import './polyfills.server.mjs';
import{a as T}from"./chunk-Q4ZNTDLA.mjs";import{E as g,H as k,Oa as S,T as I,Y as y,_,aa as x,db as b,n as f,o as v,ra as u,sa as m,ta as h,wa as w,y as p,ya as d,z as C}from"./chunk-I24PFG4Z.mjs";import{a,b as c}from"./chunk-N7QBYMCK.mjs";var E=class o{checkouts=g([]);addItem(t){let e=this.checkouts();this.checkouts.set([t])}removeItem(t){let e=this.checkouts().filter(n=>n.ticket.uuid!==t.ticket.uuid);this.checkouts.set(e)}incrementItem(t){let e=this.checkouts(),n=e.findIndex(i=>i.ticket.uuid===t.ticket.uuid);if(n!==-1){let i=c(a({},e[n]),{quantity:e[n].quantity+1}),r=[...e];r[n]=i,this.checkouts.set(r)}else this.checkouts.set([...e,c(a({},t),{quantity:1})])}decrementItem(t){let e=this.checkouts(),n=e.findIndex(i=>i.ticket.uuid===t.ticket.uuid);if(n!==-1){let i=e[n];if(i.quantity>1){let r=c(a({},i),{quantity:i.quantity-1}),s=[...e];s[n]=r,this.checkouts.set(s)}else{let r=e.filter(s=>s.ticket.uuid!==t.ticket.uuid);this.checkouts.set(r)}}}static \u0275fac=function(e){return new(e||o)};static \u0275prov=v({token:o,factory:o.\u0275fac,providedIn:"root"})};var l=class o{value;disabled=!1;onChange=()=>{};onTouched=()=>{};formControl;writeValue(t){this.value=t}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.disabled=t}markedAsTouched(){this.onTouched()}get isInvalid(){return this.formControl()?.invalid&&(this.formControl()?.dirty||this.formControl()?.touched)}static \u0275fac=function(e){return new(e||o)};static \u0275dir=_({type:o})};var M=class o extends l{min=b(-1/0);max=b(1/0);increment(){this.value!==this.max()&&(this.value++,this.onChange(this.value))}decrement(){this.value!==this.min()&&(this.value--,this.onChange(this.value))}onInput(t){let e=+t.target.value;isNaN(e)||(this.value=e,this.onChange(this.value))}static \u0275fac=(()=>{let t;return function(n){return(t||(t=k(o)))(n||o)}})();static \u0275cmp=y({type:o,selectors:[["app-custom-number-input"]],inputs:{min:[1,"min"],max:[1,"max"]},features:[S([{provide:T,useExisting:f(()=>o),multi:!0}]),x],decls:11,vars:2,consts:[[1,"input-container","bg-transparent","p-4","max-w-22","w-fit","h-[56px]","border","border-[#FFC3C3]","rounded-lg","overflow-hidden","flex","gap-4","justify-between","items-center"],["type","number","id","",1,"w-full","h-full","!font-['Montserrat']","bg-transparent","focus:outline-none",3,"input","blur","value","disabled"],[1,"controllers","flex","flex-col","gap-2"],[1,"up","h-[17px]"],[1,"cursor-pointer",3,"click"],["width","17","height","17","viewBox","0 0 17 17","fill","none","xmlns","http://www.w3.org/2000/svg"],["d","M15.6399 11.56L10.2541 6.17421C9.47306 5.39316 8.20673 5.39316 7.42568 6.17421L2.03989 11.56","stroke","#020B26","stroke-linecap","round"],[1,"down","h-[17px]"],["d","M2.04004 4.75999L7.42582 10.1458C8.20687 10.9268 9.4732 10.9268 10.2543 10.1458L15.64 4.75999","stroke","#020B26","stroke-linecap","round"]],template:function(e,n){e&1&&(u(0,"div",0)(1,"input",1),d("input",function(r){return n.onInput(r)})("blur",function(){return n.markedAsTouched()}),m(),u(2,"div",2)(3,"div",3)(4,"button",4),d("click",function(){return n.increment()}),p(),u(5,"svg",5),h(6,"path",6),m()()(),C(),u(7,"div",7)(8,"button",4),d("click",function(){return n.decrement()}),p(),u(9,"svg",5),h(10,"path",8),m()()()()()),e&2&&(I(),w("value",n.value)("disabled",n.disabled))},styles:["input[type=number][_ngcontent-%COMP%]::-webkit-inner-spin-button, input[type=number][_ngcontent-%COMP%]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[type=number][_ngcontent-%COMP%]{-moz-appearance:textfield}"]})};export{E as a,M as b};
