"use strict";(self.webpackChunkapp_lapieza=self.webpackChunkapp_lapieza||[]).push([[421],{2421:(Xe,ge,w)=>{w.r(ge),w.d(ge,{CustomerComponent:()=>zs});var t=w(8457),V=w(5794),C=w(4909),j=w(8834),ae=w(745),fe=w(9121),ye=w(5528),ie=w(7935),ce=w(5499);const H=s=>["/product/",s],be=()=>[1,2,3,4,5];function F(s,r){if(1&s&&(t.j41(0,"span"),t.nrm(1,"i",26),t.k0s()),2&s){const e=r.$implicit,i=t.XpG().$implicit,n=t.XpG(2);t.R7$(),t.Y8G("ngClass",n.getStarClass(e,i))}}function N(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",9)(1,"div",10)(2,"div",11)(3,"button",12),t.bIt("click",function(){const n=t.eBV(e).$implicit,a=t.XpG(2);return t.Njj(a.removeFromWishlistCustomer(n.id))}),t.nrm(4,"i",13),t.k0s()(),t.j41(5,"div",14)(6,"div",15)(7,"a",16),t.nrm(8,"img",17),t.k0s()()(),t.j41(9,"div",18)(10,"div",19)(11,"div",20),t.DNE(12,F,2,1,"span",21),t.k0s(),t.j41(13,"a",16)(14,"h5",22),t.EFF(15),t.k0s()(),t.j41(16,"h5",23)(17,"span",24),t.EFF(18),t.k0s()(),t.nrm(19,"app-cart-button-icon",25),t.k0s()()()()}if(2&s){const e=r.$implicit;t.R7$(7),t.Y8G("routerLink",t.eq3(11,H,e.product.slug)),t.R7$(),t.FS9("alt",e.product.name),t.Y8G("src",e.product.thumbnail_image,t.B4B),t.R7$(4),t.Y8G("ngForOf",t.lJ4(13,be)),t.R7$(),t.Y8G("routerLink",t.eq3(14,H,e.product.slug)),t.R7$(2),t.JRh(e.product.name),t.R7$(3),t.JRh(e.product.base_price),t.R7$(),t.Y8G("productId",e.product.id)("variant",e.product.variant||"5x5x5")("weight",e.product.weight||0)("initialQuantity",1)}}function M(s,r){if(1&s&&(t.j41(0,"div",7),t.DNE(1,N,20,16,"div",8),t.k0s()),2&s){const e=t.XpG();t.R7$(),t.Y8G("ngForOf",e.wishlistItems)}}let E=(()=>{class s{wishlistService;snackBar;changeDetectorRef;userCustomer;userNames="";wishlistItems=[];isLoading=!0;error=null;wishlistSubscription=null;constructor(e,i,n){this.wishlistService=e,this.snackBar=i,this.changeDetectorRef=n}ngOnChanges(e){e.userCustomer&&(console.log("userCustomer changed:",this.userCustomer),this.onUserReceived(this.userCustomer))}ngOnInit(){this.loadWishlistCustomerItems(),this.onUserReceived(this.userCustomer)}onUserReceived(e){console.log("Previous userCustomer:",this.userCustomer),this.userCustomer=e,console.log("New userCustomer:",this.userCustomer),this.userNames=this.userCustomer?.name||""}loadWishlistCustomerItems(){this.isLoading=!0,this.error=null,this.wishlistSubscription=this.wishlistService.getWishlistItems().subscribe({next:e=>{this.wishlistItems=e,this.isLoading=!1},error:e=>{this.error="No se pudieron cargar los elementos de la lista de deseos.",this.isLoading=!1,this.showErrorMessage("Error al cargar la lista de deseos"),console.error("Error cargando wishlist:",e)}})}removeFromWishlistCustomer(e){this.isLoading=!0,this.wishlistService.removeFromWishlist(e).subscribe({next:i=>{i&&"Product is removed from wishlist"===i.message?(this.wishlistItems=this.wishlistItems.filter(n=>n.id!==e),this.showSuccessMessage("Producto eliminado del wishlist"),this.changeDetectorRef.detectChanges(),this.wishlistService.updateWishlistCount(this.wishlistItems.length)):this.showErrorMessage("Error al eliminar el producto del wishlist"),this.isLoading=!1},error:i=>{this.showErrorMessage("Error al eliminar el producto"),this.isLoading=!1,console.error("Error al eliminar producto:",i)}})}addToCart(e){console.log("Agregar al carrito producto con ID:",e),this.showSuccessMessage("Producto a\xf1adido al carrito")}getStarClass(e,i){return{"fa-star":e<=i,"fa-star-o":e>i}}showSuccessMessage(e){this.snackBar.open(e,"Cerrar",{duration:3e3,panelClass:["success-snackbar"]})}showErrorMessage(e){this.snackBar.open(e,"Cerrar",{duration:5e3,panelClass:["error-snackbar"]})}ngOnDestroy(){this.wishlistSubscription&&this.wishlistSubscription.unsubscribe()}static \u0275fac=function(i){return new(i||s)(t.rXU(ie.F),t.rXU(ce.UG),t.rXU(t.gRc))};static \u0275cmp=t.VBU({type:s,selectors:[["app-customer-wishlist"]],inputs:{userCustomer:"userCustomer"},features:[t.OA$],decls:9,vars:1,consts:[["id","pills-wishlist","role","tabpanel",1,"tab-pane","fade","show"],[1,"dashboard-wishlist"],[1,"title"],[1,"title-leaf","title-leaf-gray"],[1,"icon-width","bg-gray"],[0,"xlink","href","assets/svg/leaf.svg#leaf"],["class","row g-sm-4 g-3",4,"ngIf"],[1,"row","g-sm-4","g-3"],["class","col-xxl-3 col-lg-6 col-md-4 col-sm-6 ",4,"ngFor","ngForOf"],[1,"col-xxl-3","col-lg-6","col-md-4","col-sm-6"],[1,"product-box-4","h-100",2,"background","#fff"],[1,"product-header-top"],[1,"btn","wishlist-button","btn-trash",3,"click"],[1,"fa","fa-regular","fa-trash"],[1,"product-header"],[1,"product-image"],[3,"routerLink"],[1,"img-fluid","blur-up","lazyload",3,"src","alt"],[1,"product-footer"],[1,"product-detail"],[1,"rating-stars"],[4,"ngFor","ngForOf"],[1,"name"],[1,"price"],[1,"theme-color"],[3,"productId","variant","weight","initialQuantity"],["aria-hidden","true",1,"fa",3,"ngClass"]],template:function(i,n){1&i&&(t.j41(0,"div",0)(1,"div",1)(2,"div",2)(3,"h2"),t.EFF(4,"Mis Listas"),t.k0s(),t.j41(5,"span",3),t.qSk(),t.j41(6,"svg",4),t.nrm(7,"use",5),t.k0s()()(),t.DNE(8,M,2,1,"div",6),t.k0s()()),2&i&&(t.R7$(8),t.Y8G("ngIf",!n.isLoading&&n.wishlistItems.length>0))},dependencies:[j.D,j.E,j.G,j.I,fe.X,ye.R],styles:[".btn-trash[_ngcontent-%COMP%]{float:right;color:#fff;border:1px solid #ddd!important;cursor:pointer!important;background:#003b73;border-radius:50px;padding:9px 10px;z-index:1000!important}"]})}return s})(),O=(()=>{class s{transform(e,i="MMMM d, y",n="es"){if(!e)return"";const[a,o,l]=e.split("-"),c=new Date(+l,+o-1,+a);return isNaN(c.getTime())?e:new Intl.DateTimeFormat(n,{month:"long",day:"numeric",year:"numeric"}).format(c)}static \u0275fac=function(i){return new(i||s)};static \u0275pipe=t.EJ8({name:"customDate",type:s,pure:!0})}return s})();function P(s){return null!==s&&"object"==typeof s&&"constructor"in s&&s.constructor===Object}function we(s,r){void 0===s&&(s={}),void 0===r&&(r={});const e=["__proto__","constructor","prototype"];Object.keys(r).filter(i=>e.indexOf(i)<0).forEach(i=>{typeof s[i]>"u"?s[i]=r[i]:P(r[i])&&P(s[i])&&Object.keys(r[i]).length>0&&we(s[i],r[i])})}const Ce={body:{},addEventListener(){},removeEventListener(){},activeElement:{blur(){},nodeName:""},querySelector:()=>null,querySelectorAll:()=>[],getElementById:()=>null,createEvent:()=>({initEvent(){}}),createElement:()=>({children:[],childNodes:[],style:{},setAttribute(){},getElementsByTagName:()=>[]}),createElementNS:()=>({}),importNode:()=>null,location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};function X(){const s=typeof document<"u"?document:{};return we(s,Ce),s}const xe={document:Ce,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState(){},pushState(){},go(){},back(){}},CustomEvent:function(){return this},addEventListener(){},removeEventListener(){},getComputedStyle:()=>({getPropertyValue:()=>""}),Image(){},Date(){},screen:{},setTimeout(){},clearTimeout(){},matchMedia:()=>({}),requestAnimationFrame:s=>typeof setTimeout>"u"?(s(),null):setTimeout(s,0),cancelAnimationFrame(s){typeof setTimeout>"u"||clearTimeout(s)}};function Y(){const s=typeof window<"u"?window:{};return we(s,xe),s}function Le(s,r){return void 0===r&&(r=0),setTimeout(s,r)}function ke(){return Date.now()}function Se(s){return"object"==typeof s&&null!==s&&s.constructor&&"Object"===Object.prototype.toString.call(s).slice(8,-1)}function gt(s){return typeof window<"u"&&typeof window.HTMLElement<"u"?s instanceof HTMLElement:s&&(1===s.nodeType||11===s.nodeType)}function K(){const s=Object(arguments.length<=0?void 0:arguments[0]),r=["__proto__","constructor","prototype"];for(let e=1;e<arguments.length;e+=1){const i=e<0||arguments.length<=e?void 0:arguments[e];if(null!=i&&!gt(i)){const n=Object.keys(Object(i)).filter(a=>r.indexOf(a)<0);for(let a=0,o=n.length;a<o;a+=1){const l=n[a],c=Object.getOwnPropertyDescriptor(i,l);void 0!==c&&c.enumerable&&(Se(s[l])&&Se(i[l])?i[l].__swiper__?s[l]=i[l]:K(s[l],i[l]):!Se(s[l])&&Se(i[l])?(s[l]={},i[l].__swiper__?s[l]=i[l]:K(s[l],i[l])):s[l]=i[l])}}}return s}function Ie(s,r,e){s.style.setProperty(r,e)}function Ue(s){let{swiper:r,targetPosition:e,side:i}=s;const n=Y(),a=-r.translate;let l,o=null;const c=r.params.speed;r.wrapperEl.style.scrollSnapType="none",n.cancelAnimationFrame(r.cssModeFrameID);const d=e>a?"next":"prev",u=(h,g)=>"next"===d&&h>=g||"prev"===d&&h<=g,p=()=>{l=(new Date).getTime(),null===o&&(o=l);const h=Math.max(Math.min((l-o)/c,1),0),g=.5-Math.cos(h*Math.PI)/2;let f=a+g*(e-a);if(u(f,e)&&(f=e),r.wrapperEl.scrollTo({[i]:f}),u(f,e))return r.wrapperEl.style.overflow="hidden",r.wrapperEl.style.scrollSnapType="",setTimeout(()=>{r.wrapperEl.style.overflow="",r.wrapperEl.scrollTo({[i]:f})}),void n.cancelAnimationFrame(r.cssModeFrameID);r.cssModeFrameID=n.requestAnimationFrame(p)};p()}function se(s,r){void 0===r&&(r="");const e=Y(),i=[...s.children];return e.HTMLSlotElement&&s instanceof HTMLSlotElement&&i.push(...s.assignedElements()),r?i.filter(n=>n.matches(r)):i}function Ee(s){try{return void console.warn(s)}catch{}}function Oe(s,r){void 0===r&&(r=[]);const e=document.createElement(s);return e.classList.add(...Array.isArray(r)?r:function ct(s){return void 0===s&&(s=""),s.trim().split(" ").filter(r=>!!r.trim())}(r)),e}function oe(s,r){return Y().getComputedStyle(s,null).getPropertyValue(r)}function He(s){let e,r=s;if(r){for(e=0;null!==(r=r.previousSibling);)1===r.nodeType&&(e+=1);return e}}function Ye(s,r,e){const i=Y();return e?s["width"===r?"offsetWidth":"offsetHeight"]+parseFloat(i.getComputedStyle(s,null).getPropertyValue("width"===r?"margin-right":"margin-top"))+parseFloat(i.getComputedStyle(s,null).getPropertyValue("width"===r?"margin-left":"margin-bottom")):s.offsetWidth}let Ae,De,Fe;function Ze(){return Ae||(Ae=function bt(){const s=Y(),r=X();return{smoothScroll:r.documentElement&&r.documentElement.style&&"scrollBehavior"in r.documentElement.style,touch:!!("ontouchstart"in s||s.DocumentTouch&&r instanceof s.DocumentTouch)}}()),Ae}function Qe(s){return void 0===s&&(s={}),De||(De=function wt(s){let{userAgent:r}=void 0===s?{}:s;const e=Ze(),i=Y(),n=i.navigator.platform,a=r||i.navigator.userAgent,o={ios:!1,android:!1},l=i.screen.width,c=i.screen.height,d=a.match(/(Android);?[\s\/]+([\d.]+)?/);let u=a.match(/(iPad).*OS\s([\d_]+)/);const p=a.match(/(iPod)(.*OS\s([\d_]+))?/),h=!u&&a.match(/(iPhone\sOS|iOS)\s([\d_]+)/),g="Win32"===n;let f="MacIntel"===n;return!u&&f&&e.touch&&["1024x1366","1366x1024","834x1194","1194x834","834x1112","1112x834","768x1024","1024x768","820x1180","1180x820","810x1080","1080x810"].indexOf(`${l}x${c}`)>=0&&(u=a.match(/(Version)\/([\d.]+)/),u||(u=[0,1,"13_0_0"]),f=!1),d&&!g&&(o.os="android",o.android=!0),(u||h||p)&&(o.os="ios",o.ios=!0),o}(s)),De}function qe(){return Fe||(Fe=function Mt(){const s=Y(),r=Qe();let e=!1;function i(){const l=s.navigator.userAgent.toLowerCase();return l.indexOf("safari")>=0&&l.indexOf("chrome")<0&&l.indexOf("android")<0}if(i()){const l=String(s.navigator.userAgent);if(l.includes("Version/")){const[c,d]=l.split("Version/")[1].split(" ")[0].split(".").map(u=>Number(u));e=c<16||16===c&&d<2}}const n=/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(s.navigator.userAgent),a=i();return{isSafari:e||a,needPerspectiveFix:e,need3dFix:a||n&&r.ios,isWebView:n}}()),Fe}const Ke=(s,r,e)=>{r&&!s.classList.contains(e)?s.classList.add(e):!r&&s.classList.contains(e)&&s.classList.remove(e)},Pe=(s,r,e)=>{r&&!s.classList.contains(e)?s.classList.add(e):!r&&s.classList.contains(e)&&s.classList.remove(e)},ze=(s,r)=>{if(!s||s.destroyed||!s.params)return;const i=r.closest(s.isElement?"swiper-slide":`.${s.params.slideClass}`);if(i){let n=i.querySelector(`.${s.params.lazyPreloaderClass}`);!n&&s.isElement&&(i.shadowRoot?n=i.shadowRoot.querySelector(`.${s.params.lazyPreloaderClass}`):requestAnimationFrame(()=>{i.shadowRoot&&(n=i.shadowRoot.querySelector(`.${s.params.lazyPreloaderClass}`),n&&n.remove())})),n&&n.remove()}},je=(s,r)=>{if(!s.slides[r])return;const e=s.slides[r].querySelector('[loading="lazy"]');e&&e.removeAttribute("loading")},Re=s=>{if(!s||s.destroyed||!s.params)return;let r=s.params.lazyPreloadPrevNext;const e=s.slides.length;if(!e||!r||r<0)return;r=Math.min(r,e);const i="auto"===s.params.slidesPerView?s.slidesPerViewDynamic():Math.ceil(s.params.slidesPerView),n=s.activeIndex;if(s.params.grid&&s.params.grid.rows>1){const o=n,l=[o-r];return l.push(...Array.from({length:r}).map((c,d)=>o+i+d)),void s.slides.forEach((c,d)=>{l.includes(c.column)&&je(s,d)})}const a=n+i-1;if(s.params.rewind||s.params.loop)for(let o=n-r;o<=a+r;o+=1){const l=(o%e+e)%e;(l<n||l>a)&&je(s,l)}else for(let o=Math.max(n-r,0);o<=Math.min(a+r,e-1);o+=1)o!==n&&(o>a||o<n)&&je(s,o)};function Je(s){let{swiper:r,runCallbacks:e,direction:i,step:n}=s;const{activeIndex:a,previousIndex:o}=r;let l=i;if(l||(l=a>o?"next":a<o?"prev":"reset"),r.emit(`transition${n}`),e&&a!==o){if("reset"===l)return void r.emit(`slideResetTransition${n}`);r.emit(`slideChangeTransition${n}`),r.emit("next"===l?`slideNextTransition${n}`:`slidePrevTransition${n}`)}}function et(s,r,e){const i=Y(),{params:n}=s,a=n.edgeSwipeDetection,o=n.edgeSwipeThreshold;return!a||!(e<=o||e>=i.innerWidth-o)||"prevent"===a&&(r.preventDefault(),!0)}function di(s){const r=this,e=X();let i=s;i.originalEvent&&(i=i.originalEvent);const n=r.touchEventsData;if("pointerdown"===i.type){if(null!==n.pointerId&&n.pointerId!==i.pointerId)return;n.pointerId=i.pointerId}else"touchstart"===i.type&&1===i.targetTouches.length&&(n.touchId=i.targetTouches[0].identifier);if("touchstart"===i.type)return void et(r,i,i.targetTouches[0].pageX);const{params:a,touches:o,enabled:l}=r;if(!l||!a.simulateTouch&&"mouse"===i.pointerType||r.animating&&a.preventInteractionOnTransition)return;!r.animating&&a.cssMode&&a.loop&&r.loopFix();let c=i.target;if("wrapper"===a.touchEventsTarget&&!function mt(s,r){const e=Y();let i=r.contains(s);return!i&&e.HTMLSlotElement&&r instanceof HTMLSlotElement&&(i=[...r.assignedElements()].includes(s),i||(i=function ft(s,r){const e=[r];for(;e.length>0;){const i=e.shift();if(s===i)return!0;e.push(...i.children,...i.shadowRoot?i.shadowRoot.children:[],...i.assignedElements?i.assignedElements():[])}}(s,r))),i}(c,r.wrapperEl)||"which"in i&&3===i.which||"button"in i&&i.button>0||n.isTouched&&n.isMoved)return;const d=!!a.noSwipingClass&&""!==a.noSwipingClass,u=i.composedPath?i.composedPath():i.path;d&&i.target&&i.target.shadowRoot&&u&&(c=u[0]);const p=a.noSwipingSelector?a.noSwipingSelector:`.${a.noSwipingClass}`;if(a.noSwiping&&(i.target&&i.target.shadowRoot?function li(s,r){return void 0===r&&(r=this),function e(i){if(!i||i===X()||i===Y())return null;i.assignedSlot&&(i=i.assignedSlot);const n=i.closest(s);return n||i.getRootNode?n||e(i.getRootNode().host):null}(r)}(p,c):c.closest(p)))return void(r.allowClick=!0);if(a.swipeHandler&&!c.closest(a.swipeHandler))return;o.currentX=i.pageX,o.currentY=i.pageY;const g=o.currentX,f=o.currentY;if(!et(r,i,g))return;Object.assign(n,{isTouched:!0,isMoved:!1,allowTouchCallbacks:!0,isScrolling:void 0,startMoving:void 0}),o.startX=g,o.startY=f,n.touchStartTime=ke(),r.allowClick=!0,r.updateSize(),r.swipeDirection=void 0,a.threshold>0&&(n.allowThresholdMove=!1);let _=!0;c.matches(n.focusableElements)&&(_=!1,"SELECT"===c.nodeName&&(n.isTouched=!1)),e.activeElement&&e.activeElement.matches(n.focusableElements)&&e.activeElement!==c&&("mouse"===i.pointerType||"mouse"!==i.pointerType&&!c.matches(n.focusableElements))&&e.activeElement.blur(),(a.touchStartForcePreventDefault||_&&r.allowTouchMove&&a.touchStartPreventDefault)&&!c.isContentEditable&&i.preventDefault(),a.freeMode&&a.freeMode.enabled&&r.freeMode&&r.animating&&!a.cssMode&&r.freeMode.onTouchStart(),r.emit("touchStart",i)}function ci(s){const r=X(),e=this,i=e.touchEventsData,{params:n,touches:a,rtlTranslate:o,enabled:l}=e;if(!l||!n.simulateTouch&&"mouse"===s.pointerType)return;let d,c=s;if(c.originalEvent&&(c=c.originalEvent),"pointermove"===c.type&&(null!==i.touchId||c.pointerId!==i.pointerId))return;if("touchmove"===c.type){if(d=[...c.changedTouches].find(z=>z.identifier===i.touchId),!d||d.identifier!==i.touchId)return}else d=c;if(!i.isTouched)return void(i.startMoving&&i.isScrolling&&e.emit("touchMoveOpposite",c));const u=d.pageX,p=d.pageY;if(c.preventedByNestedSwiper)return a.startX=u,void(a.startY=p);if(!e.allowTouchMove)return c.target.matches(i.focusableElements)||(e.allowClick=!1),void(i.isTouched&&(Object.assign(a,{startX:u,startY:p,currentX:u,currentY:p}),i.touchStartTime=ke()));if(n.touchReleaseOnEdges&&!n.loop)if(e.isVertical()){if(p<a.startY&&e.translate<=e.maxTranslate()||p>a.startY&&e.translate>=e.minTranslate())return i.isTouched=!1,void(i.isMoved=!1)}else{if(o&&(u>a.startX&&-e.translate<=e.maxTranslate()||u<a.startX&&-e.translate>=e.minTranslate()))return;if(!o&&(u<a.startX&&e.translate<=e.maxTranslate()||u>a.startX&&e.translate>=e.minTranslate()))return}if(r.activeElement&&r.activeElement.matches(i.focusableElements)&&r.activeElement!==c.target&&"mouse"!==c.pointerType&&r.activeElement.blur(),r.activeElement&&c.target===r.activeElement&&c.target.matches(i.focusableElements))return i.isMoved=!0,void(e.allowClick=!1);i.allowTouchCallbacks&&e.emit("touchMove",c),a.previousX=a.currentX,a.previousY=a.currentY,a.currentX=u,a.currentY=p;const h=a.currentX-a.startX,g=a.currentY-a.startY;if(e.params.threshold&&Math.sqrt(h**2+g**2)<e.params.threshold)return;if(typeof i.isScrolling>"u"){let z;e.isHorizontal()&&a.currentY===a.startY||e.isVertical()&&a.currentX===a.startX?i.isScrolling=!1:h*h+g*g>=25&&(z=180*Math.atan2(Math.abs(g),Math.abs(h))/Math.PI,i.isScrolling=e.isHorizontal()?z>n.touchAngle:90-z>n.touchAngle)}if(i.isScrolling&&e.emit("touchMoveOpposite",c),typeof i.startMoving>"u"&&(a.currentX!==a.startX||a.currentY!==a.startY)&&(i.startMoving=!0),i.isScrolling||"touchmove"===c.type&&i.preventTouchMoveFromPointerMove)return void(i.isTouched=!1);if(!i.startMoving)return;e.allowClick=!1,!n.cssMode&&c.cancelable&&c.preventDefault(),n.touchMoveStopPropagation&&!n.nested&&c.stopPropagation();let f=e.isHorizontal()?h:g,_=e.isHorizontal()?a.currentX-a.previousX:a.currentY-a.previousY;n.oneWayMovement&&(f=Math.abs(f)*(o?1:-1),_=Math.abs(_)*(o?1:-1)),a.diff=f,f*=n.touchRatio,o&&(f=-f,_=-_);const T=e.touchesDirection;e.swipeDirection=f>0?"prev":"next",e.touchesDirection=_>0?"prev":"next";const m=e.params.loop&&!n.cssMode,b="next"===e.touchesDirection&&e.allowSlideNext||"prev"===e.touchesDirection&&e.allowSlidePrev;if(!i.isMoved){if(m&&b&&e.loopFix({direction:e.swipeDirection}),i.startTranslate=e.getTranslate(),e.setTransition(0),e.animating){const z=new window.CustomEvent("transitionend",{bubbles:!0,cancelable:!0,detail:{bySwiperTouchMove:!0}});e.wrapperEl.dispatchEvent(z)}i.allowMomentumBounce=!1,n.grabCursor&&(!0===e.allowSlideNext||!0===e.allowSlidePrev)&&e.setGrabCursor(!0),e.emit("sliderFirstMove",c)}if((new Date).getTime(),!1!==n._loopSwapReset&&i.isMoved&&i.allowThresholdMove&&T!==e.touchesDirection&&m&&b&&Math.abs(f)>=1)return Object.assign(a,{startX:u,startY:p,currentX:u,currentY:p,startTranslate:i.currentTranslate}),i.loopSwapReset=!0,void(i.startTranslate=i.currentTranslate);e.emit("sliderMove",c),i.isMoved=!0,i.currentTranslate=f+i.startTranslate;let k=!0,S=n.resistanceRatio;if(n.touchReleaseOnEdges&&(S=0),f>0?(m&&b&&i.allowThresholdMove&&i.currentTranslate>(n.centeredSlides?e.minTranslate()-e.slidesSizesGrid[e.activeIndex+1]-("auto"!==n.slidesPerView&&e.slides.length-n.slidesPerView>=2?e.slidesSizesGrid[e.activeIndex+1]+e.params.spaceBetween:0)-e.params.spaceBetween:e.minTranslate())&&e.loopFix({direction:"prev",setTranslate:!0,activeSlideIndex:0}),i.currentTranslate>e.minTranslate()&&(k=!1,n.resistance&&(i.currentTranslate=e.minTranslate()-1+(-e.minTranslate()+i.startTranslate+f)**S))):f<0&&(m&&b&&i.allowThresholdMove&&i.currentTranslate<(n.centeredSlides?e.maxTranslate()+e.slidesSizesGrid[e.slidesSizesGrid.length-1]+e.params.spaceBetween+("auto"!==n.slidesPerView&&e.slides.length-n.slidesPerView>=2?e.slidesSizesGrid[e.slidesSizesGrid.length-1]+e.params.spaceBetween:0):e.maxTranslate())&&e.loopFix({direction:"next",setTranslate:!0,activeSlideIndex:e.slides.length-("auto"===n.slidesPerView?e.slidesPerViewDynamic():Math.ceil(parseFloat(n.slidesPerView,10)))}),i.currentTranslate<e.maxTranslate()&&(k=!1,n.resistance&&(i.currentTranslate=e.maxTranslate()+1-(e.maxTranslate()-i.startTranslate-f)**S))),k&&(c.preventedByNestedSwiper=!0),!e.allowSlideNext&&"next"===e.swipeDirection&&i.currentTranslate<i.startTranslate&&(i.currentTranslate=i.startTranslate),!e.allowSlidePrev&&"prev"===e.swipeDirection&&i.currentTranslate>i.startTranslate&&(i.currentTranslate=i.startTranslate),!e.allowSlidePrev&&!e.allowSlideNext&&(i.currentTranslate=i.startTranslate),n.threshold>0){if(!(Math.abs(f)>n.threshold||i.allowThresholdMove))return void(i.currentTranslate=i.startTranslate);if(!i.allowThresholdMove)return i.allowThresholdMove=!0,a.startX=a.currentX,a.startY=a.currentY,i.currentTranslate=i.startTranslate,void(a.diff=e.isHorizontal()?a.currentX-a.startX:a.currentY-a.startY)}!n.followFinger||n.cssMode||((n.freeMode&&n.freeMode.enabled&&e.freeMode||n.watchSlidesProgress)&&(e.updateActiveIndex(),e.updateSlidesClasses()),n.freeMode&&n.freeMode.enabled&&e.freeMode&&e.freeMode.onTouchMove(),e.updateProgress(i.currentTranslate),e.setTranslate(i.currentTranslate))}function ui(s){const r=this,e=r.touchEventsData;let n,i=s;if(i.originalEvent&&(i=i.originalEvent),"touchend"===i.type||"touchcancel"===i.type){if(n=[...i.changedTouches].find(S=>S.identifier===e.touchId),!n||n.identifier!==e.touchId)return}else{if(null!==e.touchId||i.pointerId!==e.pointerId)return;n=i}if(["pointercancel","pointerout","pointerleave","contextmenu"].includes(i.type)&&(!["pointercancel","contextmenu"].includes(i.type)||!r.browser.isSafari&&!r.browser.isWebView))return;e.pointerId=null,e.touchId=null;const{params:o,touches:l,rtlTranslate:c,slidesGrid:d,enabled:u}=r;if(!u||!o.simulateTouch&&"mouse"===i.pointerType)return;if(e.allowTouchCallbacks&&r.emit("touchEnd",i),e.allowTouchCallbacks=!1,!e.isTouched)return e.isMoved&&o.grabCursor&&r.setGrabCursor(!1),e.isMoved=!1,void(e.startMoving=!1);o.grabCursor&&e.isMoved&&e.isTouched&&(!0===r.allowSlideNext||!0===r.allowSlidePrev)&&r.setGrabCursor(!1);const p=ke(),h=p-e.touchStartTime;if(r.allowClick){const S=i.path||i.composedPath&&i.composedPath();r.updateClickedSlide(S&&S[0]||i.target,S),r.emit("tap click",i),h<300&&p-e.lastClickTime<300&&r.emit("doubleTap doubleClick",i)}if(e.lastClickTime=ke(),Le(()=>{r.destroyed||(r.allowClick=!0)}),!e.isTouched||!e.isMoved||!r.swipeDirection||0===l.diff&&!e.loopSwapReset||e.currentTranslate===e.startTranslate&&!e.loopSwapReset)return e.isTouched=!1,e.isMoved=!1,void(e.startMoving=!1);let g;if(e.isTouched=!1,e.isMoved=!1,e.startMoving=!1,g=o.followFinger?c?r.translate:-r.translate:-e.currentTranslate,o.cssMode)return;if(o.freeMode&&o.freeMode.enabled)return void r.freeMode.onTouchEnd({currentPos:g});const f=g>=-r.maxTranslate()&&!r.params.loop;let _=0,T=r.slidesSizesGrid[0];for(let S=0;S<d.length;S+=S<o.slidesPerGroupSkip?1:o.slidesPerGroup){const z=S<o.slidesPerGroupSkip-1?1:o.slidesPerGroup;typeof d[S+z]<"u"?(f||g>=d[S]&&g<d[S+z])&&(_=S,T=d[S+z]-d[S]):(f||g>=d[S])&&(_=S,T=d[d.length-1]-d[d.length-2])}let m=null,b=null;o.rewind&&(r.isBeginning?b=o.virtual&&o.virtual.enabled&&r.virtual?r.virtual.slides.length-1:r.slides.length-1:r.isEnd&&(m=0));const v=(g-d[_])/T,k=_<o.slidesPerGroupSkip-1?1:o.slidesPerGroup;if(h>o.longSwipesMs){if(!o.longSwipes)return void r.slideTo(r.activeIndex);"next"===r.swipeDirection&&r.slideTo(v>=o.longSwipesRatio?o.rewind&&r.isEnd?m:_+k:_),"prev"===r.swipeDirection&&(v>1-o.longSwipesRatio?r.slideTo(_+k):null!==b&&v<0&&Math.abs(v)>o.longSwipesRatio?r.slideTo(b):r.slideTo(_))}else{if(!o.shortSwipes)return void r.slideTo(r.activeIndex);!r.navigation||i.target!==r.navigation.nextEl&&i.target!==r.navigation.prevEl?("next"===r.swipeDirection&&r.slideTo(null!==m?m:_+k),"prev"===r.swipeDirection&&r.slideTo(null!==b?b:_)):r.slideTo(i.target===r.navigation.nextEl?_+k:_)}}function tt(){const s=this,{params:r,el:e}=s;if(e&&0===e.offsetWidth)return;r.breakpoints&&s.setBreakpoint();const{allowSlideNext:i,allowSlidePrev:n,snapGrid:a}=s,o=s.virtual&&s.params.virtual.enabled;s.allowSlideNext=!0,s.allowSlidePrev=!0,s.updateSize(),s.updateSlides(),s.updateSlidesClasses(),!("auto"===r.slidesPerView||r.slidesPerView>1)||!s.isEnd||s.isBeginning||s.params.centeredSlides||o&&r.loop?s.params.loop&&!o?s.slideToLoop(s.realIndex,0,!1,!0):s.slideTo(s.activeIndex,0,!1,!0):s.slideTo(s.slides.length-1,0,!1,!0),s.autoplay&&s.autoplay.running&&s.autoplay.paused&&(clearTimeout(s.autoplay.resizeTimeout),s.autoplay.resizeTimeout=setTimeout(()=>{s.autoplay&&s.autoplay.running&&s.autoplay.paused&&s.autoplay.resume()},500)),s.allowSlidePrev=n,s.allowSlideNext=i,s.params.watchOverflow&&a!==s.snapGrid&&s.checkOverflow()}function pi(s){const r=this;r.enabled&&(r.allowClick||(r.params.preventClicks&&s.preventDefault(),r.params.preventClicksPropagation&&r.animating&&(s.stopPropagation(),s.stopImmediatePropagation())))}function hi(){const s=this,{wrapperEl:r,rtlTranslate:e,enabled:i}=s;if(!i)return;let n;s.previousTranslate=s.translate,s.translate=s.isHorizontal()?-r.scrollLeft:-r.scrollTop,0===s.translate&&(s.translate=0),s.updateActiveIndex(),s.updateSlidesClasses();const a=s.maxTranslate()-s.minTranslate();n=0===a?0:(s.translate-s.minTranslate())/a,n!==s.progress&&s.updateProgress(e?-s.translate:s.translate),s.emit("setTranslate",s.translate,!1)}function gi(s){const r=this;ze(r,s.target),!r.params.cssMode&&("auto"===r.params.slidesPerView||r.params.autoHeight)&&r.update()}function fi(){const s=this;s.documentTouchHandlerProceeded||(s.documentTouchHandlerProceeded=!0,s.params.touchReleaseOnEdges&&(s.el.style.touchAction="auto"))}const it=(s,r)=>{const e=X(),{params:i,el:n,wrapperEl:a,device:o}=s,l=!!i.nested,c="on"===r?"addEventListener":"removeEventListener",d=r;!n||"string"==typeof n||(e[c]("touchstart",s.onDocumentTouchStart,{passive:!1,capture:l}),n[c]("touchstart",s.onTouchStart,{passive:!1}),n[c]("pointerdown",s.onTouchStart,{passive:!1}),e[c]("touchmove",s.onTouchMove,{passive:!1,capture:l}),e[c]("pointermove",s.onTouchMove,{passive:!1,capture:l}),e[c]("touchend",s.onTouchEnd,{passive:!0}),e[c]("pointerup",s.onTouchEnd,{passive:!0}),e[c]("pointercancel",s.onTouchEnd,{passive:!0}),e[c]("touchcancel",s.onTouchEnd,{passive:!0}),e[c]("pointerout",s.onTouchEnd,{passive:!0}),e[c]("pointerleave",s.onTouchEnd,{passive:!0}),e[c]("contextmenu",s.onTouchEnd,{passive:!0}),(i.preventClicks||i.preventClicksPropagation)&&n[c]("click",s.onClick,!0),i.cssMode&&a[c]("scroll",s.onScroll),s[d](i.updateOnWindowResize?o.ios||o.android?"resize orientationchange observerUpdate":"resize observerUpdate":"observerUpdate",tt,!0),n[c]("load",s.onLoad,{capture:!0}))},st=(s,r)=>s.grid&&r.grid&&r.grid.rows>1;var rt={init:!0,direction:"horizontal",oneWayMovement:!1,swiperElementNodeName:"SWIPER-CONTAINER",touchEventsTarget:"wrapper",initialSlide:0,speed:300,cssMode:!1,updateOnWindowResize:!0,resizeObserver:!0,nested:!1,createElements:!1,eventsPrefix:"swiper",enabled:!0,focusableElements:"input, select, option, textarea, button, video, label",width:null,height:null,preventInteractionOnTransition:!1,userAgent:null,url:null,edgeSwipeDetection:!1,edgeSwipeThreshold:20,autoHeight:!1,setWrapperSize:!1,virtualTranslate:!1,effect:"slide",breakpoints:void 0,breakpointsBase:"window",spaceBetween:0,slidesPerView:1,slidesPerGroup:1,slidesPerGroupSkip:0,slidesPerGroupAuto:!1,centeredSlides:!1,centeredSlidesBounds:!1,slidesOffsetBefore:0,slidesOffsetAfter:0,normalizeSlideIndex:!0,centerInsufficientSlides:!1,watchOverflow:!0,roundLengths:!1,touchRatio:1,touchAngle:45,simulateTouch:!0,shortSwipes:!0,longSwipes:!0,longSwipesRatio:.5,longSwipesMs:300,followFinger:!0,allowTouchMove:!0,threshold:5,touchMoveStopPropagation:!1,touchStartPreventDefault:!0,touchStartForcePreventDefault:!1,touchReleaseOnEdges:!1,uniqueNavElements:!0,resistance:!0,resistanceRatio:.85,watchSlidesProgress:!1,grabCursor:!1,preventClicks:!0,preventClicksPropagation:!0,slideToClickedSlide:!1,loop:!1,loopAddBlankSlides:!0,loopAdditionalSlides:0,loopPreventsSliding:!0,rewind:!1,allowSlidePrev:!0,allowSlideNext:!0,swipeHandler:null,noSwiping:!0,noSwipingClass:"swiper-no-swiping",noSwipingSelector:null,passiveListeners:!0,maxBackfaceHiddenSlides:10,containerModifierClass:"swiper-",slideClass:"swiper-slide",slideBlankClass:"swiper-slide-blank",slideActiveClass:"swiper-slide-active",slideVisibleClass:"swiper-slide-visible",slideFullyVisibleClass:"swiper-slide-fully-visible",slideNextClass:"swiper-slide-next",slidePrevClass:"swiper-slide-prev",wrapperClass:"swiper-wrapper",lazyPreloaderClass:"swiper-lazy-preloader",lazyPreloadPrevNext:0,runCallbacksOnInit:!0,_emitClasses:!1};function zi(s,r){return function(i){void 0===i&&(i={});const n=Object.keys(i)[0],a=i[n];"object"==typeof a&&null!==a?(!0===s[n]&&(s[n]={enabled:!0}),"navigation"===n&&s[n]&&s[n].enabled&&!s[n].prevEl&&!s[n].nextEl&&(s[n].auto=!0),["pagination","scrollbar"].indexOf(n)>=0&&s[n]&&s[n].enabled&&!s[n].el&&(s[n].auto=!0),n in s&&"enabled"in a?("object"==typeof s[n]&&!("enabled"in s[n])&&(s[n].enabled=!0),s[n]||(s[n]={enabled:!1}),K(r,i)):K(r,i)):K(r,i)}}const Be={eventsEmitter:{on(s,r,e){const i=this;if(!i.eventsListeners||i.destroyed||"function"!=typeof r)return i;const n=e?"unshift":"push";return s.split(" ").forEach(a=>{i.eventsListeners[a]||(i.eventsListeners[a]=[]),i.eventsListeners[a][n](r)}),i},once(s,r,e){const i=this;if(!i.eventsListeners||i.destroyed||"function"!=typeof r)return i;function n(){i.off(s,n),n.__emitterProxy&&delete n.__emitterProxy;for(var a=arguments.length,o=new Array(a),l=0;l<a;l++)o[l]=arguments[l];r.apply(i,o)}return n.__emitterProxy=r,i.on(s,n,e)},onAny(s,r){const e=this;if(!e.eventsListeners||e.destroyed||"function"!=typeof s)return e;const i=r?"unshift":"push";return e.eventsAnyListeners.indexOf(s)<0&&e.eventsAnyListeners[i](s),e},offAny(s){const r=this;if(!r.eventsListeners||r.destroyed||!r.eventsAnyListeners)return r;const e=r.eventsAnyListeners.indexOf(s);return e>=0&&r.eventsAnyListeners.splice(e,1),r},off(s,r){const e=this;return!e.eventsListeners||e.destroyed||!e.eventsListeners||s.split(" ").forEach(i=>{typeof r>"u"?e.eventsListeners[i]=[]:e.eventsListeners[i]&&e.eventsListeners[i].forEach((n,a)=>{(n===r||n.__emitterProxy&&n.__emitterProxy===r)&&e.eventsListeners[i].splice(a,1)})}),e},emit(){const s=this;if(!s.eventsListeners||s.destroyed||!s.eventsListeners)return s;let r,e,i;for(var n=arguments.length,a=new Array(n),o=0;o<n;o++)a[o]=arguments[o];return"string"==typeof a[0]||Array.isArray(a[0])?(r=a[0],e=a.slice(1,a.length),i=s):(r=a[0].events,e=a[0].data,i=a[0].context||s),e.unshift(i),(Array.isArray(r)?r:r.split(" ")).forEach(c=>{s.eventsAnyListeners&&s.eventsAnyListeners.length&&s.eventsAnyListeners.forEach(d=>{d.apply(i,[c,...e])}),s.eventsListeners&&s.eventsListeners[c]&&s.eventsListeners[c].forEach(d=>{d.apply(i,e)})}),s}},update:{updateSize:function It(){const s=this;let r,e;const i=s.el;r=typeof s.params.width<"u"&&null!==s.params.width?s.params.width:i.clientWidth,e=typeof s.params.height<"u"&&null!==s.params.height?s.params.height:i.clientHeight,!(0===r&&s.isHorizontal()||0===e&&s.isVertical())&&(r=r-parseInt(oe(i,"padding-left")||0,10)-parseInt(oe(i,"padding-right")||0,10),e=e-parseInt(oe(i,"padding-top")||0,10)-parseInt(oe(i,"padding-bottom")||0,10),Number.isNaN(r)&&(r=0),Number.isNaN(e)&&(e=0),Object.assign(s,{width:r,height:e,size:s.isHorizontal()?r:e}))},updateSlides:function Et(){const s=this;function r(y,I){return parseFloat(y.getPropertyValue(s.getDirectionLabel(I))||0)}const e=s.params,{wrapperEl:i,slidesEl:n,size:a,rtlTranslate:o,wrongRTL:l}=s,c=s.virtual&&e.virtual.enabled,d=c?s.virtual.slides.length:s.slides.length,u=se(n,`.${s.params.slideClass}, swiper-slide`),p=c?s.virtual.slides.length:u.length;let h=[];const g=[],f=[];let _=e.slidesOffsetBefore;"function"==typeof _&&(_=e.slidesOffsetBefore.call(s));let T=e.slidesOffsetAfter;"function"==typeof T&&(T=e.slidesOffsetAfter.call(s));const m=s.snapGrid.length,b=s.slidesGrid.length;let v=e.spaceBetween,k=-_,S=0,z=0;if(typeof a>"u")return;"string"==typeof v&&v.indexOf("%")>=0?v=parseFloat(v.replace("%",""))/100*a:"string"==typeof v&&(v=parseFloat(v)),s.virtualSize=-v,u.forEach(y=>{o?y.style.marginLeft="":y.style.marginRight="",y.style.marginBottom="",y.style.marginTop=""}),e.centeredSlides&&e.cssMode&&(Ie(i,"--swiper-centered-offset-before",""),Ie(i,"--swiper-centered-offset-after",""));const D=e.grid&&e.grid.rows>1&&s.grid;let x;D?s.grid.initSlides(u):s.grid&&s.grid.unsetSlides();const Q="auto"===e.slidesPerView&&e.breakpoints&&Object.keys(e.breakpoints).filter(y=>typeof e.breakpoints[y].slidesPerView<"u").length>0;for(let y=0;y<p;y+=1){let I;if(x=0,u[y]&&(I=u[y]),D&&s.grid.updateSlide(y,I,u),!u[y]||"none"!==oe(I,"display")){if("auto"===e.slidesPerView){Q&&(u[y].style[s.getDirectionLabel("width")]="");const A=getComputedStyle(I),W=I.style.transform,le=I.style.webkitTransform;if(W&&(I.style.transform="none"),le&&(I.style.webkitTransform="none"),e.roundLengths)x=s.isHorizontal()?Ye(I,"width",!0):Ye(I,"height",!0);else{const de=r(A,"width"),L=r(A,"padding-left"),U=r(A,"padding-right"),q=r(A,"margin-left"),ne=r(A,"margin-right"),dt=A.getPropertyValue("box-sizing");if(dt&&"border-box"===dt)x=de+q+ne;else{const{clientWidth:Ts,offsetWidth:xs}=I;x=de+L+U+q+ne+(xs-Ts)}}W&&(I.style.transform=W),le&&(I.style.webkitTransform=le),e.roundLengths&&(x=Math.floor(x))}else x=(a-(e.slidesPerView-1)*v)/e.slidesPerView,e.roundLengths&&(x=Math.floor(x)),u[y]&&(u[y].style[s.getDirectionLabel("width")]=`${x}px`);u[y]&&(u[y].swiperSlideSize=x),f.push(x),e.centeredSlides?(k=k+x/2+S/2+v,0===S&&0!==y&&(k=k-a/2-v),0===y&&(k=k-a/2-v),Math.abs(k)<.001&&(k=0),e.roundLengths&&(k=Math.floor(k)),z%e.slidesPerGroup==0&&h.push(k),g.push(k)):(e.roundLengths&&(k=Math.floor(k)),(z-Math.min(s.params.slidesPerGroupSkip,z))%s.params.slidesPerGroup==0&&h.push(k),g.push(k),k=k+x+v),s.virtualSize+=x+v,S=x,z+=1}}if(s.virtualSize=Math.max(s.virtualSize,a)+T,o&&l&&("slide"===e.effect||"coverflow"===e.effect)&&(i.style.width=`${s.virtualSize+v}px`),e.setWrapperSize&&(i.style[s.getDirectionLabel("width")]=`${s.virtualSize+v}px`),D&&s.grid.updateWrapperSize(x,h),!e.centeredSlides){const y=[];for(let I=0;I<h.length;I+=1){let A=h[I];e.roundLengths&&(A=Math.floor(A)),h[I]<=s.virtualSize-a&&y.push(A)}h=y,Math.floor(s.virtualSize-a)-Math.floor(h[h.length-1])>1&&h.push(s.virtualSize-a)}if(c&&e.loop){const y=f[0]+v;if(e.slidesPerGroup>1){const I=Math.ceil((s.virtual.slidesBefore+s.virtual.slidesAfter)/e.slidesPerGroup),A=y*e.slidesPerGroup;for(let W=0;W<I;W+=1)h.push(h[h.length-1]+A)}for(let I=0;I<s.virtual.slidesBefore+s.virtual.slidesAfter;I+=1)1===e.slidesPerGroup&&h.push(h[h.length-1]+y),g.push(g[g.length-1]+y),s.virtualSize+=y}if(0===h.length&&(h=[0]),0!==v){const y=s.isHorizontal()&&o?"marginLeft":s.getDirectionLabel("marginRight");u.filter((I,A)=>!(e.cssMode&&!e.loop)||A!==u.length-1).forEach(I=>{I.style[y]=`${v}px`})}if(e.centeredSlides&&e.centeredSlidesBounds){let y=0;f.forEach(A=>{y+=A+(v||0)}),y-=v;const I=y>a?y-a:0;h=h.map(A=>A<=0?-_:A>I?I+T:A)}if(e.centerInsufficientSlides){let y=0;f.forEach(A=>{y+=A+(v||0)}),y-=v;const I=(e.slidesOffsetBefore||0)+(e.slidesOffsetAfter||0);if(y+I<a){const A=(a-y-I)/2;h.forEach((W,le)=>{h[le]=W-A}),g.forEach((W,le)=>{g[le]=W+A})}}if(Object.assign(s,{slides:u,snapGrid:h,slidesGrid:g,slidesSizesGrid:f}),e.centeredSlides&&e.cssMode&&!e.centeredSlidesBounds){Ie(i,"--swiper-centered-offset-before",-h[0]+"px"),Ie(i,"--swiper-centered-offset-after",s.size/2-f[f.length-1]/2+"px");const y=-s.snapGrid[0],I=-s.slidesGrid[0];s.snapGrid=s.snapGrid.map(A=>A+y),s.slidesGrid=s.slidesGrid.map(A=>A+I)}if(p!==d&&s.emit("slidesLengthChange"),h.length!==m&&(s.params.watchOverflow&&s.checkOverflow(),s.emit("snapGridLengthChange")),g.length!==b&&s.emit("slidesGridLengthChange"),e.watchSlidesProgress&&s.updateSlidesOffset(),s.emit("slidesUpdated"),!(c||e.cssMode||"slide"!==e.effect&&"fade"!==e.effect)){const y=`${e.containerModifierClass}backface-hidden`,I=s.el.classList.contains(y);p<=e.maxBackfaceHiddenSlides?I||s.el.classList.add(y):I&&s.el.classList.remove(y)}},updateAutoHeight:function zt(s){const r=this,e=[],i=r.virtual&&r.params.virtual.enabled;let a,n=0;"number"==typeof s?r.setTransition(s):!0===s&&r.setTransition(r.params.speed);const o=l=>i?r.slides[r.getSlideIndexByData(l)]:r.slides[l];if("auto"!==r.params.slidesPerView&&r.params.slidesPerView>1)if(r.params.centeredSlides)(r.visibleSlides||[]).forEach(l=>{e.push(l)});else for(a=0;a<Math.ceil(r.params.slidesPerView);a+=1){const l=r.activeIndex+a;if(l>r.slides.length&&!i)break;e.push(o(l))}else e.push(o(r.activeIndex));for(a=0;a<e.length;a+=1)if(typeof e[a]<"u"){const l=e[a].offsetHeight;n=l>n?l:n}(n||0===n)&&(r.wrapperEl.style.height=`${n}px`)},updateSlidesOffset:function Tt(){const s=this,r=s.slides,e=s.isElement?s.isHorizontal()?s.wrapperEl.offsetLeft:s.wrapperEl.offsetTop:0;for(let i=0;i<r.length;i+=1)r[i].swiperSlideOffset=(s.isHorizontal()?r[i].offsetLeft:r[i].offsetTop)-e-s.cssOverflowAdjustment()},updateSlidesProgress:function xt(s){void 0===s&&(s=this&&this.translate||0);const r=this,e=r.params,{slides:i,rtlTranslate:n,snapGrid:a}=r;if(0===i.length)return;typeof i[0].swiperSlideOffset>"u"&&r.updateSlidesOffset();let o=-s;n&&(o=s),r.visibleSlidesIndexes=[],r.visibleSlides=[];let l=e.spaceBetween;"string"==typeof l&&l.indexOf("%")>=0?l=parseFloat(l.replace("%",""))/100*r.size:"string"==typeof l&&(l=parseFloat(l));for(let c=0;c<i.length;c+=1){const d=i[c];let u=d.swiperSlideOffset;e.cssMode&&e.centeredSlides&&(u-=i[0].swiperSlideOffset);const p=(o+(e.centeredSlides?r.minTranslate():0)-u)/(d.swiperSlideSize+l),h=(o-a[0]+(e.centeredSlides?r.minTranslate():0)-u)/(d.swiperSlideSize+l),g=-(o-u),f=g+r.slidesSizesGrid[c],_=g>=0&&g<=r.size-r.slidesSizesGrid[c],T=g>=0&&g<r.size-1||f>1&&f<=r.size||g<=0&&f>=r.size;T&&(r.visibleSlides.push(d),r.visibleSlidesIndexes.push(c)),Ke(d,T,e.slideVisibleClass),Ke(d,_,e.slideFullyVisibleClass),d.progress=n?-p:p,d.originalProgress=n?-h:h}},updateProgress:function Lt(s){const r=this;typeof s>"u"&&(s=r&&r.translate&&r.translate*(r.rtlTranslate?-1:1)||0);const e=r.params,i=r.maxTranslate()-r.minTranslate();let{progress:n,isBeginning:a,isEnd:o,progressLoop:l}=r;const c=a,d=o;if(0===i)n=0,a=!0,o=!0;else{n=(s-r.minTranslate())/i;const u=Math.abs(s-r.minTranslate())<1,p=Math.abs(s-r.maxTranslate())<1;a=u||n<=0,o=p||n>=1,u&&(n=0),p&&(n=1)}if(e.loop){const u=r.getSlideIndexByData(0),p=r.getSlideIndexByData(r.slides.length-1),h=r.slidesGrid[u],g=r.slidesGrid[p],f=r.slidesGrid[r.slidesGrid.length-1],_=Math.abs(s);l=_>=h?(_-h)/f:(_+f-g)/f,l>1&&(l-=1)}Object.assign(r,{progress:n,progressLoop:l,isBeginning:a,isEnd:o}),(e.watchSlidesProgress||e.centeredSlides&&e.autoHeight)&&r.updateSlidesProgress(s),a&&!c&&r.emit("reachBeginning toEdge"),o&&!d&&r.emit("reachEnd toEdge"),(c&&!a||d&&!o)&&r.emit("fromEdge"),r.emit("progress",n)},updateSlidesClasses:function Ot(){const s=this,{slides:r,params:e,slidesEl:i,activeIndex:n}=s,o=s.grid&&e.grid&&e.grid.rows>1,l=p=>se(i,`.${e.slideClass}${p}, swiper-slide${p}`)[0];let c,d,u;if(s.virtual&&e.virtual.enabled)if(e.loop){let p=n-s.virtual.slidesBefore;p<0&&(p=s.virtual.slides.length+p),p>=s.virtual.slides.length&&(p-=s.virtual.slides.length),c=l(`[data-swiper-slide-index="${p}"]`)}else c=l(`[data-swiper-slide-index="${n}"]`);else o?(c=r.find(p=>p.column===n),u=r.find(p=>p.column===n+1),d=r.find(p=>p.column===n-1)):c=r[n];c&&(o||(u=function _t(s,r){const e=[];for(;s.nextElementSibling;){const i=s.nextElementSibling;r?i.matches(r)&&e.push(i):e.push(i),s=i}return e}(c,`.${e.slideClass}, swiper-slide`)[0],e.loop&&!u&&(u=r[0]),d=function vt(s,r){const e=[];for(;s.previousElementSibling;){const i=s.previousElementSibling;r?i.matches(r)&&e.push(i):e.push(i),s=i}return e}(c,`.${e.slideClass}, swiper-slide`)[0],e.loop&&0===!d&&(d=r[r.length-1]))),r.forEach(p=>{Pe(p,p===c,e.slideActiveClass),Pe(p,p===u,e.slideNextClass),Pe(p,p===d,e.slidePrevClass)}),s.emitSlidesClasses()},updateActiveIndex:function Dt(s){const r=this,e=r.rtlTranslate?r.translate:-r.translate,{snapGrid:i,params:n,activeIndex:a,realIndex:o,snapIndex:l}=r;let d,c=s;const u=g=>{let f=g-r.virtual.slidesBefore;return f<0&&(f=r.virtual.slides.length+f),f>=r.virtual.slides.length&&(f-=r.virtual.slides.length),f};if(typeof c>"u"&&(c=function At(s){const{slidesGrid:r,params:e}=s,i=s.rtlTranslate?s.translate:-s.translate;let n;for(let a=0;a<r.length;a+=1)typeof r[a+1]<"u"?i>=r[a]&&i<r[a+1]-(r[a+1]-r[a])/2?n=a:i>=r[a]&&i<r[a+1]&&(n=a+1):i>=r[a]&&(n=a);return e.normalizeSlideIndex&&(n<0||typeof n>"u")&&(n=0),n}(r)),i.indexOf(e)>=0)d=i.indexOf(e);else{const g=Math.min(n.slidesPerGroupSkip,c);d=g+Math.floor((c-g)/n.slidesPerGroup)}if(d>=i.length&&(d=i.length-1),c===a&&!r.params.loop)return void(d!==l&&(r.snapIndex=d,r.emit("snapIndexChange")));if(c===a&&r.params.loop&&r.virtual&&r.params.virtual.enabled)return void(r.realIndex=u(c));const p=r.grid&&n.grid&&n.grid.rows>1;let h;if(r.virtual&&n.virtual.enabled&&n.loop)h=u(c);else if(p){const g=r.slides.find(_=>_.column===c);let f=parseInt(g.getAttribute("data-swiper-slide-index"),10);Number.isNaN(f)&&(f=Math.max(r.slides.indexOf(g),0)),h=Math.floor(f/n.grid.rows)}else if(r.slides[c]){const g=r.slides[c].getAttribute("data-swiper-slide-index");h=g?parseInt(g,10):c}else h=c;Object.assign(r,{previousSnapIndex:l,snapIndex:d,previousRealIndex:o,realIndex:h,previousIndex:a,activeIndex:c}),r.initialized&&Re(r),r.emit("activeIndexChange"),r.emit("snapIndexChange"),(r.initialized||r.params.runCallbacksOnInit)&&(o!==h&&r.emit("realIndexChange"),r.emit("slideChange"))},updateClickedSlide:function Ft(s,r){const e=this,i=e.params;let n=s.closest(`.${i.slideClass}, swiper-slide`);!n&&e.isElement&&r&&r.length>1&&r.includes(s)&&[...r.slice(r.indexOf(s)+1,r.length)].forEach(l=>{!n&&l.matches&&l.matches(`.${i.slideClass}, swiper-slide`)&&(n=l)});let o,a=!1;if(n)for(let l=0;l<e.slides.length;l+=1)if(e.slides[l]===n){a=!0,o=l;break}if(!n||!a)return e.clickedSlide=void 0,void(e.clickedIndex=void 0);e.clickedSlide=n,e.clickedIndex=e.virtual&&e.params.virtual.enabled?parseInt(n.getAttribute("data-swiper-slide-index"),10):o,i.slideToClickedSlide&&void 0!==e.clickedIndex&&e.clickedIndex!==e.activeIndex&&e.slideToClickedSlide()}},translate:{getTranslate:function jt(s){void 0===s&&(s=this.isHorizontal()?"x":"y");const{params:e,rtlTranslate:i,translate:n,wrapperEl:a}=this;if(e.virtualTranslate)return i?-n:n;if(e.cssMode)return n;let o=function ht(s,r){void 0===r&&(r="x");const e=Y();let i,n,a;const o=function pt(s){const r=Y();let e;return r.getComputedStyle&&(e=r.getComputedStyle(s,null)),!e&&s.currentStyle&&(e=s.currentStyle),e||(e=s.style),e}(s);return e.WebKitCSSMatrix?(n=o.transform||o.webkitTransform,n.split(",").length>6&&(n=n.split(", ").map(l=>l.replace(",",".")).join(", ")),a=new e.WebKitCSSMatrix("none"===n?"":n)):(a=o.MozTransform||o.OTransform||o.MsTransform||o.msTransform||o.transform||o.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,"),i=a.toString().split(",")),"x"===r&&(n=e.WebKitCSSMatrix?a.m41:16===i.length?parseFloat(i[12]):parseFloat(i[4])),"y"===r&&(n=e.WebKitCSSMatrix?a.m42:16===i.length?parseFloat(i[13]):parseFloat(i[5])),n||0}(a,s);return o+=this.cssOverflowAdjustment(),i&&(o=-o),o||0},setTranslate:function Rt(s,r){const e=this,{rtlTranslate:i,params:n,wrapperEl:a,progress:o}=e;let u,l=0,c=0;e.isHorizontal()?l=i?-s:s:c=s,n.roundLengths&&(l=Math.floor(l),c=Math.floor(c)),e.previousTranslate=e.translate,e.translate=e.isHorizontal()?l:c,n.cssMode?a[e.isHorizontal()?"scrollLeft":"scrollTop"]=e.isHorizontal()?-l:-c:n.virtualTranslate||(e.isHorizontal()?l-=e.cssOverflowAdjustment():c-=e.cssOverflowAdjustment(),a.style.transform=`translate3d(${l}px, ${c}px, 0px)`);const p=e.maxTranslate()-e.minTranslate();u=0===p?0:(s-e.minTranslate())/p,u!==o&&e.updateProgress(s),e.emit("setTranslate",e.translate,r)},minTranslate:function Bt(){return-this.snapGrid[0]},maxTranslate:function Gt(){return-this.snapGrid[this.snapGrid.length-1]},translateTo:function Vt(s,r,e,i,n){void 0===s&&(s=0),void 0===r&&(r=this.params.speed),void 0===e&&(e=!0),void 0===i&&(i=!0);const a=this,{params:o,wrapperEl:l}=a;if(a.animating&&o.preventInteractionOnTransition)return!1;const c=a.minTranslate(),d=a.maxTranslate();let u;if(u=i&&s>c?c:i&&s<d?d:s,a.updateProgress(u),o.cssMode){const p=a.isHorizontal();if(0===r)l[p?"scrollLeft":"scrollTop"]=-u;else{if(!a.support.smoothScroll)return Ue({swiper:a,targetPosition:-u,side:p?"left":"top"}),!0;l.scrollTo({[p?"left":"top"]:-u,behavior:"smooth"})}return!0}return 0===r?(a.setTransition(0),a.setTranslate(u),e&&(a.emit("beforeTransitionStart",r,n),a.emit("transitionEnd"))):(a.setTransition(r),a.setTranslate(u),e&&(a.emit("beforeTransitionStart",r,n),a.emit("transitionStart")),a.animating||(a.animating=!0,a.onTranslateToWrapperTransitionEnd||(a.onTranslateToWrapperTransitionEnd=function(h){!a||a.destroyed||h.target===this&&(a.wrapperEl.removeEventListener("transitionend",a.onTranslateToWrapperTransitionEnd),a.onTranslateToWrapperTransitionEnd=null,delete a.onTranslateToWrapperTransitionEnd,a.animating=!1,e&&a.emit("transitionEnd"))}),a.wrapperEl.addEventListener("transitionend",a.onTranslateToWrapperTransitionEnd))),!0}},transition:{setTransition:function Wt(s,r){const e=this;e.params.cssMode||(e.wrapperEl.style.transitionDuration=`${s}ms`,e.wrapperEl.style.transitionDelay=0===s?"0ms":""),e.emit("setTransition",s,r)},transitionStart:function Nt(s,r){void 0===s&&(s=!0);const e=this,{params:i}=e;i.cssMode||(i.autoHeight&&e.updateAutoHeight(),Je({swiper:e,runCallbacks:s,direction:r,step:"Start"}))},transitionEnd:function Xt(s,r){void 0===s&&(s=!0);const e=this,{params:i}=e;e.animating=!1,!i.cssMode&&(e.setTransition(0),Je({swiper:e,runCallbacks:s,direction:r,step:"End"}))}},slide:{slideTo:function Ht(s,r,e,i,n){void 0===s&&(s=0),void 0===e&&(e=!0),"string"==typeof s&&(s=parseInt(s,10));const a=this;let o=s;o<0&&(o=0);const{params:l,snapGrid:c,slidesGrid:d,previousIndex:u,activeIndex:p,rtlTranslate:h,wrapperEl:g,enabled:f}=a;if(!f&&!i&&!n||a.destroyed||a.animating&&l.preventInteractionOnTransition)return!1;typeof r>"u"&&(r=a.params.speed);const _=Math.min(a.params.slidesPerGroupSkip,o);let T=_+Math.floor((o-_)/a.params.slidesPerGroup);T>=c.length&&(T=c.length-1);const m=-c[T];if(l.normalizeSlideIndex)for(let D=0;D<d.length;D+=1){const x=-Math.floor(100*m),Q=Math.floor(100*d[D]),y=Math.floor(100*d[D+1]);typeof d[D+1]<"u"?x>=Q&&x<y-(y-Q)/2?o=D:x>=Q&&x<y&&(o=D+1):x>=Q&&(o=D)}if(a.initialized&&o!==p&&(!a.allowSlideNext&&(h?m>a.translate&&m>a.minTranslate():m<a.translate&&m<a.minTranslate())||!a.allowSlidePrev&&m>a.translate&&m>a.maxTranslate()&&(p||0)!==o))return!1;let b;o!==(u||0)&&e&&a.emit("beforeSlideChangeStart"),a.updateProgress(m),b=o>p?"next":o<p?"prev":"reset";const v=a.virtual&&a.params.virtual.enabled;if((!v||!n)&&(h&&-m===a.translate||!h&&m===a.translate))return a.updateActiveIndex(o),l.autoHeight&&a.updateAutoHeight(),a.updateSlidesClasses(),"slide"!==l.effect&&a.setTranslate(m),"reset"!==b&&(a.transitionStart(e,b),a.transitionEnd(e,b)),!1;if(l.cssMode){const D=a.isHorizontal(),x=h?m:-m;if(0===r)v&&(a.wrapperEl.style.scrollSnapType="none",a._immediateVirtual=!0),v&&!a._cssModeVirtualInitialSet&&a.params.initialSlide>0?(a._cssModeVirtualInitialSet=!0,requestAnimationFrame(()=>{g[D?"scrollLeft":"scrollTop"]=x})):g[D?"scrollLeft":"scrollTop"]=x,v&&requestAnimationFrame(()=>{a.wrapperEl.style.scrollSnapType="",a._immediateVirtual=!1});else{if(!a.support.smoothScroll)return Ue({swiper:a,targetPosition:x,side:D?"left":"top"}),!0;g.scrollTo({[D?"left":"top"]:x,behavior:"smooth"})}return!0}const z=qe().isSafari;return v&&!n&&z&&a.isElement&&a.virtual.update(!1,!1,o),a.setTransition(r),a.setTranslate(m),a.updateActiveIndex(o),a.updateSlidesClasses(),a.emit("beforeTransitionStart",r,i),a.transitionStart(e,b),0===r?a.transitionEnd(e,b):a.animating||(a.animating=!0,a.onSlideToWrapperTransitionEnd||(a.onSlideToWrapperTransitionEnd=function(x){!a||a.destroyed||x.target===this&&(a.wrapperEl.removeEventListener("transitionend",a.onSlideToWrapperTransitionEnd),a.onSlideToWrapperTransitionEnd=null,delete a.onSlideToWrapperTransitionEnd,a.transitionEnd(e,b))}),a.wrapperEl.addEventListener("transitionend",a.onSlideToWrapperTransitionEnd)),!0},slideToLoop:function Yt(s,r,e,i){void 0===s&&(s=0),void 0===e&&(e=!0),"string"==typeof s&&(s=parseInt(s,10));const n=this;if(n.destroyed)return;typeof r>"u"&&(r=n.params.speed);const a=n.grid&&n.params.grid&&n.params.grid.rows>1;let o=s;if(n.params.loop)if(n.virtual&&n.params.virtual.enabled)o+=n.virtual.slidesBefore;else{let l;if(a){const h=o*n.params.grid.rows;l=n.slides.find(g=>1*g.getAttribute("data-swiper-slide-index")===h).column}else l=n.getSlideIndexByData(o);const c=a?Math.ceil(n.slides.length/n.params.grid.rows):n.slides.length,{centeredSlides:d}=n.params;let u=n.params.slidesPerView;"auto"===u?u=n.slidesPerViewDynamic():(u=Math.ceil(parseFloat(n.params.slidesPerView,10)),d&&u%2==0&&(u+=1));let p=c-l<u;if(d&&(p=p||l<Math.ceil(u/2)),i&&d&&"auto"!==n.params.slidesPerView&&!a&&(p=!1),p){const h=d?l<n.activeIndex?"prev":"next":l-n.activeIndex-1<n.params.slidesPerView?"next":"prev";n.loopFix({direction:h,slideTo:!0,activeSlideIndex:"next"===h?l+1:l-c+1,slideRealIndex:"next"===h?n.realIndex:void 0})}if(a){const h=o*n.params.grid.rows;o=n.slides.find(g=>1*g.getAttribute("data-swiper-slide-index")===h).column}else o=n.getSlideIndexByData(o)}return requestAnimationFrame(()=>{n.slideTo(o,r,e,i)}),n},slideNext:function Zt(s,r,e){void 0===r&&(r=!0);const i=this,{enabled:n,params:a,animating:o}=i;if(!n||i.destroyed)return i;typeof s>"u"&&(s=i.params.speed);let l=a.slidesPerGroup;"auto"===a.slidesPerView&&1===a.slidesPerGroup&&a.slidesPerGroupAuto&&(l=Math.max(i.slidesPerViewDynamic("current",!0),1));const c=i.activeIndex<a.slidesPerGroupSkip?1:l;if(a.loop){if(o&&(!i.virtual||!a.virtual.enabled)&&a.loopPreventsSliding)return!1;if(i.loopFix({direction:"next"}),i._clientLeft=i.wrapperEl.clientLeft,i.activeIndex===i.slides.length-1&&a.cssMode)return requestAnimationFrame(()=>{i.slideTo(i.activeIndex+c,s,r,e)}),!0}return i.slideTo(a.rewind&&i.isEnd?0:i.activeIndex+c,s,r,e)},slidePrev:function Qt(s,r,e){void 0===r&&(r=!0);const i=this,{params:n,snapGrid:a,slidesGrid:o,rtlTranslate:l,enabled:c,animating:d}=i;if(!c||i.destroyed)return i;if(typeof s>"u"&&(s=i.params.speed),n.loop){if(d&&(!i.virtual||!n.virtual.enabled)&&n.loopPreventsSliding)return!1;i.loopFix({direction:"prev"}),i._clientLeft=i.wrapperEl.clientLeft}function h(b){return b<0?-Math.floor(Math.abs(b)):Math.floor(b)}const g=h(l?i.translate:-i.translate),f=a.map(b=>h(b)),_=n.freeMode&&n.freeMode.enabled;let T=a[f.indexOf(g)-1];if(typeof T>"u"&&(n.cssMode||_)){let b;a.forEach((v,k)=>{g>=v&&(b=k)}),typeof b<"u"&&(T=_?a[b]:a[b>0?b-1:b])}let m=0;return typeof T<"u"&&(m=o.indexOf(T),m<0&&(m=i.activeIndex-1),"auto"===n.slidesPerView&&1===n.slidesPerGroup&&n.slidesPerGroupAuto&&(m=m-i.slidesPerViewDynamic("previous",!0)+1,m=Math.max(m,0))),n.rewind&&i.isBeginning?i.slideTo(i.params.virtual&&i.params.virtual.enabled&&i.virtual?i.virtual.slides.length-1:i.slides.length-1,s,r,e):n.loop&&0===i.activeIndex&&n.cssMode?(requestAnimationFrame(()=>{i.slideTo(m,s,r,e)}),!0):i.slideTo(m,s,r,e)},slideReset:function qt(s,r,e){void 0===r&&(r=!0);const i=this;if(!i.destroyed)return typeof s>"u"&&(s=i.params.speed),i.slideTo(i.activeIndex,s,r,e)},slideToClosest:function Kt(s,r,e,i){void 0===r&&(r=!0),void 0===i&&(i=.5);const n=this;if(n.destroyed)return;typeof s>"u"&&(s=n.params.speed);let a=n.activeIndex;const o=Math.min(n.params.slidesPerGroupSkip,a),l=o+Math.floor((a-o)/n.params.slidesPerGroup),c=n.rtlTranslate?n.translate:-n.translate;if(c>=n.snapGrid[l]){const d=n.snapGrid[l];c-d>(n.snapGrid[l+1]-d)*i&&(a+=n.params.slidesPerGroup)}else{const d=n.snapGrid[l-1];c-d<=(n.snapGrid[l]-d)*i&&(a-=n.params.slidesPerGroup)}return a=Math.max(a,0),a=Math.min(a,n.slidesGrid.length-1),n.slideTo(a,s,r,e)},slideToClickedSlide:function Jt(){const s=this;if(s.destroyed)return;const{params:r,slidesEl:e}=s,i="auto"===r.slidesPerView?s.slidesPerViewDynamic():r.slidesPerView;let a,n=s.clickedIndex;const o=s.isElement?"swiper-slide":`.${r.slideClass}`;if(r.loop){if(s.animating)return;a=parseInt(s.clickedSlide.getAttribute("data-swiper-slide-index"),10),r.centeredSlides?n<s.loopedSlides-i/2||n>s.slides.length-s.loopedSlides+i/2?(s.loopFix(),n=s.getSlideIndex(se(e,`${o}[data-swiper-slide-index="${a}"]`)[0]),Le(()=>{s.slideTo(n)})):s.slideTo(n):n>s.slides.length-i?(s.loopFix(),n=s.getSlideIndex(se(e,`${o}[data-swiper-slide-index="${a}"]`)[0]),Le(()=>{s.slideTo(n)})):s.slideTo(n)}else s.slideTo(n)}},loop:{loopCreate:function ti(s,r){const e=this,{params:i,slidesEl:n}=e;if(!i.loop||e.virtual&&e.params.virtual.enabled)return;const a=()=>{se(n,`.${i.slideClass}, swiper-slide`).forEach((h,g)=>{h.setAttribute("data-swiper-slide-index",g)})},o=e.grid&&i.grid&&i.grid.rows>1,l=i.slidesPerGroup*(o?i.grid.rows:1),d=o&&e.slides.length%i.grid.rows!=0,u=p=>{for(let h=0;h<p;h+=1){const g=e.isElement?Oe("swiper-slide",[i.slideBlankClass]):Oe("div",[i.slideClass,i.slideBlankClass]);e.slidesEl.append(g)}};e.slides.length%l!=0?(i.loopAddBlankSlides?(u(l-e.slides.length%l),e.recalcSlides(),e.updateSlides()):Ee("Swiper Loop Warning: The number of slides is not even to slidesPerGroup, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)"),a()):d?(i.loopAddBlankSlides?(u(i.grid.rows-e.slides.length%i.grid.rows),e.recalcSlides(),e.updateSlides()):Ee("Swiper Loop Warning: The number of slides is not even to grid.rows, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)"),a()):a(),e.loopFix({slideRealIndex:s,direction:i.centeredSlides?void 0:"next",initial:r})},loopFix:function ii(s){let{slideRealIndex:r,slideTo:e=!0,direction:i,setTranslate:n,activeSlideIndex:a,initial:o,byController:l,byMousewheel:c}=void 0===s?{}:s;const d=this;if(!d.params.loop)return;d.emit("beforeLoopFix");const{slides:u,allowSlidePrev:p,allowSlideNext:h,slidesEl:g,params:f}=d,{centeredSlides:_,initialSlide:T}=f;if(d.allowSlidePrev=!0,d.allowSlideNext=!0,d.virtual&&f.virtual.enabled)return e&&(f.centeredSlides||0!==d.snapIndex?f.centeredSlides&&d.snapIndex<f.slidesPerView?d.slideTo(d.virtual.slides.length+d.snapIndex,0,!1,!0):d.snapIndex===d.snapGrid.length-1&&d.slideTo(d.virtual.slidesBefore,0,!1,!0):d.slideTo(d.virtual.slides.length,0,!1,!0)),d.allowSlidePrev=p,d.allowSlideNext=h,void d.emit("loopFix");let m=f.slidesPerView;"auto"===m?m=d.slidesPerViewDynamic():(m=Math.ceil(parseFloat(f.slidesPerView,10)),_&&m%2==0&&(m+=1));const b=f.slidesPerGroupAuto?m:f.slidesPerGroup;let v=b;v%b!=0&&(v+=b-v%b),v+=f.loopAdditionalSlides,d.loopedSlides=v;const k=d.grid&&f.grid&&f.grid.rows>1;u.length<m+v||"cards"===d.params.effect&&u.length<m+2*v?Ee("Swiper Loop Warning: The number of slides is not enough for loop mode, it will be disabled or not function properly. You need to add more slides (or make duplicates) or lower the values of slidesPerView and slidesPerGroup parameters"):k&&"row"===f.grid.fill&&Ee("Swiper Loop Warning: Loop mode is not compatible with grid.fill = `row`");const S=[],z=[],D=k?Math.ceil(u.length/f.grid.rows):u.length,x=o&&D-T<m&&!_;let Q=x?T:d.activeIndex;typeof a>"u"?a=d.getSlideIndex(u.find(L=>L.classList.contains(f.slideActiveClass))):Q=a;const y="next"===i||!i,I="prev"===i||!i;let A=0,W=0;const de=(k?u[a].column:a)+(_&&typeof n>"u"?-m/2+.5:0);if(de<v){A=Math.max(v-de,b);for(let L=0;L<v-de;L+=1){const U=L-Math.floor(L/D)*D;if(k){const q=D-U-1;for(let ne=u.length-1;ne>=0;ne-=1)u[ne].column===q&&S.push(ne)}else S.push(D-U-1)}}else if(de+m>D-v){W=Math.max(de-(D-2*v),b),x&&(W=Math.max(W,m-D+T+1));for(let L=0;L<W;L+=1){const U=L-Math.floor(L/D)*D;k?u.forEach((q,ne)=>{q.column===U&&z.push(ne)}):z.push(U)}}if(d.__preventObserver__=!0,requestAnimationFrame(()=>{d.__preventObserver__=!1}),"cards"===d.params.effect&&u.length<m+2*v&&(z.includes(a)&&z.splice(z.indexOf(a),1),S.includes(a)&&S.splice(S.indexOf(a),1)),I&&S.forEach(L=>{u[L].swiperLoopMoveDOM=!0,g.prepend(u[L]),u[L].swiperLoopMoveDOM=!1}),y&&z.forEach(L=>{u[L].swiperLoopMoveDOM=!0,g.append(u[L]),u[L].swiperLoopMoveDOM=!1}),d.recalcSlides(),"auto"===f.slidesPerView?d.updateSlides():k&&(S.length>0&&I||z.length>0&&y)&&d.slides.forEach((L,U)=>{d.grid.updateSlide(U,L,d.slides)}),f.watchSlidesProgress&&d.updateSlidesOffset(),e)if(S.length>0&&I)if(typeof r>"u"){const q=d.slidesGrid[Q+A]-d.slidesGrid[Q];c?d.setTranslate(d.translate-q):(d.slideTo(Q+Math.ceil(A),0,!1,!0),n&&(d.touchEventsData.startTranslate=d.touchEventsData.startTranslate-q,d.touchEventsData.currentTranslate=d.touchEventsData.currentTranslate-q))}else n&&(d.slideTo(d.activeIndex+(k?S.length/f.grid.rows:S.length),0,!1,!0),d.touchEventsData.currentTranslate=d.translate);else if(z.length>0&&y)if(typeof r>"u"){const q=d.slidesGrid[Q-W]-d.slidesGrid[Q];c?d.setTranslate(d.translate-q):(d.slideTo(Q-W,0,!1,!0),n&&(d.touchEventsData.startTranslate=d.touchEventsData.startTranslate-q,d.touchEventsData.currentTranslate=d.touchEventsData.currentTranslate-q))}else d.slideTo(d.activeIndex-(k?z.length/f.grid.rows:z.length),0,!1,!0);if(d.allowSlidePrev=p,d.allowSlideNext=h,d.controller&&d.controller.control&&!l){const L={slideRealIndex:r,direction:i,setTranslate:n,activeSlideIndex:a,byController:!0};Array.isArray(d.controller.control)?d.controller.control.forEach(U=>{!U.destroyed&&U.params.loop&&U.loopFix({...L,slideTo:U.params.slidesPerView===f.slidesPerView&&e})}):d.controller.control instanceof d.constructor&&d.controller.control.params.loop&&d.controller.control.loopFix({...L,slideTo:d.controller.control.params.slidesPerView===f.slidesPerView&&e})}d.emit("loopFix")},loopDestroy:function si(){const s=this,{params:r,slidesEl:e}=s;if(!r.loop||!e||s.virtual&&s.params.virtual.enabled)return;s.recalcSlides();const i=[];s.slides.forEach(n=>{const a=typeof n.swiperSlideIndex>"u"?1*n.getAttribute("data-swiper-slide-index"):n.swiperSlideIndex;i[a]=n}),s.slides.forEach(n=>{n.removeAttribute("data-swiper-slide-index")}),i.forEach(n=>{e.append(n)}),s.recalcSlides(),s.slideTo(s.realIndex,0)}},grabCursor:{setGrabCursor:function ni(s){const r=this;if(!r.params.simulateTouch||r.params.watchOverflow&&r.isLocked||r.params.cssMode)return;const e="container"===r.params.touchEventsTarget?r.el:r.wrapperEl;r.isElement&&(r.__preventObserver__=!0),e.style.cursor="move",e.style.cursor=s?"grabbing":"grab",r.isElement&&requestAnimationFrame(()=>{r.__preventObserver__=!1})},unsetGrabCursor:function ai(){const s=this;s.params.watchOverflow&&s.isLocked||s.params.cssMode||(s.isElement&&(s.__preventObserver__=!0),s["container"===s.params.touchEventsTarget?"el":"wrapperEl"].style.cursor="",s.isElement&&requestAnimationFrame(()=>{s.__preventObserver__=!1}))}},events:{attachEvents:function mi(){const s=this,{params:r}=s;s.onTouchStart=di.bind(s),s.onTouchMove=ci.bind(s),s.onTouchEnd=ui.bind(s),s.onDocumentTouchStart=fi.bind(s),r.cssMode&&(s.onScroll=hi.bind(s)),s.onClick=pi.bind(s),s.onLoad=gi.bind(s),it(s,"on")},detachEvents:function vi(){it(this,"off")}},breakpoints:{setBreakpoint:function yi(){const s=this,{realIndex:r,initialized:e,params:i,el:n}=s,a=i.breakpoints;if(!a||a&&0===Object.keys(a).length)return;const o=X(),l="window"!==i.breakpointsBase&&i.breakpointsBase?"container":i.breakpointsBase,c=["window","container"].includes(i.breakpointsBase)||!i.breakpointsBase?s.el:o.querySelector(i.breakpointsBase),d=s.getBreakpoint(a,l,c);if(!d||s.currentBreakpoint===d)return;const p=(d in a?a[d]:void 0)||s.originalParams,h=st(s,i),g=st(s,p),f=s.params.grabCursor,_=p.grabCursor,T=i.enabled;h&&!g?(n.classList.remove(`${i.containerModifierClass}grid`,`${i.containerModifierClass}grid-column`),s.emitContainerClasses()):!h&&g&&(n.classList.add(`${i.containerModifierClass}grid`),(p.grid.fill&&"column"===p.grid.fill||!p.grid.fill&&"column"===i.grid.fill)&&n.classList.add(`${i.containerModifierClass}grid-column`),s.emitContainerClasses()),f&&!_?s.unsetGrabCursor():!f&&_&&s.setGrabCursor(),["navigation","pagination","scrollbar"].forEach(z=>{if(typeof p[z]>"u")return;const D=i[z]&&i[z].enabled,x=p[z]&&p[z].enabled;D&&!x&&s[z].disable(),!D&&x&&s[z].enable()});const m=p.direction&&p.direction!==i.direction,b=i.loop&&(p.slidesPerView!==i.slidesPerView||m),v=i.loop;m&&e&&s.changeDirection(),K(s.params,p);const k=s.params.enabled,S=s.params.loop;Object.assign(s,{allowTouchMove:s.params.allowTouchMove,allowSlideNext:s.params.allowSlideNext,allowSlidePrev:s.params.allowSlidePrev}),T&&!k?s.disable():!T&&k&&s.enable(),s.currentBreakpoint=d,s.emit("_beforeBreakpoint",p),e&&(b?(s.loopDestroy(),s.loopCreate(r),s.updateSlides()):!v&&S?(s.loopCreate(r),s.updateSlides()):v&&!S&&s.loopDestroy()),s.emit("breakpoint",p)},getBreakpoint:function bi(s,r,e){if(void 0===r&&(r="window"),!s||"container"===r&&!e)return;let i=!1;const n=Y(),a="window"===r?n.innerHeight:e.clientHeight,o=Object.keys(s).map(l=>{if("string"==typeof l&&0===l.indexOf("@")){const c=parseFloat(l.substr(1));return{value:a*c,point:l}}return{value:l,point:l}});o.sort((l,c)=>parseInt(l.value,10)-parseInt(c.value,10));for(let l=0;l<o.length;l+=1){const{point:c,value:d}=o[l];"window"===r?n.matchMedia(`(min-width: ${d}px)`).matches&&(i=c):d<=e.clientWidth&&(i=c)}return i||"max"}},checkOverflow:{checkOverflow:function Ii(){const s=this,{isLocked:r,params:e}=s,{slidesOffsetBefore:i}=e;if(i){const n=s.slides.length-1;s.isLocked=s.size>s.slidesGrid[n]+s.slidesSizesGrid[n]+2*i}else s.isLocked=1===s.snapGrid.length;!0===e.allowSlideNext&&(s.allowSlideNext=!s.isLocked),!0===e.allowSlidePrev&&(s.allowSlidePrev=!s.isLocked),r&&r!==s.isLocked&&(s.isEnd=!1),r!==s.isLocked&&s.emit(s.isLocked?"lock":"unlock")}},classes:{addClasses:function Ci(){const s=this,{classNames:r,params:e,rtl:i,el:n,device:a}=s,o=function Mi(s,r){const e=[];return s.forEach(i=>{"object"==typeof i?Object.keys(i).forEach(n=>{i[n]&&e.push(r+n)}):"string"==typeof i&&e.push(r+i)}),e}(["initialized",e.direction,{"free-mode":s.params.freeMode&&e.freeMode.enabled},{autoheight:e.autoHeight},{rtl:i},{grid:e.grid&&e.grid.rows>1},{"grid-column":e.grid&&e.grid.rows>1&&"column"===e.grid.fill},{android:a.android},{ios:a.ios},{"css-mode":e.cssMode},{centered:e.cssMode&&e.centeredSlides},{"watch-progress":e.watchSlidesProgress}],e.containerModifierClass);r.push(...o),n.classList.add(...r),s.emitContainerClasses()},removeClasses:function ki(){const{el:r,classNames:e}=this;!r||"string"==typeof r||(r.classList.remove(...e),this.emitContainerClasses())}}},Ge={};class ee{constructor(){let r,e;for(var i=arguments.length,n=new Array(i),a=0;a<i;a++)n[a]=arguments[a];1===n.length&&n[0].constructor&&"Object"===Object.prototype.toString.call(n[0]).slice(8,-1)?e=n[0]:[r,e]=n,e||(e={}),e=K({},e),r&&!e.el&&(e.el=r);const o=X();if(e.el&&"string"==typeof e.el&&o.querySelectorAll(e.el).length>1){const u=[];return o.querySelectorAll(e.el).forEach(p=>{const h=K({},e,{el:p});u.push(new ee(h))}),u}const l=this;l.__swiper__=!0,l.support=Ze(),l.device=Qe({userAgent:e.userAgent}),l.browser=qe(),l.eventsListeners={},l.eventsAnyListeners=[],l.modules=[...l.__modules__],e.modules&&Array.isArray(e.modules)&&l.modules.push(...e.modules);const c={};l.modules.forEach(u=>{u({params:e,swiper:l,extendParams:zi(e,c),on:l.on.bind(l),once:l.once.bind(l),off:l.off.bind(l),emit:l.emit.bind(l)})});const d=K({},rt,c);return l.params=K({},d,Ge,e),l.originalParams=K({},l.params),l.passedParams=K({},e),l.params&&l.params.on&&Object.keys(l.params.on).forEach(u=>{l.on(u,l.params.on[u])}),l.params&&l.params.onAny&&l.onAny(l.params.onAny),Object.assign(l,{enabled:l.params.enabled,el:r,classNames:[],slides:[],slidesGrid:[],snapGrid:[],slidesSizesGrid:[],isHorizontal:()=>"horizontal"===l.params.direction,isVertical:()=>"vertical"===l.params.direction,activeIndex:0,realIndex:0,isBeginning:!0,isEnd:!1,translate:0,previousTranslate:0,progress:0,velocity:0,animating:!1,cssOverflowAdjustment(){return Math.trunc(this.translate/2**23)*2**23},allowSlideNext:l.params.allowSlideNext,allowSlidePrev:l.params.allowSlidePrev,touchEventsData:{isTouched:void 0,isMoved:void 0,allowTouchCallbacks:void 0,touchStartTime:void 0,isScrolling:void 0,currentTranslate:void 0,startTranslate:void 0,allowThresholdMove:void 0,focusableElements:l.params.focusableElements,lastClickTime:0,clickTimeout:void 0,velocities:[],allowMomentumBounce:void 0,startMoving:void 0,pointerId:null,touchId:null},allowClick:!0,allowTouchMove:l.params.allowTouchMove,touches:{startX:0,startY:0,currentX:0,currentY:0,diff:0},imagesToLoad:[],imagesLoaded:0}),l.emit("_swiper"),l.params.init&&l.init(),l}getDirectionLabel(r){return this.isHorizontal()?r:{width:"height","margin-top":"margin-left","margin-bottom ":"margin-right","margin-left":"margin-top","margin-right":"margin-bottom","padding-left":"padding-top","padding-right":"padding-bottom",marginRight:"marginBottom"}[r]}getSlideIndex(r){const{slidesEl:e,params:i}=this,a=He(se(e,`.${i.slideClass}, swiper-slide`)[0]);return He(r)-a}getSlideIndexByData(r){return this.getSlideIndex(this.slides.find(e=>1*e.getAttribute("data-swiper-slide-index")===r))}recalcSlides(){const{slidesEl:e,params:i}=this;this.slides=se(e,`.${i.slideClass}, swiper-slide`)}enable(){const r=this;r.enabled||(r.enabled=!0,r.params.grabCursor&&r.setGrabCursor(),r.emit("enable"))}disable(){const r=this;r.enabled&&(r.enabled=!1,r.params.grabCursor&&r.unsetGrabCursor(),r.emit("disable"))}setProgress(r,e){const i=this;r=Math.min(Math.max(r,0),1);const n=i.minTranslate(),o=(i.maxTranslate()-n)*r+n;i.translateTo(o,typeof e>"u"?0:e),i.updateActiveIndex(),i.updateSlidesClasses()}emitContainerClasses(){const r=this;if(!r.params._emitClasses||!r.el)return;const e=r.el.className.split(" ").filter(i=>0===i.indexOf("swiper")||0===i.indexOf(r.params.containerModifierClass));r.emit("_containerClasses",e.join(" "))}getSlideClasses(r){const e=this;return e.destroyed?"":r.className.split(" ").filter(i=>0===i.indexOf("swiper-slide")||0===i.indexOf(e.params.slideClass)).join(" ")}emitSlidesClasses(){const r=this;if(!r.params._emitClasses||!r.el)return;const e=[];r.slides.forEach(i=>{const n=r.getSlideClasses(i);e.push({slideEl:i,classNames:n}),r.emit("_slideClass",i,n)}),r.emit("_slideClasses",e)}slidesPerViewDynamic(r,e){void 0===r&&(r="current"),void 0===e&&(e=!1);const{params:n,slides:a,slidesGrid:o,slidesSizesGrid:l,size:c,activeIndex:d}=this;let u=1;if("number"==typeof n.slidesPerView)return n.slidesPerView;if(n.centeredSlides){let h,p=a[d]?Math.ceil(a[d].swiperSlideSize):0;for(let g=d+1;g<a.length;g+=1)a[g]&&!h&&(p+=Math.ceil(a[g].swiperSlideSize),u+=1,p>c&&(h=!0));for(let g=d-1;g>=0;g-=1)a[g]&&!h&&(p+=a[g].swiperSlideSize,u+=1,p>c&&(h=!0))}else if("current"===r)for(let p=d+1;p<a.length;p+=1)(e?o[p]+l[p]-o[d]<c:o[p]-o[d]<c)&&(u+=1);else for(let p=d-1;p>=0;p-=1)o[d]-o[p]<c&&(u+=1);return u}update(){const r=this;if(!r||r.destroyed)return;const{snapGrid:e,params:i}=r;function n(){const l=Math.min(Math.max(r.rtlTranslate?-1*r.translate:r.translate,r.maxTranslate()),r.minTranslate());r.setTranslate(l),r.updateActiveIndex(),r.updateSlidesClasses()}let a;i.breakpoints&&r.setBreakpoint(),[...r.el.querySelectorAll('[loading="lazy"]')].forEach(o=>{o.complete&&ze(r,o)}),r.updateSize(),r.updateSlides(),r.updateProgress(),r.updateSlidesClasses(),i.freeMode&&i.freeMode.enabled&&!i.cssMode?(n(),i.autoHeight&&r.updateAutoHeight()):(a=r.slideTo(("auto"===i.slidesPerView||i.slidesPerView>1)&&r.isEnd&&!i.centeredSlides?(r.virtual&&i.virtual.enabled?r.virtual.slides:r.slides).length-1:r.activeIndex,0,!1,!0),a||n()),i.watchOverflow&&e!==r.snapGrid&&r.checkOverflow(),r.emit("update")}changeDirection(r,e){void 0===e&&(e=!0);const i=this,n=i.params.direction;return r||(r="horizontal"===n?"vertical":"horizontal"),r===n||"horizontal"!==r&&"vertical"!==r||(i.el.classList.remove(`${i.params.containerModifierClass}${n}`),i.el.classList.add(`${i.params.containerModifierClass}${r}`),i.emitContainerClasses(),i.params.direction=r,i.slides.forEach(a=>{"vertical"===r?a.style.width="":a.style.height=""}),i.emit("changeDirection"),e&&i.update()),i}changeLanguageDirection(r){const e=this;e.rtl&&"rtl"===r||!e.rtl&&"ltr"===r||(e.rtl="rtl"===r,e.rtlTranslate="horizontal"===e.params.direction&&e.rtl,e.rtl?(e.el.classList.add(`${e.params.containerModifierClass}rtl`),e.el.dir="rtl"):(e.el.classList.remove(`${e.params.containerModifierClass}rtl`),e.el.dir="ltr"),e.update())}mount(r){const e=this;if(e.mounted)return!0;let i=r||e.params.el;if("string"==typeof i&&(i=document.querySelector(i)),!i)return!1;i.swiper=e,i.parentNode&&i.parentNode.host&&i.parentNode.host.nodeName===e.params.swiperElementNodeName.toUpperCase()&&(e.isElement=!0);const n=()=>`.${(e.params.wrapperClass||"").trim().split(" ").join(".")}`;let o=i&&i.shadowRoot&&i.shadowRoot.querySelector?i.shadowRoot.querySelector(n()):se(i,n())[0];return!o&&e.params.createElements&&(o=Oe("div",e.params.wrapperClass),i.append(o),se(i,`.${e.params.slideClass}`).forEach(l=>{o.append(l)})),Object.assign(e,{el:i,wrapperEl:o,slidesEl:e.isElement&&!i.parentNode.host.slideSlots?i.parentNode.host:o,hostEl:e.isElement?i.parentNode.host:i,mounted:!0,rtl:"rtl"===i.dir.toLowerCase()||"rtl"===oe(i,"direction"),rtlTranslate:"horizontal"===e.params.direction&&("rtl"===i.dir.toLowerCase()||"rtl"===oe(i,"direction")),wrongRTL:"-webkit-box"===oe(o,"display")}),!0}init(r){const e=this;if(e.initialized||!1===e.mount(r))return e;e.emit("beforeInit"),e.params.breakpoints&&e.setBreakpoint(),e.addClasses(),e.updateSize(),e.updateSlides(),e.params.watchOverflow&&e.checkOverflow(),e.params.grabCursor&&e.enabled&&e.setGrabCursor(),e.slideTo(e.params.loop&&e.virtual&&e.params.virtual.enabled?e.params.initialSlide+e.virtual.slidesBefore:e.params.initialSlide,0,e.params.runCallbacksOnInit,!1,!0),e.params.loop&&e.loopCreate(void 0,!0),e.attachEvents();const n=[...e.el.querySelectorAll('[loading="lazy"]')];return e.isElement&&n.push(...e.hostEl.querySelectorAll('[loading="lazy"]')),n.forEach(a=>{a.complete?ze(e,a):a.addEventListener("load",o=>{ze(e,o.target)})}),Re(e),e.initialized=!0,Re(e),e.emit("init"),e.emit("afterInit"),e}destroy(r,e){void 0===r&&(r=!0),void 0===e&&(e=!0);const i=this,{params:n,el:a,wrapperEl:o,slides:l}=i;return typeof i.params>"u"||i.destroyed||(i.emit("beforeDestroy"),i.initialized=!1,i.detachEvents(),n.loop&&i.loopDestroy(),e&&(i.removeClasses(),a&&"string"!=typeof a&&a.removeAttribute("style"),o&&o.removeAttribute("style"),l&&l.length&&l.forEach(c=>{c.classList.remove(n.slideVisibleClass,n.slideFullyVisibleClass,n.slideActiveClass,n.slideNextClass,n.slidePrevClass),c.removeAttribute("style"),c.removeAttribute("data-swiper-slide-index")})),i.emit("destroy"),Object.keys(i.eventsListeners).forEach(c=>{i.off(c)}),!1!==r&&(i.el&&"string"!=typeof i.el&&(i.el.swiper=null),function ut(s){const r=s;Object.keys(r).forEach(e=>{try{r[e]=null}catch{}try{delete r[e]}catch{}})}(i)),i.destroyed=!0),null}static extendDefaults(r){K(Ge,r)}static get extendedDefaults(){return Ge}static get defaults(){return rt}static installModule(r){ee.prototype.__modules__||(ee.prototype.__modules__=[]);const e=ee.prototype.__modules__;"function"==typeof r&&e.indexOf(r)<0&&e.push(r)}static use(r){return Array.isArray(r)?(r.forEach(e=>ee.installModule(e)),ee):(ee.installModule(r),ee)}}Object.keys(Be).forEach(s=>{Object.keys(Be[s]).forEach(r=>{ee.prototype[r]=Be[s][r]})}),ee.use([function Ct(s){let{swiper:r,on:e,emit:i}=s;const n=Y();let a=null,o=null;const l=()=>{!r||r.destroyed||!r.initialized||(i("beforeResize"),i("resize"))},u=()=>{!r||r.destroyed||!r.initialized||i("orientationchange")};e("init",()=>{r.params.resizeObserver&&typeof n.ResizeObserver<"u"?!r||r.destroyed||!r.initialized||(a=new ResizeObserver(p=>{o=n.requestAnimationFrame(()=>{const{width:h,height:g}=r;let f=h,_=g;p.forEach(T=>{let{contentBoxSize:m,contentRect:b,target:v}=T;v&&v!==r.el||(f=b?b.width:(m[0]||m).inlineSize,_=b?b.height:(m[0]||m).blockSize)}),(f!==h||_!==g)&&l()})}),a.observe(r.el)):(n.addEventListener("resize",l),n.addEventListener("orientationchange",u))}),e("destroy",()=>{o&&n.cancelAnimationFrame(o),a&&a.unobserve&&r.el&&(a.unobserve(r.el),a=null),n.removeEventListener("resize",l),n.removeEventListener("orientationchange",u)})},function kt(s){let{swiper:r,extendParams:e,on:i,emit:n}=s;const a=[],o=Y(),l=function(u,p){void 0===p&&(p={});const g=new(o.MutationObserver||o.WebkitMutationObserver)(f=>{if(r.__preventObserver__)return;if(1===f.length)return void n("observerUpdate",f[0]);const _=function(){n("observerUpdate",f[0])};o.requestAnimationFrame?o.requestAnimationFrame(_):o.setTimeout(_,0)});g.observe(u,{attributes:typeof p.attributes>"u"||p.attributes,childList:r.isElement||(typeof p.childList>"u"||p).childList,characterData:typeof p.characterData>"u"||p.characterData}),a.push(g)};e({observer:!1,observeParents:!1,observeSlideChildren:!1}),i("init",()=>{if(r.params.observer){if(r.params.observeParents){const u=function yt(s,r){const e=[];let i=s.parentElement;for(;i;)r?i.matches(r)&&e.push(i):e.push(i),i=i.parentElement;return e}(r.hostEl);for(let p=0;p<u.length;p+=1)l(u[p])}l(r.hostEl,{childList:r.params.observeSlideChildren}),l(r.wrapperEl,{attributes:!1})}}),i("destroy",()=>{a.forEach(u=>{u.disconnect()}),a.splice(0,a.length)})}]);var Z=w(9417),Ve=w(3443);const Ti=["swiper"],xi=(s,r)=>({"success-bg":s,"text-danger":r});function Li(s,r){1&s&&(t.j41(0,"span",22),t.EFF(1,"- Selected"),t.k0s())}function Oi(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",18)(1,"a",19),t.bIt("click",function(n){const a=t.eBV(e).$implicit;return t.XpG().setActive(a),t.Njj(n.preventDefault())}),t.j41(2,"span",20)(3,"span"),t.EFF(4),t.k0s(),t.DNE(5,Li,2,0,"span",21),t.k0s()()()}if(2&s){const e=r.$implicit;t.xc7("width","auto"),t.R7$(),t.HbH("filter-link pill-filter "+(e.selected?"filter-link--selected":"filter-link--unselected")),t.R7$(3),t.JRh(e.label),t.R7$(),t.Y8G("ngIf",e.selected)}}function Ai(s,r){1&s&&(t.j41(0,"div",23),t.EFF(1," Cargando informacion... "),t.k0s())}function Di(s,r){if(1&s&&(t.j41(0,"div",25)(1,"div",26)(2,"div",27),t.qSk(),t.j41(3,"svg",28),t.nrm(4,"path",29)(5,"polyline",30)(6,"line",31),t.k0s()(),t.joV(),t.j41(7,"div",32)(8,"h4"),t.EFF(9),t.j41(10,"span",33),t.EFF(11),t.k0s()(),t.j41(12,"h6",34),t.EFF(13),t.k0s()()(),t.j41(14,"div",35)(15,"a",36),t.nrm(16,"img",37),t.k0s(),t.j41(17,"div",38)(18,"a",39)(19,"h3"),t.EFF(20),t.k0s()(),t.j41(21,"p",34),t.EFF(22),t.k0s(),t.j41(23,"ul",40)(24,"li")(25,"div",41)(26,"h6",34),t.EFF(27,"Fecha : "),t.k0s(),t.j41(28,"h5"),t.EFF(29),t.nI1(30,"customDate"),t.k0s()()(),t.j41(31,"li")(32,"div",41)(33,"h6",34),t.EFF(34,"Estado de pago : "),t.k0s(),t.j41(35,"h5"),t.EFF(36),t.k0s()()(),t.j41(37,"li")(38,"div",41)(39,"h6",34),t.EFF(40,"Tipo de pago : "),t.k0s(),t.j41(41,"h5"),t.EFF(42),t.k0s()()(),t.j41(43,"li")(44,"div",41)(45,"h6",34),t.EFF(46,"Entrega : "),t.k0s(),t.j41(47,"h5"),t.EFF(48),t.k0s()()()()()()()),2&s){const e=r.$implicit;t.R7$(9),t.SpI(" ",e.delivery_status_string," "),t.R7$(),t.Y8G("ngClass",t.l_i(14,xi,"Entregado"===e.delivery_status,"Pendiente"===e.delivery_status)),t.R7$(),t.SpI(" ",e.delivery_status," "),t.R7$(2),t.JRh(e.payment_status_string),t.R7$(2),t.Y8G("href",e.links.details||"#",t.B4B),t.R7$(3),t.Y8G("href",e.links.details||"#",t.B4B),t.R7$(2),t.SpI("Orden #",e.code,""),t.R7$(2),t.SpI("Total: ",e.grand_total,""),t.R7$(7),t.JRh(t.bMT(30,12,e.date)),t.R7$(7),t.JRh(e.payment_status_string),t.R7$(6),t.JRh(e.payment_type),t.R7$(6),t.JRh(e.delivery_status_string)}}function Fi(s,r){if(1&s&&(t.qex(0),t.DNE(1,Di,49,17,"div",24),t.bVm()),2&s){const e=t.XpG();t.R7$(),t.Y8G("ngForOf",e.orders)}}function Pi(s,r){if(1&s){const e=t.RV6();t.j41(0,"nav",42)(1,"ul",43)(2,"li",44)(3,"a",45),t.bIt("click",function(){t.eBV(e);const n=t.XpG();return t.Njj(n.page>1?n.goToPage(n.pagesOrder.links[0]):null)}),t.nrm(4,"i",46),t.k0s()(),t.j41(5,"li",47)(6,"span",48),t.EFF(7),t.k0s()(),t.j41(8,"li",44)(9,"a",45),t.bIt("click",function(){t.eBV(e);const n=t.XpG();return t.Njj(n.page<(null==n.pagesOrder?null:n.pagesOrder.lastPage)?n.goToPage(n.pagesOrder.links[n.pagesOrder.links.length-1]):null)}),t.nrm(10,"i",49),t.k0s()()()()}if(2&s){const e=t.XpG();t.R7$(2),t.AVh("disabled",1===e.page),t.R7$(5),t.Lme(" P\xe1gina ",e.page," de ",(null==e.pagesOrder?null:e.pagesOrder.lastPage)||1," "),t.R7$(),t.AVh("disabled",e.page===(null==e.pagesOrder?null:e.pagesOrder.lastPage))}}let ji=(()=>{class s{userService;userCustomer;swiper;orders;pagesOrder={};page=1;searchTerm="";filteredOrders=[];currentFilter="all";isLoading=!1;originalOrders=[];navigationItems=[];swiperConfig={slidesPerView:"auto",spaceBetween:16,freeMode:!0,pagination:!1,navigation:!0};ngAfterViewInit(){new ee(".swiper-container",this.swiperConfig)}ngOnInit(){this.getOrders(this.page),this.onUserReceived(this.userCustomer),this.navigationItems=[{label:"All Purchases",route:"/purchases",selected:!0,filter:"all"},{label:"Paid Order",route:"/paid",selected:!1,filter:"paid"},{label:"Processing",route:"/processing",selected:!1,filter:"pending"},{label:"Unpaid items",route:"/unpaid",selected:!1,filter:"unpaid"},{label:"Returns & Canceled",route:"/returns",selected:!1,filter:"cancelled"},{label:"Delivered",route:"/pending-delivered",selected:!1,filter:"pending-delivered"}]}constructor(e){this.userService=e}setActive(e){this.navigationItems.forEach(i=>{i.selected=i===e}),this.searchTerm="",this.filterOrders(e.filter)}filterOrders(e="all"){this.currentFilter=e,this.isLoading=!0,this.userService.getUserUserPurchaseInfo(this.page).subscribe({next:i=>{const{data:n,meta:a}=i;Array.isArray(n)&&(this.orders=n.filter(o=>{switch(e){case"paid":return"paid"===o.payment_status;case"pending":return"pending"===o.delivery_status;case"unpaid":return"unpaid"===o.payment_status;case"cancelled":return"cancelled"===o.delivery_status||o.cancel_request;case"hidden":return!1;case"pending-delivered":return"pending"===o.delivery_status||"delivered"===o.delivery_status;default:return!0}}),this.filteredOrders=[...this.orders],this.searchTerm&&this.applySearch(),this.pagesOrder={currentPage:a.current_page,lastPage:a.last_page,links:a.links},this.page=a.current_page),this.isLoading=!1},error:i=>{console.error("Error al cargar datos del servidor:",i),this.isLoading=!1}})}onSearch(){this.applySearch()}applySearch(){const e=this.searchTerm.toLowerCase().trim();this.orders=e?this.filteredOrders.filter(i=>i.code?.toLowerCase().includes(e)||i.shipping_address?.name?.toLowerCase().includes(e)||i.shipping_address?.email?.toLowerCase().includes(e)||i.shipping_address?.address?.toLowerCase().includes(e)||i.payment_type?.toLowerCase().includes(e)||i.shipping_type?.toLowerCase().includes(e)||i.delivery_status_string?.toLowerCase().includes(e)||i.payment_status_string?.toLowerCase().includes(e)||i.date?.toLowerCase().includes(e)):[...this.filteredOrders]}getOrders(e){const i=this.navigationItems.find(a=>a.selected),n=i?i.filter:"all";this.isLoading=!0,this.userService.getUserUserPurchaseInfo(e).subscribe({next:a=>{const{data:o}=a;Array.isArray(o)?this.filterOrders(n):console.error("Error: `data` no es un array."),this.isLoading=!1},error:a=>{console.error("Error al cargar datos del servidor:",a),this.isLoading=!1}})}onUserReceived(e){this.userCustomer=e,console.log("Datos recibidos en el dashboard:",this.userCustomer)}goToPage(e){if(e?.url)try{const n=new URL(e.url).searchParams.get("page");n?(this.page=+n,this.loadOrders()):console.error("No se pudo obtener el n\xfamero de p\xe1gina desde la URL")}catch(i){console.error("Error procesando la URL:",i)}else console.error("Datos de la p\xe1gina son inv\xe1lidos o falta la propiedad `url`")}loadOrders(){this.isLoading=!0,this.userService.getUserUserPurchaseInfo(this.page).subscribe({next:({data:e,meta:i})=>{this.orders=e,this.pagesOrder={currentPage:i.current_page,lastPage:i.last_page,links:i.links},console.log("Pedidos actualizados:",this.orders),console.log("Paginaci\xf3n actualizada:",this.pagesOrder),this.isLoading=!1},error:e=>{console.error("Error al cargar los datos:",e),this.isLoading=!1}})}static \u0275fac=function(i){return new(i||s)(t.rXU(Ve.D))};static \u0275cmp=t.VBU({type:s,selectors:[["app-customer-orders"]],viewQuery:function(i,n){if(1&i&&t.GBs(Ti,5),2&i){let a;t.mGM(a=t.lsd())&&(n.swiper=a.first)}},inputs:{userCustomer:"userCustomer"},decls:21,vars:5,consts:[["id","pills-order","role","tabpanel",1,"tab-pane","fade","show"],[1,"dashboard-order"],[1,"title"],[1,"title-leaf","title-leaf-gray"],[1,"icon-width","bg-gray"],[0,"xlink","href","assets/svg/leaf.svg#leaf"],[1,"order-contain"],[2,"width","100%","margin-bottom","10px"],[1,"input-group","download-form"],["type","text","placeholder","Search your download","name","searchInput",1,"form-control",3,"ngModelChange","keyup","ngModel"],["type","button",1,"btn","theme-bg-color","text-light",3,"click"],[1,"carousel__viewport"],[1,"swiper-container"],[1,"swiper-wrapper"],["class","swiper-slide",3,"width",4,"ngFor","ngForOf"],["class","loading-indicator",4,"ngIf"],[4,"ngIf"],["class","custom-pagination",4,"ngIf"],[1,"swiper-slide"],["href","javascript:void(0)",3,"click"],[1,"filter-link__cell"],["class","visually-hidden",4,"ngIf"],[1,"visually-hidden"],[1,"loading-indicator"],["class","order-box dashboard-bg-box",4,"ngFor","ngForOf"],[1,"order-box","dashboard-bg-box"],[1,"order-container"],[1,"order-icon"],["xmlns","http://www.w3.org/2000/svg","width","24","height","24","viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"feather","feather-box"],["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"],["points","3.27 6.96 12 12.01 20.73 6.96"],["x1","12","y1","22.08","x2","12","y2","12"],[1,"order-detail"],[3,"ngClass"],[1,"text-content"],[1,"product-order-detail"],[1,"order-image",3,"href"],["src","assets/images/vegetable/product/1.png","alt","Imagen del producto",1,"blur-up","lazyload"],[1,"order-wrap"],[3,"href"],[1,"product-size"],[1,"size-box"],[1,"custom-pagination"],[1,"pagination","justify-content-center"],[1,"page-item"],["href","javascript:void(0)",1,"page-link",3,"click"],[1,"fa-solid","fa-angles-left"],[1,"page-item","disabled"],[1,"page-link",2,"background","#E63118","color","#fff"],[1,"fa-solid","fa-angles-right"]],template:function(i,n){1&i&&(t.j41(0,"div",0)(1,"div",1)(2,"div",2)(3,"h2"),t.EFF(4,"Mi Historial de \xd3rdenes"),t.k0s(),t.j41(5,"span",3),t.qSk(),t.j41(6,"svg",4),t.nrm(7,"use",5),t.k0s()()(),t.joV(),t.j41(8,"div",6)(9,"form",7)(10,"div",8)(11,"input",9),t.mxI("ngModelChange",function(o){return t.DH7(n.searchTerm,o)||(n.searchTerm=o),o}),t.bIt("keyup",function(){return n.onSearch()}),t.k0s(),t.j41(12,"button",10),t.bIt("click",function(){return n.onSearch()}),t.EFF(13,"Search"),t.k0s()()(),t.j41(14,"div",11)(15,"div",12)(16,"div",13),t.DNE(17,Oi,6,6,"div",14),t.k0s()()(),t.DNE(18,Ai,2,0,"div",15)(19,Fi,2,1,"ng-container",16)(20,Pi,11,6,"nav",17),t.k0s()()()),2&i&&(t.R7$(11),t.R50("ngModel",n.searchTerm),t.R7$(6),t.Y8G("ngForOf",n.navigationItems),t.R7$(),t.Y8G("ngIf",n.isLoading),t.R7$(),t.Y8G("ngIf",!n.isLoading),t.R7$(),t.Y8G("ngIf",null==n.pagesOrder||null==n.pagesOrder.links?null:n.pagesOrder.links.length))},dependencies:[j.D,j.E,j.G,j.I,O,Z.YN,Z.qT,Z.me,Z.BC,Z.cb,Z.vS,Z.cV],styles:[".carousel__viewport[_ngcontent-%COMP%]{width:100%;position:relative;overflow:hidden}.swiper-container[_ngcontent-%COMP%]{width:100%;height:100%}.swiper-slide[_ngcontent-%COMP%]{width:auto;height:auto}.filter-link[_ngcontent-%COMP%]{display:inline-block;padding:8px 16px;border-radius:20px;text-decoration:none;color:inherit;white-space:nowrap}.filter-link--selected[_ngcontent-%COMP%]{background-color:#e63118;font-weight:500;color:#fff}.filter-link--unselected[_ngcontent-%COMP%]{background-color:transparent;border:1px solid #f0f0f0}.filter-link--unselected[_ngcontent-%COMP%]:hover{background-color:#ddd;border:1px solid #ddd}.filter-link__cell[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}.visually-hidden[_ngcontent-%COMP%]{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}"]})}return s})();var ue=w(467),me=w(2822),Ri=w(8257),G=w(4412),Bi=w(1985),Vi=(w(1413),w(4572),w(8359),w(5558)),te=w(6697);w(6354),w(6977);const $e=["*"];class J{_ngZone;_pending=[];_listeners=[];_targetStream=new G.t(void 0);_clearListeners(){for(const r of this._listeners)r.remove();this._listeners=[]}constructor(r){this._ngZone=r}getLazyEmitter(r){return this._targetStream.pipe((0,Vi.n)(e=>{const i=new Bi.c(n=>{if(!e)return void this._pending.push({observable:i,observer:n});const a=e.addListener(r,o=>{this._ngZone.run(()=>n.next(o))});if(a)return this._listeners.push(a),()=>a.remove();n.complete()});return i}))}setTarget(r){const e=this._targetStream.value;r!==e&&(e&&(this._clearListeners(),this._pending=[]),this._targetStream.next(r),this._pending.forEach(i=>i.observable.subscribe(i.observer)),this._pending=[])}destroy(){this._clearListeners(),this._pending=[],this._targetStream.complete()}}const Me={center:{lat:37.421995,lng:-122.084092},zoom:17,mapTypeId:"roadmap"};let B=(()=>{class s{_elementRef=(0,t.WQX)(t.aKT);_ngZone=(0,t.WQX)(t.SKi);_eventManager=new J((0,t.WQX)(t.SKi));_mapEl;_existingAuthFailureCallback;googleMap;_isBrowser;height="500px";width="500px";mapId;mapTypeId;set center(e){this._center=e}_center;set zoom(e){this._zoom=e}_zoom;set options(e){this._options=e||Me}_options=Me;mapInitialized=new t.bkB;authFailure=new t.bkB;boundsChanged=this._eventManager.getLazyEmitter("bounds_changed");centerChanged=this._eventManager.getLazyEmitter("center_changed");mapClick=this._eventManager.getLazyEmitter("click");mapDblclick=this._eventManager.getLazyEmitter("dblclick");mapDrag=this._eventManager.getLazyEmitter("drag");mapDragend=this._eventManager.getLazyEmitter("dragend");mapDragstart=this._eventManager.getLazyEmitter("dragstart");headingChanged=this._eventManager.getLazyEmitter("heading_changed");idle=this._eventManager.getLazyEmitter("idle");maptypeidChanged=this._eventManager.getLazyEmitter("maptypeid_changed");mapMousemove=this._eventManager.getLazyEmitter("mousemove");mapMouseout=this._eventManager.getLazyEmitter("mouseout");mapMouseover=this._eventManager.getLazyEmitter("mouseover");projectionChanged=this._eventManager.getLazyEmitter("projection_changed");mapRightclick=this._eventManager.getLazyEmitter("rightclick");tilesloaded=this._eventManager.getLazyEmitter("tilesloaded");tiltChanged=this._eventManager.getLazyEmitter("tilt_changed");zoomChanged=this._eventManager.getLazyEmitter("zoom_changed");constructor(){const e=(0,t.WQX)(t.Agw);if(this._isBrowser=(0,Ri.i)(e),this._isBrowser){const i=window;this._existingAuthFailureCallback=i.gm_authFailure,i.gm_authFailure=()=>{this._existingAuthFailureCallback&&this._existingAuthFailureCallback(),this.authFailure.emit()}}}ngOnChanges(e){(e.height||e.width)&&this._setSize();const i=this.googleMap;i&&(e.options&&i.setOptions(this._combineOptions()),e.center&&this._center&&i.setCenter(this._center),e.zoom&&null!=this._zoom&&i.setZoom(this._zoom),e.mapTypeId&&this.mapTypeId&&i.setMapTypeId(this.mapTypeId))}ngOnInit(){this._isBrowser&&(this._mapEl=this._elementRef.nativeElement.querySelector(".map-container"),this._setSize(),google.maps.Map?this._initialize(google.maps.Map):this._ngZone.runOutsideAngular(()=>{google.maps.importLibrary("maps").then(e=>this._initialize(e.Map))}))}_initialize(e){this._ngZone.runOutsideAngular(()=>{this.googleMap=new e(this._mapEl,this._combineOptions()),this._eventManager.setTarget(this.googleMap),this.mapInitialized.emit(this.googleMap)})}ngOnDestroy(){this.mapInitialized.complete(),this._eventManager.destroy(),this._isBrowser&&(window.gm_authFailure=this._existingAuthFailureCallback)}fitBounds(e,i){this._assertInitialized(),this.googleMap.fitBounds(e,i)}panBy(e,i){this._assertInitialized(),this.googleMap.panBy(e,i)}panTo(e){this._assertInitialized(),this.googleMap.panTo(e)}panToBounds(e,i){this._assertInitialized(),this.googleMap.panToBounds(e,i)}getBounds(){return this._assertInitialized(),this.googleMap.getBounds()||null}getCenter(){return this._assertInitialized(),this.googleMap.getCenter()}getClickableIcons(){return this._assertInitialized(),this.googleMap.getClickableIcons()}getHeading(){return this._assertInitialized(),this.googleMap.getHeading()}getMapTypeId(){return this._assertInitialized(),this.googleMap.getMapTypeId()}getProjection(){return this._assertInitialized(),this.googleMap.getProjection()||null}getStreetView(){return this._assertInitialized(),this.googleMap.getStreetView()}getTilt(){return this._assertInitialized(),this.googleMap.getTilt()}getZoom(){return this._assertInitialized(),this.googleMap.getZoom()}get controls(){return this._assertInitialized(),this.googleMap.controls}get data(){return this._assertInitialized(),this.googleMap.data}get mapTypes(){return this._assertInitialized(),this.googleMap.mapTypes}get overlayMapTypes(){return this._assertInitialized(),this.googleMap.overlayMapTypes}_resolveMap(){return this.googleMap?Promise.resolve(this.googleMap):this.mapInitialized.pipe((0,te.s)(1)).toPromise()}_setSize(){if(this._mapEl){const e=this._mapEl.style;e.height=null===this.height?"":ot(this.height)||"500px",e.width=null===this.width?"":ot(this.width)||"500px"}}_combineOptions(){const e=this._options||{};return{...e,center:this._center||e.center||Me.center,zoom:this._zoom??e.zoom??Me.zoom,mapTypeId:this.mapTypeId||e.mapTypeId||Me.mapTypeId,mapId:this.mapId||e.mapId}}_assertInitialized(){}static \u0275fac=function(i){return new(i||s)};static \u0275cmp=t.VBU({type:s,selectors:[["google-map"]],inputs:{height:"height",width:"width",mapId:"mapId",mapTypeId:"mapTypeId",center:"center",zoom:"zoom",options:"options"},outputs:{mapInitialized:"mapInitialized",authFailure:"authFailure",boundsChanged:"boundsChanged",centerChanged:"centerChanged",mapClick:"mapClick",mapDblclick:"mapDblclick",mapDrag:"mapDrag",mapDragend:"mapDragend",mapDragstart:"mapDragstart",headingChanged:"headingChanged",idle:"idle",maptypeidChanged:"maptypeidChanged",mapMousemove:"mapMousemove",mapMouseout:"mapMouseout",mapMouseover:"mapMouseover",projectionChanged:"projectionChanged",mapRightclick:"mapRightclick",tilesloaded:"tilesloaded",tiltChanged:"tiltChanged",zoomChanged:"zoomChanged"},exportAs:["googleMap"],features:[t.OA$],ngContentSelectors:$e,decls:2,vars:0,consts:[[1,"map-container"]],template:function(i,n){1&i&&(t.NAR(),t.nrm(0,"div",0),t.SdG(1))},encapsulation:2,changeDetection:0})}return s})();const $i=/([A-Za-z%]+)$/;function ot(s){return null==s?"":$i.test(s)?s:`${s}px`}const We=new t.nKC("MAP_MARKER"),Qi={position:{lat:37.421995,lng:-122.084092}};let Ne=(()=>{class s{_googleMap=(0,t.WQX)(B);_ngZone=(0,t.WQX)(t.SKi);_eventManager=new J((0,t.WQX)(t.SKi));set title(e){this._title=e}_title;set position(e){this._position=e}_position;set label(e){this._label=e}_label;set clickable(e){this._clickable=e}_clickable;set options(e){this._options=e}_options;set icon(e){this._icon=e}_icon;set visible(e){this._visible=e}_visible;animationChanged=this._eventManager.getLazyEmitter("animation_changed");mapClick=this._eventManager.getLazyEmitter("click");clickableChanged=this._eventManager.getLazyEmitter("clickable_changed");cursorChanged=this._eventManager.getLazyEmitter("cursor_changed");mapDblclick=this._eventManager.getLazyEmitter("dblclick");mapDrag=this._eventManager.getLazyEmitter("drag");mapDragend=this._eventManager.getLazyEmitter("dragend");draggableChanged=this._eventManager.getLazyEmitter("draggable_changed");mapDragstart=this._eventManager.getLazyEmitter("dragstart");flatChanged=this._eventManager.getLazyEmitter("flat_changed");iconChanged=this._eventManager.getLazyEmitter("icon_changed");mapMousedown=this._eventManager.getLazyEmitter("mousedown");mapMouseout=this._eventManager.getLazyEmitter("mouseout");mapMouseover=this._eventManager.getLazyEmitter("mouseover");mapMouseup=this._eventManager.getLazyEmitter("mouseup");positionChanged=this._eventManager.getLazyEmitter("position_changed");mapRightclick=this._eventManager.getLazyEmitter("rightclick");shapeChanged=this._eventManager.getLazyEmitter("shape_changed");titleChanged=this._eventManager.getLazyEmitter("title_changed");visibleChanged=this._eventManager.getLazyEmitter("visible_changed");zindexChanged=this._eventManager.getLazyEmitter("zindex_changed");markerInitialized=new t.bkB;marker;constructor(){}ngOnInit(){this._googleMap._isBrowser&&(google.maps.Marker&&this._googleMap.googleMap?this._initialize(this._googleMap.googleMap,google.maps.Marker):this._ngZone.runOutsideAngular(()=>{Promise.all([this._googleMap._resolveMap(),google.maps.importLibrary("marker")]).then(([e,i])=>{this._initialize(e,i.Marker)})}))}_initialize(e,i){this._ngZone.runOutsideAngular(()=>{this.marker=new i(this._combineOptions()),this._assertInitialized(),this.marker.setMap(e),this._eventManager.setTarget(this.marker),this.markerInitialized.next(this.marker)})}ngOnChanges(e){const{marker:i,_title:n,_position:a,_label:o,_clickable:l,_icon:c,_visible:d}=this;i&&(e.options&&i.setOptions(this._combineOptions()),e.title&&void 0!==n&&i.setTitle(n),e.position&&a&&i.setPosition(a),e.label&&void 0!==o&&i.setLabel(o),e.clickable&&void 0!==l&&i.setClickable(l),e.icon&&c&&i.setIcon(c),e.visible&&void 0!==d&&i.setVisible(d))}ngOnDestroy(){this.markerInitialized.complete(),this._eventManager.destroy(),this.marker?.setMap(null)}getAnimation(){return this._assertInitialized(),this.marker.getAnimation()||null}getClickable(){return this._assertInitialized(),this.marker.getClickable()}getCursor(){return this._assertInitialized(),this.marker.getCursor()||null}getDraggable(){return this._assertInitialized(),!!this.marker.getDraggable()}getIcon(){return this._assertInitialized(),this.marker.getIcon()||null}getLabel(){return this._assertInitialized(),this.marker.getLabel()||null}getOpacity(){return this._assertInitialized(),this.marker.getOpacity()||null}getPosition(){return this._assertInitialized(),this.marker.getPosition()||null}getShape(){return this._assertInitialized(),this.marker.getShape()||null}getTitle(){return this._assertInitialized(),this.marker.getTitle()||null}getVisible(){return this._assertInitialized(),this.marker.getVisible()}getZIndex(){return this._assertInitialized(),this.marker.getZIndex()||null}getAnchor(){return this._assertInitialized(),this.marker}_resolveMarker(){return this.marker?Promise.resolve(this.marker):this.markerInitialized.pipe((0,te.s)(1)).toPromise()}_combineOptions(){const e=this._options||Qi;return{...e,title:this._title||e.title,position:this._position||e.position,label:this._label||e.label,clickable:this._clickable??e.clickable,map:this._googleMap.googleMap,icon:this._icon||e.icon,visible:this._visible??e.visible}}_assertInitialized(){}static \u0275fac=function(i){return new(i||s)};static \u0275dir=t.FsC({type:s,selectors:[["map-marker"]],inputs:{title:"title",position:"position",label:"label",clickable:"clickable",options:"options",icon:"icon",visible:"visible"},outputs:{animationChanged:"animationChanged",mapClick:"mapClick",clickableChanged:"clickableChanged",cursorChanged:"cursorChanged",mapDblclick:"mapDblclick",mapDrag:"mapDrag",mapDragend:"mapDragend",draggableChanged:"draggableChanged",mapDragstart:"mapDragstart",flatChanged:"flatChanged",iconChanged:"iconChanged",mapMousedown:"mapMousedown",mapMouseout:"mapMouseout",mapMouseover:"mapMouseover",mapMouseup:"mapMouseup",positionChanged:"positionChanged",mapRightclick:"mapRightclick",shapeChanged:"shapeChanged",titleChanged:"titleChanged",visibleChanged:"visibleChanged",zindexChanged:"zindexChanged",markerInitialized:"markerInitialized"},exportAs:["mapMarker"],features:[t.Jv_([{provide:We,useExisting:s}]),t.OA$]})}return s})(),os=(()=>{class s{static \u0275fac=function(i){return new(i||s)};static \u0275mod=t.$C({type:s});static \u0275inj=t.G2t({})}return s})();var lt=w(980),Te=w(5312),ls=w(3587);let ds=(()=>{class s{promise=null;loadGoogleMaps(){return this.promise||(this.promise=new Promise((e,i)=>{window.initMap=()=>{console.log("Google Maps API loaded successfully"),e()};const n=document.createElement("script");n.id="google-maps-script",n.src=`https://maps.googleapis.com/maps/api/js?key=${ls.c.googleApiKey}&callback=initMap&libraries=places,marker`,n.async=!0,n.defer=!0,n.onerror=()=>{console.error("Failed to load Google Maps API"),i(new Error("Failed to load Google Maps API"))},document.body.appendChild(n)})),this.promise}static \u0275fac=function(i){return new(i||s)};static \u0275prov=t.jDH({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})();const cs=["mapContainer"],us=["search"],ps=["addressForm"],_e=s=>({"is-invalid":s}),hs=(s,r)=>({"btn-primary":s,"btn-secondary":r});function gs(s,r){if(1&s&&(t.j41(0,"div",51),t.EFF(1),t.k0s()),2&s){const e=t.XpG(2);t.R7$(),t.SpI(" ",e.errorMessage," ")}}function fs(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",21)(1,"div",22)(2,"h2"),t.EFF(3,"Agregar Nueva Direcci\xf3n"),t.k0s(),t.j41(4,"form",23,0),t.bIt("ngSubmit",function(){t.eBV(e);const n=t.XpG();return t.Njj(n.addNewAddress(n.newAddress))}),t.j41(6,"div",24)(7,"div",25)(8,"div",26)(9,"label",27),t.EFF(10,"Buscar direcci\xf3n"),t.k0s(),t.nrm(11,"input",28,1),t.k0s(),t.j41(13,"div",26)(14,"label",29),t.EFF(15,"Direcci\xf3n"),t.k0s(),t.j41(16,"input",30,2),t.mxI("ngModelChange",function(n){t.eBV(e);const a=t.XpG();return t.DH7(a.newAddress.address,n)||(a.newAddress.address=n),t.Njj(n)}),t.k0s()(),t.j41(18,"div",26)(19,"label",31),t.EFF(20,"Ciudad"),t.k0s(),t.j41(21,"input",32,3),t.mxI("ngModelChange",function(n){t.eBV(e);const a=t.XpG();return t.DH7(a.newAddress.city,n)||(a.newAddress.city=n),t.Njj(n)}),t.k0s()(),t.j41(23,"div",26)(24,"label",33),t.EFF(25,"Estado"),t.k0s(),t.j41(26,"input",34,4),t.mxI("ngModelChange",function(n){t.eBV(e);const a=t.XpG();return t.DH7(a.newAddress.state,n)||(a.newAddress.state=n),t.Njj(n)}),t.k0s()(),t.j41(28,"div",26)(29,"label",35),t.EFF(30,"C\xf3digo Postal"),t.k0s(),t.j41(31,"input",36,5),t.mxI("ngModelChange",function(n){t.eBV(e);const a=t.XpG();return t.DH7(a.newAddress.postalCode,n)||(a.newAddress.postalCode=n),t.Njj(n)}),t.k0s()(),t.j41(33,"div",26)(34,"label",37),t.EFF(35,"Pa\xeds"),t.k0s(),t.j41(36,"input",38,6),t.mxI("ngModelChange",function(n){t.eBV(e);const a=t.XpG();return t.DH7(a.newAddress.country,n)||(a.newAddress.country=n),t.Njj(n)}),t.k0s()(),t.j41(38,"div",26)(39,"label",39),t.EFF(40,"Tel\xe9fono"),t.k0s(),t.j41(41,"input",40,7),t.mxI("ngModelChange",function(n){t.eBV(e);const a=t.XpG();return t.DH7(a.newAddress.phone,n)||(a.newAddress.phone=n),t.Njj(n)}),t.k0s()()(),t.j41(43,"div",25,8)(45,"google-map",41),t.nrm(46,"map-marker",42),t.k0s()()(),t.j41(47,"div",43)(48,"div",25)(49,"div",26)(50,"label",44),t.EFF(51,"Latitud"),t.k0s(),t.j41(52,"input",45),t.mxI("ngModelChange",function(n){t.eBV(e);const a=t.XpG();return t.DH7(a.selectedLat,n)||(a.selectedLat=n),t.Njj(n)}),t.k0s()()(),t.j41(53,"div",25)(54,"div",26)(55,"label",46),t.EFF(56,"Longitud"),t.k0s(),t.j41(57,"input",47),t.mxI("ngModelChange",function(n){t.eBV(e);const a=t.XpG();return t.DH7(a.selectedLng,n)||(a.selectedLng=n),t.Njj(n)}),t.k0s()()()(),t.j41(58,"div",48)(59,"button",49),t.EFF(60),t.k0s()()(),t.DNE(61,gs,2,1,"div",50),t.k0s()()}if(2&s){const e=t.sdS(5),i=t.sdS(17),n=t.sdS(22),a=t.sdS(27),o=t.sdS(32),l=t.sdS(37),c=t.sdS(42),d=t.XpG();t.R7$(16),t.R50("ngModel",d.newAddress.address),t.Y8G("ngClass",t.eq3(23,_e,i.invalid&&(i.dirty||i.touched))),t.R7$(5),t.R50("ngModel",d.newAddress.city),t.Y8G("ngClass",t.eq3(25,_e,n.invalid&&(n.dirty||n.touched))),t.R7$(5),t.R50("ngModel",d.newAddress.state),t.Y8G("ngClass",t.eq3(27,_e,a.invalid&&(a.dirty||a.touched))),t.R7$(5),t.R50("ngModel",d.newAddress.postalCode),t.Y8G("ngClass",t.eq3(29,_e,o.invalid&&(o.dirty||o.touched))),t.R7$(5),t.R50("ngModel",d.newAddress.country),t.Y8G("ngClass",t.eq3(31,_e,l.invalid&&(l.dirty||l.touched))),t.R7$(5),t.R50("ngModel",d.newAddress.phone),t.Y8G("ngClass",t.eq3(33,_e,c.invalid&&(c.dirty||c.touched))),t.R7$(4),t.Y8G("center",d.center)("zoom",d.zoom),t.R7$(),t.Y8G("position",d.markerPosition),t.R7$(6),t.R50("ngModel",d.selectedLat),t.R7$(5),t.R50("ngModel",d.selectedLng),t.R7$(2),t.Aen("border:1px solid #444"),t.Y8G("ngClass",t.l_i(35,hs,e.form.valid,!e.form.valid))("disabled",!e.form.valid),t.R7$(),t.SpI(" ",d.isLoading?"Agregando...":"Agregar Direcci\xf3n"," "),t.R7$(),t.Y8G("ngIf",d.errorMessage)}}function ms(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",56)(1,"div")(2,"div",57),t.nrm(3,"input",58),t.k0s(),t.j41(4,"label",59),t.EFF(5),t.k0s(),t.j41(6,"div",60)(7,"table",61)(8,"tbody")(9,"tr")(10,"td",62),t.EFF(11),t.k0s()(),t.j41(12,"tr")(13,"td"),t.EFF(14,"Direcci\xf3n :"),t.k0s(),t.j41(15,"td")(16,"p"),t.EFF(17),t.k0s()()(),t.j41(18,"tr")(19,"td"),t.EFF(20,"Ciudad :"),t.k0s(),t.j41(21,"td"),t.EFF(22),t.k0s()(),t.j41(23,"tr")(24,"td"),t.EFF(25,"Estado :"),t.k0s(),t.j41(26,"td"),t.EFF(27),t.k0s()(),t.j41(28,"tr")(29,"td"),t.EFF(30,"Pa\xeds :"),t.k0s(),t.j41(31,"td"),t.EFF(32),t.k0s()(),t.j41(33,"tr")(34,"td"),t.EFF(35,"C\xf3digo Postal :"),t.k0s(),t.j41(36,"td"),t.EFF(37),t.k0s()(),t.j41(38,"tr")(39,"td"),t.EFF(40,"Tel\xe9fono :"),t.k0s(),t.j41(41,"td"),t.EFF(42),t.k0s()()()()()(),t.j41(43,"div",63)(44,"button",64),t.bIt("click",function(){t.eBV(e);const n=t.XpG().$implicit,a=t.XpG(2);return t.Njj(a.removeShippingAddress(n.id))}),t.qSk(),t.j41(45,"svg",65),t.nrm(46,"polyline",66)(47,"path",67)(48,"line",68)(49,"line",69),t.k0s(),t.EFF(50),t.k0s()()()}if(2&s){const e=t.XpG().$implicit,i=t.XpG(2);t.AVh("selected",i.selectedAddress===e)("border-default",1===e.set_default),t.R7$(3),t.Y8G("value",e.id)("checked",i.selectedAddress===e||1===e.set_default),t.R7$(),t.xc7("background",1===e.set_default?"color(srgb 0.902 0.192 0.0943)":"color(srgb 0 0.2314 0.451)"),t.R7$(),t.SpI(" ",1===e.set_default?"Default":"Address"," "),t.R7$(6),t.JRh(e.name||"N/A"),t.R7$(6),t.JRh(e.address),t.R7$(5),t.JRh(e.city),t.R7$(5),t.JRh(e.state),t.R7$(5),t.JRh(e.country),t.R7$(5),t.JRh(e.postalCode||"N/A"),t.R7$(5),t.JRh(e.phone),t.R7$(2),t.Y8G("disabled",i.removingAddressId===e.id),t.R7$(6),t.SpI(" ",i.removingAddressId===e.id?"Eliminando...":"Eliminar"," ")}}function vs(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",54),t.bIt("click",function(){const n=t.eBV(e).$implicit,a=t.XpG(2);return t.Njj(a.selectAddress(n))}),t.DNE(1,ms,51,18,"div",55),t.k0s()}if(2&s){const e=r.$implicit,i=t.XpG(2);t.Y8G("@fadeOut",i.removingAddressId===e.id?"void":"in"),t.R7$(),t.Y8G("ngIf",i.showAllAddresses||1===e.set_default)}}function _s(s,r){if(1&s&&(t.j41(0,"div",52),t.DNE(1,vs,2,2,"div",53),t.k0s()),2&s){const e=t.XpG();t.R7$(),t.Y8G("ngForOf",e.addresses)}}let ys=(()=>{class s{userService;ngZone;cdr;googleMapsLoader;userCustomer;mapElement;searchElementRef;addressForm;newAddress={address:"",city:"",state:"",postalCode:"",country:"",phone:""};center={lat:Te.c.latitudeMapCenter,lng:Te.c.longitudeMapCenter};zoom=Te.c.zoomMap;markerPosition=this.center;geocoder;map;marker=null;selectedLat="";selectedLng="";showAddAddress=!1;addressUpdated=new t.bkB;addresses=[];selectedAddress=null;showAllAddresses=!0;isLoading=!1;errorMessage="";removingAddressId=null;constructor(e,i,n,a){this.userService=e,this.ngZone=i,this.cdr=n,this.googleMapsLoader=a}ngOnInit(){this.initializeComponent(),console.log("this.userCustomer",this.userCustomer)}ngAfterViewInit(){var e=this;return(0,ue.A)(function*(){yield e.initializeGoogleMaps(),e.initAutocomplete()})()}initializeComponent(){this.getShippingAddresses()}initializeGoogleMaps(){var e=this;return(0,ue.A)(function*(){yield e.googleMapsLoader.loadGoogleMaps(),e.geocoder=new google.maps.Geocoder,e.initMap()})()}initMap(){const e={center:this.center,zoom:this.zoom,mapTypeId:google.maps.MapTypeId.ROADMAP,mapId:Te.c.googleMapsId};this.map=new google.maps.Map(this.mapElement.nativeElement,e),navigator.geolocation?navigator.geolocation.getCurrentPosition(i=>{const n={lat:i.coords.latitude,lng:i.coords.longitude};this.center=n,this.map.setCenter(n),this.placeMarkerAndPanTo(new google.maps.LatLng(n.lat,n.lng))},()=>{this.handleLocationError(!0,this.map.getCenter())}):this.handleLocationError(!1,this.map.getCenter()),this.map.addListener("click",i=>{i.latLng&&this.placeMarkerAndPanTo(i.latLng)}),this.initAutocomplete()}handleLocationError(e,i){console.warn(e?"Error: The Geolocation service failed.":"Error: Your browser doesn't support geolocation.")}initAutocomplete(){const n=new google.maps.places.Autocomplete(this.searchElementRef.nativeElement,{fields:["address_components","geometry","icon","name"],strictBounds:!1,types:["address"]});n.addListener("place_changed",()=>{const a=n.getPlace();a.geometry&&a.geometry.location?this.ngZone.run(()=>{this.updateMapAndForm(a)}):console.warn("No details available for input: '"+a.name+"'")})}placeMarkerAndPanTo(e){this.marker&&(this.marker.map=null),this.marker=new google.maps.marker.AdvancedMarkerElement({map:this.map,position:e}),this.map.panTo(e),this.updateFormFromLatLng(e)}updateMapAndForm(e){e.geometry?.location&&(this.map.setCenter(e.geometry.location),this.map.setZoom(17),this.placeMarkerAndPanTo(e.geometry.location),this.updateFormFromPlace(e))}updateFormFromLatLng(e){this.geocoder.geocode({location:e},(i,n)=>{n===google.maps.GeocoderStatus.OK&&i&&i.length>0&&this.ngZone.run(()=>{this.updateFormFromPlace(i[0])})})}updateFormFromPlace(e){let i=e.address_components,n={};n.address=e.formatted_address,n.latitude=e.geometry?.location?.lat().toString(),n.longitude=e.geometry?.location?.lng().toString();for(let a of i)switch(a.types[0]){case"locality":n.city=a.long_name;break;case"administrative_area_level_1":n.state=a.long_name;break;case"country":n.country=a.long_name;break;case"postal_code":n.postalCode=a.long_name}this.updateAddressForm(n)}updateAddressForm(e){this.addressForm&&Object.keys(e).forEach(i=>{const n=this.addressForm.form.get(i);n&&n.setValue(e[i])})}showAddAddressForm(){this.showAddAddress=!this.showAddAddress,this.showAddAddress?setTimeout(()=>{this.initMap(),this.cdr.detectChanges()}):(this.selectedLat="",this.selectedLng="")}getShippingAddresses(){this.userService.getUserShippingAddress().subscribe({next:e=>{if(this.addresses=e,this.setDefaultAddress(),this.addresses.length>0){const i=this.addresses.find(a=>1===a.set_default)||this.addresses[0],n=e[0]?.user_id;this.getUserDetails(n,i)}},error:e=>{console.error("Failed to fetch shipping addresses:",e)}})}getUserDetails(e,i){this.userService.getUserGeneralDetails(e).subscribe({next:n=>{this.selectedAddress={...i,userDetails:n},this.selectAddress(this.selectedAddress)},error:n=>console.error("Error al obtener detalles del usuario",n)})}setDefaultAddress(){this.addresses.length>0&&(this.selectedAddress=this.addresses.find(e=>1===e.set_default)||this.addresses[0],this.emitSelectedAddress())}selectAddress(e){e?.id?this.selectedAddress?.id!==e.id?(this.selectedAddress=e,1!==e.set_default?this.updateDefaultAddress(e):this.emitSelectedAddress()):this.emitSelectedAddress():console.warn("Address ID is undefined or null!")}updateDefaultAddress(e){this.userService.setDefaultUserShippingAddress(e.id).subscribe({next:()=>{this.addresses=this.addresses.map(i=>i.id===e.id?{...i,set_default:1}:{...i,set_default:0}),this.emitSelectedAddress()},error:i=>{console.error("API call failed:",i)}})}removeShippingAddress(e){this.removingAddressId=e,this.userService.removeUserShippingAddress(e).pipe((0,lt.j)(()=>{this.removingAddressId=null})).subscribe({next:()=>{setTimeout(()=>{this.handleAddressRemoval(e)},300)},error:i=>{console.error("Failed to remove shipping address:",i)}})}handleAddressRemoval(e){const i=1===this.addresses.find(n=>n.id===e)?.set_default;this.addresses=this.addresses.filter(n=>n.id!==e),(i||this.selectedAddress?.id===e)&&(this.addresses.length>0?(this.addresses[0].set_default=i?1:this.addresses[0].set_default,this.selectedAddress=this.addresses[0]):this.selectedAddress=null),this.emitSelectedAddress()}emitSelectedAddress(){this.selectedAddress?this.addressUpdated.emit(this.selectedAddress):console.warn("No address to emit.")}addNewAddress(e){if(this.isLoading=!0,this.errorMessage="",10!==e.phone.length)return this.errorMessage="El tel\xe9fono debe ser de 10 d\xedgitos",void(this.isLoading=!1);this.userService.createUserShippingAddress(e.address,e.city,e.state,e.postalCode,e.country,e.phone).pipe((0,lt.j)(()=>{this.isLoading=!1})).subscribe({next:i=>{i.result?(console.log("Nueva direcci\xf3n a\xf1adida:",i),this.addresses.push(i.data),1===this.addresses.length&&this.updateDefaultAddress(i.data),e.latitude&&e.longitude&&this.updateAddressLocation(i.data.id,e.latitude,e.longitude),this.getShippingAddresses(),console.log("Direcci\xf3n a\xf1adida con \xe9xito")):(this.errorMessage=i.message||"Error al a\xf1adir la direcci\xf3n",console.error(this.errorMessage))},error:i=>{this.errorMessage="Error al a\xf1adir nueva direcci\xf3n",console.error("Error al a\xf1adir nueva direcci\xf3n:",i)}})}updateAddressLocation(e,i,n){this.userService.updateUserLocationAddress(e,i,n).subscribe({next:a=>{console.log("Ubicaci\xf3n de la direcci\xf3n actualizada:",a)},error:a=>{console.error("Error al actualizar la ubicaci\xf3n de la direcci\xf3n:",a)}})}static \u0275fac=function(i){return new(i||s)(t.rXU(Ve.D),t.rXU(t.SKi),t.rXU(t.gRc),t.rXU(ds))};static \u0275cmp=t.VBU({type:s,selectors:[["app-customer-address"]],viewQuery:function(i,n){if(1&i&&(t.GBs(cs,5),t.GBs(us,5),t.GBs(ps,5)),2&i){let a;t.mGM(a=t.lsd())&&(n.mapElement=a.first),t.mGM(a=t.lsd())&&(n.searchElementRef=a.first),t.mGM(a=t.lsd())&&(n.addressForm=a.first)}},inputs:{userCustomer:"userCustomer"},outputs:{addressUpdated:"addressUpdated"},decls:16,vars:3,consts:[["addressForm","ngForm"],["search",""],["addressInput","ngModel"],["cityInput","ngModel"],["stateInput","ngModel"],["postalCodeInput","ngModel"],["countryInput","ngModel"],["phoneInput","ngModel"],["mapContainer",""],["id","pills-address","role","tabpanel",1,"tab-pane","fade","show"],[1,"dashboard-address"],[1,"title","title-flex"],[1,"title-leaf"],[1,"icon-width","bg-gray"],[0,"xlink","href","assets/svg/leaf.svg#leaf"],[1,"btn","theme-bg-color","text-white","btn-sm","fw-bold","mt-lg-0","mt-3",3,"click"],["xmlns","http://www.w3.org/2000/svg","width","24","height","24","viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"feather","feather-plus","me-2"],["x1","12","y1","5","x2","12","y2","19"],["x1","5","y1","12","x2","19","y2","12"],["class","row g-sm-1",4,"ngIf"],["class","row g-sm-4 g-3",4,"ngIf"],[1,"row","g-sm-1"],[1,"container","col-xxl-12"],[3,"ngSubmit"],[1,"row"],[1,"col-md-6"],[1,"form-group"],["for","search"],["type","text","id","search","autocomplete","off",1,"form-control"],["for","address"],["type","text","id","address","name","address","required","",1,"form-control",3,"ngModelChange","ngModel","ngClass"],["for","city"],["type","text","id","city","name","city","required","",1,"form-control",3,"ngModelChange","ngModel","ngClass"],["for","state"],["type","text","id","state","name","state","required","",1,"form-control",3,"ngModelChange","ngModel","ngClass"],["for","postalCode"],["type","text","id","postalCode","name","postalCode","required","",1,"form-control",3,"ngModelChange","ngModel","ngClass"],["for","country"],["type","text","id","country","name","country","required","",1,"form-control",3,"ngModelChange","ngModel","ngClass"],["for","phone"],["type","tel","id","phone","name","phone","required","",1,"form-control",3,"ngModelChange","ngModel","ngClass"],[3,"center","zoom"],[3,"position"],[1,"row","mt-3"],["for","latitude"],["type","text","id","latitude","name","latitude","readonly","",1,"form-control",3,"ngModelChange","ngModel"],["for","longitude"],["type","text","id","longitude","name","longitude","readonly","",1,"form-control",3,"ngModelChange","ngModel"],[1,"form-group","mt-3"],["type","submit",1,"btn",3,"ngClass","disabled"],["class","error-message",4,"ngIf"],[1,"error-message"],[1,"row","g-sm-4","g-3"],["class","col-xxl-4 col-xl-6 col-lg-12 col-md-6",3,"click",4,"ngFor","ngForOf"],[1,"col-xxl-4","col-xl-6","col-lg-12","col-md-6",3,"click"],["class","address-box",3,"selected","border-default",4,"ngIf"],[1,"address-box"],[1,"form-check"],["type","radio","name","selectedAddress",1,"form-check-input",3,"value","checked"],[1,"label"],[1,"table-responsive","address-table"],[1,"table"],["colspan","2"],[1,"button-group"],[1,"btn","btn-sm","add-button","w-100",3,"click","disabled"],["xmlns","http://www.w3.org/2000/svg","width","24","height","24","viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"feather","feather-trash-2"],["points","3 6 5 6 21 6"],["d","M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"],["x1","10","y1","11","x2","10","y2","17"],["x1","14","y1","11","x2","14","y2","17"]],template:function(i,n){1&i&&(t.j41(0,"div",9)(1,"div",10)(2,"div",11)(3,"div")(4,"h2"),t.EFF(5,"Mi Libreta de Direcciones"),t.k0s(),t.j41(6,"span",12),t.qSk(),t.j41(7,"svg",13),t.nrm(8,"use",14),t.k0s()()(),t.joV(),t.j41(9,"button",15),t.bIt("click",function(){return n.showAddAddressForm()}),t.qSk(),t.j41(10,"svg",16),t.nrm(11,"line",17)(12,"line",18),t.k0s(),t.EFF(13),t.k0s()(),t.DNE(14,fs,62,38,"div",19)(15,_s,2,1,"div",20),t.k0s()()),2&i&&(t.R7$(13),t.SpI(" ",n.showAddAddress?"Hide Address Form":"Add New Address",""),t.R7$(),t.Y8G("ngIf",n.showAddAddress),t.R7$(),t.Y8G("ngIf",!n.showAddAddress))},dependencies:[j.D,j.E,j.G,j.I,Z.YN,Z.qT,Z.me,Z.BC,Z.cb,Z.YS,Z.vS,Z.cV,os,B,Ne],styles:[".btn-primary[_ngcontent-%COMP%]{background:green;color:#fff}"],data:{animation:[(0,me.i)("fadeOut",[(0,me.f)("in",(0,me.h)({opacity:1})),(0,me.t)("in => void",[(0,me.a)("300ms ease-out",(0,me.h)({opacity:0,transform:"translateY(-10px)"}))])])]}})}return s})(),bs=(()=>{class s{userCustomer;onUserReceived(e){this.userCustomer=e,console.log("Datos recibidos en el dashboard:",this.userCustomer)}static \u0275fac=function(i){return new(i||s)};static \u0275cmp=t.VBU({type:s,selectors:[["app-customer-profile"]],inputs:{userCustomer:"userCustomer"},decls:116,vars:4,consts:[["id","pills-profile","role","tabpanel",1,"tab-pane","fade","show"],[1,"dashboard-profile"],[1,"title"],[1,"title-leaf"],[1,"icon-width","bg-gray"],[0,"xlink","href","assets/svg/leaf.svg#leaf"],[1,"profile-detail","dashboard-bg-box"],[1,"dashboard-title"],[1,"profile-name-detail"],[1,"d-sm-flex","align-items-center","d-block"],[1,"product-rating","profile-rating"],[1,"rating"],["xmlns","http://www.w3.org/2000/svg","width","24","height","24","viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"feather","feather-star","fill"],["points","12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"],["xmlns","http://www.w3.org/2000/svg","width","24","height","24","viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"feather","feather-star"],["href","javascript:void(0)","data-bs-toggle","modal","data-bs-target","#editProfile"],[1,"location-profile"],[1,"location-box"],["xmlns","http://www.w3.org/2000/svg","width","24","height","24","viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"feather","feather-map-pin"],["d","M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"],["cx","12","cy","10","r","3"],["xmlns","http://www.w3.org/2000/svg","width","24","height","24","viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"feather","feather-mail"],["d","M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"],["points","22,6 12,13 2,6"],["xmlns","http://www.w3.org/2000/svg","width","24","height","24","viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"feather","feather-check-square"],["points","9 11 12 14 22 4"],["d","M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"],[1,"profile-description"],[1,"profile-about","dashboard-bg-box"],[1,"row"],[1,"col-xxl-7"],[1,"dashboard-title","mb-3"],[1,"table-responsive"],[1,"table"],["href","javascript:void(0)"],["data-bs-toggle","modal","data-bs-target","#editProfile"],[1,"col-xxl-5"],[1,"profile-image"],["src","assets/images/inner-page/dashboard-profile.png","alt","",1,"img-fluid","blur-up","lazyload"]],template:function(i,n){1&i&&(t.j41(0,"div",0)(1,"div",1)(2,"div",2)(3,"h2"),t.EFF(4,"Mi Perf\xedl"),t.k0s(),t.j41(5,"span",3),t.qSk(),t.j41(6,"svg",4),t.nrm(7,"use",5),t.k0s()()(),t.joV(),t.j41(8,"div",6)(9,"div",7)(10,"h3"),t.EFF(11,"Nombre del Perf\xedl"),t.k0s()(),t.j41(12,"div",8)(13,"div",9)(14,"h3"),t.EFF(15),t.k0s(),t.j41(16,"div",10)(17,"ul",11)(18,"li"),t.qSk(),t.j41(19,"svg",12),t.nrm(20,"polygon",13),t.k0s()(),t.joV(),t.j41(21,"li"),t.qSk(),t.j41(22,"svg",12),t.nrm(23,"polygon",13),t.k0s()(),t.joV(),t.j41(24,"li"),t.qSk(),t.j41(25,"svg",12),t.nrm(26,"polygon",13),t.k0s()(),t.joV(),t.j41(27,"li"),t.qSk(),t.j41(28,"svg",14),t.nrm(29,"polygon",13),t.k0s()(),t.joV(),t.j41(30,"li"),t.qSk(),t.j41(31,"svg",14),t.nrm(32,"polygon",13),t.k0s()()()()(),t.joV(),t.j41(33,"a",15),t.EFF(34,"Editar"),t.k0s()(),t.j41(35,"div",16)(36,"ul")(37,"li")(38,"div",17),t.qSk(),t.j41(39,"svg",18),t.nrm(40,"path",19)(41,"circle",20),t.k0s(),t.joV(),t.j41(42,"h6"),t.EFF(43,"Downers Grove, IL"),t.k0s()()(),t.j41(44,"li")(45,"div",17),t.qSk(),t.j41(46,"svg",21),t.nrm(47,"path",22)(48,"polyline",23),t.k0s(),t.joV(),t.j41(49,"h6"),t.EFF(50),t.k0s()()(),t.j41(51,"li")(52,"div",17),t.qSk(),t.j41(53,"svg",24),t.nrm(54,"polyline",25)(55,"path",26),t.k0s(),t.joV(),t.j41(56,"h6"),t.EFF(57,"Licensed for 2 years"),t.k0s()()()()(),t.j41(58,"div",27)(59,"p"),t.EFF(60,"Las viviendas se pueden clasificar seg\xfan su conexi\xf3n con las viviendas y terrenos vecinos. Se pueden utilizar diferentes tipos de tenencia de vivienda para un mismo tipo f\xedsico."),t.k0s()()(),t.j41(61,"div",28)(62,"div",29)(63,"div",30)(64,"div",31)(65,"h3"),t.EFF(66,"Sobre el Perf\xedl"),t.k0s()(),t.j41(67,"div",32)(68,"table",33)(69,"tbody")(70,"tr")(71,"td"),t.EFF(72,"Genero :"),t.k0s(),t.j41(73,"td"),t.EFF(74,"Female"),t.k0s()(),t.j41(75,"tr")(76,"td"),t.EFF(77,"Nacimiento :"),t.k0s(),t.j41(78,"td"),t.EFF(79,"21/05/1997"),t.k0s()(),t.j41(80,"tr")(81,"td"),t.EFF(82,"N\xfamero de Tel\xe9fono :"),t.k0s(),t.j41(83,"td")(84,"a",34),t.EFF(85),t.k0s()()(),t.j41(86,"tr")(87,"td"),t.EFF(88,"Direcci\xf3n :"),t.k0s(),t.j41(89,"td"),t.EFF(90,"549 Sulphur Springs Road, Downers, IL"),t.k0s()()()()(),t.j41(91,"div",31)(92,"h3"),t.EFF(93,"Detalles de la Sesi\xf3n"),t.k0s()(),t.j41(94,"div",32)(95,"table",33)(96,"tbody")(97,"tr")(98,"td"),t.EFF(99,"Correo Electr\xf3nico :"),t.k0s(),t.j41(100,"td")(101,"a",34),t.EFF(102),t.j41(103,"span",35),t.EFF(104,"Editar"),t.k0s()()()(),t.j41(105,"tr")(106,"td"),t.EFF(107,"Contrase\xf1a :"),t.k0s(),t.j41(108,"td")(109,"a",34),t.EFF(110,"\u25cf\u25cf\u25cf\u25cf\u25cf\u25cf "),t.j41(111,"span",35),t.EFF(112,"Editar"),t.k0s()()()()()()()(),t.j41(113,"div",36)(114,"div",37),t.nrm(115,"img",38),t.k0s()()()()()()),2&i&&(t.R7$(15),t.JRh(null==n.userCustomer?null:n.userCustomer.name),t.R7$(35),t.JRh(null==n.userCustomer?null:n.userCustomer.email),t.R7$(35),t.SpI(" ",null==n.userCustomer?null:n.userCustomer.phone,""),t.R7$(17),t.SpI("",null==n.userCustomer?null:n.userCustomer.email," "))},encapsulation:2})}return s})(),ws=(()=>{class s{userCustomer;onUserReceived(e){this.userCustomer=e,console.log("Datos recibidos en el dashboard:",this.userCustomer)}static \u0275fac=function(i){return new(i||s)};static \u0275cmp=t.VBU({type:s,selectors:[["app-customer-settings"]],inputs:{userCustomer:"userCustomer"},decls:50,vars:0,consts:[["id","pills-security","role","tabpanel",1,"tab-pane","fade","show"],[1,"dashboard-privacy"],[1,"dashboard-bg-box"],[1,"dashboard-title","mb-4"],[1,"privacy-box"],[1,"d-flex","align-items-start"],[1,"form-check","form-switch","switch-radio","ms-auto"],["type","checkbox","role","switch","id","redio",1,"form-check-input"],["for","redio",1,"form-check-label"],[1,"text-content"],["type","checkbox","role","switch","id","redio2",1,"form-check-input"],["for","redio2",1,"form-check-label"],[1,"btn","theme-bg-color","btn-md","fw-bold","mt-4","text-white"],[1,"dashboard-bg-box","mt-4"],["type","checkbox","role","switch","id","redio3",1,"form-check-input"],["for","redio3",1,"form-check-label"],["type","checkbox","role","switch","id","redio4",1,"form-check-input"],["for","redio4",1,"form-check-label"]],template:function(i,n){1&i&&(t.j41(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"h3"),t.EFF(5,"Privacidad"),t.k0s()(),t.j41(6,"div",4)(7,"div",5)(8,"h6"),t.EFF(9,"Permite que otros vean mi perf\xedl"),t.k0s(),t.j41(10,"div",6),t.nrm(11,"input",7)(12,"label",8),t.k0s()(),t.j41(13,"p",9),t.EFF(14,"Todas las personas podr\xe1n ver mi perf\xedl"),t.k0s()(),t.j41(15,"div",4)(16,"div",5)(17,"h6"),t.EFF(18,"\xbfQui\xe9n ha guardado este perfil? Solo para que vean mi perfil"),t.k0s(),t.j41(19,"div",6),t.nrm(20,"input",10)(21,"label",11),t.k0s()(),t.j41(22,"p",9),t.EFF(23,"Todas las personas no podr\xe1n ver mi perfil"),t.k0s()(),t.j41(24,"button",12),t.EFF(25,"Guardar Cambios"),t.k0s()(),t.j41(26,"div",13)(27,"div",3)(28,"h3"),t.EFF(29,"Configuraci\xf3n de Cuenta"),t.k0s()(),t.j41(30,"div",4)(31,"div",5)(32,"h6"),t.EFF(33,"Eliminar su Cuenta"),t.k0s(),t.j41(34,"div",6),t.nrm(35,"input",14)(36,"label",15),t.k0s()(),t.j41(37,"p",9),t.EFF(38,"Una vez que su cuenta se elimine, se registrar\xe1 y no podr\xe1 iniciar sesi\xf3n."),t.k0s()(),t.j41(39,"div",4)(40,"div",5)(41,"h6"),t.EFF(42,"Eliminaci\xf3n de su Cuenta ser\xe1 Temporal"),t.k0s(),t.j41(43,"div",6),t.nrm(44,"input",16)(45,"label",17),t.k0s()(),t.j41(46,"p",9),t.EFF(47,"Una vez que se elimine su cuenta, se registrar\xe1 y crear\xe1 una nueva cuenta"),t.k0s()(),t.j41(48,"button",12),t.EFF(49,"Eliminar Mi Cuenta"),t.k0s()()()())},encapsulation:2})}return s})();var Ms=w(99),Cs=w(5721);const ks=["fileInput"],Ss=s=>({"d-none":s}),he=s=>({"tab-pane fade":!0,"show active":s});function Is(s,r){1&s&&(t.j41(0,"div",60),t.nrm(1,"div",61),t.k0s())}function Es(s,r){1&s&&(t.j41(0,"div",62)(1,"div",63)(2,"span",64),t.EFF(3,"Cargando..."),t.k0s()()())}let zs=(()=>{class s{loginService;userService;toastr;cdr;activeTab="pills-dashboard";userLoaded=new t.bkB;imageInput;isImageLoading=!0;userCustomer=null;isMenuVisible=!1;isUploading=!1;isLoading=!0;email="";authStatusSubscription=null;constructor(e,i,n,a){this.loginService=e,this.userService=i,this.toastr=n,this.cdr=a}ngOnInit(){this.loadUserInfo()}changeTab(e){this.activeTab=e,console.log("Tab activo:",this.activeTab)}loadUserInfo(){console.log("Loading user info..."),this.loginService.getUserInfo().subscribe({next:e=>{console.log("User info received:",e),e.data&&e.data.length>0?(this.userCustomer=e.data[0],console.log("Updated userCustomer avatar is:",this.userCustomer?.avatar),this.userCustomer&&(this.userCustomer.avatar&&!this.userCustomer.avatar.startsWith("http")&&"assets/img/placeholder.jpg"!==this.userCustomer.avatar&&(this.userCustomer.avatar=`${this.userCustomer.avatar}`),this.userCustomer.avatar_original&&!this.userCustomer.avatar_original.startsWith("http")&&(this.userCustomer.avatar_original=`${this.userCustomer.avatar_original}`),this.userLoaded.emit(this.userCustomer))):(console.error("User info is empty or not in the expected format"),this.userCustomer=null),this.cdr.detectChanges()},error:e=>{console.error("Error fetching user info:",e),this.userCustomer=null}})}toggleMenuDashboard(){this.isMenuVisible=!this.isMenuVisible}closeMenuDashboard(){this.isMenuVisible=!1}ngOnDestroy(){this.authStatusSubscription&&this.authStatusSubscription.unsubscribe()}onImageSelected(e){const i=e.target.files[0];if(i){this.isUploading=!0;const n=new FileReader;n.onload=a=>{this.userCustomer&&(this.userCustomer={...this.userCustomer,avatar:a.target.result})},n.readAsDataURL(i),this.userService.profileUploadImage(i).subscribe({next:a=>{if(this.isUploading=!1,a.result&&a.path){const o=a.path.startsWith("http")?a.path:`${a.path}`;if(this.userCustomer){this.userCustomer={...this.userCustomer,avatar:o},sessionStorage.setItem("currentUserAvatar",o);const l=localStorage.getItem("user");if(l){const c=JSON.parse(l);c.avatar=o,localStorage.setItem("user",JSON.stringify(c))}}this.toastr.success("Imagen actualizada correctamente")}},error:a=>{this.isUploading=!1,console.error("Error uploading image:",a),this.toastr.error("Error al subir la imagen");const o=sessionStorage.getItem("currentUserAvatar");o&&this.userCustomer&&(this.userCustomer.avatar=o)},complete:()=>{this.imageInput?.nativeElement&&(this.imageInput.nativeElement.value="")}})}}refreshAvatar(){this.userCustomer&&this.userCustomer.avatar&&(this.isImageLoading=!0,this.userCustomer.avatar=`${this.userCustomer.avatar}?t=${(new Date).getTime()}`,console.log("Refreshed avatar URL:",this.userCustomer.avatar),this.cdr.detectChanges())}handleImageError(e){const i=e.target;if(i&&!i.src.includes("placeholder.jpg"))if(console.error("Image load error. Current src:",i.src),console.log("userCustomer:",this.userCustomer),i.getAttribute("data-tried-placeholder"))this.hideImageShowText(i);else{let n="/assets/images/placeholder.jpg";this.userCustomer?.avatar&&"https://negocios.lapieza.do/public/assets/img/placeholder.jpg"!==this.userCustomer.avatar?n=this.userCustomer.avatar:this.userCustomer?.avatar_original&&(n=this.userCustomer.avatar_original),console.log("Setting new src:",n),i.src=n,i.setAttribute("data-tried-placeholder","true")}this.isImageLoading=!1}handleImageLoad(){this.isImageLoading=!1}hideImageShowText(e){e.style.display="none";const i=document.createTextNode("Image not available");e.parentNode?.insertBefore(i,e)}static \u0275fac=function(i){return new(i||s)(t.rXU(Cs.H),t.rXU(Ve.D),t.rXU(V.tw),t.rXU(t.gRc))};static \u0275cmp=t.VBU({type:s,selectors:[["app-customer"]],viewQuery:function(i,n){if(1&i&&t.GBs(ks,5),2&i){let a;t.mGM(a=t.lsd())&&(n.imageInput=a.first)}},outputs:{userLoaded:"userLoaded"},decls:81,vars:52,consts:[["fileInput",""],[1,"user-dashboard-section","section-b-space"],[1,"container-fluid-lg"],[1,"row"],[1,"col-xxl-3","col-lg-4"],[1,"dashboard-left-sidebar"],[1,"close-button","d-flex","d-lg-none",3,"click"],[1,"close-sidebar"],[1,"fa-solid","fa-xmark"],[1,"profile-box"],[1,"cover-image"],["src","assets/images/inner-page/cover-img.jpg","alt","",1,"img-fluid","blur-up","lazyloaded"],[1,"profile-contain"],[1,"profile-image"],[1,"position-relative"],["alt","User Avatar",3,"error","load","src","ngClass"],["class","position-absolute top-50 start-50 translate-middle",4,"ngIf"],[1,"cover-icon"],[1,"fa-solid","fa-pen",3,"click"],["type","file","accept","image/jpeg,image/png,image/gif,image/svg+xml,image/webp",2,"display","none",3,"change"],["class","upload-overlay",4,"ngIf"],[1,"profile-name"],[1,"text-content"],["id","pills-tab","role","tablist",1,"nav","nav-pills","user-nav-pills"],["role","presentation",1,"nav-item"],["id","pills-dashboard-tab","type","button",1,"nav-link",3,"click"],["xmlns","http://www.w3.org/2000/svg","width","24","height","24","viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"feather","feather-home"],["d","M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"],["points","9 22 9 12 15 12 15 22"],["id","pills-order-tab","type","button",1,"nav-link",3,"click"],["xmlns","http://www.w3.org/2000/svg","width","24","height","24","viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"feather","feather-shopping-bag"],["d","M6 2L3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4z"],["x1","3","y1","6","x2","21","y2","6"],["d","M16 10a4 4 0 0 1-8 0"],["id","pills-wishlist-tab","type","button",1,"nav-link",3,"click"],["xmlns","http://www.w3.org/2000/svg","width","24","height","24","viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"feather","feather-heart"],["d","M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"],["id","pills-address-tab","type","button","role","tab",1,"nav-link",3,"click"],["xmlns","http://www.w3.org/2000/svg","width","24","height","24","viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"feather","feather-map-pin"],["d","M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"],["cx","12","cy","10","r","3"],["id","pills-profile-tab","type","button","role","tab",1,"nav-link",3,"click"],["xmlns","http://www.w3.org/2000/svg","width","24","height","24","viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"feather","feather-user"],["d","M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"],["cx","12","cy","7","r","4"],["id","pills-security-tab","type","button","role","tab",1,"nav-link",3,"click"],["xmlns","http://www.w3.org/2000/svg","width","24","height","24","viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"feather","feather-shield"],["d","M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"],[1,"col-xxl-9","col-lg-8"],[1,"btn","left-dashboard-show","btn-animation","btn-md","fw-bold","d-block","mb-4","d-lg-none",3,"click"],[1,"dashboard-right-sidebar"],["id","pills-tabContent",1,"tab-content"],["id","pills-dashboard","role","tabpanel",3,"ngClass"],[3,"userCustomer"],["id","pills-order","role","tabpanel",3,"ngClass"],["id","pills-wishlist","role","tabpanel",3,"ngClass"],["id","pills-address","role","tabpanel",3,"ngClass"],["id","pills-profile","role","tabpanel",3,"ngClass"],["id","pills-security","role","tabpanel",3,"ngClass"],["id","order-detail","role","tabpanel",3,"ngClass"],[1,"position-absolute","top-50","start-50","translate-middle"],[1,"custom-loader"],[1,"upload-overlay"],["role","status",1,"spinner-border","text-primary"],[1,"visually-hidden"]],template:function(i,n){if(1&i){const a=t.RV6();t.j41(0,"section",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"div",5)(5,"div",6),t.bIt("click",function(){return t.eBV(a),t.Njj(n.closeMenuDashboard())}),t.j41(6,"button",7),t.nrm(7,"i",8),t.k0s()(),t.j41(8,"div",9)(9,"div",10),t.nrm(10,"img",11),t.k0s(),t.j41(11,"div",12)(12,"div",13)(13,"div",14)(14,"img",15),t.bIt("error",function(l){return t.eBV(a),t.Njj(n.handleImageError(l))})("load",function(){return t.eBV(a),t.Njj(n.handleImageLoad())}),t.k0s(),t.DNE(15,Is,2,0,"div",16),t.j41(16,"div",17)(17,"i",18),t.bIt("click",function(){t.eBV(a);const l=t.sdS(19);return t.Njj(l.click())}),t.k0s(),t.j41(18,"input",19,0),t.bIt("change",function(l){return t.eBV(a),t.Njj(n.onImageSelected(l))}),t.k0s()(),t.DNE(20,Es,4,0,"div",20),t.k0s()(),t.j41(21,"div",21)(22,"h3"),t.EFF(23),t.k0s(),t.j41(24,"h6",22),t.EFF(25),t.k0s()()()(),t.j41(26,"ul",23)(27,"li",24)(28,"button",25),t.bIt("click",function(){return t.eBV(a),t.Njj(n.changeTab("pills-dashboard"))}),t.qSk(),t.j41(29,"svg",26),t.nrm(30,"path",27)(31,"polyline",28),t.k0s(),t.EFF(32," DashBoard "),t.k0s()(),t.joV(),t.j41(33,"li",24)(34,"button",29),t.bIt("click",function(){return t.eBV(a),t.Njj(n.changeTab("pills-order"))}),t.qSk(),t.j41(35,"svg",30),t.nrm(36,"path",31)(37,"line",32)(38,"path",33),t.k0s(),t.EFF(39," \xd3rdenes "),t.k0s()(),t.joV(),t.j41(40,"li",24)(41,"button",34),t.bIt("click",function(){return t.eBV(a),t.Njj(n.changeTab("pills-wishlist"))}),t.qSk(),t.j41(42,"svg",35),t.nrm(43,"path",36),t.k0s(),t.EFF(44," Listas de Deseo"),t.k0s()(),t.joV(),t.j41(45,"li",24)(46,"button",37),t.bIt("click",function(){return t.eBV(a),t.Njj(n.changeTab("pills-address"))}),t.qSk(),t.j41(47,"svg",38),t.nrm(48,"path",39)(49,"circle",40),t.k0s(),t.EFF(50,"Direcciones"),t.k0s()(),t.joV(),t.j41(51,"li",24)(52,"button",41),t.bIt("click",function(){return t.eBV(a),t.Njj(n.changeTab("pills-profile"))}),t.qSk(),t.j41(53,"svg",42),t.nrm(54,"path",43)(55,"circle",44),t.k0s(),t.EFF(56," Perf\xedl"),t.k0s()(),t.joV(),t.j41(57,"li",24)(58,"button",45),t.bIt("click",function(){return t.eBV(a),t.Njj(n.changeTab("pills-security"))}),t.qSk(),t.j41(59,"svg",46),t.nrm(60,"path",47),t.k0s(),t.EFF(61," Privacidad"),t.k0s()()()()(),t.joV(),t.j41(62,"div",48)(63,"button",49),t.bIt("click",function(){return t.eBV(a),t.Njj(n.toggleMenuDashboard())}),t.EFF(64,"Mostrar Men\xfa"),t.k0s(),t.j41(65,"div",50)(66,"div",51)(67,"div",52),t.nrm(68,"app-customer-dashboard",53),t.k0s(),t.j41(69,"div",54),t.nrm(70,"app-customer-orders",53),t.k0s(),t.j41(71,"div",55),t.nrm(72,"app-customer-wishlist",53),t.k0s(),t.j41(73,"div",56),t.nrm(74,"app-customer-address",53),t.k0s(),t.j41(75,"div",57),t.nrm(76,"app-customer-profile",53),t.k0s(),t.j41(77,"div",58),t.nrm(78,"app-customer-settings",53),t.k0s(),t.j41(79,"div",59),t.nrm(80,"router-outlet"),t.k0s()()()()()()()}2&i&&(t.R7$(4),t.AVh("show",n.isMenuVisible),t.R7$(10),t.Y8G("src",null==n.userCustomer?null:n.userCustomer.avatar,t.B4B)("ngClass",t.eq3(36,Ss,n.isImageLoading)),t.R7$(),t.Y8G("ngIf",n.isImageLoading),t.R7$(2),t.AVh("disabled",n.isUploading),t.R7$(),t.BMQ("disabled",n.isUploading?"":null),t.R7$(2),t.Y8G("ngIf",n.isUploading),t.R7$(3),t.JRh(null==n.userCustomer?null:n.userCustomer.name),t.R7$(2),t.JRh(null==n.userCustomer?null:n.userCustomer.email),t.R7$(3),t.AVh("active","pills-dashboard"===n.activeTab),t.R7$(6),t.AVh("active","pills-order"===n.activeTab),t.R7$(7),t.AVh("active","pills-wishlist"===n.activeTab),t.R7$(5),t.AVh("active","pills-address"===n.activeTab),t.R7$(6),t.AVh("active","pills-profile"===n.activeTab),t.R7$(6),t.AVh("active","pills-security"===n.activeTab),t.R7$(9),t.Y8G("ngClass",t.eq3(38,he,"pills-dashboard"===n.activeTab)),t.R7$(),t.Y8G("userCustomer",n.userCustomer),t.R7$(),t.Y8G("ngClass",t.eq3(40,he,"pills-order"===n.activeTab)),t.R7$(),t.Y8G("userCustomer",n.userCustomer),t.R7$(),t.Y8G("ngClass",t.eq3(42,he,"pills-wishlist"===n.activeTab)),t.R7$(),t.Y8G("userCustomer",n.userCustomer),t.R7$(),t.Y8G("ngClass",t.eq3(44,he,"pills-address"===n.activeTab)),t.R7$(),t.Y8G("userCustomer",n.userCustomer),t.R7$(),t.Y8G("ngClass",t.eq3(46,he,"pills-profile"===n.activeTab)),t.R7$(),t.Y8G("userCustomer",n.userCustomer),t.R7$(),t.Y8G("ngClass",t.eq3(48,he,"pills-security"===n.activeTab)),t.R7$(),t.Y8G("userCustomer",n.userCustomer),t.R7$(),t.Y8G("ngClass",t.eq3(50,he,"pills-profile"===n.activeTab)))},dependencies:[j.D,j.E,j.I,C.h,ae.CustomerDashboardComponent,E,ji,ys,bs,ws,Ms.R,V._B],styles:[".position-relative[_ngcontent-%COMP%]{position:relative}.position-relative[_ngcontent-%COMP%] .update_img[_ngcontent-%COMP%]{width:150px;height:150px;object-fit:cover;border-radius:50%}.position-relative[_ngcontent-%COMP%] .update_img.loading[_ngcontent-%COMP%]{opacity:.6}.position-relative[_ngcontent-%COMP%] .cover-icon[_ngcontent-%COMP%]{position:absolute;bottom:0;right:0;background:#fff;padding:8px;border-radius:50%;cursor:pointer}.position-relative[_ngcontent-%COMP%] .cover-icon[_ngcontent-%COMP%] i.disabled[_ngcontent-%COMP%]{opacity:.5;cursor:not-allowed}.position-relative[_ngcontent-%COMP%] .upload-overlay[_ngcontent-%COMP%]{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background-color:#ffffffb3;border-radius:inherit;z-index:1}.custom-loader[_ngcontent-%COMP%]{width:50px;height:50px;border:5px solid #f3f3f3;border-top:5px solid #3498db;border-radius:50%;animation:_ngcontent-%COMP%_spin 1s linear infinite}@keyframes _ngcontent-%COMP%_spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}"]})}return s})()},7935:(Xe,ge,w)=>{w.d(ge,{F:()=>be});var t=w(4412),V=w(7673),C=w(6354),j=w(980),ae=w(9437),fe=w(8141),ye=w(5312),ie=w(8041),ce=w(8457),H=w(5721);let be=(()=>{class F{http;loginService;apiUrl=ye.c.apiUrl;wishlistItemsSubject=new t.t([]);wishlistItems=[];isLoadingSubject=new t.t(!1);wishlistCountSubject=new t.t(0);wishlistCount$=this.wishlistCountSubject.asObservable();isLoading$=this.isLoadingSubject.asObservable();constructor(M,E){this.http=M,this.loginService=E,this.loginService.getAuthStatus().subscribe(O=>{O?this.loadWishlistItems():(this.wishlistItems=[],this.wishlistItemsSubject.next([]))}),this.loginService.isAuthenticated()&&this.loadWishlistItems()}getWishlistItems(){return this.wishlistItemsSubject.asObservable()}getWishlistCount(){return this.getWishlistItems().pipe((0,C.T)(M=>M.length))}loadWishlistItems(){this.loginService.isAuthenticated()&&(this.isLoadingSubject.next(!0),this.getWishlists().pipe((0,j.j)(()=>this.isLoadingSubject.next(!1))).subscribe({next:M=>{this.wishlistItems=M,this.wishlistItemsSubject.next(this.wishlistItems),localStorage.setItem("wishlistCount",M.length.toString())},error:M=>{console.error("Error cargando items de wishlist:",M)}}))}getWishlists(){const M=localStorage.getItem("authToken");if(!M)return(0,V.of)([]);const E=new ie.b({Authorization:`Bearer ${M}`});return this.http.get(`${this.apiUrl}wishlists`,{headers:E}).pipe((0,C.T)(O=>O&&O.success&&Array.isArray(O.data)?O.data:(console.warn("Invalid API response format:",O),[])),(0,ae.W)(O=>(console.error("Error fetching Wishlists:",O),(0,V.of)([]))))}addToWishlist(M){const E=localStorage.getItem("authToken");if(!E)return(0,V.of)({success:!1,error:"User not authenticated"});const O=new ie.b({Authorization:`Bearer ${E}`,"Content-Type":"application/json"});return this.isLoadingSubject.next(!0),this.http.get(`${this.apiUrl}wishlists-add-product?product_id=${M}`,{headers:O}).pipe((0,fe.M)(P=>{P&&P.success&&(this.loadWishlistItems(),this.updateWishlistCount(this.wishlistItems.length))}),(0,ae.W)(P=>(console.error("Error adding product to wishlist:",P),(0,V.of)({success:!1,error:"Failed to add product to wishlist"}))),(0,j.j)(()=>this.isLoadingSubject.next(!1)))}removeFromWishlist(M){const E=localStorage.getItem("authToken");if(!E)return console.error("No auth token available"),(0,V.of)({success:!1,error:"User not authenticated"});const O=new ie.b({Authorization:`Bearer ${E}`});this.isLoadingSubject.next(!0),this.updateWishlistCount(this.wishlistItems.length);const P=this.wishlistItems.find(X=>X.id===M);return P&&P.product?this.http.get(`${this.apiUrl}wishlists-remove-product?product_id=${P.product.id}`,{headers:O}).pipe((0,fe.M)(X=>{X&&X.success&&(this.wishlistItems=this.wishlistItems.filter(xe=>xe.id!==M),this.wishlistItemsSubject.next(this.wishlistItems),localStorage.setItem("wishlistCount",this.wishlistItems.length.toString()))}),(0,ae.W)(X=>(console.error("Detailed error removing product:",X),X.error&&console.error("Server error details:",X.error),this.isLoadingSubject.next(!1),(0,V.of)({success:!1,error:"Failed to remove product from wishlist"}))),(0,j.j)(()=>{this.isLoadingSubject.next(!1)})):(console.error("Wishlist item not found or missing product data"),this.isLoadingSubject.next(!1),(0,V.of)({success:!1,error:"Wishlist item not found"}))}isInWishlist(M){return this.wishlistItems.some(E=>E.product&&E.product.id===M)}checkIsInWishlist(M){const E=localStorage.getItem("authToken");if(!E)return(0,V.of)(!1);const O=new ie.b({Authorization:`Bearer ${E}`});return this.http.get(`${this.apiUrl}wishlists-check-product?product_id=${M}`,{headers:O}).pipe((0,C.T)(P=>P&&P.success&&P.exists),(0,ae.W)(P=>(console.error("Error checking product in wishlist:",P),(0,V.of)(!1))))}getWishlistItemId(M){const E=this.wishlistItems.find(O=>O.product&&O.product.id===M);return E?E.id:null}toggleWishlistItem(M){if(this.isInWishlist(M)){const E=this.getWishlistItemId(M);if(E)return this.removeFromWishlist(E)}return this.addToWishlist(M)}updateWishlistCount(M){this.wishlistCountSubject.next(M),localStorage.setItem("wishlistCount",M.toString())}static \u0275fac=function(E){return new(E||F)(ce.KVO(ie.a),ce.KVO(H.H))};static \u0275prov=ce.jDH({token:F,factory:F.\u0275fac,providedIn:"root"})}return F})()},9121:(Xe,ge,w)=>{w.d(ge,{X:()=>ce});var t=w(8834),V=w(9417),C=w(8457),j=w(5721),ae=w(99),fe=w(8240);function ye(H,be){if(1&H){const F=C.RV6();C.j41(0,"div",5)(1,"div",6)(2,"button",7),C.nrm(3,"i",8),C.k0s(),C.j41(4,"input",9),C.mxI("ngModelChange",function(M){C.eBV(F);const E=C.XpG();return C.DH7(E.quantity,M)||(E.quantity=M),C.Njj(M)}),C.k0s(),C.j41(5,"button",10),C.nrm(6,"i",11),C.k0s()()()}if(2&H){const F=C.XpG();C.R7$(4),C.R50("ngModel",F.quantity)}}function ie(H,be){if(1&H&&(C.j41(0,"div"),C.EFF(1),C.k0s()),2&H){const F=C.XpG();C.R7$(),C.JRh(F.alertMessage)}}let ce=(()=>{class H{elementRef;loginService;router;cartService;productId;variant;weight;initialQuantity=1;hideCartCounter=!1;isAuthenticated=!1;authSubscription;quantity=this.initialQuantity;alertMessage="";constructor(F,N,M,E){this.elementRef=F,this.loginService=N,this.router=M,this.cartService=E}ngAfterViewInit(){this.initAddToCartAnimation(),this.addDocumentReadyScripts(),this.initializeQuantityButtons(),this.authSubscription=this.loginService.getAuthStatus().subscribe(F=>{this.isAuthenticated=F})}initAddToCartAnimation(){$(".addcart-button").on("click",F=>{if(!this.isAuthenticated)return alert("You need to log in to add items to the cart."),void this.router.navigate(["/login"]);const N=$(window).width();let M;M=void 0!==N&&N>768?$(".button-item"):$(".mobile-cart ul li a .icli.fly-cate");const O=$(F.currentTarget).closest(".product-box-4, .deal-box").find(".product-image img, .category-image img").eq(0);!M||!M.offset()||(O.length&&O.clone().css({opacity:"0.5",position:"absolute",height:"130px",width:"130px","z-index":"100"}).offset({top:O.offset()?.top||0,left:O.offset()?.left||0}).appendTo($("body")).animate({top:(M.offset()?.top||0)+10,left:(M.offset()?.left||0)+10,width:75,height:75},1e3,"easeInOutExpo").animate({width:0,height:0},()=>{$(this).detach()}),setTimeout(()=>{$(".item-section").addClass("active")},1500),setTimeout(()=>{$(".item-section").removeClass("active")},5e3))})}addDocumentReadyScripts(){$(document).ready(function(){$(".button-item").on("click",function(){$(".item-section").addClass("active")}),$(".close-button").on("click",function(){$(".item-section").removeClass("active")}),$(".btn-cart").on("click",function(){setTimeout(function(){$(".item-section").addClass("active")},1500),setTimeout(function(){$(".item-section").removeClass("active")},5e3)})})}initializeQuantityButtons(){const F=this.elementRef.nativeElement;F.querySelectorAll(".qty-right-plus").forEach(E=>{E.addEventListener("click",()=>{if(!this.isAuthenticated)return;const O=E.previousElementSibling;if(O){const P=parseInt(O.value,10)||0;P<9&&(O.value=(P+1).toString())}})}),F.querySelectorAll(".qty-left-minus").forEach(E=>{E.addEventListener("click",()=>{if(!this.isAuthenticated)return;const O=E.nextElementSibling;if(O){const P=parseInt(O.value,10)||0;P>1&&(O.value=(P-1).toString())}})})}handleAddToCartClick(){if(!this.isAuthenticated)return this.alertMessage="You need to log in to add items to the cart.",void this.router.navigate(["/login"]);const F={id:this.productId,weight:this.weight,variant:this.variant,quantity:this.quantity.toString()};this.cartService.addToCart(F).subscribe({next:N=>{this.alertMessage="Item added to cart successfully"},error:N=>{this.alertMessage=`Error while adding item to cart: ${N}`}})}increaseQuantity(){this.quantity<9&&this.quantity++}decreaseQuantity(){this.quantity>1&&this.quantity--}ngOnDestroy(){this.authSubscription&&this.authSubscription.unsubscribe()}static \u0275fac=function(N){return new(N||H)(C.rXU(C.aKT),C.rXU(j.H),C.rXU(ae.t),C.rXU(fe.m))};static \u0275cmp=C.VBU({type:H,selectors:[["app-cart-button-icon"]],inputs:{productId:"productId",variant:"variant",weight:"weight",initialQuantity:"initialQuantity",hideCartCounter:"hideCartCounter"},decls:6,vars:2,consts:[[1,"price-qty"],["class","counter-number",4,"ngIf"],[1,"buy-button","buy-box","buy-button-2","btn","btn-cart","addcart-button",2,"background-color","#e63118",3,"click"],[1,"iconly-Buy","icli","text-white","m-0"],[4,"ngIf"],[1,"counter-number"],[1,"counter"],["title","Login required to adjust quantity",1,"qty-left-minus"],[1,"fa-solid","fa-minus"],["type","text","name","quantity","value","1","title","Login required to adjust quantity",1,"form-control","input-number","qty-input",3,"ngModelChange","ngModel"],["title","Login required to adjust quantity",1,"qty-right-plus"],[1,"fa-solid","fa-plus"]],template:function(N,M){1&N&&(C.j41(0,"div",0),C.DNE(1,ye,7,1,"div",1),C.j41(2,"button",2),C.bIt("click",function(){return M.handleAddToCartClick()}),C.nrm(3,"i",3),C.k0s(),C.nrm(4,"br"),C.DNE(5,ie,2,1,"div",4),C.k0s()),2&N&&(C.R7$(),C.Y8G("ngIf",!M.hideCartCounter),C.R7$(4),C.Y8G("ngIf",!M.alertMessage))},dependencies:[t.D,t.I,V.YN,V.me,V.BC,V.vS],styles:[".qty-right-plus[_ngcontent-%COMP%], .qty-left-minus[_ngcontent-%COMP%]{background:#fafafa!important}"]})}return H})()}}]); |