@bootpay/client-js 5.2.0-beta.15 → 5.2.0-beta.16
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.mjs +2252 -2194
- package/dist/index.umd.js +49 -49
- package/dist/src/bootpay-widget.d.ts +2 -1
- package/dist/src/lib/template/user-token.d.ts +9 -0
- package/dist/src/support/stores/widget-store.d.ts +1 -1
- package/dist/src/types/bootpay-widget-interface.d.ts +9 -0
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.appendChild(document.createTextNode('.bootpay-progress-background{position:fixed;display:block;background-color:transparent;left:0;right:0;top:0;bottom:0;text-align:center;z-index:200000;white-space:nowrap}.bootpay-progress-background.blur-off{background-color:transparent}.bootpay-progress-background:before{display:inline-block;height:100%;content:" ";vertical-align:middle}.bootpay-progress-background .progress-message-window{display:inline-block;text-align:center;max-width:600px;border-radius:3px;width:100%;background-color:transparent;padding:0;vertical-align:middle}@media (min-width: 600px){.bootpay-progress-background .progress-message-window{padding:1rem}}.bootpay-progress-background .progress-message-window .bootpay-spinner{display:inline-block;width:50px;height:50px;border-radius:50%;border-top:2px solid rgba(255,255,255,.2);border-right:2px solid rgba(255,255,255,.2);border-bottom:2px solid rgba(255,255,255,.2);border-left:2px solid #ffffff;animation:spin 1s infinite linear}.bootpay-progress-background .progress-message-window .alfred-text{margin-top:1rem}.bootpay-progress-background .progress-message-window .alfred-text span.alfred-inner-text{font-weight:400;color:#eee}@keyframes spin{0%{transform:rotate(0);border-left:2px solid #ffffff;border-top:2px solid rgba(255,255,255,.2);border-right:2px solid rgba(255,255,255,.2);border-bottom:2px solid rgba(255,255,255,.2)}50%{transform:rotate(180deg);border-left:3px solid #ffffff;border-top:2px solid rgba(255,255,255,.4);border-right:2px solid rgba(255,255,255,.4);border-bottom:2px solid rgba(255,255,255,.4)}to{transform:rotate(360deg);border-left:2px solid #ffffff;border-top:2px solid rgba(255,255,255,.2);border-right:2px solid rgba(255,255,255,.2);border-bottom:2px solid rgba(255,255,255,.2)}}body.bootpay-open{position:fixed!important;left:0;right:0;bottom:0;top:0;padding:0;margin:0;height:100vh!important;overflow:hidden!important;-webkit-overflow-scrolling:auto!important}body.bootpay-open.bootpay-mobile .bootpay-payment-background{background-color:transparent}@media (min-width: 600px){body.bootpay-open.bootpay-mobile .bootpay-payment-background{background-color:#000000b3}}body.bootpay-open .bootpay-payment-background{position:fixed;left:0;right:0;top:0;bottom:0;display:block;text-align:center;background-color:#000000b3;z-index:9999}body.bootpay-open .bootpay-payment-background:before{display:inline-block;vertical-align:middle;height:100%;content:" "}body.bootpay-open .bootpay-payment-background.__alert{padding:1rem}body.bootpay-open .bootpay-payment-background.__alert:before{display:inline-block;vertical-align:middle;height:100%;content:" "}body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window{position:absolute;max-width:400px;width:100%;background-color:#fff;border-radius:12px;left:50%;top:50%;transform:translate(-50%,-50%);overflow:hidden;box-shadow:0 0 10px #0000001a}body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window.fade-in{animation:__bootpay-fade-in .1s linear}body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window.fade-out{animation:__bootpay-fade-out .1s linear}@media (max-width: 768px){body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window{left:1rem;right:1rem;width:auto;top:50%;transform:translateY(-50%)}}body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-header{padding:1rem;text-align:left;font-size:20px;font-weight:600;position:relative}body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-header>.bootpay-close-btn{top:40%;transform:translateY(-50%);padding:0;right:1rem}@media (min-width: 600px){body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-header>.bootpay-close-btn{right:8px;top:50%;transform:translateY(-55%)}body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-header>.bootpay-close-btn:before,body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-header>.bootpay-close-btn:after{background-color:#333;width:1px}}body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-body{padding:1.5rem 1rem;text-align:center;font-size:16px;color:#333;line-height:1.5}body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-footer{display:flex;justify-content:flex-end;border-top:1px solid #f2f2f2}body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-footer>button.bootpay__alert-close{flex:0 1 50%;padding:1rem;background-color:#fff;color:#333;font-size:16px;cursor:pointer;border:0;outline:none}body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-footer>button.bootpay__alert-close.border-right{border-right:1px solid #f2f2f2}body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-footer>button.bootpay__alert-close:hover{background-color:#e0e0e0}body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-footer>button.bootpay__alert-close.bootpay-primary{color:#507cf3;font-weight:600}body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-footer>button.bootpay__alert-close.bootpay-primary:hover{color:#3f6be2}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window{position:relative;display:inline-block;vertical-align:middle}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window.__mobile{max-width:470px;height:90%}@media (max-width: 768px){body.bootpay-open .bootpay-payment-background>.bootpay-payment-window{position:absolute;left:0;right:0;top:0;bottom:0;border-radius:0!important}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window.__mobile{position:absolute;max-width:inherit;left:0;right:0;top:0;bottom:0;height:100%}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>iframe{width:100%!important;height:100%!important;border-radius:0}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>iframe.transparent{background:transparent!important}}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>button.bootpay-payment-close{position:absolute;display:none;top:-32px;right:4px;color:#fff;font-size:32px;text-decoration:none;outline:none;box-shadow:none;border:0;background-color:transparent}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>button.bootpay-payment-close:before,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>button.bootpay-payment-close:after{width:2px!important;background-color:#fff!important}@media (max-width: 768px){body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>button.bootpay-payment-close{top:1rem;right:16px;color:#000;padding:0}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>button.bootpay-payment-close:before,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>button.bootpay-payment-close:after{width:2px!important;background-color:#000!important}}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window{position:relative;width:400px;height:600px;display:none;background-color:#fff;border-radius:5px;overflow:hidden}@media (max-width: 768px){body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window{position:absolute;left:0;top:0;bottom:0;right:0;width:100%;height:100%;border-radius:0}}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.header{position:absolute;left:0;right:0;top:0;height:50px;color:#333;background-color:#fff;text-align:left}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.body{position:absolute;left:0;right:0;top:50px;bottom:72px;padding:1rem;text-align:left;font-size:14px}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.body>#bootpay-item-name-id{font-size:16px;color:#888;font-weight:400!important;text-align:center}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.body>#bootpay-price-id{font-size:36px;color:#333;font-weight:700;text-align:center;line-height:normal}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.body>.agree-text{position:absolute;bottom:1rem;left:0;right:0;color:#888;font-size:14px;text-align:center}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.footer{position:absolute;left:0;right:0;bottom:0;height:72px;padding:0 1rem;margin:0}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.footer>button.bootpay-button{display:block;width:100%;padding:1rem;outline:none;border:none;background-color:#507cf3;border-radius:5px;color:#fff;font-size:16px}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.footer>button.bootpay-button:hover,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.footer>button.bootpay-button:active{outline:none;box-shadow:none}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>iframe{width:100%;height:100%;display:none;border:0!important;outline:0!important;border-radius:0;box-shadow:none}@media (min-width: 600px){body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>iframe{width:0;height:0;border:0;outline:0;border-radius:0!important;box-shadow:none!important}}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>iframe.rounded-iframe{border-radius:0}@media (min-width: 600px){body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>iframe.rounded-iframe{width:0;height:0;border:0;outline:0;border-radius:20px!important;box-shadow:none!important}}body.bootpay-open .bootpay-payment-background #__bootpay-modal-iframe.slide-up{animation:__bootpay-slide-up .3s linear}body.bootpay-open .bootpay-payment-background #__bootpay-modal-iframe.slide-down{animation:__bootpay-slide-down .3s linear}body.bootpay-open .bootpay-payment-background>.bootpay-confirm-window>iframe{display:none;width:1px;height:1px;background:transparent;border:0!important;outline:0!important}.bootpay-close-btn{position:absolute;box-shadow:none;background-color:transparent;outline:0;z-index:10001;right:8px;top:8px;height:21px;width:21px;border:0!important;outline:none!important}@media (min-width: 600px){.bootpay-close-btn{right:4px;top:-32px;width:25px;height:25px;background:transparent;outline:none!important;border:0!important}}.bootpay-close-btn.active,.bootpay-close-btn:focus{outline:none!important;border:0!important}.bootpay-close-btn:before,.bootpay-close-btn:after{position:absolute;left:8px;top:2px;content:" ";height:24px;width:1px;background-color:#333}@media (min-width: 600px){.bootpay-close-btn:before,.bootpay-close-btn:after{height:23px;top:0;width:2px;background-color:#fff}}.bootpay-close-btn:before{transform:rotate(45deg)}.bootpay-close-btn:after{transform:rotate(-45deg)}@keyframes __bootpay-slide-up{0%{transform:translateY(150%);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes __bootpay-slide-down{0%{transform:translateY(0);opacity:1}to{transform:translateY(150%);opacity:0}}@keyframes __bootpay-fade-in{0%{opacity:0;scale:.9}to{opacity:1;scale:1}}@keyframes __bootpay-fade-out{0%{opacity:1;scale:1}to{opacity:0;scale:.9}}.__bootpay-store-el-fullscreen{position:absolute;left:0;right:0;top:0;bottom:0;height:100%}.bootpay-store-iframe-container{width:100%;height:100%}.bootpay-store-iframe-container>iframe{width:100%;border:0;outline:none;overflow:scroll}.bootpay-store-iframe-container>.bootpay-store-overlay{position:fixed;left:0;right:0;top:0;bottom:0;background-color:#000000b3;z-index:100000;text-align:center;display:none}.bootpay-store-iframe-container>.bootpay-store-overlay.fade-in{animation:fadeIn .2s ease}.bootpay-store-iframe-container>.bootpay-store-overlay.fade-out{animation:fadeOut .2s ease}.bootpay-store-iframe-container>.bootpay-store-overlay:before{display:inline-block;vertical-align:middle;height:100%;content:" "}@media (max-width: 600px){.bootpay-store-iframe-container>.bootpay-store-overlay:before{display:block;height:inherit;vertical-align:inherit}}.bootpay-store-iframe-container>.bootpay-store-overlay>.bootpay-store-overlay-iframe-container{display:inline-block;vertical-align:middle}@media (max-width: 600px){.bootpay-store-iframe-container>.bootpay-store-overlay>.bootpay-store-overlay-iframe-container{width:100%!important;height:100%!important}}.bootpay-store-iframe-container>.bootpay-store-overlay>.bootpay-store-alert-container{display:inline-block;background-color:#fff;vertical-align:middle;max-width:450px;width:100%;text-align:left;border-radius:12px;overflow:hidden}@media (max-width: 768px){.bootpay-store-iframe-container>.bootpay-store-overlay>.bootpay-store-alert-container{margin:1rem}}.bootpay-store-iframe-container>.bootpay-store-overlay>.bootpay-store-alert-container.zoom-in{animation:zoomIn .2s ease}.bootpay-store-iframe-container>.bootpay-store-overlay>.bootpay-store-alert-container.zoom-out{animation:zoomOut .2s ease}.bootpay-store-iframe-container>.bootpay-store-overlay>.bootpay-store-alert-container>.bootpay-store-alert-header{position:relative;padding:1rem 1.5rem;font-size:18px}.bootpay-store-iframe-container>.bootpay-store-overlay>.bootpay-store-alert-container>.bootpay-store-alert-header .bootpay-close-btn{position:absolute;box-shadow:none;background-color:transparent;outline:0;z-index:10001;right:1rem;top:50%;transform:translateY(-50%);height:21px;width:21px;border:0!important;outline:none!important}.bootpay-store-iframe-container>.bootpay-store-overlay>.bootpay-store-alert-container>.bootpay-store-alert-header .bootpay-close-btn.active,.bootpay-store-iframe-container>.bootpay-store-overlay>.bootpay-store-alert-container>.bootpay-store-alert-header .bootpay-close-btn:focus{outline:none!important;border:0!important}.bootpay-store-iframe-container>.bootpay-store-overlay>.bootpay-store-alert-container>.bootpay-store-alert-header .bootpay-close-btn:before,.bootpay-store-iframe-container>.bootpay-store-overlay>.bootpay-store-alert-container>.bootpay-store-alert-header .bootpay-close-btn:after{position:absolute;left:8px;top:0;content:" ";height:24px;width:1px;background-color:#888}.bootpay-store-iframe-container>.bootpay-store-overlay>.bootpay-store-alert-container>.bootpay-store-alert-header .bootpay-close-btn:before{transform:rotate(45deg)}.bootpay-store-iframe-container>.bootpay-store-overlay>.bootpay-store-alert-container>.bootpay-store-alert-header .bootpay-close-btn:after{transform:rotate(-45deg)}.bootpay-store-iframe-container>.bootpay-store-overlay>.bootpay-store-alert-container>.bootpay-store-alert-body{padding:1rem 1.5rem 2rem}.bootpay-store-iframe-container>.bootpay-store-overlay>.bootpay-store-alert-container>.bootpay-store-alert-footer>.bootpay-store-alert-button-grid{display:flex;width:100%}.bootpay-store-iframe-container>.bootpay-store-overlay>.bootpay-store-alert-container>.bootpay-store-alert-footer>.bootpay-store-alert-button-grid>.bootpay-store-cols{flex:0 50%}.bootpay-store-iframe-container>.bootpay-store-overlay>.bootpay-store-alert-container>.bootpay-store-alert-footer button.bootpay-btn{display:block;box-shadow:none;background-color:transparent;border:0!important;outline:none!important;width:100%;padding:1rem 0}.bootpay-store-iframe-container>.bootpay-store-overlay>.bootpay-store-alert-container>.bootpay-store-alert-footer button.bootpay-btn.bootpay-alert-cancel-button{background-color:#f1f1f1;color:#333;font-size:18px;font-weight:500}.bootpay-store-iframe-container>.bootpay-store-overlay>.bootpay-store-alert-container>.bootpay-store-alert-footer button.bootpay-btn.bootpay-alert-cancel-button:hover{opacity:.8}.bootpay-store-iframe-container>.bootpay-store-overlay>.bootpay-store-alert-container>.bootpay-store-alert-footer button.bootpay-btn.bootpay-alert-confirm-button{background-color:#507cf3;color:#fff;font-size:18px;font-weight:500}.bootpay-store-iframe-container>.bootpay-store-overlay>.bootpay-store-alert-container>.bootpay-store-alert-footer button.bootpay-btn.bootpay-alert-confirm-button:hover{opacity:.8}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}@keyframes zoomIn{0%{transform:scale(.9)}to{transform:scale(1)}}@keyframes zoomOut{0%{transform:scale(1)}to{transform:scale(.9)}}')),document.head.appendChild(o)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
|
-
(function(fe,Z){typeof exports=="object"&&typeof module<"u"?Z(exports):typeof define=="function"&&define.amd?define(["exports"],Z):(fe=typeof globalThis<"u"?globalThis:fe||self,Z(fe.Bootpay={}))})(this,function(fe){"use strict";const Z={PLATFORM:{JS:1,ANDROID:2,IOS:3,REST:4},STORAGE_PREFIX(r){return`__bootpay_track_${r}__`}},T0=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,r=>{let e=Math.random()*16|0;return(r=="x"?e:e&3|8).toString(16)}),re=r=>{let e=!1;return typeof r=="string"||Array.isArray(r)?e=r.length===0:e=r==null||je(r,"object")&&r.constructor===Object&&Object.keys(r).length===0,e},L=r=>!re(r),je=(r,e)=>typeof r===e,As=(r,e=void 0)=>{if(L(e)){const t=typeof e!="string"?new URLSearchParams(JSON.parse(JSON.stringify(e))).toString():e;return/\?/.test(r)?`${r}&${t}`:`${r}?${t}`}else return r},mt=(r,e)=>{for(let t in e)e.hasOwnProperty(t)&&(r[t]=e[t]);return r};var N=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Re(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function ws(r){if(r.__esModule)return r;var e=r.default;if(typeof e=="function"){var t=function s(){return this instanceof s?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(r).forEach(function(s){var i=Object.getOwnPropertyDescriptor(r,s);Object.defineProperty(t,s,i.get?i:{enumerable:!0,get:function(){return r[s]}})}),t}var R0={exports:{}};function Fs(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Et={exports:{}};const Ds=ws(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var O0;function z(){return O0||(O0=1,function(r,e){(function(t,s){r.exports=s()})(N,function(){var t=t||function(s,i){var n;if(typeof window<"u"&&window.crypto&&(n=window.crypto),typeof self<"u"&&self.crypto&&(n=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(n=globalThis.crypto),!n&&typeof window<"u"&&window.msCrypto&&(n=window.msCrypto),!n&&typeof N<"u"&&N.crypto&&(n=N.crypto),!n&&typeof Fs=="function")try{n=Ds}catch{}var y=function(){if(n){if(typeof n.getRandomValues=="function")try{return n.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof n.randomBytes=="function")try{return n.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},x=Object.create||function(){function d(){}return function(l){var v;return d.prototype=l,v=new d,d.prototype=null,v}}(),p={},a=p.lib={},c=a.Base=function(){return{extend:function(d){var l=x(this);return d&&l.mixIn(d),(!l.hasOwnProperty("init")||this.init===l.init)&&(l.init=function(){l.$super.init.apply(this,arguments)}),l.init.prototype=l,l.$super=this,l},create:function(){var d=this.extend();return d.init.apply(d,arguments),d},init:function(){},mixIn:function(d){for(var l in d)d.hasOwnProperty(l)&&(this[l]=d[l]);d.hasOwnProperty("toString")&&(this.toString=d.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),g=a.WordArray=c.extend({init:function(d,l){d=this.words=d||[],l!=i?this.sigBytes=l:this.sigBytes=d.length*4},toString:function(d){return(d||u).stringify(this)},concat:function(d){var l=this.words,v=d.words,E=this.sigBytes,_=d.sigBytes;if(this.clamp(),E%4)for(var A=0;A<_;A++){var w=v[A>>>2]>>>24-A%4*8&255;l[E+A>>>2]|=w<<24-(E+A)%4*8}else for(var I=0;I<_;I+=4)l[E+I>>>2]=v[I>>>2];return this.sigBytes+=_,this},clamp:function(){var d=this.words,l=this.sigBytes;d[l>>>2]&=4294967295<<32-l%4*8,d.length=s.ceil(l/4)},clone:function(){var d=c.clone.call(this);return d.words=this.words.slice(0),d},random:function(d){for(var l=[],v=0;v<d;v+=4)l.push(y());return new g.init(l,d)}}),o=p.enc={},u=o.Hex={stringify:function(d){for(var l=d.words,v=d.sigBytes,E=[],_=0;_<v;_++){var A=l[_>>>2]>>>24-_%4*8&255;E.push((A>>>4).toString(16)),E.push((A&15).toString(16))}return E.join("")},parse:function(d){for(var l=d.length,v=[],E=0;E<l;E+=2)v[E>>>3]|=parseInt(d.substr(E,2),16)<<24-E%8*4;return new g.init(v,l/2)}},f=o.Latin1={stringify:function(d){for(var l=d.words,v=d.sigBytes,E=[],_=0;_<v;_++){var A=l[_>>>2]>>>24-_%4*8&255;E.push(String.fromCharCode(A))}return E.join("")},parse:function(d){for(var l=d.length,v=[],E=0;E<l;E++)v[E>>>2]|=(d.charCodeAt(E)&255)<<24-E%4*8;return new g.init(v,l)}},m=o.Utf8={stringify:function(d){try{return decodeURIComponent(escape(f.stringify(d)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(d){return f.parse(unescape(encodeURIComponent(d)))}},h=a.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new g.init,this._nDataBytes=0},_append:function(d){typeof d=="string"&&(d=m.parse(d)),this._data.concat(d),this._nDataBytes+=d.sigBytes},_process:function(d){var l,v=this._data,E=v.words,_=v.sigBytes,A=this.blockSize,w=A*4,I=_/w;d?I=s.ceil(I):I=s.max((I|0)-this._minBufferSize,0);var B=I*A,C=s.min(B*4,_);if(B){for(var F=0;F<B;F+=A)this._doProcessBlock(E,F);l=E.splice(0,B),v.sigBytes-=C}return new g.init(l,C)},clone:function(){var d=c.clone.call(this);return d._data=this._data.clone(),d},_minBufferSize:0});a.Hasher=h.extend({cfg:c.extend(),init:function(d){this.cfg=this.cfg.extend(d),this.reset()},reset:function(){h.reset.call(this),this._doReset()},update:function(d){return this._append(d),this._process(),this},finalize:function(d){d&&this._append(d);var l=this._doFinalize();return l},blockSize:16,_createHelper:function(d){return function(l,v){return new d.init(v).finalize(l)}},_createHmacHelper:function(d){return function(l,v){return new b.HMAC.init(d,v).finalize(l)}}});var b=p.algo={};return p}(Math);return t})}(Et)),Et.exports}(function(r,e){(function(t,s){r.exports=s(z())})(N,function(t){return t.enc.Utf8})})(R0);var $s=R0.exports;const U0=Re($s);var gt={exports:{}},H0;function Be(){return H0||(H0=1,function(r,e){(function(t,s){r.exports=s(z())})(N,function(t){return function(){var s=t,i=s.lib,n=i.WordArray,y=s.enc;y.Base64={stringify:function(p){var a=p.words,c=p.sigBytes,g=this._map;p.clamp();for(var o=[],u=0;u<c;u+=3)for(var f=a[u>>>2]>>>24-u%4*8&255,m=a[u+1>>>2]>>>24-(u+1)%4*8&255,h=a[u+2>>>2]>>>24-(u+2)%4*8&255,b=f<<16|m<<8|h,d=0;d<4&&u+d*.75<c;d++)o.push(g.charAt(b>>>6*(3-d)&63));var l=g.charAt(64);if(l)for(;o.length%4;)o.push(l);return o.join("")},parse:function(p){var a=p.length,c=this._map,g=this._reverseMap;if(!g){g=this._reverseMap=[];for(var o=0;o<c.length;o++)g[c.charCodeAt(o)]=o}var u=c.charAt(64);if(u){var f=p.indexOf(u);f!==-1&&(a=f)}return x(p,a,g)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function x(p,a,c){for(var g=[],o=0,u=0;u<a;u++)if(u%4){var f=c[p.charCodeAt(u-1)]<<u%4*2,m=c[p.charCodeAt(u)]>>>6-u%4*2,h=f|m;g[o>>>2]|=h<<24-o%4*8,o++}return n.create(g,o)}}(),t.enc.Base64})}(gt)),gt.exports}var ks=Be();const ke=Re(ks);class Oe{$blank(e){return re(e)}$present(e){return!this.$blank(e)}$type(e,t){return je(e,t)}$uuid(){return T0()}$encrypt(e){return this.$type(e,"object")&&(e=JSON.stringify(e)),ke.stringify(U0.parse(e))}$decrypt(e){return U0.stringify(ke.parse(e))}getUserAgent(){return window.navigator.userAgent}}const Ke={debug:1,info:2,warning:3,error:4},U={level:Ke.warning,setLogLevel(r){this.level=r},messageStringify(r,e){try{return e=`${r}: ${je(e,"object")?JSON.stringify(e):e}`}catch(t){console.error(`log parse error: ${t}`)}},debug(r,e){this.level<=Ke.debug&&console.log(this.messageStringify(r,e))},info(r,e){this.level<=Ke.info&&console.info(this.messageStringify(r,e))},warn(r,e){this.level<=Ke.warning&&console.warn(this.messageStringify(r,e))},error(r,e){this.level<=Ke.error&&console.error(this.messageStringify(r,e))}};class Ss extends Oe{constructor(){super(),this.$storage={}}get(e){let t="";try{t=window.localStorage.getItem(e)}catch{t=this.$storage[e]}return this.$present(t)?this.$decrypt(t):void 0}set(e,t){try{window.localStorage.setItem(e,this.$encrypt(t))}catch{this.$storage[e]=this.$encrypt(t)}return t}currentUserUUID(){const e=Z.STORAGE_PREFIX("uuid"),t=this.get(e);return this.$blank(t)?this.set(e,this.$uuid()):t}setUUID(e){const t=Z.STORAGE_PREFIX("uuid");return this.set(t,e)}getToJSON(e){const t=this.get(e);return this.$present(t)?this.caseMarshalToJson(t):t}setToJSON(e,t){return this.set(e,JSON.stringify(t)),t}caseMarshalToJson(e){try{return JSON.parse(e)}catch{return JSON.parse(e.replace(/\\\"/g,'"'))}}}class Ps extends Ss{constructor(){super(),this.currentUserUUID()}currentSessionKey(){const e=Math.round(new Date().getTime()/1e3),t=Z.STORAGE_PREFIX("session"),s=this.getToJSON(t);return this.$blank(s)||s.time+1800<e?this.setToJSON(t,{time:e,term:this.$blank(s)?-1:e-s.time,uuid:`${this.$uuid()}-${e}`}).uuid:s.uuid}currentTimeTerm(){const e=Z.STORAGE_PREFIX("session"),t=this.getToJSON(e);return this.$blank(t.term)?-1:t.term}currentTime(){const e=Z.STORAGE_PREFIX("session"),t=this.getToJSON(e);return this.$blank(t.time)?-1:t.time}setTime(e){const t=Math.round(new Date().getTime()/1e3),s=Z.STORAGE_PREFIX("session"),i=this.getToJSON(s),n=this.$blank(i)?{time:e>0?e:t,term:e>0?t-e:-1,uuid:`${this.$uuid()}-${t}`}:i;n.time=e,this.setToJSON(s,n)}generateKey(){return`${this.$uuid()}-${new Date().getTime()}`}setUser(e){return this.set(Z.STORAGE_PREFIX("user"),e===void 0?void 0:JSON.stringify(e)),e}getUser(){try{return JSON.parse(this.get(Z.STORAGE_PREFIX("user")))}catch(e){U.error("User Storage",`사용자 정보를 추출하는데 실패하였습니다. [ ${e.message} ]`);return}}}const Se=new Ps,be={name:"@bootpay/client-js",version:"5.2.0-beta.15",main:"dist/index.mjs",exports:{".":{import:"./dist/index.mjs",types:"./dist/index.d.ts"}},styles:"dist/index.css",scripts:{test:'echo "Error: no test specified" && exit 1',build:"rm -rf ./dist && vite build",deploy:"NODE_ENV=production ./node_modules/.bin/webpack --output-path=./dist --mode=production && gzip -kf dist/*.min.js && ./webview.sh $npm_package_version"},dependencies:{typescript:"^5.5.4"},devDependencies:{"@types/ws":"^8.5.5","@types/node":"^18.15.3","@webpack-cli/serve":"^2.0.5","webpack-dev-server":"^4.15.1",webpack:"^5.87.0","webpack-cli":"^5.1.4",axios:"^0.27.2","crypto-js":"^4.1.1","@types/crypto-js":"^4.1.1","@babel/core":"^7.22.5","@babel/plugin-transform-regenerator":"^7.22.5","@babel/plugin-transform-runtime":"^7.22.5","@babel/plugin-transform-object-assign":"^7.22.5","@babel/plugin-proposal-class-properties":"^7.18.6","@babel/plugin-transform-destructuring":"^7.24.8","@babel/plugin-proposal-export-default-from":"^7.27.1","@babel/plugin-transform-class-properties":"^7.27.1","@babel/plugin-proposal-decorators":"^7.28.0","@babel/plugin-transform-private-methods":"^7.27.1","@babel/plugin-transform-typescript":"^7.28.0","@babel/preset-env":"^7.22.5","@babel/preset-typescript":"^7.22.5","@babel/runtime-corejs3":"^7.22.5","@babel/plugin-transform-classes":"^7.22.5","core-js":"^3.31.0","babel-loader":"^9.1.2","css-loader":"^6.8.1",sass:"^1.63.4","sass-loader":"^13.3.2","style-loader":"^3.3.3",vite:"^5.4.3","vite-plugin-dts":"^3.6.4","vite-plugin-tsconfig":"^1.0.4","vite-plugin-css-injected-by-js":"3.3.1"},resolutions:{"@webpack-cli/serve":"^1.3.1"},keywords:[],author:"",license:"ISC",description:""},O={mode:"production",locale:"ko",isSetLocale:!1,packageVersion:be.version,applicationId:"",API_URL:{development:"https://dev-api.bootpay.co.kr/v2",stage:"https://stage-api.bootpay.co.kr/v2",production:"https://api.bootpay.co.kr/v2"},ANALYTICS_URL:{development:"https://dev-analytics.bootpay.co.kr",stage:"https://stage-analytics.bootpay.co.kr",production:"https://analytics.bootpay.co.kr"},DOOR_URL:{development:"https://door-dev.bootpay.co.kr",stage:"https://door-stage.bootpay.co.kr",production:"https://door.bootpay.co.kr"},WIDGET_URL:{development:"https://dev-widget.bootpay.co.kr",stage:"https://stage-widget.bootpay.co.kr",production:"https://widget.bootpay.co.kr"},sdkNames:{android:100,android_react_native:101,android_flutter:102,android_unity:103,ios:200,ios_react_native:201,ios_flutter:202,ios_unity:203,ios_objc:204,ios_swift_ui:205,mac_swift:206,mac_flutter:207},sdkVersion:"",sdkName:0,set(r){this.mode=r},setApplicationId(r){return this.applicationId=r,this.currentApplicationId(void 0)},setLocale(r){this.locale=r,this.isSetLocale=!0},currentApplicationId(r=void 0){return r===void 0?this.applicationId:r},setDevelopmentHost(r){this.API_URL.development=this.API_URL.development.replace(/dev-api.bootpay.co.kr\/v2/gi,r)},setVersion(r,e,t=void 0){this.sdkName=this.sdkNames[e]===void 0?0:this.sdkNames[e],this.sdkVersion=r,this.packageVersion=t===void 0||t===""?be.version:t},toApi(r){return[this.API_URL[this.mode],r].join("/")},toDoor(r){return[this.DOOR_URL[this.mode],r].join("/")},toWidget(r){return[this.WIDGET_URL[this.mode],r].join("/")},isMobile(){if(typeof window>"u")return!1;const r=window.navigator.userAgent||window.navigator.vendor;return/Mobile|iP(hone|od|ad)|Android|BlackBerry|IEMobile|Kindle|NetFront|Silk-Accelerated|(hpw|web)OS|Fennec|Minimo|Opera M(obi|ini)|Blazer|Dolfin|Dolphin|Skyfire|Zune/.test(r)},isMobileSafari(){if(typeof window>"u")return!1;const r=window.navigator.userAgent;return(r.match(/iPad/i)||r.match(/iPhone/i))&&!r.match(/CriOS/i)},toAnalytics(r){return[this.ANALYTICS_URL[this.mode],r].join("/")}};class le extends Error{constructor(e){super(),this.name="BootpayEventError",this.eventMessage=e}}const Pe={__BOOTPAY_NAMESPACE:{},isBind:!1,initialize(){this.isBind||(typeof window<"u"&&(window.addBootpayEventListener=this.on,window.removeBootpayEventListener=this.off,window.resetBootpayEventListener=function(r,e,t){this.removeBootpayEventListener(r).addBootpayEventListener(r,e,t)}),typeof document<"u"&&(document.addBootpayEventListener=this.on,document.removeBootpayEventListener=this.off,document.resetBootpayEventListener=function(r,e,t){this.removeBootpayEventListener(r).addBootpayEventListener(r,e,t)}),typeof Element<"u"&&(Element.prototype.addBootpayEventListener=this.on,Element.prototype.removeBootpayEventListener=this.off,Element.prototype.resetBootpayEventListener=function(r,e,t){this.removeBootpayEventListener(r).addBootpayEventListener(r,e,t)}),this.isBind=!0)},on(r,e,t=void 0){return re(Pe.__BOOTPAY_NAMESPACE)&&(Pe.__BOOTPAY_NAMESPACE={}),this.addEventListener(r.split(".")[0],e,t||!1),Pe.__BOOTPAY_NAMESPACE[r]=e,this},off(r){return L(Pe.__BOOTPAY_NAMESPACE)&&L(Pe.__BOOTPAY_NAMESPACE[r])&&this.removeEventListener(r.split(".")[0],Pe.__BOOTPAY_NAMESPACE[r]),this}};class nt extends Oe{constructor(e){super(),this.$resolve=null,this.$reject=null,this.$messageEventName=(e==null?void 0:e.messageEventName)??"message.BootpayEvent",this.$eventHooks=(e==null?void 0:e.messageEventHooks)??{},this.afterBind=e==null?void 0:e.afterBind,Pe.initialize()}bind(e,t){this.$messageEventName&&window.resetBootpayEventListener(this.$messageEventName,s=>{const i=this.parseEvent(s.data);if(U.debug("event received",JSON.stringify(i)),L(i)&&L(i.event)){const n=this.hookFunction(i.hook);if(L(n)&&L(n[i.event]))return n[i.event](i.data,this);U.debug("event",`${this.$messageEventName}: ${i.event} is not defined`)}}),this.afterBind&&this.afterBind(),this.setCallbackFunction(e,t)}hookFunction(e){return this.$eventHooks[e]}reject(e){L(this.$reject)&&this.$reject(e)}resolve(e){L(this.$resolve)&&this.$resolve(e)}setCallbackFunction(e,t){this.$resolve=e,this.$reject=t}parseEvent(e){let t={};if(this.$present(e)&&this.$type(e,"string")){try{t=JSON.parse(e)}catch(s){U.info("json parsing failed",`data: ${e}, message: ${Ge(s)} JSON 파싱 형태가 아닌 이벤트 입니다.`)}return t.bootpay_event?(delete t.bootpay_event,t):null}else return null}}const Ge=r=>typeof r=="string"?r.toUpperCase():r instanceof Error?r.message:r;class _e extends Oe{constructor(e={}){super();const{iframeId:t="bootpay-iframe",template:s=this.defaultIframeHtml(),el:i=void 0}=e;this.el=i,this.$windowId=t,this.$template=s}defaultIframeHtml(){return`
|
|
2
|
+
(function(he,Z){typeof exports=="object"&&typeof module<"u"?Z(exports):typeof define=="function"&&define.amd?define(["exports"],Z):(he=typeof globalThis<"u"?globalThis:he||self,Z(he.Bootpay={}))})(this,function(he){"use strict";const Z={PLATFORM:{JS:1,ANDROID:2,IOS:3,REST:4},STORAGE_PREFIX(r){return`__bootpay_track_${r}__`}},O0=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,r=>{let e=Math.random()*16|0;return(r=="x"?e:e&3|8).toString(16)}),re=r=>{let e=!1;return typeof r=="string"||Array.isArray(r)?e=r.length===0:e=r==null||Ke(r,"object")&&r.constructor===Object&&Object.keys(r).length===0,e},U=r=>!re(r),Ke=(r,e)=>typeof r===e,Fs=(r,e=void 0)=>{if(U(e)){const t=typeof e!="string"?new URLSearchParams(JSON.parse(JSON.stringify(e))).toString():e;return/\?/.test(r)?`${r}&${t}`:`${r}?${t}`}else return r},Te=(r,e)=>{for(let t in e)e.hasOwnProperty(t)&&(r[t]=e[t]);return r};var L=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Oe(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function Ds(r){if(r.__esModule)return r;var e=r.default;if(typeof e=="function"){var t=function s(){return this instanceof s?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(r).forEach(function(s){var i=Object.getOwnPropertyDescriptor(r,s);Object.defineProperty(t,s,i.get?i:{enumerable:!0,get:function(){return r[s]}})}),t}var U0={exports:{}};function $s(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var gt={exports:{}};const ks=Ds(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var H0;function z(){return H0||(H0=1,function(r,e){(function(t,s){r.exports=s()})(L,function(){var t=t||function(s,i){var n;if(typeof window<"u"&&window.crypto&&(n=window.crypto),typeof self<"u"&&self.crypto&&(n=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(n=globalThis.crypto),!n&&typeof window<"u"&&window.msCrypto&&(n=window.msCrypto),!n&&typeof L<"u"&&L.crypto&&(n=L.crypto),!n&&typeof $s=="function")try{n=ks}catch{}var y=function(){if(n){if(typeof n.getRandomValues=="function")try{return n.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof n.randomBytes=="function")try{return n.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},d=Object.create||function(){function x(){}return function(l){var v;return x.prototype=l,v=new x,x.prototype=null,v}}(),p={},a=p.lib={},c=a.Base=function(){return{extend:function(x){var l=d(this);return x&&l.mixIn(x),(!l.hasOwnProperty("init")||this.init===l.init)&&(l.init=function(){l.$super.init.apply(this,arguments)}),l.init.prototype=l,l.$super=this,l},create:function(){var x=this.extend();return x.init.apply(x,arguments),x},init:function(){},mixIn:function(x){for(var l in x)x.hasOwnProperty(l)&&(this[l]=x[l]);x.hasOwnProperty("toString")&&(this.toString=x.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),g=a.WordArray=c.extend({init:function(x,l){x=this.words=x||[],l!=i?this.sigBytes=l:this.sigBytes=x.length*4},toString:function(x){return(x||u).stringify(this)},concat:function(x){var l=this.words,v=x.words,E=this.sigBytes,_=x.sigBytes;if(this.clamp(),E%4)for(var A=0;A<_;A++){var w=v[A>>>2]>>>24-A%4*8&255;l[E+A>>>2]|=w<<24-(E+A)%4*8}else for(var I=0;I<_;I+=4)l[E+I>>>2]=v[I>>>2];return this.sigBytes+=_,this},clamp:function(){var x=this.words,l=this.sigBytes;x[l>>>2]&=4294967295<<32-l%4*8,x.length=s.ceil(l/4)},clone:function(){var x=c.clone.call(this);return x.words=this.words.slice(0),x},random:function(x){for(var l=[],v=0;v<x;v+=4)l.push(y());return new g.init(l,x)}}),o=p.enc={},u=o.Hex={stringify:function(x){for(var l=x.words,v=x.sigBytes,E=[],_=0;_<v;_++){var A=l[_>>>2]>>>24-_%4*8&255;E.push((A>>>4).toString(16)),E.push((A&15).toString(16))}return E.join("")},parse:function(x){for(var l=x.length,v=[],E=0;E<l;E+=2)v[E>>>3]|=parseInt(x.substr(E,2),16)<<24-E%8*4;return new g.init(v,l/2)}},h=o.Latin1={stringify:function(x){for(var l=x.words,v=x.sigBytes,E=[],_=0;_<v;_++){var A=l[_>>>2]>>>24-_%4*8&255;E.push(String.fromCharCode(A))}return E.join("")},parse:function(x){for(var l=x.length,v=[],E=0;E<l;E++)v[E>>>2]|=(x.charCodeAt(E)&255)<<24-E%4*8;return new g.init(v,l)}},m=o.Utf8={stringify:function(x){try{return decodeURIComponent(escape(h.stringify(x)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(x){return h.parse(unescape(encodeURIComponent(x)))}},f=a.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new g.init,this._nDataBytes=0},_append:function(x){typeof x=="string"&&(x=m.parse(x)),this._data.concat(x),this._nDataBytes+=x.sigBytes},_process:function(x){var l,v=this._data,E=v.words,_=v.sigBytes,A=this.blockSize,w=A*4,I=_/w;x?I=s.ceil(I):I=s.max((I|0)-this._minBufferSize,0);var b=I*A,C=s.min(b*4,_);if(b){for(var F=0;F<b;F+=A)this._doProcessBlock(E,F);l=E.splice(0,b),v.sigBytes-=C}return new g.init(l,C)},clone:function(){var x=c.clone.call(this);return x._data=this._data.clone(),x},_minBufferSize:0});a.Hasher=f.extend({cfg:c.extend(),init:function(x){this.cfg=this.cfg.extend(x),this.reset()},reset:function(){f.reset.call(this),this._doReset()},update:function(x){return this._append(x),this._process(),this},finalize:function(x){x&&this._append(x);var l=this._doFinalize();return l},blockSize:16,_createHelper:function(x){return function(l,v){return new x.init(v).finalize(l)}},_createHmacHelper:function(x){return function(l,v){return new B.HMAC.init(x,v).finalize(l)}}});var B=p.algo={};return p}(Math);return t})}(gt)),gt.exports}(function(r,e){(function(t,s){r.exports=s(z())})(L,function(t){return t.enc.Utf8})})(U0);var Ss=U0.exports;const N0=Oe(Ss);var bt={exports:{}},L0;function be(){return L0||(L0=1,function(r,e){(function(t,s){r.exports=s(z())})(L,function(t){return function(){var s=t,i=s.lib,n=i.WordArray,y=s.enc;y.Base64={stringify:function(p){var a=p.words,c=p.sigBytes,g=this._map;p.clamp();for(var o=[],u=0;u<c;u+=3)for(var h=a[u>>>2]>>>24-u%4*8&255,m=a[u+1>>>2]>>>24-(u+1)%4*8&255,f=a[u+2>>>2]>>>24-(u+2)%4*8&255,B=h<<16|m<<8|f,x=0;x<4&&u+x*.75<c;x++)o.push(g.charAt(B>>>6*(3-x)&63));var l=g.charAt(64);if(l)for(;o.length%4;)o.push(l);return o.join("")},parse:function(p){var a=p.length,c=this._map,g=this._reverseMap;if(!g){g=this._reverseMap=[];for(var o=0;o<c.length;o++)g[c.charCodeAt(o)]=o}var u=c.charAt(64);if(u){var h=p.indexOf(u);h!==-1&&(a=h)}return d(p,a,g)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function d(p,a,c){for(var g=[],o=0,u=0;u<a;u++)if(u%4){var h=c[p.charCodeAt(u-1)]<<u%4*2,m=c[p.charCodeAt(u)]>>>6-u%4*2,f=h|m;g[o>>>2]|=f<<24-o%4*8,o++}return n.create(g,o)}}(),t.enc.Base64})}(bt)),bt.exports}var Ps=be();const ke=Oe(Ps);class Ue{$blank(e){return re(e)}$present(e){return!this.$blank(e)}$type(e,t){return Ke(e,t)}$uuid(){return O0()}$encrypt(e){return this.$type(e,"object")&&(e=JSON.stringify(e)),ke.stringify(N0.parse(e))}$decrypt(e){return N0.stringify(ke.parse(e))}getUserAgent(){return window.navigator.userAgent}}const Ge={debug:1,info:2,warning:3,error:4},H={level:Ge.warning,setLogLevel(r){this.level=r},messageStringify(r,e){try{return e=`${r}: ${Ke(e,"object")?JSON.stringify(e):e}`}catch(t){console.error(`log parse error: ${t}`)}},debug(r,e){this.level<=Ge.debug&&console.log(this.messageStringify(r,e))},info(r,e){this.level<=Ge.info&&console.info(this.messageStringify(r,e))},warn(r,e){this.level<=Ge.warning&&console.warn(this.messageStringify(r,e))},error(r,e){this.level<=Ge.error&&console.error(this.messageStringify(r,e))}};class Is extends Ue{constructor(){super(),this.$storage={}}get(e){let t="";try{t=window.localStorage.getItem(e)}catch{t=this.$storage[e]}return this.$present(t)?this.$decrypt(t):void 0}set(e,t){try{window.localStorage.setItem(e,this.$encrypt(t))}catch{this.$storage[e]=this.$encrypt(t)}return t}currentUserUUID(){const e=Z.STORAGE_PREFIX("uuid"),t=this.get(e);return this.$blank(t)?this.set(e,this.$uuid()):t}setUUID(e){const t=Z.STORAGE_PREFIX("uuid");return this.set(t,e)}getToJSON(e){const t=this.get(e);return this.$present(t)?this.caseMarshalToJson(t):t}setToJSON(e,t){return this.set(e,JSON.stringify(t)),t}caseMarshalToJson(e){try{return JSON.parse(e)}catch{return JSON.parse(e.replace(/\\\"/g,'"'))}}}class Rs extends Is{constructor(){super(),this.currentUserUUID()}currentSessionKey(){const e=Math.round(new Date().getTime()/1e3),t=Z.STORAGE_PREFIX("session"),s=this.getToJSON(t);return this.$blank(s)||s.time+1800<e?this.setToJSON(t,{time:e,term:this.$blank(s)?-1:e-s.time,uuid:`${this.$uuid()}-${e}`}).uuid:s.uuid}currentTimeTerm(){const e=Z.STORAGE_PREFIX("session"),t=this.getToJSON(e);return this.$blank(t.term)?-1:t.term}currentTime(){const e=Z.STORAGE_PREFIX("session"),t=this.getToJSON(e);return this.$blank(t.time)?-1:t.time}setTime(e){const t=Math.round(new Date().getTime()/1e3),s=Z.STORAGE_PREFIX("session"),i=this.getToJSON(s),n=this.$blank(i)?{time:e>0?e:t,term:e>0?t-e:-1,uuid:`${this.$uuid()}-${t}`}:i;n.time=e,this.setToJSON(s,n)}generateKey(){return`${this.$uuid()}-${new Date().getTime()}`}setUser(e){return this.set(Z.STORAGE_PREFIX("user"),e===void 0?void 0:JSON.stringify(e)),e}getUser(){try{return JSON.parse(this.get(Z.STORAGE_PREFIX("user")))}catch(e){H.error("User Storage",`사용자 정보를 추출하는데 실패하였습니다. [ ${e.message} ]`);return}}}const Se=new Rs,Be={name:"@bootpay/client-js",version:"5.2.0-beta.16",main:"dist/index.mjs",exports:{".":{import:"./dist/index.mjs",types:"./dist/index.d.ts"}},styles:"dist/index.css",scripts:{test:'echo "Error: no test specified" && exit 1',build:"rm -rf ./dist && vite build",deploy:"NODE_ENV=production ./node_modules/.bin/webpack --output-path=./dist --mode=production && gzip -kf dist/*.min.js && ./webview.sh $npm_package_version"},dependencies:{typescript:"^5.5.4"},devDependencies:{"@types/ws":"^8.5.5","@types/node":"^18.15.3","@webpack-cli/serve":"^2.0.5","webpack-dev-server":"^4.15.1",webpack:"^5.87.0","webpack-cli":"^5.1.4",axios:"^0.27.2","crypto-js":"^4.1.1","@types/crypto-js":"^4.1.1","@babel/core":"^7.22.5","@babel/plugin-transform-regenerator":"^7.22.5","@babel/plugin-transform-runtime":"^7.22.5","@babel/plugin-transform-object-assign":"^7.22.5","@babel/plugin-proposal-class-properties":"^7.18.6","@babel/plugin-transform-destructuring":"^7.24.8","@babel/plugin-proposal-export-default-from":"^7.27.1","@babel/plugin-transform-class-properties":"^7.27.1","@babel/plugin-proposal-decorators":"^7.28.0","@babel/plugin-transform-private-methods":"^7.27.1","@babel/plugin-transform-typescript":"^7.28.0","@babel/preset-env":"^7.22.5","@babel/preset-typescript":"^7.22.5","@babel/runtime-corejs3":"^7.22.5","@babel/plugin-transform-classes":"^7.22.5","core-js":"^3.31.0","babel-loader":"^9.1.2","css-loader":"^6.8.1",sass:"^1.63.4","sass-loader":"^13.3.2","style-loader":"^3.3.3",vite:"^5.4.3","vite-plugin-dts":"^3.6.4","vite-plugin-tsconfig":"^1.0.4","vite-plugin-css-injected-by-js":"3.3.1"},resolutions:{"@webpack-cli/serve":"^1.3.1"},keywords:[],author:"",license:"ISC",description:""},O={mode:"production",locale:"ko",isSetLocale:!1,packageVersion:Be.version,applicationId:"",API_URL:{development:"https://dev-api.bootpay.co.kr/v2",stage:"https://stage-api.bootpay.co.kr/v2",production:"https://api.bootpay.co.kr/v2"},ANALYTICS_URL:{development:"https://dev-analytics.bootpay.co.kr",stage:"https://stage-analytics.bootpay.co.kr",production:"https://analytics.bootpay.co.kr"},DOOR_URL:{development:"https://door-dev.bootpay.co.kr",stage:"https://door-stage.bootpay.co.kr",production:"https://door.bootpay.co.kr"},WIDGET_URL:{development:"https://dev-widget.bootpay.co.kr",stage:"https://stage-widget.bootpay.co.kr",production:"https://widget.bootpay.co.kr"},sdkNames:{android:100,android_react_native:101,android_flutter:102,android_unity:103,ios:200,ios_react_native:201,ios_flutter:202,ios_unity:203,ios_objc:204,ios_swift_ui:205,mac_swift:206,mac_flutter:207},sdkVersion:"",sdkName:0,set(r){this.mode=r},setApplicationId(r){return this.applicationId=r,this.currentApplicationId(void 0)},setLocale(r){this.locale=r,this.isSetLocale=!0},currentApplicationId(r=void 0){return r===void 0?this.applicationId:r},setDevelopmentHost(r){this.API_URL.development=this.API_URL.development.replace(/dev-api.bootpay.co.kr\/v2/gi,r)},setVersion(r,e,t=void 0){this.sdkName=this.sdkNames[e]===void 0?0:this.sdkNames[e],this.sdkVersion=r,this.packageVersion=t===void 0||t===""?Be.version:t},toApi(r){return[this.API_URL[this.mode],r].join("/")},toDoor(r){return[this.DOOR_URL[this.mode],r].join("/")},toWidget(r){return[this.WIDGET_URL[this.mode],r].join("/")},isMobile(){if(typeof window>"u")return!1;const r=window.navigator.userAgent||window.navigator.vendor;return/Mobile|iP(hone|od|ad)|Android|BlackBerry|IEMobile|Kindle|NetFront|Silk-Accelerated|(hpw|web)OS|Fennec|Minimo|Opera M(obi|ini)|Blazer|Dolfin|Dolphin|Skyfire|Zune/.test(r)},isMobileSafari(){if(typeof window>"u")return!1;const r=window.navigator.userAgent;return(r.match(/iPad/i)||r.match(/iPhone/i))&&!r.match(/CriOS/i)},toAnalytics(r){return[this.ANALYTICS_URL[this.mode],r].join("/")}};class le extends Error{constructor(e){super(),this.name="BootpayEventError",this.eventMessage=e}}const Pe={__BOOTPAY_NAMESPACE:{},isBind:!1,initialize(){this.isBind||(typeof window<"u"&&(window.addBootpayEventListener=this.on,window.removeBootpayEventListener=this.off,window.resetBootpayEventListener=function(r,e,t){this.removeBootpayEventListener(r).addBootpayEventListener(r,e,t)}),typeof document<"u"&&(document.addBootpayEventListener=this.on,document.removeBootpayEventListener=this.off,document.resetBootpayEventListener=function(r,e,t){this.removeBootpayEventListener(r).addBootpayEventListener(r,e,t)}),typeof Element<"u"&&(Element.prototype.addBootpayEventListener=this.on,Element.prototype.removeBootpayEventListener=this.off,Element.prototype.resetBootpayEventListener=function(r,e,t){this.removeBootpayEventListener(r).addBootpayEventListener(r,e,t)}),this.isBind=!0)},on(r,e,t=void 0){return re(Pe.__BOOTPAY_NAMESPACE)&&(Pe.__BOOTPAY_NAMESPACE={}),this.addEventListener(r.split(".")[0],e,t||!1),Pe.__BOOTPAY_NAMESPACE[r]=e,this},off(r){return U(Pe.__BOOTPAY_NAMESPACE)&&U(Pe.__BOOTPAY_NAMESPACE[r])&&this.removeEventListener(r.split(".")[0],Pe.__BOOTPAY_NAMESPACE[r]),this}};class at extends Ue{constructor(e){super(),this.$resolve=null,this.$reject=null,this.$messageEventName=(e==null?void 0:e.messageEventName)??"message.BootpayEvent",this.$eventHooks=(e==null?void 0:e.messageEventHooks)??{},this.afterBind=e==null?void 0:e.afterBind,Pe.initialize()}bind(e,t){this.$messageEventName&&window.resetBootpayEventListener(this.$messageEventName,s=>{const i=this.parseEvent(s.data);if(H.debug("event received",JSON.stringify(i)),U(i)&&U(i.event)){const n=this.hookFunction(i.hook);if(U(n)&&U(n[i.event]))return n[i.event](i.data,this);H.debug("event",`${this.$messageEventName}: ${i.event} is not defined`)}}),this.afterBind&&this.afterBind(),this.setCallbackFunction(e,t)}hookFunction(e){return this.$eventHooks[e]}reject(e){U(this.$reject)&&this.$reject(e)}resolve(e){U(this.$resolve)&&this.$resolve(e)}setCallbackFunction(e,t){this.$resolve=e,this.$reject=t}parseEvent(e){let t={};if(this.$present(e)&&this.$type(e,"string")){try{t=JSON.parse(e)}catch(s){H.info("json parsing failed",`data: ${e}, message: ${Xe(s)} JSON 파싱 형태가 아닌 이벤트 입니다.`)}return t.bootpay_event?(delete t.bootpay_event,t):null}else return null}}const Xe=r=>typeof r=="string"?r.toUpperCase():r instanceof Error?r.message:r;class _e extends Ue{constructor(e={}){super();const{iframeId:t="bootpay-iframe",template:s=this.defaultIframeHtml(),el:i=void 0}=e;this.el=i,this.$windowId=t,this.$template=s}defaultIframeHtml(){return`
|
|
3
3
|
<iframe id="${this.$iFrameId}" src="" frameborder="0" allowtransparency="true" scrolling="no" style="background: transparent; width: 100%; height: 100%;"></iframe>
|
|
4
|
-
`}byId(e){return document.getElementById(e)}createTemplateHtml(){this.byId(this.$windowId)===null&&document.body.insertAdjacentHTML("beforeend",this.$template)}bodyOpen(e=void 0){const t=document.querySelector("body");this.$present(t.className)?t.className=`${t.className} bootpay-open`:t.className="bootpay-open",this.$present(e)&&(t.className=`${t.className} ${e}`)}bodyClose(){const e=document.querySelector("body");e.className=e.className.replace("bootpay-open","")}templateResize(e,t){const s=this.byId(e);if(s!==void 0)for(let i in Object.keys(t)){let n=Object.keys(t)[i],y=t[n];this.$present(y)&&!String(y).match(/%/)&&!String(y).match(/vh/)&&(n.match(/width/)||n.match(/Width/)||n.match(/height/)||n.match(/Height/))&&(y=`${String(t[n]).replace(/px/gi,"")}px`),s.style.setProperty(n,y)}}isRendered(){const e=document.getElementById(this.$iFrameId);return
|
|
4
|
+
`}byId(e){return document.getElementById(e)}createTemplateHtml(){this.byId(this.$windowId)===null&&document.body.insertAdjacentHTML("beforeend",this.$template)}bodyOpen(e=void 0){const t=document.querySelector("body");this.$present(t.className)?t.className=`${t.className} bootpay-open`:t.className="bootpay-open",this.$present(e)&&(t.className=`${t.className} ${e}`)}bodyClose(){const e=document.querySelector("body");e.className=e.className.replace("bootpay-open","")}templateResize(e,t){const s=this.byId(e);if(s!==void 0)for(let i in Object.keys(t)){let n=Object.keys(t)[i],y=t[n];this.$present(y)&&!String(y).match(/%/)&&!String(y).match(/vh/)&&(n.match(/width/)||n.match(/Width/)||n.match(/height/)||n.match(/Height/))&&(y=`${String(t[n]).replace(/px/gi,"")}px`),s.style.setProperty(n,y)}}isRendered(){const e=document.getElementById(this.$iFrameId);return H.debug("isRendered",`iFrameElement: ${e}`),e!==null&&e.src!==null&&e.src!==""}postMessage(e,t=void 0){var i;const s=this.byId(this.$iFrameId);(i=s==null?void 0:s.contentWindow)==null||i.postMessage(JSON.stringify({bootpay_event:!0,event:e,data:t}),"*")}defaultRender(e){this.el=String(this.el).replace(/#/g,"");const t=document.getElementById(this.el);if(this.$blank(this.el)||t===null)throw new Error("렌더링할 DOM Element ID를 입력해주세요.");t.style.setProperty("height","0"),t.innerHTML=this.$template,this.byId(this.$iFrameId).setAttribute("src",e)}}class Ts extends _e{constructor(){super(),this.$alfredId="bootpay-alfred-progress-id",this.$alfredTextId="__alfred-text-message__"}template(e){return`
|
|
5
5
|
<div class="bootpay-progress-background" id="${this.$alfredId}" style="display: none;">
|
|
6
6
|
<div class="progress-message-window">
|
|
7
7
|
<div class="alfred-loading">
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
</div>
|
|
13
13
|
</div>
|
|
14
14
|
</div>
|
|
15
|
-
`}showProgress(e){this.$present(this.byId(this.$alfredId))?this.byId(this.$alfredTextId).innerText=e:document.body.insertAdjacentHTML("beforeend",this.template(e)),this.byId(this.$alfredId).style.setProperty("display","block")}hideProgress(){try{this.byId(this.$alfredId).outerHTML=""}catch{}}}const ue=new
|
|
16
|
-
`),function(a){if(x=a.indexOf(":"),n=r.trim(a.substr(0,x)).toLowerCase(),y=r.trim(a.substr(x+1)),n){if(i[n]&&e.indexOf(n)>=0)return;n==="set-cookie"?i[n]=(i[n]?i[n]:[]).concat([y]):i[n]=i[n]?i[n]+", "+y:y}}),i},kt}var St,Q0;function pi(){if(Q0)return St;Q0=1;var r=te;return St=r.isStandardBrowserEnv()?function(){var t=/(msie|trident)/i.test(navigator.userAgent),s=document.createElement("a"),i;function n(y){var x=y;return t&&(s.setAttribute("href",x),x=s.href),s.setAttribute("href",x),{href:s.href,protocol:s.protocol?s.protocol.replace(/:$/,""):"",host:s.host,search:s.search?s.search.replace(/^\?/,""):"",hash:s.hash?s.hash.replace(/^#/,""):"",hostname:s.hostname,port:s.port,pathname:s.pathname.charAt(0)==="/"?s.pathname:"/"+s.pathname}}return i=n(window.location.href),function(x){var p=r.isString(x)?n(x):x;return p.protocol===i.protocol&&p.host===i.host}}():function(){return function(){return!0}}(),St}var Pt,er;function xt(){if(er)return Pt;er=1;var r=Ne,e=te;function t(s){r.call(this,s??"canceled",r.ERR_CANCELED),this.name="CanceledError"}return e.inherits(t,r,{__CANCEL__:!0}),Pt=t,Pt}var It,tr;function fi(){return tr||(tr=1,It=function(e){var t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}),It}var Tt,rr;function sr(){if(rr)return Tt;rr=1;var r=te,e=oi(),t=ai(),s=W0,i=J0,n=ui(),y=pi(),x=G0,p=Ne,a=xt(),c=fi();return Tt=function(o){return new Promise(function(f,m){var h=o.data,b=o.headers,d=o.responseType,l;function v(){o.cancelToken&&o.cancelToken.unsubscribe(l),o.signal&&o.signal.removeEventListener("abort",l)}r.isFormData(h)&&r.isStandardBrowserEnv()&&delete b["Content-Type"];var E=new XMLHttpRequest;if(o.auth){var _=o.auth.username||"",A=o.auth.password?unescape(encodeURIComponent(o.auth.password)):"";b.Authorization="Basic "+btoa(_+":"+A)}var w=i(o.baseURL,o.url);E.open(o.method.toUpperCase(),s(w,o.params,o.paramsSerializer),!0),E.timeout=o.timeout;function I(){if(E){var F="getAllResponseHeaders"in E?n(E.getAllResponseHeaders()):null,D=!d||d==="text"||d==="json"?E.responseText:E.response,T={data:D,status:E.status,statusText:E.statusText,headers:F,config:o,request:E};e(function(H){f(H),v()},function(H){m(H),v()},T),E=null}}if("onloadend"in E?E.onloadend=I:E.onreadystatechange=function(){!E||E.readyState!==4||E.status===0&&!(E.responseURL&&E.responseURL.indexOf("file:")===0)||setTimeout(I)},E.onabort=function(){E&&(m(new p("Request aborted",p.ECONNABORTED,o,E)),E=null)},E.onerror=function(){m(new p("Network Error",p.ERR_NETWORK,o,E,E)),E=null},E.ontimeout=function(){var D=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded",T=o.transitional||x;o.timeoutErrorMessage&&(D=o.timeoutErrorMessage),m(new p(D,T.clarifyTimeoutError?p.ETIMEDOUT:p.ECONNABORTED,o,E)),E=null},r.isStandardBrowserEnv()){var B=(o.withCredentials||y(w))&&o.xsrfCookieName?t.read(o.xsrfCookieName):void 0;B&&(b[o.xsrfHeaderName]=B)}"setRequestHeader"in E&&r.forEach(b,function(D,T){typeof h>"u"&&T.toLowerCase()==="content-type"?delete b[T]:E.setRequestHeader(T,D)}),r.isUndefined(o.withCredentials)||(E.withCredentials=!!o.withCredentials),d&&d!=="json"&&(E.responseType=o.responseType),typeof o.onDownloadProgress=="function"&&E.addEventListener("progress",o.onDownloadProgress),typeof o.onUploadProgress=="function"&&E.upload&&E.upload.addEventListener("progress",o.onUploadProgress),(o.cancelToken||o.signal)&&(l=function(F){E&&(m(!F||F&&F.type?new a:F),E.abort(),E=null)},o.cancelToken&&o.cancelToken.subscribe(l),o.signal&&(o.signal.aborted?l():o.signal.addEventListener("abort",l))),h||(h=null);var C=c(w);if(C&&["http","https","file"].indexOf(C)===-1){m(new p("Unsupported protocol "+C+":",p.ERR_BAD_REQUEST,o));return}E.send(h)})},Tt}var Rt,ir;function hi(){return ir||(ir=1,Rt=null),Rt}var Q=te,nr=ii,or=Ne,vi=G0,yi=X0,mi={"Content-Type":"application/x-www-form-urlencoded"};function ar(r,e){!Q.isUndefined(r)&&Q.isUndefined(r["Content-Type"])&&(r["Content-Type"]=e)}function Ei(){var r;return(typeof XMLHttpRequest<"u"||typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]")&&(r=sr()),r}function gi(r,e,t){if(Q.isString(r))try{return(e||JSON.parse)(r),Q.trim(r)}catch(s){if(s.name!=="SyntaxError")throw s}return(t||JSON.stringify)(r)}var dt={transitional:vi,adapter:Ei(),transformRequest:[function(e,t){if(nr(t,"Accept"),nr(t,"Content-Type"),Q.isFormData(e)||Q.isArrayBuffer(e)||Q.isBuffer(e)||Q.isStream(e)||Q.isFile(e)||Q.isBlob(e))return e;if(Q.isArrayBufferView(e))return e.buffer;if(Q.isURLSearchParams(e))return ar(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString();var s=Q.isObject(e),i=t&&t["Content-Type"],n;if((n=Q.isFileList(e))||s&&i==="multipart/form-data"){var y=this.env&&this.env.FormData;return yi(n?{"files[]":e}:e,y&&new y)}else if(s||i==="application/json")return ar(t,"application/json"),gi(e);return e}],transformResponse:[function(e){var t=this.transitional||dt.transitional,s=t&&t.silentJSONParsing,i=t&&t.forcedJSONParsing,n=!s&&this.responseType==="json";if(n||i&&Q.isString(e)&&e.length)try{return JSON.parse(e)}catch(y){if(n)throw y.name==="SyntaxError"?or.from(y,or.ERR_BAD_RESPONSE,this,null,this.response):y}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:hi()},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};Q.forEach(["delete","get","head"],function(e){dt.headers[e]={}}),Q.forEach(["post","put","patch"],function(e){dt.headers[e]=Q.merge(mi)});var Ot=dt,Bi=te,bi=Ot,_i=function(e,t,s){var i=this||bi;return Bi.forEach(s,function(y){e=y.call(i,e,t)}),e},Ut,cr;function xr(){return cr||(cr=1,Ut=function(e){return!!(e&&e.__CANCEL__)}),Ut}var dr=te,Ht=_i,Ci=xr(),Ai=Ot,wi=xt();function Nt(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new wi}var Fi=function(e){Nt(e),e.headers=e.headers||{},e.data=Ht.call(e,e.data,e.headers,e.transformRequest),e.headers=dr.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),dr.forEach(["delete","get","head","post","put","patch","common"],function(i){delete e.headers[i]});var t=e.adapter||Ai.adapter;return t(e).then(function(i){return Nt(e),i.data=Ht.call(e,i.data,i.headers,e.transformResponse),i},function(i){return Ci(i)||(Nt(e),i&&i.response&&(i.response.data=Ht.call(e,i.response.data,i.response.headers,e.transformResponse))),Promise.reject(i)})},ce=te,lr=function(e,t){t=t||{};var s={};function i(c,g){return ce.isPlainObject(c)&&ce.isPlainObject(g)?ce.merge(c,g):ce.isPlainObject(g)?ce.merge({},g):ce.isArray(g)?g.slice():g}function n(c){if(ce.isUndefined(t[c])){if(!ce.isUndefined(e[c]))return i(void 0,e[c])}else return i(e[c],t[c])}function y(c){if(!ce.isUndefined(t[c]))return i(void 0,t[c])}function x(c){if(ce.isUndefined(t[c])){if(!ce.isUndefined(e[c]))return i(void 0,e[c])}else return i(void 0,t[c])}function p(c){if(c in t)return i(e[c],t[c]);if(c in e)return i(void 0,e[c])}var a={url:y,method:y,data:y,baseURL:x,transformRequest:x,transformResponse:x,paramsSerializer:x,timeout:x,timeoutMessage:x,withCredentials:x,adapter:x,responseType:x,xsrfCookieName:x,xsrfHeaderName:x,onUploadProgress:x,onDownloadProgress:x,decompress:x,maxContentLength:x,maxBodyLength:x,beforeRedirect:x,transport:x,httpAgent:x,httpsAgent:x,cancelToken:x,socketPath:x,responseEncoding:x,validateStatus:p};return ce.forEach(Object.keys(e).concat(Object.keys(t)),function(g){var o=a[g]||n,u=o(g);ce.isUndefined(u)&&o!==p||(s[g]=u)}),s},Lt,ur;function pr(){return ur||(ur=1,Lt={version:"0.27.2"}),Lt}var Di=pr().version,Ce=Ne,Mt={};["object","boolean","number","function","string","symbol"].forEach(function(r,e){Mt[r]=function(s){return typeof s===r||"a"+(e<1?"n ":" ")+r}});var fr={};Mt.transitional=function(e,t,s){function i(n,y){return"[Axios v"+Di+"] Transitional option '"+n+"'"+y+(s?". "+s:"")}return function(n,y,x){if(e===!1)throw new Ce(i(y," has been removed"+(t?" in "+t:"")),Ce.ERR_DEPRECATED);return t&&!fr[y]&&(fr[y]=!0,console.warn(i(y," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(n,y,x):!0}};function $i(r,e,t){if(typeof r!="object")throw new Ce("options must be an object",Ce.ERR_BAD_OPTION_VALUE);for(var s=Object.keys(r),i=s.length;i-- >0;){var n=s[i],y=e[n];if(y){var x=r[n],p=x===void 0||y(x,n,r);if(p!==!0)throw new Ce("option "+n+" must be "+p,Ce.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new Ce("Unknown option "+n,Ce.ERR_BAD_OPTION)}}var ki={assertOptions:$i,validators:Mt},hr=te,Si=W0,vr=ri,yr=Fi,lt=lr,Pi=J0,mr=ki,Le=mr.validators;function Me(r){this.defaults=r,this.interceptors={request:new vr,response:new vr}}Me.prototype.request=function(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=lt(this.defaults,t),t.method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var s=t.transitional;s!==void 0&&mr.assertOptions(s,{silentJSONParsing:Le.transitional(Le.boolean),forcedJSONParsing:Le.transitional(Le.boolean),clarifyTimeoutError:Le.transitional(Le.boolean)},!1);var i=[],n=!0;this.interceptors.request.forEach(function(u){typeof u.runWhen=="function"&&u.runWhen(t)===!1||(n=n&&u.synchronous,i.unshift(u.fulfilled,u.rejected))});var y=[];this.interceptors.response.forEach(function(u){y.push(u.fulfilled,u.rejected)});var x;if(!n){var p=[yr,void 0];for(Array.prototype.unshift.apply(p,i),p=p.concat(y),x=Promise.resolve(t);p.length;)x=x.then(p.shift(),p.shift());return x}for(var a=t;i.length;){var c=i.shift(),g=i.shift();try{a=c(a)}catch(o){g(o);break}}try{x=yr(a)}catch(o){return Promise.reject(o)}for(;y.length;)x=x.then(y.shift(),y.shift());return x},Me.prototype.getUri=function(e){e=lt(this.defaults,e);var t=Pi(e.baseURL,e.url);return Si(t,e.params,e.paramsSerializer)},hr.forEach(["delete","get","head","options"],function(e){Me.prototype[e]=function(t,s){return this.request(lt(s||{},{method:e,url:t,data:(s||{}).data}))}}),hr.forEach(["post","put","patch"],function(e){function t(s){return function(n,y,x){return this.request(lt(x||{},{method:e,headers:s?{"Content-Type":"multipart/form-data"}:{},url:n,data:y}))}}Me.prototype[e]=t(),Me.prototype[e+"Form"]=t(!0)});var Ii=Me,qt,Er;function Ti(){if(Er)return qt;Er=1;var r=xt();function e(t){if(typeof t!="function")throw new TypeError("executor must be a function.");var s;this.promise=new Promise(function(y){s=y});var i=this;this.promise.then(function(n){if(i._listeners){var y,x=i._listeners.length;for(y=0;y<x;y++)i._listeners[y](n);i._listeners=null}}),this.promise.then=function(n){var y,x=new Promise(function(p){i.subscribe(p),y=p}).then(n);return x.cancel=function(){i.unsubscribe(y)},x},t(function(y){i.reason||(i.reason=new r(y),s(i.reason))})}return e.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},e.prototype.subscribe=function(s){if(this.reason){s(this.reason);return}this._listeners?this._listeners.push(s):this._listeners=[s]},e.prototype.unsubscribe=function(s){if(this._listeners){var i=this._listeners.indexOf(s);i!==-1&&this._listeners.splice(i,1)}},e.source=function(){var s,i=new e(function(y){s=y});return{token:i,cancel:s}},qt=e,qt}var Wt,gr;function Ri(){return gr||(gr=1,Wt=function(e){return function(s){return e.apply(null,s)}}),Wt}var zt,Br;function Oi(){if(Br)return zt;Br=1;var r=te;return zt=function(t){return r.isObject(t)&&t.isAxiosError===!0},zt}var br=te,Ui=N0,ut=Ii,Hi=lr,Ni=Ot;function _r(r){var e=new ut(r),t=Ui(ut.prototype.request,e);return br.extend(t,ut.prototype,e),br.extend(t,e),t.create=function(i){return _r(Hi(r,i))},t}var ie=_r(Ni);ie.Axios=ut,ie.CanceledError=xt(),ie.CancelToken=Ti(),ie.isCancel=xr(),ie.VERSION=pr().version,ie.toFormData=X0,ie.AxiosError=Ne,ie.Cancel=ie.CanceledError,ie.all=function(e){return Promise.all(e)},ie.spread=Ri(),ie.isAxiosError=Oi(),Bt.exports=ie,Bt.exports.default=ie;var Li=Bt.exports,Mi=Li;const Xe=Re(Mi);var jt={exports:{}},Kt={exports:{}},Cr;function Ae(){return Cr||(Cr=1,function(r,e){(function(t,s){r.exports=s(z())})(N,function(t){return function(s){var i=t,n=i.lib,y=n.WordArray,x=n.Hasher,p=i.algo,a=[];(function(){for(var m=0;m<64;m++)a[m]=s.abs(s.sin(m+1))*4294967296|0})();var c=p.MD5=x.extend({_doReset:function(){this._hash=new y.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(m,h){for(var b=0;b<16;b++){var d=h+b,l=m[d];m[d]=(l<<8|l>>>24)&16711935|(l<<24|l>>>8)&4278255360}var v=this._hash.words,E=m[h+0],_=m[h+1],A=m[h+2],w=m[h+3],I=m[h+4],B=m[h+5],C=m[h+6],F=m[h+7],D=m[h+8],T=m[h+9],R=m[h+10],H=m[h+11],Y=m[h+12],j=m[h+13],X=m[h+14],K=m[h+15],$=v[0],S=v[1],P=v[2],k=v[3];$=g($,S,P,k,E,7,a[0]),k=g(k,$,S,P,_,12,a[1]),P=g(P,k,$,S,A,17,a[2]),S=g(S,P,k,$,w,22,a[3]),$=g($,S,P,k,I,7,a[4]),k=g(k,$,S,P,B,12,a[5]),P=g(P,k,$,S,C,17,a[6]),S=g(S,P,k,$,F,22,a[7]),$=g($,S,P,k,D,7,a[8]),k=g(k,$,S,P,T,12,a[9]),P=g(P,k,$,S,R,17,a[10]),S=g(S,P,k,$,H,22,a[11]),$=g($,S,P,k,Y,7,a[12]),k=g(k,$,S,P,j,12,a[13]),P=g(P,k,$,S,X,17,a[14]),S=g(S,P,k,$,K,22,a[15]),$=o($,S,P,k,_,5,a[16]),k=o(k,$,S,P,C,9,a[17]),P=o(P,k,$,S,H,14,a[18]),S=o(S,P,k,$,E,20,a[19]),$=o($,S,P,k,B,5,a[20]),k=o(k,$,S,P,R,9,a[21]),P=o(P,k,$,S,K,14,a[22]),S=o(S,P,k,$,I,20,a[23]),$=o($,S,P,k,T,5,a[24]),k=o(k,$,S,P,X,9,a[25]),P=o(P,k,$,S,w,14,a[26]),S=o(S,P,k,$,D,20,a[27]),$=o($,S,P,k,j,5,a[28]),k=o(k,$,S,P,A,9,a[29]),P=o(P,k,$,S,F,14,a[30]),S=o(S,P,k,$,Y,20,a[31]),$=u($,S,P,k,B,4,a[32]),k=u(k,$,S,P,D,11,a[33]),P=u(P,k,$,S,H,16,a[34]),S=u(S,P,k,$,X,23,a[35]),$=u($,S,P,k,_,4,a[36]),k=u(k,$,S,P,I,11,a[37]),P=u(P,k,$,S,F,16,a[38]),S=u(S,P,k,$,R,23,a[39]),$=u($,S,P,k,j,4,a[40]),k=u(k,$,S,P,E,11,a[41]),P=u(P,k,$,S,w,16,a[42]),S=u(S,P,k,$,C,23,a[43]),$=u($,S,P,k,T,4,a[44]),k=u(k,$,S,P,Y,11,a[45]),P=u(P,k,$,S,K,16,a[46]),S=u(S,P,k,$,A,23,a[47]),$=f($,S,P,k,E,6,a[48]),k=f(k,$,S,P,F,10,a[49]),P=f(P,k,$,S,X,15,a[50]),S=f(S,P,k,$,B,21,a[51]),$=f($,S,P,k,Y,6,a[52]),k=f(k,$,S,P,w,10,a[53]),P=f(P,k,$,S,R,15,a[54]),S=f(S,P,k,$,_,21,a[55]),$=f($,S,P,k,D,6,a[56]),k=f(k,$,S,P,K,10,a[57]),P=f(P,k,$,S,C,15,a[58]),S=f(S,P,k,$,j,21,a[59]),$=f($,S,P,k,I,6,a[60]),k=f(k,$,S,P,H,10,a[61]),P=f(P,k,$,S,A,15,a[62]),S=f(S,P,k,$,T,21,a[63]),v[0]=v[0]+$|0,v[1]=v[1]+S|0,v[2]=v[2]+P|0,v[3]=v[3]+k|0},_doFinalize:function(){var m=this._data,h=m.words,b=this._nDataBytes*8,d=m.sigBytes*8;h[d>>>5]|=128<<24-d%32;var l=s.floor(b/4294967296),v=b;h[(d+64>>>9<<4)+15]=(l<<8|l>>>24)&16711935|(l<<24|l>>>8)&4278255360,h[(d+64>>>9<<4)+14]=(v<<8|v>>>24)&16711935|(v<<24|v>>>8)&4278255360,m.sigBytes=(h.length+1)*4,this._process();for(var E=this._hash,_=E.words,A=0;A<4;A++){var w=_[A];_[A]=(w<<8|w>>>24)&16711935|(w<<24|w>>>8)&4278255360}return E},clone:function(){var m=x.clone.call(this);return m._hash=this._hash.clone(),m}});function g(m,h,b,d,l,v,E){var _=m+(h&b|~h&d)+l+E;return(_<<v|_>>>32-v)+h}function o(m,h,b,d,l,v,E){var _=m+(h&d|b&~d)+l+E;return(_<<v|_>>>32-v)+h}function u(m,h,b,d,l,v,E){var _=m+(h^b^d)+l+E;return(_<<v|_>>>32-v)+h}function f(m,h,b,d,l,v,E){var _=m+(b^(h|~d))+l+E;return(_<<v|_>>>32-v)+h}i.MD5=x._createHelper(c),i.HmacMD5=x._createHmacHelper(c)}(Math),t.MD5})}(Kt)),Kt.exports}var Gt={exports:{}},Xt={exports:{}},Ar;function wr(){return Ar||(Ar=1,function(r,e){(function(t,s){r.exports=s(z())})(N,function(t){return function(){var s=t,i=s.lib,n=i.WordArray,y=i.Hasher,x=s.algo,p=[],a=x.SHA1=y.extend({_doReset:function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(c,g){for(var o=this._hash.words,u=o[0],f=o[1],m=o[2],h=o[3],b=o[4],d=0;d<80;d++){if(d<16)p[d]=c[g+d]|0;else{var l=p[d-3]^p[d-8]^p[d-14]^p[d-16];p[d]=l<<1|l>>>31}var v=(u<<5|u>>>27)+b+p[d];d<20?v+=(f&m|~f&h)+1518500249:d<40?v+=(f^m^h)+1859775393:d<60?v+=(f&m|f&h|m&h)-1894007588:v+=(f^m^h)-899497514,b=h,h=m,m=f<<30|f>>>2,f=u,u=v}o[0]=o[0]+u|0,o[1]=o[1]+f|0,o[2]=o[2]+m|0,o[3]=o[3]+h|0,o[4]=o[4]+b|0},_doFinalize:function(){var c=this._data,g=c.words,o=this._nDataBytes*8,u=c.sigBytes*8;return g[u>>>5]|=128<<24-u%32,g[(u+64>>>9<<4)+14]=Math.floor(o/4294967296),g[(u+64>>>9<<4)+15]=o,c.sigBytes=g.length*4,this._process(),this._hash},clone:function(){var c=y.clone.call(this);return c._hash=this._hash.clone(),c}});s.SHA1=y._createHelper(a),s.HmacSHA1=y._createHmacHelper(a)}(),t.SHA1})}(Xt)),Xt.exports}var Vt={exports:{}},Fr;function Yt(){return Fr||(Fr=1,function(r,e){(function(t,s){r.exports=s(z())})(N,function(t){(function(){var s=t,i=s.lib,n=i.Base,y=s.enc,x=y.Utf8,p=s.algo;p.HMAC=n.extend({init:function(a,c){a=this._hasher=new a.init,typeof c=="string"&&(c=x.parse(c));var g=a.blockSize,o=g*4;c.sigBytes>o&&(c=a.finalize(c)),c.clamp();for(var u=this._oKey=c.clone(),f=this._iKey=c.clone(),m=u.words,h=f.words,b=0;b<g;b++)m[b]^=1549556828,h[b]^=909522486;u.sigBytes=f.sigBytes=o,this.reset()},reset:function(){var a=this._hasher;a.reset(),a.update(this._iKey)},update:function(a){return this._hasher.update(a),this},finalize:function(a){var c=this._hasher,g=c.finalize(a);c.reset();var o=c.finalize(this._oKey.clone().concat(g));return o}})})()})}(Vt)),Vt.exports}var Dr;function we(){return Dr||(Dr=1,function(r,e){(function(t,s,i){r.exports=s(z(),wr(),Yt())})(N,function(t){return function(){var s=t,i=s.lib,n=i.Base,y=i.WordArray,x=s.algo,p=x.MD5,a=x.EvpKDF=n.extend({cfg:n.extend({keySize:128/32,hasher:p,iterations:1}),init:function(c){this.cfg=this.cfg.extend(c)},compute:function(c,g){for(var o,u=this.cfg,f=u.hasher.create(),m=y.create(),h=m.words,b=u.keySize,d=u.iterations;h.length<b;){o&&f.update(o),o=f.update(c).finalize(g),f.reset();for(var l=1;l<d;l++)o=f.finalize(o),f.reset();m.concat(o)}return m.sigBytes=b*4,m}});s.EvpKDF=function(c,g,o){return a.create(o).compute(c,g)}}(),t.EvpKDF})}(Gt)),Gt.exports}var Jt={exports:{}},$r;function ee(){return $r||($r=1,function(r,e){(function(t,s,i){r.exports=s(z(),we())})(N,function(t){t.lib.Cipher||function(s){var i=t,n=i.lib,y=n.Base,x=n.WordArray,p=n.BufferedBlockAlgorithm,a=i.enc;a.Utf8;var c=a.Base64,g=i.algo,o=g.EvpKDF,u=n.Cipher=p.extend({cfg:y.extend(),createEncryptor:function(B,C){return this.create(this._ENC_XFORM_MODE,B,C)},createDecryptor:function(B,C){return this.create(this._DEC_XFORM_MODE,B,C)},init:function(B,C,F){this.cfg=this.cfg.extend(F),this._xformMode=B,this._key=C,this.reset()},reset:function(){p.reset.call(this),this._doReset()},process:function(B){return this._append(B),this._process()},finalize:function(B){B&&this._append(B);var C=this._doFinalize();return C},keySize:128/32,ivSize:128/32,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function B(C){return typeof C=="string"?I:_}return function(C){return{encrypt:function(F,D,T){return B(D).encrypt(C,F,D,T)},decrypt:function(F,D,T){return B(D).decrypt(C,F,D,T)}}}}()});n.StreamCipher=u.extend({_doFinalize:function(){var B=this._process(!0);return B},blockSize:1});var f=i.mode={},m=n.BlockCipherMode=y.extend({createEncryptor:function(B,C){return this.Encryptor.create(B,C)},createDecryptor:function(B,C){return this.Decryptor.create(B,C)},init:function(B,C){this._cipher=B,this._iv=C}}),h=f.CBC=function(){var B=m.extend();B.Encryptor=B.extend({processBlock:function(F,D){var T=this._cipher,R=T.blockSize;C.call(this,F,D,R),T.encryptBlock(F,D),this._prevBlock=F.slice(D,D+R)}}),B.Decryptor=B.extend({processBlock:function(F,D){var T=this._cipher,R=T.blockSize,H=F.slice(D,D+R);T.decryptBlock(F,D),C.call(this,F,D,R),this._prevBlock=H}});function C(F,D,T){var R,H=this._iv;H?(R=H,this._iv=s):R=this._prevBlock;for(var Y=0;Y<T;Y++)F[D+Y]^=R[Y]}return B}(),b=i.pad={},d=b.Pkcs7={pad:function(B,C){for(var F=C*4,D=F-B.sigBytes%F,T=D<<24|D<<16|D<<8|D,R=[],H=0;H<D;H+=4)R.push(T);var Y=x.create(R,D);B.concat(Y)},unpad:function(B){var C=B.words[B.sigBytes-1>>>2]&255;B.sigBytes-=C}};n.BlockCipher=u.extend({cfg:u.cfg.extend({mode:h,padding:d}),reset:function(){var B;u.reset.call(this);var C=this.cfg,F=C.iv,D=C.mode;this._xformMode==this._ENC_XFORM_MODE?B=D.createEncryptor:(B=D.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==B?this._mode.init(this,F&&F.words):(this._mode=B.call(D,this,F&&F.words),this._mode.__creator=B)},_doProcessBlock:function(B,C){this._mode.processBlock(B,C)},_doFinalize:function(){var B,C=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(C.pad(this._data,this.blockSize),B=this._process(!0)):(B=this._process(!0),C.unpad(B)),B},blockSize:128/32});var l=n.CipherParams=y.extend({init:function(B){this.mixIn(B)},toString:function(B){return(B||this.formatter).stringify(this)}}),v=i.format={},E=v.OpenSSL={stringify:function(B){var C,F=B.ciphertext,D=B.salt;return D?C=x.create([1398893684,1701076831]).concat(D).concat(F):C=F,C.toString(c)},parse:function(B){var C,F=c.parse(B),D=F.words;return D[0]==1398893684&&D[1]==1701076831&&(C=x.create(D.slice(2,4)),D.splice(0,4),F.sigBytes-=16),l.create({ciphertext:F,salt:C})}},_=n.SerializableCipher=y.extend({cfg:y.extend({format:E}),encrypt:function(B,C,F,D){D=this.cfg.extend(D);var T=B.createEncryptor(F,D),R=T.finalize(C),H=T.cfg;return l.create({ciphertext:R,key:F,iv:H.iv,algorithm:B,mode:H.mode,padding:H.padding,blockSize:B.blockSize,formatter:D.format})},decrypt:function(B,C,F,D){D=this.cfg.extend(D),C=this._parse(C,D.format);var T=B.createDecryptor(F,D).finalize(C.ciphertext);return T},_parse:function(B,C){return typeof B=="string"?C.parse(B,this):B}}),A=i.kdf={},w=A.OpenSSL={execute:function(B,C,F,D,T){if(D||(D=x.random(64/8)),T)var R=o.create({keySize:C+F,hasher:T}).compute(B,D);else var R=o.create({keySize:C+F}).compute(B,D);var H=x.create(R.words.slice(C),F*4);return R.sigBytes=C*4,l.create({key:R,iv:H,salt:D})}},I=n.PasswordBasedCipher=_.extend({cfg:_.cfg.extend({kdf:w}),encrypt:function(B,C,F,D){D=this.cfg.extend(D);var T=D.kdf.execute(F,B.keySize,B.ivSize,D.salt,D.hasher);D.iv=T.iv;var R=_.encrypt.call(this,B,C,T.key,D);return R.mixIn(T),R},decrypt:function(B,C,F,D){D=this.cfg.extend(D),C=this._parse(C,D.format);var T=D.kdf.execute(F,B.keySize,B.ivSize,C.salt,D.hasher);D.iv=T.iv;var R=_.decrypt.call(this,B,C,T.key,D);return R}})}()})}(Jt)),Jt.exports}var kr;function Sr(){return kr||(kr=1,function(r,e){(function(t,s,i){r.exports=s(z(),Be(),Ae(),we(),ee())})(N,function(t){return function(){var s=t,i=s.lib,n=i.BlockCipher,y=s.algo,x=[],p=[],a=[],c=[],g=[],o=[],u=[],f=[],m=[],h=[];(function(){for(var l=[],v=0;v<256;v++)v<128?l[v]=v<<1:l[v]=v<<1^283;for(var E=0,_=0,v=0;v<256;v++){var A=_^_<<1^_<<2^_<<3^_<<4;A=A>>>8^A&255^99,x[E]=A,p[A]=E;var w=l[E],I=l[w],B=l[I],C=l[A]*257^A*16843008;a[E]=C<<24|C>>>8,c[E]=C<<16|C>>>16,g[E]=C<<8|C>>>24,o[E]=C;var C=B*16843009^I*65537^w*257^E*16843008;u[A]=C<<24|C>>>8,f[A]=C<<16|C>>>16,m[A]=C<<8|C>>>24,h[A]=C,E?(E=w^l[l[l[B^w]]],_^=l[l[_]]):E=_=1}})();var b=[0,1,2,4,8,16,32,64,128,27,54],d=y.AES=n.extend({_doReset:function(){var l;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var v=this._keyPriorReset=this._key,E=v.words,_=v.sigBytes/4,A=this._nRounds=_+6,w=(A+1)*4,I=this._keySchedule=[],B=0;B<w;B++)B<_?I[B]=E[B]:(l=I[B-1],B%_?_>6&&B%_==4&&(l=x[l>>>24]<<24|x[l>>>16&255]<<16|x[l>>>8&255]<<8|x[l&255]):(l=l<<8|l>>>24,l=x[l>>>24]<<24|x[l>>>16&255]<<16|x[l>>>8&255]<<8|x[l&255],l^=b[B/_|0]<<24),I[B]=I[B-_]^l);for(var C=this._invKeySchedule=[],F=0;F<w;F++){var B=w-F;if(F%4)var l=I[B];else var l=I[B-4];F<4||B<=4?C[F]=l:C[F]=u[x[l>>>24]]^f[x[l>>>16&255]]^m[x[l>>>8&255]]^h[x[l&255]]}}},encryptBlock:function(l,v){this._doCryptBlock(l,v,this._keySchedule,a,c,g,o,x)},decryptBlock:function(l,v){var E=l[v+1];l[v+1]=l[v+3],l[v+3]=E,this._doCryptBlock(l,v,this._invKeySchedule,u,f,m,h,p);var E=l[v+1];l[v+1]=l[v+3],l[v+3]=E},_doCryptBlock:function(l,v,E,_,A,w,I,B){for(var C=this._nRounds,F=l[v]^E[0],D=l[v+1]^E[1],T=l[v+2]^E[2],R=l[v+3]^E[3],H=4,Y=1;Y<C;Y++){var j=_[F>>>24]^A[D>>>16&255]^w[T>>>8&255]^I[R&255]^E[H++],X=_[D>>>24]^A[T>>>16&255]^w[R>>>8&255]^I[F&255]^E[H++],K=_[T>>>24]^A[R>>>16&255]^w[F>>>8&255]^I[D&255]^E[H++],$=_[R>>>24]^A[F>>>16&255]^w[D>>>8&255]^I[T&255]^E[H++];F=j,D=X,T=K,R=$}var j=(B[F>>>24]<<24|B[D>>>16&255]<<16|B[T>>>8&255]<<8|B[R&255])^E[H++],X=(B[D>>>24]<<24|B[T>>>16&255]<<16|B[R>>>8&255]<<8|B[F&255])^E[H++],K=(B[T>>>24]<<24|B[R>>>16&255]<<16|B[F>>>8&255]<<8|B[D&255])^E[H++],$=(B[R>>>24]<<24|B[F>>>16&255]<<16|B[D>>>8&255]<<8|B[T&255])^E[H++];l[v]=j,l[v+1]=X,l[v+2]=K,l[v+3]=$},keySize:256/32});s.AES=n._createHelper(d)}(),t.AES})}(jt)),jt.exports}var qi=Sr();const Ve=Re(qi);class ve{constructor(){this.$http=Xe.create({timeout:6e4})}static encryptParams(e){je(e,"object")&&(e=JSON.stringify(e));let t=Ve.encrypt(e,T0());return{payload:t.ciphertext.toString(ke),token:`${t.key.toString(ke)}##${t.iv.toString(ke)}`}}static toUnderscore(e){return e.split(/(?=[A-Z])/).join("_").toLowerCase()}static toCamelcase(e){return e.replace(/(\_[a-z])/g,function(t){return t.toUpperCase().replace(/_/g,"")})}static objectKeyToUnderscore(e){let t;return L(e)&&(Array.isArray(e)?(t=[],e.forEach(s=>{let i={};Object.keys(s).forEach(n=>{i[this.toUnderscore(n)]=s[n]}),t.push(i)})):(t={},Object.keys(e).forEach(s=>{t[this.toUnderscore(s)]=e[s]}))),t}static objectKeyToCamel(e){let t;return L(e)&&(Array.isArray(e)?(t=[],e.forEach(s=>{let i={};Object.keys(s).forEach(n=>{i[this.toCamelcase(n)]=s[n]}),t.push(i)})):(t={},Object.keys(e).forEach(s=>{je(e[s],"object")&&Object.keys(e[s]).length>0?t[this.toCamelcase(s)]=this.objectKeyToCamel(e[s]):t[this.toCamelcase(s)]=e[s]}))),t}static axiosMultipayConfigure(){Xe.defaults.headers.common["Content-Type"]="application/json",Xe.defaults.headers.common.Accept="application/json",Xe.interceptors.request.use(e=>(L(e.data),this.isHttpBodyUsedMethod(e.method)&&(e.data=ve.encryptParams(ve.objectKeyToUnderscore(e.data))),e.headers!==void 0&&L(e.headers.progress)&&delete e.headers.progress,e),e=>Promise.reject(e)),Xe.interceptors.response.use(e=>e,function(e){if(L(e.response)){let t=e.response.data;return t.status=e.response.status,Promise.reject(t)}else return Promise.reject(e)})}static isHttpBodyUsedMethod(e){return["post","put"].indexOf(e)>-1}}ve.axiosMultipayConfigure();class Wi extends ve{constructor(){super()}async pollingStatus(e,t,s,i){try{const n=await this.$http.get([e,"s",t].join("/"),{params:{application_id:s,tk:i}});return Promise.resolve(n)}catch(n){return Promise.reject(n)}}}const zi=new Wi;class ji extends nt{constructor(){super(),this.$messageEventName="message.BootpayPaymentEvent",this.$eventPrefix="bootpay",this.$pollingInterval=void 0,this.$pollingData={applicationId:"",gatewayUrl:"",receiptId:"",transactionKey:""},this.$pollingEvent=zi,this.pollingInterval=3e3,this.isDone=!1}bind(e,t){this.isDone=!1,this.setCallbackFunction(e,t),window.resetBootpayEventListener(this.$messageEventName,s=>{const i=this.parseEvent(s.data);if(U.debug("event received",JSON.stringify(i)),L(i))switch(U.debug("event",i),i.event){case"error":case"cancel":return this.reject({event:i.event,pg_error_code:i.pg_error_code,error_code:i.error_code,message:i.message,payload:i.payload});case"setConfirmParameters":const n=`${i.gateway_url}/confirm/${i.receipt_id}?application_id=${i.application_id}`;i.open_type==="redirect"?W.setConfirmRedirect(n):W.setConfirmFormUrl(n);break;case"confirm":return this.resolve({event:i.event,receipt_id:i.receipt_id,gateway_url:i.gateway_url,order_id:i.order_id});case"redirect":W.destroy(!1),location.href=i.url;return;case"moveRedirectUrl":W.closePopup(),W.hidePaymentiFrame(),ue.showProgress("결제 진행 중입니다. 잠시만 기다려주세요."),location.replace(As(i.url,i.parameters)),setTimeout(()=>{W.destroy(!1)},5e3);break;case"polling":return this.$pollingData!==void 0&&(this.$pollingData.receiptId=i.receipt_id,this.$pollingData.gatewayUrl=i.gateway_url),this.startPollingEvent();case"issued":case"done":if(!this.isDone)return this.isDone=!0,this.clearPollingEvent(),this.resolve(i);break;case"iFrameStyle":W.iFrameSetStyle(i.styles);break;case"windowStyle":W.windowStyle(i.styles);break;case"hideProgress":ue.hideProgress();break;case"showProgress":ue.showProgress(i.message);break;case"resize":W.iFrameResize(i.resizeData);break;case"hidePayment":W.closePopup(),W.hidePaymentiFrame();break;case"showPayment":W.showPaymentiFrame(this.$present(i.showCloseButton)?i.showCloseButton:!1);break;case"popup":W.createPopupButton({gatewayUrl:i.url,receiptId:i.receipt_id,name:i.name,price:i.price});break;case"close":W.destroy();break;default:return}})}setDefaultPaymentData(e,t){this.$pollingData!==void 0&&(this.$pollingData.applicationId=e,this.$pollingData.transactionKey=t)}callBootpayDOMEvent(e,t=void 0){document.dispatchEvent(new CustomEvent([this.$eventPrefix,e].join(""),{detail:t}))}startPollingEvent(){this.$pollingInterval=setInterval(async()=>{if(this.$pollingData!==void 0)try{const e=await this.$pollingEvent.pollingStatus(this.$pollingData.gatewayUrl,this.$pollingData.receiptId,this.$pollingData.applicationId,this.$pollingData.transactionKey);let t={bootpay_event:!0,event:"",data:e.data};if(e.data!==void 0){if(U.debug("polling event",`receive data: ${JSON.stringify(t)}`),e.data.status===1)return t.event="done",window.postMessage(JSON.stringify(t),"*");if(e.data.status===5)return t.event="issued",window.postMessage(JSON.stringify(t),"*")}}catch{return this.reject({error_code:"RC_RECEIPT_POLLING_INVALID",message:"결제 상태 체크에 실패하였습니다."})}},this.pollingInterval)}clearPollingEvent(){this.$pollingInterval!==void 0&&clearInterval(this.$pollingInterval),this.$pollingInterval=void 0,this.$pollingData={applicationId:"",gatewayUrl:"",receiptId:"",transactionKey:""}}allClearEvent(){this.clearPollingEvent(),window.removeBootpayEventListener(this.$messageEventName)}}const ne=new ji;class Ki extends ve{constructor(){super(),this.$session=Se,this.$applicationId=void 0,this.$tk=void 0,this.$platformType=1,this.$receiptId=void 0}setTokenKey(e){this.$tk=e}setReceiptId(e){this.$receiptId=e}clearInstance(){this.$applicationId=void 0,this.$receiptId=void 0}send(e){try{if(L(this.$applicationId))return e.application_id=this.$applicationId,e.status=L(e.status)?e.status:1,e.version=be.version,e.tk=this.$tk,U.debug("send event",`${JSON.stringify(e)} 전송됨`),this.$http.post(O.toAnalytics("event"),e)}catch{return}}sendError(e){e.status=-1,this.send(e)}setApplicationId(e){this.$applicationId=e}sendCloseEvent(){if(L(this.$receiptId))try{return this.$http.put(O.toApi(`close/${this.$receiptId}`))}catch(e){return Promise.reject(e)}else return U.debug("receipt_id","undefined receipt_id"),Promise.resolve()}}const Ye=new Ki,Zt={startProgress:{PAYMENT:{ko:"결제를 시작합니다",en:"Start Payment..."},CARD_SUBSCRIPTION:{ko:"자동결제 정보를 불러오는 중입니다...",en:"Automatic payment will start..."},AUTH:{ko:"본인인증을 시작합니다",en:"Authentication will start..."}},popupLocaleMessage:{message:{ko:"구매 내역에 동의하면 결제를 진행해주세요",en:"If you agree with the purchase details, please proceed with the payment."},button:{ko:"결제계속하기",en:"Continue"}},popupMessage:{message:{PAYMENT:{ko:"구매 내역에 동의하면 결제를 진행해주세요",en:"If you agree with the purchase details, please proceed with the payment"},CARD_SUBSCRIPTION:{ko:'자동결제에 동의하면 "계속하기" 버튼을 눌러 진행해주세요',en:'If you agree to automatic card payment, press the "Continue" button to proceed'},AUTH:{ko:'본인인증에 동의하면 "계속하기" 버튼을 눌러 진행해주세요',en:'If you agree to authenticate yourself, press the "Continue" button to proceed'}},button:{PAYMENT:{ko:"결제계속하기",en:"Continue"},CARD_SUBSCRIPTION:{ko:"계속하기",en:"Continue"},AUTH:{ko:"계속하기",en:"Continue"}}},closeMessage:{PAYMENT:{ko:"결제창을 닫았습니다",en:"Payment window is closed"},CARD_SUBSCRIPTION:{ko:"자동 결제창을 닫았습니다",en:"Automatic Payment window is closed"},AUTH:{ko:"본인인증 창을 닫았습니다",en:"Authenticate window is closed"}},confirmNotYet:{PAYMENT:{ko:"결제 승인준비가 되지 않았습니다",en:"Payment approval not ready "},CARD_SUBSCRIPTION:{ko:"자동결제 승인준비가 되지 않았습니다",en:"Automatic Payment approval not ready"},AUTH:{ko:"본인인증 승인준비가 되지 않았습니다",en:"Authenticate approval not ready"}},notSelectPayment:{ko:"어떤 방법으로 결제할지 선택해주세요",en:"Please, do select payment."},termsNotAgree:{ko:"필수 약관을 모두 동의해주세요",en:"Please agree to all required terms and conditions"},notSelectBrandpay:{ko:"간편결제로 결제하려면, 등록된 카드 혹은 계좌를 선택해주세요",en:"Please select a registered card or account to pay with Easy Payment"},widgetTypeNotPayment:{ko:"결제 위젯 요청이 아닙니다. 결제 위젯이 아닌 경우 requestSubscription 함수를 이용해주세요.",en:"This is not a payment widget. If it is not a payment widget, use the requestSubscription function."},widgetTypeNotSubscription:{ko:"정기결제 위젯 요청이 아닙니다. 정기결제 위젯이 아닌 경우 requestPayment 함수를 이용해주세요.",en:"This is not a subscription widget. If it is not a subscription widget, use the requestPayment function."},getLocaleMessage:(r,e)=>{const s=r.split(".").reduce((i,n)=>i[n],Zt);return L(s)&&L(s[e])?s[e]:s.ko}};class Gi extends _e{constructor(){super(),this.mode="PAYMENT",this.modeApiUrl={PAYMENT:"request/payment",CARD_SUBSCRIPTION:"request/subscribe",AUTH:"request/authentication"},this.$formId="bootpay-form",this.$iFrameId="bootpay-iframe-id",this.$windowId="bootpay-window-id",this.$paymentWindowId="bootpay-payment-window-id",this.$confirmFormId="bootpay-confirm-form-id",this.$confirmIFrame="bootpay-confirm-iframe-id",this.$popupWindow="bootpay-popup-window-id",this.$closeButton="bootpay-close-btn",this.$popupItemNameId="bootpay-item-name-id",this.$popupPriceId="bootpay-price-id",this.$popup=void 0,this.$popupWatcher=void 0,this.$popupUrl=void 0,this.$env=O,this.$template=this.template()}template(){return`
|
|
15
|
+
`}showProgress(e){this.$present(this.byId(this.$alfredId))?this.byId(this.$alfredTextId).innerText=e:document.body.insertAdjacentHTML("beforeend",this.template(e)),this.byId(this.$alfredId).style.setProperty("display","block")}hideProgress(){try{this.byId(this.$alfredId).outerHTML=""}catch{}}}const ue=new Ts;var Bt={exports:{}},M0=function(e,t){return function(){for(var i=new Array(arguments.length),n=0;n<i.length;n++)i[n]=arguments[n];return e.apply(t,i)}},Os=M0,_t=Object.prototype.toString,Ct=function(r){return function(e){var t=_t.call(e);return r[t]||(r[t]=t.slice(8,-1).toLowerCase())}}(Object.create(null));function Ie(r){return r=r.toLowerCase(),function(t){return Ct(t)===r}}function At(r){return Array.isArray(r)}function ct(r){return typeof r>"u"}function Us(r){return r!==null&&!ct(r)&&r.constructor!==null&&!ct(r.constructor)&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}var q0=Ie("ArrayBuffer");function Hs(r){var e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(r):e=r&&r.buffer&&q0(r.buffer),e}function Ns(r){return typeof r=="string"}function Ls(r){return typeof r=="number"}function W0(r){return r!==null&&typeof r=="object"}function dt(r){if(Ct(r)!=="object")return!1;var e=Object.getPrototypeOf(r);return e===null||e===Object.prototype}var Ms=Ie("Date"),qs=Ie("File"),Ws=Ie("Blob"),zs=Ie("FileList");function wt(r){return _t.call(r)==="[object Function]"}function js(r){return W0(r)&&wt(r.pipe)}function Ks(r){var e="[object FormData]";return r&&(typeof FormData=="function"&&r instanceof FormData||_t.call(r)===e||wt(r.toString)&&r.toString()===e)}var Gs=Ie("URLSearchParams");function Xs(r){return r.trim?r.trim():r.replace(/^\s+|\s+$/g,"")}function Vs(){return typeof navigator<"u"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window<"u"&&typeof document<"u"}function Ft(r,e){if(!(r===null||typeof r>"u"))if(typeof r!="object"&&(r=[r]),At(r))for(var t=0,s=r.length;t<s;t++)e.call(null,r[t],t,r);else for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&e.call(null,r[i],i,r)}function Dt(){var r={};function e(i,n){dt(r[n])&&dt(i)?r[n]=Dt(r[n],i):dt(i)?r[n]=Dt({},i):At(i)?r[n]=i.slice():r[n]=i}for(var t=0,s=arguments.length;t<s;t++)Ft(arguments[t],e);return r}function Ys(r,e,t){return Ft(e,function(i,n){t&&typeof i=="function"?r[n]=Os(i,t):r[n]=i}),r}function Js(r){return r.charCodeAt(0)===65279&&(r=r.slice(1)),r}function Zs(r,e,t,s){r.prototype=Object.create(e.prototype,s),r.prototype.constructor=r,t&&Object.assign(r.prototype,t)}function Qs(r,e,t){var s,i,n,y={};e=e||{};do{for(s=Object.getOwnPropertyNames(r),i=s.length;i-- >0;)n=s[i],y[n]||(e[n]=r[n],y[n]=!0);r=Object.getPrototypeOf(r)}while(r&&(!t||t(r,e))&&r!==Object.prototype);return e}function ei(r,e,t){r=String(r),(t===void 0||t>r.length)&&(t=r.length),t-=e.length;var s=r.indexOf(e,t);return s!==-1&&s===t}function ti(r){if(!r)return null;var e=r.length;if(ct(e))return null;for(var t=new Array(e);e-- >0;)t[e]=r[e];return t}var ri=function(r){return function(e){return r&&e instanceof r}}(typeof Uint8Array<"u"&&Object.getPrototypeOf(Uint8Array)),te={isArray:At,isArrayBuffer:q0,isBuffer:Us,isFormData:Ks,isArrayBufferView:Hs,isString:Ns,isNumber:Ls,isObject:W0,isPlainObject:dt,isUndefined:ct,isDate:Ms,isFile:qs,isBlob:Ws,isFunction:wt,isStream:js,isURLSearchParams:Gs,isStandardBrowserEnv:Vs,forEach:Ft,merge:Dt,extend:Ys,trim:Xs,stripBOM:Js,inherits:Zs,toFlatObject:Qs,kindOf:Ct,kindOfTest:Ie,endsWith:ei,toArray:ti,isTypedArray:ri,isFileList:zs},He=te;function z0(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var j0=function(e,t,s){if(!t)return e;var i;if(s)i=s(t);else if(He.isURLSearchParams(t))i=t.toString();else{var n=[];He.forEach(t,function(p,a){p===null||typeof p>"u"||(He.isArray(p)?a=a+"[]":p=[p],He.forEach(p,function(g){He.isDate(g)?g=g.toISOString():He.isObject(g)&&(g=JSON.stringify(g)),n.push(z0(a)+"="+z0(g))}))}),i=n.join("&")}if(i){var y=e.indexOf("#");y!==-1&&(e=e.slice(0,y)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e},si=te;function xt(){this.handlers=[]}xt.prototype.use=function(e,t,s){return this.handlers.push({fulfilled:e,rejected:t,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1},xt.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},xt.prototype.forEach=function(e){si.forEach(this.handlers,function(s){s!==null&&e(s)})};var ii=xt,ni=te,oi=function(e,t){ni.forEach(e,function(i,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=i,delete e[n])})},K0=te;function Ne(r,e,t,s,i){Error.call(this),this.message=r,this.name="AxiosError",e&&(this.code=e),t&&(this.config=t),s&&(this.request=s),i&&(this.response=i)}K0.inherits(Ne,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var G0=Ne.prototype,X0={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach(function(r){X0[r]={value:r}}),Object.defineProperties(Ne,X0),Object.defineProperty(G0,"isAxiosError",{value:!0}),Ne.from=function(r,e,t,s,i,n){var y=Object.create(G0);return K0.toFlatObject(r,y,function(p){return p!==Error.prototype}),Ne.call(y,r.message,e,t,s,i),y.name=r.name,n&&Object.assign(y,n),y};var Le=Ne,V0={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},fe=te;function ai(r,e){e=e||new FormData;var t=[];function s(n){return n===null?"":fe.isDate(n)?n.toISOString():fe.isArrayBuffer(n)||fe.isTypedArray(n)?typeof Blob=="function"?new Blob([n]):Buffer.from(n):n}function i(n,y){if(fe.isPlainObject(n)||fe.isArray(n)){if(t.indexOf(n)!==-1)throw Error("Circular reference detected in "+y);t.push(n),fe.forEach(n,function(p,a){if(!fe.isUndefined(p)){var c=y?y+"."+a:a,g;if(p&&!y&&typeof p=="object"){if(fe.endsWith(a,"{}"))p=JSON.stringify(p);else if(fe.endsWith(a,"[]")&&(g=fe.toArray(p))){g.forEach(function(o){!fe.isUndefined(o)&&e.append(c,s(o))});return}}i(p,c)}}),t.pop()}else e.append(y,s(n))}return i(r),e}var Y0=ai,$t,J0;function ci(){if(J0)return $t;J0=1;var r=Le;return $t=function(t,s,i){var n=i.config.validateStatus;!i.status||!n||n(i.status)?t(i):s(new r("Request failed with status code "+i.status,[r.ERR_BAD_REQUEST,r.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i))},$t}var kt,Z0;function di(){if(Z0)return kt;Z0=1;var r=te;return kt=r.isStandardBrowserEnv()?function(){return{write:function(s,i,n,y,d,p){var a=[];a.push(s+"="+encodeURIComponent(i)),r.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),r.isString(y)&&a.push("path="+y),r.isString(d)&&a.push("domain="+d),p===!0&&a.push("secure"),document.cookie=a.join("; ")},read:function(s){var i=document.cookie.match(new RegExp("(^|;\\s*)("+s+")=([^;]*)"));return i?decodeURIComponent(i[3]):null},remove:function(s){this.write(s,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}(),kt}var xi=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)},li=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e},ui=xi,pi=li,Q0=function(e,t){return e&&!ui(t)?pi(e,t):t},St,er;function hi(){if(er)return St;er=1;var r=te,e=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];return St=function(s){var i={},n,y,d;return s&&r.forEach(s.split(`
|
|
16
|
+
`),function(a){if(d=a.indexOf(":"),n=r.trim(a.substr(0,d)).toLowerCase(),y=r.trim(a.substr(d+1)),n){if(i[n]&&e.indexOf(n)>=0)return;n==="set-cookie"?i[n]=(i[n]?i[n]:[]).concat([y]):i[n]=i[n]?i[n]+", "+y:y}}),i},St}var Pt,tr;function fi(){if(tr)return Pt;tr=1;var r=te;return Pt=r.isStandardBrowserEnv()?function(){var t=/(msie|trident)/i.test(navigator.userAgent),s=document.createElement("a"),i;function n(y){var d=y;return t&&(s.setAttribute("href",d),d=s.href),s.setAttribute("href",d),{href:s.href,protocol:s.protocol?s.protocol.replace(/:$/,""):"",host:s.host,search:s.search?s.search.replace(/^\?/,""):"",hash:s.hash?s.hash.replace(/^#/,""):"",hostname:s.hostname,port:s.port,pathname:s.pathname.charAt(0)==="/"?s.pathname:"/"+s.pathname}}return i=n(window.location.href),function(d){var p=r.isString(d)?n(d):d;return p.protocol===i.protocol&&p.host===i.host}}():function(){return function(){return!0}}(),Pt}var It,rr;function lt(){if(rr)return It;rr=1;var r=Le,e=te;function t(s){r.call(this,s??"canceled",r.ERR_CANCELED),this.name="CanceledError"}return e.inherits(t,r,{__CANCEL__:!0}),It=t,It}var Rt,sr;function vi(){return sr||(sr=1,Rt=function(e){var t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}),Rt}var Tt,ir;function nr(){if(ir)return Tt;ir=1;var r=te,e=ci(),t=di(),s=j0,i=Q0,n=hi(),y=fi(),d=V0,p=Le,a=lt(),c=vi();return Tt=function(o){return new Promise(function(h,m){var f=o.data,B=o.headers,x=o.responseType,l;function v(){o.cancelToken&&o.cancelToken.unsubscribe(l),o.signal&&o.signal.removeEventListener("abort",l)}r.isFormData(f)&&r.isStandardBrowserEnv()&&delete B["Content-Type"];var E=new XMLHttpRequest;if(o.auth){var _=o.auth.username||"",A=o.auth.password?unescape(encodeURIComponent(o.auth.password)):"";B.Authorization="Basic "+btoa(_+":"+A)}var w=i(o.baseURL,o.url);E.open(o.method.toUpperCase(),s(w,o.params,o.paramsSerializer),!0),E.timeout=o.timeout;function I(){if(E){var F="getAllResponseHeaders"in E?n(E.getAllResponseHeaders()):null,D=!x||x==="text"||x==="json"?E.responseText:E.response,R={data:D,status:E.status,statusText:E.statusText,headers:F,config:o,request:E};e(function(N){h(N),v()},function(N){m(N),v()},R),E=null}}if("onloadend"in E?E.onloadend=I:E.onreadystatechange=function(){!E||E.readyState!==4||E.status===0&&!(E.responseURL&&E.responseURL.indexOf("file:")===0)||setTimeout(I)},E.onabort=function(){E&&(m(new p("Request aborted",p.ECONNABORTED,o,E)),E=null)},E.onerror=function(){m(new p("Network Error",p.ERR_NETWORK,o,E,E)),E=null},E.ontimeout=function(){var D=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded",R=o.transitional||d;o.timeoutErrorMessage&&(D=o.timeoutErrorMessage),m(new p(D,R.clarifyTimeoutError?p.ETIMEDOUT:p.ECONNABORTED,o,E)),E=null},r.isStandardBrowserEnv()){var b=(o.withCredentials||y(w))&&o.xsrfCookieName?t.read(o.xsrfCookieName):void 0;b&&(B[o.xsrfHeaderName]=b)}"setRequestHeader"in E&&r.forEach(B,function(D,R){typeof f>"u"&&R.toLowerCase()==="content-type"?delete B[R]:E.setRequestHeader(R,D)}),r.isUndefined(o.withCredentials)||(E.withCredentials=!!o.withCredentials),x&&x!=="json"&&(E.responseType=o.responseType),typeof o.onDownloadProgress=="function"&&E.addEventListener("progress",o.onDownloadProgress),typeof o.onUploadProgress=="function"&&E.upload&&E.upload.addEventListener("progress",o.onUploadProgress),(o.cancelToken||o.signal)&&(l=function(F){E&&(m(!F||F&&F.type?new a:F),E.abort(),E=null)},o.cancelToken&&o.cancelToken.subscribe(l),o.signal&&(o.signal.aborted?l():o.signal.addEventListener("abort",l))),f||(f=null);var C=c(w);if(C&&["http","https","file"].indexOf(C)===-1){m(new p("Unsupported protocol "+C+":",p.ERR_BAD_REQUEST,o));return}E.send(f)})},Tt}var Ot,or;function yi(){return or||(or=1,Ot=null),Ot}var Q=te,ar=oi,cr=Le,mi=V0,Ei=Y0,gi={"Content-Type":"application/x-www-form-urlencoded"};function dr(r,e){!Q.isUndefined(r)&&Q.isUndefined(r["Content-Type"])&&(r["Content-Type"]=e)}function bi(){var r;return(typeof XMLHttpRequest<"u"||typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]")&&(r=nr()),r}function Bi(r,e,t){if(Q.isString(r))try{return(e||JSON.parse)(r),Q.trim(r)}catch(s){if(s.name!=="SyntaxError")throw s}return(t||JSON.stringify)(r)}var ut={transitional:mi,adapter:bi(),transformRequest:[function(e,t){if(ar(t,"Accept"),ar(t,"Content-Type"),Q.isFormData(e)||Q.isArrayBuffer(e)||Q.isBuffer(e)||Q.isStream(e)||Q.isFile(e)||Q.isBlob(e))return e;if(Q.isArrayBufferView(e))return e.buffer;if(Q.isURLSearchParams(e))return dr(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString();var s=Q.isObject(e),i=t&&t["Content-Type"],n;if((n=Q.isFileList(e))||s&&i==="multipart/form-data"){var y=this.env&&this.env.FormData;return Ei(n?{"files[]":e}:e,y&&new y)}else if(s||i==="application/json")return dr(t,"application/json"),Bi(e);return e}],transformResponse:[function(e){var t=this.transitional||ut.transitional,s=t&&t.silentJSONParsing,i=t&&t.forcedJSONParsing,n=!s&&this.responseType==="json";if(n||i&&Q.isString(e)&&e.length)try{return JSON.parse(e)}catch(y){if(n)throw y.name==="SyntaxError"?cr.from(y,cr.ERR_BAD_RESPONSE,this,null,this.response):y}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:yi()},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};Q.forEach(["delete","get","head"],function(e){ut.headers[e]={}}),Q.forEach(["post","put","patch"],function(e){ut.headers[e]=Q.merge(gi)});var Ut=ut,_i=te,Ci=Ut,Ai=function(e,t,s){var i=this||Ci;return _i.forEach(s,function(y){e=y.call(i,e,t)}),e},Ht,xr;function lr(){return xr||(xr=1,Ht=function(e){return!!(e&&e.__CANCEL__)}),Ht}var ur=te,Nt=Ai,wi=lr(),Fi=Ut,Di=lt();function Lt(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new Di}var $i=function(e){Lt(e),e.headers=e.headers||{},e.data=Nt.call(e,e.data,e.headers,e.transformRequest),e.headers=ur.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),ur.forEach(["delete","get","head","post","put","patch","common"],function(i){delete e.headers[i]});var t=e.adapter||Fi.adapter;return t(e).then(function(i){return Lt(e),i.data=Nt.call(e,i.data,i.headers,e.transformResponse),i},function(i){return wi(i)||(Lt(e),i&&i.response&&(i.response.data=Nt.call(e,i.response.data,i.response.headers,e.transformResponse))),Promise.reject(i)})},ce=te,pr=function(e,t){t=t||{};var s={};function i(c,g){return ce.isPlainObject(c)&&ce.isPlainObject(g)?ce.merge(c,g):ce.isPlainObject(g)?ce.merge({},g):ce.isArray(g)?g.slice():g}function n(c){if(ce.isUndefined(t[c])){if(!ce.isUndefined(e[c]))return i(void 0,e[c])}else return i(e[c],t[c])}function y(c){if(!ce.isUndefined(t[c]))return i(void 0,t[c])}function d(c){if(ce.isUndefined(t[c])){if(!ce.isUndefined(e[c]))return i(void 0,e[c])}else return i(void 0,t[c])}function p(c){if(c in t)return i(e[c],t[c]);if(c in e)return i(void 0,e[c])}var a={url:y,method:y,data:y,baseURL:d,transformRequest:d,transformResponse:d,paramsSerializer:d,timeout:d,timeoutMessage:d,withCredentials:d,adapter:d,responseType:d,xsrfCookieName:d,xsrfHeaderName:d,onUploadProgress:d,onDownloadProgress:d,decompress:d,maxContentLength:d,maxBodyLength:d,beforeRedirect:d,transport:d,httpAgent:d,httpsAgent:d,cancelToken:d,socketPath:d,responseEncoding:d,validateStatus:p};return ce.forEach(Object.keys(e).concat(Object.keys(t)),function(g){var o=a[g]||n,u=o(g);ce.isUndefined(u)&&o!==p||(s[g]=u)}),s},Mt,hr;function fr(){return hr||(hr=1,Mt={version:"0.27.2"}),Mt}var ki=fr().version,Ce=Le,qt={};["object","boolean","number","function","string","symbol"].forEach(function(r,e){qt[r]=function(s){return typeof s===r||"a"+(e<1?"n ":" ")+r}});var vr={};qt.transitional=function(e,t,s){function i(n,y){return"[Axios v"+ki+"] Transitional option '"+n+"'"+y+(s?". "+s:"")}return function(n,y,d){if(e===!1)throw new Ce(i(y," has been removed"+(t?" in "+t:"")),Ce.ERR_DEPRECATED);return t&&!vr[y]&&(vr[y]=!0,console.warn(i(y," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(n,y,d):!0}};function Si(r,e,t){if(typeof r!="object")throw new Ce("options must be an object",Ce.ERR_BAD_OPTION_VALUE);for(var s=Object.keys(r),i=s.length;i-- >0;){var n=s[i],y=e[n];if(y){var d=r[n],p=d===void 0||y(d,n,r);if(p!==!0)throw new Ce("option "+n+" must be "+p,Ce.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new Ce("Unknown option "+n,Ce.ERR_BAD_OPTION)}}var Pi={assertOptions:Si,validators:qt},yr=te,Ii=j0,mr=ii,Er=$i,pt=pr,Ri=Q0,gr=Pi,Me=gr.validators;function qe(r){this.defaults=r,this.interceptors={request:new mr,response:new mr}}qe.prototype.request=function(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=pt(this.defaults,t),t.method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var s=t.transitional;s!==void 0&&gr.assertOptions(s,{silentJSONParsing:Me.transitional(Me.boolean),forcedJSONParsing:Me.transitional(Me.boolean),clarifyTimeoutError:Me.transitional(Me.boolean)},!1);var i=[],n=!0;this.interceptors.request.forEach(function(u){typeof u.runWhen=="function"&&u.runWhen(t)===!1||(n=n&&u.synchronous,i.unshift(u.fulfilled,u.rejected))});var y=[];this.interceptors.response.forEach(function(u){y.push(u.fulfilled,u.rejected)});var d;if(!n){var p=[Er,void 0];for(Array.prototype.unshift.apply(p,i),p=p.concat(y),d=Promise.resolve(t);p.length;)d=d.then(p.shift(),p.shift());return d}for(var a=t;i.length;){var c=i.shift(),g=i.shift();try{a=c(a)}catch(o){g(o);break}}try{d=Er(a)}catch(o){return Promise.reject(o)}for(;y.length;)d=d.then(y.shift(),y.shift());return d},qe.prototype.getUri=function(e){e=pt(this.defaults,e);var t=Ri(e.baseURL,e.url);return Ii(t,e.params,e.paramsSerializer)},yr.forEach(["delete","get","head","options"],function(e){qe.prototype[e]=function(t,s){return this.request(pt(s||{},{method:e,url:t,data:(s||{}).data}))}}),yr.forEach(["post","put","patch"],function(e){function t(s){return function(n,y,d){return this.request(pt(d||{},{method:e,headers:s?{"Content-Type":"multipart/form-data"}:{},url:n,data:y}))}}qe.prototype[e]=t(),qe.prototype[e+"Form"]=t(!0)});var Ti=qe,Wt,br;function Oi(){if(br)return Wt;br=1;var r=lt();function e(t){if(typeof t!="function")throw new TypeError("executor must be a function.");var s;this.promise=new Promise(function(y){s=y});var i=this;this.promise.then(function(n){if(i._listeners){var y,d=i._listeners.length;for(y=0;y<d;y++)i._listeners[y](n);i._listeners=null}}),this.promise.then=function(n){var y,d=new Promise(function(p){i.subscribe(p),y=p}).then(n);return d.cancel=function(){i.unsubscribe(y)},d},t(function(y){i.reason||(i.reason=new r(y),s(i.reason))})}return e.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},e.prototype.subscribe=function(s){if(this.reason){s(this.reason);return}this._listeners?this._listeners.push(s):this._listeners=[s]},e.prototype.unsubscribe=function(s){if(this._listeners){var i=this._listeners.indexOf(s);i!==-1&&this._listeners.splice(i,1)}},e.source=function(){var s,i=new e(function(y){s=y});return{token:i,cancel:s}},Wt=e,Wt}var zt,Br;function Ui(){return Br||(Br=1,zt=function(e){return function(s){return e.apply(null,s)}}),zt}var jt,_r;function Hi(){if(_r)return jt;_r=1;var r=te;return jt=function(t){return r.isObject(t)&&t.isAxiosError===!0},jt}var Cr=te,Ni=M0,ht=Ti,Li=pr,Mi=Ut;function Ar(r){var e=new ht(r),t=Ni(ht.prototype.request,e);return Cr.extend(t,ht.prototype,e),Cr.extend(t,e),t.create=function(i){return Ar(Li(r,i))},t}var ie=Ar(Mi);ie.Axios=ht,ie.CanceledError=lt(),ie.CancelToken=Oi(),ie.isCancel=lr(),ie.VERSION=fr().version,ie.toFormData=Y0,ie.AxiosError=Le,ie.Cancel=ie.CanceledError,ie.all=function(e){return Promise.all(e)},ie.spread=Ui(),ie.isAxiosError=Hi(),Bt.exports=ie,Bt.exports.default=ie;var qi=Bt.exports,Wi=qi;const Ve=Oe(Wi);var Kt={exports:{}},Gt={exports:{}},wr;function Ae(){return wr||(wr=1,function(r,e){(function(t,s){r.exports=s(z())})(L,function(t){return function(s){var i=t,n=i.lib,y=n.WordArray,d=n.Hasher,p=i.algo,a=[];(function(){for(var m=0;m<64;m++)a[m]=s.abs(s.sin(m+1))*4294967296|0})();var c=p.MD5=d.extend({_doReset:function(){this._hash=new y.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(m,f){for(var B=0;B<16;B++){var x=f+B,l=m[x];m[x]=(l<<8|l>>>24)&16711935|(l<<24|l>>>8)&4278255360}var v=this._hash.words,E=m[f+0],_=m[f+1],A=m[f+2],w=m[f+3],I=m[f+4],b=m[f+5],C=m[f+6],F=m[f+7],D=m[f+8],R=m[f+9],T=m[f+10],N=m[f+11],Y=m[f+12],j=m[f+13],X=m[f+14],K=m[f+15],$=v[0],S=v[1],P=v[2],k=v[3];$=g($,S,P,k,E,7,a[0]),k=g(k,$,S,P,_,12,a[1]),P=g(P,k,$,S,A,17,a[2]),S=g(S,P,k,$,w,22,a[3]),$=g($,S,P,k,I,7,a[4]),k=g(k,$,S,P,b,12,a[5]),P=g(P,k,$,S,C,17,a[6]),S=g(S,P,k,$,F,22,a[7]),$=g($,S,P,k,D,7,a[8]),k=g(k,$,S,P,R,12,a[9]),P=g(P,k,$,S,T,17,a[10]),S=g(S,P,k,$,N,22,a[11]),$=g($,S,P,k,Y,7,a[12]),k=g(k,$,S,P,j,12,a[13]),P=g(P,k,$,S,X,17,a[14]),S=g(S,P,k,$,K,22,a[15]),$=o($,S,P,k,_,5,a[16]),k=o(k,$,S,P,C,9,a[17]),P=o(P,k,$,S,N,14,a[18]),S=o(S,P,k,$,E,20,a[19]),$=o($,S,P,k,b,5,a[20]),k=o(k,$,S,P,T,9,a[21]),P=o(P,k,$,S,K,14,a[22]),S=o(S,P,k,$,I,20,a[23]),$=o($,S,P,k,R,5,a[24]),k=o(k,$,S,P,X,9,a[25]),P=o(P,k,$,S,w,14,a[26]),S=o(S,P,k,$,D,20,a[27]),$=o($,S,P,k,j,5,a[28]),k=o(k,$,S,P,A,9,a[29]),P=o(P,k,$,S,F,14,a[30]),S=o(S,P,k,$,Y,20,a[31]),$=u($,S,P,k,b,4,a[32]),k=u(k,$,S,P,D,11,a[33]),P=u(P,k,$,S,N,16,a[34]),S=u(S,P,k,$,X,23,a[35]),$=u($,S,P,k,_,4,a[36]),k=u(k,$,S,P,I,11,a[37]),P=u(P,k,$,S,F,16,a[38]),S=u(S,P,k,$,T,23,a[39]),$=u($,S,P,k,j,4,a[40]),k=u(k,$,S,P,E,11,a[41]),P=u(P,k,$,S,w,16,a[42]),S=u(S,P,k,$,C,23,a[43]),$=u($,S,P,k,R,4,a[44]),k=u(k,$,S,P,Y,11,a[45]),P=u(P,k,$,S,K,16,a[46]),S=u(S,P,k,$,A,23,a[47]),$=h($,S,P,k,E,6,a[48]),k=h(k,$,S,P,F,10,a[49]),P=h(P,k,$,S,X,15,a[50]),S=h(S,P,k,$,b,21,a[51]),$=h($,S,P,k,Y,6,a[52]),k=h(k,$,S,P,w,10,a[53]),P=h(P,k,$,S,T,15,a[54]),S=h(S,P,k,$,_,21,a[55]),$=h($,S,P,k,D,6,a[56]),k=h(k,$,S,P,K,10,a[57]),P=h(P,k,$,S,C,15,a[58]),S=h(S,P,k,$,j,21,a[59]),$=h($,S,P,k,I,6,a[60]),k=h(k,$,S,P,N,10,a[61]),P=h(P,k,$,S,A,15,a[62]),S=h(S,P,k,$,R,21,a[63]),v[0]=v[0]+$|0,v[1]=v[1]+S|0,v[2]=v[2]+P|0,v[3]=v[3]+k|0},_doFinalize:function(){var m=this._data,f=m.words,B=this._nDataBytes*8,x=m.sigBytes*8;f[x>>>5]|=128<<24-x%32;var l=s.floor(B/4294967296),v=B;f[(x+64>>>9<<4)+15]=(l<<8|l>>>24)&16711935|(l<<24|l>>>8)&4278255360,f[(x+64>>>9<<4)+14]=(v<<8|v>>>24)&16711935|(v<<24|v>>>8)&4278255360,m.sigBytes=(f.length+1)*4,this._process();for(var E=this._hash,_=E.words,A=0;A<4;A++){var w=_[A];_[A]=(w<<8|w>>>24)&16711935|(w<<24|w>>>8)&4278255360}return E},clone:function(){var m=d.clone.call(this);return m._hash=this._hash.clone(),m}});function g(m,f,B,x,l,v,E){var _=m+(f&B|~f&x)+l+E;return(_<<v|_>>>32-v)+f}function o(m,f,B,x,l,v,E){var _=m+(f&x|B&~x)+l+E;return(_<<v|_>>>32-v)+f}function u(m,f,B,x,l,v,E){var _=m+(f^B^x)+l+E;return(_<<v|_>>>32-v)+f}function h(m,f,B,x,l,v,E){var _=m+(B^(f|~x))+l+E;return(_<<v|_>>>32-v)+f}i.MD5=d._createHelper(c),i.HmacMD5=d._createHmacHelper(c)}(Math),t.MD5})}(Gt)),Gt.exports}var Xt={exports:{}},Vt={exports:{}},Fr;function Dr(){return Fr||(Fr=1,function(r,e){(function(t,s){r.exports=s(z())})(L,function(t){return function(){var s=t,i=s.lib,n=i.WordArray,y=i.Hasher,d=s.algo,p=[],a=d.SHA1=y.extend({_doReset:function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(c,g){for(var o=this._hash.words,u=o[0],h=o[1],m=o[2],f=o[3],B=o[4],x=0;x<80;x++){if(x<16)p[x]=c[g+x]|0;else{var l=p[x-3]^p[x-8]^p[x-14]^p[x-16];p[x]=l<<1|l>>>31}var v=(u<<5|u>>>27)+B+p[x];x<20?v+=(h&m|~h&f)+1518500249:x<40?v+=(h^m^f)+1859775393:x<60?v+=(h&m|h&f|m&f)-1894007588:v+=(h^m^f)-899497514,B=f,f=m,m=h<<30|h>>>2,h=u,u=v}o[0]=o[0]+u|0,o[1]=o[1]+h|0,o[2]=o[2]+m|0,o[3]=o[3]+f|0,o[4]=o[4]+B|0},_doFinalize:function(){var c=this._data,g=c.words,o=this._nDataBytes*8,u=c.sigBytes*8;return g[u>>>5]|=128<<24-u%32,g[(u+64>>>9<<4)+14]=Math.floor(o/4294967296),g[(u+64>>>9<<4)+15]=o,c.sigBytes=g.length*4,this._process(),this._hash},clone:function(){var c=y.clone.call(this);return c._hash=this._hash.clone(),c}});s.SHA1=y._createHelper(a),s.HmacSHA1=y._createHmacHelper(a)}(),t.SHA1})}(Vt)),Vt.exports}var Yt={exports:{}},$r;function Jt(){return $r||($r=1,function(r,e){(function(t,s){r.exports=s(z())})(L,function(t){(function(){var s=t,i=s.lib,n=i.Base,y=s.enc,d=y.Utf8,p=s.algo;p.HMAC=n.extend({init:function(a,c){a=this._hasher=new a.init,typeof c=="string"&&(c=d.parse(c));var g=a.blockSize,o=g*4;c.sigBytes>o&&(c=a.finalize(c)),c.clamp();for(var u=this._oKey=c.clone(),h=this._iKey=c.clone(),m=u.words,f=h.words,B=0;B<g;B++)m[B]^=1549556828,f[B]^=909522486;u.sigBytes=h.sigBytes=o,this.reset()},reset:function(){var a=this._hasher;a.reset(),a.update(this._iKey)},update:function(a){return this._hasher.update(a),this},finalize:function(a){var c=this._hasher,g=c.finalize(a);c.reset();var o=c.finalize(this._oKey.clone().concat(g));return o}})})()})}(Yt)),Yt.exports}var kr;function we(){return kr||(kr=1,function(r,e){(function(t,s,i){r.exports=s(z(),Dr(),Jt())})(L,function(t){return function(){var s=t,i=s.lib,n=i.Base,y=i.WordArray,d=s.algo,p=d.MD5,a=d.EvpKDF=n.extend({cfg:n.extend({keySize:128/32,hasher:p,iterations:1}),init:function(c){this.cfg=this.cfg.extend(c)},compute:function(c,g){for(var o,u=this.cfg,h=u.hasher.create(),m=y.create(),f=m.words,B=u.keySize,x=u.iterations;f.length<B;){o&&h.update(o),o=h.update(c).finalize(g),h.reset();for(var l=1;l<x;l++)o=h.finalize(o),h.reset();m.concat(o)}return m.sigBytes=B*4,m}});s.EvpKDF=function(c,g,o){return a.create(o).compute(c,g)}}(),t.EvpKDF})}(Xt)),Xt.exports}var Zt={exports:{}},Sr;function ee(){return Sr||(Sr=1,function(r,e){(function(t,s,i){r.exports=s(z(),we())})(L,function(t){t.lib.Cipher||function(s){var i=t,n=i.lib,y=n.Base,d=n.WordArray,p=n.BufferedBlockAlgorithm,a=i.enc;a.Utf8;var c=a.Base64,g=i.algo,o=g.EvpKDF,u=n.Cipher=p.extend({cfg:y.extend(),createEncryptor:function(b,C){return this.create(this._ENC_XFORM_MODE,b,C)},createDecryptor:function(b,C){return this.create(this._DEC_XFORM_MODE,b,C)},init:function(b,C,F){this.cfg=this.cfg.extend(F),this._xformMode=b,this._key=C,this.reset()},reset:function(){p.reset.call(this),this._doReset()},process:function(b){return this._append(b),this._process()},finalize:function(b){b&&this._append(b);var C=this._doFinalize();return C},keySize:128/32,ivSize:128/32,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function b(C){return typeof C=="string"?I:_}return function(C){return{encrypt:function(F,D,R){return b(D).encrypt(C,F,D,R)},decrypt:function(F,D,R){return b(D).decrypt(C,F,D,R)}}}}()});n.StreamCipher=u.extend({_doFinalize:function(){var b=this._process(!0);return b},blockSize:1});var h=i.mode={},m=n.BlockCipherMode=y.extend({createEncryptor:function(b,C){return this.Encryptor.create(b,C)},createDecryptor:function(b,C){return this.Decryptor.create(b,C)},init:function(b,C){this._cipher=b,this._iv=C}}),f=h.CBC=function(){var b=m.extend();b.Encryptor=b.extend({processBlock:function(F,D){var R=this._cipher,T=R.blockSize;C.call(this,F,D,T),R.encryptBlock(F,D),this._prevBlock=F.slice(D,D+T)}}),b.Decryptor=b.extend({processBlock:function(F,D){var R=this._cipher,T=R.blockSize,N=F.slice(D,D+T);R.decryptBlock(F,D),C.call(this,F,D,T),this._prevBlock=N}});function C(F,D,R){var T,N=this._iv;N?(T=N,this._iv=s):T=this._prevBlock;for(var Y=0;Y<R;Y++)F[D+Y]^=T[Y]}return b}(),B=i.pad={},x=B.Pkcs7={pad:function(b,C){for(var F=C*4,D=F-b.sigBytes%F,R=D<<24|D<<16|D<<8|D,T=[],N=0;N<D;N+=4)T.push(R);var Y=d.create(T,D);b.concat(Y)},unpad:function(b){var C=b.words[b.sigBytes-1>>>2]&255;b.sigBytes-=C}};n.BlockCipher=u.extend({cfg:u.cfg.extend({mode:f,padding:x}),reset:function(){var b;u.reset.call(this);var C=this.cfg,F=C.iv,D=C.mode;this._xformMode==this._ENC_XFORM_MODE?b=D.createEncryptor:(b=D.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==b?this._mode.init(this,F&&F.words):(this._mode=b.call(D,this,F&&F.words),this._mode.__creator=b)},_doProcessBlock:function(b,C){this._mode.processBlock(b,C)},_doFinalize:function(){var b,C=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(C.pad(this._data,this.blockSize),b=this._process(!0)):(b=this._process(!0),C.unpad(b)),b},blockSize:128/32});var l=n.CipherParams=y.extend({init:function(b){this.mixIn(b)},toString:function(b){return(b||this.formatter).stringify(this)}}),v=i.format={},E=v.OpenSSL={stringify:function(b){var C,F=b.ciphertext,D=b.salt;return D?C=d.create([1398893684,1701076831]).concat(D).concat(F):C=F,C.toString(c)},parse:function(b){var C,F=c.parse(b),D=F.words;return D[0]==1398893684&&D[1]==1701076831&&(C=d.create(D.slice(2,4)),D.splice(0,4),F.sigBytes-=16),l.create({ciphertext:F,salt:C})}},_=n.SerializableCipher=y.extend({cfg:y.extend({format:E}),encrypt:function(b,C,F,D){D=this.cfg.extend(D);var R=b.createEncryptor(F,D),T=R.finalize(C),N=R.cfg;return l.create({ciphertext:T,key:F,iv:N.iv,algorithm:b,mode:N.mode,padding:N.padding,blockSize:b.blockSize,formatter:D.format})},decrypt:function(b,C,F,D){D=this.cfg.extend(D),C=this._parse(C,D.format);var R=b.createDecryptor(F,D).finalize(C.ciphertext);return R},_parse:function(b,C){return typeof b=="string"?C.parse(b,this):b}}),A=i.kdf={},w=A.OpenSSL={execute:function(b,C,F,D,R){if(D||(D=d.random(64/8)),R)var T=o.create({keySize:C+F,hasher:R}).compute(b,D);else var T=o.create({keySize:C+F}).compute(b,D);var N=d.create(T.words.slice(C),F*4);return T.sigBytes=C*4,l.create({key:T,iv:N,salt:D})}},I=n.PasswordBasedCipher=_.extend({cfg:_.cfg.extend({kdf:w}),encrypt:function(b,C,F,D){D=this.cfg.extend(D);var R=D.kdf.execute(F,b.keySize,b.ivSize,D.salt,D.hasher);D.iv=R.iv;var T=_.encrypt.call(this,b,C,R.key,D);return T.mixIn(R),T},decrypt:function(b,C,F,D){D=this.cfg.extend(D),C=this._parse(C,D.format);var R=D.kdf.execute(F,b.keySize,b.ivSize,C.salt,D.hasher);D.iv=R.iv;var T=_.decrypt.call(this,b,C,R.key,D);return T}})}()})}(Zt)),Zt.exports}var Pr;function Ir(){return Pr||(Pr=1,function(r,e){(function(t,s,i){r.exports=s(z(),be(),Ae(),we(),ee())})(L,function(t){return function(){var s=t,i=s.lib,n=i.BlockCipher,y=s.algo,d=[],p=[],a=[],c=[],g=[],o=[],u=[],h=[],m=[],f=[];(function(){for(var l=[],v=0;v<256;v++)v<128?l[v]=v<<1:l[v]=v<<1^283;for(var E=0,_=0,v=0;v<256;v++){var A=_^_<<1^_<<2^_<<3^_<<4;A=A>>>8^A&255^99,d[E]=A,p[A]=E;var w=l[E],I=l[w],b=l[I],C=l[A]*257^A*16843008;a[E]=C<<24|C>>>8,c[E]=C<<16|C>>>16,g[E]=C<<8|C>>>24,o[E]=C;var C=b*16843009^I*65537^w*257^E*16843008;u[A]=C<<24|C>>>8,h[A]=C<<16|C>>>16,m[A]=C<<8|C>>>24,f[A]=C,E?(E=w^l[l[l[b^w]]],_^=l[l[_]]):E=_=1}})();var B=[0,1,2,4,8,16,32,64,128,27,54],x=y.AES=n.extend({_doReset:function(){var l;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var v=this._keyPriorReset=this._key,E=v.words,_=v.sigBytes/4,A=this._nRounds=_+6,w=(A+1)*4,I=this._keySchedule=[],b=0;b<w;b++)b<_?I[b]=E[b]:(l=I[b-1],b%_?_>6&&b%_==4&&(l=d[l>>>24]<<24|d[l>>>16&255]<<16|d[l>>>8&255]<<8|d[l&255]):(l=l<<8|l>>>24,l=d[l>>>24]<<24|d[l>>>16&255]<<16|d[l>>>8&255]<<8|d[l&255],l^=B[b/_|0]<<24),I[b]=I[b-_]^l);for(var C=this._invKeySchedule=[],F=0;F<w;F++){var b=w-F;if(F%4)var l=I[b];else var l=I[b-4];F<4||b<=4?C[F]=l:C[F]=u[d[l>>>24]]^h[d[l>>>16&255]]^m[d[l>>>8&255]]^f[d[l&255]]}}},encryptBlock:function(l,v){this._doCryptBlock(l,v,this._keySchedule,a,c,g,o,d)},decryptBlock:function(l,v){var E=l[v+1];l[v+1]=l[v+3],l[v+3]=E,this._doCryptBlock(l,v,this._invKeySchedule,u,h,m,f,p);var E=l[v+1];l[v+1]=l[v+3],l[v+3]=E},_doCryptBlock:function(l,v,E,_,A,w,I,b){for(var C=this._nRounds,F=l[v]^E[0],D=l[v+1]^E[1],R=l[v+2]^E[2],T=l[v+3]^E[3],N=4,Y=1;Y<C;Y++){var j=_[F>>>24]^A[D>>>16&255]^w[R>>>8&255]^I[T&255]^E[N++],X=_[D>>>24]^A[R>>>16&255]^w[T>>>8&255]^I[F&255]^E[N++],K=_[R>>>24]^A[T>>>16&255]^w[F>>>8&255]^I[D&255]^E[N++],$=_[T>>>24]^A[F>>>16&255]^w[D>>>8&255]^I[R&255]^E[N++];F=j,D=X,R=K,T=$}var j=(b[F>>>24]<<24|b[D>>>16&255]<<16|b[R>>>8&255]<<8|b[T&255])^E[N++],X=(b[D>>>24]<<24|b[R>>>16&255]<<16|b[T>>>8&255]<<8|b[F&255])^E[N++],K=(b[R>>>24]<<24|b[T>>>16&255]<<16|b[F>>>8&255]<<8|b[D&255])^E[N++],$=(b[T>>>24]<<24|b[F>>>16&255]<<16|b[D>>>8&255]<<8|b[R&255])^E[N++];l[v]=j,l[v+1]=X,l[v+2]=K,l[v+3]=$},keySize:256/32});s.AES=n._createHelper(x)}(),t.AES})}(Kt)),Kt.exports}var zi=Ir();const Ye=Oe(zi);class ve{constructor(){this.$http=Ve.create({timeout:6e4})}static encryptParams(e){Ke(e,"object")&&(e=JSON.stringify(e));let t=Ye.encrypt(e,O0());return{payload:t.ciphertext.toString(ke),token:`${t.key.toString(ke)}##${t.iv.toString(ke)}`}}static toUnderscore(e){return e.split(/(?=[A-Z])/).join("_").toLowerCase()}static toCamelcase(e){return e.replace(/(\_[a-z])/g,function(t){return t.toUpperCase().replace(/_/g,"")})}static objectKeyToUnderscore(e){let t;return U(e)&&(Array.isArray(e)?(t=[],e.forEach(s=>{let i={};Object.keys(s).forEach(n=>{i[this.toUnderscore(n)]=s[n]}),t.push(i)})):(t={},Object.keys(e).forEach(s=>{t[this.toUnderscore(s)]=e[s]}))),t}static objectKeyToCamel(e){let t;return U(e)&&(Array.isArray(e)?(t=[],e.forEach(s=>{let i={};Object.keys(s).forEach(n=>{i[this.toCamelcase(n)]=s[n]}),t.push(i)})):(t={},Object.keys(e).forEach(s=>{Ke(e[s],"object")&&Object.keys(e[s]).length>0?t[this.toCamelcase(s)]=this.objectKeyToCamel(e[s]):t[this.toCamelcase(s)]=e[s]}))),t}static axiosMultipayConfigure(){Ve.defaults.headers.common["Content-Type"]="application/json",Ve.defaults.headers.common.Accept="application/json",Ve.interceptors.request.use(e=>(U(e.data),this.isHttpBodyUsedMethod(e.method)&&(e.data=ve.encryptParams(ve.objectKeyToUnderscore(e.data))),e.headers!==void 0&&U(e.headers.progress)&&delete e.headers.progress,e),e=>Promise.reject(e)),Ve.interceptors.response.use(e=>e,function(e){if(U(e.response)){let t=e.response.data;return t.status=e.response.status,Promise.reject(t)}else return Promise.reject(e)})}static isHttpBodyUsedMethod(e){return["post","put"].indexOf(e)>-1}}ve.axiosMultipayConfigure();class ji extends ve{constructor(){super()}async pollingStatus(e,t,s,i){try{const n=await this.$http.get([e,"s",t].join("/"),{params:{application_id:s,tk:i}});return Promise.resolve(n)}catch(n){return Promise.reject(n)}}}const Ki=new ji;class Gi extends at{constructor(){super(),this.$messageEventName="message.BootpayPaymentEvent",this.$eventPrefix="bootpay",this.$pollingInterval=void 0,this.$pollingData={applicationId:"",gatewayUrl:"",receiptId:"",transactionKey:""},this.$pollingEvent=Ki,this.pollingInterval=3e3,this.isDone=!1}bind(e,t){this.isDone=!1,this.setCallbackFunction(e,t),window.resetBootpayEventListener(this.$messageEventName,s=>{const i=this.parseEvent(s.data);if(H.debug("event received",JSON.stringify(i)),U(i))switch(H.debug("event",i),i.event){case"error":case"cancel":return this.reject({event:i.event,pg_error_code:i.pg_error_code,error_code:i.error_code,message:i.message,payload:i.payload});case"setConfirmParameters":const n=`${i.gateway_url}/confirm/${i.receipt_id}?application_id=${i.application_id}`;i.open_type==="redirect"?W.setConfirmRedirect(n):W.setConfirmFormUrl(n);break;case"confirm":return this.resolve({event:i.event,receipt_id:i.receipt_id,gateway_url:i.gateway_url,order_id:i.order_id});case"redirect":W.destroy(!1),location.href=i.url;return;case"moveRedirectUrl":W.closePopup(),W.hidePaymentiFrame(),ue.showProgress("결제 진행 중입니다. 잠시만 기다려주세요."),location.replace(Fs(i.url,i.parameters)),setTimeout(()=>{W.destroy(!1)},5e3);break;case"polling":return this.$pollingData!==void 0&&(this.$pollingData.receiptId=i.receipt_id,this.$pollingData.gatewayUrl=i.gateway_url),this.startPollingEvent();case"issued":case"done":if(!this.isDone)return this.isDone=!0,this.clearPollingEvent(),this.resolve(i);break;case"iFrameStyle":W.iFrameSetStyle(i.styles);break;case"windowStyle":W.windowStyle(i.styles);break;case"hideProgress":ue.hideProgress();break;case"showProgress":ue.showProgress(i.message);break;case"resize":W.iFrameResize(i.resizeData);break;case"hidePayment":W.closePopup(),W.hidePaymentiFrame();break;case"showPayment":W.showPaymentiFrame(this.$present(i.showCloseButton)?i.showCloseButton:!1);break;case"popup":W.createPopupButton({gatewayUrl:i.url,receiptId:i.receipt_id,name:i.name,price:i.price});break;case"close":W.destroy();break;default:return}})}setDefaultPaymentData(e,t){this.$pollingData!==void 0&&(this.$pollingData.applicationId=e,this.$pollingData.transactionKey=t)}callBootpayDOMEvent(e,t=void 0){document.dispatchEvent(new CustomEvent([this.$eventPrefix,e].join(""),{detail:t}))}startPollingEvent(){this.$pollingInterval=setInterval(async()=>{if(this.$pollingData!==void 0)try{const e=await this.$pollingEvent.pollingStatus(this.$pollingData.gatewayUrl,this.$pollingData.receiptId,this.$pollingData.applicationId,this.$pollingData.transactionKey);let t={bootpay_event:!0,event:"",data:e.data};if(e.data!==void 0){if(H.debug("polling event",`receive data: ${JSON.stringify(t)}`),e.data.status===1)return t.event="done",window.postMessage(JSON.stringify(t),"*");if(e.data.status===5)return t.event="issued",window.postMessage(JSON.stringify(t),"*")}}catch{return this.reject({error_code:"RC_RECEIPT_POLLING_INVALID",message:"결제 상태 체크에 실패하였습니다."})}},this.pollingInterval)}clearPollingEvent(){this.$pollingInterval!==void 0&&clearInterval(this.$pollingInterval),this.$pollingInterval=void 0,this.$pollingData={applicationId:"",gatewayUrl:"",receiptId:"",transactionKey:""}}allClearEvent(){this.clearPollingEvent(),window.removeBootpayEventListener(this.$messageEventName)}}const ne=new Gi;class Xi extends ve{constructor(){super(),this.$session=Se,this.$applicationId=void 0,this.$tk=void 0,this.$platformType=1,this.$receiptId=void 0}setTokenKey(e){this.$tk=e}setReceiptId(e){this.$receiptId=e}clearInstance(){this.$applicationId=void 0,this.$receiptId=void 0}send(e){try{if(U(this.$applicationId))return e.application_id=this.$applicationId,e.status=U(e.status)?e.status:1,e.version=Be.version,e.tk=this.$tk,H.debug("send event",`${JSON.stringify(e)} 전송됨`),this.$http.post(O.toAnalytics("event"),e)}catch{return}}sendError(e){e.status=-1,this.send(e)}setApplicationId(e){this.$applicationId=e}sendCloseEvent(){if(U(this.$receiptId))try{return this.$http.put(O.toApi(`close/${this.$receiptId}`))}catch(e){return Promise.reject(e)}else return H.debug("receipt_id","undefined receipt_id"),Promise.resolve()}}const Je=new Xi,Qt={startProgress:{PAYMENT:{ko:"결제를 시작합니다",en:"Start Payment..."},CARD_SUBSCRIPTION:{ko:"자동결제 정보를 불러오는 중입니다...",en:"Automatic payment will start..."},AUTH:{ko:"본인인증을 시작합니다",en:"Authentication will start..."}},popupLocaleMessage:{message:{ko:"구매 내역에 동의하면 결제를 진행해주세요",en:"If you agree with the purchase details, please proceed with the payment."},button:{ko:"결제계속하기",en:"Continue"}},popupMessage:{message:{PAYMENT:{ko:"구매 내역에 동의하면 결제를 진행해주세요",en:"If you agree with the purchase details, please proceed with the payment"},CARD_SUBSCRIPTION:{ko:'자동결제에 동의하면 "계속하기" 버튼을 눌러 진행해주세요',en:'If you agree to automatic card payment, press the "Continue" button to proceed'},AUTH:{ko:'본인인증에 동의하면 "계속하기" 버튼을 눌러 진행해주세요',en:'If you agree to authenticate yourself, press the "Continue" button to proceed'}},button:{PAYMENT:{ko:"결제계속하기",en:"Continue"},CARD_SUBSCRIPTION:{ko:"계속하기",en:"Continue"},AUTH:{ko:"계속하기",en:"Continue"}}},closeMessage:{PAYMENT:{ko:"결제창을 닫았습니다",en:"Payment window is closed"},CARD_SUBSCRIPTION:{ko:"자동 결제창을 닫았습니다",en:"Automatic Payment window is closed"},AUTH:{ko:"본인인증 창을 닫았습니다",en:"Authenticate window is closed"}},confirmNotYet:{PAYMENT:{ko:"결제 승인준비가 되지 않았습니다",en:"Payment approval not ready "},CARD_SUBSCRIPTION:{ko:"자동결제 승인준비가 되지 않았습니다",en:"Automatic Payment approval not ready"},AUTH:{ko:"본인인증 승인준비가 되지 않았습니다",en:"Authenticate approval not ready"}},notSelectPayment:{ko:"어떤 방법으로 결제할지 선택해주세요",en:"Please, do select payment."},termsNotAgree:{ko:"필수 약관을 모두 동의해주세요",en:"Please agree to all required terms and conditions"},notSelectBrandpay:{ko:"간편결제로 결제하려면, 등록된 카드 혹은 계좌를 선택해주세요",en:"Please select a registered card or account to pay with Easy Payment"},widgetTypeNotPayment:{ko:"결제 위젯 요청이 아닙니다. 결제 위젯이 아닌 경우 requestSubscription 함수를 이용해주세요.",en:"This is not a payment widget. If it is not a payment widget, use the requestSubscription function."},widgetTypeNotSubscription:{ko:"정기결제 위젯 요청이 아닙니다. 정기결제 위젯이 아닌 경우 requestPayment 함수를 이용해주세요.",en:"This is not a subscription widget. If it is not a subscription widget, use the requestPayment function."},getLocaleMessage:(r,e)=>{const s=r.split(".").reduce((i,n)=>i[n],Qt);return U(s)&&U(s[e])?s[e]:s.ko}};class Vi extends _e{constructor(){super(),this.mode="PAYMENT",this.modeApiUrl={PAYMENT:"request/payment",CARD_SUBSCRIPTION:"request/subscribe",AUTH:"request/authentication"},this.$formId="bootpay-form",this.$iFrameId="bootpay-iframe-id",this.$windowId="bootpay-window-id",this.$paymentWindowId="bootpay-payment-window-id",this.$confirmFormId="bootpay-confirm-form-id",this.$confirmIFrame="bootpay-confirm-iframe-id",this.$popupWindow="bootpay-popup-window-id",this.$closeButton="bootpay-close-btn",this.$popupItemNameId="bootpay-item-name-id",this.$popupPriceId="bootpay-price-id",this.$popup=void 0,this.$popupWatcher=void 0,this.$popupUrl=void 0,this.$env=O,this.$template=this.template()}template(){return`
|
|
17
17
|
<div id="${this.$windowId}" class="bootpay-payment-background">
|
|
18
18
|
<div class="bootpay-payment-window ${O.isMobile()?"__mobile":""}" id="${this.$paymentWindowId}">
|
|
19
19
|
<button class="bootpay-close-btn" id="${this.$closeButton}" style="display: none;" onclick="Bootpay.dismiss()"></button>
|
|
@@ -43,21 +43,10 @@
|
|
|
43
43
|
<iframe id="${this.$confirmIFrame}" name="${this.$confirmIFrame}"></iframe>
|
|
44
44
|
</div>
|
|
45
45
|
</div>
|
|
46
|
-
`}templateReload(){
|
|
46
|
+
`}templateReload(){H.debug("template reload","template reload!"),this.$template=this.template()}async start(e,t="PAYMENT"){return new Promise((s,i)=>{this.mode=t,this.templateReload(),ne.clearPollingEvent(),ne.bind(s,i),ne.setDefaultPaymentData(e.application_id,e.tk),this.createTemplateHtml(),this.bodyOpen(),ue.showProgress(this.message("startProgress"));const n=ve.encryptParams(ve.objectKeyToUnderscore(e)),y=this.byId(this.$formId);y.innerHTML=`
|
|
47
47
|
<input type="hidden" name="payload" value="${n.payload}" />
|
|
48
48
|
<input type="hidden" name="token" value="${n.token}" />
|
|
49
|
-
`,y.action=this.$env.toApi(this.apiUrl()),this.$present(e.extra)&&e.extra.popup,y.target=this.$iFrameId,y.submit()})}setConfirmFormUrl(e){const t=this.byId(this.$confirmIFrame),s=this.byId(this.$confirmFormId);t.style.setProperty("display","block"),s.target=this.$confirmIFrame,s.action=e}setConfirmRedirect(e){const t=this.byId(this.$confirmFormId);t.target="_self",t.action=e}confirm(){return new Promise((e,t)=>{ne.bind(e,t);const s=this.byId(this.$confirmFormId);if(this.$blank(s.action))throw new le({event:"error",error_code:"RC_CONFIRM_READY_NOT_YET",message:this.message("confirmNotYet")});s.submit()})}async startPaymentUrl(e,t="PAYMENT"){return new Promise((s,i)=>{this.mode=t,this.templateReload(),ne.clearPollingEvent(),ne.bind(s,i),ne.setDefaultPaymentData(null,null),ue.showProgress(this.message("startProgress")),this.createTemplateHtml(),this.bodyOpen();const n=this.byId(this.$formId);n.method="GET",n.action=e,n.target=this.$iFrameId,n.submit()})}createPopupButton(e){ue.hideProgress(),this.hidePaymentiFrame(),this.showPopupMessage(e),this.$present(e.gatewayUrl)&&(this.$popupUrl=`${e.gatewayUrl}?popup=1`,Ye.setReceiptId(e.receiptId))}readyToPopup(e=void 0){this.hidePopupMessage(),this.closePopup();const t="width=750,height=500,top=0,left=0,scrollbars=yes,directories=no, status=no, menubar=no, fullscreen=no";this.$popup=window.open(this.getPopupUrl(e),"BootPayPopupInstance",t),this.$popupWatcher=setInterval(async()=>{if(this.$popup===void 0||this.$popup.closed){try{clearInterval(this.$popupWatcher),await Ye.sendCloseEvent()}catch(s){U.debug("popup",Ge(s))}return this.$popupUrl=void 0,ne.reject({event:"cancel",error_code:"RC_CLOSE_WINDOW",message:this.message("closeMessage")})}},500),this.bindParentEventOnPopup()}closePopup(){if(this.$popupWatcher!==void 0)try{clearInterval(this.$popupWatcher),U.debug("close popup","clear popup interval")}catch(e){U.info("clear popup watcher",Ge(e))}if(this.$popup!==void 0&&!this.$popup.closed)try{this.$popup.close(),U.debug("close popup","close popup instance")}catch(e){U.info("popup destroy",Ge(e))}}getPopupUrl(e){return this.$present(e)?e:this.$present(this.$popupUrl)?this.$popupUrl:"about:blank"}bindParentEventOnPopup(){let e="beforeunload.BootpayReloadWatcher";O.isMobileSafari()&&(e="pagehide.BootpayReloadWatcher"),window.resetBootpayEventListener(e,()=>{if(this.$popup!==void 0&&!this.$popup.closed)try{this.$popup.close()}catch(t){U.info("popup destroy",Ge(t))}})}showPaymentiFrame(e=!1){const t=this.byId(this.$iFrameId),s=this.byId(this.$closeButton);t!==void 0&&t.style.setProperty("display","block"),s!==void 0&&e&&s.style.setProperty("display","inline-block")}showPopupMessage(e){const t=this.byId(this.$popupWindow),s=this.byId(this.$popupItemNameId),i=this.byId(this.$popupPriceId);t!==void 0&&t.style.setProperty("display","block"),s!==void 0&&(s.innerText=e.name),i!==void 0&&(parseFloat(e.price)>0?i.innerText=String(e.price).replace(/\B(?=(\d{3})+(?!\d))/g,","):i.remove())}hidePopupMessage(){this.byId(this.$popupWindow).style.setProperty("display","none")}destroy(e=!0){this.$present(document.querySelector("body").className)&&(document.querySelector("body").className=document.querySelector("body").className.replace(/bootpay-open/gi,"")),this.$present(this.byId(this.$windowId))&&(this.byId(this.$windowId).outerHTML=""),document.body.classList.remove("bootpay-open"),ue.hideProgress(),this.closePopup(),ne.allClearEvent(),Ye.clearInstance(),e&&setTimeout(()=>ne.callBootpayDOMEvent("close"),300)}iFrameResize(e){const t=this.byId(this.$iFrameId);if(t!==void 0)for(let s in Object.keys(e)){let i=Object.keys(e)[s],n=e[i];this.$present(n)&&!String(n).match(/%/)&&(i.match(/width/)||i.match(/Width/)||i.match(/height/)||i.match(/Height/))&&(n=`${String(e[i]).replace(/px/gi,"")}px`),String(n).match(/%/)&&!this.byId(this.$paymentWindowId).className.match(/w-100/)&&(this.byId(this.$paymentWindowId).className+=" w-100"),t.style.setProperty(i,n)}}iFrameSetStyle(e){U.debug("change style",e);const t=this.byId(this.$iFrameId);for(let s in Object.keys(e)){let i=Object.keys(e)[s];try{U.debug(i,e[i]),t.style.setProperty(i,e[i])}catch(n){U.warn("iframe style",n==null?void 0:n.message)}}}windowStyle(e){U.debug("change style",e);const t=this.byId(this.$paymentWindowId);for(let s in Object.keys(e)){let i=Object.keys(e)[s];try{U.debug(i,e[i]),t.style.setProperty(i,e[i])}catch(n){U.warn("iframe style",n==null?void 0:n.message)}}}hidePaymentiFrame(){const e=this.byId(this.$iFrameId),t=this.byId(this.$closeButton);e!==void 0&&e.style.setProperty("display","none"),t!==void 0&&t.style.setProperty("display","none")}message(e){return Zt.getLocaleMessage(`${e}.${this.mode}`,O.locale)}moveToUrl(e){const t=this.byId(this.$iFrameId);this.hidePaymentiFrame(),t.removeAttribute("style"),this.iFrameResize({width:O.isMobile()?"100%":400,height:O.isMobile()?"100%":700}),t.style.setProperty("display","block"),t.src=e}apiUrl(){return this.modeApiUrl[this.mode]}}const W=new Gi,Te=class Te extends Oe{constructor(){super(),this.$session=Se,this.$logger=U,this.$event=Ye,this.platformType=Z.PLATFORM.JS,this.$transactionKey="",this.extra={},this.browserBootpayFilter={instagram:/Instagram/i,kakaotalk:/KAKAOTALK/i,facebook:/FBAV/i,naver:/NAVER/i,mobile_safari:/(iPhone|iPad|iPod)/,mobile_chrome:[/Mobile|iP(hone|od|ad)|Android|BlackBerry|IEMobile|Kindle|NetFront|Silk-Accelerated|(hpw|web)OS|Fennec|Minimo|Opera M(obi|ini)|Blazer|Dolfin|Dolphin|Skyfire|Zune/,/Chrome/]}}async requestPayment(e){var t;((t=e.extra)==null?void 0:t.locale)!==void 0&&!O.isSetLocale&&O.setLocale(e.extra.locale),this.$event.clearInstance(),this.generateTransactionKey(),e.application_id=O.currentApplicationId(e.application_id),this.$event.setTokenKey(this.$transactionKey),this.$event.setApplicationId(e.application_id),this.$event.send({step:"start",msg:"결제 요청 시작",request:e}),e.sdk=!0,e.platform_type=this.platformType,e.ver=O.packageVersion,e.sdk_version=O.sdkVersion,e.sdk_type=O.sdkName,e.locale=O.locale,e.price=parseFloat(String(e.price)),e.tax_free=parseFloat(String(e.tax_free)),e.deposit_price=parseFloat(String(e.deposit_price)),Te.invalidRequestParamsData(e),Te.invalidRequestItemsData(e.items,e.price),e.uuid=this.$session.currentUserUUID(),e.sk=this.$session.currentSessionKey(),e.ti=this.$session.currentTimeTerm(),e.tk=this.$transactionKey,e.env=this.getUserDeviceEnvironment(),e.extra=this.openTypeFilter(e.extra),this.extra=e.extra;try{const s=await W.start(e);return U.debug("confirm ready",s),W.hidePaymentiFrame(),W.closePopup(),["done","issued"].indexOf(s.event)===-1&&this.$event.send({step:s.event,msg:"",request:e,response:s}),W.setConfirmFormUrl(`${s.gateway_url}/confirm/${s.receipt_id}?application_id=${e.application_id}`),Promise.resolve(s)}catch(s){return this.eventError(s),Promise.reject(s)}}async confirm(){try{const e=await W.confirm();return Promise.resolve(e)}catch(e){return this.eventError(e),Promise.reject(e)}}eventDone(e,t=!0){var s;this.$logger.debug(e.event,e),this.$event.send({step:e.event,msg:e.event==="done"?"결제완료":"가상계좌발급완료",request:{},response:e}),ue.hideProgress(),this.$logger.debug("show result",this.isDisplaySuccessResult()),this.isDisplaySuccessResult()&&t&&((s=e.data)==null?void 0:s.receipt_id)!==void 0?this.displayResultView(e.data.receipt_id):W.destroy()}eventError(e){ue.hideProgress(),W.closePopup(),this.isDisplayErrorResult()&&e.event==="error"?this.displayResultErrorView(e):W.destroy(),this.$logger.debug("done failed destroy and hide","payment"),this.$event.sendError({step:this.$present(e.event)?e.event:"error",msg:e.message,trace:function(){try{return e.stack}catch{return!1}}()})}generateTransactionKey(){return this.$transactionKey=`${this.$uuid()}-${new Date().getTime()*1e3}`,this.$transactionKey}async requestSubscription(e){this.$event.clearInstance(),this.generateTransactionKey(),this.$event.setTokenKey(this.$transactionKey),this.$event.setApplicationId(e.application_id),this.$event.send({step:"start",msg:"정기결제 요청 시작",request:e}),e.extra=this.openTypeFilter(e.extra);const t={application_id:e.application_id,subscription_id:e.subscription_id,pg:e.pg,method:e.method,order_name:e.order_name,price:e.price,tax_free:e.tax_free,user_token:e.user_token,metadata:e.metadata,redirect_url:e.redirect_url,wallet_id:e.wallet_id,widget:e.widget,widget_key:e.widget_key,widget_sandbox:e.widget_sandbox,subscribe_brandpay_type:e.subscribe_brandpay_type,platform_type:this.platformType,ver:O.packageVersion,sdk_version:O.sdkVersion,sdk_type:O.sdkName,locale:O.locale,sdk:!0,uuid:this.$session.currentUserUUID(),sk:this.$session.currentSessionKey(),tk:this.$transactionKey,env:this.getUserDeviceEnvironment(),user:e.user,extra:e.extra};try{const s=await W.start(t,"CARD_SUBSCRIPTION");switch(U.debug("subscription success",s),this.$event.send({step:"confirm",msg:"결제승인전",request:{},response:s}),W.hidePaymentiFrame(),W.closePopup(),s.event){case"done":case"issued":break;case"confirm":W.setConfirmFormUrl(`${s.gateway_url}/confirm/${s.receipt_id}?application_id=${e.application_id}`)}return Promise.resolve(s)}catch(s){return this.eventError(s),Promise.reject(s)}}async requestAuthentication(e){this.$event.clearInstance(),this.generateTransactionKey(),this.$event.setTokenKey(this.$transactionKey),this.$event.setApplicationId(e.application_id),this.$event.send({step:"start",msg:"본인인증 요청 시작",request:e}),e.extra=this.openTypeFilter(e.extra);const t={application_id:e.application_id,authentication_id:e.authentication_id,pg:e.pg,method:this.$present(e.method)?e.method:"auth",order_name:e.order_name,platform_type:this.platformType,ver:be.version,sdk_version:O.sdkVersion,sdk_type:O.sdkName,locale:O.locale,metadata:e.metadata,redirect_url:e.redirect_url,sdk:!0,uuid:this.$session.currentUserUUID(),sk:this.$session.currentSessionKey(),tk:this.$transactionKey,env:this.getUserDeviceEnvironment(),user:e.user,extra:e.extra};try{const s=await W.start(t,"AUTH");switch(U.debug("authentication success",s),this.$event.send({step:"confirm",msg:"본인인증 승인전",request:{},response:s}),W.hidePaymentiFrame(),W.closePopup(),s.event){case"done":case"issued":break;case"confirm":W.setConfirmFormUrl(`${s.gateway_url}/confirm/${s.receipt_id}?application_id=${e.application_id}`)}return Promise.resolve(s)}catch(s){return this.eventError(s),Promise.reject(s)}}async requestPaymentUrl(e){try{const t=await W.startPaymentUrl(e.url);return["done","issued"].indexOf(t.event)===-1&&this.$event.send({step:t.event,msg:"",request:{url:e.url},response:t}),W.setConfirmFormUrl(`${t.gateway_url}/confirm/${t.receipt_id}?application_id=${e.application_id}`),Promise.resolve(t)}catch(t){return this.eventError(t),Promise.reject(t)}}getUserDeviceEnvironment(){return{width:window.innerWidth,height:window.innerHeight}}isDisplaySuccessResult(){return this.extra!==void 0&&this.extra.display_success_result!==void 0&&this.extra.display_success_result}isDisplayErrorResult(){return this.extra!==void 0&&this.extra.display_error_result!==void 0&&this.extra.display_error_result}displayResultView(e){W.moveToUrl(O.toDoor(`result/${e}`))}displayResultErrorView(e){W.moveToUrl(O.toDoor(`error?error_code=${e.error_code}&pg_error_code=${e.pg_error_code}&message=${e.message}`))}openTypeFilter(e){if(this.$present(e)&&e.browser_open_type!==void 0){const t=this.getUserAgent();for(let s in e.browser_open_type){const i=e.browser_open_type[s],n=this.$present(this.browserBootpayFilter[i.browser])?this.browserBootpayFilter[i.browser]:new RegExp(`${i.browser}`);if(t.match(n)){e.open_type=i.open_type;break}}}return e}static invalidRequestParamsData(e){if(re(e))throw new le({event:"error",error_code:"NEED_MORE_PARAMS",message:"결제 요청을 위한 최소한의 결제 정보를 입력해주세요."});Object.keys(Te.invalidRequestParams).forEach(t=>{const s=e[t];if(re(s))throw new le({event:"error",error_code:"INVALID_REQUEST_PARAMS",message:Te.invalidRequestParams[t]})})}static invalidRequestItemsData(e,t){if(e!==void 0&&L(e)){let s=0;if(e.forEach((i,n)=>{if(re(i.id))throw new le({event:"error",error_code:"NEED_ITEM_ID",message:`${n+1}번째 상품 고유 ID를 입력해주세요. [ key: id ]`});if(re(i.name))throw new le({event:"error",error_code:"NEED_ITEM_NAME",message:`${n+1}번째 상품명을 입력해주세요. [ key: name ]`});if(re(i.qty))throw new le({event:"error",error_code:"NEED_ITEM_QTY",message:`${n+1}번째 상품수량을 입력해주세요. [ key: qty ]`});if(re(i.price))throw new le({event:"error",error_code:"NEED_ITEM_PRICE",message:`${n+1}번째 상품금액을 입력해주세요. [ key: price ]`});e[n].price=parseFloat(String(e[n].price)),e[n].qty=parseFloat(String(e[n].qty)),s+=e[n].price*e[n].qty}),s!==t)throw new le({event:"error",error_code:"NEED_ITEM_TOTAL_PRICE_NOT_MATCH",message:`결제 금액과 상품 수량 및 상품 금액의 총합과 일치하지 않습니다. [ 요청금액: ${t} ${typeof t}, 상품 총합계 금액: ${s} ${typeof s} ]`})}}};Te.invalidRequestParams={application_id:"application_id를 입력해주세요. [ key: application_id ]",order_name:"판매할 상품명을 입력해주세요. [ key: order_name ]",price:"판매할 상품의 금액을 입력해주세요. [ key: price ]",order_id:"가맹점에서 설정할 주문 ID를 입력해주세요. [ key: order_id ]"};let Je=Te;const Xi=new Je;class Vi extends ve{constructor(){super(),this.$session=Se}setAnalyticsData(e){this.$session.setTime(e.time),this.$session.setUUID(e.uuid)}async send(e){const t=document.URL;if(t!==void 0&&t.search(/bootapi.co.kr/)===-1){const s=this.$session.getUser();e.application_id=O.currentApplicationId(e.application_id),e.sk=this.$session.currentSessionKey(),e.uuid=this.$session.currentUserUUID(),e.time=this.$session.currentTime(),e.url=t,e.referer=document.referrer!==void 0&&L(document.referrer)&&document.referrer.search(new RegExp(window.location.hostname))==-1?document.referrer:"",e.user_id=s===void 0||re(s)?void 0:s.id,e.items=this.generateItemKeyToVersion1(e.items);try{const i=await this.$http.post(O.toAnalytics(`call?ver=${be.version}`),e);return i.data.status===200?(U.info("Analytics Common Send","통계 데이터가 전송되었습니다."),Promise.resolve()):(U.warn("Analytics Common Send",`통계 데이터가 전송 실패. ${JSON.stringify(i.data)}`),Promise.reject())}catch(i){return U.error("Analytics Common Error",`데이터 전송 실패: ${i.message}`),Promise.reject()}}}async login(e){if(e.application_id=O.currentApplicationId(e.application_id),re(e.application_id))return U.error("Analytics Params","application_id 값을 입력해주세요.");if(re(e.id))return U.error("Analytics Params","id 값을 입력해주세요.");try{const t=await this.$http.post(O.toAnalytics(`login?ver=${be.version}`),e),{user_id:s}=t.data.data;return this.$session.setUser({id:s,time:new Date().getTime()}),Promise.resolve()}catch(t){return U.error("Analytics Login Error",`데이터 전송 실패: ${t.message}`),Promise.reject()}}logout(){this.$session.setUser(void 0)}generateItemKeyToVersion1(e){if(e!==void 0)return e.map(t=>({cat1:t.cat1,cat2:t.cat2,cat3:t.cat3,item_img:t.img,item_name:t.name,unique:t.id,price:t.price}))}}const Yi=new Vi;(function(){if(typeof window>"u"||typeof window.CustomEvent=="function")return!1;function r(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};let s=document.createEvent("CustomEvent");return s.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),s}r.prototype=window.Event.prototype,window.CustomEvent=r})();const ge={$payment:Xi,$analytics:Yi,$environment:O,async requestPayment(r){return new Promise(async(e,t)=>{try{r.extra!==void 0&&r.extra.override_global_event===!0&&(U.debug("override global event","override global event!"),ge.overrideGlobalInstance());const s=await this.$payment.requestPayment(r);setTimeout(()=>{e(s),["done","issued"].indexOf(s.event)>-1&&this.$payment.eventDone(s)},100)}catch(s){setTimeout(()=>{t(this.errorHandler(s))},100)}})},async confirm(){return new Promise(async(r,e)=>{try{const t=await this.$payment.confirm();setTimeout(()=>{r(t),this.$payment.eventDone(t)},100)}catch(t){setTimeout(()=>e(this.errorHandler(t)),100)}})},async requestSubscription(r){return new Promise(async(e,t)=>{try{const s=await this.$payment.requestSubscription(r);e(s),this.$payment.eventDone(s)}catch(s){return t(this.errorHandler(s))}})},async requestAuthentication(r){return new Promise(async(e,t)=>{try{const s=await this.$payment.requestAuthentication(r);e(s),this.$payment.eventDone(s)}catch(s){return t(this.errorHandler(s))}})},async requestPaymentUrl(r){return new Promise(async(e,t)=>{try{const s=await this.$payment.requestPaymentUrl(r);setTimeout(()=>{e(s),["done","issued"].indexOf(s.event)>-1&&this.$payment.eventDone(s)},100)}catch(s){setTimeout(()=>{t(this.errorHandler(s))},100)}})},setEnvironmentMode(r,e=void 0){this.$environment.set(r),e!==void 0&&this.$environment.setDevelopmentHost(e)},setApplicationId(r){return this.$environment.setApplicationId(r)},setVersion(r,e,t){return this.$environment.setVersion(r,e,t)},setDevice(r){switch(r){case"IOS":this.$payment.platformType=Z.PLATFORM.IOS;break;case"ANDROID":this.$payment.platformType=Z.PLATFORM.ANDROID;break;default:this.$payment.platformType=Z.PLATFORM.JS}return this.$payment.platformType},errorHandler(r){let e;switch(ue.hideProgress(),r.name){case"BootpayEventError":e=r.eventMessage;break;default:if(L(r.event))e=r;else throw r}return e},readyToPopup(){W.readyToPopup()},setLogLevel(r){U.setLogLevel(r)},setUUID(r){return Se.setUUID(r)},send(r=void 0){return this.$analytics.send(r!==void 0?r:{})},login(r){return this.$analytics.login(r)},logout(){return this.$analytics.logout()},setLocale(r){O.setLocale(r),W.templateReload()},async dismiss(r=!1){if(r)try{await Ye.sendCloseEvent()}catch(e){U.debug("error",e.message)}ne.reject({event:"cancel",error_code:"RC_CLOSE_WINDOW",message:"사용자가 결제창을 닫았습니다."})},getCurrentUUID(){return Se.currentUserUUID()},destroy(){W.destroy()},overrideGlobalInstance(){window.Bootpay=ge}};typeof window<"u"&&(window.Bootpay=ge);class Ji extends nt{constructor(){super(),this.$messageEventName="message.BootpayUserTokenEvent"}bind(e,t){this.setCallbackFunction(e,t),window.resetBootpayEventListener(this.$messageEventName,s=>{const i=this.parseEvent(s.data);if(L(i))switch(U.debug("event",i),i.event){case"error":case"cancel":return this.reject({event:i.event,pg_error_code:i.pg_error_code,error_code:i.error_code,message:i.message,payload:i.payload});case"data":return this.resolve(i.data);case"confirmPasswordToken":return this.resolve(i.token);case"confirmAddCard":return this.resolve(i);case"resize":Pr.iFrameResize(i.resizeData);break;default:return}})}}class Zi extends _e{constructor(){super(),this.$windowId="bootpay-user-token-background-id",this.$userWindowId="bootpay-user-token-window-id",this.$iFrameId="bootpay-user-token-iframe-id",this.$bootpaySdkFormId="bootpay-user-token-sdk-form",this.$template=this.template(),this.$event=new Ji,this.$session=Se,this.deviceType=Z.PLATFORM.JS}setDevice(e){return this.deviceType=e,this.deviceType}template(){return`
|
|
50
|
-
<div id="${this.$windowId}" class="bootpay-payment-background">
|
|
51
|
-
<div class="bootpay-payment-window" id="${this.$userWindowId}">
|
|
52
|
-
<iframe id="${this.$iFrameId}" name="${this.$iFrameId}"></iframe>
|
|
53
|
-
<form name="${this.$bootpaySdkFormId}" id="${this.$bootpaySdkFormId}" method="GET">
|
|
54
|
-
</form>
|
|
55
|
-
</div>
|
|
56
|
-
</div>
|
|
57
|
-
`}setParams(e,t){if(t!==void 0){const s=this.byId(this.$bootpaySdkFormId);if(["POST","PUT"].indexOf(e.toUpperCase())>-1){const i=ve.encryptParams(ve.objectKeyToUnderscore(t));s.innerHTML=`
|
|
58
|
-
<input type="hidden" name="payload" value="${i.payload}" />
|
|
59
|
-
<input type="hidden" name="token" value="${i.token}" />
|
|
60
|
-
`}else{let i="";e.toUpperCase()==="DELETE"&&(i+='<input type="hidden" name="_method" value="patch"/>'),Object.keys(t).forEach(n=>{i+=`<input type="hidden" name="${n}" value="${t[n]}"/>`}),s.innerHTML=i}}}request(e,t){return new Promise((s,i)=>{this.createTemplateHtml(),this.bodyOpen(),this.$event.bind(s,i),this.goiFrameUrl("GET",O.toDoor(`sdk/password/${t}`),{type:e,uuid:this.$session.currentUserUUID()})})}addCard(e){return new Promise((t,s)=>{this.createTemplateHtml(),this.bodyOpen(),this.$event.bind(t,s),this.goiFrameUrl("GET",O.toDoor(`sdk/card/${e}`),{uuid:this.$session.currentUserUUID()})})}wallets(e){return new Promise((t,s)=>{this.createTemplateHtml(),this.bodyOpen(),this.$event.bind(t,s),this.goiFrameUrl("GET",O.toApi("sdk/easy/wallet"),{user_token:e,sdk:!0,uuid:this.$session.currentUserUUID()})})}destroyWallet(e){return new Promise((t,s)=>{this.createTemplateHtml(),this.bodyOpen(),this.$event.bind(t,s),this.goiFrameUrl("POST",O.toApi("sdk/easy/wallet"),{method:"DELETE",sdk:!0,user_token:e.user_token,wallet_id:e.wallet_id,token:e.token,uuid:this.$session.currentUserUUID()})})}createBiometricAuthenticate(e){return new Promise((t,s)=>{this.createTemplateHtml(),this.bodyOpen(),this.$event.bind(t,s),this.goiFrameUrl("POST",O.toApi("sdk/easy/biometric"),{user_token:e.userToken,sdk:!0,uuid:this.$session.currentUserUUID(),os:e.os,token:e.token})})}destroyBiometricAuthenticate(e){return new Promise((t,s)=>{this.createTemplateHtml(),this.bodyOpen(),this.$event.bind(t,s),this.goiFrameUrl("POST",O.toApi("sdk/easy/biometric"),{method:"DELETE",uuid:this.$session.currentUserUUID(),user_token:e.userToken,token:e.token})})}requestWalletPayment(e){return new Promise((t,s)=>{this.createTemplateHtml(),this.bodyOpen(),this.$event.bind(t,s),this.goiFrameUrl("POST",O.toApi("sdk/easy/card"),this.regenerateRequestPayment(e))})}goiFrameUrl(e,t,s=void 0){this.setParams(e,s);const i=this.byId(this.$bootpaySdkFormId);i.method=this.toMethod(e),i.action=t,i.target=this.$iFrameId,i.submit(),this.show()}toMethod(e){switch(e.toUpperCase()){case"PUT":return"POST";case"DELETE":return"POST";default:return e}}iFrameResize(e){const t=this.byId(this.$iFrameId);if(t!==void 0)for(let s in Object.keys(e)){let i=Object.keys(e)[s],n=e[i];this.$present(n)&&!String(n).match(/%/)&&(i.match(/width/)||i.match(/Width/)||i.match(/height/)||i.match(/Height/))&&(n=`${String(e[i]).replace(/px/gi,"")}px`),String(n).match(/%/)&&!this.byId(this.$userWindowId).className.match(/w-100/)&&(this.byId(this.$userWindowId).className+=" w-100"),t.style.setProperty(i,n)}}regenerateRequestPayment(e){return e.ver=be.version,e.platform_type=this.deviceType,e.sdk=!0,e.price=parseFloat(String(e.price)),e.tax_free=parseFloat(String(e.tax_free)),Je.invalidRequestParamsData(e),Je.invalidRequestItemsData(e.items,e.price),e.uuid=this.$session.currentUserUUID(),e.sk=this.$session.currentSessionKey(),e.ti=this.$session.currentTimeTerm(),e.tk=`${this.$uuid()}-${new Date().getTime()*1e3}`,e}show(){const e=this.byId(this.$iFrameId);e!==void 0&&e.style.setProperty("display","block")}destroy(){this.$present(document.querySelector("body").className)&&(document.querySelector("body").className=document.querySelector("body").className.replace(/bootpay-open/gi,"")),this.$present(this.byId(this.$windowId))&&(this.byId(this.$windowId).outerHTML=""),document.body.classList.remove("bootpay-open"),ne.clearPollingEvent(),setTimeout(()=>ne.callBootpayDOMEvent("close"),300)}}const Pr=new Zi,Ir={$templateUserToken:Pr,async requestPasswordToken(r){try{const e=await this.$templateUserToken.request("passwordToken",r);return this.$templateUserToken.destroy(),Promise.resolve(e)}catch(e){return this.$templateUserToken.destroy(),Promise.reject(this.errorHandler(e))}},async requestChangePassword(r){try{const e=await this.$templateUserToken.request("changePasswordToken",r);return this.$templateUserToken.destroy(),Promise.resolve(e)}catch(e){return this.$templateUserToken.destroy(),Promise.reject(this.errorHandler(e))}},async requestAddCard(r){try{const e=await this.$templateUserToken.addCard(r);return this.$templateUserToken.destroy(),Promise.resolve(e)}catch(e){return this.$templateUserToken.destroy(),Promise.reject(this.errorHandler(e))}},async wallets(r){try{const e=await this.$templateUserToken.wallets(r);return this.$templateUserToken.destroy(),Promise.resolve(e)}catch(e){return this.$templateUserToken.destroy(),Promise.reject(this.errorHandler(e))}},async destroyWallet(r){try{const e=await this.$templateUserToken.destroyWallet(r);return this.$templateUserToken.destroy(),Promise.resolve(e)}catch(e){return this.$templateUserToken.destroy(),Promise.reject(this.errorHandler(e))}},async createBiometricAuthenticate(r){try{const e=await this.$templateUserToken.createBiometricAuthenticate(r);return this.$templateUserToken.destroy(),Promise.resolve(e)}catch(e){return this.$templateUserToken.destroy(),Promise.reject(this.errorHandler(e))}},async destroyBiometricAuthenticate(r){try{const e=await this.$templateUserToken.destroyBiometricAuthenticate(r);return this.$templateUserToken.destroy(),Promise.resolve(e)}catch(e){return this.$templateUserToken.destroy(),Promise.reject(this.errorHandler(e))}},async requestWalletPayment(r){try{const e=await this.$templateUserToken.requestWalletPayment(r);return this.$templateUserToken.destroy(),Promise.resolve(e)}catch(e){return this.$templateUserToken.destroy(),Promise.reject(this.errorHandler(e))}},setEnvironmentMode(r,e=void 0){O.set(r),e!==void 0&&O.setDevelopmentHost(e)},setDevice(r){let e=Z.PLATFORM.JS;switch(r.toUpperCase()){case"IOS":e=Z.PLATFORM.IOS;break;case"ANDROID":e=Z.PLATFORM.ANDROID;break}return this.$templateUserToken.setDevice(e)},errorHandler(r){let e;switch(ue.hideProgress(),r.name){case"BootpayEventError":e=r.eventMessage;break;default:if(L(r.event))e=r;else throw r}return e},setLogLevel(r){U.setLogLevel(r)},setUUID(r){return Se.setUUID(r)},dismiss(){ne.reject({event:"cancel",error_code:"RC_CLOSE_WINDOW",message:"사용자가 결제창을 닫았습니다."})}};typeof window<"u"&&(window.BootpaySDK=Ir);var Qi=Ae();const Tr=Re(Qi),Qt={parameterPrefix:"__b_",updateParameters({parameters:r,replace:e}){const t=new URL(window.location),s=Object.fromEntries(new URLSearchParams(location.search));Object.keys(s).forEach(i=>{i.match(this.parameterPrefix)?t.searchParams.delete(i):t.searchParams.set(i,s[i])}),r&&Object.keys(r).forEach(i=>{const n=`${this.parameterPrefix}${i}`;t.searchParams.set(n,r[i])}),e?window.history.replaceState(t.toString(),"",t.toString()):window.history.pushState(r,"",t.toString())}};var Rr={exports:{}},e0={exports:{}},Or;function pt(){return Or||(Or=1,function(r,e){(function(t,s){r.exports=s(z())})(N,function(t){return function(s){var i=t,n=i.lib,y=n.Base,x=n.WordArray,p=i.x64={};p.Word=y.extend({init:function(a,c){this.high=a,this.low=c}}),p.WordArray=y.extend({init:function(a,c){a=this.words=a||[],c!=s?this.sigBytes=c:this.sigBytes=a.length*8},toX32:function(){for(var a=this.words,c=a.length,g=[],o=0;o<c;o++){var u=a[o];g.push(u.high),g.push(u.low)}return x.create(g,this.sigBytes)},clone:function(){for(var a=y.clone.call(this),c=a.words=this.words.slice(0),g=c.length,o=0;o<g;o++)c[o]=c[o].clone();return a}})}(),t})}(e0)),e0.exports}var t0={exports:{}},Ur;function en(){return Ur||(Ur=1,function(r,e){(function(t,s){r.exports=s(z())})(N,function(t){return function(){if(typeof ArrayBuffer=="function"){var s=t,i=s.lib,n=i.WordArray,y=n.init,x=n.init=function(p){if(p instanceof ArrayBuffer&&(p=new Uint8Array(p)),(p instanceof Int8Array||typeof Uint8ClampedArray<"u"&&p instanceof Uint8ClampedArray||p instanceof Int16Array||p instanceof Uint16Array||p instanceof Int32Array||p instanceof Uint32Array||p instanceof Float32Array||p instanceof Float64Array)&&(p=new Uint8Array(p.buffer,p.byteOffset,p.byteLength)),p instanceof Uint8Array){for(var a=p.byteLength,c=[],g=0;g<a;g++)c[g>>>2]|=p[g]<<24-g%4*8;y.call(this,c,a)}else y.apply(this,arguments)};x.prototype=n}}(),t.lib.WordArray})}(t0)),t0.exports}var r0={exports:{}},Hr;function tn(){return Hr||(Hr=1,function(r,e){(function(t,s){r.exports=s(z())})(N,function(t){return function(){var s=t,i=s.lib,n=i.WordArray,y=s.enc;y.Utf16=y.Utf16BE={stringify:function(p){for(var a=p.words,c=p.sigBytes,g=[],o=0;o<c;o+=2){var u=a[o>>>2]>>>16-o%4*8&65535;g.push(String.fromCharCode(u))}return g.join("")},parse:function(p){for(var a=p.length,c=[],g=0;g<a;g++)c[g>>>1]|=p.charCodeAt(g)<<16-g%2*16;return n.create(c,a*2)}},y.Utf16LE={stringify:function(p){for(var a=p.words,c=p.sigBytes,g=[],o=0;o<c;o+=2){var u=x(a[o>>>2]>>>16-o%4*8&65535);g.push(String.fromCharCode(u))}return g.join("")},parse:function(p){for(var a=p.length,c=[],g=0;g<a;g++)c[g>>>1]|=x(p.charCodeAt(g)<<16-g%2*16);return n.create(c,a*2)}};function x(p){return p<<8&4278255360|p>>>8&16711935}}(),t.enc.Utf16})}(r0)),r0.exports}var s0={exports:{}},Nr;function rn(){return Nr||(Nr=1,function(r,e){(function(t,s){r.exports=s(z())})(N,function(t){return function(){var s=t,i=s.lib,n=i.WordArray,y=s.enc;y.Base64url={stringify:function(p,a){a===void 0&&(a=!0);var c=p.words,g=p.sigBytes,o=a?this._safe_map:this._map;p.clamp();for(var u=[],f=0;f<g;f+=3)for(var m=c[f>>>2]>>>24-f%4*8&255,h=c[f+1>>>2]>>>24-(f+1)%4*8&255,b=c[f+2>>>2]>>>24-(f+2)%4*8&255,d=m<<16|h<<8|b,l=0;l<4&&f+l*.75<g;l++)u.push(o.charAt(d>>>6*(3-l)&63));var v=o.charAt(64);if(v)for(;u.length%4;)u.push(v);return u.join("")},parse:function(p,a){a===void 0&&(a=!0);var c=p.length,g=a?this._safe_map:this._map,o=this._reverseMap;if(!o){o=this._reverseMap=[];for(var u=0;u<g.length;u++)o[g.charCodeAt(u)]=u}var f=g.charAt(64);if(f){var m=p.indexOf(f);m!==-1&&(c=m)}return x(p,c,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"};function x(p,a,c){for(var g=[],o=0,u=0;u<a;u++)if(u%4){var f=c[p.charCodeAt(u-1)]<<u%4*2,m=c[p.charCodeAt(u)]>>>6-u%4*2,h=f|m;g[o>>>2]|=h<<24-o%4*8,o++}return n.create(g,o)}}(),t.enc.Base64url})}(s0)),s0.exports}var i0={exports:{}},Lr;function n0(){return Lr||(Lr=1,function(r,e){(function(t,s){r.exports=s(z())})(N,function(t){return function(s){var i=t,n=i.lib,y=n.WordArray,x=n.Hasher,p=i.algo,a=[],c=[];(function(){function u(b){for(var d=s.sqrt(b),l=2;l<=d;l++)if(!(b%l))return!1;return!0}function f(b){return(b-(b|0))*4294967296|0}for(var m=2,h=0;h<64;)u(m)&&(h<8&&(a[h]=f(s.pow(m,1/2))),c[h]=f(s.pow(m,1/3)),h++),m++})();var g=[],o=p.SHA256=x.extend({_doReset:function(){this._hash=new y.init(a.slice(0))},_doProcessBlock:function(u,f){for(var m=this._hash.words,h=m[0],b=m[1],d=m[2],l=m[3],v=m[4],E=m[5],_=m[6],A=m[7],w=0;w<64;w++){if(w<16)g[w]=u[f+w]|0;else{var I=g[w-15],B=(I<<25|I>>>7)^(I<<14|I>>>18)^I>>>3,C=g[w-2],F=(C<<15|C>>>17)^(C<<13|C>>>19)^C>>>10;g[w]=B+g[w-7]+F+g[w-16]}var D=v&E^~v&_,T=h&b^h&d^b&d,R=(h<<30|h>>>2)^(h<<19|h>>>13)^(h<<10|h>>>22),H=(v<<26|v>>>6)^(v<<21|v>>>11)^(v<<7|v>>>25),Y=A+H+D+c[w]+g[w],j=R+T;A=_,_=E,E=v,v=l+Y|0,l=d,d=b,b=h,h=Y+j|0}m[0]=m[0]+h|0,m[1]=m[1]+b|0,m[2]=m[2]+d|0,m[3]=m[3]+l|0,m[4]=m[4]+v|0,m[5]=m[5]+E|0,m[6]=m[6]+_|0,m[7]=m[7]+A|0},_doFinalize:function(){var u=this._data,f=u.words,m=this._nDataBytes*8,h=u.sigBytes*8;return f[h>>>5]|=128<<24-h%32,f[(h+64>>>9<<4)+14]=s.floor(m/4294967296),f[(h+64>>>9<<4)+15]=m,u.sigBytes=f.length*4,this._process(),this._hash},clone:function(){var u=x.clone.call(this);return u._hash=this._hash.clone(),u}});i.SHA256=x._createHelper(o),i.HmacSHA256=x._createHmacHelper(o)}(Math),t.SHA256})}(i0)),i0.exports}var o0={exports:{}},Mr;function sn(){return Mr||(Mr=1,function(r,e){(function(t,s,i){r.exports=s(z(),n0())})(N,function(t){return function(){var s=t,i=s.lib,n=i.WordArray,y=s.algo,x=y.SHA256,p=y.SHA224=x.extend({_doReset:function(){this._hash=new n.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var a=x._doFinalize.call(this);return a.sigBytes-=4,a}});s.SHA224=x._createHelper(p),s.HmacSHA224=x._createHmacHelper(p)}(),t.SHA224})}(o0)),o0.exports}var a0={exports:{}},qr;function Wr(){return qr||(qr=1,function(r,e){(function(t,s,i){r.exports=s(z(),pt())})(N,function(t){return function(){var s=t,i=s.lib,n=i.Hasher,y=s.x64,x=y.Word,p=y.WordArray,a=s.algo;function c(){return x.create.apply(x,arguments)}var g=[c(1116352408,3609767458),c(1899447441,602891725),c(3049323471,3964484399),c(3921009573,2173295548),c(961987163,4081628472),c(1508970993,3053834265),c(2453635748,2937671579),c(2870763221,3664609560),c(3624381080,2734883394),c(310598401,1164996542),c(607225278,1323610764),c(1426881987,3590304994),c(1925078388,4068182383),c(2162078206,991336113),c(2614888103,633803317),c(3248222580,3479774868),c(3835390401,2666613458),c(4022224774,944711139),c(264347078,2341262773),c(604807628,2007800933),c(770255983,1495990901),c(1249150122,1856431235),c(1555081692,3175218132),c(1996064986,2198950837),c(2554220882,3999719339),c(2821834349,766784016),c(2952996808,2566594879),c(3210313671,3203337956),c(3336571891,1034457026),c(3584528711,2466948901),c(113926993,3758326383),c(338241895,168717936),c(666307205,1188179964),c(773529912,1546045734),c(1294757372,1522805485),c(1396182291,2643833823),c(1695183700,2343527390),c(1986661051,1014477480),c(2177026350,1206759142),c(2456956037,344077627),c(2730485921,1290863460),c(2820302411,3158454273),c(3259730800,3505952657),c(3345764771,106217008),c(3516065817,3606008344),c(3600352804,1432725776),c(4094571909,1467031594),c(275423344,851169720),c(430227734,3100823752),c(506948616,1363258195),c(659060556,3750685593),c(883997877,3785050280),c(958139571,3318307427),c(1322822218,3812723403),c(1537002063,2003034995),c(1747873779,3602036899),c(1955562222,1575990012),c(2024104815,1125592928),c(2227730452,2716904306),c(2361852424,442776044),c(2428436474,593698344),c(2756734187,3733110249),c(3204031479,2999351573),c(3329325298,3815920427),c(3391569614,3928383900),c(3515267271,566280711),c(3940187606,3454069534),c(4118630271,4000239992),c(116418474,1914138554),c(174292421,2731055270),c(289380356,3203993006),c(460393269,320620315),c(685471733,587496836),c(852142971,1086792851),c(1017036298,365543100),c(1126000580,2618297676),c(1288033470,3409855158),c(1501505948,4234509866),c(1607167915,987167468),c(1816402316,1246189591)],o=[];(function(){for(var f=0;f<80;f++)o[f]=c()})();var u=a.SHA512=n.extend({_doReset:function(){this._hash=new p.init([new x.init(1779033703,4089235720),new x.init(3144134277,2227873595),new x.init(1013904242,4271175723),new x.init(2773480762,1595750129),new x.init(1359893119,2917565137),new x.init(2600822924,725511199),new x.init(528734635,4215389547),new x.init(1541459225,327033209)])},_doProcessBlock:function(f,m){for(var h=this._hash.words,b=h[0],d=h[1],l=h[2],v=h[3],E=h[4],_=h[5],A=h[6],w=h[7],I=b.high,B=b.low,C=d.high,F=d.low,D=l.high,T=l.low,R=v.high,H=v.low,Y=E.high,j=E.low,X=_.high,K=_.low,$=A.high,S=A.low,P=w.high,k=w.low,J=I,V=B,ae=C,q=F,Ze=D,qe=T,P0=R,Qe=H,ye=Y,xe=j,ht=X,et=K,vt=$,tt=S,I0=P,rt=k,me=0;me<80;me++){var pe,De,yt=o[me];if(me<16)De=yt.high=f[m+me*2]|0,pe=yt.low=f[m+me*2+1]|0;else{var ps=o[me-15],We=ps.high,st=ps.low,Mn=(We>>>1|st<<31)^(We>>>8|st<<24)^We>>>7,fs=(st>>>1|We<<31)^(st>>>8|We<<24)^(st>>>7|We<<25),hs=o[me-2],ze=hs.high,it=hs.low,qn=(ze>>>19|it<<13)^(ze<<3|it>>>29)^ze>>>6,vs=(it>>>19|ze<<13)^(it<<3|ze>>>29)^(it>>>6|ze<<26),ys=o[me-7],Wn=ys.high,zn=ys.low,ms=o[me-16],jn=ms.high,Es=ms.low;pe=fs+zn,De=Mn+Wn+(pe>>>0<fs>>>0?1:0),pe=pe+vs,De=De+qn+(pe>>>0<vs>>>0?1:0),pe=pe+Es,De=De+jn+(pe>>>0<Es>>>0?1:0),yt.high=De,yt.low=pe}var Kn=ye&ht^~ye&vt,gs=xe&et^~xe&tt,Gn=J&ae^J&Ze^ae&Ze,Xn=V&q^V&qe^q&qe,Vn=(J>>>28|V<<4)^(J<<30|V>>>2)^(J<<25|V>>>7),Bs=(V>>>28|J<<4)^(V<<30|J>>>2)^(V<<25|J>>>7),Yn=(ye>>>14|xe<<18)^(ye>>>18|xe<<14)^(ye<<23|xe>>>9),Jn=(xe>>>14|ye<<18)^(xe>>>18|ye<<14)^(xe<<23|ye>>>9),bs=g[me],Zn=bs.high,_s=bs.low,de=rt+Jn,$e=I0+Yn+(de>>>0<rt>>>0?1:0),de=de+gs,$e=$e+Kn+(de>>>0<gs>>>0?1:0),de=de+_s,$e=$e+Zn+(de>>>0<_s>>>0?1:0),de=de+pe,$e=$e+De+(de>>>0<pe>>>0?1:0),Cs=Bs+Xn,Qn=Vn+Gn+(Cs>>>0<Bs>>>0?1:0);I0=vt,rt=tt,vt=ht,tt=et,ht=ye,et=xe,xe=Qe+de|0,ye=P0+$e+(xe>>>0<Qe>>>0?1:0)|0,P0=Ze,Qe=qe,Ze=ae,qe=q,ae=J,q=V,V=de+Cs|0,J=$e+Qn+(V>>>0<de>>>0?1:0)|0}B=b.low=B+V,b.high=I+J+(B>>>0<V>>>0?1:0),F=d.low=F+q,d.high=C+ae+(F>>>0<q>>>0?1:0),T=l.low=T+qe,l.high=D+Ze+(T>>>0<qe>>>0?1:0),H=v.low=H+Qe,v.high=R+P0+(H>>>0<Qe>>>0?1:0),j=E.low=j+xe,E.high=Y+ye+(j>>>0<xe>>>0?1:0),K=_.low=K+et,_.high=X+ht+(K>>>0<et>>>0?1:0),S=A.low=S+tt,A.high=$+vt+(S>>>0<tt>>>0?1:0),k=w.low=k+rt,w.high=P+I0+(k>>>0<rt>>>0?1:0)},_doFinalize:function(){var f=this._data,m=f.words,h=this._nDataBytes*8,b=f.sigBytes*8;m[b>>>5]|=128<<24-b%32,m[(b+128>>>10<<5)+30]=Math.floor(h/4294967296),m[(b+128>>>10<<5)+31]=h,f.sigBytes=m.length*4,this._process();var d=this._hash.toX32();return d},clone:function(){var f=n.clone.call(this);return f._hash=this._hash.clone(),f},blockSize:1024/32});s.SHA512=n._createHelper(u),s.HmacSHA512=n._createHmacHelper(u)}(),t.SHA512})}(a0)),a0.exports}var c0={exports:{}},zr;function nn(){return zr||(zr=1,function(r,e){(function(t,s,i){r.exports=s(z(),pt(),Wr())})(N,function(t){return function(){var s=t,i=s.x64,n=i.Word,y=i.WordArray,x=s.algo,p=x.SHA512,a=x.SHA384=p.extend({_doReset:function(){this._hash=new y.init([new n.init(3418070365,3238371032),new n.init(1654270250,914150663),new n.init(2438529370,812702999),new n.init(355462360,4144912697),new n.init(1731405415,4290775857),new n.init(2394180231,1750603025),new n.init(3675008525,1694076839),new n.init(1203062813,3204075428)])},_doFinalize:function(){var c=p._doFinalize.call(this);return c.sigBytes-=16,c}});s.SHA384=p._createHelper(a),s.HmacSHA384=p._createHmacHelper(a)}(),t.SHA384})}(c0)),c0.exports}var x0={exports:{}},jr;function on(){return jr||(jr=1,function(r,e){(function(t,s,i){r.exports=s(z(),pt())})(N,function(t){return function(s){var i=t,n=i.lib,y=n.WordArray,x=n.Hasher,p=i.x64,a=p.Word,c=i.algo,g=[],o=[],u=[];(function(){for(var h=1,b=0,d=0;d<24;d++){g[h+5*b]=(d+1)*(d+2)/2%64;var l=b%5,v=(2*h+3*b)%5;h=l,b=v}for(var h=0;h<5;h++)for(var b=0;b<5;b++)o[h+5*b]=b+(2*h+3*b)%5*5;for(var E=1,_=0;_<24;_++){for(var A=0,w=0,I=0;I<7;I++){if(E&1){var B=(1<<I)-1;B<32?w^=1<<B:A^=1<<B-32}E&128?E=E<<1^113:E<<=1}u[_]=a.create(A,w)}})();var f=[];(function(){for(var h=0;h<25;h++)f[h]=a.create()})();var m=c.SHA3=x.extend({cfg:x.cfg.extend({outputLength:512}),_doReset:function(){for(var h=this._state=[],b=0;b<25;b++)h[b]=new a.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(h,b){for(var d=this._state,l=this.blockSize/2,v=0;v<l;v++){var E=h[b+2*v],_=h[b+2*v+1];E=(E<<8|E>>>24)&16711935|(E<<24|E>>>8)&4278255360,_=(_<<8|_>>>24)&16711935|(_<<24|_>>>8)&4278255360;var A=d[v];A.high^=_,A.low^=E}for(var w=0;w<24;w++){for(var I=0;I<5;I++){for(var B=0,C=0,F=0;F<5;F++){var A=d[I+5*F];B^=A.high,C^=A.low}var D=f[I];D.high=B,D.low=C}for(var I=0;I<5;I++)for(var T=f[(I+4)%5],R=f[(I+1)%5],H=R.high,Y=R.low,B=T.high^(H<<1|Y>>>31),C=T.low^(Y<<1|H>>>31),F=0;F<5;F++){var A=d[I+5*F];A.high^=B,A.low^=C}for(var j=1;j<25;j++){var B,C,A=d[j],X=A.high,K=A.low,$=g[j];$<32?(B=X<<$|K>>>32-$,C=K<<$|X>>>32-$):(B=K<<$-32|X>>>64-$,C=X<<$-32|K>>>64-$);var S=f[o[j]];S.high=B,S.low=C}var P=f[0],k=d[0];P.high=k.high,P.low=k.low;for(var I=0;I<5;I++)for(var F=0;F<5;F++){var j=I+5*F,A=d[j],J=f[j],V=f[(I+1)%5+5*F],ae=f[(I+2)%5+5*F];A.high=J.high^~V.high&ae.high,A.low=J.low^~V.low&ae.low}var A=d[0],q=u[w];A.high^=q.high,A.low^=q.low}},_doFinalize:function(){var h=this._data,b=h.words;this._nDataBytes*8;var d=h.sigBytes*8,l=this.blockSize*32;b[d>>>5]|=1<<24-d%32,b[(s.ceil((d+1)/l)*l>>>5)-1]|=128,h.sigBytes=b.length*4,this._process();for(var v=this._state,E=this.cfg.outputLength/8,_=E/8,A=[],w=0;w<_;w++){var I=v[w],B=I.high,C=I.low;B=(B<<8|B>>>24)&16711935|(B<<24|B>>>8)&4278255360,C=(C<<8|C>>>24)&16711935|(C<<24|C>>>8)&4278255360,A.push(C),A.push(B)}return new y.init(A,E)},clone:function(){for(var h=x.clone.call(this),b=h._state=this._state.slice(0),d=0;d<25;d++)b[d]=b[d].clone();return h}});i.SHA3=x._createHelper(m),i.HmacSHA3=x._createHmacHelper(m)}(Math),t.SHA3})}(x0)),x0.exports}var d0={exports:{}},Kr;function an(){return Kr||(Kr=1,function(r,e){(function(t,s){r.exports=s(z())})(N,function(t){/** @preserve
|
|
49
|
+
`,y.action=this.$env.toApi(this.apiUrl()),this.$present(e.extra)&&e.extra.popup,y.target=this.$iFrameId,y.submit()})}setConfirmFormUrl(e){const t=this.byId(this.$confirmIFrame),s=this.byId(this.$confirmFormId);t.style.setProperty("display","block"),s.target=this.$confirmIFrame,s.action=e}setConfirmRedirect(e){const t=this.byId(this.$confirmFormId);t.target="_self",t.action=e}confirm(){return new Promise((e,t)=>{ne.bind(e,t);const s=this.byId(this.$confirmFormId);if(this.$blank(s.action))throw new le({event:"error",error_code:"RC_CONFIRM_READY_NOT_YET",message:this.message("confirmNotYet")});s.submit()})}async startPaymentUrl(e,t="PAYMENT"){return new Promise((s,i)=>{this.mode=t,this.templateReload(),ne.clearPollingEvent(),ne.bind(s,i),ne.setDefaultPaymentData(null,null),ue.showProgress(this.message("startProgress")),this.createTemplateHtml(),this.bodyOpen();const n=this.byId(this.$formId);n.method="GET",n.action=e,n.target=this.$iFrameId,n.submit()})}createPopupButton(e){ue.hideProgress(),this.hidePaymentiFrame(),this.showPopupMessage(e),this.$present(e.gatewayUrl)&&(this.$popupUrl=`${e.gatewayUrl}?popup=1`,Je.setReceiptId(e.receiptId))}readyToPopup(e=void 0){this.hidePopupMessage(),this.closePopup();const t="width=750,height=500,top=0,left=0,scrollbars=yes,directories=no, status=no, menubar=no, fullscreen=no";this.$popup=window.open(this.getPopupUrl(e),"BootPayPopupInstance",t),this.$popupWatcher=setInterval(async()=>{if(this.$popup===void 0||this.$popup.closed){try{clearInterval(this.$popupWatcher),await Je.sendCloseEvent()}catch(s){H.debug("popup",Xe(s))}return this.$popupUrl=void 0,ne.reject({event:"cancel",error_code:"RC_CLOSE_WINDOW",message:this.message("closeMessage")})}},500),this.bindParentEventOnPopup()}closePopup(){if(this.$popupWatcher!==void 0)try{clearInterval(this.$popupWatcher),H.debug("close popup","clear popup interval")}catch(e){H.info("clear popup watcher",Xe(e))}if(this.$popup!==void 0&&!this.$popup.closed)try{this.$popup.close(),H.debug("close popup","close popup instance")}catch(e){H.info("popup destroy",Xe(e))}}getPopupUrl(e){return this.$present(e)?e:this.$present(this.$popupUrl)?this.$popupUrl:"about:blank"}bindParentEventOnPopup(){let e="beforeunload.BootpayReloadWatcher";O.isMobileSafari()&&(e="pagehide.BootpayReloadWatcher"),window.resetBootpayEventListener(e,()=>{if(this.$popup!==void 0&&!this.$popup.closed)try{this.$popup.close()}catch(t){H.info("popup destroy",Xe(t))}})}showPaymentiFrame(e=!1){const t=this.byId(this.$iFrameId),s=this.byId(this.$closeButton);t!==void 0&&t.style.setProperty("display","block"),s!==void 0&&e&&s.style.setProperty("display","inline-block")}showPopupMessage(e){const t=this.byId(this.$popupWindow),s=this.byId(this.$popupItemNameId),i=this.byId(this.$popupPriceId);t!==void 0&&t.style.setProperty("display","block"),s!==void 0&&(s.innerText=e.name),i!==void 0&&(parseFloat(e.price)>0?i.innerText=String(e.price).replace(/\B(?=(\d{3})+(?!\d))/g,","):i.remove())}hidePopupMessage(){this.byId(this.$popupWindow).style.setProperty("display","none")}destroy(e=!0){this.$present(document.querySelector("body").className)&&(document.querySelector("body").className=document.querySelector("body").className.replace(/bootpay-open/gi,"")),this.$present(this.byId(this.$windowId))&&(this.byId(this.$windowId).outerHTML=""),document.body.classList.remove("bootpay-open"),ue.hideProgress(),this.closePopup(),ne.allClearEvent(),Je.clearInstance(),e&&setTimeout(()=>ne.callBootpayDOMEvent("close"),300)}iFrameResize(e){const t=this.byId(this.$iFrameId);if(t!==void 0)for(let s in Object.keys(e)){let i=Object.keys(e)[s],n=e[i];this.$present(n)&&!String(n).match(/%/)&&(i.match(/width/)||i.match(/Width/)||i.match(/height/)||i.match(/Height/))&&(n=`${String(e[i]).replace(/px/gi,"")}px`),String(n).match(/%/)&&!this.byId(this.$paymentWindowId).className.match(/w-100/)&&(this.byId(this.$paymentWindowId).className+=" w-100"),t.style.setProperty(i,n)}}iFrameSetStyle(e){H.debug("change style",e);const t=this.byId(this.$iFrameId);for(let s in Object.keys(e)){let i=Object.keys(e)[s];try{H.debug(i,e[i]),t.style.setProperty(i,e[i])}catch(n){H.warn("iframe style",n==null?void 0:n.message)}}}windowStyle(e){H.debug("change style",e);const t=this.byId(this.$paymentWindowId);for(let s in Object.keys(e)){let i=Object.keys(e)[s];try{H.debug(i,e[i]),t.style.setProperty(i,e[i])}catch(n){H.warn("iframe style",n==null?void 0:n.message)}}}hidePaymentiFrame(){const e=this.byId(this.$iFrameId),t=this.byId(this.$closeButton);e!==void 0&&e.style.setProperty("display","none"),t!==void 0&&t.style.setProperty("display","none")}message(e){return Qt.getLocaleMessage(`${e}.${this.mode}`,O.locale)}moveToUrl(e){const t=this.byId(this.$iFrameId);this.hidePaymentiFrame(),t.removeAttribute("style"),this.iFrameResize({width:O.isMobile()?"100%":400,height:O.isMobile()?"100%":700}),t.style.setProperty("display","block"),t.src=e}apiUrl(){return this.modeApiUrl[this.mode]}}const W=new Vi,Re=class Re extends Ue{constructor(){super(),this.$session=Se,this.$logger=H,this.$event=Je,this.platformType=Z.PLATFORM.JS,this.$transactionKey="",this.extra={},this.browserBootpayFilter={instagram:/Instagram/i,kakaotalk:/KAKAOTALK/i,facebook:/FBAV/i,naver:/NAVER/i,mobile_safari:/(iPhone|iPad|iPod)/,mobile_chrome:[/Mobile|iP(hone|od|ad)|Android|BlackBerry|IEMobile|Kindle|NetFront|Silk-Accelerated|(hpw|web)OS|Fennec|Minimo|Opera M(obi|ini)|Blazer|Dolfin|Dolphin|Skyfire|Zune/,/Chrome/]}}async requestPayment(e){var t;((t=e.extra)==null?void 0:t.locale)!==void 0&&!O.isSetLocale&&O.setLocale(e.extra.locale),this.$event.clearInstance(),this.generateTransactionKey(),e.application_id=O.currentApplicationId(e.application_id),this.$event.setTokenKey(this.$transactionKey),this.$event.setApplicationId(e.application_id),this.$event.send({step:"start",msg:"결제 요청 시작",request:e}),e.sdk=!0,e.platform_type=this.platformType,e.ver=O.packageVersion,e.sdk_version=O.sdkVersion,e.sdk_type=O.sdkName,e.locale=O.locale,e.price=parseFloat(String(e.price)),e.tax_free=parseFloat(String(e.tax_free)),e.deposit_price=parseFloat(String(e.deposit_price)),Re.invalidRequestParamsData(e),Re.invalidRequestItemsData(e.items,e.price),e.uuid=this.$session.currentUserUUID(),e.sk=this.$session.currentSessionKey(),e.ti=this.$session.currentTimeTerm(),e.tk=this.$transactionKey,e.env=this.getUserDeviceEnvironment(),e.extra=this.openTypeFilter(e.extra),this.extra=e.extra;try{const s=await W.start(e);return H.debug("confirm ready",s),W.hidePaymentiFrame(),W.closePopup(),["done","issued"].indexOf(s.event)===-1&&this.$event.send({step:s.event,msg:"",request:e,response:s}),W.setConfirmFormUrl(`${s.gateway_url}/confirm/${s.receipt_id}?application_id=${e.application_id}`),Promise.resolve(s)}catch(s){return this.eventError(s),Promise.reject(s)}}async confirm(){try{const e=await W.confirm();return Promise.resolve(e)}catch(e){return this.eventError(e),Promise.reject(e)}}eventDone(e,t=!0){var s;this.$logger.debug(e.event,e),this.$event.send({step:e.event,msg:e.event==="done"?"결제완료":"가상계좌발급완료",request:{},response:e}),ue.hideProgress(),this.$logger.debug("show result",this.isDisplaySuccessResult()),this.isDisplaySuccessResult()&&t&&((s=e.data)==null?void 0:s.receipt_id)!==void 0?this.displayResultView(e.data.receipt_id):W.destroy()}eventError(e){ue.hideProgress(),W.closePopup(),this.isDisplayErrorResult()&&e.event==="error"?this.displayResultErrorView(e):W.destroy(),this.$logger.debug("done failed destroy and hide","payment"),this.$event.sendError({step:this.$present(e.event)?e.event:"error",msg:e.message,trace:function(){try{return e.stack}catch{return!1}}()})}generateTransactionKey(){return this.$transactionKey=`${this.$uuid()}-${new Date().getTime()*1e3}`,this.$transactionKey}async requestSubscription(e){this.$event.clearInstance(),this.generateTransactionKey(),this.$event.setTokenKey(this.$transactionKey),this.$event.setApplicationId(e.application_id),this.$event.send({step:"start",msg:"정기결제 요청 시작",request:e}),e.extra=this.openTypeFilter(e.extra);const t={application_id:e.application_id,subscription_id:e.subscription_id,pg:e.pg,method:e.method,order_name:e.order_name,price:e.price,tax_free:e.tax_free,user_token:e.user_token,metadata:e.metadata,redirect_url:e.redirect_url,wallet_id:e.wallet_id,widget:e.widget,widget_key:e.widget_key,widget_sandbox:e.widget_sandbox,subscribe_brandpay_type:e.subscribe_brandpay_type,platform_type:this.platformType,ver:O.packageVersion,sdk_version:O.sdkVersion,sdk_type:O.sdkName,locale:O.locale,sdk:!0,uuid:this.$session.currentUserUUID(),sk:this.$session.currentSessionKey(),tk:this.$transactionKey,env:this.getUserDeviceEnvironment(),user:e.user,extra:e.extra};try{const s=await W.start(t,"CARD_SUBSCRIPTION");switch(H.debug("subscription success",s),this.$event.send({step:"confirm",msg:"결제승인전",request:{},response:s}),W.hidePaymentiFrame(),W.closePopup(),s.event){case"done":case"issued":break;case"confirm":W.setConfirmFormUrl(`${s.gateway_url}/confirm/${s.receipt_id}?application_id=${e.application_id}`)}return Promise.resolve(s)}catch(s){return this.eventError(s),Promise.reject(s)}}async requestAuthentication(e){this.$event.clearInstance(),this.generateTransactionKey(),this.$event.setTokenKey(this.$transactionKey),this.$event.setApplicationId(e.application_id),this.$event.send({step:"start",msg:"본인인증 요청 시작",request:e}),e.extra=this.openTypeFilter(e.extra);const t={application_id:e.application_id,authentication_id:e.authentication_id,pg:e.pg,method:this.$present(e.method)?e.method:"auth",order_name:e.order_name,platform_type:this.platformType,ver:Be.version,sdk_version:O.sdkVersion,sdk_type:O.sdkName,locale:O.locale,metadata:e.metadata,redirect_url:e.redirect_url,sdk:!0,uuid:this.$session.currentUserUUID(),sk:this.$session.currentSessionKey(),tk:this.$transactionKey,env:this.getUserDeviceEnvironment(),user:e.user,extra:e.extra};try{const s=await W.start(t,"AUTH");switch(H.debug("authentication success",s),this.$event.send({step:"confirm",msg:"본인인증 승인전",request:{},response:s}),W.hidePaymentiFrame(),W.closePopup(),s.event){case"done":case"issued":break;case"confirm":W.setConfirmFormUrl(`${s.gateway_url}/confirm/${s.receipt_id}?application_id=${e.application_id}`)}return Promise.resolve(s)}catch(s){return this.eventError(s),Promise.reject(s)}}async requestPaymentUrl(e){try{const t=await W.startPaymentUrl(e.url);return["done","issued"].indexOf(t.event)===-1&&this.$event.send({step:t.event,msg:"",request:{url:e.url},response:t}),W.setConfirmFormUrl(`${t.gateway_url}/confirm/${t.receipt_id}?application_id=${e.application_id}`),Promise.resolve(t)}catch(t){return this.eventError(t),Promise.reject(t)}}getUserDeviceEnvironment(){return{width:window.innerWidth,height:window.innerHeight}}isDisplaySuccessResult(){return this.extra!==void 0&&this.extra.display_success_result!==void 0&&this.extra.display_success_result}isDisplayErrorResult(){return this.extra!==void 0&&this.extra.display_error_result!==void 0&&this.extra.display_error_result}displayResultView(e){W.moveToUrl(O.toDoor(`result/${e}`))}displayResultErrorView(e){W.moveToUrl(O.toDoor(`error?error_code=${e.error_code}&pg_error_code=${e.pg_error_code}&message=${e.message}`))}openTypeFilter(e){if(this.$present(e)&&e.browser_open_type!==void 0){const t=this.getUserAgent();for(let s in e.browser_open_type){const i=e.browser_open_type[s],n=this.$present(this.browserBootpayFilter[i.browser])?this.browserBootpayFilter[i.browser]:new RegExp(`${i.browser}`);if(t.match(n)){e.open_type=i.open_type;break}}}return e}static invalidRequestParamsData(e){if(re(e))throw new le({event:"error",error_code:"NEED_MORE_PARAMS",message:"결제 요청을 위한 최소한의 결제 정보를 입력해주세요."});Object.keys(Re.invalidRequestParams).forEach(t=>{const s=e[t];if(re(s))throw new le({event:"error",error_code:"INVALID_REQUEST_PARAMS",message:Re.invalidRequestParams[t]})})}static invalidRequestItemsData(e,t){if(e!==void 0&&U(e)){let s=0;if(e.forEach((i,n)=>{if(re(i.id))throw new le({event:"error",error_code:"NEED_ITEM_ID",message:`${n+1}번째 상품 고유 ID를 입력해주세요. [ key: id ]`});if(re(i.name))throw new le({event:"error",error_code:"NEED_ITEM_NAME",message:`${n+1}번째 상품명을 입력해주세요. [ key: name ]`});if(re(i.qty))throw new le({event:"error",error_code:"NEED_ITEM_QTY",message:`${n+1}번째 상품수량을 입력해주세요. [ key: qty ]`});if(re(i.price))throw new le({event:"error",error_code:"NEED_ITEM_PRICE",message:`${n+1}번째 상품금액을 입력해주세요. [ key: price ]`});e[n].price=parseFloat(String(e[n].price)),e[n].qty=parseFloat(String(e[n].qty)),s+=e[n].price*e[n].qty}),s!==t)throw new le({event:"error",error_code:"NEED_ITEM_TOTAL_PRICE_NOT_MATCH",message:`결제 금액과 상품 수량 및 상품 금액의 총합과 일치하지 않습니다. [ 요청금액: ${t} ${typeof t}, 상품 총합계 금액: ${s} ${typeof s} ]`})}}};Re.invalidRequestParams={application_id:"application_id를 입력해주세요. [ key: application_id ]",order_name:"판매할 상품명을 입력해주세요. [ key: order_name ]",price:"판매할 상품의 금액을 입력해주세요. [ key: price ]",order_id:"가맹점에서 설정할 주문 ID를 입력해주세요. [ key: order_id ]"};let Ze=Re;const Yi=new Ze;class Ji extends ve{constructor(){super(),this.$session=Se}setAnalyticsData(e){this.$session.setTime(e.time),this.$session.setUUID(e.uuid)}async send(e){const t=document.URL;if(t!==void 0&&t.search(/bootapi.co.kr/)===-1){const s=this.$session.getUser();e.application_id=O.currentApplicationId(e.application_id),e.sk=this.$session.currentSessionKey(),e.uuid=this.$session.currentUserUUID(),e.time=this.$session.currentTime(),e.url=t,e.referer=document.referrer!==void 0&&U(document.referrer)&&document.referrer.search(new RegExp(window.location.hostname))==-1?document.referrer:"",e.user_id=s===void 0||re(s)?void 0:s.id,e.items=this.generateItemKeyToVersion1(e.items);try{const i=await this.$http.post(O.toAnalytics(`call?ver=${Be.version}`),e);return i.data.status===200?(H.info("Analytics Common Send","통계 데이터가 전송되었습니다."),Promise.resolve()):(H.warn("Analytics Common Send",`통계 데이터가 전송 실패. ${JSON.stringify(i.data)}`),Promise.reject())}catch(i){return H.error("Analytics Common Error",`데이터 전송 실패: ${i.message}`),Promise.reject()}}}async login(e){if(e.application_id=O.currentApplicationId(e.application_id),re(e.application_id))return H.error("Analytics Params","application_id 값을 입력해주세요.");if(re(e.id))return H.error("Analytics Params","id 값을 입력해주세요.");try{const t=await this.$http.post(O.toAnalytics(`login?ver=${Be.version}`),e),{user_id:s}=t.data.data;return this.$session.setUser({id:s,time:new Date().getTime()}),Promise.resolve()}catch(t){return H.error("Analytics Login Error",`데이터 전송 실패: ${t.message}`),Promise.reject()}}logout(){this.$session.setUser(void 0)}generateItemKeyToVersion1(e){if(e!==void 0)return e.map(t=>({cat1:t.cat1,cat2:t.cat2,cat3:t.cat3,item_img:t.img,item_name:t.name,unique:t.id,price:t.price}))}}const Zi=new Ji;(function(){if(typeof window>"u"||typeof window.CustomEvent=="function")return!1;function r(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};let s=document.createEvent("CustomEvent");return s.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),s}r.prototype=window.Event.prototype,window.CustomEvent=r})();const ge={$payment:Yi,$analytics:Zi,$environment:O,async requestPayment(r){return new Promise(async(e,t)=>{try{r.extra!==void 0&&r.extra.override_global_event===!0&&(H.debug("override global event","override global event!"),ge.overrideGlobalInstance());const s=await this.$payment.requestPayment(r);setTimeout(()=>{e(s),["done","issued"].indexOf(s.event)>-1&&this.$payment.eventDone(s)},100)}catch(s){setTimeout(()=>{t(this.errorHandler(s))},100)}})},async confirm(){return new Promise(async(r,e)=>{try{const t=await this.$payment.confirm();setTimeout(()=>{r(t),this.$payment.eventDone(t)},100)}catch(t){setTimeout(()=>e(this.errorHandler(t)),100)}})},async requestSubscription(r){return new Promise(async(e,t)=>{try{const s=await this.$payment.requestSubscription(r);e(s),this.$payment.eventDone(s)}catch(s){return t(this.errorHandler(s))}})},async requestAuthentication(r){return new Promise(async(e,t)=>{try{const s=await this.$payment.requestAuthentication(r);e(s),this.$payment.eventDone(s)}catch(s){return t(this.errorHandler(s))}})},async requestPaymentUrl(r){return new Promise(async(e,t)=>{try{const s=await this.$payment.requestPaymentUrl(r);setTimeout(()=>{e(s),["done","issued"].indexOf(s.event)>-1&&this.$payment.eventDone(s)},100)}catch(s){setTimeout(()=>{t(this.errorHandler(s))},100)}})},setEnvironmentMode(r,e=void 0){this.$environment.set(r),e!==void 0&&this.$environment.setDevelopmentHost(e)},setApplicationId(r){return this.$environment.setApplicationId(r)},setVersion(r,e,t){return this.$environment.setVersion(r,e,t)},setDevice(r){switch(r){case"IOS":this.$payment.platformType=Z.PLATFORM.IOS;break;case"ANDROID":this.$payment.platformType=Z.PLATFORM.ANDROID;break;default:this.$payment.platformType=Z.PLATFORM.JS}return this.$payment.platformType},errorHandler(r){let e;switch(ue.hideProgress(),r.name){case"BootpayEventError":e=r.eventMessage;break;default:if(U(r.event))e=r;else throw r}return e},readyToPopup(){W.readyToPopup()},setLogLevel(r){H.setLogLevel(r)},setUUID(r){return Se.setUUID(r)},send(r=void 0){return this.$analytics.send(r!==void 0?r:{})},login(r){return this.$analytics.login(r)},logout(){return this.$analytics.logout()},setLocale(r){O.setLocale(r),W.templateReload()},async dismiss(r=!1){if(r)try{await Je.sendCloseEvent()}catch(e){H.debug("error",e.message)}ne.reject({event:"cancel",error_code:"RC_CLOSE_WINDOW",message:"사용자가 결제창을 닫았습니다."})},getCurrentUUID(){return Se.currentUserUUID()},destroy(){W.destroy()},overrideGlobalInstance(){window.Bootpay=ge}};typeof window<"u"&&(window.Bootpay=ge);class Qi extends at{constructor(){super(),this.$messageEventName="message.BootpayUserTokenEvent"}bind(e,t){this.setCallbackFunction(e,t),window.resetBootpayEventListener(this.$messageEventName,s=>{const i=this.parseEvent(s.data);if(U(i))switch(H.debug("event",i),i.event){case"error":case"cancel":return this.reject({event:i.event,pg_error_code:i.pg_error_code,error_code:i.error_code,message:i.message,payload:i.payload});case"data":return this.resolve(i.data);case"confirmPasswordToken":return this.resolve(i.token);case"confirmAddCard":return this.resolve(i);case"resize":$0.iFrameResize(i.resizeData);break;default:return}})}}var Rr={exports:{}},e0={exports:{}},Tr;function ft(){return Tr||(Tr=1,function(r,e){(function(t,s){r.exports=s(z())})(L,function(t){return function(s){var i=t,n=i.lib,y=n.Base,d=n.WordArray,p=i.x64={};p.Word=y.extend({init:function(a,c){this.high=a,this.low=c}}),p.WordArray=y.extend({init:function(a,c){a=this.words=a||[],c!=s?this.sigBytes=c:this.sigBytes=a.length*8},toX32:function(){for(var a=this.words,c=a.length,g=[],o=0;o<c;o++){var u=a[o];g.push(u.high),g.push(u.low)}return d.create(g,this.sigBytes)},clone:function(){for(var a=y.clone.call(this),c=a.words=this.words.slice(0),g=c.length,o=0;o<g;o++)c[o]=c[o].clone();return a}})}(),t})}(e0)),e0.exports}var t0={exports:{}},Or;function en(){return Or||(Or=1,function(r,e){(function(t,s){r.exports=s(z())})(L,function(t){return function(){if(typeof ArrayBuffer=="function"){var s=t,i=s.lib,n=i.WordArray,y=n.init,d=n.init=function(p){if(p instanceof ArrayBuffer&&(p=new Uint8Array(p)),(p instanceof Int8Array||typeof Uint8ClampedArray<"u"&&p instanceof Uint8ClampedArray||p instanceof Int16Array||p instanceof Uint16Array||p instanceof Int32Array||p instanceof Uint32Array||p instanceof Float32Array||p instanceof Float64Array)&&(p=new Uint8Array(p.buffer,p.byteOffset,p.byteLength)),p instanceof Uint8Array){for(var a=p.byteLength,c=[],g=0;g<a;g++)c[g>>>2]|=p[g]<<24-g%4*8;y.call(this,c,a)}else y.apply(this,arguments)};d.prototype=n}}(),t.lib.WordArray})}(t0)),t0.exports}var r0={exports:{}},Ur;function tn(){return Ur||(Ur=1,function(r,e){(function(t,s){r.exports=s(z())})(L,function(t){return function(){var s=t,i=s.lib,n=i.WordArray,y=s.enc;y.Utf16=y.Utf16BE={stringify:function(p){for(var a=p.words,c=p.sigBytes,g=[],o=0;o<c;o+=2){var u=a[o>>>2]>>>16-o%4*8&65535;g.push(String.fromCharCode(u))}return g.join("")},parse:function(p){for(var a=p.length,c=[],g=0;g<a;g++)c[g>>>1]|=p.charCodeAt(g)<<16-g%2*16;return n.create(c,a*2)}},y.Utf16LE={stringify:function(p){for(var a=p.words,c=p.sigBytes,g=[],o=0;o<c;o+=2){var u=d(a[o>>>2]>>>16-o%4*8&65535);g.push(String.fromCharCode(u))}return g.join("")},parse:function(p){for(var a=p.length,c=[],g=0;g<a;g++)c[g>>>1]|=d(p.charCodeAt(g)<<16-g%2*16);return n.create(c,a*2)}};function d(p){return p<<8&4278255360|p>>>8&16711935}}(),t.enc.Utf16})}(r0)),r0.exports}var s0={exports:{}},Hr;function rn(){return Hr||(Hr=1,function(r,e){(function(t,s){r.exports=s(z())})(L,function(t){return function(){var s=t,i=s.lib,n=i.WordArray,y=s.enc;y.Base64url={stringify:function(p,a){a===void 0&&(a=!0);var c=p.words,g=p.sigBytes,o=a?this._safe_map:this._map;p.clamp();for(var u=[],h=0;h<g;h+=3)for(var m=c[h>>>2]>>>24-h%4*8&255,f=c[h+1>>>2]>>>24-(h+1)%4*8&255,B=c[h+2>>>2]>>>24-(h+2)%4*8&255,x=m<<16|f<<8|B,l=0;l<4&&h+l*.75<g;l++)u.push(o.charAt(x>>>6*(3-l)&63));var v=o.charAt(64);if(v)for(;u.length%4;)u.push(v);return u.join("")},parse:function(p,a){a===void 0&&(a=!0);var c=p.length,g=a?this._safe_map:this._map,o=this._reverseMap;if(!o){o=this._reverseMap=[];for(var u=0;u<g.length;u++)o[g.charCodeAt(u)]=u}var h=g.charAt(64);if(h){var m=p.indexOf(h);m!==-1&&(c=m)}return d(p,c,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"};function d(p,a,c){for(var g=[],o=0,u=0;u<a;u++)if(u%4){var h=c[p.charCodeAt(u-1)]<<u%4*2,m=c[p.charCodeAt(u)]>>>6-u%4*2,f=h|m;g[o>>>2]|=f<<24-o%4*8,o++}return n.create(g,o)}}(),t.enc.Base64url})}(s0)),s0.exports}var i0={exports:{}},Nr;function n0(){return Nr||(Nr=1,function(r,e){(function(t,s){r.exports=s(z())})(L,function(t){return function(s){var i=t,n=i.lib,y=n.WordArray,d=n.Hasher,p=i.algo,a=[],c=[];(function(){function u(B){for(var x=s.sqrt(B),l=2;l<=x;l++)if(!(B%l))return!1;return!0}function h(B){return(B-(B|0))*4294967296|0}for(var m=2,f=0;f<64;)u(m)&&(f<8&&(a[f]=h(s.pow(m,1/2))),c[f]=h(s.pow(m,1/3)),f++),m++})();var g=[],o=p.SHA256=d.extend({_doReset:function(){this._hash=new y.init(a.slice(0))},_doProcessBlock:function(u,h){for(var m=this._hash.words,f=m[0],B=m[1],x=m[2],l=m[3],v=m[4],E=m[5],_=m[6],A=m[7],w=0;w<64;w++){if(w<16)g[w]=u[h+w]|0;else{var I=g[w-15],b=(I<<25|I>>>7)^(I<<14|I>>>18)^I>>>3,C=g[w-2],F=(C<<15|C>>>17)^(C<<13|C>>>19)^C>>>10;g[w]=b+g[w-7]+F+g[w-16]}var D=v&E^~v&_,R=f&B^f&x^B&x,T=(f<<30|f>>>2)^(f<<19|f>>>13)^(f<<10|f>>>22),N=(v<<26|v>>>6)^(v<<21|v>>>11)^(v<<7|v>>>25),Y=A+N+D+c[w]+g[w],j=T+R;A=_,_=E,E=v,v=l+Y|0,l=x,x=B,B=f,f=Y+j|0}m[0]=m[0]+f|0,m[1]=m[1]+B|0,m[2]=m[2]+x|0,m[3]=m[3]+l|0,m[4]=m[4]+v|0,m[5]=m[5]+E|0,m[6]=m[6]+_|0,m[7]=m[7]+A|0},_doFinalize:function(){var u=this._data,h=u.words,m=this._nDataBytes*8,f=u.sigBytes*8;return h[f>>>5]|=128<<24-f%32,h[(f+64>>>9<<4)+14]=s.floor(m/4294967296),h[(f+64>>>9<<4)+15]=m,u.sigBytes=h.length*4,this._process(),this._hash},clone:function(){var u=d.clone.call(this);return u._hash=this._hash.clone(),u}});i.SHA256=d._createHelper(o),i.HmacSHA256=d._createHmacHelper(o)}(Math),t.SHA256})}(i0)),i0.exports}var o0={exports:{}},Lr;function sn(){return Lr||(Lr=1,function(r,e){(function(t,s,i){r.exports=s(z(),n0())})(L,function(t){return function(){var s=t,i=s.lib,n=i.WordArray,y=s.algo,d=y.SHA256,p=y.SHA224=d.extend({_doReset:function(){this._hash=new n.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var a=d._doFinalize.call(this);return a.sigBytes-=4,a}});s.SHA224=d._createHelper(p),s.HmacSHA224=d._createHmacHelper(p)}(),t.SHA224})}(o0)),o0.exports}var a0={exports:{}},Mr;function qr(){return Mr||(Mr=1,function(r,e){(function(t,s,i){r.exports=s(z(),ft())})(L,function(t){return function(){var s=t,i=s.lib,n=i.Hasher,y=s.x64,d=y.Word,p=y.WordArray,a=s.algo;function c(){return d.create.apply(d,arguments)}var g=[c(1116352408,3609767458),c(1899447441,602891725),c(3049323471,3964484399),c(3921009573,2173295548),c(961987163,4081628472),c(1508970993,3053834265),c(2453635748,2937671579),c(2870763221,3664609560),c(3624381080,2734883394),c(310598401,1164996542),c(607225278,1323610764),c(1426881987,3590304994),c(1925078388,4068182383),c(2162078206,991336113),c(2614888103,633803317),c(3248222580,3479774868),c(3835390401,2666613458),c(4022224774,944711139),c(264347078,2341262773),c(604807628,2007800933),c(770255983,1495990901),c(1249150122,1856431235),c(1555081692,3175218132),c(1996064986,2198950837),c(2554220882,3999719339),c(2821834349,766784016),c(2952996808,2566594879),c(3210313671,3203337956),c(3336571891,1034457026),c(3584528711,2466948901),c(113926993,3758326383),c(338241895,168717936),c(666307205,1188179964),c(773529912,1546045734),c(1294757372,1522805485),c(1396182291,2643833823),c(1695183700,2343527390),c(1986661051,1014477480),c(2177026350,1206759142),c(2456956037,344077627),c(2730485921,1290863460),c(2820302411,3158454273),c(3259730800,3505952657),c(3345764771,106217008),c(3516065817,3606008344),c(3600352804,1432725776),c(4094571909,1467031594),c(275423344,851169720),c(430227734,3100823752),c(506948616,1363258195),c(659060556,3750685593),c(883997877,3785050280),c(958139571,3318307427),c(1322822218,3812723403),c(1537002063,2003034995),c(1747873779,3602036899),c(1955562222,1575990012),c(2024104815,1125592928),c(2227730452,2716904306),c(2361852424,442776044),c(2428436474,593698344),c(2756734187,3733110249),c(3204031479,2999351573),c(3329325298,3815920427),c(3391569614,3928383900),c(3515267271,566280711),c(3940187606,3454069534),c(4118630271,4000239992),c(116418474,1914138554),c(174292421,2731055270),c(289380356,3203993006),c(460393269,320620315),c(685471733,587496836),c(852142971,1086792851),c(1017036298,365543100),c(1126000580,2618297676),c(1288033470,3409855158),c(1501505948,4234509866),c(1607167915,987167468),c(1816402316,1246189591)],o=[];(function(){for(var h=0;h<80;h++)o[h]=c()})();var u=a.SHA512=n.extend({_doReset:function(){this._hash=new p.init([new d.init(1779033703,4089235720),new d.init(3144134277,2227873595),new d.init(1013904242,4271175723),new d.init(2773480762,1595750129),new d.init(1359893119,2917565137),new d.init(2600822924,725511199),new d.init(528734635,4215389547),new d.init(1541459225,327033209)])},_doProcessBlock:function(h,m){for(var f=this._hash.words,B=f[0],x=f[1],l=f[2],v=f[3],E=f[4],_=f[5],A=f[6],w=f[7],I=B.high,b=B.low,C=x.high,F=x.low,D=l.high,R=l.low,T=v.high,N=v.low,Y=E.high,j=E.low,X=_.high,K=_.low,$=A.high,S=A.low,P=w.high,k=w.low,J=I,V=b,ae=C,q=F,et=D,We=R,R0=T,tt=N,ye=Y,de=j,yt=X,rt=K,mt=$,st=S,T0=P,it=k,me=0;me<80;me++){var pe,De,Et=o[me];if(me<16)De=Et.high=h[m+me*2]|0,pe=Et.low=h[m+me*2+1]|0;else{var fs=o[me-15],ze=fs.high,nt=fs.low,qn=(ze>>>1|nt<<31)^(ze>>>8|nt<<24)^ze>>>7,vs=(nt>>>1|ze<<31)^(nt>>>8|ze<<24)^(nt>>>7|ze<<25),ys=o[me-2],je=ys.high,ot=ys.low,Wn=(je>>>19|ot<<13)^(je<<3|ot>>>29)^je>>>6,ms=(ot>>>19|je<<13)^(ot<<3|je>>>29)^(ot>>>6|je<<26),Es=o[me-7],zn=Es.high,jn=Es.low,gs=o[me-16],Kn=gs.high,bs=gs.low;pe=vs+jn,De=qn+zn+(pe>>>0<vs>>>0?1:0),pe=pe+ms,De=De+Wn+(pe>>>0<ms>>>0?1:0),pe=pe+bs,De=De+Kn+(pe>>>0<bs>>>0?1:0),Et.high=De,Et.low=pe}var Gn=ye&yt^~ye&mt,Bs=de&rt^~de&st,Xn=J&ae^J&et^ae&et,Vn=V&q^V&We^q&We,Yn=(J>>>28|V<<4)^(J<<30|V>>>2)^(J<<25|V>>>7),_s=(V>>>28|J<<4)^(V<<30|J>>>2)^(V<<25|J>>>7),Jn=(ye>>>14|de<<18)^(ye>>>18|de<<14)^(ye<<23|de>>>9),Zn=(de>>>14|ye<<18)^(de>>>18|ye<<14)^(de<<23|ye>>>9),Cs=g[me],Qn=Cs.high,As=Cs.low,xe=it+Zn,$e=T0+Jn+(xe>>>0<it>>>0?1:0),xe=xe+Bs,$e=$e+Gn+(xe>>>0<Bs>>>0?1:0),xe=xe+As,$e=$e+Qn+(xe>>>0<As>>>0?1:0),xe=xe+pe,$e=$e+De+(xe>>>0<pe>>>0?1:0),ws=_s+Vn,eo=Yn+Xn+(ws>>>0<_s>>>0?1:0);T0=mt,it=st,mt=yt,st=rt,yt=ye,rt=de,de=tt+xe|0,ye=R0+$e+(de>>>0<tt>>>0?1:0)|0,R0=et,tt=We,et=ae,We=q,ae=J,q=V,V=xe+ws|0,J=$e+eo+(V>>>0<xe>>>0?1:0)|0}b=B.low=b+V,B.high=I+J+(b>>>0<V>>>0?1:0),F=x.low=F+q,x.high=C+ae+(F>>>0<q>>>0?1:0),R=l.low=R+We,l.high=D+et+(R>>>0<We>>>0?1:0),N=v.low=N+tt,v.high=T+R0+(N>>>0<tt>>>0?1:0),j=E.low=j+de,E.high=Y+ye+(j>>>0<de>>>0?1:0),K=_.low=K+rt,_.high=X+yt+(K>>>0<rt>>>0?1:0),S=A.low=S+st,A.high=$+mt+(S>>>0<st>>>0?1:0),k=w.low=k+it,w.high=P+T0+(k>>>0<it>>>0?1:0)},_doFinalize:function(){var h=this._data,m=h.words,f=this._nDataBytes*8,B=h.sigBytes*8;m[B>>>5]|=128<<24-B%32,m[(B+128>>>10<<5)+30]=Math.floor(f/4294967296),m[(B+128>>>10<<5)+31]=f,h.sigBytes=m.length*4,this._process();var x=this._hash.toX32();return x},clone:function(){var h=n.clone.call(this);return h._hash=this._hash.clone(),h},blockSize:1024/32});s.SHA512=n._createHelper(u),s.HmacSHA512=n._createHmacHelper(u)}(),t.SHA512})}(a0)),a0.exports}var c0={exports:{}},Wr;function nn(){return Wr||(Wr=1,function(r,e){(function(t,s,i){r.exports=s(z(),ft(),qr())})(L,function(t){return function(){var s=t,i=s.x64,n=i.Word,y=i.WordArray,d=s.algo,p=d.SHA512,a=d.SHA384=p.extend({_doReset:function(){this._hash=new y.init([new n.init(3418070365,3238371032),new n.init(1654270250,914150663),new n.init(2438529370,812702999),new n.init(355462360,4144912697),new n.init(1731405415,4290775857),new n.init(2394180231,1750603025),new n.init(3675008525,1694076839),new n.init(1203062813,3204075428)])},_doFinalize:function(){var c=p._doFinalize.call(this);return c.sigBytes-=16,c}});s.SHA384=p._createHelper(a),s.HmacSHA384=p._createHmacHelper(a)}(),t.SHA384})}(c0)),c0.exports}var d0={exports:{}},zr;function on(){return zr||(zr=1,function(r,e){(function(t,s,i){r.exports=s(z(),ft())})(L,function(t){return function(s){var i=t,n=i.lib,y=n.WordArray,d=n.Hasher,p=i.x64,a=p.Word,c=i.algo,g=[],o=[],u=[];(function(){for(var f=1,B=0,x=0;x<24;x++){g[f+5*B]=(x+1)*(x+2)/2%64;var l=B%5,v=(2*f+3*B)%5;f=l,B=v}for(var f=0;f<5;f++)for(var B=0;B<5;B++)o[f+5*B]=B+(2*f+3*B)%5*5;for(var E=1,_=0;_<24;_++){for(var A=0,w=0,I=0;I<7;I++){if(E&1){var b=(1<<I)-1;b<32?w^=1<<b:A^=1<<b-32}E&128?E=E<<1^113:E<<=1}u[_]=a.create(A,w)}})();var h=[];(function(){for(var f=0;f<25;f++)h[f]=a.create()})();var m=c.SHA3=d.extend({cfg:d.cfg.extend({outputLength:512}),_doReset:function(){for(var f=this._state=[],B=0;B<25;B++)f[B]=new a.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(f,B){for(var x=this._state,l=this.blockSize/2,v=0;v<l;v++){var E=f[B+2*v],_=f[B+2*v+1];E=(E<<8|E>>>24)&16711935|(E<<24|E>>>8)&4278255360,_=(_<<8|_>>>24)&16711935|(_<<24|_>>>8)&4278255360;var A=x[v];A.high^=_,A.low^=E}for(var w=0;w<24;w++){for(var I=0;I<5;I++){for(var b=0,C=0,F=0;F<5;F++){var A=x[I+5*F];b^=A.high,C^=A.low}var D=h[I];D.high=b,D.low=C}for(var I=0;I<5;I++)for(var R=h[(I+4)%5],T=h[(I+1)%5],N=T.high,Y=T.low,b=R.high^(N<<1|Y>>>31),C=R.low^(Y<<1|N>>>31),F=0;F<5;F++){var A=x[I+5*F];A.high^=b,A.low^=C}for(var j=1;j<25;j++){var b,C,A=x[j],X=A.high,K=A.low,$=g[j];$<32?(b=X<<$|K>>>32-$,C=K<<$|X>>>32-$):(b=K<<$-32|X>>>64-$,C=X<<$-32|K>>>64-$);var S=h[o[j]];S.high=b,S.low=C}var P=h[0],k=x[0];P.high=k.high,P.low=k.low;for(var I=0;I<5;I++)for(var F=0;F<5;F++){var j=I+5*F,A=x[j],J=h[j],V=h[(I+1)%5+5*F],ae=h[(I+2)%5+5*F];A.high=J.high^~V.high&ae.high,A.low=J.low^~V.low&ae.low}var A=x[0],q=u[w];A.high^=q.high,A.low^=q.low}},_doFinalize:function(){var f=this._data,B=f.words;this._nDataBytes*8;var x=f.sigBytes*8,l=this.blockSize*32;B[x>>>5]|=1<<24-x%32,B[(s.ceil((x+1)/l)*l>>>5)-1]|=128,f.sigBytes=B.length*4,this._process();for(var v=this._state,E=this.cfg.outputLength/8,_=E/8,A=[],w=0;w<_;w++){var I=v[w],b=I.high,C=I.low;b=(b<<8|b>>>24)&16711935|(b<<24|b>>>8)&4278255360,C=(C<<8|C>>>24)&16711935|(C<<24|C>>>8)&4278255360,A.push(C),A.push(b)}return new y.init(A,E)},clone:function(){for(var f=d.clone.call(this),B=f._state=this._state.slice(0),x=0;x<25;x++)B[x]=B[x].clone();return f}});i.SHA3=d._createHelper(m),i.HmacSHA3=d._createHmacHelper(m)}(Math),t.SHA3})}(d0)),d0.exports}var x0={exports:{}},jr;function an(){return jr||(jr=1,function(r,e){(function(t,s){r.exports=s(z())})(L,function(t){/** @preserve
|
|
61
50
|
(c) 2012 by Cédric Mesnil. All rights reserved.
|
|
62
51
|
|
|
63
52
|
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
@@ -66,17 +55,56 @@
|
|
|
66
55
|
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
67
56
|
|
|
68
57
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
69
|
-
*/return function(s){var i=t,n=i.lib,y=n.WordArray,
|
|
58
|
+
*/return function(s){var i=t,n=i.lib,y=n.WordArray,d=n.Hasher,p=i.algo,a=y.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),c=y.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),g=y.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),o=y.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),u=y.create([0,1518500249,1859775393,2400959708,2840853838]),h=y.create([1352829926,1548603684,1836072691,2053994217,0]),m=p.RIPEMD160=d.extend({_doReset:function(){this._hash=y.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(_,A){for(var w=0;w<16;w++){var I=A+w,b=_[I];_[I]=(b<<8|b>>>24)&16711935|(b<<24|b>>>8)&4278255360}var C=this._hash.words,F=u.words,D=h.words,R=a.words,T=c.words,N=g.words,Y=o.words,j,X,K,$,S,P,k,J,V,ae;P=j=C[0],k=X=C[1],J=K=C[2],V=$=C[3],ae=S=C[4];for(var q,w=0;w<80;w+=1)q=j+_[A+R[w]]|0,w<16?q+=f(X,K,$)+F[0]:w<32?q+=B(X,K,$)+F[1]:w<48?q+=x(X,K,$)+F[2]:w<64?q+=l(X,K,$)+F[3]:q+=v(X,K,$)+F[4],q=q|0,q=E(q,N[w]),q=q+S|0,j=S,S=$,$=E(K,10),K=X,X=q,q=P+_[A+T[w]]|0,w<16?q+=v(k,J,V)+D[0]:w<32?q+=l(k,J,V)+D[1]:w<48?q+=x(k,J,V)+D[2]:w<64?q+=B(k,J,V)+D[3]:q+=f(k,J,V)+D[4],q=q|0,q=E(q,Y[w]),q=q+ae|0,P=ae,ae=V,V=E(J,10),J=k,k=q;q=C[1]+K+V|0,C[1]=C[2]+$+ae|0,C[2]=C[3]+S+P|0,C[3]=C[4]+j+k|0,C[4]=C[0]+X+J|0,C[0]=q},_doFinalize:function(){var _=this._data,A=_.words,w=this._nDataBytes*8,I=_.sigBytes*8;A[I>>>5]|=128<<24-I%32,A[(I+64>>>9<<4)+14]=(w<<8|w>>>24)&16711935|(w<<24|w>>>8)&4278255360,_.sigBytes=(A.length+1)*4,this._process();for(var b=this._hash,C=b.words,F=0;F<5;F++){var D=C[F];C[F]=(D<<8|D>>>24)&16711935|(D<<24|D>>>8)&4278255360}return b},clone:function(){var _=d.clone.call(this);return _._hash=this._hash.clone(),_}});function f(_,A,w){return _^A^w}function B(_,A,w){return _&A|~_&w}function x(_,A,w){return(_|~A)^w}function l(_,A,w){return _&w|A&~w}function v(_,A,w){return _^(A|~w)}function E(_,A){return _<<A|_>>>32-A}i.RIPEMD160=d._createHelper(m),i.HmacRIPEMD160=d._createHmacHelper(m)}(),t.RIPEMD160})}(x0)),x0.exports}var l0={exports:{}},Kr;function cn(){return Kr||(Kr=1,function(r,e){(function(t,s,i){r.exports=s(z(),n0(),Jt())})(L,function(t){return function(){var s=t,i=s.lib,n=i.Base,y=i.WordArray,d=s.algo,p=d.SHA256,a=d.HMAC,c=d.PBKDF2=n.extend({cfg:n.extend({keySize:128/32,hasher:p,iterations:25e4}),init:function(g){this.cfg=this.cfg.extend(g)},compute:function(g,o){for(var u=this.cfg,h=a.create(u.hasher,g),m=y.create(),f=y.create([1]),B=m.words,x=f.words,l=u.keySize,v=u.iterations;B.length<l;){var E=h.update(o).finalize(f);h.reset();for(var _=E.words,A=_.length,w=E,I=1;I<v;I++){w=h.finalize(w),h.reset();for(var b=w.words,C=0;C<A;C++)_[C]^=b[C]}m.concat(E),x[0]++}return m.sigBytes=l*4,m}});s.PBKDF2=function(g,o,u){return c.create(u).compute(g,o)}}(),t.PBKDF2})}(l0)),l0.exports}var u0={exports:{}},Gr;function dn(){return Gr||(Gr=1,function(r,e){(function(t,s,i){r.exports=s(z(),ee())})(L,function(t){return t.mode.CFB=function(){var s=t.lib.BlockCipherMode.extend();s.Encryptor=s.extend({processBlock:function(n,y){var d=this._cipher,p=d.blockSize;i.call(this,n,y,p,d),this._prevBlock=n.slice(y,y+p)}}),s.Decryptor=s.extend({processBlock:function(n,y){var d=this._cipher,p=d.blockSize,a=n.slice(y,y+p);i.call(this,n,y,p,d),this._prevBlock=a}});function i(n,y,d,p){var a,c=this._iv;c?(a=c.slice(0),this._iv=void 0):a=this._prevBlock,p.encryptBlock(a,0);for(var g=0;g<d;g++)n[y+g]^=a[g]}return s}(),t.mode.CFB})}(u0)),u0.exports}var p0={exports:{}},Xr;function xn(){return Xr||(Xr=1,function(r,e){(function(t,s,i){r.exports=s(z(),ee())})(L,function(t){return t.mode.CTR=function(){var s=t.lib.BlockCipherMode.extend(),i=s.Encryptor=s.extend({processBlock:function(n,y){var d=this._cipher,p=d.blockSize,a=this._iv,c=this._counter;a&&(c=this._counter=a.slice(0),this._iv=void 0);var g=c.slice(0);d.encryptBlock(g,0),c[p-1]=c[p-1]+1|0;for(var o=0;o<p;o++)n[y+o]^=g[o]}});return s.Decryptor=i,s}(),t.mode.CTR})}(p0)),p0.exports}var h0={exports:{}},Vr;function ln(){return Vr||(Vr=1,function(r,e){(function(t,s,i){r.exports=s(z(),ee())})(L,function(t){/** @preserve
|
|
70
59
|
* Counter block mode compatible with Dr Brian Gladman fileenc.c
|
|
71
60
|
* derived from CryptoJS.mode.CTR
|
|
72
61
|
* Jan Hruby jhruby.web@gmail.com
|
|
73
|
-
*/return t.mode.CTRGladman=function(){var s=t.lib.BlockCipherMode.extend();function i(x){if((x>>24&255)===255){var p=x>>16&255,a=x>>8&255,c=x&255;p===255?(p=0,a===255?(a=0,c===255?c=0:++c):++a):++p,x=0,x+=p<<16,x+=a<<8,x+=c}else x+=1<<24;return x}function n(x){return(x[0]=i(x[0]))===0&&(x[1]=i(x[1])),x}var y=s.Encryptor=s.extend({processBlock:function(x,p){var a=this._cipher,c=a.blockSize,g=this._iv,o=this._counter;g&&(o=this._counter=g.slice(0),this._iv=void 0),n(o);var u=o.slice(0);a.encryptBlock(u,0);for(var f=0;f<c;f++)x[p+f]^=u[f]}});return s.Decryptor=y,s}(),t.mode.CTRGladman})}(f0)),f0.exports}var h0={exports:{}},Jr;function un(){return Jr||(Jr=1,function(r,e){(function(t,s,i){r.exports=s(z(),ee())})(N,function(t){return t.mode.OFB=function(){var s=t.lib.BlockCipherMode.extend(),i=s.Encryptor=s.extend({processBlock:function(n,y){var x=this._cipher,p=x.blockSize,a=this._iv,c=this._keystream;a&&(c=this._keystream=a.slice(0),this._iv=void 0),x.encryptBlock(c,0);for(var g=0;g<p;g++)n[y+g]^=c[g]}});return s.Decryptor=i,s}(),t.mode.OFB})}(h0)),h0.exports}var v0={exports:{}},Zr;function pn(){return Zr||(Zr=1,function(r,e){(function(t,s,i){r.exports=s(z(),ee())})(N,function(t){return t.mode.ECB=function(){var s=t.lib.BlockCipherMode.extend();return s.Encryptor=s.extend({processBlock:function(i,n){this._cipher.encryptBlock(i,n)}}),s.Decryptor=s.extend({processBlock:function(i,n){this._cipher.decryptBlock(i,n)}}),s}(),t.mode.ECB})}(v0)),v0.exports}var y0={exports:{}},Qr;function fn(){return Qr||(Qr=1,function(r,e){(function(t,s,i){r.exports=s(z(),ee())})(N,function(t){return t.pad.AnsiX923={pad:function(s,i){var n=s.sigBytes,y=i*4,x=y-n%y,p=n+x-1;s.clamp(),s.words[p>>>2]|=x<<24-p%4*8,s.sigBytes+=x},unpad:function(s){var i=s.words[s.sigBytes-1>>>2]&255;s.sigBytes-=i}},t.pad.Ansix923})}(y0)),y0.exports}var m0={exports:{}},es;function hn(){return es||(es=1,function(r,e){(function(t,s,i){r.exports=s(z(),ee())})(N,function(t){return t.pad.Iso10126={pad:function(s,i){var n=i*4,y=n-s.sigBytes%n;s.concat(t.lib.WordArray.random(y-1)).concat(t.lib.WordArray.create([y<<24],1))},unpad:function(s){var i=s.words[s.sigBytes-1>>>2]&255;s.sigBytes-=i}},t.pad.Iso10126})}(m0)),m0.exports}var E0={exports:{}},ts;function vn(){return ts||(ts=1,function(r,e){(function(t,s,i){r.exports=s(z(),ee())})(N,function(t){return t.pad.Iso97971={pad:function(s,i){s.concat(t.lib.WordArray.create([2147483648],1)),t.pad.ZeroPadding.pad(s,i)},unpad:function(s){t.pad.ZeroPadding.unpad(s),s.sigBytes--}},t.pad.Iso97971})}(E0)),E0.exports}var g0={exports:{}},rs;function yn(){return rs||(rs=1,function(r,e){(function(t,s,i){r.exports=s(z(),ee())})(N,function(t){return t.pad.ZeroPadding={pad:function(s,i){var n=i*4;s.clamp(),s.sigBytes+=n-(s.sigBytes%n||n)},unpad:function(s){for(var i=s.words,n=s.sigBytes-1,n=s.sigBytes-1;n>=0;n--)if(i[n>>>2]>>>24-n%4*8&255){s.sigBytes=n+1;break}}},t.pad.ZeroPadding})}(g0)),g0.exports}var B0={exports:{}},ss;function mn(){return ss||(ss=1,function(r,e){(function(t,s,i){r.exports=s(z(),ee())})(N,function(t){return t.pad.NoPadding={pad:function(){},unpad:function(){}},t.pad.NoPadding})}(B0)),B0.exports}var b0={exports:{}},is;function En(){return is||(is=1,function(r,e){(function(t,s,i){r.exports=s(z(),ee())})(N,function(t){return function(s){var i=t,n=i.lib,y=n.CipherParams,x=i.enc,p=x.Hex,a=i.format;a.Hex={stringify:function(c){return c.ciphertext.toString(p)},parse:function(c){var g=p.parse(c);return y.create({ciphertext:g})}}}(),t.format.Hex})}(b0)),b0.exports}var _0={exports:{}},ns;function gn(){return ns||(ns=1,function(r,e){(function(t,s,i){r.exports=s(z(),Be(),Ae(),we(),ee())})(N,function(t){return function(){var s=t,i=s.lib,n=i.WordArray,y=i.BlockCipher,x=s.algo,p=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],a=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],c=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],g=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],o=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],u=x.DES=y.extend({_doReset:function(){for(var b=this._key,d=b.words,l=[],v=0;v<56;v++){var E=p[v]-1;l[v]=d[E>>>5]>>>31-E%32&1}for(var _=this._subKeys=[],A=0;A<16;A++){for(var w=_[A]=[],I=c[A],v=0;v<24;v++)w[v/6|0]|=l[(a[v]-1+I)%28]<<31-v%6,w[4+(v/6|0)]|=l[28+(a[v+24]-1+I)%28]<<31-v%6;w[0]=w[0]<<1|w[0]>>>31;for(var v=1;v<7;v++)w[v]=w[v]>>>(v-1)*4+3;w[7]=w[7]<<5|w[7]>>>27}for(var B=this._invSubKeys=[],v=0;v<16;v++)B[v]=_[15-v]},encryptBlock:function(b,d){this._doCryptBlock(b,d,this._subKeys)},decryptBlock:function(b,d){this._doCryptBlock(b,d,this._invSubKeys)},_doCryptBlock:function(b,d,l){this._lBlock=b[d],this._rBlock=b[d+1],f.call(this,4,252645135),f.call(this,16,65535),m.call(this,2,858993459),m.call(this,8,16711935),f.call(this,1,1431655765);for(var v=0;v<16;v++){for(var E=l[v],_=this._lBlock,A=this._rBlock,w=0,I=0;I<8;I++)w|=g[I][((A^E[I])&o[I])>>>0];this._lBlock=A,this._rBlock=_^w}var B=this._lBlock;this._lBlock=this._rBlock,this._rBlock=B,f.call(this,1,1431655765),m.call(this,8,16711935),m.call(this,2,858993459),f.call(this,16,65535),f.call(this,4,252645135),b[d]=this._lBlock,b[d+1]=this._rBlock},keySize:64/32,ivSize:64/32,blockSize:64/32});function f(b,d){var l=(this._lBlock>>>b^this._rBlock)&d;this._rBlock^=l,this._lBlock^=l<<b}function m(b,d){var l=(this._rBlock>>>b^this._lBlock)&d;this._lBlock^=l,this._rBlock^=l<<b}s.DES=y._createHelper(u);var h=x.TripleDES=y.extend({_doReset:function(){var b=this._key,d=b.words;if(d.length!==2&&d.length!==4&&d.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var l=d.slice(0,2),v=d.length<4?d.slice(0,2):d.slice(2,4),E=d.length<6?d.slice(0,2):d.slice(4,6);this._des1=u.createEncryptor(n.create(l)),this._des2=u.createEncryptor(n.create(v)),this._des3=u.createEncryptor(n.create(E))},encryptBlock:function(b,d){this._des1.encryptBlock(b,d),this._des2.decryptBlock(b,d),this._des3.encryptBlock(b,d)},decryptBlock:function(b,d){this._des3.decryptBlock(b,d),this._des2.encryptBlock(b,d),this._des1.decryptBlock(b,d)},keySize:192/32,ivSize:64/32,blockSize:64/32});s.TripleDES=y._createHelper(h)}(),t.TripleDES})}(_0)),_0.exports}var C0={exports:{}},os;function Bn(){return os||(os=1,function(r,e){(function(t,s,i){r.exports=s(z(),Be(),Ae(),we(),ee())})(N,function(t){return function(){var s=t,i=s.lib,n=i.StreamCipher,y=s.algo,x=y.RC4=n.extend({_doReset:function(){for(var c=this._key,g=c.words,o=c.sigBytes,u=this._S=[],f=0;f<256;f++)u[f]=f;for(var f=0,m=0;f<256;f++){var h=f%o,b=g[h>>>2]>>>24-h%4*8&255;m=(m+u[f]+b)%256;var d=u[f];u[f]=u[m],u[m]=d}this._i=this._j=0},_doProcessBlock:function(c,g){c[g]^=p.call(this)},keySize:256/32,ivSize:0});function p(){for(var c=this._S,g=this._i,o=this._j,u=0,f=0;f<4;f++){g=(g+1)%256,o=(o+c[g])%256;var m=c[g];c[g]=c[o],c[o]=m,u|=c[(c[g]+c[o])%256]<<24-f*8}return this._i=g,this._j=o,u}s.RC4=n._createHelper(x);var a=y.RC4Drop=x.extend({cfg:x.cfg.extend({drop:192}),_doReset:function(){x._doReset.call(this);for(var c=this.cfg.drop;c>0;c--)p.call(this)}});s.RC4Drop=n._createHelper(a)}(),t.RC4})}(C0)),C0.exports}var A0={exports:{}},as;function bn(){return as||(as=1,function(r,e){(function(t,s,i){r.exports=s(z(),Be(),Ae(),we(),ee())})(N,function(t){return function(){var s=t,i=s.lib,n=i.StreamCipher,y=s.algo,x=[],p=[],a=[],c=y.Rabbit=n.extend({_doReset:function(){for(var o=this._key.words,u=this.cfg.iv,f=0;f<4;f++)o[f]=(o[f]<<8|o[f]>>>24)&16711935|(o[f]<<24|o[f]>>>8)&4278255360;var m=this._X=[o[0],o[3]<<16|o[2]>>>16,o[1],o[0]<<16|o[3]>>>16,o[2],o[1]<<16|o[0]>>>16,o[3],o[2]<<16|o[1]>>>16],h=this._C=[o[2]<<16|o[2]>>>16,o[0]&4294901760|o[1]&65535,o[3]<<16|o[3]>>>16,o[1]&4294901760|o[2]&65535,o[0]<<16|o[0]>>>16,o[2]&4294901760|o[3]&65535,o[1]<<16|o[1]>>>16,o[3]&4294901760|o[0]&65535];this._b=0;for(var f=0;f<4;f++)g.call(this);for(var f=0;f<8;f++)h[f]^=m[f+4&7];if(u){var b=u.words,d=b[0],l=b[1],v=(d<<8|d>>>24)&16711935|(d<<24|d>>>8)&4278255360,E=(l<<8|l>>>24)&16711935|(l<<24|l>>>8)&4278255360,_=v>>>16|E&4294901760,A=E<<16|v&65535;h[0]^=v,h[1]^=_,h[2]^=E,h[3]^=A,h[4]^=v,h[5]^=_,h[6]^=E,h[7]^=A;for(var f=0;f<4;f++)g.call(this)}},_doProcessBlock:function(o,u){var f=this._X;g.call(this),x[0]=f[0]^f[5]>>>16^f[3]<<16,x[1]=f[2]^f[7]>>>16^f[5]<<16,x[2]=f[4]^f[1]>>>16^f[7]<<16,x[3]=f[6]^f[3]>>>16^f[1]<<16;for(var m=0;m<4;m++)x[m]=(x[m]<<8|x[m]>>>24)&16711935|(x[m]<<24|x[m]>>>8)&4278255360,o[u+m]^=x[m]},blockSize:128/32,ivSize:64/32});function g(){for(var o=this._X,u=this._C,f=0;f<8;f++)p[f]=u[f];u[0]=u[0]+1295307597+this._b|0,u[1]=u[1]+3545052371+(u[0]>>>0<p[0]>>>0?1:0)|0,u[2]=u[2]+886263092+(u[1]>>>0<p[1]>>>0?1:0)|0,u[3]=u[3]+1295307597+(u[2]>>>0<p[2]>>>0?1:0)|0,u[4]=u[4]+3545052371+(u[3]>>>0<p[3]>>>0?1:0)|0,u[5]=u[5]+886263092+(u[4]>>>0<p[4]>>>0?1:0)|0,u[6]=u[6]+1295307597+(u[5]>>>0<p[5]>>>0?1:0)|0,u[7]=u[7]+3545052371+(u[6]>>>0<p[6]>>>0?1:0)|0,this._b=u[7]>>>0<p[7]>>>0?1:0;for(var f=0;f<8;f++){var m=o[f]+u[f],h=m&65535,b=m>>>16,d=((h*h>>>17)+h*b>>>15)+b*b,l=((m&4294901760)*m|0)+((m&65535)*m|0);a[f]=d^l}o[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,o[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,o[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,o[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,o[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,o[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,o[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,o[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}s.Rabbit=n._createHelper(c)}(),t.Rabbit})}(A0)),A0.exports}var w0={exports:{}},cs;function _n(){return cs||(cs=1,function(r,e){(function(t,s,i){r.exports=s(z(),Be(),Ae(),we(),ee())})(N,function(t){return function(){var s=t,i=s.lib,n=i.StreamCipher,y=s.algo,x=[],p=[],a=[],c=y.RabbitLegacy=n.extend({_doReset:function(){var o=this._key.words,u=this.cfg.iv,f=this._X=[o[0],o[3]<<16|o[2]>>>16,o[1],o[0]<<16|o[3]>>>16,o[2],o[1]<<16|o[0]>>>16,o[3],o[2]<<16|o[1]>>>16],m=this._C=[o[2]<<16|o[2]>>>16,o[0]&4294901760|o[1]&65535,o[3]<<16|o[3]>>>16,o[1]&4294901760|o[2]&65535,o[0]<<16|o[0]>>>16,o[2]&4294901760|o[3]&65535,o[1]<<16|o[1]>>>16,o[3]&4294901760|o[0]&65535];this._b=0;for(var h=0;h<4;h++)g.call(this);for(var h=0;h<8;h++)m[h]^=f[h+4&7];if(u){var b=u.words,d=b[0],l=b[1],v=(d<<8|d>>>24)&16711935|(d<<24|d>>>8)&4278255360,E=(l<<8|l>>>24)&16711935|(l<<24|l>>>8)&4278255360,_=v>>>16|E&4294901760,A=E<<16|v&65535;m[0]^=v,m[1]^=_,m[2]^=E,m[3]^=A,m[4]^=v,m[5]^=_,m[6]^=E,m[7]^=A;for(var h=0;h<4;h++)g.call(this)}},_doProcessBlock:function(o,u){var f=this._X;g.call(this),x[0]=f[0]^f[5]>>>16^f[3]<<16,x[1]=f[2]^f[7]>>>16^f[5]<<16,x[2]=f[4]^f[1]>>>16^f[7]<<16,x[3]=f[6]^f[3]>>>16^f[1]<<16;for(var m=0;m<4;m++)x[m]=(x[m]<<8|x[m]>>>24)&16711935|(x[m]<<24|x[m]>>>8)&4278255360,o[u+m]^=x[m]},blockSize:128/32,ivSize:64/32});function g(){for(var o=this._X,u=this._C,f=0;f<8;f++)p[f]=u[f];u[0]=u[0]+1295307597+this._b|0,u[1]=u[1]+3545052371+(u[0]>>>0<p[0]>>>0?1:0)|0,u[2]=u[2]+886263092+(u[1]>>>0<p[1]>>>0?1:0)|0,u[3]=u[3]+1295307597+(u[2]>>>0<p[2]>>>0?1:0)|0,u[4]=u[4]+3545052371+(u[3]>>>0<p[3]>>>0?1:0)|0,u[5]=u[5]+886263092+(u[4]>>>0<p[4]>>>0?1:0)|0,u[6]=u[6]+1295307597+(u[5]>>>0<p[5]>>>0?1:0)|0,u[7]=u[7]+3545052371+(u[6]>>>0<p[6]>>>0?1:0)|0,this._b=u[7]>>>0<p[7]>>>0?1:0;for(var f=0;f<8;f++){var m=o[f]+u[f],h=m&65535,b=m>>>16,d=((h*h>>>17)+h*b>>>15)+b*b,l=((m&4294901760)*m|0)+((m&65535)*m|0);a[f]=d^l}o[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,o[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,o[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,o[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,o[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,o[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,o[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,o[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}s.RabbitLegacy=n._createHelper(c)}(),t.RabbitLegacy})}(w0)),w0.exports}var F0={exports:{}},xs;function Cn(){return xs||(xs=1,function(r,e){(function(t,s,i){r.exports=s(z(),Be(),Ae(),we(),ee())})(N,function(t){return function(){var s=t,i=s.lib,n=i.BlockCipher,y=s.algo;const x=16,p=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],a=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]];var c={pbox:[],sbox:[]};function g(h,b){let d=b>>24&255,l=b>>16&255,v=b>>8&255,E=b&255,_=h.sbox[0][d]+h.sbox[1][l];return _=_^h.sbox[2][v],_=_+h.sbox[3][E],_}function o(h,b,d){let l=b,v=d,E;for(let _=0;_<x;++_)l=l^h.pbox[_],v=g(h,l)^v,E=l,l=v,v=E;return E=l,l=v,v=E,v=v^h.pbox[x],l=l^h.pbox[x+1],{left:l,right:v}}function u(h,b,d){let l=b,v=d,E;for(let _=x+1;_>1;--_)l=l^h.pbox[_],v=g(h,l)^v,E=l,l=v,v=E;return E=l,l=v,v=E,v=v^h.pbox[1],l=l^h.pbox[0],{left:l,right:v}}function f(h,b,d){for(let A=0;A<4;A++){h.sbox[A]=[];for(let w=0;w<256;w++)h.sbox[A][w]=a[A][w]}let l=0;for(let A=0;A<x+2;A++)h.pbox[A]=p[A]^b[l],l++,l>=d&&(l=0);let v=0,E=0,_=0;for(let A=0;A<x+2;A+=2)_=o(h,v,E),v=_.left,E=_.right,h.pbox[A]=v,h.pbox[A+1]=E;for(let A=0;A<4;A++)for(let w=0;w<256;w+=2)_=o(h,v,E),v=_.left,E=_.right,h.sbox[A][w]=v,h.sbox[A][w+1]=E;return!0}var m=y.Blowfish=n.extend({_doReset:function(){if(this._keyPriorReset!==this._key){var h=this._keyPriorReset=this._key,b=h.words,d=h.sigBytes/4;f(c,b,d)}},encryptBlock:function(h,b){var d=o(c,h[b],h[b+1]);h[b]=d.left,h[b+1]=d.right},decryptBlock:function(h,b){var d=u(c,h[b],h[b+1]);h[b]=d.left,h[b+1]=d.right},blockSize:64/32,keySize:128/32,ivSize:64/32});s.Blowfish=n._createHelper(m)}(),t.Blowfish})}(F0)),F0.exports}(function(r,e){(function(t,s,i){r.exports=s(z(),pt(),en(),tn(),Be(),rn(),Ae(),wr(),n0(),sn(),Wr(),nn(),on(),an(),Yt(),cn(),we(),ee(),xn(),dn(),ln(),un(),pn(),fn(),hn(),vn(),yn(),mn(),En(),Sr(),gn(),Bn(),bn(),_n(),Cn())})(N,function(t){return t})})(Rr);var An=Rr.exports;const oe=Re(An);class wn{constructor(){this.data={client_key:""}}encryptKey(){return Tr(this.data.client_key).toString().substring(0,16)}encrypt(e){if(re(this.encryptKey()))throw new Error("privateKey is not set");const t=typeof e=="string"?e:JSON.stringify(e),s=Ve.encrypt(t,oe.enc.Utf8.parse(this.encryptKey()),{mode:oe.mode.ECB,padding:oe.pad.Pkcs7});return ke.stringify(s.ciphertext)}decrypt(e){if(re(this.encryptKey()))throw new Error("privateKey is not set");const s=Ve.decrypt(e,oe.enc.Utf8.parse(this.encryptKey()),{mode:oe.mode.ECB,padding:oe.pad.Pkcs7}).toString(oe.enc.Utf8);try{return JSON.parse(s)}catch{return s}}}class Fn extends wn{constructor(){super(),this.el="",this.data={},this.path=""}setExData(e,t){this.el=(e??"").replace(/#/gi,""),this.data=t}encryptParameters(){return encodeURIComponent(this.encrypt({categories:this.data.categories,extra:this.data.extra}))}encryptKey(){return L(this.data.client_key)?Tr(this.data.client_key).toString().substring(0,16):""}currentBootpayStoreParameters(){let e=[];const t=Object.fromEntries(new URLSearchParams(location.search));return Object.keys(t).forEach(s=>{s.match(Qt.parameterPrefix)&&e.push(`${s.replace(Qt.parameterPrefix,"")}=${t[s]}`)}),e.push("__frame=true"),e.join("&")}}const D0=new Fn,$0={mode:"production",locale:"ko",packageVersion:be.version,EX_SHOP_URL:{development:"https://dev-i.bootpay.co.kr",stage:"https://stage-i.bootpay.co.kr",production:"https://i.bootpay.co.kr"},set(r){this.mode=r},setClientKey(r){return this.clientKey=r,this.clientKey},setLocale(r){this.locale=r},toExShopUrl(r){return[this.EX_SHOP_URL[this.mode],r].join("/")}};class Dn extends _e{constructor(){super(),this.$iFrameId="bootpay-store-iframe",this.$iFrameContainerId="bootpay-store-iframe-container",this.$exOverlayId="bootpay-store-overlay",this.$exOverlayContainerId="bootpay-store-overlay-container",this.$exStore=D0,this.$template=`
|
|
62
|
+
*/return t.mode.CTRGladman=function(){var s=t.lib.BlockCipherMode.extend();function i(d){if((d>>24&255)===255){var p=d>>16&255,a=d>>8&255,c=d&255;p===255?(p=0,a===255?(a=0,c===255?c=0:++c):++a):++p,d=0,d+=p<<16,d+=a<<8,d+=c}else d+=1<<24;return d}function n(d){return(d[0]=i(d[0]))===0&&(d[1]=i(d[1])),d}var y=s.Encryptor=s.extend({processBlock:function(d,p){var a=this._cipher,c=a.blockSize,g=this._iv,o=this._counter;g&&(o=this._counter=g.slice(0),this._iv=void 0),n(o);var u=o.slice(0);a.encryptBlock(u,0);for(var h=0;h<c;h++)d[p+h]^=u[h]}});return s.Decryptor=y,s}(),t.mode.CTRGladman})}(h0)),h0.exports}var f0={exports:{}},Yr;function un(){return Yr||(Yr=1,function(r,e){(function(t,s,i){r.exports=s(z(),ee())})(L,function(t){return t.mode.OFB=function(){var s=t.lib.BlockCipherMode.extend(),i=s.Encryptor=s.extend({processBlock:function(n,y){var d=this._cipher,p=d.blockSize,a=this._iv,c=this._keystream;a&&(c=this._keystream=a.slice(0),this._iv=void 0),d.encryptBlock(c,0);for(var g=0;g<p;g++)n[y+g]^=c[g]}});return s.Decryptor=i,s}(),t.mode.OFB})}(f0)),f0.exports}var v0={exports:{}},Jr;function pn(){return Jr||(Jr=1,function(r,e){(function(t,s,i){r.exports=s(z(),ee())})(L,function(t){return t.mode.ECB=function(){var s=t.lib.BlockCipherMode.extend();return s.Encryptor=s.extend({processBlock:function(i,n){this._cipher.encryptBlock(i,n)}}),s.Decryptor=s.extend({processBlock:function(i,n){this._cipher.decryptBlock(i,n)}}),s}(),t.mode.ECB})}(v0)),v0.exports}var y0={exports:{}},Zr;function hn(){return Zr||(Zr=1,function(r,e){(function(t,s,i){r.exports=s(z(),ee())})(L,function(t){return t.pad.AnsiX923={pad:function(s,i){var n=s.sigBytes,y=i*4,d=y-n%y,p=n+d-1;s.clamp(),s.words[p>>>2]|=d<<24-p%4*8,s.sigBytes+=d},unpad:function(s){var i=s.words[s.sigBytes-1>>>2]&255;s.sigBytes-=i}},t.pad.Ansix923})}(y0)),y0.exports}var m0={exports:{}},Qr;function fn(){return Qr||(Qr=1,function(r,e){(function(t,s,i){r.exports=s(z(),ee())})(L,function(t){return t.pad.Iso10126={pad:function(s,i){var n=i*4,y=n-s.sigBytes%n;s.concat(t.lib.WordArray.random(y-1)).concat(t.lib.WordArray.create([y<<24],1))},unpad:function(s){var i=s.words[s.sigBytes-1>>>2]&255;s.sigBytes-=i}},t.pad.Iso10126})}(m0)),m0.exports}var E0={exports:{}},es;function vn(){return es||(es=1,function(r,e){(function(t,s,i){r.exports=s(z(),ee())})(L,function(t){return t.pad.Iso97971={pad:function(s,i){s.concat(t.lib.WordArray.create([2147483648],1)),t.pad.ZeroPadding.pad(s,i)},unpad:function(s){t.pad.ZeroPadding.unpad(s),s.sigBytes--}},t.pad.Iso97971})}(E0)),E0.exports}var g0={exports:{}},ts;function yn(){return ts||(ts=1,function(r,e){(function(t,s,i){r.exports=s(z(),ee())})(L,function(t){return t.pad.ZeroPadding={pad:function(s,i){var n=i*4;s.clamp(),s.sigBytes+=n-(s.sigBytes%n||n)},unpad:function(s){for(var i=s.words,n=s.sigBytes-1,n=s.sigBytes-1;n>=0;n--)if(i[n>>>2]>>>24-n%4*8&255){s.sigBytes=n+1;break}}},t.pad.ZeroPadding})}(g0)),g0.exports}var b0={exports:{}},rs;function mn(){return rs||(rs=1,function(r,e){(function(t,s,i){r.exports=s(z(),ee())})(L,function(t){return t.pad.NoPadding={pad:function(){},unpad:function(){}},t.pad.NoPadding})}(b0)),b0.exports}var B0={exports:{}},ss;function En(){return ss||(ss=1,function(r,e){(function(t,s,i){r.exports=s(z(),ee())})(L,function(t){return function(s){var i=t,n=i.lib,y=n.CipherParams,d=i.enc,p=d.Hex,a=i.format;a.Hex={stringify:function(c){return c.ciphertext.toString(p)},parse:function(c){var g=p.parse(c);return y.create({ciphertext:g})}}}(),t.format.Hex})}(B0)),B0.exports}var _0={exports:{}},is;function gn(){return is||(is=1,function(r,e){(function(t,s,i){r.exports=s(z(),be(),Ae(),we(),ee())})(L,function(t){return function(){var s=t,i=s.lib,n=i.WordArray,y=i.BlockCipher,d=s.algo,p=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],a=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],c=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],g=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],o=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],u=d.DES=y.extend({_doReset:function(){for(var B=this._key,x=B.words,l=[],v=0;v<56;v++){var E=p[v]-1;l[v]=x[E>>>5]>>>31-E%32&1}for(var _=this._subKeys=[],A=0;A<16;A++){for(var w=_[A]=[],I=c[A],v=0;v<24;v++)w[v/6|0]|=l[(a[v]-1+I)%28]<<31-v%6,w[4+(v/6|0)]|=l[28+(a[v+24]-1+I)%28]<<31-v%6;w[0]=w[0]<<1|w[0]>>>31;for(var v=1;v<7;v++)w[v]=w[v]>>>(v-1)*4+3;w[7]=w[7]<<5|w[7]>>>27}for(var b=this._invSubKeys=[],v=0;v<16;v++)b[v]=_[15-v]},encryptBlock:function(B,x){this._doCryptBlock(B,x,this._subKeys)},decryptBlock:function(B,x){this._doCryptBlock(B,x,this._invSubKeys)},_doCryptBlock:function(B,x,l){this._lBlock=B[x],this._rBlock=B[x+1],h.call(this,4,252645135),h.call(this,16,65535),m.call(this,2,858993459),m.call(this,8,16711935),h.call(this,1,1431655765);for(var v=0;v<16;v++){for(var E=l[v],_=this._lBlock,A=this._rBlock,w=0,I=0;I<8;I++)w|=g[I][((A^E[I])&o[I])>>>0];this._lBlock=A,this._rBlock=_^w}var b=this._lBlock;this._lBlock=this._rBlock,this._rBlock=b,h.call(this,1,1431655765),m.call(this,8,16711935),m.call(this,2,858993459),h.call(this,16,65535),h.call(this,4,252645135),B[x]=this._lBlock,B[x+1]=this._rBlock},keySize:64/32,ivSize:64/32,blockSize:64/32});function h(B,x){var l=(this._lBlock>>>B^this._rBlock)&x;this._rBlock^=l,this._lBlock^=l<<B}function m(B,x){var l=(this._rBlock>>>B^this._lBlock)&x;this._lBlock^=l,this._rBlock^=l<<B}s.DES=y._createHelper(u);var f=d.TripleDES=y.extend({_doReset:function(){var B=this._key,x=B.words;if(x.length!==2&&x.length!==4&&x.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var l=x.slice(0,2),v=x.length<4?x.slice(0,2):x.slice(2,4),E=x.length<6?x.slice(0,2):x.slice(4,6);this._des1=u.createEncryptor(n.create(l)),this._des2=u.createEncryptor(n.create(v)),this._des3=u.createEncryptor(n.create(E))},encryptBlock:function(B,x){this._des1.encryptBlock(B,x),this._des2.decryptBlock(B,x),this._des3.encryptBlock(B,x)},decryptBlock:function(B,x){this._des3.decryptBlock(B,x),this._des2.encryptBlock(B,x),this._des1.decryptBlock(B,x)},keySize:192/32,ivSize:64/32,blockSize:64/32});s.TripleDES=y._createHelper(f)}(),t.TripleDES})}(_0)),_0.exports}var C0={exports:{}},ns;function bn(){return ns||(ns=1,function(r,e){(function(t,s,i){r.exports=s(z(),be(),Ae(),we(),ee())})(L,function(t){return function(){var s=t,i=s.lib,n=i.StreamCipher,y=s.algo,d=y.RC4=n.extend({_doReset:function(){for(var c=this._key,g=c.words,o=c.sigBytes,u=this._S=[],h=0;h<256;h++)u[h]=h;for(var h=0,m=0;h<256;h++){var f=h%o,B=g[f>>>2]>>>24-f%4*8&255;m=(m+u[h]+B)%256;var x=u[h];u[h]=u[m],u[m]=x}this._i=this._j=0},_doProcessBlock:function(c,g){c[g]^=p.call(this)},keySize:256/32,ivSize:0});function p(){for(var c=this._S,g=this._i,o=this._j,u=0,h=0;h<4;h++){g=(g+1)%256,o=(o+c[g])%256;var m=c[g];c[g]=c[o],c[o]=m,u|=c[(c[g]+c[o])%256]<<24-h*8}return this._i=g,this._j=o,u}s.RC4=n._createHelper(d);var a=y.RC4Drop=d.extend({cfg:d.cfg.extend({drop:192}),_doReset:function(){d._doReset.call(this);for(var c=this.cfg.drop;c>0;c--)p.call(this)}});s.RC4Drop=n._createHelper(a)}(),t.RC4})}(C0)),C0.exports}var A0={exports:{}},os;function Bn(){return os||(os=1,function(r,e){(function(t,s,i){r.exports=s(z(),be(),Ae(),we(),ee())})(L,function(t){return function(){var s=t,i=s.lib,n=i.StreamCipher,y=s.algo,d=[],p=[],a=[],c=y.Rabbit=n.extend({_doReset:function(){for(var o=this._key.words,u=this.cfg.iv,h=0;h<4;h++)o[h]=(o[h]<<8|o[h]>>>24)&16711935|(o[h]<<24|o[h]>>>8)&4278255360;var m=this._X=[o[0],o[3]<<16|o[2]>>>16,o[1],o[0]<<16|o[3]>>>16,o[2],o[1]<<16|o[0]>>>16,o[3],o[2]<<16|o[1]>>>16],f=this._C=[o[2]<<16|o[2]>>>16,o[0]&4294901760|o[1]&65535,o[3]<<16|o[3]>>>16,o[1]&4294901760|o[2]&65535,o[0]<<16|o[0]>>>16,o[2]&4294901760|o[3]&65535,o[1]<<16|o[1]>>>16,o[3]&4294901760|o[0]&65535];this._b=0;for(var h=0;h<4;h++)g.call(this);for(var h=0;h<8;h++)f[h]^=m[h+4&7];if(u){var B=u.words,x=B[0],l=B[1],v=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,E=(l<<8|l>>>24)&16711935|(l<<24|l>>>8)&4278255360,_=v>>>16|E&4294901760,A=E<<16|v&65535;f[0]^=v,f[1]^=_,f[2]^=E,f[3]^=A,f[4]^=v,f[5]^=_,f[6]^=E,f[7]^=A;for(var h=0;h<4;h++)g.call(this)}},_doProcessBlock:function(o,u){var h=this._X;g.call(this),d[0]=h[0]^h[5]>>>16^h[3]<<16,d[1]=h[2]^h[7]>>>16^h[5]<<16,d[2]=h[4]^h[1]>>>16^h[7]<<16,d[3]=h[6]^h[3]>>>16^h[1]<<16;for(var m=0;m<4;m++)d[m]=(d[m]<<8|d[m]>>>24)&16711935|(d[m]<<24|d[m]>>>8)&4278255360,o[u+m]^=d[m]},blockSize:128/32,ivSize:64/32});function g(){for(var o=this._X,u=this._C,h=0;h<8;h++)p[h]=u[h];u[0]=u[0]+1295307597+this._b|0,u[1]=u[1]+3545052371+(u[0]>>>0<p[0]>>>0?1:0)|0,u[2]=u[2]+886263092+(u[1]>>>0<p[1]>>>0?1:0)|0,u[3]=u[3]+1295307597+(u[2]>>>0<p[2]>>>0?1:0)|0,u[4]=u[4]+3545052371+(u[3]>>>0<p[3]>>>0?1:0)|0,u[5]=u[5]+886263092+(u[4]>>>0<p[4]>>>0?1:0)|0,u[6]=u[6]+1295307597+(u[5]>>>0<p[5]>>>0?1:0)|0,u[7]=u[7]+3545052371+(u[6]>>>0<p[6]>>>0?1:0)|0,this._b=u[7]>>>0<p[7]>>>0?1:0;for(var h=0;h<8;h++){var m=o[h]+u[h],f=m&65535,B=m>>>16,x=((f*f>>>17)+f*B>>>15)+B*B,l=((m&4294901760)*m|0)+((m&65535)*m|0);a[h]=x^l}o[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,o[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,o[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,o[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,o[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,o[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,o[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,o[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}s.Rabbit=n._createHelper(c)}(),t.Rabbit})}(A0)),A0.exports}var w0={exports:{}},as;function _n(){return as||(as=1,function(r,e){(function(t,s,i){r.exports=s(z(),be(),Ae(),we(),ee())})(L,function(t){return function(){var s=t,i=s.lib,n=i.StreamCipher,y=s.algo,d=[],p=[],a=[],c=y.RabbitLegacy=n.extend({_doReset:function(){var o=this._key.words,u=this.cfg.iv,h=this._X=[o[0],o[3]<<16|o[2]>>>16,o[1],o[0]<<16|o[3]>>>16,o[2],o[1]<<16|o[0]>>>16,o[3],o[2]<<16|o[1]>>>16],m=this._C=[o[2]<<16|o[2]>>>16,o[0]&4294901760|o[1]&65535,o[3]<<16|o[3]>>>16,o[1]&4294901760|o[2]&65535,o[0]<<16|o[0]>>>16,o[2]&4294901760|o[3]&65535,o[1]<<16|o[1]>>>16,o[3]&4294901760|o[0]&65535];this._b=0;for(var f=0;f<4;f++)g.call(this);for(var f=0;f<8;f++)m[f]^=h[f+4&7];if(u){var B=u.words,x=B[0],l=B[1],v=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,E=(l<<8|l>>>24)&16711935|(l<<24|l>>>8)&4278255360,_=v>>>16|E&4294901760,A=E<<16|v&65535;m[0]^=v,m[1]^=_,m[2]^=E,m[3]^=A,m[4]^=v,m[5]^=_,m[6]^=E,m[7]^=A;for(var f=0;f<4;f++)g.call(this)}},_doProcessBlock:function(o,u){var h=this._X;g.call(this),d[0]=h[0]^h[5]>>>16^h[3]<<16,d[1]=h[2]^h[7]>>>16^h[5]<<16,d[2]=h[4]^h[1]>>>16^h[7]<<16,d[3]=h[6]^h[3]>>>16^h[1]<<16;for(var m=0;m<4;m++)d[m]=(d[m]<<8|d[m]>>>24)&16711935|(d[m]<<24|d[m]>>>8)&4278255360,o[u+m]^=d[m]},blockSize:128/32,ivSize:64/32});function g(){for(var o=this._X,u=this._C,h=0;h<8;h++)p[h]=u[h];u[0]=u[0]+1295307597+this._b|0,u[1]=u[1]+3545052371+(u[0]>>>0<p[0]>>>0?1:0)|0,u[2]=u[2]+886263092+(u[1]>>>0<p[1]>>>0?1:0)|0,u[3]=u[3]+1295307597+(u[2]>>>0<p[2]>>>0?1:0)|0,u[4]=u[4]+3545052371+(u[3]>>>0<p[3]>>>0?1:0)|0,u[5]=u[5]+886263092+(u[4]>>>0<p[4]>>>0?1:0)|0,u[6]=u[6]+1295307597+(u[5]>>>0<p[5]>>>0?1:0)|0,u[7]=u[7]+3545052371+(u[6]>>>0<p[6]>>>0?1:0)|0,this._b=u[7]>>>0<p[7]>>>0?1:0;for(var h=0;h<8;h++){var m=o[h]+u[h],f=m&65535,B=m>>>16,x=((f*f>>>17)+f*B>>>15)+B*B,l=((m&4294901760)*m|0)+((m&65535)*m|0);a[h]=x^l}o[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,o[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,o[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,o[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,o[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,o[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,o[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,o[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}s.RabbitLegacy=n._createHelper(c)}(),t.RabbitLegacy})}(w0)),w0.exports}var F0={exports:{}},cs;function Cn(){return cs||(cs=1,function(r,e){(function(t,s,i){r.exports=s(z(),be(),Ae(),we(),ee())})(L,function(t){return function(){var s=t,i=s.lib,n=i.BlockCipher,y=s.algo;const d=16,p=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],a=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]];var c={pbox:[],sbox:[]};function g(f,B){let x=B>>24&255,l=B>>16&255,v=B>>8&255,E=B&255,_=f.sbox[0][x]+f.sbox[1][l];return _=_^f.sbox[2][v],_=_+f.sbox[3][E],_}function o(f,B,x){let l=B,v=x,E;for(let _=0;_<d;++_)l=l^f.pbox[_],v=g(f,l)^v,E=l,l=v,v=E;return E=l,l=v,v=E,v=v^f.pbox[d],l=l^f.pbox[d+1],{left:l,right:v}}function u(f,B,x){let l=B,v=x,E;for(let _=d+1;_>1;--_)l=l^f.pbox[_],v=g(f,l)^v,E=l,l=v,v=E;return E=l,l=v,v=E,v=v^f.pbox[1],l=l^f.pbox[0],{left:l,right:v}}function h(f,B,x){for(let A=0;A<4;A++){f.sbox[A]=[];for(let w=0;w<256;w++)f.sbox[A][w]=a[A][w]}let l=0;for(let A=0;A<d+2;A++)f.pbox[A]=p[A]^B[l],l++,l>=x&&(l=0);let v=0,E=0,_=0;for(let A=0;A<d+2;A+=2)_=o(f,v,E),v=_.left,E=_.right,f.pbox[A]=v,f.pbox[A+1]=E;for(let A=0;A<4;A++)for(let w=0;w<256;w+=2)_=o(f,v,E),v=_.left,E=_.right,f.sbox[A][w]=v,f.sbox[A][w+1]=E;return!0}var m=y.Blowfish=n.extend({_doReset:function(){if(this._keyPriorReset!==this._key){var f=this._keyPriorReset=this._key,B=f.words,x=f.sigBytes/4;h(c,B,x)}},encryptBlock:function(f,B){var x=o(c,f[B],f[B+1]);f[B]=x.left,f[B+1]=x.right},decryptBlock:function(f,B){var x=u(c,f[B],f[B+1]);f[B]=x.left,f[B+1]=x.right},blockSize:64/32,keySize:128/32,ivSize:64/32});s.Blowfish=n._createHelper(m)}(),t.Blowfish})}(F0)),F0.exports}(function(r,e){(function(t,s,i){r.exports=s(z(),ft(),en(),tn(),be(),rn(),Ae(),Dr(),n0(),sn(),qr(),nn(),on(),an(),Jt(),cn(),we(),ee(),dn(),xn(),ln(),un(),pn(),hn(),fn(),vn(),yn(),mn(),En(),Ir(),gn(),bn(),Bn(),_n(),Cn())})(L,function(t){return t})})(Rr);var An=Rr.exports;const oe=Oe(An);var wn=Ae();const Qe=Oe(wn),M={el:void 0,data:void 0,termsPassed:!1,widgetExtra:{card_quota:[]},widgetType:1,hooks:{},setWidgetData(r,e){this.hooks=e.hooks??{},this.el=String(r).replace(/#/gi,""),this.data=e,this.termsPassed=!1,this.data.terms=this.data.terms??[],this.widgetType=1,this.data.widget=1,this.data.use_terms=this.data.use_terms??!0},setPayment(r,e,t,s=!1,i,n){this.data.pg=r,this.data.method=e,this.data.wallet_id=t,this.termsPassed=s,this.data.terms=i,this.widgetExtra=n},updateOnProcessing(r){U(r.price)&&(this.data.price=r.price),U(r.tax_free)&&(this.data.tax_free=r.tax_free),U(r.currency)&&(this.data.currency=r.currency),r.user_token!==void 0&&(this.data.user_token=r.user_token),U(r.use_terms)&&(this.data.use_terms=r.use_terms!==!1),U(r.sandbox)&&(this.data.sandbox=r.sandbox===!0),U(r.widget_key)&&(this.data.widget_key=r.widget_key),U(r.widget_type)&&(this.widgetType=r.widget_type),r.external_terms!==void 0&&(this.data.external_terms=r.external_terms),r.use_bootpay_inapp_sdk!==void 0&&(this.data.use_bootpay_inapp_sdk=r.use_bootpay_inapp_sdk),r.widget_key!==void 0&&(this.data.widget_key=r.widget_key)},encryptParameters(){return encodeURIComponent(this.encrypt({order_name:this.data.order_name,use_only_brandpay:this.data.use_only_brandpay,subscribe_brandpay_type:this.data.subscribe_brandpay_type,user_token:this.data.user_token,sandbox:this.data.sandbox,use_terms:this.data.use_terms,external_terms:this.data.external_terms,key:this.data.widget_key,use_bootpay_inapp_sdk:this.data.use_bootpay_inapp_sdk,extra:this.data.extra,log_level:H.level}))},encrypt(r){if(re(this.data.application_id))throw new Error("privateKey is not set");const e=typeof r=="string"?r:JSON.stringify(r),t=Ye.encrypt(e,oe.enc.Utf8.parse(Qe(this.data.application_id).toString().substring(0,16)),{mode:oe.mode.ECB,padding:oe.pad.Pkcs7});return ke.stringify(t.ciphertext)},decrypt(r){if(re(this.data.application_id))throw new Error("privateKey is not set");const t=Ye.decrypt(r,oe.enc.Utf8.parse(Qe(this.data.application_id).toString().substring(0,16)),{mode:oe.mode.ECB,padding:oe.pad.Pkcs7}).toString(oe.enc.Utf8);try{return JSON.parse(t)}catch{return t}},getExtra(r=void 0){return Te(r??{},Te(this.data.extra??{},this.widgetExtra??{}))},getRequestPaymentData(r=void 0){return this.data.extra={},this.data.widget_sandbox=this.data.sandbox,this.data.extra=this.getExtra(r.extra),Te(r,this.data)},callHook(r,e){this.data.hooks&&this.data.hooks[r]&&typeof this.data.hooks[r]=="function"&&this.data.hooks[r](e)}};class Fn extends _e{constructor(){super(),this.$iFrameId="bootpay-widget-iframe",this.$widgetStore=M,this.$template=this.defaultIframeHtml()}render(){const e=document.getElementById(this.$widgetStore.el);if(this.$blank(this.$widgetStore.el)||e===null)throw new Error("부트페이 위젯을 설정할 Element ID를 입력하지 않았거나 해당 Element DOM이 존재하지 않습니다.");this.templateRender()}templateRender(){const e=document.getElementById(this.$widgetStore.el);e.style.setProperty("height","0px"),e.innerHTML=this.$template,this.byId(this.$iFrameId).setAttribute("src",O.toWidget(`p/${this.$widgetStore.data.application_id}/${this.$widgetStore.encryptParameters()}`))}resize(e){this.templateResize(this.$widgetStore.el,e)}rerender(){this.postMessage("bootpayWidgetRerender")}destroy(){const e=document.getElementById(this.$widgetStore.el);e.innerHTML=""}}const G=new Fn;class Dn extends Ue{constructor(){super(),this.message=Qt}initialize(){M.setWidgetData(void 0,{application_id:void 0,order_name:"",order_id:void 0,price:0,tax_free:0,currency:"KRW",user_token:void 0,pg:void 0,method:void 0,widget_key:void 0})}render(e,t){if(this.$blank(t==null?void 0:t.price)||t.price<0)throw new Error("결제금액은 1원 이상을 입력해주세요.");if(this.$blank(t==null?void 0:t.application_id))throw new Error("application_id가 입력되지 않았습니다.");this.initialize(),M.setWidgetData(e,t),G.render(),ds.bind()}update(e){const{price:t,tax_free:s,currency:i,user_token:n,use_only_brandpay:y,use_terms:d,sandbox:p,widget_key:a,external_terms:c}=e;M.updateOnProcessing({price:t,tax_free:s,currency:i,user_token:n,use_only_brandpay:y,use_terms:d,external_terms:c,sandbox:p,widget_key:a}),(this.$present(n)||this.$present(y)||this.$present(d)||this.$present(p))&&G.postMessage("bootpayWidgetUpdateUserToken",{user_token:n,use_only_brandpay:y,use_terms:d,external_terms:c,sandbox:p,key:a})}rerender(){G.rerender()}destroy(){G.destroy()}selectPayment(e,t,s,i=!1,n,y){M.setPayment(e,t,s,i,n,y),H.debug("selectPayment",`pg: ${e}, method: ${t}, wallet_id: ${s}, terms: ${i}, select_terms: ${JSON.stringify(n)}, extra: ${JSON.stringify(y)}`)}currentTermsCondition(){return M.data.terms}async requestPayment(e){return this.widgetRequestPaymentValidate(1),ge.requestPayment(M.getRequestPaymentData(e))}async requestSubscription(e){return this.widgetRequestPaymentValidate(2),ge.requestSubscription(M.getRequestPaymentData(e))}isRendered(){return G.isRendered()}synchronizedRealTimeTransfer(e){G.postMessage("bootpayWidgetSynchronizedRealTimeTransfer",e)}sendSelectPayment(e){G.postMessage("bootpayWidgetSelectPayment",e)}sendMessage(e,t){G.postMessage(e,t)}currentPaymentParameters(){return{pg:M.data.pg,method:M.data.method,wallet_id:M.data.wallet_id,terms:M.data.terms,widget_key:M.data.widget_key,widget_sandbox:M.data.sandbox,extra:M.getExtra({})}}widgetRequestPaymentValidate(e=void 0){if(e!==void 0&&M.widgetType!==e)throw new le({event:"error",error_code:"RC_WIDGET_TYPE_INVALID",message:e===1?this.message.getLocaleMessage("widgetTypeNotPayment","ko"):this.message.getLocaleMessage("widgetTypeNotSubscription","ko")});if(this.$blank(M.data.pg)||this.$blank(M.data.method))throw new le({event:"error",error_code:"RC_PG_METHOD_NOT_SELECTED",message:this.message.getLocaleMessage("notSelectPayment","ko")});if(!M.termsPassed&&M.data.use_terms)throw new le({event:"error",error_code:"RC_TERMS_NOT_AGREE",message:this.message.getLocaleMessage("termsNotAgree","ko")});if(["BRANDPAY_CARD","BRANDPAY_AUTOMATIC_TRANSFER"].indexOf(M.data.method)>-1&&M.data.wallet_id===void 0)throw new le({event:"error",error_code:"RC_BRANDPAY_NEED_SELECT_WALLET",message:this.message.getLocaleMessage("notSelectBrandpay","ko")})}}const se=new Dn;class $n extends _e{constructor(){super(),this.$brandpayWindowId="__bootpay-card-easy-window",this.$iFrameId="__bootpay-card-easy-iframe",this.$windowId="__bootpay-card-easy-container-window",this.$additionalClass=O.isMobile()?"transparent":"rounded-iframe transparent",this.$template=this.template(),this.$widgetStore=M}template(){return`
|
|
63
|
+
<div id="${this.$windowId}" class="bootpay-payment-background">
|
|
64
|
+
<div class="bootpay-payment-window ${O.isMobile()?"__mobile":""}" id="${this.$brandpayWindowId}">
|
|
65
|
+
<iframe class="${this.$additionalClass}" id="${this.$iFrameId}" name="${this.$iFrameId}"></iframe>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
`}createIFrame(e){this.createTemplateHtml();const t=document.getElementById(this.$iFrameId);t==null||t.setAttribute("src",O.toWidget(`${e}`)),t==null||t.style.setProperty("display","block"),this.bodyOpen("bootpay-mobile")}addWallet(e){this.createIFrame(e)}removeWallet(e){this.createIFrame(`brandpay/destroy/${this.$widgetStore.data.application_id}/${e}`)}showCardInterestInformation(e){this.createIFrame(`card/interest/${this.$widgetStore.data.application_id}`)}brandpayPreference(e){const{popup:t}=e,s=`brandpay/${this.$widgetStore.data.application_id}/${this.$widgetStore.encryptParameters()}/edit`;t||O.isMobile()?window.open(O.toWidget(`${s}?__popup=true`),"widget-brandpay-environment-popup","width=500,height=800,scrollbars=yes").focus():this.createIFrame(s)}destroy(){const e=document.getElementById(this.$windowId);e!==void 0&&(e.outerHTML="",e.remove())}resize(e){H.debug("resize",e),this.templateResize(this.$iFrameId,e)}postMessage(e,t=void 0){var i;const s=this.byId(this.$iFrameId);(i=s==null?void 0:s.contentWindow)==null||i.postMessage(JSON.stringify({bootpay_event:!0,event:e,data:t}),"*")}}const Fe=new $n;class kn extends _e{constructor(){super(),this.$windowId="__bootpay-modal-window-container",this.$modalWindowId="__bootpay-modal-window",this.$iFrameId="__bootpay-modal-iframe",this.$additionalClass=O.isMobile()?"":"rounded-iframe",this.$template=this.template()}template(){return`
|
|
69
|
+
<div id="${this.$windowId}" class="bootpay-payment-background">
|
|
70
|
+
<div class="bootpay-payment-window ${O.isMobile()?"__mobile":""}" id="${this.$modalWindowId}">
|
|
71
|
+
<iframe class="${this.$additionalClass}" id="${this.$iFrameId}" name="${this.$iFrameId}"></iframe>
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
`}createIFrame(e){this.createTemplateHtml();const t=document.getElementById(this.$iFrameId);t==null||t.setAttribute("src",e),t==null||t.classList.add("slide-up"),t==null||t.style.setProperty("display","block"),this.bodyOpen()}destroy(){const e=document.getElementById(this.$iFrameId);e==null||e.classList.remove("slide-up"),e==null||e.classList.add("slide-down"),setTimeout(()=>{const t=document.getElementById(this.$windowId);t!==void 0&&(t.outerHTML="",t.remove())},300)}resize(e){H.debug("resize",e),this.templateResize(this.$iFrameId,e)}postMessage(e,t=void 0){var i;const s=this.byId(this.$iFrameId);(i=s==null?void 0:s.contentWindow)==null||i.postMessage(JSON.stringify({bootpay_event:!0,event:e,data:t}),"*")}}const vt=new kn;class Sn extends _e{constructor(){super(),this.$windowId="__bootpay-confirm-modal-window-container",this.$modalWindowId="__bootpay-confirm-modal-window",this.$additionalClass="rounded-iframe",this.$title="알림",this.$confirmButtonText="확인",this.$cancelButtonText="취소",this.$hookConfirmButtonId="__bootpay-confirm-modal-hook-button",this.$hookCancelButtonId="__bootpay-cancel-modal-hook-button",this.$hookCloseButtonId="__bootpay-close-modal-hook-button",this.$template=this.template(),this.$message=""}template(){return`
|
|
75
|
+
<div id="${this.$windowId}" class="bootpay-payment-background __alert">
|
|
76
|
+
<div class="bootpay-confirm-window fade-in" id="${this.$modalWindowId}">
|
|
77
|
+
<div class="bootpay__alert-header">
|
|
78
|
+
${this.$title}
|
|
79
|
+
<button class="bootpay-close-btn" id="${this.$hookCloseButtonId}"></button>
|
|
80
|
+
</div>
|
|
81
|
+
<div class="bootpay__alert-body">
|
|
82
|
+
${this.$message}
|
|
83
|
+
</div>
|
|
84
|
+
<div class="bootpay__alert-footer">
|
|
85
|
+
<button class="bootpay__alert-close border-right" id="${this.$hookCancelButtonId}">${this.$cancelButtonText}</button>
|
|
86
|
+
<button class="bootpay__alert-close bootpay-primary" id="${this.$hookConfirmButtonId}">${this.$confirmButtonText}</button>
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
</div>
|
|
90
|
+
`}show(e,t="알림",s="확인",i="취소",n,y,d=!0){this.$title=t,this.$message=e,this.$confirmButtonText=s,this.$cancelButtonText=i,this.$template=this.template(),this.createTemplateHtml(),document.getElementById(this.$hookConfirmButtonId).addEventListener("click",()=>{this.destroy(),n!==void 0&&n()}),document.getElementById(this.$hookCancelButtonId).addEventListener("click",()=>{this.destroy(),y!==void 0&&y()}),document.getElementById(this.$hookCloseButtonId).addEventListener("click",()=>{this.destroy(),y!==void 0&&y()}),d?(document.getElementById(this.$hookCancelButtonId).removeAttribute("style"),document.getElementById(this.$hookConfirmButtonId).removeAttribute("style")):(document.getElementById(this.$hookCancelButtonId).style.display="none",document.getElementById(this.$hookConfirmButtonId).style.flex="0 1 100%"),this.bodyOpen()}destroy(){const e=document.getElementById(this.$modalWindowId);e.classList.remove("fade-in"),e.classList.add("fade-out"),setTimeout(()=>{const t=document.getElementById(this.$windowId);t!==void 0&&(t.outerHTML="",t.remove()),this.bodyClose()},100)}}const D0=new Sn,Pn={$eventPrefix:"bootpay",bootpayWidgetSelectMethod(r){return this.triggerGlobalChangeEvent(r),se.selectPayment(r.pg,r.method,r.wallet_id,r.term_passed===!0,r.select_terms,r.extra)},bootpayWidgetResponseGetEnvironmentWidget(r){return Fe.postMessage("bootpayResponseGetEnvironmentWidget",{use_only_brandpay:G.$widgetStore.data.use_only_brandpay,user_token:G.$widgetStore.data.user_token,sandbox:G.$widgetStore.data.sandbox,use_terms:G.$widgetStore.data.use_terms,platform:r.platform})},bootpayWidgetResponseCurrentStores(r){return Fe.postMessage("bootpayResponseCurrentStores",r)},bootpayWidgetError(r,e){return e.reject(r)},bootpayWidgetBrandpayReload(r){return G.postMessage("bootpayWidgetBrandpayReload",r)},bootpayWidgetResize(r){return this.callBootpayDOMEvent("widget-resize",r),M.callHook("resize",r),G.resize(r)},bootpayWidgetShowInterestInformation(r){return Fe.showCardInterestInformation(r)},bootpayWidgetAddWallet(r){return Fe.addWallet(r.url)},bootpayWidgetRemoveWallet(r){return Fe.removeWallet(r.wallet_id)},bootpayWidgetPaymentWindowResize(r){return Fe.resize(r)},bootpayWidgetBrandpayWindowClose(){return Fe.destroy()},bootpayWidgetModalOpen(r){return vt.createIFrame(r.url)},bootpayWidgetModalClose(){return vt.destroy()},bootpayRequestModalCurrentStores(r){return G.postMessage("bootpayWidgetRequestModalCurrentStores",r)},bootpayRequestGetEnvironmentModalWidget(r){return G.postMessage("bootpayWidgetGetEnvironmentModalWidget",r)},bootpayWidgetResponseGetEnvironmentModalWidget(r){return vt.postMessage("bootpayResponseGetEnvironmentModalWidget",{application_id:G.$widgetStore.data.application_id,use_only_brandpay:G.$widgetStore.data.use_only_brandpay,user_token:G.$widgetStore.data.user_token,sandbox:G.$widgetStore.data.sandbox,use_terms:G.$widgetStore.data.use_terms,external_terms:G.$widgetStore.data.external_terms,key:G.$widgetStore.data.widget_key,platform:r.platform,log_level:H.level})},bootpayWidgetModalResize(r){return vt.resize(r)},bootpayWidgetPaymentGetStoreData(){const{application_id:r,price:e,tax_free:t,user_token:s}=G.$widgetStore.data;return G.postMessage("bootpayWidgetResponseStoreData",{applicationId:r,price:e,widgetExtra:G.$widgetStore.widgetExtra,taxFree:t,userToken:s})},bootpayWidgetTermAllAgree(r){this.callBootpayDOMEvent("all-agree-terms",r),M.callHook("allTermsAccepted",r)},bootpayWidgetSelectPayment(r){const{method_alias:e,payment_type:t,wallet_id:s}=r;return G.postMessage("bootpayWidgetSelectPayment",{method_alias:e,payment_type:t,wallet_id:s})},bootpayWidgetReady(r){this.callBootpayDOMEvent("widget-ready",r),M.callHook("ready",r)},bootpayWidgetUpdateStore(r){M.updateOnProcessing({...r})},bootpayWidgetToUrl(r){location.href=r.url},bootpayWidgetShowModal(r){return D0.show(r.message,r.title,r.confirmButtonText,r.cancelButtonText,()=>{window.BootpayWidget.alertConfirm()},()=>{window.BootpayWidget.alertCancel()})},brandpayWalletUpdated(r){M.callHook("brandpayWalletUpdated",r)},triggerGlobalChangeEvent(r){var e;r.completed=U(r.pg)&&U(r.method)&&(r.term_passed===!0||!M.data.use_terms)&&(["BRANDPAY_CARD","BRANDPAY_AUTOMATIC_TRANSFER"].indexOf(r.method)===-1||r.wallet_id!==void 0),(M.data.pg!==r.pg||M.data.method!==r.method||M.data.wallet_id!==r.wallet_id||JSON.stringify(M.widgetExtra)!==JSON.stringify(r.extra))&&(this.callBootpayDOMEvent("widget-change-payment",r),M.callHook("paymentMethodUpdated",r)),JSON.stringify((e=r.select_terms)==null?void 0:e.filter(t=>t.agree===!0))!==JSON.stringify(M.data.terms.filter(t=>t.agree===!0))&&(this.callBootpayDOMEvent("widget-change-terms",r),M.callHook("termsConsentUpdated",r))},callBootpayDOMEvent(r,e=void 0){document.dispatchEvent(new CustomEvent([this.$eventPrefix,r].join("-"),{detail:e}))},bootpayWidgetPreferenceWindow(r){return Fe.brandpayPreference(r)}};class In extends at{constructor(){super({messageEventName:"message.BootpayWidgetEvent",messageEventHooks:{WidgetWindowMessage:Pn}})}}const ds=new In;class xs{constructor(){this.data={client_key:""}}encryptKey(){return Qe(this.data.client_key).toString().substring(0,16)}encrypt(e){if(re(this.encryptKey()))throw new Error("privateKey is not set");const t=typeof e=="string"?e:JSON.stringify(e),s=Ye.encrypt(t,oe.enc.Utf8.parse(this.encryptKey()),{mode:oe.mode.ECB,padding:oe.pad.Pkcs7});return ke.stringify(s.ciphertext)}decrypt(e){if(re(this.encryptKey()))throw new Error("privateKey is not set");const s=Ye.decrypt(e,oe.enc.Utf8.parse(this.encryptKey()),{mode:oe.mode.ECB,padding:oe.pad.Pkcs7}).toString(oe.enc.Utf8);try{return JSON.parse(s)}catch{return s}}}class Rn extends xs{setWidgetData(e,t){this.el=String(e).replace(/#/gi,""),this.data=t,this.termsPassed=!1,this.data.terms=this.data.terms??[],this.widgetType=1,this.data.widget=1,this.data.use_terms=this.data.use_terms??!0,this.widgetExtra={}}setPayment(e,t,s,i=!1,n,y){this.data.pg=e,this.data.method=t,this.data.wallet_id=s,this.termsPassed=i,this.data.terms=n,this.widgetExtra=y}updateOnProcessing(e){U(e.price)&&(this.data.price=e.price),U(e.tax_free)&&(this.data.tax_free=e.tax_free),U(e.currency)&&(this.data.currency=e.currency),e.user_token!==void 0&&(this.data.user_token=e.user_token),U(e.use_terms)&&(this.data.use_terms=e.use_terms!==!1),U(e.sandbox)&&(this.data.sandbox=e.sandbox===!0),U(e.widget_key)&&(this.data.widget_key=e.widget_key),U(e.widget_type)&&(this.widgetType=e.widget_type),e.external_terms!==void 0&&(this.data.external_terms=e.external_terms),e.use_bootpay_inapp_sdk!==void 0&&(this.data.use_bootpay_inapp_sdk=e.use_bootpay_inapp_sdk),e.widget_key!==void 0&&(this.data.widget_key=e.widget_key)}encryptParameters(){return encodeURIComponent(this.encrypt({order_name:this.data.order_name,use_only_brandpay:this.data.use_only_brandpay,user_token:this.data.user_token,sandbox:this.data.sandbox,use_terms:this.data.use_terms,external_terms:this.data.external_terms,key:this.data.widget_key,use_bootpay_inapp_sdk:this.data.use_bootpay_inapp_sdk,extra:this.data.extra,log_level:H.level}))}encryptKey(){return U(this.data.application_id)?Qe(this.data.application_id).toString().substring(0,16):""}getExtra(e=void 0){return Te(e??{},Te(this.widgetExtra??{},this.data.extra??{}))}getRequestPaymentData(e=void 0){return this.data.widget_sandbox=this.data.sandbox,this.data.extra=this.getExtra(e.extra),Te(e,this.data)}}class Tn extends _e{constructor(){super(),this.$popupInstance=null,this.$popupInstanceWatcher=null,this.$windowId="bootpay-user-token-background-id",this.$userWindowId="bootpay-user-token-window-id",this.$iFrameId="bootpay-user-token-iframe-id",this.$bootpaySdkFormId="bootpay-user-token-sdk-form",this.$template=this.template(),this.$event=new Qi,this.$session=Se,this.deviceType=Z.PLATFORM.JS}setDevice(e){return this.deviceType=e,this.deviceType}template(){return`
|
|
91
|
+
<div id="${this.$windowId}" class="bootpay-payment-background">
|
|
92
|
+
<div class="bootpay-payment-window" id="${this.$userWindowId}">
|
|
93
|
+
<iframe id="${this.$iFrameId}" name="${this.$iFrameId}"></iframe>
|
|
94
|
+
<form name="${this.$bootpaySdkFormId}" id="${this.$bootpaySdkFormId}" method="GET">
|
|
95
|
+
</form>
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
98
|
+
`}setParams(e,t){if(t!==void 0){const s=this.byId(this.$bootpaySdkFormId);if(["POST","PUT"].indexOf(e.toUpperCase())>-1){const i=ve.encryptParams(ve.objectKeyToUnderscore(t));s.innerHTML=`
|
|
99
|
+
<input type="hidden" name="payload" value="${i.payload}" />
|
|
100
|
+
<input type="hidden" name="token" value="${i.token}" />
|
|
101
|
+
`}else{let i="";e.toUpperCase()==="DELETE"&&(i+='<input type="hidden" name="_method" value="patch"/>'),Object.keys(t).forEach(n=>{i+=`<input type="hidden" name="${n}" value="${t[n]}"/>`}),s.innerHTML=i}}}request(e,t){return new Promise((s,i)=>{this.createTemplateHtml(),this.bodyOpen(),this.$event.bind(s,i),this.goiFrameUrl("GET",O.toDoor(`sdk/password/${t}`),{type:e,uuid:this.$session.currentUserUUID()})})}addCard(e){return new Promise((t,s)=>{this.createTemplateHtml(),this.bodyOpen(),this.$event.bind(t,s),this.goiFrameUrl("GET",O.toDoor(`sdk/card/${e}`),{uuid:this.$session.currentUserUUID()})})}wallets(e){return new Promise((t,s)=>{this.createTemplateHtml(),this.bodyOpen(),this.$event.bind(t,s),this.goiFrameUrl("GET",O.toApi("sdk/easy/wallet"),{user_token:e,sdk:!0,uuid:this.$session.currentUserUUID()})})}destroyWallet(e){return new Promise((t,s)=>{this.createTemplateHtml(),this.bodyOpen(),this.$event.bind(t,s),this.goiFrameUrl("POST",O.toApi("sdk/easy/wallet"),{method:"DELETE",sdk:!0,user_token:e.user_token,wallet_id:e.wallet_id,token:e.token,uuid:this.$session.currentUserUUID()})})}createBiometricAuthenticate(e){return new Promise((t,s)=>{this.createTemplateHtml(),this.bodyOpen(),this.$event.bind(t,s),this.goiFrameUrl("POST",O.toApi("sdk/easy/biometric"),{user_token:e.userToken,sdk:!0,uuid:this.$session.currentUserUUID(),os:e.os,token:e.token})})}destroyBiometricAuthenticate(e){return new Promise((t,s)=>{this.createTemplateHtml(),this.bodyOpen(),this.$event.bind(t,s),this.goiFrameUrl("POST",O.toApi("sdk/easy/biometric"),{method:"DELETE",uuid:this.$session.currentUserUUID(),user_token:e.userToken,token:e.token})})}requestWalletPayment(e){return new Promise((t,s)=>{this.createTemplateHtml(),this.bodyOpen(),this.$event.bind(t,s),this.goiFrameUrl("POST",O.toApi("sdk/easy/card"),this.regenerateRequestPayment(e))})}launchBrandpayManager(e){e.popup=!0,clearInterval(this.$popupInstanceWatcher);const t=new Rn;t.setWidgetData("",e),this.$popupInstance=window.open(O.toWidget(`brandpay/${e.application_id}/${t.encryptParameters()}/edit`),"bootpay-brandpay-manager","width=600,height=800,scrollbars=yes,resizable=yes"),this.$popupInstanceWatcher=setInterval(()=>{(this.$popupInstance===null||this.$popupInstance.closed)&&clearInterval(this.$popupInstanceWatcher)},500),ds.bind()}goiFrameUrl(e,t,s=void 0){this.setParams(e,s);const i=this.byId(this.$bootpaySdkFormId);i.method=this.toMethod(e),i.action=t,i.target=this.$iFrameId,i.submit(),this.show()}toMethod(e){switch(e.toUpperCase()){case"PUT":return"POST";case"DELETE":return"POST";default:return e}}iFrameResize(e){const t=this.byId(this.$iFrameId);if(t!==void 0)for(let s in Object.keys(e)){let i=Object.keys(e)[s],n=e[i];this.$present(n)&&!String(n).match(/%/)&&(i.match(/width/)||i.match(/Width/)||i.match(/height/)||i.match(/Height/))&&(n=`${String(e[i]).replace(/px/gi,"")}px`),String(n).match(/%/)&&!this.byId(this.$userWindowId).className.match(/w-100/)&&(this.byId(this.$userWindowId).className+=" w-100"),t.style.setProperty(i,n)}}regenerateRequestPayment(e){return e.ver=Be.version,e.platform_type=this.deviceType,e.sdk=!0,e.price=parseFloat(String(e.price)),e.tax_free=parseFloat(String(e.tax_free)),Ze.invalidRequestParamsData(e),Ze.invalidRequestItemsData(e.items,e.price),e.uuid=this.$session.currentUserUUID(),e.sk=this.$session.currentSessionKey(),e.ti=this.$session.currentTimeTerm(),e.tk=`${this.$uuid()}-${new Date().getTime()*1e3}`,e}show(){const e=this.byId(this.$iFrameId);e!==void 0&&e.style.setProperty("display","block")}destroy(){this.$present(document.querySelector("body").className)&&(document.querySelector("body").className=document.querySelector("body").className.replace(/bootpay-open/gi,"")),this.$present(this.byId(this.$windowId))&&(this.byId(this.$windowId).outerHTML=""),document.body.classList.remove("bootpay-open"),ne.clearPollingEvent(),setTimeout(()=>ne.callBootpayDOMEvent("close"),300)}}const $0=new Tn,ls={$templateUserToken:$0,async requestPasswordToken(r){try{const e=await this.$templateUserToken.request("passwordToken",r);return this.$templateUserToken.destroy(),Promise.resolve(e)}catch(e){return this.$templateUserToken.destroy(),Promise.reject(this.errorHandler(e))}},async requestChangePassword(r){try{const e=await this.$templateUserToken.request("changePasswordToken",r);return this.$templateUserToken.destroy(),Promise.resolve(e)}catch(e){return this.$templateUserToken.destroy(),Promise.reject(this.errorHandler(e))}},async requestAddCard(r){try{const e=await this.$templateUserToken.addCard(r);return this.$templateUserToken.destroy(),Promise.resolve(e)}catch(e){return this.$templateUserToken.destroy(),Promise.reject(this.errorHandler(e))}},async wallets(r){try{const e=await this.$templateUserToken.wallets(r);return this.$templateUserToken.destroy(),Promise.resolve(e)}catch(e){return this.$templateUserToken.destroy(),Promise.reject(this.errorHandler(e))}},async destroyWallet(r){try{const e=await this.$templateUserToken.destroyWallet(r);return this.$templateUserToken.destroy(),Promise.resolve(e)}catch(e){return this.$templateUserToken.destroy(),Promise.reject(this.errorHandler(e))}},async createBiometricAuthenticate(r){try{const e=await this.$templateUserToken.createBiometricAuthenticate(r);return this.$templateUserToken.destroy(),Promise.resolve(e)}catch(e){return this.$templateUserToken.destroy(),Promise.reject(this.errorHandler(e))}},async destroyBiometricAuthenticate(r){try{const e=await this.$templateUserToken.destroyBiometricAuthenticate(r);return this.$templateUserToken.destroy(),Promise.resolve(e)}catch(e){return this.$templateUserToken.destroy(),Promise.reject(this.errorHandler(e))}},async requestWalletPayment(r){try{const e=await this.$templateUserToken.requestWalletPayment(r);return this.$templateUserToken.destroy(),Promise.resolve(e)}catch(e){return this.$templateUserToken.destroy(),Promise.reject(this.errorHandler(e))}},setEnvironmentMode(r,e=void 0){O.set(r),e!==void 0&&O.setDevelopmentHost(e)},setDevice(r){let e=Z.PLATFORM.JS;switch(r.toUpperCase()){case"IOS":e=Z.PLATFORM.IOS;break;case"ANDROID":e=Z.PLATFORM.ANDROID;break}return this.$templateUserToken.setDevice(e)},errorHandler(r){let e;switch(ue.hideProgress(),r.name){case"BootpayEventError":e=r.eventMessage;break;default:if(U(r.event))e=r;else throw r}return e},setLogLevel(r){H.setLogLevel(r)},setUUID(r){return Se.setUUID(r)},dismiss(){ne.reject({event:"cancel",error_code:"RC_CLOSE_WINDOW",message:"사용자가 결제창을 닫았습니다."})}};typeof window<"u"&&(window.BootpaySDK=ls);const k0={parameterPrefix:"__b_",updateParameters({parameters:r,replace:e}){const t=new URL(window.location),s=new URL(window.location.href),i=Object.fromEntries(new URLSearchParams(location.search));Object.keys(i).forEach(n=>{n.match(this.parameterPrefix)?t.searchParams.delete(n):t.searchParams.set(n,i[n])}),r&&Object.keys(r).forEach(n=>{const y=`${this.parameterPrefix}${n}`;t.searchParams.set(y,r[n])}),s.toString()!==t.toString()&&(e?window.history.replaceState({},"",t.toString()):window.history.pushState({},"",t.toString()))}};class On extends xs{constructor(){super(),this.el="",this.data={},this.path=""}setExData(e,t){this.el=(e??"").replace(/#/gi,""),this.data=t}encryptParameters(){return encodeURIComponent(this.encrypt({categories:this.data.categories,extra:this.data.extra,sdk:!0}))}encryptKey(){return U(this.data.client_key)?Qe(this.data.client_key).toString().substring(0,16):""}currentBootpayStoreParameters(){let e=[];const t=Object.fromEntries(new URLSearchParams(location.search));return Object.keys(t).forEach(s=>{s.match(k0.parameterPrefix)&&e.push(`${s.replace(k0.parameterPrefix,"")}=${t[s]}`)}),e.push("__frame=true"),e.join("&")}}const S0=new On,P0={mode:"production",locale:"ko",packageVersion:Be.version,EX_SHOP_URL:{development:"https://dev-i.bootpay.co.kr",stage:"https://stage-i.bootpay.co.kr",production:"https://i.bootpay.co.kr"},set(r){this.mode=r},setClientKey(r){return this.clientKey=r,this.clientKey},setLocale(r){this.locale=r},toExShopUrl(r){return[this.EX_SHOP_URL[this.mode],r].join("/")}};class Un extends _e{constructor(){super(),this.$iFrameId="bootpay-store-iframe",this.$iFrameContainerId="bootpay-store-iframe-container",this.$exOverlayId="bootpay-store-overlay",this.$exOverlayContainerId="bootpay-store-overlay-container",this.$exStore=S0,this.$template=`
|
|
74
102
|
<div class="bootpay-store-iframe-container" id="${this.$iFrameContainerId}">
|
|
75
103
|
<iframe id="${this.$iFrameId}" src="" allowtransparency="true" scrolling="yes" style="background: transparent; width: 100%; height: 100%;"></iframe>
|
|
76
104
|
<div class="bootpay-store-overlay" id="${this.$exOverlayId}">
|
|
77
105
|
</div>
|
|
78
106
|
</div>
|
|
79
|
-
`}render(){const e=document.getElementById(this.$exStore.el);if(this.$blank(this.$exStore.el)||e===null)throw new Error("부트페이 Ex를 설정할 Element ID를 입력하지 않았거나 해당 Element DOM이 존재하지 않습니다.");this.templateRender()}templateRender(){var s,i,n,y,
|
|
107
|
+
`}render(){const e=document.getElementById(this.$exStore.el);if(this.$blank(this.$exStore.el)||e===null)throw new Error("부트페이 Ex를 설정할 Element ID를 입력하지 않았거나 해당 Element DOM이 존재하지 않습니다.");this.templateRender()}templateRender(){var s,i,n,y,d,p,a,c,g,o;const e=document.getElementById(this.$exStore.el);e.style.setProperty("height","0px"),e.innerHTML=this.$template,this.byId(this.$iFrameId).setAttribute("src",this.shopUrl()),(n=(i=(s=this.$exStore.data)==null?void 0:s.extra)==null?void 0:i.window)!=null&&n.fullscreen?(e.classList.add("__bootpay-store-el-fullscreen"),e.style.removeProperty("height"),(y=document.getElementById(this.$exStore.el))==null||y.style.setProperty("height","100%")):((a=(p=(d=this.$exStore.data)==null?void 0:d.extra)==null?void 0:p.window)!=null&&a.width||(o=(g=(c=this.$exStore.data)==null?void 0:c.extra)==null?void 0:g.window)!=null&&o.height)&&this.resize({width:this.$exStore.data.extra.window.width,height:this.$exStore.data.extra.window.height})}resize(e){this.templateResize(this.$exStore.el,e)}postMessage(e,t){var i;const s=this.byId(this.$iFrameId);(i=s==null?void 0:s.contentWindow)==null||i.postMessage(JSON.stringify({bootpay_event:!0,event:e,data:t}),"*")}showAlert(e,t="알림",s={type:"notice",confirmText:"확인",cancelText:"취소"}){const i=document.getElementById(this.$exOverlayId);i.innerHTML=`
|
|
80
108
|
<div class="bootpay-store-alert-container" id="${this.$exOverlayContainerId}">
|
|
81
109
|
<div class="bootpay-store-alert-header">
|
|
82
110
|
<span>${t}</span>
|
|
@@ -106,32 +134,4 @@
|
|
|
106
134
|
</div>
|
|
107
135
|
</div>
|
|
108
136
|
</div>
|
|
109
|
-
`}shopUrl(){const e=Object.fromEntries(new URLSearchParams(location.search));return
|
|
110
|
-
<div id="${this.$windowId}" class="bootpay-payment-background">
|
|
111
|
-
<div class="bootpay-payment-window ${O.isMobile()?"__mobile":""}" id="${this.$brandpayWindowId}">
|
|
112
|
-
<iframe class="${this.$additionalClass}" id="${this.$iFrameId}" name="${this.$iFrameId}"></iframe>
|
|
113
|
-
</div>
|
|
114
|
-
</div>
|
|
115
|
-
`}createIFrame(e){this.createTemplateHtml();const t=document.getElementById(this.$iFrameId);t==null||t.setAttribute("src",O.toWidget(`${e}`)),t==null||t.style.setProperty("display","block"),this.bodyOpen("bootpay-mobile")}addWallet(e){this.createIFrame(e)}removeWallet(e){this.createIFrame(`brandpay/destroy/${this.$widgetStore.data.application_id}/${e}`)}showCardInterestInformation(e){this.createIFrame(`card/interest/${this.$widgetStore.data.application_id}`)}brandpayPreference(e){const{popup:t}=e,s=`brandpay/${this.$widgetStore.data.application_id}/${this.$widgetStore.encryptParameters()}/edit`;t||O.isMobile()?window.open(O.toWidget(`${s}?__popup=true`),"widget-brandpay-environment-popup","width=500,height=800,scrollbars=yes").focus():this.createIFrame(s)}destroy(){const e=document.getElementById(this.$windowId);e!==void 0&&(e.outerHTML="",e.remove())}resize(e){U.debug("resize",e),this.templateResize(this.$iFrameId,e)}postMessage(e,t=void 0){var i;const s=this.byId(this.$iFrameId);(i=s==null?void 0:s.contentWindow)==null||i.postMessage(JSON.stringify({bootpay_event:!0,event:e,data:t}),"*")}}const Fe=new Tn;class Rn extends _e{constructor(){super(),this.$windowId="__bootpay-modal-window-container",this.$modalWindowId="__bootpay-modal-window",this.$iFrameId="__bootpay-modal-iframe",this.$additionalClass=O.isMobile()?"":"rounded-iframe",this.$template=this.template()}template(){return`
|
|
116
|
-
<div id="${this.$windowId}" class="bootpay-payment-background">
|
|
117
|
-
<div class="bootpay-payment-window ${O.isMobile()?"__mobile":""}" id="${this.$modalWindowId}">
|
|
118
|
-
<iframe class="${this.$additionalClass}" id="${this.$iFrameId}" name="${this.$iFrameId}"></iframe>
|
|
119
|
-
</div>
|
|
120
|
-
</div>
|
|
121
|
-
`}createIFrame(e){this.createTemplateHtml();const t=document.getElementById(this.$iFrameId);t==null||t.setAttribute("src",e),t==null||t.classList.add("slide-up"),t==null||t.style.setProperty("display","block"),this.bodyOpen()}destroy(){const e=document.getElementById(this.$iFrameId);e==null||e.classList.remove("slide-up"),e==null||e.classList.add("slide-down"),setTimeout(()=>{const t=document.getElementById(this.$windowId);t!==void 0&&(t.outerHTML="",t.remove())},300)}resize(e){U.debug("resize",e),this.templateResize(this.$iFrameId,e)}postMessage(e,t=void 0){var i;const s=this.byId(this.$iFrameId);(i=s==null?void 0:s.contentWindow)==null||i.postMessage(JSON.stringify({bootpay_event:!0,event:e,data:t}),"*")}}const ft=new Rn;class On extends _e{constructor(){super(),this.$windowId="__bootpay-confirm-modal-window-container",this.$modalWindowId="__bootpay-confirm-modal-window",this.$additionalClass="rounded-iframe",this.$title="알림",this.$confirmButtonText="확인",this.$cancelButtonText="취소",this.$hookConfirmButtonId="__bootpay-confirm-modal-hook-button",this.$hookCancelButtonId="__bootpay-cancel-modal-hook-button",this.$hookCloseButtonId="__bootpay-close-modal-hook-button",this.$template=this.template(),this.$message=""}template(){return`
|
|
122
|
-
<div id="${this.$windowId}" class="bootpay-payment-background __alert">
|
|
123
|
-
<div class="bootpay-confirm-window fade-in" id="${this.$modalWindowId}">
|
|
124
|
-
<div class="bootpay__alert-header">
|
|
125
|
-
${this.$title}
|
|
126
|
-
<button class="bootpay-close-btn" id="${this.$hookCloseButtonId}"></button>
|
|
127
|
-
</div>
|
|
128
|
-
<div class="bootpay__alert-body">
|
|
129
|
-
${this.$message}
|
|
130
|
-
</div>
|
|
131
|
-
<div class="bootpay__alert-footer">
|
|
132
|
-
<button class="bootpay__alert-close border-right" id="${this.$hookCancelButtonId}">${this.$cancelButtonText}</button>
|
|
133
|
-
<button class="bootpay__alert-close bootpay-primary" id="${this.$hookConfirmButtonId}">${this.$confirmButtonText}</button>
|
|
134
|
-
</div>
|
|
135
|
-
</div>
|
|
136
|
-
</div>
|
|
137
|
-
`}show(e,t="알림",s="확인",i="취소",n,y,x=!0){this.$title=t,this.$message=e,this.$confirmButtonText=s,this.$cancelButtonText=i,this.$template=this.template(),this.createTemplateHtml(),document.getElementById(this.$hookConfirmButtonId).addEventListener("click",()=>{this.destroy(),n!==void 0&&n()}),document.getElementById(this.$hookCancelButtonId).addEventListener("click",()=>{this.destroy(),y!==void 0&&y()}),document.getElementById(this.$hookCloseButtonId).addEventListener("click",()=>{this.destroy(),y!==void 0&&y()}),x?(document.getElementById(this.$hookCancelButtonId).removeAttribute("style"),document.getElementById(this.$hookConfirmButtonId).removeAttribute("style")):(document.getElementById(this.$hookCancelButtonId).style.display="none",document.getElementById(this.$hookConfirmButtonId).style.flex="0 1 100%"),this.bodyOpen()}destroy(){const e=document.getElementById(this.$modalWindowId);e.classList.remove("fade-in"),e.classList.add("fade-out"),setTimeout(()=>{const t=document.getElementById(this.$windowId);t!==void 0&&(t.outerHTML="",t.remove()),this.bodyClose()},100)}}const S0=new On,Un={$eventPrefix:"bootpay",bootpayWidgetSelectMethod(r){return this.triggerGlobalChangeEvent(r),se.selectPayment(r.pg,r.method,r.wallet_id,r.term_passed===!0,r.select_terms,r.extra)},bootpayWidgetResponseGetEnvironmentWidget(r){return Fe.postMessage("bootpayResponseGetEnvironmentWidget",{use_only_brandpay:G.$widgetStore.data.use_only_brandpay,user_token:G.$widgetStore.data.user_token,sandbox:G.$widgetStore.data.sandbox,use_terms:G.$widgetStore.data.use_terms,platform:r.platform})},bootpayWidgetResponseCurrentStores(r){return Fe.postMessage("bootpayResponseCurrentStores",r)},bootpayWidgetError(r,e){return e.reject(r)},bootpayWidgetBrandpayReload(r){return G.postMessage("bootpayWidgetBrandpayReload",r)},bootpayWidgetResize(r){return this.callBootpayDOMEvent("widget-resize",r),M.callHook("resize",r),G.resize(r)},bootpayWidgetShowInterestInformation(r){return Fe.showCardInterestInformation(r)},bootpayWidgetAddWallet(r){return Fe.addWallet(r.url)},bootpayWidgetRemoveWallet(r){return Fe.removeWallet(r.wallet_id)},bootpayWidgetPaymentWindowResize(r){return Fe.resize(r)},bootpayWidgetBrandpayWindowClose(){return Fe.destroy()},bootpayWidgetModalOpen(r){return ft.createIFrame(r.url)},bootpayWidgetModalClose(){return ft.destroy()},bootpayRequestModalCurrentStores(r){return G.postMessage("bootpayWidgetRequestModalCurrentStores",r)},bootpayRequestGetEnvironmentModalWidget(r){return G.postMessage("bootpayWidgetGetEnvironmentModalWidget",r)},bootpayWidgetResponseGetEnvironmentModalWidget(r){return ft.postMessage("bootpayResponseGetEnvironmentModalWidget",{application_id:G.$widgetStore.data.application_id,use_only_brandpay:G.$widgetStore.data.use_only_brandpay,user_token:G.$widgetStore.data.user_token,sandbox:G.$widgetStore.data.sandbox,use_terms:G.$widgetStore.data.use_terms,external_terms:G.$widgetStore.data.external_terms,key:G.$widgetStore.data.widget_key,platform:r.platform,log_level:U.level})},bootpayWidgetModalResize(r){return ft.resize(r)},bootpayWidgetPaymentGetStoreData(){const{application_id:r,price:e,tax_free:t,user_token:s}=G.$widgetStore.data;return G.postMessage("bootpayWidgetResponseStoreData",{applicationId:r,price:e,widgetExtra:G.$widgetStore.widgetExtra,taxFree:t,userToken:s})},bootpayWidgetTermAllAgree(r){this.callBootpayDOMEvent("all-agree-terms",r),M.callHook("allTermsAccepted",r)},bootpayWidgetSelectPayment(r){const{method_alias:e,payment_type:t,wallet_id:s}=r;return G.postMessage("bootpayWidgetSelectPayment",{method_alias:e,payment_type:t,wallet_id:s})},bootpayWidgetReady(r){this.callBootpayDOMEvent("widget-ready",r),M.callHook("ready",r)},bootpayWidgetUpdateStore(r){M.updateOnProcessing({...r})},bootpayWidgetToUrl(r){location.href=r.url},bootpayWidgetShowModal(r){return S0.show(r.message,r.title,r.confirmButtonText,r.cancelButtonText,()=>{window.BootpayWidget.alertConfirm()},()=>{window.BootpayWidget.alertCancel()})},brandpayWalletUpdated(r){M.callHook("brandpayWalletUpdated",r)},triggerGlobalChangeEvent(r){var e;r.completed=L(r.pg)&&L(r.method)&&(r.term_passed===!0||!M.data.use_terms)&&(["BRANDPAY_CARD","BRANDPAY_AUTOMATIC_TRANSFER"].indexOf(r.method)===-1||r.wallet_id!==void 0),(M.data.pg!==r.pg||M.data.method!==r.method||M.data.wallet_id!==r.wallet_id||JSON.stringify(M.widgetExtra)!==JSON.stringify(r.extra))&&(this.callBootpayDOMEvent("widget-change-payment",r),M.callHook("paymentMethodUpdated",r)),JSON.stringify((e=r.select_terms)==null?void 0:e.filter(t=>t.agree===!0))!==JSON.stringify(M.data.terms.filter(t=>t.agree===!0))&&(this.callBootpayDOMEvent("widget-change-terms",r),M.callHook("termsConsentUpdated",r))},callBootpayDOMEvent(r,e=void 0){document.dispatchEvent(new CustomEvent([this.$eventPrefix,r].join("-"),{detail:e}))},bootpayWidgetPreferenceWindow(r){return Fe.brandpayPreference(r)}};class Hn extends nt{constructor(){super({messageEventName:"message.BootpayWidgetEvent",messageEventHooks:{WidgetWindowMessage:Un}})}}const Nn=new Hn;class Ln extends Oe{constructor(){super(),this.message=Zt}initialize(){M.setWidgetData(void 0,{application_id:void 0,order_name:"",order_id:void 0,price:0,tax_free:0,currency:"KRW",user_token:void 0,pg:void 0,method:void 0,widget_key:void 0})}render(e,t){if(this.$blank(t==null?void 0:t.price)||t.price<0)throw new Error("결제금액은 1원 이상을 입력해주세요.");if(this.$blank(t==null?void 0:t.application_id))throw new Error("application_id가 입력되지 않았습니다.");this.initialize(),M.setWidgetData(e,t),G.render(),Nn.bind()}update(e){const{price:t,tax_free:s,currency:i,user_token:n,use_only_brandpay:y,use_terms:x,sandbox:p,widget_key:a,external_terms:c}=e;M.updateOnProcessing({price:t,tax_free:s,currency:i,user_token:n,use_only_brandpay:y,use_terms:x,external_terms:c,sandbox:p,widget_key:a}),(this.$present(n)||this.$present(y)||this.$present(x)||this.$present(p))&&G.postMessage("bootpayWidgetUpdateUserToken",{user_token:n,use_only_brandpay:y,use_terms:x,external_terms:c,sandbox:p,key:a})}rerender(){G.rerender()}destroy(){G.destroy()}selectPayment(e,t,s,i=!1,n,y){M.setPayment(e,t,s,i,n,y),U.debug("selectPayment",`pg: ${e}, method: ${t}, wallet_id: ${s}, terms: ${i}, select_terms: ${JSON.stringify(n)}, extra: ${JSON.stringify(y)}`)}currentTermsCondition(){return M.data.terms}async requestPayment(e){return this.widgetRequestPaymentValidate(1),ge.requestPayment(M.getRequestPaymentData(e))}async requestSubscription(e){return this.widgetRequestPaymentValidate(2),ge.requestSubscription(M.getRequestPaymentData(e))}isRendered(){return G.isRendered()}synchronizedRealTimeTransfer(e){G.postMessage("bootpayWidgetSynchronizedRealTimeTransfer",e)}sendSelectPayment(e){G.postMessage("bootpayWidgetSelectPayment",e)}sendMessage(e,t){G.postMessage(e,t)}currentPaymentParameters(){return{pg:M.data.pg,method:M.data.method,wallet_id:M.data.wallet_id,terms:M.data.terms,widget_key:M.data.widget_key,widget_sandbox:M.data.sandbox,extra:M.getExtra({})}}widgetRequestPaymentValidate(e=void 0){if(e!==void 0&&M.widgetType!==e)throw new le({event:"error",error_code:"RC_WIDGET_TYPE_INVALID",message:e===1?this.message.getLocaleMessage("widgetTypeNotPayment","ko"):this.message.getLocaleMessage("widgetTypeNotSubscription","ko")});if(this.$blank(M.data.pg)||this.$blank(M.data.method))throw new le({event:"error",error_code:"RC_PG_METHOD_NOT_SELECTED",message:this.message.getLocaleMessage("notSelectPayment","ko")});if(!M.termsPassed&&M.data.use_terms)throw new le({event:"error",error_code:"RC_TERMS_NOT_AGREE",message:this.message.getLocaleMessage("termsNotAgree","ko")});if(["BRANDPAY_CARD","BRANDPAY_AUTOMATIC_TRANSFER"].indexOf(M.data.method)>-1&&M.data.wallet_id===void 0)throw new le({event:"error",error_code:"RC_BRANDPAY_NEED_SELECT_WALLET",message:this.message.getLocaleMessage("notSelectBrandpay","ko")})}}const se=new Ln,us={render(r,e){se.render(r,e)},rerender(){se.rerender()},setEnvironmentMode(r,e){ge.setEnvironmentMode(r,e),O.set(r)},async requestPayment(r){return new Promise(async(e,t)=>{try{const s=await se.requestPayment(r);return e(s)}catch(s){return t(this.errorHandler(s))}})},async requestSubscription(r){return new Promise(async(e,t)=>{try{const s=await se.requestSubscription(r);return e(s)}catch(s){return t(this.errorHandler(s))}})},errorHandler(r){let e;switch(ue.hideProgress(),r.name){case"BootpayEventError":e=r.eventMessage;break;default:if(L(r.event))e=r;else throw r}return e},update(r,e=!0){se.update(r),e&&this.rerender()},currentTermsCondition(){return se.currentTermsCondition()},destroy(){se.destroy()},isRendered(){return se.isRendered()},synchronizedRealTimeTransfer(r){se.synchronizedRealTimeTransfer(r)},selectPayment(r){se.sendSelectPayment(r)},setLogLevel(r){U.setLogLevel(r)},sendMessage(r,e=void 0){se.sendMessage(r,e)},setDevice(r){return ge.setDevice(r)},alertConfirm(){S0.destroy(),se.sendMessage("BootpayWidgetAlertConfirm",{confirm:!0})},alertCancel(){S0.destroy(),se.sendMessage("BootpayWidgetAlertConfirm",{confirm:!1})},currentPaymentParameters(){return se.currentPaymentParameters()},isWidgetTypeSubscription(){return M.widgetType===2},isWidgetTypePayment(){return M.widgetType===1}};typeof window<"u"&&(window.BootpayWidget=us),fe.Bootpay=ge,fe.BootpayEnvironment=O,fe.BootpaySDK=Ir,fe.BootpayStore=ls,fe.BootpayWidget=us,fe.default=ge,Object.defineProperties(fe,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
137
|
+
`}shopUrl(){const e=Object.fromEntries(new URLSearchParams(location.search));return U(e.__b_u)?P0.toExShopUrl(e.__b_u):P0.toExShopUrl(`em/${this.$exStore.data.client_key}/${this.$exStore.encryptParameters()}?${this.$exStore.currentBootpayStoreParameters()}`)}}const Ee=new Un,us={hooks:{},setHooks(r){this.hooks=r},callHook(r,e){this.hooks[r]&&this.hooks[r](e)}},Hn={resize:r=>{Ee.resize(r)},showAlert({message:r,title:e,options:t}){Ee.showAlert(r,e,t)},hideAlert(){Ee.hideAlert()},showOverlayiFrame({url:r,options:e}){Ee.showOverlayiFrameToUrl(r,e)},hideOverlayiFrame(){Ee.hideOverlayiFrame()},responseOverlayiFrame({event:r,data:e}){Ee.postMessage(r,e),this.hideOverlayiFrame()},addFavicon({url:r}){const e=document.querySelector("link[rel~='icon']");if(e)e.href=r;else{const t=document.createElement("link");t.rel="icon",t.href=r,document.head.appendChild(t)}},hookOnReady(r=null){us.callHook("onReady",r)}};class Nn extends at{constructor(){super({messageEventName:"message.BootpayStoreEvent",messageEventHooks:{StoreWindowEvent:Hn,StoreWindowRouter:k0},afterBind:()=>{window.resetBootpayEventListener("popstate.BootpayStoreEvent",e=>{const t=Object.fromEntries(new URLSearchParams(location.search));U(t.__b_u)&&Ee.postMessage("BootpayRouterChange",{url:`/${t.__b_u}`})})}})}}const Ln=new Nn;class Mn extends Ue{constructor(){super()}initialize(){S0.setExData(void 0,{client_key:void 0,categories:[],extra:{}})}render(e,t){if(this.$blank(t.client_key))throw new Error("client_key가 입력되지 않았습니다.");this.initialize(),S0.setExData(e,t),us.setHooks(t.hooks),Ln.bind(),Ee.render()}hideAlert(e="confirm"){Ee.hideAlert(e)}sendEvent(e,t){Ee.postMessage(e,t)}}const I0=new Mn,ps={render(r,e){I0.render(r,e)},setEnvironmentMode(r){P0.set(r)},hideAlert(r="confirm"){I0.hideAlert(r)},sendEvent(r,e){I0.sendEvent(r,e)}};typeof window<"u"&&(window.BootpayStore=ps);const hs={render(r,e){se.render(r,e)},rerender(){se.rerender()},setEnvironmentMode(r,e){ge.setEnvironmentMode(r,e),O.set(r)},async requestPayment(r){return new Promise(async(e,t)=>{try{const s=await se.requestPayment(r);return e(s)}catch(s){return t(this.errorHandler(s))}})},async requestSubscription(r){return new Promise(async(e,t)=>{try{const s=await se.requestSubscription(r);return e(s)}catch(s){return t(this.errorHandler(s))}})},launchBrandpayManager(r){$0.launchBrandpayManager(r)},errorHandler(r){let e;switch(ue.hideProgress(),r.name){case"BootpayEventError":e=r.eventMessage;break;default:if(U(r.event))e=r;else throw r}return e},update(r,e=!0){se.update(r),e&&this.rerender()},currentTermsCondition(){return se.currentTermsCondition()},destroy(){se.destroy()},isRendered(){return se.isRendered()},synchronizedRealTimeTransfer(r){se.synchronizedRealTimeTransfer(r)},selectPayment(r){se.sendSelectPayment(r)},setLogLevel(r){H.setLogLevel(r)},sendMessage(r,e=void 0){se.sendMessage(r,e)},setDevice(r){return ge.setDevice(r)},alertConfirm(){D0.destroy(),se.sendMessage("BootpayWidgetAlertConfirm",{confirm:!0})},alertCancel(){D0.destroy(),se.sendMessage("BootpayWidgetAlertConfirm",{confirm:!1})},currentPaymentParameters(){return se.currentPaymentParameters()},isWidgetTypeSubscription(){return M.widgetType===2},isWidgetTypePayment(){return M.widgetType===1}};typeof window<"u"&&(window.BootpayWidget=hs),he.Bootpay=ge,he.BootpayEnvironment=O,he.BootpaySDK=ls,he.BootpayStore=ps,he.BootpayWidget=hs,he.default=ge,Object.defineProperties(he,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|