@everymatrix/lottery-game-page 1.24.7 → 1.26.0

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.
Files changed (77) hide show
  1. package/dist/cjs/helper-accordion.cjs.entry.js +4 -1
  2. package/dist/cjs/helper-accordion.cjs.entry.js.map +1 -1
  3. package/dist/cjs/helper-filters_2.cjs.entry.js +10069 -9613
  4. package/dist/cjs/helper-filters_2.cjs.entry.js.map +1 -1
  5. package/dist/cjs/helper-pagination.cjs.entry.js +7 -1
  6. package/dist/cjs/helper-pagination.cjs.entry.js.map +1 -1
  7. package/dist/cjs/lottery-draw-results-history.cjs.entry.js +15 -2
  8. package/dist/cjs/lottery-draw-results-history.cjs.entry.js.map +1 -1
  9. package/dist/cjs/lottery-game-page.cjs.entry.js +24 -1
  10. package/dist/cjs/lottery-game-page.cjs.entry.js.map +1 -1
  11. package/dist/cjs/lottery-ticket-controller.cjs.entry.js +4 -1
  12. package/dist/cjs/lottery-ticket-controller.cjs.entry.js.map +1 -1
  13. package/dist/cjs/lottery-ticket.cjs.entry.js +11 -1
  14. package/dist/cjs/lottery-ticket.cjs.entry.js.map +1 -1
  15. package/dist/collection/utils/locale.utils.js +24 -1
  16. package/dist/collection/utils/locale.utils.js.map +1 -1
  17. package/dist/components/helper-accordion2.js +4 -1
  18. package/dist/components/helper-accordion2.js.map +1 -1
  19. package/dist/components/helper-filters2.js +10012 -9573
  20. package/dist/components/helper-filters2.js.map +1 -1
  21. package/dist/components/helper-pagination.js +7 -1
  22. package/dist/components/helper-pagination.js.map +1 -1
  23. package/dist/components/lottery-draw-results-history2.js +15 -2
  24. package/dist/components/lottery-draw-results-history2.js.map +1 -1
  25. package/dist/components/lottery-draw-results2.js +19 -2
  26. package/dist/components/lottery-draw-results2.js.map +1 -1
  27. package/dist/components/lottery-game-page.js +24 -1
  28. package/dist/components/lottery-game-page.js.map +1 -1
  29. package/dist/components/lottery-ticket-controller2.js +4 -1
  30. package/dist/components/lottery-ticket-controller2.js.map +1 -1
  31. package/dist/components/lottery-ticket2.js +11 -1
  32. package/dist/components/lottery-ticket2.js.map +1 -1
  33. package/dist/esm/helper-accordion.entry.js +4 -1
  34. package/dist/esm/helper-accordion.entry.js.map +1 -1
  35. package/dist/esm/helper-filters_2.entry.js +10069 -9613
  36. package/dist/esm/helper-filters_2.entry.js.map +1 -1
  37. package/dist/esm/helper-pagination.entry.js +7 -1
  38. package/dist/esm/helper-pagination.entry.js.map +1 -1
  39. package/dist/esm/lottery-draw-results-history.entry.js +15 -2
  40. package/dist/esm/lottery-draw-results-history.entry.js.map +1 -1
  41. package/dist/esm/lottery-game-page.entry.js +24 -1
  42. package/dist/esm/lottery-game-page.entry.js.map +1 -1
  43. package/dist/esm/lottery-ticket-controller.entry.js +4 -1
  44. package/dist/esm/lottery-ticket-controller.entry.js.map +1 -1
  45. package/dist/esm/lottery-ticket.entry.js +11 -1
  46. package/dist/esm/lottery-ticket.entry.js.map +1 -1
  47. package/dist/lottery-game-page/lottery-game-page.esm.js +1 -1
  48. package/dist/lottery-game-page/p-12340c50.entry.js +2921 -0
  49. package/dist/lottery-game-page/p-12340c50.entry.js.map +1 -0
  50. package/dist/lottery-game-page/p-20e0c81c.entry.js +2 -0
  51. package/dist/lottery-game-page/p-20e0c81c.entry.js.map +1 -0
  52. package/dist/lottery-game-page/p-b19ff22c.entry.js +2 -0
  53. package/dist/lottery-game-page/p-b19ff22c.entry.js.map +1 -0
  54. package/dist/lottery-game-page/p-cba19473.entry.js +2 -0
  55. package/dist/lottery-game-page/p-cba19473.entry.js.map +1 -0
  56. package/dist/lottery-game-page/p-cd4aa6a4.entry.js +2 -0
  57. package/dist/lottery-game-page/p-cd4aa6a4.entry.js.map +1 -0
  58. package/dist/lottery-game-page/p-e86e2389.entry.js +2 -0
  59. package/dist/lottery-game-page/p-e86e2389.entry.js.map +1 -0
  60. package/dist/lottery-game-page/p-f399eef1.entry.js +2 -0
  61. package/dist/lottery-game-page/p-f399eef1.entry.js.map +1 -0
  62. package/package.json +1 -1
  63. package/dist/lottery-game-page/p-042065c6.entry.js +0 -2
  64. package/dist/lottery-game-page/p-042065c6.entry.js.map +0 -1
  65. package/dist/lottery-game-page/p-5b49ab69.entry.js +0 -2
  66. package/dist/lottery-game-page/p-5b49ab69.entry.js.map +0 -1
  67. package/dist/lottery-game-page/p-606c0b0f.entry.js +0 -2
  68. package/dist/lottery-game-page/p-606c0b0f.entry.js.map +0 -1
  69. package/dist/lottery-game-page/p-96f06e2d.entry.js +0 -2
  70. package/dist/lottery-game-page/p-96f06e2d.entry.js.map +0 -1
  71. package/dist/lottery-game-page/p-a9ef5b8c.entry.js +0 -2
  72. package/dist/lottery-game-page/p-a9ef5b8c.entry.js.map +0 -1
  73. package/dist/lottery-game-page/p-b8e683f6.entry.js +0 -2
  74. package/dist/lottery-game-page/p-b8e683f6.entry.js.map +0 -1
  75. package/dist/lottery-game-page/p-f8578814.entry.js +0 -2899
  76. package/dist/lottery-game-page/p-f8578814.entry.js.map +0 -1
  77. /package/dist/types/Users/{sebastian.strulea/Documents/work → adrian.pripon/Documents/Work}/widgets-stencil/packages/lottery-game-page/.stencil/packages/lottery-game-page/stencil.config.d.ts +0 -0
@@ -0,0 +1,2 @@
1
+ import{r as t,c as e,h as i}from"./p-e765c7d9.js";const r="en";const s=["ro","en","hr"];const n={en:{loading:"Loading, please wait ...",error:"It was an error while trying to fetch the data",grid:"Grid",multiplier:"Multiplier",numberOfDraws:"Number of draws",wagerPerDraw:"Wager per draw",resetButton:"Reset",autoButton:"I feel lucky"},ro:{loading:"Se incarca, va rugam asteptati ...",error:"A fost o eroare in timp ce asteptam datele",grid:"Grid",multiplier:"Multiplicator",numberOfDraws:"Numarul de extrageri",wagerPerDraw:"Pariul per extragere",resetButton:"Reseteaza",autoButton:"Ma simt norocos"},fr:{loading:"Loading, please wait ...",error:"It was an error while trying to fetch the data",grid:"Grid",multiplier:"Multiplier",numberOfDraws:"Number of draws",wagerPerDraw:"Wager per draw",resetButton:"Reset",autoButton:"I feel lucky"},ar:{loading:"Loading, please wait ...",error:"It was an error while trying to fetch the data",grid:"Grid",multiplier:"Multiplier",numberOfDraws:"Number of draws",wagerPerDraw:"Wager per draw",resetButton:"Reset",autoButton:"I feel lucky"},hr:{loading:"Učitavanje, molimo pričekajte ...",error:"Došlo je do pogreške prilikom pokušaja dohvaćanja podataka",grid:"Tablica",multiplier:"Multiplikator",numberOfDraws:"Broj izvlačenja",wagerPerDraw:"Ulog po izvlačenju",resetButton:"Resetiraj",autoButton:"Osjećam se sretno"}};const a=(t,e)=>{const i=e;return n[i!==undefined&&s.includes(i)?i:r][t]};const o='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");:host{display:block;font-family:"Roboto", sans-serif}.TicketTitle{font-size:16px;font-weight:bold}.ButtonContainer{display:flex;justify-content:flex-end}.Toggle{cursor:pointer;margin-top:20px;display:inline-block}.ToggleSwitch{display:inline-block;background:#707070;border-radius:16px;width:58px;height:24px;position:relative;vertical-align:middle;transition:background 0.25s}.ToggleSwitch:before,.ToggleSwitch:after{content:""}.ToggleSwitch:before{display:block;background:linear-gradient(to bottom, #fff 0%, #F1F1F1 100%);border-radius:50%;box-shadow:0 0 0 1px rgba(0, 0, 0, 0.25);width:16px;height:16px;position:absolute;top:4px;left:4px;transition:left 0.25s}.Toggle:hover .ToggleSwitch:before{background:linear-gradient(to bottom, #fff 0%, #fff 100%);box-shadow:0 0 0 1px rgba(0, 0, 0, 0.5)}.ToggleCheckbox:checked+.ToggleSwitch{background:#00ABA4}.ToggleCheckbox:checked+.ToggleSwitch:before{left:38px}.ToggleCheckbox{position:absolute;visibility:hidden}.Label{margin-right:5px;position:relative;top:2px;font-size:14px;font-weight:lighter;color:#000}input[type=number]{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none}.NumberInput,.WagerInput{margin-top:10px;display:inline-flex;align-items:center}.NumberInput,.NumberInput *{box-sizing:border-box}.NumberInput button{cursor:pointer;outline:none;-webkit-appearance:none;border:none;align-items:center;justify-content:center;height:20px;position:relative}.NumberInput button:after{display:inline-block;position:absolute;transform:translate(-50%, -50%) rotate(180deg);align-items:center;text-align:center}.NumberInput button.Plus:after{transform:translate(-50%, -50%) rotate(0deg);width:30px;display:inline-flex;align-items:center;text-align:center}.NumberInput input[type=number],.WagerInput input[type=number]{max-width:50px;display:inline-flex;align-items:center;padding:4px 10px;text-align:center}.NumberInput input[type=number] .WagerInputTitle,.WagerInput input[type=number] .WagerInputTitle{font-size:14px;color:#000;padding:10px}.InputDefault{background-color:#F1F1F1;border-radius:4px;padding:5px;border:solid 1px #D4D4D4;color:#707070}.AutoButton{cursor:pointer;display:inline-block;border-radius:4px;padding:8px 20px;width:max-content;margin:5px 0;border:1px solid #00958f;background:#FFF;color:#000;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0}.AutoButton:active{background:#00958f;color:#FFF}.ResetButton{cursor:pointer;display:inline-block;border-radius:4px;padding:8px 20px;width:max-content;margin:5px 0;color:#000;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0;background:#FF3D00;border:1px solid #FF3D00;color:#FFF}.ResetButton:hover{background:#FF6536;border:1px solid #FF3D00}.TicketGridBullets{background:#f1f1f1;border-radius:4px;padding:20px;margin-top:5px}.TicketGridBullets .TicketGridTitle{margin-top:0px}.Minus{border-radius:4px;width:30px;height:24px !important;margin-right:10px;color:#FFF;background:#009993}.Plus{border-radius:4px;width:30px;height:24px !important;margin-left:10px;color:#FFF;background:#009993}.SelectWrapper{width:auto;padding:5px;margin:0 auto;border:1px solid #ccc;border-radius:5px;position:relative}.SelectButton,.SelectOptions li{display:flex;align-items:center;cursor:pointer}.SelectButton{display:flex;padding:0 5px;border-radius:7px;align-items:center;justify-content:space-between;font-size:14px}.SelectButton span:first-child{padding-right:10px}.SelectExpand{transition:transform 0.3s linear;font-size:12px}.SelectActive .SelectExpand{transform:rotate(180deg)}.SelectContent{display:none;padding:5px;border-radius:7px}.SelectWrapper.SelectActive .SelectContent{width:100%;display:block;position:absolute;left:0;top:32px;padding:0;border:1px solid #ccc;overflow:hidden;background:#fff}.SelectContent .SelectOptions{max-height:100px;margin:0;overflow-y:auto;padding:0}.SelectContent .SelectOptions .SelectedValue{background-color:#009993;color:#fff}.SelectOptions::-webkit-scrollbar{width:7px}.SelectOptions::-webkit-scrollbar-track{background:#f1f1f1;border-radius:25px}.SelectOptions::-webkit-scrollbar-thumb{background:#ccc;border-radius:25px}.SelectOptions li{height:20px;padding:0 13px;font-size:14px}.SelectOptions li:hover{background:#f2f2f2}';const l=class{constructor(i){t(this,i);this.ticketCompleted=e(this,"ticketCompleted",7);this.autoSelection=e(this,"autoSelection",7);this.resetSelection=e(this,"resetSelection",7);this.stakeChange=e(this,"stakeChange",7);this.multiplierChange=e(this,"multiplierChange",7);this.numberOfGrids=1;this.multipleDraws=true;this.resetButton=false;this.autoPick=false;this.language="en";this.clientStyling="";this.clientStylingUrlContent="";this.multiplier=false;this.numberOfDraws=1;this.isLoading=true;this.hasErrors=false;this.ticketDone=false;this.isCustomSelect=false;this.amountInfo={};this.limitStylingAppends=false;this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling;this.stylingContainer.prepend(t)};this.setClientStylingURL=()=>{let t=document.createElement("style");setTimeout((()=>{t.innerHTML=this.clientStylingUrlContent;this.stylingContainer.prepend(t)}),1)}}checkForClickOutside(t){if(t.composedPath()[0].getAttribute("data-cluster")!=="SelectComponent"){this.isCustomSelect=false}}connectedCallback(){let t=new URL(`${this.endpoint}/games/${this.gameId}`);fetch(t.href).then((t=>{if(t.ok){return t.json()}else{this.hasErrors=true}})).then((t=>{this.isLoading=false;this.gameData=t;this.grids=[...Array(this.gameData.type.boards.length).keys()];this.amountInfo=this.gameData.type.stakes[0]})).catch((t=>{this.isLoading=false;this.hasErrors=true;console.error("Error!",t)}))}componentDidRender(){if(!this.limitStylingAppends&&this.stylingContainer){if(this.clientStyling)this.setClientStyling();if(this.clientStylingUrlContent)this.setClientStylingURL();this.limitStylingAppends=true}}multiplierChangeHandler(t){this.multiplier=t.target?t.target.checked:false;this.multiplierChange.emit(this.multiplier)}drawsChangeHandler(t){this.ticket=Object.assign(Object.assign({},this.ticket),{draws:t});this.ticketCompleted.emit(this.ticket)}gridFilledHandler(t){this.ticket=Object.assign(Object.assign({},t.detail),{draws:this.numberOfDraws});this.ticketDone=true;this.ticketCompleted.emit(this.ticket)}toggleAutoSelection(){this.ticketDone=true;this.autoSelection.emit(this.ticketId)}toggleResetSelection(){this.ticketDone=false;this.resetSelection.emit(this.ticketId)}changeStake(t,e){this.stakeChange.emit({ticketId:t,stake:e})}toggleClass(){this.isCustomSelect=!this.isCustomSelect}setDropdownItem(t){this.amountInfo={value:t.value,currency:t.currency};this.isCustomSelect=false;this.changeStake(this.ticketId,t.amount)}render(){if(this.isLoading){return i("div",null,i("p",null,a("loading",this.language)))}else{if(this.hasErrors){return i("div",null,i("p",null,a("error",this.language)))}else{const{type:t}=this.gameData;return i("div",{class:"TicketContainer",ref:t=>this.stylingContainer=t},i("p",{class:"TicketTitle"},this.gameData.name),this.resetButton&&this.ticketDone&&i("div",{class:"ButtonContainer"},i("a",{class:"ResetButton",onClick:()=>this.toggleResetSelection()},a("resetButton",this.language))),this.autoPick&&!this.ticketDone&&i("div",{class:"ButtonContainer"},i("a",{class:"AutoButton",onClick:()=>this.toggleAutoSelection()},a("autoButton",this.language))),this.grids.map(((e,r)=>i("div",{class:"TicketGridBullets"},i("p",{class:"TicketGridTitle"},a("grid",this.language)," ",r+1),i("lottery-grid",{"grid-index":r,"maximum-allowed":t.boards[r].maximumAllowed,"minimum-allowed":t.boards[r].minimumAllowed,"total-numbers":t.boards[r].highNumber-t.boards[r].lowNumber+1,selectable:true,"reset-button":true,"auto-pick":true,"game-id":this.gameId,"ticket-id":this.ticketId,language:this.language,"client-styling":this.clientStyling,"client-styling-url-content":this.clientStylingUrlContent})))),t.multiplier&&i("div",null,i("label",{class:"Toggle"},i("label",{class:"Label"},a("multiplier",this.language),": "),i("input",{class:"ToggleCheckbox",type:"checkbox",onInput:t=>this.multiplierChangeHandler(t)}),i("div",{class:"ToggleSwitch"}))),this.multipleDraws&&i("div",{class:"TicketDraws"},i("label",{class:"Label"},a("numberOfDraws",this.language),": "),i("div",{class:"NumberInput"},i("button",{onClick:()=>this.numberOfDraws>1?this.numberOfDraws--:this.numberOfDraws=1,class:"Minus"},"-"),i("input",{class:"InputDefault",min:"1",value:this.numberOfDraws,type:"number"}),i("button",{onClick:()=>this.numberOfDraws++,class:"Plus"},"+"))),i("div",null,i("label",{class:"Label"},a("wagerPerDraw",this.language),": "),i("div",{class:"WagerInput"},t.stakes.length>1?i("div",{"data-cluster":"SelectComponent",class:this.isCustomSelect?"SelectWrapper SelectActive":"SelectWrapper"},i("div",{"data-cluster":"SelectComponent",class:"SelectButton",onClick:()=>this.toggleClass()},i("span",{"data-cluster":"SelectComponent"},this.amountInfo.value," ",this.amountInfo.currency),i("span",{"data-cluster":"SelectComponent",class:"SelectExpand"},"▼")),i("div",{"data-cluster":"SelectComponent",class:"SelectContent"},i("ul",{"data-cluster":"SelectComponent",class:"SelectOptions"},t.stakes.map((t=>i("li",{"data-cluster":"SelectComponent",class:this.amountInfo.value==t.value?"SelectedValue":"",value:t.value,onClick:()=>this.setDropdownItem(t)},t.value," ",t.currency)))))):i("div",null,i("input",{min:"1",value:t.stakes[0].amount,type:"number",disabled:true}),i("p",{class:"WagerInputTitle"},t.stakes[0].currency)))))}}}static get watchers(){return{numberOfDraws:["drawsChangeHandler"]}}};l.style=o;export{l as lottery_ticket};
2
+ //# sourceMappingURL=p-20e0c81c.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../lottery-ticket/dist/collection/utils/locale.utils.js","../lottery-ticket/dist/collection/components/lottery-ticket/lottery-ticket.css?tag=lottery-ticket&encapsulation=shadow","../lottery-ticket/dist/collection/components/lottery-ticket/lottery-ticket.js"],"names":["DEFAULT_LANGUAGE","SUPPORTED_LANGUAGES","TRANSLATIONS","en","loading","error","grid","multiplier","numberOfDraws","wagerPerDraw","resetButton","autoButton","ro","fr","ar","hr","translate","key","customLang","lang","undefined","includes","lotteryTicketCss","LotteryTicket","[object Object]","hostRef","this","numberOfGrids","multipleDraws","autoPick","language","clientStyling","clientStylingUrlContent","isLoading","hasErrors","ticketDone","isCustomSelect","amountInfo","limitStylingAppends","setClientStyling","sheet","document","createElement","innerHTML","stylingContainer","prepend","setClientStylingURL","cssFile","setTimeout","ev","composedPath","getAttribute","url","URL","endpoint","gameId","fetch","href","then","response","ok","json","data","gameData","grids","Array","type","boards","length","keys","stakes","catch","err","console","e","target","checked","multiplierChange","emit","event","ticket","Object","assign","draws","ticketCompleted","detail","autoSelection","ticketId","resetSelection","ticketid","amount","stakeChange","stake","item","value","currency","changeStake","h","class","ref","el","name","onClick","toggleResetSelection","toggleAutoSelection","map","_","index","grid-index","maximum-allowed","maximumAllowed","minimum-allowed","minimumAllowed","total-numbers","highNumber","lowNumber","selectable","reset-button","auto-pick","game-id","ticket-id","client-styling","client-styling-url-content","onInput","multiplierChangeHandler","min","data-cluster","toggleClass","setDropdownItem","disabled"],"mappings":"kDAAA,MAAMA,EAAmB,KACzB,MAAMC,EAAsB,CAAC,KAAM,KAAM,MACzC,MAAMC,EAAe,CACnBC,GAAI,CACFC,QAAS,2BACTC,MAAO,iDACPC,KAAM,OACNC,WAAY,aACZC,cAAe,kBACfC,aAAc,iBACdC,YAAa,QACbC,WAAY,gBAEdC,GAAI,CACFR,QAAS,qCACTC,MAAO,6CACPC,KAAM,OACNC,WAAY,gBACZC,cAAe,uBACfC,aAAc,uBACdC,YAAa,YACbC,WAAY,mBAEdE,GAAI,CACFT,QAAS,2BACTC,MAAO,iDACPC,KAAM,OACNC,WAAY,aACZC,cAAe,kBACfC,aAAc,iBACdC,YAAa,QACbC,WAAY,gB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ChB,IACApE,KAAKW,WAAW0D,UAClBE,EAAE,OAAQ,CAAE6B,eAAgB,kBAAmB5B,MAAO,gBAAkB,MAC1ED,EAAE,MAAO,CAAE6B,eAAgB,kBAAmB5B,MAAO,iBACnDD,EAAE,KAAM,CAAE6B,eAAgB,kBAAmB5B,MAAO,iBAAmBhC,EAAKI,OAAOmC,KAAKZ,GAASI,EAAE,KAAM,CAAE6B,eAAgB,kBAAmB5B,MAAOxE,KAAKW,WAAWyD,OAASD,EAAKC,MAAQ,gBAAkB,GAAIA,MAAOD,EAAKC,MAAOQ,QAAS,IAAM5E,KAAKsG,gBAAgBnC,IACtQA,EAAKC,MACL,IACAD,EAAKE,eAAkBE,EAAE,MAAO,KACtCA,EAAE,QAAS,CAAE4B,IAAK,IAAK/B,MAAO5B,EAAKI,OAAO,GAAGoB,OAAQxB,KAAM,SAAU+D,SAAU,OAC/EhC,EAAE,IAAK,CAAEC,MAAO,mBAAqBhC,EAAKI,OAAO,GAAGyB","sourcesContent":["const DEFAULT_LANGUAGE = 'en';\nconst SUPPORTED_LANGUAGES = ['ro', 'en', 'hr'];\nconst TRANSLATIONS = {\n en: {\n loading: 'Loading, please wait ...',\n error: 'It was an error while trying to fetch the data',\n grid: 'Grid',\n multiplier: 'Multiplier',\n numberOfDraws: 'Number of draws',\n wagerPerDraw: 'Wager per draw',\n resetButton: 'Reset',\n autoButton: 'I feel lucky'\n },\n ro: {\n loading: 'Se incarca, va rugam asteptati ...',\n error: 'A fost o eroare in timp ce asteptam datele',\n grid: 'Grid',\n multiplier: 'Multiplicator',\n numberOfDraws: 'Numarul de extrageri',\n wagerPerDraw: 'Pariul per extragere',\n resetButton: 'Reseteaza',\n autoButton: 'Ma simt norocos'\n },\n fr: {\n loading: 'Loading, please wait ...',\n error: 'It was an error while trying to fetch the data',\n grid: 'Grid',\n multiplier: 'Multiplier',\n numberOfDraws: 'Number of draws',\n wagerPerDraw: 'Wager per draw',\n resetButton: 'Reset',\n autoButton: 'I feel lucky'\n },\n ar: {\n loading: 'Loading, please wait ...',\n error: 'It was an error while trying to fetch the data',\n grid: 'Grid',\n multiplier: 'Multiplier',\n numberOfDraws: 'Number of draws',\n wagerPerDraw: 'Wager per draw',\n resetButton: 'Reset',\n autoButton: 'I feel lucky'\n },\n hr: {\n loading: 'Učitavanje, molimo pričekajte ...',\n error: 'Došlo je do pogreške prilikom pokušaja dohvaćanja podataka',\n grid: 'Tablica',\n multiplier: 'Multiplikator',\n numberOfDraws: 'Broj izvlačenja',\n wagerPerDraw: 'Ulog po izvlačenju',\n resetButton: 'Resetiraj',\n autoButton: 'Osjećam se sretno'\n }\n};\nexport const translate = (key, customLang) => {\n const lang = customLang;\n return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];\n};\n","@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");\n:host {\n display: block;\n font-family: \"Roboto\", sans-serif;\n}\n\n.TicketTitle {\n font-size: 16px;\n font-weight: bold;\n}\n\n.ButtonContainer {\n display: flex;\n justify-content: flex-end;\n}\n\n.Toggle {\n cursor: pointer;\n margin-top: 20px;\n display: inline-block;\n}\n\n.ToggleSwitch {\n display: inline-block;\n background: #707070;\n border-radius: 16px;\n width: 58px;\n height: 24px;\n position: relative;\n vertical-align: middle;\n transition: background 0.25s;\n}\n.ToggleSwitch:before, .ToggleSwitch:after {\n content: \"\";\n}\n.ToggleSwitch:before {\n display: block;\n background: linear-gradient(to bottom, #fff 0%, #F1F1F1 100%);\n border-radius: 50%;\n box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);\n width: 16px;\n height: 16px;\n position: absolute;\n top: 4px;\n left: 4px;\n transition: left 0.25s;\n}\n\n.Toggle:hover .ToggleSwitch:before {\n background: linear-gradient(to bottom, #fff 0%, #fff 100%);\n box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5);\n}\n\n.ToggleCheckbox:checked + .ToggleSwitch {\n background: #00ABA4;\n}\n\n.ToggleCheckbox:checked + .ToggleSwitch:before {\n left: 38px;\n}\n\n.ToggleCheckbox {\n position: absolute;\n visibility: hidden;\n}\n\n.Label {\n margin-right: 5px;\n position: relative;\n top: 2px;\n font-size: 14px;\n font-weight: lighter;\n color: #000;\n}\n\ninput[type=number] {\n -webkit-appearance: textfield;\n -moz-appearance: textfield;\n appearance: textfield;\n}\n\ninput[type=number]::-webkit-inner-spin-button,\ninput[type=number]::-webkit-outer-spin-button {\n -webkit-appearance: none;\n}\n\n.NumberInput,\n.WagerInput {\n margin-top: 10px;\n display: inline-flex;\n align-items: center;\n}\n\n.NumberInput,\n.NumberInput * {\n box-sizing: border-box;\n}\n\n.NumberInput button {\n cursor: pointer;\n outline: none;\n -webkit-appearance: none;\n border: none;\n align-items: center;\n justify-content: center;\n height: 20px;\n position: relative;\n}\n\n.NumberInput button:after {\n display: inline-block;\n position: absolute;\n transform: translate(-50%, -50%) rotate(180deg);\n align-items: center;\n text-align: center;\n}\n\n.NumberInput button.Plus:after {\n transform: translate(-50%, -50%) rotate(0deg);\n width: 30px;\n display: inline-flex;\n align-items: center;\n text-align: center;\n}\n\n.NumberInput input[type=number],\n.WagerInput input[type=number] {\n max-width: 50px;\n display: inline-flex;\n align-items: center;\n padding: 4px 10px;\n text-align: center;\n}\n.NumberInput input[type=number] .WagerInputTitle,\n.WagerInput input[type=number] .WagerInputTitle {\n font-size: 14px;\n color: #000;\n padding: 10px;\n}\n\n.InputDefault {\n background-color: #F1F1F1;\n border-radius: 4px;\n padding: 5px;\n border: solid 1px #D4D4D4;\n color: #707070;\n}\n\n.AutoButton {\n cursor: pointer;\n display: inline-block;\n border-radius: 4px;\n padding: 8px 20px;\n width: max-content;\n margin: 5px 0;\n border: 1px solid #00958f;\n background: #FFF;\n color: #000;\n font-size: 12px;\n transition: all 0.2s linear;\n text-transform: uppercase;\n text-align: center;\n letter-spacing: 0;\n}\n.AutoButton:active {\n background: #00958f;\n color: #FFF;\n}\n\n.ResetButton {\n cursor: pointer;\n display: inline-block;\n border-radius: 4px;\n padding: 8px 20px;\n width: max-content;\n margin: 5px 0;\n color: #000;\n font-size: 12px;\n transition: all 0.2s linear;\n text-transform: uppercase;\n text-align: center;\n letter-spacing: 0;\n background: #FF3D00;\n border: 1px solid #FF3D00;\n color: #FFF;\n}\n.ResetButton:hover {\n background: #FF6536;\n border: 1px solid #FF3D00;\n}\n\n.TicketGridBullets {\n background: #f1f1f1;\n border-radius: 4px;\n padding: 20px;\n margin-top: 5px;\n}\n.TicketGridBullets .TicketGridTitle {\n margin-top: 0px;\n}\n\n.Minus {\n border-radius: 4px;\n width: 30px;\n height: 24px !important;\n margin-right: 10px;\n color: #FFF;\n background: #009993;\n}\n\n.Plus {\n border-radius: 4px;\n width: 30px;\n height: 24px !important;\n margin-left: 10px;\n color: #FFF;\n background: #009993;\n}\n\n.SelectWrapper {\n width: auto;\n padding: 5px;\n margin: 0 auto;\n border: 1px solid #ccc;\n border-radius: 5px;\n position: relative;\n}\n\n.SelectButton, .SelectOptions li {\n display: flex;\n align-items: center;\n cursor: pointer;\n}\n\n.SelectButton {\n display: flex;\n padding: 0 5px;\n border-radius: 7px;\n align-items: center;\n justify-content: space-between;\n font-size: 14px;\n}\n.SelectButton span:first-child {\n padding-right: 10px;\n}\n\n.SelectExpand {\n transition: transform 0.3s linear;\n font-size: 12px;\n}\n\n.SelectActive .SelectExpand {\n transform: rotate(180deg);\n}\n\n.SelectContent {\n display: none;\n padding: 5px;\n border-radius: 7px;\n}\n\n.SelectWrapper.SelectActive .SelectContent {\n width: 100%;\n display: block;\n position: absolute;\n left: 0;\n top: 32px;\n padding: 0;\n border: 1px solid #ccc;\n overflow: hidden;\n background: #fff;\n}\n\n.SelectContent .SelectOptions {\n max-height: 100px;\n margin: 0;\n overflow-y: auto;\n padding: 0;\n}\n.SelectContent .SelectOptions .SelectedValue {\n background-color: #009993;\n color: #fff;\n}\n\n.SelectOptions::-webkit-scrollbar {\n width: 7px;\n}\n\n.SelectOptions::-webkit-scrollbar-track {\n background: #f1f1f1;\n border-radius: 25px;\n}\n\n.SelectOptions::-webkit-scrollbar-thumb {\n background: #ccc;\n border-radius: 25px;\n}\n\n.SelectOptions li {\n height: 20px;\n padding: 0 13px;\n font-size: 14px;\n}\n\n.SelectOptions li:hover {\n background: #f2f2f2;\n}","import { Component, h, Prop, State, Event, Listen, Watch } from '@stencil/core';\nimport { translate } from '../../utils/locale.utils';\nimport '@everymatrix/lottery-grid';\nexport class LotteryTicket {\n constructor() {\n /**\n * Number of grids of a ticket\n */\n this.numberOfGrids = 1;\n /**\n * Option to have the ticket registered for multiple draws\n */\n this.multipleDraws = true;\n /**\n * Shows the reset button\n */\n this.resetButton = false;\n /**\n * Shows the auto-pick button\n */\n this.autoPick = false;\n /**\n * Language\n */\n this.language = 'en';\n /**\n * Client custom styling via string\n */\n this.clientStyling = '';\n /**\n * Client custom styling via url content\n */\n this.clientStylingUrlContent = '';\n this.multiplier = false;\n this.numberOfDraws = 1;\n this.isLoading = true;\n this.hasErrors = false;\n this.ticketDone = false;\n this.isCustomSelect = false;\n this.amountInfo = {};\n this.limitStylingAppends = false;\n this.setClientStyling = () => {\n let sheet = document.createElement('style');\n sheet.innerHTML = this.clientStyling;\n this.stylingContainer.prepend(sheet);\n };\n this.setClientStylingURL = () => {\n let cssFile = document.createElement('style');\n setTimeout(() => {\n cssFile.innerHTML = this.clientStylingUrlContent;\n this.stylingContainer.prepend(cssFile);\n }, 1);\n };\n }\n /**\n * @TODO find a better way to implement click outside the custom select, so that we don't have to use the 'data-cluster' attribute on each element\n */\n checkForClickOutside(ev) {\n if (ev.composedPath()[0].getAttribute('data-cluster') !== 'SelectComponent') {\n this.isCustomSelect = false;\n }\n }\n connectedCallback() {\n let url = new URL(`${this.endpoint}/games/${this.gameId}`);\n fetch(url.href)\n .then((response) => {\n if (response.ok) {\n return response.json();\n }\n else {\n // Throw error\n this.hasErrors = true;\n }\n })\n .then((data) => {\n this.isLoading = false;\n this.gameData = data;\n this.grids = [...Array(this.gameData.type.boards.length).keys()];\n this.amountInfo = this.gameData.type.stakes[0]; // initial value for select\n })\n .catch((err) => {\n this.isLoading = false;\n this.hasErrors = true;\n console.error('Error!', err);\n });\n }\n componentDidRender() {\n // start custom styling area\n if (!this.limitStylingAppends && this.stylingContainer) {\n if (this.clientStyling)\n this.setClientStyling();\n if (this.clientStylingUrlContent)\n this.setClientStylingURL();\n this.limitStylingAppends = true;\n }\n // end custom styling area\n }\n multiplierChangeHandler(e) {\n this.multiplier = e.target ? e.target.checked : false;\n this.multiplierChange.emit(this.multiplier);\n }\n drawsChangeHandler(event) {\n this.ticket = Object.assign(Object.assign({}, this.ticket), { draws: event });\n this.ticketCompleted.emit(this.ticket);\n }\n gridFilledHandler(event) {\n this.ticket = Object.assign(Object.assign({}, event.detail), { draws: this.numberOfDraws });\n this.ticketDone = true;\n this.ticketCompleted.emit(this.ticket);\n }\n toggleAutoSelection() {\n this.ticketDone = true;\n this.autoSelection.emit(this.ticketId);\n }\n toggleResetSelection() {\n this.ticketDone = false;\n this.resetSelection.emit(this.ticketId);\n }\n changeStake(ticketid, amount) {\n this.stakeChange.emit({\n ticketId: ticketid,\n stake: amount\n });\n }\n toggleClass() {\n this.isCustomSelect = !this.isCustomSelect;\n }\n setDropdownItem(item) {\n this.amountInfo = {\n value: item.value,\n currency: item.currency\n };\n this.isCustomSelect = false;\n this.changeStake(this.ticketId, item.amount);\n }\n render() {\n if (this.isLoading) {\n return (h(\"div\", null,\n h(\"p\", null, translate('loading', this.language))));\n }\n else {\n if (this.hasErrors) {\n return (h(\"div\", null,\n h(\"p\", null, translate('error', this.language))));\n }\n else {\n const { type } = this.gameData;\n return (h(\"div\", { class: \"TicketContainer\", ref: el => this.stylingContainer = el },\n h(\"p\", { class: \"TicketTitle\" }, this.gameData.name),\n this.resetButton && this.ticketDone &&\n h(\"div\", { class: \"ButtonContainer\" },\n h(\"a\", { class: \"ResetButton\", onClick: () => this.toggleResetSelection() }, translate('resetButton', this.language))),\n this.autoPick && !this.ticketDone &&\n h(\"div\", { class: \"ButtonContainer\" },\n h(\"a\", { class: \"AutoButton\", onClick: () => this.toggleAutoSelection() }, translate('autoButton', this.language))),\n this.grids.map((_, index) => h(\"div\", { class: \"TicketGridBullets\" },\n h(\"p\", { class: \"TicketGridTitle\" },\n translate('grid', this.language),\n \" \",\n index + 1),\n h(\"lottery-grid\", { \"grid-index\": index, \"maximum-allowed\": type.boards[index].maximumAllowed, \"minimum-allowed\": type.boards[index].minimumAllowed, \"total-numbers\": type.boards[index].highNumber - type.boards[index].lowNumber + 1, selectable: true, \"reset-button\": true, \"auto-pick\": true, \"game-id\": this.gameId, \"ticket-id\": this.ticketId, language: this.language, \"client-styling\": this.clientStyling, \"client-styling-url-content\": this.clientStylingUrlContent }))),\n type.multiplier &&\n h(\"div\", null,\n h(\"label\", { class: \"Toggle\" },\n h(\"label\", { class: \"Label\" },\n translate('multiplier', this.language),\n \": \"),\n h(\"input\", { class: \"ToggleCheckbox\", type: \"checkbox\", onInput: (e) => this.multiplierChangeHandler(e) }),\n h(\"div\", { class: \"ToggleSwitch\" }))),\n this.multipleDraws &&\n h(\"div\", { class: \"TicketDraws\" },\n h(\"label\", { class: \"Label\" },\n translate('numberOfDraws', this.language),\n \": \"),\n h(\"div\", { class: \"NumberInput\" },\n h(\"button\", { onClick: () => this.numberOfDraws > 1 ? this.numberOfDraws-- : this.numberOfDraws = 1, class: \"Minus\" }, \"-\"),\n h(\"input\", { class: \"InputDefault\", min: \"1\", value: this.numberOfDraws, type: \"number\" }),\n h(\"button\", { onClick: () => this.numberOfDraws++, class: \"Plus\" }, \"+\"))),\n h(\"div\", null,\n h(\"label\", { class: \"Label\" },\n translate('wagerPerDraw', this.language),\n \": \"),\n h(\"div\", { class: \"WagerInput\" }, type.stakes.length > 1 ?\n (h(\"div\", { \"data-cluster\": \"SelectComponent\", class: this.isCustomSelect ? \"SelectWrapper SelectActive\" : \"SelectWrapper\" },\n h(\"div\", { \"data-cluster\": \"SelectComponent\", class: \"SelectButton\", onClick: () => this.toggleClass() },\n h(\"span\", { \"data-cluster\": \"SelectComponent\" },\n this.amountInfo.value,\n \" \",\n this.amountInfo.currency),\n h(\"span\", { \"data-cluster\": \"SelectComponent\", class: \"SelectExpand\" }, \"\\u25BC\")),\n h(\"div\", { \"data-cluster\": \"SelectComponent\", class: \"SelectContent\" },\n h(\"ul\", { \"data-cluster\": \"SelectComponent\", class: \"SelectOptions\" }, type.stakes.map((item) => h(\"li\", { \"data-cluster\": \"SelectComponent\", class: this.amountInfo.value == item.value ? 'SelectedValue' : '', value: item.value, onClick: () => this.setDropdownItem(item) },\n item.value,\n \" \",\n item.currency)))))) : (h(\"div\", null,\n h(\"input\", { min: \"1\", value: type.stakes[0].amount, type: \"number\", disabled: true }),\n h(\"p\", { class: \"WagerInputTitle\" }, type.stakes[0].currency)))))));\n }\n }\n }\n static get is() { return \"lottery-ticket\"; }\n static get encapsulation() { return \"shadow\"; }\n static get originalStyleUrls() { return {\n \"$\": [\"lottery-ticket.scss\"]\n }; }\n static get styleUrls() { return {\n \"$\": [\"lottery-ticket.css\"]\n }; }\n static get properties() { return {\n \"endpoint\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"NorWAy endpoint\"\n },\n \"attribute\": \"endpoint\",\n \"reflect\": true\n },\n \"gameId\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Game ID\"\n },\n \"attribute\": \"game-id\",\n \"reflect\": true\n },\n \"numberOfGrids\": {\n \"type\": \"number\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"number\",\n \"resolved\": \"number\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Number of grids of a ticket\"\n },\n \"attribute\": \"number-of-grids\",\n \"reflect\": true,\n \"defaultValue\": \"1\"\n },\n \"multipleDraws\": {\n \"type\": \"boolean\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"boolean\",\n \"resolved\": \"boolean\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Option to have the ticket registered for multiple draws\"\n },\n \"attribute\": \"multiple-draws\",\n \"reflect\": true,\n \"defaultValue\": \"true\"\n },\n \"ticketId\": {\n \"type\": \"number\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"number\",\n \"resolved\": \"number\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Ticket ID\"\n },\n \"attribute\": \"ticket-id\",\n \"reflect\": true\n },\n \"resetButton\": {\n \"type\": \"boolean\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"boolean\",\n \"resolved\": \"boolean\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Shows the reset button\"\n },\n \"attribute\": \"reset-button\",\n \"reflect\": true,\n \"defaultValue\": \"false\"\n },\n \"autoPick\": {\n \"type\": \"boolean\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"boolean\",\n \"resolved\": \"boolean\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Shows the auto-pick button\"\n },\n \"attribute\": \"auto-pick\",\n \"reflect\": true,\n \"defaultValue\": \"false\"\n },\n \"language\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Language\"\n },\n \"attribute\": \"language\",\n \"reflect\": true,\n \"defaultValue\": \"'en'\"\n },\n \"clientStyling\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Client custom styling via string\"\n },\n \"attribute\": \"client-styling\",\n \"reflect\": true,\n \"defaultValue\": \"''\"\n },\n \"clientStylingUrlContent\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Client custom styling via url content\"\n },\n \"attribute\": \"client-styling-url-content\",\n \"reflect\": true,\n \"defaultValue\": \"''\"\n }\n }; }\n static get states() { return {\n \"multiplier\": {},\n \"numberOfDraws\": {},\n \"isLoading\": {},\n \"hasErrors\": {},\n \"ticketDone\": {},\n \"isCustomSelect\": {},\n \"amountInfo\": {},\n \"limitStylingAppends\": {}\n }; }\n static get events() { return [{\n \"method\": \"ticketCompleted\",\n \"name\": \"ticketCompleted\",\n \"bubbles\": true,\n \"cancelable\": true,\n \"composed\": true,\n \"docs\": {\n \"tags\": [{\n \"name\": \"TODO\",\n \"text\": \"including ts type\"\n }],\n \"text\": \"\"\n },\n \"complexType\": {\n \"original\": \"any\",\n \"resolved\": \"any\",\n \"references\": {}\n }\n }, {\n \"method\": \"autoSelection\",\n \"name\": \"autoSelection\",\n \"bubbles\": true,\n \"cancelable\": true,\n \"composed\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"\"\n },\n \"complexType\": {\n \"original\": \"any\",\n \"resolved\": \"any\",\n \"references\": {}\n }\n }, {\n \"method\": \"resetSelection\",\n \"name\": \"resetSelection\",\n \"bubbles\": true,\n \"cancelable\": true,\n \"composed\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"\"\n },\n \"complexType\": {\n \"original\": \"any\",\n \"resolved\": \"any\",\n \"references\": {}\n }\n }, {\n \"method\": \"stakeChange\",\n \"name\": \"stakeChange\",\n \"bubbles\": true,\n \"cancelable\": true,\n \"composed\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"\"\n },\n \"complexType\": {\n \"original\": \"any\",\n \"resolved\": \"any\",\n \"references\": {}\n }\n }, {\n \"method\": \"multiplierChange\",\n \"name\": \"multiplierChange\",\n \"bubbles\": true,\n \"cancelable\": true,\n \"composed\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"\"\n },\n \"complexType\": {\n \"original\": \"any\",\n \"resolved\": \"any\",\n \"references\": {}\n }\n }]; }\n static get watchers() { return [{\n \"propName\": \"numberOfDraws\",\n \"methodName\": \"drawsChangeHandler\"\n }]; }\n static get listeners() { return [{\n \"name\": \"click\",\n \"method\": \"checkForClickOutside\",\n \"target\": \"window\",\n \"capture\": false,\n \"passive\": false\n }, {\n \"name\": \"gridFilled\",\n \"method\": \"gridFilledHandler\",\n \"target\": undefined,\n \"capture\": false,\n \"passive\": false\n }]; }\n}\n"]}
@@ -0,0 +1,2 @@
1
+ import{r as t,c as e,h as i}from"./p-e765c7d9.js";const s="en";const r=["ro","en","hr"];const o={en:{deleteTicket:"Delete ticket"},ro:{deleteTicket:"Sterge biletul"},fr:{deleteTicket:"Supprimer le billet"},ar:{deleteTicket:"حذف التذكرة"},hr:{deleteTicket:"Izbriši listić"}};const n=(t,e)=>{const i=e;return o[i!==undefined&&r.includes(i)?i:s][t]};const a='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");:host{display:block;font-family:"Roboto", sans-serif}.Header{border-radius:5px;background:#009993;display:flex;gap:30px;border:1px solid #009993;padding:8px 10px;user-select:none;margin-bottom:1px;cursor:pointer}.Header:hover{background:#00ABA4}.Header .Title,.Header .Subtitle,.Header .Description{margin:0;font-size:14px;color:#fff;text-transform:capitalize}.Header .Expand{margin-left:auto;color:#FFF;width:17px;height:17px;cursor:pointer;text-align:center;transform:rotate(90deg);font-size:20px;user-select:none}.HeaderTicketHistory{border-radius:4px;background:#F1F1F1;display:flex;gap:30px;border:1px solid #009993;padding:8px 10px;user-select:none;margin-bottom:5px;cursor:pointer}.HeaderTicketHistory:hover{background:#00ABA4}.HeaderTicketHistory .Title,.HeaderTicketHistory .Subtitle,.HeaderTicketHistory .Description{margin:0;font-size:14px;color:#000}.HeaderTicketHistory .Expand{margin-left:auto;color:#FFF;width:17px;height:17px;cursor:pointer;text-align:center;transform:rotate(90deg);font-size:20px;user-select:none}.Content{border-radius:0 0 4px 4px;background:#fff;border:1px solid #009993;padding:10px 15px;user-select:none;color:#000;margin-bottom:10px}.ActionButton{cursor:pointer;display:inline-block;border-radius:4px;margin:20px 0 10px;text-transform:uppercase;font-size:12px;text-align:center;padding:8px 20px;min-width:80px;background:#FF3D00;border:1px solid #FF3D00;color:#FFF}.ActionButton:hover{background:#FF6536;border:1px solid #FF3D00}';const c=class{constructor(i){t(this,i);this.accordionEvent=e(this,"helperAccordionAction",7);this.ticketHistoryFlag=false;this.headerTitle="";this.headerSubtitle="";this.description="";this.footer=false;this.deleteTab=false;this.postMessage=false;this.eventName="helperAccordionAction";this.collapsed=true;this.language="en";this.clientStyling="";this.clientStylingUrlContent="";this.limitStylingAppends=false;this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling;this.stylingContainer.prepend(t)};this.setClientStylingURL=()=>{let t=document.createElement("style");setTimeout((()=>{t.innerHTML=this.clientStylingUrlContent;this.stylingContainer.prepend(t)}),1)}}connectedCallback(){this.showContent=!this.collapsed}componentDidRender(){if(!this.limitStylingAppends&&this.stylingContainer){if(this.clientStyling)this.setClientStyling();if(this.clientStylingUrlContent)this.setClientStylingURL();this.limitStylingAppends=true}}toggleContent(){this.showContent=!this.showContent}deleteAction(){if(this.postMessage){window.postMessage({type:this.eventName},window.location.href)}this.accordionEvent.emit()}render(){return i("div",{class:"Wrapper",ref:t=>this.stylingContainer=t},i("div",{class:this.ticketHistoryFlag===true?"HeaderTicketHistory":"Header",onClick:()=>this.toggleContent()},i("p",{class:"Title"},this.headerTitle),i("p",{class:"Subtitle"},this.headerSubtitle),i("p",{class:"Subtitle Description"},this.description),i("span",{class:"Expand"},this.showContent?"<":">")),this.showContent&&i("div",null,i("div",{class:"Content"},i("slot",{name:"accordionContent"}),this.footer&&this.showContent&&i("div",null,this.deleteTab&&i("span",{class:"ActionButton",onClick:()=>this.deleteAction()},n("deleteTicket",this.language))))))}};c.style=a;export{c as helper_accordion};
2
+ //# sourceMappingURL=p-b19ff22c.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../helper-accordion/dist/collection/utils/locale.utils.js","../helper-accordion/dist/collection/components/helper-accordion/helper-accordion.css?tag=helper-accordion&encapsulation=shadow","../helper-accordion/dist/collection/components/helper-accordion/helper-accordion.js"],"names":["DEFAULT_LANGUAGE","SUPPORTED_LANGUAGES","TRANSLATIONS","en","deleteTicket","ro","fr","ar","hr","translate","key","customLang","lang","undefined","includes","helperAccordionCss","Accordion","[object Object]","hostRef","this","ticketHistoryFlag","headerTitle","headerSubtitle","description","footer","deleteTab","postMessage","eventName","collapsed","language","clientStyling","clientStylingUrlContent","limitStylingAppends","setClientStyling","sheet","document","createElement","innerHTML","stylingContainer","prepend","setClientStylingURL","cssFile","setTimeout","showContent","window","type","location","href","accordionEvent","emit","h","class","ref","el","onClick","toggleContent","name","deleteAction"],"mappings":"kDAAA,MAAMA,EAAmB,KACzB,MAAMC,EAAsB,CAAC,KAAM,KAAM,MACzC,MAAMC,EAAe,CACnBC,GAAI,CACFC,aAAc,iBAEhBC,GAAI,CACFD,aAAc,kBAEhBE,GAAI,CACFF,aAAc,uBAEhBG,GAAI,CACFH,aAAc,eAEhBI,GAAI,CACFJ,aAAc,mBAGX,MAAMK,EAAY,CAACC,EAAKC,KAC7B,MAAMC,EAAOD,EACb,OAAOT,EAAaU,IAASC,WAAaZ,EAAoBa,SAASF,GAAQA,EAAOZ,GAAkBU,ICrB1G,MAAMK,EAAqB,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C4B,EAAE,IAAK,CAAEC,MAAO,wBAA0BhC,KAAKI,aAC/C2B,EAAE,OAAQ,CAAEC,MAAO,UAAYhC,KAAKwB,YAAc,IAAM,MAC1DxB,KAAKwB,aACHO,EAAE,MAAO,KACPA,EAAE,MAAO,CAAEC,MAAO,WAChBD,EAAE,OAAQ,CAAEM,KAAM,qBAClBrC,KAAKK,QAAUL,KAAKwB,aAClBO,EAAE,MAAO,KAAM/B,KAAKM,WAClByB,EAAE,OAAQ,CAAEC,MAAO,eAAgBG,QAAS,IAAMnC,KAAKsC,gBAAkBhD,EAAU,eAAgBU,KAAKU","sourcesContent":["const DEFAULT_LANGUAGE = 'en';\nconst SUPPORTED_LANGUAGES = ['ro', 'en', 'hr'];\nconst TRANSLATIONS = {\n en: {\n deleteTicket: 'Delete ticket'\n },\n ro: {\n deleteTicket: 'Sterge biletul'\n },\n fr: {\n deleteTicket: 'Supprimer le billet'\n },\n ar: {\n deleteTicket: 'حذف التذكرة'\n },\n hr: {\n deleteTicket: 'Izbriši listić'\n }\n};\nexport const translate = (key, customLang) => {\n const lang = customLang;\n return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];\n};\n","@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");\n:host {\n display: block;\n font-family: \"Roboto\", sans-serif;\n}\n\n.Header {\n border-radius: 5px;\n background: #009993;\n display: flex;\n gap: 30px;\n border: 1px solid #009993;\n padding: 8px 10px;\n user-select: none;\n margin-bottom: 1px;\n cursor: pointer;\n}\n.Header:hover {\n background: #00ABA4;\n}\n.Header .Title,\n.Header .Subtitle,\n.Header .Description {\n margin: 0;\n font-size: 14px;\n color: #fff;\n text-transform: capitalize;\n}\n.Header .Expand {\n margin-left: auto;\n color: #FFF;\n width: 17px;\n height: 17px;\n cursor: pointer;\n text-align: center;\n transform: rotate(90deg);\n font-size: 20px;\n user-select: none;\n}\n\n.HeaderTicketHistory {\n border-radius: 4px;\n background: #F1F1F1;\n display: flex;\n gap: 30px;\n border: 1px solid #009993;\n padding: 8px 10px;\n user-select: none;\n margin-bottom: 5px;\n cursor: pointer;\n}\n.HeaderTicketHistory:hover {\n background: #00ABA4;\n}\n.HeaderTicketHistory .Title,\n.HeaderTicketHistory .Subtitle,\n.HeaderTicketHistory .Description {\n margin: 0;\n font-size: 14px;\n color: #000;\n}\n.HeaderTicketHistory .Expand {\n margin-left: auto;\n color: #FFF;\n width: 17px;\n height: 17px;\n cursor: pointer;\n text-align: center;\n transform: rotate(90deg);\n font-size: 20px;\n user-select: none;\n}\n\n.Content {\n border-radius: 0 0 4px 4px;\n background: #fff;\n border: 1px solid #009993;\n padding: 10px 15px;\n user-select: none;\n color: #000;\n margin-bottom: 10px;\n}\n\n.ActionButton {\n cursor: pointer;\n display: inline-block;\n border-radius: 4px;\n margin: 20px 0 10px;\n text-transform: uppercase;\n font-size: 12px;\n text-align: center;\n padding: 8px 20px;\n min-width: 80px;\n background: #FF3D00;\n border: 1px solid #FF3D00;\n color: #FFF;\n}\n.ActionButton:hover {\n background: #FF6536;\n border: 1px solid #FF3D00;\n}","import { Component, Prop, h, State, Event } from '@stencil/core';\nimport { translate } from '../../utils/locale.utils';\nexport class Accordion {\n constructor() {\n /**\n * Flag for ticket history\n */\n this.ticketHistoryFlag = false;\n /**\n * Title (top header)\n */\n this.headerTitle = '';\n /**\n * SubTitle (top header)\n */\n this.headerSubtitle = '';\n /**\n * Description\n */\n this.description = '';\n /**\n * Enables footer content\n */\n this.footer = false;\n /**\n * Enables footer button for tab deletion\n */\n this.deleteTab = false;\n /**\n * Activates postMessages as events for actions from the widget\n */\n this.postMessage = false;\n /**\n * Name of the event emitter by the action button\n */\n this.eventName = 'helperAccordionAction';\n /**\n * Collapsed\n */\n this.collapsed = true;\n /**\n * Language\n */\n this.language = 'en';\n /**\n * Client custom styling via string\n */\n this.clientStyling = '';\n /**\n * Client custom styling via url content\n */\n this.clientStylingUrlContent = '';\n this.limitStylingAppends = false;\n this.setClientStyling = () => {\n let sheet = document.createElement('style');\n sheet.innerHTML = this.clientStyling;\n this.stylingContainer.prepend(sheet);\n };\n this.setClientStylingURL = () => {\n let cssFile = document.createElement('style');\n setTimeout(() => {\n cssFile.innerHTML = this.clientStylingUrlContent;\n this.stylingContainer.prepend(cssFile);\n }, 1);\n };\n }\n // @TODO fix the `any` type :)\n connectedCallback() {\n this.showContent = !this.collapsed;\n }\n componentDidRender() {\n // start custom styling area\n if (!this.limitStylingAppends && this.stylingContainer) {\n if (this.clientStyling)\n this.setClientStyling();\n if (this.clientStylingUrlContent)\n this.setClientStylingURL();\n this.limitStylingAppends = true;\n }\n // end custom styling area\n }\n toggleContent() {\n this.showContent = !this.showContent;\n }\n deleteAction() {\n if (this.postMessage) {\n // @TODO maybe change the name type, this one sucks\n window.postMessage({ type: this.eventName }, window.location.href);\n }\n this.accordionEvent.emit();\n }\n render() {\n return (h(\"div\", { class: \"Wrapper\", ref: el => this.stylingContainer = el },\n h(\"div\", { class: this.ticketHistoryFlag === true ? 'HeaderTicketHistory' : 'Header', onClick: () => this.toggleContent() },\n h(\"p\", { class: \"Title\" }, this.headerTitle),\n h(\"p\", { class: \"Subtitle\" }, this.headerSubtitle),\n h(\"p\", { class: \"Subtitle Description\" }, this.description),\n h(\"span\", { class: \"Expand\" }, this.showContent ? '<' : '>')),\n this.showContent &&\n h(\"div\", null,\n h(\"div\", { class: \"Content\" },\n h(\"slot\", { name: 'accordionContent' }),\n this.footer && this.showContent &&\n h(\"div\", null, this.deleteTab &&\n h(\"span\", { class: \"ActionButton\", onClick: () => this.deleteAction() }, translate('deleteTicket', this.language)))))));\n }\n static get is() { return \"helper-accordion\"; }\n static get encapsulation() { return \"shadow\"; }\n static get originalStyleUrls() { return {\n \"$\": [\"helper-accordion.scss\"]\n }; }\n static get styleUrls() { return {\n \"$\": [\"helper-accordion.css\"]\n }; }\n static get properties() { return {\n \"ticketHistoryFlag\": {\n \"type\": \"boolean\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"boolean\",\n \"resolved\": \"boolean\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Flag for ticket history\"\n },\n \"attribute\": \"ticket-history-flag\",\n \"reflect\": true,\n \"defaultValue\": \"false\"\n },\n \"headerTitle\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Title (top header)\"\n },\n \"attribute\": \"header-title\",\n \"reflect\": true,\n \"defaultValue\": \"''\"\n },\n \"headerSubtitle\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"SubTitle (top header)\"\n },\n \"attribute\": \"header-subtitle\",\n \"reflect\": true,\n \"defaultValue\": \"''\"\n },\n \"description\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Description\"\n },\n \"attribute\": \"description\",\n \"reflect\": true,\n \"defaultValue\": \"''\"\n },\n \"footer\": {\n \"type\": \"boolean\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"boolean\",\n \"resolved\": \"boolean\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Enables footer content\"\n },\n \"attribute\": \"footer\",\n \"reflect\": true,\n \"defaultValue\": \"false\"\n },\n \"deleteTab\": {\n \"type\": \"boolean\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"boolean\",\n \"resolved\": \"boolean\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Enables footer button for tab deletion\"\n },\n \"attribute\": \"delete-tab\",\n \"reflect\": true,\n \"defaultValue\": \"false\"\n },\n \"postMessage\": {\n \"type\": \"boolean\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"boolean\",\n \"resolved\": \"boolean\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Activates postMessages as events for actions from the widget\"\n },\n \"attribute\": \"post-message\",\n \"reflect\": true,\n \"defaultValue\": \"false\"\n },\n \"eventName\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Name of the event emitter by the action button\"\n },\n \"attribute\": \"event-name\",\n \"reflect\": true,\n \"defaultValue\": \"'helperAccordionAction'\"\n },\n \"collapsed\": {\n \"type\": \"boolean\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"boolean\",\n \"resolved\": \"boolean\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Collapsed\"\n },\n \"attribute\": \"collapsed\",\n \"reflect\": true,\n \"defaultValue\": \"true\"\n },\n \"language\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Language\"\n },\n \"attribute\": \"language\",\n \"reflect\": true,\n \"defaultValue\": \"'en'\"\n },\n \"clientStyling\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Client custom styling via string\"\n },\n \"attribute\": \"client-styling\",\n \"reflect\": true,\n \"defaultValue\": \"''\"\n },\n \"clientStylingUrlContent\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Client custom styling via url content\"\n },\n \"attribute\": \"client-styling-url-content\",\n \"reflect\": true,\n \"defaultValue\": \"''\"\n }\n }; }\n static get states() { return {\n \"showContent\": {},\n \"limitStylingAppends\": {}\n }; }\n static get events() { return [{\n \"method\": \"accordionEvent\",\n \"name\": \"helperAccordionAction\",\n \"bubbles\": true,\n \"cancelable\": true,\n \"composed\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Action event\"\n },\n \"complexType\": {\n \"original\": \"any\",\n \"resolved\": \"any\",\n \"references\": {}\n }\n }]; }\n}\n"]}
@@ -0,0 +1,2 @@
1
+ import{r as t,c as i,h as s}from"./p-e765c7d9.js";const e=t=>!!(t.toLowerCase().match(/android/i)||t.toLowerCase().match(/blackberry|bb/i)||t.toLowerCase().match(/iphone|ipad|ipod/i)||t.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i));const a="en";const o=["ro","en","hu","hr"];const n={en:{firstPage:"First",previousPage:"Previous",nextPage:"Next",lastPage:"Last"},ro:{firstPage:"Prima",previousPage:"Anterior",nextPage:"Urmatoarea",lastPage:"Ultima"},fr:{firstPage:"First",previousPage:"Previous",nextPage:"Next",lastPage:"Last"},ar:{firstPage:"First",previousPage:"Previous",nextPage:"Next",lastPage:"Last"},hu:{firstPage:"First",previousPage:"Previous",nextPage:"Következő",lastPage:"Last"},hr:{firstPage:"Prva",previousPage:"Prethodna",nextPage:"Slijedeća",lastPage:"Zadnja"}};const h=(t,i)=>{const s=i;return n[s!==undefined&&o.includes(s)?s:a][t]};const r='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");:host{display:block;font-family:"Roboto", sans-serif}#PaginationContainer{width:100%;margin:20px 0;display:inline-flex;justify-content:space-between;align-items:center}.LeftItems button:not(:first-child),.RightItems button:not(:last-child){margin:0 10px}.LeftItems button,.RightItems button{padding:0;background-color:#009993;border-color:#009993}.PaginationArea{display:inline-flex;gap:10px;list-style:none}.PaginationArea li{margin:0;padding:0}.PaginationArea li button{width:24px;height:24px;display:flex;border:0;padding:0;justify-content:center;align-items:center;background-color:transparent;color:#000;cursor:pointer;pointer-events:all}.PaginationItem.ActiveItem button{background:#009993;border-color:#009993;color:#fff}.PaginationItem.ActiveItem button:disabled{pointer-events:none;cursor:not-allowed}.PaginationItem button:hover,.PaginationItem button:active{background:#009993;border-color:#009993;color:#fff;opacity:0.8}button{width:100px;height:32px;border:1px solid #524e52;border-radius:5px;background:#524e52;color:#fff;font-size:14px;font:inherit;cursor:pointer;transition:all 0.1s linear;text-transform:uppercase;text-align:center;letter-spacing:0}button:hover,button:active{background:#004D4A;border-color:#004D4A}button:disabled{background-color:#ccc;border-color:#ccc;color:#fff;cursor:not-allowed}@media screen and (max-width: 720px){button{width:90px;font-size:14px}}@media screen and (max-width: 480px){button{width:70px;font-size:14px}.paginationArea{padding:5px}}@media screen and (max-width: 320px){button{width:58px;font-size:12px}.paginationArea{padding:5px;gap:5px}}@media (hover: none){.paginationItem button:hover{background:inherit;border-color:inherit;color:inherit;opacity:1}.paginationItem.activeItem button:hover{background:#009993;border-color:#009993;color:#fff}}';const l=class{constructor(s){t(this,s);this.hpPageChange=i(this,"hpPageChange",7);this.nextPage="";this.prevPage="";this.offset=0;this.limit=1;this.total=1;this.language="en";this.clientStyling="";this.clientStylingUrlContent="";this.lastPage=false;this.previousPage=false;this.pagesArray=[];this.endInt=0;this.userAgent=window.navigator.userAgent;this.currentPage=1;this.limitStylingAppends=false;this.navigateTo=t=>{switch(t){case"firstPage":this.offsetInt=0;break;case"lastPage":this.offsetInt=this.endInt*this.limitInt;break;case"previousPage":this.offsetInt-=this.limitInt;break;case"nextPage":this.offsetInt+=this.limitInt;break;case"fivePagesBack":this.offsetInt-=this.limitInt*5;this.offsetInt=this.offsetInt<=0?0:this.offsetInt;break;case"fivePagesForward":this.offsetInt+=this.limitInt*5;this.offsetInt=this.offsetInt/this.limitInt>=this.endInt?this.endInt*this.limitInt:this.offsetInt;break}this.previousPage=!this.offsetInt?false:true;this.hpPageChange.emit({offset:this.offsetInt,limit:this.limitInt,total:this.totalInt})};this.paginationNavigation=(t,i)=>{this.previousPage=true;if(!isNaN(t)){if(t===1){this.offsetInt=t-1;this.previousPage=false}else{this.offsetInt=(t-1)*this.limitInt}}else{if(i===0&&this.currentPage<=4){this.navigateTo("firstPage")}else if(i===0&&this.currentPage>4){this.navigateTo("fivePagesBack")}else if(i===4&&this.endInt-this.currentPage>=2){this.navigateTo("fivePagesForward")}}this.hpPageChange.emit({offset:this.offsetInt,limit:this.limitInt,total:this.totalInt})};this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling;this.stylingContainer.prepend(t)};this.setClientStylingURL=()=>{let t=document.createElement("style");setTimeout((()=>{t.innerHTML=this.clientStylingUrlContent;this.stylingContainer.prepend(t)}),1)}}componentWillRender(){this.offsetInt=this.offset;this.limitInt=this.limit;this.currentPage=this.offsetInt/this.limitInt+1;this.limitInt=this.limit;this.totalInt=this.total;this.endInt=Math.ceil(this.totalInt/this.limitInt)-1;this.lastPage=this.offsetInt>=this.endInt*this.limitInt?false:true;if(this.currentPage==1||this.currentPage==2){this.pagesArray=Array.from({length:4},((t,i)=>i+1));this.pagesArray.push("...")}else if(this.currentPage>=3&&this.endInt-this.currentPage>=2){this.pagesArray=Array.from({length:3},((t,i)=>this.currentPage+i-1));this.pagesArray.push("...");this.pagesArray.unshift("...")}else if(this.endInt-this.currentPage<3){this.pagesArray=Array.from({length:4},((t,i)=>this.endInt-2+i));this.pagesArray.unshift("...")}}componentDidRender(){if(!this.limitStylingAppends&&this.stylingContainer){if(this.clientStyling)this.setClientStyling();if(this.clientStylingUrlContent)this.setClientStylingURL();this.limitStylingAppends=true}}render(){let t=s("ul",{class:"PaginationArea"},this.pagesArray.map(((t,i)=>s("li",{class:"PaginationItem"+(t===this.currentPage?" ActiveItem":" ")+" "+(e(this.userAgent)?"MobileButtons":"")},s("button",{disabled:t===this.currentPage?true:false,onClick:this.paginationNavigation.bind(this,t,i)},s("span",null,t))))));let i=s("button",{disabled:this.prevPage?false:true,onClick:this.navigateTo.bind(this,"firstPage")},s("span",{class:"NavigationButton"},h("firstPage",this.language)),s("span",{class:"NavigationIcon"}));let a=s("div",{class:"LeftItems"},this.secondaryArrowsActive&&i,s("button",{disabled:this.prevPage?false:true,onClick:this.navigateTo.bind(this,"previousPage")},s("span",{class:"NavigationButton"},h("previousPage",this.language)),s("span",{class:"NavigationIcon"})));if(e(this.userAgent)){a=s("div",{class:"LeftItems"},s("button",{disabled:this.prevPage?false:true,onClick:this.navigateTo.bind(this,"previousPage")},s("span",{class:"NavigationButton"},h("previousPage",this.language)),s("span",{class:"NavigationIcon"})))}let o=s("button",{disabled:this.nextPage?false:true,onClick:this.navigateTo.bind(this,"lastPage")},s("span",{class:"NavigationButton"},h("lastPage",this.language)),s("span",{class:"NavigationIcon"}));let n=s("div",{class:"RightItems"},s("button",{disabled:this.nextPage?false:true,onClick:this.navigateTo.bind(this,"nextPage")},s("span",{class:"NavigationButton"},h("nextPage",this.language)),s("span",{class:"NavigationIcon"})),this.secondaryArrowsActive&&o);if(e(this.userAgent)){n=s("div",{class:"RightItems"},s("button",{disabled:this.nextPage?false:true,onClick:this.navigateTo.bind(this,"nextPage")},s("span",{class:"NavigationButton"},h("nextPage",this.language)),s("span",{class:"NavigationIcon"})))}return s("div",{id:"PaginationContainer",ref:t=>this.stylingContainer=t},this.arrowsActive&&a,this.numberedNavActive&&t,this.arrowsActive&&n)}};l.style=r;export{l as helper_pagination};
2
+ //# sourceMappingURL=p-cba19473.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../helper-pagination/dist/collection/utils/utils.js","../helper-pagination/dist/collection/utils/locale.utils.js","../helper-pagination/dist/collection/components/helper-pagination/helper-pagination.css?tag=helper-pagination&encapsulation=shadow","../helper-pagination/dist/collection/components/helper-pagination/helper-pagination.js"],"names":["isMobile","userAgent","toLowerCase","match","DEFAULT_LANGUAGE","SUPPORTED_LANGUAGES","TRANSLATIONS","en","firstPage","previousPage","nextPage","lastPage","ro","fr","ar","hu","hr","translate","key","customLang","lang","undefined","includes","helperPaginationCss","HelperPagination","[object Object]","hostRef","this","prevPage","offset","limit","total","language","clientStyling","clientStylingUrlContent","pagesArray","endInt","window","navigator","currentPage","limitStylingAppends","navigateTo","navigationPage","offsetInt","limitInt","hpPageChange","emit","totalInt","paginationNavigation","pageNumber","index","isNaN","setClientStyling","sheet","document","createElement","innerHTML","stylingContainer","prepend","setClientStylingURL","cssFile","setTimeout","Math","ceil","Array","from","length","_","i","push","unshift","navigationArea","h","class","map","item","disabled","onClick","bind","buttonSecondaryLeftSide","buttonsLeftSide","secondaryArrowsActive","buttonSecondaryRightSide","buttonsRightSide","id","ref","el","arrowsActive","numberedNavActive"],"mappings":"kDASO,MAAMA,EAAYC,MACbA,EAAUC,cAAcC,MAAM,aACtCF,EAAUC,cAAcC,MAAM,mBAC9BF,EAAUC,cAAcC,MAAM,sBAC9BF,EAAUC,cAAcC,MAAM,qDCblC,MAAMC,EAAmB,KACzB,MAAMC,EAAsB,CAAC,KAAM,KAAM,KAAM,MAC/C,MAAMC,EAAe,CACnBC,GAAI,CACFC,UAAW,QACXC,aAAc,WACdC,SAAU,OACVC,SAAU,QAEZC,GAAI,CACFJ,UAAW,QACXC,aAAc,WACdC,SAAU,aACVC,SAAU,UAEZE,GAAI,CACFL,UAAW,QACXC,aAAc,WACdC,SAAU,OACVC,SAAU,QAEZG,GAAI,CACFN,UAAW,QACXC,aAAc,WACdC,SAAU,OACVC,SAAU,QAEZI,GAAI,CACFP,UAAW,QACXC,aAAc,WACdC,SAAU,YACVC,SAAU,QAEZK,GAAI,CACFR,UAAW,OACXC,aAA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mE,QAASlD,KAAKc,WAAWqC,KAAKnD,KAAM,aACxF6C,EAAE,OAAQ,CAAEC,MAAO,oBAAsBxD,EAAU,WAAYU,KAAKK,WACpEwC,EAAE,OAAQ,CAAEC,MAAO,qBAE3B,OAAQD,EAAE,MAAO,CAAEY,GAAI,sBAAuBC,IAAKC,GAAM3D,KAAK8B,iBAAmB6B,GAC/E3D,KAAK4D,cAAgBP,EACrBrD,KAAK6D,mBAAqBjB,EAC1B5C,KAAK4D,cAAgBJ","sourcesContent":["export function format(first, middle, last) {\n return ((first || '') + (middle ? ` ${middle}` : '') + (last ? ` ${last}` : ''));\n}\n/**\n * @name isMobile\n * @description A method that returns if the browser used to access the app is from a mobile device or not\n * @param {String} userAgent window.navigator.userAgent\n * @returns {Boolean} true or false\n */\nexport const isMobile = (userAgent) => {\n return !!(userAgent.toLowerCase().match(/android/i) ||\n userAgent.toLowerCase().match(/blackberry|bb/i) ||\n userAgent.toLowerCase().match(/iphone|ipad|ipod/i) ||\n userAgent.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i));\n};\n","const DEFAULT_LANGUAGE = 'en';\nconst SUPPORTED_LANGUAGES = ['ro', 'en', 'hu', 'hr'];\nconst TRANSLATIONS = {\n en: {\n firstPage: 'First',\n previousPage: 'Previous',\n nextPage: 'Next',\n lastPage: 'Last'\n },\n ro: {\n firstPage: 'Prima',\n previousPage: 'Anterior',\n nextPage: 'Urmatoarea',\n lastPage: 'Ultima'\n },\n fr: {\n firstPage: 'First',\n previousPage: 'Previous',\n nextPage: 'Next',\n lastPage: 'Last'\n },\n ar: {\n firstPage: 'First',\n previousPage: 'Previous',\n nextPage: 'Next',\n lastPage: 'Last'\n },\n hu: {\n firstPage: 'First',\n previousPage: 'Previous',\n nextPage: 'Következő',\n lastPage: 'Last'\n },\n hr: {\n firstPage: 'Prva',\n previousPage: 'Prethodna',\n nextPage: 'Slijedeća',\n lastPage: 'Zadnja'\n }\n};\nexport const translate = (key, customLang) => {\n const lang = customLang;\n return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];\n};\n","@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");\n:host {\n display: block;\n font-family: \"Roboto\", sans-serif;\n}\n\n#PaginationContainer {\n width: 100%;\n margin: 20px 0;\n display: inline-flex;\n justify-content: space-between;\n align-items: center;\n}\n\n.LeftItems button:not(:first-child), .RightItems button:not(:last-child) {\n margin: 0 10px;\n}\n\n.LeftItems button, .RightItems button {\n padding: 0;\n background-color: #009993;\n border-color: #009993;\n}\n\n.PaginationArea {\n display: inline-flex;\n gap: 10px;\n list-style: none;\n}\n\n.PaginationArea li {\n margin: 0;\n padding: 0;\n}\n\n.PaginationArea li button {\n width: 24px;\n height: 24px;\n display: flex;\n border: 0;\n padding: 0;\n justify-content: center;\n align-items: center;\n background-color: transparent;\n color: #000;\n cursor: pointer;\n pointer-events: all;\n}\n\n.PaginationItem.ActiveItem button {\n background: #009993;\n border-color: #009993;\n color: #fff;\n}\n\n.PaginationItem.ActiveItem button:disabled {\n pointer-events: none;\n cursor: not-allowed;\n}\n\n.PaginationItem button:hover,\n.PaginationItem button:active {\n background: #009993;\n border-color: #009993;\n color: #fff;\n opacity: 0.8;\n}\n\nbutton {\n width: 100px;\n height: 32px;\n border: 1px solid #524e52;\n border-radius: 5px;\n background: #524e52;\n color: #fff;\n font-size: 14px;\n font: inherit;\n cursor: pointer;\n transition: all 0.1s linear;\n text-transform: uppercase;\n text-align: center;\n letter-spacing: 0;\n}\n\nbutton:hover,\nbutton:active {\n background: #004D4A;\n border-color: #004D4A;\n}\n\nbutton:disabled {\n background-color: #ccc;\n border-color: #ccc;\n color: #fff;\n cursor: not-allowed;\n}\n\n@media screen and (max-width: 720px) {\n button {\n width: 90px;\n font-size: 14px;\n }\n}\n@media screen and (max-width: 480px) {\n button {\n width: 70px;\n font-size: 14px;\n }\n\n .paginationArea {\n padding: 5px;\n }\n}\n@media screen and (max-width: 320px) {\n button {\n width: 58px;\n font-size: 12px;\n }\n\n .paginationArea {\n padding: 5px;\n gap: 5px;\n }\n}\n/* fix for issue on hover/visited for mobile devices */\n@media (hover: none) {\n .paginationItem button:hover {\n background: inherit;\n border-color: inherit;\n color: inherit;\n opacity: 1;\n }\n\n .paginationItem.activeItem button:hover {\n background: #009993;\n border-color: #009993;\n color: #fff;\n }\n}","import { Component, h, Event, Prop, State } from '@stencil/core';\nimport { isMobile } from \"../../utils/utils\";\nimport { translate } from '../../utils/locale.utils';\nexport class HelperPagination {\n constructor() {\n /**\n * Next page string value - determines if the next page is disabled or active\n */\n this.nextPage = '';\n /**\n * Previous page string value - determines if the previous page is disabled or active\n */\n this.prevPage = '';\n /**\n * The received offset\n */\n this.offset = 0;\n /**\n * The received limit for the number of pages\n */\n this.limit = 1;\n /**\n * The received total number of pages\n */\n this.total = 1;\n /**\n * Language\n */\n this.language = 'en';\n /**\n * Client custom styling via string\n */\n this.clientStyling = '';\n /**\n * Client custom styling via url content\n */\n this.clientStylingUrlContent = '';\n /**\n * Component working variable for last page\n */\n this.lastPage = false;\n /**\n * Component working variable for prvious page\n */\n this.previousPage = false;\n /**\n * In component working variable for the array of pages\n */\n this.pagesArray = [];\n /**\n * In component working variable for last page\n */\n this.endInt = 0;\n this.userAgent = window.navigator.userAgent;\n this.currentPage = 1;\n this.limitStylingAppends = false;\n /**\n * Navigation logic\n */\n this.navigateTo = (navigationPage) => {\n switch (navigationPage) {\n case 'firstPage':\n this.offsetInt = 0;\n break;\n case 'lastPage':\n this.offsetInt = this.endInt * this.limitInt;\n break;\n case 'previousPage':\n this.offsetInt -= this.limitInt;\n break;\n case 'nextPage':\n this.offsetInt += this.limitInt;\n break;\n case 'fivePagesBack':\n this.offsetInt -= this.limitInt * 5;\n this.offsetInt = this.offsetInt <= 0 ? 0 : this.offsetInt;\n break;\n case 'fivePagesForward':\n this.offsetInt += this.limitInt * 5;\n this.offsetInt = this.offsetInt / this.limitInt >= this.endInt ? this.endInt * this.limitInt : this.offsetInt;\n break;\n }\n this.previousPage = !this.offsetInt ? false : true;\n this.hpPageChange.emit({ offset: this.offsetInt, limit: this.limitInt, total: this.totalInt });\n };\n /**\n * Handle navigation from here\n */\n this.paginationNavigation = (pageNumber, index) => {\n this.previousPage = true;\n if (!isNaN(pageNumber)) {\n if (pageNumber === 1) {\n this.offsetInt = pageNumber - 1;\n this.previousPage = false;\n }\n else {\n this.offsetInt = (pageNumber - 1) * this.limitInt;\n }\n }\n else {\n if (index === 0 && this.currentPage <= 4) {\n this.navigateTo('firstPage');\n }\n else if (index === 0 && this.currentPage > 4) {\n this.navigateTo('fivePagesBack');\n }\n else if (index === 4 && this.endInt - this.currentPage >= 2) {\n this.navigateTo('fivePagesForward');\n }\n }\n this.hpPageChange.emit({ offset: this.offsetInt, limit: this.limitInt, total: this.totalInt });\n };\n this.setClientStyling = () => {\n let sheet = document.createElement('style');\n sheet.innerHTML = this.clientStyling;\n this.stylingContainer.prepend(sheet);\n };\n this.setClientStylingURL = () => {\n let cssFile = document.createElement('style');\n setTimeout(() => {\n cssFile.innerHTML = this.clientStylingUrlContent;\n this.stylingContainer.prepend(cssFile);\n }, 1);\n };\n }\n componentWillRender() {\n this.offsetInt = this.offset;\n this.limitInt = this.limit;\n this.currentPage = (this.offsetInt / this.limitInt) + 1;\n this.limitInt = this.limit;\n this.totalInt = this.total;\n this.endInt = (Math.ceil(this.totalInt / this.limitInt) - 1);\n this.lastPage = (this.offsetInt >= this.endInt * this.limitInt) ? false : true;\n /**\n * Construct numbered navigation area based on current page position\n */\n if (this.currentPage == 1 || this.currentPage == 2) {\n this.pagesArray = Array.from({ length: 4 }, (_, i) => i + 1);\n this.pagesArray.push('...');\n }\n else if (this.currentPage >= 3 && ((this.endInt - this.currentPage) >= 2)) {\n this.pagesArray = Array.from({ length: 3 }, (_, i) => this.currentPage + i - 1);\n this.pagesArray.push('...');\n this.pagesArray.unshift('...');\n }\n else if ((this.endInt - this.currentPage) < 3) {\n this.pagesArray = Array.from({ length: 4 }, (_, i) => this.endInt - 2 + i);\n this.pagesArray.unshift('...');\n }\n }\n componentDidRender() {\n // start custom styling area\n if (!this.limitStylingAppends && this.stylingContainer) {\n if (this.clientStyling)\n this.setClientStyling();\n if (this.clientStylingUrlContent)\n this.setClientStylingURL();\n this.limitStylingAppends = true;\n }\n // end custom styling area\n }\n render() {\n /**\n * Center navigation area\n */\n let navigationArea = h(\"ul\", { class: \"PaginationArea\" }, this.pagesArray.map((item, index) => {\n return (h(\"li\", { class: 'PaginationItem' + (item === this.currentPage ? ' ActiveItem' : ' ') + ' ' + (isMobile(this.userAgent) ? 'MobileButtons' : '') },\n h(\"button\", { disabled: item === this.currentPage ? true : false, onClick: this.paginationNavigation.bind(this, item, index) },\n h(\"span\", null, item))));\n }));\n /**\n * Left navigation area\n */\n let buttonSecondaryLeftSide = h(\"button\", { disabled: this.prevPage ? false : true, onClick: this.navigateTo.bind(this, 'firstPage') },\n h(\"span\", { class: \"NavigationButton\" }, translate('firstPage', this.language)),\n h(\"span\", { class: \"NavigationIcon\" }));\n let buttonsLeftSide = h(\"div\", { class: \"LeftItems\" },\n this.secondaryArrowsActive && buttonSecondaryLeftSide,\n h(\"button\", { disabled: this.prevPage ? false : true, onClick: this.navigateTo.bind(this, 'previousPage') },\n h(\"span\", { class: \"NavigationButton\" }, translate('previousPage', this.language)),\n h(\"span\", { class: \"NavigationIcon\" })));\n if (isMobile(this.userAgent)) {\n buttonsLeftSide =\n h(\"div\", { class: \"LeftItems\" },\n h(\"button\", { disabled: this.prevPage ? false : true, onClick: this.navigateTo.bind(this, 'previousPage') },\n h(\"span\", { class: \"NavigationButton\" }, translate('previousPage', this.language)),\n h(\"span\", { class: \"NavigationIcon\" })));\n }\n /**\n * Right navigation area\n */\n let buttonSecondaryRightSide = h(\"button\", { disabled: this.nextPage ? false : true, onClick: this.navigateTo.bind(this, 'lastPage') },\n h(\"span\", { class: \"NavigationButton\" }, translate('lastPage', this.language)),\n h(\"span\", { class: \"NavigationIcon\" }));\n let buttonsRightSide = h(\"div\", { class: \"RightItems\" },\n h(\"button\", { disabled: this.nextPage ? false : true, onClick: this.navigateTo.bind(this, 'nextPage') },\n h(\"span\", { class: \"NavigationButton\" }, translate('nextPage', this.language)),\n h(\"span\", { class: \"NavigationIcon\" })),\n this.secondaryArrowsActive && buttonSecondaryRightSide);\n if (isMobile(this.userAgent)) {\n buttonsRightSide =\n h(\"div\", { class: \"RightItems\" },\n h(\"button\", { disabled: this.nextPage ? false : true, onClick: this.navigateTo.bind(this, 'nextPage') },\n h(\"span\", { class: \"NavigationButton\" }, translate('nextPage', this.language)),\n h(\"span\", { class: \"NavigationIcon\" })));\n }\n return (h(\"div\", { id: \"PaginationContainer\", ref: el => this.stylingContainer = el },\n this.arrowsActive && buttonsLeftSide,\n this.numberedNavActive && navigationArea,\n this.arrowsActive && buttonsRightSide));\n }\n static get is() { return \"helper-pagination\"; }\n static get encapsulation() { return \"shadow\"; }\n static get originalStyleUrls() { return {\n \"$\": [\"helper-pagination.scss\"]\n }; }\n static get styleUrls() { return {\n \"$\": [\"helper-pagination.css\"]\n }; }\n static get properties() { return {\n \"nextPage\": {\n \"type\": \"string\",\n \"mutable\": true,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Next page string value - determines if the next page is disabled or active\"\n },\n \"attribute\": \"next-page\",\n \"reflect\": true,\n \"defaultValue\": \"''\"\n },\n \"prevPage\": {\n \"type\": \"string\",\n \"mutable\": true,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Previous page string value - determines if the previous page is disabled or active\"\n },\n \"attribute\": \"prev-page\",\n \"reflect\": true,\n \"defaultValue\": \"''\"\n },\n \"offset\": {\n \"type\": \"number\",\n \"mutable\": true,\n \"complexType\": {\n \"original\": \"number\",\n \"resolved\": \"number\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"The received offset\"\n },\n \"attribute\": \"offset\",\n \"reflect\": true,\n \"defaultValue\": \"0\"\n },\n \"limit\": {\n \"type\": \"number\",\n \"mutable\": true,\n \"complexType\": {\n \"original\": \"number\",\n \"resolved\": \"number\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"The received limit for the number of pages\"\n },\n \"attribute\": \"limit\",\n \"reflect\": true,\n \"defaultValue\": \"1\"\n },\n \"total\": {\n \"type\": \"number\",\n \"mutable\": true,\n \"complexType\": {\n \"original\": \"number\",\n \"resolved\": \"number\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"The received total number of pages\"\n },\n \"attribute\": \"total\",\n \"reflect\": true,\n \"defaultValue\": \"1\"\n },\n \"language\": {\n \"type\": \"string\",\n \"mutable\": true,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Language\"\n },\n \"attribute\": \"language\",\n \"reflect\": true,\n \"defaultValue\": \"'en'\"\n },\n \"clientStyling\": {\n \"type\": \"string\",\n \"mutable\": true,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Client custom styling via string\"\n },\n \"attribute\": \"client-styling\",\n \"reflect\": true,\n \"defaultValue\": \"''\"\n },\n \"clientStylingUrlContent\": {\n \"type\": \"string\",\n \"mutable\": true,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Client custom styling via url content\"\n },\n \"attribute\": \"client-styling-url-content\",\n \"reflect\": true,\n \"defaultValue\": \"''\"\n },\n \"arrowsActive\": {\n \"type\": \"boolean\",\n \"mutable\": true,\n \"complexType\": {\n \"original\": \"boolean\",\n \"resolved\": \"boolean\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Customize pagination: Activate pagination arrows\"\n },\n \"attribute\": \"arrows-active\",\n \"reflect\": true\n },\n \"secondaryArrowsActive\": {\n \"type\": \"boolean\",\n \"mutable\": true,\n \"complexType\": {\n \"original\": \"boolean\",\n \"resolved\": \"boolean\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Customize pagination: Activate pagination secondary arrows\"\n },\n \"attribute\": \"secondary-arrows-active\",\n \"reflect\": true\n },\n \"numberedNavActive\": {\n \"type\": \"boolean\",\n \"mutable\": true,\n \"complexType\": {\n \"original\": \"boolean\",\n \"resolved\": \"boolean\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Customize pagination: Activate pagination numbered navigation\"\n },\n \"attribute\": \"numbered-nav-active\",\n \"reflect\": true\n }\n }; }\n static get states() { return {\n \"offsetInt\": {},\n \"lastPage\": {},\n \"previousPage\": {},\n \"limitInt\": {},\n \"totalInt\": {},\n \"pagesArray\": {},\n \"endInt\": {},\n \"limitStylingAppends\": {}\n }; }\n static get events() { return [{\n \"method\": \"hpPageChange\",\n \"name\": \"hpPageChange\",\n \"bubbles\": true,\n \"cancelable\": true,\n \"composed\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Event that handles the navigation, updating the offset, limit and total values\"\n },\n \"complexType\": {\n \"original\": \"any\",\n \"resolved\": \"any\",\n \"references\": {}\n }\n }]; }\n}\n"]}
@@ -0,0 +1,2 @@
1
+ import{r as t,c as e,h as i}from"./p-e765c7d9.js";const o="en";const n=["ro","en","fr","ar","hr"];const s={en:{ticket:"Ticket"},ro:{ticket:"Bilet"},fr:{ticket:"Billet"},ar:{ticket:"تذكرة"},hr:{ticket:"Listić"}};const r=(t,e)=>{const i=e;return s[i!==undefined&&n.includes(i)?i:o][t]};const l=':host{font-family:"Roboto", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";font-size:0.8rem}*,*::before,*::after{margin:0;padding:0;list-style:none;outline:none;box-sizing:border-box}input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield}.player-account-gaming-limits-popup-2{background:var(--emfe-w-color-black, #000000);color:var(--emfe-w-color-white, #000)}.Title{font-weight:800;font-size:18px}button{display:block;font-size:0.75rem;padding:12px 0;border:0;border-radius:2px;cursor:pointer}button.PrimaryButtonStyle{font-size:14px;color:#fff;background:#7ac317}button.SecondaryButtonStyle{border:1px solid #999;color:#666;background:#fff}.LinkButton{display:inline;padding:0;color:#3366CC;text-decoration:underline;background-color:rgba(0, 0, 0, 0)}.ResultIconWrapper{display:flex;flex-direction:column;align-items:center;margin:12px 0}.ResultIconWrapper svg{height:auto;width:60px;margin:12px}.ResultIconWrapper p{color:#666}.Overlay{position:absolute;top:0;left:0;width:100vw;height:100vh;background-color:rgba(0, 0, 0, 0.5);display:flex;justify-content:center;align-items:center}.ModalContainer{position:fixed;top:30vh;width:320px;height:auto;padding:18px 14px;background:#fff;border-radius:4px}.InitialWrapper{display:flex;flex-direction:column;gap:12px}.AdditionalInformation{margin:10px 0;font-size:14px}.TermsConditions{font-size:12px}.ExpandButton{font-size:14px;background-color:#fff;border:0;padding:0;margin-top:-10px;color:#999;display:flex;justify-content:center;align-items:center;cursor:pointer}.ExpandButton svg{width:28px;height:auto;margin-left:-4px}.LeftAlign{text-align:left;font-size:16px}.CenterAlign{text-align:center}.SetLimitSection{display:flex;flex-direction:column;gap:6px}.DepositTextSection{display:flex;justify-content:space-between}.DepositInputSection{height:32px;display:flex;gap:4px}.DepositInput{flex-grow:1;padding:0 6px}.SubmitDepositButton{flex-grow:1;font-size:0.75rem;padding:0}.SubmitDepositButton[disabled]{align-items:center;color:#ccc;cursor:not-allowed;background:#fff;border:#ccc 1px solid}.Hidden{display:none}.Extended{transform:rotate(180deg)}';const a=class{constructor(i){t(this,i);this.deleteTicketEvent=e(this,"deleteTicket",7);this.endpoint="";this.ticketId=1;this.postMessage=false;this.eventName="deleteTicketAction";this.collapsed=true;this.numberOfGrids=1;this.last=false;this.language="en";this.autoPick=false;this.resetButton=false;this.totalControllers=1;this.clientStyling="";this.clientStylingUrlContent="";this.limitStylingAppends=false;this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling;this.stylingContainer.prepend(t)};this.setClientStylingURL=()=>{let t=document.createElement("style");setTimeout((()=>{t.innerHTML=this.clientStylingUrlContent;this.stylingContainer.prepend(t)}),1)}}helperAccordionActionHandler(){if(this.postMessage){window.postMessage({type:this.eventName},window.location.href)}this.deleteTicketEvent.emit({ticketId:this.ticketId})}componentDidRender(){if(!this.limitStylingAppends&&this.stylingContainer){if(this.clientStyling)this.setClientStyling();if(this.clientStylingUrlContent)this.setClientStylingURL();this.limitStylingAppends=true}}render(){console.log("ticket id:",this.ticketId);return i("div",{class:"LotteryTicketControllerContainer",ref:t=>this.stylingContainer=t},i("helper-accordion",{"header-title":`${r("ticket",this.language)} ${this.ticketId}`,"header-subtitle":this.ticketDescription,footer:true,"delete-tab":this.totalControllers!==1,collapsed:!this.last||this.collapsed,language:this.language,"client-styling":this.clientStyling,"client-styling-url-content":this.clientStylingUrlContent},i("div",{slot:"accordionContent"},i("lottery-ticket",{endpoint:this.endpoint,"game-id":this.gameId,"ticket-id":this.ticketId,"number-of-grids":this.numberOfGrids,language:this.language,"reset-button":this.resetButton,"auto-pick":this.autoPick,"client-styling":this.clientStyling,"client-styling-url-content":this.clientStylingUrlContent}))))}};a.style=l;export{a as lottery_ticket_controller};
2
+ //# sourceMappingURL=p-cd4aa6a4.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../lottery-ticket-controller/dist/collection/utils/locale.utils.js","../lottery-ticket-controller/dist/collection/components/lottery-ticket-controller/lottery-ticket-controller.css?tag=lottery-ticket-controller&encapsulation=shadow","../lottery-ticket-controller/dist/collection/components/lottery-ticket-controller/lottery-ticket-controller.js"],"names":["DEFAULT_LANGUAGE","SUPPORTED_LANGUAGES","TRANSLATIONS","en","ticket","ro","fr","ar","hr","translate","key","customLang","lang","undefined","includes","lotteryTicketControllerCss","LotteryTicketController","[object Object]","hostRef","this","endpoint","ticketId","postMessage","eventName","collapsed","numberOfGrids","last","language","autoPick","resetButton","totalControllers","clientStyling","clientStylingUrlContent","limitStylingAppends","setClientStyling","sheet","document","createElement","innerHTML","stylingContainer","prepend","setClientStylingURL","cssFile","setTimeout","window","type","location","href","deleteTicketEvent","emit","console","log","h","class","ref","el","header-title","header-subtitle","ticketDescription","footer","delete-tab","client-styling","client-styling-url-content","slot","game-id","gameId","ticket-id","number-of-grids","reset-button","auto-pick"],"mappings":"kDAAA,MAAMA,EAAmB,KACzB,MAAMC,EAAsB,CAAC,KAAM,KAAM,KAAM,KAAM,MACrD,MAAMC,EAAe,CACnBC,GAAI,CACFC,OAAQ,UAEVC,GAAI,CACFD,OAAQ,SAEVE,GAAI,CACFF,OAAQ,UAEVG,GAAI,CACFH,OAAQ,SAEVI,GAAI,CACFJ,OAAQ,WAGL,MAAMK,EAAY,CAACC,EAAKC,KAC7B,MAAMC,EAAOD,EACb,OAAOT,EAAaU,IAASC,WAAaZ,EAAoBa,SAASF,GAAQA,EAAOZ,GAAkBU,ICrB1G,MAAMK,EAA6B,8sECItBC,EAAuB,MAClCC,YAAAC,6DAIEC,KAAKC,SAAW,GAIhBD,KAAKE,SAAW,EAIhBF,KAAKG,YAAc,MAInBH,KAAKI,UAAY,qBAIjBJ,KAAKK,UAAY,KAIjBL,KAAKM,cAAgB,EAIrBN,KAAKO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4C,UAAW7C,KAAK8C,OAAQC,YAAa/C,KAAKE,SAAU8C,kBAAmBhD,KAAKM,cAAeE,SAAUR,KAAKQ,SAAUyC,eAAgBjD,KAAKU,YAAawC,YAAalD,KAAKS,SAAUiC,iBAAkB1C,KAAKY,cAAe+B,6BAA8B3C,KAAKa","sourcesContent":["const DEFAULT_LANGUAGE = 'en';\nconst SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'ar', 'hr'];\nconst TRANSLATIONS = {\n en: {\n ticket: 'Ticket',\n },\n ro: {\n ticket: 'Bilet',\n },\n fr: {\n ticket: 'Billet'\n },\n ar: {\n ticket: 'تذكرة',\n },\n hr: {\n ticket: 'Listić',\n }\n};\nexport const translate = (key, customLang) => {\n const lang = customLang;\n return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];\n};\n",":host {\n font-family: \"Roboto\", system-ui, -apple-system, \"Segoe UI\", Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\";\n font-size: 0.8rem;\n}\n\n*,\n*::before,\n*::after {\n margin: 0;\n padding: 0;\n list-style: none;\n outline: none;\n box-sizing: border-box;\n}\n\n/* Chrome, Safari, Edge, Opera */\ninput::-webkit-outer-spin-button,\ninput::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n\n/* Firefox */\ninput[type=number] {\n -moz-appearance: textfield;\n}\n\n.player-account-gaming-limits-popup-2 {\n background: var(--emfe-w-color-black, #000000);\n color: var(--emfe-w-color-white, #000);\n}\n\n.Title {\n font-weight: 800;\n font-size: 18px;\n}\n\nbutton {\n display: block;\n font-size: 0.75rem;\n padding: 12px 0;\n border: 0;\n border-radius: 2px;\n cursor: pointer;\n}\nbutton.PrimaryButtonStyle {\n font-size: 14px;\n color: #fff;\n background: #7ac317;\n}\nbutton.SecondaryButtonStyle {\n border: 1px solid #999;\n color: #666;\n background: #fff;\n}\n\n.LinkButton {\n display: inline;\n padding: 0;\n color: #3366CC;\n text-decoration: underline;\n background-color: rgba(0, 0, 0, 0);\n}\n\n.ResultIconWrapper {\n display: flex;\n flex-direction: column;\n align-items: center;\n margin: 12px 0;\n}\n.ResultIconWrapper svg {\n height: auto;\n width: 60px;\n margin: 12px;\n}\n.ResultIconWrapper p {\n color: #666;\n}\n\n.Overlay {\n position: absolute;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n background-color: rgba(0, 0, 0, 0.5);\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.ModalContainer {\n position: fixed;\n top: 30vh;\n width: 320px;\n height: auto;\n padding: 18px 14px;\n background: #fff;\n border-radius: 4px;\n}\n\n.InitialWrapper {\n display: flex;\n flex-direction: column;\n gap: 12px;\n}\n\n.AdditionalInformation {\n margin: 10px 0;\n font-size: 14px;\n}\n\n.TermsConditions {\n font-size: 12px;\n}\n\n.ExpandButton {\n font-size: 14px;\n background-color: #fff;\n border: 0;\n padding: 0;\n margin-top: -10px;\n color: #999;\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n}\n.ExpandButton svg {\n width: 28px;\n height: auto;\n margin-left: -4px;\n}\n\n.LeftAlign {\n text-align: left;\n font-size: 16px;\n}\n\n.CenterAlign {\n text-align: center;\n}\n\n.SetLimitSection {\n display: flex;\n flex-direction: column;\n gap: 6px;\n}\n\n.DepositTextSection {\n display: flex;\n justify-content: space-between;\n}\n\n.DepositInputSection {\n height: 32px;\n display: flex;\n gap: 4px;\n}\n\n.DepositInput {\n flex-grow: 1;\n padding: 0 6px;\n}\n\n.SubmitDepositButton {\n flex-grow: 1;\n font-size: 0.75rem;\n padding: 0;\n}\n.SubmitDepositButton[disabled] {\n align-items: center;\n color: #ccc;\n cursor: not-allowed;\n background: #fff;\n border: #ccc 1px solid;\n}\n\n.Hidden {\n display: none;\n}\n\n.Extended {\n transform: rotate(180deg);\n}","import { Component, h, Listen, Prop, Event, State } from '@stencil/core';\nimport '@everymatrix/helper-accordion';\nimport '@everymatrix/lottery-ticket';\nimport { translate } from '../../utils/locale.utils';\nexport class LotteryTicketController {\n constructor() {\n /**\n * Endpoint URL for the source of data (NorWAy standard)\n */\n this.endpoint = '';\n /**\n * Ticket number\n */\n this.ticketId = 1;\n /**\n * Activates postMessages as events for actions from the widget\n */\n this.postMessage = false;\n /**\n * Name of the event emitter by the action button\n */\n this.eventName = 'deleteTicketAction';\n /**\n * Collapsed\n */\n this.collapsed = true;\n /**\n * Number of grids?\n */\n this.numberOfGrids = 1;\n /**\n * This toggles if the last ticket added should be expanded or not\n */\n this.last = false;\n /**\n * Language\n */\n this.language = 'en';\n /**\n * Shows the auto-pick button\n */\n this.autoPick = false;\n /**\n * Shows the reset button\n */\n this.resetButton = false;\n /**\n * Number of ticket controllers\n */\n this.totalControllers = 1;\n /**\n * Client custom styling via string\n */\n this.clientStyling = '';\n /**\n * Client custom styling via url content\n */\n this.clientStylingUrlContent = '';\n this.limitStylingAppends = false;\n this.setClientStyling = () => {\n let sheet = document.createElement('style');\n sheet.innerHTML = this.clientStyling;\n this.stylingContainer.prepend(sheet);\n };\n this.setClientStylingURL = () => {\n let cssFile = document.createElement('style');\n setTimeout(() => {\n cssFile.innerHTML = this.clientStylingUrlContent;\n this.stylingContainer.prepend(cssFile);\n }, 1);\n };\n }\n // @TODO fix the `any` type\n helperAccordionActionHandler() {\n if (this.postMessage) {\n window.postMessage({ type: this.eventName }, window.location.href);\n }\n this.deleteTicketEvent.emit({\n ticketId: this.ticketId\n });\n }\n componentDidRender() {\n // start custom styling area\n if (!this.limitStylingAppends && this.stylingContainer) {\n if (this.clientStyling)\n this.setClientStyling();\n if (this.clientStylingUrlContent)\n this.setClientStylingURL();\n this.limitStylingAppends = true;\n }\n // end custom styling area\n }\n render() {\n console.log('ticket id:', this.ticketId);\n return (h(\"div\", { class: \"LotteryTicketControllerContainer\", ref: el => this.stylingContainer = el },\n h(\"helper-accordion\", { \"header-title\": `${translate('ticket', this.language)} ${this.ticketId}`, \"header-subtitle\": this.ticketDescription, footer: true, \"delete-tab\": this.totalControllers !== 1, collapsed: !this.last || this.collapsed, language: this.language, \"client-styling\": this.clientStyling, \"client-styling-url-content\": this.clientStylingUrlContent },\n h(\"div\", { slot: \"accordionContent\" },\n h(\"lottery-ticket\", { endpoint: this.endpoint, \"game-id\": this.gameId, \"ticket-id\": this.ticketId, \"number-of-grids\": this.numberOfGrids, language: this.language, \"reset-button\": this.resetButton, \"auto-pick\": this.autoPick, \"client-styling\": this.clientStyling, \"client-styling-url-content\": this.clientStylingUrlContent })))));\n }\n static get is() { return \"lottery-ticket-controller\"; }\n static get encapsulation() { return \"shadow\"; }\n static get originalStyleUrls() { return {\n \"$\": [\"lottery-ticket-controller.scss\"]\n }; }\n static get styleUrls() { return {\n \"$\": [\"lottery-ticket-controller.css\"]\n }; }\n static get properties() { return {\n \"endpoint\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Endpoint URL for the source of data (NorWAy standard)\"\n },\n \"attribute\": \"endpoint\",\n \"reflect\": true,\n \"defaultValue\": \"''\"\n },\n \"ticketId\": {\n \"type\": \"number\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"number\",\n \"resolved\": \"number\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Ticket number\"\n },\n \"attribute\": \"ticket-id\",\n \"reflect\": true,\n \"defaultValue\": \"1\"\n },\n \"ticketDescription\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Ticket header description\"\n },\n \"attribute\": \"ticket-description\",\n \"reflect\": true\n },\n \"gameId\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"ID of the lottery game\"\n },\n \"attribute\": \"game-id\",\n \"reflect\": true\n },\n \"postMessage\": {\n \"type\": \"boolean\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"boolean\",\n \"resolved\": \"boolean\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Activates postMessages as events for actions from the widget\"\n },\n \"attribute\": \"post-message\",\n \"reflect\": true,\n \"defaultValue\": \"false\"\n },\n \"eventName\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Name of the event emitter by the action button\"\n },\n \"attribute\": \"event-name\",\n \"reflect\": true,\n \"defaultValue\": \"'deleteTicketAction'\"\n },\n \"collapsed\": {\n \"type\": \"boolean\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"boolean\",\n \"resolved\": \"boolean\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Collapsed\"\n },\n \"attribute\": \"collapsed\",\n \"reflect\": true,\n \"defaultValue\": \"true\"\n },\n \"numberOfGrids\": {\n \"type\": \"number\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"number\",\n \"resolved\": \"number\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Number of grids?\"\n },\n \"attribute\": \"number-of-grids\",\n \"reflect\": true,\n \"defaultValue\": \"1\"\n },\n \"last\": {\n \"type\": \"boolean\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"boolean\",\n \"resolved\": \"boolean\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"This toggles if the last ticket added should be expanded or not\"\n },\n \"attribute\": \"last\",\n \"reflect\": true,\n \"defaultValue\": \"false\"\n },\n \"language\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Language\"\n },\n \"attribute\": \"language\",\n \"reflect\": true,\n \"defaultValue\": \"'en'\"\n },\n \"autoPick\": {\n \"type\": \"boolean\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"boolean\",\n \"resolved\": \"boolean\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Shows the auto-pick button\"\n },\n \"attribute\": \"auto-pick\",\n \"reflect\": true,\n \"defaultValue\": \"false\"\n },\n \"resetButton\": {\n \"type\": \"boolean\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"boolean\",\n \"resolved\": \"boolean\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Shows the reset button\"\n },\n \"attribute\": \"reset-button\",\n \"reflect\": true,\n \"defaultValue\": \"false\"\n },\n \"totalControllers\": {\n \"type\": \"number\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"number\",\n \"resolved\": \"number\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Number of ticket controllers\"\n },\n \"attribute\": \"total-controllers\",\n \"reflect\": true,\n \"defaultValue\": \"1\"\n },\n \"clientStyling\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Client custom styling via string\"\n },\n \"attribute\": \"client-styling\",\n \"reflect\": true,\n \"defaultValue\": \"''\"\n },\n \"clientStylingUrlContent\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Client custom styling via url content\"\n },\n \"attribute\": \"client-styling-url-content\",\n \"reflect\": true,\n \"defaultValue\": \"''\"\n }\n }; }\n static get states() { return {\n \"limitStylingAppends\": {}\n }; }\n static get events() { return [{\n \"method\": \"deleteTicketEvent\",\n \"name\": \"deleteTicket\",\n \"bubbles\": true,\n \"cancelable\": true,\n \"composed\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"\"\n },\n \"complexType\": {\n \"original\": \"any\",\n \"resolved\": \"any\",\n \"references\": {}\n }\n }]; }\n static get listeners() { return [{\n \"name\": \"helperAccordionAction\",\n \"method\": \"helperAccordionActionHandler\",\n \"target\": undefined,\n \"capture\": false,\n \"passive\": false\n }]; }\n}\n"]}
@@ -0,0 +1,2 @@
1
+ import{r as t,h as e}from"./p-e765c7d9.js";const s="en";const i=["ro","en","fr","ar","hr"];const r={en:{drawResultsHeader:"Draw results history",drawId:"Draw ID",drawDate:"Draw Date",drawNumbersGridA:"Draw numbers Grid A",viewAllResults:"View All",lastFiveDraws:"Last 5 Draws",lastTenDraws:"Last 10 Draws",lastFifteenDraws:"Last 15 Draws",allDrawResultsHistory:"All Draw Results History",noResults:"No results",fetchingResults:"Fetching results"},ro:{drawResultsHeader:"Istoricul extragerilor",drawId:"ID-ul extragerii",drawDate:"Data extragerii",drawNumbersGridA:"Numerele extrase Grid A",viewAllResults:"Vezi toate rezultatele",lastFiveDraws:"Ultimile 5 extrageri",lastTenDraws:"Ultimile 10 extrageri",lastFifteenDraws:"Ultimile 15 extrageri",allDrawResultsHistory:"Istoricul tuturor extragerilor",noResults:"Niciun rezultat",fetchingResults:"Se obtin rezultatele"},fr:{drawResultsHeader:"Dessiner l'historique des résultats",drawId:"ID de tirage",drawDate:"Date du tirage",drawNumbersGridA:"Tirage des numéros Grille",viewAllResults:"Voir tout",lastFiveDraws:"5 derniers tirages",lastTenDraws:"10 derniers tirages",lastFifteenDraws:"15 derniers tirages",allDrawResultsHistory:"Historique des résultats de tous les tirages",noResults:"Aucun résultat",fetchingResults:"Récupération des résultats"},ar:{drawResultsHeader:"سجل نتائج السحب",drawId:"معرّف السحب",drawDate:"تاريخ السحب",drawNumbersGridA:"شبكة أرقام السحب",viewAllResults:"عرض الكل",lastFiveDraws:"آخر 5 سحوبات",lastTenDraws:"آخر 10 سحوبات",lastFifteenDraws:"آخر 15 سحبًا",allDrawResultsHistory:"سجل نتائج كل السحوبات",noResults:"لا توجد نتائج",fetchingResults:"جلب النتائج"},hr:{drawResultsHeader:"Povijest rezultata izvlačenja",drawId:"ID izvlačenja",drawDate:"Datum izvlačenja",drawNumbersGridA:"Izvučeni brojevi tablica A",viewAllResults:"Pogledaj sve",lastFiveDraws:"Zadnjih 5 izvlačenja",lastTenDraws:"Zadnjih 10 izvlačenja",lastFifteenDraws:"Zadnjih 15 izvlačenja",allDrawResultsHistory:"Povijest svih rezultata izvlačenja",noResults:"Nema rezultata",fetchingResults:"Dohvaćanje rezultata"}};const a=(t,e)=>{const a=e;return r[a!==undefined&&i.includes(a)?a:s][t]};const l='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");:host{display:block;font-family:"Roboto", sans-serif}.GridBanner{background-color:#009993;background-repeat:no-repeat;background-position:center;color:#111;padding:0 20px 30px}.GridBanner .BannerButtonsWrapper{display:flex;justify-content:space-between;padding-top:16px}.GridBanner .BannerButtonsWrapper .BannerBackButton,.GridBanner .BannerButtonsWrapper .BannerLobbyButton{background:#fff;border:1px solid #009993;border-radius:4px;padding:7px 15px;font-size:12px;text-transform:uppercase;width:80px;cursor:pointer}.GridBanner .HistoryGridBannerArea{padding-top:30px}.HistoryGridBannerArea{display:flex;flex-direction:column;align-items:center}.BannerText{font-size:14px;font-weight:300}.BannerCountdown{font-size:22px;display:flex;gap:20px}.DrawResultsSection{max-width:600px;margin:0px auto}.HistoryGrid{border-radius:5px}.DrawResultsHeader{color:#009993;padding:25px 0 10px 0;text-align:center;border-radius:4px 4px 0 0}.DrawResultsHeader h4{text-transform:uppercase;font-size:16px;font-weight:600;margin:0}.DrawNumbersGrid{padding:10px 50px}.DrawNumbersGrid p{margin:0 0 10px 0;font-size:14px}.BulletContainer{margin-bottom:20px}.DrawResultTop{background-color:#009993;padding:10px;text-align:center;color:#fff;padding:0 50px;display:flex;justify-content:center;gap:40px}.ViewAllResults{display:block;padding:10px 40px;margin:40px auto;border:0;border-radius:5px;background-color:#009993;color:#fff;outline:none}.FilterSection{display:flex;justify-content:space-between;padding:25px 15px 10px;gap:10px;margin:0px 15px}.FilterSection .FilterResultsContainer{display:flex;gap:5px;overflow-x:auto}.FilterSection .QuickFilterButton{cursor:pointer;width:max-content;border-radius:4px;border:1px solid #00958f;background:#FFF;color:#000;font-size:12px;transition:all 0.2s linear;text-align:center;letter-spacing:0}.FilterSection .QuickFilterButton:hover{background:#F1F1F1}.FilterSection helper-filters{margin-left:auto}';const n=class{constructor(e){t(this,e);this.numberOfResults=3;this.language="en";this.clientStyling="";this.clientStylingUrlContent="";this.drawData=[];this.winningDataSetsData=[""];this.displayAllDrawsResults=true;this.showQuickFilters=true;this.dateFiltersFrom="";this.dateFiltersTo="";this.isLoading=false;this.noResults=false;this.limitStylingAppends=false;this.getDrawsData=()=>{let t=new URL(`${this.endpoint}/games/${this.gameId}/draws`);if(this.dateFiltersFrom)t.searchParams.append("from",this.dateFiltersFrom);if(this.dateFiltersTo)t.searchParams.append("to",this.dateFiltersTo);fetch(t.href).then((t=>{if(t.status>=300){throw new Error("There was an error while fetching the data")}return t.json()})).then((t=>{this.winningDataSetsData=t.items.filter((t=>t.winningNumbers));this.drawData=this.winningDataSetsData.map((t=>t))})).catch((t=>{console.log("err",t)})).finally((()=>{this.isLoading=false;this.noResults=this.drawData.filter((t=>t.winningNumbers)).length==0?true:false}))};this.filterResults=t=>{this.numberOfResults=t;this.displayAllDrawsResults=true};this.getDrawResults=t=>{let e=new URL(`${this.endpoint}/games/${this.gameId}/draws/${t}`);let s={method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json"}};fetch(e.href,s).then((t=>{if(t.status==404)this.noResults=true;return t.json()})).then((t=>{this.drawData=[t].map((t=>t))})).catch((t=>{console.log("err",t)})).finally((()=>{this.isLoading=false}))};this.viewAllResults=()=>{this.numberOfResults=this.drawData.length;this.displayAllDrawsResults=false;window.scrollTo({top:0,behavior:"smooth"})};this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling;this.stylingContainer.prepend(t)};this.setClientStylingURL=()=>{let t=document.createElement("style");setTimeout((()=>{t.innerHTML=this.clientStylingUrlContent;this.stylingContainer.prepend(t)}),1)}}filtersHandler(t){this.showQuickFilters=false;this.isLoading=true;if(t.detail.ticketDrawId){this.getDrawResults(t.detail.ticketDrawId)}else{this.dateFiltersFrom=t.detail.filterFromCalendar;this.dateFiltersTo=t.detail.filterToCalendar;this.getDrawsData()}}clearFiltersHandler(){this.showQuickFilters=true;this.dateFiltersFrom="";this.dateFiltersTo="";this.drawData=this.winningDataSetsData;this.isLoading=true;this.getDrawsData()}connectedCallback(){if(this.showQuickFilters)this.getDrawsData()}disconnectedCallback(){clearInterval(this.interval)}componentDidRender(){if(!this.limitStylingAppends&&this.stylingContainer){if(this.clientStyling)this.setClientStyling();if(this.clientStylingUrlContent)this.setClientStylingURL();this.limitStylingAppends=true}}render(){let t=e("div",{class:"DrawResultsHeader"},this.displayAllDrawsResults?e("h4",null,a("drawResultsHeader",this.language)):[e("div",{class:"DrawResultsHeaderContent"},e("h4",null,a("allDrawResultsHistory",this.language)),e("div",{class:"FilterSection"},this.showQuickFilters&&e("div",{class:"FilterResultsContainer"},e("button",{class:"QuickFilterButton",onClick:()=>this.filterResults(5)},a("lastFiveDraws",this.language)),e("button",{class:"QuickFilterButton",onClick:()=>this.filterResults(10)},a("lastTenDraws",this.language)),e("button",{class:"QuickFilterButton",onClick:()=>this.filterResults(15)},a("lastFifteenDraws",this.language))),e("helper-filters",{"show-filter-id":"true","activate-ticket-search":"false","game-id":this.gameId,"client-styling":this.clientStyling,"client-styling-url-content":this.clientStylingUrlContent})))]);return e("section",{class:"GridWrapper",ref:t=>this.stylingContainer=t},e("div",{class:"DrawResultsSection"},e("div",{class:"DrawResultsAreaHistory"},t,e("div",{class:"HistoryGridWrapper"},e("div",{class:"HistoryGrid"},this.isLoading&&e("p",null,a("fetchingResults",this.language)),!this.isLoading&&!this.noResults&&this.drawData.map((t=>e("lottery-draw-results",{endpoint:this.endpoint,"game-id":this.gameId,"draw-id":t.id,"draw-mode":true,"client-styling":this.clientStyling,"client-styling-url-content":this.clientStylingUrlContent}))).reverse().slice(0,this.numberOfResults),!this.isLoading&&this.noResults&&e("p",null,a("noResults",this.language)))),this.displayAllDrawsResults&&e("button",{class:"ViewAllResults",onClick:this.viewAllResults},a("viewAllResults",this.language)))))}};n.style=l;export{n as lottery_draw_results_history};
2
+ //# sourceMappingURL=p-e86e2389.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../lottery-draw-results-history/dist/collection/utils/locale.utils.js","../lottery-draw-results-history/dist/collection/components/lottery-draw-results-history/lottery-draw-results-history.css?tag=lottery-draw-results-history&encapsulation=shadow","../lottery-draw-results-history/dist/collection/components/lottery-draw-results-history/lottery-draw-results-history.js"],"names":["DEFAULT_LANGUAGE","SUPPORTED_LANGUAGES","TRANSLATIONS","en","drawResultsHeader","drawId","drawDate","drawNumbersGridA","viewAllResults","lastFiveDraws","lastTenDraws","lastFifteenDraws","allDrawResultsHistory","noResults","fetchingResults","ro","fr","ar","hr","translate","key","customLang","lang","undefined","includes","lotteryDrawResultsHistoryCss","LotteryDrawResultsHistory","[object Object]","hostRef","this","numberOfResults","language","clientStyling","clientStylingUrlContent","drawData","winningDataSetsData","displayAllDrawsResults","showQuickFilters","dateFiltersFrom","dateFiltersTo","isLoading","limitStylingAppends","getDrawsData","url","URL","endpoint","gameId","searchParams","append","fetch","href","then","res","status","Error","json","data","items","filter","draw","winningNumbers","map","item","catch","err","console","log","finally","length","filterResults","resultsNumber","getDrawResults","drawID","drawOptions","method","headers","Content-Type","Accept","response","window","scrollTo","top","behavior","setClientStyling","sheet","document","createElement","innerHTML","stylingContainer","prepend","setClientStylingURL","cssFile","setTimeout","event","detail","ticketDrawId","filterFromCalendar","filterToCalendar","clearInterval","interval","gridHeader","h","class","onClick","show-filter-id","activate-ticket-search","game-id","client-styling","client-styling-url-content","ref","el","draw-id","id","draw-mode","reverse","slice"],"mappings":"2CAAA,MAAMA,EAAmB,KACzB,MAAMC,EAAsB,CAAC,KAAM,KAAM,KAAM,KAAM,MACrD,MAAMC,EAAe,CACnBC,GAAI,CACFC,kBAAmB,uBACnBC,OAAQ,UACRC,SAAU,YACVC,iBAAkB,sBAClBC,eAAgB,WAChBC,cAAe,eACfC,aAAc,gBACdC,iBAAkB,gBAClBC,sBAAuB,2BACvBC,UAAW,aACXC,gBAAiB,oBAEnBC,GAAI,CACFX,kBAAmB,yBACnBC,OAAQ,mBACRC,SAAU,kBACVC,iBAAkB,0BAClBC,eAAgB,yBAChBC,cAAe,uBACfC,aAAc,wBACdC,iBAAkB,wBAClBC,sBAAuB,iCACvBC,UAAW,kBACXC,gBAAiB,wBAEnBE,GAAI,CACFZ,kBAAmB,sCACnBC,OAAQ,eACRC,SAAU,iBACVC,iBAAkB,4BAClBC,eAAgB,YAChBC,cAAe,qBACfC,aAAc,sBACdC,iBAAkB,sBAClBC,sBAAuB,+CACvBC,UAAW,iBACXC,gBAAiB,8BAEnBG,GAAI,CACFb,kBAAmB,kBACnBC,OAAQ,cACRC,SAAU,cACVC,iBAAkB,mBAClBC,eAAgB,WAChBC,cAAe,eACfC,aAAc,gBACdC,iBAAkB,eAClBC,sBAAuB,wBACvBC,UAAW,gBACXC,gBAAiB,eAEnBI,GAA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AAEC,MAAO,0BAChBF,EACAC,EAAE,MAAO,CAAEC,MAAO,sBAChBD,EAAE,MAAO,CAAEC,MAAO,eAChBzE,KAAKW,WACH6D,EAAE,IAAK,KAAMlF,EAAU,kBAAmBU,KAAKE,YAChDF,KAAKW,YAAcX,KAAKhB,WAAagB,KAAKK,SAAS2B,KAAKC,GAASuC,EAAE,uBAAwB,CAAExD,SAAUhB,KAAKgB,SAAU6D,UAAW7E,KAAKiB,OAAQiE,UAAWjD,EAAKkD,GAAIC,YAAa,KAAMN,iBAAkB9E,KAAKG,cAAe4E,6BAA8B/E,KAAKI,4BAA4BiF,UAAUC,MAAM,EAAGtF,KAAKC,kBAClTD,KAAKW,WAAaX,KAAKhB,WAAcwF,EAAE,IAAK,KAAMlF,EAAU,YAAaU,KAAKE,aACnFF,KAAKO,wBAA0BiE,EAAE,SAAU,CAAEC,MAAO,iBAAkBC,QAAS1E,KAAKrB,gBAAkBW,EAAU,iBAAkBU,KAAKE","sourcesContent":["const DEFAULT_LANGUAGE = 'en';\nconst SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'ar', 'hr'];\nconst TRANSLATIONS = {\n en: {\n drawResultsHeader: 'Draw results history',\n drawId: 'Draw ID',\n drawDate: 'Draw Date',\n drawNumbersGridA: 'Draw numbers Grid A',\n viewAllResults: 'View All',\n lastFiveDraws: 'Last 5 Draws',\n lastTenDraws: 'Last 10 Draws',\n lastFifteenDraws: 'Last 15 Draws',\n allDrawResultsHistory: 'All Draw Results History',\n noResults: 'No results',\n fetchingResults: 'Fetching results'\n },\n ro: {\n drawResultsHeader: 'Istoricul extragerilor',\n drawId: 'ID-ul extragerii',\n drawDate: 'Data extragerii',\n drawNumbersGridA: 'Numerele extrase Grid A',\n viewAllResults: 'Vezi toate rezultatele',\n lastFiveDraws: 'Ultimile 5 extrageri',\n lastTenDraws: 'Ultimile 10 extrageri',\n lastFifteenDraws: 'Ultimile 15 extrageri',\n allDrawResultsHistory: 'Istoricul tuturor extragerilor',\n noResults: 'Niciun rezultat',\n fetchingResults: 'Se obtin rezultatele'\n },\n fr: {\n drawResultsHeader: 'Dessiner l\\'historique des résultats',\n drawId: 'ID de tirage',\n drawDate: 'Date du tirage',\n drawNumbersGridA: 'Tirage des numéros Grille',\n viewAllResults: 'Voir tout',\n lastFiveDraws: '5 derniers tirages',\n lastTenDraws: '10 derniers tirages',\n lastFifteenDraws: '15 derniers tirages',\n allDrawResultsHistory: 'Historique des résultats de tous les tirages',\n noResults: 'Aucun résultat',\n fetchingResults: 'Récupération des résultats'\n },\n ar: {\n drawResultsHeader: 'سجل نتائج السحب',\n drawId: 'معرّف السحب',\n drawDate: 'تاريخ السحب',\n drawNumbersGridA: 'شبكة أرقام السحب',\n viewAllResults: 'عرض الكل',\n lastFiveDraws: 'آخر 5 سحوبات',\n lastTenDraws: 'آخر 10 سحوبات',\n lastFifteenDraws: 'آخر 15 سحبًا',\n allDrawResultsHistory: 'سجل نتائج كل السحوبات',\n noResults: 'لا توجد نتائج',\n fetchingResults: 'جلب النتائج'\n },\n hr: {\n drawResultsHeader: 'Povijest rezultata izvlačenja',\n drawId: 'ID izvlačenja',\n drawDate: 'Datum izvlačenja',\n drawNumbersGridA: 'Izvučeni brojevi tablica A',\n viewAllResults: 'Pogledaj sve',\n lastFiveDraws: 'Zadnjih 5 izvlačenja',\n lastTenDraws: 'Zadnjih 10 izvlačenja',\n lastFifteenDraws: 'Zadnjih 15 izvlačenja',\n allDrawResultsHistory: 'Povijest svih rezultata izvlačenja',\n noResults: 'Nema rezultata',\n fetchingResults: 'Dohvaćanje rezultata'\n },\n};\nexport const translate = (key, customLang) => {\n const lang = customLang;\n return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];\n};\n","@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");\n:host {\n display: block;\n font-family: \"Roboto\", sans-serif;\n}\n\n.GridBanner {\n background-color: #009993;\n background-repeat: no-repeat;\n background-position: center;\n color: #111;\n padding: 0 20px 30px;\n}\n.GridBanner .BannerButtonsWrapper {\n display: flex;\n justify-content: space-between;\n padding-top: 16px;\n}\n.GridBanner .BannerButtonsWrapper .BannerBackButton, .GridBanner .BannerButtonsWrapper .BannerLobbyButton {\n background: #fff;\n border: 1px solid #009993;\n border-radius: 4px;\n padding: 7px 15px;\n font-size: 12px;\n text-transform: uppercase;\n width: 80px;\n cursor: pointer;\n}\n.GridBanner .HistoryGridBannerArea {\n padding-top: 30px;\n}\n\n.HistoryGridBannerArea {\n display: flex;\n flex-direction: column;\n align-items: center;\n}\n\n.BannerText {\n font-size: 14px;\n font-weight: 300;\n}\n\n.BannerCountdown {\n font-size: 22px;\n display: flex;\n gap: 20px;\n}\n\n.DrawResultsSection {\n max-width: 600px;\n margin: 0px auto;\n}\n\n.HistoryGrid {\n border-radius: 5px;\n}\n\n.DrawResultsHeader {\n color: #009993;\n padding: 25px 0 10px 0;\n text-align: center;\n border-radius: 4px 4px 0 0;\n}\n.DrawResultsHeader h4 {\n text-transform: uppercase;\n font-size: 16px;\n font-weight: 600;\n margin: 0;\n}\n\n.DrawNumbersGrid {\n padding: 10px 50px;\n}\n.DrawNumbersGrid p {\n margin: 0 0 10px 0;\n font-size: 14px;\n}\n\n.BulletContainer {\n margin-bottom: 20px;\n}\n\n.DrawResultTop {\n background-color: #009993;\n padding: 10px;\n text-align: center;\n color: #fff;\n padding: 0 50px;\n display: flex;\n justify-content: center;\n gap: 40px;\n}\n\n.ViewAllResults {\n display: block;\n padding: 10px 40px;\n margin: 40px auto;\n border: 0;\n border-radius: 5px;\n background-color: #009993;\n color: #fff;\n outline: none;\n}\n\n.FilterSection {\n display: flex;\n justify-content: space-between;\n padding: 25px 15px 10px;\n gap: 10px;\n margin: 0px 15px;\n}\n.FilterSection .FilterResultsContainer {\n display: flex;\n gap: 5px;\n overflow-x: auto;\n}\n.FilterSection .QuickFilterButton {\n cursor: pointer;\n width: max-content;\n border-radius: 4px;\n border: 1px solid #00958f;\n background: #FFF;\n color: #000;\n font-size: 12px;\n transition: all 0.2s linear;\n text-align: center;\n letter-spacing: 0;\n}\n.FilterSection .QuickFilterButton:hover {\n background: #F1F1F1;\n}\n.FilterSection helper-filters {\n margin-left: auto;\n}","import { Component, Prop, h, State, Listen } from '@stencil/core';\nimport { translate } from '../../utils/locale.utils';\nimport '@everymatrix/lottery-grid';\nimport '@everymatrix/helper-pagination';\nimport '@everymatrix/helper-modal';\nimport '@everymatrix/helper-filters';\nimport '@everymatrix/lottery-draw-results';\nexport class LotteryDrawResultsHistory {\n constructor() {\n /**\n * The number of results to be displayed\n */\n this.numberOfResults = 3;\n /**\n *Language\n */\n this.language = 'en';\n /**\n * Client custom styling via string\n */\n this.clientStyling = '';\n /**\n * Client custom styling via url content\n */\n this.clientStylingUrlContent = '';\n this.drawData = [];\n this.winningDataSetsData = [''];\n this.displayAllDrawsResults = true;\n this.showQuickFilters = true;\n this.dateFiltersFrom = '';\n this.dateFiltersTo = '';\n this.isLoading = false;\n this.noResults = false;\n this.limitStylingAppends = false;\n this.getDrawsData = () => {\n let url = new URL(`${this.endpoint}/games/${this.gameId}/draws`);\n if (this.dateFiltersFrom)\n url.searchParams.append('from', this.dateFiltersFrom);\n if (this.dateFiltersTo)\n url.searchParams.append('to', this.dateFiltersTo);\n fetch(url.href)\n .then((res) => {\n if (res.status >= 300) {\n throw new Error('There was an error while fetching the data');\n }\n return res.json();\n })\n .then((data) => {\n this.winningDataSetsData = data.items.filter(draw => draw.winningNumbers);\n this.drawData = this.winningDataSetsData.map((item) => item);\n })\n .catch((err) => {\n console.log('err', err);\n })\n .finally(() => {\n this.isLoading = false;\n this.noResults = this.drawData.filter(draw => draw.winningNumbers).length == 0 ? true : false;\n });\n };\n this.filterResults = (resultsNumber) => {\n this.numberOfResults = resultsNumber;\n this.displayAllDrawsResults = true;\n };\n this.getDrawResults = (drawID) => {\n let url = new URL(`${this.endpoint}/games/${this.gameId}/draws/${drawID}`);\n let drawOptions = {\n method: \"GET\",\n headers: {\n 'Content-Type': \"application/json\",\n 'Accept': 'application/json',\n },\n };\n fetch(url.href, drawOptions)\n .then((response) => {\n if (response.status == 404)\n this.noResults = true;\n return response.json();\n })\n .then((data) => {\n this.drawData = [data].map((item) => item);\n })\n .catch((err) => {\n console.log('err', err);\n })\n .finally(() => {\n this.isLoading = false;\n });\n };\n this.viewAllResults = () => {\n this.numberOfResults = this.drawData.length;\n this.displayAllDrawsResults = false;\n window.scrollTo({ top: 0, behavior: 'smooth' });\n };\n this.setClientStyling = () => {\n let sheet = document.createElement('style');\n sheet.innerHTML = this.clientStyling;\n this.stylingContainer.prepend(sheet);\n };\n this.setClientStylingURL = () => {\n let cssFile = document.createElement('style');\n setTimeout(() => {\n cssFile.innerHTML = this.clientStylingUrlContent;\n this.stylingContainer.prepend(cssFile);\n }, 1);\n };\n }\n // Filters events\n // @Listen('filterDraw')\n // filtersDrawHandler(event: CustomEvent<any>):void {\n // this.isLoading = true;\n // this.showQuickFilters = false;\n // }\n filtersHandler(event) {\n this.showQuickFilters = false;\n this.isLoading = true;\n if (event.detail.ticketDrawId) {\n this.getDrawResults(event.detail.ticketDrawId);\n }\n else {\n this.dateFiltersFrom = event.detail.filterFromCalendar;\n this.dateFiltersTo = event.detail.filterToCalendar;\n this.getDrawsData();\n }\n }\n clearFiltersHandler() {\n this.showQuickFilters = true;\n this.dateFiltersFrom = '';\n this.dateFiltersTo = '';\n this.drawData = this.winningDataSetsData;\n this.isLoading = true;\n this.getDrawsData();\n }\n connectedCallback() {\n if (this.showQuickFilters)\n this.getDrawsData();\n }\n disconnectedCallback() {\n clearInterval(this.interval);\n }\n componentDidRender() {\n // start custom styling area\n if (!this.limitStylingAppends && this.stylingContainer) {\n if (this.clientStyling)\n this.setClientStyling();\n if (this.clientStylingUrlContent)\n this.setClientStylingURL();\n this.limitStylingAppends = true;\n }\n // end custom styling area\n }\n render() {\n let gridHeader = h(\"div\", { class: \"DrawResultsHeader\" }, this.displayAllDrawsResults ? h(\"h4\", null, translate('drawResultsHeader', this.language)) :\n [h(\"div\", { class: \"DrawResultsHeaderContent\" },\n h(\"h4\", null, translate('allDrawResultsHistory', this.language)),\n h(\"div\", { class: \"FilterSection\" },\n this.showQuickFilters &&\n h(\"div\", { class: \"FilterResultsContainer\" },\n h(\"button\", { class: \"QuickFilterButton\", onClick: () => this.filterResults(5) }, translate('lastFiveDraws', this.language)),\n h(\"button\", { class: \"QuickFilterButton\", onClick: () => this.filterResults(10) }, translate('lastTenDraws', this.language)),\n h(\"button\", { class: \"QuickFilterButton\", onClick: () => this.filterResults(15) }, translate('lastFifteenDraws', this.language))),\n h(\"helper-filters\", { \"show-filter-id\": \"true\", \"activate-ticket-search\": \"false\", \"game-id\": this.gameId, \"client-styling\": this.clientStyling, \"client-styling-url-content\": this.clientStylingUrlContent }))),\n ]);\n return h(\"section\", { class: \"GridWrapper\", ref: el => this.stylingContainer = el },\n h(\"div\", { class: \"DrawResultsSection\" },\n h(\"div\", { class: \"DrawResultsAreaHistory\" },\n gridHeader,\n h(\"div\", { class: \"HistoryGridWrapper\" },\n h(\"div\", { class: \"HistoryGrid\" },\n this.isLoading &&\n h(\"p\", null, translate('fetchingResults', this.language)),\n !this.isLoading && !this.noResults && this.drawData.map((item) => h(\"lottery-draw-results\", { endpoint: this.endpoint, \"game-id\": this.gameId, \"draw-id\": item.id, \"draw-mode\": true, \"client-styling\": this.clientStyling, \"client-styling-url-content\": this.clientStylingUrlContent })).reverse().slice(0, this.numberOfResults),\n !this.isLoading && this.noResults && (h(\"p\", null, translate('noResults', this.language))))),\n this.displayAllDrawsResults && h(\"button\", { class: \"ViewAllResults\", onClick: this.viewAllResults }, translate('viewAllResults', this.language)))));\n }\n static get is() { return \"lottery-draw-results-history\"; }\n static get encapsulation() { return \"shadow\"; }\n static get originalStyleUrls() { return {\n \"$\": [\"lottery-draw-results-history.scss\"]\n }; }\n static get styleUrls() { return {\n \"$\": [\"lottery-draw-results-history.css\"]\n }; }\n static get properties() { return {\n \"endpoint\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Endpoint URL for lottery\"\n },\n \"attribute\": \"endpoint\",\n \"reflect\": true\n },\n \"gameId\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"GameID\"\n },\n \"attribute\": \"game-id\",\n \"reflect\": true\n },\n \"numberOfResults\": {\n \"type\": \"number\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"number\",\n \"resolved\": \"number\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"The number of results to be displayed\"\n },\n \"attribute\": \"number-of-results\",\n \"reflect\": true,\n \"defaultValue\": \"3\"\n },\n \"language\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Language\"\n },\n \"attribute\": \"language\",\n \"reflect\": true,\n \"defaultValue\": \"'en'\"\n },\n \"clientStyling\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Client custom styling via string\"\n },\n \"attribute\": \"client-styling\",\n \"reflect\": true,\n \"defaultValue\": \"''\"\n },\n \"clientStylingUrlContent\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Client custom styling via url content\"\n },\n \"attribute\": \"client-styling-url-content\",\n \"reflect\": true,\n \"defaultValue\": \"''\"\n }\n }; }\n static get states() { return {\n \"drawData\": {},\n \"winningDataSetsData\": {},\n \"displayAllDrawsResults\": {},\n \"showQuickFilters\": {},\n \"dateFiltersFrom\": {},\n \"dateFiltersTo\": {},\n \"isLoading\": {},\n \"noResults\": {},\n \"limitStylingAppends\": {}\n }; }\n static get listeners() { return [{\n \"name\": \"filterSelection\",\n \"method\": \"filtersHandler\",\n \"target\": undefined,\n \"capture\": false,\n \"passive\": false\n }, {\n \"name\": \"filterSelectionReset\",\n \"method\": \"clearFiltersHandler\",\n \"target\": undefined,\n \"capture\": false,\n \"passive\": false\n }]; }\n}\n"]}
@@ -0,0 +1,2 @@
1
+ import{r as t,c as e,g as i,h as a,a as r}from"./p-e765c7d9.js";const s="en";const n=["ro","en","fr","ar","hr"];const o={en:{error:"Error",title:"Chrono",backButton:"Back",lobbyButton:"Lobby",prize:"Prize",winUpTo:"Win up to",nextDraw:"Next draw in: ",buy:"Buy tickets",viewLatest:"View latest results",createTicket:"Create Ticket",modalSuccess:"Purchase successfully completed!",deleteTicketModalTitle:"Delete Ticket",deleteTicketModalText:"Are you sure you want to delete this ticket?",deleteTicketModalCancel:"Cancel",deleteTicketModalConfirm:"Delete",orderSummaryTitle:"Order Summary",orderSummaryTickets:"Ticket",orderSummaryTotal:"Total",orderSummarySubmit:"Submit",lastDrawResultsTitle:"Last Draw Results",modalLogin:"Please login to submit a ticket"},ro:{error:"Eroare",title:"Loto 6/49",backButton:"Inapoi",lobbyButton:"Lobby",prize:"MARELE JACKPOT OMG",winUpTo:"Castiga pana la",nextDraw:"Urmatoarea extragere:",buy:"Cumpara bilet",viewLatest:"Ultimile extrageri",createTicket:"Creeaza bilet",modalSuccess:"Achizitie efectuata cu succes",deleteTicketModalTitle:"Sterge biletul",deleteTicketModalText:"Esti sigur ca vrei sa stergi acest bilet?",deleteTicketModalCancel:"Anuleaza",deleteTicketModalConfirm:"Sterge",orderSummaryTitle:"Rezumat comanda",orderSummaryTickets:"Bilet",orderSummaryTotal:"Total",orderSummarySubmit:"Trimite",lastDrawResultsTitle:"Cele mai recente extrageri",modalLogin:"Please login to submit a ticket"},fr:{error:"Error",title:"Chrono",backButton:"Back",lobbyButton:"Lobby",prize:"Prize",winUpTo:"Win up to",nextDraw:"Next draw in: ",buy:"Buy tickets",viewLatest:"View latest results",createTicket:"Create Ticket",modalSuccess:"Purchase successfully completed!",deleteTicketModalTitle:"Delete Ticket",deleteTicketModalText:"Are you sure you want to delete this ticket?",deleteTicketModalCancel:"Cancel",deleteTicketModalConfirm:"Delete",orderSummaryTitle:"Order Summary",orderSummaryTickets:"Ticket",orderSummaryTotal:"Total",orderSummarySubmit:"Submit",lastDrawResultsTitle:"Résultats du dernier tirage",modalLogin:"Please login to submit a ticket"},ar:{error:"خطأ",title:"كرونو",backButton:"خلف",lobbyButton:"ردهة",prize:"جائزة",winUpTo:"الفوز بما يصل الى",nextDraw:"السحب التالي:",buy:"اشتري تذاكر",viewLatest:"عرض أحدث النتائج",createTicket:"إنشاء تذكرة",modalSuccess:"!سيتم الشراء بنجاح قريبًا",deleteTicketModalTitle:"حذف التذكرة",deleteTicketModalText:"هل أنت متأكد أنك تريد حذف هذه التذكرة؟",deleteTicketModalCancel:"يلغي",deleteTicketModalConfirm:"حذف",orderSummaryTitle:"ملخص الطلب",orderSummaryTickets:"تذكرة",orderSummaryTotal:"المجموع",orderSummarySubmit:"يُقدِّم",lastDrawResultsTitle:"نتائج آخر سحب",modalLogin:"الرجاء تسجيل الدخول لتقديم تذكرة"},hr:{error:"Greška",title:"Krono",backButton:"Nazad",lobbyButton:"Lobby",prize:"Nagrada",winUpTo:"Osvoji do",nextDraw:"Sljedeće izvlačenje za: ",buy:"Uplati listić",viewLatest:"Pogledajte najnovije rezultate",createTicket:"Uplati listić",modalSuccess:"Kupnja uspješno obavljena!",deleteTicketModalTitle:"Izbriši listić",deleteTicketModalText:"Are you sure you want to delete this ticket?",deleteTicketModalCancel:"Otkaži",deleteTicketModalConfirm:"Izbriši",orderSummaryTitle:"Sažetak narudžbe",orderSummaryTickets:"Listić",orderSummaryTotal:"Ukupno",orderSummarySubmit:"Podnijeti",lastDrawResultsTitle:"Rezultati posljednjeg izvlačenja",modalLogin:"Molimo prijavite se da uplatite listić"}};const l=(t,e)=>{const i=e;return o[i!==undefined&&n.includes(i)?i:s][t]};const c=t=>!!(t.toLowerCase().match(/android/i)||t.toLowerCase().match(/blackberry|bb/i)||t.toLowerCase().match(/iphone|ipad|ipod/i)||t.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i));const d='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");:host{display:block;font-family:"Roboto", sans-serif}.GamePage .GridBanner{background-color:#009993;background-repeat:no-repeat;background-position:center;color:#111;padding:0 20px 10px;height:220px;display:flex;flex-direction:column;justify-content:space-between}.GamePage .GridBanner .BannerButtonsWrapper{display:flex;justify-content:space-between;padding-top:16px}.GamePage .GridBanner .BannerButtonsWrapper .BannerBackButton,.GamePage .GridBanner .BannerButtonsWrapper .BannerLobbyButton{background:#fff;border:1px solid #D4D4D4;border-radius:4px;padding:7px 15px;font-size:12px;text-transform:uppercase;width:80px;cursor:pointer}.GamePage .GridBanner .GridBannerArea{padding-top:30px;display:flex;flex-direction:column;align-items:center}.GamePage .TotalWinnings{color:#000;font-size:18px;display:flex;flex-direction:row;justify-content:center;align-items:center;gap:10px;text-transform:uppercase}.GamePage .TotalWinnings span{font-size:18px;font-weight:700}.GamePage .NextDraw{color:#00958f;font-size:24px;font-weight:600;margin:0 auto;text-align:center;text-transform:uppercase;display:flex;justify-content:center;align-items:center;flex-direction:column;gap:4px}.GamePage .NextDraw .BannerText{font-weight:400;font-size:18px;text-transform:uppercase;padding:0;margin:15px 0 0 0}.GamePage .NextDraw .BannerCountdown{font-size:22px;color:#00958f;display:flex;gap:20px}.GamePage .Tabs{display:flex;justify-content:center;gap:10px}.GamePage .Tabs .TabButton{border-radius:4px;cursor:pointer;padding:8px 0;width:50%;max-width:200px;border:1px solid #00958f;background:#00958f;color:#fff;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0}.GamePage .Tabs .TabButton.Active{color:#00958f;background:#F1F1F1;border:1px solid #F1F1F1}.LastDrawResultsTitle{color:#009993;padding:25px 0 10px 0;text-align:center;border-radius:4px;text-transform:uppercase;font-size:16px;font-weight:600;margin:0}.NextDrawWrapper{padding:10px 15px;background:#F1F1F1;background:linear-gradient(0deg, #f1f1f1 0%, rgba(253, 187, 45, 0) 100%)}.NextDrawWrapper .BannerText{font-size:16px;font-weight:700;text-align:center}.NextDrawWrapper .BannerCountdown{font-size:22px;display:flex;gap:8px;color:#009993;font-weight:bolder;justify-content:center}.GamePageContent{padding:15px;max-width:1200px;margin:0 auto}.GameDetails{padding-bottom:10px;margin-bottom:20px}.CreateNewTicket{background:#004D4A;height:100px;width:100%;display:flex;margin-top:10px;flex-direction:column;justify-content:center;align-items:center}.CreateNewTicket button{cursor:pointer;display:inline-block;border-radius:50%;width:40px;height:40px;margin:5px;border:1px solid #FFF;background:#FFF;color:#004D4A;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0}.CreateNewTicket button:hover{background:#F1F1F1}.CreateNewTicket span{display:inline-block;font-size:12px;text-align:center;margin:0 auto;color:#FFF}.OrderSummary{min-width:200px;border-radius:4px;display:flex;flex-direction:column;justify-content:center;margin-top:20px;background:#fff}.OrderSummary .OrderSummaryTitle{font-size:16px;color:#009993;text-transform:uppercase;text-align:center}.OrderSummary .Ticket{display:inline-block;color:#000;font-size:14px;height:50px;line-height:50px;margin-left:15px}.OrderSummary .Ticket span{text-align:right}.OrderSummary hr{border:none;border-top:1px double #D4D4D4;color:#D4D4D4;width:100%}.OrderSummary .Total{display:inline-block;color:#000;font-size:14px;height:50px;line-height:50px;margin-left:15px}.OrderSummary .Total span{text-align:right}.ButtonWrapper{display:flex;align-items:center;justify-content:center}.ButtonWrapper .Button{cursor:pointer;border-radius:4px;padding:8px 60px;width:max-content;margin:5px;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0;background:#009993;border:1px solid #009993;color:#FFF}.ButtonWrapper .Button:hover{background:#00ABA4}.ButtonWrapper .Button.ButtonDisabled{pointer-events:none;background:#ccc;border:1px solid #ccc}.SubmitModalSuccess{text-align:center;font-size:18px;padding:20px}.DeleteTicketModalWrapper{padding:20px;text-align:center}.DeleteTicketModalWrapper .DeleteTicketModalTitle{font-size:16px;color:#00958f;font-weight:400;text-transform:uppercase;margin:20px 0 40px}.DeleteTicketModalWrapper .DeleteTicketModalText{font-size:14px;color:#000;line-height:22px;margin-bottom:40px}.DeleteTicketModalWrapper .DeleteTicketModalButtons{display:flex;gap:10px;justify-content:center}.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalConfirm{cursor:pointer;border-radius:4px;padding:8px 25px;width:max-content;margin:5px;color:#000;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0;background:#FF3D00;border:1px solid #FF3D00;color:#FFF}.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalConfirm:hover{background:#FF6536;border:1px solid #FF3D00}.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalCancel{cursor:pointer;width:max-content;border-radius:4px;padding:10px 25px;margin:5px;border:1px solid #00958f;background:#FFF;color:#000;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0}.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalCancel:hover{background:#F1F1F1}@media (min-width: 1200px){.GamePageContent .TicketsWrapper{float:left;width:49%}.GamePageContent .GameDetails{float:right;width:49%}.GamePageContent .OrderSummary{float:right;width:49%}}';const p=class{constructor(i){t(this,i);this.goBackEvent=e(this,"goBackEvent",7);this.goToLobbyEvent=e(this,"goToLobbyEvent",7);this.language="en";this.autoPick=false;this.resetButton=false;this.clientStyling="";this.clientStylingurl="";this.clientStylingUrlContent="";this.tickets=[];this.tabIndex=0;this.hasErrors=false;this.totalAmount=0;this.successVisible=false;this.deleteVisible=false;this.latestDraw={};this.totalWinningsAmount=0;this.isLoggedIn=false;this.loginModalVisible=false;this.limitStylingAppends=false;this.userAgent=window.navigator.userAgent;this.multiplier=false;this.quickPick=false;this.isMobile=c(this.userAgent);this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling;this.stylingContainer.prepend(t)};this.setClientStylingURL=()=>{let t=new URL(this.clientStylingurl);let e=document.createElement("style");fetch(t.href).then((t=>t.text())).then((t=>{this.clientStylingUrlContent=t;e.innerHTML=t;setTimeout((()=>{this.stylingContainer.prepend(e)}),1)})).catch((t=>{console.log("error ",t)}))}}connectedCallback(){this.getGameDetails();this.getDraws();if(this.sessionId){this.isLoggedIn=true}}componentDidRender(){if(!this.limitStylingAppends&&this.stylingContainer){if(this.clientStyling)this.setClientStyling();if(this.clientStylingurl)this.setClientStylingURL();this.limitStylingAppends=true}}countdownLogic(t){this.interval=setInterval((()=>{this.daysRemaining=Math.floor((Date.parse(t)-(new Date).getTime())/(1e3*60*60*24));this.hoursRemaining=Math.floor((Date.parse(t)-(new Date).getTime())/(1e3*60*60)-this.daysRemaining*24);this.minutesRemaining=Math.floor((Date.parse(t)-(new Date).getTime())/(1e3*60)-this.daysRemaining*24*60-this.hoursRemaining*60);this.secondsRemaining=Math.floor((Date.parse(t)-(new Date).getTime())/1e3-this.daysRemaining*24*60*60-this.hoursRemaining*60*60-this.minutesRemaining*60)}),1e3)}disconnectedCallback(){clearInterval(this.interval)}getGameDetails(){let t=new URL(`${this.endpoint}/games/${this.gameId}`);fetch(t.href).then((t=>{if(t.status>=300){this.hasErrors=true;throw new Error("There was an error while fetching the data")}return t.json()})).then((t=>{this.gameData=t;this.basicStake=this.gameData.type.stakes[0].amount;let e=this.gameData.draws.filter((t=>!t.winningNumbers));e.length>0&&(this.nextDraw=e[0].id);this.createNewTicket()})).catch((t=>{this.hasErrors=true;console.log("Error",t)}))}calculateTotalAmount(){const{currency:t}=this.gameData.type.stakes[0];this.totalAmount=0;this.tickets.forEach((t=>{if(t.completed){this.totalAmount+=t.amount*t.stake}}));this.currency=t}gridFilledHandler(t){this.tickets=this.tickets.map((e=>{if(e.ticketId==t.detail.id){let i=e.selectedNumbers||[];i[t.detail.index]=t.detail.selectedNumbers.map((t=>parseInt(t,10)));return{gameId:e.gameId,ticketId:e.ticketId,completed:true,amount:t.detail.draws,stake:e.stake,selectedNumbers:i}}return e}));this.calculateTotalAmount()}gridDirtyHandler(t){this.tickets=this.tickets.map((e=>{if(e.gameId==t.detail.id){return{gameId:e.gameId,ticketId:e.ticketId,completed:false,amount:e.amount,stake:e.stake,grids:[]}}return e}))}deleteTicketHandler(t){this.deleteVisible=true;this.deleteEventData=t}modalCloseEvent(){this.deleteVisible=false;this.loginModalVisible=false}stakeChangeHandler(t){const{ticketId:e,stake:i}=t.detail;this.tickets[e-1].stake=i;this.calculateTotalAmount()}multiplierChangeHandler(t){this.multiplier=t.detail}getDraws(){let t=new URL(`${this.endpoint}/games/${this.gameId}/draws`);let e={method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json"}};fetch(t.href,e).then((t=>t.json())).then((t=>{var e;let i=t.items.filter((t=>{if(Date.parse(t.date)>(new Date).getTime()){return!t.winningNumbers}}));let a=t.items.filter((t=>t.winningNumbers));if(!i[0])return;this.latestDraw=i[0];this.nextDate=this.latestDraw.date;this.countdownLogic(this.nextDate);this.lastDrawId=a[a.length-1].id;(e=this.latestDraw)===null||e===void 0?void 0:e.prizes.forEach((t=>{this.totalWinningsAmount+=JSON.parse(t.amount)}))})).catch((t=>{console.log("error ",t)}))}confirmDeleteTicketHandler(t){this.tickets=this.tickets.filter((e=>{if(e.ticketId==t.detail.ticketId){return false}return true}));this.calculateTotalAmount();this.deleteVisible=false}createNewTicket(){this.tickets=[...this.tickets,{gameId:this.gameId,ticketId:this.tickets.length+1,completed:false,amount:1,stake:this.basicStake,grids:[]}]}showLoginModal(){this.loginModalVisible=true}submitTickets(){let t=new URL(`${this.endpoint}/tickets`);let e={gameId:this.gameId,tickets:[]};this.tickets.forEach((t=>{e.tickets.push({startingDrawId:this.nextDraw,amount:t.stake,gameId:this.gameId,currency:this.currency,selection:t.selectedNumbers,multiplier:this.multiplier,drawCount:t.amount,quickPick:this.quickPick})}));let i={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${this.sessionId}`},body:JSON.stringify(e)};fetch(t.href,i).then((t=>{if(t.status>300){throw new Error("err")}return t.json()})).then((t=>{console.log("data",t)})).catch((t=>{console.log("error ",t)}));this.successVisible=true}goBack(){this.goBackEvent.emit()}goToLobby(){this.goToLobbyEvent.emit()}render(){const t=i(this.isMobile?"/assets/chrono_lottery_mobile.png":"/assets/chrono_desktop.png");if(this.hasErrors){return a("div",{class:"GamePage"},a("div",{class:"Title"},l("error",this.language)))}return a("div",{class:"GamePage",dir:this.language=="ar"?"rtl":"ltr",ref:t=>this.stylingContainer=t},a("div",{class:"GridBanner",style:{background:`url(${this.backgroundUrl?this.backgroundUrl:t})`,"background-size":"contain","background-repeat":"no-repeat","background-position":"center"}},a("div",{class:"BannerButtonsWrapper"},a("button",{class:"BannerBackButton",onClick:this.goBack.bind(this)},a("span",{class:"BannerBackButtonArrow"},"ᐸ "),l("backButton",this.language)),a("button",{class:"BannerLobbyButton",onClick:this.goToLobby.bind(this)},l("lobbyButton",this.language))),a("div",{class:"Tabs"},a("div",{class:"TabButton"+(this.tabIndex==0?" Active":""),onClick:()=>this.tabIndex=0},l("buy",this.language)),a("div",{class:"TabButton"+(this.tabIndex==1?" Active":""),onClick:()=>this.tabIndex=1},l("viewLatest",this.language)))),a("div",{class:"NextDrawWrapper"},a("div",{class:"TotalWinnings"},l("winUpTo",this.language),": ",a("span",null,"$",this.totalWinningsAmount.toLocaleString("en-US",{maximumFractionDigits:2}))),a("div",{class:"NextDraw"},a("p",{class:"BannerText"},l("nextDraw",this.language)),a("div",{class:"BannerCountdown"},a("span",{class:"CountdownDays"},this.daysRemaining,"D"),a("span",{class:"CountdownHours"},this.hoursRemaining,"H"),a("span",{class:"CountdownMinutes"},this.minutesRemaining,"M"),a("span",{class:"CountdownSeconds"},this.secondsRemaining,"S")))),this.tabIndex==0&&a("div",{class:"GamePageContent"},a("div",{class:"GameDetails"},a("lottery-game-details",{"client-styling":this.clientStyling,"client-styling-url-content":this.clientStylingUrlContent})),a("div",{class:"TicketsWrapper"},this.tickets.map((t=>a("lottery-ticket-controller",{endpoint:this.endpoint,"ticket-id":t.ticketId,"game-id":t.gameId,collapsed:false,last:true,language:this.language,"auto-pick":this.autoPick,"reset-button":this.resetButton,"total-controllers":this.tickets.length,"client-styling":this.clientStyling,"client-styling-url-content":this.clientStylingUrlContent}))),a("div",{class:"CreateNewTicket"},a("button",{onClick:()=>this.createNewTicket()},"+"),a("span",null,l("createTicket",this.language)))),a("div",{class:"OrderSummary"},a("h3",{class:"OrderSummaryTitle"},l("orderSummaryTitle",this.language)),a("div",{class:"Ticket"},l("orderSummaryTickets",this.language),": ",a("span",null,this.tickets.length)),a("hr",null),a("div",{class:"Total"},l("orderSummaryTotal",this.language),": ",a("span",null,this.totalAmount," ",this.currency)),a("div",{class:"ButtonWrapper"},this.isLoggedIn&&a("span",{class:"Button",onClick:()=>this.submitTickets()},l("orderSummarySubmit",this.language)),!this.isLoggedIn&&a("div",null,a("span",{class:"Button",onClick:()=>this.showLoginModal()},l("orderSummarySubmit",this.language)),a("helper-modal",{"title-modal":"Success",visible:this.loginModalVisible,"client-styling":this.clientStyling,"client-styling-url-content":this.clientStylingUrlContent},a("p",{class:"SubmitModalSuccess"},l("modalLogin",this.language))))))),this.tabIndex==1&&a("div",null,a("h4",{class:"LastDrawResultsTitle"},l("lastDrawResultsTitle",this.language)),a("lottery-draw-results",{endpoint:this.endpoint,"game-id":this.gameId,language:this.language,"draw-id":this.lastDrawId,"draw-mode":true,"client-styling":this.clientStyling,"client-styling-url-content":this.clientStylingUrlContent}),a("lottery-draw-results-history",{endpoint:this.endpoint,"game-id":this.gameId,language:this.language,"client-styling":this.clientStyling,"client-styling-url-content":this.clientStylingUrlContent})),a("helper-modal",{"title-modal":"Success",visible:this.successVisible,"client-styling":this.clientStyling,"client-styling-url-content":this.clientStylingUrlContent},a("p",{class:"SubmitModalSuccess"},l("modalSuccess",this.language))),a("helper-modal",{"title-modal":"Delete Ticket",visible:this.deleteVisible,"client-styling":this.clientStyling,"client-styling-url-content":this.clientStylingUrlContent},a("div",{class:"DeleteTicketModalWrapper"},a("h3",{class:"DeleteTicketModalTitle"},l("deleteTicketModalTitle",this.language)),a("p",{class:"DeleteTicketModalText"},l("deleteTicketModalText",this.language)),a("div",{class:"DeleteTicketModalButtons"},a("button",{class:"DeleteTicketModalCancel",onClick:()=>this.modalCloseEvent()},l("deleteTicketModalCancel",this.language)),a("button",{class:"DeleteTicketModalConfirm",onClick:()=>this.confirmDeleteTicketHandler(this.deleteEventData)},l("deleteTicketModalConfirm",this.language))))))}static get assetsDirs(){return["static"]}get element(){return r(this)}};p.style=d;export{p as lottery_game_page};
2
+ //# sourceMappingURL=p-f399eef1.entry.js.map