@everymatrix/cashier-page 1.31.2 → 1.32.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.
- package/dist/cashier-page.js +1 -1
- package/dist/cashier-page.js.map +1 -1
- package/package.json +2 -2
package/dist/cashier-page.js
CHANGED
|
@@ -848,7 +848,7 @@ function Ca(e){let t,n;return{c(){t=M("div"),n=M("cashier-receipt-page"),L(n,"la
|
|
|
848
848
|
// (873:2) {#if errorResponseCode && !showErrorModal}
|
|
849
849
|
function Ea(e){let t,n,r,i,o,a,s=/*$_*/e[35]("backToMethodList")+"";return{c(){t=M("cashier-error"),n=M("div"),r=E(s),A(n,"slot","button"),A(n,"class","ModalButton"),L(t,"assetsurl",/*assetsurl*/e[8]),L(t,"translationurl",/*translationurl*/e[4]),L(t,"clientstylingurl",/*clientstylingurl*/e[11]),L(t,"clientstyling",/*clientstyling*/e[10]),L(t,"hidebuttons",i=`${!/*mobileView*/e[24]}`),L(t,"errorcode",/*errorResponseCode*/e[32])},m(i,s){v(i,t,s),b(t,n),b(n,r),o||(a=S(n,"click",/*backToMethodList*/e[40]),o=!0)},p(e,n){/*$_*/16&n[1]&&s!==(s=/*$_*/e[35]("backToMethodList")+"")&&_(r,s),/*assetsurl*/256&n[0]&&L(t,"assetsurl",/*assetsurl*/e[8]),/*translationurl*/16&n[0]&&L(t,"translationurl",/*translationurl*/e[4]),/*clientstylingurl*/2048&n[0]&&L(t,"clientstylingurl",/*clientstylingurl*/e[11]),/*clientstyling*/1024&n[0]&&L(t,"clientstyling",/*clientstyling*/e[10]),/*mobileView*/16777216&n[0]&&i!==(i=`${!/*mobileView*/e[24]}`)&&L(t,"hidebuttons",i),/*errorResponseCode*/2&n[1]&&L(t,"errorcode",/*errorResponseCode*/e[32])},d(e){e&&k(t),o=!1,a()}}}function Da(t){let n,r,i,o,a,s,c;ne(/*onwindowresize*/t[56]);let u=/*selectedPaymentMethod*/t[17]?.Name&&Ko(t),d=/*errorResponseCode*/t[32]&&!/*showErrorModal*/t[33]&&Ea(t);return{c(){n=M("script"),i=D(),o=M("div"),u&&u.c(),a=D(),d&&d.c(),this.c=e,l(n.src,r=Ta)||A(n,"src",r),A(o,"class","CashierMethodDetails")},m(e,r){b(Yo.head,n),v(e,i,r),v(e,o,r),u&&u.m(o,null),b(o,a),d&&d.m(o,null)
|
|
850
850
|
/*div_binding*/,t[84](o),s||(c=S(Go,"resize",/*onwindowresize*/t[56]),s=!0)},p(e,t){/*selectedPaymentMethod*/e[17]?.Name?u?u.p(e,t):(u=Ko(e),u.c(),u.m(o,a)):u&&(u.d(1),u=null),/*errorResponseCode*/e[32]&&!/*showErrorModal*/e[33]?d?d.p(e,t):(d=Ea(e),d.c(),d.m(o,null)):d&&(d.d(1),d=null)},i:e,o:e,d(e){k(n),e&&k(i),e&&k(o),u&&u.d(),d&&d.d()
|
|
851
|
-
/*div_binding*/,t[84](null),s=!1,c()}}}let Ta="https://cdn.rawgit.com/davidshimjs/qrcodejs/gh-pages/qrcode.min.js";function Sa(e,t,n){let r;u(e,Qn,(e=>n(35,r=e)));class i{constructor(e){this.correlationFieldName=e.CorrelationFieldName||null,this.correlationFieldValue=e.CorrelationFieldValue&&e.CorrelationFieldValue.length>0?e.CorrelationFieldValue.split(","):[],this.name=e.Name||null,this.label=e.Label||null,this.description=e.Description||null,this.type=d.get(e.Type)||null,this.defaultValue=this.calcDefaultValue(e),this.format=e.Format||null,this.placeholder=e.Placeholder||null,this.isReadonly=e.IsReadonly||!1,this.isRequired=e.IsRequired||!1,this.maxValue=e.MaxValue||null,this.minValue=e.MinValue||null,this.isPrimaryField=e.IsPrimaryField||!1,this.demandUserInput=e.DemandUserInput||!1,this.autoTrim=e.AutoTrim||!1,this.autoUppercase=e.AutoUppercase||!1,this.notEqualToFieldName=e.NotEqualToFieldName||null,this.values=e.Values,this.useCopyButton=e.UseCopyButton||!1,this.inputMask=e.InputMask,this.tags=e.Tags||null}calcDefaultValue(e){return 2===this.type?"True"===e.DefaultValue:e.DefaultValue||null}get descriptionWithLink(){if("Boolean"===c[this.type]&&this.placeholder||"Link"===c[this.type]){const e=/{link}/i,t=`<a href="${this.placeholder||this.defaultValue}" target="_blank" rel="noopener noreferrer">${this.label}</a>`;return this.description.match(e)?this.description.replace(e,t):`${this.description} ${t}`}return this.description}}const o=(e,[t,n])=>[...e,...Array.isArray(t)?[...t.map((e=>[e,n]))]:[[t,n]]];var a,s;!function(e){e.Deposit="Deposit",e.Withdraw="Withdraw"}(a||(a={})),function(e){e.Default="Default",e.RedirectWithRetry="Redirect"}(s||(s={}));const l=new Map([[["Default",0],s.Default],[["Redirect",1],s.RedirectWithRetry]].reduce(o,[]));var c;!function(e){e.Unknown="Unknown",e.Text="Text",e.Boolean="Boolean",e.Number="Number",e.Money="Money",e.DateTime="DateTime",e.Lookup="Lookup",e.IpAddress="IpAddress",e.Date="Date",e.Time="Time",e.LookupCollection="LookupCollection",e.Hidden="Hidden",e.Label="Label",e.Password="Password",e.Link="Link",e.Image="Image",e.Html="Html",e.QRCode="QR"}(c||(c={}));const d=new Map([[["Unknown",0],c.Unknown],[["Text",1],c.Text],[["Boolean",2],c.Boolean],[["Number",3],c.Number],[["Money",4],c.Money],[["DateTime",5],c.DateTime],[["Lookup",6],c.Lookup],[["IpAddress",7],c.IpAddress],[["Date",8],c.Date],[["Time",9],c.Time],[["LookupCollection",10],c.LookupCollection],[["Hidden",11],c.Hidden],[["Label",12],c.Label],[["Password",13],c.Password],[["Link",14],c.Link],[["Image",15],c.Image],[["Html",19],c.Html],[["QR",20],c.QRCode]].reduce(o,[]));let h,p,f,m,g,b,y,w,v,k,x,{endpoint:M}=t,{session:C}=t,{playersession:E}=t,{lang:D="en"}=t,{local:T="en-US"}=t,{dateformat:S="d/m/Y"}=t,{timeformat:A="H:i"}=t,{dateandtimeformat:L="d/m/Y H:i"}=t,{translationurl:_}=t,{customerid:P}=t,{currency:O}=t,{amount:H}=t,{assetsurl:N}=t,{type:I=a.Deposit}=t,{selectedpaymentmethodname:B}=t,{clientstyling:R=""}=t,{clientstylingurl:F=""}=t,{ismobileview:j}=t,z={},U=[],W={},Y=!1,G=!1,J=[],K=[],X=!1,Z=window.navigator.userAgent;window.matchMedia("(max-width: 750px)");let Q,ee,te,ne,re=new Intl.NumberFormat(T,{minimumFractionDigits:2}),ie="",oe={},ae={},se=!1,le=!1,ce="";const ue=()=>{var e;e=D,Pn.set(e)};Object.keys(Mi).forEach((e=>{xi(e,Mi[e])}));const de=()=>{const e=new URL(`${M}/v1/player/${P}/payment/GetPaymentMethod`),t=new Headers;t.append("accept","application/json"),t.append("Content-Type","application/json");const r={method:"POST",mode:"cors",headers:t,body:JSON.stringify({PaymentMethodName:B,Currency:O,XPaymentSessionToken:C})};fetch(e,r).then((e=>e.json())).then((e=>{if(e.error)window.postMessage({type:"ShowSessionError",error:e.error},window.location.href);else{if("Success"!==e.ResponseCode)return n(32,te=e.ResponseCode),void me();h=e.XPaymentSessionToken,n(17,z=e.PaymentMethod),n(31,ee=Number(H)),z.HideAmountField?n(26,ie=""):Pe(),n(12,U=z.Fields&&z.Fields.map((e=>new i(e)))),U.forEach((e=>{(null==e?void 0:e.defaultValue)&&n(18,W[e.name]=e.defaultValue,W),He(e)})),ge(),me(),xe()}}))},he=e=>{"ErrorResponseCode"==e.data.type&&(n(32,te=e.data.errorResponseCode),n(19,G=e.data.showReceiptPage)),"ReceiptLoaded"==e.data.type&&Me()};V((()=>(window.addEventListener("closeModal",Ce,!1),window.addEventListener("confirmModal",Ee,!1),window.addEventListener("closeIframe",Me,!1),window.addEventListener("notificationButtonClick",De,!1),window.addEventListener("closeCashierReceiptPage",Te,!1),document.addEventListener("click",pe),window.addEventListener("message",he,!1),Uo.extend(Wo),()=>{window.removeEventListener("closeModal",Ce),window.removeEventListener("confirmModal",Ee),window.removeEventListener("closeIframe",Me),window.removeEventListener("notificationButtonClick",De),window.removeEventListener("closeCashierReceiptPage",Te),window.removeEventListener("message",he)})));const pe=e=>{v&&(n(27,oe[v]=!0,oe),He(U.find((e=>e.name===v)))),e.composedPath().includes(k)||n(23,v=null)},fe=(e,t)=>{if(t===v)return n(27,oe[v]=!0,oe),He(U.find((e=>e.name===v))),void n(23,v=null);e.stopPropagation(),k=e.composedPath()[0];const r=k.getBoundingClientRect(),i=p.getBoundingClientRect(),o=r.y;n(29,se=window.innerHeight-o<200);const a=r.top-i.top-r.height,s=i.bottom-r.bottom-r.height;n(30,Q=se?a:!se&&s<70?150:s),n(23,v=t)},me=()=>{window.postMessage({type:"ErrorResponseCode",errorResponseCode:te},window.location.href)},ge=()=>{window.postMessage({type:"ShowConfirmModal",showConfirmModal:Y,editedAmount:ee},window.location.href)},be=()=>{window.postMessage({type:"RedirectInfo",redirectMode:b,redirectUrl:f},window.location.href)},ye=()=>{n(33,le=!0),window.postMessage({type:"ShowCashierModal"},window.location.href)},we=()=>{dispatchEvent(new CustomEvent("backToMethodList",{bubbles:!0,cancelable:!0,composed:!0})),ke()},ve=()=>{window.postMessage({type:"ToggleDisableActionOnPage",disable:w},window.location.href)},ke=()=>{dispatchEvent(new CustomEvent("hidePaymentDetails",{detail:{hideMethodDetails:X},bubbles:!0,cancelable:!0,composed:!0}))},xe=()=>{dispatchEvent(new CustomEvent("hideMethodsList",{detail:{hideMethodsList:X},bubbles:!0,cancelable:!0,composed:!0}))},Me=()=>{f=null,n(19,G=!0),be()},Ce=()=>{Y=!1},Ee=()=>{n(22,w=!0);const e=new URL(`${M}/v1/player/${P}/payment/GetPaymentConfirm`),t=new Headers;t.append("accept","application/json"),t.append("Content-Type","application/json"),ve();const r={method:"POST",mode:"cors",headers:t,body:JSON.stringify({XPaymentSessionToken:h})};fetch(e,r).then((e=>e.json())).then((e=>{if("Success"!==e.ResponseCode)return n(32,te=e.ResponseCode),n(22,w=!1),ve(),void ye();h=e.XPaymentSessionToken,n(34,ce=e.Transaction.Code),f=e.RedirectUrl,b=l.get("Default"),n(22,w=!1),ve(),be(),f||n(19,G=!0),b===s.RedirectWithRetry&&(m=window.open(e.RedirectUrl,"_blank"),n(20,g=!!m),m||n(21,y=!0))}))},De=()=>{m=window.open(f,"_blank"),n(20,g=!0),n(21,y=!1),be()},Te=()=>{n(19,G=!1)},Se=e=>{e&&window.postMessage({type:"NavigateTo",path:e,target:"_blank",externalLink:!1},window.location.href)},Ae=(e,t)=>{n(18,W[e.name]=t,W),U.filter((e=>e.correlationFieldName)).forEach((e=>He(e)))},Le=e=>{if(!e.correlationFieldName)return!0;const t=e.correlationFieldValue.includes(W[e.correlationFieldName]);return!t&&W[e.name]&&delete W[e.name],t},$e=(e,t)=>e.format&&t&&!((e,t)=>{if(!e)return!0;let n,r;return"string"==typeof e?(r="","^"!==e.charAt(0)&&(r+="^"),r+=e,"$"!==e.charAt(e.length-1)&&(r+="$"),n=new RegExp(r)):(r=e.toString(),n=e),n.test(t)})(e.format,t)?r("invalidFieldError",{values:{field:e.label}}):"",_e=(e,t)=>"boolean"==typeof t||!e.isRequired||t&&t.toString().trim()?"":r("errorEmptyField"),Pe=()=>{n(26,ie=(ee?"":r("errorEmptyField"))||(z.DisplayCurrency.MinAmountLimit>ee?r("minAmountError",{values:{amount:re.format(z.DisplayCurrency.MinAmountLimit),currency:z.DisplayCurrency.Name}}):"")||(z.DisplayCurrency.MaxAmountLimit<ee?r("maxAmountError",{values:{amount:re.format(z.DisplayCurrency.MaxAmountLimit),currency:z.DisplayCurrency.Name}}):"")||(z.AmountMultiplier&&ee%z.AmountMultiplier!=0?r("amountMultiplierError",{values:{multiplier:z.AmountMultiplier}}):"")||(z.IsIntegerAmount&&!Number.isInteger(ee)?r("amountIntError"):"")||(Number(ee).toFixed(2)!=+ee?r("amountDecimalError"):""))},Oe=e=>{const t=W[e.name],i=e.placeholder,o=Uo(t,i),a=Uo(e.maxValue,i),s=Uo(e.minValue,i);o.isBefore(s)||o.isAfter(a)?n(28,ae[e.name]=r("invalidFieldError",{values:{field:e.label}}),ae):n(28,ae[e.name]=Le(e)?_e(e,t)||$e(e,t):"",ae)},He=e=>{const t=W[e.name];n(28,ae[e.name]=Le(e)?_e(e,t)||$e(e,t):"",ae)};return e.$$set=e=>{"endpoint"in e&&n(0,M=e.endpoint),"session"in e&&n(50,C=e.session),"playersession"in e&&n(1,E=e.playersession),"lang"in e&&n(2,D=e.lang),"local"in e&&n(3,T=e.local),"dateformat"in e&&n(51,S=e.dateformat),"timeformat"in e&&n(52,A=e.timeformat),"dateandtimeformat"in e&&n(53,L=e.dateandtimeformat),"translationurl"in e&&n(4,_=e.translationurl),"customerid"in e&&n(5,P=e.customerid),"currency"in e&&n(6,O=e.currency),"amount"in e&&n(7,H=e.amount),"assetsurl"in e&&n(8,N=e.assetsurl),"type"in e&&n(9,I=e.type),"selectedpaymentmethodname"in e&&n(54,B=e.selectedpaymentmethodname),"clientstyling"in e&&n(10,R=e.clientstyling),"clientstylingurl"in e&&n(11,F=e.clientstylingurl),"ismobileview"in e&&n(55,j=e.ismobileview)},e.$$.update=()=>{/*endpoint, currency*/65&e.$$.dirty[0]|/*session, selectedpaymentmethodname*/8912896&e.$$.dirty[1]&&M&&C&&B&&O&&(K.length&&K.forEach((e=>{e&&Fo(e,{dateFormat:S}).destroy()})),n(19,G=!1),n(15,K=[]),n(12,U=[]),n(18,W={}),n(27,oe={}),n(28,ae={}),n(14,J=[]),n(17,z=null),n(32,te=""),n(33,le=!1),me(),de()),/*clientstyling, customStylingContainer*/9216&e.$$.dirty[0]&&R&&p&&(()=>{let e=document.createElement("style");e.innerHTML=R,p.appendChild(e)})(),/*clientstylingurl, customStylingContainer*/10240&e.$$.dirty[0]&&F&&p&&(()=>{let e=new URL(F),t=document.createElement("style");fetch(e.href).then((e=>e.text())).then((e=>{t.innerHTML=e,setTimeout((()=>{p.appendChild(t)}),1),setTimeout((()=>{}),500)}))})(),/*lang*/4&e.$$.dirty[0]&&D&&ue(),/*lang, translationurl*/20&e.$$.dirty[0]&&D&&_&&(()=>{if(_)fetch(_).then((e=>e.json())).then((e=>{Object.keys(e).forEach((t=>{xi(t,e[t])}))})).catch((e=>{}))})(),/*ismobileview*/16777216&e.$$.dirty[1]&&j&&n(24,X="true"===j),/*fields, qrCodeContainer*/20480&e.$$.dirty[0]&&U.length&&J.length&&J.forEach((e=>{if(e&&e.innerText){const t=e.innerText;e.innerText="",new QRCode(e,{text:t,width:250,height:250})}})),/*fields, flatpickrEl*/36864&e.$$.dirty[0]&&U.length&&K.length&&(()=>{const e={[c.Time]:{noCalendar:!0,enableTime:!0,dateFormat:A,time_24hr:"H:i"===A,allowInput:!0},[c.Date]:{dateFormat:S,allowInput:!0,locale:Object.assign({},zo[D])},[c.DateTime]:{dateFormat:L,allowInput:!0,enableTime:!0,time_24hr:"H:i"===A,locale:Object.assign({},zo[D])}};K.forEach((t=>{if(!t)return;const r=JSON.parse(t.dataset.field);Fo(t,Object.assign(Object.assign({},e[r.type]),{maxDate:r.maxValue,minDate:r.minValue,defaultDate:r.defaultValue,onReady:(e,t)=>{n(18,W[r.name]=t,W)},onClose:(e,t,i)=>{ae[r.name]?n(18,W[r.name]="",W):n(18,W[r.name]=t,W)}}))}))})()},[M,E,D,T,_,P,O,H,N,I,R,F,U,p,J,K,c,z,W,G,g,y,w,v,X,x,ie,oe,ae,se,Q,ee,te,le,ce,r,Z,re,fe,()=>{if(ne)return;n(22,w=!0);const e=new URL(`${M}/v1/player/${P}/payment/GetPaymentPrepare`),t=new Headers;t.append("accept","application/json"),t.append("Content-Type","application/json"),ve();const r={method:"POST",mode:"cors",headers:t,body:JSON.stringify({XPaymentSessionToken:h,Transaction:{PaymentMethod:z.Name,Amount:ee,Currency:O,CustomFields:W},Account:{}})};fetch(e,r).then((e=>e.json())).then((e=>{if(e.error)postMessage({type:"ShowSessionError",error:e.error},window.location.href);else{if("Success"!==e.ResponseCode)return n(32,te=e.ResponseCode),n(22,w=!1),me(),ve(),void ye();h=e.XPaymentSessionToken,n(22,w=!1),Y=!0,ge(),ve()}}))},we,Se,Ae,(e,t)=>t?e.find((e=>e.Name===t)).Value:"",Le,Pe,Oe,He,(e,t)=>(ne=!!e||Object.values(t).some((e=>!!e)),ne),i,C,S,A,L,B,j,function(){n(25,x=Go.innerWidth)},()=>we(),function(){ee=$(this.value),n(31,ee)},()=>Pe(),()=>{n(27,oe.amount=!0,oe),Pe()},function(e){W[e.name]=this.value,n(18,W)},e=>{He(e)},e=>{n(27,oe[e.name]=!0,oe),He(e)},function(e){W[e.name]=this.value,n(18,W)},e=>{n(27,oe[e.name]=!0,oe),Oe(e)},e=>{n(27,oe[e.name]=!0,oe),Oe(e)},e=>{n(27,oe[e.name]=!0,oe),Oe(e)},function(e){q[e?"unshift":"push"]((()=>{K[K.length]=e,n(15,K)}))},function(e){W[e.name]=$(this.value),n(18,W)},e=>{He(e)},e=>{n(27,oe[e.name]=!0,oe),He(e)},function(e){W[e.name]=this.value,n(18,W)},e=>{He(e)},e=>{n(27,oe[e.name]=!0,oe),He(e)},function(e){W[e.name]=this.value,n(18,W)},(e,t)=>fe(t,e.name),(e,t)=>{Ae(e,t.Name),n(12,U)},function(e){W[e.name]=this.checked,n(18,W)},e=>{n(27,oe[e.name]=!0,oe),He(e)},function(e){q[e?"unshift":"push"]((()=>{J[J.length]=e,n(14,J)}))},e=>{Se(e.description)},function(e){W[e.name]=this.value,n(18,W)},()=>{n(20,g=!1)},function(e){q[e?"unshift":"push"]((()=>{p=e,n(13,p)}))}]}
|
|
851
|
+
/*div_binding*/,t[84](null),s=!1,c()}}}let Ta="https://cdn.rawgit.com/davidshimjs/qrcodejs/gh-pages/qrcode.min.js";function Sa(e,t,n){let r;u(e,Qn,(e=>n(35,r=e)));class i{constructor(e){this.correlationFieldName=e.CorrelationFieldName||null,this.correlationFieldValue=e.CorrelationFieldValue&&e.CorrelationFieldValue.length>0?e.CorrelationFieldValue.split(","):[],this.name=e.Name||null,this.label=e.Label||null,this.description=e.Description||null,this.type=d.get(e.Type)||null,this.defaultValue=this.calcDefaultValue(e),this.format=e.Format||null,this.placeholder=e.Placeholder||null,this.isReadonly=e.IsReadonly||!1,this.isRequired=e.IsRequired||!1,this.maxValue=e.MaxValue||null,this.minValue=e.MinValue||null,this.isPrimaryField=e.IsPrimaryField||!1,this.demandUserInput=e.DemandUserInput||!1,this.autoTrim=e.AutoTrim||!1,this.autoUppercase=e.AutoUppercase||!1,this.notEqualToFieldName=e.NotEqualToFieldName||null,this.values=e.Values,this.useCopyButton=e.UseCopyButton||!1,this.inputMask=e.InputMask,this.tags=e.Tags||null}calcDefaultValue(e){return 2===this.type?"True"===e.DefaultValue:e.DefaultValue||null}get descriptionWithLink(){if("Boolean"===c[this.type]&&this.placeholder||"Link"===c[this.type]){const e=/{link}/i,t=`<a href="${this.placeholder||this.defaultValue}" target="_blank" rel="noopener noreferrer">${this.label}</a>`;return this.description.match(e)?this.description.replace(e,t):`${this.description} ${t}`}return this.description}}const o=(e,[t,n])=>[...e,...Array.isArray(t)?[...t.map((e=>[e,n]))]:[[t,n]]];var a,s;!function(e){e.Deposit="Deposit",e.Withdraw="Withdraw"}(a||(a={})),function(e){e.Default="Default",e.RedirectWithRetry="Redirect"}(s||(s={}));const l=new Map([[["Default",0],s.Default],[["Redirect",1],s.RedirectWithRetry]].reduce(o,[]));var c;!function(e){e.Unknown="Unknown",e.Text="Text",e.Boolean="Boolean",e.Number="Number",e.Money="Money",e.DateTime="DateTime",e.Lookup="Lookup",e.IpAddress="IpAddress",e.Date="Date",e.Time="Time",e.LookupCollection="LookupCollection",e.Hidden="Hidden",e.Label="Label",e.Password="Password",e.Link="Link",e.Image="Image",e.Html="Html",e.QRCode="QR"}(c||(c={}));const d=new Map([[["Unknown",0],c.Unknown],[["Text",1],c.Text],[["Boolean",2],c.Boolean],[["Number",3],c.Number],[["Money",4],c.Money],[["DateTime",5],c.DateTime],[["Lookup",6],c.Lookup],[["IpAddress",7],c.IpAddress],[["Date",8],c.Date],[["Time",9],c.Time],[["LookupCollection",10],c.LookupCollection],[["Hidden",11],c.Hidden],[["Label",12],c.Label],[["Password",13],c.Password],[["Link",14],c.Link],[["Image",15],c.Image],[["Html",19],c.Html],[["QR",20],c.QRCode]].reduce(o,[]));let h,p,f,m,g,b,y,w,v,k,x,{endpoint:M}=t,{session:C}=t,{playersession:E}=t,{lang:D="en"}=t,{local:T="en-US"}=t,{dateformat:S="d/m/Y"}=t,{timeformat:A="H:i"}=t,{dateandtimeformat:L="d/m/Y H:i"}=t,{translationurl:_}=t,{customerid:P}=t,{currency:O}=t,{amount:H}=t,{assetsurl:N}=t,{type:I=a.Deposit}=t,{selectedpaymentmethodname:B}=t,{clientstyling:R=""}=t,{clientstylingurl:F=""}=t,{ismobileview:j}=t,z={},U=[],W={},Y=!1,G=!1,J=[],K=[],X=!1,Z=window.navigator.userAgent;window.matchMedia("(max-width: 750px)");let Q,ee,te,ne,re=new Intl.NumberFormat(T,{minimumFractionDigits:2}),ie="",oe={},ae={},se=!1,le=!1,ce="";const ue=()=>{var e;e=D,Pn.set(e)};Object.keys(Mi).forEach((e=>{xi(e,Mi[e])}));const de=()=>{const e=new URL(`${M}/v1/player/${P}/payment/GetPaymentMethod`),t=new Headers;t.append("accept","application/json"),t.append("Content-Type","application/json");const r={method:"POST",mode:"cors",headers:t,body:JSON.stringify({PaymentMethodName:B,Currency:O,XPaymentSessionToken:C})};fetch(e,r).then((e=>e.json())).then((e=>{if(e.error)window.postMessage({type:"ShowSessionError",error:e.error},window.location.href);else{if("Success"!==e.ResponseCode)return n(32,te=e.ResponseCode),void me();h=e.XPaymentSessionToken,n(17,z=e.PaymentMethod),n(31,ee=Number(H)),z.HideAmountField?n(26,ie=""):Pe(),n(12,U=z.Fields&&z.Fields.map((e=>new i(e)))),U.forEach((e=>{(null==e?void 0:e.defaultValue)&&n(18,W[e.name]=e.defaultValue,W),He(e)})),ge(),me(),xe()}}))},he=e=>{"ErrorResponseCode"==e.data.type&&(n(32,te=e.data.errorResponseCode),n(19,G=e.data.showReceiptPage)),"ReceiptLoaded"==e.data.type&&Me()};V((()=>(window.addEventListener("closeModal",Ce,!1),window.addEventListener("confirmModal",Ee,!1),window.addEventListener("closeIframe",Me,!1),window.addEventListener("notificationButtonClick",De,!1),window.addEventListener("closeCashierReceiptPage",Te,!1),document.addEventListener("click",pe),window.addEventListener("message",he,!1),Uo.extend(Wo),()=>{window.removeEventListener("closeModal",Ce),window.removeEventListener("confirmModal",Ee),window.removeEventListener("closeIframe",Me),window.removeEventListener("notificationButtonClick",De),window.removeEventListener("closeCashierReceiptPage",Te),window.removeEventListener("message",he)})));const pe=e=>{v&&(n(27,oe[v]=!0,oe),He(U.find((e=>e.name===v)))),e.composedPath().includes(k)||n(23,v=null)},fe=(e,t)=>{if(t===v)return n(27,oe[v]=!0,oe),He(U.find((e=>e.name===v))),void n(23,v=null);e.stopPropagation(),k=e.composedPath()[0];const r=k.getBoundingClientRect(),i=p.getBoundingClientRect(),o=r.y;n(29,se=window.innerHeight-o<200);const a=r.top-i.top-r.height,s=i.bottom-r.bottom-r.height;n(30,Q=se?a:!se&&s<70?150:s),n(23,v=t)},me=()=>{window.postMessage({type:"ErrorResponseCode",errorResponseCode:te},window.location.href)},ge=()=>{window.postMessage({type:"ShowConfirmModal",showConfirmModal:Y,editedAmount:ee},window.location.href)},be=()=>{window.postMessage({type:"RedirectInfo",redirectMode:b,redirectUrl:f},window.location.href)},ye=()=>{n(33,le=!0),window.postMessage({type:"ShowCashierModal"},window.location.href)},we=()=>{dispatchEvent(new CustomEvent("backToMethodList",{bubbles:!0,cancelable:!0,composed:!0})),ke()},ve=()=>{window.postMessage({type:"ToggleDisableActionOnPage",disable:w},window.location.href)},ke=()=>{dispatchEvent(new CustomEvent("hidePaymentDetails",{detail:{hideMethodDetails:X},bubbles:!0,cancelable:!0,composed:!0}))},xe=()=>{dispatchEvent(new CustomEvent("hideMethodsList",{detail:{hideMethodsList:X},bubbles:!0,cancelable:!0,composed:!0}))},Me=()=>{f=null,n(19,G=!0),be()},Ce=()=>{Y=!1},Ee=()=>{n(22,w=!0);const e=new URL(`${M}/v1/player/${P}/payment/GetPaymentConfirm`),t=new Headers;t.append("accept","application/json"),t.append("Content-Type","application/json"),ve();const r={method:"POST",mode:"cors",headers:t,body:JSON.stringify({XPaymentSessionToken:h})};fetch(e,r).then((e=>e.json())).then((e=>{if("Success"!==e.ResponseCode)return n(32,te=e.ResponseCode),n(22,w=!1),ve(),void ye();h=e.XPaymentSessionToken,n(34,ce=e.Transaction.Code),f=e.RedirectUrl,b=l.get(e.RedirectionMode)||l.get("Default"),n(22,w=!1),ve(),be(),f||n(19,G=!0),b===s.RedirectWithRetry&&(m=window.open(e.RedirectUrl,"_blank"),n(20,g=!!m),m||n(21,y=!0))}))},De=()=>{m=window.open(f,"_blank"),n(20,g=!0),n(21,y=!1),be()},Te=()=>{n(19,G=!1)},Se=e=>{e&&window.postMessage({type:"NavigateTo",path:e,target:"_blank",externalLink:!1},window.location.href)},Ae=(e,t)=>{n(18,W[e.name]=t,W),U.filter((e=>e.correlationFieldName)).forEach((e=>He(e)))},Le=e=>{if(!e.correlationFieldName)return!0;const t=e.correlationFieldValue.includes(W[e.correlationFieldName]);return!t&&W[e.name]&&delete W[e.name],t},$e=(e,t)=>e.format&&t&&!((e,t)=>{if(!e)return!0;let n,r;return"string"==typeof e?(r="","^"!==e.charAt(0)&&(r+="^"),r+=e,"$"!==e.charAt(e.length-1)&&(r+="$"),n=new RegExp(r)):(r=e.toString(),n=e),n.test(t)})(e.format,t)?r("invalidFieldError",{values:{field:e.label}}):"",_e=(e,t)=>"boolean"==typeof t||!e.isRequired||t&&t.toString().trim()?"":r("errorEmptyField"),Pe=()=>{n(26,ie=(ee?"":r("errorEmptyField"))||(z.DisplayCurrency.MinAmountLimit>ee?r("minAmountError",{values:{amount:re.format(z.DisplayCurrency.MinAmountLimit),currency:z.DisplayCurrency.Name}}):"")||(z.DisplayCurrency.MaxAmountLimit<ee?r("maxAmountError",{values:{amount:re.format(z.DisplayCurrency.MaxAmountLimit),currency:z.DisplayCurrency.Name}}):"")||(z.AmountMultiplier&&ee%z.AmountMultiplier!=0?r("amountMultiplierError",{values:{multiplier:z.AmountMultiplier}}):"")||(z.IsIntegerAmount&&!Number.isInteger(ee)?r("amountIntError"):"")||(Number(ee).toFixed(2)!=+ee?r("amountDecimalError"):""))},Oe=e=>{const t=W[e.name],i=e.placeholder,o=Uo(t,i),a=Uo(e.maxValue,i),s=Uo(e.minValue,i);o.isBefore(s)||o.isAfter(a)?n(28,ae[e.name]=r("invalidFieldError",{values:{field:e.label}}),ae):n(28,ae[e.name]=Le(e)?_e(e,t)||$e(e,t):"",ae)},He=e=>{const t=W[e.name];n(28,ae[e.name]=Le(e)?_e(e,t)||$e(e,t):"",ae)};return e.$$set=e=>{"endpoint"in e&&n(0,M=e.endpoint),"session"in e&&n(50,C=e.session),"playersession"in e&&n(1,E=e.playersession),"lang"in e&&n(2,D=e.lang),"local"in e&&n(3,T=e.local),"dateformat"in e&&n(51,S=e.dateformat),"timeformat"in e&&n(52,A=e.timeformat),"dateandtimeformat"in e&&n(53,L=e.dateandtimeformat),"translationurl"in e&&n(4,_=e.translationurl),"customerid"in e&&n(5,P=e.customerid),"currency"in e&&n(6,O=e.currency),"amount"in e&&n(7,H=e.amount),"assetsurl"in e&&n(8,N=e.assetsurl),"type"in e&&n(9,I=e.type),"selectedpaymentmethodname"in e&&n(54,B=e.selectedpaymentmethodname),"clientstyling"in e&&n(10,R=e.clientstyling),"clientstylingurl"in e&&n(11,F=e.clientstylingurl),"ismobileview"in e&&n(55,j=e.ismobileview)},e.$$.update=()=>{/*endpoint, currency*/65&e.$$.dirty[0]|/*session, selectedpaymentmethodname*/8912896&e.$$.dirty[1]&&M&&C&&B&&O&&(K.length&&K.forEach((e=>{e&&Fo(e,{dateFormat:S}).destroy()})),n(19,G=!1),n(15,K=[]),n(12,U=[]),n(18,W={}),n(27,oe={}),n(28,ae={}),n(14,J=[]),n(17,z=null),n(32,te=""),n(33,le=!1),me(),de()),/*clientstyling, customStylingContainer*/9216&e.$$.dirty[0]&&R&&p&&(()=>{let e=document.createElement("style");e.innerHTML=R,p.appendChild(e)})(),/*clientstylingurl, customStylingContainer*/10240&e.$$.dirty[0]&&F&&p&&(()=>{let e=new URL(F),t=document.createElement("style");fetch(e.href).then((e=>e.text())).then((e=>{t.innerHTML=e,setTimeout((()=>{p.appendChild(t)}),1),setTimeout((()=>{}),500)}))})(),/*lang*/4&e.$$.dirty[0]&&D&&ue(),/*lang, translationurl*/20&e.$$.dirty[0]&&D&&_&&(()=>{if(_)fetch(_).then((e=>e.json())).then((e=>{Object.keys(e).forEach((t=>{xi(t,e[t])}))})).catch((e=>{}))})(),/*ismobileview*/16777216&e.$$.dirty[1]&&j&&n(24,X="true"===j),/*fields, qrCodeContainer*/20480&e.$$.dirty[0]&&U.length&&J.length&&J.forEach((e=>{if(e&&e.innerText){const t=e.innerText;e.innerText="",new QRCode(e,{text:t,width:250,height:250})}})),/*fields, flatpickrEl*/36864&e.$$.dirty[0]&&U.length&&K.length&&(()=>{const e={[c.Time]:{noCalendar:!0,enableTime:!0,dateFormat:A,time_24hr:"H:i"===A,allowInput:!0},[c.Date]:{dateFormat:S,allowInput:!0,locale:Object.assign({},zo[D])},[c.DateTime]:{dateFormat:L,allowInput:!0,enableTime:!0,time_24hr:"H:i"===A,locale:Object.assign({},zo[D])}};K.forEach((t=>{if(!t)return;const r=JSON.parse(t.dataset.field);Fo(t,Object.assign(Object.assign({},e[r.type]),{maxDate:r.maxValue,minDate:r.minValue,defaultDate:r.defaultValue,onReady:(e,t)=>{n(18,W[r.name]=t,W)},onClose:(e,t,i)=>{ae[r.name]?n(18,W[r.name]="",W):n(18,W[r.name]=t,W)}}))}))})()},[M,E,D,T,_,P,O,H,N,I,R,F,U,p,J,K,c,z,W,G,g,y,w,v,X,x,ie,oe,ae,se,Q,ee,te,le,ce,r,Z,re,fe,()=>{if(ne)return;n(22,w=!0);const e=new URL(`${M}/v1/player/${P}/payment/GetPaymentPrepare`),t=new Headers;t.append("accept","application/json"),t.append("Content-Type","application/json"),ve();const r={method:"POST",mode:"cors",headers:t,body:JSON.stringify({XPaymentSessionToken:h,Transaction:{PaymentMethod:z.Name,Amount:ee,Currency:O,CustomFields:W},Account:{}})};fetch(e,r).then((e=>e.json())).then((e=>{if(e.error)postMessage({type:"ShowSessionError",error:e.error},window.location.href);else{if("Success"!==e.ResponseCode)return n(32,te=e.ResponseCode),n(22,w=!1),me(),ve(),void ye();h=e.XPaymentSessionToken,n(22,w=!1),Y=!0,ge(),ve()}}))},we,Se,Ae,(e,t)=>t?e.find((e=>e.Name===t)).Value:"",Le,Pe,Oe,He,(e,t)=>(ne=!!e||Object.values(t).some((e=>!!e)),ne),i,C,S,A,L,B,j,function(){n(25,x=Go.innerWidth)},()=>we(),function(){ee=$(this.value),n(31,ee)},()=>Pe(),()=>{n(27,oe.amount=!0,oe),Pe()},function(e){W[e.name]=this.value,n(18,W)},e=>{He(e)},e=>{n(27,oe[e.name]=!0,oe),He(e)},function(e){W[e.name]=this.value,n(18,W)},e=>{n(27,oe[e.name]=!0,oe),Oe(e)},e=>{n(27,oe[e.name]=!0,oe),Oe(e)},e=>{n(27,oe[e.name]=!0,oe),Oe(e)},function(e){q[e?"unshift":"push"]((()=>{K[K.length]=e,n(15,K)}))},function(e){W[e.name]=$(this.value),n(18,W)},e=>{He(e)},e=>{n(27,oe[e.name]=!0,oe),He(e)},function(e){W[e.name]=this.value,n(18,W)},e=>{He(e)},e=>{n(27,oe[e.name]=!0,oe),He(e)},function(e){W[e.name]=this.value,n(18,W)},(e,t)=>fe(t,e.name),(e,t)=>{Ae(e,t.Name),n(12,U)},function(e){W[e.name]=this.checked,n(18,W)},e=>{n(27,oe[e.name]=!0,oe),He(e)},function(e){q[e?"unshift":"push"]((()=>{J[J.length]=e,n(14,J)}))},e=>{Se(e.description)},function(e){W[e.name]=this.value,n(18,W)},()=>{n(20,g=!1)},function(e){q[e?"unshift":"push"]((()=>{p=e,n(13,p)}))}]}
|
|
852
852
|
/* src/CashierPage.svelte generated by Svelte v3.59.2 */
|
|
853
853
|
function Aa(e){let t;return{c(){t=M("div"),A(t,"class","DisablePage")},m(e,n){v(e,t,n)},d(e){e&&k(t)}}}
|
|
854
854
|
// (202:2) {#if lang}
|