@everymatrix/lottery-ticket-controller 0.1.23 → 1.0.69

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 (58) hide show
  1. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  2. package/dist/cjs/helper-accordion_5.cjs.entry.js +574 -671
  3. package/dist/cjs/index-2275f129.js +1304 -0
  4. package/dist/cjs/loader.cjs.js +7 -13
  5. package/dist/cjs/lottery-ticket-controller.cjs.js +17 -11
  6. package/dist/collection/collection-manifest.json +3 -3
  7. package/dist/collection/components/lottery-ticket-controller/index.js +1 -0
  8. package/dist/collection/components/lottery-ticket-controller/lottery-ticket-controller.css +182 -0
  9. package/dist/collection/components/lottery-ticket-controller/lottery-ticket-controller.js +371 -376
  10. package/dist/collection/utils/locale.utils.js +18 -15
  11. package/dist/collection/utils/utils.js +1 -1
  12. package/dist/esm/app-globals-0f993ce5.js +3 -0
  13. package/dist/esm/helper-accordion_5.entry.js +574 -671
  14. package/dist/esm/index-cf1a7f99.js +1277 -0
  15. package/dist/esm/loader.js +7 -13
  16. package/dist/esm/lottery-ticket-controller.js +14 -11
  17. package/dist/lottery-ticket-controller/lottery-ticket-controller.esm.js +1 -1
  18. package/dist/lottery-ticket-controller/p-1846ecd7.entry.js +1 -0
  19. package/dist/lottery-ticket-controller/p-e1255160.js +1 -0
  20. package/dist/lottery-ticket-controller/p-ee226061.js +2 -0
  21. package/dist/stencil.config.dev.js +17 -0
  22. package/dist/stencil.config.js +14 -19
  23. package/dist/types/Users/raul.vasile/workspace/everymatrix/widgets-monorepo/packages/stencil/lottery-ticket-controller/.stencil/packages/stencil/lottery-ticket-controller/stencil.config.d.ts +2 -0
  24. package/dist/types/Users/raul.vasile/workspace/everymatrix/widgets-monorepo/packages/stencil/lottery-ticket-controller/.stencil/packages/stencil/lottery-ticket-controller/stencil.config.dev.d.ts +2 -0
  25. package/dist/types/components/lottery-ticket-controller/index.d.ts +1 -0
  26. package/dist/types/components/lottery-ticket-controller/lottery-ticket-controller.d.ts +70 -66
  27. package/dist/types/components.d.ts +24 -1
  28. package/dist/types/stencil-public-runtime.d.ts +142 -33
  29. package/loader/cdn.js +1 -3
  30. package/loader/index.cjs.js +1 -3
  31. package/loader/index.d.ts +13 -1
  32. package/loader/index.es2017.js +1 -3
  33. package/loader/index.js +1 -3
  34. package/loader/package.json +1 -0
  35. package/package.json +11 -4
  36. package/dist/cjs/index-dd94b8db.js +0 -1275
  37. package/dist/components/helper-accordion.js +0 -6
  38. package/dist/components/helper-accordion2.js +0 -156
  39. package/dist/components/index.d.ts +0 -26
  40. package/dist/components/index.js +0 -1
  41. package/dist/components/lottery-bullet.js +0 -6
  42. package/dist/components/lottery-bullet2.js +0 -91
  43. package/dist/components/lottery-grid.js +0 -6
  44. package/dist/components/lottery-grid2.js +0 -236
  45. package/dist/components/lottery-ticket-controller.d.ts +0 -11
  46. package/dist/components/lottery-ticket-controller.js +0 -176
  47. package/dist/components/lottery-ticket.js +0 -6
  48. package/dist/components/lottery-ticket2.js +0 -263
  49. package/dist/esm/index-74cef6d4.js +0 -1249
  50. package/dist/esm/polyfills/core-js.js +0 -11
  51. package/dist/esm/polyfills/css-shim.js +0 -1
  52. package/dist/esm/polyfills/dom.js +0 -79
  53. package/dist/esm/polyfills/es5-html-element.js +0 -1
  54. package/dist/esm/polyfills/index.js +0 -34
  55. package/dist/esm/polyfills/system.js +0 -6
  56. package/dist/lottery-ticket-controller/p-72e48800.js +0 -1
  57. package/dist/lottery-ticket-controller/p-9a5da031.entry.js +0 -1
  58. package/dist/types/Users/dragos.bodea/Documents/everymatrix-prjs/stencil/widgets-stencil/packages/lottery-ticket-controller/.stencil/packages/lottery-ticket-controller/stencil.config.d.ts +0 -2
@@ -1,176 +0,0 @@
1
- import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
- import { d as defineCustomElement$5 } from './helper-accordion2.js';
3
- import { d as defineCustomElement$4 } from './lottery-bullet2.js';
4
- import { d as defineCustomElement$3 } from './lottery-grid2.js';
5
- import { d as defineCustomElement$2 } from './lottery-ticket2.js';
6
-
7
- const DEFAULT_LANGUAGE = 'en';
8
- const SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'ar'];
9
- const TRANSLATIONS = {
10
- en: {
11
- ticket: 'Ticket',
12
- },
13
- ro: {
14
- ticket: 'Bilet',
15
- },
16
- fr: {
17
- ticket: 'Billet'
18
- },
19
- ar: {
20
- ticket: 'تذكرة',
21
- }
22
- };
23
- const translate = (key, customLang) => {
24
- const lang = customLang;
25
- return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
26
- };
27
-
28
- const lotteryTicketControllerCss = ":host{display:block}";
29
-
30
- const LotteryTicketController$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
31
- constructor() {
32
- super();
33
- this.__registerHost();
34
- this.__attachShadow();
35
- this.deleteTicketEvent = createEvent(this, "deleteTicket", 7);
36
- /**
37
- * Endpoint URL for the source of data (NorWAy standard)
38
- */
39
- this.endpoint = '';
40
- /**
41
- * Ticket number
42
- */
43
- this.ticketId = 1;
44
- /**
45
- * Activates postMessages as events for actions from the widget
46
- */
47
- this.postMessage = false;
48
- /**
49
- * Name of the event emitter by the action button
50
- */
51
- this.eventName = 'deleteTicketAction';
52
- /**
53
- * Collapsed
54
- */
55
- this.collapsed = true;
56
- /**
57
- * Number of grids?
58
- */
59
- this.numberOfGrids = 1;
60
- /**
61
- * This toggles if the last ticket added should be expanded or not
62
- */
63
- this.last = false;
64
- /**
65
- * Language
66
- */
67
- this.language = 'en';
68
- /**
69
- * Shows the auto-pick button
70
- */
71
- this.autoPick = false;
72
- /**
73
- * Shows the reset button
74
- */
75
- this.resetButton = false;
76
- /**
77
- * Client custom styling via string
78
- */
79
- this.clientStyling = '';
80
- /**
81
- * Client custom styling via url content
82
- */
83
- this.clientStylingUrlContent = '';
84
- this.limitStylingAppends = false;
85
- this.setClientStyling = () => {
86
- let sheet = document.createElement('style');
87
- sheet.innerHTML = this.clientStyling;
88
- this.stylingContainer.prepend(sheet);
89
- };
90
- this.setClientStylingURL = () => {
91
- let cssFile = document.createElement('style');
92
- setTimeout(() => {
93
- cssFile.innerHTML = this.clientStylingUrlContent;
94
- this.stylingContainer.prepend(cssFile);
95
- }, 1);
96
- };
97
- }
98
- // @TODO fix the `any` type
99
- helperAccordionActionHandler() {
100
- if (this.postMessage) {
101
- window.postMessage({ type: this.eventName }, window.location.href);
102
- }
103
- this.deleteTicketEvent.emit({
104
- ticketId: this.ticketId
105
- });
106
- }
107
- componentDidRender() {
108
- // start custom styling area
109
- if (!this.limitStylingAppends && this.stylingContainer) {
110
- if (this.clientStyling)
111
- this.setClientStyling();
112
- if (this.clientStylingUrlContent)
113
- this.setClientStylingURL();
114
- this.limitStylingAppends = true;
115
- }
116
- // end custom styling area
117
- }
118
- render() {
119
- return (h("div", { class: "LotteryTicketControllerContainer", ref: el => this.stylingContainer = el }, h("helper-accordion", { "header-title": `${translate('ticket', this.language)} ${this.ticketId}`, "header-subtitle": this.ticketDescription, footer: true, "delete-tab": true, collapsed: !this.last || this.collapsed, language: this.language, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }, h("div", { slot: "accordionContent" }, 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 })))));
120
- }
121
- static get style() { return lotteryTicketControllerCss; }
122
- }, [1, "lottery-ticket-controller", {
123
- "endpoint": [1],
124
- "ticketId": [2, "ticket-id"],
125
- "ticketDescription": [1, "ticket-description"],
126
- "gameId": [1, "game-id"],
127
- "postMessage": [4, "post-message"],
128
- "eventName": [1, "event-name"],
129
- "collapsed": [4],
130
- "numberOfGrids": [2, "number-of-grids"],
131
- "last": [4],
132
- "language": [1],
133
- "autoPick": [4, "auto-pick"],
134
- "resetButton": [4, "reset-button"],
135
- "clientStyling": [1, "client-styling"],
136
- "clientStylingUrlContent": [1, "client-styling-url-content"],
137
- "limitStylingAppends": [32]
138
- }, [[0, "helperAccordionAction", "helperAccordionActionHandler"]]]);
139
- function defineCustomElement$1() {
140
- if (typeof customElements === "undefined") {
141
- return;
142
- }
143
- const components = ["lottery-ticket-controller", "helper-accordion", "lottery-bullet", "lottery-grid", "lottery-ticket"];
144
- components.forEach(tagName => { switch (tagName) {
145
- case "lottery-ticket-controller":
146
- if (!customElements.get(tagName)) {
147
- customElements.define(tagName, LotteryTicketController$1);
148
- }
149
- break;
150
- case "helper-accordion":
151
- if (!customElements.get(tagName)) {
152
- defineCustomElement$5();
153
- }
154
- break;
155
- case "lottery-bullet":
156
- if (!customElements.get(tagName)) {
157
- defineCustomElement$4();
158
- }
159
- break;
160
- case "lottery-grid":
161
- if (!customElements.get(tagName)) {
162
- defineCustomElement$3();
163
- }
164
- break;
165
- case "lottery-ticket":
166
- if (!customElements.get(tagName)) {
167
- defineCustomElement$2();
168
- }
169
- break;
170
- } });
171
- }
172
-
173
- const LotteryTicketController = LotteryTicketController$1;
174
- const defineCustomElement = defineCustomElement$1;
175
-
176
- export { LotteryTicketController, defineCustomElement };
@@ -1,6 +0,0 @@
1
- import { L as LotteryTicket$1, d as defineCustomElement$1 } from './lottery-ticket2.js';
2
-
3
- const LotteryTicket = LotteryTicket$1;
4
- const defineCustomElement = defineCustomElement$1;
5
-
6
- export { LotteryTicket, defineCustomElement };
@@ -1,263 +0,0 @@
1
- import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
- import { d as defineCustomElement$2 } from './lottery-bullet2.js';
3
- import { d as defineCustomElement$1 } from './lottery-grid2.js';
4
-
5
- const DEFAULT_LANGUAGE = 'en';
6
- const SUPPORTED_LANGUAGES = ['ro', 'en'];
7
- const TRANSLATIONS = {
8
- en: {
9
- loading: 'Loading, please wait ...',
10
- error: 'It was an error while trying to fetch the data',
11
- grid: 'Grid',
12
- multiplier: 'Multiplier',
13
- numberOfDraws: 'Number of draws',
14
- wagerPerDraw: 'Wager per draw',
15
- resetButton: 'Reset',
16
- autoButton: 'I feel lucky'
17
- },
18
- ro: {
19
- loading: 'Se incarca, va rugam asteptati ...',
20
- error: 'A fost o eroare in timp ce asteptam datele',
21
- grid: 'Grid',
22
- multiplier: 'Multiplicator',
23
- numberOfDraws: 'Numarul de extrageri',
24
- wagerPerDraw: 'Pariul per extragere',
25
- resetButton: 'Reseteaza',
26
- autoButton: 'Ma simt norocos'
27
- },
28
- fr: {
29
- loading: 'Loading, please wait ...',
30
- error: 'It was an error while trying to fetch the data',
31
- grid: 'Grid',
32
- multiplier: 'Multiplier',
33
- numberOfDraws: 'Number of draws',
34
- wagerPerDraw: 'Wager per draw',
35
- resetButton: 'Reset',
36
- autoButton: 'I feel lucky'
37
- },
38
- ar: {
39
- loading: 'Loading, please wait ...',
40
- error: 'It was an error while trying to fetch the data',
41
- grid: 'Grid',
42
- multiplier: 'Multiplier',
43
- numberOfDraws: 'Number of draws',
44
- wagerPerDraw: 'Wager per draw',
45
- resetButton: 'Reset',
46
- autoButton: 'I feel lucky'
47
- }
48
- };
49
- const translate = (key, customLang) => {
50
- const lang = customLang;
51
- return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
52
- };
53
-
54
- const lotteryTicketCss = "@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}";
55
-
56
- const LotteryTicket = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
57
- constructor() {
58
- super();
59
- this.__registerHost();
60
- this.__attachShadow();
61
- this.ticketCompleted = createEvent(this, "ticketCompleted", 7);
62
- this.autoSelection = createEvent(this, "autoSelection", 7);
63
- this.resetSelection = createEvent(this, "resetSelection", 7);
64
- this.stakeChange = createEvent(this, "stakeChange", 7);
65
- this.multiplierChange = createEvent(this, "multiplierChange", 7);
66
- /**
67
- * Number of grids of a ticket
68
- */
69
- this.numberOfGrids = 1;
70
- /**
71
- * Option to have the ticket registered for multiple draws
72
- */
73
- this.multipleDraws = true;
74
- /**
75
- * Shows the reset button
76
- */
77
- this.resetButton = false;
78
- /**
79
- * Shows the auto-pick button
80
- */
81
- this.autoPick = false;
82
- /**
83
- * Language
84
- */
85
- this.language = 'en';
86
- /**
87
- * Client custom styling via string
88
- */
89
- this.clientStyling = '';
90
- /**
91
- * Client custom styling via url content
92
- */
93
- this.clientStylingUrlContent = '';
94
- this.multiplier = false;
95
- this.numberOfDraws = 1;
96
- this.isLoading = true;
97
- this.hasErrors = false;
98
- this.ticketDone = false;
99
- this.isCustomSelect = false;
100
- this.amountInfo = {};
101
- this.limitStylingAppends = false;
102
- this.setClientStyling = () => {
103
- let sheet = document.createElement('style');
104
- sheet.innerHTML = this.clientStyling;
105
- this.stylingContainer.prepend(sheet);
106
- };
107
- this.setClientStylingURL = () => {
108
- let cssFile = document.createElement('style');
109
- setTimeout(() => {
110
- cssFile.innerHTML = this.clientStylingUrlContent;
111
- this.stylingContainer.prepend(cssFile);
112
- }, 1);
113
- };
114
- }
115
- /**
116
- * @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
117
- */
118
- checkForClickOutside(ev) {
119
- if (ev.composedPath()[0].getAttribute('data-cluster') !== 'SelectComponent') {
120
- this.isCustomSelect = false;
121
- }
122
- }
123
- connectedCallback() {
124
- let url = new URL(`${this.endpoint}/games/${this.gameId}`);
125
- fetch(url.href)
126
- .then((response) => {
127
- if (response.ok) {
128
- return response.json();
129
- }
130
- else {
131
- // Throw error
132
- this.hasErrors = true;
133
- }
134
- })
135
- .then((data) => {
136
- this.isLoading = false;
137
- this.gameData = data;
138
- this.grids = [...Array(data.rules.boards.length).keys()];
139
- this.amountInfo = this.gameData.rules.stakes[0]; // initial value for select
140
- })
141
- .catch((err) => {
142
- this.isLoading = false;
143
- this.hasErrors = true;
144
- console.error('Error!', err);
145
- });
146
- }
147
- componentDidRender() {
148
- // start custom styling area
149
- if (!this.limitStylingAppends && this.stylingContainer) {
150
- if (this.clientStyling)
151
- this.setClientStyling();
152
- if (this.clientStylingUrlContent)
153
- this.setClientStylingURL();
154
- this.limitStylingAppends = true;
155
- }
156
- // end custom styling area
157
- }
158
- multiplierChangeHandler(e) {
159
- this.multiplier = e.target ? e.target.checked : false;
160
- this.multiplierChange.emit(this.multiplier);
161
- }
162
- drawsChangeHandler(event) {
163
- this.ticket = Object.assign(Object.assign({}, this.ticket), { draws: event });
164
- this.ticketCompleted.emit(this.ticket);
165
- }
166
- gridFilledHandler(event) {
167
- this.ticket = Object.assign(Object.assign({}, event.detail), { draws: this.numberOfDraws });
168
- this.ticketDone = true;
169
- this.ticketCompleted.emit(this.ticket);
170
- }
171
- toggleAutoSelection() {
172
- this.ticketDone = true;
173
- this.autoSelection.emit(this.ticketId);
174
- }
175
- toggleResetSelection() {
176
- this.ticketDone = false;
177
- this.resetSelection.emit(this.ticketId);
178
- }
179
- changeStake(ticketid, amount) {
180
- this.stakeChange.emit({
181
- ticketId: ticketid,
182
- stake: amount
183
- });
184
- }
185
- toggleClass() {
186
- this.isCustomSelect = !this.isCustomSelect;
187
- }
188
- setDropdownItem(item) {
189
- this.amountInfo = {
190
- amount: item.amount,
191
- currency: item.currency
192
- };
193
- this.isCustomSelect = false;
194
- this.changeStake(this.ticketId, item.amount);
195
- }
196
- render() {
197
- if (this.isLoading) {
198
- return (h("div", null, h("p", null, translate('loading', this.language))));
199
- }
200
- else {
201
- if (this.hasErrors) {
202
- return (h("div", null, h("p", null, translate('error', this.language))));
203
- }
204
- else {
205
- const { rules } = this.gameData;
206
- return (h("div", { class: "TicketContainer", ref: el => this.stylingContainer = el }, h("p", { class: "TicketTitle" }, this.gameData.name), this.resetButton && this.ticketDone &&
207
- h("div", { class: "ButtonContainer" }, h("a", { class: "ResetButton", onClick: () => this.toggleResetSelection() }, translate('resetButton', this.language))), this.autoPick && !this.ticketDone &&
208
- h("div", { class: "ButtonContainer" }, h("a", { class: "AutoButton", onClick: () => this.toggleAutoSelection() }, translate('autoButton', this.language))), this.grids.map((item, index) => h("div", { class: "TicketGridBullets" }, h("p", { class: "TicketGridTitle" }, translate('grid', this.language), " ", item), h("lottery-grid", { "grid-index": index, "maximum-allowed": rules.boards[index].maximumAllowed, "minimum-allowed": rules.boards[index].minimumAllowed, "total-numbers": rules.boards[index].totalNumbers, 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 }))), rules.multiplier &&
209
- h("div", null, h("label", { class: "Toggle" }, h("label", { class: "Label" }, translate('multiplier', this.language), ": "), h("input", { class: "ToggleCheckbox", type: "checkbox", onInput: (e) => this.multiplierChangeHandler(e) }), h("div", { class: "ToggleSwitch" }))), this.multipleDraws &&
210
- h("div", { class: "TicketDraws" }, h("label", { class: "Label" }, translate('numberOfDraws', this.language), ": "), h("div", { class: "NumberInput" }, h("button", { onClick: () => this.numberOfDraws > 1 ? this.numberOfDraws-- : this.numberOfDraws = 1, class: "Minus" }, "-"), h("input", { class: "InputDefault", min: "1", value: this.numberOfDraws, type: "number" }), h("button", { onClick: () => this.numberOfDraws++, class: "Plus" }, "+"))), h("div", null, h("label", { class: "Label" }, translate('wagerPerDraw', this.language), ": "), h("div", { class: "WagerInput" }, rules.stakes.length > 1 ?
211
- (h("div", { "data-cluster": "SelectComponent", class: this.isCustomSelect ? "SelectWrapper SelectActive" : "SelectWrapper" }, h("div", { "data-cluster": "SelectComponent", class: "SelectButton", onClick: () => this.toggleClass() }, h("span", { "data-cluster": "SelectComponent" }, this.amountInfo.amount, " ", this.amountInfo.currency), h("span", { "data-cluster": "SelectComponent", class: "SelectExpand" }, "\u25BC")), h("div", { "data-cluster": "SelectComponent", class: "SelectContent" }, h("ul", { "data-cluster": "SelectComponent", class: "SelectOptions" }, rules.stakes.map((item) => h("li", { "data-cluster": "SelectComponent", class: this.amountInfo.amount == item.amount ? 'SelectedValue' : '', value: item.amount, onClick: () => this.setDropdownItem(item) }, item.amount, " ", item.currency)))))) : (h("div", null, h("input", { min: "1", value: rules.stakes[0].amount, type: "number", disabled: true }), h("p", { class: "WagerInputTitle" }, rules.stakes[0].currency)))))));
212
- }
213
- }
214
- }
215
- static get watchers() { return {
216
- "numberOfDraws": ["drawsChangeHandler"]
217
- }; }
218
- static get style() { return lotteryTicketCss; }
219
- }, [1, "lottery-ticket", {
220
- "endpoint": [1],
221
- "gameId": [1, "game-id"],
222
- "numberOfGrids": [2, "number-of-grids"],
223
- "multipleDraws": [4, "multiple-draws"],
224
- "ticketId": [2, "ticket-id"],
225
- "resetButton": [4, "reset-button"],
226
- "autoPick": [4, "auto-pick"],
227
- "language": [1],
228
- "clientStyling": [1, "client-styling"],
229
- "clientStylingUrlContent": [1, "client-styling-url-content"],
230
- "multiplier": [32],
231
- "numberOfDraws": [32],
232
- "isLoading": [32],
233
- "hasErrors": [32],
234
- "ticketDone": [32],
235
- "isCustomSelect": [32],
236
- "amountInfo": [32],
237
- "limitStylingAppends": [32]
238
- }, [[8, "click", "checkForClickOutside"], [0, "gridFilled", "gridFilledHandler"]]]);
239
- function defineCustomElement() {
240
- if (typeof customElements === "undefined") {
241
- return;
242
- }
243
- const components = ["lottery-ticket", "lottery-bullet", "lottery-grid"];
244
- components.forEach(tagName => { switch (tagName) {
245
- case "lottery-ticket":
246
- if (!customElements.get(tagName)) {
247
- customElements.define(tagName, LotteryTicket);
248
- }
249
- break;
250
- case "lottery-bullet":
251
- if (!customElements.get(tagName)) {
252
- defineCustomElement$2();
253
- }
254
- break;
255
- case "lottery-grid":
256
- if (!customElements.get(tagName)) {
257
- defineCustomElement$1();
258
- }
259
- break;
260
- } });
261
- }
262
-
263
- export { LotteryTicket as L, defineCustomElement as d };