vendor: 8,641 bytes, line 1
1import{$ as Ve,$a as bT,$b as CT,Ab as ia,Ba as Yo,D as ch,Ea as na,Eb as MT,Fb as NT,G as tT,Ha as Ys,Hb as PT,I as nT,Ib as gh,J as iT,Ja as hT,Ka as fh,L as sT,La as fT,Ma as $s,Mc as zo,Nc as Uo,Oa as $o,P as rT,Pa as pT,S as aT,Sa as Lo,T as oT,Ta as zi,Ua as Ls,Uc as kT,V as Li,Va as gT,Vc as _T,W as uT,Wa as mT,Wb as AT,Wc as zs,Xa as IT,Xc as xT,Y as cT,Ya as DT,Yc as FT,Za as vT,Zc as qT,_a as yT,a as _e,aa as qs,ab as Ui,b as pn,bb as ET,ca as be,cd as YT,d as xo,da as Vi,e as Yt,f as Bt,fa as Ce,ga as ge,ha as ce,i as Fs,ia as an,ib as Bi,j as Fo,ja as lT,jb as wT,k as QS,ka as lh,kb as Vo,la as dh,lb as ph,nb as Ii,o as oh,ob as ST,pb as Vs,qa as Hn,qb as nt,r as uh,ra as Qe,s as Bn,sa as gn,sb as Gn,tb as TT,va as ta,vb as OT,wa as hh,x as rn,xa as dT,xb as RT,y as eT,yb as Hi,za as qo,zb as Ht}from"./chunk-7FUTW2B6.js";var Lh=Yt((Yh,$h)=>{"use strict";(function(n,i){typeof Yh=="object"&&typeof $h<"u"?$h.exports=i():typeof define=="function"&&define.amd?define(i):(n=typeof globalThis<"u"?globalThis:n||self).dayjs=i()})(Yh,function(){"use strict";var n=1e3,i=6e4,e=36e5,t="millisecond",s="second",a="minute",o="hour",u="day",c="week",l="month",h="quarter",p="year",I="date",v="Invalid Date",E=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,w=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,S={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(q){var L=["th","st","nd","rd"],J=q%100;return"["+q+(L[(J-20)%10]||L[J]||L[0])+"]"}},R=function(q,L,J){var ne=String(q);return!ne||ne.length>=L?q:""+Array(L+1-ne.length).join(J)+q},x={s:R,z:function(q){var L=-q.utcOffset(),J=Math.abs(L),ne=Math.floor(J/60),Q=J%60;return(L<=0?"+":"-")+R(ne,2,"0")+":"+R(Q,2,"0")},m:function q(L,J){if(L.date()<J.date())return-q(J,L);var ne=12*(J.year()-L.year())+(J.month()-L.month()),Q=L.clone().add(ne,l),ve=J-Q<0,ye=L.clone().add(ne+(ve?-1:1),l);return+(-(ne+(J-Q)/(ve?Q-ye:ye-Q))||0)},a:function(q){return q<0?Math.ceil(q)||0:Math.floor(q)},p:function(q){return{M:l,y:p,w:c,d:u,D:I,h:o,m:a,s,ms:t,Q:h}[q]||String(q||"").toLowerCase().replace(/s$/,"")},u:function(q){return q===void 0}},N="en",O={};O[N]=S;var A="$isDayjsObject",M=function(q){return q instanceof U||!(!q||!q[A])},C=function q(L,J,ne){var Q;if(!L)return N;if(typeof L=="string"){var ve=L.toLowerCase();O[ve]&&(Q=ve),J&&(O[ve]=J,Q=ve);var ye=L.split("-");if(!Q&&ye.length>1)return q(ye[0])}else{var Ne=L.name;O[Ne]=L,Q=Ne}return!ne&&Q&&(N=Q),Q||!ne&&N},H=function(q,L){if(M(q))return q.clone();var J=typeof L=="object"?L:{};return J.date=q,J.args=arguments,new U(J)},B=x;B.l=C,B.i=M,B.w=function(q,L){return H(q,{locale:L.$L,utc:L.$u,x:L.$x,$offset:L.$offset})};var U=(function(){function q(J){this.$L=C(J.locale,null,!0),this.parse(J),this.$x=this.$x||J.x||{},this[A]=!0}var L=q.prototype;return L.parse=function(J){this.$d=(function(ne){var Q=ne.date,ve=ne.utc;if(Q===null)return new Date(NaN);if(B.u(Q))return new Date;if(Q instanceof Date)return new Date(Q);if(typeof Q=="string"&&!/Z$/i.test(Q)){var ye=Q.match(E);if(ye){var Ne=ye[2]-1||0,Ge=(ye[7]||"0").substring(0,3);return ve?new Date(Date.UTC(ye[1],Ne,ye[3]||1,ye[4]||0,ye[5]||0,ye[6]||0,Ge)):new Date(ye[1],Ne,ye[3]||1,ye[4]||0,ye[5]||0,ye[6]||0,Ge)}}return new Date(Q)})(J),this.init()},L.init=function(){var J=this.$d;this.$y=J.getFullYear(),this.$M=J.getMonth(),this.$D=J.getDate(),this.$W=J.getDay(),this.$H=J.getHours(),this.$m=J.getMinutes(),this.$s=J.getSeconds(),this.$ms=J.getMilliseconds()},L.$utils=function(){return B},L.isValid=function(){return this.$d.toString()!==v},L.isSame=function(J,ne){var Q=H(J);return this.startOf(ne)<=Q&&Q<=this.endOf(ne)},L.isAfter=function(J,ne){return H(J)<this.startOf(ne)},L.isBefore=function(J,ne){return this.endOf(ne)<H(J)},L.$g=function(J,ne,Q){return B.u(J)?this[ne]:this.set(Q,J)},L.unix=function(){return Math.floor(this.valueOf()/1e3)},L.valueOf=function(){return this.$d.getTime()},L.startOf=function(J,ne){var Q=this,ve=!!B.u(ne)||ne,ye=B.p(J),Ne=function($i,At){var mi=B.w(Q.$u?Date.UTC(Q.$y,At,$i):new Date(Q.$y,At,$i),Q);return ve?mi:mi.endOf(u)},Ge=function($i,At){return B.w(Q.toDate()[$i].apply(Q.toDate("s"),(ve?[0,0,0,0]:[23,59,59,999]).slice(At)),Q)},pt=this.$W,Tt=this.$M,Ut=this.$D,xs="set"+(this.$u?"UTC":"");switch(ye){case p:return ve?Ne(1,0):Ne(31,11);case l:return ve?Ne(1,Tt):Ne(0,Tt+1);case c:var Yi=this.$locale().weekStart||0,Qr=(pt<Yi?pt+7:pt)-Yi;return Ne(ve?Ut-Qr:Ut+(6-Qr),Tt);case u:case I:return Ge(xs+"Hours",0);case o:return Ge(xs+"Minutes",1);case a:return Ge(xs+"Seconds",2);case s:return Ge(xs+"Milliseconds",3);default:return this.clone()}},L.endOf=function(J){return this.startOf(J,!1)},L.$set=function(J,ne){var Q,ve=B.p(J),ye="set"+(this.$u?"UTC":""),Ne=(Q={},Q[u]=ye+"Date",Q[I]=ye+"Date",Q[l]=ye+"Month",Q[p]=ye+"FullYear",Q[o]=ye+"Hours",Q[a]=ye+"Minutes",Q[s]=ye+"Seconds",Q[t]=ye+"Milliseconds",Q)[ve],Ge=ve===u?this.$D+(ne-this.$W):ne;if(ve===l||ve===p){var pt=this.clone().set(I,1);pt.$d[Ne](Ge),pt.init(),this.$d=pt.set(I,Math.min(this.$D,pt.daysInMonth())).$d}else Ne&&this.$d[Ne](Ge);return this.init(),this},L.set=function(J,ne){return this.clone().$set(J,ne)},L.get=function(J){return this[B.p(J)]()},L.add=function(J,ne){var Q,ve=this;J=Number(J);var ye=B.p(ne),Ne=function(Tt){var Ut=H(ve);return B.w(Ut.date(Ut.date()+Math.round(Tt*J)),ve)};if(ye===l)return this.set(l,this.$M+J);if(ye===p)return this.set(p,this.$y+J);if(ye===u)return Ne(1);if(ye===c)return Ne(7);var Ge=(Q={},Q[a]=i,Q[o]=e,Q[s]=n,Q)[ye]||1,pt=this.$d.getTime()+J*Ge;return B.w(pt,this)},L.subtract=function(J,ne){return this.add(-1*J,ne)},L.format=function(J){var ne=this,Q=this.$locale();if(!this.isValid())return Q.invalidDate||v;var ve=J||"YYYY-MM-DDTHH:mm:ssZ",ye=B.z(this),Ne=this.$H,Ge=this.$m,pt=this.$M,Tt=Q.weekdays,Ut=Q.months,xs=Q.meridiem,Yi=function(At,mi,ea,_o){return At&&(At[mi]||At(ne,ve))||ea[mi].slice(0,_o)},Qr=function(At){return B.s(Ne%12||12,At,"0")},$i=xs||function(At,mi,ea){var _o=At<12?"AM":"PM";return ea?_o.toLowerCase():_o};return ve.replace(w,function(At,mi){return mi||(function(ea){switch(ea){case"YY":return String(ne.$y).slice(-2);case"YYYY":return B.s(ne.$y,4,"0");case"M":return pt+1;case"MM":return B.s(pt+1,2,"0");case"MMM":return Yi(Q.monthsShort,pt,Ut,3);case"MMMM":return Yi(Ut,pt);case"D":return ne.$D;case"DD":return B.s(ne.$D,2,"0");case"d":return String(ne.$W);case"dd":return Yi(Q.weekdaysMin,ne.$W,Tt,2);case"ddd":return Yi(Q.weekdaysShort,ne.$W,Tt,3);case"dddd":return Tt[ne.$W];case"H":return String(Ne);case"HH":return B.s(Ne,2,"0");case"h":return Qr(1);case"hh":return Qr(2);case"a":return $i(Ne,Ge,!0);case"A":return $i(Ne,Ge,!1);case"m":return String(Ge);case"mm":return B.s(Ge,2,"0");case"s":return String(ne.$s);case"ss":return B.s(ne.$s,2,"0");case"SSS":return B.s(ne.$ms,3,"0");case"Z":return ye}return null})(At)||ye.replace(":","")})},L.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},L.diff=function(J,ne,Q){var ve,ye=this,Ne=B.p(ne),Ge=H(J),pt=(Ge.utcOffset()-this.utcOffset())*i,Tt=this-Ge,Ut=function(){return B.m(ye,Ge)};switch(Ne){case p:ve=Ut()/12;break;case l:ve=Ut();break;case h:ve=Ut()/3;break;case c:ve=(Tt-pt)/6048e5;break;case u:ve=(Tt-pt)/864e5;break;case o:ve=Tt/e;break;case a:ve=Tt/i;break;case s:ve=Tt/n;break;default:ve=Tt}return Q?ve:B.a(ve)},L.daysInMonth=function(){return this.endOf(l).$D},L.$locale=function(){return O[this.$L]},L.locale=function(J,ne){if(!J)return this.$L;var Q=this.clone(),ve=C(J,ne,!0);return ve&&(Q.$L=ve),Q},L.clone=function(){return B.w(this.$d,this)},L.toDate=function(){return new Date(this.valueOf())},L.toJSON=function(){return this.isValid()?this.toISOString():null},L.toISOString=function(){return this.$d.toISOString()},L.toString=function(){return this.$d.toUTCString()},q})(),V=U.prototype;return H.prototype=V,[["$ms",t],["$s",s],["$m",a],["$H",o],["$W",u],["$M",l],["$y",p],["$D",I]].forEach(function(q){V[q[1]]=function(L){return this.$g(L,q[0],q[1])}}),H.extend=function(q,L){return q.$i||(q(L,U,H),q.$i=!0),H},H.locale=C,H.isDayjs=M,H.unix=function(q){return H(1e3*q)},H.en=O[N],H.Ls=O,H.p={},H})});var $O=Yt((Qh,ef)=>{"use strict";(function(n,i){typeof Qh=="object"&&typeof ef<"u"?ef.exports=i():typeof define=="function"&&define.amd?define(i):(n=typeof globalThis<"u"?globalThis:n||self).dayjs_plugin_duration=i()})(Qh,function(){"use strict";var n,i,e=1e3,t=6e4,s=36e5,a=864e5,o=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}
vendor: 5,779 bytes, line 1
1|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,u=31536e6,c=2628e6,l=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,h={years:u,months:c,days:a,hours:s,minutes:t,seconds:e,milliseconds:1,weeks:6048e5},p=function(O){return O instanceof x},I=function(O,A,M){return new x(O,M,A.$l)},v=function(O){return i.p(O)+"s"},E=function(O){return O<0},w=function(O){return E(O)?Math.ceil(O):Math.floor(O)},S=function(O){return Math.abs(O)},R=function(O,A){return O?E(O)?{negative:!0,format:""+S(O)+A}:{negative:!1,format:""+O+A}:{negative:!1,format:""}},x=(function(){function O(M,C,H){var B=this;if(this.$d={},this.$l=H,M===void 0&&(this.$ms=0,this.parseFromMilliseconds()),C)return I(M*h[v(C)],this);if(typeof M=="number")return this.$ms=M,this.parseFromMilliseconds(),this;if(typeof M=="object")return Object.keys(M).forEach(function(q){B.$d[v(q)]=M[q]}),this.calMilliseconds(),this;if(typeof M=="string"){var U=M.match(l);if(U){var V=U.slice(2).map(function(q){return q!=null?Number(q):0});return this.$d.years=V[0],this.$d.months=V[1],this.$d.weeks=V[2],this.$d.days=V[3],this.$d.hours=V[4],this.$d.minutes=V[5],this.$d.seconds=V[6],this.calMilliseconds(),this}}return this}var A=O.prototype;return A.calMilliseconds=function(){var M=this;this.$ms=Object.keys(this.$d).reduce(function(C,H){return C+(M.$d[H]||0)*h[H]},0)},A.parseFromMilliseconds=function(){var M=this.$ms;this.$d.years=w(M/u),M%=u,this.$d.months=w(M/c),M%=c,this.$d.days=w(M/a),M%=a,this.$d.hours=w(M/s),M%=s,this.$d.minutes=w(M/t),M%=t,this.$d.seconds=w(M/e),M%=e,this.$d.milliseconds=M},A.toISOString=function(){var M=R(this.$d.years,"Y"),C=R(this.$d.months,"M"),H=+this.$d.days||0;this.$d.weeks&&(H+=7*this.$d.weeks);var B=R(H,"D"),U=R(this.$d.hours,"H"),V=R(this.$d.minutes,"M"),q=this.$d.seconds||0;this.$d.milliseconds&&(q+=this.$d.milliseconds/1e3,q=Math.round(1e3*q)/1e3);var L=R(q,"S"),J=M.negative||C.negative||B.negative||U.negative||V.negative||L.negative,ne=U.format||V.format||L.format?"T":"",Q=(J?"-":"")+"P"+M.format+C.format+B.format+ne+U.format+V.format+L.format;return Q==="P"||Q==="-P"?"P0D":Q},A.toJSON=function(){return this.toISOString()},A.format=function(M){var C=M||"YYYY-MM-DDTHH:mm:ss",H={Y:this.$d.years,YY:i.s(this.$d.years,2,"0"),YYYY:i.s(this.$d.years,4,"0"),M:this.$d.months,MM:i.s(this.$d.months,2,"0"),D:this.$d.days,DD:i.s(this.$d.days,2,"0"),H:this.$d.hours,HH:i.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:i.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:i.s(this.$d.seconds,2,"0"),SSS:i.s(this.$d.milliseconds,3,"0")};return C.replace(o,function(B,U){return U||String(H[B])})},A.as=function(M){return this.$ms/h[v(M)]},A.get=function(M){var C=this.$ms,H=v(M);return H==="milliseconds"?C%=1e3:C=H==="weeks"?w(C/h[H]):this.$d[H],C||0},A.add=function(M,C,H){var B;return B=C?M*h[v(C)]:p(M)?M.$ms:I(M,this).$ms,I(this.$ms+B*(H?-1:1),this)},A.subtract=function(M,C){return this.add(M,C,!0)},A.locale=function(M){var C=this.clone();return C.$l=M,C},A.clone=function(){return I(this.$ms,this)},A.humanize=function(M){return n().add(this.$ms,"ms").locale(this.$l).fromNow(!M)},A.valueOf=function(){return this.asMilliseconds()},A.milliseconds=function(){return this.get("milliseconds")},A.asMilliseconds=function(){return this.as("milliseconds")},A.seconds=function(){return this.get("seconds")},A.asSeconds=function(){return this.as("seconds")},A.minutes=function(){return this.get("minutes")},A.asMinutes=function(){return this.as("minutes")},A.hours=function(){return this.get("hours")},A.asHours=function(){return this.as("hours")},A.days=function(){return this.get("days")},A.asDays=function(){return this.as("days")},A.weeks=function(){return this.get("weeks")},A.asWeeks=function(){return this.as("weeks")},A.months=function(){return this.get("months")},A.asMonths=function(){return this.as("months")},A.years=function(){return this.get("years")},A.asYears=function(){return this.as("years")},O})(),N=function(O,A,M){return O.add(A.years()*M,"y").add(A.months()*M,"M").add(A.days()*M,"d").add(A.hours()*M,"h").add(A.minutes()*M,"m").add(A.seconds()*M,"s").add(A.milliseconds()*M,"ms")};return function(O,A,M){n=M,i=M().$utils(),M.duration=function(B,U){var V=M.locale();return I(B,{$l:V},U)},M.isDuration=p;var C=A.prototype.add,H=A.prototype.subtract;A.prototype.add=function(B,U){return p(B)?N(this,B,1):C.bind(this)(B,U)},A.prototype.subtract=function(B,U){return p(B)?N(this,B,-1):H.bind(this)(B,U)}}})});var sf=Yt((tf,nf)=>{"use strict";(function(n,i){typeof tf=="object"&&typeof nf<"u"?nf.exports=i():typeof define=="function"&&define.amd?define(i):(n=typeof globalThis<"u"?globalThis:n||self).dayjs_plugin_utc=i()})(tf,function(){"use strict";var n="minute",i=/[+-]\d\d(?::?\d\d)?/g,e=/([+-]|\d\d)/g;return function(t,s,a){var o=s.prototype;a.utc=function(v){var E={date:v,utc:!0,args:arguments};return new s(E)},o.utc=function(v){var E=a(this.toDate(),{locale:this.$L,utc:!0});return v?E.add(this.utcOffset(),n):E},o.local=function(){return a(this.toDate(),{locale:this.$L,utc:!1})};var u=o.parse;o.parse=function(v){v.utc&&(this.$u=!0),this.$utils().u(v.$offset)||(this.$offset=v.$offset),u.call(this,v)};var c=o.init;o.init=function(){if(this.$u){var v=this.$d;this.$y=v.getUTCFullYear(),this.$M=v.getUTCMonth(),this.$D=v.getUTCDate(),this.$W=v.getUTCDay(),this.$H=v.getUTCHours(),this.$m=v.getUTCMinutes(),this.$s=v.getUTCSeconds(),this.$ms=v.getUTCMilliseconds()}else c.call(this)};var l=o.utcOffset;o.utcOffset=function(v,E){var w=this.$utils().u;if(w(v))return this.$u?0:w(this.$offset)?l.call(this):this.$offset;if(typeof v=="string"&&(v=(function(N){N===void 0&&(N="");var O=N.match(i);if(!O)return null;var A=(""+O[0]).match(e)||["-",0,0],M=A[0],C=60*+A[1]+ +A[2];
1return C===0?0:M==="+"?C:-C})(v),v===null))return this;var S=Math.abs(v)<=16?60*v:v;if(S===0)return this.utc(E);var R=this.clone();if(E)return R.$offset=S,R.$u=!1,R;var x=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(R=this.local().add(S+x,n)).$offset=S,R.$x.$localOffset=x,R};var h=o.format;o.format=function(v){var E=v||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return h.call(this,E)},o.valueOf=function(){var v=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*v},o.isUTC=function(){return!!this.$u},o.toISOString=function(){return this.toDate().toISOString()},o.toString=function(){return this.toDate().toUTCString()};var p=o.toDate;o.toDate=function(v){return v==="s"&&this.$offset?a(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():p.call(this)};var I=o.diff;o.diff=function(v,E,w){if(v&&this.$u===v.$u)return I.call(this,v,E,w);var S=this.local(),R=a(v).local();return I.call(S,R,E,w)}}})});var of=Yt((rf,af)=>{"use strict";(function(n,i){typeof rf=="object"&&typeof af<"u"?af.exports=i():typeof define=="function"&&define.amd?define(i):(n=typeof globalThis<"u"?globalThis:n||self).dayjs_plugin_timezone=i()})(rf,function(){"use strict";var n={year:0,month:1,day:2,hour:3,minute:4,second:5},i={};return function(e,t,s){var a,o=function(h,p,I){I===void 0&&(I={});var v=new Date(h),E=(function(w,S){S===void 0&&(S={});var R=S.timeZoneName||"short",x=w+"|"+R,N=i[x];return N||(N=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:w,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:R}),i[x]=N),N})(p,I);return E.formatToParts(v)},u=function(h,p){for(var I=o(h,p),v=[],E=0;E<I.length;E+=1){var w=I[E],S=w.type,R=w.value,x=n[S];x>=0&&(v[x]=parseInt(R,10))}var N=v[3],O=N===24?0:N,A=v[0]+"-"+v[1]+"-"+v[2]+" "+O+":"+v[4]+":"+v[5]+":000",M=+h;return(s.utc(A).valueOf()-(M-=M%1e3))/6e4},c=t.prototype;c.tz=function(h,p){h===void 0&&(h=a);var I,v=this.utcOffset(),E=this.toDate(),w=E.toLocaleString("en-US",{timeZone:h}),S=Math.round((E-new Date(w))/1e3/60),R=15*-Math.round(E.getTimezoneOffset()/15)-S;if(!Number(R))I=this.utcOffset(0,p);else if(I=s(w,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(R,!0),p){var x=I.utcOffset();I=I.add(v-x,"minute")}return I.$x.$timezone=h,I},c.offsetName=function(h){var p=this.$x.$timezone||s.tz.guess(),I=o(this.valueOf(),p,{timeZoneName:h}).find(function(v){return v.type.toLowerCase()==="timezonename"});return I&&I.value};var l=c.startOf;c.startOf=function(h,p){if(!this.$x||!this.$x.$timezone)return l.call(this,h,p);var I=s(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return l.call(I,h,p).tz(this.$x.$timezone,!0)},s.tz=function(h,p,I){var v=I&&p,E=I||p||a,w=u(+s(),E);if(typeof h!="string")return s(h).tz(E);var S=(function(O,A,M){var C=O-60*A*1e3,H=u(C,M);
1if(A===H)return[C,A];var B=u(C-=60*(H-A)*1e3,M);return H===B?[C,H]:[O-60*Math.min(H,B)*1e3,Math.max(H,B)]})(s.utc(h,v).valueOf(),w,E),R=S[0],x=S[1],N=s(R).utcOffset(x);return N.$x.$timezone=E,N},s.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},s.tz.setDefault=function(h){a=h}}})});var LO=Yt((uf,cf)=>{"use strict";(function(n,i){typeof uf=="object"&&typeof cf<"u"?cf.exports=i():typeof define=="function"&&define.amd?define(i):(n=typeof globalThis<"u"?globalThis:n||self).dayjs_plugin_isSameOrAfter=i()})(uf,function(){"use strict";return function(n,i){i.prototype.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)}}})});var VO=Yt((lf,df)=>{"use strict";(function(n,i){typeof lf=="object"&&typeof df<"u"?df.exports=i():typeof define=="function"&&define.amd?define(i):(n=typeof globalThis<"u"?globalThis:n||self).dayjs_plugin_isSameOrBefore=i()})(lf,function(){"use strict";return function(n,i){i.prototype.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)}}})});var zO=Yt(hu=>{"use strict";hu.remove=C_;var du=[{base:" ",chars:"\xA0"},{base:"0",chars:"\u07C0"},{base:"A",chars:"\u24B6\uFF21\xC0\xC1\xC2\u1EA6\u1EA4\u1EAA\u1EA8\xC3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\xC4\u01DE\u1EA2\xC5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F"},{base:"AA",chars:"\uA732"},{base:"AE",chars:"\xC6\u01FC\u01E2"},{base:"AO",chars:"\uA734"},{base:"AU",chars:"\uA736"},{base:"AV",chars:"\uA738\uA73A"},{base:"AY",chars:"\uA73C"},{base:"B",chars:"\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0181"},{base:"C",chars:"\u24B8\uFF23\uA73E\u1E08\u0106C\u0108\u010A\u010C\xC7\u0187\u023B"},{base:"D",chars:"\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018A\u0189\u1D05\uA779"},{base:"Dh",chars:"\xD0"},{base:"DZ",chars:"\u01F1\u01C4"},{base:"Dz",chars:"\u01F2\u01C5"},{base:"E",chars:"\u025B\u24BA\uFF25\xC8\xC9\xCA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\xCB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E\u1D07"},{base:"F",chars:"\uA77C\u24BB\uFF26\u1E1E\u0191\uA77B"},{base:"G",chars:"\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E\u0262"},{base:"H",chars:"\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D"},{base:"I",chars:"\u24BE\uFF29\xCC\xCD\xCE\u0128\u012A\u012C\u0130\xCF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197"},{base:"J",chars:"\u24BF\uFF2A\u0134\u0248\u0237"},{base:"K",chars:"\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2"},{base:"L",chars:"\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780"},{base:"LJ",chars:"\u01C7"},{base:"Lj",chars:"\u01C8"},{base:"M",chars:"\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C\u03FB"},{base:"N",chars:"\uA7A4\u0220\u24C3\uFF2E\u01F8\u0143\xD1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u019D\uA790\u1D0E"},{base:"NJ",chars:"\u01CA"},{base:"Nj",chars:"\u01CB"},{base:"O",chars:"\u24C4\uFF2F\xD2\xD3\xD4\u1ED2\u1ED0\u1ED6\u1ED4\xD5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\xD6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\xD8\u01FE\u0186\u019F\uA74A\uA74C"},{base:"OE",chars:"\u0152"},{base:"OI",chars:"\u01A2"},{base:"OO",chars:"\uA74E"},{base:"OU",chars:"\u0222"},{base:"P",chars:"\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754"},{base:"Q",chars:"\u24C6\uFF31\uA756\uA758\u024A"},{base:"R",chars:"\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782"},{base:"S",chars:"\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784"},{base:"T",chars:"\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786"},{base:"Th",chars:"\xDE"},{base:"TZ",chars:"\uA728"},{base:"U",chars:"\u24CA\uFF35\xD9\xDA\xDB\u0168\u1E78\u016A\u1E7A\u016C\xDC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244"},{base:"V",chars:"\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245"},{base:"VY",chars:"\uA760"},{base:"W",chars:"\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72"},{base:"X",chars:"\u24CD\uFF38\u1E8A\u1E8C"},{base:"Y",chars:"\u24CE\uFF39\u1EF2\xDD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE"},{base:"Z",chars:"\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762"},{base:"a",chars:"\u24D0\uFF41\u1E9A\xE0\xE1\xE2\u1EA7\u1EA5\u1EAB\u1EA9\xE3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\xE4\u01DF\u1EA3\xE5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250\u0251"},{base:"aa",chars:"\uA733"},{base:"ae",chars:"\xE6\u01FD\u01E3"},{base:"ao",chars:"\uA735"},{base:"au",chars:"\uA737"},{base:"av",chars:"\uA739\uA73B"},{base:"ay",chars:"\uA73D"},{base:"b",chars:"\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253\u0182"},{base:"c",chars:"\uFF43\u24D2\u0107\u0109\u010B\u010D\xE7\u1E09\u0188\u023C\uA73F\u2184"},{base:"d",chars:"\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\u018B\u13E7\u0501\uA7AA"},{base:"dh",chars:"\xF0"},{base:"dz",chars:"\u01F3\u01C6"},{base:"e",chars:"\u24D4\uFF45\xE8\xE9\xEA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\xEB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u01DD"},{base:"f",chars:"\u24D5\uFF46\u1E1F\u0192"},{base:"ff",chars:"\uFB00"},{base:"fi",chars:"\uFB01"},{base:"fl",chars:"\uFB02"},{base:"ffi",chars:"\uFB03"},{base:"ffl",chars:"\uFB04"},{base:"g",chars:"\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\uA77F\u1D79"},{base:"h",chars:"\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265"},{base:"hv",chars:"\u0195"},{base:"i",chars:"\u24D8\uFF49\xEC\xED\xEE\u0129\u012B\u012D\xEF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131"},{base:"j",chars:"\u24D9\uFF4A\u0135\u01F0\u0249"},{base:"k",chars:"\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3"},{base:"l",chars:"\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747\u026D"},{base:"lj",chars:"\u01C9"},{base:"m",chars:"\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F"},{base:"n",chars:"\u24DD\uFF4E\u01F9\u0144\xF1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5\u043B\u0509"},{base:"nj",chars:"\u01CC"},{base:"o",chars:"\u24DE\uFF4F\xF2\xF3\xF4\u1ED3\u1ED1\u1ED7\u1ED5\xF5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\xF6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\xF8\u01FF\uA74B\uA74D\u0275\u0254\u1D11"},{base:"oe",chars:"\u0153"},{base:"oi",chars:"\u01A3"},{base:"oo",chars:"\uA74F"},{base:"ou",chars:"\u0223"},{base:"p",chars:"\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755\u03C1"},{base:"q",chars:"\u24E0\uFF51\u024B\uA757\uA759"},{base:"r",chars:"\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783"},{base:"s",chars:"\u24E2\uFF53\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B\u0282"},{base:"ss",chars:"\xDF"}
1,{base:"t",chars:"\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787"},{base:"th",chars:"\xFE"},{base:"tz",chars:"\uA729"},{base:"u",chars:"\u24E4\uFF55\xF9\xFA\xFB\u0169\u1E79\u016B\u1E7B\u016D\xFC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289"},{base:"v",chars:"\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C"},{base:"vy",chars:"\uA761"},{base:"w",chars:"\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73"},{base:"x",chars:"\u24E7\uFF58\u1E8B\u1E8D"},{base:"y",chars:"\u24E8\uFF59\u1EF3\xFD\u0177\u1EF9\u0233\u1E8F\xFF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF"},{base:"z",chars:"\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763"}],ff={};for(pa=0;pa<du.length;pa+=1)for(hf=du[pa].chars,lu=0;lu<hf.length;lu+=1)ff[hf[lu]]=du[pa].base;var hf,lu,pa;function C_(n){return n.replace(/[^\u0000-\u007e]/g,function(i){return ff[i]||i})}hu.replacementList=du;hu.diacriticsMap=ff});var HO=Yt(fu=>{"use strict";fu.byteLength=__;fu.toByteArray=F_;fu.fromByteArray=$_;var vn=[],Gt=[],k_=typeof Uint8Array<"u"?Uint8Array:Array,pf="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(ji=0,UO=pf.length;ji<UO;++ji)vn[ji]=pf[ji],Gt[pf.charCodeAt(ji)]=ji;var ji,UO;Gt[45]=62;Gt[95]=63;function BO(n){var i=n.length;if(i%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var e=n.indexOf("=");e===-1&&(e=i);var t=e===i?0:4-e%4;return[e,t]}function __(n){var i=BO(n),e=i[0],t=i[1];return(e+t)*3/4-t}function x_(n,i,e){return(i+e)*3/4-e}function F_(n){var i,e=BO(n),t=e[0],s=e[1],a=new k_(x_(n,t,s)),o=0,u=s>0?t-4:t,c;for(c=0;c<u;c+=4)i=Gt[n.charCodeAt(c)]<<18|Gt[n.charCodeAt(c+1)]<<12|Gt[n.charCodeAt(c+2)]<<6|Gt[n.charCo
vendor: 22,856 bytes, line 1
1deAt(c+3)],a[o++]=i>>16&255,a[o++]=i>>8&255,a[o++]=i&255;return s===2&&(i=Gt[n.charCodeAt(c)]<<2|Gt[n.charCodeAt(c+1)]>>4,a[o++]=i&255),s===1&&(i=Gt[n.charCodeAt(c)]<<10|Gt[n.charCodeAt(c+1)]<<4|Gt[n.charCodeAt(c+2)]>>2,a[o++]=i>>8&255,a[o++]=i&255),a}function q_(n){return vn[n>>18&63]+vn[n>>12&63]+vn[n>>6&63]+vn[n&63]}function Y_(n,i,e){for(var t,s=[],a=i;a<e;a+=3)t=(n[a]<<16&16711680)+(n[a+1]<<8&65280)+(n[a+2]&255),s.push(q_(t));return s.join("")}function $_(n){for(var i,e=n.length,t=e%3,s=[],a=16383,o=0,u=e-t;o<u;o+=a)s.push(Y_(n,o,o+a>u?u:o+a));return t===1?(i=n[e-1],s.push(vn[i>>2]+vn[i<<4&63]+"==")):t===2&&(i=(n[e-2]<<8)+n[e-1],s.push(vn[i>>10]+vn[i>>4&63]+vn[i<<2&63]+"=")),s.join("")}});var GO=Yt(gf=>{"use strict";gf.read=function(n,i,e,t,s){var a,o,u=s*8-t-1,c=(1<<u)-1,l=c>>1,h=-7,p=e?s-1:0,I=e?-1:1,v=n[i+p];for(p+=I,a=v&(1<<-h)-1,v>>=-h,h+=u;h>0;a=a*256+n[i+p],p+=I,h-=8);for(o=a&(1<<-h)-1,a>>=-h,h+=t;h>0;o=o*256+n[i+p],p+=I,h-=8);if(a===0)a=1-l;else{if(a===c)return o?NaN:(v?-1:1)*(1/0);o=o+Math.pow(2,t),a=a-l}return(v?-1:1)*o*Math.pow(2,a-t)};gf.write=function(n,i,e,t,s,a){var o,u,c,l=a*8-s-1,h=(1<<l)-1,p=h>>1,I=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,v=t?0:a-1,E=t?1:-1,w=i<0||i===0&&1/i<0?1:0;for(i=Math.abs(i),isNaN(i)||i===1/0?(u=isNaN(i)?1:0,o=h):(o=Math.floor(Math.log(i)/Math.LN2),i*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+p>=1?i+=I/c:i+=I*Math.pow(2,1-p),i*c>=2&&(o++,c/=2),o+p>=h?(u=0,o=h):o+p>=1?(u=(i*c-1)*Math.pow(2,s),o=o+p):(u=i*Math.pow(2,p-1)*Math.pow(2,s),o=0));s>=8;n[e+v]=u&255,v+=E,u/=256,s-=8);for(o=o<<s|u,l+=s;l>0;n[e+v]=o&255,v+=E,o/=256,l-=8);n[e+v-E]|=w*128}});var cR=Yt(Zs=>{"use strict";var mf=HO(),Js=GO(),WO=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Zs.Buffer=z;Zs.SlowBuffer=H_;Zs.INSPECT_MAX_BYTES=50;var pu=2147483647;Zs.kMaxLength=pu;z.TYPED_ARRAY_SUPPORT=L_();!z.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function L_(){try{let n=new Uint8Array(1),i={foo:function(){return 42}};return Object.setPrototypeOf(i,Uint8Array.prototype),Object.setPrototypeOf(n,i),n.foo()===42}catch{return!1}}Object.defineProperty(z.prototype,"parent",{enumerable:!0,get:function(){if(z.isBuffer(this))return this.buffer}});Object.defineProperty(z.prototype,"offset",{enumerable:!0,get:function(){if(z.isBuffer(this))return this.byteOffset}});function Jn(n){if(n>pu)throw new RangeError('The value "'+n+'" is invalid for option "size"');let i=new Uint8Array(n);return Object.setPrototypeOf(i,z.prototype),i}function z(n,i,e){if(typeof n=="number"){if(typeof i=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return yf(n)}return ZO(n,i,e)}z.poolSize=8192;function ZO(n,i,e){if(typeof n=="string")return z_(n,i);if(ArrayBuffer.isView(n))return U_(n);if(n==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof n);if(yn(n,ArrayBuffer)||n&&yn(n.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(yn(n,SharedArrayBuffer)||n&&yn(n.buffer,SharedArrayBuffer)))return Df(n,i,e);if(typeof n=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let t=n.valueOf&&n.valueOf();if(t!=null&&t!==n)return z.from(t,i,e);let s=B_(n);if(s)return s;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof n[Symbol.toPrimitive]=="function")return z.from(n[Symbol.toPrimitive]("string"),i,e);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof n)}z.from=function(n,i,e){return ZO(n,i,e)};Object.setPrototypeOf(z.prototype,Uint8Array.prototype);Object.setPrototypeOf(z,Uint8Array);function XO(n){if(typeof n!="number")throw new TypeError('"size" argument must be of type number');if(n<0)throw new RangeError('The value "'+n+'" is invalid for option "size"')}function V_(n,i,e){return XO(n),n<=0?Jn(n):i!==void 0?typeof e=="string"?Jn(n).fill(i,e):Jn(n).fill(i):Jn(n)}z.alloc=function(n,i,e){return V_(n,i,e)};function yf(n){return XO(n),Jn(n<0?0:bf(n)|0)}z.allocUnsafe=function(n){return yf(n)};z.allocUnsafeSlow=function(n){return yf(n)};function z_(n,i){if((typeof i!="string"||i==="")&&(i="utf8"),!z.isEncoding(i))throw new TypeError("Unknown encoding: "+i);let e=QO(n,i)|0,t=Jn(e),s=t.write(n,i);return s!==e&&(t=t.slice(0,s)),t}function If(n){let i=n.length<0?0:bf(n.length)|0,e=Jn(i);for(let t=0;t<i;t+=1)e[t]=n[t]&255;return e}function U_(n){if(yn(n,Uint8Array)){let i=new Uint8Array(n);return Df(i.buffer,i.byteOffset,i.byteLength)}return If(n)}function Df(n,i,e){if(i<0||n.byteLength<i)throw new RangeError('"offset" is outside of buffer bounds');if(n.byteLength<i+(e||0))throw new RangeError('"length" is outside of buffer bounds');let t;return i===void 0&&e===void 0?t=new Uint8Array(n):e===void 0?t=new Uint8Array(n,i):t=new Uint8Array(n,i,e),Object.setPrototypeOf(t,z.prototype),t}function B_(n){if(z.isBuffer(n)){let i=bf(n.length)|0,e=Jn(i);return e.length===0||n.copy(e,0,0,i),e}if(n.length!==void 0)return typeof n.length!="number"||wf(n.length)?Jn(0):If(n);if(n.type==="Buffer"&&Array.isArray(n.data))return If(n.data)}function bf(n){if(n>=pu)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+pu.toString(16)+" bytes");return n|0}function H_(n){return+n!=n&&(n=0),z.alloc(+n)}z.isBuffer=function(i){return i!=null&&i._isBuffer===!0&&i!==z.prototype};z.compare=function(i,e){if(yn(i,Uint8Array)&&(i=z.from(i,i.offset,i.byteLength)),yn(e,Uint8Array)&&(e=z.from(e,e.offset,e.byteLength)),!z.isBuffer(i)||!z.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(i===e)return 0;let t=i.length,s=e.length;for(let a=0,o=Math.min(t,s);a<o;++a)if(i[a]!==e[a]){t=i[a],s=e[a];break}return t<s?-1:s<t?1:0};z.isEncoding=function(i){switch(String(i).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};z.concat=function(i,e){if(!Array.isArray(i))throw new TypeError('"list" argument must be an Array of Buffers');if(i.length===0)return z.alloc(0);let t;if(e===void 0)for(e=0,t=0;t<i.length;++t)e+=i[t].length;let s=z.allocUnsafe(e),a=0;for(t=0;t<i.length;++t){let o=i[t];if(yn(o,Uint8Array))a+o.length>s.length?(z.isBuffer(o)||(o=z.from(o)),o.copy(s,a)):Uint8Array.prototype.set.call(s,o,a);else if(z.isBuffer(o))o.copy(s,a);else throw new TypeError('"list" argument must be an Array of Buffers');a+=o.length}return s};function QO(n,i){if(z.isBuffer(n))return n.length;if(ArrayBuffer.isView(n)||yn(n,ArrayBuffer))return n.byteLength;if(typeof n!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof n);let e=n.length,t=arguments.length>2&&arguments[2]===!0;if(!t&&e===0)return 0;let s=!1;for(;;)switch(i){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":return vf(n).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return uR(n).length;default:if(s)return t?-1:vf(n).length;i=(""+i).toLowerCase(),s=!0}}z.byteLength=QO;function G_(n,i,e){let t=!1;if((i===void 0||i<0)&&(i=0),i>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,i>>>=0,e<=i))return"";for(n||(n="utf8");;)switch(n){case"hex":return nx(this,i,e);case"utf8":case"utf-8":return tR(this,i,e);case"ascii":return ex(this,i,e);case"latin1":case"binary":return tx(this,i,e);case"base64":return X_(this,i,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ix(this,i,e);default:if(t)throw new TypeError("Unknown encoding: "+n);n=(n+"").toLowerCase(),t=!0}}z.prototype._isBuffer=!0;function Ji(n,i,e){let t=n[i];n[i]=n[e],n[e]=t}z.prototype.swap16=function(){let i=this.length;if(i%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<i;e+=2)Ji(this,e,e+1);return this};z.prototype.swap32=function(){let i=this.length;if(i%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<i;e+=4)Ji(this,e,e+3),Ji(this,e+1,e+2);return this};z.prototype.swap64=function(){let i=this.length;if(i%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<i;e+=8)Ji(this,e,e+7),Ji(this,e+1,e+6),Ji(this,e+2,e+5),Ji(this,e+3,e+4);return this};z.prototype.toString=function(){let i=this.length;return i===0?"":arguments.length===0?tR(this,0,i):G_.apply(this,arguments)};z.prototype.toLocaleString=z.prototype.toString;z.prototype.equals=function(i){if(!z.isBuffer(i))throw new TypeError("Argument must be a Buffer");return this===i?!0:z.compare(this,i)===0};z.prototype.inspect=function(){let i="",e=Zs.INSPECT_MAX_BYTES;return i=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(i+=" ... "),"<Buffer "+i+">"};WO&&(z.prototype[WO]=z.prototype.inspect);z.prototype.compare=function(i,e,t,s,a){if(yn(i,Uint8Array)&&(i=z.from(i,i.offset,i.byteLength)),!z.isBuffer(i))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof i);if(e===void 0&&(e=0),t===void 0&&(t=i?i.length:0),s===void 0&&(s=0),a===void 0&&(a=this.length),e<0||t>i.length||s<0||a>this.length)throw new RangeError("out of range index");if(s>=a&&e>=t)return 0;if(s>=a)return-1;if(e>=t)return 1;if(e>>>=0,t>>>=0,s>>>=0,a>>>=0,this===i)return 0;let o=a-s,u=t-e,c=Math.min(o,u),l=this.slice(s,a),h=i.slice(e,t);for(let p=0;p<c;++p)if(l[p]!==h[p]){o=l[p],u=h[p];break}return o<u?-1:u<o?1:0};function eR(n,i,e,t,s){if(n.length===0)return-1;if(typeof e=="string"?(t=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,wf(e)&&(e=s?0:n.length-1),e<0&&(e=n.length+e),e>=n.length){if(s)return-1;e=n.length-1}else if(e<0)if(s)e=0;else return-1;if(typeof i=="string"&&(i=z.from(i,t)),z.isBuffer(i))return i.length===0?-1:jO(n,i,e,t,s);if(typeof i=="number")return i=i&255,typeof Uint8Array.prototype.indexOf=="function"?s?Uint8Array.prototype.indexOf.call(n,i,e):Uint8Array.prototype.lastIndexOf.call(n,i,e):jO(n,[i],e,t,s);throw new TypeError("val must be string, number or Buffer")}function jO(n,i,e,t,s){let a=1,o=n.length,u=i.length;if(t!==void 0&&(t=String(t).toLowerCase(),t==="ucs2"||t==="ucs-2"||t==="utf16le"||t==="utf-16le")){if(n.length<2||i.length<2)return-1;a=2,o/=2,u/=2,e/=2}function c(h,p){return a===1?h[p]:h.readUInt16BE(p*a)}let l;if(s){let h=-1;for(l=e;l<o;l++)if(c(n,l)===c(i,h===-1?0:l-h)){if(h===-1&&(h=l),l-h+1===u)return h*a}else h!==-1&&(l-=l-h),h=-1}else for(e+u>o&&(e=o-u),l=e;l>=0;l--){let h=!0;for(let p=0;p<u;p++)if(c(n,l+p)!==c(i,p)){h=!1;break}if(h)return l}return-1}z.prototype.includes=function(i,e,t){return this.indexOf(i,e,t)!==-1};z.prototype.indexOf=function(i,e,t){return eR(this,i,e,t,!0)};z.prototype.lastIndexOf=function(i,e,t){return eR(this,i,e,t,!1)};function W_(n,i,e,t){e=Number(e)||0;let s=n.length-e;t?(t=Number(t),t>s&&(t=s)):t=s;let a=i.length;t>a/2&&(t=a/2);let o;for(o=0;o<t;++o){let u=parseInt(i.substr(o*2,2),16);if(wf(u))return o;n[e+o]=u}return o}function j_(n,i,e,t){return gu(vf(i,n.length-e),n,e,t)}function J_(n,i,e,t){return gu(ox(i),n,e,t)}function K_(n,i,e,t){return gu(uR(i),n,e,t)}function Z_(n,i,e,t){return gu(ux(i,n.length-e),n,e,t)}z.prototype.write=function(i,e,t,s){if(e===void 0)s="utf8",t=this.length,e=0;else if(t===void 0&&typeof e=="string")s=e,t=this.length,e=0;else if(isFinite(e))e=e>>>0,isFinite(t)?(t=t>>>0,s===void 0&&(s="utf8")):(s=t,t=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let a=this.length-e;if((t===void 0||t>a)&&(t=a),i.length>0&&(t<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");s||(s="utf8");let o=!1;for(;;)switch(s){case"hex":return W_(this,i,e,t);case"utf8":case"utf-8":return j_(this,i,e,t);case"ascii":case"latin1":case"binary":return J_(this,i,e,t);case"base64":return K_(this,i,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Z_(this,i,e,t);default:if(o)throw new TypeError("Unknown encoding: "+s);s=(""+s).toLowerCase(),o=!0}};z.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function X_(n,i,e){return i===0&&e===n.length?mf.fromByteArray(n):mf.fromByteArray(n.slice(i,e))}function tR(n,i,e){e=Math.min(n.length,e);let t=[],s=i;for(;s<e;){let a=n[s],o=null,u=a>239?4:a>223?3:a>191?2:1;if(s+u<=e){let c,l,h,p;switch(u){case 1:a<128&&(o=a);break;case 2:c=n[s+1],(c&192)===128&&(p=(a&31)<<6|c&63,p>127&&(o=p));break;case 3:c=n[s+1],l=n[s+2],(c&192)===128&&(l&192)===128&&(p=(a&15)<<12|(c&63)<<6|l&63,p>2047&&(p<55296||p>57343)&&(o=p));break;case 4:c=n[s+1],l=n[s+2],h=n[s+3],(c&192)===128&&(l&192)===128&&(h&192)===128&&(p=(a&15)<<18|(c&63)<<12|(l&63)<<6|h&63,p>65535&&p<1114112&&(o=p))}}o===null?(o=65533,u=1):o>65535&&(o-=65536,t.push(o>>>10&1023|55296),o=56320|o&1023),t.push(o),s+=u}return Q_(t)}var JO=4096;function Q_(n){let i=n.length;if(i<=JO)return String.fromCharCode.apply(String,n);let e="",t=0;for(;t<i;)e+=String.fromCharCode.apply(String,n.slice(t,t+=JO));return e}function ex(n,i,e){let t="";e=Math.min(n.length,e);for(let s=i;s<e;++s)t+=String.fromCharCode(n[s]&127);return t}function tx(n,i,e){let t="";e=Math.min(n.length,e);for(let s=i;s<e;++s)t+=String.fromCharCode(n[s]);return t}function nx(n,i,e){let t=n.length;(!i||i<0)&&(i=0),(!e||e<0||e>t)&&(e=t);let s="";for(let a=i;a<e;++a)s+=cx[n[a]];return s}function ix(n,i,e){let t=n.slice(i,e),s="";for(let a=0;a<t.length-1;a+=2)s+=String.fromCharCode(t[a]+t[a+1]*256);return s}z.prototype.slice=function(i,e){let t=this.length;i=~~i,e=e===void 0?t:~~e,i<0?(i+=t,i<0&&(i=0)):i>t&&(i=t),e<0?(e+=t,e<0&&(e=0)):e>t&&(e=t),e<i&&(e=i);let s=this.subarray(i,e);return Object.setPrototypeOf(s,z.prototype),s};function gt(n,i,e){if(n%1!==0||n<0)throw new RangeError("offset is not uint");if(n+i>e)throw new RangeError("Trying to access beyond buffer length")}z.prototype.readUintLE=z.prototype.readUIntLE=function(i,e,t){i=i>>>0,e=e>>>0,t||gt(i,e,this.length);let s=this[i],a=1,o=0;for(;++o<e&&(a*=256);)s+=this[i+o]*a;return s};z.prototype.readUintBE=z.prototype.readUIntBE=function(i,e,t){i=i>>>0,e=e>>>0,t||gt(i,e,this.length);let s=this[i+--e],a=1;for(;e>0&&(a*=256);)s+=this[i+--e]*a;return s};z.prototype.readUint8=z.prototype.readUInt8=function(i,e){return i=i>>>0,e||gt(i,1,this.length),this[i]};z.prototype.readUint16LE=z.prototype.readUInt16LE=function(i,e){return i=i>>>0,e||gt(i,2,this.length),this[i]|this[i+1]<<8};z.prototype.readUint16BE=z.prototype.readUInt16BE=function(i,e){return i=i>>>0,e||gt(i,2,this.length),this[i]<<8|this[i+1]};z.prototype.readUint32LE=z.prototype.readUInt32LE=function(i,e){return i=i>>>0,e||gt(i,4,this.length),(this[i]|this[i+1]<<8|this[i+2]<<16)+this[i+3]*16777216};z.prototype.readUint32BE=z.prototype.readUInt32BE=function(i,e){return i=i>>>0,e||gt(i,4,this.length),this[i]*16777216+(this[i+1]<<16|this[i+2]<<8|this[i+3])};z.prototype.readBigUInt64LE=bi(function(i){i=i>>>0,Ks(i,"offset");let e=this[i],t=this[i+7];(e===void 0||t===void 0)&&ga(i,this.length-8);let s=e+this[++i]*2**8+this[++i]*2**16+this[++i]*2**24,a=this[++i]+this[++i]*2**8+this[++i]*2**16+t*2**24;return BigInt(s)+(BigInt(a)<<BigInt(32))});z.prototype.readBigUInt64BE=bi(function(i){i=i>>>0,Ks(i,"offset");let e=this[i],t=this[i+7];(e===void 0||t===void 0)&&ga(i,this.length-8);let s=e*2**24+this[++i]*2**16+this[++i]*2**8+this[++i],a=this[++i]*2**24+this[++i]*2**16+this[++i]*2**8+t;return(BigInt(s)<<BigInt(32))+BigInt(a)});z.prototype.readIntLE=function(i,e,t){i=i>>>0,e=e>>>0,t||gt(i,e,this.length);let s=this[i],a=1,o=0;for(;++o<e&&(a*=256);)s+=this[i+o]*a;return a*=128,s>=a&&(s-=Math.pow(2,8*e)),s};z.prototype.readIntBE=function(i,e,t){i=i>>>0,e=e>>>0,t||gt(i,e,this.length);let s=e,a=1,o=this[i+--s];for(;s>0&&(a*=256);)o+=this[i+--s]*a;return a*=128,o>=a&&(o-=Math.pow(2,8*e)),o};z.prototype.readInt8=function(i,e){return i=i>>>0,e||gt(i,1,this.length),this[i]&128?(255-this[i]+1)*-1:this[i]};z.prototype.readInt16LE=function(i,e){i=i>>>0,e||gt(i,2,this.length);let t=this[i]|this[i+1]<<8;return t&32768?t|4294901760:t};z.prototype.readInt16BE=function(i,e){i=i>>>0,e||gt(i,2,this.length);let t=this[i+1]|this[i]<<8;return t&32768?t|4294901760:t};z.prototype.readInt32LE=function(i,e){return i=i>>>0,e||gt(i,4,this.length),this[i]|this[i+1]<<8|this[i+2]<<16|this[i+3]<<24};z.prototype.readInt32BE=function(i,e){return i=i>>>0,e||gt(i,4,this.length),this[i]<<24|this[i+1]<<16|this[i+2]<<8|this[i+3]};z.prototype.readBigInt64LE=bi(function(i){i=i>>>0,Ks(i,"offset");let e=this[i],t=this[i+7];(e===void 0||t===void 0)&&ga(i,this.length-8);let s=this[i+4]+this[i+5]*2**8+this[i+6]*2**16+(t<<24);return(BigInt(s)<<BigInt(32))+BigInt(e+this[++i]*2**8+this[++i]*2**16+this[++i]*2**24)});z.prototype.readBigInt64BE=bi(function(i){i=i>>>0,Ks(i,"offset");let e=this[i],t=this[i+7];(e===void 0||t===void 0)&&ga(i,this.length-8);let s=(e<<24)+this[++i]*2**16+this[++i]*2**8+this[++i];return(BigInt(s)<<BigInt(32))+BigInt(this[++i]*2**24+this[++i]*2**16+this[++i]*2**8+t)});z.prototype.readFloatLE=function(i,e){return i=i>>>0,e||gt(i,4,this.length),Js.read(this,i,!0,23,4)};z.prototype.readFloatBE=function(i,e){return i=i>>>0,e||gt(i,4,this.length),Js.read(this,i,!1,23,4)};z.prototype.readDoubleLE=function(i,e){return i=i>>>0,e||gt(i,8,this.length),Js.read(this,i,!0,52,8)};z.prototype.readDoubleBE=function(i,e){return i=i>>>0,e||gt(i,8,this.length),Js.read(this,i,!1,52,8)};function Ct(n,i,e,t,s,a){if(!z.isBuffer(n))throw new TypeError('"buffer" argument must be a Buffer instance');if(i>s||i<a)throw new RangeError('"value" argument is out of bounds');if(e+t>n.length)throw new RangeError("Index out of range")}z.prototype.writeUintLE=z.prototype.writeUIntLE=function(i,e,t,s){if(i=+i,e=e>>>0,t=t>>>0,!s){let u=Math.pow(2,8*t)-1;Ct(this,i,e,t,u,0)}let a=1,o=0;for(this[e]=i&255;++o<t&&(a*=256);)this[e+o]=i/a&255;return e+t};z.prototype.writeUintBE=z.prototype.writeUIntBE=function(i,e,t,s){if(i=+i,e=e>>>0,t=t>>>0,!s){let u=Math.pow(2,8*t)-1;Ct(this,i,e,t,u,0)}let a=t-1,o=1;for(this[e+a]=i&255;--a>=0&&(o*=256);)this[e+a]=i/o&255;return e+t};z.prototype.writeUint8=z.prototype.writeUInt8=function(i,e,t){return i=+i,e=e>>>0,t||Ct(this,i,e,1,255,0),this[e]=i&255,e+1};z.prototype.writeUint16LE=z.prototype.writeUInt16LE=function(i,e,t){return i=+i,e=e>>>0,t||Ct(this,i,e,2,65535,0),this[e]=i&255,this[e+1]=i>>>8,e+2};z.prototype.writeUint16BE=z.prototype.writeUInt16BE=function(i,e,t){return i=+i,e=e>>>0,t||Ct(this,i,e,2,65535,0),this[e]=i>>>8,this[e+1]=i&255,e+2};z.prototype.writeUint32LE=z.prototype.writeUInt32LE=function(i,e,t){return i=+i,e=e>>>0,t||Ct(this,i,e,4,4294967295,0),this[e+3]=i>>>24,this[e+2]=i>>>16,this[e+1]=i>>>8,this[e]=i&255,e+4};z.prototype.writeUint32BE=z.prototype.writeUInt32BE=function(i,e,t){return i=+i,e=e>>>0,t||Ct(this,i,e,4,4294967295,0),this[e]=i>>>24,this[e+1]=i>>>16,this[e+2]=i>>>8,this[e+3]=i&255,e+4};function nR(n,i,e,t,s){oR(i,t,s,n,e,7);let a=Number(i&BigInt(4294967295));n[e++]=a,a=a>>8,n[e++]=a,a=a>>8,n[e++]=a,a=a>>8,n[e++]=a;let o=Number(i>>BigInt(32)&BigInt(4294967295));return n[e++]=o,o=o>>8,n[e++]=o,o=o>>8,n[e++]=o,o=o>>8,n[e++]=o,e}function iR(n,i,e,t,s){oR(i,t,s,n,e,7);let a=Number(i&BigInt(4294967295));n[e+7]=a,a=a>>8,n[e+6]=a,a=a>>8,n[e+5]=a,a=a>>8,n[e+4]=a;let o=Number(i>>BigInt(32)&BigInt(4294967295));return n[e+3]=o,o=o>>8,n[e+2]=o,o=o>>8,n[e+1]=o,o=o>>8,n[e]=o,e+8}z.prototype.writeBigUInt64LE=bi(function(i,e=0){return nR(this,i,e,BigInt(0),BigInt("0xffffffffffffffff"))});z.prototype.writeBigUInt64BE=bi(function(i,e=0){return iR(this,i,e,BigInt(0),BigInt("0xffffffffffffffff"))});z.prototype.writeIntLE=function(i,e,t,s){if(i=+i,e=e>>>0,!s){let c=Math.pow(2,8*t-1);Ct(this,i,e,t,c-1,-c)}let a=0,o=1,u=0;for(this[e]=i&255;++a<t&&(o*=256);)i<0&&u===0&&this[e+a-1]!==0&&(u=1),this[e+a]=(i/o>>0)-u&255;return e+t};z.prototype.writeIntBE=function(i,e,t,s){if(i=+i,e=e>>>0,!s){let c=Math.pow(2,8*t-1);Ct(this,i,e,t,c-1,-c)}let a=t-1,o=1,u=0;for(this[e+a]=i&255;--a>=0&&(o*=256);)i<0&&u===0&&this[e+a+1]!==0&&(u=1),this[e+a]=(i/o>>0)-u&255;return e+t};z.prototype.writeInt8=function(i,e,t){return i=+i,e=e>>>0,t||Ct(this,i,e,1,127,-128),i<0&&(i=255+i+1),this[e]=i&255,e+1};z.prototype.writeInt16LE=function(i,e,t){return i=+i,e=e>>>0,t||Ct(this,i,e,2,32767,-32768),this[e]=i&255,this[e+1]=i>>>8,e+2};z.prototype.writeInt16BE=function(i,e,t){return i=+i,e=e>>>0,t||Ct(this,i,e,2,32767,-32768),this[e]=i>>>8,this[e+1]=i&255,e+2};z.prototype.writeInt32LE=function(i,e,t){return i=+i,e=e>>>0,t||Ct(this,i,e,4,2147483647,-2147483648),this[e]=i&255,this[e+1]=i>>>8,this[e+2]=i>>>16,this[e+3]=i>>>24,e+4};z.prototype.writeInt32BE=function(i,e,t){return i=+i,e=e>>>0,t||Ct(this,i,e,4,2147483647,-2147483648),i<0&&(i=4294967295+i+1),this[e]=i>>>24,this[e+1]=i>>>16,this[e+2]=i>>>8,this[e+3]=i&255,e+4};z.prototype.writeBigInt64LE=bi(function(i,e=0){return nR(this,i,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});z.prototype.writeBigInt64BE=bi(function(i,e=0){return iR(this,i,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function sR(n,i,e,t,s,a){if(e+t>n.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function rR(n,i,e,t,s){return i=+i,e=e>>>0,s||sR(n,i,e,4,34028234663852886e22,-34028234663852886e22),Js.write(n,i,e,t,23,4),e+4}z.prototype.writeFloatLE=function(i,e,t){return rR(this,i,e,!0,t)};z.prototype.writeFloatBE=function(i,e,t){return rR(this,i,e,!1,t)};function aR(n,i,e,t,s){return i=+i,e=e>>>0,s||sR(n,i,e,8,17976931348623157e292,-17976931348623157e292),Js.write(n,i,e,t,52,8),e+8}z.prototype.writeDoubleLE=function(i,e,t){return aR(this,i,e,!0,t)};z.prototype.writeDoubleBE=function(i,e,t){return aR(this,i,e,!1,t)};z.prototype.copy=function(i,e,t,s){if(!z.isBuffer(i))throw new TypeError("argument should be a Buffer");if(t||(t=0),!s&&s!==0&&(s=this.length),e>=i.length&&(e=i.length),e||(e=0),s>0&&s<t&&(s=t),s===t||i.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(t<0||t>=this.length)throw new RangeError("Index out of range");if(s<0)throw new RangeError("sourceEnd out of bounds");s>this.length&&(s=this.length),i.length-e<s-t&&(s=i.length-e+t);let a=s-t;return this===i&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(e,t,s):Uint8Array.prototype.set.call(i,this.subarray(t,s),e),a};z.prototype.fill=function(i,e,t,s){if(typeof i=="string"){if(typeof e=="string"?(s=e,e=0,t=this.length):typeof t=="string"&&(s=t,t=this.length),s!==void 0&&typeof s!="str
1ing")throw new TypeError("encoding must be a string");if(typeof s=="string"&&!z.isEncoding(s))throw new TypeError("Unknown encoding: "+s);if(i.length===1){let o=i.charCodeAt(0);(s==="utf8"&&o<128||s==="latin1")&&(i=o)}}else typeof i=="number"?i=i&255:typeof i=="boolean"&&(i=Number(i));if(e<0||this.length<e||this.length<t)throw new RangeError("Out of range index");if(t<=e)return this;e=e>>>0,t=t===void 0?this.length:t>>>0,i||(i=0);let a;if(typeof i=="number")for(a=e;a<t;++a)this[a]=i;else{let o=z.isBuffer(i)?i:z.from(i,s),u=o.length;if(u===0)throw new TypeError('The value "'+i+'" is invalid for argument "value"');for(a=0;a<t-e;++a)this[a+e]=o[a%u]}return this};var js={};function Ef(n,i,e){js[n]=class extends e{constructor(){super(),Object.defineProperty(this,"message",{value:i.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${n}]`,this.stack,delete this.name}get code(){return n}set code(s){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:s,writable:!0})}toString(){return`${this.name} [${n}]: ${this.message}`}}}Ef("ERR_BUFFER_OUT_OF_BOUNDS",function(n){return n?`${n} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);Ef("ERR_INVALID_ARG_TYPE",function(n,i){return`The "${n}" argument must be of type number. Received type ${typeof i}`},TypeError);Ef("ERR_OUT_OF_RANGE",function(n,i,e){let t=`The value of "${n}" is out of range.`,s=e;return Number.isInteger(e)&&Math.abs(e)>2**32?s=KO(String(e)):typeof e=="bigint"&&(s=String(e),(e>BigInt(2)**BigInt(32)||e<-(BigInt(2)**BigInt(32)))&&(s=KO(s)),s+="n"),t+=` It must be ${i}. Received ${s}`,t},RangeError);function KO(n){let i="",e=n.length,t=n[0]==="-"?1:0;for(;e>=t+4;e-=3)i=`_${n.slice(e-3,e)}${i}`;return`${n.slice(0,e)}${i}`}function sx(n,i,e){Ks(i,"offset"),(n[i]===void 0||n[i+e]===void 0)&&ga(i,n.length-(e+1))}function oR(n,i,e,t,s,a){if(n>e||n<i){let o=typeof i=="bigint"?"n":"",u;throw a>3?i===0||i===BigInt(0)?u=`>= 0${o} and < 2${o} ** ${(a+1)*8}${o}`:u=`>= -(2${o} ** ${(a+1)*8-1}${o}) and < 2 ** ${(a+1)*8-1}${o}`:u=`>= ${i}${o} and <= ${e}${o}`,new js.ERR_OUT_OF_RANGE("value",u,n)}sx(t,s,a)}function Ks(n,i){if(typeof n!="number")throw new js.ERR_INVALID_ARG_TYPE(i,"number",n)}function ga(n,i,e){throw Math.floor(n)!==n?(Ks(n,e),new js.ERR_OUT_OF_RANGE(e||"offset","an integer",n)):i<0?new js.ERR_BUFFER_OUT_OF_BOUNDS:new js.ERR_OUT_OF_RANGE(e||"offset",`>= ${e?1:0} and <= ${i}`,n)}var rx=/[^+/0-9A-Za-z-_]/g;function ax(n){if(n=n.split("=")[0],n=n.trim().replace(rx,""),n.length<2)return"";for(;n.length%4!==0;)n=n+"=";return n}function vf(n,i){i=i||1/0;let e,t=n.length,s=null,a=[];for(let o=0;o<t;++o){if(e=n.charCodeAt(o),e>55295&&e<57344){if(!s){if(e>56319){(i-=3)>-1&&a.push(239,191,189);continue}else if(o+1===t){(i-=3)>-1&&a.push(239,191,189);continue}s=e;continue}if(e<56320){(i-=3)>-1&&a.push(239,191,189),s=e;continue}e=(s-55296<<10|e-56320)+65536}else s&&(i-=3)>-1&&a.push(239,191,189);if(s=null,e<128){if((i-=1)<0)break;a.push(e)}else if(e<2048){if((i-=2)<0)break;a.push(e>>6|192,e&63|128)}else if(e<65536){if((i-=3)<0)break;a.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((i-=4)<0)break;a.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return a}function ox(n){let i=[];for(let e=0;e<n.length;++e)i.push(n.charCodeAt(e)&255);return i}function ux(n,i){let e,t,s,a=[];for(let o=0;o<n.length&&!((i-=2)<0);++o)e=n.charCodeAt(o),t=e>>8,s=e%256,a.push(s),a.push(t);return a}function uR(n){return mf.toByteArray(ax(n))}function gu(n,i,e,t){let s;for(s=0;s<t&&!(s+e>=i.length||s>=n.length);++s)i[s+e]=n[s];return s}function yn(n,i){return n instanceof i||n!=null&&n.constructor!=null&&n.constructor.name!=null&&n.constructor.name===i.name}function wf(n){return n!==n}var cx=(function(){let n="0123456789abcdef",i=new Array(256);for(let e=0;e<16;++e){let t=e*16;for(let s=0;s<16;++s)i[t+s]=n[e]+n[s]}return i})();function bi(n){return typeof BigInt>"u"?lx:n}function lx(){throw new Error("BigInt not supported")}});var hk=Yt(($Y,dk)=>{"use strict";dk.exports=function(i,e){if(e=e.split(":")[0],i=+i,!i)return!1;switch(e){case"http":case"ws":return i!==80;case"https":case"wss":return i!==443;case"ftp":return i!==21;case"gopher":return i!==70;case"file":return!1}return i!==0}});var gk=Yt(JS=>{"use strict";var v2=Object.prototype.hasOwnProperty,y2;function fk(n){try{return decodeURIComponent(n.replace(/\+/g," "))}catch{return null}}function pk(n){try{return encodeURIComponent(n)}catch{return null}}function b2(n){for(var i=/([^=?#&]+)=?([^&]*)/g,e={},t;t=i.exec(n);
vendor: 4,774 bytes, line 1
1){var s=fk(t[1]),a=fk(t[2]);s===null||a===null||s in e||(e[s]=a)}return e}function E2(n,i){i=i||"";var e=[],t,s;typeof i!="string"&&(i="?");for(s in n)if(v2.call(n,s)){if(t=n[s],!t&&(t===null||t===y2||isNaN(t))&&(t=""),s=pk(s),t=pk(t),s===null||t===null)continue;e.push(s+"="+t)}return e.length?i+e.join("&"):""}JS.stringify=E2;JS.parse=b2});var wk=Yt((VY,Ek)=>{"use strict";var Ik=hk(),ah=gk(),w2=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,Dk=/[\n\r\t]/g,S2=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,vk=/:\d+$/,T2=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,O2=/^[a-zA-Z]:/;function ZS(n){return(n||"").toString().replace(w2,"")}var KS=[["#","hash"],["?","query"],function(i,e){return zn(e.protocol)?i.replace(/\\/g,"/"):i},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],mk={hash:1,query:1};function yk(n){var i;typeof window<"u"?i=window:typeof global<"u"?i=global:typeof self<"u"?i=self:i={};var e=i.location||{};n=n||e;var t={},s=typeof n,a;if(n.protocol==="blob:")t=new Un(unescape(n.pathname),{});else if(s==="string"){t=new Un(n,{});for(a in mk)delete t[a]}else if(s==="object"){for(a in n)a in mk||(t[a]=n[a]);t.slashes===void 0&&(t.slashes=S2.test(n.href))}return t}function zn(n){return n==="file:"||n==="ftp:"||n==="http:"||n==="https:"||n==="ws:"||n==="wss:"}function bk(n,i){n=ZS(n),n=n.replace(Dk,""),i=i||{};var e=T2.exec(n),t=e[1]?e[1].toLowerCase():"",s=!!e[2],a=!!e[3],o=0,u;return s?a?(u=e[2]+e[3]+e[4],o=e[2].length+e[3].length):(u=e[2]+e[4],o=e[2].length):a?(u=e[3]+e[4],o=e[3].length):u=e[4],t==="file:"?o>=2&&(u=u.slice(2)):zn(t)?u=e[4]:t?s&&(u=u.slice(2)):o>=2&&zn(i.protocol)&&(u=e[4]),{protocol:t,slashes:s||zn(t),slashesCount:o,rest:u}}function R2(n,i){if(n==="")return i;for(var e=(i||"/").split("/").slice(0,-1).concat(n.split("/")),t=e.length,s=e[t-1],a=!1,o=0;t--;)e[t]==="."?e.splice(t,1):e[t]===".."?(e.splice(t,1),o++):o&&(t===0&&(a=!0),e.splice(t,1),o--);return a&&e.unshift(""),(s==="."||s==="..")&&e.push(""),e.join("/")}function Un(n,i,e){if(n=ZS(n),n=n.replace(Dk,""),!(this instanceof Un))return new Un(n,i,e);var t,s,a,o,u,c,l=KS.slice(),h=typeof i,p=this,I=0;for(h!=="object"&&h!=="string"&&(e=i,i=null),e&&typeof e!="function"&&(e=ah.parse),i=yk(i),s=bk(n||"",i),t=!s.protocol&&!s.slashes,p.slashes=s.slashes||t&&i.slashes,p.protocol=s.protocol||i.protocol||"",n=s.rest,(s.protocol==="file:"&&(s.slashesCount!==2||O2.test(n))||!s.slashes&&(s.protocol||s.slashesCount<2||!zn(p.protocol)))&&(l[3]=[/(.*)/,"pathname"]);I<l.length;I++){if(o=l[I],typeof o=="function"){n=o(n,p);continue}a=o[0],c=o[1],a!==a?p[c]=n:typeof a=="string"?(u=a==="@"?n.lastIndexOf(a):n.indexOf(a),~u&&(typeof o[2]=="number"?(p[c]=n.slice(0,u),n=n.slice(u+o[2])):(p[c]=n.slice(u),n=n.slice(0,u)))):(u=a.exec(n))&&(p[c]=u[1],n=n.slice(0,u.index)),p[c]=p[c]||t&&o[3]&&i[c]||"",o[4]&&(p[c]=p[c].toLowerCase())}e&&(p.query=e(p.query)),t&&i.slashes&&p.pathname.charAt(0)!=="/"&&(p.pathname!==""||i.pathname!=="")&&(p.pathname=R2(p.pathname,i.pathname)),p.pathname.charAt(0)!=="/"&&zn(p.protocol)&&(p.pathname="/"+p.pathname),Ik(p.port,p.protocol)||(p.host=p.hostname,p.port=""),p.username=p.password="",p.auth&&(u=p.auth.indexOf(":"),~u?(p.username=p.auth.slice(0,u),p.username=encodeURIComponent(decodeURIComponent(p.username)),p.password=p.auth.slice(u+1),p.password=encodeURIComponent(decodeURIComponent(p.password))):p.username=encodeURIComponent(decodeURIComponent(p.auth)),p.auth=p.password?p.username+":"+p.password:p.username),p.origin=p.protocol!=="file:"&&zn(p.protocol)&&p.host?p.protocol+"//"+p.host:"null",p.href=p.toString()}function M2(n,i,e){var t=this;switch(n){case"query":typeof i=="string"&&i.length&&(i=(e||ah.parse)(i)),t[n]=i;break;case"port":t[n]=i,Ik(i,t.protocol)?i&&(t.host=t.hostname+":"+i):(t.host=t.hostname,t[n]="");break;case"hostname":t[n]=i,t.port&&(i+=":"+t.port),t.host=i;break;case"host":t[n]=i,vk.test(i)?(i=i.split(":"),t.port=i.pop(),t.hostname=i.join(":")):(t.hostname=i,t.port="");break;case"protocol":t.protocol=i.toLowerCase(),t.slashes=!e;break;case"pathname":case"hash":if(i){var s=n==="pathname"?"/":"#";t[n]=i.charAt(0)!==s?s+i:i}else t[n]=i;break;case"username":case"password":t[n]=encodeURIComponent(i);break;case"auth":var a=i.indexOf(":");~a?(t.username=i.slice(0,a),t.username=encodeURIComponent(decodeURIComponent(t.username)),t.password=i.slice(a+1),t.password=encodeURIComponent(decodeURIComponent(t.password))):t.username=encodeURIComponent(decodeURIComponent(i))}for(var o=0;o<KS.length;o++){var u=KS[o];u[4]&&(t[u[1]]=t[u[1]].toLowerCase())}return t.auth=t.password?t.username+":"+t.password:t.username,t.origin=t.protocol!=="file:"&&zn(t.protocol)&&t.host?t.protocol+"//"+t.host:"null",t.href=t.toString(),t}
1function N2(n){(!n||typeof n!="function")&&(n=ah.stringify);var i,e=this,t=e.host,s=e.protocol;s&&s.charAt(s.length-1)!==":"&&(s+=":");var a=s+(e.protocol&&e.slashes||zn(e.protocol)?"//":"");return e.username?(a+=e.username,e.password&&(a+=":"+e.password),a+="@"):e.password?(a+=":"+e.password,a+="@"):e.protocol!=="file:"&&zn(e.protocol)&&!t&&e.pathname!=="/"&&(a+="@"),(t[t.length-1]===":"||vk.test(e.hostname)&&!e.port)&&(t+=":"),a+=t+e.pathname,i=typeof e.query=="object"?n(e.query):e.query,i&&(a+=i.charAt(0)!=="?"?"?"+i:i),e.hash&&(a+=e.hash),a}Un.prototype={set:M2,toString:N2};Un.extractProtocol=bk;Un.location=yk;Un.trimLeft=ZS;Un.qs=ah;Ek.exports=Un});var $T=null;function mn(){return $T}function mh(n){$T??=n}var sa=class{},Di=(()=>{class n{historyGo(e){throw new Error("")}static \u0275fac=function(t){return new(t||n)};static \u0275prov=be({token:n,factory:()=>ce(LT),providedIn:"platform"})}return n})(),Rk=new Ce(""),LT=(()=>{class n extends Di{_location;_history;_doc=ce(Qe);constructor(){super(),this._location=window.location,this._history=window.history}getBaseHrefFromDOM(){return mn().getBaseHref(this._doc)}onPopState(e){let t=mn().getGlobalEventTarget(this._doc,"window");return t.addEventListener("popstate",e,!1),()=>t.removeEventListener("popstate",e)}onHashChange(e){let t=mn().getGlobalEventTarget(this._doc,"window");return t.addEventListener("hashchange",e,!1),()=>t.removeEventListener("hashchange",e)}get href(){return this._location.href}get protocol(){return this._location.protocol}get hostname(){return this._location.hostname}get port(){return this._location.port}get pathname(){return this._location.pathname}get search(){return this._location.search}get hash(){return this._location.hash}set pathname(e){this._location.pathname=e}pushState(e,t,s){this._history.pushState(e,t,s)}replaceState(e,t,s){this._history.replaceState(e,t,s)}forward(){this._history.forward()}back(){this._history.back()}historyGo(e=0){this._history.go(e)}getState(){return this._history.state}static \u0275fac=function(t){return new(t||n)};static \u0275prov=be({token:n,factory:()=>new n,providedIn:"platform"})}return n})();function Bo(n,i){return n?i?n.endsWith("/")?i.startsWith("/")?n+i.slice(1):n+i:i.startsWith("/")?n+i:`${n}/${i}`:n:i}function VT(n){let i=n.search(/#|\?|$/);return n[i-1]==="/"?n.slice(0,i-1)+n.slice(i):n}function on(n){return n&&n[0]!=="?"?`?${n}`:n}var Us=(()=>{class n{historyGo(e){throw new Error("")}static \u0275fac=function(t){return new(t||n)};static \u0275prov=be({token:n,factory:()=>ce(UT),providedIn:"root"})}return n})(),Ho=new Ce(""),UT=(()=>{class n extends Us{_platformLocation;_baseHref;_removeListenerFns=[];constructor(e,t){super(),this._platformLocation=e,this._baseHref=t??this._platformLocation.getBaseHrefFromDOM()??ce(Qe).location?.origin??""}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(e){this._removeListenerFns.push(this._platformLocation.onPopState(e),this._platformLocation.onHashChange(e))}getBaseHref(){return this._baseHref}prepareExternalUrl(e){return Bo(this._baseHref,e)}path(e=!1){let t=this._platformLocation.pathname+on(this._platformLocation.search),s=this._platformLocation.hash;return s&&e?`${t}${s}`:t}pushState(e,t,s,a){let o=this.prepareExternalUrl(s+on(a));this._platformLocation.pushState(e,t,o)}replaceState(e,t,s,a){let o=this.prepareExternalUrl(s+on(a));this._platformLocation.replaceState(e,t,o)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}getState(){return this._platformLocation.getState()}historyGo(e=0){this._platformLocation.historyGo?.(e)}static \u0275fac=function(t){return new(t||n)(ge(Di),ge(Ho,8))};static \u0275prov=be({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var BT=(()=>{class n{_subject=new Fo;_basePath;_locationStrategy;_urlChangeListeners=[];_urlChangeSubscription=null;constructor(e){this._locationStrategy=e;let t=this._locationStrategy.getBaseHref();this._basePath=Ak(VT(zT(t))),this._locationStrategy.onPopState(s=>{this._subject.next({url:this.path(!0),pop:!0,state:s.state,type:s.type})})}ngOnDestroy(){this._urlChangeSubscription?.unsubscribe(),this._urlChangeListeners=[]}path(e=!1){return this.normalize(this._locationStrategy.path(e))}getState(){return this._locationStrategy.getState()}isCurrentPathEqualTo(e,t=""){return this.path()==this.normalize(e+on(t))}normalize(e){return n.stripTrailingSlash(Pk(this._basePath,zT(e)))}prepareExternalUrl(e){return e&&e[0]!=="/"&&(e="/"+e),this._locationStrategy.prepareExternalUrl(e)}go(e,t="",s=null){this._locationStrategy.pushState(s,"",e,t),this._notifyUrlChangeListeners(this.prepareExternalUrl(e+on(t)),s)}replaceState(e,t="",s=null){this._locationStrategy.replaceState(s,"",e,t),this._notifyUrlChangeListeners(this.prepareExternalUrl(e+on(t)),s)}forward(){this._locationStrategy.forward()}back(){this._locationStrategy.back()}historyGo(e=0){this._locationStrategy.historyGo?.(e)}onUrlChange(e){return this._urlChangeListeners.push(e),this._urlChangeSubscription??=this.subscribe(t=>{this._notifyUrlChangeListeners(t.url,t.state)}),()=>{let t=this._urlChangeListeners.indexOf(e);this._urlChangeListeners.splice(t,1),this._urlChangeListeners.length===0&&(this._urlChangeSubscription?.unsubscribe(),this._urlChangeSubscription=null)}}_notifyUrlChangeListeners(e="",t){this._urlChangeListeners.forEac
vendor: 7,097 bytes, line 1
1h(s=>s(e,t))}subscribe(e,t,s){return this._subject.subscribe({next:e,error:t??void 0,complete:s??void 0})}static normalizeQueryParams=on;static joinWithSlash=Bo;static stripTrailingSlash=VT;static \u0275fac=function(t){return new(t||n)(ge(Us))};static \u0275prov=be({token:n,factory:()=>Nk(),providedIn:"root"})}return n})();function Nk(){return new BT(ge(Us))}function Pk(n,i){if(!n||!i.startsWith(n))return i;let e=i.substring(n.length);return e===""||["/",";","?","#"].includes(e[0])?e:i}function zT(n){return n.replace(/\/index\.html$/,"")}function Ak(n){if(new RegExp("^(https?:)?//").test(n)){let[,e]=n.split(/\/\/[^\/]+/);return e}return n}var kk=(()=>{class n extends Us{_platformLocation;_baseHref="";_removeListenerFns=[];constructor(e,t){super(),this._platformLocation=e,t!=null&&(this._baseHref=t)}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(e){this._removeListenerFns.push(this._platformLocation.onPopState(e),this._platformLocation.onHashChange(e))}getBaseHref(){return this._baseHref}path(e=!1){let t=this._platformLocation.hash??"#";return t.length>0?t.substring(1):t}prepareExternalUrl(e){let t=Bo(this._baseHref,e);return t.length>0?"#"+t:t}pushState(e,t,s,a){let o=this.prepareExternalUrl(s+on(a))||this._platformLocation.pathname;this._platformLocation.pushState(e,t,o)}replaceState(e,t,s,a){let o=this.prepareExternalUrl(s+on(a))||this._platformLocation.pathname;this._platformLocation.replaceState(e,t,o)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}getState(){return this._platformLocation.getState()}historyGo(e=0){this._platformLocation.historyGo?.(e)}static \u0275fac=function(t){return new(t||n)(ge(Di),ge(Ho,8))};static \u0275prov=be({token:n,factory:n.\u0275fac})}return n})();var Ih=/\s+/,HT=[],_k=(()=>{class n{_ngEl;_renderer;initialClasses=HT;rawClass;stateMap=new Map;constructor(e,t){this._ngEl=e,this._renderer=t}set klass(e){this.initialClasses=e!=null?e.trim().split(Ih):HT}set ngClass(e){this.rawClass=typeof e=="string"?e.trim().split(Ih):e}ngDoCheck(){for(let t of this.initialClasses)this._updateState(t,!0);let e=this.rawClass;if(Array.isArray(e)||e instanceof Set)for(let t of e)this._updateState(t,!0);else if(e!=null)for(let t of Object.keys(e))this._updateState(t,!!e[t]);this._applyStateDiff()}_updateState(e,t){let s=this.stateMap.get(e);s!==void 0?(s.enabled!==t&&(s.changed=!0,s.enabled=t),s.touched=!0):this.stateMap.set(e,{enabled:t,changed:!0,touched:!0})}_applyStateDiff(){for(let e of this.stateMap){let t=e[0],s=e[1];s.changed?(this._toggleClass(t,s.enabled),s.changed=!1):s.touched||(s.enabled&&this._toggleClass(t,!1),this.stateMap.delete(t)),s.touched=!1}}_toggleClass(e,t){e=e.trim(),e.length>0&&e.split(Ih).forEach(s=>{t?this._renderer.addClass(this._ngEl.nativeElement,s):this._renderer.removeClass(this._ngEl.nativeElement,s)})}static \u0275fac=function(t){return new(t||n)(nt(Ys),nt(Vs))};static \u0275dir=Ht({type:n,selectors:[["","ngClass",""]],inputs:{klass:[0,"class","klass"],ngClass:"ngClass"}})}return n})(),xk=(()=>{class n{_viewContainerRef;ngComponentOutlet=null;ngComponentOutletInputs;ngComponentOutletInjector;ngComponentOutletEnvironmentInjector;ngComponentOutletContent;ngComponentOutletNgModule;_componentRef;_moduleRef;_inputsUsed=new Map;get componentInstance(){return this._componentRef?.instance??null}constructor(e){this._viewContainerRef=e}_needToReCreateNgModuleInstance(e){return e.ngComponentOutletNgModule!==void 0}_needToReCreateComponentInstance(e){return e.ngComponentOutlet!==void 0||e.ngComponentOutletContent!==void 0||e.ngComponentOutletInjector!==void 0||e.ngComponentOutletEnvironmentInjector!==void 0||this._needToReCreateNgModuleInstance(e)}ngOnChanges(e){if(this._needToReCreateComponentInstance(e)&&(this._viewContainerRef.clear(),this._inputsUsed.clear(),this._componentRef=void 0,this.ngComponentOutlet)){let t=this.ngComponentOutletInjector||this._viewContainerRef.parentInjector;this._needToReCreateNgModuleInstance(e)&&(this._moduleRef?.destroy(),this.ngComponentOutletNgModule?this._moduleRef=OT(this.ngComponentOutletNgModule,Fk(t)):this._moduleRef=void 0),this._componentRef=this._viewContainerRef.createComponent(this.ngComponentOutlet,{injector:t,ngModuleRef:this._moduleRef,projectableNodes:this.ngComponentOutletContent,environmentInjector:this.ngComponentOutletEnvironmentInjector})}}ngDoCheck(){if(this._componentRef){if(this.ngComponentOutletInputs)for(let e of Object.keys(this.ngComponentOutletInputs))this._inputsUsed.set(e,!0);this._applyInputStateDiff(this._componentRef)}}ngOnDestroy(){this._moduleRef?.destroy()}_applyInputStateDiff(e){for(let[t,s]of this._inputsUsed)s?(e.setInput(t,this.ngComponentOutletInputs[t]),this._inputsUsed.set(t,!1)):(e.setInput(t,void 0),this._inputsUsed.delete(t))}static \u0275fac=function(t){return new(t||n)(nt(Gn))};static \u0275dir=Ht({type:n,selectors:[["","ngComponentOutlet",""]],inputs:{ngComponentOutlet:"ngComponentOutlet",ngComponentOutletInputs:"ngComponentOutletInputs",ngComponentOutletInjector:"ngComponentOutletInjector",ngComponentOutletEnvironmentInjector:"ngComponentOutletEnvironmentInjector",ngComponentOutletContent:"ngComponentOutletContent",ngComponentOutletNgModule:"ngComponentOutletNgModule"},exportAs:["ngComponentOutlet"],features:[na]})}return n})();function Fk(n){return n.get(TT).injector}var Go=class{$implicit;ngForOf;index;count;constructor(i,e,t,s){this.$implicit=i,this.ngForOf=e,this.index=t,this.count=s}get first(){return this.index===0}get last(){return this.index===this.count-1}get even(){return this.index%2===0}get odd(){return!this.even}},jT=(()=>{class n{_viewContainer;_template;_differs;set ngForOf(e){this._ngForOf=e,this._ngForOfDirty=!0}set ngForTrackBy(e){this._trackByFn=e}get ngForTrackBy(){return this._trackByFn}_ngForOf=null;_ngForOfDirty=!0;_differ=null;_trackByFn;constructor(e,t,s){this._viewContainer=e,this._template=t,this._differs=s}set ngForTemplate(e){e&&(this._template=e)}ngDoCheck(){if(this._ngForOfDirty){this._ngForOfDirty=!1;let e=this._ngForOf;!this._differ&&e&&(this._differ=this._differs.find(e).create(this.ngForTrackBy))}if(this._differ){let e=this._differ.diff(this._ngForOf);e&&this._applyChanges(e)}}_applyChanges(e){let t=this._viewContainer;e.forEachOperation((s,a,o)=>{if(s.previousIndex==null)t.createEmbeddedView(this._template,new Go(s.item,this._ngForOf,-1,-1),o===null?void 0:o);else if(o==null)t.remove(a===null?void 0:a);else if(a!==null){let u=t.get(a);t.move(u,o),GT(u,s)}});for(let s=0,a=t.length;s<a;s++){let u=t.get(s).context;u.index=s,u.count=a,u.ngForOf=this._ngForOf}e.forEachIdentityChange(s=>{let a=t.get(s.currentIndex);GT(a,s)})}static ngTemplateContextGuard(e,t){return!0}static \u0275fac=function(t){return new(t||n)(nt(Gn),nt(Ii),nt(xT))};static \u0275dir=Ht({type:n,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"}})}return n})();function GT(n,i){n.context.$implicit=i.item}var qk=(()=>{class n{_viewContainer;_context=new Wo;_thenTemplateRef=null;_elseTemplateRef=null;
vendor: 4,831 bytes, line 1
1_thenViewRef=null;_elseViewRef=null;constructor(e,t){this._viewContainer=e,this._thenTemplateRef=t}set ngIf(e){this._context.$implicit=this._context.ngIf=e,this._updateView()}set ngIfThen(e){WT(e,!1),this._thenTemplateRef=e,this._thenViewRef=null,this._updateView()}set ngIfElse(e){WT(e,!1),this._elseTemplateRef=e,this._elseViewRef=null,this._updateView()}_updateView(){this._context.$implicit?this._thenViewRef||(this._viewContainer.clear(),this._elseViewRef=null,this._thenTemplateRef&&(this._thenViewRef=this._viewContainer.createEmbeddedView(this._thenTemplateRef,this._context))):this._elseViewRef||(this._viewContainer.clear(),this._thenViewRef=null,this._elseTemplateRef&&(this._elseViewRef=this._viewContainer.createEmbeddedView(this._elseTemplateRef,this._context)))}static ngIfUseIfTypeGuard;static ngTemplateGuard_ngIf;static ngTemplateContextGuard(e,t){return!0}static \u0275fac=function(t){return new(t||n)(nt(Gn),nt(Ii))};static \u0275dir=Ht({type:n,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"}})}return n})(),Wo=class{$implicit=null;ngIf=null};function WT(n,i){if(n&&!n.createEmbeddedView)throw new Ve(2020,!1)}var jo=class{_viewContainerRef;_templateRef;_created=!1;constructor(i,e){this._viewContainerRef=i,this._templateRef=e}create(){this._created=!0,this._viewContainerRef.createEmbeddedView(this._templateRef)}destroy(){this._created=!1,this._viewContainerRef.clear()}enforceState(i){i&&!this._created?this.create():!i&&this._created&&this.destroy()}},yh=(()=>{class n{_defaultViews=[];_defaultUsed=!1;_caseCount=0;_lastCaseCheckIndex=0;_lastCasesMatched=!1;_ngSwitch;set ngSwitch(e){this._ngSwitch=e,this._caseCount===0&&this._updateDefaultCases(!0)}_addCase(){return this._caseCount++}_addDefault(e){this._defaultViews.push(e)}_matchCase(e){let t=e===this._ngSwitch;return this._lastCasesMatched||=t,this._lastCaseCheckIndex++,this._lastCaseCheckIndex===this._caseCount&&(this._updateDefaultCases(!this._lastCasesMatched),this._lastCaseCheckIndex=0,this._lastCasesMatched=!1),t}_updateDefaultCases(e){if(this._defaultViews.length>0&&e!==this._defaultUsed){this._defaultUsed=e;for(let t of this._defaultViews)t.enforceState(e)}}static \u0275fac=function(t){return new(t||n)};static \u0275dir=Ht({type:n,selectors:[["","ngSwitch",""]],inputs:{ngSwitch:"ngSwitch"}})}return n})(),Yk=(()=>{class n{ngSwitch;_view;ngSwitchCase;constructor(e,t,s){this.ngSwitch=s,s._addCase(),this._view=new jo(e,t)}ngDoCheck(){this._view.enforceState(this.ngSwitch._matchCase(this.ngSwitchCase))}static \u0275fac=function(t){return new(t||n)(nt(Gn),nt(Ii),nt(yh,9))};static \u0275dir=Ht({type:n,selectors:[["","ngSwitchCase",""]],inputs:{ngSwitchCase:"ngSwitchCase"}})}return n})(),$k=(()=>{class n{constructor(e,t,s){s._addDefault(new jo(e,t))}static \u0275fac=function(t){return new(t||n)(nt(Gn),nt(Ii),nt(yh,9))};static \u0275dir=Ht({type:n,selectors:[["","ngSwitchDefault",""]]})}return n})();var Lk=(()=>{class n{_ngEl;_differs;_renderer;_ngStyle=null;_differ=null;constructor(e,t,s){this._ngEl=e,this._differs=t,this._renderer=s}set ngStyle(e){this._ngStyle=e,!this._differ&&e&&(this._differ=this._differs.find(e).create())}ngDoCheck(){if(this._differ){let e=this._differ.diff(this._ngStyle);e&&this._applyChanges(e)}}_setStyle(e,t){let[s,a]=e.split("."),o=s.indexOf("-")===-1?void 0:Bi.DashCase;t!=null?this._renderer.setStyle(this._ngEl.nativeElement,s,a?`${t}${a}`:t,o):this._renderer.removeStyle(this._ngEl.nativeElement,s,o)}_applyChanges(e){e.forEachRemovedItem(t=>this._setStyle(t.key,null)),e.forEachAddedItem(t=>this._setStyle(t.key,t.currentValue)),e.forEachChangedItem(t=>this._setStyle(t.key,t.currentValue))}static \u0275fac=function(t){return new(t||n)(nt(Ys),nt(FT),nt(Vs))};static \u0275dir=Ht({type:n,selectors:[["","ngStyle",""]],inputs:{ngStyle:"ngStyle"}})}return n})(),Vk=(()=>{class n{_viewContainerRef;_viewRef=null;ngTemplateOutletContext=null;ngTemplateOutlet=null;ngTemplateOutletInjector=null;injector=ce(Hn);constructor(e){this._viewContainerRef=e}ngOnChanges(e){if(this._shouldRecreateView(e)){let t=this._viewContainerRef;if(this._viewRef&&t.remove(t.indexOf(this._viewRef)),!this.ngTemplateOutlet){this._viewRef=null;return}let s=this._createContextForwardProxy();this._viewRef=t.createEmbeddedView(this.ngTemplateOutlet,s,{injector:this._getInjector()})}}_getInjector(){return this.ngTemplateOutletInjector==="outlet"?this.injector:this.ngTemplateOutletInjector??void 0}_shouldRecreateView(e){return!!e.ngTemplateOutlet||!!e.ngTemplateOutletInjector}_createContextForwardProxy(){return new Proxy({},{set:(e,t,s)=>this.ngTemplateOutletContext?Reflect.set(this.ngTemplateOutletContext,t,s):!1,get:(e,t,s)=>{if(this.ngTemplateOutletContext)return Reflect.get(this.ngTemplateOutletContext,t,s)}})}static \u0275fac=function(t){return new(t||n)(nt(Gn))};
vendor: 34,379 bytes, lines 1-2
1static \u0275dir=Ht({type:n,selectors:[["","ngTemplateOutlet",""]],inputs:{ngTemplateOutletContext:"ngTemplateOutletContext",ngTemplateOutlet:"ngTemplateOutlet",ngTemplateOutletInjector:"ngTemplateOutletInjector"},features:[na]})}return n})();function zk(n,i){return new Ve(2100,!1)}var Dh=class{createSubscription(i,e,t){return zo(()=>i.subscribe({next:e,error:t}))}dispose(i){zo(()=>i.unsubscribe())}},vh=class{createSubscription(i,e,t){return i.then(s=>e?.(s),s=>t?.(s)),{unsubscribe:()=>{e=null,t=null}}}dispose(i){i.unsubscribe()}},Uk=new vh,Bk=new Dh,Hk=(()=>{class n{_ref;_latestValue=null;markForCheckOnValueUpdate=!0;_subscription=null;_obj=null;_strategy=null;applicationErrorHandler=ce(dT);constructor(e){this._ref=e}ngOnDestroy(){this._subscription&&this._dispose(),this._ref=null}transform(e){if(!this._obj){if(e)try{this.markForCheckOnValueUpdate=!1,this._subscribe(e)}finally{this.markForCheckOnValueUpdate=!0}return this._latestValue}return e!==this._obj?(this._dispose(),this.transform(e)):this._latestValue}_subscribe(e){this._obj=e,this._strategy=this._selectStrategy(e),this._subscription=this._strategy.createSubscription(e,t=>this._updateLatestValue(e,t),t=>this.applicationErrorHandler(t))}_selectStrategy(e){if(MT(e))return Uk;if(NT(e))return Bk;throw zk(n,e)}_dispose(){this._strategy.dispose(this._subscription),this._latestValue=null,this._subscription=null,this._obj=null}_updateLatestValue(e,t){e===this._obj&&(this._latestValue=t,this.markForCheckOnValueUpdate&&this._ref?.markForCheck())}static \u0275fac=function(t){return new(t||n)(nt(zs,16))};static \u0275pipe=ia({name:"async",type:n,pure:!1})}return n})();var JT=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Hi({type:n});static \u0275inj=Vi({})}return n})();function ra(n,i){i=encodeURIComponent(i);for(let e of n.split(";")){let t=e.indexOf("="),[s,a]=t==-1?[e,""]:[e.slice(0,t),e.slice(t+1)];if(s.trim()===i)return decodeURIComponent(a)}return null}var Gi=class{};var Eh="browser",jk="server";function D4(n){return n===Eh}function KT(n){return n===jk}var v4=(()=>{class n{static \u0275prov=be({token:n,providedIn:"root",factory:()=>new bh(ce(Qe),window)})}return n})(),bh=class{document;window;offset=()=>[0,0];constructor(i,e){this.document=i,this.window=e}setOffset(i){Array.isArray(i)?this.offset=()=>i:this.offset=i}getScrollPosition(){return[this.window.scrollX,this.window.scrollY]}scrollToPosition(i,e){this.window.scrollTo(pn(_e({},e),{left:i[0],top:i[1]}))}scrollToAnchor(i,e){let t=Jk(this.document,i);t&&(this.scrollToElement(t,e),t.focus({preventScroll:!0}))}setHistoryScrollRestoration(i){try{this.window.history.scrollRestoration=i}catch{console.warn(qs(2400,!1))}}scrollToElement(i,e){let t=i.getBoundingClientRect(),s=t.left+this.window.pageXOffset,a=t.top+this.window.pageYOffset,o=this.offset();this.window.scrollTo(pn(_e({},e),{left:s-o[0],top:a-o[1]}))}};function Jk(n,i){let e=n.getElementById(i)||n.getElementsByName(i)[0];if(e)return e;if(typeof n.createTreeWalker=="function"&&n.body&&typeof n.body.attachShadow=="function"){let t=n.createTreeWalker(n.body,NodeFilter.SHOW_ELEMENT),s=t.currentNode;for(;s;){let a=s.shadowRoot;if(a){let o=a.getElementById(i)||a.querySelector(`[name="${i}"]`);if(o)return o}s=t.nextNode()}}return null}var aa=class{_doc;constructor(i){this._doc=i}manager},Jo=(()=>{class n extends aa{constructor(e){super(e)}supports(e){return!0}addEventListener(e,t,s,a){return e.addEventListener(t,s,a),()=>this.removeEventListener(e,t,s,a)}removeEventListener(e,t,s,a){return e.removeEventListener(t,s,a)}static \u0275fac=function(t){return new(t||n)(ge(Qe))};static \u0275prov=be({token:n,factory:n.\u0275fac})}return n})(),Xo=new Ce(""),Oh=(()=>{class n{_zone;_plugins;_eventNameToPlugin=new Map;constructor(e,t){this._zone=t,e.forEach(o=>{o.manager=this});let s=e.filter(o=>!(o instanceof Jo));this._plugins=s.slice().reverse();let a=e.find(o=>o instanceof Jo);a&&this._plugins.push(a)}addEventListener(e,t,s,a){return this._findPluginFor(t).addEventListener(e,t,s,a)}getZone(){return this._zone}_findPluginFor(e){let t=this._eventNameToPlugin.get(e);if(t)return t;if(t=this._plugins.find(a=>a.supports(e)),!t)throw new Ve(5101,!1);return this._eventNameToPlugin.set(e,t),t}static \u0275fac=function(t){return new(t||n)(ge(Xo),ge(ta))};static \u0275prov=be({token:n,factory:n.\u0275fac})}return n})(),wh="ng-app-id";function ZT(n){for(let i of n)i.remove()}function XT(n,i){let e=i.createElement("style");return e.textContent=n,e}function Kk(n,i,e,t){let s=n.head?.querySelectorAll(`style[${wh}="${i}"],link[${wh}="${i}"]`);if(s)for(let a of s)a.removeAttribute(wh),a instanceof HTMLLinkElement?t.set(a.href.slice(a.href.lastIndexOf("/")+1),{usage:0,elements:[a]}):a.textContent&&e.set(a.textContent,{usage:0,elements:[a]})}function Th(n,i){let e=i.createElement("link");return e.setAttribute("rel","stylesheet"),e.setAttribute("href",n),e}var Rh=(()=>{class n{doc;appId;nonce;inline=new Map;external=new Map;hosts=new Set;constructor(e,t,s,a={}){this.doc=e,this.appId=t,this.nonce=s,Kk(e,t,this.inline,this.external),this.hosts.add(e.head)}addStyles(e,t){for(let s of e)this.addUsage(s,this.inline,XT);t?.forEach(s=>this.addUsage(s,this.external,Th))}removeStyles(e,t){for(let s of e)this.removeUsage(s,this.inline);t?.forEach(s=>this.removeUsage(s,this.external))}addUsage(e,t,s){let a=t.get(e);a?a.usage++:t.set(e,{usage:1,elements:[...this.hosts].map(o=>this.addElement(o,s(e,this.doc)))})}removeUsage(e,t){let s=t.get(e);s&&(s.usage--,s.usage<=0&&(ZT(s.elements),t.delete(e)))}ngOnDestroy(){for(let[,{elements:e}]of[...this.inline,...this.external])ZT(e);this.hosts.clear()}addHost(e){this.hosts.add(e);for(let[t,{elements:s}]of this.inline)s.push(this.addElement(e,XT(t,this.doc)));for(let[t,{elements:s}]of this.external)s.push(this.addElement(e,Th(t,this.doc)))}removeHost(e){this.hosts.delete(e)}addElement(e,t){return this.nonce&&t.setAttribute("nonce",this.nonce),e.appendChild(t)}static \u0275fac=function(t){return new(t||n)(ge(Qe),ge(fh),ge($o,8),ge($s))};static \u0275prov=be({token:n,factory:n.\u0275fac})}return n})(),Sh={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/",math:"http://www.w3.org/1998/Math/MathML"},Mh=/%COMP%/g;var eO="%COMP%",Zk=`_nghost-${eO}`,Xk=`_ngcontent-${eO}`,Qk=!0,e1=new Ce("",{factory:()=>Qk});function t1(n){return Xk.replace(Mh,n)}function n1(n){return Zk.replace(Mh,n)}function tO(n,i){return i.map(e=>e.replace(Mh,n))}var Nh=(()=>{class n{eventManager;sharedStylesHost;appId;removeStylesOnCompDestroy;doc;ngZone;nonce;tracingService;rendererByCompId=new Map;defaultRenderer;constructor(e,t,s,a,o,u,c=null,l=null){this.eventManager=e,this.sharedStylesHost=t,this.appId=s,this.removeStylesOnCompDestroy=a,this.doc=o,this.ngZone=u,this.nonce=c,this.tracingService=l,this.defaultRenderer=new oa(e,o,u,this.tracingService)}createRenderer(e,t){if(!e||!t)return this.defaultRenderer;let s=this.getOrCreateRenderer(e,t);return s instanceof Zo?s.applyToHost(e):s instanceof ua&&s.applyStyles(),s}getOrCreateRenderer(e,t){let s=this.rendererByCompId,a=s.get(t.id);if(!a){let o=this.doc,u=this.ngZone,c=this.eventManager,l=this.sharedStylesHost,h=this.removeStylesOnCompDestroy,p=this.tracingService;switch(t.encapsulation){case Lo.Emulated:a=new Zo(c,l,t,this.appId,h,o,u,p);break;case Lo.ShadowDom:return new Ko(c,e,t,o,u,this.nonce,p,l);case Lo.ExperimentalIsolatedShadowDom:return new Ko(c,e,t,o,u,this.nonce,p);default:a=new ua(c,l,t,h,o,u,p);break}s.set(t.id,a)}return a}ngOnDestroy(){this.rendererByCompId.clear()}componentReplaced(e){this.rendererByCompId.delete(e)}static \u0275fac=function(t){return new(t||n)(ge(Oh),ge(Rh),ge(fh),ge(e1),ge(Qe),ge(ta),ge($o),ge(Vo,8))};static \u0275prov=be({token:n,factory:n.\u0275fac})}return n})(),oa=class{eventManager;doc;ngZone;tracingService;data=Object.create(null);throwOnSyntheticProps=!0;constructor(i,e,t,s){this.eventManager=i,this.doc=e,this.ngZone=t,this.tracingService=s}destroy(){}destroyNode=null;createElement(i,e){return e?this.doc.createElementNS(Sh[e]||e,i):this.doc.createElement(i)}createComment(i){return this.doc.createComment(i)}createText(i){return this.doc.createTextNode(i)}appendChild(i,e){(QT(i)?i.content:i).appendChild(e)}insertBefore(i,e,t){i&&(QT(i)?i.content:i).insertBefore(e,t)}removeChild(i,e){e.remove()}selectRootElement(i,e){let t=typeof i=="string"?this.doc.querySelector(i):i;if(!t)throw new Ve(-5104,!1);return e||(t.textContent=""),t}parentNode(i){return i.parentNode}nextSibling(i){return i.nextSibling}setAttribute(i,e,t,s){if(s){e=s+":"+e;let a=Sh[s];a?i.setAttributeNS(a,e,t):i.setAttribute(e,t)}else i.setAttribute(e,t)}removeAttribute(i,e,t){if(t){let s=Sh[t];s?i.removeAttributeNS(s,e):i.removeAttribute(`${t}:${e}`)}else i.removeAttribute(e)}addClass(i,e){i.classList.add(e)}removeClass(i,e){i.classList.remove(e)}setStyle(i,e,t,s){s&(Bi.DashCase|Bi.Important)?i.style.setProperty(e,t,s&Bi.Important?"important":""):i.style[e]=t}removeStyle(i,e,t){t&Bi.DashCase?i.style.removeProperty(e):i.style[e]=""}setProperty(i,e,t){i!=null&&(i[e]=t)}setValue(i,e){i.nodeValue=e}listen(i,e,t,s){if(typeof i=="string"&&(i=mn().getGlobalEventTarget(this.doc,i),!i))throw new Ve(5102,!1);let a=this.decoratePreventDefault(t);return this.tracingService?.wrapEventListener&&(a=this.tracingService.wrapEventListener(i,e,a)),this.eventManager.addEventListener(i,e,a,s)}decoratePreventDefault(i){return e=>{if(e==="__ngUnwrap__")return i;i(e)===!1&&e.preventDefault()}}};function QT(n){return n.tagName==="TEMPLATE"&&n.content!==void 0}var Ko=class extends oa{hostEl;sharedStylesHost;shadowRoot;constructor(i,e,t,s,a,o,u,c){super(i,s,a,u),this.hostEl=e,this.sharedStylesHost=c,this.shadowRoot=e.attachShadow({mode:"open"}),this.sharedStylesHost&&this.sharedStylesHost.addHost(this.shadowRoot);let l=t.styles;l=tO(t.id,l);for(let p of l){let I=document.createElement("style");o&&I.setAttribute("nonce",o),I.textContent=p,this.shadowRoot.appendChild(I)}let h=t.getExternalStyles?.();if(h)for(let p of h){let I=Th(p,s);o&&I.setAttribute("nonce",o),this.shadowRoot.appendChild(I)}}nodeOrShadowRoot(i){return i===this.hostEl?this.shadowRoot:i}appendChild(i,e){return super.appendChild(this.nodeOrShadowRoot(i),e)}insertBefore(i,e,t){return super.insertBefore(this.nodeOrShadowRoot(i),e,t)}removeChild(i,e){return super.removeChild(null,e)}parentNode(i){return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(i)))}destroy(){this.sharedStylesHost&&this.sharedStylesHost.removeHost(this.shadowRoot)}},ua=class extends oa{sharedStylesHost;removeStylesOnCompDestroy;styles;styleUrls;constructor(i,e,t,s,a,o,u,c){super(i,a,o,u),this.sharedStylesHost=e,this.removeStylesOnCompDestroy=s;let l=t.styles;this.styles=c?tO(c,l):l,this.styleUrls=t.getExternalStyles?.(c)}applyStyles(){this.sharedStylesHost.addStyles(this.styles,this.styleUrls)}destroy(){this.removeStylesOnCompDestroy&&wT.size===0&&this.sharedStylesHost.removeStyles(this.styles,this.styleUrls)}},Zo=class extends ua{contentAttr;hostAttr;constructor(i,e,t,s,a,o,u,c){let l=s+"-"+t.id;super(i,e,t,a,o,u,c,l),this.contentAttr=t1(l),this.hostAttr=n1(l)}applyToHost(i){this.applyStyles(),this.setAttribute(i,this.hostAttr,"")}createElement(i,e){let t=super.createElement(i,e);return super.setAttribute(t,this.contentAttr,""),t}};var Qo=class n extends sa{supportsDOMEvents=!0;static makeCurrent(){mh(new n)}onAndCancel(i,e,t,s){return i.addEventListener(e,t,s),()=>{i.removeEventListener(e,t,s)}}dispatchEvent(i,e){i.dispatchEvent(e)}remove(i){i.remove()}createElement(i,e){return e=e||this.getDefaultDocument(),e.createElement(i)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(i){return i.nodeType===Node.ELEMENT_NODE}isShadowRoot(i){return i instanceof DocumentFragment}getGlobalEventTarget(i,e){return e==="window"?window:e==="document"?i:e==="body"?i.body:null}getBaseHref(i){let e=s1();return e==null?null:r1(e)}resetBaseElement(){ca=null}getUserAgent(){return window.navigator.userAgent}getCookie(i){return ra(document.cookie,i)}},ca=null;function s1(){return ca=ca||document.head.querySelector("base"),ca?ca.getAttribute("href"):null}function r1(n){return new URL(n,document.baseURI).pathname}var a1=(()=>{class n{build(){return new XMLHttpRequest}static \u0275fac=function(t){return new(t||n)};static \u0275prov=be({token:n,factory:n.\u0275fac})}return n})(),nO=["alt","control","meta","shift"],o1={"\b":"Backspace"," ":"Tab","\x7F":"Delete","\x1B":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},u1={alt:n=>n.altKey,control:n=>n.ctrlKey,meta:n=>n.metaKey,shift:n=>n.shiftKey},iO=(()=>{class n extends aa{constructor(e){super(e)}supports(e){return n.parseEventName(e)!=null}addEventListener(e,t,s,a){let o=n.parseEventName(t),u=n.eventCallback(o.fullKey,s,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>mn().onAndCancel(e,o.domEventName,u,a))}static parseEventName(e){let t=e.toLowerCase().split("."),s=t.shift();if(t.length===0||!(s==="keydown"||s==="keyup"))return null;let a=n._normalizeKey(t.pop()),o="",u=t.indexOf("code");if(u>-1&&(t.splice(u,1),o="code."),nO.forEach(l=>{let h=t.indexOf(l);h>-1&&(t.splice(h,1),o+=l+".")}),o+=a,t.length!=0||a.length===0)return null;let c={};return c.domEventName=s,c.fullKey=o,c}static matchEventFullKeyCode(e,t){let s=o1[e.key]||e.key,a="";return t.indexOf("code.")>-1&&(s=e.code,a="code."),s==null||!s?!1:(s=s.toLowerCase(),s===" "?s="space":s==="."&&(s="dot"),nO.forEach(o=>{if(o!==s){let u=u1[o];u(e)&&(a+=o+".")}}),a+=s,a===t)}static eventCallback(e,t,s){return a=>{n.matchEventFullKeyCode(a,e)&&s.runGuarded(()=>t(a))}}static _normalizeKey(e){return e==="esc"?"escape":e}static \u0275fac=function(t){return new(t||n)(ge(Qe))};static \u0275prov=be({token:n,factory:n.\u0275fac})}return n})();async function c1(n,i,e){let t=_e({rootComponent:n},l1(i,e));return qT(t)}function l1(n,i){return{platformRef:i?.platformRef,appProviders:[...g1,...n?.providers??[]],platformProviders:p1}}function d1(){Qo.makeCurrent()}function h1(){return new hh}function f1(){return hT(document),document}var p1=[{provide:$s,useValue:Eh},{provide:fT,useValue:d1,multi:!0},{provide:Qe,useFactory:f1}];var g1=[{provide:lT,useValue:"root"},{provide:hh,useFactory:h1},{provide:Xo,useClass:Jo,multi:!0},{provide:Xo,useClass:iO,multi:!0},Nh,Rh,Oh,{provide:ST,useExisting:Nh},{provide:Gi,useClass:a1},[]];var un=class n{headers;normalizedNames=new Map;lazyInit;lazyUpdate=null;constructor(i){i?typeof i=="string"?this.lazyInit=()=>{this.headers=new Map,i.split(` 2`).forEach(e=>{let t=e.indexOf(":");if(t>0){let s=e.slice(0,t),a=e.slice(t+1).trim();this.addHeaderEntry(s,a)}})}:typeof Headers<"u"&&i instanceof Headers?(this.headers=new Map,i.forEach((e,t)=>{this.addHeaderEntry(t,e)})):this.lazyInit=()=>{this.headers=new Map,Object.entries(i).forEach(([e,t])=>{this.setHeaderEntries(e,t)})}:this.headers=new Map}has(i){return this.init(),this.headers.has(i.toLowerCase())}get(i){this.init();let e=this.headers.get(i.toLowerCase());return e&&e.length>0?e[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(i){return this.init(),this.headers.get(i.toLowerCase())||null}append(i,e){return this.clone({name:i,value:e,op:"a"})}set(i,e){return this.clone({name:i,value:e,op:"s"})}delete(i,e){return this.clone({name:i,value:e,op:"d"})}maybeSetNormalizedName(i,e){this.normalizedNames.has(e)||this.normalizedNames.set(e,i)}init(){this.lazyInit&&(this.lazyInit instanceof n?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(i=>this.applyUpdate(i)),this.lazyUpdate=null))}copyFrom(i){i.init(),Array.from(i.headers.keys()).forEach(e=>{this.headers.set(e,i.headers.get(e)),this.normalizedNames.set(e,i.normalizedNames.get(e))})}clone(i){let e=new n;return e.lazyInit=this.lazyInit&&this.lazyInit instanceof n?this.lazyInit:this,e.lazyUpdate=(this.lazyUpdate||[]).concat([i]),e}applyUpdate(i){let e=i.name.toLowerCase();switch(i.op){case"a":case"s":let t=i.value;if(typeof t=="string"&&(t=[t]),t.length===0)return;this.maybeSetNormalizedName(i.name,e);let s=(i.op==="a"?this.headers.get(e):void 0)||[];s.push(...t),this.headers.set(e,s);break;case"d":let a=i.value;if(!a)this.headers.delete(e),this.normalizedNames.delete(e);else{let o=this.headers.get(e);if(!o)return;o=o.filter(u=>a.indexOf(u)===-1),o.length===0?(this.headers.delete(e),this.normalizedNames.delete(e)):this.headers.set(e,o)}break}}addHeaderEntry(i,e){let t=i.toLowerCase();this.maybeSetNormalizedName(i,t),this.headers.has(t)?this.headers.get(t).push(e):this.headers.set(t,[e])}setHeaderEntries(i,e){let t=(Array.isArray(e)?e:[e]).map(a=>a.toString()),s=i.toLowerCase();this.headers.set(s,t),this.maybeSetNormalizedName(i,s)}forEach(i){this.init(),Array.from(this.normalizedNames.keys()).forEach(e=>i(this.normalizedNames.get(e),this.headers.get(e)))}};var nu=class{map=new Map;set(i,e){return this.map.set(i,e),this}get(i){return this.map.has(i)||this.map.set(i,i.defaultValue()),this.map.get(i)}delete(i){return this.map.delete(i),this}has(i){return this.map.has(i)}keys(){return this.map.keys()}},iu=class{encodeKey(i){return sO(i)}encodeValue(i){return sO(i)}decodeKey(i){return decodeURIComponent(i)}decodeValue(i){return decodeURIComponent(i)}};function m1(n,i){let e=new Map;return n.length>0&&n.replace(/^\?/,"").split("&").forEach(s=>{let a=s.indexOf("="),[o,u]=a==-1?[i.decodeKey(s),""]:[i.decodeKey(s.slice(0,a)),i.decodeValue(s.slice(a+1))],c=e.get(o)||[];c.push(u),e.set(o,c)}),e}var I1=/%(\d[a-f0-9])/gi,D1={40:"@","3A":":",24:"$","2C":",","3B":";","3D":"=","3F":"?","2F":"/"};function sO(n){return encodeURIComponent(n).replace(I1,(i,e)=>D1[e]??i)}function eu(n){return`${n}`}var Wn=class n{map;encoder;updates=null;cloneFrom=null;constructor(i={}){if(this.encoder=i.encoder||new iu,i.fromString){if(i.fromObject)throw new Ve(2805,!1);this.map=m1(i.fromString,this.encoder)}else i.fromObject?(this.map=new Map,Object.keys(i.fromObject).forEach(e=>{let t=i.fromObject[e],s=Array.isArray(t)?t.map(eu):[eu(t)];this.map.set(e,s)})):this.map=null}has(i){return this.init(),this.map.has(i)}get(i){this.init();let e=this.map.get(i);return e?e[0]:null}getAll(i){return this.init(),this.map.get(i)||null}keys(){return this.init(),Array.from(this.map.keys())}append(i,e){return this.clone({param:i,value:e,op:"a"})}appendAll(i){let e=[];return Object.keys(i).forEach(t=>{let s=i[t];Array.isArray(s)?s.forEach(a=>{e.push({param:t,value:a,op:"a"})}):e.push({param:t,value:s,op:"a"})}),this.clone(e)}set(i,e){return this.clone({param:i,value:e,op:"s"})}delete(i,e){return this.clone({param:i,value:e,op:"d"})}toString(){return this.init(),this.keys().map(i=>{let e=this.encoder.encodeKey(i);return this.map.get(i).map(t=>e+"="+this.encoder.encodeValue(t)).join("&")}).filter(i=>i!=="").join("&")}clone(i){let e=new n({encoder:this.encoder});return e.cloneFrom=this.cloneFrom||this,e.updates=(this.updates||[]).concat(i),e}init(){this.map===null&&(this.map=new Map),this.cloneFrom!==null&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(i=>this.map.set(i,this.cloneFrom.map.get(i))),this.updates.forEach(i=>{switch(i.op){case"a":case"s":let e=(i.op==="a"?this.map.get(i.param):void 0)||[];e.push(eu(i.value)),this.map.set(i.param,e);break;case"d":if(i.value!==void 0){let t=this.map.get(i.param)||[],s=t.indexOf(eu(i.value));s!==-1&&t.splice(s,1),t.length>0?this.map.set(i.param,t):this.map.delete(i.param)}else{this.map.delete(i.param);break}}}),this.cloneFrom=this.updates=null)}};function v1(n){switch(n){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}function rO(n){return typeof ArrayBuffer<"u"&&n instanceof ArrayBuffer}function aO(n){return typeof Blob<"u"&&n instanceof Blob}function oO(n){return typeof FormData<"u"&&n instanceof FormData}function y1(n){return typeof URLSearchParams<"u"&&n instanceof URLSearchParams}var la="Content-Type",su="Accept",uO="text/plain",cO="application/json",lO=`${cO}, ${uO}, */*`,Bs=class n{url;body=null;headers;context;reportProgress=!1;withCredentials=!1;credentials;keepalive=!1;cache;priority;mode;redirect;referrer;integrity;referrerPolicy;responseType="json";method;params;urlWithParams;transferCache;timeout;constructor(i,e,t,s){this.url=e,this.method=i.toUpperCase();let a;if(v1(this.method)||s?(this.body=t!==void 0?t:null,a=s):a=t,a){if(this.reportProgress=!!a.reportProgress,this.withCredentials=!!a.withCredentials,this.keepalive=!!a.keepalive,a.responseType&&(this.responseType=a.responseType),a.headers&&(this.headers=a.headers),a.context&&(this.context=a.context),a.params&&(this.params=a.params),a.priority&&(this.priority=a.priority),a.cache&&(this.cache=a.cache),a.credentials&&(this.credentials=a.credentials),typeof a.timeout=="number"){if(a.timeout<1||!Number.isInteger(a.timeout))throw new Ve(2822,"");this.timeout=a.timeout}a.mode&&(this.mode=a.mode),a.redirect&&(this.redirect=a.redirect),a.integrity&&(this.integrity=a.integrity),a.referrer!==void 0&&(this.referrer=a.referrer),a.referrerPolicy&&(this.referrerPolicy=a.referrerPolicy),this.transferCache=a.transferCache}if(this.headers??=new un,this.context??=new nu,!this.params)this.params=new Wn,this.urlWithParams=e;else{let o=this.params.toString();if(o.length===0)this.urlWithParams=e;else{let u=e.indexOf("?"),c=u===-1?"?":u<e.length-1?"&":"";this.urlWithParams=e+c+o}}}serializeBody(){return this.body===null?null:typeof this.body=="string"||rO(this.body)||aO(this.body)||oO(this.body)||y1(this.body)?this.body:this.body instanceof Wn?this.body.toString():typeof this.body=="object"||typeof this.body=="boolean"||Array.isArray(this.body)?JSON.stringify(this.body):this.body.toString()}detectContentTypeHeader(){return this.body===null||oO(this.body)?null:aO(this.body)?this.body.type||null:rO(this.body)?null:typeof this.body=="string"?uO:this.body instanceof Wn?"application/x-www-form-urlencoded;charset=UTF-8":typeof this.body=="object"||typeof this.body=="number"||typeof this.body=="boolean"?cO:null}clone(i={}){let e=i.method||this.method,t=i.url||this.url,s=i.responseType||this.responseType,a=i.keepalive??this.keepalive,o=i.priority||this.priority,u=i.cache||this.cache,c=i.mode||this.mode,l=i.redirect||this.redirect,h=i.credentials||this.credentials,p=i.referrer??this.referrer,I=i.integrity||this.integrity,v=i.referrerPolicy||this.referrerPolicy,E=i.transferCache??this.transferCache,w=i.timeout??this.timeout,S=i.body!==void 0?i.body:this.body,R=i.withCredentials??this.withCredentials,x=i.reportProgress??this.reportProgress,N=i.headers||this.headers,O=i.params||this.params,A=i.context??this.context;return i.setHeaders!==void 0&&(N=Object.keys(i.setHeaders).reduce((M,C)=>M.set(C,i.setHeaders[C]),N)),i.setParams&&(O=Object.keys(i.setParams).reduce((M,C)=>M.set(C,i.setParams[C]),O)),new n(e,t,S,{params:O,headers:N,context:A,reportProgress:x,responseType:s,withCredentials:R,transferCache:E,keepalive:a,cache:u,priority:o,timeout:w,mode:c,redirect:l,credentials:h,referrer:p,integrity:I,referrerPolicy:v})}},jn=(function(n){return n[n.Sent=0]="Sent",n[n.UploadProgress=1]="UploadProgress",n[n.ResponseHeader=2]="ResponseHeader",n[n.DownloadProgress=3]="DownloadProgress",n[n.Response=4]="Response",n[n.User=5]="User",n})(jn||{}),Hs=class{headers;status;statusText;url;ok;type;redirected;responseType;constructor(i,e=200,t="OK"){this.headers=i.headers||new un,this.status=i.status!==void 0?i.status:e,this.statusText=i.statusText||t,this.url=i.url||null,this.redirected=i.redirected,this.responseType=i.responseType,this.ok=this.status>=200&&this.status<300}},da=class n extends Hs{constructor(i={}){super(i)}type=jn.ResponseHeader;clone(i={}){return new n({headers:i.headers||this.headers,status:i.status!==void 0?i.status:this.status,statusText:i.statusText||this.statusText,url:i.url||this.url||void 0})}},Wi=class n extends Hs{body;constructor(i={}){super(i),this.body=i.body!==void 0?i.body:null}type=jn.Response;clone(i={}){return new n({body:i.body!==void 0?i.body:this.body,headers:i.headers||this.headers,status:i.status!==void 0?i.status:this.status,statusText:i.statusText||this.statusText,url:i.url||this.url||void 0,redirected:i.redirected??this.redirected,responseType:i.responseType??this.responseType})}},Dn=class extends Hs{name="HttpErrorResponse";message;error;ok=!1;constructor(i){super(i,0,"Unknown Error"),this.status>=200&&this.status<300?this.message=`Http failure during parsing for ${i.url||"(unknown url)"}`:this.message=`Http failure response for ${i.url||"(unknown url)"}: ${i.status} ${i.statusText}`,this.error=i.error||null}},dO=200,b1=204;var E1=/^\)\]\}',?\n/,hO=new Ce(""),tu=(()=>{class n{fetchImpl=ce(Ah,{optional:!0})?.fetch??((...e)=>globalThis.fetch(...e));ngZone=ce(ta);destroyRef=ce(gn);handle(e){return new Fs(t=>{let s=new AbortController;this.doRequest(e,s.signal,t).then(Ch,o=>t.error(new Dn({error:o})));let a;return e.timeout&&(a=this.ngZone.runOutsideAngular(()=>setTimeout(()=>{s.signal.aborted||s.abort(new DOMException("signal timed out","TimeoutError"))},e.timeout))),()=>{a!==void 0&&clearTimeout(a),s.abort()}})}async doRequest(e,t,s){let a=this.createRequestInit(e),o;try{let w=this.ngZone.runOutsideAngular(()=>this.fetchImpl(e.urlWithParams,_e({signal:t},a)));w1(w),s.next({type:jn.Sent}),o=await w}catch(w){s.error(new Dn({error:w,status:w.status??0,statusText:w.statusText,url:e.urlWithParams,headers:w.headers}));return}let u=new un(o.headers),c=o.statusText,l=o.url||e.urlWithParams,h=o.status,p=null;if(e.reportProgress&&s.next(new da({headers:u,status:h,statusText:c,url:l})),o.body){let w=o.headers.get("content-length"),S=[],R=o.body.getReader(),x=0,N,O,A=typeof Zone<"u"&&Zone.current,M=!1;if(await this.ngZone.runOutsideAngular(async()=>{for(;;){if(this.destroyRef.destroyed){await R.cancel(),M=!0;break}let{done:H,value:B}=await R.read();if(H)break;if(S.push(B),x+=B.length,e.reportProgress){O=e.responseType==="text"?(O??"")+(N??=new TextDecoder).decode(B,{stream:!0}):void 0;let U=()=>s.next({type:jn.DownloadProgress,total:w?+w:void 0,loaded:x,partialText:O});A?A.run(U):U()}}}),M){s.complete();return}let C=this.concatChunks(S,x);try{let H=o.headers.get(la)??"";p=this.parseBody(e,C,H,h)}catch(H){s.error(new Dn({error:H,headers:new un(o.headers),status:o.status,statusText:o.statusText,url:o.url||e.urlWithParams}));return}}h===0&&(h=p?dO:0);let I=h>=200&&h<300,v=o.redirected,E=o.type;I?(s.next(new Wi({body:p,headers:u,status:h,statusText:c,url:l,redirected:v,responseType:E})),s.complete()):s.error(new Dn({error:p,headers:u,status:h,statusText:c,url:l,redirected:v,responseType:E}))}parseBody(e,t,s,a){switch(e.responseType){case"json":let o=new TextDecoder().decode(t).replace(E1,"");if(o==="")return null;try{return JSON.parse(o)}catch(u){if(a<200||a>=300)return o;throw u}case"text":return new TextDecoder().decode(t);case"blob":return new Blob([t],{type:s});case"arraybuffer":return t.buffer}}createRequestInit(e){let t={},s;if(s=e.credentials,e.withCredentials&&(s="include"),e.headers.forEach((a,o)=>t[a]=o.join(",")),e.headers.has(su)||(t[su]=lO),!e.headers.has(la)){let a=e.detectContentTypeHeader();a!==null&&(t[la]=a)}return{body:e.serializeBody(),method:e.method,headers:t,credentials:s,keepalive:e.keepalive,cache:e.cache,priority:e.priority,mode:e.mode,redirect:e.redirect,referrer:e.referrer,integrity:e.integrity,referrerPolicy:e.referrerPolicy}}concatChunks(e,t){let s=new Uint8Array(t),a=0;for(let o of e)s.set(o,a),a+=o.length;return s}static \u0275fac=function(t){return new(t||n)};static \u0275prov=be({token:n,factory:n.\u0275fac})}return n})(),Ah=class{};function Ch(){}function w1(n){n.then(Ch,Ch)}var S1=/^\)\]\}',?\n/;var kh=(()=>{class n{xhrFactory;tracingService=ce(Vo,{optional:!0});constructor(e){this.xhrFactory=e}maybePropagateTrace(e){return this.tracingService?.propagate?this.tracingService.propagate(e):e}handle(e){if(e.method==="JSONP")throw new Ve(-2800,!1);let t=this.xhrFactory;return Bn(null).pipe(Li(()=>new Fs(a=>{let o=t.build();if(o.open(e.method,e.urlWithParams),e.withCredentials&&(o.withCredentials=!0),e.headers.forEach((S,R)=>o.setRequestHeader(S,R.join(","))),e.headers.has(su)||o.setRequestHeader(su,lO),!e.headers.has(la)){let S=e.detectContentTypeHeader();S!==null&&o.setRequestHeader(la,S)}if(e.timeout&&(o.timeout=e.timeout),e.responseType){let S=e.responseType.toLowerCase();o.responseType=S!=="json"?S:"text"}let u=e.serializeBody(),c=null,l=()=>{if(c!==null)return c;let S=o.statusText||"OK",R=new un(o.getAllResponseHeaders()),x=o.responseURL||e.url;return c=new da({headers:R,status:o.status,statusText:S,url:x}),c},h=this.maybePropagateTrace(()=>{let{headers:S,status:R,statusText:x,url:N}=l(),O=null;R!==b1&&(O=typeof o.response>"u"?o.responseText:o.response),R===0&&(R=O?dO:0);let A=R>=200&&R<300;if(e.responseType==="json"&&typeof O=="string"){let M=O;O=O.replace(S1,"");try{O=O!==""?JSON.parse(O):null}catch(C){O=M,A&&(A=!1,O={error:C,text:O})}}A?(a.next(new Wi({body:O,headers:S,status:R,statusText:x,url:N||void 0})),a.complete()):a.error(new Dn({error:O,headers:S,status:R,statusText:x,url:N||void 0}))}),p=this.maybePropagateTrace(S=>{let{url:R}=l(),x=new Dn({error:S,status:o.status||0,statusText:o.statusText||"Unknown Error",url:R||void 0});a.error(x)}),I=p;e.timeout&&(I=this.maybePropagateTrace(S=>{let{url:R}=l(),x=new Dn({error:new DOMException("Request timed out","TimeoutError"),status:o.status||0,statusText:o.statusText||"Request timeout",url:R||void 0});a.error(x)}));let v=!1,E=this.maybePropagateTrace(S=>{v||(a.next(l()),v=!0);let R={type:jn.DownloadProgress,loaded:S.loaded};S.lengthComputable&&(R.total=S.total),e.responseType==="text"&&o.responseText&&(R.partialText=o.responseText),a.next(R)}),w=this.maybePropagateTrace(S=>{let R={type:jn.UploadProgress,loaded:S.loaded};S.lengthComputable&&(R.total=S.total),a.next(R)});return o.addEventListener("load",h),o.addEventListener("error",p),o.addEventListener("timeout",I),o.addEventListener("abort",p),e.reportProgress&&(o.addEventListener("progress",E),u!==null&&o.upload&&o.upload.addEventListener("progress",w)),o.send(u),a.next({type:jn.Sent}),()=>{o.removeEventListener("error",p),o.removeEventListener("abort",p),o.removeEventListener("load",h),o.removeEventListener("timeout",I),e.reportProgress&&(o.removeEventListener("progress",E),u!==null&&o.upload&&o.upload.removeEventListener("progress",w)),o.readyState!==o.DONE&&o.abort()}})))}static \u0275fac=function(t){return new(t||n)(ge(Gi))};static \u0275prov=be({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function T1(n,i){return i(n)}function O1(n,i,e){return(t,s)=>dh(e,()=>i(t,a=>n(a,s)))}var fO=new Ce("",{factory:()=>[]}),_h=new Ce(""),pO=new Ce("",{factory:()=>!0});var au=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275prov=be({token:n,factory:function(t){let s=null;return t?s=new(t||n):s=ge(kh),s},providedIn:"root"})}return n})();var ru=(()=>{class n{backend;injector;chain=null;pendingTasks=ce(Yo);contributeToStability=ce(pO);constructor(e,t){this.backend=e,this.injector=t}handle(e){if(this.chain===null){let t=Array.from(new Set([...this.injector.get(fO),...this.injector.get(_h,[])]));this.chain=t.reduceRight((s,a)=>O1(s,a,this.injector),T1)}if(this.contributeToStability){let t=this.pendingTasks.add();return this.chain(e,s=>this.backend.handle(s)).pipe(rT(t))}else return this.chain(e,t=>this.backend.handle(t))}static \u0275fac=function(t){return new(t||n)(ge(au),ge(lh))};static \u0275prov=be({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),xh=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275prov=be({token:n,factory:function(t){let s=null;return t?s=new(t||n):s=ge(ru),s},providedIn:"root"})}return n})();function Ph(n,i){return{body:i,headers:n.headers,context:n.context,observe:n.observe,params:n.params,reportProgress:n.reportProgress,responseType:n.responseType,withCredentials:n.withCredentials,credentials:n.credentials,transferCache:n.transferCache,timeout:n.timeout,keepalive:n.keepalive,priority:n.priority,cache:n.cache,mode:n.mode,redirect:n.redirect,integrity:n.integrity,referrer:n.referrer,referrerPolicy:n.referrerPolicy}}var gO=(()=>{class n{handler;constructor(e){this.handler=e}request(e,t,s={}){let a;if(e instanceof Bs)a=e;else{let c;s.headers instanceof un?c=s.headers:c=new un(s.headers);let l;s.params&&(s.params instanceof Wn?l=s.params:l=new Wn({fromObject:s.params})),a=new Bs(e,t,s.body!==void 0?s.body:null,{headers:c,context:s.context,params:l,reportProgress:s.reportProgress,responseType:s.responseType||"json",withCredentials:s.withCredentials,transferCache:s.transferCache,keepalive:s.keepalive,priority:s.priority,cache:s.cache,mode:s.mode,redirect:s.redirect,credentials:s.credentials,referrer:s.referrer,referrerPolicy:s.referrerPolicy,integrity:s.integrity,timeout:s.timeout})}let o=Bn(a).pipe(iT(c=>this.handler.handle(c)));if(e instanceof Bs||s.observe==="events")return o;let u=o.pipe(tT(c=>c instanceof Wi));switch(s.observe||"body"){case"body":switch(a.responseType){case"arraybuffer":return u.pipe(rn(c=>{if(c.body!==null&&!(c.body instanceof ArrayBuffer))throw new Ve(2806,!1);return c.body}));case"blob":return u.pipe(rn(c=>{if(c.body!==null&&!(c.body instanceof Blob))throw new Ve(2807,!1);return c.body}));case"text":return u.pipe(rn(c=>{if(c.body!==null&&typeof c.body!="string")throw new Ve(2808,!1);return c.body}));default:return u.pipe(rn(c=>c.body))}case"response":return u;default:throw new Ve(2809,!1)}}delete(e,t={}){return this.request("DELETE",e,t)}get(e,t={}){return this.request("GET",e,t)}head(e,t={}){return this.request("HEAD",e,t)}jsonp(e,t){return this.request("JSONP",e,{params:new Wn().append(t,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(e,t={}){return this.request("OPTIONS",e,t)}patch(e,t,s={}){return this.request("PATCH",e,Ph(s,t))}post(e,t,s={}){return this.request("POST",e,Ph(s,t))}put(e,t,s={}){return this.request("PUT",e,Ph(s,t))}static \u0275fac=function(t){return new(t||n)(ge(xh))};static \u0275prov=be({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var R1=new Ce("",{factory:()=>!0}),M1="XSRF-TOKEN",N1=new Ce("",{factory:()=>M1}
2),P1="X-XSRF-TOKEN",A1=new Ce("",{factory:()=>P1}),C1=(()=>{class n{cookieName=ce(N1);doc=ce(Qe);lastCookieString="";lastToken=null;parseCount=0;getToken(){let e=this.doc.cookie||"";return e!==this.lastCookieString&&(this.parseCount++,this.lastToken=ra(e,this.cookieName),this.lastCookieString=e),this.lastToken}static \u0275fac=function(t){return new(t||n)};static \u0275prov=be({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),mO=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275prov=be({token:n,factory:function(t){let s=null;return t?s=new(t||n):s=ge(C1),s},providedIn:"root"})}return n})();function k1(n,i){if(!ce(R1)||n.method==="GET"||n.method==="HEAD")return i(n);try{let s=ce(Di).href,{origin:a}=new URL(s),{origin:o}=new URL(n.url,a);if(a!==o)return i(n)}catch{return i(n)}let e=ce(mO).getToken(),t=ce(A1);return e!=null&&!n.headers.has(t)&&(n=n.clone({headers:n.headers.set(t,e)})),i(n)}var Fh=(function(n){return n[n.Interceptors=0]="Interceptors",n[n.LegacyInterceptors=1]="LegacyInterceptors",n[n.CustomXsrfConfiguration=2]="CustomXsrfConfiguration",n[n.NoXsrfProtection=3]="NoXsrfProtection",n[n.JsonpSupport=4]="JsonpSupport",n[n.RequestsMadeViaParent=5]="RequestsMadeViaParent",n[n.Fetch=6]="Fetch",n})(Fh||{});function _1(n,i){return{\u0275kind:n,\u0275providers:i}}function x1(...n){let i=[gO,ru,{provide:xh,useExisting:ru},{provide:au,useFactory:()=>ce(hO,{optional:!0})??ce(kh)},{provide:fO,useValue:k1,multi:!0}];for(let e of n)i.push(...e.\u0275providers);return an(i)}function F1(){return _1(Fh.Fetch,[tu,{provide:hO,useExisting:tu},{provide:au,useExisting:tu}])}var Y1=new Ce(""),$1="b",L1="h",V1="s",z1="st",U1="u",B1="rt",qh=new Ce(""),H1=["GET","HEAD"];function yO(n,i){let o=i,{isCacheActive:e}=o,t=xo(o,["isCacheActive"]),{transferCache:s,method:a}=n;return!(!e||s===!1||J1(n)||a==="POST"&&!t.includePostRequests&&!s||a!=="POST"&&!H1.includes(a)||!t.includeRequestsWithAuthHeaders&&j1(n)||Z1(n.headers)||X1(n.cache)||t.filter?.(n)===!1)}function G1(n,i,e,t,s,a=!1){if(!a&&!yO(n,i))return null;if(t)throw new Ve(2803,!1);if(!s){let w=n.url;s=bO(n,w)}let o=e.get(s,null);if(!o)return null;let{[$1]:u,[B1]:c,[L1]:l,[V1]:h,[z1]:p,[U1]:I}=o,v=u;switch(c){case"arraybuffer":v=DO(u);break;case"blob":v=new Blob([DO(u)]);break}let E=new un(l);return new Wi({body:v,headers:E,status:h,statusText:p,url:I})}function W1(n,i){let e=ce(qh);if(!yO(n,e))return i(n);let t=ce(pT),s=ce(Y1,{optional:!0}),a=n.url,o=bO(n,a),u=G1(n,e,t,null,o,!0);return u?Bn(u):i(n)}function j1(n){let i=n.headers;return i.has("authorization")||i.has("proxy-authorization")||i.has("cookie")}function J1(n){let{withCredentials:i,credentials:e}=n;return i||e==="include"||e==="same-origin"}var K1=new Set(["no-store","private","no-cache"]);function Z1(n){let i=n.get("cache-control");return i?i.split(",").some(e=>{let t=e.split("=",1)[0].trim().toLowerCase();return K1.has(t)}):!1}function X1(n){return n==="no-cache"||n==="no-store"}function IO(n){return[...n.keys()].sort().map(i=>`${i}=${n.getAll(i)}`).join("&")}function bO(n,i){let{params:e,method:t,responseType:s}=n,a=IO(e),o=n.serializeBody();o instanceof URLSearchParams?o=IO(o):typeof o!="string"&&(o="");let u=[t,s,i,o,a].join("|"),c=e_(u);return c}function DO(n){let i=atob(n);return Uint8Array.from(i,t=>t.charCodeAt(0)).buffer}function EO(n){return[{provide:qh,useFactory:()=>(ph("NgHttpTransferCache"),_e({isCacheActive:!0},n))},{provide:_h,useValue:W1,multi:!0},{provide:PT,multi:!0,useFactory:()=>{let i=ce(gh),e=ce(qh);return()=>{i.whenStable().then(()=>{e.isCacheActive=!1})}}}]}var Q1=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756
2734187,3204031479,3329325298]),vO;function e_(n){vO??=new TextEncoder;let i=vO.encode(n),e=1779033703,t=3144134277,s=1013904242,a=2773480762,o=1359893119,u=2600822924,c=528734635,l=1541459225,h=i.length*8,p=(i.length+8>>6)+1<<6,I=new Uint8Array(p);I.set(i),I[i.length]=128;let v=new DataView(I.buffer),E=h>>>0,w=h/4294967296>>>0;v.setUint32(p-8,w,!1),v.setUint32(p-4,E,!1);let S=new Uint32Array(64);for(let R=0;R<p;R+=64){for(let U=0;U<16;U++)S[U]=v.getUint32(R+U*4,!1);for(let U=16;U<64;U++){let V=S[U-15],q=((V>>>7|V<<25)^(V>>>18|V<<14)^V>>>3)>>>0,L=S[U-2],J=((L>>>17|L<<15)^(L>>>19|L<<13)^L>>>10)>>>0;S[U]=S[U-16]+q+S[U-7]+J>>>0}let x=e,N=t,O=s,A=a,M=o,C=u,H=c,B=l;for(let U=0;U<64;U++){let V=((M>>>6|M<<26)^(M>>>11|M<<21)^(M>>>25|M<<7))>>>0,q=(M&C^~M&H)>>>0,L=B+V+q+Q1[U]+S[U]>>>0,J=((x>>>2|x<<30)^(x>>>13|x<<19)^(x>>>22|x<<10))>>>0,ne=(x&N^x&O^N&O)>>>0,Q=J+ne>>>0;B=H,H=C,C=M,M=A+L>>>0,A=O,O=N,N=x,x=L+Q>>>0}e=e+x>>>0,t=t+N>>>0,s=s+O>>>0,a=a+A>>>0,o=o+M>>>0,u=u+C>>>0,c=c+H>>>0,l=l+B>>>0}return[e,t,s,a,o,u,c,l].map(R=>R.toString(16).padStart(8,"0")).join("")}var wO=(()=>{class n{_doc;_dom;constructor(e){this._doc=e,this._dom=mn()}addTag(e,t=!1){return e?this._getOrCreateElement(e,t):null}addTags(e,t=!1){return e?e.reduce((s,a)=>(a&&s.push(this._getOrCreateElement(a,t)),s),[]):[]}getTag(e){if(!e)return null;let t=this._doc.querySelector(`meta[${e}]`);return t?.nodeName.toLowerCase()==="meta"?t:null}getTags(e){if(!e)return[];let t=this._doc.querySelectorAll(`meta[${e}]`);return t?[].slice.call(t).filter(s=>s.nodeName.toLowerCase()==="meta"):[]}updateTag(e,t){if(!e)return null;t=t||this._parseSelector(e);let s=this.getTag(t);return s?this._setMetaElementAttributes(e,s):this._getOrCreateElement(e,!0)}removeTag(e){this.removeTagElement(this.getTag(e))}removeTagElement(e){e&&this._dom.remove(e)}_getOrCreateElement(e,t=!1){if(!t){let o=this._parseSelector(e),u=this.getTags(o).filter(c=>this._containsAttributes(e,c))[0];if(u!==void 0)return u}let s=this._dom.createElement("meta");return this._setMetaElementAttributes(e,s),this._doc.getElementsByTagName("head")[0].appendChild(s),s}_setMetaElementAttributes(e,t){return Object.keys(e).forEach(s=>t.setAttribute(this._getMetaKeyMap(s),e[s])),t}_parseSelector(e){let t=e.name?"name":"property";return`${t}=${this._escapeSelectorValue(String(e[t]))}`}_escapeSelectorValue(e){return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}_containsAttributes(e,t){return Object.keys(e).every(s=>t.getAttribute(this._getMetaKeyMap(s))===e[s])}_getMetaKeyMap(e){return t_[e]||e}static \u0275fac=function(t){return new(t||n)(ge(Qe))};static \u0275prov=be({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),t_={httpEquiv:"http-equiv"},SO=(()=>{class n{_doc;constructor(e){this._doc=e}getTitle(){return this._doc.title}setTitle(e){this._doc.title=e||""}static \u0275fac=function(t){return new(t||n)(ge(Qe))};static \u0275prov=be({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var n_=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275prov=be({token:n,factory:function(t){let s=null;return t?s=new(t||n):s=ge(i_),s},providedIn:"root"})}return n})(),i_=(()=>{class n extends n_{_doc;constructor(e){super(),this._doc=e}sanitize(e,t){if(t==null)return null;switch(e){case Ui.NONE:return t;case Ui.HTML:return Ls(t,"HTML")?zi(t):bT(this._doc,String(t)).toString();case Ui.STYLE:return Ls(t,"Style")?zi(t):t;case Ui.SCRIPT:if(Ls(t,"Script"))return zi(t);throw new Ve(5200,!1);case Ui.URL:return Ls(t,"URL")?zi(t):yT(String(t));case Ui.RESOURCE_URL:if(Ls(t,"ResourceURL"))return zi(t);throw new Ve(5201,!1);default:throw new Ve(5202,!1)}}bypassSecurityTrustHtml(e){return gT(e)}bypassSecurityTrustStyle(e){return mT(e)}bypassSecurityTrustScript(e){return IT(e)}bypassSecurityTrustUrl(e){return DT(e)}bypassSecurityTrustResourceUrl(e){return vT(e)}static \u0275fac=function(t){return new(t||n)(ge(Qe))};static \u0275prov=be({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),ou=(function(n){return n[n.NoHttpTransferCache=0]="NoHttpTransferCache",n[n.HttpTransferCacheOptions=1]="HttpTransferCacheOptions",n[n.I18nSupport=2]="I18nSupport",n[n.EventReplay=3]="EventReplay",n[n.IncrementalHydration=4]="IncrementalHydration",n})(ou||{});function s_(n,i=[],e={}){return{\u0275kind:n,\u0275providers:i}}function Qq(){return s_(ou.EventReplay,kT())}function e3(...n){let i=[],e=new Set;for(let{\u0275providers:s,\u0275kind:a}of n)e.add(a),s.length&&i.push(s);let t=e.has(ou.HttpTransferCacheOptions);return an([[],[],_T(),e.has(ou.NoHttpTransferCache)||t?[]:EO({}),i])}function Vh(n){n||(n=ce(gn));let i=new Fs(e=>{if(n.destroyed){e.next();return}return n.onDestroy(e.next.bind(e))});return e=>e.pipe(uT(i))}function TO(n,i){let t=!i?.manualCleanup?i?.injector?.get(gn)??ce(gn):null,
2s=r_(i?.equal),a;i?.requireSync?a=qo({kind:0},{equal:s}):a=qo({kind:1,value:i?.initialValue},{equal:s});let o,u=n.subscribe({next:c=>a.set({kind:1,value:c}),error:c=>{a.set({kind:2,error:c}),o?.()},complete:()=>{o?.()}});if(i?.requireSync&&a().kind===0)throw new Ve(601,!1);return o=t?.onDestroy(u.unsubscribe.bind(u)),Uo(()=>{let c=a();switch(c.kind){case 1:return c.value;case 2:throw c.error;case 0:throw new Ve(601,!1)}},{equal:i?.equal})}function r_(n=Object.is){return(i,e)=>i.kind===1&&e.kind===1&&n(i.value,e.value)}function f3(n){n===void 0&&(n=ce(Hn));let i=n.get(Yo);return e=>new Fs(t=>{let s=i.add(),a=!1;function o(){a||(s(),a=!0)}let u=e.subscribe({next:c=>{t.next(c),o()},complete:()=>{t.complete(),o()},error:c=>{t.error(c),o()}});return u.add(()=>{t.unsubscribe(),o()}),u})}function OO(n){return typeof n=="function"}function vi(n){return typeof n=="string"}function ha(n){return!!n&&typeof n=="object"&&!Array.isArray(n)}function uu(n){return n==null}function zh(n){return!uu(n)}function Uh(n){return n?Array.isArray(n)||vi(n)?n.length:ha(n)?Object.keys(n).length:0:0}function RO(n){return Uh(n)===0}function Bh(n){return n.replace(/(?:^\w|[A-Z]|\b\w)/g,(i,e)=>e==0?i.toLowerCase():i.toUpperCase()).replace(/\s+|_|-|\//g,"")}var Wh=class{translations;constructor(i){this.translations=i}getTranslation(i){return Bn(this.translations.get(i)||{})}},NO=new Ce(""),Ws=new Ce("",{factory:()=>Gs}),Gs={defaultLang:"en",reRenderOnLangChange:!1,prodMode:!1,failedRetries:2,fallbackLang:[],availableLangs:[],missingHandler:{logMissingKey:!0,useFallbackTranslation:!1,allowEmpty:!1},flatten:{aot:!1},interpolation:["{{","}}"],scopes:{keepCasing:!1,autoPrefixKeys:!0}};function a_(n={}){return pn(_e(_e({},Gs),n),{missingHandler:_e(_e({},Gs.missingHandler),n.missingHandler),flatten:_e(_e({},Gs.flatten),n.flatten),scopes:_e(_e({},Gs.scopes),n.scopes)})}function Hh(n,i){return n&&(Object.prototype.hasOwnProperty.call(n,i)?n[i]:i.split(".").reduce((e,t)=>e?.[t],n))}function o_(n,i,e){n=_e({},n);let t=i.split("."),s=t.length-1;return t.reduce((a,o,u)=>(u===s?a[o]=e:a[o]=Array.isArray(a[o])?a[o].slice():_e({},a[o]),a&&a[o]),n),n}function u_(n){return`[transloco]:${n}`}var PO=new Ce(""),c_=(()=>{class n{config=ce(Ws,{optional:!0})??Gs;get interpolationMatcher(){return l_(this.config)}transpile({value:e,params:t={},translation:s,key:a}){if(vi(e)){let o,u=e;for(;(o=this.interpolationMatcher.exec(u))!==null;){let[c,l]=o;u=u.replace(c,()=>{let h=l.trim(),p=Hh(t,h);return zh(p)?p:zh(s[h])?this.transpile({params:t,translation:s,key:a,value:s[h]}):""})}return u}else t&&(ha(e)?e=this.handleObject({value:e,params:t,translation:s,key:a}):Array.isArray(e)&&(e=this.handleArray({value:e,params:t,translation:s,key:a})));return e}handleObject({value:e,params:t={},translation:s,key:a}){let o=e;return Object.keys(t).forEach(u=>{let c=this.transpile({value:Hh(o,u),params:Hh(t,u),translation:s,key:a});o=o_(o,u,c)}),o}handleArray(s){var a=s,{value:e}=a,t=xo(a,["value"]);return e.map(o=>this.transpile(_e({value:o},t)))}static \u0275fac=function(t){return new(t||n)};static \u0275prov=be({token:n,factory:n.\u0275fac})}return n})();function l_(n){let[i,e]=n.interpolation;return new RegExp(`${i}([^${i}${e}]*?)${e}`,"g")}var AO=new Ce(""),d_=(()=>{class n{handle(e,t){return e}static \u0275fac=function(t){return new(t||n)};static \u0275prov=be({token:n,factory:n.\u0275fac})}return n})(),CO=new Ce(""),h_=(()=>{class n{preSaveTranslation(e){return e}preSaveTranslationKey(e,t){return t}static \u0275fac=function(t){return new(t||n)};static \u0275prov=be({token:n,factory:n.\u0275fac})}return n})(),kO=new Ce(""),f_=(()=>{class n{userConfig;constructor(e){this.userConfig=e}getNextLangs(){let e=this.userConfig.fallbackLang;if(!e){let t;throw t=u_(4),new Error(t)}return Array.isArray(e)?e:[e]}static \u0275fac=function(t){return new(t||n)(ge(Ws))};static \u0275prov=be({token:n,factory:n.\u0275fac})}return n})();function _O(n){let{path:i,inlineLoader:e,mainLoader:t,data:s}=n;if(e){let a=e[i];if(OO(a)===!1)throw`You're using an inline loader but didn't provide a loader for ${i}`;return e[i]().then(o=>o.default?o.default:o)}return t.getTranslation(i,s)}function p_({mainLoader:n,path:i,data:e,fallbackPath:t,inlineLoader:s}){return(t?[i,t]:[i]).map(o=>
2{let u=_O({path:o,mainLoader:n,inlineLoader:s,data:e});return uh(u).pipe(rn(c=>({translation:c,lang:o})))})}function MO(n){let i={};function e(t,s){if(t===null)i[s]=null;else if(ha(t))for(let[a,o]of Object.entries(t))e(o,s?`${s}.${a}`:a);else i[s]=t}return e(n,""),i}function g_(n){let i={};for(let[e,t]of Object.entries(n)){let s=e.split("."),a=i;s.forEach((o,u)=>{u===s.length-1?a[o]=t:(a[o]??={},a=a[o])})}return i}function fa(n){if(!n)return"";let i=n.split("/");return i.pop(),i.join("/")}function yi(n){return n?n.split("/").pop():""}function m_(n,i){return Object.keys(n).reduce((e,t)=>(e[`${i}/${t}`]=n[t],e),{})}function xO(n){return typeof n?.scope=="string"}function I_(n){return n?.loader&&ha(n.loader)}function FO(n,i){return I_(n)?m_(n.loader,i):void 0}function Gh(n){return{scope:fa(n)||null,langName:yi(n)}}var D_;var jh=class n extends Error{lang;fallbackLangs;isScope;name="TranslationLoadError";constructor(i,e,t){super(""),this.lang=i,this.fallbackLangs=e,this.isScope=t,Object.setPrototypeOf(this,n.prototype)}},v_=(()=>{class n{loader;parser;missingHandler;interceptor;fallbackStrategy;langChanges$;translations=new Map;cache=new Map;firstFallbackLang;defaultLang="";availableLangs=[];isResolvedMissingOnce=!1;lang;failedLangs=new Set;events=new Fo;events$=this.events.asObservable();config;activeLang;destroyRef=ce(gn);destroyed=!1;constructor(e,t,s,a,o,u){this.loader=e,this.parser=t,this.missingHandler=s,this.interceptor=a,this.fallbackStrategy=u,this.loader||(this.loader=new Wh(this.translations)),D_=this,this.config=JSON.parse(JSON.stringify(o)),this.setAvailableLangs(this.config.availableLangs||[]),this.setFallbackLangForMissingTranslation(this.config),this.setDefaultLang(this.config.defaultLang),this.lang=new QS(this.getDefaultLang()),this.langChanges$=this.lang.asObservable(),this.activeLang=TO(this.lang,{requireSync:!0}),this.events$.subscribe(c=>{c.type==="translationLoadSuccess"&&c.wasFailure&&this.setActiveLang(c.payload.langName)}),this.destroyRef.onDestroy(()=>{this.destroyed=!0,this.lang.complete(),this.events.complete(),this.cache.clear()})}getDefaultLang(){return this.defaultLang}setDefaultLang(e){this.defaultLang=e}getActiveLang(){return this.lang.getValue()}setActiveLang(e){return this.parser.onLangChanged?.(e),this.lang.next(e),this.events.next({type:"langChanged",payload:Gh(e)}),this}setAvailableLangs(e){this.availableLangs=e}getAvailableLangs(){return this.availableLangs}load(e,t={}){if(this.destroyed)return oh;let s=this.cache.get(e);if(s)return s;let a,o=this._isLangScoped(e),u;o&&(u=fa(e));let c={path:e,mainLoader:this.loader,inlineLoader:t.inlineLoader,data:o?{scope:u}:void 0};if(this.useFallbackTranslation(e)){let h=o?`${u}/${this.firstFallbackLang}`:this.firstFallbackLang,p=p_(pn(_e({},c),{fallbackPath:h}));a=ch(p)}else{let h=_O(c);a=uh(h)}let l=a.pipe(aT(this.config.failedRetries),cT(h=>{if(Array.isArray(h)){h.forEach(p=>{this.handleSuccess(p.lang,p.translation),p.lang!==e&&this.cache.set(p.lang,Bn({}))});return}this.handleSuccess(e,h)}),nT(h=>this.handleFailure(e,t)),oT(1),Vh(this.destroyRef));return this.cache.set(e,l),l}translate(e,t={},s=this.getActiveLang()){if(!e)return e;let{scope:a,resolveLang:o}=this.resolveLangAndScope(s);if(Array.isArray(e))return e.map(l=>this.translate(this.config.scopes.autoPrefixKeys&&a?`${a}.${l}`:l,t,o));e=this.config.scopes.autoPrefixKeys&&a?`${a}.${e}`:e;let u=this.getTranslation(o),c=u[e];return c?this.parser.transpile({value:c,params:t,translation:u,key:e}):this._handleMissingKey(e,c,t)}selectTranslate(e,t,s,a=!1){let o,u=(l,h)=>this.load(l,h).pipe(rn(()=>a?this.translateObject(e,t,l):this.translate(e,t,l)));if(uu(s))return this.langChanges$.pipe(Li(l=>u(l)));if(s=Array.isArray(s)?s[s.length-1]:s,xO(s)){let l=s;s=l.scope,o=FO(l,l.scope)}if(s=s,this.isLang(s)||this.isScopeWithLang(s))return u(s);let c=s;return this.langChanges$.pipe(Li(l=>u(`${c}/${l}`,{inlineLoader:o})))}isScopeWithLang(e){return this.isLang(yi(e))}translateObject(e,t={},s=this.getActiveLang()){if(vi(e)||Array.isArray(e)){let{resolveLang:o,scope:u}=this.resolveLangAndScope(s);if(Array.isArray(e))return e.map(h=>
2this.translateObject(this.config.scopes.autoPrefixKeys&&u?`${u}.${h}`:h,t,o));let c=this.getTranslation(o);e=this.config.scopes.autoPrefixKeys&&u?`${u}.${e}`:e;let l=g_(this.getObjectByKey(c,e));return RO(l)?this.translate(e,t,s):this.parser.transpile({value:l,params:t,translation:c,key:e})}let a=[];for(let[o,u]of this.getEntries(e))a.push(this.translateObject(o,u,s));return a}selectTranslateObject(e,t,s){if(vi(e)||Array.isArray(e))return this.selectTranslate(e,t,s,!0);let[[a,o],...u]=this.getEntries(e);return this.selectTranslateObject(a,o,s).pipe(rn(c=>{let l=[c];for(let[h,p]of u)l.push(this.translateObject(h,p,s));return l}))}getTranslation(e){if(e){if(this.isLang(e))return this.translations.get(e)||{};{let{scope:t,resolveLang:s}=this.resolveLangAndScope(e),a=this.translations.get(s)||{};return this.getObjectByKey(a,t)}}return this.translations}selectTranslation(e){let t=this.langChanges$;if(e){let s=yi(e)!==e;this.isLang(e)||s?t=Bn(e):t=this.langChanges$.pipe(rn(a=>`${e}/${a}`))}return t.pipe(Li(s=>this.load(s).pipe(rn(()=>this.getTranslation(s)))))}setTranslation(e,t=this.getActiveLang(),s={}){let o=_e(_e({},{merge:!0,emitChange:!0}),s),u=fa(t),c=e;if(u){let v=this.getMappedScope(u);c=MO({[v]:e})}let l=u?yi(t):t,h=_e(_e({},o.merge&&this.getTranslation(l)),c),p=this.config.flatten.aot?h:MO(h),I=this.interceptor.preSaveTranslation(p,l);this.translations.set(l,I),o.emitChange&&this.setActiveLang(this.getActiveLang())}setTranslationKey(e,t,s={}){let a=s.lang||this.getActiveLang(),o=this.interceptor.preSaveTranslationKey(e,t,a),u={[e]:o};this.setTranslation(u,a,pn(_e({},s),{merge:!0}))}setFallbackLangForMissingTranslation({fallbackLang:e}){let t=Array.isArray(e)?e[0]:e;e&&this.useFallbackTranslation(t)&&(this.firstFallbackLang=t)}_handleMissingKey(e,t,s){if(this.config.missingHandler.allowEmpty&&t==="")return"";if(!this.isResolvedMissingOnce&&this.useFallbackTranslation()){this.isResolvedMissingOnce=!0;let a=this.translate(e,s,this.firstFallbackLang);return this.isResolvedMissingOnce=!1,a}return this.missingHandler.handle(e,this.getMissingHandlerData(),s)}_isLangScoped(e){return this.getAvailableLangsIds().indexOf(e)===-1}isLang(e){return this.getAvailableLangsIds().indexOf(e)!==-1}_loadDependencies(e,t){let s=yi(e);return this._isLangScoped(e)&&!this.isLoadedTranslation(s)?eT([this.load(s),this.load(e,{inlineLoader:t})]):this.load(e,{inlineLoader:t})}_completeScopeWithLang(e){return this._isLangScoped(e)&&!this.isLang(yi(e))?`${e}/${this.getActiveLang()}`:e}_setScopeAlias(e,t){this.config.scopeMapping||(this.config.scopeMapping={}),this.config.scopeMapping[e]=t}isLoadedTranslation(e){return Uh(this.getTranslation(e))}getAvailableLangsIds(){let e=this.getAvailableLangs()[0];return vi(e)?this.getAvailableLangs():this.getAvailableLangs().map(t=>t.id)}getMissingHandlerData(){return pn(_e({},this.config),{activeLang:this.getActiveLang(),availableLangs:this.availableLangs,defaultLang:this.defaultLang})}useFallbackTranslation(e){return this.config.missingHandler.useFallbackTranslation&&e!==this.firstFallbackLang}handleSuccess(e,t){this.setTranslation(t,e,{emitChange:!1}),this.events.next({wasFailure:!!this.failedLangs.size,type:"translationLoadSuccess",payload:Gh(e)}),this.failedLangs.forEach(s=>this.cache.delete(s)),this.failedLangs.clear()}handleFailure(e,t){uu(t.failedCounter)&&(t.failedCounter=0,t.fallbackLangs||(t.fallbackLangs=this.fallbackStrategy.getNextLangs(e)));let s=e.split("/"),a=t.fallbackLangs,o=a[t.failedCounter];if(this.failedLangs.add(e),this.cache.has(o))return this.handleSuccess(o,this.getTranslation(o)),oh;let u=o===s[s.length-1];if(!o||u)throw new jh(e,a??[],s.length>1);let c=o;return s.length>1&&(s[s.length-1]=o,c=s.join("/")),t.failedCounter++,this.events.next({type:"translationLoadFailure",payload:Gh(e)}),this.load(c,t)}getMappedScope(e){let{scopeMapping:t={},scopes:s={keepCasing:!1}}=this.config;return t[e]||(s.keepCasing?e:Bh(e))}resolveLangAndScope(e){let t=e,s;if(this._isLangScoped(e)){let a=yi(e),o=this.isLang(a);t=o?a:this.getActiveLang(),s=this.getMappedScope(o?fa(e):e)}return{scope:s,resolveLang:t}}getObjectByKey(e,t){let s={},a=`${t}.`;for(let o in e)o.startsWith(a)&&(s[o.replace(a,"")]=e[o]);return s}getEntries(e){return e instanceof Map?e.entries():Object.entries(e)}static \u0275fac=function(t){return new(t||n)(ge(NO,8),ge(PO),ge(AO),ge(CO),ge(Ws),ge(kO))};static \u0275prov=be({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),y_=(()=>{class n{html;static \u0275fac=function(t){return new(t||n)};static \u0275cmp=RT({type:n,selectors:[["ng-component"]],inputs:{html:"html"},decls:1,vars:1,consts:[[1,"transloco-loader-template",3,"innerHTML"]],template:function(t,s){t&1&&AT(0,"div",0),t&2&&CT("innerHTML",s.html,ET)},encapsulation:2})}return n})(),Jh=class{view;vcr;constructor(i,e){this.view=i,this.vcr=e}attachView(){if(this.view instanceof Ii)this.vcr.createEmbeddedView(this.view);else if(vi(this.view)){let i=this.vcr.createComponent(y_);i.instance.html=this.view,i.hostView.detectChanges()}else this.vcr.createComponent(this.view)}detachView(){this.vcr.clear()}},b_=new Ce(""),E_=new Ce(""),w_=new Ce("");function Kh(n,i,e="|"){if(vi(n)){let t=n.split(e),s=t.pop();return s===i?[!0,t.toString()]:[!1,s]}return[!1,""]}function S_(n,i){let[e]=Kh(i,"static");
2return e?!1:!!n.config.reRenderOnLangChange}function T_(n){return n?i=>i:sT(1)}var Zh=class{initialized=!1;resolve({inline:i,provider:e,active:t}){let s=t;if(this.initialized)return s=t,s;if(e){let[,a]=Kh(e,"static");s=a}if(i){let[,a]=Kh(i,"static");s=a}return this.initialized=!0,s}resolveLangBasedOnScope(i){return fa(i)?yi(i):i}resolveLangPath(i,e){return e?`${e}/${i}`:i}},Xh=class{service;constructor(i){this.service=i}resolve(i){let{inline:e,provider:t}=i;if(e)return e;if(t){if(xO(t)){let{scope:s,alias:a=this.service.config.scopes.keepCasing?s:Bh(s)}=t;return this.service._setScopeAlias(s,a),s}return t}}},C3=(()=>{class n{destroyRef=ce(gn);service=ce(v_);tpl=ce(Ii,{optional:!0});providerLang=ce(b_,{optional:!0});providerScope=ce(w_,{optional:!0});providedLoadingTpl=ce(E_,{optional:!0});cdr=ce(zs);host=ce(Ys);vcr=ce(Gn);renderer=ce(Vs);view;memo=new Map;key;params={};inlineScope;inlineRead;prefix;inlineLang;inlineTpl;currentLang;loaderTplHandler;initialized=!1;path;langResolver=new Zh;scopeResolver=new Xh(this.service);strategy=this.tpl===null?"attribute":"structural";static ngTemplateContextGuard(e,t){return!0}ngOnInit(){let e=S_(this.service,this.providerLang||this.inlineLang);if(this.service.langChanges$.pipe(Li(t=>{let s=this.langResolver.resolve({inline:this.inlineLang,provider:this.providerLang,active:t});return Array.isArray(this.providerScope)?ch(this.providerScope.map(a=>this.resolveScope(s,a))):this.resolveScope(s,this.providerScope)}),T_(e),Vh(this.destroyRef)).subscribe(()=>{this.currentLang=this.langResolver.resolveLangBasedOnScope(this.path),this.strategy==="attribute"?this.attributeStrategy():this.structuralStrategy(this.currentLang,this.prefix||this.inlineRead),this.cdr.markForCheck(),this.initialized=!0}),!this.initialized){let t=this.resolveLoadingContent();t&&(this.loaderTplHandler=new Jh(t,this.vcr),this.loaderTplHandler.attachView())}}
2ngOnChanges(e){this.strategy==="attribute"&&Object.keys(e).some(s=>!e[s].firstChange)&&this.attributeStrategy()}attributeStrategy(){this.detachLoader(),this.renderer.setProperty(this.host.nativeElement,"innerText",this.service.translate(this.key,this.params,this.currentLang))}structuralStrategy(e,t){this.memo.clear();let s=this.getTranslateFn(e,t);this.view?(this.view.context.$implicit=s,this.view.context.currentLang=this.currentLang):(this.detachLoader(),this.view=this.vcr.createEmbeddedView(this.tpl,{$implicit:s,currentLang:this.currentLang}))}getTranslateFn(e,t){return(s,a)=>{let o=t?`${t}.${s}`:s,u=a?`${o}${JSON.stringify(a)}`:o;return this.memo.has(u)||this.memo.set(u,this.service.translate(o,a,e)),this.memo.get(u)}}resolveLoadingContent(){return this.inlineTpl||this.providedLoadingTpl}ngOnDestroy(){this.memo.clear()}detachLoader(){this.loaderTplHandler?.detachView()}resolveScope(e,t){let s=this.scopeResolver.resolve({inline:this.inlineScope,provider:t});this.path=this.langResolver.resolveLangPath(e,s);let a=FO(t,s);return this.service._loadDependencies(this.path,a)}static \u0275fac=function(t){return new(t||n)};static \u0275dir=Ht({type:n,selectors:[["","transloco",""]],inputs:{key:[0,"transloco","key"],params:[0,"translocoParams","params"],inlineScope:[0,"translocoScope","inlineScope"],inlineRead:[0,"translocoRead","inlineRead"],prefix:[0,"translocoPrefix","prefix"],inlineLang:[0,"translocoLang","inlineLang"],inlineTpl:[0,"translocoLoadingTpl","inlineTpl"]},features:[na]})}return n})();var k3=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Hi({type:n});static \u0275inj=Vi({})}return n})();function _3(n){let i=[M_(c_),P_(d_),A_(h_),N_(f_)];return n.config&&i.push(O_(n.config)),n.loader&&i.push(R_(n.loader)),i}function O_(n){return an([{provide:Ws,useValue:a_(n)}])}function R_(n){return an([{provide:NO,useClass:n}])}function M_(n){return an([{provide:PO,useClass:n,deps:[Ws]}])}function N_(n){return an([{provide:kO,useClass:n,deps:[Ws]}])}function P_(n){return an([{provide:AO,useClass:n}])}function A_(n){return an([{provide:CO,useClass:n}])}var qO=[{path:"/images/alt-plazs-logo.dark.png",hash:"319e0b2d"},{path:"/images/alt-plazs-logo.light.png",hash:"991bd326"},{path:"/images/background-desktop.webp",hash:"c9ccc0d7"},{path:"/images/background-mobile.webp",hash:"98823768"},{path:"/images/bg-lg.webp",hash:"70d961d7"},{path:"/images/bg-md.webp",hash:"f0734e13"},{path:"/images/bg-sm.webp",hash:"77a1e931"},{path:"/images/bg-xl.webp",hash:"31f64b17"},{path:"/images/bottle-menu.webp",hash:"875312c7"},{path:"/images/camera-map.webp",hash:"d2b4ac9a"},{path:"/images/drinks-menu.webp",hash:"6164733b"},{path:"/images/gallery/image1.webp",hash:"4398054d"},{path:"/images/gallery/image10.webp",hash:"e03b4dd6"},{path:"/images/gallery/image11.webp",hash:"ae85a599"},{path:"/images/gallery/image12.webp",hash:"a6901b82"},{path:"/images/gallery/image2.webp",hash:"d030836f"},{path:"/images/gallery/image3.webp",hash:"e2884c27"},{path:"/images/gallery/image4.webp",hash:"3ee1ad24"},{path:"/images/gallery/image5.webp",hash:"683b2c8a"},{path:"/images/gallery/image6.webp",hash:"2ac2697b"},{path:"/images/gallery/image7.webp",hash:"6bede522"},{path:"/images/gallery/image8.webp",hash:"533b668f"},{path:"/images/gallery/image9.webp",hash:"05deb525"},{path:"/images/gradient.png",hash:"3abb7d11"},{path:"/images/grant-logo.png",hash:"433e1136"},{path:"/images/grant-logo.svg",hash:"ec073538"},{path:"/images/home-banner.webp",hash:"4bbd3ba8"},{path:"/images/map_preview.webp",hash:"df732abb"},{path:"/images/my-meki/my-meki-bg-desktop.webp",hash:"63e4d2a8"},{path:"/images/my-meki/my-meki-bg-mobile.webp",hash:"157570c1"},{path:"/images/my-meki/my-meki-logo.webp",hash:"feb20429"},{path:"/images/oszkar_logo.webp",hash:"9fc95e55"},{path:"/images/partners/bacardi.svg",hash:"4693d22e"},{path:"/images/partners/bahart.svg",hash:"439bbf23"},{path:"/images/partners/ballantines.svg",hash:"d2c2eedc"},{path:"/images/partners/borsodi.svg",hash:"93f3c192"},{path:"/images/partners/burn.svg",hash:"d479e30e"},{path:"/images/partners/coca_cola.svg",hash:"d1e4e116"},{path:"/images/partners/finlandia.svg",hash:"db48ac5a"},{path:"/images/partners/garage.svg",hash:"546f29a4"},{path:"/images/partners/grey_goose.svg",hash:"b2b49509"},{path:"/images/partners/jack_daniels.svg",hash:"2953ba6a"},{path:"/images/partners/jim_beam.svg",hash:"f31601d0"},{path:"/images/partners/kinley.svg",hash:"8d4edc4a"},{path:"/images/partners/mcdonald.svg",hash:"d65ac206"},{path:"/images/partners/miller.svg",hash:"a199ff84"},{path:"/images/partners/one.svg",hash:"31d7ec7e"},{path:"/images/partners/radio_1.svg",hash:"67c5573f"},{path:"/images/partners/raiffeisen.svg",hash:"834fa33b"},{path:"/images/partners/somersby.svg",hash:"90e3b3b3"},{path:"/images/partners/szallas.svg",hash:"c07897f3"},{path:"/images/partners-png/bacardi.png",hash:"e8975feb"},{path:"/images/partners-png/bahart.png",hash:"4168258d"},{path:"/images/partners-png/ballantines.png",hash:"eb058aab"},{path:"/images/partners-png/borsodi.png",hash:"8b98f8e8"},{path:"/images/partners-png/burn.png",hash:"2851385a"},{path:"/images/partners-png/coca_cola.png",hash:"34cefcf9"},{path:"/images/partners-png/finlandia.png",hash:"aaede0c9"},{path:"/images/partners-png/garage.png",hash:"8e551a65"},{path:"/images/partners-png/grey_goose.png",hash:"1206e555"},{path:"/images/partners-png/jack_daniels.png",hash:"7a4f2298"},{path:"/images/partners-png/jim_beam.png",hash:"996bc3cc"},{path:"/images/partners-png/kinley.png",hash:"0193b0a9"},{path:"/images/partners-png/mcdonald.png",hash:"93953475"},{path:"/images/partners-png/miller.png",hash:"81bbdc65"},{path:"/images/partners-png/mol_nagyon_balaton.png",hash:"5fd19620"},{path:"/images/partners-png/one.png",hash:"1e04410f"},{path:"/images/partners-png/radio_1.png",hash:"e04a1b4f"},{path:"/images/partners-png/raiffeisen.png",hash:"6db7b8b5"},{path:"/images/partners-png/somersby.png",hash:"ab8b5a74"},{path:"/images/partners-png/szallas.png",hash:"15b40ca4"},{path:"/images/plazs-logo.dark.png",hash:"1d6c4031"},{path:"/images/plazs-logo.light.png",hash:"b0743aa4"},{path:"/images/venue/image1.webp",hash:"a58f6f89"},{path:"/images/venue/image2.webp",hash:"93fd5b45"},{path:"/images/vip/image1.webp",hash:"52045acd"},{path:"/images/vip/image2.webp",hash:"1062f9fc"},{path:"/images/vip/image3.webp",hash:"a781846d"},{path:"/images/vip/image4.webp",hash:"034f2427"},{path:"/images/work-with-us.webp",hash:"0eee1fd4"},{path:"/icons/calendar-icon.svg",hash:"15928b3c"},{path:"/icons/chevron-down.dark.svg",hash:"9268f620"},{path:"/icons/chevron-down.light.svg",hash:"af4cb169"},{path:"/icons/chevron-left.dark.svg",hash:"32b5af01"},{path:"/icons/chevron-left.light.svg",hash:"5c41f276"},{path:"/icons/chevron-right.dark.svg",hash:"3d214eac"},{path:"/icons/chevron-right.light.svg",hash:"2ae59c63"},{path:"/icons/closed-icon.svg",hash:"8d7120af"},{path:"/icons/edit-icon.svg",hash:"fd65539f"},{path:"/icons/facebook-icon.dark.svg",hash:"5ca9f9d3"},{path:"/icons/facebook-icon.light.svg",hash:"84bc4bca"},{path:"/icons/header-menu.dark.svg",hash:"b16c1f6c"},{path:"/icons/header-menu.light.svg",hash:"9f3adada"},{path:"/icons/info-red.svg",hash:"ab4be7a9"},{path:"/icons/instagram-icon.dark.svg",hash:"cdf7e9b9"},{path:"/icons/instagram-icon.light.svg",hash:"37624604"},{path:"/icons/lock-icon.svg",hash:"724eca43"},{path:"/icons/search-icon.svg",hash:"cd52aaca"},{path:"/icons/sold-out-icon.svg",hash:"80a4092f"},{path:"/icons/thin-chevron-down.dark.svg",hash:"fa851584"},{path:"/icons/thin-chevron-down.light.svg",hash:"da378c7d"},{path:"/icons/thin-chevron-up.svg",hash:"945ce21b"},{path:"/icons/ticket-icon.svg",hash:"da76b831"},{path:"/icons/tiktok-icon.dark.svg",hash:"897ceb50"},{path:"/icons/tiktok-icon.light.svg",hash:"2b958a6e"},{path:"/icons/x-mark-icon.svg",hash:"15290867"}];var cu=class n{constructor(){this.assetHashes=new Map}load(){for(let i of qO)this.assetHashes.set(i.path,i.hash)}getHashedFilePath(i){let e=this.assetHashes.get(i);return e!=null?`${i}?v=${e}`:i}static{this.\u0275fac=function(e){return new(e||n)}}static{this.\u0275prov=be({token:n,factory:n.\u0275fac,providedIn:"root"})}};var YO=class n{constructor(){this.assetService=ce(cu)}transform(i){return i!=null?this.assetService.getHashedFilePath(i):null}static{this.\u0275fac=function(e){return new(e||n)}}static{this.\u0275pipe=ia({name:"asset",type:n,pure:!0})}};var oe=Bt(Lh(),1),TR=Bt($O(),1),OR=Bt(sf(),1),RR=Bt(of(),1),MR=Bt(LO(),1),NR=Bt(VO(),1),Lw=Bt(zO(),1),Na=Bt(cR(),1);var mu,dx=new Uint8Array(16);function Sf(){if(!mu&&(mu=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!mu))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return mu(dx)}var bt=[];for(let n=0;n<256;++n)bt.push((n+256).toString(16).slice(1));function lR(n,i=0){return bt[n[i+0]]+bt[n[i+1]]+bt[n[i+2]]+bt[n[i+3]]+"-"+bt[n[i+4]]+bt[n[i+5]]+"-"+bt[n[i+6]]+bt[n[i+7]]+"-"+bt[n[i+8]]+bt[n[i+9]]+"-"+bt[n[i+10]]+bt[n[i+11]]+bt[n[i+12]]+bt[n[i+13]]+bt[n[i+14]]+bt[n[i+15]]}var hx=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Tf={randomUUID:hx};function fx(n,i,e){if(Tf.randomUUID&&!i&&!n)return Tf.randomUUID();n=n||{};let t=n.random||(n.rng||Sf)();if(t[6]=t[6]&15|64,t[8]=t[8]&63|128,i){e=e||0;for(let s=0;s<16;++s)i[e+s]=t[s];return i}return lR(t)}var Iu=fx;
2var Nf=class{static isInstance(i){return i&&i.copyWithBusinessRef&&typeof i.copyWithBusinessRef=="function"}};var Ll=class extends Error{constructor(i,e){super(i),this.message=i,this.extraData=e}toString(){return this.extraData?`${this.getError()}:${this.message}:${JSON.stringify(this.extraData,null,2)}`:`${this.getError()}:${this.message}`}},ie=(()=>{class n extends Ll{constructor(e,t){super(e,t)}getError(){return n.ERROR}}return n.ERROR="Serialization exception",n})(),D=(()=>{class n{constructor(e,t){this.from=e,this.to=t}static between(e,t){return new n(e,t)}static exactly(e){return new n(e,e)}contains(e){return e>=this.from&&e<=this.to}isLessThan(e){return this.to<e}isGreaterThan(e){return this.from>e}isExact(){return this.from===this.to}static mustDecode(e){if(typeof e=="number")return n.exactly(e);let s=e.toString().match(n._versionRangeMatcher);if(s)return n.between(parseInt(s[1]),parseInt(s[2]));throw new ie(`Invalid version range format: ${e}`)}static decode(e){try{return n.mustDecode(e)}catch{return null}}encode(){return n._encode(this.from,this.to)}toString(){return this.from===this.to?`${this.from}`:`${this.from}:${this.to}`}static encodedBetween(e,t){return n._encode(e,t)}static encodedExactly(e){return n._encode(e,e)}static _encode(e,t){return e===t?e:`${e}:${t}`}}return n._versionRangeMatcher=/(\d+):(\d+)/,n})();function k(n){return n==null}function _(n){return!k(n)}var K=class{static decodeNumber(i){let e=Number(i);if(typeof e=="number"&&_(e)&&!isNaN(e)&&isFinite(e))return e;throw new Error(`Invalid number: ${i}`)}static decodeNumberOrNull(i){return k(i)?null:this.decodeNumber(i)}static decodeInteger(i){let e=this.decodeNumber(i);if(Number.isInteger(e))return e;throw new Error(`Invalid integer: ${i}`)}static decodeIntegerOrNull(i){return k(i)?null:this.decodeInteger(i)}static decodeDouble(i){return this.decodeNumber(i)}static decodeDoubleOrNull(i){return this.decodeNumberOrNull(i)}static decodeString(i){if(typeof i=="string")return i;throw new Error(`Invalid string: ${JSON.stringify(i)}`)}static decodeStringOrNull(i){return k(i)?null:this.decodeString(i)}static decodeBoolean(i){if(typeof i=="boolean")return i;throw new Error(`Invalid boolean: ${JSON.stringify(i)}`)}static decodeBooleanOrNull(i){return k(i)?null:this.decodeBoolean(i)}static decodeRecord(i){if(typeof i=="object"&&i!==null)return i;throw new Error(`Invalid record: ${JSON.stringify(i)}`)}static decodeRecordOrNull(i){return k(i)?null:this.decodeRecord(i)}static decodeArray(i){if(Array.isArray(i)&&_(i))return i;throw new Error(`Invalid array: ${JSON.stringify(i)}`)}static decodeArrayOrNull(i){return k(i)?null:this.decodeArray(i)}},r=class n{static has(i,e){return i[e]!=null}static replace(i,e,t,s){i[e]==t&&(i[e]=s)}static get(i,e,t){let s=i[e];if(_(s))return s;if(_(t))return t;throw new ie(`Missing or null field with key {${e}} in data map: ${JSON.stringify(i)}`)}static getString(i,e,t){let s=this.get(i,e,t);return K.decodeString(s)}static getNumber(i,e,t){let s=this.get(i,e,t);return K.decodeNumber(s)}static getInteger(i,e,t){let s=this.get(i,e,t);return K.decodeInteger(s)}static getDouble(i,e,t){let s=this.get(i,e,t);return K.decodeDouble(s)}static getBoolean(i,e,t){let s=this.get(i,e,t);return K.decodeBoolean(s)}static getOrNull(i,e){let t=i[e];return t!==void 0?t===null?null:t:null}static getStringOrNull(i,e){let t=this.getOrNull(i,e);return K.decodeStringOrNull(t)}static getNumberOrNull(i,e){let t=this.getOrNull(i,e);return K.decodeNumberOrNull(t)}static getIntegerOrNull(i,e){let t=this.getOrNull(i,e);return K.decodeIntegerOrNull(t)}static getDoubleOrNull(i,e){let t=this.getOrNull(i,e);return K.decodeDoubleOrNull(t)}static getBooleanOrNull(i,e){let t=this.getOrNull(i,e);return K.decodeBooleanOrNull(t)}static getRecordOrNull(i,e){let t=this.getOrNull(i,e);return K.decodeRecordOrNull(t)}static getRecord(i,e){let t=this.get(i,e);return K.decodeRecord(t)}static getRaw(i,e,t){let s=i[e];return s!==void 0?s:t??null}static getMap(i,e,t){let s=i[e],a=new Map;if(_(s)&&s instanceof Object){for(let[o,u]of Object.entries(s)){let c=t(o,u);a.set(c.key,c.value)}return a}throw new ie(`Missing field with key: ${e} in data map: ${JSON.stringify(i)}`)}static getMapOrNull(i,e,t){try{return n.getMap(i,e,t)}catch{return null}}static set(i,e,t){i[e]=t}static setOptional(i,e,t){_(t)&&(i[e]=t)}static setIfNullOrUndefined(i,e,t){let s=i[e];k(s)&&(i[e]=t)}static getList(i,e,t,s){let a=i[e];return _(a)&&a instanceof Array?a.map(o=>t(o)):_(s)?s:[]}static getListOrNull(i,e,t){let s=i[e];return _(s)&&s instanceof Array?s.map(a=>t(a)):null}static getRawList(i,e,t){let s=i[e];if(s instanceof Array)return s;if(_(t))return t;throw new ie(`Missing field with key: ${e} in data map: ${JSON.stringify(i)}`)}static getVersionRange(i){return D.mustDecode(n.get(i,"$schema_version"))}static getVersionRangeOrNull(i){return D.decode(n.get(i,"$schema_version"))}};function px(n,i){return Object.values(i).includes(n)}function y(n,i,e=null){return PR(n,i,e)}function _n(n,i,e=null){return PR(n,i,e)}function Re(n,i,e=null){try{return y(n,i,e)}catch{return null}}function gx(n,i,e=null){try{return _n(n,i,e)}catch{return null}}function PR(n,i,e){if(_(n)){if(px(n,i))return n;if(_(e))return e;throw new ie(`Failed to convert value to enum: ${n}`)}if(_(e))return e;throw new ie(`Failed to convert value to enum: ${n}`)}function xn(n){if(typeof n=="number")return n;throw new ie(`Failed to convert enum value to number: ${n}`)}function m(n){if(typeof n=="string")return n;throw new ie(`Failed to convert enum value to string: ${n}`)}function Se(n){try{return m(n)}catch{return null}}function mx(n,i){let e=[];for(let t of n)if(typeof t=="number"){let s=gx(t,i);_(s)&&e.push(s)}else if(typeof t=="string"){let s=Re(t,i);_(s)&&e.push(s)}else throw new ie(`Can not convert value: {${t}} of type: {${typeof t}} to enum: {${i}}`);return e}var _d=(function(n){return n[n.Throw=0]="Throw",n[n.Log=1]="Log",n[n.Ignore=2]="Ignore",n})(_d||{});var Pf=class{constructor(){this._data=new Map}has(i){return this._data.has(i)}remove(i){this._data.delete(i)}set(i,e){this._data.set(i,e)}get(i,e=null){var t;let s=(t=this._data.get(i))!==null&&t!==void 0?t:null;return s??e}},Af=class{get $schemaVersion(){return D.exactly(1)}},b=class extends Af{asOptional(){return this}},f=class{optimizeForQuery(i,e){return null}migrateFromCurrentSchemaVersion(i,e,t){return t}migrateToCurrentSchemaVersion(i,e){return e}migrateEnum(i,e,t,s){var a;let o=(a=Re(r.getOrNull(i,e),t))!==null&&a!==void 0?a:s;i[e]=m(o)}migrateEnumOrNull(i,e,t,s){var a;let o=r.getOrNull(i,e);if(k(o))return;let u=(a=Re(o,t))!==null&&a!==void 0?a:s;i[e]=m(u)}migrateEnumList(i,e,t){let s=r.getListOrNull(i,e,o=>o);if(k(s))return;let a=mx(s,t);i[e]=a.map(o=>m(o))}onBeforeDeserialization(i,e){}onBeforeSerialization(i,e){}},$n=(function(n){return n.Live="LIVE",n.Archived="ARCHIVED",n})($n||{}),Mr=class extends b{get isArchived(){return this.status===$n.Archived}};
2var ke=class extends Error{constructor(i){super(i),this.description=i}toString(){return this.description}},Cf=class n{constructor(i,e){this._isOk=i,this._error=e}static ok(i=null){return new n(!0,null)}static error(i){return new n(!1,i)}get isOk(){return this._isOk}get isError(){return!this._isOk}get error(){if(_(this._error))return this._error;throw new ke("error is inaccessible on an ok instance")}},W=class n extends Cf{constructor(i,e,t){super(i,t),this._value=e}static concat(i){let e=i.find(t=>t.isError);return e?n.error(e.error):n.ok(i.map(t=>t.value))}static ok(i){return new n(!0,i,null)}static error(i){return new n(!1,null,i)}map(i){return this.isOk?n.ok(i(this._value)):n.error(this.error)}chain(i){return this.isOk?i(this._value):n.error(this.error)}get value(){if(this.isOk)return this._value;throw new ke("Result value is inaccessible on an error instance")}unwrap(){if(this.isOk)return this._value;throw this.error}get valueOrNull(){if(this.isOk)return this._value;throw new ke("Result value is inaccessible on an error instance")}},fe=class{static now(){return(0,oe.default)()}},Ie=(function(n){return n.Austria="AT",n.Hungary="HU",n.Romania="RO",n.Slovakia="SK",n.Slovenia="SI",n})(Ie||{}),Ee=(function(n){return n.EuropeBratislava="Europe/Bratislava",n.EuropeBucharest="Europe/Bucharest",n.EuropeBudapest="Europe/Budapest",n.EuropeLjubljana="Europe/Ljubljana",n.EuropeVienna="Europe/Vienna",n})(Ee||{}),Ix=new Map([[Ie.Austria,[Ee.EuropeVienna]],[Ie.Hungary,[Ee.EuropeBudapest]],[Ie.Romania,[Ee.EuropeBucharest]],[Ie.Slovakia,[Ee.EuropeBratislava]],[Ie.Slovenia,[Ee.EuropeLjubljana]]]),Dx=new Map([[Ee.EuropeBratislava,Ie.Slovakia],[Ee.EuropeBucharest,Ie.Romania],[Ee.EuropeBudapest,Ie.Hungary],[Ee.EuropeLjubljana,Ie.Slovenia],[Ee.EuropeVienna,Ie.Austria]]);function aY(n){let i=Ix.get(n);return i?i[0]:null}function xd(n){var i;return(i=Dx.get(n))!==null&&i!==void 0?i:null}var bn=5;var vx="K2P?:h%M_3-;fQof~qfQ4n",Su=60;var AR=24,oY=AR*Su,so=60*1e3,yx=6371e3,bx=so*60,Ex=3;oe.default.extend(TR.default);oe.default.extend(OR.default);oe.default.extend(RR.default);oe.default.extend(MR.default);oe.default.extend(NR.default);var wx=Ee.EuropeBucharest,dR=[31,28,31,30,31,30,31,31,30,31,30,31],g=class n{constructor(i){this.region=i}static ofRegion(i){var e;this.ensureInitialized();let t=(e=this.timeZoneCache)===null||e===void 0?void 0:e.get(i);if(k(t))throw new Error(`Failed to find time zone region in cache: ${i}`);return t}static default(){return this.ofRegion(wx)}now(){return fe.now().tz(this.region)}millisecondsSinceEpoch(){return this.now().valueOf()}at(i,e=0,t=1,s=0,a=0,o=0,u=0){return(0,oe.default)(new Date(i,e,t,s,a,o,u)).tz(this.region,!0)}getDayAtFirstHour(i){return this.at(i.year(),i.month(),i.date())}getTodayAtFirstHour(){let i=this.now();return this.at(i.year(),i.month(),i.date())}getNextDayAtFirstHour(i){return this.getFutureDayAtFirstHour(1,i)}getFutureDayAtFirstHour(i,e){e??(e=this.getTodayAtFirstHour());let t=e.add(oe.default.duration(i,"days")),s=e.utcOffset(),a=t.utcOffset();if(a!==s){let o=a-s;t=t.add(-o,"minutes")}return this.at(t.year(),t.month(),t.date())}getPastDayAtFirstHour(i,e){e??(e=this.getTodayAtFirstHour());let t=e.subtract(oe.default.duration(i,"days")),s=e.utcOffset(),a=t.utcOffset();if(a!==s){let o=a-s;t=t.add(-o,"minutes")}return this.at(t.year(),t.month(),t.date())}getFirstDayOfMonth(i){return this.at(i.year(),i.month(),1)}getFutureMonthOnSameDayAtSameTime(i,e){var t;let s=(t=e.today)!==null&&t!==void 0?t:this.getTodayAtFirstHour(),a=s.year(),o=s.month(),u=s.date();for(;i>0;)o++,o===12&&(a++,o=0),i--;let c=dR[o];return a%4===0&&o===1&&c++,u>c&&(u=c),this.at(a,o,u,s.hour(),s.minute(),s.second(),s.millisecond())}getFutureMonthOnSameDayAtFirstHour(i,e){let t=this.getFutureMonthOnSameDayAtSameTime(i,e);return this.at(t.year(),t.month(),t.date())}getFutureYearOnSameDayAtSameTime(i,e){var t;let s=(t=e.today)!==null&&t!==void 0?t:this.getTodayAtFirstHour(),a=s.month(),o=s.year(),u=s.date();for(;i>0;)o++,i--;let c=dR[a];return o%4===0&&a===1&&c++,u>c&&(u=c),this.at(o,a,u,s.hour(),s.minute(),s.second(),s.millisecond())}getFutureYearOnSameDayAtFirstHour(i,e){let t=this.getFutureYearOnSameDayAtSameTime(i,e);return this.at(t.year(),t.month(),t.date())}getFutureMonthOnFirstDayAtFirstHour(i,e){e??(e=this.getTodayAtFirstHour());let t=e.year(),s=e.month();for(;i>0;)s++,s===12&&(t++,s=0),i--;return this.at(t,s)}getPastMonthOnFirstDayAtFirstHour(i,e){e??(e=this.getTodayAtFirstHour());let t=e.year(),s=e.month();for(;i>0;)s--,s===0&&(t--,s=11),i--;return this.at(t,s)}getTimeDifference(i,e){let t=i.utcOffset(),s=e.utcOffset();if(t===s)return oe.default.duration(i.diff(e));let a=t-s,o=i.diff(e,"milliseconds")+a*so;return oe.default.duration(o,"milliseconds")}isDateToday(i){let e=this.now();return e.year()===i.year()&&e.month()===i.month()&&e.date()===i.date()}isSameDay(i,e){return i?.year()===e?.year()&&i?.month()===e?.month()&&i?.date()===e?.date()}isSameMonth(i,e){return i?.year()===e?.year()&&i?.month()===e?.month()}convert(i){return i.tz(this.region)}static isSameDay(i,e){return i?.year()===e?.year()&&i?.month()===e?.month()&&i?.date()===e?.date()}static isSameMonth(i,e){return i?.year()===e?.year()&&i?.month()===e?.month()}static encodeDate(i){return i.valueOf()}static encodeDateOrNull(i){var e;return(e=i?.valueOf())!==null&&e!==void 0?e:null}static decodeDate(i){return(0,oe.default)(i)}static decodeDateOrNull(i){return _(i)?(0,oe.default)(i):null}static encodeDuration(i){return i.asMilliseconds()}static encodeDurationOrNull(i){var e;return(e=i?.asMilliseconds())!==null&&e!==void 0?e:null}static decodeDuration(i){return oe.default.duration(i)}static decodeDurationOrNull(i){return _(i)?oe.default.duration(i):null}static dateToISOString(i){return i.toISOString()}static dateToISOStringOrNul(i){return _(i)?i.toISOString():null}static dateFromISOString(i){return(0,oe.default)(i)}static dateFromISOStringOrNul(i){return _(i)?(0,oe.default)(i):null}static cloneDate(i){var e;let s=(e=i.$x)===null||e===void 0?void 0:e.$timezone;return s?oe.default.tz(i.valueOf(),s):(0,oe.default)(i.valueOf())}static cloneDateOrNull(i){return k(i)?null:this.cloneDate(i)}static cloneDuration(i){return oe.default.duration(i.asMilliseconds())}static cloneDurationOrNull(i){return k(i)?null:oe.default.duration(i.asMilliseconds())}static ensureInitialized(){if(!this.timeZoneCache){this.timeZoneCache=new Map;for(let i of Object.values(Ee))this.timeZoneCache.set(i,new n(i))}}static compareInstants(i,e){let t=i.valueOf(),s=e.valueOf();return t<s?-1:t>s?1:0}static isSameInstant(i,e){return this.compareInstants(i,e)===0}
2static isSameInstantOrNull(i,e){return _(i)&&_(e)?this.isSameInstant(i,e):i===e}},Et=(()=>{class n{constructor(e,t,s){this._builders=e,this._databaseIdGenerator=t,this._unknownTypePolicy=s}static get instance(){return this._instance}get unknownTypePolicy(){return this._unknownTypePolicy}get databaseIdGenerator(){return this._databaseIdGenerator}getBuilder(e){let t=this._builders.get(e);return t??null}toData(e,t){let s=this.getBuilder(t.$typeId);if(k(s))throw new ie(`Missing data model builder for type ID: ${t.$typeId}`);s.onBeforeSerialization(e,t);let a=t.toMap(e);a.$type_id=t.$typeId,a.$schema_version=t.$schemaVersion.encode(),a.$last_update=g.encodeDate(fe.now());let o=s.optimizeForQuery(e,t);return _(o)&&Object.keys(o).length>0&&(a.$query=o),s.migrateFromCurrentSchemaVersion(e,t,a)}fromData(e,t){let s=t.$type_id;if(k(s)||typeof s!="string"||s.length<=0)throw new ie("Data map does not contain a type ID.",JSON.stringify(t));let a=this.getBuilder(s);if(k(a))throw new ie(`Missing data model builder for type ID: ${s}`);a.onBeforeDeserialization(e,t);let o=a.migrateToCurrentSchemaVersion(e,t);if(k(o))throw new ie(`Unknown schema version {${t.$schema_version}} for ${s}`);return a.build(e,o)}isSerializedData(e,t=null){let s=e.$type_id;if(k(s)||typeof s!="string"||s.length<=0)return!1;let a=this.getBuilder(s);return!(k(a)||_(t)&&s!==t)}static ensureInitialized(e,t,s){var a;(a=this._instance)!==null&&a!==void 0||(this._instance=new n(e,t,s??_d.Ignore))}}return n._instance=null,n})(),Kn=(()=>{class n{constructor(e){this.converter=e}static get instance(){return this._instance}toBinaryBlob(e){return this.converter.toBinaryBlob(e)}fromBinaryBlob(e){return this.converter.fromBinaryBlob(e)}toBase64(e){return this.converter.toBase64(e)}fromBase64(e){return this.converter.fromBase64(e)}static ensureInitialized(e){var t;(t=this._instance)!==null&&t!==void 0||(this._instance=new n(e))}}return n._instance=null,n})(),kf=class{constructor(){this.storage=new Pf}get unknownTypePolicy(){if(k(Et.instance))throw new ie("Data model factory is not initialized.");return Et.instance.unknownTypePolicy}generateUniqueId(i){if(k(Et.instance))throw new ie("Data model factory is not initialized.");return Et.instance.databaseIdGenerator.generate(i)}isSerializedData(i,e){if(k(Et.instance))throw new ie("Data model factory is not initialized.");return Et.instance.isSerializedData(i,e)}toBinaryBlob(i){if(k(Kn.instance))throw new ie("Binary blob factory is not initialized.");return Kn.instance.toBinaryBlob(i)}fromBinaryBlob(i){if(k(Kn.instance))throw new ie("Binary blob factory is not initialized.");return Kn.instance.fromBinaryBlob(i)}toBase64(i){if(k(Kn.instance))throw new ie("Binary blob factory is not initialized.");return Kn.instance.toBase64(i)}fromBase64(i){if(k(Kn.instance))throw new ie("Binary blob factory is not initialized.");return Kn.instance.fromBase64(i)}toData(i){if(k(Et.instance))throw new ie("Data model factory is not initialized.");return Et.instance.toData(this,i)}toDataOrNull(i){return k(i)?null:this.toData(i)}fromData(i){if(k(Et.instance))throw new ie("Data model factory is not initialized.");return Et.instance.fromData(this,i)}fromDataOrNull(i){return k(i)?null:this.fromData(i)}encodeDate(i){return g.encodeDate(i)}encodeDateOrNull(i){return g.encodeDateOrNull(i)}decodeDate(i){return g.decodeDate(i)}decodeDateOrNull(i){return g.decodeDateOrNull(i)}encodeDuration(i){return g.encodeDuration(i)}encodeDurationOrNull(i){return g.encodeDurationOrNull(i)}decodeDuration(i){return g.decodeDuration(i)}decodeDurationOrNull(i){return g.decodeDurationOrNull(i)}};function CR(){return new kf}var $=(function(n){return n.English="en",n.Hungarian="hu",n.Romanian="ro",n})($||{}),Sx=new Map([[Ie.Hungary,$.Hungarian],[Ie.Romania,$.Romanian]]),uY=new Map([[Ee.EuropeBudapest,$.Hungarian],[Ee.EuropeBucharest,$.Romanian]]);function Nr(n){var i;return(i=Sx.get(n))!==null&&i!==void 0?i:null}function P(n,i,e=(t,s)=>t===s){if(k(n)&&k(i))return!0;if(k(n))return!1;if(k(i)||n.length!==i.length)return!1;for(let t=0;t<n.length;t++)if(!e(n[t],i[t]))return!1;return!0}function re(n,i,e=(t,s)=>t===s){if(n==null||i==null)return n==i;if(n.size!==i.size)return!1;for(let[t,s]of n){let a=i.get(t);if(k(s)||k(a)){if(s===a)continue;return!1}if(!e(s,a))return!1}return!0}function d(n,i){return k(n)||k(i)?n===i:n.isSame(i)}function F(n){return n.clone()}function Z(n){var i;return(i=n?.clone())!==null&&i!==void 0?i:null}function ee(n,i){let e=new Map;
2return n.forEach((t,s)=>{i?e.set(s,i(t)):e.set(s,t)}),e}function Tx(n,i){return k(n)?null:ee(n,i)}function Te(n){let i=[];return i.push(...n),i}function kR(n){return new Set(n)}function et(n){return _(n)?Te(n):null}function ue(n){return n.map(i=>i.clone())}function hR(n,i){let e=[];for(let t=0;t<n.length;t++)e.push(i(n[t]));return e}function Vw(n,i){let e=new Map;return n.forEach((t,s)=>{let a=i(s,t);e.set(a.key,a.value)}),e}function se(n,i){let e={};return n.forEach((t,s)=>{let a=i(s,t);e[a.key]=a.value}),e}function Ox(n,i){return k(n)?null:se(n,i)}function as(n){return se(n,(i,e)=>({key:m(i),value:e}))}function Rx(n){return _(n)?se(n,(i,e)=>({key:m(i),value:e})):null}function os(n,i){return r.getMap(n,i,(e,t)=>({key:y(e,$),value:t}))}function Ft(n){if(k(Et.instance))throw new ie("Data model factory is not initialized.");return Et.instance.databaseIdGenerator.generate(n)}function _R(n,i=null){if(k(Et.instance))throw new ie("Data model factory is not initialized.");return Et.instance.toData(i??CR(),n)}function Fd(n,i=null){if(k(Et.instance))throw new ie("Data model factory is not initialized.");return Et.instance.fromData(i??CR(),n)}function cY(n,i=null){return k(n)?null:_R(n,i)}function xR(n,i=null){return k(n)?null:Fd(n,i)}var _f=class extends b{},tr=class extends _f{static assertType(i){if("isLegacyOrder"in i){let e=i.isLegacyOrder;if(typeof e=="boolean")return e}return!1}},xf=class extends b{};var ki=class{},Vl=class extends ki{findDiscountForMultipleTickets(i,e){return null}findDiscountForSingleTicket(i){return null}findDiscountForOrder(i){return null}reset(){}};function FR(n,i){return n>i?1:n<i?-1:0}var G=(()=>{class n extends b{constructor(){super(),this._instanceId=this.generateInstanceId()}generateInstanceId(){return`${this.$displayName}_${++n._totalNumberOfCreatedComponents}`}get $instanceId(){return this._instanceId}get $displayName(){return this.constructor.name}toString(){return this._instanceId}}return n._totalNumberOfCreatedComponents=0,n})(),Be=class extends G{compareTo(i){return FR(this.renderOrder,i.renderOrder)}},Pa=(()=>{class n extends G{constructor(e,t){super(),this.standardFee=e,this.productFee=t}get $removable(){return!1}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(2,n.SCHEMA_VERSION)}static create(e){return new n(e.standardFee,e.productFee)}static fromMap(e,t){return new n(e.fromData(r.get(t,"standardFee")),e.fromDataOrNull(r.getOrNull(t,"productFee")))}toMap(e){return{standardFee:e.toData(this.standardFee),productFee:e.toDataOrNull(this.productFee)}}clone(){var e,t;return new n(this.standardFee.clone(),(t=(e=this.productFee)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null)}copyWith({standardFee:e=F(this.standardFee),productFee:t=Z(this.productFee)}={}){return n.create({standardFee:e,productFee:t})}isSame(e){return e===this?!0:d(e.standardFee,this.standardFee)&&d(e.productFee,this.productFee)}}return n.TYPE_ID="a80d6b50091f43c89564d102412076a5",n.SCHEMA_VERSION=3,n})(),Ff=class extends f{build(i,e){return Pa.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(Pa.SCHEMA_VERSION))return e;if(t.isGreaterThan(Pa.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(r.setIfNullOrUndefined(e,"standardFee",r.getRecord(e,"feeProtocol")),delete e.feeProtocol,s=2),s<3&&(r.setIfNullOrUndefined(e,"productFee",null),s=3),e.$schema_version=D.encodedExactly(s),e}},yt=(function(n){return n.TicketsAndProducts="TicketsAndProducts",n.Tickets="Tickets",n.Vouchers="Vouchers",n.Calendar="Calendar",n.TicketAsPass="TicketAsPass",n})(yt||{}),qf=class{constructor(i){var e,t;let s=i.findComponentByTypeId(Pa.TYPE_ID);this.standardFee=(e=s?.standardFee)!==null&&e!==void 0?e:null,this.productFee=i.bookingStrategy===yt.TicketsAndProducts?(t=s?.productFee)!==null&&t!==void 0?t:this.standardFee:this.standardFee}getFeeVatOverrideForTickets(){var i,e;return(e=(i=this.standardFee)===null||i===void 0?void 0:i.overrideVat)!==null&&e!==void 0?e:null}getFeeVatOverrideForProducts(){var i,e;return(e=(i=this.productFee)===null||i===void 0?void 0:i.overrideVat)!==null&&e!==void 0?e:null}calculateFeeForTicketCartItem(i){var e,t;let s=(e=i.overrideUnitPrice)!==null&&e!==void 0?e:i.ticket.price,a=i.ticket.applicationFee,o=(t=i.quantity)!==null&&t!==void 0?t:null,u=null;return i.supplement!=null&&(s=s.add(i.supplement.price)),_(a)?u=a.calculateUnitFee(s):_(this.standardFee)&&(u=this.standardFee.calculateUnitFee(s)),_(u)&&_(o)&&(u=u.scale(o)),u?.isPositive()===!0?u:null}calculateFeeForProductCartItem(i){var e,t;let s=(e=i.overrideUnitPrice)!==null&&e!==void 0?e:i.product.price,a=(t=i.quantity)!==null&&t!==void 0?t:null,o=null;return _(this.productFee)&&(o=this.productFee.calculateUnitFee(s)),_(o)&&_(a)&&
2(o=o.scale(a)),o?.isPositive()===!0?o:null}calculateFeeForTicketOrder(i){let e=null,t=null;for(let s of i.tickets){let a=this.calculateFeeForEventTicket(s);_(a)&&(e=e!=null?e.add(a):a)}for(let s of i.products){let a=this.calculateFeeForProductOrderItem(s);_(a)&&(t=t!=null?t.add(a):a)}return{ticketFee:e,productFee:t}}calculateFeeForProductOrder(i){let e=null;for(let t of i.items){let s=this.calculateFeeForProductOrderItem(t);_(s)&&(e=e!=null?e.add(s):s)}return e}getFeeForEventTicket(i){var e,t;let s=i.template.applicationFee,a=i.template.price;return i.supplement!=null&&(a=a.add(i.supplement.template.price)),s??((t=(e=this.standardFee)===null||e===void 0?void 0:e.getUnitFee(a))!==null&&t!==void 0?t:null)}getFeeForProductOrderItem(i){var e,t;let s=i.product.price;return(t=(e=this.productFee)===null||e===void 0?void 0:e.getUnitFee(s))!==null&&t!==void 0?t:null}calculateFeeForEventTicket(i){let e=i.template.applicationFee,t=i.template.price,s=null;return i.supplement!=null&&(t=t.add(i.supplement.template.price)),_(e)?s=e.calculateUnitFee(t):_(this.standardFee)&&(s=this.standardFee.calculateUnitFee(t)),s?.isPositive()===!0?s:null}calculateFeeForProductOrderItem(i){let e=i.product.price,t=null;return _(this.productFee)&&(t=this.productFee.calculateUnitFee(e)),_(t)&&(t=t.scale(i.quantity)),t?.isPositive()===!0?t:null}};function Rn(n){return k(n)?!0:n.length<=0}function ri(n){return!Rn(n)}var Mx="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_";function tn(n){let i=Lw.default.remove(n),e=[];for(let t of i)t===" "||t==="-"?e.push("_"):Mx.includes(t)&&e.push(t);return e.join("")}function Pr(n,i,e){var t;if(_(i)){let s=n.get(i);if(_(s)&&(k(e)||e(s)))return s}if(i!==$.English){let s=n.get($.English);if(_(s)&&(k(e)||e(s)))return s}if(_(e)){for(let s of n.values())if(e(s))return s;return null}else return n.size>0&&(t=n.values().next().value)!==null&&t!==void 0?t:null}function Nx(n,i,e,t){var s;return(s=Pr(n,e,t))!==null&&s!==void 0?s:i}var Oe=(()=>{class n extends b{constructor(e){super(),this.localizations=e}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}isEmpty(){if(this.localizations.size==0)return!0;let e=!0;for(let t of this.localizations.values())if(t.length>0){e=!1;break}return e}isNotEmpty(){return!this.isEmpty()}has(e){return _(this.localizations.get(e))}hasAndNotEmpty(e){return ri(this.localizations.get(e))}set(e,t){this.localizations.set(e,t)}get(e){var t;return(t=this.localizations.get(e))!==null&&t!==void 0?t:null}getAny(e=null){return Pr(this.localizations,e,t=>t.length>0)}getAnyOrEmpty(e=null){var t;return(t=Pr(this.localizations,e,s=>s.length>0))!==null&&t!==void 0?t:""}getAnyOrDefault({defValue:e,language:t}){return Nx(this.localizations,e,t,s=>s.length>0)}static empty(){return new n(new Map)}static localized(e){return new n(e)}static forLanguage(e,t){return new n(new Map([[e,t]]))}static fromMap(e,t){return new n(r.getMap(t,"localizations",(s,a)=>({key:y(s,$),value:a})))}toMap(e){return{localizations:se(this.localizations,(t,s)=>({key:m(t),value:s}))}}clone(){return new n(ee(this.localizations))}isSame(e){return e===this?!0:re(e.localizations,this.localizations)}}return n.TYPE_ID="c18987a4c9d24afb97faaf2d4f2c83e2",n.SCHEMA_VERSION=3,n})(),Yf=class extends f{build(i,e){return Oe.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(Oe.SCHEMA_VERSION))return e;if(t.isGreaterThan(Oe.SCHEMA_VERSION))return null;let s=t.to;if(s<2){s=2;let a=i.storage.get("language",$.English);if(_(a)){let o=r.get(e,"text"),u=r.getMap(e,"localizedText",(c,l)=>({key:y(c,$),value:l}));Rn(u.get(a))&&u.set(a,o),e.localizedText=se(u,(c,l)=>({key:m(c),value:l}))}}return s<3&&(s=3,e.localizations=e.localizedText),e.$schema_version=D.encodedExactly(s),e}},It=class n{constructor(i,e){this.x=i,this.y=e}static origin(){return new n(0,0)}static i(){return new n(1,0)}static j(){return new n(0,1)}static fromJsonOrNull(i){return k(i)?null:n.fromJson(i)}static fromJson(i){return new n(r.getNumber(i,"x"),r.getNumber(i,"y"))}toJson(){return{x:this.x,y:this.y}}add(i){return new n(this.x+i.x,this.y+i.y)}sub(i){return new n(this.x-i.x,this.y-i.y)}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}clone(){return new n(this.x,this.y)}isSame(i){return i===this?!0:this.x===i.x&&this.y===i.y}},Ds=class{constructor(i,e,t,s,a=null){this.uniqueId=i,this.enabled=e,this.position=t,this.rotation=s,this._parent=a}get parent(){return this._parent}setParent(i){this._parent=_(i)?new WeakRef(i):null}},wt=(()=>{class n extends Ds{constructor(e,t,s,a,o,u=null){super(e,t,s,a,u),this.tickets=o}get $typeId(){return n.TYPE_ID}static legacy(e,t,s,a,o){return new n(e,t,s,a,k(o)?[]:[o],null)}static blank(e,t,s,a){return new n(e,t,s,a,[],null)}static fromBinaryData(e,t,s,a,o,u=null){return new n(e,t,s,a,o,u)}static fromJson(e){let t=r.getOrNull(e,"ticketTemplateId"),s=r.getListOrNull(e,"tickets",a=>a);return k(s)&&(s=_(t)?[t]:[]),new n(r.get(e,"uniqueId"),r.get(e,"enabled"),It.fromJson(r.get(e,"position")),r.getNumber(e,"rotation"),s)}toJson(){return{$typeId:this.$typeId,uniqueId:this.uniqueId,enabled:this.enabled,position:this.position.toJson(),rotation:this.rotation,tickets:this.tickets}}clone(e){return new n(this.uniqueId,this.enabled,this.position.clone(),this.rotation,Te(this.tickets),e)}isSame(e){return e===this?!0:this.uniqueId===e.uniqueId&&this.enabled===e.enabled&&d(this.position,e.position)&&this.rotation===e.rotation&&P(e.tickets,this.tickets)}}return n.TYPE_ID=1,n})(),Rt=(()=>{class n extends Ds{constructor(e,t,s,a=1,o=null,u=null,c=null,l=null){super(e,t,u??new It(0,0),c??0,l),this.texts=s,this.textSize=a,this.color=o}get $typeId(){return n.TYPE_ID}static fromJsonOrNull(e){return k(e)?null:n.fromJson(e)}static fromJson(e){return new n(r.getNumber(e,"uniqueId"),r.get(e,"enabled"),r.getMap(e,"texts",(t,s)=>({key:y(t,$),value:s})),r.getNumber(e,"textSize"),r.getNumberOrNull(e,"color"),It.fromJsonOrNull(r.getOrNull(e,"position")),r.getNumberOrNull(e,"rotation"))}toJson(){var e,t,s,a;return{$typeId:this.$typeId,uniqueId:this.uniqueId,enabled:this.enabled,texts:se(this.texts,(o,u)=>
2({key:o.toString(),value:u})),textSize:this.textSize,color:(e=this.color)!==null&&e!==void 0?e:null,position:(s=(t=this.position)===null||t===void 0?void 0:t.toJson())!==null&&s!==void 0?s:null,rotation:(a=this.rotation)!==null&&a!==void 0?a:null}}clone(e){var t,s;return new n(this.uniqueId,this.enabled,ee(this.texts),this.textSize,this.color,(s=(t=this.position)===null||t===void 0?void 0:t.clone())!==null&&s!==void 0?s:null,this.rotation,e)}isSame(e){return e===this?!0:this.uniqueId===e.uniqueId&&this.enabled===e.enabled&&re(this.texts,e.texts)&&this.textSize===e.textSize&&this.color===e.color&&d(this.position,e.position)&&this.rotation===e.rotation}}return n.TYPE_ID=4,n})(),$f=class extends Ds{constructor(i,e,t,s,a,o){super(i,e,t,s,a),this.seats=o}},Kt=(function(n){return n[n.Sequential=1]="Sequential",n[n.LeftRight=2]="LeftRight",n[n.LeftRightMiddle=3]="LeftRightMiddle",n})(Kt||{}),Dt=(()=>{class n extends $f{constructor(e,t,s,a,o,u,c,l=null,h=null){super(e,t,s,a,h,c),this.label=o,this.namingStrategy=u,this.firstLabelingOrdinal=l??1}get $typeId(){return n.TYPE_ID}static fromJson(e){var t;let s=new n(r.get(e,"uniqueId"),r.get(e,"enabled"),It.fromJson(r.get(e,"position")),r.getNumber(e,"rotation"),Rt.fromJsonOrNull(r.getOrNull(e,"label")),_n(r.getNumber(e,"namingStrategy"),Kt),r.get(e,"seats").map(a=>wt.fromJson(a)),r.getOrNull(e,"firstLabelingOrdinal"));(t=s.label)===null||t===void 0||t.setParent(s);for(let a of s.seats)a.setParent(s);return s}toJson(){var e,t;return{$typeId:this.$typeId,uniqueId:this.uniqueId,enabled:this.enabled,position:this.position.toJson(),rotation:this.rotation,label:(t=(e=this.label)===null||e===void 0?void 0:e.toJson())!==null&&t!==void 0?t:null,namingStrategy:xn(this.namingStrategy),seats:this.seats.map(s=>s.toJson()),firstLabelingOrdinal:this.firstLabelingOrdinal}}clone(e){var t,s,a,o,u;let c=new n(this.uniqueId,this.enabled,this.position.clone(),this.rotation,(s=(t=this.label)===null||t===void 0?void 0:t.clone(null))!==null&&s!==void 0?s:null,this.namingStrategy,(o=(a=this.seats)===null||a===void 0?void 0:a.map(l=>l.clone(null)))!==null&&o!==void 0?o:null,this.firstLabelingOrdinal,e);(u=c.label)===null||u===void 0||u.setParent(c);for(let l of c.seats)l.setParent(c);return c}isSame(e){return e===this?!0:this.uniqueId===e.uniqueId&&this.enabled===e.enabled&&d(this.position,e.position)&&this.rotation===e.rotation&&d(this.label,e.label)&&this.namingStrategy===e.namingStrategy&&P(this.seats,e.seats,(t,s)=>d(t,s))&&this.firstLabelingOrdinal===e.firstLabelingOrdinal}}return n.TYPE_ID=2,n})(),Aa=(()=>{class n extends Ds{constructor(e,t,s,a,o,u,c,l=null){super(e,t,s,a,l),this.width=o,this.height=u,this.tickets=c}get $typeId(){return n.TYPE_ID}static fromJson(e){return new n(r.getInteger(e,"uniqueId"),r.getBoolean(e,"enabled"),It.fromJson(r.getRecord(e,"position")),r.getDouble(e,"rotation"),r.getDouble(e,"width"),r.getDouble(e,"height"),r.getList(e,"tickets",t=>K.decodeString(t)))}toJson(){return{$typeId:this.$typeId,uniqueId:this.uniqueId,enabled:this.enabled,position:this.position.toJson(),rotation:this.rotation,width:this.width,height:this.height,tickets:Te(this.tickets)}}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.enabled===this.enabled&&e.position.isSame(this.position)&&e.rotation===this.rotation&&P(e.tickets,this.tickets)}clone(e){return new n(this.uniqueId,this.enabled,F(this.position),this.rotation,this.width,this.height,Te(this.tickets),e)}}return n.TYPE_ID=5,n})(),Mt=(()=>{class n extends Ds{constructor(e,t,s,a,o,u,c=null){super(e,t,s,a,c),this.label=o,this.children=u}get $typeId(){return n.TYPE_ID}static fromJson(e){var t;let s=o=>{let u=r.get(o,"$typeId");switch(u){case wt.TYPE_ID:return wt.fromJson(o);case Dt.TYPE_ID:return Dt.fromJson(o);case n.TYPE_ID:return n.fromJson(o);case Rt.TYPE_ID:return Rt.fromJson(o);case Aa.TYPE_ID:return Aa.fromJson(o)}throw Error(`Unknown SeatingElement of type: ${u.toString(16)}`)},a=new n(r.getInteger(e,"uniqueId"),r.getBoolean(e,"enabled"),It.fromJson(r.getRecord(e,"position")),r.getDouble(e,"rotation"),Rt.fromJsonOrNull(r.getRecordOrNull(e,"label")),r.getList(e,"children",o=>s(K.decodeRecord(o))));(t=a.label)===null||t===void 0||t.setParent(a);for(let o of a.children)o.setParent(a);return a}toJson(){var e,t;return{$typeId:this.$typeId,uniqueId:this.uniqueId,enabled:this.enabled,position:this.position.toJson(),rotation:this.rotation,label:(t=(e=this.label)===null||e===void 0?void 0:e.toJson())!==null&&t!==void 0?t:null,children:this.children.map(s=>s.toJson())}}clone(e){var t,s,a;let o=new n(this.uniqueId,this.enabled,this.position.clone(),this.rotation,(s=(t=this.label)===null||t===void 0?void 0:t.clone(null))!==null&&s!==void 0?s:null,this.children.map(u=>u.clone(null)),e);(a=o.label)===null||a===void 0||a.setParent(o);for(let u of o.children)u.setParent(o);return o}isSame(e){return e===this?!0:this.uniqueId===e.uniqueId&&this.enabled===e.enabled&&d(this.position,e.position)&&this.rotation===e.rotation&&d(this.label,e.label)&&P(this.children,e.children,(t,s)=>d(t,s))&&this.parent===e.parent}}return n.TYPE_ID=3,n})(),Px=new RegExp(" |-");function fi(n,i){return n&&n.length!==0&&i&&i.length!==0?`${n} ${i}`:n&&n.length!==0?n:i&&i.length!==0?i:null}function pi(n,i){return n&&n.length!==0&&i&&i.length!==0?`${n[0].toUpperCase()}${i[0].toUpperCase()}`:n&&n.length!==0?n[0].toUpperCase():i&&i.length!==0?i[0].toUpperCase():null}function Zt(n){throw new Error("Unreachable case"+n)}var Of="K",Lf=class{static findLocalizedNameForSeat(i,e){let t=this.joinParentSeatingElementsNames(i,i,e),s=this.findSeatProperName(i,e);return t!=null?`${t}, ${s}`:s}static generateLocalizedStringForSeat(i){let e=new Map;for(let t of Object.values($)){let s=this.findLocalizedNameForSeat(i,t);_(s)&&e.set(t,s)}return new Oe(e)}static joinParentSeatingElementsNames(i,e,t){if(k(i.parent))return null;let s=i.parent.deref();if(k(s))return null;if(s instanceof Mt){let a=this.findSectorOrRowName(s,t),o=this.joinParentSeatingElementsNames(s,e,t);return k(o)?a:k(a)?o:`${o}, ${a}`}else if(s instanceof Dt){let a=this.findRowName(s,e,t),o=this.joinParentSeatingElementsNames(s,e,t);return k(o)?a:k(a)?o:s.namingStrategy===Kt.LeftRight?`${o} - ${a}`:s.namingStrategy===Kt.LeftRightMiddle?`${o} - ${a}`:`${o}, ${a}`}return null}static findSectorOrRowName(i,e){var t,s;let a=(s=(t=i.label)===null||t===void 0?void 0:t.texts)!==null&&s!==void 0?s:null;return k(a)?null:this.findLocalizedText(a,e)}static findRowName(i,e,t){let s=i.namingStrategy;switch(s){case Kt.Sequential:return this.findSectorOrRowName(i,t);case Kt.LeftRight:return this.findLeftRightRowName(i,e,t);case Kt.LeftRightMiddle:return this.findLeftRightMiddleRowName(i,e,t);default:Zt(s)}}static findLeftRightRowName(i,e,t){var s,a;let o=-1;for(let h=0;h<i.seats.length&&o<0;h++)i.seats[h].uniqueId===e.uniqueId&&(o=h);let u=o<i.seats.length/2?this.getLocalizedLeft(t):this.getLocalizedRight(t),c=(a=(s=i.label)===null||s===void 0?void 0:s.texts)!==null&&a!==void 0?a:null;if(k(c))return u;let l=this.findLocalizedText(c,t);return k(l)?u:`${u}, ${l}`}static findLeftRightMiddleRowName(i,e,t){var s,a;let o=-1;for(let I=0;I<i.seats.length&&o<0;I++)i.seats[I].uniqueId===e.uniqueId&&(o=I);let u=i.seats.length,c=Math.floor(u/2),l;o===c?l=this.getLocalizedMiddle(t):l=o<i.seats.length/2?this.getLocalizedLeft(t):this.getLocalizedRight(t);let h=(a=(s=i.label)===null||s===void 0?void 0:s.texts)!==null&&a!==void 0?a:null;if(k(h))return l;let p=this.findLocalizedText(h,t);return k(p)?l:`${l}, ${p}`}static findLocalizedText(i,e){let t=i.get(e);if(_(t))return t;let s=i.get($.English);if(_(s))return s;for(let[,a]of i)if(_(a))return a;return null}static getLocalizedLeft(i){switch(i){case $.English:return"Left";case $.Romanian:return"St\xE2nga";case $.Hungarian:return"Bal";default:Zt(i)}}static getLocalizedRight(i){switch(i){case $.English:return"Right";case $.Romanian:return"Dreapta";case $.Hungarian:return"Jobb";default:Zt(i)}}static getLocalizedSeat(i){switch(i){case $.English:return"Seat";case $.Romanian:return"Loc";case $.Hungarian:return"Sz\xE9k";default:Zt(i)}}static findSeatProperName(i,e){var t;let s=(t=i.parent)===null||t===void 0?void 0:t.deref();if(_(s)&&s instanceof Dt){if(s.namingStrategy===Kt.Sequential){let a=s.seats.indexOf(i);return a>
2=0?`${this.getSeatInRightOrder(a+s.firstLabelingOrdinal,e)}`:null}else if(s.namingStrategy===Kt.LeftRight){let a=s.seats.length,o=a/2,u=s.seats.indexOf(i);return u<o?`${this.getSeatInRightOrder(u+s.firstLabelingOrdinal,e)}`:`${this.getSeatInRightOrder(a-1-u+s.firstLabelingOrdinal,e)}`}else if(s.namingStrategy===Kt.LeftRightMiddle){let a=s.seats.length,o=Math.floor(a/2),u=s.seats.indexOf(i);return u===o?this.getLocalizedMiddleSeat(e):u<o?`${this.getSeatInRightOrder(u+s.firstLabelingOrdinal,e)}`:`${this.getSeatInRightOrder(a-1-u+s.firstLabelingOrdinal,e)}`}}return null}static getSeatInRightOrder(i,e){switch(e){case $.English:return`${this.getLocalizedSeat(e)} ${i}`;case $.Romanian:return`${this.getLocalizedSeat(e)} ${i}`;case $.Hungarian:return`${i}. ${this.getLocalizedSeat(e)}`;default:Zt(e)}}static getLocalizedMiddle(i){switch(i){case $.English:return"Middle";case $.Romanian:return"Mijloc";case $.Hungarian:return"K\xF6z\xE9p";default:Zt(i)}}static getLocalizedMiddleSeat(i){switch(i){case $.Hungarian:return`${Of} ${this.getLocalizedSeat(i)}`;case $.English:return`${this.getLocalizedSeat(i)} ${Of}`;case $.Romanian:return`${this.getLocalizedSeat(i)} ${Of}`;default:Zt(i)}}},st=(function(n){return n.Legacy="legacy",n.Calendar="calendar",n.Ticket="ticket",n.Pool="pool",n.PointOfInterest="poi",n.Gym="gym",n.TicketBooking="ticket-booking",n})(st||{}),j=(()=>{class n{constructor(e,t,s){if(this.uniqueId=e,this.organizationId=t,this.moduleType=s,this.encoded=n.encode(e,t,s),e.length<=0)throw new Error("uniqueId must not be empty")}static create(e,t,s){return new n(e,t,s)}static legacy(e){return new n(e,null,st.Legacy)}get isLegacy(){return this.moduleType===st.Legacy}encode(){return this.encoded}toString(){return this.encoded}clone(){return k(this.organizationId)||this.organizationId.length<=0?n.legacy(this.uniqueId):n.create(this.uniqueId,this.organizationId,this.moduleType)}isSame(e){return this===e?!0:e.encoded===this.encoded}static encode(e,t=null,s=null){if(k(t)||t.length<=0)return e;let a=[];return a.push(t),a.push(e),(s??st.Legacy)!==st.Legacy&&a.push(m(s)),a.join(this.BUSINESS_REF_DELIMITER)}static mustDecode(e){let t=this.decode(e);if(k(t))throw new ie(`The provided string is not a valid encoded business module reference: ${e}`);return t}static decode(e){if(_(e)&&e.length>0){let t=e.split(this.BUSINESS_REF_DELIMITER);if(t.length>=3)return n.create(t[1],t[0],y(t[2],st));if(t.length==2)return n.create(t[1],t[0],st.Legacy);if(t.length==1)return n.legacy(t[0])}return null}}return n.BUSINESS_REF_DELIMITER=":",n})(),Si=class{static round(i){if(i===1/0)throw new ke("Infinity can not be rounded.");return Math.round(Math.abs(i))*Math.sign(i)}static toInt(i){if(i===1/0)throw new ke("Infinity can not be converted to int.");return Math.floor(Math.abs(i))*Math.sign(i)}static lerp(i,e,t){return(1-t)*i+t*e}static clamp(i,e,t){return Math.max(e,Math.min(t,i))}},Ae=(function(n){return n.USD="USD",n.EUR="EUR",n.RON="RON",n.HUF="HUF",n})(Ae||{}),Ax=new Map([[Ae.USD,"$"],[Ae.EUR,"\u20AC"],[Ae.RON,"Lei"],[Ae.HUF,"Ft"]]),Cx=new Map([[Ie.Austria,Ae.EUR],[Ie.Hungary,Ae.HUF],[Ie.Romania,Ae.RON],[Ie.Slovakia,Ae.EUR],[Ie.Slovenia,Ae.EUR]]);function Du(n){let i=Ax.get(n);return _(i)?i:"$"}function fR(n){let i=Cx.get(n);if(_(i))return i;throw new Error(`Failed to get currency of country: ${n}`)}function vu(n,i){switch(n){case Ae.EUR:return`${Du(n)} ${i}`;case Ae.USD:return`${Du(n)} ${i}`;case Ae.HUF:return`${i} ${Du(n)}`;case Ae.RON:return`${i} ${Du(n)}`}}function kx(n,i,e){return n===Ae.HUF?Si.toInt(i/e)*e:i}var Y=class n{constructor(i,e,t,s){this._currency=i,this._coins=t,this._value=s!==!0?kx(i,e,t):e}static withCurrencyFromUnits(i,e){let t=Xs(i);return new n(i,e,t)}static withCurrencyOfCountryFromUnits(i,e){let t=fR(i),s=Xs(t);return new n(t,e,s)}static withCurrencyFromAmount(i,e){let t=Xs(i);return new n(i,Si.round(e*t),t)}static withCurrencyOfCountryFromAmount(i,e){let t=fR(i),s=Xs(t);return new n(t,Si.round(e*s),s)}static zero(i){return n.withCurrencyFromUnits(i,0)}static zeroWithCurrencyOfCountry(i){return n.withCurrencyOfCountryFromUnits(i,0)}static decodeOrNull(i){return k(i)?null:n.decode(i)}static decode(i){if(i!==null&&i.length>0){let e=i.match(this.encodedPriceMatcher);if(e&&e.length>2){let t=e[1];if(t){let s=parseInt(e[2]);return new n(t,s,Xs(t),!0)}}}throw new Error(`Invalid encoded price: ${i}`)}get currency(){return this._currency}get value(){return this._value}get convertToCents(){return this._value}get convertToDecimal(){return Math.round((this._value/this._coins+Number.EPSILON)*100)/100}get convertToDouble(){return this._value/this._coins}get convertToInt(){return Si.toInt(this._value/this._coins)}format(i){switch(i=i??"$A",i){case"F":return this.convertToInt.toFixed(0);case"$F":return vu(this._currency,this.convertToInt.toFixed(0));case"D":return this.convertToDouble.toFixed(2);case"$D":return vu(this._currency,this.convertToDouble.toFixed(2));case"A":return this.currency==Ae.HUF?this.convertToInt.toFixed(0):this.convertToDouble.toFixed(2);default:return this.currency==Ae.HUF?vu(this._currency,this.convertToInt.toFixed(0)):vu(this._currency,this.convertToDouble.toFixed(2))}}encode(){return`${this._currency}:${this._value}`}clone(){return new n(this._currency,this._value,this._coins)}isEqualTo(i){if(i.currency!==this.currency)throw new ke("You cannot add two prices with different currencies");return this._value<i._value?!1:!(this._value>i._value)}compareTo(i){if(i.currency!==this.currency)throw new ke("You cannot add two prices with different currencies");return this._value<i._value?-1:this._value>i._value?1:0}add(i){if(i==null)return n.withCurrencyFromUnits(this._currency,this._value);if(i.currency!==this.currency)throw new ke("You cannot add two prices with different currencies");return n.withCurrencyFromUnits(this._currency,this._value+i._value)}difference(i){if(i==null)return n.withCurrencyFromUnits(this._currency,this._value);if(i.currency!==this.currency)throw new ke("You cannot add two prices with different currencies");return n.withCurrencyFromUnits(this._currency,this._value-i._value)}negative(){return new n(this._currency,-this._value,this._coins)}scale(i){let e=Si.round(this._value*i);return n.withCurrencyFromUnits(this.currency,e)}exchange(i,e){let t=Si.toInt(this._value*e);return n.withCurrencyFromUnits(i,t)}isSame(i){return this===i?!0:i._value===this._value&&i._currency===this._currency}toString(){return this.encode()}isNegative(){return this.value<0}isPositive(){return this.value>0}isZero(){return!this.isNegative()&&!this.isPositive()}static max(i,e){if(i.currency!==e.currency)throw new ke("You cannot compare two prices with different currencies");return n.withCurrencyFromUnits(i._currency,Math.max(i._value,e._value))}static min(i,e){if(i.currency!==e.currency)throw new ke("You cannot compare two prices with different currencies");return n.withCurrencyFromUnits(i._currency,Math.min(i._value,e._value))}static calculateNetAndVatPriceBreakdown({grossUnitPrice:i,quantity:e,vatRatio:t}){let s=i.value*e,a=i.value*(1/(1+t)),o=a*e,u=s-o,c=Xs(i.currency);return{netUnitPrice:new n(i.currency,a,c,!0),netTotalPrice:new n(i.currency,o,c,!0),vatTotalPrice:new n(i.currency,u,c,!0)}}};Y.encodedPriceMatcher=new RegExp("^([A-Z]+):-*([0-9]+)$");var _x=new Map([[Ae.USD,100],[Ae.EUR,100],[Ae.RON,100],[Ae.HUF,100]]);function Xs(n){let i=_x.get(n);if(_(i))return i;throw new Error(`Failed to get coins per currency for currency: ${n}`)}var qd=(function(n){return n.Percentage="Percentage",n.Fixed="Fixed",n.DownToPrice="DownToPrice",n})(qd||{}),ro=class extends b{},No=(()=>{class n extends ro{constructor(e){super(),this.discount=e,this.type=qd.Percentage}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.get(t,"discount"))}toMap(e){return{discount:this.discount}}clone(){return new n(this.discount)}isSame(e){return this===e?!0:e.discount==this.discount}calculateDiscount(e){let s=Math.max(0,Math.min(100,this.discount))/100;return e.scale(s)}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="e7fa8cfc09204106be3f271526b6414f",n})(),Vf=class extends f{build(i,e){return No.fromMap(i,e)}},zw=(()=>{class n extends ro{constructor(e){super(),this.price=e,this.type=qd.Fixed}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(Y.decode(r.get(t,"price")))}toMap(e){return{price:this.price.encode()}}clone(){return new n(this.price.clone())}isSame(e){return this===e?!0:d(e.price,this.price)}calculateDiscount(e){if(e.currency!=this.price.currency)return Y.zero(e.currency);let t=Math.max(0,Math.min(e.value,this.price.value));
2return Y.withCurrencyFromUnits(e.currency,t)}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="05a550a472df440aa4388c35cf6378ee",n})(),zf=class extends f{build(i,e){return zw.fromMap(i,e)}},Uw=(()=>{class n extends ro{constructor(e){super(),this.price=e,this.type=qd.DownToPrice}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(Y.decode(r.get(t,"price")))}toMap(e){return{price:this.price.encode()}}clone(){return new n(this.price.clone())}isSame(e){return this===e?!0:d(e.price,this.price)}calculateDiscount(e){return e.currency!=this.price.currency||e.compareTo(this.price)<=0?Y.zero(e.currency):e.difference(this.price)}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="67d3268a7b9445c09b7876de91cc951a",n})(),Uf=class extends f{build(i,e){return Uw.fromMap(i,e)}},Ke=(function(n){return n.Percentage="Percentage",n.Fixed="Fixed",n.DownToPrice="DownToPrice",n.Legacy="Legacy",n.Tracking="Tracking",n})(Ke||{}),Tn=(()=>{class n extends b{constructor(e,t,s,a,o,u,c,l){if(super(),this.businessRef=e,this.voucherId=t,this.voucherValue=s,this.code=a,this.type=o,this.fixedPrice=u,this.percentage=c,this.isPromoCode=l,_(c)&&(c<0||c>100))throw new Error("Invalid discount value")}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static create(e){return new n(e.businessRef,e.voucherId,e.voucherValue,e.code,e.type,e.fixedPrice,e.percentage,e.isPromoCode)}static legacy(e){return this.create({businessRef:e.businessRef,voucherId:e.voucherId,voucherValue:null,code:e.code,type:Ke.Legacy,fixedPrice:null,percentage:e.percentage,isPromoCode:!0})}static percentage(e){return this.create({businessRef:e.businessRef,voucherId:e.voucherId,voucherValue:e.voucherValue,code:e.code,type:Ke.Percentage,fixedPrice:null,percentage:e.percentage,isPromoCode:!1})}static fixed(e){return this.create({businessRef:e.businessRef,voucherId:e.voucherId,voucherValue:e.value.clone(),code:e.code,type:Ke.Fixed,fixedPrice:e.value.clone(),percentage:null,isPromoCode:!1})}static downToPrice(e){return this.create({businessRef:e.businessRef,voucherId:e.voucherId,voucherValue:null,code:e.code,type:Ke.DownToPrice,fixedPrice:e.value.clone(),percentage:null,isPromoCode:!1})}static tracking(e){return this.create({businessRef:e.businessRef,voucherId:e.voucherId,voucherValue:null,code:e.code,type:Ke.Tracking,fixedPrice:null,percentage:null,isPromoCode:!0})}static promoCode(e){let t=(s,a,o)=>this.create({businessRef:e.businessRef,voucherId:e.voucherId,voucherValue:null,code:e.code,type:s,fixedPrice:o,percentage:a,isPromoCode:!0});if(No.assertType(e.protocol))return t(Ke.Percentage,e.protocol.discount,null);if(zw.assertType(e.protocol))return t(Ke.Fixed,null,e.protocol.price);if(Uw.assertType(e.protocol))return t(Ke.DownToPrice,null,e.protocol.price);throw new Error(`Unknown promo code protocol: ${e.protocol.$typeId}`)}static fromMap(e,t){return this.create({businessRef:j.mustDecode(r.getString(t,"businessRef")),voucherId:r.getStringOrNull(t,"voucherId"),voucherValue:Y.decodeOrNull(r.getStringOrNull(t,"voucherValue")),code:r.getStringOrNull(t,"code"),type:y(r.getString(t,"type"),Ke),fixedPrice:Y.decodeOrNull(r.getStringOrNull(t,"fixedPrice")),percentage:r.getNumberOrNull(t,"percentage"),isPromoCode:r.getBoolean(t,"isPromoCode")})}toMap(e){var t,s,a,o;return{businessRef:this.businessRef.encode(),voucherId:this.voucherId,voucherValue:(s=(t=this.voucherValue)===null||t===void 0?void 0:t.encode())!==null&&s!==void 0?s:null,code:this.code,type:m(this.type),fixedPrice:(o=(a=this.fixedPrice)===null||a===void 0?void 0:a.encode())!==null&&o!==void 0?o:null,percentage:this.percentage,isPromoCode:this.isPromoCode}}clone(){return this.copyWith()}isSame(e){return e===this?!0:e.voucherId===this.voucherId&&d(e.businessRef,this.businessRef)&&e.code===this.code&&e.type===this.type&&e.percentage===this.percentage&&e.isPromoCode===this.isPromoCode&&d(e.voucherValue,this.voucherValue)&&d(e.fixedPrice,this.fixedPrice)}copyWith({businessRef:e=F(this.businessRef),voucherId:t=this.voucherId,voucherValue:s=Z(this.voucherValue),code:a=this.code,type:o=this.type,fixedPrice:u=Z(this.fixedPrice),percentage:c=this.percentage,isPromoCode:l=this.isPromoCode}={}
2){return n.create({businessRef:e,voucherId:t,voucherValue:s,code:a,type:o,fixedPrice:u,percentage:c,isPromoCode:l})}}return n.TYPE_ID="8980aeabc4f34c83bcd56b5803c554ac",n.SCHEMA_VERSION=4,n})(),Bf=class extends f{build(i,e){return Tn.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(Tn.SCHEMA_VERSION))return e;if(t.isGreaterThan(Tn.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(e.code=e.voucherId,s=2),s<3&&(s=3),s<4&&(s=4),e.$schema_version=D.encodedExactly(s),e}migrateFromCurrentSchemaVersion(i,e,t){let s=e.$schemaVersion.to;if(s>=4){if(e.voucherId==null||e.code==null)return t;t.$schema_version=D.encodedBetween(1,4),s=1}return t}},fn=class{static fromTicketPass(i){return Tn.percentage({businessRef:i.businessRef.clone(),voucherId:i.uniqueId,voucherValue:i.productPrice.scale(1/i.maxUses),code:i.code,percentage:100})}static fromGiftCard(i,e){return Tn.fixed({businessRef:i.businessRef.clone(),voucherId:i.uniqueId,code:i.code,value:e??i.value.clone()})}static fromBusinessPromoCode(i){return Tn.promoCode({businessRef:i.businessRef.clone(),voucherId:i.uniqueId,code:i.code,protocol:i.protocol})}static fromEventPromoCode(i){return Tn.promoCode({businessRef:i.businessRef.clone(),voucherId:i.uniqueId,code:i.code,protocol:i.protocol})}static fromTrackingCode(i){return Tn.tracking({businessRef:i.businessRef.clone(),voucherId:i.uniqueId,code:i.code})}static fromLegacyPromoCode(i,e){return Tn.legacy({businessRef:i.clone(),voucherId:e.uniqueId,code:e.uniqueId,percentage:e.discount})}},T=(function(n){return n.Albania="AL",n.Andorra="AD",n.Armenia="AM",n.Austria="AT",n.Azerbaijan="AZ",n.Belarus="BY",n.Belgium="BE",n.BosniaAndHerzegovina="BA",n.Bulgaria="BG",n.Croatia="HR",n.Cyprus="CY",n.CzechRepublic="CZ",n.Denmark="DK",n.Estonia="EE",n.FaroeIslands="FO",n.Finland="FI",n.France="FR",n.Georgia="GE",n.Germany="DE",n.Gibraltar="GI",n.Greece="GR",n.Hungary="HU",n.Iceland="IS",n.Ireland="IE",n.Italy="IT",n.Latvia="LV",n.Liechtenstein="LI",n.Lithuania="LT",n.Luxembourg="LU",n.NorthMacedonia="MK",n.Malta="MT",n.RepublicOfMoldova="MD",n.Monaco="MC",n.Montenegro="ME",n.Netherlands="NL",n.Norway="NO",n.Poland="PL",n.Portugal="PT",n.Romania="RO",n.Russia="RU",n.SanMarino="SM",n.Serb
2ia="RS",n.Slovakia="SK",n.Slovenia="SI",n.Spain="ES",n.Sweden="SE",n.Switzerland="CH",n.Turkey="TR",n.Ukraine="UA",n.UnitedKingdom="GB",n.VaticanCity="VA",n})(T||{}),xx=new Map([[T.Albania,"+355"],[T.Andorra,"+376"],[T.Armenia,"+374"],[T.Austria,"+43"],[T.Azerbaijan,"+994"],[T.Belarus,"+375"],[T.Belgium,"+32"],[T.BosniaAndHerzegovina,"+387"],[T.Bulgaria,"+359"],[T.Croatia,"+385"],[T.Cyprus,"+357"],[T.CzechRepublic,"+420"],[T.Denmark,"+45"],[T.Estonia,"+372"],[T.FaroeIslands,"+298"],[T.Finland,"+358"],[T.France,"+33"],[T.Georgia,"+995"],[T.Germany,"+49"],[T.Gibraltar,"+350"],[T.Greece,"+30"],[T.Hungary,"+36"],[T.Iceland,"+354"],[T.Ireland,"+353"],[T.Italy,"+39"],[T.Latvia,"+371"],[T.Liechtenstein,"+423"],[T.Lithuania,"+370"],[T.Luxembourg,"+352"],[T.NorthMacedonia,"+389"],[T.Malta,"+356"],[T.RepublicOfMoldova,"+373"],[T.Monaco,"+377"],[T.Montenegro,"+382"],[T.Netherlands,"+31"],[T.Norway,"+47"],[T.Poland,"+48"],[T.Portugal,"+351"],[T.Romania,"+40"],[T.Russia,"+7"],[T.SanMarino,"+378"],[T.Serbia,"+381"],[T.Slovakia,"+421"],[T.Slovenia,"+386"],[T.Spain,"+34"],[T.Sweden,"+46"],[T.Switzerland,"+41"],[T.Turkey,"+90"],[T.Ukraine,"+380"],[T.UnitedKingdom,"+44"],[T.VaticanCity,"+379"]]),Fx=new Map([["+355",T.Albania],["+376",T.Andorra],["+374",T.Armenia],["+43",T.Austria],["+994",T.Azerbaijan],["+375",T.Belarus],["+32",T.Belgium],["+387",T.BosniaAndHerzegovina],["+359",T.Bulgaria],["+385",T.Croatia],["+357",T.Cyprus],["+420",T.CzechRepublic],["+45",T.Denmark],["+372",T.Estonia],["+298",T.FaroeIslands],["+358",T.Finland],["+33",T.France],["+995",T.Georgia],["+49",T.Germany],["+350",T.Gibraltar],["+30",T.Greece],["+36",T.Hungary],["+354",T.Iceland],["+353",T.Ireland],["+39",T.Italy],["+371",T.Latvia],["+423",T.Liechtenstein],["+370",T.Lithuania],["+352",T.Luxembourg],["+389",T.NorthMacedonia],["+356",T.Malta],["+373",T.RepublicOfMoldova],["+377",T.Monaco],["+382",T.Montenegro],["+31",T.Netherlands],["+47",T.Norway],["+68",T.Poland],["+48",T.Poland],["+351",T.Portugal],["+40",T.Romania],["+7",T.Russia],["+378",T.SanMarino],["+381",T.Serbia],["+421",T.Slovakia],["+386",T.Slovenia],["+34",T.Spain],["+46",T.Sweden],["+41",T.Switzerland],["+90",T.Turkey],["+380",T.Ukraine],["+44",T.UnitedKingdom],["+379",T.VaticanCity]]),qx=new Map([[Ie.Austria,T.Austr
2ia],[Ie.Hungary,T.Hungary],[Ie.Romania,T.Romania],[Ie.Slovakia,T.Slovakia],[Ie.Slovenia,T.Slovenia]]);function Xi(n){return xx.get(n)}function Yx(n){return Fx.get(n)}function $x(n){return qx.get(n)}var ao=class{},de=class extends ao{constructor(){super()}format(i){return`${Xi(i.country)}${i.number}`}},Hf=class extends ao{constructor(){super(...arguments),this.formattedNumber=""}format(i){return this.formattedNumber+=Xi(i.country),this.formattedNumber+=" ",i.number[0]==="1"?(this.formattedNumber+=i.number.substring(0,1),this.formattedNumber+=" ",this.formattedNumber+=i.number.substring(1,4),this.formattedNumber+=" ",this.formattedNumber+=i.number.substring(4)):(this.formattedNumber+=i.number.substring(0,2),this.formattedNumber+=" ",this.formattedNumber+=i.number.substring(2,5),this.formattedNumber+=" ",this.formattedNumber+=i.number.substring(5)),this.formattedNumber}},Gf=class extends ao{constructor(){super(...arguments),this.formattedNumber=""}format(i){return this.formattedNumber+=Xi(i.country),this.formattedNumber+=" ",this.formattedNumber+=i.number.substring(0,3),this.formattedNumber+=" ",this.formattedNumber+=i.number.substring(3,6),this.formattedNumber+=" ",this.formattedNumber+=i.number.substring(6),this.formattedNumber}},zl=class{static ofCountry(i){let e=this.builders.get(i);if(k(e))throw Error(`Failed to find formatter for country ${i}`);return e}};zl.builders=new Map([[T.Albania,new de],[T.Andorra,new de],[T.Armenia,new de],[T.Austria,new de],[T.Azerbaijan,new de],[T.Belarus,new de],[T.Belgium,new de],[T.BosniaAndHerzegovina,new de],[T.Bulgaria,new de],[T.Croatia,new de],[T.Cyprus,new de],[T.CzechRepublic,new de],[T.Denmark,new de],[T.Estonia,new de],[T.FaroeIslands,new de],[T.Finland,new de],[T.France,new de],[T.Georgia,new de],[T.Germany,new de],[T.Gibraltar,new de],[T.Greece,new de],[T.Hungary,new Hf],[T.Iceland,new de],[T.Ireland,new de],[T.Italy,new de],[T.Latvia,new de],[T.Liechtenstein,new de],[T.Lithuania,new de],[T.Luxembourg,new de],[T.NorthMacedonia,new de],[T.Malta,new de],[T.RepublicOfMoldova,new de],[T.Monaco,new de],[T.Montenegro,new de],[T.Netherlands,new de],[T.Norway,new de],[T.Poland,new de],[T.Portugal,new de],[T.Romania,new Gf],[T.Russia,new de],[T.SanMarino,new de],[T.Serbia,new de],[T.Slovakia,new de],[T.Slovenia,new de],[T.Spain,new de],[T.Sweden,new de],[T.Switzerland,new de],[T.Turkey,new de],[T.Ukraine,new de],[T.UnitedKingdom,new de],[T.VaticanCity,new de]]);var Gr=(()=>{class n{constructor(e){this.buffer=e,this.byteOffset=0}static fromBytes(e){return new n(Na.Buffer.from(e))}skip(e){e>=0&&(this.byteOffset+=e)}seek(e){this.byteOffset=Math.max(0,Math.min(e,this.buffer.byteLength))}reset(){this.byteOffset=0}readBool(){return this.readByte()===1}peekByte(){if(this.byteOffset>=this.buffer.byteLength)throw new ie(`Byte offset ${this.byteOffset} out of range [0...${this.buffer.byteLength})`);return this.buffer.readUInt8(this.byteOffset)}readByte(){if(this.byteOffset>=this.buffer.byteLength)throw new ie(`Byte offset ${this.byteOffset} out of range [0...${this.buffer.byteLength})`);return this.buffer.readUInt8(this.byteOffset++)}readBytes(e){if(this.byteOffset>=this.buffer.byteLength)throw new ie(`Byte offset ${this.byteOffset} out of range [0...${this.buffer.byteLength})`);let t=new Uint8Array(e);for(let s=0;s<e;s++)t[s]=this.buffer.readUInt8(this.byteOffset++);return t}readUint8(){if(this.byteOffset>=this.buffer.byteLength)throw new ie(`Byte offset ${this.byteOffset} out of range [0...${this.buffer.byteLength})`);return this.buffer.readUInt8(this.byteOffset++)}readUint16(){if(this.byteOffset>=this.buffer.byteLength)throw new ie(`Byte offset ${this.byteOffset} out of range [0...${this.buffer.byteLength})`);let e=this.buffer.readUInt16BE(this.byteOffset);return this.byteOffset+=n.kBytesPerInt16,e}readUint32(){if(this.byteOffset>=this.buffer.byteLength)throw new ie(`Byte offset ${this.byteOffset} out of range [0...${this.buffer.byteLength})`);let e=this.buffer.readUInt32BE(this.byteOffset);return this.byteOffset+=n.kBytesPerInt32,e}readInt8(){if(this.byteOffset>=this.buffer.byteLength)throw new ie(`Byte offset ${this.byteOffset} out of range [0...${this.buffer.byteLength})`);return this.buffer.readInt8(this.byteOffset++)}readInt16(){if(this.byteOffset>=this.buffer.byteLength)throw new ie(`Byte offset ${this.byteOffset} out of range [0...${this.buffer.byteLength})`);let e=this.buffer.readInt16BE(this.byteOffset);return this.byteOffset+=n.kBytesPerInt16,e}readInt32(){if(this.byteOffset>=this.buffer.byteLength)throw new ie(`Byte offset ${this.byteOffset} out of range [0...${this.buffer.byteLength})`);let e=this.buffer.readInt32BE(this.byteOffset);return this.byteOffset+=n.kBytesPerInt32,e}readFloat32(){if(this.byteOffset>=this.buffer.byteLength)throw new ie(`Byte offset ${this.byteOffset} out of range [0...${this.buffer.byteLength})`);let e=this.buffer.readFloatBE(this.byteOffset);return this.byteOffset+=n.kBytesPerFloat32,e}readFloat64(){if(this.byteOffset>=this.buffer.byteLength)throw new ie(`Byte offset ${this.byteOffset} out of range [0...${this.buffer.byteLength})`);let e=this.buffer.readDoubleBE(this.byteOffset);return this.byteOffset+=n.kBytesPerFloat64,e}}return n.kBytesPerInt16=2,n.kBytesPerInt32=4,n.kBytesPerFloat32=4,n.kBytesPerFloat64=8,n})(),vs=(()=>{class n{constructor(e=n.kDefaultBufferSize){this.buffer=Na.Buffer.alloc(e),this.offset=0}toBytes(){return Uint8Array.prototype.slice.call(this.buffer,0,this.offset)}toMinimumBytes(){return Na.Buffer.from(this.buffer.subarray(0,this.offset))}writeBool(e){this.writeByte(e?1:0)}writeByte(e){this.reserveBytes(1),this.buffer.writeUInt8(e,this.offset++)}writeBytes(e){this.reserveBytes(e.byteLength);for(let t=0;t<e.byteLength;t++)this.buffer.writeUInt8(e[t],this.offset++)}writeUint8(e){this.reserveBytes(1),this.buffer.writeUInt8(e,this.offset++)}writeUInt16(e){this.reserveBytes(n.kBytesPerInt16),this.buffer.writeUInt16BE(e,this.offset),this.offset+=n.kBytesPerInt16}writeUInt32(e){this.reserveBytes(n.kBytesPerInt32),this.buffer.writeUInt32BE(e,this.offset),this.offset+=n.kBytesPerInt32}writeInt8(e){this.reserveBytes(1),this.buffer.writeInt8(e,this.offset++)}writeInt16(e){this.reserveBytes(n.kBytesPerInt16),this.buffer.writeInt16BE(e,this.offset),this.offset+=n.kBytesPerInt16}writeInt32(e){this.reserveBytes(n.kBytesPerInt32),this.buffer.writeInt32BE(e,this.offset),this.offset+=n.kBytesPerInt32}writeFloat32(e){this.reserveBytes(n.kBytesPerFloat32),this.buffer.writeFloatBE(e,this.offset),this.offset+=n.kBytesPerFloat32}writeFloat64(e){this.reserveBytes(n.kBytesPerFloat64),this.buffer.writeDoubleBE(e,this.offset),this.offset+=n.kBytesPerFloat64}reserveBytes(e){if(this.buffer.byteLength<this.offset+e){let t=n.powerOfTwo((this.offset+e)*2),s=Na.Buffer.alloc(t);this.buffer.copy(s),this.buffer=s}}static powerOfTwo(e){let t=e-1;return t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,t|=t>>32,t+1}}return n.kBytesPerInt16=2,n.kBytesPerInt32=4,n.kBytesPerFloat32=4,n.kBytesPerFloat64=8,n.kDefaultBufferSize=256,n})(),X=(()=>{class n extends Ll{constructor(e,t){super(e,t)}getError(){return n.ERROR}}return n.ERROR="Argument exception",n})(),Ul=class{constructor(i){this.writer=i??new vs}packByte(i){this.writer.writeByte(i)}packNull(){this.writer.writeByte(192)}packBool(i){i==null?this.writer.writeByte(192):this.writer.writeByte(i?195:194)}packInt(i){if(i==null){this.writer.writeByte(192);return}if(i>=0)if(i<=255)this.writer.writeByte(204),this.writer.writeUint8(i);else if(i<=65535)this.writer.writeByte(205),this.writer.writeUInt16(i);else if(i<=4294967295)this.writer.writeByte(206),this.writer.writeUInt32(i);else throw new X("value","Uint64 is not supported by BinaryPacker");else if(i>=-128)this.writer.writeByte(208),this.writer.writeInt8(i);else if(i>=-32768)this.writer.writeByte(209),this.writer.writeInt16(i);else if(i>=-2147483648)this.writer.writeByte(210),this.writer.writeInt32(i);else throw new X("value","Int64 is not supported by BinaryPacker")}packDouble(i){if(i==null){this.writer.writeByte(192);return}this.writer.writeByte(203),this.writer.writeFloat64(i)}packString(i,e){if(i==null||i.length<=0&&e?.emptyAsNull===!0){this.writer.writeByte(192);return}let t=Lx(i);this.packLength(t.length),this.writer.writeBytes(t)}packBinaryBlob(i){if(i==null){this.writer.writeByte(192);return}this.packLength(i.length),this.writer.writeBytes(i)}packLength(i){if(i==null)throw new X("value","NULL is not a valid length");if(i<0)throw new X("value",`${i} is not a valid length`);if(i<=255)this.writer.writeByte(204),this.writer.writeUint8(i);else if(i<=65535)this.writer.writeByte(205),this.writer.writeUInt16(i);else if(i<=4294967295)this.writer.writeByte(206),this.writer.writeUInt32(i);else throw new X("value","Max supported length is 0xFFFFFFFF")}takeBytes(){return this.writer.toBytes()}};function Lx(n){let i=n.length,e=!0;for(let a=0;a<i;a++)if(n.charCodeAt(a)>127){e=!1;break}let t=new Uint8Array(n.length*(e?1:4)),s=0;for(let a=0;a!==i;a++){let o=n.charCodeAt(a);if(o<128){t[s++]=o;continue}if(o<2048)t[s++]=o>>6|192;else{if(o>55295&&o<56320){if(++a>=i)throw new Error("UTF-8 encode: incomplete surrogate pair");let u=n.charCodeAt(a);if(u<56320||u>57343)throw new Error("UTF-8 encode: second surrogate character 0x"+u.toString(16)+" at index "+a+" out of range");o=65536+((o&1023)<<10)+(u&1023),t[s++]=o>>18|240,t[s++]=o>>12&63|128}else t[s++]=o>>12|224;t[s++]=o>>6&63|128}t[s++]=o&63|128}return e?t:t.subarray(0,s)}var Bl=class n{constructor(i){this.reader=i}static fromBytes(i){return new n(Gr.fromBytes(i))}unpackByte(){return this.reader.readByte()}unpackByteOrNull(){let i=this.reader.readByte();return i==192?null:i}unpackBool(){let i=this.unpackBoolOrNull();if(i==null)throw new Error("Unexpected null value");return i}unpackBoolOrNull(){let i=this.reader.readByte(),e=null;if(i==192)e=null;else if(i==194)e=!1;else if(i==195)e=!0;else throw this.formatException("bool",i);return e}unpackInt(){let i=this.unpackIntOrNull();if(i==null)throw new Error("Unexpected null value");return i}unpackIntOrNull(){let i=this.reader.readByte(),e=null;if(i==192)e=null;else if(i==204)e=this.reader.readUint8();else if(i==205)e=this.reader.readUint16();else if(i==206)e=this.reader.readUint32();else{if(i==207)throw new Error("Uint64 is not supported by BinaryUnpacker");if(i==208)e=this.reader.readInt8();else if(i==209)e=this.reader.readInt16();else if(i==210)e=this.reader.readInt32();else throw i==211?new Error("Int64 is not supported by BinaryUnpacker"):this.formatException("integer",i)}return e}unpackDouble(){let i=this.unpackDoubleOrNull();if(i==null)throw new Error("Unexpected null value");return i}unpackDoubleOrNull(){let i=this.reader.readByte(),e=null;if(i==192)e=null;else if(i==202)e=this.reader.readFloat32();else if(i==203)e=this.reader.readFloat64();else throw this.formatException("double",i);return e}unpackString(){let i=this.unpackStringOrNull();if(i==null)throw new Error("Unexpected null value");return i}unpackStringOrNull(){if(this.reader.peekByte()==192)return this.reader.readByte(),null;let e=this.unpackLength(),t=this.reader.readBytes(e);return Vx(t)}unpackBinaryBlob(){let i=this.unpackBinaryBlobOrNull();if(i==null)throw new Error("Unexpected null value");return i}unpackBinaryBlobOrNull(){if(this.reader.peekByte()==192)return this.reader.readByte(),null;let e=this.unpackLength();return this.reader.readBytes(e)}unpackLength(){let i=this.reader.readByte(),e=null;if(i==204)e=this.reader.readUint8();else if(i==205)e=this.reader.readUint16();else if(i==206)e=this.reader.readUint32();else throw this.formatException("length",i);return e}formatException(i,e){return new Error(`Try to unpack ${i} value, but it's not an ${i}, byte = 0x${e.toString(16)}`)}};function Vx(n){let i=0,e="",t=n.byteLength;for(;i<t;){let s=n[i++];if(s>127)if(s>191&&s<224){if(i>=t)throw new Error("UTF-8 decode: incomplete 2-byte sequence");s=(s&31)<<6|n[i++]&63}else if(s>223&&s<240){if(i+1>=t)throw new Error("UTF-8 decode: incomplete 3-byte sequence");s=(s&15)<<12|(n[i++]&63)<<6|n[i++]&63}else if(s>239&&s<248){if(i+2>=t)throw new Error("UTF-8 decode: incomplete 4-byte sequence");s=(s&7)<<18|(n[i++]&63)<<12|(n[i++]&63)<<6|n[i++]&63}else throw new Error("UTF-8 decode: unknown multibyte start 0x"+s.toString(16)+" at index "+(i-1));if(s<=65535)e+=String.fromCharCode(s);else if(s<=1114111)s-=65536,e+=String.fromCharCode(s>>10|55296),e+=String.fromCharCode(s&1023|56320);else throw new Error("UTF-8 decode: code point 0x"+s.toString(16)+" exceeds UTF-16 reach")}return e}var Wf=class extends ki{constructor(i){var e;super(),this.promoCode=i,this.uses=(e=this.promoCode.uses)!==null&&e!==void 0?e:0}findDiscountForSingleTicket(i){return!this.doesPromoCodeApplyToTicket(i)||this.promoCode.maxUses!=null&&this.uses>=this.promoCode.maxUses?null:this._findDiscountForSingleTicket()}findDiscountForMultipleTickets(i,e){return!this.doesPromoCodeApplyToTicket(i)||this.promoCode.maxUses!=null&&this.uses>=this.promoCode.maxUses?null:_(e)&&e>1?this._findDiscountForMultipleTickets(e,this.promoCode.maxUses):{discount:this._findDiscountForSingleTicket(),availableUses:1}}findDiscountForOrder(i){return null}reset(){var i;this.uses=(i=this.promoCode.uses)!==null&&i!==void 0?i:0}doesPromoCodeApplyToTicket(i){let e=this.promoCode.ticketId;return k(e)||e.includes(i)}_findDiscountForSingleTicket(){return this.uses++,fn.fromEventPromoCode(this.promoCode)}_findDiscountForMultipleTickets(i,e){let t=fn.fromEventPromoCode(this.promoCode),s=e==null?i:Math.min(i,e-this.uses);return this.uses+=s,{discount:t,availableUses:s}}},jf=class extends ki{constructor(i){super(),this.giftCard=i}findDiscountForMultipleTickets(i,e){return null}findDiscountForSingleTicket(i){return null}findDiscountForOrder(i){return fn.fromGiftCard(this.giftCard,Y.min(this.giftCard.remainingValue,i))}reset(){}},Jf=class extends ki{constructor(i){var e;super(),this.openPass=i,this.uses=(e=this.openPass.uses)!==null&&e!==void 0?e:0}findDiscountForSingleTicket(i){return!this.doesSeasonPassApplyToTicket(i)||this.uses>=this.openPass.maxUses?null:this._findDiscountForSingleTicket()}findDiscountForMultipleTickets(i,e){return!this.doesSeasonPassApplyToTicket(i)||this.uses>=this.openPass.maxUses?null:_(e)&&e>1?this._findDiscountForMultipleTickets(e):{discount:this._findDiscountForSingleTicket(),availableUses:1}}findDiscountForOrder(i){return null}reset(){var i;this.uses=(i=this.openPass.uses)!==null&&i!==void 0?i:0}doesSeasonPassApplyToTicket(i){let e=this.openPass.ticketId;return k(e)||e.includes(i)}_findDiscountForSingleTicket(){return this.uses++,fn.fromTicketPass(this.openPass)}_findDiscountForMultipleTickets(i){let e=fn.fromTicketPass(this.openPass),t=this.openPass.maxUses==null?i:Math.min(i,this.openPass.maxUses-this.uses);return this.uses+=t,{discount:e,availableUses:t}}},Kf=class extends ki{constructor(i){super(),this.trackingCode=i}
2findDiscountForMultipleTickets(i,e){return null}findDiscountForSingleTicket(i){return null}findDiscountForOrder(i){return fn.fromTrackingCode(this.trackingCode)}reset(){}};function zt(n){class i extends n{hasComponentByTypeId(t){return this.components.hasComponentByTypeId(t)}mustFindComponentByTypeId(t){return this.components.mustFindComponentByTypeId(t)}findComponentByTypeId(t){return this.components.findComponentByTypeId(t)}findComponentByInstanceId(t){return this.components.findComponentByInstanceId(t)}findComponentsByTypeId(t){return this.components.findComponentsByTypeId(t)}addComponent(t){this.components.addComponent(t)}addComponents(t){this.components.addComponents(t)}removeComponentByTypeId(t){return this.components.removeComponentByTypeId(t)}removeComponentByInstanceId(t){return this.components.removeComponentByInstanceId(t)}removeComponentAt(t){this.components.removeComponentAt(t)}removeAllComponents(){this.components.removeAllComponents()}popAllComponentsByTypeId(t){return this.components.popAllComponentsByTypeId(t)}popComponentByTypeId(t){return this.components.popComponentByTypeId(t)}popComponent(t){return this.components.popComponent(t)}replaceComponent(t){return this.components.replaceComponent(t)}addOrReplaceComponent(t){this.components.addOrReplaceComponent(t)}mustFindComponentField(t,s){return this.components.mustFindComponentField(t,s)}findComponentField(t,s){return this.components.findComponentField(t,s)}}return i}var Pe=(function(n){return n.Live="LIVE",n.Used="USED",n.Canceled="CANCELED",n.Refunded="REFUNDED",n.Archived="ARCHIVED",n})(Pe||{}),oo=class extends zt(b){static encodedStatusSafe(i){return m(i)}},uo=class extends oo{},ae=class n{constructor(i){this.components=[],i&&this.components.push(...i)}static deserialize(i,e){let t=[];for(let s of e)if(i.isSerializedData(s)){let a=i.fromData(s);t.push(a)}else if(i.unknownTypePolicy===_d.Throw){let a=r.getOrNull(s,"$type_id");throw new ie(`Unable to deserialize component list. Component data is not serializable: ${k(a)?JSON.stringify(s):a}`)}return new n(t)}serialize(i){return this.components.map(e=>i.toData(e))}any(i){for(let e=0;e<this.components.length;e++)if(i(this.components[e]))return!0;return!1}forEach(i){for(let e=0;e<this.components.length;e++)i(this.components[e])}hasComponentByTypeId(i){for(let e=0;e<this.components.length;e++)if(this.components[e].$typeId===i)return!0;return!1}mustFindComponentByTypeId(i){let e=this.findComponentByTypeId(i);if(!e)throw Error(`Component not found with type ID: ${i}`);return e}findComponentByTypeId(i){for(let e=0;e<this.components.length;e++)if(this.components[e].$typeId===i)return this.components[e];return null}findComponentByInstanceId(i){for(let e=0;e<this.components.length;e++)if(this.components[e].$instanceId===i)return this.components[e];return null}findComponentsByTypeId(i){let e=[];for(let t=0;t<this.components.length;t++)this.components[t].$typeId===i&&e.push(this.components[t]);return e}addComponent(i){this.components.push(i)}addComponents(i){this.components.push(...i)}removeComponentByTypeId(i){for(let e=0;e<this.components.length;e++)if(this.components[e].$typeId===i)return this.components.splice(e,1),!0;return!1}removeComponentByInstanceId(i){for(let e=0;e<this.components.length;e++)if(this.components[e].$instanceId===i)return this.components.splice(e,1),!0;return!1}removeComponentAt(i){if(i<0||i>=this.components.length)throw new RangeError(`Component index is out of range. Expected an index between {0} and {${this.components.length}} but got {${i}}.`);this.components.splice(i,1)}removeAllComponents(){this.components.length=0}popAllComponentsByTypeId(i){let e=[];for(let t=this.components.length-1;t>=0;t--)this.components[t].$typeId===i&&(e.push(this.components[t]),this.components.splice(t,1));return e}popComponentByTypeId(i){for(let e=0;e<this.components.length;e++)if(this.components[e].$typeId===i){let t=this.components[e];return this.components.splice(e,1),t}return null}popComponent(i){for(let e=0;e<this.components.length;e++)if(this.components[e]===i)return this.components.splice(e,1),i;return null}replaceComponent(i){for(let e=0;e<this.components.length;e++)if(this.components[e].$typeId===i.$typeId)return this.components[e]=i,!0;return!1}
2addOrReplaceComponent(i){for(let e=0;e<this.components.length;e++)if(this.components[e].$typeId==i.$typeId){this.components[e]=i;return}this.components.push(i)}mustFindComponentField(i,e){let t=this.mustFindComponentByTypeId(i);return e(t)}findComponentField(i,e){let t=this.findComponentByTypeId(i);return k(t)?null:e(t)}clone(){return new n(this.components.map(i=>i.clone()))}copyWithBusinessRef(i){let e=[];for(let t=0;t<this.components.length;t++){let s=this.components[t];Nf.isInstance(s)?e.push(s.copyWithBusinessRef(i)):e.push(s.clone())}return new n(e)}isSame(i){return this===i?!0:P(i.components,this.components,(e,t)=>e.isSame(t))}},dr=(()=>{class n extends uo{constructor(e,t,s,a,o,u,c,l,h,p,I,v,E,w,S){super(),this.uniqueId=e,this.code=t,this.businessRef=s,this.creationDate=a,this.eventId=o,this.ticketId=u,this.protocol=c,this.descriptions=l,this.startDate=h,this.expirationDate=p,this.components=I,this._status=v,this._usedAt=E,this._maxUses=w,this._uses=S}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(3,n.SCHEMA_VERSION)}get status(){return this._status}get usedAt(){return this._usedAt}get maxUses(){return this._maxUses}get uses(){return this._uses}static basic(e){var t;return new n(e.uniqueId,e.code,e.businessRef,fe.now(),e.eventId,e.ticketId,e.protocol,e.descriptions,e.startDate,e.expirationDate,(t=e.components)!==null&&t!==void 0?t:new ae,Pe.Live,null,e.maxUses,null)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.get(t,"code"),j.mustDecode(r.get(t,"businessRef")),g.decodeDate(r.get(t,"creationDate")),r.get(t,"eventId"),r.getListOrNull(t,"ticketId",s=>s),e.fromData(r.get(t,"protocol")),e.fromDataOrNull(r.getOrNull(t,"descriptions")),g.decodeDateOrNull(r.getOrNull(t,"startDate")),g.decodeDateOrNull(r.getOrNull(t,"expirationDate")),ae.deserialize(e,r.getList(t,"components",s=>s)),y(r.get(t,"$status"),Pe),g.decodeDateOrNull(r.getOrNull(t,"usedAt")),r.getOrNull(t,"maxUses"),r.getOrNull(t,"uses"))}toMap(e){return{uniqueId:this.uniqueId,code:this.code,businessRef:this.businessRef.encode(),creationDate:g.encodeDate(this.creationDate),$status:m(this.status),usedAt:g.encodeDateOrNull(this.usedAt),startDate:g.encodeDateOrNull(this.startDate),expirationDate:g.encodeDateOrNull(this.expirationDate),eventId:this.eventId,ticketId:this.ticketId,protocol:e.toData(this.protocol),maxUses:this.maxUses,uses:this.uses,descriptions:e.toDataOrNull(this.descriptions),components:this.components.serialize(e)}}clone(){var e,t,s,a;return new n(this.uniqueId,this.code,this.businessRef.clone(),g.cloneDate(this.creationDate),this.eventId,et(this.ticketId),(t=(e=this.protocol)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null,(a=(s=this.descriptions)===null||s===void 0?void 0:s.clone())!==null&&a!==void 0?a:null,g.cloneDateOrNull(this.startDate),g.cloneDateOrNull(this.expirationDate),this.components.clone(),this.status,g.cloneDateOrNull(this.usedAt),this.maxUses,this.uses)}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.code===this.code&&d(e.businessRef,this.businessRef)&&e.creationDate===this.creationDate&&e.status===this.status&&e.usedAt===this.usedAt&&e.startDate===this.startDate&&e.expirationDate===this.expirationDate&&e.eventId===this.eventId&&P(e.ticketId,this.ticketId)&&d(e.protocol,this.protocol)&&e.maxUses===this.maxUses&&e.uses===this.uses&&d(e.descriptions,this.descriptions)&&e.components.isSame(this.components)}updateUsage(e){var t;this.status!==Pe.Live||k(this._maxUses)||(this._uses=Math.min(this._maxUses,((t=this._uses)!==null&&t!==void 0?t:0)+1),this._uses>=this._maxUses&&(this._usedAt=fe.now(),this._status=Pe.Used))}tryUpdateUsage(e,t){var s,a;let o=this.clone();return o.status!==Pe.Live?W.error(new Error(`Voucher status {${o.status}} is not ${Pe.Live}.`)):o._maxUses==null?(o._uses=((s=o._uses)!==null&&s!==void 0?s:0)+1,W.ok(o)):(o._uses=Math.min(o._maxUses,((a=o._uses)!==null&&a!==void 0?a:0)+1),o._uses>=o._maxUses&&(o._usedAt=t,o._status=Pe.Used),W.ok(o))}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="dda4acf20f944f35baf8a2f535fd2d62",n.SCHEMA_VERSION=5,n})(),Zf=class extends f{build(i,e){return dr.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(dr.SCHEMA_VERSION))return e;if(t.isGreaterThan(dr.SCHEMA_VERSION))return null;let s=t.to;if(s<2&&(e.code=e.uniqueId,s=2),s<3){let a=r.get(e,"discount");e.protocol=i.toData(new No(a)),s=3}return s<4&&(s=4),s<5&&(s=5),e.$schema_version=D.encodedExactly(s),e}},Ca=(()=>{class n extends G{constructor(e,t,s,a,o){super(),this.includedEvents=e,this.excludedEvents=t,this.value=s,this.startDate=a,this.expirationDate=o}get $removable(){return!1}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(4,n.SCHEMA_VERSION)}static create(e){return new n(e.includedEvents,e.excludedEvents,e.value,e.startDate,e.expirationDate)}static fromMap(e,t){return new n(r.getListOrNull(t,"includedEvents",s=>s),r.getListOrNull(t,"excludedEvents",s=>s),Y.decode(r.get(t,"value")),g.decodeDateOrNull(r.getOrNull(t,"startDate")),g.decodeDateOrNull(r.getOrNull(t,"expirationDate")))}toMap(e){return{includedEvents:this.includedEvents,excludedEvents:this.excludedEvents,value:this.value.encode(),startDate:g.encodeDateOrNull(this.startDate),expirationDate:g.encodeDateOrNull(this.expirationDate)}}clone(){return new n(et(this.includedEvents),et(this.excludedEvents),this.value.clone(),g.cloneDateOrNull(this.startDate),g.cloneDateOrNull(this.expirationDate))}isSame(e){return e===this?!0:P(e.includedEvents,this.includedEvents)&&P(e.excludedEvents,this.excludedEvents)&&d(e.value,this.value)&&e.startDate===this.startDate&&e.expirationDate===this.expirationDate}}return n.TYPE_ID="b54ebc0354ca41c5b900823ebab8a5ab",n.SCHEMA_VERSION=5,n})(),Xf=class extends f{build(i,e){return Ca.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(Ca.SCHEMA_VERSION))return e;if(t.isGreaterThan(Ca.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(s=2),s<3&&(s=3),s<4&&(e.includedEvents=e.eventId,s=4),s<5&&(s=5),e.$schema_version=D.encodedExactly(s),e}},qR=(function(n){return n.LoupeGiftCard="LOUPE_GIFT_CARD",n})(qR||{}),Bw=(()=>{class n extends G{constructor(e){super(),this.attachments=e}get $typeId(){return n.TYPE_ID}get $removable(){return!0}static fromMap(e,t){return new n(r.getList(t,"attachments",s=>y(s,qR)))}toMap(e){return{attachments:this.attachments.map(t=>m(t))}}clone(){return new n(Te(this.attachments))}isSame(e){return e===this?!0:P(e.attachments,this.attachments)}}return n.TYPE_ID="79e6b51a6d9d4d3cb7b52234323ee3ff",n})(),Qf=class extends f{build(i,e){return Bw.fromMap(i,e)}},ui=(()=>{class n extends oo{constructor(e,t,s,a,o,u,c,l,h,p,I,v,E,w,S,R,x){super(),this.uniqueId=e,this.businessRef=t,this.creationDate=s,this.orderId=a,this.customerId=o,this.productId=u,this.productPrice
2=c,this.value=l,this.components=h,this.startDate=p,this.expirationDate=I,this.serialNumber=v,this._status=S,this._usedAt=R,this._usedValue=x,this._includedEvents=E,this._excludedEvents=w}get $typeId(){return n.TYPE_ID}get code(){return this.uniqueId}get status(){return this._status}get usedAt(){return this._usedAt}get usedValue(){return this._usedValue}get remainingValue(){return _(this._usedValue)?this.value.difference(this._usedValue):this.value}get includedEvents(){return this._includedEvents}get excludedEvents(){return this._excludedEvents}get $schemaVersion(){return D.between(5,n.SCHEMA_VERSION)}static create(e){return new n(e.uniqueId,e.businessRef,e.creationDate,e.orderId,e.customerId,e.productId,e.productPrice,e.value,e.components,e.startDate,e.expirationDate,e.serialNumber,e.includedEvents,e.excludedEvents,e.status,e.usedAt,e.usedValue)}static fromProductOfOrder(e,t){let s=t.findComponentByTypeId(Ca.TYPE_ID);if(k(s)||k(e.customerId))return null;let a=new ae([]),o=t.findComponentByTypeId(Bw.TYPE_ID);return _(o)&&a.addComponent(o.clone()),this.create({uniqueId:n.generatePromoCode(),businessRef:e.businessRef.clone(),creationDate:fe.now(),orderId:e.uniqueId,customerId:e.customerId,productId:t.uniqueId,productPrice:t.price.clone(),value:s.value.clone(),components:a,startDate:s.startDate,expirationDate:s.expirationDate,includedEvents:et(s.includedEvents),excludedEvents:et(s.excludedEvents),status:Pe.Live,usedAt:null,usedValue:null,serialNumber:null})}static fromMap(e,t){return this.create({uniqueId:r.getString(t,"uniqueId"),businessRef:j.mustDecode(r.getString(t,"businessRef")),creationDate:g.decodeDate(r.get(t,"creationDate")),orderId:r.getString(t,"orderId"),customerId:r.getString(t,"customerId"),productId:r.getString(t,"productId"),productPrice:Y.decode(r.getString(t,"productPrice")),value:Y.decode(r.getString(t,"value")),components:ae.deserialize(e,r.getList(t,"components",s=>K.decodeRecord(s))),startDate:g.decodeDateOrNull(r.getNumberOrNull(t,"startDate")),expirationDate:g.decodeDateOrNull(r.getNumberOrNull(t,"expirationDate")),serialNumber:r.getStringOrNull(t,"serialNumber"),includedEvents:r.getListOrNull(t,"includedEvents",s=>K.decodeString(s)),excludedEvents:r.getListOrNull(t,"excludedEvents",s=>K.decodeString(s)),status:y(r.get(t,"$status"),Pe),usedAt:g.decodeDateOrNull(r.getNumberOrNull(t,"usedAt")),usedValue:Y.decodeOrNull(r.getStringOrNull(t,"usedValue"))})}toMap(e){var t,s;return{uniqueId:this.uniqueId,code:this.code,businessRef:this.businessRef.encode(),creationDate:g.encodeDate(this.creationDate),orderId:this.orderId,customerId:this.customerId,productId:this.productId,productPrice:this.productPrice.encode(),startDate:g.encodeDateOrNull(this.startDate),expirationDate:g.encodeDateOrNull(this.expirationDate),serialNumber:this.serialNumber,$status:m(this.status),usedAt:g.encodeDateOrNull(this.usedAt),includedEvents:this.includedEvents,excludedEvents:this.excludedEvents,value:this.value.encode(),usedValue:(s=(t=this.usedValue)===null||t===void 0?void 0:t.encode())!==null&&s!==void 0?s:null,components:this.components.serialize(e)}}clone(){var e,t;return n.create({uniqueId:this.uniqueId,businessRef:this.businessRef.clone(),creationDate:g.cloneDate(this.creationDate),orderId:this.orderId,customerId:this.customerId,productId:this.productId,productPrice:this.productPrice.clone(),value:this.value.clone(),components:this.components.clone(),startDate:g.cloneDateOrNull(this.startDate),expirationDate:g.cloneDateOrNull(this.expirationDate),serialNumber:this.serialNumber,includedEvents:et(this.includedEvents),excludedEvents:et(this.excludedEvents),status:this.status,usedAt:g.cloneDateOrNull(this.usedAt),usedValue:(t=(e=this.usedValue)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null})}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&d(e.businessRef,this.businessRef)&&e.creationDate===this.creationDate&&e.orderId===this.orderId&&e.customerId===this.customerId&&e.productId===this.productId&&e.status===this.status&&e.usedAt===this.usedAt&&e.startDate===this.startDate&&e.expirationDate===this.expirationDate&&e.serialNumber===this.serialNumber&&P(e.includedEvents,this.includedEvents)&&P(e.excludedEvents,this.excludedEvents)&&d(e.value,this.value)&&d(e.productPrice,this.productPrice)&&d(e.usedValue,this.usedValue)&&e.components.isSame(this.components)}copyWith({uniqueId:e=this.uniqueId,businessRef:t=F(this.businessRef),creationDate:s=g.cloneDate(this.creationDate),orderId:a=this.orderId,customerId:o=this.customerId,productId:u
2=this.productId,productPrice:c=F(this.productPrice),value:l=F(this.value),components:h=F(this.components),startDate:p=g.cloneDateOrNull(this.startDate),expirationDate:I=g.cloneDateOrNull(this.expirationDate),serialNumber:v=this.serialNumber,includedEvents:E=et(this.includedEvents),excludedEvents:w=et(this.excludedEvents),status:S=this.status,usedAt:R=g.cloneDateOrNull(this.usedAt),usedValue:x=Z(this.usedValue)}={}){return n.create({uniqueId:e,businessRef:t,creationDate:s,orderId:a,customerId:o,productId:u,productPrice:c,value:l,components:h,startDate:p,expirationDate:I,includedEvents:E,excludedEvents:w,status:S,usedAt:R,usedValue:x,serialNumber:v})}updateUsage(e){e.type!==Ke.Fixed||k(e.fixedPrice)||this.status===Pe.Live&&(k(this._usedValue)?this._usedValue=Y.min(this.value,e.fixedPrice):this._usedValue=Y.min(this.value,this._usedValue.add(e.fixedPrice)),this._usedValue.compareTo(this.value)>=0&&(this._usedAt=fe.now(),this._status=Pe.Used))}tryUpdateUsage(e,t){var s;let a=this.clone();return e.type!==Ke.Fixed?W.error(new Error(`Discount type {${e.type}} is not ${Ke.Fixed}.`)):e.fixedPrice==null?W.error(new Error(`Discount fixed price {${e.fixedPrice}} is invalid.`)):a.status!==Pe.Live?W.error(new Error(`Voucher status {${a.status}} is not ${Pe.Live}.`)):a.remainingValue.compareTo(e.fixedPrice)<0?W.error(new Error(`Remaining value {${a.remainingValue.format()}} is less than discount fixed price {${e.fixedPrice.format()}}.`)):((s=a._usedValue)!==null&&s!==void 0||(a._usedValue=Y.zero(e.fixedPrice.currency)),a._usedValue=a._usedValue.add(e.fixedPrice),a._usedValue.compareTo(a.value)>=0&&(a._usedAt=t,a._status=Pe.Used),W.ok(a))}includeEvents(e){if(this._includedEvents==null)this._includedEvents=[...e];else for(let t of e)this._includedEvents.includes(t)||this._includedEvents.push(t)}excludeEvents(e){if(this._excludedEvents==null)this._excludedEvents=[...e];else for(let t of e)this._excludedEvents.includes(t)||this._excludedEvents.push(t)}setSerialNumber(e){if(this.serialNumber!=null)throw new ke(`Cannot set serial number {${e}} for Ticket Gift Card {${this.uniqueId}} of business {${this.businessRef}} because it already has a serial number {${this.serialNumber}}.`);return this.copyWith({serialNumber:e})}static generatePromoCode(){let e=Ft({length:15,alphabet:"NONSIMILAR_CHARACTERS"});return`GC-${e.substring(0,5)}-${e.substring(5,10)}-${e.substring(10,e.length)}`}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="14397d41116c4d9683bb03074ea11643",n.SCHEMA_VERSION=6,n})(),ep=class extends f{build(i,e){return ui.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(ui.SCHEMA_VERSION))return e;if(t.isGreaterThan(ui.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(e.productPrice=r.get(e,"value"),s=2),s<3&&(s=3),s<4&&(s=4),s<5&&(e.includedEvents=e.eventId,s=5),s<6&&(s=6),e.$schema_version=D.encodedExactly(s),e}},ys=(function(n){return n.Standard="Standard",n.Protocol="Protocol",n.Refund="Refund",n})(ys||{}),ka=(()=>{class n extends G{constructor(e,t,s,a,o,u,c){super(),this.includedEvents=e,this.excludedEvents=t,this.ticketId=s,this.maxUses=a,this.startDate=o,this.expirationDate=u,this.type=c}get $removable(){return!1}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(5,n.SCHEMA_VERSION)}static create(e){return new n(e.includedEvents,e.excludedEvents,e.ticketId,e.maxUses,e.startDate,e.expirationDate,e.type)}static fromMap(e,t){return new n(r.getListOrNull(t,"includedEvents",s=>s),r.getListOrNull(t,"excludedEvents",s=>s),r.getListOrNull(t,"ticketId",s=>s),r.get(t,"maxUses"),g.decodeDateOrNull(r.getOrNull(t,"startDate")),g.decodeDateOrNull(r.getOrNull(t,"expirationDate")),Re(r.getStringOrNull(t,"type"),ys))}toMap(e){return{includedEvents:this.includedEvents,excludedEvents:this.excludedEvents,ticketId:this.ticketId,maxUses:this.maxUses,startDate:g.encodeDateOrNull(this.startDate),expirationDate:g.encodeDateOrNull(this.expirationDate),type:Se(this.type)}}clone(){return new n(et(this.includedEvents),et(this.excludedEvents),et(this.ticketId),this.maxUses,g.cloneDateOrNull(this.startDate),g.cloneDateOrNull(this.expirationDate),this.type)}isSame(e){return e===this?!0:P(e.includedEvents,this.includedEvents)&&P(e.excludedEvents,this.excludedEvents)&&P(e.ticketId,this.ticketId)&&e.startDate===this.startDate&&e.expirationDate===this.expirationDate&&e.maxUses===this.maxUses&&e.type===this.type}}return n.TYPE_ID="20898ec9e27f47ada28bb4e198e084a7",n.SCHEMA_VERSION=6,n})(),tp=class extends f{build(i,e){return ka.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(ka.SCHEMA_VERSION))return e;if(t.isGreaterThan(ka.SCHEMA_VERSION))return null;let s=t.to;if(s<2&&(s=2),s<3){let a=i.storage.get("productPrice");if(a!=null){let o=ys.Standard;a.value<=0&&(o=ys.Protocol),e.type=Se(o)}s=3}return s<4&&(s=4),s<5&&(e.includedEvents=e.eventId,s=5),s<6&&(s=6),e.$schema_version=D.encodedExactly(s),e}},ci=(()=>{class n extends oo{constructor(e,t,s,a,o,u,c,l,h,p,I,v,E,w,S,R,x,N,O){super(),this.uniqueId=e,this.businessRef=t,this.creationDate=s,this.orderId=a,this.customerId=o,this.productId=u,this.productPrice
2=c,this.components=l,this.startDate=h,this.expirationDate=p,this.serialNumber=I,this._status=S,this._usedAt=R,this._maxUses=x,this._uses=N,this._includedEvents=v,this._excludedEvents=E,this._ticketId=w,this._type=O}get $typeId(){return n.TYPE_ID}get code(){return this.uniqueId}get status(){return this._status}get usedAt(){return this._usedAt}get maxUses(){return this._maxUses}get uses(){return this._uses}get remainingUses(){var e;return this._maxUses-((e=this._uses)!==null&&e!==void 0?e:0)}get includedEvents(){return this._includedEvents}get excludedEvents(){return this._excludedEvents}get ticketId(){return this._ticketId}get type(){return this._type}get $schemaVersion(){return D.between(6,n.SCHEMA_VERSION)}static create(e){return new n(e.uniqueId,e.businessRef,e.creationDate,e.orderId,e.customerId,e.productId,e.productPrice,e.components,e.startDate,e.expirationDate,e.serialNumber,e.includedEvents,e.excludedEvents,e.ticketId,e.status,e.usedAt,e.maxUses,e.uses,e.type)}static fromProductOfOrder(e,t){let s=t.findComponentByTypeId(ka.TYPE_ID);return k(s)||k(s.type)||k(e.customerId)?null:this.create({uniqueId:n.generatePromoCode(),businessRef:e.businessRef.clone(),creationDate:fe.now(),orderId:e.uniqueId,customerId:e.customerId,productId:t.uniqueId,productPrice:t.price.clone(),components:new ae,startDate:s.startDate,expirationDate:s.expirationDate,serialNumber:null,includedEvents:et(s.includedEvents),excludedEvents:et(s.excludedEvents),ticketId:et(s.ticketId),status:Pe.Live,usedAt:null,maxUses:s.maxUses,uses:null,type:s.type})}static fromMap(e,t){return n.create({uniqueId:r.getString(t,"uniqueId"),businessRef:j.mustDecode(r.getString(t,"businessRef")),creationDate:g.decodeDate(r.getNumber(t,"creationDate")),orderId:r.getString(t,"orderId"),customerId:r.getString(t,"customerId"),productId:r.getString(t,"productId"),productPrice:Y.decode(r.getString(t,"productPrice")),components:ae.deserialize(e,r.getList(t,"components",s=>K.decodeRecord(s))),startDate:g.decodeDateOrNull(r.getNumberOrNull(t,"startDate")),expirationDate:g.decodeDateOrNull(r.getNumberOrNull(t,"expirationDate")),serialNumber:r.getStringOrNull(t,"serialNumber"),includedEvents:r.getListOrNull(t,"includedEvents",s=>K.decodeString(s)),excludedEvents:r.getListOrNull(t,"excludedEvents",s=>K.decodeString(s)),ticketId:r.getListOrNull(t,"ticketId",s=>K.decodeString(s)),status:y(r.getString(t,"$status"),Pe),usedAt:g.decodeDateOrNull(r.getNumberOrNull(t,"usedAt")),maxUses:r.getNumber(t,"maxUses"),uses:r.getNumberOrNull(t,"uses"),type:y(r.getString(t,"type"),ys)})}toMap(e){return{uniqueId:this.uniqueId,code:this.code,businessRef:this.businessRef.encode(),creationDate:g.encodeDate(this.creationDate),orderId:this.orderId,customerId:this.customerId,productId:this.productId,productPrice:this.productPrice.encode(),startDate:g.encodeDateOrNull(this.startDate),expirationDate:g.encodeDateOrNull(this.expirationDate),serialNumber:this.serialNumber,$status:m(this.status),usedAt:g.encodeDateOrNull(this.usedAt),includedEvents:this.includedEvents,excludedEvents:this.excludedEvents,ticketId:this.ticketId,maxUses:this.maxUses,uses:this.uses,components:this.components.serialize(e),type:m(this.type)}}clone(){return this.copyWith()}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&d(e.businessRef,this.businessRef)&&e.creationDate===this.creationDate&&e.orderId===this.orderId&&e.customerId===this.customerId&&e.productId===this.productId&&e.status===this.status&&e.usedAt===this.usedAt&&e.startDate===this.startDate&&e.expirationDate===this.expirationDate&&P(e.includedEvents,this.includedEvents)&&P(e.excludedEvents,this.excludedEvents)&&P(e.ticketId,this.ticketId)&&d(e.productPrice,this.productPrice)&&e.maxUses===this.maxUses&&e.uses===this.uses&&e.type===this.type&&e.components.isSame(this.components)}copyWith({uniqueId:e=this.uniqueId,businessRef:t=F(this.businessRef),creationDate:s=g.cloneDate(this.creationDate),orderId:a=this.orderId,customerId:o=this.customerId,productId:u=this.productId,productPrice:c=this.productPrice,components:l=this.components.clone(),startDate:h=g.cloneDateOrNull(this.startDate),expirationDate:p=g.cloneDateOrNull(this.expirationDate),serialNumber:I=this.serialNumber,includedEvents:v=et(this.includedEvents),excludedEvents:E=et(this.excludedEvents),ticketId:w=et(this.ticketId),status:S=this.status,usedAt:R=g.cloneDateOrNull(this.usedAt),maxUses:x=this.maxUses,uses:N=this.uses,type:O=this.type}={}){return n.create({uniqueId:e,businessRef:t,creationDate:s,orderId:a,customerId:o,productId:u,productPrice:c,components:l,startDate:h,expirationDate:p,serialNumber:I,includedEvents:v,excludedEvents:E,ticketId:w,status:S,usedAt:R,maxUses:x,uses:N,type:O})}updateUsage(e){var t;this.status===Pe.Live&&(this._uses=Math.min(this._maxUses,((t=this._uses)!==null&&t!==void 0?t:0)+1),this._uses>=this._maxUses&&(this._usedAt=fe.now(),this._status=Pe.Used))}tryUpdateUsage(e,t){var s;let a=this.clone();return a.status!==Pe.Live?W.error(new Error(`Voucher status {${a.status}} is not ${Pe.Live}.`)):(a._uses=Math.min(a._maxUses,((s=a._uses)!==null&&s!==void 0?s:0)+1),a._uses>=a._maxUses&&(a._usedAt=t,a._status=Pe.Used),W.ok(a))}includeEvents(e){if(this._includedEvents==null)this._includedEvents=[...e];else for(let t of e)this._includedEvents.includes(t)||this._includedEvents.push(t)}excludeEvents(e){if(this._excludedEvents==null)this._excludedEvents=[...e];else for(let t of e)this._excludedEvents.includes(t)||this._excludedEvents.push(t)}setSerialNumber(e){if(this.serialNumber!=null)throw new ke(`Cannot set seri
2al number {${e}} for Open Ticket Pass {${this.uniqueId}} of business {${this.businessRef}} because it already has a serial number {${this.serialNumber}}.`);return this.copyWith({serialNumber:e})}static generatePromoCode(){let e=Ft({length:15,alphabet:"NONSIMILAR_CHARACTERS"});return`OP-${e.substring(0,5)}-${e.substring(5,10)}-${e.substring(10,e.length)}`}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="4c344c315cf04e72b39f456213d7fb44",n.SCHEMA_VERSION=7,n})(),np=class extends f{build(i,e){return ci.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(ci.SCHEMA_VERSION))return e;if(t.isGreaterThan(ci.SCHEMA_VERSION))return null;let s=t.to;if(s<2){let a=i.storage.get("productPrice");if(a==null)return null;e.productPrice=a.encode(),s=2}if(s<3){let a=Y.decode(r.get(e,"productPrice")),o=ys.Standard;a.value<=0&&(o=ys.Protocol),e.type=m(o),s=3}return s<4&&(s=4),s<5&&(s=5),s<6&&(e.includedEvents=e.eventId,s=6),s<7&&(s=7),e.$schema_version=D.encodedExactly(s),e}},hr=(()=>{class n extends uo{constructor(e,t,s,a,o,u,c,l,h,p,I,v,E,w){super(),this.uniqueId=e,this.code=t,this.businessRef=s,this.creationDate=a,this.eventId=o,this.ticketId=u,this.descriptions=c,this.startDate=l,this.expirationDate=h,this.components=p,this._status=I,this._usedAt=v,this._maxUses=E,this._uses=w}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}get status(){return this._status}get usedAt(){return this._usedAt}get maxUses(){return this._maxUses}get uses(){return this._uses}static basic(e){var t;return new n(e.uniqueId,e.code,e.businessRef,fe.now(),e.eventId,e.ticketId,e.descriptions,e.startDate,e.expirationDate,(t=e.components)!==null&&t!==void 0?t:new ae,Pe.Live,null,null,null)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.get(t,"code"),j.mustDecode(r.get(t,"businessRef")),g.decodeDate(r.get(t,"creationDate")),r.getOrNull(t,"eventId"),r.getListOrNull(t,"ticketId",s=>s),e.fromDataOrNull(r.getOrNull(t,"descriptions")),g.decodeDateOrNull(r.getOrNull(t,"startDate")),g.decodeDateOrNull(r.getOrNull(t,"expirationDate")),ae.deserialize(e,r.getList(t,"components",s=>s)),y(r.get(t,"$status"),Pe),g.decodeDateOrNull(r.getOrNull(t,"usedAt")),r.getOrNull(t,"maxUses"),r.getOrNull(t,"uses"))}toMap(e){return{uniqueId:this.uniqueId,code:this.code,businessRef:this.businessRef.encode(),creationDate:g.encodeDate(this.creationDate),$status:m(this.status),usedAt:g.encodeDateOrNull(this.usedAt),startDate:g.encodeDateOrNull(this.startDate),expirationDate:g.encodeDateOrNull(this.expirationDate),eventId:this.eventId,ticketId:this.ticketId,maxUses:this.maxUses,uses:this.uses,descriptions:e.toDataOrNull(this.descriptions),components:this.components.serialize(e)}}clone(){var e,t;return new n(this.uniqueId,this.code,this.businessRef.clone(),g.cloneDate(this.creationDate),this.eventId,et(this.ticketId),(t=(e=this.descriptions)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null,g.cloneDateOrNull(this.startDate),g.cloneDateOrNull(this.expirationDate),this.components.clone(),this.status,g.cloneDateOrNull(this.usedAt),this.maxUses,this.uses)}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.code===this.code&&d(e.businessRef,this.businessRef)&&e.creationDate===this.creationDate&&e.status===this.status&&e.usedAt===this.usedAt&&e.startDate===this.startDate&&e.expirationDate===this.expirationDate&&e.eventId===this.eventId&&P(e.ticketId,this.ticketId)&&e.maxUses===this.maxUses&&e.uses===this.uses&&d(e.descriptions,this.descriptions)&&e.components.isSame(this.components)}updateUsage(e){var t;this.status!==Pe.Live||k(this._maxUses)||(this._uses=Math.min(this._maxUses,((t=this._uses)!==null&&t!==void 0?t:0)+1),this._uses>=this._maxUses&&(this._usedAt=fe.now(),this._status=Pe.Used))}tryUpdateUsage(e,t){var s,a;let o=this.clone();return o.status!==Pe.Live?W.error(new Error(`Voucher status {${o.status}} is not ${Pe.Live}.`)):o._maxUses==null?(o._uses=((s=o._uses)!==null&&s!==void 0?s:0)+1,W.ok(o)):(o._uses=Math.min(o._maxUses,((a=o._uses)!==null&&a!==void 0?a:0)+1),o._uses>=o._maxUses&&(o._usedAt=t,o._status=Pe.Used),W.ok(o))}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="6168089714284b68bf3b046a0ea4bb57",n.SCHEMA_VERSION=3,n})(),ip=class extends f{build(i,e){return hr.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(hr.SCHEMA_VERSION))return e;if(t.isGreaterThan(hr.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(s=2),s<3&&(s=3),e.$schema_version=D.encodedExactly(s),e}},fr=(()=>{class n extends uo{constructor(e,t,s,a,o,u,c,l,h,p,I,v,E){super(),this.uniqueId=e,this.co
2de=t,this.businessRef=s,this.creationDate=a,this.protocol=o,this.descriptions=u,this.startDate=c,this.expirationDate=l,this.components=h,this._status=p,this._usedAt=I,this._maxUses=v,this._uses=E}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(2,n.SCHEMA_VERSION)}get status(){return this._status}get usedAt(){return this._usedAt}get maxUses(){return this._maxUses}get uses(){return this._uses}static basic(e){var t;return new n(e.uniqueId,e.code,e.businessRef,fe.now(),e.protocol,e.descriptions,e.startDate,e.expirationDate,(t=e.components)!==null&&t!==void 0?t:new ae,Pe.Live,null,null,null)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.get(t,"code"),j.mustDecode(r.get(t,"businessRef")),g.decodeDate(r.get(t,"creationDate")),e.fromData(r.get(t,"protocol")),e.fromDataOrNull(r.getOrNull(t,"descriptions")),g.decodeDateOrNull(r.getOrNull(t,"startDate")),g.decodeDateOrNull(r.getOrNull(t,"expirationDate")),ae.deserialize(e,r.getList(t,"components",s=>s)),y(r.get(t,"$status"),Pe),g.decodeDateOrNull(r.getOrNull(t,"usedAt")),r.getOrNull(t,"maxUses"),r.getOrNull(t,"uses"))}toMap(e){return{uniqueId:this.uniqueId,code:this.code,businessRef:this.businessRef.encode(),creationDate:g.encodeDate(this.creationDate),$status:m(this.status),usedAt:g.encodeDateOrNull(this.usedAt),startDate:g.encodeDateOrNull(this.startDate),expirationDate:g.encodeDateOrNull(this.expirationDate),protocol:e.toData(this.protocol),maxUses:this.maxUses,uses:this.uses,descriptions:e.toDataOrNull(this.descriptions),components:this.components.serialize(e)}}clone(){var e,t,s,a;return new n(this.uniqueId,this.code,this.businessRef.clone(),g.cloneDate(this.creationDate),(t=(e=this.protocol)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null,(a=(s=this.descriptions)===null||s===void 0?void 0:s.clone())!==null&&a!==void 0?a:null,g.cloneDateOrNull(this.startDate),g.cloneDateOrNull(this.expirationDate),this.components.clone(),this.status,g.cloneDateOrNull(this.usedAt),this.maxUses,this.uses)}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.code===this.code&&d(e.businessRef,this.businessRef)&&e.creationDate===this.creationDate&&e.status===this.status&&e.usedAt===this.usedAt&&e.startDate===this.startDate&&e.expirationDate===this.expirationDate&&d(e.protocol,this.protocol)&&e.maxUses===this.maxUses&&e.uses===this.uses&&d(e.descriptions,this.descriptions)&&e.components.isSame(this.components)}updateUsage(e){var t;this.status!==Pe.Live||k(this._maxUses)||(this._uses=Math.min(this._maxUses,((t=this._uses)!==null&&t!==void 0?t:0)+1),this._uses>=this._maxUses&&(this._usedAt=fe.now(),this._status=Pe.Used))}tryUpdateUsage(e,t){var s,a;let o=this.clone();return o.status!==Pe.Live?W.error(new Error(`Voucher status {${o.status}} is not ${Pe.Live}.`)):o._maxUses==null?(o._uses=((s=o._uses)!==null&&s!==void 0?s:0)+1,W.ok(o)):(o._uses=Math.min(o._maxUses,((a=o._uses)!==null&&a!==void 0?a:0)+1),o._uses>=o._maxUses&&(o._usedAt=t,o._status=Pe.Used),W.ok(o))}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="d12cd907bc2f42c8b9931bbae4920d9a",n.SCHEMA_VERSION=4,n})(),sp=class extends f{build(i,e){return fr.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(fr.SCHEMA_VERSION))return e;if(t.isGreaterThan(fr.SCHEMA_VERSION))return null;let s=t.to;if(s<2){let a=r.get(e,"discount");e.protocol=i.toData(new No(a)),s=2}return s<3&&(s=3),s<4&&(s=4),e.$schema_version=D.encodedExactly(s),e}},rp=class extends ki{constructor(i){var e;super(),this.promoCode=i,this.uses=(e=this.promoCode.uses)!==null&&e!==void 0?e:0}findDiscountForSingleTicket(i){return this.promoCode.maxUses!=null&&this.uses>=this.promoCode.maxUses?null:this._findDiscountForSingleTicket()}findDiscountForMultipleTickets(i,e){return this.promoCode.maxUses!=null&&this.uses>=this.promoCode.maxUses?null:_(e)&&e>1?this._findDiscountForMultipleTickets(e,this.promoCode.maxUses):{discount:this._findDiscountForSingleTicket(),availableUses:1}}findDiscountForOrder(i){return null}reset(){var i;this.uses=(i=this.promoCode.uses)!==null&&i!==void 0?i:0}_findDiscountForSingleTicket(){return this.uses++,fn.fromBusinessPromoCode(this.promoCode)}_findDiscountForMultipleTickets(i,e){let t=fn.fromBusinessPromoCode(this.promoCode),s=e==null?i:Math.min(i,e-this.uses);return this.uses+=s,{discount:t,availableUses:s}}},xt=class{static hasProvider(i){return dr.verifyType(i)||fr.verifyType(i)||hr.verifyType(i)||ui.verifyType(i)||ci.verifyType(i)}static getProvider(i){return k(i)?new Vl:dr.assertType(i)?new Wf(i):fr.assertType(i)?new rp(i):hr.assertType(i)?new Kf(i):ui.assertType(i)?new jf(i):ci.assertType(i)?new Jf(i):new Vl}static calculateDiscountValueForSingleItem(i,e){let t=null;return e.type===Ke.Fixed&&_(e.fixedPrice)&&(t=this.applyFixedDiscountToPrice(i,e.fixedPrice)),e.type===Ke.Percentage&&_(e.percentage)&&(t=this.applyPercentageDiscountToPrice(i,e.percentage)),e.type===Ke.DownToPrice&&_(e.fixedPrice)&&(t=this.applyDownToPriceDiscountToPrice(i,e.fixedPrice)),t==null?null:i.difference(t)}static calculateDiscountedPriceForSingleItem(i,e){let t=i;return _(e)&&(e.type===Ke.Fixed&&_(e.fixedPrice)&&(t=this.applyFixedDiscountToPrice(i,e.fixedPrice)),e.type===Ke.Percentage&&_(e.percentage)&&(t=this.applyPercentageDiscountToPrice(i,e.percentage)),e.type===Ke.DownToPrice&&_(e.fixedPrice)&&(t=this.applyDownToPriceDiscountToPrice(i,e.fixedPrice))),t}static calculateDiscountedPriceForMultipleItems(i,e,t){return this.calculateDiscountedPriceForSingleItem(i,t).scale(e)}static getFormattedPriceWithDiscountForTicket(i){let e=i.template.price,t=i.discount,s=this.calculateDiscountedPriceForSingleItem(e,t).format();if(_(t)){let a=null;t.type===Ke.Fixed&&_(t.fixedPrice)&&(a=`-${t.fixedPrice.format()}`),t.type===Ke.Percentage&&_(t.percentage)&&(a=`-${t.percentage.toFixed(0)}%`),t.type===Ke.DownToPrice&&_(t.fixedPrice)&&e.compareTo(t.fixedPrice)>=0&&(a=`-${e.difference(t.fixedPrice).format()}`),t.type===Ke.Legacy&&_(t.percentage)&&(a=`-${t.percentage.toFixed(0)}%`),a!=null&&t.code!=null&&(a=`${a} - (${t.code.toUpperCase()}
2)`),_(a)&&(s=`${s} (${a})`)}return s}static applyPercentageDiscountToPrice(i,e){let s=Math.max(0,Math.min(100,e))/100;return i.scale(1-s)}static applyFixedDiscountToPrice(i,e){let t=i.difference(e);return t.isNegative()?Y.zero(i.currency):t}static applyDownToPriceDiscountToPrice(i,e){return i.compareTo(e)<=0?i.clone():e.clone()}},we=(function(n){return n.Standard="Standard",n.Promoter="Promoter",n.Protocol="Protocol",n.HardTicket="HardTicket",n})(we||{});function YR(n){switch(n){case we.Protocol:return 0;case we.Standard:return 1;case we.Promoter:return 2;case we.HardTicket:return 3}}function Hw(n){switch(n){case we.Protocol:return"ptc";case we.Standard:case we.Promoter:return"std";case we.HardTicket:return"hrd"}}var ai=(function(n){return n.Email="Email",n.Printer="Printer",n})(ai||{}),qe=class n{static translate(i,e,t,s){let a=e.length,o=t.length,u=this.wordToBigInt(i,e);if(u.isError)return W.error(u.error);let c=u.value;return s??(s=this.findDigitCountInBase(a,i.length,o)),this.bigIntToWord(c,t,s)}static getCardinalityOfLanguage(i,e){return BigInt(i.length)**BigInt(e)}static wordToBigInt(i,e){let t=BigInt(e.length),s=BigInt(0);for(let a of i){let o=e.indexOf(a);if(o<0)return W.error("The word contains characters not in the alphabet.");s=s*t+BigInt(o)}return W.ok(s)}static bigIntToWord(i,e,t){let s=BigInt(e.length),a=[];for(let o=0;o<t;o++){let u=Number(i%s);a.unshift(e[u]),i=i/s}return i>BigInt(0)?W.error("The value is too large for the specified length."):W.ok(a.join(""))}static findDigitCountInBase(i,e,t){return Math.ceil(e*Math.log(i)/Math.log(t))}static generateRestrictedAlphabet(){let i=n.UPPER_ALPHA_NUMERIC,e=[];for(let t of i)t==="B"||t==="8"||t==="G"||t==="6"||t==="I"||t==="1"||t==="0"||t==="O"||t==="D"||t==="Q"||t==="S"||t==="5"||t==="Z"||t==="2"||t==="U"||t==="V"||t==="W"||e.push(t);return e.join("")}};qe.UPPER_ALPHA="ABCDEFGHIJKLMNOPQRSTUVWXYZ";qe.LOWER_ALPHA="abcdefghijklmnopqrstuvwxyz";qe.NUMERIC="0123456789";qe.UPPER_ALPHA_NUMERIC=qe.UPPER_ALPHA+qe.NUMERIC;qe.RESTRICTED_ALPHA_NUMERIC=qe.generateRestrictedAlphabet();qe.FULL_ALPHA_NUMERIC=qe.NUMERIC+qe.UPPER_ALPHA+qe.LOWER_ALPHA;var co=class{static generateSearchQueryArray(i,e){let t=new Set;for(let s of i){if(Rn(s))continue;let a=this.sanitizeStringForSearch(s);if(!Rn(a)){if(a.length<=4){t.add(a);continue}for(let o=0;o<a.length;++o){let u=o+4;if(u>a.length)break;t.add(a.substring(o,u))}}}if(_(e)&&e.length>0)for(let s of e){if(Rn(s))continue;let a=this.sanitizeStringForSearch(s);Rn(a)||t.add(a)}return[...t]}static sanitizeStringForSearch(i){if(Rn(i))return i;let e=Lw.default.remove(i),t=new Array;for(let s of e)qe.FULL_ALPHA_NUMERIC.includes(s)&&t.push(s);return t.join("").toLowerCase()}},Ye=(function(n){return n.Live="LIVE",n.Aborted="ABORTED",n.Canceled="CANCELED",n.Refunded="REFUNDED",n.Scanned="SCANNED",n})(Ye||{}),An=(()=>{class n extends b{constructor(e,t,s,a,o,u,c,l,h,p,I,v,E,w,S,R,x,N,O,A,M,C,H,B,U,V,q,L,J){super(),this.uniqueId=e,this.creatorId=t,this.creationDate=s,this.cancelledDate=a,this.cancelledBy=o,this.country=u,this.timezone=c,this.businessRef=l,this.status=h,this.eventId=p,this.orderId=I,this.promoterId=v,this.dateSpan=E,this.template=w,this.ticketType=S,this.deliveryMethod=R,this.storagePath=x,this.seatingOptions=N,this.scanDate=O,this.scannerId=A,this.applicationFee=M,this.discount=C,this.serialNumber=H,this.supplement=B,this.language=U,this.customerId=V,this.customerName=q,this.customerEmail=L,this.userId=J,this.templateId=w.uniqueId}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(16,n.SCHEMA_VERSION)}static create(e){return new n(e.uniqueId,e.creatorId,e.creationDate,e.cancelledDate,e.cancelledBy,e.country,e.timezone,e.businessRef,e.status,e.eventId,e.orderId,e.promoterId,e.dateSpan,e.template,e.ticketType,e.deliveryMethod,e.storagePath,e.seatingOptions,e.scanDate,e.scannerId,e.applicationFee,e.discount,e.serialNumber,e.supplement,e.language,e.customerId,e.customerName,e.customerEmail,e.userId)}static basic(e){return this.create(Object.assign(Object.assign({},e),{cancelledDate:null,cancelledBy:null,scanDate:null,scannerId:null,serialNumber:null,supplement:null}))}static fromMap(e,t){return this.create({uniqueId:r.getString(t,"uniqueId"),creatorId:r.getString(t,"creatorId"),creationDate:e.decodeDate(r.getNumber(t,"creationDate")),cancelledDate:e.decodeDateOrNull(r.getNumberOrNull(t,"cancelledDate")),cancelledBy:r.getStringOrNull(t,"cancelledBy"),country:y(r.getString(t,"country"),Ie),timezone:y(r.getString(t,"timezone"),Ee),businessRef:j.mustDecode(r.getString(t,"businessRef")),status:y(r.getString(t,"$status"),Ye),eventId:r.getString(t,"eventId"),orderId:r.getString(t,"orderId"),promoterId:r.getStringOrNull(t,"promoterId"),dateSpan:e.fromData(r.getRecord(t,"dateSpan")),template:e.fromData(r.getRecord(t,"template")),ticketType:y(r.getString(t,"ticketType"),we),deliveryMethod:y(r.getString(t,"deliveryMethod"),ai),storagePath:r.getStringOrNull(t,"storagePath"),seatingOptions:e.fromDataOrNull(r.getRecordOrNull(t,"seatingOptions")),scanDate:e.decodeDateOrNull(r.getNumberOrNull(t,"scanDate")),scannerId:r.getStringOrNull(t,"scannerId"),applicationFee:e.fromDataOrNull(r.getRecordOrNull(t,"applicationFee")),discount:e.fromDataOrNull(r.getRecordOrNull(t,"discount")),serialNumber:r.getStringOrNull(t,"serialNumber"),supplement:e.fromDataOrNull(r.getRecordOrNull(t,"supplement")),language:Re(r.getStringOrNull(t,"language"),$),customerId:r.getStringOrNull(t,"customerId"),customerName:r.getStringOrNull(t,"customerName"),customerEmail:r.getStringOrNull(t,"customerEmail"),userId:r.getStringOrNull(t,"userId")})}toMap(e){var t;return{uniqueId:this.uniqueId,creatorId:this.creatorId,creationDate:e.encodeDate(this.creationDate),
2cancelledDate:e.encodeDateOrNull(this.cancelledDate),cancelledBy:this.cancelledBy,country:m(this.country),timezone:m(this.timezone),businessRef:this.businessRef.encode(),$status:m(this.status),eventId:this.eventId,orderId:this.orderId,promoterId:this.promoterId,serialNumber:this.serialNumber,dateSpan:e.toData(this.dateSpan),template:e.toData(this.template),templateId:this.template.uniqueId,ticketType:m(this.ticketType),deliveryMethod:m(this.deliveryMethod),storagePath:this.storagePath,applicationFee:e.toDataOrNull(this.applicationFee),discount:e.toDataOrNull(this.discount),scanDate:e.encodeDateOrNull(this.scanDate),scannerId:(t=this.scannerId)!==null&&t!==void 0?t:null,seatingOptions:e.toDataOrNull(this.seatingOptions),supplement:e.toDataOrNull(this.supplement),language:Se(this.language),customerId:this.customerId,customerName:this.customerName,customerEmail:this.customerEmail,userId:this.userId}}clone(){return this.copyWith()}isSame(e){return this===e?!0:e.uniqueId===this.uniqueId&&e.creatorId===this.creatorId&&e.creationDate===this.creationDate&&e.cancelledDate===this.cancelledDate&&e.cancelledBy===this.cancelledBy&&e.country===this.country&&e.timezone===this.timezone&&e.businessRef===this.businessRef&&e.status===this.status&&e.eventId===this.eventId&&e.orderId===this.orderId&&e.userId===this.userId&&e.promoterId===this.promoterId&&e.serialNumber===this.serialNumber&&d(e.dateSpan,this.dateSpan)&&d(e.seatingOptions,this.seatingOptions)&&d(e.template,this.template)&&d(e.applicationFee,this.applicationFee)&&d(e.discount,this.discount)&&e.ticketType===this.ticketType&&e.deliveryMethod===this.deliveryMethod&&e.storagePath===this.storagePath&&e.scanDate===this.scanDate&&e.scannerId===this.scannerId&&e.serialNumber===this.serialNumber&&e.language===this.language&&e.customerId===this.customerId&&e.customerName===this.customerName&&e.customerEmail===this.customerEmail&&e.userId===this.userId&&d(e.supplement,this.supplement)}convertToEmailDelivery(e){return this.copyWith({deliveryMethod:ai.Email,storagePath:e})}assignToCustomerAccount(e){return this.copyWith({creatorId:e.uniqueId,userId:e.uniqueId})}markAsScanned(e){return this.copyWith({scanDate:fe.now(),scannerId:e,status:Ye.Scanned})}markAsRestored(){return this.copyWith({status:Ye.Live,scanDate:null,scannerId:null})}copyAsAborted(){var e;return this.copyWith({status:Ye.Aborted,supplement:(e=this.supplement)===null||e===void 0?void 0:e.copyAsAborted()})}copyAsCanceled(e,t,s){var a,o,u;return this.copyWith({cancelledDate:(a=this.cancelledDate)!==null&&a!==void 0?a:t,cancelledBy:(o=this.cancelledBy)!==null&&o!==void 0?o:e,status:s?Ye.Refunded:Ye.Canceled,supplement:(u=this.supplement)===null||u===void 0?void 0:u.copyAsCanceled(e,t,s)})}copyWithSeatingOptions(e){return this.copyWith({seatingOptions:e.clone()})}copyWithScannedSupplement({scanDate:e,scannerId:t=null}){var s;return this.copyWith({supplement:(s=this.supplement)===null||s===void 0?void 0:s.copyAsScanned({scanDate:e,scannerId:t})})}copyWith({uniqueId:e=this.uniqueId,creatorId:t=this.creatorId,creationDate:s=g.cloneDate(this.creationDate),cancelledDate:a=g.cloneDateOrNull(this.cancelledDate),cancelledBy:o=this.cancelledBy,country:u=this.country,timezone:c=this.timezone,businessRef:l=F(this.businessRef),status:h=this.status,eventId:p=this.eventId,orderId:I=this.orderId,promoterId:v=this.promoterId,dateSpan:E=F(this.dateSpan),template:w=F(this.template),ticketType:S=this.ticketType,deliveryMethod:R=this.deliveryMethod,storagePath:x=this.storagePath,seatingOptions:N=Z(this.seatingOptions),scanDate:O=g.cloneDateOrNull(this.scanDate),scannerId:A=this.scannerId,applicationFee:M=Z(this.applicationFee),discount:C=Z(this.discount),serialNumber:H=this.serialNumber,supplement:B=Z(this.supplement),language:U=this.language,customerId:V=this.customerId,customerName:q=this.customerName,customerEmail:L=this.customerEmail,userId:J=this.userId}={}){return n.create({uniqueId:e,creatorId:t,creationDate:s,cancelledDate:a,cancelledBy:o,country:u,timezone:c,businessRef:l,status:h,eventId:p,orderId:I,promoterId:v,dateSpan:E,template:w,ticketType:S,deliveryMethod:R,storagePath:x,seatingOptions:N,scanDate:O,scannerId:A,applicationFee:M,discount:C,serialNumber:H,supplement:B,language:U,customerId:V,customerName:q,customerEmail:L,userId:J})}setSerialNumber(e){if(_(this.serialNumber))throw new ke(`Cannot set seri
2al number {${e}} for ticket {${this.uniqueId}} of event {${this.eventId}} because it already has a serial number {${this.serialNumber}}`);return this.copyWith({serialNumber:e})}generateSearchQueryArray(){return co.generateSearchQueryArray([this.uniqueId])}static encodedStatusSafe(e){return m(e)}static generateCustomerStoragePath({customerId:e,orderId:t,ticketId:s,eventName:a}){let u=`${tn(a).substring(0,30)}_${s}`;return`user_accounts/${e}/orders/${t}/tickets/${u}.pdf`}static generateGuestStoragePath({orderId:e,ticketId:t,businessId:s,eventName:a}){let u=`${tn(a).substring(0,30)}_${t}`;return`business_profiles/${s}/orders/${e}/tickets/${u}.pdf`}static generateAdminStoragePath({orderId:e,ticketId:t,businessId:s,eventName:a}){let u=`${tn(a).substring(0,30)}_${t}`;return`business_profiles/${s}/orders/${e}/tickets/${u}.pdf`}}return n.TYPE_ID="bee3995077e24a1e81f9ca341c3995fe",n.SCHEMA_VERSION=17,n})(),ap=class extends f{build(i,e){return An.fromMap(i,e)}generateStandardLegacyStoragePath(i,e,t){let s=`ticket-${t}`;return`user_accounts/${i}/orders/${e}/tickets/${s}.pdf`}generateProtocolLegacyStoragePath(i,e,t){let s=`ticket-${e}`;return`business_profiles/${t}/orders/${i}/tickets/${s}.pdf`}optimizeForQuery(i,e){return i.storage.get("avoidOptimizeForQuery")===!0?null:{search:e.generateSearchQueryArray()}}migrateToCurrentSchemaVersion(i,e){var t,s,a,o,u;let c=r.getVersionRange(e);if(this.migrateEnum(e,"ticketType",we,we.Standard),this.migrateEnum(e,"deliveryMethod",ai,ai.Email),r.replace(e,"$status","DELETED",m(Ye.Canceled)),c.contains(An.SCHEMA_VERSION))return e;if(c.isGreaterThan(An.SCHEMA_VERSION))return null;let l=c.to;if(l<2&&(r.getString(e,"$status")==="ACTIVE"&&r.set(e,"$status",m(Ye.Live)),l=2),l<3&&(l=3),l<4){l=4;let h=y(r.getString(e,"timezone"),Ee),p=xd(h);r.setIfNullOrUndefined(e,"country",m(p)),r.setIfNullOrUndefined(e,"serialNumber",null)}if(l<5){l=5;let h=y(r.getString(e,"ticketType"),we),p;switch(h){case we.Protocol:{let I=r.getString(e,"orderId"),v=r.getString(e,"uniqueId"),E=j.mustDecode(r.getString(e,"businessRef"));p=this.generateProtocolLegacyStoragePath(I,v,E.uniqueId)}break;case we.Promoter:case we.Standard:{let I=r.getString(e,"customerId"),v=r.getString(e,"orderId"),E=r.getString(e,"uniqueId");p=this.generateStandardLegacyStoragePath(I,v,E)}break;case we.HardTicket:p=null;break;default:Zt(h)}r.setIfNullOrUndefined(e,"storagePath",p)}if(l<6&&(l=6),l<7&&(l=7),l<8&&(l=8),l<9&&(l=9),l<10&&(l=10),l<11&&(l=11),l<12){l=12;let h=y(r.getString(e,"ticketType"),we);e.deliveryMethod=m(h===we.HardTicket?ai.Printer:ai.Email)}if(l<13&&(e.applicationFee=null,l=13),l<14&&(l=14),l<15&&(l=15),l<16){let h=i.fromDataOrNull(r.getRecordOrNull(e,"customer"));e.language=Se((t=h?.language)!==null&&t!==void 0?t:null),e.customerId=(s=h?.uniqueId)!==null&&s!==void 0?s:null,e.customerName=(a=h?.formattedName)!==null&&a!==void 0?a:null,e.customerEmail=(o=h?.email)!==null&&o!==void 0?o:null,e.userId=(u=h?.userId)!==null&&u!==void 0?u:null,l=16}return l<17&&(l=17),e.$schema_version=D.encodedExactly(l),e}},$e=(function(n){return n.Open="OPEN",n.Aborted="ABORTED",n.Canceled="CANCELED",n.Refunded="REFUNDED",n.Pending="PENDING",n})($e||{}),pe=(function(n){return n.Online="Online",n.OnDelivery="OnDelivery",n})(pe||{}),qt=(function(n){return n.Prepared="Prepared",n.Started="Started",n.InProgress="InProgress",n.Canceled="Canceled",n.Succeeded="Succeeded",n.Failed="Failed",n.Expired="Expired",n})(qt||{}),Fe=(function(n){return n.OnlineBankCard="OnlineBankCard",n.Cash="Cash",n.POS="POS",n.BankTransfer="BankTransfer",n})(Fe||{});function Yd(n){switch(n){case pe.OnDelivery:return Fe.Cash;case pe.Online:return Fe.OnlineBankCard}}var Xe=(function(n){return n.Admin="Admin",n.Client="Client",n})(Xe||{}),it=class n{constructor(i,e=null){this.isSome=i,this._value=e}static some(i){return new n(!0,i)}static none(){return new n(!1)}get isNone(){return!this.isSome}get value(){if(this.isNone)throw new Error("value is not accessible on a none instance");return this._value}getOrElse(i){return this.isSome?this.value:i}get valueOrNull(){return this._value}},$d=(()=>{class n extends b{constructor(e,t){super(),this.pastReceipts=e,this.currentReceipt=t}get $typeId(){return n.TYPE_ID}static create(e){return e.pastReceipts.every(a=>a.isCancelled)?_(e.currentReceipt)&&e.currentReceipt.isCancelled?W.error("Current receipt MUST NOT be cancelled."):W.ok(new n(e.pastReceipts,e.currentReceipt)):W.error("All past receipts MUST be cancelled.")}static empty(){return this.create({pastReceipts:[],currentReceipt:null}).unwrap()}static ofReceipt(e){return this.create({pastReceipts:[],currentReceipt:e})}static fromMap(e,t){return n.create({pastReceipts:r.getList(t,"pastReceipts",s=>e.fromData(K.decodeRecord(s))),currentReceipt:e.fromDataOrNull(r.getRecordOrNull(t,"currentReceipt"))}).unwrap()}toMap(e){return{pastReceipts:this.pastReceipts.map(t=>e.toData(t)),currentReceipt:e.toDataOrNull(this.currentReceipt)}}clone(){return this.copyWith({pastReceipts:it.none(),currentReceipt:it.none()}).unwrap()}isSame(e){return e===this?!0:P(e.pastReceipts,this.pastReceipts,d)&&d(e.currentReceipt,this.currentReceipt)}copyWith(e){return n.create({pastReceipts:e.pastReceipts.getOrElse(this.pastReceipts),currentReceipt:e.currentReceipt.getOrElse(this.currentReceipt)})}copyWithNewReceipt(e){return e.isCancelled?W.error("New receipt must not be cancelled."):_(this.currentReceipt)?W.error("Must cancel current receipt before adding a new one."):this.copyWith({currentReceipt:it.some(e),pastReceipts:it.none()})}copyWithCurrentReceiptCancelledOrClone(e){if(k(this.currentReceipt))return this.clone();let t=this.currentReceipt.copyAsCancelledOrClone(e),s=[...this.pastReceipts,t];return this.copyWith({pastReceipts:it.some(s),currentReceipt:it.some(null)}).unwrap()}getReceiptsForExport(){let e=[...this.pastReceipts];return this.currentReceipt!=null&&e.push(this.currentReceipt),e}isEmpty(){return this.currentReceipt==null&&this.pastReceipts.length<=0}}return n.TYPE_ID="4a9b0af9989a4bac931551b7c315039f",n})(),op=class extends f{build(i,e){return $d.fromMap(i,e)}},te=(function(n){return n.Vat_0="0%",n.Vat_1="1%",n.Vat_2="2%",n.Vat_3="3%",n.Vat_4="4%",n.Vat_5="5%",n.Vat_6="6%",n.Vat_7="7%",n.Vat_8="8%",n.Vat_9="9%",n.Vat_10="10%",n.Vat_11="11%",n.Vat_12="12%",n.Vat_13="13%",n.Vat_14="14%",n.Vat_15="15%",n.Vat_16="16%",n.Vat_17="17%",n.Vat_18="18%",n.Vat_19="19%",n.Vat_20="20%",n.Vat_21="21%",n.Vat_22="22%",n.Vat_23="23%",n.Vat_24="24%",n.Vat_25="25%",n.Vat_26="26%",n.Vat_27="27%",
2n.Vat_Aam="AAM",n.Vat_Am="AM",n.Vat_Eu="EU",n.Vat_Euk="EUK",n.Vat_FAfa="F.AFA",n.Vat_Fad="FAD",n.Vat_KAfa="K.AFA",n.Vat_Maa="MAA",n.Vat_Tam="TAM",n.Vat_Kk="\xC1KK",n.Vat_Thk="\xC1THK",n})(te||{}),lY=new Map([[te.Vat_0,0],[te.Vat_1,1],[te.Vat_2,2],[te.Vat_3,3],[te.Vat_4,4],[te.Vat_5,5],[te.Vat_6,6],[te.Vat_7,7],[te.Vat_8,8],[te.Vat_9,9],[te.Vat_10,10],[te.Vat_11,11],[te.Vat_12,12],[te.Vat_13,13],[te.Vat_14,14],[te.Vat_15,15],[te.Vat_16,16],[te.Vat_17,17],[te.Vat_18,18],[te.Vat_19,19],[te.Vat_20,20],[te.Vat_21,21],[te.Vat_22,22],[te.Vat_23,23],[te.Vat_24,24],[te.Vat_25,25],[te.Vat_26,26],[te.Vat_27,27]]),zx=new Map([[0,te.Vat_0],[1,te.Vat_1],[2,te.Vat_2],[3,te.Vat_3],[4,te.Vat_4],[5,te.Vat_5],[6,te.Vat_6],[7,te.Vat_7],[8,te.Vat_8],[9,te.Vat_9],[10,te.Vat_10],[11,te.Vat_11],[12,te.Vat_12],[13,te.Vat_13],[14,te.Vat_14],[15,te.Vat_15],[16,te.Vat_16],[17,te.Vat_17],[18,te.Vat_18],[19,te.Vat_19],[20,te.Vat_20],[21,te.Vat_21],[22,te.Vat_22],[23,te.Vat_23],[24,te.Vat_24],[25,te.Vat_25],[26,te.Vat_26],[27,te.Vat_27]]);function Ux(n){return zx.get(n)}var dt=(()=>{class n{constructor(e,t,s=null){this.isDefined=e,this.isSome=t,this._value=s}static some(e){return new n(!0,!0,e)}static defined(e){return e==null?new n(!0,!1):new n(!0,!0,e)}static undefined(){return new n(!1,!1)}get isUndefined(){return!this.isDefined}get isNone(){return!this.isSome}get value(){if(this.isUndefined)throw new Error("value is not accessible on an undefined instance");if(this.isNone)throw new Error("value is not accessible on a none instance");return this._value}get valueOrNull(){if(this.isUndefined)throw new Error("value is not accessible on an undefined instance");return this._value}getOrElse(e){return this.isSome?this.value:e}encode(e){return this.isSome?e(this.value):this.isDefined?null:n.UNDEFINED_STATUS}clone(e){return this.isSome?n.some(e(this.value)):this.isDefined?n.defined():n.undefined()}isSame(e,t){return e.isSome&&this.isSome?t!=null?t(e.value,this.value):e.value===this.value:e.isDefined===this.isDefined}static decode(e,t){return e==n.UNDEFINED_STATUS?n.undefined():e==null?n.defined(null):n.some(t(e))}}return n.UNDEFINED_STATUS="__UNDEFINED__",n})(),We=(()=>{class n extends zt(b){constructor(e,t,s,a,o,u,c,l,h,p,I,v,E,w,S,R,x,N,O,A,M,C,H,B,U,V,q){super(),this.uniqueId=e,this.creatorId=t,this.creationDate=s,this.businessRef=a,this.promoterId=o,this.tickets=u,this.products=c,this.status=l,this.paymentType=h,this.paymentMethod=p,this.onlinePaymentDetails=I,this.offlinePaymentDetails=v,this.discount=E,this.source=w,this.components=S,this.isGuestOrder=R,this.refunds=x,this.cancelledDate=N,this.cancelledBy=O,this.standardApplicationFee=A,this.standardApplicationFeeVat=M,this.productApplicationFee=C,this.productApplicationFeeVat=H,this.donation=B,this.bookingStrategy=U,this.customer=V,this.contactDetails=q,this.isLegacyOrder=!0,this.eventId=u[0].eventId,this.userId=u[0].userId,this.customerId=u[0].customerId,this.language=u[0].language,this.country=u[0].country,this.timezone=u[0].timezone}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(18,n.SCHEMA_VERSION)}get isOpen(){return this.status===$e.Open}get isCanceled(){return this.status===$e.Canceled}static create(e){var t,s;return new n(e.uniqueId,e.creatorId,e.creationDate,e.businessRef,e.promoterId,e.tickets,e.products,e.status,e.paymentType,e.paymentMethod,e.onlinePaymentDetails,e.offlinePaymentDetails,e.discount,e.source,e.components,e.isGuestOrder,e.refunds,(t=e.cancelledDate)!==null&&t!==void 0?t:null,(s=e.cancelledBy)!==null&&s!==void 0?s:null,dt.defined(e.standardApplicationFee),dt.defined(e.standardApplicationFeeVat),e.productApplicationFee,e.productApplicationFeeVat,e.donation,e.bookingStrategy,e.customer,e.contactDetails)}static fromOnlineOrder(e){var t,s,a,o,u,c,l,h,p,I;return n.create({uniqueId:e.uniqueId,creatorId:e.creatorId,creationDate:e.creationDate,businessRef:e.businessRef.clone(),promoterId:e.tickets[0].promoterId,tickets:ue(e.tickets),products:ue(e.products),status:e.status,paymentType:e.paymentType,paymentMethod:e.paymentMethod,onlinePaymentDetails:(s=(t=e.onlinePaymentDetails)===null||t===void 0?void 0:t.clone())!==null&&s!==void 0?s:null,offlinePaymentDetails:null,discount:(o=(a=e.discount)===null||a===void 0?void 0:a.clone())!==null&&o!==void 0?o:null,source:Xe.Client,components:e.components.clone(),isGuestOrder:e.isGuestOrder,refunds:ue(e.refunds),cancelledDate:g.cloneDateOrNull(e.cancelledDate),
2cancelledBy:e.cancelledBy,standardApplicationFee:(c=(u=e.standardApplicationFee)===null||u===void 0?void 0:u.clone())!==null&&c!==void 0?c:null,standardApplicationFeeVat:e.standardApplicationFeeVat,productApplicationFee:(h=(l=e.productApplicationFee)===null||l===void 0?void 0:l.clone())!==null&&h!==void 0?h:null,productApplicationFeeVat:e.productApplicationFeeVat,donation:(I=(p=e.donation)===null||p===void 0?void 0:p.clone())!==null&&I!==void 0?I:null,bookingStrategy:e.bookingStrategy,customer:e.customer,contactDetails:e.contactDetails})}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.get(t,"creatorId"),e.decodeDate(r.get(t,"creationDate")),j.mustDecode(r.get(t,"businessRef")),r.getOrNull(t,"promoterId"),r.getList(t,"tickets",s=>e.fromData(s)),r.getList(t,"products",s=>e.fromData(s)),y(r.get(t,"$status"),$e),y(r.get(t,"paymentType"),pe),y(r.get(t,"paymentMethod"),Fe),e.fromDataOrNull(r.getOrNull(t,"onlinePaymentDetails")),e.fromDataOrNull(r.getOrNull(t,"offlinePaymentDetails")),e.fromDataOrNull(r.getOrNull(t,"discount")),y(r.get(t,"source"),Xe),ae.deserialize(e,r.getList(t,"components",s=>s)),r.get(t,"isGuestOrder"),r.getList(t,"refunds",s=>e.fromData(s)),e.decodeDateOrNull(r.getOrNull(t,"cancelledDate")),r.getOrNull(t,"cancelledBy"),dt.decode(r.getRaw(t,"standardApplicationFee"),s=>Y.decode(s)),dt.decode(r.getRaw(t,"standardApplicationFeeVat"),s=>y(s,te)),Y.decodeOrNull(r.getOrNull(t,"productApplicationFee")),Re(r.getStringOrNull(t,"productApplicationFeeVat"),te),Y.decodeOrNull(r.getOrNull(t,"donation")),y(r.getString(t,"bookingStrategy"),yt),e.fromDataOrNull(r.getRecordOrNull(t,"customer")),e.fromData(r.getRecord(t,"contactDetails")))}toMap(e){var t,s,a,o;e.storage.set("avoidOptimizeForQuery",!0);let u={uniqueId:this.uniqueId,creatorId:this.creatorId,customerId:this.customerId,userId:this.userId,creationDate:e.encodeDate(this.creationDate),businessRef:this.businessRef.encode(),promoterId:this.promoterId,tickets:this.tickets.map(c=>e.toData(c)),products:this.products.map(c=>e.toData(c)),$status:m(this.status),paymentType:m(this.paymentType),paymentMethod:m(this.paymentMethod),onlinePaymentDetails:e.toDataOrNull(this.onlinePaymentDetails),offlinePaymentDetails:e.toDataOrNull(this.offlinePaymentDetails),discount:e.toDataOrNull(this.discount),source:m(this.source),components:this.components.serialize(e),isGuestOrder:this.isGuestOrder,refunds:this.refunds.map(c=>e.toData(c)),cancelledDate:e.encodeDateOrNull(this.cancelledDate),cancelledBy:this.cancelledBy,eventId:this.eventId,standardApplicationFee:this.standardApplicationFee.encode(c=>c.encode()),standardApplicationFeeVat:this.standardApplicationFeeVat.encode(c=>m(c)),productApplicationFee:(s=(t=this.productApplicationFee)===null||t===void 0?void 0:t.encode())!==null&&s!==void 0?s:null,productApplicationFeeVat:Se(this.productApplicationFeeVat),donation:(o=(a=this.donation)===null||a===void 0?void 0:a.encode())!==null&&o!==void 0?o:null,bookingStrategy:m(this.bookingStrategy),customer:e.toDataOrNull(this.customer),contactDetails:e.toData(this.contactDetails)};return e.storage.remove("avoidOptimizeForQuery"),u}clone(){return this.copyWith({})}isSame(e){return this===e?!0:e.uniqueId===this.uniqueId&&e.creatorId===this.creatorId&&e.promoterId===this.promoterId&&e.creationDate===this.creationDate&&e.businessRef===this.businessRef&&e.paymentType===this.paymentType&&e.paymentMethod===this.paymentMethod&&e.cancelledDate===this.cancelledDate&&e.cancelledBy===this.cancelledBy&&d(e.donation,this.donation)&&e.standardApplicationFee.isSame(this.standardApplicationFee,d)&&e.standardApplicationFeeVat.isSame(this.standardApplicationFeeVat)&&d(e.productApplicationFee,this.productApplicationFee)&&e.productApplicationFeeVat==this.productApplicationFeeVat&&d(e.onlinePaymentDetails,this.onlinePaymentDetails)&&d(e.offlinePaymentDetails,this.offlinePaymentDetails)&&P(e.tickets,this.tickets,d)&&P(e.products,this.products,d)&&e.status===this.status&&e.bookingStrategy===this.bookingStrategy&&d(e.discount,this.discount)&&d(e.customer,this.customer)&&d(e.contactDetails,this.contactDetails)&&e.source===this.source&&e.isGuestOrder===this.isGuestOrder&&e.components.isSame(this.components)&&P(e.refunds,this.refunds,d)}copyWith({uniqueId:e=this.uniqueId,creatorId:t=this.creatorId,creationDate:s=g.cloneDate(this.creationDate),businessRef:a=F(this.businessRef),promoterId:o=this.promoterId,tickets:u=ue(this.tickets),products:c=ue(this.products),status:l=this.status,paymentType:h=this.paymentType,paymentMethod:p=this.paymentMethod,onlinePaymentDetails:I=Z(this.onlinePaymentDetails),offlinePaymentDetails:v=Z(this.offlinePaymentDetails),discount:E=Z(this.discount),source:w=this.source,components:S=F(this.components),isGuestOrder:R=this.isGuestOrder,refunds:x=ue(this.refunds),cancelledDate:N=g.cloneDateOrNull(this.cancelledDate),
2cancelledBy:O=this.cancelledBy,standardApplicationFee:A=this.standardApplicationFee.clone(L=>L.clone()),standardApplicationFeeVat:M=this.standardApplicationFeeVat.clone(L=>L),productApplicationFee:C=Z(this.productApplicationFee),productApplicationFeeVat:H=this.productApplicationFeeVat,donation:B=Z(this.donation),bookingStrategy:U=this.bookingStrategy,customer:V=Z(this.customer),contactDetails:q=F(this.contactDetails)}={}){return new n(e,t,s,a,o,u,c,l,h,p,I,v,E,w,S,R,x,N,O,A,M,C,H,B,U,V,q)}copyAsOpen({shouldClearRefunds:e=!1}={}){return this.copyWith({status:$e.Open,tickets:this.tickets.map(t=>t.markAsRestored()),cancelledBy:null,cancelledDate:null,refunds:e?[]:void 0})}copyAsAborted(){return this.copyWith({status:$e.Aborted,tickets:this.tickets.map(e=>e.copyAsAborted())})}copyAsCanceled(e,t,s){var a,o;return this.copyWith({status:s?$e.Refunded:$e.Canceled,cancelledBy:(a=this.cancelledBy)!==null&&a!==void 0?a:e,cancelledDate:(o=this.cancelledDate)!==null&&o!==void 0?o:t,tickets:this.tickets.map(u=>{let c=s||u.status===Ye.Refunded;return u.copyAsCanceled(e,t,c)})})}copyWithDiscount(e){return this.copyWith({discount:e})}copyWithPaymentDetails(e){return this.copyWith({onlinePaymentDetails:e})}copyWithOfflinePaymentDetails(e){return this.copyWith({offlinePaymentDetails:e})}copyWithReceipt(e){var t,s;return((s=(t=this.offlinePaymentDetails)===null||t===void 0?void 0:t.copyWithNewReceipt(e))!==null&&s!==void 0?s:$d.ofReceipt(e)).map(o=>this.copyWithOfflinePaymentDetails(o))}copyWithCancelledReceipt(e){if(k(this.offlinePaymentDetails))return W.error("Order has no receipt to cancel.");let t=this.offlinePaymentDetails.copyWithCurrentReceiptCancelledOrClone(e),s=this.copyWithOfflinePaymentDetails(t);return W.ok(s)}copyWithPaymentStatus(e){var t;return this.copyWith({onlinePaymentDetails:(t=this.onlinePaymentDetails)===null||t===void 0?void 0:t.copyWith({status:e})})}copyWithPaymentMethod(e){return this.copyWith({paymentMethod:e})}copyWithContactDetails(e){return this.copyWith({contactDetails:e})}copyWithTicketCloner(e){return this.copyWith({tickets:this.tickets.map(e)})}copyWithCreationDate(e){return this.copyWith({creationDate:e,tickets:this.tickets.map(t=>t.copyWith({creationDate:e}))})}assignToCustomerAccount(e){var t;return this.copyWith({creatorId:e.uniqueId,customer:(t=this.customer)===null||t===void 0?void 0:t.assignToCustomerAccount(e),tickets:this.tickets.map(s=>s.assignToCustomerAccount(e))})}getTotalFee(){return this.standardApplicationFee.isDefined?this.standardApplicationFee.isSome&&this.productApplicationFee!=null?this.standardApplicationFee.value.add(this.productApplicationFee):this.standardApplicationFee.isSome?this.standardApplicationFee.value.clone():this.productApplicationFee!=null?this.productApplicationFee.clone():null:null}tryGetCustomer(){return this.customer}generateSearchQueryArray(){var e,t,s,a,o,u,c;return co.generateSearchQueryArray([this.uniqueId,(e=this.onlinePaymentDetails)===null||e===void 0?void 0:e.paymentRequestId,(t=this.onlinePaymentDetails)===null||t===void 0?void 0:t.paymentId,(a=(s=this.customer)===null||s===void 0?void 0:s.uniqueId)!==null&&a!==void 0?a:this.customerId,(o=this.customer)===null||o===void 0?void 0:o.firstName,(u=this.customer)===null||u===void 0?void 0:u.lastName,(c=this.customer)===null||c===void 0?void 0:c.email],this.tickets.map(l=>l.templateId))}static encodedStatusSafe(e){return m(e)}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="4640f59adb5d4d6c9d62d3aba47c7115",n.SCHEMA_VERSION=19,n})(),up=class extends f{build(i,e){return We.fromMap(i,e)}optimizeForQuery(i,e){var t,s;let a=null;return e.paymentType===pe.Online?a=(s=(t=e.onlinePaymentDetails)===null||t===void 0?void 0:t.status)!==null&&s!==void 0?s:null:a=qt.Succeeded,{search:e.generateSearchQueryArray(),ticketType:m(e.tickets[0].ticketType),paymentStatus:Se(a),containsEventProducts:e.bookingStrategy===yt.TicketsAndProducts&&e.products.length>0}}migrateToCurrentSchemaVersion(i,e){var t,s,a,o;let u=r.getVersionRange(e);if(r.replace(e,"$status","DELETED",m($e.Canceled)),this.migrateEnum(e,"$status",$e,$e.Open),this.migrateEnum(e,"paymentType",pe,pe.OnDelivery),this.migrateEnum(e,"paymentMethod",Fe,Fe.Cash),u.contains(We.SCHEMA_VERSION))return e;if(u.isGreaterThan(We.SCHEMA_VERSION))return null;
2let c=u.to,l=c<18?this.extractCustomerAndContactDetailsFromLegacyTicketData(c,e):null;if(c<2&&(c=2),c<3&&(c=3),c<4&&(c=4),c<5&&(c=5),c<6&&(c=6),c<7){c=7;let h=y(r.get(e,"paymentType"),pe);e.paymentMethod=m(Yd(h))}if(c<8){if(r.get(e,"paymentMethod")===m(Fe.OnlineBankCard))e.source=m(Xe.Client);else if(r.get(e,"paymentType")===m(pe.Online))e.source=m(Xe.Client);else{let h=(s=(t=l?.customer)===null||t===void 0?void 0:t.uniqueId)!==null&&s!==void 0?s:null,p=(o=(a=l?.customer)===null||a===void 0?void 0:a.userId)!==null&&o!==void 0?o:null,I=r.getString(e,"creatorId");p===I?e.source=m(Xe.Client):e.source=m(Xe.Admin)}c=8}return c<9&&(e.isGuestOrder=!1,c=9),c<10&&(c=10,e.refunds=[]),c<11&&(c=11),c<12&&(c=12),c<13&&(e.applicationFee=dt.UNDEFINED_STATUS,e.applicationFeeVat=dt.UNDEFINED_STATUS,c=13),c<14&&(c=14),c<15&&(e.products=[],e.bookingStrategy=m(yt.Tickets),c=15),c<16&&(c=16),c<17&&(e.standardApplicationFee=e.applicationFee,e.standardApplicationFeeVat=e.applicationFeeVat,c=17),c<18&&(e.customer=i.toDataOrNull(l.customer),e.contactDetails=i.toData(l.contactDetails),c=18),c<19&&(c=19),e.$schema_version=D.encodedExactly(c),e}extractCustomerAndContactDetailsFromLegacyTicketData(i,e){var t,s;if(i>=18)throw new ie("Failed to extract customer from tickets of [EventTicketOrder]. Current schema version no longer stores the data in tickets.",{schemaVersion:i});let a=r.getList(e,"tickets",h=>h);if(a.length<=0)throw new ie("Failed to extract customer from tickets of [EventTicketOrder]. Order has no tickets.",{schemaVersion:i});let o=a[0],u=r.getStringOrNull(o,"customerId"),c=r.getRecordOrNull(o,"customer"),l=r.getRecordOrNull(o,"contactDetails");if(u!=null&&c==null)throw new ie("Failed to extract customer from tickets of [EventTicketOrder]. Ticket and order schema versions are out of sync.",{orderSchema:i,ticketSchema:(t=o.$schema_version)!==null&&t!==void 0?t:null});if(l==null)throw new ie("Failed to extract contact details from tickets of [EventTicketOrder]. Ticket and order schema versions are out of sync.",{orderSchema:i,ticketSchema:(s=o.$schema_version)!==null&&s!==void 0?s:null});return{customer:xR(c),contactDetails:Fd(l)}}},lo=class extends G{constructor(i){super(),this.note=i}get hasNote(){return _(this.note)&&this.note.length>0}},Ld=(()=>{class n extends lo{constructor(e){super(e)}get $typeId(){return n.TYPE_ID}get $removable(){return!1}static fromMap(e,t){return new n(r.get(t,"note"))}toMap(e){return{note:this.note}}clone(){return new n(this.note)}isSame(e){return this===e?!0:e.note===this.note}}return n.TYPE_ID="3b5acfa6d67d411487a3227653a549fa",n})(),cp=class extends f{build(i,e){return Ld.fromMap(i,e)}},Vd=(()=>{class n extends lo{constructor(e){super(e)}get $typeId(){return n.TYPE_ID}get $removable(){return!0}static fromMap(e,t){return new n(r.get(t,"note"))}toMap(e){return{note:this.note}}clone(){return new n(this.note)}isSame(e){return this===e?!0:e.note===this.note}}return n.TYPE_ID="1a88406fefc045a0985047f1eac60238",n})(),lp=class extends f{build(i,e){return Vd.fromMap(i,e)}},Hl=class extends b{get isOpenAndUpcoming(){return this.isUpcoming&&this.isOpen}},St=(function(n){return n.Open="OPEN",n.Aborted="ABORTED",n.Canceled="CANCELED",n.Rescheduled="RESCHEDULED",n})(St||{}),Ar=class extends Hl{get isOpen(){return this.status===St.Open}get isCanceled(){return this.status===St.Canceled}get date(){return this.dayOfYear.toDate(g.ofRegion(this.timezone))}get time(){return this.dayOfYear.toDateAndTime(this.timeOfDay,g.ofRegion(this.timezone))}get isFinished(){return this.time.add(this.duration).isBefore(fe.now())}get isUpcoming(){return this.time.isAfter(fe.now())}get isInProgress(){let i=fe.now(),e=this.time,t=e.add(this.duration);return(i.isSame(e)||i.isAfter(e))&&i.isBefore(t)}static encodedStatusSafe(i){return m(i)}},Cr=class extends Ar{get isGuestOrder(){return!1}get isLegacyOrder(){return!0}static calculateTotalDuration(i){let e=0;for(let t of i)e+=t.duration.asMilliseconds();return oe.default.duration(e,"milliseconds")}};var ut=class n{constructor(i=null){switch(i){case void 0:case null:case"":case n.NULL:this._stringValue=null;break;default:this._stringValue=i;break}}get hasValue(){return this._stringValue!==null}get value(){return this._stringValue}get queryableValue(){var i;return(i=this.value)!==null&&i!==void 0?i:n.NULL}clone(){return new n(this._stringValue)}
2isSame(i){return i._stringValue===this._stringValue}equals(i){return i===this._stringValue}};ut.NULL="null";ut.none=new ut;var gi=(()=>{class n extends b{constructor(e,t){super(),this.year=e,this.month=t,this.uniqueId=`${e}.${t.toString().padStart(2,"0")}`}get $typeId(){return n.TYPE_ID}static fromDate(e){return new n(e.year(),e.month()+1)}static fromDayOfYear(e){return new n(e.year,e.month)}static fromMap(e,t){return new n(r.get(t,"year"),r.get(t,"month"))}toMap(e){return{year:this.year,month:this.month}}clone(){return new n(this.year,this.month)}isSame(e){return this===e?!0:e.year===this.year&&e.month===this.month}toDate(e){return e.at(this.year,this.month-1,1,0,0)}static dateToUniqueId(e){return e.year.toString()+"."+e.month.toString().padStart(2,"0")}static dayOfYearToUniqueId(e){return e.year.toString()+"."+e.month.toString().padStart(2,"0")}}return n.TYPE_ID="97bd6c37ac684eb8a835a180b7e4e8bc",n})(),dp=class extends f{build(i,e){return gi.fromMap(i,e)}},rt=(()=>{class n extends Cr{constructor(e,t,s,a,o,u,c,l,h,p,I,v,E,w,S,R,x,N,O,A,M,C,H,B){super(),this.uniqueId=e,this.creatorId=t,this.businessRef=s,this.dayOfYear=a,this.timezone=o,this.creationDate=u,this.client=c,this.clientId=l,this.contactDetails=h,this.timeOfDay=p,this.staffMemberId=I,this.staffMember=v,this.status=E,this.services=w,this.hasBeenReviewed=S,this.paymentType=R,this.paymentMethod=x,this.onlinePaymentDetails=N,this.components=O,this.groupId=A,this.parentId=M,this.via=C,this.cancelledDate=H,this.cancelledBy=B,this.totalDuration=Cr.calculateTotalDuration(w),this.dayId=a.uniqueId,this.monthId=gi.dayOfYearToUniqueId(a),this.userId=c.userId,this.customerId=c.uniqueId,this.language=c.language,this.country=h.country}get duration(){return this.totalDuration}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(6,n.SCHEMA_VERSION)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.get(t,"creatorId"),j.mustDecode(r.get(t,"businessRef")),e.fromData(r.getRaw(t,"dayOfYear")),y(r.get(t,"timezone"),Ee),e.decodeDate(r.get(t,"creationDate")),e.fromData(r.getRaw(t,"client")),r.get(t,"clientId"),e.fromData(r.getRaw(t,"contactDetails")),e.fromData(r.getRaw(t,"timeOfDay")),new ut(r.getOrNull(t,"staffMemberId")),e.fromDataOrNull(r.getOrNull(t,"staffMember")),r.get(t,"$status"),r.getList(t,"services",s=>e.fromData(s)),r.get(t,"hasBeenReviewed"),y(r.get(t,"paymentType"),pe),y(r.get(t,"paymentMethod"),Fe),e.fromDataOrNull(r.getOrNull(t,"onlinePaymentDetails")),ae.deserialize(e,r.getList(t,"components",s=>s)),r.getOrNull(t,"groupId"),new ut(r.getOrNull(t,"parentId")),j.decode(r.getOrNull(t,"via")),e.decodeDateOrNull(r.getOrNull(t,"cancelledDate")),r.getOrNull(t,"cancelledBy"))}toMap(e){var t,s;return{uniqueId:this.uniqueId,creatorId:this.creatorId,userId:this.userId,businessRef:this.businessRef.encode(),dayId:this.dayId,monthId:this.monthId,dayOfYear:e.toData(this.dayOfYear),timeOfDay:e.toData(this.timeOfDay),timezone:m(this.timezone),date:e.encodeDate(this.time),creationDate:e.encodeDate(this.creationDate),contactDetails:e.toData(this.contactDetails),clientId:this.clientId,staffMemberId:this.staffMemberId.queryableValue,client:e.toData(this.client),staffMember:e.toDataOrNull(this.staffMember),services:this.services.map(a=>e.toData(a)),hasBeenReviewed:this.hasBeenReviewed,components:this.components.serialize(e),paymentType:m(this.paymentType),paymentMethod:m(this.paymentMethod),onlinePaymentDetails:e.toDataOrNull(this.onlinePaymentDetails),$status:this.status,groupId:this.groupId,parentId:this.parentId.queryableValue,via:(s=(t=this.via)===null||t===void 0?void 0:t.encode())!==null&&s!==void 0?s:null,cancelledDate:e.encodeDateOrNull(this.cancelledDate),cancelledBy:this.cancelledBy}}clone(){var e,t,s,a,o,u;return new n(this.uniqueId,this.creatorId,this.businessRef.clone(),this.dayOfYear.clone(),this.timezone,g.cloneDate(this.creationDate),this.client.clone(),this.clientId,this.contactDetails.clone(),this.timeOfDay.clone(),this.staffMemberId.clone(),(t=(e=this.staffMember)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null,this.status,this.services.map(c=>c.clone()),this.hasBeenReviewed,this.paymentType,this.paymentMethod,(a=(s=this.onlinePaymentDetails)===null||s===void 0?void 0:s.clone())!==null&&a!==void 0?a:null,this.components.clone(),this.groupId,this.parentId.clone(),(u=(o=this.via)===null||o===void 0?void 0:o.clone())!==null&&u!==void 0?u:null,g.cloneDateOrNull(this.cancelledDate),this.cancelledBy)}copyAsAborted(){var e,t,s,a,o,u;return new n(this.uniqueId,this.creatorId,this.businessRef.clone(),this.dayOfYear.clone(),this.timezone,g.cloneDate(this.creationDate),this.client.clone(),this.clientId,this.contactDetails.clone(),this.timeOfDay.clone(),this.staffMemberId.clone(),(t=(e=this.staffMember)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null,St.Aborted,this.services.map(c=>c.clone()),this.hasBeenReviewed,this.paymentType,this.paymentMethod,(a=(s=this.onlinePaymentDetails)===null||s===void 0?void 0:s.clone())!==null&&a!==void 0?a:null,this.components.clone(),this.groupId,this.parentId.clone(),(u=(o=this.via)===null||o===void 0?void 0:o.clone())!==null&&u!==void 0?u:null,g.cloneDateOrNull(this.cancelledDate),this.cancelledBy)}copyAsCanceled(e){var t,s,a,o,u,c;return new n(this.uniqueId,this.creatorId,this.businessRef.clone(),this.dayOfYear.clone(),this.timezone,g.cloneDate(this.creationDate),this.client.clone(),this.clientId,this.contactDetails.clone(),this.timeOfDay.clone(),this.staffMemberId.clone(),(s=(t=this.staffMember)===null||t===void 0?void 0:t.clone())!==null&&s!==void 0?s:null,St.Canceled,this.services.map(l=>l.clone()),this.hasBeenReviewed,this.paymentType,this.paymentMethod,(o=(a=this.onlinePaymentDetails)===null||a===void 0?void 0:a.clone())!==null&&o!==void 0?o:null,this.components.clone(),this.groupId,this.parentId.clone(),(c=(u=this.via)===null||u===void 0?void 0:u.clone())!==null&&c!==void 0?c:null,fe.now(),e)}copyWithPaymentDetails(e){var t,s,a,o;return new n(this.uniqueId,this.creatorId,this.businessRef.clone(),this.dayOfYear.clone(),this.timezone,g.cloneDate(this.creationDate),this.client.clone(),this.clientId,this.contactDetails.clone(),this.timeOfDay.clone(),this.staffMemberId.clone(),(s=(t=this.staffMember)===null||t===void 0?void 0:t.clone())!==null&&s!==void 0?s:null,this.status,this.services.map(u=>u.clone()),this.hasBeenReviewed,this.paymentType,this.paymentMethod,e,this.components.clone(),this.groupId,this.parentId.clone(),(o=(a=this.via)===null||a===void 0?void 0:a.clone())!==null&&o!==void 0?o:null,g.cloneDateOrNull(this.cancelledDate),this.cancelledBy)}copyWithPaymentStatus(e){var t,s,a,o,u,c;return new n(this.uniqueId,this.creatorId,this.businessRef.clone(),this.dayOfYear.clone(),this.timezone,g.cloneDate(this.creationDate),this.client.clone(),this.clientId,this.contactDetails.clone(),this.timeOfDay.clone(),this.staffMemberId.clone(),(s=(t=this.staffMember)===null||t===void 0?void 0:t.clone())!==null&&s!==void 0?s:null,this.status,this.services.map(l=>l.clone()),this.hasBeenReviewed,this.paymentType,this.paymentMethod,(o=(a=this.onlinePaymentDetails)===null||a===void 0?void 0:a.copyWith({status:e}))!==null&&o!==void 0?o:null,this.components.clone(),this.groupId,this.parentId.clone(),(c=(u=this.via)===null||u===void 0?void 0:u.clone())!==null&&c!==void 0?c:null,g.cloneDateOrNull(this.cancelledDate),this.cancelledBy)}copyWithPaymentMethod(e){var t,s,a,o,u,c;return new n(this.uniqueId,this.creatorId,this.businessRef.clone(),this.dayOfYear.clone(),this.timezone,g.cloneDate(this.creationDate),this.client.clone(),this.clientId,this.contactDetails.clone(),this.timeOfDay.clone(),this.staffMemberId.clone(),(s=(t=this.staffMember)===null||t===void 0?void 0:t.clone())!==null&&s!==void 0?s:null,this.status,this.services.map(l=>l.clone()),this.hasBeenReviewed,this.paymentType,e,(o=(a=this.onlinePaymentDetails)===null||a===void 0?void 0:a.clone())!==null&&o!==void 0?o:null,this.components.clone(),this.groupId,this.parentId.clone(),(c=(u=this.via)===null||u===void 0?void 0:u.clone())!==null&&c!==void 0?c:null,g.cloneDateOrNull(this.cancelledDate),this.cancelledBy)}copyWithBusinessRef(e){var t,s,a,o,u,c;return new n(this.uniqueId,this.creatorId,e.clone(),this.dayOfYear.clone(),this.timezone,g.cloneDate(this.creationDate),this.client.copyWithBusinessRef(e),this.clientId,this.contactDetails.clone(),this.timeOfDay.clone(),this.staffMemberId.clone(),(s=(t=this.staffMember)===null||t===void 0?void 0:t.copyWithBusinessRef(e))!==null&&s!==void 0?s:null,this.status,this.services.map(l=>l.copyWithBusinessRef(e)),this.hasBeenReviewed,this.paymentType,this.paymentMethod,(o=(a=this.onlinePaymentDetails)===null||a===void 0?void 0:a.clone())!==null&&o!==void 0?o:null,this.components.c
2opyWithBusinessRef(e),this.groupId,this.parentId.clone(),(c=(u=this.via)===null||u===void 0?void 0:u.clone())!==null&&c!==void 0?c:null,g.cloneDateOrNull(this.cancelledDate),this.cancelledBy)}assignToCustomerAccount(e){var t,s,a,o,u,c;return new n(this.uniqueId,e.uniqueId,this.businessRef.clone(),this.dayOfYear.clone(),this.timezone,g.cloneDate(this.creationDate),this.client.assignToCustomerAccount(e),this.clientId,this.contactDetails.clone(),this.timeOfDay.clone(),this.staffMemberId.clone(),(s=(t=this.staffMember)===null||t===void 0?void 0:t.clone())!==null&&s!==void 0?s:null,this.status,this.services.map(l=>l.clone()),this.hasBeenReviewed,this.paymentType,this.paymentMethod,(o=(a=this.onlinePaymentDetails)===null||a===void 0?void 0:a.clone())!==null&&o!==void 0?o:null,this.components.clone(),this.groupId,this.parentId.clone(),(c=(u=this.via)===null||u===void 0?void 0:u.clone())!==null&&c!==void 0?c:null,g.cloneDateOrNull(this.cancelledDate),this.cancelledBy)}isSame(e){return this===e?!0:d(e.client,this.client)&&d(e.dayOfYear,this.dayOfYear)&&d(e.timeOfDay,this.timeOfDay)&&d(e.staffMember,this.staffMember)&&d(e.contactDetails,this.contactDetails)&&d(e.onlinePaymentDetails,this.onlinePaymentDetails)&&P(e.services,this.services,d)&&e.components.isSame(this.components)&&e.timezone===this.timezone&&e.uniqueId===this.uniqueId&&e.creatorId===this.creatorId&&e.cancelledDate===this.cancelledDate&&e.cancelledBy===this.cancelledBy&&d(e.businessRef,this.businessRef)&&d(e.staffMemberId,this.staffMemberId)&&e.clientId===this.clientId&&e.creationDate===this.creationDate&&e.hasBeenReviewed===this.hasBeenReviewed&&e.status===this.status&&e.paymentType===this.paymentType&&e.paymentMethod===this.paymentMethod&&e.groupId===this.groupId&&d(e.parentId,this.parentId)&&d(e.via,this.via)}tryGetCustomer(){return this.client}hasComponentByTypeId(e){return this.components.hasComponentByTypeId(e)}mustFindComponentByTypeId(e){return this.components.mustFindComponentByTypeId(e)}findComponentByTypeId(e){return this.components.findComponentByTypeId(e)}findComponentByInstanceId(e){return this.components.findComponentByInstanceId(e)}findComponentsByTypeId(e){return this.components.findComponentsByTypeId(e)}addComponent(e){this.components.addComponent(e)}addComponents(e){this.components.addComponents(e)}removeComponentByTypeId(e){return this.components.removeComponentByTypeId(e)}removeComponentByInstanceId(e){return this.components.removeComponentByInstanceId(e)}removeComponentAt(e){this.components.removeComponentAt(e)}removeAllComponents(){this.components.removeAllComponents()}popAllComponentsByTypeId(e){return this.components.popAllComponentsByTypeId(e)}popComponentByTypeId(e){return this.components.popComponentByTypeId(e)}popComponent(e){return this.components.popComponent(e)}replaceComponent(e){return this.components.replaceComponent(e)}addOrReplaceComponent(e){this.components.addOrReplaceComponent(e)}mustFindComponentField(e,t){return this.components.mustFindComponentField(e,t)}findComponentField(e,t){return this.components.findComponentField(e,t)}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="451e4ff39c3245bbb922cd83f4abd047",n.SCHEMA_VERSION=10,n})(),hp=class extends f{build(i,e){return rt.fromMap(i,e)}optimizeForQuery(i,e){var t,s;let a=null;return e.paymentType===pe.Online?a=(s=(t=e.onlinePaymentDetails)===null||t===void 0?void 0:t.status)!==null&&s!==void 0?s:null:a=qt.Succeeded,{paymentStatus:Se(a),paymentType:m(e.paymentType),paymentMethod:m(e.paymentMethod)}}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(this.migrateEnum(e,"paymentType",pe,pe.OnDelivery),this.migrateEnum(e,"paymentMethod",Fe,Fe.Cash),this.migrateEnum(e,"$status",St,St.Open),r.replace(e,"$status","DELETED",m(St.Canceled)),t.contains(rt.SCHEMA_VERSION))return e;if(t.isGreaterThan(rt.SCHEMA_VERSION))return null;let s=t.to;if(s<2&&(r.setIfNullOrUndefined(e,"hasBeenReviewed",!1),r.set(e,"components",[]),s=2),s<3){let a=ae.deserialize(i,r.getList(e,"components",u=>u)),o=a.findComponentByTypeId(Vd.TYPE_ID);o&&a.addComponent(new Ld(o.note)),r.set(e,"components",a.serialize(i)),s=3}if(s<4&&(r.set(e,"groupId",null),r.set(e,"parentId",null),s=4),s<5&&(r.set(e,"onlinePaymentDetails",null),s=5),s<6&&(r.setIfNullOrUndefined(e,"businessRef",r.get(e,"businessId")),s=6),s<7&&(s=7),s<8&&(s=8),s<9){s=9;let a=y(r.get(e,"paymentType"),pe);e.paymentMethod=m(Yd(a))}return s<10&&(s=10),e.$schema_version=D.encodedExactly(s),e}},pr=(function(n){return n.Open="OPEN",n.Aborted="ABORTED",n.Canceled="CANCELED",n.Refunded="REFUNDED",n})(pr||{}),at=(()=>{class n extends b{constructor(e,t,s,a,o,u,c,l,h,p,I,v,E,w,S,R,x,N){var O,A,M,C,H,B;super(),this.uniqueId=e,this.creatorId=t,this.creationDate=s,this.businessRef=a,this.country=o,this.timezone=u,this.status=c,this.paymentType=l,this.paymentMethod=h,this.onlinePaymentDetails=p,this.source=I,this.components=v,this.isGuestOrder=E,this.cancelledDate=w,this.cancelledBy=S,this.applicationFee=R,this.applicationFeeVat=x,this.passes=N,this.isLegacyOrder=!0,this.userId=(A=(O=N[0].customer)===null||O===void 0?void 0:O.userId)!==null&&A!==void 0?A:null,this.customerId=(C=(M=N[0].customer)===null||M===void 0?void 0:M.uniqueId)!==null&&C!==void 0?C:null,this.language=(B=(H=N[0].customer)===null||H===void 0?void 0:H.language)!==null&&B!==void 0?B:null}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}get isOpen(){return this.status===pr.Open}get isCanceled(){return this.status===pr.Canceled}static create(e){return new n(e.uniqueId,e.creatorId,e.creationDate,e.businessRef,e.country,e.timezone,e.status,e.paymentType,e.paymentMethod,e.onlinePaymentDetails,e.source,e.components,e.isGuestOrder,e.cancelledDate,e.cancelledBy,e.a
2pplicationFee,e.applicationFeeVat,e.passes)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.get(t,"creatorId"),e.decodeDate(r.get(t,"creationDate")),j.mustDecode(r.get(t,"businessRef")),y(r.get(t,"country"),Ie),y(r.get(t,"timezone"),Ee),y(r.get(t,"$status"),pr),y(r.get(t,"paymentType"),pe),y(r.get(t,"paymentMethod"),Fe),e.fromDataOrNull(r.getOrNull(t,"onlinePaymentDetails")),y(r.get(t,"source"),Xe),ae.deserialize(e,r.getList(t,"components",s=>s)),r.get(t,"isGuestOrder"),e.decodeDateOrNull(r.getOrNull(t,"cancelledDate")),r.getOrNull(t,"cancelledBy"),Y.decodeOrNull(r.getOrNull(t,"applicationFee")),Re(r.getStringOrNull(t,"applicationFeeVat"),te),r.getList(t,"passes",s=>e.fromData(s)))}toMap(e){var t,s;return{$status:m(this.status),uniqueId:this.uniqueId,creatorId:this.creatorId,userId:this.userId,customerId:this.customerId,businessRef:this.businessRef.encode(),country:m(this.country),timezone:m(this.timezone),creationDate:e.encodeDate(this.creationDate),isGuestOrder:this.isGuestOrder,components:this.components.serialize(e),paymentType:m(this.paymentType),paymentMethod:m(this.paymentMethod),onlinePaymentDetails:e.toDataOrNull(this.onlinePaymentDetails),applicationFee:(s=(t=this.applicationFee)===null||t===void 0?void 0:t.encode())!==null&&s!==void 0?s:null,applicationFeeVat:Se(this.applicationFeeVat),cancelledDate:e.encodeDateOrNull(this.cancelledDate),cancelledBy:this.cancelledBy,source:m(this.source),passes:this.passes.map(a=>e.toData(a))}}clone(){var e,t,s,a;return new n(this.uniqueId,this.creatorId,g.cloneDate(this.creationDate),this.businessRef.clone(),this.country,this.timezone,this.status,this.paymentType,this.paymentMethod,(t=(e=this.onlinePaymentDetails)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null,this.source,this.components.clone(),this.isGuestOrder,g.cloneDateOrNull(this.cancelledDate),this.cancelledBy,(a=(s=this.applicationFee)===null||s===void 0?void 0:s.clone())!==null&&a!==void 0?a:null,this.applicationFeeVat,this.passes.map(o=>o.clone()))}isSame(e){return this===e?!0:d(e.onlinePaymentDetails,this.onlinePaymentDetails)&&P(e.passes,this.passes,d)&&e.components.isSame(this.components)&&e.country===this.country&&e.timezone===this.timezone&&e.source===this.source&&e.uniqueId===this.uniqueId&&e.creatorId===this.creatorId&&e.cancelledDate===this.cancelledDate&&e.cancelledBy===this.cancelledBy&&e.applicationFeeVat==this.applicationFeeVat&&d(e.applicationFee,this.applicationFee)&&d(e.businessRef,this.businessRef)&&e.creationDate===this.creationDate&&e.status===this.status&&e.paymentMethod===this.paymentMethod&&e.paymentType===this.paymentType&&e.isGuestOrder===this.isGuestOrder}copyWithPasses(e){var t,s,a,o;return new n(this.uniqueId,this.creatorId,g.cloneDate(this.creationDate),this.businessRef.clone(),this.country,this.timezone,this.status,this.paymentType,this.paymentMethod,(s=(t=this.onlinePaymentDetails)===null||t===void 0?void 0:t.clone())!==null&&s!==void 0?s:null,this.source,this.components.clone(),this.isGuestOrder,g.cloneDateOrNull(this.cancelledDate),this.cancelledBy,(o=(a=this.applicationFee)===null||a===void 0?void 0:a.clone())!==null&&o!==void 0?o:null,this.applicationFeeVat,e)}copyWithPaymentDetails(e){var t,s;return new n(this.uniqueId,this.creatorId,g.cloneDate(this.creationDate),this.businessRef.clone(),this.country,this.timezone,this.status,this.paymentType,this.paymentMethod,e,this.source,this.components.clone(),this.isGuestOrder,g.cloneDateOrNull(this.cancelledDate),this.cancelledBy,(s=(t=this.applicationFee)===null||t===void 0?void 0:t.clone())!==null&&s!==void 0?s:null,this.applicationFeeVat,this.passes.map(a=>a.clone()))}copyWithPaymentStatus(e){var t,s,a,o;return new n(this.uniqueId,this.creatorId,g.cloneDate(this.creationDate),this.businessRef.clone(),this.country,this.timezone,this.status,this.paymentType,this.paymentMethod,(s=(t=this.onlinePaymentDetails)===null||t===void 0?void 0:t.copyWith({status:e}))!==null&&s!==void 0?s:null,this.source,this.components.clone(),this.isGuestOrder,g.cloneDateOrNull(this.cancelledDate),this.cancelledBy,(o=(a=this.applicationFee)===null||a===void 0?void 0:a.clone())!==null&&o!==void 0?o:null,this.applicationFeeVat,this.passes.map(u=>u.clone()))}copyWithPaymentMethod(e){var t,s,a,o;return new n(this.uniqueId,this.creatorId,g.cloneDate(this.creationDate),this.businessRef.clone(),this.country,this.timezone,this.status,this.paymentType,e,(s=(t=this.onlinePaymentDetails)===null||t===void 0?void 0:t.clone())!==null&&s!==void 0?s:null,this.source,this.components.clone(),this.isGuestOrder,g.cloneDateOrNull(this.cancelledDate),this.cancelledBy,(o=(a=this.applicationFee)===null||a===void 0?void 0:a.clone())!==null&&o!==void 0?o:null,this.applicationFeeVat,this.passes.map(u=>u.clone()))}assignToCustomerAccount(e){var t,s,a,o;return new n(this.uniqueId,e.uniqueId,g.cloneDate(this.creationDate),this.businessRef.clone(),this.country,this.timezone,this.status,this.paymentType,this.paymentMethod,(s=(t=this.onlinePaymentDetails)===null||t===void 0?void 0:t.clone())!==null&&s!==void 0?s:null,this.source,this.components.clone(),this.isGuestOrder,g.cloneDateOrNull(this.cancelledDate),this.cancelledBy,(o=(a=this.applicationFee)===null||a===void 0?void 0:a.clone())!==null&&o!==void 0?o:null,this.applicationFeeVat,this.passes.map(u=>u.clone()))}tryGetCustomer(){return this.passes[0].customer}hasComponentByTypeId(e){return this.components.hasComponentByTypeId(e)}mustFindComponentByTypeId(e){return this.components.mustFindComponentByTypeId(e)}findComponentByTypeId(e){return this.components.findComponentByTypeId(e)}findComponentByInstanceId(e){return this.components.findComponentByInstanceId(e)}findComponentsByTypeId(e){return this.components.findComponentsByTypeId(e)}addComponent(e){this.components.addComponent(e)}addComponents(e){this.components.addComponents(e)}
2removeComponentByTypeId(e){return this.components.removeComponentByTypeId(e)}removeComponentByInstanceId(e){return this.components.removeComponentByInstanceId(e)}removeComponentAt(e){this.components.removeComponentAt(e)}removeAllComponents(){this.components.removeAllComponents()}popAllComponentsByTypeId(e){return this.components.popAllComponentsByTypeId(e)}popComponentByTypeId(e){return this.components.popComponentByTypeId(e)}popComponent(e){return this.components.popComponent(e)}replaceComponent(e){return this.components.replaceComponent(e)}addOrReplaceComponent(e){this.components.addOrReplaceComponent(e)}mustFindComponentField(e,t){return this.components.mustFindComponentField(e,t)}findComponentField(e,t){return this.components.findComponentField(e,t)}static encodedStatusSafe(e){return m(e)}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="3bebfa5bd9564f96b0dbeec736bf5569",n.SCHEMA_VERSION=2,n})(),fp=class extends f{build(i,e){return at.fromMap(i,e)}optimizeForQuery(i,e){var t,s;let a=null;return e.paymentType===pe.Online?a=(s=(t=e.onlinePaymentDetails)===null||t===void 0?void 0:t.status)!==null&&s!==void 0?s:null:a=qt.Succeeded,{paymentStatus:Se(a),paymentType:m(e.paymentType),paymentMethod:m(e.paymentMethod)}}migrateToCurrentSchemaVersion(i,e){var t;let s=r.getVersionRange(e);if(this.migrateEnum(e,"$status",pr,pr.Open),s.contains(at.SCHEMA_VERSION))return e;if(s.isGreaterThan(at.SCHEMA_VERSION))return null;let a=s.to;if(a<2){let o=y(r.get(e,"timezone"),Ee);e.country=m((t=xd(o))!==null&&t!==void 0?t:Ie.Romania),a=2}return e.$schema_version=D.encodedExactly(a),e}},je=(()=>{class n extends zt(b){constructor(e,t,s,a,o,u,c,l,h,p,I,v,E,w,S,R,x,N,O,A,M,C,H,B,U){super(),this.uniqueId=e,this.creatorId=t,this.creationDate=s,this.status=a,this.paymentType=o,this.paymentMethod=u,this.onlinePaymentDetails=c,this.isGuestOrder=l,this.cancelledDate=h,this.cancelledBy=p,this.sideEffects=I,this.businessRef=v,this.tickets=E,this.products=w,this.refunds=S,this.components=R,this.donation=x,this.discount=N,this.standardApplicationFee=O,this.standardApplicationFeeVat=A,this.productApplicationFee=M,this.productApplicationFeeVat=C,this.bookingStrategy=H,this.customer=B,this.contactDetails=U,this.isLegacyOrder=!0,this.eventId=E[0].eventId,this.userId=E[0].userId,this.customerId=E[0].customerId,this.language=E[0].language,this.country=E[0].country,this.timezone=E[0].timezone}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(18,n.SCHEMA_VERSION)}get isOpen(){return this.status===$e.Open}get isCanceled(){return this.status===$e.Canceled}static create(e){var t;return new n(e.uniqueId,e.creatorId,e.creationDate,e.status,e.paymentType,e.paymentMethod,e.onlinePaymentDetails,e.isGuestOrder,null,null,(t=e.sideEffects)!==null&&t!==void 0?t:[],e.businessRef,e.tickets,e.products,e.refunds,e.components,e.donation,e.discount,e.standardApplicationFee,e.standardApplicationFeeVat,e.productApplicationFee,e.productApplicationFeeVat,e.bookingStrategy,e.customer,e.contactDetails)}static fromTicketOrder(e){var t,s,a,o,u,c,l,h;return new n(e.uniqueId,e.creatorId,e.creationDate,e.status,e.paymentType,e.paymentMethod,(s=(t=e.onlinePaymentDetails)===null||t===void 0?void 0:t.clone())!==null&&s!==void 0?s:null,e.isGuestOrder,g.cloneDateOrNull(e.cancelledDate),e.cancelledBy,[],e.businessRef.clone(),ue(e.tickets),ue(e.products),ue(e.refunds),e.components.clone(),(o=(a=e.donation)===null||a===void 0?void 0:a.clone())!==null&&o!==void 0?o:null,(c=(u=e.discount)===null||u===void 0?void 0:u.clone())!==null&&c!==void 0?c:null,e.standardApplicationFee.isSome?e.standardApplicationFee.value.clone():null,e.standardApplicationFeeVat.isSome?e.standardApplicationFeeVat.value:null,(h=(l=e.productApplicationFee)===null||l===void 0?void 0:l.clone())!==null&&h!==void 0?h:null,e.productApplicationFeeVat,e.bookingStrategy,e.customer,e.contactDetails)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.get(t,"creatorId"),e.decodeDate(r.get(t,"creationDate")),y(r.get(t,"$status"),$e),y(r.get(t,"paymentType"),pe),y(r.get(t,"paymentMethod"),Fe),e.fromDataOrNull(r.getOrNull(t,"onlinePaymentDetails")),r.get(t,"isGuestOrder"),e.decodeDateOrNull(r.getOrNull(t,"cancelledDate")),r.getOrNull(t,"cancelledBy"),r.getList(t,"sideEffects",s=>e.fromData(s)),j.mustDecode(r.get(t,"businessRef")),r.getList(t,"tickets",s=>e.fromData(s)),r.getList(t,"products",s=>e.fromData(s)),r.getList(t,"refunds",s=>e.fromData(s)),ae.deserialize(e,r.getList(t,"components",s=>K.decodeRecord(s))),Y.decodeOrNull(r.getOrNull(t,"donation")),e.fromDataOrNull(r.getOrNull(t,"discount")),Y.decodeOrNull(r.getOrNull(t,"standardApplicationFee")),Re(r.getStringOrNull(t,"standardApplicationFeeVat"),te),Y.decodeOrNull(r.getOrNull(t,"productApplicationFee")),Re(r.getStringOrNull(t,"productApplicationFeeVat"),te),y(r.getString(t,"bookingStrategy"),yt),e.fromDataOrNull(r.getRecordOrNull(t,"customer")),e.fromData(r.getRecord(t,"contactDetails")))}toMap(e){var t,s,a,o,u,c;e.storage.set("avoidOptimizeForQuery",!0);let l={uniqueId:this.uniqueId,creatorId:this.creatorId,customerId:this.customerId,userId:this.userId,creationDate:e.encodeDate(this.creationDate),$status:m(this.status),paymentType:m(this.paymentType),paymentMethod:m(this.paymentMethod),onlinePaymentDetails:e.toDataOrNull(this.onlinePaymentDetails),isGuestOrder:this.isGuestOrder,cancelledDate:e.encodeDateOrNull(this.cancelledDate),
2cancelledBy:this.cancelledBy,sideEffects:this.sideEffects.map(h=>e.toData(h)),donation:(s=(t=this.donation)===null||t===void 0?void 0:t.encode())!==null&&s!==void 0?s:null,standardApplicationFee:(o=(a=this.standardApplicationFee)===null||a===void 0?void 0:a.encode())!==null&&o!==void 0?o:null,standardApplicationFeeVat:Se(this.standardApplicationFeeVat),productApplicationFee:(c=(u=this.productApplicationFee)===null||u===void 0?void 0:u.encode())!==null&&c!==void 0?c:null,productApplicationFeeVat:Se(this.productApplicationFeeVat),businessRef:this.businessRef.encode(),tickets:this.tickets.map(h=>e.toData(h)),products:this.products.map(h=>e.toData(h)),discount:e.toDataOrNull(this.discount),refunds:this.refunds.map(h=>e.toData(h)),eventId:this.eventId,components:this.components.serialize(e),bookingStrategy:m(this.bookingStrategy),customer:e.toDataOrNull(this.customer),contactDetails:e.toData(this.contactDetails)};return e.storage.remove("avoidOptimizeForQuery"),l}clone(){var e,t,s,a,o,u,c,l,h,p;return new n(this.uniqueId,this.creatorId,g.cloneDate(this.creationDate),this.status,this.paymentType,this.paymentMethod,(t=(e=this.onlinePaymentDetails)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null,this.isGuestOrder,g.cloneDateOrNull(this.cancelledDate),this.cancelledBy,this.sideEffects.map(I=>I.clone()),this.businessRef.clone(),ue(this.tickets),ue(this.products),ue(this.refunds),this.components.clone(),(a=(s=this.donation)===null||s===void 0?void 0:s.clone())!==null&&a!==void 0?a:null,(u=(o=this.discount)===null||o===void 0?void 0:o.clone())!==null&&u!==void 0?u:null,(l=(c=this.standardApplicationFee)===null||c===void 0?void 0:c.clone())!==null&&l!==void 0?l:null,this.standardApplicationFeeVat,(p=(h=this.productApplicationFee)===null||h===void 0?void 0:h.clone())!==null&&p!==void 0?p:null,this.productApplicationFeeVat,this.bookingStrategy,Z(this.customer),F(this.contactDetails))}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.creatorId===this.creatorId&&e.creationDate===this.creationDate&&e.status===this.status&&e.paymentType===this.paymentType&&e.paymentMethod===this.paymentMethod&&e.isGuestOrder===this.isGuestOrder&&e.cancelledDate===this.cancelledDate&&e.cancelledBy===this.cancelledBy&&P(e.sideEffects,this.sideEffects,d)&&d(e.onlinePaymentDetails,this.onlinePaymentDetails)&&d(e.donation,this.donation)&&d(e.standardApplicationFee,this.standardApplicationFee)&&e.standardApplicationFeeVat==this.standardApplicationFeeVat&&d(e.productApplicationFee,this.productApplicationFee)&&e.productApplicationFeeVat==this.productApplicationFeeVat&&e.businessRef===this.businessRef&&e.bookingStrategy===this.bookingStrategy&&d(e.discount,this.discount)&&P(e.tickets,this.tickets,d)&&P(e.products,this.products,d)&&P(e.refunds,this.refunds,d)&&d(e.customer,this.customer)&&d(e.contactDetails,this.contactDetails)&&d(e.components,this.components)}copyAsAborted(){return this.copyWith({status:$e.Aborted,tickets:this.tickets.map(e=>e.copyAsAborted())})}copyAsCanceled(e,t,s){var a,o;return this.copyWith({status:s?$e.Refunded:$e.Canceled,cancelledDate:(a=this.cancelledDate)!==null&&a!==void 0?a:t,cancelledBy:(o=this.cancelledBy)!==null&&o!==void 0?o:e,tickets:this.tickets.map(u=>{let c=s||u.status===Ye.Refunded;return u.copyAsCanceled(e,t,c)})})}copyWithPaymentDetails(e){return this.copyWith({onlinePaymentDetails:e})}copyWithPaymentStatus(e){var t;return this.copyWith({onlinePaymentDetails:(t=this.onlinePaymentDetails)===null||t===void 0?void 0:t.copyWith({status:e})})}copyWithPaymentMethod(e){return this.copyWith({paymentMethod:e})}copyWithContactDetails(e){return this.copyWith({contactDetails:e})}copyWithTicketCloner(e){return this.copyWith({tickets:this.tickets.map(e)})}copyWithCreationDate(e){return this.copyWith({creationDate:e,tickets:this.tickets.map(t=>t.copyWith({creationDate:e}))})}assignToCustomerAccount(e){var t;return this.copyWith({creatorId:e.uniqueId,customer:(t=this.customer)===null||t===void 0?void 0:t.assignToCustomerAccount(e),tickets:this.tickets.map(s=>s.assignToCustomerAccount(e))})}copyWith({uniqueId:e=this.uniqueId,creatorId:t=this.creatorId,creationDate:s=g.cloneDate(this.creationDate),status:a=this.status,paymentType:o=this.paymentType,paymentMethod:u=this.paymentMethod,onlinePaymentDetails:c=Z(this.onlinePaymentDetails),isGuestOrder:l=this.isGuestOrder,cancelledDate:h=g.cloneDateOrNull(this.cancelledDate),
2cancelledBy:p=this.cancelledBy,sideEffects:I=ue(this.sideEffects),businessRef:v=F(this.businessRef),tickets:E=ue(this.tickets),products:w=ue(this.products),refunds:S=ue(this.refunds),discount:R=Z(this.discount),donation:x=Z(this.donation),standardApplicationFee:N=Z(this.standardApplicationFee),standardApplicationFeeVat:O=this.standardApplicationFeeVat,productApplicationFee:A=Z(this.productApplicationFee),productApplicationFeeVat:M=this.productApplicationFeeVat,components:C=this.components.clone(),bookingStrategy:H=this.bookingStrategy,customer:B=Z(this.customer),contactDetails:U=F(this.contactDetails)}={}){return new n(e,t,s,a,o,u,c,l,h,p,I,v,E,w,S,C,x,R,N,O,A,M,H,B,U)}getTotalFee(){return this.standardApplicationFee!=null&&this.productApplicationFee!=null?this.standardApplicationFee.add(this.productApplicationFee):this.standardApplicationFee!=null?this.standardApplicationFee.clone():this.productApplicationFee!=null?this.productApplicationFee.clone():null}tryGetCustomer(){return this.customer}tryGetContactDetails(){return this.contactDetails}findSideEffect(e){for(let t=0;t<this.sideEffects.length;t++)if(this.sideEffects[t].effectType===e)return this.sideEffects[t];return null}hasSideEffect(e){return this.findSideEffect(e)!=null}static encodedStatusSafe(e){return m(e)}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="f0b0d5cdc7a44b6e839f53a9163e8e87",n.SCHEMA_VERSION=19,n})(),pp=class extends f{build(i,e){return je.fromMap(i,e)}optimizeForQuery(i,e){var t,s;let a=null;return e.paymentType===pe.Online?a=(s=(t=e.onlinePaymentDetails)===null||t===void 0?void 0:t.status)!==null&&s!==void 0?s:null:a=qt.Succeeded,{paymentStatus:Se(a),paymentType:m(e.paymentType),paymentMethod:m(e.paymentMethod),containsEventProducts:e.bookingStrategy===yt.TicketsAndProducts&&e.products.length>0}}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(r.replace(e,"$status","DELETED",m($e.Canceled)),this.migrateEnum(e,"$status",$e,$e.Open),this.migrateEnum(e,"paymentType",pe,pe.OnDelivery),this.migrateEnum(e,"paymentMethod",Fe,Fe.Cash),t.contains(je.SCHEMA_VERSION))return e;if(t.isGreaterThan(je.SCHEMA_VERSION))return null;let s=t.to,a=s<18?this.extractCustomerAndContactDetailsFromLegacyTicketData(s,e):null;if(s<2&&(s=2),s<3){let o=r.getList(e,"usedPromoCodes",h=>i.fromData(h)),u=r.getList(e,"items",h=>i.fromData(h)),c=u[0].businessRef,l=o.map(h=>fn.fromLegacyPromoCode(c,h));if(l.length>0){for(let h of u)for(let p=0;p<h.tickets.length;p++)h.tickets[p]=h.tickets[p].copyWith({discount:l[0]});e.items=u.map(h=>i.toData(h))}e.discount=null,s=3}if(s<4&&(s=4),s<5){let o=i.fromDataOrNull(r.getOrNull(e,"discount"));if(_(o)){let u=r.getList(e,"items",c=>i.fromData(c));u[0].discount=o,e.items=u.map(c=>i.toData(c))}s=5}if(s<6){s=6;let o=y(r.get(e,"paymentType"),pe);e.paymentMethod=m(Yd(o))}if(s<7&&(e.isGuestOrder=!1,s=7),s<8&&(s=8),s<9&&(e.onCompleteHooks=[],s=9),s<10){let o=r.getList(e,"items",u=>i.fromData(u));if(o.length!=1)throw new ie(`Order {${e.uniqueId}} of {${e.creatorId}} must have exactly one item.`);i.storage.set("avoidOptimizeForQuery",!0),e.businessRef=o[0].businessRef.encode(),e.tickets=o[0].tickets.map(u=>i.toData(u)),e.discount=i.toDataOrNull(o[0].discount),e.refunds=o[0].refunds.map(u=>i.toData(u)),i.storage.remove("avoidOptimizeForQuery"),s=10}if(s<11&&(s=11),s<12&&(r.setIfNullOrUndefined(e,"components",[]),s=12),s<13&&(s=13),s<14){let u=r.getList(e,"onCompleteHooks",c=>i.fromData(K.decodeRecord(c))).map(c=>c.toSideEffect()).filter(_);e.sideEffects=u.map(c=>i.toData(c)),s=14}return s<15&&(e.products=[],e.bookingStrategy=m(yt.Tickets),s=15),s<16&&(s=16),s<17&&(e.standardApplicationFee=e.applicationFee,e.standardApplicationFeeVat=e.applicationFeeVat,s=17),s<18&&(e.customer=i.toDataOrNull(a.customer),e.contactDetails=i.toData(a.contactDetails),s=18),s<19&&(s=19),e.$schema_version=D.encodedExactly(s),e}extractCustomerAndContactDetailsFromLegacyTicketData(i,e){var t,s;if(i>=18)throw new ie("Failed to extract customer from tickets of [OnlineEventTicketOrder]. Current schema version no longer stores the data in tickets.",{schemaVersion:i});let a=null;if(i<10){let l=r.getList(e,"items",h=>h);if(l.length>0){let h=r.getList(l[0],"tickets",p=>p);h.length>0&&(a=h[0])}}else{let l=r.getList(e,"tickets",h=>h);l.length>0&&(a=l[0])}if(a==null)throw new ie("Failed to extract customer from tickets of [OnlineEventTicketOrder]. Order has no tickets.",{schemaVersion:i});
2let o=r.getStringOrNull(a,"customerId"),u=r.getRecordOrNull(a,"customer"),c=r.getRecordOrNull(a,"contactDetails");if(o!=null&&u==null)throw new ie("Failed to extract customer from tickets of [OnlineEventTicketOrder]. Ticket and order schema versions are out of sync.",{orderSchema:i,ticketSchema:(t=a.$schema_version)!==null&&t!==void 0?t:null});if(c==null)throw new ie("Failed to extract contact details from tickets of [OnlineEventTicketOrder]. Ticket and order schema versions are out of sync.",{orderSchema:i,ticketSchema:(s=a.$schema_version)!==null&&s!==void 0?s:null});return{customer:xR(u),contactDetails:Fd(c)}}},sn=(function(n){return n.DeferOrderCompletion="DeferOrderCompletion",n.SendOnlyPaymentConfirmation="SendOnlyPaymentConfirmation",n.CreateGiftCard="CreateGiftCard",n.CreateOpenTicketPass="CreateOpenTicketPass",n.CreateOpenAccessPass="CreateOpenAccessPass",n.CreateOpenAccessPassFromTicket="CreateOpenAccessPassFromTicket",n.RedirectAfterPayment="RedirectAfterPayment",n.SendProductOrderConfirmationEmail="SendProductOrderConfirmationEmail",n.GenerateProductQr="GenerateProductQr",n.GenerateProductPdf="GenerateProductPdf",n.OutboundWebhook="OutboundWebhook",n})(sn||{}),Vt=class extends b{},Gw=(()=>{class n extends Vt{constructor(){super(),this.effectType=sn.DeferOrderCompletion}get $typeId(){return n.TYPE_ID}static create(){return new n}static fromMap(e,t){return new n}toMap(e){return{effectType:m(this.effectType)}}clone(){return new n}isSame(e){return this===e?!0:e.effectType===this.effectType}toLegacyOrderHook(){return Ln.create(Ze.DeferOrderCompletion)}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="600a9930cdae4ee0a02bb51519f0ba24",n})(),gp=class extends f{build(i,e){return Gw.fromMap(i,e)}},Ww=(()=>{class n extends Vt{constructor(){super(),this.effectType=sn.SendOnlyPaymentConfirmation}get $typeId(){return n.TYPE_ID}static create(){return new n}static fromMap(e,t){return new n}toMap(e){return{effectType:m(this.effectType)}}clone(){return new n}isSame(e){return this===e?!0:e.effectType===this.effectType}toLegacyOrderHook(){return Ln.create(Ze.SendOnlyPaymentConfirmation)}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="8fdbdfdf5e294fdb9e698f26e049094f",n})(),mp=class extends f{build(i,e){return Ww.fromMap(i,e)}},jw=(()=>{class n extends Vt{constructor(){super(),this.effectType=sn.CreateOpenAccessPassFromTicket}get $typeId(){return n.TYPE_ID}static create(){return new n}static fromMap(e,t){return new n}toMap(e){return{effectType:m(this.effectType)}}clone(){return new n}isSame(e){return this===e?!0:e.effectType===this.effectType}toLegacyOrderHook(){return Ln.create(Ze.CreateOpenAccessPassFromTicket)}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="cbe94102540242fbaa73a3a934905635",n})(),Ip=class extends f{build(i,e){return jw.fromMap(i,e)}},Jw=(()=>{class n extends Vt{constructor(e,t){super(),this.webRoute=e,this.isEvent=t,this.effectType=sn.RedirectAfterPayment}get $typeId(){return n.TYPE_ID}static create({webRoute:e,isEvent:t}){return new n(e,t)}static fromMap(e,t){return new n(r.getString(t,"webRoute"),r.getBoolean(t,"isEvent"))}toMap(e){return{effectType:m(this.effectType),webRoute:this.webRoute,isEvent:this.isEvent}}clone(){return new n(this.webRoute,this.isEvent)}isSame(e){return this===e?!0:e.effectType===this.effectType&&e.webRoute===this.webRoute&&e.isEvent===this.isEvent}toLegacyOrderHook(){return Ln.create(Ze.RedirectAfterPayment,{webRoute:this.webRoute,isEvent:this.isEvent})}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="6b168068a71b43eba0e11ab5d0d2570a",n})(),Dp=class extends f{build(i,e){return Jw.fromMap(i,e)}},Kw=(()=>{class n extends Vt{constructor(){super(),this.effectType=sn.CreateGiftCard}get $typeId(){return n.TYPE_ID}static create(){return new n}static fromMap(e,t){return new n}toMap(e){return{effectType:m(this.effectType)}}clone(){return new n}isSame(e){return this===e?!0:e.effectType===this.effectType}toLegacyOrderHook(){return Ln.create(Ze.CreateGiftCard)}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="a250781dbd5e48139ef618b36e5880e8",n})(),vp=class extends f{build(i,e){return Kw.fromMap(i,e)}},Zw=(()=>{class n extends Vt{constructor(){super(),this.effectType=sn.CreateOpenTicketPass}get $typeId(){return n.TYPE_ID}static create(){return new n}static fromMap(e,t){return new n}toMap(e){return{effectType:m(this.effectType)}}clone(){return new n}isSame(e){return this===e?!0:e.effectType===this.effectType}toLegacyOrderHook(){return Ln.create(Ze.CreateOpenTicketPass)}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="3137904db8b44ae59c45eae76caeacae",n})(),yp=class extends f{build(i,e){return Zw.fromMap(i,e)}},Xw=(()=>{class n extends Vt{constructor(){super(),this.effectType=sn.CreateOpenAccessPass}get $typeId(){return n.TYPE_ID}static create(){return new n}static fromMap(e,t){return new n}toMap(e){return{effectType:m(this.effectType)}}clone(){return new n}isSame(e){return this===e?!0:e.effectType===this.effectType}toLegacyOrderHook(){return Ln.create(Ze.CreateOpenAccessPass)}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="247f14fd3af04ecda0acd3ad59581a46",n})(),bp=class extends f{build(i,e){return Xw.fromMap(i,e)}},Ze=(function(n){return n.DeferOrderCompletion="defer-order-completion",n.SendOnlyPaymentConfirmation="send-only-payment-confirmation",n.CreateGiftCard="create-gift-card",n.CreateOpenTicketPass="create-open-ticket-pass",n.CreateOpenAccessPass="create-open-access-pass",n.CreateOpenAccessPassFromTicket="create-open-access-pass-from-ticket",n.RedirectAfterPayment="redirect-after-payment",n.SendProductOrderConfirmationEmail="send-product-order-confirmation-email",n.CreateOpenAccessPassPlaceholder="create-open-access-pass-placeholder",n})(Ze||{}),Ln=(()=>{class n extends b{constructor(e,t){super(),this.uniqueId=e,this.fields=t}get $typeId(){return n.TYPE_ID}static create(e,t){return new n(e,t??{})}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.get(t,"fields"))}toMap(e){return{uniqueId:this.uniqueId,fields:this.fields}}clone(){return new n(this.uniqueId,this.fields)}isSame(e){return this===e?!0:this.uniqueId===e.uniqueId&&this.fields===e.fields}setString(e,t){this.fields[e]=t}setDouble(e,t){this.fields[e]=t}setBoolean(e,t){this.fields[e]=t}getStringOrNull(e){return r.getOrNull(this.fields,e)}getString(e){let t=r.getOrNull(this.fields,e);if(t==null)throw new ie(`Missing or null field with key {${e}} in hook: ${JSON.stringify(this.fields)}`);return t}getDoubleOrNull(e){return r.getOrNull(this.fields,e)}getBooleanOrNull(e){return r.getOrNull(this.fields,e)}getBoolean(e){let t=r.getOrNull(this.fields,e);if(t==null)throw new ie(`Missing or null field with key {${e}} in hook: ${JSON.stringify(this.fields)}`);return t}
2toSideEffect(){switch(this.uniqueId){case Ze.DeferOrderCompletion:return Gw.create();case Ze.SendOnlyPaymentConfirmation:return Ww.create();case Ze.CreateGiftCard:return Kw.create();case Ze.CreateOpenTicketPass:return Zw.create();case Ze.CreateOpenAccessPass:return Xw.create();case Ze.CreateOpenAccessPassFromTicket:return jw.create();case Ze.RedirectAfterPayment:return Jw.create({webRoute:this.getString("webRoute"),isEvent:this.getBoolean("isEvent")});case Ze.CreateOpenAccessPassPlaceholder:return null;case Ze.SendProductOrderConfirmationEmail:{let e=this.getStringOrNull("eventId");return e!=null?ho.create({eventId:e,emailTemplateId:e}):ho.default({eventId:e})}}throw new ie(`Cannot convert legacy order hook of type {${this.uniqueId}} to order side effect.`)}}return n.TYPE_ID="adf17d290a074e3686ff69917664c86b",n})(),Ep=class extends f{build(i,e){return Ln.fromMap(i,e)}},Bx="default",ho=(()=>{class n extends Vt{constructor(e,t){super(),this.eventId=e,this.emailTemplateId=t,this.effectType=sn.SendProductOrderConfirmationEmail}get $typeId(){return n.TYPE_ID}static default({eventId:e}){return new n(e,Bx)}static create({eventId:e,emailTemplateId:t}){return new n(e,t)}static fromMap(e,t){return new n(r.getStringOrNull(t,"eventId"),r.getString(t,"emailTemplateId"))}toMap(e){return{effectType:m(this.effectType),eventId:this.eventId,emailTemplateId:this.emailTemplateId}}clone(){return new n(this.eventId,this.emailTemplateId)}isSame(e){return this===e?!0:e.effectType===this.effectType&&e.eventId===this.eventId&&e.emailTemplateId===this.emailTemplateId}toLegacyOrderHook(){return Ln.create(Ze.SendProductOrderConfirmationEmail,{eventId:this.eventId})}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="185a29fcfb2d442fbedbf50bc1af59f3",n})(),wp=class extends f{build(i,e){return ho.fromMap(i,e)}},On=(function(n){return n.Open="OPEN",n.Aborted="ABORTED",n.Canceled="CANCELED",n.Refunded="REFUNDED",n})(On||{}),ot=(()=>{class n extends zt(b){constructor(e,t,s,a,o,u,c,l,h,p,I,v,E,w,S,R,x,N,O,A,M,C,H,B){super(),this.uniqueId=e,this.creatorId=t,this.eventId=s,this.bookingStrategy=a,this.source=o,this.businessRef=u,this.creationDate=c,this.customer=l,this.contactDetails=h,this.status=p,this.items=I,this.paymentType=v,this.paymentMethod=E,this.onlinePaymentDetails=w,this.offlinePaymentDetails=S,this.components=R,this.sideEffects=x,this.isGuestOrder=N,this.cancelledDate=O,this.cancelledBy=A,this.refunds=M,this.donation=C,this.applicationFee=H,this.applicationFeeVat=B,this.isLegacyOrder=!0,this.userId=l.userId,this.customerId=l.uniqueId,this.language=l.language,this.country=h.country,this.timezone=h.timezone}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(11,n.SCHEMA_VERSION)}get isOpen(){return this.status===On.Open}get isCanceled(){return this.status===On.Canceled}static create(e){return new n(e.uniqueId,e.creatorId,e.eventId,e.bookingStrategy,e.source,e.businessRef,e.creationDate,e.customer,e.contactDetails,e.status,e.items,e.paymentType,e.paymentMethod,e.onlinePaymentDetails,e.offlinePaymentDetails,e.components,e.sideEffects,e.isGuestOrder,e.cancelledDate,e.cancelledBy,e.refunds,e.donation,e.applicationFee,e.applicationFeeVat)}static fromMap(e,t){return this.create({uniqueId:r.getString(t,"uniqueId"),creatorId:r.getString(t,"creatorId"),eventId:r.getStringOrNull(t,"eventId"),bookingStrategy:Re(r.getStringOrNull(t,"bookingStrategy"),yt),source:y(r.getString(t,"source"),Xe),businessRef:j.mustDecode(r.getString(t,"businessRef")),creationDate:e.decodeDate(r.getNumber(t,"creationDate")),customer:e.fromData(r.getRecord(t,"customer")),contactDetails:e.fromData(r.getRecord(t,"contactDetails")),status:y(r.getString(t,"$status"),On),items:r.getList(t,"items",s=>e.fromData(K.decodeRecord(s))),paymentType:y(r.getString(t,"paymentType"),pe),paymentMethod:y(r.getString(t,"paymentMethod"),Fe),onlinePaymentDetails:e.fromDataOrNull(r.getRecordOrNull(t,"onlinePaymentDetails")),offlinePaymentDetails:e.fromDataOrNull(r.getRecordOrNull(t,"offlinePaymentDetails")),components:ae.deserialize(e,r.getList(t,"components",s=>K.decodeRecord(s))),sideEffects:r.getList(t,"sideEffects",s=>e.fromData(K.decodeRecord(s))),isGuestOrder:r.getBoolean(t,"isGuestOrder"),cancelledDate:e.decodeDateOrNull(r.getNumberOrNull(t,"cancelledDate")),cancelledBy:r.getStringOrNull(t,"cancelledBy"),refunds:r.getList(t,"refunds",s=>e.fromData(K.decodeRecord(s))),donation:Y.decodeOrNull(r.getStringOrNull(t,"donation")),applicationFee:Y.decodeOrNull(r.getStringOrNull(t,"applicationFee")),applicationFeeVat:Re(r.getStringOrNull(t,"applicationFeeVat"),te)})}toMap(e){var t,s,a,o;return{uniqueId:this.uniqueId,creatorId:this.creatorId,eventId:this.eventId,bookingStrategy:Se(this.bookingStrategy),source:m(this.source),customerId:this.customerId,userId:this.userId,businessRef:this.businessRef.encode(),creationDate:e.encodeDate(this.creationDate),
2contactDetails:e.toData(this.contactDetails),customer:e.toData(this.customer),items:this.items.map(u=>e.toData(u)),components:this.components.serialize(e),paymentType:m(this.paymentType),paymentMethod:m(this.paymentMethod),onlinePaymentDetails:e.toDataOrNull(this.onlinePaymentDetails),offlinePaymentDetails:e.toDataOrNull(this.offlinePaymentDetails),$status:this.status,sideEffects:this.sideEffects.map(u=>e.toData(u)),isGuestOrder:this.isGuestOrder,cancelledDate:e.encodeDateOrNull(this.cancelledDate),cancelledBy:this.cancelledBy,donation:(s=(t=this.donation)===null||t===void 0?void 0:t.encode())!==null&&s!==void 0?s:null,applicationFee:(o=(a=this.applicationFee)===null||a===void 0?void 0:a.encode())!==null&&o!==void 0?o:null,applicationFeeVat:Se(this.applicationFeeVat),refunds:this.refunds.map(u=>e.toData(u))}}clone(){return this.copyWith()}copyWith({uniqueId:e=this.uniqueId,creatorId:t=this.creatorId,eventId:s=this.eventId,bookingStrategy:a=this.bookingStrategy,source:o=this.source,businessRef:u=F(this.businessRef),creationDate:c=g.cloneDate(this.creationDate),customer:l=F(this.customer),contactDetails:h=F(this.contactDetails),status:p=this.status,items:I=ue(this.items),paymentType:v=this.paymentType,paymentMethod:E=this.paymentMethod,onlinePaymentDetails:w=Z(this.onlinePaymentDetails),offlinePaymentDetails:S=Z(this.offlinePaymentDetails),components:R=F(this.components),sideEffects:x=ue(this.sideEffects),isGuestOrder:N=this.isGuestOrder,cancelledDate:O=g.cloneDateOrNull(this.cancelledDate),cancelledBy:A=this.cancelledBy,refunds:M=ue(this.refunds),donation:C=Z(this.donation),applicationFee:H=Z(this.applicationFee),applicationFeeVat:B=this.applicationFeeVat}={}){return n.create({uniqueId:e,creatorId:t,eventId:s,bookingStrategy:a,source:o,businessRef:u,creationDate:c,customer:l,contactDetails:h,status:p,items:I,paymentType:v,paymentMethod:E,onlinePaymentDetails:w,offlinePaymentDetails:S,components:R,sideEffects:x,isGuestOrder:N,cancelledDate:O,cancelledBy:A,refunds:M,donation:C,applicationFee:H,applicationFeeVat:B})}copyAsAborted(){return this.copyWith({status:On.Aborted})}copyAsCanceled(e,t,s){var a,o;return this.copyWith({status:s?On.Refunded:On.Canceled,cancelledDate:(a=g.cloneDateOrNull(this.cancelledDate))!==null&&a!==void 0?a:t,cancelledBy:(o=this.cancelledBy)!==null&&o!==void 0?o:e})}copyWithPaymentDetails(e){return this.copyWith({onlinePaymentDetails:e})}copyWithOfflinePaymentDetails(e){return this.copyWith({offlinePaymentDetails:e})}copyWithReceipt(e){var t,s;return((s=(t=this.offlinePaymentDetails)===null||t===void 0?void 0:t.copyWithNewReceipt(e))!==null&&s!==void 0?s:$d.ofReceipt(e)).map(o=>this.copyWithOfflinePaymentDetails(o))}copyWithCancelledReceipt(e){if(this.offlinePaymentDetails==null)return W.error("Order has no receipt to cancel.");let t=this.offlinePaymentDetails.copyWithCurrentReceiptCancelledOrClone(e),s=this.copyWithOfflinePaymentDetails(t);return W.ok(s)}copyWithPaymentStatus(e){var t;return this.copyWith({onlinePaymentDetails:(t=this.onlinePaymentDetails)===null||t===void 0?void 0:t.copyWith({status:e})})}copyWithPaymentMethod(e){return this.copyWith({paymentMethod:e})}copyWithBusinessRef(e){return this.copyWith({businessRef:F(e),customer:this.customer.copyWithBusinessRef(e),items:this.items.map(t=>t.copyWithBusinessRef(e)),components:this.components.copyWithBusinessRef(e)})}assignToCustomerAccount(e){return this.copyWith({creatorId:e.uniqueId,customer:this.customer.assignToCustomerAccount(e)})}isSame(e){return this===e?!0:d(e.customer,this.customer)&&d(e.contactDetails,this.contactDetails)&&d(e.onlinePaymentDetails,this.onlinePaymentDetails)&&P(e.items,this.items,d)&&P(e.sideEffects,this.sideEffects,d)&&e.components.isSame(this.components)&&e.uniqueId===this.uniqueId&&e.creatorId===this.creatorId&&e.eventId===this.eventId&&e.bookingStrategy===this.bookingStrategy&&e.source===this.source&&e.cancelledDate===this.cancelledDate&&e.cancelledBy===this.cancelledBy&&d(e.donation,this.donation)&&d(e.applicationFee,this.applicationFee)&&d(e.businessRef,this.businessRef)&&e.creationDate===this.creationDate&&e.status===this.status&&e.paymentMethod===this.paymentMethod&&e.paymentType===this.paymentType&&e.isGuestOrder===this.isGuestOrder&&e.applicationFeeVat==this.applicationFeeVat&&P(e.refunds,this.refunds,d)}tryGetCustomer(){return this.customer}findSideEffect(e){for(let t=0;t<this.sideEffects.length;t++)if(this.sideEffects[t].effectType===e)return this.sideEffects[t];return null}hasSideEffect(e){return this.findSideEffect(e)!=null}static encodedStatusSafe(e){return m(e)}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="a3f4d7358b454d9d8f6469caecf46163",n.SCHEMA_VERSION=13,n})(),Sp=class extends f{build(i,e){return ot.fromMap(i,e)}optimizeForQuery(i,e){var t,s;let a=null;return e.paymentType===pe.Online?a=(s=(t=e.onlinePaymentDetails)===null||t===void 0?void 0:t.status)!==null&&s!==void 0?s:null:a=qt.Succeeded,{paymentStatus:Se(a),paymentType:m(e.paymentType),paymentMethod:m(e.paymentMethod),containsEventProducts:e.bookingStrategy===yt.TicketsAndProducts}}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(this.migrateEnum(e,"paymentType",pe,pe.OnDelivery),this.migrateEnum(e,"paymentMethod",Fe,Fe.Cash),this.migrateEnum(e,"$status",On,On.Open),t.contains(ot.SCHEMA_VERSION))return e;
2if(t.isGreaterThan(ot.SCHEMA_VERSION))return null;let s=t.to;if(s<2&&(e.onCompleteHooks=[],s=2),s<3){s=3;let a=y(r.get(e,"paymentType"),pe);e.paymentMethod=m(Yd(a))}if(s<4&&(e.isGuestOrder=!1,s=4),s<5&&(s=5),s<6&&(s=6),s<7&&(s=7),s<8&&(s=8),s<9){let a=i.fromDataOrNull(r.getRecordOrNull(e,"onlinePaymentDetails"));r.setIfNullOrUndefined(e,"source",m(a==null?Xe.Admin:Xe.Client)),s=9}if(s<10&&(s=10),s<11){let o=r.getList(e,"onCompleteHooks",u=>i.fromData(K.decodeRecord(u))).map(u=>u.toSideEffect()).filter(_);e.sideEffects=o.map(u=>i.toData(u)),s=11}if(s<12){let a=y(r.getString(e,"source"),Xe),o=null,u=null;if(a===Xe.Client){let c=r.getList(e,"sideEffects",l=>i.fromData(K.decodeRecord(l)));for(let l of c)if(ho.assertType(l)){o=l.eventId;break}u=o!=null?yt.Vouchers:null}e.eventId=o,e.bookingStrategy=Se(u),s=12}return s<13&&(s=13),e.$schema_version=D.encodedExactly(s),e}},Nt=(function(n){return n.PricePerService="PricePerService",n.PricePerGram="PricePerGram",n.PricePerCm="PricePerCm",n.PricePerMinute="PricePerMinute",n.PricePerFinger="PricePerFinger",n.PricePerHour="PricePerHour",n.PricePerHourPerPerson="PricePerHourPerPerson",n.PricePerLiter="PricePerLiter",n.PricePerDeciliter="PricePerDeciliter",n.PricePerHeadlight="PricePerHeadlight",n})(Nt||{}),bs=(()=>{class n extends G{constructor(e,t){super(),this.groups=e,this.priceType=t}get $typeId(){return n.TYPE_ID}get $removable(){return!1}static empty(e){return new n([],e??Nt.PricePerService)}static fromMap(e,t){return new n(r.getList(t,"groups",s=>e.fromData(s)),r.get(t,"priceType"))}toMap(e){return{groups:this.groups.map(t=>e.toData(t)),priceType:this.priceType}}clone(){return new n(ue(this.groups),this.priceType)}isSame(e){return e===this?!0:P(e.groups,this.groups,(t,s)=>d(t,s))&&e.priceType===this.priceType}}return n.TYPE_ID="6ae8dfadf66044e186d090ca570c05f3",n})(),Tp=class extends f{build(i,e){return bs.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){return this.migrateEnum(e,"priceType",Nt,Nt.PricePerService),e}},Po=(()=>{class n extends b{constructor(e,t){super(),this.from=e,this.to=t}get isExact(){return this.from.asMilliseconds()===this.to.asMilliseconds()}get $typeId(){return n.TYPE_ID}static between(e,t){return new n(e,t)}static exactly(e){return new n(e,e)}static fromMap(e,t){return new n(e.decodeDuration(r.get(t,"from")),e.decodeDuration(r.get(t,"to")))}toMap(e){return{from:e.encodeDuration(this.from),to:e.encodeDuration(this.to)}}clone(){return new n(g.cloneDuration(this.from),g.cloneDuration(this.to))}isSame(e){return this===e?!0:e.from===this.from&&e.to===this.to}}return n.TYPE_ID="ef08016bc4664d4fb9cdc791b61c4328",n})(),Op=class extends f{build(i,e){return Po.fromMap(i,e)}},Vn=(()=>{class n extends b{constructor(e,t){super(),this.from=e,this.to=t}get isExact(){return this.from.value===this.to.value}get $typeId(){return n.TYPE_ID}static between(e,t){return new n(e,t)}static exactly(e){return new n(e,e)}static free(e){return n.exactly(Y.zero(e))}static zero(e){return n.exactly(Y.zero(e))}static fromMap(e,t){return new n(Y.decode(r.get(t,"from")),Y.decode(r.get(t,"to")))}toMap(e){return{from:this.from.encode(),to:this.to.encode()}}clone(){return new n(this.from.clone(),this.to.clone())}isSame(e){return this===e?!0:e.from===this.from&&e.to===this.to}copyWith(e,t){return new n(e??this.from.clone(),t??this.to.clone())}add(e){return new n(this.from.add(e.from),this.to.add(e.to))}subtract(e){return new n(this.from.add(e.from.negative()),this.to.add(e.to.negative()))}scale(e){return new n(this.from.scale(e),this.to.scale(e))}equals(e){return this.from.currency===e.from.currency&&this.from.value===e.from.value&&this.to.currency===e.to.currency&&this.to.value===e.to.value}toNonNegative(){this.from.isNegative()&&(this.from=Y.zero(this.from.currency)),this.to.isNegative()&&(this.to=Y.zero(this.to.currency))}}return n.TYPE_ID="4a74e5cd06e740aaa7a89452eb2c70e9",n})(),Rp=class extends f{build(i,e){return Vn.fromMap(i,e)}},gr=(()=>{class n extends b{constructor(e,t,s,a,o,u,c){super(),this.names=e,this.descriptions=t,this.isPricePublic=s,this.priceType=a,this.priceRanges=o,this.durationRange=u,this.selected=c}get maxDuration(){return this.durationRange.to}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}static fromMap(e,t){return new n(e.fromData(r.getRaw(t,"names")),e.fromData(r.getRaw(t,"descriptions")),r.get(t,"isPricePublic"),y(r.get(t,"priceType"),Nt),r.getMap(t,"priceRanges",(s,a)=>({key:s,value:e.fromData(a)})),e.fromData(r.getRaw(t,"durationRange")),r.get(t,"selected"))}toMap(e){return{names:e.toData(this.names),descriptions:e.toData(this.descriptions),isPricePublic:this.isPricePublic,priceType:m(this.priceType),priceRanges:se(this.priceRanges,(t,s)=>({key:t.toString(),value:e.toData(s)})),durationRange:_R(this.durationRange),selected:this.selected}}clone(){return new n(this.names.clone(),this.descriptions.clone(),this.isPricePublic,this.priceType,ee(this.priceRanges),this.durationRange.clone(),this.selected)}isSame(e){return this===e?!0:d(e.names,this.names)&&d(e.descriptions,this.descriptions)&&e.isPricePublic==this.isPricePublic&&e.priceType==this.priceType&&re(e.priceRanges,this.priceRanges,d)&&e.durationRange.isSame(this.durationRange)&&e.selected==this.selected}}return n.TYPE_ID="cb74e641f64a49d3b096eba21e772c89",n.SCHEMA_VERSION=6,n})(),Mp=class extends f{build(i,e){return gr.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){var t;let s=r.getVersionRange(e);if(this.migrateEnum(e,"priceType",Nt,Nt.PricePerService),s.contains(gr.
2SCHEMA_VERSION))return e;if(s.isGreaterThan(gr.SCHEMA_VERSION))return null;let a=s.to;if(a<2&&(r.set(e,"isPricePublic",!0),a=2),a<3){let u=r.getMap(e,"prices",(h,p)=>({key:h,value:Y.decode(p)})),c=Vw(u,(h,p)=>({key:h,value:Vn.exactly(p)})),l=se(c,(h,p)=>({key:h.toString(),value:i.toData(p)}));r.set(e,"priceRanges",l),a=3}if(a<4){let u=i.decodeDuration(r.get(e,"duration"));r.set(e,"durationRange",i.toData(Po.exactly(u))),a=4}let o=y(r.get(e,"priceType"),Nt);if((a<5||!o)&&(r.set(e,"priceType",Nt.PricePerService),a=5),a<6){let u=r.get(e,"name"),c=r.get(e,"description"),l=(t=i.storage.get("language",$.English))!==null&&t!==void 0?t:$.English,h=Oe.forLanguage(l,u),p=Oe.forLanguage(l,c);r.set(e,"names",i.toData(h)),r.set(e,"descriptions",i.toData(p)),a=6}return e.$schema_version=D.encodedExactly(a),e}},Jt=(()=>{class n extends G{constructor(e,t,s,a){super(),this.names=e,this.isRequired=t,this.isSingleSelect=s,this.modifiers=a}get isOptional(){return!this.isRequired}get isMultiSelect(){return!this.isSingleSelect}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}get $removable(){return!1}static fromMap(e,t){return new n(e.fromData(r.getRaw(t,"names")),r.get(t,"isRequired"),r.get(t,"isSingleSelect"),r.getList(t,"modifiers",s=>e.fromData(s)))}toMap(e){return{names:e.toData(this.names),isRequired:this.isRequired,isSingleSelect:this.isSingleSelect,modifiers:this.modifiers.map(t=>e.toData(t))}}clone(){return new n(this.names.clone(),this.isRequired,this.isSingleSelect,this.modifiers.map(e=>e.clone()))}isSame(e){return this===e?!0:d(e.names,this.names)&&e.isRequired===this.isRequired&&e.isSingleSelect===this.isSingleSelect&&P(e.modifiers,this.modifiers,d)}}return n.TYPE_ID="4179c91733004ed19e6dd5ca5d7d7fff",n.SCHEMA_VERSION=2,n})(),Np=class extends f{build(i,e){return Jt.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){var t;let s=r.getVersionRange(e);if(s.contains(gr.SCHEMA_VERSION))return e;if(s.isGreaterThan(gr.SCHEMA_VERSION))return null;let a=s.to;if(a<2){let o=r.getOrNull(e,"name");if(_(o)){let u=(t=i.storage.get("language",$.English))!==null&&t!==void 0?t:$.English;r.setIfNullOrUndefined(e,"names",i.toData(Oe.forLanguage(u,o)))}a=2}return e.$schema_version=D.encodedExactly(a),e}},Ot=(()=>{class n extends G{constructor(e,t){super(),this.priceRanges=e,this.priceType=t}get $removable(){return!1}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(2,n.SCHEMA_VERSION)}static fromPrices(e){let t=Vw(e,(s,a)=>({key:s,value:Vn.exactly(a)}));return new n(t,Nt.PricePerService)}static fromMap(e,t){return new n(r.getMap(t,"priceRanges",(s,a)=>({key:s,value:e.fromData(a)})),y(r.get(t,"priceType"),Nt))}toMap(e){return{priceRanges:se(this.priceRanges,(t,s)=>({key:t.toString(),value:e.toData(s)})),priceType:m(this.priceType)}}clone(){return new n(ee(this.priceRanges),this.priceType)}isSame(e){return this===e?!0:re(e.priceRanges,this.priceRanges,d)&&e.priceType===this.priceType}}return n.TYPE_ID="dfaa11194f284685ae94cb168b4375f7",n.SCHEMA_VERSION=3,n})(),Pp=class extends f{build(i,e){return Ot.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(this.migrateEnum(e,"priceType",Nt,Nt.PricePerService),t.contains(Ot.SCHEMA_VERSION))return e;if(t.isGreaterThan(Ot.SCHEMA_VERSION))return null;let s=t.to;if(s<2){let o=r.getMap(e,"prices",(c,l)=>({key:c,value:Y.decode(l)})),u=Vw(o,(c,l)=>
2({key:c,value:Vn.exactly(l)}));r.set(e,"priceRanges",se(u,(c,l)=>({key:c.toString(),value:i.toData(l)}))),s=2}let a=r.get(e,"priceType");return(s<3||!a)&&r.set(e,"priceType",Nt.PricePerService),e.$schema_version=D.encodedExactly(s),e}},Gl=class{},fo=class n extends Gl{constructor(i,e,t,s,a,o){super(),this.orderTypeId=i,this.itemPrice=e,this.donationPrice=t,this.standardFeePrice=s,this.totalFeePrice=a,this.totalPrice=o}static product(i){return new n(ot.TYPE_ID,i.itemPrice,i.donationPrice,i.standardFeePrice,i.totalFeePrice,i.totalPrice)}static pass(i){return new n(at.TYPE_ID,i.itemPrice,i.donationPrice,i.standardFeePrice,i.totalFeePrice,i.totalPrice)}static calendar(i){return new n(rt.TYPE_ID,i.itemPrice,i.donationPrice,i.standardFeePrice,i.totalFeePrice,i.totalPrice)}static verifyType(i){return i instanceof n}static assertType(i){return i instanceof n}},Ap=class n extends Gl{constructor(i,e,t,s,a,o,u,c){super(),this.itemPrice=i,this.productPrice=e,this.supplementPrice=t,this.donationPrice=s,this.standardFeePrice=a,this.productFeePrice=o,this.totalFeePrice=u,this.totalPrice=c,this.orderTypeId=je.TYPE_ID}static create(i){return new n(i.itemPrice,i.productPrice,i.supplementPrice,i.donationPrice,i.standardFeePrice,i.productFeePrice,i.totalFeePrice,i.totalPrice)}static verifyType(i){return i instanceof n}static assertType(i){return i instanceof n}},Es=class{},Cp=class n extends Es{constructor(){super(...arguments),this.orderTypeId=rt.TYPE_ID}static verifyType(i){return i instanceof n}static assertType(i){return i instanceof n}getCurrencyOfOrder(i){if(!rt.assertType(i))throw new X("order","Order type is not valid");return i.services.length>0?i.services[0].service.getPrice().from.currency:null}calculateDiscountForOnlineOrder(i){if(!rt.assertType(i))throw new X("order","Order type is not valid");return null}calculateCheckoutPriceBreakdownForOnlineOrder(i){if(!rt.assertType(i))throw new X("order","Order type is not valid");let e=this.calculatePriceForOnlineCalendarOrder(i);return e==null?null:fo.calendar({donationPrice:null,itemPrice:e,standardFeePrice:null,totalFeePrice:null,totalPrice:e.clone()})}calculateDiscountBreakdownForOrder(i){if(!rt.assertType(i))throw new X("order","Order type is not valid");return null}calculateFeeBreakdownForOrder(i){if(!rt.assertType(i))throw new X("order","Order type is not valid");return null}calculateCheckoutPriceForOrder(i){if(!rt.assertType(i))throw new X("order","Order type is not valid");let e=this.getCurrencyOfOrder(i);if(k(e))return null;let t=Y.zero(e);for(let s of i.services){let a=this.calculatePriceForCalendarOrderItem(s);if(k(a)||a.currency!==e)return null;t=t.add(a)}return t}calculateCheckoutPriceForDiscountProvider(i){if(!rt.assertType(i))throw new X("order","Order type is not valid");return this.calculatePriceForOnlineCalendarOrder(i)}calculateIncomeForOrder(i){if(!rt.assertType(i))throw new X("order","Order type is not valid");return this.calculatePriceForOnlineCalendarOrder(i)}calculateIncomeWithoutDiscountForOrder(i){if(!rt.assertType(i))throw new X("order","Order type is not valid");return this.calculatePriceForOnlineCalendarOrder(i)}canCreateRefundForOnlineOrder(i){if(!rt.assertType(i))throw new X("order","Order type is not valid");return null}calculateExistingRefundForOrder(i){if(!rt.assertType(i))throw new X("order","Order type is not valid");return null}calculateRemainingRefundForOrder(i){if(!rt.assertType(i))throw new X("order","Order type is not valid");return null}calculateMaxRefundForOnlineOrder(i){if(!rt.assertType(i))throw new X("order","Order type is not valid");return null}calculatePriceForOnlineCalendarOrder(i){let e=this.getCurrencyOfOrder(i);if(k(e))return null;let t=Y.zero(e);for(let s of i.services){let a=this.calculatePriceForCalendarOrderItem(s);if(k(a)||a.currency!==e)return null;t=t.add(a)}return t}calculatePriceForCalendarOrderItem(i){let e=i.service.currency,t=Y.zero(e),s=Y.zero(e),a=i.service.components.findComponentByTypeId(Ot.TYPE_ID);if(_(a)){let c=a.priceRanges.get(e);if(k(c))return null;t=t.add(c.from),s=s.add(c.to)}let o=i.service.components.findComponentByTypeId(bs.TYPE_ID);if(_(o))for(let c of o.groups){let l=c.priceRanges.get(e);if(k(l))return null;let h=l.scale(c.groupSize);t=t.add(h.from),s=s.add(h.to)}let u=i.service.components.findComponentsByTypeId(Jt.TYPE_ID);for(let c of u)for(let l of c.modifiers)if(l.selected){let h=l.priceRanges.get(e);if(k(h))return null;t=t.add(h.from),s=s.add(h.to)}return t.value===s.value?s:null}},$R=(()=>{class n extends G{constructor(e,t=null,s=null){super(),this.locations=e,this.mapPreview=t,this.mapUrl=s}get hasMapPreview(){return _(this.mapPreview)}get $removable(){return!1}get $typeId(){return n.TYPE_ID}static empty(){return new n([])}static fromMap(e,t){return new n(r.getList(t,"locations",s=>e.fromData(s)),e.fromDataOrNull(r.getOrNull(t,"mapPreview")),r.getOrNull(t,"mapUrl"))}toMap(e){return{locations:this.locations.map(t=>e.toData(t)),mapPreview:e.toDataOrNull(this.mapPreview),mapUrl:this.mapUrl}}clone(){return new n(ue(this.locations),Z(this.mapPreview),this.mapUrl)}isSame(e){return e===this?!0:P(e.locations,this.locations,(t,s)=>d(t,s))&&d(e.mapPreview,this.mapPreview)&&e.mapUrl===this.mapUrl}}return n.TYPE_ID="183e2c4561cd4b83990cfc56b061035e",n})(),kp=class extends f{build(i,e){return $R.fromMap(i,e)}},Qw=(()=>{class n extends G{constructor(e){super(),this.coverImages=e}get $typeId(){return n.TYPE_ID}get $removable(){return!1}static empty(){return new n(new Map)}static fromMap(e,t){return new n(r.getMap(t,"coverImages",(s,a)=>({key:y(s,$),value:e.fromData(a)})))}toMap(e){return{coverImages:se(this.coverImages,(t,s)=>({key:y(t,$),value:e.toData(s)}))}}
2clone(){return new n(ee(this.coverImages,e=>e.clone()))}isSame(e){return this===e?!0:re(e.coverImages,this.coverImages,(t,s)=>d(t,s))}}return n.TYPE_ID="dd0fcaf086124bbfa888fb11b1c88531",n})(),_p=class extends f{build(i,e){return Qw.fromMap(i,e)}},LR=(()=>{class n extends G{constructor(e){super(),this.settings=e}get $typeId(){return n.TYPE_ID}get $removable(){return!1}static fromMap(e,t){return new n(e.fromData(r.getRaw(t,"settings")))}toMap(e){return{settings:e.toData(this.settings)}}clone(){return new n(this.settings.clone())}isSame(e){return this===e?!0:d(e.settings,this.settings)}}return n.TYPE_ID="a5f8d5fded504966992d2227da66577f",n})(),xp=class extends f{build(i,e){return LR.fromMap(i,e)}},Fn=(function(n){return n.Accommodation="Accommodation",n.Accountant="Accountant",n.Acupuncture="Acupuncture",n.Adventure="Adventure",n.AdventurePark="AdventurePark",n.AdvertisingAgency="AdvertisingAgency",n.Airport="Airport",n.ATM="ATM",n.Attorney="Attorney",n.Attractions="Attractions",n.Bakery="Bakery",n.Bank="Bank",n.Bar="Bar",n.Barbershop="Barbershop",n.BearWatching="BearWatching",n.BeautyIndustry="BeautyIndustry",n.BeautySalon="BeautySalon",n.Beekeeping="Beekeeping",n.Bistro="Bistro",n.Butcher="Butcher",n.Cafe="Cafe",n.CarInspection="CarInspection",n.CarParts="CarParts",n.CarpetCleaning="CarpetCleaning",n.CarPolishing="CarPolishing",n.CarRepair="CarRepair",n.CarWash="CarWash",n.Castle="Castle",n.CaveVisit="CaveVisit",n.Chiropractor="Chiropractor",n.Church="Church",n.Cinema="Cinema",n.Climbing="Climbing",n.Clinic="Clinic",n.ClothingStore="ClothingStore",n.ClothingStoreAndFurrier="ClothingStoreAndFurrier",n.CompanyPrograms="CompanyPrograms",n.Concert="Concert",n.Construction="Construction",n.ConstructionAndInteriorDesign="ConstructionAndInteriorDesign",n.Cosmetics="Cosmetics",n.CruiseProgrammes="CruiseProgrammes",n.Cruising="Cruising",n.Culture="Culture",n.Cycling="Cycling",n.DailyMenu="DailyMenu",n.DairyProduct="DairyProduct",n.Dentist="Dentist",n.Dietitian="Dietitian",n.DIYStore="DIYStore",n.DrivingSchool="DrivingSchool",n.ElectricDeviceRepair="ElectricDeviceRepair",n.ElectronicsShop="ElectronicsShop",n.Entertainment="Entertainment",n.ExperienceConcert="ExperienceConcert",n.EyebrowsAndLashes="EyebrowsAndLashes",n.Fair="Fair",n.Farm="Farm",n.FarmStore="FarmStore",n.FastFood="FastFood",n.Festival="Festival",n.FishingShop="FishingShop",n.Fitness="Fitness",n.Florist="Florist",n.Football="Football",n.ForRent="ForRent",n.Furniture="Furniture",n.Gardening="Gardening",n.GasAndEnergy="GasAndEnergy",n.GiftShop="GiftShop",n.Greengrocer="Greengrocer",n.Grocery="Grocery",n.GuidedTour="GuidedTour",n.Gym="Gym",n.GymAndFitness="GymAndFitness",n.HairMedicine="HairMedicine",n.HandcraftedProducts="HandcraftedProducts",n.Healthcare="Healthcare",n.Hike="Hike",n.HikingShop="HikingShop",n.Hockey="Hockey",n.HomeDecoration="HomeDecoration",n.HorseRiding="HorseRiding",n.Hotel="Hotel",n.IceCream="IceCream",n.InteriorDesign="InteriorDesign",n.KidsFriendly="KidsFriendly",n.Kinetotherapist="Kinetotherapist",n.Leisure="Leisure",n.LocalEvents="LocalEvents",n.LocalNewsAndEvents="LocalNewsAndEvents",n.LocalProducers="LocalProducers",n.LocalSportEvents="LocalSportEvents",n.LocalTreasures="LocalTreasures",n.MakeupArtist="MakeupArtist",n.MakeupTattoo="MakeupTattoo",n.ManicureAndPedicure="ManicureAndPedicure",n.Marketplace="Marketplace",n.Massage="Massage",n.MedicalServices="MedicalServices",n.MensHaircut="MensHaircut",n.MetalShop="MetalShop",n.MoneyExchange="MoneyExchange",n.MountainBiking="MountainBiking",n.Museum="Museum",n.Music="Music",n.Musician="Musician",n.NailSalon="NailSalon",n.NatureHike="NatureHike",n.Naturopath="Naturopath",n.OffRoadTour="OffRoadTour",n.Ophthalmology="Ophthalmology",n.OralSurgeon="OralSurgeon",n.OrganicShop="OrganicShop",n.Orthopaedist="Orthopaedist",n.Paintball="Paintball",n.PaintShop="PaintShop",n.Party="Party",n.PastryShop="PastryShop",n.Performance="Performance",n.PersonalTrainer="PersonalTrainer",n.Pharmacy="Pharmacy",n.Photography="Photography",n.Physiotherapy="Physiotherapy",n.Piercing="Piercing",n.Pizza="Pizza",n.Podcasts="Podcasts",n.Pool="Pool",n.Print="Print",n.PrintingHouse="PrintingHouse",n.Production="Production",n.Psychologist="Psychologist",n.Pub="Pub",n.PublicAdm
2inistration="PublicAdministration",n.Restaurant="Restaurant",n.RestaurantsAndBars="RestaurantsAndBars",n.RockClimbing="RockClimbing",n.RomanticPrograms="RomanticPrograms",n.Running="Running",n.SecondHandShop="SecondHandShop",n.Sharpening="Sharpening",n.Shopping="Shopping",n.SolarPanels="SolarPanels",n.Spa="Spa",n.SpeechTherapist="SpeechTherapist",n.Sport="Sport",n.SportAndFitness="SportAndFitness",n.SportsShop="SportsShop",n.TanningStudio="TanningStudio",n.Tattoo="Tattoo",n.TattooRemoval="TattooRemoval",n.Taxi="Taxi",n.TeethWhitening="TeethWhitening",n.TheatricalPerformance="TheatricalPerformance",n.TherapyCenter="TherapyCenter",n.TobaccoShop="TobaccoShop",n.TouristInterest="TouristInterest",n.ToyShop="ToyShop",n.Tradition="Tradition",n.TraditionalStore="TraditionalStore",n.TyreService="TyreService",n.UpholsteryCleaning="UpholsteryCleaning",n.VehicleRepair="VehicleRepair",n.Veterinary="Veterinary",n.WaterSports="WaterSports",n.WaxingSalon="WaxingSalon",n.WeddingAndEvents="WeddingAndEvents",n.WeddingMakeupArtist="WeddingMakeupArtist",n.Wellness="Wellness",n.WhatToSee="WhatToSee",n.Winery="Winery",n.WomensHaircut="WomensHaircut",n.Workshop="Workshop",n.Zoo="Zoo",n.Other="Other",n})(Fn||{}),eS=(()=>{class n extends G{constructor(e){super(),this.classification=e}get $typeId(){return n.TYPE_ID}get $removable(){return!1}static fromMap(e,t){return new n(r.getList(t,"classification",s=>{var a;return(a=y(s,Fn))!==null&&a!==void 0?a:Fn.Other}))}toMap(e){return{classification:this.classification.map(t=>m(t))}}clone(){return new n(this.classification)}isSame(e){return this===e?!0:P(e.classification,this.classification)}}return n.TYPE_ID="d519d56ff6aa4c32bca9dc341a7aae68",n})(),Fp=class extends f{build(i,e){return eS.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){return this.migrateEnumList(e,"classification",Fn),e}},nr=(()=>{class n extends Be{constructor(e,t,s){super(),this.businessHours=e,this.renderOrder=t,this.isRenderingEnabled=s}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}get $removable(){return!1}static fromBusinessHours(e,t){return new n(e,n.DEFAULT_RENDER_ORDER,t)}static fromMap(e,t){return new n(e.fromData(r.getRaw(t,"businessHours")),r.get(t,"renderOrder"),r.get(t,"isRenderingEnabled"))}toMap(e){return{businessHours:e.toData(this.businessHours),renderOrder:this.renderOrder,isRenderingEnabled:this.isRenderingEnabled}}clone(){return new n(this.businessHours.clone(),this.renderOrder,this.isRenderingEnabled)}isSame(e){return this===e?!0:d(e.businessHours,this.businessHours)&&e.renderOrder===this.renderOrder&&e.isRenderingEnabled===this.isRenderingEnabled}}return n.TYPE_ID="fa15528bac2b41539a9b5738627f5f34",n.SCHEMA_VERSION=2,n.DEFAULT_RENDER_ORDER=4,n})(),qp=class extends f{build(i,e){return nr.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(nr.SCHEMA_VERSION))return e;if(t.isGreaterThan(nr.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(r.setIfNullOrUndefined(e,"renderOrder",nr.DEFAULT_RENDER_ORDER),r.setIfNullOrUndefined(e,"isRenderingEnabled",!0),s=2),e.$schema_version=D.encodedExactly(s),e}},kr=(()=>{class n extends b{constructor(e,t){super(),this.uniqueId=e,this.name=t}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.get(t,"name"))}static fromName(e){return new n(e.toLowerCase().replace(" ","_"),e)}toMap(e){return{uniqueId:this.uniqueId,name:this.name}}clone(){return new n(this.uniqueId,this.name)}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.name===this.name}}return n.TYPE_ID="dd0a8327277f4f1f99b34367f05a3cce",n})(),Yp=class extends f{build(i,e){return kr.fromMap(i,e)}},zd=(()=>{class n extends b{constructor(e,t,s,a,o,u,c,l,h,p,I,v,E,w,S,R,x,N,O){super(),this.country=e,this.administrativeAreaLevel1=t,this.administrativeAreaLevel2=s,this.administrativeAreaLevel3=a,this.administrativeAreaLevel4=o,this.administrativeAreaLevel5=u,this.locality=c,this.sublocalityLevel1=l,this.sublocalityLevel2=h,this.sublocalityLevel3=p,this.sublocalityLevel4=I,this.sublocalityLevel5=v,this.formattedAddress=E,this.street=w,this.streetNumber=S,this.building=R,this.floor=x,this.room=N,this.postalCode=O}get $typeId(){return n.TYPE_ID}static create(e){var t,s,a,o,u,c,l,h,p,I,v,E,w,S,R,x,N,O,A;return new n((t=e.country)!==null&&t!==void 0?t:null,(s=e.administrativeAreaLevel1)!==null&&s!==void 0?s:null,(a=e.administrativeAreaLevel2)!==null&&a!==void 0?a:null,(o=e.administrativeAreaLevel3)!==null&&o!==void 0?o:null,(u=e.administrativeAreaLevel4)!==null&&u!==void 0?u:null,(c=e.administrativeAreaLevel5)!==null&&c!==void 0?c:null,(l=e.locality)!==null&&l!==void 0?l:null,(h=e.sublocalityLevel1)!==null&&h!==void 0?h:null,(p=e.sublocalityLevel2)!==null&&p!==void 0?p:null,(I=e.sublocalityLevel3)!==null&&I!==void 0?I:null,(v=e.sublocalityLevel4)!==null&&v!==void 0?v:null,(E=e.sublocalityLevel5)!==null&&E!==void 0?E:null,(w=e.formattedAddress)!==null&&w!==void 0?w:null,(S=e.street)!==null&&S!==void 0?S:null,(R=e.streetNumber)!==null&&R!==void 0?R:null,(
2x=e.building)!==null&&x!==void 0?x:null,(N=e.floor)!==null&&N!==void 0?N:null,(O=e.room)!==null&&O!==void 0?O:null,(A=e.postalCode)!==null&&A!==void 0?A:null)}static ourOffice(){return n.create({country:"RO",administrativeAreaLevel1:new kr("ro_hr","Harghita"),locality:new kr("ro_hr_gheorgheni","Gheorgheni"),postalCode:"535500",formattedAddress:"Str Pompierilor 56/A"})}static fromMap(e,t){return new n(r.getOrNull(t,"country"),e.fromDataOrNull(r.getRaw(t,"administrativeAreaLevel1")),e.fromDataOrNull(r.getRaw(t,"administrativeAreaLevel2")),e.fromDataOrNull(r.getRaw(t,"administrativeAreaLevel3")),e.fromDataOrNull(r.getRaw(t,"administrativeAreaLevel4")),e.fromDataOrNull(r.getRaw(t,"administrativeAreaLevel5")),e.fromDataOrNull(r.getRaw(t,"locality")),e.fromDataOrNull(r.getRaw(t,"sublocalityLevel1")),e.fromDataOrNull(r.getRaw(t,"sublocalityLevel2")),e.fromDataOrNull(r.getRaw(t,"sublocalityLevel3")),e.fromDataOrNull(r.getRaw(t,"sublocalityLevel4")),e.fromDataOrNull(r.getRaw(t,"sublocalityLevel5")),r.getOrNull(t,"formattedAddress"),r.getOrNull(t,"street"),r.getOrNull(t,"streetNumber"),r.getOrNull(t,"building"),r.getOrNull(t,"floor"),r.getOrNull(t,"room"),r.getOrNull(t,"postalCode"))}toMap(e){return{country:this.country,administrativeAreaLevel1:e.toDataOrNull(this.administrativeAreaLevel1),administrativeAreaLevel2:e.toDataOrNull(this.administrativeAreaLevel2),administrativeAreaLevel3:e.toDataOrNull(this.administrativeAreaLevel3),administrativeAreaLevel4:e.toDataOrNull(this.administrativeAreaLevel4),administrativeAreaLevel5:e.toDataOrNull(this.administrativeAreaLevel5),locality:e.toDataOrNull(this.locality),sublocalityLevel1:e.toDataOrNull(this.sublocalityLevel1),sublocalityLevel2:e.toDataOrNull(this.sublocalityLevel2),sublocalityLevel3:e.toDataOrNull(this.sublocalityLevel3),sublocalityLevel4:e.toDataOrNull(this.sublocalityLevel4),sublocalityLevel5:e.toDataOrNull(this.sublocalityLevel5),formattedAddress:this.formattedAddress,street:this.street,streetNumber:this.streetNumber,building:this.building,floor:this.floor,room:this.room,postalCode:this.postalCode}}clone(){var e,t,s,a,o,u,c,l,h,p,I,v,E,w,S,R,x,N,O,A,M,C;return new n(this.country,(t=(e=this.administrativeAreaLevel1)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null,(a=(s=this.administrativeAreaLevel2)===null||s===void 0?void 0:s.clone())!==null&&a!==void 0?a:null,(u=(o=this.administrativeAreaLevel3)===null||o===void 0?void 0:o.clone())!==null&&u!==void 0?u:null,(l=(c=this.administrativeAreaLevel4)===null||c===void 0?void 0:c.clone())!==null&&l!==void 0?l:null,(p=(h=this.administrativeAreaLevel5)===null||h===void 0?void 0:h.clone())!==null&&p!==void 0?p:null,(v=(I=this.locality)===null||I===void 0?void 0:I.clone())!==null&&v!==void 0?v:null,(w=(E=this.sublocalityLevel1)===null||E===void 0?void 0:E.clone())!==null&&w!==void 0?w:null,(R=(S=this.sublocalityLevel2)===null||S===void 0?void 0:S.clone())!==null&&R!==void 0?R:null,(N=(x=this.sublocalityLevel3)===null||x===void 0?void 0:x.clone())!==null&&N!==void 0?N:null,(A=(O=this.sublocalityLevel4)===null||O===void 0?void 0:O.clone())!==null&&A!==void 0?A:null,(C=(M=this.sublocalityLevel5)===null||M===void 0?void 0:M.clone())!==null&&C!==void 0?C:null,this.formattedAddress,this.street,this.streetNumber,this.building,this.floor,this.room,this.postalCode)}isSame(e){return e===this?!0:e.country===this.country&&d(e.administrativeAreaLevel1,this.administrativeAreaLevel1)&&d(e.administrativeAreaLevel2,this.administrativeAreaLevel2)&&d(e.administrativeAreaLevel3,this.administrativeAreaLevel3)&&d(e.administrativeAreaLevel4,this.administrativeAreaLevel4)&&d(e.administrativeAreaLevel5,this.administrativeAreaLevel5)&&d(e.locality,this.locality)&&d(e.sublocalityLevel1,this.sublocalityLevel1)&&d(e.sublocalityLevel2,this.sublocalityLevel2)&&d(e.sublocalityLevel3,this.sublocalityLevel3)&&d(e.sublocalityLevel4,this.sublocalityLevel4)&&d(e.sublocalityLevel5,this.sublocalityLevel5)&&e.formattedAddress===this.formattedAddress&&e.street===this.street&&e.streetNumber===this.streetNumber&&e.building===this.building&&e.floor===this.floor&&e.room===this.room&&e.postalCode===this.postalCode}}
2return n.TYPE_ID="841cd6a8ba184e5797f5aa172eed4861",n})(),$p=class extends f{build(i,e){return zd.fromMap(i,e)}},tS=(()=>{class n extends b{constructor(e,t,s){super(),this.address=e,this.coordinates=t,this.mapPreview=s}get $typeId(){return n.TYPE_ID}get isMapPreviewAvailable(){return this.mapPreview!==null}static empty(){return new n(null,null,null)}static fromCountry(e){return new n(zd.create({country:e.toString()}),null,null)}static fromMap(e,t){return new n(e.fromDataOrNull(r.getRaw(t,"address")),e.fromDataOrNull(r.getRaw(t,"coordinates")),e.fromDataOrNull(r.getRaw(t,"mapPreview")))}toMap(e){return{address:e.toDataOrNull(this.address),coordinates:e.toDataOrNull(this.coordinates),mapPreview:e.toDataOrNull(this.mapPreview)}}clone(){var e,t,s,a,o,u;return new n((t=(e=this.address)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null,(a=(s=this.coordinates)===null||s===void 0?void 0:s.clone())!==null&&a!==void 0?a:null,(u=(o=this.mapPreview)===null||o===void 0?void 0:o.clone())!==null&&u!==void 0?u:null)}isSame(e){return e===this?!0:d(e.address,this.address)&&d(e.coordinates,this.coordinates)&&d(e.mapPreview,this.mapPreview)}copyWith(e){var t,s,a,o,u,c,l,h,p;return new n((t=e.address)!==null&&t!==void 0?t:(a=(s=this.address)===null||s===void 0?void 0:s.clone())!==null&&a!==void 0?a:null,(o=e.coordinates)!==null&&o!==void 0?o:(c=(u=this.coordinates)===null||u===void 0?void 0:u.clone())!==null&&c!==void 0?c:null,(l=e.mapPreview)!==null&&l!==void 0?l:(p=(h=this.mapPreview)===null||h===void 0?void 0:h.clone())!==null&&p!==void 0?p:null)}}return n.TYPE_ID="32aec9ffdf7a4b378a50b0a2f241c47f",n})(),Lp=class extends f{build(i,e){return tS.fromMap(i,e)}},Oi=(()=>{class n extends G{constructor(e){super(),this.location=e}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}get $removable(){return!1}static empty(){return new n(tS.empty())}static fromMap(e,t){return new n(e.fromData(r.getRaw(t,"location")))}toMap(e){return{location:e.toData(this.location)}}clone(){return new n(this.location.clone())}isSame(e){return this===e?!0:d(e.location,this.location)}}return n.TYPE_ID="a9b3401166e54d87981a5841d8b4c68f",n.SCHEMA_VERSION=3,n.DEFAULT_RENDER_ORDER=11,n})(),Vp=class extends f{build(i,e){return Oi.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(Oi.SCHEMA_VERSION))return e;if(t.isGreaterThan(Oi.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(r.setIfNullOrUndefined(e,"renderOrder",Oi.DEFAULT_RENDER_ORDER),r.setIfNullOrUndefined(e,"isRenderingEnabled",!0),s=2),s<3&&(s=3),e.$schema_version=D.encodedExactly(s),e}},VR=(()=>{class n extends G{constructor(e){super(),this.paymentMethods=e}get $typeId(){return n.TYPE_ID}get $removable(){return!1}static fromMap(e,t){return new n(r.getList(t,"paymentMethods",s=>{var a;return(a=y(s,pe))!==null&&a!==void 0?a:pe.OnDelivery}))}toMap(e){return{paymentMethods:this.paymentMethods}}clone(){return new n(this.paymentMethods)}isSame(e){return this===e?!0:P(e.paymentMethods,this.paymentMethods)}}return n.TYPE_ID="fe93698787814a5291014033545519d8",n})(),zp=class extends f{build(i,e){return VR.fromMap(i,e)}},nS=(()=>{class n extends G{constructor(e){super(),this.settings=e}get $typeId(){return n.TYPE_ID}get $removable(){return!1}static fromMap(e,t){return new n(e.fromData(r.getRaw(t,"settings")))}toMap(e){return{settings:e.toData(this.settings)}}clone(){return new n(this.settings.clone())}isSame(e){return this===e?!0:d(e.settings,this.settings)}}return n.TYPE_ID="8b0d2368e7fa4df8bfdd95d634fcaa28",n})(),Up=class extends f{build(i,e){return nS.fromMap(i,e)}},po=(()=>{class n extends G{constructor(e,t){super(),this.totalScore=e,this.numberOfRatings=t}get rating(){return this.numberOfRatings>0?this.totalScore/this.numberOfRatings:0}get $typeId(){return n.TYPE_ID}get $removable(){return!1}static firstRating(e){return new n(e,1)}static fromMap(e,t){return new n(r.get(t,"totalScore"),r.get(t,"numberOfRatings"))}toMap(e){return{totalScore:this.totalScore,numberOfRatings:this.numberOfRatings}}clone(){return new n(this.totalScore,this.numberOfRatings)}isSame(e){return this===e?!0:e.totalScore===this.totalScore&&e.numberOfRatings===this.numberOfRatings}addRating(e){return new n(this.totalScore+e,this.numberOfRatings+1)}}return n.TYPE_ID="56598c7161f743ebbfe3500202623d7b",n})(),Bp=class extends f{build(i,e){return po.fromMap(i,e)}},_a=(()=>{class n extends G{constructor(e,t,s){super(),this.allowCustomBookingSettings=e,this.allowOpenReservations=t,this.settings=s}get $removable(){return!1}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static fromMap(e,t){return new n(r.get(t,"allowCustomBookingSettings"),r.get(t,"allowOpenReservations"),e.fromData(r.get(t,"settings")))}toMap(e){return{allowCustomBookingSettings:this.allowCustomBookingSettings,allowOpenReservations:this.allowOpenReservations,settings:e.toData(this.settings)}}clone(){return new n(this.allowCustomBookingSettings,this.allowOpenReservations,this.settings.clone())}isSame(e){return e===this?!0:e.allowCustomBookingSettings===this.allowCustomBookingSettings&&e.allowOpenReservations===this.allowOpenReservations&&d(e.settings,this.settings)}}
2return n.TYPE_ID="8b154835c5c247f48197fc67b962224a",n.SCHEMA_VERSION=3,n})(),Hp=class extends f{build(i,e){return _a.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(_a.SCHEMA_VERSION))return e;if(t.isGreaterThan(_a.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(r.set(e,"allowCustomBookingSettings",!1),s=2),s<3&&(r.set(e,"allowOpenReservations",!1),s=3),e.$schema_version=D.encodedExactly(s),e}},go=(()=>{class n extends G{constructor(e){super(),this.settings=e}get $typeId(){return n.TYPE_ID}get $removable(){return!1}static fromMap(e,t){return new n(e.fromData(r.getRaw(t,"settings")))}toMap(e){return{settings:e.toData(this.settings)}}clone(){return new n(this.settings.clone())}isSame(e){return this===e?!0:d(e.settings,this.settings)}}return n.TYPE_ID="ed6e0bce01f84c3fbf67a8dd4279b234",n})(),Gp=class extends f{build(i,e){return go.fromMap(i,e)}},iS=(()=>{class n extends G{constructor(e){super(),this.settings=e}get $typeId(){return n.TYPE_ID}get $removable(){return!1}static fromMap(e,t){return new n(e.fromData(r.getRaw(t,"settings")))}toMap(e){return{settings:e.toData(this.settings)}}clone(){return new n(this.settings.clone())}isSame(e){return this===e?!0:d(e.settings,this.settings)}}return n.TYPE_ID="10439f7981824b6ba4de03d0806e5ccb",n})(),Wp=class extends f{build(i,e){return iS.fromMap(i,e)}},sS=(()=>{class n extends G{constructor(e){super(),this.lastActivity=e}get $removable(){return!1}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(e.decodeDate(r.get(t,"lastActivity")))}toMap(e){return{lastActivity:e.encodeDate(this.lastActivity)}}clone(){return new n(g.cloneDate(this.lastActivity))}isSame(e){return e===this?!0:e.lastActivity===this.lastActivity}}return n.TYPE_ID="16f0691483b743f7a154552d7ea71e7d",n})(),jp=class extends f{build(i,e){return sS.fromMap(i,e)}},rS=(()=>{class n extends G{constructor(e){super(),this.publishingStatus=e}get $typeId(){return n.TYPE_ID}get $removable(){return!1}static fromMap(e,t){return new n(r.get(t,"publishingStatus"))}toMap(e){return{publishingStatus:this.publishingStatus}}clone(){return new n(this.publishingStatus)}isSame(e){return this===e?!0:e.publishingStatus===this.publishingStatus}}return n.TYPE_ID="d250c8c6f3f744488b8c54972758cbcf",n})(),Jp=class extends f{build(i,e){return rS.fromMap(i,e)}},mo=(()=>{class n extends G{constructor(e){super(),this.isBlacklisted=e}get $typeId(){return n.TYPE_ID}get $removable(){return!1}static fromMap(e,t){return new n(r.get(t,"isBlacklisted"))}toMap(e){return{isBlacklisted:this.isBlacklisted}}clone(){return new n(this.isBlacklisted)}isSame(e){return this===e?!0:e.isBlacklisted===this.isBlacklisted}}return n.TYPE_ID="8014bcf3d6774bfc947e89e9e3389d89",n})(),Kp=class extends f{build(i,e){return mo.fromMap(i,e)}},Ud=(()=>{class n extends G{constructor(e,t){super(),this.joinDate=e,this.inviteCodeId=t}get $typeId(){return n.TYPE_ID}get $removable(){return!1}static fromMap(e,t){return new n(e.decodeDate(r.get(t,"joinDate")),r.getOrNull(t,"inviteCodeId"))}toMap(e){return{joinDate:e.encodeDate(this.joinDate),inviteCodeId:this.inviteCodeId}}clone(){return new n(g.cloneDate(this.joinDate),this.inviteCodeId)}isSame(e){return this===e?!0:e.joinDate===this.joinDate&&e.invite
2CodeId===this.inviteCodeId}}return n.TYPE_ID="dff7d59583664f30a3d0a5cf0c52575b",n})(),Zp=class extends f{build(i,e){return Ud.fromMap(i,e)}},aS=(()=>{class n extends G{constructor(e,t){super(),this.firstName=e,this.lastName=t}get $typeId(){return n.TYPE_ID}get $removable(){return!1}static fromMap(e,t){return new n(r.getOrNull(t,"firstName"),r.getOrNull(t,"lastName"))}toMap(e){return{firstName:this.firstName,lastName:this.lastName}}clone(){return new n(this.firstName,this.lastName)}isSame(e){return this===e?!0:e.firstName===this.firstName&&e.lastName===this.lastName}}return n.TYPE_ID="69bea39bd81344beb9866c47caa3333b",n})(),Xp=class extends f{build(i,e){return aS.fromMap(i,e)}},Wl=(()=>{class n extends G{constructor(e,t,s){super(),this.address=e,this.coordinates=t,this.timezone=s}get $typeId(){return n.TYPE_ID}get $removable(){return!1}static fromMap(e,t){return new n(e.fromDataOrNull(r.getOrNull(t,"address")),e.fromDataOrNull(r.getOrNull(t,"coordinates")),Re(r.getOrNull(t,"timezone"),Ee))}toMap(e){return{address:e.toDataOrNull(this.address),coordinates:e.toDataOrNull(this.coordinates),timezone:Se(this.timezone)}}clone(){return new n(Z(this.address),Z(this.coordinates),this.timezone)}isSame(e){return e===this?!0:d(e.address,this.address)&&d(e.coordinates,this.coordinates)&&e.timezone===this.timezone}}return n.TYPE_ID="5c3777f2aede4a51bdfcc01900a1b8f1",n})(),Qp=class extends f{build(i,e){return Wl.fromMap(i,e)}},Bd=(()=>{class n extends G{constructor(e){super(),this.owners=e}get $typeId(){return n.TYPE_ID}get $removable(){return!1}static fromMap(e,t){return new n(r.getList(t,"owners",s=>s))}toMap(e){return{owners:this.owners}}clone(){return new n(this.owners)}isSame(e){return this===e?!0:e.owners===this.owners}}return n.TYPE_ID="58e30976c1374c8b9e95879d6d18bffb",n})(),eg=class extends f{build(i,e){return Bd.fromMap(i,e)}},zR=(()=>{class n extends G{constructor(e){super(),this.adminShareLink=e}get $removable(){return!1}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.getOrNull(t,"adminShareLink"))}toMap(e){return{adminShareLink:this.adminShareLink}}clone(){return new n(this.adminShareLink)}isSame(e){return e===this?!0:e.adminShareLink===this.adminShareLink}}return n.TYPE_ID="fc8346c74b5b408fbfafeaf7b26057f8",n})(),tg=class extends f{build(i,e){return zR.fromMap(i,e)}},UR=(()=>{class n extends G{constructor(e){super(),this.customerDetails=e}get $typeId(){return n.TYPE_ID}get $removable(){return!1}static fromMap(e,t){return new n(e.fromData(r.get(t,"customerDetails")))}toMap(e){return{customerDetails:e.toData(this.customerDetails)}}clone(){return new n(this.customerDetails.clone())}isSame(e){return e===this?!0:d(e.customerDetails,this.customerDetails)}}return n.TYPE_ID="c03f983bc91f451cab41c5cdb3cbc808",n})(),ng=class extends f{build(i,e){return UR.fromMap(i,e)}},BR=(()=>{class n extends G{constructor(e,t,s=null,a=null){super(),this.serviceId=e,this.groupSize=t,this.reservationId=s,this.groupId=a}get $removable(){return!1}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.get(t,"serviceId"),r.get(t,"groupSize"),r.getOrNull(t,"reservationId"),r.getOrNull(t,"groupId"))}toMap(e){return{serviceId:this.serviceId,groupSize:this.groupSize,reservationId:this.reservationId,groupId:this.groupId}}clone(){return new n(this.serviceId,this.groupSize,this.reservationId,this.groupId)}isSame(e){return e===this?!0:e.serviceId===this.serviceId&&e.groupSize===this.groupSize&&e.reservationId===this.reservationId&&e.groupId===this.groupId}}return n.TYPE_ID="4ab97b7a823747b88567b44c1c4740c7",n})(),ig=class extends f{build(i,e){return BR.fromMap(i,e)}},HR=(()=>{class n extends G{constructor(e,t=null,s=null){super(),this.serviceId=e,this.reservationId=t,this.groupId=s}get $removable(){return!1}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.get(t,"serviceId"),r.getOrNull(t,"reservationId"),r.getOrNull(t,"groupId"))}toMap(e){return{serviceId:this.serviceId,reservationId:this.reservationId,groupId:this.groupId}}clone(){return new n(this.serviceId,this.reservationId,this.groupId)}isSame(e){return e===this?!0:e.serviceId===this.serviceId&&e.reservationId===this.reservationId&&e.groupId===this.groupId}}return n.TYPE_ID="18c2e75e24d940a1b3da7904ac55cba3",n})(),sg=class extends f{build(i,e){return HR.fromMap(i,e)}},_r=class n{sanitize(i){let e=i?.replace(" ","");return e&&n.numberValidator.test(e)?e:null}};_r.numberValidator=new RegExp("^\\+?\\d+$");var he=class extends _r{constructor(i=7,e=13){super(),this.minLength=i,this.maxLength=e}validateFormattedNumber(i){return i.replace(Px,"")!==null}validate(i){let e=this.sanitize(i);return!(e===null||this.minLength!==null&&e.length<this.minLength||this.maxLength!==null&&e.length>this.maxLength)}},Io=class n extends _r{validateFormattedNumber(i){let e=i?.replace(" ","");return e?n.formattedPhoneNumberFormat.test(e):!1}validate(i){let e=this.sanitize(i);return e?n.phoneNumberFormat.test(e):!1}sanitize(i){let e=super.sanitize(i);return e&&(e.startsWith("+36")&&(e=e.substring(3)),e.startsWith("06")&&(e=e.substring(2))),e}};Io.formattedPhoneNumberFormat=new RegExp("^(?:\\+36|06)?(?:[0-9]\\d{7,8})$");Io.phoneNumberFormat=new RegExp("^[0-9]\\d{7,8}$");var jl=class n extends _r{validateFormattedNumber(i){let e=i?.replace(" ","");return e?n.formattedPhoneNumberFormat.test(e):!1}validate(i){let e=this.sanitize(i);return e?e.length===9:!1}sanitize(i){let e=super.sanitize(i);return e&&(e.startsWith("+40")&&(e=e.substring(3)),e.startsWith("0")&&(e=e.substring(1))),e}};jl.formattedPhoneNumberFormat=new RegExp("^(?:\\+40|0)?(?:7\\d{8})$");var Qi=class{static ofCountry(i){let e=this.validators.get(i);if(_(e))return e;throw new Error(`Failed to find phone number validator for country: ${i}`)}static hasForCountry(i){return this.validators.has(i)}};Qi.validators=new Map([[T.Albania,new he],[T.Andorra,new he],[T.Armenia,new he],[T.Austria,new he],[T.Azerbaijan,new he],[T.Belarus,new he],[T.Belgium,new he],[T.BosniaAndHerzegovina,new he],[T.Bulgaria,new he],[T.Croatia,new he],[T.Cyprus,new he],[T.CzechRepublic,new he],[T.Denmark,new he],[T.Estonia,new he],[T.FaroeIslands,new he],[T.Finland,new he],[T.France,new he],[T.Georgia,new he],[T.Germany,new he],[T.Gibraltar,new he],[T.Greece,new he],[T.Hungary,new Io],[T.Iceland,new he],[T.Ireland,new he],[T.Italy,new he],[T.Latvia,new he],[T.Liechtenstein,new he],[T.Lithuania,new he],[T.Luxembourg,new he],[T.NorthMacedonia,new he],[T.Malta,new he],[T.RepublicOfMoldova,new he],[T.Monaco,new he],[T.Montenegro,new he],[T.Netherlands,new he],[T.Norway,new he],[T.Poland,new he],[T.Portugal,new he],[T.Romania,new jl],[T.Russia,new he],[T.SanMarino,new he],[T.Serbia,new he],[T.Slovakia,new he],[T.Slovenia,new he],[T.Spain,new he],[T.Sweden,new he],[T.Switzerland,new he],[T.Turkey,new he],[T.Ukraine,new he],[T.UnitedKingdom,new he],[T.VaticanCity,new he]]);var ft=class n{constructor(i,e){this.country=i,this.number=e}get asFormattedString(){return Xi(this.country)+this.number}encode(){return`(${Xi(this.country)})${this.number}`}
2toISOE164(){return`+${Xi(this.country)}${this.number}`}toPrefixAndNumber(){return`${Xi(this.country)}${this.number}`}static mustDecode(i){if(i&&i.length!==0){let e=i.match(this.encodedPhoneNumberMatcher);if(e&&e.length>2){let t=Yx(e[1]);if(t){let s=e[2];return s&&s.length>0?new n(t,s):new n(t,"")}}}throw new ie(`Failed to deserialize encoded phone number: ${i}`)}static decode(i){return k(i)||i.length===0?null:n.mustDecode(i)}clone(){return new n(this.country,this.number)}isSame(i){return i===this?!0:i.country===this.country&&i.number===this.number}invalidate(){return new n(this.country,this.number.replace(/\d/g,"0"))}sanitize(i,e){return this.getSanitizedPhoneNumber(i,e)}ofCountry(i){let e=$x(i);return e?new n(e,""):null}getSanitizedPhoneNumber(i,e){let t=Qi.ofCountry(i),s=t.sanitize(e);return t&&s?new n(i,s):null}hasPhoneNumberValidator(i){return Qi.hasForCountry(i)}isPhoneNumberValid(i,e){var t;if(!i||!this.hasPhoneNumberValidator(i)||!e||e.length===0)return!1;let s=Qi.ofCountry(i);return(t=s?.validate(e))!==null&&t!==void 0?t:!1}isFormattedPhoneNumberValid(i,e){var t;if(!i||!this.hasPhoneNumberValidator(i)||!e||e.length===0)return!1;let s=Qi.ofCountry(i);return(t=s?.validateFormattedNumber(e))!==null&&t!==void 0?t:!1}getFormattedPhoneNumber(i){let e=zl.ofCountry(i.country);return e?e.format(i):i.asFormattedString}};ft.encodedPhoneNumberMatcher=new RegExp("^\\((\\+\\d+)\\)(\\d+)$");var Mi=(()=>{class n extends G{constructor(e,t,s,a,o,u,c){super(),this.tikTok=e,this.facebook=t,this.instagram=s,this.website=a,this.emailAddress=o,this.phoneNumber=u,this.removable=c}static create(e){return new n(e.tikTok,e.facebook,e.instagram,e.website,e.emailAddress,e.phoneNumber,e.removable)}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}get $removable(){return this.removable}static empty(e=!1){return new n("","","","","",null,e)}static fromMap(e,t){return new n(r.get(t,"tikTok"),r.get(t,"facebook"),r.get(t,"instagram"),r.get(t,"website"),r.get(t,"emailAddress"),ft.decode(r.getOrNull(t,"phoneNumber")),r.get(t,"removable"))}toMap(e){var t,s;return{tikTok:this.tikTok,facebook:this.facebook,instagram:this.instagram,website:this.website,emailAddress:this.emailAddress,phoneNumber:(s=(t=this.phoneNumber)===null||t===void 0?void 0:t.encode())!==null&&s!==void 0?s:null,removable:this.removable}}clone(){var e,t;return new n(this.tikTok,this.facebook,this.instagram,this.website,this.emailAddress,(t=(e=this.phoneNumber)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null,this.removable)}isSame(e){return this===e?!0:e.tikTok===this.tikTok&&e.facebook===this.facebook&&e.instagram===this.instagram&&e.website===this.website&&e.emailAddress===this.emailAddress&&d(e.phoneNumber,this.phoneNumber)&&e.removable===this.removable}copyWith(e){var t,s,a,o,u,c,l,h,p;return n.create({tikTok:(t=e.tikTok)!==null&&t!==void 0?t:this.tikTok,facebook:(s=e.facebook)!==null&&s!==void 0?s:this.facebook,instagram:(a=e.instagram)!==null&&a!==void 0?a:this.instagram,website:(o=e.website)!==null&&o!==void 0?o:this.website,emailAddress:(u=e.emailAddress)!==null&&u!==void 0?u:this.emailAddress,phoneNumber:(h=(c=e.phoneNumber)!==null&&c!==void 0?c:(l=this.phoneNumber)===null||l===void 0?void 0:l.clone())!==null&&h!==void 0?h:null,removable:(p=e.removable)!==null&&p!==void 0?p:this.removable})}}return n.TYPE_ID="834392f9bbea47d9a3962b4bb41e4823",n.SCHEMA_VERSION=5,n})(),rg=class extends f{build(i,e){return Mi.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(Mi.SCHEMA_VERSION))return e;if(t.isGreaterThan(Mi.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(r.setIfNullOrUndefined(e,"emailAddress",""),s=2),s<3&&(r.setIfNullOrUndefined(e,"tikTok",""),s=3),s<4&&(r.setIfNullOrUndefined(e,"phoneNumber",null),s=4),s<5&&(r.setIfNullOrUndefined(e,"removable",!1),s=5),e.$schema_version=D.encodedExactly(s),e}},GR=(()=>{class n extends G{constructor(e){super(),this.coverImage=e}get $typeId(){return n.TYPE_ID}get $removable(){return!0}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}static fromMap(e,t){return new n(e.fromData(r.getRaw(t,"coverImage")))}toMap(e){return{coverImage:e.toData(this.coverImage)}}clone(){return new n(this.coverImage.clone())}isSame(e){return this===e?!0:d(e.coverImage,this.coverImage)}}return n.TYPE_ID="ce623d915310493797dbec434db1d491",n.SCHEMA_VERSION=1,n})(),ag=class extends f{build(i,e){return GR.fromMap(i,e)}},WR=(()=>{class n extends G{constructor(e){super(),this.title=e}get $typeId(){return n.TYPE_ID}get $removable(){return!0}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}static fromMap(e,t){return new n(e.fromData(r.getRaw(t,"title")))}toMap(e){return{title:e.toData(this.title)}}clone(){return new n(this.title.clone())}isSame(e){return this===e?!0:d(e.title,this.title)}}return n.TYPE_ID="9a49dacf042143f8832db0092041ff7f",n.SCHEMA_VERSION=1,n})(),og=class extends f{build(i,e){return WR.fromMap(i,e)}},en=(()=>{class n extends G{constructor(e){super(),this.portfolio=e}get $typeId(){return n.TYPE_ID}get $removable(){return!0}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}static fromMap(e,t){return new n(e.fromData(r.getRaw(t,"portfolio")))}toMap(e){return{portfolio:e.toData(this.portfolio)}}clone(){return new n(this.portfolio.clone())}isSame(e){return this===e?!0:d(e.portfolio,this.portfolio)}}return n.TYPE_ID="24fd01fc9daa474a96f57ca558179391",n.SCHEMA_VERSION=2,n})(),ug=class extends f{build(i,e){return en.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(en.SCHEMA_VERSION))return e;if(t.isGreaterThan(en.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(r.set(e,"portfolio",r.get(e,"photos")),s=2),e.$schema_version=D.encodedExactly(s),e}},jR=(()=>{class n extends G{constructor(e){super(),this.portfolio=e}get $typeId(){return n.TYPE_ID}get $removable(){return!1}static fromMap(e,t){return new n(e.fromData(r.getRaw(t,"portfolio")))}toMap(e){return{portfolio:e.toData(this.portfolio)}}clone(){return new n(this.portfolio.clone())}isSame(e){return this===e?!0:d(e.portfolio,this.portfolio)}}return n.TYPE_ID="3d04a8d15ab542d19c5473a81391be89",n})(),cg=class extends f{build(i,e){return jR.fromMap(i,e)}},Hd=(()=>{class n extends b{constructor(e,t){super(),this.text=e,this.richText=t}get $typeId(){return n.TYPE_ID}get hasText(){return this.text!=""&&this.text!=n.kPlainLineBreak}get hasRichText(){return this.richText!=""&&this.richText!=n.kRichLineBreak}get isNotEmpty(){return this.hasText||this.hasRichText}get isEmpty(){return!this.isNotEmpty}static empty(){return new n("","")}static plain(e){return new n(e,e)}static fromMap(e,t){return new n(r.get(t,"text"),r.get(t,"richText"))}toMap(){return{text:this.text,richText:this.richText}}clone(){return new n(this.text,this.richText)}isSame(e){return e===this?!0:e.text==this.text&&e.richText==this.richText}}return n.TYPE_ID="a5877e2717384653b5ba67201f876992",n.kPlainLineBreak=` 3`,n.kRichLineBreak='[{"insert":"\\n"}]',n})(),lg=class extends f{build(i,e){return Hd.fromMap(i,e)}},hn=(()=>{class n extends b{constructor(e){super(),this.localizations=e}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}isEmpty(){if(this.localizations.size==0)return!0;let e=!0;for(let t of this.localizations.values())if(t.isNotEmpty){e=!1;break}return e}isNotEmpty(){return!this.isEmpty()}has(e){return _(this.localizations.get(e))}hasAndNotEmpty(e){let t=this.localizations.get(e);return _(t)&&t.isNotEmpty}set(e,t){this.localizations.set(e,t)}get(e){var t;return(t=this.localizations.get(e))!==null&&t!==void 0?t:null}getAny(e=null){return Pr(this.localizations,e,t=>t.isNotEmpty)}getAnyOrEmpty(e=null){var t;return(t=Pr(this.localizations,e,s=>s.isNotEmpty))!==null&&t!==void 0?t:Hd.empty()}static empty(){return new n(new Map)}static forLanguage(e,t){return new n(new Map([[e,t]]))}static localized(e){return new n(e)}static fromMap(e,t){return new n(r.getMap(t,"localizations",(s,a)=>({key:y(s,$),value:e.fromData(a)})))}toMap(e){return{localizations:se(this.localizations,(t,s)=>({key:m(t),value:e.toData(s)}))}}
3clone(){return new n(ee(this.localizations,e=>e.clone()))}isSame(e){return e===this?!0:re(e.localizations,this.localizations,(t,s)=>d(t,s))}}return n.TYPE_ID="d83e3182e6e64bc4a8c4ffd08faa464a",n.SCHEMA_VERSION=3,n})(),dg=class extends f{build(i,e){return hn.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(hn.SCHEMA_VERSION))return e;if(t.isGreaterThan(hn.SCHEMA_VERSION))return null;let s=t.to;if(s<2){s=2;let a=i.storage.get("language",$.English);if(_(a)){let o=i.fromData(r.get(e,"description")),u=r.getMap(e,"localizedDescription",(c,l)=>({key:y(c,$),value:i.fromData(l)}));k(u.get(a))&&u.set(a,o),e.localizedDescription=se(u,(c,l)=>({key:m(c),value:i.toData(l)}))}}return s<3&&(s=3,e.localizations=e.localizedDescription),e.$schema_version=D.encodedExactly(s),e}},es=(()=>{class n extends Be{constructor(e,t,s){super(),this.descriptions=e,this.renderOrder=t,this.isRenderingEnabled=s}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}get $removable(){return!1}static empty(e){var t;return new n(hn.empty(),(t=e?.renderOrder)!==null&&t!==void 0?t:n.DEFAULT_RENDER_ORDER,!1)}static fromMap(e,t){return new n(e.fromData(r.getRaw(t,"descriptions")),r.get(t,"renderOrder"),r.get(t,"isRenderingEnabled"))}static fromRichDescription(e){return new n(e,n.DEFAULT_RENDER_ORDER,!0)}static fromLocalizedRichDescription(e){return new n(e,n.DEFAULT_RENDER_ORDER,!0)}toMap(e){return{descriptions:e.toData(this.descriptions),renderOrder:this.renderOrder,isRenderingEnabled:this.isRenderingEnabled}}clone(){return new n(this.descriptions.clone(),this.renderOrder,this.isRenderingEnabled)}isSame(e){return this===e?!0:d(e.descriptions,this.descriptions)&&e.renderOrder===this.renderOrder&&e.isRenderingEnabled===this.isRenderingEnabled}}return n.TYPE_ID="bc238734949a432eba8e7384436c4d1f",n.SCHEMA_VERSION=3,n.DEFAULT_RENDER_ORDER=8,n})(),hg=class extends f{build(i,e){return es.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){var t;let s=r.getVersionRange(e);if(s.contains(es.SCHEMA_VERSION))return e;if(s.isGreaterThan(es.SCHEMA_VERSION))return null;let a=s.to;if(a<2&&(r.setIfNullOrUndefined(e,"renderOrder",es.DEFAULT_RENDER_ORDER),r.setIfNullOrUndefined(e,"isRenderingEnabled",!0),a=2),a<3){let o=r.get(e,"description");if(o){let u=i.fromData(o),c=(t=i.storage.get("language",$.English))!==null&&t!==void 0?t:$.English;r.set(e,"descriptions",i.toData(hn.forLanguage(c,u)))}a=3}return e.$schema_version=D.encodedExactly(a),e}},Tu=(()=>{class n extends G{constructor(e,t,s,a){super(),this.name=e,this.email=t,this.phoneNumber=s,this.address=a}get $removable(){return!1}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}static create(e){var t,s,a,o;return new n((t=e.name)!==null&&t!==void 0?t:null,(s=e.email)!==null&&s!==void 0?s:null,(a=e.phoneNumber)!==null&&a!==void 0?a:null,(o=e.address)!==null&&o!==void 0?o:null)}static fromMap(e,t){return new n(r.getOrNull(t,"name"),r.getOrNull(t,"email"),ft.decode(r.getOrNull(t,"phoneNumber")),e.fromDataOrNull(r.getOrNull(t,"address")))}toMap(e){var t,s;return{name:this.name,email:this.email,phoneNumber:(s=(t=this.phoneNumber)===null||t===void 0?void 0:t.encode())!==null&&s!==void 0?s:null,address:e.toDataOrNull(this.address)}}clone(){var e,t,s,a;return new n(this.name,this.email,(t=(e=this.phoneNumber)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null,(a=(s=this.address)===null||s===void 0?void 0:s.clone())!==null&&a!==void 0?a:null)}isSame(e){return e===this?!0:e.name===this.name&&e.email===this.email&&d(e.phoneNumber,this.phoneNumber)&&d(e.address,this.address)}copyWith(e){var t,s,a,o;let u=(t=e.name)!==null&&t!==void 0?t:it.none(),c=(s=e.email)!==null&&s!==void 0?s:it.none(),l=(a=e.phoneNumber)!==null&&a!==void 0?a:it.none(),h=(o=e.address)!==null&&o!==void 0?o:it.none();return new n(u.isSome?u.value:this.name,c.isSome?c.value:this.email,l.isSome?l.value:this.phoneNumber,h.isSome?h.value:this.address)}}return n.TYPE_ID="a503e34f5ece4f47bad09ec69ba020ee",n.SCHEMA_VERSION=5,n})(),fg=class extends f{build(i,e){return Tu.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(Tu.SCHEMA_VERSION))return e;if(t.isGreaterThan(Tu.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(s=2),s<3&&(s=3),s<4&&(s=4),s<5&&(s=5),e.$schema_version=D.encodedExactly(s),e}},Ni=(function(n){return n.PhysicalPerson="PhysicalPerson",n.LegalEntity="LegalEntity",n})(Ni||{});var xa=(()=>{class n extends b{constructor(e,t,s,a,o,u,c){super(),this.invoiceType=e,this.name=t,this.email=s,this.taxCode=a,this.groupTaxCode=o,this.address=u,this.phoneNumber=c}get $removable(){return!1}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static create(e){return new n(e.invoiceType,e.name,e.email,e.taxCode,e.groupTaxCode,e.address,e.phoneNumber)}static personal(e){return n.create({invoiceType:Ni.PhysicalPerson,name:e.name,email:e.email,taxCode:null,groupTaxCode:null,address:e.address,phoneNumber:e.phoneNumber})}static legalEntity(e){return n.create({invoiceType:Ni.LegalEntity,name:e.name,email:e.email,taxCode:e.taxCode,groupTaxCode:e.groupTaxCode,address:e.address,phoneNumber:e.phoneNumber})}static fromMap(e,t){return new n(y(r.get(t,"invoiceType"),Ni),r.get(t,"name"),r.get(t,"email"),r.getOrNull(t,"taxCode"),r.getOrNull(t,"groupTaxCode"),e.fromDataOrNull(r.getOrNull(t,"address")),ft.decode(r.getOrNull(t,"phoneNumber")))}toMap(e){var t,s;return{name:this.name,email:this.email,phoneNumber:(s=(t=this.phoneNumber)===null||t===void 0?void 0:t.encode())!==null&&s!==void 0?s:null,address:e.toDataOrNull(this.address),taxCode:this.taxCode,groupTaxCode:this.groupTaxCode,invoiceType:m(this.invoiceType)}}clone(){var e,t,s,a;return new n(this.invoiceType,this.name,this.email,this.taxCode,this.groupTaxCode,(t=(e=this.address)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null,(a=(s=this.phoneNumber)===null||s===void 0?void 0:s.clone())!==null&&a!==void 0?a:null)}isSame(e){return e===this?!0:e.name===this.name&&e.email===this.email&&e.taxCode===this.taxCode&&e.groupTaxCode===this.groupTaxCode&&e.invoiceType===this.invoiceType&&d(e.phoneNumber,this.phoneNumber)&&d(e.address,this.address)}copyWith(e){var t,s,a,o,u,c,l,h,p,I,v;return new n((t=e.invoiceType)!==null&&t!==void 0?t:this.invoiceType,(s=e.name)!==null&&s!==void 0?s:this.name,(a=e.email)!==null&&a!==void 0?a:this.email,(o=e.taxCode)!==null&&o!==void 0?o:this.taxCode,(u=e.groupTaxCode)!==null&&u!==void 0?u:this.groupTaxCode,(h=(c=e.address)!==null&&c!==void 0?c:(l=this.address)===null||l===void 0?void 0:l.clone())!==null&&h!==void 0?h:null,(v=(p=e.phoneNumber)!==null&&p!==void 0?p:(I=this.phoneNumber)===null||I===void 0?void 0:I.clone())!==null&&v!==void 0?v:null)}}return n.TYPE_ID="c75a774b18044543b04999a3720417e6",n.SCHEMA_VERSION=2,n})(),pg=class extends f{build(i,e){return xa.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(xa.SCHEMA_VERSION))return e;if(t.isGreaterThan(xa.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(s=2),e.$schema_version=D.encodedExactly(s),e}},JR=(()=>{class n extends G{constructor(e){super(),this.profiles=e}get $removable(){return!1}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}updateBillingProfile(e){for(let t=0;t<this.profiles.length;t++)if(this.profiles[t].invoiceType==e.invoiceType){this.profiles[t]=e;return}this.profiles.push(e)}getBillingProfile(e){if(e==null)return null;for(let t=0;t<this.profiles.length;t++)if(this.profiles[t].invoiceType==e)return this.profiles[t];return null}getAnyBillingProfile(e){if(e!=null){for(let t=0;t<this.profiles.length;t++)if(this.profiles[t].invoiceType==e)return this.profiles[t]}return this.profiles.length>0?this.profiles[0]:null}static empty(){return new n([])}static fromLegacy(e){var t,s,a,o;if(k(e.name)||k(e.email))return null;let u=xa.personal({name:e.name,email:e.email,phoneNumber:(s=(t=e.phoneNumber)===null||t===void 0?void 0:t.clone())!==null&&s!==void 0?s:null,address:(o=(a=e.address)===null||a===void 0?void 0:a.clone())!==null&&o!==void 0?o:null});return new n([u])}static fromProfile(e){return new n([e])}static fromMap(e,t){return new n(r.getList(t,"profiles",s=>e.fromData(s)))}toMap(e){return{profiles:this.profiles.map(t=>e.toData(t))}}clone(){return new n(this.profiles.map(e=>e.clone()))}isSame(e){return e===this?!0:P(e.profiles,this.profiles,d)}prune(e){let t=[];for(let s=0;s<this.profiles.length;s++)if(this.profiles[s].invoiceType==e){t.push(this.profiles[s].clone());break}return new n(t)}}return n.TYPE_ID="18329832a0e3479d93460fa80a95f0d8",n.SCHEMA_VERSION=1,n})(),gg=class extends f{build(i,e){return JR.fromMap(i,e)}},Ou=(()=>{class n extends G{constructor(e,t){super(),this.marketing=e,this.businessMarketing=t}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}get $removable(){return!1}static create(e){return new n(e.marketing,e.businessMarketing)}static fromMap(e,t){return n.create({marketing:r.getBoolean(t,"marketing"),businessMarketing:r.getList(t,"businessMarketing",s=>j.mustDecode(K.decodeString(s)))})}toMap(e){return{marketing:this.marketing,businessMarketing:this.businessMarketing.map(t=>t.encode())}}clone(){return n.create({marketing:this.marketing,businessMarketing:ue(this.businessMarketing)})}isSame(e){return e===this?!0:e.marketing===this.marketing&&P(e.businessMarketing,this.businessMarketing,d)}}return n.TYPE_ID="16bc0e2a0f6d4cc28a0d4d7a4dc39e05",n.SCHEMA_VERSION=2,n})(),mg=class extends f{build(i,e){return Ou.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(Ou.SCHEMA_VERSION))return e;if(t.isGreaterThan(Ou.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(r.setIfNullOrUndefined(e,"businessMarketing",[]),s=2),e.$schema_version=D.encodedExactly(s),e}},oS=(()=>{class n extends G{constructor(e){super(),this.settings=e}get $typeId(){return n.TYPE_ID}get $removable(){return!1}static fromMap(e,t){return new n(e.fromData(r.getRaw(t,"settings")))}toMap(e){return{settings:e.toData(this.settings)}}clone(){return new n(this.settings.clone())}isSame(e){return this===e?!0:d(e.settings,this.settings)}}return n.TYPE_ID="7172147766a84b0584a5018a30c1a69c",n})(),Ig=class extends f{build(i,e){return oS.fromMap(i,e)}},KR=(()=>{class n extends G{constructor(e,t){super(),this.isRequired=e,this.details=t}get isValid(){return!this.isRequired||this.details!=null}get $typeId(){return n.TYPE_ID}get $removable(){return!1}static required(){return new n(!0,null)}static fulfilled({details:e}){return new n(!0,e)}static fromMap(e,t){return new n(r.get(t,"isRequired"),e.fromDataOrNull(r.getOrNull(t,"details")))}toMap(e){return{isRequired:this.isRequired,details:e.toDataOrNull(this.details)}}clone(){var e,t;return new n(this.isRequired,(t=(e=this.details)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null)}isSame(e){return this===e?!0:e.isRequired==this.isRequired&&d(e.details,this.details)}}return n.TYPE_ID="a3bb9813e0a04a0fa115538173c056c2",n})(),Dg=class extends f{build(i,e){return KR.fromMap(i,e)}},uS=(()=>{class n extends G{constructor(e){super(),this.seatingLayoutId=e}get $removable(){return!1}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.get(t,"seatingLayoutId"))}toMap(e){return{seatingLayoutId:this.seatingLayoutId}}clone(){return new n(this.seatingLayoutId)}isSame(e){return this===e?!0:e.seatingLayoutId==this.seatingLayoutId}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="95a725f15f1c44b49eb9cd0b9e3b61bc",n})(),vg=class extends f{build(i,e){return uS.fromMap(i,e)}},mr=(()=>{class n extends G{constructor(e,t){super(),this.roomId=e,this.seatingLayoutId=t}get $removable(){return!1}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static fromMap(e,t){return new n(r.get(t,"roomId"),r.get(t,"seatingLayoutId"))}toMap(e){return{roomId:this.roomId,seatingLayoutId:this.seatingLayoutId}}clone(){return new n(this.roomId,this.seatingLayoutId)}isSame(e){return this===e?!0:e.roomId==this.roomId&&e.seatingLayoutId==this.seatingLayoutId}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="dd6a0dbc7dcb47fe95accd94d0f2b9f5",n.SCHEMA_VERSION=2,n})(),yg=class extends f{build(i,e){return mr.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(mr.SCHEMA_VERSION))return e;if(t.isGreaterThan(mr.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(e.roomId=e.seatingLayoutId,s=2),e.$schema_version=D.encodedExactly(s),e}},Do=(function(n){return n.Public="Public",n.Private="Private",n.Internal="Internal",n})(Do||{}),Gd=(()=>{class n extends G{constructor(e){super(),this.privacyMode=e}get $removable(){return!1}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(y(r.get(t,"privacyMode"),Do))}toMap(e){return{privacyMode:m(this.privacyMode)}}clone(){return new n(this.privacyMode)}isSame(e){return e===this?!0:e.privacyMode===this.privacyMode}}return n.TYPE_ID="707b4d61272448b5930800228a9bc16e",n})(),bg=class extends f{build(i,e){return Gd.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){return this.migrateEnum(e,"privacyMode",Do,Do.Private),e}},cS=(function(n){return n.Live="LIVE",n.Archived="ARCHIVED",n})(cS||{}
3),li=(function(n){return n.Precise="Precise",n.Approximate="Approximate",n.Minimal="Minimal",n})(li||{}),Fa=(()=>{class n extends b{constructor(e,t,s,a,o,u){super(),this.status=e,this.uniqueId=t,this.businessRef=s,this.names=a,this.mapLocation=o,this.displayMode=u}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static fromMap(e,t){return new n(y(r.get(t,"$status"),cS),r.get(t,"uniqueId"),j.mustDecode(r.get(t,"businessRef")),e.fromData(r.get(t,"names")),e.fromData(r.get(t,"mapLocation")),y(r.get(t,"displayMode"),li))}toMap(e){return{$status:m(this.status),uniqueId:this.uniqueId,businessRef:this.businessRef.encode(),names:e.toData(this.names),mapLocation:e.toData(this.mapLocation),displayMode:m(this.displayMode)}}clone(){return new n(this.status,this.uniqueId,this.businessRef.clone(),this.names.clone(),this.mapLocation.clone(),this.displayMode)}isSame(e){return e===this?!0:e.status===this.status&&e.uniqueId===this.uniqueId&&d(e.businessRef,this.businessRef)&&d(e.names,this.names)&&d(e.mapLocation,this.mapLocation)&&e.displayMode===this.displayMode}copyWith(e){var t,s,a,o,u,c;return new n((t=e.status)!==null&&t!==void 0?t:this.status,(s=e.uniqueId)!==null&&s!==void 0?s:this.uniqueId,(a=e.businessRef)!==null&&a!==void 0?a:this.businessRef.clone(),(o=e.names)!==null&&o!==void 0?o:this.names.clone(),(u=e.mapLocation)!==null&&u!==void 0?u:this.mapLocation.clone(),(c=e.displayMode)!==null&&c!==void 0?c:this.displayMode)}}return n.TYPE_ID="5c0d1bb1509a4e55867d7a09684bc3cb",n.SCHEMA_VERSION=2,n})(),Eg=class extends f{build(i,e){return Fa.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){var t;this.migrateEnum(e,"displayMode",li,li.Precise);let s=r.getVersionRange(e);if(s.contains(Fa.SCHEMA_VERSION))return e;if(s.isGreaterThan(Fa.SCHEMA_VERSION))return null;let a=s.to;return a<2&&((t=e.displayMode)!==null&&t!==void 0||(e.displayMode=m(li.Precise)),a=2),e.$schema_version=D.encodedExactly(a),e}},_t=(()=>{class n extends G{constructor(e,t,s,a,o,u){super(),this.uniqueId=e,this.businessRef=t,this.names=s,this.mapLocation=a,this.status=o,this.displayMode=u}static fromPlace(e){return new n(e.uniqueId,e.businessRef.clone(),e.names.clone(),e.mapLocation.clone(),e.status,e.displayMode)}get $removable(){return!1}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.get(t,"uniqueId"),j.mustDecode(r.get(t,"businessRef")),e.fromData(r.get(t,"names")),e.fromData(r.get(t,"mapLocation")),y(r.get(t,"$status"),cS),y(r.get(t,"displayMode"),li))}toMap(e){return{uniqueId:this.uniqueId,businessRef:this.businessRef.encode(),names:e.toData(this.names),mapLocation:e.toData(this.mapLocation),$status:m(this.status),displayMode:m(this.displayMode)}}clone(){return new n(this.uniqueId,this.businessRef.clone(),this.names.clone(),this.mapLocation.clone(),this.status,this.displayMode)}copyWith({uniqueId:e=this.uniqueId,businessRef:t=this.businessRef,names:s=this.names,mapLocation:a=this.mapLocation,status:o=this.status,displayMode:u=this.displayMode}={}){return new n(e,t,s,a,o,u)}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&d(e.businessRef,this.businessRef)&&d(e.names,this.names)&&d(e.mapLocation,this.mapLocation)&&e.status===this.status&&e.displayMode===this.displayMode}}return n.TYPE_ID="38d48f5c30744c1ba3b02051fa4799d9",n})(),wg=class extends f{build(i,e){return _t.fromMap(i,e)}},us=(()=>{class n extends G{constructor(e){super(),this.place=e}get $removable(){return!1}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(e.fromData(r.get(t,"place")))}toMap(e){return{place:e.toData(this.place)}}clone(){return new n(this.place.clone())}isSame(e){return e===this?!0:d(e.place,this.place)}}return n.TYPE_ID="e209ed5dcc1144a89f45fb1507b0d10d",n})(),Sg=class extends f{build(i,e){return us.fromMap(i,e)}},Ru=(()=>{class n extends G{constructor(e,t,s){super(),this.facebookPixelId=e,this.tikTokPixelId=t,this.googleTagManagerId=s}get $removable(){return!1}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(2,n.SCHEMA_VERSION)}static fromMap(e,t){return new n(r.get(t,"facebookPixelId"),r.get(t,"tikTokPixelId"),r.get(t,"googleTagManagerId"))}toMap(e){return{facebookPixelId:this.facebookPixelId,tikTokPixelId:this.tikTokPixelId,googleTagManagerId:this.googleTagManagerId}}clone(){return new n(this.facebookPixelId,this.tikTokPixelId,this.googleTagManagerId)}isSame(e){return e===this?!0:e.facebookPixelId==this.facebookPixelId&&e.tikTokPixelId==this.tikTokPixelId&&e.googleTagManagerId==this.googleTagManagerId}}return n.TYPE_ID="f21ba80ed75b40dabb4d366fc23bafe5",n.SCHEMA_VERSION=3,n})(),Tg=class extends f{build(i,e){return Ru.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){var t,s,a;let o=r.getVersionRange(e);if(o.contains(Ru.SCHEMA_VERSION))return e;if(o.isGreaterThan(Ru.SCHEMA_VERSION))return null;let u=o.to;return u<2&&((t=e.facebookPixelId)!==null&&t!==void 0||(e.facebookPixelId=r.get(e,"pixelId")),(s=e.tikTokPixelId)!==null&&s!==void 0||(e.tikTokPixelId=""),u=2),u<3&&((a=e.googleTagManagerId)!==null&&a!==void 0||(e.googleTagManagerId=""),u=3),e.$schema_version=D.encodedExactly(u),e}},lS=(()=>
3{class n extends G{constructor(e,t){super(),this.maxModifierPercentage=e,this.maxModifierPrice=t}get $removable(){return!1}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.getOrNull(t,"maxModifierPercentage"),Y.decodeOrNull(r.getOrNull(t,"maxModifierPrice")))}toMap(e){var t,s;return{maxModifierPercentage:this.maxModifierPercentage,maxModifierPrice:(s=(t=this.maxModifierPrice)===null||t===void 0?void 0:t.encode())!==null&&s!==void 0?s:null}}clone(){var e,t;return new n(this.maxModifierPercentage,(t=(e=this.maxModifierPrice)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null)}isSame(e){return e===this?!0:e.maxModifierPercentage===this.maxModifierPercentage&&d(e.maxModifierPrice,this.maxModifierPrice)}}return n.TYPE_ID="929c51eb09c247c5860597e2c27d8152",n})(),Og=class extends f{build(i,e){return lS.fromMap(i,e)}},Mu=(()=>{class n extends G{constructor(e,t,s){super(),this.organizationLogo=e,this.eventRules=t,this.organizationDetails=s}get $removable(){return!1}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}static fromMap(e,t){return new n(e.fromDataOrNull(r.getOrNull(t,"organizationLogo")),r.get(t,"eventRules"),r.get(t,"organizationDetails"))}toMap(e){return{organizationLogo:e.toDataOrNull(this.organizationLogo),eventRules:this.eventRules,organizationDetails:this.organizationDetails}}clone(){var e,t;return new n((t=(e=this.organizationLogo)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null,this.eventRules,this.organizationDetails)}isSame(e){return e===this?!0:d(e.organizationLogo,this.organizationLogo)&&e.eventRules==this.eventRules&&e.organizationDetails==this.organizationDetails}}return n.TYPE_ID="5500e8f4fdc944b0b10ff12faebce135",n.SCHEMA_VERSION=4,n})(),Rg=class extends f{build(i,e){return Mu.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){var t,s,a;let o=r.getVersionRange(e);if(o.contains(Mu.SCHEMA_VERSION))return e;if(o.isGreaterThan(Mu.SCHEMA_VERSION))return null;let u=o.to;return u<2&&(u=2),u<3&&((t=e.importantInfo)!==null&&t!==void 0||(e.importantInfo=""),(s=e.organizationDetails)!==null&&s!==void 0||(e.organizationDetails=""),u=3),u<4&&((a=e.eventRules)!==null&&a!==void 0||(e.eventRules=e.importantInfo),u=4),e.$schema_version=D.encodedExactly(u),e}},ZR=(()=>{class n extends G{constructor(e){super(),this.categories=e}get $removable(){return!1}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.categories)}static empty(){return new n(new Array)}static fromMap(e,t){return new n(r.getList(t,"categories",s=>e.fromData(s)))}toMap(e){return{categories:this.categories.map(t=>e.toData(t))}}clone(){return new n(ue(this.categories))}isSame(e){return e===this?!0:P(e.categories,this.categories,(t,s)=>d(t,s))}}return n.TYPE_ID="dda1c6a088a04c2c9c7298e9eb381d28",n})(),Mg=class extends f{build(i,e){return ZR.fromMap(i,e)}},cs=(()=>{class n extends G{constructor(e,t){super(),this.tickets=e,this.showSellingCountdown=t}get $removable(){return!1}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static empty(){return new n([],!1)}static fromMap(e,t){return new n(r.getList(t,"tickets",s=>e.fromData(s)),r.getBoolean(t,"showSellingCountdown"))}toMap(e){return{tickets:this.tickets.map(t=>e.toData(t)),showSellingCountdown:this.showSellingCountdown}}clone(){return new n(ue(this.tickets),this.showSellingCountdown)}isSame(e){return e===this?!0:P(e.tickets,this.tickets)&&e.showSellingCountdown===this.showSellingCountdown}}return n.TYPE_ID="28485ac7cad4438f849aa9085bfc8a6a",n.SCHEMA_VERSION=2,n})(),Ng=class extends f{build(i,e){return cs.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){var t;let s=r.getVersionRange(e);if(s.contains(cs.SCHEMA_VERSION))return e;if(s.isGreaterThan(cs.SCHEMA_VERSION))return null;let a=s.to;return a<2&&((t=e.showSellingCountdown)!==null&&t!==void 0||(e.showSellingCountdown=!1),a=2),e.$schema_version=D.encodedExactly(a),e}},dS=(()=>{class n extends G{constructor(e){super(),this.products=e}get $removable(){return!1}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.getList(t,"products",s=>e.fromData(s)))}toMap(e){return{products:this.products.map(t=>e.toData(t))}}clone(){return new n(ue(this.products))}isSame(e){return e===this?!0:P(e.products,this.products)}}return n.TYPE_ID="421a3d2bdecc4a0881db2dbcd190406e",n})(),Pg=class extends f{build(i,e){return dS.fromMap(i,e)}},XR=(()=>{class n extends G{constructor(e,t){super(),this.accountSettings=e,this.programSettings=t}get $removable(){return!0}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.accountSettings,e.programSettings)}static fromMap(e,t){return new n(e.fromData(r.get(t,"accountSettings")),e.fromData(r.get(t,"programSettings")))}toMap(e){return{accountSettings:e.toData(this.accountSettings),programSettings:e.toData(this.programSettings)}}clone(){return new n(this.accountSettings.clone(),this.programSettings.clone())}isSame(e){return e===this?!0:d(e.accountSettings,this.accountSettings)&&d(e.programSettings,this.programSettings)}}return n.TYPE_ID="47b820e800554d118ea846292470687e",n})(),Ag=class extends f{build(i,e){return XR.fromMap(i,e)}},hS=(()=>{class n extends G{constructor(e){super(),this.event=e}get $typeId(){return n.TYPE_ID}get $removable(){return!1}static create(e){return new n(e.event)}static fromMap(e,t){return new n(e.fromData(r.get(t,"event")))}toMap(e){return{event:e.toData(this.event)}}clone(){return new n(this.event.clone())}isSame(e){return e===this?!0:d(e.event,this.event)}}return n.TYPE_ID="b4d8d90de71d4dcca0b004da29385057",n})(),Cg=class extends f{build(i,e){return hS.fromMap(i,e)}},QR=(()=>{class n extends G{constructor(e){super(),this.openTime=e}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}get $removable(){return!0}static fromMap(e,t){return new n(e.decodeDate(r.get(t,"openTime")))}toMap(e){return{openTime:e.encodeDate(this.openTime)}}clone(){return new n(g.cloneDate(this.openTime))}isSame(e){return this===e?!0:e.openTime===this.openTime}}return n.TYPE_ID="ff9e73a42c0b47cd91dd5537261763a2",n.SCHEMA_VERSION=1,n})(),kg=class extends f{build(i,e){return QR.fromMap(i,e)}},_s=(function(n){return n.Other="OTHER",n.Theater="THEATER",n.Comedy="COMEDY",n.Concert="CONCERT",n.Festival="FESTIVA
3L",n.Party="PARTY",n.PerformanceEvening="PERFORMANCE_EVENING",n.Sport="SPORT",n.Performance="PERFORMANCE",n.Gastro="GASTRO",n})(_s||{}),Ir=class n{constructor(i,e){this.isFeatured=i,this.featuredScore=e}static create(i){return new n(i.isFeatured,i.featuredScore)}static empty(){return this.create({isFeatured:!1,featuredScore:0})}static fromMap(i){return this.create({isFeatured:r.getBoolean(i,"isFeatured"),featuredScore:r.getDouble(i,"featuredScore")})}toMap(){return{isFeatured:this.isFeatured,featuredScore:this.featuredScore}}copyWith({isFeatured:i=this.isFeatured,featuredScore:e=this.featuredScore}={}){return n.create({isFeatured:i,featuredScore:e})}clone(){return this.copyWith()}isSame(i){return i===this?!0:i.isFeatured===this.isFeatured&&i.featuredScore===this.featuredScore}},Dr=(()=>{class n extends G{constructor(e,t,s){super(),this.defaultPriority=e,this.partnerPriorities=t,this.classification=s}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}get $removable(){return!1}isFeatured(e){return this.getPartnerPriorityOrDefault(e).isFeatured}featuredScore(e){return this.getPartnerPriorityOrDefault(e).featuredScore}getPartnerPriorityOrDefault(e){var t;let s=null;return e&&(s=(t=this.partnerPriorities.get(e))!==null&&t!==void 0?t:null),s??(s=this.defaultPriority),s}static create(e){return new n(e.defaultPriority,e.partnerPriorities,e.classification)}static empty(){return this.create({defaultPriority:Ir.create({isFeatured:!1,featuredScore:0}),partnerPriorities:new Map,classification:[]})}static fromMap(e,t){return this.create({defaultPriority:Ir.fromMap(r.getRecord(t,"defaultPriority")),partnerPriorities:r.getMap(t,"partnerPriorities",(s,a)=>({key:s,value:Ir.fromMap(K.decodeRecord(a))})),classification:r.getList(t,"classification",s=>y(K.decodeString(s),_s))})}toMap(e){return{defaultPriority:this.defaultPriority.toMap(),partnerPriorities:se(this.partnerPriorities,(t,s)=>({key:t,value:s.toMap()})),classification:this.classification.map(t=>m(t))}}copyWith({defaultPriority:e=this.defaultPriority,partnerPriorities:t=ee(this.partnerPriorities,a=>a.clone()),classification:s=Te(this.classification)}={}){return n.create({defaultPriority:e,partnerPriorities:t,classification:s})}copyWithPartnerPriority(e,t){var s;let a=(s=this.partnerPriorities.get(e))!==null&&s!==void 0?s:null,o=t(a),u=ee(this.partnerPriorities,c=>c.clone());return o?u.set(e,o):u.delete(e),this.copyWith({partnerPriorities:u})}clone(){return this.copyWith()}isSame(e){return e===this?!0:d(e.defaultPriority,this.defaultPriority)&&re(e.partnerPriorities,this.partnerPriorities,d)&&P(e.classification,this.classification)}}return n.TYPE_ID="dd3cd833d7a740c78f07780a47f9dc64",n.SCHEMA_VERSION=2,n})(),_g=class extends f{build(i,e){return Dr.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){this.migrateEnumList(e,"classification",_s);let t=r.getVersionRange(e);if(t.contains(Dr.SCHEMA_VERSION))return e;if(t.isGreaterThan(Dr.SCHEMA_VERSION))return null;let s=t.to;if(s<2){let a=r.getBoolean(e,"isFeatured",!1),o=r.getDouble(e,"featuredScore",0),u=Ir.create({isFeatured:a,featuredScore:o});r.setIfNullOrUndefined(e,"defaultPriority",u.toMap()),r.setIfNullOrUndefined(e,"partnerPriorities",{}),s=2}return e.$schema_version=D.encodedExactly(s),e}migrateFromCurrentSchemaVersion(i,e,t){let s=e.$schemaVersion.to;if(s>=2){if(e.partnerPriorities.size>0)return t;r.set(t,"isFeatured",e.defaultPriority.isFeatured),r.set(t,"featuredScore",e.defaultPriority.featuredScore),delete t.defaultPriority,delete t.partnerPriorities,s=1,t.$schema_version=D.encodedExactly(s)}return t}},eM=(()=>{class n extends G{constructor(e){super(),this.settings=e}get $typeId(){return n.TYPE_ID}get $removable(){return!1}static create(e){return new n(e.settings)}static fromMap(e,t){return n.create({settings:t.fromData(r.getRecord(e,"settings"))})}toMap(e){return{settings:e.toData(this.settings)}}clone(){return new n(this.settings.clone())}isSame(e){return e===this?!0:d(e.settings,this.settings)}}return n.TYPE_ID="ca40f6f3c5684ffeabb830def9789fe6",n})(),xg=class extends f{build(i,e){return eM.fromMap(e,i)}},ni=(function(n){return n.DateTime="DateTime",n.DateOnly="DateOnly",n.Soon="Soon",n})(ni||{}),ir=(()=>{class n extends G{constructor(e){super(),this.format=e}get $removable(){return!0}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}static fromMap(e,t){return new n(y(r.getString(t,"format"),ni))}toMap(e){return{format:m(this.format)}}clone(){return new n(this.format)}isSame(e){return e===this?!0:e.format===this.format}}return n.TYPE_ID="045594ad70bb4745961ef20ea6784dfd",n.SCHEMA_VERSION=2,n})(),Fg=class extends f{build(i,e){return ir.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){var t;this.migrateEnum(e,"format",ni,ni.DateTime);let s=r.getVersionRange(e);if(s.contains(ir.SCHEMA_VERSION))return e;if(s.isGreaterThan(ir.SCHEMA_VERSION))return null;let a=s.to;return a<2&&((t=e.format)!==null&&t!==void 0||(e.format=r.getBoolean(e,"showTime")?m(ni.DateTime):m(ni.DateOnly)),a=2),e.$schema_version=D.encodedExactly(a),e}migrateFromCurrentSchemaVersion(i,e,t){var s;let a=(s=e.$schemaVersion.to)!==null&&s!==void 0?s:ir.SCHEMA_VERSION;return a>=2&&(a=1,t.showTime=e.format!==ni.DateOnly,t.$schema_version=D.encodedBetween(1,2)),t}},tM=(()=>{class n extends G{constructor(e){super(),this.image=e}get $removable(){return!0}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(e.fromData(r.get(t,"image")))}toMap(e){return{image:e.toData(this.image)}}clone(){return new n(this.image.clone())}isSame(e){return e===this?!0:d(e.image,this.image)}}return n.TYPE_ID="95a2440cb0954b3d9e3b84fb2b7f7d51",n})(),qg=class extends f{build(i,e){return tM.fromMap(i,e)}},nM=(()=>{class n extends G{constructor(e){super(),this.customInfo=e}get $removable(){return!0}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(e.fromData(r.get(t,"customInfo")))}toMap(e){return{customInfo:e.toData(this.customInfo)}}clone(){return new n(this.customInfo.clone())}isSame(e){return e===this?!0:d(e.customInfo,this.customInfo)}}return n.TYPE_ID="f50b6b4c137047e68d5d2c32b8a3b3a0",n})(),Yg=class extends f{build(i,e){return nM.fromMap(i,e)}},fS=(()=>{class n extends G{constructor(e){super(),this.solver=e}get $typeId(){return n.TYPE_ID}get $removable(){return!0}static create(e){return new n(e.solver)}static fromMap(e,t){return new n(r.get(t,"solver"))}toMap(e){return{solver:this.solver}}clone(){return new n(this.solver)}isSame(e){return this===e?!0:e.solver===this.solver}}return n.TYPE_ID="8dfdce19bccf407fb4382cce8d65303f",n})(),$g=class extends f{build(i,e){return fS.fromMap(i,e)}},pS=(function(n){return n.PublicBath="KOZFURDO",n.NaturalBath="TERMESZETES_FURDO",n.MuseumFortressCastle="MUZEUM_VAR_KASTELY",n.TouristTransport="TURISZTIKAI_KOZLEKEDES",n.AdventurePark="KALANDPARK",n.Zoo="ALLATKERT",n.AmusementPark="VIDAMPARK",n.NaturalReserve="VEDETT_TERMESZETI_TERULET",n.MusicDanceEvent="ZENES_TANCOS_RENDEZVENY",n})(pS||{}),gS=(function(n){return n.GuidedTour="TARLATVEZETES",n.EducationalProgram="OKTATASI_PROGRAM",n.Bath="FURDO_PROGRAM",n.Beach="STRAND_PROGRAM",n.SwimmingPool="USZODAI_PROGRAM",n.Wellness="WELLNESS_PROGRAM",n.Health="EGESZSEGUGYI_SZOLGALTATAS",n.OpenWaterBeach="SZABADVIZI_STRAND_PROGRAM",n.Exhibition="KIALLITAS",n.MuseumPedagogy="MUZEUMPEDAGOGIA",n.ChurchEstablishmentVisit="EGYHAZI_LETESITMENY_LATOGATASA",n.CastleVisit="KASTELYLATOGATAS",n.FortressVisit="VARLATOGATAS",n.OtherMonumentVisit="EGYEB_MUEMLEK_LATOGATASA",n.LakeBoating="TAVI_HAJOZAS",n.RiverBoating="FOLYAMI_HAJOZAS",n.HopOnHopOff="HOP_ON_HOP_OFF",n.AdventureParkProgram="KALANDPARKI_PROGRAM",n.ExperienceCenterProgram="ELMENYKOZPONTI_PROGRAM",n.ZooProgram="ALLATKERTI_PROGRAM",n.WildlifeParkProgram="VADASPARKI_PROGRAM",n.AmusementParkProgram="VIDAMPARKI_PROGRAM",n.NationalParkVisit="NEMZETI_PARK_LATOGATAS",n.CaveVisit="BARLANGLATOGATAS",n.ParkVisit="PARKLATOGATAS",n.ThematicExhibitionVisit="TEMATIKUS_BEMUTATOHELY_LATOGATAS",n.ToursTrips="TURAK_KIRANDULASOK",n.CulturalEvent="KULTURALIS_RENDEZVENY",n.Concert="KONCERT",n.Festival="FESZTIVAL",n})(gS||{}),iM=(function(n){return n.Constant="ALLANDO",n.OneTime="EGYSZERI",n.FewOccasions="NEHANY_ALKALMAS",n.Intermittent="IDOSZAKOS",n.SystematicallyRepeating="RENDSZERES_ISMETLODO",n})(iM||{}),sM=(function(n){return n.Standalone="ONALLO_PROGRAM",n.PartOfASeries="PROGRAMSOROZAT_RESZE",n.Combined="KOMBINALT_PROGRAM",n})(sM||{}),rM=(()=>{class n extends b{constructor(e,t,s,a,o,u){super(),this.mainCategory=e,this.subCategory=t,this.frequency=s,this.type=a,this.nameOfSeries=o,this.canonicalId=u}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.mainCategory,e.subCategory,e.frequency,e.type,e.nameOfSeries,e.canonicalId)}static fromMap(e,t){return new n(y(r.get(t,"mainCategory"),pS),y(r.get(t,"subCategory"),gS),y(r.get(t,"frequency"),iM),y(r.get(t,"type"),sM),r.getOrNull(t,"nameOfSeries"),r.getOrNull(t,"canonicalId"))}toMap(e){return{mainCategory:m(this.mainCategory),subCategory:m(this.subCategory),frequency:m(this.frequency),type:m(this.type),nameOfSeries:this.nameOfSeries,canonicalId:this.canonicalId}}clone(){return new n(this.mainCategory,this.subCategory,this.frequency,this.type,this.nameOfSeries,this.canonicalId)}isSame(e){return e===this?!0:e.mainCategory===this.mainCategory&&e.subCategory===this.subCategory&&e.frequency===this.frequency&&e.type===this.type&&e.nameOfSeries===this.nameOfSeries&&e.canonicalId===this.canonicalId}}return n.TYPE_ID="ca3aacd982b44ae9a1ac3bd076c1125f",n})(),Lg=class extends f{build(i,e){return rM.fromMap(i,e)}},aM=(()=>{class n extends G{constructor(e,t,s){super(),this.mainCategory=e,this.subCategory=t,this.serviceLocationId=s}get $typeId(){return n.TYPE_ID}get $removable(){return!0}static create(e){return new n(e.mainCategory,e.subCategory,e.serviceLocationId)}static fromMap(e,t){return new n(y(r.getString(t,"mainCategory"),pS),y(r.getString(t,"subCategory"),gS),r.getString(t,"serviceLocationId"))}toMap(e){return{mainCategory:m(this.mainCategory),subCategory:m(this.subCategory),serviceLocationId:this.serviceLocationId}}clone(){return this.copyWith()}copyWith({mainCategory:e=this.mainCategory,subCategory:t=this.subCategory,serviceLocationId:s=this.serviceLocationId}={}){return n.create({mainCategory:e,subCategory:t,serviceLocationId:s})}isSame(e){return e===this?!0:e.mainCategory===this.mainCategory&&e.subCategory===this.subCategory&&e.serviceLocationId===this.serviceLocationId}}return n.TYPE_ID="19065ea6c63144d7a82e0684f3e52ea4",n})(),Vg=class extends f{build(i,e){return aM.fromMap(i,e)}},vr=(()=>{class n extends G{constructor(e,t=null){super(),this.url=e,this.freeEventUrl=t}get $removable(){return!0}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static fromMap(e,t){return new n(r.getString(t,"url"),r.getStringOrNull(t,"freeEventUrl"))}toMap(e){return{url:this.url,freeEventUrl:this.freeEventUrl}}clone(){return new n(this.url,this.freeEventUrl)}isSame(e){return e===this?!0:e.url===this.url&&e.freeEventUrl===this.freeEventUrl}}return n.TYPE_ID="b52c651f66b24913b03270c9c73c286b",n.SCHEMA_VERSION=2,n})(),zg=class extends f{build(i,e){return vr.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(vr.SCHEMA_VERSION))return e;if(t.isGreaterThan(vr.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(s=2),e.$schema_version=D.encodedExactly(s),e}},Nu=(()=>{class n extends G{constructor(e,t){super(),this.templateId=e,this.variationId=t}get $removable(){return!1}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static fromMap(e,t){return new n(r.getString(t,"templateId"),r.getStringOrNull(t,"variationId"))}toMap(e){return{templateId:this.templateId,variationId:this.variationId}}clone(){return new n(this.templateId,this.variationId)}isSame(e){return e===this?!0:e.templateId===this.templateId&&e.variationId===this.variationId}}return n.TYPE_ID="54c806a1adf1465ab6c657ebf907b760",n.SCHEMA_VERSION=2,n})(),Ug=class extends f{build(i,e){return Nu.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(Nu.SCHEMA_VERSION))return e;if(t.isGreaterThan(Nu.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(s=2),e.$schema_version=D.encodedExactly(s),e}},oM=(()=>{class n extends G{constructor(e,t,s,a){super(),this.title=e,this.description=t,this.acceptButtonLabel=s,this.declineButtonLabel=a}get $removable(){return!1}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(e.fromData(r.get(t,"title")),e.fromData(r.get(t,"description")),e.fromData(r.get(t,"acceptButtonLabel")),e.fromData(r.get(t,"declineButtonLabel")))}toMap(e){return{title:e.toData(this.title),description:e.toData(this.description),acceptButtonLabel:e.toData(this.acceptButtonLabel),declineButtonLabel:e.toData(this.declineButtonLabel)}}clone(){return new n(this.title.clone(),this.description.clone(),this.acceptButtonLabel.clone(),this.declineButtonLabel.clone())}isSame(e){return e===this?!0:d(e.title,this.title)&&d(e.description,this.description)&&d(e.acceptButtonLabel,this.acceptButtonLabel)&&d(e.declineButtonLabel,this.declineButtonLabel)}}return n.TYPE_ID="80984e4dbb104ddc89c350c500d0e90c",n})(),Bg=class extends f{build(i,e){return oM.fromMap(i,e)}},uM=(()=>{class n extends G{constructor(e){super(),this.calendarEntry=e}get $removable(){return!1}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(e.fromData(r.get(t,"calendarEntry")))}toMap(e){return{calendarEntry:e.toData(this.calendarEntry)}}clone(){return new n(this.calendarEntry.clone())}isSame(e){return e===this?!0:d(e.calendarEntry,this.calendarEntry)}copyWithBusinessRef(e){return new n(this.calendarEntry.copyWithBusinessRef(e))}}return n.TYPE_ID="b782326375794de3bb24f585daa836ce",n})(),Hg=class extends f{build(i,e){return uM.fromMap(i,e)}},mS=(()=>{class n extends lo{constructor(e){super(e)}get $typeId(){return n.TYPE_ID}get $removable(){return!1}static fromMap(e,t){return new n(r.get(t,"note"))}toMap(e){return{note:this.note}}clone(){return new n(this.note)}isSame(e){return this===e?!0:e.note===this.note}}return n.TYPE_ID="8ba401dc1ccd487d997d1647a193158d",n})(),Gg=class extends f{build(i,e){return mS.fromMap(i,e)}},cM=(()=>{class n extends G{constructor(e){super(),this.voucher=e}get $typeId(){return n.TYPE_ID}get $removable(){return!1}static create(e){return new n(e.voucher)}static fromMap(e,t){return this.create({voucher:e.fromData(r.getRecord(t,"voucher"))})}toMap(e){return{voucher:e.toData(this.voucher)}}clone(){return n.create({voucher:F(this.voucher)})}isSame(e){return e===this?!0:d(e.voucher,this.voucher)}}return n.TYPE_ID="b65713254e6e41a0aec400cf52b38650",n})(),Wg=class extends f{build(i,e){return cM.fromMap(i,e)}},lM=(()=>{class n extends G{constructor(e,t){super(),this.vouchers=e,this.openAccessPasses=t}get $typeId(){return n.TYPE_ID}get $removable(){return!1}static create(e){return new n(e.vouchers,e.openAccessPasses)}static fromMap(e,t){return this.create({vouchers:r.getList(t,"vouchers",s=>e.fromData(K.decodeRecord(s))),openAccessPasses:r.getList(t,"openAccessPasses",s=>e.fromData(K.decodeRecord(s)))})}toMap(e){return{vouchers:this.vouchers.map(t=>e.toData(t)),openAccessPasses:this.openAccessPasses.map(t=>e.toData(t))}}clone(){return n.create({vouchers:ue(this.vouchers),openAccessPasses:ue(this.openAccessPasses)})}isSame(e){return e===this?!0:P(e.vouchers,this.vouchers,d)&&P(e.openAccessPasses,this.openAccessPasses,d)}}return n.TYPE_ID="d1b0f3afa2d54b25a9811578ba0da06f",n})(),jg=class extends f{build(i,e){return lM.fromMap(i,e)}},Wd=(()=>{class n extends b{constructor(e){super(),this.localizedPhoto=e}get $typeId(){return n.TYPE_ID}get isEmpty(){return!this.isNotEmpty}get isNotEmpty(){return this.localizedPhoto.size>0}static empty(){return new n(new Map)}get(e){var t;return(t=this.localizedPhoto.get(e))!==null&&t!==void 0?t:null}getAny(e=null){return Pr(this.localizedPhoto,e)}static fromMap(e,t){return new n(r.getMap(t,"localizedPhoto",(s,a)=>({key:s,value:e.fromData(a)})))}toMap(e){return{localizedPhoto:se(this.localizedPhoto,(t,s)=>({key:t.toString(),value:e.toData(s)}))}}
3clone(){return new n(ee(this.localizedPhoto))}isSame(e){return e===this?!0:re(e.localizedPhoto,this.localizedPhoto)}}return n.TYPE_ID="5d4f1eff83bd441b853e4ca0aaaf94b0",n})(),Jg=class extends f{build(i,e){return Wd.fromMap(i,e)}},dM=(()=>{class n extends Be{constructor(e,t,s,a=null,o=null,u,c){super(),this.titles=e,this.descriptions=t,this.photos=s,this.businessId=a,this.dynamicLink=o,this.renderOrder=u,this.isRenderingEnabled=c}get $removable(){return!0}get $typeId(){return n.TYPE_ID}static empty(e=this.DEFAULT_RENDER_ORDER){return new n(Oe.empty(),Oe.empty(),Wd.empty(),null,null,e,!0)}static fromMap(e,t){return new n(e.fromData(r.get(t,"titles")),e.fromData(r.get(t,"descriptions")),e.fromData(r.get(t,"photos")),r.getOrNull(t,"businessId"),r.getOrNull(t,"dynamicLink"),r.get(t,"renderOrder"),r.get(t,"isRenderingEnabled"))}toMap(e){return{titles:e.toData(this.titles),descriptions:e.toData(this.descriptions),photos:e.toData(this.photos),businessId:this.businessId,dynamicLink:this.dynamicLink,renderOrder:this.renderOrder,isRenderingEnabled:this.isRenderingEnabled}}clone(){return new n(this.titles.clone(),this.descriptions.clone(),this.photos.clone(),this.businessId,this.dynamicLink,this.renderOrder,this.isRenderingEnabled)}isSame(e){return e===this?!0:d(e.titles,this.titles)&&d(e.descriptions,this.descriptions)&&d(e.photos,this.photos)&&e.businessId===this.businessId&&e.dynamicLink===this.dynamicLink&&e.renderOrder===this.renderOrder&&e.isRenderingEnabled===this.isRenderingEnabled}}return n.TYPE_ID="cdc7908f88fa4f64aacc5940f852ee29",n.DEFAULT_RENDER_ORDER=0,n})(),Kg=class extends f{build(i,e){return dM.fromMap(i,e)}},hM=(()=>{class n extends Be{constructor(e,t,s,a,o){super(),this.eventId=e,this.eventWebRoute=t,this.ticketRefs=s,this.renderOrder=a,this.isRenderingEnabled=o}get $typeId(){return n.TYPE_ID}get $removable(){return!0}static fromMap(e,t){return new n(r.get(t,"eventId"),r.get(t,"eventWebRoute"),r.getList(t,"ticketRefs",s=>e.fromData(s)),r.get(t,"renderOrder"),r.get(t,"isRenderingEnabled"))}toMap(e){return{eventId:this.eventId,eventWebRoute:this.eventWebRoute,ticketRefs:this.ticketRefs.map(t=>e.toData(t)),renderOrder:this.renderOrder,isRenderingEnabled:this.isRenderingEnabled}}clone(){return new n(this.eventId,this.eventWebRoute,this.ticketRefs.map(e=>e.clone()),this.renderOrder,this.isRenderingEnabled)}isSame(e){return this===e?!0:e.eventId===this.eventId&&e.eventWebRoute===this.eventWebRoute&&P(e.ticketRefs,this.ticketRefs)&&e.renderOrder===this.renderOrder&&e.isRenderingEnabled===this.isRenderingEnabled}}return n.TYPE_ID="d1f9270cde2f41a49aae79935c51a23a",n.DEFAULT_RENDER_ORDER=16,n})(),Zg=class extends f{build(i,e){return hM.fromMap(i,e)}},dn=(()=>{class n extends Be{constructor(e,t,s){super(),this.dateSpan=e,this.renderOrder=t,this.isRenderingEnabled=s}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}get $removable(){return!0}static fromMap(e,t){return new n(e.fromData(r.get(t,"dateSpan")),r.get(t,"renderOrder"),r.get(t,"isRenderingEnabled"))}toMap(e){return{dateSpan:e.toData(this.dateSpan),renderOrder:this.renderOrder,isRenderingEnabled:this.isRenderingEnabled}}clone(){return new n(this.dateSpan.clone(),this.renderOrder,this.isRenderingEnabled)}isSame(e){return this===e?!0:d(e.dateSpan,this.dateSpan)&&e.renderOrder===this.renderOrder&&e.isRenderingEnabled===this.isRenderingEnabled}}return n.TYPE_ID="aca080eb34c74fab90f19e48725a271d",n.SCHEMA_VERSION=3,n.DEFAULT_RENDER_ORDER=5,n})(),Xg=class extends f{build(i,e){return dn.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(dn.SCHEMA_VERSION))return e;if(t.isGreaterThan(dn.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(r.setIfNullOrUndefined(e,"isPublic",!1),s=2),s<3&&(r.setIfNullOrUndefined(e,"renderOrder",dn.DEFAULT_RENDER_ORDER),r.setIfNullOrUndefined(e,"isRenderingEnabled",!0),s=3),e.$schema_version=D.encodedExactly(s),e}},fM=(()=>{class n extends G{constructor(e){super(),this.difficulty=e}get $typeId(){return n.TYPE_ID}get $removable(){return!0}static fromMap(e,t){return new n(r.get(t,"difficulty"))}toMap(e){return{difficulty:this.difficulty}}clone(){return new n(this.difficulty)}isSame(e){return this===e?!0:e.difficulty===this.difficulty}}return n.TYPE_ID="d7ba1b6518864549ac6f070cb2614bfa",n})(),Qg=class extends f{build(i,e){return fM.fromMap(i,e)}},pM=(()=>{class n extends G{constructor(e){super(),this.distance=e}get $typeId(){return n.TYPE_ID}get $removable(){return!0}static fromMap(e,t){return new n(r.get(t,"distance"))}toMap(e){return{distance:this.distance}}clone(){return new n(this.distance)}isSame(e){return this===e?!0:e.distance===this.distance}}return n.TYPE_ID="02001e2d94bd460eaadcb605ce9bc00f",n})(),em=class extends f{build(i,e){return pM.fromMap(i,e)}},gM=(()=>{class n extends G{constructor(e){super(),this.duration=e}get $typeId(){return n.TYPE_ID}get $removable(){return!0}static fromMap(e,t){return new n(e.decodeDuration(r.get(t,"duration")))}toMap(e){return{duration:e.encodeDuration(this.duration)}}clone(){return new n(this.duration)}isSame(e){return this===e?!0:e.duration===this.duration}}return n.TYPE_ID="a051b640d4c94f8c8c426f0800571b32",n})(),tm=class extends f{build(i,e){return gM.fromMap(i,e)}},mM=(()=>{class n extends G{constructor(e){super(),this.elevation=e}get $typeId(){return n.TYPE_ID}get $removable(){return!0}static fromMap(e,t){return new n(r.get(t,"elevation"))}toMap(e){return{elevation:this.elevation}}clone(){return new n(this.elevation)}isSame(e){return this===e?!0:e.elevation===this.elevation}}return n.TYPE_ID="01085a9cfe7f4f4ca36e58f7ffc67a6b",n})(),nm=class extends f{build(i,e){return mM.fromMap(i,e)}},IM=(()=>{class n extends Be{constructor(e,t,s,a,o,u,c,l){super(),this.tikTok=e,this.facebook=t,this.instagram=s,this.website=a,this.emailAddress=o,this.phoneNumber=u,this.isRenderingEnabled=c,this.renderOrder=l}get $typeId(){return n.TYPE_ID}get $removable(){return!0}static fromMap(e,t){return new n(e.fromData(r.get(t,"tikTok")),e.fromData(r.get(t,"facebook")),e.fromData(r.get(t,"instagram")),e.fromData(r.get(t,"website")),e.fromData(r.get(t,"emailAddress")),e.fromData(r.get(t,"phoneNumber")),r.get(t,"isRenderingEnabled"),r.get(t,"renderOrder"))}toMap(e){return{tikTok:e.toData(this.tikTok),facebook:e.toData(this.facebook),instagram:e.toData(this.instagram),website:e.toData(this.website),emailAddress:e.toData(this.emailAddress),phoneNumber:e.toData(this.phoneNumber),isRenderingEnabled:this.isRenderingEnabled,renderOrder:this.renderOrder}}clone(){return new n(this.tikTok.clone(),this.facebook.clone(),this.instagram.clone(),this.website.clone(),this.emailAddress.clone(),this.phoneNumber.clone(),this.isRenderingEnabled,this.renderOrder)}isSame(e){return this===e?!0:d(e.tikTok,this.tikTok)&&d(e.facebook,this.facebook)&&d(e.instagram,this.instagram)&&d(e.website,this.website)&&d(e.emailAddress,this.emailAddress)&&d(e.phoneNumber,this.phoneNumber)&&e.renderOrder===this.renderOrder&&e.isRenderingEnabled===this.isRenderingEnabled}}return n.TYPE_ID="3e66fd46ba984035b71e79229cf30fea",n})(),im=class extends f{build(i,e){return IM.fromMap(i,e)}},sm=(function(n){return n.None="None",n.SponsoredBy="SponsoredBy",n})(sm||{}),DM=(()=>{class n extends G{constructor(e=null){super(),this.tag=e??sm.None}get $removable(){return!0}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(Re(r.getOrNull(t,"tag"),sm))}toMap(e){return{tag:m(this.tag)}}clone(){return new n(this.tag)}isSame(e){return e===this?!0:e.tag===this.tag}}return n.TYPE_ID="79b3c2967ed347d387da5bcf3755fb0d",n})(),rm=class extends f{build(i,e){return DM.fromMap(i,e)}},vM=(()=>{class n extends Be{constructor(e,t,s,a,o,u){super(),this.titles=e,this.richDescriptions=t,this.isRenderingEnabled=s,this.renderOrder=a,this.formFields=o,this.destinationEmail=u}get $typeId(){return n.TYPE_ID}get $removable(){return!0}static fromMap(e,t){return new n(e.fromData(r.get(t,"titles")),e.fromData(r.get(t,"richDescriptions")),r.get(t,"isRenderingEnabled"),r.get(t,"renderOrder"),r.getList(t,"formFields",s=>e.fromData(s)),r.get(t,"destinationEmail"))}toMap(e){return{titles:e.toData(this.titles),richDescriptions:e.toData(this.richDescriptions),isRenderingEnabled:this.isRenderingEnabled,renderOrder:this.renderOrder,formFields:this.formFields.map(t=>
3e.toData(t)),destinationEmail:this.destinationEmail}}clone(){return new n(this.titles.clone(),this.richDescriptions.clone(),this.isRenderingEnabled,this.renderOrder,this.formFields.map(e=>e.clone()),this.destinationEmail)}isSame(e){return e===this?!0:d(e.titles,this.titles)&&d(e.richDescriptions,this.richDescriptions)&&e.renderOrder===this.renderOrder&&e.isRenderingEnabled===this.isRenderingEnabled&&P(e.formFields,this.formFields,d)&&e.destinationEmail==this.destinationEmail}}return n.TYPE_ID="aae52921419b4da5931b794a0c1f3aaf",n.DEFAULT_RENDER_ORDER=18,n})(),am=class extends f{build(i,e){return vM.fromMap(i,e)}},ma=(()=>{class n extends Be{constructor(e,t,s){super(),this.collection=e,this.renderOrder=t,this.isRenderingEnabled=s}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}get $removable(){return!0}static fromMap(e,t){return new n(e.fromData(r.get(t,"collection")),r.get(t,"renderOrder"),r.get(t,"isRenderingEnabled"))}toMap(e){return{collection:e.toData(this.collection),renderOrder:this.renderOrder,isRenderingEnabled:this.isRenderingEnabled}}clone(){var e,t;return new n((t=(e=this.collection)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null,this.renderOrder,this.isRenderingEnabled)}isSame(e){return this===e?!0:d(e.collection,this.collection)&&e.renderOrder===this.renderOrder&&e.isRenderingEnabled===this.isRenderingEnabled}}return n.TYPE_ID="f4b61437496e4f838ea7f6fc7037b070",n.SCHEMA_VERSION=2,n.DEFAULT_RENDER_ORDER=2,n})(),om=class extends f{build(i,e){return ma.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(ma.SCHEMA_VERSION))return e;if(t.isGreaterThan(ma.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(r.setIfNullOrUndefined(e,"renderOrder",ma.DEFAULT_RENDER_ORDER),r.setIfNullOrUndefined(e,"isRenderingEnabled",!0),s=2),e.$schema_version=D.encodedExactly(s),e}},Ia=(()=>{class n extends Be{constructor(e,t,s,a,o,u,c,l){super(),this.titles=e,this.descriptions=t,this.photos=s,this.labels=a,this.solver=o,this.renderOrder=u,this.isRenderingEnabled=c,this.overrideDefaultAction=l}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(4,n.SCHEMA_VERSION)}get $removable(){return!0}static fromMap(e,t){return new n(e.fromData(r.get(t,"titles")),e.fromData(r.get(t,"descriptions")),e.fromData(r.get(t,"photos")),e.fromData(r.get(t,"labels")),r.get(t,"solver"),r.get(t,"renderOrder"),r.get(t,"isRenderingEnabled"),r.get(t,"overrideDefaultAction"))}toMap(e){return{titles:e.toData(this.titles),descriptions:e.toData(this.descriptions),photos:e.toData(this.photos),labels:e.toData(this.labels),solver:this.solver,renderOrder:this.renderOrder,isRenderingEnabled:this.isRenderingEnabled,overrideDefaultAction:this.overrideDefaultAction}}clone(){return new n(this.titles.clone(),this.descriptions.clone(),this.photos.clone(),this.labels.clone(),this.solver,this.renderOrder,this.isRenderingEnabled,this.overrideDefaultAction)}isSame(e){return this===e?!0:d(e.titles,this.titles)&&d(e.descriptions,this.descriptions)&&d(e.photos,this.photos)&&d(e.labels,this.labels)&&e.solver===this.solver&&e.renderOrder===this.renderOrder&&e.isRenderingEnabled===this.isRenderingEnabled&&e.overrideDefaultAction===this.overrideDefaultAction}}return n.TYPE_ID="9e7ca9c2836d4dee95b603e6e3b5235e",n.SCHEMA_VERSION=5,n.DEFAULT_RENDER_ORDER=1,n})(),um=class extends f{build(i,e){return Ia.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){var t,s,a;let o=r.getVersionRange(e);if(o.contains(Ia.SCHEMA_VERSION))return e;if(o.isGreaterThan(Ia.SCHEMA_VERSION))return null;let u=o.to;if(u<2&&(r.setIfNullOrUndefined(e,"renderOrder",Ia.DEFAULT_RENDER_ORDER),r.setIfNullOrUndefined(e,"isRenderingEnabled",!0),u=2),u<3&&(r.setIfNullOrUndefined(e,"overrideDefaultAction",!1),u=3),u<4){let c=r.getMap(e,"labels",(l,h)=>({key:y(l,$),value:h}));e.labels=i.toData(Oe.localized(c)),u=4}return u<5&&((t=e.titles)!==null&&t!==void 0||(e.titles=i.toData(Oe.empty())),(s=e.descriptions)!==null&&s!==void 0||(e.descriptions=i.toData(Oe.empty())),(a=e.photos)!==null&&a!==void 0||(e.photos=i.toData(Wd.empty())),u=4),e.$schema_version=D.encodedExactly(u),e}},yM=(()=>{class n extends G{constructor(e){super(),this.labels=e}get $typeId(){return n.TYPE_ID}get $removable(){return!0}static fromMap(e,t){return new n(e.fromData(r.getRaw(t,"labels")))}toMap(e){return{labels:e.toData(this.labels)}}clone(){return new n(this.labels.clone())}isSame(e){return this===e?!0:d(e.labels,this.labels)}}return n.TYPE_ID="bff9578232a443148e55e6b0fcedfdaa",n})(),cm=class extends f{build(i,e){return yM.fromMap(i,e)}},bM=(()=>{class n extends G{constructor(e){super(),this.landscapeRating=e}get $typeId(){return n.TYPE_ID}get $removable(){return!0}static fromMap(e,t){return new n(r.get(t,"landscapeRating"))}toMap(e){return{landscapeRating:this.landscapeRating}}clone(){return new n(this.landscapeRating)}isSame(e){return this===e?!0:e.landscapeRating===this.landscapeRating}}return n.TYPE_ID="d05867279e524949ab793ac20ae02634",n})(),lm=class extends f{build(i,e){return bM.fromMap(i,e)}},Da=(()=>{class n extends Be{constructor(e,t,s=null,a,o,u){super(),this.renderOrder=e,this.isRenderingEnabled=t,this.businessId=s,this.photo=a,this.titles=o,this.descriptions=u}get $removable(){return!0}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(2,n.SCHEMA_VERSION)}static empty(e=this.DEFAULT_RENDER_ORDER){return new n(e,!0,null,null,Oe.empty(),Oe.empty())}static fromMap(e,t){return new n(r.get(t,"renderOrder"),r.get(t,"isRenderingEnabled"),r.getOrNull(t,"businessId"),e.fromDataOrNull(r.getOrNull(t,"photo")),e.fromData(r.get(t,"titles")),e.fromData(r.get(t,"descriptions")))}toMap(e){return{renderOrder:this.renderOrder,isRenderingEnabled:this.isRenderingEnabled,businessId:this.businessId,photo:e.toDataOrNull(this.photo),titles:e.toData(this.titles),descriptions:e.toData(this.descriptions)}}clone(){var e,t;return new n(this.renderOrder,this.isRenderingEnabled,this.businessId,(t=(e=this.photo)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null,this.titles.clone(),this.descriptions.clone())}isSame(e){return e===this?!0:e.renderOrder===this.renderOrder&&e.isRenderingEnabled===this.isRenderingEnabled&&e.businessId===this.businessId&&d(e.photo,this.photo)&&d(e.titles,this.titles)&&d(e.descriptions,this.descriptions)}}return n.TYPE_ID="c124450cb61d48beab0d84067cc717ca",n.SCHEMA_VERSION=3,n.DEFAULT_RENDER_ORDER=0,n})(),dm=class extends f{build(i,e){return Da.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(Da.SCHEMA_VERSION))return e;if(t.isGreaterThan(Da.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(r.setIfNullOrUndefined(e,"renderOrder",Da.DEFAULT_RENDER_ORDER),r.setIfNullOrUndefined(e,"isRenderingEnabled",!0),s=2),s<3&&(r.setIfNullOrUndefined(e,"titles",i.toData(Oe.empty())),r.setIfNullOrUndefined(e,"descriptions",i.toData(Oe.empty())),s=3),e.$schema_version=D.encodedExactly(s),e}},EM=(()=>{class n extends Be{constructor(e,t,s,a,o,u){super(),this.titles=e,this.richDescriptions=t,this.photo=s,this.alwaysExpanded=a,this.renderOrder=o,this.isRenderingEnabled=u}get $typeId(){return n.TYPE_ID}get $removable(){return!0}static fromMap(e,t){return new n(e.fromData(r.get(t,"titles")),e.fromData(r.get(t,"richDescriptions")),e.fromDataOrNull(r.getOrNull(t,"photo")),r.get(t,"alwaysExpanded"),r.get(t,"renderOrder"),r.get(t,"isRenderingEnabled"))}toMap(e){return{titles:e.toData(this.titles),richDescriptions:e.toData(this.richDescriptions),photo:e.toDataOrNull(this.photo),alwaysExpanded:this.alwaysExpanded,renderOrder:this.renderOrder,isRenderingEnabled:this.isRenderingEnabled}}clone(){var e,t;return new n(this.titles.clone(),this.richDescriptions.clone(),(t=(e=this.photo)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null,this.alwaysExpanded,this.renderOrder,this.isRenderingEnabled)}isSame(e){return e===this?!0:d(e.titles,this.titles)&&d(e.richDescriptions,this.richDescriptions)&&d(e.photo,this.photo)&&e.alwaysExpanded===this.alwaysExpanded&&e.renderOrder===this.renderOrder&&e.isRenderingEnabled===this.isRenderingEnabled}}return n.TYPE_ID="37303397124b42f5b9f0dc2ee4fc4501",n.DEFAULT_RENDER_ORDER=12,n})(),hm=class extends f{build(i,e){return EM.fromMap(i,e)}},va=(()=>{class n extends G{constructor(e,t,s,a){super(),this.titles=e,this.items=t,this.renderOrder=s,this.isRenderingEnabled=a}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}get $removable(){return!0}static fromMap(e,t){return new n(e.fromData(r.get(t,"titles")),r.getList(t,"items",s=>e.fromData(s)),r.get(t,"renderOrder"),r.get(t,"isRenderingEnabled"))}toMap(e){return{titles:e.toData(this.titles),items:this.items.map(t=>e.toData(t)),renderOrder:this.renderOrder,isRenderingEnabled:this.isRenderingEnabled}}clone(){return new n(this.titles.clone(),this.items.map(e=>e.clone()),this.renderOrder,this.isRenderingEnabled)}isSame(e){return this===e?!0:d(e.titles,this.titles)&&P(e.items,this.items)&&e.renderOrder===this.renderOrder&&e.isRenderingEnabled===this.isRenderingEnabled}}return n.TYPE_ID="a5a8d2fd89fe4f05ae4d01dbbb07f5d4",n.SCHEMA_VERSION=2,n.DEFAULT_RENDER_ORDER=9,n})(),fm=class extends f{build(i,e){return va.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(va.SCHEMA_VERSION))return e;if(t.isGreaterThan(va.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(r.setIfNullOrUndefined(e,"renderOrder",va.DEFAULT_RENDER_ORDER),r.setIfNullOrUndefined(e,"isRenderingEnabled",!0),s=2),e.$schema_version=D.encodedExactly(s),e}},wM=(()=>{class n extends Be{constructor(e,t,s,a){super(),this.titles=e,this.photo=t,this.renderOrder=s,this.isRenderingEnabled=a}get $typeId(){return n.TYPE_ID}get $removable(){return!0}static fromMap(e,t){return new n(e.fromData(r.get(t,"titles")),e.fromDataOrNull(r.getOrNull(t,"photo")),r.get(t,"renderOrder"),r.get(t,"isRenderingEnabled"))}toMap(e){return{titles:e.toData(this.titles),photo:e.toDataOrNull(this.photo),renderOrder:this.renderOrder,isRenderingEnabled:this.isRenderingEnabled}}clone(){var e,t;return new n(this.titles.clone(),(t=(e=this.photo)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null,this.renderOrder,this.isRenderingEnabled)}isSame(e){return e===this?!0:d(e.titles,this.titles)&&d(e.photo,this.photo)&&e.renderOrder===this.renderOrder&&e.isRenderingEnabled===this.isRenderingEnabled}}return n.TYPE_ID="ecff8e404d49477d974e96a9fff87449",n.DEFAULT_RENDER_ORDER=14,n})(),pm=class extends f{build(i,e){return wM.fromMap(i,e)}},SM=(()=>{class n extends G{constructor(e){super(),this.descriptions=e}get $removable(){return!0}get $typeId(){return n.TYPE_ID}static empty(){return new n(Oe.empty())}static fromMap(e,t){return new n(e.fromData(r.get(t,"descriptions")))}toMap(e){return{descriptions:e.toData(this.descriptions)}}clone(){return new n(this.descriptions.clone())}isSame(e){return e===this?!0:d(e.descriptions,this.descriptions)}}return n.TYPE_ID="e5cb37e2511a4748a4986c95c673c441",n})(),gm=class extends f{build(i,e){return SM.fromMap(i,e)}},ws=(()=>{class n extends G{constructor(e){super(),this.names=e}get $removable(){return!0}get $typeId(){return n.TYPE_ID}static empty(){return new n(Oe.empty())}static fromMap(e,t){return new n(e.fromData(r.get(t,"names")))}toMap(e){return{names:e.toData(this.names)}}clone(){return new n(this.names.clone())}isSame(e){return e===this?!0:d(e.names,this.names)}}return n.TYPE_ID="8cea7287910d49568230426f91732d2d",n})(),mm=class extends f{build(i,e){return ws.fromMap(i,e)}},TM=(()=>{class n extends Be{constructor(e,t,s,a,o,u,c,l){super(),this.titles=e,this.richDescriptions=t,this.photos=s,this.isRenderingEnabled=a,this.renderOrder=o,this.intentSolver=u,this.intentLabel=c,this.alwaysExpanded=l}get $typeId(){return n.TYPE_ID}get $removable(){return!0}static fromMap(e,t){return new n(e.fromData(r.get(t,"titles")),e.fromData(r.get(t,"richDescriptions")),e.fromData(r.get(t,"photos")),r.get(t,"isRenderingEnabled"),r.get(t,"renderOrder"),r.getOrNull(t,"intentSolver"),e.fromDataOrNull(r.getOrNull(t,"intentLabel")),r.get(t,"alwaysExpanded"))}toMap(e){return{titles:e.toData(this.titles),richDescriptions:e.toData(this.richDescriptions),photos:e.toDataOrNull(this.photos),isRenderingEnabled:this.isRenderingEnabled,renderOrder:this.renderOrder,intentSolver:this.intentSolver,intentLabel:e.toDataOrNull(this.intentLabel),alwaysExpanded:this.alwaysExpanded}}clone(){var e,t,s,a;return new n(this.titles.clone(),this.richDescriptions.clone(),(t=(e=this.photos)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null,this.isRenderingEnabled,this.renderOrder,this.intentSolver,(a=(s=this.intentLabel)===null||s===void 0?void 0:s.clone())!==null&&a!==void 0?a:null,this.alwaysExpanded)}isSame(e){return e===this?!0:d(e.titles,this.titles)&&d(e.richDescriptions,this.richDescriptions)&&d(e.photos,this.photos)&&e.renderOrder===this.renderOrder&&e.isRenderingEnabled===this.isRenderingEnabled&&e.intentSolver===this.intentSolver&&d(e.intentLabel,this.intentLabel)&&e.alwaysExpanded===this.alwaysExpanded}}return n.TYPE_ID="66f71c2039d44f7a91e0cbd4addd6706",n.DEFAULT_RENDER_ORDER=12,n})(),Im=class extends f{build(i,e){return TM.fromMap(i,e)}},ts=(()=>{class n extends Be{constructor(e,t,s,a,o,u){super(),this.titles=e,this.richDescriptions=t,this.coordinates=s,this.mapPreview=a,this.renderOrder=o,this.isRenderingEnabled=u}get $typeId(){return n.TYPE_ID}get $removable(){return!1}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}static empty(){return new n(Oe.empty(),hn.empty(),null,null,n.DEFAULT_RENDER_ORDER,!0)}static fromMap(e,t){return new n(e.fromData(r.get(t,"titles")),e.fromData(r.get(t,"richDescriptions")),e.fromDataOrNull(r.getOrNull(t,"coordinates")),e.fromDataOrNull(r.getOrNull(t,"mapPreview")),r.get(t,"renderOrder"),r.get(t,"isRenderingEnabled"))}toMap(e){return{titles:e.toData(this.titles),richDescriptions:e.toData(this.richDescriptions),coordinates:e.toDataOrNull(this.coordinates),mapPreview:e.toDataOrNull(this.mapPreview),renderOrder:this.renderOrder,isRenderingEnabled:this.isRenderingEnabled}}clone(){var e,t,s,a;return new n(this.titles.clone(),this.richDescriptions.clone(),(t=(e=this.coordinates)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null,(a=(s=this.mapPreview)===null||s===void 0?void 0:s.clone())!==null&&a!==void 0?a:null,this.renderOrder,this.isRenderingEnabled)}isSame(e){return this===e?!0:d(e.titles,this.titles)&&d(e.richDescriptions,this.richDescriptions)&&d(e.coordinates,this.coordinates)&&d(e.mapPreview,this.mapPreview)&&e.renderOrder===this.renderOrder&&e.isRenderingEnabled===this.isRenderingEnabled}}return n.TYPE_ID="e16ea98b2124424881abb8989bcb3f14",n.SCHEMA_VERSION=4,n.DEFAULT_RENDER_ORDER=11,n})(),Dm=class extends f{build(i,e){return ts.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(ts.SCHEMA_VERSION))return e;if(t.isGreaterThan(ts.SCHEMA_VERSION))return null;let s=t.to;if(s<2){let a=r.getMap(e,"directions",(o,u)=>
3({key:y(o,$),value:i.fromData(u)}));r.set(e,"richDescriptions",i.toData(hn.localized(a))),s=2}return s<3&&(r.set(e,"titles",i.toData(Oe.empty())),s=3),s<4&&(r.setIfNullOrUndefined(e,"renderOrder",ts.DEFAULT_RENDER_ORDER),r.setIfNullOrUndefined(e,"isRenderingEnabled",!0),s=4),e.$schema_version=D.encodedExactly(s),e}},OM=(()=>{class n extends G{constructor(e){super(),this.maxElevation=e}get $typeId(){return n.TYPE_ID}get $removable(){return!1}static fromMap(e,t){return new n(r.get(t,"maxElevation"))}toMap(e){return{maxElevation:this.maxElevation}}clone(){return new n(this.maxElevation)}isSame(e){return this===e?!0:e.maxElevation===this.maxElevation}}return n.TYPE_ID="e20751e2bb8f4fe3836e2d7383c2e662",n})(),vm=class extends f{build(i,e){return OM.fromMap(i,e)}},ya=(()=>{class n extends Be{constructor(e,t,s){super(),this.occasions=e,this.renderOrder=t,this.isRenderingEnabled=s}get $typeId(){return n.TYPE_ID}get $removable(){return!0}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static fromMap(e,t){return new n(r.getList(t,"occasions",s=>e.fromData(s)),r.get(t,"renderOrder"),r.get(t,"isRenderingEnabled"))}toMap(e){return{occasions:this.occasions.map(t=>e.toData(t)),renderOrder:this.renderOrder,isRenderingEnabled:this.isRenderingEnabled}}clone(){return new n(this.occasions.map(e=>e.clone()),this.renderOrder,this.isRenderingEnabled)}isSame(e){return this===e?!0:P(e.occasions,this.occasions,(t,s)=>d(t,s))&&e.renderOrder===this.renderOrder&&e.isRenderingEnabled===this.isRenderingEnabled}}return n.TYPE_ID="caa5fc10e26a43dfbf623b80584dfa98",n.SCHEMA_VERSION=2,n.DEFAULT_RENDER_ORDER=6,n})(),ym=class extends f{build(i,e){return ya.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(ya.SCHEMA_VERSION))return e;if(t.isGreaterThan(ya.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(r.setIfNullOrUndefined(e,"renderOrder",ya.DEFAULT_RENDER_ORDER),r.setIfNullOrUndefined(e,"isRenderingEnabled",!0),s=2),e.$schema_version=D.encodedExactly(s),e}},RM=(function(n){return n.VeryEasy="VeryEasy",n.Easy="Easy",n.Medium="Medium",n.Hard="Hard",n.VeryHard="VeryHard",n})(RM||{}),MM=(()=>{class n extends G{constructor(e){super(),this.difficulty=e}get $typeId(){return n.TYPE_ID}get $removable(){return!1}static fromMap(e,t){return new n(y(r.get(t,"difficulty"),RM))}toMap(e){return{difficulty:m(this.difficulty)}}clone(){return new n(this.difficulty)}isSame(e){return this===e?!0:e.difficulty===this.difficulty}}return n.TYPE_ID="21c7504428b146a8a4a6791cc5d45b83",n})(),bm=class extends f{build(i,e){return MM.fromMap(i,e)}},yr=(()=>{class n extends G{constructor(e,t=!1){super(),this.legacyProfilePhotos=e,this.isPublic=t}get $typeId(){return n.TYPE_ID}get $removable(){return!1}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static fromMap(e,t){return new n(e.fromDataOrNull(r.getOrNull(t,"profilePhotos")),r.get(t,"isPublic"))}toMap(e){return{isPublic:this.isPublic}}clone(){var e,t;return new n((t=(e=this.legacyProfilePhotos)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null,this.isPublic)}isSame(e){return this===e?!0:d(e.legacyProfilePhotos,this.legacyProfilePhotos)&&e.isPublic===this.isPublic}}return n.TYPE_ID="bb168f64a58742dd8eb1d9463dcdb98e",n.SCHEMA_VERSION=3,n})(),Em=class extends f{build(i,e){return yr.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(yr.SCHEMA_VERSION))return e;if(t.isGreaterThan(yr.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(r.set(e,"isPublic",!1),s=2),s<3&&(s=3),e.$schema_version=D.encodedExactly(s),e}},Jl=(function(n){return n.None="None",n.Bookable="Bookable",n.BuyTicket="BuyTicket",n.ContinuousPrograms="ContinuousPrograms",n.Fair="Fair",n.ForChildren="ForChildren",n.ForEveryone="ForEveryone",n.Party="Party",n.Workshop="Workshop",n})(Jl||{}),NM=(()=>{class n extends G{constructor(e=null){super(),this.tag=e??Jl.None}get $removable(){return!0}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(Re(r.getOrNull(t,"tag"),Jl))}toMap(e){return{tag:m(this.tag)}}clone(){return new n(this.tag)}isSame(e){return e===this?!0:e.tag===this.tag}}return n.TYPE_ID="bb0b27495b6f4d228c52016fd7dc39a8",n})(),wm=class extends f{build(i,e){return NM.fromMap(i,e)}},ba=(()=>{class n extends Be{constructor(e,t,s,a,o,u,c){super(),this.priceRanges=e,this.priceType=t,this.description=s,this.isPriceFixed=a,this.isPricePublic=o,this.renderOrder=u,this.isRenderingEnabled=c}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}get $removable(){return!0}static fromMap(e,t){return new n(r.getMap(t,"priceRanges",(s,a)=>({key:s,value:e.fromData(a)})),r.get(t,"priceType"),r.get(t,"description"),r.get(t,"isPriceFixed"),r.get(t,"isPricePublic"),r.get(t,"renderOrder"),r.get(t,"isRenderingEnabled"))}toMap(e){return{priceRanges:se(this.priceRanges,(t,s)=>({key:t.toString(),value:e.toData(s)})),priceType:this.priceType,description:this.description,isPriceFixed:this.isPriceFixed,isPricePublic:this.isPricePublic,renderOrder:this.renderOrder,isRenderingEnabled:this.isRenderingEnabled}}
3clone(){return new n(ee(this.priceRanges),this.priceType,this.description,this.isPriceFixed,this.isPricePublic,this.renderOrder,this.isRenderingEnabled)}isSame(e){return this===e?!0:re(e.priceRanges,this.priceRanges,d)&&e.priceType===this.priceType&&e.description===this.description&&e.isPriceFixed===this.isPriceFixed&&e.isPricePublic===this.isPricePublic&&e.renderOrder===this.renderOrder&&e.isRenderingEnabled===this.isRenderingEnabled}}return n.TYPE_ID="4b59f382c31548e5828a2739e816168e",n.SCHEMA_VERSION=3,n.DEFAULT_RENDER_ORDER=7,n})(),Sm=class extends f{build(i,e){return ba.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(ba.SCHEMA_VERSION))return e;if(t.isGreaterThan(ba.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(r.setIfNullOrUndefined(e,"description",""),s=2),s<3&&(r.setIfNullOrUndefined(e,"renderOrder",ba.DEFAULT_RENDER_ORDER),r.setIfNullOrUndefined(e,"isRenderingEnabled",!0),s=3),e.$schema_version=D.encodedExactly(s),e}},IS=(()=>{class n extends G{constructor(e){super(),this.elements=e}get $typeId(){return n.TYPE_ID}get $removable(){return!1}static fromMap(e,t){return new n(r.getList(t,"elements",s=>e.fromData(s)))}toMap(e){return{elements:this.elements.map(t=>e.toData(t))}}clone(){return new n(this.elements.map(e=>e.clone()))}isSame(e){return this===e?!0:P(e.elements,this.elements)}copyWithBusinessRef(e){return new n(this.elements.map(t=>t.copyWithBusinessRef(e)))}}return n.TYPE_ID="1aea276409dc4034b1b32821a2b0342b",n})(),Tm=class extends f{build(i,e){return IS.fromMap(i,e)}},PM=(()=>{class n extends G{constructor(e){super(),this.groupId=e}get $removable(){return!1}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.get(t,"groupId"))}toMap(e){return{groupId:this.groupId}}clone(){return new n(this.groupId)}isSame(e){return e===this?!0:e.groupId===this.groupId}}return n.TYPE_ID="3505e71590074448aece1d83d7498639",n})(),Om=class extends f{build(i,e){return PM.fromMap(i,e)}},Pu=(()=>{class n extends Be{constructor(e,t,s,a,o,u){super(),this.titles=e,this.elements=t,this.rendererId=s,this.renderOrder=a,this.isRenderingEnabled=o,this.allowOpeningItems=u}get $typeId(){return n.TYPE_ID}get $removable(){return!0}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static fromMap(e,t){return new n(e.fromData(r.get(t,"titles")),r.getList(t,"elements",s=>e.fromData(s)),r.getOrNull(t,"rendererId"),r.get(t,"renderOrder"),r.get(t,"isRenderingEnabled"),r.get(t,"allowOpeningItems"))}toMap(e){return{titles:e.toData(this.titles),elements:this.elements.map(t=>e.toData(t)),rendererId:this.rendererId,renderOrder:this.renderOrder,isRenderingEnabled:this.isRenderingEnabled,allowOpeningItems:this.allowOpeningItems}}clone(){return new n(this.titles.clone(),this.elements.map(e=>e.clone()),this.rendererId,this.renderOrder,this.isRenderingEnabled,this.allowOpeningItems)}isSame(e){return this===e?!0:d(e.titles,this.titles)&&P(e.elements,this.elements)&&e.rendererId===this.rendererId&&e.renderOrder===this.renderOrder&&e.isRenderingEnabled===this.isRenderingEnabled&&e.allowOpeningItems===this.allowOpeningItems}copyWithBusinessRef(e){return new n(this.titles.clone(),this.elements.map(t=>t.copyWithBusinessRef(e)),this.rendererId,this.renderOrder,this.isRenderingEnabled,this.allowOpeningItems)}}return n.TYPE_ID="8333d816c85345c28ec19c9671a03a4d",n.SCHEMA_VERSION=2,n})(),Rm=class extends f{build(i,e){return Pu.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(Pu.SCHEMA_VERSION))return e;if(t.isGreaterThan(Pu.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(r.setIfNullOrUndefined(e,"allowOpeningItems",!0),s=2),e.$schema_version=D.encodedExactly(s),e}},AM=(()=>{class n extends Be{constructor(e,t,s,a,o){super(),this.titles=e,this.descriptions=t,this.links=s,this.renderOrder=a,this.isRenderingEnabled=o}get $typeId(){return n.TYPE_ID}get $removable(){return!0}static fromMap(e,t){return new n(e.fromData(r.get(t,"titles")),e.fromData(r.get(t,"descriptions")),r.getList(t,"links",s=>e.fromData(s)),r.get(t,"renderOrder"),r.get(t,"isRenderingEnabled"))}toMap(e){return{titles:e.toData(this.titles),descriptions:e.toData(this.descriptions),links:this.links.map(t=>e.toData(t)),renderOrder:this.renderOrder,isRenderingEnabled:this.isRenderingEnabled}}clone(){return new n(this.titles.clone(),this.descriptions.clone(),this.links.map(e=>e.clone()),this.renderOrder,this.isRenderingEnabled)}isSame(e){return this===e?!0:d(e.titles,this.titles)&&d(e.descriptions,this.descriptions)&&P(e.links,this.links)&&e.renderOrder===this.renderOrder&&e.isRenderingEnabled===this.isRenderingEnabled}}return n.TYPE_ID="81659b53e3d34f2a943f76735f2e1bcc",n.DEFAULT_RENDER_ORDER=16,n})(),Mm=class extends f{build(i,e){return AM.fromMap(i,e)}},Ea=(()=>{class n extends Be{constructor(e,t,s,a,o){super(),this.names=e,this.items=t,this.contentType=s,this.renderOrder=a,this.isRenderingEnabled=o}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}get $removable(){return!1}static fromMap(e,t){return new n(r.getMap(t,"names",(s,a)=>({key:s,value:a})),r.getList(t,"items",s=>s),r.getOrNull(t,"contentType"),r.get(t,"renderOrder"),r.get(t,"isRenderingEnabled"))}toMap(e){return{names:se(this.names,(t,s)=>({key:t.toString(),value:s})),items:this.items,contentType:this.contentType,renderOrder:this.renderOrder,isRenderingEnabled:this.isRenderingEnabled}}
3clone(){return new n(ee(this.names),this.items,this.contentType,this.renderOrder,this.isRenderingEnabled)}isSame(e){return this===e?!0:re(e.names,this.names)&&P(e.items,this.items)&&e.contentType===this.contentType&&e.renderOrder===this.renderOrder&&e.isRenderingEnabled===this.isRenderingEnabled}}return n.TYPE_ID="f4f419fb84324d80b2778cc47f41d3af",n.SCHEMA_VERSION=2,n.DEFAULT_RENDER_ORDER=10,n})(),Nm=class extends f{build(i,e){return Ea.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(Ea.SCHEMA_VERSION))return e;if(t.isGreaterThan(Ea.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(r.setIfNullOrUndefined(e,"renderOrder",Ea.DEFAULT_RENDER_ORDER),r.setIfNullOrUndefined(e,"isRenderingEnabled",!0),s=2),e.$schema_version=D.encodedExactly(s),e}},CM=(()=>{class n extends Be{constructor(e,t,s){super(),this.businessRef=e,this.renderOrder=t,this.isRenderingEnabled=s}get $typeId(){return n.TYPE_ID}get $removable(){return!0}static fromMap(e,t){return new n(j.decode(r.getOrNull(t,"businessRef")),r.get(t,"renderOrder"),r.get(t,"isRenderingEnabled"))}toMap(e){var t,s;return{businessRef:(s=(t=this.businessRef)===null||t===void 0?void 0:t.encode())!==null&&s!==void 0?s:null,renderOrder:this.renderOrder,isRenderingEnabled:this.isRenderingEnabled}}clone(){var e,t;return new n((t=(e=this.businessRef)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null,this.renderOrder,this.isRenderingEnabled)}isSame(e){return this===e?!0:d(e.businessRef,this.businessRef)&&e.renderOrder===this.renderOrder&&e.isRenderingEnabled===this.isRenderingEnabled}}return n.TYPE_ID="cfdbe5c2271e4436af10d89def9128f8",n.DEFAULT_RENDER_ORDER=19,n})(),Pm=class extends f{build(i,e){return CM.fromMap(i,e)}},kM=(()=>{class n extends Be{constructor(e,t,s,a){super(),this.titles=e,this.photos=t,this.renderOrder=s,this.isRenderingEnabled=a}get $typeId(){return n.TYPE_ID}get $removable(){return!0}static fromMap(e,t){return new n(e.fromData(r.get(t,"titles")),e.fromDataOrNull(r.getOrNull(t,"photos")),r.get(t,"renderOrder"),r.get(t,"isRenderingEnabled"))}toMap(e){return{titles:e.toData(this.titles),photos:e.toDataOrNull(this.photos),renderOrder:this.renderOrder,isRenderingEnabled:this.isRenderingEnabled}}clone(){var e,t;return new n(this.titles.clone(),(t=(e=this.photos)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null,this.renderOrder,this.isRenderingEnabled)}isSame(e){return e===this?!0:d(e.titles,this.titles)&&d(e.photos,this.photos)&&e.renderOrder===this.renderOrder&&e.isRenderingEnabled===this.isRenderingEnabled}}return n.TYPE_ID="50e33874effc44b3b559adfdbbcfd7b3",n.DEFAULT_RENDER_ORDER=14,n})(),Am=class extends f{build(i,e){return kM.fromMap(i,e)}},vo=(function(n){return n.Free="Free",n.Standard="Standard",n.Premium="Premium",n})(vo||{}),_M=(()=>{class n extends G{constructor(e){super(),this.badge=e}get $typeId(){return n.TYPE_ID}get $removable(){return!0}static fromMap(e,t){return new n(y(r.get(t,"badge"),vo))}toMap(e){return{badge:m(this.badge)}}clone(){return new n(this.badge)}isSame(e){return this===e?!0:e.badge===this.badge}}return n.TYPE_ID="5ead95b8701b40d0a33627915e780a5e",n})(),Cm=class extends f{build(i,e){return _M.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){return this.migrateEnum(e,"badge",vo,vo.Free),e}},xM=(()=>{class n extends G{constructor(e){super(),this.touristSign=e}get $typeId(){return n.TYPE_ID}get $removable(){return!0}static fromMap(e,t){return new n(r.get(t,"touristSign"))}toMap(e){return{touristSign:m(this.touristSign)}}clone(){return new n(this.touristSign)}isSame(e){return this===e?!0:e.touristSign===this.touristSign}}return n.TYPE_ID="b9b5e761c41b4164b3afcc0e3a4b8c21",n})(),km=class extends f{build(i,e){return xM.fromMap(i,e)}},wa=(()=>{class n extends Be{constructor(e,t,s,a){super(),this.mapPreview=e,this.mapUrl=t,this.renderOrder=s,this.isRenderingEnabled=a}get $removable(){return!0}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static fromMap(e,t){return new n(e.fromDataOrNull(r.getOrNull(t,"mapPreview")),r.getOrNull(t,"mapUrl"),r.get(t,"renderOrder"),r.get(t,"isRenderingEnabled"))}toMap(e){return{mapPreview:e.toDataOrNull(this.mapPreview),mapUrl:this.mapUrl,renderOrder:this.renderOrder,isRenderingEnabled:this.isRenderingEnabled}}clone(){var e,t;return new n((t=(e=this.mapPreview)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null,this.mapUrl,this.renderOrder,this.isRenderingEnabled)}isSame(e){return this===e?!0:d(e.mapPreview,this.mapPreview)&&e.mapUrl===this.mapUrl&&e.renderOrder===this.renderOrder&&e.isRenderingEnabled===this.isRenderingEnabled}}return n.TYPE_ID="3a29347d2ca2421d826c2d55345880ab",n.SCHEMA_VERSION=2,n.DEFAULT_RENDER_ORDER=3,n})(),_m=class extends f{build(i,e){return wa.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(wa.SCHEMA_VERSION))return e;if(t.isGreaterThan(wa.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(r.setIfNullOrUndefined(e,"renderOrder",wa.DEFAULT_RENDER_ORDER),r.setIfNullOrUndefined(e,"isRenderingEnabled",!0),s=2),e.$schema_version=D.encodedExactly(s),e}},br=(function(n){return n.DrinkTab="DrinkTab",n.Menu="Menu",n})(br||{}),Au=(()=>{class n extends Be{constructor(e,t,s,a,o,u,c){super(),this.names=e,this.titles=t,this.categories=s,this.items=a,this.renderOrder=o,this.isRenderingEnabled=u,this.menuType=c}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}get $removable(){return!0}static fromMap(e,t){return new n(e.fromData(r.get(t,"names")),e.fromData(r.get(t,"titles")),r.getList(t,"categories",s=>e.fromData(s)),r.getList(t,"items",s=>e.fromData(s)),r.get(t,"renderOrder"),r.get(t,"isRenderingEnabled"),y(r.get(t,"menuType"),br))}toMap(e){return{names:e.toData(this.names),titles:e.toData(this.titles),categories:this.categories.map(t=>e.toData(t)),items:this.items.map(t=>e.toData(t)),renderOrder:this.renderOrder,isRenderingEnabled:this.isRenderingEnabled,menuType:m(this.menuType)}}clone(){return new n(this.names.clone(),this.titles.clone(),this.categories.map(e=>e.clone()),this.items.map(e=>e.clone()),this.renderOrder,this.isRenderingEnabled,this.menuType)}isSame(e){return this===e?!0:d(e.names,this.names)&&d(e.titles,this.titles)&&P(e.categories,this.categories,d)&&P(e.items,this.items,d)&&e.renderOrder===this.renderOrder&&e.isRenderingEnabled===this.isRenderingEnabled&&e.menuType==this.menuType}}return n.TYPE_ID="197c127f87d04e1bbb23606a277d4c2a",n.DEFAULT_RENDER_ORDER=15,n.SCHEMA_VERSION=2,n})(),xm=class extends f{build(i,e){return Au.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){var t;let s=r.getVersionRange(e);if(this.migrateEnum(e,"menuType",br,br.Menu),s.contains(Au.SCHEMA_VERSION))return e;if(s.isGreaterThan(Au.SCHEMA_VERSION))return null;let a=s.to;return a<2&&((t=e.menuType)!==null&&t!==void 0||(e.menuType=m(br.Menu)),a=2),e.$schema_version=D.encodedExactly(a),e}},FM=(()=>{class n extends G{constructor(e){super(),this.submissions=e}get $removable(){return!0}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.getList(t,"submissions",s=>e.fromData(s)))}toMap(e){return{submissions:this.submissions.map(t=>e.toData(t))}}clone(){return new n(this.submissions.map(e=>e.clone()))}isSame(e){return e===this?!0:P(e.submissions,this.submissions,d)}}return n.TYPE_ID="88b176ec911d45f581a38e1a9406fdd8",n})(),Fm=class extends f{build(i,e){return FM.fromMap(i,e)}},qM=(()=>{class n extends G{constructor(e){super(),this.questions=e}get $removable(){return!0}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.getList(t,"questions",s=>e.fromData(s)))}toMap(e){return{questions:this.questions.map(t=>e.toData(t))}}clone(){return new n(this.questions.map(e=>e.clone()))}isSame(e){return e===this?!0:P(e.questions,this.questions,d)}}return n.TYPE_ID="08fa3fc84e294f3894d43d162eeb3fc2",n})(),qm=class extends f{build(i,e){return qM.fromMap(i,e)}},DS=(()=>{class n extends b{constructor(e,t){super(),this.front=e,this.back=t}get $typeId(){return n.TYPE_ID}get $removable(){return!0}static fromMap(e,t){return new n(e.fromDataOrNull(r.getRaw(t,"front")),e.fromDataOrNull(r.getRaw(t,"back")))}toMap(e){return{front:e.toDataOrNull(this.front),back:e.toDataOrNull(this.back)}}clone(){var e,t,s,a;return new n((t=(e=this.front)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null,(a=(s=this.back)===null||s===void 0?void 0:s.clone())!==null&&a!==void 0?a:null)}isSame(e){return this===e?!0:d(e.front,this.front)&&d(e.back,this.back)}}return n.TYPE_ID="3b51b5e3f6634192879add24262ec587",n})(),Ym=class extends f{build(i,e){return DS.fromMap(i,e)}},Sa=(()=>{class n extends G{constructor(e){super(),this.cover=e}get $typeId(){return n.TYPE_ID}get $removable(){return!0}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}static fromMap(e,t){return new n(e.fromData(r.getRaw(t,"cover")))}toMap(e){return{cover:e.toData(this.cover)}}clone(){return new n(this.cover.clone())}isSame(e){return this===e?!0:d(e.cover,this.cover)}}return n.TYPE_ID="a2c228082cf24ff3bb3c1679e9d34be0",n.SCHEMA_VERSION=2,n})(),$m=class extends f{build(i,e){return Sa.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(Sa.SCHEMA_VERSION))return e;if(t.isGreaterThan(Sa.SCHEMA_VERSION))return null;let s=t.to;if(s<2){let a=DS.fromMap(i,e);e.cover=i.toData(a),s=2}return e.$schema_version=D.encodedExactly(s),e}migrateFromCurrentSchemaVersion(i,e,t){var s;let a=(s=e.$schemaVersion.to)!==null&&s!==void 0?s:Sa.SCHEMA_VERSION;return a>=2&&(a=1,t.front=i.toDataOrNull(e.cover.front),t.back=i.toDataOrNull(e.cover.back),delete t.cover,t.$
3schema_version=D.encodedExactly(1)),t}},Er=(()=>{class n extends b{constructor(e,t,s,a){super(),this.paymentAccount=e,this.paymentMethods=t,this.allowLegalEntityInvoices=s,this.allowOfflineOrderReceipts=a}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static create(e){return new n(e.paymentAccount,e.paymentMethods,e.allowLegalEntityInvoices,e.allowOfflineOrderReceipts)}static empty(){return this.create({paymentAccount:null,paymentMethods:[],allowLegalEntityInvoices:!1,allowOfflineOrderReceipts:!1})}static fromMap(e,t){return new n(e.fromDataOrNull(r.getRecordOrNull(t,"paymentAccount")),r.getList(t,"paymentMethods",s=>{var a;return(a=y(s,pe))!==null&&a!==void 0?a:pe.OnDelivery}),r.getBoolean(t,"allowLegalEntityInvoices"),r.getBoolean(t,"allowOfflineOrderReceipts"))}toMap(e){return{paymentAccount:e.toDataOrNull(this.paymentAccount),paymentMethods:this.paymentMethods,allowLegalEntityInvoices:this.allowLegalEntityInvoices,allowOfflineOrderReceipts:this.allowOfflineOrderReceipts}}clone(){var e,t;return new n((t=(e=this.paymentAccount)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null,this.paymentMethods.map(s=>s),this.allowLegalEntityInvoices,this.allowOfflineOrderReceipts)}isSame(e){return this===e?!0:P(e.paymentMethods,this.paymentMethods)&&d(e.paymentAccount,this.paymentAccount)&&e.allowLegalEntityInvoices===this.allowLegalEntityInvoices}}return n.TYPE_ID="83ca8be665134c7e8bdebdfe91864614",n.SCHEMA_VERSION=3,n})(),Lm=class extends f{build(i,e){return Er.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){var t;let s=r.getVersionRange(e);if(s.contains(Er.SCHEMA_VERSION))return e;if(s.isGreaterThan(Er.SCHEMA_VERSION))return null;let a=s.to;return a<2&&(e.allowLegalEntityInvoices=!1,a=2),a<3&&((t=e.allowOfflineOrderReceipts)!==null&&t!==void 0||(e.allowOfflineOrderReceipts=!1),a=3),e.$schema_version=D.encodedExactly(a),e}},ls=(()=>{class n extends G{constructor(e){super(),this.settings=e}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}get $removable(){return!1}static fromMap(e,t){return new n(e.fromData(r.get(t,"settings")))}toMap(e){return{settings:e.toData(this.settings)}}clone(){return new n(this.settings.clone())}isSame(e){return this===e?!0:d(e.settings,this.settings)}}return n.TYPE_ID="136fbd9410324b2da7d24e2898be08b9",n.SCHEMA_VERSION=2,n})(),Vm=class extends f{build(i,e){return ls.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(ls.SCHEMA_VERSION))return e;if(t.isGreaterThan(ls.SCHEMA_VERSION))return null;let s=t.to;if(s<2){let a=i.fromDataOrNull(r.getOrNull(e,"paymentAccount")),o=r.getList(e,"paymentMethods",c=>{var l;return(l=y(c,pe))!==null&&l!==void 0?l:pe.OnDelivery}),u=Er.create({paymentAccount:a,paymentMethods:o,allowLegalEntityInvoices:!1,allowOfflineOrderReceipts:!1});r.setIfNullOrUndefined(e,"settings",i.toData(u)),s=2}return e.$schema_version=D.encodedExactly(s),e}},vS=(()=>{class n extends G{constructor(e){super(),this.settings=e}get $typeId(){return n.TYPE_ID}get $removable(){return!1}static fromMap(e,t){return new n(e.fromData(r.get(t,"settings")))}toMap(e){return{settings:e.toData(this.settings)}}clone(){return new n(this.settings.clone())}copyWith({settings:e=F(this.settings)}={}){return new n(e)}isSame(e){return this===e?!0:d(e.settings,this.settings)}toLegacy(){return new ls(Er.create({paymentAccount:this.settings.standard.paymentAccount.clone(),paymentMethods:[...this.settings.standard.paymentMethods],allowLegalEntityInvoices:this.settings.standard.allowLegalEntityInvoices,allowOfflineOrderReceipts:this.settings.standard.allowOfflineOrderReceipts}))}}return n.TYPE_ID="9e90d3e6111b4be6a63277e5c1cb6c2d",n})(),zm=class extends f{build(i,e){return vS.fromMap(i,e)}},YM=(()=>{class n extends G{constructor(e){super(),this.settings=e}get $typeId(){return n.TYPE_ID}get $removable(){return!1}static fromMap(e,t){return new n(e.fromData(r.get(t,"settings")))}toMap(e){return{settings:e.toData(this.settings)}}clone(){return new n(this.settings.clone())}isSame(e){return this===e?!0:d(e.settings,this.settings)}}return n.TYPE_ID="9927a278f37d4f53b5987998d16b3e6c",n})(),Um=class extends f{build(i,e){return YM.fromMap(i,e)}},yS=(()=>{class n extends G{constructor(e){super(),this.settings=e}get $typeId(){return n.TYPE_ID}get $removable(){return!1}static fromMap(e,t){return new n(e.fromData(r.getRaw(t,"settings")))}toMap(e){return{settings:e.toData(this.settings)}}clone(){return new n(this.settings.clone())}isSame(e){return this===e?!0:d(e.settings,this.settings)}}return n.TYPE_ID="155d1d0f512d4dc1b90fa7b2c52f9d6a",n})(),Bm=class extends f{build(i,e){return yS.fromMap(i,e)}},$M=(()=>{class n extends G{constructor(e){super(),this.settings=e}get $typeId(){return n.TYPE_ID}get $removable(){return!1}static fromMap(e,t){return new n(e.fromData(r.getRaw(t,"settings")))}toMap(e){return{settings:e.toData(this.settings)}}clone(){return new n(this.settings.clone())}isSame(e){return this===e?!0:d(e.settings,this.settings)}}return n.TYPE_ID="39cd19b0ec1142799608aa5b9a33e52e",n})(),Hm=class extends f{build(i,e){return $M.fromMap(i,e)}},LM=(()=>{class n extends G{constructor(e){super(),this.weeklySchedule=e}get $typeId(){return n.TYPE_ID}get $removable(){return!1}static fromMap(e,t){return new n(e.fromData(r.getRaw(t,"weeklySchedule")))}toMap(e){return{weeklySchedule:e.toData(this.weeklySchedule)}}clone(){return new n(this.weeklySchedule.clone())}isSame(e){return this===e?!0:d(e.weeklySchedule,this.weeklySchedule)}}return n.TYPE_ID="5f2d0c1f81944faabbe6c22373499fbc",n})(),Gm=class extends f{build(i,e){return LM.fromMap(i,e)}},VM=(()=>{class n extends G{constructor(e,t){super(),this.isFeatured=e,this.featuredScore=t}get $typeId(){return n.TYPE_ID}get $removable(){return!1}static create(e){return new n(e.isFeatured,e.featuredScore)}static fromMap(e,t){return this.create({isFeatured:r.getBoolean(t,"isFeatured"),featuredScore:r.getInteger(t,"featuredScore")})}toMap(e){return{isFeatured:this.isFeatured,featuredScore:this.featuredScore}}copyWith({isFeatured:e=this.isFeatured,featuredScore:t=this.featuredScore}={}){return n.create({isFeatured:e,featuredScore:t})}clone(){return this.copyWith()}isSame(e){return e===this?!0:e.isFeatured===this.isFeatured&&e.featuredScore===this.featuredScore}}return n.TYPE_ID="8d8203d3892e45589e06c94d88bdaf70",n})(),Wm=class extends f{build(i,e){return VM.fromMap(i,e)}},yo=(function(n){return n.ReadOnly="ReadOnly",n.ReadWrite="ReadWrite",n.Unavailable="Unavailable",n})(yo||{}),Cu=(()=>{class n extends G{constructor(e){super(),this.eventAccessRules=e}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}get $removable(){return!1}static fromMap(e,t){return new n(r.getMap(t,"eventAccessRules",(s,a)=>({key:s,value:y(a,yo)})))}toMap(e){return{eventAccessRules:se(this.eventAccessRules,(t,s)=>({key:t,value:y(s,yo)}))}}
3clone(){return new n(ee(this.eventAccessRules))}isSame(e){return e===this?!0:re(e.eventAccessRules,this.eventAccessRules)}}return n.TYPE_ID="779ee588c971483993cfbc078c61107a",n.SCHEMA_VERSION=2,n})(),jm=class extends f{build(i,e){return Cu.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(Cu.SCHEMA_VERSION))return e;if(t.isGreaterThan(Cu.SCHEMA_VERSION))return null;let s=t.to;if(s<2){let a=r.getList(e,"accessibleEventIds",u=>u),o=new Map;for(let u of a)o.set(u,yo.ReadWrite);e.eventAccessRules=se(o,(u,c)=>({key:u,value:y(c,yo)})),s=2}return e.$schema_version=D.encodedExactly(s),e}},Kl=(()=>{class n extends G{constructor(e){super(),this.flexibleDuration=e}get duration(){return this.flexibleDuration.totalDuration}get $typeId(){return n.TYPE_ID}get $removable(){return!1}static create(e){return new n(e)}static fromMap(e,t){return new n(e.fromData(r.get(t,"flexibleDuration")))}toMap(e){return{flexibleDuration:e.toData(this.flexibleDuration)}}clone(){return new n(this.flexibleDuration.clone())}isSame(e){return this===e?!0:d(e.flexibleDuration,this.flexibleDuration)&&e.$removable===this.$removable}}return n.TYPE_ID="6108cc546dd94060a86e99621fd32d9b",n})(),Jm=class extends f{build(i,e){return Kl.fromMap(i,e)}},zM=(()=>{class n extends G{constructor(e=null){super(),this.groups=e??[]}get $removable(){return!1}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.getList(t,"groups",s=>e.fromData(s)))}toMap(e){return{groups:this.groups.map(t=>e.toData(t))}}clone(){return new n(ue(this.groups))}isSame(e){return e===this?!0:P(e.groups,this.groups,(t,s)=>d(t,s))}getAttendance(){let e=0;for(let t of this.groups)e+=t.groupSize;return e}getNumberOfAdults(){let e=0;for(let t of this.groups)e+=t.numberOfAdults;return e}getNumberOfChildren(){let e=0;for(let t of this.groups)e+=t.numberOfChildren;return e}getNumberOfStudents(){let e=0;for(let t of this.groups)e+=t.numberOfStudents;return e}getNumberOfPensioners(){let e=0;for(let t of this.groups)e+=t.numberOfPensioners;return e}}return n.TYPE_ID="bfa930799c59401a85556a217d418baf",n})(),Km=class extends f{build(i,e){return zM.fromMap(i,e)}},$t=(function(n){return n.Classroom="Classroom",n.Family="Family",n.Adults="Adults",n.Student="Student",n.Pensioner="Pensioner",n})($t||{}),ku=(()=>{class n extends b{constructor(e,t=null,s=null,a=null,o=null){super(),this.groupType=e,this.numberOfAdults=t??0,this.numberOfChildren=s??0,this.numberOfStudents=a??0,this.numberOfPensioners=o??0}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}get groupSize(){switch(this.groupType){case $t.Classroom:case $t.Family:return this.numberOfAdults+this.numberOfChildren;case $t.Student:return this.numberOfStudents;case $t.Pensioner:return this.numberOfPensioners;case $t.Adults:return this.numberOfAdults;default:throw Error(`Invalid pool attendance group type: ${this.groupType}`)}}static family(e){return new n($t.Family,2,e)}static classroom(e){return new n($t.Classroom,1,e)}static adults(e){return new n($t.Adults,e)}static students(e){return new n($t.Student,0,0,e)}static pensioners(e){return new n($t.Pensioner,0,0,0,e)}static fromMap(e,t){return new n(y(r.get(t,"groupType"),$t),r.get(t,"numberOfAdults"),r.get(t,"numberOfChildren"),r.get(t,"numberOfStudents"),r.get(t,"numberOfPensioners"))}toMap(e){return{groupType:m(this.groupType),numberOfAdults:this.numberOfAdults,numberOfChildren:this.numberOfChildren,numberOfStudents:this.numberOfStudents,numberOfPensioners:this.numberOfPensioners}}clone(){return new n(this.groupType,this.numberOfAdults,this.numberOfChildren,this.numberOfStudents,this.numberOfPensioners)}isSame(e){return e===this?!0:e.groupType===this.groupType&&e.numberOfAdults===this.numberOfAdults&&e.numberOfChildren===this.numberOfChildren&&e.numberOfStudents===this.numberOfStudents&&e.numberOfPensioners===this.numberOfPensioners}}return n.TYPE_ID="810819a04ea84f77868d8e9153e3fac6",n.SCHEMA_VERSION=2,n})(),Zm=class extends f{build(i,e){return ku.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){var t;let s=r.getVersionRange(e);if(s.contains(ku.SCHEMA_VERSION))return e;if(s.isGreaterThan(ku.SCHEMA_VERSION))return null;let a=s.to;if(a<2){let o=r.getOrNull(e,"groupType_v2");o??(o=r.get(e,"groupType")),o=="StudentOrPensioner"?(r.set(e,"groupType",m($t.Adults)),r.set(e,"numberOfAdults",0),r.set(e,"numberOfChildren",0),r.set(e,"numberOfStudents",0),r.set(e,"numberOfPensioners",0)):(r.set(e,"groupType",(t=r.getOrNull(e,"groupType_v2"))!==null&&t!==void 0?t:r.get(e,"groupType")),r.setIfNullOrUndefined(e,"numberOfStudents",0),r.setIfNullOrUndefined(e,"numberOfPensioners",0)),a=2}return e.$schema_version=D.encodedExactly(a),e}},UM=(()=>{class n extends G{constructor(e=null){super(),this.duration=e??oe.default.duration(0)}get $removable(){return!1}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(e.decodeDurationOrNull(r.getOrNull(t,"duration")))}toMap(e){return{duration:e.encodeDurationOrNull(this.duration)}}clone(){return new n(g.cloneDuration(this.duration))}isSame(e){return e===this?!0:e.duration===this.duration}}return n.TYPE_ID="ff372e592fbf451fbc0d278a5b924364",n})(),Xm=class extends f{build(i,e){return UM.fromMap(i,e)}},bS=(()=>{class n extends b{constructor(e,t,s,a){super(),this.names=e,this.groupSize=t,this.priceRanges=s,this.isPricePublic=a}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(e.fromData(r.get(t,"names")),r.get(t,"groupSize"),r.getMap(t,"priceRanges",(s,a)=>({key:s,value:e.fromData(a)})),r.get(t,"isPricePublic"))}toMap(e){return{names:e.toData(this.names),groupSize:this.groupSize,priceRanges:se(this.priceRanges,(t,s)=>({key:t,value:e.toData(s)})),isPricePublic:this.isPricePublic}}clone(){return new n(this.names.clone(),this.groupSize,ee(this.priceRanges,e=>e.clone()),this.isPricePublic)}isSame(e){return e===this?!0:d(e.names,this.names)&&e.groupSize===this.groupSize&&re
3(e.priceRanges,this.priceRanges)&&e.isPricePublic===this.isPricePublic}}return n.TYPE_ID="8a4cf49a2bb94af097db44a55ec05acc",n})(),Qm=class extends f{build(i,e){return bS.fromMap(i,e)}},BM=(()=>{class n extends G{constructor(e,t,s){super(),this.adultsOnly=e,this.availableForMen=t,this.availableForWomen=s}get $removable(){return!1}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.get(t,"adultsOnly"),r.get(t,"availableForMen"),r.get(t,"availableForWomen"))}toMap(e){return{adultsOnly:this.adultsOnly,availableForMen:this.availableForMen,availableForWomen:this.availableForWomen}}clone(){return new n(this.adultsOnly,this.availableForMen,this.availableForWomen)}isSame(e){return e===this?!0:e.adultsOnly===this.adultsOnly&&e.availableForMen===this.availableForMen&&e.availableForWomen===this.availableForWomen}}return n.TYPE_ID="b3bdbc6ee18b4642b001b233cdc5d11a",n})(),eI=class extends f{build(i,e){return BM.fromMap(i,e)}},ES=(()=>{class n extends G{constructor(e){super(),this.capacity=e}get $removable(){return!1}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(e.fromData(r.get(t,"capacity")))}toMap(e){return{capacity:e.toData(this.capacity)}}clone(){return new n(this.capacity.clone())}isSame(e){return e===this?!0:d(e.capacity,this.capacity)}}return n.TYPE_ID="fe990f50622b4682a7b54882b971a31d",n})(),tI=class extends f{build(i,e){return ES.fromMap(i,e)}},oi=(()=>{class n extends G{constructor(e){super(),this.durationRange=e}get minDuration(){return this.durationRange.from}get maxDuration(){return this.durationRange.to}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}get $removable(){return!1}static fromDuration(e){return new n(Po.exactly(e))}static fromMap(e,t){return new n(e.fromData(r.get(t,"durationRange")))}toMap(e){return{durationRange:e.toData(this.durationRange)}}clone(){return new n(this.durationRange.clone())}isSame(e){return this===e?!0:d(e.durationRange,this.durationRange)}}return n.TYPE_ID="6ba14b3af22141f2b6561253ab39fd2d",n.SCHEMA_VERSION=2,n})(),nI=class extends f{build(i,e){return oi.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(oi.SCHEMA_VERSION))return e;if(t.isGreaterThan(oi.SCHEMA_VERSION))return null;let s=t.to;if(s<2){let a=i.decodeDuration(r.get(e,"duration"));r.set(e,"durationRange",i.toData(Po.exactly(a))),s=2}return e.$schema_version=D.encodedExactly(s),e}},HM=(()=>{class n extends G{constructor(e){super(),this.paymentMethods=e}get $typeId(){return n.TYPE_ID}get $removable(){return!1}static fromMap(e,t){return new n(r.getList(t,"paymentMethods",s=>y(s,pe,pe.OnDelivery)))}toMap(e){return{paymentMethods:this.paymentMethods}}clone(){return new n(this.paymentMethods)}isSame(e){return this===e?!0:P(e.paymentMethods,this.paymentMethods)}}return n.TYPE_ID="2e7abf379977480590774e46179a80fc",n})(),iI=class extends f{build(i,e){return HM.fromMap(i,e)}},GM=(()=>{class n extends G{constructor(e){super(),this.photos=e}get $removable(){return!1}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(e.fromData(r.get(t,"photos")))}toMap(e){return{photos:e.toData(this.photos)}}clone(){return new n(this.photos.clone())}isSame(e){return e===this?!0:d(e.photos,this.photos)}}return n.TYPE_ID="462eb9dd080e497296d3c9835217fac1",n})(),sI=class extends f{build(i,e){return GM.fromMap(i,e)}},wS=(()=>{class n extends G{constructor(e){super(),this.staffMembers=e}get $removable(){return!1}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.getList(t,"staffMembers",s=>s))}toMap(e){return{staffMembers:this.staffMembers}}clone(){return new n(Te(this.staffMembers))}isSame(e){return e===this?!0:P(e.staffMembers,this.staffMembers)}}return n.TYPE_ID="90d814a79fd543d98cc9e36cff8feb95",n})(),rI=class extends f{build(i,e){return wS.fromMap(i,e)}},WM=(function(n){return n.None="None",n.Cosmetician="Cosmetician",n.Manicure="Manicure",n.Pedicure="Pedicure",n.Masseur="Masseur",n.NailArtist="NailArtist",n.MakeUpTattooist="MakeUpTattooist",n.MensHaircut="MensHaircut",n.Tattooist="Tattooist",n.WomensHaircut="WomensHaircut",n})(WM||{}),SS=(()=>{class n extends G{constructor(e){super(),this.professions=e}get $typeId(){return n.TYPE_ID}get $removable(){return!1}static fromMap(e,t){return new n(r.getList(t,"professions",s=>y(s,WM)))}toMap(e){return{professions:this.professions}}clone(){return new n(this.professions)}isSame(e){return this===e?!0:P(e.professions,this.professions)}}return n.TYPE_ID="a54d7553cae943298116ac252e075454",n})(),aI=class extends f{build(i,e){return SS.fromMap(i,e)}},jM=(()=>{class n extends G{constructor(e){super(),this.staffRoleId=e}get $removable(){return!1}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.get(t,"staffRoleId"))}toMap(e){return{staffRoleId:this.staffRoleId}}clone(){return new n(this.staffRoleId)}isSame(e){return e===this?!0:e.staffRoleId===this.staffRoleId}}return n.TYPE_ID="f21f47c34d744029a4d05c645688a785",n})(),oI=class extends f{build(i,e){return jM.fromMap(i,e)}},TS=(()=>{class n extends G{constructor(e){super(),this.ticket=e}get $typeId(){return n.TYPE_ID}get $removable(){return!1}static create(e){return new n(e.ticket)}static fromData(e,t){return new n(e.fromData(r.get(t,"ticket")))}toMap(e){return{ticket:e.toData(this.ticket)}}clone(){return new n(this.ticket.clone())}isSame(e){return e===this?!0:d(e.ticket,this.ticket)}}return n.TYPE_ID="95ec51d271ae48d2bfa6c0ab4e117c58",n})(),uI=class extends f{build(i,e){return TS.fromData(i,e)}},JM=(()=>{class n extends G{constructor(e){super(),this.ticketSettings=e}get $typeId(){return n.TYPE_ID}get $removable(){return!0}static create(e){return new n(e.ticketSettings)}static fromMap(e,t){return new n(e.fromData(r.get(t,"ticketSettings")))}toMap(e){return{ticketSettings:e.toData(this.ticketSettings)}}clone(){return new n(this.ticketSettings.clone())}isSame(e){return e===this?!0:d(e.ticketSettings,this.ticketSettings)}}return n.TYPE_ID="2ceccb77d0fb4b89a595fbe289a97682",n})(),cI=class extends f{build(i,e){return JM.fromMap(i,e)}},Ue=class n{constructor(i){Number.isSafeInteger(i)?i>=0?this.value=i:this.value=n._INFINITY:this.value=0}static finite(i){return new n(i)}get isInfinite(){return this.value===n._INFINITY}get isFinite(){return!this.isInfinite}encode(){return this.value}static decode(i){return new n(i)}clone(){return this.isInfinite?n.infinity:new n(this.value)}isSame(i){return i===this?!0:i.value===this.value}compareTo(i){return typeof i=="number"?this.compareToNumber(i):this.compareToCardinal(i)}compareToNumber(i){if(this.isInfinite)return 1;let e=n.finite(Math.abs(i));return this.compareTo(e)}compareToCardinal(i){return this.isInfinite?i.isInfinite?0:1:i.isInfinite?-1:FR(this.value,i.value)}};Ue._INFINITY=-1;Ue.infinity=new Ue(Ue._INFINITY);var KM=(()=>{class n extends G{constructor(e){super(),this.cartLimit=e}get $typeId(){return n.TYPE_ID}get $removable(){return!1}static fromMap(e,t){return new n(Ue.decode(r.getNumber(t,"cartLimit")))}toMap(e){return{cartLimit:this.cartLimit.encode()}}clone(){return new n(this.cartLimit.clone())}isSame(e){return e===this?!0:d(e.cartLimit,this.cartLimit)}}return n.TYPE_ID="7f90fcbe8efa4205abb5988ef6e2de77",n})(),lI=class extends f{build(i,e){return KM.fromMap(i,e)}},ZM=(()=>{class n extends G{constructor(e){super(),this.hasOnLocationPayment=e}static create(e){return new n(e.hasOnLocationPayment)}get $typeId(){return n.TYPE_ID}get $removable(){return!0}static fromMap(e,t){return new n(r.getBoolean(t,"hasOnLocationPayment"))}toMap(e){return{hasOnLocationPayment:this.hasOnLocationPayment}}clone(){return new n(this.hasOnLocationPayment)}isSame(e){return e===this?!0:e.hasOnLocationPayment===this.hasOnLocationPayment}}return n.TYPE_ID="b1d866c7b6f44424abdadae3694b2390",n})(),dI=class extends f{build(i,e){return ZM.fromMap(i,e)}},XM=(()=>{class n extends G{constructor(e){super(),this.color=e}get $removable(){return!0}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.color)}static fromMap(e,t){return this.create({color:r.getNumber(t,"color")})}toMap(e){return{color:this.color}}clone(){return n.create({color:this.color})}isSame(e){return e===this?!0:e.color===this.color}}return n.TYPE_ID="6c1c269189d243ba8c2b13609b8814d3",n})(),hI=class extends f{build(i,e){return XM.fromMap(i,e)}},QM=(()=>{class n extends G{constructor(e){super(),this.color=e}get $removable(){return!0}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.color)}static fromMap(e,t){return this.create({color:r.getNumber(t,"color")})}toMap(e){return{color:this.color}}clone(){return n.create({color:this.color})}isSame(e){return e===this?!0:e.color===this.color}}return n.TYPE_ID="f00dd7fc164e4c6f89717da232aa0146",n})(),fI=class extends f{build(i,e){return QM.fromMap(i,e)}},OS=(()=>{class n extends G{constructor(e){super(),this.uniqueId=e}get $typeId(){return n.TYPE_ID}get $removable(){return!1}static create({uniqueId:e}){return new n(e)}static fromMap(e,t){return n.create({uniqueId:r.getString(t,"uniqueId")})}toMap(e){return{uniqueId:this.uniqueId}}clone(){return n.create({uniqueId:this.uniqueId})}isSame(e){return e.uniqueId===this.uniqueId}}return n.TYPE_ID="d1528714772445329abc4b93b5939315",n})(),pI=class extends f{build(i,e){return OS.fromMap(i,e)}};var gI=class n{constructor(i=null){this._nextValue=i??1}get nextValue(){return this._nextValue}generate(){return this._nextValue++}clone(){return new n(this._nextValue)}isSame(i){return i===this?!0:this._nextValue===i._nextValue}};function Wr(n,i){function e(s){if(Number.isSafeInteger(s)===!1)return`number {${s}} is not a safe integer`;if(n){let a=-(2**(i-1)),o=2**(i-1)-1;if(s<a||s>o)return`number {${s}} is out of range`}else{let o=2**i-1;
3if(s<0||s>o)return`number {${s}} is out of range`}return null}class t{constructor(a){this.__value=a}static make(a){let o=e(a);if(o!==null)throw new Error(o);return new t(a)}static makeOrNull(a){return e(a)!==null?null:new t(a)}static makeSafe(a){let o=e(a);return o!==null?W.error(o):W.ok(new t(a))}asNumber(){return this.__value}}return t}var ht=class extends Wr(!1,8){static make(i){return super.make(i)}static makeOrNull(i){return super.makeOrNull(i)}static makeSafe(i){return super.makeSafe(i)}},Je=class extends Wr(!1,16){static make(i){return super.make(i)}static makeOrNull(i){return super.makeOrNull(i)}static makeSafe(i){return super.makeSafe(i)}},pR=class extends Wr(!1,32){static make(i){return super.make(i)}static makeOrNull(i){return super.makeOrNull(i)}static makeSafe(i){return super.makeSafe(i)}},gR=class extends Wr(!0,8){static make(i){return super.make(i)}static makeOrNull(i){return super.makeOrNull(i)}static makeSafe(i){return super.makeSafe(i)}},mR=class extends Wr(!0,16){static make(i){return super.make(i)}static makeOrNull(i){return super.makeOrNull(i)}static makeSafe(i){return super.makeSafe(i)}},IR=class extends Wr(!0,32){static make(i){return super.make(i)}static makeOrNull(i){return super.makeOrNull(i)}static makeSafe(i){return super.makeSafe(i)}};function RS(n){function i(t){if(t.length>n)return`string {${t}}, is longer than the max allowed length of {${n}} characters`;for(let s=0;s<t.length;s++){let a=t.charCodeAt(s);if(a<32||a>127)return`string {${t}}, is not a valid ASCII string, because at position {${s}}, character {${t.charAt(s)}} is not a printable ASCII character`}return null}class e{constructor(s){this.__value=s}static make(s){let a=i(s);if(a!==null)throw new Error(a);return new e(s)}static makeOrNull(s){return i(s)!==null?null:new e(s)}static makeSafe(s){let a=i(s);return a!==null?W.error(a):W.ok(new e(s))}asString(){return this.__value}}return e}var Nn=class extends RS(20){static make(i){return super.make(i)}static makeOrNull(i){return super.makeOrNull(i)}static makeSafe(i){return super.makeSafe(i)}},DR=class extends RS(80){static make(i){return super.make(i)}static makeOrNull(i){return super.makeOrNull(i)}static makeSafe(i){return super.makeSafe(i)}},Zl=class extends RS(120){static make(i){return super.make(i)}static makeOrNull(i){return super.makeOrNull(i)}static makeSafe(i){return super.makeSafe(i)}},me=class n{constructor(i,e,t){this.dateFormat=i,this.separator=e,this.timeFormat=t;let s="";ri(i)&&(s=i),ri(e)&&(s+=e),ri(t)&&(s+=t),this.formatter=ri(s)?s:null}static auto(){return new n(null,null,null)}static date(i){return new n(i,null,null)}static time(i){return new n(null,null,i)}static dateTime(i,e,t){return new n(i,t??null,e)}},vR=class n{constructor(i){this.formatters=i}static YYYYMMMDDHHmm(){return new n(new Map([[$.English,me.dateTime("MMM DD. YYYY","HH:mm",", ")],[$.Hungarian,me.dateTime("YYYY.MMM.DD.","HH:mm",", ")],[$.Romanian,me.dateTime("DD MMM YYYY","HH:mm",", ")]]))}static YYYYMMMDD(){return new n(new Map([[$.English,me.date("MMM DD. YYYY")],[$.Hungarian,me.date("YYYY.MMM.DD.")],[$.Romanian,me.date("DD MMM YYYY")]]))}static YYYYMMDDHHmm(){return new n(new Map([[$.English,me.dateTime("MM.DD.YYYY","HH:mm",", ")],[$.Hungarian,me.dateTime("YYYY.MM.DD.","HH:mm",", ")],[$.Romanian,me.dateTime("DD MM YYYY","HH:mm",", ")]]))}static YYYYMMDD(){return new n(new Map([[$.English,me.date("MM.DD.YYYY")],[$.Hungarian,me.date("YYYY.MM.DD.")],[$.Romanian,me.date("DD MM YYYY")]]))}static YYYYMMMMDHHmm(){return new n(new Map([[$.English,me.dateTime("YYYY MMMM D","HH:mm",", ")],[$.Hungarian,me.dateTime("YYYY. MMMM D.","HH:mm",", ")],[$.Romanian,me.dateTime("D MMMM YYYY","HH:mm",", ")]]))}static YYYYMMMMD(){return new n(new Map([[$.English,me.date("YYYY MMMM D")],[$.Hungarian,me.date("YYYY. MMMM D.")],[$.Romanian,me.date("D MMMM YYYY")]]))}static MMMMDHHmm(){return new n(new Map([[$.English,me.dateTime("MMMM D","HH:mm",", ")],[$.Hungarian,me.dateTime("MMMM D.","HH:mm",", ")],[$.Romanian,me.dateTime("D MMMM","HH:mm",", ")]]))}static MMMMD(){return new n(new Map([[$.English,me.date("MMMM D")],[$.Hungarian,me.date("MMMM D.")],[$.Romanian,me.date("D MMMM")]]))}static MMMDDHHmm(){return new n(new Map([[$.English,me.dateTime("MMM DD","HH:mm",", ")],[$.Hungarian,me.dateTime("MMM.DD.","HH:mm",", ")],[$.Romanian,me.dateTime("DD MMM","HH:mm",", ")]]))}static MMMDD(){return new n(new Map([[$.English,me.date("MMM DD")],[$.Hungarian,me.date("MMM.DD.")],[$.Romanian,me.date("DD MMM")]]))}static MMDDHHmm(){return new n(new Map([[$.English,me.dateTime("MM.DD","HH:mm",", ")],[$.Hungarian,me.dateTime("MM.DD.","HH:mm",", ")],[$.Romanian,me.dateTime("DD MM","HH:mm",", ")]]))}static MMDD(){return new n(new Map([[$.English,me.date("MM.DD")],[$.Hungarian,me.date("MM.DD.")],[$.Romanian,me.date("DD MM")]]))}static DDHHmm(){return new n(new Map([[$.English,me.dateTime("DD","HH:mm",", ")],[$.Hungarian,me.dateTime("DD.","HH:mm",", ")],[$.Romanian,me.dateTime("DD","HH:mm",", ")]]))}static DD(){return new n(new Map([[$.English,me.date("DD")],[$.Hungarian,me.date("DD.")],[$.Romanian,me.date("DD")]]))}static HHmm(){return new n(new Map([[$.English,me.time("HH:mm")],[$.Hungarian,me.t
3ime("HH:mm")],[$.Romanian,me.time("HH:mm")]]))}},mI=class{},bo=class n extends mI{constructor(i,e,t){super(),this._isBoolean=i,this._booleanValue=e,this._listValue=t}get isBoolean(){return this._isBoolean}get isList(){return!this._isBoolean}get booleanValue(){if(this._booleanValue==null)throw new ke("boolean value is not accessible on a list instance");return this._booleanValue}get listValue(){if(this._listValue==null)throw new ke("list value is not accessible on a boolean instance");return this._listValue}static fromBoolean(i){return new n(!0,i,null)}static decode(i){return i===!1?new n(!0,!1,null):i===!0?new n(!0,!0,null):new n(!1,null,i)}static decodeOrNull(i){return i!=null?this.decode(i):null}encode(){return this._isBoolean?this._booleanValue:this._listValue}clone(){return new n(this._isBoolean,this._booleanValue,et(this._listValue))}isSame(i){return i===this?!0:P(i._listValue,this._listValue)&&i._isBoolean==this._isBoolean&&i._booleanValue==this._booleanValue}},eN=(()=>{class n extends b{constructor(e,t,s,a,o){super(),this.uniqueId=e,this.name=t,this.unitPrice=s,this.quantity=a,this.totalPrice=o}static create(e){return new n(e.uniqueId,e.name,e.unitPrice,e.quantity,e.totalPrice)}static fromMap(e,t){return new n(r.getString(t,"uniqueId"),e.fromData(r.getRecord(t,"name")),Y.decode(r.getString(t,"unitPrice")),r.getInteger(t,"quantity"),Y.decode(r.getString(t,"totalPrice")))}toMap(e){return{uniqueId:this.uniqueId,name:e.toData(this.name),unitPrice:this.unitPrice.encode(),quantity:this.quantity,totalPrice:this.totalPrice.encode()}}clone(){return new n(this.uniqueId,this.name,this.unitPrice,this.quantity,this.totalPrice)}isSame(e){return e===this?!0:this.uniqueId===e.uniqueId&&this.name===e.name&&this.unitPrice===e.unitPrice&&this.quantity===e.quantity&&this.totalPrice===e.totalPrice}get $typeId(){return n.TYPE_ID}}return n.TYPE_ID="21ff46af79814e6b8f76a3177d20725a",n})(),II=class extends f{build(i,e){return eN.fromMap(i,e)}},tN=(()=>{class n extends b{constructor(e,t,s,a){super(),this.eventId=e,this.deduplicationId=t,this.businessRef=s,this.contents=a}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.eventId,e.deduplicationId,e.businessRef,e.contents)}static fromMap(e,t){return new n(r.getString(t,"eventId"),r.getString(t,"deduplicationId"),j.mustDecode(r.getString(t,"businessRef")),r.getList(t,"contents",s=>e.fromData(s)))}toMap(e){return{eventId:this.eventId,deduplicationId:this.deduplicationId,businessRef:this.businessRef.encode(),contents:this.contents.map(t=>e.toData(t))}}clone(){return new n(this.eventId,this.deduplicationId,this.businessRef.clone(),this.contents.map(e=>e.clone()))}isSame(e){return e===this?!0:this.eventId===e.eventId&&this.deduplicationId===e.deduplicationId&&d(this.businessRef,e.businessRef)&&P(this.contents,e.contents,d)}}return n.TYPE_ID="48bcf44fec81475ebb03aed78c9d0b24",n})(),DI=class extends f{build(i,e){return tN.fromMap(i,e)}},Xl=class extends b{},nN=(()=>{class n extends Xl{constructor(e,t,s,a){super(),this.uniqueId=e,this.storagePath=t,this.downloadUrl=s,this.fileName=a}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.uniqueId,e.storagePath,e.downloadUrl,e.fileName)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.get(t,"storagePath"),r.get(t,"downloadUrl"),r.getOrNull(t,"fileName"))}toMap(e){return{uniqueId:this.uniqueId,storagePath:this.storagePath,downloadUrl:this.downloadUrl,fileName:this.fileName}}clone(){return new n(this.uniqueId,this.storagePath,this.downloadUrl,this.fileName)}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.storagePath===this.storagePath&&e.downloadUrl===this.downloadUrl&&e.fileName===this.fileName}copyWith(e){var t,s,a,o;return new n((t=e.uniqueId)!==null&&t!==void 0?t:this.uniqueId,(s=e.storagePath)!==null&&s!==void 0?s:this.storagePath,(a=e.downloadUrl)!==null&&a!==void 0?a:this.downloadUrl,(o=e.fileName)!==null&&o!==void 0?o:this.fileName)}}return n.TYPE_ID="87e0d6dec9a84309b1f17a79d4a3851b",n})(),vI=class extends f{build(i,e){return nN.fromMap(i,e)}},Ta=(()=>{class n extends Xl{constructor(e,t,s,a,o,u){super(),this.uniqueId=e,this.storagePath=t,this.downloadUrl=s,this.width=a,this.height=o,this.lods=u,this.hasImageSize=a>0&&o>0,this.aspectRatio=this.hasImageSize?a/o:0}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}static create(e){var t;return new n(e.uniqueId,e.storagePath,e.downloadUrl,e.width,e.height,(t=e.lods)!==null&&t!==void 0?t:[])}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.get(t,"storagePath"),r.get(t,"downloadUrl"),r.getNumber(t,"width"),r.getNumber(t,"height"),r.getList(t,"lods",s=>e.fromData(s)))}toMap(e){return{uniqueId:this.uniqueId,storagePath:this.storagePath,downloadUrl:this.downloadUrl,width:this.width,height:this.height,lods:this.lods.map(t=>e.toData(t))}}clone(){return new n(this.uniqueId,this.storagePath,this.downloadUrl,this.width,this.height,this.lods.map(e=>e.clone()))}isSame(e){return e===this?!0:e.height===this.height&&e.width===this.width&&e.uniqueId===this.uniqueId&&e.storagePath===this.storagePath&&e.downloadUrl===this.downloadUrl&&P(e.lods,this.lods,d)}copyWith(e){var t,s,a,o,u,c;return new n((t=e.uniqueId)!==null&&t!==void 0?t:this.uniqueId,(s=e.storagePath)!==null&&s!==void 0?s:this.storagePath,(a=e.downloadUrl)!==null&&a!==void 0?a:this.downloadUrl,(o=e.width)!==null&&o!==void 0?o:this.width,(u=e.height)!==null&&u!==void 0?u:this.height,(c=e.lods)!==null&&c!==void 0?c:this.lods.map(l=>l.clone()))}}return n.TYPE_ID="f189261d8ef94b208771d4dbc833dece",n.SCHEMA_VERSION=4,n})(),yI=class extends f{build(i,e){return Ta.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){var t,s;let a=r.getVersionRange(e);if(a.contains(Ta.SCHEMA_VERSION))return e;if(a.isGreaterThan(Ta.SCHEMA_VERSION))return null;let o=a.to;
3if(o<2&&(o=2),o<3&&(o=3,e.lods=[]),o<4){o=4;let u=i.fromDataOrNull(r.getOrNull(e,"imageSize"));e.width=(t=u?.width)!==null&&t!==void 0?t:0,e.height=(s=u?.height)!==null&&s!==void 0?s:0}return e.$schema_version=D.encodedExactly(o),e}migrateFromCurrentSchemaVersion(i,e,t){var s;let a=(s=e.$schemaVersion.to)!==null&&s!==void 0?s:Ta.SCHEMA_VERSION;return a>=4&&(a=1,t.imageSize=null,t.blurHash=vx,t.$schema_version=D.encodedBetween(1,4)),t}},_u=(()=>{class n extends Mr{constructor(e,t,s,a,o){super(),this.uniqueId=e,this.titles=t,this.descriptions=s,this.isRequired=a,this.status=o}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static create(e){return new n(e.uniqueId,e.titles,e.descriptions,e.isRequired,e.status)}static fromMap(e,t){return n.create({uniqueId:r.getString(t,"uniqueId"),titles:e.fromData(r.get(t,"titles")),descriptions:e.fromData(r.get(t,"descriptions")),isRequired:r.getBoolean(t,"isRequired"),status:y(r.getString(t,"$status"),$n)})}toMap(e){return{uniqueId:this.uniqueId,titles:e.toData(this.titles),descriptions:e.toData(this.descriptions),isRequired:this.isRequired,$status:m(this.status)}}clone(){return this.copyWith()}copyWith({uniqueId:e=this.uniqueId,titles:t=F(this.titles),descriptions:s=F(this.descriptions),isRequired:a=this.isRequired,status:o=this.status}={}){return n.create({uniqueId:e,titles:t,descriptions:s,isRequired:a,status:o})}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&d(e.titles,this.titles)&&d(e.descriptions,this.descriptions)&&e.isRequired===this.isRequired&&e.status===this.status}}return n.TYPE_ID="f755b4563e3f4161964f1ba9ed46ccdf",n.SCHEMA_VERSION=2,n})(),bI=class extends f{build(i,e){return _u.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(_u.SCHEMA_VERSION))return e;if(t.isGreaterThan(_u.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(r.setIfNullOrUndefined(e,"$status",$n.Live),s=2),e.$schema_version=D.encodedExactly(s),e}},xu=(()=>{class n extends Mr{constructor(e,t,s,a,o){super(),this.uniqueId=e,this.titles=t,this.descriptions=s,this.isRequired=a,this.status=o}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static fromMap(e,t){return new n(r.getString(t,"uniqueId"),e.fromData(r.get(t,"titles")),e.fromData(r.get(t,"descriptions")),r.getBoolean(t,"isRequired"),y(r.getString(t,"$status"),$n))}toMap(e){return{uniqueId:this.uniqueId,titles:e.toData(this.titles),descriptions:e.toData(this.descriptions),isRequired:this.isRequired,$status:m(this.status)}}clone(){return new n(this.uniqueId,this.titles.clone(),this.descriptions.clone(),this.isRequired,this.status)}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&d(e.titles,this.titles)&&d(e.descriptions,this.descriptions)&&e.isRequired===this.isRequired&&e.status===this.status}}return n.TYPE_ID="4f18387516fa46d192cebb83c8970739",n.SCHEMA_VERSION=3,n})(),EI=class extends f{build(i,e){return xu.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(xu.SCHEMA_VERSION))return e;if(t.isGreaterThan(xu.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(r.setIfNullOrUndefined(e,"isRequired",!0),r.setIfNullOrUndefined(e,"uniqueId",tn(i.fromData(r.getRecord(e,"titles")).getAnyOrDefault({defValue:"default"}))),s=2),s<3&&(r.setIfNullOrUndefined(e,"$status",$n.Live),s=3),e.$schema_version=D.encodedExactly(s),e}},MS=(()=>{class n extends b{constructor(e,t){super(),this.uniqueId=e,this.value=t}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.uniqueId,e.value)}static fromMap(e,t){return new n(r.getString(t,"uniqueId"),e.fromData(r.getRecord(t,"value")))}toMap(e){return{uniqueId:this.uniqueId,value:e.toData(this.value)}}clone(){return this.copyWith()}copyWith({uniqueId:e=this.uniqueId,value:t=F(this.value)}={}){return n.create({uniqueId:e,value:t})}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&d(e.value,this.value)}}return n.TYPE_ID="7bdcc35ef46746a6b1c10d567c86abf9",n})(),wI=class extends f{build(i,e){return MS.fromMap(i,e)}},Fu=(()=>{class n extends Mr{constructor(e,t,s,a,o,u,c){super(),this.uniqueId=e,this.titles=t,this.descriptions=s,this.options=a,this.isRequired=o,this.isMultiSelect=u,this.status=c}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static fromMap(e,t){return new n(r.getString(t,"uniqueId"),e.fromData(r.get(t,"titles")),e.fromData(r.get(t,"descriptions")),r.getList(t,"options",s=>e.fromData(K.decodeRecord(s))),r.getBoolean(t,"isRequired"),r.get(t,"isMultiSelect"),y(r.getString(t,"$status"),$n))}toMap(e){return{uniqueId:this.uniqueId,titles:e.toData(this.titles),descriptions:e.toData(this.descriptions),options:this.options.map(t=>e.toData(t)),isRequired:this.isRequired,isMultiSelect:this.isMultiSelect,$status:m(this.status)}}clone(){return new n(this.uniqueId,this.titles.clone(),this.descriptions.clone(),this.options.map(e=>e.clone()),this.isRequired,this.isMultiSelect,this.status)}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&d(e.titles,this.titles)&&d(e.descriptions,this.descriptions)&&P(e.options,this.options,d)&&e.isRequired===this.isRequired&&e.isMultiSelect===this.isMultiSelect&&e.status===this.status}}return n.TYPE_ID="78f5e64b2e564a6292f5af4743f4c54f",n.SCHEMA_VERSION=4,n})(),SI=class extends f{build(i,e){return Fu.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(Fu.SCHEMA_VERSION))return e;if(t.isGreaterThan(Fu.SCHEMA_VERSION))return null;let s=t.to;if(s<2&&(r.setIfNullOrUndefined(e,"isRequired",!0),r.setIfNullOrUndefined(e,"uniqueId",tn(i.fromData(r.getRecord(e,"titles")).getAnyOrDefault({defValue:"default"}))),s=2),s<3){let a=r.getList(e,"options",o=>i.fromData(K.decodeRecord(o)));e.options=a.map(o=>i.toData(MS.create({uniqueId:tn(o.getAnyOrDefault({defValue:"default"})),value:o.clone()}))),s=3}return s<4&&(r.setIfNullOrUndefined(e,"$status",$n.Live),s=4),e.$schema_version=D.encodedExactly(s),e}},qu=(()=>{class n extends Mr{constructor(e,t,s,a,o,u,c){super(),this.uniqueId=e,this.titles=t,this.descriptions=s,this.hints=a,this.isRequired=o,this.isMultiLine=u,this.status=c}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static fromMap(e,t){return new n(r.getString(t,"uniqueId"),e.fromData(r.get(t,"titles")),e.fromData(r.get(t,"descriptions")),e.fromData(r.get(t,"hints")),r.getBoolean(t,"isRequired"),r.getBoolean(t,"isMultiLine"),y(r.getString(t,"$status"),$n))}toMap(e){return{uniqueId:this.uniqueId,titles:e.toData(this.titles),descriptions:e.toData(this.descriptions),hints:e.toData(this.hints),isRequired:this.isRequired,isMultiLine:this.isMultiLine,$status:m(this.status)}}clone(){return new n(this.uniqueId,this.titles.clone(),this.descriptions.clone(),this.hints.clone(),this.isRequired,this.isMultiLine,this.status)}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&d(e.titles,this.titles)&&d(e.descriptions,this.descriptions)&&d(e.hints,this.hints)&&e.isRequired===this.isRequired&&e.isMultiLine===this.isMultiLine&&e.status===this.status}}return n.TYPE_ID="ef01473c124e46b297010746bccbf02f",n.SCHEMA_VERSION=3,n})(),TI=class extends f{build(i,e){return qu.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(qu.SCHEMA_VERSION))return e;
3if(t.isGreaterThan(qu.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(r.setIfNullOrUndefined(e,"isRequired",!0),r.setIfNullOrUndefined(e,"uniqueId",tn(i.fromData(r.getRecord(e,"titles")).getAnyOrDefault({defValue:"default"}))),s=2),s<3&&(r.setIfNullOrUndefined(e,"$status",$n.Live),s=3),e.$schema_version=D.encodedExactly(s),e}},xr=class extends b{},iN=(()=>{class n extends b{constructor(e,t){super(),this.ticketTemplateId=e,this.answers=t}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.ticketTemplateId,e.answers)}static fromMap(e,t){return new n(r.getStringOrNull(t,"ticketTemplateId"),r.getList(t,"answers",s=>e.fromData(s)))}toMap(e){return{ticketTemplateId:this.ticketTemplateId,answers:this.answers.map(t=>e.toData(t))}}clone(){return new n(this.ticketTemplateId,this.answers.map(e=>e.clone()))}isSame(e){return e===this?!0:e.ticketTemplateId===this.ticketTemplateId&&P(e.answers,this.answers,d)}}return n.TYPE_ID="e1c7d5f6a8b0c2d4e5f7a9b1c3d6e8f0",n})(),OI=class extends f{build(i,e){return iN.fromMap(i,e)}},sN=(()=>{class n extends xr{constructor(e,t){super(),this.questionId=e,this.value=t}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.questionId,e.value)}static fromMap(e,t){return new n(r.getString(t,"questionId"),r.getString(t,"value"))}toMap(e){return{questionId:this.questionId,value:this.value}}clone(){return new n(this.questionId,this.value)}isSame(e){return e===this?!0:e.questionId===this.questionId&&e.value===this.value}}return n.TYPE_ID="a7e3f1b2c4d6e8f0a1b3c5d7e9f1a2b4",n})(),RI=class extends f{build(i,e){return sN.fromMap(i,e)}},rN=(()=>{class n extends xr{constructor(e,t){super(),this.questionId=e,this.selectedOptions=t}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.questionId,e.selectedOptions)}static fromMap(e,t){return new n(r.getString(t,"questionId"),r.getList(t,"selectedOptions",s=>s))}toMap(e){return{questionId:this.questionId,selectedOptions:this.selectedOptions}}clone(){return new n(this.questionId,[...this.selectedOptions])}isSame(e){return e===this?!0:e.questionId===this.questionId&&P(e.selectedOptions,this.selectedOptions)}}return n.TYPE_ID="b8f4a2c3d5e7f9a1b2c4d6e8f0a3b5c7",n})(),MI=class extends f{build(i,e){return rN.fromMap(i,e)}},aN=(()=>{class n extends xr{constructor(e,t){super(),this.questionId=e,this.value=t}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.questionId,e.value)}static fromMap(e,t){return new n(r.getString(t,"questionId"),e.fromData(r.getRecord(t,"value")))}toMap(e){return{questionId:this.questionId,value:e.toData(this.value)}}clone(){return new n(this.questionId,this.value.clone())}isSame(e){return e===this?!0:e.questionId===this.questionId&&d(e.value,this.value)}}return n.TYPE_ID="c9a5b3d4e6f8a0b2c3d5e7f9a1b4c6d8",n})(),NI=class extends f{build(i,e){return aN.fromMap(i,e)}},oN=(()=>{class n extends xr{constructor(e,t){super(),this.questionId=e,this.value=t}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.questionId,e.value)}static fromMap(e,t){return new n(r.getString(t,"questionId"),r.getBoolean(t,"value"))}toMap(e){return{questionId:this.questionId,value:this.value}}clone(){return new n(this.questionId,this.value)}isSame(e){return e===this?!0:e.questionId===this.questionId&&e.value===this.value}}return n.TYPE_ID="d0b6c4e5f7a9b1c3d4e6f8a0b2c5d7e9",n})(),PI=class extends f{build(i,e){return oN.fromMap(i,e)}},uN=(function(n){return n.Celery="Celery",n.Egg="Egg",n.Fish="Fish",n.Gluten="Gluten",n.Lupins="Lupins",n.Milk="Milk",n.Molluscs="Molluscs",n.Mustard="Mustard",n.Nuts="Nuts",n.SesameSeeds="SesameSeeds",n.SoyaBeans="SoyaBeans",n.SulphurDioxide="SulphurDioxide",n})(uN||{}),Yu=(()=>{class n extends b{constructor(e,t,s,a,o){super(),this.uniqueId=e,this.names=t,this.photo=s,this.items=a,this.featured=o}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),e.fromData(r.get(t,"names")),e.fromDataOrNull(r.getOrNull(t,"photo")),r.getList(t,"items",s=>s),r.get(t,"featured"))}toMap(e){return{uniqueId:this.uniqueId,names:e.toData(this.names),photo:e.toDataOrNull(this.photo),items:this.items,featured:this.featured}}clone(){var e,t;return new n(this.uniqueId,this.names.clone(),(t=(e=this.photo)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null,this.items,this.featured)}isSame(e){return e===this?!0:e.uniqueId==this.uniqueId&&d(e.names,this.names)&&d(e.photo,this.photo)&&P(e.items,this.items)&&e.featured===this.featured}}return n.TYPE_ID="a8a152a50eb1472597a7f3b99019e7e6",n.SCHEMA_VERSION=2,n})(),AI=class extends f{build(i,e){return Yu.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){var t;let s=r.getVersionRange(e);if(s.contains(Yu.SCHEMA_VERSION))return e;if(s.isGreaterThan(Yu.SCHEMA_VERSION))return null;let a=s.to;return a<2&&((t=e.featured)!==null&&t!==void 0||(e.featured=!1),a=2),e.$schema_version=D.encodedExactly(a),e}},qa=(function(n){return n.Gram="g",n.Milliliter="ml",n.Piece="pcs",n})(qa||{}),$u=(()=>{class n extends b{constructor(e,t,s,a,o,u,c,l,h,p){super(),this.uniqueId=e,this.names=t,this.descriptions=s,this.photo=a,this.price=o,this.portionSize=u,this.portionUnit=c,this.allergens=l,this.ingredients=h,this.nutrients=p}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),e.fromData(r.get(t,"names")),e.fromData(r.get(t,"descriptions")),e.fromDataOrNull(r.getOrNull(t,"photo")),Y.decode(r.get(t,"price")),r.get(t,"portionSize"),y(r.get(t,"portionUnit"),qa),r.getList(t,"allergens",s=>y(s,uN)),e.fromDataOrNull(r.getOrNull(t,"ingredients")),e.fromDataOrNull(r.getOrNull(t,"nutrients")))}toMap(e){return{uniqueId:this.uniqueId,names:e.toData(this.names),descriptions:e.toData(this.descriptions),photo:e.toDataOrNull(this.photo),price:this.price.encode(),portionSize:this.portionSize,portionUnit:m(this.portionUnit),allergens:this.allergens.map(t=>m(t)),ingredients:e.toDataOrNull(this.ingredients),nutrients:e.toDataOrNull(this.nutrients)}}clone(){var e,t,s,a,o,u;return new n(this.uniqueId,this.names.clone(),this.descriptions.clone(),(t=(e=this.photo)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null,this.price.clone(),this.portionSize,this.portionUnit,this.allergens,(a=(s=this.ingredients)===null||s===void 0?void 0:s.clone())!==null&&a!==void 0?a:null,(u=(o=this.nutrients)===null||o===void 0?void 0:o.clone())!==null&&u!==void 0?u:null)}isSame(e){return e===this?!0:e.uniqueId==this.uniqueId&&d(e.names,this.names)&&d(e.descriptions,this.descriptions)&&d(e.photo,this.photo)&&d(e.price,this.price)&&e.portionSize==this.portionSize&&e.portionUnit==this.portionUnit&&P(e.allergens,this.allergens)&&d(e.ingredients,this.ingredients)&&d(e.nutrients,this.nutrients)}}return n.TYPE_ID="b52a41fe0be44570a03cebe929ab394c",n.SCHEMA_VERSION=2,n})(),CI=class extends f{build(i,e){return $u.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){var t,s,a;this.migrateEnum(e,"portionUnit",qa,qa.Gram);let o=r.getVersionRange(e);if(o.contains($u.SCHEMA_VERSION))return e;if(o.isGreaterThan($u.SCHEMA_VERSION))return null;let u=o.to;return u<2&&((t=e.portionSize)!==null&&t!==void 0||(e.portionSize=0),(s=e.portionUnit)!==null&&s!==void 0||(e.portionUnit=m(qa.Gram)),(a=e.allergens)!==null&&a!==void 0||(e.allergens=new Array),u=2),e.$schema_version=D.encodedExactly(u),e}},Lu=(()=>{class n extends b{constructor(e,t,s,a,o,u,c){super(),this.calories=e,this.proteins=t,this.fats=s,this.saturatedFats=a,this.carbs=o,this.sugars=u,this.salt=c}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static fromMap(e,t){return new n(r.get(t,"calories"),r.get(t,"proteins"),r.get(t,"fats"),r.get(t,"saturatedFats"),r.get(t,"carbs"),r.get(t,"sugars"),r.get(t,"salt"))}toMap(e){return{calories:this.calories,proteins:this.proteins,fats:this.fats,saturatedFats:this.saturatedFats,carbs:this.carbs,sugars:this.sugars,salt:this.salt}}clone(){return new n(this.calories,this.proteins,this.fats,this.saturatedFats,this.carbs,this.sugars,this.salt)}isSame(e){return e===this?!0:e.calories===this.calories&&e.proteins===this.proteins&&e.fats===this.fats&&e.saturatedFats===this.saturatedFats&&e.carbs===this.carbs&&e.sugars===this.sugars&&e.salt===this.salt}}return n.TYPE_ID="2e81352ffbc54996aaa5ef81df4e3e14",n.SCHEMA_VERSION=2,n})(),kI=class extends f{build(i,e){return Lu.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){var t,s;let a=r.getVersionRange(e);if(a.contains(Lu.SCHEMA_VERSION))return e;if(a.isGreaterThan(Lu.SCHEMA_VERSION))return null;let o=a.to;return o<2&&((t=e.saturatedFats)!==null&&t!==void 0||(e.saturatedFats=0),(s=e.sugars)!==null&&s!==void 0||(e.sugars=0),o=2),e.$schema_version=D.encodedExactly(o),e}},cN=(()=>{class n extends b{constructor(e,t,s){super(),this.uniqueId=e,this.webRoute=t,this.posts=s}static fromData(e){return new n(e.metadata.uniqueId,e.metadata.webRoute,e.posts)}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.get(t,"webRoute"),r.getList(t,"posts",s=>e.fromData(s)))}toMap(e){return{uniqueId:this.uniqueId,webRoute:this.webRoute,posts:this.posts.map(t=>e.toData(t))}}clone(){return new n(this.uniqueId,this.webRoute,this.posts.map(e=>e.clone()))}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.webRoute===this.webRoute&&P(e.posts,this.posts,d)}}return n.TYPE_ID="f20e8e02bd7e4f6b9d03f76ea851da91",n})(),_I=class extends f{build(i,e){return cN.fromMap(i,e)}},lN=(()=>{class n extends b{constructor(e,t,s,a,o,u){super(),this.uniqueId=e,this.url=t,this.creationDate=s,this.title=a,this.description=o,this.coverPhoto=u}static fromData(e){return new n(e.uniqueId,e.url,e.creationDate,e.title,e.description,e.coverPhoto)}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.getOrNull(t,"url"),e.decodeDate(r.get(t,"creationDate")),os(t,"title"),os(t,"description"),os(t,"coverPhoto"))}toMap(e){return{uniqueId:this.uniqueId,url:this.url,creationDate:e.encodeDate(this.creationDate),title:as(this.title),description:as(this.description),coverPhoto:as(this.coverPhoto)}}clone(){return new n(this.uniqueId,this.url,g.cloneDate(this.creationDate),this.title,this.description,this.coverPhoto)}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.url===this.url&&e.creationDate===this.creationDate&&re(e.title,this.title)&&re(e.description,this.description)&&re(e.coverPhoto,this.coverPhoto)}}return n.TYPE_ID="020ac8eac6f94ecaa7e8d974f53d6a06",n})(),xI=class extends f{build(i,e){return lN.fromMap(i,e)}},He=(function(n){return n.OfflineEventTicketOrderAborted="OfflineEventTicketOrderAborted",n.OfflineEventTicketOrderCompleted="OfflineEventTicketOrderCompleted",n.OfflineEventTicketOrderCreated="OfflineEventTicketOrderCreated",
3n.OfflineEventTicketOrderModified="OfflineEventTicketOrderModified",n.OfflineEventTicketOrderPaymentMethodChanged="OfflineEventTicketOrderPaymentMethodChanged",n.OnlineEventPassOrderCreated="OnlineEventPassOrderCreated",n.OnlineEventTicketOrderAborted="OnlineEventTicketOrderAborted",n.OnlineEventTicketOrderCanceled="OnlineEventTicketOrderCanceled",n.OnlineEventTicketOrderCompleted="OnlineEventTicketOrderCompleted",n.OnlineEventTicketOrderCreated="OnlineEventTicketOrderCreated",n.OnlineEventTicketOrderRefunded="OnlineEventTicketOrderRefunded",n.OnlineProductOrderAborted="OnlineProductOrderAborted",n.OnlineProductOrderCanceled="OnlineProductOrderCanceled",n.OnlineProductOrderCompleted="OnlineProductOrderCompleted",n.OnlineProductOrderCreated="OnlineProductOrderCreated",n.OnlineProductOrderRefunded="OnlineProductOrderRefunded",n.EventOpenAccessPassCreated="EventOpenAccessPassCreated",n.EventOpenAccessPassModifiedEvents="EventOpenAccessPassModifiedEvents",n.EventOpenAccessPassModifiedMaxCount="EventOpenAccessPassModifiedMaxCount",n.EventOpenAccessPassRefunded="EventOpenAccessPassRefunded",n.SeatedEventOpenAccessPassSwap="SeatedEventOpenAccessPassSwap",n.SeatedEventOpenAccessPassMoved="SeatedEventOpenAccessPassMoved",n.SeatedOfflineEventTicketSwap="SeatedOfflineEventTicketSwap",n.SeatedOnlineEventTicketSwap="SeatedOnlineEventTicketSwap",n})(He||{}),ze=class extends b{},dN=(()=>{class n extends ze{constructor(e){super(),this.pass=e}get $typeId(){return n.TYPE_ID}generateQueryData(){return{businessRef:this.pass.businessRef.encode(),passId:this.pass.uniqueId,orderId:this.pass.orderId}}get type(){return He.EventOpenAccessPassCreated}static create(e){return new n(e.pass)}static fromMap(e,t){return this.create({pass:e.fromData(r.getRecord(t,"pass"))})}toMap(e){return{pass:e.toData(this.pass)}}clone(){return n.create({pass:F(this.pass)})}isSame(e){return e===this?!0:d(e.pass,this.pass)}}return n.TYPE_ID="c53a4344933d46f9aed2e298acec4d50",n})(),FI=class extends f{build(i,e){return dN.fromMap(i,e)}},hN=(()=>{class n extends ze{constructor(e,t,s,a){super(),this.before=e,this.after=t,this.addedEvents=s,this.removedEvents=a}get $typeId(){return n.TYPE_ID}generateQueryData(){return{businessRef:this.after.businessRef.encode(),passId:this.after.uniqueId,orderId:this.after.orderId}}get type(){return He.EventOpenAccessPassModifiedEvents}static create(e){return new n(e.before,e.after,e.addedEvents,e.removedEvents)}static fromMap(e,t){return this.create({before:e.fromData(r.getRecord(t,"before")),after:e.fromData(r.getRecord(t,"after")),addedEvents:r.getList(t,"addedEvents",s=>K.decodeString(s)),removedEvents:r.getList(t,"removedEvents",s=>K.decodeString(s))})}toMap(e){return{before:e.toData(this.before),after:e.toData(this.after),addedEvents:this.addedEvents,removedEvents:this.removedEvents}}clone(){return n.create({before:F(this.before),after:F(this.after),addedEvents:Te(this.addedEvents),removedEvents:Te(this.removedEvents)})}isSame(e){return e===this?!0:d(e.before,this.before)&&d(e.after,this.after)&&P(e.addedEvents,this.addedEvents)&&P(e.removedEvents,this.removedEvents)}}return n.TYPE_ID="dac9e38057554c34a49257d7658af599",n})(),qI=class extends f{build(i,e){return hN.fromMap(i,e)}},fN=(()=>{class n extends ze{constructor(e,t,s,a){super(),this.oldMaxCount=e,this.newMaxCount=t,this.before=s,this.after=a}get $typeId(){return n.TYPE_ID}get type(){return He.EventOpenAccessPassModifiedMaxCount}generateQueryData(){return{businessRef:this.after.businessRef.encode(),passId:this.after.uniqueId,orderId:this.after.orderId}}static create(e){return new n(e.oldMaxCount,e.newMaxCount,e.before,e.after)}static fromMap(e,t){return this.create({oldMaxCount:dt.decode(r.getRaw(t,"oldMaxCount"),s=>Ue.decode(K.decodeNumber(s))),newMaxCount:dt.decode(r.getRaw(t,"newMaxCount"),s=>Ue.decode(K.decodeNumber(s))),before:e.fromData(r.getRecord(t,"before")),after:e.fromData(r.getRecord(t,"after"))})}toMap(e){return{oldMaxCount:this.oldMaxCount.encode(t=>t.encode()),newMaxCount:this.newMaxCount.encode(t=>t.encode()),before:e.toData(this.before),after:e.toData(this.after)}}clone(){return n.create({oldMaxCount:this.oldMaxCount.clone(F),newMaxCount:this.newMaxCount.clone(F),before:F(this.before),after:F(this.after)})}isSame(e){return e===this?!0:e.oldMaxCount.isSame(this.oldMaxCount,d)&&e.newMaxCount.isSame(this.newMaxCount,d)&&d(e.before,this.before)&&d(e.after,this.after)}}return n.TYPE_ID="449edb0634144ba8ad23601f8b64efd0",n})(),YI=class extends f{build(i,e){return fN.fromMap(i,e)}},pN=(()=>{class n extends ze{constructor(e,t){super(),this.before=e,this.after=t}get $typeId(){return n.TYPE_ID}get type(){return He.EventOpenAccessPassRefunded}generateQueryData(){return{businessRef:this.after.businessRef.encode(),passId:this.after.uniqueId,orderId:this.after.orderId}}static create(e){return new n(e.before,e.after)}static fromMap(e,t){return this.create({before:e.fromData(r.getRecord(t,"before")),after:e.fromData(r.getRecord(t,"after"))})}toMap(e){return{before:e.toData(this.before),after:e.toData(this.after)}}clone(){return n.create({before:F(this.before),after:F(this.after)})}isSame(e){return e===this?!0:d(e.before,this.before)&&d(e.after,this.after)}}return n.TYPE_ID="f205542757c640c092a11ef50e5d3376",n})(),$I=class extends f{build(i,e){return pN.fromMap(i,e)}},gN=(()=>{class n extends ze{constructor(e){super(),this.order=e}get type(){return He.OnlineEventPassOrderCreated}get $typeId(){return n.TYPE_ID}generateQueryData(){return{businessRef:this.order.businessRef.encode(),orderId:this.order.uniqueId,customerId:this.order.creatorId,isGuestOrder:this.order.isGuestOrder}}static create(e){return new n(e.order)}static fromMap(e,t){return this.create({order:e.fromData(r.getRecord(t,"order"))})}toMap(e){return{order:e.toData(this.order)}}clone(){return n.create({order:F(this.order)})}isSame(e){return e===this?!0:d(e.order,this.order)}}return n.TYPE_ID="5bbcd56284f24aa39eba6b5bdfbabc9d",n})(),LI=class extends f{build(i,e){return gN.fromMap(i,e)}},mN=(()=>{class n extends ze{constructor(e,t,s,a){super(),this.before=e,this.after=t,this.oldSeatId=s,this.newSeatId=a}get $typeId(){return n.TYPE_ID}generateQueryData(){return{businessRef:this.after.businessRef.encode(),passId:this.after.uniqueId,orderId:this.after.orderId}}get type(){return He.SeatedEventOpenAccessPassMoved}static create(e){return new n(e.before,e.after,e.oldSeatId,e.newSeatId)}static fromMap(e,t){return this.create({before:e.fromData(r.getRecord(t,"before")),after:e.fromData(r.getRecord(t,"after")),oldSeatId:r.getNumberOrNull(t,"oldSeatId"),newSeatId:r.getNumberOrNull(t,"newSeatId")})}toMap(e){return{before:e.toData(this.before),after:e.toData(this.after),oldSeatId:this.oldSeatId,newSeatId:this.newSeatId}}clone(){return new n(F(this.before),F(this.after),this.oldSeatId,this.newSeatId)}isSame(e){return e===this?!0:d(e.before,this.before)&&d(e.after,this.after)&&e.oldSeatId===this.oldSeatId&&e.newSeatId===this.newSeatId}}return n.TYPE_ID="83a6db6a65dc4a5293c40eeaf6b400da",n})(),VI=class extends f{build(i,e){return mN.fromMap(i,e)}},IN=(()=>{class n extends ze{constructor(e,t,s,a){super(),this.before=e,this.after=t,this.addedSeats=s,this.removedSeats=a}get $typeId(){return n.TYPE_ID}generateQueryData(){return{businessRef:this.after.businessRef.encode(),passId:this.after.uniqueId,orderId:this.after.orderId}}get type(){return He.SeatedEventOpenAccessPassSwap}static create(e){return new n(e.before,e.after,e.addedSeats,e.removedSeats)}static fromMap(e,t){return this.create({before:e.fromData(r.getRecord(t,"before")),after:e.fromData(r.getRecord(t,"after")),addedSeats:r.getList(t,"addedSeats",s=>Ql.fromMap(e,K.decodeRecord(s))),removedSeats:r.getList(t,"removedSeats",s=>Ql.fromMap(e,K.decodeRecord(s)))})}toMap(e){return{before:e.toData(this.before),after:e.toData(this.after),addedSeats:this.addedSeats.map(t=>t.toMap(e)),removedSeats:this.removedSeats.map(t=>t.toMap(e))}}clone(){return n.create({before:this.before.clone(),after:this.after.clone(),addedSeats:this.addedSeats.map(e=>e.clone()),removedSeats:this.removedSeats.map(e=>e.clone())})}isSame(e){return e===this?!0:d(e.before,this.before)&&d(e.after,this.after)&&P(e.addedSeats,this.addedSeats,d)&&P(e.removedSeats,this.removedSeats,d)}}return n.TYPE_ID="3bcd1f41193d4b69bb06133b48a8e8d8",n})(),zI=class extends f{build(i,e){return IN.fromMap(i,e)}},Ql=class n{constructor(i,e){this.eventId=i,this.seatId=e}static create(i){return new n(i.eventId,i.seatId)}static fromMap(i,e){return this.create({eventId:r.getString(e,"eventId"),seatId:r.getNumber(e,"seatId")})}toMap(i){return{eventId:this.eventId,seatId:this.seatId}}clone(){return n.create({eventId:this.eventId,seatId:this.seatId})}isSame(i){return i===this?!0:i.eventId===this.eventId&&i.seatId===this.seatId}},DN=(()=>{class n extends ze{constructor(e,t){super(),this.before=e,this.after=t}get $typeId(){return n.TYPE_ID}get type(){return He.OnlineProductOrderAborted}generateQueryData(){return{businessRef:this.after.businessRef.encode(),orderId:this.after.uniqueId,customerId:this.after.creatorId,isGuestOrder:this.after.isGuestOrder}}static create(e){return new n(e.before,e.after)}static fromMap(e,t){return this.create({before:e.fromData(r.getRecord(t,"before")),after:e.fromData(r.getRecord(t,"after"))})}toMap(e){return{before:e.toData(this.before),after:e.toData(this.after)}}clone(){return n.create({before:F(this.before),after:F(this.after)})}isSame(e){return e===this?!0:d(e.before,this.before)&&d(e.after,this.after)}}return n.TYPE_ID="32ed5cb6006d43f08ca62bcda385db51",n})(),UI=class extends f{build(i,e){return DN.fromMap(i,e)}},vN=(()=>{class n extends ze{constructor(e,t){super(),this.before=e,this.after=t}get $typeId(){return n.TYPE_ID}get type(){return He.OnlineProductOrderCanceled}generateQueryData(){return{businessRef:this.after.businessRef.encode(),orderId:this.after.uniqueId,customerId:this.after.creatorId,isGuestOrder:this.after.isGuestOrder}}static create(e){return new n(e.before,e.after)}static fromMap(e,t){return this.create({before:e.fromData(r.getRecord(t,"before")),after:e.fromData(r.getRecord(t,"after"))})}toMap(e){return{before:e.toData(this.before),after:e.toData(this.after)}}clone(){return n.create({before:F(this.before),after:F(this.after)})}isSame(e){return e===this?!0:d(e.before,this.before)&&d(e.after,this.after)}}return n.TYPE_ID="88fb9d369d0c41a29235ef531c7d23f4",n})(),BI=class extends f{build(i,e){return vN.fromMap(i,e)}},yN=(()=>{class n extends ze{constructor(e,t){super(),this.before=e,this.after=t}get $typeId(){return n.TYPE_ID}get type(){return He.OnlineProductOrderCompleted}generateQueryData(){return{businessRef:this.after.businessRef.encode(),orderId:this.after.uniqueId,customerId:this.after.creatorId,isGuestOrder:this.after.isGuestOrder}}static create(e){return new n(e.before,e.after)}static fromMap(e,t){return this.create({before:e.fromData(r.getRecord(t,"before")),after:e.fromData(r.getRecord(t,"after"))})}toMap(e){return{before:e.toData(this.before),after:e.toData(this.after)}}clone(){return n.create({before:F(this.before),after:F(this.after)})}isSame(e){return e===this?!0:d(e.before,this.before)&&d(e.after,this.after)}}return n.TYPE_ID="d7be6b3d0b474626b4777b0efb8a1b9e",n})(),HI=class extends f{build(i,e){return yN.fromMap(i,e)}},bN=(()=>{class n extends ze{constructor(e){super(),this.order=e}get $typeId(){return n.TYPE_ID}get type(){return He.OnlineProductOrderCreated}generateQueryData(){return{businessRef:this.order.businessRef.encode(),orderId:this.order.uniqueId,customerId:this.order.creatorId,isGuestOrder:this.order.isGuestOrder}}static create(e){return new n(e.order)}static fromMap(e,t){return this.create({order:e.fromData(r.getRecord(t,"order"))})}toMap(e){return{order:e.toData(this.order)}}clone(){return n.create({order:F(this.order)})}isSame(e){return e===this?!0:d(e.order,this.order)}}return n.TYPE_ID="7fa85879e8c6428bb5821626c076b299",n})(),GI=class extends f{build(i,e){return bN.fromMap(i,e)}},EN=(()=>{class n extends ze{constructor(e,t){super(),this.before=e,this.after=t}get $typeId(){return n.TYPE_ID}get type(){return He.OnlineProductOrderRefunded}generateQueryData(){return{businessRef:this.after.businessRef.encode(),orderId:this.after.uniqueId,customerId:this.after.creatorId,isGuestOrder:this.after.isGuestOrder}}static create(e){return new n(e.before,e.after)}static fromMap(e,t){return this.create({before:e.fromData(r.getRecord(t,"before")),after:e.fromData(r.getRecord(t,"after"))})}toMap(e){return{before:e.toData(this.before),after:e.toData(this.after)}}clone(){return n.create({before:F(this.before),after:F(this.after)})}isSame(e){return e===this?!0:d(e.before,this.before)&&d(e.after,this.after)}}return n.TYPE_ID="5d5a4ec00bc148ecaec661386eb7e451",n})(),WI=class extends f{build(i,e){return EN.fromMap(i,e)}},wN=(()=>{class n extends ze{constructor(e,t){super(),this.before=e,this.after=t}get $typeId(){return n.TYPE_ID}get type(){return He.OfflineEventTicketOrderAborted}generateQueryData(){return{businessRef:this.after.businessRef.encode(),eventId:this.after.eventId,orderId:this.after.uniqueId}}static create(e){return new n(e.before,e.after)}static fromMap(e,t){return this.create({before:e.fromData(r.getRecord(t,"before")),after:e.fromData(r.getRecord(t,"after"))})}toMap(e){return{before:e.toData(this.before),after:e.toData(this.after)}}clone(){return n.create({before:F(this.before),after:F(this.after)})}isSame(e){return e===this?!0:d(e.before,this.before)&&d(e.after,this.after)}}return n.TYPE_ID="bb8aab02b12c4a0aa8a0dc4e7bf3a2f0",n})(),jI=class extends f{build(i,e){return wN.fromMap(i,e)}},SN=(()=>{class n extends ze{constructor(e,t){super(),this.before=e,this.after=t}get $typeId(){return n.TYPE_ID}get type(){return He.OfflineEventTicketOrderCompleted}generateQueryData(){return{businessRef:this.after.businessRef.encode(),eventId:this.after.eventId,orderId:this.after.uniqueId}}static create(e){return new n(e.before,e.after)}static fromMap(e,t){return this.create({before:e.fromData(r.getRecord(t,"before")),after:e.fromData(r.getRecord(t,"after"))})}toMap(e){return{before:e.toData(this.before),after:e.toData(this.after)}}clone(){return n.create({before:F(this.before),after:F(this.after)})}isSame(e){return e===this?!0:d(e.before,this.before)&&d(e.after,this.after)}}return n.TYPE_ID="bc0a2f219f244a42a04df0300df3990a",n})(),JI=class extends f{build(i,e){return SN.fromMap(i,e)}},TN=(()=>{class n extends ze{constructor(e){super(),this.order=e}get $typeId(){return n.TYPE_ID}get type(){return He.OfflineEventTicketOrderCreated}generateQueryData(){return{businessRef:this.order.businessRef.encode(),eventId:this.order.eventId,orderId:this.order.uniqueId}}static create(e){return new n(e.order)}static fromMap(e,t){return this.create({order:e.fromData(r.getRecord(t,"order"))})}toMap(e){return{order:e.toData(this.order)}}clone(){return n.create({order:F(this.order)})}isSame(e){return e===this?!0:d(e.order,this.order)}}return n.TYPE_ID="e762a23821074e119b79b8a511311dbd",n})(),KI=class extends f{build(i,e){return TN.fromMap(i,e)}},ON=(()=>{class n extends ze{constructor(e,t,s,a){super(),this.before=e,this.after=t,this.canceledTickets=s,this.refundedT
3ickets=a}get $typeId(){return n.TYPE_ID}get type(){return He.OfflineEventTicketOrderModified}generateQueryData(){return{businessRef:this.after.businessRef.encode(),eventId:this.after.eventId,orderId:this.after.uniqueId}}static create(e){return new n(e.before,e.after,e.canceledTickets,e.refundedTickets)}static fromMap(e,t){return this.create({before:e.fromData(r.getRecord(t,"before")),after:e.fromData(r.getRecord(t,"after")),canceledTickets:r.getList(t,"canceledTickets",s=>K.decodeString(s)),refundedTickets:r.getList(t,"refundedTickets",s=>K.decodeString(s))})}toMap(e){return{before:e.toData(this.before),after:e.toData(this.after),canceledTickets:this.canceledTickets,refundedTickets:this.refundedTickets}}clone(){return n.create({before:F(this.before),after:F(this.after),canceledTickets:Te(this.canceledTickets),refundedTickets:Te(this.refundedTickets)})}isSame(e){return e===this?!0:d(e.before,this.before)&&d(e.after,this.after)&&P(e.canceledTickets,this.canceledTickets)&&P(e.refundedTickets,this.refundedTickets)}}return n.TYPE_ID="7051c7a5042d4e50a2f08dbb1edfa939",n})(),ZI=class extends f{build(i,e){return ON.fromMap(i,e)}},RN=(()=>{class n extends ze{constructor(e,t,s,a){super(),this.oldPaymentMethod=e,this.newPaymentMethod=t,this.before=s,this.after=a}get type(){return He.OfflineEventTicketOrderPaymentMethodChanged}generateQueryData(){return{businessRef:this.after.businessRef.encode(),eventId:this.after.eventId,orderId:this.after.uniqueId}}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.oldPaymentMethod,e.newPaymentMethod,e.before,e.after)}static fromMap(e,t){return this.create({oldPaymentMethod:y(r.getString(t,"oldPaymentMethod"),Fe),newPaymentMethod:y(r.getString(t,"newPaymentMethod"),Fe),before:e.fromData(r.getRecord(t,"before")),after:e.fromData(r.getRecord(t,"after"))})}toMap(e){return{oldPaymentMethod:m(this.oldPaymentMethod),newPaymentMethod:m(this.newPaymentMethod),before:e.toData(this.before),after:e.toData(this.after)}}clone(){return new n(this.oldPaymentMethod,this.newPaymentMethod,F(this.before),F(this.after))}isSame(e){return e===this?!0:e.oldPaymentMethod===this.oldPaymentMethod&&e.newPaymentMethod===this.newPaymentMethod&&d(e.before,this.before)&&d(e.after,this.after)}}return n.TYPE_ID="0a74a6c39b1542f9afe53b7eeb53cda5",n})(),XI=class extends f{build(i,e){return RN.fromMap(i,e)}},MN=(()=>{class n extends ze{constructor(e,t,s,a,o){super(),this.ticketId=e,this.oldSeatId=t,this.newSeatId=s,this.before=a,this.after=o}get type(){return He.SeatedOfflineEventTicketSwap}generateQueryData(){return{businessRef:this.after.businessRef.encode(),eventId:this.after.eventId,orderId:this.after.uniqueId,ticketId:this.ticketId}}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.ticketId,e.oldSeatId,e.newSeatId,e.before,e.after)}static fromMap(e,t){return this.create({ticketId:r.getString(t,"ticketId"),oldSeatId:r.getNumber(t,"oldSeatId"),newSeatId:r.getNumber(t,"newSeatId"),before:e.fromData(r.getRecord(t,"before")),after:e.fromData(r.getRecord(t,"after"))})}toMap(e){return{ticketId:this.ticketId,oldSeatId:this.oldSeatId,newSeatId:this.newSeatId,before:e.toData(this.before),after:e.toData(this.after)}}clone(){return n.create({ticketId:this.ticketId,oldSeatId:this.oldSeatId,newSeatId:this.newSeatId,before:F(this.before),after:F(this.after)})}isSame(e){return e===this?!0:e.ticketId===this.ticketId&&e.oldSeatId===this.oldSeatId&&e.newSeatId===this.newSeatId&&d(e.before,this.before)&&d(e.after,this.after)}}return n.TYPE_ID="a99eecd314c1e4e529c35a1fc878022e3",n})(),QI=class extends f{build(i,e){return MN.fromMap(i,e)}},NN=(()=>{class n extends ze{constructor(e,t){super(),this.before=e,this.after=t}get $typeId(){return n.TYPE_ID}get type(){return He.OnlineEventTicketOrderAborted}generateQueryData(){return{businessRef:this.after.businessRef.encode(),eventId:this.after.eventId,orderId:this.after.uniqueId,customerId:this.after.creatorId,isGuestOrder:this.after.isGuestOrder}}static create(e){return new n(e.before,e.after)}static fromMap(e,t){return this.create({before:e.fromData(r.getRecord(t,"before")),after:e.fromData(r.getRecord(t,"after"))})}toMap(e){return{before:e.toData(this.before),after:e.toData(this.after)}}clone(){return n.create({before:F(this.before),after:F(this.after)})}isSame(e){return e===this?!0:d(e.before,this.before)&&d(e.after,this.after)}}return n.TYPE_ID="4a4550f27c9644c3a11928866edbdc39",n})(),eD=class extends f{build(i,e){return NN.fromMap(i,e)}},PN=(()=>{class n extends ze{constructor(e,t){super(),this.before=e,this.after=t}get $typeId(){return n.TYPE_ID}get type(){return He.OnlineEventTicketOrderCanceled}generateQueryData(){return{businessRef:this.after.businessRef.encode(),eventId:this.after.eventId,orderId:this.after.uniqueId,customerId:this.after.creatorId,isGuestOrder:this.after.isGuestOrder}}static create(e){return new n(e.before,e.after)}static fromMap(e,t){return this.create({before:e.fromData(r.getRecord(t,"before")),after:e.fromData(r.getRecord(t,"after"))})}toMap(e){return{before:e.toData(this.before),after:e.toData(this.after)}}clone(){return n.create({before:F(this.before),after:F(this.after)})}isSame(e){return e===this?!0:d(e.before,this.before)&&d(e.after,this.after)}}return n.TYPE_ID="ef9a961ab7434c6ca0bdbee1259135ab",n})(),tD=class extends f{build(i,e){return PN.fromMap(i,e)}},AN=(()=>{class n extends ze{constructor(e,t){super(),this.before=e,this.after=t}get $typeId(){return n.TYPE_ID}get type(){return He.OnlineEventTicketOrderCompleted}generateQueryData(){return{businessRef:this.after.businessRef.encode(),eventId:this.after.eventId,orderId:this.after.uniqueId,customerId:this.after.creatorId,isGuestOrder:this.after.isGuestOrder}}static create(e){return new n(e.before,e.after)}static fromMap(e,t){return this.create({before:e.fromData(r.getRecord(t,"before")),after:e.fromData(r.getRecord(t,"after"))})}toMap(e){return{before:e.toData(this.before),after:e.toData(this.after)}}clone(){return n.create({before:F(this.before),after:F(this.after)})}isSame(e){return e===this?!0:d(e.before,this.before)&&d(e.after,this.after)}}return n.TYPE_ID="5722ec06983747f791367afc06f32813",n})(),nD=class extends f{build(i,e){return AN.fromMap(i,e)}},CN=(()=>{class n extends ze{constructor(e){super(),this.order=e}get $typeId(){return n.TYPE_ID}get type(){return He.OnlineEventTicketOrderCreated}generateQueryData(){return{businessRef:this.order.businessRef.encode(),eventId:this.order.eventId,orderId:this.order.uniqueId,customerId:this.order.creatorId,isGuestOrder:this.order.isGuestOrder}}static create(e){return new n(e.order)}static fromMap(e,t){return this.create({order:e.fromData(r.getRecord(t,"order"))})}toMap(e){return{order:e.toData(this.order)}}clone(){return n.create({order:F(this.order)})}isSame(e){return e===this?!0:d(e.order,this.order)}}return n.TYPE_ID="e5cce0df91d14aad9de194bad10e6b96",n})(),iD=class extends f{build(i,e){return CN.fromMap(i,e)}},kN=(()=>{class n extends ze{constructor(e,t){super(),this.before=e,this.after=t}get $typeId(){return n.TYPE_ID}get type(){return He.OnlineEventTicketOrderRefunded}generateQueryData(){return{businessRef:this.after.businessRef.encode(),eventId:this.after.eventId,orderId:this.after.uniqueId,customerId:this.after.creatorId,isGuestOrder:this.after.isGuestOrder}}static create(e){return new n(e.before,e.after)}static fromMap(e,t){return this.create({before:e.fromData(r.getRecord(t,"before")),after:e.fromData(r.getRecord(t,"after"))})}toMap(e){return{before:e.toData(this.before),after:e.toData(this.after)}}clone(){return n.create({before:F(this.before),after:F(this.after)})}isSame(e){return e===this?!0:d(e.before,this.before)&&d(e.after,this.after)}}return n.TYPE_ID="bc5d52f42b4e43338130d8408c6d37c5",n})(),sD=class extends f{build(i,e){return kN.fromMap(i,e)}},_N=(()=>{class n extends ze{constructor(e,t,s,a,o){super(),this.ticketId=e,this.oldSeatId=t,this.newSeatId=s,this.before=a,this.after=o}get type(){return He.SeatedOnlineEventTicketSwap}generateQueryData(){return{businessRef:this.after.businessRef.encode(),eventId:this.after.eventId,orderId:this.after.uniqueId,ticketId:this.ticketId}}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.ticketId,e.oldSeatId,e.newSeatId,e.before,e.after)}static fromMap(e,t){return this.create({ticketId:r.getString(t,"ticketId"),oldSeatId:r.getNumber(t,"oldSeatId"),newSeatId:r.getNumber(t,"newSeatId"),before:e.fromData(r.getRecord(t,"before")),after:e.fromData(r.getRecord(t,"after"))})}toMap(e){return{ticketId:this.ticketId,oldSeatId:this.oldSeatId,newSeatId:this.newSeatId,before:e.toData(this.before),after:e.toData(this.after)}}clone(){return new n(this.ticketId,this.oldSeatId,this.newSeatId,F(this.before),F(this.after))}isSame(e){return e===this?!0:e.ticketId===this.ticketId&&e.oldSeatId===this.oldSeatId&&e.newSeatId===this.newSeatId&&d(e.before,this.before)&&d(e.after,this.after)}}return n.TYPE_ID="4d426a5670d04e208c9451001b35bdc6",n})(),rD=class extends f{build(i,e){return _N.fromMap(i,e)}},ed=class extends b{},sr=(()=>{class n extends ed{constructor(e,t){super(),this.eventId=e,this.seatingOptions=t}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.eventId,e.seatingOptions)}static fromMap(e,t){return this.create({eventId:r.getString(t,"eventId"),seatingOptions:e.fromData(r.getRecord(t,"seatingOptions"))})}toMap(e){return{eventId:this.eventId,seatingOptions:e.toData(this.seatingOptions)}}clone(){return n.create({eventId:this.eventId,seatingOptions:F(this.seatingOptions)})}isSame(e){return e===this?!0:e.eventId===this.eventId&&d(e.seatingOptions,this.seatingOptions)}}return n.TYPE_ID="f8c6f1f070934635adf6f9afba340077",n})(),aD=class extends f{build(i,e){return sr.fromMap(i,e)}},rr=(()=>{class n extends ed{constructor(e){super(),this.eventId=e}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.eventId)}static fromMap(e,t){return this.create({eventId:r.getString(t,"eventId")})}toMap(e){return{eventId:this.eventId}}clone(){return n.create({eventId:this.eventId})}isSame(e){return e===this?!0:e.eventId===this.eventId}}return n.TYPE_ID="21d7459ed68e470fb8e674954b69ac33",n})(),oD=class extends f{build(i,e){return rr.fromMap(i,e)}},uD=class n{constructor(i,e){this.protocol=i,this.passVariationId=e}static forPass(i){return new n(i.protocol,i.passVariationId)}static forTemplate(i){return new n(i.protocol,null)}static empty(){return new n(null,null)}setSourcePass({protocol:i,passVariationId:e}){this.protocol=i,this.passVariationId=e}setSourceTemplate({protocol:i}){this.protocol=i,this.passVariationId=null}
3findSeats(){return this.getSeatDistribution()}getSeatForEvent(i){if(this.protocol==null)throw new ke("Cannot use [SeatedOpenAccessProtocolHelper] without a source attached");let e=null,t=this.protocol.seatingOptions;t!=null&&this.isEventAssigned(i)&&(e=t);for(let[s,a]of this.protocol.modifiers)if(s==i)switch(!0){case a instanceof sr:e=a.seatingOptions;break;case a instanceof rr:e=null;break}return e}getSeatDistribution(){if(this.protocol==null)throw new ke("Cannot use [SeatedOpenAccessProtocolHelper] without a source attached");let i=new Map,e=this.protocol.seatingOptions;if(e!=null){let t=this.getAssignedEventIds();for(let s of t)i.set(s,e)}for(let[t,s]of this.protocol.modifiers)switch(!0){case s instanceof sr:i.set(t,s.seatingOptions);break;case s instanceof rr:i.delete(t);break}return i}addEvent(i,e){var t;if(this.protocol==null)throw new ke("Cannot use [SeatedOpenAccessProtocolHelper] without a source attached");this.protocol.modifiers.delete(i);let s=this.isCanonEvent(i),a=((t=this.protocol.seatingOptions)===null||t===void 0?void 0:t.seatId)===e.seatId;s&&a||this.protocol.modifiers.set(i,sr.create({eventId:i,seatingOptions:e}))}undoAddEvent(i){if(this.protocol==null)throw new ke("Cannot use [SeatedOpenAccessProtocolHelper] without a source attached");let e=this.protocol.modifiers.get(i);k(e)||e instanceof sr&&this.protocol.modifiers.delete(i)}removeEvent(i){if(this.protocol==null)throw new ke("Cannot use [SeatedOpenAccessProtocolHelper] without a source attached");this.isCanonEvent(i)&&this.protocol.modifiers.set(i,rr.create({eventId:i}))}undoRemoveEvent(i){if(this.protocol==null)throw new ke("Cannot use [SeatedOpenAccessProtocolHelper] without a source attached");let e=this.protocol.modifiers.get(i);k(e)||e instanceof rr&&this.protocol.modifiers.delete(i)}isEventAssigned(i){return this.passVariationId!=null?this.protocol.isEventAssignedToPass({eventId:i,passVariationId:this.passVariationId}):this.protocol.isEventAssignedToTemplate({eventId:i})}getAssignedEventIds(){return this.passVariationId!=null?this.protocol.getAssignedEventIdsForPass({passVariationId:this.passVariationId}):this.protocol.getAssignedEventIdsForTemplate()}isCanonEvent(i){return this.passVariationId!=null?this.protocol.isEventAssignedToPass({eventId:i,passVariationId:this.passVariationId}):this.protocol.isEventAssignedToTemplate({eventId:i})}},jr=(function(n){return n.PerEvent="PerEvent",n.PerSeat="PerSeat",n.LimitedTime="LimitedTime",n.LimitedUses="LimitedUses",n.GymAccess="GymAccess",n})(jr||{}),Ss=class{static convertFromLegacyEventList(i){let e=new Map;for(let t of i)e.set(t,bo.fromBoolean(!0));return e}static convertToLegacyEventList(i){let e=[];for(let[t,s]of i){if(s.isList)return null;s.isBoolean&&s.booleanValue&&e.push(t)}return e}},Ts=class extends b{},ns=(()=>{class n extends Ts{constructor(e,t){super(),this.events=e,this.maxEventCount=t,this.type=jr.PerEvent}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}static create(e){return new n(e.events,e.maxEventCount)}static fromMap(e,t){return this.create({events:r.getMap(t,"events",(s,a)=>({key:s,value:bo.decode(a)})),maxEventCount:dt.decode(r.getRaw(t,"maxEventCount"),s=>Ue.decode(K.decodeNumber(s)))})}toMap(e){return{type:m(this.type),events:se(this.events,(t,s)=>({key:t,value:s.encode()})),maxEventCount:this.maxEventCount.encode(t=>t.encode())}}clone(){return n.create({events:ee(this.events,e=>e.clone()),maxEventCount:this.maxEventCount.clone(e=>e.clone())})}isSame(e){return e===this?!0:e.maxEventCount.isSame(this.maxEventCount,(t,s)=>t.isSame(s))&&re(e.events,this.events,d)}applyTemplateChanges(e){return n.create({events:ee(e.events,t=>t.clone()),maxEventCount:this.maxEventCount.clone(t=>t.clone())})}cloneEventConfiguration(){return ee(this.events,e=>e.clone())}isEventAssignedToPass({eventId:e,passVariationId:t}){let s=this.events.get(e);return!!(s!=null&&(s.isList&&s.listValue.includes(t)||s.isBoolean&&s.booleanValue))}isEventAssignedToTemplate({eventId:e}){let t=this.events.get(e);return!!(t!=null&&(t.isList&&t.listValue.length>0||t.isBoolean&&t.booleanValue))}getAssignedEventIdsForPass({passVariationId:e}){let t=[];for(let[s,a]of this.events)(a.isBoolean&&a.booleanValue||a.isList&&a.listValue.includes(e))&&t.push(s);return t}getAssignedEventIdsForTemplate(){let e=[];for(let[t,s]of this.events)(s.isBoolean&&s.booleanValue||s.isList&&s.listValue.length>0)&&e.push(t);return e}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}static convertToLegacyEventList(e){return Ss.convertToLegacyEventList(e.events)}}
3return n.TYPE_ID="63db964b2656479a943c4bf0c1a1af7f",n.SCHEMA_VERSION=3,n})(),cD=class extends f{build(i,e){return ns.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){var t;let s=r.getVersionRange(e);if(s.contains(ns.SCHEMA_VERSION))return e;if(s.isGreaterThan(ns.SCHEMA_VERSION))return null;let a=s.to;if(a<2&&((t=e.maxEventCount)!==null&&t!==void 0||(e.maxEventCount=dt.UNDEFINED_STATUS),a=2),a<3){let o=Ss.convertFromLegacyEventList(r.getList(e,"events",u=>K.decodeString(u)));e.events=se(o,(u,c)=>({key:u,value:c.encode()})),a=3}return e.$schema_version=D.encodedExactly(a),e}migrateFromCurrentSchemaVersion(i,e,t){let s=e.$schemaVersion.to;if(s>=3){let a=ns.convertToLegacyEventList(e);if(a==null)return t;t.events=a,t.$schema_version=D.encodedBetween(1,2),s=1}return t}},ar=(()=>{class n extends Ts{constructor(e,t,s,a,o){super(),this.events=e,this.maxEventCount=t,this.roomId=s,this.seatingOptions=a,this.modifiers=o,this.type=jr.PerSeat}static create(e){return new n(e.events,e.maxEventCount,e.roomId,e.seatingOptions,e.modifiers)}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}static fromMap(e,t){return new n(r.getMap(t,"events",(s,a)=>({key:s,value:bo.decode(a)})),dt.decode(r.getRaw(t,"maxEventCount"),s=>Ue.decode(K.decodeNumber(s))),r.getString(t,"roomId"),e.fromDataOrNull(r.getRecordOrNull(t,"seatingOptions")),r.getMap(t,"modifiers",(s,a)=>({key:s,value:e.fromData(K.decodeRecord(a))})))}toMap(e){return{type:m(this.type),events:se(this.events,(t,s)=>({key:t,value:s.encode()})),maxEventCount:this.maxEventCount.encode(t=>t.encode()),roomId:this.roomId,seatingOptions:e.toDataOrNull(this.seatingOptions),modifiers:se(this.modifiers,(t,s)=>({key:t,value:e.toData(s)}))}}clone(){return this.copyWith()}applyTemplateChanges(e){return this.copyWith({events:ee(e.events,t=>t.clone()),maxEventCount:e.maxEventCount.clone(t=>t.clone())})}copyWith({events:e=ee(this.events,u=>u.clone()),maxEventCount:t=this.maxEventCount.clone(u=>u.clone()),roomId:s=this.roomId,seatingOptions:a=Z(this.seatingOptions),modifiers:o=ee(this.modifiers,u=>u.clone())}={}){return n.create({events:e,maxEventCount:t,roomId:s,seatingOptions:a,modifiers:o})}isSame(e){return e===this?!0:re(e.modifiers,this.modifiers,d)&&e.maxEventCount.isSame(this.maxEventCount,(t,s)=>t.isSame(s))&&e.roomId==this.roomId&&d(e.seatingOptions,this.seatingOptions)&&re(e.events,this.events,d)}cloneEventConfiguration(){return ee(this.events,e=>e.clone())}isEventAssignedToPass({eventId:e,passVariationId:t}){let s=this.events.get(e);return!!(s!=null&&(s.isList&&s.listValue.includes(t)||s.isBoolean&&s.booleanValue))}isEventAssignedToTemplate({eventId:e}){let t=this.events.get(e);return!!(t!=null&&(t.isList&&t.listValue.length>0||t.isBoolean&&t.booleanValue))}getAssignedEventIdsForPass({passVariationId:e}){let t=[];for(let[s,a]of this.events)(a.isBoolean&&a.booleanValue||a.isList&&a.listValue.includes(e))&&t.push(s);return t}getAssignedEventIdsForTemplate(){let e=[];for(let[t,s]of this.events)(s.isBoolean&&s.booleanValue||s.isList&&s.listValue.length>0)&&e.push(t);return e}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}static convertToLegacyEventList(e){return Ss.convertToLegacyEventList(e.events)}}return n.TYPE_ID="df4fc95ef7124dbc8ef15935a24527c8",n.SCHEMA_VERSION=4,n})(),lD=class extends f{build(i,e){return ar.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){var t,s;let a=r.getVersionRange(e);if(a.contains(ar.SCHEMA_VERSION))return e;if(a.isGreaterThan(ar.SCHEMA_VERSION))return null;let o=a.to;if(o<2&&((t=e.modifiers)!==null&&t!==void 0||(e.modifiers=se(new Map,(u,c)=>({key:u,value:i.toData(c)}))),o=2),o<3&&((s=e.maxEventCount)!==null&&s!==void 0||(e.maxEventCount=dt.UNDEFINED_STATUS),o=3),o<4){let u=Ss.convertFromLegacyEventList(r.getList(e,"events",c=>K.decodeString(c)));e.events=se(u,(c,l)=>({key:c,value:l.encode()})),o=4}return e.$schema_version=D.encodedExactly(o),e}migrateFromCurrentSchemaVersion(i,e,t){let s=e.$schemaVersion.to;if(s>=4){let a=ar.convertToLegacyEventList(e);if(a==null)return t;t.events=a,t.$schema_version=D.encodedBetween(1,3),s=1}return t}};var xN=(()=>{class n extends b{constructor(e,t,s){super(),this.uniqueId=e,this.creationDate=t,this.data=s}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.uniqueId,e.creationDate,e.data)}static fromMap(e,t){return this.create({uniqueId:r.getString(t,"uniqueId"),creationDate:e.decodeDate(r.getNumber(t,"creationDate")),data:e.fromData(r.getRecord(t,"data"))})}toMap(e){return{uniqueId:this.uniqueId,creationDate:e.encodeDate(this.creationDate),type:m(this.data.type),data:e.toData(this.data)}}clone(){return n.create({uniqueId:this.uniqueId,creationDate:this.creationDate,data:this.data.clone()})}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.creationDate===this.creationDate&&d(e.data,this.data)}}return n.TYPE_ID="23498bd319a147b1bcf8630a8fddb0b8",n})(),dD=class extends f{build(i,e){return xN.fromMap(i,e)}optimizeForQuery(i,e){return e.data.generateQueryData()}},Eo=class{},Pt=(()=>{class n extends b{constructor(e,t){super(),this.hour=e,this.minute=t}get inMinutes(){return this.hour*Su+this.minute}get asFormattedString(){return`${(this.hour%AR).toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}`}get $typeId(){return n.TYPE_ID}static midnight(){return new n(0,0)}static fromDate(e){return new n(e.hour(),e.minute())}static fromMinutes(e){return new n(Math.floor(e/Su),e%Su)}static fromMap(e,t){return new n(r.get(t,"hour"),r.get(t,"minute"))}toMap(e){return{hour:this.hour,minute:this.minute}}clone(){return new n(this.hour,this.minute)}isSame(e){return e===this?!0:e.hour===this.hour&&e.minute===this.minute}add(e){return n.fromMinutes(this.inMinutes+e.asMinutes())}toString(){return this.asFormattedString}}return n.TYPE_ID="342a0c2d03c648f389a448d062838e92",n})(),hD=class extends f{build(i,e){return Pt.fromMap(i,e)}}
3,Pi=class n extends Eo{constructor(i,e,t){super(),this.entryId=i,this.timeOfDay=e,this.duration=t}clone(){return new n(this.entryId,this.timeOfDay.clone(),g.cloneDuration(this.duration))}isSame(i){return i===this?!0:i.entryId===this.entryId&&d(i.timeOfDay,this.timeOfDay)&&i.duration===this.duration}toDiagnosticsObject(){return{entryId:this.entryId,timeOfDay:this.timeOfDay.asFormattedString,duration:this.duration.asMinutes()}}},Os=class n{constructor(i,e){this.uniqueId=i,this.slots=e,this.calendarState=new Map;for(let t of e)this.addSlotToCalendarState(t)}static empty(i){return new n(i,[])}static fromLegacyCalendarState(i,e){let t=[...e.keys()];t.sort();let s=new Map,a=new Map,o=new Set;for(let c of t){let l=e.get(c);if(_(l))for(let h of l)o.has(h)||(o.add(h),s.set(h,c*bn)),a.set(h,c*bn)}let u=[...o].map(c=>{let l=s.get(c),h=a.get(c);if(k(l))throw Error(`Failed to find start time for entry: ${c}`);if(k(h))throw Error(`Failed to find end time for entry: ${c}`);return new Pi(c,Pt.fromMinutes(l),oe.default.duration({minutes:h-(l-bn)}))});return new n(i,u)}clone(){return new n(this.uniqueId,this.slots.map(i=>i.clone()))}isSame(i){return i===this?!0:P(i.slots,this.slots,(e,t)=>d(e,t))&&i.uniqueId===this.uniqueId}getSlots(i){var e;let t=Math.floor(i/bn);return(e=this.calendarState.get(t))!==null&&e!==void 0?e:[]}addSlot(i){this.slots.push(i),this.addSlotToCalendarState(i)}removeSlot(i){if(i>=0&&i<this.slots.length){let e=this.slots.splice(i,1)[0];e&&this.removeSlotFromCalendarState(e)}}addSlotToCalendarState(i){var e;let t=i.timeOfDay.inMinutes,s=i.duration.asMinutes();for(let a=0;a<s;a+=bn){let o=Math.floor((t+a)/bn),u=(e=this.calendarState.get(o))!==null&&e!==void 0?e:[];u.push(i),this.calendarState.set(o,u)}}removeSlotFromCalendarState(i){let e=i.timeOfDay.inMinutes,t=i.duration.asMinutes();for(let s=0;s<t;s+=bn){let a=Math.floor((e+s)/bn),o=this.calendarState.get(a);_(o)&&this.calendarState.set(a,o.filter(u=>u.entryId!==i.entryId))}}toDiagnosticsObject(){return this.slots.map(i=>i.toDiagnosticsObject())}toLegacyCalendarState(){var i;let e=new Map;for(let t of this.slots){let s=t.timeOfDay.inMinutes,a=t.duration.asMinutes();for(let o=0;o<a;o+=bn){let u=Math.floor((s+o)/bn),c=(i=e.get(u))!==null&&i!==void 0?i:[];c.push(t),e.set(u,c)}}return e}},wr=(()=>{class n extends b{}return n.GLOBAL_STATE_ID="_CALENDAR_GLOBAL_STATE",n})(),Ya=class n{constructor(i,e,t){this.dayOfYear=i,this.timezone=e,this.calendars=t,this.date=this.dayOfYear.toDate(g.ofRegion(this.timezone))}get dayOfMonth(){return this.dayOfYear.day}static fromOther(i){return new n(i.dayOfYear.clone(),i.timezone,ee(i.calendars,e=>e.clone()))}static empty(i,e){return new n(i,e,new Map)}clone(){return new n(this.dayOfYear.clone(),this.timezone,ee(this.calendars,i=>i.clone()))}isSame(i){return i===this?!0:re(i.calendars,this.calendars,(e,t)=>d(e,t))&&d(i.dayOfYear,this.dayOfYear)&&i.timezone===this.timezone}getCalendarState(i){var e;return(e=this.calendars.get(i??wr.GLOBAL_STATE_ID))!==null&&e!==void 0?e:null}getOrCreateCalendarState(i){var e;let t=(e=this.calendars.get(i??wr.GLOBAL_STATE_ID))!==null&&e!==void 0?e:null;return k(t)&&(t=Os.empty(i),this.calendars.set(i,t)),t}toDiagnosticsObject(){let i={};return this.calendars.forEach((e,t)=>{i[t]=e.toDiagnosticsObject()}),{dayOfYear:this.dayOfYear.uniqueId,date:g.encodeDate(this.date),timezone:m(this.timezone),calendars:i}}},jd=(()=>{class n extends b{constructor(e,t){super(),this.from=e,this.to=t}get isExact(){return this.from===this.to}get $typeId(){return n.TYPE_ID}static between(e,t){return new n(e,t)}static upTo(e){return new n(1,e)}static fromMap(e,t){return new n(r.get(t,"from"),r.get(t,"to"))}toMap(e){return{from:this.from,to:this.to}}clone(){return new n(this.from,this.to)}isSame(e){return e===this?!0:e.from===this.from&&e.to===this.to}toDiagnosticsObject(){return{from:this.from,to:this.to}}}return n.TYPE_ID="a92d5163af934e2e8ce74cf9820eeae4",n})(),fD=class extends f{build(i,e){return jd.fromMap(i,e)}},ds=class n extends Eo{constructor(i,e,t,s,a,o){super(),this.entryId=i,this.timeOfDay=e,this.duration=t,this.serviceId=s,this.capacity=a,this.occupancy=o}get groupId(){return this.entryId}clone(){return new n(this.entryId,this.timeOfDay.clone(),g.cloneDuration(this.duration),this.serviceId,this.capacity.clone(),this.occupancy)}isSame(i){return i===this?!0:i.entryId===this.entryId&&d(i.timeOfDay,this.timeOfDay)&&d(i.capacity,this.capacity)&&i.duration===this.duration&&i.serviceId===this.serviceId&&i.occupancy===this.occupancy}toDiagnosticsObject(){return{entryId:this.entryId,timeOfDay:this.timeOfDay.asFormattedString,duration:this.duration.asMinutes(),serviceId:this.serviceId,capacity:this.capacity.toDiagnosticsObject(),occupancy:this.occupancy}}}
3,Fr=class n extends Eo{constructor(i,e,t,s,a){super(),this.entryId=i,this.timeOfDay=e,this.duration=t,this.serviceId=s,this.isOpen=a}get groupId(){return this.entryId}clone(){return new n(this.entryId,this.timeOfDay.clone(),g.cloneDuration(this.duration),this.serviceId,this.isOpen)}isSame(i){return i===this?!0:i.entryId===this.entryId&&d(i.timeOfDay,this.timeOfDay)&&i.duration===this.duration&&i.serviceId===this.serviceId&&i.isOpen===this.isOpen}toDiagnosticsObject(){return{entryId:this.entryId,timeOfDay:this.timeOfDay.asFormattedString,duration:this.duration.asMinutes(),serviceId:this.serviceId,isOpen:this.isOpen}}},De=(()=>{class n{constructor(e){this.getRandomValues=e}generate(e){var t,s;let a=(t=e?.length)!==null&&t!==void 0?t:n.kAutoIdLength,o=this.generateAlphabet((s=e?.alphabet)!==null&&s!==void 0?s:"ALL"),u=o.length,c="";for(;c.length<a;){let l=new Uint8Array(n.kAutoIdLength);this.getRandomValues(l).forEach(p=>{let I=u*4-1;c.length<a&&p<=I&&(c+=o.charAt(p%u))})}return c}generateAlphabet(e){switch(e){case"UC_LETTERS":return n.UC_LETTERS;case"UC_LETTERS_DIGITS":return n.UC_LETTERS+n.DIGITS;case"LC_LETTERS":return n.LC_LETTERS;case"DIGITS":return n.DIGITS;case"NONSIMILAR_CHARACTERS":return n.NONSIMILAR_CHARACTERS;default:return n.UC_LETTERS+n.LC_LETTERS+n.DIGITS}}}return n.UC_LETTERS="ABCDEFGHIJKLMNOPQRSTUVWXYZ",n.LC_LETTERS="abcdefghijklmnopqrstuvwxyz",n.DIGITS="0123456789",n.NONSIMILAR_CHARACTERS="ABCDEFGHJKLMNPQRSTWXYZ23456789",n.kAutoIdLength=20,n.kAuthIdLength=28,n})(),yR=(()=>{class n{static serialize(e){return this.asBytes_v3(e)}static deserialize(e){let t=Gr.fromBytes(e),s=t.readByte();switch(s){case 3:case 2:return this.fromBytes_v3(t);case 1:return this.fromBytes_v1(t)}throw new ie(`Calendar state cannot be deserialized because format ${s} is unknown`)}static asBytes_v3(e){let t=new vs,s=this.isBackwardsCompatible_v2(e)?2:3;t.writeByte(s),t.writeByte(e.size);for(let a of e.values())this.writeCalendarState_v3(t,a);return t.toBytes()}static isBackwardsCompatible_v2(e){for(let t of e.values())for(let s of t.slots)if(!(s instanceof Pi||s instanceof ds))return!1;return!0}static writeCalendarState_v3(e,t){if(t.uniqueId.length>De.kAuthIdLength)throw new ie("Calendar day state ID is not valid");this.writeUniqueId(e,t.uniqueId,De.kAuthIdLength);let s=t.slots;e.writeInt32(s.length);for(let a=0;a<s.length;a++){let o=s[a];if(o.entryId.length>De.kAutoIdLength)throw new ie("Calendar entry id is not valid");if(o instanceof Pi)this.writeSingleEntryCalendarSlot_v3(e,o);else if(o instanceof ds)this.writeGroupCalendarSlot_v3(e,o);else if(o instanceof Fr)this.writeOpenCalendarSlot_v3(e,o);else throw new ie(`Unsupported staff calendar slot: ${o.constructor.name}`)}}static writeSingleEntryCalendarSlot_v3(e,t){e.writeByte(this.SINGLE_ENTRY_SLOT_ID),this.writeUniqueId(e,t.entryId,De.kAutoIdLength),e.writeInt32(t.timeOfDay.inMinutes),e.writeInt32(t.duration.asMilliseconds())}static writeGroupCalendarSlot_v3(e,t){e.writeByte(this.GROUP_ENTRY_SLOT_ID),this.writeUniqueId(e,t.entryId,De.kAutoIdLength),this.writeUniqueId(e,t.serviceId,De.kAutoIdLength),e.writeInt32(t.timeOfDay.inMinutes),e.writeInt32(t.duration.asMilliseconds()),e.writeInt32(t.capacity.from),e.writeInt32(t.capacity.to),e.writeInt32(t.occupancy)}static writeOpenCalendarSlot_v3(e,t){e.writeByte(this.OPEN_ENTRY_SLOT_ID),this.writeUniqueId(e,t.entryId,De.kAutoIdLength),this.writeUniqueId(e,t.serviceId,De.kAutoIdLength),e.writeInt32(t.timeOfDay.inMinutes),e.writeInt32(t.duration.asMilliseconds()),e.writeBool(t.isOpen)}static fromBytes_v3(e){let t=new Map,s=e.readByte();for(let a=0;a<s;a++){let o=this.readCalendarState_v3(e);t.set(o.uniqueId,o)}return t}static readCalendarState_v3(e){let t=this.readUniqueId(e,De.kAuthIdLength),s=[],a=e.readInt32();for(let o=0;o<a;o++){let u=e.readByte();if(u===this.SINGLE_ENTRY_SLOT_ID)s.push(this.readSingleEntryCalendarSlot_v3(e));else if(u===this.GROUP_ENTRY_SLOT_ID)s.push(this.readGroupCalendarSlot_v3(e));else if(u===this.OPEN_ENTRY_SLOT_ID)s.push(this.readOpenCalendarSlot_v3(e));else throw new ie(`Unknown staff calendar slot type: ${u}`)}return new Os(t,s)}static readSingleEntryCalendarSlot_v3(e){let t=this.readUniqueId(e,De.kAutoIdLength),s=Pt.fromMinutes(e.readInt32()),a=oe.default.duration(e.readInt32());
3return new Pi(t,s,a)}static readGroupCalendarSlot_v3(e){let t=this.readUniqueId(e,De.kAutoIdLength),s=this.readUniqueId(e,De.kAutoIdLength),a=Pt.fromMinutes(e.readInt32()),o=oe.default.duration(e.readInt32()),u=jd.between(e.readInt32(),e.readInt32()),c=e.readInt32();return new ds(t,a,o,s,u,c)}static readOpenCalendarSlot_v3(e){let t=this.readUniqueId(e,De.kAutoIdLength),s=this.readUniqueId(e,De.kAutoIdLength),a=Pt.fromMinutes(e.readInt32()),o=oe.default.duration(e.readInt32()),u=e.readBool();return new Fr(t,a,o,s,u)}static fromBytes_v1(e){let t=new Map,s=e.readByte();for(let a=0;a<s;a++){let o=this.readCalendarState_v1(e);t.set(o.uniqueId,o)}return t}static readCalendarState_v1(e){let t=this.readUniqueId(e,De.kAuthIdLength),s=e.readInt32(),a=new Map;for(let o=0;o<s;o++){let u=[],c=e.readInt32(),l=e.readByte();a.set(c,u);for(let h=0;h<l;h++)u.push(this.readUniqueId(e,De.kAutoIdLength))}return Os.fromLegacyCalendarState(t,a)}static writeUniqueId(e,t,s){let a=0;for(let o=0;o<t.length;o++)e.writeByte(t.charCodeAt(o)),a++;for(;a<s;)e.writeByte(0),a++}static readUniqueId(e,t){let s=[];for(let a=0;a<t;a++){let o=e.readByte();o>0&&s.push(o)}return String.fromCharCode(...s)}}return n.SINGLE_ENTRY_SLOT_ID=1,n.GROUP_ENTRY_SLOT_ID=2,n.OPEN_ENTRY_SLOT_ID=3,n})(),FN=(()=>{class n extends wr{constructor(e,t,s){super(),this.dayOfYear=e,this.timezone=t,this.calendars=s,this.date=this.dayOfYear.toDate(g.ofRegion(this.timezone))}get $typeId(){return n.TYPE_ID}get timestamp(){return this.date.valueOf()}static fromMap(e,t){return new n(e.fromData(r.get(t,"dayOfYear")),y(r.get(t,"timezone"),Ee),yR.deserialize(e.fromBinaryBlob(r.getRaw(t,"data"))))}toMap(e){return{dayOfYear:e.toData(this.dayOfYear),date:e.encodeDate(this.date),timezone:m(this.timezone),data:e.toBinaryBlob(yR.serialize(this.calendars))}}clone(){return new n(this.dayOfYear.clone(),this.timezone,ee(this.calendars,e=>e.clone()))}isSame(e){return e===this?!0:re(e.calendars,this.calendars,(t,s)=>d(t,s))&&d(e.dayOfYear,this.dayOfYear)&&e.timezone===this.timezone}getCalendarState(e){var t;return(t=this.calendars.get(e??wr.GLOBAL_STATE_ID))!==null&&t!==void 0?t:null}getOrCreateCalendarState(e){var t;let s=(t=this.calendars.get(e??wr.GLOBAL_STATE_ID))!==null&&t!==void 0?t:null;return k(s)&&(s=Os.empty(e),this.calendars.set(e,s)),s}toDiagnosticsObject(){let e={};return this.calendars.forEach((t,s)=>{e[s]=t.toDiagnosticsObject()}),{dayOfYear:this.dayOfYear.uniqueId,date:g.encodeDate(this.date),timezone:m(this.timezone),calendars:e}}}return n.TYPE_ID="3aabd3d773e34aab89ca32cc7f9fd6a6",n})(),pD=class extends f{build(i,e){return FN.fromMap(i,e)}},Mn=(()=>{class n extends b{constructor(e,t,s){super(),this.year=e,this.month=t,this.day=s,this.uniqueId=`${e}.${t.toString().padStart(2,"0")}.${s.toString().padStart(2,"0")}`}get $typeId(){return n.TYPE_ID}static fromDate(e){return new n(e.year(),e.month()+1,e.date())}toDate(e){return e.at(this.year,this.month-1,this.day)}toDateAndTime(e,t){return t.at(this.year,this.month-1,this.day,e.hour,e.minute)}static fromMap(e,t){return new n(r.get(t,"year"),r.get(t,"month"),r.get(t,"day"))}toMap(e){return{year:this.year,month:this.month,day:this.day}}clone(){return new n(this.year,this.month,this.day)}isSame(e){return this===e?!0:e.year===this.year&&e.month===this.month&&e.day===this.day}static dateToUniqueId(e){return`${e.year}.${e.month.toString().padStart(2,"0")}.${e.day.toString().padStart(2,"0")}`}}return n.TYPE_ID="7e5f74d6fa6f4ff3b2a5fb128cefed42",n})(),gD=class extends f{build(i,e){return Mn.fromMap(i,e)}},bR=(()=>{class n{static serialize(e){return this.asBytes(e)}static deserialize(e,t){let s=Gr.fromBytes(e),a=s.readByte();if(a===1)return this.fromBytes(s,t);throw new ie(`Calendar state cannot be deserialized because format ${a} is unknown`)}static asBytes(e){let t=new vs;t.writeByte(1),t.writeByte(e.size);for(let a of e.values())this.writeDailyCalendarSnapshot(t,a);return t.toBytes()}static writeDailyCalendarSnapshot(e,t){e.writeByte(t.dayOfMonth),e.writeByte(t.calendars.size);for(let s of t.calendars.values())this.writeCalendarState(e,s)}static writeCalendarState(e,t){if(t.uniqueId.length>
3De.kAuthIdLength)throw new ie("Calendar day state ID is not valid");this.writeUniqueId(e,t.uniqueId,De.kAuthIdLength);let s=t.slots;e.writeInt32(s.length);for(let a=0;a<s.length;a++){let o=s[a];if(o.entryId.length>De.kAutoIdLength)throw new ie("Calendar entry ID is not valid");if(o instanceof Pi)this.writeSingleEntryCalendarSlot(e,o);else if(o instanceof ds)this.writeGroupCalendarSlot(e,o);else if(o instanceof Fr)this.writeOpenCalendarSlot(e,o);else throw new ie(`Unsupported staff calendar slot: ${o.constructor.name}`)}}static writeSingleEntryCalendarSlot(e,t){e.writeByte(this.SINGLE_ENTRY_SLOT_ID),this.writeUniqueId(e,t.entryId,De.kAutoIdLength),e.writeInt32(t.timeOfDay.inMinutes),e.writeInt32(t.duration.asMilliseconds())}static writeGroupCalendarSlot(e,t){e.writeByte(this.GROUP_ENTRY_SLOT_ID),this.writeUniqueId(e,t.entryId,De.kAutoIdLength),this.writeUniqueId(e,t.serviceId,De.kAutoIdLength),e.writeInt32(t.timeOfDay.inMinutes),e.writeInt32(t.duration.asMilliseconds()),e.writeInt32(t.capacity.from),e.writeInt32(t.capacity.to),e.writeInt32(t.occupancy)}static writeOpenCalendarSlot(e,t){e.writeByte(this.OPEN_ENTRY_SLOT_ID),this.writeUniqueId(e,t.entryId,De.kAutoIdLength),this.writeUniqueId(e,t.serviceId,De.kAutoIdLength),e.writeInt32(t.timeOfDay.inMinutes),e.writeInt32(t.duration.asMilliseconds()),e.writeBool(t.isOpen)}static fromBytes(e,t){let s=new Map,a=e.readByte();for(let o=0;o<a;o++){let u=this.readCalendarSnapshot(e,t);s.set(u.dayOfMonth,u)}return s}static readCalendarSnapshot(e,t){let s=new Map,a=e.readByte(),o=e.readByte();for(let u=0;u<o;u++){let c=this.readCalendarState(e);s.set(c.uniqueId,c)}return t(s,a)}static readCalendarState(e){let t=this.readUniqueId(e,De.kAuthIdLength),s=[],a=e.readInt32();for(let o=0;o<a;o++){let u=e.readByte();if(u===this.SINGLE_ENTRY_SLOT_ID)s.push(this.readSingleEntryCalendarSlot(e));else if(u===this.GROUP_ENTRY_SLOT_ID)s.push(this.readGroupCalendarSlot(e));else if(u===this.OPEN_ENTRY_SLOT_ID)s.push(this.readOpenCalendarSlot(e));else throw new ie(`Unknown staff calendar slot type: ${u}`)}return new Os(t,s)}static readSingleEntryCalendarSlot(e){let t=this.readUniqueId(e,De.kAutoIdLength),s=Pt.fromMinutes(e.readInt32()),a=oe.default.duration(e.readInt32());return new Pi(t,s,a)}static readGroupCalendarSlot(e){let t=this.readUniqueId(e,De.kAutoIdLength),s=this.readUniqueId(e,De.kAutoIdLength),a=Pt.fromMinutes(e.readInt32()),o=oe.default.duration(e.readInt32()),u=jd.between(e.readInt32(),e.readInt32()),c=e.readInt32();return new ds(t,a,o,s,u,c)}static readOpenCalendarSlot(e){let t=this.readUniqueId(e,De.kAutoIdLength),s=this.readUniqueId(e,De.kAutoIdLength),a=Pt.fromMinutes(e.readInt32()),o=oe.default.duration(e.readInt32()),u=e.readBool();return new Fr(t,a,o,s,u)}static writeUniqueId(e,t,s){let a=0;for(let o=0;o<t.length;o++)e.writeByte(t.charCodeAt(o)),a++;for(;a<s;)e.writeByte(0),a++}static readUniqueId(e,t){let s=[];for(let a=0;a<t;a++){let o=e.readByte();o>0&&s.push(o)}return String.fromCharCode(...s)}}return n.SINGLE_ENTRY_SLOT_ID=1,n.GROUP_ENTRY_SLOT_ID=2,n.OPEN_ENTRY_SLOT_ID=3,n})(),qN=(()=>{class n extends wr{constructor(e,t,s){super(),this.monthOfYear=e,this.timezone=t,this.calendars=s,this.date=this.monthOfYear.toDate(g.ofRegion(this.timezone))}get $typeId(){return n.TYPE_ID}get timestamp(){return this.date.valueOf()}static empty(e,t){return new n(e,t,new Map)}static fromMap(e,t){let s=e.fromData(r.get(t,"monthOfYear")),a=y(r.get(t,"timezone"),Ee),o=bR.deserialize(e.fromBinaryBlob(r.getRaw(t,"data")),(u,c)=>new Ya(new Mn(s.year,s.month,c),a,u));return new n(s,a,o)}toMap(e){return{monthOfYear:e.toData(this.monthOfYear),date:e.encodeDate(this.date),timezone:m(this.timezone),data:e.toBinaryBlob(bR.serialize(this.calendars))}}clone(){return new n(this.monthOfYear.clone(),this.timezone,ee(this.calendars,e=>e.clone()))}isSame(e){return e===this?!0:re(e.calendars,this.calendars,(t,s)=>d(t,s))&&d(e.monthOfYear,this.monthOfYear)&&e.timezone===this.timezone}addDailyCalendar(e){let t=e.dayOfYear.day;return this.calendars.has(e.dayOfYear.day)?!1:(this.calendars.set(t,Ya.fromOther(e)),!0)}getDailyCalendar(e){var t;return(t=this.calendars.get(e))!==null&&t!==void 0?t:null}getOrCreateDailyCalendar(e){var t;let s=(t=this.calendars.get(e))!==null&&t!==void 0?t:null;return k(s)&&(s=Ya.empty(new Mn(this.monthOfYear.year,this.monthOfYear.month,e),this.timezone),this.calendars.set(e,s)),s}toDiagnosticsObject(){let e={};
3return this.calendars.forEach((t,s)=>{e[s.toString()]=t.toDiagnosticsObject()}),{monthOfYear:this.monthOfYear.uniqueId,date:g.encodeDate(this.date),timezone:m(this.timezone),calendars:e}}}return n.TYPE_ID="30538a42dc5c4377bf5976e5bf91dc94",n})(),mD=class extends f{build(i,e){return qN.fromMap(i,e)}},$a=(()=>{class n extends b{constructor(e,t,s){super(),this.income=e,this.orderCount=t,this.ticketCount=s}get $typeId(){return n.TYPE_ID}static empty(e){return new n(Y.zero(e),0,0)}static fromMap(e,t){return new n(Y.decode(r.get(t,"income")),r.get(t,"orderCount"),r.get(t,"ticketCount"))}toMap(e){return{income:this.income.encode(),orderCount:this.orderCount,ticketCount:this.ticketCount}}clone(){return new n(this.income.clone(),this.orderCount,this.ticketCount)}isSame(e){return e===this?!0:d(e.income,this.income)&&e.orderCount===this.orderCount&&e.ticketCount===this.ticketCount}}return n.TYPE_ID="e2d36aca101a41769390d5b0e275e8eb",n})(),ID=class extends f{build(i,e){return $a.fromMap(i,e)}},NS=(()=>{class n extends b{constructor(e,t,s){super(),this.offlineTickets=e,this.onlineTickets=t,this.totalTickets=s}get $typeId(){return n.TYPE_ID}static empty(){return new n(0,0,0)}static legacy(e){return new n(0,0,e)}static fromMap(e,t){return new n(r.getNumber(t,"offlineTickets"),r.getNumber(t,"onlineTickets"),r.getNumber(t,"totalTickets"))}toMap(e){return{offlineTickets:this.offlineTickets,onlineTickets:this.onlineTickets,totalTickets:this.totalTickets}}clone(){return new n(this.offlineTickets,this.onlineTickets,this.totalTickets)}isSame(e){return e===this?!0:e.offlineTickets===this.offlineTickets&&e.onlineTickets===this.onlineTickets&&e.totalTickets===this.totalTickets}}return n.TYPE_ID="2feb9a35c363434b99351d6fe42344e1",n})(),DD=class extends f{build(i,e){return NS.fromMap(i,e)}},La=(()=>{class n extends b{constructor(e){super(),this.ticketsSalesPerEvent=e}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}static empty(){return new n(new Map)}static fromMap(e,t){return new n(r.getMap(t,"ticketsSalesPerEvent",(s,a)=>({key:s,value:e.fromData(a)})))}toMap(e){return{ticketsSalesPerEvent:se(this.ticketsSalesPerEvent,(t,s)=>({key:t,value:e.toData(s)}))}}clone(){return new n(ee(this.ticketsSalesPerEvent,e=>e.clone()))}isSame(e){return e===this?!0:re(e.ticketsSalesPerEvent,this.ticketsSalesPerEvent,(t,s)=>d(t,s))}}return n.TYPE_ID="3dbd2ce2a19a42f4b3d368f2e2d011c3",n.SCHEMA_VERSION=2,n})(),vD=class extends f{build(i,e){return La.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){var t;let s=r.getVersionRange(e);if(s.contains(La.SCHEMA_VERSION))return e;if(s.isGreaterThan(La.SCHEMA_VERSION))return null;let a=s.to;return a<2&&((t=e.ticketsSalesPerEvent)!==null&&t!==void 0||(e.ticketsSalesPerEvent=se(r.getMap(e,"ticketsSoldPerEvent",(o,u)=>({key:o,value:NS.legacy(Number(u))})),(o,u)=>({key:o,value:i.toData(u)}))),a=2),e.$schema_version=D.encodedExactly(a),e}},YN=(()=>{class n extends b{constructor(e,t,s,a,o,u,c,l){super(),this.businessRef=e,this.timezone=t,this.day=s,this.currency=a,this.cashStats=o,this.creditCardStats=u,this.onlineStats=c,this.ticketStats=l}get $typeId(){return n.TYPE_ID}static empty(e,t,s,a){return new n(e,t,a,s,$a.empty(s),$a.empty(s),$a.empty(s),La.empty())}static fromMap(e,t){return new n(j.mustDecode(r.get(t,"businessRef")),y(r.get(t,"timezone"),Ee),e.fromData(r.get(t,"day")),y(r.get(t,"currency"),Ae),e.fromData(r.get(t,"cashStats")),e.fromData(r.get(t,"credit
3CardStats")),e.fromData(r.get(t,"onlineStats")),e.fromData(r.get(t,"ticketStats")))}toMap(e){return{businessRef:this.businessRef.encode(),timezone:m(this.timezone),day:e.toData(this.day),currency:m(this.currency),cashStats:e.toData(this.cashStats),creditCardStats:e.toData(this.creditCardStats),onlineStats:e.toData(this.onlineStats),ticketStats:e.toData(this.ticketStats)}}clone(){return new n(this.businessRef.clone(),this.timezone,this.day.clone(),this.currency,this.cashStats.clone(),this.creditCardStats.clone(),this.onlineStats.clone(),this.ticketStats.clone())}isSame(e){return e===this?!0:d(e.businessRef,this.businessRef)&&e.timezone===this.timezone&&d(e.day,this.day)&&e.currency===this.currency&&d(e.cashStats,this.cashStats)&&d(e.creditCardStats,this.creditCardStats)&&d(e.onlineStats,this.onlineStats)&&d(e.ticketStats,this.ticketStats)}}return n.TYPE_ID="051e412faf884251a407f03569e5b83e",n})(),yD=class extends f{build(i,e){return YN.fromMap(i,e)}},qn=(function(n){return n.Billingo="billingo",n.Szamlazz="szamlazz",n})(qn||{}),td=class extends b{},Vu=(()=>{class n extends td{constructor(e,t,s,a,o,u){super(),this.accountId=e,this.apiKeySecret=t,this.invoiceTemplateId=s,this.receiptTemplateId=a,this.vat=o,this.allowLegalEntities=u,this.provider=qn.Billingo}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(3,n.SCHEMA_VERSION)}static create(e){return new n(e.accountId,e.apiKeySecret,e.invoiceTemplateId,e.receiptTemplateId,e.vat,e.allowLegalEntities)}static fromMap(e,t){return this.create({accountId:r.getString(t,"accountId"),apiKeySecret:r.getStringOrNull(t,"apiKeySecret"),invoiceTemplateId:r.getStringOrNull(t,"invoiceTemplateId"),receiptTemplateId:r.getStringOrNull(t,"receiptTemplateId"),vat:y(r.getString(t,"vat"),te),allowLegalEntities:r.getBoolean(t,"allowLegalEntities")})}toMap(e){return{accountId:this.accountId,apiKeySecret:this.apiKeySecret,provider:m(this.provider),vat:m(this.vat),invoiceTemplateId:this.invoiceTemplateId,receiptTemplateId:this.receiptTemplateId,allowLegalEntities:this.allowLegalEntities}}clone(){return n.create({accountId:this.accountId,apiKeySecret:this.apiKeySecret,invoiceTemplateId:this.invoiceTemplateId,receiptTemplateId:this.receiptTemplateId,vat:this.vat,allowLegalEntities:this.allowLegalEntities})}isSame(e){return this===e?!0:this.accountId===e.accountId&&this.apiKeySecret===e.apiKeySecret&&this.vat===e.vat&&this.allowLegalEntities===e.allowLegalEntities&&this.invoiceTemplateId===e.invoiceTemplateId&&this.receiptTemplateId===e.receiptTemplateId}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="c41400e6263c49d896a5f3077e62d2e8",n.SCHEMA_VERSION=5,n})(),bD=class extends f{build(i,e){return Vu.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(Vu.SCHEMA_VERSION))return e;if(t.isGreaterThan(Vu.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(s=2,r.set(e,"apiKeySecret",null)),s<3&&(s=3,e.accountId=e.uniqueId),s<4&&(s=4,e.allowLegalEntities=!1),s<5&&(s=5),e.$schema_version=D.encodedExactly(s),e}},$N=(()=>{class n extends td{constructor(e,t,s,a,o){super(),this.accountId=e,this.apiKeySecret=t,this.invoicePrefix=s,this.vat=a,this.allowLegalEntities=o,this.provider=qn.Szamlazz}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.accountId,e.apiKeySecret,e.invoicePrefix,e.vat,e.allowLegalEntities)}static fromMap(e,t){return new n(r.get(t,"accountId"),r.get(t,"apiKeySecret"),r.get(t,"invoicePrefix"),y(r.get(t,"vat"),te),r.get(t,"allowLegalEntities"))}toMap(e){return{accountId:this.accountId,apiKeySecret:this.apiKeySecret,invoicePrefix:this.invoicePrefix,provider:m(this.provider),vat:m(this.vat),allowLegalEntities:this.allowLegalEntities}}clone(){return new n(this.accountId,this.apiKeySecret,this.invoicePrefix,this.vat,this.allowLegalEntities)}isSame(e){return this===e?!0:this.accountId===e.accountId&&this.apiKeySecret===e.apiKeySecret&&this.invoicePrefix===e.invoicePrefix&&this.vat===e.vat&&this.allowLegalEntities===e.allowLegalEntities}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="d528f8dfc97244bdb9b089a78f35c320",n})(),ED=class extends f{build(i,e){return $N.fromMap(i,e)}},LN=(()=>{class n extends b{constructor(e,t,s,a,o,u,c){super(),this.fullName=e,this.motherName=t,this.placeOfBirth=s,this.dateOfBirth=a,this.taxI
3dentifier=o,this.tajNumber=u,this.homeAddress=c}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.fullName,e.motherName,e.placeOfBirth,e.dateOfBirth,e.taxIdentifier,e.tajNumber,e.homeAddress)}static fromMap(e,t){return new n(r.get(t,"fullName"),r.get(t,"motherName"),r.get(t,"placeOfBirth"),e.fromData(r.get(t,"dateOfBirth")),r.get(t,"taxIdentifier"),r.get(t,"tajNumber"),r.get(t,"homeAddress"))}toMap(e){return{fullName:this.fullName,motherName:this.motherName,placeOfBirth:this.placeOfBirth,dateOfBirth:e.toData(this.dateOfBirth),taxIdentifier:this.taxIdentifier,tajNumber:this.tajNumber,homeAddress:this.homeAddress}}clone(){return new n(this.fullName,this.motherName,this.placeOfBirth,this.dateOfBirth.clone(),this.taxIdentifier,this.tajNumber,this.homeAddress)}isSame(e){return this===e?!0:e.fullName==this.fullName&&e.motherName==this.motherName&&e.placeOfBirth==this.placeOfBirth&&d(e.dateOfBirth,this.dateOfBirth)&&e.taxIdentifier==this.taxIdentifier&&e.tajNumber==this.tajNumber&&e.homeAddress==this.homeAddress}}return n.TYPE_ID="1c5151986b1248b49da2aaaa97b24819",n})(),wD=class extends f{build(i,e){return LN.fromMap(i,e)}},Hx=28,SD=(function(n){return n.Pending="PENDING",n.Completed="COMPLETED",n.Expired="EXPIRED",n})(SD||{}),VN=(()=>{class n extends b{constructor(e,t,s,a,o,u){super(),this.uniqueId=e,this.creationDate=t,this.expirationDate=s,this.orderId=a,this.businessRef=o,this.status=u}get $typeId(){return n.TYPE_ID}static fromOrder(e,t){return new n(Ft({length:Hx}),fe.now(),t,e.uniqueId,e.businessRef.clone(),SD.Pending)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),e.decodeDate(r.get(t,"creationDate")),e.decodeDate(r.get(t,"expirationDate")),r.get(t,"orderId"),j.mustDecode(r.get(t,"businessRef")),y(r.get(t,"$status"),SD))}toMap(e){return{uniqueId:this.uniqueId,creationDate:e.encodeDate(this.creationDate),expirationDate:e.encodeDate(this.expirationDate),orderId:this.orderId,businessRef:this.businessRef.encode(),$status:m(this.status)}}clone(){return new n(this.uniqueId,g.cloneDate(this.creationDate),g.cloneDate(this.expirationDate),this.orderId,this.businessRef.clone(),this.status)}isSame(e){return this===e?!0:e.uniqueId==this.uniqueId&&e.creationDate===this.creationDate&&e.expirationDate===this.expirationDate&&e.orderId==this.orderId&&e.status===this.status&&d(e.businessRef,this.businessRef)}copyWith(e){var t,s,a,o,u,c;return new n((t=e.uniqueId)!==null&&t!==void 0?t:this.uniqueId,(s=e.creationDate)!==null&&s!==void 0?s:g.cloneDate(this.creationDate),(a=e.expirationDate)!==null&&a!==void 0?a:g.cloneDate(this.expirationDate),(o=e.orderId)!==null&&o!==void 0?o:this.orderId,(u=e.businessRef)!==null&&u!==void 0?u:this.businessRef.clone(),(c=e.status)!==null&&c!==void 0?c:this.status)}static encodedStatusSafe(e){return m(e)}}return n.TYPE_ID="f5d92e82571a4af4908bc2f0db57057f",n})(),TD=class extends f{build(i,e){return VN.fromMap(i,e)}},Va=(()=>{class n extends b{constructor(e,t,s,a){super(),this.provider=e,this.uniqueId=t,this.name=s,this.downloadUrl=a}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static create(e){return new n(e.provider,e.uniqueId,e.name,e.downloadUrl)}static fromMap(e,t){return new n(y(r.get(t,"provider"),qn),r.getString(t,"uniqueId"),r.getString(t,"name"),r.getStringOrNull(t,"downloadUrl"))}toMap(e){return{provider:m(this.provider),uniqueId:this.uniqueId,name:this.name,downloadUrl:this.downloadUrl}}clone(){return new n(this.provider,this.uniqueId,this.name,this.downloadUrl)}isSame(e){return this===e?!0:this.provider===e.provider&&this.uniqueId===e.uniqueId&&this.name===e.name&&this.downloadUrl===e.downloadUrl}}return n.TYPE_ID="5b1cc85d2b434e40935cf86659364b5e",n.SCHEMA_VERSION=2,n})(),OD=class extends f{build(i,e){return Va.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(Va.SCHEMA_VERSION))return e;if(t.isGreaterThan(Va.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(e.name=e.uniqueId,s=2),e.$schema_version=D.encodedExactly(s),e}},nd=(()=>{class n extends b{constructor(e,t,s,a){super(),this.provider=e,this.uniqueId=t,this.name=s,this.downloadUrl=a}get $typeId(){return n.TYPE_ID}get sanitizedName(){let e=this.name;return e&&(e=e.normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),""),e.replace(/[^a-zA-Z0-9]/g,"_"))}static create(e){return new n(e.provider,e.uniqueId,e.name,e.downloadUrl)}static fromLegacy(e){return new n(e.provider,e.uniqueId,e.name,e.downloadUrl)}static fromMap(e,t){return new n(y(r.get(t,"provider"),qn),r.getString(t,"uniqueId"),r.getString(t,"name"),r.getStringOrNull(t,"downloadUrl"))}toMap(e){return{provider:m(this.provider),uniqueId:this.uniqueId,name:this.name,downloadUrl:this.downloadUrl}}clone(){return new n(this.provider,this.uniqueId,this.name,this.downloadUrl)}isSame(e){return this===e?!0:this.provider===e.provider&&this.uniqueId===e.uniqueId&&this.name===e.name&&this.downloadUrl===e.downloadUrl}}return n.TYPE_ID="17968d635bcf40b3a70ef63e1ff7dd1c",n})(),RD=class extends f{build(i,e){return nd.fromMap(i,e)}},hs=(function(n){return n.Create="CREATE",n.Cancel="CANCEL",n.Modify="MODIFY",n})(hs||{}),Zi=(()=>{class n extends b{constructor(e,t){super(),this.type=e,this.invoices=t}get isEmpty(){return this.invoices.length<=0}get numberOfInvoices(){return this.invoices.length}get $typeId(){return n.TYPE_ID}static asCreate(e){return new n(hs.Create,[e])}static asCancel(e){return new n(hs.Cancel,[e])}static fromMap(e,t){return new n(y(r.get(t,"type"),hs),r.getList(t,"invoices",s=>e.fromData(s)))}toMap(e){return{type:m(this.type),invoices:this.invoices.map(t=>e.toData(t))}}clone(){return new n(this.type,this.invoices.map(e=>e.clone()))}isSame(e){return this===e?!0:this.type===e.type&&P(e.invoices,this.invoices,d)}getInvoice(e){return this.invoices[e]}getAllInvoices(){return[...this.invoices]}}return n.TYPE_ID="a975a3baf62d4b8889483520d3119a03",n})(),MD=class extends f{build(i,e){return Zi.fromMap(i,e)}};function Qs(n){return m(n).toLowerCase()}var mt=(function(n){return n.Order="Order",n.Supplement="Supplement",n.Product="Product",n.ApplicationFee="ApplicationFee",n.Donation="Donation",n})(mt||{}),ii=(()=>{class n extends b{constructor(e,t,s){super(),this.uniqueId=e,this.scope=t,this.actions=s}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static forOrder(e){return new n(Qs(mt.Order),mt.Order,[Zi.asCreate(e)])}static forSupplement(e){return new n(Qs(mt.Supplement),mt.Supplement,[Zi.asCreate(e)])}static forProduct(e){return new n(Qs(mt.Product),mt.Product,[Zi.asCreate(e)])}static forApplicationFee(e){return new n(Qs(mt.ApplicationFee),mt.ApplicationFee,[Zi.asCreate(e)])}static forDonation(e){return new n(Qs(mt.Donation),mt.Donation,[Zi.asCreate(e)])}static fromMap(e,t){return new n(r.getString(t,"uniqueId"),y(r.getString(t,"scope"),mt),r.getList(t,"actions",s=>e.fromData(s)))}toMap(e){return{uniqueId:this.uniqueId,scope:m(this.scope),actions:this.actions.map(t=>e.toData(t))}}clone(){return new n(this.uniqueId,this.scope,this.actions.map(e=>e.clone()))}isSame(e){return this===e?!0:this.uniqueId===e.uniqueId&&this.scope===e.scope&&P(e.actions,this.actions,d)}hasActiveInvoice(){return this.actions.length<=0?!1:this.actions[this.actions.length-1].type===hs.Create}tryFindActiveInvoice(){let t=(()=>
3{if(this.actions.length<=0)return null;let s=this.actions[this.actions.length-1];return s.type!=hs.Create?null:s})();return t==null||t.numberOfInvoices<=0||t.numberOfInvoices>1?null:t.getInvoice(0)}addAction(e){this.actions.push(e)}getInvoicesForExport(){let e=[];for(let t of this.actions)e.push(...t.getAllInvoices());return e}getInvoicesForCheckout(){let e=[];return this.actions.length>0&&this.actions[0].type==hs.Create&&e.push(...this.actions[0].getAllInvoices()),e}}return n.TYPE_ID="94c4537c3a8e47598532f69cd4ada772",n.SCHEMA_VERSION=2,n})(),ND=class extends f{build(i,e){return ii.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(ii.SCHEMA_VERSION))return e;if(t.isGreaterThan(ii.SCHEMA_VERSION))return null;let s=t.to;if(s<2){let a=y(r.getString(e,"scope"),mt);e.uniqueId=Qs(a),s=2}return e.$schema_version=D.encodedExactly(s),e}};function Gx(n){let i=null,e=null,t=null,s=null,a=null;for(let o=0;o<n.length;o++){let u=n[o].scope;switch(u){case mt.Order:{if(i!=null)return null;i=n[o];break}case mt.Supplement:{if(e!=null)return null;e=n[o];break}case mt.Product:{if(t!=null)return null;t=n[o];break}case mt.ApplicationFee:{if(s!=null)return null;s=n[o];break}case mt.Donation:{if(a!=null)return null;a=n[o];break}default:Zt(u)}}return{order:i,supplement:e,product:t,applicationFee:s,donation:a}}var za=(()=>{class n extends b{constructor(e){super(),this.entries=e}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}static fromInvoices(e){let t=[];return e.orderInvoice!=null&&t.push(ii.forOrder(e.orderInvoice)),e.supplementInvoice!=null&&t.push(ii.forSupplement(e.supplementInvoice)),e.productInvoice!=null&&t.push(ii.forProduct(e.productInvoice)),e.applicationFeeInvoice!=null&&t.push(ii.forApplicationFee(e.applicationFeeInvoice)),e.donationInvoice!=null&&t.push(ii.forDonation(e.donationInvoice)),new n(t)}static fromLegacy(e){return n.fromInvoices({orderInvoice:e.orderInvoice,supplementInvoice:null,productInvoice:null,applicationFeeInvoice:e.applicationFeeInvoice,donationInvoice:null})}static fromMap(e,t){return new n(r.getList(t,"entries",s=>e.fromData(s)))}toMap(e){return{entries:this.entries.map(t=>e.toData(t))}}clone(){return new n(ue(this.entries))}isSame(e){return this===e?!0:P(e.entries,this.entries,d)}hasAnyEntries(){return this.entries.length>0}hasAnyActiveEntries(){for(let e=0;e<this.entries.length;e++)if(this.entries[e].hasActiveInvoice())return!0;return!1}getInvoiceGroupByScope(e){for(let t=0;t<this.entries.length;t++)if(this.entries[t].scope===e)return this.entries[t];return null}getInvoicesForExport(){let e=[];for(let t of this.entries)e.push(...t.getInvoicesForExport());return e}getInvoicesForCheckout(){let e=[];for(let t of this.entries)e.push(...t.getInvoicesForCheckout());return e}getLegacyGroups(){return Gx(this.entries)}}return n.TYPE_ID="ce560f0f0a1844d4b7e2bec2fc830c95",n.SCHEMA_VERSION=6,n})(),PD=class extends f{build(i,e){return za.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(za.SCHEMA_VERSION))return e;if(t.isGreaterThan(za.SCHEMA_VERSION))return null;let s=t.to;if(s<2&&(s=2),s<3&&(s=3),s<4&&(s=4),s<5&&(s=5),s<6){let a=i.fromDataOrNull(r.getRecordOrNull(e,"order")),o=i.fromDataOrNull(r.getRecordOrNull(e,"supplement")),u=i.fromDataOrNull(r.getRecordOrNull(e,"product")),c=i.fromDataOrNull(r.getRecordOrNull(e,"applicationFee")),l=i.fromDataOrNull(r.getRecordOrNull(e,"donation")),h=[];a!=null&&h.push(a),o!=null&&h.push(o),u!=null&&h.push(u),c!=null&&h.push(c),l!=null&&h.push(l),e.entries=h.map(p=>i.toData(p)),s=6}return e.$schema_version=D.encodedExactly(s),e}migrateFromCurrentSchemaVersion(i,e,t){let s=e.$schemaVersion.to;if(s>=6){let a=e.getLegacyGroups();if(a==null)return t;t.order=i.toDataOrNull(a.order),t.supplement=i.toDataOrNull(a.supplement),t.product=i.toDataOrNull(a.product),t.applicationFee=i.toDataOrNull(a.applicationFee),t.donation=i.toDataOrNull(a.donation),delete t.entries,t.$schema_version=D.encodedBetween(3,5),s=5}return t}},AD=(function(n){return n.Pending="PENDING",n.Completed="COMPLETED",n})(AD||{}),zN=(()=>{class n extends b{constructor(e,t,s,a,o,u){super(),this.uniqueId=e,this.creationDate=t,this.status=s,this.order=a,this.paymentAccountId=o,this.errorCode=u}get $typeId(){return n.TYPE_ID}
3static create(e,t,s){return new n(e.uniqueId,fe.now(),AD.Pending,e,t,s)}static fromMap(e,t){let s=e.fromData(r.get(t,"order"));return new n(r.getString(t,"uniqueId"),e.decodeDate(r.getInteger(t,"creationDate")),y(r.getString(t,"$status"),AD),s,r.getString(t,"paymentAccountId"),r.getString(t,"errorCode"))}toMap(e){return{uniqueId:this.uniqueId,creationDate:e.encodeDate(this.creationDate),$status:m(this.status),order:e.toData(this.order),paymentAccountId:this.paymentAccountId,errorCode:this.errorCode,businessRef:this.order.businessRef.encode(),orderId:this.order.uniqueId,eventId:this.order instanceof We?this.order.eventId:this.order instanceof je?this.order.eventId:null}}clone(){return new n(this.uniqueId,g.cloneDate(this.creationDate),this.status,this.order.clone(),this.paymentAccountId,this.errorCode)}isSame(e){return this===e?!0:e.uniqueId===this.uniqueId&&e.creationDate===this.creationDate&&e.status===this.status&&d(e.order,this.order)&&e.paymentAccountId===this.paymentAccountId&&e.errorCode===this.errorCode}copyWith(e){var t,s,a,o,u,c;return new n((t=e.uniqueId)!==null&&t!==void 0?t:this.uniqueId,(s=e.creationDate)!==null&&s!==void 0?s:g.cloneDate(this.creationDate),(a=e.status)!==null&&a!==void 0?a:this.status,(o=e.order)!==null&&o!==void 0?o:this.order.clone(),(u=e.paymentAccountId)!==null&&u!==void 0?u:this.paymentAccountId,(c=e.errorCode)!==null&&c!==void 0?c:this.errorCode)}static encodedStatusSafe(e){return m(e)}}return n.TYPE_ID="a8f3c4d1e2b54f6c9a7d8e5b3c2f1a4e",n})(),CD=class extends f{build(i,e){return zN.fromMap(i,e)}},kD=(function(n){return n.Pending="PENDING",n.Completed="COMPLETED",n})(kD||{}),UN=(()=>{class n extends b{constructor(e,t,s,a,o,u,c){super(),this.uniqueId=e,this.creationDate=t,this.status=s,this.organizationId=a,this.paymentAccountId=o,this.paymentAccountName=u,this.invoiceProvider=c}get $typeId(){return n.TYPE_ID}static create(e,t,s,a){return new n(Ft(),fe.now(),kD.Pending,e,t,s,a)}static fromMap(e,t){return new n(r.getString(t,"uniqueId"),e.decodeDate(r.getInteger(t,"creationDate")),y(r.getString(t,"$status"),kD),r.getString(t,"organizationId"),r.getString(t,"paymentAccountId"),r.getString(t,"paymentAccountName"),y(r.getString(t,"invoiceProvider"),qn))}toMap(e){return{uniqueId:this.uniqueId,creationDate:e.encodeDate(this.creationDate),$status:m(this.status),organizationId:this.organizationId,paymentAccountId:this.paymentAccountId,paymentAccountName:this.paymentAccountName,invoiceProvider:m(this.invoiceProvider)}}clone(){return new n(this.uniqueId,g.cloneDate(this.creationDate),this.status,this.organizationId,this.paymentAccountId,this.paymentAccountName,this.invoiceProvider)}isSame(e){return this===e?!0:e.uniqueId===this.uniqueId&&e.creationDate===this.creationDate&&e.status===this.status&&e.organizationId===this.organizationId&&e.paymentAccountId===this.paymentAccountId&&e.paymentAccountName===this.paymentAccountName&&e.invoiceProvider===this.invoiceProvider}copyWith(e){var t,s,a,o,u,c,l;return new n((t=e.uniqueId)!==null&&t!==void 0?t:this.uniqueId,(s=e.creationDate)!==null&&s!==void 0?s:g.cloneDate(this.creationDate),(a=e.status)!==null&&a!==void 0?a:this.status,(o=e.organizationId)!==null&&o!==void 0?o:this.organizationId,(u=e.paymentAccountId)!==null&&u!==void 0?u:this.paymentAccountId,(c=e.paymentAccountName)!==null&&c!==void 0?c:this.paymentAccountName,(l=e.invoiceProvider)!==null&&l!==void 0?l:this.invoiceProvider)}static encodedStatusSafe(e){return m(e)}}return n.TYPE_ID="75a01f1977df403888cadf2e19a604c4",n})(),_D=class extends f{build(i,e){return UN.fromMap(i,e)}},BN=(function(n){return n.Active="Active",n.Inactive="Inactive",n})(BN||{}),zu=(()=>{class n extends b{constructor(e,t,s,a,o,u,c){super(),this.campaignId=e,this.campaignName=t,this.adAccountId=s,this.businessRef=a,this.status=o,this.timedAtHour=u,this.markedForDeactivation=c}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}static create(e){var t;return new n(e.campaignId,e.campaignName,e.adAccountId,e.businessRef,e.status,e.timedAtHour,(t=e.markedForDeactivation)!==null&&t!==void 0?t:!1)}static fromMap(e,t){return n.create({campaignId:r.getString(t,"campaignId"),campaignName:r.getString(t,"campaignName"),adAccountId:r.getString(t,"adAccountId"),businessRef:j.mustDecode(r.getString(t,"businessRef")),status:y(r.getString(t,"status"),BN),timedAtHour:r.getInteger(t,"timedAtHour"),markedForDeactivation:r.getBoolean(t,"markedForDeactivation")})}toMap(e){return{campaignId:this.campaignId,campaignName:this.campaignName,adAccountId:this.adAccountId,businessRef:this.businessRef.encode(),status:m(this.status),timedAtHour:this.timedAtHour,markedForDeactivation:this.markedForDeactivation}}clone(){return this.copyWith()}copyWith({campaignId:e=this.campaignId,campaignName:t=this.campaignName,adAccountId:s=this.adAccountId,businessRef:a=F(this.businessRef),status:o=this.status,timedAtHour:u=this.timedAtHour,markedForDeactivation:c=this.markedForDeactivation}={}){return n.create({campaignId:e,campaignName:t,adAccountId:s,businessRef:a,status:o,timedAtHour:u,markedForDeactivation:c})}isSame(e){return e===this?!0:e.campaignId===this.campaignId&&e.campaignName===this.campaignName&&e.adAccountId===this.adAccountId&&d(e.businessRef,this.businessRef)&&e.status===this.status&&e.timedAtHour===this.timedAtHour&&e.markedForDeactivation===this.markedForDeactivation}}return n.TYPE_ID="571545cf14744688989b5c7631cf6225",n.SCHEMA_VERSION=2,n})(),xD=class extends f{build(i,e){return zu.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(zu.SCHEMA_VERSION))return e;if(t.isGreaterThan(zu.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(r.setIfNullOrUndefined(e,"adAccountId","ZzyEI2MyQqtu2lBdKPBp"),s=2),e.$schema_version=D.encodedExactly(s),e}},HN=(function(n){return n.Active="Active",n.Inactive="Inactive",n})(HN||{}),Uu=(()=>{class n extends b{constructor(e,t,s,a,o,u,c,l,h,p,I,v,E,w,S){super(),this.adSetId=e,this.adSetName=t,this.campaignId=s,this.campaignName=a,this.adAccountId=o,this.businessRef=u,this.eventId=c,this.eventName=l,this.startDate=h,this.endDate=p,this.status=I,this.budget=v,this.includedCustomAudienceId=E,this.excludedCustomAudienceId=w,this.alreadyPurchasedTicket=S}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}static create(e){var t,s,a;return new n(e.adSetId,e.adSetName,e.campaignId,e.campaignName,e.adAccountId,e.businessRef,e.eventId,e.eventName,e.startDate,e.endD
3ate,e.status,e.budget,(t=e.includedCustomAudienceId)!==null&&t!==void 0?t:null,(s=e.excludedCustomAudienceId)!==null&&s!==void 0?s:null,(a=e.alreadyPurchasedTicket)!==null&&a!==void 0?a:[])}static fromMap(e,t){return n.create({adSetId:r.getString(t,"adSetId"),adSetName:r.getString(t,"adSetName"),campaignId:r.getString(t,"campaignId"),campaignName:r.getString(t,"campaignName"),adAccountId:r.getString(t,"adAccountId"),businessRef:j.mustDecode(r.getString(t,"businessRef")),eventId:r.getString(t,"eventId"),eventName:r.getString(t,"eventName"),startDate:e.decodeDate(r.getInteger(t,"startDate")),endDate:e.decodeDate(r.getInteger(t,"endDate")),status:y(r.getString(t,"status"),HN),budget:r.getDouble(t,"budget"),includedCustomAudienceId:r.getStringOrNull(t,"includedCustomAudienceId"),excludedCustomAudienceId:r.getStringOrNull(t,"excludedCustomAudienceId"),alreadyPurchasedTicket:r.getList(t,"alreadyPurchasedTicket",s=>K.decodeString(s))})}toMap(e){return{adSetId:this.adSetId,adSetName:this.adSetName,campaignId:this.campaignId,campaignName:this.campaignName,adAccountId:this.adAccountId,businessRef:this.businessRef.encode(),eventId:this.eventId,eventName:this.eventName,startDate:e.encodeDate(this.startDate),endDate:e.encodeDate(this.endDate),status:m(this.status),budget:this.budget,includedCustomAudienceId:this.includedCustomAudienceId,excludedCustomAudienceId:this.excludedCustomAudienceId,alreadyPurchasedTicket:this.alreadyPurchasedTicket}}clone(){return this.copyWith()}copyWith({adSetId:e=this.adSetId,adSetName:t=this.adSetName,campaignId:s=this.campaignId,campaignName:a=this.campaignName,adAccountId:o=this.adAccountId,businessRef:u=F(this.businessRef),eventId:c=this.eventId,eventName:l=this.eventName,startDate:h=g.cloneDate(this.startDate),endDate:p=g.cloneDate(this.endDate),status:I=this.status,budget:v=this.budget,includedCustomAudienceId:E=this.includedCustomAudienceId,excludedCustomAudienceId:w=this.excludedCustomAudienceId,alreadyPurchasedTicket:S=Te(this.alreadyPurchasedTicket)}={}){return n.create({adSetId:e,adSetName:t,campaignId:s,campaignName:a,adAccountId:o,businessRef:u,eventId:c,eventName:l,startDate:h,endDate:p,status:I,budget:v,includedCustomAudienceId:E,excludedCustomAudienceId:w,alreadyPurchasedTicket:S})}isSame(e){return e===this?!0:e.adSetId===this.adSetId&&e.adSetName===this.adSetName&&e.campaignId===this.campaignId&&e.campaignName===this.campaignName&&e.adAccountId===this.adAccountId&&d(e.businessRef,this.businessRef)&&e.eventId===this.eventId&&e.eventName===this.eventName&&g.isSameDay(e.startDate,this.startDate)&&g.isSameDay(e.endDate,this.endDate)&&e.status===this.status&&e.budget===this.budget&&e.includedCustomAudienceId===this.includedCustomAudienceId&&e.excludedCustomAudienceId===this.excludedCustomAudienceId&&P(e.alreadyPurchasedTicket,this.alreadyPurchasedTicket)}}return n.TYPE_ID="3ddc04ab49c947a6bbeb5fd49888f1c9",n.SCHEMA_VERSION=3,n})(),FD=class extends f{build(i,e){return Uu.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(Uu.SCHEMA_VERSION))return e;if(t.isGreaterThan(Uu.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(s=2),s<3&&(r.set(e,"excludedCustomAudienceId",null),r.set(e,"adAccountId","ZzyEI2MyQqtu2lBdKPBp"),s=3),e.$schema_version=D.encodedExactly(s),e}},GN=(function(n){return n.Active="Active",n.Inactive="Inactive",n})(GN||{}),Bu=(()=>{class n extends b{constructor(e,t,s,a,o,u,c,l,h,p,I,v,E,w,S,R,x,N,O,A,M,C){super(),this.adId=e,this.adName=t,this.adSetId=s,this.adSetName=a,this.campaignId=o,this.campaignName=u,this.adAccountId=c,this.businessRef=l,this.eventId=h,this.eventName=p,this.creationDate=I,this.startDate=v,this.endDate=E,this.status=w,this.budget=S,this.budgetSpent=R,this.impressions=x,this.reach=N,this.conversions=O,this.clicks=A,this.roas=M,this.costPerResult=C}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}static create(e){var t,s,a,o,u,c,l;return new n(e.adId,e.adName,e.adSetId,e.adSetName,e.campaignId,e.campaignName,e.adAccountId,e.businessRef,e.eventId,e.eventName,e.creationDate,e.startDate,e.endD
3ate,e.status,e.budget,(t=e.budgetSpent)!==null&&t!==void 0?t:0,(s=e.impressions)!==null&&s!==void 0?s:0,(a=e.reach)!==null&&a!==void 0?a:0,(o=e.conversions)!==null&&o!==void 0?o:0,(u=e.clicks)!==null&&u!==void 0?u:0,(c=e.roas)!==null&&c!==void 0?c:0,(l=e.costPerResult)!==null&&l!==void 0?l:0)}static fromMap(e,t){return n.create({adId:r.getString(t,"adId"),adName:r.getString(t,"adName"),adSetId:r.getString(t,"adSetId"),adSetName:r.getString(t,"adSetName"),campaignId:r.getString(t,"campaignId"),campaignName:r.getString(t,"campaignName"),adAccountId:r.getString(t,"adAccountId"),businessRef:j.mustDecode(r.getString(t,"businessRef")),eventId:r.getString(t,"eventId"),eventName:r.getString(t,"eventName"),creationDate:e.decodeDate(r.getInteger(t,"creationDate")),startDate:e.decodeDate(r.getInteger(t,"startDate")),endDate:e.decodeDate(r.getInteger(t,"endDate")),status:y(r.getString(t,"status"),GN),budget:r.getDouble(t,"budget"),budgetSpent:r.getDouble(t,"budgetSpent"),impressions:r.getInteger(t,"impressions"),reach:r.getInteger(t,"reach"),conversions:r.getInteger(t,"conversions"),clicks:r.getInteger(t,"clicks"),roas:r.getDouble(t,"roas"),costPerResult:r.getDouble(t,"costPerResult")})}toMap(e){return{adId:this.adId,adName:this.adName,adSetId:this.adSetId,adSetName:this.adSetName,campaignId:this.campaignId,campaignName:this.campaignName,adAccountId:this.adAccountId,businessRef:this.businessRef.encode(),eventId:this.eventId,eventName:this.eventName,creationDate:e.encodeDate(this.creationDate),startDate:e.encodeDate(this.startDate),endDate:e.encodeDate(this.endDate),status:m(this.status),budget:this.budget,budgetSpent:this.budgetSpent,impressions:this.impressions,reach:this.reach,c
3onversions:this.conversions,clicks:this.clicks,roas:this.roas,costPerResult:this.costPerResult}}clone(){return this.copyWith()}copyWith({adId:e=this.adId,adName:t=this.adName,adSetId:s=this.adSetId,adSetName:a=this.adSetName,campaignId:o=this.campaignId,campaignName:u=this.campaignName,adAccountId:c=this.adAccountId,businessRef:l=F(this.businessRef),eventId:h=this.eventId,eventName:p=this.eventName,creationDate:I=g.cloneDate(this.creationDate),startDate:v=g.cloneDate(this.startDate),endDate:E=g.cloneDate(this.endDate),status:w=this.status,budget:S=this.budget,budgetSpent:R=this.budgetSpent,impressions:x=this.impressions,reach:N=this.reach,conversions:O=this.conversions,clicks:A=this.clicks,roas:M=this.roas,costPerResult:C=this.costPerResult}={}){return n.create({adId:e,adName:t,adSetId:s,adSetName:a,campaignId:o,campaignName:u,adAccountId:c,businessRef:l,eventId:h,eventName:p,creationDate:I,startDate:v,endDate:E,status:w,budget:S,budgetSpent:R,impressions:x,reach:N,conversions:O,clicks:A,roas:M,costPerResult:C})}isSame(e){return e===this?!0:e.adId===this.adId&&e.adName===this.adName&&e.adSetId===this.adSetId&&e.adSetName===this.adSetName&&e.campaignId===this.campaignId&&e.campaignName===this.campaignName&&e.adAccountId===this.adAccountId&&d(e.businessRef,this.businessRef)&&e.eventId===this.eventId&&e.eventName===this.eventName&&g.isSameDay(e.creationDate,this.creationDate)&&g.isSameDay(e.startDate,this.startDate)&&g.isSameDay(e.endDate,this.endDate)&&e.status===this.status&&e.budget===this.budget&&e.budgetSpent===this.budgetSpent&&e.impressions===this.impressions&&e.reach===this.reach&&e.conversions===this.conversions&&e.clicks===this.clicks&&e.roas===this.roas&&e.costPerResult===this.costPerResult}}return n.TYPE_ID="34f40333bc7646cdb77a946911d25a2b",n.SCHEMA_VERSION=3,n})(),qD=class extends f{build(i,e){return Bu.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(Bu.SCHEMA_VERSION))return e;if(t.isGreaterThan(Bu.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(r.setIfNullOrUndefined(e,"creationDate",fe.now()),s=2),s<3&&(r.setIfNullOrUndefined(e,"adAccountId","ZzyEI2MyQqtu2lBdKPBp"),s=3),e.$schema_version=D.encodedExactly(s),e}},WN=(()=>{class n extends b{constructor(e){super(),this.adCredit=e}get $typeId(){return n.TYPE_ID}static create(e){var t;return new n((t=e.adCredit)!==null&&t!==void 0?t:0)}static fromMap(e,t){return n.create({adCredit:r.getDouble(t,"adCredit")})}toMap(e){return{adCredit:this.adCredit}}clone(){return this.copyWith()}copyWith({adCredit:e=this.adCredit}={}){return n.create({adCredit:e})}isSame(e){return e===this?!0:e.adCredit===this.adCredit}}return n.TYPE_ID="897acfd4108d4f7391a24779cd840d81",n})(),YD=class extends f{build(i,e){return WN.fromMap(i,e)}},jN=(()=>{class n extends b{constructor(e,t,s,a,o,u){super(),this.onlineTicketFeePercentage=e,this.cashTicketFeePercentage=t,this.posTicketFeePercentage=s,this.onlinePassFeePercentage=a,this.cashPassFeePercentage=o,this.posPassFeePercentage=u}get $typeId(){return n.TYPE_ID}static create(e){var t,s,a,o,u,c;return new n((t=e.onlineTicketFeePercentage)!==null&&t!==void 0?t:0,(s=e.cashTicketFeePercentage)!==null&&s!==void 0?s:0,(a=e.posTicketFeePercentage)!==null&&a!==void 0?a:0,(o=e.onlinePassFeePercentage)!==null&&o!==void 0?o:0,(u=e.cashPassFeePercentage)!==null&&u!==void 0?u:0,(c=e.posPassFeePercentage)!==null&&c!==void 0?c:0)}static fromMap(e,t){return n.create({onlineTicketFeePercentage:r.getDouble(t,"onlineTicketFeePercentage"),cashTicketFeePercentage:r.getDouble(t,"cashTicketFeePercentage"),posTicketFeePercentage:r.getDouble(t,"posTicketFeePercentage"),onlinePassFeePercentage:r.getDouble(t,"onlinePassFeePercentage"),cashPassFeePercentage:r.getDouble(t,"cashPassFeePercentage"),posPassFeePercentage:r.getDouble(t,"posPassFeePercentage")})}toMap(e){return{onlineTicketFeePercentage:this.onlineTicketFeePercentage,cashTicketFeePercentage:this.cashTicketFeePercentage,posTicketFeePercentage:this.posTicketFeePercentage,onlinePassFeePercentage:this.onlinePassFeePercentage,cashPassFeePercentage:this.cashPassFeePercentage,posPassFeePercentage:this.posPassFeePercentage}}clone(){return this.copyWith()}copyWith({onlineTicketFeePercentage:e=this.onlineTicketFeePercentage,cashTicketFeePercentage:t=this.cashTicketFeePercentage,posTicketFeePercentage:s=this.posTicketFeePercentage,onlinePassFeePercentage:a=this.onlinePassFeePercentage,cashPassFeePercentage:o=this.cashPassFeePercentage,posPassFeePercentage:u=this.posPassFeePercentage}={}){return n.create({onlineTicketFeePercentage:e,cashTicketFeePercentage:t,posTicketFeePercentage:s,onlinePassFeePercentage:a,cashPassFeePercentage:o,posPassFeePercentage:u})}isSame(e){return e===this?!0:e.onlineTicketFeePercentage===this.onlineTicketFeePercentage&&e.cashTicketFeePercentage===this.cashTicketFeePercentage&&e.posTicketFeePercentage===this.posTicketFeePercentage&&e.onlinePassFeePercentage===this.onlinePassFeePercentage&&e.cashPassFeePercentage===this.cashPassFeePercentage&&e.posPassFeePercentage===this.posPassFeePercentage}}return n.TYPE_ID="f48c43235d3f43ea955193a2d5fc2afc",n})(),$D=class extends f{build(i,e){return jN.fromMap(i,e)}},JN=(()=>{class n extends b{constructor(e,t,s,a,o,u,c,l,h){super(),this.uniqueId=e,this.organizationId=t,this.name=s,this.country=a,this.metaApiAccessTokenId=o,this.adAccountId=u,this.pixelId=c,this.beneficiary=l,this.payor=h}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.uniqueId,e.organizationId,e.name,e.country,e.metaApiAccessTokenId,e.adAccountId,e.pixelId,e.beneficiary,e.payor)}static fromMap(e,t){return n.create({uniqueId:r.getString(t,"uniqueId"),organizationId:r.getStringOrNull(t,"organizationId"),name:r.getString(t,"name"),country:y(r.get(t,"country"),Ie),metaApiAccessTokenId:r.getString(t,"metaApiAccessTokenId"),adAccountId:r.getString(t,"adAccountId"),pixelId:r.getString(t,"pixelId"),beneficiary:r.getString(t,"beneficiary"),payor:r.getString(t,"payor")})}toMap(e){return{uniqueId:this.uniqueId,organizationId:this.organizationId,name:this.name,country:m(this.country),metaApiAccessTokenId:this.metaApiAccessTokenId,adAccountId:this.adAccountId,pixelId:this.pixelId,beneficiary:this.beneficiary,payor:this.payor}}clone(){return this.copyWith()}copyWith({uniqueId:e=this.uniqueId,organizationId:t=this.organizationId,name:s=this.name,country:a=this.country,metaApiAccessTokenId:o=this.metaApiAccessTokenId,adAccountId:u=this.adAccountId,pixelId:c=this.pixelId,beneficiary:l=this.beneficiary,payor:h=this.payor}={}){return n.create({uniqueId:e,organizationId:t,name:s,country:a,metaApiAccessTokenId:o,adAccountId:u,pixelId:c,beneficiary:l,payor:h})}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.organizationId===this.organizationId&&e.name===this.name&&e.country===this.country&&e.metaApiAccessTokenId===this.metaApiAccessTokenId&&e.adAccountId===this.adAccountId&&e.pixelId===this.pixelId&&e.beneficiary===this.beneficiary&&e.payor===this.payor}}return n.TYPE_ID="150c0922126a45b4a6dcea36e3def4e4",n})(),LD=class extends f{build(i,e){return JN.fromMap(i,e)}},KN=(()=>{class n extends b{constructor(e,t){super(),this.uniqueId=e,this.name=t}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.uniqueId,e.name)}static fromMap(e,t){return n.create({uniqueId:r.getString(t,"uniqueId"),name:r.getString(t,"name")})}toMap(e){return{uniqueId:this.uniqueId,name:this.name}}clone(){return this.copyWith()}copyWith({uniqueId:e=this.uniqueId,name:t=this.name}={}){return n.create({uniqueId:e,name:t})}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.name===this.name}}return n.TYPE_ID="bc255d298b5a400c8e2257b56b17661b",n})(),VD=class extends f{build(i,e){return KN.fromMap(i,e)}},ZN=(()=>{class n extends b{constructor(e,t,s,a,o){super(),this.category=e,this.useEmojis=t,this.vocabularyPrompt=s,this.lengthPrompt=a,this.examplesPrompt=o}get $typeId(){return n.TYPE_ID}static create(e){var t,s;return new n(e.category,e.useEmojis,e.vocabularyPrompt,(t=e.lengthPrompt)!==null&&t!==void 0?t:"",(s=e.examplesPrompt)!==null&&s!==void 0?s:"")}static fromMap(e,t){return n.create({category:y(r.getString(t,"category"),_s),useEmojis:r.getBoolean(t,"useEmojis"),vocabularyPrompt:r.getString(t,"vocabularyPrompt"),lengthPrompt:r.getString(t,"lengthPrompt"),examplesPrompt:r.getString(t,"examplesPrompt")})}toMap(e){return{category:m(this.category),useEmojis:this.useEmojis,vocabularyPrompt:this.vocabularyPrompt,lengthPrompt:this.lengthPrompt,examplesPrompt:this.examplesPrompt}}clone(){return this.copyWith()}copyWith({category:e=this.category,useEmojis:t=this.useEmojis,vocabularyPrompt:s=this.vocabularyPrompt,lengthPrompt:a=this.lengthPrompt,examplesPrompt:o=this.examplesPrompt}={}){return n.create({category:e,useEmojis:t,vocabularyPrompt:s,lengthPrompt:a,examplesPrompt:o})}isSame(e){return e===this?!0:e.category===this.category&&e.useEmojis===this.useEmojis&&e.vocabularyPrompt===this.vocabularyPrompt&&e.lengthPrompt===this.lengthPrompt&&e.examplesPrompt===this.examplesPrompt}}return n.TYPE_ID="8f22dc8dd2b54f9f96338ccc9cc5c1d0",n})(),zD=class extends f{build(i,e){return ZN.fromMap(i,e)}},XN=(()=>{class n extends b{constructor(e,t,s,a,o,u,c,l,h,p){super(),this.eventCategoriesPrompt=e,this.eventInfoPrompt=t,this.languagePrompt=s,this.useEmojiPrompt=a,this.doNotUseEmojiPrompt=o,this.otherSpecificationsPrompt=u,this.lengthPrompt=c,this.eventTitlePrompt=l,this.examplesPrompt=h,this.vocabularyPrompt=p}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.eventCategoriesPrompt,e.eventInfoPrompt,e.languagePrompt,e.useEmojiPrompt,e.doNotUseEmojiPrompt,e.otherSpecificationsPrompt,e.lengthPrompt,e.eventTitlePrompt,e.examplesPrompt,e.vocabularyPrompt)}static fromMap(e,t){return n.create({eventCategoriesPrompt:r.getString(t,"eventCategoriesPrompt"),eventInfoPrompt:r.getString(t,"eventInfoPrompt"),languagePrompt:r.getString(t,"languagePrompt"),useEmojiPrompt:r.getString(t,"useEmojiPrompt"),doNotUseEmojiPrompt:r.getString(t,"doNotUseEmojiPrompt"),otherSpecificationsPrompt:r.getString(t,"otherSpecificationsPrompt"),lengthPrompt:r.getString(t,"lengthPrompt"),eventTitlePrompt:r.getString(t,"eventTitlePrompt"),examplesPrompt:r.getString(t,"examplesPrompt"),vocabularyPrompt:r.getString(t,"vocabularyPrompt")})}toMap(e){return{eventCategoriesPrompt:this.eventCategoriesPrompt,eventInfoPrompt:this.eventInfoPrompt,languagePrompt:this.languagePrompt,useEmojiPrompt:this.useEmojiPrompt,doNotUseEmojiPrompt:this.doNotUseEmojiPrompt,otherSpecificationsPrompt:this.otherSpecificationsPrompt,lengthPrompt:this.lengthPrompt,eventTitlePrompt:this.eventTitlePrompt,examplesPrompt:this.examplesPrompt,vocabularyPrompt:this.vocabularyPrompt}}clone(){return this.copyWith()}copyWith({eventCategoriesPrompt:e=this.eventCategoriesPrompt,eventInfoPrompt:t=this.eventInfoPrompt,languagePrompt:s=this.languagePrompt,useEmojiPrompt:a=this.useEmojiPrompt,doNotUseEmojiPrompt:o=this.doNotUseEmojiPrompt,otherSpecificationsPrompt:u=this.otherSpecificationsPrompt,lengthPrompt:c=this.lengthPrompt,eventTitlePrompt:l=this.eventTitlePrompt,examplesPrompt:h=this.examplesPrompt,vocabularyPrompt:p=this.vocabularyPrompt}={}){return n.create({eventCategoriesPrompt:e,eventInfoPrompt:t,languagePrompt:s,useEmojiPrompt:a,doNotUseEmojiPrompt:o,otherSpecificationsPrompt:u,lengthPrompt:c,eventTitlePrompt:l,examplesPrompt:h,vocabularyPrompt:p})}isSame(e){return e===this?!0:e.eventCategoriesPrompt===this.eventCategoriesPrompt&&e.eventInfoPrompt===this.eventInfoPrompt&&e.languagePrompt===this.languagePrompt&&e.useEmojiPrompt===this.useEmojiPrompt&&e.doNotUseEmojiPrompt===this.doNotUseEmojiPrompt&&e.otherSpecificationsPrompt===this.otherSpecificationsPrompt&&e.lengthPrompt===this.lengthPrompt&&e.eventTitlePrompt===this.eventTitlePrompt&&e.examplesPrompt===this.examplesPrompt&&e.vocabularyPrompt===this.vocabularyPrompt}}return n.TYPE_ID="d9193ee780f44f52b0d6d87c1b42b1c9",n})(),UD=class extends f{build(i,e){return XN.fromMap(i,e)}},QN=(()=>{class n extends b{constructor(e,t,s){super(),this.city=e,this.adAccountId=t,this.metaId=s}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.city,e.adAccountId,e.metaId)}static fromMap(e,t){return n.create({city:r.getString(t,"city"),adAccountId:r.getString(t,"adAccountId"),metaId:r.getString(t,"metaId")})}toMap(e){return{city:this.city,adAccountId:this.adAccountId,metaId:this.metaId}}clone(){return this.copyWith()}copyWith({city:e=this.city,adAccountId:t=this.adAccountId,metaId:s=this.metaId}={}){return n.create({city:e,adAccountId:t,metaId:s})}isSame(e){return e===this?!0:e.city===this.city&&e.adAccountId===this.adAccountId&&e.metaId===this.metaId}}return n.TYPE_ID="71bd622df5b6473686779257558bbcac",n})(),BD=class extends f{build(i,e){return QN.fromMap(i,e)}},eP=(()=>{class n extends b{constructor(e){super(),this.email=e}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.email)}static fromMap(e,t){return n.create({email:r.getString(t,"email")})}toMap(e){return{email:this.email}}clone(){return this.copyWith()}copyWith({email:e=this.email}={}){return n.create({email:e})}isSame(e){return e===this?!0:e.email===this.email}}return n.TYPE_ID="c24f6f4f768a4de9932b1596da363271",n})(),HD=class extends f{build(i,e){return eP.fromMap(i,e)}},Ti=(function(n){return n.VoucherValue="VoucherValue",n.ZeroPrice="ZeroPrice",n.Hidden="Hidden",n})(Ti||{}),id=class extends b{get businessId(){return this.businessRef.uniqueId}get hasText(){return this.reviewText.length>0}},tP=(()=>{class n extends id{constructor(e,t,s,a,o,u,c,l,h,p){super(),this.uniqueId=e,this.creationDate=t,this.businessRef=s,this.reviewText=a,this.reviewRating=o,this.reviewerId=u,this.reviewerFirstName=c,this.reviewerLastName=l,this.isAnonymous=h,this.reviewerPhoto=p,this.reviewerInitials=pi(c,l),this.reviewerFormattedName=fi(c,l)}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.get(t,"uniqueId"),e.decodeDate(r.get(t,"creationDate")),j.mustDecode(r.get(t,"businessRef")),r.get(t,"reviewText"),r.get(t,"reviewRating"),r.get(t,"reviewerId"),r.get(t,"reviewerFirstName"),r.get(t,"reviewerLastName"),r.get(t,"isAnonymous"),e.fromDataOrNull(r.getOrNull(t,"reviewerPhoto")))}toMap(e){return{uniqueId:this.uniqueId,creationDate:e.encodeDate(this.creationDate),businessRef:this.businessRef.encode(),reviewText:this.reviewText,reviewRating:this.reviewRating,reviewerId:this.reviewerId,reviewerFirstName:this.reviewerFirstName,reviewerLastName:this.reviewerLastName,isAnonymous:this.isAnonymous,reviewerPhoto:e.toDataOrNull(this.reviewerPhoto),reviewTextLength:this.reviewText.trim().length}}clone(){var e,t;return new n(this.uniqueId,g.cloneDate(this.creationDate),this.businessRef.clone(),this.reviewText,this.reviewRating,this.reviewerId,this.reviewerFirstName,this.reviewerLastName,this.isAnonymous,(t=(e=this.reviewerPhoto)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null)}isSame(e){return e===this?!0:e.uniqueId==this.uniqueId&&e.creationDate==this.creationDate&&d(e.businessRef,this.businessRef)&&e.reviewText==this.reviewText&&e.reviewRating==this.reviewRating&&e.reviewerId==this.reviewerId&&e.reviewerFirstName==this.reviewerFirstName&&e.reviewerLastName==this.reviewerLastName&&e.isAnonymous==this.isAnonymous&&d(e.reviewerPhoto,this.reviewerPhoto)}copyWithBusinessRef(e){var t,s;return new n(this.uniqueId,g.cloneDate(this.creationDate),e.clone(),this.reviewText,this.reviewRating,this.reviewerId,this.reviewerFirstName,this.reviewerLastName,this.isAnonymous,(s=(t=this.reviewerPhoto)===null||t===void 0?void 0:t.clone())!==null&&s!==void 0?s:null)}}return n.TYPE_ID="85534cc308c04252b7797d9b6f47e8be",n})(),GD=class extends f{build(i,e){return tP.fromMap(i,e)}},Hu=(()=>{class n extends id{constructor(e,t,s,a,o,u,c,l,h,p,I,v,E,w,S,R,x){super(),this.uniqueId=e,this.creationDate=t,this.businessRef=s,this.reviewText=a,this.reviewRating=o,this.reviewerId=u,this.reviewerFirstName=c,this.reviewerLastName=l,this.isAnonymous=h,this.reviewerPhoto=p,this.via=I,this.orderId=v,this.orderDate=E,this.serviceId=w,this.serviceName=S,this.userId=R,this.staffMemberId=x,this.reviewerInitials=pi(c,l),this.reviewerFormattedName=fi(c,l)}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),e.decodeDate(r.get(t,"creationDate")),j.mustDecode(r.get(t,"businessRef")),r.get(t,"reviewText"),r.get(t,"reviewRating"),r.get(
3t,"reviewerId"),r.get(t,"reviewerFirstName"),r.get(t,"reviewerLastName"),r.get(t,"isAnonymous"),e.fromDataOrNull(r.getOrNull(t,"reviewerPhoto")),j.decode(r.getOrNull(t,"via")),r.get(t,"orderId"),e.decodeDate(r.get(t,"orderDate")),r.get(t,"serviceId"),r.get(t,"serviceName"),r.get(t,"userId"),new ut(r.get(t,"staffMemberId")))}toMap(e){var t,s;return{uniqueId:this.uniqueId,creationDate:e.encodeDate(this.creationDate),businessRef:this.businessRef.encode(),reviewText:this.reviewText,reviewRating:this.reviewRating,reviewerId:this.reviewerId,reviewerFirstName:this.reviewerFirstName,reviewerLastName:this.reviewerLastName,isAnonymous:this.isAnonymous,reviewerPhoto:e.toDataOrNull(this.reviewerPhoto),via:(s=(t=this.via)===null||t===void 0?void 0:t.encode())!==null&&s!==void 0?s:null,orderId:this.orderId,orderDate:e.encodeDate(this.orderDate),serviceId:this.serviceId,serviceName:this.serviceName,userId:this.userId,staffMemberId:this.staffMemberId.queryableValue,reviewTextLength:this.reviewText.trim().length}}clone(){var e,t,s,a;return new n(this.uniqueId,g.cloneDate(this.creationDate),this.businessRef.clone(),this.reviewText,this.reviewRating,this.reviewerId,this.reviewerFirstName,this.reviewerLastName,this.isAnonymous,(t=(e=this.reviewerPhoto)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null,(a=(s=this.via)===null||s===void 0?void 0:s.clone())!==null&&a!==void 0?a:null,this.orderId,g.cloneDate(this.orderDate),this.serviceId,this.serviceName,this.userId,this.staffMemberId.clone())}isSame(e){return e===this?!0:e.uniqueId==this.uniqueId&&e.creationDate==this.creationDate&&d(e.businessRef,this.businessRef)&&e.reviewText==this.reviewText&&e.reviewRating==this.reviewRating&&e.reviewerId==this.reviewerId&&e.reviewerFirstName==this.reviewerFirstName&&e.reviewerLastName==this.reviewerLastName&&e.isAnonymous==this.isAnonymous&&d(e.reviewerPhoto,this.reviewerPhoto)&&d(e.via,this.via)&&e.orderId==this.orderId&&e.orderDate==this.orderDate&&e.serviceId==this.serviceId&&e.serviceName==this.serviceName&&e.userId==this.userId&&d(e.staffMemberId,this.staffMemberId)}copyWithBusinessRef(e){var t,s,a,o;return new n(this.uniqueId,g.cloneDate(this.creationDate),e.clone(),this.reviewText,this.reviewRating,this.reviewerId,this.reviewerFirstName,this.reviewerLastName,this.isAnonymous,(s=(t=this.reviewerPhoto)===null||t===void 0?void 0:t.clone())!==null&&s!==void 0?s:null,(o=(a=this.via)===null||a===void 0?void 0:a.clone())!==null&&o!==void 0?o:null,this.orderId,g.cloneDate(this.orderDate),this.serviceId,this.serviceName,this.userId,this.staffMemberId.clone())}}return n.TYPE_ID="2e0b729955bd4965b8d920ec0a166229",n.SCHEMA_VERSION=5,n})(),WD=class extends f{build(i,e){return Hu.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){var t,s,a,o,u,c;let l=r.getVersionRange(e);if(l.contains(Hu.SCHEMA_VERSION))return e;if(l.isGreaterThan(Hu.SCHEMA_VERSION))return null;let h=l.to;if(h<2){let p=i.decodeDate(r.get(e,"creationDate"));r.set(e,"appointmentDate",i.encodeDate(p)),h=2}return h<3&&(r.set(e,"isAnonymous",!1),h=3),h<4&&(r.setIfNullOrUndefined(e,"businessRef",r.get(e,"businessId")),h=4),h<5&&((t=e.orderId)!==null&&t!==void 0||(e.orderId=e.appointmentId),(s=e.orderDate)!==null&&s!==void 0||(e.orderDate=e.appointmentDate),(a=e.reviewerId)!==null&&a!==void 0||(e.reviewerId=e.clientId),(o=e.reviewerFirstName)!==null&&o!==void 0||(e.reviewerFirstName=e.clientFirstName),(u=e.reviewerLastName)!==null&&u!==void 0||(e.reviewerLastName=e.clientLastName),(c=e.reviewerPhoto)!==null&&c!==void 0||(e.reviewerPhoto=e.clientPhoto),h=5),e.$schema_version=D.encodedExactly(h),e}migrateFromCurrentSchemaVersion(i,e,t){var s,a,o,u,c,l,h,p;let I=e.$schemaVersion.to;return I>=5&&(I=4,(s=t.appointmentId)!==null&&s!==void 0||(t.appointmentId=t.orderId),(a=t.appointmentDate)!==null&&a!==void 0||(t.appointmentDate=t.orderDate),(o=t.clientId)!==null&&o!==void 0||(t.clientId=t.reviewerId),(u=t.clientFirstName)!==null&&u!==void 0||(t.clientFirstName=t.reviewerFirstName),(c=t.clientLastName)!==null&&c!==void 0||(t.clientLastName=t.reviewerLastName),(l=t.clientPhoto)!==null&&l!==void 0||(t.clientPhoto=t.reviewerPhoto),(h=t.likes)!==null&&h!==void 0||(t.likes=0),(p=t.dislikes)!==null&&p!==void 0||(t.dislikes=0),t.$schema_version=D.encodedBetween(1,5)),t}},qr=class n{constructor(i,e,t,s,a,o,u,c,l,h,p,I,v,E,w){this.offlineOrders=i,this.offlineTickets=e,this.onlineOrders=t,this.onlineTickets=s,this.promoterOrders=a,this.promoterTickets=o,this.protocolOrders=u,this.protocolTickets=c,this.totalOrders=l,this.totalTickets=h,this.offlineIncome=p,this.onlineIncome=I,this.promoterIncome=v,this.protocolIncome=E,this.totalIncome=w}static empty(i){return new n(0,0,0,0,0,0,0,0,0,0,Y.zero(i),Y.zero(i),Y.zero(i),Y.zero(i),Y.zero(i))}static fromMap(i,e){return new n(r.get(e,"offlineOrders"),r.get(e,"offlineTickets"),r.get(e,"onlineOrders"),r.get(e,"onlineTickets"),r.get(e,"promoterOrders"),r.get(e,"promoterTickets"),r.get(e,"protocolOrders"),r.get(e,"protocolTickets"),r.get(e,"totalOrders"),r.get(e,"totalTickets"),Y.decode(r.get(e,"offlineIncome")),Y.decode(r.get(e,"onlineIncome")),Y.decode(r.get(e,"promoterIncome")),Y.decode(r.get(e,"protocolIncome")),Y.decode(r.get(e,"totalIncome")))}toMap(i){return{offlineOrders:this.offlineOrders,offlineTickets:this.offlineTickets,onlineOrders:this.onlineOrders,onlineTickets:this.onlineTickets,promoterOrders:this.promoterOrders,promoterTickets:this.promoterTickets,protocolOrders:this.protocolOrders,protocolTickets:this.protocolTickets,totalOrders:this.totalOrders,totalTickets:this.totalTickets,offlineIncome:this.offlineIncome.encode(),onlineIncome:this.onlineIncome.encode(),promoterIncome:this.promoterIncome.encode(),protocolIncome:this.protocolIncome.encode(),totalIncome:this.totalIncome.encode()}}clone(){return new n(this.offlineOrders,this.offlineTickets,this.onlineOrders,this.onlineTickets,this.promoterOrders,this.promoterTickets,this.protocolOrders,this.protocolTickets,this.totalOrders,this.totalTickets,this.offlineIncome.clone(),this.onlineIncome.clone(),this.promoterIncome.clone(),this.protocolIncome.clone(),this.totalIncome.clone())}isSame(i){return i===this?!0:i.offlineOrders===this.offlineOrders&&i.offlineTickets===this.offlineTickets&&i.onlineOrders===this.onlineOrders&&i.onlineTickets===this.onlineTickets&&i.promoterOrders===this.promoterOrders&&i.promoterTickets===this.promoterTickets&&i.protocolOrders===this.protocolOrders&&i.protocolTickets===this.protocolTickets&&i.totalOrders===this.totalOrders&&i.totalTickets===this.totalTickets&&d(i.offlineIncome,this.offlineIncome)&&d(i.onlineIncome,this.onlineIncome)&&d(i.promoterIncome,this.promoterIncome)&&d(i.protocolIncome,this.protocolIncome)&&d(i.totalIncome,this.totalIncome)}ensurePositive(){this.offlineOrders<0&&(this.offlineOrders=0),this.offlineTickets<0&&(this.offlineTickets=0),this.onlineOrders<0&&(this.onlineOrders=0),this.onlineTickets<0&&(this.onlineTickets=0),this.promoterOrders<0&&(this.promoterOrders=0),this.promoterTickets<0&&(this.promoterTickets=0),this.protocolOrders<0&&(this.protocolOrders=0),this.protocolTickets<0&&(this.protocolTickets=0),this.totalOrders<0&&(this.totalOrders=0),this.totalTickets<0&&(this.totalTickets=0),this.offlineIncome.value<0&&(this.offlineIncome=Y.zero(this.offlineIncome.currency)),this.onlineIncome.value<0&&(this.onlineIncome=Y.zero(this.onlineIncome.currency)),this.promoterIncome.value<0&&(this.promoterIncome=Y.zero(this.promoterIncome.currency)),this.protocolIncome.value<0&&(this.protocolIncome=Y.zero(this.protocolIncome.currency)),this.totalIncome.value<0&&(this.totalIncome=Y.zero(this.totalIncome.currency))}},is=(function(n){return n.InTime="in-time",n.Barion="barion",n.Stripe="stripe",n.BtPay="btepos",n})(is||{}),Wx=28,lt=class{constructor(){}static getUniquePaymentRequestId(){return Ft({length:Wx})}static getCurrencyOfOrder(i){return tr.assertType(i)?Lt.getCurrencyOfOrder(i):null}static calculateCheckoutPriceForOrder(i,e){return tr.assertType(i)?Lt.calculateCheckoutPriceForOrder(i,e):null}static calculateIncomeForOrder(i,e){return tr.assertType(i)?Lt.calculateIncomeForOrder(i,e):null}static calculateIncomeWithoutDiscountForOrder(i,e){return tr.assertType(i)?Lt.calculateIncomeWithoutDiscountForOrder(i,e):null}static calculateCheckoutPriceForTicketSupplement(i){return Lt.calculateCheckoutPriceForTicketSupplement(i)}static calculateCheckoutPriceForEventTicket(i,e){return Lt.calculateCheckoutPriceForEventTicket(i,e)}static calculateIncomeForEventTicket(i,e){return Lt.calculateIncomeForEventTicket(i,e)}static calculateIncomeWithoutDiscountForEventTicket(i,e){return Lt.calculateIncomeWithoutDiscountForEventTicket(i,e)}static calculateOriginalIncomeForOfflineTicketOrder(i,e){return Lt.calculateOriginalIncomeForOfflineTicketOrder(i,e)}static encodePriceForTransaction({price:i,provider:e}){switch(e){case is.Barion:switch(i.currency){case Ae.HUF:return i.convertToInt;case Ae.RON:case Ae.USD:case Ae.EUR:return i.convertToDecimal}break;case is.Stripe:return i.convertToCents;case is.BtPay:return i.convertToCents;case is.InTime:return i.convertToCents}}static encodePriceForInvoice({price:i,provider:e}){switch(e){case qn.Billingo:switch(i.currency){case Ae.HUF:return i.convertToInt;case Ae.RON:case Ae.USD:case Ae.EUR:return i.convertToDecimal}break;case qn.Szamlazz:return i.convertToDecimal}}},Ua=class n{constructor(i,e){this.day=i,this.sales=e}static empty(i,e){return new n(e,qr.empty(i))}static fromMap(i,e){return new n(i.fromData(r.get(e,"day")),qr.fromMap(i,r.get(e,"sales")))}toMap(i){return{day:i.toData(this.day),sales:this.sales.toMap(i)}}clone(){return new n(this.day.clone(),this.sales.clone())}isSame(i){return i===this?!0:d(i.day,this.day)&&d(i.sales,this.sales)}addTicketOrder(i,e){var t,s,a,o;let u=i.tickets[0].template.price.currency,c=i.source===Xe.Client,l=i.tickets[0].ticketType===we.Promoter,h=i.tickets[0].ticketType===we.Protocol,p=0,I=Y.zero(u),v=(t=e?.orderDetails)===null||t===void 0?void 0:t.discountedPrice;v??(v=lt.calculateIncomeForOrder(i,{applyProducts:!1,applySupplements:!0}));for(let E of i.tickets)if(E.status===Ye.Live||E.status===Ye.Scanned){p++;let w=(o=(a=(s=e?.ticketsDetails)===null||s===void 0?void 0:s.get(E.uniqueId))===null||a===void 0?void 0:a.discountedPrice)!==null&&o!==void 0?o:E.template.price.clone();I=I.add(w)}v??(v=I),l?(this.sales.promoterOrders++,this.sales.promoterTickets+=p,this.sales.promoterIncome=this.sales.promoterIncome.add(v)):h?(this.sales.protocolOrders++,this.sales.protocolTickets+=p,this.sales.protocolIncome=this.sales.protocolIncome.add(v)):c?(this.sales.onlineOrders++,this.sales.onlineTickets+=p,this.sales.onlineIncome=this.sales.onlineIncome.add(v)):(this.sales.offlineOrders++,this.sales.offlineTickets+=p,this.sales.offlineIncome=this.sales.offlineIncome.add(v)),this.sales.totalOrders++,this.sales.totalTickets+=p,this.sales.totalIncome=this.sales.totalIncome.add(v)}addOnlineTicketOrder(i,e){var t,s,a,o;let u=i.tickets[0].template.price.currency,c=(t=e?.orderDetails)===null||t===void 0?void 0:t.discountedPrice;if(c??(c=lt.calculateIncomeForOrder(i,{applyProducts:!1,applySupplements:!0})),k(c)){c??(c=Y.zero(u));for(let l of i.tickets){let h=(o=(a=(s=e?.ticketsDetails)===null||s===void 0?void 0:s.get(l.uniqueId))===null||a===void 0?void 0:a.discountedPrice)!==null&&o!==void 0?o:l.template.price.clone();c=c?.add(h)}}this.sales.onlineOrders++,this.sales.onlineTickets+=i.tickets.length,this.sales.onlineIncome=this.sales.onlineIncome.add(c),this.sales.totalOrders++,this.sales.totalTickets+=i.tickets.length,this.sales.totalIncome=this.sales.totalIncome.add(c)}removeTicketOrder(i,e,t){var s,a,o;let u=i.tickets[0].template.price.currency,c=i.source===Xe.Client,l=i.tickets[0].ticketType===we.Promoter,h=i.tickets[0].ticketType===we.Protocol,p=0,I=Y.zero(u);for(let v=0;v<i.tickets.length;++v)if(e.tickets[v].status!==Ye.Refunded){let E=i.tickets[v],w=(o=(a=(s=t?.ticketsDetails)===null||s===void 0?void 0:s.get(E.uniqueId))===null||a===void 0?void 0:a.discountedPrice)!==null&&o!==void 0?o:E.template.price.clone();I=I.add(w),p++}l?(this.sales.promoterOrders--,this.sales.promoterTickets-=p,this.sales.promoterIncome=this.sales.promoterIncome.difference(I)):h?(this.sales.protocolOrders--,this.sales.protocolTickets-=p,this.sales.protocolIncome=this.sales.protocolIncome.difference(I)):c?(this.sales.onlineOrders--,this.sales.onlineTickets-=p,this.sales.onlineIncome=this.sales.onlineIncome.difference(I)):(this.sales.offlineOrders--,this.sales.offlineTickets-=p,this.sales.offlineIncome=this.sales.offlineIncome.difference(I)),this.sales.totalOrders--,this.sales.totalTickets-=p,this.sales.totalIncome=this.sales.totalIncome.difference(I),this.sales.ensurePositive()}removeOnlineTicketOrder(i,e){var t,s,a,o;let u=i.tickets[0].template.price.currency,c=(t=e?.orderDetails)===null||t===void 0?void 0:t.discountedPrice;if(c??(c=lt.calculateIncomeForOrder(i,{applyProducts:!1,applySupplements:!0})),k(c)){c??(c=Y.zero(u));for(let l of i.tickets){let h=(o=(a=(s=e?.ticketsDetails)===null||s===void 0?void 0:s.get(l.uniqueId))===null||a===void 0?void 0:a.discountedPrice)!==null&&o!==void 0?o:l.template.price.clone();c=c?.add(h)}}this.sales.onlineOrders--,this.sales.onlineTickets-=i.tickets.length,this.sales.onlineIncome=this.sales.onlineIncome.difference(c),this.sales.totalOrders--,this.sales.totalTickets-=i.tickets.length,this.sales.totalIncome=this.sales.totalIncome.difference(c),this.sales.ensurePositive()}removeEventTicket(i,e,t){var s,a;let o=i.source===Xe.Client,u=i.tickets[t],c=u.ticketType===we.Promoter,l=u.ticketType===we.Protocol,h=(a=(s=e?.ticketsDetails)===null||s===void 0?void 0:s.get(u.uniqueId))===null||a===void 0?void 0:a.discountedPrice;h??(h=lt.calculateIncomeForEventTicket(u,{applySupplement:!0})),h??(h=u.template.price.clone()),c?(this.sales.promoterTickets--,this.sales.promoterIncome=this.sales.promoterIncome.difference(h)):l?(this.sales.protocolTickets--,this.sales.protocolIncome=this.sales.protocolIncome.difference(h)):o?(this.sales.onlineTickets--,this.sales.onlineIncome=this.sales.onlineIncome.difference(h)):(this.sales.offlineTickets--,this.sales.offlineIncome=this.sales.offlineIncome.difference(h)),this.sales.totalTickets--,this.sales.totalIncome=this.sales.totalIncome.difference(h),this.sales.ensurePositive()}},jx="rfkpMi0IXRv4WBW9AHs9XarfG65N",Jx=533333,yu="GC-",Rf="OP-",Mf="SP-",bu="OP-SP",Eu="PT",Wt=class n{constructor(i,e,t){this.originalPrice=i,this.discountedPrice=e,this.discountType=t}clone(){return new n(this.originalPrice.clone(),this.discountedPrice.clone(),this.discountType)}},or=class n{constructor(i,e){this.orderDetails=i,this.ticketsDetails=e}add(i){let e=this.clone(),t=this.orderDetails.originalPrice.currency;
3if(i.orderDetails.originalPrice.currency!==t||(e.orderDetails.originalPrice=e.orderDetails.originalPrice.add(i.orderDetails.originalPrice),i.orderDetails.discountedPrice.currency!==t))return null;e.orderDetails.discountedPrice=e.orderDetails.discountedPrice.add(i.orderDetails.discountedPrice);for(let s of i.ticketsDetails.entries()){if(s[1].originalPrice.currency!==t||s[1].discountedPrice.currency!==t)return null;e.ticketsDetails.set(s[0],s[1])}return e}clone(){return new n(this.orderDetails.clone(),ee(this.ticketsDetails,i=>F(i)))}},si=class{static getOrderDiscountDetailsOfOnlineTicketOrder(i){if(i.tickets.length===0)return null;let e=i.tickets[0].template.price.currency,t=new or(new Wt(Y.zero(e),Y.zero(e),""),new Map),s=We.fromOnlineOrder(i),a=this.getOrderDiscountDetailsOfTicketOrder(s,!1);return k(a)?null:(t=t.add(a),t)}static getOrderDiscountDetailsOfTicketOrder(i,e=!0){if(i.tickets.length===0)return null;switch(i.tickets[0].ticketType){case we.Standard:return this.generateStandardOrderDiscountDetails(i,e);case we.Protocol:return this.generateProtocolOrderDiscountDetails(i);default:return this.generateEmptyOrderDiscountDetails(i,e)}}static generateStandardOrderDiscountDetails(i,e=!0){var t,s,a,o,u,c;let l=i.tickets[0].template.price.currency,h=new or(new Wt(Y.zero(l),Y.zero(l),""),new Map),p=!1;for(let I of i.tickets){if(I.template.price.currency!==l)return null;let v=(a=(s=(t=I.discount)===null||t===void 0?void 0:t.code)===null||s===void 0?void 0:s.startsWith(Rf))!==null&&a!==void 0?a:!1,E=(c=(u=(o=I.discount)===null||o===void 0?void 0:o.code)===null||u===void 0?void 0:u.startsWith(Mf))!==null&&c!==void 0?c:!1,w=v||E,S=I.businessRef.organizationId===jx;w&&S&&(p=!0),h.ticketsDetails.set(I.uniqueId,new Wt(I.template.price.clone(),I.template.price.clone(),""))}if(p)return this.generateLoupePassOrderDiscountDetails(i,h);if(_(i.discount)){h.orderDetails.discountType=this.getDiscountTypeOfOrder(i);let I=lt.calculateIncomeWithoutDiscountForOrder(i,{applyProducts:!1,applySupplements:!0}),v=lt.calculateIncomeForOrder(i,{applyProducts:!1,applySupplements:!0});if(k(I)||k(v))return null;if(h.orderDetails.originalPrice=I.clone(),h.orderDetails.discountedPrice=v.clone(),v.isSame(I))return h;let E=v.value*100/I.value;for(let R of h.ticketsDetails.entries()){let x=xt.applyPercentageDiscountToPrice(R[1].originalPrice,E);h.ticketsDetails.get(R[0]).discountedPrice=x,h.ticketsDetails.get(R[0]).discountType=this.getDiscountTypeOfOrder(i)}let w=Y.zero(l);for(let R of h.ticketsDetails.values())w=w.add(R.discountedPrice);let S=v.difference(w);for(let R of h.ticketsDetails.entries()){if(S.value===0)break;let x=R[1].discountedPrice.add(S);x.isNegative()?(S=x.clone(),x=Y.zero(l)):S=Y.zero(l),h.ticketsDetails.get(R[0]).discountedPrice=x.clone()}}else{let I=lt.calculateIncomeWithoutDiscountForOrder(i,{applyProducts:!1,applySupplements:!0});if(k(I))return null;let v=Y.zero(l);for(let E of i.tickets){let w=lt.calculateIncomeForEventTicket(E,{applySupplement:!0});if(k(w))return null;h.ticketsDetails.get(E.uniqueId).discountedPrice=w,h.ticketsDetails.get(E.uniqueId).discountType=this.getDiscountTypeOfTicket(E),v=v.add(w)}h.orderDetails.originalPrice=I,h.orderDetails.discountedPrice=v}if(e)for(let I of i.tickets)I.status!==Ye.Live&&I.status!==Ye.Scanned&&I.status!==Ye.Canceled&&(h.orderDetails.originalPrice=h.orderDetails.originalPrice.difference(h.ticketsDetails.get(I.uniqueId).originalPrice),h.orderDetails.discountedPrice=h.orderDetails.discountedPrice.difference(h.ticketsDetails.get(I.uniqueId).discountedPrice),h.ticketsDetails.delete(I.uniqueId));return h}static generateProtocolOrderDiscountDetails(i){let e=i.tickets[0].template.price.currency,t=new or(new Wt(Y.zero(e),Y.zero(e),Eu),new Map);for(let s of i.tickets)t.ticketsDetails.set(s.uniqueId,new Wt(Y.zero(e),Y.zero(e),Eu));return t}static generateEmptyOrderDiscountDetails(i,e=!0){let t=i.tickets[0].template.price.currency,s=new or(new Wt(Y.zero(t),Y.zero(t),""),new Map);for(let o of i.tickets){if(o.template.price.currency!==t)return null;s.ticketsDetails.set(o.uniqueId,new Wt(o.template.price.clone(),o.template.price.clone(),""))}let a=lt.calculateIncomeWithoutDiscountForOrder(i,{applyProducts:!1,applySupplements:!0});if(k(a))return null;if(s.orderDetails.originalPrice=a.clone(),s.orderDetails.discountedPrice=a.clone(),e)for(let o of i.tickets)o.status!==Ye.Live&&o.status!==Ye.Scanned&&o.status!==Ye.Refunded&&(s.orderDetails.originalPrice=s.orderDetails.originalPrice.difference(s.ticketsDetails.get(o.uniqueId).originalPrice),s.orderDetails.discountedPrice=s.orderDetails.discountedPrice.difference(s.ticketsDetails.get(o.uniqueId).discountedPrice),s.ticketsDetails.delete(o.uniqueId));return s}static generateLoupePassOrderDiscountDetails(i,e){var t,s;let a=lt.calculateIncomeWithoutDiscountForOrder(i,{applyProducts:!1,applySupplements:!0});if(k(a))return null;let o=i.tickets[0].template.price.currency;e.orderDetails=new Wt(a.clone(),Y.zero(o),bu);for(let u of i.tickets)_(u.discount)?(e.ticketsDetails.set(u.uniqueId,new Wt(u.template.price.clone(),(s=(t=u.discount.voucherValue)===null||t===void 0?void 0:t.clone())!==null&&s!==void 0?s:Y.withCurrencyFromUnits(o,Jx),bu)),e.orderDetails.discountedPrice=e.orderDetails.discountedPrice.add(e.ticketsDetails.get(u.uniqueId).discountedPrice)):(e.ticketsDetails.set(u.uniqueId,new Wt(u.template.price.clone(),u.template.price.clone(),"")),e.orderDetails.discountedPrice=e.orderDetails.discountedPrice.add(e.ticketsDetails.get(u.uniqueId).originalPrice));return e}static getDiscountTypeOfTicket(i){if(i.ticketType===we.Protocol)return Eu;if(k(i.discount))return"";let e=i.discount.code;return k(e)?"":e.startsWith(Rf)||e.startsWith(Mf)?bu:e.startsWith(yu)?yu:e}static getDiscountTypeOfOrder(i){if(i.tickets[0].ticketType===we.Protocol)return Eu;if(k(i.discount))return"";let e=i.discount.code;return k(e)?"":e.startsWith(Rf)||e.startsWith(Mf)?bu:e.startsWith(yu)?yu:e}}
3,Ba=class n{constructor(i,e){this.templateId=i,this.sales=e}static empty(i,e){return new n(e,qr.empty(i))}static fromMap(i,e){return new n(r.get(e,"templateId"),qr.fromMap(i,r.get(e,"sales")))}toMap(i){return{templateId:this.templateId,sales:this.sales.toMap(i)}}clone(){return new n(this.templateId,this.sales.clone())}isSame(i){return i===this?!0:i.templateId===this.templateId&&d(i.sales,this.sales)}addEventTicketOfTicketOrder(i,e,t){var s,a,o;let u=i.source===Xe.Client,c=i.tickets[t].ticketType===we.Promoter,l=i.tickets[t].ticketType===we.Protocol,h=(o=(a=(s=e?.ticketsDetails)===null||s===void 0?void 0:s.get(i.tickets[t].uniqueId))===null||a===void 0?void 0:a.discountedPrice)!==null&&o!==void 0?o:i.tickets[t].template.price.clone();c?(this.sales.promoterTickets++,this.sales.promoterIncome=this.sales.promoterIncome.add(h)):l?(this.sales.protocolTickets++,this.sales.protocolIncome=this.sales.protocolIncome.add(h)):u?(this.sales.onlineTickets++,this.sales.onlineIncome=this.sales.onlineIncome.add(h)):(this.sales.offlineTickets++,this.sales.offlineIncome=this.sales.offlineIncome.add(h)),this.sales.totalTickets++,this.sales.totalIncome=this.sales.totalIncome.add(h)}addEventTicketOfOnlineTicketOrder(i,e,t){var s,a,o;let u=(o=(a=(s=e?.ticketsDetails)===null||s===void 0?void 0:s.get(i.tickets[t].uniqueId))===null||a===void 0?void 0:a.discountedPrice)!==null&&o!==void 0?o:i.tickets[t].template.price.clone();this.sales.onlineTickets++,this.sales.onlineIncome=this.sales.onlineIncome.add(u),this.sales.totalTickets++,this.sales.totalIncome=this.sales.totalIncome.add(u)}removeEventTicketOfTicketOrder(i,e,t){var s,a,o;let u=i.source===Xe.Client,c=i.tickets[t].ticketType===we.Promoter,l=i.tickets[t].ticketType===we.Protocol,h=(o=(a=(s=e?.ticketsDetails)===null||s===void 0?void 0:s.get(i.tickets[t].uniqueId))===null||a===void 0?void 0:a.discountedPrice)!==null&&o!==void 0?o:i.tickets[t].template.price.clone();c?(this.sales.promoterTickets--,this.sales.promoterIncome=this.sales.promoterIncome.difference(h)):l?(this.sales.protocolTickets--,this.sales.protocolIncome=this.sales.protocolIncome.difference(h)):u?(this.sales.onlineTickets--,this.sales.onlineIncome=this.sales.onlineIncome.difference(h)):(this.sales.offlineTickets--,this.sales.offlineIncome=this.sales.offlineIncome.difference(h)),this.sales.totalTickets--,this.sales.totalIncome=this.sales.totalIncome.difference(h),this.sales.ensurePositive()}removeEventTicketOfOnlineTicketOrder(i,e,t){var s,a,o;let u=(o=(a=(s=e?.ticketsDetails)===null||s===void 0?void 0:s.get(i.tickets[t].uniqueId))===null||a===void 0?void 0:a.discountedPrice)!==null&&o!==void 0?o:i.tickets[t].template.price.clone();this.sales.onlineTickets--,this.sales.onlineIncome=this.sales.onlineIncome.difference(u),this.sales.totalTickets--,this.sales.totalIncome=this.sales.totalIncome.difference(u),this.sales.ensurePositive()}},nP=(()=>{class n extends b{constructor(e,t,s,a,o){super(),this.monthOfYear=e,this.timezone=t,this.currency=s,this.dailySales=a,this.ticketTemplateSales=o}static empty(e,t,s){return new n(e,t,s,new Array,new Array)}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(e.fromData(r.get(t,"monthOfYear")),y(r.get(t,"timezone"),Ee),y(r.get(t,"currency"),Ae),r.getList(t,"dailySales",s=>Ua.fromMap(e,s)),r.getList(t,"ticketTemplateSales",s=>Ba.fromMap(e,s)))}toMap(e){return{monthOfYear:e.toData(this.monthOfYear),timezone:m(this.timezone),currency:m(this.currency),dailySales:this.dailySales.map(t=>t.toMap(e)),ticketTemplateSales:this.ticketTemplateSales.map(t=>t.toMap(e))}}clone(){return new n(this.monthOfYear.clone(),this.timezone,this.currency,ue(this.dailySales),ue(this.ticketTemplateSales))}isSame(e){return e===this?!0:d(e.monthOfYear,this.monthOfYear)&&e.timezone===this.timezone&&e.currency===this.currency&&P(e.dailySales,this.dailySales,d)&&P(e.ticketTemplateSales,this.ticketTemplateSales,d)}addTicketOrder(e){var t,s,a,o;if(e.status!==$e.Open)return;let u=e.creationDate,c=Mn.fromDate(u),l=null,h;for(let v=0;v<this.dailySales.length;++v)if(this.dailySales[v].day.isSame(c)){l=v;break}_(l)?h=this.dailySales[l]:(h=Ua.empty(this.currency,c),this.dailySales.push(h));let p=si.getOrderDiscountDetailsOfTicketOrder(e),I=(t=p?.orderDetails)===null||t===void 0?void 0:t.discountedPrice;if(I??(I=lt.calculateIncomeForOrder(e,{applyProducts:!1,applySupplements:!0})),k(I)){I??(I=Y.zero(this.currency));
3for(let v of e.tickets){let E=(o=(a=(s=p?.ticketsDetails)===null||s===void 0?void 0:s.get(v.uniqueId))===null||a===void 0?void 0:a.discountedPrice)!==null&&o!==void 0?o:v.template.price.clone();I=I?.add(E)}}h.addTicketOrder(e,p);for(let v=0;v<e.tickets.length;++v){let E=e.tickets[v];if(E.status!==Ye.Live&&E.status!==Ye.Scanned)continue;let w=null;for(let R=0;R<this.ticketTemplateSales.length;++R)if(this.ticketTemplateSales[R].templateId===E.templateId){w=R;break}let S;_(w)?S=this.ticketTemplateSales[w]:(S=Ba.empty(this.currency,E.templateId),this.ticketTemplateSales.push(S)),S.addEventTicketOfTicketOrder(e,p,v)}}addOnlineTicketOrder(e){var t,s,a,o;if(e.status!==$e.Open)return;let u=e.creationDate,c=Mn.fromDate(u),l=null,h;for(let v=0;v<this.dailySales.length;++v)if(this.dailySales[v].day.isSame(c)){l=v;break}_(l)?h=this.dailySales[l]:(h=Ua.empty(this.currency,c),this.dailySales.push(h));let p=si.getOrderDiscountDetailsOfOnlineTicketOrder(e),I=(t=p?.orderDetails)===null||t===void 0?void 0:t.discountedPrice;if(I??(I=lt.calculateIncomeForOrder(e,{applyProducts:!1,applySupplements:!0})),k(I)){I??(I=Y.zero(this.currency));for(let v of e.tickets){let E=(o=(a=(s=p?.ticketsDetails)===null||s===void 0?void 0:s.get(v.uniqueId))===null||a===void 0?void 0:a.discountedPrice)!==null&&o!==void 0?o:v.template.price.clone();I=I?.add(E)}}h.addOnlineTicketOrder(e,p);for(let v=0;v<e.tickets.length;++v){let E=e.tickets[v];if(E.status!==Ye.Live&&E.status!==Ye.Scanned)continue;let w=null;for(let R=0;R<this.ticketTemplateSales.length;++R)if(this.ticketTemplateSales[R].templateId===e.tickets[v].templateId){w=R;break}let S;_(w)?S=this.ticketTemplateSales[w]:(S=Ba.empty(this.currency,e.tickets[v].templateId),this.ticketTemplateSales.push(S)),S.addEventTicketOfOnlineTicketOrder(e,p,v)}}removeTicketOrder(e,t){var s,a,o,u;if(e.status!==$e.Canceled&&e.status!==$e.Refunded)return;let c=e.creationDate,l=Mn.fromDate(c),h=null;for(let I=0;I<this.dailySales.length;++I)if(this.dailySales[I].day.isSame(l)){h=I;break}let p=si.getOrderDiscountDetailsOfTicketOrder(e);if(_(h)){let I=this.dailySales[h],v=(s=p?.orderDetails)===null||s===void 0?void 0:s.discountedPrice;if(v??(v=lt.calculateIncomeForOrder(e,{applyProducts:!1,applySupplements:!0})),k(v)){v??(v=Y.zero(this.currency));for(let E of e.tickets){let w=(u=(o=(a=p?.ticketsDetails)===null||a===void 0?void 0:a.get(E.uniqueId))===null||o===void 0?void 0:o.discountedPrice)!==null&&u!==void 0?u:E.template.price.clone();v=v?.add(w)}}I.removeTicketOrder(e,t,p)}for(let I=0;I<e.tickets.length;++I){let v=null;for(let w=0;w<this.ticketTemplateSales.length;++w){let S=e.tickets[I];if(this.ticketTemplateSales[w].templateId===S.templateId){v=w;break}}let E;_(v)&&(E=this.ticketTemplateSales[v],E.removeEventTicketOfTicketOrder(e,p,I))}}removeOnlineTicketOrder(e){var t,s,a,o;if(e.status!==$e.Canceled&&e.status!==$e.Refunded)return;let u=e.creationDate,c=Mn.fromDate(u),l=null;for(let p=0;p<this.dailySales.length;++p)if(this.dailySales[p].day.isSame(c)){l=p;break}let h=si.getOrderDiscountDetailsOfOnlineTicketOrder(e);if(_(l)){let p=this.dailySales[l],I=(t=h?.orderDetails)===null||t===void 0?void 0:t.discountedPrice;if(I??(I=lt.calculateIncomeForOrder(e,{applyProducts:!1,applySupplements:!0})),k(I)){I??(I=Y.zero(this.currency));for(let v of e.tickets){let E=(o=(a=(s=h?.ticketsDetails)===null||s===void 0?void 0:s.get(v.uniqueId))===null||a===void 0?void 0:a.discountedPrice)!==null&&o!==void 0?o:v.template.price.clone();I=I?.add(E)}}p.removeOnlineTicketOrder(e,h)}for(let p=0;p<e.tickets.length;++p){let I=null;for(let E=0;E<this.ticketTemplateSales.length;++E)if(this.ticketTemplateSales[E].templateId===e.tickets[p].templateId){I=E;break}let v;_(I)&&(v=this.ticketTemplateSales[I],v.removeEventTicketOfOnlineTicketOrder(e,h,p))}}removeEventTicket(e,t){var s,a,o,u;let c=e.tickets[t];if(c.status!==Ye.Canceled&&c.status!==Ye.Refunded)return;let l=e.creationDate,h=Mn.fromDate(l),p=null;for(let E=0;E<this.dailySales.length;++E)if(this.dailySales[E].day.isSame(h)){p=E;break}let I=si.getOrderDiscountDetailsOfTicketOrder(e);if(_(p)){let E=this.dailySales[p],w=(s=I?.orderDetails)===null||s===void 0?void 0:s.discountedPrice;if(w??(w=lt.calculateIncomeForOrder(e,{applyProducts:!1,applySupplements:!0})),k(w)){w??(w=Y.zero(this.currency));for(let S of e.tickets){let R=(u=(o=(a=I?.ticketsDetails)===null||a===void 0?void 0:a.get(S.uniqueId))===null||o===void 0?void 0:o.discountedPrice)!==null&&u!==void 0?u:S.template.price.clone();w=w?.add(R)}}E.removeEventTicket(e,I,t)}let v=null;for(let E=0;E<this.ticketTemplateSales.length;++E)if(this.ticketTemplateSales[E].templateId===e.tickets[t].templateId){v=E;break}_(v)&&this.ticketTemplateSales[v].removeEventTicketOfTicketOrder(e,I,t)}}return n.TYPE_ID="719c6b49327949dfa9384fafb7743e1b",n})(),jD=class extends f{build(i,e){return nP.fromMap(i,e)}},Zn=(function(n){return n.Offline="Offline",n.Online="Online",n.Promoter="Promoter",n.Protocol="Protocol",n})(Zn||{}),Ha=class n{constructor(i,e,t){this.ticketId=i,this.templateId=e,this.price=t}static fromTicketOrder(i,e){return i.tickets.map(t=>n.fromEventTicket(t,e))}static fromOnlineTicketOrder(i,e){let t=new Array;for(let s of i.tickets)t.push(n.fromEventTicket(s,e));return t}static fromEventTicket(i,e){var t,s,a;return new n(i.uniqueId,i.templateId,(a=(s=(t=e?.ticketsDetails)===null||t===void 0?void 0:t.get(i.uniqueId))===null||s===void 0?void 0:s.discountedPrice)!==null&&a!==void 0?a:i.template.price.clone())}static fromMap(i,e){return new n(r.get(e,"ticketId"),r.get(e,"templateId"),Y.decode(r.get(e,"price")))}toMap(i){return{ticketId:this.ticketId,templateId:this.templateId,price:this.price.encode()}}clone(){return new n(this.ticketId,this.templateId,this.price.clone())}isSame(i){return i===this?!0:i.ticketId===this.ticketId&&i.templateId===this.templateId&&d(i.price,this.price)}},JD=class n{constructor(i,e,t,s,a,o,u){this.orderId=i,this.date=e,this.country=t,this.tickets=s,this.totalPrice=a,this.isOnline=o,this.orderType=u}static fromTicketOrder(i){var e,t,s;let a=si.getOrderDiscountDetailsOfTicketOrder(i),o=Ha.fromTicketOrder(i,a),u=i.source===Xe.Client,c=i.tickets[0].ticketType===we.Promoter,l=i.tickets[0].ticketType===we.Protocol,h;return c?h=Zn.Promoter:l?h=Zn.Protocol:u?h=Zn.Online:h=Zn.Offline,new n(i.uniqueId,g.cloneDate(i.creationDate),n.findTicketOrderCountry(i),o,(s=(t=(e=a?.orderDetails)===null||e===void 0?void 0:e.discountedPrice)!==null&&t!==void 0?t:lt.calculateIncomeForOrder(i,{applyProducts:!1,applySupplements:!0}))!==null&&s!==void 0?s:n.calculateTotalPrice(o),u,h)}static fromOnlineTicketOrder(i){var e,t,s;let a=si.getOrderDiscountDetailsOfOnlineTicketOrder(i),o=Ha.fromOnlineTicketOrder(i,a);return new n(i.uniqueId,g.cloneDate(i.creationDate),n.findOnlineTicketOrderCountry(i),o,(s=(t=(e=a?.orderDetails)===null||e===void 0?void 0:e.discountedPrice)!==null&&t!==void 0?t:lt.calculateIncomeForOrder(i,{applyProducts:!1,applySupplements:!0}))!==null&&s!==void 0?s:n.calculateTotalPrice(o),!0,Zn.Online)}static findTicketOrderCountry(i){var e;let t=i.tryGetCustomer(),s=t?.findComponentByTypeId(Wl.TYPE_ID),a=(e=s?.address)===null||e===void 0?void 0:e.country;return ri(a)?a:null}static findOnlineTicketOrderCountry(i){var e;let t=i.tryGetCustomer(),s=t?.findComponentByTypeId(Wl.TYPE_ID),a=(e=s?.address)===null||e===void 0?void 0:e.country;return ri(a)?a:null}static calculateTotalPrice(i){let e=i[0].price.currency,t=Y.zero(e);for(let s of i)s.price.currency===e&&(t=t.add(s.price));return t}static fromMap(i,e){let t=Re(r.getOrNull(e,"orderType"),Zn);if(k(t)){let s=r.get(e,"isOnline");_(s)&&(t=s?Zn.Online:Zn.Offline)}return new n(r.get(e,"orderId"),i.decodeDate(r.get(e,"date")),r.getOrNull(e,"country"),r.getList(e,"tickets",s=>Ha.fromMap(i,s)),Y.decode(r.get(e,"totalPrice")),r.getOrNull(e,"isOnline"),t)}toMap(i){return{orderId:this.orderId,date:i.encodeDate(this.date),country:this.country,tickets:this.tickets.map(e=>e.toMap(i)),totalPrice:this.totalPrice.encode(),isOnline:this.isOnline,orderType:Se(this.orderType)}}clone(){var i;return new n(this.orderId,g.cloneDate(this.date),(i=this.country)!==null&&i!==void 0?i:null,ue(this.tickets),this.totalPrice.clone(),this.isOnline,this.orderType)}isSame(i){return i===this?!0:i.orderId===this.orderId&&i.date===this.date&&i.country===this.country&&P(i.tickets,this.tickets,d)&&d(i.totalPrice,this.totalPrice)&&i.isOnline===this.isOnline&&i.orderType===this.orderType}},iP=(()=>{class n extends b{constructor(e,t,s){super(),this.monthOfYear=e,this.timezone=t,this.orders=s}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(e.fromData(r.get(t,"monthOfYear")),y(r.get(t,"timezone"),Ee),r.getList(t,"orders",s=>JD.fromMap(e,s)))}toMap(e){return{monthOfYear:e.toData(this.monthOfYear),timezone:m(this.timezone),orders:this.orders.map(t=>t.toMap(e))}}clone(){return new n(this.monthOfYear.clone(),this.timezone,ue(this.orders))}isSame(e){return e===this?!0:d(e.monthOfYear,this.monthOfYear)&&e.timezone===this.timezone&&P(e.orders,this.orders,d)}}return n.TYPE_ID="77c641fc41c543e7a80e19fc9d58c876",n})(),KD=class extends f{build(i,e){return iP.fromMap(i,e)}},Gu=(()=>{class n extends b{constructor(e,t,s,a,o,u){super(),this.scannedNormalTickets=e,this.scannedProtocolTickets=t,this.scannedHardTickets=s,this.scannedThirdPartyTickets=a,this.scannedTicketsBy=o,this.totalScannedTickets=u}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static empty(){return new n(new Map,new Map,new Map,new Map,new Map,0)}static fromMap(e,t){return new n(r.getMap(t,"scannedNormalTickets",(s,a)=>({key:s,value:Number(a)})),r.getMap(t,"scannedProtocolTickets",(s,a)=>({key:s,value:Number(a)})),r.getMap(t,"scannedHardTickets",(s,a)=>({key:s,value:Number(a)})),r.getMap(t,"scannedThirdPartyTickets",(s,a)=>({key:s,value:Number(a)})),r.getMap(t,"scannedTicketsBy",(s,a)=>({key:s,value:Number(a)})),r.get(t,"totalScannedTickets"))}toMap(e){return{scannedNormalTickets:se(this.scannedNormalTickets,(t,s)=>({key:t.toString(),value:s})),scannedProtocolTickets:se(this.scannedProtocolTickets,(t,s)=>({key:t.toString(),value:s})),scannedHardTickets:se(this.scannedHardTickets,(t,s)=>({key:t.toString(),value:s})),scannedThirdPartyTickets:se(this.scannedThirdPartyTickets,(t,s)=>({key:t.toString(),value:s})),scannedTicketsBy:se(this.scannedTicketsBy,(t,s)=>({key:t.toString(),value:s})),totalScannedTickets:this.totalScannedTickets}}
3clone(){return new n(ee(this.scannedNormalTickets),ee(this.scannedProtocolTickets),ee(this.scannedHardTickets),ee(this.scannedThirdPartyTickets),ee(this.scannedTicketsBy),this.totalScannedTickets)}isSame(e){return this===e?!0:re(e.scannedNormalTickets,this.scannedNormalTickets)&&re(e.scannedProtocolTickets,this.scannedProtocolTickets)&&re(e.scannedHardTickets,this.scannedHardTickets)&&re(e.scannedThirdPartyTickets,this.scannedThirdPartyTickets)&&re(e.scannedTicketsBy,this.scannedTicketsBy)&&e.totalScannedTickets===this.totalScannedTickets}addTicket(e){var t;let s=e.templateId;if(e.ticketType===we.HardTicket){this.scannedHardTickets.has(s)||this.scannedHardTickets.set(s,0);let u=this.scannedHardTickets.get(s);this.scannedHardTickets.set(s,u+1)}else if(e.ticketType===we.Protocol){this.scannedProtocolTickets.has(s)||this.scannedProtocolTickets.set(s,0);let u=this.scannedProtocolTickets.get(s);this.scannedProtocolTickets.set(s,u+1)}else{this.scannedNormalTickets.has(s)||this.scannedNormalTickets.set(s,0);let u=this.scannedNormalTickets.get(s);this.scannedNormalTickets.set(s,u+1)}let a=(t=e.scannerId)!==null&&t!==void 0?t:"";this.scannedTicketsBy.has(a)||this.scannedTicketsBy.set(a,0);let o=this.scannedTicketsBy.get(a);this.scannedTicketsBy.set(a,o+1),this.totalScannedTickets++}addThirdPartyTicket(e){var t;let s=e.templateId;this.scannedThirdPartyTickets.has(s)||this.scannedThirdPartyTickets.set(s,0);let a=this.scannedThirdPartyTickets.get(s);this.scannedThirdPartyTickets.set(s,a+1);let o=(t=e.scannerId)!==null&&t!==void 0?t:"";this.scannedTicketsBy.has(o)||this.scannedTicketsBy.set(o,0);let u=this.scannedTicketsBy.get(o);this.scannedTicketsBy.set(o,u+1),this.totalScannedTickets++}}return n.TYPE_ID="dae319c7fa56484eb0c323f2d3d5dbc2",n.SCHEMA_VERSION=3,n})(),ZD=class extends f{build(i,e){return Gu.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(Gu.SCHEMA_VERSION))return e;if(t.isGreaterThan(Gu.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(r.setIfNullOrUndefined(e,"scannedProtocolTickets",{}),s=2),s<3&&(r.setIfNullOrUndefined(e,"scannedThirdPartyTickets",{}),s=3),e.$schema_version=D.encodedExactly(s),e}},sd=(()=>{class n extends b{}return n.DELIMITER="-",n})(),vt=(function(n){return n.Event="Event",n.Business="Business",n})(vt||{}),hi=(function(n){return n.AssignByTicketType="AssignByTicketType",n.AssignByTicketPrice="AssignByTicketPrice",n})(hi||{}),XD=class extends Error{constructor(i,e="unknown",t){var s;super(i),this.description=i,this.code=e,this.fatal=(s=t?.fatal)!==null&&s!==void 0?s:!0}toString(){return`[${this.code}] ${this.description}`}},_i=class extends TypeError{constructor(i){super(`unsupported product type {${i.constructor.name}}.`)}},rd=class extends sd{constructor(i,e,t,s,a,o,u,c){super(),this.businessRef=i,this.eventId=e,this.creationDate=t,this.shortCode=s,this.scope=a,this.serialNumbers=c,this.ticketGroups=u,this.totalTicketGroups=o}getSerialNumber(i){if(!(i instanceof An))return W.error(new _i(i));let e=i,t=this.getTicketGroupId(e);if(k(t))throw new XD("Cannot assign a serial group for ticket.","ticket-not-valid");let s=this.registerTicketGroup(t,e),a=YR(e.ticketType),o=this.incrementSerialNumber(t,e.ticketType);return W.ok([this.shortCode,a.toFixed().padStart(2,"0"),s.toFixed().padStart(3,"0"),o.toFixed().padStart(4,"0")].join(sd.DELIMITER))}registerTicketGroup(i,e){var t;let s=(t=this.ticketGroups.get(i))!==null&&t!==void 0?t:null;return k(s)&&(s=this.getTicketGroup(e),this.ticketGroups.set(i,s),++this.totalTicketGroups),s}incrementSerialNumber(i,e){var t;let s=`${Hw(e)}_${i}`,a=((t=this.serialNumbers.get(s))!==null&&t!==void 0?t:0)+1;return this.serialNumbers.set(s,a),a}},sP=(()=>{class n extends rd{constructor(e,t,s,a,o,u,c,l){super(e,t,s,a,o,u,c,l)}get strategy(){return hi.AssignByTicketPrice}get $typeId(){return n.TYPE_ID}getSerialNumbers(){return this.serialNumbers}static forEvent(e){return e.shortCode==null?null:new n(e.businessRef,e.uniqueId,(0,oe.default)(),e.shortCode,vt.Event,0,new Map,new Map)}static forBusiness(e,t){return new n(e,null,(0,oe.default)(),t,vt.Business,0,new Map,new Map)}static fromMap(e,t){return new n(j.mustDecode(r.get(t,"businessRef")),r.getOrNull(t,"eventId"),e.decodeDate(r.get(t,"creationDate")),r.get(t,"shortCode"),y(r.get(t,"scope"),vt),r.get(t,"totalTicketGroups"),r.getMap(t,"ticketGroups",(s,a)=>({key:s,value:Number(a)})),r.getMap(t,"serialNumbers",(s,a)=>({key:s,value:Number(a)})))}toMap(e){return{eventId:this.eventId,businessRef:this.businessRef.encode(),creationDate:e.encodeDate(this.creationDate),shortCode:this.shortCode,scope:m(this.scope),totalTicketGroups:this.totalTicketGroups,ticketGroups:se(this.ticketGroups,(t,s)=>({key:t,value:s})),serialNumbers:se(this.serialNumbers,(t,s)=>({key:t,value:s}))}}clone(){return new n(this.businessRef.clone(),this.eventId,g.cloneDate(this.creationDate),this.shortCode,this.scope,this.totalTicketGroups,ee(this.ticketGroups,e=>e),ee(this.serialNumbers,e=>e))}isSame(e){return this===e?!0:this.eventId===e.eventId&&d(this.businessRef,e.businessRef)&&this.creationDate==e.creationDate&&this.shortCode===e.shortCode&&this.scope===e.scope&&this.totalTicketGroups===e.totalTicketGroups&&re(e.ticketGroups,this.ticketGroups,(t,s)=>t===s)&&re(e.serialNumbers,this.serialNumbers,(t,s)=>t===s)}getTicketGroupId(e){return _(e.discount)?null:this.getTicketPrice(e).encode()}getTicketGroup(e){return this.getTicketPrice(e).convertToCents}getTicketPrice(e){return e.ticketType==we.Protocol?Y.zero(e.template.price.currency):e.template.price}}return n.TYPE_ID="4e53ae190d9a4e428b9a1a1c46617114",n})(),QD=class extends f{build(i,e){return sP.fromMap(i,e)}},Wu=(()=>{class n extends rd{constructor(e,t,s,a,o,u,c,l){super(e,t,s,a,o,u,c,l)}get strategy(){return hi.AssignByTicketType}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}getTicketGroups(){return this.ticketGroups}getSerialNumbers(){return this.serialNumbers}static forEvent(e){return e.shortCode==null?null:new n(e.businessRef,e.uniqueId,(0,oe.default)(),e.shortCode,vt.Event,0,new Map,new Map)}static forBusiness(e,t){return new n(e,null,(0,oe.default)(),t,vt.Business,0,new Map,new Map)}static fromMap(e,t){return new n(j.mustDecode(r.get(t,"businessRef")),r.getOrNull(t,"eventId"),e.decodeDate(r.get(t,"creationDate")),r.get(t,"shortCode"),y(r.get(t,"scope"),vt),r.get(t,"totalTicketGroups"),r.getMap(t,"ticketGroups",(s,a)=>({key:s,value:Number(a)})),r.getMap(t,"serialNumbers",(s,a)=>({key:s,value:Number(a)})))}toMap(e){return{eventId:this.eventId,businessRef:this.businessRef.encode(),creationDate:e.encodeDate(this.creationDate),shortCode:this.shortCode,scope:m(this.scope),totalTicketGroups:this.totalTicketGroups,ticketGroups:se(this.ticketGroups,(t,s)=>({key:t,value:s})),serialNumbers:se(this.serialNumbers,(t,s)=>({key:t,value:s}))}}clone(){return new n(this.businessRef.clone(),this.eventId,g.cloneDate(this.creationDate),this.shortCode,this.scope,this.totalTicketGroups,ee(this.ticketGroups,e=>e),ee(this.serialNumbers,e=>e))}isSame(e){return this===e?!0:this.eventId===e.eventId&&d(this.businessRef,e.businessRef)&&this.creationDate==e.creationDate&&this.shortCode===e.shortCode&&this.scope===e.scope&&this.totalTicketGroups===e.totalTicketGroups&&re(e.ticketGroups,this.ticketGroups,(t,s)=>t===s)&&re(e.serialNumbers,this.serialNumbers,(t,s)=>t===s)}getTicketGroupId(e){return e.template.uniqueId}getTicketGroup(e){return this.totalTicketGroups+1}}return n.TYPE_ID="0e0c0b0a090807060504030201000f0e",n.SCHEMA_VERSION=3,n})(),ev=class extends f{build(i,e){return Wu.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(Wu.SCHEMA_VERSION))return e;if(t.isGreaterThan(Wu.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(e.scope=m(vt.Event),e.shortCode=e.eventShortCode,s=2),s<3&&(e.totalTicketGroups=e.totalTicketTypes,e.ticketGroups=e.ticketTypes,s=3),e.$schema_version=D.encodedExactly(s),e}},ad=(function(n){return n.Live="LIVE",n.Used="USED",n.Canceled="CANCELED",n.Refunded="REFUNDED",n})(ad||{}),Yr=(function(n){return n.Admin="Admin",n.Client="Client",n})(Yr||{}),di=(()=>{class n extends zt(b){constructor(e,t,s,a,o,u,c,l,h,p,I,v,E,w,S,R,x,N,O,A,M){super(),this.status=e,this.uniqueId=t,this.scanCode=s,this.businessRef=a,this.creationDate=o,this.templateId=u,this.orderId=c,this.viaOrderId=l,this.storagePath=h,this.originalName=p,this.overrideName=I,this.price=v,this.originalPrice=E,this.protocol=w,this.customer=S,this.variation=R,this.usedAt=x,this.serialNumber=N,this.paymentMethod=O,this.source=A,this.components=M}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(10,n.SCHEMA_VERSION)}static create(e){var t,s,a,o,u,c;return new n(e.status,e.uniqueId,e.scanCode,e.businessRef,e.creationDate,e.templateId,e.orderId,e.viaOrderId,e.storagePath,e.originalName,(t=e.overrideName)!==null&&t!==void 0?t:null,e.price,e.originalPrice,e.protocol,e.customer,e.variation,(s=e.usedAt)!==null&&s!==void 0?s:null,(a=e.serialNumber)!==null&&a!==void 0?a:null,(o=e.paymentMethod)!==null&&o!==void 0?o:null,(u=e.source)!==null&&u!==void 0?u:null,(c=e.components)!==null&&c!==void 0?c:new ae)}static fromMap(e,t){return new n(y(r.get(t,"$status"),ad),r.get(t,"uniqueId"),r.get(t,"scanCode"),j.mustDecode(r.get(t,"businessRef")),e.decodeDate(r.get(t,"creationDate")),r.get(t,"templateId"),r.getOrNull(t,"orderId"),r.getOrNull(t,"viaOrderId"),r.getOrNull(t,"storagePath"),e.fromData(r.get(t,"originalName")),e.fromDataOrNull(r.getOrNull(t,"overrideName")),Y.decode(r.get(t,"price")),Y.decodeOrNull(r.getOrNull(t,"originalPrice")),e.fromData(r.get(t,"protocol")),e.fromDataOrNull(r.getOrNull(t,"customer")),e.fromDataOrNull(r.getOrNull(t,"variation")),e.decodeDateOrNull(r.getOrNull(t,"usedAt")),r.getStringOrNull(t,"serialNumber"),Re(r.getOrNull(t,"paymentMethod"),Fe),y(r.get(t,"source"),Yr),ae.deserialize(e,r.get(t,"components")))}toMap(e){var t,s,a,o,u,c;return{$status:m(this.status),uniqueId:this.uniqueId,scanCode:this.scanCode,businessRef:this.businessRef.encode(),creationDate:e.encodeDate(this.creationDate),templateId:this.templateId,orderId:this.orderId,viaOrderId:this.viaOrderId,storagePath:this.storagePath,originalName:e.toData(this.originalName),overrideName:e.toDataOrNull(this.overrideName),price:this.price.encode(),originalPrice
3:(s=(t=this.originalPrice)===null||t===void 0?void 0:t.encode())!==null&&s!==void 0?s:null,protocol:e.toData(this.protocol),protocolType:m(this.protocol.type),customer:e.toDataOrNull(this.customer),customerId:(o=(a=this.customer)===null||a===void 0?void 0:a.uniqueId)!==null&&o!==void 0?o:null,variation:e.toDataOrNull(this.variation),variationId:(c=(u=this.variation)===null||u===void 0?void 0:u.uniqueId)!==null&&c!==void 0?c:null,usedAt:e.encodeDateOrNull(this.usedAt),serialNumber:this.serialNumber,paymentMethod:this.paymentMethod,source:m(this.source),components:this.components.serialize(e)}}clone(){var e,t,s,a;return new n(this.status,this.uniqueId,this.scanCode,this.businessRef.clone(),g.cloneDate(this.creationDate),this.templateId,this.orderId,this.viaOrderId,this.storagePath,this.originalName.clone(),(t=(e=this.overrideName)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null,this.price.clone(),(a=(s=this.originalPrice)===null||s===void 0?void 0:s.clone())!==null&&a!==void 0?a:null,F(this.protocol),Z(this.customer),Z(this.variation),g.cloneDateOrNull(this.usedAt),this.serialNumber,this.paymentMethod,this.source,this.components.clone())}isSame(e){return e===this?!0:e.status===this.status&&e.uniqueId===this.uniqueId&&e.scanCode===this.scanCode&&d(e.businessRef,this.businessRef)&&e.templateId===this.templateId&&e.orderId===this.orderId&&e.viaOrderId===this.viaOrderId&&e.storagePath===this.storagePath&&d(e.originalName,this.originalName)&&d(e.overrideName,this.overrideName)&&d(e.price,this.price)&&d(e.originalPrice,this.originalPrice)&&d(e.protocol,this.protocol)&&d(e.customer,this.customer)&&d(e.variation,this.variation)&&e.usedAt===this.usedAt&&e.creationDate===this.creationDate&&e.serialNumber===this.serialNumber&&e.paymentMethod===this.paymentMethod&&e.source===this.source&&d(e.components,this.components)}copyWith(e){var t,s,a,o,u,c,l,h,p,I,v,E,w,S,R,x,N,O,A,M,C,H,B,U,V;return new n((t=e.status)!==null&&t!==void 0?t:this.status,(s=e.uniqueId)!==null&&s!==void 0?s:this.uniqueId,(a=e.scanCode)!==null&&a!==void 0?a:this.scanCode,(o=e.businessRef)!==null&&o!==void 0?o:this.businessRef.clone(),(u=e.creationDate)!==null&&u!==void 0?u:g.cloneDate(this.creationDate),(c=e.templateId)!==null&&c!==void 0?c:this.templateId,(l=e.orderId)!==null&&l!==void 0?l:this.orderId,(h=e.viaOrderId)!==null&&h!==void 0?h:this.viaOrderId,(p=e.storagePath)!==null&&p!==void 0?p:this.storagePath,(I=e.originalName)!==null&&I!==void 0?I:this.originalName.clone(),(v=e.overrideName)!==null&&v!==void 0?v:(w=(E=this.overrideName)===null||E===void 0?void 0:E.clone())!==null&&w!==void 0?w:null,(S=e.price)!==null&&S!==void 0?S:this.price.clone(),(R=e.originalPrice)!==null&&R!==void 0?R:(N=(x=this.originalPrice)===null||x===void 0?void 0:x.clone())!==null&&N!==void 0?N:null,(O=e.protocol)!==null&&O!==void 0?O:F(this.protocol),(A=e.customer)!==null&&A!==void 0?A:Z(this.customer),(M=e.variation)!==null&&M!==void 0?M:Z(this.variation),(C=e.usedAt)!==null&&C!==void 0?C:g.cloneDateOrNull(this.usedAt),(H=e.serialNumber)!==null&&H!==void 0?H:this.serialNumber,(B=e.paymentMethod)!==null&&B!==void 0?B:this.paymentMethod,(U=e.source)!==null&&U!==void 0?U:this.source,(V=e.components)!==null&&V!==void 0?V:this.components.clone())}assignToCustomerAccount(e){var t,s,a,o,u,c;return new n(this.status,this.uniqueId,this.scanCode,this.businessRef.clone(),g.cloneDate(this.creationDate),this.templateId,this.orderId,this.viaOrderId,this.storagePath,this.originalName.clone(),(s=(t=this.overrideName)===null||t===void 0?void 0:t.clone())!==null&&s!==void 0?s:null,this.price.clone(),(o=(a=this.originalPrice)===null||a===void 0?void 0:a.clone())!==null&&o!==void 0?o:null,F(this.protocol),(c=(u=this.customer)===null||u===void 0?void 0:u.assignToCustomerAccount(e))!==null&&c!==void 0?c:null,Z(this.variation),g.cloneDateOrNull(this.usedAt),this.serialNumber,this.paymentMethod,this.source,this.components.clone())}getVariationId(){var e,t;return(t=(e=this.variation)===null||e===void 0?void 0:e.uniqueId)!==null&&t!==void 0?t:null}getVariationIdOrDefault(){var e,t;return(t=(e=this.variation)===null||e===void 0?void 0:e.uniqueId)!==null&&t!==void 0?t:n.DEFAULT_VARIATION_ID}static encodedStatusSafe(e){return m(e)}static generateStoragePath(e,t,s){let o=`${tn(s).substring(0,30)}_${e}`;return`business_profiles/${t}/passes/${o}.pdf`}}return n.TYPE_ID="19c0c499c3a548b9b10d6dec4a082a75",n.SCHEMA_VERSION=14,n.DEFAULT_VARIATION_ID="__DEFAULT_VARIATION__",n})(),tv=class extends f{build(i,e){return di.fromMap(i,e)}optimizeForQuery(i,e){let t=e.protocol;if(!(t instanceof ar)||t.modifiers.size<=0)return null;let a=uD.forPass({protocol:t,passVariationId:e.getVariationIdOrDefault()}).findSeats();if(a.size<=0)return null;let o=[];for(let[u,c]of a){let l=c.seatId;o.push(`${u}:${l}`)}return{seats:o}}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(this.migrateEnum(e,"$status",ad,ad.Live),t.contains(di.SCHEMA_VERSION))return e;if(t.isGreaterThan(di.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(e.protocol=i.toData(ns.create({events:new Map,maxEventCount:dt.undefined()})),s=2),s<3&&(s=3),s<4&&(s=4),s<5&&(s=5),s<6&&(s=6),s<7&&(s=7,e.components=[]),s<8&&(s=8),s<9&&(s=9,e.scanCode=e.uniqueId),s<10&&(s=10,e.originalName=e.names),s<11&&(s=11),s<12&&(e.source=k(e.orderId)?m(Yr.Admin):m(Yr.Client),s=12),s<13&&(e.viaOrderId=e.orderId,e.orderId=null,s=13),s<14&&(s=14),e.$schema_version=D.encodedExactly(s),e}},od=class extends sd{getFormattedProductTypeId(i){switch(!0){case i instanceof An:return W.ok(YR(i.ticketType).toFixed().padStart(2,"0"));case i instanceof di:return W.ok("P");case i instanceof ui:return W.ok("V");case i instanceof ci:return W.ok("V");default:return W.error(new _i(i))}}getSerialNumber(i){return W.concat([this.getFormattedProductTypeId(i),this.getFormattedSeasonId(i),this.getFormattedProductGroupId(i),this.getProductSerialNumberBucketId(i)]).map(([e,t,s,a])=>{let o=this.getNextSerialNumber(a);this.markSerialNumberAsUsed(a,o);let u=[this.shortCode,e,s,o.toFixed().padStart(4,"0")];return t!=null&&u.splice(2,0,t),u.join(sd.DELIMITER)})}getNextSerialNumber(i){var e;return((e=this.serialNumberBuckets.get(i))!==null&&e!==void 0?e:0)+1}markSerialNumberAsUsed(i,e){this.serialNumberBuckets.set(i,e)}},Rs=(function(n){return n.AssignByTemplate="AssignByTemplate",n.AssignByPrice="AssignByPrice",n})(Rs||{}),ud;(function(n){function i(e){switch(e){case hi.AssignByTicketType:return Rs.AssignByTemplate;
3case hi.AssignByTicketPrice:return Rs.AssignByPrice}}n.fromLegacy=i})(ud||(ud={}));var Ga=(()=>{class n extends od{constructor(e,t,s,a,o,u,c,l){super(),this.businessRef=e,this.eventId=t,this.seasonId=s,this.creationDate=a,this.shortCode=o,this.scope=u,this.serialNumberBuckets=c,this.groups=l}static create(e){return new n(e.businessRef,e.eventId,e.seasonId,e.creationDate,e.shortCode,e.scope,e.serialNumberBuckets,e.groups)}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}get strategy(){return Rs.AssignByTemplate}static fromLegacy(e){return n.create({businessRef:e.businessRef.clone(),eventId:e.eventId,seasonId:null,creationDate:g.cloneDate(e.creationDate),scope:e.scope,groups:ee(e.getTicketGroups(),t=>t),serialNumberBuckets:ee(e.getSerialNumbers(),t=>t),shortCode:e.shortCode})}static forBusiness(e,t){return n.create({businessRef:e,eventId:null,seasonId:null,creationDate:fe.now(),shortCode:t,scope:vt.Business,groups:new Map,serialNumberBuckets:new Map})}static forEvent(e){return e.shortCode==null?null:n.create({businessRef:e.businessRef,eventId:e.uniqueId,seasonId:null,creationDate:fe.now(),shortCode:e.shortCode,scope:vt.Event,groups:new Map,serialNumberBuckets:new Map})}getSerialNumber(e){return this.ensureProductGroupIsRegistered(e).chain(()=>super.getSerialNumber(e))}getFormattedSeasonId(e){return W.ok(this.seasonId)}ensureProductGroupIsRegistered(e){return this.getProductGroupId(e).chain(t=>(this.registerGroup(t),W.ok(null)))}registerGroup(e){if(this.groups.has(e))return;let t=this.getNextGroupNumber();this.groups.set(e,t)}getNextGroupNumber(){return this.groups.size+1}getProductGroupId(e){switch(!0){case e instanceof An:return W.ok(e.templateId);case e instanceof di:return W.ok(e.templateId);default:return W.error(new _i(e))}}getFormattedProductGroupId(e){return this.getProductGroupId(e).chain(t=>{let s=this.groups.get(t);return s==null?W.error(`Cannot find group with id {${t}}.`):W.ok(s.toFixed().padStart(3,"0"))})}getProductSerialNumberBucketId(e){switch(!0){case e instanceof An:{let t=Hw(e.ticketType);return W.ok(`${t}_${e.templateId}`)}case e instanceof di:return W.ok(`p_${e.templateId}`);default:return W.error(new _i(e))}}static fromMap(e,t){return n.create({businessRef:j.mustDecode(r.getString(t,"businessRef")),eventId:r.getStringOrNull(t,"eventId"),seasonId:r.getStringOrNull(t,"seasonId"),creationDate:e.decodeDate(r.getNumber(t,"creationDate")),scope:y(r.getString(t,"scope"),vt),shortCode:r.getString(t,"shortCode"),groups:r.getMap(t,"groups",(s,a)=>({key:K.decodeString(s),value:K.decodeNumber(a)})),serialNumberBuckets:r.getMap(t,"serialNumberBuckets",(s,a)=>({key:K.decodeString(s),value:K.decodeNumber(a)}))})}toMap(e){return{businessRef:this.businessRef.encode(),eventId:this.eventId,seasonId:this.seasonId,creationDate:e.encodeDate(this.creationDate),scope:m(this.scope),shortCode:this.shortCode,groups:se(this.groups,(t,s)=>({key:t,value:s})),groupCount:this.groups.size,serialNumberBuckets:se(this.serialNumberBuckets,(t,s)=>({key:t,value:s}))}}clone(){return n.create({businessRef:this.businessRef.clone(),eventId:this.eventId,seasonId:this.seasonId,creationDate:g.cloneDate(this.creationDate),scope:this.scope,shortCode:this.shortCode,groups:ee(this.groups,e=>e),serialNumberBuckets:ee(this.serialNumberBuckets,e=>e)})}isSame(e){return e===this?!0:d(e.businessRef,this.businessRef)&&e.eventId===this.eventId&&e.seasonId===this.seasonId&&e.creationDate===this.creationDate&&e.shortCode===this.shortCode&&e.scope===this.scope&&re(e.groups,this.groups,(t,s)=>t===s)&&re(e.serialNumberBuckets,this.serialNumberBuckets,(t,s)=>t===s)}resetForNewSeason(e){return n.create({businessRef:this.businessRef.clone(),eventId:this.eventId,seasonId:e,creationDate:g.cloneDate(this.creationDate),scope:this.scope,shortCode:this.shortCode,groups:new Map,serialNumberBuckets:new Map})}}return n.TYPE_ID="fd55a887385d4dd695eb9465e7e42b09",n.SCHEMA_VERSION=2,n})(),nv=class extends f{build(i,e){return Ga.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(Ga.SCHEMA_VERSION))return e;if(t.isGreaterThan(Ga.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(s=2),e.$schema_version=D.encodedExactly(s),e}},Wa=(()=>{class n extends od{constructor(e,t,s,a,o,u,c){super(),this.businessRef=e,this.eventId=t,this.seasonId=s,this.creationDate=a,this.shortCode=o,this.scope=u,this.serialNumberBuckets=c}static create(e){return new n(e.businessRef,e.eventId,e.seasonId,e.creationDate,e.shortCode,e.scope,e.serialNumberBuckets)}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}get strategy(){return Rs.AssignByPrice}static fromLegacy(e){return n.create({businessRef:e.businessRef,eventId:e.eventId,seasonId:null,creationDate:g.cloneDate(e.creationDate),scope:e.scope,shortCode:e.shortCode,serialNumberBuckets:ee(e.getSerialNumbers(),t=>t)})}static forBusiness(e,t){return n.create({businessRef:e,eventId:null,seasonId:null,creationDate:fe.now(),scope:vt.Business,shortCode:t,serialNumberBuckets:new Map})}static forEvent(e){return e.shortCode==null?null:n.create({businessRef:e.businessRef,eventId:e.uniqueId,seasonId:null,creationDate:fe.now(),scope:vt.Event,shortCode:e.shortCode,serialNumberBuckets:new Map})}getFormattedSeasonId(e){return W.ok(this.seasonId)}getFormattedProductGroupId(e){switch(!0){case e instanceof An:{let t=this.findDiscountedPriceOfEventTicket(e);return W.ok(t.convertToCents.toFixed().padStart(3,"0"))}case e instanceof di:{let t=e.price;return W.ok(t.convertToCents.toFixed().padStart(3,"0"))}case e instanceof ui:{let t=e.value;return W.ok(t.convertToCents.toFixed().padStart(3,"0"))}case e instanceof ci:{let t=e.productPrice;return W.ok(t.convertToCents.toFixed().padStart(3,"0"))}default:return W.error(new _i(e))}}findDiscountedPriceOfEventTicket(e){if(e.ticketType===we.Protocol)return Y.zero(e.template.price.currency);if(e.discount!=null){let t=e.template.price;return xt.calculateDiscountedPriceForSingleItem(t,e.discount)}return e.template.price}getProductSerialNumberBucketId(e){switch(!0){case e instanceof An:{let t=Hw(e.ticketType);if(e.ticketType===we.Protocol)return W.ok(`${t}_${e.template.price.encode()}`);let s=this.findDiscountedPriceOfEventTicket(e);return W.ok(`${t}_${s.encode()}`)}case e instanceof di:return W.ok(`p_${e.price.encode()}`);case e instanceof ci:return W.ok(`v_${e.productPrice.encode()}`);case e instanceof ui:return W.ok(`v_${e.value.encode()}`);default:return W.error(new _i(e))}}static fromMap(e,t){return n.create({businessRef:j.mustDecode(r.getString(t,"businessRef")),eventId:r.getStringOrNull(t,"eventId"),seasonId:r.getStringOrNull(t,"seasonId"),creationDate:e.decodeDate(r.getNumber(t,"creationDate")),scope:y(r.getString(t,"scope"),vt),shortCode:r.getString(t,"shortCode"),serialNumberBuckets:r.getMap(t,"serialNumberBuckets",(s,a)=>({key:K.decodeString(s),value:K.decodeNumber(a)}))})}toMap(e){return{businessRef:this.businessRef.encode(),eventId:this.eventId,seasonId:this.seasonId,creationDate:e.encodeDate(this.creationDate),scope:m(this.scope),shortCode:this.shortCode,serialNumberBuckets:se(this.serialNumberBuckets,(t,s)=>({key:t,value:s}))}}clone(){return n.create({businessRef:this.businessRef.clone(),eventId:this.eventId,seasonId:this.seasonId,creationDate:g.cloneDate(this.creationDate),scope:this.scope,shortCode:this.shortCode,serialNumberBuckets:ee(this.serialNumberBuckets,e=>e)})}isSame(e){return e===this?!0:d(e.businessRef,this.businessRef)&&e.eventId===this.eventId&&e.seasonId===this.seasonId&&e.creationDate===this.creationDate&&e.shortCode===this.shortCode&&e.scope===this.scope&&re(e.serialNumberBuckets,this.serialNumberBuckets,(t,s)=>t===s)}resetForNewSeason(e){return n.create({businessRef:this.businessRef.clone(),eventId:this.eventId,seasonId:e,creationDate:g.cloneDate(this.creationDate),scope:this.scope,shortCode:this.shortCode,serialNumberBuckets:new Map})}}return n.TYPE_ID="62fd2f7dd59c4c6da8953b603b8a0083",n.SCHEMA_VERSION=2,n})(),iv=class extends f{build(i,e){return Wa.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(Wa.SCHEMA_VERSION))return e;if(t.isGreaterThan(Wa.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(s=2),e.$schema_version=D.encodedExactly(s),e}},Xt="ABCDEFGHIJKLMNOPQRSTUVWXYZ",ln=5,Kx="AAAAA",rP=(()=>{class n extends b{constructor(e,t){if(super(),this.creationDate=e,_(t)&&t.length!==ln)throw new X("value",`Start value must have exactly ${ln} characters.`);let s=Array(ln).fill(Xt.length-1);if(_(t))for(let a=0;a<s.length;a++){let o=Xt.indexOf(t[a]);if(o<0)throw new X("value","Start value must contain only characters from the alphabet.");s[a]=o}this._nextValue=t,this._state=s}get $typeId(){return n.TYPE_ID}get isExhausted(){return this._nextValue==null}peek(){return this._nextValue}next(){if(k(this._nextValue))return null;for(let s=ln-1;s>=0&&(this._state[s]++,!(this._state[s]<Xt.length));s--)this._state[s]=0;let e=this._state.map(s=>Xt[s]).join(""),t=this._nextValue;return this._nextValue=e.localeCompare(t)>0?e:null,t}static create(){return new n(fe.now(),Kx)}static fromMap(e,t){return new n(e.decodeDate(r.get(t,"creationDate")),r.get(t,"nextValue"))}toMap(e){return{creationDate:e.encodeDate(this.creationDate),nextValue:this._nextValue}}clone(){return new n(g.cloneDate(this.creationDate),this._nextValue)}isSame(e){return this===e?!0:this.creationDate==e.creationDate&&this._nextValue===e._nextValue}}return n.TYPE_ID="2782b5894a244a93af6ea0867352199c",n})(),sv=class extends f{build(i,e){return rP.fromMap(i,e)}},rv=class extends f{constructor(){super(...arguments),this.legacyBuilder=new ev}build(i,e){let t=this.legacyBuilder.build(i,e);return Ga.fromLegacy(t)}onBeforeDeserialization(i,e){this.legacyBuilder.onBeforeDeserialization(i,e)}onBeforeSerialization(i,e){throw new Error("LegacyTicketBasedSerialNumberPool should not be serialized.")}migrateToCurrentSchemaVersion(i,e){return this.legacyBuilder.migrateToCurrentSchemaVersion(i,e)}},av=class extends f{constructor(){super(...arguments),this.legacyBuilder=new QD}build(i,e){let t=this.legacyBuilder.build(i,e);return Wa.fromLegacy(t)}onBeforeDeserialization(i,e){this.legacyBuilder.onBeforeDeserialization(i,e)}onBeforeSerialization(i,e){throw new Error("LegacyPriceBasedSerialNumberPool should not be serialized.")}migrateToCurrentSchemaVersion(i,e){return this.legacyBuilder.migrateToCurrentSchemaVersion(i,e)}},aP=(()=>{class n extends b{constructor(e,t,s,a){super(),this.uniqueId=e,this.businessRef=t,this.eventId=s,this.creationDate=a}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.uniqueId,e.businessRef,e.eventId,fe.now())}static fromMap(e,t){return new n(r.get(t,"uniqueId"),j.mustDecode(r.get(t,"businessRef")),r.get(t,"eventId"),e.decodeDate(r.get(t,"creationDate")))}toMap(e){return{uniqueId:this.uniqueId,businessRef:this.businessRef.encode(),eventId:this.eventId,creationDate:e.encodeDate(this.creationDate)}}clone(){return new n(this.uniqueId,this.businessRef.clone(),this.eventId,g.cloneDate(this.creationDate))}isSame(e){return this===e?!0:this.uniqueId===e.uniqueId&&this.businessRef.isSame(e.businessRef)&&this.creationDate==e.creationDate&&this.eventId===e.eventId}}
3return n.TYPE_ID="9b6fc4efc4e849d4ae7c3d4dcc84cab8",n})(),ov=class extends f{build(i,e){return aP.fromMap(i,e)}},oP=(()=>{class n extends b{constructor(e,t,s){super(),this.uniqueId=e,this.businessRef=t,this.creationDate=s}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.uniqueId,e.businessRef,fe.now())}static fromMap(e,t){return new n(r.get(t,"uniqueId"),j.mustDecode(r.get(t,"businessRef")),e.decodeDate(r.get(t,"creationDate")))}toMap(e){return{uniqueId:this.uniqueId,businessRef:this.businessRef.encode(),creationDate:e.encodeDate(this.creationDate)}}clone(){return new n(this.uniqueId,this.businessRef.clone(),g.cloneDate(this.creationDate))}isSame(e){return this===e?!0:this.uniqueId===e.uniqueId&&this.businessRef.isSame(e.businessRef)&&this.creationDate===e.creationDate}}return n.TYPE_ID="6b1821707ad148d1aa641249b94439bb",n})(),uv=class extends f{build(i,e){return oP.fromMap(i,e)}},nn=class n{constructor(i,e,t,s,a,o){if(this.minX=i,this.maxX=e,this.minY=t,this.maxY=s,this.minViewportScale=a,this.maxViewportScale=o,this.minX>this.maxX)throw new Error("minX must be less than or equal to maxX");if(this.minY>this.maxY)throw new Error("minY must be less than or equal to maxY");if(this.minViewportScale>this.maxViewportScale)throw new Error("minViewportScale must be less than or equal to maxViewportScale");if(a<=0)throw new Error("minViewportScale must be greater than 0");if(o<=0)throw new Error("maxViewportScale must be greater than 0")}static fromJson(i){return new n(r.getNumber(i,"minX"),r.getNumber(i,"maxX"),r.getNumber(i,"minY"),r.getNumber(i,"maxY"),r.getNumber(i,"minViewportScale"),r.getNumber(i,"maxViewportScale"))}toJson(){return{minX:this.minX,maxX:this.maxX,minY:this.minY,maxY:this.maxY,minViewportScale:this.minViewportScale,maxViewportScale:this.maxViewportScale}}clone(){return new n(this.minX,this.maxX,this.minY,this.maxY,this.minViewportScale,this.maxViewportScale)}isSame(i){return i===this?!0:i.minX===this.minX&&i.maxX===this.maxX&&i.minY===this.minY&&i.maxY===this.maxY&&i.minViewportScale===this.minViewportScale&&i.maxViewportScale===this.maxViewportScale}};nn.DEFAULT_CAMERA_CONSTRAINTS=new nn(-36,36,-36,36,15,60);var Pn=class{static serialize(i){return this.asBytes(i)}static deserialize(i){let e=Bl.fromBytes(i),t=e.unpackByte();switch(t){case 1:return this.fromBytes_v1(e);case 2:return this.fromBytes_v2(e)}throw new ie(`Seating layout cannot be deserialized because format ${t} is unknown`)}static asBytes(i){let e=new Ul,t=l=>{e.packInt(l.uniqueId),e.packBool(l.enabled),e.packDouble(l.position.x),e.packDouble(l.position.y),e.packDouble(l.rotation),e.packDouble(l.textSize),e.packInt(l.color),e.packLength(l.texts.size);for(let[h,p]of l.texts.entries())e.packString(m(h)),e.packString(p)},s=l=>{e.packInt(l.uniqueId),e.packBool(l.enabled),e.packDouble(l.position.x),e.packDouble(l.position.y),e.packDouble(l.rotation),e.packLength(l.tickets.length);for(let h=0;h<l.tickets.length;h++)e.packString(l.tickets[h])},a=l=>{e.packInt(l.uniqueId),e.packBool(l.enabled),e.packDouble(l.position.x),e.packDouble(l.position.y),e.packDouble(l.rotation),e.packInt(xn(l.namingStrategy)),e.packInt(l.firstLabelingOrdinal),e.packBool(l.label!=null),l.label!=null&&t(l.label),e.packLength(l.seats.length);for(let h=0;h<l.seats.length;h++)s(l.seats[h])},o=l=>{e.packInt(l.uniqueId),e.packBool(l.enabled),e.packDouble(l.position.x),e.packDouble(l.position.y),e.packDouble(l.rotation),e.packBool(l.label!=null),l.label!=null&&t(l.label),e.packLength(l.children.length);for(let h=0;h<l.children.length;h++)c(l.children[h])},u=l=>{e.packInt(l.uniqueId),e.packBool(l.enabled),e.packDouble(l.position.x),e.packDouble(l.position.y),e.packDouble(l.rotation),e.packDouble(l.width),e.packDouble(l.height),e.packLength(l.tickets.length);for(let h=0;h<l.tickets.length;h++)e.packString(l.tickets[h])},c=l=>{let h=l.$typeId;switch(e.packByte(h),h){case wt.TYPE_ID:s(l);break;case Dt.TYPE_ID:a(l);break;case Rt.TYPE_ID:t(l);break;case Mt.TYPE_ID:o(l);break;case Aa.TYPE_ID:u(l);break;default:throw new ie(`Cannot serialize seating layout. Unsupported seating element of type: ${h}`)}};e.packByte(2),e.packLength(i.length);for(let l=0;l<i.length;l++)c(i[l]);return e.takeBytes()}static fromBytes_v2(i){let e=h=>{let p=i.unpackInt(),I=i.unpackBool(),v=i.unpackDouble(),E=i.unpackDouble(),w=i.unpackDouble(),S=i.unpackDouble(),R=i.unpackIntOrNull(),x=i.unpackLength(),N=new Map;for(let O=0;O<x;O++)N.set(y(i.unpackString(),$),i.unpackString());return new Rt(p,I,N,S,R,new It(v,E),w,h!=null?new WeakRef(h):null)},t=h=>{let p=i.unpackInt(),I=i.unpackBool(),v=i.unpackDouble(),E=i.unpackDouble(),w=i.unpackDouble(),S=i.unpackLength(),R=[];for(let x=0;x<S;x++)R.push(i.unpackString());return wt.fromBinaryData(p,I,new It(v,E),w,R,h!=null?new WeakRef(h):null)},s=h=>{let p=i.unpackInt(),I=i.unpackBool(),v=i.unpackDouble(),E=i.unpackDouble(),w=i.unpackDouble(),S=_n(i.unpackInt(),Kt),R=i.unpackInt(),x=new Dt(p,I,new It(v,E),w,null,S,[],R,h!=null?new WeakRef(h):null);i.unpackBool()&&(x.label=e(x));let O=i.unpackLength();for(let A=0;A<O;A++)x.seats.push(t(x));return x},a=h=>{let p=i.unpackInt(),I=i.unpackBool(),v=i.unpackDouble(),E=i.unpackDouble(),w=i.unpackDouble(),S=new Mt(p,I,new It(v,E),w,null,[],h!=null?new WeakRef(h):null);i.unpackBool()&&(S.label=e(S));let x=i.unpackLength();for(let N=0;N<x;N++)S.children.push(u(S));return S},o=h=>{let p=i.unpackInt(),I=i.unpackBool(),v=i.unpackDouble(),E=i.unpackDouble(),w=i.unpackDouble(),S=i.unpackDouble(),R=i.unpackDouble(),x=i.unpackLength(),N=[];for(let O=0;O<x;O++)N.push(i.unpackString());return new Aa(p,I,new It(v,E),w,S,R,N,h!=null?new WeakRef(h):null)},u=h=>{let p=i.unpackByte();switch(p){case wt.TYPE_ID:return t(h);case Dt.TYPE_ID:return s(h);case Rt.TYPE_ID:return e(h);case Mt.TYPE_ID:return a(h);case Aa.TYPE_ID:return o(h);default:throw new ie(`Cannot deserialize seating layout. Unsupported seating element of type: ${p}`)}},c=i.unpackLength(),l=[];for(let h=0;h<c;h++)l.push(u(null));return l}static fromBytes_v1(i){let e=l=>{let h=i.unpackInt(),p=i.unpackBool(),I=i.unpackDouble(),v=i.unpackDouble(),E=i.unpackDouble(),w=i.unpackDouble(),S=i.unpackIntOrNull(),R=i.unpackLength(),x=new Map;for(let N=0;N<R;N++)x.set(y(i.unpackString(),$),i.unpackString());return new Rt(h,p,x,w,S,new It(I,v),E,l!=null?new WeakRef(l):null)},t=l=>{let h=i.unpackInt(),p=i.unpackBool(),I=i.unpackDouble(),v=i.unpackDouble(),E=i.unpackDouble(),w=i.unpackStringOrNull();return wt.fromBinaryData(h,p,new It(I,v),E,w!=null?[w]:[],l!=null?new WeakRef(l):null)},s=l=>{let h=i.unpackInt(),p=i.unpackBool(),I=i.unpackDouble(),v=i.unpackDouble(),E=i.unpackDouble(),w=_n(i.unpackInt(),Kt),S=i.unpackInt(),R=new Dt(h,p,new It(I,v),E,null,w,[],S,l!=null?new WeakRef(l):null);i.unpackBool()&&(R.label=e(R));let N=i.unpackLength();for(let O=0;O<N;O++)R.seats.push(t(R));return R},a=l=>{let h=i.unpackInt(),p=i.unpackBool(),I=i.unpackDouble(),v=i.unpackDouble(),E=i.unpackDouble(),w=new Mt(h,p,new It(I,v),E,null,[],l!=null?new WeakRef(l):null);i.unpackBool()&&(w.label=e(w));let R=i.unpackLength();for(let x=0;x<R;x++)w.children.push(o(w));return w},o=l=>{let h=i.unpackByte();switch(h){case wt.TYPE_ID:return t(l);case Dt.TYPE_ID:return s(l);case Rt.TYPE_ID:return e(l);case Mt.TYPE_ID:return a(l);default:throw new ie(`Cannot deserialize seating layout. Unsupported seating element of type: ${h}`)}},u=i.unpackLength(),c=[];for(let l=0;l<u;l++)c.push(o(null));return c}},uP=(()=>{class n extends b{constructor(e,t,s,a,o,u,c,l,h){super(),this.uniqueId=e,this.businessRef=t,this.eventId=s,this.roomId=a,this.buildingId=o,this.name=u,this.backgroundImage=c,this.children=l,this.cameraConstraints=h}get $typeId(){return n.TYPE_ID}static fromRoom(e,t,s){return new n(s??Ft(),e.businessRef.clone(),e.uniqueId,t.uniqueId,t.buildingId,t.name,t.backgroundImage,t.children.map(a=>a.clone(null)),t.cameraConstraints.clone())}static fromLegacy(e,t){return new n(Ft(),e.businessRef.clone(),e.uniqueId,t.uniqueId,t.uniqueId,t.name,t.backgroundImage,t.children.map(s=>s.clone(null)),t.cameraConstraints.clone())}static fromMap(e,t){var s;let a=(s=e.storage.get("format"))!==null&&s!==void 0?s:"binary";switch(a){case"json":return this.fromJson(e,t);case"binary":return this.fromBinary(e,t);case"base64":return this.fromBase64(e,t)}
3throw Error("Unknown seating layout serialization format: "+a)}toMap(e){var t;let s=(t=e.storage.get("format"))!==null&&t!==void 0?t:"binary";switch(s){case"json":return this.toJson(e);case"binary":return this.toBinary(e);case"base64":return this.toBase64(e)}throw Error("Unknown seating layout serialization format: "+s)}clone(){return new n(this.uniqueId,this.businessRef.clone(),this.eventId,this.roomId,this.buildingId,this.name,this.backgroundImage,this.children.map(e=>e.clone(null)),this.cameraConstraints.clone())}isSame(e){return e===this?!0:this.uniqueId===e.uniqueId&&d(this.businessRef,e.businessRef)&&this.eventId===e.eventId&&this.roomId===e.roomId&&this.buildingId===e.buildingId&&this.name===e.name&&this.backgroundImage===e.backgroundImage&&P(this.children,e.children,(t,s)=>d(t,s))&&d(this.cameraConstraints,e.cameraConstraints)}static fromJson(e,t){let s=a=>{let o=r.getNumber(a,"$typeId");switch(o){case Mt.TYPE_ID:return Mt.fromJson(a);case Dt.TYPE_ID:return Dt.fromJson(a);case wt.TYPE_ID:return wt.fromJson(a);case Rt.TYPE_ID:return Rt.fromJson(a)}throw Error(`Unknown SeatingElement of type: ${o}`)};return new n(r.get(t,"uniqueId"),j.mustDecode(r.get(t,"businessRef")),r.get(t,"eventId"),r.get(t,"roomId"),r.get(t,"buildingId"),r.get(t,"name"),r.getOrNull(t,"backgroundImage"),r.get(t,"children").map(a=>s(a)),nn.fromJson(r.get(t,"cameraConstraints")))}toJson(e){return{uniqueId:this.uniqueId,businessRef:this.businessRef.encode(),eventId:this.eventId,roomId:this.roomId,buildingId:this.buildingId,name:this.name,backgroundImage:this.backgroundImage,children:this.children.map(t=>t.toJson()),cameraConstraints:this.cameraConstraints.toJson()}}static fromBinary(e,t){return new n(r.get(t,"uniqueId"),j.mustDecode(r.get(t,"businessRef")),r.get(t,"eventId"),r.get(t,"roomId"),r.get(t,"buildingId"),r.get(t,"name"),r.getOrNull(t,"backgroundImage"),Pn.deserialize(e.fromBinaryBlob(r.getRaw(t,"children"))),nn.fromJson(r.get(t,"cameraConstraints")))}toBinary(e){return{uniqueId:this.uniqueId,businessRef:this.businessRef.encode(),eventId:this.eventId,roomId:this.roomId,buildingId:this.buildingId,name:this.name,backgroundImage:this.backgroundImage,children:e.toBinaryBlob(Pn.serialize(this.children)),cameraConstraints:this.cameraConstraints.toJson()}}static fromBase64(e,t){return new n(r.get(t,"uniqueId"),j.mustDecode(r.get(t,"businessRef")),r.get(t,"eventId"),r.get(t,"roomId"),r.get(t,"buildingId"),r.get(t,"name"),r.getOrNull(t,"backgroundImage"),Pn.deserialize(e.fromBase64(r.get(t,"children"))),nn.fromJson(r.get(t,"cameraConstraints")))}toBase64(e){return{uniqueId:this.uniqueId,businessRef:this.businessRef.encode(),eventId:this.eventId,roomId:this.roomId,buildingId:this.buildingId,name:this.name,backgroundImage:this.backgroundImage,children:e.toBase64(Pn.serialize(this.children)),cameraConstraints:this.cameraConstraints.toJson()}}findSeatById(e){for(let t of this.children){let s=this.findSeatByIdRecursive(t,e);if(s!=null)return s}return null}findSeatByIdRecursive(e,t){if(e instanceof wt&&e.uniqueId===t)return e;if(e instanceof Dt){for(let s of e.seats)if(s.uniqueId===t)return s}else if(e instanceof Mt)for(let s of e.children){let a=this.findSeatByIdRecursive(s,t);if(a!=null)return a}return null}}return n.TYPE_ID="716d9172fc4a49b6af0f62281094bf60",n})(),cv=class extends f{build(i,e){return uP.fromMap(i,e)}},PS=(()=>{class n extends b{constructor(e,t,s,a){super(),this.uniqueId=e,this.buildingId=t,this.name=s,this.backgroundImage=a}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.get(t,"buildingId"),r.get(t,"name"),r.getOrNull(t,"backgroundImage"))}toMap(e){return{uniqueId:this.uniqueId,buildingId:this.buildingId,name:this.name,backgroundImage:this.backgroundImage}}clone(){return new n(this.uniqueId,this.buildingId,this.name,this.backgroundImage)}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.buildingId===this.buildingId&&e.name===this.name&&e.backgroundImage===this.backgroundImage}}return n.TYPE_ID="c4057061a22448baa9df1befdbfeb09f",n})(),lv=class extends f{build(i,e){return PS.fromMap(i,e)}},cP=(()=>{class n extends PS{constructor(e,t,s,a,o,u){super(e,t,s,a),this.children=o,this.cameraConstraints=u}get $typeId(){return n.TYPE_ID}static fromMap(e,t){var s;let a=(s=e.storage.get("format"))!==null&&s!==void 0?s:"binary";switch(a){case"json":return this.fromJson(e,t);case"binary":return this.fromBinary(e,t);case"base64":return this.fromBase64(e,t)}throw Error("Unknown room serialization format: "+a)}toMap(e){var t;let s=(t=e.storage.get("format"))!==null&&t!==void 0?t:"binary";switch(s){case"json":return this.toJson(e);case"binary":return this.toBinary(e);case"base64":return this.toBase64(e)}throw Error("Unknown room serialization format: "+s)}clone(){return new n(this.uniqueId,this.buildingId,this.name,this.backgroundImage,this.children.map(e=>e.clone(null)),this.cameraConstraints.clone())}isSame(e){return e===this?!0:this.uniqueId===e.uniqueId&&this.buildingId===e.buildingId&&this.name===e.name&&this.backgroundImage===e.backgroundImage&&P(this.children,e.children,(t,s)=>d(t,s))&&d(this.cameraConstraints,e.cameraConstraints)}static fromJson(e,t){let s=a=>{let o=r.getNumber(a,"$typeId");switch(o){case Mt.TYPE_ID:return Mt.fromJson(a);case Dt.TYPE_ID:return Dt.fromJson(a);case wt.TYPE_ID:return wt.fromJson(a);case Rt.TYPE_ID:return Rt.fromJson(a)}throw Error(`Unknown SeatingElement of type: ${o}`)};return new n(r.get(t,"uniqueId"),r.get(t,"buildingId"),r.get(t,"name"),r.getOrNull(t,"backgroundImage"),r.get(t,"children").map(a=>s(a)),nn.fromJson(r.get(t,"cameraConstraints")))}toJson(e){return{uniqueId:this.uniqueId,buildingId:this.buildingId,name:this.name,backgroundImage:this.backgroundImage,children:this.children.map(t=>t.toJson()),cameraConstraints:this.cameraConstraints.toJson()}}static fromBinary(e,t){return new n(r.get(t,"uniqueId"),r.get(t,"buildingId"),r.get(t,"name"),r.getOrNull(t,"backgroundImage"),Pn.deserialize(e.fromBinaryBlob(r.getRaw(t,"children"))),nn.fromJson(r.get(t,"cameraConstraints")))}toBinary(e){return{uniqueId:this.uniqueId,buildingId:this.buildingId,name:this.name,backgroundImage:this.backgroundImage,children:e.toBinaryBlob(Pn.serialize(this.children)),cameraConstraints:this.cameraConstraints.toJson()}}static fromBase64(e,t){return new n(r.get(t,"uniqueId"),r.get(t,"buildingId"),r.get(t,"name"),r.getOrNull(t,"backgroundImage"),Pn.deserialize(e.fromBase64(r.get(t,"children"))),nn.fromJson(r.get(t,"cameraConstraints")))}toBase64(e){return{uniqueId:this.uniqueId,buildingId:this.buildingId,name:this.name,backgroundImage:this.backgroundImage,children:e.toBase64(Pn.serialize(this.children)),cameraConstraints:this.cameraConstraints.toJson()}}static findSeatById(e,t){for(let s of e.children){let a=this.findSeatByIdRecursively(s,t);if(a!=null)return a}return null}static findSeatByIdRecursively(e,t){if(e.$typeId==Mt.TYPE_ID){let s=e;for(let a of s.children){let o=this.findSeatByIdRecursively(a,t);
3if(o!=null)return o}}else if(e.$typeId==Dt.TYPE_ID){let s=e;for(let a of s.seats)if(a.uniqueId==t)return a}else if(e.$typeId==wt.TYPE_ID){let s=e;if(s.uniqueId==t)return s}return null}}return n.TYPE_ID="e166745086c84d0dbc9944a82a8e7ab9",n})(),dv=class extends f{build(i,e){return cP.fromMap(i,e)}},lP=(()=>{class n extends b{constructor(e,t,s){super(),this.uniqueId=e,this.name=t,this.location=s}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.get(t,"name"),e.fromData(r.get(t,"location")))}toMap(e){return{uniqueId:this.uniqueId,name:this.name,location:e.toData(this.location)}}clone(){return new n(this.uniqueId,this.name,this.location.clone())}isSame(e){return e===this?!0:this.uniqueId===e.uniqueId&&this.name===e.name&&d(this.location,e.location)}}return n.TYPE_ID="9ef3319b515145e9801442b9fe70ec24",n})(),hv=class extends f{build(i,e){return lP.fromMap(i,e)}},ju=(()=>{class n extends b{constructor(e,t,s,a,o,u){super(),this.uniqueId=e,this.name=t,this.backgroundImage=s,this.children=a,this.serialIdGenerator=o,this.cameraConstraints=u}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static fromMap(e,t){let s=a=>{let o=r.getNumber(a,"$typeId");switch(o){case Mt.TYPE_ID:return Mt.fromJson(a);case Dt.TYPE_ID:return Dt.fromJson(a);case wt.TYPE_ID:return wt.fromJson(a);case Rt.TYPE_ID:return Rt.fromJson(a)}throw Error(`Unknown SeatingElement of type: ${o}`)};return new n(r.get(t,"uniqueId"),r.get(t,"name"),r.getOrNull(t,"backgroundImage"),r.get(t,"children").map(a=>s(a)),new gI(r.get(t,"nextSerial")),nn.fromJson(r.get(t,"cameraConstraints")))}toMap(e){return{uniqueId:this.uniqueId,name:this.name,backgroundImage:this.backgroundImage,children:this.children.map(t=>t.toJson()),nextSerial:this.serialIdGenerator.nextValue,cameraConstraints:this.cameraConstraints.toJson()}}clone(){return new n(this.uniqueId,this.name,this.backgroundImage,this.children.map(e=>e.clone(null)),this.serialIdGenerator.clone(),this.cameraConstraints.clone())}isSame(e){return e===this?!0:this.uniqueId===e.uniqueId&&this.name===e.name&&this.backgroundImage===e.backgroundImage&&P(this.children,e.children,(t,s)=>d(t,s))&&d(this.serialIdGenerator,e.serialIdGenerator)&&d(this.cameraConstraints,e.cameraConstraints)}}return n.TYPE_ID="9926bce12e62427abf828a720f9c22b1",n.SCHEMA_VERSION=3,n})(),fv=class extends f{build(i,e){return ju.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(ju.SCHEMA_VERSION))return e;if(t.isGreaterThan(ju.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(e.cameraConstraints=nn.DEFAULT_CAMERA_CONSTRAINTS.toJson(),s=2),s<3&&(e.backgroundImage=null,s=3),e.$schema_version=D.encodedExactly(s),e}},pv=class n{constructor(i,e){this.uniqueId=i,this.name=e}static fromBuilding(i){return new n(i.uniqueId,i.name)}static fromMap(i,e){return new n(r.get(e,"uniqueId"),r.get(e,"name"))}toMap(i){return{uniqueId:this.uniqueId,name:this.name}}clone(){return new n(this.uniqueId,this.name)}isSame(i){return i===this?!0:this.uniqueId===i.uniqueId&&this.name===i.name}},gv=class n{constructor(i,e,t){this.uniqueId=i,this.buildingId=e,this.name=t}static fromRoom(i){return new n(i.uniqueId,i.buildingId,i.name)}static fromMap(i,e){return new n(r.get(e,"uniqueId"),r.get(e,"buildingId"),r.get(e,"name"))}toMap(i){return{uniqueId:this.uniqueId,buildingId:this.buildingId,name:this.name}}clone(){return new n(this.uniqueId,this.buildingId,this.name)}isSame(i){return i===this?!0:this.uniqueId===i.uniqueId&&this.buildingId===i.buildingId&&this.name===i.name}},dP=(()=>{class n extends b{constructor(e,t){super(),this.buildings=e,this.rooms=t}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.getList(t,"buildings",s=>pv.fromMap(e,s)),r.getMap(t,"rooms",(s,a)=>({key:s,value:a.map(u=>gv.fromMap(e,u))})))}toMap(e){return{buildings:this.buildings.map(t=>t.toMap(e)),rooms:se(this.rooms,(t,s)=>({key:t,value:s.map(a=>a.toMap(e))}))}}clone(){return new n(ue(this.buildings),ee(this.rooms,e=>ue(e)))}isSame(e){return e===this?!0:P(this.buildings,e.buildings,d)&&re(this.rooms,e.rooms,(t,s)=>P(t,s,d))}}return n.TYPE_ID="7aed3fd30bd54a178a1f1ee3e7114f4b",n})(),mv=class extends f{build(i,e){return dP.fromMap(i,e)}},cd=class n{constructor(i,e,t,s){this.a=i,this.b=e,this.c=t,this.d=s}static rotation(i){let e=Math.cos(i),t=Math.sin(i);return new n(e,t,-t,e)}matMul(i){return new n(this.a*i.a+this.b*i.c,this.a*i.b+this.b*i.d,this.c*i.a+this.d*i.c,this.c*i.b+this.d*i.d)}vecMul(i){return new It(this.a*i.x+this.b*i.y,this.c*i.x+this.d*i.y)}};cd.IDENTITY=new cd(1,0,0,1);var ld=class extends b{},Ju=(()=>{class n extends ld{constructor(e,t,s){super(),this.fee=e,this.maxFee=t,this.overrideVat=s}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static fromMap(e,t){return new n(e.fromData(r.get(t,"fee")),Y.decodeOrNull(r.getOrNull(t,"maxFee")),Re(r.getStringOrNull(t,"overrideVat"),te))}toMap(e){var t,s;return{fee:e.toData(this.fee),maxFee:(s=(t=this.maxFee)===null||t===void 0?void 0:t.encode())!==null&&s!==void 0?s:null,overrideVat:Se(this.overrideVat)}}clone(){var e,t;return new n(this.fee.clone(),(t=(e=this.maxFee)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null,this.overrideVat)}isSame(e){return this===e?!0:d(e.fee,this.fee)&&d(e.maxFee,this.maxFee)&&e.overrideVat==this.overrideVat}getUnitFee(e){return this.fee.clone()}calculateUnitFee(e){let t=this.fee.calculateUnitFee(e);return this.maxFee!=null&&this.maxFee.value>0&&t.compareTo(this.maxFee)>0&&(t=this.maxFee.clone()),t}}
3return n.TYPE_ID="5b39e4d6fae643dda63068283a31ab27",n.SCHEMA_VERSION=3,n})(),Iv=class extends f{build(i,e){return Ju.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(Ju.SCHEMA_VERSION))return e;if(t.isGreaterThan(Ju.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(s=2),s<3&&(s=3),e.$schema_version=D.encodedExactly(s),e}},Ku=(()=>{class n extends ld{constructor(e,t,s){super(),this.feeRanges=e,this.maxFee=t,this.overrideVat=s,e.sort((a,o)=>a.priceRange.from.value-o.priceRange.from.value)}get $removable(){return!1}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static fromMap(e,t){return new n(r.getList(t,"feeRanges",s=>e.fromData(s)),Y.decodeOrNull(r.getOrNull(t,"maxFee")),Re(r.getStringOrNull(t,"overrideVat"),te))}toMap(e){var t,s;return{feeRanges:this.feeRanges.map(a=>e.toData(a)),maxFee:(s=(t=this.maxFee)===null||t===void 0?void 0:t.encode())!==null&&s!==void 0?s:null,overrideVat:Se(this.overrideVat)}}clone(){var e,t;return new n(ue(this.feeRanges),(t=(e=this.maxFee)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null,this.overrideVat)}isSame(e){return e===this?!0:P(e.feeRanges,this.feeRanges,(t,s)=>d(t,s))&&d(e.maxFee,this.maxFee)&&e.overrideVat==this.overrideVat}getUnitFee(e){for(let t=this.feeRanges.length-1;t>=0;t--)if(e.value>=this.feeRanges[t].priceRange.from.value)return this.feeRanges[t].fee.clone();return null}calculateUnitFee(e){let t=Y.zero(e.currency);for(let s=this.feeRanges.length-1;s>=0;s--)if(e.value>=this.feeRanges[s].priceRange.from.value){t=this.feeRanges[s].fee.calculateUnitFee(e);break}return this.maxFee!=null&&this.maxFee.value>0&&t.compareTo(this.maxFee)>0&&(t=this.maxFee.clone()),t}}return n.TYPE_ID="afbbeba3d3e74552b14e18d28d9120ca",n.SCHEMA_VERSION=3,n})(),Dv=class extends f{build(i,e){return Ku.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(Ku.SCHEMA_VERSION))return e;if(t.isGreaterThan(Ku.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(s=2),s<3&&(s=3),e.$schema_version=D.encodedExactly(s),e}},hP=(function(n){return n.Live="LIVE",n.Canceled="CANCELED",n.Sold="SOLD",n})(hP||{}),fP=(()=>{class n extends b{constructor(e,t,s,a,o,u,c,l){super(),this.uniqueId=e,this.creatorId=t,this.creationDate=s,this.businessRef=a,this.status=o,this.eventId=u,this.customer=c,this.items=l,this.userId=c.userId,this.customerId=c.uniqueId}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.get(t,"creatorId"),e.decodeDate(r.get(t,"creationDate")),j.mustDecode(r.get(t,"businessRef")),y(r.get(t,"status"),hP),r.get(t,"eventId"),e.fromData(r.get(t,"customer")),r.getList(t,"items",s=>e.fromData(s)))}toMap(e){return{uniqueId:this.uniqueId,creatorId:this.creatorId,creationDate:e.encodeDate(this.creationDate),businessRef:this.businessRef.encode(),status:m(this.status),eventId:this.eventId,userId:this.userId,customerId:this.customerId,customer:e.toData(this.customer),items:this.items.map(t=>e.toData(t))}}clone(){return new n(this.uniqueId,this.creatorId,g.cloneDate(this.creationDate),this.businessRef.clone(),this.status,this.eventId,this.customer.clone(),this.items.map(e=>e.clone()))}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.creatorId===this.creatorId&&e.creationDate===this.creationDate&&d(e.businessRef,this.businessRef)&&e.status===this.status&&e.eventId===this.eventId&&e.userId===this.userId&&e.customerId===this.customerId&&d(e.customer,this.customer)&&P(e.items,this.items)}copyWithStatus(e){return new n(this.uniqueId,this.creatorId,g.cloneDate(this.creationDate),this.businessRef.clone(),e,this.eventId,this.customer.clone(),this.items.map(t=>t.clone()))}}return n.TYPE_ID="215e1b185c0a47d2a467de6b3eee8d2a",n})(),vv=class extends f{build(i,e){return fP.fromMap(i,e)}},Zu=(()=>{class n extends b{constructor(e,t,s,a,o){super(),this.uniqueId=e,this.templateId=t,this.templateName=s,this.quantity=a,this.siblingTicketTemplateIds=o}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.get(t,"templateId"),e.fromData(r.getRaw(t,"templateName")),r.get(t,"quantity"),r.getList(t,"siblingTicketTemplateIds",s=>s))}toMap(e){return{uniqueId:this.uniqueId,templateId:this.templateId,templateName:e.toData(this.templateName),quantity:this.quantity,siblingTicketTemplateIds:Te(this.siblingTicketTemplateIds)}}clone(){return new n(this.uniqueId,this.templateId,this.templateName.clone(),this.quantity,Te(this.siblingTicketTemplateIds))}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.templateId===this.templateId&&d(e.templateName,this.templateName)&&P(e.siblingTicketTemplateIds,this.siblingTicketTemplateIds)&&e.quantity===this.quantity}}return n.TYPE_ID="25b3bffe70f34e0697326b14c3c639da",n.SCHEMA_VERSION=2,n})(),yv=class extends f{build(i,e){return Zu.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(Zu.SCHEMA_VERSION))return e;if(t.isGreaterThan(Zu.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(e.siblingTicketTemplateIds=[],s=2),e.$schema_version=D.encodedExactly(s),e}};function Zx(n,i,e){switch(i){case Xn.OneDay:return g.ofRegion(e).getFutureDayAtFirstHour(1,n).subtract(1,"second");case Xn.OneWeek:return g.ofRegion(e).getFutureDayAtFirstHour(7,n).subtract(1,"second");case Xn.OneMonth:return g.ofRegion(e).getFutureMonthOnSameDayAtFirstHour(1,{today:n}).subtract(1,"second");case Xn.OneYear:return g.ofRegion(e).getFutureYearOnSameDayAtFirstHour(1,{today:n}).subtract(1,"second");case Xn.ThreeMonths:return g.ofRegion(e).getFutureMonthOnSameDayAtFirstHour(3,{today:n}).subtract(1,"second");
3case Xn.TwoMonths:return g.ofRegion(e).getFutureMonthOnSameDayAtFirstHour(2,{today:n}).subtract(1,"second");case Xn.SixMonths:return g.ofRegion(e).getFutureMonthOnSameDayAtFirstHour(6,{today:n}).subtract(1,"second")}}var Xn=(function(n){return n.OneDay="OneDay",n.OneWeek="OneWeek",n.OneMonth="OneMonth",n.OneYear="OneYear",n.ThreeMonths="ThreeMonths",n.TwoMonths="TwoMonths",n.SixMonths="SixMonths",n})(Xn||{}),Xu=(()=>{class n extends Ts{constructor(e,t,s,a,o,u,c){super(),this.startDate=e,this.renewalDate=t,this.scanValidity=s,this.maxUses=a,this.timezone=o,this.renewalPeriod=u,this.type=jr.GymAccess,this._uses=c,this.expirationDate=Zx(t,u,o)}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}get uses(){return this._uses}get isUsed(){return this._uses!=null&&this.maxUses!=null&&this._uses>=this.maxUses}static fromMap(e,t){return new n(e.decodeDate(r.get(t,"startDate")),e.decodeDate(r.get(t,"renewalDate")),e.decodeDuration(r.get(t,"scanValidity")),r.getOrNull(t,"maxUses"),y(r.get(t,"timezone"),Ee),y(r.get(t,"renewalPeriod"),Xn),r.getOrNull(t,"uses"))}toMap(e){return{type:m(this.type),startDate:e.encodeDate(this.startDate),renewalDate:e.encodeDate(this.renewalDate),scanValidity:e.encodeDuration(this.scanValidity),expirationDate:e.encodeDate(this.expirationDate),maxUses:this.maxUses,uses:this._uses,renewalPeriod:m(this.renewalPeriod),timezone:m(this.timezone)}}clone(){return new n(g.cloneDate(this.startDate),g.cloneDate(this.renewalDate),g.cloneDuration(this.scanValidity),this.maxUses,this.timezone,this.renewalPeriod,this._uses)}isSame(e){return e===this?!0:e.renewalPeriod==this.renewalPeriod&&e.timezone==this.timezone&&e.startDate==this.startDate&&e.renewalDate==this.renewalDate&&e.scanValidity==this.scanValidity&&e.maxUses==this.maxUses&&e._uses==this._uses}copyWith(e){var t,s,a,o,u,c,l;return new n((t=e.startDate)!==null&&t!==void 0?t:g.cloneDate(this.startDate),(s=e.renewalDate)!==null&&s!==void 0?s:g.cloneDate(this.renewalDate),(a=e.scanValidity)!==null&&a!==void 0?a:g.cloneDuration(this.scanValidity),(o=e.maxUses)!==null&&o!==void 0?o:this.maxUses,(u=e.timezone)!==null&&u!==void 0?u:this.timezone,(c=e.renewalPeriod)!==null&&c!==void 0?c:this.renewalPeriod,(l=e.uses)!==null&&l!==void 0?l:this._uses)}applyTemplateChanges(e){return this.clone()}updateUsage(){var e;this.maxUses!=null&&(this._uses=Math.min(this.maxUses,((e=this._uses)!==null&&e!==void 0?e:0)+1))}isEligibleForRenewal(e){let t=g.ofRegion(this.timezone).getPastDayAtFirstHour(2,this.expirationDate);return e.isAfter(t)}renew(e){return new n(g.cloneDate(this.startDate),g.cloneDate(e),g.cloneDuration(this.scanValidity),this.maxUses,this.timezone,this.renewalPeriod,null)}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="c243b9926ec447b2855165e7d462f3fc",n.SCHEMA_VERSION=2,n})(),bv=class extends f{build(i,e){return Xu.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(Xu.SCHEMA_VERSION))return e;if(t.isGreaterThan(Xu.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(e.scanValidity=g.encodeDuration(oe.default.duration(5,"hours")),s=2),e.$schema_version=D.encodedExactly(s),e}},pP=(()=>{class n extends Ts{constructor(e){super(),this.expirationDate=e,this.type=jr.LimitedTime}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(g.decodeDate(r.get(t,"expirationDate")))}toMap(e){return{type:m(this.type),expirationDate:g.encodeDate(this.expirationDate)}}clone(){return new n(g.cloneDate(this.expirationDate))}isSame(e){return e===this?!0:e.expirationDate==this.expirationDate}applyTemplateChanges(e){return new n(g.cloneDate(e.expirationDate))}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="f508ec32762e4bca95322c09f838c8c3",n})(),Ev=class extends f{build(i,e){return pP.fromMap(i,e)}},gP=(()=>{class n extends Ts{constructor(e,t){super(),this.maxUses=e,this.type=jr.LimitedUses,this._uses=t}get uses(){return this._uses}get isUsed(){return _(this._uses)&&this._uses>=this.maxUses}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.get(t,"maxUses"),r.getOrNull(t,"uses"))}toMap(e){return{type:m(this.type),maxUses:this.maxUses,uses:this.uses}}clone(){return new n(this.maxUses,this.uses)}isSame(e){return e===this?!0:e.maxUses===this.maxUses&&e.uses===this.uses}applyTemplateChanges(e){return new n(e.maxUses,this.uses)}updateUsage(){var e;this._uses=Math.min(this.maxUses,((e=this._uses)!==null&&e!==void 0?e:0)+1)}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="789ad1a3a9de410697745d7955898dcc",n})(),wv=class extends f{build(i,e){return gP.fromMap(i,e)}},Cn=class n{constructor(i,e,t,s,a,o,u,c,l,h,p,I,v){this.uniqueId=i,this.webRoute=e,this.country=t,this.localizedName=s,this.startDate=a,this.coverImage=o,this.pricingInfo=u,this.locationInfo=c,this.classificationInfo=l,this.eventDateFormat=h,this.passEventOverrideLink=p,this.thirdPartyEventUrl=I,this.freeEventUrl=v}
3static create(i){return new n(i.uniqueId,i.webRoute,i.country,i.localizedName,i.startDate,i.coverImage,i.pricingInfo,i.locationInfo,i.classificationInfo,i.eventDateFormat,i.passEventOverrideLink,i.thirdPartyEventUrl,i.freeEventUrl)}static fromMap(i,e){return new n(r.getString(e,"uniqueId"),r.getString(e,"webRoute"),y(r.getString(e,"country"),Ie),i.fromData(r.get(e,"localizedName")),i.decodeDate(r.getNumber(e,"startDate")),r.getString(e,"coverImage"),dd.fromMapOrNull(i,r.getOrNull(e,"pricingInfo")),fs.fromMap(i,r.get(e,"locationInfo")),hd.fromMap(i,r.get(e,"classificationInfo")),y(r.getString(e,"eventDateFormat"),ni),r.getStringOrNull(e,"passEventOverrideLink"),r.getStringOrNull(e,"thirdPartyEventUrl"),r.getStringOrNull(e,"freeEventUrl"))}toMap(i){var e,t;return{uniqueId:this.uniqueId,webRoute:this.webRoute,country:m(this.country),localizedName:i.toData(this.localizedName),startDate:i.encodeDate(this.startDate),coverImage:this.coverImage,pricingInfo:(t=(e=this.pricingInfo)===null||e===void 0?void 0:e.toMap(i))!==null&&t!==void 0?t:null,locationInfo:this.locationInfo.toMap(i),classificationInfo:this.classificationInfo.toMap(i),eventDateFormat:m(this.eventDateFormat),passEventOverrideLink:this.passEventOverrideLink,thirdPartyEventUrl:this.thirdPartyEventUrl,freeEventUrl:this.freeEventUrl}}clone(){return new n(this.uniqueId,this.webRoute,this.country,F(this.localizedName),g.cloneDate(this.startDate),this.coverImage,Z(this.pricingInfo),F(this.locationInfo),F(this.classificationInfo),this.eventDateFormat,this.passEventOverrideLink,this.thirdPartyEventUrl,this.freeEventUrl)}isSame(i){return i===this?!0:i.uniqueId===this.uniqueId&&i.webRoute===this.webRoute&&i.country===this.country&&d(i.localizedName,this.localizedName)&&i.startDate===this.startDate&&i.coverImage===this.coverImage&&d(i.pricingInfo,this.pricingInfo)&&d(i.locationInfo,this.locationInfo)&&d(i.classificationInfo,this.classificationInfo)&&i.eventDateFormat===this.eventDateFormat&&i.passEventOverrideLink===this.passEventOverrideLink&&i.thirdPartyEventUrl===this.thirdPartyEventUrl&&i.freeEventUrl===this.freeEventUrl}},Ri=(function(n){return n.Open="Open",n.Upcoming="Upcoming",n.SoldOut="SoldOut",n})(Ri||{}),dd=class n{constructor(i,e,t,s){this.saleState=i,this.remainingTicketCount=e,this.minPrice=t,this.maxPrice=s}static create(i){return new n(i.saleState,i.remainingTicketCount,i.minPrice,i.maxPrice)}static fromMap(i,e){var t,s;let a=(t=Re(r.getStringOrNull(e,"saleState"),Ri))!==null&&t!==void 0?t:(s=r.getBooleanOrNull(e,"isSoldOut"))!==null&&s!==void 0&&s?Ri.SoldOut:Ri.Open;return this.create({saleState:a,remainingTicketCount:r.getIntegerOrNull(e,"remainingTicketCount"),minPrice:Y.decodeOrNull(r.getStringOrNull(e,"minPrice")),maxPrice:Y.decodeOrNull(r.getStringOrNull(e,"maxPrice"))})}static fromMapOrNull(i,e){return k(e)?null:n.fromMap(i,e)}toMap(i){var e,t,s,a;return{saleState:m(this.saleState),isSoldOut:this.saleState===Ri.SoldOut,remainingTicketCount:this.remainingTicketCount,minPrice:(t=(e=this.minPrice)===null||e===void 0?void 0:e.encode())!==null&&t!==void 0?t:null,maxPrice:(a=(s=this.maxPrice)===null||s===void 0?void 0:s.encode())!==null&&a!==void 0?a:null}}clone(){return n.create({saleState:this.saleState,remainingTicketCount:this.remainingTicketCount,minPrice:Z(this.minPrice),maxPrice:Z(this.maxPrice)})}isSame(i){return i===this?!0:i.saleState===this.saleState&&i.remainingTicketCount===this.remainingTicketCount&&d(i.minPrice,this.minPrice)&&d(i.maxPrice,this.maxPrice)}},fs=class n{constructor(i,e,t){this.localizedName=i,this.city=e,this.address=t}static create(i){return new n(i.localizedName,i.city,i.address)}static fromMap(i,e){return new n(i.fromData(r.get(e,"localizedName")),r.getStringOrNull(e,"city"),r.getStringOrNull(e,"address"))}static fromMapOrNull(i,e){return k(e)?null:n.fromMap(i,e)}toMap(i){var e,t;return{localizedName:i.toData(this.localizedName),city:(e=this.city)!==null&&e!==void 0?e:null,address:(t=this.address)!==null&&t!==void 0?t:null}}clone(){return new n(F(this.localizedName),this.city,this.address)}isSame(i){return i===this?!0:d(i.localizedName,this.localizedName)&&i.city===this.city&&i.address===this.address}},hd=class n{constructor(i,e,t){this.classification=i,this.isFeatured=e,this.featuredScore=t}static create(i){return new n(i.classification,i.isFeatured,i.featuredScore)}static fromMap(i,e){return new n(r.getList(e,"classification",t=>y(t,_s)),r.getBoolean(e,"isFeatured"),r.getNumber(e,"featuredScore"))}toMap(i){return{classification:this.classification.map(e=>m(e)),isFeatured:this.isFeatured,featuredScore:this.featuredScore}}clone(){return new n(Te(this.classification),this.isFeatured,this.featuredScore)}isSame(i){return i===this?!0:P(i.classification,this.classification,(e,t)=>e===t)&&i.isFeatured===this.isFeatured&&i.featuredScore===this.featuredScore}};var Qu=(()=>{class n extends b{constructor(e,t,s){super(),this.isSubscribingEnabled=e,this.isSubscribingRequired=t,this.consentText=s}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static create(e){return new n(e.isSubscribingEnabled,e.isSubscribingRequired,e.consentText)}static fromBusinessLevelMarketingSettings(e){return n.create({isSubscribingEnabled:e.isSubscribingEnabled,isSubscribingRequired:e.isSubscribingRequired,consentText:e.consentText})}static fromMap(e,t){return n.create({isSubscribingEnabled:r.getBoolean(t,"isSubscribingEnabled"),isSubscribingRequired:r.getBoolean(t,"isSubscribingRequired"),
3consentText:e.fromDataOrNull(r.getRecordOrNull(t,"consentText"))})}toMap(e){return{isSubscribingEnabled:this.isSubscribingEnabled,isSubscribingRequired:this.isSubscribingRequired,consentText:e.toDataOrNull(this.consentText)}}clone(){return n.create({isSubscribingEnabled:this.isSubscribingEnabled,isSubscribingRequired:this.isSubscribingRequired,consentText:this.consentText})}isSame(e){return e===this?!0:e.isSubscribingEnabled===this.isSubscribingEnabled&&e.isSubscribingRequired===this.isSubscribingRequired&&d(e.consentText,this.consentText)}}return n.TYPE_ID="c70e521a71234701b6f840e7e0527a25",n.SCHEMA_VERSION=2,n})(),Sv=class extends f{build(i,e){return Qu.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(Qu.SCHEMA_VERSION))return e;if(t.isGreaterThan(Qu.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(r.setIfNullOrUndefined(e,"isSubscribingRequired",!1),s=2),e.$schema_version=D.encodedExactly(s),e}},ec=(()=>{class n extends b{constructor(e,t,s,a,o){super(),this.businessRef=e,this.isSubscribingEnabled=t,this.isSubscribingRequired=s,this.vendorSettings=a,this.consentText=o}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static create(e){return new n(e.businessRef,e.isSubscribingEnabled,e.isSubscribingRequired,e.vendorSettings,e.consentText)}static fromMap(e,t){return n.create({businessRef:j.mustDecode(r.getString(t,"businessRef")),isSubscribingEnabled:r.getBoolean(t,"isSubscribingEnabled"),isSubscribingRequired:r.getBoolean(t,"isSubscribingRequired"),vendorSettings:e.fromDataOrNull(r.getRecordOrNull(t,"vendorSettings")),consentText:e.fromDataOrNull(r.getRecordOrNull(t,"consentText"))})}toMap(e){return{businessRef:this.businessRef.encode(),isSubscribingEnabled:this.isSubscribingEnabled,isSubscribingRequired:this.isSubscribingRequired,vendorSettings:e.toDataOrNull(this.vendorSettings),consentText:e.toDataOrNull(this.consentText)}}clone(){return this.copyWith()}copyWith({businessRef:e=F(this.businessRef),isSubscribingEnabled:t=this.isSubscribingEnabled,isSubscribingRequired:s=this.isSubscribingRequired,vendorSettings:a=Z(this.vendorSettings),consentText:o=Z(this.consentText)}={}){return n.create({businessRef:e,isSubscribingEnabled:t,isSubscribingRequired:s,vendorSettings:a,consentText:o})}isSame(e){return e===this?!0:d(e.businessRef,this.businessRef)&&e.isSubscribingEnabled===this.isSubscribingEnabled&&e.isSubscribingRequired===this.isSubscribingRequired&&d(e.vendorSettings,this.vendorSettings)&&d(e.consentText,this.consentText)}}return n.TYPE_ID="d3b8a0ffda80417281c9bf8b7726de02",n.SCHEMA_VERSION=2,n})(),Tv=class extends f{build(i,e){return ec.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(ec.SCHEMA_VERSION))return e;if(t.isGreaterThan(ec.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(r.setIfNullOrUndefined(e,"isSubscribingRequired",!1),s=2),e.$schema_version=D.encodedExactly(s),e}},mP=(()=>{class n extends b{constructor(e,t,s,a){super(),this.accountId=e,this.isGuestAccount=t,this.businessRef=s,this.activeSubscription=a}get $typeId(){return n.TYPE_ID}get uniqueId(){return this.accountId}static create(e){return new n(e.accountId,e.isGuestAccount,e.businessRef,e.activeSubscription)}static fromMap(e,t){return n.create({accountId:r.getString(t,"accountId"),isGuestAccount:r.getBoolean(t,"isGuestAccount"),businessRef:j.mustDecode(r.getString(t,"businessRef")),activeSubscription:e.fromData(r.getRecord(t,"activeSubscription"))})}toMap(e){return{uniqueId:this.uniqueId,accountId:this.accountId,isGuestAccount:this.isGuestAccount,businessRef:this.businessRef.encode(),activeSubscription:e.toData(this.activeSubscription)}}clone(){return this.copyWith()}copyWith({accountId:e=this.accountId,isGuestAccount:t=this.isGuestAccount,businessRef:s=this.businessRef,activeSubscription:a=this.activeSubscription}={}){return n.create({accountId:e,isGuestAccount:t,businessRef:s,activeSubscription:a})}isSame(e){return e===this?!0:e.accountId===this.accountId&&e.isGuestAccount===this.isGuestAccount&&d(e.businessRef,this.businessRef)&&d(e.activeSubscription,this.activeSubscription)}}return n.TYPE_ID="278ccf462a44450ba1e897bd611c95bb",n})(),Ov=class extends f{build(i,e){return mP.fromMap(i,e)}},wo=class extends b{},IP=(()=>{class n extends b{constructor(e,t){super(),this.creationDate=e,this.businessRef=t}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.creationDate,e.businessRef)}static fromMap(e,t){return this.create({creationDate:e.decodeDate(r.getNumber(t,"creationDate")),businessRef:j.mustDecode(r.getString(t,"businessRef"))})}toMap(e){return{creationDate:e.encodeDate(this.creationDate),businessRef:this.businessRef.encode()}}clone(){return n.create({businessRef:F(this.businessRef),creationDate:g.cloneDate(this.creationDate)})}isSame(e){return e===this?!0:d(e.businessRef,this.businessRef)&&e.creationDate===this.creationDate}}return n.TYPE_ID="c3224973e03644dd9f1bf217c9c94a52",n})(),Rv=class extends f{build(i,e){return IP.fromMap(i,e)}},Jd=(function(n){return n.PersistenceOnly="PersistenceOnly",n.Mailchimp="Mailchimp",n.Mailerlite="Mailerlite",n})(Jd||{}),Kd=(function(n){return n.PersistenceOnly="PersistenceOnly",n.Mailchimp="Mailchimp",n.Mailerlite="Mailerlite",n})(Kd||{}),So=class extends b{},DP=(()=>{class n extends wo{constructor(e,t,s,a,o,u,c,l,h,p){super(),this.id=e,this.emailAddress=t,this.uniqueEmailId=s,this.contactId=a,this.webId=o,this.listId=u,this.tags=c,this.businessRef=l,this.consentDate=h,this.subscriptionDate=p}get $typeId(){return n.TYPE_ID}get type(){return Jd.Mailchimp}static create(e){return new n(e.id,e.emailAddress,e.uniqueEmailId,e.contactId,e.webId,e.listId,e.tags,e.businessRef,e.consentDate,e.subscriptionDate)}static fromMap(e,t){return n.create({id:r.getString(t,"id"),emailAddress:r.getString(t,"emailAddress"),uniqueEmailId:r.getString(t,"uniqueEmailId"),contactId:r.getString(t,"contactId"),webId:r.getNumber(t,"webId"),listId:r.getString(t,"listId"),tags:r.getList(t,"tags",s=>K.decodeString(s)),businessRef:j.mustDecode(r.getString(t,"businessRef")),consentDate:e.decodeDate(r.getNumber(t,"consentDate")),subscriptionDate:e.decodeDate(r.getNumber(t,"subscriptionDate"))})}toMap(e){return{type:m(this.type),id:this.id,emailAddress:this.emailAddress,uniqueEmailId:this.uniqueEmailId,contactId:this.contactId,webId:this.webId,listId:this.listId,tags:this.tags,businessRef:this.businessRef.encode(),consentDate:e.encodeDate(this.consentDate),subscriptionDate:e.encodeDate(this.subscriptionDate)}}clone(){return n.create({id:this.id,emailAddress:this.emailAddress,uniqueEmailId:this.uniqueEmailId,contactId:this.contactId,webId:this.webId,listId:this.listId,tags:Te(this.tags),businessRef:F(this.businessRef),consentDate:g.cloneDate(this.consentDate),subscriptionDate:g.cloneDate(this.subscriptionDate)})}isSame(e){return e===this?!0:e.id===this.id&&e.emailAddress===this.emailAddress&&e.uniqueEmailId===this.uniqueEmailId&&e.contactId===this.contactId&&e.webId===this.webId&&e.listId===this.listId&&P(e.tags,this.tags)&&d(e.businessRef,this.businessRef)&&e.consentDate===this.consentDate&&e.subscriptionDate===this.subscriptionDate}}return n.TYPE_ID="ab05df3997494fe5bc5ea3a7ab67af9d",n})(),Mv=class extends f{build(i,e){return DP.fromMap(i,e)}},vP=(()=>{class n extends So{constructor(e,t,s){super(),this.apiKey=e,this.serverId=t,this.listId=s}get $typeId(){return n.TYPE_ID}get type(){return Kd.Mailchimp}static create(e){return new n(e.apiKey,e.serverId,e.listId)}static fromMap(e,t){return this.create({apiKey:r.getString(t,"apiKey"),serverId:r.getString(t,"serverId"),listId:r.getString(t,"listId")})}toMap(e){return{type:m(this.type),apiKey:this.apiKey,serverId:this.serverId,listId:this.listId}}clone(){return this.copyWith()}copyWith({apiKey:e=this.apiKey,serverId:t=this.serverId,listId:s=this.listId}={}){return n.create({apiKey:e,serverId:t,listId:s}
3)}isSame(e){return e===this?!0:e.apiKey===this.apiKey&&e.serverId===this.serverId&&e.listId===this.listId}}return n.TYPE_ID="054a681b192b4caea4399f6c1ead596e",n})(),Nv=class extends f{build(i,e){return vP.fromMap(i,e)}},yP=(()=>{class n extends So{constructor(e){super(),this.apiKey=e}get $typeId(){return n.TYPE_ID}get type(){return Kd.Mailerlite}static create(e){return new n(e.apiKey)}static fromMap(e,t){return this.create({apiKey:r.getString(t,"apiKey")})}toMap(e){return{type:m(this.type),apiKey:this.apiKey}}clone(){return n.create({apiKey:this.apiKey})}isSame(e){return e===this?!0:e.apiKey===this.apiKey}}return n.TYPE_ID="acae44ecdd004e229eca1833059e79f6",n})(),Pv=class extends f{build(i,e){return yP.fromMap(i,e)}},bP=(()=>{class n extends wo{constructor(e,t,s,a,o){super(),this.id=e,this.email=t,this.businessRef=s,this.consentDate=a,this.subscriptionDate=o}get $typeId(){return n.TYPE_ID}get type(){return Jd.Mailerlite}static create(e){return new n(e.id,e.email,e.businessRef,e.consentDate,e.subscriptionDate)}static fromMap(e,t){return this.create({id:r.getString(t,"id"),email:r.getString(t,"email"),businessRef:j.mustDecode(r.getString(t,"businessRef")),consentDate:e.decodeDate(r.getNumber(t,"consentDate")),subscriptionDate:e.decodeDate(r.getNumber(t,"subscriptionDate"))})}toMap(e){return{type:m(this.type),id:this.id,email:this.email,businessRef:this.businessRef.encode(),consentDate:e.encodeDate(this.consentDate),subscriptionDate:e.encodeDate(this.subscriptionDate)}}clone(){return n.create({id:this.id,email:this.email,businessRef:F(this.businessRef),consentDate:g.cloneDate(this.consentDate),subscriptionDate:g.cloneDate(this.subscriptionDate)})}isSame(e){return e===this?!0:e.id===this.id&&e.email===this.email&&d(e.businessRef,this.businessRef)&&e.consentDate===this.consentDate&&e.subscriptionDate===this.subscriptionDate}}return n.TYPE_ID="2d3a5008630b4f84929f08fd4e36dc85",n})(),Av=class extends f{build(i,e){return bP.fromMap(i,e)}},EP=(()=>{class n extends So{constructor(){super()}get $typeId(){return n.TYPE_ID}get type(){return Kd.PersistenceOnly}static create(){return new n}static fromMap(e,t){return this.create()}toMap(e){return{type:m(this.type)}}clone(){return n.create()}isSame(e){return!0}}return n.TYPE_ID="a2fedb527ac9467d8f3802171527c092",n})(),Cv=class extends f{build(i,e){return EP.fromMap(i,e)}},wP=(()=>{class n extends wo{constructor(e,t,s,a){super(),this.emailAddress=e,this.businessRef=t,this.consentDate=s,this.subscriptionDate=a}get $typeId(){return n.TYPE_ID}get type(){return Jd.PersistenceOnly}static create(e){return new n(e.emailAddress,e.businessRef,e.consentDate,e.subscriptionDate)}static fromMap(e,t){return this.create({emailAddress:r.getString(t,"emailAddress"),businessRef:j.mustDecode(r.getString(t,"businessRef")),consentDate:e.decodeDate(r.getNumber(t,"consentDate")),subscriptionDate:e.decodeDate(r.getNumber(t,"subscriptionDate"))})}toMap(e){return{emailAddress:this.emailAddress,businessRef:this.businessRef.encode(),consentDate:e.encodeDate(this.consentDate),subscriptionDate:e.encodeDate(this.subscriptionDate)}}clone(){return n.create({emailAddress:this.emailAddress,businessRef:F(this.businessRef),consentDate:g.cloneDate(this.consentDate),subscriptionDate:g.cloneDate(this.subscriptionDate)})}isSame(e){return e===this?!0:e.emailAddress===this.emailAddress&&d(e.businessRef,this.businessRef)&&e.consentDate===this.consentDate&&e.subscriptionDate===this.subscriptionDate}}return n.TYPE_ID="c44451fd628b400cb859cd05b007c448",n})(),kv=class extends f{build(i,e){return wP.fromMap(i,e)}},To=class extends b{},fd=class extends b{},AS=(()=>{class n extends To{constructor(e){super(),this.unitPrice=e,this.uniqueId=n.UNIQUE_ID,this.quantity=1,this.totalPrice=e,this.originalUnitPrice=null}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}static create({amount:e}){return new n(e)}static fromMap(e,t){return new n(Y.decode(r.getString(t,"unitPrice")))}toMap(e){return{unitPrice:this.unitPrice.encode()}}clone(){return new n(F(this.unitPrice))}isSame(e){return e===this?!0:d(e.unitPrice,this.unitPrice)}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="a3add96a664044daba0cb45e10c7a832",n.SCHEMA_VERSION=1,n.UNIQUE_ID="donation",n})(),_v=class extends f{build(i,e){return AS.fromMap(i,e)}},pd=class n extends To{constructor(i,e,t,s){var a,o;super(),this.eventId=i,this.ticket=e,this.supplement=t,this.priceModifier=s;let u=e.price.clone(),c=(o=(a=e.originalPrice)===null||a===void 0?void 0:a.clone())!==null&&o!==void 0?o:null;s!=null&&(u=u.add(s),c!=null&&(c=c.add(s))),this.unitPrice=u,this.originalUnitPrice=c}get uniqueId(){return this.ticket.uniqueId}static verifyType(i){return i instanceof n}static assertType(i){return i instanceof n}},tc=(()=>{class n extends pd{constructor(e,t,s,a,o){super(e,s,a,o),this.quantity=t,this._totalPrice=this.unitPrice.scale(t)}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}get totalPrice(){return this._totalPrice}
3static create(e){return new n(e.eventId,e.quantity,e.ticket,e.supplement,e.priceModifier)}static fromMap(e,t){return new n(r.getStringOrNull(t,"eventId"),r.getInteger(t,"quantity"),e.fromData(r.getRecord(t,"ticket")),e.fromDataOrNull(r.getRecordOrNull(t,"supplement")),Y.decodeOrNull(r.getStringOrNull(t,"priceModifier")))}toMap(e){var t,s;return{eventId:this.eventId,quantity:this.quantity,ticket:e.toData(this.ticket),supplement:e.toDataOrNull(this.supplement),priceModifier:(s=(t=this.priceModifier)===null||t===void 0?void 0:t.encode())!==null&&s!==void 0?s:null}}clone(){return new n(this.eventId,this.quantity,F(this.ticket),Z(this.supplement),Z(this.priceModifier))}isSame(e){return e===this?!0:e.eventId===this.eventId&&e.quantity===this.quantity&&d(e.ticket,this.ticket)&&d(e.supplement,this.supplement)&&d(e.priceModifier,this.priceModifier)}static assertType(e){return e instanceof n}}return n.TYPE_ID="2e9fa2e91b8d42269dc4d39c02ca3558",n.SCHEMA_VERSION=3,n})(),xv=class extends f{build(i,e){return tc.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(tc.SCHEMA_VERSION))return e;if(t.isGreaterThan(tc.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(s=2),s<3&&(s=3),e.$schema_version=D.encodedExactly(s),e}},nc=(()=>{class n extends pd{constructor(e,t,s,a,o){super(e,s,a,o),this.seats=t,this._totalPrice=this.unitPrice.scale(this.seats.length)}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}get quantity(){return this.seats.length}get totalPrice(){return this._totalPrice}static create(e){return new n(e.eventId,e.seats,e.ticket,e.supplement,e.priceModifier)}static fromMap(e,t){return new n(r.getStringOrNull(t,"eventId"),r.getList(t,"seats",s=>s),e.fromData(r.getRecord(t,"ticket")),e.fromDataOrNull(r.getRecordOrNull(t,"supplement")),Y.decodeOrNull(r.getStringOrNull(t,"priceModifier")))}toMap(e){var t,s;return{eventId:this.eventId,seats:this.seats,ticket:e.toData(this.ticket),supplement:e.toDataOrNull(this.supplement),priceModifier:(s=(t=this.priceModifier)===null||t===void 0?void 0:t.encode())!==null&&s!==void 0?s:null}}clone(){return new n(this.eventId,Te(this.seats),F(this.ticket),Z(this.supplement),Z(this.priceModifier))}isSame(e){return e===this?!0:e.eventId===this.eventId&&d(e.ticket,this.ticket)&&d(e.supplement,this.supplement)&&P(e.seats,this.seats)&&d(e.priceModifier,this.priceModifier)}static assertType(e){return e instanceof n}}return n.TYPE_ID="f5f5bc259394409a9d5b32c083003428",n.SCHEMA_VERSION=3,n})(),Fv=class extends f{build(i,e){return nc.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(nc.SCHEMA_VERSION))return e;if(t.isGreaterThan(nc.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(s=2),s<3&&(s=3),e.$schema_version=D.encodedExactly(s),e}},ic=(()=>{class n extends To{constructor(e,t,s){var a,o;super(),this.eventId=e,this.quantity=t,this.product=s,this.unitPrice=s.price.clone(),this.originalUnitPrice=(o=(a=s.originalPrice)===null||a===void 0?void 0:a.clone())!==null&&o!==void 0?o:null,this._totalPrice=this.unitPrice.scale(t)}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}get uniqueId(){return this.product.uniqueId}get totalPrice(){return this._totalPrice}static create(e){return new n(e.eventId,e.quantity,e.product)}static fromMap(e,t){return new n(r.getStringOrNull(t,"eventId"),r.getInteger(t,"quantity"),e.fromData(r.getRecord(t,"product")))}toMap(e){return{eventId:this.eventId,quantity:this.quantity,product:e.toData(this.product)}}clone(){return new n(this.eventId,this.quantity,F(this.product))}isSame(e){return e===this?!0:d(e.product,this.product)&&e.eventId===this.eventId&&e.quantity===this.quantity}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="2e56888e5c2e4784a1fc221cc309b1de",n.SCHEMA_VERSION=2,n})(),qv=class extends f{build(i,e){return ic.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(ic.SCHEMA_VERSION))return e;if(t.isGreaterThan(ic.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(s=2),e.$schema_version=D.encodedExactly(s),e}},Ao=(function(n){return n.TicketOrder="TicketOrder",n.ProductOrder="ProductOrder",n.GenericOrder="GenericOrder",n})(Ao||{}),sc=(()=>{class n extends b{constructor(e,t,s,a,o,u,c,l,h,p,I,v,E,w,S){super(),this.businessRef=e,this.eventId=t,this.items=s,this.voucher=a,this.creatorId=o,this.customer=u,this.paymentType=c,this.paymentMethod=l,this.isGuestOrder=h,this.invoiceType=p,this.allowPlatformMarketing=I,this.allowBusinessMarketing=v,this.language=E,this.formSubmissions=w,this.strategy=S}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}static create(e){return new n(e.businessRef,e.eventId,e.items,e.voucher,e.creatorId,e.customer,e.paymentType,e.paymentMethod,e.isGuestOrder,e.invoiceType,e.allowPlatformMarketing,e.allowBusinessMarketing,e.language,e.formSubmissions,e.strategy)}static fromMap(e,t){return new n(j.mustDecode(r.getString(t,"businessRef")),r.getString(t,"eventId"),r.getList(t,"items",s=>e.fromData(s)),e.fromDataOrNull(r.getRecordOrNull(t,"voucher")),r.getString(t,"creatorId"),e.fromData(r.getRecord(t,"customer")),y(r.getString(t,"paymentType"),pe),y(r.getString(t,"paymentMethod"),Fe),r.getBoolean(t,"isGuestOrder"),Re(r.getStringOrNull(t,"invoiceType"),Ni),r.getBooleanOrNull(t,"allowPlatformMarketing"),r.getBooleanOrNull(t,"allowBusinessMarketing"),y(r.getString(t,"language"),$),r.getListOrNull(t,"formSubmissions",s=>e.fromData(s)),y(r.getString(t,"strategy"),Ao))}toMap(e){var t,s;return{businessRef:this.businessRef.encode(),eventId:this.eventId,items:this.items.map(a=>e.toData(a)),voucher:e.toDataOrNull(this.voucher),creatorId:this.creatorId,customer:e.toData(this.customer),paymentType:m(this.paymentType),paymentMethod:m(this.paymentMethod),isGuestOrder:this.isGuestOrder,invoiceType:Se(this.invoiceType),allowPlatformMarketing:this.allowPlatformMarketing,allowBusinessMarketing:this.allowBusinessMarketing,language:m(this.language),formSubmissions:(s=(t=this.formSubmissions)===null||t===void 0?void 0:t.map(a=>
3e.toData(a)))!==null&&s!==void 0?s:null,strategy:m(this.strategy)}}clone(){var e,t;return new n(this.businessRef.clone(),this.eventId,this.items.map(s=>s.clone()),Z(this.voucher),this.creatorId,F(this.customer),this.paymentType,this.paymentMethod,this.isGuestOrder,this.invoiceType,this.allowPlatformMarketing,this.allowBusinessMarketing,this.language,(t=(e=this.formSubmissions)===null||e===void 0?void 0:e.map(s=>s.clone()))!==null&&t!==void 0?t:null,this.strategy)}isSame(e){return e===this?!0:d(e.businessRef,this.businessRef)&&e.eventId===this.eventId&&P(e.items,this.items,d)&&d(e.voucher,this.voucher)&&e.creatorId===this.creatorId&&e.paymentType===this.paymentType&&e.paymentMethod===this.paymentMethod&&e.language===this.language&&e.isGuestOrder===this.isGuestOrder&&e.invoiceType===this.invoiceType&&e.allowPlatformMarketing===this.allowPlatformMarketing&&e.allowBusinessMarketing===this.allowBusinessMarketing&&e.strategy===this.strategy&&d(e.customer,this.customer)&&P(e.formSubmissions,this.formSubmissions,d)}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="16ea414b67bc4172838bdef9ceb500d9",n.SCHEMA_VERSION=6,n})(),Yv=class extends f{build(i,e){return sc.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(sc.SCHEMA_VERSION))return e;if(t.isGreaterThan(sc.SCHEMA_VERSION))return null;let s=t.to;if(s<2&&(s=2),s<3&&(e.language=m($.English),s=3),s<4&&(s=4),s<5&&(e.strategy=m(Ao.GenericOrder),s=5),s<6){let a=Y.decodeOrNull(r.getOrNull(e,"donation"));if(a!=null){let o=r.getList(e,"items",u=>i.fromData(u));o.push(AS.create({amount:a})),e.items=o.map(u=>i.toData(u))}s=6}return e.$schema_version=D.encodedExactly(s),e}},ja=(()=>{class n extends b{constructor(e,t,s,a,o,u,c,l,h,p){super(),this.eventId=e,this.items=t,this.voucher=s,this.discount=a,this.supplementaryTicket=o,this.ticketType=u,this.requireTaxIdentifier=c,this.promoterId=l,this.note=h,this.deliveryMethod=p}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}static create(e){return new n(e.eventId,e.items,e.voucher,e.discount,e.supplementaryTicket,e.ticketType,e.requireTaxIdentifier,e.promoterId,e.note,e.deliveryMethod)}static fromMap(e,t){return this.create({eventId:r.getStringOrNull(t,"eventId"),items:r.getList(t,"items",s=>e.fromData(s)),voucher:e.fromDataOrNull(r.getRecordOrNull(t,"voucher")),discount:e.fromDataOrNull(r.getRecordOrNull(t,"discount")),supplementaryTicket:e.fromDataOrNull(r.getRecordOrNull(t,"supplementaryTicket")),ticketType:y(r.getString(t,"ticketType"),we),requireTaxIdentifier:r.getBoolean(t,"requireTaxIdentifier"),promoterId:r.getStringOrNull(t,"promoterId"),note:r.getStringOrNull(t,"note"),deliveryMethod:y(r.getString(t,"deliveryMethod"),ai)})}toMap(e){return{eventId:this.eventId,items:this.items.map(t=>e.toData(t)),voucher:e.toDataOrNull(this.voucher),discount:e.toDataOrNull(this.discount),supplementaryTicket:e.toDataOrNull(this.supplementaryTicket),ticketType:m(this.ticketType),requireTaxIdentifier:this.requireTaxIdentifier,promoterId:this.promoterId,note:this.note,deliveryMethod:m(this.deliveryMethod)}}clone(){return n.create({eventId:this.eventId,items:this.items.map(e=>e.clone()),voucher:Z(this.voucher),discount:Z(this.discount),supplementaryTicket:Z(this.supplementaryTicket),ticketType:this.ticketType,requireTaxIdentifier:this.requireTaxIdentifier,promoterId:this.promoterId,note:this.note,deliveryMethod:this.deliveryMethod})}isSame(e){return e===this?!0:e.eventId===this.eventId&&P(e.items,this.items,d)&&d(e.voucher,this.voucher)&&d(e.discount,this.discount)&&e.ticketType===this.ticketType&&e.requireTaxIdentifier===this.requireTaxIdentifier&&e.promoterId===this.promoterId&&e.note===this.note&&e.deliveryMethod===this.deliveryMethod&&d(e.supplementaryTicket,this.supplementaryTicket)}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="5e39949f4b824b84953eb3160251a5b2",n.SCHEMA_VERSION=1,n})(),$v=class extends f{build(i,e){return ja.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(ja.SCHEMA_VERSION))return e;if(t.isGreaterThan(ja.SCHEMA_VERSION))return null;let s=t.to;return e.$schema_version=D.encodedExactly(s),e}},rc=(()=>{class n extends b{constructor(e,t,s,a,o,u,c,l){super(),this.businessRef=e,this.creatorId=t,this.entries=s,this.customer=a,this.paymentType=
3o,this.paymentMethod=u,this.language=c,this.strategy=l}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}static create(e){return new n(e.businessRef,e.creatorId,e.entries,e.customer,e.paymentType,e.paymentMethod,e.language,e.strategy)}static fromMap(e,t){return this.create({businessRef:j.mustDecode(r.getString(t,"businessRef")),entries:r.getList(t,"entries",s=>e.fromData(s)),creatorId:r.getString(t,"creatorId"),customer:e.fromDataOrNull(r.getRecordOrNull(t,"customer")),paymentType:y(r.getString(t,"paymentType"),pe),paymentMethod:y(r.getString(t,"paymentMethod"),Fe),language:y(r.getString(t,"language"),$),strategy:y(r.getString(t,"strategy"),Ao)})}toMap(e){return{businessRef:this.businessRef.encode(),entries:this.entries.map(t=>e.toData(t)),creatorId:this.creatorId,customer:e.toDataOrNull(this.customer),paymentType:m(this.paymentType),paymentMethod:m(this.paymentMethod),language:m(this.language),strategy:m(this.strategy)}}clone(){return n.create({businessRef:this.businessRef.clone(),entries:this.entries.map(e=>e.clone()),creatorId:this.creatorId,customer:Z(this.customer),paymentType:this.paymentType,paymentMethod:this.paymentMethod,language:this.language,strategy:this.strategy})}isSame(e){return e===this?!0:d(e.businessRef,this.businessRef)&&P(e.entries,this.entries,d)&&e.creatorId===this.creatorId&&e.paymentType===this.paymentType&&e.paymentMethod===this.paymentMethod&&e.language===this.language&&e.strategy===this.strategy&&d(e.customer,this.customer)}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="03ae5313740644e091e51ac8d32c6316",n.SCHEMA_VERSION=6,n})(),Lv=class extends f{build(i,e){return rc.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(rc.SCHEMA_VERSION))return e;if(t.isGreaterThan(rc.SCHEMA_VERSION))return null;let s=t.to;if(s<2&&(s=2),s<3&&(s=3),s<4&&(e.language=m($.English),s=4),s<5&&(e.strategy=m(Ao.GenericOrder),s=5),s<6){let a=ja.create({eventId:r.getStringOrNull(e,"eventId"),items:r.getList(e,"items",o=>i.fromData(o)),voucher:i.fromDataOrNull(r.getRecordOrNull(e,"voucher")),discount:i.fromDataOrNull(r.getRecordOrNull(e,"discount")),supplementaryTicket:i.fromDataOrNull(r.getRecordOrNull(e,"supplementaryTicket")),ticketType:y(r.getString(e,"ticketType"),we),requireTaxIdentifier:r.getBoolean(e,"requireTaxIdentifier"),promoterId:r.getStringOrNull(e,"promoterId"),note:r.getStringOrNull(e,"note"),deliveryMethod:y(r.getString(e,"deliveryMethod"),ai)});e.entries=[i.toData(a)],s=6}return e.$schema_version=D.encodedExactly(s),e}},ac=(()=>{class n extends b{constructor(e,t,s,a,o,u,c,l){super(),this.businessRef=e,this.items=t,this.creatorId=s,this.viaOrder=a,this.paymentMethod=o,this.source=u,this.country=c,this.timezone=l}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}static create(e){return new n(e.businessRef,e.items,e.creatorId,e.viaOrder,e.paymentMethod,e.source,e.country,e.timezone)}static fromMap(e,t){return new n(j.mustDecode(r.getString(t,"businessRef")),r.getList(t,"items",s=>e.fromData(s)),r.getString(t,"creatorId"),e.fromDataOrNull(r.getRecordOrNull(t,"viaOrder")),y(r.getString(t,"paymentMethod"),Fe),y(r.get(t,"source"),Yr),y(r.get(t,"country"),Ie),y(r.get(t,"timezone"),Ee))}toMap(e){return{businessRef:this.businessRef.encode(),items:this.items.map(t=>e.toData(t)),creatorId:this.creatorId,viaOrder:e.toDataOrNull(this.viaOrder),paymentMethod:m(this.paymentMethod),source:m(this.source),country:m(this.country),timezone:m(this.timezone)}}clone(){return new n(this.businessRef.clone(),this.items.map(e=>e.clone()),this.creatorId,Z(this.viaOrder),this.paymentMethod,this.source,this.country,this.timezone)}isSame(e){return e===this?!0:d(e.businessRef,this.businessRef)&&d(e.viaOrder,this.viaOrder)&&P(e.items,this.items,d)&&e.source===this.source&&e.country===this.country&&e.timezone===this.timezone&&e.creatorId===this.creatorId&&e.paymentMethod===this.paymentMethod}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="f71aa7d417744bfeb292e03fc558dda1",n.SCHEMA_VERSION=3,n})(),Vv=class extends f{build(i,e){return ac.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){var t;let s=r.getVersionRange(e);if(s.contains(ac.SCHEMA_VERSION))return e;if(s.isGreaterThan(ac.SCHEMA_VERSION))return null;let a=s.to;if(a<2&&(e.source=m(Yr.Admin),e.timezone=m(Ee.EuropeBucharest),a=2),a<3){let o=y(r.get(e,"timezone"),Ee);e.country=m((t=xd(o))!==null&&t!==void 0?t:Ie.Romania),a=3}return e.$schema_version=D.encodedExactly(a),e}},oc=(()=>{class n extends fd{constructor(e,t,s,a,o,u){super(),this.passId=e,this.scanCode=t,this.customer=s,this.template=a,this.variation=o,this.components=u}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}static create(e){var t;return new n(e.passId,e.scanCode,e.customer,e.template,e.variation,(t=e.components)!==null&&t!==void 0?t:new ae)}static fromMap(e,t){return new n(r.getString(t,"passId"),r.getString(t,"scanCode"),e.fromDataOrNull(r.getRecord(t,"customer")),e.fromData(r.getRecord(t,"template")),e.fromDataOrNull(r.getRecordOrNull(t,"variation")),ae.deserialize(e,r.get(t,"components")))}toMap(e){return{passId:this.passId,scanCode:this.scanCode,customer:e.toDataOrNull(this.customer),template:e.toData(this.template),variation:e.toDataOrNull(this.variation),components:this.components.serialize(e)}}clone(){return new n(this.passId,this.scanCode,Z(this.customer),F(this.template),Z(this.variation),this.components.clone())}isSame(e){return e===this?!0:d(e.template,this.template)&&d(e.variation,this.variation)&&e.passId===this.passId&&e.scanCode===this.scanCode&&d(e.customer,this.customer)&&d(e.components,this.components)}static assertType(e){return e instanceof n}}return n.TYPE_ID="10d7eba3031e4557afcdf1448d6adf08",n.SCHEMA_VERSION=2,n})(),zv=class extends f{build(i,e){return oc.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(oc.SCHEMA_VERSION))return e;if(t.isGreaterThan(oc.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(s=2,e.components=[]),e.$schema_version=D.encodedExactly(s),e}},uc=(()=>{class n extends fd{constructor(e,t,s,a,o,u,c){super(),this.passId=e,this.scanCode=t,this.customer=s,this.seatingOptions=a,this.template=o,this.variation=u,this.components=c}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}static create(e){var t;return new n(e.passId,e.scanCode,e.customer,e.seatingOptions,e.template,e.variation,(t=e.components)!==null&&t!==void 0?t:new ae)}static fromMap(e,t){return new n(r.getString(t,"passId"),r.getString(t,"scanCode"),e.fromDataOrNull(r.getRecord(t,"customer")),e.fromData(r.getRecord(t,"seatingOptions")),e.fromData(r.getRecord(t,"template")),e.fromDataOrNull(r.getRecordOrNull(t,"variation")),ae.deserialize(e,r.get(t,"components")))}toMap(e){return{passId:this.passId,scanCode:this.scanCode,customer:e.toDataOrNull(this.customer),seatingOptions:e.toData(this.seatingOptions),template:e.toData(this.template),variation:e.toDataOrNull(this.variation),components:this.components.serialize(e)}}clone(){return new n(this.passId,this.scanCode,Z(this.customer),F(this.seatingOptions),F(this.template),Z(this.variation),this.components.clone())}isSame(e){return e===this?!0:d(e.template,this.template)&&e.passId===this.passId&&e.scanCode===this.scanCode&&d(e.variation,this.variation)&&d(e.seatingOptions,this.seatingOptions)&&d(e.customer,this.customer)&&d(e.components,this.components)}static assertType(e){return e instanceof n}}return n.TYPE_ID="f5d357d1beef44fbb889d360ca7197d7",n.SCHEMA_VERSION=2,n})(),Uv=class extends f{build(i,e){return uc.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(uc.SCHEMA_VERSION))return e;if(t.isGreaterThan(uc.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(s=2,e.components=[]),e.$schema_version=D.encodedExactly(s),e}},SP=(()=>{class n extends b{constructor(e,t,s,a){super(),this.businessRef=e,this.allowDonations=t,this.donationMessage=s,this.donationOptions=a}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.businessRef,e.allowDonations,e.donationMessage,e.donationOptions)}static fromMap(e,t){return n.create({businessRef:j.mustDecode(r.getString(t,"businessRef")),allowDonations:r.getBoolean(t,"allowDonations"),donationMessage:e.fromDataOrNull(r.getOrNull(t,"donationMessage")),donationOptions:r.getList(t,"donationOptions",s=>Y.decode(s))})}toMap(e){return{businessRef:this.businessRef.encode(),allowDonations:this.allowDonations,donationMessage:e.toDataOrNull(this.donationMessage),donationOptions:this.donationOptions.map(t=>t.encode())}}clone(){return this.copyWith()}copyWith({businessRef:e=F(this.businessRef),allowDonations:t=this.allowDonations,donationMessage:s=Z(this.donationMessage),donationOptions:a=ue(this.donationOptions)}={}){return n.create({businessRef:e,allowDonations:t,donationMessage:s,donationOptions:a})}isSame(e){return e===this?!0:d(e.businessRef,this.businessRef)&&e.allowDonations===this.allowDonations&&d(e.donationMessage,this.donationMessage)&&P(e.donationOptions,this.donationOptions,d)}}return n.TYPE_ID="291f0e20b47449f4a3a02b0f976be18c",n})(),Bv=class extends f{build(i,e){return SP.fromMap(i,e)}},TP=(()=>{class n extends b{constructor(e,t,s){super(),this.businessRef=e,this.donation=t,this.order=s,this.uniqueId=s.uniqueId}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.businessRef,e.donation,e.order)}static fromOrder(e){return e.donation==null?null:new n(e.businessRef.clone(),e.donation.clone(),e.clone())}static fromMap(e,t){return n.create({businessRef:j.mustDecode(r.getString(t,"businessRef")),donation:Y.decode(r.getString(t,"donation")),order:e.fromData(r.get(t,"order"))})}toMap(e){return{businessRef:this.businessRef.encode(),donation:this.donation.encode(),order:e.toData(this.order),orderId:this.order.uniqueId,customerId:this.order.userId,isGuestOrder:this.order.isGuestOrder,eventId:this.order.eventId,uniqueId:this.order.uniqueId}}clone(){return n.create({businessRef:this.businessRef.clone(),donation:this.donation.clone(),order:this.order.clone()})}isSame(e){return e===this?!0:d(e.businessRef,this.businessRef)&&d(e.donation,this.donation)&&d(e.order,this.order)}}return n.TYPE_ID="65d89fa192244b15a459e5283f59c41a",n})(),Hv=class extends f{build(i,e){return TP.fromMap(i,e)}},cc=(()=>{class n extends b{constructor(e,t,s){super(),this.enabled=e,this.body=t,this.supplementaryEmailAttachments=s}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static create(e){return new n(e.enabled,e.body,e.supplementaryEmailAttachments)}static fromMap(e,t){return new n(r.getBoolean(t,"enabled"),e.fromData(r.getRaw(t,"body")),r.getList(t,"supplementaryEmailAttachments",s=>e.fromData(s)))}toMap(e){return{enabled:this.enabled,body:e.toData(this.body),supplementaryEmailAttachments:this.supplementaryEmailAttachments.map(t=>e.toData(t))}}clone(){return new n(this.enabled,this.body.clone(),this.supplementaryEmailAttachments.map(e=>e.clone()))}isSame(e){return e===this?!0:e.enabled===this.enabled&&d(e.body,this.body)&&P(e.supplementaryEmailAttachments,this.supplementaryEmailAttachments,d)}}return n.TYPE_ID="0aec0978aa384b3cad6b3afd8ea4f3e0",n.SCHEMA_VERSION=2,n})(),Gv=class extends f{build(i,e){return cc.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(cc.SCHEMA_VERSION))return e;if(t.isGreaterThan(cc.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(s=2,e.supplementaryEmailAttachments=[]),e.$schema_version=D.encodedExactly(s),e}},Ms=class extends b{},CS=(()=>{class n extends Ms{constructor(){super(),this.strategy=yt.Calendar}get $typeId(){return n.TYPE_ID}static create(){return new n}static fromMap(e,t){return new n}toMap(e){return{strategy:m(this.strategy)}}clone(){return new n}isSame(e){return this===e?!0:e.strategy===this.strategy}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="9a3bdc979d474f178a83d094cd9e4ecc",n})(),Wv=class extends f{build(i,e){return CS.fromMap(i,e)}},OP=(()=>{class n extends Ms{constructor(e){super(),this.deferOrderCompletion=e,this.strategy=yt.TicketsAndProducts}get $typeId(){return n.TYPE_ID}static create(e){var t;return new n((t=e?.deferOrderCompletion)!==null&&t!==void 0?t:!1)}static fromMap(e,t){return new n(r.get(t,"deferOrderCompletion"))}toMap(e){return{strategy:m(this.strategy),deferOrderCompletion:this.deferOrderCompletion}}clone(){return new n(this.deferOrderCompletion)}isSame(e){return this===e?!0:e.strategy===this.strategy&&e.deferOrderCompletion===this.deferOrderCompletion}copyWith(e){var t;return new n((t=e?.deferOrderCompletion)!==null&&t!==void 0?t:this.deferOrderCompletion)}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="0e62f05968bd48d4b99e0e1ce0acd3bd",n})(),jv=class extends f{build(i,e){return OP.fromMap(i,e)}},kS=(()=>
3{class n extends Ms{constructor(e){super(),this.shouldSendElectronicPass=e,this.strategy=yt.TicketAsPass}get $typeId(){return n.TYPE_ID}static create(e){var t;return new n((t=e?.shouldSendElectronicPass)!==null&&t!==void 0?t:!0)}static fromMap(e,t){return new n(r.get(t,"shouldSendElectronicPass"))}toMap(e){return{strategy:m(this.strategy),shouldSendElectronicPass:this.shouldSendElectronicPass}}clone(){return new n(this.shouldSendElectronicPass)}isSame(e){return this===e?!0:e.strategy===this.strategy&&e.shouldSendElectronicPass===this.shouldSendElectronicPass}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="582e401d109843aebe0cc2330af1f4a0",n})(),Jv=class extends f{build(i,e){return kS.fromMap(i,e)}},Zd=(()=>{class n extends Ms{constructor(e,t,s){super(),this.sendOnlyPaymentConfirmation=e,this.allowExtendedCartSize=t,this.deferOrderCompletion=s,this.strategy=yt.Tickets}get $typeId(){return n.TYPE_ID}static create(e){var t,s,a;return new n((t=e?.sendOnlyPaymentConfirmation)!==null&&t!==void 0?t:!1,(s=e?.allowExtendedCartSize)!==null&&s!==void 0?s:!1,(a=e?.deferOrderCompletion)!==null&&a!==void 0?a:!1)}static fromMap(e,t){return new n(r.get(t,"sendOnlyPaymentConfirmation"),r.get(t,"allowExtendedCartSize"),r.get(t,"deferOrderCompletion"))}toMap(e){return{strategy:m(this.strategy),sendOnlyPaymentConfirmation:this.sendOnlyPaymentConfirmation,allowExtendedCartSize:this.allowExtendedCartSize,deferOrderCompletion:this.deferOrderCompletion}}clone(){return new n(this.sendOnlyPaymentConfirmation,this.allowExtendedCartSize,this.deferOrderCompletion)}isSame(e){return this===e?!0:e.strategy===this.strategy&&e.sendOnlyPaymentConfirmation===this.sendOnlyPaymentConfirmation&&e.allowExtendedCartSize===this.allowExtendedCartSize&&e.deferOrderCompletion===this.deferOrderCompletion}copyWith(e){var t,s,a;return new n((t=e?.sendOnlyPaymentConfirmation)!==null&&t!==void 0?t:this.sendOnlyPaymentConfirmation,(s=e?.allowExtendedCartSize)!==null&&s!==void 0?s:this.allowExtendedCartSize,(a=e?.deferOrderCompletion)!==null&&a!==void 0?a:this.deferOrderCompletion)}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="e0af97a8699d4d4fa47ccd43d05943fe",n})(),Kv=class extends f{build(i,e){return Zd.fromMap(i,e)}},Xd=(()=>{class n extends Ms{constructor(){super(),this.strategy=yt.Vouchers}get $typeId(){return n.TYPE_ID}static create(){return new n}static fromMap(e,t){return new n}toMap(e){return{strategy:m(this.strategy)}}clone(){return new n}isSame(e){return this===e?!0:e.strategy===this.strategy}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="4d15c87322704c45a3e7b30bcdf4a186",n})(),Zv=class extends f{build(i,e){return Xd.fromMap(i,e)}},En=(function(n){return n.Open="OPEN",n.Scanned="SCANNED",n})(En||{}),lc=(()=>{class n extends b{constructor(e,t,s,a,o,u,c,l,h){super(),this.businessRef=e,this.eventId=t,this.uniqueId=s,this.passId=a,this.passTemplateId=o,this.scans=u,this.creationDate=c,this.status=l,this.scanValidity=h,this.expirationDate=h!=null?c.add(h):null}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}get lastScannerId(){return this.scans[this.scans.length-1].scannerId}get lastScanDate(){return this.scans[this.scans.length-1].scanDate}static inside(e){return new n(e.businessRef,e.eventId,e.uniqueId,e.passId,e.passTemplateId,[{scannerId:e.scannerId,scanDate:e.scanDate,status:En.Scanned}],e.creationDate,En.Scanned,e.scanValidity)}static fromMap(e,t){return new n(j.mustDecode(r.get(t,"businessRef")),r.getOrNull(t,"eventId"),r.get(t,"uniqueId"),r.get(t,"passId"),r.get(t,"passTemplateId"),r.getList(t,"scans",s=>({scannerId:r.get(s,"scannerId"),scanDate:e.decodeDate(r.get(s,"scanDate")),status:y(r.get(s,"status"),En)})),e.decodeDate(r.get(t,"creationDate")),y(r.get(t,"$status"),En),e.decodeDurationOrNull(r.getOrNull(t,"scanValidity")))}toMap(e){return{businessRef:this.businessRef.encode(),eventId:this.eventId,uniqueId:this.uniqueId,passId:this.passId,passTemplateId:this.passTemplateId,scans:this.scans.map(t=>({scannerId:t.scannerId,scanDate:e.encodeDate(t.scanDate),status:m(t.status)})),creationDate:e.encodeDate(this.creationDate),$status:m(this.status),scanValidity:e.encodeDurationOrNull(this.scanValidity)}}clone(){return new n(this.businessRef.clone(),this.eventId,this.uniqueId,this.passId,this.passTemplateId,this.scans.map(e=>Object.assign({},e)),g.cloneDate(this.creationDate),this.status,g.cloneDurationOrNull(this.scanValidity))}isSame(e){return this===e?!0:e.eventId===this.eventId&&e.uniqueId===this.uniqueId&&e.passId===this.passId&&e.passTemplateId===this.passTemplateId&&e.creationDate===this.creationDate&&e.status===this.status&&e.scanValidity==this.scanValidity&&d(e.businessRef,this.businessRef)&&P(e.scans,this.scans,(t,s)=>t.scanDate==s.scanDate&&t.scannerId==s.scannerId&&t.status==s.status)}scanIn(e){return new n(this.businessRef.clone(),this.eventId,this.uniqueId,this.passId,this.passTemplateId,[...this.scans.map(t=>Object.assign({},t)),{scannerId:e.scannerId,scanDate:e.scanDate,status:En.Scanned}],g.cloneDate(this.creationDate),En.Scanned,g.cloneDurationOrNull(this.scanValidity))}scanOut(e){return new n(this.businessRef.clone(),this.eventId,this.uniqueId,this.passId,this.passTemplateId,[...this.scans.map(t=>Object.assign({},t)),{scannerId:e.scannerId,scanDate:e.scanDate,status:En.Open}],g.cloneDate(this.creationDate),En.Open,g.cloneDurationOrNull(this.scanValidity))}}return n.TYPE_ID="59fdaa80bcc745b99d39ad0f6f838894",n.SCHEMA_VERSION=5,n})(),Xv=class extends f{build(i,e){return lc.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){var t;let s=r.getVersionRange(e);if(s.contains(lc.SCHEMA_VERSION))return e;if(s.isGreaterThan(lc.SCHEMA_VERSION))return null;let a=s.to;if(a<2){let o=i.storage.get("businessRef"),u=(t=i.storage.get("uniqueId"))!==null&&t!==void 0?t:r.getOrNull(e,"eventId");if(o==null||u==null)return null;e.businessRef=o.encode(),e.uniqueId=u,a=2}if(a<3&&(e.creationDate=e.scanDate,a=3),a<4&&(a=4),a<5){let o=r.get(e,"scannerId"),u=i.decodeDate(r.get(e,"scanDate"));e.scans=[{scannerId:o,scanDate:i.encodeDate(u),status:m(En.Scanned)}],a=5}return e.$schema_version=D.encodedExactly(a),e}},RP=(function(n){return n.Live="LIVE",n.Archived="ARCHIVED",n})(RP||{}),dc=(()=>{class n extends zt(b){constructor(e,t,s,a,o,u,c,l){super(),this.status=e,this.uniqueId=t,this.businessRef=s,this.creationDate=a,this.price=o,this.protocol=u,this.components=c,this.variations=l}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(2,n.SCHEMA_VERSION)}static fromMap(e,t){return new n(y(r.get(t,"$status"),RP),r.get(t,"uniqueId"),j.mustDecode(r.get(t,"businessRef")),e.decodeDate(r.get(t,"creationDate")),Y.decode(r.get(t,"price")),e.fromData(r.get(t,"protocol")),ae.deserialize(e,r.get(t,"components")),r.getList(t,"variations",s=>e.fromData(s)))}toMap(e){return{$status:m(this.status),uniqueId:this.uniqueId,businessRef:this.businessRef.encode(),creationDate:e.encodeDate(this.creationDate),price:this.price.encode(),protocol:e.toData(this.protocol),protocolType:m(this.protocol.type),components:this.components.serialize(e),variations:this.variations.map(t=>e.toData(t))}}clone(){return new n(this.status,this.uniqueId,this.businessRef.clone(),g.cloneDate(this.creationDate),this.price.clone(),F(this.protocol),this.components.clone(),this.variations.map(e=>e.clone()))}isSame(e){return e===this?!0:e.status===this.status&&e.uniqueId===this.uniqueId&&e.creationDate===this.creationDate&&P(e.variations,this.variations,d)&&d(e.businessRef,this.businessRef)&&d(e.price,this.price)&&d(e.protocol,this.protocol)&&d(e.components,this.components)}copyWith(e){var t,s,a,o,u,c,l,h;return new n((t=e.status)!==null&&t!==void 0?t:this.status,(s=e.uniqueId)!==null&&s!==void 0?s:this.uniqueId,(a=e.businessRef)!==null&&a!==void 0?a:this.businessRef.clone(),(o=e.creationDate)!==null&&o!==void 0?o:g.cloneDate(this.creationDate),(u=e.price)!==null&&u!==void 0?u:this.price.clone(),(c=e.protocol)!==null&&c!==void 0?c:F(this.protocol),(l=e.components)!==null&&l!==void 0?l:this.components.clone(),(h=e.variations)!==null&&h!==void 0?h:this.variations.map(p=>p.clone()))}findVariationById(e){for(let t=0;t<this.variations.length;t++)if(this.variations[t].uniqueId==e)return this.variations[t];return null}static encodedStatusSafe(e){return m(e)}}return n.TYPE_ID="18346d4a68be4a788bd4deecbf50b717",n.SCHEMA_VERSION=3,n})(),Qv=class extends f{build(i,e){return dc.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(dc.SCHEMA_VERSION))return e;if(t.isGreaterThan(dc.SCHEMA_VERSION))return null;let s=t.to;if(s<2){let a=Ss.convertFromLegacyEventList(r.getList(e,"events",o=>K.decodeString(o)));e.protocol=i.toData(ns.create({events:a,maxEventCount:dt.undefined()})),s=2}return s<3&&(s=3),e.$schema_version=D.encodedExactly(s),e}},MP=(()=>{class n extends b{constructor(e,t){super(),this.businessRef=e,this.soldPasses=t}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.businessRef,e.soldPasses)}static empty(e){return this.create({businessRef:e,soldPasses:new Map})}static fromMap(e,t){return new n(j.mustDecode(r.get(t,"businessRef")),r.getMap(t,"soldPasses",(s,a)=>({key:s,value:Number(a)})))}toMap(e){return{businessRef:this.businessRef.encode(),soldPasses:se(this.soldPasses,(t,s)=>({key:t,value:s}))}}clone(){return new n(this.businessRef.clone(),ee(this.soldPasses,e=>e))}isSame(e){return e===this?!0:re(e.soldPasses,this.soldPasses,(t,s)=>t===s)&&d(e.businessRef,this.businessRef)}getSoldPassCount(e){var t;return(t=this.soldPasses.get(e))!==null&&t!==void 0?t:0}onPassSold(e){let t=e.templateId,s=this.getSoldPassCount(t);this.soldPasses.set(t,s+1)}onPassCancelled(e){let t=e.templateId,s=this.getSoldPassCount(t);this.soldPasses.set(t,s-1)}}return n.TYPE_ID="67eb164872284979a6b47108c696337e",n})(),ey=class extends f{build(i,e){return MP.fromMap(i,e)}},hc=(()=>{class n extends b{constructor(e,t,s,a,o,u,c,l,h,p){super(),this.uniqueId=e,this.creationDate=t,this.entryTime=s,this.passId=a,this.passName=o,this.customer=u,this.passExpirationDate=c,this.passUses=l,this.scanValidity=h,this.isInside=p,this.expirationDate=h!=null?s.add(h):null}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static inside(e){return new n(e.uniqueId,e.creationDate,e.entryTime,e.passId,e.passName,e.customer,e.passExpirationDate,e.passUses,e.scanValidity,!0)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),e.decodeDate(r.get(t,"creationDate")),e.decodeDate(r.get(t,"entryTime")),r.get(t,"passId"),e.fromData(r.get(t,"passName")),e.fromDataOrNull(r.getOrNull(t,"customer")),e.decodeDateOrNull(r.getOrNull(t,"passExpirationDate")),r.getOrNull(t,"passUses"),e.decodeDurationOrNull(r.getOrNull(t,"scanValidity")),r.get(t,"isInside"))}toMap(e){return{uniqueId:this.uniqueId,creationDate:e.encodeDate(this.creationDate),entryTime:e.encodeDate(this.entryTime),passId:this.passId,passName:e.toData(this.passName),customer:e.toDataOrNull(this.customer),passExpirationDate:e.encodeDateOrNull(this.passExpirationDate),passUses:this.passUses,scanValidity:e.encodeDurationOrNull(this.scanValidity),isInside:this.isInside}}clone(){return new n(this.uniqueId,g.cloneDate(this.creationDate),g.cloneDate(this.entryTime),this.passId,this.passName.clone(),Z(this.customer),g.cloneDateOrNull(this.passExpirationDate),this.passUses,g.cloneDurationOrNull(this.scanValidity),this.isInside)}isSame(e){return e===this?!0:e.creationDate==this.creationDate&&e.entryTime==this.entryTime&&d(e.passName,this.passName)&&d(e.customer,this.customer)&&e.passExpirationDate===this.passExpirationDate&&e.passUses===this.passUses&&e.scanValidity==this.scanValidity&&e.passId===this.passId&&e.uniqueId===this.uniqueId&&e.isInside===this.isInside}copyWithState(e){return new n(this.uniqueId,g.cloneDate(this.creationDate),g.cloneDate(this.entryTime),this.passId,this.passName.clone(),Z(this.customer),g.cloneDateOrNull(this.passExpirationDate),this.passUses,g.cloneDurationOrNull(this.scanValidity),e)}}return n.TYPE_ID="c6cd741873774b00affc9b6c13cabc92",n.SCHEMA_VERSION=2,n})(),ty=class extends f{build(i,e){return hc.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(hc.SCHEMA_VERSION))return e;if(t.isGreaterThan(hc.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(s=2),e.$schema_version=D.encodedExactly(s),e}},ny=(function(n){return n.Pending="PENDING",n.Completed="COMPLETED",n})(ny||{}),NP=(()=>{class n extends b{constructor(e,t,s,a,o,u){super(),this.uniqueId=e,this.orderId=t,this.pass=s,this.creationDate=a,this.renewalDate=o,this.status=u}get $typeId(){return n.TYPE_ID}static fromPass(e){return new n(e.uniqueId,e.orderId,e.pass,e.creationDate,e.renew
3alDate,ny.Pending)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.get(t,"orderId"),e.fromData(r.get(t,"pass")),e.decodeDate(r.get(t,"creationDate")),e.decodeDate(r.get(t,"renewalDate")),y(r.get(t,"$status"),ny))}toMap(e){return{uniqueId:this.uniqueId,orderId:this.orderId,pass:e.toData(this.pass),passId:this.pass.uniqueId,passTemplateId:this.pass.templateId,businessRef:this.pass.businessRef.encode(),creationDate:e.encodeDate(this.creationDate),renewalDate:e.encodeDate(this.renewalDate),$status:m(this.status)}}clone(){return new n(this.uniqueId,this.orderId,this.pass.clone(),g.cloneDate(this.creationDate),g.cloneDate(this.renewalDate),this.status)}isSame(e){return this===e?!0:e.uniqueId===this.uniqueId&&e.orderId===this.orderId&&e.creationDate===this.creationDate&&e.renewalDate===this.renewalDate&&e.status===this.status&&d(e.pass,this.pass)}copyWith(e){var t,s,a,o,u,c;return new n((t=e.uniqueId)!==null&&t!==void 0?t:this.uniqueId,(s=e.orderId)!==null&&s!==void 0?s:this.orderId,(a=e.pass)!==null&&a!==void 0?a:this.pass.clone(),(o=e.creationDate)!==null&&o!==void 0?o:g.cloneDate(this.creationDate),(u=e.renewalDate)!==null&&u!==void 0?u:g.cloneDate(this.renewalDate),(c=e.status)!==null&&c!==void 0?c:this.status)}}return n.TYPE_ID="3712044a104d42ef8b333e0a111694b5",n})(),iy=class extends f{build(i,e){return NP.fromMap(i,e)}},PP=(()=>{class n extends b{constructor(e,t,s){super(),this.uniqueId=e,this.businessRef=t,this.creationDate=s}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.uniqueId,e.businessRef,fe.now())}static fromMap(e,t){return new n(r.get(t,"uniqueId"),j.mustDecode(r.get(t,"businessRef")),e.decodeDate(r.get(t,"creationDate")))}toMap(e){return{uniqueId:this.uniqueId,businessRef:this.businessRef.encode(),creationDate:e.encodeDate(this.creationDate)}}clone(){return new n(this.uniqueId,this.businessRef.clone(),g.cloneDate(this.creationDate))}isSame(e){return this===e?!0:this.uniqueId===e.uniqueId&&this.businessRef.isSame(e.businessRef)&&this.creationDate===e.creationDate}}return n.TYPE_ID="87cdd23c75cc4c18932757426dce6dbb",n})(),sy=class extends f{build(i,e){return PP.fromMap(i,e)}},_S=(()=>{class n extends b{constructor(e,t,s){super(),this.uniqueId=e,this.names=t,this.price=s}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.uniqueId,e.names,e.price)}static fromMap(e,t){return new n(r.getString(t,"uniqueId"),e.fromData(r.getRecord(t,"names")),Y.decode(r.getString(t,"price")))}toMap(e){return{uniqueId:this.uniqueId,names:e.toData(this.names),price:this.price.encode()}}clone(){return new n(this.uniqueId,this.names.clone(),this.price.clone())}isSame(e){return e===this?!0:d(e.names,this.names)&&d(e.price,this.price)&&e.uniqueId===this.uniqueId}}return n.TYPE_ID="1a732f1abe754f85a0a3d492fee364f8",n})(),ry=class extends f{build(i,e){return _S.fromMap(i,e)}},fc=(()=>{class n extends b{constructor(e,t,s,a){super(),this.uniqueId=e,this.names=t,this.price=s,this.printedCardCover=a}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static create(e){return new n(e.uniqueId,e.names,e.price,e.printedCardCover)}static fromMap(e,t){return new n(r.getString(t,"uniqueId"),e.fromData(r.getRecord(t,"names")),Y.decode(r.getString(t,"price")),e.fromDataOrNull(r.getRecordOrNull(t,"printedCardCover")))}toMap(e){return{uniqueId:this.uniqueId,names:e.toData(this.names),price:this.price.encode(),printedCardCover:e.toDataOrNull(this.printedCardCover)}}clone(){var e,t;return new n(this.uniqueId,this.names.clone(),this.price.clone(),(t=(e=this.printedCardCover)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null)}isSame(e){return e===this?!0:d(e.names,this.names)&&d(e.price,this.price)&&e.uniqueId===this.uniqueId&&d(e.printedCardCover,this.printedCardCover)}copyWith(e){var t,s,a,o,u,c;return new n((t=e.uniqueId)!==null&&t!==void 0?t:this.uniqueId,(s=e.names)!==null&&s!==void 0?s:this.names.clone(),(a=e.price)!==null&&a!==void 0?a:this.price.clone(),(o=e.printedCardCover)!==null&&o!==void 0?o:(c=(u=this.printedCardCover)===null||u===void 0?void 0:u.clone())!==null&&c!==void 0?c:null)}
3toDetails(){return _S.create({uniqueId:this.uniqueId,names:this.names.clone(),price:this.price.clone()})}}return n.TYPE_ID="019a6c69350d4163b5e1f12b69871bdc",n.SCHEMA_VERSION=3,n})(),ay=class extends f{build(i,e){return fc.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(fc.SCHEMA_VERSION))return e;if(t.isGreaterThan(fc.SCHEMA_VERSION))return null;let s=t.to;if(s<2){let a=r.getString(e,"price").toLowerCase().replaceAll(":","_");e.uniqueId=a,s=2}return s<3&&(s=3),e.$schema_version=D.encodedExactly(s),e}},Sr=class{constructor(i){this.$key=i}};Sr.KEY_EMPTY="_EMPTY_";Sr.empty=new Sr(Sr.KEY_EMPTY);var pc=(()=>{class n extends Vt{constructor(e){super(),this.qrPrefix=e,this.effectType=sn.GenerateProductQr}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static create(e){return new n(e.qrPrefix)}static fromMap(e,t){return n.create({qrPrefix:r.getStringOrNull(t,"qrPrefix")})}toMap(e){return{effectType:m(this.effectType),qrPrefix:this.qrPrefix}}clone(){return n.create({qrPrefix:this.qrPrefix})}isSame(e){return this===e?!0:e.effectType===this.effectType&&e.qrPrefix===this.qrPrefix}toLegacyOrderHook(){return null}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="e3b596f7dc374967af57e41f433fe6bb",n.SCHEMA_VERSION=2,n})(),oy=class extends f{build(i,e){return pc.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(pc.SCHEMA_VERSION))return e;if(t.isGreaterThan(pc.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(s=2),e.$schema_version=D.encodedExactly(s),e}},AP=(()=>{class n extends Vt{constructor(){super(),this.effectType=sn.GenerateProductPdf}get $typeId(){return n.TYPE_ID}static create(){return new n}static fromMap(e,t){return new n}toMap(e){return{effectType:m(this.effectType)}}clone(){return new n}isSame(e){return this===e?!0:e.effectType===this.effectType}toLegacyOrderHook(){return null}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="059081bb153c4a7587c73ae2bc6dda32",n})(),uy=class extends f{build(i,e){return AP.fromMap(i,e)}},CP=(function(n){return n.GenericProduct="GenericProduct",n})(CP||{}),cy=class extends b{},kP=(()=>{class n extends cy{constructor(e,t,s,a,o,u,c,l){super(),this.uniqueId=e,this.scanCode=t,this.creationDate=s,this.businessRef=a,this.eventId=o,this.orderId=u,this.productItemIndex=c,this.productInstance=l,this.type=CP.GenericProduct}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.uniqueId,e.scanCode,e.creationDate,e.businessRef,e.eventId,e.orderId,e.productItemIndex,e.productInstance)}static fromMap(e,t){return n.create({uniqueId:r.getString(t,"uniqueId"),scanCode:r.getString(t,"scanCode"),creationDate:e.decodeDate(r.getInteger(t,"creationDate")),businessRef:j.mustDecode(r.getString(t,"businessRef")),eventId:r.getString(t,"eventId"),orderId:r.getString(t,"orderId"),productItemIndex:r.getInteger(t,"productItemIndex"),productInstance:r.getInteger(t,"productInstance")})}toMap(e){return{uniqueId:this.uniqueId,scanCode:this.scanCode,creationDate:e.encodeDate(this.creationDate),businessRef:this.businessRef.encode(),eventId:this.eventId,orderId:this.orderId,type:m(this.type),productItemIndex:this.productItemIndex,productInstance:this.productInstance}}clone(){return this.copyWith()}copyWith({uniqueId:e=this.uniqueId,scanCode:t=this.scanCode,creationDate:s=g.cloneDate(this.creationDate),businessRef:a=F(this.businessRef),eventId:o=this.eventId,orderId:u=this.orderId,productItemIndex:c=this.productItemIndex,productInstance:l=this.productInstance}={}){return n.create({uniqueId:e,scanCode:t,creationDate:s,businessRef:a,eventId:o,orderId:u,productItemIndex:c,productInstance:l})}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.scanCode===this.scanCode&&e.creationDate===this.creationDate&&d(e.businessRef,this.businessRef)&&e.eventId===this.eventId&&e.orderId===this.orderId&&e.type===this.type&&e.productItemIndex===this.productItemIndex&&e.productInstance===this.productInstance}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="d1e595ea0bf7eb56b12709f105819ffa",n})(),ly=class extends f{build(i,e){return kP.fromMap(i,e)}},dy=class extends b{},_P=(function(n){return n.OkeokeProducts="OkeokeProducts",n})(_P||{}),xP=(()=>{class n extends dy{constructor(){super(),this.strategy=_P.OkeokeProducts}get $typeId(){return n.TYPE_ID}static create(){return new n}static fromMap(e,t){return new n}toMap(e){return{strategy:m(this.strategy)}}clone(){return new n}isSame(e){return this===e?!0:e.strategy===this.strategy}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="48d176b449d447a5ad3eeb2214a0322b",n})(),hy=class extends f{build(i,e){return xP.fromMap(i,e)}},FP=(()=>{class n extends Vt{constructor(e){super(),this.protocol=e,this.effectType=sn.OutboundWebhook}get $typeId(){return n.TYPE_ID}static create({protocol:e}){return new n(e)}static fromMap(e,t){return new n(e.fromData(r.getRecord(t,"protocol")))}toMap(e){return{effectType:m(this.effectType),protocol:e.toData(this.protocol)}}clone(){return new n(F(this.protocol))}isSame(e){return this===e?!0:e.effectType===this.effectType&&d(e.protocol,this.protocol)}toLegacyOrderHook(){return null}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="eb22829474e74e3dace2ffce61ad7bf7",n})(),fy=class extends f{build(i,e){return FP.fromMap(i,e)}},qP=(()=>{class n extends b{constructor(e,t){super(),this.uniqueId=e,this.businessRef=t}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.uniqueId,e.businessRef)}static fromMap(e,t){return n.create({uniqueId:r.getString(t,"uniqueId"),businessRef:j.mustDecode(r.getString(t,"businessRef"))})}toMap(e){return{uniqueId:this.uniqueId,businessRef:this.businessRef.encode()}}clone(){return this.copyWith()}copyWith({uniqueId:e=this.uniqueId,businessRef:t=F(this.businessRef)}={}){return n.create({uniqueId:e,businessRef:t})}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&d(e.businessRef,this.businessRef)}}return n.TYPE_ID="da5ead9125bd4036a12750a045b58954",n})(),py=class extends f{build(i,e){return qP.fromMap(i,e)}},Oa=(()=>{class n extends b{constructor(e,t,s,a,o,u,c,l){super(),this.historicMonumentTax=e,this.theaterTax=t,this.amountsDonatedForHumanitarianPurposes=s,this.entertainmentTax=a,this.show
3FeeOnReport=o,this.passUsageCalculationMode=u,this.hideExtraProducts=c,this.allowServerSideReports=l}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}static empty(){return new n(null,null,null,null,!1,Ti.VoucherValue,!1,!1)}static fromMap(e,t){return new n(r.getDoubleOrNull(t,"historicMonumentTax"),r.getDoubleOrNull(t,"theaterTax"),r.getDoubleOrNull(t,"amountsDonatedForHumanitarianPurposes"),r.getDoubleOrNull(t,"entertainmentTax"),r.getBoolean(t,"showFeeOnReport"),y(r.getString(t,"passUsageCalculationMode"),Ti),r.getBoolean(t,"hideExtraProducts"),r.getBoolean(t,"allowServerSideReports"))}toMap(e){return{historicMonumentTax:this.historicMonumentTax,theaterTax:this.theaterTax,amountsDonatedForHumanitarianPurposes:this.amountsDonatedForHumanitarianPurposes,entertainmentTax:this.entertainmentTax,showFeeOnReport:this.showFeeOnReport,passUsageCalculationMode:m(this.passUsageCalculationMode),hideExtraProducts:this.hideExtraProducts,allowServerSideReports:this.allowServerSideReports}}clone(){return new n(this.historicMonumentTax,this.theaterTax,this.amountsDonatedForHumanitarianPurposes,this.entertainmentTax,this.showFeeOnReport,this.passUsageCalculationMode,this.hideExtraProducts,this.allowServerSideReports)}isSame(e){return e===this?!0:e.historicMonumentTax===this.historicMonumentTax&&e.theaterTax===this.theaterTax&&e.amountsDonatedForHumanitarianPurposes===this.amountsDonatedForHumanitarianPurposes&&e.entertainmentTax===this.entertainmentTax&&e.showFeeOnReport===this.showFeeOnReport&&e.passUsageCalculationMode===this.passUsageCalculationMode&&e.hideExtraProducts===this.hideExtraProducts&&e.allowServerSideReports===this.allowServerSideReports}}return n.TYPE_ID="f73b446876024af793a6fbc7b552ddba",n.SCHEMA_VERSION=6,n})(),gy=class extends f{build(i,e){return Oa.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){var t,s,a,o,u;let c=r.getVersionRange(e);if(c.contains(Oa.SCHEMA_VERSION))return e;if(c.isGreaterThan(Oa.SCHEMA_VERSION))return null;let l=c.to;if(l<2&&((t=e.showFeeOnReport)!==null&&t!==void 0||(e.showFeeOnReport=!1),l=2),l<3&&((s=e.hidePassUsages)!==null&&s!==void 0||(e.hidePassUsages=!1),l=3),l<4&&((a=e.hideExtraProducts)!==null&&a!==void 0||(e.hideExtraProducts=!1),l=4),l<5&&((o=e.allowServerSideReports)!==null&&o!==void 0||(e.allowServerSideReports=!1),l=5),l<6){let h=r.getBoolean(e,"hidePassUsages");(u=e.passUsageCalculationMode)!==null&&u!==void 0||(e.passUsageCalculationMode=m(h?Ti.Hidden:Ti.VoucherValue)),l=6}return e.$schema_version=D.encodedExactly(l),e}migrateFromCurrentSchemaVersion(i,e,t){var s;let a=(s=e.$schemaVersion.to)!==null&&s!==void 0?s:Oa.SCHEMA_VERSION;if(a>=6){let o;switch(e.passUsageCalculationMode){case Ti.VoucherValue:o=!1;break;case Ti.ZeroPrice:o=!1;break;case Ti.Hidden:o=!0;break}t.hidePassUsages=o,t.$schema_version=D.encodedBetween(1,6),a=1}return t}},Ra=(function(n){return n.Pending="PENDING",n.Completed="COMPLETED",n})(Ra||{}),YP=(()=>{class n extends b{constructor(e,t,s,a,o){super(),this.uniqueId=e,this.status=t,this.order=s,this.creationDate=a,this.completionDate=o}get $typeId(){return n.TYPE_ID}get creatorId(){return this.order.creatorId}get userId(){return this.order.userId}get isGuestOrder(){return this.order.isGuestOrder}get businessRef(){return this.order.businessRef}get eventId(){return je.assertType(this.order)||We.assertType(this.order)?this.order.eventId:null}static create(e){return new n(e.uniqueId,Ra.Pending,e.order,e.creationDate,null)}static fromOrder(e){return e.onlinePaymentDetails==null?null:new n(e.uniqueId,Ra.Pending,e.clone(),g.cloneDate(e.creationDate),null)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),y(r.get(t,"$status"),Ra),e.fromData(r.get(t,"order")),e.decodeDate(r.get(t,"creationDate")),e.decodeDateOrNull(r.getOrNull(t,"completionDate")))}toMap(e){return{uniqueId:this.uniqueId,orderId:this.order.uniqueId,creatorId:this.creatorId,userId:this.userId,eventId:this.eventId,isGuestOrder:this.isGuestOrder,order:e.toData(this.order),businessRef:this.businessRef.encode(),creationDate:e.encodeDate(this.creationDate),completionDate:e.encodeDateOrNull(this.completionDate),$status:m(this.status)}}clone(){return new n(this.uniqueId,this.status,this.order.clone(),g.cloneDate(this.creationDate),g.cloneDateOrNull(this.completionDate))}isSame(e){return this===e?!0:e.uniqueId===this.uniqueId&&e.creationDate===this.creationDate&&e.completionDate===this.completionDate&&e.status===this.status&&d(e.order,this.order)}copyAsComplete(e){return new n(this.uniqueId,Ra.Completed,this.order.clone(),g.cloneDate(this.creationDate),g.cloneDate(e))}}return n.TYPE_ID="76265ded706f460599615a968f4bed39",n})(),my=class extends f{build(i,e){return YP.fromMap(i,e)}},Ma=(function(n){return n.Pending="PENDING",n.Completed="COMPLETED",n})(Ma||{}),gc=(function(n){return n.Abort="ABORT",n.Complete="COMPLETE",n})(gc||{}),$P=(()=>{class n extends b{constructor(e,t,s,a,o,u){super(),this.uniqueId=e,this.status=t,this.mode=s,this.order=a,this.creationDate=o,this.completionDate=u}get $typeId(){return n.TYPE_ID}get creatorId(){return this.order.creatorId}get userId(){return this.order.userId}get isGuestOrder(){return this.order.isGuestOrder}get businessRef(){return this.order.businessRef}get eventId(){return je.assertType(this.order)||We.assertType(this.order)?this.order.eventId:null}static complete(e){return new n(e.uniqueId,Ma.Pending,gc.Complete,e.order,e.creationDate,
3null)}static abort(e){return new n(e.uniqueId,Ma.Pending,gc.Abort,e.order,e.creationDate,null)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),y(r.get(t,"$status"),Ma),y(r.get(t,"mode"),gc),e.fromData(r.get(t,"order")),e.decodeDate(r.get(t,"creationDate")),e.decodeDateOrNull(r.getOrNull(t,"completionDate")))}toMap(e){return{uniqueId:this.uniqueId,orderId:this.order.uniqueId,creatorId:this.creatorId,userId:this.userId,eventId:this.eventId,isGuestOrder:this.isGuestOrder,order:e.toData(this.order),businessRef:this.businessRef.encode(),creationDate:e.encodeDate(this.creationDate),completionDate:e.encodeDateOrNull(this.completionDate),$status:m(this.status),mode:m(this.mode)}}clone(){return new n(this.uniqueId,this.status,this.mode,this.order.clone(),g.cloneDate(this.creationDate),g.cloneDateOrNull(this.completionDate))}isSame(e){return this===e?!0:e.uniqueId===this.uniqueId&&e.creationDate===this.creationDate&&e.completionDate===this.completionDate&&e.status===this.status&&e.mode===this.mode&&d(e.order,this.order)}copyAsComplete(e){return new n(this.uniqueId,Ma.Completed,this.mode,this.order.clone(),g.cloneDate(this.creationDate),g.cloneDate(e))}}return n.TYPE_ID="1875f7ea3974427d9ebe83b1392b79b1",n})(),Iy=class extends f{build(i,e){return $P.fromMap(i,e)}},mc=(function(n){return n.Running="RUNNING",n.Idle="IDLE",n})(mc||{}),LP=(()=>{class n extends b{constructor(e,t,s,a,o,u){super(),this.uniqueId=e,this.creationDate=t,this.status=s,this.businessRef=a,this.eventId=o,this.numberOfRequestsPerBatch=u}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.get(t,"uniqueId"),e.decodeDate(r.get(t,"creationDate")),y(r.get(t,"$status"),mc),j.mustDecode(r.get(t,"businessRef")),r.get(t,"eventId"),r.getInteger(t,"numberOfRequestsPerBatch"))}toMap(e){return{uniqueId:this.uniqueId,creationDate:e.encodeDate(this.creationDate),$status:m(this.status),businessRef:this.businessRef.encode(),eventId:this.eventId,numberOfRequestsPerBatch:this.numberOfRequestsPerBatch}}clone(){return new n(this.uniqueId,g.cloneDate(this.creationDate),this.status,F(this.businessRef),this.eventId,this.numberOfRequestsPerBatch)}isSame(e){return this===e?!0:e.uniqueId===this.uniqueId&&e.creationDate===this.creationDate&&e.status===this.status&&d(e.businessRef,this.businessRef)&&e.eventId===this.eventId&&e.numberOfRequestsPerBatch===this.numberOfRequestsPerBatch}copyAsIdle(){return new n(this.uniqueId,g.cloneDate(this.creationDate),mc.Idle,F(this.businessRef),this.eventId,this.numberOfRequestsPerBatch)}copyAsRunning(e){return new n(this.uniqueId,g.cloneDate(this.creationDate),mc.Running,F(this.businessRef),this.eventId,e??this.numberOfRequestsPerBatch)}}return n.TYPE_ID="ede0c55225b34648b0b88ba905aba4cf",n})(),Dy=class extends f{build(i,e){return LP.fromMap(i,e)}},vy=(function(n){return n.Pending="PENDING",n.Completed="COMPLETED",n})(vy||{}),VP=(()=>{class n extends b{constructor(e,t,s,a,o,u,c,l){super(),this.uniqueId=e,this.schedulerTaskId=t,this.creationDate=s,this.status=a,this.businessRef=o,this.eventId=u,this.completionDate=c,this.requestIds=l}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.get(t,"schedulerTaskId"),e.decodeDate(r.get(t,"creationDate")),y(r.get(t,"$status"),vy),j.mustDecode(r.get(t,"businessRef")),r.get(t,"eventId"),e.decodeDateOrNull(r.getOrNull(t,"completionDate")),r.getList(t,"requestIds",s=>s))}toMap(e){return{uniqueId:this.uniqueId,schedulerTaskId:this.schedulerTaskId,creationDate:e.encodeDate(this.creationDate),$status:m(this.status),businessRef:this.businessRef.encode(),eventId:this.eventId,completionDate:e.encodeDateOrNull(this.completionDate),requestCount:this.requestIds.length,requestIds:this.requestIds}}clone(){return new n(this.uniqueId,this.schedulerTaskId,g.cloneDate(this.creationDate),this.status,F(this.businessRef),this.eventId,g.cloneDateOrNull(this.completionDate),Te(this.requestIds))}isSame(e){return this===e?!0:e.uniqueId===this.uniqueId&&e.schedulerTaskId===this.schedulerTaskId&&e.creationDate===this.creationDate&&e.status===this.status&&d(e.businessRef,this.businessRef)&&e.eventId===this.eventId&&e.completionDate===this.completionDate&&P(e.requestIds,this.requestIds)}copyAsComplete(e){return new n(this.uniqueId,this.schedulerTaskId,g.cloneDate(this.creationDate),vy.Completed,F(this.businessRef),this.eventId,e,Te(this.requestIds))}}return n.TYPE_ID="4a6bacdba6844f34906dba5b94a16a0e",n})(),yy=class extends f{build(i,e){return VP.fromMap(i,e)}},le=(function(n){return n.InTime="InTime",n.InTimeWeb="InTimeWeb",n.InTimeCloud="InTimeCloud",n.InT
3imeBusiness="InTimeBusiness",n.InTimeReception="InTimeReception",n.InTimeBusinessWeb="InTimeBusinessWeb",n.InTimePaymentService="InTimePaymentService",n.InTimeScanner="InTimeScanner",n})(le||{}),Le=class extends b{},tt=class extends Le{},zP=(()=>{class n extends Le{constructor(e,t,s,a,o,u){super(),this.uniqueId=e,this.creatorId=t,this.deviceId=s,this.creationDate=a,this.source=o,this.order=u}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.uniqueId,e.creatorId,e.deviceId,e.creationDate,e.source,e.order)}static fromMap(e,t){return new n(r.getString(t,"uniqueId"),r.getStringOrNull(t,"creatorId"),r.getStringOrNull(t,"deviceId"),e.decodeDate(r.getNumber(t,"creationDate")),y(r.getString(t,"source"),le),e.fromData(r.get(t,"order")))}toMap(e){return{uniqueId:this.uniqueId,creatorId:this.creatorId,deviceId:this.deviceId,creationDate:e.encodeDate(this.creationDate),source:m(this.source),order:e.toData(this.order),orderId:this.order.uniqueId}}clone(){return new n(this.uniqueId,this.creatorId,this.deviceId,this.creationDate,this.source,this.order)}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.creatorId===this.creatorId&&e.deviceId===this.deviceId&&e.creationDate===this.creationDate&&e.source===this.source&&d(e.order,this.order)}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="070333760bfe4b71a8f97eec3d96205c",n})(),by=class extends f{build(i,e){return zP.fromMap(i,e)}},UP=(()=>{class n extends b{constructor(e){super(),this.permissions=e}get $typeId(){return n.TYPE_ID}has(e){return this.permissions.get(e.uniqueId)===!0}static fromMap(e,t){return new n(r.getMap(t,"permissions",(s,a)=>({key:s,value:a})))}toMap(e){return{permissions:se(this.permissions,(t,s)=>({key:t,value:s}))}}clone(){return new n(ee(this.permissions))}isSame(e){return this===e?!0:re(e.permissions,this.permissions)}}return n.TYPE_ID="22ce46893a08497b89aa141301598062",n})(),Ey=class extends f{build(i,e){return UP.fromMap(i,e)}},Ai=(function(n){return n.Live="LIVE",n.Archived="ARCHIVED",n})(Ai||{}),Oo=class extends b{static encodedStatusSafe(i){return m(i)}hasComponentByTypeId(i){return this.components.hasComponentByTypeId(i)}mustFindComponentByTypeId(i){return this.components.mustFindComponentByTypeId(i)}findComponentByTypeId(i){return this.components.findComponentByTypeId(i)}findComponentByInstanceId(i){return this.components.findComponentByInstanceId(i)}findComponentsByTypeId(i){return this.components.findComponentsByTypeId(i)}addComponent(i){this.components.addComponent(i)}addComponents(i){this.components.addComponents(i)}removeComponentByTypeId(i){return this.components.removeComponentByTypeId(i)}removeComponentByInstanceId(i){return this.components.removeComponentByInstanceId(i)}removeComponentAt(i){this.components.removeComponentAt(i)}removeAllComponents(){this.components.removeAllComponents()}popAllComponentsByTypeId(i){return this.components.popAllComponentsByTypeId(i)}popComponentByTypeId(i){return this.components.popComponentByTypeId(i)}popComponent(i){return this.components.popComponent(i)}replaceComponent(i){return this.components.replaceComponent(i)}addOrReplaceComponent(i){this.components.addOrReplaceComponent(i)}mustFindComponentField(i,e){return this.components.mustFindComponentField(i,e)}findComponentField(i,e){return this.components.findComponentField(i,e)}},Qt=(function(n){return n[n.Administrator=0]="Administrator",n[n.Employee=1]="Employee",n[n.Developer=2]="Developer",n[n.Collaborator=3]="Collaborator",n})(Qt||{}),Ic=(()=>{class n extends Oo{constructor(e,t,s,a,o,u,c,l,h,p,I){super(),this.uniqueId=e,this.businessRef=t,this.firstName=s,this.lastName=a,this.phoneNumber=o,this.photo=u,this.userId=c,this.pushNotificationToken=l,this.email=h,this.status=p,this.components=I,this.partnerRole=Qt.Collaborator,this.formattedName=fi(s,a),this.initials=pi(s,a)}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static create(e){return new n(e.uniqueId,e.businessRef,e.firstName,e.lastName,e.phoneNumber,e.photo,e.userId,e.pushNotificationToken,e.email,e.status,e.components)}static fromMap(e,t){return new n(r.getString(t,"uniqueId"),j.mustDecode(r.getString(t,"businessRef")),r.getString(t,"firstName"),r.getString(t,"lastName"),ft.mustDecode(r.getString(t,"phoneNumber")),e.fromDataOrNull(r.getRecordOrNull(t,"photo")),r.getStringOrNull(t,"userId"),r.getStringOrNull(t,"pushNotificationToken"),r.getStringOrNull(t,"email"),y(r.getString(t,"$status"),Ai),ae.deserialize(e,r.getRaw(t,"components")))}toMap(e){return{uniqueId:this.uniqueId,businessRef:this.businessRef.encode(),firstName:this.firstName,lastName:this.lastName,phoneNumber:this.phoneNumber.encode(),photo:e.toDataOrNull(this.photo),userId:this.userId,pushNotificationToken:this.pushNotificationToken,email:this.email,partnerRole:xn(this.partnerRole),$status:m(this.status),components:this.components.serialize(e)}}clone(){return this.copyWith()}copyWith({uniqueId:e=this.uniqueId,businessRef:t=F(this.businessRef),firstName:s=this.firstName,lastName:a=this.lastName,phoneNumber:o=F(this.phoneNumber),photo:u=Z(this.photo),userId:c=this.userId,pushNotificationToken:l=this.pushNotificationToken,email:h=this.email,status:p=this.status,components:I=F(this.components)}={}){return new n(e,t,s,a,o,u,c,l,h,p,I)}isSame(e){return this===e?!0:e.uniqueId===this.uniqueId&&e.businessRef===this.businessRef&&e.firstName===this.firstName&&e.lastName===this.lastName&&d(e.phoneNumber,this.phoneNumber)&&d(e.photo,this.photo)&&e.userId===this.userId&&e.pushNotificationToken===this.pushNotificationToken&&e.email===this.email&&e.status===this.status&&e.components.isSame(this.components)}}return n.TYPE_ID="b8cbbe732fda4a5b89fb3eec12190424",n.SCHEMA_VERSION=2,n})(),wy=class extends f{build(i,e){return Ic.fromMap(i,e)}optimizeForQuery(i,e){return{formattedName:e.formattedName}}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(Ic.SCHEMA_VERSION))return e;if(t.isGreaterThan(Ic.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(r.setIfNullOrUndefined(e,"$status",m(Ai.Live)),s=2),e.$schema_version=D.encodedExactly(s),e}},wi=(function(n){return n.Calendar="calendar",n.Ticket="ticket",n.TicketTracker="ticket-tracker",n.Pool="pool",n.PointOfInterest="poi",n.Promoter="promoter",n.Gym="gym",n.TicketBooking="ticket-booking",n})(wi||{});function Xx(n){switch(n){case st.Legacy:case st.Calendar:return wi.Calendar;case st.Ticket:return wi.Ticket;case st.Pool:return wi.Pool;case st.PointOfInterest:return wi.PointOfInterest;case st.Gym:return wi.Gym;case st.TicketBooking:return wi.TicketBooking}}var BP=(()=>{class n extends b{constructor(e,t,s){super(),this.businessRef=e,this.eventId=t,this.priceModifiers=s}get $typeId(){return n.TYPE_ID}static empty(e,t){return new n(e,t,new Map)}static fromMap(e,t){return new n(j.mustDecode(r.get(t,"businessRef")),r.get(t,"eventId"),r.getMap(t,"priceModifiers",(s,a)=>({key:s,value:Y.decode(a)})))}toMap(e){return{businessRef:this.businessRef.encode(),eventId:this.eventId,priceModifiers:se(this.priceModifiers,(t,s)=>({key:t,value:s.encode()}))}}clone(){return new n(this.businessRef.clone(),this.eventId,ee(this.priceModifiers,e=>e.clone()))}isSame(e){return this===e?!0:re(e.priceModifiers,this.priceModifiers,d)&&d(e.businessRef,this.businessRef)&&e.eventId===this.eventId}scaleTicketPrice(e,t){let s=this.priceModifiers.get(e);return _(s)?t.add(s):t}}return n.TYPE_ID="d4fe2ff26d774a22b382e7d395e33b91",n})(),Sy=class extends f{build(i,e){return BP.fromMap(i,e)}},HP=(()=>{class n extends Le{constructor(e,t,s,a,o,u){super(),this.uniqueId=e,this.creatorId=t,this.deviceId=s,this.creationDate=a,this.source=o,this.order=u}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.uniqueId,e.creatorId,e.deviceId,e.creationDate,e.source,e.order)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.getOrNull(t,"creatorId"),r.getOrNull(t,"deviceId"),e.decodeDate(r.get(t,"creationDate")),y(r.get(t,"source"),le),e.fromData(r.get(t,"order")))}toMap(e){return{uniqueId:this.uniqueId,creatorId:this.creatorId,deviceId:this.deviceId,creationDate:e.encodeDate(this.creationDate),source:m(this.source),orderId:this.order.uniqueId,order:e.toData(this.order)}}clone(){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,this.order.clone())}isSame(e){return this===e?!0:e.uniqueId===this.uniqueId&&e.creatorId===this.creatorId&&e.deviceId===this.deviceId&&e.creationDate===this.creationDate&&e.source===this.source&&d(e.order,this.order)}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="00562d086e4f40a9852e9de39d83fa3f",n})(),Ty=class extends f{build(i,e){return HP.fromMap(i,e)}},GP=(()=>{class n extends Le{constructor(e,t,s,a,o,u){super(),this.uniqueId=e,this.creatorId=t,this.deviceId=s,this.creationDate=a,this.source=o,this.order=u}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.uniqueId,e.creatorId,e.deviceId,e.creationDate,e.source,e.order)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.getOrNull(t,"creatorId"),r.getOrNull(t,"deviceId"),e.decodeDate(r.get(t,"creationDate")),y(r.get(t,"source"),le),e.fromData(r.get(t,"order")))}toMap(e){return{uniqueId:this.uniqueId,creatorId:this.creatorId,deviceId:this.deviceId,creationDate:e.encodeDate(this.creationDate),source:m(this.source),orderId:this.order.uniqueId,order:e.toData(this.order)}}clone(){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,this.order.clone())}isSame(e){return this===e?!0:e.uniqueId===this.uniqueId&&e.creatorId===this.creatorId&&e.deviceId===this.deviceId&&e.creationDate===this.creationDate&&e.source===this.source&&d(e.order,this.order)}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}
3return n.TYPE_ID="84039e1ef2ea45ccb1890e0ec41261bd",n})(),Oy=class extends f{build(i,e){return GP.fromMap(i,e)}},WP=(()=>{class n extends Le{constructor(e,t,s,a,o,u){super(),this.uniqueId=e,this.creatorId=t,this.deviceId=s,this.creationDate=a,this.source=o,this.order=u}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.uniqueId,e.creatorId,e.deviceId,e.creationDate,e.source,e.order)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.getOrNull(t,"creatorId"),r.getOrNull(t,"deviceId"),e.decodeDate(r.get(t,"creationDate")),y(r.get(t,"source"),le),e.fromData(r.get(t,"order")))}toMap(e){return{uniqueId:this.uniqueId,creatorId:this.creatorId,deviceId:this.deviceId,creationDate:e.encodeDate(this.creationDate),source:m(this.source),orderId:this.order.uniqueId,order:e.toData(this.order)}}clone(){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,this.order.clone())}isSame(e){return this===e?!0:e.uniqueId===this.uniqueId&&e.creatorId===this.creatorId&&e.deviceId===this.deviceId&&e.creationDate===this.creationDate&&e.source===this.source&&d(e.order,this.order)}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="a78e3b8f63ee4e9f99505ff727f8a2a2",n})(),Ry=class extends f{build(i,e){return WP.fromMap(i,e)}},jP=(()=>{class n extends Le{constructor(e,t,s,a,o,u){super(),this.uniqueId=e,this.creatorId=t,this.deviceId=s,this.creationDate=a,this.source=o,this.order=u}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.getOrNull(t,"creatorId"),r.getOrNull(t,"deviceId"),e.decodeDate(r.get(t,"creationDate")),y(r.get(t,"source"),le),e.fromData(r.get(t,"order")))}toMap(e){return{uniqueId:this.uniqueId,creatorId:this.creatorId,deviceId:this.deviceId,creationDate:e.encodeDate(this.creationDate),source:m(this.source),orderId:this.order.uniqueId,order:e.toData(this.order)}}clone(){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,this.order.clone())}isSame(e){return this===e?!0:e.uniqueId===this.uniqueId&&e.creatorId===this.creatorId&&e.deviceId===this.deviceId&&e.creationDate===this.creationDate&&e.source===this.source&&d(e.order,this.order)}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="c5f7471d926a4321969bce395cbbcdb6",n})(),My=class extends f{build(i,e){return jP.fromMap(i,e)}},gd=class extends b{},JP=(()=>{class n extends gd{constructor(e,t,s,a,o,u,c){super(),this.uniqueId=e,this.businessRef=t,this.orderId=s,this.promoCode=a,this.creationDate=o,this.product=u,this.customer=c}get $typeId(){return n.TYPE_ID}static fromProductOfOrder(e,t){return new n(Ft(),e.businessRef.clone(),e.uniqueId,n.generatePromoCode(),fe.now(),t.clone(),e.customer.clone())}static fromOrder(e,t){return new n(Ft(),e.businessRef.clone(),e.uniqueId,n.generatePromoCode(),fe.now(),e.items[t].product.clone(),e.customer.clone())}static fromMap(e,t){return new n(r.get(t,"uniqueId"),j.mustDecode(r.get(t,"businessRef")),r.get(t,"orderId"),r.get(t,"promoCode"),e.decodeDate(r.get(t,"creationDate")),e.fromData(r.get(t,"product")),e.fromData(r.get(t,"customer")))}toMap(e){return{uniqueId:this.uniqueId,businessRef:this.businessRef.encode(),orderId:this.orderId,promoCode:this.promoCode,creationDate:e.encodeDate(this.creationDate),product:e.toData(this.product),productId:this.product.uniqueId,customer:e.toData(this.customer),customerId:this.customer.uniqueId}}clone(){return new n(this.uniqueId,this.businessRef.clone(),this.orderId,this.promoCode,g.cloneDate(this.creationDate),this.product.clone(),this.customer.clone())}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.orderId===this.orderId&&e.promoCode===this.promoCode&&e.creationDate===this.creationDate&&d(e.businessRef,this.businessRef)&&d(e.product,this.product)&&d(e.customer,this.customer)}static generatePromoCode(){let e=Ft({length:15,alphabet:"UC_LETTERS_DIGITS"});return`GC-${e.substring(0,5)}-${e.substring(5,10)}-${e.substring(10,e.length)}`}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="3e87432897a44e3581a3a2c084e9ad64",n})(),Ny=class extends f{build(i,e){return JP.fromMap(i,e)}},KP=(()=>{class n extends gd{constructor(e,t,s,a,o,u,c){super(),this.uniqueId=e,this.businessRef=t,this.orderId=s,this.promoCode=a,this.creationDate=o,this.product=u,this.customer=c}get $typeId(){return n.TYPE_ID}static fromProductOfOrder(e,t){return new n(Ft(),e.businessRef.clone(),e.uniqueId,n.generatePromoCode(),fe.now(),t.clone(),e.customer.clone())}static fromOrder(e,t){return new n(Ft(),e.businessRef.clone(),e.uniqueId,n.generatePromoCode(),fe.now(),e.items[t].product.clone(),e.customer.clone())}static fromMap(e,t){return new n(r.get(t,"uniqueId"),j.mustDecode(r.get(t,"businessRef")),r.get(t,"orderId"),r.get(t,"promoCode"),e.decodeDate(r.get(t,"creationDate")),e.fromData(r.get(t,"product")),e.fromData(r.get(t,"customer")))}toMap(e){return{uniqueId:this.uniqueId,businessRef:this.businessRef.encode(),orderId:this.orderId,promoCode:this.promoCode,creationDate:e.encodeDate(this.creationDate),product:e.toData(this.product),productId:this.product.uniqueId,customer:e.toData(this.customer),customerId:this.customer.uniqueId}}clone(){return new n(this.uniqueId,this.businessRef.clone(),this.orderId,this.promoCode,g.cloneDate(this.creationDate),this.product.clone(),this.customer.clone())}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.orderId===this.orderId&&e.promoCode===this.promoCode&&e.creationDate===this.creationDate&&d(e.businessRef,this.businessRef)&&d(e.product,this.product)&&d(e.customer,this.customer)}static generatePromoCode(){let e=Ft({length:15,alphabet:"UC_LETTERS_DIGITS"});return`SP-${e.substring(0,5)}-${e.substring(5,10)}-${e.substring(10,e.length)}`}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="9b09d5662d8f440db69b943d3aa48438",n})(),Py=class extends f{build(i,e){return KP.fromMap(i,e)}},Ro=(function(n){return n.Live="LIVE",n.Archived="ARCHIVED",n})(Ro||{}),wn=(function(n){return n.Generic="Generic",n.Book="Book",n.GiftCard="GiftCard",n.OpenAccessPass="OpenAccessPass",n.OpenTicketPass="OpenTicketPass",n})(wn||{}),Dc=(()=>{class n extends zt(b){constructor(e,t,s,a,o,u,c,l,h,p,I,v,E,w,S){super(),this.uniqueId=e,this.businessRef=t,this.creationDate=s,this.names=a,this.richDescriptions=o,this.coverImage=u,this.price=c,this.originalPrice=l,this.isPurchasable=h,this.status=p,this.components=I,this.sideEffects=v,this.overrideVat=E,this.type=w,this.assignable=S}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(6,n.SCHEMA_VERSION)}get hasDiscount(){return _(this.originalPrice)&&this.originalPrice.value>this.price.value}get discountPercentage(){return _(this.originalPrice)?100-this.price.value*100/this.originalPrice.value:0}static create(e){var t;return new n(e.uniqueId,e.businessRef,e.creationDate,e.names,e.richDescriptions,e.coverImage,e.price,e.originalPrice,e.isPurchasable,e.status,e.components,e.sideEffects,e.overrideVat,e.type,(t=e.assignable)!==null&&t!==void 0?t:!1)}static basic(e){var t,s,a,o,u;return this.create({uniqueId:e.uniqueId,businessRef:e.businessRef,creationDate:(t=e.creationDate)!==null&&t!==void 0?t:fe.now(),names:Oe.localized(e.names),richDescriptions:hn.empty(),coverImage:e.coverImage,price:e.price,originalPrice
3:null,isPurchasable:(s=e.isPurchasable)!==null&&s!==void 0?s:!0,status:Ro.Live,components:(a=e.components)!==null&&a!==void 0?a:new ae,sideEffects:(o=e.sideEffects)!==null&&o!==void 0?o:[],overrideVat:null,type:e.type,assignable:(u=e.assignable)!==null&&u!==void 0?u:!1})}static fromMap(e,t){return this.create({uniqueId:r.get(t,"uniqueId"),businessRef:j.mustDecode(r.get(t,"businessRef")),creationDate:e.decodeDate(r.getInteger(t,"creationDate")),names:e.fromData(r.get(t,"names")),richDescriptions:e.fromData(r.get(t,"richDescriptions")),coverImage:e.fromDataOrNull(r.getOrNull(t,"coverImage")),price:Y.decode(r.get(t,"price")),originalPrice:Y.decodeOrNull(r.getOrNull(t,"originalPrice")),isPurchasable:r.get(t,"isPurchasable"),status:y(r.get(t,"$status"),Ro),components:ae.deserialize(e,r.getList(t,"components",s=>s)),sideEffects:r.getList(t,"sideEffects",s=>e.fromData(s)),overrideVat:Re(r.getStringOrNull(t,"overrideVat"),te),type:y(r.getString(t,"type"),wn),assignable:r.getBoolean(t,"assignable")})}toMap(e){var t,s;return{uniqueId:this.uniqueId,businessRef:this.businessRef.encode(),creationDate:e.encodeDate(this.creationDate),names:e.toData(this.names),richDescriptions:e.toData(this.richDescriptions),coverImage:e.toDataOrNull(this.coverImage),price:this.price.encode(),originalPrice:(s=(t=this.originalPrice)===null||t===void 0?void 0:t.encode())!==null&&s!==void 0?s:null,isPurchasable:this.isPurchasable,$status:m(this.status),components:this.components.serialize(e),sideEffects:this.sideEffects.map(a=>e.toData(a)),overrideVat:Se(this.overrideVat),type:m(this.type),assignable:this.assignable}}clone(){return this.copyWith()}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&d(e.businessRef,this.businessRef)&&d(e.names,this.names)&&e.creationDate===this.creationDate&&d(e.richDescriptions,this.richDescriptions)&&d(e.coverImage,this.coverImage)&&d(e.price,this.price)&&d(e.originalPrice,this.originalPrice)&&P(e.sideEffects,this.sideEffects,d)&&e.isPurchasable===this.isPurchasable&&e.status===this.status&&d(e.components,this.components)&&e.overrideVat===this.overrideVat&&e.type===this.type&&e.assignable===this.assignable}copyWithBusinessRef(e){return this.copyWith({businessRef:e,components:this.components.copyWithBusinessRef(e)})}copyWith({uniqueId:e=this.uniqueId,businessRef:t=F(this.businessRef),creationDate:s=this.creationDate,names:a=F(this.names),richDescriptions:o=F(this.richDescriptions),coverImage:u=Z(this.coverImage),price:c=F(this.price),originalPrice:l=Z(this.originalPrice),isPurchasable:h=this.isPurchasable,status:p=this.status,components:I=F(this.components),sideEffects:v=ue(this.sideEffects),overrideVat:E=this.overrideVat,type:w=this.type,assignable:S=this.assignable}={}){return n.create({uniqueId:e,businessRef:t,names:a,creationDate:s,richDescriptions:o,coverImage:u,price:c,originalPrice:l,isPurchasable:h,status:p,components:I,sideEffects:v,overrideVat:E,type:w,assignable:S})}findSideEffect(e){for(let t=0;t<this.sideEffects.length;t++)if(this.sideEffects[t].effectType===e)return this.sideEffects[t];return null}hasSideEffect(e){return this.findSideEffect(e)!=null}static generateCustomerStoragePath({customerId:e,orderId:t,productId:s,productInstanceId:a,eventName:o}){let u=o!=null?tn(o).substring(0,30):null,c=`${s}_${a}`;return u!=null&&(c=`${u}_${c}`),`user_accounts/${e}/orders/${t}/products/${c}.pdf`}static generateGuestStoragePath({orderId:e,productId:t,productInstanceId:s,businessId:a,eventName:o}){let u=o!=null?tn(o).substring(0,30):null,c=`${t}_${s}`;return u!=null&&(c=`${u}_${c}`),`business_profiles/${a}/orders/${e}/products/${c}.pdf`}}return n.TYPE_ID="ed4387cc3983460f81bc55cd886f0276",n.SCHEMA_VERSION=8,n})(),Ay=class extends f{build(i,e){return Dc.fromMap(i,e)}onBeforeDeserialization(i,e){let t=Y.decode(r.get(e,"price"));i.storage.set("productPrice",t)}migrateToCurrentSchemaVersion(i,e){var t;this.migrateEnum(e,"$status",Ro,Ro.Live);let s=r.getVersionRange(e);if(s.contains(Dc.SCHEMA_VERSION))return e;if(s.isGreaterThan(Dc.SCHEMA_VERSION))return null;let a=s.to;if(a<2&&(e.onOrderCompleteHooks=[],a=2),a<3&&(a=3),a<4&&(a=4),a<5){let o=r.getList(e,"onOrderCompleteHooks",c=>i.fromData(c)),u=null;if(s.to<2)u=wn.OpenTicketPass;else{for(let c of o)switch(c.uniqueId){case Ze.CreateGiftCard:{u=wn.GiftCard;break}case Ze.CreateOpenTicketPass:{u=wn.OpenTicketPass;break}case Ze.CreateOpenAccessPass:{u=wn.OpenAccessPass;break}case Ze.CreateOpenAccessPassPlaceholder:{u=wn.OpenAccessPass;break}case Ze.CreateOpenAccessPassFromTicket:{u=wn.OpenAccessPass;break}}u??(u=wn.Book),e.type=m(u),a=5}}
3if(a<6){let u=r.getList(e,"onOrderCompleteHooks",c=>i.fromData(c)).map(c=>c.toSideEffect()).filter(_);e.sideEffects=u.map(c=>i.toData(c)),a=6}return a<7&&(r.setIfNullOrUndefined(e,"creationDate",(t=r.getRaw(e,"$last_update"))!==null&&t!==void 0?t:i.encodeDate(fe.now())),a=7),a<8&&(r.setIfNullOrUndefined(e,"assignable",!0),a=8),e.$schema_version=D.encodedExactly(a),e}},Cy=class extends b{},$r=(()=>{class n extends Cy{constructor(e,t,s,a){super(),this.paymentAccount=e,this.paymentMethods=t,this.allowLegalEntityInvoices=s,this.allowOfflineOrderReceipts=a}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.paymentAccount,e.paymentMethods,e.allowLegalEntityInvoices,e.allowOfflineOrderReceipts)}static fromPaymentAccount(e){var t,s;return new n(e.toRef(),[pe.Online],(s=(t=e.invoicingProtocol)===null||t===void 0?void 0:t.allowLegalEntities)!==null&&s!==void 0?s:!1,!1)}static fromMap(e,t){return new n(e.fromData(r.getRecord(t,"paymentAccount")),r.getList(t,"paymentMethods",s=>{var a;return(a=y(s,pe))!==null&&a!==void 0?a:pe.OnDelivery}),r.getBoolean(t,"allowLegalEntityInvoices"),r.getBoolean(t,"allowOfflineOrderReceipts"))}toMap(e){return{paymentAccount:e.toData(this.paymentAccount),paymentMethods:this.paymentMethods,allowLegalEntityInvoices:this.allowLegalEntityInvoices,allowOfflineOrderReceipts:this.allowOfflineOrderReceipts}}clone(){return new n(this.paymentAccount,this.paymentMethods.map(e=>e),this.allowLegalEntityInvoices,this.allowOfflineOrderReceipts)}isSame(e){return this===e?!0:P(e.paymentMethods,this.paymentMethods)&&d(e.paymentAccount,this.paymentAccount)&&e.allowLegalEntityInvoices===this.allowLegalEntityInvoices&&e.allowOfflineOrderReceipts===this.allowOfflineOrderReceipts}}return n.TYPE_ID="20b26b2661634636afb700ab480db55f",n})(),ky=class extends f{build(i,e){return $r.fromMap(i,e)}},Tr=(()=>{class n extends b{constructor(e,t){super(),this.standard=e,this.products=t}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static create(e){return new n(e.standard,e.products)}static fromPaymentAccounts(e){return new n($r.fromPaymentAccount(e.standard),e.products!=null?$r.fromPaymentAccount(e.products):null)}static fromMap(e,t){return new n(e.fromData(r.getRecord(t,"standard")),e.fromDataOrNull(r.getRecordOrNull(t,"products")))}toMap(e){return{standard:e.toData(this.standard),products:e.toDataOrNull(this.products)}}clone(){var e,t;return new n(this.standard.clone(),(t=(e=this.products)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null)}copyWith({standard:e=F(this.standard),products:t=Z(this.products)}={}){return n.create({standard:e,products:t})}isSame(e){return this===e?!0:d(e.standard,this.standard)&&d(e.products,this.products)}}return n.TYPE_ID="39b4add95d114b499fb1217c1124238c",n.SCHEMA_VERSION=2,n})(),_y=class extends f{build(i,e){return Tr.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(Tr.SCHEMA_VERSION))return e;if(t.isGreaterThan(Tr.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(s=2,e.products=null),e.$schema_version=D.encodedExactly(s),e}},vc=(()=>{class n extends b{constructor(e,t,s){super(),this.product=e,this.quantity=t,this.applicationFee=s,this.productId=e.uniqueId}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static create(e){return new n(e.product,e.quantity,e.applicationFee)}static fromMap(e,t){return new n(e.fromData(r.getRaw(t,"product")),r.get(t,"quantity"),e.fromDataOrNull(r.getOrNull(t,"applicationFee")))}toMap(e){return{product:e.toData(this.product),productId:this.product.uniqueId,quantity:this.quantity,applicationFee:e.toDataOrNull(this.applicationFee)}}clone(){var e,t;return new n(this.product.clone(),this.quantity,(t=(e=this.applicationFee)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null)}isSame(e){return this===e?!0:d(e.product,this.product)&&d(e.applicationFee,this.applicationFee)&&e.quantity===this.quantity}copyWithBusinessRef(e){var t,s;return new n(this.product.copyWithBusinessRef(e),this.quantity,(s=(t=this.applicationFee)===null||t===void 0?void 0:t.clone())!==null&&s!==void 0?s:null)}static generateProductInstanceId(e,t){return`${e.toString(16).padStart(4,"0")}${t.toString(16).padStart(4,"0")}`}}
3return n.TYPE_ID="fac8d656b3ac49e8a83c52bc7dbf25e4",n.SCHEMA_VERSION=2,n})(),xy=class extends f{build(i,e){return vc.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(vc.SCHEMA_VERSION))return e;if(t.isGreaterThan(vc.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(s=2),e.$schema_version=D.encodedExactly(s),e}},ZP=(()=>{class n extends b{constructor(e,t,s,a,o){super(),this.uniqueId=e,this.businessRef=t,this.productId=s,this.eventId=a,this.productType=o}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.uniqueId,e.businessRef,e.productId,e.eventId,e.productType)}static fromMap(e,t){return n.create({uniqueId:r.getString(t,"uniqueId"),businessRef:j.mustDecode(r.getString(t,"businessRef")),productId:r.getString(t,"productId"),eventId:r.getString(t,"eventId"),productType:y(r.getString(t,"productType"),wn)})}toMap(e){return{uniqueId:this.uniqueId,businessRef:this.businessRef.encode(),productId:this.productId,eventId:this.eventId,productType:m(this.productType)}}clone(){return this.copyWith()}copyWith({uniqueId:e=this.uniqueId,businessRef:t=F(this.businessRef),productId:s=this.productId,eventId:a=this.eventId,productType:o=this.productType}={}){return n.create({uniqueId:e,businessRef:t,productId:s,eventId:a,productType:o})}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&d(e.businessRef,this.businessRef)&&e.productId===this.productId&&e.eventId===this.eventId&&e.productType===this.productType}}return n.TYPE_ID="de1632bd1862402e9a7ce690d83a86f8",n})(),Fy=class extends f{build(i,e){return ZP.fromMap(i,e)}},yc=(()=>{class n extends b{constructor(e,t,s,a,o){super(),this.businessRef=e,this.paymentAccount=t,this.feeProtocol=s,this.productsDescription=a,this.qrCodePrefix=o}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static create(e){return new n(e.businessRef,e.paymentAccount,e.feeProtocol,e.productsDescription,e.qrCodePrefix)}static fromMap(e,t){return n.create({businessRef:j.mustDecode(r.getString(t,"businessRef")),paymentAccount:e.fromDataOrNull(r.getRecordOrNull(t,"paymentAccount")),feeProtocol:e.fromDataOrNull(r.getRecordOrNull(t,"feeProtocol")),productsDescription:e.fromDataOrNull(r.getRecordOrNull(t,"productsDescription")),qrCodePrefix:r.getStringOrNull(t,"qrCodePrefix")})}toMap(e){return{businessRef:this.businessRef.encode(),paymentAccount:e.toDataOrNull(this.paymentAccount),feeProtocol:e.toDataOrNull(this.feeProtocol),productsDescription:e.toDataOrNull(this.productsDescription),qrCodePrefix:this.qrCodePrefix}}clone(){return this.copyWith()}copyWith({businessRef:e=this.businessRef.clone(),paymentAccount:t=Z(this.paymentAccount),feeProtocol:s=Z(this.feeProtocol),productsDescription:a=Z(this.productsDescription),qrCodePrefix:o=this.qrCodePrefix}={}){return n.create({businessRef:e,paymentAccount:t,feeProtocol:s,productsDescription:a,qrCodePrefix:o})}isSame(e){return e===this?!0:d(e.businessRef,this.businessRef)&&d(e.paymentAccount,this.paymentAccount)&&d(e.feeProtocol,this.feeProtocol)&&d(e.productsDescription,this.productsDescription)&&e.qrCodePrefix===this.qrCodePrefix}}return n.TYPE_ID="25084de4165c4dd686f34888e347d99e",n.SCHEMA_VERSION=3,n})(),qy=class extends f{build(i,e){return yc.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(yc.SCHEMA_VERSION))return e;if(t.isGreaterThan(yc.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(s=2),s<3&&(s=3),e.$schema_version=D.encodedExactly(s),e}},XP=(()=>{class n extends b{constructor(e,t,s){super(),this.uniqueId=e,this.creationDate=t,this.store=s}get $typeId(){return n.TYPE_ID}static empty(e){return new n(e,fe.now(),{})}static fromMap(e,t){return new n(r.get(t,"uniqueId"),e.decodeDate(r.get(t,"creationDate")),r.get(t,"store"))}toMap(e){return{uniqueId:this.uniqueId,creationDate:e.encodeDate(this.creationDate),store:this.store}}clone(){return new n(this.uniqueId,this.creationDate,Object.assign({},this.store))}copyWith({uniqueId:e=this.uniqueId,creationDate:t=this.creationDate}){return new n(e,t,Object.assign({},this.store))}isSame(e){return this===e?!0:this.uniqueId===e.uniqueId&&this.store===e.store&&this.creationDate===e.creationDate}setString(e,t){this.store[e]=t}setNumber(e,t){this.store[e]=t}setBoolean(e,t){this.store[e]=t}getString(e){return r.getStringOrNull(this.store,e)}getStringArray(e){let t=r.getRaw(this.store,e);return t!=null&&Array.isArray(t)?t.length<=0?[]:typeof t[0]=="string"?t.map(s=>s):null:null}getNumber(e){return r.getNumberOrNull(this.store,e)}getBoolean(e){return r.getBooleanOrNull(this.store,e)}}return n.TYPE_ID="ecf220a03d874f9fbba612d98ccba25a",n})(),Yy=class extends f{build(i,e){return XP.fromMap(i,e)}},QP=(()=>{class n extends b{constructor(e,t){super(),this.descriptions=e,this.seatId=t}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.descriptions,e.seatId)}static fromSeat(e){return new n(Lf.generateLocalizedStringForSeat(e),e.uniqueId)}static fromMap(e,t){return new n(e.fromData(r.get(t,"descriptions")),r.get(t,"seatId"))}toMap(e){return{descriptions:e.toData(this.descriptions),seatId:this.seatId}}clone(){return new n(this.descriptions.clone(),this.seatId)}isSame(e){return this===e?!0:this.seatId==e.seatId&&d(this.descriptions,e.descriptions)}copyWithNames(e){return new n(e.clone(),this.seatId)}}return n.TYPE_ID="3a578fa286d445bdb89fb80b3fae54b6",n})(),$y=class extends f{build(i,e){return QP.fromMap(i,e)}},eA=(()=>{class n extends b{constructor(e,t,s){super(),this.uniqueId=e,this.value=t,this.creationDate=s}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.uniqueId,e.value,e.creationDate)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.get(t,"value"),e.decodeDate(r.get(t,"creationDate")))}toMap(e){return{uniqueId:this.uniqueId,value:this.value,creationDate:e.encodeDate(this.creationDate)}}clone(){return new n(this.uniqueId,this.value,this.creationDate)}isSame(e){return this===e?!0:this.uniqueId===e.uniqueId&&this.value===e.value&&this.creationDate===e.creationDate}}return n.TYPE_ID="02f481af5d9b4bd28c575abd6507f99b",n})(),Ly=class extends f{build(i,e){return eA.fromMap(i,e)}},md=class n{constructor(i,e,t,s){this.title=i,this.description=e,this.url=t,this.image=s}static fromData(i){return new n(i.title,i.description,i.url,i.image)}static fromMap(i,e){return new n(r.get(e,"title"),r.get(e,"description"),r.getOrNull(e,"url"),r.getOrNull(e,"image"))}
3toMap(i){let e={title:this.title,description:this.description};return r.setOptional(e,"url",this.url),r.setOptional(e,"image",this.image),e}clone(){return new n(this.title,this.description,this.url,this.image)}isSame(i){return this===i?!0:i.title===this.title&&i.description===this.description&&i.url===this.url&&i.image===this.image}},Vy=class n{constructor(i,e,t,s,a,o){this.uniqueId=i,this.icon=e,this.name=t,this.isFeatured=s,this.rank=a,this.filterOrder=o}static fromData(i){return new n(i.uniqueId,i.icon,i.name,i.isFeatured,i.rank,i.filterOrder)}static fromMap(i,e){return new n(r.get(e,"uniqueId"),r.getOrNull(e,"icon"),os(e,"name"),r.get(e,"isFeatured"),r.get(e,"rank"),r.get(e,"filterOrder"))}toMap(i){let e={uniqueId:this.uniqueId,name:as(this.name),isFeatured:this.isFeatured,rank:this.rank,filterOrder:this.filterOrder};return r.setOptional(e,"icon",this.icon),e}clone(){return new n(this.uniqueId,this.icon,ee(this.name),this.isFeatured,this.rank,this.filterOrder)}isSame(i){return this===i?!0:i.uniqueId===this.uniqueId&&i.icon===this.icon&&i.isFeatured===this.isFeatured&&i.rank===this.rank&&i.filterOrder===this.filterOrder&&re(i.name,this.name)}},zy=class n{constructor(i,e){this.uniqueId=i,this.category=e}static fromData(i){return new n(i.uniqueId,i.category)}static fromMap(i,e){return new n(r.get(e,"uniqueId"),r.get(e,"category"))}toMap(i){return{uniqueId:this.uniqueId,category:this.category}}clone(){return new n(this.uniqueId,this.category)}isSame(i){return this===i?!0:i.uniqueId===this.uniqueId&&i.category===this.category}},bc=(()=>{class n extends b{constructor(e,t,s,a,o,u,c,l,h,p,I){super(),this.uniqueId=e,this.webRoute=t,this.isFestival=s,this.referralLink=a,this.images=o,this.title=u,this.description=c,this.location=l,this.categories=h,this.items=p,this.seoTags=I}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static fromData(e){return new n(e.metadata.uniqueId,e.metadata.webRoute,e.metadata.isFestival,e.metadata.referralLink,e.metadata.images,e.metadata.title,e.metadata.description,e.metadata.location,e.categories,e.items,md.fromData(e.metadata.seoTags))}static fromMap(e,t){let s=r.getOrNull(t,"seoTags");return new n(r.get(t,"uniqueId"),r.get(t,"webRoute"),r.get(t,"isFestival"),r.getOrNull(t,"referralLink"),r.getList(t,"images",a=>a),os(t,"title"),os(t,"description"),os(t,"location"),r.getList(t,"categories",a=>Vy.fromMap(e,a)),r.getList(t,"items",a=>zy.fromMap(e,a)),k(s)?null:md.fromMap(e,s))}toMap(e){var t,s;return{uniqueId:this.uniqueId,webRoute:this.webRoute,isFestival:this.isFestival,referralLink:this.referralLink,images:this.images,title:as(this.title),description:as(this.description),location:as(this.location),categories:hR(this.categories,a=>a.toMap(e)),items:hR(this.items,a=>a.toMap(e)),seoTags:(s=(t=this.seoTags)===null||t===void 0?void 0:t.toMap(e))!==null&&s!==void 0?s:null}}clone(){var e,t;return new n(this.uniqueId,this.webRoute,this.isFestival,this.referralLink,Te(this.images),ee(this.title),ee(this.description),ee(this.location),ue(this.categories),ue(this.items),(t=(e=this.seoTags)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null)}isSame(e){return this===e?!0:e.uniqueId===this.uniqueId&&e.webRoute===this.webRoute&&e.isFestival===this.isFestival&&d(e.seoTags,this.seoTags)&&P(e.images,this.images)&&re(e.title,this.title)&&re(e.description,this.description)&&re(e.location,this.location)&&P(e.categories,this.categories,d)&&P(e.items,this.items,d)}}return n.TYPE_ID="138fb56544c541b98549755f6e00b129",n.SCHEMA_VERSION=3,n})(),Uy=class extends f{build(i,e){return bc.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(bc.SCHEMA_VERSION))return e;if(t.isGreaterThan(bc.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(e.seoTags=null,s=2),s<3&&(e.referralLink=null,e.location={},s=3),e.$schema_version=D.encodedExactly(s),e}},tA=(()=>{class n extends b{constructor(e,t,s,a,o,u,c,l,h,p,I){super(),this.uniqueId=e,this.webRoute=t,this.isFestival=s,this.referralLink=a,this.images=o,this.title=u,this.description=c,this.location=l,this.categories=h,this.items=p,this.seo=I}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.uniqueId,e.webRoute,e.isFestival,e.referralLink,e.images,e.title,e.description,e.location,e.categories,e.items,e.seo)}static fromMap(e,t){return n.create({uniqueId:r.getString(t,"uniqueId"),webRoute:r.getString(t,"webRoute"),isFestival:r.getBoolean(t,"isFestival"),referralLink:r.getStringOrNull(t,"referralLink"),images:r.getList(t,"images",s=>s),title:r.getMap(t,"title",(s,a)=>({key:y(s,$),value:a})),description:r.getMap(t,"description",(s,a)=>({key:y(s,$),value:a})),location:r.getMap(t,"location",(s,a)=>({key:y(s,$),value:a})),categories:r.getList(t,"categories",s=>By.fromMap(e,s)),items:r.getList(t,"items",s=>Hy.fromMap(e,s)),seo:Gy.fromMapOrNull(e,r.getOrNull(t,"seo"))})}toMap(e){var t,s;
3return{uniqueId:this.uniqueId,webRoute:this.webRoute,isFestival:this.isFestival,referralLink:this.referralLink,images:this.images,title:se(this.title,(a,o)=>({key:m(a),value:o})),description:se(this.description,(a,o)=>({key:m(a),value:o})),location:se(this.location,(a,o)=>({key:m(a),value:o})),categories:this.categories.map(a=>a.toMap(e)),items:this.items.map(a=>a.toMap(e)),seo:(s=(t=this.seo)===null||t===void 0?void 0:t.toMap(e))!==null&&s!==void 0?s:null}}clone(){var e,t;return n.create({uniqueId:this.uniqueId,webRoute:this.webRoute,isFestival:this.isFestival,referralLink:this.referralLink,images:Te(this.images),title:ee(this.title),description:ee(this.description),location:ee(this.location),categories:this.categories.map(s=>s.clone()),items:this.items.map(s=>s.clone()),seo:(t=(e=this.seo)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null})}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.webRoute===this.webRoute&&e.isFestival===this.isFestival&&e.referralLink===this.referralLink&&P(e.images,this.images)&&re(e.title,this.title)&&re(e.description,this.description)&&re(e.location,this.location)&&P(e.categories,this.categories,d)&&P(e.items,this.items,d)&&d(e.seo,this.seo)}}return n.TYPE_ID="7ad3a409cade4c3188f22d04c7fb4e0f",n})(),By=class n{constructor(i,e,t,s,a,o){this.uniqueId=i,this.icon=e,this.name=t,this.isFeatured=s,this.rank=a,this.filterOrder=o}static create(i){return new n(i.uniqueId,i.icon,i.name,i.isFeatured,i.rank,i.filterOrder)}static fromMap(i,e){return new n(r.getString(e,"uniqueId"),r.getStringOrNull(e,"icon"),r.getMap(e,"name",(t,s)=>({key:y(t,$),value:s})),r.getBoolean(e,"isFeatured"),r.getNumber(e,"rank"),r.getNumber(e,"filterOrder"))}toMap(i){return{uniqueId:this.uniqueId,icon:this.icon,name:se(this.name,(e,t)=>({key:m(e),value:t})),isFeatured:this.isFeatured,rank:this.rank,filterOrder:this.filterOrder}}clone(){return new n(this.uniqueId,this.icon,ee(this.name),this.isFeatured,this.rank,this.filterOrder)}isSame(i){return i===this?!1:i.uniqueId===this.uniqueId&&i.icon===this.icon&&re(i.name,this.name)&&i.isFeatured===this.isFeatured&&i.rank===this.rank&&i.filterOrder===this.filterOrder}},Ei=(function(n){return n.Business="BUSINESS",n.Event="EVENT",n})(Ei||{}),Hy=class n{constructor(i,e,t){switch(this.classification=i,this.type=e,this.item=t,e){case Ei.Business:if(!(t instanceof Ja))throw new X("item","Invalid item type.");break;case Ei.Event:if(!(t instanceof Cn))throw new X("item","Invalid item type.");break}}static create(i){let e;switch(!0){case i.item instanceof Ja:e=Ei.Business;break;case i.item instanceof Cn:e=Ei.Event;break;default:Zt(i.item)}return new n(i.classification,e,i.item)}static fromMap(i,e){let t=y(r.getString(e,"type"),Ei),s;switch(t){case Ei.Business:s=Ja.fromMap(i,r.get(e,"item"));break;case Ei.Event:s=Cn.fromMap(i,r.get(e,"item"));break;default:throw new ie(`Invalid item type: ${t}`)}return n.create({item:s,classification:r.getList(e,"classification",a=>a)})}toMap(i){return{classification:this.classification,type:m(this.type),item:this.item.toMap(i)}}clone(){return n.create({classification:Te(this.classification),item:this.item.clone()})}isSame(i){return i===this?!0:i.classification===this.classification&&i.type===this.type&&d(i.item,this.item)}},Ja=class n{constructor(i,e,t,s,a,o,u,c,l,h,p,I,v){this.uniqueId=i,this.name=e,this.cover=t,this.businessCategory=s,this.locationInfo=a,this.label=o,this.startDate=u,this.isVerified=c,this.tag=l,this.badgeType=h,this.menuType=p,this.intentOverride=I,this.webRoute=v}static create(i){return new n(i.uniqueId,i.name,i.cover,i.businessCategory,i.locationInfo,i.label,i.startDate,i.isVerified,i.tag,i.badgeType,i.menuType,i.intentOverride,i.webRoute)}static fromMap(i,e){return n.create({uniqueId:r.getString(e,"uniqueId"),name:r.getMap(e,"name",(t,s)=>({key:y(t,$),value:s})),cover:r.getMapOrNull(e,"cover",(t,s)=>({key:y(t,$),value:s})),businessCategory:Re(r.getStringOrNull(e,"businessCategory"),Fn),locationInfo:fs.fromMapOrNull(i,r.getOrNull(e,"locationInfo")),label:r.getMapOrNull(e,"label",(t,s)=>({key:y(t,$),value:s})),startDate:g.decodeDateOrNull(r.getNumberOrNull(e,"startDate")),isVerified:r.getBoolean(e,"isVerified"),tag:Re(r.getStringOrNull(e,"tag"),Jl),badgeType:Re(r.getStringOrNull(e,"badgeType"),vo),menuType:Re(r.getStringOrNull(e,"menuType"),br),intentOverride:r.getStringOrNull(e,"intentOverride"),webRoute:r.getStringOrNull(e,"webRoute")})}toMap(i){var e,t;return{uniqueId:this.uniqueId,name:se(this.name,(s,a)=>({key:m(s),value:a})),cover:Rx(this.cover),businessCategory:Se(this.businessCategory),locationInfo:(t=(e=this.locationInfo)===null||e===void 0?void 0:e.toMap(i))!==null&&t!==void 0?t:null,label:this.label==null?null:se(this.label,(s,a)=>({key:m(s),value:a})),startDate:g.encodeDateOrNull(this.startDate),isVerified:this.isVerified,tag:Se(this.tag),badgeType:Se(this.badgeType),menuType:Se(this.menuType),intentOverride:this.intentOverride,webRoute:this.webRoute}}clone(){var i,e;return n.create({uniqueId:this.uniqueId,name:ee(this.name),cover:Tx(this.cover),businessCategory:this.businessCategory,badgeType:this.badgeType,intentOverride:this.intentOverride,isVerified:this.isVerified,label:this.label==null?null:ee(this.label),locationInfo:(e=(i=this.locationInfo)===null||i===void 0?void 0:i.clone())!==null&&e!==void 0?e:null,menuType:this.menuType,startDate:this.startDate,tag:this.tag,webRoute:this.webRoute})}isSame(i){return i===this?!0:i.uniqueId===this.uniqueId&&re(i.name,this.name)&&re(i.cover,this.cover)&&i.businessCategory===this.businessCategory&&d(i.locationInfo,this.locationInfo)&&re(i.label,this.label)&&i.startDate===this.startDate&&i.isVerified===this.isVerified&&i.tag===this.tag&&i.badgeType===this.badgeType&&i.menuType===this.menuType&&i.intentOverride===this.intentOverride&&i.webRoute===this.webRoute}},Gy=class n{constructor(i,e,t,s){this.title=i,this.description=e,this.url=t,this.image=s}static create(i){return new n(i.title,i.description,i.url,i.image)}static fromMap(i,e){return n.create({title:r.getString(e,"title"),description:r.getString(e,"description"),url:r.getStringOrNull(e,"url"),image:r.getStringOrNull(e,"image")})}static fromMapOrNull(i,e){return e==null?null:n.fromMap(i,e)}
3toMap(i){return{title:this.title,description:this.description,url:this.url,image:this.image}}clone(){return n.create({title:this.title,description:this.description,url:this.url,image:this.image})}isSame(i){return i===this?!0:i.title===this.title&&i.description===this.description&&i.url===this.url&&i.image===this.image}},Wy=class extends f{build(i,e){return tA.fromMap(i,e)}},xe=(function(n){return n[n.Monday=1]="Monday",n[n.Tuesday=2]="Tuesday",n[n.Wednesday=3]="Wednesday",n[n.Thursday=4]="Thursday",n[n.Friday=5]="Friday",n[n.Saturday=6]="Saturday",n[n.Sunday=7]="Sunday",n})(xe||{}),nA=(()=>{class n extends b{constructor(e,t){super(),this.name=e,this.code=t}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.name,e.code)}static fromMap(e,t){return new n(r.getString(t,"name"),r.getString(t,"code"))}toMap(e){return{name:this.name,code:this.code}}clone(){return new n(this.name,this.code)}isSame(e){return e===this?!0:e.name===this.name&&e.code===this.code}}return n.TYPE_ID="a97b47f220f1455b89a4545e467496fd",n})(),jy=class extends f{build(i,e){return nA.fromMap(i,e)}},Ec=(()=>{class n extends b{constructor(e,t,s,a,o){super(),this.name=e,this.productId=t,this.priceId=s,this.grossPrice=a,this.available=o}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}get $removable(){return!1}static create(e){return new n(e.name,e.productId,e.priceId,e.grossPrice,e.available)}static fromData(e,t){return new n(r.getString(t,"name"),r.getNumber(t,"productId"),r.getNumber(t,"priceId"),r.getNumber(t,"grossPrice"),dt.decode(r.getRaw(t,"available"),s=>s))}toMap(e){return{name:this.name,productId:this.productId,priceId:this.priceId,grossPrice:this.grossPrice,available:this.available.encode(t=>t)}}clone(){return new n(this.name,this.productId,this.priceId,this.grossPrice,this.available.clone(e=>e))}isSame(e){return e===this?!0:e.name===this.name&&e.productId===this.productId&&e.priceId===this.priceId&&e.grossPrice===this.grossPrice&&e.available.isSame(this.available)}}return n.TYPE_ID="91c701353ab94f018968d3f83c2cf96f",n.SCHEMA_VERSION=2,n})(),Jy=class extends f{build(i,e){return Ec.fromData(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(Ec.SCHEMA_VERSION))return e;if(t.isGreaterThan(Ec.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(e.available=dt.UNDEFINED_STATUS,s=2),e.$schema_version=D.encodedExactly(s),e}},iA=(()=>{class n extends b{constructor(e,t,s,a){super(),this.uniqueId=e,this.baseUrl=t,this.posName=s,this.certificateId=a}get $typeId(){return n.TYPE_ID}get $removable(){return!1}static create(e){return new n(e.uniqueId,e.baseUrl,e.posName,e.certificateId)}static fromData(e,t){return new n(r.getString(t,"uniqueId"),r.getString(t,"baseUrl"),r.getString(t,"posName"),r.getString(t,"certificateId"))}toMap(e){return{uniqueId:this.uniqueId,baseUrl:this.baseUrl,posName:this.posName,certificateId:this.certificateId}}clone(){return new n(this.uniqueId,this.baseUrl,this.posName,this.certificateId)}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.baseUrl===this.baseUrl&&e.posName===this.posName&&e.certificateId===this.certificateId}}return n.TYPE_ID="96bc0825a60b40aca93a5a05797bc8ed",n})(),Ky=class extends f{build(i,e){return iA.fromData(i,e)}},sA=(()=>{class n extends b{constructor(e,t){super(),this.uniqueId=e,this.subscriptions=t}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.getList(t,"subscription",s=>e.fromData(s)))}toMap(e){return{uniqueId:this.uniqueId,subscriptions:this.subscriptions.map(t=>e.toData(t))}}clone(){return new n(this.uniqueId,ue(this.subscriptions))}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&P(e.subscriptions,this.subscriptions,(t,s)=>d(t,s))}}return n.TYPE_ID="94f1aa96d2254dcfb017b13d2b981a60",n})(),Zy=class extends f{build(i,e){return sA.fromMap(i,e)}},rA=(()=>{class n extends b{constructor(e){super(),this.groupServicesByStaffMembers=e}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.get(t,"groupServicesByStaffMembers"))}toMap(e){return{groupServicesByStaffMembers:this.groupServicesByStaffMembers}}clone(){return new n(this.groupServicesByStaffMembers)}isSame(e){return this===e?!0:e.groupServicesByStaffMembers===this.groupServicesByStaffMembers}}return n.TYPE_ID="56ddc6a91be743a892a63a50e163ccf1",n})(),Xy=class extends f{build(i,e){return rA.fromMap(i,e)}},wc=(()=>{class n extends b{constructor(e,t,s,a){super(),this.businessRef=e,this.templateIdHu=t,this.templateIdRo=s,this.scheduledHour=a}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}static create(e){return new n(e.businessRef,e.templateIdHu,e.templateIdRo,e.scheduledHour)}static fromMap(e,t){return n.create({businessRef:j.mustDecode(r.getString(t,"businessRef")),templateIdHu:r.getInteger(t,"templateIdHu"),templateIdRo:r.getInteger(t,"templateIdRo"),scheduledHour:r.getIntegerOrNull(t,"scheduledHour")})}toMap(e){return{businessRef:this.businessRef.encode(),templateIdHu:this.templateIdHu,templateIdRo:this.templateIdRo,scheduledHour:this.scheduledHour}}clone(){return this.copyWith()}copyWith({businessRef:e=this.businessRef,templateIdHu:t=this.templateIdHu,templateIdRo:s=this.templateIdRo,scheduledHour:a=this.scheduledHour}={}){return n.create({businessRef:e,templateIdHu:t,templateIdRo:s,scheduledHour:a})}isSame(e){return e===this?!0:d(e.businessRef,this.businessRef)&&e.templateIdHu===this.templateIdHu&&e.templateIdRo===this.templateIdRo&&e.scheduledHour===this.scheduledHour}}return n.TYPE_ID="59f584e68fcd446fae53e6cdf6250c0b",n.SCHEMA_VERSION=2,n})(),Qy=class extends f{build(i,e){return wc.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(wc.SCHEMA_VERSION))return e;if(t.isGreaterThan(wc.SCHEMA_VERSION))return null;let s=t.to;if(s<2){let a=r.getInteger(e,"templateId");r.setIfNullOrUndefined(e,"templateIdHu",a),r.setIfNullOrUndefined(e,"templateIdRo",a),delete e.templateId,s=2}return e.$schema_version=D.encodedExactly(s),e}},Sc=(()=>{class n extends Le{constructor(e,t,s,a,o,u){super(),this.uniqueId=e,this.creatorId=t,this.deviceId=s,this.creationDate=a,this.source=o,this.businessId=u}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.getOrNull(t,"creatorId"),r.getOrNull(t,"deviceId"),e.decodeDate(r.get(t,"creationDate")),y(r.get(t,"source"),le),r.get(t,"businessId"))}toMap(e){return{uniqueId:this.uniqueId,creatorId:this.creatorId,deviceId:this.deviceId,creationDate:e.encodeDate(this.creationDate),source:m(this.source),businessId:this.businessId}}clone(){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,this.businessId)}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.creatorId===this.creatorId&&e.deviceId===this.deviceId&&e.creationDate===this.creationDate&&e.source===this.source&&e.businessId===this.businessId}}
3return n.TYPE_ID="f4b36290fcbe401aa2711cc471016827",n.SCHEMA_VERSION=2,n})(),eb=class extends f{build(i,e){return Sc.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(Sc.SCHEMA_VERSION))return e;if(t.isGreaterThan(Sc.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(s=2),e.$schema_version=D.encodedExactly(s),e}},aA=(()=>{class n extends b{constructor(e,t,s,a,o,u,c,l,h,p,I,v,E){super(),this.businessName=e,this.legalName=t,this.taxNumber=s,this.companyRegistrationNumber=a,this.registeredAddressPostalCode=o,this.registeredAddressCity=u,this.registeredAddressStreet=c,this.logo=l,this.contactName=h,this.contactEmail=p,this.contactPhone=I,this.publicName=v,this.website=E}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.businessName,e.legalName,e.taxNumber,e.companyRegistrationNumber,e.registeredAddressPostalCode,e.registeredAddressCity,e.registeredAddressStreet,e.logo,e.contactName,e.contactEmail,e.contactPhone,e.publicName,e.website)}static empty(){return n.create({businessName:"",legalName:"",taxNumber:"",companyRegistrationNumber:"",registeredAddressPostalCode:"",registeredAddressCity:"",registeredAddressStreet:"",logo:null,contactName:"",contactEmail:"",contactPhone:"",publicName:"",website:""})}static fromMap(e,t){return n.create({businessName:r.getString(t,"businessName"),legalName:r.getString(t,"legalName"),taxNumber:r.getString(t,"taxNumber"),companyRegistrationNumber:r.getString(t,"companyRegistrationNumber"),registeredAddressPostalCode:r.getString(t,"registeredAddressPostalCode"),registeredAddressCity:r.getString(t,"registeredAddressCity"),registeredAddressStreet:r.getString(t,"registeredAddressStreet"),logo:e.fromDataOrNull(r.getRecordOrNull(t,"logo")),contactName:r.getString(t,"contactName"),contactEmail:r.getString(t,"contactEmail"),contactPhone:r.getString(t,"contactPhone"),publicName:r.getString(t,"publicName"),website:r.getString(t,"website")})}toMap(e){return{businessName:this.businessName,legalName:this.legalName,taxNumber:this.taxNumber,companyRegistrationNumber:this.companyRegistrationNumber,registeredAddressPostalCode:this.registeredAddressPostalCode,registeredAddressCity:this.registeredAddressCity,registeredAddressStreet:this.registeredAddressStreet,logo:e.toDataOrNull(this.logo),contactName:this.contactName,contactEmail:this.contactEmail,contactPhone:this.contactPhone,publicName:this.publicName,website:this.website}}clone(){return this.copyWith()}copyWith({businessName:e=this.businessName,legalName:t=this.legalName,taxNumber:s=this.taxNumber,companyRegistrationNumber:a=this.companyRegistrationNumber,registeredAddressPostalCode:o=this.registeredAddressPostalCode,registeredAddressCity:u=this.registeredAddressCity,registeredAddressStreet:c=this.registeredAddressStreet,logo:l=Z(this.logo),contactName:h=this.contactName,contactEmail:p=this.contactEmail,contactPhone:I=this.contactPhone,publicName:v=this.publicName,website:E=this.website}={}){return n.create({businessName:e,legalName:t,taxNumber:s,companyRegistrationNumber:a,registeredAddressPostalCode:o,registeredAddressCity:u,registeredAddressStreet:c,logo:l,contactName:h,contactEmail:p,contactPhone:I,publicName:v,website:E})}isSame(e){return e===this?!0:e.businessName===this.businessName&&e.legalName===this.legalName&&e.taxNumber===this.taxNumber&&e.companyRegistrationNumber===this.companyRegistrationNumber&&e.registeredAddressPostalCode===this.registeredAddressPostalCode&&e.registeredAddressCity===this.registeredAddressCity&&e.registeredAddressStreet===this.registeredAddressStreet&&d(e.logo,this.logo)&&e.contactName===this.contactName&&e.contactEmail===this.contactEmail&&e.contactPhone===this.contactPhone&&e.publicName===this.publicName&&e.website===this.website}}return n.TYPE_ID="cd38acfa1f8b4629b423e3e60af4f2a5",n})(),tb=class extends f{build(i,e){return aA.fromMap(i,e)}},Id=(()=>{class n extends b{constructor(e,t){super(),this.from=e,this.to=t}get $typeId(){return n.TYPE_ID}get durationInMinutes(){return this.to.inMinutes-this.from.inMinutes}static fromMap(e,t){return new n(e.fromData(r.getRaw(t,"from")),e.fromData(r.getRaw(t,"to")))}toMap(e){return{from:e.toData(this.from),to:e.toData(this.to)}}clone(){return new n(this.from.clone(),this.to.clone())}isSame(e){return e===this?!0:d(e.from,this.from)&&d(e.to,this.to)}}return n.TYPE_ID="77eab58be9d244388c6db33c29684543",n})(),nb=class extends f{build(i,e){return Id.fromMap(i,e)}},Qn=(()=>{class n extends b{constructor(e,t,s=!1){super(),this.dayOfWeek=e,this.times=t,this.closed=s}get hasAnyHoursDefined(){return!this.closed&&this.times.length!==0}get $typeId(){return n.TYPE_ID}static nineToFive(e){return new n(e,[new Id(new Pt(9,0),new Pt(17,0))],!1)}static closed(e){return new n(e,[new Id(new Pt(9,0),new Pt(17,0))],!0)}static fromMap(e,t){return new n(r.get(t,"dayOfWeek"),r.getList(t,"times",s=>e.fromData(s)),r.get(t,"closed"))}toMap(e){return{dayOfWeek:this.dayOfWeek,times:this.times.map(t=>e.toData(t)),closed:this.closed}}clone(){return new n(this.dayOfWeek,this.times.map(e=>e.clone()),this.closed)}isSame(e){return e===this?!0:e.dayOfWeek===this.dayOfWeek&&P(e.times,this.times,d)&&e.closed===this.closed}}return n.TYPE_ID="256cc45db74b48b98500a6da0091aac4",n})(),ib=class extends f{build(i,e){return Qn.fromMap(i,e)}},oA=(()=>{class n extends b{constructor(e,t,s,a,o,u,c){super(),this.monday=e,this.tuesday=t,this.wednesday=s,this.thursday=a,this.friday=o,this.saturday=u,this.sunday=c}get $typeId(){return n.TYPE_ID}get hasAnyOpenHours(){return!this.monday.closed||!this.tuesday.closed||!this.wednesday.closed||!this.thursday.closed||!this.friday.closed||!this.saturday.closed||!this.sunday.closed}nineToFive(){return new n(Qn.nineToFive(xe.Monday),Qn.nineToFive(xe.Tuesday),Qn.nineToFive(xe.Wednesday),Qn.nineToFive(xe.Thursday),Qn.nineToFive(xe.Friday),Qn.nineToFive(xe.Saturday),Qn.nineToFive(xe.Sunday))}static fromMap(e,t){return new n(e.fromData(r.getRaw(t,"monday")),e.fromData(r.getRaw(t,"tuesday")),e.fromData(r.getRaw(t,"wednesday")),e.fromData(r.getRaw(t,"thursday")),e.fromData(r.getRaw(t,"friday")),e.fromData(r.getRaw(t,"saturday")),e.fromData(r.getRaw(t,"sunday")))}toMap(e){return{monday:e.toData(this.monday),tuesday:e.toData(this.tuesday),wednesday:e.toData(this.wednesday),thursday:e.toData(this.thursday),friday:e.toData(this.friday),saturday:e.toData(this.saturday),sunday:e.toData(this.sunday)}}clone(){return new n(this.monday.clone(),this.tuesday.clone(),this.wednesday.clone(),this.thursday.clone(),this.friday.clone(),this.saturday.clone(),this.sunday.clone())}isSame(e){return e===this?!0:d(e.monday,this.monday)&&d(e.tuesday,this.tuesday)&&d(e.wednesday,this.wednesday)&&d(e.thursday,this.thursday)&&d(e.friday,this.friday)&&d(e.saturday,this.saturday)&&d(e.sunday,this.sunday)}}return n.TYPE_ID="48cea499ab5340d5a4fb72025e9fac2e",n})(),sb=class extends f{build(i,e){return oA.fromMap(i,e)}},uA=(()=>{class n extends b{constructor(e,t,s,a,o,u,c,l,h){super(),this.uniqueId=e,this.creatorId=t,this.organizationId=s,this.moduleType=a,this.name=o,this.creationDate=u,this.country=c,this.language=l,this.timezone=h,this.businessRef=j.create(e,s,a)}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.get(t,"creatorId"),r.get(t,"organizationId"),y(r.get(t,"moduleType"),st),r.get(t,"name"),e.decodeDate(r.get(t,"creationDate")),y(r.get(t,"country"),Ie),y(r.get(t,"language"),$),y(r.get(t,"timezone"),Ee))}toMap(e){return{uniqueId:this.uniqueId,creatorId:this.creatorId,organizationId:this.organizationId,moduleType:m(this.moduleType),name:this.name,creationDate:e.encodeDate(this.creationDate),
3country:m(this.country),language:m(this.language),timezone:m(this.timezone)}}clone(){return new n(this.uniqueId,this.creatorId,this.organizationId,this.moduleType,this.name,g.cloneDate(this.creationDate),this.country,this.language,this.timezone)}isSame(e){return this===e?!0:e.uniqueId===this.uniqueId&&e.businessRef===this.businessRef&&e.creatorId===this.creatorId&&e.organizationId===this.organizationId&&e.name===this.name&&e.creationDate===this.creationDate&&e.country===this.country&&e.language===this.language&&e.timezone===this.timezone&&e.moduleType==this.moduleType}}return n.TYPE_ID="227059f44e234334b025549f48a2f01c",n})(),rb=class extends f{build(i,e){return uA.fromMap(i,e)}},ps=(function(n){return n.Public="Public",n.Hybrid="Hybrid",n.Hidden="Hidden",n.Internal="Internal",n})(ps||{});var xS=(()=>{class n extends b{constructor(e){super(),this.privacyMode=e}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(y(r.get(t,"privacyMode"),ps))}toMap(e){return{privacyMode:m(this.privacyMode)}}clone(){return new n(this.privacyMode)}isSame(e){return e===this?!0:e.privacyMode===this.privacyMode}}return n.TYPE_ID="e2c60f34b67e4032a34d1e2a3a923252",n})(),ab=class extends f{build(i,e){return xS.fromMap(i,e)}},FS=(()=>{class n extends b{constructor(e,t,s){super(),this.storagePath=e,this.uploadKey=t,this.photos=s}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.get(t,"storagePath"),r.get(t,"uploadKey"),r.getList(t,"photos",s=>e.fromData(s)))}toMap(e){return{storagePath:this.storagePath,uploadKey:this.uploadKey,photos:this.photos.map(t=>e.toData(t))}}clone(){return new n(this.storagePath,this.uploadKey,this.photos.map(e=>e.clone()))}isSame(e){return e===this?!0:e.storagePath===this.storagePath&&e.uploadKey===this.uploadKey&&P(e.photos,this.photos,d)}copyWith(e){var t,s,a;return new n((t=e.storagePath)!==null&&t!==void 0?t:this.storagePath,(s=e.uploadKey)!==null&&s!==void 0?s:this.uploadKey,(a=e.photos)!==null&&a!==void 0?a:this.photos.map(o=>o.clone()))}}return n.TYPE_ID="00d2ea3c2dff49fc9dd8851d6da3fd14",n})(),ob=class extends f{build(i,e){return FS.fromMap(i,e)}},ss=(function(n){return n.Unknown="Unknown",n.Calendar="Calendar",n.Pool="Pool",n.Advert="Advert",n})(ss||{}),Dd=class extends zt(b){},Tc=(()=>{class n extends Dd{constructor(e,t,s,a,o,u,c,l,h,p){super(),this.uniqueId=e,this.creatorId=t,this.creationDate=s,this.country=a,this.language=o,this.timezone=u,this.names=c,this.businessRef=l,this.webRoute=h,this.components=p}get organizationId(){var e;return(e=this.businessRef.organizationId)!==null&&e!==void 0?e:this.creatorId}get moduleType(){var e;return(e=this.businessRef.moduleType)!==null&&e!==void 0?e:st.Legacy}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(19,n.SCHEMA_VERSION)}static create(e){return new n(e.uniqueId,e.creatorId,e.creationDate,e.country,e.language,e.timezone,e.names,e.businessRef,e.webRoute,e.components)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.get(t,"creatorId"),e.decodeDate(r.get(t,"creationDate")),r.get(t,"country"),r.get(t,"language"),r.get(t,"timezone"),e.fromData(r.get(t,"names")),j.mustDecode(r.get(t,"businessRef")),r.getOrNull(t,"webRoute"),ae.deserialize(e,r.getList(t,"components",s=>s)))}toMap(e){return{uniqueId:this.uniqueId,creatorId:this.creatorId,creationDate:e.encodeDate(this.creationDate),country:this.country,language:this.language,timezone:this.timezone,names:e.toData(this.names),businessRef:this.businessRef.encode(),webRoute:this.webRoute,components:this.components.serialize(e)}}clone(){return new n(this.uniqueId,this.creatorId,this.creationDate,this.country,this.language,this.timezone,this.names.clone(),this.businessRef.clone(),this.webRoute,this.components.clone())}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.creatorId===this.creatorId&&e.country===this.country&&d(e.names,this.names)&&e.creationDate===this.creationDate&&e.timezone===this.timezone&&e.language===this.language&&d(e.businessRef,this.businessRef)&&e.webRoute===this.webRoute&&e.components.isSame(this.components)}copyWithBusinessRef(e){return new n(this.uniqueId,this.creatorId,this.creationDate,this.country,this.language,this.timezone,this.names.clone(),e.clone(),this.webRoute,this.components.c
3opyWithBusinessRef(e))}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}getSchedulingMode(){return this.components.hasComponentByTypeId(Qw.TYPE_ID)?ss.Advert:this.components.hasComponentByTypeId(yS.TYPE_ID)?ss.Pool:this.components.hasComponentByTypeId(go.TYPE_ID)?ss.Calendar:ss.Unknown}setRating(e,t){let s=new po(e,t);this.components.addOrReplaceComponent(s)}setPublishingStatus(e){let t=new rS(e);this.components.addOrReplaceComponent(t)}setBusinessSettings(e){let t=new _a(e.allowCustomBookingSettings,e.allowOpenReservations,e.localizationSettings);this.components.addOrReplaceComponent(t)}setProfileElementCache(e){let t=new IS(e);this.components.addOrReplaceComponent(t)}setLastActivityTime(e){let t=new sS(e);this.components.addOrReplaceComponent(t)}}return n.TYPE_ID="c437a22af5cf40c39b2035ce58a31f12",n.SCHEMA_VERSION=21,n})(),ub=class extends f{build(i,e){return Tc.fromMap(i,e)}onBeforeDeserialization(i,e){var t;let s=(t=Re(r.get(e,"language"),$))!==null&&t!==void 0?t:Nr(y(r.get(e,"country"),Ie));i.storage.set("language",s)}migrateToCurrentSchemaVersion(i,e){var t,s,a,o,u,c,l,h,p,I,v,E,w,S,R;let x=r.getVersionRange(e);if(x.contains(Tc.SCHEMA_VERSION))return e;if(x.isGreaterThan(Tc.SCHEMA_VERSION))return null;let N=x.to;if(N<2){let O=r.getRaw(e,"mainClassification"),A=O.indexOf("HairSalon");A>=0&&(O[A]=Fn.MensHaircut),this.migrateEnumList(e,"mainClassification",Fn),N=2}if(N<3){let O=i.fromData(r.getRaw(e,"workplacePhotos")),A=i.fromData(r.getRaw(e,"businessHours")),M=i.fromData(r.getRaw(e,"bookingSettings")),C=r.getList(e,"mainClassification",V=>V),H=i.fromData(r.getRaw(e,"healthAndSafetySettings")),B=(t=r.getOrNull(e,"showPublicBusinessHours"))!==null&&t!==void 0?t:!1,U=new ae([new en(O),new go(M),new eS(C),new iS(H),nr.fromBusinessHours(A,B)]);r.set(e,"components",U.serialize(i)),N=3}if(N<4&&(r.set(e,"schedulingMode",ss.Calendar),N=4),N<5){let O=ae.deserialize(i,r.getList(e,"components",C=>C)),A=(s=r.getOrNull(e,"totalScore"))!==null&&s!==void 0?s:0,M=(a=r.getOrNull(e,"numberOfRatings"))!==null&&a!==void 0?a:0;O.removeComponentByTypeId(po.TYPE_ID),O.addComponent(new po(A,M)),r.set(e,"components",O.serialize(i)),N=5}if(N<6&&(N=6),N<7){let O=ae.deserialize(i,r.getList(e,"components",M=>M)),A=Mi.empty();O.removeComponentByTypeId(Mi.TYPE_ID),O.addComponent(A),r.set(e,"components",O.serialize(i)),N=7}if(N<8&&(r.set(e,"richDescription",""),N=8),N<9&&(N=9),N<10){let O=r.get(e,"description"),A=r.get(e,"description");r.set(e,"description",i.toData(new Hd(O??"",A??""))),N=10}if(N<11){let O=r.get(e,"country");r.setIfNullOrUndefined(e,"language",Nr(O)),N=11}if(N<12&&(N=12),N<13){let O=ae.deserialize(i,r.getList(e,"components",U=>U)),A=i.fromData(r.getRaw(e,"location")),M=i.fromData(r.getRaw(e,"description")),C=ft.decode(r.getOrNull(e,"phoneNumber")),H=r.get(e,"language"),B=O.mustFindComponentByTypeId(Mi.TYPE_ID);O.replaceComponent(B.copyWith({phoneNumber:C})),O.addComponent(es.fromRichDescription(hn.forLanguage(H,M))),O.addComponent(new Oi(A)),r.set(e,"components",O.serialize(i)),N=13}if(N<14){let O=ae.deserialize(i,r.getList(e,"components",C=>C)),A=O.findComponentByTypeId(yr.TYPE_ID),M=O.findComponentByTypeId(en.TYPE_ID);if(M==null){let C=r.get(e,"uniqueId"),H="workplacePhotos";M=new en(new FS(`business_profiles/${C}/${H}`,`${C}.${H}`,(u=(o=A?.legacyProfilePhotos)===null||o===void 0?void 0:o.photos)!==null&&u!==void 0?u:[])),O.removeComponentByTypeId(en.TYPE_ID),O.addComponent(M)}r.set(e,"components",O.serialize(i)),N=14}if(N<15){let O=ae.deserialize(i,r.getList(e,"components",M=>M)),A=O.findComponentByTypeId(go.TYPE_ID);if(A!==null){let M=new nS(new xS((c=A.settings.legacyPrivacyMode)!==null&&c!==void 0?c:ps.Hidden));O.addComponent(M)}r.set(e,"components",O.serialize(i)),N=15}if(N<16){let O=r.get(e,"language"),A=r.get(e,"name");e.names=i.toData(Oe.forLanguage(O,A)),N=16}if(N<17&&(r.setIfNullOrUndefined(e,"organizationId",r.get(e,"creatorId")),N=17),N<18){let O=r.get(e,"uniqueId"),A=r.get(e,"organizationId"),M=j.create(O,A,st.Legacy);r.set(e,"businessRef",M.encode()),N=18}if(N<19&&(N=19),N<20){let O=ae.deserialize(i,r.getList(e,"components",A=>A));if(O.hasComponentByTypeId(yr.TYPE_ID)){let A=O.findComponentByTypeId(Oi.TYPE_ID),M=(l=O.findComponentByTypeId(ts.TYPE_ID))!==null&&l!==void 0?l:ts.empty();(h=M.coordinates)!==null&&h!==void 0||(M.coordinates=(v=(I=(p=A?.location)===null||p===void 0?void 0:p.coordinates)===null||I===void 0?void 0:I.clone())!==null&&v!==void 0?v:null),(E=M.mapPreview)!==null&&E!==void 0||(M.mapPreview=(R=(S=(w=A?.location)===null||w===void 0?void 0:w.mapPreview)===null||S===void 0?void 0:S.clone())!==null&&R!==void 0?R:null),O.addOrReplaceComponent(M)}e.components=O.serialize(i),N=20}return N<21&&(N=21),e.$schema_version=D.encodedExactly(N),e}},Oc=(()=>{class n extends Le{constructor(e,t,s,a,o,u,c,l){super(),this.uniqueId=e,this.creatorId=t,this.deviceId=s,this.creationDate=a,this.source=o,this.businessId=u,this.totalScore=c,this.numberOfRatings=l}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.getOrNull(t,"creatorId"),r.getOrNull(t,"deviceId"),e.decodeDate(r.get(t,"creationDate")),y(r.get(t,"source"),le),r.get(t,"businessId"),r.get(t,"totalScore"),r.get(t,"numberOfRatings"))}toMap(e){return{uniqueId:this.uniqueId,creatorId:this.creatorId,deviceId:this.deviceId,creationDate:e.encodeDate(this.creationDate),source:m(this.source),businessId:this.businessId,totalScore:this.totalScore,numberOfRatings:this.numberOfRatings}}clone(){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,this.businessId,this.totalScore,this.numberOfRatings)}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.creatorId===this.creatorId&&e.deviceId===this.deviceId&&e.creationDate===this.creationDate&&e.source===this.source&&e.businessId===this.businessId&&e.totalScore===this.totalScore&&e.numberOfRatings===this.numberOfRatings}}return n.TYPE_ID="6c2a42895f584a68a5b44188cc162589",n.SCHEMA_VERSION=2,n})(),cb=class extends f{build(i,e){return Oc.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(Oc.SCHEMA_VERSION))return e;
3if(t.isGreaterThan(Oc.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(s=2),e.$schema_version=D.encodedExactly(s),e}},cA=(()=>{class n extends b{constructor(e,t,s,a,o,u){super(),this.uniqueId=e,this.businessId=t,this.creationDate=s,this.redirectTo=a,this.allowWebBooking=o,this.isReadyForOnlineBooking=u}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.get(t,"businessId"),e.decodeDate(r.get(t,"creationDate")),r.getOrNull(t,"redirectTo"),r.get(t,"allowWebBooking"),r.get(t,"isReadyForOnlineBooking"))}toMap(e){return{uniqueId:this.uniqueId,businessId:this.businessId,creationDate:e.encodeDate(this.creationDate),redirectTo:this.redirectTo,allowWebBooking:this.allowWebBooking,isReadyForOnlineBooking:this.isReadyForOnlineBooking}}clone(){return new n(this.uniqueId,this.businessId,g.cloneDate(this.creationDate),this.redirectTo,this.allowWebBooking,this.isReadyForOnlineBooking)}isSame(e){return this===e?!0:e.uniqueId===this.uniqueId&&e.businessId===this.businessId&&e.creationDate===this.creationDate&&e.redirectTo===this.redirectTo&&e.allowWebBooking===this.allowWebBooking&&e.isReadyForOnlineBooking===this.isReadyForOnlineBooking}}return n.TYPE_ID="2c57cdaaccd8435fb55b745a52b95a7e",n})(),lb=class extends f{build(i,e){return cA.fromMap(i,e)}},Or=(()=>{class n extends b{constructor(e,t=null){super(),this.allowLocalization=e,this.defaultLanguage=t}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}static none(){return new n(!1,null)}static fromMap(e,t){return new n(r.get(t,"allowLocalization"),Re(r.getOrNull(t,"defaultLanguage"),$))}toMap(e){return{allowLocalization:this.allowLocalization,defaultLanguage:Se(this.defaultLanguage)}}clone(){return new n(this.allowLocalization,this.defaultLanguage)}isSame(e){return e===this?!0:e.allowLocalization===this.allowLocalization&&e.defaultLanguage===this.defaultLanguage}}return n.TYPE_ID="9b1a399859ea455ea395f401fbdab010",n.SCHEMA_VERSION=2,n})(),db=class extends f{build(i,e){return Or.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(Or.SCHEMA_VERSION))return e;if(t.isGreaterThan(Or.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(s=2),e.$schema_version=D.encodedExactly(s),e}},Qd=(()=>{class n extends b{constructor(e){super(),this.allowCalendarSharing=e}get $typeId(){return n.TYPE_ID}static none(){return new n(!1)}static fromMap(e,t){return new n(r.get(t,"allowCalendarSharing"))}toMap(e){return{allowCalendarSharing:this.allowCalendarSharing}}clone(){return new n(this.allowCalendarSharing)}isSame(e){return e===this?!0:e.allowCalendarSharing===this.allowCalendarSharing}}return n.TYPE_ID="6f028118001b4df49d8b97bbe9b9fe26",n})(),hb=class extends f{build(i,e){return Qd.fromMap(i,e)}},Rc=(()=>{class n extends b{constructor(e,t,s,a,o){super(),this.autoJoinClientsByPhoneNumber=e,this.allowCustomBookingSettings=t,this.allowOpenReservations=s,this.staffPrivacySettings=a,this.localizationSettings=o}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(2,n.SCHEMA_VERSION)}static empty(){return new n(!1,!1,!1,Qd.none(),Or.none())}static fromMap(e,t){return new n(r.get(t,"autoJoinClientsByPhoneNumber"),r.get(t,"allowCustomBookingSettings"),r.get(t,"allowOpenReservations"),e.fromData(r.get(t,"staffPrivacySettings")),e.fromData(r.get(t,"localizationSettings")))}toMap(e){return{autoJoinClientsByPhoneNumber:this.autoJoinClientsByPhoneNumber,allowCustomBookingSettings:this.allowCustomBookingSettings,allowOpenReservations:this.allowOpenReservations,staffPrivacySettings:e.toData(this.staffPrivacySettings),localizationSettings:e.toData(this.localizationSettings)}}clone(){return new n(this.autoJoinClientsByPhoneNumber,this.allowCustomBookingSettings,this.allowOpenReservations,this.staffPrivacySettings.clone(),this.localizationSettings.clone())}isSame(e){return this===e?!0:e.autoJoinClientsByPhoneNumber===this.autoJoinClientsByPhoneNumber&&e.allowCustomBookingSettings===this.allowCustomBookingSettings&&e.staffPrivacySettings===this.staffPrivacySettings&&d(e.staffPrivacySettings,this.staffPrivacySettings)&&d(e.localizationSettings,this.localizationSettings)}}return n.TYPE_ID="243a8bf8436a48e4bf55dc9ed23e9655",n.SCHEMA_VERSION=6,n})(),fb=class extends f{build(i,e){return Rc.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(Rc.SCHEMA_VERSION))return e;if(t.isGreaterThan(Rc.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(r.set(e,"autoJoinClientsByPhoneNumber",r.get(e,"autoInv
3iteClientsByPhoneNumber")),s=2),s<3&&(r.set(e,"staffPrivacySettings",i.toData(Qd.none())),s=3),s<4&&(r.set(e,"localizationSettings",i.toData(Or.none())),s=4),s<5&&(r.set(e,"allowCustomBookingSettings",!1),s=5),s<6&&(r.set(e,"allowOpenReservations",!1),s=6),e.$schema_version=D.encodedExactly(s),e}},Mc=(()=>{class n extends Le{constructor(e,t,s,a,o,u,c){super(),this.uniqueId=e,this.creatorId=t,this.deviceId=s,this.creationDate=a,this.source=o,this.business=u,this.businessId=c}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.getOrNull(t,"creatorId"),r.getOrNull(t,"deviceId"),e.decodeDate(r.get(t,"creationDate")),y(r.get(t,"source"),le),e.fromData(r.get(t,"business")),r.get(t,"businessId"))}toMap(e){return{uniqueId:this.uniqueId,creatorId:this.creatorId,deviceId:this.deviceId,creationDate:e.encodeDate(this.creationDate),source:m(this.source),business:e.toData(this.business),businessId:this.businessId}}clone(){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,this.business.clone(),this.businessId)}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.creatorId===this.creatorId&&e.deviceId===this.deviceId&&e.creationDate===this.creationDate&&e.source===this.source&&d(e.business,this.business)&&e.businessId===this.businessId}}return n.TYPE_ID="5adebbe2544f47dabeb91628a08883c9",n.SCHEMA_VERSION=2,n})(),pb=class extends f{build(i,e){return Mc.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(Mc.SCHEMA_VERSION))return e;if(t.isGreaterThan(Mc.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(s=2),e.$schema_version=D.encodedExactly(s),e}},qS=(()=>{class n extends b{constructor(e=!0,t=!0,s=3){super(),this.allowSchedulingFromTheFront=e,this.allowSchedulingFromTheBack=t,this.slotCount=s}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.get(t,"allowSchedulingFromTheFront"),r.get(t,"allowSchedulingFromTheBack"),r.get(t,"slotCount"))}toMap(){return{allowSchedulingFromTheFront:this.allowSchedulingFromTheFront,allowSchedulingFromTheBack:this.allowSchedulingFromTheBack,slotCount:this.slotCount}}clone(){return new n(this.allowSchedulingFromTheFront,this.allowSchedulingFromTheBack,this.slotCount)}isSame(e){return this===e?!0:e.allowSchedulingFromTheFront===this.allowSchedulingFromTheFront&&e.allowSchedulingFromTheBack===this.allowSchedulingFromTheBack&&e.slotCount===this.slotCount}}return n.TYPE_ID="17e2848768c34820ae52002f213e5b1d",n})(),gb=class extends f{build(i,e){return qS.fromMap(i,e)}},YS=(function(n){return n.Basic="Basic",n.Clustered="Clustered",n})(YS||{}),Nc=(()=>{class n extends b{constructor(e,t=!0,s=oe.default.duration(30,"minutes"),a=oe.default.duration(30,"days"),o=oe.default.duration(24,"hours"),u=oe.default.duration(30,"minutes"),c=oe.default.duration(0,"minutes"),l=YS.Basic,h,p,I){super(),this.legacyPrivacyMode=e,this.allowCalendarView=t,this.bookingInAdvance=s,this.bookingForFuture=a,this.cancellation=o,this.smartSchedule=u,this.breakBetweenAppointments=c,this.schedulePostProcessor=l,this.clusteredSchedulingSettings=h,this.maxUniqueServices=p,this.maxInstancesPerService=I}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}static fromMap(e,t){return new n(Re(r.getOrNull(t,"privacyMode"),ps),r.get(t,"allowCalendarView"),e.decodeDuration(r.get(t,"bookingInAdvance")),e.decodeDuration(r.get(t,"bookingForFuture")),e.decodeDuration(r.get(t,"cancellation")),e.decodeDuration(r.get(t,"smartSchedule")),e.decodeDuration(r.get(t,"breakBetweenAppointments")),r.get(t,"schedulePostProcessor"),e.fromData(r.getRaw(t,"clusteredSchedulingSettings")),Ue.decode(r.get(t,"maxUniqueServices")),Ue.decode(r.get(t,"maxInstancesPerService")))}toMap(e){return{privacyMode:Se(this.legacyPrivacyMode),allowCalendarView:this.allowCalendarView,bookingInAdvance:e.encodeDuration(this.bookingInAdvance),bookingForFuture:e.encodeDuration(this.bookingForFuture),cancellation:e.encodeDuration(this.cancellation),smartSchedule:e.encodeDuration(this.smartSchedule),breakBetweenAppointments:e.encodeDuration(this.breakBetweenAppointments),schedulePostProcessor:this.schedulePostProcessor,clusteredSchedulingSettings:e.toData(this.clusteredSchedulingSettings),maxUniqueServices:this.maxUniqueServices.encode(),maxInstancesPerService:this.maxInstancesPerService.encode()}}clone(){return new n(this.legacyPrivacyMode,this.allowCalendarView,this.bookingInAdvance,this.bookingForFuture,this.cancellation,this.smartSchedule,this.breakBetweenAppointments,this.schedulePostProcessor,this.clusteredSchedulingSettings.clone(),this.maxUniqueServices.clone(),this.maxInstancesPerService.clone())}isSame(e){return this===e?!0:e.allowCalendarView===this.allowCalendarView&&e.bookingInAdvance===this.bookingInAdvance&&e.bookingForFuture===this.bookingForFuture&&e.cancellation===this.cancellation&&e.smartSchedule===this.smartSchedule&&e.breakBetweenAppointments===this.breakBetweenAppointments&&e.schedulePostProcessor===this.schedulePostProcessor&&d(e.clusteredSchedulingSettings,this.clusteredSchedulingSettings)&&d(e.maxUniqueServices,this.maxUniqueServices)&&d(e.maxInstancesPerService,this.maxInstancesPerService)}}return n.TYPE_ID="4cbc0e9786e54d3e914658d0edc81dc1",n.SCHEMA_VERSION=8,n})(),mb=class extends f{build(i,e){return Nc.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){var t;let s=r.getVersionRange(e);if(s.contains(Nc.SCHEMA_VERSION))return e;if(s.isGreaterThan(Nc.SCHEMA_VERSION))return null;let a=s.to;if(a<2&&(r.set(e,"clusteredSchedulingSettings",i.toData(new qS)),r.set(e,"schedulePostProcessor",m(YS.Clustered)),r.set(e,"allowCalendarView",!0),r.set(e,"scheduleInterval",oe.default.duration(30,"minutes").asMilliseconds()),r.set(e,"bookableServiceCount",Ue.infinity.encode()),a=2),a<3){let o=r.get(e,"allowPublicListing"),u=r.get(e,"allowPublicCalendar");o?u?r.set(e,"privacyMode",ps.Public):r.set(e,"privacyMode",ps.Hybrid):r.set(e,"privacyMode",ps.Hidden),a=3}return a<4&&(r.set(e,"smartSchedule",r.get(e,"scheduleInterval")),a=4),a<5&&(r.set(e,"breakBetweenAppointments",0),a=5),a<6&&(r.set(e,"privacyMode",(t=r.getOrNull(e,"v6_privacyMode"))!==null&&t!==void 0?t:r.getOrNull(e,"privacyMode")),a=6),a<7&&(a=7),a<8&&(r.set(e,"maxUniqueServices",r.get(e,"bookableServiceCount")),r.setIfNullOrUndefined(e,"maxInstancesPerService",Ue.finite(Ex).encode()),a=8),e.$schema_version=D.encodedExactly(a),e}},ti=(function(n){return n.Standard="Standard",n.CalendarBooking="CalendarBooking",n.TicketAsOpenAccessPass="TicketAsOpenAccessPass",n})(ti||{}),Pc=(()=>{class n extends b{constructor(e,t,s,a,o){super(),this.strategy=e,this.shouldSe
3ndElectronicPass=t,this.shouldSendOnlyPaymentConfirmation=s,this.allowExtendedCartSize=a,this.deferOrderCompletion=o}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static create(e){return new n(e.strategy,e.shouldSendElectronicPass,e.shouldSendOnlyPaymentConfirmation,e.allowExtendedCartSize,e.deferOrderCompletion)}static standard(){return new n(ti.Standard,!1,!1,!1,!1)}static calendarBooking(){return new n(ti.CalendarBooking,!1,!1,!1,!1)}static fromMap(e,t){return new n(y(r.getString(t,"strategy"),ti),r.get(t,"shouldSendElectronicPass"),r.get(t,"shouldSendOnlyPaymentConfirmation"),r.get(t,"allowExtendedCartSize"),r.get(t,"deferOrderCompletion"))}toMap(e){return{strategy:m(this.strategy),shouldSendElectronicPass:this.shouldSendElectronicPass,shouldSendOnlyPaymentConfirmation:this.shouldSendOnlyPaymentConfirmation,allowExtendedCartSize:this.allowExtendedCartSize,deferOrderCompletion:this.deferOrderCompletion}}clone(){return new n(this.strategy,this.shouldSendElectronicPass,this.shouldSendOnlyPaymentConfirmation,this.allowExtendedCartSize,this.deferOrderCompletion)}isSame(e){return this===e?!0:e.strategy===this.strategy&&e.shouldSendElectronicPass===this.shouldSendElectronicPass&&e.shouldSendOnlyPaymentConfirmation===this.shouldSendOnlyPaymentConfirmation&&e.allowExtendedCartSize===this.allowExtendedCartSize&&e.deferOrderCompletion===this.deferOrderCompletion}toEventBookingProtocol(e){switch(this.strategy){case ti.Standard:return e.hasProductList?Xd.create():Zd.create({sendOnlyPaymentConfirmation:this.shouldSendOnlyPaymentConfirmation,allowExtendedCartSize:this.allowExtendedCartSize,deferOrderCompletion:this.deferOrderCompletion});case ti.CalendarBooking:return CS.create();case ti.TicketAsOpenAccessPass:return kS.create({shouldSendElectronicPass:this.shouldSendElectronicPass})}}}return n.TYPE_ID="4f15c35d21984983a61c3f8687361975",n.SCHEMA_VERSION=4,n})(),Ib=class extends f{build(i,e){return Pc.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){this.migrateEnum(e,"strategy",ti,ti.Standard);let t=r.getVersionRange(e);if(t.contains(Pc.SCHEMA_VERSION))return e;if(t.isGreaterThan(Pc.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(e.shouldSendElectronicPass=!0,s=2),s<3&&(e.deferOrderCompletion=!1,s=3),s<4&&(e.shouldSendOnlyPaymentConfirmation=!1,e.allowExtendedCartSize=!1,s=4),e.$schema_version=D.encodedExactly(s),e}},Ac=(()=>{class n extends Ar{constructor(e,t,s,a,o,u,c,l,h,p,I,v,E,w){super(),this.uniqueId=e,this.status=t,this.creatorId=s,this.businessRef=a,this.dayOfYear=o,this.timeOfDay=u,this.timezone=c,this.creationDate=l,this.staffMemberId=h,this.staffMember=p,this.components=I,this.duration=v,this.cancelledDate=E,this.cancelledBy=w,this.dayId=o.uniqueId,this.monthId=gi.dayOfYearToUniqueId(o)}get groupId(){return null}get parentId(){return ut.none}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(4,n.SCHEMA_VERSION)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),y(r.get(t,"$status"),St),r.get(t,"creatorId"),j.mustDecode(r.get(t,"businessRef")),e.fromData(r.get(t,"dayOfYear")),e.fromData(r.get(t,"timeOfDay")),y(r.get(t,"timezone"),Ee),e.decodeDate(r.get(t,"creationDate")),new ut(r.getOrNull(t,"staffMemberId")),e.fromDataOrNull(r.getOrNull(t,"staffMember")),ae.deserialize(e,r.get(t,"components")),e.decodeDuration(r.get(t,"duration")),e.decodeDateOrNull(r.getOrNull(t,"cancelledDate")),r.getOrNull(t,"cancelledBy"))}toMap(e){return{uniqueId:this.uniqueId,$status:m(this.status),creatorId:this.creatorId,businessRef:this.businessRef.encode(),dayId:this.dayId,monthId:this.monthId,dayOfYear:e.toData(this.dayOfYear),timeOfDay:e.toData(this.timeOfDay),duration:e.encodeDuration(this.duration),timezone:m(this.timezone),creationDate:e.encodeDate(this.creationDate),staffMemberId:this.staffMemberId.queryableValue,staffMember:e.toDataOrNull(this.staffMember),date:e.encodeDate(this.time),components:this.components.serialize(e),groupId:this.groupId,parentId:this.parentId.queryableValue,cancelledDate:e.encodeDateOrNull(this.cancelledDate),cancelledBy:this.cancelledBy}}clone(){return new n(this.uniqueId,this.status,this.creatorId,this.businessRef.clone(),this.dayOfYear.clone(),this.timeOfDay.clone(),this.timezone,g.cloneDate(this.creationDate),this.staffMemberId.clone(),Z(this.staffMember),this.components.clone(),g.cloneDuration(this.duration),g.cloneDateOrNull(this.cancelledDate),this.cancelledBy)}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.status===this.status&&e.creatorId===this.creatorId&&e.cancelledDate===this.cancelledDate&&e.cancelledBy===this.cancelledBy&&d(e.businessRef,this.businessRef)&&d(e.dayOfYear,this.dayOfYear)&&d(e.timeOfDay,this.timeOfDay)&&e.timezone===this.timezone&&e.creationDate===this.creationDate&&d(e.staffMemberId,this.staffMemberId)&&d(e.staffMember,this.staffMember)&&d(e.components,this.components)&&e.duration===this.duration}copyWithBusinessRef(e){var t,s;return new n(this.uniqueId,this.status,this.creatorId,e.clone(),this.dayOfYear.clone(),this.timeOfDay.clone(),this.timezone,g.cloneDate(this.creationDate),this.staffMemberId.clone(),(s=(t=this.staffMember)===null||t===void 0?void 0:t.copyWithBusinessRef(e))!==null&&s!==void 0?s:null,this.components.c
3opyWithBusinessRef(e),g.cloneDuration(this.duration),g.cloneDateOrNull(this.cancelledDate),this.cancelledBy)}}return n.TYPE_ID="c949b761e0e14d69b94f87fc39e90d15",n.SCHEMA_VERSION=6,n})(),Db=class extends f{build(i,e){return Ac.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(r.replace(e,"$status","DELETED",m(St.Canceled)),t.contains(Ac.SCHEMA_VERSION))return e;if(t.isGreaterThan(Ac.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(r.set(e,"components",[]),s=2),s<3&&(s=3),s<4&&(r.setIfNullOrUndefined(e,"businessRef",r.get(e,"businessId")),s=4),s<5&&(s=5),s<6&&(s=6),e.$schema_version=D.encodedExactly(s),e}},Cc=(()=>{class n extends tt{constructor(e,t,s,a,o,u=!1,c,l){super(),this.uniqueId=e,this.creatorId=t,this.deviceId=s,this.creationDate=a,this.source=o,this.seen=u,this.calendarEntry=c,this.calendarEntryId=l}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.getOrNull(t,"creatorId"),r.getOrNull(t,"deviceId"),e.decodeDate(r.get(t,"creationDate")),y(y(r.get(t,"source"),le),le),r.get(t,"seen"),e.fromData(r.get(t,"calendarEntry")),r.get(t,"calendarEntryId"))}toMap(e){return{uniqueId:this.uniqueId,creatorId:this.creatorId,deviceId:this.deviceId,creationDate:e.encodeDate(this.creationDate),source:m(this.source),calendarEntryId:this.calendarEntryId,calendarEntry:e.toData(this.calendarEntry),seen:this.seen}}clone(){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,this.seen,this.calendarEntry.clone(),this.calendarEntryId)}isSame(e){return this===e?!0:e.uniqueId===this.uniqueId&&e.creatorId===this.creatorId&&e.deviceId===this.deviceId&&e.creationDate===this.creationDate&&e.source===this.source&&e.calendarEntryId===this.calendarEntryId&&d(e.calendarEntry,this.calendarEntry)&&e.seen===this.seen}markAsSeen(){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,!0,this.calendarEntry.clone(),this.calendarEntryId)}}return n.TYPE_ID="2e80a18d13494007b237e34a2882d6b7",n.SCHEMA_VERSION=2,n})(),vb=class extends f{build(i,e){return Cc.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(Cc.SCHEMA_VERSION))return e;if(t.isGreaterThan(Cc.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(s=2),e.$schema_version=D.encodedExactly(s),e}},kc=(()=>{class n extends tt{constructor(e,t,s,a,o,u=!1,c,l){super(),this.uniqueId=e,this.creatorId=t,this.deviceId=s,this.creationDate=a,this.source=o,this.seen=u,this.calendarEntry=c,this.calendarEntryId=l}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.getOrNull(t,"creatorId"),r.getOrNull(t,"deviceId"),e.decodeDate(r.get(t,"creationDate")),y(y(r.get(t,"source"),le),le),r.get(t,"seen"),e.fromData(r.get(t,"calendarEntry")),r.get(t,"calendarEntryId"))}toMap(e){return{uniqueId:this.uniqueId,creatorId:this.creatorId,deviceId:this.deviceId,creationDate:e.encodeDate(this.creationDate),source:m(this.source),calendarEntryId:this.calendarEntryId,calendarEntry:e.toData(this.calendarEntry),seen:this.seen}}clone(){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,this.seen,this.calendarEntry.clone(),this.calendarEntryId)}isSame(e){return this===e?!0:e.uniqueId===this.uniqueId&&e.creatorId===this.creatorId&&e.deviceId===this.deviceId&&e.creationDate===this.creationDate&&e.source===this.source&&e.calendarEntryId===this.calendarEntryId&&d(e.calendarEntry,this.calendarEntry)&&e.seen===this.seen}markAsSeen(){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,!0,this.calendarEntry.clone(),this.calendarEntryId)}}return n.TYPE_ID="d399ab7d7717471f8d4a6ca879d36b8b",n.SCHEMA_VERSION=2,n})(),yb=class extends f{build(i,e){return kc.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(kc.SCHEMA_VERSION))return e;if(t.isGreaterThan(kc.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(s=2),e.$schema_version=D.encodedExactly(s),e}},_c=(()=>
3{class n extends tt{constructor(e,t,s,a,o,u=!1,c,l){super(),this.uniqueId=e,this.creatorId=t,this.deviceId=s,this.creationDate=a,this.source=o,this.seen=u,this.calendarEntry=c,this.calendarEntryId=l}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.getOrNull(t,"creatorId"),r.getOrNull(t,"deviceId"),e.decodeDate(r.get(t,"creationDate")),y(y(r.get(t,"source"),le),le),r.get(t,"seen"),e.fromData(r.get(t,"calendarEntry")),r.get(t,"calendarEntryId"))}toMap(e){return{uniqueId:this.uniqueId,creatorId:this.creatorId,deviceId:this.deviceId,creationDate:e.encodeDate(this.creationDate),source:m(this.source),calendarEntryId:this.calendarEntryId,calendarEntry:e.toData(this.calendarEntry),seen:this.seen}}clone(){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,this.seen,this.calendarEntry.clone(),this.calendarEntryId)}isSame(e){return this===e?!0:e.uniqueId===this.uniqueId&&e.creatorId===this.creatorId&&e.deviceId===this.deviceId&&e.creationDate===this.creationDate&&e.source===this.source&&e.calendarEntryId===this.calendarEntryId&&d(e.calendarEntry,this.calendarEntry)&&e.seen===this.seen}markAsSeen(){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,!0,this.calendarEntry.clone(),this.calendarEntryId)}}return n.TYPE_ID="0419ba3e6a8642d696417bb51b111ed5",n.SCHEMA_VERSION=2,n})(),bb=class extends f{build(i,e){return _c.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(_c.SCHEMA_VERSION))return e;if(t.isGreaterThan(_c.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(s=2),e.$schema_version=D.encodedExactly(s),e}},xc=(()=>{class n extends tt{constructor(e,t,s,a,o,u,c,l,h=!1,p){super(),this.uniqueId=e,this.creatorId=t,this.deviceId=s,this.creationDate=a,this.source=o,this.groupId=u,this.repeatCount=c,this.repeatInterval=l,this.seen=h,this.calendarEntry=p}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.getOrNull(t,"creatorId"),r.getOrNull(t,"deviceId"),e.decodeDate(r.get(t,"creationDate")),y(y(r.get(t,"source"),le),le),r.get(t,"groupId"),Ue.decode(r.get(t,"repeatCount")),e.decodeDuration(r.get(t,"repeatInterval")),r.get(t,"seen"),e.fromData(r.get(t,"calendarEntry")))}toMap(e){return{uniqueId:this.uniqueId,creatorId:this.creatorId,deviceId:this.deviceId,creationDate:e.encodeDate(this.creationDate),source:m(this.source),groupId:this.groupId,repeatCount:this.repeatCount.encode(),repeatInterval:e.encodeDuration(this.repeatInterval),calendarEntry:e.toData(this.calendarEntry),seen:this.seen}}clone(){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,this.groupId,this.repeatCount.clone(),this.repeatInterval,this.seen,this.calendarEntry.clone())}isSame(e){return this===e?!0:e.uniqueId===this.uniqueId&&e.creatorId===this.creatorId&&e.deviceId===this.deviceId&&e.creationDate===this.creationDate&&e.source===this.source&&e.groupId===this.groupId&&d(e.repeatCount,this.repeatCount)&&e.repeatInterval===this.repeatInterval&&d(e.calendarEntry,this.calendarEntry)&&e.seen===this.seen}markAsSeen(){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,this.groupId,this.repeatCount.clone(),this.repeatInterval,!0,this.calendarEntry.clone())}}return n.TYPE_ID="3c5deb9d65ca4d7e917bb932da3dc7f6",n.SCHEMA_VERSION=2,n})(),Eb=class extends f{build(i,e){return xc.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(xc.SCHEMA_VERSION))return e;if(t.isGreaterThan(xc.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(s=2),e.$schema_version=D.encodedExactly(s),e}},Fc=(()=>{class n extends tt{constructor(e,t,s,a,o,u=!1,c,l,h,p){super(),this.uniqueId=e,this.creatorId=t,this.deviceId=s,this.creationDate=a,this.source=o,this.seen=u,this.after=c,this.before=l,this.afterId=h,this.beforeId=p}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.getOrNull(t,"creatorId"),r.getOrNull(t,"deviceId"),e.decodeDate(r.get(t,"creationDate")),y(y(r.get(t,"source"),le),le),r.get(t,"seen"),e.fromData(r.get(t,"after")),e.fromData(r.get(t,"before")),r.get(t,"afterId"),r.get(t,"beforeId"))}toMap(e){return{uniqueId:this.uniqueId,creatorId:this.creatorId,deviceId:this.deviceId,creationDate:e.encodeDate(this.creationDate),source:m(this.source),afterId:this.afterId,beforeId:this.beforeId,after:e.toData(this.after),before:e.toData(this.before),seen:this.seen}}clone(){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,this.seen,this.after.clone(),this.before.clone(),this.afterId,this.beforeId)}isSame(e){return this===e?!0:e.uniqueId===this.uniqueId&&e.creatorId===this.creatorId&&e.deviceId===this.deviceId&&e.creationDate===this.creationDate&&e.source===this.source&&e.afterId===this.afterId&&e.beforeId===this.beforeId&&d(e.after,this.after)&&d(e.before,this.before)&&e.seen===this.seen}markAsSeen(){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,!0,this.after.clone(),this.before.clone(),this.afterId,this.beforeId)}}return n.TYPE_ID="8dee51411e1743adad8f4520a47bfcbb",n.SCHEMA_VERSION=2,n})(),wb=class extends f{build(i,e){return Fc.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(Fc.SCHEMA_VERSION))return e;if(t.isGreaterThan(Fc.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(s=2),e.$schema_version=D.encodedExactly(s),e}},qc=(()=>
3{class n extends tt{constructor(e,t,s,a,o,u=!1,c,l){super(),this.uniqueId=e,this.creatorId=t,this.deviceId=s,this.creationDate=a,this.source=o,this.seen=u,this.calendarEntry=c,this.calendarEntryId=l}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.getOrNull(t,"creatorId"),r.getOrNull(t,"deviceId"),e.decodeDate(r.get(t,"creationDate")),y(y(r.get(t,"source"),le),le),r.get(t,"seen"),e.fromData(r.get(t,"calendarEntry")),r.get(t,"calendarEntryId"))}toMap(e){return{uniqueId:this.uniqueId,creatorId:this.creatorId,deviceId:this.deviceId,creationDate:e.encodeDate(this.creationDate),source:m(this.source),calendarEntryId:this.calendarEntryId,calendarEntry:e.toData(this.calendarEntry),seen:this.seen}}clone(){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,this.seen,this.calendarEntry.clone(),this.calendarEntryId)}isSame(e){return this===e?!0:e.uniqueId===this.uniqueId&&e.creatorId===this.creatorId&&e.deviceId===this.deviceId&&e.creationDate===this.creationDate&&e.source===this.source&&e.calendarEntryId===this.calendarEntryId&&d(e.calendarEntry,this.calendarEntry)&&e.seen===this.seen}markAsSeen(){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,!0,this.calendarEntry.clone(),this.calendarEntryId)}}return n.TYPE_ID="bf4d5c82f3e74b2cb2af5de45c175a9c",n.SCHEMA_VERSION=2,n})(),Sb=class extends f{build(i,e){return qc.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(qc.SCHEMA_VERSION))return e;if(t.isGreaterThan(qc.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(s=2),e.$schema_version=D.encodedExactly(s),e}};var Yc=(()=>{class n extends Ar{constructor(e,t,s,a,o,u,c,l,h,p,I,v,E,w,S){super(),this.uniqueId=e,this.status=t,this.creatorId=s,this.businessRef=a,this.dayOfYear=o,this.timeOfDay=u,this.timezone=c,this.creationDate=l,this.staffMemberId=h,this.staffMember=p,this.components=I,this.duration=v,this.description=E,this.cancelledDate=w,this.cancelledBy=S,this.dayId=o.uniqueId,this.monthId=gi.dayOfYearToUniqueId(o)}get groupId(){return null}get parentId(){return ut.none}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(4,n.SCHEMA_VERSION)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),y(r.get(t,"$status"),St),r.get(t,"creatorId"),j.mustDecode(r.get(t,"businessRef")),e.fromData(r.get(t,"dayOfYear")),e.fromData(r.get(t,"timeOfDay")),y(r.get(t,"timezone"),Ee),e.decodeDate(r.get(t,"creationDate")),new ut(r.getOrNull(t,"staffMemberId")),e.fromDataOrNull(r.getOrNull(t,"staffMember")),ae.deserialize(e,r.get(t,"components")),e.decodeDuration(r.get(t,"duration")),r.getOrNull(t,"description"),e.decodeDateOrNull(r.getOrNull(t,"cancelledDate")),r.getOrNull(t,"cancelledBy"))}toMap(e){return{uniqueId:this.uniqueId,$status:m(this.status),creatorId:this.creatorId,businessRef:this.businessRef.encode(),dayId:this.dayId,monthId:this.monthId,dayOfYear:e.toData(this.dayOfYear),timeOfDay:e.toData(this.timeOfDay),duration:e.encodeDuration(this.duration),timezone:m(this.timezone),creationDate:e.encodeDate(this.creationDate),staffMemberId:this.staffMemberId.queryableValue,staffMember:e.toDataOrNull(this.staffMember),description:this.description,date:e.encodeDate(this.time),components:this.components.serialize(e),groupId:this.groupId,parentId:this.parentId.queryableValue,cancelledDate:e.encodeDateOrNull(this.cancelledDate),cancelledBy:this.cancelledBy}}clone(){return new n(this.uniqueId,this.status,this.creatorId,this.businessRef.clone(),this.dayOfYear.clone(),this.timeOfDay.clone(),this.timezone,g.cloneDate(this.creationDate),this.staffMemberId.clone(),Z(this.staffMember),this.components.clone(),g.cloneDuration(this.duration),this.description,g.cloneDateOrNull(this.cancelledDate),this.cancelledBy)}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.status===this.status&&e.creatorId===this.creatorId&&e.cancelledDate===this.cancelledDate&&e.cancelledBy===this.cancelledBy&&d(e.businessRef,this.businessRef)&&d(e.dayOfYear,this.dayOfYear)&&d(e.timeOfDay,this.timeOfDay)&&e.timezone===this.timezone&&e.creationDate===this.creationDate&&d(e.staffMemberId,this.staffMemberId)&&d(e.staffMember,this.staffMember)&&d(e.components,this.components)&&e.duration===this.duration&&e.description===this.description}copyWithBusinessRef(e){var t,s;return new n(this.uniqueId,this.status,this.creatorId,e.clone(),this.dayOfYear.clone(),this.timeOfDay.clone(),this.timezone,g.cloneDate(this.creationDate),this.staffMemberId.clone(),(s=(t=this.staffMember)===null||t===void 0?void 0:t.copyWithBusinessRef(e))!==null&&s!==void 0?s:null,this.components.c
3opyWithBusinessRef(e),g.cloneDuration(this.duration),this.description,g.cloneDateOrNull(this.cancelledDate),this.cancelledBy)}}return n.TYPE_ID="0764c9bef4564138837da4a1f42e3ee0",n.SCHEMA_VERSION=6,n})(),Tb=class extends f{build(i,e){return Yc.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(r.replace(e,"$status","DELETED",m(St.Canceled)),t.contains(Yc.SCHEMA_VERSION))return e;if(t.isGreaterThan(Yc.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(r.set(e,"components",[]),s=2),s<3&&(s=3),s<4&&(r.setIfNullOrUndefined(e,"businessRef",r.get(e,"businessId")),s=4),s<5&&(s=5),s<6&&(s=6),e.$schema_version=D.encodedExactly(s),e}},$c=(()=>{class n extends tt{constructor(e,t,s,a,o,u,c){super(),this.uniqueId=e,this.creatorId=t,this.deviceId=s,this.creationDate=a,this.source=o,this.seen=u,this.entry=c}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.getOrNull(t,"creatorId"),r.getOrNull(t,"deviceId"),e.decodeDate(r.get(t,"creationDate")),y(r.get(t,"source"),le),r.get(t,"seen"),e.fromData(r.get(t,"entry")))}toMap(e){return{uniqueId:this.uniqueId,creatorId:this.creatorId,deviceId:this.deviceId,creationDate:e.encodeDate(this.creationDate),source:m(this.source),seen:this.seen,entry:e.toData(this.entry)}}clone(){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,this.seen,this.entry.clone())}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.creatorId===this.creatorId&&e.deviceId===this.deviceId&&e.creationDate===this.creationDate&&e.source===this.source&&e.seen===this.seen&&d(e.entry,this.entry)}markAsSeen(){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,!0,this.entry.clone())}}return n.TYPE_ID="20a62e29eb384e1482ba2ef3d6aff9cf",n.SCHEMA_VERSION=2,n})(),Ob=class extends f{build(i,e){return $c.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains($c.SCHEMA_VERSION))return e;if(t.isGreaterThan($c.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(s=2),e.$schema_version=D.encodedExactly(s),e}},Lc=(()=>{class n extends tt{constructor(e,t,s,a,o,u,c,l){super(),this.uniqueId=e,this.creatorId=t,this.deviceId=s,this.creationDate=a,this.source=o,this.seen=u,this.entry=c,this.userId=l}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.getOrNull(t,"creatorId"),r.getOrNull(t,"deviceId"),e.decodeDate(r.get(t,"creationDate")),y(r.get(t,"source"),le),r.get(t,"seen"),e.fromData(r.get(t,"entry")),r.get(t,"userId"))}toMap(e){return{uniqueId:this.uniqueId,creatorId:this.creatorId,deviceId:this.deviceId,creationDate:e.encodeDate(this.creationDate),source:m(this.source),seen:this.seen,entry:e.toData(this.entry),userId:this.userId}}clone(){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,this.seen,this.entry.clone(),this.userId)}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.creatorId===this.creatorId&&e.deviceId===this.deviceId&&e.creationDate===this.creationDate&&e.source===this.source&&e.seen===this.seen&&d(e.entry,this.entry)&&e.userId===this.userId}markAsSeen(){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,!0,this.entry.clone(),this.userId)}copyWithBusinessRef(e){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,!0,this.entry.copyWithBusinessRef(e),this.userId)}}return n.TYPE_ID="0355106afff54c0cb9a1bea6cf0e7263",n.SCHEMA_VERSION=2,n})(),Rb=class extends f{build(i,e){return Lc.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(Lc.SCHEMA_VERSION))return e;if(t.isGreaterThan(Lc.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(s=2),e.$schema_version=D.encodedExactly(s),e}},Vc=(()=>{class n extends tt{constructor(e,t,s,a,o,u){super(),this.uniqueId=e,this.creatorId=t,this.deviceId=s,this.creationDate=a,this.source=o,this.seen=u}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.getOrNull(t,"creatorId"),r.getOrNull(t,"deviceId"),e.decodeDate(r.get(t,"creationDate")),y(r.get(t,"source"),le),r.get(t,"seen"))}toMap(e){return{uniqueId:this.uniqueId,creatorId:this.creatorId,deviceId:this.deviceId,creationDate:e.encodeDate(this.creationDate),source:m(this.source),seen:this.seen}}clone(){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,this.seen)}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.creatorId===this.creatorId&&e.deviceId===this.deviceId&&e.creationDate===this.creationDate&&e.source===this.source&&e.seen===this.seen}markAsSeen(){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,!0)}}return n.TYPE_ID="493fe0ff4785467995b16a3103b1737f",n.SCHEMA_VERSION=2,n})(),Mb=class extends f{build(i,e){return Vc.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(Vc.SCHEMA_VERSION))return e;if(t.isGreaterThan(Vc.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(s=2),e.$schema_version=D.encodedExactly(s),e}},zc=(()=>{class n extends tt{constructor(e,t,s,a,o,u,c,l){super(),this.uniqueId=e,this.creatorId=t,this.deviceId=s,this.creationDate=a,this.source=o,this.seen=u,this.client=c,this.clientId=l}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.getOrNull(t,"creatorId"),r.getOrNull(t,"deviceId"),e.decodeDate(r.get(t,"creationDate")),y(r.get(t,"source"),le),r.get(t,"seen"),e.fromData(r.get(t,"client")),r.get(t,"clientId"))}toMap(e){return{uniqueId:this.uniqueId,creatorId:this.creatorId,deviceId:this.deviceId,creationDate:e.encodeDate(this.creationDate),source:m(this.source),clientId:this.clientId,client:e.toData(this.client),seen:this.seen}}clone(){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,this.seen,this.client.clone(),this.clientId)}isSame(e){return this===e?!0:e.uniqueId===this.uniqueId&&e.creatorId===this.creatorId&&e.deviceId===this.deviceId&&e.creationDate===this.creationDate&&e.source===this.source&&e.clientId===this.clientId&&d(e.client,this.client)&&e.seen===this.seen}markAsSeen(){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,!0,this.client.clone(),this.clientId)}}return n.TYPE_ID="6956373105ca405cb7298430a95fe1b5",n.SCHEMA_VERSION=2,n})(),Nb=class extends f{build(i,e){return zc.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(zc.SCHEMA_VERSION))return e;if(t.isGreaterThan(zc.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(s=2),e.$schema_version=D.encodedExactly(s),e}},Uc=(()=>{class n extends tt{constructor(e,t,s,a,o,u,c,l){super(),this.uniqueId=e,this.creatorId=t,this.deviceId=s,this.creationDate=a,this.source=o,this.seen=u,this.client=c,this.clientId=l}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.getOrNull(t,"creatorId"),r.getOrNull(t,"deviceId"),e.decodeDate(r.get(t,"creationDate")),y(r.get(t,"source"),le),r.get(t,"seen"),e.fromData(r.get(t,"client")),r.get(t,"clientId"))}toMap(e){return{uniqueId:this.uniqueId,creatorId:this.creatorId,deviceId:this.deviceId,creationDate:e.encodeDate(this.creationDate),source:m(this.source),seen:this.seen,client:e.toData(this.client),clientId:this.clientId}}clone(){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,this.seen,this.client.clone(),this.clientId)}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.creatorId===this.creatorId&&e.deviceId===this.deviceId&&e.creationDate===this.creationDate&&e.source===this.source&&e.seen===this.seen&&d(e.client,this.client)&&e.clientId===this.clientId}markAsSeen(){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,!0,this.client.clone(),this.clientId)}}return n.TYPE_ID="de1e5b7f906843468941dd437b5df7d6",n.SCHEMA_VERSION=2,n})(),Pb=class extends f{build(i,e){return Uc.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(Uc.SCHEMA_VERSION))return e;if(t.isGreaterThan(Uc.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(s=2),e.$schema_version=D.encodedExactly(s),e}},Ci=(function(n){return n.Live="LIVE",n.Used="USED",n})(Ci||{});var vd=class extends b{},Bc=(()=>{class n extends vd{constructor(e,t,s,a,o,u,c,l=null){super(),this.uniqueId=e,this.businessRef=t,this.creationDate=s,this.expirationDate=a,this.ownerStaffId=o,this.usedBy=u,this.usedAt=c,this.status=l??Ci.Live}get businessId(){return this.businessRef.uniqueId}get hasBeenUsed(){return this.status!==Ci.Live}get hasExpired(){return k(this.expirationDate)?!1:fe.now().isAfter(this.expirationDate)}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),j.mustDecode(r.get(t,"businessRef")),e.decodeDate(r.get(t,"creationDate")),e.decodeDateOrNull(r.getOrNull(t,"expirationDate")),r.getOrNull(t,"ownerStaffId"),r.getOrNull(t,"usedBy"),e.decodeDateOrNull(r.getOrNull(t,"usedAt")),Re(r.get(t,"$status"),Ci))}toMap(e){return{uniqueId:this.uniqueId,businessRef:this.businessRef.encode(),creationDate:e.encodeDate(this.creationDate),expirationDate:e.encodeDateOrNull(this.expirationDate),ownerStaffId:this.ownerStaffId,usedBy:this.usedBy,usedAt:e.encodeDateOrNull(this.usedAt),$status:m(this.status)}}clone(){return new n(this.uniqueId,this.businessRef.clone(),this.creationDate,this.expirationDate,this.ownerStaffId,this.usedBy,g.cloneDateOrNull(this.usedAt),this.status)}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&d(e.businessRef,this.businessRef)&&e.creationDate===this.creationDate&&e.expirationDate===this.expirationDate&&e.ownerStaffId===this.ownerStaffId&&e.usedBy===this.usedBy&&e.usedAt===this.usedAt&&e.status===this.status}copyWithBusinessRef(e){return new n(this.uniqueId,e.clone(),this.creationDate,this.expirationDate,this.ownerStaffId,this.usedBy,g.cloneDateOrNull(this.usedAt),this.status)}}return n.TYPE_ID="1effe3fa00ac41608a811350fdec2282",n.SCHEMA_VERSION=6,n})(),Ab=class extends f{build(i,e){return Bc.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(Bc.SCHEMA_VERSION))return e;if(t.isGreaterThan(Bc.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(r.set(e,"$status",Ci.Live),s=2),s<3&&(s=3),s<4&&(s=4),s<5&&(s=5),s<6&&(r.setIfNullOrUndefined(e,"businessRef",r.get(e,"businessId")),s=6),e.$schema_version=D.encodedExactly(s),e}},Sn=(function(n){return n.Live="LIVE",n.Archived="ARCHIVED",n})(Sn||{}),Hc=(()=>{class n extends zt(b){constructor(e,t,s,a,o,u,c=Sn.Live,l,h,p,I,v,E,w,S){super(),this.uniqueId=e,this.firstName=t,this.lastName=s,this.creationDate=a,this.isOnlineCustomer=o,this.businessRef=u,this.status=c,this.phoneNumber=l,this.email=h,this.photo=p,this.pushNotificationToken=I,this.userId=v,this.language=E,this.components=w,this.dayOfBirth=S,this.formattedName=fi(t,s),this.initials=pi(t,s)}get isLive(){return this.status===Sn.Live}get isArchived(){return this.status===Sn.Archived}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(10,n.SCHEMA_VERSION)}static create(e){var t;return new n(e.uniqueId,e.firstName,e.lastName,e.creationDate,e.isOnlineCustomer,e.businessRef,(t=e.status)!==null&&t!==void 0?t:Sn.Live,e.phoneNumber,e.email,e.photo,e.pushNotificationToken,e.userId,e.language,e.components,e.dayOfBirth)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.getOrNull(t,"firstName"),r.getOrNull(t,"lastName"),e.decodeDate(r.get(t,"creationDate")),r.get(t,"isOnlineCustomer"),j.mustDecode(r.get(t,"businessRef")),y(r.get(t,"$status"),Sn),ft.decode(r.getOrNull(t,"phoneNumber")),r.getOrNull(t,"email"),e.fromDataOrNull(r.getOrNull(t,"photo")),r.getOrNull(t,"pushNotificationToken"),r.getOrNull(t,"userId"),Re(r.getOrNull(t,"language"),$),ae.deserialize(e,r.getList(t,"components",s=>s)),e.fromDataOrNull(r.getOrNull(t,"dayOfBirth")))}toMap(e){var t,s;return{uniqueId:this.uniqueId,firstName:this.firstName,lastName:this.lastName,creationDate:e.encodeDate(this.creationDate),isOnlineCustomer:this.isOnlineCustomer,businessRef:this.businessRef.encode(),$status:m(this.status),phoneNumber:(s=(t=this.phoneNumber)===null||t===void 0?void 0:t.encode())!==null&&s!==void 0?s:null,email:this.email,photo:e.toDataOrNull(this.photo),pushNotificationToken:this.pushNotificationToken,userId:this.userId,language:Se(this.language),components:this.components.serialize(e),dayOfBirth:e.toDataOrNull(this.dayOfBirth)}}clone(){return this.copyWith()}isSame(e){return this===e?!0:e.uniqueId===this.uniqueId&&e.firstName===this.firstName&&e.lastName===this.lastName&&e.creationDate===this.creationDate&&e.isOnlineCustomer===this.isOnlineCustomer&&d(e.businessRef,this.businessRef)&&e.status===this.status&&d(e.phoneNumber,this.phoneNumber)&&e.email===this.email&&d(e.photo,this.photo)&&d(e.dayOfBirth,this.dayOfBirth)&&e.pushNotificationToken===this.pushNotificationToken&&e.components.isSame(this.components)}copyWith(e){var t,s,{uniqueId:a=this.uniqueId,firstName:o=this.firstName,lastName:u=this.lastName,creationDate:c=g.cloneDate(this.creationDate),isOnlineCustomer:l=this.isOnlineCustomer,businessRef:h=this.businessRef.clone(),status:p=this.status,phoneNumber:I=Z(this.phoneNumber),email:v=this.email,photo:E=Z(this.photo),pushNotificationToken:w=this.pushNotificationToken,userId:S=this.userId,language:R=this.language,components:x=F(this.components),dayOfBirth:N=(s=(t=this.dayOfBirth)===null||t===void 0?void 0:t.clone())!==null&&s!==void 0?s:null}=e===void 0?{}:e;return new n(a,o,u,c,l,h,p,I,v,E,w,S,R,x,N)}copyWithBusinessRef(e){return this.copyWith({businessRef:e,components:this.components.c
3opyWithBusinessRef(e)})}assignToCustomerAccount(e){return this.copyWith({userId:e.uniqueId})}archived(){return this.copyWith({status:Sn.Archived})}alive(){return this.copyWith({status:Sn.Live})}blacklisted(){let e=this.components.clone();return e.addOrReplaceComponent(new mo(!0)),this.copyWith({components:e})}get hasJoinedByInvitation(){return this.components.hasComponentByTypeId(Ud.TYPE_ID)}get isBlacklisted(){let e=this.findComponentByTypeId(mo.TYPE_ID);return e?.isBlacklisted===!0}getOwners(){var e;let t=this.findComponentByTypeId(Bd.TYPE_ID);return(e=t?.owners)!==null&&e!==void 0?e:[]}static encodedStatusSafe(e){return m(e)}getQueryableFields(){return[this.uniqueId,this.userId,this.firstName,this.lastName,this.email].filter(_)}generateSearchQueryArray(){return co.generateSearchQueryArray(this.getQueryableFields())}}return n.TYPE_ID="df8997d8cb804ac0809d1973ea69aa0c",n.SCHEMA_VERSION=11,n})(),Cb=class extends f{build(i,e){return Hc.fromMap(i,e)}optimizeForQuery(i,e){return{search:e.generateSearchQueryArray()}}migrateToCurrentSchemaVersion(i,e){var t;let s=r.getVersionRange(e);if(r.replace(e,"$status","DELETED",m(Sn.Archived)),s.contains(Hc.SCHEMA_VERSION))return e;if(s.isGreaterThan(Hc.SCHEMA_VERSION))return null;let a=s.to;if(a<2&&(r.set(e,"$status",Sn.Live),a=2),a<3&&(a=3),a<4&&(r.set(e,"creationDate",r.get(e,"joinDate")),a=4),a<5&&(r.setIfNullOrUndefined(e,"joinDate",r.getOrNull(e,"v5_joinDate")),a=5),a<6&&(r.setIfNullOrUndefined(e,"owners",[]),a=6),a<7&&(r.setIfNullOrUndefined(e,"businessRef",r.get(e,"businessId")),a=7),a<8&&(r.setIfNullOrUndefined(e,"isBlacklisted",!1),a=8),a<9){let o=ae.deserialize(i,r.getList(e,"components",w=>w)),u=r.get(e,"isBlacklisted"),c=r.getOrNull(e,"overrideFirstName"),l=r.getOrNull(e,"overrideLastName"),h=r.getList(e,"owners",w=>w),p=r.getOrNull(e,"notes"),I=i.decodeDate(r.get(e,"creationDate")),v=i.decodeDateOrNull(r.getOrNull(e,"joinDate")),E=(t=r.getOrNull(e,"hasJoinedByInvitation"))!==null&&t!==void 0?t:!1;o.addOrReplaceComponent(new mo(u)),o.addOrReplaceComponent(new aS(c,l)),o.addOrReplaceComponent(new Bd(h)),o.addOrReplaceComponent(new mS(p??"")),E&&o.addOrReplaceComponent(new Ud(v??I,null)),e.components=o.serialize(i),a=9}return a<10&&(e.isOnlineCustomer=e.isOnlineClient,a=10),a<11&&(a=11),e.$schema_version=D.encodedExactly(a),e}},Gc=(()=>{class n extends b{constructor(e,t,s,a,o){super(),this.uniqueId=e,this.businessRef=t,this.customerId=s,this.creationDate=a,this.isBlacklisted=o}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),j.mustDecode(r.get(t,"businessRef")),r.get(t,"customerId"),e.decodeDate(r.get(t,"creationDate")),r.get(t,"isBlacklisted"))}toMap(e){return{uniqueId:this.uniqueId,businessRef:this.businessRef.encode(),customerId:this.customerId,creationDate:e.encodeDate(this.creationDate),isBlacklisted:this.isBlacklisted}}clone(){return new n(this.uniqueId,this.businessRef.clone(),this.customerId,g.cloneDate(this.creationDate),this.isBlacklisted)}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&d(e.businessRef,this.businessRef)&&e.customerId===this.customerId&&e.creationDate===this.creationDate&&e.isBlacklisted===this.isBlacklisted}copyWithBusinessRef(e){return new n(this.uniqueId,e.clone(),this.customerId,g.cloneDate(this.creationDate),this.isBlacklisted)}copyWith(e){var t,s,a,o;return new n((t=e?.uniqueId)!==null&&t!==void 0?t:this.uniqueId,this.businessRef.clone(),(s=e?.customerId)!==null&&s!==void 0?s:this.customerId,(a=e?.creationDate)!==null&&a!==void 0?a:g.cloneDate(this.creationDate),(o=e?.isBlacklisted)!==null&&o!==void 0?o:this.isBlacklisted)}}return n.TYPE_ID="61dd590312de4a5baeed041679d1cb37",n.SCHEMA_VERSION=4,n})(),kb=class extends f{build(i,e){return Gc.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){var t;let s=r.getVersionRange(e);if(s.contains(Gc.SCHEMA_VERSION))return e;if(s.isGreaterThan(Gc.SCHEMA_VERSION))return null;let a=s.to;return a<2&&(r.setIfNullOrUndefined(e,"businessRef",r.get(e,"businessId")),a=2),a<3&&((t=e.isBlacklisted)!==null&&t!==void 0||(e.isBlacklisted=!1),a=3),a<4&&(e.customerId=e.clientId,a=4),e.$schema_version=D.encodedExactly(a),e}},Wc=(()=>{class n extends tt{constructor(e,t,s,a,o,u,c,l){super(),this.uniqueId=e,this.creatorId=t,this.deviceId=s,this.creationDate=a,this.source=o,this.seen=u,this.client=c,this.clientId=l}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.getOrNull(t,"creatorId"),r.getOrNull(t,"deviceId"),e.decodeDate(r.get(t,"creationDate")),y(r.get(t,"source"),le),r.get(t,"seen"),e.fromData(r.getRaw(t,"client")),r.get(t,"clientId"))}toMap(e){return{uniqueId:this.uniqueId,creatorId:this.creatorId,deviceId:this.deviceId,creationDate:e.encodeDate(this.creationDate),source:m(this.source),clientId:this.clientId,client:e.toData(this.client),seen:this.seen}}clone(){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,this.seen,this.client.clone(),this.clientId)}isSame(e){return this===e?!0:e.uniqueId===this.uniqueId&&e.creatorId===this.creatorId&&e.deviceId===this.deviceId&&e.creationDate===this.creationDate&&e.source===this.source&&e.clientId===this.clientId&&d(e.client,this.client)&&e.seen===this.seen}markAsSeen(){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,!0,this.client.clone(),this.clientId)}}return n.TYPE_ID="50c5848532b54ff3b791ba32840b8573",n.SCHEMA_VERSION=2,n})(),_b=class extends f{build(i,e){return Wc.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(Wc.SCHEMA_VERSION))return e;if(t.isGreaterThan(Wc.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(s=2),e.$schema_version=D.encodedExactly(s),e}},jc=(()=>{class n extends tt{constructor(e,t,s,a,o,u=!1){super(),this.uniqueId=e,this.creatorId=t,this.deviceId=s,this.creationDate=a,this.source=o,this.seen=u}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.getOrNull(t,"creatorId"),r.getOrNull(t,"deviceId"),e.decodeDate(r.get(t,"creationDate")),y(r.get(t,"source"),le),r.get(t,"seen"))}toMap(e){return{uniqueId:this.uniqueId,creatorId:this.creatorId,deviceId:this.deviceId,creationDate:e.encodeDate(this.creationDate),source:m(this.source),seen:this.seen}}clone(){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,this.seen)}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.creatorId===this.creatorId&&e.deviceId===this.deviceId&&e.creationDate===this.creationDate&&e.source===this.source&&e.seen==this.seen}markAsSeen(){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,!0)}}return n.TYPE_ID="249eda6c53ea4bc8ba5d2afb11752a4c",n.SCHEMA_VERSION=2,n})(),xb=class extends f{build(i,e){return jc.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(jc.SCHEMA_VERSION))return e;if(t.isGreaterThan(jc.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(s=2),e.$schema_version=D.encodedExactly(s),e}},lA=(function(n){return n.AppointmentReminder="AppointmentReminder",n})(lA||{}),dA=(function(n){return n.Upcoming="UPCOMING",n.Sent="SENT",n.Cancelled="CANCELLED",n})(dA||{}),hA=(()=>{class n extends b{constructor(e,t,s,a,o,u,c,l,h){super(),this.uniqueId=e,this.status=t,this.type=s,this.groupId=a,this.templateId=o,this.creatorId=u,this.creationDate=c,this.expirationDate=l,this.components=h}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.get(t,"uniqueId"),y(r.get(t,"$status"),dA),y(r.get(t,"type"),lA),r.get(t,"groupId"),r.get(t,"templateId"),r.getOrNull(t,"creatorId"),e.decodeDate(r.get(t,"creationDate")),e.decodeDate(r.get(t,"expirationDate")),ae.deserialize(e,r.get(t,"components")))}toMap(e){return{uniqueId:this.uniqueId,$status:m(this.status),type:m(this.type),groupId:this.groupId,templateId:this.templateId,creatorId:this.creatorId,creationDate:e.encodeDate(this.creationDate),formattedCreationDate:this.creationDate.format("MMMM DD, YYYY HH:mm:ss Z"),expirationDate:e.encodeDate(this.expirationDate),formattedExpirationDate:this.expirationDate.format("MMMM DD, YYYY HH:mm:ss Z"),components:this.components.serialize(e)}}clone(){return new n(this.uniqueId,this.status,this.type,this.groupId,this.templateId,this.creatorId,g.cloneDate(this.creationDate),g.cloneDate(this.expirationDate),this.components.clone())}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.status===this.status&&e.type===this.type&&e.groupId===this.groupId&&e.templateId===this.templateId&&e.creatorId===this.creatorId&&e.creationDate===this.creationDate&&e.expirationDate===this.expirationDate&&d(e.components,this.components)}copyWithBusinessRef(e){return new n(this.uniqueId,this.status,this.type,this.groupId,this.templateId,this.creatorId,g.cloneDate(this.creationDate),g.cloneDate(this.expirationDate),this.components.c
3opyWithBusinessRef(e))}}return n.TYPE_ID="44dbee2a946d4a8582f90c673e5770f3",n})(),Fb=class extends f{build(i,e){return hA.fromMap(i,e)}},fA=(()=>{class n extends b{constructor(e,t){super(),this.enabled=e,this.shrinkAmount=t}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.get(t,"enabled"),r.get(t,"shrinkAmount"))}toMap(e){return{enabled:this.enabled,shrinkAmount:this.shrinkAmount}}clone(){return new n(this.enabled,this.shrinkAmount)}isSame(e){return e===this?!0:e.enabled===this.enabled&&e.shrinkAmount===this.shrinkAmount}}return n.TYPE_ID="4ace5e717e004fa4bb2e8ebd27a16653a",n})(),qb=class extends f{build(i,e){return fA.fromMap(i,e)}},Ka=(()=>{class n extends b{constructor(e,t,s,a,o,u,c,l,h){super(),this.names=e,this.country=t,this.language=s,this.timezone=a,this.phoneNumber=o,this.address=u,this.coordinates=c,this.webRoute=l,this.dateSpan=h}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(3,n.SCHEMA_VERSION)}static create(e){return new n(e.names,e.country,e.language,e.timezone,e.phoneNumber,e.address,e.coordinates,e.webRoute,e.dateSpan)}static forCalendarOrder(e){var t,s,a,o,u,c;let l=e.profile.mustFindComponentByTypeId(Mi.TYPE_ID),h=e.profile.mustFindComponentByTypeId(Oi.TYPE_ID);return new n(e.profile.names,e.profile.country,e.profile.language,e.profile.timezone,(s=(t=l.phoneNumber)===null||t===void 0?void 0:t.clone())!==null&&s!==void 0?s:null,(o=(a=h.location.address)===null||a===void 0?void 0:a.clone())!==null&&o!==void 0?o:null,(c=(u=h.location.coordinates)===null||u===void 0?void 0:u.clone())!==null&&c!==void 0?c:null,e.profile.webRoute,e.dateSpan)}static forTicketOrProductOrder(e){var t,s,a,o,u,c;let l=e.profile.mustFindComponentByTypeId(ws.TYPE_ID),h=e.profile.findComponentByTypeId(_t.TYPE_ID),p=e.profile.findComponentByTypeId(us.TYPE_ID),I=e.profile.findComponentByTypeId(dn.TYPE_ID),v=(t=h?.mapLocation)!==null&&t!==void 0?t:p?.place.mapLocation;return new n(l.names.clone(),e.profile.country,e.profile.language,e.profile.timezone,null,(a=(s=v?.address)===null||s===void 0?void 0:s.clone())!==null&&a!==void 0?a:null,(u=(o=v?.coordinates)===null||o===void 0?void 0:o.clone())!==null&&u!==void 0?u:null,e.profile.webRoute,(c=I?.dateSpan)!==null&&c!==void 0?c:null)}static forBusiness(e){return new n(Oe.localized(new Map([[$.English,e.business.name]])),e.business.country,e.business.language,e.business.timezone,null,null,null,null,null)}static forThirdPartyTicket(e){var t,s,a,o,u,c;let l=e.profile.mustFindComponentByTypeId(ws.TYPE_ID),h=e.profile.findComponentByTypeId(_t.TYPE_ID),p=e.profile.findComponentByTypeId(us.TYPE_ID),I=e.profile.findComponentByTypeId(dn.TYPE_ID),v=(t=h?.mapLocation)!==null&&t!==void 0?t:p?.place.mapLocation;return new n(l.names.clone(),e.profile.country,e.profile.language,e.profile.timezone,null,(a=(s=v?.address)===null||s===void 0?void 0:s.clone())!==null&&a!==void 0?a:null,(u=(o=v?.coordinates)===null||o===void 0?void 0:o.clone())!==null&&u!==void 0?u:null,e.profile.webRoute,(c=I?.dateSpan)!==null&&c!==void 0?c:null)}static fromMap(e,t){return new n(e.fromData(r.get(t,"names")),y(r.get(t,"country"),Ie),y(r.get(t,"language"),$),y(r.get(t,"timezone"),Ee),ft.decode(r.getOrNull(t,"phoneNumber")),e.fromDataOrNull(r.getOrNull(t,"address")),e.fromDataOrNull(r.getOrNull(t,"coordinates")),r.getOrNull(t,"webRoute"),e.fromDataOrNull(r.getOrNull(t,"dateSpan")))}toMap(e){var t,s;return{names:e.toData(this.names),country:m(this.country),language:m(this.language),timezone:m(this.timezone),phoneNumber:(s=(t=this.phoneNumber)===null||t===void 0?void 0:t.encode())!==null&&s!==void 0?s:null,address:e.toDataOrNull(this.address),coordinates:e.toDataOrNull(this.coordinates),webRoute:this.webRoute,dateSpan:e.toDataOrNull(this.dateSpan)}}clone(){var e,t,s,a,o,u,c,l;return new n(this.names.clone(),this.country,this.language,this.timezone,(t=(e=this.phoneNumber)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null,(a=(s=this.address)===null||s===void 0?void 0:s.clone())!==null&&a!==void 0?a:null,(u=(o=this.coordinates)===null||o===void 0?void 0:o.clone())!==null&&u!==void 0?u:null,this.webRoute,(l=(c=this.dateSpan)===null||c===void 0?void 0:c.clone())!==null&&l!==void 0?l:null)}isSame(e){return this===e?!0:d(e.names,this.names)&&d(e.dateSpan,this.dateSpan)&&e.country===this.country&&e.language===this.language&&e.timezone===this.timezone&&e.phoneNumber===this.phoneNumber&&d(e.address,this.address)&&d(e.coordinates,this.coordinates)&&e.webRoute===this.webRoute}}return n.TYPE_ID="fa13268f25f445c98aa5394b962f6f10",n.SCHEMA_VERSION=5,n})(),Yb=class extends f{build(i,e){return Ka.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){var t,s,a,o;let u=r.getVersionRange(e);if(u.contains(Ka.SCHEMA_VERSION))return e;if(u.isGreaterThan(Ka.SCHEMA_VERSION))return null;
3let c=u.to;if(c<2&&(c=2),c<3){c=3;let l=y(r.get(e,"country"),Ie),h=(s=(t=i.storage.get("language"))!==null&&t!==void 0?t:Nr(l))!==null&&s!==void 0?s:$.English,p=r.get(e,"name");e.names=i.toData(Oe.forLanguage(h,p))}if(c<4){c=4;let l=y(r.get(e,"country"),Ie),h=(o=(a=i.storage.get("language"))!==null&&a!==void 0?a:Nr(l))!==null&&o!==void 0?o:$.English;e.language=m(h)}return c<5&&(c=5),e.$schema_version=D.encodedExactly(c),e}},Za=(function(n){return n.Call="Call",n.Message="Message",n})(Za||{}),pA=(()=>{class n extends b{constructor(e,t){super(),this.title=e,this.body=t}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.title,e.body)}static fromMap(e,t){return new n(r.get(t,"title"),r.get(t,"body"))}toMap(e){return{title:this.title,body:this.body}}clone(){return new n(this.title,this.body)}isSame(e){return e===this?!0:e.title===this.title&&e.body===this.body}}return n.TYPE_ID="fb6224248d3e4545bad204b438fa3e5e",n})(),$b=class extends f{build(i,e){return pA.fromMap(i,e)}};var yd=class extends b{},gA=(()=>{class n extends yd{constructor(e,t,s,a,o,u,c){super(),this.uniqueId=e,this.firstName=t,this.lastName=s,this.email=a,this.phoneNumber=o,this.creationDate=u,this.components=c,this.formattedName=fi(t,s),this.initials=pi(t,s)}get $typeId(){return n.TYPE_ID}get hasAName(){return this.firstName!==null&&this.firstName.length!==0||this.lastName!==null&&this.lastName.length!==0}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.get(t,"firstName"),r.get(t,"lastName"),r.get(t,"email"),ft.decode(r.getOrNull(t,"phoneNumber")),e.decodeDate(r.get(t,"creationDate")),ae.deserialize(e,r.getList(t,"components",s=>s)))}toMap(e){var t,s;return{uniqueId:this.uniqueId,firstName:this.firstName,lastName:this.lastName,email:this.email,phoneNumber:(s=(t=this.phoneNumber)===null||t===void 0?void 0:t.encode())!==null&&s!==void 0?s:null,creationDate:e.encodeDateOrNull(this.creationDate),components:this.components.serialize(e)}}clone(){var e,t;return new n(this.uniqueId,this.firstName,this.lastName,this.email,(t=(e=this.phoneNumber)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null,g.cloneDate(this.creationDate),this.components.clone())}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.firstName===this.firstName&&e.lastName===this.lastName&&e.email===this.email&&d(e.phoneNumber,this.phoneNumber)&&e.creationDate===this.creationDate&&e.components.isSame(this.components)}copyWith(e){var t,s,a,o,u,c,l,h,p;return new n((t=e?.uniqueId)!==null&&t!==void 0?t:this.uniqueId,(s=e?.firstName)!==null&&s!==void 0?s:this.firstName,(a=e?.lastName)!==null&&a!==void 0?a:this.lastName,(o=e?.email)!==null&&o!==void 0?o:this.email,(u=e?.phoneNumber)!==null&&u!==void 0?u:this.phoneNumber,(c=e?.creationDate)!==null&&c!==void 0?c:(h=(l=this.creationDate)===null||l===void 0?void 0:l.clone())!==null&&h!==void 0?h:null,(p=e?.components)!==null&&p!==void 0?p:this.components.clone())}hasComponentByTypeId(e){return this.components.hasComponentByTypeId(e)}mustFindComponentByTypeId(e){return this.components.mustFindComponentByTypeId(e)}findComponentByTypeId(e){return this.components.findComponentByTypeId(e)}findComponentByInstanceId(e){return this.components.findComponentByInstanceId(e)}findComponentsByTypeId(e){return this.components.findComponentsByTypeId(e)}addComponent(e){this.components.addComponent(e)}addComponents(e){this.components.addComponents(e)}removeComponentByTypeId(e){return this.components.removeComponentByTypeId(e)}removeComponentByInstanceId(e){return this.components.removeComponentByInstanceId(e)}removeComponentAt(e){this.components.removeComponentAt(e)}removeAllComponents(){this.components.removeAllComponents()}popAllComponentsByTypeId(e){return this.components.popAllComponentsByTypeId(e)}popComponentByTypeId(e){return this.components.popComponentByTypeId(e)}popComponent(e){return this.components.popComponent(e)}replaceComponent(e){return this.components.replaceComponent(e)}addOrReplaceComponent(e){this.components.addOrReplaceComponent(e)}mustFindComponentField(e,t){return this.components.mustFindComponentField(e,t)}findComponentField(e,t){return this.components.findComponentField(e,t)}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="aa9b3472388f46c5a42cbaaaabadde03",n})(),Lb=class extends f{build(i,e){return gA.fromMap(i,e)}},Jc=(()=>{class n extends yd{constructor(e,t,s,a,o,u,c,l,h){super(),this.uniqueId=e,this.firstName=t,this.lastName=s,this.email=a,this.phoneNumber=o,this.photo=u,this.pushNotificationToken=c,this.creationDate=l,this.components=h,this.formattedName=fi(t,s),this.initials=pi(t,s)}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}get hasAName(){return this.firstName!==null&&this.firstName.length!==0||this.lastName!==null&&this.lastName.length!==0}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.get(t,"firstName"),r.get(t,"lastName"),r.get(t,"email"),ft.mustDecode(r.get(t,"phoneNumber")),e.fromDataOrNull(r.getRaw(t,"photo")),r.getOrNull(t,"pushNotificationToken"),e.decodeDateOrNull(r.getOrNull(t,"creationDate")),ae.deserialize(e,r.getList(t,"components",s=>s)))}toMap(e){return{uniqueId:this.uniqueId,firstName:this.firstName,lastName:this.lastName,email:this.email,phoneNumber:this.phoneNumber.encode(),photo:e.toDataOrNull(this.photo),pushNotificationToken:this.pushNotificationToken,creationDate:e.encodeDateOrNull(this.creationDate),
3components:this.components.serialize(e)}}clone(){var e,t;return new n(this.uniqueId,this.firstName,this.lastName,this.email,this.phoneNumber.clone(),(t=(e=this.photo)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null,this.pushNotificationToken,g.cloneDateOrNull(this.creationDate),this.components.clone())}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.firstName===this.firstName&&e.lastName===this.lastName&&e.email===this.email&&d(e.phoneNumber,this.phoneNumber)&&d(e.photo,this.photo)&&e.pushNotificationToken===this.pushNotificationToken&&e.creationDate===this.creationDate&&e.components.isSame(this.components)}copyWith(e){var t,s,a,o,u,c,l,h,p,I,v;return new n((t=e?.uniqueId)!==null&&t!==void 0?t:this.uniqueId,(s=e?.firstName)!==null&&s!==void 0?s:this.firstName,(a=e?.lastName)!==null&&a!==void 0?a:this.lastName,(o=e?.email)!==null&&o!==void 0?o:this.email,(u=e?.phoneNumber)!==null&&u!==void 0?u:this.phoneNumber,(c=e?.photo)!==null&&c!==void 0?c:this.photo,e?.pushNotificationToken==null?null:(l=e?.pushNotificationToken)!==null&&l!==void 0?l:this.pushNotificationToken,(h=e?.creationDate)!==null&&h!==void 0?h:(I=(p=this.creationDate)===null||p===void 0?void 0:p.clone())!==null&&I!==void 0?I:null,(v=e?.components)!==null&&v!==void 0?v:this.components.clone())}hasComponentByTypeId(e){return this.components.hasComponentByTypeId(e)}mustFindComponentByTypeId(e){return this.components.mustFindComponentByTypeId(e)}findComponentByTypeId(e){return this.components.findComponentByTypeId(e)}findComponentByInstanceId(e){return this.components.findComponentByInstanceId(e)}findComponentsByTypeId(e){return this.components.findComponentsByTypeId(e)}addComponent(e){this.components.addComponent(e)}addComponents(e){this.components.addComponents(e)}removeComponentByTypeId(e){return this.components.removeComponentByTypeId(e)}removeComponentByInstanceId(e){return this.components.removeComponentByInstanceId(e)}removeComponentAt(e){this.components.removeComponentAt(e)}removeAllComponents(){this.components.removeAllComponents()}popAllComponentsByTypeId(e){return this.components.popAllComponentsByTypeId(e)}popComponentByTypeId(e){return this.components.popComponentByTypeId(e)}popComponent(e){return this.components.popComponent(e)}replaceComponent(e){return this.components.replaceComponent(e)}addOrReplaceComponent(e){this.components.addOrReplaceComponent(e)}mustFindComponentField(e,t){return this.components.mustFindComponentField(e,t)}findComponentField(e,t){return this.components.findComponentField(e,t)}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="12807bac2fb34d99b7924b5413db42a7",n.SCHEMA_VERSION=5,n})(),Vb=class extends f{build(i,e){return Jc.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(Jc.SCHEMA_VERSION))return e;if(t.isGreaterThan(Jc.SCHEMA_VERSION))return null;let s=t.to;return s<4&&(s=4),s<5&&(s=5),e.$schema_version=D.encodedExactly(s),e}},mA=(()=>{class n extends b{constructor(e,t,s,a,o){super(),this.uniqueId=e,this.creationDate=t,this.email=s,this.phoneNumber=a,this.authenticationProviders=o}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.get(t,"uniqueId"),e.decodeDate(r.get(t,"creationDate")),r.getOrNull(t,"email"),r.getOrNull(t,"phoneNumber"),r.getList(t,"authenticationProviders",s=>s))}toMap(e){return{uniqueId:this.uniqueId,creationDate:e.encodeDate(this.creationDate),email:this.email,phoneNumber:this.phoneNumber,authenticationProviders:this.authenticationProviders}}clone(){return new n(this.uniqueId,g.cloneDate(this.creationDate),this.email,this.phoneNumber,this.authenticationProviders.map(e=>e))}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.creationDate===this.creationDate&&e.email===this.email&&e.phoneNumber===this.phoneNumber&&P(e.authenticationProviders,this.authenticationProviders)}}return n.TYPE_ID="8240a2bb46f747a3a61e2cdc11c0022a",n})(),zb=class extends f{build(i,e){return mA.fromMap(i,e)}},IA=(()=>{class n extends b{constructor(e,t,s,a,o,u){super(),this.dayOfYear=e,this.timezone=t,this.scheduleTemplateId=s,this.scheduleTemplateName=a,this.times=o,this.closed=u,this.uniqueId=n.getUniqueId(e),this.localDate=this.dayOfYear.toDate(g.ofRegion(t))}get timestamp(){return this.localDate.valueOf()}get hasAnyHoursDefined(){return!this.closed&&this.times.length>0}get $typeId(){return n.TYPE_ID}static closed(e,t){return new n(Mn.fromDate(t),e,null,null,[],!0)}static fromMap(e,t){return new n(e.fromData(r.getRaw(t,"dayOfYear")),r.get(t,"timezone"),r.getOrNull(t,"scheduleTemplateId"),r.getOrNull(t,"scheduleTemplateName"),r.getList(t,"times",s=>e.fromData(s)),r.get(t,"closed"))}toMap(e){return{dayOfYear:e.toData(this.dayOfYear),timezone:this.timezone,times:this.times.map(t=>e.toData(t)),closed:this.closed,scheduleTemplateId:this.scheduleTemplateId,scheduleTemplateName:this.scheduleTemplateName}}clone(){return new n(this.dayOfYear.clone(),this.timezone,this.scheduleTemplateId,this.scheduleTemplateName,this.times.map(e=>e.clone()),this.closed)}isSame(e){return this===e?!0:d(e.dayOfYear,this.dayOfYear)&&P(e.times,this.times,d)&&e.timezone===this.timezone&&e.closed===this.closed&&e.scheduleTemplateId===this.scheduleTemplateId&&e.scheduleTemplateName===this.scheduleTemplateName}static getUniqueId(e){return`${e.year}.${e.month.toString().padStart(2,"0")}.${e.day.toString().padStart(2,"0")}`}}
3return n.TYPE_ID="475589a04fc2461fab74d28707cd5322",n})(),Ub=class extends f{build(i,e){return IA.fromMap(i,e)}},DA=(()=>{class n extends b{constructor(e,t,s){super(),this.ordersPerService=e,this.incomePerService=t,this.currency=s}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.getMap(t,"ordersPerService",(s,a)=>({key:s,value:Number(a)})),r.getMap(t,"incomePerService",(s,a)=>({key:s,value:e.fromData(a)})),r.get(t,"currency"))}toMap(e){return{ordersPerService:se(this.ordersPerService,(t,s)=>({key:t.toString(),value:s})),incomePerService:se(this.incomePerService,(t,s)=>({key:t,value:e.toData(s)})),currency:this.currency}}clone(){return new n(ee(this.ordersPerService),ee(this.incomePerService),this.currency)}isSame(e){return this===e?!0:re(e.ordersPerService,this.ordersPerService)&&re(e.incomePerService,this.incomePerService,d)&&e.currency===this.currency}}return n.TYPE_ID="387dcdd7741d43739dfc1a9688abd96a",n})(),Bb=class extends f{build(i,e){return DA.fromMap(i,e)}},$S=(()=>{class n extends b{constructor(e,t){super(),this.from=e,this.to=t}get $typeId(){return n.TYPE_ID}get isExact(){return this.from.isSame(this.to)}duration(){let e=this.from.utcOffset(),t=this.to.utcOffset();if(e===t)return oe.default.duration(this.from.diff(this.to));let s=e-t,a=this.from.diff(this.to,"milliseconds")+s*so;return oe.default.duration(a,"milliseconds")}toFormattedString(){return this.from.isSame(this.to)?this.from.format("DD.MM"):`${this.from.format("DD.MM")}-${this.to.format("DD.MM")}`}static fromMap(e,t){return new n(e.decodeDate(r.get(t,"from")),e.decodeDate(r.get(t,"to")))}toMap(e){return{from:e.encodeDate(this.from),to:e.encodeDate(this.to)}}clone(){return new n(this.from,this.to)}isSame(e){return e===this?!0:e.from===this.from&&e.to===this.to}atTimeZone(e){return new n(g.ofRegion(e).convert(this.from),g.ofRegion(e).convert(this.to))}contains(e){return e.isAfter(this.from)&&e.isBefore(this.to)}includes(e){return this.from.isBefore(e.from)&&this.to.isAfter(e.to)}intersects(e){return this.contains(e.from)||this.contains(e.to)||e.includes(this)}}return n.TYPE_ID="4d9da12e3f9d4ce0b3f4136efafd09ec",n})(),Hb=class extends f{build(i,e){return $S.fromMap(i,e)}},vA=(function(n){return n.Live="LIVE",n.Used="USED",n})(vA||{}),yA=(()=>{class n extends b{constructor(e,t,s,a,o,u,c){super(),this.uniqueId=e,this.userId=t,this.email=s,this.creationDate=a,this.expirationDate=o,this.usedAt=u,this.status=c}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.get(t,"userId"),r.get(t,"email"),e.decodeDate(r.get(t,"creationDate")),e.decodeDate(r.get(t,"expirationDate")),e.decodeDateOrNull(r.getOrNull(t,"usedAt")),y(r.get(t,"$status"),vA))}toMap(e){return{uniqueId:this.uniqueId,userId:this.userId,email:this.email,creationDate:e.encodeDate(this.creationDate),expirationDate:e.encodeDate(this.expirationDate),usedAt:e.encodeDateOrNull(this.usedAt),$status:m(this.status)}}clone(){return new n(this.uniqueId,this.userId,this.email,g.cloneDate(this.creationDate),g.cloneDate(this.expirationDate),g.cloneDateOrNull(this.usedAt),this.status)}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.userId===this.userId&&e.email===this.email&&e.creationDate===this.creationDate&&e.expirationDate===this.expirationDate&&e.usedAt===this.usedAt&&e.status===this.status}copyWith(e){var t,s,a,o,u,c,l;return new n((t=e?.uniqueId)!==null&&t!==void 0?t:this.uniqueId,(s=e?.userId)!==null&&s!==void 0?s:this.userId,(a=e?.email)!==null&&a!==void 0?a:this.email,(o=e?.creationDate)!==null&&o!==void 0?o:g.cloneDate(this.creationDate),(u=e?.expirationDate)!==null&&u!==void 0?u:g.cloneDate(this.expirationDate),e?.usedAt===null?null:(c=e?.usedAt)!==null&&c!==void 0?c:this.usedAt,(l=e?.status)!==null&&l!==void 0?l:this.status)}}return n.TYPE_ID="0d9e2cfeb6c44eb4864e16092d166451",n})(),Gb=class extends f{build(i,e){return yA.fromMap(i,e)}},bA=(()=>{class n extends Le{constructor(e,t,s,a,o,u){super(),this.uniqueId=e,this.creatorId=t,this.deviceId=s,this.creationDate=a,this.source=o,this.eventId=u}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.getOrNull(t,"creatorId"),r.getOrNull(t,"deviceId"),e.decodeDate(r.get(t,"creationDate")),y(r.get(t,"source"),le),r.get(t,"eventId"))}toMap(e){return{uniqueId:this.uniqueId,creatorId:this.creatorId,deviceId:this.deviceId,creationDate:e.encodeDate(this.creationDate),source:m(this.source),eventId:this.eventId}}clone(){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,this.eventId)}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.creatorId===this.creatorId&&e.deviceId===this.deviceId&&e.creationDate===this.creationDate&&e.source===this.source&&e.eventId===this.eventId}}return n.TYPE_ID="13d3b3f651dc4911b340d0dec4ab6666",n})(),Wb=class extends f{build(i,e){return bA.fromMap(i,e)}},eh=(()=>{class n extends b{constructor(e,t,s){super(),this.artists=e,this.brands=t,this.organizers=s}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.artists,e.brands,e.organizers)}static fromMap(e,t){return n.create({artists:r.getList(t,"artists",s=>K.decodeString(s)),brands:r.getList(t,"brands",s=>K.decodeString(s)),organizers:r.getList(t,"organizers",s=>K.decodeString(s))})}static empty(){return n.create({artists:[],brands:[],organizers:[]})}toMap(e){return{artists:this.artists,brands:this.brands,organizers:this.organizers}}clone(){return new n(this.artists.slice(),this.brands.slice(),this.organizers.slice())}isSame(e){return e===this?!0:P(e.artists,this.artists)&&P(e.brands,this.brands)&&P(e.organizers,this.organizers)}}return n.TYPE_ID="c0df506b15ee4179876da8bf04c947ef",n})(),jb=class extends f{build(i,e){return eh.fromMap(i,e)}},kn=(function(n){return n.Dot="Dot",n.Dash="Dash",n})(kn||{});var Jr=(function(n){return n.Legacy="Legacy",n.Standard="Standard",n.Sharded="Sharded",n})(Jr||{}),bd=(function(n){return n.Live="LIVE",n.Archived="ARCHIVED",n.Closed="CLOSED",n.Canceled="CANCELED",n})(bd||{}),Kc=(()=>{class n extends Dd{constructor(e,t,s,a,o,u,c,l,h,p,I,v,E,w,S,R,x,N,O){super(),this.uniqueId=e,this.creatorId=t,this.creationDate=s,this.country=a,this.language=o,this.timezone=u,this.businessRef=c,this.webRoute=l,this.components=h,this.placeId=p,this.productionId=I,this.status=v,this.shortCode=E,this.serialNumberScope=w,this.serialNumberStrategy=S,this.ticketPoolStrategy=R,this.qrCodeSeparator=x,this.associations=N,this.bookingProtocol=O}get organizationId(){var e;return(e=this.businessRef.organizationId)!==null&&e!==void 0?e:this.creatorId}get moduleType(){var e;return(e=this.businessRef.moduleType)!==null&&e!==void 0?e:st.Legacy}get bookingStrategy(){return this.bookingProtocol.strategy}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}static create(e){var t,s;return new n(e.uniqueId,e.creatorId,e.creationDate,e.country,e.language,e.timezone,e.businessRef,e.webRoute,e.components,e.placeId,e.productionId,bd.Live,e.
3shortCode,e.serialNumberScope,e.serialNumberStrategy,e.ticketPoolStrategy,(t=e.qrCodeSeparator)!==null&&t!==void 0?t:kn.Dot,(s=e.associations)!==null&&s!==void 0?s:eh.create({artists:[],brands:[],organizers:[]}),e.bookingProtocol)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.get(t,"creatorId"),e.decodeDate(r.get(t,"creationDate")),y(r.get(t,"country"),Ie),y(r.get(t,"language"),$),y(r.get(t,"timezone"),Ee),j.mustDecode(r.get(t,"businessRef")),r.getOrNull(t,"webRoute"),ae.deserialize(e,r.getList(t,"components",s=>s)),r.getOrNull(t,"placeId"),r.getOrNull(t,"productionId"),y(r.get(t,"$status"),bd),r.getOrNull(t,"shortCode"),y(r.get(t,"serialNumberScope"),vt),y(r.getString(t,"serialNumberStrategy"),Rs),y(r.get(t,"ticketPoolStrategy"),Jr),y(r.get(t,"qrCodeSeparator"),kn),e.fromData(r.get(t,"associations")),e.fromData(r.get(t,"bookingProtocol")))}toMap(e){return{$status:m(this.status),uniqueId:this.uniqueId,creatorId:this.creatorId,creationDate:e.encodeDate(this.creationDate),country:m(this.country),language:m(this.language),timezone:m(this.timezone),businessRef:this.businessRef.encode(),webRoute:this.webRoute,components:this.components.serialize(e),placeId:this.placeId,productionId:this.productionId,shortCode:this.shortCode,serialNumberScope:m(this.serialNumberScope),serialNumberStrategy:m(this.serialNumberStrategy),ticketPoolStrategy:m(this.ticketPoolStrategy),qrCodeSeparator:m(this.qrCodeSeparator),associations:e.toData(this.associations),bookingProtocol:e.toData(this.bookingProtocol),bookingStrategy:m(this.bookingStrategy)}}clone(){return new n(this.uniqueId,this.creatorId,this.creationDate,this.country,this.language,this.timezone,this.businessRef.clone(),this.webRoute,this.components.clone(),this.placeId,this.productionId,this.status,this.shortCode,this.serialNumberScope,this.serialNumberStrategy,this.ticketPoolStrategy,this.qrCodeSeparator,this.associations.clone(),this.bookingProtocol.clone())}isSame(e){return e===this?!0:e.status===this.status&&e.uniqueId===this.uniqueId&&e.creatorId===this.creatorId&&e.country===this.country&&e.creationDate===this.creationDate&&e.timezone===this.timezone&&e.language===this.language&&d(e.businessRef,this.businessRef)&&e.webRoute===this.webRoute&&e.serialNumberScope===this.serialNumberScope&&e.serialNumberStrategy===this.serialNumberStrategy&&e.ticketPoolStrategy===this.ticketPoolStrategy&&e.qrCodeSeparator===this.qrCodeSeparator&&e.components.isSame(this.components)&&e.shortCode===this.shortCode&&e.placeId===this.placeId&&e.productionId===this.productionId&&d(e.associations,this.associations)&&d(e.bookingProtocol,this.bookingProtocol)}copyWith(e){var t,s,a,o,u,c;return new n(this.uniqueId,this.creatorId,this.creationDate,this.country,this.language,this.timezone,this.businessRef.clone(),this.webRoute,this.components.clone(),(t=e?.placeId)!==null&&t!==void 0?t:this.placeId,this.productionId,this.status,this.shortCode,(s=e?.serialNumberScope)!==null&&s!==void 0?s:this.serialNumberScope,(a=e?.serialNumberStrategy)!==null&&a!==void 0?a:this.serialNumberStrategy,(o=e?.ticketPoolStrategy)!==null&&o!==void 0?o:this.ticketPoolStrategy,(u=e?.qrCodeSeparator)!==null&&u!==void 0?u:this.qrCodeSeparator,this.associations.clone(),(c=e?.bookingProtocol)!==null&&c!==void 0?c:this.bookingProtocol.clone())}static encodedStatusSafe(e){return m(e)}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}hasSeating(){return this.components.any(e=>mr.assertType(e)||uS.assertType(e)?_(e.seatingLayoutId):!1)}findTicketById(e){let t=this.findComponentByTypeId(cs.TYPE_ID);if(t!=null){for(let s of t.tickets)if(s.uniqueId===e)return s}return null}}return n.TYPE_ID="61b732b763e04974a096748c9c1514c6",n.SCHEMA_VERSION=10,n})(),Jb=class extends f{build(i,e){return Kc.fromMap(i,e)}optimizeForQuery(i,e){var t,s,a,o,u,c,l;let h=e.findComponentByTypeId(dn.TYPE_ID),p=e.findComponentByTypeId(ws.TYPE_ID),I=e.findComponentByTypeId(Gd.TYPE_ID),v=e.findComponentByTypeId(_t.TYPE_ID);return{hasBackstage:e.hasComponentByTypeId(hS.TYPE_ID),hasDynamicPricing:e.hasComponentByTypeId(lS.TYPE_ID),startDate:g.encodeDateOrNull((s=(t=h?.dateSpan)===null||t===void 0?void 0:t.from)!==null&&s!==void 0?s:null),endDate:g.encodeDateOrNull((o=(a=h?.dateSpan)===null||a===void 0?void 0:a.to)!==null&&o!==void 0?o:null),locationId:(u=v?.uniqueId)!==null&&u!==void 0?u:e.placeId,names:Ox((c=p?.names)===null||c===void 0?void 0:c.localizations,(E,w)=>({key:m(E),value:w})),privacyMode:Se((l=I?.privacyMode)!==null&&l!==void 0?l:null)}}onBeforeDeserialization(i,e){var t;let s=(t=Re(r.get(e,"language"),$))!==null&&t!==void 0?t:Nr(y(r.get(e,"country"),Ie));i.storage.set("language",s)}migrateToCurrentSchemaVersion(i,e){var t,s,a;let o=r.getVersionRange(e);if(this.migrateEnum(e,"qrCodeSeparator",kn,kn.Dot),o.contains(Kc.SCHEMA_VERSION))return e;if(o.isGreaterThan(Kc.SCHEMA_VERSION))return null;let u=o.to;if(u<2&&(e.serialNumberStrategy=m(hi.AssignByTicketType),e.serialNumberScope=m(vt.Event),e.shortCode=null,u=2),u<3&&((t=e.associations)!==null&&t!==void 0||(e.associations=i.toData(eh.empty())),u=3),u<4){let c=y(r.get(e,"serialNumberStrategy"),hi),l=ud.fromLegacy(c);r.set(e,"serialNumberStrategy",m(l)),u=4}if(u<5&&(r.set(e,"qrCodeSeparator",m(kn.Dot)),u=5),u<6&&(r.setIfNullOrUndefined(e,"ticketPoolStrategy",m(Jr.Legacy)),u=6),u<7&&(u=7),u<8){let c=ae.deserialize(i,r.getList(e,"components",v=>v)),l=c.findComponentByTypeId(oS.TYPE_ID),p=c.findComponentByTypeId(dS.TYPE_ID)!=null,I=(a=(s=l?.settings)===null||s===void 0?void 0:s.toEventBookingProtocol({hasProductList:p}))!==null&&a!==void 0?a:p?Xd.create():Zd.create();
3e.bookingProtocol=i.toData(I),e.components=c.serialize(i),u=8}if(u<9){let c=ae.deserialize(i,r.getList(e,"components",h=>h)),l=c.findComponentByTypeId(ls.TYPE_ID);if(l!=null&&l.settings.paymentAccount!=null){let h=new vS(Tr.create({standard:$r.create({paymentAccount:l.settings.paymentAccount.clone(),paymentMethods:[...l.settings.paymentMethods],allowLegalEntityInvoices:l.settings.allowLegalEntityInvoices,allowOfflineOrderReceipts:l.settings.allowOfflineOrderReceipts}),products:null}));c.addOrReplaceComponent(h)}c.removeComponentByTypeId(ls.TYPE_ID),e.components=c.serialize(i),u=9}if(u<10){let c=ae.deserialize(i,r.getList(e,"components",p=>p)),l=c.findComponentByTypeId(_t.TYPE_ID),h=c.findComponentByTypeId(us.TYPE_ID);l==null&&h!=null&&(c.addOrReplaceComponent(_t.fromPlace(h.place)),e.components=c.serialize(i)),u=10}return e.$schema_version=D.encodedExactly(u),e}migrateFromCurrentSchemaVersion(i,e,t){if(e.$schemaVersion.to>=10){let a=e.findComponentByTypeId(_t.TYPE_ID),o=e.findComponentByTypeId(us.TYPE_ID);if(a!=null&&o==null){let u=e.components.clone();u.addOrReplaceComponent(new us(Fa.fromMap(i,a.toMap(i)))),t.components=u.serialize(i)}t.$schema_version=D.encodedBetween(9,10)}return t}},EA=(()=>{class n extends Le{constructor(e,t,s,a,o,u,c){super(),this.uniqueId=e,this.creatorId=t,this.deviceId=s,this.creationDate=a,this.source=o,this.event=u,this.eventId=c}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.getOrNull(t,"creatorId"),r.getOrNull(t,"deviceId"),e.decodeDate(r.get(t,"creationDate")),y(r.get(t,"source"),le),e.fromData(r.get(t,"event")),r.get(t,"eventId"))}toMap(e){return{uniqueId:this.uniqueId,creatorId:this.creatorId,deviceId:this.deviceId,creationDate:e.encodeDate(this.creationDate),source:m(this.source),event:e.toData(this.event),eventId:this.eventId}}clone(){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,F(this.event),this.eventId)}isSame(e){return this===e?!0:e.uniqueId===this.uniqueId&&e.creatorId===this.creatorId&&e.deviceId===this.deviceId&&e.creationDate===this.creationDate&&e.source===this.source&&d(e.event,this.event)&&e.eventId===this.eventId}}return n.TYPE_ID="196beaedf85b48759fbefa5ca6021a14",n})(),Kb=class extends f{build(i,e){return EA.fromMap(i,e)}},wA=(()=>{class n extends Le{constructor(e,t,s,a,o,u,c){super(),this.uniqueId=e,this.creatorId=t,this.deviceId=s,this.creationDate=a,this.source=o,this.event=u,this.eventId=c}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.getOrNull(t,"creatorId"),r.getOrNull(t,"deviceId"),e.decodeDate(r.get(t,"creationDate")),y(r.get(t,"source"),le),e.fromData(r.get(t,"event")),r.get(t,"eventId"))}toMap(e){return{uniqueId:this.uniqueId,creatorId:this.creatorId,deviceId:this.deviceId,creationDate:e.encodeDate(this.creationDate),source:m(this.source),event:e.toData(this.event),eventId:this.eventId}}clone(){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,F(this.event),this.eventId)}isSame(e){return this===e?!0:e.uniqueId===this.uniqueId&&e.creatorId===this.creatorId&&e.deviceId===this.deviceId&&e.creationDate===this.creationDate&&e.source===this.source&&d(e.event,this.event)&&e.eventId===this.eventId}}return n.TYPE_ID="c8d50f9d43fb4f86af04968fc84a0137",n})(),Zb=class extends f{build(i,e){return wA.fromMap(i,e)}},SA=(()=>{class n extends b{constructor(e){super(),this.featuredBusinesses=e}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.getMap(t,"featuredBusinesses",(s,a)=>({key:s,value:a})))}toMap(e){return{featuredBusinesses:se(this.featuredBusinesses,(t,s)=>({key:t,value:s}))}}clone(){return new n(ee(this.featuredBusinesses))}isSame(e){return e===this?!0:re(e.featuredBusinesses,this.featuredBusinesses)}}return n.TYPE_ID="99f29a0ba83b415cbabcc9fc05eb49ea",n})(),Xb=class extends f{build(i,e){return SA.fromMap(i,e)}},TA=(()=>{class n extends b{constructor(e,t){super(),this.featured=e,this.renderOrder=t}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.get(t,"featured"),r.get(t,"renderOrder"))}toMap(e){return{featured:this.featured,renderOrder:this.renderOrder}}clone(){return new n(this.featured,this.renderOrder)}isSame(e){return e===this?!0:e.featured===this.featured&&e.renderOrder===this.renderOrder}}return n.TYPE_ID="6f49c7d4a6c747e38a754d12030e6f0d",n})(),Qb=class extends f{build(i,e){return TA.fromMap(i,e)}},cn=(function(n){return n.Fixed="Fixed",n.Percentage="Percentage",n.FixedAndPercentage="FixedAndPercentage",n})(cn||{}),Xa=(()=>{class n extends b{constructor(e,t,s){super(),this.type=e,this._fixedPrice=t,this._percentage=s}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}get fixedPrice(){if(k(this._fixedPrice))throw new Error(`Cannot get fixed price of application fee if type is: ${this.type}`);return this._fixedPrice}get fixedPriceOrNull(){return this._fixedPrice}get percentage(){if(k(this._percentage))throw new Error(`Cannot get percentage of application fee if type is: ${this.type}`);return this._percentage}get percentageOrNull(){return this._percentage}static fixed(e){return new n(cn.Fixed,e,null)}static percentage(e){return new n(cn.Percentage,null,e)}static both(e,t){return new n(cn.FixedAndPercentage,e,t)}static fromMap(e,t){return new n(y(r.get(t,"type"),cn),Y.decodeOrNull(r.getOrNull(t,"fixedPrice")),r.getOrNull(t,"percentage"))}toMap(e){var t,s;return{type:m(this.type),fixedPrice:(s=(t=this._fixedPrice)===null||t===void 0?void 0:t.encode())!==null&&s!==void 0?s:null,percentage:this._percentage}}clone(){var e,t;return new n(this.type,(t=(e=this._fixedPrice)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null,this._percentage)}isSame(e){return e===this?!0:e.type===this.type&&e._percentage===this._percentage&&d(e._fixedPrice,this._fixedPrice)}
3calculateUnitFee(e){if(this.type===cn.Fixed)return this.fixedPrice.currency===e.currency?this.fixedPrice:Y.zero(e.currency);if(this.type===cn.Percentage)return e.scale(this.percentage/100);if(this.type===cn.FixedAndPercentage){let t=this.fixedPrice.currency===e.currency?this.fixedPrice:Y.zero(e.currency),s=e.scale(this.percentage/100);return t.add(s)}else Zt(this.type)}toString(){switch(this.type){case cn.Fixed:return this.fixedPrice.format();case cn.Percentage:return`${this.percentage}%`;case cn.FixedAndPercentage:return`${this.fixedPrice.format()} + ${this.percentage}%`;default:Zt(this.type)}}}return n.TYPE_ID="64f7e0dbc86444a4ac1c236719059af1",n.SCHEMA_VERSION=2,n})(),eE=class extends f{build(i,e){return Xa.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(Xa.SCHEMA_VERSION))return e;if(t.isGreaterThan(Xa.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(s=2),e.$schema_version=D.encodedExactly(s),e}},Zc=(()=>{class n extends b{constructor(e,t){super(),this.priceRange=e,this.fee=t}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}static fromMap(e,t){return new n(e.fromData(r.get(t,"priceRange")),e.fromData(r.get(t,"fee")))}toMap(e){return{priceRange:e.toData(this.priceRange),fee:e.toData(this.fee)}}clone(){return new n(this.priceRange.clone(),this.fee.clone())}isSame(e){return e===this?!0:d(e.priceRange,this.priceRange)&&d(e.fee,this.fee)}isInRange(e){return e.currency!==this.priceRange.from.currency||e.currency!==this.priceRange.to.currency?!1:e.compareTo(this.priceRange.from)>=0&&e.compareTo(this.priceRange.to)<=0}}return n.TYPE_ID="bca5bc4bd7364ed388da1c8bbd70f840",n.SCHEMA_VERSION=2,n})(),tE=class extends f{build(i,e){return Zc.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=D.mustDecode(e.$schema_version);if(t.contains(Zc.SCHEMA_VERSION))return e;if(t.isGreaterThan(Zc.SCHEMA_VERSION))return null;let s=t.to;if(s<2){let a=Y.decode(r.get(e,"fee"));e.fee=i.toData(Xa.fixed(a)),s=2}return e.$schema_version=D.encodedExactly(s),e}};var OA=(()=>{class n extends b{constructor(e){super(),this.events=e}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.getList(t,"events",s=>s))}toMap(e){return{events:this.events}}clone(){return new n(Te(this.events))}isSame(e){return e===this?!0:P(e.events,this.events)}}return n.TYPE_ID="88973c69b66c490f9111e3e89e1b9ee0",n})(),nE=class extends f{build(i,e){return OA.fromMap(i,e)}},RA=(()=>{class n extends b{constructor(e,t,s,a,o){super(),this.uniqueId=e,this.userId=t,this.name=s,this.phoneNumber=a,this.locality=o}get $typeId(){return n.TYPE_ID}static fromMap(e,t){let s=r.get(t,"phoneNumber");return s=s.replace(/ /g,""),new n(r.get(t,"uniqueId"),r.getOrNull(t,"userId"),r.get(t,"name"),ft.mustDecode(s),e.fromDataOrNull(r.getOrNull(t,"locality")))}toMap(e){return{uniqueId:this.uniqueId,userId:this.userId,name:this.name,phoneNumber:this.phoneNumber.encode(),locality:e.toDataOrNull(this.locality)}}clone(){return new n(this.uniqueId,this.userId,this.name,this.phoneNumber.clone(),Z(this.locality))}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.userId===this.userId&&e.name===this.name&&d(e.phoneNumber,this.phoneNumber)&&d(e.locality,this.locality)}}return n.TYPE_ID="fa31d3c7e8664e09b1e3db715cd01acc",n})(),iE=class extends f{build(i,e){return RA.fromMap(i,e)}};var ur=(()=>{class n extends b{constructor(e,t){super(),this.duration=e,this.blocking=t}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(e.decodeDuration(r.get(t,"duration")),r.get(t,"blocking"))}toMap(e){return{duration:e.encodeDuration(this.duration),blocking:this.blocking}}clone(){return new n(g.cloneDuration(this.duration),this.blocking)}isSame(e){return this===e?!0:e.duration.asMilliseconds()===this.duration.asMilliseconds()&&e.blocking===this.blocking}}return n.TYPE_ID="fca68d7a7ee24438b66382eb1cf1ca1d",n})(),sE=class extends f{build(i,e){return ur.fromMap(i,e)}},MA=(()=>{class n extends b{constructor(e){super(),this.fractions=e,this.totalDuration=n.calculateTotalDuration(e)}get $typeId(){return n.TYPE_ID}static empty(){return new n([new ur(oe.default.duration(0),!0)])}static fromDuration(e,t=!0){return new n([new ur(e,t)])}static fromMinutes(e,t=!0){return new n([new ur(oe.default.duration(e*so),t)])}static fromMap(e,t){return new n(r.getList(t,"fractions",s=>e.fromData(s)))}toMap(e){return{fractions:this.fractions.map(t=>e.toData(t))}}clone(){return new n(this.fractions.map(e=>e.clone()))}isSame(e){return this===e?!0:P(e.fractions,this.fractions,(t,s)=>t.isSame(s))}shrink(e){let t=[];for(let s=0;s<this.fractions.length;s++)if(s<this.fractions.length-1)t.push(this.fractions[s].clone());else{let a=this.fractions[s].duration.asMilliseconds()-e.asMilliseconds();a>0&&t.push(new ur(oe.default.duration(a),this.fractions[s].blocking))}return new n(t)}isBlockingAtMinute(e){let t=e*so,s=0;for(let a=0;a<this.fractions.length;a++){let o=this.fractions[a].duration.asMilliseconds();if(t>=s&&t<s+o&&this.fractions[a].blocking)return!0;s+=o}return!1}static calculateTotalDuration(e){let t=0;return e.forEach(s=>t+=s.duration.asMilliseconds()),oe.default.duration(t)}}return n.TYPE_ID="1cf8b38d7db8406fa2870cf1d52480a7",n})(),rE=class extends f{build(i,e){return MA.fromMap(i,e)}};var LS=(()=>{class n extends b{constructor(e,t){super(),this.latitude=e,this.longitude=t}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.get(t,"latitude"),r.get(t,"longitude"))}toMap(e){return{latitude:this.latitude,longitude:this.longitude}}clone(){return new n(this.latitude,this.longitude)}isSame(e){return e===this?!0:e.latitude===this.latitude&&e.longitude===this.longitude}distance(e){let t=this.latitude*Math.PI/180,s=e.latitude*Math.PI/180,a=(e.latitude-this.latitude)*Math.PI/180,o=(e.longitude-this.longitude)*Math.PI/180,u=Math.sin(a/2)*Math.sin(a/2)+Math.cos(t)*Math.cos(s)*Math.sin(o/2)*Math.sin(o/2),c=2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u));return yx*c/1e3}}return n.TYPE_ID="e23b1343a8674a648c9e5adc055953bf",n})(),aE=class extends f{build(i,e){return LS.fromMap(i,e)}},Ed=class extends Ar{},Xc=(()=>
3{class n extends Ed{constructor(e,t,s,a,o,u,c,l,h,p,I,v,E,w,S,R,x,N){super(),this.uniqueId=e,this.status=t,this.creatorId=s,this.businessRef=a,this.dayOfYear=o,this.timeOfDay=u,this.timezone=c,this.creationDate=l,this.staffMemberId=h,this.staffMember=p,this.groupId=I,this.components=v,this.duration=E,this.serviceId=w,this.service=S,this.capacity=R,this.cancelledDate=x,this.cancelledBy=N,this.dayId=o.uniqueId,this.monthId=gi.dayOfYearToUniqueId(o)}get parentId(){return ut.none}get clientOrderGroupId(){return this.uniqueId}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(2,n.SCHEMA_VERSION)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),y(r.get(t,"$status"),St),r.get(t,"creatorId"),j.mustDecode(r.get(t,"businessRef")),e.fromData(r.getRaw(t,"dayOfYear")),e.fromData(r.getRaw(t,"timeOfDay")),r.get(t,"timezone"),e.decodeDate(r.get(t,"creationDate")),new ut(r.getOrNull(t,"staffMemberId")),e.fromDataOrNull(r.getOrNull(t,"staffMember")),r.getOrNull(t,"groupId"),ae.deserialize(e,r.getList(t,"components",s=>s)),e.decodeDuration(r.get(t,"duration")),r.get(t,"serviceId"),e.fromData(r.getRaw(t,"service")),e.fromData(r.getRaw(t,"capacity")),e.decodeDateOrNull(r.getOrNull(t,"cancelledDate")),r.getOrNull(t,"cancelledBy"))}toMap(e){return{uniqueId:this.uniqueId,creatorId:this.creatorId,businessRef:this.businessRef.encode(),dayId:this.dayId,monthId:this.monthId,dayOfYear:e.toData(this.dayOfYear),timeOfDay:e.toData(this.timeOfDay),timezone:this.timezone,creationDate:e.encodeDate(this.creationDate),date:e.encodeDate(this.time),serviceId:this.serviceId,service:e.toData(this.service),staffMemberId:this.staffMemberId.queryableValue,staffMember:e.toDataOrNull(this.staffMember),$status:m(this.status),groupId:this.groupId,parentId:this.parentId.queryableValue,clientOrderGroupId:this.clientOrderGroupId,capacity:e.toData(this.capacity),duration:e.encodeDuration(this.duration),components:this.components.serialize(e),cancelledDate:e.encodeDateOrNull(this.cancelledDate),cancelledBy:this.cancelledBy}}clone(){var e,t;return new n(this.uniqueId,this.status,this.creatorId,this.businessRef.clone(),this.dayOfYear.clone(),this.timeOfDay.clone(),this.timezone,g.cloneDate(this.creationDate),this.staffMemberId.clone(),(t=(e=this.staffMember)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null,this.groupId,this.components.clone(),this.duration,this.serviceId,this.service.clone(),this.capacity.clone(),g.cloneDateOrNull(this.cancelledDate),this.cancelledBy)}isSame(e){return this===e?!0:e.uniqueId===this.uniqueId&&e.status===this.status&&e.creatorId===this.creatorId&&e.cancelledDate===this.cancelledDate&&e.cancelledBy===this.cancelledBy&&d(e.businessRef,this.businessRef)&&d(e.dayOfYear,this.dayOfYear)&&d(e.timeOfDay,this.timeOfDay)&&e.timezone===this.timezone&&e.creationDate===this.creationDate&&d(e.staffMemberId,this.staffMemberId)&&d(e.staffMember,this.staffMember)&&e.groupId===this.groupId&&e.components.isSame(this.components)&&e.duration===this.duration&&e.serviceId===this.serviceId&&d(e.service,this.service)&&d(e.capacity,this.capacity)}copyWithBusinessRef(e){var t,s;return new n(this.uniqueId,this.status,this.creatorId,e.clone(),this.dayOfYear.clone(),this.timeOfDay.clone(),this.timezone,g.cloneDate(this.creationDate),this.staffMemberId.clone(),(s=(t=this.staffMember)===null||t===void 0?void 0:t.copyWithBusinessRef(e))!==null&&s!==void 0?s:null,this.groupId,this.components.copyWithBusinessRef(e),this.duration,this.serviceId,this.service.copyWithBusinessRef(e),this.capacity.clone(),g.cloneDateOrNull(this.cancelledDate),this.cancelledBy)}}return n.TYPE_ID="9fb56c43e1254967bbb2d2947998d587",n.SCHEMA_VERSION=4,n})(),oE=class extends f{build(i,e){return Xc.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(r.replace(e,"$status","DELETED",m(St.Canceled)),t.contains(Xc.SCHEMA_VERSION))return e;if(t.isGreaterThan(Xc.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(r.setIfNullOrUndefined(e,"businessRef",r.get(e,"businessId")),s=2),s<3&&(s=3),s<4&&(s=4),e.$schema_version=D.encodedExactly(s),e}},NA=(function(n){return n.ClientTemperatureChecks="ClientTemperatureChecks",n.ContactlessPaymentAvailable="ContactlessPaymentAvailable",n.DisinfectionBetweenClients="DisinfectionBetweenClients",n.DisinfectionOfAllSurfacesInTheWorkspace="DisinfectionOfAllSurfacesInTheWorkspace",n.DisposableSuppliesInUse="DisposableSuppliesInUse",n.EmployeesWearDisposableGloves="EmployeesWearDisposableGloves",n.EmployeesWearMask="EmployeesWearMask",n.EmployeeTemperatureChecks="EmployeeTemperatureChecks",n.MaintainSocialDistancing="MaintainSocialDistancing",n.MaskProvidedForClients="MaskProvidedForClients",n.NoInteractionWithOtherClients="NoInteractionWithOtherClients",n.NoWaitingArea="NoWaitingArea",n.NoWalkIns="NoWalkIns",n.PlaceToWashHandsAvailable="PlaceToWashHandsAvailable",n.TimeGapBetweenAppointments="TimeGapBetweenAppointments",n})(NA||{}),Qc=(()=>{class n extends b{constructor(e,t){super(),this.rules=e,this.showRulesOnProfile=t}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}static fromMap(e,t){return new n(r.getList(t,"rules",s=>y(s,NA)),r.get(t,"showRulesOnProfile"))}toMap(e){return{showRulesOnProfile:this.showRulesOnProfile,rules:this.rules.map(t=>t)}}clone(){return new n(this.rules,this.showRulesOnProfile)}isSame(e){return e===this?!0:e.showRulesOnProfile===this.showRulesOnProfile&&P(e.rules,this.rules)}}return n.TYPE_ID="7c039643a0164b86af1f9afaf5451d18",n.SCHEMA_VERSION=2,n})(),uE=class extends f{build(i,e){return Qc.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){var t;let s=r.getVersionRange(e);if(s.contains(Qc.SCHEMA_VERSION))return e;if(s.isGreaterThan(Qc.SCHEMA_VERSION))return null;let a=s.to;if(a<2){let o=(t=r.getOrNull(e,"allowPublicRules"))!==null&&t!==void 0?t:!1;r.set(e,"showRulesOnProfile",o),a=2}return e.$schema_version=D.encodedExactly(a),e}},cE=class n{constructor(i,e,t,s,a,o,u,c){this.uniqueId=i,this.webRoute=e,this.localizedName=t,this.coverImage=s,this.country=a,this.eventCount=o,this.isFeatured=u,this.featuredScore=c}
3static create(i){return new n(i.uniqueId,i.webRoute,i.localizedName,i.coverImage,i.country,i.eventCount,i.isFeatured,i.featuredScore)}static fromMap(i,e){var t,s;let a=(t=r.getBooleanOrNull(e,"isFeatured"))!==null&&t!==void 0?t:!1,o=(s=r.getIntegerOrNull(e,"featuredScore"))!==null&&s!==void 0?s:0;return this.create({uniqueId:r.getString(e,"uniqueId"),webRoute:r.getString(e,"webRoute"),localizedName:i.fromData(r.getRecord(e,"localizedName")),coverImage:r.getString(e,"coverImage"),country:y(r.getString(e,"country"),Ie),eventCount:r.getInteger(e,"eventCount"),isFeatured:a,featuredScore:o})}toMap(i){return{uniqueId:this.uniqueId,webRoute:this.webRoute,localizedName:i.toData(this.localizedName),coverImage:this.coverImage,country:m(this.country),eventCount:this.eventCount,isFeatured:this.isFeatured,featuredScore:this.featuredScore}}clone(){return n.create({uniqueId:this.uniqueId,webRoute:this.webRoute,localizedName:F(this.localizedName),coverImage:this.coverImage,country:this.country,eventCount:this.eventCount,isFeatured:this.isFeatured,featuredScore:this.featuredScore})}isSame(i){return i===this?!0:i.uniqueId===this.uniqueId&&i.webRoute===this.webRoute&&d(i.localizedName,this.localizedName)&&i.coverImage===this.coverImage&&i.country===this.country&&i.eventCount===this.eventCount&&i.isFeatured===this.isFeatured&&i.featuredScore===this.featuredScore}},lE=class n{constructor(i,e,t,s,a,o,u,c){this.uniqueId=i,this.webRoute=e,this.localizedName=t,this.coverImage=s,this.country=a,this.eventCount=o,this.isFeatured=u,this.featuredScore=c}static create(i){return new n(i.uniqueId,i.webRoute,i.localizedName,i.coverImage,i.country,i.eventCount,i.isFeatured,i.featuredScore)}static fromMap(i,e){var t,s;let a=(t=r.getBooleanOrNull(e,"isFeatured"))!==null&&t!==void 0?t:!1,o=(s=r.getIntegerOrNull(e,"featuredScore"))!==null&&s!==void 0?s:0;return this.create({uniqueId:r.getString(e,"uniqueId"),webRoute:r.getString(e,"webRoute"),localizedName:i.fromData(r.getRecord(e,"localizedName")),coverImage:r.getString(e,"coverImage"),country:y(r.getString(e,"country"),Ie),eventCount:r.getInteger(e,"eventCount"),isFeatured:a,featuredScore:o})}toMap(i){return{uniqueId:this.uniqueId,webRoute:this.webRoute,localizedName:i.toData(this.localizedName),coverImage:this.coverImage,country:m(this.country),eventCount:this.eventCount,isFeatured:this.isFeatured,featuredScore:this.featuredScore}}clone(){return n.create({uniqueId:this.uniqueId,webRoute:this.webRoute,localizedName:F(this.localizedName),coverImage:this.coverImage,country:this.country,eventCount:this.eventCount,isFeatured:this.isFeatured,featuredScore:this.featuredScore})}isSame(i){return i===this?!0:i.uniqueId===this.uniqueId&&i.webRoute===this.webRoute&&d(i.localizedName,this.localizedName)&&i.coverImage===this.coverImage&&i.country===this.country&&i.eventCount===this.eventCount&&i.isFeatured===this.isFeatured&&i.featuredScore===this.featuredScore}},dE=class n{constructor(i,e,t,s,a,o,u,c){this.uniqueId=i,this.webRoute=e,this.localizedName=t,this.coverImage=s,this.country=a,this.eventCount=o,this.isFeatured=u,this.featuredScore=c}static create(i){return new n(i.uniqueId,i.webRoute,i.localizedName,i.coverImage,i.country,i.eventCount,i.isFeatured,i.featuredScore)}static fromMap(i,e){var t,s;let a=(t=r.getBooleanOrNull(e,"isFeatured"))!==null&&t!==void 0?t:!1,o=(s=r.getIntegerOrNull(e,"featuredScore"))!==null&&s!==void 0?s:0;return this.create({uniqueId:r.getString(e,"uniqueId"),webRoute:r.getString(e,"webRoute"),localizedName:i.fromData(r.getRecord(e,"localizedName")),coverImage:r.getString(e,"coverImage"),country:y(r.getString(e,"country"),Ie),eventCount:r.getInteger(e,"eventCount"),isFeatured:a,featuredScore:o})}toMap(i){return{uniqueId:this.uniqueId,webRoute:this.webRoute,localizedName:i.toData(this.localizedName),coverImage:this.coverImage,country:m(this.country),eventCount:this.eventCount,isFeatured:this.isFeatured,featuredScore:this.featuredScore}}clone(){return n.create({uniqueId:this.uniqueId,webRoute:this.webRoute,localizedName:F(this.localizedName),coverImage:this.coverImage,country:this.country,eventCount:this.eventCount,isFeatured:this.isFeatured,featuredScore:this.featuredScore})}isSame(i){return i===this?!0:i.uniqueId===this.uniqueId&&i.webRoute===this.webRoute&&d(i.localizedName,this.localizedName)&&i.coverImage===this.coverImage&&i.country===this.country&&i.eventCount===this.eventCount&&i.isFeatured===this.isFeatured&&i.featuredScore===this.featuredScore}},el=(()=>{class n extends b{constructor(e,t,s,a){super(),this.events=e,this.artists=t,this.brands=s,this.organizers=a}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static empty(){return new n([],[],[],[])}static create(e){return new n(e.events,e.artists,e.brands,e.organizers)}static fromMap(e,t){return new n(r.getList(e,"events",s=>Cn.fromMap(t,K.decodeRecord(s))),r.getList(e,"artists",s=>cE.fromMap(t,K.decodeRecord(s))),r.getList(e,"brands",s=>lE.fromMap(t,K.decodeRecord(s))),r.getList(e,"organizers",s=>dE.fromMap(t,K.decodeRecord(s))))}toMap(e){return{events:this.events.map(t=>t.toMap(e)),artists:this.artists.map(t=>t.toMap(e)),brands:this.brands.map(t=>t.toMap(e)),organizers:this.organizers.map(t=>t.toMap(e))}}clone(){return new n(this.events.map(e=>F(e)),this.artists.map(e=>F(e)),this.brands.map(e=>F(e)),this.organizers.map(e=>F(e)))}isSame(e){return e===this?!0:P(e.events,this.events,(t,s)=>d(t,s))&&P(e.artists,this.artists,(t,s)=>d(t,s))&&P(e.brands,this.brands,(t,s)=>d(t,s))&&P(e.organizers,this.organizers,(t,s)=>d(t,s))}}return n.TYPE_ID="1a46488b26394556b8694cbfc5a13294",n.SCHEMA_VERSION=2,n})(),hE=class extends f{build(i,e){return el.fromMap(e,i)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(el.SCHEMA_VERSION))return e;
3if(t.isGreaterThan(el.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(r.setIfNullOrUndefined(e,"artists",[]),r.setIfNullOrUndefined(e,"brands",[]),r.setIfNullOrUndefined(e,"organizers",[]),s=2),e.$schema_version=D.encodedExactly(s),e}},PA=(()=>{class n extends b{constructor(e,t){super(),this.width=e,this.height=t,this.aspectRatio=e/t}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.get(t,"width"),r.get(t,"height"))}toMap(e){return{width:this.width,height:this.height,aspectRatio:this.aspectRatio}}clone(){return new n(this.width,this.height)}isSame(e){return e===this?!0:e.width===this.width&&e.height===this.height&&e.aspectRatio==this.aspectRatio}}return n.TYPE_ID="2bae69fc521047ef87e72f10d11df14d",n})(),fE=class extends f{build(i,e){return PA.fromMap(i,e)}};var tl=(()=>{class n extends b{constructor(e,t,s,a){super(),this.titles=e,this.captions=t,this.photo=s,this.url=a}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(e.fromData(r.getRaw(t,"titles")),e.fromData(r.getRaw(t,"captions")),e.fromData(r.getRaw(t,"photo")),r.getOrNull(t,"url"))}toMap(e){return{titles:e.toData(this.titles),captions:e.toData(this.captions),photo:e.toDataOrNull(this.photo),url:this.url}}clone(){var e,t;return new n(this.titles.clone(),this.captions.clone(),(t=(e=this.photo)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null,this.url)}isSame(e){return this===e?!0:d(e.titles,this.titles)&&d(e.captions,this.captions)&&d(e.photo,this.photo)}}return n.TYPE_ID="e8b7f8153d444268b0cca658e9bd264d",n.SCHEMA_VERSION=2,n})(),pE=class extends f{build(i,e){return tl.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(tl.SCHEMA_VERSION))return e;if(t.isGreaterThan(tl.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(s=2),e.$schema_version=D.encodedExactly(s),e}},nl=(()=>{class n extends b{constructor(e,t,s,a,o){super(),this.uniqueId=e,this.name=t,this.countyId=s,this.county=a,this.country=o,this.formattedName=`${t}, ${a}`}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.get(t,"name"),r.get(t,"countyId"),r.get(t,"county"),y(r.get(t,"country"),Ie))}toMap(e){return{uniqueId:this.uniqueId,name:this.name,countyId:this.countyId,county:this.county,country:m(this.country)}}clone(){return new n(this.uniqueId,this.name,this.countyId,this.county,this.country)}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.name===this.name&&e.countyId===this.countyId&&e.country===this.county&&e.country===this.country}}return n.TYPE_ID="f20a276171d545ea8f18e435fff7761c",n.SCHEMA_VERSION=2,n})(),gE=class extends f{build(i,e){return nl.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(nl.SCHEMA_VERSION))return e;if(t.isGreaterThan(nl.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(r.set(e,"country",r.get(e,"uniqueId").substring(0,2).toUpperCase()),s=2),e.$schema_version=D.encodedExactly(s),e}},AA=(()=>{class n extends b{constructor(e,t,s){super(),this.storagePath=e,this.uploadKey=t,this.photos=s}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.get(t,"storagePath"),r.get(t,"uploadKey"),r.getList(t,"photos",s=>e.fromData(s)))}toMap(e){return{storagePath:this.storagePath,uploadKey:this.uploadKey,photos:this.photos.map(t=>e.toData(t))}}clone(){return new n(this.storagePath,this.uploadKey,this.photos.map(e=>e.clone()))}isSame(e){return e===this?!0:e.storagePath===this.storagePath&&e.uploadKey===this.uploadKey&&P(e.photos,this.photos,d)}}return n.TYPE_ID="bb9a29b2de344c508a52f8dabd0c978d",n})(),mE=class extends f{build(i,e){return AA.fromMap(i,e)}},CA=(()=>{class n extends b{constructor(e){super(),this.history=e}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.getMap(t,"history",(s,a)=>({key:s,value:e.decodeDate(a)})))}toMap(e){return{history:se(this.history,(t,s)=>({key:t,value:e.encodeDate(s)}))}}clone(){return new n(ee(this.history,e=>g.cloneDate(e)))}isSame(e){return e===this?!0:re(e.history,this.history)}}return n.TYPE_ID="64bffd43efc941d39538315ef1a624df",n})(),IE=class extends f{build(i,e){return CA.fromMap(i,e)}},il=(()=>{class n extends b{constructor(e,t,s,a,o,u){super(),this.businessRef=e,this.staffId=t,this.monthOfYear=s,this.timezone=a,this.currency=o,this.data=u}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}static fromMap(e,t){return new n(j.mustDecode(r.get(t,"businessRef")),r.get(t,"staffId"),e.fromData(r.getRaw(t,"monthOfYear")),r.get(t,"timezone"),r.get(t,"currency"),r.getMap(t,"data",(s,a)=>({key:Number(s),value:e.fromData(a)})))}toMap(e){return{businessRef:this.businessRef.encode(),staffId:this.staffId,monthOfYear:e.toData(this.monthOfYear),timezone:this.timezone,currency:this.currency,data:se(this.data,(t,s)=>({key:t.toString(),value:e.toData(s)}))}}clone(){return new n(this.businessRef.clone(),this.staffId,this.monthOfYear.clone(),this.timezone,this.currency,ee(this.data))}isSame(e){return this===e?!0:d(e.businessRef,this.businessRef)&&e.staffId===this.staffId&&e.monthOfYear.isSame(this.monthOfYear)&&e.timezone===this.timezone&&e.currency===this.currency&&re(e.data,this.data,d)}copyWithBusinessRef(e){return new n(e.clone(),this.staffId,this.monthOfYear.clone(),this.timezone,this.currency,ee(this.data))}}return n.TYPE_ID="b84858f679234aa6b10cd5684b848238",n.SCHEMA_VERSION=2,n})(),DE=class extends f{build(i,e){return il.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){var t;let s=r.getVersionRange(e);if(s.contains(il.SCHEMA_VERSION))return e;if(s.isGreaterThan(il.SCHEMA_VERSION))return null;let a=s.to;return a<2&&(r.set(e,"businessRef",(t=r.getOrNull(e,"businessRef"))!==null&&t!==void 0?t:r.get(e,"businessId")),a=2),e.$schema_version=D.encodedExactly(a),e}},kA=(()=>{class n extends b{constructor(e,t){super(),this.payload=e,this.creationDate=t}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.payload,e.creationDate)}static fromMap(e,t){return n.create({payload:r.getString(t,"payload"),creationDate:e.decodeDate(r.getNumber(t,"creationDate"))})}toMap(e){return{payload:this.payload,creationDate:e.encodeDate(this.creationDate)}}clone(){return n.create({payload:this.payload,creationDate:g.cloneDate(this.creationDate)})}isSame(e){return e===this?!0:e.payload===this.payload&&e.creationDate===this.creationDate}}return n.TYPE_ID="9e29556849014ceaaed45ff4b80b5d62",n})(),vE=class extends f{build(i,e){return kA.fromMap(i,e)}},_A=(()=>{class n extends b{constructor(e,t,s){super(),this.taxNumber=e,this.registrationNumber=t,this.certificate=s}get $removable(){return!0}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.taxNumber,e.registrationNumber,e.certificate)}static fromMap(e,t){return new n(r.get(t,"taxNumber"),r.get(t,"registrationNumber"),r.get(t,"certificate"))}toMap(e){return{taxNumber:this.taxNumber,registrationNumber:this.registrationNumber,certificate:this.certificate}}clone(){return new n(this.taxNumber,this.registrationNumber,this.certificate)}isSame(e){return e===this?!0:e.taxNumber===this.taxNumber&&e.registrationNumber===this.registrationNumber&&e.certificate===this.certificate}}return n.TYPE_ID="808194c60a3a47499e98cd4a3968a9a5",n})(),yE=class extends f{build(i,e){return _A.fromMap(i,e)}},xA=(function(n){return n.A_5="A_5",n.B_18="B_18",n.C_27="C_27",n.D_AJT="D_AJT",n.E_0="E_0",n})(xA||{}),FA=(function(n){return n.Child="GYEREK",n.Student="DIAK",n.Adult="FELNOTT",n.Pensioner="NYUGDIJAS",n.Old="IDOS",n.Mixed="VEGYES",n})(FA||{}),qA=(()=>{class n extends b{constructor(e,t){super(),this.taxCategory=e,this.ageGroup=t}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.taxCategory,e.ageGroup)}static fromMap(e,t){return new n(y(r.get(t,"taxCategory"),xA),y(r.get(t,"ageGroup"),FA))}toMap(e){return{taxCategory:m(this.taxCategory),ageGroup:m(this.ageGroup)}}clone(){return new n(this.taxCategory,this.ageGroup)}isSame(e){return e===this?!0:e.taxCategory===this.taxCategory&&e.ageGroup===this.ageGroup}}return n.TYPE_ID="06e2020bde474dad8fb18fd4ca0d0441",n})(),bE=class extends f{build(i,e){return qA.fromMap(i,e)}},YA=(()=>{class n extends b{constructor(e){super(),this.renderOrder=e}get $typeId(){return n.TYPE_ID}get isEmpty(){return this.renderOrder.length===0}get isNotEmpty(){return this.renderOrder.length>0}static fromMap(e,t){return new n(r.getList(t,"renderOrder",s=>wE.fromMap(e,s)))}toMap(e){return{renderOrder:this.renderOrder.map(t=>t.toMap(e))}}clone(){return new n(ue(this.renderOrder))}isSame(e){return e===this?!0:P(e.renderOrder,this.renderOrder,(t,s)=>d(t,s))}indexOf(e){for(let t=0;t<this.renderOrder.length;++t){let s=this.renderOrder[t];if(s.objectId===e)return s.index}return-1}}return n.TYPE_ID="afef4d195f2545fba1679111ff6565c7",n})(),EE=class extends f{build(i,e){return YA.fromMap(i,e)}},wE=class n{constructor(i,e){this.objectId=i,this.index=e}static fromMap(i,e){return new n(r.getString(e,"objectId"),r.getInteger(e,"index"))}toMap(i){return{objectId:this.objectId,index:this.index}}clone(){return new n(this.objectId,this.index)}isSame(i){return i===this?!0:i.objectId===this.objectId&&i.index===this.index}},$A=(()=>{class n extends Le{constructor(e,t,s,a,o,u){super(),this.uniqueId=e,this.creatorId=t,this.deviceId=s,this.creationDate=a,this.source=o,this.order=u}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.uniqueId,e.creatorId,e.deviceId,e.creationDate,e.source,e.order)}static fromMap(e,t){return new n(r.getString(t,"uniqueId"),r.getStringOrNull(t,"creatorId"),r.getStringOrNull(t,"deviceId"),e.decodeDate(r.getNumber(t,"creationDate")),y(r.getString(t,"source"),le),e.fromData(r.get(t,"order")))}toMap(e){return{uniqueId:this.uniqueId,creatorId:this.creatorId,deviceId:this.deviceId,creationDate:e.encodeDate(this.creationDate),source:m(this.source),order:e.toData(this.order),orderId:this.order.uniqueId}}clone(){return new n(this.uniqueId,this.creatorId,this.deviceId,this.creationDate,this.source,this.order)}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.creatorId===this.creatorId&&e.deviceId===this.deviceId&&e.creationDate===this.creationDate&&e.source===this.source&&d(e.order,this.order)}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="04782a96389c4613a2eb8e03d5c2ce0c",n})(),SE=class extends f{build(i,e){return $A.fromMap(i,e)}},sl=(()=>{class n extends b{constructor(e,t,s,a,o,u,c,l,h){super(),this.invoiceType=e,this.status=t,this.provider=s,this.paymentRequestId=a,this.paymentId=o,this.paymentDate=u,this.checkoutSessionId=c,this.invoicingDetails=l,this.applicationFeeTransactionId=h}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}get isSuccess(){return this.status===qt.Succeeded}static create(e){var t,s,a,o,u,c,l;return new n(e.invoiceType,e.status,(t=e.provider)!==null&&t!==void 0?t:null,(s=e.paymentRequestId)!==null&&s!==void 0?s:null,(a=e.paymentId)!==null&&a!==void 0?a:null,(o=e.paymentDate)!==null&&o!==void 0?o:dt.defined(null),(u=e.checkoutSessionId)!==null&&u!==void 0?u:null,(c=e.invoicingDetails)!==null&&c!==void 0?c:null,(l=e.applicationFeeTransactionId)!==null&&l!==void 0?l:null)}static checkoutSession(e){return n.create(e)}static prepared(e){return n.create({invoiceType:e,status:qt.Prepared})}static fromMap(e,t){return new n(y(r.getString(t,"invoiceType"),Ni),y(r.getString(t,"status"),qt),Re(r.getStringOrNull(t,"provider"),is),r.getStringOrNull(t,"paymentRequestId"),r.getStringOrNull(t,"paymentId"),dt.decode(r.getRaw(t,"paymentDate"),s=>e.decodeDate(K.decodeNumber(s))),r.getStringOrNull(t,"checkoutSessionId"),e.fromDataOrNull(r.getOrNull(t,"invoicingDetails")),r.getStringOrNull(t,"applicationFeeTransactionId"))}toMap(e){return{invoiceType:m(this.invoiceType),status:m(this.status),provider:Se(this.provider),paymentRequestId:this.paymentRequestId,paymentId:this.paymentId,paymentDate:this.paymentDate.encode(t=>e.encodeDate(t)),checkoutSessionId:this.checkoutSessionId,invoicingDetails:e.toDataOrNull(this.invoicingDetails),applicationFeeTransactionId:this.applicationFeeTransactionId}}clone(){var e,t;return new n(this.invoiceType,this.status,this.provider,this.paymentRequestId,this.paymentId,this.paymentDate.clone(s=>g.cloneDate(s)),this.checkoutSessionId,(t=(e=this.invoicingDetails)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null,this.applicationFeeTransactionId)}isSame(e){return this===e?!0:this.invoiceType===e.invoiceType&&this.status===e.status&&this.provider===e.provider&&this.paymentId===e.paymentId&&this.checkoutSessionId===e.checkoutSessionId&&this.paymentRequestId===e.paymentRequestId&&this.applicationFeeTransactionId===e.applicationFeeTransactionId&&d(e.invoicingDetails,this.invoicingDetails)}copyWith(e){var t,s,a,o,u,c,l,h,p,I,v;return new n((t=e.invoiceType)!==null&&t!==void 0?t:this.invoiceType,(s=e.status)!==null&&s!==void 0?s:this.status,(a=e.provider)!==null&&a!==void 0?a:this.provider,(o=e.paymentRequestId)!==null&&o!==void 0?o:this.paymentRequestId,(u=e.paymentId)!==null&&u!==void 0?u:this.paymentId,(c=e.paymentDate)!==null&&c!==void 0?c:this.paymentDate.clone(E=>g.cloneDate(E)),(l=e.checkoutSessionId)!==null&&l!==void 0?l:this.checkoutSessionId,(h=e.invoicingDetails)!==null&&h!==void 0?h:(I=(p=this.invoicingDetails)===null||p===void 0?void 0:p.clone())!==null&&I!==void 0?I:null,(v=e.applicationFeeTransactionId)!==null&&v!==void 0?v:this.applicationFeeTransactionId)}}return n.TYPE_ID="5358056c948b499bab9cbde5ed251e7d",n.SCHEMA_VERSION=11,n})(),TE=class extends f{build(i,e){return sl.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(sl.SCHEMA_VERSION))return e;if(t.isGreaterThan(sl.SCHEMA_VERSION))return null;let s=t.to;if(s<2&&(r.set(e,"paymentRequestId",null),s=2),s<3&&(r.set(e,"checkoutSessionId",null),s=3),s<4&&(r.set(e,"invoiceProvider",null),r.set(e,"invoiceId",null),r.set(e,"invoiceDownloadUrl",null),s=4),s<5&&(r.set(e,"invoiceType",m(Ni.PhysicalPerson)),s=5),s<6){let a=Re(r.getOrNull(e,"invoiceProvider"),qn),o=r.getOrNull(e,"invoiceId"),u=r.getOrNull(e,"invoiceDownloadUrl"),c=[];a!=null&&o!=null&&u!=null&&c.push(Va.create({provider:a,uniqueId:o,name:o,downloadUrl:u})),e.invoices=c.map(l=>i.toData(l)),s=6}if(s<7&&(r.set(e,"requiresApplicationFeeInvoice",!1),s=7),s<8&&(r.setIfNullOrUndefined(e,"paymentDate",dt.UNDEFINED_STATUS),s=8),s<9){let a=r.getList(e,"invoices",u=>i.fromData(u)),o=null;a.length>0&&(o=za.fromLegacy({orderInvoice:nd.fromLegacy(a[0]),applicationFeeInvoice:a.length>1?nd.fromLegacy(a[1]):null}
3)),e.invoicingDetails=i.toDataOrNull(o),s=9}if(s<10&&(s=10),s<11){let a=r.getBoolean(e,"requiresApplicationFeeInvoice"),o=r.getStringOrNull(e,"paymentRequestId");e.applicationFeeTransactionId=o!=null&&a?`fee.${o}`:null,s=11}return e.$schema_version=D.encodedExactly(s),e}migrateFromCurrentSchemaVersion(i,e,t){let s=e.$schemaVersion.to;return s>=11&&(t.requiresApplicationFeeInvoice=e.applicationFeeTransactionId!=null,t.$schema_version=D.encodedBetween(9,11),s=10),t}},rl=(()=>{class n extends b{constructor(e,t,s,a,o){super(),this.uniqueId=e,this.businessRef=t,this.tickets=s,this.refunds=a,this.discount=o}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static create(e){return new n(e.uniqueId,e.businessRef,e.tickets,e.refunds,e.discount)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),j.mustDecode(r.get(t,"businessRef")),r.getList(t,"tickets",s=>e.fromData(s)),r.getList(t,"refunds",s=>e.fromData(s)),e.fromDataOrNull(r.getOrNull(t,"discount")))}toMap(e){e.storage.set("avoidOptimizeForQuery",!0);let t={uniqueId:this.uniqueId,businessRef:this.businessRef.encode(),tickets:this.tickets.map(s=>e.toData(s)),discount:e.toDataOrNull(this.discount),refunds:this.refunds.map(s=>e.toData(s))};return e.storage.remove("avoidOptimizeForQuery"),t}clone(){var e,t;return new n(this.uniqueId,this.businessRef.clone(),this.tickets.map(s=>s.clone()),this.refunds.map(s=>s.clone()),(t=(e=this.discount)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null)}isSame(e){return this===e?!0:e.uniqueId===this.uniqueId&&e.businessRef===this.businessRef&&d(e.discount,this.discount)&&P(e.tickets,this.tickets,d)&&P(e.refunds,this.refunds,d)}assignToCustomerAccount(e){var t,s;return new n(this.uniqueId,this.businessRef.clone(),this.tickets.map(a=>a.assignToCustomerAccount(e)),this.refunds.map(a=>a.clone()),(s=(t=this.discount)===null||t===void 0?void 0:t.clone())!==null&&s!==void 0?s:null)}}return n.TYPE_ID="130b21920b544d6c98d5863995072d0d",n.SCHEMA_VERSION=3,n})(),OE=class extends f{build(i,e){return rl.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(rl.SCHEMA_VERSION))return e;if(t.isGreaterThan(rl.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(s=2),s<3&&(s=3,e.refunds=[]),e.$schema_version=D.encodedExactly(s),e}},LA=(()=>{class n extends Le{constructor(e,t,s,a,o,u,c,l,h,p){super(),this.uniqueId=e,this.creatorId=t,this.deviceId=s,this.creationDate=a,this.source=o,this.businessRef=u,this.templateId=c,this.roomId=l,this.removedLocks=h,this.addedLocks=p}static create(e){return new n(e.uniqueId,e.creatorId,e.deviceId,e.creationDate,e.source,e.businessRef,e.templateId,e.roomId,e.removedLocks,e.addedLocks)}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.getOrNull(t,"creatorId"),r.getOrNull(t,"deviceId"),e.decodeDate(r.get(t,"creationDate")),y(r.get(t,"source"),le),j.mustDecode(r.get(t,"businessRef")),r.get(t,"templateId"),r.get(t,"roomId"),r.getList(t,"removedLocks",s=>s),r.getList(t,"addedLocks",s=>s))}toMap(e){return{uniqueId:this.uniqueId,creatorId:this.creatorId,deviceId:this.deviceId,creationDate:e.encodeDate(this.creationDate),source:m(this.source),businessRef:this.businessRef.encode(),templateId:this.templateId,roomId:this.roomId,removedLocks:this.removedLocks,addedLocks:this.addedLocks}}clone(){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,this.businessRef.clone(),this.templateId,this.roomId,Te(this.removedLocks),Te(this.addedLocks))}isSame(e){return this===e?!0:e.uniqueId===this.uniqueId&&e.creatorId===this.creatorId&&e.deviceId===this.deviceId&&e.creationDate===this.creationDate&&e.source===this.source&&e.templateId===this.templateId&&e.roomId===this.roomId&&d(e.businessRef,this.businessRef)&&P(e.removedLocks,this.removedLocks)&&P(e.addedLocks,this.addedLocks)}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="175c6cf467364f8e90bb96fc5c58cde6",n})(),RE=class extends f{build(i,e){return LA.fromMap(i,e)}},VA=(()=>{class n extends Le{constructor(e,t,s,a,o,u){super(),this.uniqueId=e,this.creatorId=t,this.deviceId=s,this.creationDate=a,this.source=o,this.template=u}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.getOrNull(t,"creatorId"),r.getOrNull(t,"deviceId"),e.decodeDate(r.get(t,"creationDate")),y(r.get(t,"source"),le),e.fromData(r.get(t,"template")))}toMap(e){return{uniqueId:this.uniqueId,creatorId:this.creatorId,deviceId:this.deviceId,creationDate:e.encodeDate(this.creationDate),source:m(this.source),templateId:this.template.uniqueId,template:e.toData(this.template)}}clone(){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,this.template.clone())}isSame(e){return this===e?!0:e.uniqueId===this.uniqueId&&e.creatorId===this.creatorId&&e.deviceId===this.deviceId&&e.creationDate===this.creationDate&&e.source===this.source&&d(e.template,this.template)}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="5be9df6355b0464abd7d64184a9ee481",n})(),ME=class extends f{build(i,e){return VA.fromMap(i,e)}},zA=(()=>{class n extends Le{constructor(e,t,s,a,o,u,c){super(),this.uniqueId=e,this.creatorId=t,this.deviceId=s,this.creationDate=a,this.source=o,this.before=u,this.after=c}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.getOrNull(t,"creatorId"),r.getOrNull(t,"deviceId"),e.decodeDate(r.get(t,"creationDate")),y(r.get(t,"source"),le),e.fromData(r.get(t,"before")),e.fromData(r.get(t,"after")))}toMap(e){return{uniqueId:this.uniqueId,creatorId:this.creatorId,deviceId:this.deviceId,creationDate:e.encodeDate(this.creationDate),source:m(this.source),beforeId:this.before.uniqueId,before:e.toData(this.before),afterId:this.after.uniqueId,after:e.toData(this.after)}}clone(){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,this.before.clone(),this.after.clone())}isSame(e){return this===e?!0:e.uniqueId===this.uniqueId&&e.creatorId===this.creatorId&&e.deviceId===this.deviceId&&e.creationDate===this.creationDate&&e.source===this.source&&d(e.before,this.before)&&d(e.after,this.after)}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="730689c7ad4340039ce7caf843fbaca8",n})(),NE=class extends f{build(i,e){return zA.fromMap(i,e)}},UA=(()=>{class n extends Le{constructor(e,t,s,a,o,u){super(),this.uniqueId=e,this.creatorId=t,this.deviceId=s,this.creationDate=a,this.source=o,this.passes=u}static create(e){return new n(e.uniqueId,e.creatorId,e.deviceId,e.creationDate,e.source,e.passes)}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.getOrNull(t,"creatorId"),r.getOrNull(t,"deviceId"),e.decodeDate(r.get(t,"creationDate")),y(r.get(t,"source"),le),r.getList(t,"passes",s=>e.fromData(s)))}toMap(e){return{uniqueId:this.uniqueId,creatorId:this.creatorId,deviceId:this.deviceId,creationDate:e.encodeDate(this.creationDate),source:m(this.source),passes:this.passes.map(t=>e.toData(t))}}clone(){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,this.passes.map(e=>e.clone()))}isSame(e){return this===e?!0:e.uniqueId===this.uniqueId&&e.creatorId===this.creatorId&&e.deviceId===this.deviceId&&e.creationDate===this.creationDate&&e.source===this.source&&P(e.passes,this.passes,d)}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="59aee5a2bb1949b08d240fba6836453e",n})(),PE=class extends f{build(i,e){return UA.fromMap(i,e)}},BA=(()=>{class n extends Le{constructor(e,t,s,a,o,u){super(),this.uniqueId=e,this.creatorId=t,this.deviceId=s,this.creationDate=a,this.source=o,this.pass=u}static create(e){return new n(e.uniqueId,e.creatorId,e.deviceId,e.creationDate,e.source,e.pass)}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.getOrNull(t,"creatorId"),r.getOrNull(t,"deviceId"),e.decodeDate(r.get(t,"creationDate")),y(r.get(t,"source"),le),e.fromData(r.get(t,"pass")))}toMap(e){return{uniqueId:this.uniqueId,creatorId:this.creatorId,deviceId:this.deviceId,creationDate:e.encodeDate(this.creationDate),source:m(this.source),passId:this.pass.uniqueId,pass:e.toData(this.pass)}}clone(){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,this.pass.clone())}isSame(e){return this===e?!0:e.uniqueId===this.uniqueId&&e.creatorId===this.creatorId&&e.deviceId===this.deviceId&&e.creationDate===this.creationDate&&e.source===this.source&&d(e.pass,this.pass)}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="70158308f54347e18e7028fbd2c88572",n})(),AE=class extends f{build(i,e){return BA.fromMap(i,e)}},HA=(()=>{class n extends Le{constructor(e,t,s,a,o,u,c){super(),this.uniqueId=e,this.creatorId=t,this.deviceId=s,this.creationDate=a,this.source=o,this.before=u,this.after=c}static create(e){return new n(e.uniqueId,e.creatorId,e.deviceId,e.creationDate,e.source,e.before,e.after)}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.getOrNull(t,"creatorId"),r.getOrNull(t,"deviceId"),e.decodeDate(r.get(t,"creationDate")),y(r.get(t,"source"),le),e.fromData(r.get(t,"before")),e.fromData(r.get(t,"after")))}toMap(e){return{uniqueId:this.uniqueId,creatorId:this.creatorId,deviceId:this.deviceId,creationDate:e.encodeDate(this.creationDate),source:m(this.source),beforeId:this.before.uniqueId,before:e.toData(this.before),afterId:this.after.uniqueId,after:e.toData(this.after)}}clone(){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,this.before.clone(),this.after.clone())}isSame(e){return this===e?!0:e.uniqueId===this.uniqueId&&e.creatorId===this.creatorId&&e.deviceId===this.deviceId&&e.creationDate===this.creationDate&&e.source===this.source&&d(e.before,this.before)&&d(e.after,this.after)}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="fd0f428b3cf2417595f5a0366baa59be",n})(),CE=class extends f{build(i,e){return HA.fromMap(i,e)}},GA=(()=>{class n extends b{constructor(e,t,s){super(),this.businessRef=e,this.uniqueId=t,this.creationDate=s}get $typeId(){return n.TYPE_ID}get scanCode(){return this.uniqueId}static create(e){return new n(e.businessRef,e.uniqueId,e.creationDate)}static fromMap(e,t){return n.create({businessRef:j.mustDecode(r.getString(t,"businessRef")),uniqueId:r.getString(t,"uniqueId"),creationDate:e.decodeDate(r.getNumber(t,"creationDate"))})}toMap(e){return{businessRef:this.businessRef.encode(),uniqueId:this.uniqueId,creationDate:e.encodeDate(this.creationDate)}}clone(){return n.create({businessRef:this.businessRef.clone(),uniqueId:this.uniqueId,creationDate:g.cloneDate(this.creationDate)})}isSame(e){return e===this?!0:d(e.businessRef,this.businessRef)&&e.uniqueId===this.uniqueId&&e.creationDate===this.creationDate}}return n.TYPE_ID="df151ea0e11b43b2b4dea6e0707dc317",n})(),kE=class extends f{build(i,e){return GA.fromMap(i,e)}},al=(()=>{class n extends tt{constructor(e,t,s,a,o,u,c,l){super(),this.uniqueId=e,this.creatorId=t,this.deviceId=s,this.creationDate=a,this.source=o,this.seen=u,this.reservation=c,this.reservationId=l}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.getOrNull(t,"creatorId"),r.getOrNull(t,"deviceId"),e.decodeDate(r.get(t,"creationDate")),y(r.get(t,"source"),le),r.get(t,"seen"),e.fromData(r.get(t,"reservation")),r.get(t,"reservationId"))}toMap(e){return{reservationId:this.reservationId,uniqueId:this.uniqueId,creatorId:this.creatorId,deviceId:this.deviceId,creationDate:e.encodeDate(this.creationDate),source:m(this.source),reservation:e.toData(this.reservation),seen:this.seen}}clone(){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,this.seen,this.reservation.clone(),this.reservationId)}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.creatorId===this.creatorId&&e.deviceId===this.deviceId&&e.creationDate===this.creationDate&&e.source===this.source&&e.seen===this.seen&&d(e.reservation,this.reservation)&&e.reservationId===this.reservationId}markAsSeen(){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,!0,this.reservation.clone(),this.reservationId)}}return n.TYPE_ID="cb022201d0a640aebebd5308cd92b588",n.SCHEMA_VERSION=2,n})(),_E=class extends f{build(i,e){return al.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(al.SCHEMA_VERSION))return e;if(t.isGreaterThan(al.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(s=2),e.$schema_version=D.encodedExactly(s),e}},ol=(()=>
3{class n extends Ed{constructor(e,t,s,a,o,u,c,l,h,p,I,v,E,w,S,R,x){super(),this.uniqueId=e,this.status=t,this.creatorId=s,this.businessRef=a,this.dayOfYear=o,this.timeOfDay=u,this.timezone=c,this.creationDate=l,this.staffMemberId=h,this.staffMember=p,this.groupId=I,this.components=v,this.duration=E,this.serviceId=w,this.service=S,this.cancelledDate=R,this.cancelledBy=x,this.dayId=o.uniqueId,this.monthId=gi.dayOfYearToUniqueId(o)}get parentId(){return ut.none}get clientOrderGroupId(){return this.uniqueId}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(2,n.SCHEMA_VERSION)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),y(r.get(t,"$status"),St),r.get(t,"creatorId"),j.mustDecode(r.get(t,"businessRef")),e.fromData(r.getRaw(t,"dayOfYear")),e.fromData(r.getRaw(t,"timeOfDay")),r.get(t,"timezone"),e.decodeDate(r.get(t,"creationDate")),new ut(r.getOrNull(t,"staffMemberId")),e.fromDataOrNull(r.getOrNull(t,"staffMember")),r.getOrNull(t,"groupId"),ae.deserialize(e,r.getList(t,"components",s=>s)),e.decodeDuration(r.get(t,"duration")),r.get(t,"serviceId"),e.fromData(r.getRaw(t,"service")),e.decodeDateOrNull(r.getOrNull(t,"cancelledDate")),r.getOrNull(t,"cancelledBy"))}toMap(e){return{uniqueId:this.uniqueId,creatorId:this.creatorId,businessRef:this.businessRef.encode(),dayId:this.dayId,monthId:this.monthId,dayOfYear:e.toData(this.dayOfYear),timeOfDay:e.toData(this.timeOfDay),timezone:this.timezone,creationDate:e.encodeDate(this.creationDate),date:e.encodeDate(this.time),serviceId:this.serviceId,service:e.toData(this.service),staffMemberId:this.staffMemberId.queryableValue,staffMember:e.toDataOrNull(this.staffMember),$status:m(this.status),groupId:this.groupId,parentId:this.parentId.queryableValue,clientOrderGroupId:this.clientOrderGroupId,duration:e.encodeDuration(this.duration),components:this.components.serialize(e),cancelledDate:e.encodeDateOrNull(this.cancelledDate),cancelledBy:this.cancelledBy}}clone(){var e,t;return new n(this.uniqueId,this.status,this.creatorId,this.businessRef.clone(),this.dayOfYear.clone(),this.timeOfDay.clone(),this.timezone,g.cloneDate(this.creationDate),this.staffMemberId.clone(),(t=(e=this.staffMember)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null,this.groupId,this.components.clone(),this.duration,this.serviceId,this.service.clone(),g.cloneDateOrNull(this.cancelledDate),this.cancelledBy)}isSame(e){return this===e?!0:e.uniqueId===this.uniqueId&&e.status===this.status&&e.creatorId===this.creatorId&&e.cancelledDate===this.cancelledDate&&e.cancelledBy===this.cancelledBy&&d(e.businessRef,this.businessRef)&&d(e.dayOfYear,this.dayOfYear)&&d(e.timeOfDay,this.timeOfDay)&&e.timezone===this.timezone&&e.creationDate===this.creationDate&&d(e.staffMemberId,this.staffMemberId)&&d(e.staffMember,this.staffMember)&&e.groupId===this.groupId&&e.components.isSame(this.components)&&e.duration===this.duration&&e.serviceId===this.serviceId&&d(e.service,this.service)}copyWithBusinessRef(e){var t,s;return new n(this.uniqueId,this.status,this.creatorId,e.clone(),this.dayOfYear.clone(),this.timeOfDay.clone(),this.timezone,g.cloneDate(this.creationDate),this.staffMemberId,(s=(t=this.staffMember)===null||t===void 0?void 0:t.copyWithBusinessRef(e))!==null&&s!==void 0?s:null,this.groupId,this.components.copyWithBusinessRef(e),this.duration,this.serviceId,this.service.copyWithBusinessRef(e),g.cloneDateOrNull(this.cancelledDate),this.cancelledBy)}}return n.TYPE_ID="fd7e0334304a4193aa11b366020a6019",n.SCHEMA_VERSION=4,n})(),xE=class extends f{build(i,e){return ol.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(r.replace(e,"$status","DELETED",m(St.Canceled)),t.contains(ol.SCHEMA_VERSION))return e;if(t.isGreaterThan(ol.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(r.setIfNullOrUndefined(e,"businessRef",r.get(e,"businessId")),s=2),s<3&&(s=3),s<4&&(s=4),e.$schema_version=D.encodedExactly(s),e}},Qa=(()=>{class n extends b{constructor(e,t,s=null){super(),this.timeOfDay=e,this.service=t,this.serviceId=t.uniqueId,this.duration=s??t.getDuration()}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}static fromMap(e,t){return new n(e.fromData(r.getRaw(t,"timeOfDay")),e.fromData(r.getRaw(t,"service")),e.decodeDuration(r.get(t,"duration")))}toMap(e){return{timeOfDay:e.toData(this.timeOfDay),service:e.toData(this.service),duration:e.encodeDuration(this.duration)}}clone(){return new n(this.timeOfDay.clone(),this.service.clone(),this.duration.clone())}isSame(e){return this===e?!0:d(e.timeOfDay,this.timeOfDay)&&d(e.service,this.service)&&e.duration===this.duration&&e.serviceId===this.serviceId}copyWithBusinessRef(e){return new n(this.timeOfDay.clone(),this.service.copyWithBusinessRef(e),this.duration.clone())}}return n.TYPE_ID="41ecebd379a54e98a8e8437a4ec98be0",n.SCHEMA_VERSION=2,n})(),FE=class extends f{build(i,e){return Qa.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(Qa.SCHEMA_VERSION))return e;if(t.isGreaterThan(Qa.SCHEMA_VERSION))return null;let s=t.to;if(s<2){let a=i.fromData(r.getRaw(e,"flexibleDuration"));r.set(e,"duration",i.encodeDuration(a.totalDuration)),s=2}return e.$schema_version=D.encodedExactly(s),e}},ul=(()=>{class n extends b{constructor(e,t,s,a,o,u=null){super(),this.uniqueId=e,this.appStoreId=t,this.creatorId=s,this.name=a,this.creationDate=o,this.subscription=u}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static fromAccount(e){return new n(e.uniqueId,Iu().toUpperCase(),e.uniqueId,e.formattedName,(0,oe.default)())}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.get(t,"appStoreId"),r.get(t,"creatorId"),r.get(t,"name"),e.decodeDate(r.get(t,"creationDate")),e.fromDataOrNull(r.getOrNull(t,"subscription")))}toMap(e){return{uniqueId:this.uniqueId,appStoreId:this.appStoreId,creatorId:this.creatorId,name:this.name,creationDate:e.encodeDate(this.creationDate),subscription:e.toDataOrNull(this.subscription)}}clone(){var e,t;return new n(this.uniqueId,this.appStoreId,this.creatorId,this.name,g.cloneDate(this.creationDate),(t=(e=this.subscription)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null)}isSame(e){return this===e?!0:e.uniqueId===this.uniqueId&&e.appStoreId===this.appStoreId&&e.creatorId===this.creatorId&&e.name===this.name&&e.creationDate===this.creationDate&&d(e.subscription,this.subscription)}}
3return n.TYPE_ID="0886902cdb2e434fafa5e3a82d6fa26d",n.SCHEMA_VERSION=2,n})(),qE=class extends f{build(i,e){return ul.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(ul.SCHEMA_VERSION))return e;if(t.isGreaterThan(ul.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(r.setIfNullOrUndefined(e,"appStoreId",Iu().toUpperCase()),s=2),e.$schema_version=D.encodedExactly(s),e}},WA=(()=>{class n extends b{constructor(e,t,s,a,o,u=null,c=null,l){super(),this.uniqueId=e,this.firstName=t,this.lastName=s,this.email=a,this.phoneNumber=o,this.photo=u,this.pushNotificationToken=c,this.creationDate=l,this.formattedName=fi(t,s),this.initials=pi(t,s)}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}get hasAName(){return this.firstName!==null&&this.firstName.length!==0||this.lastName!==null&&this.lastName.length!==0}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.get(t,"firstName"),r.get(t,"lastName"),r.get(t,"email"),ft.mustDecode(r.get(t,"phoneNumber")),e.fromDataOrNull(r.getRaw(t,"photo")),r.getOrNull(t,"pushNotificationToken"),e.decodeDateOrNull(r.getOrNull(t,"creationDate")))}toMap(e){return{uniqueId:this.uniqueId,firstName:this.firstName,lastName:this.lastName,email:this.email,phoneNumber:this.phoneNumber.encode(),photo:e.toDataOrNull(this.photo),pushNotificationToken:this.pushNotificationToken,creationDate:e.encodeDateOrNull(this.creationDate)}}clone(){var e,t;return new n(this.uniqueId,this.firstName,this.lastName,this.email,this.phoneNumber.clone(),(t=(e=this.photo)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null,this.pushNotificationToken,g.cloneDateOrNull(this.creationDate))}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.firstName===this.firstName&&e.lastName===this.lastName&&e.email===this.email&&d(e.phoneNumber,this.phoneNumber)&&d(e.photo,this.photo)&&e.pushNotificationToken===this.pushNotificationToken&&e.creationDate===this.creationDate}copyWith(e){var t,s,a,o,u,c;return new n(this.uniqueId,(t=e?.firstName)!==null&&t!==void 0?t:this.firstName,(s=e?.lastName)!==null&&s!==void 0?s:this.lastName,(a=e?.email)!==null&&a!==void 0?a:this.email,(o=e?.phoneNumber)!==null&&o!==void 0?o:this.phoneNumber,(u=e?.photo)!==null&&u!==void 0?u:this.photo,this.pushNotificationToken,(c=e?.creationDate)!==null&&c!==void 0?c:g.cloneDateOrNull(this.creationDate))}}return n.TYPE_ID="ffd67fe8e7074857bb8e340966eef98d",n.SCHEMA_VERSION=2,n})(),YE=class extends f{build(i,e){return WA.fromMap(i,e)}},jA=(()=>{class n extends b{constructor(e,t){super(),this.uniqueId=e,this.name=t}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.uniqueId,e.name)}static fromMap(e,t){return n.create({uniqueId:r.getString(t,"uniqueId"),name:r.getString(t,"name")})}toMap(e){return{uniqueId:this.uniqueId,name:this.name}}clone(){return n.create({uniqueId:this.uniqueId,name:this.name})}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.name===this.name}}return n.TYPE_ID="efe95367d0714381ba349d77b5f7b6d3",n})(),$E=class extends f{build(i,e){return jA.fromMap(i,e)}},JA=(()=>{class n extends b{constructor(e){super(),this.vendorSettings=e}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.vendorSettings)}static fromMap(e,t){return n.create({vendorSettings:e.fromDataOrNull(r.getRecordOrNull(t,"vendorSettings"))})}toMap(e){return{vendorSettings:e.toDataOrNull(this.vendorSettings)}}clone(){var e,t;return n.create({vendorSettings:(t=(e=this.vendorSettings)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null})}isSame(e){return e===this?!0:d(e.vendorSettings,this.vendorSettings)}}return n.TYPE_ID="dc30212d0fb74cb19f9ddc8403c4a817",n})(),LE=class extends f{build(i,e){return JA.fromMap(i,e)}},KA=(()=>{class n extends b{constructor(e,t){super(),this.organizerIds=e,this.eventIds=t}get $typeId(){return n.TYPE_ID}static create(e){var t,s;return new n((t=e.organizerIds)!==null&&t!==void 0?t:[],(s=e.eventIds)!==null&&s!==void 0?s:[])}static fromMap(e,t){return n.create({organizerIds:r.getList(t,"organizerIds",s=>K.decodeString(s)),eventIds:r.getList(t,"eventIds",s=>K.decodeString(s))})}toMap(e){return{organizerIds:this.organizerIds,eventIds:this.eventIds}}clone(){return n.create({organizerIds:[...this.organizerIds],eventIds:[...this.eventIds]})}isSame(e){return e===this?!0:e.organizerIds===this.organizerIds&&e.eventIds===this.eventIds}}return n.TYPE_ID="c14357e7515f41eb813d7ade9dabee79",n})(),VE=class extends f{build(i,e){return KA.fromMap(i,e)}},VS=(()=>{class n extends b{constructor(e,t,s){super(),this.name=e,this.uniqueId=t,this.organizationId=s}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.get(t,"name"),r.get(t,"uniqueId"),r.get(t,"organizationId"))}toMap(e){return{name:this.name,uniqueId:this.uniqueId,organizationId:this.organizationId}}clone(){return new n(this.name,this.uniqueId,this.organizationId)}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.name===this.name&&e.organizationId===this.organizationId}}return n.TYPE_ID="b2c09b1d9305489888c06f7a001660ad",n})(),zE=class extends f{build(i,e){return VS.fromMap(i,e)}},wd=(function(n){return n.Live="LIVE",n.Archived="ARCHIVED",n})(wd||{}),cl=(()=>{class n extends b{constructor(e,t,s,a,o,u,c,l,h){super(),this.uniqueId=e,this.name=t,this.creationDate=s,this.organizationId=a,this.marketplaceAccountId=o,this.marketplaceProvider=u,this.invoicingProtocol=c,this.shouldSplitAp
3plicationFee=l,this.status=h}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(3,n.SCHEMA_VERSION)}static create(e){var t;return new n(e.uniqueId,e.name,e.creationDate,e.organizationId,e.marketplaceAccountId,e.marketplaceProvider,e.invoicingProtocol,e.shouldSplitApplicationFee,(t=e.status)!==null&&t!==void 0?t:wd.Live)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.get(t,"name"),e.decodeDate(r.get(t,"creationDate")),r.get(t,"organizationId"),r.get(t,"marketplaceAccountId"),y(r.get(t,"marketplaceProvider"),is),e.fromDataOrNull(r.getOrNull(t,"invoicingProtocol")),r.get(t,"shouldSplitApplicationFee"),y(r.get(t,"$status"),wd))}toMap(e){return{uniqueId:this.uniqueId,name:this.name,creationDate:e.encodeDate(this.creationDate),organizationId:this.organizationId,marketplaceAccountId:this.marketplaceAccountId,marketplaceProvider:m(this.marketplaceProvider),invoicingProtocol:e.toDataOrNull(this.invoicingProtocol),shouldSplitApplicationFee:this.shouldSplitApplicationFee,$status:m(this.status)}}clone(){var e,t;return new n(this.uniqueId,this.name,this.creationDate.clone(),this.organizationId,this.marketplaceAccountId,this.marketplaceProvider,(t=(e=this.invoicingProtocol)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null,this.shouldSplitApplicationFee,this.status)}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.name===this.name&&e.creationDate===this.creationDate&&e.organizationId===this.organizationId&&e.marketplaceAccountId===this.marketplaceAccountId&&e.marketplaceProvider===this.marketplaceProvider&&e.status===this.status&&this.shouldSplitApplicationFee===e.shouldSplitApplicationFee&&d(e.invoicingProtocol,this.invoicingProtocol)}copyWith(e){var t,s,a,o;return new n(this.uniqueId,this.name,this.creationDate.clone(),this.organizationId,this.marketplaceAccountId,this.marketplaceProvider,(t=e?.invoicingProtocol)!==null&&t!==void 0?t:(a=(s=this.invoicingProtocol)===null||s===void 0?void 0:s.clone())!==null&&a!==void 0?a:null,this.shouldSplitApplicationFee,(o=e?.status)!==null&&o!==void 0?o:this.status)}toRef(){return new VS(this.name,this.uniqueId,this.organizationId)}}return n.TYPE_ID="34d279b5c1c7401bbe4a8811ced405a2",n.SCHEMA_VERSION=5,n})(),UE=class extends f{build(i,e){return cl.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(cl.SCHEMA_VERSION))return e;if(t.isGreaterThan(cl.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(s=2),s<3&&(s=3),s<4&&(s=4,e.shouldSplitApplicationFee=!1),s<5&&(s=5,e.$status=m(wd.Live)),e.$schema_version=D.encodedExactly(s),e}},ll=(()=>{class n extends b{constructor(e,t,s,a,o){super(),this.uniqueId=e,this.creationDate=t,this.order=s,this.paymentSettings=a,this.overrideCheckoutReturnUrl=o}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}get orderId(){return this.order.uniqueId}get creatorId(){return this.order.creatorId}get status(){return this.order.onlinePaymentDetails.status}get provider(){return this.order.onlinePaymentDetails.provider}get paymentRequestId(){return this.order.onlinePaymentDetails.paymentRequestId}get paymentId(){return this.order.onlinePaymentDetails.paymentId}get checkoutSessionId(){return this.order.onlinePaymentDetails.checkoutSessionId}get isGuestPurchase(){return this.order.isGuestOrder}static ofOrder(e,t,s){if(k(e.onlinePaymentDetails)||k(e.onlinePaymentDetails.paymentRequestId))throw new Error("The order does not have online payment details.");return new n(e.onlinePaymentDetails.paymentRequestId,g.default().now(),e,Z(t),s)}static ofUpdatedOrder(e,t){if(k(t.onlinePaymentDetails)||k(t.onlinePaymentDetails.paymentRequestId)||t.onlinePaymentDetails.paymentRequestId!=e.uniqueId)throw new Error("The order does not have online payment details.");return new n(e.uniqueId,g.default().now(),t,Z(e.paymentSettings),e.overrideCheckoutReturnUrl)}static fromMap(e,t){return new n(r.getString(t,"uniqueId"),e.decodeDate(r.getNumber(t,"creationDate")),e.fromData(r.getRecord(t,"order")),e.fromDataOrNull(r.getRecordOrNull(t,"paymentSettings")),r.getStringOrNull(t,"overrideCheckoutReturnUrl"))}toMap(e){return{uniqueId:this.uniqueId,order:e.toData(this.order),orderId:this.order.uniqueId,creatorId:this.order.creatorId,status:Se(this.order.onlinePaymentDetails.status),provider:Se(this.order.onlinePaymentDetails.provider),paymentRequestId:this.order.onlinePaymentDetails.paymentRequestId,paymentId:this.order.onlinePaymentDetails.paymentId,checkoutSessionId:this.order.onlinePaymentDetails.checkoutSessionId,creationDate:e.encodeDate(this.creationDate),paymentSettings:e.toDataOrNull(this.paymentSettings),isGuestPurchase:this.order.isGuestOrder,overrideCheckoutReturnUrl:this.overrideCheckoutReturnUrl}}clone(){return new n(this.uniqueId,g.cloneDate(this.creationDate),this.order.clone(),Z(this.paymentSettings),this.overrideCheckoutReturnUrl)}isSame(e){return this===e?!0:d(e.order,this.order)&&d(e.paymentSettings,this.paymentSettings)&&this.overrideCheckoutReturnUrl===e.overrideCheckoutReturnUrl&&this.uniqueId===e.uniqueId&&this.creationDate===e.creationDate}}return n.TYPE_ID="11fc5026ca4b4dae81bc4f58a8c01545",n.SCHEMA_VERSION=4,n})(),BE=class extends f{build(i,e){return ll.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){var t;let s=r.getVersionRange(e);if(s.contains(ll.SCHEMA_VERSION))return e;
3if(s.isGreaterThan(ll.SCHEMA_VERSION))return null;let a=s.to;if(a<2&&(a=2),a<3&&(a=3),a<4){let o=i.fromDataOrNull(r.getRecordOrNull(e,"paymentAccount")),u=i.fromData(r.getRecord(e,"order")),c=o==null?null:Tr.create({standard:$r.create({paymentAccount:o,paymentMethods:[pe.Online],allowOfflineOrderReceipts:!1,allowLegalEntityInvoices:((t=u.onlinePaymentDetails)===null||t===void 0?void 0:t.invoiceType)===Ni.LegalEntity}),products:null});e.paymentSettings=i.toDataOrNull(c),a=4}return e.$schema_version=D.encodedExactly(a),e}},dl=(()=>{class n extends b{constructor(e,t,s,a=null,o=null,u=new Map){super(),this.order=e,this.status=t,this.provider=s,this.paymentRequestId=a,this.paymentId=o,this.data=u}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}get isFailure(){return this.status===qt.Failed||this.status===qt.Canceled}static fromMap(e,t){return new n(e.fromData(r.get(t,"order")),r.get(t,"status"),r.get(t,"provider"),r.getOrNull(t,"paymentRequestId"),r.getOrNull(t,"paymentId"),r.getMap(t,"data",(s,a)=>({key:s,value:a})))}toMap(e){return{order:e.toData(this.order),status:this.status,provider:this.provider,paymentRequestId:this.paymentRequestId,paymentId:this.paymentId,data:se(this.data,(t,s)=>({key:t,value:s}))}}clone(){return new n(this.order.clone(),this.status,this.provider,this.paymentRequestId,this.paymentId,ee(this.data))}isSame(e){return this===e?!0:d(e.order,this.order)&&re(e.data,this.data)&&this.status===e.status&&this.provider===e.provider&&this.paymentRequestId===e.paymentRequestId&&this.paymentId===e.paymentId}getData(e,t){let s=this.data.get(e);if(_(s))return s;if(_(t))return t;throw new Error(`Missing or null field with key {${e}} in payment data.`)}getDataOrNull(e){let t=this.data.get(e);return t!==void 0?t===null?null:t:null}}return n.TYPE_ID="a9a948152d114df984b15cbdd1cf7acb",n.SCHEMA_VERSION=2,n})(),HE=class extends f{build(i,e){return dl.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(dl.SCHEMA_VERSION))return e;if(t.isGreaterThan(dl.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(r.setIfNullOrUndefined(e,"paymentRequestId",null),s=2),e.$schema_version=D.encodedExactly(s),e}},ZA=(()=>{class n extends b{constructor(e,t,s,a=null,o=null,u=null,c=new Map){super(),this.order=e,this.status=t,this.provider=s,this.paymentRequestId=a,this.paymentId=o,this.checkoutSessionId=u,this.data=c}get $typeId(){return n.TYPE_ID}get isFailure(){return this.status===qt.Failed||this.status===qt.Canceled}static fromMap(e,t){return new n(e.fromData(r.get(t,"order")),r.get(t,"status"),r.get(t,"provider"),r.getOrNull(t,"paymentRequestId"),r.getOrNull(t,"paymentId"),r.getOrNull(t,"checkoutSessionId"),r.getMap(t,"data",(s,a)=>({key:s,value:a})))}toMap(e){return{order:e.toData(this.order),status:this.status,provider:this.provider,paymentRequestId:this.paymentRequestId,paymentId:this.paymentId,checkoutSessionId:this.checkoutSessionId,data:se(this.data,(t,s)=>({key:t,value:s}))}}clone(){return new n(this.order.clone(),this.status,this.provider,this.paymentRequestId,this.paymentId,this.checkoutSessionId,ee(this.data))}isSame(e){return this===e?!0:d(e.order,this.order)&&re(e.data,this.data)&&this.status===e.status&&this.provider===e.provider&&this.paymentRequestId===e.paymentRequestId&&this.paymentId===e.paymentId&&this.checkoutSessionId===e.checkoutSessionId}getData(e,t){let s=this.data.get(e);if(_(s))return s;if(_(t))return t;throw new Error(`Missing or null field with key {${e}} in checkout data.`)}getDataOrNull(e){let t=this.data.get(e);return t!==void 0?t===null?null:t:null}}return n.TYPE_ID="cf93ca2588ae41fe8b36b0e53d5cec5b",n})(),GE=class extends f{build(i,e){return ZA.fromMap(i,e)}},XA=(()=>{class n extends b{constructor(e,t,s,a){super(),this.firstName=e,this.lastName=t,this.email=s,this.phoneNumber=a}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.getOrNull(t,"firstName"),r.getOrNull(t,"lastName"),r.getOrNull(t,"email"),ft.mustDecode(r.get(t,"phoneNumber")))}toMap(e){return{firstName:this.firstName,lastName:this.lastName,email:this.email,phoneNumber:this.phoneNumber.encode()}}clone(){return new n(this.firstName,this.lastName,this.email,this.phoneNumber.clone())}isSame(e){return e===this?!0:e.firstName===this.firstName&&e.lastName===this.lastName&&e.email===this.email&&d(e.phoneNumber,this.phoneNumber)}}return n.TYPE_ID="d042d63f90eb4cc99ca8f13912506a80",n})(),WE=class extends f{build(i,e){return XA.fromMap(i,e)}},hl=(()=>{class n extends Cr{constructor(e,t,s,a,o,u,c,l,h,p,I,v,E,w,S,R,x,N,O,A){super(),this.uniqueId=e,this.creatorId=t,this.businessRef=s,this.dayOfYear=a,this.timezone=o,this.creationDate=u,this.client=c,this.clientId=l,this.contactDetails=h,this.timeOfDay=p,this.staffMemberId=I,this.staffMember=v,this.status=E,this.services=w,this.hasBeenReviewed=S,this.components=R,this.groupId=x,this.parentId=N,this.cancelledDate=O,this.cancelledBy=A,this.paymentType=pe.OnDelivery,this.paymentMethod=Fe.Cash,this.onlinePaymentDetails=null,this.totalDuration=Cr.calculateTotalDuration(w),this.dayId=a.uniqueId,this.monthId=gi.dayOfYearToUniqueId(a),this.userId=c.userId,this.customerId=c.uniqueId,this.language=c.language,this.country=h.country}get duration(){return this.totalDuration}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(7,n.SCHEMA_VERSION)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.get(t,"creatorId"),j.mustDecode(r.get(t,"businessRef")),e.fromData(r.getRaw(t,"dayOfYear")),r.get(t,"timezone"),e.decodeDate(r.get(t,"creationDate")),e.fromData(r.getRaw(t,"client")),r.get(t,"clientId"),e.fromData(r.getRaw(t,"contactDetails")),e.fromData(r.getRaw(t,"timeOfDay")),new ut(r.getOrNull(t,"staffMemberId")),e.fromDataOrNull(r.getOrNull(t,"staffMember")),r.get(t,"$status"),r.getList(t,"services",s=>e.fromData(s)),r.get(t,"hasBeenReviewed"),ae.deserialize(e,r.getList(t,"components",s=>s)),r.getOrNull(t,"groupId"),new ut(r.getOrNull(t,"parentId")),e.decodeDateOrNull(r.getOrNull(t,"cancelledDate")),r.getOrNull(t,"cancelledBy"))}toMap(e){return{uniqueId:this.uniqueId,creatorId:this.creatorId,userId:this.userId,businessRef:this.businessRef.encode(),dayId:this.dayId,monthId:this.monthId,dayOfYear:e.toData(this.dayOfYear),timeOfDay:e.toData(this.timeOfDay),timezone:this.timezone,creationDate:e.encodeDate(this.creationDate),date:e.encodeDate(this.time),contactDetails:e.toData(this.contactDetails),clientId:this.clientId,staffMemberId:this.staffMemberId.queryableValue,client:e.toData(this.client),staffMember:e.toDataOrNull(this.staffMember),services:this.services.map(t=>e.toData(t)),hasBeenReviewed:this.hasBeenReviewed,components:this.components.serialize(e),$status:this.status,groupId:this.groupId,parentId:this.parentId.queryableValue,paymentType:m(this.paymentType),paymentMethod:m(this.paymentMethod),onlinePaymentDetails:e.toDataOrNull(this.onlinePaymentDetails),cancelledDate:e.encodeDateOrNull(this.cancelledDate),
3cancelledBy:this.cancelledBy}}clone(){var e,t;return new n(this.uniqueId,this.creatorId,this.businessRef.clone(),this.dayOfYear.clone(),this.timezone,g.cloneDate(this.creationDate),this.client.clone(),this.clientId,this.contactDetails.clone(),this.timeOfDay.clone(),this.staffMemberId.clone(),(t=(e=this.staffMember)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null,this.status,this.services.map(s=>s.clone()),this.hasBeenReviewed,this.components.clone(),this.groupId,this.parentId.clone(),g.cloneDateOrNull(this.cancelledDate),this.cancelledBy)}isSame(e){return this===e?!0:d(e.client,this.client)&&d(e.dayOfYear,this.dayOfYear)&&d(e.timeOfDay,this.timeOfDay)&&d(e.staffMember,this.staffMember)&&d(e.contactDetails,this.contactDetails)&&P(e.services,this.services,d)&&e.components.isSame(this.components)&&e.timezone===this.timezone&&e.uniqueId===this.uniqueId&&e.creatorId===this.creatorId&&e.cancelledDate===this.cancelledDate&&e.cancelledBy===this.cancelledBy&&d(e.businessRef,this.businessRef)&&d(e.staffMemberId,this.staffMemberId)&&e.clientId===this.clientId&&e.creationDate===this.creationDate&&e.hasBeenReviewed===this.hasBeenReviewed&&e.status===this.status&&e.groupId===this.groupId&&d(e.parentId,this.parentId)}copyWithBusinessRef(e){var t,s;return new n(this.uniqueId,this.creatorId,e.clone(),this.dayOfYear.clone(),this.timezone,g.cloneDate(this.creationDate),this.client.copyWithBusinessRef(e),this.clientId,this.contactDetails.clone(),this.timeOfDay.clone(),this.staffMemberId.clone(),(s=(t=this.staffMember)===null||t===void 0?void 0:t.copyWithBusinessRef(e))!==null&&s!==void 0?s:null,this.status,this.services.map(a=>a.copyWithBusinessRef(e)),this.hasBeenReviewed,this.components.copyWithBusinessRef(e),this.groupId,this.parentId.clone(),g.cloneDateOrNull(this.cancelledDate),this.cancelledBy)}assignToCustomerAccount(e){var t,s;return new n(this.uniqueId,e.uniqueId,this.businessRef.clone(),this.dayOfYear.clone(),this.timezone,g.cloneDate(this.creationDate),this.client.assignToCustomerAccount(e),this.clientId,this.contactDetails.clone(),this.timeOfDay.clone(),this.staffMemberId.clone(),(s=(t=this.staffMember)===null||t===void 0?void 0:t.clone())!==null&&s!==void 0?s:null,this.status,this.services.map(a=>a.clone()),this.hasBeenReviewed,this.components.clone(),this.groupId,this.parentId.clone(),g.cloneDateOrNull(this.cancelledDate),this.cancelledBy)}withNewClient(e){var t,s;return new n(this.uniqueId,this.creatorId,this.businessRef.clone(),this.dayOfYear.clone(),this.timezone,g.cloneDate(this.creationDate),e,e.uniqueId,this.contactDetails.clone(),this.timeOfDay.clone(),this.staffMemberId.clone(),(s=(t=this.staffMember)===null||t===void 0?void 0:t.clone())!==null&&s!==void 0?s:null,this.status,ue(this.services),this.hasBeenReviewed,this.components.clone(),this.groupId,this.parentId.clone(),g.cloneDateOrNull(this.cancelledDate),this.cancelledBy)}copyWithPaymentDetails(e){return this.clone()}copyWithPaymentStatus(e){return this.clone()}copyWithPaymentMethod(e){return this.clone()}tryGetCustomer(){return this.client}hasComponentByTypeId(e){return this.components.hasComponentByTypeId(e)}mustFindComponentByTypeId(e){return this.components.mustFindComponentByTypeId(e)}findComponentByTypeId(e){return this.components.findComponentByTypeId(e)}findComponentByInstanceId(e){return this.components.findComponentByInstanceId(e)}findComponentsByTypeId(e){return this.components.findComponentsByTypeId(e)}addComponent(e){this.components.addComponent(e)}addComponents(e){this.components.addComponents(e)}removeComponentByTypeId(e){return this.components.removeComponentByTypeId(e)}removeComponentByInstanceId(e){return this.components.removeComponentByInstanceId(e)}removeComponentAt(e){this.components.removeComponentAt(e)}removeAllComponents(){this.components.removeAllComponents()}popAllComponentsByTypeId(e){return this.components.popAllComponentsByTypeId(e)}popComponentByTypeId(e){return this.components.popComponentByTypeId(e)}popComponent(e){return this.components.popComponent(e)}replaceComponent(e){return this.components.replaceComponent(e)}addOrReplaceComponent(e){this.components.addOrReplaceComponent(e)}mustFindComponentField(e,t){return this.components.mustFindComponentField(e,t)}findComponentField(e,t){return this.components.findComponentField(e,t)}}return n.TYPE_ID="e8bfb3910769497e9efe5613e2e1f804",n.SCHEMA_VERSION=10,n})(),jE=class extends f{build(i,e){return hl.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(r.replace(e,"$status","DELETED",m(St.Canceled)),t.contains(hl.SCHEMA_VERSION))return e;if(t.isGreaterThan(hl.SCHEMA_VERSION))return null;let s=t.to;if(s<2){let a=i.fromData(r.getRaw(e,"flexibleDuration")),o=[new Qa(i.fromData(r.getRaw(e,"timeOfDay")),i.fromData(r.getRaw(e,"service")),a.totalDuration)];r.set(e,"services",o.map(u=>i.toData(u))),s=2}if(s<3&&(r.set(e,"components",[]),s=3),s<4){let a=ae.deserialize(i,r.getList(e,"components",u=>u)),o=a.findComponentByTypeId(Vd.TYPE_ID);o&&a.addComponent(new Ld(o.note)),r.set(e,"components",a.serialize(i)),s=4}return s<5&&(r.setIfNullOrUndefined(e,"hasBeenReviewed",!1),s=5),s<6&&(r.set(e,"parentId",null),s=6),s<7&&(r.setIfNullOrUndefined(e,"businessRef",r.get(e,"businessId")),s=7),s<8&&(s=8),s<9&&(s=9),s<10&&(s=10),e.$schema_version=D.encodedExactly(s),e}},QA=(()=>{class n extends b{constructor(e,t,s,a){super(),this.storagePath=e,this.downloadUrl=t,this.width=s,this.height=a,this.hasImageSize=s>0&&a>0,this.aspectRatio=this.hasImageSize?s/a:0}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.getString(t,"storagePath"),r.getString(t,"downloadUrl"),r.getNumber(t,"width"),r.getNumber(t,"height"))}toMap(e){return{storagePath:this.storagePath,downloadUrl:this.downloadUrl,width:this.width,height:this.height}}clone(){return new n(this.storagePath,this.downloadUrl,this.width,this.height)}isSame(e){return e===this?!0:e.height===this.height&&e.width===this.width&&e.storagePath===this.storagePath&&e.downloadUrl===this.downloadUrl}}return n.TYPE_ID="787d3c97bbc1465897107e95072f6148",n})(),JE=class extends f{build(i,e){return QA.fromMap(i,e)}};var KE=class{constructor(i,e){this.categoryId=i,this.pointsOfInterest=e}isSame(i){return this===i?!0:i.categoryId===this.categoryId&&P(i.pointsOfInterest,this.pointsOfInterest)}},eC=(()=>{class n extends b{constructor(e,t){super(),this.localityId=e,this.pointsOfInterest=t}get $typeId(){return n.TYPE_ID}get uniqueId(){return this.localityId}static fromMap(e,t){let s=r.getMap(t,"pointsOfInterest",(o,u)=>
3({key:o,value:u})),a=[];return s.forEach((o,u)=>{a.push(new KE(u,o))}),new n(r.get(t,"localityId"),a)}toMap(e){let t={};for(let s of this.pointsOfInterest)t[s.categoryId]=s.pointsOfInterest;return{localityId:this.localityId,pointsOfInterest:t}}clone(){return new n(this.localityId,this.pointsOfInterest)}isSame(e){return this===e?!0:e.localityId===this.localityId&&P(e.pointsOfInterest,this.pointsOfInterest)}}return n.TYPE_ID="cabbe5ef7f094d6e9b9accba32256840",n})(),ZE=class extends f{build(i,e){return eC.fromMap(i,e)}},fl=(()=>{class n extends b{constructor(e,t,s){super(),this.numberOfLanes=e,this.maxCapacityPerLane=t,this.bookingInAdvance=s}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static fromMap(e,t){return new n(r.get(t,"numberOfLanes"),r.get(t,"maxCapacityPerLane"),e.decodeDuration(r.get(t,"bookingInAdvance")))}toMap(e){return{numberOfLanes:this.numberOfLanes,maxCapacityPerLane:this.maxCapacityPerLane,bookingInAdvance:e.encodeDuration(this.bookingInAdvance)}}clone(){return new n(this.numberOfLanes,this.maxCapacityPerLane,g.cloneDuration(this.bookingInAdvance))}isSame(e){return this===e?!0:e.numberOfLanes==this.numberOfLanes&&e.maxCapacityPerLane==this.maxCapacityPerLane&&e.bookingInAdvance==this.bookingInAdvance}}return n.TYPE_ID="717eacfecc8c414fb42043625f4c72b0",n.SCHEMA_VERSION=2,n})(),XE=class extends f{build(i,e){return fl.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(fl.SCHEMA_VERSION))return e;if(t.isGreaterThan(fl.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(r.set(e,"bookingInAdvance",bx*4),s=2),e.$schema_version=D.encodedExactly(s),e}},pl=(()=>{class n extends tt{constructor(e,t,s,a,o,u,c,l){super(),this.uniqueId=e,this.creatorId=t,this.deviceId=s,this.creationDate=a,this.source=o,this.seen=u,this.checkInId=c,this.checkIn=l}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.getOrNull(t,"creatorId"),r.getOrNull(t,"deviceId"),e.decodeDate(r.get(t,"creationDate")),y(r.get(t,"source"),le),r.get(t,"seen"),r.get(t,"checkInId"),e.fromData(r.get(t,"checkIn")))}toMap(e){return{uniqueId:this.uniqueId,creatorId:this.creatorId,deviceId:this.deviceId,creationDate:e.encodeDate(this.creationDate),source:m(this.source),seen:this.seen,checkInId:this.checkInId,checkIn:e.toData(this.checkIn)}}clone(){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,this.seen,this.checkInId,this.checkIn.clone())}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.creatorId===this.creatorId&&e.deviceId===this.deviceId&&e.creationDate===this.creationDate&&e.source===this.source&&e.seen===this.seen&&e.checkInId===this.checkInId&&d(e.checkIn,this.checkIn)}markAsSeen(){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,!0,this.checkInId,this.checkIn.clone())}}return n.TYPE_ID="8722905bbc7a4162a52480f913cac858",n.SCHEMA_VERSION=2,n})(),QE=class extends f{build(i,e){return pl.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(pl.SCHEMA_VERSION))return e;if(t.isGreaterThan(pl.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(s=2),e.$schema_version=D.encodedExactly(s),e}},tC=(function(n){return n.Open="OPEN",n.Finished="FINISHED",n})(tC||{}),gl=(()=>{class n extends b{constructor(e,t,s,a,o,u,c,l,h,p,I,v,E,w,S,R){super(),this.uniqueId=e,this.creatorId=t,this.businessId=s,this.reservationId=a,this.assignedKeys=o,this.assignedBracelets=u,this.hasSlippers=c,this.hasSwimmingCap=l,this.creationDate=h,this.checkInTime=p,this.status=I,this.reservation=v,this.checkOutTime=E,this.assignedLane=w,this.isLaneReserved=S,this.isPoolReserved=R}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.get(t,"creatorId"),r.get(t,"businessId"),r.get(t,"reservationId"),r.getList(t,"assignedKeys",s=>s),r.getList(t,"assignedBracelets",s=>s),r.get(t,"hasSlippers"),r.get(t,"hasSwimmingCap"),e.decodeDate(r.get(t,"creationDate")),e.decodeDate(r.get(t,"checkInTime")),y(r.get(t,"$status"),tC),e.fromData(r.get(t,"reservation")),e.decodeDateOrNull(r.getOrNull(t,"checkOutTime")),r.getOrNull(t,"assignedLane"),r.get(t,"isLaneReserved"),r.get(t,"isPoolReserved"))}toMap(e){return{uniqueId:this.uniqueId,creatorId:this.creatorId,businessId:this.businessId,reservationId:this.reservationId,assignedKeys:this.assignedKeys,assignedBracelets:this.assignedBracelets,hasSlippers:this.hasSlippers,hasSwimmingCap:this.hasSwimmingCap,creationDate:e.encodeDate(this.creationDate),
3checkInTime:e.encodeDate(this.checkInTime),$status:m(this.status),reservation:e.toData(this.reservation),checkOutTime:e.encodeDateOrNull(this.checkOutTime),assignedLane:this.assignedLane,isLaneReserved:this.isLaneReserved,isPoolReserved:this.isPoolReserved}}clone(){return new n(this.uniqueId,this.creatorId,this.businessId,this.reservationId,Te(this.assignedKeys),Te(this.assignedBracelets),this.hasSlippers,this.hasSwimmingCap,g.cloneDate(this.creationDate),g.cloneDate(this.checkInTime),this.status,this.reservation.clone(),g.cloneDateOrNull(this.checkOutTime),this.assignedLane,this.isLaneReserved,this.isPoolReserved)}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.creatorId===this.creatorId&&e.businessId===this.businessId&&e.reservationId===this.reservationId&&P(e.assignedKeys,this.assignedKeys)&&P(e.assignedBracelets,this.assignedBracelets)&&e.hasSlippers===this.hasSlippers&&e.hasSwimmingCap===this.hasSwimmingCap&&e.creationDate===this.creationDate&&e.checkInTime===this.checkInTime&&e.status===this.status&&d(e.reservation,this.reservation)&&e.checkOutTime===this.checkOutTime&&e.assignedLane===this.assignedLane&&e.isLaneReserved===this.isLaneReserved&&e.isPoolReserved===this.isPoolReserved}copyWithBusinessRef(e){return new n(this.uniqueId,this.creatorId,this.businessId,this.reservationId,Te(this.assignedKeys),Te(this.assignedBracelets),this.hasSlippers,this.hasSwimmingCap,g.cloneDate(this.creationDate),g.cloneDate(this.checkInTime),this.status,this.reservation.copyWithBusinessRef(e),g.cloneDateOrNull(this.checkOutTime),this.assignedLane,this.isLaneReserved,this.isPoolReserved)}}return n.TYPE_ID="5aafd6ef93bd498485abf4b27a2d9835",n.SCHEMA_VERSION=2,n})(),e0=class extends f{build(i,e){return gl.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(gl.SCHEMA_VERSION))return e;if(t.isGreaterThan(gl.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(r.setIfNullOrUndefined(e,"isLaneReserved",!1),r.setIfNullOrUndefined(e,"isPoolReserved",!1),s=2),e.$schema_version=D.encodedExactly(s),e}},ml=(()=>{class n extends tt{constructor(e,t,s,a,o,u,c,l){super(),this.uniqueId=e,this.creatorId=t,this.deviceId=s,this.creationDate=a,this.source=o,this.seen=u,this.checkInId=c,this.checkIn=l}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.getOrNull(t,"creatorId"),r.getOrNull(t,"deviceId"),e.decodeDate(r.get(t,"creationDate")),y(r.get(t,"source"),le),r.get(t,"seen"),r.get(t,"checkInId"),e.fromData(r.get(t,"checkIn")))}toMap(e){return{uniqueId:this.uniqueId,creatorId:this.creatorId,deviceId:this.deviceId,creationDate:e.encodeDate(this.creationDate),source:m(this.source),seen:this.seen,checkInId:this.checkInId,checkIn:e.toData(this.checkIn)}}clone(){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,this.seen,this.checkInId,this.checkIn.clone())}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.creatorId===this.creatorId&&e.deviceId===this.deviceId&&e.creationDate===this.creationDate&&e.source===this.source&&e.seen===this.seen&&e.checkInId===this.checkInId&&d(e.checkIn,this.checkIn)}markAsSeen(){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,!0,this.checkInId,this.checkIn.clone())}}return n.TYPE_ID="eca3b9fec3354759b7d7e8c73eaddc66",n.SCHEMA_VERSION=2,n})(),t0=class extends f{build(i,e){return ml.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(ml.SCHEMA_VERSION))return e;if(t.isGreaterThan(ml.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(s=2),e.$schema_version=D.encodedExactly(s),e}},nC=(()=>{class n extends b{constructor(e,t,s,a){super(),this.adultServicePrice=e,this.studentServicePrice=t,this.pensionerServicePrice=s,this.familyServicePrice=a}get $typeId(){return n.TYPE_ID}
3static fromMap(e,t){return new n(Y.decode(r.get(t,"adultServicePrice")),Y.decode(r.get(t,"studentServicePrice")),Y.decode(r.get(t,"pensionerServicePrice")),Y.decode(r.get(t,"familyServicePrice")))}toMap(e){return{adultServicePrice:this.adultServicePrice.encode(),studentServicePrice:this.studentServicePrice.encode(),pensionerServicePrice:this.pensionerServicePrice.encode(),familyServicePrice:this.familyServicePrice.encode()}}clone(){return new n(this.adultServicePrice.clone(),this.studentServicePrice.clone(),this.pensionerServicePrice.clone(),this.familyServicePrice.clone())}isSame(e){return this===e?!0:d(e.adultServicePrice,this.adultServicePrice)&&d(e.studentServicePrice,this.studentServicePrice)&&d(e.pensionerServicePrice,this.pensionerServicePrice)&&d(e.familyServicePrice,this.familyServicePrice)}}return n.TYPE_ID="81cd7cd91ba94a1189559669a6644c47",n})(),n0=class extends f{build(i,e){return nC.fromMap(i,e)}},Il=(()=>{class n extends tt{constructor(e,t,s,a,o,u,c,l){super(),this.uniqueId=e,this.creatorId=t,this.deviceId=s,this.creationDate=a,this.source=o,this.seen=u,this.reservation=c,this.reservationId=l}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.getOrNull(t,"creatorId"),r.getOrNull(t,"deviceId"),e.decodeDate(r.get(t,"creationDate")),y(r.get(t,"source"),le),r.get(t,"seen"),e.fromData(r.get(t,"reservation")),r.get(t,"reservationId"))}toMap(e){return{uniqueId:this.uniqueId,creatorId:this.creatorId,deviceId:this.deviceId,creationDate:e.encodeDate(this.creationDate),source:m(this.source),seen:this.seen,reservation:e.toData(this.reservation),reservationId:this.reservationId}}clone(){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,this.seen,this.reservation.clone(),this.reservationId)}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.creatorId===this.creatorId&&e.deviceId===this.deviceId&&e.creationDate===this.creationDate&&e.source===this.source&&e.seen===this.seen&&d(e.reservation,this.reservation)&&e.reservationId===this.reservationId}markAsSeen(){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,!0,this.reservation.clone(),this.reservationId)}}return n.TYPE_ID="4afb8c2bc35d460fbd883cbd9b42a59a",n.SCHEMA_VERSION=2,n})(),i0=class extends f{build(i,e){return Il.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(Il.SCHEMA_VERSION))return e;if(t.isGreaterThan(Il.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(s=2),e.$schema_version=D.encodedExactly(s),e}},Dl=(()=>{class n extends tt{constructor(e,t,s,a,o,u,c,l){super(),this.uniqueId=e,this.creatorId=t,this.deviceId=s,this.creationDate=a,this.source=o,this.seen=u,this.reservation=c,this.reservationId=l}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.getOrNull(t,"creatorId"),r.getOrNull(t,"deviceId"),e.decodeDate(r.get(t,"creationDate")),y(r.get(t,"source"),le),r.get(t,"seen"),e.fromData(r.get(t,"reservation")),r.get(t,"reservationId"))}toMap(e){return{uniqueId:this.uniqueId,creatorId:this.creatorId,deviceId:this.deviceId,creationDate:e.encodeDate(this.creationDate),source:m(this.source),seen:this.seen,reservation:e.toData(this.reservation),reservationId:this.reservationId}}clone(){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,this.seen,this.reservation.clone(),this.reservationId)}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.creatorId===this.creatorId&&e.deviceId===this.deviceId&&e.creationDate===this.creationDate&&e.source===this.source&&e.seen===this.seen&&d(e.reservation,this.reservation)}markAsSeen(){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,!0,this.reservation.clone(),this.reservationId)}}return n.TYPE_ID="c55910f4771f48578dac540c7f6a9ee9",n.SCHEMA_VERSION=2,n})(),s0=class extends f{build(i,e){return Dl.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(Dl.SCHEMA_VERSION))return e;if(t.isGreaterThan(Dl.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(s=2),e.$schema_version=D.encodedExactly(s),e}},r0=(function(n){return n.Pending="PENDING",n.Approved="APPROVED",n.InProgress="IN_PROGRESS",n.Finished="FINISHED",n.Canceled="CANCELED",n})(r0||{}),vl=(()=>{class n extends Hl{constructor(e,t,s,a,o,u,c,l,h,p,I,v,E,w,S,R,x,N,O,A,M){super(),this.uniqueId=e,this.creatorId=t,this.businessRef=s,this.dayOfYear=a,this.timeOfDay=o,this.timezone=u,this.creationDate=c,this.client=l,this.clientId=h,this.duration=p,this.status=I,this.service=v,this.serviceId=E,this.isOnlineReservation=w,this.assignedLane=S,this.isLaneReserved=R,this.isPoolReserved=x,this.contactDetails=N,this.hasBeenReviewed=O,this.cancelledDate=A,this.cancelledBy=M,this.dayId=a.uniqueId,this.monthId=gi.dayOfYearToUniqueId(a)}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(5,n.SCHEMA_VERSION)}get isOpen(){return this.status!==r0.Canceled}get isCanceled(){return this.status===r0.Canceled}get date(){return this.dayOfYear.toDate(g.ofRegion(this.timezone))}get time(){return this.dayOfYear.toDateAndTime(this.timeOfDay,g.ofRegion(this.timezone))}get isFinished(){return this.time.add(this.duration).isBefore(fe.now())}get isUpcoming(){return this.time.isAfter(fe.now())}get isInProgress(){let e=fe.now(),t=this.time,s=t.add(this.duration);return(e.isSame(t)||e.isAfter(t))&&e.isBefore(s)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.get(t,"creatorId"),j.mustDecode(r.get(t,"businessRef")),e.fromData(r.get(t,"dayOfYear")),e.fromData(r.get(t,"timeOfDay")),y(r.get(t,"timezone"),Ee),e.decodeDate(r.get(t,"creationDate")),e.fromData(r.get(t,"client")),r.get(t,"clientId"),e.decodeDuration(r.get(t,"duration")),r.get(t,"$status"),e.fromData(r.get(t,"service")),r.get(t,"serviceId"),r.get(t,"isOnlineReservation"),r.getOrNull(t,"assignedLane"),r.get(t,"isLaneReserved"),r.get(t,"isPoolReserved"),e.fromData(r.get(t,"contactDetails")),r.get(t,"hasBeenReviewed"),e.decodeDateOrNull(r.getOrNull(t,"cancelledDate")),r.getOrNull(t,"cancelledBy"))}toMap(e){return{uniqueId:this.uniqueId,creatorId:this.creatorId,businessRef:this.businessRef.encode(),dayId:this.dayId,dayOfYear:e.toData(this.dayOfYear),timeOfDay:e.toData(this.timeOfDay),duration:e.encodeDuration(this.duration),timezone:this.timezone,creationDate:e.encodeDate(this.creationDate),date:e.encodeDate(this.time),clientId:this.clientId,client:e.toData(this.client),$status:this.status,service:e.toData(this.service),serviceId:this.serviceId,isOnlineReservation:this.isOnlineReservation,assignedLane:this.assignedLane,isLaneReserved:this.isLaneReserved,isPoolReserved:this.isPoolReserved,contactDetails:e.toData(this.contactDetails),hasBeenReviewed:this.hasBeenReviewed,cancelledDate:e.encodeDateOrNull(this.cancelledDate),
3cancelledBy:this.cancelledBy}}clone(){return new n(this.uniqueId,this.creatorId,this.businessRef.clone(),this.dayOfYear.clone(),this.timeOfDay.clone(),this.timezone,g.cloneDate(this.creationDate),this.client.clone(),this.clientId,g.cloneDuration(this.duration),this.status,this.service.clone(),this.serviceId,this.isOnlineReservation,this.assignedLane,this.isLaneReserved,this.isPoolReserved,this.contactDetails,this.hasBeenReviewed,g.cloneDateOrNull(this.cancelledDate),this.cancelledBy)}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.creatorId===this.creatorId&&e.cancelledDate===this.cancelledDate&&e.cancelledBy===this.cancelledBy&&d(e.businessRef,this.businessRef)&&d(e.dayOfYear,this.dayOfYear)&&d(e.timeOfDay,this.timeOfDay)&&e.timezone===this.timezone&&e.creationDate===this.creationDate&&d(e.client,this.client)&&e.clientId===this.clientId&&e.duration===this.duration&&e.status===this.status&&d(e.service,this.service)&&e.serviceId===this.serviceId&&e.isOnlineReservation===this.isOnlineReservation&&e.assignedLane===this.assignedLane&&e.isLaneReserved===this.isLaneReserved&&e.isPoolReserved===this.isPoolReserved&&d(e.contactDetails,this.contactDetails)&&e.hasBeenReviewed===this.hasBeenReviewed}copyWithBusinessRef(e){return new n(this.uniqueId,this.creatorId,e.clone(),this.dayOfYear.clone(),this.timeOfDay.clone(),this.timezone,g.cloneDate(this.creationDate),this.client.copyWithBusinessRef(e),this.clientId,g.cloneDuration(this.duration),this.status,this.service.copyWithBusinessRef(e),this.serviceId,this.isOnlineReservation,this.assignedLane,this.isLaneReserved,this.isPoolReserved,this.contactDetails,this.hasBeenReviewed,g.cloneDateOrNull(this.cancelledDate),this.cancelledBy)}}return n.TYPE_ID="6bb99d8a63d54625b3b759dcadf3db68",n.SCHEMA_VERSION=6,n})(),a0=class extends f{build(i,e){return vl.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(vl.SCHEMA_VERSION))return e;if(t.isGreaterThan(vl.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(r.setIfNullOrUndefined(e,"isLaneReserved",!1),r.setIfNullOrUndefined(e,"isPoolReserved",!1),s=2),s<3&&(r.setIfNullOrUndefined(e,"contactDetails",i.toData(this.getDefaultPoolContactDetails())),s=3),s<4&&(r.setIfNullOrUndefined(e,"hasBeenReviewed",!1),s=4),s<5&&(r.setIfNullOrUndefined(e,"businessRef",r.get(e,"businessId")),s=5),s<6&&(s=6),e.$schema_version=D.encodedExactly(s),e}getDefaultPoolContactDetails(){return Ka.create({names:Oe.forLanguage($.Hungarian,"Gyergy\xF3szentmikl\xF3si Uszoda"),country:Ie.Romania,language:$.Romanian,timezone:Ee.EuropeBucharest,phoneNumber:ft.mustDecode("(+40)748689565"),address:zd.create({country:"RO",administrativeAreaLevel1:new kr("ro_hr","Harghita"),locality:new kr("ro_hr_gheorgheni","Gheorgheni"),formattedAddress:"Makkos utca 19/A"}),coordinates:new LS(46.7274799,25.5904378),webRoute:null,dateSpan:null})}},o0=(function(n){return n.None="None",n.Link="Link",n.Text="Text",n})(o0||{}),u0=(function(n){return n.None="None",n.Age16="Age16",n.Age18="Age18",n})(u0||{}),iC=(()=>{class n extends b{constructor(e,t,s,a,o,u,c,l,h){super(),this.termsUrl=e,this.privacyPolicyUrl=t,this.cookiePolicyUrl=s,this.marketingConsentEnabled=a,this.marketingConsentText=o,this.houseRulesType=u,this.houseRulesUrl=c,this.ageRestriction=l,this.parentalConsent=h}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.termsUrl,e.privacyPolicyUrl,e.cookiePolicyUrl,e.marketingConsentEnabled,e.marketingConsentText,e.houseRulesType,e.houseRulesUrl,e.ageRestriction,e.parentalConsent)}static empty(){return n.create({marketingConsentEnabled:!1,houseRulesType:o0.None,ageRestriction:u0.None})}static emptyWithEventOverrides(){return{settings:n.empty()}}static fromMap(e,t){var s,a,o,u,c,l,h;let p=r.getStringOrNull(t,"houseRulesType"),I=r.getStringOrNull(t,"ageRestriction");return n.create({termsUrl:(s=r.getStringOrNull(t,"termsUrl"))!==null&&s!==void 0?s:void 0,privacyPolicyUrl:(a=r.getStringOrNull(t,"privacyPolicyUrl"))!==null&&a!==void 0?a:void 0,cookiePolicyUrl:(o=r.getStringOrNull(t,"cookiePolicyUrl"))!==null&&o!==void 0?o:void 0,marketingConsentEnabled:(u
3=r.getBooleanOrNull(t,"marketingConsentEnabled"))!==null&&u!==void 0?u:void 0,marketingConsentText:(c=r.getStringOrNull(t,"marketingConsentText"))!==null&&c!==void 0?c:void 0,houseRulesType:_(p)?y(p,o0):void 0,houseRulesUrl:(l=r.getStringOrNull(t,"houseRulesUrl"))!==null&&l!==void 0?l:void 0,ageRestriction:_(I)?y(I,u0):void 0,parentalConsent:(h=r.getStringOrNull(t,"parentalConsent"))!==null&&h!==void 0?h:void 0})}toMap(e){let t={};return r.setOptional(t,"termsUrl",this.termsUrl),r.setOptional(t,"privacyPolicyUrl",this.privacyPolicyUrl),r.setOptional(t,"cookiePolicyUrl",this.cookiePolicyUrl),r.setOptional(t,"marketingConsentEnabled",this.marketingConsentEnabled),r.setOptional(t,"marketingConsentText",this.marketingConsentText),_(this.houseRulesType)&&(t.houseRulesType=m(this.houseRulesType)),r.setOptional(t,"houseRulesUrl",this.houseRulesUrl),_(this.ageRestriction)&&(t.ageRestriction=m(this.ageRestriction)),r.setOptional(t,"parentalConsent",this.parentalConsent),t}clone(){return this.copyWith()}copyWith({termsUrl:e=this.termsUrl,privacyPolicyUrl:t=this.privacyPolicyUrl,cookiePolicyUrl:s=this.cookiePolicyUrl,marketingConsentEnabled:a=this.marketingConsentEnabled,marketingConsentText:o=this.marketingConsentText,houseRulesType:u=this.houseRulesType,houseRulesUrl:c=this.houseRulesUrl,ageRestriction:l=this.ageRestriction,parentalConsent:h=this.parentalConsent}={}){return n.create({termsUrl:e,privacyPolicyUrl:t,cookiePolicyUrl:s,marketingConsentEnabled:a,marketingConsentText:o,houseRulesType:u,houseRulesUrl:c,ageRestriction:l,parentalConsent:h})}isSame(e){return e===this?!0:e.termsUrl===this.termsUrl&&e.privacyPolicyUrl===this.privacyPolicyUrl&&e.cookiePolicyUrl===this.cookiePolicyUrl&&e.marketingConsentEnabled===this.marketingConsentEnabled&&e.marketingConsentText===this.marketingConsentText&&e.houseRulesType===this.houseRulesType&&e.houseRulesUrl===this.houseRulesUrl&&e.ageRestriction===this.ageRestriction&&e.parentalConsent===this.parentalConsent}}return n.TYPE_ID="b0afd46137124f50b2eb0fccceba0444",n})(),c0=class extends f{build(i,e){return iC.fromMap(i,e)}},l0=(function(n){return n.PassSticker="PassSticker",n.NarrowPass="NarrowPass",n})(l0||{}),gs=(function(n){return n.A4="A4",n.Boca6x11="Boca6x11",n.Boca6x11Reverse="Boca6x11Reverse",n.Boca152x51="Boca152x51",n.Boca152x51Reverse="Boca152x51Reverse",n})(gs||{}),sC=(()=>{class n extends b{constructor(e,t,s,a){super(),this.automaticTicketPrinting=e,this.automaticPassPrinting=t,this.ticketFormat=s,this.passFormat=a}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.automaticTicketPrinting,e.automaticPassPrinting,e.ticketFormat,e.passFormat)}static empty(){return n.create({automaticTicketPrinting:!1,automaticPassPrinting:!1,ticketFormat:gs.A4,passFormat:l0.PassSticker})}static fromMap(e,t){return n.create({automaticTicketPrinting:r.getBoolean(t,"ticketAutomaticPrinting"),automaticPassPrinting:r.getBoolean(t,"passAutomaticPrinting"),ticketFormat:y(r.getString(t,"ticketFormat"),gs),passFormat:y(r.getString(t,"passFormat"),l0)})}toMap(e){return{ticketAutomaticPrinting:this.automaticTicketPrinting,passAutomaticPrinting:this.automaticPassPrinting,ticketFormat:m(this.ticketFormat),passFormat:m(this.passFormat)}}clone(){return this.copyWith()}copyWith({automaticTicketPrinting:e=this.automaticTicketPrinting,automaticPassPrinting:t=this.automaticPassPrinting,ticketFormat:s=this.ticketFormat,passFormat:a=this.passFormat}={}){return n.create({automaticTicketPrinting:e,automaticPassPrinting:t,ticketFormat:s,passFormat:a})}isSame(e){return e===this?!0:e.automaticTicketPrinting===this.automaticTicketPrinting&&e.automaticPassPrinting===this.automaticPassPrinting&&e.ticketFormat===this.ticketFormat&&e.passFormat===this.passFormat}}return n.TYPE_ID="c06da7fd00eb4dd6b47e0a884df3a940",n})(),d0=class extends f{build(i,e){return sC.fromMap(i,e)}};var yl=(()=>{class n extends b{constructor(e,t,s){super(),this.businessRef=e,this.elementId=t,this.name=s,this.refId=`${this.businessRef.encoded}:${this.elementId}`}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(j.mustDecode(r.get(t,"businessRef")),r.get(t,"elementId"),r.get(t,"name"))}toMap(e){return{businessRef:this.businessRef.encode(),elementId:this.elementId,name:this.name}}clone(){return new n(this.businessRef.clone(),this.elementId,this.name)}isSame(e){return this===e?!0:d(e.businessRef,this.businessRef)&&e.elementId===this.elementId&&e.name===this.name}copyWithBusinessRef(e){return new n(e.clone(),this.elementId,this.name)}}return n.TYPE_ID="b914c85a97924007a9d9561ef0318497",n.SCHEMA_VERSION=2,n})(),h0=class extends f{build(i,e){return yl.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);
3if(t.contains(yl.SCHEMA_VERSION))return e;if(t.isGreaterThan(yl.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(r.setIfNullOrUndefined(e,"businessRef",r.get(e,"businessId")),s=2),e.$schema_version=D.encodedExactly(s),e}},rC=(function(n){return n.Live="LIVE",n.Archived="ARCHIVED",n})(rC||{}),bl=(()=>{class n extends b{constructor(e,t,s,a,o,u){super(),this.uniqueId=e,this.businessRef=t,this.name=s,this.status=a,this.webRoute=o,this.components=u}get $schemaVersion(){return D.between(2,n.SCHEMA_VERSION)}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.get(t,"uniqueId"),j.mustDecode(r.get(t,"businessRef")),r.get(t,"name"),y(r.get(t,"$status"),rC),r.getOrNull(t,"webRoute"),ae.deserialize(e,r.get(t,"components")))}toMap(e){return{uniqueId:this.uniqueId,businessRef:this.businessRef.encode(),name:this.name,$status:this.status,webRoute:this.webRoute,components:this.components.serialize(e)}}clone(){return new n(this.uniqueId,this.businessRef.clone(),this.name,this.status,this.webRoute,this.components.clone())}isSame(e){return this===e?!0:e.uniqueId===this.uniqueId&&d(e.businessRef,this.businessRef)&&e.name===this.name&&e.status===this.status&&e.webRoute===this.webRoute&&d(e.components,this.components)}copyWithBusinessRef(e){return new n(this.uniqueId,e.clone(),this.name,this.status,this.webRoute,this.components.copyWithBusinessRef(e))}static encodedStatusSafe(e){return m(e)}hasComponentByTypeId(e){return this.components.hasComponentByTypeId(e)}mustFindComponentByTypeId(e){return this.components.mustFindComponentByTypeId(e)}findComponentByTypeId(e){return this.components.findComponentByTypeId(e)}findComponentByInstanceId(e){return this.components.findComponentByInstanceId(e)}findComponentsByTypeId(e){return this.components.findComponentsByTypeId(e)}addComponent(e){this.components.addComponent(e)}addComponents(e){this.components.addComponents(e)}removeComponentByTypeId(e){return this.components.removeComponentByTypeId(e)}removeComponentByInstanceId(e){return this.components.removeComponentByInstanceId(e)}removeComponentAt(e){this.components.removeComponentAt(e)}removeAllComponents(){this.components.removeAllComponents()}popAllComponentsByTypeId(e){return this.components.popAllComponentsByTypeId(e)}popComponentByTypeId(e){return this.components.popComponentByTypeId(e)}popComponent(e){return this.components.popComponent(e)}replaceComponent(e){return this.components.replaceComponent(e)}addOrReplaceComponent(e){this.components.addOrReplaceComponent(e)}mustFindComponentField(e,t){return this.components.mustFindComponentField(e,t)}findComponentField(e,t){return this.components.findComponentField(e,t)}}return n.TYPE_ID="0c418ade165b4ac2a8f4ce857795fbfd",n.SCHEMA_VERSION=3,n})(),f0=class extends f{build(i,e){return bl.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(bl.SCHEMA_VERSION))return e;if(t.isGreaterThan(bl.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(r.setIfNullOrUndefined(e,"businessRef",r.get(e,"businessId")),s=2),s<3&&(e.webRoute=null,s=3),e.$schema_version=D.encodedExactly(s),e}},aC=(()=>{class n extends b{constructor(e,t,s){super(),this.webRoute=e,this.names=t,this.photos=s}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.get(t,"webRoute"),e.fromData(r.get(t,"names")),e.fromData(r.get(t,"photos")))}toMap(e){return{webRoute:this.webRoute,names:e.toData(this.names),photos:e.toData(this.photos)}}clone(){return new n(this.webRoute,this.names.clone(),this.photos.clone())}isSame(e){return e===this?!0:e.webRoute===this.webRoute&&d(e.names,this.names)&&d(e.photos,this.photos)}}return n.TYPE_ID="3b2e1fb49a104402b96e97fbd6f6f2e1",n})(),p0=class extends f{build(i,e){return aC.fromMap(i,e)}},oC=(()=>{class n extends b{constructor(e,t){super(),this.soldTickets=e,this.incomePerTicket=t}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.getMap(t,"soldTickets",(s,a)=>({key:s,value:Number(a)})),r.getMap(t,"incomePerTicket",(s,a)=>({key:s,value:Y.decode(String(a))})))}toMap(e){return{soldTickets:se(this.soldTickets,(t,s)=>({key:t,value:s})),incomePerTicket:se(this.incomePerTicket,(t,s)=>({key:t,value:s.encode()}))}}
3clone(){return new n(ee(this.soldTickets,e=>e),ee(this.incomePerTicket,e=>e.clone()))}isSame(e){return this===e?!0:re(e.soldTickets,this.soldTickets,(t,s)=>t===s)&&re(e.incomePerTicket,this.incomePerTicket,(t,s)=>d(t,s))}}return n.TYPE_ID="637a0fbb7f3949c68f575a32706edfed",n})(),g0=class extends f{build(i,e){return oC.fromMap(i,e)}},uC=(()=>{class n extends b{constructor(e,t,s,a){super(),this.eventId=e,this.creatorId=t,this.creationDate=s,this.businessRef=a}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.get(t,"eventId"),r.get(t,"creatorId"),e.decodeDate(r.get(t,"creationDate")),j.mustDecode(r.get(t,"businessRef")))}toMap(e){return{eventId:this.eventId,creatorId:this.creatorId,creationDate:e.encodeDate(this.creationDate),businessRef:this.businessRef.encode()}}clone(){return new n(this.eventId,this.creatorId,this.creationDate,this.businessRef.clone())}isSame(e){return this===e?!0:e.eventId===this.eventId&&e.creatorId===this.creatorId&&e.creationDate===this.creationDate&&e.businessRef===this.businessRef}}return n.TYPE_ID="e061da24351246efaa161f5452094f9b",n})(),m0=class extends f{build(i,e){return uC.fromMap(i,e)}},El=(()=>{class n extends Oo{constructor(e,t,s,a,o,u,c,l,h,p,I,v){super(),this.uniqueId=e,this.businessRef=t,this.firstName=s,this.lastName=a,this.phoneNumber=o,this.photo=u,this.userId=c,this.pushNotificationToken=l,this.email=h,this.status=p,this.partnerRole=I,this.components=v,this.formattedName=fi(s,a),this.initials=pi(s,a)}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static create(e){return new n(e.uniqueId,e.businessRef,e.firstName,e.lastName,e.phoneNumber,e.photo,e.userId,e.pushNotificationToken,e.email,e.status,e.partnerRole,e.components)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),j.mustDecode(r.get(t,"businessRef")),r.get(t,"firstName"),r.get(t,"lastName"),ft.mustDecode(r.get(t,"phoneNumber")),e.fromDataOrNull(r.getOrNull(t,"photo")),r.getOrNull(t,"userId"),r.getOrNull(t,"pushNotificationToken"),r.getOrNull(t,"email"),y(r.get(t,"$status"),Ai),_n(r.get(t,"partnerRole"),Qt),ae.deserialize(e,r.getRaw(t,"components")))}toMap(e){return{uniqueId:this.uniqueId,businessRef:this.businessRef.encode(),firstName:this.firstName,lastName:this.lastName,phoneNumber:this.phoneNumber.encode(),photo:e.toDataOrNull(this.photo),userId:this.userId,pushNotificationToken:this.pushNotificationToken,email:this.email,$status:m(this.status),partnerRole:xn(this.partnerRole),components:this.components.serialize(e)}}clone(){return this.copyWith()}copyWith({uniqueId:e=this.uniqueId,businessRef:t=F(this.businessRef),firstName:s=this.firstName,lastName:a=this.lastName,phoneNumber:o=F(this.phoneNumber),photo:u=Z(this.photo),userId:c=this.userId,pushNotificationToken:l=this.pushNotificationToken,email:h=this.email,status:p=this.status,partnerRole:I=this.partnerRole,components:v=F(this.components)}={}){return new n(e,t,s,a,o,u,c,l,h,p,I,v)}isSame(e){return this===e?!0:e.uniqueId===this.uniqueId&&e.businessRef===this.businessRef&&e.firstName===this.firstName&&e.lastName===this.lastName&&d(e.phoneNumber,this.phoneNumber)&&d(e.photo,this.photo)&&e.userId===this.userId&&e.pushNotificationToken===this.pushNotificationToken&&e.email===this.email&&e.status===this.status&&e.partnerRole===this.partnerRole&&e.components.isSame(this.components)}}return n.TYPE_ID="5f79aded1fc84665af3bae02b31d06f3",n.SCHEMA_VERSION=3,n})(),I0=class extends f{build(i,e){return El.fromMap(i,e)}optimizeForQuery(i,e){return{formattedName:e.formattedName}}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(El.SCHEMA_VERSION))return e;if(t.isGreaterThan(El.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(s=2),s<3&&(s=3,e.partnerRole=xn(Qt.Collaborator)),e.$schema_version=D.encodedExactly(s),e}},cC=(()=>{class n extends b{constructor(e){super(),this.eventStats=e}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.getMap(t,"eventStats",(s,a)=>({key:s,value:e.fromData(a)})))}toMap(e){return{eventStats:se(this.eventStats,(t,s)=>({key:t,value:e.toData(s)}))}}
3clone(){return new n(ee(this.eventStats,e=>e.clone()))}isSame(e){return this===e?!0:re(e.eventStats,this.eventStats,(t,s)=>d(t,s))}}return n.TYPE_ID="fa367abd0e9f48c589c2511ce45031b4",n})(),D0=class extends f{build(i,e){return cC.fromMap(i,e)}};var lC=(()=>{class n extends b{constructor(e,t,s){super(),this.businessRef=e,this.businessCategory=t,this.url=s}get $typeId(){return n.TYPE_ID}get isEmpty(){return!(_(this.businessRef)||_(this.businessCategory)||_(this.url))}static fromMap(e,t){return new n(j.decode(r.getOrNull(t,"businessRef")),y(r.getOrNull(t,"businessCategory"),Fn),r.getOrNull(t,"url"))}toMap(e){var t,s,a,o;return{businessRef:(s=(t=this.businessRef)===null||t===void 0?void 0:t.encode())!==null&&s!==void 0?s:null,businessCategory:(a=Se(this.businessCategory))!==null&&a!==void 0?a:null,url:(o=this.url)!==null&&o!==void 0?o:null}}clone(){var e,t,s,a;return new n((t=(e=this.businessRef)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null,(s=this.businessCategory)!==null&&s!==void 0?s:null,(a=this.url)!==null&&a!==void 0?a:null)}isSame(e){return e===this?!0:d(e.businessRef,this.businessRef)&&e.businessCategory===this.businessCategory&&e.url===this.url}}return n.TYPE_ID="62641c8c76bd4e84a02558fe205eabc5",n})(),v0=class extends f{build(i,e){return lC.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){return this.migrateEnumOrNull(e,"businessCategory",Fn,Fn.Other),e}},dC=(()=>{class n extends b{constructor(e,t,s,a,o,u,c,l,h){super(),this.uniqueId=e,this.name=t,this.provider=s,this.downloadUrl=a,this.isCancelled=o,this.isElectronic=u,this.emailAddresses=c,this.creationDate=l,this.cancellationDate=h}get $typeId(){return n.TYPE_ID}static create(e){if(e.isCancelled){if(k(e.cancellationDate))return W.error(new Error("Cancellation date MUST be provided for cancelled receipts."))}else if(_(e.cancellationDate))return W.error(new Error("Cancellation date MUST NOT be provided for live receipts."));if(e.isElectronic){if(e.emailAddresses.length<=0)return W.error(new Error("At least one email address MUST be provided for electronic receipts."))}else if(e.emailAddresses.length>0)return W.error(new Error("Email addresses MUST NOT be provided for physical receipts."));return W.ok(new n(e.uniqueId,e.name,e.provider,e.downloadUrl,e.isCancelled,e.isElectronic,e.emailAddresses,e.creationDate,e.cancellationDate))}static electronic(e){return n.create({uniqueId:e.uniqueId,name:e.name,provider:e.provider,downloadUrl:e.downloadUrl,isCancelled:!1,isElectronic:!0,emailAddresses:e.emailAddresses,creationDate:e.creationDate,cancellationDate:null})}static physical(e){return n.create({uniqueId:e.uniqueId,name:e.name,provider:e.provider,downloadUrl:e.downloadUrl,isCancelled:!1,isElectronic:!1,emailAddresses:[],creationDate:e.creationDate,cancellationDate:null})}static fromMap(e,t){return n.create({uniqueId:r.getString(t,"uniqueId"),name:r.getString(t,"name"),provider:y(r.getString(t,"provider"),qn),downloadUrl:r.getString(t,"downloadUrl"),isCancelled:r.getBoolean(t,"isCancelled"),isElectronic:r.getBoolean(t,"isElectronic"),emailAddresses:r.getList(t,"emailAddresses",s=>K.decodeString(s)),creationDate:e.decodeDate(r.getNumber(t,"creationDate")),cancellationDate:e.decodeDateOrNull(r.getNumberOrNull(t,"cancellationDate"))}).unwrap()}toMap(e){return{uniqueId:this.uniqueId,name:this.name,provider:m(this.provider),downloadUrl:this.downloadUrl,isCancelled:this.isCancelled,isElectronic:this.isElectronic,emailAddresses:this.emailAddresses.map(t=>t),creationDate:e.encodeDate(this.creationDate),cancellationDate:e.encodeDateOrNull(this.cancellationDate)}}clone(){return n.create({uniqueId:this.uniqueId,name:this.name,provider:this.provider,downloadUrl:this.downloadUrl,isCancelled:this.isCancelled,isElectronic:this.isElectronic,emailAddresses:this.emailAddresses.map(e=>e),creationDate:g.cloneDate(this.creationDate),cancellationDate:g.cloneDateOrNull(this.cancellationDate)}).unwrap()}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.name===this.name&&e.provider===this.provider&&e.downloadUrl===this.downloadUrl&&e.isCancelled===this.isCancelled&&e.isElectronic===this.isElectronic&&P(e.emailAddresses,this.emailAddresses)&&e.creationDate===this.creationDate&&e.cancellationDate===this.cancellationDate}copyWith(e){return n.create({uniqueId:e.uniqueId.getOrElse(this.uniqueId),name:e.name.getOrElse(this.name),provider:e.provider.getOrElse(this.provider),downloadUrl:e.downloadUrl.getOrElse(this.downloadUrl),isCancelled:e.isCancelled.getOrElse(this.isCancelled),isElectronic:e.isElectronic.getOrElse(this.isElectronic),emailAddresses:e.emailAddresses.getOrElse(this.emailAddresses),creationDate:e.creationDate.getOrElse(g.cloneDate(this.creationDate)),cancellationDate:e.cancellationDate.getOrElse(g.cloneDateOrNull(this.cancellationDate))})}copyAsCancelledOrClone(e){return this.isCancelled?this.clone():this.copyWith({isCancelled:it.some(!0),cancellationDate:it.some(e),creationDate:it.none(),downloadUrl:it.none(),emailAddresses:it.none(),isElectronic:it.none(),name:it.none(),provider:it.none(),uniqueId:it.none()}).unwrap()}}return n.TYPE_ID="25145629ce98439a803b3350cdd66414",n})(),y0=class extends f{build(i,e){return dC.fromMap(i,e)}},wl=(()=>{class n extends tt{constructor(e,t,s,a,o,u,c,l){super(),this.uniqueId=e,this.creatorId=t,this.deviceId=s,this.creationDate=a,this.source=o,this.seen=u,this.before=c,this.after=l}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.getOrNull(t,"creatorId"),r.getOrNull(t,"deviceId"),e.decodeDate(r.get(t,"creationDate")),y(r.get(t,"source"),le),r.get(t,"seen"),e.fromData(r.get(t,"before")),e.fromData(r.get(t,"after")))}toMap(e){return{uniqueId:this.uniqueId,creatorId:this.creatorId,deviceId:this.deviceId,creationDate:e.encodeDate(this.creationDate),source:m(this.source),seen:this.seen,before:e.toData(this.before),after:e.toData(this.after)}}clone(){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,this.seen,this.before.clone(),this.after.clone())}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.creatorId===this.creatorId&&e.deviceId===this.deviceId&&e.creationDate===this.creationDate&&e.source===this.source&&e.seen===this.seen&&d(e.before,this.before)&&d(e.after,this.after)}markAsSeen(){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,!0,this.before.clone(),this.after.clone())}}return n.TYPE_ID="54e38df631dc4f8fb0f457b2cb5b8a0b",n.SCHEMA_VERSION=2,n})(),b0=class extends f{build(i,e){return wl.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(wl.SCHEMA_VERSION))return e;if(t.isGreaterThan(wl.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(s=2),e.$schema_version=D.encodedExactly(s),e}},Sl=(()=>{class n extends tt{constructor(e,t,s,a,o,u,c,l,h){super(),this.uniqueId=e,this.creatorId=t,this.deviceId=s,this.creationDate=a,this.source=o,this.seen=u,this.before=c,this.after=l,this.userId=h}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.getOrNull(t,"creatorId"),r.getOrNull(t,"deviceId"),e.decodeDate(r.get(t,"creationDate")),y(r.get(t,"source"),le),r.get(t,"seen"),e.fromData(r.get(t,"before")),e.fromData(r.get(t,"after")),r.get(t,"userId"))}toMap(e){return{uniqueId:this.uniqueId,creatorId:this.creatorId,deviceId:this.deviceId,creationDate:e.encodeDate(this.creationDate),source:m(this.source),seen:this.seen,before:e.toData(this.before),after:e.toData(this.after),userId:this.userId}}clone(){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,this.seen,this.before.clone(),this.after.clone(),this.userId)}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.creatorId===this.creatorId&&e.deviceId===this.deviceId&&e.creationDate===this.creationDate&&e.source===this.source&&e.seen===this.seen&&d(e.before,this.before)&&d(e.after,this.after)&&e.uniqueId===this.uniqueId}markAsSeen(){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,!0,this.before.clone(),this.after.clone(),this.userId)}copyWithBusinessRef(e){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,!0,this.before.copyWithBusinessRef(e),this.after.copyWithBusinessRef(e),this.userId)}}return n.TYPE_ID="e0c21002ab624c17b6a4fdbdbcfd13a5",n.SCHEMA_VERSION=2,n})(),E0=class extends f{build(i,e){return Sl.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(Sl.SCHEMA_VERSION))return e;if(t.isGreaterThan(Sl.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(s=2),e.$schema_version=D.encodedExactly(s),e}};var hC=(()=>{class n extends b{constructor(e,t){super(),this.totalScore=e,this.numberOfRatings=t}get $typeId(){return n.TYPE_ID}get averageRating(){return this.numberOfRatings>0?this.totalScore/this.numberOfRatings:0}static none(){return new n(0,0)}add(e){return new n(this.totalScore+e,this.numberOfRatings+1)}static fromMap(e,t){return new n(r.get(t,"totalScore"),r.get(t,"numberOfRatings"))}toMap(e){return{totalScore:this.totalScore,numberOfRatings:this.numberOfRatings}}clone(){return new n(this.totalScore,this.numberOfRatings)}isSame(e){return e===this?!0:e.totalScore===this.totalScore&&e.numberOfRatings===this.numberOfRatings}}return n.TYPE_ID="4d37507426074736921d552a85c871fc",n})(),w0=class extends f{build(i,e){return hC.fromMap(i,e)}},fC=(()=>{class n extends b{constructor(e,t,s){super(),this.uniqueId=e,this.name=t,this.times=s}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.get(t,"name"),r.getList(t,"times",s=>e.fromData(s)))}toMap(e){return{uniqueId:this.uniqueId,name:this.name,times:this.times.map(t=>e.toData(t))}}clone(){return new n(this.uniqueId,this.name,this.times.map(e=>e.clone()))}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.name===this.name&&P(e.times,this.times,(t,s)=>d(t,s))}}return n.TYPE_ID="aa7c1283f8264868a10fa056ce5cf03a",n})(),S0=class extends f{build(i,e){return fC.fromMap(i,e)}},zS=(()=>{class n extends b{constructor(e,t){super(),this.from=e,this.to=t}get durationInMinutes(){return this.to.inMinutes-this.from.inMinutes}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(e.fromData(r.getRaw(t,"from")),e.fromData(r.getRaw(t,"to")))}toMap(e){return{from:e.toData(this.from),to:e.toData(this.to)}}clone(){return new n(this.from.clone(),this.to.clone())}isSame(e){return e===this?!0:d(e.from,this.from)&&d(e.to,this.to)}}return n.TYPE_ID="118d779862b740d8b752515417be7991",n})(),T0=class extends f{build(i,e){return zS.fromMap(i,e)}},cr=class{static serialize(i){return new O0(i).pack()}static deserialize(i){return new R0(i).unpack()}},O0=class{constructor(i){this.searchSnapshot=i,this.packer=new Ul}pack(){this.packer.packByte(this.searchSnapshot.$version.asNumber()),this.packer.packLength(this.searchSnapshot.length.asNumber());for(let i of this.searchSnapshot.elements)this.packElement(i);return this.packer.takeBytes()}packElement(i){var e;let t=i.$typeId;switch(this.packer.packByte(t.asNumber()),!0){case i instanceof xi:this.packKeywordList(i);break;case i instanceof Fi:this.packEventList(i);break;case i instanceof Lr:this.packArtistList(i);break;case i instanceof Vr:this.packBrandList(i);break;case i instanceof zr:this.packOrganizerList(i);break;default:throw new Error(`Unsupported snapshot element type {${(e=i.constructor.name)!==null&&e!==void 0?e:typeof i}}.`)}}packKeywordList(i){this.packer.packByte(i.listId.asNumber()),this.packer.packLength(i.length.asNumber());for(let e of i.keywords)this.packer.packString(e.asString())}packEventList(i){this.packer.packLength(i.length.asNumber());for(let e of i.events)this.packEvent(e)}packEvent(i){this.packer.packString(i.uniqueId.asString()),this.packer.packLength(i.length.asNumber());for(let e of i.keywords)this.packKeywordRef(e)}packArtistList(i){this.packer.packLength(i.length.asNumber());for(let e of i.artists)this.packArtist(e)}packArtist(i){this.packer.packString(i.uniqueId.asString()),this.packer.packLength(i.length.asNumber());for(let e of i.keywords)this.packKeywordRef(e)}packBrandList(i){this.packer.packLength(i.length.asNumber());for(let e of i.brands)this.packBrand(e)}packBrand(i){this.packer.packString(i.uniqueId.asString()),this.packer.packLength(i.length.asNumber());for(let e of i.keywords)this.packKeywordRef(e)}packOrganizerList(i){this.packer.packLength(i.length.asNumber());for(let e of i.organizers)this.packOrganizer(e)}packOrganizer(i){this.packer.packString(i.uniqueId.asString()),this.packer.packLength(i.length.asNumber());for(let e of i.keywords)this.packKeywordRef(e)}packKeywordRef(i){this.packer.packByte(i.listId.asNumber()),this.packer.packInt(i.index.asNumber())}},R0=class{constructor(i){this.unpacker=Bl.fromBytes(i)}unpack(){let i=ht.make(this.unpacker.unpackByte());if(!0===(i.asNumber()===1))return this.unpackV1();throw new Error(`Unsupported search snapshot version {${i.asNumber()}}.`)}unpackV1(){let i=Je.make(this.unpacker.unpackLength()),e=new Array(i.asNumber());for(let t=0;t<i.asNumber();t++)e[t]=this.unpackElement();return Ns.create({elements:e})}unpackElement(){let i=ht.make(this.unpacker.unpackByte());switch(!0){case i.asNumber()===xi.TYPE_ID.asNumber():return this.unpackKeywordList();case i.asNumber()===Fi.TYPE_ID.asNumber():return this.unpackEventList();case i.asNumber()===Lr.TYPE_ID.asNumber():return this.unpackArtistList(
3);case i.asNumber()===Vr.TYPE_ID.asNumber():return this.unpackBrandList();case i.asNumber()===zr.TYPE_ID.asNumber():return this.unpackOrganizerList();default:throw new Error(`Unsupported snapshot element type {${i.asNumber()}}.`)}}unpackKeywordList(){let i=ht.make(this.unpacker.unpackByte()),e=Je.make(this.unpacker.unpackLength()),t=new Array(e.asNumber());for(let s=0;s<e.asNumber();s++)t[s]=Zl.make(this.unpacker.unpackString());return xi.create({listId:i,keywords:t})}unpackEventList(){let i=Je.make(this.unpacker.unpackLength()),e=new Array(i.asNumber());for(let t=0;t<i.asNumber();t++)e[t]=this.unpackEvent();return Fi.create({events:e})}unpackEvent(){let i=Nn.make(this.unpacker.unpackString()),e=Je.make(this.unpacker.unpackLength()),t=new Array(e.asNumber());for(let s=0;s<e.asNumber();s++)t[s]=this.unpackKeywordRef();return Sd.create({uniqueId:i,keywords:t})}unpackArtistList(){let i=Je.make(this.unpacker.unpackLength()),e=new Array(i.asNumber());for(let t=0;t<i.asNumber();t++)e[t]=this.unpackArtist();return Lr.create({artists:e})}unpackArtist(){let i=Nn.make(this.unpacker.unpackString()),e=Je.make(this.unpacker.unpackLength()),t=new Array(e.asNumber());for(let s=0;s<e.asNumber();s++)t[s]=this.unpackKeywordRef();return Td.create({uniqueId:i,keywords:t})}unpackBrandList(){let i=Je.make(this.unpacker.unpackLength()),e=new Array(i.asNumber());for(let t=0;t<i.asNumber();t++)e[t]=this.unpackBrand();return Vr.create({brands:e})}unpackBrand(){let i=Nn.make(this.unpacker.unpackString()),e=Je.make(this.unpacker.unpackLength()),t=new Array(e.asNumber());for(let s=0;s<e.asNumber();s++)t[s]=this.unpackKeywordRef();return Od.create({uniqueId:i,keywords:t})}unpackOrganizerList(){let i=Je.make(this.unpacker.unpackLength()),e=new Array(i.asNumber());for(let t=0;t<i.asNumber();t++)e[t]=this.unpackOrganizer();return zr.create({organizers:e})}unpackOrganizer(){let i=Nn.make(this.unpacker.unpackString()),e=Je.make(this.unpacker.unpackLength()),t=new Array(e.asNumber());for(let s=0;s<e.asNumber();s++)t[s]=this.unpackKeywordRef();return Rd.create({uniqueId:i,keywords:t})}unpackKeywordRef(){let i=ht.make(this.unpacker.unpackByte()),e=Je.make(this.unpacker.unpackInt());return As.create({listId:i,index:e})}},Ns=class n extends b{constructor(i,e){super(),this.length=i,this.elements=e}get $typeId(){return n.TYPE_ID}get $version(){return n.VERSION}static create(i){return new n(Je.make(i.elements.length),i.elements)}static fromMap(i,e){var t;let s=(t=i.storage.get("format"))!==null&&t!==void 0?t:"binary";switch(s){case"json":return this.fromJson(i,e);case"binary":return this.fromBinary(i,e);case"base64":return this.fromBase64(i,e)}throw new Error(`Unsupported search snapshot serialization format {${s}}.`)}static fromJson(i,e){let t=s=>{let a=ht.make(r.getNumber(s,"$typeId"));switch(!0){case a.asNumber()===xi.TYPE_ID.asNumber():return xi.fromJson(i,s);case a.asNumber()===Fi.TYPE_ID.asNumber():return Fi.fromJson(i,s)}throw new Error(`Unknown SnapshotElement of type {${a.asNumber()}}.`)};return new n(Je.make(r.getNumber(e,"length")),r.getList(e,"elements",s=>t(s)))}static fromBinary(i,e){return cr.deserialize(i.fromBinaryBlob(r.getRaw(e,"elements")))}static fromBase64(i,e){return cr.deserialize(i.fromBase64(r.getString(e,"elements")))}toMap(i){var e;let t=(e=i.storage.get("format"))!==null&&e!==void 0?e:"binary";switch(t){case"json":return this.toJson(i);case"binary":return this.toBinary(i);case"base64":return this.toBase64(i)}throw new Error(`Unsupported search snapshot serialization format {${t}}.`)}toJson(i){return{length:this.length.asNumber(),elements:this.elements.map(e=>e.toJson(i))}}toBinary(i){return{elements:i.toBinaryBlob(cr.serialize(this))}}toBase64(i){return{elements:i.toBase64(cr.serialize(this))}}clone(){return new n(this.length,this.elements.map(i=>F(i)))}isSame(i){return i===this?!0:i.length.asNumber()===this.length.asNumber()&&P(i.elements,this.elements,(e,t)=>d(e,t))}};Ns.TYPE_ID="a5b29992dc444895a8da159f40ac0f7a";Ns.VERSION=ht.make(1);var Ps=class{},xi=class n extends Ps{constructor(i,e,t){super(),this.listId=i,this.length=e,this.keywords=t}get $typeId(){return n.TYPE_ID}static create(i){return new n(i.listId,Je.make(i.keywords.length),i.keywords)}static fromJson(i,e){return new n(ht.make(r.getNumber(e,"listId")),Je.make(r.getNumber(e,"length")),r.getList(e,"keywords",t=>Zl.make(t)))}toJson(i){return{listId:this.listId.asNumber(),length:this.length.asNumber(),keywords:this.keywords.map(e=>e.asString())}}clone(){return new n(this.listId,this.length,this.keywords.map(i=>i))}isSame(i){return i===this?!0:i.listId.asNumber()===this.listId.asNumber()&&i.length.asNumber()===this.length.asNumber()&&P(i.keywords,this.keywords,(e,t)=>e.asString()===t.asString())}};xi.TYPE_ID=ht.make(1);var As=class n{constructor(i,e){this.listId=i,this.index=e}static create(i){return new n(i.listId,i.index)}static fromJson(i,e){return new n(ht.make(r.getNumber(e,"listId")),Je.make(r.getNumber(e,"index")))}toJson(i){return{listId:this.listId.asNumber(),index:this.index.asNumber()}}clone(){return new n(this.listId,this.index)}isSame(i){return i.listId.asNumber()===this.listId.asNumber()&&i.index.asNumber()===this.index.asNumber()}},Sd=class n{constructor(i,e,t){this.uniqueId=i,this.length=e,this.keywords=t}static create(i){return new n(i.uniqueId,ht.make(i.keywords.length),i.keywords)}static fromJson(i,e){return this.create({uniqueId:Nn.make(r.getString(e,"uniqueId")),keywords:r.getList(e,"keywords",t=>As.fromJson(i,t))})}toJson(i){return{uniqueId:this.uniqueId.asString(),length:this.length.asNumber(),keywords:this.keywords.map(e=>e.toJson(i))}}clone(){return n.create({uniqueId:this.uniqueId,keywords:this.keywords.map(i=>i)})}isSame(i){return i===this?!0:i.uniqueId.asString()===this.uniqueId.asString()&&P(i.keywords,this.keywords,(e,t)=>d(e,t))}},Fi=class n extends Ps{constructor(i,e){super(),this.length=i,this.events=e}get $typeId(){return n.TYPE_ID}static create(i){return new n(Je.make(i.events.length),i.events)}static fromJson(i,e){return new n(Je.make(r.getNumber(e,"length")),r.getList(e,"events",t=>Sd.fromJson(i,t)))}toJson(i){return{length:this.length.asNumber(),events:this.events.map(e=>e.toJson(i))}}clone(){return new n(this.length,this.events.map(i=>F(i)))}isSame(i){return i===this?!0:i.length.asNumber()===this.length.asNumber()&&P(i.events,this.events,(e,t)=>d(e,t))}};Fi.TYPE_ID=ht.make(2);var Td=class n{constructor(i,e,t){this.uniqueId=i,this.length=e,this.keywords=t}static create(i){return new n(i.uniqueId,ht.make(i.keywords.length),i.keywords)}static fromJson(i,e){return n.create({uniqueId:Nn.make(r.getString(e,"uniqueId")),keywords:r.getList(e,"keywords",t=>As.fromJson(i,K.decodeRecord(t)))})}toJson(i){return{uniqueId:this.uniqueId.asString(),length:this.length.asNumber(),keywords:this.keywords.map(e=>e.toJson(i))}}clone(){return n.create({uniqueId:this.uniqueId,keywords:ue(this.keywords)})}isSame(i){return i===this?!0:i.uniqueId.asString()===this.uniqueId.asString()&&P(i.keywords,this.keywords,(e,t)=>d(e,t))}},Od=class n{constructor(i,e,t){this.uniqueId=i,this.length=e,this.keywords=t}static create(i){return new n(i.uniqueId,ht.make(i.keywords.length),i.keywords)}static fromJson(i,e){return n.create({uniqueId:Nn.make(r.getString(e,"uniqueId")),keywords:r.getList(e,"keywords",t=>As.fromJson(i,K.decodeRecord(t)))})}toJson(i){return{uniqueId:this.uniqueId.asString(),length:this.length.asNumber(),keywords:this.keywords.map(e=>e.toJson(i))}}clone(){return n.create({uniqueId:this.uniqueId,keywords:ue(this.keywords)})}isSame(i){return i===this?!0:i.uniqueId.asString()===this.uniqueId.asString()&&P(i.keywords,this.keywords,(e,t)=>d(e,t))}},Rd=class n{constructor(i,e,t){this.uniqueId=i,this.length=e,this.keywords=t}static create(i){return new n(i.uniqueId,ht.make(i.keywords.length),i.keywords)}static fromJson(i,e){return n.create({uniqueId:Nn.make(r.getString(e,"uniqueId")),keywords:r.getList(e,"keywords",t=>As.fromJson(i,K.decodeRecord(t)))})}toJson(i){return{uniqueId:this.uniqueId.asString(),length:this.length.asNumber(),keywords:this.keywords.map(e=>e.toJson(i))}}clone(){return n.create({uniqueId:this.uniqueId,keywords:ue(this.keywords)})}isSame(i){return i===this?!0:i.uniqueId.asString()===this.uniqueId.asString()&&P(i.keywords,this.keywords,(e,t)=>d(e,t))}},Lr=class n extends Ps{constructor(i,e){super(),this.length=i,this.artists=e}get $typeId(){return n.TYPE_ID}static create(i){return new n(Je.make(i.artists.length),i.artists)}static fromJson(i,e){return this.create({artists:r.getList(e,"artists",t=>Td.fromJson(i,K.decodeRecord(t)))})}toJson(i){return{length:this.length.asNumber(),artists:this.artists.map(e=>e.toJson(i))}}clone(){return n.create({artists:this.artists.map(i=>F(i))})}isSame(i){return i===this?!0:P(i.artists,this.artists,(e,t)=>d(e,t))}};Lr.TYPE_ID=ht.make(3);var Vr=class n extends Ps{constructor(i,e){super(),this.length=i,this.brands=e}get $typeId(){return n.TYPE_ID}static create(i){return new n(Je.make(i.brands.length),i.brands)}static fromJson(i,e){return this.create({brands:r.getList(e,"brands",t=>Od.fromJson(i,K.decodeRecord(t)))})}toJson(i){return{length:this.length.asNumber(),brands:this.brands.map(e=>e.toJson(i))}}clone(){return n.create({brands:this.brands.map(i=>F(i))})}isSame(i){return i===this?!0:P(i.brands,this.brands,(e,t)=>d(e,t))}};Vr.TYPE_ID=ht.make(4);var zr=class n extends Ps{constructor(i,e){super(),this.length=i,this.organizers=e}get $typeId(){return n.TYPE_ID}static create(i){return new n(Je.make(i.organizers.length),i.organizers)}static fromJson(i,e){return this.create({organizers:r.getList(e,"organizers",t=>Rd.fromJson(i,K.decodeRecord(t)))})}toJson(i){return{length:this.length.asNumber(),organizers:this.organizers.map(e=>e.toJson(i))}}clone(){return n.create({organizers:this.organizers.map(i=>F(i))})}isSame(i){return i===this?!0:P(i.organizers,this.organizers,(e,t)=>d(e,t))}};zr.TYPE_ID=ht.make(5);var M0=class extends f{build(i,e){return Ns.fromMap(i,e)}},US=(function(n){return n[n.None=0]="None",n[n.Ticket=1]="Ticket",n[n.Pass=2]="Pass",n})(US||{}),th=(function(n){return n[n.Free=0]="Free",n[n.Sold=1]="Sold",n[n.Taken=2]="Taken",n[n.Reserved=3]="Reserved",n})(th||{}),wu=De.kAutoIdLength,Md=class n{constructor(i,e,t,s){if(this.uniqueId=i,this.state=e,this.orderType=t,_(s)&&s.length!==wu)throw new X("orderId",`Order ID length must be ${wu} characters, but it is ${s.length} characters ${s}`);this._orderId=s}get orderId(){return this._orderId}
3set orderId(i){if(_(i)&&i.length!==wu)throw new X("orderId",`Order ID length must be ${wu} characters, but it is ${i.length} characters ${i}`);this._orderId=i}static free(i){return new n(i,th.Free,US.None,null)}clone(){return new n(this.uniqueId,this.state,this.orderType,this.orderId)}isSame(i){return i===this?!0:i.uniqueId===this.uniqueId&&i.state===this.state&&i.orderType===this.orderType&&i.orderId===this.orderId}},Ur=class{static serialize(i){return this.asBytes(i)}static deserialize(i){let e=Gr.fromBytes(i),t=e.readByte();if(t===1)return this.fromBytes(e);throw new ie(`Seating state cannot be deserialized because format ${t} is unknown`)}static asBytes(i){let e=new vs;e.writeByte(1),e.writeInt32(i.length);for(let t of i)this.writeSeatInfo(e,t);return e.toMinimumBytes()}static writeSeatInfo(i,e){i.writeByte(xn(e.state)),i.writeByte(xn(e.orderType)),this.writeOrderId(i,e.orderId)}static writeOrderId(i,e){let t=0;if(_(e))for(;t<e.length;t++)i.writeByte(e.charCodeAt(t));for(;t<De.kAutoIdLength;t++)i.writeByte(0)}static fromBytes(i){let e=[],t=i.readInt32();for(let s=0;s<t;s++)e.push(this.readSeatInfo(i,s));return e}static readSeatInfo(i,e){let t=_n(i.readByte(),th),s=_n(i.readByte(),US),a=this.readOrderId(i);return new Md(e,t,s,a)}static readOrderId(i){let e="",t=!0;for(let a=0;a<De.kAutoIdLength;a++){let o=i.readByte();o===0&&(t=!1),e+=String.fromCharCode(o)}return t?e:null}},Nd=class extends b{get seatCount(){return this.seats.length}},pC=(()=>{class n extends Nd{constructor(e,t,s,a){super(),this.seats=e,this.businessRef=t,this.creationDate=s,this.passTemplateId=a}get $typeId(){return n.TYPE_ID}static empty({businessRef:e,passTemplateId:t}){return new n([],e,fe.now(),t)}static fromMap(e,t){return new n(Ur.deserialize(e.fromBinaryBlob(r.getRaw(t,"seats"))),j.mustDecode(r.get(t,"businessRef")),e.decodeDate(r.get(t,"creationDate")),r.get(t,"passTemplateId"))}toMap(e){return{seatCount:this.seatCount,seats:e.toBinaryBlob(Ur.serialize(this.seats)),businessRef:this.businessRef.encode(),creationDate:e.encodeDate(this.creationDate),passTemplateId:this.passTemplateId}}clone(){return new n(ue(this.seats),this.businessRef.clone(),g.cloneDate(this.creationDate),this.passTemplateId)}isSame(e){return e===this?!0:e.seatCount===this.seatCount&&P(e.seats,this.seats,(t,s)=>d(t,s))&&d(e.businessRef,this.businessRef)&&e.creationDate===this.creationDate&&e.passTemplateId===this.passTemplateId}}return n.TYPE_ID="f795d4cf24724be0b8600661712e7765",n})(),N0=class extends f{build(i,e){return pC.fromMap(i,e)}},gC=(function(n){return n.Free="Free",n.Sold="Sold",n.Scanned="Scanned",n.TicketScanned="TicketScanned",n.PassScanned="PassScanned",n.InCart="InCart",n.Locked="Locked",n.ReservedForPass="ReservedForPass",n.ReservedByPass="ReservedByPass",n.LockedByPass="LockedByPass",n.ReservedForTicket="ReservedForTicket",n.Disabled="Disabled",n.NotConfigured="NotConfigured",n})(gC||{}),mC=(()=>{class n extends b{constructor(e,t){super(),this.seatCount=e,this.statistics=t}get $typeId(){return n.TYPE_ID}static empty(){return new n(0,new Map)}static create(e){return new n(e.seatCount,e.statistics)}static fromMap(e,t){return new n(r.getInteger(t,"seatCount"),r.getMap(t,"statistics",(s,a)=>({key:y(s,gC),value:a})))}toMap(e){return{seatCount:this.seatCount,statistics:se(this.statistics,(t,s)=>({key:m(t),value:s}))}}clone(){return this.copyWith()}isSame(e){return e===this?!0:e.seatCount===this.seatCount&&re(e.statistics,this.statistics)}copyWith({seatCount:e=this.seatCount,statistics:t=this.statistics}={}){return new n(e,t)}}return n.TYPE_ID="3f625307b0da4a4ba93200158c164ae2",n})(),P0=class extends f{build(i,e){return mC.fromMap(i,e)}},IC=(()=>{class n extends Nd{constructor(e,t,s,a){super(),this.seats=e,this.businessRef=t,this.creationDate=s,this.eventId=a}get $typeId(){return n.TYPE_ID}static empty({businessRef:e,eventId:t}){return new n([],e,fe.now(),t)}static fromMap(e,t){return new n(Ur.deserialize(e.fromBinaryBlob(r.getRaw(t,"seats"))),j.mustDecode(r.get(t,"businessRef")),e.decodeDate(r.get(t,"creationDate")),r.get(t,"eventId"))}toMap(e){return{seatCount:this.seatCount,seats:e.toBinaryBlob(Ur.serialize(this.seats)),businessRef:this.businessRef.encode(),creationDate:e.encodeDate(this.creationDate),eventId:this.eventId}}clone(){return new n(ue(this.seats),this.businessRef.clone(),g.cloneDate(this.creationDate),this.eventId)}isSame(e){return e===this?!0:e.seatCount===this.seatCount&&P(e.seats,this.seats,(t,s)=>d(t,s))&&d(e.businessRef,this.businessRef)&&e.creationDate===this.creationDate&&e.eventId===this.eventId}}return n.TYPE_ID="27e7b5e64e3c40ce8f45e0025339bae3",n})(),A0=class extends f{build(i,e){return IC.fromMap(i,e)}},Tl=(()=>{class n extends b{constructor(e,t,s,a,o,u,c,l,h,p,I){super(),this.uniqueId=e,this.customerId=t,this.name=s,this.phoneNumber=a,this.note=o,this.expirationDate=u,this.createdBy=c,this.cancelledBy=l,this.creationDate=h,this.cancelledDate=p,this.items=I}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.getOrNull(t,"customerId"),r.getOrNull(t,"name"),ft.decode(r.getOrNull(t,"phoneNumber")),r.getOrNull(t,"note"),e.decodeDateOrNull(r.getIntegerOrNull(t,"expirationDate")),r.getOrNull(t,"createdBy"),r.getOrNull(t,"cancelledBy"),e.decodeDateOrNull(r.getIntegerOrNull(t,"creationDate")),e.decodeDateOrNull(r.getIntegerOrNull(t,"cancelledDate")),r.getList(t,"items",s=>e.fromData(s)))}toMap(e){var t,s;return{uniqueId:this.uniqueId,customerId:this.customerId,name:this.name,phoneNumber:(s=(t=this.phoneNumber)===null||t===void 0?void 0:t.encode())!==null&&s!==void 0?s:null,note:this.note,expirationDate:e.encodeDateOrNull(this.expirationDate),
3createdBy:this.createdBy,cancelledBy:this.cancelledBy,creationDate:e.encodeDateOrNull(this.creationDate),cancelledDate:e.encodeDateOrNull(this.cancelledDate),items:this.items.map(a=>e.toData(a))}}clone(){var e,t;return new n(this.uniqueId,this.customerId,this.name,(t=(e=this.phoneNumber)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null,this.note,g.cloneDateOrNull(this.expirationDate),this.createdBy,this.cancelledBy,g.cloneDateOrNull(this.creationDate),g.cloneDateOrNull(this.cancelledDate),this.items.map(s=>s.clone()))}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.customerId===this.customerId&&e.name===this.name&&d(e.phoneNumber,this.phoneNumber)&&e.note===this.note&&e.expirationDate==this.expirationDate&&e.createdBy==this.createdBy&&e.cancelledBy==this.cancelledBy&&e.creationDate==this.creationDate&&e.cancelledDate==this.cancelledDate&&P(e.items,this.items,d)}}return n.TYPE_ID="90f82e6b2d204b95ab13fe035bf10d50",n.SCHEMA_VERSION=5,n})(),C0=class extends f{build(i,e){return Tl.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){var t;let s=r.getVersionRange(e);if(s.contains(Tl.SCHEMA_VERSION))return e;if(s.isGreaterThan(Tl.SCHEMA_VERSION))return null;let a=s.to;return a<2&&((t=e.items)!==null&&t!==void 0||(e.items=[]),a=2),a<3&&(a=3),a<4&&(a=4),a<5&&(a=5),e.$schema_version=D.encodedExactly(a),e}},Ol=(()=>{class n extends b{constructor(e,t,s,a,o){super(),this.seatName=e,this.seatId=t,this.ticketTemplateId=s,this.cancelledBy=a,this.cancelledDate=o}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(e.fromData(r.getRaw(t,"seatName")),r.get(t,"seatId"),r.getOrNull(t,"ticketTemplateId"),r.getOrNull(t,"cancelledBy"),e.decodeDateOrNull(r.getIntegerOrNull(t,"cancelledDate")))}toMap(e){return{seatName:e.toData(this.seatName),seatId:this.seatId,ticketTemplateId:this.ticketTemplateId,cancelledBy:this.cancelledBy,cancelledDate:e.encodeDateOrNull(this.cancelledDate)}}clone(){return new n(this.seatName.clone(),this.seatId,this.ticketTemplateId,this.cancelledBy,g.cloneDateOrNull(this.cancelledDate))}isSame(e){return e===this?!0:d(e.seatName,this.seatName)&&e.seatId===this.seatId&&e.ticketTemplateId===this.ticketTemplateId&&e.cancelledBy==this.cancelledBy&&e.cancelledDate==this.cancelledDate}}return n.TYPE_ID="686c5c44f13244878a29d4a85466a9d3",n.SCHEMA_VERSION=3,n})(),k0=class extends f{build(i,e){return Ol.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(Ol.SCHEMA_VERSION))return e;if(t.isGreaterThan(Ol.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(s=2),s<3&&(s=3),e.$schema_version=D.encodedExactly(s),e}},BS=(function(n){return n.Live="LIVE",n.Archived="ARCHIVED",n})(BS||{}),Rl=(()=>{class n extends b{constructor(e,t,s,a,o,u,c,l,h,p,I,v,E,w,S){super(),this.uniqueId=e,this.businessRef=t,this.currency=s,this.isPrivate=a,this.isOnDemand=o,this.color=u,this.names=c,this.descriptions=l,this.components=h,this.isInviteOnly=p,this.isPriceFixed=I,this.isPricePublic=v,this.status=E,this.orderIndex=w,this.contactMethod=S}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}get name(){return this.names.getAnyOrEmpty()}get description(){return this.descriptions.getAnyOrEmpty()}get hasName(){return this.name!==null&&this.name.length>0}get isPublic(){return!this.isPrivate}get isCallOnly(){return this.contactMethod===Za.Call}get isMessageOnly(){return this.contactMethod===Za.Message}static fromMap(e,t){return new n(r.get(t,"uniqueId"),j.decode(r.getOrNull(t,"businessRef")),y(r.get(t,"currency"),Ae),r.get(t,"isPrivate"),r.get(t,"isOnDemand"),r.get(t,"color"),e.fromData(r.getRaw(t,"names")),e.fromData(r.getRaw(t,"descriptions")),ae.deserialize(e,r.get(t,"components")),r.get(t,"isInviteOnly"),r.get(t,"isPriceFixed"),r.get(t,"isPricePublic"),y(r.get(t,"$status"),BS),r.get(t,"orderIndex"),Re(r.getOrNull(t,"contactMethod"),Za))}toMap(e){var t,s;return{uniqueId:this.uniqueId,businessRef:(s=(t=this.businessRef)===null||t===void 0?void 0:t.encode())!==null&&s!==void 0?s:null,names:e.toData(this.names),descriptions:e.toData(this.descriptions),isPrivate:this.isPrivate,isOnDemand:this.isOnDemand,isPricePublic:this.isPricePublic,currency:m(this.currency),color:this.color,components:this.components.serialize(e),isPriceFixed:this.isPriceFixed,isInviteOnly:this.isInviteOnly,$status:m(this.status),orderIndex:this.orderIndex,contactMethod:Se(this.contactMethod)}}clone(){var e,t;return new n(this.uniqueId,(t=(e=this.businessRef)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null,this.currency,this.isPrivate,this.isOnDemand,this.color,this.names.clone(),this.descriptions.clone(),this.components.clone(),this.isInviteOnly,this.isPriceFixed,this.isPricePublic,this.status,this.orderIndex,this.contactMethod)}isSame(e){return this===e?!0:e.uniqueId===this.uniqueId&&d(e.businessRef,this.businessRef)&&d(e.names,this.names)&&d(e.descriptions,this.descriptions)&&e.components.isSame(this.components)&&e.isPrivate===this.isPrivate&&e.isOn
3Demand===this.isOnDemand&&e.isPricePublic===this.isPricePublic&&e.currency===this.currency&&e.color===this.color&&e.isPriceFixed===this.isPriceFixed&&e.isInviteOnly===this.isInviteOnly&&e.status===this.status&&e.orderIndex===this.orderIndex&&e.contactMethod===this.contactMethod}copyWithBusinessRef(e){return new n(this.uniqueId,e.clone(),this.currency,this.isPrivate,this.isOnDemand,this.color,this.names.clone(),this.descriptions.clone(),this.components.copyWithBusinessRef(e),this.isInviteOnly,this.isPriceFixed,this.isPricePublic,this.status,this.orderIndex,this.contactMethod)}hasComponentByTypeId(e){return this.components.hasComponentByTypeId(e)}mustFindComponentByTypeId(e){return this.components.mustFindComponentByTypeId(e)}findComponentByTypeId(e){return this.components.findComponentByTypeId(e)}findComponentByInstanceId(e){return this.components.findComponentByInstanceId(e)}findComponentsByTypeId(e){return this.components.findComponentsByTypeId(e)}addComponent(e){this.components.addComponent(e)}addComponents(e){this.components.addComponents(e)}removeComponentByTypeId(e){return this.components.removeComponentByTypeId(e)}removeComponentByInstanceId(e){return this.components.removeComponentByInstanceId(e)}removeComponentAt(e){this.components.removeComponentAt(e)}removeAllComponents(){this.components.removeAllComponents()}popAllComponentsByTypeId(e){return this.components.popAllComponentsByTypeId(e)}popComponentByTypeId(e){return this.components.popComponentByTypeId(e)}popComponent(e){return this.components.popComponent(e)}replaceComponent(e){return this.components.replaceComponent(e)}addOrReplaceComponent(e){this.components.addOrReplaceComponent(e)}mustFindComponentField(e,t){return this.components.mustFindComponentField(e,t)}findComponentField(e,t){return this.components.findComponentField(e,t)}isBasic(){return this.hasComponentByTypeId(Ot.TYPE_ID)}isComposite(){return this.hasComponentByTypeId(Jt.TYPE_ID)}getDuration(){let e=this.findComponentByTypeId(oi.TYPE_ID);if(e&&e instanceof oi)return e.durationRange.to;let t=this.findComponentsByTypeId(Jt.TYPE_ID).filter(s=>s instanceof Jt).map(s=>s);return Qx(t)}getMinimumDuration(){let e=this.findComponentByTypeId(oi.TYPE_ID);if(e&&e instanceof oi)return e.durationRange.from;let t=this.findComponentsByTypeId(Jt.TYPE_ID).filter(s=>s instanceof Jt).map(s=>s);return e2(this.currency,t)}getPrice(){let e=this.components.findComponentByTypeId(Ot.TYPE_ID);if(_(e))return n2(e,this.currency);let t=this.components.findComponentByTypeId(bs.TYPE_ID);if(_(t))return i2(t,this.currency);let s=this.components.findComponentsByTypeId(Jt.TYPE_ID);if(_(s)&&s.length>=0)return s2(s,this.currency);throw new Error("No component found in service to determine price.")}getPriceType(){let e=this.findComponentByTypeId(Ot.TYPE_ID);return e&&e instanceof Ot?e.priceType:Nt.PricePerService}getMinimumPrice(){var e;let t=this.findComponentByTypeId(Ot.TYPE_ID);if(t&&t instanceof Ot)return(e=t.priceRanges.get(this.currency))!==null&&e!==void 0?e:Vn.exactly(Y.withCurrencyFromAmount(this.currency,0));let s=this.findComponentsByTypeId(Jt.TYPE_ID).filter(a=>a instanceof Jt).map(a=>a);return a2(this.currency,s)}isEveryPricePublic(){let e=this.components.findComponentByTypeId(Ot.TYPE_ID);if(_(e))return this.isPricePublic;let t=this.components.findComponentByTypeId(bs.TYPE_ID);if(_(t))return t.groups.every(a=>a.isPricePublic);let s=this.components.findComponentsByTypeId(Jt.TYPE_ID);if(_(s))return s.every(a=>a.modifiers.every(o=>!o.selected||o.isPricePublic));throw new Error("No component found in service to determine price visibility.")}}return n.TYPE_ID="0c6514d656674c2e8935143cd5b6fef3",n.SCHEMA_VERSION=13,n})(),_0=class extends f{build(i,e){return Rl.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(Rl.SCHEMA_VERSION))return e;if(t.isGreaterThan(Rl.SCHEMA_VERSION))return null;let s=t.to;if(s<2&&(r.set(e,"isInviteOnly",!1),s=2),s<3&&(r.set(e,"$status",BS.Live),s=3),s<4){let a=ae.deserialize(i,r.getList(e,"components",c=>c)),o=Fd(r.getRaw(e,"flexibleDuration")),u=r.getMap(e,"prices",(c,l)=>
3({key:c,value:Y.decode(l)}));a.addComponent(Kl.create(o)),a.addComponent(Ot.fromPrices(u)),r.set(e,"components",a.serialize(i)),r.setIfNullOrUndefined(e,"isPricePublic",!0),s=4}if(s<5&&(s=5),s<6&&(r.set(e,"orderIndex",0),s=6),s<7&&(r.set(e,"contactMethod",Za.Call),s=7),s<8){let a=ae.deserialize(i,r.getList(e,"components",u=>u)),o=a.popComponentByTypeId(Kl.TYPE_ID);o&&a.addComponent(oi.fromDuration(o.duration)),r.set(e,"components",a.serialize(i)),s=8}if(s<9&&(s=9),s<10){let a=r.getMap(e,"localizations",(l,h)=>({key:l,value:h})),o=r.getMap(e,"descriptions",(l,h)=>({key:l,value:h})),u=Oe.localized(a),c=Oe.localized(o);r.set(e,"names",i.toData(u)),r.set(e,"descriptions",i.toData(c)),s=10}if(s<11){let a=r.getList(e,"staffMembers",u=>u),o=ae.deserialize(i,r.getList(e,"components",u=>u));o.addComponent(new wS(a)),r.set(e,"components",o.serialize(i)),s=11}if(s<12){let a=ae.deserialize(i,r.getList(e,"components",u=>u));if(a.findComponentByTypeId(ES.TYPE_ID)!==null){let u=a.findComponentByTypeId(Ot.TYPE_ID),c=bs.empty(u.priceType);if(u!==null){let l=new bS(Oe.forLanguage($.English,"Group"),0,u.priceRanges,!0);c.groups.push(l)}a.removeComponentByTypeId(bs.TYPE_ID),a.removeComponentByTypeId(Ot.TYPE_ID),a.addComponent(c)}r.set(e,"components",a.serialize(i)),s=12}return s<13&&(s=13),e.$schema_version=D.encodedExactly(s),e}};function Qx(n){let i=0;for(let e of n)for(let t of e.modifiers)t.selected&&(i+=t.maxDuration.asMilliseconds());return oe.default.duration(i,"milliseconds")}function e2(n,i){let e=oe.default.duration(0);for(let t of i){if(t.isOptional)continue;let s=t.modifiers[0];for(let a=1;a<t.modifiers.length;a++)t.modifiers[a].durationRange.to<s.durationRange.to&&(s=t.modifiers[a]);e=e.add(s.durationRange.to.asMilliseconds(),"milliseconds")}if(e.asMilliseconds()<=0){let t=t2(i);t&&(e=e.add(t.asMilliseconds(),"milliseconds"))}return e}function t2(n){let i=null;for(let e of n)for(let t of e.modifiers){let s=t.durationRange.to;s.asMilliseconds()>0&&s<(i??(i=s))&&(i=s)}return i}function n2(n,i){let e=n.priceRanges.get(i);if(k(e))throw new Error(`Missing price for currency: ${i}`);return e}function i2(n,i){let e=Vn.free(i);return n.groups.map(s=>{let a=s.priceRanges.get(i);if(k(a))throw new Error(`Missing price for currency: ${i}`);return a.scale(s.groupSize)}).reduceRight((s,a)=>s.add(a),e)}function s2(n,i){let e=Vn.free(i);return r2(n).map(s=>{let a=s.priceRanges.get(i);if(k(a))throw new Error(`Missing price for currency: ${i}`);return a}).reduceRight((s,a)=>s.add(a),e)}function r2(n){let i=[];return n.forEach(e=>e.modifiers.forEach(t=>{t.selected&&i.push(t)})),i}function a2(n,i){let e=Y.withCurrencyFromAmount(n,0);for(let t of i){if(t.isOptional)continue;let s=t.modifiers[0];for(let o=1;o<t.modifiers.length;o++){let u=t.modifiers[o].priceRanges.get(n),c=s.priceRanges.get(n);k(u)||k(c)||u.to.value<c.to.value&&(s=t.modifiers[o])}let a=s.priceRanges.get(n);_(a)&&(e=e.add(a.from))}if(e.value<=0){let t=o2(n,i);t&&(e=e.add(t.to))}return Vn.exactly(e)}function o2(n,i){let e=null;for(let t of i)for(let s of t.modifiers){let a=s.durationRange.to,o=s.priceRanges.get(n);if(k(o))continue;let u=o.to;a.asMilliseconds()>0&&u.value>0&&u.value<(e??(e=u)).value&&(e=u)}return e?Vn.exactly(e):null}var Ml=(()=>{class n extends vd{constructor(e,t,s,a,o,u,c,l,h,p){super(),this.uniqueId=e,this.businessRef=t,this.creationDate=s,this.expirationDate=a,this.staffRoleId=o,this.partnerRole=u,this.staffProfileId=c,this.status=l,this.usedBy=h,this.usedAt=p}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),j.mustDecode(r.get(t,"businessRef")),e.decodeDate(r.get(t,"creationDate")),e.decodeDateOrNull(r.getOrNull(t,"expirationDate")),r.get(t,"staffRoleId"),_n(r.get(t,"partnerRole"),Qt),r.getOrNull(t,"staffProfileId"),y(r.get(t,"$status"),Ci),r.getOrNull(t,"usedBy"),e.decodeDateOrNull(r.getOrNull(t,"usedAt")))}toMap(e){return{uniqueId:this.uniqueId,businessRef:this.businessRef.encode(),creationDate:e.encodeDate(this.creationDate),expirationDate:e.encodeDateOrNull(this.expirationDate),staffProfileId:this.staffProfileId,staffRoleId:this.staffRoleId,partnerRole:xn(this.partnerRole),$status:m(this.status),usedBy:this.usedBy,usedAt:e.encodeDateOrNull(this.usedAt)}}clone(){return new n(this.uniqueId,this.businessRef.clone(),g.cloneDate(this.creationDate),g.cloneDateOrNull(this.expirationDate),this.staffRoleId,this.partnerRole,this.staffProfileId,this.status,this.usedBy,g.cloneDateOrNull(this.usedAt))}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&d(e.businessRef,this.businessRef)&&e.creationDate===this.creationDate&&e.expirationDate===this.expirationDate&&e.staffRoleId===this.staffRoleId&&e.partnerRole===this.partnerRole&&e.staffProfileId===this.staffProfileId&&e.status===this.status&&e.usedBy===this.usedBy&&e.usedAt===this.usedAt}use(e,t){return new n(this.uniqueId,this.businessRef.clone(),this.creationDate,this.expirationDate,this.staffRoleId,this.partnerRole,this.staffProfileId,Ci.Used,e,t??(0,oe.default)())}copyWithBusinessRef(e){return new n(this.uniqueId,e.clone(),g.cloneDate(this.creationDate),g.cloneDateOrNull(this.expirationDate),this.staffRoleId,this.partnerRole,this.staffProfileId,this.status,this.usedBy,g.cloneDateOrNull(this.usedAt))}}return n.TYPE_ID="6cdd8faba58d49b7a0462b5fae03be47",n.SCHEMA_VERSION=5,n})(),x0=class extends f{build(i,e){return Ml.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(Ml.SCHEMA_VERSION))return e;if(t.isGreaterThan(Ml.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(r.set(e,"$status",Ci.Live),s=2),s<3&&(s=3),s<4&&(r.setIfNullOrUndefined(e,"businessRef",r.get(e,"businessId")),s=4),s<5&&(s=5,e.partnerRole=e.userRole),e.$schema_version=D.encodedExactly(s),e}},HS=(function(n){return n.CanViewOtherCalendars="CanViewOtherCalendars",n.CanEditOtherCalendars="CanEditOtherCalendars",n.CanViewClients="CanViewClients",n.CanEditClients="CanEditClients",n.CanEditServices="CanEditServices",n.CanInviteStaff="CanInviteStaff",n.CanEditStaffRoles="CanEditStaffRoles",n.CanEditBusinessProfile="CanEditBusinessProfile",n.CanEditPortfolio="CanEditPortfolio",n.CanEditOtherStaffSchedule="CanEditOtherStaffSchedule",n})(HS||{}),Nl=(()=>{class n extends Oo{constructor(e,t,s,a,o,u,c,l,h=!0,p,I,v,E){super(),this.uniqueId=e,this.businessRef=t,this.firstName=s,this.lastName=a,this.phoneNumber=o,this.photo=u,this.userId=c,this.pushNotificationToken=l,this.isPublic=h,this.partnerRole=p,this.email=I,this.status=v,this.components=E,this.formattedName=fi(s,a),this.initials=pi(s,a)}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(5,n.SCHEMA_VERSION)}get isDeveloper(){return this.partnerRole===Qt.Developer}get isAdministrator(){return this.partnerRole===Qt.Administrator}get isEmployee(){return this.partnerRole===Qt.Employee}get isNotDeveloper(){return!this.isDeveloper}get isNotAdministrator(){return!this.isAdministrator}get isNotEmployee(){return!this.isEmployee}get isVisibleForClients(){return this.isPublic&&this.isNotDeveloper}static forOwnerOfBusiness(e,t){var s,a;return new n(t.uniqueId,e.clone(),t.firstName,t.lastName,t.phoneNumber.clone(),(a=(s=t.photo)===null||s===void 0?void 0:s.clone())!==null&&a!==void 0?a:null,t.uniqueId,t.pushNotificationToken,!0,Qt.Administrator,t.email,Ai.Live,this.createRequiredComponents())}static froDeveloperOfBusiness(e,t){var s,a;return new n(t.uniqueId,e.clone(),t.firstName,t.lastName,t.phoneNumber.clone(),(a=(s=t.photo)===null||s===void 0?void 0:s.clone())!==null&&a!==void 0?a:null,t.uniqueId,t.pushNotificationToken,!0,Qt.Developer,t.email,Ai.Live,this.createRequiredComponents())}static createRequiredComponents(){let e=new SS([]);return new ae([e])}static fromMap(e,t){return new n(r.getString(t,"uniqueId"),j.mustDecode(r.getString(t,"businessRef")),r.getString(t,"firstName"),r.getString(t,"lastName"),ft.mustDecode(r.getString(t,"phoneNumber")),e.fromDataOrNull(r.getRecordOrNull(t,"photo")),r.getStringOrNull(t,"userId"),r.getStringOrNull(t,"pushNotificationToken"),r.getBoolean(t,"isPublic"),_n(r.getInteger(t,"partnerRole"),Qt),r.getStringOrNull(t,"email"),y(r.getString(t,"$status"),Ai),ae.deserialize(e,r.getRaw(t,"components")))}toMap(e){return{uniqueId:this.uniqueId,businessRef:this.businessRef.encode(),firstName:this.firstName,lastName:this.lastName,phoneNumber:this.phoneNumber.encode(),photo:e.toDataOrNull(this.photo),userId:this.userId,partnerRole:xn(this.partnerRole),$status:m(this.status),pushNotificationToken:this.pushNotificationToken,isPublic:this.isPublic,email:this.email,components:this.components.serialize(e)}}clone(){return this.copyWith()}copyWith({uniqueId:e=this.uniqueId,businessRef:t=F(this.businessRef),firstName:s=this.firstName,lastName:a=this.lastName,phoneNumber:o=F(this.phoneNumber),photo:u=Z(this.photo),userId:c=this.userId,pushNotificationToken:l=this.pushNotificationToken,isPublic:h=this.isPublic,partnerRole:p=this.partnerRole,email:I=this.email,status:v=this.status,components:E=F(this.components)}={}){return new n(e,t,s,a,o,u,c,l,h,p,I,v,E)}isSame(e){return this===e?!0:e.uniqueId===this.uniqueId&&e.businessRef===this.businessRef&&e.firstName===this.firstName&&e.lastName===this.lastName&&d(e.phoneNumber,this.phoneNumber)&&d(e.photo,this.photo)&&e.userId===this.userId&&e.partnerRole===this.partnerRole&&e.status===this.status&&e.pushNotificationToken===this.pushNotificationToken&&e.isPublic===this.isPublic&&e.email===this.email&&e.components.isSame(this.components)}copyWithBusinessRef(e){var t,s;return new n(this.uniqueId,e.clone(),this.firstName,this.lastName,this.phoneNumber.clone(),(s=(t=this.photo)===null||t===void 0?void 0:t.clone())!==null&&s!==void 0?s:null,this.userId,this.pushNotificationToken,this.isPublic,this.partnerRole,this.email,this.status,this.components.c
3opyWithBusinessRef(e))}}return n.TYPE_ID="05a0c1ee5eb941829784281eee2da2ac",n.SCHEMA_VERSION=6,n})(),F0=class extends f{build(i,e){return Nl.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(Nl.SCHEMA_VERSION))return e;if(t.isGreaterThan(Nl.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(r.set(e,"component",[]),s=2),s<3&&(r.setIfNullOrUndefined(e,"businessRef",r.get(e,"businessId")),s=3),s<4&&(s=4),s<5&&(s=5,e.partnerRole=e.userRole),s<6&&(r.setIfNullOrUndefined(e,"$status",m(Ai.Live)),s=6),e.$schema_version=D.encodedExactly(s),e}migrateFromCurrentSchemaVersion(i,e,t){let a=r.getVersionRange(t).from;return a>=5&&(a=3,t.userRole=t.partnerRole,t.$schema_version=D.encodedBetween(3,6)),t}},Ki=(()=>{class n extends b{constructor(e,t){super(),this.uniqueId=e,this.permissions=t}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static fromMap(e,t){let s=r.getMap(t,"permissions",(o,u)=>({key:Re(o,HS),value:u})),a=new Map;return s.forEach((o,u)=>{_(u)&&a.set(u,o)}),new n(r.get(t,"uniqueId"),a)}toMap(e){return{uniqueId:this.uniqueId,permissions:se(this.permissions,(t,s)=>({key:m(t),value:s}))}}clone(){return new n(this.uniqueId,ee(this.permissions))}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&re(e.permissions,this.permissions)}}return n.TYPE_ID="c2815f564ef44001b325bb632bdb29bc",n.SCHEMA_VERSION=2,n.BASIC="cf228795c90243f99f41a9b8724f3a85",n.STAFF="cf03d42a715443858c0fa6f45a721da4",n.MANAGER="68aa198be45e426db12b48072b8970cc",n.NONE="__STAFF_ROLE_NONE__",n.ADMINISTRATOR="__STAFF_ROLE_ADMINISTRATOR__",n.DEVELOPER="__STAFF_ROLE_DEVELOPER__",n.kMaxPermissions=9,n})(),q0=class extends f{build(i,e){return Ki.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(Ki.SCHEMA_VERSION))return e;if(t.isGreaterThan(Ki.SCHEMA_VERSION))return null;let s=t.to;if(s<2){let a=r.get(e,"uniqueId");if(a==Ki.MANAGER||a==Ki.ADMINISTRATOR||a==Ki.DEVELOPER){let o=r.getRaw(e,"permissions",{});r.set(e,m(HS.CanEditOtherStaffSchedule),!0),r.set(e,"permissions",o)}s=2}return e.$schema_version=D.encodedExactly(s),e}},DC=(()=>{class n extends b{constructor(e,t){super(),this.staffRoles=e,this.defaultStaffRole=t}get $typeId(){return n.TYPE_ID}static empty(e=null){return new n(new Map,e??null)}static fromMap(e,t){return new n(r.getMap(t,"staffRoles",(s,a)=>({key:s,value:a})),r.getOrNull(t,"defaultStaffRole"))}toMap(e){return{staffRoles:se(this.staffRoles,(t,s)=>({key:t,value:s})),defaultStaffRole:this.defaultStaffRole}}clone(){return new n(ee(this.staffRoles),this.defaultStaffRole)}isSame(e){return e===this?!0:re(e.staffRoles,this.staffRoles)&&e.defaultStaffRole===this.defaultStaffRole}}return n.TYPE_ID="e7b37a1e52694a88ac1383f404d5d995",n})(),Y0=class extends f{build(i,e){return DC.fromMap(i,e)}},Pl=(()=>{class n extends xf{constructor(e,t,s,a,o,u,c,l,h,p,I,v,E){super(),this.uniqueId=e,this.businessId=t,this.creatorId=s,this.organizationId=a,this.name=o,this.partnerRole=u,this.creationDate=c,this.country=l,this.language=h,this.memberId=p,this.timezone=I,this.moduleType=v,this.dashboards=E,this.businessRef=j.create(e,a,v)}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}hasDashboard(e){return this.dashboards.includes(e)}addDashboard(e){this.dashboards.unshift(e)}getDashboards(){return[...this.dashboards]}static create(e){return new n(e.uniqueId,e.businessId,e.creatorId,e.organizationId,e.name,e.partnerRole,e.creationDate,e.country,e.language,e.memberId,e.t
3imezone,e.moduleType,[e.dashboard])}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.get(t,"businessId"),r.get(t,"creatorId"),r.get(t,"organizationId"),r.get(t,"name"),_n(r.get(t,"partnerRole"),Qt),e.decodeDate(r.get(t,"creationDate")),y(r.get(t,"country"),Ie),y(r.get(t,"language"),$),r.get(t,"memberId"),y(r.get(t,"timezone"),Ee),y(r.get(t,"moduleType"),st),r.getList(t,"dashboards",s=>y(s,wi)))}toMap(e){return{uniqueId:this.uniqueId,businessId:this.businessId,creatorId:this.creatorId,organizationId:this.organizationId,moduleType:m(this.moduleType),memberId:this.memberId,name:this.name,partnerRole:xn(this.partnerRole),creationDate:e.encodeDate(this.creationDate),country:m(this.country),language:m(this.language),timezone:m(this.timezone),dashboards:this.dashboards.map(t=>m(t))}}clone(){return new n(this.uniqueId,this.businessId,this.creatorId,this.organizationId,this.name,this.partnerRole,this.creationDate,this.country,this.language,this.memberId,this.timezone,this.moduleType,[...this.dashboards])}isSame(e){return this===e?!0:e.uniqueId===this.uniqueId&&e.businessRef===this.businessRef&&e.creatorId===this.creatorId&&e.organizationId===this.organizationId&&e.name===this.name&&e.partnerRole===this.partnerRole&&e.creationDate===this.creationDate&&e.country===this.country&&e.language===this.language&&e.memberId===this.memberId&&e.timezone===this.timezone&&e.moduleType==this.moduleType&&P(e.dashboards,this.dashboards)}copyWith(e){var t,s,a;return new n(this.uniqueId,(t=e?.businessId)!==null&&t!==void 0?t:this.businessId,this.creatorId,(s=e?.organizationId)!==null&&s!==void 0?s:this.organizationId,this.name,this.partnerRole,this.creationDate,this.country,this.language,this.memberId,this.timezone,(a=e?.moduleType)!==null&&a!==void 0?a:this.moduleType,[...this.dashboards])}}return n.TYPE_ID="f44f3c74e9514cfea8c4dc03f501dea6",n.SCHEMA_VERSION=13,n})(),$0=class extends f{build(i,e){return Pl.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(Pl.SCHEMA_VERSION))return e;if(t.isGreaterThan(Pl.SCHEMA_VERSION))return null;let s=t.to;if(s<2&&(r.set(e,"userRole",r.get(e,"role")),s=2),s<3&&(r.set(e,"schedulingMode",ss.Calendar),s=3),s<4&&(s=4),s<5&&(s=5),s<6){let a=r.get(e,"country");r.setIfNullOrUndefined(e,"language",Nr(a)),s=6}if(s<7&&(s=7),s<8&&(r.set(e,"businessId",r.get(e,"uniqueId")),s=8),s<9&&(r.setIfNullOrUndefined(e,"organizationId",r.get(e,"creatorId")),s=9),s<10&&(r.set(e,"moduleType",st.Legacy),s=10),s<11&&(s=11,e.partnerRole=e.userRole),s<12){s=12;let a=y(r.get(e,"moduleType"),st),o=Xx(a);e.dashboards=[m(o)]}return s<13&&(s=13,e.memberId=e.staffId),e.$schema_version=D.encodedExactly(s),e}migrateFromCurrentSchemaVersion(i,e,t){let a=r.getVersionRange(t).from;return a>=11&&(a=8,t.userRole=t.partnerRole,t.staffId=t.memberId,t.$schema_version=D.encodedBetween(8,13)),t}},vC=(function(n){return n.InTime="InTime",n.AppStore="AppStore",n.GooglePlay="GooglePlay",n})(vC||{}),yC=(function(n){return n.Active="Active",n.GracePeriod="GracePeriod",n.Cancelled="Cancelled",n.Revoked="Revoked",n})(yC||{}),bC=(function(n){return n.FreeTrial="FreeTrial",n.LifeTime="LifeTime",n.Standard="Standard",n})(bC||{}),EC=(()=>{class n extends b{constructor(e,t,s,a,o,u,c,l){super(),this.subscriptionType=e,this.status=t,this.storeId=s,this.expirationDate=a,this.organizationId=o,this.billingAccountId=u,this.storeSubscriptionId=c,this.storeSubscriptionStatus=l,this.uniqueId=`${u}:${o}`}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(y(r.get(t,"subscriptionType"),bC),y(r.get(t,"status"),yC),y(r.get(t,"storeId"),vC),e.decodeDate(r.get(t,"expirationDate")),r.get(t,"organizationId"),r.get(t,"billingAccountId"),new ut(r.getOrNull(t,"storeSubscriptionId")),new ut(r.getOrNull(t,"storeSubscriptionStatus")))}toMap(e){return{subscriptionType:m(this.subscriptionType),status:m(this.status),storeId:m(this.storeId),expirationDate:e.encodeDate(this.expirationDate),organizationId:this.organizationId,billingAccountId:this.billingAccountId,storeSubscriptionId:this.storeSubscriptionId.queryableValue,storeSubscriptionStatus:this.storeSubscriptionStatus.queryableValue}}clone(){return new n(this.subscriptionType,this.status,this.storeId,g.cloneDate(this.expirationDate),this.organizationId,this.billingAccountId,this.storeSubscriptionId.clone(),this.storeSubscriptionStatus.clone())}isSame(e){return e===this?!0:e.subscriptionType===this.subscriptionType&&e.status===this.status&&e.storeId===this.storeId&&e.expirationDate===this.expirationDate&&e.organizationId===this.organizationId&&e.billingAccountId===this.billingAccountId&&d(e.storeSubscriptionId,this.storeSubscriptionId)&&d(e.storeSubscriptionStatus,this.storeSubscriptionStatus)}}return n.TYPE_ID="5a1bb7dd9a4d461d833f811c19b93a52",n})(),L0=class extends f{build(i,e){return EC.fromMap(i,e)}},wC=(()=>{class n extends b{constructor(e,t,s,a,o,u,c){super(),this.uniqueId=e,this.creatorId=t,this.creationDate=s,this.businessRef=a,this.eventId=o,this.jobId=u,this.tickets=c,this.ticketCount=c.length}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.get(t,"creatorId"),e.decodeDate(r.get(t,"creationDate")),j.mustDecode(r.get(t,"businessRef")),r.get(t,"eventId"),r.get(t,"jobId"),r.getList(t,"tickets",s=>s))}toMap(e){return{uniqueId:this.uniqueId,creatorId:this.creatorId,creationDate:e.encodeDate(this.creationDate),businessRef:this.businessRef.encode(),eventId:this.eventId,jobId:this.jobId,tickets:this.tickets}}clone(){return new n(this.uniqueId,this.creatorId,g.cloneDate(this.creationDate),this.businessRef.clone(),this.eventId,this.jobId,Te(this.tickets))}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.creatorId===this.creatorId&&e.creationDate===this.creationDate&&d(e.businessRef,this.businessRef)&&e.eventId===this.eventId&&e.jobId===this.jobId&&P(e.tickets,this.tickets)}}return n.TYPE_ID="bad87a1ca796456cb73fcfea64e277b9",n})(),V0=class extends f{build(i,e){return wC.fromMap(i,e)}},SC=(()=>{class n extends b{constructor(e,t,s,a,o,u,c,l,h){super(),this.uniqueId=e,this.creatorId=t,this.creationDate=s,this.businessRef=a,this.eventId=o,this.batchSize=u,this.ticketCount=c,this.template=l,this.name=h,this.batchCount=Math.ceil(c/u)}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.get(t,"creatorId"),e.decodeDate(r.get(t,"creationDate")),j.mustDecode(r.get(t,"businessRef")),r.get(t,"eventId"),r.get(t,"batchSize"),r.get(t,"ticketCount"),e.fromData(r.get(t,"template")),r.get(t,"name"))}toMap(e){return{uniqueId:this.uniqueId,creatorId:this.creatorId,creationDate:e.encodeDate(this.creationDate),businessRef:this.businessRef.encode(),eventId:this.eventId,batchSize:this.batchSize,ticketCount:this.ticketCount,template:e.toData(this.template),name:this.name}}clone(){return new n(this.uniqueId,this.creatorId,g.cloneDate(this.creationDate),this.businessRef.clone(),this.eventId,this.batchSize,this.ticketCount,F(this.template),this.name)}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.creatorId===this.creatorId&&e.creationDate===this.creationDate&&d(e.businessRef,this.businessRef)&&e.eventId===this.eventId&&e.batchSize===this.batchSize&&e.ticketCount===this.ticketCount&&d(e.template,this.template)&&e.name===this.name}}return n.TYPE_ID="4e2d6162ca574f16848d064d4449faba",n})(),z0=class extends f{build(i,e){return SC.fromMap(i,e)}},TC=(function(n){return n.TwoPlusOne="TwoPlusOne",n.CoupleTicket="CoupleTicket",n})(TC||{}),ms=(function(n){return n.Public="Public",n.Promoter="Promoter",n.Protocol="Protocol",n.ThirdParty="ThirdParty",n})(ms||{}),Is=(function(n){return n.Live="LIVE",n.Archived="ARCHIVED",n})(Is||{}),eo=(()=>{class n extends zt(b){constructor(e,t,s,a,o,u,c,l,h,p,I,v,E,w,S,R,x,N,O,A,M,C,H){super(),this.uniqueId=e,this.names=t,this.richDescriptions=s,this.dateSpan=a,this.scanDateSpan=o,this.price=u,this.originalPrice=c,this.applicationFee=l,this.specialOffer=h,this.overrideVat=p,this.quantity=I,this.minQuantity=v,this.isPurchasable=E,this.isLimited=w,this.isPublic=S,this.isPurchasableBySelf=R,this.status=x,this.scope=N,this.components=O,this.sideEffects=A,this.siblingTicketTemplateIds=M,this.ticketSupplementTemplateId=C,this.availabilityModifier=H}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(16,n.SCHEMA_VERSION)}get hasPositiveQuantity(){return this.quantity.isInfinite||this.quantity.value>0}get hasDiscount(){return _(this.originalPrice)&&this.originalPrice.value>this.price.value}get discountPercentage(){return _(this.originalPrice)?100-this.price.value*100/this.originalPrice.value:0}static create(e){return new n(e.uniqueId,e.names,e.richDescriptions,e.dateSpan,e.scanDateSpan,e.price,e.originalPrice,e.applicationFee,e.specialOffer,e.overrideVat,e.quantity,e.minQuantity,e.isPurchasable,e.isLimited,e.isPublic,e.isPurchasableBySelf,e.status,e.scope,e.components,e.sideEffects,e.siblingTicketTemplateIds,e.ticketSupplementTemplateId,e.availabilityModifier)}static fromMap(e,t){return this.create({uniqueId:r.getString(t,"uniqueId"),names:e.fromData(r.getRecord(t,"names")),richDescriptions:e.fromData(r.getRecord(t,"richDescriptions")),dateSpan:e.fromData(r.getRecord(t,"dateSpan")),scanDateSpan:e.fromDataOrNull(r.getRecordOrNull(t,"scanDateSpan")),price:Y.decode(r.getString(t,"price")),originalPrice
3:Y.decodeOrNull(r.getStringOrNull(t,"originalPrice")),applicationFee:e.fromDataOrNull(r.getRecordOrNull(t,"applicationFee")),specialOffer:Re(r.getStringOrNull(t,"specialOffer"),TC),overrideVat:Re(r.getStringOrNull(t,"overrideVat"),te),quantity:Ue.decode(r.getNumber(t,"quantity")),minQuantity:Ue.decode(r.getNumber(t,"minQuantity")),isPurchasable:r.getBoolean(t,"isPurchasable"),isLimited:r.getBoolean(t,"isLimited"),isPublic:r.getBoolean(t,"isPublic"),isPurchasableBySelf:r.getBoolean(t,"isPurchasableBySelf"),status:y(r.getString(t,"$status"),Is),scope:y(r.getString(t,"scope"),ms),components:ae.deserialize(e,r.getList(t,"components",s=>K.decodeRecord(s))),sideEffects:r.getList(t,"sideEffects",s=>e.fromData(K.decodeRecord(s))),siblingTicketTemplateIds:r.getList(t,"siblingTicketTemplateIds",s=>K.decodeString(s)),ticketSupplementTemplateId:r.getStringOrNull(t,"ticketSupplementTemplateId"),availabilityModifier:e.fromDataOrNull(r.getRecordOrNull(t,"availabilityModifier"))})}toMap(e){var t,s;return{uniqueId:this.uniqueId,names:e.toData(this.names),richDescriptions:e.toData(this.richDescriptions),dateSpan:e.toData(this.dateSpan),scanDateSpan:e.toDataOrNull(this.scanDateSpan),price:this.price.encode(),originalPrice:(s=(t=this.originalPrice)===null||t===void 0?void 0:t.encode())!==null&&s!==void 0?s:null,applicationFee:e.toDataOrNull(this.applicationFee),specialOffer:Se(this.specialOffer),overrideVat:Se(this.overrideVat),quantity:this.quantity.encode(),minQuantity:this.minQuantity.encode(),isPurchasable:this.isPurchasable,isLimited:this.isLimited,isPublic:this.isPublic,isPurchasableBySelf:this.isPurchasableBySelf,$status:m(this.status),scope:m(this.scope),components:this.components.serialize(e),sideEffects:this.sideEffects.map(a=>e.toData(a)),siblingTicketTemplateIds:Te(this.siblingTicketTemplateIds),ticketSupplementTemplateId:this.ticketSupplementTemplateId,availabilityModifier:e.toDataOrNull(this.availabilityModifier)}}clone(){return this.copyWith()}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&d(e.names,this.names)&&d(e.richDescriptions,this.richDescriptions)&&d(e.dateSpan,this.dateSpan)&&d(e.scanDateSpan,this.scanDateSpan)&&d(e.price,this.price)&&d(e.originalPrice,this.originalPrice)&&d(e.applicationFee,this.applicationFee)&&d(e.quantity,this.quantity)&&d(e.minQuantity,this.minQuantity)&&P(e.sideEffects,this.sideEffects,d)&&P(e.siblingTicketTemplateIds,this.siblingTicketTemplateIds)&&e.specialOffer===this.specialOffer&&e.overrideVat===this.overrideVat&&e.isPurchasable===this.isPurchasable&&e.isLimited===this.isLimited&&e.isPublic===this.isPublic&&e.isPurchasableBySelf===this.isPurchasableBySelf&&e.status===this.status&&e.scope===this.scope&&d(e.components,this.components)&&d(e.availabilityModifier,this.availabilityModifier)}copyWith({uniqueId:e=this.uniqueId,names:t=F(this.names),richDescriptions:s=F(this.richDescriptions),dateSpan:a=F(this.dateSpan),scanDateSpan:o=Z(this.scanDateSpan),price:u=F(this.price),originalPrice:c=Z(this.originalPrice),applicationFee:l=Z(this.applicationFee),specialOffer:h=this.specialOffer,overrideVat:p=this.overrideVat,quantity:I=F(this.quantity),minQuantity:v=F(this.minQuantity),isPurchasable:E=this.isPurchasable,isLimited:w=this.isLimited,isPublic:S=this.isPublic,isPurchasableBySelf:R=this.isPurchasableBySelf,status:x=this.status,scope:N=this.scope,components:O=F(this.components),sideEffects:A=this.sideEffects.map(B=>F(B)),siblingTicketTemplateIds:M=Te(this.siblingTicketTemplateIds),ticketSupplementTemplateId:C=this.ticketSupplementTemplateId,availabilityModifier:H=Z(this.availabilityModifier)}={}){return n.create({uniqueId:e,names:t,richDescriptions:s,dateSpan:a,scanDateSpan:o,price:u,originalPrice:c,applicationFee:l,specialOffer:h,overrideVat:p,quantity:I,minQuantity:v,isPurchasable:E,isLimited:w,isPublic:S,isPurchasableBySelf:R,status:x,scope:N,components:O,sideEffects:A,siblingTicketTemplateIds:M,ticketSupplementTemplateId:C,availabilityModifier:H})}copyWithFee(e){return this.copyWith({applicationFee:e})}findSideEffect(e){for(let t=0;t<this.sideEffects.length;t++)if(this.sideEffects[t].effectType===e)return this.sideEffects[t];return null}hasSideEffect(e){return this.findSideEffect(e)!=null}}return n.TYPE_ID="1633b79afe6f4b8295c29357d531e5ac",n.SCHEMA_VERSION=17,n})(),U0=class extends f{build(i,e){return eo.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){var t,s,a,o,u,c;this.migrateEnum(e,"$status",Is,Is.Live),this.migrateEnum(e,"scope",ms,ms.Public);let l=r.getVersionRange(e);if(l.contains(eo.SCHEMA_VERSION))return e;if(l.isGreaterThan(eo.SCHEMA_VERSION))return null;let h=l.to;if(h<2&&((t=e.fullPrice)!==null&&t!==void 0||(e.fullPrice=e.price),h=2),h<3&&((s=e.$status)!==null&&s!==void 0||(e.$status=m(Is.Live)),h=3),h<4&&(e.applicationFee=null,e.specialOffer=null,h=4),h<5){let p=Y.decode(r.get(e,"price")),I=Y.decodeOrNull(r.getOrNull(e,"fullPrice"));_(I)&&I.value>p.value?e.originalPrice=I.encode():e.originalPrice=null,h=5}if(h<6&&((a=e.isLimited)!==null&&a!==void 0||(e.isLimited=!1),h=6),h<7&&((o=e.isPublic)!==null&&o!==void 0||(e.isPublic=!0),h=7),h<8&&((u=e.scope)!==null&&u!==void 0||(e.scope=m(ms.Public)),h=8),h<9&&(h=9),h<10&&(e.onOrderCompleteHooks=[],h=10),h<11&&((c=e.isPurchasableBySelf)!==null&&c!==void 0||(e.isPurchasableBySelf=!0),h=11),h<12&&(h=12),h<13&&(e.siblingTicketTemplateIds=[],h=13),h<14&&(h=14),h<15&&(e.minQuantity=Ue.finite(1).encode(),h=15),h<16){let I=r.getList(e,"onOrderCompleteHooks",v=>i.fromData(v)).map(v=>v.toSideEffect()).filter(_);e.sideEffects=I.map(v=>i.toData(v)),h=16}return h<17&&(h=17),e.$schema_version=D.encodedExactly(h),e}},Al=(()=>{class n extends b{constructor(e,t,s,a,o){super(),this.uniqueId=e,this.names=t,this.items=s,this.expanded=a,this.showLowestPrice=o}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static create(e){return new n(e.uniqueId,e.names,e.items,e.expanded,e.showLowestPrice)}static empty(e){return new n(e,Oe.empty(),new Array,!1,!0)}static fromMap(e,t){return new n(r.getString(t,"uniqueId"),e.fromData(r.get(t,"names")),r.getList(t,"items",s=>s),r.getBoolean(t,"expanded"),r.getBoolean(t,"showLowestPrice"))}toMap(e){return{uniqueId:this.uniqueId,names:e.toData(this.names),items:this.items,expanded:this.expanded,showLowestPrice:this.showLowestPrice}}clone(){return new n(this.uniqueId,this.names.clone(),this.items,this.expanded,this.showLowestPrice)}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&d(e.names,this.names)&&P(e.items,this.items)&&e.expanded===this.expanded&&e.showLowestPrice===this.showLowestPrice}}return n.TYPE_ID="088dd61267a74984b7c94610484995a6",n.SCHEMA_VERSION=3,n})(),B0=class extends f{build(i,e){return Al.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){var t,s;let a=r.getVersionRange(e);if(a.contains(Al.SCHEMA_VERSION))return e;if(a.isGreaterThan(Al.SCHEMA_VERSION))return null;let o=a.to;return o<2&&((t=e.expanded)!==null&&t!==void 0||(e.expanded=!1),o=2),o<3&&((s=e.showLowestPrice)!==null&&s!==void 0||(e.showLowestPrice=!0),o=3),e.$schema_version=D.encodedExactly(o),e}},OC=(()=>{class n extends b{constructor(e,t,s,a,o,u){super(),this.uniqueId=e,this.names=t,this.richDescriptions=s,this.dateSpan=a,this.price=o,this.originalPrice=u}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.get(t,"uniqueId"),e.fromData(r.get(t,"names")),e.fromData(r.get(t,"richDescriptions")),e.fromData(r.get(t,"dateSpan")),Y.decode(r.get(t,"price")),Y.decodeOrNull(r.getOrNull(t,"originalPrice")))}toMap(e){var t,s;return{uniqueId:this.uniqueId,names:e.toData(this.names),richDescriptions:e.toData(this.richDescriptions),dateSpan:e.toData(this.dateSpan),price:this.price.encode(),originalPrice
3:(s=(t=this.originalPrice)===null||t===void 0?void 0:t.encode())!==null&&s!==void 0?s:null}}clone(){var e,t;return new n(this.uniqueId,this.names.clone(),this.richDescriptions.clone(),this.dateSpan.clone(),this.price.clone(),(t=(e=this.originalPrice)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null)}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&d(e.names,this.names)&&d(e.richDescriptions,this.richDescriptions)&&d(e.dateSpan,this.dateSpan)&&d(e.price,this.price)&&d(e.originalPrice,this.originalPrice)}}return n.TYPE_ID="4e7f1770d6ef4e22825a1d94d4c77470",n})(),H0=class extends f{build(i,e){return OC.fromMap(i,e)}},G0=class extends b{},RC=(()=>{class n extends G0{constructor(e){super(),this.dependentTicketTemplateId=e}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.dependentTicketTemplateId)}static fromMap(e,t){return n.create({dependentTicketTemplateId:r.get(t,"dependentTicketTemplateId")})}toMap(e){return{dependentTicketTemplateId:this.dependentTicketTemplateId}}clone(){return n.create({dependentTicketTemplateId:this.dependentTicketTemplateId})}isSame(e){return this===e?!0:e instanceof n?e.dependentTicketTemplateId===this.dependentTicketTemplateId:!1}}return n.TYPE_ID="b96773f6d9284b24a415fd4da6a32f13",n})(),W0=class extends f{build(i,e){return RC.fromMap(i,e)}},MC=(()=>{class n extends Le{constructor(e,t,s,a,o,u,c){super(),this.uniqueId=e,this.creatorId=t,this.deviceId=s,this.creationDate=a,this.source=o,this.ticketId=u,this.ticket=c}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.getOrNull(t,"creatorId"),r.getOrNull(t,"deviceId"),e.decodeDate(r.get(t,"creationDate")),y(r.get(t,"source"),le),r.get(t,"ticketId"),e.fromData(r.get(t,"ticket")))}toMap(e){return{uniqueId:this.uniqueId,creatorId:this.creatorId,deviceId:this.deviceId,creationDate:e.encodeDate(this.creationDate),source:m(this.source),ticketId:this.ticketId,ticket:e.toData(this.ticket)}}clone(){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,this.ticketId,this.ticket.clone())}isSame(e){return this===e?!0:e.uniqueId===this.uniqueId&&e.creatorId===this.creatorId&&e.deviceId===this.deviceId&&e.creationDate===this.creationDate&&e.source===this.source&&e.ticketId===this.ticketId&&d(e.ticket,this.ticket)}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="2ed09e7a014a4cf5888de629eba3e281",n})(),j0=class extends f{build(i,e){return MC.fromMap(i,e)}},NC=(()=>{class n extends Le{constructor(e,t,s,a,o,u,c){super(),this.uniqueId=e,this.creatorId=t,this.deviceId=s,this.creationDate=a,this.source=o,this.ticketId=u,this.ticket=c}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.getOrNull(t,"creatorId"),r.getOrNull(t,"deviceId"),e.decodeDate(r.get(t,"creationDate")),y(r.get(t,"source"),le),r.get(t,"ticketId"),e.fromData(r.get(t,"ticket")))}toMap(e){return{uniqueId:this.uniqueId,creatorId:this.creatorId,deviceId:this.deviceId,creationDate:e.encodeDate(this.creationDate),source:m(this.source),ticketId:this.ticketId,ticket:e.toData(this.ticket)}}clone(){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,this.ticketId,this.ticket.clone())}isSame(e){return this===e?!0:e.uniqueId===this.uniqueId&&e.creatorId===this.creatorId&&e.deviceId===this.deviceId&&e.creationDate===this.creationDate&&e.source===this.source&&e.ticketId===this.ticketId&&d(e.ticket,this.ticket)}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="7b2f6e21854a4440a6426ea3ed4de97d",n})(),J0=class extends f{build(i,e){return NC.fromMap(i,e)}},Cl=(()=>{class n extends b{constructor(e,t,s,a,o,u,c,l,h,p,I,v,E,w,S,R,x,N,O,A,M,C,H,B,U,V,q,L){super(),this.eventDefaultLanguage=e,this.defaultFacebookPixelId=t,this.defaultTikTokPixelId=s,this.defaultGoogleTagManagerId=a,this.organizationLogo=o,this.eventRules=u,this.organizationDetails=c,this.serialNumberScope=l,this.serialNumberStrategy=h,this.vat=p,this.feeProtocol=I,this.canEmployeeEditPaymentSettings=v,this.paymentAccount=E,this.paymentType=w,this.activePaymentMethods=S,this.maxMo
3difierPercentage=R,this.maxModifierPrice=x,this.ticketPrintFormat=N,this.defaultEventClassification=O,this.serialNumberLimits=A,this.allowLocalizedInputFields=M,this.organizationUniqueRegistrationCode=C,this.customInfo=H,this.customImageInfo=B,this.qrCodeSeparator=U,this.allowPredefinedProtocolTickets=V,this.allowOfflineOrderReceipts=q,this.eventBookingStrategy=L}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(22,n.SCHEMA_VERSION)}static create(e){return new n(e.eventDefaultLanguage,e.defaultFacebookPixelId,e.defaultTikTokPixelId,e.defaultGoogleTagManagerId,e.organizationLogo,e.eventRules,e.organizationDetails,e.serialNumberScope,e.serialNumberStrategy,e.vat,e.feeProtocol,e.canEmployeeEditPaymentSettings,e.paymentAccount,e.paymentType,e.activePaymentMethods,e.maxModifierPercentage,e.maxModifierPrice,e.ticketPrintFormat,e.defaultEventClassification,e.serialNumberLimits,e.allowLocalizedInputFields,e.organizationUniqueRegistrationCode,e.customInfo,e.customImageInfo,e.qrCodeSeparator,e.allowPredefinedProtocolTickets,e.allowOfflineOrderReceipts,e.eventBookingStrategy)}static fromMap(e,t){return this.create({eventDefaultLanguage:Re(r.getStringOrNull(t,"eventDefaultLanguage"),$),defaultFacebookPixelId:r.getString(t,"defaultFacebookPixelId"),defaultTikTokPixelId:r.getString(t,"defaultTikTokPixelId"),defaultGoogleTagManagerId:r.getString(t,"defaultGoogleTagManagerId"),organizationLogo:e.fromDataOrNull(r.getRecordOrNull(t,"organizationLogo")),eventRules:r.getString(t,"eventRules"),organizationDetails:r.getString(t,"organizationDetails"),serialNumberScope:y(r.getString(t,"serialNumberScope"),vt),serialNumberStrategy:y(r.getString(t,"serialNumberStrategy"),Rs),vat:y(r.getString(t,"vat"),te),feeProtocol:e.fromDataOrNull(r.getRecordOrNull(t,"feeProtocol")),canEmployeeEditPaymentSettings:r.getBoolean(t,"canEmployeeEditPaymentSettings"),paymentAccount:e.fromDataOrNull(r.getRecordOrNull(t,"paymentAccount")),paymentType:y(r.getString(t,"paymentType"),pe),activePaymentMethods:r.getList(t,"activePaymentMethods",s=>y(K.decodeString(s),Fe)),maxModifierPercentage:r.getNumberOrNull(t,"maxModifierPercentage"),maxModifierPrice:Y.decodeOrNull(r.getStringOrNull(t,"maxModifierPrice")),ticketPrintFormat:y(r.getString(t,"ticketPrintFormat"),gs),defaultEventClassification:r.getList(t,"defaultEventClassification",s=>y(K.decodeString(s),_s)),serialNumberLimits:r.getListOrNull(t,"serialNumberLimits",s=>K.decodeString(s)),allowLocalizedInputFields:r.getBoolean(t,"allowLocalizedInputFields"),organizationUniqueRegistrationCode:r.getString(t,"organizationUniqueRegistrationCode"),customInfo:e.fromDataOrNull(r.getRecordOrNull(t,"customInfo")),customImageInfo:e.fromDataOrNull(r.getRecordOrNull(t,"customImageInfo")),qrCodeSeparator:y(r.getString(t,"qrCodeSeparator"),kn),allowPredefinedProtocolTickets:r.getBoolean(t,"allowPredefinedProtocolTickets"),allowOfflineOrderReceipts:r.getBoolean(t,"allowOfflineOrderReceipts"),eventBookingStrategy:y(r.getString(t,"eventBookingStrategy"),yt)})}toMap(e){var t,s;return{eventDefaultLanguage:Se(this.eventDefaultLanguage),defaultFacebookPixelId:this.defaultFacebookPixelId,defaultTikTokPixelId:this.defaultTikTokPixelId,defaultGoogleTagManagerId:this.defaultGoogleTagManagerId,organizationLogo:e.toDataOrNull(this.organizationLogo),eventRules:this.eventRules,organizationDetails:this.organizationDetails,serialNumberScope:m(this.serialNumberScope),serialNumberStrategy:m(this.serialNumberStrategy),vat:m(this.vat),feeProtocol:e.toDataOrNull(this.feeProtocol),canEmployeeEditPaymentSettings:this.canEmployeeEditPaymentSettings,paymentAccount:e.toDataOrNull(this.paymentAccount),paymentType:m(this.paymentType),activePaymentMethods:this.activePaymentMethods.map(a=>m(a)),maxModifierPercentage:this.maxModifierPercentage,maxModifierPrice:(s=(t=this.maxModifierPrice)===null||t===void 0?void 0:t.encode())!==null&&s!==void 0?s:null,ticketPrintFormat:m(this.ticketPrintFormat),defaultEventClassification:this.defaultEventClassification.map(a=>m(a)),serialNumberLimits:this.serialNumberLimits,allowLocalizedInputFields:this.allowLocalizedInputFields,organizationUniqueRegistrationCode:this.organizationUniqueRegistrationCode,customInfo:e.toDataOrNull(this.customInfo),customImageInfo:e.toDataOrNull(this.customImageInfo),qrCodeSeparator:m(this.qrCodeSeparator),allowPredefinedProtocolTickets:this.allowPredefinedProtocolTickets,allowOfflineOrderReceipts:this.allowOfflineOrderReceipts,eventBookingStrategy:m(this.eventBookingStrategy)}}clone(){return this.copyWith()}isSame(e){return e===this?!0:e.eventDefaultLanguage===this.eventDefaultLanguage&&e.defaultFacebookPixelId===this.defaultFacebookPixelId&&e.defaultTikTokPixelId===this.defaultTikTokPixelId&&e.defaultGoogleTagManagerId===this.defaultGoogleTagManagerId&&d(e.organizationLogo,this.organizationLogo)&&e.eventRules===this.eventRules&&e.organizationDetail
3s===this.organizationDetails&&e.serialNumberScope===this.serialNumberScope&&e.serialNumberStrategy===this.serialNumberStrategy&&e.vat===this.vat&&d(e.feeProtocol,this.feeProtocol)&&e.canEmployeeEditPaymentSettings===this.canEmployeeEditPaymentSettings&&d(e.paymentAccount,this.paymentAccount)&&e.paymentType===this.paymentType&&P(e.activePaymentMethods,this.activePaymentMethods)&&e.maxModifierPercentage===this.maxModifierPercentage&&d(e.maxModifierPrice,this.maxModifierPrice)&&e.ticketPrintFormat===this.ticketPrintFormat&&P(e.defaultEventClassification,this.defaultEventClassification)&&P(e.serialNumberLimits,this.serialNumberLimits)&&e.allowLocalizedInputFields===this.allowLocalizedInputFields&&e.organizationUniqueRegistrationCode===this.organizationUniqueRegistrationCode&&d(e.customInfo,this.customInfo)&&d(e.customImageInfo,this.customImageInfo)&&e.qrCodeSeparator===this.qrCodeSeparator&&e.allowPredefinedProtocolTickets===this.allowPredefinedProtocolTickets&&e.allowOfflineOrderReceipts===this.allowOfflineOrderReceipts&&e.eventBookingStrategy===this.eventBookingStrategy}copyWith({eventDefaultLanguage:e=this.eventDefaultLanguage,defaultFacebookPixelId:t=this.defaultFacebookPixelId,defaultTikTokPixelId:s=this.defaultTikTokPixelId,defaultGoogleTagManagerId:a=this.defaultGoogleTagManagerId,organizationLogo:o=Z(this.organizationLogo),eventRules:u=this.eventRules,organizationDetails:c=this.organizationDetails,serialNumberScope:l=this.serialNumberScope,serialNumberStrategy:h=this.serialNumberStrategy,vat:p=this.vat,feeProtocol:I=Z(this.feeProtocol),canEmployeeEditPaymentSettings:v=this.canEmployeeEditPaymentSettings,paymentAccount:E=Z(this.paymentAccount),paymentType:w=this.paymentType,activePaymentMethods:S=Te(this.activePaymentMethods),maxModifierPercentage:R=this.maxModifierPercentage,maxModifierPrice:x=Z(this.maxModifierPrice),ticketPrintFormat:N=this.ticketPrintFormat,defaultEventClassification:O=Te(this.defaultEventClassification),serialNumberLimits:A=et(this.serialNumberLimits),allowLocalizedInputFields:M=this.allowLocalizedInputFields,organizationUniqueRegistrationCode:C=this.organizationUniqueRegistrationCode,customInfo:H=Z(this.customInfo),customImageInfo:B=Z(this.customImageInfo),qrCodeSeparator:U=this.qrCodeSeparator,allowPredefinedProtocolTickets:V=this.allowPredefinedProtocolTickets,allowOfflineOrderReceipts:q=this.allowOfflineOrderReceipts,eventBookingStrategy:L=this.eventBookingStrategy}={}){return n.create({eventDefaultLanguage:e,defaultFacebookPixelId:t,defaultTikTokPixelId:s,defaultGoogleTagManagerId:a,organizationLogo:o,eventRules:u,organizationDetails:c,serialNumberScope:l,serialNumberStrategy:h,vat:p,feeProtocol:I,canEmployeeEditPaymentSettings:v,paymentAccount:E,paymentType:w,activePaymentMethods:S,maxModifierPercentage:R,maxModifierPrice:x,ticketPrintFormat:N,defaultEventClassification:O,serialNumberLimits:A,allowLocalizedInputFields:M,organizationUniqueRegistrationCode:C,customInfo:H,customImageInfo:B,qrCodeSeparator:U,allowPredefinedProtocolTickets:V,allowOfflineOrderReceipts:q,eventBookingStrategy:L})}}return n.TYPE_ID="dcc8890db3aa45238df7c3c014998876",n.SCHEMA_VERSION=30,n})(),K0=class extends f{build(i,e){return Cl.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){var t,s,a,o,u,c,l,h,p,I,v,E,w,S,R,x,N,O,A;this.migrateEnumList(e,"defaultEventClassification",_s),this.migrateEnum(e,"ticketPrintFormat",gs,gs.Boca6x11),this.migrateEnum(e,"qrCodeSeparator",kn,kn.Dot);let M=r.getVersionRange(e);if(M.contains(Cl.SCHEMA_VERSION))return e;if(M.isGreaterThan(Cl.SCHEMA_VERSION))return null;let C=M.to;if(C<2&&((t=e.organizationName)!==null&&t!==void 0||(e.organizationName=""),(s=e.registrationCode)!==null&&s!==void 0||(e.registrationCode=""),C=2),C<3&&(C=3),C<4&&((a=e.defaultFacebookPixelId)!==null&&a!==void 0||(e.defaultFacebookPixelId=r.get(e,"defaultPixelId")),(o=e.defaultTikTokPixelId)!==null&&o!==void 0||(e.defaultTikTokPixelId=""),C=4),C<5&&((u=e.importantInfo)!==null&&u!==void 0||(e.importantInfo=""),(c=e.organizationDetails)!==null&&c!==void 0||(e.organizationDetails=""),C=5),C<6&&(C=6),C<7&&((l=e.serialNumberScope)!==null&&l!==void 0||(e.serialNumberScope=m(vt.Event)),(h=e.serialNumberStrategy)!==null&&h!==void 0||(e.serialNumberStrategy=m(hi.AssignByTicketType)),C=7),C<8&&((p=e.vatPercent)!==null&&p!==void 0||(e.vatPercent=27),C=8),C<9){if(k(e.vat)){let H=r.getNumber(e,"vatPercent"),B=Ux(Math.trunc(H));e.vat=(I=m(B))!==null&&I!==void 0?I:te.Vat_27}C=9}if(C<10&&(C=10),C<11&&(C=11),C<12&&(C=12),C<13&&((v=e.canEmployeeEditPaymentSettings)!==null&&v!==void 0||(e.canEmployeeEditPaymentSettings=!1),C=13),C<14){let H=i.fromDataOrNull(r.getRecordOrNull(e,"paymentSettings"));H!=null?(e.paymentAccount=i.toDataOrNull((E=H.paymentAccount)!==null&&E!==void 0?E:null),e.paymentType=m(H.paymentMethods.length>0?H.paymentMethods[0]:pe.OnDelivery)):(e.paymentAccount=null,e.paymentType=m(pe.OnDelivery)),C=14}if(C<15&&((w=e.eventRules)!==null&&w!==void 0||(e.eventRules=e.importantInfo),C=15),
3C<16&&((S=e.ticketPrintFormat)!==null&&S!==void 0||(e.ticketPrintFormat=m(gs.Boca6x11)),C=16),C<17&&((R=e.defaultEventClassification)!==null&&R!==void 0||(e.defaultEventClassification=[]),C=17),C<18&&(C=18),C<19&&((x=e.allowLocalizedInputFields)!==null&&x!==void 0||(e.allowLocalizedInputFields=!1),C=19),C<20&&((N=e.defaultGoogleTagManagerId)!==null&&N!==void 0||(e.defaultGoogleTagManagerId=""),C=20),C<21&&((O=e.organizationUniqueRegistrationCode)!==null&&O!==void 0||(e.organizationUniqueRegistrationCode=""),C=21),C<22){let H=y(r.getString(e,"serialNumberStrategy"),hi),B=ud.fromLegacy(H);r.set(e,"serialNumberStrategy",m(B)),C=22}return C<23&&(C=23),C<24&&(C=24),C<25&&(r.setIfNullOrUndefined(e,"qrCodeSeparator",m(kn.Dot)),C=25),C<26&&(r.setIfNullOrUndefined(e,"allowPredefinedProtocolTickets",!1),C=26),C<27&&(r.setIfNullOrUndefined(e,"allowOfflineOrderReceipts",!1),C=27),C<28&&(r.setIfNullOrUndefined(e,"eventBookingStrategy",m(yt.Tickets)),C=28),C<29&&(C=29),C<30&&((A=e.activePaymentMethods)!==null&&A!==void 0||(e.activePaymentMethods=Object.values(Fe).map(m)),C=30),e.$schema_version=D.encodedExactly(C),e}},PC=(()=>{class n extends b{constructor(e){super(),this.organizationInfo=e}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.organizationInfo)}static fromMap(e,t){return this.create({organizationInfo:r.getString(t,"organizationInfo")})}toMap(e){return{organizationInfo:this.organizationInfo}}clone(){return this.copyWith()}isSame(e){return e===this?!0:e.organizationInfo===this.organizationInfo}copyWith({organizationInfo:e=this.organizationInfo}={}){return n.create({organizationInfo:e})}}return n.TYPE_ID="196f8ef6d29a41a9bedb64b5ced8eebe",n})(),Z0=class extends f{build(i,e){return PC.fromMap(i,e)}};var to=class n{constructor(i,e,t,s){this.sessionId=i,this.seats=e,this.creationDate=t,this.expirationDate=s}static create(i){var e,t;let s=(e=i.creationDate)!==null&&e!==void 0?e:fe.now(),a=(t=i.expirationDate)!==null&&t!==void 0?t:s.add(15,"minutes");return new n(i.sessionId,i.seats,s,a)}isValidForSession(i,e){return e??(e=fe.now()),i!==this.sessionId&&e.isBefore(this.expirationDate)}isExpired(i){return i??(i=fe.now()),this.expirationDate.isBefore(i)}clone(){return new n(this.sessionId,Te(this.seats),g.cloneDate(this.creationDate),g.cloneDate(this.expirationDate))}isSame(i){return this===i?!0:i.sessionId===this.sessionId&&P(i.seats,this.seats)&&i.creationDate===this.creationDate&&i.expirationDate===this.expirationDate}static verifyType(i){return i instanceof n}static assertType(i){return i instanceof n}},Pd=class n{constructor(i,e,t){this.sessionId=i,this.seats=e,this.creationDate=t}static create(i){var e;let t=(e=i.creationDate)!==null&&e!==void 0?e:(0,oe.default)();return new n(i.sessionId,i.seats,t)}isValidForSession(i,e){return i!==this.sessionId}isExpired(i){return!1}clone(){return new n(this.sessionId,Te(this.seats),g.cloneDate(this.creationDate))}isSame(i){return this===i?!0:i.sessionId===this.sessionId&&P(i.seats,this.seats)&&i.creationDate===this.creationDate}static verifyType(i){return i instanceof n}static assertType(i){return i instanceof n}},no=class n{constructor(i,e,t,s,a){this.sessionId=i,this.seats=e,this.creationDate=t,this.expirationDate=s,this.reservationId=a}static create(i){var e,t;let s=(e=i.creationDate)!==null&&e!==void 0?e:(0,oe.default)();return new n(i.sessionId,i.seats,s,(t=i.expirationDate)!==null&&t!==void 0?t:null,i.reservationId)}isValidForSession(i,e){return i!==this.sessionId}isExpired(i){var e,t;return i??(i=fe.now()),(t=(e=this.expirationDate)===null||e===void 0?void 0:e.isBefore(i))!==null&&t!==void 0?t:!1}clone(){return new n(this.sessionId,Te(this.seats),g.cloneDate(this.creationDate),g.cloneDateOrNull(this.expirationDate),this.reservationId)}isSame(i){return this===i?!0:i.sessionId===this.sessionId&&P(i.seats,this.seats)&&i.creationDate===this.creationDate&&i.expirationDate===this.expirationDate&&i.reservationId===this.reservationId}static verifyType(i){return i instanceof n}static assertType(i){return i instanceof n}},io=class n{constructor(i,e,t,s){this.seats=i,this.locks=e,this.templateId=t,this.creationDate=s}static create(i){var e;let t=(e=i.creationDate)!==null&&e!==void 0?e:(0,oe.default)();return new n(i.seats,i.locks,i.templateId,t)}isExpired(i){return!1}isValidForSession(i,e){return!0}clone(){return new n(Te(this.seats),Te(this.locks),this.templateId,g.cloneDate(this.creationDate))}isSame(i){return this===i?!0:P(i.seats,this.seats)&&P(i.locks,this.locks)&&i.templateId===this.templateId&&i.creationDate===this.creationDate}static verifyType(i){return i instanceof n}static assertType(i){return i instanceof n}},Ad=class n{constructor(i,e){this.seats=i,this.creationDate=e}static create(i){return new n(i.seats,i.creationDate)}isValidForSession(i,e){return!0}isExpired(i){return!1}clone(){return new n(Te(this.seats),g.cloneDate(this.creationDate))}isSame(i){return i===this?!0:P(i.seats,this.seats)&&i.creationDate===this.creationDate}static verifyType(i){return i instanceof n}static assertType(i){return i instanceof n}},Cd=(()=>{class n{static serialize(e){return this.asBytes(e)}static deserialize(e){let t=Gr.fromBytes(e),s=t.readByte();switch(s){case 1:return this.fromBytes_v1(t);case 2:return this.fromBytes_v2(t);case 3:return this.fromBytes_v3(t);case 4:return this.fromBytes(t)}throw new ie(`Seat selection cannot be deserialized because format ${s} is unknown`)}static asBytes(e){let t=new vs,s=2;
3for(let o=0;o<e.length;o++){let u=e[o];io.assertType(u)&&u.locks.length>0&&(s=Math.max(s,3)),no.assertType(u)&&u.expirationDate!=null&&(s=Math.max(s,4))}let a={passLocks:s>=3,expirationDate:s>=4};t.writeByte(s),t.writeInt32(e.length);for(let o=0;o<e.length;o++)this.writeSeatSelectionEntry(t,e[o],a);return t.toBytes()}static writeSeatSelectionEntry(e,t,s){if(t instanceof to)this.writeTemporarySeatSelectionEntry(e,t,s);else if(t instanceof Pd)this.writePermanentSeatSelectionEntry(e,t,s);else if(t instanceof no)this.writeReservedSeatSelectionEntry(e,t,s);else if(t instanceof io)this.writePassSeatSelectionEntry(e,t,s);else if(t instanceof Ad)this.writeArtificialSeatSelectionEntry(e,t,s);else throw new ie("Seat selection entry cannot be serialized because type is unknown")}static writeTemporarySeatSelectionEntry(e,t,s){e.writeByte(n.TEMPORARY_SEAT_SELECTION_ENTRY_TYPE_ID),this.writeUniqueId(e,t.sessionId,De.kAuthIdLength),e.writeInt32(t.creationDate.unix()),e.writeInt32(t.expirationDate.unix()),e.writeInt32(t.seats.length);for(let a=0;a<t.seats.length;a++)e.writeInt32(t.seats[a])}static writePermanentSeatSelectionEntry(e,t,s){e.writeByte(n.PERMANENT_SEAT_SELECTION_ENTRY_TYPE_ID),this.writeUniqueId(e,t.sessionId,De.kAuthIdLength),e.writeInt32(t.creationDate.unix()),e.writeInt32(t.seats.length);for(let a=0;a<t.seats.length;a++)e.writeInt32(t.seats[a])}static writeReservedSeatSelectionEntry(e,t,s){e.writeByte(n.RESERVED_SEAT_SELECTION_ENTRY_TYPE_ID),this.writeUniqueId(e,t.sessionId,De.kAuthIdLength),this.writeUniqueId(e,t.reservationId,De.kAuthIdLength),e.writeInt32(t.creationDate.unix()),s.expirationDate===!0&&e.writeInt32(t.expirationDate!=null?t.expirationDate.unix():0),e.writeInt32(t.seats.length);for(let a=0;a<t.seats.length;a++)e.writeInt32(t.seats[a])}static writePassSeatSelectionEntry(e,t,s){e.writeByte(n.PASS_SEAT_SELECTION_ENTRY_TYPE_ID),this.writeUniqueId(e,t.templateId,De.kAuthIdLength),e.writeInt32(t.creationDate.unix()),e.writeInt32(t.seats.length);for(let a=0;a<t.seats.length;a++)e.writeInt32(t.seats[a]);if(s.passLocks){e.writeInt32(t.locks.length);for(let a=0;a<t.locks.length;a++)e.writeInt32(t.locks[a])}}static writeArtificialSeatSelectionEntry(e,t,s){e.writeByte(n.ARTIFICIAL_SEAT_SELECTION_ENTRY_TYPE_ID),e.writeInt32(t.creationDate.unix()),e.writeInt32(t.seats.length);for(let a=0;a<t.seats.length;a++)e.writeInt32(t.seats[a])}static fromBytes_v2(e){let t=[],s=e.readInt32();for(let a=0;a<s;a++)t.push(this.readSeatSelectionEntry(e,{passLocks:!1}));return t}static fromBytes_v3(e){let t=[],s=e.readInt32();for(let a=0;a<s;a++)t.push(this.readSeatSelectionEntry(e,{passLocks:!0}));return t}static fromBytes(e){let t=[],s=e.readInt32();for(let a=0;a<s;a++)t.push(this.readSeatSelectionEntry(e,{passLocks:!0,expirationDate:!0}));return t}static readSeatSelectionEntry(e,t){let s=e.readByte();switch(s){case n.TEMPORARY_SEAT_SELECTION_ENTRY_TYPE_ID:return this.readTemporarySeatSelectionEntry(e,t);case n.PERMANENT_SEAT_SELECTION_ENTRY_TYPE_ID:return this.readPermanentSeatSelectionEntry(e,t);case n.RESERVED_SEAT_SELECTION_ENTRY_TYPE_ID:return this.readReservedSeatSelectionEntry(e,t);case n.PASS_SEAT_SELECTION_ENTRY_TYPE_ID:return this.readPassSeatSelectionEntry(e,t);case n.ARTIFICIAL_SEAT_SELECTION_ENTRY_TYPE_ID:return this.readArtificialSeatSelectionEntry(e,t);default:throw new ie(`Seat selection entry cannot be deserialized because type ID ${s} is unknown`)}}static readTemporarySeatSelectionEntry(e,t){let s=this.readUniqueId(e,De.kAuthIdLength),a=e.readInt32(),o=e.readInt32(),u=e.readInt32(),c=[];for(let l=0;l<u;l++)c.push(e.readInt32());return new to(s,c,oe.default.unix(a),oe.default.unix(o))}static readPermanentSeatSelectionEntry(e,t){let s=this.readUniqueId(e,De.kAuthIdLength),a=e.readInt32(),o=e.readInt32(),u=[];for(let c=0;c<o;c++)u.push(e.readInt32());return new Pd(s,u,oe.default.unix(a))}static readReservedSeatSelectionEntry(e,t){let s=this.readUniqueId(e,De.kAuthIdLength),a=this.readUniqueId(e,De.kAuthIdLength),o=e.readInt32(),u=t.expirationDate===!0?e.readInt32():0,c=e.readInt32(),l=[];for(let h=0;h<c;h++)l.push(e.readInt32());return new no(s,l,oe.default.unix(o),u>0?oe.default.unix(u):null,a)}static readPassSeatSelectionEntry(e,t){let s=this.readUniqueId(e,De.kAuthIdLength),a=e.readInt32(),o=e.readInt32(),u=[],c=[];for(let l=0;l<o;l++)u.push(e.readInt32());if(t.passLocks){let l=e.readInt32();for(let h=0;h<l;h++)c.push(e.readInt32())}return io.create({templateId:s,seats:u,locks:c,creationDate:oe.default.unix(a)})}static readArtificialSeatSelectionEntry(e,t){let s=e.readInt32(),a=e.readInt32(),o=[];for(let u=0;u<a;u++)o.push(e.readInt32());return Ad.create({seats:o,creationDate:oe.default.unix(s)})}static fromBytes_v1(e){let t=[],s=e.readByte();for(let a=0;a<s;a++)t.push(this.readSeatSelectionEntry_v1(e));return t}static readSeatSelectionEntry_v1(e){let t=this.readUniqueId(e,De.kAutoIdLength),s=e.readInt32(),a=e.readInt32(),o=e.readInt32(),u=[];for(let c=0;c<o;c++)u.push(e.readInt32());return new to(t,u,oe.default.unix(s),oe.default.unix(a))}static writeUniqueId(e,t,s){let a=0;for(let o=0;o<t.length;o++)e.writeByte(t.charCodeAt(o)),a++;for(;a<s;)e.writeByte(0),a++}static readUniqueId(e,t){let s=[];for(let a=0;a<t;a++){let o=e.readByte();o>0&&s.push(o)}return String.fromCharCode(...s)}}return n.TEMPORARY_SEAT_SELECTION_ENTRY_TYPE_ID=0,n.PERMANENT_SEAT_SELECTION_ENTRY_TYPE_ID=1,n.RESERVED_SEAT_SELECTION_ENTRY_TYPE_ID=2,n.PASS_SEAT_SELECTION_ENTRY_TYPE_ID=3,n.ARTIFICIAL_SEAT_SELECTION_ENTRY_TYPE_ID=4,n})(),AC=(()=>{class n extends b{constructor(e,t,s){super(),this.businessRef=e,this.templateId=t,this.entries=s}get $typeId(){return n.TYPE_ID}static empty(e,t){return new n(e,t,[])}static fromMap(e,t){return new n(j.mustDecode(r.get(t,"businessRef")),r.get(t,"templateId"),Cd.deserialize(e.fromBinaryBlob(r.getRaw(t,"entries"))))}toMap(e){return{businessRef:this.businessRef.encode(),templateId:this.templateId,entr
3ies:e.toBinaryBlob(Cd.serialize(this.entries))}}clone(){return new n(this.businessRef.clone(),this.templateId,ue(this.entries))}isSame(e){return e===this?!0:e.templateId===this.templateId&&P(e.entries,this.entries,d)&&d(e.businessRef,this.businessRef)}}return n.TYPE_ID="ade3aa178b604054a80b39067c9d5c29",n})(),X0=class extends f{build(i,e){return AC.fromMap(i,e)}},CC=(()=>{class n extends b{constructor(e,t,s){super(),this.eventId=e,this.businessRef=t,this.entries=s}get $typeId(){return n.TYPE_ID}static empty(e,t){return new n(t,e,[])}static fromMap(e,t){return new n(r.get(t,"eventId"),j.mustDecode(r.get(t,"businessRef")),Cd.deserialize(e.fromBinaryBlob(r.getRaw(t,"entries"))))}toMap(e){return{eventId:this.eventId,businessRef:this.businessRef.encode(),entries:e.toBinaryBlob(Cd.serialize(this.entries))}}clone(){return new n(this.eventId,this.businessRef.clone(),ue(this.entries))}isSame(e){return e===this?!0:e.eventId===this.eventId&&P(e.entries,this.entries,d)&&d(e.businessRef,this.businessRef)}}return n.TYPE_ID="f010766de7bf43a0b654094a9118b1e2",n})(),Q0=class extends f{build(i,e){return CC.fromMap(i,e)}},Br=class{static fromIntegersToBytes(i){let e=new vs((i.length+1)*vs.kBytesPerInt32);e.writeInt32(i.length);for(let t=0;t<i.length;t++)e.writeInt32(i[t]);return e.toBytes()}static fromBytesToIntegers(i){let e=Gr.fromBytes(i),t=e.readInt32(),s=[];for(let a=0;a<t;a++)s.push(e.readInt32());return s}},Mo=class extends b{},kl=(()=>{class n extends Mo{constructor(e,t,s,a,o){super(),this.eventId=e,this.businessRef=t,this.reservedSeats=s,this.soldTickets=a,this.reservedTickets=o,this.strategy=Jr.Legacy}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}getSeatingModule(){return this}getTicketCount(e){return this.getSoldTicketCount(e)+this.getReservedTicketCount(e)}isSoldOut(e){return e.quantity.isInfinite?!1:this.getTicketCount(e.uniqueId)>=e.quantity.value}isAnySeatReserved(e){for(let t=0;t<e.length;t++)if(this.reservedSeats.has(e[t]))return!0;return!1}isSeatReserved(e){return this.reservedSeats.has(e)}getSoldTicketCount(e){var t;return(t=this.soldTickets.get(e))!==null&&t!==void 0?t:0}getReservedTicketCount(e){var t;return(t=this.reservedTickets.get(e))!==null&&t!==void 0?t:0}reserveSeat(e){return this.reservedSeats.has(e)?!1:(this.reservedSeats.add(e),!0)}freeSeat(e){return this.reservedSeats.has(e)?(this.reservedSeats.delete(e),!0):!1}reserveTicket(e){let t=e.seatingOptions;if(_(t)){if(this.reservedSeats.has(t.seatId))return!1}else if(this.isSoldOut(e.template))return!1;let s=this.getReservedTicketCount(e.templateId);return this.reservedTickets.set(e.templateId,s+1),_(t)&&this.reservedSeats.add(t.seatId),!0}reserveTicketWithoutLimit(e){let t=e.seatingOptions,s=e.template.uniqueId;if(_(t)&&this.reservedSeats.has(t.seatId))return!1;let a=this.getReservedTicketCount(s);return this.reservedTickets.set(s,a+1),_(t)&&this.reservedSeats.add(t.seatId),!0}addReservationWithoutLimit(e,t){if(Number.isSafeInteger(t)===!1)throw new ke("You are trying to reserve a non-integer amount of tickets.");if(t<0)throw new ke("You are trying to reserve a negative amount of tickets.");if(t===0)return;let s=this.getReservedTicketCount(e);this.reservedTickets.set(e,s+t)}removeReservation(e,t){if(Number.isSafeInteger(t)===!1)throw new ke("You are trying to remove a non-integer amount of tickets.");if(t<0)throw new ke("You are trying to remove a negative amount of tickets.");if(t===0)return;let s=this.getReservedTicketCount(e);if(s<t)throw new ke("You are trying to remove more tickets than you have reserved.");this.reservedTickets.set(e,s-t)}reserveAndSell(e){let t=this.reserveTicket(e);return t&&this.onTicketSold(e),t}reserveAndSellWithoutLimit(e){let t=this.reserveTicketWithoutLimit(e);return t&&this.onTicketSold(e),t}onTicketAborted(e){let t=this.getReservedTicketCount(e.templateId);if(t<=0)throw new ke("You are trying to refund tickets that have not been reserved.");this.reservedTickets.set(e.templateId,t-1);let s=e.seatingOptions;_(s)&&this.reservedSeats.delete(s.seatId)}onTicketRefundedOrCanceled(e){let t=this.getSoldTicketCount(e.templateId);if(t<=0)throw new ke("You are trying to refund tickets that have not been sold.");this.soldTickets.set(e.templateId,t-1);let s=e.seatingOptions;_(s)&&this.reservedSeats.delete(s.seatId)}onTicketSold(e){let t=this.getReservedTicketCount(e.templateId);if(t<=0)throw new ke(`You are trying to sell tickets that have not been reserved for template {${e.templateId}} of event {${e.eventId}} of {${e.businessRef}}.`);let s=this.getSoldTicketCount(e.templateId);this.reservedTickets.set(e.templateId,t-1),this.soldTickets.set(e.templateId,s+1)}static empty(e,t){return new n(t,e,new Set,new Map,new Map)}static fromMap(e,t){let s=r.getRaw(t,"reservedSeats"),a=_(s)?Br.fromBytesToIntegers(e.fromBinaryBlob(s)):[];return new n(r.get(t,"eventId"),j.mustDecode(r.get(t,"businessRef")),new Set(a
3),r.getMap(t,"soldTickets",(o,u)=>({key:o,value:Number(u)})),r.getMap(t,"reservedTickets",(o,u)=>({key:o,value:Number(u)})))}toMap(e){return{eventId:this.eventId,businessRef:this.businessRef.encode(),reservedSeats:e.toBinaryBlob(Br.fromIntegersToBytes([...this.reservedSeats])),soldTickets:se(this.soldTickets,(t,s)=>({key:t,value:s})),reservedTickets:se(this.reservedTickets,(t,s)=>({key:t,value:s}))}}clone(){return new n(this.eventId,this.businessRef.clone(),kR(this.reservedSeats),ee(this.soldTickets,e=>e),ee(this.reservedTickets,e=>e))}isSame(e){return e===this?!0:re(e.soldTickets,this.soldTickets,(t,s)=>t===s)&&re(e.reservedTickets,this.reservedTickets,(t,s)=>t===s)&&e.eventId===this.eventId&&P([...e.reservedSeats],[...this.reservedSeats])&&d(e.businessRef,this.businessRef)}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="36a6cd5fd79340329c414c3e28f94206",n.SCHEMA_VERSION=3,n})(),ew=class extends f{build(i,e){return kl.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(kl.SCHEMA_VERSION))return e;if(t.isGreaterThan(kl.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(s=2),s<3&&(s=3,e.reservedSeats=e.seats),e.$schema_version=D.encodedExactly(s),e}},tw=class n{constructor(i,e,t){this.templateId=i,this.limit=e,this.shards=t}static create(i){return new n(i.templateId,i.limit,i.shards)}static fromMap(i){return this.create({templateId:r.getString(i,"templateId"),limit:r.getNumber(i,"limit"),shards:r.getList(i,"shards",e=>K.decodeString(e))})}toMap(){return{templateId:this.templateId,limit:this.limit,shards:this.shards}}clone(){return n.create({templateId:this.templateId,limit:this.limit,shards:Te(this.shards)})}isSame(i){return i===this?!0:i.templateId===this.templateId&&i.limit===this.limit&&P(i.shards,this.shards)}},kC=(()=>{class n extends Mo{constructor(e,t,s,a){super(),this.businessRef=e,this.eventId=t,this.shardGroups=s,this.reservedTickets=a}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.businessRef,e.eventId,e.shardGroups,e.reservedTickets)}get strategy(){return Jr.Sharded}getSeatingModule(){return null}getTicketCount(e){var t;return(t=this.reservedTickets.get(e))!==null&&t!==void 0?t:0}isSoldOut(e){return e.quantity.isInfinite?!1:this.getTicketCount(e.uniqueId)>=e.quantity.value}static fromMap(e,t){return this.create({businessRef:j.mustDecode(r.getString(t,"businessRef")),eventId:r.getString(t,"eventId"),shardGroups:r.getMap(t,"shardGroups",(s,a)=>({key:s,value:tw.fromMap(K.decodeRecord(a))})),reservedTickets:r.getMap(t,"reservedTickets",(s,a)=>({key:s,value:K.decodeNumber(a)}))})}toMap(e){return{businessRef:this.businessRef.encode(),eventId:this.eventId,shardGroups:se(this.shardGroups,(t,s)=>({key:t,value:s.toMap()})),reservedTickets:se(this.reservedTickets,(t,s)=>({key:t,value:s}))}}clone(){return n.create({businessRef:this.businessRef.clone(),eventId:this.eventId,shardGroups:ee(this.shardGroups,e=>e.clone()),reservedTickets:ee(this.reservedTickets)})}isSame(e){return e===this?!0:d(e.businessRef,this.businessRef)&&e.eventId===this.eventId&&re(e.shardGroups,this.shardGroups,(t,s)=>d(t,s))&&re(e.reservedTickets,this.reservedTickets)}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="1f40ccc0ecda4da893d8aad86048819c",n})(),nw=class extends f{build(i,e){return kC.fromMap(i,e)}},_C=(()=>{class n extends Mo{constructor(e,t,s,a){super(),this.businessRef=e,this.eventId=t,this.reservedSeats=s,this.reservedTickets=a,this.strategy=Jr.Standard}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.businessRef,e.eventId,e.reservedSeats,e.reservedTickets)}static empty(e){return new n(e.businessRef,e.eventId,new Set,new Map)}getSeatingModule(){return this}getTicketCount(e){var t;return(t=this.reservedTickets.get(e))!==null&&t!==void 0?t:0}isSoldOut(e){return e.quantity.isInfinite?!1:this.getTicketCount(e.uniqueId)>=e.quantity.value}isAnySeatReserved(e){return e.some(t=>this.reservedSeats.has(t))}isSeatReserved(e){return this.reservedSeats.has(e)}static fromMap(e,t){let s=r.getRaw(t,"reservedSeats"),a=_(s)?Br.fromBytesToIntegers(e.fromBinaryBlob(s)):[];return this.create({businessRef:j.mustDecode(r.getString(t,"businessRef")),eventId:r.getString(t,"eventId"),reservedSeats:new Set(a
3),reservedTickets:r.getMap(t,"reservedTickets",(o,u)=>({key:o,value:K.decodeNumber(u)}))})}toMap(e){return{businessRef:this.businessRef.encode(),eventId:this.eventId,reservedSeats:e.toBinaryBlob(Br.fromIntegersToBytes([...this.reservedSeats])),reservedTickets:se(this.reservedTickets,(t,s)=>({key:t,value:s}))}}clone(){return n.create({businessRef:this.businessRef.clone(),eventId:this.eventId,reservedSeats:kR(this.reservedSeats),reservedTickets:ee(this.reservedTickets,e=>e)})}isSame(e){return e===this?!0:d(e.businessRef,this.businessRef)&&e.eventId===this.eventId&&P([...e.reservedSeats],[...this.reservedSeats])&&re(e.reservedTickets,this.reservedTickets,(t,s)=>t===s)}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="95651766429f479792a02ab53bf316b3",n})(),iw=class extends f{build(i,e){return _C.fromMap(i,e)}},xC=(()=>{class n extends b{constructor(e,t,s){super(),this.businessRef=e,this.eventId=t,this.soldTickets=s}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.businessRef,e.eventId,e.soldTickets)}static empty(e){return new n(e.businessRef,e.eventId,new Map)}getTicketCount(e){var t;return(t=this.soldTickets.get(e))!==null&&t!==void 0?t:0}static fromMap(e,t){return this.create({businessRef:j.mustDecode(r.getString(t,"businessRef")),eventId:r.getString(t,"eventId"),soldTickets:r.getMap(t,"soldTickets",(s,a)=>({key:s,value:K.decodeNumber(a)}))})}toMap(e){return{businessRef:this.businessRef.encode(),eventId:this.eventId,soldTickets:se(this.soldTickets,(t,s)=>({key:t,value:s}))}}clone(){return n.create({businessRef:this.businessRef.clone(),eventId:this.eventId,soldTickets:ee(this.soldTickets)})}isSame(e){return e===this?!0:d(e.businessRef,this.businessRef)&&e.eventId===this.eventId&&re(e.soldTickets,this.soldTickets)}}return n.TYPE_ID="50ee3d9c8dca44dfaf1751f3745afdab",n})(),sw=class extends f{build(i,e){return xC.fromMap(i,e)}},FC=(()=>{class n extends b{constructor(e,t,s,a){super(),this.uniqueId=e,this.templateId=t,this.limit=s,this.count=a}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.uniqueId,e.templateId,e.limit,e.count)}static fromMap(e,t){return this.create({uniqueId:r.getString(t,"uniqueId"),templateId:r.getString(t,"templateId"),limit:r.getNumber(t,"limit"),count:r.getNumber(t,"count")})}toMap(e){return{uniqueId:this.uniqueId,templateId:this.templateId,limit:this.limit,count:this.count}}clone(){return n.create({uniqueId:this.uniqueId,templateId:this.templateId,limit:this.limit,count:this.count})}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.templateId===this.templateId&&e.limit===this.limit&&e.count===this.count}}return n.TYPE_ID="b74068ae9324a9da20826cf665ebf30",n})(),rw=class extends f{build(i,e){return FC.fromMap(i,e)}};var ei=(()=>{class n extends b{constructor(e,t,s=!1){super(),this.dayOfWeek=e,this.times=t,this.closed=s}get $typeId(){return n.TYPE_ID}get hasAnyHoursDefined(){return!this.closed&&this.times.length!==0}static nineToFive(e){return new n(e,[new zS(new Pt(9,0),new Pt(17,0))],!1)}static closed(e){return new n(e,[],!0)}static fromMap(e,t){return new n(r.get(t,"dayOfWeek"),r.getList(t,"times",s=>e.fromData(s)),r.get(t,"closed"))}toMap(e){return{dayOfWeek:m(this.dayOfWeek),closed:this.closed,times:this.times.map(t=>e.toData(t))}}clone(){return new n(this.dayOfWeek,this.times.map(e=>e.clone()),this.closed)}isSame(e){return e===this?!0:e.dayOfWeek===this.dayOfWeek&&e.closed===this.closed&&P(e.times,this.times,d)}}return n.TYPE_ID="42e4b37f536e4924ac4c0cbb2f0c6281",n})(),aw=class extends f{build(i,e){return ei.fromMap(i,e)}},qC=(()=>{class n extends b{constructor(e=ei.nineToFive(xe.Monday),t=ei.nineToFive(xe.Tuesday),s=ei.nineToFive(xe.Wednesday),a=ei.nineToFive(xe.Thursday),o=ei.nineToFive(xe.Friday),u=ei.closed(xe.Saturday),c=ei.closed(xe.Sunday)){super(),this.monday=e,this.tuesday=t,this.wednesday=s,this.thursday=a,this.friday=o,this.saturday=u,this.sunday=c}get $typeId(){return n.TYPE_ID}get hasAnyHoursDefined(){return this.monday.hasAnyHoursDefined||this.tuesday.hasAnyHoursDefined||this.wednesday.hasAnyHoursDefined||this.thursday.hasAnyHoursDefined||this.friday.hasAnyHoursDefined||this.saturday.hasAnyHoursDefined||this.sunday.hasAnyHoursDefined}static fromMap(e,t){return new n(e.fromData(r.getRaw(t,"monday")),e.fromData(r.getRaw(t,"tuesday")),e.fromData(r.getRaw(t,"wednesday")),e.fromData(r.getRaw(t,"thursday")),e.fromData(r.getRaw(t,"friday")),e.fromData(r.getRaw(t,"saturday")),e.fromData(r.getRaw(t,"sunday")))}toMap(e){return{monday:e.toData(this.monday),tuesday:e.toData(this.tuesday),wednesday:e.toData(this.wednesday),thursday:e.toData(this.thursday),friday:e.toData(this.friday),saturday:e.toData(this.saturday),sunday:e.toData(this.sunday)}}clone(){return new n(this.monday.clone(),this.tuesday.clone(),this.wednesday.clone(),this.thursday.clone(),this.friday.clone(),this.saturday.clone(),this.sunday.clone())}isSame(e){return e===this?!0:d(e.monday,this.monday)&&d(e.tuesday,this.tuesday)&&d(e.wednesday,this.wednesday)&&d(e.thursday,this.thursday)&&d(e.friday,this.friday)&&d(e.saturday,this.saturday)&&d(e.sunday,this.sunday)}copyWithDay(e){return new n(e.dayOfWeek===xe.Monday?e:this.monday,e.dayOfWeek===xe.Tuesday?e:this.tuesday,e.dayOfWeek===xe.Wednesday?e:this.wednesday,e.dayOfWeek===xe.Thursday?e:this.thursday,e.dayOfWeek===xe.Friday?e:this.friday,e.dayOfWeek===xe.Saturday?e:this.saturday,e.dayOfWeek===xe.Sunday?e:this.sunday)}atDayOfWeek(e){switch(e){case xe.Monday:return this.monday;case xe.Tuesday:return this.tuesday;case xe.Wednesday:return this.wednesday;case xe.Thursday:return this.thursday;case xe.Friday:return this.friday;case xe.Saturday:return this.saturday;case xe.Sunday:return this.sunday}}}return n.TYPE_ID="c3c0a7e5a6d844b09fbcea158a3e0139",n})(),ow=class extends f{build(i,e){return qC.fromMap(i,e)}},_l=(()=>{class n extends b{constructor(e,t,s,a,o=null){if(super(),this.uniqueId=e,this.eventId=t,this.ticketId=s,this.discount=a,this.description=o,a<0||a>100)throw new Error("Invalid discount value")}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static fromMap(e,t){return new n(r.get(e,"uniqueId"),r.get(e,"eventId"),r.getListOrNull(e,"ticketId",s=>s),r.get(e,"discount"),r.getOrNull(e,"description"))}toMap(e){return{uniqueId:this.uniqueId,eventId:this.eventId,ticketId:this.ticketId,discount:this.discount,description:this.description}}clone(){return new n(this.uniqueId,this.eventId,et(this.ticketId),this.discount,this.description)}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.eventId===this.eventId&&P(e.ticketId,this.ticketId)&&e.discount===this.discount&&e.description===this.description}}return n.TYPE_ID="a805fed501f149e399f99343cc20327f",n.SCHEMA_VERSION=2,n})(),uw=class extends f{build(i,e){return _l.fromMap(e,i)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(_l.SCHEMA_VERSION))return e;
3if(t.isGreaterThan(_l.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(r.setIfNullOrUndefined(e,"ticketId",[]),s=2),e.$schema_version=D.encodedExactly(s),e}},YC=(()=>{class n extends b{constructor(e,t,s,a){super(),this.creatorId=e,this.creationDate=t,this.price=s,this.comment=a}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.exactly(n.SCHEMA_VERSION)}static create(e){return new n(e.creatorId,e.creationDate,e.price,e.comment)}static fromMap(e,t){return new n(r.get(t,"creatorId"),g.decodeDate(r.get(t,"creationDate")),Y.decode(r.get(t,"price")),r.getOrNull(t,"comment"))}toMap(e){var t,s;return{creatorId:this.creatorId,creationDate:g.encodeDate(this.creationDate),price:(s=(t=this.price)===null||t===void 0?void 0:t.encode())!==null&&s!==void 0?s:null,comment:this.comment}}clone(){var e,t;return new n(this.creatorId,g.cloneDate(this.creationDate),(t=(e=this.price)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null,this.comment)}isSame(e){return e===this?!0:d(e.price,this.price)&&e.creatorId==this.creatorId&&e.creationDate==this.creationDate&&e.comment==this.comment}}return n.TYPE_ID="e6cfa762b5f545f785cde6942a308855",n.SCHEMA_VERSION=1,n})(),cw=class extends f{build(i,e){return YC.fromMap(i,e)}},lw=class n{constructor(i){this.exchangeRate=i}findExchangeRate(i,e){for(let t of this.exchangeRate){if(t.from==i&&t.to==e)return t.rate;if(t.from==e&&t.to==i)return 1/t.rate}return null}static decodeOrNull(i){return i!=null?this.decode(i):null}static decode(i){return new n(i.map(e=>({from:y(r.get(e,"from"),Ae),to:y(r.get(e,"to"),Ae),rate:r.get(e,"rate")})))}encode(){return this.exchangeRate.map(i=>({from:m(i.from),to:m(i.to),rate:i.rate}))}clone(){let i=[];for(let e of this.exchangeRate)i.push(Object.assign({},e));return new n(i)}isSame(i){if(this===i)return!0;if(i.exchangeRate.length!=this.exchangeRate.length)return!1;for(let e=0;e<this.exchangeRate.length;e++)if(this.exchangeRate[e].from!=i.exchangeRate[e].from||this.exchangeRate[e].to!=i.exchangeRate[e].to||this.exchangeRate[e].rate!=i.exchangeRate[e].rate)return!1;return!0}},$C=(()=>{class n extends b{constructor(e,t){super(),this.displayCurrency=e,this.exchange=t}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(y(r.get(t,"displayCurrency"),Ae),lw.decode(r.get(t,"exchange")))}toMap(e){return{displayCurrency:m(this.displayCurrency),exchange:this.exchange.encode()}}clone(){return new n(this.displayCurrency,this.exchange.clone())}isSame(e){return this===e?!0:d(e.exchange,this.exchange)&&e.displayCurrency==this.displayCurrency}}return n.TYPE_ID="0d04b89fcb874f809c6a27d2ca51458c",n})(),dw=class extends f{build(i,e){return $C.fromMap(i,e)}},LC=(()=>{class n extends b{constructor(e,t){if(_(e)&&e.length!==2)throw new Error("Country code must be 2 characters long or null.");if(_(t)&&t.length!==4)throw new Error("Postal code must be 4 characters long or null.");if(_(t)&&e!=="HU")throw new Error("When postal code is set, country must be HU");super(),this.country=e,this.postalCode=t}get $typeId(){return n.TYPE_ID}get isForeigner(){return this.country!=="HU"}static foreigner(e){return this.create({country:e,postalCode:null})}static domestic(e){return this.create({country:"HU",postalCode:e})}static create(e){return new n(e.country,e.postalCode)}static fromMap(e,t){return new n(r.getStringOrNull(t,"country"),r.getStringOrNull(t,"postalCode"))}toMap(e){return{country:this.country,postalCode:this.postalCode}}clone(){return new n(this.country,this.postalCode)}isSame(e){return this===e?!0:e.country===this.country&&e.postalCode===this.postalCode}}return n.TYPE_ID="a5ac6031a45b4f8a84e1e372b2f25840",n})(),hw=class extends f{build(i,e){return LC.fromMap(i,e)}},xl=(()=>{class n extends b{constructor(e,t,s,a,o){super(),this.artist=e,this.events=t,this.metaPixelId=s,this.tikTokPixelId=a,this.googleTagManagerId=o}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static create(e){return new n(e.artist,e.events,e.metaPixelId,e.tikTokPixelId,e.googleTagManagerId)}static fromMap(e,t){return n.create({artist:e.fromData(K.decodeRecord(r.get(t,"artist"))),events:r.getList(t,"events",s=>Cn.fromMap(e,K.decodeRecord(s))),metaPixelId:r.getStringOrNull(t,"metaPixelId"),tikTokPixelId:r.getStringOrNull(t,"tikTokPixelId"),googleTagManagerId:r.getStringOrNull(t,"googleTagManagerId")})}toMap(e){return{artist:e.toData(this.artist),events:this.events.map(t=>t.toMap(e)),metaPixelId:this.metaPixelId,tikTokPixelId:this.tikTokPixelId,googleTagManagerId:this.googleTagManagerId}}clone(){return n.create({artist:this.artist.clone(),events:ue(this.events),metaPixelId:this.metaPixelId,tikTokPixelId:this.tikTokPixelId,googleTagManagerId:this.googleTagManagerId})}isSame(e){return e===this?!0:d(e.artist,this.artist)&&P(e.events,this.events,(t,s)=>d(t,s))&&e.metaPixelId===this.metaPixelId&&e.tikTokPixelId===this.tikTokPixelId&&e.googleTagManagerId===this.googleTagManagerId}}return n.TYPE_ID="51047fa8dc754a84bbe996f19222a54f",n.SCHEMA_VERSION=2,n})(),fw=class extends f{build(i,e){return xl.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(xl.SCHEMA_VERSION))return e;if(t.isGreaterThan(xl.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(s=2),e.$schema_version=D.encodedExactly(s),e}},VC=(()=>{class n extends zt(b){constructor(e,t,s){super(),this.uniqueId=e,this.webRoute=t,this.components=s}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.uniqueId,e.webRoute,e.components)}static fromMap(e,t){return n.create({uniqueId:r.getString(t,"uniqueId"),webRoute:r.getStringOrNull(t,"webRoute"),components:ae.deserialize(e,r.getList(t,"components",s=>K.decodeRecord(s)))})}toMap(e){return{uniqueId:this.uniqueId,webRoute:this.webRoute,components:this.components.serialize(e)}}clone(){return n.create({uniqueId:this.uniqueId,webRoute:this.webRoute,components:this.components.clone()})}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.webRoute===this.webRoute&&d(e.components,this.components)}}return n.TYPE_ID="1239912cb3e04963b2f03157bbdae904",n})(),pw=class extends f{build(i,e){return VC.fromMap(i,e)}},Fl=(()=>{class n extends b{constructor(e,t,s,a,o){super(),this.brand=e,this.events=t,this.metaPixelId=s,this.tikTokPixelId=a,this.googleTagManagerId=o}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static create(e){return new n(e.brand,e.events,e.metaPixelId,e.tikTokPixelId,e.googleTagManagerId)}static fromMap(e,t){return n.create({brand:e.fromData(K.decodeRecord(r.get(t,"brand"))),events:r.getList(t,"events",s=>Cn.fromMap(e,K.decodeRecord(s))),metaPixelId:r.getStringOrNull(t,"metaPixelId"),tikTokPixelId:r.getStringOrNull(t,"tikTokPixelId"),googleTagManagerId:r.getStringOrNull(t,"googleTagManagerId")})}toMap(e){return{brand:e.toData(this.brand),events:this.events.map(t=>t.toMap(e)),metaPixelId:this.metaPixelId,tikTokPixelId:this.tikTokPixelId,googleTagManagerId:this.googleTagManagerId}}clone(){return n.create({brand:this.brand.clone(),events:ue(this.events),metaPixelId:this.metaPixelId,tikTokPixelId:this.tikTokPixelId,googleTagManagerId:this.googleTagManagerId})}isSame(e){return e===this?!0:d(e.brand,this.brand)&&P(e.events,this.events,(t,s)=>d(t,s))&&e.metaPixelId===this.metaPixelId&&e.tikTokPixelId===this.tikTokPixelId&&e.googleTagManagerId===this.googleTagManagerId}}return n.TYPE_ID="861310ba6b984cbb844efc74f90738c7",n.SCHEMA_VERSION=2,n})(),gw=class extends f{build(i,e){return Fl.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(Fl.SCHEMA_VERSION))return e;if(t.isGreaterThan(Fl.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(s=2),e.$schema_version=D.encodedExactly(s),e}},zC=(()=>{class n extends zt(b){constructor(e,t,s){super(),this.uniqueId=e,this.webRoute=t,this.components=s}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.uniqueId,e.webRoute,e.components)}static fromMap(e,t){return n.create({uniqueId:r.getString(t,"uniqueId"),webRoute:r.getStringOrNull(t,"webRoute"),components:ae.deserialize(e,r.getList(t,"components",s=>K.decodeRecord(s)))})}toMap(e){return{uniqueId:this.uniqueId,webRoute:this.webRoute,components:this.components.serialize(e)}}clone(){return n.create({uniqueId:this.uniqueId,webRoute:this.webRoute,components:this.components.clone()})}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.webRoute===this.webRoute&&d(e.components,this.components)}}return n.TYPE_ID="ec2f75aaf7844b9480db0590d1ca3914",n})(),mw=class extends f{build(i,e){return zC.fromMap(i,e)}},ql=(()=>{class n extends b{constructor(e,t,s,a,o){super(),this.organizer=e,this.events=t,this.metaPixelId=s,this.tikTokPixelId=a,this.googleTagManagerId=o}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(1,n.SCHEMA_VERSION)}static create(e){return new n(e.organizer,e.events,e.metaPixelId,e.tikTokPixelId,e.googleTagManagerId)}static fromMap(e,t){return n.create({organizer:e.fromData(K.decodeRecord(r.get(t,"organizer"))),events:r.getList(t,"events",s=>Cn.fromMap(e,K.decodeRecord(s))),metaPixelId:r.getStringOrNull(t,"metaPixelId"),tikTokPixelId:r.getStringOrNull(t,"tikTokPixelId"),googleTagManagerId:r.getStringOrNull(t,"googleTagManagerId")})}toMap(e){return{organizer:e.toData(this.organizer),events:this.events.map(t=>t.toMap(e)),metaPixelId:this.metaPixelId,tikTokPixelId:this.tikTokPixelId,googleTagManagerId:this.googleTagManagerId}}clone(){return n.create({organizer:this.organizer.clone(),events:ue(this.events),metaPixelId:this.metaPixelId,tikTokPixelId:this.tikTokPixelId,googleTagManagerId:this.googleTagManagerId})}isSame(e){return e===this?!0:d(e.organizer,this.organizer)&&P(e.events,this.events,(t,s)=>d(t,s))&&e.metaPixelId===this.metaPixelId&&e.tikTokPixelId===this.tikTokPixelId&&e.googleTagManagerId===this.googleTagManagerId}}return n.TYPE_ID="146c89d7fa5747ef884407eaf747c94a",n.SCHEMA_VERSION=2,n})(),Iw=class extends f{build(i,e){return ql.fromMap(i,e)}migrateToCurrentSchemaVersion(i,e){let t=r.getVersionRange(e);if(t.contains(ql.SCHEMA_VERSION))return e;if(t.isGreaterThan(ql.SCHEMA_VERSION))return null;let s=t.to;return s<2&&(s=2),e.$schema_version=D.encodedExactly(s),e}},UC=(()=>{class n extends zt(b){constructor(e,t,s){super(),this.uniqueId=e,this.webRoute=t,this.components=s}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.uniqueId,e.webRoute,e.components)}static fromMap(e,t){return n.create({uniqueId:r.getString(t,"uniqueId"),webRoute:r.getStringOrNull(t,"webRoute"),components:ae.deserialize(e,r.getList(t,"components",s=>K.decodeRecord(s)))})}toMap(e){return{uniqueId:this.uniqueId,webRoute:this.webRoute,components:this.components.serialize(e)}}clone(){return n.create({uniqueId:this.uniqueId,webRoute:this.webRoute,components:this.components.clone()})}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.webRoute===this.webRoute&&d(e.components,this.components)}}
3return n.TYPE_ID="19ecfb262ea548caa305bd818d0f6f98",n})(),Dw=class extends f{build(i,e){return UC.fromMap(i,e)}},Yl=(function(n){return n.Live="LIVE",n.Scanned="SCANNED",n})(Yl||{}),BC=(()=>{class n extends b{constructor(e,t,s,a,o,u,c,l,h,p,I,v,E){var w;super(),this.uniqueId=e,this.scanCode=t,this.creationDate=s,this.country=a,this.timezone=o,this.businessRef=u,this.status=c,this.eventId=l,this.template=h,this.contactDetails=p,this.scanDate=I,this.scannerId=v,this.customer=E,this.templateId=h.uniqueId,this.customerId=(w=E?.uniqueId)!==null&&w!==void 0?w:null}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.uniqueId,e.scanCode,e.creationDate,e.country,e.timezone,e.businessRef,e.status,e.eventId,e.template,e.contactDetails,null,null,e.customer)}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.get(t,"scanCode"),e.decodeDate(r.get(t,"creationDate")),y(r.get(t,"country"),Ie),y(r.get(t,"timezone"),Ee),j.mustDecode(r.get(t,"businessRef")),y(r.get(t,"$status"),Yl),r.get(t,"eventId"),e.fromData(r.get(t,"template")),e.fromData(r.get(t,"contactDetails")),e.decodeDateOrNull(r.getOrNull(t,"scanDate")),r.getOrNull(t,"scannerId"),e.fromDataOrNull(r.getOrNull(t,"customer")))}toMap(e){var t;return{uniqueId:this.uniqueId,scanCode:this.scanCode,creationDate:e.encodeDate(this.creationDate),country:m(this.country),timezone:m(this.timezone),businessRef:this.businessRef.encode(),$status:m(this.status),eventId:this.eventId,template:e.toData(this.template),templateId:this.template.uniqueId,contactDetails:e.toData(this.contactDetails),scanDate:e.encodeDateOrNull(this.scanDate),scannerId:(t=this.scannerId)!==null&&t!==void 0?t:null,customer:e.toDataOrNull(this.customer),customerId:this.customerId}}clone(){return new n(this.uniqueId,this.scanCode,g.cloneDate(this.creationDate),this.country,this.timezone,this.businessRef.clone(),this.status,this.eventId,this.template.clone(),this.contactDetails.clone(),g.cloneDateOrNull(this.scanDate),this.scannerId,Z(this.customer))}isSame(e){return this===e?!0:e.uniqueId===this.uniqueId&&e.scanCode===this.scanCode&&e.creationDate===this.creationDate&&e.country===this.country&&e.timezone===this.timezone&&e.businessRef===this.businessRef&&e.status===this.status&&e.eventId===this.eventId&&d(e.template,this.template)&&d(e.contactDetails,this.contactDetails)&&d(e.customer,this.customer)&&e.scanDate===this.scanDate&&e.scannerId===this.scannerId}markAsScanned(e){return new n(this.uniqueId,this.scanCode,g.cloneDate(this.creationDate),this.country,this.timezone,this.businessRef.clone(),Yl.Scanned,this.eventId,this.template.clone(),this.contactDetails.clone(),fe.now(),e,Z(this.customer))}markAsRestored(){return new n(this.uniqueId,this.scanCode,g.cloneDate(this.creationDate),this.country,this.timezone,this.businessRef.clone(),Yl.Live,this.eventId,this.template.clone(),this.contactDetails.clone(),null,null,Z(this.customer))}static encodedStatusSafe(e){return m(e)}}return n.TYPE_ID="3f8f9e66ecac4b68a56c6cbf774376f8",n})(),vw=class extends f{build(i,e){return BC.fromMap(i,e)}},HC=(()=>{class n extends b{constructor(e,t,s){super(),this.enabled=e,this.freeSeatFraction=t,this.randomizationStrength=s}get $typeId(){return n.TYPE_ID}static create(e){return W.concat([this.validateFreeSeatFraction(e.freeSeatFraction),this.validateRandomizationStrength(e.randomizationStrength)]).map(([t,s])=>new n(e.enabled,t,s))}static validateFreeSeatFraction(e){return k(e)?W.ok(e):e<this.FREE_SEAT_FRACTION_MIN||e>this.FREE_SEAT_FRACTION_MAX?W.error(`Free seat fraction must be in the range [${this.FREE_SEAT_FRACTION_MIN}, ${this.FREE_SEAT_FRACTION_MAX}].`):W.ok(e)}static validateRandomizationStrength(e){return k(e)?W.ok(e):Number.isSafeInteger(e)?e<this.RANDOMIZATION_STRENGTH_MIN||e>this.RANDOMIZATION_STRENGTH_MAX?W.error(`Randomization strength must be in the range [${this.RANDOMIZATION_STRENGTH_MIN}, ${this.RANDOMIZATION_STRENGTH_MAX}].`):W.ok(e):W.error("Randomization strength must be a safe integer or null.")}static fromMap(e,t){return this.create({enabled:r.getBoolean(t,"enabled"),freeSeatFraction:r.getNumberOrNull(t,"freeSeatFraction"),randomizationStrength:r.getNumberOrNull(t,"randomizationStrength")}).unwrap()}toMap(e){return{enabled:this.enabled,freeSeatFraction:this.freeSeatFraction,randomizationStrength:this.randomizationStrength}}clone(){return new n(this.enabled,this.freeSeatFraction,this.randomizationStrength)}isSame(e){return e===this?!0:e.enabled===this.enabled&&e.freeSeatFraction===this.freeSeatFraction&&e.randomizationStrength===this.randomizationStrength}}return n.TYPE_ID="73d38b03c75d4481a504b20ed04d584c",n.RANDOMIZATION_STRENGTH_MIN=1,n.RANDOMIZATION_STRENGTH_MAX=100,n.FREE_SEAT_FRACTION_MIN=0,n.FREE_SEAT_FRACTION_MAX=1,n})(),yw=class extends f{build(i,e){return HC.fromMap(i,e)}},GC=(()=>{class n extends Le{constructor(e,t,s,a,o,u){super(),this.uniqueId=e,this.creatorId=t,this.deviceId=s,this.creationDate=a,this.source=o,this.customer=u}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.getOrNull(t,"creatorId"),r.getOrNull(t,"deviceId"),e.decodeDate(r.get(t,"creationDate")),y(y(r.get(t,"source"),le),le),e.fromData(r.get(t,"customer")))}toMap(e){return{uniqueId:this.uniqueId,creatorId:this.creatorId,deviceId:this.deviceId,creationDate:e.encodeDate(this.creationDate),source:m(this.source),customerId:this.customer.uniqueId,customer:e.toData(this.customer)}}clone(){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,this.customer.clone())}isSame(e){return this===e?!0:e.uniqueId===this.uniqueId&&e.creatorId===this.creatorId&&e.deviceId===this.deviceId&&e.creationDate===this.creationDate&&e.source===this.source&&d(e.customer,this.customer)}}return n.TYPE_ID="1f497cf30a3343a2b62eae64350a5d99",n})(),bw=class extends f{build(i,e){return GC.fromMap(i,e)}},WC=(()=>{class n extends Le{constructor(e,t,s,a,o,u){super(),this.uniqueId=e,this.creatorId=t,this.deviceId=s,this.creationDate=a,this.source=o,this.customer=u}get $typeId(){return n.TYPE_ID}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.getOrNull(t,"creatorId"),r.getOrNull(t,"deviceId"),e.decodeDate(r.get(t,"creationDate")),y(y(r.get(t,"source"),le),le),e.fromData(r.get(t,"customer")))}toMap(e){return{uniqueId:this.uniqueId,creatorId:this.creatorId,deviceId:this.deviceId,creationDate:e.encodeDate(this.creationDate),source:m(this.source),customerId:this.customer.uniqueId,customer:e.toData(this.customer)}}clone(){return new n(this.uniqueId,this.creatorId,this.deviceId,g.cloneDate(this.creationDate),this.source,this.customer.clone())}isSame(e){return this===e?!0:e.uniqueId===this.uniqueId&&e.creatorId===this.creatorId&&e.deviceId===this.deviceId&&e.creationDate===this.creationDate&&e.source===this.source&&d(e.customer,this.customer)}}return n.TYPE_ID="3ba4f21ad5c94e9dbcead49408fb1898",n})(),Ew=class extends f{build(i,e){return WC.fromMap(i,e)}},rs=(function(n){return n.Open="OPEN",n.Aborted="ABORTED",n.Canceled="CANCELED",n.Refunded="REFUNDED",n})(rs||{}),$l=(()=>{class n extends b{constructor(e,t,s,a,o,u,c,l,h,p,I,v,E,w,S,R,x,N,O,A){var M,C,H,B,U,V;super(),this.uniqueId=e,this.creatorId=t,this.creationDate=s,this.businessRef=a,this.country=o,this.timezone=u,this.status=c,this.paymentType=l,this.paymentMethod=h,this.onlinePaymentDetails=p,this.source=I,this.components=v,this.isGuestOrder=E,this.cancelledDate=w,this.cancelledBy=S,this.applicationFee=R,this.applicationFeeVat=x,this.price=N,this.pass=O,this.sideEffects=A,this.isLegacyOrder=!0,this.userId=(C=(M=O.customer)===null||M===void 0?void 0:M.userId)!==null&&C!==void 0?C:null,this.customerId=(B=(H=O.customer)===null||H===void 0?void 0:H.uniqueId)!==null&&B!==void 0?B:null,this.language=(V=(U=O.customer)===null||U===void 0?void 0:U.language)!==null&&V!==void 0?V:null}get $typeId(){return n.TYPE_ID}get $schemaVersion(){return D.between(4,n.SCHEMA_VERSION)}get isOpen(){return this.status===rs.Open}get isCanceled(){return this.status===rs.Canceled}static create(e){var t;return new n(Ft(),e.creatorId,fe.now(),e.pass.businessRef.clone(),e.country,e.timezone,rs.Open,pe.OnDelivery,e.paymentMethod,null,Xe.Admin,new ae,!1,null,null,null,null,(t=e.price)!==null&&t!==void 0?t:e.pass.price.clone(),e.pass,[])}static fromMap(e,t){return new n(r.get(t,"uniqueId"),r.get(t,"creatorId"),e.decodeDate(r.get(t,"creationDate")),j.mustDecode(r.get(t,"businessRef")),y(r.get(t,"country"),Ie),y(r.get(t,"timezone"),Ee),y(r.get(t,"$status"),rs),y(r.get(t,"paymentType"),pe),y(r.get(t,"paymentMethod"),Fe),e.fromDataOrNull(r.getOrNull(t,"onlinePaymentDetails")),y(r.get(t,"source"),Xe),ae.deserialize(e,r.getList(t,"components",s=>s)),r.get(t,"isGuestOrder"),e.decodeDateOrNull(r.getOrNull(t,"cancelledDate")),r.getOrNull(t,"cancelledBy"),Y.decodeOrNull(r.getOrNull(t,"applicationFee")),Re(r.getStringOrNull(t,"applicationFeeVat"),te),Y.decode(r.get(t,"price")),e.fromData(r.get(t,"pass")),r.getList(t,"sideEffects",s=>e.fromData(s)))}toMap(e){var t,s;return{$status:m(this.status),uniqueId:this.uniqueId,creatorId:this.creatorId,userId:this.userId,customerId:this.customerId,businessRef:this.businessRef.encode(),country:m(this.country),timezone:m(this.timezone),creationDate:e.encodeDate(this.creationDate),isGuestOrder:this.isGuestOrder,components:this.components.serialize(e),paymentType:m(this.paymentType),paymentMethod:m(this.paymentMethod),onlinePaymentDetails:e.toDataOrNull(this.onlinePaymentDetails),applicationFee:(s=(t=this.applicationFee)===null||t===void 0?void 0:t.encode())!==null&&s!==void 0?s:null,applicationFeeVat:Se(this.applicationFeeVat),sideEffects:this.sideEffects.map(a=>e.toData(a)),cancelledDate:e.encodeDateOrNull(this.cancelledDate),
3cancelledBy:this.cancelledBy,passTemplateId:this.pass.templateId,passId:this.pass.uniqueId,pass:e.toData(this.pass),price:this.price.encode(),source:m(this.source)}}clone(){var e,t,s,a;return new n(this.uniqueId,this.creatorId,g.cloneDate(this.creationDate),this.businessRef.clone(),this.country,this.timezone,this.status,this.paymentType,this.paymentMethod,(t=(e=this.onlinePaymentDetails)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null,this.source,this.components.clone(),this.isGuestOrder,g.cloneDateOrNull(this.cancelledDate),this.cancelledBy,(a=(s=this.applicationFee)===null||s===void 0?void 0:s.clone())!==null&&a!==void 0?a:null,this.applicationFeeVat,this.price.clone(),this.pass.clone(),this.sideEffects.map(o=>o.clone()))}isSame(e){return this===e?!0:d(e.onlinePaymentDetails,this.onlinePaymentDetails)&&P(e.sideEffects,this.sideEffects,d)&&e.components.isSame(this.components)&&e.country===this.country&&e.timezone===this.timezone&&e.source===this.source&&e.uniqueId===this.uniqueId&&e.creatorId===this.creatorId&&e.cancelledDate===this.cancelledDate&&e.cancelledBy===this.cancelledBy&&e.applicationFeeVat==this.applicationFeeVat&&d(e.applicationFee,this.applicationFee)&&d(e.businessRef,this.businessRef)&&d(e.price,this.price)&&d(e.pass,this.pass)&&e.creationDate===this.creationDate&&e.status===this.status&&e.paymentMethod===this.paymentMethod&&e.paymentType===this.paymentType&&e.isGuestOrder===this.isGuestOrder}copyWithPaymentDetails(e){var t,s;return new n(this.uniqueId,this.creatorId,g.cloneDate(this.creationDate),this.businessRef.clone(),this.country,this.timezone,this.status,this.paymentType,this.paymentMethod,e,this.source,this.components.clone(),this.isGuestOrder,g.cloneDateOrNull(this.cancelledDate),this.cancelledBy,(s=(t=this.applicationFee)===null||t===void 0?void 0:t.clone())!==null&&s!==void 0?s:null,this.applicationFeeVat,this.price.clone(),this.pass.clone(),this.sideEffects.map(a=>a.clone()))}copyWithPaymentStatus(e){var t,s,a,o;return new n(this.uniqueId,this.creatorId,g.cloneDate(this.creationDate),this.businessRef.clone(),this.country,this.timezone,this.status,this.paymentType,this.paymentMethod,(s=(t=this.onlinePaymentDetails)===null||t===void 0?void 0:t.copyWith({status:e}))!==null&&s!==void 0?s:null,this.source,this.components.clone(),this.isGuestOrder,g.cloneDateOrNull(this.cancelledDate),this.cancelledBy,(o=(a=this.applicationFee)===null||a===void 0?void 0:a.clone())!==null&&o!==void 0?o:null,this.applicationFeeVat,this.price.clone(),this.pass.clone(),this.sideEffects.map(u=>u.clone()))}copyWithPaymentMethod(e){var t,s,a,o;return new n(this.uniqueId,this.creatorId,g.cloneDate(this.creationDate),this.businessRef.clone(),this.country,this.timezone,this.status,this.paymentType,e,(s=(t=this.onlinePaymentDetails)===null||t===void 0?void 0:t.clone())!==null&&s!==void 0?s:null,this.source,this.components.clone(),this.isGuestOrder,g.cloneDateOrNull(this.cancelledDate),this.cancelledBy,(o=(a=this.applicationFee)===null||a===void 0?void 0:a.clone())!==null&&o!==void 0?o:null,this.applicationFeeVat,this.price.clone(),this.pass.clone(),this.sideEffects.map(u=>u.clone()))}assignToCustomerAccount(e){var t,s,a,o;return new n(this.uniqueId,e.uniqueId,g.cloneDate(this.creationDate),this.businessRef.clone(),this.country,this.timezone,this.status,this.paymentType,this.paymentMethod,(s=(t=this.onlinePaymentDetails)===null||t===void 0?void 0:t.clone())!==null&&s!==void 0?s:null,this.source,this.components.clone(),this.isGuestOrder,g.cloneDateOrNull(this.cancelledDate),this.cancelledBy,(o=(a=this.applicationFee)===null||a===void 0?void 0:a.clone())!==null&&o!==void 0?o:null,this.applicationFeeVat,this.price.clone(),this.pass.clone(),this.sideEffects.map(u=>u.clone()))}tryGetCustomer(){return this.pass.customer}hasComponentByTypeId(e){return this.components.hasComponentByTypeId(e)}mustFindComponentByTypeId(e){return this.components.mustFindComponentByTypeId(e)}findComponentByTypeId(e){return this.components.findComponentByTypeId(e)}findComponentByInstanceId(e){return this.components.findComponentByInstanceId(e)}findComponentsByTypeId(e){return this.components.findComponentsByTypeId(e)}addComponent(e){this.components.addComponent(e)}addComponents(e){this.components.addComponents(e)}
3removeComponentByTypeId(e){return this.components.removeComponentByTypeId(e)}removeComponentByInstanceId(e){return this.components.removeComponentByInstanceId(e)}removeComponentAt(e){this.components.removeComponentAt(e)}removeAllComponents(){this.components.removeAllComponents()}popAllComponentsByTypeId(e){return this.components.popAllComponentsByTypeId(e)}popComponentByTypeId(e){return this.components.popComponentByTypeId(e)}popComponent(e){return this.components.popComponent(e)}replaceComponent(e){return this.components.replaceComponent(e)}addOrReplaceComponent(e){this.components.addOrReplaceComponent(e)}mustFindComponentField(e,t){return this.components.mustFindComponentField(e,t)}findComponentField(e,t){return this.components.findComponentField(e,t)}static encodedStatusSafe(e){return m(e)}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="42f894d385874d4ea562b86fb70803a3",n.SCHEMA_VERSION=5,n})(),ww=class extends f{build(i,e){return $l.fromMap(i,e)}optimizeForQuery(i,e){var t,s;let a=null;return e.paymentType===pe.Online?a=(s=(t=e.onlinePaymentDetails)===null||t===void 0?void 0:t.status)!==null&&s!==void 0?s:null:a=qt.Succeeded,{paymentStatus:Se(a),paymentType:m(e.paymentType),paymentMethod:m(e.paymentMethod)}}migrateToCurrentSchemaVersion(i,e){var t;let s=r.getVersionRange(e);if(this.migrateEnum(e,"$status",rs,rs.Open),this.migrateEnum(e,"paymentType",pe,pe.OnDelivery),this.migrateEnum(e,"paymentMethod",Fe,Fe.Cash),s.contains($l.SCHEMA_VERSION))return e;if(s.isGreaterThan($l.SCHEMA_VERSION))return null;let a=s.to;if(a<2&&(a=2),a<3&&(e.timezone=m(Ee.EuropeBucharest),a=3),a<4){let u=r.getList(e,"onCompleteHooks",c=>i.fromData(c)).map(c=>c.toSideEffect()).filter(_);e.sideEffects=u.map(c=>i.toData(c)),a=4}if(a<5){let o=y(r.get(e,"timezone"),Ee);e.country=m((t=xd(o))!==null&&t!==void 0?t:Ie.Romania),a=5}return e.$schema_version=D.encodedExactly(a),e}},jC=(()=>{class n extends b{constructor(e,t,s){super(),this.businessRef=e,this.eventId=t,this.expirationDate=s}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.businessRef,e.eventId,e.expirationDate)}static fromMap(e,t){return this.create({businessRef:j.mustDecode(r.getString(e,"businessRef")),eventId:r.getString(e,"eventId"),expirationDate:t.decodeDate(r.getNumber(e,"expirationDate"))})}toMap(e){return{businessRef:this.businessRef.encode(),eventId:this.eventId,expirationDate:e.encodeDate(this.expirationDate)}}clone(){return n.create({businessRef:this.businessRef.clone(),eventId:this.eventId,expirationDate:g.cloneDate(this.expirationDate)})}isSame(e){return e===this?!0:d(e.businessRef,this.businessRef)&&e.eventId===this.eventId&&e.expirationDate===this.expirationDate}copyWith(e){var t,s,a;return n.create({businessRef:(t=e.businessRef)!==null&&t!==void 0?t:this.businessRef.clone(),eventId:(s=e.eventId)!==null&&s!==void 0?s:this.eventId,expirationDate:(a=e.expirationDate)!==null&&a!==void 0?a:g.cloneDate(this.expirationDate)})}}return n.TYPE_ID="edfb8a59d6ad4b91beb9e598657a5244",n})(),Sw=class extends f{build(i,e){return jC.fromMap(e,i)}},JC=(()=>{class n extends b{constructor(e,t,s,a){super(),this.uniqueId=e,this.expirationDate=t,this.lastAcquired=s,this.durationOverride=a}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.uniqueId,e.expirationDate,e.lastAcquired,e.durationOverride)}static acquireNew(e,t,s){return n.create({uniqueId:e,expirationDate:t.add(s),lastAcquired:t,durationOverride:null})}acquire(e,t){var s;return e.isAfter(this.expirationDate)?this.copyWith({expirationDate:e.add((s=this.durationOverride)!==null&&s!==void 0?s:t),lastAcquired:e}):null}static fromMap(e,t){return this.create({uniqueId:r.getString(t,"uniqueId"),expirationDate:e.decodeDate(r.getNumber(t,"expirationDate")),lastAcquired:e.decodeDate(r.getNumber(t,"lastAcquired")),durationOverride:e.decodeDurationOrNull(r.getNumberOrNull(t,"durationOverride"))})}toMap(e){var t,s;return{uniqueId:this.uniqueId,expirationDate:e.encodeDateOrNull(this.expirationDate),exportationDateISO8601:this.expirationDate.toISOString(),lastAcquired:e.encodeDateOrNull(this.lastAcquired),lastAcquiredISO8601:this.lastAcquired.toISOString(),durationOverride:e.encodeDurationOrNull(this.durationOverride),durationOverrideISO8601:(s=(t=this.durationOverride)===null||t===void 0?void 0:t.toISOString())!==null&&s!==void 0?s:null}}clone(){return n.create({uniqueId:this.uniqueId,expirationDate:g.cloneDate(this.expirationDate),lastAcquired:g.cloneDate(this.lastAcquired),durationOverride:this.durationOverride})}copyWith({uniqueId:e=this.uniqueId,expirationDate:t=g.cloneDate(this.expirationDate),lastAcquired:s=g.cloneDate(this.lastAcquired),durationOverride:a=g.cloneDurationOrNull(this.durationOverride)}={}){return n.create({uniqueId:e,expirationDate:t,lastAcquired:s,durationOverride:a})}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.expirationDate===this.expirationDate&&e.lastAcquired===this.lastAcquired&&e.durationOverride===this.durationOverride}}return n.TYPE_ID="39d041714cbb415a86939de18ed9ef1e",n})(),Tw=class extends f{build(i,e){return JC.fromMap(i,e)}},KC=(()=>{class n extends b{constructor(e,t,s,a,o,u,c,l){super(),this.uniqueId=e,this.name=t,this.organizationId=s,this.taxNumber=a,this.registrationNumber=o,this.privateKey=u,this.publicKey=c,this.certificate=l}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.uniqueId,e.name,e.organizationId,e.taxNumber,e.registrationNumber,e.privateKey,e.publicKey,e.certificate)}static fromMap(e,t){return n.create({uniqueId:r.getString(t,"uniqueId"),name:r.getString(t,"name"),organizationId:r.getString(t,"organizationId"),taxNumber:r.getString(t,"taxNumber"),registrationNumber:r.getString(t,"registrationNumber"),privateKey:r.getString(t,"privateKey"),publicKey:r.getString(t,"publicKey"),certificate:r.getStringOrNull(t,"certificate")})}toMap(e){return{uniqueId:this.uniqueId,name:this.name,organizationId:this.organizationId,taxNumber:this.taxNumber,registrationNumber:this.registrationNumber,privateKey:this.privateKey,publicKey:this.publicKey,certificate:this.certificate}}clone(){return this.copyWith()}copyWith({uniqueId:e=this.uniqueId,name:t=this.name,organizationId:s=this.organizationId,taxNumber:a=this.taxNumber,registrationNumber:o=this.registrationNumber,privateKey:u=this.privateKey,publicKey:c=this.publicKey,certificate:l=this.certificate}={}){return n.create({uniqueId:e,name:t,organizationId:s,taxNumber:a,registrationNumber:o,privateKey:u,publicKey:c,certificate:l})}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.name===this.name&&e.organizationId===this.organizationId&&e.taxNumber===this.taxNumber&&e.registrationNumber===this.registrationNumber&&e.privateKey===this.privateKey&&e.publicKey===this.publicKey&&e.certificate===this.certificate}}return n.TYPE_ID="6a9113eac4d74495bef6e2c2bfcbee4e",n})(),Ow=class extends f{build(i,e){return KC.fromMap(i,e)}},ZC=(()=>{class n extends b{constructor(e,t,s,a,o,u){super(),this.accountId=e,this.isGuestAccount=t,this.creationDate=s,this.platformMarketingConsent=a,this.pendingSubscriptions=o,this.activeSubscriptions=u;let c=new Set;for(let l of o){let h=l.businessRef.encode();if(c.has(h))throw new Error(`Duplicate business ref found in pending subscriptions: ${h}`);c.add(h)}for(let l of u){let h=l.businessRef.encode();if(c.has(h))throw new Error(`Duplicate business ref found in active subscriptions: ${h}`);c.add(h)}}get uniqueId(){return this.accountId}get isPending(){return this.pendingSubscriptions.length>0}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.accountId,e.isGuestAccount,e.creationDate,e.platformMarketingConsent,e.pendingSubscriptions,e.activeSubscriptions)}static fresh(e){return this.create({accountId:e.accountId,isGuestAccount:e.isGuestAccount,creationDate:e.creationDate,platformMarketingConsent:!1,pendingSubscriptions:[],activeSubscriptions:[]})}static fromMap(e,t){return this.create({accountId:r.getString(t,"accountId"),isGuestAccount:r.getBoolean(t,"isGuestAccount"),creationDate:e.decodeDate(r.getNumber(t,"creationDate")),platformMarketingConsent:r.getBoolean(t,"platformMarketingConsent"),pendingSubscriptions:r.getList(t,"pen
3dingSubscriptions",s=>e.fromData(K.decodeRecord(s))),activeSubscriptions:r.getList(t,"activeSubscriptions",s=>e.fromData(K.decodeRecord(s)))})}toMap(e){return{uniqueId:this.uniqueId,accountId:this.accountId,isGuestAccount:this.isGuestAccount,creationDate:e.encodeDate(this.creationDate),platformMarketingConsent:this.platformMarketingConsent,pendingSubscriptions:this.pendingSubscriptions.map(t=>e.toData(t)),activeSubscriptions:this.activeSubscriptions.map(t=>e.toData(t))}}clone(){return this.copyWith()}copyWith({accountId:e=this.accountId,isGuestAccount:t=this.isGuestAccount,creationDate:s=this.creationDate,platformMarketingConsent:a=this.platformMarketingConsent,pendingSubscriptions:o=ue(this.pendingSubscriptions),activeSubscriptions:u=ue(this.activeSubscriptions)}={}){return n.create({accountId:e,isGuestAccount:t,creationDate:s,platformMarketingConsent:a,pendingSubscriptions:o,activeSubscriptions:u})}isSame(e){return e===this?!0:e.accountId===this.accountId&&e.isGuestAccount===this.isGuestAccount&&e.creationDate===this.creationDate&&e.platformMarketingConsent===this.platformMarketingConsent&&P(e.pendingSubscriptions,this.pendingSubscriptions,d)&&P(e.activeSubscriptions,this.activeSubscriptions,d)}isSubscribedToBusiness(e){return this.pendingSubscriptions.some(t=>d(t.businessRef,e))||this.activeSubscriptions.some(t=>d(t.businessRef,e))}pushRequest(e){return this.copyWith({pendingSubscriptions:[...ue(this.pendingSubscriptions),e]})}removeRequest(e){return this.copyWith({pendingSubscriptions:ue(this.pendingSubscriptions).filter(t=>!d(t.businessRef,e))})}pushSubscription(e){return this.removeRequest(e.businessRef).copyWith({activeSubscriptions:[...ue(this.activeSubscriptions),e]})}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="abab352a36f2454689657c99bf739344",n})(),Rw=class extends f{build(i,e){return ZC.fromMap(i,e)}optimizeForQuery(i,e){return{isPending:e.isPending}}},XC=(()=>{class n extends b{constructor(e,t,s,a,o,u,c,l,h,p,I,v,E){super(),this.uniqueId=e,this.creatorId=t,this.creationDate=s,this.country=a,this.language=o,this.timezone=u,this.businessRef=c,this.webRoute=l,this.placeId=h,this.status=p,this.names=I,this.dateSpan=v,this.cover=E}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.uniqueId,e.creatorId,e.creationDate,e.country,e.language,e.timezone,e.businessRef,e.webRoute,e.placeId,e.status,e.names,e.dateSpan,e.cover)}static fromEventProfile(e){let t=e.findComponentByTypeId(dn.TYPE_ID);if(t==null)return W.error("EventProfile does not have a DateSpanComponent");let s=e.findComponentByTypeId(ws.TYPE_ID);if(s==null)return W.error("EventProfile does not have a LocalizedNameComponent");let a=e.findComponentByTypeId(en.TYPE_ID);if(a==null)return W.error("EventProfile does not have a ProfilePhotosComponent");let o=a.portfolio.photos.at(0);return o==null?W.error("EventProfile does not have a cover photo"):W.ok(this.create({uniqueId:e.uniqueId,creatorId:e.creatorId,creationDate:e.creationDate,country:e.country,businessRef:F(e.businessRef),cover:o,dateSpan:F(t.dateSpan),language:e.language,names:F(s.names),placeId:e.placeId,status:e.status,timezone:e.timezone,webRoute:e.webRoute}))}static fromMap(e,t){return this.create({uniqueId:r.getString(t,"uniqueId"),creatorId:r.getString(t,"creatorId"),creationDate:e.decodeDate(r.getNumber(t,"creationDate")),country:y(r.getString(t,"country"),Ie),language:y(r.getString(t,"language"),$),timezone:y(r.getString(t,"timezone"),Ee),businessRef:j.mustDecode(r.getString(t,"businessRef")),webRoute:r.getStringOrNull(t,"webRoute"),placeId:r.getStringOrNull(t,"placeId"),status:y(r.getString(t,"status"),bd),names:e.fromData(r.getRecord(t,"names")),dateSpan:e.fromData(r.getRecord(t,"dateSpan")),cover:e.fromData(r.getRecord(t,"cover"))})}toMap(e){return{uniqueId:this.uniqueId,creatorId:this.creatorId,creationDate:e.encodeDate(this.creationDate),country:m(this.country),language:m(this.language),timezone:m(this.timezone),businessRef:this.businessRef.encode(),webRoute:this.webRoute,placeId:this.placeId,status:m(this.status),names:e.toData(this.names),dateSpan:e.toData(this.dateSpan),cover:e.toData(this.cover)}}clone(){return n.create({uniqueId:this.uniqueId,creatorId:this.creatorId,creationDate:g.cloneDate(this.creationDate),
3country:this.country,language:this.language,timezone:this.timezone,businessRef:F(this.businessRef),webRoute:this.webRoute,placeId:this.placeId,status:this.status,names:F(this.names),dateSpan:F(this.dateSpan),cover:F(this.cover)})}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.creatorId===this.creatorId&&e.creationDate===this.creationDate&&e.country===this.country&&e.language===this.language&&e.timezone===this.timezone&&d(e.businessRef,this.businessRef)&&e.webRoute===this.webRoute&&e.placeId===this.placeId&&e.status===this.status&&d(e.names,this.names)&&d(e.dateSpan,this.dateSpan)&&d(e.cover,this.cover)}}return n.TYPE_ID="272e0a2604b4462f96f4e3416f70157a",n})(),Mw=class extends f{build(i,e){return XC.fromMap(i,e)}},QC=(()=>{class n extends Le{constructor(e,t,s,a,o,u){super(),this.uniqueId=e,this.creatorId=t,this.deviceId=s,this.creationDate=a,this.source=o,this.order=u}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.uniqueId,e.creatorId,e.deviceId,e.creationDate,e.source,e.order)}static fromMap(e,t){return this.create({uniqueId:r.getString(t,"uniqueId"),creatorId:r.getStringOrNull(t,"creatorId"),deviceId:r.getStringOrNull(t,"deviceId"),creationDate:e.decodeDate(r.getNumber(t,"creationDate")),source:y(r.getString(t,"source"),le),order:e.fromData(r.getRecord(t,"order"))})}toMap(e){return{uniqueId:this.uniqueId,creatorId:this.creatorId,deviceId:this.deviceId,creationDate:e.encodeDate(this.creationDate),source:this.source,order:e.toData(this.order)}}clone(){return n.create({uniqueId:this.uniqueId,creatorId:this.creatorId,deviceId:this.deviceId,creationDate:g.cloneDate(this.creationDate),source:this.source,order:F(this.order)})}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.creatorId===this.creatorId&&e.deviceId===this.deviceId&&e.creationDate===this.creationDate&&e.source===this.source&&d(e.order,this.order)}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="239a2b18ad7746cf8053677c8d5e4642",n})(),Nw=class extends f{build(i,e){return QC.fromMap(i,e)}},ek=(()=>{class n extends b{constructor(e,t,s,a,o){super(),this.uniqueId=e,this.names=t,this.price=s,this.overrideVat=a,this.pdfBackground=o}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.uniqueId,e.names,e.price,e.overrideVat,e.pdfBackground)}static fromData(e,t){return this.create({uniqueId:r.getString(t,"uniqueId"),names:e.fromData(r.getRecord(t,"names")),price:Y.decode(r.getString(t,"price")),overrideVat:Re(r.getStringOrNull(t,"overrideVat"),te),pdfBackground:e.fromDataOrNull(r.getRecordOrNull(t,"pdfBackground"))})}toMap(e){return{uniqueId:this.uniqueId,names:e.toData(this.names),price:this.price.encode(),overrideVat:Se(this.overrideVat),pdfBackground:e.toDataOrNull(this.pdfBackground)}}clone(){return this.copyWith()}copyWith({uniqueId:e=this.uniqueId,names:t=F(this.names),price:s=F(this.price),overrideVat:a=this.overrideVat,pdfBackground:o=Z(this.pdfBackground)}={}){return n.create({uniqueId:e,names:t,price:s,overrideVat:a,pdfBackground:o})}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&d(e.names,this.names)&&d(e.price,this.price)&&e.overrideVat===this.overrideVat&&d(e.pdfBackground,this.pdfBackground)}}return n.TYPE_ID="40c5c0801626451d8742067c58b3eee7",n})(),Pw=class extends f{build(i,e){return ek.fromData(i,e)}},er=(function(n){return n.Live="LIVE",n.Aborted="ABORTED",n.Canceled="CANCELED",n.Refunded="REFUNDED",n.Scanned="SCANNED",n})(er||{}),tk=(()=>{class n extends b{constructor(e,t,s,a,o,u,c,l,h){super(),this.uniqueId=e,this.status=t,this.template=s,this.ticketId=a,this.storagePath=o,this.cancelledDate=u,this.cancelledBy=c,this.scanDate=l,this.scannerId=h}get templateId(){return this.template.uniqueId}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.uniqueId,e.status,e.template,e.ticketId,e.storagePath,e.cancelledDate,e.cancelledBy,e.scanDate,e.scannerId)}static fromMap(e,t){return this.create({uniqueId:r.getString(t,"uniqueId"),status:y(r.getString(t,"$status"),er),template:e.fromData(r.getRecord(t,"template")),ticketId:r.getString(t,"ticketId"),storagePath:r.getString(t,"storagePath"),cancelledDate:e.decodeDateOrNull(r.getNumberOrNull(t,"cancelledDate")),cancelledBy:r.getStringOrNull(t,"cancelledBy"),scanDate:e.decodeDateOrNull(r.getNumberOrNull(t,"scanDate")),scannerId:r.getStringOrNull(t,"scannerId")})}toMap(e){return{$status:m(this.status),uniqueId:this.uniqueId,template:e.toData(this.template),templateId:this.templateId,ticketId:this.ticketId,storagePath:this.storagePath,cancelledDate:e.encodeDateOrNull(this.cancelledDate),
3cancelledBy:this.cancelledBy,scanDate:e.encodeDateOrNull(this.scanDate),scannerId:this.scannerId}}clone(){return this.copyWith()}copyWith({uniqueId:e=this.uniqueId,status:t=this.status,template:s=F(this.template),ticketId:a=this.ticketId,storagePath:o=this.storagePath,cancelledDate:u=g.cloneDateOrNull(this.cancelledDate),cancelledBy:c=this.cancelledBy,scanDate:l=g.cloneDateOrNull(this.scanDate),scannerId:h=this.scannerId}={}){return n.create({uniqueId:e,status:t,template:s,ticketId:a,storagePath:o,cancelledDate:u,cancelledBy:c,scanDate:l,scannerId:h})}copyAsCanceled(e,t,s){var a,o;return this.copyWith({status:s?er.Refunded:er.Canceled,cancelledDate:(a=this.cancelledDate)!==null&&a!==void 0?a:g.cloneDateOrNull(t),cancelledBy:(o=this.cancelledBy)!==null&&o!==void 0?o:e})}copyAsScanned({scanDate:e,scannerId:t=null}){return this.copyWith({status:er.Scanned,scanDate:e,scannerId:t})}copyAsAborted(){return this.copyWith({status:er.Aborted})}isSame(e){return e.uniqueId===this.uniqueId&&e.status===this.status&&d(e.template,this.template)&&e.ticketId===this.ticketId&&e.storagePath===this.storagePath&&e.scanDate===this.scanDate&&e.scannerId===this.scannerId}static generateCustomerStoragePath({customerId:e,orderId:t,ticketId:s,eventName:a}){let u=`${tn(a).substring(0,30)}_${s}_supplement`;return`user_accounts/${e}/orders/${t}/supplements/${u}.pdf`}static generateGuestStoragePath({orderId:e,ticketId:t,businessId:s,eventName:a}){let u=`${tn(a).substring(0,30)}_${t}_supplement`;return`business_profiles/${s}/orders/${e}/supplements/${u}.pdf`}}return n.TYPE_ID="5832eb8846614fbd9faa9237854359a3",n})(),Aw=class extends f{build(i,e){return tk.fromMap(i,e)}},nk=(()=>{class n extends b{constructor(e,t){super(),this.paymentAccount=e,this.supplements=t}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.paymentAccount,e.supplements)}static fromMap(e,t){return n.create({paymentAccount:e.fromDataOrNull(r.getRecordOrNull(t,"paymentAccount")),supplements:r.getList(t,"supplements",s=>e.fromData(K.decodeRecord(s)))})}toMap(e){return{paymentAccount:e.toDataOrNull(this.paymentAccount),supplements:this.supplements.map(t=>e.toData(t))}}clone(){return this.copyWith()}copyWith({paymentAccount:e=Z(this.paymentAccount),supplements:t=ue(this.supplements)}={}){return n.create({paymentAccount:e,supplements:t})}isSame(e){return e===this?!0:d(e.paymentAccount,this.paymentAccount)&&P(e.supplements,this.supplements,d)}}return n.TYPE_ID="261d6182f59b4c6ca778997d78f7030d",n})(),Cw=class extends f{build(i,e){return nk.fromMap(i,e)}},ik=(()=>{class n extends Le{constructor(e,t,s,a,o,u,c){super(),this.uniqueId=e,this.creatorId=t,this.deviceId=s,this.creationDate=a,this.source=o,this.order=u,this.isRefund=c}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.uniqueId,e.creatorId,e.deviceId,e.creationDate,e.source,e.order,e.isRefund)}static fromMap(e,t){return this.create({uniqueId:r.getString(t,"uniqueId"),creatorId:r.getStringOrNull(t,"creatorId"),deviceId:r.getStringOrNull(t,"deviceId"),creationDate:e.decodeDate(r.getNumber(t,"creationDate")),source:y(r.getString(t,"source"),le),order:e.fromData(r.getRecord(t,"order")),isRefund:r.getBoolean(t,"isRefund")})}toMap(e){return{uniqueId:this.uniqueId,creatorId:this.creatorId,deviceId:this.deviceId,creationDate:e.encodeDate(this.creationDate),source:this.source,order:e.toData(this.order),isRefund:this.isRefund}}clone(){return new n(this.uniqueId,this.creatorId,this.deviceId,this.creationDate,this.source,this.order,this.isRefund)}isSame(e){return e===this?!0:e.uniqueId===this.uniqueId&&e.creatorId===this.creatorId&&e.deviceId===this.deviceId&&e.creationDate.isSame(this.creationDate)&&e.source===this.source&&e.order.isSame(this.order)&&e.isRefund===this.isRefund}static verifyType(e){return e instanceof n}static assertType(e){return e instanceof n}}return n.TYPE_ID="7ce0c3dde643487396ed4993045230f7",n})(),kw=class extends f{build(i,e){return ik.fromMap(i,e)}},sk=(()=>{class n extends b{constructor(e,t,s,a){super(),this.voucherId=e,this.businessRef=t,this.creationDate=s,this.creatorId=a}get $typeId(){return n.TYPE_ID}static create(e){return new n(e.voucherId,e.businessRef,e.creationDate,e.creatorId)}static fromMap(e,t){return n.create({voucherId:r.getString(t,"voucherId"),businessRef:j.mustDecode(r.getString(t,"businessRef")),creationDate:e.decodeDate(r.getInteger(t,"creationDate")),creatorId:r.getString(t,"creatorId")})}toMap(e){return{voucherId:this.voucherId,businessRef:this.businessRef.encode(),creationDate:e.encodeDate(this.creationDate),
3creatorId:this.creatorId}}clone(){return n.create({voucherId:this.voucherId,businessRef:this.businessRef.clone(),creationDate:this.creationDate,creatorId:this.creatorId})}isSame(e){return e===this?!0:e.voucherId===this.voucherId&&d(e.businessRef,this.businessRef)&&e.creationDate===this.creationDate&&e.creatorId===this.creatorId}}return n.TYPE_ID="a27fd06cfbf04519bd759454e9bbb398",n})(),_w=class extends f{build(i,e){return sk.fromMap(i,e)}},xw=class n extends Es{constructor(){super(...arguments),this.orderTypeId=at.TYPE_ID}static verifyType(i){return i instanceof n}static assertType(i){return i instanceof n}getCurrencyOfOrder(i){if(!at.assertType(i))throw new X("order","Order type is not valid");return i.passes.length>0?i.passes[0].price.currency:null}calculateDiscountForOnlineOrder(i){if(!at.assertType(i))throw new X("order","Order type is not valid");return null}calculateCheckoutPriceBreakdownForOnlineOrder(i){var e,t,s,a;if(!at.assertType(i))throw new X("order","Order type is not valid");let o=this.calculatePriceForOnlineEventPassOrder({order:i,applyFee:!1});if(o==null)return null;let u=(t=(e=i.applicationFee)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null,c=(a=(s=i.applicationFee)===null||s===void 0?void 0:s.clone())!==null&&a!==void 0?a:null,l=c!=null?o.add(c):o.clone();return fo.pass({donationPrice:null,itemPrice:o,standardFeePrice:u,totalFeePrice:c,totalPrice:l})}calculateDiscountBreakdownForOrder(i){if(!at.assertType(i))throw new X("order","Order type is not valid");return null}calculateFeeBreakdownForOrder(i){if(!at.assertType(i))throw new X("order","Order type is not valid");return null}calculateCheckoutPriceForOrder(i){if(!at.assertType(i))throw new X("order","Order type is not valid");return this.calculatePriceForOnlineEventPassOrder({order:i,applyFee:!0})}calculateCheckoutPriceForDiscountProvider(i){if(!at.assertType(i))throw new X("order","Order type is not valid");return this.calculatePriceForOnlineEventPassOrder({order:i,applyFee:!1})}calculateIncomeForOrder(i){if(!at.assertType(i))throw new X("order","Order type is not valid");return this.calculatePriceForOnlineEventPassOrder({order:i,applyFee:!1})}calculateIncomeWithoutDiscountForOrder(i){if(!at.assertType(i))throw new X("order","Order type is not valid");return this.calculatePriceForOnlineEventPassOrder({order:i,applyFee:!1})}canCreateRefundForOnlineOrder(i){if(!at.assertType(i))throw new X("order","Order type is not valid");return null}calculateExistingRefundForOrder(i){if(!at.assertType(i))throw new X("order","Order type is not valid");return null}calculateRemainingRefundForOrder(i){if(!at.assertType(i))throw new X("order","Order type is not valid");return null}calculateMaxRefundForOnlineOrder(i){if(!at.assertType(i))throw new X("order","Order type is not valid");return null}calculatePriceForOnlineEventPassOrder({order:i,applyFee:e}){let t=this.getCurrencyOfOrder(i);if(k(t))return null;let s=Y.zero(t);for(let a of i.passes){if(a.price.currency!=t)return null;s=s.add(a.price)}return e&&_(i.applicationFee)&&(s=s.add(i.applicationFee)),s}},kt={};function Rr(n){return n!==null&&typeof n=="object"&&typeof n.applyProducts=="boolean"&&typeof n.applySupplements=="boolean"}function kd(n){return n!==null&&typeof n=="object"&&typeof n.includeStandardFee=="boolean"&&typeof n.includeProductFee=="boolean"&&typeof n.includeProducts=="boolean"&&typeof n.includeSupplements=="boolean"}function ER(n){return n!==null&&typeof n=="object"&&typeof n.includeStandardFee=="boolean"}var Cs=class{static calculateFeeValueForEventTicket(i){let e=i.applicationFee;if(e==null)return null;let t=i.template.price;i.supplement!=null&&(t=t.add(i.supplement.template.price));let s=e.calculateUnitFee(t);return s.isPositive()?{price:s,fee:e}:null}static calculateFeeValueForProductOrderItem(i){let e=i.applicationFee;if(e==null)return null;let t=i.product.price,s=e.calculateUnitFee(t);return s.isPositive()?{price:s.scale(i.quantity),fee:e}:null}},Fw=class n extends Es{constructor(){super(...arguments),this.orderTypeId=We.TYPE_ID}static verifyType(i){return i instanceof n}static assertType(i){return i instanceof n}getCurrencyOfOrder(i){if(!We.assertType(i))throw new X("order","Order type is not val
3id");return i.tickets.length>0?i.tickets[0].template.price.currency:null}calculateDiscountForOnlineOrder(i){if(!We.assertType(i))throw new X("order","Order type is not valid");return null}calculateCheckoutPriceBreakdownForOnlineOrder(i){if(!We.assertType(i))throw new X("order","Order type is not valid");return null}calculateDiscountBreakdownForOrder(i){if(!We.assertType(i))throw new X("order","Order type is not valid");let e=[];for(let t=0;t<i.tickets.length;t++){let s=i.tickets[t];if(s.discount!=null){let a=xt.calculateDiscountValueForSingleItem(s.template.price,s.discount);a!=null&&e.push({price:a,host:{type:"ticket",index:t}})}}if(i.discount!=null){let t=this.calculateCheckoutPriceForDiscountProvider(i,kt);if(t==null)return null;let s=xt.calculateDiscountValueForSingleItem(t,i.discount);s!=null&&e.push({price:s,host:{type:"order"}})}return{entries:e}}calculateFeeBreakdownForOrder(i){if(!We.assertType(i))throw new X("order","Order type is not valid");let e=[];for(let t=0;t<i.tickets.length;t++){let s=i.tickets[t],a=Cs.calculateFeeValueForEventTicket(s);a!=null&&e.push(Object.assign(Object.assign({},a),{host:{type:"ticket",index:t}}))}for(let t=0;t<i.products.length;t++){let s=i.products[t],a=Cs.calculateFeeValueForProductOrderItem(s);a!=null&&e.push(Object.assign(Object.assign({},a),{host:{type:"product",index:t}}))}return{entries:e}}calculateCheckoutPriceForOrder(i){if(!We.assertType(i))throw new X("order","Order type is not valid");return this.calculatePriceForOfflineTicketOrder({order:i,applyProducts:!0,applySupplements:!0,applyDonation:!0,applyFee:!0,discountMode:"Everything"})}calculateCheckoutPriceForDiscountProvider(i,e){if(!We.assertType(i))throw new X("order","Order type is not valid");let t=!1,s=!1;return Rr(e)&&(t=e.applyProducts,s=e.applySupplements),this.calculatePriceForOfflineTicketOrder({order:i,applyProducts:t,applySupplements:s,applyDonation:!1,applyFee:!1,discountMode:"TicketsOnly"})}calculateIncomeForOrder(i,e){if(!We.assertType(i))throw new X("order","Order type is not valid");if(!Rr(e))throw new X("config","Config type is not valid");return this.calculatePriceForOfflineTicketOrder({order:i,applyProducts:e.applyProducts,applySupplements:e.applySupplements,applyDonation:!1,applyFee:!1,discountMode:"Everything"})}calculateIncomeWithoutDiscountForOrder(i,e){if(!We.assertType(i))throw new X("order","Order type is not valid");if(!Rr(e))throw new X("config","Config type is not valid");return this.calculatePriceForOfflineTicketOrder({order:i,applyProducts:e.applyProducts,applySupplements:e.applySupplements,applyDonation:!1,applyFee:!1,discountMode:"None"})}canCreateRefundForOnlineOrder(i){if(!We.assertType(i))throw new X("order","Order type is not valid");return null}calculateExistingRefundForOrder(i){if(!We.assertType(i))throw new X("order","Order type is not valid");return this.calculateExistingRefundForOfflineTicketOrder(i)}calculateRemainingRefundForOrder(i,e){if(!We.assertType(i))throw new X("order","Order type is not valid");if(!kd(e))throw new X("config","Config type is not valid");return this.calculateRemainingRefundForOfflineTicketOrder(i,e)}calculateMaxRefundForOnlineOrder(i,e){if(!We.assertType(i))throw new X("order","Order type is not valid");if(!kd(e))throw new X("config","Config type is not valid");return this.calculateMaxRefundForOfflineTicketOrder(i,e)}calculatePriceForOfflineTicketOrder({order:i,applyProducts:e,applySupplements:t,applyFee:s,applyDonation:a,discountMode:o}){let u=null;if(i.tickets.length>0&&(u=i.tickets[0].template.price.currency),k(u))return null;let c=Y.zero(u);for(let l of i.tickets){if(l.template.price.currency!==u)return null;let h=xt.calculateDiscountedPriceForSingleItem(l.template.price,o!="None"?l.discount:null);c=c.add(h)}if(o=="Everything"&&(c=xt.calculateDiscountedPriceForSingleItem(c,i.discount)),e)for(let l of i.products){if(l.product.price.currency!==u)return null;c=c.add(l.product.price.scale(l.quantity))}if(t)for(let l of i.tickets){if(l.supplement==null)continue;if(l.supplement.template.price.currency!==u)return null;let h=l.supplement.template.price;c=c.add(h)}return s&&(i.standardApplicationFee.isSome&&(c=c.add(i.standardApplicationFee.value)),_(i.productApplicationFee)&&(c=c.add(i.productApplicationFee))),a&&_(i.donation)&&(c=c.add(i.donation)),c}calculateExistingRefundForOfflineTicketOrder(i){let e=null;if(i.tickets.length>0&&(e=i.tickets[0].template.price.currency),k(e))return null;let t=Y.zero(e);for(let s of i.refunds)t=t.add(s.price);return t}calculateRemainingRefundForOfflineTicketOrder(i,e){let t=this.calculateIncomeForOrder(i,{applyProducts:e.includeProducts,applySupplements:e.includeSupplements});if(k(t))return null;i.standardApplicationFee.isSome&&e.includeStandardFee&&(t=t.add(i.standardApplicationFee.value)),i.productApplicationFee!=null&&e.includeProductFee&&(t=t.add(i.productApplicationFee));let s=Y.zero(t.currency);for(let a of i.refunds)s=s.add(a.price);return t.difference(s)}calculateMaxRefundForOfflineTicketOrder(i,e){let t=this.calculateIncomeForOrder(i,{applyProducts:e.includeProducts,applySupplements:e.includeSupplements});return k(t)?null:(i.standardApplicationFee.isSome&&e.includeStandardFee&&(t=t.add(i.standardApplicationFee.value)),i.productApplicationFee!=null&&e.includeProductFee&&(t=t.add(i.productApplicationFee)),t)}}
3,qw=class n extends Es{constructor(){super(...arguments),this.orderTypeId=je.TYPE_ID}static verifyType(i){return i instanceof n}static assertType(i){return i instanceof n}getCurrencyOfOrder(i){if(!je.assertType(i))throw new X("order","Order type is not valid");return i.tickets.length>0?i.tickets[0].template.price.currency:null}calculateDiscountForOnlineOrder(i){if(!je.assertType(i))throw new X("order","Order type is not valid");return this.calculateDiscountForOnlineTicketOrder(i)}calculateCheckoutPriceBreakdownForOnlineOrder(i){var e,t,s,a,o,u;if(!je.assertType(i))throw new X("order","Order type is not valid");let c=this.calculatePriceForOnlineTicketOrder({order:i,applyProducts:!0,applySupplements:!0,applyDonation:!0,applyFee:!0,discountMode:"Everything"}),l=this.calculatePriceForOnlineTicketOrder({order:i,applyProducts:!1,applySupplements:!1,applyDonation:!1,applyFee:!1,discountMode:"Everything"}),h=this.calculatePriceForOnlineTicketOrder({order:i,applyProducts:!0,applySupplements:!1,applyDonation:!1,applyFee:!1,discountMode:"Everything"}),p=this.calculatePriceForOnlineTicketOrder({order:i,applyProducts:!1,applySupplements:!0,applyDonation:!1,applyFee:!1,discountMode:"Everything"});if(c==null||l==null||h==null||p==null)return null;let I=h.compareTo(l)>0?h.difference(l):null,v=p.compareTo(l)>0?p.difference(l):null,E=(t=(e=i.donation)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null,w=i.getTotalFee(),S=(a=(s=i.standardApplicationFee)===null||s===void 0?void 0:s.clone())!==null&&a!==void 0?a:null,R=(u=(o=i.productApplicationFee)===null||o===void 0?void 0:o.clone())!==null&&u!==void 0?u:null;return Ap.create({totalPrice:c,itemPrice:l,productPrice:I,supplementPrice:v,standardFeePrice:S,productFeePrice:R,totalFeePrice:w,donationPrice:E})}calculateDiscountBreakdownForOrder(i){if(!je.assertType(i))throw new X("order","Order type is not valid");let e=[];for(let t=0;t<i.tickets.length;t++){let s=i.tickets[t];if(s.discount!=null){let a=xt.calculateDiscountValueForSingleItem(s.template.price,s.discount);a!=null&&e.push({price:a,host:{type:"ticket",index:t}})}}if(i.discount!=null){let t=this.calculateCheckoutPriceForDiscountProvider(i,kt);if(t==null)return null;let s=xt.calculateDiscountValueForSingleItem(t,i.discount);s!=null&&e.push({price:s,host:{type:"order"}})}return{entries:e}}calculateFeeBreakdownForOrder(i){if(!je.assertType(i))throw new X("order","Order type is not valid");let e=[];for(let t=0;t<i.tickets.length;t++){let s=i.tickets[t],a=Cs.calculateFeeValueForEventTicket(s);a!=null&&e.push(Object.assign(Object.assign({},a),{host:{type:"ticket",index:t}}))}for(let t=0;t<i.products.length;t++){let s=i.products[t],a=Cs.calculateFeeValueForProductOrderItem(s);a!=null&&e.push(Object.assign(Object.assign({},a),{host:{type:"product",index:t}}))}return{entries:e}}calculateCheckoutPriceForOrder(i){if(!je.assertType(i))throw new X("order","Order type is not valid");return this.calculatePriceForOnlineTicketOrder({order:i,applyProducts:!0,applySupplements:!0,applyDonation:!0,applyFee:!0,discountMode:"Everything"})}calculateCheckoutPriceForDiscountProvider(i,e){if(!je.assertType(i))throw new X("order","Order type is not valid");let t=!1,s=!1;return Rr(e)&&(t=e.applyProducts,s=e.applySupplements),this.calculatePriceForOnlineTicketOrder({order:i,applyProducts:t,applySupplements:s,applyDonation:!1,applyFee:!1,discountMode:"TicketsOnly"})}calculateIncomeForOrder(i,e){var t;if(!je.assertType(i))throw new X("order","Order type is not valid");if(!Rr(e))throw new X("config","Config type is not valid");return this.calculatePriceForOnlineTicketOrder({order:i,applyProducts:e.applyProducts,applySupplements:(t=e.applySupplements)!==null&&t!==void 0?t:!0,applyDonation:!1,applyFee:!1,discountMode:"Everything"})}calculateIncomeWithoutDiscountForOrder(i,e){if(!je.assertType(i))throw new X("order","Order type is not valid");if(!Rr(e))throw new X("config","Config type is not valid");return this.calculatePriceForOnlineTicketOrder({order:i,applyProducts:e.applyProducts,applySupplements:e.applySupplements,applyDonation:!1,applyFee:!1,discountMode:"None"})}canCreateRefundForOnlineOrder(i){if(!je.assertType(i))throw new X("order","Order type is not val
3id");return this.canCreateRefundForOnlineTicketOrder(i)}calculateExistingRefundForOrder(i){if(!je.assertType(i))throw new X("order","Order type is not valid");return this.calculateExistingRefundForOnlineTicketOrder(i)}calculateRemainingRefundForOrder(i,e){if(!je.assertType(i))throw new X("order","Order type is not valid");if(!kd(e))throw new X("config","Config type is not valid");return this.calculateRemainingRefundForOnlineTicketOrder(i,e)}calculateMaxRefundForOnlineOrder(i,e){if(!je.assertType(i))throw new X("order","Order type is not valid");if(!kd(e))throw new X("config","Config type is not valid");return this.calculateMaxRefundForOnlineTicketOrder(i,e)}calculateDiscountForOnlineTicketOrder(i){if(k(i.discount))return null;let e=this.calculatePriceForOnlineTicketOrder({order:i,applyProducts:!0,applySupplements:!0,applyDonation:!1,applyFee:!1,discountMode:"TicketsOnly"});if(k(e))return null;let t=xt.calculateDiscountedPriceForSingleItem(e,i.discount);return e.difference(t)}calculatePriceForOnlineTicketOrder({order:i,applyProducts:e,applySupplements:t,applyFee:s,applyDonation:a,discountMode:o}){let u=this.getCurrencyOfOrder(i);if(k(u))return null;let c=Y.zero(u);for(let l of i.tickets){if(l.template.price.currency!==u)return null;let h=xt.calculateDiscountedPriceForSingleItem(l.template.price,o!="None"?l.discount:null);c=c.add(h)}if(o=="Everything"&&(c=xt.calculateDiscountedPriceForSingleItem(c,i.discount)),e)for(let l of i.products){if(l.product.price.currency!==u)return null;c=c.add(l.product.price.scale(l.quantity))}if(t)for(let l of i.tickets){if(l.supplement==null)continue;if(l.supplement.template.price.currency!==u)return null;let h=l.supplement.template.price;c=c.add(h)}return s&&(_(i.standardApplicationFee)&&(c=c.add(i.standardApplicationFee)),_(i.productApplicationFee)&&(c=c.add(i.productApplicationFee))),a&&_(i.donation)&&(c=c.add(i.donation)),c}canCreateRefundForOnlineTicketOrder(i){return i.status!==$e.Refunded?!1:i.refunds.length<=0}calculateExistingRefundForOnlineTicketOrder(i){let e=null;if(i.tickets.length>0&&(e=i.tickets[0].template.price.currency),k(e))return null;let t=Y.zero(e);for(let s of i.refunds)t=t.add(s.price);return t}calculateRemainingRefundForOnlineTicketOrder(i,e){let t=this.calculateIncomeForOrder(i,{applyProducts:e.includeProducts,applySupplements:e.includeSupplements});if(k(t))return null;i.standardApplicationFee!=null&&e.includeStandardFee&&(t=t.add(i.standardApplicationFee)),i.productApplicationFee!=null&&e.includeProductFee&&(t=t.add(i.productApplicationFee));let s=Y.zero(t.currency);for(let a of i.refunds)s=s.add(a.price);return t.difference(s)}calculateMaxRefundForOnlineTicketOrder(i,e){let t=this.calculateIncomeForOrder(i,{applyProducts:e.includeProducts,applySupplements:e.includeSupplements});return k(t)?null:(i.standardApplicationFee!=null&&e.includeStandardFee&&(t=t.add(i.standardApplicationFee)),i.productApplicationFee!=null&&e.includeProductFee&&(t=t.add(i.productApplicationFee)),t)}},Yw=class n extends Es{constructor(){super(...arguments),this.orderTypeId=ot.TYPE_ID}static verifyType(i){return i instanceof n}static assertType(i){return i instanceof n}getCurrencyOfOrder(i){if(!ot.assertType(i))throw new X("order","Order type is not valid");return i.items.length>0?i.items[0].product.price.currency:null}calculateDiscountForOnlineOrder(i){if(!ot.assertType(i))throw new X("order","Order type is not valid");return null}calculateCheckoutPriceBreakdownForOnlineOrder(i){var e,t,s,a,o,u;if(!ot.assertType(i))throw new X("order","Order type is not valid");let c=this.calculatePriceForOnlineProductOrder({order:i,applyDonation:!1,applyFee:!1});if(c==null)return null;let l=(t=(e=i.donation)===null||e===void 0?void 0:e.clone())!==null&&t!==void 0?t:null,h=(a=(s=i.applicationFee)===null||s===void 0?void 0:s.clone())!==null&&a!==void 0?a:null,p=(u=(o=i.applicationFee)===null||o===void 0?void 0:o.clone())!==null&&u!==void 0?u:null,I=c.clone();return l!=null&&(I=I.add(l)),p!=null&&(I=I.add(p)),fo.product({itemPrice:c,donationPrice:l,standardFeePrice:h,totalFeePrice:p,totalPrice:I})}calculateDiscountBreakdownForOrder(i){if(!ot.assertType(i))throw new X("order","Order type is not val
3id");return null}calculateFeeBreakdownForOrder(i){if(!ot.assertType(i))throw new X("order","Order type is not valid");let e=[];for(let t=0;t<i.items.length;t++){let s=i.items[t],a=Cs.calculateFeeValueForProductOrderItem(s);a!=null&&e.push(Object.assign(Object.assign({},a),{host:{type:"product",index:t}}))}return{entries:e}}calculateCheckoutPriceForOrder(i){if(!ot.assertType(i))throw new X("order","Order type is not valid");return this.calculatePriceForOnlineProductOrder({order:i,applyDonation:!0,applyFee:!0})}calculateCheckoutPriceForDiscountProvider(i){if(!ot.assertType(i))throw new X("order","Order type is not valid");return this.calculatePriceForOnlineProductOrder({order:i,applyDonation:!1,applyFee:!1})}calculateIncomeForOrder(i){if(!ot.assertType(i))throw new X("order","Order type is not valid");return this.calculatePriceForOnlineProductOrder({order:i,applyDonation:!1,applyFee:!1})}calculateIncomeWithoutDiscountForOrder(i){if(!ot.assertType(i))throw new X("order","Order type is not valid");return this.calculatePriceForOnlineProductOrder({order:i,applyDonation:!1,applyFee:!1})}canCreateRefundForOnlineOrder(i){if(!ot.assertType(i))throw new X("order","Order type is not valid");return this.canCreateRefundForOnlineProductOrder(i)}calculateExistingRefundForOrder(i){if(!ot.assertType(i))throw new X("order","Order type is not valid");return this.calculateExistingRefundForOnlineProductOrder(i)}calculateRemainingRefundForOrder(i,e){if(!ot.assertType(i))throw new X("order","Order type is not valid");if(!ER(e))throw new X("config","Config type is not valid");return this.calculateRemainingRefundForOnlineProductOrder(i,e)}calculateMaxRefundForOnlineOrder(i,e){if(!ot.assertType(i))throw new X("order","Order type is not valid");if(!ER(e))throw new X("config","Config type is not valid");return this.calculateMaxRefundForOnlineProductOrder(i,e)}calculatePriceForOnlineProductOrder({order:i,applyDonation:e,applyFee:t}){let s=this.getCurrencyOfOrder(i);if(k(s))return null;let a=Y.zero(s);for(let o of i.items){if(o.product.price.currency!=s)return null;a=a.add(o.product.price.scale(o.quantity))}return t&&_(i.applicationFee)&&(a=a.add(i.applicationFee)),e&&_(i.donation)&&(a=a.add(i.donation)),a}canCreateRefundForOnlineProductOrder(i){return i.status!==On.Refunded?!1:i.refunds.length<=0}calculateExistingRefundForOnlineProductOrder(i){let e=null;if(i.items.length>0&&(e=i.items[0].product.price.currency),k(e))return null;let t=Y.zero(e);for(let s of i.refunds)t=t.add(s.price);return t}calculateRemainingRefundForOnlineProductOrder(i,e){let t=this.calculateIncomeForOrder(i);if(k(t))return null;i.applicationFee!=null&&e.includeStandardFee&&(t=t.add(i.applicationFee));let s=Y.zero(t.currency);for(let a of i.refunds)s=s.add(a.price);return t.difference(s)}calculateMaxRefundForOnlineProductOrder(i,e){let t=this.calculateIncomeForOrder(i);return k(t)?null:(i.applicationFee!=null&&e.includeStandardFee&&(t=t.add(i.applicationFee)),t)}},Lt=class{constructor(){this._impl=new Map,this._impl.set(rt.TYPE_ID,new Cp),this._impl.set(at.TYPE_ID,new xw),this._impl.set(We.TYPE_ID,new Fw),this._impl.set(je.TYPE_ID,new qw),this._impl.set(ot.TYPE_ID,new Yw)}static getAdapterForOrder(i){var e;return(e=this._instance._impl.get(i.$typeId))!==null&&e!==void 0?e:null}static getCurrencyOfOrder(i){var e,t;return(t=(e=this.getAdapterForOrder(i))===null||e===void 0?void 0:e.getCurrencyOfOrder(i))!==null&&t!==void 0?t:null}static calculateDiscountForOnlineOrder(i,e){var t,s;return(s=(t=this.getAdapterForOrder(i))===null||t===void 0?void 0:t.calculateDiscountForOnlineOrder(i,e??kt))!==null&&s!==void 0?s:null}static calculateCheckoutPriceBreakdownForOnlineOrder(i,e){var t,s;return(s=(t=this.getAdapterForOrder(i))===null||t===void 0?void 0:t.calculateCheckoutPriceBreakdownForOnlineOrder(i,e??kt))!==null&&s!==void 0?s:null}static calculateDiscountBreakdownForOrder(i,e){var t,s;return(s=(t=this.getAdapterForOrder(i))===null||t===void 0?void 0:t.calculateDiscountBreakdownForOrder(i,e??kt))!==null&&s!==void 0?s:null}static calculateFeeBreakdownForOrder(i,e){var t,s;return(s=(t=this.getAdapterForOrder(i))===null||t===void 0?void 0:t.calculateFeeBreakdownForOrder(i,e??kt))!==null&&s!==void 0?s:null}static calculateCheckoutPriceForOrder(i,e){var t,s;return(s=(t=this.getAdapterForOrder(i))===null||t===void 0?void 0:t.calculateCheckoutPriceForOrder(i,e??kt))!==null&&s!==void 0?s:null}static calculateCheckoutPriceForDiscountProvider(i,e){var t,s;return(s=(t=this.getAdapterForOrder(i))===null||t===void 0?void 0:t.calculateCheckoutPriceForDiscountProvider(i,e??kt))!==null&&s!==void 0?s:null}static calculateIncomeForOrder(i,e){var t,s;return(s=(t=this.getAdapterForOrder(i))===null||t===void 0?void 0:t.calculateIncomeForOrder(i,e??kt))!==null&&s!==void 0?s:null}static calculateIncomeWithoutDiscountForOrder(i,e){var t,s;return(s=(t=this.getAdapterForOrder(i))===null||t===void 0?void 0:t.calculateIncomeWithoutDiscountForOrder(i,e??kt))!==null&&s!==void 0?s:null}static canCreateRefundForOnlineOrder(i,e){var t,s;return(s=(t=this.getAdapterForOrder(i))===null||t===void 0?void 0:t.canCreateRefundForOnlineOrder(i,e??kt))!==null&&s!==void 0?s:null}static calculateExistingRefundForOrder(i,e){var t,s;return(s=(t=this.getAdapterForOrder(i))===null||t===void 0?void 0:t.calculateExistingRefundForOrder(i,e??kt))!==null&&s!==void 0?s:null}static calculateRemainingRefundForOrder(i,e){var t,s;return(s=(t=this.getAdapterForOrder(i))===null||t===void 0?void 0:t.calculateRemainingRefundForOrder(i,e??kt))!==null&&s!==void 0?s:null}static calculateMaxRefundForOnlineOrder(i,e){var t,s;return(s=(t=this.getAdapterForOrder(i))===null||t===void 0?void 0:t.calculateMaxRefundForOnlineOrder(i,e??kt))!==null&&s!==void 0?s:null}static calculateCheckoutPriceForTicketSupplement(i){return i.template.price.clone()}static calculateCheckoutPriceForEventTicket(i,{applySupplement:e}){return this.calculatePriceForEventTicket({ticket:i,applyDiscount:!0,applySupplement:e})}static calculateIncomeForEventTicket(i,{applySupplement:e}){return this.calculatePriceForEventTicket({ticket:i,applyDiscount:!0,applySupplement:e})}static calculateIncomeWithoutDiscountForEventTicket(i,{applySupplement:e}){return this.calculatePriceForEventTicket({ticket:i,applyDiscount:!1,applySupplement:e})}static calculateOriginalIncomeForOfflineTicketOrder(i,{applyProducts:e,applySupplements:t}){if(i.tickets.length<=0||i.tickets[0].template.originalPrice==null)return null;let s=null;if(i.tickets.length>0&&(s=i.tickets[0].template.originalPrice.currency),s==null)return null;let a=Y.zero(s);for(let o of i.tickets){if(o.template.originalPrice==null||o.template.originalPrice.currency!==s)return null;a=a.add(o.template.originalPrice)}if(e)for(let o of i.products){if(o.product.price.currency!=s)return null;a=a.add(o.product.price.scale(o.quantity))}if(t)for(let o of i.tickets){if(o.supplement==null)continue;if(o.supplement.template.price.currency!=s)return null;let u=o.supplement.template.price;a=a.add(u)}return a}static calculatePriceForEventTicket({ticket:i,applySupplement:e,applyDiscount:t}){let s=xt.calculateDiscountedPriceForSingleItem(i.template.price,t?i.discount:null);return e&&i.supplement!=null&&(s=s.add(i.supplement.template.price)),s}};Lt._instance=new Lt;var $w=class{constructor(i){this.state=i}getSeatInfo(i){if(i<0)throw new Error(`Invalid seat ID: ${i}`);return this.ensureInitializedUpTo(i),this.state.seats[i]}updateSeatInfo(i,e){if(i<0)throw new Error(`Invalid seat ID: ${i}`);this.ensureInitializedUpTo(i),e(this.state.seats[i])}swapSeatInfo(i,e,t){if(i<0)throw new Error(`Invalid seat ID: ${i}`);if(e<0)throw new Error(`Invalid seat ID: ${e}`);this.ensureInitializedUpTo(Math.max(i,e));let s=this.state.seats[i],a=this.state.seats[e];return t!=null&&!t(s,a)?!1:(this.state.seats[e]=s,this.state.seats[i]=a,!0)}ensureInitializedUpTo(i){if(!(i<0)&&!(i<this.state.seatCount))for(let e=this.state.seatCount;e<=i;e++)this.state.seats.push(Md.free(e))}},wR=class{},ks=class{static get(i){if(this.cache.has(i))return this.cache.get(i);let e=BigInt(2)**BigInt(i)-BigInt(1);return this.cache.set(i,e),e}static findPrimeLargerThan(i){for(let e of this.MERSENNE_PRIME_EXPONENTS){let t=this.get(e);if(t>i)return W.ok(t)}return W.error(`No Mersenne prime found larger than target {${i}}
3. This should not happen in any realistic scenario.`)}};ks.MERSENNE_PRIME_EXPONENTS=[2,3,5,7,13,17,19,31,61,89,107,127,521,607,1279,2203,2281,3217,4253,4423,9689,9941,11213,19937,21701,23209,44497,86243,110503];ks.cache=new Map;var lr=class{static findShuffledInteger(i,e,t){if(e<=BigInt(0))return W.error("The modulo value must be positive.");if(i<BigInt(0)||i>=e)return W.error("The source value must be in the interval [0, modulo).");for(;t<BigInt(0);)t+=e;let s=i,a=e,o=ks.findPrimeLargerThan(a);if(o.isError)return o;let u=o.value,c=t,l=(u*s+c)%a;return W.ok(l)}static findUnshuffledInteger(i,e,t){if(e<=BigInt(0))return W.error("The modulo value must be positive.");if(i<BigInt(0)||i>=e)return W.error("The shuffled value must be in the interval [0, modulo).");for(;t<BigInt(0);)t+=e;let s=i,a=e,o=ks.findPrimeLargerThan(a);if(o.isError)return o;let u=o.value,c=t,l=this.findModularMultiplicativeInverse(u,a),h=this.findModularAdditiveInverse(c,a),p=l*(s+h)%a;return W.ok(p)}static findModularMultiplicativeInverse(i,e){let t=e,s=i,a=BigInt(0),o=BigInt(1);for(;s>BigInt(1);){let u=s/t,c=t;t=s%t,s=c,c=a,a=o-u*a,o=c}for(;o<BigInt(0);)o+=e;return o}static findModularAdditiveInverse(i,e){let t=-i;for(;t<BigInt(0);)t+=e;return t}},Hr,Yn=class{static findScannerEventCode(i){if(i.length!==ln)return W.error(`Event short code {${i}}, must be {${ln}}, characters long.`);let e=this.shuffleEventShortCode(i);if(e.isError)return W.error(e.error);let t=e.value,s=qe.translate(t,Xt,this.SCANNER_CODE_ALPHABET);if(s.isError)return W.error(s.error);let a=s.value;return this.shuffleScannerCode(a)}static shuffleEventShortCode(i){let e=qe.wordToBigInt(i,Xt);if(e.isError)return W.error(e.error);let t=e.value,s=lr.findShuffledInteger(t,this.EVENT_SHORT_CODE_LANGUAGE_CARDINALITY,this.EVENT_SHORT_CODE_OFFSET);if(s.isError)return W.error(s.error);let a=s.value;return qe.bigIntToWord(a,Xt,ln)}static shuffleScannerCode(i){let e=qe.wordToBigInt(i,this.SCANNER_CODE_ALPHABET);if(e.isError)return W.error(e.error);let t=e.value,s=lr.findShuffledInteger(t,this.SCANNER_CODE_LANGUAGE_CARDINALITY,this.SCANNER_CODE_OFFSET);if(s.isError)return W.error(s.error);let a=s.value;return qe.bigIntToWord(a,this.SCANNER_CODE_ALPHABET,this.SCANNER_CODE_LENGTH)}static findEventShortCode(i){if(i.length!==this.SCANNER_CODE_LENGTH)return W.error(`Scanner event code {${i}}, must be {${this.SCANNER_CODE_LENGTH}}, characters long.`);let e=this.unshuffleScannerCode(i);if(e.isError)return W.error(e.error);let t=e.value,s=qe.translate(t,this.SCANNER_CODE_ALPHABET,Xt,ln);if(s.isError)return W.error(s.error);let a=s.value;return this.unshuffleEventShortCode(a)}static unshuffleScannerCode(i){let e=qe.wordToBigInt(i,this.SCANNER_CODE_ALPHABET);if(e.isError)return W.error(e.error);let t=e.value,s=lr.findUnshuffledInteger(t,this.SCANNER_CODE_LANGUAGE_CARDINALITY,this.SCANNER_CODE_OFFSET);if(s.isError)return W.error(s.error);let a=s.value;return qe.bigIntToWord(a,this.SCANNER_CODE_ALPHABET,this.SCANNER_CODE_LENGTH)}static unshuffleEventShortCode(i){let e=qe.wordToBigInt(i,Xt);if(e.isError)return W.error(e.error);let t=e.value,s=lr.findUnshuffledInteger(t,this.EVENT_SHORT_CODE_LANGUAGE_CARDINALITY,this.EVENT_SHORT_CODE_OFFSET);if(s.isError)return W.error(s.error);let a=s.value;return qe.bigIntToWord(a,Xt,ln)}};Hr=Yn;Yn.EVENT_SHORT_CODE_LANGUAGE_CARDINALITY=qe.getCardinalityOfLanguage(Xt,ln);Yn.PRIME=ks.findPrimeLargerThan(Hr.EVENT_SHORT_CODE_LANGUAGE_CARDINALITY).value;Yn.EVENT_SHORT_CODE_OFFSET=Hr.PRIME;Yn.SCANNER_CODE_ALPHABET=qe.RESTRICTED_ALPHA_NUMERIC;Yn.SCANNER_CODE_LENGTH=Math.ceil(ln*Math.log(Xt.length)/Math.log(Hr.SCANNER_CODE_ALPHABET.length));Yn.SCANNER_CODE_LANGUAGE_CARDINALITY=qe.getCardinalityOfLanguage(Hr.SCANNER_CODE_ALPHABET,Hr.SCANNER_CODE_LENGTH);Yn.SCANNER_CODE_OFFSET=BigInt(0);function*GS(n){for(let i of n.children)yield*rk(i)}function*rk(n){switch(!0){case n instanceof wt:{yield n;return}case n instanceof Dt:for(let i of n.seats)yield i;break;case n instanceof Mt:for(let i of n.children)yield*rk(i);break}}var ct;(function(n){function i(U){var V;let q=U.findComponentByTypeId(Gd.TYPE_ID);return(V=q?.privacyMode)!==null&&V!==void 0?V:null}n.findPrivacyMode=i;function e(U){let V=U.findComponentByTypeId(ws.TYPE_ID);return k(V)?null:V.names}n.findName=e;function t(U){let V=U.findComponentByTypeId(es.TYPE_ID);return k(V)?null:V.descriptions}n.findDescription=t;function s(U){var V,q;let L=U.findComponentByTypeId(dn.TYPE_ID);return(q=(V=L?.dateSpan)===null||V===void 0?void 0:V.from)!==null&&q!==void 0?q:null}n.findStartDate=s;function a(U){var V,q;let L=U.findComponentByTypeId(dn.TYPE_ID);return(q=(V=L?.dateSpan)===null||V===void 0?void 0:V.to)!==null&&q!==void 0?q:null}n.findEndDate=a;function o(U){var V,q;let L=U.findComponentByTypeId(en.TYPE_ID);return k(L)?null:(q=(V=L.portfolio.photos[0])===null||V===void 0?void 0:V.downloadUrl)!==null&&q!==void 0?q:null}n.findCoverImage=o;function u(U){var V,q,L;let J=U.findComponentByTypeId(en.TYPE_ID);return k(J)?null:(L=(q=(V=J.portfolio.photos[0])===null||V===void 0?void 0:V.lods[0])===null||q===void 0?void 0:q.downloadUrl)!==null&&L!==void 0?L:null}n.findCoverImageLod0=u;function c(U){var V,q;let L=U.findComponentByTypeId(en.TYPE_ID);return k(L)?null:(q=(V=L.portfolio.photos[0])===null||V===void 0?void 0:V.storagePath)!==null&&q!==void 0?q:null}n.findCoverImageStoragePath=c;function l(U){var V;let q=U.findComponentByTypeId(_t.TYPE_ID);return(V=q?.displayMode)!==null&&V!==void 0?V:null}n.findLocationDisplayMode=l;function h(U){var V,q,L,J;let ne=U.findComponentByTypeId(_t.TYPE_ID);return(J=(L=(q=(V=ne?.mapLocation)===null||V===void 0?void 0:V.address)===null||q===void 0?void 0:q.locality)===null||L===void 0?void 0:L.uniqueId)!==null&&J!==void 0?J:null}n.findLocalityId=h;function p(U){var V;let q=U.findComponentByTypeId(_t.TYPE_ID);return(V=q?.names)!==null&&V!==void 0?V:null}n.findLocationName=p;function I(U){var V,q,L;let J=U.findComponentByTypeId(_t.TYPE_ID);return(L=(q=(V=J?.mapLocation)===null||V===void 0?void 0:V.address)===null||q===void 0?void 0:q.formattedAddress)!==null&&L!==void 0?L:null}n.findAddress=I;function v(U){var V,q,L,J;let ne=U.findComponentByTypeId(_t.TYPE_ID);return(J=(L=(q=(V=ne?.mapLocation)===null||V===void 0?void 0:V.address)===null||q===void 0?void 0:q.locality)===null||L===void 0?void 0:L.name)!==null&&J!==void 0?J:null}n.findCity=v;function E(U){var V,q;let L=U.findComponentByTypeId(_t.TYPE_ID);return(q=(V=L?.mapLocation)===null||V===void 0?void 0:V.coordinates)!==null&&q!==void 0?q:null}n.findGeoCoordinates=E;function w(U){var V;let q=U.findComponentByTypeId(Dr.TYPE_ID);return(V=q?.classification)!==null&&V!==void 0?V:null}n.findClassification=w;
3function S(U,V){var q,L;return(L=(q=x(U))===null||q===void 0?void 0:q.isFeatured(V))!==null&&L!==void 0?L:null}n.findFeaturedFlag=S;function R(U,V){var q,L;return(L=(q=x(U))===null||q===void 0?void 0:q.featuredScore(V))!==null&&L!==void 0?L:null}n.findFeaturedScore=R;function x(U){return U.findComponentByTypeId(Dr.TYPE_ID)}n.findEventClassificationComponent=x;function N(U){var V;let q=U.findComponentByTypeId(ir.TYPE_ID);return(V=q?.format)!==null&&V!==void 0?V:ni.DateTime}n.getEventDateFormat=N;function O(U){var V;let q=U.findComponentByTypeId(fS.TYPE_ID);return(V=q?.solver)!==null&&V!==void 0?V:null}n.getPassEventOverrideLink=O;function A(U){return U.hasComponentByTypeId(mr.TYPE_ID)}n.isSeated=A;function M(U,V){let q=U.findComponentByTypeId(cs.TYPE_ID);if(q==null)return null;let L=0;for(let J of q.tickets){if(J.quantity.isInfinite)return Ue.infinity;L+=J.quantity.value}for(let J of V)_(J.serialNumber)&&(J.status===Ye.Live||J.status===Ye.Scanned)&&L--;return Ue.finite(L)}n.getRemainingTicketQuantityWithoutSeating=M;function C(U,V,q){let L=new $w(V),J=GS(U),ne=0,Q=new Set;for(let Ne of J){let Ge=L.getSeatInfo(Ne.uniqueId);Ne.tickets.length>0&&Ge.state===th.Free&&(ne++,Q.add(Ne.uniqueId))}if(q==null)return Ue.finite(ne);let ve=new Set(q.entries.filter(Ne=>!Ne.isExpired()).flatMap(Ne=>Ne.seats)),ye=Array.from(ve).filter(Ne=>Q.has(Ne)).length;return ne-=ye,Ue.finite(ne)}n.getRemainingTicketQuantityWithSeating=C;function H(U){var V;let q=U.findComponentByTypeId(vr.TYPE_ID);return(V=q?.url)!==null&&V!==void 0?V:null}n.getThirdPartyEventUrl=H;function B(U){var V;let q=U.findComponentByTypeId(vr.TYPE_ID);return(V=q?.freeEventUrl)!==null&&V!==void 0?V:null}n.getFreeEventUrl=B})(ct||(ct={}));var SR;(function(n){function i({eventProfile:e,dynamicPricingSettings:t,ticketSupplementTemplates:s,ticketPool:a,seatingLayout:o,seatSelectionLock:u,now:c,partnerAppId:l,ignorePrivacyMode:h=!1}){var p;let I=ct.findPrivacyMode(e);if(!h&&(k(I)||I!==Do.Public))return null;let v=ct.findEndDate(e);if(_(v)&&v.isBefore(c))return null;let E=e.webRoute;if(k(E))return null;let w=ct.findName(e);if(k(w))return null;let S=ct.findStartDate(e);if(k(S))return null;let R=l2(e);if(k(R))return null;let x=(p=ct.findCoverImageLod0(e))!==null&&p!==void 0?p:ct.findCoverImage(e);if(Rn(x))return null;let N=ct.getEventDateFormat(e),O=ct.getPassEventOverrideLink(e),A=ct.getThirdPartyEventUrl(e),M=ct.getFreeEventUrl(e),C=u2({eventProfile:e,dynamicPricingSettings:t,ticketSupplementTemplates:s,ticketPool:a,seatingLayout:o,seatSelectionLock:u,now:c}),H=d2(e,l);return Cn.create({uniqueId:e.uniqueId,webRoute:E,country:e.country,localizedName:w,startDate:S,coverImage:x,pricingInfo:C,locationInfo:R,classificationInfo:H,eventDateFormat:N,passEventOverrideLink:O,thirdPartyEventUrl:A,freeEventUrl:M})}n.generate=i})(SR||(SR={}));function u2({eventProfile:n,dynamicPricingSettings:i,ticketSupplementTemplates:e,ticketPool:t,seatingLayout:s,seatSelectionLock:a,now:o}){var u,c,l;let h=n.findComponentByTypeId(cs.TYPE_ID),p=new qf(n);if(k(h))return null;let I=h.tickets.filter(N=>N.scope===ms.Public),v=null;if(s!=null){let N=c2(s),O=A=>N.has(A.uniqueId);if(I=I.filter(O),t!=null){let A=new Set;for(let B of GS(s))B.tickets.some(U=>N.has(U))&&A.add(B.uniqueId);let M=new Set,C=B=>{A.has(B)&&M.add(B)};if(_(a?.entries)){for(let B of a.entries)if(!B.isExpired())for(let U of B.seats)C(U)}let H=(u=t.getSeatingModule())===null||u===void 0?void 0:u.reservedSeats;if(_(H))for(let B of H)C(B);v=A.size-M.size}}if(I.length<=0)return null;let E=null,w=null,S=!0,R=!0;for(let N of I){o<N.dateSpan.from||(R=!1);let A=N.components.hasComponentByTypeId(TS.TYPE_ID),M=N.price,C=(c=e?.find(B=>B.uniqueId===N.ticketSupplementTemplateId))!==null&&c!==void 0?c:null,H=p.calculateFeeForTicketCartItem({ticket:N,supplement:C,quantity:1});if(M=C!=null?M.add(C.price):M,M=M.add(H),A){if(!(N.status===Is.Live&&_(t)&&!t.isSoldOut(N)))continue;S=!1,(k(E)||M.value<E.value)&&(E=M.clone()),(k(w)||M.value>w.value)&&(w=M.clone())}else{let B=_(t)&&t.isSoldOut(N),U=o>=N.dateSpan.from&&o<N.dateSpan.to;if(N.isPurchasable&&N.isPublic&&U&&!B&&(S=!1),!N.isPurchasable||!N.isPublic||!U||B)continue;let V=(l=i?.priceModifiers)===null||l===void 0?void 0:l.get(N.uniqueId);_(V)&&(M=M.add(V)),(k(E)||M.value<E.value)&&(E=M.clone()),(k(w)||M.value>w.value)&&(w=M.clone())}}let x;return R?x=Ri.Upcoming:S?x=Ri.SoldOut:x=Ri.Open,dd.create({saleState:x,remainingTicketCount:v,minPrice:E,maxPrice:w})}function c2(n){let i=new Set;for(let e of GS(n))for(let t of e.tickets)i.add(t);return i}function l2(n){var i;let e=(i=ct.findLocationDisplayMode(n))!==null&&i!==void 0?i:li.Minimal,t=ct.findLocationName(n);if(k(t))return null;if(e===li.Minimal)return fs.create({localizedName:t,address:null,city:null});let s=ct.findCity(n);if(e===li.Approximate)return fs.create({localizedName:t,city:s,address:null});let a=ct.findAddress(n);return fs.create({localizedName:t,address:a,city:s}
3)}function d2(n,i){let e=ct.findClassification(n),t=ct.findFeaturedFlag(n,i),s=ct.findFeaturedScore(n,i);return hd.create({classification:e??[],isFeatured:t??!1,featuredScore:s??0})}var jt=class n{constructor(i,e){this.uniqueId=i,this.names=e}static create(i){return new n(i.uniqueId,i.names)}toTicketTemplate({uniqueId:i,now:e,currency:t}){return eo.create({applicationFee:null,components:new ae([OS.create({uniqueId:this.uniqueId})]),dateSpan:new $S(e,e),isLimited:!1,isPublic:!1,isPurchasable:!1,isPurchasableBySelf:!1,names:this.names.clone(),sideEffects:[],siblingTicketTemplateIds:[],originalPrice:null,price:Y.withCurrencyFromAmount(t,0),quantity:Ue.finite(0),minQuantity:Ue.finite(1),overrideVat:null,richDescriptions:hn.empty(),scanDateSpan:null,scope:ms.Protocol,specialOffer:null,status:Is.Live,uniqueId:i,availabilityModifier:null,ticketSupplementTemplateId:null})}},dY=[jt.create({uniqueId:"AAA",names:Oe.localized(new Map([[$.English,"AAA"]]))}),jt.create({uniqueId:"STAFF",names:Oe.localized(new Map([[$.English,"Staff"],[$.Romanian,"Staff"]]))}),jt.create({uniqueId:"CREW",names:Oe.localized(new Map([[$.English,"Crew"],[$.Romanian,"Echip\u0103"]]))}),jt.create({uniqueId:"ARTIST",names:Oe.localized(new Map([[$.English,"Artist"],[$.Romanian,"Artist"]]))}),jt.create({uniqueId:"STAGE",names:Oe.localized(new Map([[$.English,"Stage"],[$.Romanian,"Scen\u0103"]]))}),jt.create({uniqueId:"BACKSTAGE",names:Oe.localized(new Map([[$.English,"Backstage"],[$.Romanian,"Backstage"]]))}),jt.create({uniqueId:"GUEST",names:Oe.localized(new Map([[$.English,"Guest"],[$.Romanian,"Oaspete"]]))}),jt.create({uniqueId:"PROTOCOL",names:Oe.localized(new Map([[$.English,"Guest"],[$.Romanian,"Protocol"],[$.Hungarian,"Tiszteletjegy"]]))}),jt.create({uniqueId:"PROTOCOL_VIP",names:Oe.localized(new Map([[$.English,"Guest VIP"],[$.Romanian,"Protocol VIP"],[$.Hungarian,"Tiszteletjegy VIP"]]))}),jt.create({uniqueId:"PROTOCOL_GOLD_VIP",names:Oe.localized(new Map([[$.English,"Guest Gold VIP"],[$.Romanian,"Protocol Gold VIP"],[$.Hungarian,"Tiszteletjegy Gold VIP"]]))})];function h2(){let n=new Map;return n.set(Bu.TYPE_ID,new qD),n.set(JN.TYPE_ID,new LD),n.set(KN.TYPE_ID,new VD),n.set(WN.TYPE_ID,new YD),n.set(qP.TYPE_ID,new py),n.set(jN.TYPE_ID,new $D),n.set($P.TYPE_ID,new Iy),n.set(LP.TYPE_ID,new Dy),n.set(VP.TYPE_ID,new yy),n.set(Oa.TYPE_ID,new gy),n.set(sr.TYPE_ID,new aD),n.set(zd.TYPE_ID,new $p),n.set(kr.TYPE_ID,new Yp),n.set(Uu.TYPE_ID,new FD),n.set($R.TYPE_ID,new kp),n.set(Qw.TYPE_ID,new _p),n.set(tN.TYPE_ID,new DI),n.set(eN.TYPE_ID,new II),n.set(Ru.TYPE_ID,new Tg),n.set(eM.TYPE_ID,new xg),n.set(HC.TYPE_ID,new yw),n.set(xl.TYPE_ID,new fw),n.set(VC.TYPE_ID,new pw),n.set(xN.TYPE_ID,new dD),n.set(nA.TYPE_ID,new jy),n.set(hS.TYPE_ID,new Cg),n.set(Ec.TYPE_ID,new Jy),n.set(TS.TYPE_ID,new uI),n.set(sA.TYPE_ID,new Zy),n.set(JR.TYPE_ID,new gg),n.set(Vu.TYPE_ID,new bD),n.set(xa.TYPE_ID,new pg),n.set(mo.TYPE_ID,new Kp),n.set(dM.TYPE_ID,new Kg),n.set(_u.TYPE_ID,new bI),n.set(Fl.TYPE_ID,new gw),n.set(zC.TYPE_ID,new mw),n.set(lP.TYPE_ID,new hv),n.set(rA.TYPE_ID,new Xy),n.set(LR.TYPE_ID,new xp),n.set(wc.TYPE_ID,new Qy),n.set(eS.TYPE_ID,new Fp),n.set(Sc.TYPE_ID,new eb),n.set(aA.TYPE_ID,new tb),n.set(oA.TYPE_ID,new sb),n.set(nr.TYPE_ID,new qp),n.set(Qn.TYPE_ID,new ib),n.set(SP.TYPE_ID,new Bv),n.set(Qu.TYPE_ID,new Sv),n.set(ec.TYPE_ID,new Tv),n.set(mP.TYPE_ID,new Ov),n.set(IP.TYPE_ID,new Rv),n.set(Oi.TYPE_ID,new Vp),n.set(Pl.TYPE_ID,new $0),n.set(uA.TYPE_ID,new rb),n.set(xS.TYPE_ID,new ab),n.set(nS.TYPE_ID,new Up),n.set(Tc.TYPE_ID,new ub),n.set(fr.TYPE_ID,new sp),n.set(po.TYPE_ID,new Bp),n.set(Oc.TYPE_ID,new cb),n.set(cA.TYPE_ID,new lb),n.set(Rc.TYPE_ID,new fb),n.set(_a.TYPE_ID,new Hp),n.set(oP.TYPE_ID,new uv),n.set(Mc.TYPE_ID,new pb),n.set(hM.TYPE_ID,new Zg),n.set(Nc.TYPE_ID,new mb),n.set(go.TYPE_ID,new Gp),n.set(Ac.TYPE_ID,new Db),n.set(Cc.TYPE_ID,new vb),n.set(kc.TYPE_ID,new yb),n.set(uM.TYPE_ID,new Hg),n.set(_c.TYPE_ID,new bb),n.set(xc.TYPE_ID,new Eb),n.set(Fc.TYPE_ID,new wb),n.set(qc.TYPE_ID,new Sb),n.set(Yc.TYPE_ID,new Tb),n.set(Qa.TYPE_ID,new FE),n.set(zu.TYPE_ID,new xD),n.set($c.TYPE_ID,new Ob),n.set(Lc.TYPE_ID,new Rb),n.set(PS.TYPE_ID,new lv),n.set(jd.TYPE_ID,new fD),n.set(ZA.TYPE_ID,new GE),n.set(ZN.TYPE_ID,new zD),n.set(Vc.TYPE_ID,new Mb),n.set(zc.TYPE_ID,new Nb),n.set(Uc.TYPE_ID,new Pb),n.set(Bc.TYPE_ID,new Ab),n.set(Ud.TYPE_ID,new Zp),n.set(Ld.TYPE_ID,new cp),n.set(jc.TYPE_ID,new xb),n.set(Wc.TYPE_ID,new _b),n.set(hA.TYPE_ID,new Fb),n.set(qS.TYPE_ID,new gb),n.set(Cu.TYPE_ID,new jm),n.set(Ic.TYPE_ID,new wy),n.set(XN.TYPE_ID,new UD),n.set(fA.TYPE_ID,new qb),n.set(Mi.TYPE_ID,new rg),n.set(Ka.TYPE_ID,new Yb),n.set(GR.TYPE_ID,new ag),n.set($C.TYPE_ID,new dw),n.set(YM.TYPE_ID,new Um),n.set(Jc.TYPE_ID,new Vb),n.set(mA.TYPE_ID,new zb),n.set(GC.TYPE_ID,new bw),n.set(Wl.TYPE_ID,new Qp),n.set(Hc.TYPE_ID,new Cb),n.set(Gc.TYPE_ID,new kb),n.set(zR.TYPE_ID,new tg),n.set(WC.TYPE_ID,new Ew),n.set(tM.TYPE_ID,new qg),n.set(pA.TYPE_ID,new $b),n.set(nM.TYPE_ID,new Yg),n.set(aS.TYPE_ID,new Xp),n.set($a.TYPE_ID,new ID),n.set(YN.TYPE_ID,new yD),n.set(IA.TYPE_ID,new Ub),n.set(DA.TYPE_ID,new Bb),n.set(NS.TYPE_ID,new DD),n.set(La.TYPE_ID,new vD),n.set(ir.TYPE_ID,new Fg),n.set($S.TYPE_ID,new Hb),n.set(dn.TYPE_ID,new Xg),n.set(xu.TYPE_ID,new EI),n.set(Mn.TYPE_ID,new gD),n.set(fM.TYPE_ID,new Qg),n.set(Tn.TYPE_ID,new Bf),n.set(bc.TYPE_ID,new Uy),n.set(tA.TYPE_ID,new Wy),n.set(pM.TYPE_ID,new em),n.set(TP.TYPE_ID,new Hv),n.set(Uw.TYPE_ID,new Uf),n.set(gM.TYPE_ID,new tm),n.set(Po.TYPE_ID,new Op),n.set(Ku.TYPE_ID,new Dv),n.set(BP.TYPE_ID,new Sy),n.set(lS.TYPE_ID,new Og),n.set(mM.TYPE_ID,new nm),n.set(yA.TYPE_ID,new Gb),n.set(bA.TYPE_ID,new Wb),n.set(Dr.TYPE_ID,new _g),n.set(EA.TYPE_ID,new Kb),n.set(XC.TYPE_ID,new Mw),n.set(dN.TYPE_ID,new FI),n.set(hN.TYPE_ID,new qI),n.set(fN.TYPE_ID,new YI),n.set(pN.TYPE_ID,new $I),n.set(ns.TYPE_ID,new cD),n.set(Gd.TYPE_ID,new bg),n.set(Kc.TYPE_ID,new Jb),n.set(eh.TYPE_ID,new jb),n.set(dr.TYPE_ID,new Zf),n.set(IC.TYPE_ID,new A0),n.set(CC.TYPE_ID,new Q0),n.set(aP.TYPE_ID,new ov),n.set(An.TYPE_ID,new ap),n.set(We.TYPE_ID,new up),n.set(wA.TYPE_ID,new Zb),n.set(IM.TYPE_ID,new im),n.set(SA.TYPE_ID,new Xb),n.set(TA.TYPE_ID,new Qb),n.set(DM.TYPE_ID,new rm),n.set(Xa.TYPE_ID,new eE),n.set(Zc.TYPE_ID,new tE),n.set(Pa.TYPE_ID,new Ff),n.set(OA.TYPE_ID,new nE),n.set(RA.TYPE_ID,new iE),n.set(nN.TYPE_ID,new vI),n.set(zw.TYPE_ID,new zf),n.set(MA.TYPE_ID,new rE),n.set(Kl.TYPE_ID,new Jm),n.set(vM.TYPE_ID,new am),n.set(ma.TYPE_ID,new om),n.set(QR.TYPE_ID,new kg),n.set(UP.TYPE_ID,new Ey),n.set(LS.TYPE_ID,new aE),n.set(BR.TYPE_ID,new ig),n.set(Xc.TYPE_ID,new oE),n.set(gA.TYPE_ID,new Lb),n.set(Xu.TYPE_ID,new bv),n.set($l.TYPE_ID,new ww),n.set(hc.TYPE_ID,new ty),n.set(iS.TYPE_ID,new Wp),n.set(Qc.TYPE_ID,new uE),n.set(el.TYPE_ID,new hE),n.set(PA.TYPE_ID,new fE),n.set(Ia.TYPE_ID,new um),n.set(nd.TYPE_ID,new RD),n.set(Zi.TYPE_ID,new MD),n.set(ii.TYPE_ID,new ND),n.set(Mu.TYPE_ID,new Rg),n.set(za.TYPE_ID,new PD),n.set(XP.TYPE_ID,new Yy),n.set(yM.TYPE_ID,new cm),n.set(bM.TYPE_ID,new lm),n.set(sS.TYPE_ID,new jp),n.set(Tu.TYPE_ID,new fg),n.set(Da.TYPE_ID,new dm),n.set(VR.TYPE_ID,new zp),n.set(FN.TYPE_ID,new pD),n.set(Ou.TYPE_ID,new mg),n.set(_l.TYPE_ID,new uw),n.set(Va.TYPE_ID,new OD),n.set(EM.TYPE_ID,new hm),n.set(tl.TYPE_ID,new pE),n.set(va.TYPE_ID,new fm),n.set(sP.TYPE_ID,new av),n.set(wM.TYPE_ID,new pm),n.set(ju.TYPE_ID,new fv),n.set(uS.TYPE_ID,new vg),n.set(jM.TYPE_ID,new oI),n.set(Wu.TYPE_ID,new rv),n.set(JP.TYPE_ID,new Ny),n.set(kl.TYPE_ID,new ew),n.set(KP.TYPE_ID,new Py),n.set(pP.TYPE_ID,new Ev),n.set(gP.TYPE_ID,new wv),n.set(nl.TYPE_ID,new gE),n.set(Or.TYPE_ID,new db),n.set(SM.TYPE_ID,new gm),n.set(ws.TYPE_ID,new mm),n.set(AA.TYPE_ID,new mE),n.set(Wd.TYPE_ID,new Jg),n.set(jR.TYPE_ID,new cg),n.set(hn.TYPE_ID,new dg),n.set(es.TYPE_ID,new hg),n.set(TM.TYPE_ID,new Im),n.set(Oe.TYPE_ID,new Yf),n.set(_t.TYPE_ID,new wg),n.set(CA.TYPE_ID,new IE),n.set(vP.TYPE_ID,new Nv),n.set(DP.TYPE_ID,new Mv),n.set(yP.TYPE_ID,new Pv),n.set(bP.TYPE_ID,new Av),n.set(tS.TYPE_ID,new Lp),n.set(ts.TYPE_ID,new Dm),n.set(ZC.TYPE_ID,new Rw),n.set(OM.TYPE_ID,new vm),n.set(Yu.TYPE_ID,new AI),n.set(Au.TYPE_ID,new xm),n.set($u.TYPE_ID,new CI),n.set(qN.TYPE_ID,new mD),n.set(nP.TYPE_ID,new jD),n.set(iP.TYPE_ID,new KD),n.set(il.TYPE_ID,new DE),n.set(gi.TYPE_ID,new dp),n.set(cN.TYPE_ID,new _I),n.set(lN.TYPE_ID,new xI),n.set(PP.TYPE_ID,new sy),n.set(kA.TYPE_ID,new vE),n.set(Vd.TYPE_ID,new lp),n.set(_A.TYPE_ID,new yE),n.set(LC.TYPE_ID,new hw),n.set(UR.TYPE_ID,new ng),n.set(aM.TYPE_ID,new Vg),n.set(rM.TYPE_ID,new Lg),n.set(KC.TYPE_ID,new Ow),n.set(XR.TYPE_ID,new Ag),n.set(qA.TYPE_ID,new bE),n.set(JM.TYPE_ID,new cI),n.set(Lu.TYPE_ID,new kI),n.set(ya.TYPE_ID,new ym),n.set(YA.TYPE_ID,new EE),n.set(rc.TYPE_ID,new Lv),n.set(wN.TYPE_ID,new jI),n.set(SN.TYPE_ID,new JI),n.set(TN.TYPE_ID,new KI),n.set(ON.TYPE_ID,new ZI),n.set(RN.TYPE_ID,new XI),n.set($d.TYPE_ID,new op),n.set(QC.TYPE_ID,new Nw),n.set($A.TYPE_ID,new SE),n.set(rt.TYPE_ID,new hp),n.set(sc.TYPE_ID,new Yv),n.set(at.TYPE_ID,new fp),n.set(gN.TYPE_ID,new LI),n.set(je.TYPE_ID,new pp),n.set(NN.TYPE_ID,new eD),n.set(PN.TYPE_ID,new tD),n.set(AN.TYPE_ID,new nD),n.set(CN.TYPE_ID,new iD),n.set(rl.TYPE_ID,new OE),n.set(kN.TYPE_ID,new sD),n.set(sl.TYPE_ID,new TE),n.set(ot.TYPE_ID,new Sp),n.set(DN.TYPE_ID,new UI),n.set(vN.TYPE_ID,new BI),n.set(ik.TYPE_ID,new kw),n.set(yN.TYPE_ID,new HI),n.set(bN.TYPE_ID,new GI),n.set(EN.TYPE_ID,new WI),n.set(ZM.TYPE_ID,new dI),n.set(di.TYPE_ID,new tv),n.set(UA.TYPE_ID,new PE),n.set(oc.TYPE_ID,new zv),n.set(Nu.TYPE_ID,new Ug),n.set(BA.TYPE_ID,new AE),n.set(GA.TYPE_ID,new kE),n.set(MP.TYPE_ID,new ey),n.set(NP.TYPE_ID,new iy),n.set(LA.TYPE_ID,new RE),n.set(dc.TYPE_ID,new Qv),n.set(VA.TYPE_ID,new ME),n.set(zA.TYPE_ID,new NE),n.set(HA.TYPE_ID,new CE),n.set(fc.TYPE_ID,new ay),n.set(_S.TYPE_ID,new ry),n.set(lc.TYPE_ID,new Xv),n.set(ol.TYPE_ID,new xE),n.set(al.TYPE_ID,new _E),n.set(ci.TYPE_ID,new np),n.set(ka.TYPE_ID,new tp),n.set(Fu.TYPE_ID,new SI),n.set(YP.TYPE_ID,new my),n.set(Ln.TYPE_ID,new Ep),n.set(Hu.TYPE_ID,new WD),n.set(cM.TYPE_ID,new Wg),n.set(ul.TYPE_ID,new qE),n.set(ql.TYPE_ID,new Iw),n.set(UC.TYPE_ID,new Dw),n.set(MM.TYPE_ID,new bm),n.set(Bd.TYPE_ID,new eg),n.set(WA.TYPE_ID,new YE),n.set(jA.TYPE_ID,new $E),n.set(JA.TYPE_ID,new LE),n.set(KA.TYPE_ID,new VE),n.set(ac.TYPE_ID,new Vv),n.set(fS.TYPE_ID,new $g),n.set(pC.TYPE_ID,new N0),n.set(AC.TYPE_ID,new X0),n.set(cl.TYPE_ID,new UE),n.set(VS.TYPE_ID,new zE),n.set(ll.TYPE_ID,new BE),n.set(dl.TYPE_ID,new HE),n.set(Er.TYPE_ID,new Lm),n.set(ls.TYPE_ID,new Vm),n.set(No.TYPE_ID,new Vf),n.set(EP.TYPE_ID,new Cv),n.set(wP.TYPE_ID,new kv),n.set(hl.TYPE_ID,new jE),n.set(XA.TYPE_ID,new WE),n.set(FS.TYPE_ID,new ob),n.set(QA.TYPE_ID,new JE),n.set(Ta.TYPE_ID,new yI),n.set(Fa.TYPE_ID,new Eg),n.set(us.TYPE_ID,new Sg),n.set(yr.TYPE_ID,new Em),n.set(eC.TYPE_ID,new ZE),n.set(NM.TYPE_ID,new wm),n.set(tP.TYPE_ID,new GD),n.set(iC.TYPE_ID,new c0),n.set(sC.TYPE_ID,new d0),n.set(zM.TYPE_ID,new Km),n.set(ku.TYPE_ID,new Zm),n.set(fl.TYPE_ID,new XE),n.set(yS.TYPE_ID,new Bm),n.set(gl.TYPE_ID,new e0),n.set(pl.TYPE_ID,new QE),n.set(ml.TYPE_ID,new t0),n.set(nC.TYPE_ID,new n0),n.set($M.TYPE_ID,new Hm),n.set(vl.TYPE_ID,new a0),n.set(Il.TYPE_ID,new i0),n.set(Dl.TYPE_ID,new s0),n.set(UM.TYPE_ID,new Xm),n.set(LM.TYPE_ID,new Gm),n.set(OS.TYPE_ID,new pI),n.set(Wa.TYPE_ID,new iv),n.set(Vn.TYPE_ID,new Rp),n.set(ba.TYPE_ID,new Sm),n.set(DS.TYPE_ID,new Ym),n.set(Sa.TYPE_ID,new $m),n.set(GP.TYPE_ID,new Oy),n.set(Dc.TYPE_ID,new Ay),n.set(ic.TYPE_ID,new qv),n.set(ZP.TYPE_ID,new Fy),n.set(dS.TYPE_ID,new Pg),n.set(lM.TYPE_ID,new jg),n.set(vc.TYPE_ID,new xy),n.set(yc.TYPE_ID,new qy),n.set(bl.TYPE_ID,new f0),n.set(IS.TYPE_ID,new Tm),n.set(PM.TYPE_ID,new Om),n.set(Pu.TYPE_ID,new Rm),n.set(yl.TYPE_ID,new h0),n.set(aC.TYPE_ID,new p0),n.set(AM.TYPE_ID,new Mm),n.set(en.TYPE_ID,new ug),n.set(oM.TYPE_ID,new Bg),n.set(oC.TYPE_ID,new g0),n.set(uC.TYPE_ID,new m0),n.set(El.TYPE_ID,new I0),n.set(cC.TYPE_ID,new D0),n.set(jP.TYPE_ID,new My),n.set(WP.TYPE_ID,new Ry),n.set(VM.TYPE_ID,new Wm),n.set(rS.TYPE_ID,new Jp),n.set(lC.TYPE_ID,new v0),n.set(JC.TYPE_ID,new Tw),n.set(dC.TYPE_ID,new y0),n.set(YC.TYPE_ID,new cw),n.set(Ea.TYPE_ID,new Nm),n.set(rr.TYPE_ID,new oD),n.set(wl.TYPE_ID,new b0),n.set(Sl.TYPE_ID,new E0),n.set(kM.TYPE_ID,new Am),n.set(CM.TYPE_ID,new Pm),n.set(hC.TYPE_ID,new w0),n.set(Hd.TYPE_ID,new lg),n.set(dP.TYPE_ID,new mv),n.set(Gu.TYPE_ID,new ZD),n.set(HR.TYPE_ID,new sg),n.set(fC.TYPE_ID,new S0),n.set(zS.TYPE_ID,new T0),n.set(Ns.TYPE_ID,new M0),n.set(uc.TYPE_ID,new Uv),n.set(mN.TYPE_ID,new VI),n.set(IN.TYPE_ID,new zI),n.set(MN.TYPE_ID,new QI),n.set(_N.TYPE_ID,new rD),n.set(ar.TYPE_ID,new lD),n.set(uP.TYPE_ID,new cv),n.set(QP.TYPE_ID,new $y),n.set(cP.TYPE_ID,new dv),n.set(mr.TYPE_ID,new yg),n.set(Tl.TYPE_ID,new C0),n.set(Ol.TYPE_ID,new k0),n.set(mC.TYPE_ID,new P0),n.set(eA.TYPE_ID,new Ly),n.set(Rl.TYPE_ID,new _0),n.set(bs.TYPE_ID,new Tp),n.set(bS.TYPE_ID,new Qm),n.set(BM.TYPE_ID,new eI),n.set(ES.TYPE_ID,new tI),n.set(ur.TYPE_ID,new sE),n.set(oi.TYPE_ID,new nI),n.set(gr.TYPE_ID,new Mp),n.set(Jt.TYPE_ID,new Np),n.set(HM.TYPE_ID,new iI),n.set(GM.TYPE_ID,new sI),n.set(Ot.TYPE_ID,new Pp),n.set(wS.TYPE_ID,new rI),n.set(kC.TYPE_ID,new nw),n.set(jC.TYPE_ID,new Sw),n.set(rP.TYPE_ID,new sv),n.set(xC.TYPE_ID,new sw),n.set(Ml.TYPE_ID,new x0),n.set(mS.TYPE_ID,new Gg),n.set(Qd.TYPE_ID,new hb),n.set(SS.TYPE_ID,new aI),n.set(Nl.TYPE_ID,new F0),n.set(Ki.TYPE_ID,new q0),n.set(DC.TYPE_ID,new Y0),n.set(_C.TYPE_ID,new iw),n.set(Ju.TYPE_ID,new Iv),n.set(EC.TYPE_ID,new L0),n.set(_M.TYPE_ID,new Cm),n.set($N.TYPE_ID,new ED),n.set(eP.TYPE_ID,new HD),n.set(QN.TYPE_ID,new BD),n.set(LN.TYPE_ID,new wD),n.set(zP.TYPE_ID,new by),n.set(VN.TYPE_ID,new TD),n.set(KR.TYPE_ID,new Dg),n.set(Ga.TYPE_ID,new nv),n.set(qu.TYPE_ID,new TI),n.set(BC.TYPE_ID,new vw),n.set(NC.TYPE_ID,new J0),n.set(wC.TYPE_ID,new V0),n.set(Pc.TYPE_ID,new Ib),n.set(oS.TYPE_ID,new Ig),n.set(tc.TYPE_ID,new xv),n.set(nc.TYPE_ID,new Fv),n.set(KM.TYPE_ID,new lI),n.set(cc.TYPE_ID,new Gv),n.set(ui.TYPE_ID,new ep),n.set(Ca.TYPE_ID,new Xf),n.set(SC.TYPE_ID,new z0),n.set(HP.TYPE_ID,new Ty),n.set(FC.TYPE_ID,new rw),n.set(fP.TYPE_ID,new vv),n.set(Zu.TYPE_ID,new yv),n.set(XM.TYPE_ID,new hI),n.set(QM.TYPE_ID,new fI),n.set(MC.TYPE_ID,new j0),n.set(Cl.TYPE_ID,new K0),n.set(PC.TYPE_ID,new Z0),n.set(tk.TYPE_ID,new Aw),n.set(nk.TYPE_ID,new Cw),n.set(ek.TYPE_ID,new Pw),n.set(eo.TYPE_ID,new U0),n.set(Al.TYPE_ID,new B0),n.set(ZR.TYPE_ID,new Mg),n.set(cs.TYPE_ID,new Ng),n.set(OC.TYPE_ID,new H0),n.set(RC.TYPE_ID,new W0),n.set(Pt.TYPE_ID,new hD),n.set(Id.TYPE_ID,new nb),n.set(WR.TYPE_ID,new og),n.set(xM.TYPE_ID,new km),n.set(hr.TYPE_ID,new ip),n.set(wa.TYPE_ID,new _m),n.set(Bw.TYPE_ID,new Qf),n.set(sk.TYPE_ID,new _w),n.set(qC.TYPE_ID,new ow),n.set(ei.TYPE_ID,new aw),n.set(zN.TYPE_ID,new CD),n.set(UN.TYPE_ID,new _D),n.set(vr.TYPE_ID,new zg),n.set(CS.TYPE_ID,new Wv),n.set(OP.TYPE_ID,new jv),n.set(kS.TYPE_ID,new Jv),n.set(Zd.TYPE_ID,new Kv),n.set(Xd.TYPE_ID,new Zv),n.set(iN.TYPE_ID,new OI),n.set(sN.TYPE_ID,new RI),n.set(rN.TYPE_ID,new MI),n.set(aN.TYPE_ID,new NI),n.set(oN.TYPE_ID,new PI),n.set(MS.TYPE_ID,new wI),n.set(FM.TYPE_ID,new Fm),n.set(qM.TYPE_ID,new qm),n.set($r.TYPE_ID,new ky),n.set(Tr.TYPE_ID,new _y),n.set(vS.TYPE_ID,new zm),n.set(ho.TYPE_ID,new wp),n.set(Jw.TYPE_ID,new D
3p),n.set(Gw.TYPE_ID,new gp),n.set(jw.TYPE_ID,new Ip),n.set(Ww.TYPE_ID,new mp),n.set(Zw.TYPE_ID,new yp),n.set(Kw.TYPE_ID,new vp),n.set(Xw.TYPE_ID,new bp),n.set(pc.TYPE_ID,new oy),n.set(AP.TYPE_ID,new uy),n.set(xP.TYPE_ID,new hy),n.set(FP.TYPE_ID,new fy),n.set(iA.TYPE_ID,new Ky),n.set(kP.TYPE_ID,new ly),n.set(AS.TYPE_ID,new _v),n.set(ja.TYPE_ID,new $v),n}function hY(n){var i;let e=h2();if(_(n.customBuilders))for(let[t,s]of n.customBuilders)e.set(t,s);Et.ensureInitialized(e,n.databaseIdGenerator,(i=n.unknownTypePolicy)!==null&&i!==void 0?i:_d.Log)}function fY(n){Kn.ensureInitialized(n)}var mY="qft05GjztKZgN5ACyiQ2a1j7Iumy",ak="oYtHkbBW1x0LcGdMbunk9TDOeEC1";function IY(n){return Rn(n)?null:n}var f2="hu",Kr={production:!0,appId:ak,i18nHash:"74aa1fabcef939b0622f0b77cc389de0",defaultLanguage:"hu",routingLanguage:f2,allowLogging:!0,allowGtmTracking:!1,canChangeLanguage:!1,allowLanguageOverride:!0,useGoogleMapsEmbed:!0,useApiEmulator:!1,ticketPlatformUrl:"https://in-time.hu",apiGatewayUrl:"https://in-time-api-gateway-46gavk95.ew.gateway.dev",firebase:{apiKey:"AIzaSyAhr_ou2x0K0stfQyTcCewQdiz-3tHmhjQ",authDomain:"in-time-db42c.firebaseapp.com",databaseURL:"https://in-time-db42c.firebaseio.com",projectId:"in-time-db42c",storageBucket:"in-time-db42c.appspot.com",messagingSenderId:"327503077961",appId:"1:327503077961:web:5443e61568229f24835598",measurementId:"G-JJXSX3L585"}};var nh=Bt(Lh(),1),uk=Bt(sf(),1),ck=Bt(of(),1);function Zr(n){return n==null}function WS(n){return Zr(n)?!0:n.length<=0}var Me=(function(n){return n[n.Debug=0]="Debug",n[n.Info=1]="Info",n[n.Warning=2]="Warning",n[n.Error=3]="Error",n[n.Exception=4]="Exception",n[n.Fatal=5]="Fatal",n})(Me||{}),p2=new Map([[Me.Debug,0],[Me.Info,1],[Me.Warning,2],[Me.Error,3],[Me.Exception,4],[Me.Fatal,5]]),EY=new Map([[0,Me.Debug],[1,Me.Info],[2,Me.Warning],[3,Me.Error],[4,Me.Exception],[5,Me.Fatal]]),g2=new Map([[Me.Debug,"DEBUG"],[Me.Info,"INFO"],[Me.Warning,"WARNING"],[Me.Error,"ERROR"],[Me.Exception,"EXCEPTION"],[Me.Fatal,"FATAL"]]),wY=new Map([["DEBUG",Me.Debug],["INFO",Me.Info],["WARNING",Me.Warning],["ERROR",Me.Error],["EXCEPTION",Me.Exception],["FATAL",Me.Fatal]]);function ok(n){let i=p2.get(n);if(Zr(i))throw new Error("Unknown log level: ${logLevel}");return i}function m2(n){let i=g2.get(n);if(Zr(i))throw new Error("Unknown log level: ${logLevel}");return i}var jS=class{constructor(i){this.channels=i}setChannels(i){this.channels=i}clearChannels(){this.channels=null}isChannelOn(i=null){var e,t;return Zr(i)?!0:(t=(e=this.channels)===null||e===void 0?void 0:e.isOn(i))!==null&&t!==void 0?t:!0}meetsPriority(i){return ok(i)>=ok(this.logLevel)}};nh.default.extend(uk.default);nh.default.extend(ck.default);var SY=(()=>{class n extends jS{constructor(e,t,s=null){super(s),this.logLevel=e,this.appName=t}getLogPrefix(e){let t=this.appName,s=m2(e),a=(0,nh.default)().tz(n.timezone).format(n.dateFormat);return`[${s} | ${a} | ${t}]`}logDebug(e,t){if(this.meetsPriority(Me.Debug)&&this.isChannelOn(t?.channel)){let s=this.getLogPrefix(Me.Debug);console.debug(`${s} ${e}`)}}logInfo(e,t){if(this.meetsPriority(Me.Info)&&this.isChannelOn(t?.channel)){let s=this.getLogPrefix(Me.Info);console.info(`${s} ${e}`)}}logWarning(e,t){if(this.meetsPriority(Me.Warning)&&this.isChannelOn(t?.channel)){let s=this.getLogPrefix(Me.Warning);console.warn(`${s} ${e}`)}}logError(e,t){if(this.meetsPriority(Me.Error)&&this.isChannelOn(t?.channel)){let s=this.getLogPrefix(Me.Error);WS(t?.stackTrace)?console.error(`${s} ${e}`):console.error(`${s} ${e} ${t?.stackTrace}`)}}logException(e,t){if(this.meetsPriority(Me.Exception)&&this.isChannelOn(t?.channel)){let s=this.getLogPrefix(Me.Exception);WS(t?.stackTrace)?console.error(`${s} ${e}`):console.error(`${s} ${e} ${t?.stackTrace}`)}}logFatal(e,t){if(this.meetsPriority(Me.Fatal)&&this.isChannelOn(t?.channel)){let s=this.getLogPrefix(Me.Fatal);WS(t?.stackTrace)?console.error(`${s} ${e}`):console.error(`${s} ${e} ${t?.stackTrace}`)}}}return n.dateFormat="YYYY-MM-DD @ HH:mm:ss",n.timezone="Europe/Bucharest",n})(),Co=[];function TY(n){Co.length=0,Co.push(...n)}function I2(n,i){return Zr(n)?null:i===!0?JSON.stringify(n,null,2):typeof n=="string"?n:n.toString()}function Xr(n,i){for(let e of Co)e.logDebug(n,i)}function OY(n,i){for(let e of Co)e.logInfo(n,i)}function qi(n,i,e){let t=I2(i,e?.stringify),s=Zr(t)?n:`${n}${t}`;for(let a of Co)a.logError(s,e)}var D2=["home","event","events","faq","tables","vip","work-with-us","apply-now","register","grant","house-rules","impresszum","privacy-policy","gtc","online-drinks-terms","job-application-complete","table-reservation-complete","partner-card","mymeki","drinks-menu"];function ko(n){return D2.includes(n)}var lk=new Map([["en",new Map([["home","Pl\xE1zs Si\xF3fok - The iconic location of the Balaton summer | Concerts, Beach & Party"],["events","Pl\xE1zs Si\xF3fok - Events"],["faq","Pl\xE1zs Si\xF3fok - FAQ"],["tables","Pl\xE1zs Si\xF3fok - Table reservation"],["vip","Pl\xE1zs Si\xF3fok - VIP"],["work-with-us","Pl\xE1zs Si\xF3fok - Work with us"],["apply-now","Pl\xE1zs Si\xF3fok - Work with us | Apply now"],["register","Pl\xE1zs Si\xF3fok - Opening weekend registration"],["grant","Pl\xE1zs Si\xF3fok - Information about participating in the competition"],["house-rules","Pl\xE1zs Si\xF3fok - House rules"],["impresszum","Pl\xE1zs Si\xF3fok - Impresszum"],["privacy-policy","Pl\xE1zs Si\xF3fok - Privacy policy"],["gtc","Pl\xE1zs Si\xF3fok - Terms and conditions"],["online-drinks-terms","Pl\xE1zs Si\xF3fok - Online drinks terms"],["job-application-complete","Pl\xE1zs Si\xF3fok - Work with us | Thank y
3ou"],["table-reservation-complete","Pl\xE1zs Si\xF3fok - Table reservation | Thank you"],["partner-card","Pl\xE1zs Si\xF3fok - Partner card"],["mymeki","Pl\xE1zs Si\xF3fok - MyMeki"],["drinks-menu","Pl\xE1zs Si\xF3fok - Drinks Menu"]])],["hu",new Map([["home","Pl\xE1zs Si\xF3fok - A balatoni ny\xE1r ikonikus helysz\xEDne | Koncertek, Beach & Party"],["events","Pl\xE1zs Si\xF3fok - Esem\xE9nyek"],["faq","Pl\xE1zs Si\xF3fok - Inform\xE1ci\xF3k"],["tables","Pl\xE1zs Si\xF3fok - Asztalfoglal\xE1s"],["vip","Pl\xE1zs Si\xF3fok - VIP"],["work-with-us","Pl\xE1zs Si\xF3fok - Dolgozz vel\xFCnk"],["apply-now","Pl\xE1zs Si\xF3fok - Dolgozz vel\xFCnk | Jelentkez\xE9s"],["register","Pl\xE1zs Si\xF3fok - Nyit\xF3 h\xE9tv\xE9ge regisztr\xE1ci\xF3"],["grant","Pl\xE1zs Si\xF3fok - T\xE1j\xE9koztat\xE1s p\xE1ly\xE1zatban val\xF3 r\xE9szv\xE9telr\u0151l"],["house-rules","Pl\xE1zs Si\xF3fok - H\xE1zirend"],["impresszum","Pl\xE1zs Si\xF3fok - Impresszum"],["privacy-policy","Pl\xE1zs Si\xF3fok - Adatv\xE9delmi t\xE1j\xE9koztat\xF3"],["gtc","Pl\xE1zs Si\xF3fok - \xC1SZF"],["online-drinks-terms","Pl\xE1zs Si\xF3fok - Online italcsomagok felt\xE9telei"],["job-application-complete","Pl\xE1zs Si\xF3fok - Dolgozz vel\xFCnk | K\xF6sz\xF6nj\xFCk"],["table-reservation-complete","Pl\xE1zs Si\xF3fok - Asztalfoglal\xE1s | K\xF6sz\xF6nj\xFCk"],["partner-card","Pl\xE1zs Si\xF3fok - Partnerk\xE1rtya"],["mymeki","Pl\xE1zs Si\xF3fok - MyMeki"],["drinks-menu","Pl\xE1zs Si\xF3fok - Itallap"]])]]),ih=new Map([["en",new Map([["home",""],["event","event/:event-route"],["events","events"],["faq","faq"],["tables","tables"],["vip","vip"],["work-with-us","work-with-us"],["apply-now","apply-now"],["register","register"],["grant","grant"],["house-rules","house-rules"],["impresszum","impresszum"],["privacy-policy","privacy-policy"],["gtc","gtc"],["online-drinks-terms","online-drinks-terms"],["job-application-complete","thank-you-for-your-application"],["table-reservation-complete","thank-you-for-your-reservation"],["partner-card","partner-card"],["mymeki","mymeki"],["drinks-menu","drinks-menu"]])],["hu",new Map([["home",""],["event","esemeny/:event-route"],["events",["programok","esemenyek"]],["faq",["gy-i-k","gyik"]],["tables","asztalfoglalas"],["vip","vip"],["work-with-us",["munka","dolgozz-velunk"]],["apply-now","jelentkezz-most"],["register","regisztracio"],["grant","palyazati-tajekoztato"],["house-rules","hazirend"],["impresszum","impresszum"],["privacy-policy","adatvedelmi-tajekoztato"],["gtc","aszf"],["online-drinks-terms","online-italcsomagok-feltetelei"],["job-application-complete","koszonjuk-jelentkezesedet-allas"],["table-reservation-complete","koszonjuk-erdeklodesedet-asztalfoglalas"],["partner-card","partnerkartya"],["mymeki","mymeki"],["drinks-menu","itallap"]])]]);var sh=class{constructor(){}static getRouteTitle(i){if(i==null||!ko(i))throw new Error(`Invalid route name: ${i}`);let e=lk.get(Kr.routingLanguage);if(e==null)throw new Error(`Invalid route name: ${i}`);let t=e.get(i)??e.get("home");if(t==null)throw new Error(`Invalid route name: ${i}`);return t}static getCanonicalRoutePath(i){if(i==null||!ko(i))throw new Error(`Invalid route name: ${i}`);let e=ih.get(Kr.routingLanguage);if(e==null)throw new Error(`Invalid route name: ${i}`);let t=e.get(i);if(t==null||Array.isArray(t)&&t.length<=0)throw new Error(`Invalid route name: ${i}`);return Array.isArray(t)?t[0]:t}static getRoutePath(i){if(i==null||!ko(i))throw new Error(`Invalid route name: ${i}`);let e=ih.get(Kr.routingLanguage);if(e==null)throw new Error(`Invalid route name: ${i}`);let t=e.get(i);if(t==null||Array.isArray(t)&&t.length<=0)throw new Error(`Invalid route name: ${i}`);return t}static getRouterLink(i,e,t){if(i==null||!ko(i))return qi(`Invalid route name: ${i}`),null;let s=ih.get(Kr.routingLanguage);if(s==null)return qi(`No routes found for language: ${Kr.routingLanguage}`),null;let a=s.get(i);if(a==null||Array.isArray(a)&&a.length<=0)return qi(`No route template found for route name: ${i}`),null;let o=Array.isArray(a)?a[0]:a,u=o.match(/:[a-zA-Z0-9-]+/g);return u!=null&&u.length>1?(qi(`Multiple parameters found in "${o}". Only one is allowed.`),null):(u!=null&&u.length>0&&(ri(e)?o=o.replace(/:[a-zA-Z0-9-]+/,e):o=o.replace(/\/:[a-zA-Z0-9-]+/,"")),t===!1?o:`/${o}`)}};function xY(n){switch(n){case"api/not-authorized":return"error/not-authorized";case"api/not-implemented":return"error/not-implemented";case"api/not-supported":return"error/not-supported";case"api/bad-request":return"error/http-bad-request";case"api/database-error":return"error/database-error";case"api/document-not-found":return"error/document-not-found";case"api/ticket-is-sold-out":return"error/ticket-is-sold-out";case"api/order-not-valid":return"error/order-not-valid";case"api/promo-code-not-found":return"error/promo-code-not-found";case"api/promo-code-not-valid":return"error/promo-code-not-valid";case"api/promo-code-expired":return"error/promo-code-expired";case"api/promo-code-not-yet-available":return"error/promo-code-not-yet-available";default:return"error/api-internal-error"}}var rh="plazssiofok.hu",qY="the-spice-must-flow";var Ok=Bt(wk());var Sk={url:"https://plazssiofok.hu/",title:"Pl\xE1zs Si\xF3fok - A balatoni ny\xE1r ikonikus helysz\xEDne",description:"Nappal strand \xE9s medence a Balaton partj\xE1n, \xE9jjel koncertek \xE9s bulik. VIP szolg\xE1ltat\xE1sok, nagysz\xEDnpad, t\xF6bb t\xE1nct\xE9r. N\xE9zd meg a programokat!",image:"https://plazssiofok.hu/images/home-banner.webp",imageWidth:"2600",imageHeight:"1665"};var XS="event-linked-data",P2="noindex, nofollow",Tk=class n{constructor(){this.request=ce(YT);this.platformId=ce($s);this.title=ce(SO);this.meta=ce(wO);this._doc=ce(Qe);this.initialSeoData=Sk}resetCanonicalUrl(){this.setUrl(this.initialSeoData.url)}resetTags(){this.setTitle(this.initialSeoData.title),this.setTag("description",this.initialSeoData.description),this.setTag("image",this.initialSeoData.image),this.setTag("image:width",this.initialSeoData.imageWidth),this.setTag("image:height",this.initialSeoData.imageHeight)}resetEventLinkedData(){let i=this._doc.getElementById(XS);i?.remove()}addEventLinkedData(i){try{let e=this._doc.getElementById(XS);e?.remove();let t=this._doc.createElement("script");t.id=XS,t.type="application/ld+json",t.text=JSON.stringify(i,void 0,2),this._doc.head.appendChild(t)}catch(e){qi("Failed to add event linked data: ",e)}}setCanonicalUrl(i){let e=this.getCurrentUrl();if(e==null){Xr("Current URL is null, skipping canonical url generation");return}let t=this.parseUrl(e);if(t.isError){Xr("Failed to parse current URL, skipping canonical url generation");return}let s=this.generateCanonicalUrl(t.value,i);this.setUrl(s)}preventIndexing(){this.meta.updateTag({name:"robots",content:P2})}generateCanonicalEventUrl(i){let e=sh.getRouterLink("event",i,!0);return`https://${rh}${e}`}generateCanonicalAssetUrl(i){return`https://${rh}/${i}`}setTitle(i){this.title.setTitle(i),this.meta.updateTag({property:"og:title",content:i}),this.meta.updateTag({name:"twitter:title",content:i})}setTag(i,e){switch(i){case"image":this.meta.updateTag({property:"og:image",content:e}),this.meta.updateTag({name:"twitter:image",content:e});break;case"image:width":this.meta.updateTag({property:"og:image:width",content:e});break;case"image:height":this.meta.updateTag({property:"og:image:height",content:e});break;
3case"description":this.meta.updateTag({name:"description",content:e}),this.meta.updateTag({property:"og:description",content:e}),this.meta.updateTag({name:"twitter:description",content:e});break}}setUrl(i){let e=this._doc.querySelector('link[rel="canonical"]');e==null&&(e=this._doc.createElement("link"),e.setAttribute("rel","canonical"),this._doc.head.appendChild(e)),e.setAttribute("href",i),this.meta.updateTag({property:"og:url",content:i}),this.meta.updateTag({name:"twitter:url",content:i})}getCurrentUrl(){return KT(this.platformId)?(Xr(`Running on server platform, attempting to get current URL from request object: ${this.request?.url}`),this.request?.url??null):(Xr(`Running on browser platform, getting current URL from document object: ${this._doc.URL}`),this._doc.URL)}parseUrl(i){try{let e=new Ok.default(i);return e==null?(Xr(`URL parsing returned null for url: ${i}`),W.error("error/invalid-url")):W.ok(e)}catch(e){return qi(`Failed to parse url {${i}}: `,e),W.error("error/url-parsing-failed")}}generateCanonicalUrl(i,e){return i.set("protocol","https:"),i.set("port",""),i.set("hostname",rh),i.set("query",""),i.set("hash",""),e?.overrideRoute!=null&&i.set("pathname",e.overrideRoute),i.toString()}static{this.\u0275fac=function(e){return new(e||n)}}static{this.\u0275prov=be({token:n,factory:n.\u0275fac,providedIn:"root"})}};export{mn as a,Rk as b,Us as c,UT as d,BT as e,kk as f,_k as g,xk as h,jT as i,qk as j,yh as k,Yk as l,$k as m,Lk as n,Vk as o,Hk as p,JT as q,D4 as r,v4 as s,Nh as t,c1 as u,gO as v,x1 as w,F1 as x,SO as y,n_ as z,Qq as A,e3 as B,Lh as C,Vh as D,TO as E,f3 as F,v_ as G,C3 as H,k3 as I,_3 as J,P_ as K,cu as L,YO as M,sf as N,of as O,Me as P,SY as Q,TY as R,Xr as S,OY as T,qi as U,$O as V,LO as W,VO as X,cR as Y,ie as Z,k as _,_ as $,r as aa,y as ba,Re as ca,m as da,_d as ea,b as fa,f as ga,Cf as ha,W as ia,fe as ja,Ee as ka,aY as la,g as ma,$ as na,d as oa,Ft as pa,_R as qa,Fd as ra,cY as sa,Rn as ta,ri as ua,Pr as va,st as wa,j as xa,Ae as ya,co as za,en as Aa,es as Ba,Do as Ca,Gd as Da,us as Ea,Ru as Fa,QR as Ga,dn as Ha,ws as Ia,vR as Ja,De as Ka,Ri as La,XP as Ma,$S as Na,wR as Oa,ct as Pa,hY as Qa,fY as Ra,mY as Sa,IY as Ta,Kr as Ua,sh as Va,xY as Wa,Sk as Xa,rh as Ya,qY as Za,Tk as _a};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.