flowallet-testnet/FLO_webWallet_minified.html
Vivek Teega e61be9f594 Fixed: floData with 16 char didnot sent on testnet
Adjusted max floData size to 1040
2020-09-11 18:13:49 +05:30

19 lines
132 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<title>FLO web wallet</title>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta charset="UTF-8">
<meta name="description" content="This webapp allows monitoring FLO addresses and performing transactions based on blockchain.">
<style>
@font-face{font-family:Roboto;font-style:normal;src:url(../fonts/roboto-v20-latin-regular.eot);src:local("Roboto"),local("Roboto-Regular"),url(../fonts/roboto-v20-latin-regular.eot?#iefix) format("embedded-opentype"),url(../fonts/roboto-v20-latin-regular.woff2) format("woff2"),url(../fonts/roboto-v20-latin-regular.woff) format("woff"),url(../fonts/roboto-v20-latin-regular.ttf) format("truetype"),url(../fonts/roboto-v20-latin-regular.svg#Roboto) format("svg")}:root{--sidenav-color:#f0f0f0;--accent-color:#D40E1E;--back-color:#ebebeb;--body-color:#fff;--sec-color:#ccc;--bw:#000;--opac-accent-color:rgba(210, 13, 29, 0.1)}*{-webkit-box-sizing:border-box;box-sizing:border-box}::-moz-selection{color:#fff;background:var(--accent-color)}::selection{color:#fff;background:var(--accent-color)}svg{overflow:visible}body{font-family:Roboto,sans-serif;background-color:var(--body-color);font-size:16px;color:var(--bw);margin:0;height:100vh}button,textarea{-ms-flex-item-align:start;align-self:flex-start;display:flexbox;width:100%;padding:1em;background:0 0;border-radius:.25em;border:1px solid var(--sec-color);margin:1em 0;font-family:Roboto,sans-serif}button{width:100%;font-weight:700;color:var(--accent-color);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;-webkit-transition:color .2s ease,background-color .2s ease,border .2s ease;transition:color .2s ease,background-color .2s ease,border .2s ease;font-size:.8em}button:hover{background-color:var(--opac-accent-color);border:1px transparent solid}.primaryButton{background:var(--accent-color)!important;color:#fff!important;border:1px solid var(--accent-color)}.primaryButton:hover{opacity:.8}button:disabled,button[disabled]{color:var(--sec-color)!important;pointer-events:none;background:0 0!important;border:none}button:focus,input:focus,textarea:focus{outline:0}::-moz-focus-inner{border:none}.icons:active,button:active,monitor:active,svg:active{-webkit-tap-highlight-color:transparent}.input,.text-area{width:100%;margin:1em 0;-ms-flex-item-align:start;align-self:flex-start;display:-webkit-box;display:-ms-flexbox;display:flex;position:relative}.input label,.text-area label{position:absolute;pointer-events:none;opacity:.6;padding:0 .4em;margin:1.05em 1em 1em .8em;-webkit-transition:color .2s ease,padding .2s ease,opacity .2s ease,-webkit-transform .2s ease;transition:color .2s ease,padding .2s ease,opacity .2s ease,-webkit-transform .2s ease;transition:transform .2s ease,color .2s ease,padding .2s ease,opacity .2s ease;transition:transform .2s ease,color .2s ease,padding .2s ease,opacity .2s ease,-webkit-transform .2s ease;background:var(--body-color);z-index:1;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transform-origin:left;transform-origin:left;will-change:transform}.input .label-active,.text-area .label-active{-webkit-transform:translateY(-1.7em) scale(.8);transform:translateY(-1.7em) scale(.8);opacity:1!important}.input input:focus{border:var(--accent-color) 1px solid}.input input:focus~label{color:var(--accent-color)}.text-area textarea:focus{border:var(--accent-color) 1px solid}.text-area textarea:focus~label{color:var(--accent-color)}input,textarea{color:inherit;width:100%;font-size:1em;display:flexbox;background-color:transparent;padding:1em;border-radius:.25em;margin:0;border:1px solid var(--sec-color);font-family:Roboto,sans-serif;-webkit-transition:border .2s ease;transition:border .2s ease}#overlay{opacity:0;pointer-events:none;position:fixed;z-index:6;background:rgba(0,0,0,.2);height:100vh;width:100vw;-webkit-transition:opacity .2s ease;transition:opacity .2s ease}#overlay #popup{display:-webkit-box;display:-ms-flexbox;display:flex;bottom:0;position:absolute;width:100vw;padding:1em;-ms-flex-wrap:wrap;flex-wrap:wrap;background:var(--body-color);-webkit-transition:-webkit-transform .2s ease;transition:-webkit-transform .2s ease;transition:transform .2s ease;transition:transform .2s ease,-webkit-transform .2s ease;-webkit-transform:translateY(1em);transform:translateY(1em)}#overlay #popup .input{width:100%!important;margin:1em 0!important}#overlay #popup button{border:none;width:auto;margin:.5em 0!important}#overlay #popup button:first-of-type{margin-left:auto!important}#overlay #popup button:last-of-type{margin-left:.5em!important;width:4em!important}#overlay #popup h4,#overlay #popup h5{margin:1em 0;opacity:.8;width:100%}#textCopied{font-weight:400;padding:1em;border-radius:2em;background:var(--sec-color);position:absolute;bottom:0;pointer-events:none;margin:2em 0;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%);-webkit-transition:.2s opacity ease;transition:.2s opacity ease;opacity:0;z-index:10}#main-card #header{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;font-weight:400;display:-webkit-box;display:-ms-flexbox;display:flex;position:absolute;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:48px;z-index:3;top:0;right:0;left:0}#main-card #header span{margin-right:1em;font-weight:700}#main-card #header svg{fill:var(--accent-color);height:2em;width:2em}#main-card #header svg:first-of-type{margin:1em .4em 1em 1em}#main-card #header svg:last-of-type{margin:1em .5em 1em auto}#main-card .right{display:-ms-grid;display:grid;left:0;position:absolute;top:48px;right:0;bottom:54px}#loadBalance,#spinner{position:absolute;top:0;right:0;width:2em;height:2em;padding:.3em;margin:1.9em 1em}#loadBalance .p1,#spinner .p1{fill:none}#loadBalance .p2,#spinner .p2{fill:var(--accent-color)}#spinner{margin:.7em 0}#sendData #sdleft{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-line-pack:start;align-content:flex-start;width:100%;margin:.5em 0;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-transition:width .2s ease;transition:width .2s ease}#sendData #sdleft .input{-webkit-transition:border .2s ease;transition:border .2s ease;border:1px solid var(--sec-color);margin:1em 0!important;border-radius:.25em;width:100%!important}#sendData #sdleft .input input{height:auto;border:none;padding:1em 0 1em 1em;-webkit-box-flex:1;-ms-flex:1;flex:1;min-width:0}#sendData #sdleft .input button{margin:.5em .5em .5em 0!important;height:auto;border:none;width:9em}#sendData #sdleft .input:focus-within{border:1px solid var(--accent-color)}#sendData #sdright{opacity:.6;-ms-flex-wrap:wrap;flex-wrap:wrap;display:-webkit-box;display:-ms-flexbox;display:flex;width:100%;pointer-events:none}#sendData #sdright .input,#sendData #sdright .text-area{margin:.5em 0}#sendData #dispBal{position:relative;width:100%;border:1px solid var(--sec-color);padding:1em 2em;-ms-flex-item-align:start;align-self:flex-start;overflow-wrap:break-word;border-radius:.25em;margin:auto}#sendData #dispBal #dispBalInt{font-size:3em;-ms-flex-item-align:center;-ms-grid-row-align:center;align-self:center}#sendData #dispBal #dispBalFloat{font-size:1em;-ms-flex-item-align:center;-ms-grid-row-align:center;align-self:center}#sendData #dispBal h5:last-of-type{opacity:.8;font-weight:400}#bottom-nav{overflow:hidden;position:fixed;height:54px;-ms-flex-line-pack:center;align-content:center;text-align:center;left:0;right:0;display:-webkit-box;display:-ms-flexbox;display:flex;bottom:0;z-index:4;background:var(--body-color);border-top:1px solid var(--sec-color)}#bottom-nav #indicator{display:none}#bottom-nav .icons{opacity:.8;position:relative;width:100%;z-index:2;-ms-flex-item-align:center;-ms-grid-row-align:center;align-self:center;-ms-grid-column-align:center;justify-self:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;padding:.4em;cursor:pointer}#bottom-nav .icons svg{fill:var(--bw);height:1.1em;margin:0 0 4px 0;stroke:none}#bottom-nav .icons h6{margin:0;font-weight:400}#bottom-nav .icons span{display:none}.activeButton{opacity:1!important;color:var(--accent-color)!important}.activeButton svg{fill:var(--accent-color)!important}.reveal{width:16em!important}.reveal span{opacity:1!important}#overlay2{position:absolute;opacity:0;pointer-events:none;top:0;bottom:0;left:0;right:0;background:rgba(0,0,0,.2);z-index:3;-webkit-transition:opacity .2s ease;transition:opacity .2s ease}.show{opacity:1!important;pointer-events:all!important}.hide{opacity:0;pointer-events:none}#menu{display:none}#addrGen card{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin:1em 0;border:solid 1px var(--sec-color);border-radius:.25em}#addrGen card h5{margin:.5em 0 1em 0;font-weight:400}#addrGen card h4{font-weight:400}#addrGen card div{position:relative;display:flexbox;padding:1em;word-break:break-all;width:100%}#addrGen card div:nth-of-type(1){border-bottom:1px solid var(--sec-color)}#addrGen card svg{cursor:pointer;position:absolute;right:0;top:0;padding:.6em;height:2.5em;width:2.5em;margin:.8em;fill:var(--bw);opacity:.5;border-radius:2em;-webkit-transition:.2s ease background;transition:.2s ease background}#addrGen card svg:hover{background:var(--sec-color);opacity:1}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;appearance:none;margin:0}input[type=number]{-moz-appearance:textfield}.innerPage{position:fixed;overflow-y:auto;display:-ms-grid;display:grid;top:0;bottom:0;left:0;right:0;-ms-flex-line-pack:start;align-content:flex-start;z-index:2;background:var(--body-color)}.title-bar{top:0;position:absolute;display:-webkit-box;display:-ms-flexbox;display:flex;width:100%;height:auto;-ms-flex-line-pack:center;align-content:center;background:var(--body-color);border-bottom:1px solid var(--sec-color)}.title-bar svg{display:flexbox;height:3em;width:3em;padding:.9em;fill:var(--bw)!important;cursor:pointer;-ms-flex-item-align:center;align-self:center}.title-bar span{padding:.5em;-ms-flex-item-align:center;-ms-grid-row-align:center;align-self:center;-webkit-box-flex:1;-ms-flex:1;flex:1;width:calc(100% - 8em);font-weight:700;line-height:1.5em}.title-bar h5{margin:0;font-weight:400}.title-bar h3{margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#dispMsg trans-container{position:absolute;overflow-y:auto;width:100%;bottom:0;top:65px;padding:.25em 0 5em 0;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-line-pack:start;align-content:flex-start;background:var(--back-color);scroll-behavior:smooth}#dispMsg trans-container transaction-card{display:-webkit-box;display:-ms-flexbox;display:flex;position:relative;width:calc(100% - 1em);-ms-flex-wrap:wrap;flex-wrap:wrap;margin:.25em .5em;border-radius:.25em;background:var(--body-color)}#dispMsg trans-container transaction-card svg{display:flexbox;-ms-flex-item-align:center;align-self:center;margin-right:.5em;height:1em;width:1em;fill:var(--accent-color)}#dispMsg trans-container transaction-card div{display:flexbox;width:100%;line-height:1.4em;padding:1em;overflow-wrap:break-word;word-wrap:break-word}#dispMsg trans-container transaction-card div:nth-of-type(1){display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-line-pack:center;align-content:center;opacity:.8;font-size:.9em;padding-bottom:.5em}#dispMsg trans-container transaction-card div:nth-of-type(2){padding-top:.5em}#dispMsg trans-container transaction-card div:nth-of-type(3){text-align:right;font-size:.8em;opacity:.8}loading{position:absolute;display:-ms-grid;display:grid;height:calc(100% - 1.6em);width:calc(100% - 1.1em);place-items:center;z-index:10}loading svg{position:relative;height:2.5em;width:2.5em}loading .p1{fill:none}loading .p2{fill:var(--accent-color)}#addNewAddress,#scrollToTop{position:fixed;cursor:pointer;width:3.5em;height:3.5em;right:0;margin:1em;padding:1.2em;border-radius:50%;-webkit-box-shadow:.1em .2em .3em rgba(0,0,0,.4);box-shadow:.1em .2em .3em rgba(0,0,0,.4);-webkit-transition:right .2s ease,bottom .2s ease,opacity .2s ease;transition:right .2s ease,bottom .2s ease,opacity .2s ease;z-index:2;background:var(--accent-color);fill:#fff}#addNewAddress{bottom:54px}#scrollToTop{opacity:0;pointer-events:none}#add-container,#edit-container{position:fixed;top:0;left:0;right:0;bottom:0;z-index:4;background:rgba(0,0,0,.2);-webkit-transition:opacity .2s ease;transition:opacity .2s ease}#add,#edit{position:absolute;bottom:0;width:100vw;height:auto;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-transform:translateY(1em);transform:translateY(1em);padding:1em;background:var(--body-color);-webkit-transition:-webkit-transform .2s ease;transition:-webkit-transform .2s ease;transition:transform .2s ease;transition:transform .2s ease,-webkit-transform .2s ease}#add button,#edit button{border:none;width:auto;margin:.5em 0!important}#add button:last-of-type,#edit button:last-of-type{margin-left:1em!important}#add h4,#edit h4{margin:1em 0;opacity:.8}#add .input,#edit .input{margin:1em 0!important;width:100%!important}#edit-container #edit #loadingSvg{top:0;-ms-flex-item-align:center;-ms-grid-row-align:center;align-self:center;opacity:.6;fill:var(--bw);position:absolute;right:0;height:2em;width:2em;padding:.5em;margin:1.7em 1em 1em 1.5em;-webkit-transition:opacity .2s ease;transition:opacity .2s ease;z-index:2;border-radius:2em;cursor:pointer}#edit-container #edit #loadingSvg:hover{background:var(--sec-color)}#edit-container #edit div:first-of-type{position:relative;width:100%;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-line-pack:center;align-content:center;margin-bottom:1em}#edit-container #edit div:first-of-type button{display:flexbox;white-space:nowrap;margin-left:0!important;-ms-flex-item-align:center;align-self:center}#edit-container #edit div:first-of-type h4{padding:0;-ms-flex-item-align:center;align-self:center;display:flexbox;text-align:right}#edit-container #edit h4{padding-right:2em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#edit-container #edit button:nth-of-type(2){margin-left:auto!important}#edit-container #edit h3,#edit-container #edit h4,#edit-container #edit h5{display:flexbox;width:100%}#add-container #add button:first-of-type{margin-left:auto!important}#monitor-list{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;width:100%;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-line-pack:start;align-content:flex-start;padding-bottom:5em}#monitor-list monitor{height:auto;border-radius:.25em;border:1px solid var(--sec-color);margin:.5em 0;-ms-flex-item-align:start;align-self:flex-start;width:100%;position:relative;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}#monitor-list monitor div{padding:1em;overflow-wrap:break-word;word-wrap:break-word}#monitor-list monitor div:nth-of-type(1){padding:1em 4em 1em .8em;font-size:1.2em;font-weight:700}#monitor-list monitor div:nth-of-type(2){font-size:.8em;padding-top:0;opacity:.8}#monitor-list monitor div:nth-of-type(3){position:absolute;top:0;height:100%;width:100%;z-index:1}#monitor-list monitor svg{top:0;-ms-flex-item-align:center;-ms-grid-row-align:center;align-self:center;opacity:.6;fill:var(--bw);position:absolute;right:0;height:2em;width:2em;padding:.5em;margin:.5em;-webkit-transition:opacity .2s ease;transition:opacity .2s ease;z-index:2;border-radius:2em}#monitor-list monitor svg:hover{background:var(--sec-color)}#monitor-list monitor badge{position:absolute;pointer-events:none;color:#fff;background:var(--accent-color);border-radius:2em;padding:.5em;-webkit-transition:opacity .2s ease;transition:opacity .2s ease;bottom:0;right:0;margin:.5em;line-height:0;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center}#monitor-list monitor badge::after{content:"";display:block;padding-bottom:100%}#settings-page section{width:100%;border-bottom:1px solid var(--sec-color);display:-ms-grid;display:grid;padding-bottom:1em}#settings-page section:last-of-type{border:none}#settings-page h3,#settings-page h4{display:flexbox;width:100%;-ms-flex-item-align:center;align-self:center}#settings-page h5{margin:0;-ms-flex-item-align:center;-ms-grid-row-align:center;align-self:center;font-weight:400;opacity:.9}#settings-page div{display:-webkit-box;display:-ms-flexbox;display:flex;width:100%;padding:1em 0;-ms-flex-line-pack:center;align-content:center}#settings-page .row{-webkit-box-flex:1;-ms-flex:1;flex:1}#settings-page .row span{font-size:.8em}#settings-page .border-card{color:inherit;text-decoration:none;display:-webkit-box;display:-ms-flexbox;display:flex;padding:.5em 0;width:auto}#settings-page .border-card svg{fill:var(--accent-color);display:flexbox;height:2em;-ms-flex-item-align:center;align-self:center;margin:.5em}.slide-up{opacity:1;-webkit-transform:none!important;transform:none!important;pointer-events:all}.switch{display:flexbox;width:2em;-ms-flex-line-pack:center;align-content:center;position:relative;height:1.5em;z-index:1;margin-right:1em;-ms-flex-item-align:center;align-self:center;-webkit-tap-highlight-color:transparent}.switch input{opacity:0;width:0;height:0}.slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;width:3em;background-color:var(--sec-color);-webkit-transition:.4s;transition:.4s}.slider:before{position:absolute;-ms-flex-item-align:center;-ms-grid-row-align:center;align-self:center;content:"";height:1.6em;width:1.6em;background-color:#fff;-webkit-transform:translateY(-1px);transform:translateY(-1px);-webkit-transition:.4s;transition:.4s;-webkit-box-shadow:0 2px 4px rgba(0,0,0,.24);box-shadow:0 2px 4px rgba(0,0,0,.24)}input:checked+.slider{background-color:var(--accent-color)}input:checked+.slider:before{-webkit-transform:translate(1.4em,-1px);transform:translate(1.4em,-1px)}.slider.round{border-radius:2em}.slider.round:before{border-radius:50%}.page{display:-webkit-box;display:-ms-flexbox;display:flex;position:absolute;overflow-y:auto;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-line-pack:start;align-content:flex-start;top:0;bottom:0;left:0;right:0;width:100%;height:100%;padding:0 1em}#transaction-complete{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center;-ms-flex-line-pack:center;align-content:center}#transaction-complete h3{text-align:center;width:100%}#transaction-complete svg{-ms-grid-column-align:center;justify-self:center;fill:green;width:20vw}#transaction-complete button{position:absolute;bottom:0}#enterPrivKey{width:100%;position:absolute;overflow-y:auto;display:-ms-grid;display:grid;-ms-flex-wrap:wrap;flex-wrap:wrap;padding:1em;top:49px}#enterPrivKey .input{width:100%!important;margin:1em 0!important}#enterPrivKey h4{margin:.5em 0}#noInternet{pointer-events:none;opacity:0;position:fixed;top:0;left:0;right:0;padding:1em;z-index:11;background:khaki;color:#000}.spin{-webkit-animation:spin 1s infinite ease;animation:spin 1s infinite ease}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.highlight{-webkit-animation:highlightElement .6s ease forwards;animation:highlightElement .6s ease forwards}@-webkit-keyframes highlightElement{0%{opacity:0;background:var(--accent-color)}100%{opacity:1;background:0 0}}@keyframes highlightElement{0%{opacity:0;background:var(--accent-color)}100%{opacity:1;background:0 0}}.fade{-webkit-animation:fade .2s ease forwards;animation:fade .2s ease forwards}@-webkit-keyframes fade{0%{opacity:0}100%{opacity:1}}@keyframes fade{0%{opacity:0}100%{opacity:1}}@media screen and (min-width:768px){#enterPrivKey{border:1px solid var(--sec-color);width:400px;padding:2em;left:50%;margin:2em 0;-webkit-transform:translateX(-50%);transform:translateX(-50%)}#enterPrivKey .title-bar{position:relative;border:none}#enterPrivKey button{margin:.5em 0 .5em auto!important}#transaction-complete svg{width:8em}#transaction-complete button{position:relative;bottom:auto}.innerPage{position:absolute;overflow-y:auto;padding:0 1em;top:0;bottom:0;width:100%}#settings-page h4{text-align:left}#settings-page div{padding:.5em 0;-ms-flex-line-pack:center;align-content:center}#settings-page #deleteDB button{margin-left:0!important;margin-right:auto!important;width:auto}#monitor-list{padding-bottom:6em}#monitor-list monitor{-ms-flex-item-align:auto;align-self:auto;width:16em;display:-webkit-box;display:-ms-flexbox;display:flex;margin:.5em;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}#monitor-list monitor div:first-of-type{padding:1.5em 2em 1.5em .8em;-webkit-box-flex:1;-ms-flex:1;flex:1}#monitor-list monitor div:nth-of-type(2){padding:1em 4em 1em 1em}#monitor-list monitor svg{top:auto;bottom:0;opacity:0}#monitor-list monitor svg:hover{opacity:1!important}#monitor-list monitor badge{top:0;bottom:auto}#monitor-list monitor:hover svg{opacity:.6}#add-container,#edit-container{display:-ms-grid;display:grid;place-content:center}#add,#edit{padding:1em 2em;-webkit-box-shadow:0 1em 2em rgba(0,0,0,.16);box-shadow:0 1em 2em rgba(0,0,0,.16);border-radius:.25em;position:relative;width:400px!important}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:0 0}::-webkit-scrollbar-thumb{background:var(--sec-color);opacity:.4;border-radius:1em}::-webkit-scrollbar-thumb:hover{background:#555}::-webkit-scrollbar-corner{background:0 0}.input:hover label,.text-area:hover label{opacity:.8}card{margin:1em!important}body{background-color:var(--back-color)!important;display:-ms-grid;display:grid;place-items:center!important}.input,.text-area,button{margin:1em!important}#main-card{margin:0!important;position:relative;width:80vw!important;height:90vh!important;border-radius:.25em;overflow:hidden;-webkit-box-shadow:0 1em 2em rgba(0,0,0,.16);box-shadow:0 1em 2em rgba(0,0,0,.16);background:var(--body-color);-webkit-transition:width .2s ease,height .2s ease;transition:width .2s ease,height .2s ease}#main-card #bottom-nav{display:-ms-grid;display:grid;border-top:none;opacity:1!important;pointer-events:all!important;position:absolute!important;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-ms-flex-wrap:wrap;flex-wrap:wrap;top:0;width:64px;text-align:left!important;height:100%;background:var(--sidenav-color);-webkit-transition:width .2s ease;transition:width .2s ease}#main-card #bottom-nav #indicator{position:absolute;display:inline-block;left:0;width:4px;height:2em;background:var(--accent-color);border-radius:0 4px 4px 0;-webkit-transition:-webkit-transform .2s ease;transition:-webkit-transform .2s ease;transition:transform .2s ease;transition:transform .2s ease,-webkit-transform .2s ease}#main-card #bottom-nav #menu{position:absolute;top:0;display:inline-block!important;opacity:.8}#main-card #bottom-nav #settingsBtn{position:absolute;bottom:0}#main-card #bottom-nav .icons{padding:1.2em;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-line-pack:center;align-content:center;-ms-flex-wrap:nowrap;flex-wrap:nowrap;white-space:nowrap;-webkit-transition:opacity .2s ease;transition:opacity .2s ease}#main-card #bottom-nav .icons h6{display:none}#main-card #bottom-nav .icons span{opacity:0;display:inline-block;-webkit-transition:opacity .2s ease;transition:opacity .2s ease;margin-left:1em;line-height:1.2em}#main-card #bottom-nav .icons svg{height:1.2em;display:flexbox;-ms-flex-item-align:center!important;align-self:center!important;margin:0}#main-card #bottom-nav .icons:hover{opacity:1}#main-card .right{top:64px;left:64px;right:0;bottom:0}#header{opacity:1!important;pointer-events:all!important;z-index:2;width:calc(100% - 64px);left:64px!important;height:64px!important}#overlay{display:-ms-grid;display:grid;place-content:center}#overlay #popup{padding:1em 2em;-webkit-box-shadow:0 1em 2em rgba(0,0,0,.16);box-shadow:0 1em 2em rgba(0,0,0,.16);border-radius:.25em;width:400px!important;position:relative}.input,button{width:auto!important}#sendData #sdleft{width:40%;padding:0 .5em}#sendData #sdright{opacity:.6;width:60%;display:flexbox;-ms-flex-item-align:start;align-self:flex-start}#sendData #sdright .input,#sendData #sdright .text-area,#sendData #sdright button{width:100%!important;margin:.5em!important}}@media screen and (min-width:1280px){#main-card{width:60vw!important;height:80vh!important}}@media screen and (min-width:1600px){#main-card{width:50vw!important}}@media all and (device-width:768px) and (device-height:1024px) and (orientation:portrait){#main-card{width:80vw!important;height:60vh!important}monitor svg{opacity:1!important}}@media all and (device-width:1024px) and (device-height:768px) and (orientation:landscape){#main-card{width:80vw!important;height:70vh!important}monitor svg{opacity:1!important}}@media screen and (max-width:380px){button{font-size:.8em}}@media screen and (max-width:360px){body{font-size:12px!important}#bottom-nav{height:48px}trans-container{top:48px!important}#header{height:4em}.right{bottom:48px!important}}
</style>
</head>
<body onload="onLoadStartUp()">
<div id="main-card"> <div id="noInternet"> There seems to be a problem connecting to the internet. </div><div id="overlay2"></div><header id="header"> <svg viewBox="0 0 96 108" style="enable-background:new 0 0 90.5 106.3;" xml:space="preserve"> <path d="M90.2,102.5c-2.4-8.2-9.9-14.5-27.4-23.1c-7.1-3.5-11.8-6.2-14-8.3c-1.7-1.6-3.5-4-4.2-5.5c-0.7-1.7-0.7-5.5,0-7.5 c1.3-3.6,2.6-5.2,12.9-15.1c6.2-5.9,9.3-10.3,11.1-15.5c0.7-2.1,0.8-7.6,0.2-9.4C66.5,12,61.7,6.7,53.7,1.6c-3-1.9-4.3-2.1-4.3-0.8 c0,0.3-0.5,1.4-1,2.4l-1,1.8l-2.8-1.9c-1.5-1.1-3.4-2.2-4.1-2.6c-1.3-0.7-2.4-0.6-2.4,0.2c0,0.3-1.4,3.4-2,4.4 c0,0.1-0.4-0.1-0.9-0.4c-6.1-4.4-8.7-5.5-8.7-3.9c0,0.7-1.8,4.2-4,7.9C16,19.5,9.4,24.9,2.6,24.9c-3,0-2.9-0.1-2,3.4 c0.7,2.8,1.1,3.1,3.6,2.3c2.3-0.7,3.9-1.5,5.8-2.9c0.8-0.6,1.5-0.9,1.6-0.9c0.1,0.1,0.5,1,0.7,2.1s0.7,2,0.9,2.1 c0.8,0.3,5.1-1.3,7.5-2.9l2.3-1.5l0.5,1.8c0.6,2.4,1,2.7,3.3,2.1c3.9-1,7.7-3.7,11.5-8.2l2-2.4l-0.2,2.1c-0.6,5.4-4.3,11.4-11.3,18 c-1.8,1.7-4.7,4.5-6.5,6.2c-10.7,10.2-10,18.6,2,26.5c2.7,1.8,10.3,5.8,15.3,8c0.9,0.4,3.3,1.7,5.3,2.9c11,6.5,16.4,13.1,16.4,19.7 c0,1.3,0.1,2.4,0.2,2.6l0,0c0.3,0.3,0.1,0.3,3-0.5c1.4-0.4,2.6-0.9,2.8-1.1c0.4-0.6-0.6-3.7-1.8-6.1c-1.3-2.5-5.6-7-8.9-9.4 c-3.8-2.8-9.3-5.9-17-9.7c-8.5-4.2-11.8-6.2-14.7-9.1c-2.6-2.6-3.9-5.3-3.9-8.2c0-4.6,2.3-8.6,8.3-14.1c9.4-8.7,13-13,15.5-18.8 c1.3-3,1.4-3.4,1.4-6.7c0-3.1-0.1-3.8-1.1-6l-1.1-2.4l1-1.6c0.5-0.9,1.2-2.1,1.5-2.6l0.5-1l1.5,2.1c1.8,2.6,3.2,6.8,3.2,9.3 c0,1.7-0.6,4.7-1.4,6.4c-0.2,0.4-0.4,1-0.5,1.3c-0.1,0.3-1.1,2-2.2,3.7c-2,3-5.2,6.4-13.4,14.2c-5.7,5.4-7.6,8.6-7.8,13.1 c-0.2,3.7,0.7,5.9,3.7,9.2c3.2,3.4,6.9,5.8,17.4,11c12.1,6,17.3,9.6,21.3,14.5c2.5,3.2,3.7,5.8,3.9,9.3c0.1,1.6,0.3,3,0.5,3 c0.1,0.1,0.8,0,1.4-0.2s1.9-0.5,2.7-0.7l1.5-0.4l-0.2-1.5c-0.7-5.1-5.4-10.8-13.1-16c-4.4-2.9-5.8-3.7-17.3-9.4 c-5.7-2.8-9.2-5.1-11.8-7.6c-4.3-4.2-5.1-8.8-2.7-13.9c1.4-2.8,2.7-4.4,12.5-13.8c8-7.7,11.4-13.7,11.4-20.1c0-5.1-2.3-9.9-6.9-14.3 c-1.1-1-2-2-2.1-2.2c-0.2-0.4,1.5-3.9,1.9-3.9c1.2,0,7.8,6.3,9.7,9.2c2,3.3,2.5,5,2.5,8.9c0,3.9-0.6,5.9-2.9,9.8 c-2.4,4.1-4.2,6-14.2,15.5c-3.4,3.2-5.7,6.1-6.9,8.7c-0.9,2-1.1,2.7-1.1,5.1c0,2.3,0.2,3.2,1,4.9c1.9,4,7.4,8.5,15.4,12.4 c12.5,6.1,15.1,7.6,19.4,10.7c7.2,5.3,10.6,10.5,10.6,16c0,1.3,0.1,2.4,0.3,2.5c0.4,0.3,4.8-0.8,5.5-1.3 C90.7,104.4,90.7,104.3,90.2,102.5z M20.3,23.3L20.3,23.3c-2,1-3.3,1.4-4.8,1.5L13.3,25l2.3-2.8c3.7-4.5,6.4-8.9,10-16 c0.9-1.8,1.8-3.5,2-3.6c0.4-0.4,2.6,1.1,5.1,3.4l2.1,1.9l-1.9,2.8C28.2,17.5,24.5,21.2,20.3,23.3z M39.3,17.4 c-1.2,1.7-6.5,5.7-8.6,6.5v0c-1.1,0.4-2.8,0.8-3.9,0.9L24.9,25l2.1-2.6c2.5-3.1,5.1-7,7-10.4c0.7-1.4,1.4-2.5,1.5-2.6 c0.3-0.4,1.7,1.4,3,4.1l1.5,3L39.3,17.4z M44.6,10c-0.7,1.2-1.4,2.1-1.5,2.1c-0.1,0-1.5-1.4-3-3l-2.8-3l0.6-1.5 c1.1-2.6,1.3-2.7,3.4-1c1.9,1.5,4.5,3.8,4.5,4.1C45.8,7.8,45.3,8.9,44.6,10z"/> </svg> <span>RanchiMall</span> <svg viewBox="0 0 18 18" style="enable-background:new 0 0 18 18;" xml:space="preserve"> <g> <path d="M18,4v12c0,1.1-0.9,2-2,2H1c-0.6,0-1-0.4-1-1V3c0-0.6,0.4-1,1-1h15C17.1,2,18,2.9,18,4z M16,10 c0-1.4-1.1-2.5-2.5-2.5S11,8.6,11,10s1.1,2.5,2.5,2.5S16,11.4,16,10z"/> <path d="M16,2H1l13-2C15.1,0,16,0.9,16,2z" style="fill: #9e0915"/> <circle cx="13.5" cy="10" r="1.5"/> </g> </svg> <span>FLO web wallet</span> </header> <div id="bottom-nav"> <div id="indicator"></div><div class="icons" id="menu" title='Expand side navigation bar'> <svg role="img" viewBox="0 0 20 16"> <g> <path d="M19,2H1C0.4,2,0,1.6,0,1v0c0-0.6,0.4-1,1-1l18,0c0.6,0,1,0.4,1,1v0C20,1.6,19.6,2,19,2z"/> <path d="M12,10H1c-0.6,0-1-0.4-1-1v0c0-0.6,0.4-1,1-1h11c0.6,0,1,0.4,1,1v0C13,9.6,12.6,10,12,10z"/> </g> </svg> <span></span> </div><div class="icons tabs activeButton" title='Monitor FLO data' id="getDataBtn" onclick="showPage(this.id, 'getData')"> <svg role="img" viewBox="0 0 20 16"> <path d="M18,0H2C0.9,0,0,0.9,0,2v14c0,1.1,0.9,2,2,2h16c1.1,0,2-0.9,2-2V2C20,0.9,19.1,0,18,0z M16.4,6.9l-4.2,4.2 c-0.4,0.4-1,0.4-1.4,0L8.6,9l-3.5,3.5c-0.4,0.4-1,0.4-1.4,0c-0.4-0.4-0.4-1,0-1.4l4.2-4.2c0.4-0.4,1-0.4,1.4,0L11.4,9l3.5-3.5 c0.4-0.4,1-0.4,1.4,0C16.8,5.9,16.8,6.5,16.4,6.9z"/> </svg> <h6>Monitor</h6> <span>Monitor FLO data</span> </div><div class="icons tabs" title='Send FLO data' id="sendDataBtn" onclick="showPage(this.id, 'sendData')"> <svg role="img" viewBox="0 0 20 16"> <g> <path d="M0.3,9.1l6.2,2.2c0.2,0.1,0.4,0,0.5-0.1L19.1,0L0.3,8.2C-0.1,8.4-0.1,9,0.3,9.1z"/> <path d="M10,18.8l-2.2-6.2c-0.1-0.2,0-0.4,0.1-0.5L19.1,0l-8.2,18.8C10.7,19.2,10.1,19.2,10,18.8z"/> </g> </svg> <h6>Send</h6> <span>Send FLO data</span> </div><div class="icons tabs" title='Generate or recover FLO address' id="addrGenBtn" onclick="showPage(this.id, 'addrGen')"> <svg role="img" viewBox="0 0 20 16"> <g> <circle cx="9" cy="9" r="3"/> <path d="M12,14v1c0,0.6-0.4,1-1,1H3c-0.6,0-1-0.4-1-1V3c0-0.6,0.4-1,1-1h8c0.6,0,1,0.4,1,1v1c0,0.6,0.4,1,1,1h0c0.6,0,1-0.4,1-1V2 c0-1.1-0.9-2-2-2H2C0.9,0,0,0.9,0,2v14c0,1.1,0.9,2,2,2h10c1.1,0,2-0.9,2-2v-2c0-0.6-0.4-1-1-1h0C12.4,13,12,13.4,12,14z"/> <circle cx="17" cy="9" r="3"/> </g> </svg> <h6>Generate</h6> <span>Generate address</span> </div><div class="icons tabs" title="Settings" id="settingsBtn" onclick="showPage(this.id, 'settings-page')"> <svg role="img" x='0' y='0' viewBox="0 0 20 16"> <title>Settings</title> <g> <circle cx="9.6" cy="8.7" r="4"/> <path d="M18.8,7.3l-3.4-5.9C14.9,0.5,14,0,13,0H6.2c-1,0-1.9,0.5-2.4,1.4L0.4,7.3c-0.5,0.9-0.5,1.9,0,2.8l3.4,5.9 c0.5,0.9,1.4,1.4,2.4,1.4H13c1,0,1.9-0.5,2.4-1.4l3.4-5.9C19.3,9.2,19.3,8.1,18.8,7.3z M9.6,14.7c-3.3,0-6-2.7-6-6s2.7-6,6-6 s6,2.7,6,6S12.9,14.7,9.6,14.7z"/> </g> </svg> <h6>Settings</h6> <span>Settings</span> </div></div><div class="right"> <h5 id="textCopied"> Copied </h5> <div id="getData" class="page"> <div id="add-container" class="hide"> <div id="add"> <h4>Add new address to monitoring list</h4> <div class="input"> <input aria-label="FLO address" type="text" oninput="checkAddress(this)" onfocus="animateInput(this.parentNode)" onblur="revertBack(this.parentNode)" id="floAddr" autocomplete="new-password"/> <label>FLO Address</label> </div><div class="input"> <input aria-label="Label" type="text" onfocus="animateInput(this.parentNode)" onblur="revertBack(this.parentNode)" id="addrLabel" autocomplete="new-password"/> <label>Label</label> </div><button onclick="closeAdd()">Cancel</button> <button id="addAddressToMonitor" onclick="addAddressToMonitoringList()" disabled>Add</button> </div></div><div id="edit-container" class="hide"> <div id="edit"> <h4>Edit display card</h4> <svg id="loadingSvg" onclick="copyToClipboard(this.parentNode, '0')" viewBox="0 0 13 16" style="enable-background:new 0 0 13 16;" xml:space="preserve"> <title>Copy FLO address</title> <path d="M12,0H4C3.4,0,3,0.4,3,1v3H1C0.4,4,0,4.4,0,5v10c0,0.6,0.4,1,1,1h8c0.6,0,1-0.4,1-1v-3h2c0.6,0,1-0.4,1-1V1 C13,0.4,12.6,0,12,0z M8,13c0,0.6-0.4,1-1,1H3c-0.6,0-1-0.4-1-1V7c0-0.6,0.4-1,1-1h4c0.6,0,1,0.4,1,1V13z M11,9c0,0.6-0.4,1-1,1V5 c0-0.6-0.4-1-1-1H5V3c0-0.6,0.4-1,1-1h4c0.6,0,1,0.4,1,1V9z"/> </svg> <div> <button onclick="showBalance()">Check balance</button> <svg class="hide" id="spinner" viewBox="0 0 16 16" style="enable-background:new 0 0 16 16;" xml:space="preserve"> <g> <path class='p1' d="M8,0C3.6,0,0,3.6,0,8s3.6,8,8,8s8-3.6,8-8S12.4,0,8,0z M8,14c-3.3,0-6-2.7-6-6s2.7-6,6-6s6,2.7,6,6 S11.3,14,8,14z"/> <path class='p2' d="M6.5,13.8c-2.2-0.5-3.9-2.3-4.4-4.5c-0.7-3.6,1.7-6.8,5-7.2C7.6,2,8,1.6,8,1.1v0c0-0.6-0.5-1.1-1.1-1 C2.5,0.7-0.8,4.9,0.2,9.6c0.6,3.1,2.9,5.5,6,6.2c4.8,1.1,9.1-2.2,9.8-6.7C16,8.5,15.5,8,14.9,8h0c-0.5,0-0.9,0.4-1,0.9 C13.5,12.2,10.2,14.7,6.5,13.8z"/> </g> </svg> <h4 id="showBalance"></h4> </div><div class="input"> <input aria-label="Label" autocomplete="new-password" type="text" onfocus="animateInput(this.parentNode)" onblur="revertBack(this.parentNode)" id="newAddrLabel"/> <label>Label</label> </div><button onclick="removedata()" id="removeAddr">Remove</button> <button onclick="closeEdit()">Cancel</button> <button id="editdata" onclick="editdata()">Save</button> </div></div><div id="monitor-list"> </div><svg id="addNewAddress" viewBox="0 0 17 17"> <title>Add new address to monitor</title> <path id="Union_1" data-name="Union 1" d="M7.5-3701v-6.5H1a1,1,0,0,1-1-1,1,1,0,0,1,1-1H7.5v-6.5a1,1,0,0,1,1-1,1,1,0,0,1,1,1v6.5H16a1,1,0,0,1,1,1,1,1,0,0,1-1,1H9.5v6.5a1,1,0,0,1-1,1A1,1,0,0,1,7.5-3701Z" transform="translate(0 3717)"/> </svg> </div><div id="dispMsg" class="hide innerPage"> <div class='title-bar'> <svg onclick="backToMonitoringPage()" viewBox="0 0 16 16"> <title>Go back to monitoring page</title> <path d="M14.9,6.5h-11L8.4,2c0.4-0.4,0.4-1.2,0-1.6C8-0.1,7.2-0.1,6.8,0.3L0.3,6.8C0.2,6.9,0.1,7,0.1,7.2C0,7.5,0,7.8,0.1,8 c0.1,0.1,0.1,0.3,0.2,0.4l6.5,6.5c0.4,0.4,1.2,0.4,1.6,0c0.4-0.4,0.4-1.2,0-1.6L3.9,8.8h11c0.6,0,1.1-0.5,1.1-1.1 C16,7,15.5,6.5,14.9,6.5z"/> </svg> <span><h3 id="addressLabel"></h3><h5 id="fullAddress"></h5></span> <svg onclick="refreshdata()" viewBox="0 0 16 16" style="enable-background:new 0 0 19.9 21.5;" xml:space="preserve"> <title>Refresh transactions</title> <path d="M10,6h4.7c0.4,0,0.7-0.3,0.7-0.7V0.7C15.3,0.3,15,0,14.6,0c-0.1,0-0.9,0.7-1.9,1.6c-2.2-1.7-5.3-2.2-8.5-0.8 C2.8,1.5,1.6,2.7,0.9,4.3C-1.9,10.2,2.4,16,8,16c3.2,0,5.9-1.9,7.2-4.6c0.3-0.7-0.2-1.4-0.9-1.4c-0.4,0-0.7,0.2-0.9,0.5 c-1.3,2.8-4.7,4.4-8.1,2.9c-1.2-0.5-2.2-1.5-2.7-2.7C0.6,6.3,3.8,2,8,2c1.2,0,2.4,0.4,3.3,1c-1.1,1.1-2,2.1-2,2.3 C9.3,5.7,9.6,6,10,6z"/> </svg> </div><trans-container id="transactions-container"> </trans-container> <svg onclick="backToTop()" id="scrollToTop" viewBox="0 0 16 9" style="enable-background:new 0 0 16 9;" xml:space="preserve"> <path class="st0" d="M15.7,7.3l-7-7c-0.4-0.4-1-0.4-1.4,0l-7,7c-0.4,0.4-0.4,1,0,1.4c0.4,0.4,1,0.4,1.4,0L8,2.4l6.3,6.3 c0.4,0.4,1,0.4,1.4,0C16.1,8.3,16.1,7.7,15.7,7.3z"/> </svg> </div><div id="sendData" class="page hide"> <div id="sdleft"> <div id="dispBal"> <svg class="hide" id="loadBalance" viewBox="0 0 16 16" style="enable-background:new 0 0 16 16;" xml:space="preserve"> <g> <path class='p1' d="M8,0C3.6,0,0,3.6,0,8s3.6,8,8,8s8-3.6,8-8S12.4,0,8,0z M8,14c-3.3,0-6-2.7-6-6s2.7-6,6-6s6,2.7,6,6 S11.3,14,8,14z"/> <path class='p2' d="M6.5,13.8c-2.2-0.5-3.9-2.3-4.4-4.5c-0.7-3.6,1.7-6.8,5-7.2C7.6,2,8,1.6,8,1.1v0c0-0.6-0.5-1.1-1.1-1 C2.5,0.7-0.8,4.9,0.2,9.6c0.6,3.1,2.9,5.5,6,6.2c4.8,1.1,9.1-2.2,9.8-6.7C16,8.5,15.5,8,14.9,8h0c-0.5,0-0.9,0.4-1,0.9 C13.5,12.2,10.2,14.7,6.5,13.8z"/> </g> </svg> <h5>Available balance</h5> <span id="dispBalInt">0</span> <span id="dispBalFloat"></span> <h5>To send FLO data, make sure you have enough balance.</h5> </div><div class="input"> <input aria-label="FLO address" autocomplete="new-password" onfocus="animateInput(this.parentNode)" onblur="revertBack(this.parentNode)" type="text" id="getBal_addr" oninput="checkBalAddress(this)"/> <label>FLO address</label> <button id="getBal_btn" onclick="getBal()" disabled>Check balance</button> </div></div><div id="sdright"> <div class="input"> <input aria-label="Receiver's address" oninput="validateInfo(this)" autocomplete="new-password" type="text" onfocus="animateInput(this.parentNode)" onblur="revertBack(this.parentNode)" id="receiver"/> <label>Receiver's address</label> </div><div class="input"> <input aria-label="Amount" autocomplete="new-password" type="number" onfocus="animateInput(this.parentNode)" onblur="revertBack(this.parentNode)" id="amount"/> <label>Amount</label> </div><div class="text-area"> <textarea aria-label="FLO data" data-gramm_editor="false" onfocus="animateInput(this.parentNode)" onblur="revertBack(this.parentNode)" rows="8" id="flotextdata"></textarea> <label>FLO data</label> </div><button class="primaryButton" id="sendBtn" onclick="showPrivKeyPage()" disabled>Send</button> </div></div><div class="innerPage hide" id="privKeyPage"> <div class='title-bar'> <svg onclick="showPage('sendDataBtn', 'sendData')" viewBox="0 0 16 16"> <title>Go back to monitoring page</title> <path d="M14.9,6.5h-11L8.4,2c0.4-0.4,0.4-1.2,0-1.6C8-0.1,7.2-0.1,6.8,0.3L0.3,6.8C0.2,6.9,0.1,7,0.1,7.2C0,7.5,0,7.8,0.1,8 c0.1,0.1,0.1,0.3,0.2,0.4l6.5,6.5c0.4,0.4,1.2,0.4,1.6,0c0.4-0.4,0.4-1.2,0-1.6L3.9,8.8h11c0.6,0,1.1-0.5,1.1-1.1 C16,7,15.5,6.5,14.9,6.5z"/> </svg> <span><h3>Send</h3></span> </div><div id="enterPrivKey"> <div class="input"> <input aria-label="private key" autocomplete="new-password" type="text" onfocus="animateInput(this.parentNode)" onblur="revertBack(this.parentNode)" id="privKey"/> <label>Private key</label> </div><button onclick="sendMessage()">continue</button> </div></div><div id="transaction-complete" class="innerPage hide"> <svg viewBox="0 0 16 16" style="enable-background:new 0 0 16 16;" xml:space="preserve"> <g> <path d="M14.3,2.4L7.9,8.7L5.8,6.6c-0.4-0.4-1-0.4-1.4,0S4,7.6,4.4,8l2.8,2.8c0.4,0.4,1,0.4,1.4,0l7.1-7.1 c0.4-0.4,0.4-1,0-1.4C15.3,2,14.7,2,14.3,2.4z"/> <path d="M13.9,7C14,7.3,14,7.7,14,8c0,3.3-2.7,6-6,6s-6-2.7-6-6s2.7-6,6-6c1.5,0,2.8,0.5,3.9,1.4L13.3,2 C11.9,0.8,10,0,8,0C3.6,0,0,3.6,0,8s3.6,8,8,8s8-3.6,8-8c0-0.9-0.2-1.8-0.4-2.6L13.9,7z"/> </g> </svg> <h3>Transaction successful</h3> <h4 id="transactionId"></h4> <button class="primaryButton" onclick="showPage('sendDataBtn', 'sendData')">Done</button> </div><div id="addrGen" class="page hide"> <button id="GenNewAddrBtn" class="primaryButton">Generate new address</button> <button id="showRecoveryModal">Recover FLO address</button><br/><br/> <div id="addrDisp"> </div></div><div id="settings-page" class="page hide"> <section> <h4>Dark mode</h4> <div> <span class="row"> Automatic<br><span>Dark mode active : 6pm - 6am</span> </span> <label class="switch"> <input aria-label="Toggle automatic dark theme" autocomplete="new-password" type="checkbox" id="auto-mode" type="checkbox" onclick="autoMode()"/> <span class="slider round"></span> </label> </div><div> <span class="row">Manual<br><span>Dark mode</span> </span> <label class="switch"> <input aria-label="Toggle manual dark theme" autocomplete="new-password" type="checkbox" id="manual-mode" type="checkbox" onclick="theme()"/> <span class="slider round"></span> </label> </div></section> <section id="deleteDB"> <h4>Clear all local data</h4> <h5>This will delete all local Web Wallet data like added addresses and locally stored transactions.After clearing local data you may experience slow loading of newly added address, please proceed cautiously! </h5> <button class="primaryButton" onclick="deleteDB()">Clear data</button> </section> <section> <h4>About</h4> <h5>Version 2.7.2</h5> <a class="border-card" href="https://flo.cash/" target="_blank" rel="noopener noreferrer"> <h5>Powered by</h5> <svg viewBox="0 0 108 48" style="enable-background:new 0 0 107.65 47.07;" xml:space="preserve"> <g> <path class="flo-logo" d="M34.2,32.4c0,0,3.75-0.18,7.41-3.86c2.96-2.98,3.65-6.66,3.99-8.52c-11.04-0.63-12.36,0.99-13.71,1.68 c-1.19,0.61-5.33,4.55-5.33,4.55s3.06-3.13,3.2-9.94c0.09-4.54-1.02-7.39-2.72-10.64C25.29,2.33,22.79,0,22.79,0l0.01,4.97 c0,0,4.35,2.84,4.35,11.84c0,6.52-4.35,11.02-4.35,11.02s-4.35-4.5-4.35-11.02c0-9.01,4.35-11.84,4.35-11.84L22.79,0 c0,0-2.48,2.33-4.23,5.67c-1.7,3.25-2.81,6.1-2.72,10.64c0.13,6.81,3.2,9.94,3.2,9.94s-4.14-3.95-5.33-4.55 c-1.35-0.69-2.67-2.31-13.71-1.68c0.34,1.86,1.03,5.54,3.99,8.52c3.66,3.68,7.41,3.86,7.41,3.86s-5.05-2.03-7.15-9.45 c0,0,5.76-0.7,9.63,1.87c2.52,1.67,4.86,4.26,6.79,6.01c0,0-2.58-0.04-6.81,1.88c-2.54,1.15-3.92,2.84-4.44,4.38 c-0.36,1.06-0.2,2.27-0.2,2.27s3.31,0.31,5.94,0c1.99-0.23,3.42-2.16,3.42-2.16s-2,0.78-3.95,0.78c-2.06,0-2.67-0.66-2.67-0.66 c0.98-3.64,8.68-5.19,8.68-5.19s-1.34,2.6-1.42,6.5c-0.1,4.79,3.57,8.52,3.57,8.45c0,0.07,3.67-3.66,3.57-8.45 c-0.08-3.9-1.42-6.5-1.42-6.5s7.71,1.55,8.68,5.19c0,0-0.61,0.66-2.67,0.66c-1.95,0-3.95-0.78-3.95-0.78s1.43,1.93,3.42,2.16 c2.63,0.31,5.94,0,5.94,0s0.16-1.21-0.2-2.27c-0.52-1.54-1.9-3.23-4.44-4.38c-4.23-1.92-6.81-1.88-6.81-1.88 c1.93-1.76,4.27-4.34,6.79-6.01c3.87-2.57,9.63-1.87,9.63-1.87C39.26,30.38,34.2,32.4,34.2,32.4z M22.8,43.06 c-0.95-1.37-1.47-2.13-1.47-4.26c0-2.4,1.12-4.61,1.47-5.14c0.35,0.52,1.47,2.74,1.47,5.14C24.27,40.92,23.75,41.69,22.8,43.06z"/> <g> <polygon class="flo-logo" points="73.53,36.36 73.53,20.01 70.53,20.01 70.53,36.36 70.53,39.35 84,39.35 84,36.36 "/> <g> <rect x="52.75" y="20.01" class="flo-logo" width="13.47" height="2.93"/> <polygon class="flo-logo" points="63.74,28.36 55.74,28.36 52.75,28.36 52.75,31.35 52.75,39.35 55.74,39.35 55.74,31.35 63.74,31.35 "/> </g> <path class="flo-logo" d="M97.99,20.01c-5.34,0-9.67,4.33-9.67,9.67s4.33,9.67,9.67,9.67s9.67-4.33,9.67-9.67S103.33,20.01,97.99,20.01 z M97.99,35.85c-3.41,0-6.17-2.76-6.17-6.17c0-3.41,2.76-6.17,6.17-6.17c3.41,0,6.17,2.76,6.17,6.17 C104.15,33.09,101.39,35.85,97.99,35.85z"/> </g> </g> </svg> </a> </section> </div></div></div><div id="overlay"> <div id="popup"> <h4>Recover FLO address</h4> <h5>Please enter your private key.</h5> <div class="input"> <input aria-label="Private key" autocomplete="new-password" type="text" onfocus="animateInput(this.parentNode)" onblur="revertBack(this.parentNode)" id="pop" oninput="checkPrivateKey(this)"/> <label>Private key</label> </div><button onclick="fadeout()">Cancel</button> <button id="ok" onclick="RecoverAddr()" disabled>Ok</button> </div></div>
<script>
const floGlobals={blockchain:"FLO",apiURL:{FLO:"https://explorer.mediciland.com",FLO_TEST:"https://testnet-flosight.duckdns.org"},fee:5e-4};let mode,activeAddress,scrollingEvent,bottomNav=document.getElementById("bottom-nav"),floAddr=document.getElementById("floAddr"),addrLabel=document.getElementById("addrLabel"),newAddrLabel=document.getElementById("newAddrLabel"),recentPage="getDataBtn",initial=0,limit=10;window.addEventListener("offline",()=>{document.getElementById("noInternet").classList.add("show")}),window.addEventListener("online",()=>{document.getElementById("noInternet").classList.remove("show")});const html=document.querySelector("html");function daylight(){html.setAttribute("style","--bw: #000;--back-color: #EBEBEB;--body-color: #fff;--sidenav-color:#f0f0f0;--sec-color: #ccc;--opac-accent-color: rgb(210, 13, 29, 0.1);")}function nightlight(){html.setAttribute("style","--bw: #fff;--back-color: #222;--body-color: #2a2a2a;--sidenav-color:#313131;--sec-color: #555;--opac-accent-color: rgb(210, 13, 29, 0.2);")}function autoMode(){if(document.getElementById("auto-mode").checked){localStorage.setItem("dark","auto"),document.getElementById("manual-mode").checked=!1;let t=(new Date).getHours();t>6&&t<18?daylight():nightlight()}else localStorage.setItem("dark","no"),daylight(),clearInterval(mode)}function theme(){document.getElementById("manual-mode").checked?(nightlight(),localStorage.setItem("dark","yes"),document.getElementById("auto-mode").checked=!1):(daylight(),localStorage.setItem("dark","no"))}function closeSidePanel(){window.innerWidth>768&&(bottomNav.classList.remove("reveal"),document.getElementById("overlay2").classList.remove("show"))}function fadeout(){document.getElementById("overlay").classList.remove("show"),document.getElementById("popup").classList.remove("slide-up"),document.getElementById("pop").value=""}function animateInput(t){t.children[1].classList.add("label-active")}function revertBack(t){""==t.children[0].value&&t.children[1].classList.remove("label-active")}function clickedAddress(t){let e=t.children[1].textContent,n=t.children[0].textContent;"badge"===t.lastElementChild.tagName&&t.lastElementChild.remove(),monitorData(e,n),showInnerPage("dispMsg")}function showAdd(){document.getElementById("add-container").classList.add("show"),document.getElementById("add").classList.add("slide-up"),window.innerWidth>768&&floAddr.focus()}function closeAdd(){document.getElementById("add-container").classList.remove("show"),document.getElementById("add").classList.remove("slide-up"),floAddr.value="",addrLabel.value="",document.getElementById("addAddressToMonitor").disabled=!0}function checkAddress(t){let e=document.getElementById("addAddressToMonitor");floCrypto.validateAddr(t.value)?e.disabled=!1:e.disabled=!0}function addAddressToMonitoringList(){let t=addrLabel.value;""==t&&(t="Unknown"),compactIDB.addData("labels",t,floAddr.value).then(e=>{createAddressCards(floAddr.value,t),floWebWallet.syncTransactions(floAddr.value),closeAdd()}).catch(t=>{alert(t)})}function showPage(t,e){let n=document.querySelectorAll(".page"),i=document.querySelectorAll(".tabs"),r=document.querySelectorAll(".innerPage");bottomNav.classList.remove("hide"),document.getElementById("header").classList.remove("hide"),n.forEach(function(t){t.classList.add("hide")}),i.forEach(function(t){t.classList.remove("activeButton")}),r.forEach(function(t){t.classList.add("hide")});let o=document.getElementById(t);if(o.classList.add("activeButton"),window.innerWidth>768){let t=o.offsetTop-16,e=o.getBoundingClientRect().height;document.getElementById("indicator").setAttribute("style","transform: translateY("+(t+e/2)+"px")}let s=document.getElementById(e);s.classList.remove("hide"),recentPage!=t&&(s.classList.add("fade"),s.addEventListener("animationEnd",function(){s.classList.remove("fade")}),s.addEventListener("webkitAnimationEnd",function(){s.classList.remove("fade")})),recentPage=t}let resizeComplete;function setElements(){let t=document.getElementById(recentPage),e=document.getElementById("indicator"),n=document.getElementById("addNewAddress"),i=document.getElementById("scrollToTop");if(window.innerWidth<768)bottomNav.classList.remove("reveal"),document.getElementById("overlay2").classList.remove("show"),n.setAttribute("style","bottom: 54px; right: 0"),i.setAttribute("style","bottom: 0; right: 0");else{let r=document.getElementById("main-card").getBoundingClientRect(),o=(window.innerHeight-r.height)/2+16,s=(window.innerWidth-r.width)/2+16;n.setAttribute("style",`bottom: ${o}px; right: ${s}px`),i.setAttribute("style",`bottom: ${o}px; right: ${s}px`);let a=t.offsetTop-16,u=t.getBoundingClientRect().height;e.setAttribute("style","transform: translateY("+(a+u/2)+"px")}}function showInnerPage(t){let e=document.querySelectorAll(".page"),n=document.querySelectorAll(".innerPage");e.forEach(function(t){t.classList.add("hide")}),n.forEach(function(t){t.classList.add("hide")}),bottomNav.classList.add("hide"),document.getElementById("header").classList.add("hide");let i=document.getElementById(t);i.classList.remove("hide"),i.classList.add("fade"),i.addEventListener("animationEnd",function(){i.classList.remove("fade")}),i.addEventListener("webkitAnimationEnd",function(){i.classList.remove("fade")})}function checkBalAddress(t){let e=document.getElementById("getBal_btn");floCrypto.validateAddr(t.value)?e.disabled=!1:e.disabled=!0}function showBalance(){let t=document.getElementById("spinner");t.classList.add("show","spin"),floBlockchainAPI.getBalance(activeAddress.children[1].textContent).then(e=>{t.classList.remove("show","spin"),document.getElementById("showBalance").textContent=`${e} FLOs`}).catch(e=>{t.classList.remove("show","spin"),document.getElementById("showBalance").textContent="Something went wrong!"})}function getBal(){let t=document.getElementById("getBal_addr"),e=document.getElementById("loadBalance"),n=document.getElementById("dispBalInt"),i=document.getElementById("dispBalFloat");e.classList.add("show","spin"),floBlockchainAPI.getBalance(t.value).then(t=>{let r=t.split("."),o=r.pop(),s=r.pop();void 0===s?n.textContent="0":parseFloat(t)<.005?(n.textContent="Insufficient Balance",i.textContent=""):(n.textContent=s,i.innerHTML=`.${o} FLOs`,document.getElementById("sdright").setAttribute("style","pointer-events: all; opacity: 1")),e.classList.remove("show","spin")}).catch(t=>{console.log(t),e.classList.remove("show","spin")})}function checkPrivateKey(t){""===t.value||t.value.length<52?document.getElementById("ok").disabled=!0:document.getElementById("ok").disabled=!1}function RecoverAddr(){let t=document.getElementById("pop");floWebWallet.recoverAddr(t.value).then(t=>{let e=document.getElementById("addrDisp"),n=document.createElement("card");n.classList.add("highlight"),n.innerHTML=`<div>\n <h5>Recovered FLO Address</h5>\n <h4>${t.floID}</h4>\n <svg onclick="copyToClipboard(this.parentNode, '1')" viewBox="0 0 13 16" style="enable-background:new 0 0 13 16;" xml:space="preserve">\n <title>Copy FLO address</title>\n <path d="M12,0H4C3.4,0,3,0.4,3,1v3H1C0.4,4,0,4.4,0,5v10c0,0.6,0.4,1,1,1h8c0.6,0,1-0.4,1-1v-3h2c0.6,0,1-0.4,1-1V1\n C13,0.4,12.6,0,12,0z M8,13c0,0.6-0.4,1-1,1H3c-0.6,0-1-0.4-1-1V7c0-0.6,0.4-1,1-1h4c0.6,0,1,0.4,1,1V13z M11,9c0,0.6-0.4,1-1,1V5\n c0-0.6-0.4-1-1-1H5V3c0-0.6,0.4-1,1-1h4c0.6,0,1,0.4,1,1V9z"/>\n </svg>\n </div>\n <div>\n <h5>Private Key</h5>\n <h4>${t.privKey}</h4>\n <svg onclick="copyToClipboard(this.parentNode, '1')" viewBox="0 0 13 16" style="enable-background:new 0 0 13 16;" xml:space="preserve">\n <title>Copy private key</title>\n <path d="M12,0H4C3.4,0,3,0.4,3,1v3H1C0.4,4,0,4.4,0,5v10c0,0.6,0.4,1,1,1h8c0.6,0,1-0.4,1-1v-3h2c0.6,0,1-0.4,1-1V1\n C13,0.4,12.6,0,12,0z M8,13c0,0.6-0.4,1-1,1H3c-0.6,0-1-0.4-1-1V7c0-0.6,0.4-1,1-1h4c0.6,0,1,0.4,1,1V13z M11,9c0,0.6-0.4,1-1,1V5\n c0-0.6-0.4-1-1-1H5V3c0-0.6,0.4-1,1-1h4c0.6,0,1,0.4,1,1V9z"/>\n </svg>\n </div>`,e.insertBefore(n,e.firstChild),fadeout()}).catch(t=>{alert("invalid private key"),console.log(t)})}function backToMonitoringPage(){let t=document.getElementById("transactions-container");for(;t.lastChild;)t.removeChild(t.lastChild);showPage("getDataBtn","getData"),initial=0,limit=10,document.getElementById("transactions-container").removeEventListener("scroll",scrollingEvent)}function monitorData(t,e){document.getElementById("dispMsg");let n=document.getElementById("transactions-container");n.innerHTML='<loading>\n <svg viewBox="0 0 16 16" style="enable-background:new 0 0 16 16;" xml:space="preserve">\n <g>\n <path class=\'p1\' d="M8,0C3.6,0,0,3.6,0,8s3.6,8,8,8s8-3.6,8-8S12.4,0,8,0z M8,14c-3.3,0-6-2.7-6-6s2.7-6,6-6s6,2.7,6,6\n S11.3,14,8,14z"/>\n <path class=\'p2\' d="M6.5,13.8c-2.2-0.5-3.9-2.3-4.4-4.5c-0.7-3.6,1.7-6.8,5-7.2C7.6,2,8,1.6,8,1.1v0c0-0.6-0.5-1.1-1.1-1\n C2.5,0.7-0.8,4.9,0.2,9.6c0.6,3.1,2.9,5.5,6,6.2c4.8,1.1,9.1-2.2,9.8-6.7C16,8.5,15.5,8,14.9,8h0c-0.5,0-0.9,0.4-1,0.9\n C13.5,12.2,10.2,14.7,6.5,13.8z"/>\n </g>\n </svg>\n </loading>',document.querySelector("loading").children[0].classList.add("spin"),document.getElementById("addressLabel").textContent=e,document.getElementById("fullAddress").textContent=t,floWebWallet.readTransactions(t).then(e=>{if(void 0===e)n.innerHTML="<div style='display:flex; align-content: center;width: 100%;height:100%'><h3 style='display:flexbox;align-self:center;text-align: center;width:100%'>Data is not synced yet, Try again after sometime.</h3></div>";else if(0===e.length)n.innerHTML="<div style='display:flex; align-content: center;width: 100%;height:100%'><h3 style='display:flexbox;align-self:center;text-align: center;width:100%'>There are no transactions to show.</h3></div>";else if(e.reverse(),document.querySelector("loading").children[0].classList.remove("spin"),n.innerHTML="",e.length<10)limit=e.length,n.appendChild(createTransactionCard(t,e));else{let i;scrollingEvent=n.addEventListener("scroll",t=>{clearTimeout(i),i=setTimeout(()=>{n.scrollTop>window.innerHeight?document.getElementById("scrollToTop").classList.add("show"):document.getElementById("scrollToTop").classList.remove("show")},200)}),n.appendChild(createTransactionCard(t,e));const r=i=>{new IntersectionObserver((i,o)=>{i.forEach(i=>{i.isIntersecting&&i.target==n.lastElementChild&&e.length>=limit&&(n.appendChild(createTransactionCard(t,e)),document.querySelectorAll("transaction-card").forEach(r),o.disconnect())})}).observe(i)};document.querySelectorAll("transaction-card").forEach(r)}}).catch(t=>{console.log(t),alert(t)})}function createTransactionCard(t,e){let n=document.createDocumentFragment();floWebWallet.getLabels();for(;initial<limit;initial++){let i=new Date(1e3*e[initial].time).toLocaleDateString(),r=new Date(1e3*e[initial].time).toLocaleTimeString(),o=document.createElement("transaction-card");e[initial].sender===t?o.innerHTML=`<div>\n <svg viewBox="0 0 16 16" style="enable-background:new 0 0 16 16;" xml:space="preserve">\n <path d="M14.7,0H3.9C3.2,0,2.6,0.6,2.6,1.3s0.6,1.3,1.3,1.3h7.5l-11,11c-0.5,0.5-0.5,1.4,0,1.9c0.5,0.5,1.4,0.5,1.9,0\n l11-11v7.5c0,0.7,0.6,1.3,1.3,1.3s1.3-0.6,1.3-1.3V1.3C16,0.6,15.4,0,14.7,0z"/>\n </svg>\n ${e[initial].receiver}</div><div> ${e[initial].floData}</div><div>${r} ${i}</div>`:o.innerHTML=`<div>\n <svg viewBox="0 0 16 16" style="enable-background:new 0 0 16 16;" xml:space="preserve">\n <path d="M16,14.7V3.9c0-0.7-0.6-1.3-1.3-1.3s-1.3,0.6-1.3,1.3v7.5l-11-11c-0.5-0.5-1.4-0.5-1.9,0\n c-0.5,0.5-0.5,1.4,0,1.9l11,11H3.9c-0.7,0-1.3,0.6-1.3,1.3S3.2,16,3.9,16h10.7C15.4,16,16,15.4,16,14.7z"/>\n </svg>\n ${e[initial].sender}</div><div> ${e[initial].floData}</div><div> ${r} ${i}</div>`,n.appendChild(o)}return limit+=10,e.length-e.length%10==limit&&(limit+=e.length%10),n}function refreshdata(){initial=0,limit=10,floWebWallet.syncTransactions(document.getElementById("fullAddress").textContent),monitorData(document.getElementById("fullAddress").textContent,document.getElementById("addressLabel").textContent)}function createAddressCards(t,e){let n=document.getElementById("monitor-list");'<h3 style="text-align: center;width: 100%;">Add a FLO address to start monitoring</h3>'===n.innerHTML&&(n.innerHTML="");let i=document.createElement("monitor");i.id=t,i.innerHTML=`<div>${e}</div>\n <div>${t}</div>\n <div onclick="clickedAddress(this.parentNode)"></div>\n <svg class='edit-options' onclick="showEdit(this.parentNode)" viewBox="0 0 4 16" style="enable-background:new 0 0 4 16;" xml:space="preserve">\n <title>Edit address card</title>\n <g>\n <circle cx="2" cy="2" r="2"/>\n <circle cx="2" cy="14" r="2"/>\n <circle cx="2" cy="8" r="2"/>\n </g>\n </svg>`,n.appendChild(i)}function showEdit(t){activeAddress=t,newAddrLabel=document.getElementById("newAddrLabel"),document.getElementById("edit-container").classList.add("show");let e=document.getElementById("edit");e.classList.add("slide-up"),newAddrLabel.focus(),e.children[0].textContent=t.children[1].textContent,newAddrLabel.value=t.children[0].textContent;let n=document.addEventListener("click",function(t){t.target.closest("#edit")||t.target.closest(".edit-options")||(closeEdit(),document.removeEventListener("click",n))})}function editdata(){let t=document.getElementById("edit"),e=newAddrLabel.value;""==e&&(e="Unknown"),compactIDB.writeData("labels",e,t.children[0].textContent).then(t=>{activeAddress.children[0].textContent=e,closeEdit()}).catch(t=>{console.log(t)})}function removedata(){confirm("Do you want to delete this address?")&&(activeAddress.remove(),compactIDB.removeData("labels",activeAddress.children[1].textContent)),closeEdit()}function closeEdit(){document.getElementById("edit-container").classList.remove("show"),document.getElementById("edit").classList.remove("slide-up"),newAddrLabel.value="",document.getElementById("showBalance").textContent=""}function createAllCards(){floWebWallet.getLabels().then(t=>{0===Object.entries(t).length?document.getElementById("monitor-list").innerHTML='<h3 style="text-align: center;width: 100%;">Add a FLO address to start monitoring</h3>':Object.keys(t).forEach(e=>{createAddressCards(e,t[e]),floWebWallet.syncTransactions(e).then(t=>{if(t.length>0){let n=document.createElement("badge"),i=t.length;i>99&&(i="99+"),n.textContent=i,document.getElementById(e).appendChild(n)}}).catch(t=>{console.log(t)})})}).catch(t=>{console.log(t)})}function validateInfo(t){floCrypto.validateAddr(t.value)?document.getElementById("sendBtn").disabled=!1:document.getElementById("sendBtn").disabled=!0}function showPrivKeyPage(){document.getElementById("privKey").focus(),showInnerPage("privKeyPage")}function sendMessage(){let t=document.getElementById("getBal_addr").value,e=parseFloat(document.getElementById("amount").value),n=document.getElementById("receiver").value,i=document.getElementById("flotextdata").value,r=document.getElementById("privKey").value;floWebWallet.sendTransaction(t,n,e,i,r).then(t=>{document.getElementById("transactionId").textContent=`transaction ID : ${t}`,showInnerPage("transaction-complete")}).catch(t=>{alert(t)})}function deleteDB(){compactIDB.deleteDB().then(t=>{alert(t),onLoadStartUp()}).catch(t=>{alert(t)})}function copyToClipboard(t,e){let n=document.createElement("textarea"),i=document.getElementById("textCopied");n.setAttribute("readonly",""),n.setAttribute("style","position: absolute; left: -9999px"),document.body.appendChild(n),n.value=t.children[e].textContent,n.select(),document.execCommand("copy"),document.body.removeChild(n),i.classList.add("show"),setTimeout(()=>{i.classList.remove("show")},1e3)}function backToTop(){console.log("hey"),document.getElementById("transactions-container").scrollTop=0}function ascii_to_hexa(t){for(var e=[],n=0,i=t.length;n<i;n++){var r=Number(t.charCodeAt(n)).toString(16);e.push(r)}return e.join("")}"yes"===localStorage.dark?(nightlight(),document.getElementById("manual-mode").checked=!0,clearInterval(mode)):"auto"===localStorage.dark?(document.getElementById("auto-mode").checked=!0,document.getElementById("manual-mode").checked=!1,autoMode(),mode=setInterval(()=>{let t=(new Date).getHours();console.log(t),t>6&&t<18?daylight():nightlight()},6e4)):(daylight(),document.getElementById("manual-mode").checked=!1,clearInterval(mode)),document.getElementById("showRecoveryModal").onclick=function(){document.getElementById("overlay").classList.add("show"),document.getElementById("popup").classList.add("slide-up"),window.innerWidth>768&&document.getElementById("pop").focus();let t=document.addEventListener("click",function(e){e.target.closest("#popup")||e.target.closest("#showRecoveryModal")||(fadeout(),document.removeEventListener("click",t))})},document.getElementById("pop").addEventListener("keypress",function(t){13==t.keyCode&&document.getElementById("ok").click()}),document.getElementById("getBal_addr").addEventListener("keypress",function(t){13==t.keyCode&&document.getElementById("getBal_btn").click()}),addrLabel.addEventListener("keypress",function(t){13==t.keyCode&&document.getElementById("addAddressToMonitor").click()}),floAddr.addEventListener("keypress",function(t){13==t.keyCode&&document.getElementById("addAddressToMonitor").click()}),newAddrLabel.addEventListener("keypress",t=>{13==t.keyCode&&editdata()}),document.getElementById("menu").addEventListener("click",function(){window.innerWidth>768&&bottomNav.classList.toggle("reveal"),document.getElementById("overlay2").classList.toggle("show");let t=document.addEventListener("click",function(e){e.target.closest("#menu")||e.target.closest("#bottom-nav")||(closeSidePanel(),document.removeEventListener("click",t))})}),document.getElementById("addNewAddress").onclick=function(){showAdd();let t=document.addEventListener("click",function(e){e.target.closest("#add")||e.target.closest("#addNewAddress")||(closeAdd(),document.removeEventListener("click",t))})},document.getElementById(recentPage).click(),window.addEventListener("resize",()=>{clearTimeout(resizeComplete),resizeComplete=setTimeout(()=>{setElements()},200)}),document.getElementById("GenNewAddrBtn").addEventListener("click",()=>{let t=floCrypto.generateNewID(),e=document.getElementById("addrDisp"),n=document.createElement("card");n.classList.add("highlight"),n.innerHTML=`<div>\n <h5>New FLO Address</h5>\n <h4>${t.floID}</h4>\n <svg onclick="copyToClipboard(this.parentNode, '1')" viewBox="0 0 13 16" style="enable-background:new 0 0 13 16;" xml:space="preserve">\n <title>Copy FLO address</title>\n <path d="M12,0H4C3.4,0,3,0.4,3,1v3H1C0.4,4,0,4.4,0,5v10c0,0.6,0.4,1,1,1h8c0.6,0,1-0.4,1-1v-3h2c0.6,0,1-0.4,1-1V1\n C13,0.4,12.6,0,12,0z M8,13c0,0.6-0.4,1-1,1H3c-0.6,0-1-0.4-1-1V7c0-0.6,0.4-1,1-1h4c0.6,0,1,0.4,1,1V13z M11,9c0,0.6-0.4,1-1,1V5\n c0-0.6-0.4-1-1-1H5V3c0-0.6,0.4-1,1-1h4c0.6,0,1,0.4,1,1V9z"/>\n </svg>\n </div>\n <div><h5>Private Key</h5>\n <h4>${t.privKey}</h4>\n <svg onclick="copyToClipboard(this.parentNode, '1')" viewBox="0 0 13 16" style="enable-background:new 0 0 13 16;" xml:space="preserve">\n <title>Copy private key</title>\n <path d="M12,0H4C3.4,0,3,0.4,3,1v3H1C0.4,4,0,4.4,0,5v10c0,0.6,0.4,1,1,1h8c0.6,0,1-0.4,1-1v-3h2c0.6,0,1-0.4,1-1V1\n C13,0.4,12.6,0,12,0z M8,13c0,0.6-0.4,1-1,1H3c-0.6,0-1-0.4-1-1V7c0-0.6,0.4-1,1-1h4c0.6,0,1,0.4,1,1V13z M11,9c0,0.6-0.4,1-1,1V5\n c0-0.6-0.4-1-1-1H5V3c0-0.6,0.4-1,1-1h4c0.6,0,1,0.4,1,1V9z"/>\n </svg>\n </div>`,e.insertBefore(n,e.firstChild),n.addEventListener("animationEnd",function(){n.classList.remove("highlight")}),n.addEventListener("webkitAnimationEnd",function(){n.classList.remove("highlight")})}),"undefined"!=typeof Crypto&&Crypto.util||function(){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=window.Crypto={},n=e.util={rotl:function(t,e){return t<<e|t>>>32-e},rotr:function(t,e){return t<<32-e|t>>>e},endian:function(t){if(t.constructor==Number)return 16711935&n.rotl(t,8)|4278255360&n.rotl(t,24);for(var e=0;e<t.length;e++)t[e]=n.endian(t[e]);return t},randomBytes:function(t){for(var e=[];t>0;t--)e.push(Math.floor(256*Math.random()));return e},bytesToWords:function(t){for(var e=[],n=0,i=0;n<t.length;n++,i+=8)e[i>>>5]|=(255&t[n])<<24-i%32;return e},wordsToBytes:function(t){for(var e=[],n=0;n<32*t.length;n+=8)e.push(t[n>>>5]>>>24-n%32&255);return e},bytesToHex:function(t){for(var e=[],n=0;n<t.length;n++)e.push((t[n]>>>4).toString(16)),e.push((15&t[n]).toString(16));return e.join("")},hexToBytes:function(t){for(var e=[],n=0;n<t.length;n+=2)e.push(parseInt(t.substr(n,2),16));return e},bytesToBase64:function(e){for(var n=[],i=0;i<e.length;i+=3)for(var r=e[i]<<16|e[i+1]<<8|e[i+2],o=0;o<4;o++)8*i+6*o<=8*e.length?n.push(t.charAt(r>>>6*(3-o)&63)):n.push("=");return n.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var n=[],i=0,r=0;i<e.length;r=++i%4)0!=r&&n.push((t.indexOf(e.charAt(i-1))&Math.pow(2,-2*r+8)-1)<<2*r|t.indexOf(e.charAt(i))>>>6-2*r);return n}},i=e.charenc={},r=(i.UTF8={stringToBytes:function(t){return r.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(r.bytesToString(t)))}},i.Binary={stringToBytes:function(t){for(var e=[],n=0;n<t.length;n++)e.push(255&t.charCodeAt(n));return e},bytesToString:function(t){for(var e=[],n=0;n<t.length;n++)e.push(String.fromCharCode(t[n]));return e.join("")}})}(),function(){var t=Crypto,e=t.util,n=t.charenc,i=n.UTF8,r=n.Binary,o=t.SHA1=function(t,n){var i=e.wordsToBytes(o._sha1(t));return n&&n.asBytes?i:n&&n.asString?r.bytesToString(i):e.bytesToHex(i)};o._sha1=function(t){t.constructor==String&&(t=i.stringToBytes(t));var n=e.bytesToWords(t),r=8*t.length,o=[],s=1732584193,a=-271733879,u=-1732584194,c=271733878,l=-1009589776;n[r>>5]|=128<<24-r%32,n[15+(r+64>>>9<<4)]=r;for(var d=0;d<n.length;d+=16){for(var h=s,p=a,f=u,g=c,m=l,y=0;y<80;y++){if(y<16)o[y]=n[d+y];else{var v=o[y-3]^o[y-8]^o[y-14]^o[y-16];o[y]=v<<1|v>>>31}var B=(s<<5|s>>>27)+l+(o[y]>>>0)+(y<20?1518500249+(a&u|~a&c):y<40?1859775393+(a^u^c):y<60?(a&u|a&c|u&c)-1894007588:(a^u^c)-899497514);l=c,c=u,u=a<<30|a>>>2,a=s,s=B}s+=h,a+=p,u+=f,c+=g,l+=m}return[s,a,u,c,l]},o._blocksize=16,o._digestsize=20}(),function(){var t=Crypto,e=t.util,n=t.charenc,i=n.UTF8,r=n.Binary;t.HMAC=function(t,n,o,s){n.constructor==String&&(n=i.stringToBytes(n)),o.constructor==String&&(o=i.stringToBytes(o)),o.length>4*t._blocksize&&(o=t(o,{asBytes:!0}));for(var a=o.slice(0),u=o.slice(0),c=0;c<4*t._blocksize;c++)a[c]^=92,u[c]^=54;var l=t(a.concat(t(u.concat(n),{asBytes:!0})),{asBytes:!0});return s&&s.asBytes?l:s&&s.asString?r.bytesToString(l):e.bytesToHex(l)}}(),("undefined"==typeof Crypto||!Crypto.util)&&function(){var t,e=(t=window.Crypto={}).util={rotl:function(t,e){return t<<e|t>>>32-e},rotr:function(t,e){return t<<32-e|t>>>e},endian:function(t){if(t.constructor==Number)return 16711935&e.rotl(t,8)|4278255360&e.rotl(t,24);for(var n=0;n<t.length;n++)t[n]=e.endian(t[n]);return t},randomBytes:function(t){for(var e=[];t>0;t--)e.push(Math.floor(256*Math.random()));return e},bytesToWords:function(t){for(var e=[],n=0,i=0;n<t.length;n++,i+=8)e[i>>>5]|=(255&t[n])<<24-i%32;return e},wordsToBytes:function(t){for(var e=[],n=0;n<32*t.length;n+=8)e.push(t[n>>>5]>>>24-n%32&255);return e},bytesToHex:function(t){for(var e=[],n=0;n<t.length;n++)e.push((t[n]>>>4).toString(16)),e.push((15&t[n]).toString(16));return e.join("")},hexToBytes:function(t){for(var e=[],n=0;n<t.length;n+=2)e.push(parseInt(t.substr(n,2),16));return e},bytesToBase64:function(t){for(var e=[],n=0;n<t.length;n+=3)for(var i=t[n]<<16|t[n+1]<<8|t[n+2],r=0;r<4;r++)8*n+6*r<=8*t.length?e.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(i>>>6*(3-r)&63)):e.push("=");return e.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var e=[],n=0,i=0;n<t.length;i=++n%4)0!=i&&e.push(("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(t.charAt(n-1))&Math.pow(2,-2*i+8)-1)<<2*i|"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(t.charAt(n))>>>6-2*i);return e}};(t=t.charenc={}).UTF8={stringToBytes:function(t){return n.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(n.bytesToString(t)))}};var n=t.Binary={stringToBytes:function(t){for(var e=[],n=0;n<t.length;n++)e.push(255&t.charCodeAt(n));return e},bytesToString:function(t){for(var e=[],n=0;n<t.length;n++)e.push(String.fromCharCode(t[n]));return e.join("")}}}(),function(){var t=Crypto,e=t.util,n=t.charenc,i=n.UTF8,r=n.Binary,o=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],s=t.SHA256=function(t,n){var i=e.wordsToBytes(s._sha256(t));return n&&n.asBytes?i:n&&n.asString?r.bytesToString(i):e.bytesToHex(i)};s._sha256=function(t){t.constructor==String&&(t=i.stringToBytes(t));var n,r,s,a,u,c,l,d,h,p,f,g=e.bytesToWords(t),m=8*t.length,y=(t=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],[]);for(g[m>>5]|=128<<24-m%32,g[15+(m+64>>9<<4)]=m,d=0;d<g.length;d+=16){for(m=t[0],n=t[1],r=t[2],s=t[3],a=t[4],u=t[5],c=t[6],l=t[7],h=0;h<64;h++){h<16?y[h]=g[h+d]:(p=y[h-15],f=y[h-2],y[h]=((p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3)+(y[h-7]>>>0)+((f<<15|f>>>17)^(f<<13|f>>>19)^f>>>10)+(y[h-16]>>>0)),f=m&n^m&r^n&r;var v=(m<<30|m>>>2)^(m<<19|m>>>13)^(m<<10|m>>>22);p=(l>>>0)+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&u^~a&c)+o[h]+(y[h]>>>0),l=c,c=u,u=a,a=s+p>>>0,s=r,r=n,n=m,m=p+(f=v+f)>>>0}t[0]+=m,t[1]+=n,t[2]+=r,t[3]+=s,t[4]+=a,t[5]+=u,t[6]+=c,t[7]+=l}return t},s._blocksize=16,s._digestsize=32}(),function(){var t=Crypto,e=t.util,n=t.charenc,i=n.UTF8,r=n.Binary;t.HMAC=function(t,n,o,s){n.constructor==String&&(n=i.stringToBytes(n)),o.constructor==String&&(o=i.stringToBytes(o)),o.length>4*t._blocksize&&(o=t(o,{asBytes:!0}));for(var a=o.slice(0),u=(o=o.slice(0),0);u<4*t._blocksize;u++)a[u]^=92,o[u]^=54;return t=t(a.concat(t(o.concat(n),{asBytes:!0})),{asBytes:!0}),s&&s.asBytes?t:s&&s.asString?r.bytesToString(t):e.bytesToHex(t)}}(),function(){var t=window.SecureRandom=function(){};if(t.state,t.pool,t.pptr,t.poolCopyOnInit,t.poolSize=256,t.prototype.nextBytes=function(e){var n;if(window.crypto&&window.crypto.getRandomValues&&window.Uint8Array)try{var i=new Uint8Array(e.length);for(window.crypto.getRandomValues(i),n=0;n<e.length;++n)e[n]=t.getByte()^i[n];return}catch(t){alert(t)}for(n=0;n<e.length;++n)e[n]=t.getByte()},t.seedTime=function(){t.seedInt((new Date).getTime())},t.getByte=function(){if(null==t.state){for(t.seedTime(),t.state=t.ArcFour(),t.state.init(t.pool),t.poolCopyOnInit=[],t.pptr=0;t.pptr<t.pool.length;++t.pptr)t.poolCopyOnInit[t.pptr]=t.pool[t.pptr];t.pptr=0}return t.state.next()},t.seedInt=function(e){t.seedInt8(e),t.seedInt8(e>>8),t.seedInt8(e>>16),t.seedInt8(e>>24)},t.seedInt16=function(e){t.seedInt8(e),t.seedInt8(e>>8)},t.seedInt8=function(e){t.pool[t.pptr++]^=255&e,t.pptr>=t.poolSize&&(t.pptr-=t.poolSize)},t.ArcFour=function(){function t(){this.i=0,this.j=0,this.S=new Array}return t.prototype.init=function(t){var e,n,i;for(e=0;e<256;++e)this.S[e]=e;for(n=0,e=0;e<256;++e)n=n+this.S[e]+t[e%t.length]&255,i=this.S[e],this.S[e]=this.S[n],this.S[n]=i;this.i=0,this.j=0},t.prototype.next=function(){var t;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,t=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=t,this.S[t+this.S[this.i]&255]},new t},null==t.pool){var e;if(t.pool=new Array,t.pptr=0,window.crypto&&window.crypto.getRandomValues&&window.Uint8Array)try{var n=new Uint8Array(t.poolSize);for(window.crypto.getRandomValues(n),e=0;e<t.poolSize;++e)t.pool[t.pptr++]=n[e]}catch(t){alert(t)}for(;t.pptr<t.poolSize;)e=Math.floor(65536*Math.random()),t.pool[t.pptr++]=e>>>8,t.pool[t.pptr++]=255&e;t.pptr=Math.floor(t.poolSize*Math.random()),t.seedTime();var i="";i+=window.screen.height*window.screen.width*window.screen.colorDepth,i+=window.screen.availHeight*window.screen.availWidth*window.screen.pixelDepth,i+=(new Date).getTimezoneOffset(),i+=navigator.userAgent;for(var r="",o=0;o<navigator.plugins.length;o++)r+=navigator.plugins[o].name+" "+navigator.plugins[o].filename+" "+navigator.plugins[o].description+" "+navigator.plugins[o].version+", ";var s="";for(o=0;o<navigator.mimeTypes.length;o++)s+=navigator.mimeTypes[o].description+" "+navigator.mimeTypes[o].type+" "+navigator.mimeTypes[o].suffixes+", ";i+=r+s,i+=navigator.cookieEnabled+typeof sessionStorage+typeof localStorage,i+=navigator.language,i+=window.history.length,i+=window.location;var a=Crypto.SHA256(i,{asBytes:!0});for(o=0;o<a.length;o++)t.seedInt8(a[o])}}();var zl=[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],zr=[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],sl=[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],sr=[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],hl=[0,1518500249,1859775393,2400959708,2840853838],hr=[1352829926,1548603684,1836072691,2053994217,0],bytesToWords=function(t){for(var e=[],n=0,i=0;n<t.length;n++,i+=8)e[i>>>5]|=t[n]<<24-i%32;return e},wordsToBytes=function(t){for(var e=[],n=0;n<32*t.length;n+=8)e.push(t[n>>>5]>>>24-n%32&255);return e},processBlock=function(t,e,n){for(var i=0;i<16;i++){var r=n+i,o=e[r];e[r]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8)}var s,a,u,c,l,d,h,p,f,g,m;d=s=t[0],h=a=t[1],p=u=t[2],f=c=t[3],g=l=t[4];for(i=0;i<80;i+=1)m=s+e[n+zl[i]]|0,m+=i<16?f1(a,u,c)+hl[0]:i<32?f2(a,u,c)+hl[1]:i<48?f3(a,u,c)+hl[2]:i<64?f4(a,u,c)+hl[3]:f5(a,u,c)+hl[4],m=(m=rotl(m|=0,sl[i]))+l|0,s=l,l=c,c=rotl(u,10),u=a,a=m,m=d+e[n+zr[i]]|0,m+=i<16?f5(h,p,f)+hr[0]:i<32?f4(h,p,f)+hr[1]:i<48?f3(h,p,f)+hr[2]:i<64?f2(h,p,f)+hr[3]:f1(h,p,f)+hr[4],m=(m=rotl(m|=0,sr[i]))+g|0,d=g,g=f,f=rotl(p,10),p=h,h=m;m=t[1]+u+f|0,t[1]=t[2]+c+g|0,t[2]=t[3]+l+d|0,t[3]=t[4]+s+h|0,t[4]=t[0]+a+p|0,t[0]=m};function f1(t,e,n){return t^e^n}function f2(t,e,n){return t&e|~t&n}function f3(t,e,n){return(t|~e)^n}function f4(t,e,n){return t&n|e&~n}function f5(t,e,n){return t^(e|~n)}function rotl(t,e){return t<<e|t>>>32-e}function ripemd160(t){var e=[1732584193,4023233417,2562383102,271733878,3285377520],n=bytesToWords(t),i=8*t.length,r=8*t.length;n[i>>>5]|=128<<24-i%32,n[14+(i+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8);for(var o=0;o<n.length;o+=16)processBlock(e,n,o);for(o=0;o<5;o++){var s=e[o];e[o]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}return wordsToBytes(e)}!function(){var t,e=window.BigInteger=function t(e,n,i){if(!(this instanceof t))return new t(e,n,i);null!=e&&("number"==typeof e?this.fromNumber(e,n,i):null==n&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,n))};function n(){return new e(null)}"Microsoft Internet Explorer"==navigator.appName?(e.prototype.am=function(t,e,n,i,r,o){for(var s=32767&e,a=e>>15;--o>=0;){var u=32767&this[t],c=this[t++]>>15,l=a*u+c*s;r=((u=s*u+((32767&l)<<15)+n[i]+(1073741823&r))>>>30)+(l>>>15)+a*c+(r>>>30),n[i++]=1073741823&u}return r},t=30):"Netscape"!=navigator.appName?(e.prototype.am=function(t,e,n,i,r,o){for(;--o>=0;){var s=e*this[t++]+n[i]+r;r=Math.floor(s/67108864),n[i++]=67108863&s}return r},t=26):(e.prototype.am=function(t,e,n,i,r,o){for(var s=16383&e,a=e>>14;--o>=0;){var u=16383&this[t],c=this[t++]>>14,l=a*u+c*s;r=((u=s*u+((16383&l)<<14)+n[i]+r)>>28)+(l>>14)+a*c,n[i++]=268435455&u}return r},t=28),e.prototype.DB=t,e.prototype.DM=(1<<t)-1,e.prototype.DV=1<<t;e.prototype.FV=Math.pow(2,52),e.prototype.F1=52-t,e.prototype.F2=2*t-52;var i,r,o="0123456789abcdefghijklmnopqrstuvwxyz",s=new Array;for(i="0".charCodeAt(0),r=0;r<=9;++r)s[i++]=r;for(i="a".charCodeAt(0),r=10;r<36;++r)s[i++]=r;for(i="A".charCodeAt(0),r=10;r<36;++r)s[i++]=r;function a(t){return o.charAt(t)}function u(t,e){var n=s[t.charCodeAt(e)];return null==n?-1:n}function c(t){var e=n();return e.fromInt(t),e}function l(t){var e,n=1;return 0!=(e=t>>>16)&&(t=e,n+=16),0!=(e=t>>8)&&(t=e,n+=8),0!=(e=t>>4)&&(t=e,n+=4),0!=(e=t>>2)&&(t=e,n+=2),0!=(e=t>>1)&&(t=e,n+=1),n}function d(t){if(0==t)return-1;var e=0;return 0==(65535&t)&&(t>>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function h(t){for(var e=0;0!=t;)t&=t-1,++e;return e}e.prototype.copyTo=function(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s},e.prototype.fromInt=function(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0},e.prototype.fromString=function(t,n){var i;if(16==n)i=4;else if(8==n)i=3;else if(256==n)i=8;else if(2==n)i=1;else if(32==n)i=5;else{if(4!=n)return void this.fromRadix(t,n);i=2}this.t=0,this.s=0;for(var r=t.length,o=!1,s=0;--r>=0;){var a=8==i?255&t[r]:u(t,r);a<0?"-"==t.charAt(r)&&(o=!0):(o=!1,0==s?this[this.t++]=a:s+i>this.DB?(this[this.t-1]|=(a&(1<<this.DB-s)-1)<<s,this[this.t++]=a>>this.DB-s):this[this.t-1]|=a<<s,(s+=i)>=this.DB&&(s-=this.DB))}8==i&&0!=(128&t[0])&&(this.s=-1,s>0&&(this[this.t-1]|=(1<<this.DB-s)-1<<s)),this.clamp(),o&&e.ZERO.subTo(this,this)},e.prototype.clamp=function(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t},e.prototype.dlShiftTo=function(t,e){var n;for(n=this.t-1;n>=0;--n)e[n+t]=this[n];for(n=t-1;n>=0;--n)e[n]=0;e.t=this.t+t,e.s=this.s},e.prototype.drShiftTo=function(t,e){for(var n=t;n<this.t;++n)e[n-t]=this[n];e.t=Math.max(this.t-t,0),e.s=this.s},e.prototype.lShiftTo=function(t,e){var n,i=t%this.DB,r=this.DB-i,o=(1<<r)-1,s=Math.floor(t/this.DB),a=this.s<<i&this.DM;for(n=this.t-1;n>=0;--n)e[n+s+1]=this[n]>>r|a,a=(this[n]&o)<<i;for(n=s-1;n>=0;--n)e[n]=0;e[s]=a,e.t=this.t+s+1,e.s=this.s,e.clamp()},e.prototype.rShiftTo=function(t,e){e.s=this.s;var n=Math.floor(t/this.DB);if(n>=this.t)e.t=0;else{var i=t%this.DB,r=this.DB-i,o=(1<<i)-1;e[0]=this[n]>>i;for(var s=n+1;s<this.t;++s)e[s-n-1]|=(this[s]&o)<<r,e[s-n]=this[s]>>i;i>0&&(e[this.t-n-1]|=(this.s&o)<<r),e.t=this.t-n,e.clamp()}},e.prototype.subTo=function(t,e){for(var n=0,i=0,r=Math.min(t.t,this.t);n<r;)i+=this[n]-t[n],e[n++]=i&this.DM,i>>=this.DB;if(t.t<this.t){for(i-=t.s;n<this.t;)i+=this[n],e[n++]=i&this.DM,i>>=this.DB;i+=this.s}else{for(i+=this.s;n<t.t;)i-=t[n],e[n++]=i&this.DM,i>>=this.DB;i-=t.s}e.s=i<0?-1:0,i<-1?e[n++]=this.DV+i:i>0&&(e[n++]=i),e.t=n,e.clamp()},e.prototype.multiplyTo=function(t,n){var i=this.abs(),r=t.abs(),o=i.t;for(n.t=o+r.t;--o>=0;)n[o]=0;for(o=0;o<r.t;++o)n[o+i.t]=i.am(0,r[o],n,o,0,i.t);n.s=0,n.clamp(),this.s!=t.s&&e.ZERO.subTo(n,n)},e.prototype.squareTo=function(t){for(var e=this.abs(),n=t.t=2*e.t;--n>=0;)t[n]=0;for(n=0;n<e.t-1;++n){var i=e.am(n,e[n],t,2*n,0,1);(t[n+e.t]+=e.am(n+1,2*e[n],t,2*n+1,i,e.t-n-1))>=e.DV&&(t[n+e.t]-=e.DV,t[n+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(n,e[n],t,2*n,0,1)),t.s=0,t.clamp()},e.prototype.divRemTo=function(t,i,r){var o=t.abs();if(!(o.t<=0)){var s=this.abs();if(s.t<o.t)return null!=i&&i.fromInt(0),void(null!=r&&this.copyTo(r));null==r&&(r=n());var a=n(),u=this.s,c=t.s,d=this.DB-l(o[o.t-1]);d>0?(o.lShiftTo(d,a),s.lShiftTo(d,r)):(o.copyTo(a),s.copyTo(r));var h=a.t,p=a[h-1];if(0!=p){var f=p*(1<<this.F1)+(h>1?a[h-2]>>this.F2:0),g=this.FV/f,m=(1<<this.F1)/f,y=1<<this.F2,v=r.t,B=v-h,b=null==i?n():i;for(a.dlShiftTo(B,b),r.compareTo(b)>=0&&(r[r.t++]=1,r.subTo(b,r)),e.ONE.dlShiftTo(h,b),b.subTo(a,a);a.t<h;)a[a.t++]=0;for(;--B>=0;){var w=r[--v]==p?this.DM:Math.floor(r[v]*g+(r[v-1]+y)*m);if((r[v]+=a.am(0,w,r,B,0,h))<w)for(a.dlShiftTo(B,b),r.subTo(b,r);r[v]<--w;)r.subTo(b,r)}null!=i&&(r.drShiftTo(h,i),u!=c&&e.ZERO.subTo(i,i)),r.t=h,r.clamp(),d>0&&r.rShiftTo(d,r),u<0&&e.ZERO.subTo(r,r)}}},e.prototype.invDigit=function(){if(this.t<1)return 0;var t=this[0];if(0==(1&t))return 0;var e=3&t;return(e=(e=(e=(e=e*(2-(15&t)*e)&15)*(2-(255&t)*e)&255)*(2-((65535&t)*e&65535))&65535)*(2-t*e%this.DV)%this.DV)>0?this.DV-e:-e},e.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},e.prototype.exp=function(t,i){if(t>4294967295||t<1)return e.ONE;var r=n(),o=n(),s=i.convert(this),a=l(t)-1;for(s.copyTo(r);--a>=0;)if(i.sqrTo(r,o),(t&1<<a)>0)i.mulTo(o,s,r);else{var u=r;r=o,o=u}return i.revert(r)},e.prototype.toString=function(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return this.toRadix(t);e=2}var n,i=(1<<e)-1,r=!1,o="",s=this.t,u=this.DB-s*this.DB%e;if(s-- >0)for(u<this.DB&&(n=this[s]>>u)>0&&(r=!0,o=a(n));s>=0;)u<e?(n=(this[s]&(1<<u)-1)<<e-u,n|=this[--s]>>(u+=this.DB-e)):(n=this[s]>>(u-=e)&i,u<=0&&(u+=this.DB,--s)),n>0&&(r=!0),r&&(o+=a(n));return r?o:"0"},e.prototype.negate=function(){var t=n();return e.ZERO.subTo(this,t),t},e.prototype.abs=function(){return this.s<0?this.negate():this},e.prototype.compareTo=function(t){var e=this.s-t.s;if(0!=e)return e;var n=this.t;if(0!=(e=n-t.t))return this.s<0?-e:e;for(;--n>=0;)if(0!=(e=this[n]-t[n]))return e;return 0},e.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+l(this[this.t-1]^this.s&this.DM)},e.prototype.mod=function(t){var i=n();return this.abs().divRemTo(t,null,i),this.s<0&&i.compareTo(e.ZERO)>0&&t.subTo(i,i),i},e.prototype.modPowInt=function(t,e){var n;return n=t<256||e.isEven()?new B(e):new b(e),this.exp(t,n)},e.ZERO=c(0),e.ONE=c(1);var p=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],f=(1<<26)/p[p.length-1];function g(t,e){return t&e}function m(t,e){return t|e}function y(t,e){return t^e}function v(t,e){return t&~e}e.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},e.prototype.toRadix=function(t){if(null==t&&(t=10),0==this.signum()||t<2||t>36)return"0";var e=this.chunkSize(t),i=Math.pow(t,e),r=c(i),o=n(),s=n(),a="";for(this.divRemTo(r,o,s);o.signum()>0;)a=(i+s.intValue()).toString(t).substr(1)+a,o.divRemTo(r,o,s);return s.intValue().toString(t)+a},e.prototype.fromRadix=function(t,n){this.fromInt(0),null==n&&(n=10);for(var i=this.chunkSize(n),r=Math.pow(n,i),o=!1,s=0,a=0,c=0;c<t.length;++c){var l=u(t,c);l<0?"-"==t.charAt(c)&&0==this.signum()&&(o=!0):(a=n*a+l,++s>=i&&(this.dMultiply(r),this.dAddOffset(a,0),s=0,a=0))}s>0&&(this.dMultiply(Math.pow(n,s)),this.dAddOffset(a,0)),o&&e.ZERO.subTo(this,this)},e.prototype.fromNumber=function(t,n,i){if("number"==typeof n)if(t<2)this.fromInt(1);else for(this.fromNumber(t,i),this.testBit(t-1)||this.bitwiseTo(e.ONE.shiftLeft(t-1),m,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(n);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(e.ONE.shiftLeft(t-1),this);else{var r=new Array,o=7&t;r.length=1+(t>>3),n.nextBytes(r),o>0?r[0]&=(1<<o)-1:r[0]=0,this.fromString(r,256)}},e.prototype.bitwiseTo=function(t,e,n){var i,r,o=Math.min(t.t,this.t);for(i=0;i<o;++i)n[i]=e(this[i],t[i]);if(t.t<this.t){for(r=t.s&this.DM,i=o;i<this.t;++i)n[i]=e(this[i],r);n.t=this.t}else{for(r=this.s&this.DM,i=o;i<t.t;++i)n[i]=e(r,t[i]);n.t=t.t}n.s=e(this.s,t.s),n.clamp()},e.prototype.changeBit=function(t,n){var i=e.ONE.shiftLeft(t);return this.bitwiseTo(i,n,i),i},e.prototype.addTo=function(t,e){for(var n=0,i=0,r=Math.min(t.t,this.t);n<r;)i+=this[n]+t[n],e[n++]=i&this.DM,i>>=this.DB;if(t.t<this.t){for(i+=t.s;n<this.t;)i+=this[n],e[n++]=i&this.DM,i>>=this.DB;i+=this.s}else{for(i+=this.s;n<t.t;)i+=t[n],e[n++]=i&this.DM,i>>=this.DB;i+=t.s}e.s=i<0?-1:0,i>0?e[n++]=i:i<-1&&(e[n++]=this.DV+i),e.t=n,e.clamp()},e.prototype.dMultiply=function(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},e.prototype.dAddOffset=function(t,e){if(0!=t){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=t;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}},e.prototype.multiplyLowerTo=function(t,e,n){var i,r=Math.min(this.t+t.t,e);for(n.s=0,n.t=r;r>0;)n[--r]=0;for(i=n.t-this.t;r<i;++r)n[r+this.t]=this.am(0,t[r],n,r,0,this.t);for(i=Math.min(t.t,e);r<i;++r)this.am(0,t[r],n,r,0,e-r);n.clamp()},e.prototype.multiplyUpperTo=function(t,e,n){--e;var i=n.t=this.t+t.t-e;for(n.s=0;--i>=0;)n[i]=0;for(i=Math.max(e-this.t,0);i<t.t;++i)n[this.t+i-e]=this.am(e-i,t[i],n,0,0,this.t+i-e);n.clamp(),n.drShiftTo(1,n)},e.prototype.modInt=function(t){if(t<=0)return 0;var e=this.DV%t,n=this.s<0?t-1:0;if(this.t>0)if(0==e)n=this[0]%t;else for(var i=this.t-1;i>=0;--i)n=(e*n+this[i])%t;return n},e.prototype.millerRabin=function(t){var i=this.subtract(e.ONE),r=i.getLowestSetBit();if(r<=0)return!1;var o=i.shiftRight(r);(t=t+1>>1)>p.length&&(t=p.length);for(var s=n(),a=0;a<t;++a){s.fromInt(p[Math.floor(Math.random()*p.length)]);var u=s.modPow(o,this);if(0!=u.compareTo(e.ONE)&&0!=u.compareTo(i)){for(var c=1;c++<r&&0!=u.compareTo(i);)if(0==(u=u.modPowInt(2,this)).compareTo(e.ONE))return!1;if(0!=u.compareTo(i))return!1}}return!0},e.prototype.clone=function(){var t=n();return this.copyTo(t),t},e.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},e.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},e.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},e.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},e.prototype.toByteArray=function(){var t=this.t,e=new Array;e[0]=this.s;var n,i=this.DB-t*this.DB%8,r=0;if(t-- >0)for(i<this.DB&&(n=this[t]>>i)!=(this.s&this.DM)>>i&&(e[r++]=n|this.s<<this.DB-i);t>=0;)i<8?(n=(this[t]&(1<<i)-1)<<8-i,n|=this[--t]>>(i+=this.DB-8)):(n=this[t]>>(i-=8)&255,i<=0&&(i+=this.DB,--t)),0!=(128&n)&&(n|=-256),0==r&&(128&this.s)!=(128&n)&&++r,(r>0||n!=this.s)&&(e[r++]=n);return e},e.prototype.equals=function(t){return 0==this.compareTo(t)},e.prototype.min=function(t){return this.compareTo(t)<0?this:t},e.prototype.max=function(t){return this.compareTo(t)>0?this:t},e.prototype.and=function(t){var e=n();return this.bitwiseTo(t,g,e),e},e.prototype.or=function(t){var e=n();return this.bitwiseTo(t,m,e),e},e.prototype.xor=function(t){var e=n();return this.bitwiseTo(t,y,e),e},e.prototype.andNot=function(t){var e=n();return this.bitwiseTo(t,v,e),e},e.prototype.not=function(){for(var t=n(),e=0;e<this.t;++e)t[e]=this.DM&~this[e];return t.t=this.t,t.s=~this.s,t},e.prototype.shiftLeft=function(t){var e=n();return t<0?this.rShiftTo(-t,e):this.lShiftTo(t,e),e},e.prototype.shiftRight=function(t){var e=n();return t<0?this.lShiftTo(-t,e):this.rShiftTo(t,e),e},e.prototype.getLowestSetBit=function(){for(var t=0;t<this.t;++t)if(0!=this[t])return t*this.DB+d(this[t]);return this.s<0?this.t*this.DB:-1},e.prototype.bitCount=function(){for(var t=0,e=this.s&this.DM,n=0;n<this.t;++n)t+=h(this[n]^e);return t},e.prototype.testBit=function(t){var e=Math.floor(t/this.DB);return e>=this.t?0!=this.s:0!=(this[e]&1<<t%this.DB)},e.prototype.setBit=function(t){return this.changeBit(t,m)},e.prototype.clearBit=function(t){return this.changeBit(t,v)},e.prototype.flipBit=function(t){return this.changeBit(t,y)},e.prototype.add=function(t){var e=n();return this.addTo(t,e),e},e.prototype.subtract=function(t){var e=n();return this.subTo(t,e),e},e.prototype.multiply=function(t){var e=n();return this.multiplyTo(t,e),e},e.prototype.divide=function(t){var e=n();return this.divRemTo(t,e,null),e},e.prototype.remainder=function(t){var e=n();return this.divRemTo(t,null,e),e},e.prototype.divideAndRemainder=function(t){var e=n(),i=n();return this.divRemTo(t,e,i),new Array(e,i)},e.prototype.modPow=function(t,e){var i,r,o=t.bitLength(),s=c(1);if(o<=0)return s;i=o<18?1:o<48?3:o<144?4:o<768?5:6,r=o<8?new B(e):e.isEven()?new I(e):new b(e);var a=new Array,u=3,d=i-1,h=(1<<i)-1;if(a[1]=r.convert(this),i>1){var p=n();for(r.sqrTo(a[1],p);u<=h;)a[u]=n(),r.mulTo(p,a[u-2],a[u]),u+=2}var f,g,m=t.t-1,y=!0,v=n();for(o=l(t[m])-1;m>=0;){for(o>=d?f=t[m]>>o-d&h:(f=(t[m]&(1<<o+1)-1)<<d-o,m>0&&(f|=t[m-1]>>this.DB+o-d)),u=i;0==(1&f);)f>>=1,--u;if((o-=u)<0&&(o+=this.DB,--m),y)a[f].copyTo(s),y=!1;else{for(;u>1;)r.sqrTo(s,v),r.sqrTo(v,s),u-=2;u>0?r.sqrTo(s,v):(g=s,s=v,v=g),r.mulTo(v,a[f],s)}for(;m>=0&&0==(t[m]&1<<o);)r.sqrTo(s,v),g=s,s=v,v=g,--o<0&&(o=this.DB-1,--m)}return r.revert(s)},e.prototype.modInverse=function(t){var n=t.isEven();if(0===this.signum())throw new Error("division by zero");if(this.isEven()&&n||0==t.signum())return e.ZERO;for(var i=t.clone(),r=this.clone(),o=c(1),s=c(0),a=c(0),u=c(1);0!=i.signum();){for(;i.isEven();)i.rShiftTo(1,i),n?(o.isEven()&&s.isEven()||(o.addTo(this,o),s.subTo(t,s)),o.rShiftTo(1,o)):s.isEven()||s.subTo(t,s),s.rShiftTo(1,s);for(;r.isEven();)r.rShiftTo(1,r),n?(a.isEven()&&u.isEven()||(a.addTo(this,a),u.subTo(t,u)),a.rShiftTo(1,a)):u.isEven()||u.subTo(t,u),u.rShiftTo(1,u);i.compareTo(r)>=0?(i.subTo(r,i),n&&o.subTo(a,o),s.subTo(u,s)):(r.subTo(i,r),n&&a.subTo(o,a),u.subTo(s,u))}if(0!=r.compareTo(e.ONE))return e.ZERO;for(;u.compareTo(t)>=0;)u.subTo(t,u);for(;u.signum()<0;)u.addTo(t,u);return u},e.prototype.pow=function(t){return this.exp(t,new w)},e.prototype.gcd=function(t){var e=this.s<0?this.negate():this.clone(),n=t.s<0?t.negate():t.clone();if(e.compareTo(n)<0){var i=e;e=n,n=i}var r=e.getLowestSetBit(),o=n.getLowestSetBit();if(o<0)return e;for(r<o&&(o=r),o>0&&(e.rShiftTo(o,e),n.rShiftTo(o,n));e.signum()>0;)(r=e.getLowestSetBit())>0&&e.rShiftTo(r,e),(r=n.getLowestSetBit())>0&&n.rShiftTo(r,n),e.compareTo(n)>=0?(e.subTo(n,e),e.rShiftTo(1,e)):(n.subTo(e,n),n.rShiftTo(1,n));return o>0&&n.lShiftTo(o,n),n},e.prototype.isProbablePrime=function(t){var e,n=this.abs();if(1==n.t&&n[0]<=p[p.length-1]){for(e=0;e<p.length;++e)if(n[0]==p[e])return!0;return!1}if(n.isEven())return!1;for(e=1;e<p.length;){for(var i=p[e],r=e+1;r<p.length&&i<f;)i*=p[r++];for(i=n.modInt(i);e<r;)if(i%p[e++]==0)return!1}return n.millerRabin(t)},e.prototype.square=function(){var t=n();return this.squareTo(t),t},e.valueOf=c,e.prototype.toByteArrayUnsigned=function(){var t=this.abs().toByteArray();return t.length?(0==t[0]&&(t=t.slice(1)),t.map(function(t){return t<0?t+256:t})):t},e.fromByteArrayUnsigned=function(t){return t.length?128&t[0]?new e([0].concat(t)):new e(t):t.valueOf(0)},e.prototype.toByteArraySigned=function(){var t=this.abs().toByteArrayUnsigned();return this.compareTo(e.ZERO)<0?128&t[0]?t.unshift(128):t[0]|=128:128&t[0]&&t.unshift(0),t},e.fromByteArraySigned=function(t){return 128&t[0]?(t[0]&=127,e.fromByteArrayUnsigned(t).negate()):e.fromByteArrayUnsigned(t)};var B=window.Classic=function(t){this.m=t};B.prototype.convert=function(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t},B.prototype.revert=function(t){return t},B.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},B.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n),this.reduce(n)},B.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)};var b=window.Montgomery=function(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t};b.prototype.convert=function(t){var i=n();return t.abs().dlShiftTo(this.m.t,i),i.divRemTo(this.m,null,i),t.s<0&&i.compareTo(e.ZERO)>0&&this.m.subTo(i,i),i},b.prototype.revert=function(t){var e=n();return t.copyTo(e),this.reduce(e),e},b.prototype.reduce=function(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e<this.m.t;++e){var n=32767&t[e],i=n*this.mpl+((n*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(t[n=e+this.m.t]+=this.m.am(0,i,t,e,0,this.m.t);t[n]>=t.DV;)t[n]-=t.DV,t[++n]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)},b.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n),this.reduce(n)},b.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)};var w=window.NullExp=function(){};w.prototype.convert=function(t){return t},w.prototype.revert=function(t){return t},w.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n)},w.prototype.sqrTo=function(t,e){t.squareTo(e)};var I=window.Barrett=function(t){this.r2=n(),this.q3=n(),e.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t};I.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=n();return t.copyTo(e),this.reduce(e),e},I.prototype.revert=function(t){return t},I.prototype.reduce=function(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)},I.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n),this.reduce(n)},I.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)}}(),function(){var t=window.EllipticCurve=function(){};t.FieldElementFp=function(t,e){this.x=e,this.q=t},t.FieldElementFp.prototype.equals=function(t){return t==this||this.q.equals(t.q)&&this.x.equals(t.x)},t.FieldElementFp.prototype.toBigInteger=function(){return this.x},t.FieldElementFp.prototype.negate=function(){return new t.FieldElementFp(this.q,this.x.negate().mod(this.q))},t.FieldElementFp.prototype.add=function(e){return new t.FieldElementFp(this.q,this.x.add(e.toBigInteger()).mod(this.q))},t.FieldElementFp.prototype.subtract=function(e){return new t.FieldElementFp(this.q,this.x.subtract(e.toBigInteger()).mod(this.q))},t.FieldElementFp.prototype.multiply=function(e){return new t.FieldElementFp(this.q,this.x.multiply(e.toBigInteger()).mod(this.q))},t.FieldElementFp.prototype.square=function(){return new t.FieldElementFp(this.q,this.x.square().mod(this.q))},t.FieldElementFp.prototype.divide=function(e){return new t.FieldElementFp(this.q,this.x.multiply(e.toBigInteger().modInverse(this.q)).mod(this.q))},t.FieldElementFp.prototype.getByteLength=function(){return Math.floor((this.toBigInteger().bitLength()+7)/8)},t.FieldElementFp.prototype.sqrt=function(){if(!this.q.testBit(0))throw new Error("even value of q");if(this.q.testBit(1)){var e=new t.FieldElementFp(this.q,this.x.modPow(this.q.shiftRight(2).add(BigInteger.ONE),this.q));return e.square().equals(this)?e:null}var n=this.q.subtract(BigInteger.ONE),i=n.shiftRight(1);if(!this.x.modPow(i,this.q).equals(BigInteger.ONE))return null;var r,o,s=n.shiftRight(2).shiftLeft(1).add(BigInteger.ONE),a=this.x,u=a.shiftLeft(2).mod(this.q);do{var c,l=new SecureRandom;do{c=new BigInteger(this.q.bitLength(),l)}while(c.compareTo(this.q)>=0||!c.multiply(c).subtract(u).modPow(i,this.q).equals(n));var d=t.FieldElementFp.fastLucasSequence(this.q,c,a,s);if(r=d[0],(o=d[1]).multiply(o).mod(this.q).equals(u))return o.testBit(0)&&(o=o.add(this.q)),o=o.shiftRight(1),new t.FieldElementFp(this.q,o)}while(r.equals(BigInteger.ONE)||r.equals(n));return null},t.FieldElementFp.fastLucasSequence=function(t,e,n,i){for(var r=i.bitLength(),o=i.getLowestSetBit(),s=BigInteger.ONE,a=BigInteger.TWO,u=e,c=BigInteger.ONE,l=BigInteger.ONE,d=r-1;d>=o+1;--d)c=c.multiply(l).mod(t),i.testBit(d)?(l=c.multiply(n).mod(t),s=s.multiply(u).mod(t),a=u.multiply(a).subtract(e.multiply(c)).mod(t),u=u.multiply(u).subtract(l.shiftLeft(1)).mod(t)):(l=c,s=s.multiply(a).subtract(c).mod(t),u=u.multiply(a).subtract(e.multiply(c)).mod(t),a=a.multiply(a).subtract(c.shiftLeft(1)).mod(t));l=(c=c.multiply(l).mod(t)).multiply(n).mod(t),s=s.multiply(a).subtract(c).mod(t),a=u.multiply(a).subtract(e.multiply(c)).mod(t),c=c.multiply(l).mod(t);for(d=1;d<=o;++d)s=s.multiply(a).mod(t),a=a.multiply(a).subtract(c.shiftLeft(1)).mod(t),c=c.multiply(c).mod(t);return[s,a]},t.PointFp=function(t,e,n,i,r){this.curve=t,this.x=e,this.y=n,this.z=null==i?BigInteger.ONE:i,this.zinv=null,this.compressed=!!r},t.PointFp.prototype.getX=function(){null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q));var t=this.x.toBigInteger().multiply(this.zinv);return this.curve.reduce(t),this.curve.fromBigInteger(t)},t.PointFp.prototype.getY=function(){null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q));var t=this.y.toBigInteger().multiply(this.zinv);return this.curve.reduce(t),this.curve.fromBigInteger(t)},t.PointFp.prototype.equals=function(t){return t==this||(this.isInfinity()?t.isInfinity():t.isInfinity()?this.isInfinity():!!t.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(t.z)).mod(this.curve.q).equals(BigInteger.ZERO)&&t.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(t.z)).mod(this.curve.q).equals(BigInteger.ZERO))},t.PointFp.prototype.isInfinity=function(){return null==this.x&&null==this.y||this.z.equals(BigInteger.ZERO)&&!this.y.toBigInteger().equals(BigInteger.ZERO)},t.PointFp.prototype.negate=function(){return new t.PointFp(this.curve,this.x,this.y.negate(),this.z)},t.PointFp.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var n=e.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(e.z)).mod(this.curve.q),i=e.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(e.z)).mod(this.curve.q);if(BigInteger.ZERO.equals(i))return BigInteger.ZERO.equals(n)?this.twice():this.curve.getInfinity();var r=new BigInteger("3"),o=this.x.toBigInteger(),s=this.y.toBigInteger(),a=(e.x.toBigInteger(),e.y.toBigInteger(),i.square()),u=a.multiply(i),c=o.multiply(a),l=n.square().multiply(this.z),d=l.subtract(c.shiftLeft(1)).multiply(e.z).subtract(u).multiply(i).mod(this.curve.q),h=c.multiply(r).multiply(n).subtract(s.multiply(u)).subtract(l.multiply(n)).multiply(e.z).add(n.multiply(u)).mod(this.curve.q),p=u.multiply(this.z).multiply(e.z).mod(this.curve.q);return new t.PointFp(this.curve,this.curve.fromBigInteger(d),this.curve.fromBigInteger(h),p)},t.PointFp.prototype.twice=function(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var e=new BigInteger("3"),n=this.x.toBigInteger(),i=this.y.toBigInteger(),r=i.multiply(this.z),o=r.multiply(i).mod(this.curve.q),s=this.curve.a.toBigInteger(),a=n.square().multiply(e);BigInteger.ZERO.equals(s)||(a=a.add(this.z.square().multiply(s)));var u=(a=a.mod(this.curve.q)).square().subtract(n.shiftLeft(3).multiply(o)).shiftLeft(1).multiply(r).mod(this.curve.q),c=a.multiply(e).multiply(n).subtract(o.shiftLeft(1)).shiftLeft(2).multiply(o).subtract(a.square().multiply(a)).mod(this.curve.q),l=r.square().multiply(r).shiftLeft(3).mod(this.curve.q);return new t.PointFp(this.curve,this.curve.fromBigInteger(u),this.curve.fromBigInteger(c),l)},t.PointFp.prototype.multiply=function(t){if(this.isInfinity())return this;if(0==t.signum())return this.curve.getInfinity();var e,n=t,i=n.multiply(new BigInteger("3")),r=this.negate(),o=this;for(e=i.bitLength()-2;e>0;--e){o=o.twice();var s=i.testBit(e);s!=n.testBit(e)&&(o=o.add(s?this:r))}return o},t.PointFp.prototype.multiplyTwo=function(t,e,n){var i;i=t.bitLength()>n.bitLength()?t.bitLength()-1:n.bitLength()-1;for(var r=this.curve.getInfinity(),o=this.add(e);i>=0;)r=r.twice(),t.testBit(i)?r=n.testBit(i)?r.add(o):r.add(this):n.testBit(i)&&(r=r.add(e)),--i;return r},t.PointFp.prototype.getEncoded=function(e){var n=this.getX().toBigInteger(),i=this.getY().toBigInteger(),r=t.integerToBytes(n,32);return e?i.isEven()?r.unshift(2):r.unshift(3):(r.unshift(4),r=r.concat(t.integerToBytes(i,32))),r},t.PointFp.decodeFrom=function(e,n){n[0];var i=n.length-1,r=n.slice(1,1+i/2),o=n.slice(1+i/2,1+i);r.unshift(0),o.unshift(0);var s=new BigInteger(r),a=new BigInteger(o);return new t.PointFp(e,e.fromBigInteger(s),e.fromBigInteger(a))},t.PointFp.prototype.add2D=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;if(this.x.equals(e.x))return this.y.equals(e.y)?this.twice():this.curve.getInfinity();var n=e.x.subtract(this.x),i=e.y.subtract(this.y).divide(n),r=i.square().subtract(this.x).subtract(e.x),o=i.multiply(this.x.subtract(r)).subtract(this.y);return new t.PointFp(this.curve,r,o)},t.PointFp.prototype.twice2D=function(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var e=this.curve.fromBigInteger(BigInteger.valueOf(2)),n=this.curve.fromBigInteger(BigInteger.valueOf(3)),i=this.x.square().multiply(n).add(this.curve.a).divide(this.y.multiply(e)),r=i.square().subtract(this.x.multiply(e)),o=i.multiply(this.x.subtract(r)).subtract(this.y);return new t.PointFp(this.curve,r,o)},t.PointFp.prototype.multiply2D=function(t){if(this.isInfinity())return this;if(0==t.signum())return this.curve.getInfinity();var e,n=t,i=n.multiply(new BigInteger("3")),r=this.negate(),o=this;for(e=i.bitLength()-2;e>0;--e){o=o.twice();var s=i.testBit(e);s!=n.testBit(e)&&(o=o.add2D(s?this:r))}return o},t.PointFp.prototype.isOnCurve=function(){var t=this.getX().toBigInteger(),e=this.getY().toBigInteger(),n=this.curve.getA().toBigInteger(),i=this.curve.getB().toBigInteger(),r=this.curve.getQ(),o=e.multiply(e).mod(r),s=t.multiply(t).multiply(t).add(n.multiply(t)).add(i).mod(r);return o.equals(s)},t.PointFp.prototype.toString=function(){return"("+this.getX().toBigInteger().toString()+","+this.getY().toBigInteger().toString()+")"},t.PointFp.prototype.validate=function(){var t=this.curve.getQ();if(this.isInfinity())throw new Error("Point is at infinity.");var e=this.getX().toBigInteger(),n=this.getY().toBigInteger();if(e.compareTo(BigInteger.ONE)<0||e.compareTo(t.subtract(BigInteger.ONE))>0)throw new Error("x coordinate out of bounds");if(n.compareTo(BigInteger.ONE)<0||n.compareTo(t.subtract(BigInteger.ONE))>0)throw new Error("y coordinate out of bounds");if(!this.isOnCurve())throw new Error("Point is not on the curve.");if(this.multiply(t).isInfinity())throw new Error("Point is not a scalar multiple of G.");return!0},t.CurveFp=function(e,n,i){this.q=e,this.a=this.fromBigInteger(n),this.b=this.fromBigInteger(i),this.infinity=new t.PointFp(this,null,null),this.reducer=new Barrett(this.q)},t.CurveFp.prototype.getQ=function(){return this.q},t.CurveFp.prototype.getA=function(){return this.a},t.CurveFp.prototype.getB=function(){return this.b},t.CurveFp.prototype.equals=function(t){return t==this||this.q.equals(t.q)&&this.a.equals(t.a)&&this.b.equals(t.b)},t.CurveFp.prototype.getInfinity=function(){return this.infinity},t.CurveFp.prototype.fromBigInteger=function(e){return new t.FieldElementFp(this.q,e)},t.CurveFp.prototype.reduce=function(t){this.reducer.reduce(t)},t.CurveFp.prototype.decodePointHex=function(e){var n=parseInt(e.substr(0,2),16);switch(n){case 0:return this.infinity;case 2:case 3:var i=1&n,r=e.substr(2,e.length-2),o=new BigInteger(r,16);return this.decompressPoint(i,o);case 4:case 6:case 7:var s=(e.length-2)/2,a=(r=e.substr(2,s),e.substr(s+2,s));return new t.PointFp(this,this.fromBigInteger(new BigInteger(r,16)),this.fromBigInteger(new BigInteger(a,16)));default:return null}},t.CurveFp.prototype.encodePointHex=function(t){if(t.isInfinity())return"00";var e=t.getX().toBigInteger().toString(16),n=t.getY().toBigInteger().toString(16),i=this.getQ().toString(16).length;for(i%2!=0&&i++;e.length<i;)e="0"+e;for(;n.length<i;)n="0"+n;return"04"+e+n},t.CurveFp.prototype.decompressPoint=function(e,n){var i=this.fromBigInteger(n),r=i.multiply(i.square().add(this.getA())).add(this.getB()).sqrt();if(null==r)throw new Error("Invalid point compression");var o=r.toBigInteger();return(o.testBit(0)?1:0)!=e&&(r=this.fromBigInteger(this.getQ().subtract(o))),new t.PointFp(this,i,r,null,!0)},t.fromHex=function(t){return new BigInteger(t,16)},t.integerToBytes=function(t,e){var n=t.toByteArrayUnsigned();if(e<n.length)n=n.slice(n.length-e);else for(;e>n.length;)n.unshift(0);return n},t.X9Parameters=function(t,e,n,i){this.curve=t,this.g=e,this.n=n,this.h=i},t.X9Parameters.prototype.getCurve=function(){return this.curve},t.X9Parameters.prototype.getG=function(){return this.g},t.X9Parameters.prototype.getN=function(){return this.n},t.X9Parameters.prototype.getH=function(){return this.h},t.secNamedCurves={secp256k1:function(){var e=t.fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F"),n=BigInteger.ZERO,i=t.fromHex("7"),r=t.fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141"),o=BigInteger.ONE,s=new t.CurveFp(e,n,i),a=s.decodePointHex("0479BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8");return new t.X9Parameters(s,a,r,o)}},t.getSECCurveByName=function(e){return null==t.secNamedCurves[e]?null:t.secNamedCurves[e]()}}(),function(){var t=window.bitjs=function(){};t.pub=35,t.priv=163,t.compressed=!1,t.privkey2wif=function(n){var i=Crypto.util.hexToBytes(n);1==t.compressed&&i.push(1),i.unshift(t.priv);var r=Crypto.SHA256(Crypto.SHA256(i,{asBytes:!0}),{asBytes:!0}).slice(0,4);return e.encode(i.concat(r))},t.wif2privkey=function(t){var n=!1,i=e.decode(t),r=i.slice(0,i.length-4);return(r=r.slice(1,r.length)).length>=33&&1==r[r.length-1]&&(r=r.slice(0,r.length-1),n=!0),{privkey:Crypto.util.bytesToHex(r),compressed:n}},t.wif2pubkey=function(e){var n=t.compressed,i=t.wif2privkey(e);t.compressed=i.compressed;var r=t.newPubkey(i.privkey);return t.compressed=n,{pubkey:r,compressed:i.compressed}},t.wif2address=function(e){var n=t.wif2pubkey(e);return{address:t.pubkey2address(n.pubkey),compressed:n.compressed}},t.newPubkey=function(e){var n=BigInteger.fromByteArrayUnsigned(Crypto.util.hexToBytes(e)),i=EllipticCurve.getSECCurveByName("secp256k1").getG().multiply(n),r=i.getX().toBigInteger(),o=i.getY().toBigInteger(),s=EllipticCurve.integerToBytes(r,32);if((s=s.concat(EllipticCurve.integerToBytes(o,32))).unshift(4),1==t.compressed){var a=EllipticCurve.integerToBytes(r,32);return o.isEven()?a.unshift(2):a.unshift(3),Crypto.util.bytesToHex(a)}return Crypto.util.bytesToHex(s)},t.pubkey2address=function(n,i){var r=ripemd160(Crypto.SHA256(Crypto.util.hexToBytes(n),{asBytes:!0}));r.unshift(i||t.pub);var o=Crypto.SHA256(Crypto.SHA256(r,{asBytes:!0}),{asBytes:!0}).slice(0,4);return e.encode(r.concat(o))},t.transaction=function(){var n={version:2,inputs:[],outputs:[],locktime:0,floData:"",addinput:function(t,e,i,r){var o={};return o.outpoint={hash:t,index:e},o.script=Crypto.util.hexToBytes(i),o.sequence=r||(0==n.locktime?4294967295:0),this.inputs.push(o)},addoutput:function(t,e){var i={},r=[],o=n.addressDecode(t);return i.value=new BigInteger(""+Math.round(1*e*1e8),10),r.push(118),r.push(169),r.push(o.length),(r=r.concat(o)).push(136),r.push(172),i.script=r,this.outputs.push(i)},addflodata:function(t){return this.floData=t,this.floData},addressDecode:function(t){var n=e.decode(t),i=n.slice(0,n.length-4),r=n.slice(n.length-4);if(Crypto.SHA256(Crypto.SHA256(i,{asBytes:!0}),{asBytes:!0}).slice(0,4)+""==r+"")return i.slice(1)},transactionHash:function(e,n){for(var i=t.clone(this),r=n||1,o=0;o<i.inputs.length;o++)e!=o&&(i.inputs[o].script=[]);if(i.inputs&&i.inputs[e]){if(1==r);else if(2==r){i.outputs=[];for(o=0;o<i.inputs.length;o++)e!=o&&(i.inputs[o].sequence=0)}else if(3==r){i.outputs.length=e+1;for(o=0;o<e;o++)i.outputs[o].value=-1,i.outputs[o].script=[];for(o=0;o<i.inputs.length;o++)e!=o&&(i.inputs[o].sequence=0)}else if(r>=128)if(i.inputs=[i.inputs[e]],129==r);else if(130==r)i.outputs=[];else if(131==r){i.outputs.length=e+1;for(o=0;o<e;o++)i.outputs[o].value=-1,i.outputs[o].script=[]}var s=Crypto.util.hexToBytes(i.serialize());s=s.concat(t.numToBytes(parseInt(r),4));var a=Crypto.SHA256(s,{asBytes:!0});return Crypto.util.bytesToHex(Crypto.SHA256(a,{asBytes:!0}))}return!1},transactionSig:function(e,n,i,r){var o=i||1,s=r||Crypto.util.hexToBytes(this.transactionHash(e,o));if(s){var a=EllipticCurve.getSECCurveByName("secp256k1"),u=t.wif2privkey(n),c=BigInteger.fromByteArrayUnsigned(Crypto.util.hexToBytes(u.privkey)),l=a.getN(),d=BigInteger.fromByteArrayUnsigned(s),h=0;do{var p=this.deterministicK(n,s,h),f=a.getG().multiply(p).getX().toBigInteger().mod(l),g=p.modInverse(l).multiply(d.add(c.multiply(f))).mod(l);h++}while(f.compareTo(BigInteger.ZERO)<=0||g.compareTo(BigInteger.ZERO)<=0);var m=l.shiftRight(1);g.compareTo(m)>0&&(g=l.subtract(g));var y=function(t,e){var n=t.toByteArraySigned(),i=e.toByteArraySigned(),r=[];return r.push(2),r.push(n.length),(r=r.concat(n)).push(2),r.push(i.length),(r=r.concat(i)).unshift(r.length),r.unshift(48),r}(f,g);return y.push(parseInt(o,10)),Crypto.util.bytesToHex(y)}return!1},deterministicK:function(e,n,i){i=i||0;var r=t.wif2privkey(e),o=Crypto.util.hexToBytes(r.privkey),s=EllipticCurve.getSECCurveByName("secp256k1").getN(),a=[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],u=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];u=Crypto.HMAC(Crypto.SHA256,a.concat([0]).concat(o).concat(n),u,{asBytes:!0}),a=Crypto.HMAC(Crypto.SHA256,a,u,{asBytes:!0}),u=Crypto.HMAC(Crypto.SHA256,a.concat([1]).concat(o).concat(n),u,{asBytes:!0}),a=Crypto.HMAC(Crypto.SHA256,a,u,{asBytes:!0});var c=[];c=a=Crypto.HMAC(Crypto.SHA256,a,u,{asBytes:!0});for(var l=BigInteger.fromByteArrayUnsigned(c),d=0;l.compareTo(s)>=0||l.compareTo(BigInteger.ZERO)<=0||d<i;)u=Crypto.HMAC(Crypto.SHA256,a.concat([0]),u,{asBytes:!0}),a=Crypto.HMAC(Crypto.SHA256,a,u,{asBytes:!0}),c=a=Crypto.HMAC(Crypto.SHA256,a,u,{asBytes:!0}),l=BigInteger.fromByteArrayUnsigned(c),d++;return l},signinput:function(e,n,i){var r=t.wif2pubkey(n),o=i||1,s=this.transactionSig(e,n,o),a=[],u=Crypto.util.hexToBytes(s);a.push(u.length),a=a.concat(u);var c=Crypto.util.hexToBytes(r.pubkey);return a.push(c.length),a=a.concat(c),this.inputs[e].script=a,!0},sign:function(t,e){for(var n=e||1,i=0;i<this.inputs.length;i++)this.signinput(i,t,n);return this.serialize()},serialize:function(){var e=[];e=(e=e.concat(t.numToBytes(parseInt(this.version),4))).concat(t.numToVarInt(this.inputs.length));for(var n=0;n<this.inputs.length;n++){var i=this.inputs[n];e=(e=e.concat(Crypto.util.hexToBytes(i.outpoint.hash).reverse())).concat(t.numToBytes(parseInt(i.outpoint.index),4));var r=i.script;e=(e=(e=e.concat(t.numToVarInt(r.length))).concat(r)).concat(t.numToBytes(parseInt(i.sequence),4))}e=e.concat(t.numToVarInt(this.outputs.length));for(n=0;n<this.outputs.length;n++){var o=this.outputs[n];e=e.concat(t.numToBytes(o.value,8));r=o.script;e=(e=e.concat(t.numToVarInt(r.length))).concat(r)}return e=e.concat(t.numToBytes(parseInt(this.locktime),4)),flohex=ascii_to_hexa(this.floData),floDataCount=this.floData.length,floDataCount<16?(floDataCountString=floDataCount.toString(16),floDataCountString="0"+floDataCountString):floDataCount<253?floDataCountString=floDataCount.toString(16):floDataCount<=1040?(floDataCountAdjusted=floDataCount-253+parseInt("0xfd00fd"),floDataCountStringAdjusted=floDataCountAdjusted.toString(16),floDataCountString=floDataCountStringAdjusted.substr(0,2)+floDataCountStringAdjusted.substr(4,2)+floDataCountStringAdjusted.substr(2,2)):floDataCountString="Character Limit Exceeded",Crypto.util.bytesToHex(e)+floDataCountString+flohex}};return n},t.numToBytes=function(e,n){return void 0===n&&(n=8),0==n?[]:-1==e?Crypto.util.hexToBytes("ffffffffffffffff"):[e%256].concat(t.numToBytes(Math.floor(e/256),n-1))},t.numToByteArray=function(e){return e<=256?[e]:[e%256].concat(t.numToByteArray(Math.floor(e/256)))},t.numToVarInt=function(e){return e<253?[e]:e<65536?[253].concat(t.numToBytes(e,2)):e<4294967296?[254].concat(t.numToBytes(e,4)):[255].concat(t.numToBytes(e,8))},t.bytesToNum=function(e){return 0==e.length?0:e[0]+256*t.bytesToNum(e.slice(1))},t.clone=function(e){if(null==e||"object"!=typeof e)return e;var n=new e.constructor;for(var i in e)e.hasOwnProperty(i)&&(n[i]=t.clone(e[i]));return n};var e=t.Base58={alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",validRegex:/^[1-9A-HJ-NP-Za-km-z]+$/,base:BigInteger.valueOf(58),encode:function(t){for(var n=BigInteger.fromByteArrayUnsigned(t),i=[];n.compareTo(e.base)>=0;){var r=n.mod(e.base);i.unshift(e.alphabet[r.intValue()]),n=n.subtract(r).divide(e.base)}i.unshift(e.alphabet[n.intValue()]);for(var o=0;o<t.length&&0==t[o];o++)i.unshift(e.alphabet[0]);return i.join("")},decode:function(t){for(var n=BigInteger.valueOf(0),i=0,r=t.length-1;r>=0;r--){var o=e.alphabet.indexOf(t[r]);if(o<0)throw"Invalid character";n=n.add(BigInteger.valueOf(o).multiply(e.base.pow(t.length-1-r))),"1"==t[r]?i++:i=0}for(var s=n.toByteArrayUnsigned();i-- >0;)s.unshift(0);return s}}}(),"object"==typeof module?module.exports:window.Bitcoin={},function(t){t.Base58={alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",validRegex:/^[1-9A-HJ-NP-Za-km-z]+$/,base:BigInteger.valueOf(58),encode:function(t){for(var n=BigInteger.fromByteArrayUnsigned(t),i=[];n.compareTo(e.base)>=0;){var r=n.mod(e.base);i.unshift(e.alphabet[r.intValue()]),n=n.subtract(r).divide(e.base)}i.unshift(e.alphabet[n.intValue()]);for(var o=0;o<t.length&&0==t[o];o++)i.unshift(e.alphabet[0]);return i.join("")},decode:function(t){for(var n=BigInteger.valueOf(0),i=0,r=t.length-1;r>=0;r--){var o=e.alphabet.indexOf(t[r]);if(o<0)throw"Invalid character";n=n.add(BigInteger.valueOf(o).multiply(e.base.pow(t.length-1-r))),"1"==t[r]?i++:i=0}for(var s=n.toByteArrayUnsigned();i-- >0;)s.unshift(0);return s}};var e=t.Base58}("undefined"!=typeof Bitcoin?Bitcoin:module.exports),Bitcoin.Address=function(t){"FLO"==floGlobals.blockchain?this.version=35:"FLO_TEST"==floGlobals.blockchain&&(this.version=115),"string"==typeof t&&(t=Bitcoin.Address.decodeString(t,this.version)),this.hash=t},Bitcoin.Address.networkVersion=35,Bitcoin.Address.prototype.toString=function(){var t=this.hash.slice(0);t.unshift(this.version);var e=Crypto.SHA256(Crypto.SHA256(t,{asBytes:!0}),{asBytes:!0}),n=t.concat(e.slice(0,4));return Bitcoin.Base58.encode(n)},Bitcoin.Address.prototype.getHashBase64=function(){return Crypto.util.bytesToBase64(this.hash)},Bitcoin.Address.decodeString=function(t,e){var n=Bitcoin.Base58.decode(t),i=n.slice(0,21),r=Crypto.SHA256(Crypto.SHA256(i,{asBytes:!0}),{asBytes:!0});if(r[0]!=n[21]||r[1]!=n[22]||r[2]!=n[23]||r[3]!=n[24])throw"Checksum validation failed!";if(e!=i.shift())throw"Version "+i.shift()+" not supported!";return i},Bitcoin.ECDSA=function(){var t=EllipticCurve.getSECCurveByName("secp256k1"),e=new SecureRandom,n=null;var i={getBigRandom:function(t){return new BigInteger(t.bitLength(),e).mod(t.subtract(BigInteger.ONE)).add(BigInteger.ONE)},sign:function(e,n){var r=n,o=t.getN(),s=BigInteger.fromByteArrayUnsigned(e);do{var a=i.getBigRandom(o),u=t.getG().multiply(a).getX().toBigInteger().mod(o)}while(u.compareTo(BigInteger.ZERO)<=0);var c=a.modInverse(o).multiply(s.add(r.multiply(u))).mod(o);return i.serializeSig(u,c)},verify:function(e,n,r){var o,s,a;if(Bitcoin.Util.isArray(n)){var u=i.parseSig(n);o=u.r,s=u.s}else{if("object"!=typeof n||!n.r||!n.s)throw"Invalid value for signature";o=n.r,s=n.s}if(r instanceof ec.PointFp)a=r;else{if(!Bitcoin.Util.isArray(r))throw"Invalid format for pubkey value, must be byte array or ec.PointFp";a=EllipticCurve.PointFp.decodeFrom(t.getCurve(),r)}var c=BigInteger.fromByteArrayUnsigned(e);return i.verifyRaw(c,o,s,a)},verifyRaw:function(e,n,i,r){var o=t.getN(),s=t.getG();if(n.compareTo(BigInteger.ONE)<0||n.compareTo(o)>=0)return!1;if(i.compareTo(BigInteger.ONE)<0||i.compareTo(o)>=0)return!1;var a=i.modInverse(o),u=e.multiply(a).mod(o),c=n.multiply(a).mod(o);return s.multiply(u).add(r.multiply(c)).getX().toBigInteger().mod(o).equals(n)},serializeSig:function(t,e){var n=t.toByteArraySigned(),i=e.toByteArraySigned(),r=[];return r.push(2),r.push(n.length),(r=r.concat(n)).push(2),r.push(i.length),(r=r.concat(i)).unshift(r.length),r.unshift(48),r},parseSig:function(t){var e;if(48!=t[0])throw new Error("Signature not a valid DERSequence");if(2!=t[e=2])throw new Error("First element in signature must be a DERInteger");var n=t.slice(e+2,e+2+t[e+1]);if(2!=t[e+=2+t[e+1]])throw new Error("Second element in signature must be a DERInteger");var i=t.slice(e+2,e+2+t[e+1]);return e+=2+t[e+1],{r:BigInteger.fromByteArrayUnsigned(n),s:BigInteger.fromByteArrayUnsigned(i)}},parseSigCompact:function(e){if(65!==e.length)throw"Signature has the wrong length";var n=e[0]-27;if(n<0||n>7)throw"Invalid signature type";var i=t.getN();return{r:BigInteger.fromByteArrayUnsigned(e.slice(1,33)).mod(i),s:BigInteger.fromByteArrayUnsigned(e.slice(33,65)).mod(i),i:n}},recoverPubKey:function(e,r,o,s){var a=1&(s&=3),u=s>>1,c=t.getN(),l=t.getG(),d=t.getCurve(),h=d.getQ(),p=d.getA().toBigInteger(),f=d.getB().toBigInteger();n||(n=h.add(BigInteger.ONE).divide(BigInteger.valueOf(4)));var g=u?e.add(c):e,m=g.multiply(g).multiply(g).add(p.multiply(g)).add(f).mod(h).modPow(n,h),y=(m.isEven(),(m.isEven()?!a:a)?m:h.subtract(m)),v=new EllipticCurve.PointFp(d,d.fromBigInteger(g),d.fromBigInteger(y));v.validate();var B=BigInteger.fromByteArrayUnsigned(o),b=BigInteger.ZERO.subtract(B).mod(c),w=e.modInverse(c),I=function(t,e,n,i){for(var r=Math.max(e.bitLength(),i.bitLength()),o=t.add2D(n),s=t.curve.getInfinity(),a=r-1;a>=0;--a)(s=s.twice2D()).z=BigInteger.ONE,e.testBit(a)?s=i.testBit(a)?s.add2D(o):s.add2D(t):i.testBit(a)&&(s=s.add2D(n));return s}(v,r,l,b).multiply(w);if(I.validate(),!i.verifyRaw(B,e,r,I))throw"Pubkey recovery unsuccessful";var T=new Bitcoin.ECKey;return T.pub=I,T},calcPubkeyRecoveryParam:function(t,e,n,i){for(var r=0;r<4;r++)try{if(Bitcoin.ECDSA.recoverPubKey(e,n,i,r).getBitcoinAddress().toString()==t)return r}catch(t){}throw"Unable to find valid recovery factor"}};return i}(),Bitcoin.KeyPool=new function(){return this.keyArray=[],this.push=function(t){if(null!=t&&null!=t.priv){var e=!0;for(var n in this.keyArray){var i=this.keyArray[n];if(null!=i&&null!=i.priv&&t.getBitcoinAddress()==i.getBitcoinAddress()){e=!1;break}}e&&this.keyArray.push(t)}},this.reset=function(){this.keyArray=[]},this.getArray=function(){return this.keyArray.slice(0)},this.setArray=function(t){this.keyArray=t},this.length=function(){return this.keyArray.length},this.toString=function(){var t="# = "+this.length()+"\n",e=this.getArray();for(var n in e){var i=e[n];Bitcoin.Util.hasMethods(i,"getBitcoinAddress","toString")&&null!=i&&(t+='"'+i.getBitcoinAddress()+'", "'+i.toString("wif")+'"\n')}return t},this},Bitcoin.Bip38Key=function(){var t=function(t,e){this.address=t,this.priv=e};return t.prototype.getBitcoinAddress=function(){return this.address},t.prototype.toString=function(){return this.priv},t}(),Bitcoin.ECKey=function(){var t=Bitcoin.ECDSA,e=Bitcoin.KeyPool,n=EllipticCurve.getSECCurveByName("secp256k1"),i=function(r){if(r){if(r instanceof BigInteger)this.priv=r;else if(Bitcoin.Util.isArray(r))this.priv=BigInteger.fromByteArrayUnsigned(r);else if("string"==typeof r){var o=null;try{"FLO"==floGlobals.blockchain&&/^R[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{51}$/.test(r)||"FLO_TEST"==floGlobals.blockchain&&/^c[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{51}$/.test(r)?(o=i.decodeCompressedWalletImportFormat(r),this.compressed=!0):i.isHexFormat(r)&&(o=Crypto.util.hexToBytes(r))}catch(t){this.setError(t)}i.isBase6Format(r)?this.priv=new BigInteger(r,6):null==o||32!=o.length?this.priv=null:this.priv=BigInteger.fromByteArrayUnsigned(o)}}else{var s=n.getN();this.priv=t.getBigRandom(s)}this.compressed=null==this.compressed?!!i.compressByDefault:this.compressed;try{null!=this.priv&&0==BigInteger.ZERO.compareTo(this.priv)&&this.setError("Error: BigInteger equal to zero.");var a=Crypto.util.hexToBytes("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364140"),u=BigInteger.fromByteArrayUnsigned(a);null!=this.priv&&u.compareTo(this.priv)<0&&this.setError("Error: BigInteger outside of curve range."),null!=this.priv&&e.push(this)}catch(t){this.setError(t)}};return"FLO"==floGlobals.blockchain?i.privateKeyPrefix=163:"FLO_TEST"==floGlobals.blockchain&&(i.privateKeyPrefix=239),i.compressByDefault=!1,i.prototype.setError=function(t){return this.error=t,this.priv=null,this},i.prototype.setCompressed=function(t){return this.compressed=!!t,this.pubPoint&&(this.pubPoint.compressed=this.compressed),this},i.prototype.getPub=function(){return this.compressed?this.pubComp?this.pubComp:this.pubComp=this.getPubPoint().getEncoded(1):this.pubUncomp?this.pubUncomp:this.pubUncomp=this.getPubPoint().getEncoded(0)},i.prototype.getPubPoint=function(){return this.pubPoint||(this.pubPoint=n.getG().multiply(this.priv),this.pubPoint.compressed=this.compressed),this.pubPoint},i.prototype.getPubKeyHex=function(){return this.compressed?this.pubKeyHexComp?this.pubKeyHexComp:this.pubKeyHexComp=Crypto.util.bytesToHex(this.getPub()).toString().toUpperCase():this.pubKeyHexUncomp?this.pubKeyHexUncomp:this.pubKeyHexUncomp=Crypto.util.bytesToHex(this.getPub()).toString().toUpperCase()},i.prototype.getPubKeyHash=function(){return this.compressed?this.pubKeyHashComp?this.pubKeyHashComp:this.pubKeyHashComp=Bitcoin.Util.sha256ripe160(this.getPub()):this.pubKeyHashUncomp?this.pubKeyHashUncomp:this.pubKeyHashUncomp=Bitcoin.Util.sha256ripe160(this.getPub())},i.prototype.getBitcoinAddress=function(){var t=this.getPubKeyHash();return new Bitcoin.Address(t).toString()},i.prototype.setPub=function(t){Bitcoin.Util.isArray(t)&&(t=Crypto.util.bytesToHex(t).toString().toUpperCase());var e=n.getCurve().decodePointHex(t);return this.setCompressed(e.compressed),this.pubPoint=e,this},i.prototype.getBitcoinWalletImportFormat=function(){var t=this.getBitcoinPrivateKeyByteArray();if(null==t)return"";t.unshift(i.privateKeyPrefix),this.compressed&&t.push(1);var e=Crypto.SHA256(Crypto.SHA256(t,{asBytes:!0}),{asBytes:!0});return t=t.concat(e.slice(0,4)),Bitcoin.Base58.encode(t)},i.prototype.getBitcoinHexFormat=function(){return Crypto.util.bytesToHex(this.getBitcoinPrivateKeyByteArray()).toString().toUpperCase()},i.prototype.getBitcoinBase64Format=function(){return Crypto.util.bytesToBase64(this.getBitcoinPrivateKeyByteArray())},i.prototype.getBitcoinPrivateKeyByteArray=function(){if(null==this.priv)return null;for(var t=this.priv.toByteArrayUnsigned();t.length<32;)t.unshift(0);return t},i.prototype.toString=function(t){return"base64"==(t=t||"").toString().toLowerCase()||"b64"==t.toString().toLowerCase()?this.getBitcoinBase64Format():"wif"==t.toString().toLowerCase()?this.getBitcoinWalletImportFormat():this.getBitcoinHexFormat()},i.prototype.sign=function(e){return t.sign(e,this.priv)},i.prototype.verify=function(e,n){return t.verify(e,n,this.getPub())},i.decodeWalletImportFormat=function(t){var e=Bitcoin.Base58.decode(t),n=e.slice(0,33),r=Crypto.SHA256(Crypto.SHA256(n,{asBytes:!0}),{asBytes:!0});if(r[0]!=e[33]||r[1]!=e[34]||r[2]!=e[35]||r[3]!=e[36])throw"Checksum validation failed!";var o=n.shift();if(o!=i.privateKeyPrefix)throw"Version "+o+" not supported!";return n},i.decodeCompressedWalletImportFormat=function(t){var e=Bitcoin.Base58.decode(t),n=e.slice(0,34),r=Crypto.SHA256(Crypto.SHA256(n,{asBytes:!0}),{asBytes:!0});if(r[0]!=e[34]||r[1]!=e[35]||r[2]!=e[36]||r[3]!=e[37])throw"Checksum validation failed!";var o=n.shift();if(o!=i.privateKeyPrefix)throw"Version "+o+" not supported!";return n.pop(),n},i.isHexFormat=function(t){return t=t.toString(),/^[A-Fa-f0-9]{64}$/.test(t)},i.isWalletImportFormat=function(t){return t=t.toString(),128==i.privateKeyPrefix?/^5[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{50}$/.test(t):/^R[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{50}$/.test(t)},i.isCompressedWalletImportFormat=function(t){return t=t.toString(),128==i.privateKeyPrefix?/^[LK][123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{51}$/.test(t):/^R[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{51}$/.test(t)},i.isBase64Format=function(t){return t=t.toString(),/^[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789=+\/]{44}$/.test(t)},i.isBase6Format=function(t){return t=t.toString(),/^[012345]{99}$/.test(t)},i.isMiniFormat=function(t){t=t.toString();var e=/^S[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21}$/.test(t),n=/^S[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{25}$/.test(t),i=/^S[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{29}$/.test(t),r=Crypto.SHA256(t+"?",{asBytes:!0});return(0===r[0]||1===r[0])&&(e||n||i)},i}(),Bitcoin.Util={isArray:Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},makeFilledArray:function(t,e){for(var n=[],i=0;i<t;)n[i++]=e;return n},numToVarInt:function(t){return t<253?[t]:t<=65536?[253,t>>>8,255&t]:t<=1?[254].concat(Crypto.util.wordsToBytes([t])):[255].concat(Crypto.util.wordsToBytes([t>>>32,t]))},valueToBigInt:function(t){return t instanceof BigInteger?t:BigInteger.fromByteArrayUnsigned(t)},formatValue:function(t){for(var e=this.valueToBigInt(t).toString(),n=e.length>8?e.substr(0,e.length-8):"0",i=e.length>8?e.substr(e.length-8):e;i.length<8;)i="0"+i;for(i=i.replace(/0*$/,"");i.length<2;)i+="0";return n+"."+i},parseValue:function(t){for(var e=t.split("."),n=e[0],i=e[1]||"0";i.length<8;)i+="0";i=i.replace(/^0+/g,"");var r=BigInteger.valueOf(parseInt(n));return r=(r=r.multiply(BigInteger.valueOf(1e8))).add(BigInteger.valueOf(parseInt(i)))},sha256ripe160:function(t){return ripemd160(Crypto.SHA256(t,{asBytes:!0}),{asBytes:!0})},dsha256:function(t){return Crypto.SHA256(Crypto.SHA256(t,{asBytes:!0}),{asBytes:!0})},hasMethods:function(t){for(var e,n=1;e=arguments[n++];)if("function"!=typeof t[e])return!1;return!0}};const floCrypto={generateNewID:function(){try{var t=new Bitcoin.ECKey(!1);return t.setCompressed(!0),{floID:t.getBitcoinAddress(),pubKey:t.getPubKeyHex(),privKey:t.getBitcoinWalletImportFormat()}}catch(t){console.log(t)}},getPubKeyHex:function(t){var e=new Bitcoin.ECKey(t);if(null!=e.priv)return e.setCompressed(!0),e.getPubKeyHex()},getFloIDfromPubkeyHex:function(t){return(new Bitcoin.ECKey).setPub(t).getBitcoinAddress()},verifyPrivKey:function(t,e,n=!0){try{var i=new Bitcoin.ECKey(t);return null!=i.priv&&(i.setCompressed(!0),!(!n||e!=i.getBitcoinAddress())||!n&&e==i.getPubKeyHex())}catch(t){console.log(t)}},validateAddr:function(t){try{new Bitcoin.Address(t);return!0}catch{return!1}}},floBlockchainAPI={promisedAJAX:function(t,e){return new Promise((n,i)=>{var r=new XMLHttpRequest,o=`${floGlobals.apiURL[floGlobals.blockchain]}/${e}`;console.log(o),r.open(t,o,!0),r.onload=(t=>{4==r.readyState&&200==r.status?n(r.response):i(r.response)}),r.send()})},getBalance:function(t){return new Promise((e,n)=>{this.promisedAJAX("GET",`api/addr/${t}/balance`).then(t=>{e(t)}).catch(t=>{n(t)})})},sendTx:function(t,e,n,i,r=""){return new Promise((o,s)=>{if(floCrypto.validateAddr(t)?floCrypto.validateAddr(e)||s(`Invalid address : ${e}`):s(`Invalid address : ${t}`),i.length<1||!floCrypto.verifyPrivKey(i,t))s("Invalid Private key!");else if("number"!=typeof n||n<=0)s(`Invalid sendAmt : ${n}`);else{var a=bitjs.transaction(),u=0,c=floGlobals.fee;this.promisedAJAX("GET",`api/addr/${t}/utxo`).then(l=>{for(var d=JSON.parse(l),h=d.length-1;h>=0&&u<n+c&&d[h].confirmations;h--)a.addinput(d[h].txid,d[h].vout,d[h].scriptPubKey),u+=d[h].amount;if(u<n+c)s("Insufficient balance!");else{a.addoutput(e,n);var p=u-n-c;p>0&&a.addoutput(t,p),a.addflodata(r);var f=a.sign(i,1);this.broadcastTx(f).then(t=>{o(t)}).catch(t=>{s(t)})}}).catch(t=>{s(t)})}})},broadcastTx:function(t){return new Promise((e,n)=>{var i=new XMLHttpRequest,r=`${floGlobals.apiURL[floGlobals.blockchain]}/api/tx/send`;if(t.length<1)n("Empty Signature");else{var o=`{"rawtx":"${t}"}`;i.open("POST",r,!1),i.setRequestHeader("Content-type","application/json"),i.onload=function(){4==i.readyState&&200==i.status?(console.log(i.response),e(JSON.parse(i.response).txid.result)):n(i.responseText)},i.send(o)}})},getNewTxs:function(t,e){return new Promise((n,r)=>{this.promisedAJAX("GET",`api/addrs/${t}/txs?from=0&to=1`).then(o=>{var s=JSON.parse(o).totalItems-e;this.promisedAJAX("GET",`api/addrs/${t}/txs?from=0&to=${2*s}`).then(r=>{r=JSON.parse(r);var o=[];for(i=r.totalItems-e-1;i>=0;i--){if(r.items[i].isCoinBase)var s={time:r.items[i].time,txid:r.items[i].txid,sender:"(mined)"+r.items[i].vin[0].coinbase,receiver:t,floData:r.items[i].floData};else s={time:r.items[i].time,txid:r.items[i].txid,sender:r.items[i].vin[0].addr,receiver:r.items[i].vout[0].scriptPubKey.addresses[0],floData:r.items[i].floData};o.push(s)}n({totalItems:r.totalItems,items:o})}).catch(t=>{r(t)})}).catch(t=>{r(t)})})}};window.indexedDB=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,window.IDBTransaction=window.IDBTransaction||window.webkitIDBTransaction||window.msIDBTransaction,window.IDBKeyRange=window.IDBKeyRange||window.webkitIDBKeyRange||window.msIDBKeyRange,window.indexedDB||window.alert("Your browser doesn't support a stable version of IndexedDB.");const compactIDB={setDefaultDB:function(t){this.dbName=t},initDB:function(t,e={}){return new Promise((n,r)=>{this.dbName=this.dbName||t;var o=indexedDB.open(t);o.onerror=(t=>{r("Error in opening IndexedDB!")}),o.onupgradeneeded=(t=>{var n=t.target.result;for(obs in e){var r=n.createObjectStore(obs,e[obs].options||{});if(e[obs].indexes&&"object"==typeof e[obs].indexes)for(i in e[obs].indexes)r.createIndex(i,i,e[obs].indexes[i]||{})}}),o.onsuccess=(t=>{var i=t.target.result;JSON.stringify(Object.values(i.objectStoreNames).sort())===JSON.stringify(Object.keys(e).sort())?n("Initiated IndexedDB"):r("IndexedDB already exist with different ObjectStores!"),i.close()})})},openDB:function(t=this.dbName){return new Promise((e,n)=>{var i=indexedDB.open(t);i.onerror=(t=>n("Error in opening IndexedDB!")),i.onsuccess=(t=>e(t.target.result))})},deleteDB:function(t=this.dbName){return new Promise((e,n)=>{var i=indexedDB.deleteDatabase(t);i.onerror=(t=>n("Error deleting database!")),i.onsuccess=(t=>e("Database deleted successfully"))})},writeData:function(t,e,n=!1,i=this.dbName){return new Promise((r,o)=>{this.openDB(i).then(i=>{var s=i.transaction(t,"readwrite").objectStore(t);let a=n?s.put(e,n):s.put(e);a.onsuccess=(t=>r("Write data Successful")),a.onerror=(t=>o(`Write data unsuccessful [${t.target.error.name}] ${t.target.error.message}`)),i.close()}).catch(t=>o(t))})},addData:function(t,e,n=!1,i=this.dbName){return new Promise((r,o)=>{this.openDB(i).then(i=>{var s=i.transaction(t,"readwrite").objectStore(t);let a=n?s.add(e,n):s.add(e);a.onsuccess=(t=>r("Add data successful")),a.onerror=(t=>o(`Add data unsuccessful [${t.target.error.name}] ${t.target.error.message}`)),i.close()}).catch(t=>o(t))})},removeData:function(t,e,n=this.dbName){return new Promise((i,r)=>{this.openDB(n).then(n=>{let o=n.transaction(t,"readwrite").objectStore(t).delete(e);o.onsuccess=(t=>i(`Removed Data ${e}`)),o.onerror=(t=>r(`Remove data unsuccessful [${t.target.error.name}] ${t.target.error.message}`)),n.close()}).catch(t=>r(t))})},readData:function(t,e,n=this.dbName){return new Promise((i,r)=>{this.openDB(n).then(n=>{let o=n.transaction(t,"readonly").objectStore(t).get(e);o.onsuccess=(t=>i(t.target.result)),o.onerror=(t=>r(`Read data unsuccessful [${t.target.error.name}] ${t.target.error.message}`)),n.close()}).catch(t=>r(t))})},readAllData:function(t,e=this.dbName){return new Promise((n,i)=>{this.openDB(e).then(e=>{var r=e.transaction(t,"readonly").objectStore(t),o={};let s=r.openCursor();s.onsuccess=(t=>{var e=t.target.result;e?(o[e.primaryKey]=e.value,e.continue()):n(o)}),s.onerror=(t=>i(`Read-All data unsuccessful [${t.target.error.name}] ${t.target.error.message}`)),e.close()}).catch(t=>i(t))})},getAllData:function(t,e=this.dbName){return new Promise((n,i)=>{this.openDB(e).then(e=>{let r=e.transaction(t,"readonly").objectStore(t).getAll();r.onsuccess=(t=>n(t.target.result)),r.onerror=(t=>i(`Read data unsuccessful [${t.target.error.name}] ${t.target.error.message}`)),e.close()}).catch(t=>i(t))})},searchData:function(t,e,n=this.dbName){return new Promise((i,r)=>{this.openDB(n).then(n=>{var o=n.transaction(t,"readonly").objectStore(t),s={};let a=o.openCursor();a.onsuccess=(t=>{var n=t.target.result;n?(e(n.primaryKey,n.value)&&(s[n.primaryKey]=n.value),n.continue()):i(s)}),a.onerror=(t=>r(`Search unsuccessful [${t.target.error.name}] ${t.target.error.message}`)),n.close()}).catch(t=>r(t))})}};function onLoadStartUp(){compactIDB.initDB("FLOwebWallet",{lastSync:{},labels:{},transactions:{}}).then(t=>console.log(t)).catch(t=>console.log(t)),createAllCards(),setElements()}floWebWallet={generateNewAddr:function(){return new Promise((t,e)=>{try{t(floCrypto.generateNewID())}catch(t){e(t)}})},recoverAddr:function(t){return new Promise((e,n)=>{try{var i={};i.privKey=t,i.pubKey=floCrypto.getPubKeyHex(i.privKey),i.floID=floCrypto.getFloIDfromPubkeyHex(i.pubKey),e(i)}catch(t){n(t)}})},sendTransaction:function(t,e,n,i,r){return new Promise((o,s)=>{floBlockchainAPI.sendTx(t,e,n,r,i).then(t=>o(t)).catch(t=>s(t))})},syncTransactions:function(t){return new Promise((e,n)=>{compactIDB.readData("lastSync",t).then(n=>{n|=0,floBlockchainAPI.getNewTxs(t,n).then(n=>{compactIDB.readData("transactions",t).then(i=>{if(void 0===i)var r=compactIDB.addData("transactions",n.items,t);else r=compactIDB.writeData("transactions",i.concat(n.items),t);var o=compactIDB.writeData("lastSync",n.totalItems,t);Promise.all([r,o]).then(t=>e(n.items))})})}).catch(t=>n(t))})},readTransactions:function(t){return new Promise((e,n)=>{compactIDB.readData("transactions",t).then(t=>e(t)).catch(t=>n(t))})},getLabels:function(){return new Promise((t,e)=>{compactIDB.readAllData("labels").then(e=>t(e)).catch(t=>e(t))})}};
</script>
</body>
</html>