choco-one-click-payment 1.1.33 → 1.1.35
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 +525 -510
- package/dist/index.js +43 -43
- 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-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-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-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 mt = {
|
|
3
3
|
ru: {
|
|
4
4
|
paymentMethod: "Способ оплаты",
|
|
@@ -172,24 +172,24 @@ for (let e = 0; e < 256; ++e)
|
|
|
172
172
|
function It(e, t = 0) {
|
|
173
173
|
return H[e[t + 0]] + H[e[t + 1]] + H[e[t + 2]] + H[e[t + 3]] + "-" + H[e[t + 4]] + H[e[t + 5]] + "-" + H[e[t + 6]] + H[e[t + 7]] + "-" + H[e[t + 8]] + H[e[t + 9]] + "-" + H[e[t + 10]] + H[e[t + 11]] + H[e[t + 12]] + H[e[t + 13]] + H[e[t + 14]] + H[e[t + 15]];
|
|
174
174
|
}
|
|
175
|
-
const Qt = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto),
|
|
175
|
+
const Qt = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), We = {
|
|
176
176
|
randomUUID: Qt
|
|
177
177
|
};
|
|
178
178
|
function Be(e, t, o) {
|
|
179
|
-
if (
|
|
180
|
-
return
|
|
179
|
+
if (We.randomUUID && !e)
|
|
180
|
+
return We.randomUUID();
|
|
181
181
|
e = e || {};
|
|
182
182
|
const i = e.random || (e.rng || Bt)();
|
|
183
183
|
return i[6] = i[6] & 15 | 64, i[8] = i[8] & 63 | 128, It(i);
|
|
184
184
|
}
|
|
185
|
-
const
|
|
185
|
+
const Ve = "choco_device_id";
|
|
186
186
|
function V(e, t = "ru", o = "KZT") {
|
|
187
187
|
const i = Number(e), s = t === "ru" ? "ru-RU" : "en-US";
|
|
188
188
|
return `${i.toLocaleString(s)} ${bt[o]}`;
|
|
189
189
|
}
|
|
190
190
|
function rt() {
|
|
191
|
-
let e = localStorage.getItem(
|
|
192
|
-
return e || (e = Be(), localStorage.setItem(
|
|
191
|
+
let e = localStorage.getItem(Ve);
|
|
192
|
+
return e || (e = Be(), localStorage.setItem(Ve, e)), e;
|
|
193
193
|
}
|
|
194
194
|
function Ce() {
|
|
195
195
|
if (typeof window > "u") return !1;
|
|
@@ -201,7 +201,7 @@ function ot() {
|
|
|
201
201
|
const e = navigator.userAgent || "", t = e.indexOf("OS");
|
|
202
202
|
return (e.indexOf("iPhone") > -1 || e.indexOf("iPad") > -1) && t > -1 ? Number(e.substring(t + 3, t + 6).replace("_", ".")) : 0;
|
|
203
203
|
}
|
|
204
|
-
function
|
|
204
|
+
function Xe() {
|
|
205
205
|
var u;
|
|
206
206
|
if (typeof navigator > "u") return "unknown";
|
|
207
207
|
const e = (navigator.userAgent || navigator.vendor || "").toLowerCase(), t = (navigator.platform || "").toLowerCase(), o = (((u = navigator.userAgentData) == null ? void 0 : u.platform) || "").toLowerCase(), i = `${e} ${t} ${o}`;
|
|
@@ -210,7 +210,7 @@ function De() {
|
|
|
210
210
|
function ye() {
|
|
211
211
|
if (typeof navigator > "u") return !1;
|
|
212
212
|
const e = navigator.userAgentData;
|
|
213
|
-
return e != null && e.platform && ["iOS", "iPadOS"].includes(e.platform) ||
|
|
213
|
+
return e != null && e.platform && ["iOS", "iPadOS"].includes(e.platform) || Xe() === "ios" ? !0 : (navigator.userAgent || "").includes("Macintosh") && typeof document < "u" && "ontouchend" in document;
|
|
214
214
|
}
|
|
215
215
|
function me(e) {
|
|
216
216
|
if (typeof sessionStorage > "u") return !1;
|
|
@@ -220,9 +220,9 @@ function me(e) {
|
|
|
220
220
|
function St(e) {
|
|
221
221
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
222
222
|
}
|
|
223
|
-
var fe = { exports: {} }, Pt = fe.exports,
|
|
223
|
+
var fe = { exports: {} }, Pt = fe.exports, Ye;
|
|
224
224
|
function kt() {
|
|
225
|
-
return
|
|
225
|
+
return Ye || (Ye = 1, (function(e, t) {
|
|
226
226
|
(function(i, s) {
|
|
227
227
|
e.exports = s();
|
|
228
228
|
})(Pt, function() {
|
|
@@ -237,8 +237,8 @@ function kt() {
|
|
|
237
237
|
Object.defineProperty(l, "__esModule", {
|
|
238
238
|
value: !0
|
|
239
239
|
}), l.Centrifuge = void 0;
|
|
240
|
-
var C =
|
|
241
|
-
function
|
|
240
|
+
var C = k(f(187)), P = k(f(471)), _ = f(147), b = f(853);
|
|
241
|
+
function k(g) {
|
|
242
242
|
return g && g.__esModule ? g : { default: g };
|
|
243
243
|
}
|
|
244
244
|
function T(g) {
|
|
@@ -249,20 +249,20 @@ function kt() {
|
|
|
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 I(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 w(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 B(g, h, p) {
|
|
263
|
+
return h && w(g.prototype, h), g;
|
|
264
264
|
}
|
|
265
|
-
function
|
|
265
|
+
function v(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
268
|
g.prototype = Object.create(h && h.prototype, { constructor: { value: g, writable: !0, configurable: !0 } }), h && L(g, h);
|
|
@@ -275,16 +275,16 @@ function kt() {
|
|
|
275
275
|
function O(g) {
|
|
276
276
|
var h = q();
|
|
277
277
|
return function() {
|
|
278
|
-
var A =
|
|
278
|
+
var A = J(g), n;
|
|
279
279
|
if (h) {
|
|
280
|
-
var r =
|
|
280
|
+
var r = J(this).constructor;
|
|
281
281
|
n = Reflect.construct(A, arguments, r);
|
|
282
282
|
} else
|
|
283
283
|
n = A.apply(this, arguments);
|
|
284
|
-
return
|
|
284
|
+
return F(this, n);
|
|
285
285
|
};
|
|
286
286
|
}
|
|
287
|
-
function
|
|
287
|
+
function F(g, h) {
|
|
288
288
|
if (h && (T(h) === "object" || typeof h == "function"))
|
|
289
289
|
return h;
|
|
290
290
|
if (h !== void 0)
|
|
@@ -306,17 +306,17 @@ function kt() {
|
|
|
306
306
|
return !1;
|
|
307
307
|
}
|
|
308
308
|
}
|
|
309
|
-
function
|
|
310
|
-
return
|
|
309
|
+
function J(g) {
|
|
310
|
+
return J = Object.setPrototypeOf ? Object.getPrototypeOf : function(p) {
|
|
311
311
|
return p.__proto__ || Object.getPrototypeOf(p);
|
|
312
|
-
},
|
|
312
|
+
}, J(g);
|
|
313
313
|
}
|
|
314
314
|
var x = "timeout", M = "connection closed", m = /* @__PURE__ */ (function(g) {
|
|
315
|
-
|
|
315
|
+
v(p, g);
|
|
316
316
|
var h = O(p);
|
|
317
317
|
function p(A, n) {
|
|
318
318
|
var r;
|
|
319
|
-
return
|
|
319
|
+
return I(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 kt() {
|
|
|
351
351
|
disableWithCredentials: !1
|
|
352
352
|
}, r._configure(n), r;
|
|
353
353
|
}
|
|
354
|
-
return
|
|
354
|
+
return B(p, [{
|
|
355
355
|
key: "setToken",
|
|
356
356
|
value: function(n) {
|
|
357
357
|
this._token = n;
|
|
@@ -389,24 +389,24 @@ function kt() {
|
|
|
389
389
|
}, {
|
|
390
390
|
key: "_ajax",
|
|
391
391
|
value: function(n, r, c, d, y) {
|
|
392
|
-
var
|
|
392
|
+
var E = this, S = "";
|
|
393
393
|
this._debug("sending AJAX request to", n, "with data", JSON.stringify(d));
|
|
394
|
-
var
|
|
395
|
-
this._xmlhttprequest !== null ?
|
|
394
|
+
var Q;
|
|
395
|
+
this._xmlhttprequest !== null ? Q = new this._xmlhttprequest() : Q = f.g.XMLHttpRequest ? new f.g.XMLHttpRequest() : new f.g.ActiveXObject("Microsoft.XMLHTTP");
|
|
396
396
|
for (var R in r)
|
|
397
|
-
r.hasOwnProperty(R) && (
|
|
398
|
-
|
|
397
|
+
r.hasOwnProperty(R) && (S.length > 0 && (S += "&"), S += encodeURIComponent(R) + "=" + encodeURIComponent(r[R]));
|
|
398
|
+
S.length > 0 && (S = "?" + S), Q.open("POST", n + S, !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
|
-
c.hasOwnProperty(X) &&
|
|
401
|
-
return
|
|
402
|
-
if (
|
|
403
|
-
if (
|
|
400
|
+
c.hasOwnProperty(X) && Q.setRequestHeader(X, c[X]);
|
|
401
|
+
return Q.onreadystatechange = function() {
|
|
402
|
+
if (Q.readyState === 4)
|
|
403
|
+
if (Q.status === 200) {
|
|
404
404
|
var U, D = !1;
|
|
405
405
|
try {
|
|
406
|
-
U = JSON.parse(
|
|
406
|
+
U = JSON.parse(Q.responseText), D = !0;
|
|
407
407
|
} catch {
|
|
408
408
|
y({
|
|
409
|
-
error: "Invalid JSON. Data was: " +
|
|
409
|
+
error: "Invalid JSON. Data was: " + Q.responseText,
|
|
410
410
|
status: 200,
|
|
411
411
|
data: null
|
|
412
412
|
});
|
|
@@ -416,23 +416,23 @@ function kt() {
|
|
|
416
416
|
status: 200
|
|
417
417
|
});
|
|
418
418
|
} else
|
|
419
|
-
|
|
420
|
-
status:
|
|
419
|
+
E._log("wrong status code in AJAX response", Q.status), y({
|
|
420
|
+
status: Q.status,
|
|
421
421
|
data: null
|
|
422
422
|
});
|
|
423
423
|
}, setTimeout(function() {
|
|
424
|
-
return
|
|
425
|
-
}, 20),
|
|
424
|
+
return Q.send(JSON.stringify(d));
|
|
425
|
+
}, 20), Q;
|
|
426
426
|
}
|
|
427
427
|
}, {
|
|
428
428
|
key: "_log",
|
|
429
429
|
value: function() {
|
|
430
|
-
(0,
|
|
430
|
+
(0, b.log)("info", arguments);
|
|
431
431
|
}
|
|
432
432
|
}, {
|
|
433
433
|
key: "_debug",
|
|
434
434
|
value: function() {
|
|
435
|
-
this._config.debug === !0 && (0,
|
|
435
|
+
this._config.debug === !0 && (0, b.log)("debug", arguments);
|
|
436
436
|
}
|
|
437
437
|
}, {
|
|
438
438
|
key: "_websocketSupported",
|
|
@@ -458,9 +458,9 @@ function kt() {
|
|
|
458
458
|
value: function(n) {
|
|
459
459
|
if (!("Promise" in f.g))
|
|
460
460
|
throw new Error("Promise polyfill required");
|
|
461
|
-
if ((0,
|
|
461
|
+
if ((0, b.extend)(this._config, n || {}), this._debug("centrifuge config", this._config), !this._url)
|
|
462
462
|
throw new Error("url required");
|
|
463
|
-
var r = (0,
|
|
463
|
+
var r = (0, b.startsWith)(this._url, "ws") && this._url.indexOf("format=protobuf") > -1;
|
|
464
464
|
if (r || this._config.protocol === "protobuf")
|
|
465
465
|
this._setFormat("protobuf"), this._protocol = "protobuf";
|
|
466
466
|
else {
|
|
@@ -468,7 +468,7 @@ function kt() {
|
|
|
468
468
|
throw new Error("unsupported protocol " + this._config.protocol);
|
|
469
469
|
this._setFormat("json");
|
|
470
470
|
}
|
|
471
|
-
if ((0,
|
|
471
|
+
if ((0, b.startsWith)(this._url, "http"))
|
|
472
472
|
if (this._debug("client will try to connect to SockJS endpoint"), this._config.sockjs !== null)
|
|
473
473
|
this._debug("SockJS explicitly provided in options"), this._sockjs = this._config.sockjs;
|
|
474
474
|
else {
|
|
@@ -513,7 +513,7 @@ function kt() {
|
|
|
513
513
|
}, {
|
|
514
514
|
key: "_getRetryInterval",
|
|
515
515
|
value: function() {
|
|
516
|
-
var n = (0,
|
|
516
|
+
var n = (0, b.backoff)(this._retries, this._config.minRetry, this._config.maxRetry);
|
|
517
517
|
return this._retries += 1, n;
|
|
518
518
|
}
|
|
519
519
|
}, {
|
|
@@ -546,12 +546,12 @@ function kt() {
|
|
|
546
546
|
this._callbacks = {};
|
|
547
547
|
for (var y in this._subs)
|
|
548
548
|
if (this._subs.hasOwnProperty(y)) {
|
|
549
|
-
var
|
|
550
|
-
n ? (
|
|
549
|
+
var E = this._subs[y];
|
|
550
|
+
n ? (E._isSuccess() && (E._triggerUnsubscribe(), E._recover = !0), E._shouldResubscribe() && E._setSubscribing()) : E._setUnsubscribed();
|
|
551
551
|
}
|
|
552
552
|
this._abortInflightXHRs(), this._refreshTimeout !== null && (clearTimeout(this._refreshTimeout), this._refreshTimeout = null);
|
|
553
|
-
for (var
|
|
554
|
-
this._subRefreshTimeouts.hasOwnProperty(
|
|
553
|
+
for (var S in this._subRefreshTimeouts)
|
|
554
|
+
this._subRefreshTimeouts.hasOwnProperty(S) && this._subRefreshTimeouts[S] && this._clearSubRefreshTimeout(S);
|
|
555
555
|
this._subRefreshTimeouts = {}, this._reconnect || (this._subs = {});
|
|
556
556
|
}
|
|
557
557
|
}, {
|
|
@@ -609,17 +609,17 @@ function kt() {
|
|
|
609
609
|
// method: this._methodType.CONNECT
|
|
610
610
|
};
|
|
611
611
|
(n._token || n._connectData || n._config.name || n._config.version) && (d.params = {}), n._token && (d.params.token = n._token), n._connectData && (d.params.data = n._connectData), n._config.name && (d.params.name = n._config.name), n._config.version && (d.params.version = n._config.version);
|
|
612
|
-
var y = {},
|
|
613
|
-
for (var
|
|
614
|
-
if (n._serverSubs.hasOwnProperty(
|
|
615
|
-
|
|
616
|
-
var
|
|
612
|
+
var y = {}, E = !1;
|
|
613
|
+
for (var S in n._serverSubs)
|
|
614
|
+
if (n._serverSubs.hasOwnProperty(S) && n._serverSubs[S].recoverable) {
|
|
615
|
+
E = !0;
|
|
616
|
+
var Q = {
|
|
617
617
|
recover: !0
|
|
618
618
|
};
|
|
619
|
-
n._serverSubs[
|
|
619
|
+
n._serverSubs[S].seq || n._serverSubs[S].gen ? (n._serverSubs[S].seq && (Q.seq = n._serverSubs[S].seq), n._serverSubs[S].gen && (Q.gen = n._serverSubs[S].gen)) : n._serverSubs[S].offset && (Q.offset = n._serverSubs[S].offset), n._serverSubs[S].epoch && (Q.epoch = n._serverSubs[S].epoch), y[S] = Q;
|
|
620
620
|
}
|
|
621
|
-
|
|
622
|
-
n._connectResponse(n._decoder.decodeCommandResult(n._methodType.CONNECT, R.result),
|
|
621
|
+
E && (d.params || (d.params = {}), d.params.subs = y), n._latencyStart = /* @__PURE__ */ new Date(), n._call(d).then(function(R) {
|
|
622
|
+
n._connectResponse(n._decoder.decodeCommandResult(n._methodType.CONNECT, R.result), E), R.next && R.next();
|
|
623
623
|
}, function(R) {
|
|
624
624
|
var X = R.error;
|
|
625
625
|
X.code === 109 && (n._refreshRequired = !0), n._disconnect("connect error", !0), R.next && R.next();
|
|
@@ -628,24 +628,24 @@ function kt() {
|
|
|
628
628
|
n._debug("transport level error", d);
|
|
629
629
|
}, this._transport.onclose = function(d) {
|
|
630
630
|
n._transportClosed = !0;
|
|
631
|
-
var y = M,
|
|
631
|
+
var y = M, E = !0;
|
|
632
632
|
if (d && "reason" in d && d.reason)
|
|
633
633
|
try {
|
|
634
|
-
var
|
|
635
|
-
n._debug("reason is an advice object",
|
|
634
|
+
var S = JSON.parse(d.reason);
|
|
635
|
+
n._debug("reason is an advice object", S), y = S.reason, E = S.reconnect;
|
|
636
636
|
} catch {
|
|
637
637
|
y = d.reason, n._debug("reason is a plain string", y);
|
|
638
638
|
}
|
|
639
639
|
if (n._config.onTransportClose !== null && n._config.onTransportClose({
|
|
640
640
|
event: d,
|
|
641
641
|
reason: y,
|
|
642
|
-
reconnect:
|
|
643
|
-
}), n._disconnect(y,
|
|
642
|
+
reconnect: E
|
|
643
|
+
}), n._disconnect(y, E), n._reconnect === !0) {
|
|
644
644
|
n._reconnecting = !0;
|
|
645
|
-
var
|
|
646
|
-
n._debug("reconnect after " +
|
|
645
|
+
var Q = n._getRetryInterval();
|
|
646
|
+
n._debug("reconnect after " + Q + " milliseconds"), setTimeout(function() {
|
|
647
647
|
n._reconnect === !0 && (n._refreshRequired ? n._refresh() : n._connect());
|
|
648
|
-
},
|
|
648
|
+
}, Q);
|
|
649
649
|
}
|
|
650
650
|
}, this._transport.onmessage = function(d) {
|
|
651
651
|
n._dataReceived(d.data);
|
|
@@ -705,10 +705,10 @@ function kt() {
|
|
|
705
705
|
value: function(n, r) {
|
|
706
706
|
var c = this;
|
|
707
707
|
return this.isConnected() ? new Promise(function(d, y) {
|
|
708
|
-
c._call(n).then(function(
|
|
709
|
-
d(r(c._decoder.decodeCommandResult(n.method,
|
|
710
|
-
}, function(
|
|
711
|
-
y(
|
|
708
|
+
c._call(n).then(function(E) {
|
|
709
|
+
d(r(c._decoder.decodeCommandResult(n.method, E.result))), E.next && E.next();
|
|
710
|
+
}, function(E) {
|
|
711
|
+
y(E.error), E.next && E.next();
|
|
712
712
|
});
|
|
713
713
|
}) : Promise.reject(this._createErrorObject(M, 0));
|
|
714
714
|
}
|
|
@@ -786,13 +786,13 @@ function kt() {
|
|
|
786
786
|
}, {
|
|
787
787
|
key: "_dispatchSynchronized",
|
|
788
788
|
value: function(n, r) {
|
|
789
|
-
var c = this, d = Promise.resolve(), y = function(
|
|
790
|
-
n.hasOwnProperty(
|
|
791
|
-
return c._dispatchReply(n[
|
|
789
|
+
var c = this, d = Promise.resolve(), y = function(Q) {
|
|
790
|
+
n.hasOwnProperty(Q) && (d = d.then(function() {
|
|
791
|
+
return c._dispatchReply(n[Q]);
|
|
792
792
|
}));
|
|
793
793
|
};
|
|
794
|
-
for (var
|
|
795
|
-
y(
|
|
794
|
+
for (var E in n)
|
|
795
|
+
y(E);
|
|
796
796
|
d = d.then(function() {
|
|
797
797
|
r();
|
|
798
798
|
});
|
|
@@ -860,10 +860,10 @@ function kt() {
|
|
|
860
860
|
return;
|
|
861
861
|
}
|
|
862
862
|
this._refreshTimeout !== null && (clearTimeout(this._refreshTimeout), this._refreshTimeout = null);
|
|
863
|
-
var r = this._clientID, c = this._newXHRID(), d = function(
|
|
863
|
+
var r = this._clientID, c = this._newXHRID(), d = function(Q) {
|
|
864
864
|
if (c in n._xhrs && delete n._xhrs[c], n._clientID === r) {
|
|
865
|
-
if (
|
|
866
|
-
if (
|
|
865
|
+
if (Q.error || Q.status !== 200) {
|
|
866
|
+
if (Q.error ? n._debug("error refreshing connection token", Q.error) : n._debug("error refreshing connection token: wrong status code", Q.status), n._numRefreshFailed++, n._refreshTimeout !== null && (clearTimeout(n._refreshTimeout), n._refreshTimeout = null), n._config.refreshAttempts !== null && n._numRefreshFailed >= n._config.refreshAttempts) {
|
|
867
867
|
n._refreshFailed();
|
|
868
868
|
return;
|
|
869
869
|
}
|
|
@@ -873,7 +873,7 @@ function kt() {
|
|
|
873
873
|
}, X);
|
|
874
874
|
return;
|
|
875
875
|
}
|
|
876
|
-
if (n._numRefreshFailed = 0, n._token =
|
|
876
|
+
if (n._numRefreshFailed = 0, n._token = Q.data.token, !n._token) {
|
|
877
877
|
n._refreshFailed();
|
|
878
878
|
return;
|
|
879
879
|
}
|
|
@@ -899,8 +899,8 @@ function kt() {
|
|
|
899
899
|
var y = {};
|
|
900
900
|
this._config.onRefresh(y, d);
|
|
901
901
|
} else {
|
|
902
|
-
var
|
|
903
|
-
this._xhrs[c] =
|
|
902
|
+
var E = this._ajax(this._config.refreshEndpoint, this._config.refreshParams, this._config.refreshHeaders, this._config.refreshData, d);
|
|
903
|
+
this._xhrs[c] = E;
|
|
904
904
|
}
|
|
905
905
|
}
|
|
906
906
|
}, {
|
|
@@ -958,17 +958,17 @@ function kt() {
|
|
|
958
958
|
});
|
|
959
959
|
}
|
|
960
960
|
}
|
|
961
|
-
},
|
|
961
|
+
}, E = {
|
|
962
962
|
client: this._clientID,
|
|
963
963
|
channels: [n]
|
|
964
964
|
};
|
|
965
965
|
if (this._config.onPrivateSubscribe !== null)
|
|
966
966
|
this._config.onPrivateSubscribe({
|
|
967
|
-
data:
|
|
967
|
+
data: E
|
|
968
968
|
}, y);
|
|
969
969
|
else {
|
|
970
|
-
var
|
|
971
|
-
this._xhrs[d] =
|
|
970
|
+
var S = this._ajax(this._config.subscribeEndpoint, this._config.subscribeParams, this._config.subscribeHeaders, E, y);
|
|
971
|
+
this._xhrs[d] = S;
|
|
972
972
|
}
|
|
973
973
|
}
|
|
974
974
|
}, {
|
|
@@ -983,10 +983,10 @@ function kt() {
|
|
|
983
983
|
this._debug("subscription refresh error", n, r), this._clearSubRefreshTimeout(n);
|
|
984
984
|
var d = this._getSub(n);
|
|
985
985
|
if (d !== null) {
|
|
986
|
-
var y = Math.round(Math.random() * 1e3),
|
|
986
|
+
var y = Math.round(Math.random() * 1e3), E = setTimeout(function() {
|
|
987
987
|
return c._subRefresh(n);
|
|
988
988
|
}, this._config.subRefreshInterval + y);
|
|
989
|
-
this._subRefreshTimeouts[n] =
|
|
989
|
+
this._subRefreshTimeouts[n] = E;
|
|
990
990
|
}
|
|
991
991
|
}
|
|
992
992
|
}, {
|
|
@@ -1019,15 +1019,15 @@ function kt() {
|
|
|
1019
1019
|
channel: d
|
|
1020
1020
|
}
|
|
1021
1021
|
};
|
|
1022
|
-
if (n._subscribeData && (y.params.data = n._subscribeData), (0,
|
|
1022
|
+
if (n._subscribeData && (y.params.data = n._subscribeData), (0, b.startsWith)(d, this._config.privateChannelPrefix))
|
|
1023
1023
|
this._isSubscribeBatching ? this._privateChannels[d] = !0 : (this.startSubscribeBatching(), this._subscribe(n), this.stopSubscribeBatching());
|
|
1024
1024
|
else {
|
|
1025
|
-
var
|
|
1026
|
-
if (
|
|
1025
|
+
var E = n._needRecover();
|
|
1026
|
+
if (E === !0) {
|
|
1027
1027
|
y.params.recover = !0;
|
|
1028
|
-
var
|
|
1029
|
-
if (
|
|
1030
|
-
|
|
1028
|
+
var S = this._getLastSeq(d), Q = this._getLastGen(d);
|
|
1029
|
+
if (S || Q)
|
|
1030
|
+
S && (y.params.seq = S), Q && (y.params.gen = Q);
|
|
1031
1031
|
else {
|
|
1032
1032
|
var R = this._getLastOffset(d);
|
|
1033
1033
|
R && (y.params.offset = R);
|
|
@@ -1036,7 +1036,7 @@ function kt() {
|
|
|
1036
1036
|
X && (y.params.epoch = X);
|
|
1037
1037
|
}
|
|
1038
1038
|
this._call(y).then(function(U) {
|
|
1039
|
-
c._subscribeResponse(d,
|
|
1039
|
+
c._subscribeResponse(d, E, c._decoder.decodeCommandResult(c._methodType.SUBSCRIBE, U.result)), U.next && U.next();
|
|
1040
1040
|
}, function(U) {
|
|
1041
1041
|
c._subscribeError(d, U.error), U.next && U.next();
|
|
1042
1042
|
});
|
|
@@ -1083,16 +1083,16 @@ function kt() {
|
|
|
1083
1083
|
}, this._getTTLMilliseconds(n.ttl))), this.startBatching(), this.startSubscribeBatching();
|
|
1084
1084
|
for (var y in this._subs)
|
|
1085
1085
|
if (this._subs.hasOwnProperty(y)) {
|
|
1086
|
-
var
|
|
1087
|
-
|
|
1086
|
+
var E = this._subs[y];
|
|
1087
|
+
E._shouldResubscribe() && this._subscribe(E, d);
|
|
1088
1088
|
}
|
|
1089
1089
|
this.stopSubscribeBatching(), this.stopBatching(), this._startPing();
|
|
1090
|
-
var
|
|
1090
|
+
var S = {
|
|
1091
1091
|
client: n.client,
|
|
1092
1092
|
transport: this._transportName,
|
|
1093
1093
|
latency: this._latency
|
|
1094
1094
|
};
|
|
1095
|
-
n.data && (
|
|
1095
|
+
n.data && (S.data = n.data), this.emit("connect", S), n.subs && this._processServerSubs(n.subs);
|
|
1096
1096
|
}
|
|
1097
1097
|
}
|
|
1098
1098
|
}, {
|
|
@@ -1106,23 +1106,23 @@ function kt() {
|
|
|
1106
1106
|
};
|
|
1107
1107
|
y = this._expandSubscribeContext(y, c), this.emit("subscribe", y);
|
|
1108
1108
|
}
|
|
1109
|
-
for (var
|
|
1110
|
-
if (n.hasOwnProperty(
|
|
1111
|
-
var
|
|
1112
|
-
if (
|
|
1113
|
-
var
|
|
1114
|
-
if (
|
|
1115
|
-
|
|
1116
|
-
for (var R in
|
|
1117
|
-
|
|
1109
|
+
for (var E in n)
|
|
1110
|
+
if (n.hasOwnProperty(E)) {
|
|
1111
|
+
var S = n[E];
|
|
1112
|
+
if (S.recovered) {
|
|
1113
|
+
var Q = S.publications;
|
|
1114
|
+
if (Q && Q.length > 0) {
|
|
1115
|
+
Q.length > 1 && (!Q[0].offset || Q[0].offset > Q[1].offset) && (Q = Q.reverse());
|
|
1116
|
+
for (var R in Q)
|
|
1117
|
+
Q.hasOwnProperty(R) && this._handlePublication(E, Q[R]);
|
|
1118
1118
|
}
|
|
1119
1119
|
}
|
|
1120
|
-
this._serverSubs[
|
|
1121
|
-
seq:
|
|
1122
|
-
gen:
|
|
1123
|
-
offset:
|
|
1124
|
-
epoch:
|
|
1125
|
-
recoverable:
|
|
1120
|
+
this._serverSubs[E] = {
|
|
1121
|
+
seq: S.seq,
|
|
1122
|
+
gen: S.gen,
|
|
1123
|
+
offset: S.offset,
|
|
1124
|
+
epoch: S.epoch,
|
|
1125
|
+
recoverable: S.recoverable
|
|
1126
1126
|
};
|
|
1127
1127
|
}
|
|
1128
1128
|
}
|
|
@@ -1171,9 +1171,9 @@ function kt() {
|
|
|
1171
1171
|
"positioned" in r && (d = r.positioned);
|
|
1172
1172
|
var y = "";
|
|
1173
1173
|
"epoch" in r && (y = r.epoch);
|
|
1174
|
-
var
|
|
1175
|
-
return "offset" in r && (
|
|
1176
|
-
offset:
|
|
1174
|
+
var E = 0;
|
|
1175
|
+
return "offset" in r && (E = r.offset), d && (n.streamPosition = {
|
|
1176
|
+
offset: E,
|
|
1177
1177
|
epoch: y
|
|
1178
1178
|
}), r.data && (n.data = r.data), n;
|
|
1179
1179
|
}
|
|
@@ -1183,17 +1183,17 @@ function kt() {
|
|
|
1183
1183
|
var d = this, y = this._getSub(n);
|
|
1184
1184
|
if (y && y._isSubscribing()) {
|
|
1185
1185
|
y._setSubscribeSuccess(c);
|
|
1186
|
-
var
|
|
1187
|
-
if (
|
|
1188
|
-
|
|
1189
|
-
for (var
|
|
1190
|
-
|
|
1186
|
+
var E = c.publications;
|
|
1187
|
+
if (E && E.length > 0) {
|
|
1188
|
+
E.length >= 2 && !E[0].offset && !E[1].offset && (E = E.reverse());
|
|
1189
|
+
for (var S in E)
|
|
1190
|
+
E.hasOwnProperty(S) && this._handlePublication(n, E[S]);
|
|
1191
1191
|
}
|
|
1192
1192
|
if (c.recoverable && (!r || !c.recovered) && (this._lastSeq[n] = c.seq || 0, this._lastGen[n] = c.gen || 0, this._lastOffset[n] = c.offset || 0), this._lastEpoch[n] = c.epoch || "", c.recoverable && (y._recoverable = !0), c.expires === !0) {
|
|
1193
|
-
var
|
|
1193
|
+
var Q = setTimeout(function() {
|
|
1194
1194
|
return d._subRefresh(n);
|
|
1195
1195
|
}, this._getTTLMilliseconds(c.ttl));
|
|
1196
|
-
this._subRefreshTimeouts[n] =
|
|
1196
|
+
this._subRefreshTimeouts[n] = Q;
|
|
1197
1197
|
}
|
|
1198
1198
|
}
|
|
1199
1199
|
}
|
|
@@ -1206,22 +1206,22 @@ function kt() {
|
|
|
1206
1206
|
return;
|
|
1207
1207
|
}
|
|
1208
1208
|
var y = this._callbacks[c];
|
|
1209
|
-
if (clearTimeout(this._callbacks[c].timeout), delete this._callbacks[c], (0,
|
|
1210
|
-
var
|
|
1211
|
-
if (!
|
|
1209
|
+
if (clearTimeout(this._callbacks[c].timeout), delete this._callbacks[c], (0, b.errorExists)(n)) {
|
|
1210
|
+
var S = y.errback;
|
|
1211
|
+
if (!S) {
|
|
1212
1212
|
r();
|
|
1213
1213
|
return;
|
|
1214
1214
|
}
|
|
1215
|
-
var
|
|
1216
|
-
|
|
1217
|
-
error:
|
|
1215
|
+
var Q = n.error;
|
|
1216
|
+
S({
|
|
1217
|
+
error: Q,
|
|
1218
1218
|
next: r
|
|
1219
1219
|
});
|
|
1220
1220
|
} else {
|
|
1221
|
-
var
|
|
1222
|
-
if (!
|
|
1221
|
+
var E = y.callback;
|
|
1222
|
+
if (!E)
|
|
1223
1223
|
return;
|
|
1224
|
-
|
|
1224
|
+
E({
|
|
1225
1225
|
result: d,
|
|
1226
1226
|
next: r
|
|
1227
1227
|
});
|
|
@@ -1304,14 +1304,14 @@ function kt() {
|
|
|
1304
1304
|
"type" in c && (d = c.type);
|
|
1305
1305
|
var y = c.channel;
|
|
1306
1306
|
if (d === this._pushType.PUBLICATION) {
|
|
1307
|
-
var
|
|
1308
|
-
this._handlePublication(y,
|
|
1307
|
+
var E = this._decoder.decodePushData(this._pushType.PUBLICATION, c.data);
|
|
1308
|
+
this._handlePublication(y, E);
|
|
1309
1309
|
} else if (d === this._pushType.MESSAGE) {
|
|
1310
|
-
var
|
|
1311
|
-
this._handleMessage(
|
|
1310
|
+
var S = this._decoder.decodePushData(this._pushType.MESSAGE, c.data);
|
|
1311
|
+
this._handleMessage(S);
|
|
1312
1312
|
} else if (d === this._pushType.JOIN) {
|
|
1313
|
-
var
|
|
1314
|
-
this._handleJoin(y,
|
|
1313
|
+
var Q = this._decoder.decodePushData(this._pushType.JOIN, c.data);
|
|
1314
|
+
this._handleJoin(y, Q);
|
|
1315
1315
|
} else if (d === this._pushType.LEAVE) {
|
|
1316
1316
|
var R = this._decoder.decodePushData(this._pushType.LEAVE, c.data);
|
|
1317
1317
|
this._handleLeave(y, R);
|
|
@@ -1389,7 +1389,7 @@ function kt() {
|
|
|
1389
1389
|
errback: c,
|
|
1390
1390
|
timeout: null
|
|
1391
1391
|
}, this._callbacks[n].timeout = setTimeout(function() {
|
|
1392
|
-
delete d._callbacks[n], (0,
|
|
1392
|
+
delete d._callbacks[n], (0, b.isFunction)(c) && c({
|
|
1393
1393
|
error: d._createErrorObject(x)
|
|
1394
1394
|
});
|
|
1395
1395
|
}, this._config.timeout);
|
|
@@ -1454,11 +1454,11 @@ function kt() {
|
|
|
1454
1454
|
this._debug("no private channels found, no need to make request");
|
|
1455
1455
|
return;
|
|
1456
1456
|
}
|
|
1457
|
-
var
|
|
1457
|
+
var E = {
|
|
1458
1458
|
client: this._clientID,
|
|
1459
1459
|
channels: c
|
|
1460
|
-
},
|
|
1461
|
-
if (
|
|
1460
|
+
}, S = this._clientID, Q = this._newXHRID(), R = function(D) {
|
|
1461
|
+
if (Q in n._xhrs && delete n._xhrs[Q], n._clientID === S) {
|
|
1462
1462
|
if (D.error || D.status !== 200) {
|
|
1463
1463
|
n._debug("authorization request failed");
|
|
1464
1464
|
for (var re in c)
|
|
@@ -1474,55 +1474,55 @@ function kt() {
|
|
|
1474
1474
|
var ke = D.data.channels[W];
|
|
1475
1475
|
ke.channel && (le[ke.channel] = ke.token);
|
|
1476
1476
|
}
|
|
1477
|
-
var
|
|
1478
|
-
n._isBatching || (n.startBatching(),
|
|
1479
|
-
for (var
|
|
1480
|
-
if (c.hasOwnProperty(
|
|
1477
|
+
var xe = !1;
|
|
1478
|
+
n._isBatching || (n.startBatching(), xe = !0);
|
|
1479
|
+
for (var Fe in c)
|
|
1480
|
+
if (c.hasOwnProperty(Fe)) {
|
|
1481
1481
|
var yt = (function() {
|
|
1482
|
-
var z = c[
|
|
1483
|
-
if (
|
|
1482
|
+
var z = c[Fe], Je = le[z];
|
|
1483
|
+
if (Je) {
|
|
1484
1484
|
var oe = {
|
|
1485
1485
|
method: n._methodType.SUBSCRIBE,
|
|
1486
1486
|
params: {
|
|
1487
1487
|
channel: z,
|
|
1488
|
-
token:
|
|
1488
|
+
token: Je
|
|
1489
1489
|
}
|
|
1490
|
-
},
|
|
1491
|
-
if (
|
|
1490
|
+
}, qe = n._getSub(z);
|
|
1491
|
+
if (qe === null)
|
|
1492
1492
|
return "continue";
|
|
1493
|
-
var
|
|
1494
|
-
if (
|
|
1493
|
+
var je = qe._needRecover();
|
|
1494
|
+
if (je === !0) {
|
|
1495
1495
|
oe.params.recover = !0;
|
|
1496
1496
|
var we = n._getLastSeq(z), _e = n._getLastGen(z);
|
|
1497
1497
|
if (we || _e)
|
|
1498
1498
|
we && (oe.params.seq = we), _e && (oe.params.gen = _e);
|
|
1499
1499
|
else {
|
|
1500
|
-
var
|
|
1501
|
-
|
|
1500
|
+
var ze = n._getLastOffset(z);
|
|
1501
|
+
ze && (oe.params.offset = ze);
|
|
1502
1502
|
}
|
|
1503
|
-
var
|
|
1504
|
-
|
|
1503
|
+
var Ke = n._getLastEpoch(z);
|
|
1504
|
+
Ke && (oe.params.epoch = Ke);
|
|
1505
1505
|
}
|
|
1506
|
-
n._call(oe).then(function(
|
|
1507
|
-
n._subscribeResponse(z,
|
|
1508
|
-
}, function(
|
|
1509
|
-
n._subscribeError(z,
|
|
1506
|
+
n._call(oe).then(function($) {
|
|
1507
|
+
n._subscribeResponse(z, je, n._decoder.decodeCommandResult(n._methodType.SUBSCRIBE, $.result)), $.next && $.next();
|
|
1508
|
+
}, function($) {
|
|
1509
|
+
n._subscribeError(z, $.error), $.next && $.next();
|
|
1510
1510
|
});
|
|
1511
1511
|
} else
|
|
1512
1512
|
return n._subscribeError(z, n._createErrorObject("permission denied", 103)), "continue";
|
|
1513
1513
|
})();
|
|
1514
1514
|
if (yt === "continue") continue;
|
|
1515
1515
|
}
|
|
1516
|
-
|
|
1516
|
+
xe && n.stopBatching();
|
|
1517
1517
|
}
|
|
1518
1518
|
};
|
|
1519
1519
|
if (this._config.onPrivateSubscribe !== null)
|
|
1520
1520
|
this._config.onPrivateSubscribe({
|
|
1521
|
-
data:
|
|
1521
|
+
data: E
|
|
1522
1522
|
}, R);
|
|
1523
1523
|
else {
|
|
1524
|
-
var X = this._ajax(this._config.subscribeEndpoint, this._config.subscribeParams, this._config.subscribeHeaders,
|
|
1525
|
-
this._xhrs[
|
|
1524
|
+
var X = this._ajax(this._config.subscribeEndpoint, this._config.subscribeParams, this._config.subscribeHeaders, E, R);
|
|
1525
|
+
this._xhrs[Q] = X;
|
|
1526
1526
|
}
|
|
1527
1527
|
}
|
|
1528
1528
|
}, {
|
|
@@ -1536,7 +1536,7 @@ function kt() {
|
|
|
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 P.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 kt() {
|
|
|
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), P = C.Centrifuge;
|
|
1555
|
+
l.default = P, a.exports = l.default;
|
|
1556
1556
|
})
|
|
1557
1557
|
),
|
|
1558
1558
|
/***/
|
|
@@ -1562,18 +1562,18 @@ function kt() {
|
|
|
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(I, w) {
|
|
1566
|
+
if (!(I instanceof w))
|
|
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(I, w) {
|
|
1570
|
+
for (var B = 0; B < w.length; B++) {
|
|
1571
|
+
var v = w[B];
|
|
1572
|
+
v.enumerable = v.enumerable || !1, v.configurable = !0, "value" in v && (v.writable = !0), Object.defineProperty(I, v.key, v);
|
|
1573
1573
|
}
|
|
1574
1574
|
}
|
|
1575
|
-
function
|
|
1576
|
-
return
|
|
1575
|
+
function P(I, w, B) {
|
|
1576
|
+
return w && C(I.prototype, w), I;
|
|
1577
1577
|
}
|
|
1578
1578
|
var _ = {
|
|
1579
1579
|
CONNECT: 0,
|
|
@@ -1590,7 +1590,7 @@ function kt() {
|
|
|
1590
1590
|
SUB_REFRESH: 11
|
|
1591
1591
|
};
|
|
1592
1592
|
l.JsonMethodType = _;
|
|
1593
|
-
var
|
|
1593
|
+
var b = {
|
|
1594
1594
|
PUBLICATION: 0,
|
|
1595
1595
|
JOIN: 1,
|
|
1596
1596
|
LEAVE: 2,
|
|
@@ -1598,52 +1598,52 @@ function kt() {
|
|
|
1598
1598
|
MESSAGE: 4,
|
|
1599
1599
|
SUBSCRIBE: 5
|
|
1600
1600
|
};
|
|
1601
|
-
l.JsonPushType =
|
|
1602
|
-
var
|
|
1603
|
-
function
|
|
1604
|
-
f(this,
|
|
1601
|
+
l.JsonPushType = b;
|
|
1602
|
+
var k = /* @__PURE__ */ (function() {
|
|
1603
|
+
function I() {
|
|
1604
|
+
f(this, I);
|
|
1605
1605
|
}
|
|
1606
|
-
return
|
|
1606
|
+
return P(I, [{
|
|
1607
1607
|
key: "encodeCommands",
|
|
1608
|
-
value: function(
|
|
1609
|
-
return
|
|
1610
|
-
return JSON.stringify(
|
|
1608
|
+
value: function(B) {
|
|
1609
|
+
return B.map(function(v) {
|
|
1610
|
+
return JSON.stringify(v);
|
|
1611
1611
|
}).join(`
|
|
1612
1612
|
`);
|
|
1613
1613
|
}
|
|
1614
|
-
}]),
|
|
1614
|
+
}]), I;
|
|
1615
1615
|
})();
|
|
1616
|
-
l.JsonEncoder =
|
|
1616
|
+
l.JsonEncoder = k;
|
|
1617
1617
|
var T = /* @__PURE__ */ (function() {
|
|
1618
|
-
function
|
|
1619
|
-
f(this,
|
|
1618
|
+
function I() {
|
|
1619
|
+
f(this, I);
|
|
1620
1620
|
}
|
|
1621
|
-
return
|
|
1621
|
+
return P(I, [{
|
|
1622
1622
|
key: "decodeReplies",
|
|
1623
|
-
value: function(
|
|
1624
|
-
return
|
|
1625
|
-
`).filter(function(
|
|
1626
|
-
return
|
|
1627
|
-
}).map(function(
|
|
1628
|
-
return JSON.parse(
|
|
1623
|
+
value: function(B) {
|
|
1624
|
+
return B.split(`
|
|
1625
|
+
`).filter(function(v) {
|
|
1626
|
+
return v !== "";
|
|
1627
|
+
}).map(function(v) {
|
|
1628
|
+
return JSON.parse(v);
|
|
1629
1629
|
});
|
|
1630
1630
|
}
|
|
1631
1631
|
}, {
|
|
1632
1632
|
key: "decodeCommandResult",
|
|
1633
|
-
value: function(
|
|
1634
|
-
return
|
|
1633
|
+
value: function(B, v) {
|
|
1634
|
+
return v;
|
|
1635
1635
|
}
|
|
1636
1636
|
}, {
|
|
1637
1637
|
key: "decodePush",
|
|
1638
|
-
value: function(
|
|
1639
|
-
return
|
|
1638
|
+
value: function(B) {
|
|
1639
|
+
return B;
|
|
1640
1640
|
}
|
|
1641
1641
|
}, {
|
|
1642
1642
|
key: "decodePushData",
|
|
1643
|
-
value: function(
|
|
1644
|
-
return
|
|
1643
|
+
value: function(B, v) {
|
|
1644
|
+
return v;
|
|
1645
1645
|
}
|
|
1646
|
-
}]),
|
|
1646
|
+
}]), I;
|
|
1647
1647
|
})();
|
|
1648
1648
|
l.JsonDecoder = T;
|
|
1649
1649
|
})
|
|
@@ -1663,11 +1663,11 @@ function kt() {
|
|
|
1663
1663
|
Object.defineProperty(l, "__esModule", {
|
|
1664
1664
|
value: !0
|
|
1665
1665
|
}), l.default = void 0;
|
|
1666
|
-
var
|
|
1667
|
-
function
|
|
1666
|
+
var P = b(f(187)), _ = f(853);
|
|
1667
|
+
function b(h) {
|
|
1668
1668
|
return h && h.__esModule ? h : { default: h };
|
|
1669
1669
|
}
|
|
1670
|
-
function
|
|
1670
|
+
function k(h, p) {
|
|
1671
1671
|
if (!(h instanceof p))
|
|
1672
1672
|
throw new TypeError("Cannot call a class as a function");
|
|
1673
1673
|
}
|
|
@@ -1677,21 +1677,21 @@ function kt() {
|
|
|
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
|
|
1680
|
+
function I(h, p, A) {
|
|
1681
1681
|
return p && T(h.prototype, p), h;
|
|
1682
1682
|
}
|
|
1683
|
-
function
|
|
1683
|
+
function w(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 && B(h, p);
|
|
1687
1687
|
}
|
|
1688
|
-
function
|
|
1689
|
-
return
|
|
1688
|
+
function B(h, p) {
|
|
1689
|
+
return B = Object.setPrototypeOf || function(n, r) {
|
|
1690
1690
|
return n.__proto__ = r, n;
|
|
1691
|
-
},
|
|
1691
|
+
}, B(h, p);
|
|
1692
1692
|
}
|
|
1693
|
-
function
|
|
1694
|
-
var p =
|
|
1693
|
+
function v(h) {
|
|
1694
|
+
var p = F();
|
|
1695
1695
|
return function() {
|
|
1696
1696
|
var n = N(h), r;
|
|
1697
1697
|
if (p) {
|
|
@@ -1714,7 +1714,7 @@ function kt() {
|
|
|
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 F() {
|
|
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 kt() {
|
|
|
1729
1729
|
return A.__proto__ || Object.getPrototypeOf(A);
|
|
1730
1730
|
}, N(h);
|
|
1731
1731
|
}
|
|
1732
|
-
var q = 0,
|
|
1733
|
-
|
|
1734
|
-
var p =
|
|
1732
|
+
var q = 0, J = 1, x = 2, M = 3, m = 4, g = /* @__PURE__ */ (function(h) {
|
|
1733
|
+
w(A, h);
|
|
1734
|
+
var p = v(A);
|
|
1735
1735
|
function A(n, r, c) {
|
|
1736
1736
|
var d;
|
|
1737
|
-
return
|
|
1737
|
+
return k(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 I(A, [{
|
|
1742
1742
|
key: "_nextPromiseId",
|
|
1743
1743
|
value: function() {
|
|
1744
1744
|
return ++this._promiseId;
|
|
@@ -1775,8 +1775,8 @@ function kt() {
|
|
|
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++) {
|
|
1778
|
-
var
|
|
1779
|
-
|
|
1778
|
+
var E = c[d];
|
|
1779
|
+
E in r && this.on(E, r[E]);
|
|
1780
1780
|
}
|
|
1781
1781
|
}
|
|
1782
1782
|
}
|
|
@@ -1793,7 +1793,7 @@ function kt() {
|
|
|
1793
1793
|
}, {
|
|
1794
1794
|
key: "_isSubscribing",
|
|
1795
1795
|
value: function() {
|
|
1796
|
-
return this._status ===
|
|
1796
|
+
return this._status === J;
|
|
1797
1797
|
}
|
|
1798
1798
|
}, {
|
|
1799
1799
|
key: "_isReady",
|
|
@@ -1818,7 +1818,7 @@ function kt() {
|
|
|
1818
1818
|
}, {
|
|
1819
1819
|
key: "_setSubscribing",
|
|
1820
1820
|
value: function(r) {
|
|
1821
|
-
this._isResubscribe = r || !1, this._ready === !0 && this._initializePromise(), this._status =
|
|
1821
|
+
this._isResubscribe = r || !1, this._ready === !0 && this._initializePromise(), this._status = J;
|
|
1822
1822
|
}
|
|
1823
1823
|
}, {
|
|
1824
1824
|
key: "_setSubscribeSuccess",
|
|
@@ -1906,14 +1906,14 @@ function kt() {
|
|
|
1906
1906
|
if (this._isError())
|
|
1907
1907
|
return Promise.reject(this._error);
|
|
1908
1908
|
var c = new Promise(function(d, y) {
|
|
1909
|
-
var
|
|
1909
|
+
var E = setTimeout(function() {
|
|
1910
1910
|
y({
|
|
1911
1911
|
code: 0,
|
|
1912
1912
|
message: "timeout"
|
|
1913
1913
|
});
|
|
1914
1914
|
}, r._centrifuge._config.timeout);
|
|
1915
1915
|
r._promises[r._nextPromiseId()] = {
|
|
1916
|
-
timeout:
|
|
1916
|
+
timeout: E,
|
|
1917
1917
|
resolve: d,
|
|
1918
1918
|
reject: y
|
|
1919
1919
|
};
|
|
@@ -1953,7 +1953,7 @@ function kt() {
|
|
|
1953
1953
|
});
|
|
1954
1954
|
}
|
|
1955
1955
|
}]), A;
|
|
1956
|
-
})(
|
|
1956
|
+
})(P.default);
|
|
1957
1957
|
l.default = g, a.exports = l.default;
|
|
1958
1958
|
})
|
|
1959
1959
|
),
|
|
@@ -1963,30 +1963,30 @@ function kt() {
|
|
|
1963
1963
|
(function(a, l, f) {
|
|
1964
1964
|
Object.defineProperty(l, "__esModule", {
|
|
1965
1965
|
value: !0
|
|
1966
|
-
}), l.backoff =
|
|
1967
|
-
function C(
|
|
1968
|
-
return
|
|
1966
|
+
}), l.backoff = b, l.errorExists = k, l.extend = T, l.isFunction = P, l.log = _, l.startsWith = C;
|
|
1967
|
+
function C(I, w) {
|
|
1968
|
+
return I.lastIndexOf(w, 0) === 0;
|
|
1969
1969
|
}
|
|
1970
|
-
function
|
|
1971
|
-
return
|
|
1970
|
+
function P(I) {
|
|
1971
|
+
return I == null ? !1 : typeof I == "function";
|
|
1972
1972
|
}
|
|
1973
|
-
function _(
|
|
1973
|
+
function _(I, w) {
|
|
1974
1974
|
if (f.g.console) {
|
|
1975
|
-
var
|
|
1976
|
-
|
|
1975
|
+
var B = f.g.console[I];
|
|
1976
|
+
P(B) && B.apply(f.g.console, w);
|
|
1977
1977
|
}
|
|
1978
1978
|
}
|
|
1979
|
-
function
|
|
1980
|
-
var
|
|
1981
|
-
return Math.floor((1 -
|
|
1979
|
+
function b(I, w, B) {
|
|
1980
|
+
var v = 0.5 * Math.random(), L = Math.min(B, w * Math.pow(2, I + 1));
|
|
1981
|
+
return Math.floor((1 - v) * L);
|
|
1982
1982
|
}
|
|
1983
|
-
function
|
|
1984
|
-
return "error" in
|
|
1983
|
+
function k(I) {
|
|
1984
|
+
return "error" in I && I.error !== null;
|
|
1985
1985
|
}
|
|
1986
|
-
function T(
|
|
1987
|
-
for (var
|
|
1988
|
-
|
|
1989
|
-
return
|
|
1986
|
+
function T(I, w) {
|
|
1987
|
+
for (var B in w)
|
|
1988
|
+
w.hasOwnProperty(B) && (I[B] = w[B]);
|
|
1989
|
+
return I;
|
|
1990
1990
|
}
|
|
1991
1991
|
})
|
|
1992
1992
|
),
|
|
@@ -2002,44 +2002,44 @@ function kt() {
|
|
|
2002
2002
|
} : C = function(g) {
|
|
2003
2003
|
return Object.getOwnPropertyNames(g);
|
|
2004
2004
|
};
|
|
2005
|
-
function
|
|
2005
|
+
function P(m) {
|
|
2006
2006
|
console && console.warn && console.warn(m);
|
|
2007
2007
|
}
|
|
2008
2008
|
var _ = Number.isNaN || function(g) {
|
|
2009
2009
|
return g !== g;
|
|
2010
2010
|
};
|
|
2011
|
-
function
|
|
2012
|
-
|
|
2011
|
+
function b() {
|
|
2012
|
+
b.init.call(this);
|
|
2013
2013
|
}
|
|
2014
|
-
a.exports =
|
|
2015
|
-
var
|
|
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
|
+
var k = 10;
|
|
2016
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
|
}
|
|
2020
|
-
Object.defineProperty(
|
|
2020
|
+
Object.defineProperty(b, "defaultMaxListeners", {
|
|
2021
2021
|
enumerable: !0,
|
|
2022
2022
|
get: function() {
|
|
2023
|
-
return
|
|
2023
|
+
return k;
|
|
2024
2024
|
},
|
|
2025
2025
|
set: function(m) {
|
|
2026
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
|
+
k = 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
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
|
|
2038
|
-
return m._maxListeners === void 0 ?
|
|
2037
|
+
function I(m) {
|
|
2038
|
+
return m._maxListeners === void 0 ? b.defaultMaxListeners : m._maxListeners;
|
|
2039
2039
|
}
|
|
2040
|
-
|
|
2041
|
-
return
|
|
2042
|
-
},
|
|
2040
|
+
b.prototype.getMaxListeners = function() {
|
|
2041
|
+
return I(this);
|
|
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;
|
|
2045
2045
|
if (n !== void 0)
|
|
@@ -2059,11 +2059,11 @@ function kt() {
|
|
|
2059
2059
|
if (typeof d == "function")
|
|
2060
2060
|
f(d, this, h);
|
|
2061
2061
|
else
|
|
2062
|
-
for (var y = d.length,
|
|
2063
|
-
f(
|
|
2062
|
+
for (var y = d.length, E = F(d, y), p = 0; p < y; ++p)
|
|
2063
|
+
f(E[p], this, h);
|
|
2064
2064
|
return !0;
|
|
2065
2065
|
};
|
|
2066
|
-
function
|
|
2066
|
+
function w(m, g, h, p) {
|
|
2067
2067
|
var A, n, r;
|
|
2068
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",
|
|
@@ -2071,31 +2071,31 @@ function kt() {
|
|
|
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 = I(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, P(c);
|
|
2078
2078
|
}
|
|
2079
2079
|
return m;
|
|
2080
2080
|
}
|
|
2081
|
-
|
|
2082
|
-
return
|
|
2083
|
-
},
|
|
2084
|
-
return
|
|
2081
|
+
b.prototype.addListener = function(g, h) {
|
|
2082
|
+
return w(this, g, h, !1);
|
|
2083
|
+
}, b.prototype.on = b.prototype.addListener, b.prototype.prependListener = function(g, h) {
|
|
2084
|
+
return w(this, g, h, !0);
|
|
2085
2085
|
};
|
|
2086
|
-
function
|
|
2086
|
+
function B() {
|
|
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 v(m, g, h) {
|
|
2091
|
+
var p = { fired: !1, wrapFn: void 0, target: m, type: g, listener: h }, A = B.bind(p);
|
|
2092
2092
|
return A.listener = h, p.wrapFn = A, A;
|
|
2093
2093
|
}
|
|
2094
|
-
|
|
2095
|
-
return T(h), this.on(g,
|
|
2096
|
-
},
|
|
2097
|
-
return T(h), this.prependListener(g,
|
|
2098
|
-
},
|
|
2094
|
+
b.prototype.once = function(g, h) {
|
|
2095
|
+
return T(h), this.on(g, v(this, g, h)), this;
|
|
2096
|
+
}, b.prototype.prependOnceListener = function(g, h) {
|
|
2097
|
+
return T(h), this.prependListener(g, v(this, g, h)), this;
|
|
2098
|
+
}, b.prototype.removeListener = function(g, h) {
|
|
2099
2099
|
var p, A, n, r, c;
|
|
2100
2100
|
if (T(h), A = this._events, A === void 0)
|
|
2101
2101
|
return this;
|
|
@@ -2114,7 +2114,7 @@ function kt() {
|
|
|
2114
2114
|
n === 0 ? p.shift() : N(p, n), p.length === 1 && (A[g] = p[0]), A.removeListener !== void 0 && this.emit("removeListener", g, c || h);
|
|
2115
2115
|
}
|
|
2116
2116
|
return this;
|
|
2117
|
-
},
|
|
2117
|
+
}, b.prototype.off = b.prototype.removeListener, b.prototype.removeAllListeners = function(g) {
|
|
2118
2118
|
var h, p, A;
|
|
2119
2119
|
if (p = this._events, p === void 0)
|
|
2120
2120
|
return this;
|
|
@@ -2138,15 +2138,15 @@ function kt() {
|
|
|
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) : F(A, A.length);
|
|
2142
2142
|
}
|
|
2143
|
-
|
|
2143
|
+
b.prototype.listeners = function(g) {
|
|
2144
2144
|
return L(this, g, !0);
|
|
2145
|
-
},
|
|
2145
|
+
}, b.prototype.rawListeners = function(g) {
|
|
2146
2146
|
return L(this, g, !1);
|
|
2147
|
-
},
|
|
2147
|
+
}, b.listenerCount = function(m, g) {
|
|
2148
2148
|
return typeof m.listenerCount == "function" ? m.listenerCount(g) : O.call(m, g);
|
|
2149
|
-
},
|
|
2149
|
+
}, b.prototype.listenerCount = O;
|
|
2150
2150
|
function O(m) {
|
|
2151
2151
|
var g = this._events;
|
|
2152
2152
|
if (g !== void 0) {
|
|
@@ -2158,10 +2158,10 @@ function kt() {
|
|
|
2158
2158
|
}
|
|
2159
2159
|
return 0;
|
|
2160
2160
|
}
|
|
2161
|
-
|
|
2161
|
+
b.prototype.eventNames = function() {
|
|
2162
2162
|
return this._eventsCount > 0 ? C(this._events) : [];
|
|
2163
2163
|
};
|
|
2164
|
-
function
|
|
2164
|
+
function F(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;
|
|
@@ -2176,7 +2176,7 @@ function kt() {
|
|
|
2176
2176
|
g[h] = m[h].listener || m[h];
|
|
2177
2177
|
return g;
|
|
2178
2178
|
}
|
|
2179
|
-
function
|
|
2179
|
+
function J(m, g) {
|
|
2180
2180
|
return new Promise(function(h, p) {
|
|
2181
2181
|
function A(r) {
|
|
2182
2182
|
m.removeListener(g, n), p(r);
|
|
@@ -2239,7 +2239,7 @@ function kt() {
|
|
|
2239
2239
|
var wt = kt();
|
|
2240
2240
|
const _t = /* @__PURE__ */ St(wt);
|
|
2241
2241
|
let he = null;
|
|
2242
|
-
function
|
|
2242
|
+
function Ge(e, t) {
|
|
2243
2243
|
if (!(e != null && e.client_url) || !(e != null && e.token) || !(e != null && e.channel))
|
|
2244
2244
|
return console.error("[Centrifuge] Invalid socket_connections"), null;
|
|
2245
2245
|
const { client_url: o, token: i, channel: s } = e;
|
|
@@ -2279,7 +2279,7 @@ function Tt(e) {
|
|
|
2279
2279
|
function ge(e) {
|
|
2280
2280
|
return /^4[0-9]/.test(e) ? "visa" : /^5[1-5]/.test(e) || /^2[2-7]/.test(e) ? "mastercard" : "card";
|
|
2281
2281
|
}
|
|
2282
|
-
const
|
|
2282
|
+
const ee = {
|
|
2283
2283
|
iconType: "kaspi_pay",
|
|
2284
2284
|
label: "Kaspi.kz",
|
|
2285
2285
|
type: "kaspi_pay"
|
|
@@ -2295,7 +2295,7 @@ const $ = {
|
|
|
2295
2295
|
function K(e) {
|
|
2296
2296
|
return e === "enabled" || e === !0;
|
|
2297
2297
|
}
|
|
2298
|
-
function
|
|
2298
|
+
function Ze(e) {
|
|
2299
2299
|
if (!e) return null;
|
|
2300
2300
|
let t = String(e).trim().toLowerCase();
|
|
2301
2301
|
return t.startsWith("payment_method_") && (t = t.replace("payment_method_", "")), t === "kaspi" ? "kaspi_pay" : t === "apple" ? "apple_pay" : t === "google" ? "google_pay" : t === "newcard" ? "new_card" : t === "card" ? "card" : ["kaspi_pay", "apple_pay", "google_pay", "new_card"].includes(t) ? t : null;
|
|
@@ -2305,18 +2305,18 @@ function Lt(e) {
|
|
|
2305
2305
|
const t = e, o = ((u = t == null ? void 0 : t.context) == null ? void 0 : u.last_payment_method) ?? (t == null ? void 0 : t.last_payment_method) ?? ((a = t == null ? void 0 : t.attributes) == null ? void 0 : a.last_payment_method);
|
|
2306
2306
|
if (!o) return null;
|
|
2307
2307
|
if (typeof o == "string")
|
|
2308
|
-
return { type:
|
|
2308
|
+
return { type: Ze(o), cardId: null };
|
|
2309
2309
|
if (typeof o != "object") return null;
|
|
2310
2310
|
const i = o.type ?? o.payment_method ?? o.method, s = o.card_id ?? o.cardId ?? o.id ?? ((l = o.card) == null ? void 0 : l.id) ?? null;
|
|
2311
2311
|
return {
|
|
2312
|
-
type:
|
|
2312
|
+
type: Ze(i),
|
|
2313
2313
|
cardId: s != null ? String(s) : null
|
|
2314
2314
|
};
|
|
2315
2315
|
}
|
|
2316
2316
|
function Rt(e, t, o = {}) {
|
|
2317
|
-
var
|
|
2318
|
-
const i = [], s = (
|
|
2319
|
-
return s != null && s.isKaspiOnly && l && !
|
|
2317
|
+
var w, B, v, L;
|
|
2318
|
+
const i = [], s = (w = e == null ? void 0 : e.kaspi) == null ? void 0 : w.data, u = ((B = e == null ? void 0 : e.cards_v2) == null ? void 0 : B.data) || [], a = ((L = (v = e == null ? void 0 : e.payment_methods) == null ? void 0 : v.data) == null ? void 0 : L.attributes) || {}, l = K(a.payment_method_kaspi), f = K(a.payment_method_card), C = typeof window < "u" && window.self === window.top, _ = Xe() === "ios", b = !!(o != null && o.onlyKaspiAvailable), k = !!(o != null && o.disableKaspi);
|
|
2319
|
+
return s != null && s.isKaspiOnly && l && !k ? [ee] : b ? s != null && s.isAvailable && l && !k ? [ee] : [] : (K(a.payment_method_apple_pay) && !me("apple_pay") && (Ce() && C || ye() || _ || ot() === 16) && i.push(st), s != null && s.isAvailable && l && !k && i.push(ee), f && u.filter((O) => !O.isExpired).forEach((O) => {
|
|
2320
2320
|
i.push({
|
|
2321
2321
|
iconType: ge(O.attributes.mask),
|
|
2322
2322
|
type: "card",
|
|
@@ -2331,20 +2331,20 @@ function Rt(e, t, o = {}) {
|
|
|
2331
2331
|
label: t ? t("newCard") : "Оплата новой картой"
|
|
2332
2332
|
}), i);
|
|
2333
2333
|
}
|
|
2334
|
-
function
|
|
2335
|
-
var
|
|
2336
|
-
const o = (
|
|
2334
|
+
function Re(e, t = {}) {
|
|
2335
|
+
var I, w, B, v;
|
|
2336
|
+
const o = (I = e == null ? void 0 : e.kaspi) == null ? void 0 : I.data, i = ((w = e == null ? void 0 : e.cards_v2) == null ? void 0 : w.data) || [], s = ((v = (B = e == null ? void 0 : e.payment_methods) == null ? void 0 : B.data) == null ? void 0 : v.attributes) || {}, u = K(s.payment_method_kaspi), a = K(s.payment_method_card), l = !!(t != null && t.disableKaspi), f = typeof window < "u" && window.self === window.top, P = Xe() === "ios", _ = K(s.payment_method_apple_pay) && !me("apple_pay") && (Ce() && f || ye() || P || ot() === 16), b = K(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
|
-
return
|
|
2339
|
-
const
|
|
2340
|
-
if ((
|
|
2341
|
-
return
|
|
2342
|
-
if ((
|
|
2343
|
-
if ((
|
|
2344
|
-
if ((
|
|
2338
|
+
return ee;
|
|
2339
|
+
const k = Lt(e);
|
|
2340
|
+
if ((k == null ? void 0 : k.type) === "kaspi_pay" && (o != null && o.isAvailable) && u && !l)
|
|
2341
|
+
return ee;
|
|
2342
|
+
if ((k == null ? void 0 : k.type) === "apple_pay" && _) return st;
|
|
2343
|
+
if ((k == null ? void 0 : k.type) === "google_pay" && b) return it;
|
|
2344
|
+
if ((k == null ? void 0 : k.type) === "new_card" && K(s.payment_method_new_card))
|
|
2345
2345
|
return { iconType: "new_card", type: "new_card", label: "Оплата новой картой" };
|
|
2346
|
-
if ((
|
|
2347
|
-
const L =
|
|
2346
|
+
if ((k == null ? void 0 : k.type) === "card" && a) {
|
|
2347
|
+
const L = k.cardId != null ? i.find((O) => !O.isExpired && String(O.id) === k.cardId) : null;
|
|
2348
2348
|
if (L)
|
|
2349
2349
|
return {
|
|
2350
2350
|
iconType: ge(L.attributes.mask),
|
|
@@ -2356,8 +2356,8 @@ function Le(e, t = {}) {
|
|
|
2356
2356
|
}
|
|
2357
2357
|
if (a) {
|
|
2358
2358
|
const L = i.find((O) => {
|
|
2359
|
-
var
|
|
2360
|
-
return ((
|
|
2359
|
+
var F;
|
|
2360
|
+
return ((F = O.attributes) == null ? void 0 : F.isDefault) && !O.isExpired;
|
|
2361
2361
|
});
|
|
2362
2362
|
if (L)
|
|
2363
2363
|
return {
|
|
@@ -2368,7 +2368,7 @@ function Le(e, t = {}) {
|
|
|
2368
2368
|
cardType: L.type
|
|
2369
2369
|
};
|
|
2370
2370
|
}
|
|
2371
|
-
if (o != null && o.isAvailable && u && !l) return
|
|
2371
|
+
if (o != null && o.isAvailable && u && !l) return ee;
|
|
2372
2372
|
const T = a ? i.find((L) => !L.isExpired) : null;
|
|
2373
2373
|
return T ? {
|
|
2374
2374
|
iconType: ge(T.attributes.mask),
|
|
@@ -2386,7 +2386,7 @@ function at(e) {
|
|
|
2386
2386
|
return null;
|
|
2387
2387
|
}
|
|
2388
2388
|
}
|
|
2389
|
-
function
|
|
2389
|
+
function Oe(e, t) {
|
|
2390
2390
|
if (!(typeof localStorage > "u"))
|
|
2391
2391
|
try {
|
|
2392
2392
|
localStorage.setItem(e, t);
|
|
@@ -2409,7 +2409,7 @@ async function Ot(e, t) {
|
|
|
2409
2409
|
return `HTTP ${e.status}: ${e.statusText}`;
|
|
2410
2410
|
}
|
|
2411
2411
|
}
|
|
2412
|
-
async function
|
|
2412
|
+
async function Z(e, t) {
|
|
2413
2413
|
const o = await Ot(e, t);
|
|
2414
2414
|
throw Object.assign(new Error(o), { status: e.status });
|
|
2415
2415
|
}
|
|
@@ -2449,10 +2449,10 @@ async function Se(e, t, o, i, s) {
|
|
|
2449
2449
|
},
|
|
2450
2450
|
body: JSON.stringify(i)
|
|
2451
2451
|
});
|
|
2452
|
-
return u.ok || await
|
|
2452
|
+
return u.ok || await Z(u, s), u.json();
|
|
2453
2453
|
}
|
|
2454
2454
|
async function Mt(e, t, o) {
|
|
2455
|
-
var l, f, C,
|
|
2455
|
+
var l, f, C, P;
|
|
2456
2456
|
const i = await fetch(`${e}/api/v2/oauth2/tokens`, {
|
|
2457
2457
|
method: "POST",
|
|
2458
2458
|
headers: {
|
|
@@ -2466,13 +2466,13 @@ async function Mt(e, t, o) {
|
|
|
2466
2466
|
track_id: o
|
|
2467
2467
|
})
|
|
2468
2468
|
});
|
|
2469
|
-
i.ok || await
|
|
2470
|
-
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) ?? ((
|
|
2469
|
+
i.ok || await Z(i, "Не удалось авторизоваться через track_id");
|
|
2470
|
+
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) ?? ((P = (C = s == null ? void 0 : s.data) == null ? void 0 : C.attributes) == null ? void 0 : P.refresh_token) ?? null;
|
|
2471
2471
|
if (!u) throw new Error("В ответе отсутствует access_token");
|
|
2472
2472
|
return { access_token: u, refresh_token: a };
|
|
2473
2473
|
}
|
|
2474
2474
|
async function Nt(e, t, o) {
|
|
2475
|
-
var l, f, C,
|
|
2475
|
+
var l, f, C, P;
|
|
2476
2476
|
const i = await fetch(`${e}/api/v2/oauth2/tokens`, {
|
|
2477
2477
|
method: "POST",
|
|
2478
2478
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2482,12 +2482,12 @@ async function Nt(e, t, o) {
|
|
|
2482
2482
|
refresh_token: o
|
|
2483
2483
|
})
|
|
2484
2484
|
});
|
|
2485
|
-
i.ok || await
|
|
2486
|
-
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) ?? ((
|
|
2485
|
+
i.ok || await Z(i, "Не удалось обновить токен по refresh_token");
|
|
2486
|
+
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) ?? ((P = (C = s == null ? void 0 : s.data) == null ? void 0 : C.attributes) == null ? void 0 : P.refresh_token) ?? null;
|
|
2487
2487
|
if (!u) throw new Error("В ответе отсутствует access_token");
|
|
2488
2488
|
return { access_token: u, refresh_token: a };
|
|
2489
2489
|
}
|
|
2490
|
-
async function
|
|
2490
|
+
async function Me(e, t) {
|
|
2491
2491
|
const o = await fetch(`${e}/orders/v1/checkout/context`, {
|
|
2492
2492
|
method: "POST",
|
|
2493
2493
|
headers: {
|
|
@@ -2504,7 +2504,7 @@ async function Oe(e, t) {
|
|
|
2504
2504
|
}
|
|
2505
2505
|
})
|
|
2506
2506
|
});
|
|
2507
|
-
return o.ok || await
|
|
2507
|
+
return o.ok || await Z(o, "Ошибка получения контекста оплаты"), o.json();
|
|
2508
2508
|
}
|
|
2509
2509
|
async function Dt(e, t, o) {
|
|
2510
2510
|
const i = await fetch(`${e}/payment-gateway/v1/cards/${o}`, {
|
|
@@ -2514,7 +2514,7 @@ async function Dt(e, t, o) {
|
|
|
2514
2514
|
Authorization: `Bearer ${t.accessToken}`
|
|
2515
2515
|
}
|
|
2516
2516
|
});
|
|
2517
|
-
return i.ok || await
|
|
2517
|
+
return i.ok || await Z(i, "Не удалось удалить карту"), i.json().catch(() => ({}));
|
|
2518
2518
|
}
|
|
2519
2519
|
async function Xt(e, t, o) {
|
|
2520
2520
|
const i = await fetch(
|
|
@@ -2527,7 +2527,7 @@ async function Xt(e, t, o) {
|
|
|
2527
2527
|
}
|
|
2528
2528
|
}
|
|
2529
2529
|
);
|
|
2530
|
-
return i.ok || await
|
|
2530
|
+
return i.ok || await Z(i, "Не удалось отметить карту как основную"), i.json().catch(() => ({}));
|
|
2531
2531
|
}
|
|
2532
2532
|
async function Ut(e, t, o) {
|
|
2533
2533
|
const i = await fetch(`${e}/orders/v1/orders/${o}/status`, {
|
|
@@ -2545,7 +2545,7 @@ async function Ut(e, t, o) {
|
|
|
2545
2545
|
const s = await i.json(), u = (s == null ? void 0 : s.data) ?? s;
|
|
2546
2546
|
return { data: { status: u == null ? void 0 : u.status, payload: (u == null ? void 0 : u.payload) ?? {} } };
|
|
2547
2547
|
}
|
|
2548
|
-
async function
|
|
2548
|
+
async function $e(e, t, o, i, s = {}) {
|
|
2549
2549
|
const { checkoutAmount: u, checkoutPaymentMethod: a, useBalanceFlag: l, voucher: f } = Ie(
|
|
2550
2550
|
t,
|
|
2551
2551
|
{
|
|
@@ -2587,7 +2587,7 @@ async function xt(e, t) {
|
|
|
2587
2587
|
}
|
|
2588
2588
|
}
|
|
2589
2589
|
);
|
|
2590
|
-
return o.ok || await
|
|
2590
|
+
return o.ok || await Z(o, "Ошибка получения купонов"), o.json();
|
|
2591
2591
|
}
|
|
2592
2592
|
async function Ft(e, t, o) {
|
|
2593
2593
|
const i = window.location.hostname, s = await fetch(`${e}/payment-gateway/v1/apple/session`, {
|
|
@@ -2599,7 +2599,7 @@ async function Ft(e, t, o) {
|
|
|
2599
2599
|
},
|
|
2600
2600
|
body: JSON.stringify({ validationUrl: o, domainName: i })
|
|
2601
2601
|
});
|
|
2602
|
-
return s.ok || await
|
|
2602
|
+
return s.ok || await Z(s, "Ошибка получения Apple Pay сессии"), s.json();
|
|
2603
2603
|
}
|
|
2604
2604
|
async function Jt(e, t, o, i, s = {}) {
|
|
2605
2605
|
const { checkoutAmount: u, checkoutPaymentMethod: a, useBalanceFlag: l, voucher: f } = Ie(
|
|
@@ -2671,10 +2671,10 @@ function qt(e) {
|
|
|
2671
2671
|
bonuses: s
|
|
2672
2672
|
};
|
|
2673
2673
|
}
|
|
2674
|
-
function
|
|
2675
|
-
|
|
2674
|
+
function Ne(e, t) {
|
|
2675
|
+
Oe("webPayToken", e), t && Oe("webPayRefreshToken", t);
|
|
2676
2676
|
}
|
|
2677
|
-
function
|
|
2677
|
+
function et() {
|
|
2678
2678
|
be("webPayToken"), be("webPayRefreshToken");
|
|
2679
2679
|
}
|
|
2680
2680
|
async function jt(e) {
|
|
@@ -2686,7 +2686,7 @@ async function jt(e) {
|
|
|
2686
2686
|
e.config.clientId,
|
|
2687
2687
|
t
|
|
2688
2688
|
);
|
|
2689
|
-
|
|
2689
|
+
Ne(i.access_token, i.refresh_token), e.accessToken = i.access_token;
|
|
2690
2690
|
return;
|
|
2691
2691
|
} catch {
|
|
2692
2692
|
be("webPayRefreshToken");
|
|
@@ -2700,7 +2700,7 @@ async function jt(e) {
|
|
|
2700
2700
|
e.config.clientId,
|
|
2701
2701
|
e.config.trackId
|
|
2702
2702
|
);
|
|
2703
|
-
|
|
2703
|
+
Ne(o.access_token, o.refresh_token), e.accessToken = o.access_token;
|
|
2704
2704
|
}
|
|
2705
2705
|
const zt = `<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2706
2706
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.89711 8.50443C10.4185 8.72365 10.6242 9.56386 10.7471 10.3459L10.7816 10.5699L10.8557 11.0301C11.0006 11.9088 11.303 13.7327 11.303 14.6845C11.303 14.9224 11.2806 15.105 11.2396 15.2053C11.1713 15.3599 10.9724 15.5082 10.6978 15.6319C10.0332 15.7846 9.33863 15.8671 8.62315 15.8671C8.54739 15.8671 8.47285 15.8637 8.39805 15.8616C8.10889 15.785 7.89156 15.657 7.77649 15.4821C7.42905 14.9542 7.40812 13.7781 7.40116 12.4037L7.40037 12.2443L7.39755 11.8324C7.38623 10.3774 7.37651 9.1229 7.94288 8.67272C8.16223 8.49957 8.47392 8.44225 8.89711 8.50443ZM5.58009 11.6722C5.90978 11.6548 6.12181 13.1684 6.16441 14.3162C6.19427 15.1152 6.10438 15.4439 5.96084 15.5619C5.79833 15.5113 5.63864 15.4565 5.48128 15.397C5.3763 15.219 5.29607 14.9389 5.2451 14.5721C5.08947 13.4193 5.22466 11.6925 5.58009 11.6722ZM13.8455 13.934C13.825 14.0391 13.796 14.1204 13.7602 14.1889C13.4783 14.4 13.1821 14.5938 12.872 14.7682C12.7733 14.7837 12.6856 14.7729 12.6427 14.7053C12.2318 14.0314 12.0775 11.9173 12.4752 11.7333C12.9936 11.4995 13.9224 13.5685 13.8455 13.934ZM8.50042 0C13.1296 0 16.8941 3.42166 16.9979 7.67934L17 7.82651V7.89454C16.9915 9.81778 16.2332 11.5773 14.9839 12.9392C14.9386 12.918 14.8559 12.8486 14.7062 12.6395C14.5512 12.4293 13.2148 10.5096 13.2148 8.30946C13.2148 7.87768 13.8816 7.20318 14.4717 6.61114C14.9128 6.16562 15.3306 5.74539 15.4845 5.4151C15.6804 4.98892 15.5433 4.69134 15.3265 4.59047C15.1302 4.50082 14.8355 4.56621 14.6287 4.90904C14.2893 5.46389 14.1805 5.56758 13.6855 5.93882C13.1984 6.30986 12.424 6.68338 12.424 6.19988C12.424 5.93882 12.8553 5.34757 13.0684 4.93314C13.286 4.51408 13.0515 4.21072 12.6022 4.21072C11.7198 4.21072 11.1341 5.2598 11.1341 5.62326C11.1341 5.98642 11.3229 6.03813 11.3229 6.46104C11.3229 6.88713 10.3548 7.4398 9.44281 7.4398C8.56481 7.4398 8.05566 7.27394 7.8447 6.80665L7.81777 6.74105L7.75678 6.57266C7.54046 5.98255 7.38528 5.55458 7.11514 5.10733C6.9717 4.87081 6.75038 4.70684 6.55897 4.56257C6.30881 4.38121 6.17902 4.21421 6.15193 4.08967C6.12696 3.96611 6.11352 3.73326 6.54117 3.19648C6.96793 2.66277 7.02775 2.25958 6.81418 2.05153C6.73678 1.97752 6.60482 1.93011 6.43535 1.93011C6.13562 1.93011 5.71912 2.07834 5.2899 2.48551C4.62267 3.12364 5.00146 3.72951 5.00146 3.99548C5.00146 4.26127 4.87922 4.41162 4.47882 4.77323C4.07547 5.13644 3.93627 5.44783 3.89014 6.69935C3.87247 7.3442 3.75079 7.71539 3.64156 8.04453C3.54718 8.33302 3.46038 8.60425 3.45569 8.99611C3.44822 9.43038 3.52566 9.71023 3.61604 10.0331C3.70477 10.3316 3.79902 10.6736 3.8594 11.2456C3.95544 12.1312 3.92205 12.8792 3.74744 13.6437L3.70084 13.8353L3.68995 13.8903C3.65419 14.0247 3.61168 14.1879 3.55423 14.249C1.4029 12.8228 0 10.4936 0 7.86072C0 3.51974 3.80561 0 8.50042 0Z" fill="#F14635"/>
|
|
@@ -2771,7 +2771,7 @@ function $t(e) {
|
|
|
2771
2771
|
const t = e == null ? void 0 : e.toLowerCase();
|
|
2772
2772
|
return t && Zt[t] || "";
|
|
2773
2773
|
}
|
|
2774
|
-
const
|
|
2774
|
+
const Ue = `<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2775
2775
|
<path d="M19.7045 10.7313C15.0567 10.7313 11.2687 6.94328 11.2687 2.26866C11.2687 2.10746 11.1612 2 11 2C10.8388 2 10.7313 2.10746 10.7313 2.26866C10.7313 6.94328 6.94328 10.7313 2.26866 10.7313C2.10746 10.7313 2 10.8388 2 11C2 11.1612 2.10746 11.2687 2.26866 11.2687C6.94328 11.2687 10.7313 15.0567 10.7313 19.7313C10.7313 19.8925 10.8388 20 11 20C11.1612 20 11.2687 19.8925 11.2687 19.7313C11.2687 15.0567 15.0567 11.2687 19.7313 11.2687C19.8925 11.2687 20 11.1612 20 11C20 10.8388 19.8657 10.7313 19.7045 10.7313Z" fill="#2F2F2F"/>
|
|
2776
2776
|
</svg>
|
|
2777
2777
|
`, en = '<svg class="choco-widget-method-item-trash" width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4.16663 5.83317H15.8333" stroke="#CC3434" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M15 5.8335V15.0002C15 15.921 14.2542 16.6668 13.3333 16.6668H6.66667C5.74583 16.6668 5 15.921 5 15.0002V5.8335" stroke="#CC3434" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M12.5 3.12516H7.5" stroke="#CC3434" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M8.33329 9.1665V13.3332" stroke="#CC3434" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M11.6667 9.1665V13.3332" stroke="#CC3434" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>', tn = '<svg class="choco-widget-method-item-check" width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M13.3333 4.3335L5.99996 11.6668L2.66663 8.3335" stroke="#242424" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>';
|
|
@@ -2828,7 +2828,7 @@ function nn(e, t, o, i) {
|
|
|
2828
2828
|
</div>
|
|
2829
2829
|
<div class="choco-widget-balance-label-wrapper">
|
|
2830
2830
|
<div class="choco-widget-balance-icon">
|
|
2831
|
-
${
|
|
2831
|
+
${Ue}
|
|
2832
2832
|
</div>
|
|
2833
2833
|
<div class="choco-widget-balance-amount">${s ? V(e.amount, "ru", i) : 0}</div>
|
|
2834
2834
|
<label class="choco-widget-toggle">
|
|
@@ -2839,43 +2839,43 @@ function nn(e, t, o, i) {
|
|
|
2839
2839
|
</div>
|
|
2840
2840
|
`;
|
|
2841
2841
|
}
|
|
2842
|
-
function rn(e, t, o, i) {
|
|
2842
|
+
function rn(e, t, o, i, s) {
|
|
2843
2843
|
if (!e) return "";
|
|
2844
|
-
const
|
|
2844
|
+
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 ? V(f, "ru", s) : null;
|
|
2845
2845
|
return `
|
|
2846
|
-
<div class="choco-widget-balance-toggle" data-action="toggle-coupon">
|
|
2846
|
+
<div class="choco-widget-balance-toggle${o ? " choco-widget-balance-toggle--disabled" : ""}" data-action="toggle-coupon">
|
|
2847
2847
|
<div class="choco-widget-balance-info">
|
|
2848
2848
|
<div class="choco-widget-balance-text">
|
|
2849
|
-
<div class="choco-widget-balance-label">${
|
|
2849
|
+
<div class="choco-widget-balance-label">${i("coupon")}${l ? ` <span style="color:#767485">(${l})</span>` : ""}</div>
|
|
2850
2850
|
</div>
|
|
2851
2851
|
</div>
|
|
2852
2852
|
<div class="choco-widget-balance-label-wrapper">
|
|
2853
|
-
${
|
|
2853
|
+
${C ? `
|
|
2854
2854
|
<div class="choco-widget-balance-icon">
|
|
2855
|
-
${
|
|
2855
|
+
${Ue}
|
|
2856
2856
|
</div>
|
|
2857
|
-
<div class="choco-widget-balance-amount">${
|
|
2857
|
+
<div class="choco-widget-balance-amount">${C}</div>
|
|
2858
2858
|
` : ""}
|
|
2859
2859
|
<label class="choco-widget-toggle">
|
|
2860
|
-
<input type="checkbox" ${t ? "checked" : ""} />
|
|
2860
|
+
<input type="checkbox" ${t && !o ? "checked" : ""} ${o ? "disabled" : ""} />
|
|
2861
2861
|
<span class="choco-widget-toggle-slider"></span>
|
|
2862
2862
|
</label>
|
|
2863
2863
|
</div>
|
|
2864
2864
|
</div>
|
|
2865
2865
|
`;
|
|
2866
2866
|
}
|
|
2867
|
-
function on(e, t, o, i, s, u, a, l) {
|
|
2867
|
+
function on(e, t, o, i, s, u, a, l, f) {
|
|
2868
2868
|
if (!e && !o && !s) return "";
|
|
2869
|
-
const
|
|
2869
|
+
const C = e ? `
|
|
2870
2870
|
<div class="choco-widget-balance-toggle" data-action="toggle-balance">
|
|
2871
2871
|
<div class="choco-widget-balance-info">
|
|
2872
2872
|
<div class="choco-widget-balance-text">
|
|
2873
|
-
<div class="choco-widget-balance-label">${
|
|
2873
|
+
<div class="choco-widget-balance-label">${l("balance")}</div>
|
|
2874
2874
|
</div>
|
|
2875
2875
|
</div>
|
|
2876
2876
|
<div class="choco-widget-balance-label-wrapper">
|
|
2877
2877
|
<div class="choco-widget-balance-icon">
|
|
2878
|
-
${
|
|
2878
|
+
${Ue}
|
|
2879
2879
|
</div>
|
|
2880
2880
|
<div class="choco-widget-balance-amount">${e}</div>
|
|
2881
2881
|
<label class="choco-widget-toggle">
|
|
@@ -2887,9 +2887,9 @@ function on(e, t, o, i, s, u, a, l) {
|
|
|
2887
2887
|
` : "";
|
|
2888
2888
|
return `
|
|
2889
2889
|
<div class="choco-widget-balance-section">
|
|
2890
|
-
${rn(s, u, a, l)}
|
|
2891
|
-
${
|
|
2892
|
-
${nn(o, i,
|
|
2890
|
+
${rn(s, u, a, l, f)}
|
|
2891
|
+
${C}
|
|
2892
|
+
${nn(o, i, l, f)}
|
|
2893
2893
|
</div>
|
|
2894
2894
|
`;
|
|
2895
2895
|
}
|
|
@@ -2916,33 +2916,34 @@ function an(e) {
|
|
|
2916
2916
|
balanceFormatted: l,
|
|
2917
2917
|
useBalance: f,
|
|
2918
2918
|
bonuses: C,
|
|
2919
|
-
useBonuses:
|
|
2919
|
+
useBonuses: P,
|
|
2920
2920
|
coupon: _,
|
|
2921
|
-
useCoupon:
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2921
|
+
useCoupon: b,
|
|
2922
|
+
couponDisabled: k,
|
|
2923
|
+
cashbackFormatted: T,
|
|
2924
|
+
disabled: I,
|
|
2925
|
+
paymentMethodDisabled: w = !1,
|
|
2926
|
+
loading: B,
|
|
2927
|
+
t: v,
|
|
2928
|
+
currency: L
|
|
2929
|
+
} = e, O = (s == null ? void 0 : s.label) ?? v("selectMethod"), F = Ee(s), N = At(u, a), q = on(l, f, C, P, _, b, k, v, L), J = sn(T, v), x = (a == null ? void 0 : a.type) === "google_pay", M = (a == null ? void 0 : a.type) === "apple_pay", m = x || M;
|
|
2929
2930
|
return `
|
|
2930
|
-
<div class="choco-widget-bottom-bar" role="region" aria-label="${
|
|
2931
|
-
${
|
|
2931
|
+
<div class="choco-widget-bottom-bar" role="region" aria-label="${v("paymentMethod")}">
|
|
2932
|
+
${q}
|
|
2932
2933
|
<div class="choco-widget-payment-info">
|
|
2933
2934
|
<div class="choco-widget-payment-info-main">
|
|
2934
2935
|
<button
|
|
2935
2936
|
class="choco-widget-payment-method ${(s == null ? void 0 : s.type) || ""}"
|
|
2936
2937
|
data-action="change-method"
|
|
2937
|
-
aria-label="${
|
|
2938
|
+
aria-label="${v("paymentMethod")}: ${O}"
|
|
2938
2939
|
type="button"
|
|
2939
|
-
${
|
|
2940
|
+
${w || I || B ? "disabled" : ""}
|
|
2940
2941
|
>
|
|
2941
|
-
<div class="choco-widget-method-label">${
|
|
2942
|
+
<div class="choco-widget-method-label">${v("paymentMethod")}</div>
|
|
2942
2943
|
<div class="choco-widget-method-value">
|
|
2943
|
-
<div class="choco-widget-method-icon-wrapper ${s == null ? void 0 : s.type}" aria-hidden="true">${
|
|
2944
|
+
<div class="choco-widget-method-icon-wrapper ${s == null ? void 0 : s.type}" aria-hidden="true">${F}</div>
|
|
2944
2945
|
<div class="choco-widget-method-details">
|
|
2945
|
-
<div class="choco-widget-method-name ${s == null ? void 0 : s.type}">${
|
|
2946
|
+
<div class="choco-widget-method-name ${s == null ? void 0 : s.type}">${O}</div>
|
|
2946
2947
|
<div class="choco-widget-method-chevron">
|
|
2947
2948
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2948
2949
|
<path d="M8 10L12 14L16 10" stroke="#242424" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
@@ -2951,24 +2952,24 @@ function an(e) {
|
|
|
2951
2952
|
</div>
|
|
2952
2953
|
</div>
|
|
2953
2954
|
</button>
|
|
2954
|
-
<div class="choco-widget-google-pay-amount ${
|
|
2955
|
-
<div class="choco-widget-google-pay-amount-label">${
|
|
2956
|
-
${i ? `<div class="choco-widget-google-pay-amount-value">${
|
|
2955
|
+
<div class="choco-widget-google-pay-amount ${m ? "" : "choco-widget-google-pay-amount--hidden"}" aria-live="polite">
|
|
2956
|
+
<div class="choco-widget-google-pay-amount-label">${v("total")} ${t}</div>
|
|
2957
|
+
${i ? `<div class="choco-widget-google-pay-amount-value">${v("instead")} <span class="choco-widget-google-pay-amount-value-number">${o || ""}</span></div>` : ""}
|
|
2957
2958
|
</div>
|
|
2958
2959
|
<button
|
|
2959
|
-
class="choco-widget-pay-button ${
|
|
2960
|
+
class="choco-widget-pay-button ${B ? "choco-widget-pay-button--loading" : ""} ${m ? "choco-widget-pay-button--hidden" : ""}"
|
|
2960
2961
|
data-action="pay"
|
|
2961
|
-
aria-label="${
|
|
2962
|
+
aria-label="${v("pay")} ${t}"
|
|
2962
2963
|
type="button"
|
|
2963
|
-
${
|
|
2964
|
+
${I || B ? "disabled" : ""}
|
|
2964
2965
|
>
|
|
2965
|
-
${
|
|
2966
|
+
${v("pay")} ${t}
|
|
2966
2967
|
</button>
|
|
2967
2968
|
</div>
|
|
2968
|
-
<div class="choco-widget-google-pay-row ${
|
|
2969
|
+
<div class="choco-widget-google-pay-row ${x ? "" : "choco-widget-google-pay-row--hidden"}">
|
|
2969
2970
|
<div class="choco-widget-google-pay-button-slot" data-action="google-pay-button-slot"></div>
|
|
2970
2971
|
</div>
|
|
2971
|
-
<div class="choco-widget-apple-pay-row ${
|
|
2972
|
+
<div class="choco-widget-apple-pay-row ${M ? "" : "choco-widget-apple-pay-row--hidden"}">
|
|
2972
2973
|
<div class="choco-widget-apple-pay-button-slot" data-action="apple-pay-button-slot"></div>
|
|
2973
2974
|
</div>
|
|
2974
2975
|
</div>
|
|
@@ -2994,7 +2995,7 @@ function an(e) {
|
|
|
2994
2995
|
<path d="M15 18L9 12L15 6" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2995
2996
|
</svg>
|
|
2996
2997
|
</button>
|
|
2997
|
-
<h3 class="choco-widget-sheet-title" id="choco-sheet-title">${
|
|
2998
|
+
<h3 class="choco-widget-sheet-title" id="choco-sheet-title">${v("paymentMethods")}</h3>
|
|
2998
2999
|
<button
|
|
2999
3000
|
class="choco-widget-sheet-button choco-widget-sheet-button--edit"
|
|
3000
3001
|
data-action="edit-sheet"
|
|
@@ -3009,7 +3010,7 @@ function an(e) {
|
|
|
3009
3010
|
<button
|
|
3010
3011
|
class="choco-widget-sheet-button choco-widget-sheet-button--previous"
|
|
3011
3012
|
data-action="previous-sheet"
|
|
3012
|
-
aria-label="${
|
|
3013
|
+
aria-label="${v("back")}"
|
|
3013
3014
|
type="button"
|
|
3014
3015
|
style="display: none;"
|
|
3015
3016
|
>
|
|
@@ -3020,25 +3021,25 @@ function an(e) {
|
|
|
3020
3021
|
</button>
|
|
3021
3022
|
</div>
|
|
3022
3023
|
<div class="choco-widget-payment-methods" role="list">
|
|
3023
|
-
${
|
|
3024
|
+
${N}
|
|
3024
3025
|
</div>
|
|
3025
3026
|
<div class="choco-widget-sheet-delete-confirm" data-delete-confirm="content" aria-hidden="true">
|
|
3026
3027
|
<div class="choco-widget-sheet-delete-confirm-actions">
|
|
3027
|
-
<button type="button" class="choco-widget-delete-confirm-btn choco-widget-delete-confirm-btn--cancel" data-action="confirm-delete-cancel">${
|
|
3028
|
-
<button type="button" class="choco-widget-delete-confirm-btn choco-widget-delete-confirm-btn--delete" data-action="confirm-delete-submit">${
|
|
3028
|
+
<button type="button" class="choco-widget-delete-confirm-btn choco-widget-delete-confirm-btn--cancel" data-action="confirm-delete-cancel">${v("cancel")}</button>
|
|
3029
|
+
<button type="button" class="choco-widget-delete-confirm-btn choco-widget-delete-confirm-btn--delete" data-action="confirm-delete-submit">${v("delete")}</button>
|
|
3029
3030
|
</div>
|
|
3030
3031
|
</div>
|
|
3031
|
-
${
|
|
3032
|
+
${J}
|
|
3032
3033
|
</div>
|
|
3033
3034
|
</div>
|
|
3034
3035
|
|
|
3035
3036
|
<div class="choco-widget-add-card-sheet choco-widget-payment-sheet" data-sheet="add-card" aria-hidden="true" style="display: none;">
|
|
3036
3037
|
<div class="choco-widget-sheet-content choco-widget-add-card-sheet-content">
|
|
3037
3038
|
<div class="choco-widget-sheet-header">
|
|
3038
|
-
<h3 class="choco-widget-sheet-title">${
|
|
3039
|
+
<h3 class="choco-widget-sheet-title">${v("addCard")}</h3>
|
|
3039
3040
|
</div>
|
|
3040
3041
|
<div class="choco-widget-add-card-iframe-wrapper">
|
|
3041
|
-
<iframe id="choco-widget-add-card-iframe" class="choco-widget-add-card-iframe" title="${
|
|
3042
|
+
<iframe id="choco-widget-add-card-iframe" class="choco-widget-add-card-iframe" title="${v("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>
|
|
3042
3043
|
</div>
|
|
3043
3044
|
</div>
|
|
3044
3045
|
</div>
|
|
@@ -3076,10 +3077,10 @@ function dn(e) {
|
|
|
3076
3077
|
ut(e) && (e.container.style.setProperty("--choco-widget-accent-color", e.config.color), e.container.innerHTML = cn());
|
|
3077
3078
|
}
|
|
3078
3079
|
function hn(e) {
|
|
3079
|
-
var
|
|
3080
|
+
var P, _, b, k, T;
|
|
3080
3081
|
if (!ut(e)) return;
|
|
3081
3082
|
e.container.style.setProperty("--choco-widget-accent-color", e.config.color), e.container.classList.remove("choco-one-click-widget--visible");
|
|
3082
|
-
const t = e.getAvailablePaymentMethods(), o = (
|
|
3083
|
+
const t = e.getAvailablePaymentMethods(), o = (P = e.checkoutContext) == null ? void 0 : P.data, i = e.config.currency || "KZT", s = (k = (b = (_ = o == null ? void 0 : o.balance) == null ? void 0 : _.data) == null ? void 0 : b.money) == null ? void 0 : k[i], u = s > 0 ? V(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 ? V(a.cashbackAmount, e.config.locale, e.config.currency) : null, f = e._getPayableAmount(), C = f < e.config.amount;
|
|
3083
3084
|
e.container.innerHTML = an({
|
|
3084
3085
|
amountFormatted: V(f, e.config.locale, e.config.currency),
|
|
3085
3086
|
originalAmountFormatted: V(
|
|
@@ -3097,11 +3098,12 @@ function hn(e) {
|
|
|
3097
3098
|
useBonuses: e.useBonuses,
|
|
3098
3099
|
coupon: e.selectedCoupon,
|
|
3099
3100
|
useCoupon: e.useCoupon,
|
|
3101
|
+
couponDisabled: e._isCouponDisabled(),
|
|
3100
3102
|
cashbackFormatted: l,
|
|
3101
3103
|
disabled: e.disabled,
|
|
3102
3104
|
paymentMethodDisabled: e.paymentMethodDisabled,
|
|
3103
3105
|
loading: e.loading,
|
|
3104
|
-
t: (
|
|
3106
|
+
t: (I, w) => e.t(I, w),
|
|
3105
3107
|
currency: i
|
|
3106
3108
|
}), e._attachEventListeners(), e.isOpen = !0, e._emitUserEvent("one_click_pay_cta_rendered", {
|
|
3107
3109
|
terminal_id: e.config.terminalId,
|
|
@@ -3110,8 +3112,8 @@ function hn(e) {
|
|
|
3110
3112
|
payment_method: e._getPaymentMethodForUserEvent()
|
|
3111
3113
|
}), requestAnimationFrame(() => {
|
|
3112
3114
|
requestAnimationFrame(() => {
|
|
3113
|
-
var
|
|
3114
|
-
(
|
|
3115
|
+
var I;
|
|
3116
|
+
(I = e.container) == null || I.classList.add("choco-one-click-widget--visible");
|
|
3115
3117
|
});
|
|
3116
3118
|
});
|
|
3117
3119
|
}
|
|
@@ -3150,13 +3152,13 @@ function lt(e) {
|
|
|
3150
3152
|
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 = un(e.selectedPaymentMethod)), dt(e);
|
|
3151
3153
|
}
|
|
3152
3154
|
function pe(e) {
|
|
3153
|
-
var
|
|
3154
|
-
const t = (
|
|
3155
|
+
var P, _, b, k, T;
|
|
3156
|
+
const t = (P = e.container) == null ? void 0 : P.querySelector(".choco-widget-pay-button"), o = (_ = e.container) == null ? void 0 : _.querySelector(
|
|
3155
3157
|
".choco-widget-google-pay-amount"
|
|
3156
|
-
), i = (
|
|
3158
|
+
), i = (b = e.container) == null ? void 0 : b.querySelector(
|
|
3157
3159
|
".choco-widget-google-pay-amount-label"
|
|
3158
3160
|
);
|
|
3159
|
-
let s = (
|
|
3161
|
+
let s = (k = e.container) == null ? void 0 : k.querySelector(
|
|
3160
3162
|
".choco-widget-google-pay-amount-value"
|
|
3161
3163
|
), u = (T = e.container) == null ? void 0 : T.querySelector(
|
|
3162
3164
|
".choco-widget-google-pay-amount-value-number"
|
|
@@ -3175,38 +3177,38 @@ function pe(e) {
|
|
|
3175
3177
|
)), u ? u.textContent = C : s && (s.textContent = `${e.t("instead")} ${C}`);
|
|
3176
3178
|
}
|
|
3177
3179
|
function dt(e) {
|
|
3178
|
-
var f, C,
|
|
3179
|
-
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 = (
|
|
3180
|
+
var f, C, P, _, b, k, T, I, w, B;
|
|
3181
|
+
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 = (P = e.container) == null ? void 0 : P.querySelector(".choco-widget-pay-button"), u = (_ = e.container) == null ? void 0 : _.querySelector(
|
|
3180
3182
|
".choco-widget-google-pay-amount"
|
|
3181
|
-
), a = (
|
|
3183
|
+
), a = (b = e.container) == null ? void 0 : b.querySelector(".choco-widget-google-pay-row"), l = (k = e.container) == null ? void 0 : k.querySelector(".choco-widget-apple-pay-row");
|
|
3182
3184
|
if (s == null || s.classList.toggle("choco-widget-pay-button--hidden", i), u == null || u.classList.toggle(
|
|
3183
3185
|
"choco-widget-google-pay-amount--hidden",
|
|
3184
3186
|
!i
|
|
3185
3187
|
), 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) {
|
|
3186
3188
|
fn(e);
|
|
3187
|
-
const
|
|
3189
|
+
const v = (T = e.container) == null ? void 0 : T.querySelector(
|
|
3188
3190
|
'[data-action="apple-pay-button-slot"]'
|
|
3189
3191
|
);
|
|
3190
|
-
|
|
3192
|
+
v && (v.innerHTML = "");
|
|
3191
3193
|
} else if (o) {
|
|
3192
3194
|
e._googlePayButtonRenderVersion += 1;
|
|
3193
|
-
const
|
|
3195
|
+
const v = (I = e.container) == null ? void 0 : I.querySelector(
|
|
3194
3196
|
'[data-action="google-pay-button-slot"]'
|
|
3195
3197
|
);
|
|
3196
|
-
|
|
3198
|
+
v && (v.innerHTML = ""), gn(e);
|
|
3197
3199
|
} else {
|
|
3198
3200
|
e._googlePayButtonRenderVersion += 1;
|
|
3199
|
-
const
|
|
3201
|
+
const v = (w = e.container) == null ? void 0 : w.querySelector(
|
|
3200
3202
|
'[data-action="google-pay-button-slot"]'
|
|
3201
|
-
), L = (
|
|
3203
|
+
), L = (B = e.container) == null ? void 0 : B.querySelector(
|
|
3202
3204
|
'[data-action="apple-pay-button-slot"]'
|
|
3203
3205
|
);
|
|
3204
|
-
|
|
3206
|
+
v && (v.innerHTML = ""), L && (L.innerHTML = "");
|
|
3205
3207
|
}
|
|
3206
|
-
pe(e),
|
|
3208
|
+
pe(e), Y(e);
|
|
3207
3209
|
}
|
|
3208
3210
|
async function fn(e) {
|
|
3209
|
-
var a, l, f, C,
|
|
3211
|
+
var a, l, f, C, P;
|
|
3210
3212
|
const t = (a = e.container) == null ? void 0 : a.querySelector(
|
|
3211
3213
|
'[data-action="google-pay-button-slot"]'
|
|
3212
3214
|
);
|
|
@@ -3219,7 +3221,7 @@ async function fn(e) {
|
|
|
3219
3221
|
return;
|
|
3220
3222
|
}
|
|
3221
3223
|
if (o !== e._googlePayButtonRenderVersion) return;
|
|
3222
|
-
if (!((
|
|
3224
|
+
if (!((P = (C = (f = window.google) == null ? void 0 : f.payments) == null ? void 0 : C.api) != null && P.PaymentsClient)) {
|
|
3223
3225
|
e.config.onError({ attributes: { message: e.t("errorGooglePayUnsupported") } });
|
|
3224
3226
|
return;
|
|
3225
3227
|
}
|
|
@@ -3234,7 +3236,7 @@ async function fn(e) {
|
|
|
3234
3236
|
});
|
|
3235
3237
|
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((_) => {
|
|
3236
3238
|
_.style.setProperty("border-radius", "12px", "important"), _.style.setProperty("font-weight", "bold", "important"), _.style.setProperty("font-size", "16px", "important");
|
|
3237
|
-
}), t.appendChild(u),
|
|
3239
|
+
}), t.appendChild(u), Y(e);
|
|
3238
3240
|
}
|
|
3239
3241
|
function gn(e) {
|
|
3240
3242
|
var u, a;
|
|
@@ -3261,37 +3263,37 @@ function gn(e) {
|
|
|
3261
3263
|
</defs>
|
|
3262
3264
|
</svg>
|
|
3263
3265
|
</span>
|
|
3264
|
-
`, o.appendChild(i), o.appendChild(s), t.appendChild(o),
|
|
3266
|
+
`, o.appendChild(i), o.appendChild(s), t.appendChild(o), Y(e);
|
|
3265
3267
|
}
|
|
3266
3268
|
function ne(e) {
|
|
3267
|
-
e.loading = !0,
|
|
3269
|
+
e.loading = !0, Y(e);
|
|
3268
3270
|
}
|
|
3269
3271
|
function j(e) {
|
|
3270
|
-
var _,
|
|
3272
|
+
var _, b, k, T, I, w, B, v;
|
|
3271
3273
|
e.loading = !1;
|
|
3272
|
-
const t = (_ = e.container) == null ? void 0 : _.querySelector(".choco-widget-payment-method"), o = (
|
|
3274
|
+
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 = (k = e.container) == null ? void 0 : k.querySelector(
|
|
3273
3275
|
".choco-widget-google-pay-button-slot button"
|
|
3274
3276
|
), s = (T = e.container) == null ? void 0 : T.querySelector(
|
|
3275
3277
|
".choco-widget-apple-pay-button-slot button"
|
|
3276
|
-
), u = (
|
|
3278
|
+
), u = (I = e.container) == null ? void 0 : I.querySelector(
|
|
3277
3279
|
".choco-widget-google-pay-amount"
|
|
3278
|
-
), a = (
|
|
3280
|
+
), a = (w = e.container) == null ? void 0 : w.querySelector(".choco-widget-google-pay-row"), l = (B = e.container) == null ? void 0 : B.querySelector(".choco-widget-apple-pay-row"), f = (v = e.container) == null ? void 0 : v.querySelector(
|
|
3279
3281
|
".choco-widget-balance-section"
|
|
3280
|
-
), C = e._isInteractionBlocked(),
|
|
3281
|
-
t && (t.disabled =
|
|
3282
|
+
), C = e._isInteractionBlocked(), P = e.paymentMethodDisabled || C;
|
|
3283
|
+
t && (t.disabled = P), 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");
|
|
3282
3284
|
}
|
|
3283
|
-
function
|
|
3284
|
-
var _,
|
|
3285
|
-
const t = (_ = e.container) == null ? void 0 : _.querySelector(".choco-widget-payment-method"), o = (
|
|
3285
|
+
function Y(e) {
|
|
3286
|
+
var _, b, k, T, I, w, B, v;
|
|
3287
|
+
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 = (k = e.container) == null ? void 0 : k.querySelector(
|
|
3286
3288
|
".choco-widget-google-pay-button-slot button"
|
|
3287
3289
|
), s = (T = e.container) == null ? void 0 : T.querySelector(
|
|
3288
3290
|
".choco-widget-apple-pay-button-slot button"
|
|
3289
|
-
), u = (
|
|
3291
|
+
), u = (I = e.container) == null ? void 0 : I.querySelector(
|
|
3290
3292
|
".choco-widget-google-pay-amount"
|
|
3291
|
-
), a = (
|
|
3293
|
+
), a = (w = e.container) == null ? void 0 : w.querySelector(".choco-widget-google-pay-row"), l = (B = e.container) == null ? void 0 : B.querySelector(".choco-widget-apple-pay-row"), f = (v = e.container) == null ? void 0 : v.querySelector(
|
|
3292
3294
|
".choco-widget-balance-section"
|
|
3293
|
-
), C = e._isInteractionBlocked(),
|
|
3294
|
-
f == null || f.classList.toggle("disabled", C), t && (t.disabled =
|
|
3295
|
+
), C = e._isInteractionBlocked(), P = e.paymentMethodDisabled || C;
|
|
3296
|
+
f == null || f.classList.toggle("disabled", C), t && (t.disabled = P), o && (o.disabled = C, o.classList.toggle("choco-widget-pay-button--loading", e.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));
|
|
3295
3297
|
}
|
|
3296
3298
|
function ht(e) {
|
|
3297
3299
|
var o;
|
|
@@ -3299,7 +3301,7 @@ function ht(e) {
|
|
|
3299
3301
|
const t = (o = e.container) == null ? void 0 : o.querySelector('[data-sheet="payment"]');
|
|
3300
3302
|
t && (t.classList.add("choco-widget-payment-sheet--open"), e.isPaymentSheetOpen = !0, ue(e));
|
|
3301
3303
|
}
|
|
3302
|
-
function
|
|
3304
|
+
function G(e) {
|
|
3303
3305
|
var o;
|
|
3304
3306
|
const t = (o = e.container) == null ? void 0 : o.querySelector('[data-sheet="payment"]');
|
|
3305
3307
|
if (t) {
|
|
@@ -3315,7 +3317,7 @@ function ue(e) {
|
|
|
3315
3317
|
const o = t.querySelector(".choco-widget-sheet-title"), i = t.querySelector('[data-action="close-sheet"]'), s = t.querySelector('[data-action="edit-sheet"]'), u = t.querySelector('[data-action="previous-sheet"]'), l = e.getAvailablePaymentMethods().some((C) => C.type === "card");
|
|
3316
3318
|
e.isPaymentSheetEditMode ? (t.classList.add("choco-widget-payment-sheet--edit"), o && (o.textContent = e.t("editCards")), i && (i.style.display = "none"), s && (s.style.display = "none"), u && (u.style.display = "")) : (t.classList.remove("choco-widget-payment-sheet--edit"), t.classList.toggle("choco-widget-payment-sheet--no-cards", !l), o && (o.textContent = e.t("paymentMethods")), i && (i.style.display = ""), s && (s.style.display = l ? "" : "none"), u && (u.style.display = "none"));
|
|
3317
3319
|
}
|
|
3318
|
-
function
|
|
3320
|
+
function Te(e) {
|
|
3319
3321
|
if (!e.addCardActionUrl || !e.container) return;
|
|
3320
3322
|
const t = e.container.querySelector('[data-sheet="add-card"]'), o = e.container.querySelector(
|
|
3321
3323
|
"#choco-widget-add-card-iframe"
|
|
@@ -3349,11 +3351,11 @@ function yn(e, t) {
|
|
|
3349
3351
|
}
|
|
3350
3352
|
function ve(e) {
|
|
3351
3353
|
var o;
|
|
3352
|
-
e._pendingDeleteMethod = null,
|
|
3354
|
+
e._pendingDeleteMethod = null, De(e, !1);
|
|
3353
3355
|
const t = (o = e.container) == null ? void 0 : o.querySelector('[data-sheet="payment"]');
|
|
3354
3356
|
t == null || t.classList.remove("choco-widget-payment-sheet--delete-confirm"), ue(e);
|
|
3355
3357
|
}
|
|
3356
|
-
function
|
|
3358
|
+
function De(e, t) {
|
|
3357
3359
|
var u, a, l;
|
|
3358
3360
|
const o = (u = e.container) == null ? void 0 : u.querySelector(
|
|
3359
3361
|
".choco-widget-sheet-delete-confirm-actions"
|
|
@@ -3369,10 +3371,10 @@ async function mn(e, t) {
|
|
|
3369
3371
|
const o = t == null ? void 0 : t.cardId;
|
|
3370
3372
|
if (!(!o || (t == null ? void 0 : t.type) !== "card"))
|
|
3371
3373
|
try {
|
|
3372
|
-
await Dt(e.apiUrl, e._getApiConfig(), o), e.checkoutContext = await
|
|
3374
|
+
await Dt(e.apiUrl, e._getApiConfig(), o), e.checkoutContext = await Me(
|
|
3373
3375
|
e.apiUrl,
|
|
3374
3376
|
e._getApiConfig()
|
|
3375
|
-
), ((i = e.selectedPaymentMethod) == null ? void 0 : i.type) === "card" && ((s = e.selectedPaymentMethod) == null ? void 0 : s.cardId) === o && (e.selectedPaymentMethod =
|
|
3377
|
+
), ((i = e.selectedPaymentMethod) == null ? void 0 : i.type) === "card" && ((s = e.selectedPaymentMethod) == null ? void 0 : s.cardId) === o && (e.selectedPaymentMethod = Re(
|
|
3376
3378
|
e.checkoutContext.data,
|
|
3377
3379
|
e._getKaspiOptions()
|
|
3378
3380
|
), e._emitPaymentMethodSelected(), lt(e)), Ae(e), e.config.onSuccess({ message: e.t("cardDeleted") }), e.config.onCardDeleted && e.config.onCardDeleted({ cardId: o });
|
|
@@ -3385,12 +3387,12 @@ async function mn(e, t) {
|
|
|
3385
3387
|
function ft(e, t) {
|
|
3386
3388
|
if (!e._isInteractionBlocked()) {
|
|
3387
3389
|
if (e.selectedPaymentMethod = t, e._emitPaymentMethodSelected(), t.type === "new_card") {
|
|
3388
|
-
e._emitUserEvent("one_click_pay_method_resolved", { payment_method: t.type }),
|
|
3390
|
+
e._emitUserEvent("one_click_pay_method_resolved", { payment_method: t.type }), G(e), e.handlePayment();
|
|
3389
3391
|
return;
|
|
3390
3392
|
}
|
|
3391
3393
|
e._emitUserEvent("one_click_pay_method_resolved", {
|
|
3392
3394
|
payment_method: e._getPaymentMethodForUserEvent()
|
|
3393
|
-
}), Ae(e),
|
|
3395
|
+
}), Ae(e), G(e), lt(e);
|
|
3394
3396
|
}
|
|
3395
3397
|
}
|
|
3396
3398
|
function tt(e, t) {
|
|
@@ -3402,10 +3404,10 @@ function tt(e, t) {
|
|
|
3402
3404
|
}
|
|
3403
3405
|
switch (o) {
|
|
3404
3406
|
case "order.paid":
|
|
3405
|
-
e._orderStatusResolved = !0,
|
|
3407
|
+
e._orderStatusResolved = !0, te(e), pt(e, t);
|
|
3406
3408
|
break;
|
|
3407
3409
|
case "order.failed":
|
|
3408
|
-
e._orderStatusResolved = !0,
|
|
3410
|
+
e._orderStatusResolved = !0, te(e), Ct(e, t);
|
|
3409
3411
|
break;
|
|
3410
3412
|
case "order.action_required":
|
|
3411
3413
|
bn(e, t);
|
|
@@ -3414,17 +3416,17 @@ function tt(e, t) {
|
|
|
3414
3416
|
console.warn("Unknown event type:", o);
|
|
3415
3417
|
}
|
|
3416
3418
|
}
|
|
3417
|
-
function
|
|
3419
|
+
function te(e) {
|
|
3418
3420
|
e._orderStatusPollingId && (clearInterval(e._orderStatusPollingId), e._orderStatusPollingId = null);
|
|
3419
3421
|
}
|
|
3420
3422
|
function ce(e, t) {
|
|
3421
|
-
|
|
3423
|
+
te(e), e._orderStatusResolved = !1;
|
|
3422
3424
|
const o = 6e3, i = 5;
|
|
3423
3425
|
let s = 0;
|
|
3424
3426
|
const u = async () => {
|
|
3425
3427
|
if (!e._orderStatusResolved) {
|
|
3426
3428
|
if (s >= i) {
|
|
3427
|
-
|
|
3429
|
+
te(e), j(e), e.config.onError({
|
|
3428
3430
|
attributes: { message: e.t("errorNoServerResponseRetry") }
|
|
3429
3431
|
});
|
|
3430
3432
|
return;
|
|
@@ -3437,13 +3439,13 @@ function ce(e, t) {
|
|
|
3437
3439
|
String(t)
|
|
3438
3440
|
), l = a == null ? void 0 : a.status, f = (a == null ? void 0 : a.payload) || {};
|
|
3439
3441
|
if (l === "success") {
|
|
3440
|
-
e._orderStatusResolved = !0,
|
|
3442
|
+
e._orderStatusResolved = !0, te(e), pt(e, {
|
|
3441
3443
|
id: String(f.id || t),
|
|
3442
3444
|
attributes: { amount: f.amount, paid_at: f.paid_at || "" }
|
|
3443
3445
|
});
|
|
3444
3446
|
return;
|
|
3445
3447
|
}
|
|
3446
|
-
l === "fail" && (e._orderStatusResolved = !0,
|
|
3448
|
+
l === "fail" && (e._orderStatusResolved = !0, te(e), Ct(e, {
|
|
3447
3449
|
id: String(f.id || t),
|
|
3448
3450
|
attributes: { message: f.message || e.t("paymentError") }
|
|
3449
3451
|
}));
|
|
@@ -3454,14 +3456,14 @@ function ce(e, t) {
|
|
|
3454
3456
|
};
|
|
3455
3457
|
e._orderStatusPollingId = setInterval(u, o), u();
|
|
3456
3458
|
}
|
|
3457
|
-
function
|
|
3459
|
+
function He() {
|
|
3458
3460
|
return typeof document > "u" ? !1 : document.hidden || document.visibilityState === "hidden";
|
|
3459
3461
|
}
|
|
3460
3462
|
function gt(e, t) {
|
|
3461
3463
|
j(e), e.config.onSuccess(t);
|
|
3462
3464
|
}
|
|
3463
|
-
function
|
|
3464
|
-
if (!e._pendingSuccessPayload ||
|
|
3465
|
+
function Le(e) {
|
|
3466
|
+
if (!e._pendingSuccessPayload || He()) return;
|
|
3465
3467
|
const t = e._pendingSuccessPayload;
|
|
3466
3468
|
e._pendingSuccessPayload = null, gt(e, t);
|
|
3467
3469
|
}
|
|
@@ -3469,7 +3471,7 @@ function pt(e, t) {
|
|
|
3469
3471
|
var s, u;
|
|
3470
3472
|
e.isAddCardViewOpen && ae(e);
|
|
3471
3473
|
const o = t.attributes || ((s = t.data) == null ? void 0 : s.attributes) || {}, i = { id: t.id || ((u = t.data) == null ? void 0 : u.id), attributes: o };
|
|
3472
|
-
if (
|
|
3474
|
+
if (He()) {
|
|
3473
3475
|
e._pendingSuccessPayload = i;
|
|
3474
3476
|
return;
|
|
3475
3477
|
}
|
|
@@ -3518,7 +3520,7 @@ async function En(e) {
|
|
|
3518
3520
|
if (e._isBalanceFullyCoveringAmount()) {
|
|
3519
3521
|
ne(e);
|
|
3520
3522
|
try {
|
|
3521
|
-
const a = await
|
|
3523
|
+
const a = await $e(
|
|
3522
3524
|
e.apiUrl,
|
|
3523
3525
|
e._getApiConfig(),
|
|
3524
3526
|
e.deviceId,
|
|
@@ -3548,7 +3550,7 @@ async function En(e) {
|
|
|
3548
3550
|
}
|
|
3549
3551
|
ne(e);
|
|
3550
3552
|
try {
|
|
3551
|
-
const a = await
|
|
3553
|
+
const a = await $e(
|
|
3552
3554
|
e.apiUrl,
|
|
3553
3555
|
e._getApiConfig(),
|
|
3554
3556
|
e.deviceId,
|
|
@@ -3558,12 +3560,12 @@ async function En(e) {
|
|
|
3558
3560
|
await nt(e);
|
|
3559
3561
|
const l = (a == null ? void 0 : a.id) ?? ((i = a == null ? void 0 : a.data) == null ? void 0 : i.id);
|
|
3560
3562
|
if (l && ce(e, String(l)), ((s = e.selectedPaymentMethod) == null ? void 0 : s.type) === "kaspi_pay") {
|
|
3561
|
-
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,
|
|
3563
|
+
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, P = f.action_url_type || f.action_type || "redirect";
|
|
3562
3564
|
if (C)
|
|
3563
3565
|
return typeof e.config.onKaspiLink == "function" ? (e.config.onKaspiLink({
|
|
3564
3566
|
action_link: C,
|
|
3565
3567
|
action_url: C,
|
|
3566
|
-
action_type:
|
|
3568
|
+
action_type: P,
|
|
3567
3569
|
event: a
|
|
3568
3570
|
}), a) : (window.location.href = C, a);
|
|
3569
3571
|
}
|
|
@@ -3632,8 +3634,8 @@ async function Bn(e, t) {
|
|
|
3632
3634
|
e.apiUrl,
|
|
3633
3635
|
e._getApiConfig(),
|
|
3634
3636
|
u.validationURL
|
|
3635
|
-
), C = ((l = (a = f == null ? void 0 : f.data) == null ? void 0 : a.attributes) == null ? void 0 : l.session) || f,
|
|
3636
|
-
s.completeMerchantValidation(
|
|
3637
|
+
), C = ((l = (a = f == null ? void 0 : f.data) == null ? void 0 : a.attributes) == null ? void 0 : l.session) || f, P = JSON.parse(atob(C));
|
|
3638
|
+
s.completeMerchantValidation(P);
|
|
3637
3639
|
} catch (f) {
|
|
3638
3640
|
console.error("Apple Pay session error:", f), s.abort(), e.config.onError({ attributes: { message: e.t("errorApplePayInit") } });
|
|
3639
3641
|
}
|
|
@@ -3666,8 +3668,8 @@ async function Bn(e, t) {
|
|
|
3666
3668
|
}, s.begin();
|
|
3667
3669
|
}
|
|
3668
3670
|
async function In(e, t) {
|
|
3669
|
-
var
|
|
3670
|
-
const o = (
|
|
3671
|
+
var w, B, v, L, O, F;
|
|
3672
|
+
const o = (w = e.checkoutContext) == null ? void 0 : w.data, i = ((v = (B = o == null ? void 0 : o.payment_methods) == null ? void 0 : B.data) == null ? void 0 : v.attributes) || {}, s = i.google_pay_settings || {};
|
|
3671
3673
|
if (!(i.payment_method_google_pay === "enabled" || i.payment_method_google_pay === !0)) {
|
|
3672
3674
|
e.config.onError({ attributes: { message: e.t("errorGooglePayUnsupported") } });
|
|
3673
3675
|
return;
|
|
@@ -3679,8 +3681,8 @@ async function In(e, t) {
|
|
|
3679
3681
|
});
|
|
3680
3682
|
return;
|
|
3681
3683
|
}
|
|
3682
|
-
const f = e.config.environment === "production", C = (s == null ? void 0 : s.merchant_name) || "Choco",
|
|
3683
|
-
if (f && !
|
|
3684
|
+
const f = e.config.environment === "production", C = (s == null ? void 0 : s.merchant_name) || "Choco", P = s == null ? void 0 : s.google_merchant_id;
|
|
3685
|
+
if (f && !P) {
|
|
3684
3686
|
e.config.onError({
|
|
3685
3687
|
attributes: { message: e.t("errorGooglePaySettingsUnavailable") }
|
|
3686
3688
|
});
|
|
@@ -3697,12 +3699,12 @@ async function In(e, t) {
|
|
|
3697
3699
|
console.error("Google Pay SDK load error:", N), e.config.onError({ attributes: { message: e.t("errorGooglePayUnsupported") } });
|
|
3698
3700
|
return;
|
|
3699
3701
|
}
|
|
3700
|
-
const
|
|
3701
|
-
if (!(
|
|
3702
|
+
const b = window.google;
|
|
3703
|
+
if (!(b != null && b.payments)) {
|
|
3702
3704
|
e.config.onError({ attributes: { message: e.t("errorGooglePayUnsupported") } });
|
|
3703
3705
|
return;
|
|
3704
3706
|
}
|
|
3705
|
-
const
|
|
3707
|
+
const k = [
|
|
3706
3708
|
{
|
|
3707
3709
|
type: "CARD",
|
|
3708
3710
|
parameters: {
|
|
@@ -3718,7 +3720,7 @@ async function In(e, t) {
|
|
|
3718
3720
|
], T = {
|
|
3719
3721
|
apiVersion: 2,
|
|
3720
3722
|
apiVersionMinor: 0,
|
|
3721
|
-
allowedPaymentMethods:
|
|
3723
|
+
allowedPaymentMethods: k,
|
|
3722
3724
|
transactionInfo: {
|
|
3723
3725
|
totalPriceStatus: "FINAL",
|
|
3724
3726
|
totalPriceLabel: "Итого",
|
|
@@ -3726,30 +3728,30 @@ async function In(e, t) {
|
|
|
3726
3728
|
currencyCode: e.config.currency,
|
|
3727
3729
|
countryCode: e.config.currency === "GEL" ? "GE" : "KZ"
|
|
3728
3730
|
},
|
|
3729
|
-
merchantInfo: f ? { merchantId:
|
|
3730
|
-
},
|
|
3731
|
+
merchantInfo: f ? { merchantId: P, merchantName: C } : { merchantName: C }
|
|
3732
|
+
}, I = new b.payments.api.PaymentsClient({
|
|
3731
3733
|
environment: f ? "PRODUCTION" : "TEST"
|
|
3732
3734
|
});
|
|
3733
3735
|
try {
|
|
3734
|
-
const N = await
|
|
3736
|
+
const N = await I.isReadyToPay({
|
|
3735
3737
|
apiVersion: 2,
|
|
3736
3738
|
apiVersionMinor: 0,
|
|
3737
|
-
allowedPaymentMethods:
|
|
3739
|
+
allowedPaymentMethods: k
|
|
3738
3740
|
});
|
|
3739
3741
|
if (!(N != null && N.result)) {
|
|
3740
3742
|
e.config.onError({ attributes: { message: e.t("errorGooglePayUnsupported") } });
|
|
3741
3743
|
return;
|
|
3742
3744
|
}
|
|
3743
3745
|
ne(e);
|
|
3744
|
-
const q = await
|
|
3745
|
-
if (!
|
|
3746
|
-
const x = JSON.parse(
|
|
3746
|
+
const q = await I.loadPaymentData(T), J = (O = (L = q == null ? void 0 : q.paymentMethodData) == null ? void 0 : L.tokenizationData) == null ? void 0 : O.token;
|
|
3747
|
+
if (!J) throw new Error(e.t("errorGooglePayPayment"));
|
|
3748
|
+
const x = JSON.parse(J), M = await ct(
|
|
3747
3749
|
e.apiUrl,
|
|
3748
3750
|
e._getApiConfig(),
|
|
3749
3751
|
e.deviceId,
|
|
3750
3752
|
x,
|
|
3751
3753
|
t
|
|
3752
|
-
), m = (M == null ? void 0 : M.id) ?? ((
|
|
3754
|
+
), m = (M == null ? void 0 : M.id) ?? ((F = M == null ? void 0 : M.data) == null ? void 0 : F.id);
|
|
3753
3755
|
m && ce(e, String(m));
|
|
3754
3756
|
} catch (N) {
|
|
3755
3757
|
j(e), N.statusCode === "CANCELED" ? e.config.onCancel() : (e.config.onError({
|
|
@@ -3788,47 +3790,47 @@ async function Qn(e, t, o) {
|
|
|
3788
3790
|
}
|
|
3789
3791
|
}
|
|
3790
3792
|
function Sn(e) {
|
|
3791
|
-
var a, l, f, C,
|
|
3793
|
+
var a, l, f, C, P, _, b, k, T, I, w;
|
|
3792
3794
|
const t = e.container;
|
|
3793
|
-
(a = t.querySelector('[data-action="pay"]')) == null || a.addEventListener("click", () => e.handlePayment()), (l = t.querySelector('[data-action="change-method"]')) == null || l.addEventListener("click", () => ht(e)), t.querySelectorAll('[data-action="close"]').forEach((
|
|
3794
|
-
e._pendingDeleteMethod ? ve(e) :
|
|
3795
|
+
(a = t.querySelector('[data-action="pay"]')) == null || a.addEventListener("click", () => e.handlePayment()), (l = t.querySelector('[data-action="change-method"]')) == null || l.addEventListener("click", () => ht(e)), t.querySelectorAll('[data-action="close"]').forEach((B) => B.addEventListener("click", () => e.close())), (f = t.querySelector('[data-action="close-sheet"]')) == null || f.addEventListener("click", () => {
|
|
3796
|
+
e._pendingDeleteMethod ? ve(e) : G(e);
|
|
3795
3797
|
}), (C = t.querySelector('[data-action="edit-sheet"]')) == null || C.addEventListener("click", () => {
|
|
3796
3798
|
e.isPaymentSheetEditMode = !0, Ae(e), ue(e);
|
|
3797
|
-
}), (
|
|
3799
|
+
}), (P = t.querySelector('[data-action="previous-sheet"]')) == null || P.addEventListener("click", () => {
|
|
3798
3800
|
e.isPaymentSheetEditMode = !1, Ae(e), ue(e);
|
|
3799
|
-
}), (_ = t.querySelector('[data-action="close-add-card"]')) == null || _.addEventListener("click", () => ae(e)), (
|
|
3801
|
+
}), (_ = t.querySelector('[data-action="close-add-card"]')) == null || _.addEventListener("click", () => ae(e)), (b = t.querySelector('[data-action="confirm-delete-cancel"]')) == null || b.addEventListener("click", () => ve(e)), (k = t.querySelector('[data-action="confirm-delete-submit"]')) == null || k.addEventListener("click", () => {
|
|
3800
3802
|
if (e._pendingDeleteMethod) {
|
|
3801
|
-
const
|
|
3802
|
-
|
|
3803
|
+
const B = e._pendingDeleteMethod;
|
|
3804
|
+
De(e, !0), mn(e, B).then(() => G(e)).finally(() => De(e, !1));
|
|
3803
3805
|
}
|
|
3804
|
-
}), t.querySelectorAll(".choco-widget-method-item").forEach((
|
|
3805
|
-
|
|
3806
|
+
}), t.querySelectorAll(".choco-widget-method-item").forEach((B) => {
|
|
3807
|
+
B.addEventListener("click", (v) => {
|
|
3806
3808
|
const L = JSON.parse(
|
|
3807
|
-
|
|
3809
|
+
v.currentTarget.getAttribute("data-method") || "{}"
|
|
3808
3810
|
);
|
|
3809
3811
|
ft(e, L);
|
|
3810
3812
|
});
|
|
3811
3813
|
});
|
|
3812
3814
|
const o = t.querySelector('[data-sheet="payment"]');
|
|
3813
|
-
o && (o.addEventListener("click", (
|
|
3814
|
-
|
|
3815
|
+
o && (o.addEventListener("click", (B) => {
|
|
3816
|
+
B.target === o && G(e);
|
|
3815
3817
|
}), kn(e, o));
|
|
3816
3818
|
const i = t.querySelector('[data-action="toggle-balance"]');
|
|
3817
|
-
i && ((T = i.querySelector("input[type='checkbox']")) == null || T.addEventListener("change", (
|
|
3818
|
-
e.useBalance =
|
|
3819
|
+
i && ((T = i.querySelector("input[type='checkbox']")) == null || T.addEventListener("change", (B) => {
|
|
3820
|
+
e.useBalance = B.target.checked, e._updatePayButtonAmount();
|
|
3819
3821
|
}));
|
|
3820
3822
|
const s = t.querySelector('[data-action="toggle-bonuses"]');
|
|
3821
|
-
s && ((
|
|
3822
|
-
e.useBonuses =
|
|
3823
|
+
s && ((I = s.querySelector("input[type='checkbox']")) == null || I.addEventListener("change", (B) => {
|
|
3824
|
+
e.useBonuses = B.target.checked, e.config.onAppliedBonus(e.useBonuses), e._updatePayButtonAmount();
|
|
3823
3825
|
}));
|
|
3824
3826
|
const u = t.querySelector('[data-action="toggle-coupon"]');
|
|
3825
|
-
u && ((
|
|
3826
|
-
e.useCoupon =
|
|
3827
|
+
u && ((w = u.querySelector("input[type='checkbox']")) == null || w.addEventListener("change", (B) => {
|
|
3828
|
+
e.useCoupon = B.target.checked, e._updatePayButtonAmount();
|
|
3827
3829
|
})), document.removeEventListener("keydown", e._boundKeyDown), document.addEventListener("keydown", e._boundKeyDown), dt(e);
|
|
3828
3830
|
}
|
|
3829
3831
|
function Pn(e, t) {
|
|
3830
3832
|
var o, i;
|
|
3831
|
-
e.isOpen && (t.key === "Escape" && (t.preventDefault(), e._pendingDeleteMethod ? ve(e) : e.isAddCardViewOpen ? ae(e) : e.isPaymentSheetOpen ?
|
|
3833
|
+
e.isOpen && (t.key === "Escape" && (t.preventDefault(), e._pendingDeleteMethod ? ve(e) : e.isAddCardViewOpen ? ae(e) : e.isPaymentSheetOpen ? G(e) : e.close()), t.key === "Enter" && ((i = (o = t.target) == null ? void 0 : o.dataset) == null ? void 0 : i.action) === "pay" && (t.preventDefault(), e.handlePayment()));
|
|
3832
3834
|
}
|
|
3833
3835
|
function kn(e, t) {
|
|
3834
3836
|
const o = t.querySelector('[data-action="sheet-drag-handle"]'), i = t.querySelector(".choco-widget-sheet-content");
|
|
@@ -3837,15 +3839,15 @@ function kn(e, t) {
|
|
|
3837
3839
|
let u = 0, a = 0;
|
|
3838
3840
|
const l = (C) => {
|
|
3839
3841
|
a = C.clientY;
|
|
3840
|
-
const
|
|
3841
|
-
i.style.transform = `translateY(${
|
|
3842
|
+
const P = Math.max(0, a - u);
|
|
3843
|
+
i.style.transform = `translateY(${P}px)`;
|
|
3842
3844
|
}, f = (C) => {
|
|
3843
3845
|
o.releasePointerCapture(C.pointerId), o.removeEventListener("pointermove", l), o.removeEventListener("pointerup", f), o.removeEventListener("pointercancel", f);
|
|
3844
|
-
const
|
|
3845
|
-
if (i.classList.remove("choco-widget-sheet-content--dragging"),
|
|
3846
|
+
const P = Math.max(0, a - u);
|
|
3847
|
+
if (i.classList.remove("choco-widget-sheet-content--dragging"), P >= s) {
|
|
3846
3848
|
i.style.transform = "translateY(100%)";
|
|
3847
3849
|
const _ = () => {
|
|
3848
|
-
i.removeEventListener("transitionend", _), i.style.transform = "",
|
|
3850
|
+
i.removeEventListener("transitionend", _), i.style.transform = "", G(e);
|
|
3849
3851
|
};
|
|
3850
3852
|
i.addEventListener("transitionend", _);
|
|
3851
3853
|
} else
|
|
@@ -3861,13 +3863,13 @@ class ie {
|
|
|
3861
3863
|
return at(t);
|
|
3862
3864
|
}
|
|
3863
3865
|
static _setAuthStorageValue(t, o) {
|
|
3864
|
-
|
|
3866
|
+
Oe(t, o);
|
|
3865
3867
|
}
|
|
3866
3868
|
static _removeAuthStorageValue(t) {
|
|
3867
3869
|
be(t);
|
|
3868
3870
|
}
|
|
3869
3871
|
static async logout() {
|
|
3870
|
-
|
|
3872
|
+
et();
|
|
3871
3873
|
}
|
|
3872
3874
|
// ─── Конструктор ──────────────────────────────────────────────────────────────
|
|
3873
3875
|
constructor(t) {
|
|
@@ -3918,7 +3920,7 @@ class ie {
|
|
|
3918
3920
|
return Number.isFinite(t) && t > 0 ? t : 0;
|
|
3919
3921
|
}
|
|
3920
3922
|
_getPaymentBreakdown() {
|
|
3921
|
-
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),
|
|
3923
|
+
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), P = this.useBalance ? t : C, _ = this.useBalance && !u, b = this.useCoupon && this.selectedCoupon ? {
|
|
3922
3924
|
id: this.selectedCoupon.voucher_id,
|
|
3923
3925
|
template_id: this.selectedCoupon.template_id,
|
|
3924
3926
|
type: this.selectedCoupon.type
|
|
@@ -3926,10 +3928,10 @@ class ie {
|
|
|
3926
3928
|
return {
|
|
3927
3929
|
payableAmount: C,
|
|
3928
3930
|
checkoutOptions: {
|
|
3929
|
-
checkoutAmount:
|
|
3931
|
+
checkoutAmount: P,
|
|
3930
3932
|
forceBalanceMethod: u,
|
|
3931
3933
|
useBalance: _,
|
|
3932
|
-
voucher:
|
|
3934
|
+
voucher: b
|
|
3933
3935
|
}
|
|
3934
3936
|
};
|
|
3935
3937
|
}
|
|
@@ -3968,7 +3970,7 @@ class ie {
|
|
|
3968
3970
|
pe(this);
|
|
3969
3971
|
}
|
|
3970
3972
|
_showAddCardView() {
|
|
3971
|
-
|
|
3973
|
+
Te(this);
|
|
3972
3974
|
}
|
|
3973
3975
|
_closeAddCardView() {
|
|
3974
3976
|
ae(this);
|
|
@@ -3986,10 +3988,10 @@ class ie {
|
|
|
3986
3988
|
}
|
|
3987
3989
|
// ─── Хранение токенов ────────────────────────────────────────────────────────
|
|
3988
3990
|
_saveTokensToStorage(t, o) {
|
|
3989
|
-
|
|
3991
|
+
Ne(t, o);
|
|
3990
3992
|
}
|
|
3991
3993
|
_clearAuthStorage() {
|
|
3992
|
-
|
|
3994
|
+
et();
|
|
3993
3995
|
}
|
|
3994
3996
|
_getAuthStorageValue(t) {
|
|
3995
3997
|
return ie._getAuthStorageValue(t);
|
|
@@ -4030,13 +4032,13 @@ class ie {
|
|
|
4030
4032
|
this._lifecycleListenersAttached && (document.removeEventListener("visibilitychange", this._boundVisibilityChange), window.removeEventListener("focus", this._boundWindowFocus), window.removeEventListener("pageshow", this._boundPageShow), this._lifecycleListenersAttached = !1);
|
|
4031
4033
|
}
|
|
4032
4034
|
_onVisibilityChange() {
|
|
4033
|
-
|
|
4035
|
+
He() || Le(this);
|
|
4034
4036
|
}
|
|
4035
4037
|
_onWindowFocus() {
|
|
4036
|
-
|
|
4038
|
+
Le(this);
|
|
4037
4039
|
}
|
|
4038
4040
|
_onPageShow() {
|
|
4039
|
-
|
|
4041
|
+
Le(this);
|
|
4040
4042
|
}
|
|
4041
4043
|
// ─── Авторизация (приватная) ──────────────────────────────────────────────────
|
|
4042
4044
|
async _obtainTokenByRefreshOrTrackId() {
|
|
@@ -4044,13 +4046,13 @@ class ie {
|
|
|
4044
4046
|
}
|
|
4045
4047
|
async _fetchCheckoutContextWithRetry() {
|
|
4046
4048
|
try {
|
|
4047
|
-
this.checkoutContext = await
|
|
4049
|
+
this.checkoutContext = await Me(
|
|
4048
4050
|
this.apiUrl,
|
|
4049
4051
|
this._getApiConfig()
|
|
4050
4052
|
);
|
|
4051
4053
|
} catch (t) {
|
|
4052
4054
|
if (t.status === 401)
|
|
4053
|
-
this._removeAuthStorageValue("webPayToken"), await this._obtainTokenByRefreshOrTrackId(), this.checkoutContext = await
|
|
4055
|
+
this._removeAuthStorageValue("webPayToken"), await this._obtainTokenByRefreshOrTrackId(), this.checkoutContext = await Me(
|
|
4054
4056
|
this.apiUrl,
|
|
4055
4057
|
this._getApiConfig()
|
|
4056
4058
|
);
|
|
@@ -4060,12 +4062,15 @@ class ie {
|
|
|
4060
4062
|
}
|
|
4061
4063
|
async _fetchCoupons() {
|
|
4062
4064
|
try {
|
|
4063
|
-
const t = await xt(this.apiUrl, this._getApiConfig()), i = (Array.isArray(t) ? t : Array.isArray(t == null ? void 0 : t.data) ? t.data : []).filter((s) =>
|
|
4065
|
+
const t = await xt(this.apiUrl, this._getApiConfig()), i = (Array.isArray(t) ? t : Array.isArray(t == null ? void 0 : t.data) ? t.data : []).filter((s) => Number(s.reward_amount) > 0).sort((s, u) => s.sort_weight - u.sort_weight);
|
|
4064
4066
|
this.selectedCoupon = i.length > 0 ? i[0] : null, this.useCoupon = !1;
|
|
4065
4067
|
} catch {
|
|
4066
4068
|
this.selectedCoupon = null, this.useCoupon = !1;
|
|
4067
4069
|
}
|
|
4068
4070
|
}
|
|
4071
|
+
_isCouponDisabled() {
|
|
4072
|
+
return this.selectedCoupon ? this.config.amount < this.selectedCoupon.min_pay_amount : !1;
|
|
4073
|
+
}
|
|
4069
4074
|
// ─── Рендер ───────────────────────────────────────────────────────────────────
|
|
4070
4075
|
_prerender() {
|
|
4071
4076
|
dn(this);
|
|
@@ -4089,11 +4094,11 @@ class ie {
|
|
|
4089
4094
|
return this.config.onError({ attributes: { message: u.message } }), !1;
|
|
4090
4095
|
}
|
|
4091
4096
|
await this._fetchCoupons();
|
|
4092
|
-
const i =
|
|
4097
|
+
const i = Ge(
|
|
4093
4098
|
(o = (t = this.checkoutContext) == null ? void 0 : t.data) == null ? void 0 : o.socket_connections,
|
|
4094
4099
|
(s) => tt(this, s)
|
|
4095
4100
|
);
|
|
4096
|
-
return i && (this.centrifuge = i.centrifuge), this.selectedPaymentMethod =
|
|
4101
|
+
return i && (this.centrifuge = i.centrifuge), this.selectedPaymentMethod = Re(
|
|
4097
4102
|
this.checkoutContext.data,
|
|
4098
4103
|
this._getKaspiOptions()
|
|
4099
4104
|
), this._emitPaymentMethodSelected(), this._render(), !0;
|
|
@@ -4106,7 +4111,7 @@ class ie {
|
|
|
4106
4111
|
}
|
|
4107
4112
|
destroy() {
|
|
4108
4113
|
const t = document.getElementById("choco-one-click-widget");
|
|
4109
|
-
t && (t.style.display = "none"), this._clearNewCardActionTimeout(),
|
|
4114
|
+
t && (t.style.display = "none"), this._clearNewCardActionTimeout(), te(this), this._pendingSuccessPayload = null, this._detachLifecycleListeners(), this.isAddCardViewOpen && ae(this), this.centrifuge && (this.centrifuge.disconnect(), this.centrifuge = null), document.removeEventListener("keydown", this._boundKeyDown), this.container && (this.container.classList.remove("choco-one-click-widget--visible"), setTimeout(() => {
|
|
4110
4115
|
var o;
|
|
4111
4116
|
(o = this.container) == null || o.remove(), this.container = null;
|
|
4112
4117
|
}, 300)), this.isOpen = !1, this.isPaymentSheetOpen = !1, this.isAddCardViewOpen = !1, this.selectedPaymentMethod = null;
|
|
@@ -4149,12 +4154,22 @@ class ie {
|
|
|
4149
4154
|
ht(this);
|
|
4150
4155
|
}
|
|
4151
4156
|
closePaymentSheet() {
|
|
4152
|
-
|
|
4157
|
+
G(this);
|
|
4153
4158
|
}
|
|
4154
4159
|
async updateAmount(t) {
|
|
4160
|
+
var o;
|
|
4155
4161
|
if (typeof t != "number" || !Number.isFinite(t) || t < 0)
|
|
4156
4162
|
throw new Error("amount must be a non-negative number");
|
|
4157
|
-
this.config.amount = t,
|
|
4163
|
+
if (this.config.amount = t, this._isCouponDisabled() && (this.useCoupon = !1), this.selectedCoupon) {
|
|
4164
|
+
const i = this.isPaymentSheetOpen, s = this.isAddCardViewOpen;
|
|
4165
|
+
if (this._render(), Y(this), i) {
|
|
4166
|
+
const u = (o = this.container) == null ? void 0 : o.querySelector('[data-sheet="payment"]');
|
|
4167
|
+
u && (u.classList.add("choco-widget-payment-sheet--open"), this.isPaymentSheetOpen = !0);
|
|
4168
|
+
}
|
|
4169
|
+
s && Te(this);
|
|
4170
|
+
return;
|
|
4171
|
+
}
|
|
4172
|
+
pe(this);
|
|
4158
4173
|
}
|
|
4159
4174
|
async updateAvailableBonus(t) {
|
|
4160
4175
|
if (typeof t != "number" || !Number.isFinite(t) || t < 0)
|
|
@@ -4166,17 +4181,17 @@ class ie {
|
|
|
4166
4181
|
throw new Error(`Unsupported locale: ${t}`);
|
|
4167
4182
|
if (this.config.locale = t, !this.container) return;
|
|
4168
4183
|
const o = this.isPaymentSheetOpen, i = this.isAddCardViewOpen;
|
|
4169
|
-
if (this._render(),
|
|
4184
|
+
if (this._render(), Y(this), o) {
|
|
4170
4185
|
const s = this.container.querySelector('[data-sheet="payment"]');
|
|
4171
4186
|
s && (s.classList.add("choco-widget-payment-sheet--open"), this.isPaymentSheetOpen = !0);
|
|
4172
4187
|
}
|
|
4173
|
-
i &&
|
|
4188
|
+
i && Te(this);
|
|
4174
4189
|
}
|
|
4175
4190
|
async setLoading(t) {
|
|
4176
|
-
this.loading = !!t,
|
|
4191
|
+
this.loading = !!t, Y(this);
|
|
4177
4192
|
}
|
|
4178
4193
|
async setDisabled(t) {
|
|
4179
|
-
this.disabled = !!t,
|
|
4194
|
+
this.disabled = !!t, Y(this);
|
|
4180
4195
|
}
|
|
4181
4196
|
async setPreorderId(t) {
|
|
4182
4197
|
this.config.preorderId = t;
|
|
@@ -4200,11 +4215,11 @@ class ie {
|
|
|
4200
4215
|
return this.config.onError({ attributes: { message: a.message } }), !1;
|
|
4201
4216
|
}
|
|
4202
4217
|
await this._fetchCoupons(), this.centrifuge && (this.centrifuge.disconnect(), this.centrifuge = null);
|
|
4203
|
-
const s =
|
|
4218
|
+
const s = Ge(
|
|
4204
4219
|
(i = (o = this.checkoutContext) == null ? void 0 : o.data) == null ? void 0 : i.socket_connections,
|
|
4205
4220
|
(u) => tt(this, u)
|
|
4206
4221
|
);
|
|
4207
|
-
return s && (this.centrifuge = s.centrifuge), this.selectedPaymentMethod =
|
|
4222
|
+
return s && (this.centrifuge = s.centrifuge), this.selectedPaymentMethod = Re(
|
|
4208
4223
|
this.checkoutContext.data,
|
|
4209
4224
|
this._getKaspiOptions()
|
|
4210
4225
|
), this._emitPaymentMethodSelected(), this.paymentMethodDisabled = !1, this._render(), !0;
|