1import{b as e,u as P,r as n,j as t,L as q,a as L,d as J,F as R,Q as X,R as ce}from"./app.a81fcc9b.js";import{D as he}from"./Dropdown.b9a87165.js";import{R as te}from"./index.0ad264b7.js";import{a as ke,r as Ce,e as _e}from"./ru.6d719a5c.js";import{G as Se,L as Ie,F as ae,s as re,h as Ee,R as Me}from"./RegisterFormSeller.077d4e4c.js";import{s as Ae}from"./search-normal.ec4cb010.js";import{H as Le}from"./Details.51456eed.js";import{C as Oe}from"./Close.45d537a1.js";import{u as le,C as Z}from"./index.esm.f3a3a7bd.js";import{u as K}from"./index.esm.df0a5478.js";import{C as Re}from"./index.0a570c6a.js";import"./index.min.a8661fc0.js";import{A as D}from"./index.fd86f9e9.js";import{T as me}from"./Trans.1e056b57.js";import{M as oe}from"./index.81a67292.js";import{I as de}from"./index.c322d093.js";import{p as Te}from"./index.a02999f6.js";import je from"./QuickLook.e118ab56.js";import Ve from"./DeliveryModal.b4f58f8a.js";const ye="/build/assets/user.413c7c7c.svg",qe="/build/assets/logout.3fa9bd04.svg",Fe="/build/assets/gps.4596d868.svg";function He({color:r="#2400FF",...s}){return e("svg",{width:"22",height:"16",viewBox:"0 0 22 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:s.className,children:e("path",{d:"M7.82333 12.5103C7.82333 13.9563 6.63765 15.1285 5.17505 15.1285C3.71245 15.1285 2.52677 13.9563 2.52677 12.5103M7.82333 12.5103C7.82333 11.0644 6.63765 9.89215 5.17505 9.89215C3.71245 9.89215 2.52677 11.0644 2.52677 12.5103M7.82333 12.5103H13.7819M2.52677 12.5103H1.20264V1.72851C1.20264 1.17623 1.65035 0.728516 2.20264 0.728516H13.7819V12.5103M19.7406 12.5103C19.7406 13.9563 18.5549 15.1285 17.0923 15.1285C15.6297 15.1285 14.444 13.9563 14.444 12.5103M19.7406 12.5103C19.7406 11.0644 18.5549 9.89215 17.0923 9.89215C15.6297 9.89215 14.444 11.0644 14.444 12.5103M19.7406 12.5103H20.4026V7.27397L17.0923 4.00124H13.7819V12.5103M14.444 12.5103H13.7819",stroke:r,strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function Pe({auth:r,languages:s}){var p;const{i18n:a,t:i}=P(),[N,u]=n.exports.useState(!1),[g,b]=n.exports.useState(!1),c=a.language==="az"?ke:a.language==="ru"?Ce:_e,y=async()=>{await L.post(route("logout")).then(()=>{J.Inertia.visit(i("routes:home"))}),window.location.reload()},o=d=>{const v=a.getResourceBundle(a.language,"routes"),l=window.location.pathname;if(l.includes("mehsul/")||l.includes("en/product/")||l.includes("ru/produkt/")){const f=i("routes:product",{lng:d}),m=l.split("/"),F=m[m.length-1];a.changeLanguage(d),window.history.replaceState(null,null,f+"/"+F)}else if(l.includes("kateqoriya/")||l.includes("en/category/")||l.includes("ru/kategoriya/")){const f=i("routes:category",{lng:d}),m=l.split("/"),F=m[m.length-1];a.changeLanguage(d),window.history.replaceState(null,null,f+"/"+F)}else if(l.includes("xususi-teklifler/")||l.includes("en/special-offers/")||l.includes("ru/spetsialnyye-predlozheniya/")){const f=i("routes:special-offers",{lng:d}),m=l.split("/"),F=m[m.length-1];a.changeLanguage(d),window.history.replaceState(null,null,f+"/"+F)}else{let f=Object.keys(v).find(F=>l===v[F]);a.changeLanguage(d);const m=i(`routes:${f}`,{lng:d});m&&f&&window.history.replaceState(null,null,m)}};return t("div",{className:"hidden sm:block w-full px-4 sm:px-0",children:[e("div",{className:"container mx-auto pt-4 sm:py-3",children:t("div",{className:"flex justify-between flex-row",children:[t("div",{className:"flex justify-start items-center flex-col sm:flex-row mb-2 sm:mb-0 -mx-4",children:[e("div",{className:"px-4 flex items-center border-r border-r-gray-200 last:border-0",children:e(q,{href:i("routes:suppliers","suppliers"),className:"font-normal text-sm text-black hover:text-blue-600 transition-color",children:i("common.manufacturers")})}),e("div",{className:"px-4 flex items-center border-r border-r-gray-200 last:border-0",children:e(q,{href:i("routes:terms"),className:"font-normal text-sm text-black hover:text-blue-600 transition-color",children:i("common.terms")})}),e("div",{className:"px-4 flex items-center border-r border-r-gray-200",children:e(q,{href:i("routes:contact"),className:"font-normal text-sm text-black hover:text-blue-600 transition-color",children:i("common.contacts")}
1)}),e("div",{className:"px-4 flex items-center border-r border-r-gray-200",children:e("a",{href:"https://e-gov.az/az/services/readwidenew/3505/",target:"_blank",className:"font-normal text-sm text-black hover:text-blue-600 transition-color",children:i("common.export_declaration")})}),e("div",{className:"px-4 flex items-center border-r border-r-gray-200",children:e("button",{onClick:()=>b(!0),className:"font-normal text-sm text-black hover:text-blue-600 transition-color",children:i("license.check_license")})}),e("div",{className:"px-4",children:t("button",{type:"button","data-bs-toggle":"modal","data-bs-target":"#deliveryModal",className:"flex justify-start items-center gap-3 py-2 px-4 group bg-transparent transition",children:[e(He,{}),e("span",{className:"font-normal text-sm text-blue-600",children:i("common.track_order")})]})})]}),t("div",{className:"flex items-center gap-5 sm:ml-0 justify-center sm:justify-start",children:[t("button",{onClick:()=>u(!0),className:"flex items-center gap-2 cursor-pointer hover:opacity-80 transition-opacity gps-track-btn",children:[e("img",{src:Fe,alt:"gps"}),e("div",{className:"gs1-btn-text",children:i("gs1.track_gs1_order")})]}),(r==null?void 0:r.user)&&!((p=window==null?void 0:window.location)!=null&&p.pathname.includes(i("routes:user-dashboard")))?e(q,{href:i("routes:user-dashboard"),className:"flex items-center",children:t(te,{type:"button",className:"ripple-button py-2.5 px-4 rounded bg-blue-600 text-center",children:[e("img",{src:ye,className:"w-6 h-6 float-left mr-2"}),e("span",{className:"text-sm text-white font-normal",children:i("common.dashboard")})]})}):r!=null&&r.user?t(te,{onClick:y,type:"button",className:"ripple-button py-2.5 px-4 rounded bg-blue-600 text-center",children:[e("img",{src:qe,className:"w-6 h-6 float-left mr-2"}),e("span",{className:"text-sm text-white font-normal",children:i("common.logout")})]}):t(te,{type:"button","data-bs-toggle":"modal","data-bs-target":"#loginModal",className:"ripple-button py-2.5 px-4 rounded bg-blue-600 text-center ",children:[e("img",{src:ye,className:"w-6 h-6 float-left mr-2"}),e("span",{className:"text-sm text-white font-normal",children:i("common.dashboard")})]}),e(he,{buttonImage:c,buttonText:"",items:s,onChange:d=>{o(d)}})]})]})}),e(Se,{isOpen:N,onClose:()=>u(!1)}),e(Ie,{isOpen:g,onClose:()=>b(!1)})]})}const $e="/build/assets/logo.eb152547.svg";function Be(r){return e("svg",{className:r.className,width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{className:"group-hover:stroke-blue-600 stroke-blue-600 sm:stroke-black",d:"M16.0308 4.53783L1.00098 4.53762L1 4.53788M16.0308 4.53783L16.0303 14.962C16.0303 15.9495 15.2146 16.75 14.2085 16.75H2.82185C1.81567 16.75 1 15.9495 1 14.962V4.53788M16.0308 4.53783L13.0176 1.52514C12.8414 1.34897 12.6025 1.25 12.3533 1.25H4.67699C4.42785 1.25 4.18891 1.34897 4.01274 1.52514L1 4.53788M11.3333 7.35606C11.3333 8.9125 10.0716 10.1742 8.51515 10.1742C6.95871 10.1742 5.69697 8.9125 5.69697 7.35606",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function ve(r){return t("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:r.className,children:[t("g",{"clip-path":"url(#clip0_2805_9768)",children:[e("path",{d:"M6.90594 20H2.31281C1.03754 20 0 18.9625 0 17.6872V13.0941C0 11.8188 1.03754 10.7812 2.31281 10.7812H6.90594C8.18121 10.7812 9.21875 11.8188 9.21875 13.0941V17.6872C9.21875 18.9625 8.18121 20 6.90594 20ZM7.65625 13.0941C7.65625 12.6804 7.31965 12.3438 6.90594 12.3438H2.31281C1.8991 12.3438 1.5625 12.6804 1.5625 13.0941V17.6872C1.5625 18.1009 1.8991 18.4375 2.31281 18.4375H6.90594C7.31965 18.4375 7.65625 18.1009 7.65625 17.6872V13.0941Z",className:"fill-[#2400FF] sm:fill-[#2B3644] group-hover:fill-[#2400FF]"}),e("path",{d:"M17.6562 20H13.125C11.8327 20 10.7812 18.9486 10.7812 17.6562V13.125C10.7812 11.8327 11.8327 10.7812 13.125 10.7812H17.6562C18.9486 10.7812 20 11.8327 20 13.125V17.6562C20 18.9486 18.9486 20 17.6562 20ZM18.4375 13.125C18.4375 12.6942 18.087 12.3438 17.6562 12.3438H13.125C12.6942 12.3438 12.3438 12.6942 12.3438 13.125V17.6562C12.3438 18.087 12.6942 18.4375 13.125 18.4375H17.6562C18.087 18.4375 18.4375 18.087 18.4375 17.6562V13.125Z",className:"fill-[#2400FF] sm:fill-[#2B3644] group-hover:fill-[#2400FF]"}),e("path",{d:"M6.90594 9.21875H2.31281C1.03754 9.21875 0 8.18121 0 6.90594V2.31281C0 1.03754 1.03754 0 2.31281 0H6.9
10594C8.18121 0 9.21875 1.03754 9.21875 2.31281V6.90594C9.21875 8.18121 8.18121 9.21875 6.90594 9.21875ZM7.65625 2.31281C7.65625 1.8991 7.31965 1.5625 6.90594 1.5625H2.31281C1.8991 1.5625 1.5625 1.8991 1.5625 2.31281V6.90594C1.5625 7.31965 1.8991 7.65625 2.31281 7.65625H6.90594C7.31965 7.65625 7.65625 7.31965 7.65625 6.90594V2.31281Z",className:"fill-[#2400FF] sm:fill-[#2B3644] group-hover:fill-[#2400FF]"}),e("path",{d:"M17.6562 9.21875H13.125C11.8327 9.21875 10.7812 8.16734 10.7812 6.875V2.34375C10.7812 1.05141 11.8327 0 13.125 0H17.6562C18.9486 0 20 1.05141 20 2.34375V6.875C20 8.16734 18.9486 9.21875 17.6562 9.21875ZM18.4375 2.34375C18.4375 1.91297 18.087 1.5625 17.6562 1.5625H13.125C12.6942 1.5625 12.3438 1.91297 12.3438 2.34375V6.875C12.3438 7.30578 12.6942 7.65625 13.125 7.65625H17.6562C18.087 7.65625 18.4375 7.30578 18.4375 6.875V2.34375Z",className:"fill-[#2400FF] sm:fill-[#2B3644] group-hover:fill-[#2400FF]"})]}),e("defs",{children:e("clipPath",{id:"clip0_2805_9768",children:e("rect",{width:"20",height:"20",fill:"white",transform:"matrix(1 0 0 -1 0 20)"})})})]})}function Ze({menuIsOpen:r,setMenuIsOpen:s,languages:a}){const[i,N]=n.exports.useState(0),[u,g]=n.exports.useState(!1),{i18n:b,t:c}=P(),y=b.language==="az"?ke:b.language==="ru"?Ce:_e,o=n.exports.useRef(),p=n.exports.useRef();let d=0;n.exports.useLayoutEffect(()=>{const $=o.current.offsetTop,w=()=>{var O,H,W,_,k,M,h,x,C,z,S,B;var A=window.pageYOffset||document.documentElement.scrollTop;A<=d&&A>$&&window.innerHeight+window.scrollY<document.body.offsetHeight-100?((H=(O=o.current)==null?void 0:O.classList)==null||H.add("fixed","top-0","z-[999]","left-0","bg-white","w-full","sm:border-b","border-gray-300","sm:py-[15px]"),(_=(W=p.current)==null?void 0:W.classList)==null||_.add("h-[90px]"),(M=(k=p.current)==null?void 0:k.classList)==null||M.remove("hidden")):((x=(h=o.current)==null?void 0:h.classList)==null||x.remove("fixed","top-0","z-[999]","left-0","bg-white","w-full","sm:border-b","border-gray-300","sm:py-[15px]"),(z=(C=p.current)==null?void 0:C.classList)==null||z.remove("h-[90px]"),(B=(S=p.current)==null?void 0:S.classList)==null||B.remove("add")),d=A<=0?0:A};window.addEventListener("scroll",w),J.Inertia.on("navigate",()=>{document.body.classList.remove("lock-scroll")})},[]);const{data:v}=K("/jsonapi/basket?locale=az",L.get,{revalidateOnFocus:!1});n.exports.useEffect(()=>{var $,w,A,O,H;if(v){const W=(H=(O=(A=(w=($=v==null?void 0:v.data)==null?void 0:$.data)==null?void 0:w.relationships)==null?void 0:A["basket/product"])==null?void 0:O.data)==null?void 0:H.length;N(W)}},[v]);const l=le({mode:"onChange",defaultValues:{keyword:""}}),f=()=>{J.Inertia.visit(`${c("routes:search-product")}?keyword=${l.watch("keyword")}&catalog=${l.watch("catalog")}`)},[m,F]=n.exports.useState(null),{data:E}=K(`/get-categories?locale=${b.language}`,L.get,{revalidateOnFocus:!1});n.exports.useEffect(async()=>{E&&F(E==null?void 0:E.data)},[E]);const j=$=>{const w=b.getResourceBundle(b.language,"routes"),A=window.location.pathname;let O=Object.keys(w).find(W=>w[W]===A);b.changeLanguage($);const H=c(`routes:${O}`,{lng:$});H&&O&&window.history.replaceState(null,null,H)};return t(R,{children:[t("div",{ref:o,children:[e("div",{className:"container mx-auto py-4 sm:py-0",children:t("div",{className:"flex items-center justify-between flex-row px-4 pl-2 sm:px-0 gap-6 sm:gap-0",children:[e("button",{onClick:()=>{r?document.body.classList.remove("lock-scroll"):document.body.classList.add("lock-scroll"),s(!r)},className:"sm:hidden h-[42px] w-[42px] flex items-center text-sm text-black group hover:text-blue-600 transition rounded justify-center items-center p-0 group",children:r?e(Oe,{className:"w-[15px]"}):e(ve,{className:"float-left mr-0 sm:mr-2"})}),e("div",{children:e(q,{href:c("routes:home"),children:e("img",{src:$e})})}),t("div",{className:"flex items-center flex-row gap-2 sm:gap-0",children:[t("button",{onClick:()=>s(!0),className:"hidden sm:flex items-center text-sm text-black group hover:text-blue-600 transition rounded justify-center items-center p-2 sm:p-0 group",children:[e(ve,{className:"float-left mr-0 sm:mr-2 group-hover:scale-110 transition"}),e("span",{className:"hidden text-sm sm:inline",children:c("common.categories")})]}),t("div",{className:"ml-14 mr-11 hidden sm:flex items-center p-1 rounded border border-[#F4F6F8] bg-[#F4F6F8] focus-within:border-blue-600",children:[e("div",{className:"flex items-center rounded-l text-xs text-gray-500 border-r-[#E4EBF1] pr-1 border-r max-w-[90px]",children:e(Z,{control:l.control,name:"catalog",render:({field:{onCh
1ange:$,value:w}})=>e(he,{buttonText:w||"Ham\u0131s\u0131",onChange:A=>{A?l.setValue("catalog",A):l.setValue("catalog",null)},customClassContainer:"bg-[#F4F6F8] max-w-[80px] z-[49]",customClass:"w-[475px] left-0 -ml-[10px] -mt-[10px!important] ",customClassInner:"grid grid-cols-2",customClassIcon:"ml-4 mr-1",customClassBtn:"text-ellipsis w-[85px] pl-2 whitespace-nowrap overflow-hidden bg-transparent",customSelectedClass:"text-blue-600 before-close-icon relative pl-[23px]",items:m?m.map(A=>({label:A.title,value:A.id})):[],textSize:"text-xs"})})}),e(Z,{control:l.control,name:"keyword",render:({field:{onChange:$,value:w}})=>e("input",{type:"text",className:"bg-[#F4F6F8] block flex-1 border-0 focus:ring-0 h-9 text-xs sm:w-80 placeholder:text-[#B0BDC8] placeholder:font-normal",placeholder:c("home.search_product"),onChange:$,value:w,onKeyDown:A=>{A.key==="Enter"&&f()}})}),e("div",{className:"flex items-center px-3.5 py-1.5 border-l-[#E4EBF1] border-l h-full",children:e("button",{type:"button",onClick:f,children:e("img",{src:Ae,className:"w-5 h-5"})})})]}),t("div",{className:"flex items-center gap-2 sm:gap-6",children:[e("button",{onClick:()=>g(!0),className:"flex items-center gap-2 cursor-pointer hover:opacity-80 transition-opacity gps-track-mobile",children:e("img",{src:Fe,alt:"gps"})}),t(q,{href:c("routes:wishlist"),className:"hidden sm:flex text-sm text-black text-normal hover:text-blue-600 transition group bg-blue-100 rounded sm:bg-transparent justify-center items-center p-2 sm:p-0",children:[e(Le,{className:"mr-0 sm:mr-3 w-5 group-hover:scale-110 transition"}),e("span",{className:"hidden sm:inline",children:c("common.wishlist")})]}),t(q,{href:c("routes:cart"),className:"relative text-sm text-black text-normal flex h-[42px] w-[42px] sm:w-auto sm:h-auto hover:text-blue-600 transition group bg-[#F4F6F8] rounded-lg sm:bg-transparent justify-center items-center p-2 sm:p-0 mr-2 sm:mr-0",children:[e(Be,{className:"mr-0 sm:mr-3 w-5 group-hover:scale-110 transition"}),i>0&&e("span",{className:"absolute bg-[#FF0000] text-white rounded-full text-xs w-[16px] h-[16px] text-center sm:-top-2.5 top-0 right-0 sm:left-4",children:i}),e("span",{className:"hidden sm:inline",children:c("common.cart")})]}),e("div",{className:"sm:hidden",children:e(he,{buttonImage:y,buttonText:"",items:a,onChange:$=>{j($)},customClassInner:"rounded-xl"})})]})]})]})}),e(Se,{isOpen:u,onClose:()=>g(!1)})]}),e("div",{className:"hidden",ref:p})]})}function We({menuIsOpen:r,setMenuIsOpen:s,auth:a}){const[i,N]=n.exports.useState(null),{i18n:u}=P(),{data:g}=K("/jsonapi/locale",L.get,{revalidateOnFocus:!1});return n.exports.useEffect(()=>{var b,c,y;g&&N((y=(c=(b=g.data)==null?void 0:b.data)==null?void 0:c.filter(o=>{var p;return u.language!==((p=o==null?void 0:o.attributes)==null?void 0:p["locale.languageid"])}))==null?void 0:y.map(o=>{var p,d;return{label:(p=o==null?void 0:o.attributes)==null?void 0:p["locale.languageid"].toUpperCase(),value:(d=o==null?void 0:o.attributes)==null?void 0:d["locale.languageid"]}}))},[g,u.language]),t(R,{children:[e(Pe,{auth:a,languages:i}),e(Ze,{menuIsOpen:r,setMenuIsOpen:s,languages:i})]})}function Ue(r){const{t:s}=P();return e("div",{className:"flex bg-[#060709] items-center justify-center pb-[75px] sm:pb-6 py-6 px-3",children:t("span",{className:"text-white text-xs font-normal text-center",children:[s("common.copyright")," \xA9 2023"]})})}const Ge="/build/assets/pin.ddd72ed9.svg",Qe="/build/assets/phone.02ccf1d9.svg",Ye="/build/assets/envelope.0c6c025c.svg",Ke="/build/assets/logo-footer.a94c0a4d.svg",Xe="/build/assets/mastercard.634c89a3.svg",Je="/build/assets/visa.721910f2.svg";var De={prefix:"fab",iconName:"square-instagram",icon:[448,512,["instagram-square"],"e055","M224,202.66A53.34,53.34,0,1,0,277.36,256,53.38,53.38,0,0,0,224,202.66Zm124.71-41a54,54,0,0,0-30.41-30.41c-21-8.29-71-6.43-94.3-6.43s-73.25-1.93-94.31,6.43a54,54,0,0,0-30.41,30.41c-8.28,21-6.43,71.05-6.43,94.33S91,329.26,99.32,350.33a54,54,0,0,0,30.41,30.41c21,8.29,71,6.43,94.31,6.43s73.24,1.93,94.3-6.43a54,54,0,0,0,30.41-30.41c8.35-21,6.43-71.05,6.43-94.33S357.1,182.74,348.75,161.67Z
1M224,338a82,82,0,1,1,82-82A81.9,81.9,0,0,1,224,338Zm85.38-148.3a19.14,19.14,0,1,1,19.13-19.14A19.1,19.1,0,0,1,309.42,189.74ZM400,32H48A48,48,0,0,0,0,80V432a48,48,0,0,0,48,48H400a48,48,0,0,0,48-48V80A48,48,0,0,0,400,32ZM382.88,322c-1.29,25.63-7.14,48.34-25.85,67s-41.4,24.63-67,25.85c-26.41,1.49-105.59,1.49-132,0-25.63-1.29-48.26-7.15-67-25.85s-24.63-41.42-25.85-67c-1.49-26.42-1.49-105.61,0-132,1.29-25.63,7.07-48.34,25.85-67s41.47-24.56,67-25.78c26.41-1.49,105.59-1.49,132,0,25.63,1.29,48.33,7.15,67,25.85s24.63,41.42,25.85,67.05C384.37,216.44,384.37,295.56,382.88,322Z"]},et={prefix:"fab",iconName:"linkedin-in",icon:[448,512,[],"f0e1","M100.28 448H7.4V148.9h92.88zM53.79 108.1C24.09 108.1 0 83.5 0 53.8a53.79 53.79 0 0 1 107.58 0c0 29.7-24.1 54.3-53.79 54.3zM447.9 448h-92.68V302.4c0-34.7-.7-79.2-48.29-79.2-48.29 0-55.69 37.7-55.69 76.7V448h-92.78V148.9h89.08v40.8h1.3c12.4-23.5 42.69-48.3 87.88-48.3 94 0 111.28 61.9 111.28 142.3V448z"]},tt={prefix:"fab",iconName:"square-facebook",icon:[448,512,["facebook-square"],"f082","M400 32H48A48 48 0 0 0 0 80v352a48 48 0 0 0 48 48h137.25V327.69h-63V256h63v-54.64c0-62.15 37-96.48 93.67-96.48 27.14 0 55.52 4.84 55.52 4.84v61h-31.27c-30.81 0-40.42 19.12-40.42 38.73V256h68.78l-11 71.69h-57.78V480H400a48 48 0 0 0 48-48V80a48 48 0 0 0-48-48z"]},st={prefix:"fab",iconName:"whatsapp",icon:[448,512,[],"f232","M380.9 97.1C339 55.1 283.2 32 223.9 32c-122.4 0-222 99.6-222 222 0 39.1 10.2 77.3 29.6 111L0 480l117.7-30.9c32.4 17.7 68.9 27 106.1 27h.1c122.3 0 224.1-99.6 224.1-222 0-59.3-25.2-115-67.1-157zm-157 341.6c-33.2 0-65.7-8.9-94-25.7l-6.7-4-69.8 18.3L72 359.2l-4.4-7c-18.5-29.4-28.2-63.3-28.2-98.2 0-101.7 82.8-184.5 184.6-184.5 49.3 0 95.6 19.2 130.4 54.1 34.8 34.9 56.2 81.2 56.1 130.5 0 101.8-84.9 184.6-186.6 184.6zm101.2-138.2c-5.5-2.8-32.8-16.2-37.9-18-5.1-1.9-8.8-2.8-12.5 2.8-3.7 5.6-14.3 18-17.6 21.8-3.2 3.7-6.5 4.2-12 1.4-32.6-16.3-54-29.1-75.5-66-5.7-9.8 5.7-9.1 16.3-30.3 1.8-3.7.9-6.9-.5-9.7-1.4-2.8-12.5-30.1-17.1-41.2-4.5-10.8-9.1-9.3-12.5-9.5-3.2-.2-6.9-.2-10.6-.2-3.7 0-9.7 1.4-14.8 6.9-5.1 5.6-19.4 19-19.4 46.3 0 27.3 19.9 53.7 22.6 57.4 2.8 3.7 39.1 59.7 94.8 83.8 35.2 15.2 49 16.5 66.6 13.9 10.7-1.6 32.8-13.4 37.4-26.4 4.6-13 4.6-24.1 3.2-26.4-1.3-2.5-5-3.9-10.5-6.6z"]},at={prefix:"fab",iconName:"youtube",icon:[576,512,[61802],"f167","M549.655 124.083c-6.281-23.65-24.787-42.276-48.284-48.597C458.781 64 288 64 288 64S117.22 64 74.629 75.486c-23.497 6.322-42.003 24.947-48.284 48.597-11.412 42.867-11.412 132.305-11.412 132.305s0 89.438 11.412 132.305c6.281 23.65 24.787 41.5 48.284 47.821C117.22 448 288 448 288 448s170.78 0 213.371-11.486c23.497-6.321 42.003-24.171 48.284-47.821 11.412-42.867 11.412-132.305 11.412-132.305s0-89.438-11.412-132.305zm-317.51 213.508V175.185l142.739 81.205-142.739 81.201z"]},rt={prefix:"fab",iconName:"twitter",icon:[512,512,[],"f099","M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z"]};function lt(){var i,N,u,g,b,c,y,o,p,d,v,l,f,m,F;const{i18n:r,t:s}=P(),{data:a}=K("/site-settings-data",L.get,{revalidateOnFocus:!1});return t("div",{className:"grid sm:grid-cols-4 py-8 pt-5 gap-x-5 gap-y-5 sm:gap-y-11 px-4 sm:px-0",children:[t("div",{className:"text-black flex flex-col",children:[e("span",{className:"text-[27px] font-bold",children:"azexport.az"}),e("span",{className:"text-xs font-normal leading-none",children:"Made in Azerbaijan"})]}),t("div",{className:"flex items-center justify-start gap-3",children:[e("img",{src:Ge,className:"h-11"}),e("span",{className:"text-black text-sm font-normal max-w-[200px]",children:(i=a==null?void 0:a.data)==null?void 0:i[`address_${r.language}`]})]}),t("div",{className:"flex items-center justify-start gap-3",children:[e("img",{src:Qe,className:"h-11"}),e("span",{className:"text-black text-sm font-normal max-w-[200px]",children:(N=a==null?void 0:a.data)==null?void 0:N.phone})]}),t("div",{className:"flex items-center justify-start gap-3",children:[e("img",{src:Ye,className:"h-11"}),e("span",{className:"text-black text-sm font-normal max-w-[200px]",children:(u=a==null?void 0:a.data)==null?void 0:u.email})]}),t("div",{className:"flex flex-row w-full gap-8 mt-3 sm:mt-0 sm:gap-0 sm:col-span-2 sm:grid sm:grid-cols-2",children:[t("div",{className:"flex flex-col",children:[e("span",{className:"text-black text-lg font-bold leading-loose",children:s("common.info")}),e(q,{href:s("routes:about"),className:"text-sm font-normal leading-loose text-black",children:s("common.about_us")}
1),e(q,{href:s("routes:terms"),className:"text-sm font-normal leading-loose text-black",children:s("common.terms")}),e(q,{href:s("routes:faq"),className:"text-sm font-normal leading-loose text-black",children:s("common.faq")}),e(q,{href:s("routes:contact"),className:"text-sm font-normal leading-loose text-black",children:s("common.contacts")})]}),t("div",{className:"flex flex-col",children:[e("span",{className:"text-black text-lg font-bold leading-loose text-black",children:s("common.for_customers")}),e(q,{href:s("routes:suppliers"),className:"text-sm font-normal leading-loose text-black",children:s("common.manufacturers")}),e(q,{href:s("routes:wishlist"),className:"text-sm font-normal leading-loose text-black",children:s("common.wishlist")})]})]}),t("div",{className:"flex flex-col gap-y-4",children:[e("span",{className:"text-black text-lg font-bold leading-loose",children:s("common.follow_us")}),t("div",{className:"flex gap-x-2",children:[((g=a==null?void 0:a.data)==null?void 0:g.facebook)&&e("a",{target:"_blank",className:"bg-[#F4F6F8] h-[40px] w-[40px] flex justify-center items-center rounded-lg",href:(b=a==null?void 0:a.data)==null?void 0:b.facebook,children:e(ae,{icon:tt,color:"#2B3644",className:"text-2xl sm:text-xl"})}),((c=a==null?void 0:a.data)==null?void 0:c.instagram)&&e("a",{target:"_blank",className:"bg-[#F4F6F8] h-[40px] w-[40px] flex justify-center items-center rounded-lg",href:(y=a==null?void 0:a.data)==null?void 0:y.instagram,children:e(ae,{icon:De,className:"text-2xl sm:text-xl",color:"#2B3644"})}),((o=a==null?void 0:a.data)==null?void 0:o.whatsapp)&&e("a",{target:"_blank",className:"bg-[#F4F6F8] h-[40px] w-[40px] flex justify-center items-center rounded-lg",href:(p=a==null?void 0:a.data)==null?void 0:p.whatsapp,children:e(ae,{icon:st,className:"text-2xl sm:text-xl",color:"#2B3644"})}),((d=a==null?void 0:a.data)==null?void 0:d.youtube)&&e("a",{target:"_blank",className:"bg-[#F4F6F8] h-[40px] w-[40px] flex justify-center items-center rounded-lg",href:(v=a==null?void 0:a.data)==null?void 0:v.youtube,children:e(ae,{icon:at,className:"text-2xl sm:text-xl",color:"#2B3644"})}),((l=a==null?void 0:a.data)==null?void 0:l.twitter)&&e("a",{target:"_blank",className:"bg-[#F4F6F8] h-[40px] w-[40px] flex justify-center items-center rounded-lg",href:(f=a==null?void 0:a.data)==null?void 0:f.twitter,children:e(ae,{icon:rt,className:"text-2xl sm:text-xl",color:"#2B3644"})}),((m=a==null?void 0:a.data)==null?void 0:m.linkedin)&&e("a",{target:"_blank",className:"bg-[#F4F6F8] h-[40px] w-[40px] flex justify-center items-center rounded-lg",href:(F=a==null?void 0:a.data)==null?void 0:F.linkedin,children:e(ae,{icon:et,className:"text-2xl sm:text-xl",color:"#2B3644"})})]}),t("div",{className:"flex items-center gap-2 mt-2",children:[e("img",{src:Ke,className:"h-6"}),e("span",{className:"font-sm text-black font-normal text-xs",children:s("common.footer_info")})]})]}),t("div",{className:"hidden sm:flex flex-col gap-y-4",children:[e("span",{className:"text-black text-lg font-bold leading-loose",children:"\xA0"}),t("div",{className:"flex gap-x-4 items-center",children:[e("img",{src:Xe,className:"h-9"}),e("img",{src:Je,className:"h-5"})]})]})]})}function ot({productCounts:r}){const[s,a]=n.exports.useState(null),{i18n:i,t:N}=P(),{data:u}=K(`/get-categories?locale=${i.language}`,L.get,{revalidateOnFocus:!1}),g=function(c,y){var o=new Date(c.count),p=new Date(y.count);return o<p?1:o>p?-1:0},b=c=>{const y=c.map(o=>{var p;return{...o,count:r[o.id]||0,subMenu:(p=o.subMenu)==null?void 0:p.map(d=>({...d,count:r[d.id]||0})).slice(0,3)}});return y.sort(g),y.map(o=>{var p;(p=o.subMenu)==null||p.sort(g)}),y};return n.exports.useEffect(async()=>{if(u){const c=b(u==null?void 0:u.data);a(c)}},[u]),e("div",{className:"hidden sm:block bg-[#1C1F22] text-white",children:e("div",{className:"container mx-auto pb-9 pt-14",children:t("div",{className:"grid grid-cols-2 sm:grid-cols-5 gap-y-9 leading-loose px-4 sm:px-0",children:[t("div",{className:"flex flex-col",children:[e("span",{className:"font-bold text-xs mb-1",children:N("common.register")}),e(q,{className:"font-normal text-2xs",type:"button","data-bs-toggle":"modal","data-bs-target":"#loginModal",children:N("common.register_buyer")}),e(q,{className:"font-normal text-2xs",type:"button","data-bs-toggle":"modal","data-bs-target":"#loginModal",children:N("common.register_seller")})]}),s==null?void 0:s.map((c,y)=>{var o;return t("div",{className:"flex flex-col",children:[e("span",{className:"font-bold text-xs mb-1",children:c.title}),(o=c==null?void 0:c.subMenu)==null?void 0:o.map((p,d)=>e(q,{href:`${N("routes:category")}/${p.id}`,className:"font-normal text-2xs",children:p.title},d))]},y)})]})})})}
1function nt({productCounts:r}){return t(R,{children:[e("div",{className:"container mx-auto",children:e(lt,{})}),e(ot,{productCounts:r}),e(Ue,{})]})}const it=({items:r})=>e("div",{className:"hidden sm:block container mx-auto py-4 px-4 sm:px-0",children:e("nav",{className:"bg-grey-light rounded-md w-full",children:e("ol",{className:"list-reset flex justify-start items-center sm:items-start gap-6",children:r==null?void 0:r.map((s,a)=>e("li",{className:"relative after:content-[''] after:bg-blue-600 after:absolute after:w-[9px] after:h-[1px] after:right-[-1rem] after:top-[55%] last:after:hidden",children:s.href?e(q,{href:s.href,className:"text-[#BCC6D1] hover:text-blue-600 font-normal text-xs",children:s.title}):e("span",{className:"text-black font-normal text-xs",children:s.title})},a))})})});function dt(){const{t:r}=P(),[s,a]=n.exports.useState(!1);return t(R,{children:[t("div",{className:"flex sm:hidden flex-col items-start flex-col mb-2 -mx-4 gap-y-4 mt-4 pb-16",children:[e("div",{className:"px-4 flex items-center border-0 sm:border-r border-r-gray-200 last:border-0",children:e(q,{href:r("routes:suppliers"),className:"font-normal text-sm text-black hover:text-blue-600 transition-color",children:r("common.manufacturers")})}),e("div",{className:"px-4 flex items-center border-0 sm:border-r border-r-gray-200 last:border-0",children:e(q,{href:r("routes:terms"),className:"font-normal text-sm text-black hover:text-blue-600 transition-color",children:r("common.terms")})}),e("div",{className:"px-4 flex items-center border-0 sm:border-r border-r-gray-200 last:border-0",children:e("button",{onClick:()=>a(!0),className:"font-normal text-sm text-black hover:text-blue-600 transition-color",children:r("license.check_license")})}),e("div",{className:"px-4 flex items-center last:border-0",children:e(q,{href:r("routes:contact"),className:"font-normal text-sm text-black hover:text-blue-600 transition-color",children:r("common.contacts")})})]}),e(Ie,{isOpen:s,onClose:()=>a(!1)})]})}function ct({topOffset:r,menuHeight:s,menuIsOpen:a,setMenuIsOpen:i,productCounts:N}){const u=n.exports.useRef(),{i18n:g}=P();n.exports.useLayoutEffect(()=>{u.current.style.top=`${r||180}px`},[]),n.exports.useLayoutEffect(()=>{a?u.current.style.height=`${s+30>370?s+30:370}px`:u.current.style.height="0px"},[a]);const{data:b,isLoading:c}=K(`/jsonapi/catalog?locale=${g.language}&include=catalog,text,media&sort=c.label`,L.get,{revalidateOnFocus:!1});return e("div",{className:a?"fixed bg-transparent sm:bg-[#001432]/[.65] z-[999] top-[100px] sm:top-0 left-0 h-full w-full visible opacity-100":"fixed bg-[#001432]/[.65] z-[999] top-0 left-0 h-full w-full invisible opacity-0",onClick:y=>{var o;i(!((o=y==null?void 0:y.target)!=null&&o.className.includes("fixed")))},id:"fixedOverlayMenu",children:e("div",{className:"container relative mx-auto",children:e("div",{className:a?"overlay-menu min-h-[410px] bg-white absolute left-0 py-3 pt-0 px-6 -mt-5 h-[368px] sm:transition-all sm:delay-100 sm:duration-300 hover:shadow-[0px_15px_16px_rgba(0,0,0,0.25)] w-full sm:w-auto sm:pt-3":"bg-white absolute left-0 py-5 px-6 -mt-5 h-0 sm:transition-all sm:delay-100 sm:duration-300",ref:u,children:t("div",{className:a?"opacity-100":"opacity-0 pointer-events-none",children:[b&&e(Re,{categoryMenuRef:u,data:b,productCounts:N}),e(dt,{})]})})})})}function Ne({setModalClose:r}){const{t:s}=P(),[a,i]=n.exports.useState(!1),[N,u]=n.exports.useState(!1),{control:g,handleSubmit:b,reset:c,watch:y,formState:o}=le({mode:"onChange",defaultValues:{email:"",password:"",remember:""}}),p=o.errors;n.exports.useEffect(()=>()=>{c("password")},[]);const d=b(v=>{i(!0),L.post(route("login"),v).then(l=>{r(!0),J.Inertia.visit(s("routes:user-dashboard"))}).catch(l=>{var f,m,F;console.log(l),((f=l==null?void 0:l.response)==null?void 0:f.status)===422?u((F=(m=l==null?void 0:l.response)==null?void 0:m.data)==null?void 0:F.message):u(s("errors.system_error"))}).finally(()=>{i(!1)})});return t("form",{autoComplete:"false",children:[N&&e(D,{type:"danger",text:N,hasIcon:!0}),t("div",{className:"grid sm:grid-cols-2 gap-x-4 gap-y-6",children:[t("div",{children:[e("label",{className:"text-sm font-normal text-black block mb-2",children:s("authorization.email")}
1),e(Z,{control:g,name:"email",render:({field:{onChange:v,value:l}})=>{var f;return t(R,{children:[e("input",{type:"email",className:"border border-gray-300 focus:ring-0 h-14 rounded w-full",onChange:v,value:l}),p.email&&e("span",{className:"text-red-600",children:(f=p.email)==null?void 0:f.message})]})},rules:{required:{value:!0,message:s("common.required_field")}}})]}),t("div",{children:[e("label",{className:"text-sm font-normal text-black block mb-2",children:s("authorization.password")}),e(Z,{control:g,name:"password",render:({field:{onChange:v,value:l}})=>{var f;return t(R,{children:[e("input",{type:"password",className:"border border-gray-300 focus:ring-0 h-14 rounded w-full",onChange:v,value:l}),p.password&&e("span",{className:"text-red-600",children:(f=p.password)==null?void 0:f.message})]})},rules:{required:{value:!0,message:s("common.required_field")}}})]}),e("div",{className:"flex items-center",children:t("label",{children:[e(Z,{control:g,name:"remember",render:({field:{onChange:v,value:l}})=>e("input",{type:"checkbox",className:"border-gray-300 rounded",value:"1",onChange:f=>v(f.target.checked)})}),e("span",{className:"text-sm text-black font-normal ml-2",children:s("authorization.remember_me")})]})}),e("div",{children:e(te,{onClick:d,isLoading:a,className:"ripple-button bg-blue-600 text-sm text-white font-normal uppercase w-full p-4 rounded",children:s("authorization.sign_in")})})]})]})}function pe({isLogin:r}){const{t:s}=P();return e("div",{className:"flex mt-5 flex-col sm:flex-row sm:mt-12 text-base font-normal text-black justify-between",children:r?t(R,{children:[e("div",{children:e(me,{i18nKey:"authorization.register_text",components:[e("button",{type:"button","data-bs-toggle":"modal","data-bs-target":"#registerModal",className:"text-blue-500 text-base"})]})}),e("div",{className:"hidden sm:block border-gray-300 border-r w-[1px] h-[22px]"}),e("div",{children:e("button",{type:"button",className:"text-blue-500 text-base mt-2 sm:mt-0","data-bs-toggle":"modal","data-bs-target":"#forgotPassModal",children:s("authorization.forgot_password")})})]}):e("div",{children:e(me,{i18nKey:"authorization.login_text",components:[e("button",{type:"button","data-bs-toggle":"modal","data-bs-target":"#loginModal",className:"text-blue-500 text-base"})]})})})}const fe="/build/assets/asan-logo.6d931413.svg",ut="/build/assets/mygov-login.8553f3e2.svg",mt="/build/assets/mygov-login-hover.7149fb90.svg";function pt({}){const{t:r,i18n:s}=P(),[a,i]=n.exports.useState(!1),N=typeof window<"u"&&new URLSearchParams(window.location.search).has("mygov_error");return e("div",{className:"modal fade fixed top-0 left-0 hidden w-full h-full outline-none overflow-x-hidden overflow-y-auto",id:"loginModal",tabIndex:"-1","aria-labelledby":"loginModalTitle","aria-modal":"true",role:"dialog",children:e(oe,{modalClose:a,bodyHeight:(window==null?void 0:window.innerWidth)<=767?"100vh":"auto",children:t("div",{className:"px-4 sm:px-0 flex flex-col justify-center sm:block h-full",children:[e("h1",{className:"text-[28px] font-medium text-black mb-3",children:r("authorization.sign_in")}),t("ul",{className:"nav nav-pills flex gap-3 flex-wrap list-none pl-0 mb-4 login-tabs",id:"pills-tab2",role:"tablist",children:[e("li",{className:"nav-item",role:"presentation",children:e("a",{href:"#pills-home222",className:" nav-link block font-normal text-2sm leading-tight rounded px-8 py-4 my-2 md:mr-2 focus:outline-none focus:ring-0 active ",id:"pills-home222-tab","data-bs-toggle":"pill","data-bs-target":"#pills-home222",role:"tab","aria-controls":"pills-home222","aria-selected":"true",children:r("authorization.buyer_account")})}),e("li",{className:"nav-item",role:"presentation",children:e("a",{href:"#pills-profile222",className:" nav-link block font-normal text-2sm leading-tight rounded px-8 py-4 my-2 md:mx-2 focus:outline-none focus:ring-0 bg-white ",id:"pills-profile222-tab","data-bs-toggle":"pill","data-bs-target":"#pills-profile222",role:"tab","aria-controls":"pills-profile222","aria-selected":"false",children:r("authorization.seller_account")})})]}),t("div",{className:"tab-content",id:"pills-tab2Content",children:[t("div",{className:"tab-pane fade show active",id:"pills-home222",role:"tabpanel","aria-labelledby":"pills-home222-tab",children:[N&&e(D,{type:"danger",text:r("authorization.mygov_error"),hasIcon:!0}),t("div",{className:"flex items-start flex-col gap-y-5",children:[t("a",{href:`/auth/mygov/redirect?locale=${s.language}`,className:"group block rounded",children:[e("img",{src:ut,alt:"MyGov ID",className:"group-hover:hidden"}),e("img",{src:mt,alt:"MyGov ID",className:"hidden group-hover:block"})]}),e("div",{className:"flex justify-center w-full border-b border-gray-300 relative mt-[10px] mb-[20px]",children:e("span",{className:"absolute bottom-[-10px] bg-white px-3",children:r("authorization.or")}
1)})]}),e(Ne,{setModalClose:i})]}),t("div",{className:"tab-pane fade",id:"pills-profile222",role:"tabpanel","aria-labelledby":"pills-profile222-tab",children:[t("div",{className:"flex items-start flex-col gap-y-5",children:[e("button",{type:"button","data-bs-toggle":"modal","data-bs-target":"#asanLoginModal",className:"rounded p-3 w-auto",style:{boxShadow:"0px 8px 16px rgba(0, 0, 0, 0.04)"},children:e("img",{src:fe})}),e("div",{className:"flex justify-center w-full border-b border-gray-300 relative mt-[10px] mb-[20px]",children:e("span",{className:"absolute bottom-[-10px] bg-white px-3",children:r("authorization.or")})})]}),e(Ne,{setModalClose:i})]})]}),e(pe,{isLogin:!0})]})})})}function ft({setModalClose:r}){const{t:s}=P(),[a,i]=n.exports.useState(!1),[N,u]=n.exports.useState(!1),{formState:g,control:b,handleSubmit:c,reset:y,watch:o,setError:p}=le({mode:"onChange",defaultValues:{firstname:"",lastname:"",telephone:"",email:"",password:"",password_confirmation:"",agree:!1}}),d=g.errors;return n.exports.useEffect(()=>()=>{y({password:"",password_confirmation:""})},[]),t("form",{onSubmit:c((l,f)=>{i(!0),f.preventDefault(),grecaptcha.ready(function(){grecaptcha.execute("6LdGrRkkAAAAALr6n1rrPIyavuTMgsnQrpq33O0p",{action:"registerForm"}).then(function(m){const F={firstname:l.firstname,lastname:l.lastname,name:l.firstname+" "+l.lastname,email:l.email,telephone:l.telephone,password:l.password,password_confirmation:l.password_confirmation,cToken:m};L.post(route("register"),F).then(async E=>{r(!0),X.success("Qeydiyyat m\xFCv\u0259ff\u0259qiyy\u0259tl\u0259 tamamland\u0131!",{position:X.POSITION.TOP_CENTER,autoClose:4e3,theme:"colored"}),J.Inertia.visit(s("routes:user-dashboard"))}).catch(E=>{var j,$,w,A,O,H;if(console.log(E),((j=E==null?void 0:E.response)==null?void 0:j.status)===422){u((w=($=E==null?void 0:E.response)==null?void 0:$.data)==null?void 0:w.message);const W=(O=(A=E==null?void 0:E.response)==null?void 0:A.data)==null?void 0:O.errors;(H=Object.keys(W))==null||H.map(_=>{var k;p(_,{type:"custom",message:(k=W[_])==null?void 0:k[0]})})}else u(s("errors.system_error"))}).finally(()=>{i(!1)})}).catch(m=>{i(!1)})})}),children:[N&&e(D,{type:"danger",text:N,hasIcon:!0}),t("div",{className:"grid sm:grid-cols-2 gap-x-4 gap-y-6",children:[t("div",{children:[e("label",{className:"text-sm font-normal text-black block mb-2",children:s("authorization.name")}),e(Z,{control:b,name:"firstname",render:({field:{onChange:l,value:f}})=>{var m;return t(R,{children:[e("input",{className:d.firstname?"border border-red-500 focus:ring-0 h-14 rounded w-full":"border border-gray-300 focus:ring-0 h-14 rounded w-full",onChange:l,value:f,type:"text",name:"firstname"}),d.firstname&&e("span",{className:"text-red-600",children:(m=d.firstname)==null?void 0:m.message})]})},rules:{required:{value:!0,message:s("common.required_field")}}})]}),t("div",{children:[e("label",{className:"text-sm font-normal text-black block mb-2",children:s("authorization.lastname")}),e(Z,{control:b,name:"lastname",render:({field:{onChange:l,value:f}})=>{var m;return t(R,{children:[e("input",{className:d.lastname?"border border-red-500 focus:ring-0 h-14 rounded w-full":"border border-gray-300 focus:ring-0 h-14 rounded w-full",onChange:l,value:f,type:"text",name:"lastname"}),d.lastname&&e("span",{className:"text-red-600",children:(m=d.lastname)==null?void 0:m.message})]})},rules:{required:{value:!0,message:s("common.required_field")}}})]}),t("div",{children:[e("label",{className:"text-sm font-normal text-black block mb-2",children:s("authorization.email")}),e(Z,{control:b,name:"email",render:({field:{onChange:l,value:f}})=>{var m;return t(R,{children:[e("input",{className:d.email?"border border-red-500 focus:ring-0 h-14 rounded w-full":"border border-gray-300 focus:ring-0 h-14 rounded w-full",onChange:l,value:f,type:"text",name:"email"}),d.email&&e("span",{className:"text-red-600",children:(m=d.email)==null?void 0:m.message})]})},rules:{required:{value:!0,message:s("common.required_field")},pattern:{value:/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/,message:"Yaln\u0131\u015F email"}}})]}),t("div",{children:[e("label",{className:"text-sm font-normal text-black block mb-2",children:s("authorization.phone")}
1),e(Z,{control:b,name:"telephone",render:({field:{onChange:l,value:f}})=>{var m;return t(R,{children:[e(de,{mask:"(+994) 88-888-8888",onChange:l,value:f,className:d.telephone?"outline-none px-2 text-sm border border-red-500 focus:ring-0 h-14 rounded w-full":"outline-none px-2 text-sm border border-gray-300 focus:ring-0 h-14 rounded w-full",formatChars:{8:"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"},children:F=>e("input",{...F})}),d.telephone&&e("span",{className:"text-red-600",children:(m=d.telephone)==null?void 0:m.message})]})},rules:{required:{value:!0,message:s("common.required_field")}}})]}),t("div",{children:[e("label",{className:"text-sm font-normal text-black block mb-2",children:s("authorization.password")}),e(Z,{control:b,name:"password",render:({field:{onChange:l,value:f}})=>{var m;return t(R,{children:[e("input",{className:d.password?"border border-red-500 focus:ring-0 h-14 rounded w-full":"border border-gray-300 focus:ring-0 h-14 rounded w-full",onChange:l,value:f,type:"password",autoComplete:"new-password"}),d.password&&e("span",{className:"text-red-600",children:(m=d.password)==null?void 0:m.message})]})},rules:{required:{value:!0,message:s("common.required_field")},pattern:{value:Te,message:s("errors.password_matches")}}})]}),t("div",{children:[e("label",{className:"text-sm font-normal text-black block mb-2",children:s("authorization.repeat_password")}),e(Z,{control:b,name:"password_confirmation",render:({field:{onChange:l,value:f}})=>{var m;return t(R,{children:[e("input",{className:d.password_confirmation?"border border-red-500 focus:ring-0 h-14 rounded w-full":"border border-gray-300 focus:ring-0 h-14 rounded w-full",onChange:l,type:"password",value:f}),d.password_confirmation&&e("span",{className:"text-red-600",children:(m=d.password_confirmation)==null?void 0:m.message})]})},rules:{required:{value:!0,message:s("common.required_field")},validate:l=>l!==o("password")?s("errors.repeat_password"):null}})]}),e("div",{className:"flex items-center",children:t("label",{children:[e(Z,{control:b,name:"agree",defaultValue:!1,render:({field:{onChange:l,value:f}})=>e("input",{type:"checkbox",className:d!=null&&d.agree?"border-red-500 rounded":"border-gray-300 rounded",onChange:()=>l(!f)}),rules:{required:{value:!0,message:s("common.required_field")}}}),e("span",{className:"text-sm text-black font-normal ml-2",children:e(me,{i18nKey:"authorization.terms_field",components:[e("a",{href:s("routes:terms"),target:"blank",className:d!=null&&d.agree?"text-red-500":"text-blue-500"})]})})]})}),e("div",{children:e(te,{isLoading:a,className:"ripple-button bg-blue-600 text-sm text-white font-normal uppercase w-full p-4 rounded",children:s("authorization.register")})})]})]})}function ht({setModalClose:r,setShowCountdown:s,setCode:a,setCertificateData:i,responseError:N,certificateList:u,certificateData:g,setisRegisterSellerOpen:b,setRegisterData:c,setIsRegisterModalOpen:y}){var M;const{t:o,i18n:p}=P(),[d,v]=n.exports.useState(!1),[l,f]=n.exports.useState(!1);n.exports.useState(""),n.exports.useState(""),n.exports.useState("");const{control:m,handleSubmit:F,reset:E,watch:j,formState:$}=le({mode:"onChange",defaultValues:{mobile_number:"",user_id:"",vatid:""}}),w=$.errors;n.exports.useEffect(()=>{E()},[]);const A=F(h=>{v(!0),L.post("/asan-imza/authenticate",{...h,mobile_number:h.mobile_number.replace(/[^0-9+]/g,""),lang:p.language}).then(x=>{var C;a((C=x.data)==null?void 0:C.verificationCode),i({mobileNumber:h.mobile_number.replace(/[^0-9+]/g,""),vatId:h.vatid.replace(/[^0-9+]/g,""),mobileNumberFormatted:h.mobile_number,userId:h.user_id}),s(!0)}).catch(x=>{var C,z;console.log(x),f((z=(C=x==null?void 0:x.response)==null?void 0:C.data)==null?void 0:z.message)}).finally(()=>{v(!1)})}),O=async()=>{var x,C,z,S,B,U,V,G,Q,T;const h=j("vatid");try{const I=await L.post("/api/check-voen",{voen:h});if(I!=null&&I.data)if(((C=(x=I.data)==null?void 0:x.response)==null?void 0:C.code)==="1109"||!I.data)setError("vatid",{type:"custom",message:(z=I.data)==null?void 0:z.response.message});else return(S=I==null?void 0:I.data)!=null&&S.is_registered?k():(c({vatId:h,name:(B=I==null?void 0:I.data)==null?void 0:B.name,address:(U=I==null?void 0:I.data)==null?void 0:U.legalAddress,district:(V=I==null?void 0:I.data)==null?void 0:V.district}),b(!0),r(!0)),{name:(G=I==null?void 0:I.data)==null?void 0:G.name,address:(Q=I==null?void 0:I.data)==null?void 0:Q.legalAddress,district:(T=I==null?void 0:I.data)==null?void 0:T.district}}catch(I){console.log(I)}},H=async(h,x,C,z,S="")=>{var V,G,Q,T,I,ee;const B=[{id:(V=j("vatid"))!=null&&V.endsWith("1")?"37252":"37253",type:"text",attributes:{"supplier.lists.type":"default","supplier.lists.config":{}}}],U={data:{type:"supplier",attributes:{"supplier.code":h,"supplier.label":x,"supplier.status":"1"},relationships:{text:{data:B}}}};try{const Y=await L.post("/admin/default/jsonadm/supplier",U),se={data:[{type:"supplier/address",attributes:{"supplier.address.parentid":(Q=(G=Y==null?void 0:Y.data)==null?void 0:G.data)==null?void 0:Q.id,"supplier.address.firstname":(T=x==null?void 0:x.split(" "))==null?void 0:T[0],"supplier.address.lastname":((I=x==null?void 0:x.split(" "))==null?void 0:I[1])||
1((ee=x==null?void 0:x.split(" "))==null?void 0:ee[0]),"supplier.address.address1":C,"supplier.address.address2":"","supplier.address.email":"","supplier.address.telephone":z,"supplier.address.postal":"","supplier.address.city":"","supplier.address.state":S,"supplier.address.countryid":"AZ","supplier.address.vatid":h,"supplier.address.latitude":"","supplier.address.longitude":""}}]};await L.post("/admin/default/jsonadm/supplier/address",se)}catch(Y){console.log(Y)}},W=async(h,x,C,z,S)=>{var B;try{await L.post("/add-user-group"),await L.post("/jsonapi/customer?related=property",{data:[{attributes:{"customer.property.type":"supplierType","customer.property.languageid":null,"customer.property.value":(B=j("vatid"))!=null&&B.endsWith("1")?"CORPORATE":"INDIVIDUAL"}}]}),await H(h,x,C,z,S)}catch(U){console.log(U),X.error(o("errors.system_error"),{position:X.POSITION.TOP_CENTER,autoClose:4e3,theme:"colored"})}},_=async(h,x,C,z,S)=>{v(!0),grecaptcha.ready(function(){grecaptcha.execute("6LdGrRkkAAAAALr6n1rrPIyavuTMgsnQrpq33O0p",{action:"registerForm"}).then(async function(B){var V,G,Q;const U={cToken:B,firstname:(V=h==null?void 0:h.split(" "))==null?void 0:V[0],lastname:((G=h==null?void 0:h.split(" "))==null?void 0:G[1])||((Q=h==null?void 0:h.split(" "))==null?void 0:Q[0]),name:h,email:z,telephone:x,address1:C,vatid:z,password:"azexport",password_confirmation:"azexport",latitude:"",longitude:""};L.post(route("register"),U).then(async T=>{try{await W(z,h,C,x,S),r(!0),X.success("Qeydiyyat m\xFCv\u0259ff\u0259qiyy\u0259tl\u0259 tamamland\u0131!",{position:X.POSITION.TOP_CENTER,autoClose:4e3,theme:"colored"}),J.Inertia.visit(o("routes:user-dashboard"))}catch(I){console.log(I)}}).catch(T=>{var I,ee,Y,se,ne,ie;if(console.log(T),((I=T==null?void 0:T.response)==null?void 0:I.status)===422){f((Y=(ee=T==null?void 0:T.response)==null?void 0:ee.data)==null?void 0:Y.message);const be=(ne=(se=T==null?void 0:T.response)==null?void 0:se.data)==null?void 0:ne.errors;(ie=Object.keys(be))==null||ie.map(xe=>{var ge;setError(xe,{type:"custom",message:(ge=be[xe])==null?void 0:ge[0]})})}else f(o("errors.system_error"))}).finally(()=>{v(!1)})}).catch(console.log)})},k=async()=>{j("vatid")&&j("vatid")!==""&&L.post("/asan-imza/login-with-vat",{vatId:j("vatid")}).then(async h=>{var x;if(((x=h==null?void 0:h.data)==null?void 0:x.status)==="1")r(!0),y(!1),J.Inertia.visit(o("routes:user-dashboard"),{onFinish:()=>{window.location.reload()}});else{const C=await O(j("vatid"));C&&_(C.name,g==null?void 0:g.mobileNumberFormatted,C.address,j("vatid"),C.district),r(!0)}})};return t("form",{autoComplete:"false",children:[l&&e(D,{type:"danger",text:l,hasIcon:!0}),N&&e(D,{type:"danger",text:N,hasIcon:!0}),t("div",{className:"grid sm:grid-cols-2 gap-x-4 gap-y-6",children:[!u&&t(R,{children:[t("div",{children:[e("label",{className:"text-sm font-normal text-black block mb-2",children:o("authorization.mobile_number")}),e(Z,{control:m,name:"mobile_number",render:({field:{onChange:h,value:x}})=>{var C;
1return t(R,{children:[e(de,{mask:"(+994) 88-888-8888",onChange:h,value:x,className:w.mobile_number?"outline-none px-3 border border-gray-300 border-red-500 focus:ring-0 h-14 rounded w-full":"outline-none px-3 border border-gray-300 focus:ring-0 h-14 rounded w-full",formatChars:{8:"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"},children:z=>e("input",{...z})}),w.mobile_number&&e("span",{className:"text-red-600",children:(C=w.mobile_number)==null?void 0:C.message})]})},rules:{required:{value:!0,message:o("common.required_field")}}})]}),t("div",{children:[e("label",{className:"text-sm font-normal text-black block mb-2",children:o("authorization.user_id")}),e(Z,{control:m,name:"user_id",render:({field:{onChange:h,value:x}})=>{var C;return t(R,{children:[e(de,{mask:"888888",onChange:h,value:x,className:w.user_id?"outline-none px-3 border border-gray-300 border-red-500 focus:ring-0 h-14 rounded w-full":"outline-none px-3 border border-gray-300 focus:ring-0 h-14 rounded w-full",formatChars:{8:"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"},children:z=>e("input",{...z})}),w.user_id&&e("span",{className:"text-red-600",children:(C=w.user_id)==null?void 0:C.message})]})},rules:{required:{value:!0,message:o("common.required_field")}}})]})]}),u&&t(R,{children:[t("div",{children:[e("label",{className:"text-sm font-normal text-black block mb-2",children:o("authorization.certificate")}),e(Z,{control:m,name:"vatid",render:({field:{onChange:h,value:x}})=>{var C,z;return t(R,{children:[t("select",{className:w.user_id?"outline-none px-3 border border-gray-300 border-red-500 focus:ring-0 h-14 rounded w-full":"outline-none px-3 border border-gray-300 focus:ring-0 h-14 rounded w-full",onChange:h,children:[e("option",{value:"",children:"-"}),(C=u==null?void 0:u.certList)==null?void 0:C.map(S=>e("option",{value:S.voen,selected:x===S.voen,children:S.orgName}))]}),w.vatid&&e("span",{className:"text-red-600",children:(z=w.vatid)==null?void 0:z.message})]})},rules:{required:{value:!0,message:o("common.required_field")}}})]}),e("div",{})]}),e("div",{children:e(te,{type:"button",onClick:u?O:A,isLoading:d,disabled:u&&(((M=u==null?void 0:u.certList)==null?void 0:M.length)===0||!j("vatid")),className:"ripple-button bg-blue-600 text-sm text-white font-normal uppercase w-full p-4 rounded",children:o("authorization.sign_in")})})]})]})}const ue=270,ze=({className:r,style:s,value:a=1,timeout:i,...N})=>{const[u,g]=n.exports.useState(a),[b,c]=n.exports.useState(`0 ${ue}`),y=n.exports.useCallback(()=>{const o=u/a,p=`${(ue-o*ue).toFixed(0)} ${ue}`;c(p)},[u,a]);return n.exports.useEffect(()=>{const o=u>0&&setInterval(()=>g(u-1),1e3);return y(),u===0&&i&&setTimeout(()=>{i()},1e3),()=>{clearInterval(o)}},[u,y,i]),t("div",{className:[r,re.root].join(" "),style:s,...N,children:[e("svg",{className:re.svg,viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",children:t("g",{className:re.circle,children:[e("circle",{className:re["path-elapsed"],cx:"50",cy:"50",r:"43"}),e("path",{strokeDasharray:b,className:re["path-remaining"],d:" M 50, 50 m -43, 0 a 43,43 0 1,0 86,0 a 43,43 0 1,0 -86,0 "})]})}),e("span",{className:re.label,children:Ee.utc(u*1e3).format("mm:ss")})]})};function bt({isOpen:r,certificateData:s}){return e("div",{className:`modal fade fixed top-0 left-0 hidden ${r?"show block":"hidden"} w-full h-full outline-none overflow-x-hidden overflow-y-auto`,id:"registerSellerModal",tabIndex:"-1","aria-labelledby":"asanLoginModalTitle","aria-modal":"true",role:"dialog",style:{display:r?"block":"none"},children:e(oe,{modalClose:!r,children:e("div",{className:"px-4 sm:px-0 flex flex-col justify-center sm:block h-full",children:e(Me,{certificateData:s})})})})}function xt({code:r,certificateData:s,setError:a,setShowCountdown:i,setModalClose:N,setCertificateList:u,isRegisterModalOpen:g,setIsRegisterModalOpen:b}){var d;const{t:c}=P(),y={revalidateOnFocus:!1,revalidateOnReconnect:!1,shouldRetryOnError:!1,refreshInterval:2e3},{data:o,error:p}=K(s?`/asan-imza/check-status?mobileNumber=${s.mobileNumber}&vatId=${s.vatId}&userId=${s.userId}`:null,L.get,y);return n.exports.useEffect(()=>{var v,l,f,m,F;((v=o==null?void 0:o.data)==null?void 0:v.status)==="USER_AUTHENTICATED"&&(N(!0),b(!0)),["NOT_VALID","EXPIRED_TRANSACTION","USER_CANCEL","MID_NOT_READY","SENDING_ERROR","SIM_ERROR","INTERNAL_ERROR"].includes((l=o==null?void 0:o.data)==null?void 0:l.status)&&(i(!1),a(c(`errors.asan_
1imza.${(f=o==null?void 0:o.data)==null?void 0:f.status}`))),((m=o==null?void 0:o.data)==null?void 0:m.status)==="CERTIFICATES"&&(i(!1),u((F=o==null?void 0:o.data)==null?void 0:F.data))},[(d=o==null?void 0:o.data)==null?void 0:d.status]),n.exports.useEffect(()=>{var v,l;p&&(i(!1),a(((l=(v=p==null?void 0:p.response)==null?void 0:v.data)==null?void 0:l.message)==="User does not exist"?e(me,{i18nKey:"authorization.user_not_found",components:[e("button",{type:"button","data-bs-toggle":"modal","data-bs-target":"#registerModal",className:"text-blue-500 text-base ml-1"})]}):"X\u0259ta ba\u015F verdi"))},[p]),t("div",{className:"flex m-[10px] flex-col justify-center items-center",children:[e("img",{src:fe,alt:"logo"}),e("span",{className:"text-lg font-medium my-5",children:c("authorization.verificationMessage")}),t("div",{className:"flex flex-col justify-center items-center rounded-lg mb-6 mt-2",children:[e("span",{className:"text-md",children:c("authorization.code")}),e("span",{className:"font-bold text-3xl ",children:r})]}),e(ze,{value:120,timeout:()=>i(!1)}),e("button",{className:"text-sm mt-8 text-gray-400",type:"button",onClick:()=>i(!1),children:"\u0130mtina et"}),e(bt,{isOpen:g,certificateData:o})]})}function gt({isOpen:r,onClose:s,setisRegisterSellerOpen:a,setRegisterData:i}){const{t:N}=P(),[u,g]=n.exports.useState(!1),[b,c]=n.exports.useState(null),[y,o]=n.exports.useState(null),[p,d]=n.exports.useState(!1),[v,l]=n.exports.useState(null),[f,m]=n.exports.useState(!1);return n.exports.useEffect(()=>{m(null)},[]),n.exports.useEffect(()=>{r||(g(!1),c(null),o(null),l(null),m(!1))},[r]),r?t("div",{className:"fixed inset-0 z-50 overflow-y-auto",children:[e("div",{className:"fixed inset-0 bg-black bg-opacity-50",onClick:s}),e("div",{className:"flex items-center justify-center min-h-screen p-4",onClick:F=>F.stopPropagation(),children:e("div",{className:"relative bg-white rounded-lg shadow-xl w-full max-w-screen-md mx-auto",children:e(oe,{children:e("div",{className:"px-4 sm:px-0 flex flex-col justify-center sm:block h-full",children:u?e(xt,{code:b,certificateData:y,setShowCountdown:g,setError:l,setModalClose:s,setCertificateList:m,isRegisterModalOpen:p,setIsRegisterModalOpen:d}):t(R,{children:[e("h1",{className:"text-[28px] font-medium text-black mb-3",children:N("authorization.asan_login")}),e(ht,{setModalClose:s,setShowCountdown:g,setCode:c,certificateData:y,setCertificateData:o,responseError:v,certificateList:f,setisRegisterSellerOpen:a,setRegisterData:i,setIsRegisterModalOpen:d}),e(pe,{isLogin:!1})]})})})})})]}):null}function yt(){const{t:r}=P(),[s,a]=n.exports.useState(!1),[i,N]=n.exports.useState(""),[u,g]=n.exports.useState(!1),[b,c]=n.exports.useState(!1);return t("div",{className:"modal fade fixed top-0 left-0 hidden w-full h-full outline-none overflow-x-hidden overflow-y-auto",id:"registerModal",tabIndex:"-1","aria-labelledby":"registerModalTitle","aria-modal":"true",role:"dialog",children:[e(
1oe,{modalClose:b,bodyHeight:(window==null?void 0:window.innerWidth)<=767?"100vh":"auto",children:t("div",{className:"px-4 sm:px-0 flex flex-col justify-center sm:block h-full",children:[e("h1",{className:"text-[28px] font-medium text-black mb-3",children:r("authorization.register")}),t("ul",{className:"nav nav-pills flex gap-3 flex-wrap list-none pl-0 mb-4 login-tabs",id:"pills-tab2",role:"tablist",children:[e("li",{className:"nav-item",role:"presentation",children:e("a",{href:"#pills-home2",className:" nav-link block font-normal text-2sm leading-tight rounded px-8 py-4 my-2 md:mr-2 focus:outline-none focus:ring-0 active ",id:"pills-home2-tab","data-bs-toggle":"pill","data-bs-target":"#pills-home2",role:"tab","aria-controls":"pills-home2","aria-selected":"true",children:r("authorization.buyer_account")})}),e("li",{className:"nav-item",role:"presentation",children:e("a",{href:"#pills-profile2",className:" nav-link block font-normal text-2sm leading-tight rounded px-8 py-4 my-2 md:mx-2 focus:outline-none focus:ring-0 bg-white ",id:"pills-profile2-tab","data-bs-toggle":"pill","data-bs-target":"#pills-profile2",role:"tab","aria-controls":"pills-profile2","aria-selected":"false",children:r("authorization.seller_account")})})]}),t("div",{className:"tab-content",id:"pills-tab2Content",children:[e("div",{className:"tab-pane fade show active",id:"pills-home2",role:"tabpanel","aria-labelledby":"pills-home2-tab",children:e(ft,{setModalClose:c})}),t("div",{className:"tab-pane fade",id:"pills-profile2",role:"tabpanel","aria-labelledby":"pills-profile2-tab",children:[s&&e(Me,{registerData:i,setModalClose:c}),!s&&e("button",{type:"button",onClick:()=>g(!0),className:"rounded p-3 w-auto",style:{boxShadow:"0px 8px 16px rgba(0, 0, 0, 0.04)"},children:e("img",{src:fe})})]})]}),e(pe,{isLogin:!1})]})}),e(gt,{isOpen:u,onClose:()=>g(!1),setisRegisterSellerOpen:a,setRegisterData:N})]})}function vt({}){const{t:r}=P(),[s,a]=n.exports.useState(!1),[i,N]=n.exports.useState(!1),[u,g]=n.exports.useState(!1),{control:b,handleSubmit:c,reset:y,watch:o,formState:{errors:p}}=le({mode:"onChange",defaultValues:{email:""}}),d=c(v=>{N(!0),L.post(route("password.email"),v).then(l=>{a(!0)}).catch(l=>{var f,m,F;console.log(l),((f=l==null?void 0:l.response)==null?void 0:f.status)===422?g((F=(m=l==null?void 0:l.response)==null?void 0:m.data)==null?void 0:F.message):g(r("errors.system_error"))}).finally(()=>{N(!1)})});return e("div",{className:"modal fade fixed top-0 left-0 hidden w-full h-full outline-none overflow-x-hidden overflow-y-auto",id:"forgotPassModal",tabIndex:"-1","aria-labelledby":"forgotPassModalTitle","aria-modal":"true",role:"dialog",children:t(oe,{children:[e("h1",{className:"text-[28px] font-medium text-black mb-3",children:r("authorization.reset_password")}),e("p",{className:"text-sm text-black font-normal mb-6",children:r("authorization.reset_password_info")}),u&&e(D,{type:"danger",text:u,hasIcon:!0}),t("div",{className:"grid grid-cols-2 gap-x-4 gap-y-6 mb-2",children:[t("div",{children:[e("label",{className:"text-sm font-normal text-black block mb-2",children:r("authorization.email")}),e(Z,{control:b,name:"email",render:({field:{onChange:v,value:l}})=>{var f;return t(R,{children:[e("input",{type:"email",className:"border border-gray-300 focus:ring-0 h-14 rounded w-full",onChange:v,value:l}),p.email&&e("span",{className:"text-red-600",children:(f=p.email)==null?void 0:f.message})]})},rules:{required:{value:!0,message:r("common.required_field")}}})]}),e("div",{}),e(te,{className:"ripple-button bg-blue-600 text-sm text-white font-normal uppercase w-full p-4 rounded",onClick:d,type:"button",disabled:i,children:r("authorization.email")})]}),s&&e(D,{type:"success",text:r("authorization.link_sent"),hasIcon:!0})]})})}const we="/build/assets/user-profile-circle.35a482ab.svg",Nt="/build/assets/logout-01.9028b882.svg",wt="/build/assets/mobile-shop.7e8ef75e.svg",kt="/build/assets/mobile-delivery.e99bed91.svg",Ct="/build/assets/mobile-heart.4fc4dade.svg";function _t({auth:r}){var i;const{t:s}=P(),a=()=>{axios.post(route("logout")).then(()=>{Inertia.visit(s("routes:home"))})};return t("div",{className:"flex sm:hidden justify-around items-center fixed bottom-0 left-0 w-full bg-white h-[55px] z-50 border-t border-[#DBE1E8]",children:[(r==null?void 0:r.user)&&!((i=window==null?void 0:window.location)!=null&&i.pathname.includes(s("routes:user-dashboard")))?t(q,{href:s("routes:user-dashboard"),
1className:"flex flex-col items-center ",children:[e("img",{src:we,className:"w-[20px] h-[20px]"}),e("span",{className:"text-2xs text-black font-normal",children:s("common.dashboard")})]}):r!=null&&r.user?t("button",{onClick:a,type:"button",className:"flex flex-col items-center",children:[e("img",{src:Nt,className:"w-[20px] h-[20px]"}),e("span",{className:"text-2xs text-black font-normal",children:s("common.logout")})]}):t("button",{type:"button","data-bs-toggle":"modal","data-bs-target":"#loginModal",className:"flex flex-col items-center",children:[e("img",{src:we,className:"w-[20px] h-[20px]"}),e("span",{className:"text-2xs text-black font-normal",children:s("common.dashboard")})]}),t("button",{type:"button","data-bs-toggle":"modal","data-bs-target":"#deliveryModal",className:"flex flex-col items-center",children:[e("img",{src:kt,className:"w-[20px] h-[20px]"}),e("span",{className:"text-2xs text-black font-normal",children:s("common.track_order")})]}),t(q,{href:s("routes:wishlist"),className:"flex flex-col items-center",children:[e("img",{src:Ct,className:"w-[20px] h-[20px]"}),e("span",{className:"text-2xs text-black font-normal",children:s("common.wishlist")})]}),t(q,{href:s("routes:suppliers"),className:"flex flex-col items-center",children:[e("img",{src:wt,className:"w-[20px] h-[20px]"}),e("span",{className:"text-2xs text-black font-normal",children:s("common.manufacturers")})]})]})}const St="/build/assets/mobile-popup-icon.58e3a4bd.png";function It(){const{t:r}=P(),[s,a]=n.exports.useState(!1);return n.exports.useEffect(()=>{localStorage.getItem("shopPopupClosed")!=="1"&&window.innerWidth<768?a(!0):a(!1)},[]),e("div",{className:s?"modal fade fixed left-0 show sm:hidden w-full outline-none overflow-x-hidden overflow-y-auto bottom-[70px] p-0 h-[87px]":"modal fade fixed left-0 hidden sm:hidden w-full outline-none overflow-x-hidden overflow-y-auto bottom-[70px] p-0 h-[87px]",id:"mobileShopModal",tabIndex:"-1","aria-labelledby":"mobileShopModalTitle","aria-modal":"true",role:"dialog",children:e("div",{className:"modal-dialog modal-dialog-centered relative w-auto pointer-events-none items-end modal-sm pb-[60px] mt-0",children:t("div",{className:"modal-content border-none shadow-lg relative flex flex-col w-full pointer-events-auto bg-[#7432FF] bg-clip-padding rounded-md outline-none text-current",children:[e("button",{type:"button",className:"absolute right-3 sm:-right-[10%] top-3 bg-white shadow-[0px_8px_16px_#546276] btn-close box-content w-4 h-4 p-1 text-blue-600 border-none rounded-full focus:shadow-none focus:outline-none text-sm hover:text-white hover:bg-blue-600 transition z-[999]","data-bs-dismiss":"modal","aria-label":"Close",onClick:()=>{a(!1),localStorage.setItem("shopPopupClosed",1)}}),e("div",{className:"modal-body relative p-4",children:t("div",{className:"flex pr-5 gap-2 items-center",children:[e("img",{src:St}),e("span",{className:"text-sm text-white font-medium",children:r("common.mobile_popup_text")})]})})]})})})}function Mt({setModalClose:r,setShowCountdown:s,setCode:a,setCertificateData:i,responseError:N,certificateList:u,certificateData:g}){var W;const{t:b,i18n:c}=P(),[y,o]=n.exports.useState(!1),[p,d]=n.exports.useState(!1);n.exports.useState(""),n.exports.useState(""),n.exports.useState("");const{control:v,handleSubmit:l,reset:f,watch:m,formState:F}=le({mode:"onChange",defaultValues:{mobile_number:"",user_id:"",vatid:""}}),E=F.errors;n.exports.useEffect(()=>{f()},[]);const j=l(_=>{o(!0),L.post("/asan-imza/authenticate",{..._,mobile_number:_.mobile_number.replace(/[^0-9+]/g,""),lang:c.language}).then(k=>{var M;a((M=k.data)==null?void 0:M.verificationCode),i({mobileNumber:_.mobile_number.replace(/[^0-9+]/g,""),vatId:_.vatid.replace(/[^0-9+]/g,""),mobileNumberFormatted:_.mobile_number,userId:_.user_id}),s(!0)}).catch(k=>{var M,h;console.log(k),d((h=(M=k==null?void 0:k.response)==null?void 0:M.data)==null?void 0:h.message)}).finally(()=>{o(!1)})}),$=async _=>{var k,M,h,x,C,z;try{const S=await L.post("/api/check-voen",{voen:_});if(S!=null&&S.data)if(((M=(k=S.data)==null?void 0:k.response)==null?void 0:M.code)==="1109"||!S.data)setError("vatid",{type:"custom",message:(h=S.data)==null?void 0:h.response.message});else return{name:(x=S==null?void 0:S.data)==null?void 0:x.name,address:(C=S==null?void 0:S.data)==null?void 0:C.legalAddress,district:(z=S==null?void 0:S.data)==null?void 0:z.district}}catch(S){console.log(S)}},w=async(_,k,M,h,x="")=>{var S,B,U,V,G,Q;const C=[{id:(S=m("vatid"))!=null&&S.endsWith("1")?"37252":"37253",type:"text",attributes:{"supplier.lists.type":"default","supplier.lists.config":{}}}],z={data:{type:"supplier",attributes:{"supplier.code":_,"supplier.label":k,"supplier.status":"1"},relationships:{text:{data:C}}}};try{const T=await L.post("/admin/default/jsonadm/supplier",z),I={data:[{type:"supplier/address",attributes:{"supplier.address.parentid":(U=(B=T==null?void 0:T.data)==null?void 0:B.data)==null?void 0:U.id,"supplier.address.firstname":(V=k==null?void 0:k.split(" "))==null?void 0:V[0],"supplier.address.lastname":((G=k==null?void 0:k.split(" "))==null?void 0:G[1])||((Q=k==null?void 0:k.split(" "))==null?void 0:Q[0]),"supplier.address.address1":M,"supplier.address.address2":"","supplier.address.email":"","supplier.address.telep
1hone":h,"supplier.address.postal":"","supplier.address.city":"","supplier.address.state":x,"supplier.address.countryid":"AZ","supplier.address.vatid":_,"supplier.address.latitude":"","supplier.address.longitude":""}}]};await L.post("/admin/default/jsonadm/supplier/address",I)}catch(T){console.log(T)}},A=async(_,k,M,h,x)=>{var C;try{await L.post("/add-user-group"),await L.post("/jsonapi/customer?related=property",{data:[{attributes:{"customer.property.type":"supplierType","customer.property.languageid":null,"customer.property.value":(C=m("vatid"))!=null&&C.endsWith("1")?"CORPORATE":"INDIVIDUAL"}}]}),await w(_,k,M,h,x)}catch(z){console.log(z),X.error(b("errors.system_error"),{position:X.POSITION.TOP_CENTER,autoClose:4e3,theme:"colored"})}},O=async(_,k,M,h,x)=>{o(!0),grecaptcha.ready(function(){grecaptcha.execute("6LdGrRkkAAAAALr6n1rrPIyavuTMgsnQrpq33O0p",{action:"registerForm"}).then(async function(C){var S,B,U;const z={cToken:C,firstname:(S=_==null?void 0:_.split(" "))==null?void 0:S[0],lastname:((B=_==null?void 0:_.split(" "))==null?void 0:B[1])||((U=_==null?void 0:_.split(" "))==null?void 0:U[0]),name:_,email:h,telephone:k,address1:M,vatid:h,password:"azexport",password_confirmation:"azexport",latitude:"",longitude:""};L.post(route("register"),z).then(async V=>{try{await A(h,_,M,k,x),r(!0),X.success("Qeydiyyat m\xFCv\u0259ff\u0259qiyy\u0259tl\u0259 tamamland\u0131!",{position:X.POSITION.TOP_CENTER,autoClose:4e3,theme:"colored"}),J.Inertia.visit(b("routes:user-dashboard"))}catch(G){console.log(G)}}).catch(V=>{var G,Q,T,I,ee,Y;if(console.log(V),((G=V==null?void 0:V.response)==null?void 0:G.status)===422){d((T=(Q=V==null?void 0:V.response)==null?void 0:Q.data)==null?void 0:T.message);const se=(ee=(I=V==null?void 0:V.response)==null?void 0:I.data)==null?void 0:ee.errors;(Y=Object.keys(se))==null||Y.map(ne=>{var ie;setError(ne,{type:"custom",message:(ie=se[ne])==null?void 0:ie[0]})})}else d(b("errors.system_error"))}).finally(()=>{o(!1)})}).catch(console.log)})},H=async()=>{m("vatid")&&m("vatid")!==""&&L.post("/asan-imza/login-with-vat",{vatId:m("vatid")}).then(async _=>{var k;if(((k=_==null?void 0:_.data)==null?void 0:k.status)==="1")r(!0),J.Inertia.visit(b("routes:user-dashboard"));else{const M=await $(m("vatid"));M&&O(M.name,g==null?void 0:g.mobileNumberFormatted,M.address,m("vatid"),M.district)}})};return t("form",{autoComplete:"false",children:[p&&e(D,{type:"danger",text:p,hasIcon:!0}),N&&e(D,{type:"danger",text:N,hasIcon:!0}),t("div",{className:"grid sm:grid-cols-2 gap-x-4 gap-y-6",children:[!u&&t(R,{children:[t("div",{children:[e("label",{className:"text-sm font-normal text-black block mb-2",children:b("authorization.mobile_number")}),e(Z,{control:v,name:"mobile_number",render:({field:{onChange:_,value:k}})=>{var M;
1return t(R,{children:[e(de,{mask:"(+994) 88-888-8888",onChange:_,value:k,className:E.mobile_number?"outline-none px-3 border border-gray-300 border-red-500 focus:ring-0 h-14 rounded w-full":"outline-none px-3 border border-gray-300 focus:ring-0 h-14 rounded w-full",formatChars:{8:"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"},children:h=>e("input",{...h})}),E.mobile_number&&e("span",{className:"text-red-600",children:(M=E.mobile_number)==null?void 0:M.message})]})},rules:{required:{value:!0,message:b("common.required_field")}}})]}),t("div",{children:[e("label",{className:"text-sm font-normal text-black block mb-2",children:b("authorization.user_id")}),e(Z,{control:v,name:"user_id",render:({field:{onChange:_,value:k}})=>{var M;return t(R,{children:[e(de,{mask:"888888",onChange:_,value:k,className:E.user_id?"outline-none px-3 border border-gray-300 border-red-500 focus:ring-0 h-14 rounded w-full":"outline-none px-3 border border-gray-300 focus:ring-0 h-14 rounded w-full",formatChars:{8:"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"},children:h=>e("input",{...h})}),E.user_id&&e("span",{className:"text-red-600",children:(M=E.user_id)==null?void 0:M.message})]})},rules:{required:{value:!0,message:b("common.required_field")}}})]})]}),u&&t(R,{children:[t("div",{children:[e("label",{className:"text-sm font-normal text-black block mb-2",children:b("authorization.certificate")}),e(Z,{control:v,name:"vatid",render:({field:{onChange:_,value:k}})=>{var M,h;return t(R,{children:[t("select",{className:E.user_id?"outline-none px-3 border border-gray-300 border-red-500 focus:ring-0 h-14 rounded w-full":"outline-none px-3 border border-gray-300 focus:ring-0 h-14 rounded w-full",onChange:_,children:[e("option",{value:"",children:"-"}),(M=u==null?void 0:u.certList)==null?void 0:M.map(x=>e("option",{value:x.voen,selected:k===x.voen,children:x.orgName}))]}),E.vatid&&e("span",{className:"text-red-600",children:(h=E.vatid)==null?void 0:h.message})]})},rules:{required:{value:!0,message:b("common.required_field")}}})]}),e("div",{})]}),e("div",{children:e(te,{type:"button",onClick:u?H:j,isLoading:y,disabled:u&&(((W=u==null?void 0:u.certList)==null?void 0:W.length)===0||!m("vatid")),className:"ripple-button bg-blue-600 text-sm text-white font-normal uppercase w-full p-4 rounded",children:b("authorization.sign_in")})})]})]})}function Ft({code:r,certificateData:s,setError:a,setShowCountdown:i,setModalClose:N,setCertificateList:u}){var o;const{t:g}=P(),b={revalidateOnFocus:!1,revalidateOnReconnect:!1,shouldRetryOnError:!1,refreshInterval:2e3},{data:c,error:y}=K(s?`/asan-imza/check-status?mobileNumber=${s.mobileNumber}&vatId=${s.vatId}&userId=${s.userId}`:null,L.get,b);return n.exports.useEffect(()=>{var p,d,v,l,f;((p=c==null?void 0:c.data)==null?void 0:p.status)==="USER_AUTHENTICATED"&&(N(!0),Inertia.visit("/user-dashboard")),["NOT_VALID","EXPIRED_TRANSACTION","USER_CANCEL","MID_NOT_READY","SENDING_ERROR","SIM_ERROR","INTERNAL_ERROR"].includes((d=c==null?void 0:c.data)==null?void 0:d.status)&&(i(!1),a(g(`errors.asan_imza.${(v=c==null?void 0:c.data)==null?void 0:v.status}`))),((l=c==null?void 0:c.data)==null?void 0:l.status)==="CERTIFICATES"&&(i(!1),u((f=c==null?void 0:c.data)==null?void 0:f.data))},[(o=c==null?void 0:c.data)==null?void 0:o.status]),n.exports.useEffect(()=>{var p,d,v,l;y&&(i(!1),a(((d=(p=y==null?void 0:y.response)==null?void 0:p.data)==null?void 0:d.message)==="User does not exist"?e(Trans,{i18nKey:"authorization.user_not_found",components:[e("button",{type:"button","data-bs-toggle":"modal","data-bs-target":"#registerModal",className:"text-blue-500 text-base ml-1"})]}):(l=(v=y==null?void 0:y.response)==null?void 0:v.data)==null?void 0:l.message))},[y]),t("div",{className:"flex m-[10px] flex-col justify-center items-center",children:[e("img",{src:fe,alt:"logo"}),e("span",{className:"text-lg font-medium my-5",children:g("authorization.verificationMessage")}),t("div",{className:"flex flex-col justify-center items-center rounded-lg mb-6 mt-2",children:[e("span",{className:"text-md",children:g("authorization.code")}),e("span",{className:"font-bold text-3xl ",children:r})]}),e(ze,{value:120,timeout:()=>i(!1)}),e("button",{className:"text-sm mt-8 text-gray-400",type:"button",onClick:()=>i(!1),children:"\u0130mtina et"})]})}function zt(){const{t:r}
1=P(),[s,a]=n.exports.useState(!1),[i,N]=n.exports.useState(!1),[u,g]=n.exports.useState(null),[b,c]=n.exports.useState(null),[y,o]=n.exports.useState(null),[p,d]=n.exports.useState(!1);return n.exports.useEffect(()=>{d(null)},[]),e("div",{className:"modal fade fixed top-0 left-0 hidden w-full h-full outline-none overflow-x-hidden overflow-y-auto",id:"asanLoginModal",tabIndex:"-1","aria-labelledby":"asanLoginModalTitle","aria-modal":"true",role:"dialog",children:e(oe,{modalClose:s,children:e("div",{className:"px-4 sm:px-0 flex flex-col justify-center sm:block h-full",children:i?e(Ft,{code:u,certificateData:b,setShowCountdown:N,setError:o,setModalClose:a,setCertificateList:d}):t(R,{children:[e("h1",{className:"text-[28px] font-medium text-black mb-3",children:r("authorization.asan_login")}),e(Mt,{setModalClose:a,setShowCountdown:N,setCode:g,certificateData:b,setCertificateData:c,responseError:y,certificateList:p}),e(pe,{isLogin:!0})]})})})})}function Kt({children:r,breadCrumbItems:s,auth:a}){const[i,N]=n.exports.useState(!1),[u,g]=n.exports.useState(180),[b,c]=n.exports.useState(370),[y,o]=n.exports.useState(null),[p,d]=n.exports.useState([]),[v,l]=n.exports.useState([]),[f,m]=n.exports.useState({}),{data:F}=K("/jsonapi/customer?related=relationships&include=product",L.get,{revalidateOnFocus:!1});n.exports.useEffect(()=>{var w,A;F&&((A=(w=F.data)==null?void 0:w.data)==null||A.map(O=>{const H=O==null?void 0:O.attributes["customer.lists.refid"];d(W=>[...W,H])}))},[F]);const{data:E}=K("/jsonapi/product?aggregate=index.catalog.id",L.get,{revalidateOnFocus:!1});n.exports.useEffect(()=>{var w,A;if(E){const O={};(A=(w=E.data)==null?void 0:w.data)==null||A.map(H=>{O[H.id]=H.attributes}),m(O)}},[E]);const{data:j}=K("/jsonapi/supplier?include=supplier/address&page[limit]=5000",L.get,{revalidateOnFocus:!1});n.exports.useEffect(()=>{var w,A;j&&((A=(w=j==null?void 0:j.data)==null?void 0:w.data)==null||A.map(O=>{var k,M,h,x,C,z,S,B;const H=O==null?void 0:O.attributes["supplier.id"],W=(x=(h=(M=(k=O==null?void 0:O.relationships)==null?void 0:k["supplier/address"])==null?void 0:M.data)==null?void 0:h[0])==null?void 0:x.id;((B=(S=(z=(C=j==null?void 0:j.data)==null?void 0:C.included)==null?void 0:z.find(U=>U.id==W))==null?void 0:S.attributes)==null?void 0:B["supplier.address.address3"])==="1"&&l(U=>[...U,H])}))},[j]);const $=ce.Children.map(r,w=>ce.isValidElement(w)?(w==null?void 0:w.type)!=="div"?ce.cloneElement(w,{menuIsOpen:i,setTopOffset:g,setMenuHeight:c,setQuickLookData:o,wishlistIds:p,suppliersWithDelivery:v,productCounts:f}):ce.cloneElement(w):w);return n.exports.useEffect(()=>{const w=document.createElement("script");return w.src="/sienna.js",w.defer=!0,document.body.appendChild(w),()=>{document.body.removeChild(w)}},[]),t(R,{children:[e(We,{menuIsOpen:i,setMenuIsOpen:N,auth:a}),e(ct,{topOffset:u,menuHeight:b,menuIsOpen:i,setMenuIsOpen:N,productCounts:f}),s&&e(it,{items:s}),$,e(nt,{productCounts:f}),e(pt,{}),e(yt,{}),e(vt,{}),e(zt,{}),e(je,{productData:y,suppliersWithDelivery:v,wishlistIds:p}),e(Ve,{}),e(_t,{auth:a}),e(It,{})]})}export{Kt as L,Qe as a,Ye as e,Ge as p};
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.