choco-one-click-payment 1.1.41 → 1.1.43
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/index.esm.js +344 -336
- package/dist/index.js +36 -36
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('.choco-one-click-widget{position:fixed;top:0;left:0;right:0;bottom:0;z-index:999999;font-family:Sirius,sans-serif;--choco-widget-accent-color: #2F2F2F;pointer-events:none}.choco-one-click-widget--embedded{position:static;top:auto;left:auto;right:auto;bottom:auto;z-index:auto;pointer-events:auto;min-height:1px}.choco-one-click-widget--embedded .choco-widget-bottom-bar{position:static;box-shadow:none;border-radius:24px}.choco-one-click-widget--embedded .choco-widget-payment-sheet{position:fixed}.choco-one-click-widget *{box-sizing:border-box;font-family:Sirius,sans-serif}.choco-one-click-widget .choco-widget-bottom-bar{opacity:0;transform:translateY(16px)}.choco-one-click-widget .choco-widget-balance-section,.choco-one-click-widget .choco-widget-payment-info{opacity:0;transform:translateY(8px)}.choco-one-click-widget--visible .choco-widget-bottom-bar,.choco-one-click-widget--visible .choco-widget-balance-section,.choco-one-click-widget--visible .choco-widget-payment-info{opacity:1;transform:translateY(0)}.choco-widget-bottom-bar{position:absolute;bottom:0;left:0;right:0;background:#fff;border-radius:24px 24px 0 0;padding:16px;box-shadow:0 -4px 20px #0000001a;transition:transform .24s cubic-bezier(.4,0,.2,1),opacity .2s ease;pointer-events:auto}.choco-widget-payment-info{display:flex;flex-direction:column;gap:12px;align-items:stretch;transition:transform .22s ease,opacity .2s ease}.choco-widget-payment-info-main{display:flex;gap:12px;align-items:center}.choco-widget-payment-method{gap:12px;background:#f1f2f7;border-radius:16px;padding:5px 8px;cursor:pointer;transition:background .2s ease;border:none;font-family:inherit;text-align:left;width:100%;position:relative;height:46px}.choco-widget-payment-method:disabled{cursor:not-allowed;pointer-events:none;opacity:.5}.choco-widget-payment-method.google_pay,.choco-widget-payment-method.apple_pay{max-width:140px}.choco-widget-method-icon-placeholder{font-size:24px}.choco-widget-method-details{flex:1}.choco-widget-method-label{font-size:14px;color:#000}.choco-widget-method-value{font-size:14px;font-weight:600;color:#000;display:flex;align-items:center;gap:4px}.choco-widget-method-icon-wrapper svg{display:block;width:100%;max-width:29px;max-height:18px;margin-top:2px}.choco-widget-method-icon-wrapper:empty{display:none}.choco-widget-method-icon-wrapper.google_pay svg{height:17px;max-width:35px;border:1px solid #3C4043;padding:3px 4px 2px;border-radius:8px}.choco-widget-method-name{font-size:14px;font-weight:700}.choco-widget-method-name.google_pay,.choco-widget-method-name.apple_pay{display:none}.choco-widget-method-chevron{position:absolute;right:5px;top:0;bottom:0;margin:auto 0;width:24px;height:24px}.choco-widget-freedom-card-btn{width:100%;padding:13px;background:linear-gradient(to right,#17678d,#00ca82);border:none;border-radius:16px;font-size:16px;font-weight:700;font-family:inherit;color:#fff;cursor:pointer}.choco-widget-freedom-card-btn:disabled{opacity:.5;pointer-events:none}.choco-widget-pay-button{background:var(--choco-widget-accent-color);color:#fff;border:none;border-radius:16px;height:46px;padding:0 16px;font-size:16px;font-weight:600;cursor:pointer;transition:all .2s ease;white-space:nowrap;width:100%;overflow:hidden}.choco-widget-pay-button--loading{cursor:not-allowed;pointer-events:none;position:relative}.choco-widget-pay-button--loading:before{content:"";display:block;width:16px;height:16px;border:2px solid #ffffff;border-top:2px solid transparent;border-radius:50%;animation:choco-spin 1s linear infinite;position:absolute;left:0;right:0;margin:0 auto;z-index:2}.choco-widget-pay-button--loading:after{content:"";display:block;width:100%;height:100%;background:#2f2f2f;position:absolute;left:0;top:0}.choco-widget-pay-button:disabled{opacity:.5;pointer-events:none}.choco-widget-pay-button--hidden{display:none}.choco-widget-google-pay-amount{min-width:124px;height:46px;display:flex;flex-direction:column;justify-content:center;text-align:right;width:100%}.choco-widget-google-pay-amount--hidden{display:none}.choco-widget-google-pay-amount-label{font-size:20px;font-weight:700;line-height:24px;color:#1d1d1d}.choco-widget-google-pay-amount-value{font-size:14px;line-height:18px;color:#1d1d1d;white-space:nowrap;opacity:.5}.choco-widget-google-pay-amount-value--hidden{display:none}.choco-widget-google-pay-amount-value-number{text-decoration:line-through}.choco-widget-google-pay-row--hidden{display:none}.choco-widget-wallet-blocked{pointer-events:none;opacity:.6}.choco-widget-google-pay-button-slot{width:100%}.choco-widget-google-pay-button-slot>button{width:100%!important;height:52px;min-height:52px;border-radius:12px!important;font-size:16px!important}.choco-widget-apple-pay-row--hidden{display:none}.choco-widget-apple-pay-button-slot{width:100%}.choco-widget-apple-pay-button-wrapper{position:relative;width:100%;height:52px}.choco-widget-apple-pay-button{width:100%;height:52px;min-height:52px;border:0;border-radius:12px;cursor:pointer;background:#000;color:#fff;font-size:16px;display:flex;align-items:center;justify-content:center;gap:8px;padding:0 16px}.choco-widget-apple-pay-button--native{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:52px;opacity:.01;z-index:2}.choco-widget-apple-pay-button-overlay{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;gap:8px;background:#000;border-radius:12px;pointer-events:none;z-index:1}.choco-widget-apple-pay-button-text{font-size:16px;line-height:20px;font-weight:600;color:#fff}.choco-widget-apple-pay-button-icon{display:inline-flex;align-items:center;justify-content:center}.choco-widget-payment-sheet{position:absolute;bottom:0;left:0;right:0;top:0;background:#00000080;display:flex;align-items:flex-end;opacity:0;pointer-events:none;transition:opacity .3s ease}.choco-widget-payment-sheet--open{opacity:1;pointer-events:auto}.choco-widget-payment-sheet--open .choco-widget-sheet-content{transform:translateY(0)}.choco-widget-sheet-content{background:#fff;border-radius:24px 24px 0 0;width:100%;max-height:70vh;overflow-y:auto;transform:translateY(100%);transition:transform .3s cubic-bezier(.4,0,.2,1);padding:8px 16px 16px;position:relative;will-change:transform}.choco-widget-sheet-content--dragging{transition:none}.choco-widget-sheet-grabber{flex-shrink:0;display:flex;align-items:center;justify-content:center;cursor:grab;touch-action:none;margin-bottom:8px;-webkit-user-select:none;user-select:none}.choco-widget-sheet-grabber:active{cursor:grabbing}.choco-widget-sheet-grabber:before{content:"";width:72px;height:6px;background:#e5e5e7;border-radius:42px}.choco-widget-sheet-content{-webkit-overflow-scrolling:touch;overscroll-behavior:contain}.choco-widget-sheet-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px;position:relative}.choco-widget-sheet-title{font-size:20px;font-weight:700;color:#000;margin:0;flex:1;text-align:center}.choco-widget-payment-sheet--edit .choco-widget-sheet-title{padding-left:30px}.choco-widget-payment-sheet--no-cards .choco-widget-sheet-title{padding-right:30px}.choco-widget-payment-sheet--delete-confirm .choco-widget-sheet-title{padding:0}.choco-widget-sheet-button{background:none;border:none;width:32px;height:32px;border-radius:50%;display:flex;align-items:center;justify-content:center;cursor:pointer;padding:0}.choco-widget-sheet-button svg{color:#000}.choco-widget-sheet-delete-confirm{display:none;padding-top:16px}.choco-widget-payment-sheet--delete-confirm .choco-widget-payment-methods,.choco-widget-payment-sheet--delete-confirm .choco-widget-cashback-section{display:none!important}.choco-widget-payment-sheet--delete-confirm .choco-widget-sheet-delete-confirm{display:block}.choco-widget-sheet-delete-confirm-text{margin:0 0 24px;font-size:16px;line-height:1.4;color:#242424;text-align:center}.choco-widget-sheet-delete-confirm-actions{display:flex;gap:12px}.choco-widget-delete-confirm-btn{flex:1;padding:14px 20px;font-size:16px;font-weight:600;font-family:inherit;border-radius:16px;border:none;cursor:pointer;transition:background .2s ease,opacity .2s ease}.choco-widget-delete-confirm-btn--cancel{background:#f1f2f7;color:#242424}.choco-widget-delete-confirm-btn--delete{background:var(--choco-widget-accent-color);color:#fff}.choco-widget-delete-confirm-btn--loading{cursor:not-allowed;pointer-events:none;position:relative}.choco-widget-sheet-delete-confirm-actions.choco-widget-sheet-delete-confirm-actions--loading .choco-widget-delete-confirm-btn{pointer-events:none;cursor:not-allowed;opacity:.7}.choco-widget-delete-confirm-btn--delete.choco-widget-delete-confirm-btn--loading:before{content:"";display:block;width:16px;height:16px;border:2px solid #ffffff;border-top:2px solid transparent;border-radius:50%;animation:choco-spin 1s linear infinite;position:absolute;left:0;right:0;margin:0 auto;z-index:2}.choco-widget-delete-confirm-btn--delete.choco-widget-delete-confirm-btn--loading:after{content:"";display:block;width:100%;height:100%;background:#cc3434;position:absolute;left:0;top:0;border-radius:16px}.choco-widget-add-card-sheet{align-items:stretch}.choco-widget-add-card-sheet .choco-widget-add-card-sheet-content{max-height:none;height:100%;display:flex;flex-direction:column;transform:none;border-radius:0;padding:0}.choco-widget-add-card-sheet--open .choco-widget-add-card-sheet-content{transform:none}.choco-widget-add-card-sheet .choco-widget-sheet-header{flex-shrink:0;margin-bottom:0;padding:12px 0;border-bottom:1px solid #eee}.choco-widget-add-card-iframe-wrapper{flex:1;min-height:0;background:#fff}.choco-widget-add-card-iframe{width:100%;height:100%;border:none;display:block}.choco-widget-balance-section{margin-bottom:12px;padding:12px 8px;background:#f1f2f7;border-radius:12px;transition:transform .22s ease,opacity .2s ease}.choco-widget-balance-section.disabled{opacity:.5;pointer-events:none}.choco-widget-balance-toggle{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px;padding:4px 0}.choco-widget-balance-toggle:last-child{margin-bottom:0}.choco-widget-balance-toggle--disabled{opacity:.5;pointer-events:none}.choco-widget-balance-info{display:flex;align-items:center;gap:12px}.choco-widget-balance-text{display:flex;flex-direction:column}.choco-widget-balance-label-wrapper{display:flex;align-items:center;gap:8px}.choco-widget-balance-label{font-size:16px;font-weight:500}.choco-widget-balance-sublabel{font-size:12px;color:#767485;margin-top:2px}.choco-widget-balance-icon{width:22px;height:22px}.choco-widget-balance-amount{font-size:16px;font-weight:500;color:#000;white-space:nowrap}.choco-widget-toggle{position:relative;display:inline-block;width:42px;height:26px}.choco-widget-toggle input{opacity:0;width:0;height:0}.choco-widget-toggle-slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#d4d3df;transition:.3s;border-radius:28px}.choco-widget-toggle-slider:before{position:absolute;content:"";height:22px;width:22px;left:2px;bottom:0;top:0;margin:auto;background-color:#fff;transition:.3s;border-radius:50%}.choco-widget-toggle input:checked+.choco-widget-toggle-slider{background-color:var(--choco-widget-accent-color)}.choco-widget-toggle input:checked+.choco-widget-toggle-slider:before{transform:translate(16px)}.choco-widget-cashback-section{margin-top:20px;padding-top:20px;border-top:1px solid #f0f0f0}.choco-widget-cashback-info{display:flex;align-items:center;gap:8px;padding:12px 16px;background:#fff5ee;border-radius:12px;font-size:14px;color:#ff6b00}.choco-widget-cashback-icon{font-size:20px}.choco-widget-cashback-text strong{font-weight:700}.choco-widget-payment-methods{display:flex;flex-direction:column;gap:8px}.choco-widget-method-item{display:flex;align-items:center;gap:12px;padding:10px 0;cursor:pointer;transition:all .2s ease;border:2px solid transparent;width:100%;border:0;background:none;text-align:left;font-family:inherit;font-size:inherit}.choco-widget-method-item-icon-wrapper{width:37px}.choco-widget-method-item-icon-wrapper svg{display:block;width:100%;max-width:29px;height:29px;margin:0 auto}.choco-widget-method-item-icon-wrapper.google_pay{outline:1px solid #3C4043;padding:3px 5px 2px;border-radius:15px}.choco-widget-method-item-icon-wrapper.google_pay svg{height:15px;max-width:29px}.choco-widget-method-item-label{flex:1;font-size:16px;color:#000}.choco-widget-method-item-check,.choco-widget-method-item-trash-btn{flex-shrink:0;display:flex;align-items:center;justify-content:center;padding:6px;margin:-6px 0 -6px 6px;background:none;border:none;cursor:pointer;border-radius:8px;-webkit-tap-highlight-color:transparent}.choco-widget-method-item-check{height:30px;width:30px}.choco-widget-method-item-trash-btn:hover{background:#cc343414}.choco-widget-method-item-trash{flex-shrink:0;width:20px;height:20px}.choco-widget-bottom-bar-prerender{position:absolute;bottom:0;left:0;right:0;background:#fff;border-radius:24px 24px 0 0;box-shadow:0 -4px 20px #0000001a;transition:transform .3s cubic-bezier(.4,0,.2,1);height:78px}.choco-widget-payment-loading{width:30px;height:30px;animation:choco-spin 1s linear infinite;border:3px solid var(--choco-widget-accent-color);border-top:3px solid transparent;border-radius:50%;position:absolute;top:0;bottom:0;left:0;right:0;margin:auto}@keyframes choco-spin{to{transform:rotate(360deg)}}@keyframes choco-fade-in{0%{opacity:0;transform:translate(-50%,-50%) scale(.9)}to{opacity:1;transform:translate(-50%,-50%) scale(1)}}@media(max-width:768px){.choco-widget-bottom-bar{padding:16px 16px 20px}.choco-widget-sheet-content{max-height:80vh}.choco-widget-sheet-title{font-size:18px}.choco-widget-method-item-label{font-size:17px}}@media(max-width:768px)and (min-height:812px){.choco-widget-bottom-bar,.choco-widget-sheet-content{padding-bottom:calc(20px + env(safe-area-inset-bottom,20px))}}@supports (padding: env(safe-area-inset-bottom)){.choco-widget-bottom-bar{padding-bottom:calc(16px + env(safe-area-inset-bottom))}.choco-widget-sheet-content{padding-bottom:calc(20px + env(safe-area-inset-bottom))}}')),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('.choco-one-click-widget{position:fixed;top:0;left:0;right:0;bottom:0;z-index:999999;font-family:Sirius,sans-serif;--choco-widget-accent-color: #2F2F2F;pointer-events:none}.choco-one-click-widget--embedded{position:static;top:auto;left:auto;right:auto;bottom:auto;z-index:auto;pointer-events:auto;min-height:1px}.choco-one-click-widget--embedded .choco-widget-bottom-bar{position:static;box-shadow:none;border-radius:24px}.choco-one-click-widget--embedded .choco-widget-payment-sheet{position:fixed}.choco-one-click-widget *{box-sizing:border-box;font-family:Sirius,sans-serif}.choco-one-click-widget .choco-widget-bottom-bar{opacity:0;transform:translateY(16px)}.choco-one-click-widget .choco-widget-balance-section,.choco-one-click-widget .choco-widget-payment-info{opacity:0;transform:translateY(8px)}.choco-one-click-widget--visible .choco-widget-bottom-bar,.choco-one-click-widget--visible .choco-widget-balance-section,.choco-one-click-widget--visible .choco-widget-payment-info{opacity:1;transform:translateY(0)}.choco-widget-bottom-bar{position:absolute;bottom:0;left:0;right:0;background:#fff;border-radius:24px 24px 0 0;padding:16px;box-shadow:0 -4px 20px #0000001a;transition:transform .24s cubic-bezier(.4,0,.2,1),opacity .2s ease;pointer-events:auto}.choco-widget-payment-info{display:flex;flex-direction:column;gap:12px;align-items:stretch;transition:transform .22s ease,opacity .2s ease}.choco-widget-payment-info-main{display:flex;gap:12px;align-items:center}.choco-widget-payment-method{gap:12px;background:#f1f2f7;border-radius:16px;padding:5px 8px;cursor:pointer;transition:background .2s ease;border:none;font-family:inherit;text-align:left;width:100%;position:relative;height:46px}.choco-widget-payment-method:disabled{cursor:not-allowed;pointer-events:none;opacity:.5}.choco-widget-payment-method.google_pay,.choco-widget-payment-method.apple_pay{max-width:140px}.choco-widget-method-icon-placeholder{font-size:24px}.choco-widget-method-details{flex:1}.choco-widget-method-label{font-size:14px;color:#000}.choco-widget-method-value{font-size:14px;font-weight:600;color:#000;display:flex;align-items:center;gap:4px}.choco-widget-method-icon-wrapper svg{display:block;width:100%;max-width:29px;max-height:18px;margin-top:2px}.choco-widget-method-icon-wrapper:empty{display:none}.choco-widget-method-icon-wrapper.google_pay svg{height:17px;max-width:35px;border:1px solid #3C4043;padding:3px 4px 2px;border-radius:8px}.choco-widget-method-name{font-size:14px;font-weight:700}.choco-widget-method-name.google_pay,.choco-widget-method-name.apple_pay{display:none}.choco-widget-method-chevron{position:absolute;right:5px;top:0;bottom:0;margin:auto 0;width:24px;height:24px}.choco-widget-freedom-card-btn{width:100%;height:46px;padding:0 13px;background:linear-gradient(to right,#17678d,#00ca82);border:none;border-radius:16px;font-size:16px;font-weight:700;font-family:inherit;color:#fff;cursor:pointer}.choco-widget-freedom-card-btn:disabled{opacity:.5;pointer-events:none}.choco-widget-pay-button{background:var(--choco-widget-accent-color);color:#fff;border:none;border-radius:16px;height:46px;padding:0 16px;font-size:16px;font-weight:600;cursor:pointer;transition:all .2s ease;white-space:nowrap;width:100%;overflow:hidden}.choco-widget-pay-button--loading{cursor:not-allowed;pointer-events:none;position:relative}.choco-widget-pay-button--loading:before{content:"";display:block;width:16px;height:16px;border:2px solid #ffffff;border-top:2px solid transparent;border-radius:50%;animation:choco-spin 1s linear infinite;position:absolute;left:0;right:0;margin:0 auto;z-index:2}.choco-widget-pay-button--loading:after{content:"";display:block;width:100%;height:100%;background:#2f2f2f;position:absolute;left:0;top:0}.choco-widget-pay-button:disabled{opacity:.5;pointer-events:none}.choco-widget-pay-button--hidden{display:none}.choco-widget-google-pay-amount{min-width:124px;height:46px;display:flex;flex-direction:column;justify-content:center;text-align:right;width:100%}.choco-widget-google-pay-amount--hidden{display:none}.choco-widget-google-pay-amount-label{font-size:20px;font-weight:700;line-height:24px;color:#1d1d1d}.choco-widget-google-pay-amount-value{font-size:14px;line-height:18px;color:#1d1d1d;white-space:nowrap;opacity:.5}.choco-widget-google-pay-amount-value--hidden{display:none}.choco-widget-google-pay-amount-value-number{text-decoration:line-through}.choco-widget-google-pay-row--hidden{display:none}.choco-widget-wallet-blocked{pointer-events:none;opacity:.6}.choco-widget-google-pay-button-slot{width:100%}.choco-widget-google-pay-button-slot>button{width:100%!important;height:52px;min-height:52px;border-radius:12px!important;font-size:16px!important}.choco-widget-apple-pay-row--hidden{display:none}.choco-widget-apple-pay-button-slot{width:100%}.choco-widget-apple-pay-button-wrapper{position:relative;width:100%;height:52px}.choco-widget-apple-pay-button{width:100%;height:52px;min-height:52px;border:0;border-radius:12px;cursor:pointer;background:#000;color:#fff;font-size:16px;display:flex;align-items:center;justify-content:center;gap:8px;padding:0 16px}.choco-widget-apple-pay-button--native{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:52px;opacity:.01;z-index:2}.choco-widget-apple-pay-button-overlay{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;gap:8px;background:#000;border-radius:12px;pointer-events:none;z-index:1}.choco-widget-apple-pay-button-text{font-size:16px;line-height:20px;font-weight:600;color:#fff}.choco-widget-apple-pay-button-icon{display:inline-flex;align-items:center;justify-content:center}.choco-widget-payment-sheet{position:absolute;bottom:0;left:0;right:0;top:0;background:#00000080;display:flex;align-items:flex-end;opacity:0;pointer-events:none;transition:opacity .3s ease}.choco-widget-payment-sheet--open{opacity:1;pointer-events:auto}.choco-widget-payment-sheet--open .choco-widget-sheet-content{transform:translateY(0)}.choco-widget-sheet-content{background:#fff;border-radius:24px 24px 0 0;width:100%;max-height:70vh;overflow-y:auto;transform:translateY(100%);transition:transform .3s cubic-bezier(.4,0,.2,1);padding:8px 16px 16px;position:relative;will-change:transform}.choco-widget-sheet-content--dragging{transition:none}.choco-widget-sheet-grabber{flex-shrink:0;display:flex;align-items:center;justify-content:center;cursor:grab;touch-action:none;margin-bottom:8px;-webkit-user-select:none;user-select:none}.choco-widget-sheet-grabber:active{cursor:grabbing}.choco-widget-sheet-grabber:before{content:"";width:72px;height:6px;background:#e5e5e7;border-radius:42px}.choco-widget-sheet-content{-webkit-overflow-scrolling:touch;overscroll-behavior:contain}.choco-widget-sheet-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px;position:relative}.choco-widget-sheet-title{font-size:20px;font-weight:700;color:#000;margin:0;flex:1;text-align:center}.choco-widget-payment-sheet--edit .choco-widget-sheet-title{padding-left:30px}.choco-widget-payment-sheet--no-cards .choco-widget-sheet-title{padding-right:30px}.choco-widget-payment-sheet--delete-confirm .choco-widget-sheet-title{padding:0}.choco-widget-sheet-button{background:none;border:none;width:32px;height:32px;border-radius:50%;display:flex;align-items:center;justify-content:center;cursor:pointer;padding:0}.choco-widget-sheet-button svg{color:#000}.choco-widget-sheet-delete-confirm{display:none;padding-top:16px}.choco-widget-payment-sheet--delete-confirm .choco-widget-payment-methods,.choco-widget-payment-sheet--delete-confirm .choco-widget-cashback-section{display:none!important}.choco-widget-payment-sheet--delete-confirm .choco-widget-sheet-delete-confirm{display:block}.choco-widget-sheet-delete-confirm-text{margin:0 0 24px;font-size:16px;line-height:1.4;color:#242424;text-align:center}.choco-widget-sheet-delete-confirm-actions{display:flex;gap:12px}.choco-widget-delete-confirm-btn{flex:1;padding:14px 20px;font-size:16px;font-weight:600;font-family:inherit;border-radius:16px;border:none;cursor:pointer;transition:background .2s ease,opacity .2s ease}.choco-widget-delete-confirm-btn--cancel{background:#f1f2f7;color:#242424}.choco-widget-delete-confirm-btn--delete{background:var(--choco-widget-accent-color);color:#fff}.choco-widget-delete-confirm-btn--loading{cursor:not-allowed;pointer-events:none;position:relative}.choco-widget-sheet-delete-confirm-actions.choco-widget-sheet-delete-confirm-actions--loading .choco-widget-delete-confirm-btn{pointer-events:none;cursor:not-allowed;opacity:.7}.choco-widget-delete-confirm-btn--delete.choco-widget-delete-confirm-btn--loading:before{content:"";display:block;width:16px;height:16px;border:2px solid #ffffff;border-top:2px solid transparent;border-radius:50%;animation:choco-spin 1s linear infinite;position:absolute;left:0;right:0;margin:0 auto;z-index:2}.choco-widget-delete-confirm-btn--delete.choco-widget-delete-confirm-btn--loading:after{content:"";display:block;width:100%;height:100%;background:#cc3434;position:absolute;left:0;top:0;border-radius:16px}.choco-widget-add-card-sheet{align-items:stretch}.choco-widget-add-card-sheet .choco-widget-add-card-sheet-content{max-height:none;height:100%;display:flex;flex-direction:column;transform:none;border-radius:0;padding:0}.choco-widget-add-card-sheet--open .choco-widget-add-card-sheet-content{transform:none}.choco-widget-add-card-sheet .choco-widget-sheet-header{flex-shrink:0;margin-bottom:0;padding:12px 0;border-bottom:1px solid #eee}.choco-widget-add-card-iframe-wrapper{flex:1;min-height:0;background:#fff}.choco-widget-add-card-iframe{width:100%;height:100%;border:none;display:block}.choco-widget-balance-section{margin-bottom:12px;padding:12px 8px;background:#f1f2f7;border-radius:12px;transition:transform .22s ease,opacity .2s ease}.choco-widget-balance-section.disabled{opacity:.5;pointer-events:none}.choco-widget-balance-toggle{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px;padding:4px 0}.choco-widget-balance-toggle:last-child{margin-bottom:0}.choco-widget-balance-toggle--disabled{opacity:.5;pointer-events:none}.choco-widget-balance-info{display:flex;align-items:center;gap:12px}.choco-widget-balance-text{display:flex;flex-direction:column}.choco-widget-balance-label-wrapper{display:flex;align-items:center;gap:8px}.choco-widget-balance-label{font-size:16px;font-weight:500}.choco-widget-balance-sublabel{font-size:12px;color:#767485;margin-top:2px}.choco-widget-balance-icon{width:22px;height:22px}.choco-widget-balance-amount{font-size:16px;font-weight:500;color:#000;white-space:nowrap}.choco-widget-toggle{position:relative;display:inline-block;width:42px;height:26px}.choco-widget-toggle input{opacity:0;width:0;height:0}.choco-widget-toggle-slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#d4d3df;transition:.3s;border-radius:28px}.choco-widget-toggle-slider:before{position:absolute;content:"";height:22px;width:22px;left:2px;bottom:0;top:0;margin:auto;background-color:#fff;transition:.3s;border-radius:50%}.choco-widget-toggle input:checked+.choco-widget-toggle-slider{background-color:var(--choco-widget-accent-color)}.choco-widget-toggle input:checked+.choco-widget-toggle-slider:before{transform:translate(16px)}.choco-widget-cashback-section{margin-top:20px;padding-top:20px;border-top:1px solid #f0f0f0}.choco-widget-cashback-info{display:flex;align-items:center;gap:8px;padding:12px 16px;background:#fff5ee;border-radius:12px;font-size:14px;color:#ff6b00}.choco-widget-cashback-icon{font-size:20px}.choco-widget-cashback-text strong{font-weight:700}.choco-widget-payment-methods{display:flex;flex-direction:column;gap:8px}.choco-widget-method-item{display:flex;align-items:center;gap:12px;padding:10px 0;cursor:pointer;transition:all .2s ease;border:2px solid transparent;width:100%;border:0;background:none;text-align:left;font-family:inherit;font-size:inherit}.choco-widget-method-item-icon-wrapper{width:37px}.choco-widget-method-item-icon-wrapper svg{display:block;width:100%;max-width:29px;height:29px;margin:0 auto}.choco-widget-method-item-icon-wrapper.google_pay{outline:1px solid #3C4043;padding:3px 5px 2px;border-radius:15px}.choco-widget-method-item-icon-wrapper.google_pay svg{height:15px;max-width:29px}.choco-widget-method-item-label{flex:1;font-size:16px;color:#000}.choco-widget-method-item-check,.choco-widget-method-item-trash-btn{flex-shrink:0;display:flex;align-items:center;justify-content:center;padding:6px;margin:-6px 0 -6px 6px;background:none;border:none;cursor:pointer;border-radius:8px;-webkit-tap-highlight-color:transparent}.choco-widget-method-item-check{height:30px;width:30px}.choco-widget-method-item-trash-btn:hover{background:#cc343414}.choco-widget-method-item-trash{flex-shrink:0;width:20px;height:20px}.choco-widget-bottom-bar-prerender{position:absolute;bottom:0;left:0;right:0;background:#fff;border-radius:24px 24px 0 0;box-shadow:0 -4px 20px #0000001a;transition:transform .3s cubic-bezier(.4,0,.2,1);height:78px}.choco-widget-payment-loading{width:30px;height:30px;animation:choco-spin 1s linear infinite;border:3px solid var(--choco-widget-accent-color);border-top:3px solid transparent;border-radius:50%;position:absolute;top:0;bottom:0;left:0;right:0;margin:auto}@keyframes choco-spin{to{transform:rotate(360deg)}}@keyframes choco-fade-in{0%{opacity:0;transform:translate(-50%,-50%) scale(.9)}to{opacity:1;transform:translate(-50%,-50%) scale(1)}}@media(max-width:768px){.choco-widget-bottom-bar{padding:16px 16px 20px}.choco-widget-sheet-content{max-height:80vh}.choco-widget-sheet-title{font-size:18px}.choco-widget-method-item-label{font-size:17px}}@media(max-width:768px)and (min-height:812px){.choco-widget-bottom-bar,.choco-widget-sheet-content{padding-bottom:calc(20px + env(safe-area-inset-bottom,20px))}}@supports (padding: env(safe-area-inset-bottom)){.choco-widget-bottom-bar{padding-bottom:calc(16px + env(safe-area-inset-bottom))}.choco-widget-sheet-content{padding-bottom:calc(20px + env(safe-area-inset-bottom))}}')),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
|
|
2
2
|
const bt = {
|
|
3
3
|
ru: {
|
|
4
4
|
paymentMethod: "Способ оплаты",
|
|
@@ -183,7 +183,7 @@ function Be(e, t, o) {
|
|
|
183
183
|
return i[6] = i[6] & 15 | 64, i[8] = i[8] & 63 | 128, Qt(i);
|
|
184
184
|
}
|
|
185
185
|
const Ve = "choco_device_id";
|
|
186
|
-
function
|
|
186
|
+
function K(e, t = "ru", o = "KZT") {
|
|
187
187
|
const i = Number(e), s = t === "ru" ? "ru-RU" : "en-US";
|
|
188
188
|
return `${i.toLocaleString(s)} ${Et[o]}`;
|
|
189
189
|
}
|
|
@@ -237,42 +237,42 @@ function wt() {
|
|
|
237
237
|
Object.defineProperty(l, "__esModule", {
|
|
238
238
|
value: !0
|
|
239
239
|
}), l.Centrifuge = void 0;
|
|
240
|
-
var C = S(f(187)),
|
|
240
|
+
var C = S(f(187)), B = S(f(471)), _ = f(147), b = f(853);
|
|
241
241
|
function S(g) {
|
|
242
242
|
return g && g.__esModule ? g : { default: g };
|
|
243
243
|
}
|
|
244
|
-
function
|
|
244
|
+
function T(g) {
|
|
245
245
|
"@babel/helpers - typeof";
|
|
246
|
-
return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ?
|
|
246
|
+
return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? T = function(p) {
|
|
247
247
|
return typeof p;
|
|
248
|
-
} :
|
|
248
|
+
} : T = function(p) {
|
|
249
249
|
return p && typeof Symbol == "function" && p.constructor === Symbol && p !== Symbol.prototype ? "symbol" : typeof p;
|
|
250
|
-
},
|
|
250
|
+
}, T(g);
|
|
251
251
|
}
|
|
252
|
-
function
|
|
252
|
+
function v(g, h) {
|
|
253
253
|
if (!(g instanceof h))
|
|
254
254
|
throw new TypeError("Cannot call a class as a function");
|
|
255
255
|
}
|
|
256
|
-
function
|
|
256
|
+
function k(g, h) {
|
|
257
257
|
for (var p = 0; p < h.length; p++) {
|
|
258
258
|
var A = h[p];
|
|
259
259
|
A.enumerable = A.enumerable || !1, A.configurable = !0, "value" in A && (A.writable = !0), Object.defineProperty(g, A.key, A);
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
|
-
function
|
|
263
|
-
return h &&
|
|
262
|
+
function w(g, h, p) {
|
|
263
|
+
return h && k(g.prototype, h), g;
|
|
264
264
|
}
|
|
265
|
-
function
|
|
265
|
+
function I(g, h) {
|
|
266
266
|
if (typeof h != "function" && h !== null)
|
|
267
267
|
throw new TypeError("Super expression must either be null or a function");
|
|
268
|
-
g.prototype = Object.create(h && h.prototype, { constructor: { value: g, writable: !0, configurable: !0 } }), h &&
|
|
268
|
+
g.prototype = Object.create(h && h.prototype, { constructor: { value: g, writable: !0, configurable: !0 } }), h && R(g, h);
|
|
269
269
|
}
|
|
270
|
-
function
|
|
271
|
-
return
|
|
270
|
+
function R(g, h) {
|
|
271
|
+
return R = Object.setPrototypeOf || function(A, n) {
|
|
272
272
|
return A.__proto__ = n, A;
|
|
273
|
-
},
|
|
273
|
+
}, R(g, h);
|
|
274
274
|
}
|
|
275
|
-
function
|
|
275
|
+
function L(g) {
|
|
276
276
|
var h = q();
|
|
277
277
|
return function() {
|
|
278
278
|
var A = J(g), n;
|
|
@@ -281,11 +281,11 @@ function wt() {
|
|
|
281
281
|
n = Reflect.construct(A, arguments, r);
|
|
282
282
|
} else
|
|
283
283
|
n = A.apply(this, arguments);
|
|
284
|
-
return
|
|
284
|
+
return x(this, n);
|
|
285
285
|
};
|
|
286
286
|
}
|
|
287
|
-
function
|
|
288
|
-
if (h && (
|
|
287
|
+
function x(g, h) {
|
|
288
|
+
if (h && (T(h) === "object" || typeof h == "function"))
|
|
289
289
|
return h;
|
|
290
290
|
if (h !== void 0)
|
|
291
291
|
throw new TypeError("Derived constructors may only return object or undefined");
|
|
@@ -311,12 +311,12 @@ function wt() {
|
|
|
311
311
|
return p.__proto__ || Object.getPrototypeOf(p);
|
|
312
312
|
}, J(g);
|
|
313
313
|
}
|
|
314
|
-
var
|
|
315
|
-
|
|
316
|
-
var h =
|
|
314
|
+
var F = "timeout", M = "connection closed", m = /* @__PURE__ */ (function(g) {
|
|
315
|
+
I(p, g);
|
|
316
|
+
var h = L(p);
|
|
317
317
|
function p(A, n) {
|
|
318
318
|
var r;
|
|
319
|
-
return
|
|
319
|
+
return v(this, p), r = h.call(this), r._url = A, r._websocket = null, r._sockjs = null, r._isSockjs = !1, r._xmlhttprequest = null, r._binary = !1, r._methodType = null, r._pushType = null, r._encoder = null, r._decoder = null, r._status = "disconnected", r._reconnect = !0, r._reconnecting = !1, r._transport = null, r._transportName = null, r._transportClosed = !0, r._messageId = 0, r._clientID = null, r._refreshRequired = !1, r._subs = {}, r._serverSubs = {}, r._lastSeq = {}, r._lastGen = {}, r._lastOffset = {}, r._lastEpoch = {}, r._messages = [], r._isBatching = !1, r._isSubscribeBatching = !1, r._privateChannels = {}, r._numRefreshFailed = 0, r._refreshTimeout = null, r._pingTimeout = null, r._pongTimeout = null, r._subRefreshTimeouts = {}, r._retries = 0, r._callbacks = {}, r._latency = null, r._latencyStart = null, r._connectData = null, r._token = null, r._xhrID = 0, r._xhrs = {}, r._dispatchPromise = Promise.resolve(), r._protocol = "", r._config = {
|
|
320
320
|
protocol: "",
|
|
321
321
|
debug: !1,
|
|
322
322
|
name: "js",
|
|
@@ -351,7 +351,7 @@ function wt() {
|
|
|
351
351
|
disableWithCredentials: !1
|
|
352
352
|
}, r._configure(n), r;
|
|
353
353
|
}
|
|
354
|
-
return
|
|
354
|
+
return w(p, [{
|
|
355
355
|
key: "setToken",
|
|
356
356
|
value: function(n) {
|
|
357
357
|
this._token = n;
|
|
@@ -393,8 +393,8 @@ function wt() {
|
|
|
393
393
|
this._debug("sending AJAX request to", n, "with data", JSON.stringify(d));
|
|
394
394
|
var Q;
|
|
395
395
|
this._xmlhttprequest !== null ? Q = new this._xmlhttprequest() : Q = f.g.XMLHttpRequest ? new f.g.XMLHttpRequest() : new f.g.ActiveXObject("Microsoft.XMLHTTP");
|
|
396
|
-
for (var
|
|
397
|
-
r.hasOwnProperty(
|
|
396
|
+
for (var O in r)
|
|
397
|
+
r.hasOwnProperty(O) && (P.length > 0 && (P += "&"), P += encodeURIComponent(O) + "=" + encodeURIComponent(r[O]));
|
|
398
398
|
P.length > 0 && (P = "?" + P), Q.open("POST", n + P, !0), "withCredentials" in Q && (Q.withCredentials = !this._config.disableWithCredentials), Q.setRequestHeader("X-Requested-With", "XMLHttpRequest"), Q.setRequestHeader("Content-Type", "application/json");
|
|
399
399
|
for (var X in c)
|
|
400
400
|
c.hasOwnProperty(X) && Q.setRequestHeader(X, c[X]);
|
|
@@ -437,7 +437,7 @@ function wt() {
|
|
|
437
437
|
}, {
|
|
438
438
|
key: "_websocketSupported",
|
|
439
439
|
value: function() {
|
|
440
|
-
return this._config.websocket !== null ? !0 : !(typeof WebSocket != "function" && (typeof WebSocket > "u" ? "undefined" :
|
|
440
|
+
return this._config.websocket !== null ? !0 : !(typeof WebSocket != "function" && (typeof WebSocket > "u" ? "undefined" : T(WebSocket)) !== "object");
|
|
441
441
|
}
|
|
442
442
|
}, {
|
|
443
443
|
key: "_setFormat",
|
|
@@ -445,7 +445,7 @@ function wt() {
|
|
|
445
445
|
if (!this._formatOverride(n)) {
|
|
446
446
|
if (n === "protobuf")
|
|
447
447
|
throw new Error("not implemented by JSON only Centrifuge client – use client with Protobuf");
|
|
448
|
-
this._binary = !1, this._methodType =
|
|
448
|
+
this._binary = !1, this._methodType = _.JsonMethodType, this._pushType = _.JsonPushType, this._encoder = new _.JsonEncoder(), this._decoder = new _.JsonDecoder();
|
|
449
449
|
}
|
|
450
450
|
}
|
|
451
451
|
}, {
|
|
@@ -618,11 +618,11 @@ function wt() {
|
|
|
618
618
|
};
|
|
619
619
|
n._serverSubs[P].seq || n._serverSubs[P].gen ? (n._serverSubs[P].seq && (Q.seq = n._serverSubs[P].seq), n._serverSubs[P].gen && (Q.gen = n._serverSubs[P].gen)) : n._serverSubs[P].offset && (Q.offset = n._serverSubs[P].offset), n._serverSubs[P].epoch && (Q.epoch = n._serverSubs[P].epoch), y[P] = Q;
|
|
620
620
|
}
|
|
621
|
-
E && (d.params || (d.params = {}), d.params.subs = y), n._latencyStart = /* @__PURE__ */ new Date(), n._call(d).then(function(
|
|
622
|
-
n._connectResponse(n._decoder.decodeCommandResult(n._methodType.CONNECT,
|
|
623
|
-
}, function(
|
|
624
|
-
var X =
|
|
625
|
-
X.code === 109 && (n._refreshRequired = !0), n._disconnect("connect error", !0),
|
|
621
|
+
E && (d.params || (d.params = {}), d.params.subs = y), n._latencyStart = /* @__PURE__ */ new Date(), n._call(d).then(function(O) {
|
|
622
|
+
n._connectResponse(n._decoder.decodeCommandResult(n._methodType.CONNECT, O.result), E), O.next && O.next();
|
|
623
|
+
}, function(O) {
|
|
624
|
+
var X = O.error;
|
|
625
|
+
X.code === 109 && (n._refreshRequired = !0), n._disconnect("connect error", !0), O.next && O.next();
|
|
626
626
|
});
|
|
627
627
|
}, this._transport.onerror = function(d) {
|
|
628
628
|
n._debug("transport level error", d);
|
|
@@ -867,7 +867,7 @@ function wt() {
|
|
|
867
867
|
n._refreshFailed();
|
|
868
868
|
return;
|
|
869
869
|
}
|
|
870
|
-
var
|
|
870
|
+
var O = Math.round(Math.random() * 1e3 * Math.max(n._numRefreshFailed, 20)), X = n._config.refreshInterval + O;
|
|
871
871
|
n._refreshTimeout = setTimeout(function() {
|
|
872
872
|
return n._refresh();
|
|
873
873
|
}, X);
|
|
@@ -934,12 +934,12 @@ function wt() {
|
|
|
934
934
|
this._clearSubRefreshTimeout(n);
|
|
935
935
|
else
|
|
936
936
|
return;
|
|
937
|
-
var c = this._clientID, d = this._newXHRID(), y = function(
|
|
938
|
-
if (d in r._xhrs && delete r._xhrs[d], !(
|
|
937
|
+
var c = this._clientID, d = this._newXHRID(), y = function(O) {
|
|
938
|
+
if (d in r._xhrs && delete r._xhrs[d], !(O.error || O.status !== 200 || r._clientID !== c)) {
|
|
939
939
|
var X = {};
|
|
940
|
-
if (
|
|
941
|
-
for (var U in
|
|
942
|
-
var D =
|
|
940
|
+
if (O.data.channels)
|
|
941
|
+
for (var U in O.data.channels) {
|
|
942
|
+
var D = O.data.channels[U];
|
|
943
943
|
D.channel && (X[D.channel] = D.token);
|
|
944
944
|
}
|
|
945
945
|
var re = X[n];
|
|
@@ -951,10 +951,10 @@ function wt() {
|
|
|
951
951
|
token: re
|
|
952
952
|
}
|
|
953
953
|
}, le = r._getSub(n);
|
|
954
|
-
le !== null && r._call(Pe).then(function(
|
|
955
|
-
r._subRefreshResponse(n, r._decoder.decodeCommandResult(r._methodType.SUB_REFRESH,
|
|
956
|
-
}, function(
|
|
957
|
-
r._subRefreshError(n,
|
|
954
|
+
le !== null && r._call(Pe).then(function(V) {
|
|
955
|
+
r._subRefreshResponse(n, r._decoder.decodeCommandResult(r._methodType.SUB_REFRESH, V.result)), V.next && V.next();
|
|
956
|
+
}, function(V) {
|
|
957
|
+
r._subRefreshError(n, V.error), V.next && V.next();
|
|
958
958
|
});
|
|
959
959
|
}
|
|
960
960
|
}
|
|
@@ -1029,8 +1029,8 @@ function wt() {
|
|
|
1029
1029
|
if (P || Q)
|
|
1030
1030
|
P && (y.params.seq = P), Q && (y.params.gen = Q);
|
|
1031
1031
|
else {
|
|
1032
|
-
var
|
|
1033
|
-
|
|
1032
|
+
var O = this._getLastOffset(d);
|
|
1033
|
+
O && (y.params.offset = O);
|
|
1034
1034
|
}
|
|
1035
1035
|
var X = this._getLastEpoch(d);
|
|
1036
1036
|
X && (y.params.epoch = X);
|
|
@@ -1113,8 +1113,8 @@ function wt() {
|
|
|
1113
1113
|
var Q = P.publications;
|
|
1114
1114
|
if (Q && Q.length > 0) {
|
|
1115
1115
|
Q.length > 1 && (!Q[0].offset || Q[0].offset > Q[1].offset) && (Q = Q.reverse());
|
|
1116
|
-
for (var
|
|
1117
|
-
Q.hasOwnProperty(
|
|
1116
|
+
for (var O in Q)
|
|
1117
|
+
Q.hasOwnProperty(O) && this._handlePublication(E, Q[O]);
|
|
1118
1118
|
}
|
|
1119
1119
|
}
|
|
1120
1120
|
this._serverSubs[E] = {
|
|
@@ -1155,7 +1155,7 @@ function wt() {
|
|
|
1155
1155
|
value: function(n, r) {
|
|
1156
1156
|
var c = this._getSub(n);
|
|
1157
1157
|
if (c && c._isSubscribing()) {
|
|
1158
|
-
if (r.code === 0 && r.message ===
|
|
1158
|
+
if (r.code === 0 && r.message === F) {
|
|
1159
1159
|
this._disconnect("timeout", !0);
|
|
1160
1160
|
return;
|
|
1161
1161
|
}
|
|
@@ -1313,8 +1313,8 @@ function wt() {
|
|
|
1313
1313
|
var Q = this._decoder.decodePushData(this._pushType.JOIN, c.data);
|
|
1314
1314
|
this._handleJoin(y, Q);
|
|
1315
1315
|
} else if (d === this._pushType.LEAVE) {
|
|
1316
|
-
var
|
|
1317
|
-
this._handleLeave(y,
|
|
1316
|
+
var O = this._decoder.decodePushData(this._pushType.LEAVE, c.data);
|
|
1317
|
+
this._handleLeave(y, O);
|
|
1318
1318
|
} else if (d === this._pushType.UNSUBSCRIBE) {
|
|
1319
1319
|
var X = this._decoder.decodePushData(this._pushType.UNSUBSCRIBE, c.data);
|
|
1320
1320
|
this._handleUnsub(y, X);
|
|
@@ -1390,7 +1390,7 @@ function wt() {
|
|
|
1390
1390
|
timeout: null
|
|
1391
1391
|
}, this._callbacks[n].timeout = setTimeout(function() {
|
|
1392
1392
|
delete d._callbacks[n], (0, b.isFunction)(c) && c({
|
|
1393
|
-
error: d._createErrorObject(
|
|
1393
|
+
error: d._createErrorObject(F)
|
|
1394
1394
|
});
|
|
1395
1395
|
}, this._config.timeout);
|
|
1396
1396
|
}
|
|
@@ -1457,7 +1457,7 @@ function wt() {
|
|
|
1457
1457
|
var E = {
|
|
1458
1458
|
client: this._clientID,
|
|
1459
1459
|
channels: c
|
|
1460
|
-
}, P = this._clientID, Q = this._newXHRID(),
|
|
1460
|
+
}, P = this._clientID, Q = this._newXHRID(), O = function(D) {
|
|
1461
1461
|
if (Q in n._xhrs && delete n._xhrs[Q], n._clientID === P) {
|
|
1462
1462
|
if (D.error || D.status !== 200) {
|
|
1463
1463
|
n._debug("authorization request failed");
|
|
@@ -1470,8 +1470,8 @@ function wt() {
|
|
|
1470
1470
|
}
|
|
1471
1471
|
var le = {};
|
|
1472
1472
|
if (D.data.channels)
|
|
1473
|
-
for (var
|
|
1474
|
-
var ke = D.data.channels[
|
|
1473
|
+
for (var V in D.data.channels) {
|
|
1474
|
+
var ke = D.data.channels[V];
|
|
1475
1475
|
ke.channel && (le[ke.channel] = ke.token);
|
|
1476
1476
|
}
|
|
1477
1477
|
var Fe = !1;
|
|
@@ -1519,9 +1519,9 @@ function wt() {
|
|
|
1519
1519
|
if (this._config.onPrivateSubscribe !== null)
|
|
1520
1520
|
this._config.onPrivateSubscribe({
|
|
1521
1521
|
data: E
|
|
1522
|
-
},
|
|
1522
|
+
}, O);
|
|
1523
1523
|
else {
|
|
1524
|
-
var X = this._ajax(this._config.subscribeEndpoint, this._config.subscribeParams, this._config.subscribeHeaders, E,
|
|
1524
|
+
var X = this._ajax(this._config.subscribeEndpoint, this._config.subscribeParams, this._config.subscribeHeaders, E, O);
|
|
1525
1525
|
this._xhrs[Q] = X;
|
|
1526
1526
|
}
|
|
1527
1527
|
}
|
|
@@ -1536,7 +1536,7 @@ function wt() {
|
|
|
1536
1536
|
var d = this._getSub(n);
|
|
1537
1537
|
if (d !== null)
|
|
1538
1538
|
return d._setEvents(r), d._isUnsubscribed() && d.subscribe(c), d;
|
|
1539
|
-
var y = new
|
|
1539
|
+
var y = new B.default(this, n, r);
|
|
1540
1540
|
return this._subs[n] = y, y.subscribe(c), y;
|
|
1541
1541
|
}
|
|
1542
1542
|
}]), p;
|
|
@@ -1551,8 +1551,8 @@ function wt() {
|
|
|
1551
1551
|
Object.defineProperty(l, "__esModule", {
|
|
1552
1552
|
value: !0
|
|
1553
1553
|
}), l.default = void 0;
|
|
1554
|
-
var C = f(382),
|
|
1555
|
-
l.default =
|
|
1554
|
+
var C = f(382), B = C.Centrifuge;
|
|
1555
|
+
l.default = B, a.exports = l.default;
|
|
1556
1556
|
})
|
|
1557
1557
|
),
|
|
1558
1558
|
/***/
|
|
@@ -1562,20 +1562,20 @@ function wt() {
|
|
|
1562
1562
|
Object.defineProperty(l, "__esModule", {
|
|
1563
1563
|
value: !0
|
|
1564
1564
|
}), l.JsonPushType = l.JsonMethodType = l.JsonEncoder = l.JsonDecoder = void 0;
|
|
1565
|
-
function f(
|
|
1566
|
-
if (!(
|
|
1565
|
+
function f(v, k) {
|
|
1566
|
+
if (!(v instanceof k))
|
|
1567
1567
|
throw new TypeError("Cannot call a class as a function");
|
|
1568
1568
|
}
|
|
1569
|
-
function C(
|
|
1570
|
-
for (var
|
|
1571
|
-
var
|
|
1572
|
-
|
|
1569
|
+
function C(v, k) {
|
|
1570
|
+
for (var w = 0; w < k.length; w++) {
|
|
1571
|
+
var I = k[w];
|
|
1572
|
+
I.enumerable = I.enumerable || !1, I.configurable = !0, "value" in I && (I.writable = !0), Object.defineProperty(v, I.key, I);
|
|
1573
1573
|
}
|
|
1574
1574
|
}
|
|
1575
|
-
function v
|
|
1576
|
-
return
|
|
1575
|
+
function B(v, k, w) {
|
|
1576
|
+
return k && C(v.prototype, k), v;
|
|
1577
1577
|
}
|
|
1578
|
-
var
|
|
1578
|
+
var _ = {
|
|
1579
1579
|
CONNECT: 0,
|
|
1580
1580
|
SUBSCRIBE: 1,
|
|
1581
1581
|
UNSUBSCRIBE: 2,
|
|
@@ -1589,7 +1589,7 @@ function wt() {
|
|
|
1589
1589
|
REFRESH: 10,
|
|
1590
1590
|
SUB_REFRESH: 11
|
|
1591
1591
|
};
|
|
1592
|
-
l.JsonMethodType =
|
|
1592
|
+
l.JsonMethodType = _;
|
|
1593
1593
|
var b = {
|
|
1594
1594
|
PUBLICATION: 0,
|
|
1595
1595
|
JOIN: 1,
|
|
@@ -1600,52 +1600,52 @@ function wt() {
|
|
|
1600
1600
|
};
|
|
1601
1601
|
l.JsonPushType = b;
|
|
1602
1602
|
var S = /* @__PURE__ */ (function() {
|
|
1603
|
-
function
|
|
1604
|
-
f(this,
|
|
1603
|
+
function v() {
|
|
1604
|
+
f(this, v);
|
|
1605
1605
|
}
|
|
1606
|
-
return v
|
|
1606
|
+
return B(v, [{
|
|
1607
1607
|
key: "encodeCommands",
|
|
1608
|
-
value: function(
|
|
1609
|
-
return
|
|
1610
|
-
return JSON.stringify(
|
|
1608
|
+
value: function(w) {
|
|
1609
|
+
return w.map(function(I) {
|
|
1610
|
+
return JSON.stringify(I);
|
|
1611
1611
|
}).join(`
|
|
1612
1612
|
`);
|
|
1613
1613
|
}
|
|
1614
|
-
}]),
|
|
1614
|
+
}]), v;
|
|
1615
1615
|
})();
|
|
1616
1616
|
l.JsonEncoder = S;
|
|
1617
|
-
var
|
|
1618
|
-
function
|
|
1619
|
-
f(this,
|
|
1617
|
+
var T = /* @__PURE__ */ (function() {
|
|
1618
|
+
function v() {
|
|
1619
|
+
f(this, v);
|
|
1620
1620
|
}
|
|
1621
|
-
return v
|
|
1621
|
+
return B(v, [{
|
|
1622
1622
|
key: "decodeReplies",
|
|
1623
|
-
value: function(
|
|
1624
|
-
return
|
|
1625
|
-
`).filter(function(
|
|
1626
|
-
return
|
|
1627
|
-
}).map(function(
|
|
1628
|
-
return JSON.parse(
|
|
1623
|
+
value: function(w) {
|
|
1624
|
+
return w.split(`
|
|
1625
|
+
`).filter(function(I) {
|
|
1626
|
+
return I !== "";
|
|
1627
|
+
}).map(function(I) {
|
|
1628
|
+
return JSON.parse(I);
|
|
1629
1629
|
});
|
|
1630
1630
|
}
|
|
1631
1631
|
}, {
|
|
1632
1632
|
key: "decodeCommandResult",
|
|
1633
|
-
value: function(
|
|
1634
|
-
return
|
|
1633
|
+
value: function(w, I) {
|
|
1634
|
+
return I;
|
|
1635
1635
|
}
|
|
1636
1636
|
}, {
|
|
1637
1637
|
key: "decodePush",
|
|
1638
|
-
value: function(
|
|
1639
|
-
return
|
|
1638
|
+
value: function(w) {
|
|
1639
|
+
return w;
|
|
1640
1640
|
}
|
|
1641
1641
|
}, {
|
|
1642
1642
|
key: "decodePushData",
|
|
1643
|
-
value: function(
|
|
1644
|
-
return
|
|
1643
|
+
value: function(w, I) {
|
|
1644
|
+
return I;
|
|
1645
1645
|
}
|
|
1646
|
-
}]),
|
|
1646
|
+
}]), v;
|
|
1647
1647
|
})();
|
|
1648
|
-
l.JsonDecoder =
|
|
1648
|
+
l.JsonDecoder = T;
|
|
1649
1649
|
})
|
|
1650
1650
|
),
|
|
1651
1651
|
/***/
|
|
@@ -1663,7 +1663,7 @@ function wt() {
|
|
|
1663
1663
|
Object.defineProperty(l, "__esModule", {
|
|
1664
1664
|
value: !0
|
|
1665
1665
|
}), l.default = void 0;
|
|
1666
|
-
var
|
|
1666
|
+
var B = b(f(187)), _ = f(853);
|
|
1667
1667
|
function b(h) {
|
|
1668
1668
|
return h && h.__esModule ? h : { default: h };
|
|
1669
1669
|
}
|
|
@@ -1671,27 +1671,27 @@ function wt() {
|
|
|
1671
1671
|
if (!(h instanceof p))
|
|
1672
1672
|
throw new TypeError("Cannot call a class as a function");
|
|
1673
1673
|
}
|
|
1674
|
-
function
|
|
1674
|
+
function T(h, p) {
|
|
1675
1675
|
for (var A = 0; A < p.length; A++) {
|
|
1676
1676
|
var n = p[A];
|
|
1677
1677
|
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(h, n.key, n);
|
|
1678
1678
|
}
|
|
1679
1679
|
}
|
|
1680
|
-
function
|
|
1681
|
-
return p &&
|
|
1680
|
+
function v(h, p, A) {
|
|
1681
|
+
return p && T(h.prototype, p), h;
|
|
1682
1682
|
}
|
|
1683
|
-
function
|
|
1683
|
+
function k(h, p) {
|
|
1684
1684
|
if (typeof p != "function" && p !== null)
|
|
1685
1685
|
throw new TypeError("Super expression must either be null or a function");
|
|
1686
|
-
h.prototype = Object.create(p && p.prototype, { constructor: { value: h, writable: !0, configurable: !0 } }), p &&
|
|
1686
|
+
h.prototype = Object.create(p && p.prototype, { constructor: { value: h, writable: !0, configurable: !0 } }), p && w(h, p);
|
|
1687
1687
|
}
|
|
1688
|
-
function
|
|
1689
|
-
return
|
|
1688
|
+
function w(h, p) {
|
|
1689
|
+
return w = Object.setPrototypeOf || function(n, r) {
|
|
1690
1690
|
return n.__proto__ = r, n;
|
|
1691
|
-
},
|
|
1691
|
+
}, w(h, p);
|
|
1692
1692
|
}
|
|
1693
|
-
function
|
|
1694
|
-
var p =
|
|
1693
|
+
function I(h) {
|
|
1694
|
+
var p = x();
|
|
1695
1695
|
return function() {
|
|
1696
1696
|
var n = N(h), r;
|
|
1697
1697
|
if (p) {
|
|
@@ -1699,22 +1699,22 @@ function wt() {
|
|
|
1699
1699
|
r = Reflect.construct(n, arguments, c);
|
|
1700
1700
|
} else
|
|
1701
1701
|
r = n.apply(this, arguments);
|
|
1702
|
-
return
|
|
1702
|
+
return R(this, r);
|
|
1703
1703
|
};
|
|
1704
1704
|
}
|
|
1705
|
-
function
|
|
1705
|
+
function R(h, p) {
|
|
1706
1706
|
if (p && (C(p) === "object" || typeof p == "function"))
|
|
1707
1707
|
return p;
|
|
1708
1708
|
if (p !== void 0)
|
|
1709
1709
|
throw new TypeError("Derived constructors may only return object or undefined");
|
|
1710
|
-
return
|
|
1710
|
+
return L(h);
|
|
1711
1711
|
}
|
|
1712
|
-
function
|
|
1712
|
+
function L(h) {
|
|
1713
1713
|
if (h === void 0)
|
|
1714
1714
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
1715
1715
|
return h;
|
|
1716
1716
|
}
|
|
1717
|
-
function
|
|
1717
|
+
function x() {
|
|
1718
1718
|
if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1;
|
|
1719
1719
|
if (typeof Proxy == "function") return !0;
|
|
1720
1720
|
try {
|
|
@@ -1729,16 +1729,16 @@ function wt() {
|
|
|
1729
1729
|
return A.__proto__ || Object.getPrototypeOf(A);
|
|
1730
1730
|
}, N(h);
|
|
1731
1731
|
}
|
|
1732
|
-
var q = 0, J = 1,
|
|
1733
|
-
|
|
1734
|
-
var p =
|
|
1732
|
+
var q = 0, J = 1, F = 2, M = 3, m = 4, g = /* @__PURE__ */ (function(h) {
|
|
1733
|
+
k(A, h);
|
|
1734
|
+
var p = I(A);
|
|
1735
1735
|
function A(n, r, c) {
|
|
1736
1736
|
var d;
|
|
1737
1737
|
return S(this, A), d = p.call(this), d.channel = r, d._centrifuge = n, d._status = q, d._error = null, d._isResubscribe = !1, d._ready = !1, d._subscriptionPromise = null, d._noResubscribe = !1, d._recoverable = !1, d._recover = !1, d._setEvents(c), d._initializePromise(), d._promises = {}, d._promiseId = 0, d._subscribeData = null, d.on("error", function(y) {
|
|
1738
1738
|
this._centrifuge._debug("subscription error", y);
|
|
1739
1739
|
}), d;
|
|
1740
1740
|
}
|
|
1741
|
-
return
|
|
1741
|
+
return v(A, [{
|
|
1742
1742
|
key: "_nextPromiseId",
|
|
1743
1743
|
value: function() {
|
|
1744
1744
|
return ++this._promiseId;
|
|
@@ -1771,7 +1771,7 @@ function wt() {
|
|
|
1771
1771
|
key: "_setEvents",
|
|
1772
1772
|
value: function(r) {
|
|
1773
1773
|
if (r) {
|
|
1774
|
-
if ((0,
|
|
1774
|
+
if ((0, _.isFunction)(r))
|
|
1775
1775
|
this.on("publish", r);
|
|
1776
1776
|
else if (Object.prototype.toString.call(r) === Object.prototype.toString.call({}))
|
|
1777
1777
|
for (var c = ["publish", "join", "leave", "unsubscribe", "subscribe", "error"], d = 0, y = c.length; d < y; d++) {
|
|
@@ -1798,12 +1798,12 @@ function wt() {
|
|
|
1798
1798
|
}, {
|
|
1799
1799
|
key: "_isReady",
|
|
1800
1800
|
value: function() {
|
|
1801
|
-
return this._status ===
|
|
1801
|
+
return this._status === F || this._status === M;
|
|
1802
1802
|
}
|
|
1803
1803
|
}, {
|
|
1804
1804
|
key: "_isSuccess",
|
|
1805
1805
|
value: function() {
|
|
1806
|
-
return this._status ===
|
|
1806
|
+
return this._status === F;
|
|
1807
1807
|
}
|
|
1808
1808
|
}, {
|
|
1809
1809
|
key: "_isError",
|
|
@@ -1823,8 +1823,8 @@ function wt() {
|
|
|
1823
1823
|
}, {
|
|
1824
1824
|
key: "_setSubscribeSuccess",
|
|
1825
1825
|
value: function(r) {
|
|
1826
|
-
if (this._status !==
|
|
1827
|
-
this._status =
|
|
1826
|
+
if (this._status !== F) {
|
|
1827
|
+
this._status = F;
|
|
1828
1828
|
var c = this._getSubscribeSuccessContext(r);
|
|
1829
1829
|
this._recover = !1, this.emit("subscribe", c), this._resolve(c);
|
|
1830
1830
|
for (var d in this._promises)
|
|
@@ -1853,7 +1853,7 @@ function wt() {
|
|
|
1853
1853
|
key: "_setUnsubscribed",
|
|
1854
1854
|
value: function(r) {
|
|
1855
1855
|
if (this._centrifuge._clearSubRefreshTimeout(this.channel), this._status !== m) {
|
|
1856
|
-
var c = this._status ===
|
|
1856
|
+
var c = this._status === F;
|
|
1857
1857
|
this._status = m, r === !0 && (this._recover = !1, this._noResubscribe = !0, delete this._centrifuge._lastSeq[this.channel], delete this._centrifuge._lastGen[this.channel], delete this._centrifuge._lastEpoch[this.channel]), c && this._triggerUnsubscribe();
|
|
1858
1858
|
}
|
|
1859
1859
|
}
|
|
@@ -1890,7 +1890,7 @@ function wt() {
|
|
|
1890
1890
|
}, {
|
|
1891
1891
|
key: "subscribe",
|
|
1892
1892
|
value: function(r) {
|
|
1893
|
-
this._status !==
|
|
1893
|
+
this._status !== F && (r && r.since && this._centrifuge._setSubscribeSince(this, r.since), r && r.data && this._setSubscribeData(r.data), this._noResubscribe = !1, this._centrifuge._subscribe(this));
|
|
1894
1894
|
}
|
|
1895
1895
|
}, {
|
|
1896
1896
|
key: "unsubscribe",
|
|
@@ -1953,7 +1953,7 @@ function wt() {
|
|
|
1953
1953
|
});
|
|
1954
1954
|
}
|
|
1955
1955
|
}]), A;
|
|
1956
|
-
})(
|
|
1956
|
+
})(B.default);
|
|
1957
1957
|
l.default = g, a.exports = l.default;
|
|
1958
1958
|
})
|
|
1959
1959
|
),
|
|
@@ -1963,30 +1963,30 @@ function wt() {
|
|
|
1963
1963
|
(function(a, l, f) {
|
|
1964
1964
|
Object.defineProperty(l, "__esModule", {
|
|
1965
1965
|
value: !0
|
|
1966
|
-
}), l.backoff = b, l.errorExists = S, l.extend =
|
|
1967
|
-
function C(
|
|
1968
|
-
return
|
|
1966
|
+
}), l.backoff = b, l.errorExists = S, l.extend = T, l.isFunction = B, l.log = _, l.startsWith = C;
|
|
1967
|
+
function C(v, k) {
|
|
1968
|
+
return v.lastIndexOf(k, 0) === 0;
|
|
1969
1969
|
}
|
|
1970
|
-
function v
|
|
1971
|
-
return
|
|
1970
|
+
function B(v) {
|
|
1971
|
+
return v == null ? !1 : typeof v == "function";
|
|
1972
1972
|
}
|
|
1973
|
-
function
|
|
1973
|
+
function _(v, k) {
|
|
1974
1974
|
if (f.g.console) {
|
|
1975
|
-
var
|
|
1976
|
-
|
|
1975
|
+
var w = f.g.console[v];
|
|
1976
|
+
B(w) && w.apply(f.g.console, k);
|
|
1977
1977
|
}
|
|
1978
1978
|
}
|
|
1979
|
-
function b(
|
|
1980
|
-
var
|
|
1981
|
-
return Math.floor((1 -
|
|
1979
|
+
function b(v, k, w) {
|
|
1980
|
+
var I = 0.5 * Math.random(), R = Math.min(w, k * Math.pow(2, v + 1));
|
|
1981
|
+
return Math.floor((1 - I) * R);
|
|
1982
1982
|
}
|
|
1983
|
-
function S(
|
|
1984
|
-
return "error" in
|
|
1983
|
+
function S(v) {
|
|
1984
|
+
return "error" in v && v.error !== null;
|
|
1985
1985
|
}
|
|
1986
|
-
function
|
|
1987
|
-
for (var
|
|
1988
|
-
|
|
1989
|
-
return
|
|
1986
|
+
function T(v, k) {
|
|
1987
|
+
for (var w in k)
|
|
1988
|
+
k.hasOwnProperty(w) && (v[w] = k[w]);
|
|
1989
|
+
return v;
|
|
1990
1990
|
}
|
|
1991
1991
|
})
|
|
1992
1992
|
),
|
|
@@ -2002,10 +2002,10 @@ function wt() {
|
|
|
2002
2002
|
} : C = function(g) {
|
|
2003
2003
|
return Object.getOwnPropertyNames(g);
|
|
2004
2004
|
};
|
|
2005
|
-
function
|
|
2005
|
+
function B(m) {
|
|
2006
2006
|
console && console.warn && console.warn(m);
|
|
2007
2007
|
}
|
|
2008
|
-
var
|
|
2008
|
+
var _ = Number.isNaN || function(g) {
|
|
2009
2009
|
return g !== g;
|
|
2010
2010
|
};
|
|
2011
2011
|
function b() {
|
|
@@ -2013,7 +2013,7 @@ function wt() {
|
|
|
2013
2013
|
}
|
|
2014
2014
|
a.exports = b, a.exports.once = J, b.EventEmitter = b, b.prototype._events = void 0, b.prototype._eventsCount = 0, b.prototype._maxListeners = void 0;
|
|
2015
2015
|
var S = 10;
|
|
2016
|
-
function
|
|
2016
|
+
function T(m) {
|
|
2017
2017
|
if (typeof m != "function")
|
|
2018
2018
|
throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof m);
|
|
2019
2019
|
}
|
|
@@ -2023,22 +2023,22 @@ function wt() {
|
|
|
2023
2023
|
return S;
|
|
2024
2024
|
},
|
|
2025
2025
|
set: function(m) {
|
|
2026
|
-
if (typeof m != "number" || m < 0 ||
|
|
2026
|
+
if (typeof m != "number" || m < 0 || _(m))
|
|
2027
2027
|
throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + m + ".");
|
|
2028
2028
|
S = m;
|
|
2029
2029
|
}
|
|
2030
2030
|
}), b.init = function() {
|
|
2031
2031
|
(this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) && (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0;
|
|
2032
2032
|
}, b.prototype.setMaxListeners = function(g) {
|
|
2033
|
-
if (typeof g != "number" || g < 0 ||
|
|
2033
|
+
if (typeof g != "number" || g < 0 || _(g))
|
|
2034
2034
|
throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + g + ".");
|
|
2035
2035
|
return this._maxListeners = g, this;
|
|
2036
2036
|
};
|
|
2037
|
-
function
|
|
2037
|
+
function v(m) {
|
|
2038
2038
|
return m._maxListeners === void 0 ? b.defaultMaxListeners : m._maxListeners;
|
|
2039
2039
|
}
|
|
2040
2040
|
b.prototype.getMaxListeners = function() {
|
|
2041
|
-
return
|
|
2041
|
+
return v(this);
|
|
2042
2042
|
}, b.prototype.emit = function(g) {
|
|
2043
2043
|
for (var h = [], p = 1; p < arguments.length; p++) h.push(arguments[p]);
|
|
2044
2044
|
var A = g === "error", n = this._events;
|
|
@@ -2059,45 +2059,45 @@ function wt() {
|
|
|
2059
2059
|
if (typeof d == "function")
|
|
2060
2060
|
f(d, this, h);
|
|
2061
2061
|
else
|
|
2062
|
-
for (var y = d.length, E =
|
|
2062
|
+
for (var y = d.length, E = x(d, y), p = 0; p < y; ++p)
|
|
2063
2063
|
f(E[p], this, h);
|
|
2064
2064
|
return !0;
|
|
2065
2065
|
};
|
|
2066
|
-
function
|
|
2066
|
+
function k(m, g, h, p) {
|
|
2067
2067
|
var A, n, r;
|
|
2068
|
-
if (
|
|
2068
|
+
if (T(h), n = m._events, n === void 0 ? (n = m._events = /* @__PURE__ */ Object.create(null), m._eventsCount = 0) : (n.newListener !== void 0 && (m.emit(
|
|
2069
2069
|
"newListener",
|
|
2070
2070
|
g,
|
|
2071
2071
|
h.listener ? h.listener : h
|
|
2072
2072
|
), n = m._events), r = n[g]), r === void 0)
|
|
2073
2073
|
r = n[g] = h, ++m._eventsCount;
|
|
2074
|
-
else if (typeof r == "function" ? r = n[g] = p ? [h, r] : [r, h] : p ? r.unshift(h) : r.push(h), A =
|
|
2074
|
+
else if (typeof r == "function" ? r = n[g] = p ? [h, r] : [r, h] : p ? r.unshift(h) : r.push(h), A = v(m), A > 0 && r.length > A && !r.warned) {
|
|
2075
2075
|
r.warned = !0;
|
|
2076
2076
|
var c = new Error("Possible EventEmitter memory leak detected. " + r.length + " " + String(g) + " listeners added. Use emitter.setMaxListeners() to increase limit");
|
|
2077
|
-
c.name = "MaxListenersExceededWarning", c.emitter = m, c.type = g, c.count = r.length,
|
|
2077
|
+
c.name = "MaxListenersExceededWarning", c.emitter = m, c.type = g, c.count = r.length, B(c);
|
|
2078
2078
|
}
|
|
2079
2079
|
return m;
|
|
2080
2080
|
}
|
|
2081
2081
|
b.prototype.addListener = function(g, h) {
|
|
2082
|
-
return
|
|
2082
|
+
return k(this, g, h, !1);
|
|
2083
2083
|
}, b.prototype.on = b.prototype.addListener, b.prototype.prependListener = function(g, h) {
|
|
2084
|
-
return
|
|
2084
|
+
return k(this, g, h, !0);
|
|
2085
2085
|
};
|
|
2086
|
-
function
|
|
2086
|
+
function w() {
|
|
2087
2087
|
if (!this.fired)
|
|
2088
2088
|
return this.target.removeListener(this.type, this.wrapFn), this.fired = !0, arguments.length === 0 ? this.listener.call(this.target) : this.listener.apply(this.target, arguments);
|
|
2089
2089
|
}
|
|
2090
|
-
function
|
|
2091
|
-
var p = { fired: !1, wrapFn: void 0, target: m, type: g, listener: h }, A =
|
|
2090
|
+
function I(m, g, h) {
|
|
2091
|
+
var p = { fired: !1, wrapFn: void 0, target: m, type: g, listener: h }, A = w.bind(p);
|
|
2092
2092
|
return A.listener = h, p.wrapFn = A, A;
|
|
2093
2093
|
}
|
|
2094
2094
|
b.prototype.once = function(g, h) {
|
|
2095
|
-
return
|
|
2095
|
+
return T(h), this.on(g, I(this, g, h)), this;
|
|
2096
2096
|
}, b.prototype.prependOnceListener = function(g, h) {
|
|
2097
|
-
return
|
|
2097
|
+
return T(h), this.prependListener(g, I(this, g, h)), this;
|
|
2098
2098
|
}, b.prototype.removeListener = function(g, h) {
|
|
2099
2099
|
var p, A, n, r, c;
|
|
2100
|
-
if (
|
|
2100
|
+
if (T(h), A = this._events, A === void 0)
|
|
2101
2101
|
return this;
|
|
2102
2102
|
if (p = A[g], p === void 0)
|
|
2103
2103
|
return this;
|
|
@@ -2133,21 +2133,21 @@ function wt() {
|
|
|
2133
2133
|
this.removeListener(g, h[A]);
|
|
2134
2134
|
return this;
|
|
2135
2135
|
};
|
|
2136
|
-
function
|
|
2136
|
+
function R(m, g, h) {
|
|
2137
2137
|
var p = m._events;
|
|
2138
2138
|
if (p === void 0)
|
|
2139
2139
|
return [];
|
|
2140
2140
|
var A = p[g];
|
|
2141
|
-
return A === void 0 ? [] : typeof A == "function" ? h ? [A.listener || A] : [A] : h ? q(A) :
|
|
2141
|
+
return A === void 0 ? [] : typeof A == "function" ? h ? [A.listener || A] : [A] : h ? q(A) : x(A, A.length);
|
|
2142
2142
|
}
|
|
2143
2143
|
b.prototype.listeners = function(g) {
|
|
2144
|
-
return
|
|
2144
|
+
return R(this, g, !0);
|
|
2145
2145
|
}, b.prototype.rawListeners = function(g) {
|
|
2146
|
-
return
|
|
2146
|
+
return R(this, g, !1);
|
|
2147
2147
|
}, b.listenerCount = function(m, g) {
|
|
2148
|
-
return typeof m.listenerCount == "function" ? m.listenerCount(g) :
|
|
2149
|
-
}, b.prototype.listenerCount =
|
|
2150
|
-
function
|
|
2148
|
+
return typeof m.listenerCount == "function" ? m.listenerCount(g) : L.call(m, g);
|
|
2149
|
+
}, b.prototype.listenerCount = L;
|
|
2150
|
+
function L(m) {
|
|
2151
2151
|
var g = this._events;
|
|
2152
2152
|
if (g !== void 0) {
|
|
2153
2153
|
var h = g[m];
|
|
@@ -2161,7 +2161,7 @@ function wt() {
|
|
|
2161
2161
|
b.prototype.eventNames = function() {
|
|
2162
2162
|
return this._eventsCount > 0 ? C(this._events) : [];
|
|
2163
2163
|
};
|
|
2164
|
-
function
|
|
2164
|
+
function x(m, g) {
|
|
2165
2165
|
for (var h = new Array(g), p = 0; p < g; ++p)
|
|
2166
2166
|
h[p] = m[p];
|
|
2167
2167
|
return h;
|
|
@@ -2184,10 +2184,10 @@ function wt() {
|
|
|
2184
2184
|
function n() {
|
|
2185
2185
|
typeof m.removeListener == "function" && m.removeListener("error", A), h([].slice.call(arguments));
|
|
2186
2186
|
}
|
|
2187
|
-
M(m, g, n, { once: !0 }), g !== "error" &&
|
|
2187
|
+
M(m, g, n, { once: !0 }), g !== "error" && F(m, A, { once: !0 });
|
|
2188
2188
|
});
|
|
2189
2189
|
}
|
|
2190
|
-
function
|
|
2190
|
+
function F(m, g, h) {
|
|
2191
2191
|
typeof m.on == "function" && M(m, "error", g, h);
|
|
2192
2192
|
}
|
|
2193
2193
|
function M(m, g, h, p) {
|
|
@@ -2292,7 +2292,7 @@ const ee = {
|
|
|
2292
2292
|
label: "Google Pay",
|
|
2293
2293
|
type: "google_pay"
|
|
2294
2294
|
};
|
|
2295
|
-
function
|
|
2295
|
+
function W(e) {
|
|
2296
2296
|
return e === "enabled" || e === !0;
|
|
2297
2297
|
}
|
|
2298
2298
|
function Ze(e) {
|
|
@@ -2314,68 +2314,68 @@ function Rt(e) {
|
|
|
2314
2314
|
};
|
|
2315
2315
|
}
|
|
2316
2316
|
function Ot(e, t, o = {}) {
|
|
2317
|
-
var
|
|
2318
|
-
const i = [], s = (
|
|
2319
|
-
return s != null && s.isKaspiOnly && l && !S ? [ee] : b ? s != null && s.isAvailable && l && !S ? [ee] : [] : (
|
|
2317
|
+
var k, w, I, R;
|
|
2318
|
+
const i = [], s = (k = e == null ? void 0 : e.kaspi) == null ? void 0 : k.data, u = ((w = e == null ? void 0 : e.cards_v2) == null ? void 0 : w.data) || [], a = ((R = (I = e == null ? void 0 : e.payment_methods) == null ? void 0 : I.data) == null ? void 0 : R.attributes) || {}, l = W(a.payment_method_kaspi), f = W(a.payment_method_card), C = typeof window < "u" && window.self === window.top, _ = Xe() === "ios", b = !!(o != null && o.onlyKaspiAvailable), S = !!(o != null && o.disableKaspi);
|
|
2319
|
+
return s != null && s.isKaspiOnly && l && !S ? [ee] : b ? s != null && s.isAvailable && l && !S ? [ee] : [] : (W(a.payment_method_apple_pay) && !me("apple_pay") && (Ce() && C || ye() || _ || st() === 16) && i.push(it), s != null && s.isAvailable && l && !S && i.push(ee), f && u.filter((L) => !L.isExpired).forEach((L) => {
|
|
2320
2320
|
i.push({
|
|
2321
|
-
iconType: ge(
|
|
2321
|
+
iconType: ge(L.attributes.mask),
|
|
2322
2322
|
type: "card",
|
|
2323
|
-
cardId:
|
|
2324
|
-
label: `•••• ${
|
|
2325
|
-
cardType:
|
|
2326
|
-
isDefault:
|
|
2323
|
+
cardId: L.id,
|
|
2324
|
+
label: `•••• ${L.attributes.mask.slice(-4)}`,
|
|
2325
|
+
cardType: L.type,
|
|
2326
|
+
isDefault: L.attributes.isDefault
|
|
2327
2327
|
});
|
|
2328
|
-
}),
|
|
2328
|
+
}), W(a.payment_method_google_pay) && !me("google_pay") && !(o != null && o.disableGooglePay) && !Ce() && !ye() && i.push(at), W(a.payment_method_new_card) && i.push({
|
|
2329
2329
|
iconType: "new_card",
|
|
2330
2330
|
type: "new_card",
|
|
2331
2331
|
label: t ? t("newCard") : "Оплата новой картой"
|
|
2332
2332
|
}), i);
|
|
2333
2333
|
}
|
|
2334
2334
|
function Re(e, t = {}) {
|
|
2335
|
-
var
|
|
2336
|
-
const o = (
|
|
2335
|
+
var v, k, w, I;
|
|
2336
|
+
const o = (v = e == null ? void 0 : e.kaspi) == null ? void 0 : v.data, i = ((k = e == null ? void 0 : e.cards_v2) == null ? void 0 : k.data) || [], s = ((I = (w = e == null ? void 0 : e.payment_methods) == null ? void 0 : w.data) == null ? void 0 : I.attributes) || {}, u = W(s.payment_method_kaspi), a = W(s.payment_method_card), l = !!(t != null && t.disableKaspi), f = typeof window < "u" && window.self === window.top, B = Xe() === "ios", _ = W(s.payment_method_apple_pay) && !me("apple_pay") && (Ce() && f || ye() || B || st() === 16), b = W(s.payment_method_google_pay) && !me("google_pay") && !(t != null && t.disableGooglePay) && !Ce() && !ye();
|
|
2337
2337
|
if (o != null && o.isKaspiOnly && u && !l || t != null && t.onlyKaspiAvailable && (o != null && o.isAvailable) && u && !l)
|
|
2338
2338
|
return ee;
|
|
2339
2339
|
const S = Rt(e);
|
|
2340
2340
|
if ((S == null ? void 0 : S.type) === "kaspi_pay" && (o != null && o.isAvailable) && u && !l)
|
|
2341
2341
|
return ee;
|
|
2342
|
-
if ((S == null ? void 0 : S.type) === "apple_pay" &&
|
|
2342
|
+
if ((S == null ? void 0 : S.type) === "apple_pay" && _) return it;
|
|
2343
2343
|
if ((S == null ? void 0 : S.type) === "google_pay" && b) return at;
|
|
2344
|
-
if ((S == null ? void 0 : S.type) === "new_card" &&
|
|
2344
|
+
if ((S == null ? void 0 : S.type) === "new_card" && W(s.payment_method_new_card))
|
|
2345
2345
|
return { iconType: "new_card", type: "new_card", label: "Оплата новой картой" };
|
|
2346
2346
|
if ((S == null ? void 0 : S.type) === "card" && a) {
|
|
2347
|
-
const
|
|
2348
|
-
if (
|
|
2347
|
+
const R = S.cardId != null ? i.find((L) => !L.isExpired && String(L.id) === S.cardId) : null;
|
|
2348
|
+
if (R)
|
|
2349
2349
|
return {
|
|
2350
|
-
iconType: ge(
|
|
2350
|
+
iconType: ge(R.attributes.mask),
|
|
2351
2351
|
type: "card",
|
|
2352
|
-
cardId:
|
|
2353
|
-
label: `•••• ${
|
|
2354
|
-
cardType:
|
|
2352
|
+
cardId: R.id,
|
|
2353
|
+
label: `•••• ${R.attributes.mask.slice(-4)}`,
|
|
2354
|
+
cardType: R.type
|
|
2355
2355
|
};
|
|
2356
2356
|
}
|
|
2357
2357
|
if (a) {
|
|
2358
|
-
const
|
|
2359
|
-
var
|
|
2360
|
-
return ((
|
|
2358
|
+
const R = i.find((L) => {
|
|
2359
|
+
var x;
|
|
2360
|
+
return ((x = L.attributes) == null ? void 0 : x.isDefault) && !L.isExpired;
|
|
2361
2361
|
});
|
|
2362
|
-
if (
|
|
2362
|
+
if (R)
|
|
2363
2363
|
return {
|
|
2364
|
-
iconType: ge(
|
|
2364
|
+
iconType: ge(R.attributes.mask),
|
|
2365
2365
|
type: "card",
|
|
2366
|
-
cardId:
|
|
2367
|
-
label: `•••• ${
|
|
2368
|
-
cardType:
|
|
2366
|
+
cardId: R.id,
|
|
2367
|
+
label: `•••• ${R.attributes.mask.slice(-4)}`,
|
|
2368
|
+
cardType: R.type
|
|
2369
2369
|
};
|
|
2370
2370
|
}
|
|
2371
2371
|
if (o != null && o.isAvailable && u && !l) return ee;
|
|
2372
|
-
const
|
|
2373
|
-
return
|
|
2374
|
-
iconType: ge(
|
|
2372
|
+
const T = a ? i.find((R) => !R.isExpired) : null;
|
|
2373
|
+
return T ? {
|
|
2374
|
+
iconType: ge(T.attributes.mask),
|
|
2375
2375
|
type: "card",
|
|
2376
|
-
cardId:
|
|
2377
|
-
label: `••••${
|
|
2378
|
-
cardType:
|
|
2376
|
+
cardId: T.id,
|
|
2377
|
+
label: `••••${T.attributes.mask.slice(-4)}`,
|
|
2378
|
+
cardType: T.type
|
|
2379
2379
|
} : null;
|
|
2380
2380
|
}
|
|
2381
2381
|
function ct(e) {
|
|
@@ -2453,7 +2453,7 @@ async function Se(e, t, o, i, s) {
|
|
|
2453
2453
|
return u.ok || await Z(u, s), u.json();
|
|
2454
2454
|
}
|
|
2455
2455
|
async function Nt(e, t, o) {
|
|
2456
|
-
var l, f, C,
|
|
2456
|
+
var l, f, C, B;
|
|
2457
2457
|
const i = await fetch(`${e}/api/v2/oauth2/tokens`, {
|
|
2458
2458
|
method: "POST",
|
|
2459
2459
|
headers: {
|
|
@@ -2468,12 +2468,12 @@ async function Nt(e, t, o) {
|
|
|
2468
2468
|
})
|
|
2469
2469
|
});
|
|
2470
2470
|
i.ok || await Z(i, "Не удалось авторизоваться через track_id");
|
|
2471
|
-
const s = await i.json(), u = (s == null ? void 0 : s.access_token) ?? ((f = (l = s == null ? void 0 : s.data) == null ? void 0 : l.attributes) == null ? void 0 : f.access_token), a = (s == null ? void 0 : s.refresh_token) ?? ((
|
|
2471
|
+
const s = await i.json(), u = (s == null ? void 0 : s.access_token) ?? ((f = (l = s == null ? void 0 : s.data) == null ? void 0 : l.attributes) == null ? void 0 : f.access_token), a = (s == null ? void 0 : s.refresh_token) ?? ((B = (C = s == null ? void 0 : s.data) == null ? void 0 : C.attributes) == null ? void 0 : B.refresh_token) ?? null;
|
|
2472
2472
|
if (!u) throw new Error("В ответе отсутствует access_token");
|
|
2473
2473
|
return { access_token: u, refresh_token: a };
|
|
2474
2474
|
}
|
|
2475
2475
|
async function Dt(e, t, o) {
|
|
2476
|
-
var l, f, C,
|
|
2476
|
+
var l, f, C, B;
|
|
2477
2477
|
const i = await fetch(`${e}/api/v2/oauth2/tokens`, {
|
|
2478
2478
|
method: "POST",
|
|
2479
2479
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2484,7 +2484,7 @@ async function Dt(e, t, o) {
|
|
|
2484
2484
|
})
|
|
2485
2485
|
});
|
|
2486
2486
|
i.ok || await Z(i, "Не удалось обновить токен по refresh_token");
|
|
2487
|
-
const s = await i.json(), u = (s == null ? void 0 : s.access_token) ?? ((f = (l = s == null ? void 0 : s.data) == null ? void 0 : l.attributes) == null ? void 0 : f.access_token), a = (s == null ? void 0 : s.refresh_token) ?? ((
|
|
2487
|
+
const s = await i.json(), u = (s == null ? void 0 : s.access_token) ?? ((f = (l = s == null ? void 0 : s.data) == null ? void 0 : l.attributes) == null ? void 0 : f.access_token), a = (s == null ? void 0 : s.refresh_token) ?? ((B = (C = s == null ? void 0 : s.data) == null ? void 0 : C.attributes) == null ? void 0 : B.refresh_token) ?? null;
|
|
2488
2488
|
if (!u) throw new Error("В ответе отсутствует access_token");
|
|
2489
2489
|
return { access_token: u, refresh_token: a };
|
|
2490
2490
|
}
|
|
@@ -2834,7 +2834,7 @@ function rn(e, t, o, i) {
|
|
|
2834
2834
|
<div class="choco-widget-balance-icon">
|
|
2835
2835
|
${Ue}
|
|
2836
2836
|
</div>
|
|
2837
|
-
<div class="choco-widget-balance-amount">${s ?
|
|
2837
|
+
<div class="choco-widget-balance-amount">${s ? K(e.amount, "ru", i) : 0}</div>
|
|
2838
2838
|
<label class="choco-widget-toggle">
|
|
2839
2839
|
<input type="checkbox" ${t ? "checked" : ""} />
|
|
2840
2840
|
<span class="choco-widget-toggle-slider"></span>
|
|
@@ -2845,7 +2845,7 @@ function rn(e, t, o, i) {
|
|
|
2845
2845
|
}
|
|
2846
2846
|
function on(e, t, o, i, s) {
|
|
2847
2847
|
if (!e) return "";
|
|
2848
|
-
const u = new Date(e.expires_at), a = isNaN(u.getTime()) ? "" : `${String(u.getDate()).padStart(2, "0")}.${String(u.getMonth() + 1).padStart(2, "0")}`, l = a ? i("couponUntil", { date: a }) : "", f = Number(e.reward_amount), C = Number.isFinite(f) && f > 0 ?
|
|
2848
|
+
const u = new Date(e.expires_at), a = isNaN(u.getTime()) ? "" : `${String(u.getDate()).padStart(2, "0")}.${String(u.getMonth() + 1).padStart(2, "0")}`, l = a ? i("couponUntil", { date: a }) : "", f = Number(e.reward_amount), C = Number.isFinite(f) && f > 0 ? K(f, "ru", s) : null;
|
|
2849
2849
|
return `
|
|
2850
2850
|
<div class="choco-widget-balance-toggle${o ? " choco-widget-balance-toggle--disabled" : ""}" data-action="toggle-coupon">
|
|
2851
2851
|
<div class="choco-widget-balance-info">
|
|
@@ -2920,45 +2920,46 @@ function cn(e) {
|
|
|
2920
2920
|
balanceFormatted: l,
|
|
2921
2921
|
useBalance: f,
|
|
2922
2922
|
bonuses: C,
|
|
2923
|
-
useBonuses:
|
|
2924
|
-
coupon:
|
|
2923
|
+
useBonuses: B,
|
|
2924
|
+
coupon: _,
|
|
2925
2925
|
useCoupon: b,
|
|
2926
2926
|
couponDisabled: S,
|
|
2927
|
-
cashbackFormatted:
|
|
2928
|
-
disabled:
|
|
2929
|
-
paymentMethodDisabled:
|
|
2930
|
-
loading:
|
|
2931
|
-
showFreedomBtn:
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2927
|
+
cashbackFormatted: T,
|
|
2928
|
+
disabled: v,
|
|
2929
|
+
paymentMethodDisabled: k = !1,
|
|
2930
|
+
loading: w,
|
|
2931
|
+
showFreedomBtn: I,
|
|
2932
|
+
freedomAmountFormatted: R,
|
|
2933
|
+
t: L,
|
|
2934
|
+
currency: x
|
|
2935
|
+
} = e, N = (s == null ? void 0 : s.label) ?? L("selectMethod"), q = Ee(s), J = ut(u, a), F = sn(l, f, C, B, _, b, S, L, x), M = an(T, L), m = (a == null ? void 0 : a.type) === "google_pay", g = (a == null ? void 0 : a.type) === "apple_pay", h = m || g;
|
|
2935
2936
|
return `
|
|
2936
|
-
<div class="choco-widget-bottom-bar" role="region" aria-label="${
|
|
2937
|
-
${
|
|
2937
|
+
<div class="choco-widget-bottom-bar" role="region" aria-label="${L("paymentMethod")}">
|
|
2938
|
+
${F}
|
|
2938
2939
|
<div class="choco-widget-payment-info">
|
|
2939
|
-
${
|
|
2940
|
+
${I ? `
|
|
2940
2941
|
<button
|
|
2941
2942
|
class="choco-widget-freedom-card-btn"
|
|
2942
2943
|
data-action="freedom-card"
|
|
2943
2944
|
type="button"
|
|
2944
|
-
${
|
|
2945
|
+
${v || w ? "disabled" : ""}
|
|
2945
2946
|
>
|
|
2946
|
-
|
|
2947
|
+
от ${R} по карте Freedom
|
|
2947
2948
|
</button>
|
|
2948
2949
|
` : ""}
|
|
2949
2950
|
<div class="choco-widget-payment-info-main">
|
|
2950
2951
|
<button
|
|
2951
2952
|
class="choco-widget-payment-method ${(s == null ? void 0 : s.type) || ""}"
|
|
2952
2953
|
data-action="change-method"
|
|
2953
|
-
aria-label="${
|
|
2954
|
+
aria-label="${L("paymentMethod")}: ${N}"
|
|
2954
2955
|
type="button"
|
|
2955
|
-
${
|
|
2956
|
+
${k || v || w ? "disabled" : ""}
|
|
2956
2957
|
>
|
|
2957
|
-
<div class="choco-widget-method-label">${
|
|
2958
|
+
<div class="choco-widget-method-label">${L("paymentMethod")}</div>
|
|
2958
2959
|
<div class="choco-widget-method-value">
|
|
2959
|
-
<div class="choco-widget-method-icon-wrapper ${s == null ? void 0 : s.type}" aria-hidden="true">${
|
|
2960
|
+
<div class="choco-widget-method-icon-wrapper ${s == null ? void 0 : s.type}" aria-hidden="true">${q}</div>
|
|
2960
2961
|
<div class="choco-widget-method-details">
|
|
2961
|
-
<div class="choco-widget-method-name ${s == null ? void 0 : s.type}">${
|
|
2962
|
+
<div class="choco-widget-method-name ${s == null ? void 0 : s.type}">${N}</div>
|
|
2962
2963
|
<div class="choco-widget-method-chevron">
|
|
2963
2964
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2964
2965
|
<path d="M8 10L12 14L16 10" stroke="#242424" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
@@ -2967,24 +2968,24 @@ function cn(e) {
|
|
|
2967
2968
|
</div>
|
|
2968
2969
|
</div>
|
|
2969
2970
|
</button>
|
|
2970
|
-
<div class="choco-widget-google-pay-amount ${
|
|
2971
|
-
<div class="choco-widget-google-pay-amount-label">${
|
|
2972
|
-
${i ? `<div class="choco-widget-google-pay-amount-value">${
|
|
2971
|
+
<div class="choco-widget-google-pay-amount ${h ? "" : "choco-widget-google-pay-amount--hidden"}" aria-live="polite">
|
|
2972
|
+
<div class="choco-widget-google-pay-amount-label">${L("total")} ${t}</div>
|
|
2973
|
+
${i ? `<div class="choco-widget-google-pay-amount-value">${L("instead")} <span class="choco-widget-google-pay-amount-value-number">${o || ""}</span></div>` : ""}
|
|
2973
2974
|
</div>
|
|
2974
2975
|
<button
|
|
2975
|
-
class="choco-widget-pay-button ${
|
|
2976
|
+
class="choco-widget-pay-button ${w ? "choco-widget-pay-button--loading" : ""} ${h ? "choco-widget-pay-button--hidden" : ""}"
|
|
2976
2977
|
data-action="pay"
|
|
2977
|
-
aria-label="${
|
|
2978
|
+
aria-label="${L("pay")} ${t}"
|
|
2978
2979
|
type="button"
|
|
2979
|
-
${
|
|
2980
|
+
${v || w ? "disabled" : ""}
|
|
2980
2981
|
>
|
|
2981
|
-
${
|
|
2982
|
+
${L("pay")} ${t}
|
|
2982
2983
|
</button>
|
|
2983
2984
|
</div>
|
|
2984
|
-
<div class="choco-widget-google-pay-row ${
|
|
2985
|
+
<div class="choco-widget-google-pay-row ${m ? "" : "choco-widget-google-pay-row--hidden"}">
|
|
2985
2986
|
<div class="choco-widget-google-pay-button-slot" data-action="google-pay-button-slot"></div>
|
|
2986
2987
|
</div>
|
|
2987
|
-
<div class="choco-widget-apple-pay-row ${
|
|
2988
|
+
<div class="choco-widget-apple-pay-row ${g ? "" : "choco-widget-apple-pay-row--hidden"}">
|
|
2988
2989
|
<div class="choco-widget-apple-pay-button-slot" data-action="apple-pay-button-slot"></div>
|
|
2989
2990
|
</div>
|
|
2990
2991
|
</div>
|
|
@@ -3010,7 +3011,7 @@ function cn(e) {
|
|
|
3010
3011
|
<path d="M15 18L9 12L15 6" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3011
3012
|
</svg>
|
|
3012
3013
|
</button>
|
|
3013
|
-
<h3 class="choco-widget-sheet-title" id="choco-sheet-title">${
|
|
3014
|
+
<h3 class="choco-widget-sheet-title" id="choco-sheet-title">${L("paymentMethods")}</h3>
|
|
3014
3015
|
<button
|
|
3015
3016
|
class="choco-widget-sheet-button choco-widget-sheet-button--edit"
|
|
3016
3017
|
data-action="edit-sheet"
|
|
@@ -3025,7 +3026,7 @@ function cn(e) {
|
|
|
3025
3026
|
<button
|
|
3026
3027
|
class="choco-widget-sheet-button choco-widget-sheet-button--previous"
|
|
3027
3028
|
data-action="previous-sheet"
|
|
3028
|
-
aria-label="${
|
|
3029
|
+
aria-label="${L("back")}"
|
|
3029
3030
|
type="button"
|
|
3030
3031
|
style="display: none;"
|
|
3031
3032
|
>
|
|
@@ -3036,25 +3037,25 @@ function cn(e) {
|
|
|
3036
3037
|
</button>
|
|
3037
3038
|
</div>
|
|
3038
3039
|
<div class="choco-widget-payment-methods" role="list">
|
|
3039
|
-
${
|
|
3040
|
+
${J}
|
|
3040
3041
|
</div>
|
|
3041
3042
|
<div class="choco-widget-sheet-delete-confirm" data-delete-confirm="content" aria-hidden="true">
|
|
3042
3043
|
<div class="choco-widget-sheet-delete-confirm-actions">
|
|
3043
|
-
<button type="button" class="choco-widget-delete-confirm-btn choco-widget-delete-confirm-btn--cancel" data-action="confirm-delete-cancel">${
|
|
3044
|
-
<button type="button" class="choco-widget-delete-confirm-btn choco-widget-delete-confirm-btn--delete" data-action="confirm-delete-submit">${
|
|
3044
|
+
<button type="button" class="choco-widget-delete-confirm-btn choco-widget-delete-confirm-btn--cancel" data-action="confirm-delete-cancel">${L("cancel")}</button>
|
|
3045
|
+
<button type="button" class="choco-widget-delete-confirm-btn choco-widget-delete-confirm-btn--delete" data-action="confirm-delete-submit">${L("delete")}</button>
|
|
3045
3046
|
</div>
|
|
3046
3047
|
</div>
|
|
3047
|
-
${
|
|
3048
|
+
${M}
|
|
3048
3049
|
</div>
|
|
3049
3050
|
</div>
|
|
3050
3051
|
|
|
3051
3052
|
<div class="choco-widget-add-card-sheet choco-widget-payment-sheet" data-sheet="add-card" aria-hidden="true" style="display: none;">
|
|
3052
3053
|
<div class="choco-widget-sheet-content choco-widget-add-card-sheet-content">
|
|
3053
3054
|
<div class="choco-widget-sheet-header">
|
|
3054
|
-
<h3 class="choco-widget-sheet-title">${
|
|
3055
|
+
<h3 class="choco-widget-sheet-title">${L("addCard")}</h3>
|
|
3055
3056
|
</div>
|
|
3056
3057
|
<div class="choco-widget-add-card-iframe-wrapper">
|
|
3057
|
-
<iframe id="choco-widget-add-card-iframe" class="choco-widget-add-card-iframe" title="${
|
|
3058
|
+
<iframe id="choco-widget-add-card-iframe" class="choco-widget-add-card-iframe" title="${L("addCard")}" sandbox="allow-forms allow-modals allow-orientation-lock allow-pointer-lock allow-popups allow-popups-to-escape-sandbox allow-presentation allow-same-origin allow-scripts"></iframe>
|
|
3058
3059
|
</div>
|
|
3059
3060
|
</div>
|
|
3060
3061
|
</div>
|
|
@@ -3092,13 +3093,13 @@ function hn(e) {
|
|
|
3092
3093
|
lt(e) && (e.container.style.setProperty("--choco-widget-accent-color", e.config.color), e.container.innerHTML = An());
|
|
3093
3094
|
}
|
|
3094
3095
|
function fn(e) {
|
|
3095
|
-
var
|
|
3096
|
+
var B, _, b, S, T;
|
|
3096
3097
|
if (e._destroyed || !lt(e)) return;
|
|
3097
3098
|
e.container.style.setProperty("--choco-widget-accent-color", e.config.color), e.container.classList.remove("choco-one-click-widget--visible");
|
|
3098
|
-
const t = e.getAvailablePaymentMethods(), o = (
|
|
3099
|
+
const t = e.getAvailablePaymentMethods(), o = (B = e.checkoutContext) == null ? void 0 : B.data, i = e.config.currency || "KZT", s = (S = (b = (_ = o == null ? void 0 : o.balance) == null ? void 0 : _.data) == null ? void 0 : b.money) == null ? void 0 : S[i], u = s > 0 ? K(s, e.config.locale, e.config.currency) : null, a = (T = o == null ? void 0 : o.cashback) == null ? void 0 : T.data, l = (a == null ? void 0 : a.cashbackAmount) > 0 ? K(a.cashbackAmount, e.config.locale, e.config.currency) : null, f = e._getPayableAmount(), C = f < e.config.amount;
|
|
3099
3100
|
e.container.innerHTML = cn({
|
|
3100
|
-
amountFormatted:
|
|
3101
|
-
originalAmountFormatted:
|
|
3101
|
+
amountFormatted: K(f, e.config.locale, e.config.currency),
|
|
3102
|
+
originalAmountFormatted: K(
|
|
3102
3103
|
e.config.amount,
|
|
3103
3104
|
e.config.locale,
|
|
3104
3105
|
e.config.currency
|
|
@@ -3119,7 +3120,12 @@ function fn(e) {
|
|
|
3119
3120
|
paymentMethodDisabled: e.paymentMethodDisabled,
|
|
3120
3121
|
loading: e.loading,
|
|
3121
3122
|
showFreedomBtn: !e.config.isFridge && e.config.onFreedomLink !== null,
|
|
3122
|
-
|
|
3123
|
+
freedomAmountFormatted: K(
|
|
3124
|
+
Math.round(f * 0.84),
|
|
3125
|
+
e.config.locale,
|
|
3126
|
+
e.config.currency
|
|
3127
|
+
),
|
|
3128
|
+
t: (v, k) => e.t(v, k),
|
|
3123
3129
|
currency: i
|
|
3124
3130
|
}), e._attachEventListeners(), e.isOpen = !0, e._emitUserEvent("one_click_pay_cta_rendered", {
|
|
3125
3131
|
terminal_id: e.config.terminalId,
|
|
@@ -3128,8 +3134,8 @@ function fn(e) {
|
|
|
3128
3134
|
payment_method: e._getPaymentMethodForUserEvent()
|
|
3129
3135
|
}), requestAnimationFrame(() => {
|
|
3130
3136
|
requestAnimationFrame(() => {
|
|
3131
|
-
var
|
|
3132
|
-
e._destroyed || (
|
|
3137
|
+
var v;
|
|
3138
|
+
e._destroyed || (v = e.container) == null || v.classList.add("choco-one-click-widget--visible");
|
|
3133
3139
|
});
|
|
3134
3140
|
});
|
|
3135
3141
|
}
|
|
@@ -3168,23 +3174,25 @@ function dt(e) {
|
|
|
3168
3174
|
t && e.selectedPaymentMethod && (t.className = `choco-widget-payment-method ${e.selectedPaymentMethod.type}`), o && e.selectedPaymentMethod && (o.className = `choco-widget-method-name ${e.selectedPaymentMethod.type}`, o.textContent = e.selectedPaymentMethod.label), i && e.selectedPaymentMethod && (i.className = `choco-widget-method-icon-wrapper ${e.selectedPaymentMethod.type}`, i.innerHTML = ln(e.selectedPaymentMethod)), ht(e);
|
|
3169
3175
|
}
|
|
3170
3176
|
function pe(e) {
|
|
3171
|
-
var
|
|
3172
|
-
const t = (
|
|
3177
|
+
var _, b, S, T, v, k;
|
|
3178
|
+
const t = (_ = e.container) == null ? void 0 : _.querySelector(".choco-widget-pay-button"), o = (b = e.container) == null ? void 0 : b.querySelector(
|
|
3173
3179
|
".choco-widget-google-pay-amount"
|
|
3174
|
-
), i = (
|
|
3180
|
+
), i = (S = e.container) == null ? void 0 : S.querySelector(
|
|
3175
3181
|
".choco-widget-google-pay-amount-label"
|
|
3176
3182
|
);
|
|
3177
|
-
let s = (
|
|
3183
|
+
let s = (T = e.container) == null ? void 0 : T.querySelector(
|
|
3178
3184
|
".choco-widget-google-pay-amount-value"
|
|
3179
|
-
), u = (
|
|
3185
|
+
), u = (v = e.container) == null ? void 0 : v.querySelector(
|
|
3180
3186
|
".choco-widget-google-pay-amount-value-number"
|
|
3181
3187
|
);
|
|
3182
|
-
const a = e._getPayableAmount(), l =
|
|
3188
|
+
const a = e._getPayableAmount(), l = K(a, e.config.locale, e.config.currency), f = a < e.config.amount, C = K(
|
|
3183
3189
|
e.config.amount,
|
|
3184
3190
|
e.config.locale,
|
|
3185
3191
|
e.config.currency
|
|
3186
3192
|
);
|
|
3187
|
-
|
|
3193
|
+
t && (t.textContent = `${e.t("pay")} ${l}`, t.setAttribute("aria-label", `${e.t("pay")} ${l}`));
|
|
3194
|
+
const B = (k = e.container) == null ? void 0 : k.querySelector(".choco-widget-freedom-card-btn");
|
|
3195
|
+
if (B && (B.textContent = `от ${K(Math.round(a * 0.84), e.config.locale, e.config.currency)} по карте Freedom`), i && (i.textContent = `${e.t("total")} ${l}`), !f) {
|
|
3188
3196
|
s == null || s.remove();
|
|
3189
3197
|
return;
|
|
3190
3198
|
}
|
|
@@ -3193,8 +3201,8 @@ function pe(e) {
|
|
|
3193
3201
|
)), u ? u.textContent = C : s && (s.textContent = `${e.t("instead")} ${C}`);
|
|
3194
3202
|
}
|
|
3195
3203
|
function ht(e) {
|
|
3196
|
-
var f, C,
|
|
3197
|
-
const t = ((f = e.selectedPaymentMethod) == null ? void 0 : f.type) === "google_pay", o = ((C = e.selectedPaymentMethod) == null ? void 0 : C.type) === "apple_pay", i = t || o, s = (
|
|
3204
|
+
var f, C, B, _, b, S, T, v, k, w;
|
|
3205
|
+
const t = ((f = e.selectedPaymentMethod) == null ? void 0 : f.type) === "google_pay", o = ((C = e.selectedPaymentMethod) == null ? void 0 : C.type) === "apple_pay", i = t || o, s = (B = e.container) == null ? void 0 : B.querySelector(".choco-widget-pay-button"), u = (_ = e.container) == null ? void 0 : _.querySelector(
|
|
3198
3206
|
".choco-widget-google-pay-amount"
|
|
3199
3207
|
), a = (b = e.container) == null ? void 0 : b.querySelector(".choco-widget-google-pay-row"), l = (S = e.container) == null ? void 0 : S.querySelector(".choco-widget-apple-pay-row");
|
|
3200
3208
|
if (s == null || s.classList.toggle("choco-widget-pay-button--hidden", i), u == null || u.classList.toggle(
|
|
@@ -3202,29 +3210,29 @@ function ht(e) {
|
|
|
3202
3210
|
!i
|
|
3203
3211
|
), a == null || a.classList.toggle("choco-widget-google-pay-row--hidden", !t), l == null || l.classList.toggle("choco-widget-apple-pay-row--hidden", !o), t) {
|
|
3204
3212
|
gn(e);
|
|
3205
|
-
const
|
|
3213
|
+
const I = (T = e.container) == null ? void 0 : T.querySelector(
|
|
3206
3214
|
'[data-action="apple-pay-button-slot"]'
|
|
3207
3215
|
);
|
|
3208
|
-
|
|
3216
|
+
I && (I.innerHTML = "");
|
|
3209
3217
|
} else if (o) {
|
|
3210
3218
|
e._googlePayButtonRenderVersion += 1;
|
|
3211
|
-
const
|
|
3219
|
+
const I = (v = e.container) == null ? void 0 : v.querySelector(
|
|
3212
3220
|
'[data-action="google-pay-button-slot"]'
|
|
3213
3221
|
);
|
|
3214
|
-
|
|
3222
|
+
I && (I.innerHTML = ""), pn(e);
|
|
3215
3223
|
} else {
|
|
3216
3224
|
e._googlePayButtonRenderVersion += 1;
|
|
3217
|
-
const
|
|
3225
|
+
const I = (k = e.container) == null ? void 0 : k.querySelector(
|
|
3218
3226
|
'[data-action="google-pay-button-slot"]'
|
|
3219
|
-
),
|
|
3227
|
+
), R = (w = e.container) == null ? void 0 : w.querySelector(
|
|
3220
3228
|
'[data-action="apple-pay-button-slot"]'
|
|
3221
3229
|
);
|
|
3222
|
-
|
|
3230
|
+
I && (I.innerHTML = ""), R && (R.innerHTML = "");
|
|
3223
3231
|
}
|
|
3224
3232
|
pe(e), Y(e);
|
|
3225
3233
|
}
|
|
3226
3234
|
async function gn(e) {
|
|
3227
|
-
var a, l, f, C,
|
|
3235
|
+
var a, l, f, C, B;
|
|
3228
3236
|
const t = (a = e.container) == null ? void 0 : a.querySelector(
|
|
3229
3237
|
'[data-action="google-pay-button-slot"]'
|
|
3230
3238
|
);
|
|
@@ -3237,7 +3245,7 @@ async function gn(e) {
|
|
|
3237
3245
|
return;
|
|
3238
3246
|
}
|
|
3239
3247
|
if (o !== e._googlePayButtonRenderVersion) return;
|
|
3240
|
-
if (!((
|
|
3248
|
+
if (!((B = (C = (f = window.google) == null ? void 0 : f.payments) == null ? void 0 : C.api) != null && B.PaymentsClient)) {
|
|
3241
3249
|
e.config.onError({ attributes: { message: e.t("errorGooglePayUnsupported") } });
|
|
3242
3250
|
return;
|
|
3243
3251
|
}
|
|
@@ -3250,8 +3258,8 @@ async function gn(e) {
|
|
|
3250
3258
|
buttonLocale: e.config.locale || "ru",
|
|
3251
3259
|
buttonSizeMode: "fill"
|
|
3252
3260
|
});
|
|
3253
|
-
u.classList.add("choco-widget-google-pay-button"), u.style.setProperty("width", "100%", "important"), u.style.setProperty("height", "52px", "important"), u.style.setProperty("min-height", "52px", "important"), u.style.setProperty("border-radius", "12px", "important"), u.style.setProperty("font-size", "16px", "important"), u.style.setProperty("font-weight", "bold", "important"), u.querySelectorAll("*").forEach((
|
|
3254
|
-
|
|
3261
|
+
u.classList.add("choco-widget-google-pay-button"), u.style.setProperty("width", "100%", "important"), u.style.setProperty("height", "52px", "important"), u.style.setProperty("min-height", "52px", "important"), u.style.setProperty("border-radius", "12px", "important"), u.style.setProperty("font-size", "16px", "important"), u.style.setProperty("font-weight", "bold", "important"), u.querySelectorAll("*").forEach((_) => {
|
|
3262
|
+
_.style.setProperty("border-radius", "12px", "important"), _.style.setProperty("font-weight", "bold", "important"), _.style.setProperty("font-size", "16px", "important");
|
|
3255
3263
|
}), t.appendChild(u), Y(e);
|
|
3256
3264
|
}
|
|
3257
3265
|
function pn(e) {
|
|
@@ -3296,31 +3304,31 @@ function ne(e) {
|
|
|
3296
3304
|
e.loading = !0, Y(e);
|
|
3297
3305
|
}
|
|
3298
3306
|
function j(e) {
|
|
3299
|
-
var
|
|
3307
|
+
var _, b, S, T, v, k, w, I;
|
|
3300
3308
|
e.loading = !1;
|
|
3301
|
-
const t = (
|
|
3309
|
+
const t = (_ = e.container) == null ? void 0 : _.querySelector(".choco-widget-payment-method"), o = (b = e.container) == null ? void 0 : b.querySelector(".choco-widget-pay-button"), i = (S = e.container) == null ? void 0 : S.querySelector(
|
|
3302
3310
|
".choco-widget-google-pay-button-slot button"
|
|
3303
|
-
), s = (
|
|
3311
|
+
), s = (T = e.container) == null ? void 0 : T.querySelector(
|
|
3304
3312
|
".choco-widget-apple-pay-button-slot button"
|
|
3305
|
-
), u = (
|
|
3313
|
+
), u = (v = e.container) == null ? void 0 : v.querySelector(
|
|
3306
3314
|
".choco-widget-google-pay-amount"
|
|
3307
|
-
), a = (
|
|
3315
|
+
), a = (k = e.container) == null ? void 0 : k.querySelector(".choco-widget-google-pay-row"), l = (w = e.container) == null ? void 0 : w.querySelector(".choco-widget-apple-pay-row"), f = (I = e.container) == null ? void 0 : I.querySelector(
|
|
3308
3316
|
".choco-widget-balance-section"
|
|
3309
|
-
), C = e._isInteractionBlocked(),
|
|
3310
|
-
t && (t.disabled =
|
|
3317
|
+
), C = e._isInteractionBlocked(), B = e.paymentMethodDisabled || C;
|
|
3318
|
+
t && (t.disabled = B), o && (o.disabled = C, o.classList.remove("choco-widget-pay-button--loading")), i && (i.disabled = C), s && (s.disabled = C), u == null || u.classList.toggle("choco-widget-wallet-blocked", C), u == null || u.setAttribute("aria-disabled", String(C)), a == null || a.classList.toggle("choco-widget-wallet-blocked", C), a == null || a.setAttribute("aria-disabled", String(C)), l == null || l.classList.toggle("choco-widget-wallet-blocked", C), l == null || l.setAttribute("aria-disabled", String(C)), f == null || f.classList.remove("disabled");
|
|
3311
3319
|
}
|
|
3312
3320
|
function Y(e) {
|
|
3313
|
-
var b, S,
|
|
3314
|
-
const t = (b = e.container) == null ? void 0 : b.querySelector(".choco-widget-payment-method"), o = (S = e.container) == null ? void 0 : S.querySelector(".choco-widget-pay-button"), i = (
|
|
3321
|
+
var b, S, T, v, k, w, I, R, L;
|
|
3322
|
+
const t = (b = e.container) == null ? void 0 : b.querySelector(".choco-widget-payment-method"), o = (S = e.container) == null ? void 0 : S.querySelector(".choco-widget-pay-button"), i = (T = e.container) == null ? void 0 : T.querySelector(".choco-widget-freedom-card-btn"), s = (v = e.container) == null ? void 0 : v.querySelector(
|
|
3315
3323
|
".choco-widget-google-pay-button-slot button"
|
|
3316
|
-
), u = (
|
|
3324
|
+
), u = (k = e.container) == null ? void 0 : k.querySelector(
|
|
3317
3325
|
".choco-widget-apple-pay-button-slot button"
|
|
3318
|
-
), a = (
|
|
3326
|
+
), a = (w = e.container) == null ? void 0 : w.querySelector(
|
|
3319
3327
|
".choco-widget-google-pay-amount"
|
|
3320
|
-
), l = (
|
|
3328
|
+
), l = (I = e.container) == null ? void 0 : I.querySelector(".choco-widget-google-pay-row"), f = (R = e.container) == null ? void 0 : R.querySelector(".choco-widget-apple-pay-row"), C = (L = e.container) == null ? void 0 : L.querySelector(
|
|
3321
3329
|
".choco-widget-balance-section"
|
|
3322
|
-
),
|
|
3323
|
-
C == null || C.classList.toggle("disabled",
|
|
3330
|
+
), B = e._isInteractionBlocked(), _ = e.paymentMethodDisabled || B;
|
|
3331
|
+
C == null || C.classList.toggle("disabled", B), t && (t.disabled = _), o && (o.disabled = B, o.classList.toggle("choco-widget-pay-button--loading", e.loading)), i && (i.disabled = B), s && (s.disabled = B), u && (u.disabled = B), a == null || a.classList.toggle("choco-widget-wallet-blocked", B), a == null || a.setAttribute("aria-disabled", String(B)), l == null || l.classList.toggle("choco-widget-wallet-blocked", B), l == null || l.setAttribute("aria-disabled", String(B)), f == null || f.classList.toggle("choco-widget-wallet-blocked", B), f == null || f.setAttribute("aria-disabled", String(B));
|
|
3324
3332
|
}
|
|
3325
3333
|
function ft(e) {
|
|
3326
3334
|
var o;
|
|
@@ -3587,12 +3595,12 @@ async function vn(e) {
|
|
|
3587
3595
|
await rt(e);
|
|
3588
3596
|
const l = (a == null ? void 0 : a.id) ?? ((i = a == null ? void 0 : a.data) == null ? void 0 : i.id);
|
|
3589
3597
|
if (l && ce(e, String(l)), ((s = e.selectedPaymentMethod) == null ? void 0 : s.type) === "kaspi_pay") {
|
|
3590
|
-
const f = (a == null ? void 0 : a.attributes) || ((u = a == null ? void 0 : a.data) == null ? void 0 : u.attributes) || {}, C = f.action_link || f.action_url,
|
|
3598
|
+
const f = (a == null ? void 0 : a.attributes) || ((u = a == null ? void 0 : a.data) == null ? void 0 : u.attributes) || {}, C = f.action_link || f.action_url, B = f.action_url_type || f.action_type || "redirect";
|
|
3591
3599
|
if (C)
|
|
3592
3600
|
return typeof e.config.onKaspiLink == "function" ? (e.config.onKaspiLink({
|
|
3593
3601
|
action_link: C,
|
|
3594
3602
|
action_url: C,
|
|
3595
|
-
action_type:
|
|
3603
|
+
action_type: B,
|
|
3596
3604
|
event: a
|
|
3597
3605
|
}), a) : (window.location.href = C, a);
|
|
3598
3606
|
}
|
|
@@ -3661,8 +3669,8 @@ async function In(e, t) {
|
|
|
3661
3669
|
e.apiUrl,
|
|
3662
3670
|
e._getApiConfig(),
|
|
3663
3671
|
u.validationURL
|
|
3664
|
-
), C = ((l = (a = f == null ? void 0 : f.data) == null ? void 0 : a.attributes) == null ? void 0 : l.session) || f,
|
|
3665
|
-
s.completeMerchantValidation(
|
|
3672
|
+
), C = ((l = (a = f == null ? void 0 : f.data) == null ? void 0 : a.attributes) == null ? void 0 : l.session) || f, B = JSON.parse(atob(C));
|
|
3673
|
+
s.completeMerchantValidation(B);
|
|
3666
3674
|
} catch (f) {
|
|
3667
3675
|
console.error("Apple Pay session error:", f), s.abort(), e.config.onError({ attributes: { message: e.t("errorApplePayInit") } });
|
|
3668
3676
|
}
|
|
@@ -3695,8 +3703,8 @@ async function In(e, t) {
|
|
|
3695
3703
|
}, s.begin();
|
|
3696
3704
|
}
|
|
3697
3705
|
async function Qn(e, t) {
|
|
3698
|
-
var
|
|
3699
|
-
const o = (
|
|
3706
|
+
var k, w, I, R, L, x;
|
|
3707
|
+
const o = (k = e.checkoutContext) == null ? void 0 : k.data, i = ((I = (w = o == null ? void 0 : o.payment_methods) == null ? void 0 : w.data) == null ? void 0 : I.attributes) || {}, s = i.google_pay_settings || {};
|
|
3700
3708
|
if (!(i.payment_method_google_pay === "enabled" || i.payment_method_google_pay === !0)) {
|
|
3701
3709
|
e.config.onError({ attributes: { message: e.t("errorGooglePayUnsupported") } });
|
|
3702
3710
|
return;
|
|
@@ -3708,8 +3716,8 @@ async function Qn(e, t) {
|
|
|
3708
3716
|
});
|
|
3709
3717
|
return;
|
|
3710
3718
|
}
|
|
3711
|
-
const f = e.config.environment === "production", C = (s == null ? void 0 : s.merchant_name) || "Choco",
|
|
3712
|
-
if (f && !
|
|
3719
|
+
const f = e.config.environment === "production", C = (s == null ? void 0 : s.merchant_name) || "Choco", B = s == null ? void 0 : s.google_merchant_id;
|
|
3720
|
+
if (f && !B) {
|
|
3713
3721
|
e.config.onError({
|
|
3714
3722
|
attributes: { message: e.t("errorGooglePaySettingsUnavailable") }
|
|
3715
3723
|
});
|
|
@@ -3719,7 +3727,7 @@ async function Qn(e, t) {
|
|
|
3719
3727
|
await Sn(e, t, { gateway: a, gatewayMerchantId: l });
|
|
3720
3728
|
return;
|
|
3721
3729
|
}
|
|
3722
|
-
const
|
|
3730
|
+
const _ = Number(e._getCheckoutAmount()).toFixed(2);
|
|
3723
3731
|
try {
|
|
3724
3732
|
await e._loadGooglePaySdk();
|
|
3725
3733
|
} catch (N) {
|
|
@@ -3744,23 +3752,23 @@ async function Qn(e, t) {
|
|
|
3744
3752
|
parameters: { gateway: a, gatewayMerchantId: l }
|
|
3745
3753
|
}
|
|
3746
3754
|
}
|
|
3747
|
-
],
|
|
3755
|
+
], T = {
|
|
3748
3756
|
apiVersion: 2,
|
|
3749
3757
|
apiVersionMinor: 0,
|
|
3750
3758
|
allowedPaymentMethods: S,
|
|
3751
3759
|
transactionInfo: {
|
|
3752
3760
|
totalPriceStatus: "FINAL",
|
|
3753
3761
|
totalPriceLabel: "Итого",
|
|
3754
|
-
totalPrice:
|
|
3762
|
+
totalPrice: _,
|
|
3755
3763
|
currencyCode: e.config.currency,
|
|
3756
3764
|
countryCode: e.config.currency === "GEL" ? "GE" : "KZ"
|
|
3757
3765
|
},
|
|
3758
|
-
merchantInfo: f ? { merchantId:
|
|
3759
|
-
},
|
|
3766
|
+
merchantInfo: f ? { merchantId: B, merchantName: C } : { merchantName: C }
|
|
3767
|
+
}, v = new b.payments.api.PaymentsClient({
|
|
3760
3768
|
environment: f ? "PRODUCTION" : "TEST"
|
|
3761
3769
|
});
|
|
3762
3770
|
try {
|
|
3763
|
-
const N = await
|
|
3771
|
+
const N = await v.isReadyToPay({
|
|
3764
3772
|
apiVersion: 2,
|
|
3765
3773
|
apiVersionMinor: 0,
|
|
3766
3774
|
allowedPaymentMethods: S
|
|
@@ -3770,15 +3778,15 @@ async function Qn(e, t) {
|
|
|
3770
3778
|
return;
|
|
3771
3779
|
}
|
|
3772
3780
|
ne(e);
|
|
3773
|
-
const q = await
|
|
3781
|
+
const q = await v.loadPaymentData(T), J = (L = (R = q == null ? void 0 : q.paymentMethodData) == null ? void 0 : R.tokenizationData) == null ? void 0 : L.token;
|
|
3774
3782
|
if (!J) throw new Error(e.t("errorGooglePayPayment"));
|
|
3775
|
-
const
|
|
3783
|
+
const F = JSON.parse(J), M = await At(
|
|
3776
3784
|
e.apiUrl,
|
|
3777
3785
|
e._getApiConfig(),
|
|
3778
3786
|
e.deviceId,
|
|
3779
|
-
|
|
3787
|
+
F,
|
|
3780
3788
|
t
|
|
3781
|
-
), m = (M == null ? void 0 : M.id) ?? ((
|
|
3789
|
+
), m = (M == null ? void 0 : M.id) ?? ((x = M == null ? void 0 : M.data) == null ? void 0 : x.id);
|
|
3782
3790
|
m && ce(e, String(m));
|
|
3783
3791
|
} catch (N) {
|
|
3784
3792
|
j(e), N.statusCode === "CANCELED" ? e.config.onCancel() : (e.config.onError({
|
|
@@ -3817,44 +3825,44 @@ async function Sn(e, t, o) {
|
|
|
3817
3825
|
}
|
|
3818
3826
|
}
|
|
3819
3827
|
function Pn(e) {
|
|
3820
|
-
var a, l, f, C,
|
|
3828
|
+
var a, l, f, C, B, _, b, S, T, v, k, w;
|
|
3821
3829
|
const t = e.container;
|
|
3822
3830
|
(a = t.querySelector('[data-action="freedom-card"]')) == null || a.addEventListener("click", () => {
|
|
3823
3831
|
e.config.onFreedomLink && e.config.onFreedomLink();
|
|
3824
|
-
}), (l = t.querySelector('[data-action="pay"]')) == null || l.addEventListener("click", () => e.handlePayment()), (f = t.querySelector('[data-action="change-method"]')) == null || f.addEventListener("click", () => ft(e)), t.querySelectorAll('[data-action="close"]').forEach((
|
|
3832
|
+
}), (l = t.querySelector('[data-action="pay"]')) == null || l.addEventListener("click", () => e.handlePayment()), (f = t.querySelector('[data-action="change-method"]')) == null || f.addEventListener("click", () => ft(e)), t.querySelectorAll('[data-action="close"]').forEach((I) => I.addEventListener("click", () => e.close())), (C = t.querySelector('[data-action="close-sheet"]')) == null || C.addEventListener("click", () => {
|
|
3825
3833
|
e._pendingDeleteMethod ? ve(e) : G(e);
|
|
3826
|
-
}), (
|
|
3834
|
+
}), (B = t.querySelector('[data-action="edit-sheet"]')) == null || B.addEventListener("click", () => {
|
|
3827
3835
|
e.isPaymentSheetEditMode = !0, Ae(e), ue(e);
|
|
3828
|
-
}), (
|
|
3836
|
+
}), (_ = t.querySelector('[data-action="previous-sheet"]')) == null || _.addEventListener("click", () => {
|
|
3829
3837
|
e.isPaymentSheetEditMode = !1, Ae(e), ue(e);
|
|
3830
|
-
}), (b = t.querySelector('[data-action="close-add-card"]')) == null || b.addEventListener("click", () => ae(e)), (S = t.querySelector('[data-action="confirm-delete-cancel"]')) == null || S.addEventListener("click", () => ve(e)), (
|
|
3838
|
+
}), (b = t.querySelector('[data-action="close-add-card"]')) == null || b.addEventListener("click", () => ae(e)), (S = t.querySelector('[data-action="confirm-delete-cancel"]')) == null || S.addEventListener("click", () => ve(e)), (T = t.querySelector('[data-action="confirm-delete-submit"]')) == null || T.addEventListener("click", () => {
|
|
3831
3839
|
if (e._pendingDeleteMethod) {
|
|
3832
|
-
const
|
|
3833
|
-
De(e, !0), bn(e,
|
|
3840
|
+
const I = e._pendingDeleteMethod;
|
|
3841
|
+
De(e, !0), bn(e, I).then(() => G(e)).finally(() => De(e, !1));
|
|
3834
3842
|
}
|
|
3835
|
-
}), t.querySelectorAll(".choco-widget-method-item").forEach((
|
|
3836
|
-
|
|
3837
|
-
const
|
|
3838
|
-
|
|
3843
|
+
}), t.querySelectorAll(".choco-widget-method-item").forEach((I) => {
|
|
3844
|
+
I.addEventListener("click", (R) => {
|
|
3845
|
+
const L = JSON.parse(
|
|
3846
|
+
R.currentTarget.getAttribute("data-method") || "{}"
|
|
3839
3847
|
);
|
|
3840
|
-
gt(e,
|
|
3848
|
+
gt(e, L);
|
|
3841
3849
|
});
|
|
3842
3850
|
});
|
|
3843
3851
|
const o = t.querySelector('[data-sheet="payment"]');
|
|
3844
|
-
o && (o.addEventListener("click", (
|
|
3845
|
-
|
|
3852
|
+
o && (o.addEventListener("click", (I) => {
|
|
3853
|
+
I.target === o && G(e);
|
|
3846
3854
|
}), wn(e, o));
|
|
3847
3855
|
const i = t.querySelector('[data-action="toggle-balance"]');
|
|
3848
|
-
i && ((
|
|
3849
|
-
e.useBalance =
|
|
3856
|
+
i && ((v = i.querySelector("input[type='checkbox']")) == null || v.addEventListener("change", (I) => {
|
|
3857
|
+
e.useBalance = I.target.checked, tt(e), e._updatePayButtonAmount();
|
|
3850
3858
|
}));
|
|
3851
3859
|
const s = t.querySelector('[data-action="toggle-bonuses"]');
|
|
3852
|
-
s && ((
|
|
3853
|
-
e.useBonuses =
|
|
3860
|
+
s && ((k = s.querySelector("input[type='checkbox']")) == null || k.addEventListener("change", (I) => {
|
|
3861
|
+
e.useBonuses = I.target.checked, e.config.onAppliedBonus(e.useBonuses), tt(e), e._updatePayButtonAmount();
|
|
3854
3862
|
}));
|
|
3855
3863
|
const u = t.querySelector('[data-action="toggle-coupon"]');
|
|
3856
|
-
u && ((
|
|
3857
|
-
e.useCoupon =
|
|
3864
|
+
u && ((w = u.querySelector("input[type='checkbox']")) == null || w.addEventListener("change", (I) => {
|
|
3865
|
+
e.useCoupon = I.target.checked, e._updatePayButtonAmount();
|
|
3858
3866
|
})), document.removeEventListener("keydown", e._boundKeyDown), document.addEventListener("keydown", e._boundKeyDown), ht(e);
|
|
3859
3867
|
}
|
|
3860
3868
|
function kn(e, t) {
|
|
@@ -3868,17 +3876,17 @@ function wn(e, t) {
|
|
|
3868
3876
|
let u = 0, a = 0;
|
|
3869
3877
|
const l = (C) => {
|
|
3870
3878
|
a = C.clientY;
|
|
3871
|
-
const
|
|
3872
|
-
i.style.transform = `translateY(${
|
|
3879
|
+
const B = Math.max(0, a - u);
|
|
3880
|
+
i.style.transform = `translateY(${B}px)`;
|
|
3873
3881
|
}, f = (C) => {
|
|
3874
3882
|
o.releasePointerCapture(C.pointerId), o.removeEventListener("pointermove", l), o.removeEventListener("pointerup", f), o.removeEventListener("pointercancel", f);
|
|
3875
|
-
const
|
|
3876
|
-
if (i.classList.remove("choco-widget-sheet-content--dragging"),
|
|
3883
|
+
const B = Math.max(0, a - u);
|
|
3884
|
+
if (i.classList.remove("choco-widget-sheet-content--dragging"), B >= s) {
|
|
3877
3885
|
i.style.transform = "translateY(100%)";
|
|
3878
|
-
const
|
|
3879
|
-
i.removeEventListener("transitionend",
|
|
3886
|
+
const _ = () => {
|
|
3887
|
+
i.removeEventListener("transitionend", _), i.style.transform = "", G(e);
|
|
3880
3888
|
};
|
|
3881
|
-
i.addEventListener("transitionend",
|
|
3889
|
+
i.addEventListener("transitionend", _);
|
|
3882
3890
|
} else
|
|
3883
3891
|
i.style.transform = "";
|
|
3884
3892
|
};
|
|
@@ -3949,7 +3957,7 @@ class ie {
|
|
|
3949
3957
|
return Number.isFinite(t) && t > 0 ? t : 0;
|
|
3950
3958
|
}
|
|
3951
3959
|
_getPaymentBreakdown() {
|
|
3952
|
-
const t = this.config.amount, o = this._getBalanceAmount(), i = this.useBalance ? Math.min(o, t) : 0, s = t - i, u = this.useBalance && i >= t, a = this.useBonuses ? this._getAvailableBonus() : 0, l = Math.max(s - a, 0), f = this._getCouponDiscount(), C = Math.max(l - f, 0),
|
|
3960
|
+
const t = this.config.amount, o = this._getBalanceAmount(), i = this.useBalance ? Math.min(o, t) : 0, s = t - i, u = this.useBalance && i >= t, a = this.useBonuses ? this._getAvailableBonus() : 0, l = Math.max(s - a, 0), f = this._getCouponDiscount(), C = Math.max(l - f, 0), B = this.useBalance ? t : C, _ = this.useBalance && !u, S = this.useCoupon && this.selectedCoupon && !this._isCouponDisabled() ? {
|
|
3953
3961
|
id: this.selectedCoupon.voucher_id,
|
|
3954
3962
|
template_id: this.selectedCoupon.template_id,
|
|
3955
3963
|
type: this.selectedCoupon.type
|
|
@@ -3957,9 +3965,9 @@ class ie {
|
|
|
3957
3965
|
return {
|
|
3958
3966
|
payableAmount: C,
|
|
3959
3967
|
checkoutOptions: {
|
|
3960
|
-
checkoutAmount:
|
|
3968
|
+
checkoutAmount: B,
|
|
3961
3969
|
forceBalanceMethod: u,
|
|
3962
|
-
useBalance:
|
|
3970
|
+
useBalance: _,
|
|
3963
3971
|
voucher: S
|
|
3964
3972
|
}
|
|
3965
3973
|
};
|