├── .DS_Store ├── .gitignore ├── CODE_OF_CONDUCT.md ├── LICENSE ├── README.md ├── admin-go ├── Dockerfile ├── auth │ └── auth.go ├── litbox-admin.go ├── logging │ └── logging.go ├── routes │ ├── home.go │ ├── login.go │ ├── render.go │ └── static.go ├── static │ ├── css │ │ ├── bootstrap.min.css │ │ └── style.css │ └── js │ │ ├── bootstrap.min.js │ │ └── jquery.min.js └── templates │ ├── base.html │ ├── index.html │ └── login.html ├── admin ├── .gitignore ├── Dockerfile ├── app.js ├── bin │ └── www ├── lit.js ├── package-lock.json ├── package.json ├── pairing.js ├── passport.config.js ├── public │ └── stylesheets │ │ ├── login.css │ │ ├── sticky-footer-navbar.css │ │ └── style.css ├── routes │ ├── auth.js │ ├── index.js │ ├── pair.js │ └── status.js ├── tunnel.js └── views │ ├── error.pug │ ├── index.pug │ ├── layout.pug │ ├── login.pug │ ├── pair.pug │ └── status.pug ├── build.sh ├── buildloop.sh ├── docker-compose.yml ├── init-dev.sh ├── init.sh ├── tor ├── Dockerfile ├── docker-entrypoint.sh └── torrc └── tunnel ├── Dockerfile ├── entrypoint.sh ├── generate_authorized_keys.sh └── sshd_config /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vertcoin-project/litbox/6fc2334ecc63bafd88ce5fa52545db627dad8798/.DS_Store -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | data/ 2 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. 6 | 7 | ## Our Standards 8 | 9 | Examples of behavior that contributes to creating a positive environment include: 10 | 11 | * Using welcoming and inclusive language 12 | * Being respectful of differing viewpoints and experiences 13 | * Gracefully accepting constructive criticism 14 | * Focusing on what is best for the community 15 | * Showing empathy towards other community members 16 | 17 | Examples of unacceptable behavior by participants include: 18 | 19 | * The use of sexualized language or imagery and unwelcome sexual attention or advances 20 | * Trolling, insulting/derogatory comments, and personal or political attacks 21 | * Public or private harassment 22 | * Publishing others' private information, such as a physical or electronic address, without explicit permission 23 | * Other conduct which could reasonably be considered inappropriate in a professional setting 24 | 25 | ## Our Responsibilities 26 | 27 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. 28 | 29 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. 30 | 31 | ## Scope 32 | 33 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. 34 | 35 | ## Enforcement 36 | 37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at contact@vertcoin.org. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. 38 | 39 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. 40 | 41 | ## Attribution 42 | 43 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [https://contributor-covenant.org/version/1/4][version] 44 | 45 | [homepage]: https://contributor-covenant.org 46 | [version]: https://contributor-covenant.org/version/1/4/ 47 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017-present The Vertcoin developers 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # litbox 2 | -------------------------------------------------------------------------------- /admin-go/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:alpine 2 | 3 | RUN apk update && apk upgrade && \ 4 | apk add --no-cache bash git openssh gcc musl-dev 5 | 6 | WORKDIR /go/src/github.com/gertjaap/litbox 7 | COPY . . 8 | RUN go get -d -v ./... 9 | RUN go install -v ./... 10 | 11 | ENTRYPOINT ["litbox"] -------------------------------------------------------------------------------- /admin-go/auth/auth.go: -------------------------------------------------------------------------------- 1 | package auth 2 | 3 | import ( 4 | "github.com/dgrijalva/jwt-go" 5 | "github.com/gertjaap/litbox/logging" 6 | "net/http" 7 | "time" 8 | ) 9 | 10 | // Todo: generate key on first startup and store it in a file. 11 | func signingKey() []byte { 12 | return []byte("testsigningkey") 13 | } 14 | 15 | // Authentication middleware. Will check if a valid JWT is part 16 | // of the client's cookies and redirect the user to the login page 17 | // if this is not the case. 18 | func AuthenticationGuard(h http.HandlerFunc) http.HandlerFunc { 19 | return func(w http.ResponseWriter, r *http.Request) { 20 | 21 | cookie, _ := r.Cookie("jwt") 22 | if(cookie == nil) { 23 | http.Redirect(w, r, "/login", 301); 24 | return 25 | } 26 | 27 | token, err := jwt.ParseWithClaims(cookie.Value, &jwt.StandardClaims{}, func(token *jwt.Token) (interface{}, error) { 28 | return signingKey(), nil 29 | }); 30 | if err != nil { 31 | logging.Error.Printf("Error parsing JWT", err); 32 | http.Redirect(w, r, "/login", 301); 33 | return 34 | } 35 | 36 | if token.Valid { 37 | h(w, r); 38 | } else { 39 | http.Redirect(w, r, "/login", 301); 40 | return 41 | } 42 | } 43 | } 44 | 45 | // Authentication endpoint. Will return a JWT cookie and redirect the 46 | // user to the homepage if authentication is succesful, or will return 47 | // the user to the login page if not. 48 | func Login(w http.ResponseWriter, r *http.Request) { 49 | 50 | // Create the Claims 51 | claims := &jwt.StandardClaims{ 52 | ExpiresAt: time.Now().Add(60 * time.Minute).Unix(), 53 | Issuer: "test", 54 | } 55 | 56 | token := jwt.NewWithClaims(jwt.SigningMethodHS256, claims) 57 | ss, err := token.SignedString(signingKey()) 58 | if err != nil { 59 | w.WriteHeader(http.StatusInternalServerError) 60 | w.Write([]byte("Internal server error")) 61 | return 62 | } 63 | expiration := time.Now().Add(60 * time.Minute) 64 | cookie := http.Cookie{Name: "jwt", Value: ss, Expires: expiration} 65 | http.SetCookie(w, &cookie) 66 | http.Redirect(w, r, "/", 301); 67 | } 68 | 69 | func Logout(w http.ResponseWriter, r *http.Request) { 70 | expiration := time.Now().Add(-60 * time.Minute) 71 | cookie := http.Cookie{Name: "jwt", Value: "", Expires: expiration} 72 | http.SetCookie(w, &cookie) 73 | http.Redirect(w, r, "/", 301); 74 | } -------------------------------------------------------------------------------- /admin-go/litbox-admin.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "github.com/gertjaap/litbox/auth" 5 | "github.com/gertjaap/litbox/logging" 6 | "github.com/gertjaap/litbox/routes" 7 | "net/http" 8 | "os" 9 | ) 10 | 11 | 12 | 13 | func main() { 14 | logging.Init(os.Stdout, os.Stdout, os.Stdout, os.Stdout) 15 | 16 | http.HandleFunc("/", auth.AuthenticationGuard(routes.Home)) 17 | http.HandleFunc("/login", routes.Login); 18 | http.HandleFunc("/logout", routes.Logout); 19 | http.HandleFunc(routes.STATIC_URL, routes.Static) 20 | err := http.ListenAndServe(":3000", nil) 21 | if err != nil { 22 | logging.Error.Println("ListenAndServe: ", err) 23 | } 24 | } -------------------------------------------------------------------------------- /admin-go/logging/logging.go: -------------------------------------------------------------------------------- 1 | package logging 2 | 3 | import ( 4 | "io" 5 | "log" 6 | ) 7 | 8 | var ( 9 | Trace *log.Logger 10 | Info *log.Logger 11 | Warning *log.Logger 12 | Error *log.Logger 13 | ) 14 | 15 | func Init( 16 | traceHandle io.Writer, 17 | infoHandle io.Writer, 18 | warningHandle io.Writer, 19 | errorHandle io.Writer) { 20 | 21 | Trace = log.New(traceHandle, 22 | "TRACE: ", 23 | log.Ldate|log.Ltime|log.Lshortfile) 24 | 25 | Info = log.New(infoHandle, 26 | "INFO: ", 27 | log.Ldate|log.Ltime|log.Lshortfile) 28 | 29 | Warning = log.New(warningHandle, 30 | "WARNING: ", 31 | log.Ldate|log.Ltime|log.Lshortfile) 32 | 33 | Error = log.New(errorHandle, 34 | "ERROR: ", 35 | log.Ldate|log.Ltime|log.Lshortfile) 36 | } 37 | -------------------------------------------------------------------------------- /admin-go/routes/home.go: -------------------------------------------------------------------------------- 1 | package routes 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | func Home(w http.ResponseWriter, req *http.Request) { 8 | context := Context{Title: "Welcome!"} 9 | Render(w, "index", context) 10 | } 11 | -------------------------------------------------------------------------------- /admin-go/routes/login.go: -------------------------------------------------------------------------------- 1 | package routes 2 | 3 | import ( 4 | "github.com/gertjaap/litbox/auth" 5 | "net/http" 6 | ) 7 | 8 | func Login(w http.ResponseWriter, r *http.Request) { 9 | if r.Method == "GET" { 10 | context := Context{Title: "Welcome!"} 11 | Render(w, "login", context) 12 | } else if r.Method == "POST" { 13 | auth.Login(w, r); 14 | } 15 | } 16 | 17 | func Logout(w http.ResponseWriter, r *http.Request) { 18 | auth.Logout(w, r); 19 | } 20 | -------------------------------------------------------------------------------- /admin-go/routes/render.go: -------------------------------------------------------------------------------- 1 | package routes 2 | 3 | import ( 4 | "fmt" 5 | "html/template" 6 | "log" 7 | "net/http" 8 | ) 9 | 10 | type Context struct { 11 | Title string 12 | Static string 13 | } 14 | 15 | func Render(w http.ResponseWriter, tmpl string, context Context) { 16 | context.Static = STATIC_URL 17 | tmpl_list := []string{"templates/base.html", 18 | fmt.Sprintf("templates/%s.html", tmpl)} 19 | t, err := template.ParseFiles(tmpl_list...) 20 | if err != nil { 21 | log.Print("template parsing error: ", err) 22 | } 23 | err = t.Execute(w, context) 24 | if err != nil { 25 | log.Print("template executing error: ", err) 26 | } 27 | } -------------------------------------------------------------------------------- /admin-go/routes/static.go: -------------------------------------------------------------------------------- 1 | package routes 2 | 3 | import ( 4 | "io" 5 | "net/http" 6 | "time" 7 | ) 8 | 9 | const STATIC_URL string = "/static/" 10 | const STATIC_ROOT string = "static/" 11 | 12 | func Static(w http.ResponseWriter, req *http.Request) { 13 | static_file := req.URL.Path[len(STATIC_URL):] 14 | if len(static_file) != 0 { 15 | f, err := http.Dir(STATIC_ROOT).Open(static_file) 16 | if err == nil { 17 | content := io.ReadSeeker(f) 18 | http.ServeContent(w, req, static_file, time.Now(), content) 19 | return 20 | } 21 | } 22 | http.NotFound(w, req) 23 | } -------------------------------------------------------------------------------- /admin-go/static/css/style.css: -------------------------------------------------------------------------------- 1 | /* Sticky footer styles 2 | -------------------------------------------------- */ 3 | html { 4 | position: relative; 5 | min-height: 100%; 6 | } 7 | body { 8 | /* Margin bottom by footer height */ 9 | margin-bottom: 60px; 10 | } 11 | .footer { 12 | position: absolute; 13 | bottom: 0; 14 | width: 100%; 15 | /* Set the fixed height of the footer here */ 16 | height: 60px; 17 | background-color: #f5f5f5; 18 | } 19 | 20 | 21 | /* Custom page CSS 22 | -------------------------------------------------- */ 23 | /* Not required for template or sticky footer method. */ 24 | 25 | body > .container { 26 | padding: 60px 15px 0; 27 | } 28 | .container .text-muted { 29 | margin: 20px 0; 30 | } 31 | 32 | .footer > .container { 33 | padding-right: 15px; 34 | padding-left: 15px; 35 | line-height: 60px; 36 | } 37 | 38 | code { 39 | font-size: 80%; 40 | } 41 | 42 | nav.navbar { 43 | background-color: #e0e0e0; 44 | } -------------------------------------------------------------------------------- /admin-go/static/js/bootstrap.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap v4.0.0 (https://getbootstrap.com) 3 | * Copyright 2011-2018 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 4 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 5 | */ 6 | !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("jquery"),require("popper.js")):"function"==typeof define&&define.amd?define(["exports","jquery","popper.js"],e):e(t.bootstrap={},t.jQuery,t.Popper)}(this,function(t,e,n){"use strict";function i(t,e){for(var n=0;n0?i:null}catch(t){return null}},reflow:function(t){return t.offsetHeight},triggerTransitionEnd:function(n){t(n).trigger(e.end)},supportsTransitionEnd:function(){return Boolean(e)},isElement:function(t){return(t[0]||t).nodeType},typeCheckConfig:function(t,e,n){for(var s in n)if(Object.prototype.hasOwnProperty.call(n,s)){var r=n[s],o=e[s],a=o&&i.isElement(o)?"element":(l=o,{}.toString.call(l).match(/\s([a-zA-Z]+)/)[1].toLowerCase());if(!new RegExp(r).test(a))throw new Error(t.toUpperCase()+': Option "'+s+'" provided type "'+a+'" but expected type "'+r+'".')}var l}};return e=("undefined"==typeof window||!window.QUnit)&&{end:"transitionend"},t.fn.emulateTransitionEnd=n,i.supportsTransitionEnd()&&(t.event.special[i.TRANSITION_END]={bindType:e.end,delegateType:e.end,handle:function(e){if(t(e.target).is(this))return e.handleObj.handler.apply(this,arguments)}}),i}(e),L=(a="alert",h="."+(l="bs.alert"),c=(o=e).fn[a],u={CLOSE:"close"+h,CLOSED:"closed"+h,CLICK_DATA_API:"click"+h+".data-api"},f="alert",d="fade",_="show",g=function(){function t(t){this._element=t}var e=t.prototype;return e.close=function(t){t=t||this._element;var e=this._getRootElement(t);this._triggerCloseEvent(e).isDefaultPrevented()||this._removeElement(e)},e.dispose=function(){o.removeData(this._element,l),this._element=null},e._getRootElement=function(t){var e=P.getSelectorFromElement(t),n=!1;return e&&(n=o(e)[0]),n||(n=o(t).closest("."+f)[0]),n},e._triggerCloseEvent=function(t){var e=o.Event(u.CLOSE);return o(t).trigger(e),e},e._removeElement=function(t){var e=this;o(t).removeClass(_),P.supportsTransitionEnd()&&o(t).hasClass(d)?o(t).one(P.TRANSITION_END,function(n){return e._destroyElement(t,n)}).emulateTransitionEnd(150):this._destroyElement(t)},e._destroyElement=function(t){o(t).detach().trigger(u.CLOSED).remove()},t._jQueryInterface=function(e){return this.each(function(){var n=o(this),i=n.data(l);i||(i=new t(this),n.data(l,i)),"close"===e&&i[e](this)})},t._handleDismiss=function(t){return function(e){e&&e.preventDefault(),t.close(this)}},s(t,null,[{key:"VERSION",get:function(){return"4.0.0"}}]),t}(),o(document).on(u.CLICK_DATA_API,'[data-dismiss="alert"]',g._handleDismiss(new g)),o.fn[a]=g._jQueryInterface,o.fn[a].Constructor=g,o.fn[a].noConflict=function(){return o.fn[a]=c,g._jQueryInterface},g),R=(m="button",E="."+(v="bs.button"),T=".data-api",y=(p=e).fn[m],C="active",I="btn",A="focus",b='[data-toggle^="button"]',D='[data-toggle="buttons"]',S="input",w=".active",N=".btn",O={CLICK_DATA_API:"click"+E+T,FOCUS_BLUR_DATA_API:"focus"+E+T+" blur"+E+T},k=function(){function t(t){this._element=t}var e=t.prototype;return e.toggle=function(){var t=!0,e=!0,n=p(this._element).closest(D)[0];if(n){var i=p(this._element).find(S)[0];if(i){if("radio"===i.type)if(i.checked&&p(this._element).hasClass(C))t=!1;else{var s=p(n).find(w)[0];s&&p(s).removeClass(C)}if(t){if(i.hasAttribute("disabled")||n.hasAttribute("disabled")||i.classList.contains("disabled")||n.classList.contains("disabled"))return;i.checked=!p(this._element).hasClass(C),p(i).trigger("change")}i.focus(),e=!1}}e&&this._element.setAttribute("aria-pressed",!p(this._element).hasClass(C)),t&&p(this._element).toggleClass(C)},e.dispose=function(){p.removeData(this._element,v),this._element=null},t._jQueryInterface=function(e){return this.each(function(){var n=p(this).data(v);n||(n=new t(this),p(this).data(v,n)),"toggle"===e&&n[e]()})},s(t,null,[{key:"VERSION",get:function(){return"4.0.0"}}]),t}(),p(document).on(O.CLICK_DATA_API,b,function(t){t.preventDefault();var e=t.target;p(e).hasClass(I)||(e=p(e).closest(N)),k._jQueryInterface.call(p(e),"toggle")}).on(O.FOCUS_BLUR_DATA_API,b,function(t){var e=p(t.target).closest(N)[0];p(e).toggleClass(A,/^focus(in)?$/.test(t.type))}),p.fn[m]=k._jQueryInterface,p.fn[m].Constructor=k,p.fn[m].noConflict=function(){return p.fn[m]=y,k._jQueryInterface},k),j=function(t){var e="carousel",n="bs.carousel",i="."+n,o=t.fn[e],a={interval:5e3,keyboard:!0,slide:!1,pause:"hover",wrap:!0},l={interval:"(number|boolean)",keyboard:"boolean",slide:"(boolean|string)",pause:"(string|boolean)",wrap:"boolean"},h="next",c="prev",u="left",f="right",d={SLIDE:"slide"+i,SLID:"slid"+i,KEYDOWN:"keydown"+i,MOUSEENTER:"mouseenter"+i,MOUSELEAVE:"mouseleave"+i,TOUCHEND:"touchend"+i,LOAD_DATA_API:"load"+i+".data-api",CLICK_DATA_API:"click"+i+".data-api"},_="carousel",g="active",p="slide",m="carousel-item-right",v="carousel-item-left",E="carousel-item-next",T="carousel-item-prev",y={ACTIVE:".active",ACTIVE_ITEM:".active.carousel-item",ITEM:".carousel-item",NEXT_PREV:".carousel-item-next, .carousel-item-prev",INDICATORS:".carousel-indicators",DATA_SLIDE:"[data-slide], [data-slide-to]",DATA_RIDE:'[data-ride="carousel"]'},C=function(){function o(e,n){this._items=null,this._interval=null,this._activeElement=null,this._isPaused=!1,this._isSliding=!1,this.touchTimeout=null,this._config=this._getConfig(n),this._element=t(e)[0],this._indicatorsElement=t(this._element).find(y.INDICATORS)[0],this._addEventListeners()}var C=o.prototype;return C.next=function(){this._isSliding||this._slide(h)},C.nextWhenVisible=function(){!document.hidden&&t(this._element).is(":visible")&&"hidden"!==t(this._element).css("visibility")&&this.next()},C.prev=function(){this._isSliding||this._slide(c)},C.pause=function(e){e||(this._isPaused=!0),t(this._element).find(y.NEXT_PREV)[0]&&P.supportsTransitionEnd()&&(P.triggerTransitionEnd(this._element),this.cycle(!0)),clearInterval(this._interval),this._interval=null},C.cycle=function(t){t||(this._isPaused=!1),this._interval&&(clearInterval(this._interval),this._interval=null),this._config.interval&&!this._isPaused&&(this._interval=setInterval((document.visibilityState?this.nextWhenVisible:this.next).bind(this),this._config.interval))},C.to=function(e){var n=this;this._activeElement=t(this._element).find(y.ACTIVE_ITEM)[0];var i=this._getItemIndex(this._activeElement);if(!(e>this._items.length-1||e<0))if(this._isSliding)t(this._element).one(d.SLID,function(){return n.to(e)});else{if(i===e)return this.pause(),void this.cycle();var s=e>i?h:c;this._slide(s,this._items[e])}},C.dispose=function(){t(this._element).off(i),t.removeData(this._element,n),this._items=null,this._config=null,this._element=null,this._interval=null,this._isPaused=null,this._isSliding=null,this._activeElement=null,this._indicatorsElement=null},C._getConfig=function(t){return t=r({},a,t),P.typeCheckConfig(e,t,l),t},C._addEventListeners=function(){var e=this;this._config.keyboard&&t(this._element).on(d.KEYDOWN,function(t){return e._keydown(t)}),"hover"===this._config.pause&&(t(this._element).on(d.MOUSEENTER,function(t){return e.pause(t)}).on(d.MOUSELEAVE,function(t){return e.cycle(t)}),"ontouchstart"in document.documentElement&&t(this._element).on(d.TOUCHEND,function(){e.pause(),e.touchTimeout&&clearTimeout(e.touchTimeout),e.touchTimeout=setTimeout(function(t){return e.cycle(t)},500+e._config.interval)}))},C._keydown=function(t){if(!/input|textarea/i.test(t.target.tagName))switch(t.which){case 37:t.preventDefault(),this.prev();break;case 39:t.preventDefault(),this.next()}},C._getItemIndex=function(e){return this._items=t.makeArray(t(e).parent().find(y.ITEM)),this._items.indexOf(e)},C._getItemByDirection=function(t,e){var n=t===h,i=t===c,s=this._getItemIndex(e),r=this._items.length-1;if((i&&0===s||n&&s===r)&&!this._config.wrap)return e;var o=(s+(t===c?-1:1))%this._items.length;return-1===o?this._items[this._items.length-1]:this._items[o]},C._triggerSlideEvent=function(e,n){var i=this._getItemIndex(e),s=this._getItemIndex(t(this._element).find(y.ACTIVE_ITEM)[0]),r=t.Event(d.SLIDE,{relatedTarget:e,direction:n,from:s,to:i});return t(this._element).trigger(r),r},C._setActiveIndicatorElement=function(e){if(this._indicatorsElement){t(this._indicatorsElement).find(y.ACTIVE).removeClass(g);var n=this._indicatorsElement.children[this._getItemIndex(e)];n&&t(n).addClass(g)}},C._slide=function(e,n){var i,s,r,o=this,a=t(this._element).find(y.ACTIVE_ITEM)[0],l=this._getItemIndex(a),c=n||a&&this._getItemByDirection(e,a),_=this._getItemIndex(c),C=Boolean(this._interval);if(e===h?(i=v,s=E,r=u):(i=m,s=T,r=f),c&&t(c).hasClass(g))this._isSliding=!1;else if(!this._triggerSlideEvent(c,r).isDefaultPrevented()&&a&&c){this._isSliding=!0,C&&this.pause(),this._setActiveIndicatorElement(c);var I=t.Event(d.SLID,{relatedTarget:c,direction:r,from:l,to:_});P.supportsTransitionEnd()&&t(this._element).hasClass(p)?(t(c).addClass(s),P.reflow(c),t(a).addClass(i),t(c).addClass(i),t(a).one(P.TRANSITION_END,function(){t(c).removeClass(i+" "+s).addClass(g),t(a).removeClass(g+" "+s+" "+i),o._isSliding=!1,setTimeout(function(){return t(o._element).trigger(I)},0)}).emulateTransitionEnd(600)):(t(a).removeClass(g),t(c).addClass(g),this._isSliding=!1,t(this._element).trigger(I)),C&&this.cycle()}},o._jQueryInterface=function(e){return this.each(function(){var i=t(this).data(n),s=r({},a,t(this).data());"object"==typeof e&&(s=r({},s,e));var l="string"==typeof e?e:s.slide;if(i||(i=new o(this,s),t(this).data(n,i)),"number"==typeof e)i.to(e);else if("string"==typeof l){if("undefined"==typeof i[l])throw new TypeError('No method named "'+l+'"');i[l]()}else s.interval&&(i.pause(),i.cycle())})},o._dataApiClickHandler=function(e){var i=P.getSelectorFromElement(this);if(i){var s=t(i)[0];if(s&&t(s).hasClass(_)){var a=r({},t(s).data(),t(this).data()),l=this.getAttribute("data-slide-to");l&&(a.interval=!1),o._jQueryInterface.call(t(s),a),l&&t(s).data(n).to(l),e.preventDefault()}}},s(o,null,[{key:"VERSION",get:function(){return"4.0.0"}},{key:"Default",get:function(){return a}}]),o}();return t(document).on(d.CLICK_DATA_API,y.DATA_SLIDE,C._dataApiClickHandler),t(window).on(d.LOAD_DATA_API,function(){t(y.DATA_RIDE).each(function(){var e=t(this);C._jQueryInterface.call(e,e.data())})}),t.fn[e]=C._jQueryInterface,t.fn[e].Constructor=C,t.fn[e].noConflict=function(){return t.fn[e]=o,C._jQueryInterface},C}(e),H=function(t){var e="collapse",n="bs.collapse",i="."+n,o=t.fn[e],a={toggle:!0,parent:""},l={toggle:"boolean",parent:"(string|element)"},h={SHOW:"show"+i,SHOWN:"shown"+i,HIDE:"hide"+i,HIDDEN:"hidden"+i,CLICK_DATA_API:"click"+i+".data-api"},c="show",u="collapse",f="collapsing",d="collapsed",_="width",g="height",p={ACTIVES:".show, .collapsing",DATA_TOGGLE:'[data-toggle="collapse"]'},m=function(){function i(e,n){this._isTransitioning=!1,this._element=e,this._config=this._getConfig(n),this._triggerArray=t.makeArray(t('[data-toggle="collapse"][href="#'+e.id+'"],[data-toggle="collapse"][data-target="#'+e.id+'"]'));for(var i=t(p.DATA_TOGGLE),s=0;s0&&(this._selector=o,this._triggerArray.push(r))}this._parent=this._config.parent?this._getParent():null,this._config.parent||this._addAriaAndCollapsedClass(this._element,this._triggerArray),this._config.toggle&&this.toggle()}var o=i.prototype;return o.toggle=function(){t(this._element).hasClass(c)?this.hide():this.show()},o.show=function(){var e,s,r=this;if(!this._isTransitioning&&!t(this._element).hasClass(c)&&(this._parent&&0===(e=t.makeArray(t(this._parent).find(p.ACTIVES).filter('[data-parent="'+this._config.parent+'"]'))).length&&(e=null),!(e&&(s=t(e).not(this._selector).data(n))&&s._isTransitioning))){var o=t.Event(h.SHOW);if(t(this._element).trigger(o),!o.isDefaultPrevented()){e&&(i._jQueryInterface.call(t(e).not(this._selector),"hide"),s||t(e).data(n,null));var a=this._getDimension();t(this._element).removeClass(u).addClass(f),this._element.style[a]=0,this._triggerArray.length>0&&t(this._triggerArray).removeClass(d).attr("aria-expanded",!0),this.setTransitioning(!0);var l=function(){t(r._element).removeClass(f).addClass(u).addClass(c),r._element.style[a]="",r.setTransitioning(!1),t(r._element).trigger(h.SHOWN)};if(P.supportsTransitionEnd()){var _="scroll"+(a[0].toUpperCase()+a.slice(1));t(this._element).one(P.TRANSITION_END,l).emulateTransitionEnd(600),this._element.style[a]=this._element[_]+"px"}else l()}}},o.hide=function(){var e=this;if(!this._isTransitioning&&t(this._element).hasClass(c)){var n=t.Event(h.HIDE);if(t(this._element).trigger(n),!n.isDefaultPrevented()){var i=this._getDimension();if(this._element.style[i]=this._element.getBoundingClientRect()[i]+"px",P.reflow(this._element),t(this._element).addClass(f).removeClass(u).removeClass(c),this._triggerArray.length>0)for(var s=0;s0&&t(n).toggleClass(d,!i).attr("aria-expanded",i)}},i._getTargetFromElement=function(e){var n=P.getSelectorFromElement(e);return n?t(n)[0]:null},i._jQueryInterface=function(e){return this.each(function(){var s=t(this),o=s.data(n),l=r({},a,s.data(),"object"==typeof e&&e);if(!o&&l.toggle&&/show|hide/.test(e)&&(l.toggle=!1),o||(o=new i(this,l),s.data(n,o)),"string"==typeof e){if("undefined"==typeof o[e])throw new TypeError('No method named "'+e+'"');o[e]()}})},s(i,null,[{key:"VERSION",get:function(){return"4.0.0"}},{key:"Default",get:function(){return a}}]),i}();return t(document).on(h.CLICK_DATA_API,p.DATA_TOGGLE,function(e){"A"===e.currentTarget.tagName&&e.preventDefault();var i=t(this),s=P.getSelectorFromElement(this);t(s).each(function(){var e=t(this),s=e.data(n)?"toggle":i.data();m._jQueryInterface.call(e,s)})}),t.fn[e]=m._jQueryInterface,t.fn[e].Constructor=m,t.fn[e].noConflict=function(){return t.fn[e]=o,m._jQueryInterface},m}(e),W=function(t){var e="dropdown",i="bs.dropdown",o="."+i,a=".data-api",l=t.fn[e],h=new RegExp("38|40|27"),c={HIDE:"hide"+o,HIDDEN:"hidden"+o,SHOW:"show"+o,SHOWN:"shown"+o,CLICK:"click"+o,CLICK_DATA_API:"click"+o+a,KEYDOWN_DATA_API:"keydown"+o+a,KEYUP_DATA_API:"keyup"+o+a},u="disabled",f="show",d="dropup",_="dropright",g="dropleft",p="dropdown-menu-right",m="dropdown-menu-left",v="position-static",E='[data-toggle="dropdown"]',T=".dropdown form",y=".dropdown-menu",C=".navbar-nav",I=".dropdown-menu .dropdown-item:not(.disabled)",A="top-start",b="top-end",D="bottom-start",S="bottom-end",w="right-start",N="left-start",O={offset:0,flip:!0,boundary:"scrollParent"},k={offset:"(number|string|function)",flip:"boolean",boundary:"(string|element)"},L=function(){function a(t,e){this._element=t,this._popper=null,this._config=this._getConfig(e),this._menu=this._getMenuElement(),this._inNavbar=this._detectNavbar(),this._addEventListeners()}var l=a.prototype;return l.toggle=function(){if(!this._element.disabled&&!t(this._element).hasClass(u)){var e=a._getParentFromElement(this._element),i=t(this._menu).hasClass(f);if(a._clearMenus(),!i){var s={relatedTarget:this._element},r=t.Event(c.SHOW,s);if(t(e).trigger(r),!r.isDefaultPrevented()){if(!this._inNavbar){if("undefined"==typeof n)throw new TypeError("Bootstrap dropdown require Popper.js (https://popper.js.org)");var o=this._element;t(e).hasClass(d)&&(t(this._menu).hasClass(m)||t(this._menu).hasClass(p))&&(o=e),"scrollParent"!==this._config.boundary&&t(e).addClass(v),this._popper=new n(o,this._menu,this._getPopperConfig())}"ontouchstart"in document.documentElement&&0===t(e).closest(C).length&&t("body").children().on("mouseover",null,t.noop),this._element.focus(),this._element.setAttribute("aria-expanded",!0),t(this._menu).toggleClass(f),t(e).toggleClass(f).trigger(t.Event(c.SHOWN,s))}}}},l.dispose=function(){t.removeData(this._element,i),t(this._element).off(o),this._element=null,this._menu=null,null!==this._popper&&(this._popper.destroy(),this._popper=null)},l.update=function(){this._inNavbar=this._detectNavbar(),null!==this._popper&&this._popper.scheduleUpdate()},l._addEventListeners=function(){var e=this;t(this._element).on(c.CLICK,function(t){t.preventDefault(),t.stopPropagation(),e.toggle()})},l._getConfig=function(n){return n=r({},this.constructor.Default,t(this._element).data(),n),P.typeCheckConfig(e,n,this.constructor.DefaultType),n},l._getMenuElement=function(){if(!this._menu){var e=a._getParentFromElement(this._element);this._menu=t(e).find(y)[0]}return this._menu},l._getPlacement=function(){var e=t(this._element).parent(),n=D;return e.hasClass(d)?(n=A,t(this._menu).hasClass(p)&&(n=b)):e.hasClass(_)?n=w:e.hasClass(g)?n=N:t(this._menu).hasClass(p)&&(n=S),n},l._detectNavbar=function(){return t(this._element).closest(".navbar").length>0},l._getPopperConfig=function(){var t=this,e={};return"function"==typeof this._config.offset?e.fn=function(e){return e.offsets=r({},e.offsets,t._config.offset(e.offsets)||{}),e}:e.offset=this._config.offset,{placement:this._getPlacement(),modifiers:{offset:e,flip:{enabled:this._config.flip},preventOverflow:{boundariesElement:this._config.boundary}}}},a._jQueryInterface=function(e){return this.each(function(){var n=t(this).data(i);if(n||(n=new a(this,"object"==typeof e?e:null),t(this).data(i,n)),"string"==typeof e){if("undefined"==typeof n[e])throw new TypeError('No method named "'+e+'"');n[e]()}})},a._clearMenus=function(e){if(!e||3!==e.which&&("keyup"!==e.type||9===e.which))for(var n=t.makeArray(t(E)),s=0;s0&&r--,40===e.which&&rdocument.documentElement.clientHeight;!this._isBodyOverflowing&&t&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),this._isBodyOverflowing&&!t&&(this._element.style.paddingRight=this._scrollbarWidth+"px")},p._resetAdjustments=function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""},p._checkScrollbar=function(){var t=document.body.getBoundingClientRect();this._isBodyOverflowing=t.left+t.right
',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:0,container:!1,fallbackPlacement:"flip",boundary:"scrollParent"},f="show",d="out",_={HIDE:"hide"+o,HIDDEN:"hidden"+o,SHOW:"show"+o,SHOWN:"shown"+o,INSERTED:"inserted"+o,CLICK:"click"+o,FOCUSIN:"focusin"+o,FOCUSOUT:"focusout"+o,MOUSEENTER:"mouseenter"+o,MOUSELEAVE:"mouseleave"+o},g="fade",p="show",m=".tooltip-inner",v=".arrow",E="hover",T="focus",y="click",C="manual",I=function(){function a(t,e){if("undefined"==typeof n)throw new TypeError("Bootstrap tooltips require Popper.js (https://popper.js.org)");this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._popper=null,this.element=t,this.config=this._getConfig(e),this.tip=null,this._setListeners()}var I=a.prototype;return I.enable=function(){this._isEnabled=!0},I.disable=function(){this._isEnabled=!1},I.toggleEnabled=function(){this._isEnabled=!this._isEnabled},I.toggle=function(e){if(this._isEnabled)if(e){var n=this.constructor.DATA_KEY,i=t(e.currentTarget).data(n);i||(i=new this.constructor(e.currentTarget,this._getDelegateConfig()),t(e.currentTarget).data(n,i)),i._activeTrigger.click=!i._activeTrigger.click,i._isWithActiveTrigger()?i._enter(null,i):i._leave(null,i)}else{if(t(this.getTipElement()).hasClass(p))return void this._leave(null,this);this._enter(null,this)}},I.dispose=function(){clearTimeout(this._timeout),t.removeData(this.element,this.constructor.DATA_KEY),t(this.element).off(this.constructor.EVENT_KEY),t(this.element).closest(".modal").off("hide.bs.modal"),this.tip&&t(this.tip).remove(),this._isEnabled=null,this._timeout=null,this._hoverState=null,this._activeTrigger=null,null!==this._popper&&this._popper.destroy(),this._popper=null,this.element=null,this.config=null,this.tip=null},I.show=function(){var e=this;if("none"===t(this.element).css("display"))throw new Error("Please use show on visible elements");var i=t.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){t(this.element).trigger(i);var s=t.contains(this.element.ownerDocument.documentElement,this.element);if(i.isDefaultPrevented()||!s)return;var r=this.getTipElement(),o=P.getUID(this.constructor.NAME);r.setAttribute("id",o),this.element.setAttribute("aria-describedby",o),this.setContent(),this.config.animation&&t(r).addClass(g);var l="function"==typeof this.config.placement?this.config.placement.call(this,r,this.element):this.config.placement,h=this._getAttachment(l);this.addAttachmentClass(h);var c=!1===this.config.container?document.body:t(this.config.container);t(r).data(this.constructor.DATA_KEY,this),t.contains(this.element.ownerDocument.documentElement,this.tip)||t(r).appendTo(c),t(this.element).trigger(this.constructor.Event.INSERTED),this._popper=new n(this.element,r,{placement:h,modifiers:{offset:{offset:this.config.offset},flip:{behavior:this.config.fallbackPlacement},arrow:{element:v},preventOverflow:{boundariesElement:this.config.boundary}},onCreate:function(t){t.originalPlacement!==t.placement&&e._handlePopperPlacementChange(t)},onUpdate:function(t){e._handlePopperPlacementChange(t)}}),t(r).addClass(p),"ontouchstart"in document.documentElement&&t("body").children().on("mouseover",null,t.noop);var u=function(){e.config.animation&&e._fixTransition();var n=e._hoverState;e._hoverState=null,t(e.element).trigger(e.constructor.Event.SHOWN),n===d&&e._leave(null,e)};P.supportsTransitionEnd()&&t(this.tip).hasClass(g)?t(this.tip).one(P.TRANSITION_END,u).emulateTransitionEnd(a._TRANSITION_DURATION):u()}},I.hide=function(e){var n=this,i=this.getTipElement(),s=t.Event(this.constructor.Event.HIDE),r=function(){n._hoverState!==f&&i.parentNode&&i.parentNode.removeChild(i),n._cleanTipClass(),n.element.removeAttribute("aria-describedby"),t(n.element).trigger(n.constructor.Event.HIDDEN),null!==n._popper&&n._popper.destroy(),e&&e()};t(this.element).trigger(s),s.isDefaultPrevented()||(t(i).removeClass(p),"ontouchstart"in document.documentElement&&t("body").children().off("mouseover",null,t.noop),this._activeTrigger[y]=!1,this._activeTrigger[T]=!1,this._activeTrigger[E]=!1,P.supportsTransitionEnd()&&t(this.tip).hasClass(g)?t(i).one(P.TRANSITION_END,r).emulateTransitionEnd(150):r(),this._hoverState="")},I.update=function(){null!==this._popper&&this._popper.scheduleUpdate()},I.isWithContent=function(){return Boolean(this.getTitle())},I.addAttachmentClass=function(e){t(this.getTipElement()).addClass("bs-tooltip-"+e)},I.getTipElement=function(){return this.tip=this.tip||t(this.config.template)[0],this.tip},I.setContent=function(){var e=t(this.getTipElement());this.setElementContent(e.find(m),this.getTitle()),e.removeClass(g+" "+p)},I.setElementContent=function(e,n){var i=this.config.html;"object"==typeof n&&(n.nodeType||n.jquery)?i?t(n).parent().is(e)||e.empty().append(n):e.text(t(n).text()):e[i?"html":"text"](n)},I.getTitle=function(){var t=this.element.getAttribute("data-original-title");return t||(t="function"==typeof this.config.title?this.config.title.call(this.element):this.config.title),t},I._getAttachment=function(t){return c[t.toUpperCase()]},I._setListeners=function(){var e=this;this.config.trigger.split(" ").forEach(function(n){if("click"===n)t(e.element).on(e.constructor.Event.CLICK,e.config.selector,function(t){return e.toggle(t)});else if(n!==C){var i=n===E?e.constructor.Event.MOUSEENTER:e.constructor.Event.FOCUSIN,s=n===E?e.constructor.Event.MOUSELEAVE:e.constructor.Event.FOCUSOUT;t(e.element).on(i,e.config.selector,function(t){return e._enter(t)}).on(s,e.config.selector,function(t){return e._leave(t)})}t(e.element).closest(".modal").on("hide.bs.modal",function(){return e.hide()})}),this.config.selector?this.config=r({},this.config,{trigger:"manual",selector:""}):this._fixTitle()},I._fixTitle=function(){var t=typeof this.element.getAttribute("data-original-title");(this.element.getAttribute("title")||"string"!==t)&&(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))},I._enter=function(e,n){var i=this.constructor.DATA_KEY;(n=n||t(e.currentTarget).data(i))||(n=new this.constructor(e.currentTarget,this._getDelegateConfig()),t(e.currentTarget).data(i,n)),e&&(n._activeTrigger["focusin"===e.type?T:E]=!0),t(n.getTipElement()).hasClass(p)||n._hoverState===f?n._hoverState=f:(clearTimeout(n._timeout),n._hoverState=f,n.config.delay&&n.config.delay.show?n._timeout=setTimeout(function(){n._hoverState===f&&n.show()},n.config.delay.show):n.show())},I._leave=function(e,n){var i=this.constructor.DATA_KEY;(n=n||t(e.currentTarget).data(i))||(n=new this.constructor(e.currentTarget,this._getDelegateConfig()),t(e.currentTarget).data(i,n)),e&&(n._activeTrigger["focusout"===e.type?T:E]=!1),n._isWithActiveTrigger()||(clearTimeout(n._timeout),n._hoverState=d,n.config.delay&&n.config.delay.hide?n._timeout=setTimeout(function(){n._hoverState===d&&n.hide()},n.config.delay.hide):n.hide())},I._isWithActiveTrigger=function(){for(var t in this._activeTrigger)if(this._activeTrigger[t])return!0;return!1},I._getConfig=function(n){return"number"==typeof(n=r({},this.constructor.Default,t(this.element).data(),n)).delay&&(n.delay={show:n.delay,hide:n.delay}),"number"==typeof n.title&&(n.title=n.title.toString()),"number"==typeof n.content&&(n.content=n.content.toString()),P.typeCheckConfig(e,n,this.constructor.DefaultType),n},I._getDelegateConfig=function(){var t={};if(this.config)for(var e in this.config)this.constructor.Default[e]!==this.config[e]&&(t[e]=this.config[e]);return t},I._cleanTipClass=function(){var e=t(this.getTipElement()),n=e.attr("class").match(l);null!==n&&n.length>0&&e.removeClass(n.join(""))},I._handlePopperPlacementChange=function(t){this._cleanTipClass(),this.addAttachmentClass(this._getAttachment(t.placement))},I._fixTransition=function(){var e=this.getTipElement(),n=this.config.animation;null===e.getAttribute("x-placement")&&(t(e).removeClass(g),this.config.animation=!1,this.hide(),this.show(),this.config.animation=n)},a._jQueryInterface=function(e){return this.each(function(){var n=t(this).data(i),s="object"==typeof e&&e;if((n||!/dispose|hide/.test(e))&&(n||(n=new a(this,s),t(this).data(i,n)),"string"==typeof e)){if("undefined"==typeof n[e])throw new TypeError('No method named "'+e+'"');n[e]()}})},s(a,null,[{key:"VERSION",get:function(){return"4.0.0"}},{key:"Default",get:function(){return u}},{key:"NAME",get:function(){return e}},{key:"DATA_KEY",get:function(){return i}},{key:"Event",get:function(){return _}},{key:"EVENT_KEY",get:function(){return o}},{key:"DefaultType",get:function(){return h}}]),a}();return t.fn[e]=I._jQueryInterface,t.fn[e].Constructor=I,t.fn[e].noConflict=function(){return t.fn[e]=a,I._jQueryInterface},I}(e),x=function(t){var e="popover",n="bs.popover",i="."+n,o=t.fn[e],a=new RegExp("(^|\\s)bs-popover\\S+","g"),l=r({},U.Default,{placement:"right",trigger:"click",content:"",template:''}),h=r({},U.DefaultType,{content:"(string|element|function)"}),c="fade",u="show",f=".popover-header",d=".popover-body",_={HIDE:"hide"+i,HIDDEN:"hidden"+i,SHOW:"show"+i,SHOWN:"shown"+i,INSERTED:"inserted"+i,CLICK:"click"+i,FOCUSIN:"focusin"+i,FOCUSOUT:"focusout"+i,MOUSEENTER:"mouseenter"+i,MOUSELEAVE:"mouseleave"+i},g=function(r){var o,g;function p(){return r.apply(this,arguments)||this}g=r,(o=p).prototype=Object.create(g.prototype),o.prototype.constructor=o,o.__proto__=g;var m=p.prototype;return m.isWithContent=function(){return this.getTitle()||this._getContent()},m.addAttachmentClass=function(e){t(this.getTipElement()).addClass("bs-popover-"+e)},m.getTipElement=function(){return this.tip=this.tip||t(this.config.template)[0],this.tip},m.setContent=function(){var e=t(this.getTipElement());this.setElementContent(e.find(f),this.getTitle());var n=this._getContent();"function"==typeof n&&(n=n.call(this.element)),this.setElementContent(e.find(d),n),e.removeClass(c+" "+u)},m._getContent=function(){return this.element.getAttribute("data-content")||this.config.content},m._cleanTipClass=function(){var e=t(this.getTipElement()),n=e.attr("class").match(a);null!==n&&n.length>0&&e.removeClass(n.join(""))},p._jQueryInterface=function(e){return this.each(function(){var i=t(this).data(n),s="object"==typeof e?e:null;if((i||!/destroy|hide/.test(e))&&(i||(i=new p(this,s),t(this).data(n,i)),"string"==typeof e)){if("undefined"==typeof i[e])throw new TypeError('No method named "'+e+'"');i[e]()}})},s(p,null,[{key:"VERSION",get:function(){return"4.0.0"}},{key:"Default",get:function(){return l}},{key:"NAME",get:function(){return e}},{key:"DATA_KEY",get:function(){return n}},{key:"Event",get:function(){return _}},{key:"EVENT_KEY",get:function(){return i}},{key:"DefaultType",get:function(){return h}}]),p}(U);return t.fn[e]=g._jQueryInterface,t.fn[e].Constructor=g,t.fn[e].noConflict=function(){return t.fn[e]=o,g._jQueryInterface},g}(e),K=function(t){var e="scrollspy",n="bs.scrollspy",i="."+n,o=t.fn[e],a={offset:10,method:"auto",target:""},l={offset:"number",method:"string",target:"(string|element)"},h={ACTIVATE:"activate"+i,SCROLL:"scroll"+i,LOAD_DATA_API:"load"+i+".data-api"},c="dropdown-item",u="active",f={DATA_SPY:'[data-spy="scroll"]',ACTIVE:".active",NAV_LIST_GROUP:".nav, .list-group",NAV_LINKS:".nav-link",NAV_ITEMS:".nav-item",LIST_ITEMS:".list-group-item",DROPDOWN:".dropdown",DROPDOWN_ITEMS:".dropdown-item",DROPDOWN_TOGGLE:".dropdown-toggle"},d="offset",_="position",g=function(){function o(e,n){var i=this;this._element=e,this._scrollElement="BODY"===e.tagName?window:e,this._config=this._getConfig(n),this._selector=this._config.target+" "+f.NAV_LINKS+","+this._config.target+" "+f.LIST_ITEMS+","+this._config.target+" "+f.DROPDOWN_ITEMS,this._offsets=[],this._targets=[],this._activeTarget=null,this._scrollHeight=0,t(this._scrollElement).on(h.SCROLL,function(t){return i._process(t)}),this.refresh(),this._process()}var g=o.prototype;return g.refresh=function(){var e=this,n=this._scrollElement===this._scrollElement.window?d:_,i="auto"===this._config.method?n:this._config.method,s=i===_?this._getScrollTop():0;this._offsets=[],this._targets=[],this._scrollHeight=this._getScrollHeight(),t.makeArray(t(this._selector)).map(function(e){var n,r=P.getSelectorFromElement(e);if(r&&(n=t(r)[0]),n){var o=n.getBoundingClientRect();if(o.width||o.height)return[t(n)[i]().top+s,r]}return null}).filter(function(t){return t}).sort(function(t,e){return t[0]-e[0]}).forEach(function(t){e._offsets.push(t[0]),e._targets.push(t[1])})},g.dispose=function(){t.removeData(this._element,n),t(this._scrollElement).off(i),this._element=null,this._scrollElement=null,this._config=null,this._selector=null,this._offsets=null,this._targets=null,this._activeTarget=null,this._scrollHeight=null},g._getConfig=function(n){if("string"!=typeof(n=r({},a,n)).target){var i=t(n.target).attr("id");i||(i=P.getUID(e),t(n.target).attr("id",i)),n.target="#"+i}return P.typeCheckConfig(e,n,l),n},g._getScrollTop=function(){return this._scrollElement===window?this._scrollElement.pageYOffset:this._scrollElement.scrollTop},g._getScrollHeight=function(){return this._scrollElement.scrollHeight||Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)},g._getOffsetHeight=function(){return this._scrollElement===window?window.innerHeight:this._scrollElement.getBoundingClientRect().height},g._process=function(){var t=this._getScrollTop()+this._config.offset,e=this._getScrollHeight(),n=this._config.offset+e-this._getOffsetHeight();if(this._scrollHeight!==e&&this.refresh(),t>=n){var i=this._targets[this._targets.length-1];this._activeTarget!==i&&this._activate(i)}else{if(this._activeTarget&&t0)return this._activeTarget=null,void this._clear();for(var s=this._offsets.length;s--;){this._activeTarget!==this._targets[s]&&t>=this._offsets[s]&&("undefined"==typeof this._offsets[s+1]||t=4)throw new Error("Bootstrap's JavaScript requires at least jQuery v1.9.1 but less than v4.0.0")}(e),t.Util=P,t.Alert=L,t.Button=R,t.Carousel=j,t.Collapse=H,t.Dropdown=W,t.Modal=M,t.Popover=x,t.Scrollspy=K,t.Tab=V,t.Tooltip=U,Object.defineProperty(t,"__esModule",{value:!0})}); 7 | //# sourceMappingURL=bootstrap.min.js.map -------------------------------------------------------------------------------- /admin-go/static/js/jquery.min.js: -------------------------------------------------------------------------------- 1 | /*! jQuery v3.3.1 | (c) JS Foundation and other contributors | jquery.org/license */ 2 | !function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){"use strict";var n=[],r=e.document,i=Object.getPrototypeOf,o=n.slice,a=n.concat,s=n.push,u=n.indexOf,l={},c=l.toString,f=l.hasOwnProperty,p=f.toString,d=p.call(Object),h={},g=function e(t){return"function"==typeof t&&"number"!=typeof t.nodeType},y=function e(t){return null!=t&&t===t.window},v={type:!0,src:!0,noModule:!0};function m(e,t,n){var i,o=(t=t||r).createElement("script");if(o.text=e,n)for(i in v)n[i]&&(o[i]=n[i]);t.head.appendChild(o).parentNode.removeChild(o)}function x(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[c.call(e)]||"object":typeof e}var b="3.3.1",w=function(e,t){return new w.fn.init(e,t)},T=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;w.fn=w.prototype={jquery:"3.3.1",constructor:w,length:0,toArray:function(){return o.call(this)},get:function(e){return null==e?o.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=w.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return w.each(this,e)},map:function(e){return this.pushStack(w.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(o.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n0&&t-1 in e)}var E=function(e){var t,n,r,i,o,a,s,u,l,c,f,p,d,h,g,y,v,m,x,b="sizzle"+1*new Date,w=e.document,T=0,C=0,E=ae(),k=ae(),S=ae(),D=function(e,t){return e===t&&(f=!0),0},N={}.hasOwnProperty,A=[],j=A.pop,q=A.push,L=A.push,H=A.slice,O=function(e,t){for(var n=0,r=e.length;n+~]|"+M+")"+M+"*"),z=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),X=new RegExp(W),U=new RegExp("^"+R+"$"),V={ID:new RegExp("^#("+R+")"),CLASS:new RegExp("^\\.("+R+")"),TAG:new RegExp("^("+R+"|[*])"),ATTR:new RegExp("^"+I),PSEUDO:new RegExp("^"+W),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+P+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},G=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Q=/^[^{]+\{\s*\[native \w/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,K=/[+~]/,Z=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),ee=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},te=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ne=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},re=function(){p()},ie=me(function(e){return!0===e.disabled&&("form"in e||"label"in e)},{dir:"parentNode",next:"legend"});try{L.apply(A=H.call(w.childNodes),w.childNodes),A[w.childNodes.length].nodeType}catch(e){L={apply:A.length?function(e,t){q.apply(e,H.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function oe(e,t,r,i){var o,s,l,c,f,h,v,m=t&&t.ownerDocument,T=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==T&&9!==T&&11!==T)return r;if(!i&&((t?t.ownerDocument||t:w)!==d&&p(t),t=t||d,g)){if(11!==T&&(f=J.exec(e)))if(o=f[1]){if(9===T){if(!(l=t.getElementById(o)))return r;if(l.id===o)return r.push(l),r}else if(m&&(l=m.getElementById(o))&&x(t,l)&&l.id===o)return r.push(l),r}else{if(f[2])return L.apply(r,t.getElementsByTagName(e)),r;if((o=f[3])&&n.getElementsByClassName&&t.getElementsByClassName)return L.apply(r,t.getElementsByClassName(o)),r}if(n.qsa&&!S[e+" "]&&(!y||!y.test(e))){if(1!==T)m=t,v=e;else if("object"!==t.nodeName.toLowerCase()){(c=t.getAttribute("id"))?c=c.replace(te,ne):t.setAttribute("id",c=b),s=(h=a(e)).length;while(s--)h[s]="#"+c+" "+ve(h[s]);v=h.join(","),m=K.test(e)&&ge(t.parentNode)||t}if(v)try{return L.apply(r,m.querySelectorAll(v)),r}catch(e){}finally{c===b&&t.removeAttribute("id")}}}return u(e.replace(B,"$1"),t,r,i)}function ae(){var e=[];function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}return t}function se(e){return e[b]=!0,e}function ue(e){var t=d.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function le(e,t){var n=e.split("|"),i=n.length;while(i--)r.attrHandle[n[i]]=t}function ce(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function fe(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function pe(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function de(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ie(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function he(e){return se(function(t){return t=+t,se(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function ge(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}n=oe.support={},o=oe.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},p=oe.setDocument=function(e){var t,i,a=e?e.ownerDocument||e:w;return a!==d&&9===a.nodeType&&a.documentElement?(d=a,h=d.documentElement,g=!o(d),w!==d&&(i=d.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",re,!1):i.attachEvent&&i.attachEvent("onunload",re)),n.attributes=ue(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=ue(function(e){return e.appendChild(d.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=Q.test(d.getElementsByClassName),n.getById=ue(function(e){return h.appendChild(e).id=b,!d.getElementsByName||!d.getElementsByName(b).length}),n.getById?(r.filter.ID=function(e){var t=e.replace(Z,ee);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&g){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(Z,ee);return function(e){var n="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&g){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),r.find.TAG=n.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&g)return t.getElementsByClassName(e)},v=[],y=[],(n.qsa=Q.test(d.querySelectorAll))&&(ue(function(e){h.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&y.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||y.push("\\["+M+"*(?:value|"+P+")"),e.querySelectorAll("[id~="+b+"-]").length||y.push("~="),e.querySelectorAll(":checked").length||y.push(":checked"),e.querySelectorAll("a#"+b+"+*").length||y.push(".#.+[+~]")}),ue(function(e){e.innerHTML="";var t=d.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&y.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&y.push(":enabled",":disabled"),h.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&y.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),y.push(",.*:")})),(n.matchesSelector=Q.test(m=h.matches||h.webkitMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector||h.msMatchesSelector))&&ue(function(e){n.disconnectedMatch=m.call(e,"*"),m.call(e,"[s!='']:x"),v.push("!=",W)}),y=y.length&&new RegExp(y.join("|")),v=v.length&&new RegExp(v.join("|")),t=Q.test(h.compareDocumentPosition),x=t||Q.test(h.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return f=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e===d||e.ownerDocument===w&&x(w,e)?-1:t===d||t.ownerDocument===w&&x(w,t)?1:c?O(c,e)-O(c,t):0:4&r?-1:1)}:function(e,t){if(e===t)return f=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===d?-1:t===d?1:i?-1:o?1:c?O(c,e)-O(c,t):0;if(i===o)return ce(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?ce(a[r],s[r]):a[r]===w?-1:s[r]===w?1:0},d):d},oe.matches=function(e,t){return oe(e,null,null,t)},oe.matchesSelector=function(e,t){if((e.ownerDocument||e)!==d&&p(e),t=t.replace(z,"='$1']"),n.matchesSelector&&g&&!S[t+" "]&&(!v||!v.test(t))&&(!y||!y.test(t)))try{var r=m.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){}return oe(t,d,null,[e]).length>0},oe.contains=function(e,t){return(e.ownerDocument||e)!==d&&p(e),x(e,t)},oe.attr=function(e,t){(e.ownerDocument||e)!==d&&p(e);var i=r.attrHandle[t.toLowerCase()],o=i&&N.call(r.attrHandle,t.toLowerCase())?i(e,t,!g):void 0;return void 0!==o?o:n.attributes||!g?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},oe.escape=function(e){return(e+"").replace(te,ne)},oe.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},oe.uniqueSort=function(e){var t,r=[],i=0,o=0;if(f=!n.detectDuplicates,c=!n.sortStable&&e.slice(0),e.sort(D),f){while(t=e[o++])t===e[o]&&(i=r.push(o));while(i--)e.splice(r[i],1)}return c=null,e},i=oe.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e)}else if(3===o||4===o)return e.nodeValue}else while(t=e[r++])n+=i(t);return n},(r=oe.selectors={cacheLength:50,createPseudo:se,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Z,ee),e[3]=(e[3]||e[4]||e[5]||"").replace(Z,ee),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||oe.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&oe.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return V.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=a(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Z,ee).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=E[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&E(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=oe.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace($," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,f,p,d,h,g=o!==a?"nextSibling":"previousSibling",y=t.parentNode,v=s&&t.nodeName.toLowerCase(),m=!u&&!s,x=!1;if(y){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===v:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?y.firstChild:y.lastChild],a&&m){x=(d=(l=(c=(f=(p=y)[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]||[])[0]===T&&l[1])&&l[2],p=d&&y.childNodes[d];while(p=++d&&p&&p[g]||(x=d=0)||h.pop())if(1===p.nodeType&&++x&&p===t){c[e]=[T,d,x];break}}else if(m&&(x=d=(l=(c=(f=(p=t)[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]||[])[0]===T&&l[1]),!1===x)while(p=++d&&p&&p[g]||(x=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===v:1===p.nodeType)&&++x&&(m&&((c=(f=p[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]=[T,x]),p===t))break;return(x-=i)===r||x%r==0&&x/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||oe.error("unsupported pseudo: "+e);return i[b]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?se(function(e,n){var r,o=i(e,t),a=o.length;while(a--)e[r=O(e,o[a])]=!(n[r]=o[a])}):function(e){return i(e,0,n)}):i}},pseudos:{not:se(function(e){var t=[],n=[],r=s(e.replace(B,"$1"));return r[b]?se(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),t[0]=null,!n.pop()}}),has:se(function(e){return function(t){return oe(e,t).length>0}}),contains:se(function(e){return e=e.replace(Z,ee),function(t){return(t.textContent||t.innerText||i(t)).indexOf(e)>-1}}),lang:se(function(e){return U.test(e||"")||oe.error("unsupported lang: "+e),e=e.replace(Z,ee).toLowerCase(),function(t){var n;do{if(n=g?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===h},focus:function(e){return e===d.activeElement&&(!d.hasFocus||d.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:de(!1),disabled:de(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return Y.test(e.nodeName)},input:function(e){return G.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:he(function(){return[0]}),last:he(function(e,t){return[t-1]}),eq:he(function(e,t,n){return[n<0?n+t:n]}),even:he(function(e,t){for(var n=0;n=0;)e.push(r);return e}),gt:he(function(e,t,n){for(var r=n<0?n+t:n;++r1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function be(e,t,n){for(var r=0,i=t.length;r-1&&(o[l]=!(a[l]=f))}}else v=we(v===a?v.splice(h,v.length):v),i?i(null,a,v,u):L.apply(a,v)})}function Ce(e){for(var t,n,i,o=e.length,a=r.relative[e[0].type],s=a||r.relative[" "],u=a?1:0,c=me(function(e){return e===t},s,!0),f=me(function(e){return O(t,e)>-1},s,!0),p=[function(e,n,r){var i=!a&&(r||n!==l)||((t=n).nodeType?c(e,n,r):f(e,n,r));return t=null,i}];u1&&xe(p),u>1&&ve(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(B,"$1"),n,u0,i=e.length>0,o=function(o,a,s,u,c){var f,h,y,v=0,m="0",x=o&&[],b=[],w=l,C=o||i&&r.find.TAG("*",c),E=T+=null==w?1:Math.random()||.1,k=C.length;for(c&&(l=a===d||a||c);m!==k&&null!=(f=C[m]);m++){if(i&&f){h=0,a||f.ownerDocument===d||(p(f),s=!g);while(y=e[h++])if(y(f,a||d,s)){u.push(f);break}c&&(T=E)}n&&((f=!y&&f)&&v--,o&&x.push(f))}if(v+=m,n&&m!==v){h=0;while(y=t[h++])y(x,b,a,s);if(o){if(v>0)while(m--)x[m]||b[m]||(b[m]=j.call(u));b=we(b)}L.apply(u,b),c&&!o&&b.length>0&&v+t.length>1&&oe.uniqueSort(u)}return c&&(T=E,l=w),x};return n?se(o):o}return s=oe.compile=function(e,t){var n,r=[],i=[],o=S[e+" "];if(!o){t||(t=a(e)),n=t.length;while(n--)(o=Ce(t[n]))[b]?r.push(o):i.push(o);(o=S(e,Ee(i,r))).selector=e}return o},u=oe.select=function(e,t,n,i){var o,u,l,c,f,p="function"==typeof e&&e,d=!i&&a(e=p.selector||e);if(n=n||[],1===d.length){if((u=d[0]=d[0].slice(0)).length>2&&"ID"===(l=u[0]).type&&9===t.nodeType&&g&&r.relative[u[1].type]){if(!(t=(r.find.ID(l.matches[0].replace(Z,ee),t)||[])[0]))return n;p&&(t=t.parentNode),e=e.slice(u.shift().value.length)}o=V.needsContext.test(e)?0:u.length;while(o--){if(l=u[o],r.relative[c=l.type])break;if((f=r.find[c])&&(i=f(l.matches[0].replace(Z,ee),K.test(u[0].type)&&ge(t.parentNode)||t))){if(u.splice(o,1),!(e=i.length&&ve(u)))return L.apply(n,i),n;break}}}return(p||s(e,d))(i,t,!g,n,!t||K.test(e)&&ge(t.parentNode)||t),n},n.sortStable=b.split("").sort(D).join("")===b,n.detectDuplicates=!!f,p(),n.sortDetached=ue(function(e){return 1&e.compareDocumentPosition(d.createElement("fieldset"))}),ue(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||le("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&ue(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||le("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ue(function(e){return null==e.getAttribute("disabled")})||le(P,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),oe}(e);w.find=E,w.expr=E.selectors,w.expr[":"]=w.expr.pseudos,w.uniqueSort=w.unique=E.uniqueSort,w.text=E.getText,w.isXMLDoc=E.isXML,w.contains=E.contains,w.escapeSelector=E.escape;var k=function(e,t,n){var r=[],i=void 0!==n;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&w(e).is(n))break;r.push(e)}return r},S=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},D=w.expr.match.needsContext;function N(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var A=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,t,n){return g(t)?w.grep(e,function(e,r){return!!t.call(e,r,e)!==n}):t.nodeType?w.grep(e,function(e){return e===t!==n}):"string"!=typeof t?w.grep(e,function(e){return u.call(t,e)>-1!==n}):w.filter(t,e,n)}w.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?w.find.matchesSelector(r,e)?[r]:[]:w.find.matches(e,w.grep(t,function(e){return 1===e.nodeType}))},w.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(w(e).filter(function(){for(t=0;t1?w.uniqueSort(n):n},filter:function(e){return this.pushStack(j(this,e||[],!1))},not:function(e){return this.pushStack(j(this,e||[],!0))},is:function(e){return!!j(this,"string"==typeof e&&D.test(e)?w(e):e||[],!1).length}});var q,L=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(w.fn.init=function(e,t,n){var i,o;if(!e)return this;if(n=n||q,"string"==typeof e){if(!(i="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:L.exec(e))||!i[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(i[1]){if(t=t instanceof w?t[0]:t,w.merge(this,w.parseHTML(i[1],t&&t.nodeType?t.ownerDocument||t:r,!0)),A.test(i[1])&&w.isPlainObject(t))for(i in t)g(this[i])?this[i](t[i]):this.attr(i,t[i]);return this}return(o=r.getElementById(i[2]))&&(this[0]=o,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):g(e)?void 0!==n.ready?n.ready(e):e(w):w.makeArray(e,this)}).prototype=w.fn,q=w(r);var H=/^(?:parents|prev(?:Until|All))/,O={children:!0,contents:!0,next:!0,prev:!0};w.fn.extend({has:function(e){var t=w(e,this),n=t.length;return this.filter(function(){for(var e=0;e-1:1===n.nodeType&&w.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?w.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?u.call(w(e),this[0]):u.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(w.uniqueSort(w.merge(this.get(),w(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}});function P(e,t){while((e=e[t])&&1!==e.nodeType);return e}w.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return k(e,"parentNode")},parentsUntil:function(e,t,n){return k(e,"parentNode",n)},next:function(e){return P(e,"nextSibling")},prev:function(e){return P(e,"previousSibling")},nextAll:function(e){return k(e,"nextSibling")},prevAll:function(e){return k(e,"previousSibling")},nextUntil:function(e,t,n){return k(e,"nextSibling",n)},prevUntil:function(e,t,n){return k(e,"previousSibling",n)},siblings:function(e){return S((e.parentNode||{}).firstChild,e)},children:function(e){return S(e.firstChild)},contents:function(e){return N(e,"iframe")?e.contentDocument:(N(e,"template")&&(e=e.content||e),w.merge([],e.childNodes))}},function(e,t){w.fn[e]=function(n,r){var i=w.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=w.filter(r,i)),this.length>1&&(O[e]||w.uniqueSort(i),H.test(e)&&i.reverse()),this.pushStack(i)}});var M=/[^\x20\t\r\n\f]+/g;function R(e){var t={};return w.each(e.match(M)||[],function(e,n){t[n]=!0}),t}w.Callbacks=function(e){e="string"==typeof e?R(e):w.extend({},e);var t,n,r,i,o=[],a=[],s=-1,u=function(){for(i=i||e.once,r=t=!0;a.length;s=-1){n=a.shift();while(++s-1)o.splice(n,1),n<=s&&s--}),this},has:function(e){return e?w.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=a=[],n||t||(o=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=[e,(n=n||[]).slice?n.slice():n],a.push(n),t||u()),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!r}};return l};function I(e){return e}function W(e){throw e}function $(e,t,n,r){var i;try{e&&g(i=e.promise)?i.call(e).done(t).fail(n):e&&g(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}w.extend({Deferred:function(t){var n=[["notify","progress",w.Callbacks("memory"),w.Callbacks("memory"),2],["resolve","done",w.Callbacks("once memory"),w.Callbacks("once memory"),0,"resolved"],["reject","fail",w.Callbacks("once memory"),w.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},"catch":function(e){return i.then(null,e)},pipe:function(){var e=arguments;return w.Deferred(function(t){w.each(n,function(n,r){var i=g(e[r[4]])&&e[r[4]];o[r[1]](function(){var e=i&&i.apply(this,arguments);e&&g(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[r[0]+"With"](this,i?[e]:arguments)})}),e=null}).promise()},then:function(t,r,i){var o=0;function a(t,n,r,i){return function(){var s=this,u=arguments,l=function(){var e,l;if(!(t=o&&(r!==W&&(s=void 0,u=[e]),n.rejectWith(s,u))}};t?c():(w.Deferred.getStackHook&&(c.stackTrace=w.Deferred.getStackHook()),e.setTimeout(c))}}return w.Deferred(function(e){n[0][3].add(a(0,e,g(i)?i:I,e.notifyWith)),n[1][3].add(a(0,e,g(t)?t:I)),n[2][3].add(a(0,e,g(r)?r:W))}).promise()},promise:function(e){return null!=e?w.extend(e,i):i}},o={};return w.each(n,function(e,t){var a=t[2],s=t[5];i[t[1]]=a.add,s&&a.add(function(){r=s},n[3-e][2].disable,n[3-e][3].disable,n[0][2].lock,n[0][3].lock),a.add(t[3].fire),o[t[0]]=function(){return o[t[0]+"With"](this===o?void 0:this,arguments),this},o[t[0]+"With"]=a.fireWith}),i.promise(o),t&&t.call(o,o),o},when:function(e){var t=arguments.length,n=t,r=Array(n),i=o.call(arguments),a=w.Deferred(),s=function(e){return function(n){r[e]=this,i[e]=arguments.length>1?o.call(arguments):n,--t||a.resolveWith(r,i)}};if(t<=1&&($(e,a.done(s(n)).resolve,a.reject,!t),"pending"===a.state()||g(i[n]&&i[n].then)))return a.then();while(n--)$(i[n],s(n),a.reject);return a.promise()}});var B=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;w.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&B.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,n)},w.readyException=function(t){e.setTimeout(function(){throw t})};var F=w.Deferred();w.fn.ready=function(e){return F.then(e)["catch"](function(e){w.readyException(e)}),this},w.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--w.readyWait:w.isReady)||(w.isReady=!0,!0!==e&&--w.readyWait>0||F.resolveWith(r,[w]))}}),w.ready.then=F.then;function _(){r.removeEventListener("DOMContentLoaded",_),e.removeEventListener("load",_),w.ready()}"complete"===r.readyState||"loading"!==r.readyState&&!r.documentElement.doScroll?e.setTimeout(w.ready):(r.addEventListener("DOMContentLoaded",_),e.addEventListener("load",_));var z=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if("object"===x(n)){i=!0;for(s in n)z(e,t,s,n[s],!0,o,a)}else if(void 0!==r&&(i=!0,g(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(w(e),n)})),t))for(;s1,null,!0)},removeData:function(e){return this.each(function(){K.remove(this,e)})}}),w.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=J.get(e,t),n&&(!r||Array.isArray(n)?r=J.access(e,t,w.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=w.queue(e,t),r=n.length,i=n.shift(),o=w._queueHooks(e,t),a=function(){w.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return J.get(e,n)||J.access(e,n,{empty:w.Callbacks("once memory").add(function(){J.remove(e,[t+"queue",n])})})}}),w.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length\x20\t\r\n\f]+)/i,he=/^$|^module$|\/(?:java|ecma)script/i,ge={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};ge.optgroup=ge.option,ge.tbody=ge.tfoot=ge.colgroup=ge.caption=ge.thead,ge.th=ge.td;function ye(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&N(e,t)?w.merge([e],n):n}function ve(e,t){for(var n=0,r=e.length;n-1)i&&i.push(o);else if(l=w.contains(o.ownerDocument,o),a=ye(f.appendChild(o),"script"),l&&ve(a),n){c=0;while(o=a[c++])he.test(o.type||"")&&n.push(o)}return f}!function(){var e=r.createDocumentFragment().appendChild(r.createElement("div")),t=r.createElement("input");t.setAttribute("type","radio"),t.setAttribute("checked","checked"),t.setAttribute("name","t"),e.appendChild(t),h.checkClone=e.cloneNode(!0).cloneNode(!0).lastChild.checked,e.innerHTML="",h.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue}();var be=r.documentElement,we=/^key/,Te=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ce=/^([^.]*)(?:\.(.+)|)/;function Ee(){return!0}function ke(){return!1}function Se(){try{return r.activeElement}catch(e){}}function De(e,t,n,r,i,o){var a,s;if("object"==typeof t){"string"!=typeof n&&(r=r||n,n=void 0);for(s in t)De(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=ke;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return w().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=w.guid++)),e.each(function(){w.event.add(this,t,i,r,n)})}w.event={global:{},add:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,y=J.get(e);if(y){n.handler&&(n=(o=n).handler,i=o.selector),i&&w.find.matchesSelector(be,i),n.guid||(n.guid=w.guid++),(u=y.events)||(u=y.events={}),(a=y.handle)||(a=y.handle=function(t){return"undefined"!=typeof w&&w.event.triggered!==t.type?w.event.dispatch.apply(e,arguments):void 0}),l=(t=(t||"").match(M)||[""]).length;while(l--)d=g=(s=Ce.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=w.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=w.event.special[d]||{},c=w.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&w.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(e,r,h,a)||e.addEventListener&&e.addEventListener(d,a)),f.add&&(f.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),w.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,y=J.hasData(e)&&J.get(e);if(y&&(u=y.events)){l=(t=(t||"").match(M)||[""]).length;while(l--)if(s=Ce.exec(t[l])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){f=w.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,y.handle)||w.removeEvent(e,d,y.handle),delete u[d])}else for(d in u)w.event.remove(e,d+t[l],n,r,!0);w.isEmptyObject(u)&&J.remove(e,"handle events")}},dispatch:function(e){var t=w.event.fix(e),n,r,i,o,a,s,u=new Array(arguments.length),l=(J.get(this,"events")||{})[t.type]||[],c=w.event.special[t.type]||{};for(u[0]=t,n=1;n=1))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n-1:w.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u\x20\t\r\n\f]*)[^>]*)\/>/gi,Ae=/\s*$/g;function Le(e,t){return N(e,"table")&&N(11!==t.nodeType?t:t.firstChild,"tr")?w(e).children("tbody")[0]||e:e}function He(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Oe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Pe(e,t){var n,r,i,o,a,s,u,l;if(1===t.nodeType){if(J.hasData(e)&&(o=J.access(e),a=J.set(t,o),l=o.events)){delete a.handle,a.events={};for(i in l)for(n=0,r=l[i].length;n1&&"string"==typeof y&&!h.checkClone&&je.test(y))return e.each(function(i){var o=e.eq(i);v&&(t[0]=y.call(this,i,o.html())),Re(o,t,n,r)});if(p&&(i=xe(t,e[0].ownerDocument,!1,e,r),o=i.firstChild,1===i.childNodes.length&&(i=o),o||r)){for(u=(s=w.map(ye(i,"script"),He)).length;f")},clone:function(e,t,n){var r,i,o,a,s=e.cloneNode(!0),u=w.contains(e.ownerDocument,e);if(!(h.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||w.isXMLDoc(e)))for(a=ye(s),r=0,i=(o=ye(e)).length;r0&&ve(a,!u&&ye(e,"script")),s},cleanData:function(e){for(var t,n,r,i=w.event.special,o=0;void 0!==(n=e[o]);o++)if(Y(n)){if(t=n[J.expando]){if(t.events)for(r in t.events)i[r]?w.event.remove(n,r):w.removeEvent(n,r,t.handle);n[J.expando]=void 0}n[K.expando]&&(n[K.expando]=void 0)}}}),w.fn.extend({detach:function(e){return Ie(this,e,!0)},remove:function(e){return Ie(this,e)},text:function(e){return z(this,function(e){return void 0===e?w.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return Re(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Le(this,e).appendChild(e)})},prepend:function(){return Re(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Le(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return Re(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Re(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(w.cleanData(ye(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return w.clone(this,e,t)})},html:function(e){return z(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Ae.test(e)&&!ge[(de.exec(e)||["",""])[1].toLowerCase()]){e=w.htmlPrefilter(e);try{for(;n=0&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))),u}function et(e,t,n){var r=$e(e),i=Fe(e,t,r),o="border-box"===w.css(e,"boxSizing",!1,r),a=o;if(We.test(i)){if(!n)return i;i="auto"}return a=a&&(h.boxSizingReliable()||i===e.style[t]),("auto"===i||!parseFloat(i)&&"inline"===w.css(e,"display",!1,r))&&(i=e["offset"+t[0].toUpperCase()+t.slice(1)],a=!0),(i=parseFloat(i)||0)+Ze(e,t,n||(o?"border":"content"),a,r,i)+"px"}w.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Fe(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=G(t),u=Xe.test(t),l=e.style;if(u||(t=Je(s)),a=w.cssHooks[t]||w.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];"string"==(o=typeof n)&&(i=ie.exec(n))&&i[1]&&(n=ue(e,t,i),o="number"),null!=n&&n===n&&("number"===o&&(n+=i&&i[3]||(w.cssNumber[s]?"":"px")),h.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,o,a,s=G(t);return Xe.test(t)||(t=Je(s)),(a=w.cssHooks[t]||w.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=Fe(e,t,r)),"normal"===i&&t in Ve&&(i=Ve[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),w.each(["height","width"],function(e,t){w.cssHooks[t]={get:function(e,n,r){if(n)return!ze.test(w.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?et(e,t,r):se(e,Ue,function(){return et(e,t,r)})},set:function(e,n,r){var i,o=$e(e),a="border-box"===w.css(e,"boxSizing",!1,o),s=r&&Ze(e,t,r,a,o);return a&&h.scrollboxSize()===o.position&&(s-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(o[t])-Ze(e,t,"border",!1,o)-.5)),s&&(i=ie.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=w.css(e,t)),Ke(e,n,s)}}}),w.cssHooks.marginLeft=_e(h.reliableMarginLeft,function(e,t){if(t)return(parseFloat(Fe(e,"marginLeft"))||e.getBoundingClientRect().left-se(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),w.each({margin:"",padding:"",border:"Width"},function(e,t){w.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+oe[r]+t]=o[r]||o[r-2]||o[0];return i}},"margin"!==e&&(w.cssHooks[e+t].set=Ke)}),w.fn.extend({css:function(e,t){return z(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=$e(e),i=t.length;a1)}});function tt(e,t,n,r,i){return new tt.prototype.init(e,t,n,r,i)}w.Tween=tt,tt.prototype={constructor:tt,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||w.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(w.cssNumber[n]?"":"px")},cur:function(){var e=tt.propHooks[this.prop];return e&&e.get?e.get(this):tt.propHooks._default.get(this)},run:function(e){var t,n=tt.propHooks[this.prop];return this.options.duration?this.pos=t=w.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):tt.propHooks._default.set(this),this}},tt.prototype.init.prototype=tt.prototype,tt.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=w.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){w.fx.step[e.prop]?w.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[w.cssProps[e.prop]]&&!w.cssHooks[e.prop]?e.elem[e.prop]=e.now:w.style(e.elem,e.prop,e.now+e.unit)}}},tt.propHooks.scrollTop=tt.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},w.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},w.fx=tt.prototype.init,w.fx.step={};var nt,rt,it=/^(?:toggle|show|hide)$/,ot=/queueHooks$/;function at(){rt&&(!1===r.hidden&&e.requestAnimationFrame?e.requestAnimationFrame(at):e.setTimeout(at,w.fx.interval),w.fx.tick())}function st(){return e.setTimeout(function(){nt=void 0}),nt=Date.now()}function ut(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=oe[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function lt(e,t,n){for(var r,i=(pt.tweeners[t]||[]).concat(pt.tweeners["*"]),o=0,a=i.length;o1)},removeAttr:function(e){return this.each(function(){w.removeAttr(this,e)})}}),w.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?w.prop(e,t,n):(1===o&&w.isXMLDoc(e)||(i=w.attrHooks[t.toLowerCase()]||(w.expr.match.bool.test(t)?dt:void 0)),void 0!==n?null===n?void w.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=w.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!h.radioValue&&"radio"===t&&N(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(M);if(i&&1===e.nodeType)while(n=i[r++])e.removeAttribute(n)}}),dt={set:function(e,t,n){return!1===t?w.removeAttr(e,n):e.setAttribute(n,n),n}},w.each(w.expr.match.bool.source.match(/\w+/g),function(e,t){var n=ht[t]||w.find.attr;ht[t]=function(e,t,r){var i,o,a=t.toLowerCase();return r||(o=ht[a],ht[a]=i,i=null!=n(e,t,r)?a:null,ht[a]=o),i}});var gt=/^(?:input|select|textarea|button)$/i,yt=/^(?:a|area)$/i;w.fn.extend({prop:function(e,t){return z(this,w.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[w.propFix[e]||e]})}}),w.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&w.isXMLDoc(e)||(t=w.propFix[t]||t,i=w.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=w.find.attr(e,"tabindex");return t?parseInt(t,10):gt.test(e.nodeName)||yt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),h.optSelected||(w.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),w.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){w.propFix[this.toLowerCase()]=this});function vt(e){return(e.match(M)||[]).join(" ")}function mt(e){return e.getAttribute&&e.getAttribute("class")||""}function xt(e){return Array.isArray(e)?e:"string"==typeof e?e.match(M)||[]:[]}w.fn.extend({addClass:function(e){var t,n,r,i,o,a,s,u=0;if(g(e))return this.each(function(t){w(this).addClass(e.call(this,t,mt(this)))});if((t=xt(e)).length)while(n=this[u++])if(i=mt(n),r=1===n.nodeType&&" "+vt(i)+" "){a=0;while(o=t[a++])r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(s=vt(r))&&n.setAttribute("class",s)}return this},removeClass:function(e){var t,n,r,i,o,a,s,u=0;if(g(e))return this.each(function(t){w(this).removeClass(e.call(this,t,mt(this)))});if(!arguments.length)return this.attr("class","");if((t=xt(e)).length)while(n=this[u++])if(i=mt(n),r=1===n.nodeType&&" "+vt(i)+" "){a=0;while(o=t[a++])while(r.indexOf(" "+o+" ")>-1)r=r.replace(" "+o+" "," ");i!==(s=vt(r))&&n.setAttribute("class",s)}return this},toggleClass:function(e,t){var n=typeof e,r="string"===n||Array.isArray(e);return"boolean"==typeof t&&r?t?this.addClass(e):this.removeClass(e):g(e)?this.each(function(n){w(this).toggleClass(e.call(this,n,mt(this),t),t)}):this.each(function(){var t,i,o,a;if(r){i=0,o=w(this),a=xt(e);while(t=a[i++])o.hasClass(t)?o.removeClass(t):o.addClass(t)}else void 0!==e&&"boolean"!==n||((t=mt(this))&&J.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":J.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;t=" "+e+" ";while(n=this[r++])if(1===n.nodeType&&(" "+vt(mt(n))+" ").indexOf(t)>-1)return!0;return!1}});var bt=/\r/g;w.fn.extend({val:function(e){var t,n,r,i=this[0];{if(arguments.length)return r=g(e),this.each(function(n){var i;1===this.nodeType&&(null==(i=r?e.call(this,n,w(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=w.map(i,function(e){return null==e?"":e+""})),(t=w.valHooks[this.type]||w.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))});if(i)return(t=w.valHooks[i.type]||w.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(bt,""):null==n?"":n}}}),w.extend({valHooks:{option:{get:function(e){var t=w.find.attr(e,"value");return null!=t?t:vt(w.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),w.each(["radio","checkbox"],function(){w.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=w.inArray(w(e).val(),t)>-1}},h.checkOn||(w.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),h.focusin="onfocusin"in e;var wt=/^(?:focusinfocus|focusoutblur)$/,Tt=function(e){e.stopPropagation()};w.extend(w.event,{trigger:function(t,n,i,o){var a,s,u,l,c,p,d,h,v=[i||r],m=f.call(t,"type")?t.type:t,x=f.call(t,"namespace")?t.namespace.split("."):[];if(s=h=u=i=i||r,3!==i.nodeType&&8!==i.nodeType&&!wt.test(m+w.event.triggered)&&(m.indexOf(".")>-1&&(m=(x=m.split(".")).shift(),x.sort()),c=m.indexOf(":")<0&&"on"+m,t=t[w.expando]?t:new w.Event(m,"object"==typeof t&&t),t.isTrigger=o?2:3,t.namespace=x.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+x.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=i),n=null==n?[t]:w.makeArray(n,[t]),d=w.event.special[m]||{},o||!d.trigger||!1!==d.trigger.apply(i,n))){if(!o&&!d.noBubble&&!y(i)){for(l=d.delegateType||m,wt.test(l+m)||(s=s.parentNode);s;s=s.parentNode)v.push(s),u=s;u===(i.ownerDocument||r)&&v.push(u.defaultView||u.parentWindow||e)}a=0;while((s=v[a++])&&!t.isPropagationStopped())h=s,t.type=a>1?l:d.bindType||m,(p=(J.get(s,"events")||{})[t.type]&&J.get(s,"handle"))&&p.apply(s,n),(p=c&&s[c])&&p.apply&&Y(s)&&(t.result=p.apply(s,n),!1===t.result&&t.preventDefault());return t.type=m,o||t.isDefaultPrevented()||d._default&&!1!==d._default.apply(v.pop(),n)||!Y(i)||c&&g(i[m])&&!y(i)&&((u=i[c])&&(i[c]=null),w.event.triggered=m,t.isPropagationStopped()&&h.addEventListener(m,Tt),i[m](),t.isPropagationStopped()&&h.removeEventListener(m,Tt),w.event.triggered=void 0,u&&(i[c]=u)),t.result}},simulate:function(e,t,n){var r=w.extend(new w.Event,n,{type:e,isSimulated:!0});w.event.trigger(r,null,t)}}),w.fn.extend({trigger:function(e,t){return this.each(function(){w.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return w.event.trigger(e,t,n,!0)}}),h.focusin||w.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){w.event.simulate(t,e.target,w.event.fix(e))};w.event.special[t]={setup:function(){var r=this.ownerDocument||this,i=J.access(r,t);i||r.addEventListener(e,n,!0),J.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=J.access(r,t)-1;i?J.access(r,t,i):(r.removeEventListener(e,n,!0),J.remove(r,t))}}});var Ct=e.location,Et=Date.now(),kt=/\?/;w.parseXML=function(t){var n;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(e){n=void 0}return n&&!n.getElementsByTagName("parsererror").length||w.error("Invalid XML: "+t),n};var St=/\[\]$/,Dt=/\r?\n/g,Nt=/^(?:submit|button|image|reset|file)$/i,At=/^(?:input|select|textarea|keygen)/i;function jt(e,t,n,r){var i;if(Array.isArray(t))w.each(t,function(t,i){n||St.test(e)?r(e,i):jt(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,r)});else if(n||"object"!==x(t))r(e,t);else for(i in t)jt(e+"["+i+"]",t[i],n,r)}w.param=function(e,t){var n,r=[],i=function(e,t){var n=g(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(Array.isArray(e)||e.jquery&&!w.isPlainObject(e))w.each(e,function(){i(this.name,this.value)});else for(n in e)jt(n,e[n],t,i);return r.join("&")},w.fn.extend({serialize:function(){return w.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=w.prop(this,"elements");return e?w.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!w(this).is(":disabled")&&At.test(this.nodeName)&&!Nt.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var n=w(this).val();return null==n?null:Array.isArray(n)?w.map(n,function(e){return{name:t.name,value:e.replace(Dt,"\r\n")}}):{name:t.name,value:n.replace(Dt,"\r\n")}}).get()}});var qt=/%20/g,Lt=/#.*$/,Ht=/([?&])_=[^&]*/,Ot=/^(.*?):[ \t]*([^\r\n]*)$/gm,Pt=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Mt=/^(?:GET|HEAD)$/,Rt=/^\/\//,It={},Wt={},$t="*/".concat("*"),Bt=r.createElement("a");Bt.href=Ct.href;function Ft(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(M)||[];if(g(n))while(r=o[i++])"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function _t(e,t,n,r){var i={},o=e===Wt;function a(s){var u;return i[s]=!0,w.each(e[s]||[],function(e,s){var l=s(t,n,r);return"string"!=typeof l||o||i[l]?o?!(u=l):void 0:(t.dataTypes.unshift(l),a(l),!1)}),u}return a(t.dataTypes[0])||!i["*"]&&a("*")}function zt(e,t){var n,r,i=w.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&w.extend(!0,e,r),e}function Xt(e,t,n){var r,i,o,a,s=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}function Ut(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=l[u+" "+o]||l["* "+o]))for(i in l)if((s=i.split(" "))[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}w.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ct.href,type:"GET",isLocal:Pt.test(Ct.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":$t,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":w.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?zt(zt(e,w.ajaxSettings),t):zt(w.ajaxSettings,e)},ajaxPrefilter:Ft(It),ajaxTransport:Ft(Wt),ajax:function(t,n){"object"==typeof t&&(n=t,t=void 0),n=n||{};var i,o,a,s,u,l,c,f,p,d,h=w.ajaxSetup({},n),g=h.context||h,y=h.context&&(g.nodeType||g.jquery)?w(g):w.event,v=w.Deferred(),m=w.Callbacks("once memory"),x=h.statusCode||{},b={},T={},C="canceled",E={readyState:0,getResponseHeader:function(e){var t;if(c){if(!s){s={};while(t=Ot.exec(a))s[t[1].toLowerCase()]=t[2]}t=s[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return c?a:null},setRequestHeader:function(e,t){return null==c&&(e=T[e.toLowerCase()]=T[e.toLowerCase()]||e,b[e]=t),this},overrideMimeType:function(e){return null==c&&(h.mimeType=e),this},statusCode:function(e){var t;if(e)if(c)E.always(e[E.status]);else for(t in e)x[t]=[x[t],e[t]];return this},abort:function(e){var t=e||C;return i&&i.abort(t),k(0,t),this}};if(v.promise(E),h.url=((t||h.url||Ct.href)+"").replace(Rt,Ct.protocol+"//"),h.type=n.method||n.type||h.method||h.type,h.dataTypes=(h.dataType||"*").toLowerCase().match(M)||[""],null==h.crossDomain){l=r.createElement("a");try{l.href=h.url,l.href=l.href,h.crossDomain=Bt.protocol+"//"+Bt.host!=l.protocol+"//"+l.host}catch(e){h.crossDomain=!0}}if(h.data&&h.processData&&"string"!=typeof h.data&&(h.data=w.param(h.data,h.traditional)),_t(It,h,n,E),c)return E;(f=w.event&&h.global)&&0==w.active++&&w.event.trigger("ajaxStart"),h.type=h.type.toUpperCase(),h.hasContent=!Mt.test(h.type),o=h.url.replace(Lt,""),h.hasContent?h.data&&h.processData&&0===(h.contentType||"").indexOf("application/x-www-form-urlencoded")&&(h.data=h.data.replace(qt,"+")):(d=h.url.slice(o.length),h.data&&(h.processData||"string"==typeof h.data)&&(o+=(kt.test(o)?"&":"?")+h.data,delete h.data),!1===h.cache&&(o=o.replace(Ht,"$1"),d=(kt.test(o)?"&":"?")+"_="+Et+++d),h.url=o+d),h.ifModified&&(w.lastModified[o]&&E.setRequestHeader("If-Modified-Since",w.lastModified[o]),w.etag[o]&&E.setRequestHeader("If-None-Match",w.etag[o])),(h.data&&h.hasContent&&!1!==h.contentType||n.contentType)&&E.setRequestHeader("Content-Type",h.contentType),E.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+("*"!==h.dataTypes[0]?", "+$t+"; q=0.01":""):h.accepts["*"]);for(p in h.headers)E.setRequestHeader(p,h.headers[p]);if(h.beforeSend&&(!1===h.beforeSend.call(g,E,h)||c))return E.abort();if(C="abort",m.add(h.complete),E.done(h.success),E.fail(h.error),i=_t(Wt,h,n,E)){if(E.readyState=1,f&&y.trigger("ajaxSend",[E,h]),c)return E;h.async&&h.timeout>0&&(u=e.setTimeout(function(){E.abort("timeout")},h.timeout));try{c=!1,i.send(b,k)}catch(e){if(c)throw e;k(-1,e)}}else k(-1,"No Transport");function k(t,n,r,s){var l,p,d,b,T,C=n;c||(c=!0,u&&e.clearTimeout(u),i=void 0,a=s||"",E.readyState=t>0?4:0,l=t>=200&&t<300||304===t,r&&(b=Xt(h,E,r)),b=Ut(h,b,E,l),l?(h.ifModified&&((T=E.getResponseHeader("Last-Modified"))&&(w.lastModified[o]=T),(T=E.getResponseHeader("etag"))&&(w.etag[o]=T)),204===t||"HEAD"===h.type?C="nocontent":304===t?C="notmodified":(C=b.state,p=b.data,l=!(d=b.error))):(d=C,!t&&C||(C="error",t<0&&(t=0))),E.status=t,E.statusText=(n||C)+"",l?v.resolveWith(g,[p,C,E]):v.rejectWith(g,[E,C,d]),E.statusCode(x),x=void 0,f&&y.trigger(l?"ajaxSuccess":"ajaxError",[E,h,l?p:d]),m.fireWith(g,[E,C]),f&&(y.trigger("ajaxComplete",[E,h]),--w.active||w.event.trigger("ajaxStop")))}return E},getJSON:function(e,t,n){return w.get(e,t,n,"json")},getScript:function(e,t){return w.get(e,void 0,t,"script")}}),w.each(["get","post"],function(e,t){w[t]=function(e,n,r,i){return g(n)&&(i=i||r,r=n,n=void 0),w.ajax(w.extend({url:e,type:t,dataType:i,data:n,success:r},w.isPlainObject(e)&&e))}}),w._evalUrl=function(e){return w.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},w.fn.extend({wrapAll:function(e){var t;return this[0]&&(g(e)&&(e=e.call(this[0])),t=w(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return g(e)?this.each(function(t){w(this).wrapInner(e.call(this,t))}):this.each(function(){var t=w(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=g(e);return this.each(function(n){w(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){w(this).replaceWith(this.childNodes)}),this}}),w.expr.pseudos.hidden=function(e){return!w.expr.pseudos.visible(e)},w.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},w.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var Vt={0:200,1223:204},Gt=w.ajaxSettings.xhr();h.cors=!!Gt&&"withCredentials"in Gt,h.ajax=Gt=!!Gt,w.ajaxTransport(function(t){var n,r;if(h.cors||Gt&&!t.crossDomain)return{send:function(i,o){var a,s=t.xhr();if(s.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(a in t.xhrFields)s[a]=t.xhrFields[a];t.mimeType&&s.overrideMimeType&&s.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");for(a in i)s.setRequestHeader(a,i[a]);n=function(e){return function(){n&&(n=r=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===e?s.abort():"error"===e?"number"!=typeof s.status?o(0,"error"):o(s.status,s.statusText):o(Vt[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=n(),r=s.onerror=s.ontimeout=n("error"),void 0!==s.onabort?s.onabort=r:s.onreadystatechange=function(){4===s.readyState&&e.setTimeout(function(){n&&r()})},n=n("abort");try{s.send(t.hasContent&&t.data||null)}catch(e){if(n)throw e}},abort:function(){n&&n()}}}),w.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),w.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return w.globalEval(e),e}}}),w.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),w.ajaxTransport("script",function(e){if(e.crossDomain){var t,n;return{send:function(i,o){t=w(" 58 | 59 | 60 | -------------------------------------------------------------------------------- /admin-go/templates/index.html: -------------------------------------------------------------------------------- 1 | {{ define "content" }} 2 | 5 |

Welcome to Litbox

6 | {{ end }} -------------------------------------------------------------------------------- /admin-go/templates/login.html: -------------------------------------------------------------------------------- 1 | {{ define "content" }} 2 | 5 | 6 | 7 | {{ end }} -------------------------------------------------------------------------------- /admin/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | 8 | # Runtime data 9 | pids 10 | *.pid 11 | *.seed 12 | *.pid.lock 13 | 14 | # Directory for instrumented libs generated by jscoverage/JSCover 15 | lib-cov 16 | 17 | # Coverage directory used by tools like istanbul 18 | coverage 19 | 20 | # nyc test coverage 21 | .nyc_output 22 | 23 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 24 | .grunt 25 | 26 | # Typescript cache 27 | .tscache 28 | 29 | # Bower dependency directory (https://bower.io/) 30 | bower_components 31 | 32 | # node-waf configuration 33 | .lock-wscript 34 | 35 | # Compiled binary addons (https://nodejs.org/api/addons.html) 36 | build/Release 37 | 38 | # Dependency directories 39 | node_modules/ 40 | jspm_packages/ 41 | 42 | # Typescript v1 declaration files 43 | typings/ 44 | 45 | # Optional npm cache directory 46 | .npm 47 | 48 | # Optional eslint cache 49 | .eslintcache 50 | 51 | # Optional REPL history 52 | .node_repl_history 53 | 54 | # Output of 'npm pack' 55 | *.tgz 56 | 57 | # Yarn Integrity file 58 | .yarn-integrity 59 | 60 | # dotenv environment variables file 61 | .env 62 | 63 | dist/ 64 | 65 | 66 | #-- admin box specific files 67 | 68 | #-- The password file 69 | admin_password 70 | 71 | #-- The key files 72 | vertcoin-box-admin.key 73 | vertcoin-box-admin.key.pub 74 | -------------------------------------------------------------------------------- /admin/Dockerfile: -------------------------------------------------------------------------------- 1 | 2 | FROM node:8-alpine 3 | COPY . /var/app 4 | RUN cd /var/app && npm update && npm install --silent 5 | WORKDIR /var/app 6 | ENV NODE_ENV=production 7 | CMD ["npm", "start"] -------------------------------------------------------------------------------- /admin/app.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var path = require('path'); 3 | var fs = require('fs'); 4 | var favicon = require('serve-favicon'); 5 | var logger = require('morgan'); 6 | var cookieParser = require('cookie-parser'); 7 | var bodyParser = require('body-parser'); 8 | var hash = require('pbkdf2-password')() 9 | 10 | var index = require('./routes/index'); 11 | var auth = require('./routes/auth'); 12 | var status = require('./routes/status'); 13 | var pair = require('./routes/pair'); 14 | 15 | var app = express(); 16 | 17 | app.use(require('morgan')('combined')); 18 | app.use(require('cookie-parser')()); 19 | app.use(require('body-parser').urlencoded({ extended: true })); 20 | app.use(require('express-session')({ secret: require('crypto').randomBytes(64).toString('hex'), resave: false, saveUninitialized: false })); 21 | 22 | 23 | // authentication setup 24 | var passport = require('./passport.config'); 25 | app.use(passport.initialize()); 26 | app.use(passport.session()); 27 | 28 | // create default root password if it does not exist 29 | if(!fs.existsSync(path.join(__dirname, 'admin_password'))) { 30 | hash({ password: 'admin' }, function (err, pass, salt, hash) { 31 | if (err) throw err; 32 | // store the salt & hash in the "db" 33 | fs.writeFile(path.join(__dirname, 'admin_password'), "admin\t" + salt + "\t" + hash, (err) => { 34 | if(err) console.error(err); 35 | else console.log("Default admin password file written"); 36 | }); 37 | }); 38 | } 39 | 40 | // Create directory for storing pairing requests 41 | if(!fs.existsSync(path.join(__dirname, 'pairingRequests'))) { 42 | fs.mkdirSync(path.join(__dirname, 'pairingRequests')); 43 | } 44 | 45 | // view engine setup 46 | app.set('views', path.join(__dirname, 'views')); 47 | app.set('view engine', 'pug'); 48 | 49 | // uncomment after placing your favicon in /public 50 | //app.use(favicon(path.join(__dirname, 'public', 'favicon.ico'))); 51 | app.use(logger('dev')); 52 | app.use(bodyParser.json()); 53 | app.use(bodyParser.urlencoded({ extended: false })); 54 | app.use(cookieParser()); 55 | app.use(express.static(path.join(__dirname, 'public'))); 56 | 57 | app.use('/', index); 58 | app.use('/auth', auth); 59 | app.use('/status', status); 60 | app.use('/pair', pair); 61 | 62 | // catch 404 and forward to error handler 63 | app.use(function(req, res, next) { 64 | var err = new Error('Not Found'); 65 | err.status = 404; 66 | next(err); 67 | }); 68 | 69 | // error handler 70 | app.use(function(err, req, res, next) { 71 | // set locals, only providing error in development 72 | res.locals.message = err.message; 73 | res.locals.error = req.app.get('env') === 'development' ? err : {}; 74 | 75 | // render the error page 76 | res.status(err.status || 500); 77 | res.render('error'); 78 | }); 79 | 80 | 81 | 82 | module.exports = app; 83 | -------------------------------------------------------------------------------- /admin/bin/www: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /** 4 | * Module dependencies. 5 | */ 6 | 7 | var app = require('../app'); 8 | var debug = require('debug')('vertcoin-box-admin:server'); 9 | var http = require('http'); 10 | 11 | /** 12 | * Get port from environment and store in Express. 13 | */ 14 | 15 | var port = normalizePort(process.env.PORT || '3000'); 16 | app.set('port', port); 17 | 18 | /** 19 | * Create HTTP server. 20 | */ 21 | 22 | var server = http.createServer(app); 23 | 24 | /** 25 | * Listen on provided port, on all network interfaces. 26 | */ 27 | 28 | server.listen(port); 29 | server.on('error', onError); 30 | server.on('listening', onListening); 31 | 32 | var pairApp = require('../pairing'); 33 | var pairPort = normalizePort(process.env.PAIR_PORT || '3001'); 34 | pairApp.set('port', pairPort); 35 | var pairServer = http.createServer(pairApp); 36 | pairServer.listen(pairPort); 37 | pairServer.on('error', onError); 38 | pairServer.on('listening', onListening); 39 | 40 | /** 41 | * Normalize a port into a number, string, or false. 42 | */ 43 | 44 | function normalizePort(val) { 45 | var port = parseInt(val, 10); 46 | 47 | if (isNaN(port)) { 48 | // named pipe 49 | return val; 50 | } 51 | 52 | if (port >= 0) { 53 | // port number 54 | return port; 55 | } 56 | 57 | return false; 58 | } 59 | 60 | /** 61 | * Event listener for HTTP server "error" event. 62 | */ 63 | 64 | function onError(error) { 65 | if (error.syscall !== 'listen') { 66 | throw error; 67 | } 68 | 69 | var bind = typeof port === 'string' 70 | ? 'Pipe ' + port 71 | : 'Port ' + port; 72 | 73 | // handle specific listen errors with friendly messages 74 | switch (error.code) { 75 | case 'EACCES': 76 | console.error(bind + ' requires elevated privileges'); 77 | process.exit(1); 78 | break; 79 | case 'EADDRINUSE': 80 | console.error(bind + ' is already in use'); 81 | process.exit(1); 82 | break; 83 | default: 84 | throw error; 85 | } 86 | } 87 | 88 | /** 89 | * Event listener for HTTP server "listening" event. 90 | */ 91 | 92 | function onListening() { 93 | var addr = server.address(); 94 | var bind = typeof addr === 'string' 95 | ? 'pipe ' + addr 96 | : 'port ' + addr.port; 97 | debug('Listening on ' + bind); 98 | } 99 | -------------------------------------------------------------------------------- /admin/lit.js: -------------------------------------------------------------------------------- 1 | const WebSocket = require('ws'); 2 | 3 | var id = 1; 4 | 5 | module.exports = {}; 6 | module.exports.connect = function() { 7 | var host = process.env.LIT_HOST || 'litbox-lit'; 8 | console.log("Connecting to " + host); 9 | 10 | var ws = new WebSocket('ws://' + host + ':8001/ws', { origin: 'http://localhost' }); 11 | return ws; 12 | }; 13 | 14 | module.exports.getBalance = function(ws, callback) { 15 | id++; 16 | var requestId = id; 17 | var request = { 18 | id : requestId, 19 | method: "LitRPC.Balance", 20 | params: [] 21 | }; 22 | ws.on('message', (dataString) => { 23 | var data = JSON.parse(dataString); 24 | if(data.id == requestId) { 25 | callback(null, data); 26 | } 27 | }); 28 | ws.send(JSON.stringify(request)); 29 | } 30 | 31 | -------------------------------------------------------------------------------- /admin/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vertcoin-box-admin", 3 | "version": "0.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "accepts": { 8 | "version": "1.3.4", 9 | "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.4.tgz", 10 | "integrity": "sha1-hiRnWMfdbSGmR0/whKR0DsBesh8=", 11 | "requires": { 12 | "mime-types": "2.1.17", 13 | "negotiator": "0.6.1" 14 | } 15 | }, 16 | "acorn": { 17 | "version": "3.3.0", 18 | "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", 19 | "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=" 20 | }, 21 | "acorn-globals": { 22 | "version": "3.1.0", 23 | "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-3.1.0.tgz", 24 | "integrity": "sha1-/YJw9x+7SZawBPqIDuXUZXOnMb8=", 25 | "requires": { 26 | "acorn": "4.0.13" 27 | }, 28 | "dependencies": { 29 | "acorn": { 30 | "version": "4.0.13", 31 | "resolved": "https://registry.npmjs.org/acorn/-/acorn-4.0.13.tgz", 32 | "integrity": "sha1-EFSVrlNh1pe9GVyCUZLhrX8lN4c=" 33 | } 34 | } 35 | }, 36 | "align-text": { 37 | "version": "0.1.4", 38 | "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", 39 | "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", 40 | "requires": { 41 | "kind-of": "3.2.2", 42 | "longest": "1.0.1", 43 | "repeat-string": "1.6.1" 44 | } 45 | }, 46 | "amdefine": { 47 | "version": "1.0.1", 48 | "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", 49 | "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=" 50 | }, 51 | "array-flatten": { 52 | "version": "1.1.1", 53 | "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", 54 | "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" 55 | }, 56 | "asap": { 57 | "version": "2.0.6", 58 | "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", 59 | "integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=" 60 | }, 61 | "asn1": { 62 | "version": "0.2.3", 63 | "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", 64 | "integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y=" 65 | }, 66 | "basic-auth": { 67 | "version": "2.0.0", 68 | "resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.0.tgz", 69 | "integrity": "sha1-AV2z81PgLlY3d1X5YnQuiYHnu7o=", 70 | "requires": { 71 | "safe-buffer": "5.1.1" 72 | } 73 | }, 74 | "body-parser": { 75 | "version": "1.18.2", 76 | "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.2.tgz", 77 | "integrity": "sha1-h2eKGdhLR9hZuDGZvVm84iKxBFQ=", 78 | "requires": { 79 | "bytes": "3.0.0", 80 | "content-type": "1.0.4", 81 | "debug": "2.6.9", 82 | "depd": "1.1.1", 83 | "http-errors": "1.6.2", 84 | "iconv-lite": "0.4.19", 85 | "on-finished": "2.3.0", 86 | "qs": "6.5.1", 87 | "raw-body": "2.3.2", 88 | "type-is": "1.6.15" 89 | } 90 | }, 91 | "bytes": { 92 | "version": "3.0.0", 93 | "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", 94 | "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=" 95 | }, 96 | "camelcase": { 97 | "version": "1.2.1", 98 | "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", 99 | "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=" 100 | }, 101 | "center-align": { 102 | "version": "0.1.3", 103 | "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", 104 | "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", 105 | "requires": { 106 | "align-text": "0.1.4", 107 | "lazy-cache": "1.0.4" 108 | } 109 | }, 110 | "character-parser": { 111 | "version": "2.2.0", 112 | "resolved": "https://registry.npmjs.org/character-parser/-/character-parser-2.2.0.tgz", 113 | "integrity": "sha1-x84o821LzZdE5f/CxfzeHHMmH8A=", 114 | "requires": { 115 | "is-regex": "1.0.4" 116 | } 117 | }, 118 | "clean-css": { 119 | "version": "3.4.28", 120 | "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-3.4.28.tgz", 121 | "integrity": "sha1-vxlF6C/ICPVWlebd6uwBQA79A/8=", 122 | "requires": { 123 | "commander": "2.8.1", 124 | "source-map": "0.4.4" 125 | } 126 | }, 127 | "cliui": { 128 | "version": "2.1.0", 129 | "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", 130 | "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", 131 | "requires": { 132 | "center-align": "0.1.3", 133 | "right-align": "0.1.3", 134 | "wordwrap": "0.0.2" 135 | } 136 | }, 137 | "commander": { 138 | "version": "2.8.1", 139 | "resolved": "https://registry.npmjs.org/commander/-/commander-2.8.1.tgz", 140 | "integrity": "sha1-Br42f+v9oMMwqh4qBy09yXYkJdQ=", 141 | "requires": { 142 | "graceful-readlink": "1.0.1" 143 | } 144 | }, 145 | "connect-ensure-login": { 146 | "version": "0.1.1", 147 | "resolved": "https://registry.npmjs.org/connect-ensure-login/-/connect-ensure-login-0.1.1.tgz", 148 | "integrity": "sha1-F03MUSQ7nqwj+NmCFa62aU4uihI=" 149 | }, 150 | "constantinople": { 151 | "version": "3.1.0", 152 | "resolved": "https://registry.npmjs.org/constantinople/-/constantinople-3.1.0.tgz", 153 | "integrity": "sha1-dWnKqKo/jVk11i4fqW+fcCzYHHk=", 154 | "requires": { 155 | "acorn": "3.3.0", 156 | "is-expression": "2.1.0" 157 | } 158 | }, 159 | "content-disposition": { 160 | "version": "0.5.2", 161 | "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", 162 | "integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ=" 163 | }, 164 | "content-type": { 165 | "version": "1.0.4", 166 | "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", 167 | "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" 168 | }, 169 | "cookie": { 170 | "version": "0.3.1", 171 | "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", 172 | "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=" 173 | }, 174 | "cookie-parser": { 175 | "version": "1.4.3", 176 | "resolved": "https://registry.npmjs.org/cookie-parser/-/cookie-parser-1.4.3.tgz", 177 | "integrity": "sha1-D+MfoZ0AC5X0qt8fU/3CuKIDuqU=", 178 | "requires": { 179 | "cookie": "0.3.1", 180 | "cookie-signature": "1.0.6" 181 | } 182 | }, 183 | "cookie-signature": { 184 | "version": "1.0.6", 185 | "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", 186 | "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" 187 | }, 188 | "crc": { 189 | "version": "3.4.4", 190 | "resolved": "https://registry.npmjs.org/crc/-/crc-3.4.4.tgz", 191 | "integrity": "sha1-naHpgOO9RPxck79as9ozeNheRms=" 192 | }, 193 | "debug": { 194 | "version": "2.6.9", 195 | "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", 196 | "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", 197 | "requires": { 198 | "ms": "2.0.0" 199 | } 200 | }, 201 | "decamelize": { 202 | "version": "1.2.0", 203 | "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", 204 | "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" 205 | }, 206 | "depd": { 207 | "version": "1.1.1", 208 | "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.1.tgz", 209 | "integrity": "sha1-V4O04cRZ8G+lyif5kfPQbnoxA1k=" 210 | }, 211 | "destroy": { 212 | "version": "1.0.4", 213 | "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", 214 | "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" 215 | }, 216 | "doctypes": { 217 | "version": "1.1.0", 218 | "resolved": "https://registry.npmjs.org/doctypes/-/doctypes-1.1.0.tgz", 219 | "integrity": "sha1-6oCxBqh1OHdOijpKWv4pPeSJ4Kk=" 220 | }, 221 | "ee-first": { 222 | "version": "1.1.1", 223 | "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", 224 | "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" 225 | }, 226 | "encodeurl": { 227 | "version": "1.0.1", 228 | "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.1.tgz", 229 | "integrity": "sha1-eePVhlU0aQn+bw9Fpd5oEDspTSA=" 230 | }, 231 | "escape-html": { 232 | "version": "1.0.3", 233 | "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", 234 | "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" 235 | }, 236 | "etag": { 237 | "version": "1.8.1", 238 | "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", 239 | "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" 240 | }, 241 | "express": { 242 | "version": "4.15.5", 243 | "resolved": "https://registry.npmjs.org/express/-/express-4.15.5.tgz", 244 | "integrity": "sha1-ZwI1ypWYiQpa6BcLg9tyK4Qu2Sc=", 245 | "requires": { 246 | "accepts": "1.3.4", 247 | "array-flatten": "1.1.1", 248 | "content-disposition": "0.5.2", 249 | "content-type": "1.0.4", 250 | "cookie": "0.3.1", 251 | "cookie-signature": "1.0.6", 252 | "debug": "2.6.9", 253 | "depd": "1.1.1", 254 | "encodeurl": "1.0.1", 255 | "escape-html": "1.0.3", 256 | "etag": "1.8.1", 257 | "finalhandler": "1.0.6", 258 | "fresh": "0.5.2", 259 | "merge-descriptors": "1.0.1", 260 | "methods": "1.1.2", 261 | "on-finished": "2.3.0", 262 | "parseurl": "1.3.2", 263 | "path-to-regexp": "0.1.7", 264 | "proxy-addr": "1.1.5", 265 | "qs": "6.5.0", 266 | "range-parser": "1.2.0", 267 | "send": "0.15.6", 268 | "serve-static": "1.12.6", 269 | "setprototypeof": "1.0.3", 270 | "statuses": "1.3.1", 271 | "type-is": "1.6.15", 272 | "utils-merge": "1.0.0", 273 | "vary": "1.1.2" 274 | }, 275 | "dependencies": { 276 | "finalhandler": { 277 | "version": "1.0.6", 278 | "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.0.6.tgz", 279 | "integrity": "sha1-AHrqM9Gk0+QgF/YkhIrVjSEvgU8=", 280 | "requires": { 281 | "debug": "2.6.9", 282 | "encodeurl": "1.0.1", 283 | "escape-html": "1.0.3", 284 | "on-finished": "2.3.0", 285 | "parseurl": "1.3.2", 286 | "statuses": "1.3.1", 287 | "unpipe": "1.0.0" 288 | } 289 | }, 290 | "ipaddr.js": { 291 | "version": "1.4.0", 292 | "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.4.0.tgz", 293 | "integrity": "sha1-KWrKh4qCGBbluF0KKFqZvP9FgvA=" 294 | }, 295 | "mime": { 296 | "version": "1.3.4", 297 | "resolved": "https://registry.npmjs.org/mime/-/mime-1.3.4.tgz", 298 | "integrity": "sha1-EV+eO2s9rylZmDyzjxSaLUDrXVM=" 299 | }, 300 | "proxy-addr": { 301 | "version": "1.1.5", 302 | "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-1.1.5.tgz", 303 | "integrity": "sha1-ccDuOxAt4/IC87ZPYI0XP8uhqRg=", 304 | "requires": { 305 | "forwarded": "0.1.2", 306 | "ipaddr.js": "1.4.0" 307 | } 308 | }, 309 | "qs": { 310 | "version": "6.5.0", 311 | "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.0.tgz", 312 | "integrity": "sha512-fjVFjW9yhqMhVGwRExCXLhJKrLlkYSaxNWdyc9rmHlrVZbk35YHH312dFd7191uQeXkI3mKLZTIbSvIeFwFemg==" 313 | }, 314 | "send": { 315 | "version": "0.15.6", 316 | "resolved": "https://registry.npmjs.org/send/-/send-0.15.6.tgz", 317 | "integrity": "sha1-IPI6nJJbdiq4JwX+L52yUqzkfjQ=", 318 | "requires": { 319 | "debug": "2.6.9", 320 | "depd": "1.1.1", 321 | "destroy": "1.0.4", 322 | "encodeurl": "1.0.1", 323 | "escape-html": "1.0.3", 324 | "etag": "1.8.1", 325 | "fresh": "0.5.2", 326 | "http-errors": "1.6.2", 327 | "mime": "1.3.4", 328 | "ms": "2.0.0", 329 | "on-finished": "2.3.0", 330 | "range-parser": "1.2.0", 331 | "statuses": "1.3.1" 332 | } 333 | }, 334 | "serve-static": { 335 | "version": "1.12.6", 336 | "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.12.6.tgz", 337 | "integrity": "sha1-uXN3P2NEmTTaVOW+ul4x2fQhFXc=", 338 | "requires": { 339 | "encodeurl": "1.0.1", 340 | "escape-html": "1.0.3", 341 | "parseurl": "1.3.2", 342 | "send": "0.15.6" 343 | } 344 | }, 345 | "setprototypeof": { 346 | "version": "1.0.3", 347 | "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.3.tgz", 348 | "integrity": "sha1-ZlZ+NwQ+608E2RvWWMDL77VbjgQ=" 349 | }, 350 | "utils-merge": { 351 | "version": "1.0.0", 352 | "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.0.tgz", 353 | "integrity": "sha1-ApT7kiu5N1FTVBxPcJYjHyh8ivg=" 354 | } 355 | } 356 | }, 357 | "express-session": { 358 | "version": "1.15.6", 359 | "resolved": "https://registry.npmjs.org/express-session/-/express-session-1.15.6.tgz", 360 | "integrity": "sha512-r0nrHTCYtAMrFwZ0kBzZEXa1vtPVrw0dKvGSrKP4dahwBQ1BJpF2/y1Pp4sCD/0kvxV4zZeclyvfmw0B4RMJQA==", 361 | "requires": { 362 | "cookie": "0.3.1", 363 | "cookie-signature": "1.0.6", 364 | "crc": "3.4.4", 365 | "debug": "2.6.9", 366 | "depd": "1.1.1", 367 | "on-headers": "1.0.1", 368 | "parseurl": "1.3.2", 369 | "uid-safe": "2.1.5", 370 | "utils-merge": "1.0.1" 371 | } 372 | }, 373 | "fastfall": { 374 | "version": "1.5.1", 375 | "resolved": "https://registry.npmjs.org/fastfall/-/fastfall-1.5.1.tgz", 376 | "integrity": "sha1-P+4DMxpJ0dObPN96XpzWb0dee5Q=", 377 | "requires": { 378 | "reusify": "1.0.3" 379 | } 380 | }, 381 | "forwarded": { 382 | "version": "0.1.2", 383 | "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", 384 | "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=" 385 | }, 386 | "fresh": { 387 | "version": "0.5.2", 388 | "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", 389 | "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" 390 | }, 391 | "function-bind": { 392 | "version": "1.1.1", 393 | "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", 394 | "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" 395 | }, 396 | "graceful-readlink": { 397 | "version": "1.0.1", 398 | "resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz", 399 | "integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=" 400 | }, 401 | "has": { 402 | "version": "1.0.1", 403 | "resolved": "https://registry.npmjs.org/has/-/has-1.0.1.tgz", 404 | "integrity": "sha1-hGFzP1OLCDfJNh45qauelwTcLyg=", 405 | "requires": { 406 | "function-bind": "1.1.1" 407 | } 408 | }, 409 | "http-errors": { 410 | "version": "1.6.2", 411 | "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.2.tgz", 412 | "integrity": "sha1-CgAsyFcHGSp+eUbO7cERVfYOxzY=", 413 | "requires": { 414 | "depd": "1.1.1", 415 | "inherits": "2.0.3", 416 | "setprototypeof": "1.0.3", 417 | "statuses": "1.3.1" 418 | }, 419 | "dependencies": { 420 | "setprototypeof": { 421 | "version": "1.0.3", 422 | "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.3.tgz", 423 | "integrity": "sha1-ZlZ+NwQ+608E2RvWWMDL77VbjgQ=" 424 | } 425 | } 426 | }, 427 | "iconv-lite": { 428 | "version": "0.4.19", 429 | "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", 430 | "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==" 431 | }, 432 | "inherits": { 433 | "version": "2.0.3", 434 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", 435 | "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" 436 | }, 437 | "is-buffer": { 438 | "version": "1.1.6", 439 | "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", 440 | "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" 441 | }, 442 | "is-expression": { 443 | "version": "2.1.0", 444 | "resolved": "https://registry.npmjs.org/is-expression/-/is-expression-2.1.0.tgz", 445 | "integrity": "sha1-kb6dR968/vB3l36XIr5tz7RGXvA=", 446 | "requires": { 447 | "acorn": "3.3.0", 448 | "object-assign": "4.1.1" 449 | } 450 | }, 451 | "is-promise": { 452 | "version": "2.1.0", 453 | "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", 454 | "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=" 455 | }, 456 | "is-regex": { 457 | "version": "1.0.4", 458 | "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", 459 | "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", 460 | "requires": { 461 | "has": "1.0.1" 462 | } 463 | }, 464 | "jade-bootstrap": { 465 | "version": "1.0.14", 466 | "resolved": "https://registry.npmjs.org/jade-bootstrap/-/jade-bootstrap-1.0.14.tgz", 467 | "integrity": "sha1-x99tRjinKHKZ3HUXXrUAnzJyEeg=" 468 | }, 469 | "js-stringify": { 470 | "version": "1.0.2", 471 | "resolved": "https://registry.npmjs.org/js-stringify/-/js-stringify-1.0.2.tgz", 472 | "integrity": "sha1-Fzb939lyTyijaCrcYjCufk6Weds=" 473 | }, 474 | "jstransformer": { 475 | "version": "1.0.0", 476 | "resolved": "https://registry.npmjs.org/jstransformer/-/jstransformer-1.0.0.tgz", 477 | "integrity": "sha1-7Yvwkh4vPx7U1cGkT2hwntJHIsM=", 478 | "requires": { 479 | "is-promise": "2.1.0", 480 | "promise": "7.3.1" 481 | } 482 | }, 483 | "kind-of": { 484 | "version": "3.2.2", 485 | "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", 486 | "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", 487 | "requires": { 488 | "is-buffer": "1.1.6" 489 | } 490 | }, 491 | "lazy-cache": { 492 | "version": "1.0.4", 493 | "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", 494 | "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=" 495 | }, 496 | "longest": { 497 | "version": "1.0.1", 498 | "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", 499 | "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=" 500 | }, 501 | "media-typer": { 502 | "version": "0.3.0", 503 | "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", 504 | "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" 505 | }, 506 | "merge-descriptors": { 507 | "version": "1.0.1", 508 | "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", 509 | "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" 510 | }, 511 | "methods": { 512 | "version": "1.1.2", 513 | "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", 514 | "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" 515 | }, 516 | "mime-db": { 517 | "version": "1.30.0", 518 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.30.0.tgz", 519 | "integrity": "sha1-dMZD2i3Z1qRTmZY0ZbJtXKfXHwE=" 520 | }, 521 | "mime-types": { 522 | "version": "2.1.17", 523 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.17.tgz", 524 | "integrity": "sha1-Cdejk/A+mVp5+K+Fe3Cp4KsWVXo=", 525 | "requires": { 526 | "mime-db": "1.30.0" 527 | } 528 | }, 529 | "morgan": { 530 | "version": "1.9.0", 531 | "resolved": "https://registry.npmjs.org/morgan/-/morgan-1.9.0.tgz", 532 | "integrity": "sha1-0B+mxlhZt2/PMbPLU6OCGjEdgFE=", 533 | "requires": { 534 | "basic-auth": "2.0.0", 535 | "debug": "2.6.9", 536 | "depd": "1.1.1", 537 | "on-finished": "2.3.0", 538 | "on-headers": "1.0.1" 539 | } 540 | }, 541 | "ms": { 542 | "version": "2.0.0", 543 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", 544 | "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" 545 | }, 546 | "negotiator": { 547 | "version": "0.6.1", 548 | "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", 549 | "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=" 550 | }, 551 | "object-assign": { 552 | "version": "4.1.1", 553 | "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", 554 | "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" 555 | }, 556 | "on-finished": { 557 | "version": "2.3.0", 558 | "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", 559 | "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", 560 | "requires": { 561 | "ee-first": "1.1.1" 562 | } 563 | }, 564 | "on-headers": { 565 | "version": "1.0.1", 566 | "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.1.tgz", 567 | "integrity": "sha1-ko9dD0cNSTQmUepnlLCFfBAGk/c=" 568 | }, 569 | "parseurl": { 570 | "version": "1.3.2", 571 | "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz", 572 | "integrity": "sha1-/CidTtiZMRlGDBViUyYs3I3mW/M=" 573 | }, 574 | "passport": { 575 | "version": "0.4.0", 576 | "resolved": "https://registry.npmjs.org/passport/-/passport-0.4.0.tgz", 577 | "integrity": "sha1-xQlWkTR71a07XhgCOMORTRbwWBE=", 578 | "requires": { 579 | "passport-strategy": "1.0.0", 580 | "pause": "0.0.1" 581 | } 582 | }, 583 | "passport-local": { 584 | "version": "1.0.0", 585 | "resolved": "https://registry.npmjs.org/passport-local/-/passport-local-1.0.0.tgz", 586 | "integrity": "sha1-H+YyaMkudWBmJkN+O5BmYsFbpu4=", 587 | "requires": { 588 | "passport-strategy": "1.0.0" 589 | } 590 | }, 591 | "passport-strategy": { 592 | "version": "1.0.0", 593 | "resolved": "https://registry.npmjs.org/passport-strategy/-/passport-strategy-1.0.0.tgz", 594 | "integrity": "sha1-tVOaqPwiWj0a0XlHbd8ja0QPUuQ=" 595 | }, 596 | "path-parse": { 597 | "version": "1.0.5", 598 | "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", 599 | "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=" 600 | }, 601 | "path-to-regexp": { 602 | "version": "0.1.7", 603 | "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", 604 | "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" 605 | }, 606 | "pause": { 607 | "version": "0.0.1", 608 | "resolved": "https://registry.npmjs.org/pause/-/pause-0.0.1.tgz", 609 | "integrity": "sha1-HUCLP9t2kjuVQ9lvtMnf1TXZy10=" 610 | }, 611 | "pbkdf2-password": { 612 | "version": "1.2.1", 613 | "resolved": "https://registry.npmjs.org/pbkdf2-password/-/pbkdf2-password-1.2.1.tgz", 614 | "integrity": "sha1-n3RROhVf041Na1yEFNOVXdJspu4=", 615 | "requires": { 616 | "fastfall": "1.5.1" 617 | } 618 | }, 619 | "promise": { 620 | "version": "7.3.1", 621 | "resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz", 622 | "integrity": "sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==", 623 | "requires": { 624 | "asap": "2.0.6" 625 | } 626 | }, 627 | "pug": { 628 | "version": "2.0.0-beta11", 629 | "resolved": "https://registry.npmjs.org/pug/-/pug-2.0.0-beta11.tgz", 630 | "integrity": "sha1-Favmr1AEx+LPRhPksnRlyVRrXwE=", 631 | "requires": { 632 | "pug-code-gen": "1.1.1", 633 | "pug-filters": "2.1.5", 634 | "pug-lexer": "3.1.0", 635 | "pug-linker": "2.0.3", 636 | "pug-load": "2.0.9", 637 | "pug-parser": "2.0.2", 638 | "pug-runtime": "2.0.3", 639 | "pug-strip-comments": "1.0.2" 640 | } 641 | }, 642 | "pug-attrs": { 643 | "version": "2.0.2", 644 | "resolved": "https://registry.npmjs.org/pug-attrs/-/pug-attrs-2.0.2.tgz", 645 | "integrity": "sha1-i+KyIlVo/6ddG4Zpgr/59BEa/8s=", 646 | "requires": { 647 | "constantinople": "3.1.0", 648 | "js-stringify": "1.0.2", 649 | "pug-runtime": "2.0.3" 650 | } 651 | }, 652 | "pug-bootstrap": { 653 | "version": "0.0.15", 654 | "resolved": "https://registry.npmjs.org/pug-bootstrap/-/pug-bootstrap-0.0.15.tgz", 655 | "integrity": "sha1-Ack6s2nPGpRWdtcOoSUjaAjhIRY=", 656 | "requires": { 657 | "pug": "2.0.0-rc.4" 658 | }, 659 | "dependencies": { 660 | "pug": { 661 | "version": "2.0.0-rc.4", 662 | "resolved": "https://registry.npmjs.org/pug/-/pug-2.0.0-rc.4.tgz", 663 | "integrity": "sha512-SL7xovj6E2Loq9N0UgV6ynjMLW4urTFY/L/Fprhvz13Xc5vjzkjZjI1QHKq31200+6PSD8PyU6MqrtCTJj6/XA==", 664 | "requires": { 665 | "pug-code-gen": "2.0.0", 666 | "pug-filters": "2.1.5", 667 | "pug-lexer": "3.1.0", 668 | "pug-linker": "3.0.3", 669 | "pug-load": "2.0.9", 670 | "pug-parser": "4.0.0", 671 | "pug-runtime": "2.0.3", 672 | "pug-strip-comments": "1.0.2" 673 | } 674 | }, 675 | "pug-code-gen": { 676 | "version": "2.0.0", 677 | "resolved": "https://registry.npmjs.org/pug-code-gen/-/pug-code-gen-2.0.0.tgz", 678 | "integrity": "sha512-E4oiJT+Jn5tyEIloj8dIJQognbiNNp0i0cAJmYtQTFS0soJ917nlIuFtqVss3IXMEyQKUew3F4gIkBpn18KbVg==", 679 | "requires": { 680 | "constantinople": "3.1.0", 681 | "doctypes": "1.1.0", 682 | "js-stringify": "1.0.2", 683 | "pug-attrs": "2.0.2", 684 | "pug-error": "1.3.2", 685 | "pug-runtime": "2.0.3", 686 | "void-elements": "2.0.1", 687 | "with": "5.1.1" 688 | } 689 | }, 690 | "pug-linker": { 691 | "version": "3.0.3", 692 | "resolved": "https://registry.npmjs.org/pug-linker/-/pug-linker-3.0.3.tgz", 693 | "integrity": "sha512-DCKczglCXOzJ1lr4xUj/lVHYvS+lGmR2+KTCjZjtIpdwaN7lNOoX2SW6KFX5X4ElvW+6ThwB+acSUg08UJFN5A==", 694 | "requires": { 695 | "pug-error": "1.3.2", 696 | "pug-walk": "1.1.5" 697 | } 698 | }, 699 | "pug-parser": { 700 | "version": "4.0.0", 701 | "resolved": "https://registry.npmjs.org/pug-parser/-/pug-parser-4.0.0.tgz", 702 | "integrity": "sha512-ocEUFPdLG9awwFj0sqi1uiZLNvfoodCMULZzkRqILryIWc/UUlDlxqrKhKjAIIGPX/1SNsvxy63+ayEGocGhQg==", 703 | "requires": { 704 | "pug-error": "1.3.2", 705 | "token-stream": "0.0.1" 706 | } 707 | } 708 | } 709 | }, 710 | "pug-code-gen": { 711 | "version": "1.1.1", 712 | "resolved": "https://registry.npmjs.org/pug-code-gen/-/pug-code-gen-1.1.1.tgz", 713 | "integrity": "sha1-HPcnRO8qA56uajNAyqoRBYcSWOg=", 714 | "requires": { 715 | "constantinople": "3.1.0", 716 | "doctypes": "1.1.0", 717 | "js-stringify": "1.0.2", 718 | "pug-attrs": "2.0.2", 719 | "pug-error": "1.3.2", 720 | "pug-runtime": "2.0.3", 721 | "void-elements": "2.0.1", 722 | "with": "5.1.1" 723 | } 724 | }, 725 | "pug-error": { 726 | "version": "1.3.2", 727 | "resolved": "https://registry.npmjs.org/pug-error/-/pug-error-1.3.2.tgz", 728 | "integrity": "sha1-U659nSm7A89WRJOgJhCfVMR/XyY=" 729 | }, 730 | "pug-filters": { 731 | "version": "2.1.5", 732 | "resolved": "https://registry.npmjs.org/pug-filters/-/pug-filters-2.1.5.tgz", 733 | "integrity": "sha512-xkw71KtrC4sxleKiq+cUlQzsiLn8pM5+vCgkChW2E6oNOzaqTSIBKIQ5cl4oheuDzvJYCTSYzRaVinMUrV4YLQ==", 734 | "requires": { 735 | "clean-css": "3.4.28", 736 | "constantinople": "3.1.0", 737 | "jstransformer": "1.0.0", 738 | "pug-error": "1.3.2", 739 | "pug-walk": "1.1.5", 740 | "resolve": "1.5.0", 741 | "uglify-js": "2.8.29" 742 | } 743 | }, 744 | "pug-lexer": { 745 | "version": "3.1.0", 746 | "resolved": "https://registry.npmjs.org/pug-lexer/-/pug-lexer-3.1.0.tgz", 747 | "integrity": "sha1-/QhzdtSmdbT1n4/vQiiDQ06VgaI=", 748 | "requires": { 749 | "character-parser": "2.2.0", 750 | "is-expression": "3.0.0", 751 | "pug-error": "1.3.2" 752 | }, 753 | "dependencies": { 754 | "acorn": { 755 | "version": "4.0.13", 756 | "resolved": "https://registry.npmjs.org/acorn/-/acorn-4.0.13.tgz", 757 | "integrity": "sha1-EFSVrlNh1pe9GVyCUZLhrX8lN4c=" 758 | }, 759 | "is-expression": { 760 | "version": "3.0.0", 761 | "resolved": "https://registry.npmjs.org/is-expression/-/is-expression-3.0.0.tgz", 762 | "integrity": "sha1-Oayqa+f9HzRx3ELHQW5hwkMXrJ8=", 763 | "requires": { 764 | "acorn": "4.0.13", 765 | "object-assign": "4.1.1" 766 | } 767 | } 768 | } 769 | }, 770 | "pug-linker": { 771 | "version": "2.0.3", 772 | "resolved": "https://registry.npmjs.org/pug-linker/-/pug-linker-2.0.3.tgz", 773 | "integrity": "sha1-szH/olc33eacEntWwQ/xf652bco=", 774 | "requires": { 775 | "pug-error": "1.3.2", 776 | "pug-walk": "1.1.5" 777 | } 778 | }, 779 | "pug-load": { 780 | "version": "2.0.9", 781 | "resolved": "https://registry.npmjs.org/pug-load/-/pug-load-2.0.9.tgz", 782 | "integrity": "sha512-BDdZOCru4mg+1MiZwRQZh25+NTRo/R6/qArrdWIf308rHtWA5N9kpoUskRe4H6FslaQujC+DigH9LqlBA4gf6Q==", 783 | "requires": { 784 | "object-assign": "4.1.1", 785 | "pug-walk": "1.1.5" 786 | } 787 | }, 788 | "pug-parser": { 789 | "version": "2.0.2", 790 | "resolved": "https://registry.npmjs.org/pug-parser/-/pug-parser-2.0.2.tgz", 791 | "integrity": "sha1-U6aAz9BQOdywwn0CkJS8SnkmibA=", 792 | "requires": { 793 | "pug-error": "1.3.2", 794 | "token-stream": "0.0.1" 795 | } 796 | }, 797 | "pug-runtime": { 798 | "version": "2.0.3", 799 | "resolved": "https://registry.npmjs.org/pug-runtime/-/pug-runtime-2.0.3.tgz", 800 | "integrity": "sha1-mBYmB7D86eJU1CfzOYelrucWi9o=" 801 | }, 802 | "pug-strip-comments": { 803 | "version": "1.0.2", 804 | "resolved": "https://registry.npmjs.org/pug-strip-comments/-/pug-strip-comments-1.0.2.tgz", 805 | "integrity": "sha1-0xOvoBvMN0mA4TmeI+vy65vchRM=", 806 | "requires": { 807 | "pug-error": "1.3.2" 808 | } 809 | }, 810 | "pug-walk": { 811 | "version": "1.1.5", 812 | "resolved": "https://registry.npmjs.org/pug-walk/-/pug-walk-1.1.5.tgz", 813 | "integrity": "sha512-rJlH1lXerCIAtImXBze3dtKq/ykZMA4rpO9FnPcIgsWcxZLOvd8zltaoeOVFyBSSqCkhhJWbEbTMga8UxWUUSA==" 814 | }, 815 | "qs": { 816 | "version": "6.5.1", 817 | "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz", 818 | "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==" 819 | }, 820 | "random-bytes": { 821 | "version": "1.0.0", 822 | "resolved": "https://registry.npmjs.org/random-bytes/-/random-bytes-1.0.0.tgz", 823 | "integrity": "sha1-T2ih3Arli9P7lYSMMDJNt11kNgs=" 824 | }, 825 | "range-parser": { 826 | "version": "1.2.0", 827 | "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", 828 | "integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=" 829 | }, 830 | "raw-body": { 831 | "version": "2.3.2", 832 | "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.2.tgz", 833 | "integrity": "sha1-vNYMd9Prk83gBQKVw/N5OJvIj4k=", 834 | "requires": { 835 | "bytes": "3.0.0", 836 | "http-errors": "1.6.2", 837 | "iconv-lite": "0.4.19", 838 | "unpipe": "1.0.0" 839 | } 840 | }, 841 | "repeat-string": { 842 | "version": "1.6.1", 843 | "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", 844 | "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=" 845 | }, 846 | "resolve": { 847 | "version": "1.5.0", 848 | "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.5.0.tgz", 849 | "integrity": "sha512-hgoSGrc3pjzAPHNBg+KnFcK2HwlHTs/YrAGUr6qgTVUZmXv1UEXXl0bZNBKMA9fud6lRYFdPGz0xXxycPzmmiw==", 850 | "requires": { 851 | "path-parse": "1.0.5" 852 | } 853 | }, 854 | "reusify": { 855 | "version": "1.0.3", 856 | "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.3.tgz", 857 | "integrity": "sha512-t8ZQIaf4CHxy8mb4QddDuGOygGiSSiJHMZrtrC+4E7urVtqON4dHVwmV0gfiBOE1tt5p1puae6o8e0b3wkr1Ag==" 858 | }, 859 | "right-align": { 860 | "version": "0.1.3", 861 | "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", 862 | "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", 863 | "requires": { 864 | "align-text": "0.1.4" 865 | } 866 | }, 867 | "safe-buffer": { 868 | "version": "5.1.1", 869 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", 870 | "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==" 871 | }, 872 | "semver": { 873 | "version": "5.4.1", 874 | "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", 875 | "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==" 876 | }, 877 | "serve-favicon": { 878 | "version": "2.4.5", 879 | "resolved": "https://registry.npmjs.org/serve-favicon/-/serve-favicon-2.4.5.tgz", 880 | "integrity": "sha512-s7F8h2NrslMkG50KxvlGdj+ApSwaLex0vexuJ9iFf3GLTIp1ph/l1qZvRe9T9TJEYZgmq72ZwJ2VYiAEtChknw==", 881 | "requires": { 882 | "etag": "1.8.1", 883 | "fresh": "0.5.2", 884 | "ms": "2.0.0", 885 | "parseurl": "1.3.2", 886 | "safe-buffer": "5.1.1" 887 | } 888 | }, 889 | "source-map": { 890 | "version": "0.4.4", 891 | "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", 892 | "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", 893 | "requires": { 894 | "amdefine": "1.0.1" 895 | } 896 | }, 897 | "ssh2": { 898 | "version": "0.5.5", 899 | "resolved": "https://registry.npmjs.org/ssh2/-/ssh2-0.5.5.tgz", 900 | "integrity": "sha1-x3gezS7OcwSiU89iD6taXCK7IjU=", 901 | "requires": { 902 | "ssh2-streams": "0.1.20" 903 | } 904 | }, 905 | "ssh2-streams": { 906 | "version": "0.1.20", 907 | "resolved": "https://registry.npmjs.org/ssh2-streams/-/ssh2-streams-0.1.20.tgz", 908 | "integrity": "sha1-URGNFUVV31Rp7h9n4M8efoosDjo=", 909 | "requires": { 910 | "asn1": "0.2.3", 911 | "semver": "5.4.1", 912 | "streamsearch": "0.1.2" 913 | } 914 | }, 915 | "statuses": { 916 | "version": "1.3.1", 917 | "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.3.1.tgz", 918 | "integrity": "sha1-+vUbnrdKrvOzrPStX2Gr8ky3uT4=" 919 | }, 920 | "streamsearch": { 921 | "version": "0.1.2", 922 | "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-0.1.2.tgz", 923 | "integrity": "sha1-gIudDlb8Jz2Am6VzOOkpkZoanxo=" 924 | }, 925 | "token-stream": { 926 | "version": "0.0.1", 927 | "resolved": "https://registry.npmjs.org/token-stream/-/token-stream-0.0.1.tgz", 928 | "integrity": "sha1-zu78cXp2xDFvEm0LnbqlXX598Bo=" 929 | }, 930 | "type-is": { 931 | "version": "1.6.15", 932 | "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.15.tgz", 933 | "integrity": "sha1-yrEPtJCeRByChC6v4a1kbIGARBA=", 934 | "requires": { 935 | "media-typer": "0.3.0", 936 | "mime-types": "2.1.17" 937 | } 938 | }, 939 | "uglify-js": { 940 | "version": "2.8.29", 941 | "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", 942 | "integrity": "sha1-KcVzMUgFe7Th913zW3qcty5qWd0=", 943 | "requires": { 944 | "source-map": "0.5.7", 945 | "uglify-to-browserify": "1.0.2", 946 | "yargs": "3.10.0" 947 | }, 948 | "dependencies": { 949 | "source-map": { 950 | "version": "0.5.7", 951 | "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", 952 | "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" 953 | } 954 | } 955 | }, 956 | "uglify-to-browserify": { 957 | "version": "1.0.2", 958 | "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", 959 | "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", 960 | "optional": true 961 | }, 962 | "uid-safe": { 963 | "version": "2.1.5", 964 | "resolved": "https://registry.npmjs.org/uid-safe/-/uid-safe-2.1.5.tgz", 965 | "integrity": "sha512-KPHm4VL5dDXKz01UuEd88Df+KzynaohSL9fBh096KWAxSKZQDI2uBrVqtvRM4rwrIrRRKsdLNML/lnaaVSRioA==", 966 | "requires": { 967 | "random-bytes": "1.0.0" 968 | } 969 | }, 970 | "unpipe": { 971 | "version": "1.0.0", 972 | "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", 973 | "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" 974 | }, 975 | "utils-merge": { 976 | "version": "1.0.1", 977 | "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", 978 | "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" 979 | }, 980 | "vary": { 981 | "version": "1.1.2", 982 | "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", 983 | "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" 984 | }, 985 | "void-elements": { 986 | "version": "2.0.1", 987 | "resolved": "https://registry.npmjs.org/void-elements/-/void-elements-2.0.1.tgz", 988 | "integrity": "sha1-wGavtYK7HLQSjWDqkjkulNXp2+w=" 989 | }, 990 | "window-size": { 991 | "version": "0.1.0", 992 | "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", 993 | "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=" 994 | }, 995 | "with": { 996 | "version": "5.1.1", 997 | "resolved": "https://registry.npmjs.org/with/-/with-5.1.1.tgz", 998 | "integrity": "sha1-+k2qktrzLE6pTtRTyB8EaGtXXf4=", 999 | "requires": { 1000 | "acorn": "3.3.0", 1001 | "acorn-globals": "3.1.0" 1002 | } 1003 | }, 1004 | "wordwrap": { 1005 | "version": "0.0.2", 1006 | "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", 1007 | "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=" 1008 | }, 1009 | "yargs": { 1010 | "version": "3.10.0", 1011 | "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", 1012 | "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", 1013 | "requires": { 1014 | "camelcase": "1.2.1", 1015 | "cliui": "2.1.0", 1016 | "decamelize": "1.2.0", 1017 | "window-size": "0.1.0" 1018 | } 1019 | } 1020 | } 1021 | } 1022 | -------------------------------------------------------------------------------- /admin/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vertcoin-box-admin", 3 | "version": "0.0.0", 4 | "private": true, 5 | "scripts": { 6 | "start": "node ./bin/www" 7 | }, 8 | "dependencies": { 9 | "body-parser": "^1.18.2", 10 | "connect-ensure-login": "^0.1.1", 11 | "cookie-parser": "^1.4.3", 12 | "debug": "~2.6.9", 13 | "express": "~4.15.5", 14 | "express-session": "^1.15.6", 15 | "jade-bootstrap": "^1.0.14", 16 | "memory-stream": "0.0.3", 17 | "morgan": "^1.9.0", 18 | "passport": "^0.4.0", 19 | "passport-local": "^1.0.0", 20 | "pbkdf2-password": "^1.2.1", 21 | "pug": "2.0.0-beta11", 22 | "pug-bootstrap": "0.0.15", 23 | "qrcode": "^1.2.0", 24 | "serve-favicon": "~2.4.5", 25 | "ssh2": "^0.5.5", 26 | "uuid": "^3.2.1", 27 | "ws": "^4.0.0" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /admin/pairing.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var path = require('path'); 3 | var fs = require('fs'); 4 | var crypto = require('crypto'); 5 | var bodyParser = require('body-parser'); 6 | 7 | var tunnel = require('./tunnel'); 8 | const uuidv4 = require('uuid/v4'); 9 | 10 | var app = express(); 11 | 12 | app.use(bodyParser.json()); 13 | 14 | app.post('/pair', function(req, res, next) { 15 | const signature = req.headers["x-hmac-signature"]; 16 | const body = req.body; 17 | 18 | var testSignature = crypto.createHmac("sha256", "abc123").update(JSON.stringify(body)).digest("base64") 19 | 20 | console.log("Pairing request received. Signature: [", signature , "] [", testSignature ,"] \r\n\r\n Request: \r\n" , body); 21 | 22 | if(signature === testSignature) { 23 | var requestId = uuidv4(); 24 | 25 | fs.writeFileSync("/root/keys/" + requestId + ".crt", "-----BEGIN RSA PUBLIC KEY-----\n" + req.body.publicKey + "\n-----END RSA PUBLIC KEY-----"); 26 | tunnel.executeCommand('/root/generate_authorized_keys.sh', (err, success) => { 27 | if(err) { 28 | console.error(err); 29 | return res.sendStatus(500); 30 | } 31 | 32 | if(success) { 33 | res.sendStatus(201); 34 | } 35 | else 36 | { 37 | res.sendStatus(500); 38 | } 39 | }); 40 | } else { 41 | return res.sendStatus(500); 42 | } 43 | 44 | 45 | 46 | }); 47 | 48 | module.exports = app; 49 | -------------------------------------------------------------------------------- /admin/passport.config.js: -------------------------------------------------------------------------------- 1 | var passport = require('passport'); 2 | var Strategy = require('passport-local').Strategy; 3 | var hash = require('pbkdf2-password')() 4 | var fs = require('fs'); 5 | var path = require('path'); 6 | passport.use(new Strategy( 7 | function(username, password, cb) { 8 | fs.readFile(path.join(__dirname,"admin_password"), (err, data) => { 9 | if(err) return cb(err); 10 | var passwordData = data.toString().split('\t'); 11 | if(username !== passwordData[0]) return cb(null, false); 12 | 13 | hash({ password: password, salt: passwordData[1] }, function (err, pass, salt, hash) { 14 | if (err) return cb(err); 15 | if (hash == passwordData[2]) return cb(null, {username:'admin', id: 0}); 16 | else return cb(null, false); 17 | }); 18 | }); 19 | }) 20 | ); 21 | 22 | passport.serializeUser(function(user, cb) { 23 | cb(null, user.id); 24 | }); 25 | 26 | passport.deserializeUser(function(id, cb) { 27 | if(id == 0) { 28 | return cb(null, {id:0, username:'admin'}); 29 | } 30 | cb(new Error("User invalid"), null); 31 | }); 32 | 33 | module.exports = passport; 34 | -------------------------------------------------------------------------------- /admin/public/stylesheets/login.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 40px; 3 | padding-bottom: 40px; 4 | background-color: #eee; 5 | } 6 | 7 | .form-signin { 8 | max-width: 330px; 9 | padding: 15px; 10 | margin: 0 auto; 11 | } 12 | .form-signin .form-signin-heading, 13 | .form-signin .checkbox { 14 | margin-bottom: 10px; 15 | } 16 | .form-signin .checkbox { 17 | font-weight: normal; 18 | } 19 | .form-signin .form-control { 20 | position: relative; 21 | height: auto; 22 | -webkit-box-sizing: border-box; 23 | -moz-box-sizing: border-box; 24 | box-sizing: border-box; 25 | padding: 10px; 26 | font-size: 16px; 27 | } 28 | .form-signin .form-control:focus { 29 | z-index: 2; 30 | } 31 | .form-signin input[type="email"] { 32 | margin-bottom: -1px; 33 | border-bottom-right-radius: 0; 34 | border-bottom-left-radius: 0; 35 | } 36 | .form-signin input[type="password"] { 37 | margin-bottom: 10px; 38 | border-top-left-radius: 0; 39 | border-top-right-radius: 0; 40 | } 41 | -------------------------------------------------------------------------------- /admin/public/stylesheets/sticky-footer-navbar.css: -------------------------------------------------------------------------------- 1 | /* Sticky footer styles 2 | -------------------------------------------------- */ 3 | html { 4 | position: relative; 5 | min-height: 100%; 6 | } 7 | body { 8 | /* Margin bottom by footer height */ 9 | margin-bottom: 60px; 10 | } 11 | .footer { 12 | position: absolute; 13 | bottom: 0; 14 | width: 100%; 15 | /* Set the fixed height of the footer here */ 16 | height: 60px; 17 | background-color: #f5f5f5; 18 | } 19 | 20 | 21 | /* Custom page CSS 22 | -------------------------------------------------- */ 23 | /* Not required for template or sticky footer method. */ 24 | 25 | body > .container { 26 | padding: 60px 15px 0; 27 | } 28 | .container .text-muted { 29 | margin: 20px 0; 30 | } 31 | 32 | .footer > .container { 33 | padding-right: 15px; 34 | padding-left: 15px; 35 | } 36 | 37 | code { 38 | font-size: 80%; 39 | } 40 | -------------------------------------------------------------------------------- /admin/public/stylesheets/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding: 50px; 3 | font: 14px "Lucida Grande", Helvetica, Arial, sans-serif; 4 | } 5 | 6 | a { 7 | color: #00B7FF; 8 | } 9 | -------------------------------------------------------------------------------- /admin/routes/auth.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var router = express.Router(); 3 | var passport = require('passport'); 4 | 5 | router.get('/login', function(req,res,next) { 6 | res.render('login'); 7 | }); 8 | 9 | router.post('/login', 10 | passport.authenticate('local', { failureRedirect: '/auth/login?error=1' }), 11 | function(req, res) { 12 | res.redirect('/'); 13 | }); 14 | 15 | router.get('/logout', 16 | function(req, res){ 17 | req.logout(); 18 | res.redirect('/'); 19 | }); 20 | 21 | module.exports = router; 22 | -------------------------------------------------------------------------------- /admin/routes/index.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var router = express.Router(); 3 | var ensure = require('connect-ensure-login'); 4 | 5 | 6 | /* GET home page. */ 7 | router.get('/', ensure.ensureLoggedIn('/auth/login'), function(req, res, next) { 8 | res.render('index', { }); 9 | }); 10 | 11 | 12 | 13 | 14 | module.exports = router; 15 | -------------------------------------------------------------------------------- /admin/routes/pair.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const router = express.Router(); 3 | const ensure = require('connect-ensure-login'); 4 | const uuidv4 = require('uuid/v4'); 5 | const crypto = require('crypto'); 6 | const fs = require('fs'); 7 | const path = require('path'); 8 | const QRCode = require('qrcode'); 9 | const MemoryStream = require('memory-stream'); 10 | 11 | /* GET pairing page. */ 12 | router.get('/', ensure.ensureLoggedIn('/auth/login'), function(req, res, next) { 13 | // Read TOR Hostname 14 | var torHost = fs.readFileSync('/root/tor/hostname').toString().replace('\n',''); 15 | 16 | // Generate pairing request id 17 | var requestId = uuidv4(); 18 | 19 | // Generate HMAC key for one-time use 20 | crypto.randomBytes(256, (err, buf) => { 21 | if (err) 22 | { 23 | console.log(err); 24 | return res.sendStatus(500); 25 | } 26 | var hmacSecret = buf.toString('hex'); 27 | var pairObj = { 28 | id : requestId, 29 | torHost : torHost, 30 | hmacSecret : hmacSecret 31 | }; 32 | 33 | 34 | QRCode.toFile(path.join(__dirname,"/../pairingRequests/" + requestId + ".png"), JSON.stringify(pairObj), {}, function (err) { 35 | if (err) 36 | { 37 | console.log(err); 38 | return res.sendStatus(500); 39 | } 40 | fs.writeFile(path.join(__dirname,"/../pairingRequests/" + requestId + ".json"), pairObj, function(err) { 41 | if (err) 42 | { 43 | console.log(err); 44 | return res.sendStatus(500); 45 | } 46 | res.render('pair', { qrfile : "/pair/qr/" + requestId, pairfile : "/pair/pairFile/" + requestId }); 47 | }); 48 | }); 49 | }); 50 | }); 51 | 52 | router.get('/qr/:id', ensure.ensureLoggedIn('/auth/login'), function(req, res, next) { 53 | var requestId = req.params.id; 54 | fs.stat(path.join(__dirname,"/../pairingRequests/" + requestId + ".png"), function(err, stats) { 55 | if (err) return res.sendStatus(500); 56 | var createdAgo = (new Date().getTime() - new Date(stats.mtime).getTime()) / 1000; 57 | if(createdAgo >= 300) return res.sendStatus(500); // Longer than 5 minutes old 58 | res.header("Content-Type","image/png"); 59 | res.sendFile(path.join(__dirname,"/../pairingRequests/" + requestId + ".png")); 60 | }); 61 | }); 62 | 63 | router.get('/pairFile/:id', ensure.ensureLoggedIn('/auth/login'), function(req, res, next) { 64 | var requestId = req.params.id; 65 | fs.stat(path.join(__dirname,"/../pairingRequests/" + requestId + ".json"), function(err, stats) { 66 | if (err) return res.sendStatus(500); 67 | var createdAgo = (new Date().getTime() - new Date(stats.mtime).getTime()) / 1000; 68 | if(createdAgo >= 300) return res.sendStatus(500); // Longer than 5 minutes old 69 | res.header("Content-Type","application/json"); 70 | res.header("Content-Disposition","attach; filename=pair.json"); 71 | 72 | res.sendFile(path.join(__dirname,"/../pairingRequests/" + requestId + ".json")); 73 | }); 74 | }); 75 | 76 | 77 | module.exports = router; 78 | -------------------------------------------------------------------------------- /admin/routes/status.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var router = express.Router(); 3 | var ensure = require('connect-ensure-login'); 4 | var fs = require('fs'); 5 | var tunnel = require('../tunnel'); 6 | var lit = require('../lit'); 7 | 8 | router.get('/', ensure.ensureLoggedIn('/auth/login'), function(req, res, next) { 9 | var torHost = fs.readFileSync('/root/tor/hostname'); 10 | tunnel.checkTunnel((err, success) => { 11 | var ws = lit.connect(); 12 | ws.on('open', () => { 13 | lit.getBalance(ws, (litErr, data) => { 14 | if(data.result && data.error == null) { 15 | res.render('status', { torHost: torHost, litStatus: true, litError: null, tunnelStatus: success, tunnelError: err }); 16 | } else { 17 | res.render('status', { torHost: torHost, litStatus: false, litError: data.error, tunnelStatus: success, tunnelError: err }); 18 | } 19 | }); 20 | }); 21 | ws.on('error', (litErr) => { 22 | ws.close(); 23 | res.render('status', { torHost: torHost, litStatus: false, litError: JSON.stringify(litErr), tunnelStatus: success, tunnelError: err }); 24 | }); 25 | }); 26 | }); 27 | 28 | module.exports = router; -------------------------------------------------------------------------------- /admin/tunnel.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs') 2 | const path = require('path') 3 | const Client = require('ssh2').Client 4 | 5 | module.exports = {}; 6 | 7 | 8 | module.exports.checkTunnel = function(callback) { 9 | var conn = new Client(); 10 | conn.on('ready', function() { 11 | callback(null, true); 12 | conn.end(); 13 | }).on('error', function(err) { 14 | callback(err, false); 15 | }).connect({ 16 | host: 'litbox-tunnel', 17 | port: 22, 18 | username: 'root', 19 | privateKey: fs.readFileSync(path.join('/root/secrets/litbox-admin.key')) 20 | }); 21 | } 22 | 23 | module.exports.executeCommand = function(command, callback) { 24 | var conn = new Client(); 25 | conn.on('ready', function() { 26 | conn.exec(command, function(err, stream) { 27 | if (err) callback(err, false); 28 | var commandErr = null; 29 | stream.on('close', function(code, signal) { 30 | console.log('Stream :: close :: code: ' + code + ', signal: ' + signal); 31 | conn.end(); 32 | callback(commandErr, commandErr == null); 33 | }).on('data', function(data) { 34 | console.log('STDOUT: ' + data); 35 | }).stderr.on('data', function(data) { 36 | console.log('STDERR: ' + data); 37 | commandErr = data; 38 | }); 39 | }); 40 | }).on('error', function(err) { 41 | callback(err, false); 42 | }).connect({ 43 | host: 'litbox-tunnel', 44 | port: 22, 45 | username: 'root', 46 | privateKey: fs.readFileSync(path.join('/root/secrets/litbox-admin.key')) 47 | }); 48 | } -------------------------------------------------------------------------------- /admin/views/error.pug: -------------------------------------------------------------------------------- 1 | extends ../node_modules/pug-bootstrap/layouts/starter 2 | append styles 3 | link(href="/css/style.css", rel="stylesheet") 4 | block body 5 | h1= message 6 | h2= error.status 7 | pre #{error.stack} 8 | -------------------------------------------------------------------------------- /admin/views/index.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | append body 4 | .container 5 | h1= title 6 | p Welcome to Litbox -------------------------------------------------------------------------------- /admin/views/layout.pug: -------------------------------------------------------------------------------- 1 | extends ../node_modules/pug-bootstrap/_bootstrap 2 | append styles 3 | // Custom styles for this template 4 | link(href='/stylesheets/sticky-footer-navbar.css', rel='stylesheet') 5 | block body 6 | // Fixed navbar 7 | nav.navbar.navbar-default.navbar-fixed-top 8 | .container 9 | .navbar-header 10 | button.navbar-toggle.collapsed(type='button', data-toggle='collapse', data-target='#navbar', aria-expanded='false', aria-controls='navbar') 11 | span.sr-only Toggle navigation 12 | span.icon-bar 13 | span.icon-bar 14 | span.icon-bar 15 | a.navbar-brand(href='/') Litbox 16 | #navbar.collapse.navbar-collapse 17 | ul.nav.navbar-nav 18 | li.active 19 | a(href='/') Home 20 | li 21 | a(href='/status') Status 22 | li 23 | a(href='/settings') Settings 24 | li 25 | a(href='/pair') Pair Device 26 | li 27 | a(href='/auth/logout') Logout 28 | footer.footer 29 | .container 30 | p.text-muted © 2013-2018 Vertcoin 31 | -------------------------------------------------------------------------------- /admin/views/login.pug: -------------------------------------------------------------------------------- 1 | extends ../node_modules/pug-bootstrap/_bootstrap 2 | 3 | append styles 4 | // Custom styles for this template 5 | link(href='/stylesheets/login.css', rel='stylesheet') 6 | block body 7 | .container 8 | form.form-signin(action='/auth/login',method='post') 9 | h2.form-signin-heading Please sign in 10 | label.sr-only(for='inputEmail') User name 11 | input#inputEmail.form-control(type='text', name='username' placeholder='User name', required='', autofocus='') 12 | label.sr-only(for='inputPassword') Password 13 | input#inputPassword.form-control(type='password', name='password', placeholder='Password', required='') 14 | button.btn.btn-lg.btn-primary.btn-block(type='submit') Sign in 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /admin/views/pair.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | append body 4 | .container 5 | h1 Pair new device 6 | p Using the information on this page you can pair a new device with your Litbox. Make sure you complete the procedure within the next 5 minutes. If you fail to do so, you can refresh this page and start over. 7 | div.col-xs-12.col-md-6 8 | h2 Pairing mobile device 9 | p You can pair the litbox mobile client by scanning the QR Code below. 10 | img(src=qrfile) 11 | div.col-xs-12.col-md-6 12 | h2 Pairing desktop 13 | p You can pair a desktop client by downloading the file below and use it in the pairing procedure. 14 | a(href=pairfile target="_blank") Download Pair File -------------------------------------------------------------------------------- /admin/views/status.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | append body 4 | .container 5 | h1 Status 6 | p SSH Tunnel Operational: #{tunnelStatus} #{tunnelError} 7 | p LIT Operational: #{litStatus} #{litError} 8 | p TOR Hostname: #{torHost} -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | docker build admin/ -t litbox-admin 3 | docker build tunnel/ -t litbox-tunnel 4 | docker build tor/ -t litbox-tor 5 | docker build admin-go/ -t litbox-admin-go 6 | 7 | -------------------------------------------------------------------------------- /buildloop.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | while : 3 | do 4 | echo "Waiting for file changes..." 5 | inotifywait -e modify -r . 6 | 7 | docker build admin/ -t litbox-admin 8 | if [ $? != 0 ]; then continue; fi 9 | 10 | docker build tunnel/ -t litbox-tunnel 11 | if [ $? != 0 ]; then continue; fi 12 | 13 | docker build tor/ -t litbox-tor 14 | if [ $? != 0 ]; then continue; fi 15 | 16 | docker build admin-go/ -t litbox-admin-go 17 | if [ $? != 0 ]; then continue; fi 18 | 19 | docker-compose up -d 20 | done -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "2" 2 | services: 3 | 4 | litbox-lit: 5 | image: lit 6 | restart: always 7 | expose: 8 | - "8001" 9 | volumes: 10 | - ./data/lit:/root/.lit 11 | 12 | litbox-tunnel: 13 | image: litbox-tunnel 14 | restart: always 15 | expose: 16 | - "22" 17 | volumes: 18 | - ./data/keys:/root/keys 19 | 20 | litbox-admin: 21 | image: litbox-admin 22 | restart: always 23 | expose: 24 | - "3000" 25 | ports: 26 | - "80:3000" 27 | volumes: 28 | - ./data/secrets:/root/secrets 29 | - ./data/tor:/root/tor 30 | - ./data/keys:/root/keys 31 | 32 | litbox-admin-go: 33 | image: litbox-admin-go 34 | restart: always 35 | expose: 36 | - "3000" 37 | ports: 38 | - "81:3000" 39 | volumes: 40 | - ./data/secrets:/root/secrets 41 | - ./data/tor:/root/tor 42 | - ./data/keys:/root/keys 43 | 44 | litbox-tor: 45 | image: litbox-tor 46 | depends_on: 47 | - litbox-tunnel 48 | volumes: 49 | - ./data/tor/:/var/lib/tor/hidden_service/ 50 | 51 | 52 | networks: 53 | default: 54 | external: 55 | name: litbox-network 56 | -------------------------------------------------------------------------------- /init-dev.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # create data directory for lit 4 | mkdir -p data/lit 5 | 6 | # create directory containing private keys 7 | mkdir -p data/secrets 8 | 9 | # create directory containing public keys 10 | mkdir -p data/keys 11 | 12 | # create directory containing tor hostname and key 13 | mkdir -p data/tor 14 | 15 | # generate SSH private key for the Admin box to connect to the Tunnel box 16 | ssh-keygen -t rsa -N "" -f data/secrets/litbox-admin.key 17 | 18 | # include the public key for the admin box SSH key into the list of allowed SSH keys (this directory is merged into authorized_keys on startup of the tunnel box) 19 | mv data/secrets/litbox-admin.key.pub data/keys 20 | 21 | # generate a new private key for LIT 22 | hexdump -n 32 -e '8/4 "%08x"' /dev/random > data/lit/privkey.hex 23 | 24 | docker network create litbox-network 25 | 26 | -------------------------------------------------------------------------------- /init.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # create data directory for lit 4 | mkdir -p /usr/local/litbox/data/lit 5 | 6 | # create directory containing private keys 7 | mkdir -p /usr/local/litbox/data/secrets 8 | 9 | # create directory containing public keys 10 | mkdir -p /usr/local/litbox/data/keys 11 | 12 | # generate SSH private key for the Admin box to connect to the Tunnel box 13 | ssh-keygen -t rsa -N "" -f /usr/local/litbox/data/secrets/litbox-admin.key 14 | 15 | # include the public key for the admin box SSH key into the list of allowed SSH keys (this directory is merged into authorized_keys on startup of the tunnel box) 16 | mv /usr/local/litbox/data/secrets/litbox-admin.key.pub /usr/local/litbox/data/keys 17 | 18 | # generate a new private key for LIT 19 | hexdump -n 32 -e '8/4 "%08x"' /dev/random > /usr/local/litbox/data/lit/privkey.hex 20 | 21 | cd /usr/local/litbox 22 | curl -o docker-compose.yml https://raw.githubusercontent.com/gertjaap/litbox/master/docker-compose.yml 23 | 24 | docker network create litbox-network 25 | 26 | docker-compose up -d 27 | -------------------------------------------------------------------------------- /tor/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:jessie 2 | ENV DEBIAN_FRONTEND=noninteractive 3 | RUN apt-get update && apt-get install -y tor 4 | COPY ./docker-entrypoint.sh /docker-entrypoint.sh 5 | COPY ./torrc /etc/tor/torrc 6 | CMD ["/docker-entrypoint.sh","tor"] 7 | -------------------------------------------------------------------------------- /tor/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | if [ "${1:0:1}" == '-' ]; then 6 | set -- tor $@ 7 | fi 8 | 9 | if [ "$1" == "tor" ]; then 10 | # set rights on keys 11 | chown -R debian-tor:debian-tor /var/lib/tor/hidden_service/ 12 | chmod -R 700 /var/lib/tor/hidden_service/ 13 | 14 | # Switch user 15 | set -- su debian-tor -s /bin/sh -c "$@" 16 | fi 17 | 18 | exec "$@" -------------------------------------------------------------------------------- /tor/torrc: -------------------------------------------------------------------------------- 1 | HiddenServiceDir /var/lib/tor/hidden_service/ 2 | HiddenServicePort 49222 litbox-tunnel:22 3 | HiddenServicePort 49280 litbox-admin:3001 4 | -------------------------------------------------------------------------------- /tunnel/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine 2 | ENTRYPOINT ["/entrypoint.sh"] 3 | EXPOSE 22 4 | COPY entrypoint.sh /entrypoint.sh 5 | RUN apk add --no-cache openssh 6 | COPY generate_authorized_keys.sh /root 7 | COPY sshd_config /etc/ssh/sshd_config 8 | -------------------------------------------------------------------------------- /tunnel/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/ash 2 | 3 | # generate host keys if not present 4 | ssh-keygen -A 5 | 6 | /root/generate_authorized_keys.sh 7 | 8 | # do not detach (-D), log to stderr (-e), passthrough other arguments 9 | exec /usr/sbin/sshd -D -e "$@" -------------------------------------------------------------------------------- /tunnel/generate_authorized_keys.sh: -------------------------------------------------------------------------------- 1 | #!/bin/ash 2 | 3 | mkdir -p /root/.ssh 4 | 5 | # insert all ssh keys 6 | cat /root/keys/*.pub > /root/.ssh/authorized_keys 7 | 8 | for i in /root/keys/*.crt; do ssh-keygen -i -f $i >> /root/.ssh/authorized_keys; done -------------------------------------------------------------------------------- /tunnel/sshd_config: -------------------------------------------------------------------------------- 1 | # $OpenBSD: sshd_config,v 1.101 2017/03/14 07:19:07 djm Exp $ 2 | 3 | # This is the sshd server system-wide configuration file. See 4 | # sshd_config(5) for more information. 5 | 6 | # This sshd was compiled with PATH=/bin:/usr/bin:/sbin:/usr/sbin 7 | 8 | # The strategy used for options in the default sshd_config shipped with 9 | # OpenSSH is to specify options with their default value where 10 | # possible, but leave them commented. Uncommented options override the 11 | # default value. 12 | 13 | #Port 22 14 | #AddressFamily any 15 | #ListenAddress 0.0.0.0 16 | #ListenAddress :: 17 | 18 | #HostKey /etc/ssh/ssh_host_rsa_key 19 | #HostKey /etc/ssh/ssh_host_dsa_key 20 | #HostKey /etc/ssh/ssh_host_ecdsa_key 21 | #HostKey /etc/ssh/ssh_host_ed25519_key 22 | 23 | # Ciphers and keying 24 | #RekeyLimit default none 25 | 26 | # Logging 27 | #SyslogFacility AUTH 28 | #LogLevel INFO 29 | 30 | # Authentication: 31 | 32 | #LoginGraceTime 2m 33 | PermitRootLogin yes 34 | #StrictModes yes 35 | #MaxAuthTries 6 36 | #MaxSessions 10 37 | 38 | PubkeyAuthentication yes 39 | 40 | # The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2 41 | # but this is overridden so installations will only check .ssh/authorized_keys 42 | AuthorizedKeysFile .ssh/authorized_keys 43 | 44 | #AuthorizedPrincipalsFile none 45 | 46 | #AuthorizedKeysCommand none 47 | #AuthorizedKeysCommandUser nobody 48 | 49 | # For this to work you will also need host keys in /etc/ssh/ssh_known_hosts 50 | #HostbasedAuthentication no 51 | # Change to yes if you don't trust ~/.ssh/known_hosts for 52 | # HostbasedAuthentication 53 | #IgnoreUserKnownHosts no 54 | # Don't read the user's ~/.rhosts and ~/.shosts files 55 | #IgnoreRhosts yes 56 | 57 | # To disable tunneled clear text passwords, change to no here! 58 | PasswordAuthentication no 59 | #PermitEmptyPasswords no 60 | 61 | # Change to no to disable s/key passwords 62 | #ChallengeResponseAuthentication yes 63 | 64 | # Kerberos options 65 | #KerberosAuthentication no 66 | #KerberosOrLocalPasswd yes 67 | #KerberosTicketCleanup yes 68 | #KerberosGetAFSToken no 69 | 70 | # GSSAPI options 71 | #GSSAPIAuthentication no 72 | #GSSAPICleanupCredentials yes 73 | 74 | # Set this to 'yes' to enable PAM authentication, account processing, 75 | # and session processing. If this is enabled, PAM authentication will 76 | # be allowed through the ChallengeResponseAuthentication and 77 | # PasswordAuthentication. Depending on your PAM configuration, 78 | # PAM authentication via ChallengeResponseAuthentication may bypass 79 | # the setting of "PermitRootLogin without-password". 80 | # If you just want the PAM account and session checks to run without 81 | # PAM authentication, then enable this but set PasswordAuthentication 82 | # and ChallengeResponseAuthentication to 'no'. 83 | #UsePAM no 84 | 85 | #AllowAgentForwarding yes 86 | #AllowTcpForwarding yes 87 | #GatewayPorts no 88 | #X11Forwarding no 89 | #X11DisplayOffset 10 90 | #X11UseLocalhost yes 91 | #PermitTTY yes 92 | #PrintMotd yes 93 | #PrintLastLog yes 94 | #TCPKeepAlive yes 95 | #UseLogin no 96 | #PermitUserEnvironment no 97 | #Compression delayed 98 | #ClientAliveInterval 0 99 | #ClientAliveCountMax 3 100 | #UseDNS no 101 | #PidFile /run/sshd.pid 102 | #MaxStartups 10:30:100 103 | #PermitTunnel no 104 | #ChrootDirectory none 105 | #VersionAddendum none 106 | 107 | # no default banner path 108 | #Banner none 109 | 110 | # override default of no subsystems 111 | Subsystem sftp /usr/lib/ssh/sftp-server 112 | 113 | # the following are HPN related configuration options 114 | # tcp receive buffer polling. disable in non autotuning kernels 115 | #TcpRcvBufPoll yes 116 | 117 | # disable hpn performance boosts 118 | #HPNDisabled no 119 | 120 | # buffer size for hpn to non-hpn connections 121 | #HPNBufferSize 2048 122 | 123 | 124 | # Example of overriding settings on a per-user basis 125 | #Match User anoncvs 126 | # X11Forwarding no 127 | # AllowTcpForwarding no 128 | # PermitTTY no 129 | # ForceCommand cvs server 130 | --------------------------------------------------------------------------------