@everymatrix/casino-challenges-claim-code 0.0.1

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 (59) hide show
  1. package/dist/casino-challenges-claim-code/app-globals-0f993ce5.js +1 -0
  2. package/dist/casino-challenges-claim-code/casino-challenges-claim-code-746b4197.js +1 -0
  3. package/dist/casino-challenges-claim-code/casino-challenges-claim-code.entry.js +1 -0
  4. package/dist/casino-challenges-claim-code/casino-challenges-claim-code.esm.js +1 -0
  5. package/dist/casino-challenges-claim-code/index-05d7637d.js +2 -0
  6. package/dist/casino-challenges-claim-code/index.esm.js +1 -0
  7. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  8. package/dist/cjs/casino-challenges-claim-code-a4324416.js +214 -0
  9. package/dist/cjs/casino-challenges-claim-code.cjs.entry.js +10 -0
  10. package/dist/cjs/casino-challenges-claim-code.cjs.js +25 -0
  11. package/dist/cjs/index-718e2d1c.js +1214 -0
  12. package/dist/cjs/index.cjs.js +10 -0
  13. package/dist/cjs/loader.cjs.js +15 -0
  14. package/dist/collection/collection-manifest.json +12 -0
  15. package/dist/collection/components/casino-challenges-claim-code/casino-challenges-claim-code.css +81 -0
  16. package/dist/collection/components/casino-challenges-claim-code/casino-challenges-claim-code.js +300 -0
  17. package/dist/collection/components/casino-challenges-claim-code/index.js +1 -0
  18. package/dist/collection/index.js +1 -0
  19. package/dist/collection/utils/locale.utils.js +43 -0
  20. package/dist/collection/utils/types.js +1 -0
  21. package/dist/collection/utils/utils.js +3 -0
  22. package/dist/esm/app-globals-0f993ce5.js +3 -0
  23. package/dist/esm/casino-challenges-claim-code-746b4197.js +212 -0
  24. package/dist/esm/casino-challenges-claim-code.entry.js +2 -0
  25. package/dist/esm/casino-challenges-claim-code.js +20 -0
  26. package/dist/esm/index-05d7637d.js +1187 -0
  27. package/dist/esm/index.js +2 -0
  28. package/dist/esm/loader.js +11 -0
  29. package/dist/index.cjs.js +1 -0
  30. package/dist/index.js +1 -0
  31. package/dist/stencil.config.dev.js +19 -0
  32. package/dist/stencil.config.js +19 -0
  33. package/dist/storybook/main.js +43 -0
  34. package/dist/storybook/preview.js +9 -0
  35. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/casino-challenges-claim-code/.stencil/libs/common/src/storybook/storybook-utils.d.ts +39 -0
  36. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/casino-challenges-claim-code/.stencil/packages/stencil/casino-challenges-claim-code/stencil.config.d.ts +2 -0
  37. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/casino-challenges-claim-code/.stencil/packages/stencil/casino-challenges-claim-code/stencil.config.dev.d.ts +2 -0
  38. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/casino-challenges-claim-code/.stencil/packages/stencil/casino-challenges-claim-code/storybook/main.d.ts +3 -0
  39. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/casino-challenges-claim-code/.stencil/packages/stencil/casino-challenges-claim-code/storybook/preview.d.ts +70 -0
  40. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/casino-challenges-claim-code/.stencil/tools/plugins/index.d.ts +4 -0
  41. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/casino-challenges-claim-code/.stencil/tools/plugins/lazy-load-chunk-plugin.d.ts +12 -0
  42. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/casino-challenges-claim-code/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +5 -0
  43. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/casino-challenges-claim-code/.stencil/tools/plugins/vite-chunk-plugin.d.ts +6 -0
  44. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/casino-challenges-claim-code/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +4 -0
  45. package/dist/types/components/casino-challenges-claim-code/casino-challenges-claim-code.d.ts +56 -0
  46. package/dist/types/components/casino-challenges-claim-code/index.d.ts +1 -0
  47. package/dist/types/components.d.ts +119 -0
  48. package/dist/types/index.d.ts +1 -0
  49. package/dist/types/stencil-public-runtime.d.ts +1674 -0
  50. package/dist/types/utils/locale.utils.d.ts +3 -0
  51. package/dist/types/utils/types.d.ts +15 -0
  52. package/dist/types/utils/utils.d.ts +1 -0
  53. package/loader/cdn.js +1 -0
  54. package/loader/index.cjs.js +1 -0
  55. package/loader/index.d.ts +24 -0
  56. package/loader/index.es2017.js +1 -0
  57. package/loader/index.js +2 -0
  58. package/loader/package.json +11 -0
  59. package/package.json +27 -0
@@ -0,0 +1 @@
1
+ const o=()=>{};export{o as g}
@@ -0,0 +1 @@
1
+ import{r as e,c as t,h as n}from"./index-05d7637d.js";function o(e,t){if(e){const n=document.createElement("style");n.innerHTML=t,e.appendChild(n)}}function i(e,t){const n=new URL(t);fetch(n.href).then((e=>e.text())).then((t=>{const n=document.createElement("style");n.innerHTML=t,e&&e.appendChild(n)})).catch((e=>{console.error("There was an error while trying to load client styling from URL",e)}))}function r(e,t){if(window.emMessageBus){const n=document.createElement("style");window.emMessageBus.subscribe(t,(t=>{n.innerHTML=t,e&&e.appendChild(n)}))}}const s={en:{title:"Enter the secret code to unlock hidden quests and rewards.",btnText:"Apply code",successMessage:"The code was successfully applied.",inputLabel:"3–30 characters, no spaces",lengthMinError:"Code must be at least 3 characters",lengthMaxError:"Too long — max 30 characters",formatError:"Invalid code format. Please use only Latin letters (case-sensitive), numbers, and special characters.",genericError:"Something went wrong, please retry"},ro:{},fr:{},ar:{},hr:{}},a=(e,t)=>s[void 0!==t&&t in s?t:"en"][e],c=class{constructor(n){e(this,n),this.openNotification=t(this,"openNotification",7),this.asciiPrintableRegex=/^[\x21-\x7E]+$/,this.handleSubmit=async()=>{if(this.endpoint&&this.session&&this.domain){const e=await this.applyCode();e.Success?this.openNotification.emit({message:a("successMessage",this.language)}):(this.hasError=!0,this.openNotification.emit({message:e.ErrorMessage,errored:!0,showTabLink:3002===e.ErrorCode||3023===e.ErrorCode||3003===e.ErrorCode}))}},this.applyCode=async()=>(this.loading=!0,fetch(`${this.endpoint}/challenge/GrantChallengeByCode`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({DomainId:this.domain,PlayerSessionId:this.session,ActivationCode:this.code})}).then((e=>e.json())).finally((()=>this.loading=!1))),this.handleInput=e=>{this.code=e.target.value,this.debounceTime&&clearTimeout(this.debounceTime),this.debounceTime=setTimeout((()=>{this.hasError=!this.validate(this.code)}),200)},this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.translationUrl="",this.language="en",this.endpoint="",this.domain="",this.session="",this.loading=!1,this.hasError=!1,this.code="",this.notificationMessage=""}handleClientStylingChange(e,t){e!=t&&o(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(e,t){e!=t&&i(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(e,t){e!=t&&r(this.stylingContainer,`${this.mbSource}.Style`)}componentWillLoad(){this.translationUrl&&(async e=>{if(e)try{const n=await fetch(e);if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);const o=await n.json();t=o,Object.keys(t).forEach((e=>{for(let n in t[e])s[e][n]=t[e][n]}))}catch(e){console.error("Failed to fetch or parse translations from URL:",e)}var t})(this.translationUrl)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&r(this.stylingContainer,`${this.mbSource}.Style`),this.clientStyling&&o(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&i(this.stylingContainer,this.clientStylingUrl))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}validate(e){return e.length>=3&&e.length<=30&&this.asciiPrintableRegex.test(e)}render(){return n("div",{key:"241aeeb9f0f0984bbf0367a7c925e0b84ef15fa0",ref:e=>this.stylingContainer=e},n("div",{key:"f20ec43253905cb0e9a356f65d1e51e695f784cf",class:"container"},n("p",{key:"a4c3b0ca894db101c192f7c62ff141ec51eaede1",class:"container__title"},a("title",this.language)),n("input",{key:"c99bdd43659c9d2fc06702fe041eab8458bb0ee5",class:"code-input "+(this.hasError?"errored":""),type:"text",placeholder:"e.g. SPRING24",onInput:this.handleInput}),n("p",{key:"c2aacc2d4a23c7d222f895dce3a3a47b8f03f587",class:"code-input__text"},a("inputLabel",this.language)),n("button",{key:"51e79d07278368567026d31b0c70e8c9f0eb4840",class:"container__button",onClick:this.handleSubmit,disabled:this.loading||!this.code||this.hasError},a("btnText",this.language))))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};c.style=".container {\n display: flex;\n flex-direction: column;\n align-items: center;\n padding: 80px 0;\n text-align: center;\n}\n.container__title {\n font-size: var(--emw--font-size-medium-plus, 18px);\n font-weight: var(--emw--font-weight-medium, 500);\n line-height: 22px;\n color: var(--emw--color-white, white);\n margin: 0 0 32px;\n}\n.container__button {\n margin-top: 45px;\n padding: 14px 20px;\n background: transparent;\n text-transform: uppercase;\n border-radius: var(--emw--button-border-radius, 99px);\n border: 2px solid var(--emw--button-border-color, #083B17);\n font-size: var(--emw--font-size-x-small, 12px);\n font-weight: var(--emw--font-weight-bold, 700);\n color: var(--emw--color-white, #FFFFFF);\n background-color: var(--emw--button-background-color, #18CE51);\n cursor: pointer;\n}\n.container__button:hover {\n color: var(--emw--color-gray-300, #083B17);\n border-color: transparent;\n box-shadow: 0 0 4px 0 rgba(188, 252, 177, 0.2), 0 0 20px 0 rgba(0, 183, 79, 0.5);\n}\n.container__button:disabled, .container__button:disabled:hover {\n color: var(--emw--color-gray-50, #E2E2E2);\n border: 2px solid var(--emw--button-border-color, #083B17);\n opacity: 0.7;\n cursor: not-allowed;\n}\n@container challenges-container (max-width: 576px) {\n .container__button {\n width: calc(100% - 32px);\n position: absolute;\n bottom: 50px;\n }\n}\n\n.code-input {\n border: 1px solid var(--emw--button-border-color, #083B17);\n background: var(--emw--color-background-secondary, rgba(221, 255, 207, 0.1019607843));\n border-radius: 6px;\n padding: 12px 0;\n line-height: 24px;\n color: var(--emw--color-white, #FFFFFF);\n text-align: center;\n font-size: var(--emw--font-size-medium, 16px);\n min-width: 340px;\n}\n.code-input:focus {\n outline: 1px solid var(--emw--border-success-color, #00B74F);\n}\n.code-input:focus.errored {\n outline-color: var(--emw--color-error, #D6421E);\n}\n.code-input.errored {\n border-color: var(--emw--color-error, #D6421E);\n}\n.code-input__text {\n margin: 8px 0 0;\n line-height: 22px;\n font-size: var(--emw--font-size-x-small, 12px);\n font-weight: var(--emw--font-weight-medium, 500);\n color: var(--emw--color-gray-150, #C8D6CE);\n}\n.code-input__text.errored {\n color: var(--emw--color-error, #D6421E);\n}\n@container challenges-container (max-width: 576px) {\n .code-input {\n min-width: 100%;\n }\n}";export{c as C}
@@ -0,0 +1 @@
1
+ export{C as casino_challenges_claim_code}from"./casino-challenges-claim-code-746b4197.js";import"./index-05d7637d.js";
@@ -0,0 +1 @@
1
+ import{p as n,b as e}from"./index-05d7637d.js";export{s as setNonce}from"./index-05d7637d.js";import{g as l}from"./app-globals-0f993ce5.js";(()=>{const e=import.meta.url,l={};return""!==e&&(l.resourcesUrl=new URL(".",e).href),n(l)})().then((async n=>(await l(),e([["casino-challenges-claim-code",[[1,"casino-challenges-claim-code",{mbSource:[513,"mb-source"],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],translationUrl:[513,"translation-url"],language:[513],endpoint:[513],domain:[513],session:[513],loading:[32],hasError:[32],code:[32],notificationMessage:[32]},null,{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}]]]],n))));
@@ -0,0 +1,2 @@
1
+ var e=Object.defineProperty,t=new WeakMap,n=e=>t.get(e),l=(e,n)=>t.set(n.t=e,n),o=(e,t)=>t in e,s=(e,t)=>(0,console.error)(e,t),r=new Map,i=new Map,c="slot-fb{display:contents}slot-fb[hidden]{display:none}",u="undefined"!=typeof window?window:{},a=u.document||{head:{}},f={l:0,o:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},h=e=>Promise.resolve(e),d=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1})(),m=!1,p=[],y=[],$=(e,t)=>n=>{e.push(n),m||(m=!0,t&&4&f.l?v(w):f.raf(w))},b=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){s(e)}e.length=0},w=()=>{b(p),b(y),(m=p.length>0)&&f.raf(w)},v=e=>h().then(e),g=$(y,!0),S={},j=e=>"object"==(e=typeof e)||"function"===e;function k(e){var t,n,l;return null!=(l=null==(n=null==(t=e.head)?void 0:t.querySelector('meta[name="csp-nonce"]'))?void 0:n.getAttribute("content"))?l:void 0}((t,n)=>{for(var l in n)e(t,l,{get:n[l],enumerable:!0})})({},{err:()=>E,map:()=>C,ok:()=>O,unwrap:()=>P,unwrapErr:()=>L});var O=e=>({isOk:!0,isErr:!1,value:e}),E=e=>({isOk:!1,isErr:!0,value:e});function C(e,t){if(e.isOk){const n=t(e.value);return n instanceof Promise?n.then((e=>O(e))):O(n)}if(e.isErr)return E(e.value);throw"should never get here"}var M,x,P=e=>{if(e.isOk)return e.value;throw e.value},L=e=>{if(e.isErr)return e.value;throw e.value},R=(e,t,...n)=>{let l=null,o=null,s=!1,r=!1;const i=[],c=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?c(l):null!=l&&"boolean"!=typeof l&&((s="function"!=typeof e&&!j(l))&&(l+=""),s&&r?i[i.length-1].i+=l:i.push(s?T(null,l):l),r=s)};if(c(n),t){t.key&&(o=t.key);{const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}}const u=T(e,null);return u.u=t,i.length>0&&(u.h=i),u.m=o,u},T=(e,t)=>({l:0,p:e,i:t,$:null,h:null,u:null,m:null}),A={},N=(e,t,l)=>{const o=(e=>n(e).$hostElement$)(e);return{emit:e=>U(o,t,{bubbles:!!(4&l),composed:!!(2&l),cancelable:!!(1&l),detail:e})}},U=(e,t,n)=>{const l=f.ce(t,n);return e.dispatchEvent(l),l},W=new WeakMap,D=e=>"sc-"+e.v,F=(e,t,n,l,s,r)=>{if(n!==l){let i=o(e,t),c=t.toLowerCase();if("class"===t){const t=e.classList,o=q(n),s=q(l);t.remove(...o.filter((e=>e&&!s.includes(e)))),t.add(...s.filter((e=>e&&!o.includes(e))))}else if("key"===t);else if("ref"===t)l&&l(e);else if(i||"o"!==t[0]||"n"!==t[1]){const o=j(l);if((i||o&&null!==l)&&!s)try{if(e.tagName.includes("-"))e[t]=l;else{const o=null==l?"":l;"list"===t?i=!1:null!=n&&e[t]==o||(e[t]=o)}}catch(e){}null==l||!1===l?!1===l&&""!==e.getAttribute(t)||e.removeAttribute(t):(!i||4&r||s)&&!o&&e.setAttribute(t,l=!0===l?"":l)}else if(t="-"===t[2]?t.slice(3):o(u,c)?c.slice(2):c[2]+t.slice(3),n||l){const o=t.endsWith(G);t=t.replace(V,""),n&&f.rel(e,t,n,o),l&&f.ael(e,t,l,o)}}},H=/\s/,q=e=>e?e.split(H):[],G="Capture",V=RegExp(G+"$"),_=(e,t,n)=>{const l=11===t.$.nodeType&&t.$.host?t.$.host:t.$,o=e&&e.u||S,s=t.u||S;for(const e of z(Object.keys(o)))e in s||F(l,e,o[e],void 0,n,t.l);for(const e of z(Object.keys(s)))F(l,e,o[e],s[e],n,t.l)};function z(e){return e.includes("ref")?[...e.filter((e=>"ref"!==e)),"ref"]:e}var B=!1,I=(e,t,n)=>{const l=t.h[n];let o,s,r=0;if(null!==l.i)o=l.$=a.createTextNode(l.i);else if(o=l.$=a.createElement(l.p),_(null,l,B),null!=M&&o["s-si"]!==M&&o.classList.add(o["s-si"]=M),l.h)for(r=0;r<l.h.length;++r)s=I(e,l,r),s&&o.appendChild(s);return o["s-hn"]=x,o},J=(e,t,n,l,o,s)=>{let r,i=e;for(i.shadowRoot&&i.tagName===x&&(i=i.shadowRoot);o<=s;++o)l[o]&&(r=I(null,n,o),r&&(l[o].$=r,Z(i,r,t)))},K=(e,t,n)=>{for(let l=t;l<=n;++l){const t=e[l];if(t){const e=t.$;Y(t),e&&e.remove()}}},Q=(e,t,n=!1)=>e.p===t.p&&(!!n||e.m===t.m),X=(e,t,n=!1)=>{const l=t.$=e.$,o=e.h,s=t.h,r=t.i;null===r?(_(e,t,B),null!==o&&null!==s?((e,t,n,l,o=!1)=>{let s,r,i=0,c=0,u=0,a=0,f=t.length-1,h=t[0],d=t[f],m=l.length-1,p=l[0],y=l[m];for(;i<=f&&c<=m;)if(null==h)h=t[++i];else if(null==d)d=t[--f];else if(null==p)p=l[++c];else if(null==y)y=l[--m];else if(Q(h,p,o))X(h,p,o),h=t[++i],p=l[++c];else if(Q(d,y,o))X(d,y,o),d=t[--f],y=l[--m];else if(Q(h,y,o))X(h,y,o),Z(e,h.$,d.$.nextSibling),h=t[++i],y=l[--m];else if(Q(d,p,o))X(d,p,o),Z(e,d.$,h.$),d=t[--f],p=l[++c];else{for(u=-1,a=i;a<=f;++a)if(t[a]&&null!==t[a].m&&t[a].m===p.m){u=a;break}u>=0?(r=t[u],r.p!==p.p?s=I(t&&t[c],n,u):(X(r,p,o),t[u]=void 0,s=r.$),p=l[++c]):(s=I(t&&t[c],n,c),p=l[++c]),s&&Z(h.$.parentNode,s,h.$)}i>f?J(e,null==l[m+1]?null:l[m+1].$,n,l,c,m):c>m&&K(t,i,f)})(l,o,t,s,n):null!==s?(null!==e.i&&(l.textContent=""),J(l,null,t,s,0,s.length-1)):null!==o&&K(o,0,o.length-1)):e.i!==r&&(l.data=r)},Y=e=>{e.u&&e.u.ref&&e.u.ref(null),e.h&&e.h.map(Y)},Z=(e,t,n)=>null==e?void 0:e.insertBefore(t,n),ee=(e,t)=>{t&&!e.S&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.S=t)))},te=(e,t)=>{if(e.l|=16,!(4&e.l))return ee(e,e.j),g((()=>ne(e,t)));e.l|=512},ne=(e,t)=>{const n=e.t;if(!n)throw Error(`Can't render component <${e.$hostElement$.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);let l;return t&&(l=ue(n,"componentWillLoad")),le(l,(()=>se(e,n,t)))},le=(e,t)=>oe(e)?e.then(t).catch((e=>{console.error(e),t()})):t(),oe=e=>e instanceof Promise||e&&e.then&&"function"==typeof e.then,se=async(e,t,n)=>{var l;const o=e.$hostElement$,s=o["s-rc"];n&&(e=>{const t=e.k,n=e.$hostElement$,l=t.l,o=((e,t)=>{var n;const l=D(t),o=i.get(l);if(e=11===e.nodeType?e:a,o)if("string"==typeof o){let s,r=W.get(e=e.head||e);if(r||W.set(e,r=new Set),!r.has(l)){{s=a.createElement("style"),s.innerHTML=o;const t=null!=(n=f.O)?n:k(a);null!=t&&s.setAttribute("nonce",t),e.insertBefore(s,e.querySelector("link"))}4&t.l&&(s.innerHTML+=c),r&&r.add(l)}}else e.adoptedStyleSheets.includes(o)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,o]);return l})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&(n["s-sc"]=o,n.classList.add(o+"-h"))})(e);re(e,t,o,n),s&&(s.map((e=>e())),o["s-rc"]=void 0);{const t=null!=(l=o["s-p"])?l:[],n=()=>ie(e);0===t.length?n():(Promise.all(t).then(n),e.l|=4,t.length=0)}},re=(e,t,n,l)=>{try{t=t.render(),e.l&=-17,e.l|=2,((e,t,n=!1)=>{const l=e.$hostElement$,o=e.k,s=e.C||T(null,null),r=(e=>e&&e.p===A)(t)?t:R(null,null,t);if(x=l.tagName,o.M&&(r.u=r.u||{},o.M.map((([e,t])=>r.u[t]=l[e]))),n&&r.u)for(const e of Object.keys(r.u))l.hasAttribute(e)&&!["key","ref","style","class"].includes(e)&&(r.u[e]=l[e]);r.p=null,r.l|=4,e.C=r,r.$=s.$=l.shadowRoot||l,M=l["s-sc"],X(s,r,n)})(e,t,l)}catch(t){s(t,e.$hostElement$)}return null},ie=e=>{const t=e.$hostElement$,n=e.t,l=e.j;64&e.l||(e.l|=64,ae(t),ue(n,"componentDidLoad"),e.P(t),l||ce()),e.S&&(e.S(),e.S=void 0),512&e.l&&v((()=>te(e,!1))),e.l&=-517},ce=()=>{ae(a.documentElement),v((()=>U(u,"appload",{detail:{namespace:"casino-challenges-claim-code"}})))},ue=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){s(e)}},ae=e=>e.classList.add("hydrated"),fe=(e,t,l)=>{var o,r;const i=e.prototype;if(t.L||t.R||e.watchers){e.watchers&&!t.R&&(t.R=e.watchers);const c=Object.entries(null!=(o=t.L)?o:{});if(c.map((([e,[o]])=>{(31&o||2&l&&32&o)&&Object.defineProperty(i,e,{get(){return((e,t)=>n(this).T.get(t))(0,e)},set(l){((e,t,l,o)=>{const r=n(e);if(!r)throw Error(`Couldn't find host element for "${o.v}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/ionic-team/stencil/issues/5457).`);const i=r.$hostElement$,c=r.T.get(t),u=r.l,a=r.t;if(l=((e,t)=>null==e||j(e)?e:1&t?e+"":e)(l,o.L[t][0]),(!(8&u)||void 0===c)&&l!==c&&(!Number.isNaN(c)||!Number.isNaN(l))&&(r.T.set(t,l),a)){if(o.R&&128&u){const e=o.R[t];e&&e.map((e=>{try{a[e](l,c,t)}catch(e){s(e,i)}}))}2==(18&u)&&te(r,!1)}})(this,e,l,t)},configurable:!0,enumerable:!0})})),1&l){const l=new Map;i.attributeChangedCallback=function(e,o,s){f.jmp((()=>{var r;const c=l.get(e);if(this.hasOwnProperty(c))s=this[c],delete this[c];else{if(i.hasOwnProperty(c)&&"number"==typeof this[c]&&this[c]==s)return;if(null==c){const l=n(this),i=null==l?void 0:l.l;if(i&&!(8&i)&&128&i&&s!==o){const n=l.t,i=null==(r=t.R)?void 0:r[e];null==i||i.forEach((t=>{null!=n[t]&&n[t].call(n,s,o,e)}))}return}}this[c]=(null!==s||"boolean"!=typeof this[c])&&s}))},e.observedAttributes=Array.from(new Set([...Object.keys(null!=(r=t.R)?r:{}),...c.filter((([e,t])=>15&t[0])).map((([e,n])=>{var o;const s=n[1]||e;return l.set(s,e),512&n[0]&&(null==(o=t.M)||o.push([e,s])),s}))]))}}return e},he=e=>{ue(e,"disconnectedCallback")},de=(e,l={})=>{var o;const h=[],m=l.exclude||[],p=u.customElements,y=a.head,$=y.querySelector("meta[charset]"),b=a.createElement("style"),w=[];let v,g=!0;Object.assign(f,l),f.o=new URL(l.resourcesUrl||"./",a.baseURI).href;let S=!1;if(e.map((e=>{e[1].map((l=>{var o;const c={l:l[0],v:l[1],L:l[2],A:l[3]};4&c.l&&(S=!0),c.L=l[2],c.M=[],c.R=null!=(o=l[4])?o:{};const u=c.v,a=class extends HTMLElement{constructor(e){if(super(e),this.hasRegisteredEventListeners=!1,((e,n)=>{const l={l:0,$hostElement$:e,k:n,T:new Map};l.N=new Promise((e=>l.P=e)),e["s-p"]=[],e["s-rc"]=[],t.set(e,l)})(e=this,c),1&c.l)if(e.shadowRoot){if("open"!==e.shadowRoot.mode)throw Error(`Unable to re-use existing shadow root for ${c.v}! Mode is set to ${e.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else e.attachShadow({mode:"open"})}connectedCallback(){this.hasRegisteredEventListeners||(this.hasRegisteredEventListeners=!0),v&&(clearTimeout(v),v=null),g?w.push(this):f.jmp((()=>(e=>{if(!(1&f.l)){const t=n(e),l=t.k,o=()=>{};if(1&t.l)(null==t?void 0:t.t)||(null==t?void 0:t.N)&&t.N.then((()=>{}));else{t.l|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){ee(t,t.j=n);break}}l.L&&Object.entries(l.L).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n)=>{let l;if(!(32&t.l)){if(t.l|=32,n.U){const e=(e=>{const t=e.v.replace(/-/g,"_"),n=e.U;if(!n)return;const l=r.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(r.set(n,e),e[t])),s)
2
+ /*!__STENCIL_STATIC_IMPORT_SWITCH__*/})(n);if(e&&"then"in e){const t=()=>{};l=await e,t()}else l=e;if(!l)throw Error(`Constructor for "${n.v}#${t.W}" was not found`);l.isProxied||(n.R=l.watchers,fe(l,n,2),l.isProxied=!0);const o=()=>{};t.l|=8;try{new l(t)}catch(e){s(e)}t.l&=-9,t.l|=128,o()}else l=e.constructor,customElements.whenDefined(e.localName).then((()=>t.l|=128));if(l&&l.style){let e;"string"==typeof l.style&&(e=l.style);const t=D(n);if(!i.has(t)){const l=()=>{};((e,t,n)=>{let l=i.get(e);d&&n?(l=l||new CSSStyleSheet,"string"==typeof l?l=t:l.replaceSync(t)):l=t,i.set(e,l)})(t,e,!!(1&n.l)),l()}}}const o=t.j,c=()=>te(t,!0);o&&o["s-rc"]?o["s-rc"].push(c):c()})(e,t,l)}o()}})(this)))}disconnectedCallback(){f.jmp((()=>(async()=>{if(!(1&f.l)){const e=n(this);(null==e?void 0:e.t)?he(e.t):(null==e?void 0:e.N)&&e.N.then((()=>he(e.t)))}})()))}componentOnReady(){return n(this).N}};c.U=e[0],m.includes(u)||p.get(u)||(h.push(u),p.define(u,fe(a,c,1)))}))})),h.length>0&&(S&&(b.textContent+=c),b.textContent+=h.sort()+"{visibility:hidden}.hydrated{visibility:inherit}",b.innerHTML.length)){b.setAttribute("data-styles","");const e=null!=(o=f.O)?o:k(a);null!=e&&b.setAttribute("nonce",e),y.insertBefore(b,$?$.nextSibling:y.firstChild)}g=!1,w.length?w.map((e=>e.connectedCallback())):f.jmp((()=>v=setTimeout(ce,30)))},me=e=>f.O=e;export{de as b,N as c,R as h,h as p,l as r,me as s}
@@ -0,0 +1 @@
1
+ export{C as CasinoChallengesClaimCode}from"./casino-challenges-claim-code-746b4197.js";import"./index-05d7637d.js";
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ const globalScripts = () => {};
4
+
5
+ exports.globalScripts = globalScripts;
@@ -0,0 +1,214 @@
1
+ 'use strict';
2
+
3
+ const index = require('./index-718e2d1c.js');
4
+
5
+ /**
6
+ * @name setClientStyling
7
+ * @description Method used to create and append to the passed element of the widget a style element with the content received
8
+ * @param {HTMLElement} stylingContainer The reference element of the widget
9
+ * @param {string} clientStyling The style content
10
+ */
11
+ function setClientStyling(stylingContainer, clientStyling) {
12
+ if (stylingContainer) {
13
+ const sheet = document.createElement('style');
14
+ sheet.innerHTML = clientStyling;
15
+ stylingContainer.appendChild(sheet);
16
+ }
17
+ }
18
+
19
+ /**
20
+ * @name setClientStylingURL
21
+ * @description Method used to create and append to the passed element of the widget a style element with the content fetched from a given URL
22
+ * @param {HTMLElement} stylingContainer The reference element of the widget
23
+ * @param {string} clientStylingUrl The URL of the style content
24
+ */
25
+ function setClientStylingURL(stylingContainer, clientStylingUrl) {
26
+ const url = new URL(clientStylingUrl);
27
+
28
+ fetch(url.href)
29
+ .then((res) => res.text())
30
+ .then((data) => {
31
+ const cssFile = document.createElement('style');
32
+ cssFile.innerHTML = data;
33
+ if (stylingContainer) {
34
+ stylingContainer.appendChild(cssFile);
35
+ }
36
+ })
37
+ .catch((err) => {
38
+ console.error('There was an error while trying to load client styling from URL', err);
39
+ });
40
+ }
41
+
42
+ /**
43
+ * @name setStreamLibrary
44
+ * @description Method used to create and append to the passed element of the widget a style element with content fetched from the MessageBus
45
+ * @param {HTMLElement} stylingContainer The highest element of the widget
46
+ * @param {string} domain The domain from where the content should be fetched (e.g. 'Casino.Style', 'App.Style', 'casino-footer.style', etc.)
47
+ * @param {ref} subscription A reference to a variable where the subscription should be saved for unsubscribing when no longer needed
48
+ */
49
+ function setStreamStyling(stylingContainer, domain, subscription) {
50
+ if (window.emMessageBus) {
51
+ const sheet = document.createElement('style');
52
+
53
+ window.emMessageBus.subscribe(domain, (data) => {
54
+ sheet.innerHTML = data;
55
+ if (stylingContainer) {
56
+ stylingContainer.appendChild(sheet);
57
+ }
58
+ });
59
+ }
60
+ }
61
+
62
+ const DEFAULT_LANGUAGE = 'en';
63
+ const TRANSLATIONS = {
64
+ en: {
65
+ title: 'Enter the secret code to unlock hidden quests and rewards.',
66
+ btnText: 'Apply code',
67
+ successMessage: 'The code was successfully applied.',
68
+ inputLabel: '3–30 characters, no spaces',
69
+ lengthMinError: 'Code must be at least 3 characters',
70
+ lengthMaxError: 'Too long — max 30 characters',
71
+ formatError: 'Invalid code format. Please use only Latin letters (case-sensitive), numbers, and special characters.',
72
+ genericError: 'Something went wrong, please retry'
73
+ },
74
+ ro: {},
75
+ fr: {},
76
+ ar: {},
77
+ hr: {}
78
+ };
79
+ const translate = (key, customLang) => {
80
+ const lang = customLang;
81
+ return TRANSLATIONS[lang !== undefined && lang in TRANSLATIONS ? lang : DEFAULT_LANGUAGE][key];
82
+ };
83
+ const getTranslations = (data) => {
84
+ Object.keys(data).forEach((item) => {
85
+ for (let key in data[item]) {
86
+ TRANSLATIONS[item][key] = data[item][key];
87
+ }
88
+ });
89
+ };
90
+ const resolveTranslationUrl = async (translationUrl) => {
91
+ if (translationUrl) {
92
+ try {
93
+ const response = await fetch(translationUrl);
94
+ if (!response.ok) {
95
+ throw new Error(`HTTP error! status: ${response.status}`);
96
+ }
97
+ const translations = await response.json();
98
+ getTranslations(translations);
99
+ }
100
+ catch (error) {
101
+ console.error('Failed to fetch or parse translations from URL:', error);
102
+ }
103
+ }
104
+ };
105
+
106
+ const casinoChallengesClaimCodeCss = ".container {\n display: flex;\n flex-direction: column;\n align-items: center;\n padding: 80px 0;\n text-align: center;\n}\n.container__title {\n font-size: var(--emw--font-size-medium-plus, 18px);\n font-weight: var(--emw--font-weight-medium, 500);\n line-height: 22px;\n color: var(--emw--color-white, white);\n margin: 0 0 32px;\n}\n.container__button {\n margin-top: 45px;\n padding: 14px 20px;\n background: transparent;\n text-transform: uppercase;\n border-radius: var(--emw--button-border-radius, 99px);\n border: 2px solid var(--emw--button-border-color, #083B17);\n font-size: var(--emw--font-size-x-small, 12px);\n font-weight: var(--emw--font-weight-bold, 700);\n color: var(--emw--color-white, #FFFFFF);\n background-color: var(--emw--button-background-color, #18CE51);\n cursor: pointer;\n}\n.container__button:hover {\n color: var(--emw--color-gray-300, #083B17);\n border-color: transparent;\n box-shadow: 0 0 4px 0 rgba(188, 252, 177, 0.2), 0 0 20px 0 rgba(0, 183, 79, 0.5);\n}\n.container__button:disabled, .container__button:disabled:hover {\n color: var(--emw--color-gray-50, #E2E2E2);\n border: 2px solid var(--emw--button-border-color, #083B17);\n opacity: 0.7;\n cursor: not-allowed;\n}\n@container challenges-container (max-width: 576px) {\n .container__button {\n width: calc(100% - 32px);\n position: absolute;\n bottom: 50px;\n }\n}\n\n.code-input {\n border: 1px solid var(--emw--button-border-color, #083B17);\n background: var(--emw--color-background-secondary, rgba(221, 255, 207, 0.1019607843));\n border-radius: 6px;\n padding: 12px 0;\n line-height: 24px;\n color: var(--emw--color-white, #FFFFFF);\n text-align: center;\n font-size: var(--emw--font-size-medium, 16px);\n min-width: 340px;\n}\n.code-input:focus {\n outline: 1px solid var(--emw--border-success-color, #00B74F);\n}\n.code-input:focus.errored {\n outline-color: var(--emw--color-error, #D6421E);\n}\n.code-input.errored {\n border-color: var(--emw--color-error, #D6421E);\n}\n.code-input__text {\n margin: 8px 0 0;\n line-height: 22px;\n font-size: var(--emw--font-size-x-small, 12px);\n font-weight: var(--emw--font-weight-medium, 500);\n color: var(--emw--color-gray-150, #C8D6CE);\n}\n.code-input__text.errored {\n color: var(--emw--color-error, #D6421E);\n}\n@container challenges-container (max-width: 576px) {\n .code-input {\n min-width: 100%;\n }\n}";
107
+ const CasinoChallengesClaimCodeStyle0 = casinoChallengesClaimCodeCss;
108
+
109
+ const CasinoChallengesClaimCode = class {
110
+ constructor(hostRef) {
111
+ index.registerInstance(this, hostRef);
112
+ this.openNotification = index.createEvent(this, "openNotification", 7);
113
+ this.asciiPrintableRegex = /^[\x21-\x7E]+$/;
114
+ this.handleSubmit = async () => {
115
+ if (this.endpoint && this.session && this.domain) {
116
+ const response = await this.applyCode();
117
+ if (response.Success) {
118
+ this.openNotification.emit({ message: translate('successMessage', this.language) });
119
+ }
120
+ else {
121
+ this.hasError = true;
122
+ const showTabLink = response.ErrorCode === 3002 || response.ErrorCode === 3023 || response.ErrorCode === 3003;
123
+ this.openNotification.emit({ message: response.ErrorMessage, errored: true, showTabLink });
124
+ }
125
+ }
126
+ };
127
+ this.applyCode = async () => {
128
+ this.loading = true;
129
+ const url = `${this.endpoint}/challenge/GrantChallengeByCode`;
130
+ const body = {
131
+ DomainId: this.domain,
132
+ PlayerSessionId: this.session,
133
+ ActivationCode: this.code
134
+ };
135
+ return fetch(url, {
136
+ method: 'POST',
137
+ headers: {
138
+ 'Content-Type': 'application/json'
139
+ },
140
+ body: JSON.stringify(body)
141
+ })
142
+ .then((res) => res.json())
143
+ .finally(() => (this.loading = false));
144
+ };
145
+ this.handleInput = (event) => {
146
+ this.code = event.target.value;
147
+ if (this.debounceTime) {
148
+ clearTimeout(this.debounceTime);
149
+ }
150
+ this.debounceTime = setTimeout(() => {
151
+ this.hasError = !this.validate(this.code);
152
+ }, 200);
153
+ };
154
+ this.mbSource = undefined;
155
+ this.clientStyling = undefined;
156
+ this.clientStylingUrl = undefined;
157
+ this.translationUrl = '';
158
+ this.language = 'en';
159
+ this.endpoint = '';
160
+ this.domain = '';
161
+ this.session = '';
162
+ this.loading = false;
163
+ this.hasError = false;
164
+ this.code = '';
165
+ this.notificationMessage = '';
166
+ }
167
+ handleClientStylingChange(newValue, oldValue) {
168
+ if (newValue != oldValue) {
169
+ setClientStyling(this.stylingContainer, this.clientStyling);
170
+ }
171
+ }
172
+ handleClientStylingUrlChange(newValue, oldValue) {
173
+ if (newValue != oldValue) {
174
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
175
+ }
176
+ }
177
+ handleMbSourceChange(newValue, oldValue) {
178
+ if (newValue != oldValue) {
179
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
180
+ }
181
+ }
182
+ componentWillLoad() {
183
+ if (this.translationUrl) {
184
+ resolveTranslationUrl(this.translationUrl);
185
+ }
186
+ }
187
+ componentDidLoad() {
188
+ if (this.stylingContainer) {
189
+ if (this.mbSource)
190
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
191
+ if (this.clientStyling)
192
+ setClientStyling(this.stylingContainer, this.clientStyling);
193
+ if (this.clientStylingUrl)
194
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
195
+ }
196
+ }
197
+ disconnectedCallback() {
198
+ this.stylingSubscription && this.stylingSubscription.unsubscribe();
199
+ }
200
+ validate(val) {
201
+ return val.length >= 3 && val.length <= 30 && this.asciiPrintableRegex.test(val);
202
+ }
203
+ render() {
204
+ return (index.h("div", { key: '241aeeb9f0f0984bbf0367a7c925e0b84ef15fa0', ref: (el) => (this.stylingContainer = el) }, index.h("div", { key: 'f20ec43253905cb0e9a356f65d1e51e695f784cf', class: "container" }, index.h("p", { key: 'a4c3b0ca894db101c192f7c62ff141ec51eaede1', class: "container__title" }, translate('title', this.language)), index.h("input", { key: 'c99bdd43659c9d2fc06702fe041eab8458bb0ee5', class: `code-input ${this.hasError ? 'errored' : ''}`, type: "text", placeholder: "e.g. SPRING24", onInput: this.handleInput }), index.h("p", { key: 'c2aacc2d4a23c7d222f895dce3a3a47b8f03f587', class: "code-input__text" }, translate('inputLabel', this.language)), index.h("button", { key: '51e79d07278368567026d31b0c70e8c9f0eb4840', class: "container__button", onClick: this.handleSubmit, disabled: this.loading || !this.code || this.hasError }, translate('btnText', this.language)))));
205
+ }
206
+ static get watchers() { return {
207
+ "clientStyling": ["handleClientStylingChange"],
208
+ "clientStylingUrl": ["handleClientStylingUrlChange"],
209
+ "mbSource": ["handleMbSourceChange"]
210
+ }; }
211
+ };
212
+ CasinoChallengesClaimCode.style = CasinoChallengesClaimCodeStyle0;
213
+
214
+ exports.CasinoChallengesClaimCode = CasinoChallengesClaimCode;
@@ -0,0 +1,10 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const casinoChallengesClaimCode = require('./casino-challenges-claim-code-a4324416.js');
6
+ require('./index-718e2d1c.js');
7
+
8
+
9
+
10
+ exports.casino_challenges_claim_code = casinoChallengesClaimCode.CasinoChallengesClaimCode;
@@ -0,0 +1,25 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-718e2d1c.js');
6
+ const appGlobals = require('./app-globals-3a1e7e63.js');
7
+
8
+ /*
9
+ Stencil Client Patch Browser v4.19.2 | MIT Licensed | https://stenciljs.com
10
+ */
11
+ var patchBrowser = () => {
12
+ const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('casino-challenges-claim-code.cjs.js', document.baseURI).href));
13
+ const opts = {};
14
+ if (importMeta !== "") {
15
+ opts.resourcesUrl = new URL(".", importMeta).href;
16
+ }
17
+ return index.promiseResolve(opts);
18
+ };
19
+
20
+ patchBrowser().then(async (options) => {
21
+ await appGlobals.globalScripts();
22
+ return index.bootstrapLazy([["casino-challenges-claim-code.cjs",[[1,"casino-challenges-claim-code",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"endpoint":[513],"domain":[513],"session":[513],"loading":[32],"hasError":[32],"code":[32],"notificationMessage":[32]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}]]]], options);
23
+ });
24
+
25
+ exports.setNonce = index.setNonce;