@everymatrix/lottery-hakuna-ticket-history 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import{r as t,h as e}from"./index-50addd47.js";function n(t,e){if(t){const n=document.createElement("style");n.innerHTML=e,t.appendChild(n)}}function r(t,e){if(!t||!e)return;const n=new URL(e);fetch(n.href).then((t=>t.text())).then((e=>{const n=document.createElement("style");n.innerHTML=e,t&&t.appendChild(n)})).catch((t=>{console.error("There was an error while trying to load client styling from URL",t)}))}function i(t,e){if(window.emMessageBus){const n=document.createElement("style");window.emMessageBus.subscribe(e,(e=>{n.innerHTML=e,t&&t.appendChild(n)}))}}var a,o,s,u;function c(t){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c(t)}function h(t){if(null===t||!0===t||!1===t)return NaN;var e=Number(t);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}function d(t,e){if(e.length<t)throw new TypeError(t+" argument"+(t>1?"s":"")+" required, but only "+e.length+" present")}function l(t){d(1,arguments);var e=Object.prototype.toString.call(t);return t instanceof Date||"object"===c(t)&&"[object Date]"===e?new Date(t.getTime()):"number"==typeof t||"[object Number]"===e?new Date(t):("string"!=typeof t&&"[object String]"!==e||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}!function(t){t.Lottery="Lottery",t.PoolGame="PoolGame"}(a||(a={})),function(t){t.Tipping="HomeDrawAway",t.Oddsbomben="CorrectScore"}(o||(o={})),function(t){t.Settled="Settled",t.Purchased="Purchased",t.Canceled="Canceled"}(s||(s={})),function(t){t.WON="Won",t.LOST="Lost"}(u||(u={}));var f={};function m(){return f}function v(t){d(1,arguments);var e=l(t),n=e.getUTCDay(),r=(n<1?7:0)+n-1;return e.setUTCDate(e.getUTCDate()-r),e.setUTCHours(0,0,0,0),e}function g(t){d(1,arguments);var e=l(t),n=e.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var i=v(r),a=new Date(0);a.setUTCFullYear(n,0,4),a.setUTCHours(0,0,0,0);var o=v(a);return e.getTime()>=i.getTime()?n+1:e.getTime()>=o.getTime()?n:n-1}function y(t,e){var n,r,i,a,o,s,u,c;d(1,arguments);var f=m(),v=h(null!==(n=null!==(r=null!==(i=null!==(a=null==e?void 0:e.weekStartsOn)&&void 0!==a?a:null==e||null===(o=e.locale)||void 0===o||null===(s=o.options)||void 0===s?void 0:s.weekStartsOn)&&void 0!==i?i:f.weekStartsOn)&&void 0!==r?r:null===(u=f.locale)||void 0===u||null===(c=u.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==n?n:0);if(!(v>=0&&v<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var g=l(t),y=g.getUTCDay(),w=(y<v?7:0)+y-v;return g.setUTCDate(g.getUTCDate()-w),g.setUTCHours(0,0,0,0),g}function w(t,e){var n,r,i,a,o,s,u,c;d(1,arguments);var f=l(t),v=f.getUTCFullYear(),g=m(),w=h(null!==(n=null!==(r=null!==(i=null!==(a=null==e?void 0:e.firstWeekContainsDate)&&void 0!==a?a:null==e||null===(o=e.locale)||void 0===o||null===(s=o.options)||void 0===s?void 0:s.firstWeekContainsDate)&&void 0!==i?i:g.firstWeekContainsDate)&&void 0!==r?r:null===(u=g.locale)||void 0===u||null===(c=u.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==n?n:1);if(!(w>=1&&w<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var b=new Date(0);b.setUTCFullYear(v+1,0,w),b.setUTCHours(0,0,0,0);var p=y(b,e),x=new Date(0);x.setUTCFullYear(v,0,w),x.setUTCHours(0,0,0,0);var k=y(x,e);return f.getTime()>=p.getTime()?v+1:f.getTime()>=k.getTime()?v:v-1}function b(t,e){for(var n=t<0?"-":"",r=Math.abs(t).toString();r.length<e;)r="0"+r;return n+r}const p=function(t,e){var n=t.getUTCFullYear(),r=n>0?n:1-n;return b("yy"===e?r%100:r,e.length)},x=function(t,e){var n=t.getUTCMonth();return"M"===e?String(n+1):b(n+1,2)},k=function(t,e){return b(t.getUTCDate(),e.length)},M=function(t,e){return b(t.getUTCHours()%12||12,e.length)},S=function(t,e){return b(t.getUTCHours(),e.length)},E=function(t,e){return b(t.getUTCMinutes(),e.length)},C=function(t,e){return b(t.getUTCSeconds(),e.length)},D=function(t,e){var n=e.length,r=t.getUTCMilliseconds();return b(Math.floor(r*Math.pow(10,n-3)),e.length)};var P={G:function(t,e,n){var r=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if("yo"===e){var r=t.getUTCFullYear();return n.ordinalNumber(r>0?r:1-r,{unit:"year"})}return p(t,e)},Y:function(t,e,n,r){var i=w(t,r),a=i>0?i:1-i;return"YY"===e?b(a%100,2):"Yo"===e?n.ordinalNumber(a,{unit:"year"}):b(a,e.length)},R:function(t,e){return b(g(t),e.length)},u:function(t,e){return b(t.getUTCFullYear(),e.length)},Q:function(t,e,n){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return b(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return b(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){var r=t.getUTCMonth();switch(e){case"M":case"MM":return x(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){var r=t.getUTCMonth();switch(e){case"L":return String(r+1);case"LL":return b(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){var i=function(t,e){d(1,arguments);var n=l(t),r=y(n,e).getTime()-function(t,e){var n,r,i,a,o,s,u,c;d(1,arguments);var l=m(),f=h(null!==(n=null!==(r=null!==(i=null!==(a=null==e?void 0:e.firstWeekContainsDate)&&void 0!==a?a:null==e||null===(o=e.locale)||void 0===o||null===(s=o.options)||void 0===s?void 0:s.firstWeekContainsDate)&&void 0!==i?i:l.firstWeekContainsDate)&&void 0!==r?r:null===(u=l.locale)||void 0===u||null===(c=u.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==n?n:1),v=w(t,e),g=new Date(0);return g.setUTCFullYear(v,0,f),g.setUTCHours(0,0,0,0),y(g,e)}(n,e).getTime();return Math.round(r/6048e5)+1}(t,r);return"wo"===e?n.ordinalNumber(i,{unit:"week"}):b(i,e.length)},I:function(t,e,n){var r=function(t){d(1,arguments);var e=l(t),n=v(e).getTime()-function(t){d(1,arguments);var e=g(t),n=new Date(0);return n.setUTCFullYear(e,0,4),n.setUTCHours(0,0,0,0),v(n)}(e).getTime();return Math.round(n/6048e5)+1}(t);return"Io"===e?n.ordinalNumber(r,{unit:"week"}):b(r,e.length)},d:function(t,e,n){return"do"===e?n.ordinalNumber(t.getUTCDate(),{unit:"date"}):k(t,e)},D:function(t,e,n){var r=function(t){d(1,arguments);var e=l(t),n=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var r=e.getTime();return Math.floor((n-r)/864e5)+1}(t);return"Do"===e?n.ordinalNumber(r,{unit:"dayOfYear"}):b(r,e.length)},E:function(t,e,n){var r=t.getUTCDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){var i=t.getUTCDay(),a=(i-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(a);case"ee":return b(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){var i=t.getUTCDay(),a=(i-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(a);case"cc":return b(a,e.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(t,e,n){var r=t.getUTCDay(),i=0===r?7:r;switch(e){case"i":return String(i);case"ii":return b(i,e.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){var r=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(t,e,n){var r,i=t.getUTCHours();switch(r=12===i?"noon":0===i?"midnight":i/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(t,e,n){var r,i=t.getUTCHours();switch(r=i>=17?"evening":i>=12?"afternoon":i>=4?"morning":"night",e){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(t,e,n){if("ho"===e){var r=t.getUTCHours()%12;return 0===r&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return M(t,e)},H:function(t,e,n){return"Ho"===e?n.ordinalNumber(t.getUTCHours(),{unit:"hour"}):S(t,e)},K:function(t,e,n){var r=t.getUTCHours()%12;return"Ko"===e?n.ordinalNumber(r,{unit:"hour"}):b(r,e.length)},k:function(t,e,n){var r=t.getUTCHours();return 0===r&&(r=24),"ko"===e?n.ordinalNumber(r,{unit:"hour"}):b(r,e.length)},m:function(t,e,n){return"mo"===e?n.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):E(t,e)},s:function(t,e,n){return"so"===e?n.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):C(t,e)},S:function(t,e){return D(t,e)},X:function(t,e,n,r){var i=(r._originalDate||t).getTimezoneOffset();if(0===i)return"Z";switch(e){case"X":return j(i);case"XXXX":case"XX":return _(i);default:return _(i,":")}},x:function(t,e,n,r){var i=(r._originalDate||t).getTimezoneOffset();switch(e){case"x":return j(i);case"xxxx":case"xx":return _(i);default:return _(i,":")}},O:function(t,e,n,r){var i=(r._originalDate||t).getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+T(i,":");default:return"GMT"+_(i,":")}},z:function(t,e,n,r){var i=(r._originalDate||t).getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+T(i,":");default:return"GMT"+_(i,":")}},t:function(t,e,n,r){return b(Math.floor((r._originalDate||t).getTime()/1e3),e.length)},T:function(t,e,n,r){return b((r._originalDate||t).getTime(),e.length)}};function T(t,e){var n=t>0?"-":"+",r=Math.abs(t),i=Math.floor(r/60),a=r%60;if(0===a)return n+String(i);var o=e||"";return n+String(i)+o+b(a,2)}function j(t,e){return t%60==0?(t>0?"-":"+")+b(Math.abs(t)/60,2):_(t,e)}function _(t,e){var n=e||"",r=t>0?"-":"+",i=Math.abs(t);return r+b(Math.floor(i/60),2)+n+b(i%60,2)}const O=P;var R=function(t,e){switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},W=function(t,e){switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},z={p:W,P:function(t,e){var n,r=t.match(/(P+)(p+)?/)||[],i=r[1],a=r[2];if(!a)return R(t,e);switch(i){case"P":n=e.dateTime({width:"short"});break;case"PP":n=e.dateTime({width:"medium"});break;case"PPP":n=e.dateTime({width:"long"});break;default:n=e.dateTime({width:"full"})}return n.replace("{{date}}",R(i,e)).replace("{{time}}",W(a,e))}};const L=z;var Y=["D","DD"],q=["YY","YYYY"];function G(t,e,n){if("YYYY"===t)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===t)throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===t)throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===t)throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var A={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function N(t){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}var U,B={date:N({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:N({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:N({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},Q={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function H(t){return function(e,n){var r;if("formatting"===(null!=n&&n.context?String(n.context):"standalone")&&t.formattingValues){var i=t.defaultFormattingWidth||t.defaultWidth,a=null!=n&&n.width?String(n.width):i;r=t.formattingValues[a]||t.formattingValues[i]}else{var o=t.defaultWidth,s=null!=n&&n.width?String(n.width):t.defaultWidth;r=t.values[s]||t.values[o]}return r[t.argumentCallback?t.argumentCallback(e):e]}}function I(t){return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.width,i=e.match(r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth]);if(!i)return null;var a,o=i[0],s=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],u=Array.isArray(s)?function(t){for(var e=0;e<t.length;e++)if(t[e].test(o))return e}(s):function(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e].test(o))return e}(s);return a=t.valueCallback?t.valueCallback(u):u,{value:a=n.valueCallback?n.valueCallback(a):a,rest:e.slice(o.length)}}}const $={code:"en-US",formatDistance:function(t,e,n){var r,i=A[t];return r="string"==typeof i?i:1===e?i.one:i.other.replace("{{count}}",e.toString()),null!=n&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},formatLong:B,formatRelative:function(t){return Q[t]},localize:{ordinalNumber:function(t){var e=Number(t),n=e%100;if(n>20||n<10)switch(n%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},era:H({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:H({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:H({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:H({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:H({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(U={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(t){return parseInt(t,10)}},function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.match(U.matchPattern);if(!n)return null;var r=n[0],i=t.match(U.parsePattern);if(!i)return null;var a=U.valueCallback?U.valueCallback(i[0]):i[0];return{value:a=e.valueCallback?e.valueCallback(a):a,rest:t.slice(r.length)}}),era:I({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:I({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:I({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:I({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:I({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};var X=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,F=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,J=/^'([^]*?)'?$/,Z=/''/g,K=/[a-zA-Z]/;function V(t,e,n){var r,i,a,o,s,u,f,v,g,y,w,b,p,x,k,M,S,E;d(2,arguments);var C=String(e),D=m(),P=null!==(r=null!==(i=null==n?void 0:n.locale)&&void 0!==i?i:D.locale)&&void 0!==r?r:$,T=h(null!==(a=null!==(o=null!==(s=null!==(u=null==n?void 0:n.firstWeekContainsDate)&&void 0!==u?u:null==n||null===(f=n.locale)||void 0===f||null===(v=f.options)||void 0===v?void 0:v.firstWeekContainsDate)&&void 0!==s?s:D.firstWeekContainsDate)&&void 0!==o?o:null===(g=D.locale)||void 0===g||null===(y=g.options)||void 0===y?void 0:y.firstWeekContainsDate)&&void 0!==a?a:1);if(!(T>=1&&T<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var j=h(null!==(w=null!==(b=null!==(p=null!==(x=null==n?void 0:n.weekStartsOn)&&void 0!==x?x:null==n||null===(k=n.locale)||void 0===k||null===(M=k.options)||void 0===M?void 0:M.weekStartsOn)&&void 0!==p?p:D.weekStartsOn)&&void 0!==b?b:null===(S=D.locale)||void 0===S||null===(E=S.options)||void 0===E?void 0:E.weekStartsOn)&&void 0!==w?w:0);if(!(j>=0&&j<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!P.localize)throw new RangeError("locale must contain localize property");if(!P.formatLong)throw new RangeError("locale must contain formatLong property");var _=l(t);if(!function(t){if(d(1,arguments),!function(t){return d(1,arguments),t instanceof Date||"object"===c(t)&&"[object Date]"===Object.prototype.toString.call(t)}(t)&&"number"!=typeof t)return!1;var e=l(t);return!isNaN(Number(e))}(_))throw new RangeError("Invalid time value");var R=function(t){var e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),t.getTime()-e.getTime()}(_),W=function(t,e){return d(2,arguments),function(t,e){d(2,arguments);var n=l(t).getTime(),r=h(e);return new Date(n+r)}(t,-h(e))}(_,R),z={firstWeekContainsDate:T,weekStartsOn:j,locale:P,_originalDate:_};return C.match(F).map((function(t){var e=t[0];return"p"===e||"P"===e?(0,L[e])(t,P.formatLong):t})).join("").match(X).map((function(r){if("''"===r)return"'";var i,a,o=r[0];if("'"===o)return(a=(i=r).match(J))?a[1].replace(Z,"'"):i;var s=O[o];if(s)return null!=n&&n.useAdditionalWeekYearTokens||-1===q.indexOf(r)||G(r,e,String(t)),null!=n&&n.useAdditionalDayOfYearTokens||!(-1!==Y.indexOf(r))||G(r,e,String(t)),s(W,r,P.localize,z);if(o.match(K))throw new RangeError("Format string contains an unescaped latin alphabet character `"+o+"`");return r})).join("")}function tt(t,e){return null==t||""===t||(0!==t||!e)&&(Array.isArray(t)?function(t){if(0===t.length)return!0;const e=t.length;let n=0;for(let r=0;r<e;r++){if(!tt(t[r]))return!1;n++}return n===e}(t):"[object Object]"===Object.prototype.toString.call(t)?function(t){if(0===Object.keys(t).length)return!0;const e=Object.keys(t).length;let n=0;for(const e of Object.values(t)){if(!tt(e))return!1;n++}return n===e}(t):!t)}const et="?";function nt(t,e){return t&&t.length>0?t.map((t=>{const[n,r]=V(new Date(t.createdAt),`MMM d,yyyy${et}HH:mm:ss a 'UTC'`).split(et);return{id:t.id,name:(null==e?void 0:e.name)||t.gameName,imageSrc:null==e?void 0:e.imageSrc,totalAmount:(null==e?void 0:e.currency)?`${null==e?void 0:e.currency} ${t.amount}`:t.amount,date:n,time:r,selectedNumbers:t.selection.map((t=>t.selections)).join(",")}})):[]}async function rt({endpoint:t,filterData:e,sessionId:n,meta:r}){const{items:i=[],total:a}=await function(t,e="GET",n=null,r={}){return new Promise(((i,a)=>{const o="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)})),s=Object.assign({"Content-Type":"application/json"},r);"GET"!==e&&"HEAD"!==e&&(s["X-Idempotency-Key"]=o);const u={method:e,headers:s,body:null};n&&"GET"!==e&&"HEAD"!==e?u.body=JSON.stringify(n):delete u.body,fetch(t,u).then((t=>t.ok?t.json():t.json().then((e=>{a({status:t.status,statusText:t.statusText,code:e.code||"UNKNOWN_ERROR",message:e.message||"An unknown error occurred",data:e.data||null})}),(()=>a({status:t.status,statusText:t.statusText,code:"PARSE_ERROR",message:"Failed to parse error response"}))))).then((t=>i(t)),(t=>a(t)))}))}(`${t}/tickets${function(t){const e={};Object.entries(t).forEach((([t,n])=>{tt(n,!0)||(e[t]=n)}));const n=Object.entries(e).map((([t,e])=>`${encodeURIComponent(t)}=${encodeURIComponent(e)}`)).join("&");return n?`?${n}`:""}(e)}`,"GET",null,{Authorization:`Bearer ${n}`})||{items:[],total:0};return{items:nt(i,r),total:a}}const it=["ro","en","fr","ar","hr"],at={en:{releaseToRefresh:"Release to refresh...",youHaveReachedTheEnd:"You have reached the end.",failToShowTicketList:"Fail to show ticket list.",unauthorized:"Unauthorized, please login."}},ot=(t,e,n)=>{const r=e;let i=at[void 0!==r&&it.includes(r)?r:"en"][t];return n&&Object.keys(n).forEach((t=>{i=i.replace(`{${t}}`,n[t])})),i};var st=function(){return st=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},st.apply(this,arguments)},ut={primaryColor:"#333",secondaryColor:"#E6E6E6"};function ct(t,e){if(void 0===e&&(e={}),"function"==typeof t.icon){var n=e.placeholders||ut;return ht(t.icon(n.primaryColor,n.secondaryColor),e)}return ht(t.icon,e)}function ht(t,e){var n="svg"===t.tag?st(st({},t.attrs),e.extraSVGAttrs||{}):t.attrs,r=Object.keys(n).reduce((function(t,e){var r=n[e],i="".concat(e,'="').concat(r,'"');return t.push(i),t}),[]),i=r.length?" "+r.join(" "):"",a=(t.children||[]).map((function(t){return ht(t,e)})).join("");return a&&a.length?"<".concat(t.tag).concat(i,">").concat(a,"</").concat(t.tag,">"):"<".concat(t.tag).concat(i," />")}const dt=ct({icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"}}]},name:"loading",theme:"outlined"},{extraSVGAttrs:{width:"14px",height:"14px",fill:"currentColor"}}),lt=class{constructor(n){t(this,n),this.page=0,this.vendorGameType=a.Lottery,this.customStyle=`\n :host {\n --lottery-hakuna-ticket-history-item-container-min-width: ${this.minItemWidth}px;\n\n .lottery-hakuna-ticket-history-item__container {\n justify-content: flex-start;\n }\n }\n\n .lottery-hakuna-ticket-history-item__container-wrapper {\n height: 100%;\n box-sizing: border-box;\n }\n .lottery-hakuna-ticket-history-item__container {\n height: 100%;\n box-sizing: border-box;\n }\n `,this.handleLoadMore=()=>{!this.isLoading&&this.hasMore&&this.getTicketList(this.page+1)},this.handleRefresh=()=>{this.isRefreshing||(this.page=1,this.getTicketList(1,!0))},this.renderSkeleton=()=>e("lottery-hakuna-ticket-history-item",{"client-styling":this.customStyle+(this.clientStyling||""),"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource,translationUrl:this.translationUrl,language:this.language,showSkeleton:!0}),this.renderItem=t=>e("lottery-hakuna-ticket-history-item",{"client-styling":this.customStyle+(this.clientStyling||""),"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource,translationUrl:this.translationUrl,language:this.language,key:t.id,"history-item-name":t.name,"history-item-image-src":t.imageSrc,"ticket-id":t.id,"total-amount":t.totalAmount,date:t.date,time:t.time,"selected-numbers":t.selectedNumbers}),this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.language="en",this.translationUrl="",this.endpoint=void 0,this.gameId=void 0,this.playerId=void 0,this.sessionId="",this.scrollThreshold="0px 0px 200px 0px",this.scrollItemHeight=110,this.scrollContainerHeight=500,this.ticketHistoryTitle="YOUR TICKET",this.ticketHistoryItemImageSrc=void 0,this.ticketHistoryItemName=void 0,this.ticketHistoryItemCurrency="R",this.listLoadingText=void 0,this.listRefreshingText=void 0,this.listEndText=void 0,this.limit=10,this.visibleTickets=[],this.hasMore=!1,this.isLoading=!1,this.isRefreshing=!1,this.errorMessage=void 0,this.minItemWidth=300,this.showSkeleton=!0}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&r(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&i(this.stylingContainer,`${this.mbSource}.Style`)}componentWillLoad(){(async t=>{if(t)try{const n=await fetch(t);if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);const r=await n.json();e=r,Object.keys(e).forEach((t=>{for(let n in e[t])at[t][n]=e[t][n]}))}catch(t){console.error("Failed to fetch or parse translations from URL:",t)}var e})(this.translationUrl),this.getTicketList(1)}async getTicketList(t,e=!1){try{if(!this.endpoint||!this.sessionId)return Promise.reject(new Error("Endpoint and sessionId are required"));if(t<=0||!this.limit)return;e?this.isRefreshing=!0:this.isLoading=!0;const{items:n,total:r}=await rt({endpoint:this.endpoint,filterData:{offset:(t-1)*this.limit,limit:this.limit,vendorGameType:this.vendorGameType},sessionId:this.sessionId,meta:{name:this.ticketHistoryItemName,imageSrc:this.ticketHistoryItemImageSrc,currency:this.ticketHistoryItemCurrency}});this.visibleTickets=e?[...n]:[...this.visibleTickets,...n],this.hasMore=t<Math.ceil(r/this.limit),this.page=t,this.isLoading=!1,this.isRefreshing=!1,this.errorMessage=null}catch(t){if(this.isLoading=!1,this.isRefreshing=!1,401===t.status)return this.errorMessage=ot("unauthorized",this.language),void window.postMessage({type:"SessionExpired"},window.location.href);this.errorMessage=ot("failToShowTicketList",this.language)}}componentDidLoad(){this.stylingContainer&&(this.mbSource&&i(this.stylingContainer,`${this.mbSource}.Style`),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&r(this.stylingContainer,this.clientStylingUrl))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}renderInfoIcon(){return e("svg",{width:"45",height:"45",viewBox:"0 0 45 45",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",fill:"currentColor",d:"M22.5 5.625C13.1802 5.625 5.625 13.1802 5.625 22.5C5.625 31.8198 13.1802 39.375 22.5 39.375C31.8198 39.375 39.375 31.8198 39.375 22.5C39.375 13.1802 31.8198 5.625 22.5 5.625ZM1.875 22.5C1.875 11.1091 11.1091 1.875 22.5 1.875C33.8909 1.875 43.125 11.1091 43.125 22.5C43.125 33.8909 33.8909 43.125 22.5 43.125C11.1091 43.125 1.875 33.8909 1.875 22.5ZM22.5 13.125C23.5355 13.125 24.375 13.9645 24.375 15V22.5C24.375 23.5355 23.5355 24.375 22.5 24.375C21.4645 24.375 20.625 23.5355 20.625 22.5V15C20.625 13.9645 21.4645 13.125 22.5 13.125ZM20.625 30C20.625 28.9645 21.4645 28.125 22.5 28.125H22.5188C23.5543 28.125 24.3938 28.9645 24.3938 30C24.3938 31.0355 23.5543 31.875 22.5188 31.875H22.5C21.4645 31.875 20.625 31.0355 20.625 30Z"}))}render(){return e("div",{key:"f150fbefd3394af032c600f9b939357bc07ef7db",class:"lottery-hakuna-ticket-history__container",ref:t=>this.stylingContainer=t},e("div",{key:"67e83eb97dbb358b1d057c1c7948fc8f6e4bc363",class:"lottery-hakuna-ticket-history__title"},this.ticketHistoryTitle),this.errorMessage&&e("div",{key:"cae8e46734e5ac71874dbd3d28a861218b5c67eb",class:"lottery-hakuna-ticket-history__error-message"},this.renderInfoIcon(),e("span",{key:"7c8feec0afda57a6546da5ad9ddc5e35d52683ac"},this.errorMessage)),e("lottery-infinite-scroll",{key:"828de5559807ea0314d05be5e17ce2340b494a5f","client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource,hasMore:this.hasMore,enableVirtualScroll:!0,items:[...this.visibleTickets],estimatedItemHeight:this.scrollItemHeight,minItemWidth:this.minItemWidth,threshold:this.scrollThreshold,gridGap:10,isLoading:this.isLoading,isRefreshing:this.isRefreshing,onLoadMore:this.handleLoadMore,onRefresh:this.handleRefresh,renderItem:this.renderItem,renderSkeleton:this.showSkeleton?this.renderSkeleton:null,skeletonCount:this.limit},e("div",{key:"833b363afc9d355fd6ec1e50a848f759f4f7c1b9",slot:"loading-more",class:"lottery-hakuna-ticket-history__loading-more"},e("span",{key:"8cf28988956c1710e4adfc6c169761bf3c833e6a",class:"loading-spinner",innerHTML:dt})),e("div",{key:"9faed4a64236ff2a7ae920499fe236aec3393433",slot:"refresh-loading",class:"lottery-hakuna-ticket-history__refresh-loading"},this.listRefreshingText||ot("releaseToRefresh",this.language)),e("div",{key:"b61b6aeaadda6e8e0b48d58e2f9ad7f77e57badf",slot:"end-message",class:"lottery-hakuna-ticket-history__end-message"},this.listEndText||ot("youHaveReachedTheEnd",this.language))))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};lt.style=":host{display:block}.lottery-hakuna-ticket-history__container{padding:var(--lottery-hakuna-container-padding, 0);display:flex;flex-direction:var(--lottery-hakuna-container-flex-direction, column);align-items:var(--lottery-hakuna-container-align-items, center)}.lottery-hakuna-ticket-history__title{color:var(--lottery-hakuna-title-color, #000);font-size:var(--lottery-hakuna-title-font-size, 14px);font-style:var(--lottery-hakuna-title-font-style, normal);font-weight:var(--lottery-hakuna-title-font-weight, 700);line-height:var(--lottery-hakuna-title-line-height, normal);text-transform:var(--lottery-hakuna-title-text-transform, uppercase);margin-bottom:var(--lottery-hakuna-title-margin-bottom, 18px)}lottery-hakuna-ticket-history-item{width:var(--lottery-hakuna-ticket-history-item-width, 100%)}lottery-infinite-scroll{max-width:var(--lottery-hakuna-ticket-history-item-max-width, 100%);height:var(--lottery-hakuna-ticket-history-item-height, 500px)}.lottery-hakuna-ticket-history__end-message{width:var(--lottery-hakuna-end-message-width, 100%);text-align:var(--lottery-hakuna-end-message-text-align, center);font-size:var(--lottery-hakuna-end-message-font-size, 14px)}.lottery-hakuna-ticket-history__loading-more{width:var(--lottery-hakuna-loading-more-width, 100%);display:flex;align-items:center;justify-content:center;font-size:var(--lottery-hakuna-loading-more-font-size, 14px);gap:var(--lottery-hakuna-loading-spinner-text-gap, 8px);}.lottery-hakuna-ticket-history__loading-more .loading-spinner{animation:spin var(--lottery-hakuna-loading-spinner-animation-duration, 1s) linear infinite;color:var(--lottery-hakuna-loading-spinner-color, currentColor);}.lottery-hakuna-ticket-history__loading-more .loading-spinner svg{width:var(--lottery-hakuna-loading-spinner-size, 16px);height:var(--lottery-hakuna-loading-spinner-size, 16px)}@keyframes spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}.lottery-hakuna-ticket-history__error-message{display:flex;align-items:center;justify-content:center;gap:8px;margin-bottom:10px}.lottery-hakuna-ticket-history__error-message svg{width:20px;height:20px}";export{lt as L,r as a,i as b,ct as r,n as s}
1
+ import{r as t,h as e}from"./index-50addd47.js";function n(t,e){if(t){const n=document.createElement("style");n.innerHTML=e,t.appendChild(n)}}function r(t,e){if(!t||!e)return;const n=new URL(e);fetch(n.href).then((t=>t.text())).then((e=>{const n=document.createElement("style");n.innerHTML=e,t&&t.appendChild(n)})).catch((t=>{console.error("There was an error while trying to load client styling from URL",t)}))}function i(t,e){if(window.emMessageBus){const n=document.createElement("style");window.emMessageBus.subscribe(e,(e=>{n.innerHTML=e,t&&t.appendChild(n)}))}}var a,o,s,u;function c(t){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c(t)}function h(t){if(null===t||!0===t||!1===t)return NaN;var e=Number(t);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}function d(t,e){if(e.length<t)throw new TypeError(t+" argument"+(t>1?"s":"")+" required, but only "+e.length+" present")}function l(t){d(1,arguments);var e=Object.prototype.toString.call(t);return t instanceof Date||"object"===c(t)&&"[object Date]"===e?new Date(t.getTime()):"number"==typeof t||"[object Number]"===e?new Date(t):("string"!=typeof t&&"[object String]"!==e||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}!function(t){t.Lottery="Lottery",t.PoolGame="PoolGame"}(a||(a={})),function(t){t.Tipping="HomeDrawAway",t.Oddsbomben="CorrectScore"}(o||(o={})),function(t){t.Settled="Settled",t.Purchased="Purchased",t.Canceled="Canceled"}(s||(s={})),function(t){t.WON="Won",t.LOST="Lost"}(u||(u={}));var f={};function m(){return f}function v(t){d(1,arguments);var e=l(t),n=e.getUTCDay(),r=(n<1?7:0)+n-1;return e.setUTCDate(e.getUTCDate()-r),e.setUTCHours(0,0,0,0),e}function g(t){d(1,arguments);var e=l(t),n=e.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var i=v(r),a=new Date(0);a.setUTCFullYear(n,0,4),a.setUTCHours(0,0,0,0);var o=v(a);return e.getTime()>=i.getTime()?n+1:e.getTime()>=o.getTime()?n:n-1}function y(t,e){var n,r,i,a,o,s,u,c;d(1,arguments);var f=m(),v=h(null!==(n=null!==(r=null!==(i=null!==(a=null==e?void 0:e.weekStartsOn)&&void 0!==a?a:null==e||null===(o=e.locale)||void 0===o||null===(s=o.options)||void 0===s?void 0:s.weekStartsOn)&&void 0!==i?i:f.weekStartsOn)&&void 0!==r?r:null===(u=f.locale)||void 0===u||null===(c=u.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==n?n:0);if(!(v>=0&&v<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var g=l(t),y=g.getUTCDay(),w=(y<v?7:0)+y-v;return g.setUTCDate(g.getUTCDate()-w),g.setUTCHours(0,0,0,0),g}function w(t,e){var n,r,i,a,o,s,u,c;d(1,arguments);var f=l(t),v=f.getUTCFullYear(),g=m(),w=h(null!==(n=null!==(r=null!==(i=null!==(a=null==e?void 0:e.firstWeekContainsDate)&&void 0!==a?a:null==e||null===(o=e.locale)||void 0===o||null===(s=o.options)||void 0===s?void 0:s.firstWeekContainsDate)&&void 0!==i?i:g.firstWeekContainsDate)&&void 0!==r?r:null===(u=g.locale)||void 0===u||null===(c=u.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==n?n:1);if(!(w>=1&&w<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var b=new Date(0);b.setUTCFullYear(v+1,0,w),b.setUTCHours(0,0,0,0);var p=y(b,e),x=new Date(0);x.setUTCFullYear(v,0,w),x.setUTCHours(0,0,0,0);var k=y(x,e);return f.getTime()>=p.getTime()?v+1:f.getTime()>=k.getTime()?v:v-1}function b(t,e){for(var n=t<0?"-":"",r=Math.abs(t).toString();r.length<e;)r="0"+r;return n+r}const p=function(t,e){var n=t.getUTCFullYear(),r=n>0?n:1-n;return b("yy"===e?r%100:r,e.length)},x=function(t,e){var n=t.getUTCMonth();return"M"===e?String(n+1):b(n+1,2)},k=function(t,e){return b(t.getUTCDate(),e.length)},M=function(t,e){return b(t.getUTCHours()%12||12,e.length)},S=function(t,e){return b(t.getUTCHours(),e.length)},E=function(t,e){return b(t.getUTCMinutes(),e.length)},C=function(t,e){return b(t.getUTCSeconds(),e.length)},D=function(t,e){var n=e.length,r=t.getUTCMilliseconds();return b(Math.floor(r*Math.pow(10,n-3)),e.length)};var P={G:function(t,e,n){var r=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if("yo"===e){var r=t.getUTCFullYear();return n.ordinalNumber(r>0?r:1-r,{unit:"year"})}return p(t,e)},Y:function(t,e,n,r){var i=w(t,r),a=i>0?i:1-i;return"YY"===e?b(a%100,2):"Yo"===e?n.ordinalNumber(a,{unit:"year"}):b(a,e.length)},R:function(t,e){return b(g(t),e.length)},u:function(t,e){return b(t.getUTCFullYear(),e.length)},Q:function(t,e,n){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return b(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return b(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){var r=t.getUTCMonth();switch(e){case"M":case"MM":return x(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){var r=t.getUTCMonth();switch(e){case"L":return String(r+1);case"LL":return b(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){var i=function(t,e){d(1,arguments);var n=l(t),r=y(n,e).getTime()-function(t,e){var n,r,i,a,o,s,u,c;d(1,arguments);var l=m(),f=h(null!==(n=null!==(r=null!==(i=null!==(a=null==e?void 0:e.firstWeekContainsDate)&&void 0!==a?a:null==e||null===(o=e.locale)||void 0===o||null===(s=o.options)||void 0===s?void 0:s.firstWeekContainsDate)&&void 0!==i?i:l.firstWeekContainsDate)&&void 0!==r?r:null===(u=l.locale)||void 0===u||null===(c=u.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==n?n:1),v=w(t,e),g=new Date(0);return g.setUTCFullYear(v,0,f),g.setUTCHours(0,0,0,0),y(g,e)}(n,e).getTime();return Math.round(r/6048e5)+1}(t,r);return"wo"===e?n.ordinalNumber(i,{unit:"week"}):b(i,e.length)},I:function(t,e,n){var r=function(t){d(1,arguments);var e=l(t),n=v(e).getTime()-function(t){d(1,arguments);var e=g(t),n=new Date(0);return n.setUTCFullYear(e,0,4),n.setUTCHours(0,0,0,0),v(n)}(e).getTime();return Math.round(n/6048e5)+1}(t);return"Io"===e?n.ordinalNumber(r,{unit:"week"}):b(r,e.length)},d:function(t,e,n){return"do"===e?n.ordinalNumber(t.getUTCDate(),{unit:"date"}):k(t,e)},D:function(t,e,n){var r=function(t){d(1,arguments);var e=l(t),n=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var r=e.getTime();return Math.floor((n-r)/864e5)+1}(t);return"Do"===e?n.ordinalNumber(r,{unit:"dayOfYear"}):b(r,e.length)},E:function(t,e,n){var r=t.getUTCDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){var i=t.getUTCDay(),a=(i-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(a);case"ee":return b(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){var i=t.getUTCDay(),a=(i-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(a);case"cc":return b(a,e.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(t,e,n){var r=t.getUTCDay(),i=0===r?7:r;switch(e){case"i":return String(i);case"ii":return b(i,e.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){var r=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(t,e,n){var r,i=t.getUTCHours();switch(r=12===i?"noon":0===i?"midnight":i/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(t,e,n){var r,i=t.getUTCHours();switch(r=i>=17?"evening":i>=12?"afternoon":i>=4?"morning":"night",e){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(t,e,n){if("ho"===e){var r=t.getUTCHours()%12;return 0===r&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return M(t,e)},H:function(t,e,n){return"Ho"===e?n.ordinalNumber(t.getUTCHours(),{unit:"hour"}):S(t,e)},K:function(t,e,n){var r=t.getUTCHours()%12;return"Ko"===e?n.ordinalNumber(r,{unit:"hour"}):b(r,e.length)},k:function(t,e,n){var r=t.getUTCHours();return 0===r&&(r=24),"ko"===e?n.ordinalNumber(r,{unit:"hour"}):b(r,e.length)},m:function(t,e,n){return"mo"===e?n.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):E(t,e)},s:function(t,e,n){return"so"===e?n.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):C(t,e)},S:function(t,e){return D(t,e)},X:function(t,e,n,r){var i=(r._originalDate||t).getTimezoneOffset();if(0===i)return"Z";switch(e){case"X":return j(i);case"XXXX":case"XX":return _(i);default:return _(i,":")}},x:function(t,e,n,r){var i=(r._originalDate||t).getTimezoneOffset();switch(e){case"x":return j(i);case"xxxx":case"xx":return _(i);default:return _(i,":")}},O:function(t,e,n,r){var i=(r._originalDate||t).getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+T(i,":");default:return"GMT"+_(i,":")}},z:function(t,e,n,r){var i=(r._originalDate||t).getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+T(i,":");default:return"GMT"+_(i,":")}},t:function(t,e,n,r){return b(Math.floor((r._originalDate||t).getTime()/1e3),e.length)},T:function(t,e,n,r){return b((r._originalDate||t).getTime(),e.length)}};function T(t,e){var n=t>0?"-":"+",r=Math.abs(t),i=Math.floor(r/60),a=r%60;if(0===a)return n+String(i);var o=e||"";return n+String(i)+o+b(a,2)}function j(t,e){return t%60==0?(t>0?"-":"+")+b(Math.abs(t)/60,2):_(t,e)}function _(t,e){var n=e||"",r=t>0?"-":"+",i=Math.abs(t);return r+b(Math.floor(i/60),2)+n+b(i%60,2)}const O=P;var R=function(t,e){switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},W=function(t,e){switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},z={p:W,P:function(t,e){var n,r=t.match(/(P+)(p+)?/)||[],i=r[1],a=r[2];if(!a)return R(t,e);switch(i){case"P":n=e.dateTime({width:"short"});break;case"PP":n=e.dateTime({width:"medium"});break;case"PPP":n=e.dateTime({width:"long"});break;default:n=e.dateTime({width:"full"})}return n.replace("{{date}}",R(i,e)).replace("{{time}}",W(a,e))}};const L=z;var Y=["D","DD"],q=["YY","YYYY"];function G(t,e,n){if("YYYY"===t)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===t)throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===t)throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===t)throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var A={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function N(t){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}var U,B={date:N({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:N({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:N({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},Q={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function $(t){return function(e,n){var r;if("formatting"===(null!=n&&n.context?String(n.context):"standalone")&&t.formattingValues){var i=t.defaultFormattingWidth||t.defaultWidth,a=null!=n&&n.width?String(n.width):i;r=t.formattingValues[a]||t.formattingValues[i]}else{var o=t.defaultWidth,s=null!=n&&n.width?String(n.width):t.defaultWidth;r=t.values[s]||t.values[o]}return r[t.argumentCallback?t.argumentCallback(e):e]}}function H(t){return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.width,i=e.match(r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth]);if(!i)return null;var a,o=i[0],s=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],u=Array.isArray(s)?function(t){for(var e=0;e<t.length;e++)if(t[e].test(o))return e}(s):function(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e].test(o))return e}(s);return a=t.valueCallback?t.valueCallback(u):u,{value:a=n.valueCallback?n.valueCallback(a):a,rest:e.slice(o.length)}}}const I={code:"en-US",formatDistance:function(t,e,n){var r,i=A[t];return r="string"==typeof i?i:1===e?i.one:i.other.replace("{{count}}",e.toString()),null!=n&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},formatLong:B,formatRelative:function(t){return Q[t]},localize:{ordinalNumber:function(t){var e=Number(t),n=e%100;if(n>20||n<10)switch(n%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},era:$({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:$({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:$({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:$({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:$({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(U={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(t){return parseInt(t,10)}},function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.match(U.matchPattern);if(!n)return null;var r=n[0],i=t.match(U.parsePattern);if(!i)return null;var a=U.valueCallback?U.valueCallback(i[0]):i[0];return{value:a=e.valueCallback?e.valueCallback(a):a,rest:t.slice(r.length)}}),era:H({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:H({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:H({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:H({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:H({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};var X=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,F=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,J=/^'([^]*?)'?$/,Z=/''/g,K=/[a-zA-Z]/;function V(t,e,n){var r,i,a,o,s,u,f,v,g,y,w,b,p,x,k,M,S,E;d(2,arguments);var C=String(e),D=m(),P=null!==(r=null!==(i=null==n?void 0:n.locale)&&void 0!==i?i:D.locale)&&void 0!==r?r:I,T=h(null!==(a=null!==(o=null!==(s=null!==(u=null==n?void 0:n.firstWeekContainsDate)&&void 0!==u?u:null==n||null===(f=n.locale)||void 0===f||null===(v=f.options)||void 0===v?void 0:v.firstWeekContainsDate)&&void 0!==s?s:D.firstWeekContainsDate)&&void 0!==o?o:null===(g=D.locale)||void 0===g||null===(y=g.options)||void 0===y?void 0:y.firstWeekContainsDate)&&void 0!==a?a:1);if(!(T>=1&&T<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var j=h(null!==(w=null!==(b=null!==(p=null!==(x=null==n?void 0:n.weekStartsOn)&&void 0!==x?x:null==n||null===(k=n.locale)||void 0===k||null===(M=k.options)||void 0===M?void 0:M.weekStartsOn)&&void 0!==p?p:D.weekStartsOn)&&void 0!==b?b:null===(S=D.locale)||void 0===S||null===(E=S.options)||void 0===E?void 0:E.weekStartsOn)&&void 0!==w?w:0);if(!(j>=0&&j<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!P.localize)throw new RangeError("locale must contain localize property");if(!P.formatLong)throw new RangeError("locale must contain formatLong property");var _=l(t);if(!function(t){if(d(1,arguments),!function(t){return d(1,arguments),t instanceof Date||"object"===c(t)&&"[object Date]"===Object.prototype.toString.call(t)}(t)&&"number"!=typeof t)return!1;var e=l(t);return!isNaN(Number(e))}(_))throw new RangeError("Invalid time value");var R=function(t){var e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),t.getTime()-e.getTime()}(_),W=function(t,e){return d(2,arguments),function(t,e){d(2,arguments);var n=l(t).getTime(),r=h(e);return new Date(n+r)}(t,-h(e))}(_,R),z={firstWeekContainsDate:T,weekStartsOn:j,locale:P,_originalDate:_};return C.match(F).map((function(t){var e=t[0];return"p"===e||"P"===e?(0,L[e])(t,P.formatLong):t})).join("").match(X).map((function(r){if("''"===r)return"'";var i,a,o=r[0];if("'"===o)return(a=(i=r).match(J))?a[1].replace(Z,"'"):i;var s=O[o];if(s)return null!=n&&n.useAdditionalWeekYearTokens||-1===q.indexOf(r)||G(r,e,String(t)),null!=n&&n.useAdditionalDayOfYearTokens||!(-1!==Y.indexOf(r))||G(r,e,String(t)),s(W,r,P.localize,z);if(o.match(K))throw new RangeError("Format string contains an unescaped latin alphabet character `"+o+"`");return r})).join("")}function tt(t,e){return null==t||""===t||(0!==t||!e)&&(Array.isArray(t)?function(t){if(0===t.length)return!0;const e=t.length;let n=0;for(let r=0;r<e;r++){if(!tt(t[r]))return!1;n++}return n===e}(t):"[object Object]"===Object.prototype.toString.call(t)?function(t){if(0===Object.keys(t).length)return!0;const e=Object.keys(t).length;let n=0;for(const e of Object.values(t)){if(!tt(e))return!1;n++}return n===e}(t):!t)}const et="?";function nt(t,e){return t&&t.length>0?t.map((t=>{const[n,r]=V(new Date(t.createdAt),`MMM d,yyyy${et}HH:mm:ss a 'UTC'`).split(et);return{id:t.id,name:(null==e?void 0:e.name)||t.gameName,imageSrc:null==e?void 0:e.imageSrc,totalAmount:(null==e?void 0:e.currency)?`${null==e?void 0:e.currency} ${t.amount}`:t.amount,date:n,time:r,selectedNumbers:t.selection.map((t=>t.selections)).join(",")}})):[]}async function rt({endpoint:t,filterData:e,sessionId:n,meta:r}){const{items:i=[],total:a}=await function(t,e="GET",n=null,r={}){return new Promise(((i,a)=>{const o="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)})),s=Object.assign({"Content-Type":"application/json"},r);"GET"!==e&&"HEAD"!==e&&(s["X-Idempotency-Key"]=o);const u={method:e,headers:s,body:null};n&&"GET"!==e&&"HEAD"!==e?u.body=JSON.stringify(n):delete u.body,fetch(t,u).then((t=>t.ok?t.json():t.json().then((e=>{a({status:t.status,statusText:t.statusText,code:e.code||"UNKNOWN_ERROR",message:e.message||"An unknown error occurred",data:e.data||null})}),(()=>a({status:t.status,statusText:t.statusText,code:"PARSE_ERROR",message:"Failed to parse error response"}))))).then((t=>i(t)),(t=>a(t)))}))}(`${t}/tickets${function(t){const e={};Object.entries(t).forEach((([t,n])=>{tt(n,!0)||(e[t]=n)}));const n=Object.entries(e).map((([t,e])=>`${encodeURIComponent(t)}=${encodeURIComponent(e)}`)).join("&");return n?`?${n}`:""}(e)}`,"GET",null,{Authorization:`Bearer ${n}`})||{items:[],total:0};return{items:nt(i,r),total:a}}const it=["ro","en","fr","ar","hr"],at={en:{releaseToRefresh:"Release to refresh...",youHaveReachedTheEnd:"You have reached the end.",failToShowTicketList:"Fail to show ticket list.",unauthorized:"Unauthorized, please login."}},ot=(t,e,n)=>{const r=e;let i=at[void 0!==r&&it.includes(r)?r:"en"][t];return n&&Object.keys(n).forEach((t=>{i=i.replace(`{${t}}`,n[t])})),i};var st=function(){return st=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},st.apply(this,arguments)},ut={primaryColor:"#333",secondaryColor:"#E6E6E6"};function ct(t,e){if(void 0===e&&(e={}),"function"==typeof t.icon){var n=e.placeholders||ut;return ht(t.icon(n.primaryColor,n.secondaryColor),e)}return ht(t.icon,e)}function ht(t,e){var n="svg"===t.tag?st(st({},t.attrs),e.extraSVGAttrs||{}):t.attrs,r=Object.keys(n).reduce((function(t,e){var r=n[e],i="".concat(e,'="').concat(r,'"');return t.push(i),t}),[]),i=r.length?" "+r.join(" "):"",a=(t.children||[]).map((function(t){return ht(t,e)})).join("");return a&&a.length?"<".concat(t.tag).concat(i,">").concat(a,"</").concat(t.tag,">"):"<".concat(t.tag).concat(i," />")}const dt=ct({icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"}}]},name:"loading",theme:"outlined"},{extraSVGAttrs:{width:"14px",height:"14px",fill:"currentColor"}}),lt=class{constructor(n){t(this,n),this.page=0,this.vendorGameType=a.Lottery,this.customStyle=`\n :host {\n --lottery-hakuna-ticket-history-item-container-min-width: ${this.minItemWidth}px;\n\n .lottery-hakuna-ticket-history-item__container {\n justify-content: flex-start;\n }\n }\n\n .lottery-hakuna-ticket-history-item__container-wrapper {\n height: 100%;\n box-sizing: border-box;\n }\n .lottery-hakuna-ticket-history-item__container {\n height: 100%;\n box-sizing: border-box;\n }\n `,this.handleLoadMore=()=>{!this.isLoading&&this.hasMore&&this.getTicketList(this.page+1)},this.handleRefresh=()=>{this.isRefreshing||(this.page=1,this.getTicketList(1,!0))},this.renderSkeleton=()=>e("lottery-hakuna-ticket-history-item",{"client-styling":this.customStyle+(this.clientStyling||""),"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource,translationUrl:this.translationUrl,language:this.language,showSkeleton:!0}),this.renderItem=t=>e("lottery-hakuna-ticket-history-item",{"client-styling":this.customStyle+(this.clientStyling||""),"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource,translationUrl:this.translationUrl,language:this.language,key:t.id,"history-item-name":t.name,"history-item-image-src":t.imageSrc,"ticket-id":t.id,"total-amount":t.totalAmount,date:t.date,time:t.time,"selected-numbers":t.selectedNumbers}),this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.language="en",this.translationUrl="",this.endpoint=void 0,this.gameId=void 0,this.playerId=void 0,this.sessionId="",this.scrollThreshold="0px 0px 200px 0px",this.scrollContainerHeight=500,this.ticketHistoryTitle="YOUR TICKET",this.ticketHistoryItemImageSrc=void 0,this.ticketHistoryItemName=void 0,this.ticketHistoryItemCurrency="R",this.listLoadingText=void 0,this.listRefreshingText=void 0,this.listEndText=void 0,this.limit=10,this.visibleTickets=[],this.hasMore=!1,this.isLoading=!1,this.isRefreshing=!1,this.errorMessage=void 0,this.minItemWidth=300,this.showSkeleton=!0}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&r(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&i(this.stylingContainer,`${this.mbSource}.Style`)}componentWillLoad(){(async t=>{if(t)try{const n=await fetch(t);if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);const r=await n.json();e=r,Object.keys(e).forEach((t=>{for(let n in e[t])at[t][n]=e[t][n]}))}catch(t){console.error("Failed to fetch or parse translations from URL:",t)}var e})(this.translationUrl),this.getTicketList(1)}async getTicketList(t,e=!1){try{if(!this.endpoint||!this.sessionId)return Promise.reject(new Error("Endpoint and sessionId are required"));if(t<=0||!this.limit)return;e?this.isRefreshing=!0:this.isLoading=!0;const{items:n,total:r}=await rt({endpoint:this.endpoint,filterData:{offset:(t-1)*this.limit,limit:this.limit,vendorGameType:this.vendorGameType},sessionId:this.sessionId,meta:{name:this.ticketHistoryItemName,imageSrc:this.ticketHistoryItemImageSrc,currency:this.ticketHistoryItemCurrency}});this.visibleTickets=e?[...n]:[...this.visibleTickets,...n],this.hasMore=t<Math.ceil(r/this.limit),this.page=t,this.isLoading=!1,this.isRefreshing=!1,this.errorMessage=null}catch(t){if(this.isLoading=!1,this.isRefreshing=!1,401===t.status)return this.errorMessage=ot("unauthorized",this.language),void window.postMessage({type:"SessionExpired"},window.location.href);this.errorMessage=ot("failToShowTicketList",this.language)}}componentDidLoad(){this.stylingContainer&&(this.mbSource&&i(this.stylingContainer,`${this.mbSource}.Style`),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&r(this.stylingContainer,this.clientStylingUrl))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}renderInfoIcon(){return e("svg",{width:"45",height:"45",viewBox:"0 0 45 45",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",fill:"currentColor",d:"M22.5 5.625C13.1802 5.625 5.625 13.1802 5.625 22.5C5.625 31.8198 13.1802 39.375 22.5 39.375C31.8198 39.375 39.375 31.8198 39.375 22.5C39.375 13.1802 31.8198 5.625 22.5 5.625ZM1.875 22.5C1.875 11.1091 11.1091 1.875 22.5 1.875C33.8909 1.875 43.125 11.1091 43.125 22.5C43.125 33.8909 33.8909 43.125 22.5 43.125C11.1091 43.125 1.875 33.8909 1.875 22.5ZM22.5 13.125C23.5355 13.125 24.375 13.9645 24.375 15V22.5C24.375 23.5355 23.5355 24.375 22.5 24.375C21.4645 24.375 20.625 23.5355 20.625 22.5V15C20.625 13.9645 21.4645 13.125 22.5 13.125ZM20.625 30C20.625 28.9645 21.4645 28.125 22.5 28.125H22.5188C23.5543 28.125 24.3938 28.9645 24.3938 30C24.3938 31.0355 23.5543 31.875 22.5188 31.875H22.5C21.4645 31.875 20.625 31.0355 20.625 30Z"}))}render(){return e("div",{key:"f670a3429de4b967f7ea6de648e91201f08611c3",class:"lottery-hakuna-ticket-history__container",ref:t=>this.stylingContainer=t},e("div",{key:"e1f7c9acdfccf3b059af66f6be956027fe9157a9",class:"lottery-hakuna-ticket-history__title"},this.ticketHistoryTitle),this.errorMessage&&e("div",{key:"db36df4b9e6277883149a7dfd905b458656c6956",class:"lottery-hakuna-ticket-history__error-message"},this.renderInfoIcon(),e("span",{key:"bf55f6af11f8760b75b76c3866714ca311671ef4"},this.errorMessage)),e("lottery-infinite-scroll",{key:"33d57ff5205e065ce989d88a5f4ab22ed8ce8520","client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource,hasMore:this.hasMore,items:[...this.visibleTickets],minItemWidth:this.minItemWidth,threshold:this.scrollThreshold,gridGap:10,isLoading:this.isLoading,isRefreshing:this.isRefreshing,onLoadMore:this.handleLoadMore,onRefresh:this.handleRefresh,renderItem:this.renderItem,renderSkeleton:this.showSkeleton?this.renderSkeleton:null,skeletonCount:this.limit},e("div",{key:"3c64ee5287ec0e1be431890c2a2a1e9011fb41f0",slot:"loading-more",class:"lottery-hakuna-ticket-history__loading-more"},e("span",{key:"23f990cea7385a6de85cc246d2e9c8d942d9838d",class:"loading-spinner",innerHTML:dt})),e("div",{key:"74a90a269101258ac8e8e642773c57fe1aef7971",slot:"refresh-loading",class:"lottery-hakuna-ticket-history__refresh-loading"},this.listRefreshingText||ot("releaseToRefresh",this.language)),e("div",{key:"ffa6650f925314df9ea067422ce60f38bee01f0e",slot:"end-message",class:"lottery-hakuna-ticket-history__end-message"},this.listEndText||ot("youHaveReachedTheEnd",this.language))))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};lt.style=":host{display:block}.lottery-hakuna-ticket-history__container{padding:var(--lottery-hakuna-container-padding, 0);display:flex;flex-direction:var(--lottery-hakuna-container-flex-direction, column);align-items:var(--lottery-hakuna-container-align-items, center)}.lottery-hakuna-ticket-history__title{color:var(--lottery-hakuna-title-color, #000);font-size:var(--lottery-hakuna-title-font-size, 14px);font-style:var(--lottery-hakuna-title-font-style, normal);font-weight:var(--lottery-hakuna-title-font-weight, 700);line-height:var(--lottery-hakuna-title-line-height, normal);text-transform:var(--lottery-hakuna-title-text-transform, uppercase);margin-bottom:var(--lottery-hakuna-title-margin-bottom, 18px)}lottery-hakuna-ticket-history-item{width:var(--lottery-hakuna-ticket-history-item-width, 100%)}lottery-infinite-scroll{max-width:var(--lottery-hakuna-ticket-history-item-max-width, 100%);height:var(--lottery-hakuna-ticket-history-item-height, 500px)}.lottery-hakuna-ticket-history__end-message{width:var(--lottery-hakuna-end-message-width, 100%);text-align:var(--lottery-hakuna-end-message-text-align, center);font-size:var(--lottery-hakuna-end-message-font-size, 14px)}.lottery-hakuna-ticket-history__loading-more{width:var(--lottery-hakuna-loading-more-width, 100%);display:flex;align-items:center;justify-content:center;font-size:var(--lottery-hakuna-loading-more-font-size, 14px);gap:var(--lottery-hakuna-loading-spinner-text-gap, 8px);}.lottery-hakuna-ticket-history__loading-more .loading-spinner{animation:spin var(--lottery-hakuna-loading-spinner-animation-duration, 1s) linear infinite;color:var(--lottery-hakuna-loading-spinner-color, currentColor);}.lottery-hakuna-ticket-history__loading-more .loading-spinner svg{width:var(--lottery-hakuna-loading-spinner-size, 16px);height:var(--lottery-hakuna-loading-spinner-size, 16px)}@keyframes spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}.lottery-hakuna-ticket-history__error-message{display:flex;align-items:center;justify-content:center;gap:8px;margin-bottom:10px}.lottery-hakuna-ticket-history__error-message svg{width:20px;height:20px}";export{lt as L,r as a,i as b,ct as r,n as s}
@@ -1 +1 @@
1
- import{p as e,b as t}from"./index-50addd47.js";export{s as setNonce}from"./index-50addd47.js";import{g as l}from"./app-globals-0f993ce5.js";(()=>{const t=import.meta.url,l={};return""!==t&&(l.resourcesUrl=new URL(".",t).href),e(l)})().then((async e=>(await l(),t([["lottery-button_8",[[1,"lottery-hakuna-ticket-history",{mbSource:[513,"mb-source"],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],language:[513],translationUrl:[513,"translation-url"],endpoint:[513],gameId:[513,"game-id"],playerId:[514,"player-id"],sessionId:[513,"session-id"],scrollThreshold:[1,"scroll-threshold"],scrollItemHeight:[2,"scroll-item-height"],scrollContainerHeight:[2,"scroll-container-height"],ticketHistoryTitle:[1,"ticket-history-title"],ticketHistoryItemImageSrc:[1,"ticket-history-item-image-src"],ticketHistoryItemName:[1,"ticket-history-item-name"],ticketHistoryItemCurrency:[1,"ticket-history-item-currency"],listLoadingText:[1,"list-loading-text"],listRefreshingText:[1,"list-refreshing-text"],listEndText:[1,"list-end-text"],limit:[2],minItemWidth:[2,"min-item-width"],showSkeleton:[4,"show-skeleton"],visibleTickets:[32],hasMore:[32],isLoading:[32],isRefreshing:[32],errorMessage:[32]},null,{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}],[1,"lottery-hakuna-ticket-history-item",{mbSource:[513,"mb-source"],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],language:[513],translationUrl:[513,"translation-url"],historyItemName:[1,"history-item-name"],historyItemImageSrc:[1,"history-item-image-src"],ticketId:[8,"ticket-id"],totalAmount:[1,"total-amount"],date:[1],time:[1],selectedNumbers:[1,"selected-numbers"],showSkeleton:[4,"show-skeleton"],selectedNumbersCount:[2,"selected-numbers-count"]},null,{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}],[1,"lottery-infinite-scroll",{items:[16],hasMore:[4,"has-more"],isLoading:[4,"is-loading"],isRefreshing:[4,"is-refreshing"],threshold:[1],estimatedItemHeight:[2,"estimated-item-height"],containerHeight:[1,"container-height"],enableVirtualScroll:[4,"enable-virtual-scroll"],renderItem:[16],renderSkeleton:[16],skeletonCount:[2,"skeleton-count"],pullTriggerDistance:[2,"pull-trigger-distance"],minItemWidth:[2,"min-item-width"],gridGap:[2,"grid-gap"],visibleStartIndex:[32],visibleEndIndex:[32],pullDistance:[32],columns:[32]},null,{items:["handleItemsChange"],isRefreshing:["handleRefreshingChange"]}],[1,"lottery-selection-group",{mbSource:[513,"mb-source"],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],language:[513],translationUrl:[513,"translation-url"],splitToken:[513,"split-token"],selectionGroupId:[513,"selection-group-id"],selectionGroupLabel:[513,"selection-group-label"],type:[513],selectedBulletTexts:[513,"selected-bullet-texts"],maxSelectedCount:[514,"max-selected-count"],maxDisplayBulletsCount:[514,"max-display-bullets-count"],bulletTexts:[513,"bullet-texts"],maxIntegerBulletText:[514,"max-integer-bullet-text"],minIntegerBulletText:[514,"min-integer-bullet-text"],bulletTextType:[513,"bullet-text-type"],hasBorder:[516,"has-border"],hasBackground:[516,"has-background"],dialogTitle:[513,"dialog-title"],dialogInputPlaceholder:[513,"dialog-input-placeholder"],dialogConfig:[32],inputInfo:[32]},[[0,"lotteryBulletClick","lotteryBulletClickHandler"]],{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}],[0,"ui-skeleton",{structure:[1],width:[1],height:[1],borderRadius:[8,"border-radius"],marginBottom:[8,"margin-bottom"],marginTop:[8,"margin-top"],marginLeft:[8,"margin-left"],marginRight:[8,"margin-right"],animation:[4],rows:[2],size:[1]},null,{structure:["handleStructureChange"]}],[1,"lottery-button",{variant:[513],size:[513],color:[513],disabled:[516],loading:[516],text:[513],mbSource:[513,"mb-source"],language:[513],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],translationUrl:[513,"translation-url"],ripples:[32]},null,{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}],[1,"lottery-selection",{value:[520],text:[513],idx:[514],type:[513],mbSource:[513,"mb-source"],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],hasBorder:[516,"has-border"],hasBackground:[516,"has-background"],deleteIconSvg:[513,"delete-icon-svg"],deleteIconWidth:[513,"delete-icon-width"],deleteIconHeight:[513,"delete-icon-height"]},null,{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}],[1,"lottery-tipping-dialog",{mbSource:[1,"mb-source"],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],visible:[516],dialogTitle:[1,"dialog-title"],width:[1],closable:[4],mask:[4],maskClosable:[4,"mask-closable"],animationDuration:[2,"animation-duration"],fullscreen:[4],showFooter:[4,"show-footer"],showCancelBtn:[4,"show-cancel-btn"],language:[513],translationUrl:[520,"translation-url"],dialogClass:[1,"dialog-class"],dialogStyle:[16]},null,{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}]]]],e))));
1
+ import{p as e,b as t}from"./index-50addd47.js";export{s as setNonce}from"./index-50addd47.js";import{g as l}from"./app-globals-0f993ce5.js";(()=>{const t=import.meta.url,l={};return""!==t&&(l.resourcesUrl=new URL(".",t).href),e(l)})().then((async e=>(await l(),t([["lottery-button_8",[[1,"lottery-hakuna-ticket-history",{mbSource:[513,"mb-source"],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],language:[513],translationUrl:[513,"translation-url"],endpoint:[513],gameId:[513,"game-id"],playerId:[514,"player-id"],sessionId:[513,"session-id"],scrollThreshold:[1,"scroll-threshold"],scrollContainerHeight:[2,"scroll-container-height"],ticketHistoryTitle:[1,"ticket-history-title"],ticketHistoryItemImageSrc:[1,"ticket-history-item-image-src"],ticketHistoryItemName:[1,"ticket-history-item-name"],ticketHistoryItemCurrency:[1,"ticket-history-item-currency"],listLoadingText:[1,"list-loading-text"],listRefreshingText:[1,"list-refreshing-text"],listEndText:[1,"list-end-text"],limit:[2],minItemWidth:[2,"min-item-width"],showSkeleton:[4,"show-skeleton"],visibleTickets:[32],hasMore:[32],isLoading:[32],isRefreshing:[32],errorMessage:[32]},null,{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}],[1,"lottery-hakuna-ticket-history-item",{mbSource:[513,"mb-source"],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],language:[513],translationUrl:[513,"translation-url"],historyItemName:[1,"history-item-name"],historyItemImageSrc:[1,"history-item-image-src"],ticketId:[8,"ticket-id"],totalAmount:[1,"total-amount"],date:[1],time:[1],selectedNumbers:[1,"selected-numbers"],showSkeleton:[4,"show-skeleton"],selectedNumbersCount:[2,"selected-numbers-count"]},null,{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}],[1,"lottery-infinite-scroll",{items:[16],hasMore:[4,"has-more"],isLoading:[4,"is-loading"],isRefreshing:[4,"is-refreshing"],threshold:[1],containerHeight:[1,"container-height"],renderItem:[16],renderSkeleton:[16],skeletonCount:[2,"skeleton-count"],pullTriggerDistance:[2,"pull-trigger-distance"],minItemWidth:[2,"min-item-width"],gridGap:[2,"grid-gap"],pullDistance:[32]},null,{isRefreshing:["handleRefreshingChange"]}],[1,"lottery-selection-group",{mbSource:[513,"mb-source"],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],language:[513],translationUrl:[513,"translation-url"],splitToken:[513,"split-token"],selectionGroupId:[513,"selection-group-id"],selectionGroupLabel:[513,"selection-group-label"],type:[513],selectedBulletTexts:[513,"selected-bullet-texts"],maxSelectedCount:[514,"max-selected-count"],maxDisplayBulletsCount:[514,"max-display-bullets-count"],bulletTexts:[513,"bullet-texts"],maxIntegerBulletText:[514,"max-integer-bullet-text"],minIntegerBulletText:[514,"min-integer-bullet-text"],bulletTextType:[513,"bullet-text-type"],hasBorder:[516,"has-border"],hasBackground:[516,"has-background"],dialogTitle:[513,"dialog-title"],dialogInputPlaceholder:[513,"dialog-input-placeholder"],dialogConfig:[32],inputInfo:[32]},[[0,"lotteryBulletClick","lotteryBulletClickHandler"]],{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}],[0,"ui-skeleton",{structure:[1],width:[1],height:[1],borderRadius:[8,"border-radius"],marginBottom:[8,"margin-bottom"],marginTop:[8,"margin-top"],marginLeft:[8,"margin-left"],marginRight:[8,"margin-right"],animation:[4],rows:[2],size:[1]},null,{structure:["handleStructureChange"]}],[1,"lottery-button",{variant:[513],size:[513],color:[513],disabled:[516],loading:[516],text:[513],mbSource:[513,"mb-source"],language:[513],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],translationUrl:[513,"translation-url"],ripples:[32]},null,{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}],[1,"lottery-selection",{value:[520],text:[513],idx:[514],type:[513],mbSource:[513,"mb-source"],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],hasBorder:[516,"has-border"],hasBackground:[516,"has-background"],deleteIconSvg:[513,"delete-icon-svg"],deleteIconWidth:[513,"delete-icon-width"],deleteIconHeight:[513,"delete-icon-height"]},null,{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}],[1,"lottery-tipping-dialog",{mbSource:[1,"mb-source"],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],visible:[516],dialogTitle:[1,"dialog-title"],width:[1],closable:[4],mask:[4],maskClosable:[4,"mask-closable"],animationDuration:[2,"animation-duration"],fullscreen:[4],showFooter:[4,"show-footer"],showCancelBtn:[4,"show-cancel-btn"],language:[513],translationUrl:[520,"translation-url"],dialogClass:[1,"dialog-class"],dialogStyle:[16]},null,{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}]]]],e))));
@@ -42,10 +42,6 @@ export declare class LotteryHakunaTicketHistory {
42
42
  * Default: '0px 0px 200px 0px'
43
43
  */
44
44
  scrollThreshold: string;
45
- /**
46
- * Estimated height of a single ticket item in pixels.
47
- */
48
- scrollItemHeight: number;
49
45
  /**
50
46
  * Height of the scrollable container in pixels.
51
47
  */
@@ -2,103 +2,89 @@ import { EventEmitter } from '../../stencil-public-runtime';
2
2
  export declare class LotteryInfiniteScroll {
3
3
  el: HTMLElement;
4
4
  /**
5
- * An array of items to be displayed in the infinite scroll list.
5
+ * The list of items to be displayed in the infinite scroll.
6
6
  */
7
7
  items: any[];
8
8
  /**
9
- * Indicates if there are more items to load. When false, no more `loadMore` events will be emitted.
9
+ * Indicates whether there is more data to load.
10
10
  */
11
11
  hasMore: boolean;
12
12
  /**
13
- * Indicates if new items are currently being loaded. Used to prevent multiple `loadMore` calls.
13
+ * Indicates if data is currently being loaded.
14
14
  */
15
15
  isLoading: boolean;
16
16
  /**
17
- * Indicates if the component is currently in a refreshing state (e.g., during pull-to-refresh).
17
+ * Indicates if the content is currently being refreshed (pull-to-refresh).
18
18
  */
19
19
  isRefreshing: boolean;
20
20
  /**
21
- * Defines the intersection root margin for the IntersectionObserver.
22
- * This allows for pre-loading content before the sentinel becomes visible.
23
- * E.g., '0px 0px 200px 0px' means the bottom margin is 200px.
21
+ * The IntersectionObserver's rootMargin.
22
+ * Defines the distance from the bottom of the scroll container to trigger the `loadMore` event.
23
+ * E.g., '0px 0px 200px 0px' triggers when 200px from the bottom.
24
24
  */
25
25
  threshold: string;
26
26
  /**
27
- * Estimated height of each item.
28
- * Used in virtual scrolling to calculate the total scrollbar length.
29
- * Even if actual heights vary, an average value is sufficient;
30
- * CSS handles layout fluidly without overlap.
31
- */
32
- estimatedItemHeight: number;
33
- /**
34
- * Container height. If `enableVirtualScroll` is true,
35
- * it is recommended to explicitly set the container height in CSS
36
- * or pass this value.
27
+ * The height of the scrollable container.
37
28
  */
38
29
  containerHeight: string;
39
30
  /**
40
- * Enables or disables virtual scrolling for performance optimization with large lists.
31
+ * A function that renders a single item in the list.
32
+ * @param item - The data item to render.
33
+ * @param index - The index of the item.
34
+ * @returns The VNode for the item.
41
35
  */
42
- enableVirtualScroll: boolean;
43
- /** Render function */
44
36
  renderItem: (item: any, index: number) => any;
45
- /** Render function for skeleton item */
37
+ /**
38
+ * A function that renders a skeleton item for initial loading or when no data is available.
39
+ * @param index - The index of the skeleton item.
40
+ * @returns The VNode for the skeleton item.
41
+ */
46
42
  renderSkeleton: (index: number) => any;
47
- /** Number of skeleton items to show during initial load */
43
+ /**
44
+ * The number of skeleton items to display during initial loading.
45
+ * @default 6
46
+ */
48
47
  skeletonCount: number;
49
- /** Pull-to-refresh trigger distance */
48
+ /**
49
+ * The distance (in pixels) the user needs to pull down to trigger a refresh.
50
+ * @default 60
51
+ */
50
52
  pullTriggerDistance: number;
51
- /** Grid layout configuration: minimum column width
52
- * Used with CSS Grid to achieve responsiveness: repeat(auto-fill, minmax(minItemWidth, 1fr))
53
+ /**
54
+ * For Grid layout: The minimum width (in pixels) for each item.
55
+ * Used with CSS Grid's `auto-fill` to determine column count.
56
+ * @default 340
53
57
  */
54
58
  minItemWidth: number;
55
- /** Grid spacing (px) */
59
+ /**
60
+ * For Grid layout: The gap (in pixels) between grid items.
61
+ * @default 10
62
+ */
56
63
  gridGap: number;
57
64
  /**
58
- * Emitted when the user scrolls near the end of the list, indicating that more items should be loaded.
65
+ * Emitted when the user scrolls near the bottom of the list,
66
+ * indicating that more data should be loaded.
59
67
  */
60
68
  loadMore: EventEmitter<void>;
61
69
  /**
62
- * Emitted when the pull-to-refresh action is triggered by the user.
70
+ * Emitted when the user performs a pull-to-refresh action.
63
71
  */
64
72
  refresh: EventEmitter<void>;
65
73
  /**
66
- * The starting index of the items currently visible in the viewport (for virtual scrolling).
67
- */
68
- visibleStartIndex: number;
69
- /**
70
- * The ending index of the items currently visible in the viewport (for virtual scrolling).
71
- */
72
- visibleEndIndex: number;
73
- /**
74
- * The current distance of the pull-to-refresh action.
74
+ * The current vertical pull distance (in pixels) for the pull-to-refresh mechanism.
75
75
  */
76
76
  pullDistance: number;
77
- /** Number of columns that can fit in the current container width */
78
- columns: number;
79
77
  private observer;
80
- private resizeObserver;
81
- /** The HTMLElement observed by the IntersectionObserver (bottom sentinel). */
82
78
  private sentinel;
83
- /** The scrollable container HTMLElement. */
84
79
  private scrollContainer;
85
- /** Y-coordinate of the touch start event. */
86
80
  private startY;
87
- /** Indicates if a touch event is currently active for pull-to-refresh. */
88
81
  private isTouching;
89
- private rafId;
90
82
  componentDidLoad(): void;
91
83
  componentDidUpdate(): void;
92
84
  disconnectedCallback(): void;
93
- private initResizeObserver;
94
- private recalcColumns;
95
- handleItemsChange(): void;
96
85
  handleRefreshingChange(newValue: boolean): void;
97
86
  private disconnectObserver;
98
87
  private initObserver;
99
- private onScroll;
100
- private calculateMetrics;
101
- private calculateVisibleRange;
102
88
  private handleTouchStart;
103
89
  private handleTouchMove;
104
90
  private handleTouchEnd;
@@ -59,10 +59,6 @@ export namespace Components {
59
59
  * Height of the scrollable container in pixels.
60
60
  */
61
61
  "scrollContainerHeight": number;
62
- /**
63
- * Estimated height of a single ticket item in pixels.
64
- */
65
- "scrollItemHeight": number;
66
62
  /**
67
63
  * Threshold distance from the bottom to trigger loading more items. Default: '0px 0px 200px 0px'
68
64
  */
@@ -98,59 +94,60 @@ export namespace Components {
98
94
  }
99
95
  interface LotteryInfiniteScroll {
100
96
  /**
101
- * Container height. If `enableVirtualScroll` is true, it is recommended to explicitly set the container height in CSS or pass this value.
97
+ * The height of the scrollable container.
102
98
  */
103
99
  "containerHeight": string;
104
100
  /**
105
- * Enables or disables virtual scrolling for performance optimization with large lists.
106
- */
107
- "enableVirtualScroll": boolean;
108
- /**
109
- * Estimated height of each item. Used in virtual scrolling to calculate the total scrollbar length. Even if actual heights vary, an average value is sufficient; CSS handles layout fluidly without overlap.
110
- */
111
- "estimatedItemHeight": number;
112
- /**
113
- * Grid spacing (px)
101
+ * For Grid layout: The gap (in pixels) between grid items.
102
+ * @default 10
114
103
  */
115
104
  "gridGap": number;
116
105
  /**
117
- * Indicates if there are more items to load. When false, no more `loadMore` events will be emitted.
106
+ * Indicates whether there is more data to load.
118
107
  */
119
108
  "hasMore": boolean;
120
109
  /**
121
- * Indicates if new items are currently being loaded. Used to prevent multiple `loadMore` calls.
110
+ * Indicates if data is currently being loaded.
122
111
  */
123
112
  "isLoading": boolean;
124
113
  /**
125
- * Indicates if the component is currently in a refreshing state (e.g., during pull-to-refresh).
114
+ * Indicates if the content is currently being refreshed (pull-to-refresh).
126
115
  */
127
116
  "isRefreshing": boolean;
128
117
  /**
129
- * An array of items to be displayed in the infinite scroll list.
118
+ * The list of items to be displayed in the infinite scroll.
130
119
  */
131
120
  "items": any[];
132
121
  /**
133
- * Grid layout configuration: minimum column width Used with CSS Grid to achieve responsiveness: repeat(auto-fill, minmax(minItemWidth, 1fr))
122
+ * For Grid layout: The minimum width (in pixels) for each item. Used with CSS Grid's `auto-fill` to determine column count.
123
+ * @default 340
134
124
  */
135
125
  "minItemWidth": number;
136
126
  /**
137
- * Pull-to-refresh trigger distance
127
+ * The distance (in pixels) the user needs to pull down to trigger a refresh.
128
+ * @default 60
138
129
  */
139
130
  "pullTriggerDistance": number;
140
131
  /**
141
- * Render function
132
+ * A function that renders a single item in the list.
133
+ * @param item - The data item to render.
134
+ * @param index - The index of the item.
135
+ * @returns The VNode for the item.
142
136
  */
143
137
  "renderItem": (item: any, index: number) => any;
144
138
  /**
145
- * Render function for skeleton item
139
+ * A function that renders a skeleton item for initial loading or when no data is available.
140
+ * @param index - The index of the skeleton item.
141
+ * @returns The VNode for the skeleton item.
146
142
  */
147
143
  "renderSkeleton": (index: number) => any;
148
144
  /**
149
- * Number of skeleton items to show during initial load
145
+ * The number of skeleton items to display during initial loading.
146
+ * @default 6
150
147
  */
151
148
  "skeletonCount": number;
152
149
  /**
153
- * Defines the intersection root margin for the IntersectionObserver. This allows for pre-loading content before the sentinel becomes visible. E.g., '0px 0px 200px 0px' means the bottom margin is 200px.
150
+ * The IntersectionObserver's rootMargin. Defines the distance from the bottom of the scroll container to trigger the `loadMore` event. E.g., '0px 0px 200px 0px' triggers when 200px from the bottom.
154
151
  */
155
152
  "threshold": string;
156
153
  }
@@ -243,10 +240,6 @@ declare namespace LocalJSX {
243
240
  * Height of the scrollable container in pixels.
244
241
  */
245
242
  "scrollContainerHeight"?: number;
246
- /**
247
- * Estimated height of a single ticket item in pixels.
248
- */
249
- "scrollItemHeight"?: number;
250
243
  /**
251
244
  * Threshold distance from the bottom to trigger loading more items. Default: '0px 0px 200px 0px'
252
245
  */
@@ -282,67 +275,68 @@ declare namespace LocalJSX {
282
275
  }
283
276
  interface LotteryInfiniteScroll {
284
277
  /**
285
- * Container height. If `enableVirtualScroll` is true, it is recommended to explicitly set the container height in CSS or pass this value.
278
+ * The height of the scrollable container.
286
279
  */
287
280
  "containerHeight"?: string;
288
281
  /**
289
- * Enables or disables virtual scrolling for performance optimization with large lists.
290
- */
291
- "enableVirtualScroll"?: boolean;
292
- /**
293
- * Estimated height of each item. Used in virtual scrolling to calculate the total scrollbar length. Even if actual heights vary, an average value is sufficient; CSS handles layout fluidly without overlap.
294
- */
295
- "estimatedItemHeight"?: number;
296
- /**
297
- * Grid spacing (px)
282
+ * For Grid layout: The gap (in pixels) between grid items.
283
+ * @default 10
298
284
  */
299
285
  "gridGap"?: number;
300
286
  /**
301
- * Indicates if there are more items to load. When false, no more `loadMore` events will be emitted.
287
+ * Indicates whether there is more data to load.
302
288
  */
303
289
  "hasMore"?: boolean;
304
290
  /**
305
- * Indicates if new items are currently being loaded. Used to prevent multiple `loadMore` calls.
291
+ * Indicates if data is currently being loaded.
306
292
  */
307
293
  "isLoading"?: boolean;
308
294
  /**
309
- * Indicates if the component is currently in a refreshing state (e.g., during pull-to-refresh).
295
+ * Indicates if the content is currently being refreshed (pull-to-refresh).
310
296
  */
311
297
  "isRefreshing"?: boolean;
312
298
  /**
313
- * An array of items to be displayed in the infinite scroll list.
299
+ * The list of items to be displayed in the infinite scroll.
314
300
  */
315
301
  "items"?: any[];
316
302
  /**
317
- * Grid layout configuration: minimum column width Used with CSS Grid to achieve responsiveness: repeat(auto-fill, minmax(minItemWidth, 1fr))
303
+ * For Grid layout: The minimum width (in pixels) for each item. Used with CSS Grid's `auto-fill` to determine column count.
304
+ * @default 340
318
305
  */
319
306
  "minItemWidth"?: number;
320
307
  /**
321
- * Emitted when the user scrolls near the end of the list, indicating that more items should be loaded.
308
+ * Emitted when the user scrolls near the bottom of the list, indicating that more data should be loaded.
322
309
  */
323
310
  "onLoadMore"?: (event: LotteryInfiniteScrollCustomEvent<void>) => void;
324
311
  /**
325
- * Emitted when the pull-to-refresh action is triggered by the user.
312
+ * Emitted when the user performs a pull-to-refresh action.
326
313
  */
327
314
  "onRefresh"?: (event: LotteryInfiniteScrollCustomEvent<void>) => void;
328
315
  /**
329
- * Pull-to-refresh trigger distance
316
+ * The distance (in pixels) the user needs to pull down to trigger a refresh.
317
+ * @default 60
330
318
  */
331
319
  "pullTriggerDistance"?: number;
332
320
  /**
333
- * Render function
321
+ * A function that renders a single item in the list.
322
+ * @param item - The data item to render.
323
+ * @param index - The index of the item.
324
+ * @returns The VNode for the item.
334
325
  */
335
326
  "renderItem"?: (item: any, index: number) => any;
336
327
  /**
337
- * Render function for skeleton item
328
+ * A function that renders a skeleton item for initial loading or when no data is available.
329
+ * @param index - The index of the skeleton item.
330
+ * @returns The VNode for the skeleton item.
338
331
  */
339
332
  "renderSkeleton"?: (index: number) => any;
340
333
  /**
341
- * Number of skeleton items to show during initial load
334
+ * The number of skeleton items to display during initial loading.
335
+ * @default 6
342
336
  */
343
337
  "skeletonCount"?: number;
344
338
  /**
345
- * Defines the intersection root margin for the IntersectionObserver. This allows for pre-loading content before the sentinel becomes visible. E.g., '0px 0px 200px 0px' means the bottom margin is 200px.
339
+ * The IntersectionObserver's rootMargin. Defines the distance from the bottom of the scroll container to trigger the `loadMore` event. E.g., '0px 0px 200px 0px' triggers when 200px from the bottom.
346
340
  */
347
341
  "threshold"?: string;
348
342
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/lottery-hakuna-ticket-history",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "module": "./dist/index.js",
6
6
  "es2015": "./dist/esm/index.mjs",