]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/BIP39.git/blob - bip39-standalone.html
Table uses monospace font.
[perso/Immae/Projets/Cryptomonnaies/BIP39.git] / bip39-standalone.html
1 <!DOCTYPE html>
2 <html>
3 <head lang="en">
4 <meta charset="utf-8" />
5 <title>BIP39 - Mnemonic Code</title>
6 <style>/*!
7 * Bootstrap v3.2.0 (http://getbootstrap.com)
8 * Copyright 2011-2014 Twitter, Inc.
9 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
10 *//*! normalize.css v3.0.1 | MIT License | git.io/normalize */html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background:0 0}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{margin:.67em 0;font-size:2em}mark{color:#000;background:#ff0}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{height:0;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{margin:0;font:inherit;color:inherit}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}input{line-height:normal}input[type=checkbox],input[type=radio]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{padding:.35em .625em .75em;margin:0 2px;border:1px solid silver}legend{padding:0;border:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-spacing:0;border-collapse:collapse}td,th{padding:0}@media print{*{color:#000!important;text-shadow:none!important;background:transparent!important;-webkit-box-shadow:none!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100%!important}p,h2,h3{orphans:3;widows:3}h2,h3{page-break-after:avoid}select{background:#fff!important}.navbar{display:none}.table td,.table th{background-color:#fff!important}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000!important}.label{border:1px solid #000}.table{border-collapse:collapse!important}.table-bordered th,.table-bordered td{border:1px solid #ddd!important}}@font-face{font-family:'Glyphicons Halflings';src:url(../fonts/glyphicons-halflings-regular.eot);src:url(../fonts/glyphicons-halflings-regular.eot?#iefix) format('embedded-opentype'),url(../fonts/glyphicons-halflings-regular.woff) format('woff'),url(../fonts/glyphicons-halflings-regular.ttf) format('truetype'),url(../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular) format('svg')}.glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.glyphicon-asterisk:before{content:"\2a"}.glyphicon-plus:before{content:"\2b"}.glyphicon-euro:before{content:"\20ac"}.glyphicon-minus:before{content:"\2212"}.glyphicon-cloud:before{content:"\2601"}.glyphicon-envelope:before{content:"\2709"}.glyphicon-pencil:before{content:"\270f"}.glyphicon-glass:before{content:"\e001"}.glyphicon-music:before{content:"\e002"}.glyphicon-search:before{content:"\e003"}.glyphicon-heart:before{content:"\e005"}.glyphicon-star:before{content:"\e006"}.glyphicon-star-empty:before{content:"\e007"}.glyphicon-user:before{content:"\e008"}.glyphicon-film:before{content:"\e009"}.glyphicon-th-large:before{content:"\e010"}.glyphicon-th:before{content:"\e011"}.glyphicon-th-list:before{content:"\e012"}.glyphicon-ok:before{content:"\e013"}.glyphicon-remove:before{content:"\e014"}.glyphicon-zoom-in:before{content:"\e015"}.glyphicon-zoom-out:before{content:"\e016"}.glyphicon-off:before{content:"\e017"}.glyphicon-signal:before{content:"\e018"}.glyphicon-cog:before{content:"\e019"}.glyphicon-trash:before{content:"\e020"}.glyphicon-home:before{content:"\e021"}.glyphicon-file:before{content:"\e022"}.glyphicon-time:before{content:"\e023"}.glyphicon-road:before{content:"\e024"}.glyphicon-download-alt:before{content:"\e025"}.glyphicon-download:before{content:"\e026"}.glyphicon-upload:before{content:"\e027"}.glyphicon-inbox:before{content:"\e028"}.glyphicon-play-circle:before{content:"\e029"}.glyphicon-repeat:before{content:"\e030"}.glyphicon-refresh:before{content:"\e031"}.glyphicon-list-alt:before{content:"\e032"}.glyphicon-lock:before{content:"\e033"}.glyphicon-flag:before{content:"\e034"}.glyphicon-headphones:before{content:"\e035"}.glyphicon-volume-off:before{content:"\e036"}.glyphicon-volume-down:before{content:"\e037"}.glyphicon-volume-up:before{content:"\e038"}.glyphicon-qrcode:before{content:"\e039"}.glyphicon-barcode:before{content:"\e040"}.glyphicon-tag:before{content:"\e041"}.glyphicon-tags:before{content:"\e042"}.glyphicon-book:before{content:"\e043"}.glyphicon-bookmark:before{content:"\e044"}.glyphicon-print:before{content:"\e045"}.glyphicon-camera:before{content:"\e046"}.glyphicon-font:before{content:"\e047"}.glyphicon-bold:before{content:"\e048"}.glyphicon-italic:before{content:"\e049"}.glyphicon-text-height:before{content:"\e050"}.glyphicon-text-width:before{content:"\e051"}.glyphicon-align-left:before{content:"\e052"}.glyphicon-align-center:before{content:"\e053"}.glyphicon-align-right:before{content:"\e054"}.glyphicon-align-justify:before{content:"\e055"}.glyphicon-list:before{content:"\e056"}.glyphicon-indent-left:before{content:"\e057"}.glyphicon-indent-right:before{content:"\e058"}.glyphicon-facetime-video:before{content:"\e059"}.glyphicon-picture:before{content:"\e060"}.glyphicon-map-marker:before{content:"\e062"}.glyphicon-adjust:before{content:"\e063"}.glyphicon-tint:before{content:"\e064"}.glyphicon-edit:before{content:"\e065"}.glyphicon-share:before{content:"\e066"}.glyphicon-check:before{content:"\e067"}.glyphicon-move:before{content:"\e068"}.glyphicon-step-backward:before{content:"\e069"}.glyphicon-fast-backward:before{content:"\e070"}.glyphicon-backward:before{content:"\e071"}.glyphicon-play:before{content:"\e072"}.glyphicon-pause:before{content:"\e073"}.glyphicon-stop:before{content:"\e074"}.glyphicon-forward:before{content:"\e075"}.glyphicon-fast-forward:before{content:"\e076"}.glyphicon-step-forward:before{content:"\e077"}.glyphicon-eject:before{content:"\e078"}.glyphicon-chevron-left:before{content:"\e079"}.glyphicon-chevron-right:before{content:"\e080"}.glyphicon-plus-sign:before{content:"\e081"}.glyphicon-minus-sign:before{content:"\e082"}.glyphicon-remove-sign:before{content:"\e083"}.glyphicon-ok-sign:before{content:"\e084"}.glyphicon-question-sign:before{content:"\e085"}.glyphicon-info-sign:before{content:"\e086"}.glyphicon-screenshot:before{content:"\e087"}.glyphicon-remove-circle:before{content:"\e088"}.glyphicon-ok-circle:before{content:"\e089"}.glyphicon-ban-circle:before{content:"\e090"}.glyphicon-arrow-left:before{content:"\e091"}.glyphicon-arrow-right:before{content:"\e092"}.glyphicon-arrow-up:before{content:"\e093"}.glyphicon-arrow-down:before{content:"\e094"}.glyphicon-share-alt:before{content:"\e095"}.glyphicon-resize-full:before{content:"\e096"}.glyphicon-resize-small:before{content:"\e097"}.glyphicon-exclamation-sign:before{content:"\e101"}.glyphicon-gift:before{content:"\e102"}.glyphicon-leaf:before{content:"\e103"}.glyphicon-fire:before{content:"\e104"}.glyphicon-eye-open:before{content:"\e105"}.glyphicon-eye-close:before{content:"\e106"}.glyphicon-warning-sign:before{content:"\e107"}.glyphicon-plane:before{content:"\e108"}.glyphicon-calendar:before{content:"\e109"}.glyphicon-random:before{content:"\e110"}.glyphicon-comment:before{content:"\e111"}.glyphicon-magnet:before{content:"\e112"}.glyphicon-chevron-up:before{content:"\e113"}.glyphicon-chevron-down:before{content:"\e114"}.glyphicon-retweet:before{content:"\e115"}.glyphicon-shopping-cart:before{content:"\e116"}.glyphicon-folder-close:before{content:"\e117"}.glyphicon-folder-open:before{content:"\e118"}.glyphicon-resize-vertical:before{content:"\e119"}.glyphicon-resize-horizontal:before{content:"\e120"}.glyphicon-hdd:before{content:"\e121"}.glyphicon-bullhorn:before{content:"\e122"}.glyphicon-bell:before{content:"\e123"}.glyphicon-certificate:before{content:"\e124"}.glyphicon-thumbs-up:before{content:"\e125"}.glyphicon-thumbs-down:before{content:"\e126"}.glyphicon-hand-right:before{content:"\e127"}.glyphicon-hand-left:before{content:"\e128"}.glyphicon-hand-up:before{content:"\e129"}.glyphicon-hand-down:before{content:"\e130"}.glyphicon-circle-arrow-right:before{content:"\e131"}.glyphicon-circle-arrow-left:before{content:"\e132"}.glyphicon-circle-arrow-up:before{content:"\e133"}.glyphicon-circle-arrow-down:before{content:"\e134"}.glyphicon-globe:before{content:"\e135"}.glyphicon-wrench:before{content:"\e136"}.glyphicon-tasks:before{content:"\e137"}.glyphicon-filter:before{content:"\e138"}.glyphicon-briefcase:before{content:"\e139"}.glyphicon-fullscreen:before{content:"\e140"}.glyphicon-dashboard:before{content:"\e141"}.glyphicon-paperclip:before{content:"\e142"}.glyphicon-heart-empty:before{content:"\e143"}.glyphicon-link:before{content:"\e144"}.glyphicon-phone:before{content:"\e145"}.glyphicon-pushpin:before{content:"\e146"}.glyphicon-usd:before{content:"\e148"}.glyphicon-gbp:before{content:"\e149"}.glyphicon-sort:before{content:"\e150"}.glyphicon-sort-by-alphabet:before{content:"\e151"}.glyphicon-sort-by-alphabet-alt:before{content:"\e152"}.glyphicon-sort-by-order:before{content:"\e153"}.glyphicon-sort-by-order-alt:before{content:"\e154"}.glyphicon-sort-by-attributes:before{content:"\e155"}.glyphicon-sort-by-attributes-alt:before{content:"\e156"}.glyphicon-unchecked:before{content:"\e157"}.glyphicon-expand:before{content:"\e158"}.glyphicon-collapse-down:before{content:"\e159"}.glyphicon-collapse-up:before{content:"\e160"}.glyphicon-log-in:before{content:"\e161"}.glyphicon-flash:before{content:"\e162"}.glyphicon-log-out:before{content:"\e163"}.glyphicon-new-window:before{content:"\e164"}.glyphicon-record:before{content:"\e165"}.glyphicon-save:before{content:"\e166"}.glyphicon-open:before{content:"\e167"}.glyphicon-saved:before{content:"\e168"}.glyphicon-import:before{content:"\e169"}.glyphicon-export:before{content:"\e170"}.glyphicon-send:before{content:"\e171"}.glyphicon-floppy-disk:before{content:"\e172"}.glyphicon-floppy-saved:before{content:"\e173"}.glyphicon-floppy-remove:before{content:"\e174"}.glyphicon-floppy-save:before{content:"\e175"}.glyphicon-floppy-open:before{content:"\e176"}.glyphicon-credit-card:before{content:"\e177"}.glyphicon-transfer:before{content:"\e178"}.glyphicon-cutlery:before{content:"\e179"}.glyphicon-header:before{content:"\e180"}.glyphicon-compressed:before{content:"\e181"}.glyphicon-earphone:before{content:"\e182"}.glyphicon-phone-alt:before{content:"\e183"}.glyphicon-tower:before{content:"\e184"}.glyphicon-stats:before{content:"\e185"}.glyphicon-sd-video:before{content:"\e186"}.glyphicon-hd-video:before{content:"\e187"}.glyphicon-subtitles:before{content:"\e188"}.glyphicon-sound-stereo:before{content:"\e189"}.glyphicon-sound-dolby:before{content:"\e190"}.glyphicon-sound-5-1:before{content:"\e191"}.glyphicon-sound-6-1:before{content:"\e192"}.glyphicon-sound-7-1:before{content:"\e193"}.glyphicon-copyright-mark:before{content:"\e194"}.glyphicon-registration-mark:before{content:"\e195"}.glyphicon-cloud-download:before{content:"\e197"}.glyphicon-cloud-upload:before{content:"\e198"}.glyphicon-tree-conifer:before{content:"\e199"}.glyphicon-tree-deciduous:before{content:"\e200"}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}:before,:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:10px;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.42857143;color:#333;background-color:#fff}input,button,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#428bca;text-decoration:none}a:hover,a:focus{color:#2a6496;text-decoration:underline}a:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}figure{margin:0}img{vertical-align:middle}.img-responsive,.thumbnail>img,.thumbnail a>img,.carousel-inner>.item>img,.carousel-inner>.item>a>img{display:block;width:100% \9;max-width:100%;height:auto}.img-rounded{border-radius:6px}.img-thumbnail{display:inline-block;width:100% \9;max-width:100%;height:auto;padding:4px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.img-circle{border-radius:50%}hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}h1,h2,h3,h4,h5,h6,.h1,.h2,.h3,.h4,.h5,.h6{font-family:inherit;font-weight:500;line-height:1.1;color:inherit}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small,.h1 small,.h2 small,.h3 small,.h4 small,.h5 small,.h6 small,h1 .small,h2 .small,h3 .small,h4 .small,h5 .small,h6 .small,.h1 .small,.h2 .small,.h3 .small,.h4 .small,.h5 .small,.h6 .small{font-weight:400;line-height:1;color:#777}h1,.h1,h2,.h2,h3,.h3{margin-top:20px;margin-bottom:10px}h1 small,.h1 small,h2 small,.h2 small,h3 small,.h3 small,h1 .small,.h1 .small,h2 .small,.h2 .small,h3 .small,.h3 .small{font-size:65%}h4,.h4,h5,.h5,h6,.h6{margin-top:10px;margin-bottom:10px}h4 small,.h4 small,h5 small,.h5 small,h6 small,.h6 small,h4 .small,.h4 .small,h5 .small,.h5 .small,h6 .small,.h6 .small{font-size:75%}h1,.h1{font-size:36px}h2,.h2{font-size:30px}h3,.h3{font-size:24px}h4,.h4{font-size:18px}h5,.h5{font-size:14px}h6,.h6{font-size:12px}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:16px;font-weight:300;line-height:1.4}@media (min-width:768px){.lead{font-size:21px}}small,.small{font-size:85%}cite{font-style:normal}mark,.mark{padding:.2em;background-color:#fcf8e3}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.text-justify{text-align:justify}.text-nowrap{white-space:nowrap}.text-lowercase{text-transform:lowercase}.text-uppercase{text-transform:uppercase}.text-capitalize{text-transform:capitalize}.text-muted{color:#777}.text-primary{color:#428bca}a.text-primary:hover{color:#3071a9}.text-success{color:#3c763d}a.text-success:hover{color:#2b542c}.text-info{color:#31708f}a.text-info:hover{color:#245269}.text-warning{color:#8a6d3b}a.text-warning:hover{color:#66512c}.text-danger{color:#a94442}a.text-danger:hover{color:#843534}.bg-primary{color:#fff;background-color:#428bca}a.bg-primary:hover{background-color:#3071a9}.bg-success{background-color:#dff0d8}a.bg-success:hover{background-color:#c1e2b3}.bg-info{background-color:#d9edf7}a.bg-info:hover{background-color:#afd9ee}.bg-warning{background-color:#fcf8e3}a.bg-warning:hover{background-color:#f7ecb5}.bg-danger{background-color:#f2dede}a.bg-danger:hover{background-color:#e4b9b9}.page-header{padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eee}ul,ol{margin-top:0;margin-bottom:10px}ul ul,ol ul,ul ol,ol ol{margin-bottom:0}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;margin-left:-5px;list-style:none}.list-inline>li{display:inline-block;padding-right:5px;padding-left:5px}dl{margin-top:0;margin-bottom:20px}dt,dd{line-height:1.42857143}dt{font-weight:700}dd{margin-left:0}@media (min-width:768px){.dl-horizontal dt{float:left;width:160px;overflow:hidden;clear:left;text-align:right;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}}abbr[title],abbr[data-original-title]{cursor:help;border-bottom:1px dotted #777}.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:10px 20px;margin:0 0 20px;font-size:17.5px;border-left:5px solid #eee}blockquote p:last-child,blockquote ul:last-child,blockquote ol:last-child{margin-bottom:0}blockquote footer,blockquote small,blockquote .small{display:block;font-size:80%;line-height:1.42857143;color:#777}blockquote footer:before,blockquote small:before,blockquote .small:before{content:'\2014 \00A0'}.blockquote-reverse,blockquote.pull-right{padding-right:15px;padding-left:0;text-align:right;border-right:5px solid #eee;border-left:0}.blockquote-reverse footer:before,blockquote.pull-right footer:before,.blockquote-reverse small:before,blockquote.pull-right small:before,.blockquote-reverse .small:before,blockquote.pull-right .small:before{content:''}.blockquote-reverse footer:after,blockquote.pull-right footer:after,.blockquote-reverse small:after,blockquote.pull-right small:after,.blockquote-reverse .small:after,blockquote.pull-right .small:after{content:'\00A0 \2014'}blockquote:before,blockquote:after{content:""}address{margin-bottom:20px;font-style:normal;line-height:1.42857143}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace}code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;border-radius:4px}kbd{padding:2px 4px;font-size:90%;color:#fff;background-color:#333;border-radius:3px;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.25);box-shadow:inset 0 -1px 0 rgba(0,0,0,.25)}kbd kbd{padding:0;font-size:100%;-webkit-box-shadow:none;box-shadow:none}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:1.42857143;color:#333;word-break:break-all;word-wrap:break-word;background-color:#f5f5f5;border:1px solid #ccc;border-radius:4px}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width:768px){.container{width:750px}}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.container-fluid{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}.row{margin-right:-15px;margin-left:-15px}.col-xs-1,.col-sm-1,.col-md-1,.col-lg-1,.col-xs-2,.col-sm-2,.col-md-2,.col-lg-2,.col-xs-3,.col-sm-3,.col-md-3,.col-lg-3,.col-xs-4,.col-sm-4,.col-md-4,.col-lg-4,.col-xs-5,.col-sm-5,.col-md-5,.col-lg-5,.col-xs-6,.col-sm-6,.col-md-6,.col-lg-6,.col-xs-7,.col-sm-7,.col-md-7,.col-lg-7,.col-xs-8,.col-sm-8,.col-md-8,.col-lg-8,.col-xs-9,.col-sm-9,.col-md-9,.col-lg-9,.col-xs-10,.col-sm-10,.col-md-10,.col-lg-10,.col-xs-11,.col-sm-11,.col-md-11,.col-lg-11,.col-xs-12,.col-sm-12,.col-md-12,.col-lg-12{position:relative;min-height:1px;padding-right:15px;padding-left:15px}.col-xs-1,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-10,.col-xs-11,.col-xs-12{float:left}.col-xs-12{width:100%}.col-xs-11{width:91.66666667%}.col-xs-10{width:83.33333333%}.col-xs-9{width:75%}.col-xs-8{width:66.66666667%}.col-xs-7{width:58.33333333%}.col-xs-6{width:50%}.col-xs-5{width:41.66666667%}.col-xs-4{width:33.33333333%}.col-xs-3{width:25%}.col-xs-2{width:16.66666667%}.col-xs-1{width:8.33333333%}.col-xs-pull-12{right:100%}.col-xs-pull-11{right:91.66666667%}.col-xs-pull-10{right:83.33333333%}.col-xs-pull-9{right:75%}.col-xs-pull-8{right:66.66666667%}.col-xs-pull-7{right:58.33333333%}.col-xs-pull-6{right:50%}.col-xs-pull-5{right:41.66666667%}.col-xs-pull-4{right:33.33333333%}.col-xs-pull-3{right:25%}.col-xs-pull-2{right:16.66666667%}.col-xs-pull-1{right:8.33333333%}.col-xs-pull-0{right:auto}.col-xs-push-12{left:100%}.col-xs-push-11{left:91.66666667%}.col-xs-push-10{left:83.33333333%}.col-xs-push-9{left:75%}.col-xs-push-8{left:66.66666667%}.col-xs-push-7{left:58.33333333%}.col-xs-push-6{left:50%}.col-xs-push-5{left:41.66666667%}.col-xs-push-4{left:33.33333333%}.col-xs-push-3{left:25%}.col-xs-push-2{left:16.66666667%}.col-xs-push-1{left:8.33333333%}.col-xs-push-0{left:auto}.col-xs-offset-12{margin-left:100%}.col-xs-offset-11{margin-left:91.66666667%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-0{margin-left:0}@media (min-width:768px){.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-10,.col-sm-11,.col-sm-12{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666667%}.col-sm-10{width:83.33333333%}.col-sm-9{width:75%}.col-sm-8{width:66.66666667%}.col-sm-7{width:58.33333333%}.col-sm-6{width:50%}.col-sm-5{width:41.66666667%}.col-sm-4{width:33.33333333%}.col-sm-3{width:25%}.col-sm-2{width:16.66666667%}.col-sm-1{width:8.33333333%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666667%}.col-sm-pull-10{right:83.33333333%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666667%}.col-sm-pull-7{right:58.33333333%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666667%}.col-sm-pull-4{right:33.33333333%}.col-sm-pull-3{right:25%}.col-sm-pull-2{right:16.66666667%}.col-sm-pull-1{right:8.33333333%}.col-sm-pull-0{right:auto}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666667%}.col-sm-push-10{left:83.33333333%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666667%}.col-sm-push-7{left:58.33333333%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666667%}.col-sm-push-4{left:33.33333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.66666667%}.col-sm-push-1{left:8.33333333%}.col-sm-push-0{left:auto}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666667%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-0{margin-left:0}}@media (min-width:992px){.col-md-1,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-10,.col-md-11,.col-md-12{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666667%}.col-md-10{width:83.33333333%}.col-md-9{width:75%}.col-md-8{width:66.66666667%}.col-md-7{width:58.33333333%}.col-md-6{width:50%}.col-md-5{width:41.66666667%}.col-md-4{width:33.33333333%}.col-md-3{width:25%}.col-md-2{width:16.66666667%}.col-md-1{width:8.33333333%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666667%}.col-md-pull-10{right:83.33333333%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666667%}.col-md-pull-7{right:58.33333333%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666667%}.col-md-pull-4{right:33.33333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.66666667%}.col-md-pull-1{right:8.33333333%}.col-md-pull-0{right:auto}.col-md-push-12{left:100%}.col-md-push-11{left:91.66666667%}.col-md-push-10{left:83.33333333%}.col-md-push-9{left:75%}.col-md-push-8{left:66.66666667%}.col-md-push-7{left:58.33333333%}.col-md-push-6{left:50%}.col-md-push-5{left:41.66666667%}.col-md-push-4{left:33.33333333%}.col-md-push-3{left:25%}.col-md-push-2{left:16.66666667%}.col-md-push-1{left:8.33333333%}.col-md-push-0{left:auto}.col-md-offset-12{margin-left:100%}.col-md-offset-11{margin-left:91.66666667%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-9{margin-left:75%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-6{margin-left:50%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-3{margin-left:25%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-0{margin-left:0}}@media (min-width:1200px){.col-lg-1,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-10,.col-lg-11,.col-lg-12{float:left}.col-lg-12{width:100%}.col-lg-11{width:91.66666667%}.col-lg-10{width:83.33333333%}.col-lg-9{width:75%}.col-lg-8{width:66.66666667%}.col-lg-7{width:58.33333333%}.col-lg-6{width:50%}.col-lg-5{width:41.66666667%}.col-lg-4{width:33.33333333%}.col-lg-3{width:25%}.col-lg-2{width:16.66666667%}.col-lg-1{width:8.33333333%}.col-lg-pull-12{right:100%}.col-lg-pull-11{right:91.66666667%}.col-lg-pull-10{right:83.33333333%}.col-lg-pull-9{right:75%}.col-lg-pull-8{right:66.66666667%}.col-lg-pull-7{right:58.33333333%}.col-lg-pull-6{right:50%}.col-lg-pull-5{right:41.66666667%}.col-lg-pull-4{right:33.33333333%}.col-lg-pull-3{right:25%}.col-lg-pull-2{right:16.66666667%}.col-lg-pull-1{right:8.33333333%}.col-lg-pull-0{right:auto}.col-lg-push-12{left:100%}.col-lg-push-11{left:91.66666667%}.col-lg-push-10{left:83.33333333%}.col-lg-push-9{left:75%}.col-lg-push-8{left:66.66666667%}.col-lg-push-7{left:58.33333333%}.col-lg-push-6{left:50%}.col-lg-push-5{left:41.66666667%}.col-lg-push-4{left:33.33333333%}.col-lg-push-3{left:25%}.col-lg-push-2{left:16.66666667%}.col-lg-push-1{left:8.33333333%}.col-lg-push-0{left:auto}.col-lg-offset-12{margin-left:100%}.col-lg-offset-11{margin-left:91.66666667%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-0{margin-left:0}}table{background-color:transparent}th{text-align:left}.table{width:100%;max-width:100%;margin-bottom:20px}.table>thead>tr>th,.table>tbody>tr>th,.table>tfoot>tr>th,.table>thead>tr>td,.table>tbody>tr>td,.table>tfoot>tr>td{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #ddd}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ddd}.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>th,.table>caption+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>td,.table>thead:first-child>tr:first-child>td{border-top:0}.table>tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed>thead>tr>th,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>tbody>tr>td,.table-condensed>tfoot>tr>td{padding:5px}.table-bordered{border:1px solid #ddd}.table-bordered>thead>tr>th,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>tbody>tr>td,.table-bordered>tfoot>tr>td{border:1px solid #ddd}.table-bordered>thead>tr>th,.table-bordered>thead>tr>td{border-bottom-width:2px}.table-striped>tbody>tr:nth-child(odd)>td,.table-striped>tbody>tr:nth-child(odd)>th{background-color:#f9f9f9}.table-hover>tbody>tr:hover>td,.table-hover>tbody>tr:hover>th{background-color:#f5f5f5}table col[class*=col-]{position:static;display:table-column;float:none}table td[class*=col-],table th[class*=col-]{position:static;display:table-cell;float:none}.table>thead>tr>td.active,.table>tbody>tr>td.active,.table>tfoot>tr>td.active,.table>thead>tr>th.active,.table>tbody>tr>th.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>tbody>tr.active>td,.table>tfoot>tr.active>td,.table>thead>tr.active>th,.table>tbody>tr.active>th,.table>tfoot>tr.active>th{background-color:#f5f5f5}.table-hover>tbody>tr>td.active:hover,.table-hover>tbody>tr>th.active:hover,.table-hover>tbody>tr.active:hover>td,.table-hover>tbody>tr:hover>.active,.table-hover>tbody>tr.active:hover>th{background-color:#e8e8e8}.table>thead>tr>td.success,.table>tbody>tr>td.success,.table>tfoot>tr>td.success,.table>thead>tr>th.success,.table>tbody>tr>th.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>tbody>tr.success>td,.table>tfoot>tr.success>td,.table>thead>tr.success>th,.table>tbody>tr.success>th,.table>tfoot>tr.success>th{background-color:#dff0d8}.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover,.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr:hover>.success,.table-hover>tbody>tr.success:hover>th{background-color:#d0e9c6}.table>thead>tr>td.info,.table>tbody>tr>td.info,.table>tfoot>tr>td.info,.table>thead>tr>th.info,.table>tbody>tr>th.info,.table>tfoot>tr>th.info,.table>thead>tr.info>td,.table>tbody>tr.info>td,.table>tfoot>tr.info>td,.table>thead>tr.info>th,.table>tbody>tr.info>th,.table>tfoot>tr.info>th{background-color:#d9edf7}.table-hover>tbody>tr>td.info:hover,.table-hover>tbody>tr>th.info:hover,.table-hover>tbody>tr.info:hover>td,.table-hover>tbody>tr:hover>.info,.table-hover>tbody>tr.info:hover>th{background-color:#c4e3f3}.table>thead>tr>td.warning,.table>tbody>tr>td.warning,.table>tfoot>tr>td.warning,.table>thead>tr>th.warning,.table>tbody>tr>th.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>tbody>tr.warning>td,.table>tfoot>tr.warning>td,.table>thead>tr.warning>th,.table>tbody>tr.warning>th,.table>tfoot>tr.warning>th{background-color:#fcf8e3}.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover,.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr:hover>.warning,.table-hover>tbody>tr.warning:hover>th{background-color:#faf2cc}.table>thead>tr>td.danger,.table>tbody>tr>td.danger,.table>tfoot>tr>td.danger,.table>thead>tr>th.danger,.table>tbody>tr>th.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>tbody>tr.danger>td,.table>tfoot>tr.danger>td,.table>thead>tr.danger>th,.table>tbody>tr.danger>th,.table>tfoot>tr.danger>th{background-color:#f2dede}.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover,.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr:hover>.danger,.table-hover>tbody>tr.danger:hover>th{background-color:#ebcccc}@media screen and (max-width:767px){.table-responsive{width:100%;margin-bottom:15px;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar;border:1px solid #ddd}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>thead>tr>th,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tfoot>tr>td{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>thead>tr>th:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0}.table-responsive>.table-bordered>thead>tr>th:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>th,.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>td{border-bottom:0}}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:inherit;color:#333;border:0;border-bottom:1px solid #e5e5e5}label{display:inline-block;max-width:100%;margin-bottom:5px;font-weight:700}input[type=search]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type=radio],input[type=checkbox]{margin:4px 0 0;margin-top:1px \9;line-height:normal}input[type=file]{display:block}input[type=range]{display:block;width:100%}select[multiple],select[size]{height:auto}input[type=file]:focus,input[type=radio]:focus,input[type=checkbox]:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}output{display:block;padding-top:7px;font-size:14px;line-height:1.42857143;color:#555}.form-control{display:block;width:100%;height:34px;padding:6px 12px;font-size:14px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-transition:border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}.form-control::-moz-placeholder{color:#777;opacity:1}.form-control:-ms-input-placeholder{color:#777}.form-control::-webkit-input-placeholder{color:#777}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{cursor:not-allowed;background-color:#eee;opacity:1}textarea.form-control{height:auto}input[type=search]{-webkit-appearance:none}input[type=date],input[type=time],input[type=datetime-local],input[type=month]{line-height:34px;line-height:1.42857143 \0}input[type=date].input-sm,input[type=time].input-sm,input[type=datetime-local].input-sm,input[type=month].input-sm{line-height:30px}input[type=date].input-lg,input[type=time].input-lg,input[type=datetime-local].input-lg,input[type=month].input-lg{line-height:46px}.form-group{margin-bottom:15px}.radio,.checkbox{position:relative;display:block;min-height:20px;margin-top:10px;margin-bottom:10px}.radio label,.checkbox label{padding-left:20px;margin-bottom:0;font-weight:400;cursor:pointer}.radio input[type=radio],.radio-inline input[type=radio],.checkbox input[type=checkbox],.checkbox-inline input[type=checkbox]{position:absolute;margin-top:4px \9;margin-left:-20px}.radio+.radio,.checkbox+.checkbox{margin-top:-5px}.radio-inline,.checkbox-inline{display:inline-block;padding-left:20px;margin-bottom:0;font-weight:400;vertical-align:middle;cursor:pointer}.radio-inline+.radio-inline,.checkbox-inline+.checkbox-inline{margin-top:0;margin-left:10px}input[type=radio][disabled],input[type=checkbox][disabled],input[type=radio].disabled,input[type=checkbox].disabled,fieldset[disabled] input[type=radio],fieldset[disabled] input[type=checkbox]{cursor:not-allowed}.radio-inline.disabled,.checkbox-inline.disabled,fieldset[disabled] .radio-inline,fieldset[disabled] .checkbox-inline{cursor:not-allowed}.radio.disabled label,.checkbox.disabled label,fieldset[disabled] .radio label,fieldset[disabled] .checkbox label{cursor:not-allowed}.form-control-static{padding-top:7px;padding-bottom:7px;margin-bottom:0}.form-control-static.input-lg,.form-control-static.input-sm{padding-right:0;padding-left:0}.input-sm,.form-horizontal .form-group-sm .form-control{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-sm{height:30px;line-height:30px}textarea.input-sm,select[multiple].input-sm{height:auto}.input-lg,.form-horizontal .form-group-lg .form-control{height:46px;padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}select.input-lg{height:46px;line-height:46px}textarea.input-lg,select[multiple].input-lg{height:auto}.has-feedback{position:relative}.has-feedback .form-control{padding-right:42.5px}.form-control-feedback{position:absolute;top:25px;right:0;z-index:2;display:block;width:34px;height:34px;line-height:34px;text-align:center}.input-lg+.form-control-feedback{width:46px;height:46px;line-height:46px}.input-sm+.form-control-feedback{width:30px;height:30px;line-height:30px}.has-success .help-block,.has-success .control-label,.has-success .radio,.has-success .checkbox,.has-success .radio-inline,.has-success .checkbox-inline{color:#3c763d}.has-success .form-control{border-color:#3c763d;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-success .form-control:focus{border-color:#2b542c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168}.has-success .input-group-addon{color:#3c763d;background-color:#dff0d8;border-color:#3c763d}.has-success .form-control-feedback{color:#3c763d}.has-warning .help-block,.has-warning .control-label,.has-warning .radio,.has-warning .checkbox,.has-warning .radio-inline,.has-warning .checkbox-inline{color:#8a6d3b}.has-warning .form-control{border-color:#8a6d3b;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-warning .form-control:focus{border-color:#66512c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b}.has-warning .input-group-addon{color:#8a6d3b;background-color:#fcf8e3;border-color:#8a6d3b}.has-warning .form-control-feedback{color:#8a6d3b}.has-error .help-block,.has-error .control-label,.has-error .radio,.has-error .checkbox,.has-error .radio-inline,.has-error .checkbox-inline{color:#a94442}.has-error .form-control{border-color:#a94442;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-error .form-control:focus{border-color:#843534;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483}.has-error .input-group-addon{color:#a94442;background-color:#f2dede;border-color:#a94442}.has-error .form-control-feedback{color:#a94442}.has-feedback label.sr-only~.form-control-feedback{top:0}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#737373}@media (min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .input-group{display:inline-table;vertical-align:middle}.form-inline .input-group .input-group-addon,.form-inline .input-group .input-group-btn,.form-inline .input-group .form-control{width:auto}.form-inline .input-group>.form-control{width:100%}.form-inline .control-label{margin-bottom:0;vertical-align:middle}.form-inline .radio,.form-inline .checkbox{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.form-inline .radio label,.form-inline .checkbox label{padding-left:0}.form-inline .radio input[type=radio],.form-inline .checkbox input[type=checkbox]{position:relative;margin-left:0}.form-inline .has-feedback .form-control-feedback{top:0}}.form-horizontal .radio,.form-horizontal .checkbox,.form-horizontal .radio-inline,.form-horizontal .checkbox-inline{padding-top:7px;margin-top:0;margin-bottom:0}.form-horizontal .radio,.form-horizontal .checkbox{min-height:27px}.form-horizontal .form-group{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.form-horizontal .control-label{padding-top:7px;margin-bottom:0;text-align:right}}.form-horizontal .has-feedback .form-control-feedback{top:0;right:15px}@media (min-width:768px){.form-horizontal .form-group-lg .control-label{padding-top:14.3px}}@media (min-width:768px){.form-horizontal .form-group-sm .control-label{padding-top:6px}}.btn{display:inline-block;padding:6px 12px;margin-bottom:0;font-size:14px;font-weight:400;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:none;border:1px solid transparent;border-radius:4px}.btn:focus,.btn:active:focus,.btn.active:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn:hover,.btn:focus{color:#333;text-decoration:none}.btn:active,.btn.active{background-image:none;outline:0;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{pointer-events:none;cursor:not-allowed;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none;opacity:.65}.btn-default{color:#333;background-color:#fff;border-color:#ccc}.btn-default:hover,.btn-default:focus,.btn-default:active,.btn-default.active,.open>.dropdown-toggle.btn-default{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default:active,.btn-default.active,.open>.dropdown-toggle.btn-default{background-image:none}.btn-default.disabled,.btn-default[disabled],fieldset[disabled] .btn-default,.btn-default.disabled:hover,.btn-default[disabled]:hover,fieldset[disabled] .btn-default:hover,.btn-default.disabled:focus,.btn-default[disabled]:focus,fieldset[disabled] .btn-default:focus,.btn-default.disabled:active,.btn-default[disabled]:active,fieldset[disabled] .btn-default:active,.btn-default.disabled.active,.btn-default[disabled].active,fieldset[disabled] .btn-default.active{background-color:#fff;border-color:#ccc}.btn-default .badge{color:#fff;background-color:#333}.btn-primary{color:#fff;background-color:#428bca;border-color:#357ebd}.btn-primary:hover,.btn-primary:focus,.btn-primary:active,.btn-primary.active,.open>.dropdown-toggle.btn-primary{color:#fff;background-color:#3071a9;border-color:#285e8e}.btn-primary:active,.btn-primary.active,.open>.dropdown-toggle.btn-primary{background-image:none}.btn-primary.disabled,.btn-primary[disabled],fieldset[disabled] .btn-primary,.btn-primary.disabled:hover,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary:hover,.btn-primary.disabled:focus,.btn-primary[disabled]:focus,fieldset[disabled] .btn-primary:focus,.btn-primary.disabled:active,.btn-primary[disabled]:active,fieldset[disabled] .btn-primary:active,.btn-primary.disabled.active,.btn-primary[disabled].active,fieldset[disabled] .btn-primary.active{background-color:#428bca;border-color:#357ebd}.btn-primary .badge{color:#428bca;background-color:#fff}.btn-success{color:#fff;background-color:#5cb85c;border-color:#4cae4c}.btn-success:hover,.btn-success:focus,.btn-success:active,.btn-success.active,.open>.dropdown-toggle.btn-success{color:#fff;background-color:#449d44;border-color:#398439}.btn-success:active,.btn-success.active,.open>.dropdown-toggle.btn-success{background-image:none}.btn-success.disabled,.btn-success[disabled],fieldset[disabled] .btn-success,.btn-success.disabled:hover,.btn-success[disabled]:hover,fieldset[disabled] .btn-success:hover,.btn-success.disabled:focus,.btn-success[disabled]:focus,fieldset[disabled] .btn-success:focus,.btn-success.disabled:active,.btn-success[disabled]:active,fieldset[disabled] .btn-success:active,.btn-success.disabled.active,.btn-success[disabled].active,fieldset[disabled] .btn-success.active{background-color:#5cb85c;border-color:#4cae4c}.btn-success .badge{color:#5cb85c;background-color:#fff}.btn-info{color:#fff;background-color:#5bc0de;border-color:#46b8da}.btn-info:hover,.btn-info:focus,.btn-info:active,.btn-info.active,.open>.dropdown-toggle.btn-info{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info:active,.btn-info.active,.open>.dropdown-toggle.btn-info{background-image:none}.btn-info.disabled,.btn-info[disabled],fieldset[disabled] .btn-info,.btn-info.disabled:hover,.btn-info[disabled]:hover,fieldset[disabled] .btn-info:hover,.btn-info.disabled:focus,.btn-info[disabled]:focus,fieldset[disabled] .btn-info:focus,.btn-info.disabled:active,.btn-info[disabled]:active,fieldset[disabled] .btn-info:active,.btn-info.disabled.active,.btn-info[disabled].active,fieldset[disabled] .btn-info.active{background-color:#5bc0de;border-color:#46b8da}.btn-info .badge{color:#5bc0de;background-color:#fff}.btn-warning{color:#fff;background-color:#f0ad4e;border-color:#eea236}.btn-warning:hover,.btn-warning:focus,.btn-warning:active,.btn-warning.active,.open>.dropdown-toggle.btn-warning{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning:active,.btn-warning.active,.open>.dropdown-toggle.btn-warning{background-image:none}.btn-warning.disabled,.btn-warning[disabled],fieldset[disabled] .btn-warning,.btn-warning.disabled:hover,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning:hover,.btn-warning.disabled:focus,.btn-warning[disabled]:focus,fieldset[disabled] .btn-warning:focus,.btn-warning.disabled:active,.btn-warning[disabled]:active,fieldset[disabled] .btn-warning:active,.btn-warning.disabled.active,.btn-warning[disabled].active,fieldset[disabled] .btn-warning.active{background-color:#f0ad4e;border-color:#eea236}.btn-warning .badge{color:#f0ad4e;background-color:#fff}.btn-danger{color:#fff;background-color:#d9534f;border-color:#d43f3a}.btn-danger:hover,.btn-danger:focus,.btn-danger:active,.btn-danger.active,.open>.dropdown-toggle.btn-danger{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger:active,.btn-danger.active,.open>.dropdown-toggle.btn-danger{background-image:none}.btn-danger.disabled,.btn-danger[disabled],fieldset[disabled] .btn-danger,.btn-danger.disabled:hover,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger:hover,.btn-danger.disabled:focus,.btn-danger[disabled]:focus,fieldset[disabled] .btn-danger:focus,.btn-danger.disabled:active,.btn-danger[disabled]:active,fieldset[disabled] .btn-danger:active,.btn-danger.disabled.active,.btn-danger[disabled].active,fieldset[disabled] .btn-danger.active{background-color:#d9534f;border-color:#d43f3a}.btn-danger .badge{color:#d9534f;background-color:#fff}.btn-link{font-weight:400;color:#428bca;cursor:pointer;border-radius:0}.btn-link,.btn-link:active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:hover,.btn-link:focus,.btn-link:active{border-color:transparent}.btn-link:hover,.btn-link:focus{color:#2a6496;text-decoration:underline;background-color:transparent}.btn-link[disabled]:hover,fieldset[disabled] .btn-link:hover,.btn-link[disabled]:focus,fieldset[disabled] .btn-link:focus{color:#777;text-decoration:none}.btn-lg,.btn-group-lg>.btn{padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}.btn-sm,.btn-group-sm>.btn{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.btn-xs,.btn-group-xs>.btn{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:5px}input[type=submit].btn-block,input[type=reset].btn-block,input[type=button].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{display:none}.collapse.in{display:block}tr.collapse.in{display:table-row}tbody.collapse.in{display:table-row-group}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition:height .35s ease;-o-transition:height .35s ease;transition:height .35s ease}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px solid;border-right:4px solid transparent;border-left:4px solid transparent}.dropdown{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;font-size:14px;text-align:left;list-style:none;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.15);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175)}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.42857143;color:#333;white-space:nowrap}.dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus{color:#262626;text-decoration:none;background-color:#f5f5f5}.dropdown-menu>.active>a,.dropdown-menu>.active>a:hover,.dropdown-menu>.active>a:focus{color:#fff;text-decoration:none;background-color:#428bca;outline:0}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{color:#777}.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{text-decoration:none;cursor:not-allowed;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-menu-right{right:0;left:auto}.dropdown-menu-left{right:auto;left:0}.dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.42857143;color:#777;white-space:nowrap}.dropdown-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{content:"";border-top:0;border-bottom:4px solid}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:1px}@media (min-width:768px){.navbar-right .dropdown-menu{right:0;left:auto}.navbar-right .dropdown-menu-left{right:auto;left:0}}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group>.btn,.btn-group-vertical>.btn{position:relative;float:left}.btn-group>.btn:hover,.btn-group-vertical>.btn:hover,.btn-group>.btn:focus,.btn-group-vertical>.btn:focus,.btn-group>.btn:active,.btn-group-vertical>.btn:active,.btn-group>.btn.active,.btn-group-vertical>.btn.active{z-index:2}.btn-group>.btn:focus,.btn-group-vertical>.btn:focus{outline:0}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar{margin-left:-5px}.btn-toolbar .btn-group,.btn-toolbar .input-group{float:left}.btn-toolbar>.btn,.btn-toolbar>.btn-group,.btn-toolbar>.input-group{margin-left:5px}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group>.btn-group:first-child>.btn:last-child,.btn-group>.btn-group:first-child>.dropdown-toggle{border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:last-child>.btn:first-child{border-top-left-radius:0;border-bottom-left-radius:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{padding-right:8px;padding-left:8px}.btn-group>.btn-lg+.dropdown-toggle{padding-right:12px;padding-left:12px}.btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn-group.open .dropdown-toggle.btn-link{-webkit-box-shadow:none;box-shadow:none}.btn .caret{margin-left:0}.btn-lg .caret{border-width:5px 5px 0;border-bottom-width:0}.dropup .btn-lg .caret{border-width:0 5px 5px}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group,.btn-group-vertical>.btn-group>.btn{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-top-left-radius:0;border-top-right-radius:0;border-bottom-left-radius:4px}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group-vertical>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-top-right-radius:0}.btn-group-justified{display:table;width:100%;table-layout:fixed;border-collapse:separate}.btn-group-justified>.btn,.btn-group-justified>.btn-group{display:table-cell;float:none;width:1%}.btn-group-justified>.btn-group .btn{width:100%}.btn-group-justified>.btn-group .dropdown-menu{left:auto}[data-toggle=buttons]>.btn>input[type=radio],[data-toggle=buttons]>.btn>input[type=checkbox]{position:absolute;z-index:-1;filter:alpha(opacity=0);opacity:0}.input-group{position:relative;display:table;border-collapse:separate}.input-group[class*=col-]{float:none;padding-right:0;padding-left:0}.input-group .form-control{position:relative;z-index:2;float:left;width:100%;margin-bottom:0}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{height:46px;padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}select.input-group-lg>.form-control,select.input-group-lg>.input-group-addon,select.input-group-lg>.input-group-btn>.btn{height:46px;line-height:46px}textarea.input-group-lg>.form-control,textarea.input-group-lg>.input-group-addon,textarea.input-group-lg>.input-group-btn>.btn,select[multiple].input-group-lg>.form-control,select[multiple].input-group-lg>.input-group-addon,select[multiple].input-group-lg>.input-group-btn>.btn{height:auto}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-group-sm>.form-control,select.input-group-sm>.input-group-addon,select.input-group-sm>.input-group-btn>.btn{height:30px;line-height:30px}textarea.input-group-sm>.form-control,textarea.input-group-sm>.input-group-addon,textarea.input-group-sm>.input-group-btn>.btn,select[multiple].input-group-sm>.form-control,select[multiple].input-group-sm>.input-group-addon,select[multiple].input-group-sm>.input-group-btn>.btn{height:auto}.input-group-addon,.input-group-btn,.input-group .form-control{display:table-cell}.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child),.input-group .form-control:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:6px 12px;font-size:14px;font-weight:400;line-height:1;color:#555;text-align:center;background-color:#eee;border:1px solid #ccc;border-radius:4px}.input-group-addon.input-sm{padding:5px 10px;font-size:12px;border-radius:3px}.input-group-addon.input-lg{padding:10px 16px;font-size:18px;border-radius:6px}.input-group-addon input[type=radio],.input-group-addon input[type=checkbox]{margin-top:0}.input-group .form-control:first-child,.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle),.input-group-btn:last-child>.btn-group:not(:last-child)>.btn{border-top-right-radius:0;border-bottom-right-radius:0}.input-group-addon:first-child{border-right:0}.input-group .form-control:last-child,.input-group-addon:last-child,.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group>.btn,.input-group-btn:last-child>.dropdown-toggle,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:first-child>.btn-group:not(:first-child)>.btn{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-addon:last-child{border-left:0}.input-group-btn{position:relative;font-size:0;white-space:nowrap}.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-1px}.input-group-btn>.btn:hover,.input-group-btn>.btn:focus,.input-group-btn>.btn:active{z-index:2}.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group{margin-right:-1px}.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group{margin-left:-1px}.nav{padding-left:0;margin-bottom:0;list-style:none}.nav>li{position:relative;display:block}.nav>li>a{position:relative;display:block;padding:10px 15px}.nav>li>a:hover,.nav>li>a:focus{text-decoration:none;background-color:#eee}.nav>li.disabled>a{color:#777}.nav>li.disabled>a:hover,.nav>li.disabled>a:focus{color:#777;text-decoration:none;cursor:not-allowed;background-color:transparent}.nav .open>a,.nav .open>a:hover,.nav .open>a:focus{background-color:#eee;border-color:#428bca}.nav .nav-divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{float:left;margin-bottom:-1px}.nav-tabs>li>a{margin-right:2px;line-height:1.42857143;border:1px solid transparent;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>li.active>a,.nav-tabs>li.active>a:hover,.nav-tabs>li.active>a:focus{color:#555;cursor:default;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent}.nav-tabs.nav-justified{width:100%;border-bottom:0}.nav-tabs.nav-justified>li{float:none}.nav-tabs.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%}.nav-tabs.nav-justified>li>a{margin-bottom:0}}.nav-tabs.nav-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a:focus{border:1px solid #ddd}@media (min-width:768px){.nav-tabs.nav-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a:focus{border-bottom-color:#fff}}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:4px}.nav-pills>li+li{margin-left:2px}.nav-pills>li.active>a,.nav-pills>li.active>a:hover,.nav-pills>li.active>a:focus{color:#fff;background-color:#428bca}.nav-stacked>li{float:none}.nav-stacked>li+li{margin-top:2px;margin-left:0}.nav-justified{width:100%}.nav-justified>li{float:none}.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-justified>li{display:table-cell;width:1%}.nav-justified>li>a{margin-bottom:0}}.nav-tabs-justified{border-bottom:0}.nav-tabs-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:hover,.nav-tabs-justified>.active>a:focus{border:1px solid #ddd}@media (min-width:768px){.nav-tabs-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:hover,.nav-tabs-justified>.active>a:focus{border-bottom-color:#fff}}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}.navbar{position:relative;min-height:50px;margin-bottom:20px;border:1px solid transparent}@media (min-width:768px){.navbar{border-radius:4px}}@media (min-width:768px){.navbar-header{float:left}}.navbar-collapse{padding-right:15px;padding-left:15px;overflow-x:visible;-webkit-overflow-scrolling:touch;border-top:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1)}.navbar-collapse.in{overflow-y:auto}@media (min-width:768px){.navbar-collapse{width:auto;border-top:0;-webkit-box-shadow:none;box-shadow:none}.navbar-collapse.collapse{display:block!important;height:auto!important;padding-bottom:0;overflow:visible!important}.navbar-collapse.in{overflow-y:visible}.navbar-fixed-top .navbar-collapse,.navbar-static-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{padding-right:0;padding-left:0}}.navbar-fixed-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{max-height:340px}@media (max-width:480px) and (orientation:landscape){.navbar-fixed-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{max-height:200px}}.container>.navbar-header,.container-fluid>.navbar-header,.container>.navbar-collapse,.container-fluid>.navbar-collapse{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.container>.navbar-header,.container-fluid>.navbar-header,.container>.navbar-collapse,.container-fluid>.navbar-collapse{margin-right:0;margin-left:0}}.navbar-static-top{z-index:1000;border-width:0 0 1px}@media (min-width:768px){.navbar-static-top{border-radius:0}}.navbar-fixed-top,.navbar-fixed-bottom{position:fixed;right:0;left:0;z-index:1030;-webkit-transform:translate3d(0,0,0);-o-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}@media (min-width:768px){.navbar-fixed-top,.navbar-fixed-bottom{border-radius:0}}.navbar-fixed-top{top:0;border-width:0 0 1px}.navbar-fixed-bottom{bottom:0;margin-bottom:0;border-width:1px 0 0}.navbar-brand{float:left;height:50px;padding:15px 15px;font-size:18px;line-height:20px}.navbar-brand:hover,.navbar-brand:focus{text-decoration:none}@media (min-width:768px){.navbar>.container .navbar-brand,.navbar>.container-fluid .navbar-brand{margin-left:-15px}}.navbar-toggle{position:relative;float:right;padding:9px 10px;margin-top:8px;margin-right:15px;margin-bottom:8px;background-color:transparent;background-image:none;border:1px solid transparent;border-radius:4px}.navbar-toggle:focus{outline:0}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}@media (min-width:768px){.navbar-toggle{display:none}}.navbar-nav{margin:7.5px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:20px}@media (max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;-webkit-box-shadow:none;box-shadow:none}.navbar-nav .open .dropdown-menu>li>a,.navbar-nav .open .dropdown-menu .dropdown-header{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:20px}.navbar-nav .open .dropdown-menu>li>a:hover,.navbar-nav .open .dropdown-menu>li>a:focus{background-image:none}}@media (min-width:768px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:15px;padding-bottom:15px}.navbar-nav.navbar-right:last-child{margin-right:-15px}}@media (min-width:768px){.navbar-left{float:left!important}.navbar-right{float:right!important}}.navbar-form{padding:10px 15px;margin-top:8px;margin-right:-15px;margin-bottom:8px;margin-left:-15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1)}@media (min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block;width:auto;vertical-align:middle}.navbar-form .input-group{display:inline-table;vertical-align:middle}.navbar-form .input-group .input-group-addon,.navbar-form .input-group .input-group-btn,.navbar-form .input-group .form-control{width:auto}.navbar-form .input-group>.form-control{width:100%}.navbar-form .control-label{margin-bottom:0;vertical-align:middle}.navbar-form .radio,.navbar-form .checkbox{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.navbar-form .radio label,.navbar-form .checkbox label{padding-left:0}.navbar-form .radio input[type=radio],.navbar-form .checkbox input[type=checkbox]{position:relative;margin-left:0}.navbar-form .has-feedback .form-control-feedback{top:0}}@media (max-width:767px){.navbar-form .form-group{margin-bottom:5px}}@media (min-width:768px){.navbar-form{width:auto;padding-top:0;padding-bottom:0;margin-right:0;margin-left:0;border:0;-webkit-box-shadow:none;box-shadow:none}.navbar-form.navbar-right:last-child{margin-right:-15px}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-left-radius:0;border-top-right-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{border-bottom-right-radius:0;border-bottom-left-radius:0}.navbar-btn{margin-top:8px;margin-bottom:8px}.navbar-btn.btn-sm{margin-top:10px;margin-bottom:10px}.navbar-btn.btn-xs{margin-top:14px;margin-bottom:14px}.navbar-text{margin-top:15px;margin-bottom:15px}@media (min-width:768px){.navbar-text{float:left;margin-right:15px;margin-left:15px}.navbar-text.navbar-right:last-child{margin-right:0}}.navbar-default{background-color:#f8f8f8;border-color:#e7e7e7}.navbar-default .navbar-brand{color:#777}.navbar-default .navbar-brand:hover,.navbar-default .navbar-brand:focus{color:#5e5e5e;background-color:transparent}.navbar-default .navbar-text{color:#777}.navbar-default .navbar-nav>li>a{color:#777}.navbar-default .navbar-nav>li>a:hover,.navbar-default .navbar-nav>li>a:focus{color:#333;background-color:transparent}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:hover,.navbar-default .navbar-nav>.active>a:focus{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:hover,.navbar-default .navbar-nav>.disabled>a:focus{color:#ccc;background-color:transparent}.navbar-default .navbar-toggle{border-color:#ddd}.navbar-default .navbar-toggle:hover,.navbar-default .navbar-toggle:focus{background-color:#ddd}.navbar-default .navbar-toggle .icon-bar{background-color:#888}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:#e7e7e7}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:hover,.navbar-default .navbar-nav>.open>a:focus{color:#555;background-color:#e7e7e7}@media (max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#777}.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus{color:#333;background-color:transparent}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#ccc;background-color:transparent}}.navbar-default .navbar-link{color:#777}.navbar-default .navbar-link:hover{color:#333}.navbar-default .btn-link{color:#777}.navbar-default .btn-link:hover,.navbar-default .btn-link:focus{color:#333}.navbar-default .btn-link[disabled]:hover,fieldset[disabled] .navbar-default .btn-link:hover,.navbar-default .btn-link[disabled]:focus,fieldset[disabled] .navbar-default .btn-link:focus{color:#ccc}.navbar-inverse{background-color:#222;border-color:#080808}.navbar-inverse .navbar-brand{color:#777}.navbar-inverse .navbar-brand:hover,.navbar-inverse .navbar-brand:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-text{color:#777}.navbar-inverse .navbar-nav>li>a{color:#777}.navbar-inverse .navbar-nav>li>a:hover,.navbar-inverse .navbar-nav>li>a:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:hover,.navbar-inverse .navbar-nav>.active>a:focus{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:hover,.navbar-inverse .navbar-nav>.disabled>a:focus{color:#444;background-color:transparent}.navbar-inverse .navbar-toggle{border-color:#333}.navbar-inverse .navbar-toggle:hover,.navbar-inverse .navbar-toggle:focus{background-color:#333}.navbar-inverse .navbar-toggle .icon-bar{background-color:#fff}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#101010}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:hover,.navbar-inverse .navbar-nav>.open>a:focus{color:#fff;background-color:#080808}@media (max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#777}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#444;background-color:transparent}}.navbar-inverse .navbar-link{color:#777}.navbar-inverse .navbar-link:hover{color:#fff}.navbar-inverse .btn-link{color:#777}.navbar-inverse .btn-link:hover,.navbar-inverse .btn-link:focus{color:#fff}.navbar-inverse .btn-link[disabled]:hover,fieldset[disabled] .navbar-inverse .btn-link:hover,.navbar-inverse .btn-link[disabled]:focus,fieldset[disabled] .navbar-inverse .btn-link:focus{color:#444}.breadcrumb{padding:8px 15px;margin-bottom:20px;list-style:none;background-color:#f5f5f5;border-radius:4px}.breadcrumb>li{display:inline-block}.breadcrumb>li+li:before{padding:0 5px;color:#ccc;content:"/\00a0"}.breadcrumb>.active{color:#777}.pagination{display:inline-block;padding-left:0;margin:20px 0;border-radius:4px}.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:6px 12px;margin-left:-1px;line-height:1.42857143;color:#428bca;text-decoration:none;background-color:#fff;border:1px solid #ddd}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-top-left-radius:4px;border-bottom-left-radius:4px}.pagination>li:last-child>a,.pagination>li:last-child>span{border-top-right-radius:4px;border-bottom-right-radius:4px}.pagination>li>a:hover,.pagination>li>span:hover,.pagination>li>a:focus,.pagination>li>span:focus{color:#2a6496;background-color:#eee;border-color:#ddd}.pagination>.active>a,.pagination>.active>span,.pagination>.active>a:hover,.pagination>.active>span:hover,.pagination>.active>a:focus,.pagination>.active>span:focus{z-index:2;color:#fff;cursor:default;background-color:#428bca;border-color:#428bca}.pagination>.disabled>span,.pagination>.disabled>span:hover,.pagination>.disabled>span:focus,.pagination>.disabled>a,.pagination>.disabled>a:hover,.pagination>.disabled>a:focus{color:#777;cursor:not-allowed;background-color:#fff;border-color:#ddd}.pagination-lg>li>a,.pagination-lg>li>span{padding:10px 16px;font-size:18px}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-top-left-radius:6px;border-bottom-left-radius:6px}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-top-right-radius:6px;border-bottom-right-radius:6px}.pagination-sm>li>a,.pagination-sm>li>span{padding:5px 10px;font-size:12px}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-top-left-radius:3px;border-bottom-left-radius:3px}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-top-right-radius:3px;border-bottom-right-radius:3px}.pager{padding-left:0;margin:20px 0;text-align:center;list-style:none}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;border-radius:15px}.pager li>a:hover,.pager li>a:focus{text-decoration:none;background-color:#eee}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:hover,.pager .disabled>a:focus,.pager .disabled>span{color:#777;cursor:not-allowed;background-color:#fff}.label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}a.label:hover,a.label:focus{color:#fff;text-decoration:none;cursor:pointer}.label:empty{display:none}.btn .label{position:relative;top:-1px}.label-default{background-color:#777}.label-default[href]:hover,.label-default[href]:focus{background-color:#5e5e5e}.label-primary{background-color:#428bca}.label-primary[href]:hover,.label-primary[href]:focus{background-color:#3071a9}.label-success{background-color:#5cb85c}.label-success[href]:hover,.label-success[href]:focus{background-color:#449d44}.label-info{background-color:#5bc0de}.label-info[href]:hover,.label-info[href]:focus{background-color:#31b0d5}.label-warning{background-color:#f0ad4e}.label-warning[href]:hover,.label-warning[href]:focus{background-color:#ec971f}.label-danger{background-color:#d9534f}.label-danger[href]:hover,.label-danger[href]:focus{background-color:#c9302c}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:12px;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;background-color:#777;border-radius:10px}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.btn-xs .badge{top:0;padding:1px 5px}a.badge:hover,a.badge:focus{color:#fff;text-decoration:none;cursor:pointer}a.list-group-item.active>.badge,.nav-pills>.active>a>.badge{color:#428bca;background-color:#fff}.nav-pills>li>a>.badge{margin-left:3px}.jumbotron{padding:30px;margin-bottom:30px;color:inherit;background-color:#eee}.jumbotron h1,.jumbotron .h1{color:inherit}.jumbotron p{margin-bottom:15px;font-size:21px;font-weight:200}.jumbotron>hr{border-top-color:#d5d5d5}.container .jumbotron{border-radius:6px}.jumbotron .container{max-width:100%}@media screen and (min-width:768px){.jumbotron{padding-top:48px;padding-bottom:48px}.container .jumbotron{padding-right:60px;padding-left:60px}.jumbotron h1,.jumbotron .h1{font-size:63px}}.thumbnail{display:block;padding:4px;margin-bottom:20px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.thumbnail>img,.thumbnail a>img{margin-right:auto;margin-left:auto}a.thumbnail:hover,a.thumbnail:focus,a.thumbnail.active{border-color:#428bca}.thumbnail .caption{padding:9px;color:#333}.alert{padding:15px;margin-bottom:20px;border:1px solid transparent;border-radius:4px}.alert h4{margin-top:0;color:inherit}.alert .alert-link{font-weight:700}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:5px}.alert-dismissable,.alert-dismissible{padding-right:35px}.alert-dismissable .close,.alert-dismissible .close{position:relative;top:-2px;right:-21px;color:inherit}.alert-success{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.alert-success hr{border-top-color:#c9e2b3}.alert-success .alert-link{color:#2b542c}.alert-info{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.alert-info hr{border-top-color:#a6e1ec}.alert-info .alert-link{color:#245269}.alert-warning{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.alert-warning hr{border-top-color:#f7e1b5}.alert-warning .alert-link{color:#66512c}.alert-danger{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.alert-danger hr{border-top-color:#e4b9c0}.alert-danger .alert-link{color:#843534}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{height:20px;margin-bottom:20px;overflow:hidden;background-color:#f5f5f5;border-radius:4px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);box-shadow:inset 0 1px 2px rgba(0,0,0,.1)}.progress-bar{float:left;width:0;height:100%;font-size:12px;line-height:20px;color:#fff;text-align:center;background-color:#428bca;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);-webkit-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease}.progress-striped .progress-bar,.progress-bar-striped{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);-webkit-background-size:40px 40px;background-size:40px 40px}.progress.active .progress-bar,.progress-bar.active{-webkit-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-bar[aria-valuenow="1"],.progress-bar[aria-valuenow="2"]{min-width:30px}.progress-bar[aria-valuenow="0"]{min-width:30px;color:#777;background-color:transparent;background-image:none;-webkit-box-shadow:none;box-shadow:none}.progress-bar-success{background-color:#5cb85c}.progress-striped .progress-bar-success{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-info{background-color:#5bc0de}.progress-striped .progress-bar-info{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-warning{background-color:#f0ad4e}.progress-striped .progress-bar-warning{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-danger{background-color:#d9534f}.progress-striped .progress-bar-danger{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.media,.media-body{overflow:hidden;zoom:1}.media,.media .media{margin-top:15px}.media:first-child{margin-top:0}.media-object{display:block}.media-heading{margin:0 0 5px}.media>.pull-left{margin-right:10px}.media>.pull-right{margin-left:10px}.media-list{padding-left:0;list-style:none}.list-group{padding-left:0;margin-bottom:20px}.list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#fff;border:1px solid #ddd}.list-group-item:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.list-group-item>.badge{float:right}.list-group-item>.badge+.badge{margin-right:5px}a.list-group-item{color:#555}a.list-group-item .list-group-item-heading{color:#333}a.list-group-item:hover,a.list-group-item:focus{color:#555;text-decoration:none;background-color:#f5f5f5}.list-group-item.disabled,.list-group-item.disabled:hover,.list-group-item.disabled:focus{color:#777;background-color:#eee}.list-group-item.disabled .list-group-item-heading,.list-group-item.disabled:hover .list-group-item-heading,.list-group-item.disabled:focus .list-group-item-heading{color:inherit}.list-group-item.disabled .list-group-item-text,.list-group-item.disabled:hover .list-group-item-text,.list-group-item.disabled:focus .list-group-item-text{color:#777}.list-group-item.active,.list-group-item.active:hover,.list-group-item.active:focus{z-index:2;color:#fff;background-color:#428bca;border-color:#428bca}.list-group-item.active .list-group-item-heading,.list-group-item.active:hover .list-group-item-heading,.list-group-item.active:focus .list-group-item-heading,.list-group-item.active .list-group-item-heading>small,.list-group-item.active:hover .list-group-item-heading>small,.list-group-item.active:focus .list-group-item-heading>small,.list-group-item.active .list-group-item-heading>.small,.list-group-item.active:hover .list-group-item-heading>.small,.list-group-item.active:focus .list-group-item-heading>.small{color:inherit}.list-group-item.active .list-group-item-text,.list-group-item.active:hover .list-group-item-text,.list-group-item.active:focus .list-group-item-text{color:#e1edf7}.list-group-item-success{color:#3c763d;background-color:#dff0d8}a.list-group-item-success{color:#3c763d}a.list-group-item-success .list-group-item-heading{color:inherit}a.list-group-item-success:hover,a.list-group-item-success:focus{color:#3c763d;background-color:#d0e9c6}a.list-group-item-success.active,a.list-group-item-success.active:hover,a.list-group-item-success.active:focus{color:#fff;background-color:#3c763d;border-color:#3c763d}.list-group-item-info{color:#31708f;background-color:#d9edf7}a.list-group-item-info{color:#31708f}a.list-group-item-info .list-group-item-heading{color:inherit}a.list-group-item-info:hover,a.list-group-item-info:focus{color:#31708f;background-color:#c4e3f3}a.list-group-item-info.active,a.list-group-item-info.active:hover,a.list-group-item-info.active:focus{color:#fff;background-color:#31708f;border-color:#31708f}.list-group-item-warning{color:#8a6d3b;background-color:#fcf8e3}a.list-group-item-warning{color:#8a6d3b}a.list-group-item-warning .list-group-item-heading{color:inherit}a.list-group-item-warning:hover,a.list-group-item-warning:focus{color:#8a6d3b;background-color:#faf2cc}a.list-group-item-warning.active,a.list-group-item-warning.active:hover,a.list-group-item-warning.active:focus{color:#fff;background-color:#8a6d3b;border-color:#8a6d3b}.list-group-item-danger{color:#a94442;background-color:#f2dede}a.list-group-item-danger{color:#a94442}a.list-group-item-danger .list-group-item-heading{color:inherit}a.list-group-item-danger:hover,a.list-group-item-danger:focus{color:#a94442;background-color:#ebcccc}a.list-group-item-danger.active,a.list-group-item-danger.active:hover,a.list-group-item-danger.active:focus{color:#fff;background-color:#a94442;border-color:#a94442}.list-group-item-heading{margin-top:0;margin-bottom:5px}.list-group-item-text{margin-bottom:0;line-height:1.3}.panel{margin-bottom:20px;background-color:#fff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.05);box-shadow:0 1px 1px rgba(0,0,0,.05)}.panel-body{padding:15px}.panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-left-radius:3px;border-top-right-radius:3px}.panel-heading>.dropdown .dropdown-toggle{color:inherit}.panel-title{margin-top:0;margin-bottom:0;font-size:16px;color:inherit}.panel-title>a{color:inherit}.panel-footer{padding:10px 15px;background-color:#f5f5f5;border-top:1px solid #ddd;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.list-group{margin-bottom:0}.panel>.list-group .list-group-item{border-width:1px 0;border-radius:0}.panel>.list-group:first-child .list-group-item:first-child{border-top:0;border-top-left-radius:3px;border-top-right-radius:3px}.panel>.list-group:last-child .list-group-item:last-child{border-bottom:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.list-group+.panel-footer{border-top-width:0}.panel>.table,.panel>.table-responsive>.table,.panel>.panel-collapse>.table{margin-bottom:0}.panel>.table:first-child,.panel>.table-responsive:first-child>.table:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:first-child{border-top-left-radius:3px}.panel>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:last-child{border-top-right-radius:3px}.panel>.table:last-child,.panel>.table-responsive:last-child>.table:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:first-child{border-bottom-left-radius:3px}.panel>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:last-child{border-bottom-right-radius:3px}.panel>.panel-body+.table,.panel>.panel-body+.table-responsive{border-top:1px solid #ddd}.panel>.table>tbody:first-child>tr:first-child th,.panel>.table>tbody:first-child>tr:first-child td{border-top:0}.panel>.table-bordered,.panel>.table-responsive>.table-bordered{border:0}.panel>.table-bordered>thead>tr>th:first-child,.panel>.table-responsive>.table-bordered>thead>tr>th:first-child,.panel>.table-bordered>tbody>tr>th:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:first-child,.panel>.table-bordered>tfoot>tr>th:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child,.panel>.table-bordered>thead>tr>td:first-child,.panel>.table-responsive>.table-bordered>thead>tr>td:first-child,.panel>.table-bordered>tbody>tr>td:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:first-child,.panel>.table-bordered>tfoot>tr>td:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0}.panel>.table-bordered>thead>tr>th:last-child,.panel>.table-responsive>.table-bordered>thead>tr>th:last-child,.panel>.table-bordered>tbody>tr>th:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:last-child,.panel>.table-bordered>tfoot>tr>th:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child,.panel>.table-bordered>thead>tr>td:last-child,.panel>.table-responsive>.table-bordered>thead>tr>td:last-child,.panel>.table-bordered>tbody>tr>td:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:last-child,.panel>.table-bordered>tfoot>tr>td:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0}.panel>.table-bordered>thead>tr:first-child>td,.panel>.table-responsive>.table-bordered>thead>tr:first-child>td,.panel>.table-bordered>tbody>tr:first-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>td,.panel>.table-bordered>thead>tr:first-child>th,.panel>.table-responsive>.table-bordered>thead>tr:first-child>th,.panel>.table-bordered>tbody>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>th{border-bottom:0}.panel>.table-bordered>tbody>tr:last-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.panel>.table-bordered>tfoot>tr:last-child>td,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td,.panel>.table-bordered>tbody>tr:last-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.panel>.table-bordered>tfoot>tr:last-child>th,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}.panel>.table-responsive{margin-bottom:0;border:0}.panel-group{margin-bottom:20px}.panel-group .panel{margin-bottom:0;border-radius:4px}.panel-group .panel+.panel{margin-top:5px}.panel-group .panel-heading{border-bottom:0}.panel-group .panel-heading+.panel-collapse>.panel-body{border-top:1px solid #ddd}.panel-group .panel-footer{border-top:0}.panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:1px solid #ddd}.panel-default{border-color:#ddd}.panel-default>.panel-heading{color:#333;background-color:#f5f5f5;border-color:#ddd}.panel-default>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ddd}.panel-default>.panel-heading .badge{color:#f5f5f5;background-color:#333}.panel-default>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ddd}.panel-primary{border-color:#428bca}.panel-primary>.panel-heading{color:#fff;background-color:#428bca;border-color:#428bca}.panel-primary>.panel-heading+.panel-collapse>.panel-body{border-top-color:#428bca}.panel-primary>.panel-heading .badge{color:#428bca;background-color:#fff}.panel-primary>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#428bca}.panel-success{border-color:#d6e9c6}.panel-success>.panel-heading{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.panel-success>.panel-heading+.panel-collapse>.panel-body{border-top-color:#d6e9c6}.panel-success>.panel-heading .badge{color:#dff0d8;background-color:#3c763d}.panel-success>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#d6e9c6}.panel-info{border-color:#bce8f1}.panel-info>.panel-heading{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.panel-info>.panel-heading+.panel-collapse>.panel-body{border-top-color:#bce8f1}.panel-info>.panel-heading .badge{color:#d9edf7;background-color:#31708f}.panel-info>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#bce8f1}.panel-warning{border-color:#faebcc}.panel-warning>.panel-heading{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.panel-warning>.panel-heading+.panel-collapse>.panel-body{border-top-color:#faebcc}.panel-warning>.panel-heading .badge{color:#fcf8e3;background-color:#8a6d3b}.panel-warning>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#faebcc}.panel-danger{border-color:#ebccd1}.panel-danger>.panel-heading{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.panel-danger>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ebccd1}.panel-danger>.panel-heading .badge{color:#f2dede;background-color:#a94442}.panel-danger>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ebccd1}.embed-responsive{position:relative;display:block;height:0;padding:0;overflow:hidden}.embed-responsive .embed-responsive-item,.embed-responsive iframe,.embed-responsive embed,.embed-responsive object{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;border:0}.embed-responsive.embed-responsive-16by9{padding-bottom:56.25%}.embed-responsive.embed-responsive-4by3{padding-bottom:75%}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.05);box-shadow:inset 0 1px 1px rgba(0,0,0,.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,.15)}.well-lg{padding:24px;border-radius:6px}.well-sm{padding:9px;border-radius:3px}.close{float:right;font-size:21px;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;filter:alpha(opacity=20);opacity:.2}.close:hover,.close:focus{color:#000;text-decoration:none;cursor:pointer;filter:alpha(opacity=50);opacity:.5}button.close{-webkit-appearance:none;padding:0;cursor:pointer;background:0 0;border:0}.modal-open{overflow:hidden}.modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1050;display:none;overflow:hidden;-webkit-overflow-scrolling:touch;outline:0}.modal.fade .modal-dialog{-webkit-transition:-webkit-transform .3s ease-out;-o-transition:-o-transform .3s ease-out;transition:transform .3s ease-out;-webkit-transform:translate3d(0,-25%,0);-o-transform:translate3d(0,-25%,0);transform:translate3d(0,-25%,0)}.modal.in .modal-dialog{-webkit-transform:translate3d(0,0,0);-o-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal-dialog{position:relative;width:auto;margin:10px}.modal-content{position:relative;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #999;border:1px solid rgba(0,0,0,.2);border-radius:6px;outline:0;-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);box-shadow:0 3px 9px rgba(0,0,0,.5)}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{filter:alpha(opacity=0);opacity:0}.modal-backdrop.in{filter:alpha(opacity=50);opacity:.5}.modal-header{min-height:16.43px;padding:15px;border-bottom:1px solid #e5e5e5}.modal-header .close{margin-top:-2px}.modal-title{margin:0;line-height:1.42857143}.modal-body{position:relative;padding:15px}.modal-footer{padding:15px;text-align:right;border-top:1px solid #e5e5e5}.modal-footer .btn+.btn{margin-bottom:0;margin-left:5px}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:768px){.modal-dialog{width:600px;margin:30px auto}.modal-content{-webkit-box-shadow:0 5px 15px rgba(0,0,0,.5);box-shadow:0 5px 15px rgba(0,0,0,.5)}.modal-sm{width:300px}}@media (min-width:992px){.modal-lg{width:900px}}.tooltip{position:absolute;z-index:1070;display:block;font-size:12px;line-height:1.4;visibility:visible;filter:alpha(opacity=0);opacity:0}.tooltip.in{filter:alpha(opacity=90);opacity:.9}.tooltip.top{padding:5px 0;margin-top:-3px}.tooltip.right{padding:0 5px;margin-left:3px}.tooltip.bottom{padding:5px 0;margin-top:3px}.tooltip.left{padding:0 5px;margin-left:-3px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;text-decoration:none;background-color:#000;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-left .tooltip-arrow{bottom:0;left:5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-right .tooltip-arrow{right:5px;bottom:0;border-width:5px 5px 0;border-top-color:#000}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-left .tooltip-arrow{top:0;left:5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-right .tooltip-arrow{top:0;right:5px;border-width:0 5px 5px;border-bottom-color:#000}.popover{position:absolute;top:0;left:0;z-index:1060;display:none;max-width:276px;padding:1px;text-align:left;white-space:normal;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2)}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{padding:8px 14px;margin:0;font-size:14px;font-weight:400;line-height:18px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover>.arrow,.popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover>.arrow{border-width:11px}.popover>.arrow:after{content:"";border-width:10px}.popover.top>.arrow{bottom:-11px;left:50%;margin-left:-11px;border-top-color:#999;border-top-color:rgba(0,0,0,.25);border-bottom-width:0}.popover.top>.arrow:after{bottom:1px;margin-left:-10px;content:" ";border-top-color:#fff;border-bottom-width:0}.popover.right>.arrow{top:50%;left:-11px;margin-top:-11px;border-right-color:#999;border-right-color:rgba(0,0,0,.25);border-left-width:0}.popover.right>.arrow:after{bottom:-10px;left:1px;content:" ";border-right-color:#fff;border-left-width:0}.popover.bottom>.arrow{top:-11px;left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,.25)}.popover.bottom>.arrow:after{top:1px;margin-left:-10px;content:" ";border-top-width:0;border-bottom-color:#fff}.popover.left>.arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#999;border-left-color:rgba(0,0,0,.25)}.popover.left>.arrow:after{right:1px;bottom:-10px;content:" ";border-right-width:0;border-left-color:#fff}.carousel{position:relative}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner>.item{position:relative;display:none;-webkit-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>img,.carousel-inner>.item>a>img{line-height:1}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:0;bottom:0;left:0;width:15%;font-size:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6);filter:alpha(opacity=50);opacity:.5}.carousel-control.left{background-image:-webkit-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.5)),to(rgba(0,0,0,.0001)));background-image:linear-gradient(to right,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);background-repeat:repeat-x}.carousel-control.right{right:0;left:auto;background-image:-webkit-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.0001)),to(rgba(0,0,0,.5)));background-image:linear-gradient(to right,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);background-repeat:repeat-x}.carousel-control:hover,.carousel-control:focus{color:#fff;text-decoration:none;filter:alpha(opacity=90);outline:0;opacity:.9}.carousel-control .icon-prev,.carousel-control .icon-next,.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right{position:absolute;top:50%;z-index:5;display:inline-block}.carousel-control .icon-prev,.carousel-control .glyphicon-chevron-left{left:50%;margin-left:-10px}.carousel-control .icon-next,.carousel-control .glyphicon-chevron-right{right:50%;margin-right:-10px}.carousel-control .icon-prev,.carousel-control .icon-next{width:20px;height:20px;margin-top:-10px;font-family:serif}.carousel-control .icon-prev:before{content:'\2039'}.carousel-control .icon-next:before{content:'\203a'}.carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:15;width:60%;padding-left:0;margin-left:-30%;text-align:center;list-style:none}.carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;cursor:pointer;background-color:#000 \9;background-color:rgba(0,0,0,0);border:1px solid #fff;border-radius:10px}.carousel-indicators .active{width:12px;height:12px;margin:0;background-color:#fff}.carousel-caption{position:absolute;right:15%;bottom:20px;left:15%;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6)}.carousel-caption .btn{text-shadow:none}@media screen and (min-width:768px){.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-prev,.carousel-control .icon-next{width:30px;height:30px;margin-top:-15px;font-size:30px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{margin-left:-15px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{margin-right:-15px}.carousel-caption{right:20%;left:20%;padding-bottom:30px}.carousel-indicators{bottom:20px}}.clearfix:before,.clearfix:after,.dl-horizontal dd:before,.dl-horizontal dd:after,.container:before,.container:after,.container-fluid:before,.container-fluid:after,.row:before,.row:after,.form-horizontal .form-group:before,.form-horizontal .form-group:after,.btn-toolbar:before,.btn-toolbar:after,.btn-group-vertical>.btn-group:before,.btn-group-vertical>.btn-group:after,.nav:before,.nav:after,.navbar:before,.navbar:after,.navbar-header:before,.navbar-header:after,.navbar-collapse:before,.navbar-collapse:after,.pager:before,.pager:after,.panel-body:before,.panel-body:after,.modal-footer:before,.modal-footer:after{display:table;content:" "}.clearfix:after,.dl-horizontal dd:after,.container:after,.container-fluid:after,.row:after,.form-horizontal .form-group:after,.btn-toolbar:after,.btn-group-vertical>.btn-group:after,.nav:after,.navbar:after,.navbar-header:after,.navbar-collapse:after,.pager:after,.panel-body:after,.modal-footer:after{clear:both}.center-block{display:block;margin-right:auto;margin-left:auto}.pull-right{float:right!important}.pull-left{float:left!important}.hide{display:none!important}.show{display:block!important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none!important;visibility:hidden!important}.affix{position:fixed;-webkit-transform:translate3d(0,0,0);-o-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}@-ms-viewport{width:device-width}.visible-xs,.visible-sm,.visible-md,.visible-lg{display:none!important}.visible-xs-block,.visible-xs-inline,.visible-xs-inline-block,.visible-sm-block,.visible-sm-inline,.visible-sm-inline-block,.visible-md-block,.visible-md-inline,.visible-md-inline-block,.visible-lg-block,.visible-lg-inline,.visible-lg-inline-block{display:none!important}@media (max-width:767px){.visible-xs{display:block!important}table.visible-xs{display:table}tr.visible-xs{display:table-row!important}th.visible-xs,td.visible-xs{display:table-cell!important}}@media (max-width:767px){.visible-xs-block{display:block!important}}@media (max-width:767px){.visible-xs-inline{display:inline!important}}@media (max-width:767px){.visible-xs-inline-block{display:inline-block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm{display:block!important}table.visible-sm{display:table}tr.visible-sm{display:table-row!important}th.visible-sm,td.visible-sm{display:table-cell!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-block{display:block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline{display:inline!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline-block{display:inline-block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md{display:block!important}table.visible-md{display:table}tr.visible-md{display:table-row!important}th.visible-md,td.visible-md{display:table-cell!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-block{display:block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline{display:inline!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline-block{display:inline-block!important}}@media (min-width:1200px){.visible-lg{display:block!important}table.visible-lg{display:table}tr.visible-lg{display:table-row!important}th.visible-lg,td.visible-lg{display:table-cell!important}}@media (min-width:1200px){.visible-lg-block{display:block!important}}@media (min-width:1200px){.visible-lg-inline{display:inline!important}}@media (min-width:1200px){.visible-lg-inline-block{display:inline-block!important}}@media (max-width:767px){.hidden-xs{display:none!important}}@media (min-width:768px) and (max-width:991px){.hidden-sm{display:none!important}}@media (min-width:992px) and (max-width:1199px){.hidden-md{display:none!important}}@media (min-width:1200px){.hidden-lg{display:none!important}}.visible-print{display:none!important}@media print{.visible-print{display:block!important}table.visible-print{display:table}tr.visible-print{display:table-row!important}th.visible-print,td.visible-print{display:table-cell!important}}.visible-print-block{display:none!important}@media print{.visible-print-block{display:block!important}}.visible-print-inline{display:none!important}@media print{.visible-print-inline{display:inline!important}}.visible-print-inline-block{display:none!important}@media print{.visible-print-inline-block{display:inline-block!important}}@media print{.hidden-print{display:none!important}}</style>
11 <meta content="Mnemonic code for generating deterministic keys" name="description"/>
12 <meta content="width=device-width, initial-scale=1.0" name="viewport" />
13 <meta content="bitcoin mnemonic converter" name="description" />
14 <meta content="Ian Coleman" name="author" />
15
16 <style>
17 body {
18 padding-bottom: 32px;
19 }
20 .form-control[readonly] {
21 cursor: text;
22 }
23 .feedback-container {
24 position: fixed;
25 top: 0;
26 width: 100%;
27 text-align: center;
28 z-index: 4;
29 }
30 .feedback {
31 display: table;
32 padding: 0.5em 1em;
33 background-color: orange;
34 margin: 0 auto;
35 font-size: 2em;
36 color: #444;
37 border: 2px solid #555;
38 border-top: 0;
39 border-bottom-left-radius: 20px 20px;
40 border-bottom-right-radius: 20px 20px;
41 }
42 .no-border {
43 border: 0;
44 box-shadow: inset 0 1px 1px rgba(0,0,0,.0);
45 -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.0);
46 }
47 .phrase {
48 word-break: keep-all;
49 }
50 .strength {
51 /* override mobile width from bootstrap */
52 width: auto!important;
53 display: inline-block;
54 }
55 .languages * {
56 padding-left: 10px;
57 }
58 .monospace {
59 font-family: monospace;
60 }
61 </style>
62 </head>
63 <body>
64 <div class="container">
65
66 <h1 class="text-center">Mnemonic Code Converter</h1>
67 <hr>
68 <div class="row">
69 <div class="col-md-12">
70 <h2>Mnemonic</h2>
71 <form class="form-horizontal" role="form">
72 <div class="col-sm-2"></div>
73 <div class="col-sm-10">
74 <p>You can enter an existing BIP39 mnemonic, or generate a new random one. Typing your own twelve words will probably not work how you expect, since the words require a particular structure (the last word is a checksum)</p>
75 <p>For more info see the <a href="https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki" target="_blank">BIP39 spec</a></p>
76 </div>
77 <div class="form-group">
78 <label class="col-sm-2 control-label"></label>
79 <div class="col-sm-10">
80 <div class="form-inline">
81 <div class="input-group-inline">
82 <button class="btn generate">Generate</button>
83 <span>a random</span>
84 <select id="strength" class="strength form-control">
85 <option value="3">3</option>
86 <option value="6">6</option>
87 <option value="9">9</option>
88 <option value="12">12</option>
89 <option value="15" selected>15</option>
90 <option value="18">18</option>
91 <option value="21">21</option>
92 <option value="24">24</option>
93 </select>
94 word mnemonic, or enter your own below.
95 </div>
96 </div>
97 </div>
98 </div>
99 <div class="form-group">
100 <label class="col-sm-2 control-label"></label>
101 <div class="col-sm-10 languages">
102 <a href="#english">English</a>
103 <a href="#japanese" title="Japanese">日本語</a>
104 <a href="#spanish" title="Spanish">Español</a>
105 <a href="#chinese_simplified" title="Chinese (Simplified)">中文(简体)</a>
106 <a href="#chinese_traditional" title="Chinese (Traditional)">中文(繁體)</a>
107 <a href="#french" title="French">Français</a>
108 <a href="#italian" title="Italian">Italiano</a>
109 </div>
110 </div>
111 <div class="form-group">
112 <label for="phrase" class="col-sm-2 control-label">BIP39 Mnemonic</label>
113 <div class="col-sm-10">
114 <textarea id="phrase" class="phrase form-control"></textarea>
115 </div>
116 </div>
117 <div class="form-group">
118 <label for="passphrase" class="col-sm-2 control-label">BIP39 Passphrase (optional)</label>
119 <div class="col-sm-10">
120 <textarea id="passphrase" class="passphrase form-control"></textarea>
121 </div>
122 </div>
123 <div class="form-group">
124 <label for="seed" class="col-sm-2 control-label">BIP39 Seed</label>
125 <div class="col-sm-10">
126 <textarea id="seed" class="seed form-control" readonly="readonly"></textarea>
127 </div>
128 </div>
129 <div class="form-group">
130 <label for="network-phrase" class="col-sm-2 control-label">Coin</label>
131 <div class="col-sm-10">
132 <select id="network-phrase" class="network form-control">
133 <!-- populated by javascript -->
134 </select>
135 </div>
136 </div>
137 <div class="form-group">
138 <label for="root-key" class="col-sm-2 control-label">BIP32 Root Key</label>
139 <div class="col-sm-10">
140 <textarea id="root-key" class="root-key form-control"></textarea>
141 </div>
142 </div>
143 </form>
144 </div>
145 </div>
146
147 <hr>
148
149 <div class="row">
150 <div class="col-md-12">
151 <h2>Derivation Path</h2>
152 <ul class="derivation-type nav nav-tabs" role="tablist">
153 <li id="bip44-tab" class="active">
154 <a href="#bip44" role="tab" data-toggle="tab">BIP44</a>
155 </li>
156 <li id="bip32-tab">
157 <a href="#bip32" role="tab" data-toggle="tab">BIP32</a>
158 </li>
159 </ul>
160 <div class="derivation-type tab-content">
161 <div id="bip44" class="tab-pane active">
162 <form class="form-horizontal" role="form">
163 <br>
164 <div class="col-sm-2"></div>
165 <div class="col-sm-10">
166 <p>For more info see the <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki" target="_blank">BIP44 spec</a></p>
167 </div>
168 <div class="form-group">
169 <label for="purpose" class="col-sm-2 control-label">
170 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#purpose" target="_blank">Purpose</a>
171 </label>
172 <div class="col-sm-10">
173 <input id="purpose" type="text" class="purpose form-control" value="44">
174 </div>
175 </div>
176 <div class="form-group">
177 <label for="coin" class="col-sm-2 control-label">
178 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#registered-coin-types" target="_blank">Coin</a>
179 </label>
180 <div class="col-sm-10">
181 <input id="coin" type="text" class="coin form-control" value="0">
182 </div>
183 </div>
184 <div class="form-group">
185 <label for="account" class="col-sm-2 control-label">
186 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#account" target="_blank">Account</a>
187 </label>
188 <div class="col-sm-10">
189 <input id="account" type="text" class="account form-control" value="0">
190 </div>
191 </div>
192 <div class="form-group">
193 <label for="change" class="col-sm-2 control-label">
194 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#change" target="_blank">External / Internal</a>
195 </label>
196 <div class="col-sm-10">
197 <input id="change" type="text" class="change form-control" value="0">
198 </div>
199 </div>
200 <div class="form-group">
201 <label for="bip44-path" class="col-sm-2 control-label">BIP32 Derivation Path</label>
202 <div class="col-sm-10">
203 <input id="bip44-path" type="text" class="path form-control" value="m/44'/0'/0'/0" readonly="readonly">
204 </div>
205 </div>
206 </form>
207 </div>
208 <div id="bip32" class="tab-pane">
209 <form class="form-horizontal" role="form">
210 <br>
211 <div class="col-sm-2"></div>
212 <div class="col-sm-10">
213 <p>For more info see the <a href="https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki" target="_blank">BIP32 spec</a></p>
214 </div>
215 <div class="form-group">
216 <label for="bip32-path" class="col-sm-2 control-label">BIP32 Derivation Path</label>
217 <div class="col-sm-10">
218 <input id="bip32-path" type="text" class="path form-control" value="m/0">
219 </div>
220 </div>
221 <div class="form-group">
222 <div class="col-sm-2"></div>
223 <label class="col-sm-10">
224 <input class="hardened-addresses" type="checkbox">
225 Use hardened addresses
226 </label>
227 </div>
228 <div class="form-group">
229 <label class="col-sm-2 control-label">Hive Wallet</label>
230 <div class="col-sm-10">
231 <p class="form-control no-border">
232 Use path <code>m/0'/0</code>.
233 For more info see the <a href="https://www.hivewallet.com/" target="_blank">Hive Wallet homepage</a>
234 </p>
235 </div>
236 </div>
237 <div class="form-group">
238 <label for="mycelium-path" class="col-sm-2 control-label">Mycelium Wallet</label>
239 <div class="col-sm-10">
240 <p class="form-control no-border">
241 Use path <code>m/44'/0'/0'/0</code>.
242 For more info see the <a href="http://www.mycelium.com/" target="_blank">Mycelium Wallet homepage</a>
243 </p>
244 </div>
245 </div>
246 <div class="form-group">
247 <label for="core-path" class="col-sm-2 control-label">Bitcoin Core</label>
248 <div class="col-sm-10">
249 <p class="form-control no-border">
250 Use path <code>m/0'/0'</code> with hardened addresses.
251 For more info see the <a href="https://github.com/bitcoin/bitcoin/pull/8035" target="_blank">Bitcoin Core BIP32 implementation</a>
252 </p>
253 </div>
254 </div>
255 <div class="form-group">
256 <label class="col-sm-2 control-label">Block Explorers</label>
257 <div class="col-sm-10">
258 <p class="form-control no-border">
259 Use path <code>m/44'/0'/0'</code>.
260 Only enter the <code>xpub</code> extended key into block explorer search fields, never the <code>xpriv</code> key.
261 </p>
262 </div>
263 </div>
264 </form>
265 </div>
266 </div>
267 <form class="form-horizontal" role="form">
268 <div class="form-group">
269 <label for="extended-priv-key" class="col-sm-2 control-label">BIP32 Extended Key</label>
270 <div class="col-sm-10">
271 <textarea id="extended-priv-key" class="extended-priv-key form-control" readonly="readonly"></textarea>
272 </div>
273 </div>
274 <div class="form-group">
275 <label for="extended-pub-key" class="col-sm-2 control-label">BIP32 Extended Key (addresses only)</label>
276 <div class="col-sm-10">
277 <textarea id="extended-pub-key" class="extended-pub-key form-control" readonly="readonly"></textarea>
278 </div>
279 </div>
280 </form>
281 </div>
282 </div>
283
284 <hr>
285
286 <div class="row">
287 <div class="col-md-12">
288 <h2>Derived Addresses</h2>
289 <p>Note these addreses are derived from the <strong>BIP32 Extended Key</strong></p>
290 <table class="table table-striped">
291 <thead>
292 <th>
293 <div class="input-group">
294 Path&nbsp;&nbsp;
295 <button class="index-toggle">Toggle</button>
296 </div>
297 </th>
298 <th>
299 <div class="input-group">
300 Address&nbsp;&nbsp;
301 <button class="address-toggle">Toggle</button>
302 </div>
303 </th>
304 <th>
305 <div class="input-group">
306 Public Key&nbsp;&nbsp;
307 <button class="public-key-toggle">Toggle</button>
308 </div>
309 </th>
310 <th>
311 <div class="input-group">
312 Private Key&nbsp;&nbsp;
313 <button class="private-key-toggle">Toggle</button>
314 </div>
315 </th>
316 </thead>
317 <tbody class="addresses monospace">
318 <tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
319 <tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
320 <tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
321 <tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
322 <tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
323 </tbody>
324 </table>
325 </div>
326 </div>
327 <span>Show next </button>
328 <input type="number" class="rows-to-add" value="20">
329 <button class="more">Show</button>
330
331 <hr>
332
333 <div class="row">
334 <div class="col-md-12">
335 <h2>More info</h2>
336 <h3>BIP39 <span class="small">Mnemonic code for generating deterministic keys</span></h3>
337 <p>
338 Read more at the
339 <a href="https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki">official BIP39 spec</a>
340 </p>
341 <h3>BIP32 <span class="small">Hierarchical Deterministic Wallets</span></h3>
342 <p>
343 Read more at the
344 <a href="https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki" target="_blank">official BIP32 spec</a>
345 and see the demo at
346 <a href="http://bip32.org/" target="_blank">bip32.org</a>
347 </p>
348 <h3>BIP44 <span class="small">Multi-Account Hierarchy for Deterministic Wallets</span></h3>
349 <p>
350 Read more at the
351 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki" target="_blank">official BIP44 spec</a>
352 </p>
353 <h3>Private Keys</h3>
354 <p>
355 Use private keys at
356 <a href="https://web.archive.org/web/20150707020924/https://brainwallet.org/" target="_blank">brainwallet.org</a>,
357 but be careful - it can be easy to make mistakes if you
358 don't know what you're doing
359 </p>
360 </div>
361 </div>
362
363 <hr>
364
365 <div class="row">
366 <div class="col-md-12">
367
368 <h2>Offline Usage</h2>
369
370 <p>
371 You can use this tool without having to be online.
372 </p>
373 <p>
374 In your browser, select file save-as, and save this page
375 as a file.
376 </p>
377 <p>
378 Double-click that file to open it in a browser
379 on any offline computer.
380 </p>
381 <p>
382 Alternatively, download it from
383 <a href="https://github.com/iancoleman/bip39">
384 https://github.com/iancoleman/bip39
385 </a>
386
387 </div>
388 </div>
389
390 <hr>
391
392 <div class="row">
393 <div class="col-md-12">
394
395 <h2>This project is 100% open-source code</h2>
396
397 <p>
398 <span>Get the source code at - </span>
399 <a href="https://github.com/iancoleman/bip39" target="_blank">
400 https://github.com/iancoleman/bip39
401 </a>
402 </p>
403
404 <h3>Libraries</h3>
405
406 <p>
407 <span>BitcoinJS - </span>
408 <a href="https://github.com/bitcoinjs/bitcoinjs-lib" target="_blank">
409 https://github.com/bitcoinjs/bitcoinjs-lib
410 </a>
411 </p>
412
413 <p>
414 <span>jsBIP39 - </span>
415 <a href="https://github.com/iancoleman/jsbip39" target="_blank">
416 https://github.com/iancoleman/jsbip39
417 </a>
418 </p>
419
420 <p>
421 <span>sjcl - </span>
422 <a href="https://github.com/bitwiseshiftleft/sjcl" target="_blank">
423 https://github.com/bitwiseshiftleft/sjcl
424 </a>
425 </p>
426
427 <p>
428 <span>jQuery - </span>
429 <a href="https://jquery.com/" target="_blank">
430 https://jquery.com/
431 </a>
432 </p>
433
434 <p>
435 <span>Twitter Bootstrap - </span>
436 <a href="http://getbootstrap.com/" target="_blank">
437 http://getbootstrap.com/
438 </a>
439 </p>
440
441 </div>
442 </div>
443
444 </div>
445
446 <div class="feedback-container">
447 <div class="feedback">Loading...</div>
448 </div>
449
450 <script type="text/template" id="address-row-template">
451 <tr>
452 <td class="index"><span></span></td>
453 <td class="address"><span></span></td>
454 <td class="pubkey"><span></span></td>
455 <td class="privkey"><span></span></td>
456 </tr>
457 </script>
458 <script>/*! jQuery v2.1.1 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */
459 !function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l=a.document,m="2.1.1",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){return!n.isArray(a)&&a-parseFloat(a)>=0},isPlainObject:function(a){return"object"!==n.type(a)||a.nodeType||n.isWindow(a)?!1:a.constructor&&!j.call(a.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=l.createElement("script"),b.text=a,l.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:g.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(e=d.call(arguments,2),f=function(){return a.apply(b||this,e.concat(d.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:k}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+-new Date,v=a.document,w=0,x=0,y=gb(),z=gb(),A=gb(),B=function(a,b){return a===b&&(l=!0),0},C="undefined",D=1<<31,E={}.hasOwnProperty,F=[],G=F.pop,H=F.push,I=F.push,J=F.slice,K=F.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},L="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",N="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=N.replace("w","w#"),P="\\["+M+"*("+N+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+O+"))|)"+M+"*\\]",Q=":("+N+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+P+")*)|.*)\\)|)",R=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),S=new RegExp("^"+M+"*,"+M+"*"),T=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),V=new RegExp(Q),W=new RegExp("^"+O+"$"),X={ID:new RegExp("^#("+N+")"),CLASS:new RegExp("^\\.("+N+")"),TAG:new RegExp("^("+N.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+Q),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("^(?:"+L+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ab=/[+~]/,bb=/'|\\/g,cb=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),db=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{I.apply(F=J.call(v.childNodes),v.childNodes),F[v.childNodes.length].nodeType}catch(eb){I={apply:F.length?function(a,b){H.apply(a,J.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fb(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],!a||"string"!=typeof a)return d;if(1!==(k=b.nodeType)&&9!==k)return[];if(p&&!e){if(f=_.exec(a))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return I.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return I.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=9===k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(bb,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+qb(o[l]);w=ab.test(a)&&ob(b.parentNode)||b,x=o.join(",")}if(x)try{return I.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function gb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function hb(a){return a[u]=!0,a}function ib(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function jb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function kb(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||D)-(~a.sourceIndex||D);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function lb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function mb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function nb(a){return hb(function(b){return b=+b,hb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function ob(a){return a&&typeof a.getElementsByTagName!==C&&a}c=fb.support={},f=fb.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fb.setDocument=function(a){var b,e=a?a.ownerDocument||a:v,g=e.defaultView;return e!==n&&9===e.nodeType&&e.documentElement?(n=e,o=e.documentElement,p=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){m()},!1):g.attachEvent&&g.attachEvent("onunload",function(){m()})),c.attributes=ib(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ib(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(e.getElementsByClassName)&&ib(function(a){return a.innerHTML="<div class='a'></div><div class='a i'></div>",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=ib(function(a){return o.appendChild(a).id=u,!e.getElementsByName||!e.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==C&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){var c=typeof a.getAttributeNode!==C&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==C?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==C&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(e.querySelectorAll))&&(ib(function(a){a.innerHTML="<select msallowclip=''><option selected=''></option></select>",a.querySelectorAll("[msallowclip^='']").length&&q.push("[*^$]="+M+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+M+"*(?:value|"+L+")"),a.querySelectorAll(":checked").length||q.push(":checked")}),ib(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+M+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ib(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",Q)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===v&&t(v,a)?-1:b===e||b.ownerDocument===v&&t(v,b)?1:k?K.call(k,a)-K.call(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],i=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:k?K.call(k,a)-K.call(k,b):0;if(f===g)return kb(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?kb(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},e):n},fb.matches=function(a,b){return fb(a,null,null,b)},fb.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fb(b,n,null,[a]).length>0},fb.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fb.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&E.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fb.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fb.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fb.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fb.selectors={cacheLength:50,createPseudo:hb,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(cb,db),a[3]=(a[3]||a[4]||a[5]||"").replace(cb,db),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fb.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fb.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(cb,db).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+M+")"+a+"("+M+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==C&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fb.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fb.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?hb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=K.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:hb(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?hb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:hb(function(a){return function(b){return fb(a,b).length>0}}),contains:hb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:hb(function(a){return W.test(a||"")||fb.error("unsupported lang: "+a),a=a.replace(cb,db).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:nb(function(){return[0]}),last:nb(function(a,b){return[b-1]}),eq:nb(function(a,b,c){return[0>c?c+b:c]}),even:nb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:nb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:nb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:nb(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=lb(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=mb(b);function pb(){}pb.prototype=d.filters=d.pseudos,d.setFilters=new pb,g=fb.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=S.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=T.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(R," ")}),h=h.slice(c.length));for(g in d.filter)!(e=X[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?fb.error(a):z(a,i).slice(0)};function qb(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function rb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function sb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function tb(a,b,c){for(var d=0,e=b.length;e>d;d++)fb(a,b[d],c);return c}function ub(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function vb(a,b,c,d,e,f){return d&&!d[u]&&(d=vb(d)),e&&!e[u]&&(e=vb(e,f)),hb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||tb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ub(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ub(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?K.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ub(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):I.apply(g,r)})}function wb(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=rb(function(a){return a===b},h,!0),l=rb(function(a){return K.call(b,a)>-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>i;i++)if(c=d.relative[a[i].type])m=[rb(sb(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return vb(i>1&&sb(m),i>1&&qb(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&wb(a.slice(i,e)),f>e&&wb(a=a.slice(e)),f>e&&qb(a))}m.push(c)}return sb(m)}function xb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=G.call(i));s=ub(s)}I.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&fb.uniqueSort(i)}return k&&(w=v,j=t),r};return c?hb(f):f}return h=fb.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wb(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xb(e,d)),f.selector=a}return f},i=fb.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(cb,db),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(cb,db),ab.test(j[0].type)&&ob(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qb(j),!a)return I.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,ab.test(a)&&ob(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ib(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ib(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||jb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ib(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||jb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ib(function(a){return null==a.getAttribute("disabled")})||jb(L,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fb}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return g.call(b,a)>=0!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:l,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}return d=l.getElementById(c[2]),d&&d.parentNode&&(this.length=1,this[0]=d),this.context=l,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};A.prototype=n.fn,y=n(l);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){return a?"string"==typeof a?g.call(n(a),this[0]):g.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(C[a]||n.unique(e),B.test(a)&&e.reverse()),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return n.each(a.match(E)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(b=a.memory&&l,c=!0,g=e||0,e=0,f=h.length,d=!0;h&&f>g;g++)if(h[g].apply(l[0],l[1])===!1&&a.stopOnFalse){b=!1;break}d=!1,h&&(i?i.length&&j(i.shift()):b?h=[]:k.disable())},k={add:function(){if(h){var c=h.length;!function g(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&g(c)})}(arguments),d?f=h.length:b&&(e=c,j(b))}return this},remove:function(){return h&&n.each(arguments,function(a,b){var c;while((c=n.inArray(b,h,c))>-1)h.splice(c,1),d&&(f>=c&&f--,g>=c&&g--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],f=0,this},disable:function(){return h=i=b=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,b||k.disable(),this},locked:function(){return!i},fireWith:function(a,b){return!h||c&&!i||(b=b||[],b=[a,b.slice?b.slice():b],d?i.push(b):j(b)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!c}};return k},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(H.resolveWith(l,[n]),n.fn.triggerHandler&&(n(l).triggerHandler("ready"),n(l).off("ready"))))}});function I(){l.removeEventListener("DOMContentLoaded",I,!1),a.removeEventListener("load",I,!1),n.ready()}n.ready.promise=function(b){return H||(H=n.Deferred(),"complete"===l.readyState?setTimeout(n.ready):(l.addEventListener("DOMContentLoaded",I,!1),a.addEventListener("load",I,!1))),H.promise(b)},n.ready.promise();var J=n.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)n.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f};n.acceptData=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function K(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=n.expando+Math.random()}K.uid=1,K.accepts=n.acceptData,K.prototype={key:function(a){if(!K.accepts(a))return 0;var b={},c=a[this.expando];if(!c){c=K.uid++;try{b[this.expando]={value:c},Object.defineProperties(a,b)}catch(d){b[this.expando]=c,n.extend(a,b)}}return this.cache[c]||(this.cache[c]={}),c},set:function(a,b,c){var d,e=this.key(a),f=this.cache[e];if("string"==typeof b)f[b]=c;else if(n.isEmptyObject(f))n.extend(this.cache[e],b);else for(d in b)f[d]=b[d];return f},get:function(a,b){var c=this.cache[this.key(a)];return void 0===b?c:c[b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=this.key(a),g=this.cache[f];if(void 0===b)this.cache[f]={};else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in g?d=[b,e]:(d=e,d=d in g?[d]:d.match(E)||[])),c=d.length;while(c--)delete g[d[c]]}},hasData:function(a){return!n.isEmptyObject(this.cache[a[this.expando]]||{})},discard:function(a){a[this.expando]&&delete this.cache[a[this.expando]]}};var L=new K,M=new K,N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(O,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}M.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return M.hasData(a)||L.hasData(a)},data:function(a,b,c){return M.access(a,b,c)},removeData:function(a,b){M.remove(a,b)
460 },_data:function(a,b,c){return L.access(a,b,c)},_removeData:function(a,b){L.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=M.get(f),1===f.nodeType&&!L.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));L.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){M.set(this,a)}):J(this,function(b){var c,d=n.camelCase(a);if(f&&void 0===b){if(c=M.get(f,a),void 0!==c)return c;if(c=M.get(f,d),void 0!==c)return c;if(c=P(f,d,void 0),void 0!==c)return c}else this.each(function(){var c=M.get(this,d);M.set(this,d,b),-1!==a.indexOf("-")&&void 0!==c&&M.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){M.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=L.get(a,b),c&&(!d||n.isArray(c)?d=L.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return L.get(a,c)||L.access(a,c,{empty:n.Callbacks("once memory").add(function(){L.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?n.queue(this[0],a):void 0===b?this:this.each(function(){var c=n.queue(this,a,b);n._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&n.dequeue(this,a)})},dequeue:function(a){return this.each(function(){n.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=n.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=L.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var Q=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,R=["Top","Right","Bottom","Left"],S=function(a,b){return a=b||a,"none"===n.css(a,"display")||!n.contains(a.ownerDocument,a)},T=/^(?:checkbox|radio)$/i;!function(){var a=l.createDocumentFragment(),b=a.appendChild(l.createElement("div")),c=l.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="<textarea>x</textarea>",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var U="undefined";k.focusinBubbles="onfocusin"in a;var V=/^key/,W=/^(?:mouse|pointer|contextmenu)|click/,X=/^(?:focusinfocus|focusoutblur)$/,Y=/^([^.]*)(?:\.(.+)|)$/;function Z(){return!0}function $(){return!1}function _(){try{return l.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return typeof n!==U&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(E)||[""],j=b.length;while(j--)h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g,!1)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.hasData(a)&&L.get(a);if(r&&(i=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&(delete r.handle,L.remove(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,m,o,p=[d||l],q=j.call(b,"type")?b.type:b,r=j.call(b,"namespace")?b.namespace.split("."):[];if(g=h=d=d||l,3!==d.nodeType&&8!==d.nodeType&&!X.test(q+n.event.triggered)&&(q.indexOf(".")>=0&&(r=q.split("."),q=r.shift(),r.sort()),k=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=r.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),o=n.event.special[q]||{},e||!o.trigger||o.trigger.apply(d,c)!==!1)){if(!e&&!o.noBubble&&!n.isWindow(d)){for(i=o.delegateType||q,X.test(i+q)||(g=g.parentNode);g;g=g.parentNode)p.push(g),h=g;h===(d.ownerDocument||l)&&p.push(h.defaultView||h.parentWindow||a)}f=0;while((g=p[f++])&&!b.isPropagationStopped())b.type=f>1?i:o.bindType||q,m=(L.get(g,"events")||{})[b.type]&&L.get(g,"handle"),m&&m.apply(g,c),m=k&&g[k],m&&m.apply&&n.acceptData(g)&&(b.result=m.apply(g,c),b.result===!1&&b.preventDefault());return b.type=q,e||b.isDefaultPrevented()||o._default&&o._default.apply(p.pop(),c)!==!1||!n.acceptData(d)||k&&n.isFunction(d[q])&&!n.isWindow(d)&&(h=d[k],h&&(d[k]=null),n.event.triggered=q,d[q](),n.event.triggered=void 0,h&&(d[k]=h)),b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(L.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(g.namespace))&&(a.handleObj=g,a.data=g.data,e=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(a.result=e)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!==this;i=i.parentNode||this)if(i.disabled!==!0||"click"!==a.type){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>=0:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button;return null==a.pageX&&null!=b.clientX&&(c=a.target.ownerDocument||l,d=c.documentElement,e=c.body,a.pageX=b.clientX+(d&&d.scrollLeft||e&&e.scrollLeft||0)-(d&&d.clientLeft||e&&e.clientLeft||0),a.pageY=b.clientY+(d&&d.scrollTop||e&&e.scrollTop||0)-(d&&d.clientTop||e&&e.clientTop||0)),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},fix:function(a){if(a[n.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=W.test(e)?this.mouseHooks:V.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new n.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=l),3===a.target.nodeType&&(a.target=a.target.parentNode),g.filter?g.filter(a,f):a},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==_()&&this.focus?(this.focus(),!1):void 0},delegateType:"focusin"},blur:{trigger:function(){return this===_()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&n.nodeName(this,"input")?(this.click(),!1):void 0},_default:function(a){return n.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=n.extend(new n.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?n.event.trigger(e,null,b):n.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},n.removeEvent=function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)},n.Event=function(a,b){return this instanceof n.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?Z:$):this.type=a,b&&n.extend(this,b),this.timeStamp=a&&a.timeStamp||n.now(),void(this[n.expando]=!0)):new n.Event(a,b)},n.Event.prototype={isDefaultPrevented:$,isPropagationStopped:$,isImmediatePropagationStopped:$,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=Z,a&&a.preventDefault&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=Z,a&&a.stopPropagation&&a.stopPropagation()},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=Z,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},n.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){n.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!n.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),k.focusinBubbles||n.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){n.event.simulate(b,a.target,n.event.fix(a),!0)};n.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=L.access(d,b);e||d.addEventListener(a,c,!0),L.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=L.access(d,b)-1;e?L.access(d,b,e):(d.removeEventListener(a,c,!0),L.remove(d,b))}}}),n.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(g in a)this.on(g,b,c,a[g],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=$;else if(!d)return this;return 1===e&&(f=d,d=function(a){return n().off(a),f.apply(this,arguments)},d.guid=f.guid||(f.guid=n.guid++)),this.each(function(){n.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,n(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=$),this.each(function(){n.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){n.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?n.event.trigger(a,b,c,!0):void 0}});var ab=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bb=/<([\w:]+)/,cb=/<|&#?\w+;/,db=/<(?:script|style|link)/i,eb=/checked\s*(?:[^=]|=\s*.checked.)/i,fb=/^$|\/(?:java|ecma)script/i,gb=/^true\/(.*)/,hb=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,ib={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};ib.optgroup=ib.option,ib.tbody=ib.tfoot=ib.colgroup=ib.caption=ib.thead,ib.th=ib.td;function jb(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function kb(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function lb(a){var b=gb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function mb(a,b){for(var c=0,d=a.length;d>c;c++)L.set(a[c],"globalEval",!b||L.get(b[c],"globalEval"))}function nb(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(L.hasData(a)&&(f=L.access(a),g=L.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}M.hasData(a)&&(h=M.access(a),i=n.extend({},h),M.set(b,i))}}function ob(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function pb(a,b){var c=b.nodeName.toLowerCase();"input"===c&&T.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}n.extend({clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=ob(h),f=ob(a),d=0,e=f.length;e>d;d++)pb(f[d],g[d]);if(b)if(c)for(f=f||ob(a),g=g||ob(h),d=0,e=f.length;e>d;d++)nb(f[d],g[d]);else nb(a,h);return g=ob(h,"script"),g.length>0&&mb(g,!i&&ob(a,"script")),h},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k=b.createDocumentFragment(),l=[],m=0,o=a.length;o>m;m++)if(e=a[m],e||0===e)if("object"===n.type(e))n.merge(l,e.nodeType?[e]:e);else if(cb.test(e)){f=f||k.appendChild(b.createElement("div")),g=(bb.exec(e)||["",""])[1].toLowerCase(),h=ib[g]||ib._default,f.innerHTML=h[1]+e.replace(ab,"<$1></$2>")+h[2],j=h[0];while(j--)f=f.lastChild;n.merge(l,f.childNodes),f=k.firstChild,f.textContent=""}else l.push(b.createTextNode(e));k.textContent="",m=0;while(e=l[m++])if((!d||-1===n.inArray(e,d))&&(i=n.contains(e.ownerDocument,e),f=ob(k.appendChild(e),"script"),i&&mb(f),c)){j=0;while(e=f[j++])fb.test(e.type||"")&&c.push(e)}return k},cleanData:function(a){for(var b,c,d,e,f=n.event.special,g=0;void 0!==(c=a[g]);g++){if(n.acceptData(c)&&(e=c[L.expando],e&&(b=L.cache[e]))){if(b.events)for(d in b.events)f[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);L.cache[e]&&delete L.cache[e]}delete M.cache[c[M.expando]]}}}),n.fn.extend({text:function(a){return J(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=a)})},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=jb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=jb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(ob(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&mb(ob(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(ob(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return J(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!db.test(a)&&!ib[(bb.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(ab,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(ob(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(ob(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,m=this,o=l-1,p=a[0],q=n.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&eb.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(c=n.buildFragment(a,this[0].ownerDocument,!1,this),d=c.firstChild,1===c.childNodes.length&&(c=d),d)){for(f=n.map(ob(c,"script"),kb),g=f.length;l>j;j++)h=c,j!==o&&(h=n.clone(h,!0,!0),g&&n.merge(f,ob(h,"script"))),b.call(this[j],h,j);if(g)for(i=f[f.length-1].ownerDocument,n.map(f,lb),j=0;g>j;j++)h=f[j],fb.test(h.type||"")&&!L.access(h,"globalEval")&&n.contains(i,h)&&(h.src?n._evalUrl&&n._evalUrl(h.src):n.globalEval(h.textContent.replace(hb,"")))}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),g=e.length-1,h=0;g>=h;h++)c=h===g?this:this.clone(!0),n(e[h])[b](c),f.apply(d,c.get());return this.pushStack(d)}});var qb,rb={};function sb(b,c){var d,e=n(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:n.css(e[0],"display");return e.detach(),f}function tb(a){var b=l,c=rb[a];return c||(c=sb(a,b),"none"!==c&&c||(qb=(qb||n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=qb[0].contentDocument,b.write(),b.close(),c=sb(a,b),qb.detach()),rb[a]=c),c}var ub=/^margin/,vb=new RegExp("^("+Q+")(?!px)[a-z%]+$","i"),wb=function(a){return a.ownerDocument.defaultView.getComputedStyle(a,null)};function xb(a,b,c){var d,e,f,g,h=a.style;return c=c||wb(a),c&&(g=c.getPropertyValue(b)||c[b]),c&&(""!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),vb.test(g)&&ub.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0!==g?g+"":g}function yb(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d=l.documentElement,e=l.createElement("div"),f=l.createElement("div");if(f.style){f.style.backgroundClip="content-box",f.cloneNode(!0).style.backgroundClip="",k.clearCloneStyle="content-box"===f.style.backgroundClip,e.style.cssText="border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;position:absolute",e.appendChild(f);function g(){f.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",f.innerHTML="",d.appendChild(e);var g=a.getComputedStyle(f,null);b="1%"!==g.top,c="4px"===g.width,d.removeChild(e)}a.getComputedStyle&&n.extend(k,{pixelPosition:function(){return g(),b},boxSizingReliable:function(){return null==c&&g(),c},reliableMarginRight:function(){var b,c=f.appendChild(l.createElement("div"));return c.style.cssText=f.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",c.style.marginRight=c.style.width="0",f.style.width="1px",d.appendChild(e),b=!parseFloat(a.getComputedStyle(c,null).marginRight),d.removeChild(e),b}})}}(),n.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var zb=/^(none|table(?!-c[ea]).+)/,Ab=new RegExp("^("+Q+")(.*)$","i"),Bb=new RegExp("^([+-])=("+Q+")","i"),Cb={position:"absolute",visibility:"hidden",display:"block"},Db={letterSpacing:"0",fontWeight:"400"},Eb=["Webkit","O","Moz","ms"];function Fb(a,b){if(b in a)return b;var c=b[0].toUpperCase()+b.slice(1),d=b,e=Eb.length;while(e--)if(b=Eb[e]+c,b in a)return b;return d}function Gb(a,b,c){var d=Ab.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Hb(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=n.css(a,c+R[f],!0,e)),d?("content"===c&&(g-=n.css(a,"padding"+R[f],!0,e)),"margin"!==c&&(g-=n.css(a,"border"+R[f]+"Width",!0,e))):(g+=n.css(a,"padding"+R[f],!0,e),"padding"!==c&&(g+=n.css(a,"border"+R[f]+"Width",!0,e)));return g}function Ib(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=wb(a),g="border-box"===n.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=xb(a,b,f),(0>e||null==e)&&(e=a.style[b]),vb.test(e))return e;d=g&&(k.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Hb(a,b,c||(g?"border":"content"),d,f)+"px"}function Jb(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=L.get(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&S(d)&&(f[g]=L.access(d,"olddisplay",tb(d.nodeName)))):(e=S(d),"none"===c&&e||L.set(d,"olddisplay",e?c:n.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}n.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=xb(a,"opacity");return""===c?"1":c}}}},cssNumber:{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:{"float":"cssFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=n.camelCase(b),i=a.style;return b=n.cssProps[h]||(n.cssProps[h]=Fb(i,h)),g=n.cssHooks[b]||n.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b]:(f=typeof c,"string"===f&&(e=Bb.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(n.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||n.cssNumber[h]||(c+="px"),k.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i[b]=c)),void 0)}},css:function(a,b,c,d){var e,f,g,h=n.camelCase(b);return b=n.cssProps[h]||(n.cssProps[h]=Fb(a.style,h)),g=n.cssHooks[b]||n.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=xb(a,b,d)),"normal"===e&&b in Db&&(e=Db[b]),""===c||c?(f=parseFloat(e),c===!0||n.isNumeric(f)?f||0:e):e}}),n.each(["height","width"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?zb.test(n.css(a,"display"))&&0===a.offsetWidth?n.swap(a,Cb,function(){return Ib(a,b,d)}):Ib(a,b,d):void 0},set:function(a,c,d){var e=d&&wb(a);return Gb(a,c,d?Hb(a,b,d,"border-box"===n.css(a,"boxSizing",!1,e),e):0)}}}),n.cssHooks.marginRight=yb(k.reliableMarginRight,function(a,b){return b?n.swap(a,{display:"inline-block"},xb,[a,"marginRight"]):void 0}),n.each({margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+R[d]+b]=f[d]||f[d-2]||f[0];return e}},ub.test(a)||(n.cssHooks[a+b].set=Gb)}),n.fn.extend({css:function(a,b){return J(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=wb(a),e=b.length;e>g;g++)f[b[g]]=n.css(a,b[g],!1,d);return f}return void 0!==c?n.style(a,b,c):n.css(a,b)},a,b,arguments.length>1)},show:function(){return Jb(this,!0)},hide:function(){return Jb(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){S(this)?n(this).show():n(this).hide()})}});function Kb(a,b,c,d,e){return new Kb.prototype.init(a,b,c,d,e)}n.Tween=Kb,Kb.prototype={constructor:Kb,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=Kb.propHooks[this.prop];return a&&a.get?a.get(this):Kb.propHooks._default.get(this)},run:function(a){var b,c=Kb.propHooks[this.prop];return this.pos=b=this.options.duration?n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Kb.propHooks._default.set(this),this}},Kb.prototype.init.prototype=Kb.prototype,Kb.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[n.cssProps[a.prop]]||n.cssHooks[a.prop])?n.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Kb.propHooks.scrollTop=Kb.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},n.fx=Kb.prototype.init,n.fx.step={};var Lb,Mb,Nb=/^(?:toggle|show|hide)$/,Ob=new RegExp("^(?:([+-])=|)("+Q+")([a-z%]*)$","i"),Pb=/queueHooks$/,Qb=[Vb],Rb={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=Ob.exec(b),f=e&&e[3]||(n.cssNumber[a]?"":"px"),g=(n.cssNumber[a]||"px"!==f&&+d)&&Ob.exec(n.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,n.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function Sb(){return setTimeout(function(){Lb=void 0}),Lb=n.now()}function Tb(a,b){var c,d=0,e={height:a};for(b=b?1:0;4>d;d+=2-b)c=R[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function Ub(a,b,c){for(var d,e=(Rb[b]||[]).concat(Rb["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function Vb(a,b,c){var d,e,f,g,h,i,j,k,l=this,m={},o=a.style,p=a.nodeType&&S(a),q=L.get(a,"fxshow");c.queue||(h=n._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,l.always(function(){l.always(function(){h.unqueued--,n.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[o.overflow,o.overflowX,o.overflowY],j=n.css(a,"display"),k="none"===j?L.get(a,"olddisplay")||tb(a.nodeName):j,"inline"===k&&"none"===n.css(a,"float")&&(o.display="inline-block")),c.overflow&&(o.overflow="hidden",l.always(function(){o.overflow=c.overflow[0],o.overflowX=c.overflow[1],o.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],Nb.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(p?"hide":"show")){if("show"!==e||!q||void 0===q[d])continue;p=!0}m[d]=q&&q[d]||n.style(a,d)}else j=void 0;if(n.isEmptyObject(m))"inline"===("none"===j?tb(a.nodeName):j)&&(o.display=j);else{q?"hidden"in q&&(p=q.hidden):q=L.access(a,"fxshow",{}),f&&(q.hidden=!p),p?n(a).show():l.done(function(){n(a).hide()}),l.done(function(){var b;L.remove(a,"fxshow");for(b in m)n.style(a,b,m[b])});for(d in m)g=Ub(p?q[d]:0,d,l),d in q||(q[d]=g.start,p&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function Wb(a,b){var c,d,e,f,g;for(c in a)if(d=n.camelCase(c),e=b[d],f=a[c],n.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=n.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function Xb(a,b,c){var d,e,f=0,g=Qb.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=Lb||Sb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:n.extend({},b),opts:n.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:Lb||Sb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=n.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(Wb(k,j.opts.specialEasing);g>f;f++)if(d=Qb[f].call(j,a,k,j.opts))return d;return n.map(k,Ub,j),n.isFunction(j.opts.start)&&j.opts.start.call(a,j),n.fx.timer(n.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}n.Animation=n.extend(Xb,{tweener:function(a,b){n.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],Rb[c]=Rb[c]||[],Rb[c].unshift(b)},prefilter:function(a,b){b?Qb.unshift(a):Qb.push(a)}}),n.speed=function(a,b,c){var d=a&&"object"==typeof a?n.extend({},a):{complete:c||!c&&b||n.isFunction(a)&&a,duration:a,easing:c&&b||b&&!n.isFunction(b)&&b};return d.duration=n.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in n.fx.speeds?n.fx.speeds[d.duration]:n.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){n.isFunction(d.old)&&d.old.call(this),d.queue&&n.dequeue(this,d.queue)},d},n.fn.extend({fadeTo:function(a,b,c,d){return this.filter(S).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=n.isEmptyObject(a),f=n.speed(b,c,d),g=function(){var b=Xb(this,n.extend({},a),f);(e||L.get(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=n.timers,g=L.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&Pb.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&n.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=L.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=n.timers,g=d?d.length:0;for(c.finish=!0,n.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),n.each(["toggle","show","hide"],function(a,b){var c=n.fn[b];n.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(Tb(b,!0),a,d,e)}}),n.each({slideDown:Tb("show"),slideUp:Tb("hide"),slideToggle:Tb("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){n.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),n.timers=[],n.fx.tick=function(){var a,b=0,c=n.timers;for(Lb=n.now();b<c.length;b++)a=c[b],a()||c[b]!==a||c.splice(b--,1);c.length||n.fx.stop(),Lb=void 0},n.fx.timer=function(a){n.timers.push(a),a()?n.fx.start():n.timers.pop()},n.fx.interval=13,n.fx.start=function(){Mb||(Mb=setInterval(n.fx.tick,n.fx.interval))},n.fx.stop=function(){clearInterval(Mb),Mb=null},n.fx.speeds={slow:600,fast:200,_default:400},n.fn.delay=function(a,b){return a=n.fx?n.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a=l.createElement("input"),b=l.createElement("select"),c=b.appendChild(l.createElement("option"));a.type="checkbox",k.checkOn=""!==a.value,k.optSelected=c.selected,b.disabled=!0,k.optDisabled=!c.disabled,a=l.createElement("input"),a.value="t",a.type="radio",k.radioValue="t"===a.value}();var Yb,Zb,$b=n.expr.attrHandle;n.fn.extend({attr:function(a,b){return J(this,n.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}}),n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===U?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),d=n.attrHooks[b]||(n.expr.match.bool.test(b)?Zb:Yb)),void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=n.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void n.removeAttr(a,b))
461 },removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(E);if(f&&1===a.nodeType)while(c=f[e++])d=n.propFix[c]||c,n.expr.match.bool.test(c)&&(a[d]=!1),a.removeAttribute(c)},attrHooks:{type:{set:function(a,b){if(!k.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),Zb={set:function(a,b,c){return b===!1?n.removeAttr(a,c):a.setAttribute(c,c),c}},n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=$b[b]||n.find.attr;$b[b]=function(a,b,d){var e,f;return d||(f=$b[b],$b[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,$b[b]=f),e}});var _b=/^(?:input|select|textarea|button)$/i;n.fn.extend({prop:function(a,b){return J(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[n.propFix[a]||a]})}}),n.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!n.isXMLDoc(a),f&&(b=n.propFix[b]||b,e=n.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){return a.hasAttribute("tabindex")||_b.test(a.nodeName)||a.href?a.tabIndex:-1}}}}),k.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this});var ac=/[\t\r\n\f]/g;n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h="string"==typeof a&&a,i=0,j=this.length;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,this.className))});if(h)for(b=(a||"").match(E)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ac," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=n.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0===arguments.length||"string"==typeof a&&a,i=0,j=this.length;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,this.className))});if(h)for(b=(a||"").match(E)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ac," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?n.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(n.isFunction(a)?function(c){n(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=n(this),f=a.match(E)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===U||"boolean"===c)&&(this.className&&L.set(this,"__className__",this.className),this.className=this.className||a===!1?"":L.get(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(ac," ").indexOf(b)>=0)return!0;return!1}});var bc=/\r/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e="":"number"==typeof e?e+="":n.isArray(e)&&(e=n.map(e,function(a){return null==a?"":a+""})),b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(bc,""):null==c?"":c)}}}),n.extend({valHooks:{option:{get:function(a){var b=n.find.attr(a,"value");return null!=b?b:n.trim(n.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(k.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&n.nodeName(c.parentNode,"optgroup"))){if(b=n(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=n.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=n.inArray(d.value,f)>=0)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){return n.isArray(b)?a.checked=n.inArray(n(a).val(),b)>=0:void 0}},k.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})}),n.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var cc=n.now(),dc=/\?/;n.parseJSON=function(a){return JSON.parse(a+"")},n.parseXML=function(a){var b,c;if(!a||"string"!=typeof a)return null;try{c=new DOMParser,b=c.parseFromString(a,"text/xml")}catch(d){b=void 0}return(!b||b.getElementsByTagName("parsererror").length)&&n.error("Invalid XML: "+a),b};var ec,fc,gc=/#.*$/,hc=/([?&])_=[^&]*/,ic=/^(.*?):[ \t]*([^\r\n]*)$/gm,jc=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,kc=/^(?:GET|HEAD)$/,lc=/^\/\//,mc=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,nc={},oc={},pc="*/".concat("*");try{fc=location.href}catch(qc){fc=l.createElement("a"),fc.href="",fc=fc.href}ec=mc.exec(fc.toLowerCase())||[];function rc(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(E)||[];if(n.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function sc(a,b,c,d){var e={},f=a===oc;function g(h){var i;return e[h]=!0,n.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function tc(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&n.extend(!0,a,d),a}function uc(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function vc(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:fc,type:"GET",isLocal:jc.test(ec[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":pc,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":n.parseJSON,"text xml":n.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?tc(tc(a,n.ajaxSettings),b):tc(n.ajaxSettings,a)},ajaxPrefilter:rc(nc),ajaxTransport:rc(oc),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=n.ajaxSetup({},b),l=k.context||k,m=k.context&&(l.nodeType||l.jquery)?n(l):n.event,o=n.Deferred(),p=n.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!f){f={};while(b=ic.exec(e))f[b[1].toLowerCase()]=b[2]}b=f[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?e:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return c&&c.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||fc)+"").replace(gc,"").replace(lc,ec[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=n.trim(k.dataType||"*").toLowerCase().match(E)||[""],null==k.crossDomain&&(h=mc.exec(k.url.toLowerCase()),k.crossDomain=!(!h||h[1]===ec[1]&&h[2]===ec[2]&&(h[3]||("http:"===h[1]?"80":"443"))===(ec[3]||("http:"===ec[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=n.param(k.data,k.traditional)),sc(nc,k,b,v),2===t)return v;i=k.global,i&&0===n.active++&&n.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!kc.test(k.type),d=k.url,k.hasContent||(k.data&&(d=k.url+=(dc.test(d)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=hc.test(d)?d.replace(hc,"$1_="+cc++):d+(dc.test(d)?"&":"?")+"_="+cc++)),k.ifModified&&(n.lastModified[d]&&v.setRequestHeader("If-Modified-Since",n.lastModified[d]),n.etag[d]&&v.setRequestHeader("If-None-Match",n.etag[d])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+pc+"; q=0.01":""):k.accepts["*"]);for(j in k.headers)v.setRequestHeader(j,k.headers[j]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(j in{success:1,error:1,complete:1})v[j](k[j]);if(c=sc(oc,k,b,v)){v.readyState=1,i&&m.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,c.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,f,h){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),c=void 0,e=h||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,f&&(u=uc(k,v,f)),u=vc(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(n.lastModified[d]=w),w=v.getResponseHeader("etag"),w&&(n.etag[d]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,i&&m.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),i&&(m.trigger("ajaxComplete",[v,k]),--n.active||n.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,void 0,b,"script")}}),n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){return n.isFunction(c)&&(e=e||d,d=c,c=void 0),n.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),n.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}}),n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},n.fn.extend({wrapAll:function(a){var b;return n.isFunction(a)?this.each(function(b){n(this).wrapAll(a.call(this,b))}):(this[0]&&(b=n(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this)},wrapInner:function(a){return this.each(n.isFunction(a)?function(b){n(this).wrapInner(a.call(this,b))}:function(){var b=n(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,"body")||n(this).replaceWith(this.childNodes)}).end()}}),n.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0},n.expr.filters.visible=function(a){return!n.expr.filters.hidden(a)};var wc=/%20/g,xc=/\[\]$/,yc=/\r?\n/g,zc=/^(?:submit|button|image|reset|file)$/i,Ac=/^(?:input|select|textarea|keygen)/i;function Bc(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||xc.test(a)?d(a,e):Bc(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)Bc(a+"["+e+"]",b[e],c,d)}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(a)||a.jquery&&!n.isPlainObject(a))n.each(a,function(){e(this.name,this.value)});else for(c in a)Bc(c,a[c],b,e);return d.join("&").replace(wc,"+")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,"elements");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(":disabled")&&Ac.test(this.nodeName)&&!zc.test(a)&&(this.checked||!T.test(a))}).map(function(a,b){var c=n(this).val();return null==c?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(yc,"\r\n")}}):{name:b.name,value:c.replace(yc,"\r\n")}}).get()}}),n.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(a){}};var Cc=0,Dc={},Ec={0:200,1223:204},Fc=n.ajaxSettings.xhr();a.ActiveXObject&&n(a).on("unload",function(){for(var a in Dc)Dc[a]()}),k.cors=!!Fc&&"withCredentials"in Fc,k.ajax=Fc=!!Fc,n.ajaxTransport(function(a){var b;return k.cors||Fc&&!a.crossDomain?{send:function(c,d){var e,f=a.xhr(),g=++Cc;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)f.setRequestHeader(e,c[e]);b=function(a){return function(){b&&(delete Dc[g],b=f.onload=f.onerror=null,"abort"===a?f.abort():"error"===a?d(f.status,f.statusText):d(Ec[f.status]||f.status,f.statusText,"string"==typeof f.responseText?{text:f.responseText}:void 0,f.getAllResponseHeaders()))}},f.onload=b(),f.onerror=b("error"),b=Dc[g]=b("abort");try{f.send(a.hasContent&&a.data||null)}catch(h){if(b)throw h}},abort:function(){b&&b()}}:void 0}),n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return n.globalEval(a),a}}}),n.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),n.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(d,e){b=n("<script>").prop({async:!0,charset:a.scriptCharset,src:a.url}).on("load error",c=function(a){b.remove(),c=null,a&&e("error"===a.type?404:200,a.type)}),l.head.appendChild(b[0])},abort:function(){c&&c()}}}});var Gc=[],Hc=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Gc.pop()||n.expando+"_"+cc++;return this[a]=!0,a}}),n.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(Hc.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&Hc.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=n.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(Hc,"$1"+e):b.jsonp!==!1&&(b.url+=(dc.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||n.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,Gc.push(e)),g&&n.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),n.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||l;var d=v.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=n.buildFragment([a],b,e),e&&e.length&&n(e).remove(),n.merge([],d.childNodes))};var Ic=n.fn.load;n.fn.load=function(a,b,c){if("string"!=typeof a&&Ic)return Ic.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=n.trim(a.slice(h)),a=a.slice(0,h)),n.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&n.ajax({url:a,type:e,dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?n("<div>").append(n.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,f||[a.responseText,b,a])}),this},n.expr.filters.animated=function(a){return n.grep(n.timers,function(b){return a===b.elem}).length};var Jc=a.document.documentElement;function Kc(a){return n.isWindow(a)?a:9===a.nodeType&&a.defaultView}n.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=n.css(a,"position"),l=n(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=n.css(a,"top"),i=n.css(a,"left"),j=("absolute"===k||"fixed"===k)&&(f+i).indexOf("auto")>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),n.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},n.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){n.offset.setOffset(this,a,b)});var b,c,d=this[0],e={top:0,left:0},f=d&&d.ownerDocument;if(f)return b=f.documentElement,n.contains(b,d)?(typeof d.getBoundingClientRect!==U&&(e=d.getBoundingClientRect()),c=Kc(f),{top:e.top+c.pageYOffset-b.clientTop,left:e.left+c.pageXOffset-b.clientLeft}):e},position:function(){if(this[0]){var a,b,c=this[0],d={top:0,left:0};return"fixed"===n.css(c,"position")?b=c.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),n.nodeName(a[0],"html")||(d=a.offset()),d.top+=n.css(a[0],"borderTopWidth",!0),d.left+=n.css(a[0],"borderLeftWidth",!0)),{top:b.top-d.top-n.css(c,"marginTop",!0),left:b.left-d.left-n.css(c,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||Jc;while(a&&!n.nodeName(a,"html")&&"static"===n.css(a,"position"))a=a.offsetParent;return a||Jc})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(b,c){var d="pageYOffset"===c;n.fn[b]=function(e){return J(this,function(b,e,f){var g=Kc(b);return void 0===f?g?g[c]:b[e]:void(g?g.scrollTo(d?a.pageXOffset:f,d?f:a.pageYOffset):b[e]=f)},b,e,arguments.length,null)}}),n.each(["top","left"],function(a,b){n.cssHooks[b]=yb(k.pixelPosition,function(a,c){return c?(c=xb(a,b),vb.test(c)?n(a).position()[b]+"px":c):void 0})}),n.each({Height:"height",Width:"width"},function(a,b){n.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return J(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.size=function(){return this.length},n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var Lc=a.jQuery,Mc=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=Mc),b&&a.jQuery===n&&(a.jQuery=Lc),n},typeof b===U&&(a.jQuery=a.$=n),n});
462 </script>
463 <script>/*!
464 * Bootstrap v3.2.0 (http://getbootstrap.com)
465 * Copyright 2011-2014 Twitter, Inc.
466 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
467 */
468 if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.2.0",d.prototype.close=function(b){function c(){f.detach().trigger("closed.bs.alert").remove()}var d=a(this),e=d.attr("data-target");e||(e=d.attr("href"),e=e&&e.replace(/.*(?=#[^\s]*$)/,""));var f=a(e);b&&b.preventDefault(),f.length||(f=d.hasClass("alert")?d:d.parent()),f.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one("bsTransitionEnd",c).emulateTransitionEnd(150):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.2.0",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),d[e](null==f[b]?this.options[b]:f[b]),setTimeout(a.proxy(function(){"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")&&(c.prop("checked")&&this.$element.hasClass("active")?a=!1:b.find(".active").removeClass("active")),a&&c.prop("checked",!this.$element.hasClass("active")).trigger("change")}a&&this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target);d.hasClass("btn")||(d=d.closest(".btn")),b.call(d,"toggle"),c.preventDefault()})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b).on("keydown.bs.carousel",a.proxy(this.keydown,this)),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=this.sliding=this.interval=this.$active=this.$items=null,"hover"==this.options.pause&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.2.0",c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0},c.prototype.keydown=function(a){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.to=function(b){var c=this,d=this.getItemIndex(this.$active=this.$element.find(".item.active"));return b>this.$items.length-1||0>b?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){c.to(b)}):d==b?this.pause().cycle():this.slide(b>d?"next":"prev",a(this.$items[b]))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){return this.sliding?void 0:this.slide("next")},c.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},c.prototype.slide=function(b,c){var d=this.$element.find(".item.active"),e=c||d[b](),f=this.interval,g="next"==b?"left":"right",h="next"==b?"first":"last",i=this;if(!e.length){if(!this.options.wrap)return;e=this.$element.find(".item")[h]()}if(e.hasClass("active"))return this.sliding=!1;var j=e[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:g});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,f&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(e)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:g});return a.support.transition&&this.$element.hasClass("slide")?(e.addClass(b),e[0].offsetWidth,d.addClass(g),e.addClass(g),d.one("bsTransitionEnd",function(){e.removeClass([b,g].join(" ")).addClass("active"),d.removeClass(["active",g].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(1e3*d.css("transition-duration").slice(0,-1))):(d.removeClass("active"),e.addClass("active"),this.sliding=!1,this.$element.trigger(m)),f&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this},a(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}}),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.collapse"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b);!e&&f.toggle&&"show"==b&&(b=!b),e||d.data("bs.collapse",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.transitioning=null,this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};c.VERSION="3.2.0",c.DEFAULTS={toggle:!0},c.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},c.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var c=a.Event("show.bs.collapse");if(this.$element.trigger(c),!c.isDefaultPrevented()){var d=this.$parent&&this.$parent.find("> .panel > .in");if(d&&d.length){var e=d.data("bs.collapse");if(e&&e.transitioning)return;b.call(d,"hide"),e||d.data("bs.collapse",null)}var f=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[f](0),this.transitioning=1;var g=function(){this.$element.removeClass("collapsing").addClass("collapse in")[f](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return g.call(this);var h=a.camelCase(["scroll",f].join("-"));this.$element.one("bsTransitionEnd",a.proxy(g,this)).emulateTransitionEnd(350)[f](this.$element[0][h])}}},c.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var d=function(){this.transitioning=0,this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(d,this)).emulateTransitionEnd(350):d.call(this)}}},c.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var d=a.fn.collapse;a.fn.collapse=b,a.fn.collapse.Constructor=c,a.fn.collapse.noConflict=function(){return a.fn.collapse=d,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(c){var d,e=a(this),f=e.attr("data-target")||c.preventDefault()||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""),g=a(f),h=g.data("bs.collapse"),i=h?"toggle":e.data(),j=e.attr("data-parent"),k=j&&a(j);h&&h.transitioning||(k&&k.find('[data-toggle="collapse"][data-parent="'+j+'"]').not(e).addClass("collapsed"),e[g.hasClass("in")?"addClass":"removeClass"]("collapsed")),b.call(g,i)})}(jQuery),+function(a){"use strict";function b(b){b&&3===b.which||(a(e).remove(),a(f).each(function(){var d=c(a(this)),e={relatedTarget:this};d.hasClass("open")&&(d.trigger(b=a.Event("hide.bs.dropdown",e)),b.isDefaultPrevented()||d.removeClass("open").trigger("hidden.bs.dropdown",e))}))}function c(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.2.0",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a('<div class="dropdown-backdrop"/>').insertAfter(a(this)).on("click",b);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus"),f.toggleClass("open").trigger("shown.bs.dropdown",h)}return!1}},g.prototype.keydown=function(b){if(/(38|40|27)/.test(b.keyCode)){var d=a(this);if(b.preventDefault(),b.stopPropagation(),!d.is(".disabled, :disabled")){var e=c(d),g=e.hasClass("open");if(!g||g&&27==b.keyCode)return 27==b.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.divider):visible a",i=e.find('[role="menu"]'+h+', [role="listbox"]'+h);if(i.length){var j=i.index(i.filter(":focus"));38==b.keyCode&&j>0&&j--,40==b.keyCode&&j<i.length-1&&j++,~j||(j=0),i.eq(j).trigger("focus")}}}};var h=a.fn.dropdown;a.fn.dropdown=d,a.fn.dropdown.Constructor=g,a.fn.dropdown.noConflict=function(){return a.fn.dropdown=h,this},a(document).on("click.bs.dropdown.data-api",b).on("click.bs.dropdown.data-api",".dropdown form",function(a){a.stopPropagation()}).on("click.bs.dropdown.data-api",f,g.prototype.toggle).on("keydown.bs.dropdown.data-api",f+', [role="menu"], [role="listbox"]',g.prototype.keydown)}(jQuery),+function(a){"use strict";function b(b,d){return this.each(function(){var e=a(this),f=e.data("bs.modal"),g=a.extend({},c.DEFAULTS,e.data(),"object"==typeof b&&b);f||e.data("bs.modal",f=new c(this,g)),"string"==typeof b?f[b](d):g.show&&f.show(d)})}var c=function(b,c){this.options=c,this.$body=a(document.body),this.$element=a(b),this.$backdrop=this.isShown=null,this.scrollbarWidth=0,this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,a.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};c.VERSION="3.2.0",c.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},c.prototype.toggle=function(a){return this.isShown?this.hide():this.show(a)},c.prototype.show=function(b){var c=this,d=a.Event("show.bs.modal",{relatedTarget:b});this.$element.trigger(d),this.isShown||d.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.$body.addClass("modal-open"),this.setScrollbar(),this.escape(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',a.proxy(this.hide,this)),this.backdrop(function(){var d=a.support.transition&&c.$element.hasClass("fade");c.$element.parent().length||c.$element.appendTo(c.$body),c.$element.show().scrollTop(0),d&&c.$element[0].offsetWidth,c.$element.addClass("in").attr("aria-hidden",!1),c.enforceFocus();var e=a.Event("shown.bs.modal",{relatedTarget:b});d?c.$element.find(".modal-dialog").one("bsTransitionEnd",function(){c.$element.trigger("focus").trigger(e)}).emulateTransitionEnd(300):c.$element.trigger("focus").trigger(e)}))},c.prototype.hide=function(b){b&&b.preventDefault(),b=a.Event("hide.bs.modal"),this.$element.trigger(b),this.isShown&&!b.isDefaultPrevented()&&(this.isShown=!1,this.$body.removeClass("modal-open"),this.resetScrollbar(),this.escape(),a(document).off("focusin.bs.modal"),this.$element.removeClass("in").attr("aria-hidden",!0).off("click.dismiss.bs.modal"),a.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",a.proxy(this.hideModal,this)).emulateTransitionEnd(300):this.hideModal())},c.prototype.enforceFocus=function(){a(document).off("focusin.bs.modal").on("focusin.bs.modal",a.proxy(function(a){this.$element[0]===a.target||this.$element.has(a.target).length||this.$element.trigger("focus")},this))},c.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.bs.modal",a.proxy(function(a){27==a.which&&this.hide()},this)):this.isShown||this.$element.off("keyup.dismiss.bs.modal")},c.prototype.hideModal=function(){var a=this;this.$element.hide(),this.backdrop(function(){a.$element.trigger("hidden.bs.modal")})},c.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},c.prototype.backdrop=function(b){var c=this,d=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var e=a.support.transition&&d;if(this.$backdrop=a('<div class="modal-backdrop '+d+'" />').appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",a.proxy(function(a){a.target===a.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus.call(this.$element[0]):this.hide.call(this))},this)),e&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!b)return;e?this.$backdrop.one("bsTransitionEnd",b).emulateTransitionEnd(150):b()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var f=function(){c.removeBackdrop(),b&&b()};a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",f).emulateTransitionEnd(150):f()}else b&&b()},c.prototype.checkScrollbar=function(){document.body.clientWidth>=window.innerWidth||(this.scrollbarWidth=this.scrollbarWidth||this.measureScrollbar())},c.prototype.setScrollbar=function(){var a=parseInt(this.$body.css("padding-right")||0,10);this.scrollbarWidth&&this.$body.css("padding-right",a+this.scrollbarWidth)},c.prototype.resetScrollbar=function(){this.$body.css("padding-right","")},c.prototype.measureScrollbar=function(){var a=document.createElement("div");a.className="modal-scrollbar-measure",this.$body.append(a);var b=a.offsetWidth-a.clientWidth;return this.$body[0].removeChild(a),b};var d=a.fn.modal;a.fn.modal=b,a.fn.modal.Constructor=c,a.fn.modal.noConflict=function(){return a.fn.modal=d,this},a(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(c){var d=a(this),e=d.attr("href"),f=a(d.attr("data-target")||e&&e.replace(/.*(?=#[^\s]+$)/,"")),g=f.data("bs.modal")?"toggle":a.extend({remote:!/#/.test(e)&&e},f.data(),d.data());d.is("a")&&c.preventDefault(),f.one("show.bs.modal",function(a){a.isDefaultPrevented()||f.one("hidden.bs.modal",function(){d.is(":visible")&&d.trigger("focus")})}),b.call(f,g,this)})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tooltip"),f="object"==typeof b&&b;(e||"destroy"!=b)&&(e||d.data("bs.tooltip",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.type=this.options=this.enabled=this.timeout=this.hoverState=this.$element=null,this.init("tooltip",a,b)};c.VERSION="3.2.0",c.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(this.options.viewport.selector||this.options.viewport);for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show()},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide()},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var c=a.contains(document.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!c)return;var d=this,e=this.tip(),f=this.getUID(this.type);this.setContent(),e.attr("id",f),this.$element.attr("aria-describedby",f),this.options.animation&&e.addClass("fade");var g="function"==typeof this.options.placement?this.options.placement.call(this,e[0],this.$element[0]):this.options.placement,h=/\s?auto?\s?/i,i=h.test(g);i&&(g=g.replace(h,"")||"top"),e.detach().css({top:0,left:0,display:"block"}).addClass(g).data("bs."+this.type,this),this.options.container?e.appendTo(this.options.container):e.insertAfter(this.$element);var j=this.getPosition(),k=e[0].offsetWidth,l=e[0].offsetHeight;if(i){var m=g,n=this.$element.parent(),o=this.getPosition(n);g="bottom"==g&&j.top+j.height+l-o.scroll>o.height?"top":"top"==g&&j.top-o.scroll-l<0?"bottom":"right"==g&&j.right+k>o.width?"left":"left"==g&&j.left-k<o.left?"right":g,e.removeClass(m).addClass(g)}var p=this.getCalculatedOffset(g,j,k,l);this.applyPlacement(p,g);var q=function(){d.$element.trigger("shown.bs."+d.type),d.hoverState=null};a.support.transition&&this.$tip.hasClass("fade")?e.one("bsTransitionEnd",q).emulateTransitionEnd(150):q()}},c.prototype.applyPlacement=function(b,c){var d=this.tip(),e=d[0].offsetWidth,f=d[0].offsetHeight,g=parseInt(d.css("margin-top"),10),h=parseInt(d.css("margin-left"),10);isNaN(g)&&(g=0),isNaN(h)&&(h=0),b.top=b.top+g,b.left=b.left+h,a.offset.setOffset(d[0],a.extend({using:function(a){d.css({top:Math.round(a.top),left:Math.round(a.left)})}},b),0),d.addClass("in");var i=d[0].offsetWidth,j=d[0].offsetHeight;"top"==c&&j!=f&&(b.top=b.top+f-j);var k=this.getViewportAdjustedDelta(c,b,i,j);k.left?b.left+=k.left:b.top+=k.top;var l=k.left?2*k.left-e+i:2*k.top-f+j,m=k.left?"left":"top",n=k.left?"offsetWidth":"offsetHeight";d.offset(b),this.replaceArrow(l,d[0][n],m)},c.prototype.replaceArrow=function(a,b,c){this.arrow().css(c,a?50*(1-a/b)+"%":"")},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle();a.find(".tooltip-inner")[this.options.html?"html":"text"](b),a.removeClass("fade in top bottom left right")},c.prototype.hide=function(){function b(){"in"!=c.hoverState&&d.detach(),c.$element.trigger("hidden.bs."+c.type)}var c=this,d=this.tip(),e=a.Event("hide.bs."+this.type);return this.$element.removeAttr("aria-describedby"),this.$element.trigger(e),e.isDefaultPrevented()?void 0:(d.removeClass("in"),a.support.transition&&this.$tip.hasClass("fade")?d.one("bsTransitionEnd",b).emulateTransitionEnd(150):b(),this.hoverState=null,this)},c.prototype.fixTitle=function(){var a=this.$element;(a.attr("title")||"string"!=typeof a.attr("data-original-title"))&&a.attr("data-original-title",a.attr("title")||"").attr("title","")},c.prototype.hasContent=function(){return this.getTitle()},c.prototype.getPosition=function(b){b=b||this.$element;var c=b[0],d="BODY"==c.tagName;return a.extend({},"function"==typeof c.getBoundingClientRect?c.getBoundingClientRect():null,{scroll:d?document.documentElement.scrollTop||document.body.scrollTop:b.scrollTop(),width:d?a(window).width():b.outerWidth(),height:d?a(window).height():b.outerHeight()},d?{top:0,left:0}:b.offset())},c.prototype.getCalculatedOffset=function(a,b,c,d){return"bottom"==a?{top:b.top+b.height,left:b.left+b.width/2-c/2}:"top"==a?{top:b.top-d,left:b.left+b.width/2-c/2}:"left"==a?{top:b.top+b.height/2-d/2,left:b.left-c}:{top:b.top+b.height/2-d/2,left:b.left+b.width}},c.prototype.getViewportAdjustedDelta=function(a,b,c,d){var e={top:0,left:0};if(!this.$viewport)return e;var f=this.options.viewport&&this.options.viewport.padding||0,g=this.getPosition(this.$viewport);if(/right|left/.test(a)){var h=b.top-f-g.scroll,i=b.top+f-g.scroll+d;h<g.top?e.top=g.top-h:i>g.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;j<g.left?e.left=g.left-j:k>g.width&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){return this.$tip=this.$tip||a(this.options.template)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.validate=function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){clearTimeout(this.timeout),this.hide().$element.off("."+this.type).removeData("bs."+this.type)};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;(e||"destroy"!=b)&&(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.2.0",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").empty()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},c.prototype.tip=function(){return this.$tip||(this.$tip=a(this.options.template)),this.$tip};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){var e=a.proxy(this.process,this);this.$body=a("body"),this.$scrollElement=a(a(c).is("body")?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",e),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.2.0",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b="offset",c=0;a.isWindow(this.$scrollElement[0])||(b="position",c=this.$scrollElement.scrollTop()),this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight();var d=this;this.$body.find(this.selector).map(function(){var d=a(this),e=d.data("target")||d.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[b]().top+c,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){d.offsets.push(this[0]),d.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b<=e[0])return g!=(a=f[0])&&this.activate(a);for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(!e[a+1]||b<=e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){this.activeTarget=b,a(this.selector).parentsUntil(this.options.target,".active").removeClass("active");var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate.bs.scrollspy")};var d=a.fn.scrollspy;a.fn.scrollspy=c,a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=d,this},a(window).on("load.bs.scrollspy.data-api",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);c.call(b,b.data())})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new c(this)),"string"==typeof b&&e[b]()})}var c=function(b){this.element=a(b)};c.VERSION="3.2.0",c.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.data("target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a")[0],f=a.Event("show.bs.tab",{relatedTarget:e});if(b.trigger(f),!f.isDefaultPrevented()){var g=a(d);this.activate(b.closest("li"),c),this.activate(g,g.parent(),function(){b.trigger({type:"shown.bs.tab",relatedTarget:e})})}}},c.prototype.activate=function(b,c,d){function e(){f.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),b.addClass("active"),g?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active"),d&&d()}var f=c.find("> .active"),g=d&&a.support.transition&&f.hasClass("fade");g?f.one("bsTransitionEnd",e).emulateTransitionEnd(150):e(),f.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this},a(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(c){c.preventDefault(),b.call(a(this),"show")})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=this.unpin=this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.2.0",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=a(document).height(),d=this.$target.scrollTop(),e=this.$element.offset(),f=this.options.offset,g=f.top,h=f.bottom;"object"!=typeof f&&(h=g=f),"function"==typeof g&&(g=f.top(this.$element)),"function"==typeof h&&(h=f.bottom(this.$element));var i=null!=this.unpin&&d+this.unpin<=e.top?!1:null!=h&&e.top+this.$element.height()>=b-h?"bottom":null!=g&&g>=d?"top":!1;if(this.affixed!==i){null!=this.unpin&&this.$element.css("top","");var j="affix"+(i?"-"+i:""),k=a.Event(j+".bs.affix");this.$element.trigger(k),k.isDefaultPrevented()||(this.affixed=i,this.unpin="bottom"==i?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(j).trigger(a.Event(j.replace("affix","affixed"))),"bottom"==i&&this.$element.offset({top:b-this.$element.height()-h}))}}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},d.offsetBottom&&(d.offset.bottom=d.offsetBottom),d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery);</script>
469 <script>(function() {
470 'use strict';
471
472 /**
473 * Extend an Object with another Object's properties.
474 *
475 * The source objects are specified as additional arguments.
476 *
477 * @param dst Object the object to extend.
478 *
479 * @return Object the final object.
480 */
481 var _extend = function(dst) {
482 var sources = Array.prototype.slice.call(arguments, 1);
483 for (var i=0; i<sources.length; ++i) {
484 var src = sources[i];
485 for (var p in src) {
486 if (src.hasOwnProperty(p)) dst[p] = src[p];
487 }
488 }
489 return dst;
490 };
491
492
493 /**
494 * Defer execution of given function.
495 * @param {Function} func
496 */
497 var _defer = function(func) {
498 if (typeof setImmediate === 'function') {
499 return setImmediate(func);
500 } else {
501 return setTimeout(func, 0);
502 }
503 };
504
505 /**
506 * Based on the algorithm at http://en.wikipedia.org/wiki/Levenshtein_distance.
507 */
508 var Levenshtein = {
509 /**
510 * Calculate levenshtein distance of the two strings.
511 *
512 * @param str1 String the first string.
513 * @param str2 String the second string.
514 * @return Integer the levenshtein distance (0 and above).
515 */
516 get: function(str1, str2) {
517 // base cases
518 if (str1 === str2) return 0;
519 if (str1.length === 0) return str2.length;
520 if (str2.length === 0) return str1.length;
521
522 // two rows
523 var prevRow = new Array(str2.length + 1),
524 curCol, nextCol, i, j, tmp;
525
526 // initialise previous row
527 for (i=0; i<prevRow.length; ++i) {
528 prevRow[i] = i;
529 }
530
531 // calculate current row distance from previous row
532 for (i=0; i<str1.length; ++i) {
533 nextCol = i + 1;
534
535 for (j=0; j<str2.length; ++j) {
536 curCol = nextCol;
537
538 // substution
539 nextCol = prevRow[j] + ( (str1.charAt(i) === str2.charAt(j)) ? 0 : 1 );
540 // insertion
541 tmp = curCol + 1;
542 if (nextCol > tmp) {
543 nextCol = tmp;
544 }
545 // deletion
546 tmp = prevRow[j + 1] + 1;
547 if (nextCol > tmp) {
548 nextCol = tmp;
549 }
550
551 // copy current col value into previous (in preparation for next iteration)
552 prevRow[j] = curCol;
553 }
554
555 // copy last col value into previous (in preparation for next iteration)
556 prevRow[j] = nextCol;
557 }
558
559 return nextCol;
560 },
561
562 /**
563 * Asynchronously calculate levenshtein distance of the two strings.
564 *
565 * @param str1 String the first string.
566 * @param str2 String the second string.
567 * @param cb Function callback function with signature: function(Error err, int distance)
568 * @param [options] Object additional options.
569 * @param [options.progress] Function progress callback with signature: function(percentComplete)
570 */
571 getAsync: function(str1, str2, cb, options) {
572 options = _extend({}, {
573 progress: null
574 }, options);
575
576 // base cases
577 if (str1 === str2) return cb(null, 0);
578 if (str1.length === 0) return cb(null, str2.length);
579 if (str2.length === 0) return cb(null, str1.length);
580
581 // two rows
582 var prevRow = new Array(str2.length + 1),
583 curCol, nextCol,
584 i, j, tmp,
585 startTime, currentTime;
586
587 // initialise previous row
588 for (i=0; i<prevRow.length; ++i) {
589 prevRow[i] = i;
590 }
591
592 nextCol = 1;
593 i = 0;
594 j = -1;
595
596 var __calculate = function() {
597 // reset timer
598 startTime = new Date().valueOf();
599 currentTime = startTime;
600
601 // keep going until one second has elapsed
602 while (currentTime - startTime < 1000) {
603 // reached end of current row?
604 if (str2.length <= (++j)) {
605 // copy current into previous (in preparation for next iteration)
606 prevRow[j] = nextCol;
607
608 // if already done all chars
609 if (str1.length <= (++i)) {
610 return cb(null, nextCol);
611 }
612 // else if we have more left to do
613 else {
614 nextCol = i + 1;
615 j = 0;
616 }
617 }
618
619 // calculation
620 curCol = nextCol;
621
622 // substution
623 nextCol = prevRow[j] + ( (str1.charAt(i) === str2.charAt(j)) ? 0 : 1 );
624 // insertion
625 tmp = curCol + 1;
626 if (nextCol > tmp) {
627 nextCol = tmp;
628 }
629 // deletion
630 tmp = prevRow[j + 1] + 1;
631 if (nextCol > tmp) {
632 nextCol = tmp;
633 }
634
635 // copy current into previous (in preparation for next iteration)
636 prevRow[j] = curCol;
637
638 // get current time
639 currentTime = new Date().valueOf();
640 }
641
642 // send a progress update?
643 if (null !== options.progress) {
644 try {
645 options.progress.call(null, (i * 100.0/ str1.length));
646 } catch (err) {
647 return cb('Progress callback: ' + err.toString());
648 }
649 }
650
651 // next iteration
652 _defer(__calculate);
653 };
654
655 __calculate();
656 }
657
658 };
659
660 // amd
661 if (typeof define !== "undefined" && define !== null && define.amd) {
662 define(function() {
663 return Levenshtein;
664 });
665 }
666 // commonjs
667 else if (typeof module !== "undefined" && module !== null && typeof exports !== "undefined" && module.exports === exports) {
668 module.exports = Levenshtein;
669 }
670 // web worker
671 else if (typeof self !== "undefined" && typeof self.postMessage === 'function' && typeof self.importScripts === 'function') {
672 self.Levenshtein = Levenshtein;
673 }
674 // browser main thread
675 else if (typeof window !== "undefined" && window !== null) {
676 window.Levenshtein = Levenshtein;
677 }
678 }());
679
680 </script>
681 <script>(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.bitcoin = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
682 // (public) Constructor
683 function BigInteger(a, b, c) {
684 if (!(this instanceof BigInteger))
685 return new BigInteger(a, b, c)
686
687 if (a != null) {
688 if ("number" == typeof a) this.fromNumber(a, b, c)
689 else if (b == null && "string" != typeof a) this.fromString(a, 256)
690 else this.fromString(a, b)
691 }
692 }
693
694 var proto = BigInteger.prototype
695
696 // duck-typed isBigInteger
697 proto.__bigi = require('../package.json').version
698 BigInteger.isBigInteger = function (obj, check_ver) {
699 return obj && obj.__bigi && (!check_ver || obj.__bigi === proto.__bigi)
700 }
701
702 // Bits per digit
703 var dbits
704
705 // am: Compute w_j += (x*this_i), propagate carries,
706 // c is initial carry, returns final carry.
707 // c < 3*dvalue, x < 2*dvalue, this_i < dvalue
708 // We need to select the fastest one that works in this environment.
709
710 // am1: use a single mult and divide to get the high bits,
711 // max digit bits should be 26 because
712 // max internal value = 2*dvalue^2-2*dvalue (< 2^53)
713 function am1(i, x, w, j, c, n) {
714 while (--n >= 0) {
715 var v = x * this[i++] + w[j] + c
716 c = Math.floor(v / 0x4000000)
717 w[j++] = v & 0x3ffffff
718 }
719 return c
720 }
721 // am2 avoids a big mult-and-extract completely.
722 // Max digit bits should be <= 30 because we do bitwise ops
723 // on values up to 2*hdvalue^2-hdvalue-1 (< 2^31)
724 function am2(i, x, w, j, c, n) {
725 var xl = x & 0x7fff,
726 xh = x >> 15
727 while (--n >= 0) {
728 var l = this[i] & 0x7fff
729 var h = this[i++] >> 15
730 var m = xh * l + h * xl
731 l = xl * l + ((m & 0x7fff) << 15) + w[j] + (c & 0x3fffffff)
732 c = (l >>> 30) + (m >>> 15) + xh * h + (c >>> 30)
733 w[j++] = l & 0x3fffffff
734 }
735 return c
736 }
737 // Alternately, set max digit bits to 28 since some
738 // browsers slow down when dealing with 32-bit numbers.
739 function am3(i, x, w, j, c, n) {
740 var xl = x & 0x3fff,
741 xh = x >> 14
742 while (--n >= 0) {
743 var l = this[i] & 0x3fff
744 var h = this[i++] >> 14
745 var m = xh * l + h * xl
746 l = xl * l + ((m & 0x3fff) << 14) + w[j] + c
747 c = (l >> 28) + (m >> 14) + xh * h
748 w[j++] = l & 0xfffffff
749 }
750 return c
751 }
752
753 // wtf?
754 BigInteger.prototype.am = am1
755 dbits = 26
756
757 BigInteger.prototype.DB = dbits
758 BigInteger.prototype.DM = ((1 << dbits) - 1)
759 var DV = BigInteger.prototype.DV = (1 << dbits)
760
761 var BI_FP = 52
762 BigInteger.prototype.FV = Math.pow(2, BI_FP)
763 BigInteger.prototype.F1 = BI_FP - dbits
764 BigInteger.prototype.F2 = 2 * dbits - BI_FP
765
766 // Digit conversions
767 var BI_RM = "0123456789abcdefghijklmnopqrstuvwxyz"
768 var BI_RC = new Array()
769 var rr, vv
770 rr = "0".charCodeAt(0)
771 for (vv = 0; vv <= 9; ++vv) BI_RC[rr++] = vv
772 rr = "a".charCodeAt(0)
773 for (vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv
774 rr = "A".charCodeAt(0)
775 for (vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv
776
777 function int2char(n) {
778 return BI_RM.charAt(n)
779 }
780
781 function intAt(s, i) {
782 var c = BI_RC[s.charCodeAt(i)]
783 return (c == null) ? -1 : c
784 }
785
786 // (protected) copy this to r
787 function bnpCopyTo(r) {
788 for (var i = this.t - 1; i >= 0; --i) r[i] = this[i]
789 r.t = this.t
790 r.s = this.s
791 }
792
793 // (protected) set from integer value x, -DV <= x < DV
794 function bnpFromInt(x) {
795 this.t = 1
796 this.s = (x < 0) ? -1 : 0
797 if (x > 0) this[0] = x
798 else if (x < -1) this[0] = x + DV
799 else this.t = 0
800 }
801
802 // return bigint initialized to value
803 function nbv(i) {
804 var r = new BigInteger()
805 r.fromInt(i)
806 return r
807 }
808
809 // (protected) set from string and radix
810 function bnpFromString(s, b) {
811 var self = this
812
813 var k
814 if (b == 16) k = 4
815 else if (b == 8) k = 3
816 else if (b == 256) k = 8; // byte array
817 else if (b == 2) k = 1
818 else if (b == 32) k = 5
819 else if (b == 4) k = 2
820 else {
821 self.fromRadix(s, b)
822 return
823 }
824 self.t = 0
825 self.s = 0
826 var i = s.length,
827 mi = false,
828 sh = 0
829 while (--i >= 0) {
830 var x = (k == 8) ? s[i] & 0xff : intAt(s, i)
831 if (x < 0) {
832 if (s.charAt(i) == "-") mi = true
833 continue
834 }
835 mi = false
836 if (sh == 0)
837 self[self.t++] = x
838 else if (sh + k > self.DB) {
839 self[self.t - 1] |= (x & ((1 << (self.DB - sh)) - 1)) << sh
840 self[self.t++] = (x >> (self.DB - sh))
841 } else
842 self[self.t - 1] |= x << sh
843 sh += k
844 if (sh >= self.DB) sh -= self.DB
845 }
846 if (k == 8 && (s[0] & 0x80) != 0) {
847 self.s = -1
848 if (sh > 0) self[self.t - 1] |= ((1 << (self.DB - sh)) - 1) << sh
849 }
850 self.clamp()
851 if (mi) BigInteger.ZERO.subTo(self, self)
852 }
853
854 // (protected) clamp off excess high words
855 function bnpClamp() {
856 var c = this.s & this.DM
857 while (this.t > 0 && this[this.t - 1] == c)--this.t
858 }
859
860 // (public) return string representation in given radix
861 function bnToString(b) {
862 var self = this
863 if (self.s < 0) return "-" + self.negate()
864 .toString(b)
865 var k
866 if (b == 16) k = 4
867 else if (b == 8) k = 3
868 else if (b == 2) k = 1
869 else if (b == 32) k = 5
870 else if (b == 4) k = 2
871 else return self.toRadix(b)
872 var km = (1 << k) - 1,
873 d, m = false,
874 r = "",
875 i = self.t
876 var p = self.DB - (i * self.DB) % k
877 if (i-- > 0) {
878 if (p < self.DB && (d = self[i] >> p) > 0) {
879 m = true
880 r = int2char(d)
881 }
882 while (i >= 0) {
883 if (p < k) {
884 d = (self[i] & ((1 << p) - 1)) << (k - p)
885 d |= self[--i] >> (p += self.DB - k)
886 } else {
887 d = (self[i] >> (p -= k)) & km
888 if (p <= 0) {
889 p += self.DB
890 --i
891 }
892 }
893 if (d > 0) m = true
894 if (m) r += int2char(d)
895 }
896 }
897 return m ? r : "0"
898 }
899
900 // (public) -this
901 function bnNegate() {
902 var r = new BigInteger()
903 BigInteger.ZERO.subTo(this, r)
904 return r
905 }
906
907 // (public) |this|
908 function bnAbs() {
909 return (this.s < 0) ? this.negate() : this
910 }
911
912 // (public) return + if this > a, - if this < a, 0 if equal
913 function bnCompareTo(a) {
914 var r = this.s - a.s
915 if (r != 0) return r
916 var i = this.t
917 r = i - a.t
918 if (r != 0) return (this.s < 0) ? -r : r
919 while (--i >= 0)
920 if ((r = this[i] - a[i]) != 0) return r
921 return 0
922 }
923
924 // returns bit length of the integer x
925 function nbits(x) {
926 var r = 1,
927 t
928 if ((t = x >>> 16) != 0) {
929 x = t
930 r += 16
931 }
932 if ((t = x >> 8) != 0) {
933 x = t
934 r += 8
935 }
936 if ((t = x >> 4) != 0) {
937 x = t
938 r += 4
939 }
940 if ((t = x >> 2) != 0) {
941 x = t
942 r += 2
943 }
944 if ((t = x >> 1) != 0) {
945 x = t
946 r += 1
947 }
948 return r
949 }
950
951 // (public) return the number of bits in "this"
952 function bnBitLength() {
953 if (this.t <= 0) return 0
954 return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM))
955 }
956
957 // (public) return the number of bytes in "this"
958 function bnByteLength() {
959 return this.bitLength() >> 3
960 }
961
962 // (protected) r = this << n*DB
963 function bnpDLShiftTo(n, r) {
964 var i
965 for (i = this.t - 1; i >= 0; --i) r[i + n] = this[i]
966 for (i = n - 1; i >= 0; --i) r[i] = 0
967 r.t = this.t + n
968 r.s = this.s
969 }
970
971 // (protected) r = this >> n*DB
972 function bnpDRShiftTo(n, r) {
973 for (var i = n; i < this.t; ++i) r[i - n] = this[i]
974 r.t = Math.max(this.t - n, 0)
975 r.s = this.s
976 }
977
978 // (protected) r = this << n
979 function bnpLShiftTo(n, r) {
980 var self = this
981 var bs = n % self.DB
982 var cbs = self.DB - bs
983 var bm = (1 << cbs) - 1
984 var ds = Math.floor(n / self.DB),
985 c = (self.s << bs) & self.DM,
986 i
987 for (i = self.t - 1; i >= 0; --i) {
988 r[i + ds + 1] = (self[i] >> cbs) | c
989 c = (self[i] & bm) << bs
990 }
991 for (i = ds - 1; i >= 0; --i) r[i] = 0
992 r[ds] = c
993 r.t = self.t + ds + 1
994 r.s = self.s
995 r.clamp()
996 }
997
998 // (protected) r = this >> n
999 function bnpRShiftTo(n, r) {
1000 var self = this
1001 r.s = self.s
1002 var ds = Math.floor(n / self.DB)
1003 if (ds >= self.t) {
1004 r.t = 0
1005 return
1006 }
1007 var bs = n % self.DB
1008 var cbs = self.DB - bs
1009 var bm = (1 << bs) - 1
1010 r[0] = self[ds] >> bs
1011 for (var i = ds + 1; i < self.t; ++i) {
1012 r[i - ds - 1] |= (self[i] & bm) << cbs
1013 r[i - ds] = self[i] >> bs
1014 }
1015 if (bs > 0) r[self.t - ds - 1] |= (self.s & bm) << cbs
1016 r.t = self.t - ds
1017 r.clamp()
1018 }
1019
1020 // (protected) r = this - a
1021 function bnpSubTo(a, r) {
1022 var self = this
1023 var i = 0,
1024 c = 0,
1025 m = Math.min(a.t, self.t)
1026 while (i < m) {
1027 c += self[i] - a[i]
1028 r[i++] = c & self.DM
1029 c >>= self.DB
1030 }
1031 if (a.t < self.t) {
1032 c -= a.s
1033 while (i < self.t) {
1034 c += self[i]
1035 r[i++] = c & self.DM
1036 c >>= self.DB
1037 }
1038 c += self.s
1039 } else {
1040 c += self.s
1041 while (i < a.t) {
1042 c -= a[i]
1043 r[i++] = c & self.DM
1044 c >>= self.DB
1045 }
1046 c -= a.s
1047 }
1048 r.s = (c < 0) ? -1 : 0
1049 if (c < -1) r[i++] = self.DV + c
1050 else if (c > 0) r[i++] = c
1051 r.t = i
1052 r.clamp()
1053 }
1054
1055 // (protected) r = this * a, r != this,a (HAC 14.12)
1056 // "this" should be the larger one if appropriate.
1057 function bnpMultiplyTo(a, r) {
1058 var x = this.abs(),
1059 y = a.abs()
1060 var i = x.t
1061 r.t = i + y.t
1062 while (--i >= 0) r[i] = 0
1063 for (i = 0; i < y.t; ++i) r[i + x.t] = x.am(0, y[i], r, i, 0, x.t)
1064 r.s = 0
1065 r.clamp()
1066 if (this.s != a.s) BigInteger.ZERO.subTo(r, r)
1067 }
1068
1069 // (protected) r = this^2, r != this (HAC 14.16)
1070 function bnpSquareTo(r) {
1071 var x = this.abs()
1072 var i = r.t = 2 * x.t
1073 while (--i >= 0) r[i] = 0
1074 for (i = 0; i < x.t - 1; ++i) {
1075 var c = x.am(i, x[i], r, 2 * i, 0, 1)
1076 if ((r[i + x.t] += x.am(i + 1, 2 * x[i], r, 2 * i + 1, c, x.t - i - 1)) >= x.DV) {
1077 r[i + x.t] -= x.DV
1078 r[i + x.t + 1] = 1
1079 }
1080 }
1081 if (r.t > 0) r[r.t - 1] += x.am(i, x[i], r, 2 * i, 0, 1)
1082 r.s = 0
1083 r.clamp()
1084 }
1085
1086 // (protected) divide this by m, quotient and remainder to q, r (HAC 14.20)
1087 // r != q, this != m. q or r may be null.
1088 function bnpDivRemTo(m, q, r) {
1089 var self = this
1090 var pm = m.abs()
1091 if (pm.t <= 0) return
1092 var pt = self.abs()
1093 if (pt.t < pm.t) {
1094 if (q != null) q.fromInt(0)
1095 if (r != null) self.copyTo(r)
1096 return
1097 }
1098 if (r == null) r = new BigInteger()
1099 var y = new BigInteger(),
1100 ts = self.s,
1101 ms = m.s
1102 var nsh = self.DB - nbits(pm[pm.t - 1]); // normalize modulus
1103 if (nsh > 0) {
1104 pm.lShiftTo(nsh, y)
1105 pt.lShiftTo(nsh, r)
1106 } else {
1107 pm.copyTo(y)
1108 pt.copyTo(r)
1109 }
1110 var ys = y.t
1111 var y0 = y[ys - 1]
1112 if (y0 == 0) return
1113 var yt = y0 * (1 << self.F1) + ((ys > 1) ? y[ys - 2] >> self.F2 : 0)
1114 var d1 = self.FV / yt,
1115 d2 = (1 << self.F1) / yt,
1116 e = 1 << self.F2
1117 var i = r.t,
1118 j = i - ys,
1119 t = (q == null) ? new BigInteger() : q
1120 y.dlShiftTo(j, t)
1121 if (r.compareTo(t) >= 0) {
1122 r[r.t++] = 1
1123 r.subTo(t, r)
1124 }
1125 BigInteger.ONE.dlShiftTo(ys, t)
1126 t.subTo(y, y); // "negative" y so we can replace sub with am later
1127 while (y.t < ys) y[y.t++] = 0
1128 while (--j >= 0) {
1129 // Estimate quotient digit
1130 var qd = (r[--i] == y0) ? self.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2)
1131 if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) { // Try it out
1132 y.dlShiftTo(j, t)
1133 r.subTo(t, r)
1134 while (r[i] < --qd) r.subTo(t, r)
1135 }
1136 }
1137 if (q != null) {
1138 r.drShiftTo(ys, q)
1139 if (ts != ms) BigInteger.ZERO.subTo(q, q)
1140 }
1141 r.t = ys
1142 r.clamp()
1143 if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder
1144 if (ts < 0) BigInteger.ZERO.subTo(r, r)
1145 }
1146
1147 // (public) this mod a
1148 function bnMod(a) {
1149 var r = new BigInteger()
1150 this.abs()
1151 .divRemTo(a, null, r)
1152 if (this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r, r)
1153 return r
1154 }
1155
1156 // Modular reduction using "classic" algorithm
1157 function Classic(m) {
1158 this.m = m
1159 }
1160
1161 function cConvert(x) {
1162 if (x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m)
1163 else return x
1164 }
1165
1166 function cRevert(x) {
1167 return x
1168 }
1169
1170 function cReduce(x) {
1171 x.divRemTo(this.m, null, x)
1172 }
1173
1174 function cMulTo(x, y, r) {
1175 x.multiplyTo(y, r)
1176 this.reduce(r)
1177 }
1178
1179 function cSqrTo(x, r) {
1180 x.squareTo(r)
1181 this.reduce(r)
1182 }
1183
1184 Classic.prototype.convert = cConvert
1185 Classic.prototype.revert = cRevert
1186 Classic.prototype.reduce = cReduce
1187 Classic.prototype.mulTo = cMulTo
1188 Classic.prototype.sqrTo = cSqrTo
1189
1190 // (protected) return "-1/this % 2^DB"; useful for Mont. reduction
1191 // justification:
1192 // xy == 1 (mod m)
1193 // xy = 1+km
1194 // xy(2-xy) = (1+km)(1-km)
1195 // x[y(2-xy)] = 1-k^2m^2
1196 // x[y(2-xy)] == 1 (mod m^2)
1197 // if y is 1/x mod m, then y(2-xy) is 1/x mod m^2
1198 // should reduce x and y(2-xy) by m^2 at each step to keep size bounded.
1199 // JS multiply "overflows" differently from C/C++, so care is needed here.
1200 function bnpInvDigit() {
1201 if (this.t < 1) return 0
1202 var x = this[0]
1203 if ((x & 1) == 0) return 0
1204 var y = x & 3; // y == 1/x mod 2^2
1205 y = (y * (2 - (x & 0xf) * y)) & 0xf; // y == 1/x mod 2^4
1206 y = (y * (2 - (x & 0xff) * y)) & 0xff; // y == 1/x mod 2^8
1207 y = (y * (2 - (((x & 0xffff) * y) & 0xffff))) & 0xffff; // y == 1/x mod 2^16
1208 // last step - calculate inverse mod DV directly
1209 // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints
1210 y = (y * (2 - x * y % this.DV)) % this.DV; // y == 1/x mod 2^dbits
1211 // we really want the negative inverse, and -DV < y < DV
1212 return (y > 0) ? this.DV - y : -y
1213 }
1214
1215 // Montgomery reduction
1216 function Montgomery(m) {
1217 this.m = m
1218 this.mp = m.invDigit()
1219 this.mpl = this.mp & 0x7fff
1220 this.mph = this.mp >> 15
1221 this.um = (1 << (m.DB - 15)) - 1
1222 this.mt2 = 2 * m.t
1223 }
1224
1225 // xR mod m
1226 function montConvert(x) {
1227 var r = new BigInteger()
1228 x.abs()
1229 .dlShiftTo(this.m.t, r)
1230 r.divRemTo(this.m, null, r)
1231 if (x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r, r)
1232 return r
1233 }
1234
1235 // x/R mod m
1236 function montRevert(x) {
1237 var r = new BigInteger()
1238 x.copyTo(r)
1239 this.reduce(r)
1240 return r
1241 }
1242
1243 // x = x/R mod m (HAC 14.32)
1244 function montReduce(x) {
1245 while (x.t <= this.mt2) // pad x so am has enough room later
1246 x[x.t++] = 0
1247 for (var i = 0; i < this.m.t; ++i) {
1248 // faster way of calculating u0 = x[i]*mp mod DV
1249 var j = x[i] & 0x7fff
1250 var u0 = (j * this.mpl + (((j * this.mph + (x[i] >> 15) * this.mpl) & this.um) << 15)) & x.DM
1251 // use am to combine the multiply-shift-add into one call
1252 j = i + this.m.t
1253 x[j] += this.m.am(0, u0, x, i, 0, this.m.t)
1254 // propagate carry
1255 while (x[j] >= x.DV) {
1256 x[j] -= x.DV
1257 x[++j]++
1258 }
1259 }
1260 x.clamp()
1261 x.drShiftTo(this.m.t, x)
1262 if (x.compareTo(this.m) >= 0) x.subTo(this.m, x)
1263 }
1264
1265 // r = "x^2/R mod m"; x != r
1266 function montSqrTo(x, r) {
1267 x.squareTo(r)
1268 this.reduce(r)
1269 }
1270
1271 // r = "xy/R mod m"; x,y != r
1272 function montMulTo(x, y, r) {
1273 x.multiplyTo(y, r)
1274 this.reduce(r)
1275 }
1276
1277 Montgomery.prototype.convert = montConvert
1278 Montgomery.prototype.revert = montRevert
1279 Montgomery.prototype.reduce = montReduce
1280 Montgomery.prototype.mulTo = montMulTo
1281 Montgomery.prototype.sqrTo = montSqrTo
1282
1283 // (protected) true iff this is even
1284 function bnpIsEven() {
1285 return ((this.t > 0) ? (this[0] & 1) : this.s) == 0
1286 }
1287
1288 // (protected) this^e, e < 2^32, doing sqr and mul with "r" (HAC 14.79)
1289 function bnpExp(e, z) {
1290 if (e > 0xffffffff || e < 1) return BigInteger.ONE
1291 var r = new BigInteger(),
1292 r2 = new BigInteger(),
1293 g = z.convert(this),
1294 i = nbits(e) - 1
1295 g.copyTo(r)
1296 while (--i >= 0) {
1297 z.sqrTo(r, r2)
1298 if ((e & (1 << i)) > 0) z.mulTo(r2, g, r)
1299 else {
1300 var t = r
1301 r = r2
1302 r2 = t
1303 }
1304 }
1305 return z.revert(r)
1306 }
1307
1308 // (public) this^e % m, 0 <= e < 2^32
1309 function bnModPowInt(e, m) {
1310 var z
1311 if (e < 256 || m.isEven()) z = new Classic(m)
1312 else z = new Montgomery(m)
1313 return this.exp(e, z)
1314 }
1315
1316 // protected
1317 proto.copyTo = bnpCopyTo
1318 proto.fromInt = bnpFromInt
1319 proto.fromString = bnpFromString
1320 proto.clamp = bnpClamp
1321 proto.dlShiftTo = bnpDLShiftTo
1322 proto.drShiftTo = bnpDRShiftTo
1323 proto.lShiftTo = bnpLShiftTo
1324 proto.rShiftTo = bnpRShiftTo
1325 proto.subTo = bnpSubTo
1326 proto.multiplyTo = bnpMultiplyTo
1327 proto.squareTo = bnpSquareTo
1328 proto.divRemTo = bnpDivRemTo
1329 proto.invDigit = bnpInvDigit
1330 proto.isEven = bnpIsEven
1331 proto.exp = bnpExp
1332
1333 // public
1334 proto.toString = bnToString
1335 proto.negate = bnNegate
1336 proto.abs = bnAbs
1337 proto.compareTo = bnCompareTo
1338 proto.bitLength = bnBitLength
1339 proto.byteLength = bnByteLength
1340 proto.mod = bnMod
1341 proto.modPowInt = bnModPowInt
1342
1343 // (public)
1344 function bnClone() {
1345 var r = new BigInteger()
1346 this.copyTo(r)
1347 return r
1348 }
1349
1350 // (public) return value as integer
1351 function bnIntValue() {
1352 if (this.s < 0) {
1353 if (this.t == 1) return this[0] - this.DV
1354 else if (this.t == 0) return -1
1355 } else if (this.t == 1) return this[0]
1356 else if (this.t == 0) return 0
1357 // assumes 16 < DB < 32
1358 return ((this[1] & ((1 << (32 - this.DB)) - 1)) << this.DB) | this[0]
1359 }
1360
1361 // (public) return value as byte
1362 function bnByteValue() {
1363 return (this.t == 0) ? this.s : (this[0] << 24) >> 24
1364 }
1365
1366 // (public) return value as short (assumes DB>=16)
1367 function bnShortValue() {
1368 return (this.t == 0) ? this.s : (this[0] << 16) >> 16
1369 }
1370
1371 // (protected) return x s.t. r^x < DV
1372 function bnpChunkSize(r) {
1373 return Math.floor(Math.LN2 * this.DB / Math.log(r))
1374 }
1375
1376 // (public) 0 if this == 0, 1 if this > 0
1377 function bnSigNum() {
1378 if (this.s < 0) return -1
1379 else if (this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0
1380 else return 1
1381 }
1382
1383 // (protected) convert to radix string
1384 function bnpToRadix(b) {
1385 if (b == null) b = 10
1386 if (this.signum() == 0 || b < 2 || b > 36) return "0"
1387 var cs = this.chunkSize(b)
1388 var a = Math.pow(b, cs)
1389 var d = nbv(a),
1390 y = new BigInteger(),
1391 z = new BigInteger(),
1392 r = ""
1393 this.divRemTo(d, y, z)
1394 while (y.signum() > 0) {
1395 r = (a + z.intValue())
1396 .toString(b)
1397 .substr(1) + r
1398 y.divRemTo(d, y, z)
1399 }
1400 return z.intValue()
1401 .toString(b) + r
1402 }
1403
1404 // (protected) convert from radix string
1405 function bnpFromRadix(s, b) {
1406 var self = this
1407 self.fromInt(0)
1408 if (b == null) b = 10
1409 var cs = self.chunkSize(b)
1410 var d = Math.pow(b, cs),
1411 mi = false,
1412 j = 0,
1413 w = 0
1414 for (var i = 0; i < s.length; ++i) {
1415 var x = intAt(s, i)
1416 if (x < 0) {
1417 if (s.charAt(i) == "-" && self.signum() == 0) mi = true
1418 continue
1419 }
1420 w = b * w + x
1421 if (++j >= cs) {
1422 self.dMultiply(d)
1423 self.dAddOffset(w, 0)
1424 j = 0
1425 w = 0
1426 }
1427 }
1428 if (j > 0) {
1429 self.dMultiply(Math.pow(b, j))
1430 self.dAddOffset(w, 0)
1431 }
1432 if (mi) BigInteger.ZERO.subTo(self, self)
1433 }
1434
1435 // (protected) alternate constructor
1436 function bnpFromNumber(a, b, c) {
1437 var self = this
1438 if ("number" == typeof b) {
1439 // new BigInteger(int,int,RNG)
1440 if (a < 2) self.fromInt(1)
1441 else {
1442 self.fromNumber(a, c)
1443 if (!self.testBit(a - 1)) // force MSB set
1444 self.bitwiseTo(BigInteger.ONE.shiftLeft(a - 1), op_or, self)
1445 if (self.isEven()) self.dAddOffset(1, 0); // force odd
1446 while (!self.isProbablePrime(b)) {
1447 self.dAddOffset(2, 0)
1448 if (self.bitLength() > a) self.subTo(BigInteger.ONE.shiftLeft(a - 1), self)
1449 }
1450 }
1451 } else {
1452 // new BigInteger(int,RNG)
1453 var x = new Array(),
1454 t = a & 7
1455 x.length = (a >> 3) + 1
1456 b.nextBytes(x)
1457 if (t > 0) x[0] &= ((1 << t) - 1)
1458 else x[0] = 0
1459 self.fromString(x, 256)
1460 }
1461 }
1462
1463 // (public) convert to bigendian byte array
1464 function bnToByteArray() {
1465 var self = this
1466 var i = self.t,
1467 r = new Array()
1468 r[0] = self.s
1469 var p = self.DB - (i * self.DB) % 8,
1470 d, k = 0
1471 if (i-- > 0) {
1472 if (p < self.DB && (d = self[i] >> p) != (self.s & self.DM) >> p)
1473 r[k++] = d | (self.s << (self.DB - p))
1474 while (i >= 0) {
1475 if (p < 8) {
1476 d = (self[i] & ((1 << p) - 1)) << (8 - p)
1477 d |= self[--i] >> (p += self.DB - 8)
1478 } else {
1479 d = (self[i] >> (p -= 8)) & 0xff
1480 if (p <= 0) {
1481 p += self.DB
1482 --i
1483 }
1484 }
1485 if ((d & 0x80) != 0) d |= -256
1486 if (k === 0 && (self.s & 0x80) != (d & 0x80))++k
1487 if (k > 0 || d != self.s) r[k++] = d
1488 }
1489 }
1490 return r
1491 }
1492
1493 function bnEquals(a) {
1494 return (this.compareTo(a) == 0)
1495 }
1496
1497 function bnMin(a) {
1498 return (this.compareTo(a) < 0) ? this : a
1499 }
1500
1501 function bnMax(a) {
1502 return (this.compareTo(a) > 0) ? this : a
1503 }
1504
1505 // (protected) r = this op a (bitwise)
1506 function bnpBitwiseTo(a, op, r) {
1507 var self = this
1508 var i, f, m = Math.min(a.t, self.t)
1509 for (i = 0; i < m; ++i) r[i] = op(self[i], a[i])
1510 if (a.t < self.t) {
1511 f = a.s & self.DM
1512 for (i = m; i < self.t; ++i) r[i] = op(self[i], f)
1513 r.t = self.t
1514 } else {
1515 f = self.s & self.DM
1516 for (i = m; i < a.t; ++i) r[i] = op(f, a[i])
1517 r.t = a.t
1518 }
1519 r.s = op(self.s, a.s)
1520 r.clamp()
1521 }
1522
1523 // (public) this & a
1524 function op_and(x, y) {
1525 return x & y
1526 }
1527
1528 function bnAnd(a) {
1529 var r = new BigInteger()
1530 this.bitwiseTo(a, op_and, r)
1531 return r
1532 }
1533
1534 // (public) this | a
1535 function op_or(x, y) {
1536 return x | y
1537 }
1538
1539 function bnOr(a) {
1540 var r = new BigInteger()
1541 this.bitwiseTo(a, op_or, r)
1542 return r
1543 }
1544
1545 // (public) this ^ a
1546 function op_xor(x, y) {
1547 return x ^ y
1548 }
1549
1550 function bnXor(a) {
1551 var r = new BigInteger()
1552 this.bitwiseTo(a, op_xor, r)
1553 return r
1554 }
1555
1556 // (public) this & ~a
1557 function op_andnot(x, y) {
1558 return x & ~y
1559 }
1560
1561 function bnAndNot(a) {
1562 var r = new BigInteger()
1563 this.bitwiseTo(a, op_andnot, r)
1564 return r
1565 }
1566
1567 // (public) ~this
1568 function bnNot() {
1569 var r = new BigInteger()
1570 for (var i = 0; i < this.t; ++i) r[i] = this.DM & ~this[i]
1571 r.t = this.t
1572 r.s = ~this.s
1573 return r
1574 }
1575
1576 // (public) this << n
1577 function bnShiftLeft(n) {
1578 var r = new BigInteger()
1579 if (n < 0) this.rShiftTo(-n, r)
1580 else this.lShiftTo(n, r)
1581 return r
1582 }
1583
1584 // (public) this >> n
1585 function bnShiftRight(n) {
1586 var r = new BigInteger()
1587 if (n < 0) this.lShiftTo(-n, r)
1588 else this.rShiftTo(n, r)
1589 return r
1590 }
1591
1592 // return index of lowest 1-bit in x, x < 2^31
1593 function lbit(x) {
1594 if (x == 0) return -1
1595 var r = 0
1596 if ((x & 0xffff) == 0) {
1597 x >>= 16
1598 r += 16
1599 }
1600 if ((x & 0xff) == 0) {
1601 x >>= 8
1602 r += 8
1603 }
1604 if ((x & 0xf) == 0) {
1605 x >>= 4
1606 r += 4
1607 }
1608 if ((x & 3) == 0) {
1609 x >>= 2
1610 r += 2
1611 }
1612 if ((x & 1) == 0)++r
1613 return r
1614 }
1615
1616 // (public) returns index of lowest 1-bit (or -1 if none)
1617 function bnGetLowestSetBit() {
1618 for (var i = 0; i < this.t; ++i)
1619 if (this[i] != 0) return i * this.DB + lbit(this[i])
1620 if (this.s < 0) return this.t * this.DB
1621 return -1
1622 }
1623
1624 // return number of 1 bits in x
1625 function cbit(x) {
1626 var r = 0
1627 while (x != 0) {
1628 x &= x - 1
1629 ++r
1630 }
1631 return r
1632 }
1633
1634 // (public) return number of set bits
1635 function bnBitCount() {
1636 var r = 0,
1637 x = this.s & this.DM
1638 for (var i = 0; i < this.t; ++i) r += cbit(this[i] ^ x)
1639 return r
1640 }
1641
1642 // (public) true iff nth bit is set
1643 function bnTestBit(n) {
1644 var j = Math.floor(n / this.DB)
1645 if (j >= this.t) return (this.s != 0)
1646 return ((this[j] & (1 << (n % this.DB))) != 0)
1647 }
1648
1649 // (protected) this op (1<<n)
1650 function bnpChangeBit(n, op) {
1651 var r = BigInteger.ONE.shiftLeft(n)
1652 this.bitwiseTo(r, op, r)
1653 return r
1654 }
1655
1656 // (public) this | (1<<n)
1657 function bnSetBit(n) {
1658 return this.changeBit(n, op_or)
1659 }
1660
1661 // (public) this & ~(1<<n)
1662 function bnClearBit(n) {
1663 return this.changeBit(n, op_andnot)
1664 }
1665
1666 // (public) this ^ (1<<n)
1667 function bnFlipBit(n) {
1668 return this.changeBit(n, op_xor)
1669 }
1670
1671 // (protected) r = this + a
1672 function bnpAddTo(a, r) {
1673 var self = this
1674
1675 var i = 0,
1676 c = 0,
1677 m = Math.min(a.t, self.t)
1678 while (i < m) {
1679 c += self[i] + a[i]
1680 r[i++] = c & self.DM
1681 c >>= self.DB
1682 }
1683 if (a.t < self.t) {
1684 c += a.s
1685 while (i < self.t) {
1686 c += self[i]
1687 r[i++] = c & self.DM
1688 c >>= self.DB
1689 }
1690 c += self.s
1691 } else {
1692 c += self.s
1693 while (i < a.t) {
1694 c += a[i]
1695 r[i++] = c & self.DM
1696 c >>= self.DB
1697 }
1698 c += a.s
1699 }
1700 r.s = (c < 0) ? -1 : 0
1701 if (c > 0) r[i++] = c
1702 else if (c < -1) r[i++] = self.DV + c
1703 r.t = i
1704 r.clamp()
1705 }
1706
1707 // (public) this + a
1708 function bnAdd(a) {
1709 var r = new BigInteger()
1710 this.addTo(a, r)
1711 return r
1712 }
1713
1714 // (public) this - a
1715 function bnSubtract(a) {
1716 var r = new BigInteger()
1717 this.subTo(a, r)
1718 return r
1719 }
1720
1721 // (public) this * a
1722 function bnMultiply(a) {
1723 var r = new BigInteger()
1724 this.multiplyTo(a, r)
1725 return r
1726 }
1727
1728 // (public) this^2
1729 function bnSquare() {
1730 var r = new BigInteger()
1731 this.squareTo(r)
1732 return r
1733 }
1734
1735 // (public) this / a
1736 function bnDivide(a) {
1737 var r = new BigInteger()
1738 this.divRemTo(a, r, null)
1739 return r
1740 }
1741
1742 // (public) this % a
1743 function bnRemainder(a) {
1744 var r = new BigInteger()
1745 this.divRemTo(a, null, r)
1746 return r
1747 }
1748
1749 // (public) [this/a,this%a]
1750 function bnDivideAndRemainder(a) {
1751 var q = new BigInteger(),
1752 r = new BigInteger()
1753 this.divRemTo(a, q, r)
1754 return new Array(q, r)
1755 }
1756
1757 // (protected) this *= n, this >= 0, 1 < n < DV
1758 function bnpDMultiply(n) {
1759 this[this.t] = this.am(0, n - 1, this, 0, 0, this.t)
1760 ++this.t
1761 this.clamp()
1762 }
1763
1764 // (protected) this += n << w words, this >= 0
1765 function bnpDAddOffset(n, w) {
1766 if (n == 0) return
1767 while (this.t <= w) this[this.t++] = 0
1768 this[w] += n
1769 while (this[w] >= this.DV) {
1770 this[w] -= this.DV
1771 if (++w >= this.t) this[this.t++] = 0
1772 ++this[w]
1773 }
1774 }
1775
1776 // A "null" reducer
1777 function NullExp() {}
1778
1779 function nNop(x) {
1780 return x
1781 }
1782
1783 function nMulTo(x, y, r) {
1784 x.multiplyTo(y, r)
1785 }
1786
1787 function nSqrTo(x, r) {
1788 x.squareTo(r)
1789 }
1790
1791 NullExp.prototype.convert = nNop
1792 NullExp.prototype.revert = nNop
1793 NullExp.prototype.mulTo = nMulTo
1794 NullExp.prototype.sqrTo = nSqrTo
1795
1796 // (public) this^e
1797 function bnPow(e) {
1798 return this.exp(e, new NullExp())
1799 }
1800
1801 // (protected) r = lower n words of "this * a", a.t <= n
1802 // "this" should be the larger one if appropriate.
1803 function bnpMultiplyLowerTo(a, n, r) {
1804 var i = Math.min(this.t + a.t, n)
1805 r.s = 0; // assumes a,this >= 0
1806 r.t = i
1807 while (i > 0) r[--i] = 0
1808 var j
1809 for (j = r.t - this.t; i < j; ++i) r[i + this.t] = this.am(0, a[i], r, i, 0, this.t)
1810 for (j = Math.min(a.t, n); i < j; ++i) this.am(0, a[i], r, i, 0, n - i)
1811 r.clamp()
1812 }
1813
1814 // (protected) r = "this * a" without lower n words, n > 0
1815 // "this" should be the larger one if appropriate.
1816 function bnpMultiplyUpperTo(a, n, r) {
1817 --n
1818 var i = r.t = this.t + a.t - n
1819 r.s = 0; // assumes a,this >= 0
1820 while (--i >= 0) r[i] = 0
1821 for (i = Math.max(n - this.t, 0); i < a.t; ++i)
1822 r[this.t + i - n] = this.am(n - i, a[i], r, 0, 0, this.t + i - n)
1823 r.clamp()
1824 r.drShiftTo(1, r)
1825 }
1826
1827 // Barrett modular reduction
1828 function Barrett(m) {
1829 // setup Barrett
1830 this.r2 = new BigInteger()
1831 this.q3 = new BigInteger()
1832 BigInteger.ONE.dlShiftTo(2 * m.t, this.r2)
1833 this.mu = this.r2.divide(m)
1834 this.m = m
1835 }
1836
1837 function barrettConvert(x) {
1838 if (x.s < 0 || x.t > 2 * this.m.t) return x.mod(this.m)
1839 else if (x.compareTo(this.m) < 0) return x
1840 else {
1841 var r = new BigInteger()
1842 x.copyTo(r)
1843 this.reduce(r)
1844 return r
1845 }
1846 }
1847
1848 function barrettRevert(x) {
1849 return x
1850 }
1851
1852 // x = x mod m (HAC 14.42)
1853 function barrettReduce(x) {
1854 var self = this
1855 x.drShiftTo(self.m.t - 1, self.r2)
1856 if (x.t > self.m.t + 1) {
1857 x.t = self.m.t + 1
1858 x.clamp()
1859 }
1860 self.mu.multiplyUpperTo(self.r2, self.m.t + 1, self.q3)
1861 self.m.multiplyLowerTo(self.q3, self.m.t + 1, self.r2)
1862 while (x.compareTo(self.r2) < 0) x.dAddOffset(1, self.m.t + 1)
1863 x.subTo(self.r2, x)
1864 while (x.compareTo(self.m) >= 0) x.subTo(self.m, x)
1865 }
1866
1867 // r = x^2 mod m; x != r
1868 function barrettSqrTo(x, r) {
1869 x.squareTo(r)
1870 this.reduce(r)
1871 }
1872
1873 // r = x*y mod m; x,y != r
1874 function barrettMulTo(x, y, r) {
1875 x.multiplyTo(y, r)
1876 this.reduce(r)
1877 }
1878
1879 Barrett.prototype.convert = barrettConvert
1880 Barrett.prototype.revert = barrettRevert
1881 Barrett.prototype.reduce = barrettReduce
1882 Barrett.prototype.mulTo = barrettMulTo
1883 Barrett.prototype.sqrTo = barrettSqrTo
1884
1885 // (public) this^e % m (HAC 14.85)
1886 function bnModPow(e, m) {
1887 var i = e.bitLength(),
1888 k, r = nbv(1),
1889 z
1890 if (i <= 0) return r
1891 else if (i < 18) k = 1
1892 else if (i < 48) k = 3
1893 else if (i < 144) k = 4
1894 else if (i < 768) k = 5
1895 else k = 6
1896 if (i < 8)
1897 z = new Classic(m)
1898 else if (m.isEven())
1899 z = new Barrett(m)
1900 else
1901 z = new Montgomery(m)
1902
1903 // precomputation
1904 var g = new Array(),
1905 n = 3,
1906 k1 = k - 1,
1907 km = (1 << k) - 1
1908 g[1] = z.convert(this)
1909 if (k > 1) {
1910 var g2 = new BigInteger()
1911 z.sqrTo(g[1], g2)
1912 while (n <= km) {
1913 g[n] = new BigInteger()
1914 z.mulTo(g2, g[n - 2], g[n])
1915 n += 2
1916 }
1917 }
1918
1919 var j = e.t - 1,
1920 w, is1 = true,
1921 r2 = new BigInteger(),
1922 t
1923 i = nbits(e[j]) - 1
1924 while (j >= 0) {
1925 if (i >= k1) w = (e[j] >> (i - k1)) & km
1926 else {
1927 w = (e[j] & ((1 << (i + 1)) - 1)) << (k1 - i)
1928 if (j > 0) w |= e[j - 1] >> (this.DB + i - k1)
1929 }
1930
1931 n = k
1932 while ((w & 1) == 0) {
1933 w >>= 1
1934 --n
1935 }
1936 if ((i -= n) < 0) {
1937 i += this.DB
1938 --j
1939 }
1940 if (is1) { // ret == 1, don't bother squaring or multiplying it
1941 g[w].copyTo(r)
1942 is1 = false
1943 } else {
1944 while (n > 1) {
1945 z.sqrTo(r, r2)
1946 z.sqrTo(r2, r)
1947 n -= 2
1948 }
1949 if (n > 0) z.sqrTo(r, r2)
1950 else {
1951 t = r
1952 r = r2
1953 r2 = t
1954 }
1955 z.mulTo(r2, g[w], r)
1956 }
1957
1958 while (j >= 0 && (e[j] & (1 << i)) == 0) {
1959 z.sqrTo(r, r2)
1960 t = r
1961 r = r2
1962 r2 = t
1963 if (--i < 0) {
1964 i = this.DB - 1
1965 --j
1966 }
1967 }
1968 }
1969 return z.revert(r)
1970 }
1971
1972 // (public) gcd(this,a) (HAC 14.54)
1973 function bnGCD(a) {
1974 var x = (this.s < 0) ? this.negate() : this.clone()
1975 var y = (a.s < 0) ? a.negate() : a.clone()
1976 if (x.compareTo(y) < 0) {
1977 var t = x
1978 x = y
1979 y = t
1980 }
1981 var i = x.getLowestSetBit(),
1982 g = y.getLowestSetBit()
1983 if (g < 0) return x
1984 if (i < g) g = i
1985 if (g > 0) {
1986 x.rShiftTo(g, x)
1987 y.rShiftTo(g, y)
1988 }
1989 while (x.signum() > 0) {
1990 if ((i = x.getLowestSetBit()) > 0) x.rShiftTo(i, x)
1991 if ((i = y.getLowestSetBit()) > 0) y.rShiftTo(i, y)
1992 if (x.compareTo(y) >= 0) {
1993 x.subTo(y, x)
1994 x.rShiftTo(1, x)
1995 } else {
1996 y.subTo(x, y)
1997 y.rShiftTo(1, y)
1998 }
1999 }
2000 if (g > 0) y.lShiftTo(g, y)
2001 return y
2002 }
2003
2004 // (protected) this % n, n < 2^26
2005 function bnpModInt(n) {
2006 if (n <= 0) return 0
2007 var d = this.DV % n,
2008 r = (this.s < 0) ? n - 1 : 0
2009 if (this.t > 0)
2010 if (d == 0) r = this[0] % n
2011 else
2012 for (var i = this.t - 1; i >= 0; --i) r = (d * r + this[i]) % n
2013 return r
2014 }
2015
2016 // (public) 1/this % m (HAC 14.61)
2017 function bnModInverse(m) {
2018 var ac = m.isEven()
2019 if ((this.isEven() && ac) || m.signum() == 0) return BigInteger.ZERO
2020 var u = m.clone(),
2021 v = this.clone()
2022 var a = nbv(1),
2023 b = nbv(0),
2024 c = nbv(0),
2025 d = nbv(1)
2026 while (u.signum() != 0) {
2027 while (u.isEven()) {
2028 u.rShiftTo(1, u)
2029 if (ac) {
2030 if (!a.isEven() || !b.isEven()) {
2031 a.addTo(this, a)
2032 b.subTo(m, b)
2033 }
2034 a.rShiftTo(1, a)
2035 } else if (!b.isEven()) b.subTo(m, b)
2036 b.rShiftTo(1, b)
2037 }
2038 while (v.isEven()) {
2039 v.rShiftTo(1, v)
2040 if (ac) {
2041 if (!c.isEven() || !d.isEven()) {
2042 c.addTo(this, c)
2043 d.subTo(m, d)
2044 }
2045 c.rShiftTo(1, c)
2046 } else if (!d.isEven()) d.subTo(m, d)
2047 d.rShiftTo(1, d)
2048 }
2049 if (u.compareTo(v) >= 0) {
2050 u.subTo(v, u)
2051 if (ac) a.subTo(c, a)
2052 b.subTo(d, b)
2053 } else {
2054 v.subTo(u, v)
2055 if (ac) c.subTo(a, c)
2056 d.subTo(b, d)
2057 }
2058 }
2059 if (v.compareTo(BigInteger.ONE) != 0) return BigInteger.ZERO
2060 if (d.compareTo(m) >= 0) return d.subtract(m)
2061 if (d.signum() < 0) d.addTo(m, d)
2062 else return d
2063 if (d.signum() < 0) return d.add(m)
2064 else return d
2065 }
2066
2067 var lowprimes = [
2068 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71,
2069 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151,
2070 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233,
2071 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317,
2072 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419,
2073 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503,
2074 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607,
2075 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701,
2076 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811,
2077 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911,
2078 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997
2079 ]
2080
2081 var lplim = (1 << 26) / lowprimes[lowprimes.length - 1]
2082
2083 // (public) test primality with certainty >= 1-.5^t
2084 function bnIsProbablePrime(t) {
2085 var i, x = this.abs()
2086 if (x.t == 1 && x[0] <= lowprimes[lowprimes.length - 1]) {
2087 for (i = 0; i < lowprimes.length; ++i)
2088 if (x[0] == lowprimes[i]) return true
2089 return false
2090 }
2091 if (x.isEven()) return false
2092 i = 1
2093 while (i < lowprimes.length) {
2094 var m = lowprimes[i],
2095 j = i + 1
2096 while (j < lowprimes.length && m < lplim) m *= lowprimes[j++]
2097 m = x.modInt(m)
2098 while (i < j) if (m % lowprimes[i++] == 0) return false
2099 }
2100 return x.millerRabin(t)
2101 }
2102
2103 // (protected) true if probably prime (HAC 4.24, Miller-Rabin)
2104 function bnpMillerRabin(t) {
2105 var n1 = this.subtract(BigInteger.ONE)
2106 var k = n1.getLowestSetBit()
2107 if (k <= 0) return false
2108 var r = n1.shiftRight(k)
2109 t = (t + 1) >> 1
2110 if (t > lowprimes.length) t = lowprimes.length
2111 var a = new BigInteger(null)
2112 var j, bases = []
2113 for (var i = 0; i < t; ++i) {
2114 for (;;) {
2115 j = lowprimes[Math.floor(Math.random() * lowprimes.length)]
2116 if (bases.indexOf(j) == -1) break
2117 }
2118 bases.push(j)
2119 a.fromInt(j)
2120 var y = a.modPow(r, this)
2121 if (y.compareTo(BigInteger.ONE) != 0 && y.compareTo(n1) != 0) {
2122 var j = 1
2123 while (j++ < k && y.compareTo(n1) != 0) {
2124 y = y.modPowInt(2, this)
2125 if (y.compareTo(BigInteger.ONE) == 0) return false
2126 }
2127 if (y.compareTo(n1) != 0) return false
2128 }
2129 }
2130 return true
2131 }
2132
2133 // protected
2134 proto.chunkSize = bnpChunkSize
2135 proto.toRadix = bnpToRadix
2136 proto.fromRadix = bnpFromRadix
2137 proto.fromNumber = bnpFromNumber
2138 proto.bitwiseTo = bnpBitwiseTo
2139 proto.changeBit = bnpChangeBit
2140 proto.addTo = bnpAddTo
2141 proto.dMultiply = bnpDMultiply
2142 proto.dAddOffset = bnpDAddOffset
2143 proto.multiplyLowerTo = bnpMultiplyLowerTo
2144 proto.multiplyUpperTo = bnpMultiplyUpperTo
2145 proto.modInt = bnpModInt
2146 proto.millerRabin = bnpMillerRabin
2147
2148 // public
2149 proto.clone = bnClone
2150 proto.intValue = bnIntValue
2151 proto.byteValue = bnByteValue
2152 proto.shortValue = bnShortValue
2153 proto.signum = bnSigNum
2154 proto.toByteArray = bnToByteArray
2155 proto.equals = bnEquals
2156 proto.min = bnMin
2157 proto.max = bnMax
2158 proto.and = bnAnd
2159 proto.or = bnOr
2160 proto.xor = bnXor
2161 proto.andNot = bnAndNot
2162 proto.not = bnNot
2163 proto.shiftLeft = bnShiftLeft
2164 proto.shiftRight = bnShiftRight
2165 proto.getLowestSetBit = bnGetLowestSetBit
2166 proto.bitCount = bnBitCount
2167 proto.testBit = bnTestBit
2168 proto.setBit = bnSetBit
2169 proto.clearBit = bnClearBit
2170 proto.flipBit = bnFlipBit
2171 proto.add = bnAdd
2172 proto.subtract = bnSubtract
2173 proto.multiply = bnMultiply
2174 proto.divide = bnDivide
2175 proto.remainder = bnRemainder
2176 proto.divideAndRemainder = bnDivideAndRemainder
2177 proto.modPow = bnModPow
2178 proto.modInverse = bnModInverse
2179 proto.pow = bnPow
2180 proto.gcd = bnGCD
2181 proto.isProbablePrime = bnIsProbablePrime
2182
2183 // JSBN-specific extension
2184 proto.square = bnSquare
2185
2186 // constants
2187 BigInteger.ZERO = nbv(0)
2188 BigInteger.ONE = nbv(1)
2189 BigInteger.valueOf = nbv
2190
2191 module.exports = BigInteger
2192
2193 },{"../package.json":4}],2:[function(require,module,exports){
2194 (function (Buffer){
2195 // FIXME: Kind of a weird way to throw exceptions, consider removing
2196 var assert = require('assert')
2197 var BigInteger = require('./bigi')
2198
2199 /**
2200 * Turns a byte array into a big integer.
2201 *
2202 * This function will interpret a byte array as a big integer in big
2203 * endian notation.
2204 */
2205 BigInteger.fromByteArrayUnsigned = function(byteArray) {
2206 // BigInteger expects a DER integer conformant byte array
2207 if (byteArray[0] & 0x80) {
2208 return new BigInteger([0].concat(byteArray))
2209 }
2210
2211 return new BigInteger(byteArray)
2212 }
2213
2214 /**
2215 * Returns a byte array representation of the big integer.
2216 *
2217 * This returns the absolute of the contained value in big endian
2218 * form. A value of zero results in an empty array.
2219 */
2220 BigInteger.prototype.toByteArrayUnsigned = function() {
2221 var byteArray = this.toByteArray()
2222 return byteArray[0] === 0 ? byteArray.slice(1) : byteArray
2223 }
2224
2225 BigInteger.fromDERInteger = function(byteArray) {
2226 return new BigInteger(byteArray)
2227 }
2228
2229 /*
2230 * Converts BigInteger to a DER integer representation.
2231 *
2232 * The format for this value uses the most significant bit as a sign
2233 * bit. If the most significant bit is already set and the integer is
2234 * positive, a 0x00 is prepended.
2235 *
2236 * Examples:
2237 *
2238 * 0 => 0x00
2239 * 1 => 0x01
2240 * -1 => 0xff
2241 * 127 => 0x7f
2242 * -127 => 0x81
2243 * 128 => 0x0080
2244 * -128 => 0x80
2245 * 255 => 0x00ff
2246 * -255 => 0xff01
2247 * 16300 => 0x3fac
2248 * -16300 => 0xc054
2249 * 62300 => 0x00f35c
2250 * -62300 => 0xff0ca4
2251 */
2252 BigInteger.prototype.toDERInteger = BigInteger.prototype.toByteArray
2253
2254 BigInteger.fromBuffer = function(buffer) {
2255 // BigInteger expects a DER integer conformant byte array
2256 if (buffer[0] & 0x80) {
2257 var byteArray = Array.prototype.slice.call(buffer)
2258
2259 return new BigInteger([0].concat(byteArray))
2260 }
2261
2262 return new BigInteger(buffer)
2263 }
2264
2265 BigInteger.fromHex = function(hex) {
2266 if (hex === '') return BigInteger.ZERO
2267
2268 assert.equal(hex, hex.match(/^[A-Fa-f0-9]+/), 'Invalid hex string')
2269 assert.equal(hex.length % 2, 0, 'Incomplete hex')
2270 return new BigInteger(hex, 16)
2271 }
2272
2273 BigInteger.prototype.toBuffer = function(size) {
2274 var byteArray = this.toByteArrayUnsigned()
2275 var zeros = []
2276
2277 var padding = size - byteArray.length
2278 while (zeros.length < padding) zeros.push(0)
2279
2280 return new Buffer(zeros.concat(byteArray))
2281 }
2282
2283 BigInteger.prototype.toHex = function(size) {
2284 return this.toBuffer(size).toString('hex')
2285 }
2286
2287 }).call(this,require("buffer").Buffer)
2288 },{"./bigi":1,"assert":5,"buffer":7}],3:[function(require,module,exports){
2289 var BigInteger = require('./bigi')
2290
2291 //addons
2292 require('./convert')
2293
2294 module.exports = BigInteger
2295 },{"./bigi":1,"./convert":2}],4:[function(require,module,exports){
2296 module.exports={
2297 "name": "bigi",
2298 "version": "1.4.0",
2299 "description": "Big integers.",
2300 "keywords": [
2301 "cryptography",
2302 "math",
2303 "bitcoin",
2304 "arbitrary",
2305 "precision",
2306 "arithmetic",
2307 "big",
2308 "integer",
2309 "int",
2310 "number",
2311 "biginteger",
2312 "bigint",
2313 "bignumber",
2314 "decimal",
2315 "float"
2316 ],
2317 "devDependencies": {
2318 "mocha": "^1.20.1",
2319 "jshint": "^2.5.1",
2320 "coveralls": "^2.10.0",
2321 "istanbul": "^0.2.11"
2322 },
2323 "repository": {
2324 "url": "https://github.com/cryptocoinjs/bigi",
2325 "type": "git"
2326 },
2327 "main": "./lib/index.js",
2328 "scripts": {
2329 "test": "_mocha -- test/*.js",
2330 "jshint": "jshint --config jshint.json lib/*.js ; true",
2331 "unit": "mocha",
2332 "coverage": "istanbul cover ./node_modules/.bin/_mocha -- --reporter list test/*.js",
2333 "coveralls": "npm run-script coverage && node ./node_modules/.bin/coveralls < coverage/lcov.info"
2334 },
2335 "dependencies": {},
2336 "testling": {
2337 "files": "test/*.js",
2338 "harness": "mocha",
2339 "browsers": [
2340 "ie/9..latest",
2341 "firefox/latest",
2342 "chrome/latest",
2343 "safari/6.0..latest",
2344 "iphone/6.0..latest",
2345 "android-browser/4.2..latest"
2346 ]
2347 },
2348 "bugs": {
2349 "url": "https://github.com/cryptocoinjs/bigi/issues"
2350 },
2351 "homepage": "https://github.com/cryptocoinjs/bigi",
2352 "_id": "bigi@1.4.0",
2353 "dist": {
2354 "shasum": "90ac1aeac0a531216463bdb58f42c1e05c8407ac",
2355 "tarball": "http://registry.npmjs.org/bigi/-/bigi-1.4.0.tgz"
2356 },
2357 "_from": "bigi@^1.4.0",
2358 "_npmVersion": "1.4.3",
2359 "_npmUser": {
2360 "name": "jp",
2361 "email": "jprichardson@gmail.com"
2362 },
2363 "maintainers": [
2364 {
2365 "name": "jp",
2366 "email": "jprichardson@gmail.com"
2367 },
2368 {
2369 "name": "midnightlightning",
2370 "email": "boydb@midnightdesign.ws"
2371 },
2372 {
2373 "name": "sidazhang",
2374 "email": "sidazhang89@gmail.com"
2375 },
2376 {
2377 "name": "nadav",
2378 "email": "npm@shesek.info"
2379 }
2380 ],
2381 "directories": {},
2382 "_shasum": "90ac1aeac0a531216463bdb58f42c1e05c8407ac",
2383 "_resolved": "https://registry.npmjs.org/bigi/-/bigi-1.4.0.tgz"
2384 }
2385
2386 },{}],5:[function(require,module,exports){
2387 // http://wiki.commonjs.org/wiki/Unit_Testing/1.0
2388 //
2389 // THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8!
2390 //
2391 // Originally from narwhal.js (http://narwhaljs.org)
2392 // Copyright (c) 2009 Thomas Robinson <280north.com>
2393 //
2394 // Permission is hereby granted, free of charge, to any person obtaining a copy
2395 // of this software and associated documentation files (the 'Software'), to
2396 // deal in the Software without restriction, including without limitation the
2397 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
2398 // sell copies of the Software, and to permit persons to whom the Software is
2399 // furnished to do so, subject to the following conditions:
2400 //
2401 // The above copyright notice and this permission notice shall be included in
2402 // all copies or substantial portions of the Software.
2403 //
2404 // THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2405 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2406 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2407 // AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
2408 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
2409 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2410
2411 // when used in node, this will actually load the util module we depend on
2412 // versus loading the builtin util module as happens otherwise
2413 // this is a bug in node module loading as far as I am concerned
2414 var util = require('util/');
2415
2416 var pSlice = Array.prototype.slice;
2417 var hasOwn = Object.prototype.hasOwnProperty;
2418
2419 // 1. The assert module provides functions that throw
2420 // AssertionError's when particular conditions are not met. The
2421 // assert module must conform to the following interface.
2422
2423 var assert = module.exports = ok;
2424
2425 // 2. The AssertionError is defined in assert.
2426 // new assert.AssertionError({ message: message,
2427 // actual: actual,
2428 // expected: expected })
2429
2430 assert.AssertionError = function AssertionError(options) {
2431 this.name = 'AssertionError';
2432 this.actual = options.actual;
2433 this.expected = options.expected;
2434 this.operator = options.operator;
2435 if (options.message) {
2436 this.message = options.message;
2437 this.generatedMessage = false;
2438 } else {
2439 this.message = getMessage(this);
2440 this.generatedMessage = true;
2441 }
2442 var stackStartFunction = options.stackStartFunction || fail;
2443
2444 if (Error.captureStackTrace) {
2445 Error.captureStackTrace(this, stackStartFunction);
2446 }
2447 else {
2448 // non v8 browsers so we can have a stacktrace
2449 var err = new Error();
2450 if (err.stack) {
2451 var out = err.stack;
2452
2453 // try to strip useless frames
2454 var fn_name = stackStartFunction.name;
2455 var idx = out.indexOf('\n' + fn_name);
2456 if (idx >= 0) {
2457 // once we have located the function frame
2458 // we need to strip out everything before it (and its line)
2459 var next_line = out.indexOf('\n', idx + 1);
2460 out = out.substring(next_line + 1);
2461 }
2462
2463 this.stack = out;
2464 }
2465 }
2466 };
2467
2468 // assert.AssertionError instanceof Error
2469 util.inherits(assert.AssertionError, Error);
2470
2471 function replacer(key, value) {
2472 if (util.isUndefined(value)) {
2473 return '' + value;
2474 }
2475 if (util.isNumber(value) && !isFinite(value)) {
2476 return value.toString();
2477 }
2478 if (util.isFunction(value) || util.isRegExp(value)) {
2479 return value.toString();
2480 }
2481 return value;
2482 }
2483
2484 function truncate(s, n) {
2485 if (util.isString(s)) {
2486 return s.length < n ? s : s.slice(0, n);
2487 } else {
2488 return s;
2489 }
2490 }
2491
2492 function getMessage(self) {
2493 return truncate(JSON.stringify(self.actual, replacer), 128) + ' ' +
2494 self.operator + ' ' +
2495 truncate(JSON.stringify(self.expected, replacer), 128);
2496 }
2497
2498 // At present only the three keys mentioned above are used and
2499 // understood by the spec. Implementations or sub modules can pass
2500 // other keys to the AssertionError's constructor - they will be
2501 // ignored.
2502
2503 // 3. All of the following functions must throw an AssertionError
2504 // when a corresponding condition is not met, with a message that
2505 // may be undefined if not provided. All assertion methods provide
2506 // both the actual and expected values to the assertion error for
2507 // display purposes.
2508
2509 function fail(actual, expected, message, operator, stackStartFunction) {
2510 throw new assert.AssertionError({
2511 message: message,
2512 actual: actual,
2513 expected: expected,
2514 operator: operator,
2515 stackStartFunction: stackStartFunction
2516 });
2517 }
2518
2519 // EXTENSION! allows for well behaved errors defined elsewhere.
2520 assert.fail = fail;
2521
2522 // 4. Pure assertion tests whether a value is truthy, as determined
2523 // by !!guard.
2524 // assert.ok(guard, message_opt);
2525 // This statement is equivalent to assert.equal(true, !!guard,
2526 // message_opt);. To test strictly for the value true, use
2527 // assert.strictEqual(true, guard, message_opt);.
2528
2529 function ok(value, message) {
2530 if (!value) fail(value, true, message, '==', assert.ok);
2531 }
2532 assert.ok = ok;
2533
2534 // 5. The equality assertion tests shallow, coercive equality with
2535 // ==.
2536 // assert.equal(actual, expected, message_opt);
2537
2538 assert.equal = function equal(actual, expected, message) {
2539 if (actual != expected) fail(actual, expected, message, '==', assert.equal);
2540 };
2541
2542 // 6. The non-equality assertion tests for whether two objects are not equal
2543 // with != assert.notEqual(actual, expected, message_opt);
2544
2545 assert.notEqual = function notEqual(actual, expected, message) {
2546 if (actual == expected) {
2547 fail(actual, expected, message, '!=', assert.notEqual);
2548 }
2549 };
2550
2551 // 7. The equivalence assertion tests a deep equality relation.
2552 // assert.deepEqual(actual, expected, message_opt);
2553
2554 assert.deepEqual = function deepEqual(actual, expected, message) {
2555 if (!_deepEqual(actual, expected)) {
2556 fail(actual, expected, message, 'deepEqual', assert.deepEqual);
2557 }
2558 };
2559
2560 function _deepEqual(actual, expected) {
2561 // 7.1. All identical values are equivalent, as determined by ===.
2562 if (actual === expected) {
2563 return true;
2564
2565 } else if (util.isBuffer(actual) && util.isBuffer(expected)) {
2566 if (actual.length != expected.length) return false;
2567
2568 for (var i = 0; i < actual.length; i++) {
2569 if (actual[i] !== expected[i]) return false;
2570 }
2571
2572 return true;
2573
2574 // 7.2. If the expected value is a Date object, the actual value is
2575 // equivalent if it is also a Date object that refers to the same time.
2576 } else if (util.isDate(actual) && util.isDate(expected)) {
2577 return actual.getTime() === expected.getTime();
2578
2579 // 7.3 If the expected value is a RegExp object, the actual value is
2580 // equivalent if it is also a RegExp object with the same source and
2581 // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`).
2582 } else if (util.isRegExp(actual) && util.isRegExp(expected)) {
2583 return actual.source === expected.source &&
2584 actual.global === expected.global &&
2585 actual.multiline === expected.multiline &&
2586 actual.lastIndex === expected.lastIndex &&
2587 actual.ignoreCase === expected.ignoreCase;
2588
2589 // 7.4. Other pairs that do not both pass typeof value == 'object',
2590 // equivalence is determined by ==.
2591 } else if (!util.isObject(actual) && !util.isObject(expected)) {
2592 return actual == expected;
2593
2594 // 7.5 For all other Object pairs, including Array objects, equivalence is
2595 // determined by having the same number of owned properties (as verified
2596 // with Object.prototype.hasOwnProperty.call), the same set of keys
2597 // (although not necessarily the same order), equivalent values for every
2598 // corresponding key, and an identical 'prototype' property. Note: this
2599 // accounts for both named and indexed properties on Arrays.
2600 } else {
2601 return objEquiv(actual, expected);
2602 }
2603 }
2604
2605 function isArguments(object) {
2606 return Object.prototype.toString.call(object) == '[object Arguments]';
2607 }
2608
2609 function objEquiv(a, b) {
2610 if (util.isNullOrUndefined(a) || util.isNullOrUndefined(b))
2611 return false;
2612 // an identical 'prototype' property.
2613 if (a.prototype !== b.prototype) return false;
2614 // if one is a primitive, the other must be same
2615 if (util.isPrimitive(a) || util.isPrimitive(b)) {
2616 return a === b;
2617 }
2618 var aIsArgs = isArguments(a),
2619 bIsArgs = isArguments(b);
2620 if ((aIsArgs && !bIsArgs) || (!aIsArgs && bIsArgs))
2621 return false;
2622 if (aIsArgs) {
2623 a = pSlice.call(a);
2624 b = pSlice.call(b);
2625 return _deepEqual(a, b);
2626 }
2627 var ka = objectKeys(a),
2628 kb = objectKeys(b),
2629 key, i;
2630 // having the same number of owned properties (keys incorporates
2631 // hasOwnProperty)
2632 if (ka.length != kb.length)
2633 return false;
2634 //the same set of keys (although not necessarily the same order),
2635 ka.sort();
2636 kb.sort();
2637 //~~~cheap key test
2638 for (i = ka.length - 1; i >= 0; i--) {
2639 if (ka[i] != kb[i])
2640 return false;
2641 }
2642 //equivalent values for every corresponding key, and
2643 //~~~possibly expensive deep test
2644 for (i = ka.length - 1; i >= 0; i--) {
2645 key = ka[i];
2646 if (!_deepEqual(a[key], b[key])) return false;
2647 }
2648 return true;
2649 }
2650
2651 // 8. The non-equivalence assertion tests for any deep inequality.
2652 // assert.notDeepEqual(actual, expected, message_opt);
2653
2654 assert.notDeepEqual = function notDeepEqual(actual, expected, message) {
2655 if (_deepEqual(actual, expected)) {
2656 fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual);
2657 }
2658 };
2659
2660 // 9. The strict equality assertion tests strict equality, as determined by ===.
2661 // assert.strictEqual(actual, expected, message_opt);
2662
2663 assert.strictEqual = function strictEqual(actual, expected, message) {
2664 if (actual !== expected) {
2665 fail(actual, expected, message, '===', assert.strictEqual);
2666 }
2667 };
2668
2669 // 10. The strict non-equality assertion tests for strict inequality, as
2670 // determined by !==. assert.notStrictEqual(actual, expected, message_opt);
2671
2672 assert.notStrictEqual = function notStrictEqual(actual, expected, message) {
2673 if (actual === expected) {
2674 fail(actual, expected, message, '!==', assert.notStrictEqual);
2675 }
2676 };
2677
2678 function expectedException(actual, expected) {
2679 if (!actual || !expected) {
2680 return false;
2681 }
2682
2683 if (Object.prototype.toString.call(expected) == '[object RegExp]') {
2684 return expected.test(actual);
2685 } else if (actual instanceof expected) {
2686 return true;
2687 } else if (expected.call({}, actual) === true) {
2688 return true;
2689 }
2690
2691 return false;
2692 }
2693
2694 function _throws(shouldThrow, block, expected, message) {
2695 var actual;
2696
2697 if (util.isString(expected)) {
2698 message = expected;
2699 expected = null;
2700 }
2701
2702 try {
2703 block();
2704 } catch (e) {
2705 actual = e;
2706 }
2707
2708 message = (expected && expected.name ? ' (' + expected.name + ').' : '.') +
2709 (message ? ' ' + message : '.');
2710
2711 if (shouldThrow && !actual) {
2712 fail(actual, expected, 'Missing expected exception' + message);
2713 }
2714
2715 if (!shouldThrow && expectedException(actual, expected)) {
2716 fail(actual, expected, 'Got unwanted exception' + message);
2717 }
2718
2719 if ((shouldThrow && actual && expected &&
2720 !expectedException(actual, expected)) || (!shouldThrow && actual)) {
2721 throw actual;
2722 }
2723 }
2724
2725 // 11. Expected to throw an error:
2726 // assert.throws(block, Error_opt, message_opt);
2727
2728 assert.throws = function(block, /*optional*/error, /*optional*/message) {
2729 _throws.apply(this, [true].concat(pSlice.call(arguments)));
2730 };
2731
2732 // EXTENSION! This is annoying to write outside this module.
2733 assert.doesNotThrow = function(block, /*optional*/message) {
2734 _throws.apply(this, [false].concat(pSlice.call(arguments)));
2735 };
2736
2737 assert.ifError = function(err) { if (err) {throw err;}};
2738
2739 var objectKeys = Object.keys || function (obj) {
2740 var keys = [];
2741 for (var key in obj) {
2742 if (hasOwn.call(obj, key)) keys.push(key);
2743 }
2744 return keys;
2745 };
2746
2747 },{"util/":29}],6:[function(require,module,exports){
2748
2749 },{}],7:[function(require,module,exports){
2750 /*!
2751 * The buffer module from node.js, for the browser.
2752 *
2753 * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
2754 * @license MIT
2755 */
2756
2757 var base64 = require('base64-js')
2758 var ieee754 = require('ieee754')
2759 var isArray = require('is-array')
2760
2761 exports.Buffer = Buffer
2762 exports.SlowBuffer = SlowBuffer
2763 exports.INSPECT_MAX_BYTES = 50
2764 Buffer.poolSize = 8192 // not used by this implementation
2765
2766 var rootParent = {}
2767
2768 /**
2769 * If `Buffer.TYPED_ARRAY_SUPPORT`:
2770 * === true Use Uint8Array implementation (fastest)
2771 * === false Use Object implementation (most compatible, even IE6)
2772 *
2773 * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
2774 * Opera 11.6+, iOS 4.2+.
2775 *
2776 * Due to various browser bugs, sometimes the Object implementation will be used even
2777 * when the browser supports typed arrays.
2778 *
2779 * Note:
2780 *
2781 * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,
2782 * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
2783 *
2784 * - Safari 5-7 lacks support for changing the `Object.prototype.constructor` property
2785 * on objects.
2786 *
2787 * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
2788 *
2789 * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
2790 * incorrect length in some situations.
2791
2792 * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they
2793 * get the Object implementation, which is slower but behaves correctly.
2794 */
2795 Buffer.TYPED_ARRAY_SUPPORT = (function () {
2796 function Bar () {}
2797 try {
2798 var arr = new Uint8Array(1)
2799 arr.foo = function () { return 42 }
2800 arr.constructor = Bar
2801 return arr.foo() === 42 && // typed array instances can be augmented
2802 arr.constructor === Bar && // constructor can be set
2803 typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`
2804 arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`
2805 } catch (e) {
2806 return false
2807 }
2808 })()
2809
2810 function kMaxLength () {
2811 return Buffer.TYPED_ARRAY_SUPPORT
2812 ? 0x7fffffff
2813 : 0x3fffffff
2814 }
2815
2816 /**
2817 * Class: Buffer
2818 * =============
2819 *
2820 * The Buffer constructor returns instances of `Uint8Array` that are augmented
2821 * with function properties for all the node `Buffer` API functions. We use
2822 * `Uint8Array` so that square bracket notation works as expected -- it returns
2823 * a single octet.
2824 *
2825 * By augmenting the instances, we can avoid modifying the `Uint8Array`
2826 * prototype.
2827 */
2828 function Buffer (arg) {
2829 if (!(this instanceof Buffer)) {
2830 // Avoid going through an ArgumentsAdaptorTrampoline in the common case.
2831 if (arguments.length > 1) return new Buffer(arg, arguments[1])
2832 return new Buffer(arg)
2833 }
2834
2835 this.length = 0
2836 this.parent = undefined
2837
2838 // Common case.
2839 if (typeof arg === 'number') {
2840 return fromNumber(this, arg)
2841 }
2842
2843 // Slightly less common case.
2844 if (typeof arg === 'string') {
2845 return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')
2846 }
2847
2848 // Unusual.
2849 return fromObject(this, arg)
2850 }
2851
2852 function fromNumber (that, length) {
2853 that = allocate(that, length < 0 ? 0 : checked(length) | 0)
2854 if (!Buffer.TYPED_ARRAY_SUPPORT) {
2855 for (var i = 0; i < length; i++) {
2856 that[i] = 0
2857 }
2858 }
2859 return that
2860 }
2861
2862 function fromString (that, string, encoding) {
2863 if (typeof encoding !== 'string' || encoding === '') encoding = 'utf8'
2864
2865 // Assumption: byteLength() return value is always < kMaxLength.
2866 var length = byteLength(string, encoding) | 0
2867 that = allocate(that, length)
2868
2869 that.write(string, encoding)
2870 return that
2871 }
2872
2873 function fromObject (that, object) {
2874 if (Buffer.isBuffer(object)) return fromBuffer(that, object)
2875
2876 if (isArray(object)) return fromArray(that, object)
2877
2878 if (object == null) {
2879 throw new TypeError('must start with number, buffer, array or string')
2880 }
2881
2882 if (typeof ArrayBuffer !== 'undefined') {
2883 if (object.buffer instanceof ArrayBuffer) {
2884 return fromTypedArray(that, object)
2885 }
2886 if (object instanceof ArrayBuffer) {
2887 return fromArrayBuffer(that, object)
2888 }
2889 }
2890
2891 if (object.length) return fromArrayLike(that, object)
2892
2893 return fromJsonObject(that, object)
2894 }
2895
2896 function fromBuffer (that, buffer) {
2897 var length = checked(buffer.length) | 0
2898 that = allocate(that, length)
2899 buffer.copy(that, 0, 0, length)
2900 return that
2901 }
2902
2903 function fromArray (that, array) {
2904 var length = checked(array.length) | 0
2905 that = allocate(that, length)
2906 for (var i = 0; i < length; i += 1) {
2907 that[i] = array[i] & 255
2908 }
2909 return that
2910 }
2911
2912 // Duplicate of fromArray() to keep fromArray() monomorphic.
2913 function fromTypedArray (that, array) {
2914 var length = checked(array.length) | 0
2915 that = allocate(that, length)
2916 // Truncating the elements is probably not what people expect from typed
2917 // arrays with BYTES_PER_ELEMENT > 1 but it's compatible with the behavior
2918 // of the old Buffer constructor.
2919 for (var i = 0; i < length; i += 1) {
2920 that[i] = array[i] & 255
2921 }
2922 return that
2923 }
2924
2925 function fromArrayBuffer (that, array) {
2926 if (Buffer.TYPED_ARRAY_SUPPORT) {
2927 // Return an augmented `Uint8Array` instance, for best performance
2928 array.byteLength
2929 that = Buffer._augment(new Uint8Array(array))
2930 } else {
2931 // Fallback: Return an object instance of the Buffer class
2932 that = fromTypedArray(that, new Uint8Array(array))
2933 }
2934 return that
2935 }
2936
2937 function fromArrayLike (that, array) {
2938 var length = checked(array.length) | 0
2939 that = allocate(that, length)
2940 for (var i = 0; i < length; i += 1) {
2941 that[i] = array[i] & 255
2942 }
2943 return that
2944 }
2945
2946 // Deserialize { type: 'Buffer', data: [1,2,3,...] } into a Buffer object.
2947 // Returns a zero-length buffer for inputs that don't conform to the spec.
2948 function fromJsonObject (that, object) {
2949 var array
2950 var length = 0
2951
2952 if (object.type === 'Buffer' && isArray(object.data)) {
2953 array = object.data
2954 length = checked(array.length) | 0
2955 }
2956 that = allocate(that, length)
2957
2958 for (var i = 0; i < length; i += 1) {
2959 that[i] = array[i] & 255
2960 }
2961 return that
2962 }
2963
2964 function allocate (that, length) {
2965 if (Buffer.TYPED_ARRAY_SUPPORT) {
2966 // Return an augmented `Uint8Array` instance, for best performance
2967 that = Buffer._augment(new Uint8Array(length))
2968 } else {
2969 // Fallback: Return an object instance of the Buffer class
2970 that.length = length
2971 that._isBuffer = true
2972 }
2973
2974 var fromPool = length !== 0 && length <= Buffer.poolSize >>> 1
2975 if (fromPool) that.parent = rootParent
2976
2977 return that
2978 }
2979
2980 function checked (length) {
2981 // Note: cannot use `length < kMaxLength` here because that fails when
2982 // length is NaN (which is otherwise coerced to zero.)
2983 if (length >= kMaxLength()) {
2984 throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
2985 'size: 0x' + kMaxLength().toString(16) + ' bytes')
2986 }
2987 return length | 0
2988 }
2989
2990 function SlowBuffer (subject, encoding) {
2991 if (!(this instanceof SlowBuffer)) return new SlowBuffer(subject, encoding)
2992
2993 var buf = new Buffer(subject, encoding)
2994 delete buf.parent
2995 return buf
2996 }
2997
2998 Buffer.isBuffer = function isBuffer (b) {
2999 return !!(b != null && b._isBuffer)
3000 }
3001
3002 Buffer.compare = function compare (a, b) {
3003 if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
3004 throw new TypeError('Arguments must be Buffers')
3005 }
3006
3007 if (a === b) return 0
3008
3009 var x = a.length
3010 var y = b.length
3011
3012 var i = 0
3013 var len = Math.min(x, y)
3014 while (i < len) {
3015 if (a[i] !== b[i]) break
3016
3017 ++i
3018 }
3019
3020 if (i !== len) {
3021 x = a[i]
3022 y = b[i]
3023 }
3024
3025 if (x < y) return -1
3026 if (y < x) return 1
3027 return 0
3028 }
3029
3030 Buffer.isEncoding = function isEncoding (encoding) {
3031 switch (String(encoding).toLowerCase()) {
3032 case 'hex':
3033 case 'utf8':
3034 case 'utf-8':
3035 case 'ascii':
3036 case 'binary':
3037 case 'base64':
3038 case 'raw':
3039 case 'ucs2':
3040 case 'ucs-2':
3041 case 'utf16le':
3042 case 'utf-16le':
3043 return true
3044 default:
3045 return false
3046 }
3047 }
3048
3049 Buffer.concat = function concat (list, length) {
3050 if (!isArray(list)) throw new TypeError('list argument must be an Array of Buffers.')
3051
3052 if (list.length === 0) {
3053 return new Buffer(0)
3054 }
3055
3056 var i
3057 if (length === undefined) {
3058 length = 0
3059 for (i = 0; i < list.length; i++) {
3060 length += list[i].length
3061 }
3062 }
3063
3064 var buf = new Buffer(length)
3065 var pos = 0
3066 for (i = 0; i < list.length; i++) {
3067 var item = list[i]
3068 item.copy(buf, pos)
3069 pos += item.length
3070 }
3071 return buf
3072 }
3073
3074 function byteLength (string, encoding) {
3075 if (typeof string !== 'string') string = '' + string
3076
3077 var len = string.length
3078 if (len === 0) return 0
3079
3080 // Use a for loop to avoid recursion
3081 var loweredCase = false
3082 for (;;) {
3083 switch (encoding) {
3084 case 'ascii':
3085 case 'binary':
3086 // Deprecated
3087 case 'raw':
3088 case 'raws':
3089 return len
3090 case 'utf8':
3091 case 'utf-8':
3092 return utf8ToBytes(string).length
3093 case 'ucs2':
3094 case 'ucs-2':
3095 case 'utf16le':
3096 case 'utf-16le':
3097 return len * 2
3098 case 'hex':
3099 return len >>> 1
3100 case 'base64':
3101 return base64ToBytes(string).length
3102 default:
3103 if (loweredCase) return utf8ToBytes(string).length // assume utf8
3104 encoding = ('' + encoding).toLowerCase()
3105 loweredCase = true
3106 }
3107 }
3108 }
3109 Buffer.byteLength = byteLength
3110
3111 // pre-set for values that may exist in the future
3112 Buffer.prototype.length = undefined
3113 Buffer.prototype.parent = undefined
3114
3115 function slowToString (encoding, start, end) {
3116 var loweredCase = false
3117
3118 start = start | 0
3119 end = end === undefined || end === Infinity ? this.length : end | 0
3120
3121 if (!encoding) encoding = 'utf8'
3122 if (start < 0) start = 0
3123 if (end > this.length) end = this.length
3124 if (end <= start) return ''
3125
3126 while (true) {
3127 switch (encoding) {
3128 case 'hex':
3129 return hexSlice(this, start, end)
3130
3131 case 'utf8':
3132 case 'utf-8':
3133 return utf8Slice(this, start, end)
3134
3135 case 'ascii':
3136 return asciiSlice(this, start, end)
3137
3138 case 'binary':
3139 return binarySlice(this, start, end)
3140
3141 case 'base64':
3142 return base64Slice(this, start, end)
3143
3144 case 'ucs2':
3145 case 'ucs-2':
3146 case 'utf16le':
3147 case 'utf-16le':
3148 return utf16leSlice(this, start, end)
3149
3150 default:
3151 if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
3152 encoding = (encoding + '').toLowerCase()
3153 loweredCase = true
3154 }
3155 }
3156 }
3157
3158 Buffer.prototype.toString = function toString () {
3159 var length = this.length | 0
3160 if (length === 0) return ''
3161 if (arguments.length === 0) return utf8Slice(this, 0, length)
3162 return slowToString.apply(this, arguments)
3163 }
3164
3165 Buffer.prototype.equals = function equals (b) {
3166 if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
3167 if (this === b) return true
3168 return Buffer.compare(this, b) === 0
3169 }
3170
3171 Buffer.prototype.inspect = function inspect () {
3172 var str = ''
3173 var max = exports.INSPECT_MAX_BYTES
3174 if (this.length > 0) {
3175 str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')
3176 if (this.length > max) str += ' ... '
3177 }
3178 return '<Buffer ' + str + '>'
3179 }
3180
3181 Buffer.prototype.compare = function compare (b) {
3182 if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
3183 if (this === b) return 0
3184 return Buffer.compare(this, b)
3185 }
3186
3187 Buffer.prototype.indexOf = function indexOf (val, byteOffset) {
3188 if (byteOffset > 0x7fffffff) byteOffset = 0x7fffffff
3189 else if (byteOffset < -0x80000000) byteOffset = -0x80000000
3190 byteOffset >>= 0
3191
3192 if (this.length === 0) return -1
3193 if (byteOffset >= this.length) return -1
3194
3195 // Negative offsets start from the end of the buffer
3196 if (byteOffset < 0) byteOffset = Math.max(this.length + byteOffset, 0)
3197
3198 if (typeof val === 'string') {
3199 if (val.length === 0) return -1 // special case: looking for empty string always fails
3200 return String.prototype.indexOf.call(this, val, byteOffset)
3201 }
3202 if (Buffer.isBuffer(val)) {
3203 return arrayIndexOf(this, val, byteOffset)
3204 }
3205 if (typeof val === 'number') {
3206 if (Buffer.TYPED_ARRAY_SUPPORT && Uint8Array.prototype.indexOf === 'function') {
3207 return Uint8Array.prototype.indexOf.call(this, val, byteOffset)
3208 }
3209 return arrayIndexOf(this, [ val ], byteOffset)
3210 }
3211
3212 function arrayIndexOf (arr, val, byteOffset) {
3213 var foundIndex = -1
3214 for (var i = 0; byteOffset + i < arr.length; i++) {
3215 if (arr[byteOffset + i] === val[foundIndex === -1 ? 0 : i - foundIndex]) {
3216 if (foundIndex === -1) foundIndex = i
3217 if (i - foundIndex + 1 === val.length) return byteOffset + foundIndex
3218 } else {
3219 foundIndex = -1
3220 }
3221 }
3222 return -1
3223 }
3224
3225 throw new TypeError('val must be string, number or Buffer')
3226 }
3227
3228 // `get` is deprecated
3229 Buffer.prototype.get = function get (offset) {
3230 console.log('.get() is deprecated. Access using array indexes instead.')
3231 return this.readUInt8(offset)
3232 }
3233
3234 // `set` is deprecated
3235 Buffer.prototype.set = function set (v, offset) {
3236 console.log('.set() is deprecated. Access using array indexes instead.')
3237 return this.writeUInt8(v, offset)
3238 }
3239
3240 function hexWrite (buf, string, offset, length) {
3241 offset = Number(offset) || 0
3242 var remaining = buf.length - offset
3243 if (!length) {
3244 length = remaining
3245 } else {
3246 length = Number(length)
3247 if (length > remaining) {
3248 length = remaining
3249 }
3250 }
3251
3252 // must be an even number of digits
3253 var strLen = string.length
3254 if (strLen % 2 !== 0) throw new Error('Invalid hex string')
3255
3256 if (length > strLen / 2) {
3257 length = strLen / 2
3258 }
3259 for (var i = 0; i < length; i++) {
3260 var parsed = parseInt(string.substr(i * 2, 2), 16)
3261 if (isNaN(parsed)) throw new Error('Invalid hex string')
3262 buf[offset + i] = parsed
3263 }
3264 return i
3265 }
3266
3267 function utf8Write (buf, string, offset, length) {
3268 return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
3269 }
3270
3271 function asciiWrite (buf, string, offset, length) {
3272 return blitBuffer(asciiToBytes(string), buf, offset, length)
3273 }
3274
3275 function binaryWrite (buf, string, offset, length) {
3276 return asciiWrite(buf, string, offset, length)
3277 }
3278
3279 function base64Write (buf, string, offset, length) {
3280 return blitBuffer(base64ToBytes(string), buf, offset, length)
3281 }
3282
3283 function ucs2Write (buf, string, offset, length) {
3284 return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
3285 }
3286
3287 Buffer.prototype.write = function write (string, offset, length, encoding) {
3288 // Buffer#write(string)
3289 if (offset === undefined) {
3290 encoding = 'utf8'
3291 length = this.length
3292 offset = 0
3293 // Buffer#write(string, encoding)
3294 } else if (length === undefined && typeof offset === 'string') {
3295 encoding = offset
3296 length = this.length
3297 offset = 0
3298 // Buffer#write(string, offset[, length][, encoding])
3299 } else if (isFinite(offset)) {
3300 offset = offset | 0
3301 if (isFinite(length)) {
3302 length = length | 0
3303 if (encoding === undefined) encoding = 'utf8'
3304 } else {
3305 encoding = length
3306 length = undefined
3307 }
3308 // legacy write(string, encoding, offset, length) - remove in v0.13
3309 } else {
3310 var swap = encoding
3311 encoding = offset
3312 offset = length | 0
3313 length = swap
3314 }
3315
3316 var remaining = this.length - offset
3317 if (length === undefined || length > remaining) length = remaining
3318
3319 if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
3320 throw new RangeError('attempt to write outside buffer bounds')
3321 }
3322
3323 if (!encoding) encoding = 'utf8'
3324
3325 var loweredCase = false
3326 for (;;) {
3327 switch (encoding) {
3328 case 'hex':
3329 return hexWrite(this, string, offset, length)
3330
3331 case 'utf8':
3332 case 'utf-8':
3333 return utf8Write(this, string, offset, length)
3334
3335 case 'ascii':
3336 return asciiWrite(this, string, offset, length)
3337
3338 case 'binary':
3339 return binaryWrite(this, string, offset, length)
3340
3341 case 'base64':
3342 // Warning: maxLength not taken into account in base64Write
3343 return base64Write(this, string, offset, length)
3344
3345 case 'ucs2':
3346 case 'ucs-2':
3347 case 'utf16le':
3348 case 'utf-16le':
3349 return ucs2Write(this, string, offset, length)
3350
3351 default:
3352 if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
3353 encoding = ('' + encoding).toLowerCase()
3354 loweredCase = true
3355 }
3356 }
3357 }
3358
3359 Buffer.prototype.toJSON = function toJSON () {
3360 return {
3361 type: 'Buffer',
3362 data: Array.prototype.slice.call(this._arr || this, 0)
3363 }
3364 }
3365
3366 function base64Slice (buf, start, end) {
3367 if (start === 0 && end === buf.length) {
3368 return base64.fromByteArray(buf)
3369 } else {
3370 return base64.fromByteArray(buf.slice(start, end))
3371 }
3372 }
3373
3374 function utf8Slice (buf, start, end) {
3375 end = Math.min(buf.length, end)
3376 var firstByte
3377 var secondByte
3378 var thirdByte
3379 var fourthByte
3380 var bytesPerSequence
3381 var tempCodePoint
3382 var codePoint
3383 var res = []
3384 var i = start
3385
3386 for (; i < end; i += bytesPerSequence) {
3387 firstByte = buf[i]
3388 codePoint = 0xFFFD
3389
3390 if (firstByte > 0xEF) {
3391 bytesPerSequence = 4
3392 } else if (firstByte > 0xDF) {
3393 bytesPerSequence = 3
3394 } else if (firstByte > 0xBF) {
3395 bytesPerSequence = 2
3396 } else {
3397 bytesPerSequence = 1
3398 }
3399
3400 if (i + bytesPerSequence <= end) {
3401 switch (bytesPerSequence) {
3402 case 1:
3403 if (firstByte < 0x80) {
3404 codePoint = firstByte
3405 }
3406 break
3407 case 2:
3408 secondByte = buf[i + 1]
3409 if ((secondByte & 0xC0) === 0x80) {
3410 tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
3411 if (tempCodePoint > 0x7F) {
3412 codePoint = tempCodePoint
3413 }
3414 }
3415 break
3416 case 3:
3417 secondByte = buf[i + 1]
3418 thirdByte = buf[i + 2]
3419 if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
3420 tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
3421 if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
3422 codePoint = tempCodePoint
3423 }
3424 }
3425 break
3426 case 4:
3427 secondByte = buf[i + 1]
3428 thirdByte = buf[i + 2]
3429 fourthByte = buf[i + 3]
3430 if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
3431 tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
3432 if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
3433 codePoint = tempCodePoint
3434 }
3435 }
3436 }
3437 }
3438
3439 if (codePoint === 0xFFFD) {
3440 // we generated an invalid codePoint so make sure to only advance by 1 byte
3441 bytesPerSequence = 1
3442 } else if (codePoint > 0xFFFF) {
3443 // encode to utf16 (surrogate pair dance)
3444 codePoint -= 0x10000
3445 res.push(codePoint >>> 10 & 0x3FF | 0xD800)
3446 codePoint = 0xDC00 | codePoint & 0x3FF
3447 }
3448
3449 res.push(codePoint)
3450 }
3451
3452 return String.fromCharCode.apply(String, res)
3453 }
3454
3455 function asciiSlice (buf, start, end) {
3456 var ret = ''
3457 end = Math.min(buf.length, end)
3458
3459 for (var i = start; i < end; i++) {
3460 ret += String.fromCharCode(buf[i] & 0x7F)
3461 }
3462 return ret
3463 }
3464
3465 function binarySlice (buf, start, end) {
3466 var ret = ''
3467 end = Math.min(buf.length, end)
3468
3469 for (var i = start; i < end; i++) {
3470 ret += String.fromCharCode(buf[i])
3471 }
3472 return ret
3473 }
3474
3475 function hexSlice (buf, start, end) {
3476 var len = buf.length
3477
3478 if (!start || start < 0) start = 0
3479 if (!end || end < 0 || end > len) end = len
3480
3481 var out = ''
3482 for (var i = start; i < end; i++) {
3483 out += toHex(buf[i])
3484 }
3485 return out
3486 }
3487
3488 function utf16leSlice (buf, start, end) {
3489 var bytes = buf.slice(start, end)
3490 var res = ''
3491 for (var i = 0; i < bytes.length; i += 2) {
3492 res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)
3493 }
3494 return res
3495 }
3496
3497 Buffer.prototype.slice = function slice (start, end) {
3498 var len = this.length
3499 start = ~~start
3500 end = end === undefined ? len : ~~end
3501
3502 if (start < 0) {
3503 start += len
3504 if (start < 0) start = 0
3505 } else if (start > len) {
3506 start = len
3507 }
3508
3509 if (end < 0) {
3510 end += len
3511 if (end < 0) end = 0
3512 } else if (end > len) {
3513 end = len
3514 }
3515
3516 if (end < start) end = start
3517
3518 var newBuf
3519 if (Buffer.TYPED_ARRAY_SUPPORT) {
3520 newBuf = Buffer._augment(this.subarray(start, end))
3521 } else {
3522 var sliceLen = end - start
3523 newBuf = new Buffer(sliceLen, undefined)
3524 for (var i = 0; i < sliceLen; i++) {
3525 newBuf[i] = this[i + start]
3526 }
3527 }
3528
3529 if (newBuf.length) newBuf.parent = this.parent || this
3530
3531 return newBuf
3532 }
3533
3534 /*
3535 * Need to make sure that buffer isn't trying to write out of bounds.
3536 */
3537 function checkOffset (offset, ext, length) {
3538 if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
3539 if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
3540 }
3541
3542 Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
3543 offset = offset | 0
3544 byteLength = byteLength | 0
3545 if (!noAssert) checkOffset(offset, byteLength, this.length)
3546
3547 var val = this[offset]
3548 var mul = 1
3549 var i = 0
3550 while (++i < byteLength && (mul *= 0x100)) {
3551 val += this[offset + i] * mul
3552 }
3553
3554 return val
3555 }
3556
3557 Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
3558 offset = offset | 0
3559 byteLength = byteLength | 0
3560 if (!noAssert) {
3561 checkOffset(offset, byteLength, this.length)
3562 }
3563
3564 var val = this[offset + --byteLength]
3565 var mul = 1
3566 while (byteLength > 0 && (mul *= 0x100)) {
3567 val += this[offset + --byteLength] * mul
3568 }
3569
3570 return val
3571 }
3572
3573 Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
3574 if (!noAssert) checkOffset(offset, 1, this.length)
3575 return this[offset]
3576 }
3577
3578 Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
3579 if (!noAssert) checkOffset(offset, 2, this.length)
3580 return this[offset] | (this[offset + 1] << 8)
3581 }
3582
3583 Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
3584 if (!noAssert) checkOffset(offset, 2, this.length)
3585 return (this[offset] << 8) | this[offset + 1]
3586 }
3587
3588 Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
3589 if (!noAssert) checkOffset(offset, 4, this.length)
3590
3591 return ((this[offset]) |
3592 (this[offset + 1] << 8) |
3593 (this[offset + 2] << 16)) +
3594 (this[offset + 3] * 0x1000000)
3595 }
3596
3597 Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
3598 if (!noAssert) checkOffset(offset, 4, this.length)
3599
3600 return (this[offset] * 0x1000000) +
3601 ((this[offset + 1] << 16) |
3602 (this[offset + 2] << 8) |
3603 this[offset + 3])
3604 }
3605
3606 Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
3607 offset = offset | 0
3608 byteLength = byteLength | 0
3609 if (!noAssert) checkOffset(offset, byteLength, this.length)
3610
3611 var val = this[offset]
3612 var mul = 1
3613 var i = 0
3614 while (++i < byteLength && (mul *= 0x100)) {
3615 val += this[offset + i] * mul
3616 }
3617 mul *= 0x80
3618
3619 if (val >= mul) val -= Math.pow(2, 8 * byteLength)
3620
3621 return val
3622 }
3623
3624 Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
3625 offset = offset | 0
3626 byteLength = byteLength | 0
3627 if (!noAssert) checkOffset(offset, byteLength, this.length)
3628
3629 var i = byteLength
3630 var mul = 1
3631 var val = this[offset + --i]
3632 while (i > 0 && (mul *= 0x100)) {
3633 val += this[offset + --i] * mul
3634 }
3635 mul *= 0x80
3636
3637 if (val >= mul) val -= Math.pow(2, 8 * byteLength)
3638
3639 return val
3640 }
3641
3642 Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
3643 if (!noAssert) checkOffset(offset, 1, this.length)
3644 if (!(this[offset] & 0x80)) return (this[offset])
3645 return ((0xff - this[offset] + 1) * -1)
3646 }
3647
3648 Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
3649 if (!noAssert) checkOffset(offset, 2, this.length)
3650 var val = this[offset] | (this[offset + 1] << 8)
3651 return (val & 0x8000) ? val | 0xFFFF0000 : val
3652 }
3653
3654 Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
3655 if (!noAssert) checkOffset(offset, 2, this.length)
3656 var val = this[offset + 1] | (this[offset] << 8)
3657 return (val & 0x8000) ? val | 0xFFFF0000 : val
3658 }
3659
3660 Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
3661 if (!noAssert) checkOffset(offset, 4, this.length)
3662
3663 return (this[offset]) |
3664 (this[offset + 1] << 8) |
3665 (this[offset + 2] << 16) |
3666 (this[offset + 3] << 24)
3667 }
3668
3669 Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
3670 if (!noAssert) checkOffset(offset, 4, this.length)
3671
3672 return (this[offset] << 24) |
3673 (this[offset + 1] << 16) |
3674 (this[offset + 2] << 8) |
3675 (this[offset + 3])
3676 }
3677
3678 Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
3679 if (!noAssert) checkOffset(offset, 4, this.length)
3680 return ieee754.read(this, offset, true, 23, 4)
3681 }
3682
3683 Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
3684 if (!noAssert) checkOffset(offset, 4, this.length)
3685 return ieee754.read(this, offset, false, 23, 4)
3686 }
3687
3688 Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
3689 if (!noAssert) checkOffset(offset, 8, this.length)
3690 return ieee754.read(this, offset, true, 52, 8)
3691 }
3692
3693 Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
3694 if (!noAssert) checkOffset(offset, 8, this.length)
3695 return ieee754.read(this, offset, false, 52, 8)
3696 }
3697
3698 function checkInt (buf, value, offset, ext, max, min) {
3699 if (!Buffer.isBuffer(buf)) throw new TypeError('buffer must be a Buffer instance')
3700 if (value > max || value < min) throw new RangeError('value is out of bounds')
3701 if (offset + ext > buf.length) throw new RangeError('index out of range')
3702 }
3703
3704 Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
3705 value = +value
3706 offset = offset | 0
3707 byteLength = byteLength | 0
3708 if (!noAssert) checkInt(this, value, offset, byteLength, Math.pow(2, 8 * byteLength), 0)
3709
3710 var mul = 1
3711 var i = 0
3712 this[offset] = value & 0xFF
3713 while (++i < byteLength && (mul *= 0x100)) {
3714 this[offset + i] = (value / mul) & 0xFF
3715 }
3716
3717 return offset + byteLength
3718 }
3719
3720 Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
3721 value = +value
3722 offset = offset | 0
3723 byteLength = byteLength | 0
3724 if (!noAssert) checkInt(this, value, offset, byteLength, Math.pow(2, 8 * byteLength), 0)
3725
3726 var i = byteLength - 1
3727 var mul = 1
3728 this[offset + i] = value & 0xFF
3729 while (--i >= 0 && (mul *= 0x100)) {
3730 this[offset + i] = (value / mul) & 0xFF
3731 }
3732
3733 return offset + byteLength
3734 }
3735
3736 Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
3737 value = +value
3738 offset = offset | 0
3739 if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
3740 if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
3741 this[offset] = value
3742 return offset + 1
3743 }
3744
3745 function objectWriteUInt16 (buf, value, offset, littleEndian) {
3746 if (value < 0) value = 0xffff + value + 1
3747 for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; i++) {
3748 buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>
3749 (littleEndian ? i : 1 - i) * 8
3750 }
3751 }
3752
3753 Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
3754 value = +value
3755 offset = offset | 0
3756 if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
3757 if (Buffer.TYPED_ARRAY_SUPPORT) {
3758 this[offset] = value
3759 this[offset + 1] = (value >>> 8)
3760 } else {
3761 objectWriteUInt16(this, value, offset, true)
3762 }
3763 return offset + 2
3764 }
3765
3766 Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
3767 value = +value
3768 offset = offset | 0
3769 if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
3770 if (Buffer.TYPED_ARRAY_SUPPORT) {
3771 this[offset] = (value >>> 8)
3772 this[offset + 1] = value
3773 } else {
3774 objectWriteUInt16(this, value, offset, false)
3775 }
3776 return offset + 2
3777 }
3778
3779 function objectWriteUInt32 (buf, value, offset, littleEndian) {
3780 if (value < 0) value = 0xffffffff + value + 1
3781 for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; i++) {
3782 buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff
3783 }
3784 }
3785
3786 Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
3787 value = +value
3788 offset = offset | 0
3789 if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
3790 if (Buffer.TYPED_ARRAY_SUPPORT) {
3791 this[offset + 3] = (value >>> 24)
3792 this[offset + 2] = (value >>> 16)
3793 this[offset + 1] = (value >>> 8)
3794 this[offset] = value
3795 } else {
3796 objectWriteUInt32(this, value, offset, true)
3797 }
3798 return offset + 4
3799 }
3800
3801 Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
3802 value = +value
3803 offset = offset | 0
3804 if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
3805 if (Buffer.TYPED_ARRAY_SUPPORT) {
3806 this[offset] = (value >>> 24)
3807 this[offset + 1] = (value >>> 16)
3808 this[offset + 2] = (value >>> 8)
3809 this[offset + 3] = value
3810 } else {
3811 objectWriteUInt32(this, value, offset, false)
3812 }
3813 return offset + 4
3814 }
3815
3816 Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
3817 value = +value
3818 offset = offset | 0
3819 if (!noAssert) {
3820 var limit = Math.pow(2, 8 * byteLength - 1)
3821
3822 checkInt(this, value, offset, byteLength, limit - 1, -limit)
3823 }
3824
3825 var i = 0
3826 var mul = 1
3827 var sub = value < 0 ? 1 : 0
3828 this[offset] = value & 0xFF
3829 while (++i < byteLength && (mul *= 0x100)) {
3830 this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
3831 }
3832
3833 return offset + byteLength
3834 }
3835
3836 Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
3837 value = +value
3838 offset = offset | 0
3839 if (!noAssert) {
3840 var limit = Math.pow(2, 8 * byteLength - 1)
3841
3842 checkInt(this, value, offset, byteLength, limit - 1, -limit)
3843 }
3844
3845 var i = byteLength - 1
3846 var mul = 1
3847 var sub = value < 0 ? 1 : 0
3848 this[offset + i] = value & 0xFF
3849 while (--i >= 0 && (mul *= 0x100)) {
3850 this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
3851 }
3852
3853 return offset + byteLength
3854 }
3855
3856 Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
3857 value = +value
3858 offset = offset | 0
3859 if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
3860 if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
3861 if (value < 0) value = 0xff + value + 1
3862 this[offset] = value
3863 return offset + 1
3864 }
3865
3866 Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
3867 value = +value
3868 offset = offset | 0
3869 if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
3870 if (Buffer.TYPED_ARRAY_SUPPORT) {
3871 this[offset] = value
3872 this[offset + 1] = (value >>> 8)
3873 } else {
3874 objectWriteUInt16(this, value, offset, true)
3875 }
3876 return offset + 2
3877 }
3878
3879 Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
3880 value = +value
3881 offset = offset | 0
3882 if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
3883 if (Buffer.TYPED_ARRAY_SUPPORT) {
3884 this[offset] = (value >>> 8)
3885 this[offset + 1] = value
3886 } else {
3887 objectWriteUInt16(this, value, offset, false)
3888 }
3889 return offset + 2
3890 }
3891
3892 Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
3893 value = +value
3894 offset = offset | 0
3895 if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
3896 if (Buffer.TYPED_ARRAY_SUPPORT) {
3897 this[offset] = value
3898 this[offset + 1] = (value >>> 8)
3899 this[offset + 2] = (value >>> 16)
3900 this[offset + 3] = (value >>> 24)
3901 } else {
3902 objectWriteUInt32(this, value, offset, true)
3903 }
3904 return offset + 4
3905 }
3906
3907 Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
3908 value = +value
3909 offset = offset | 0
3910 if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
3911 if (value < 0) value = 0xffffffff + value + 1
3912 if (Buffer.TYPED_ARRAY_SUPPORT) {
3913 this[offset] = (value >>> 24)
3914 this[offset + 1] = (value >>> 16)
3915 this[offset + 2] = (value >>> 8)
3916 this[offset + 3] = value
3917 } else {
3918 objectWriteUInt32(this, value, offset, false)
3919 }
3920 return offset + 4
3921 }
3922
3923 function checkIEEE754 (buf, value, offset, ext, max, min) {
3924 if (value > max || value < min) throw new RangeError('value is out of bounds')
3925 if (offset + ext > buf.length) throw new RangeError('index out of range')
3926 if (offset < 0) throw new RangeError('index out of range')
3927 }
3928
3929 function writeFloat (buf, value, offset, littleEndian, noAssert) {
3930 if (!noAssert) {
3931 checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
3932 }
3933 ieee754.write(buf, value, offset, littleEndian, 23, 4)
3934 return offset + 4
3935 }
3936
3937 Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
3938 return writeFloat(this, value, offset, true, noAssert)
3939 }
3940
3941 Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
3942 return writeFloat(this, value, offset, false, noAssert)
3943 }
3944
3945 function writeDouble (buf, value, offset, littleEndian, noAssert) {
3946 if (!noAssert) {
3947 checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
3948 }
3949 ieee754.write(buf, value, offset, littleEndian, 52, 8)
3950 return offset + 8
3951 }
3952
3953 Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
3954 return writeDouble(this, value, offset, true, noAssert)
3955 }
3956
3957 Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
3958 return writeDouble(this, value, offset, false, noAssert)
3959 }
3960
3961 // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
3962 Buffer.prototype.copy = function copy (target, targetStart, start, end) {
3963 if (!start) start = 0
3964 if (!end && end !== 0) end = this.length
3965 if (targetStart >= target.length) targetStart = target.length
3966 if (!targetStart) targetStart = 0
3967 if (end > 0 && end < start) end = start
3968
3969 // Copy 0 bytes; we're done
3970 if (end === start) return 0
3971 if (target.length === 0 || this.length === 0) return 0
3972
3973 // Fatal error conditions
3974 if (targetStart < 0) {
3975 throw new RangeError('targetStart out of bounds')
3976 }
3977 if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')
3978 if (end < 0) throw new RangeError('sourceEnd out of bounds')
3979
3980 // Are we oob?
3981 if (end > this.length) end = this.length
3982 if (target.length - targetStart < end - start) {
3983 end = target.length - targetStart + start
3984 }
3985
3986 var len = end - start
3987 var i
3988
3989 if (this === target && start < targetStart && targetStart < end) {
3990 // descending copy from end
3991 for (i = len - 1; i >= 0; i--) {
3992 target[i + targetStart] = this[i + start]
3993 }
3994 } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
3995 // ascending copy from start
3996 for (i = 0; i < len; i++) {
3997 target[i + targetStart] = this[i + start]
3998 }
3999 } else {
4000 target._set(this.subarray(start, start + len), targetStart)
4001 }
4002
4003 return len
4004 }
4005
4006 // fill(value, start=0, end=buffer.length)
4007 Buffer.prototype.fill = function fill (value, start, end) {
4008 if (!value) value = 0
4009 if (!start) start = 0
4010 if (!end) end = this.length
4011
4012 if (end < start) throw new RangeError('end < start')
4013
4014 // Fill 0 bytes; we're done
4015 if (end === start) return
4016 if (this.length === 0) return
4017
4018 if (start < 0 || start >= this.length) throw new RangeError('start out of bounds')
4019 if (end < 0 || end > this.length) throw new RangeError('end out of bounds')
4020
4021 var i
4022 if (typeof value === 'number') {
4023 for (i = start; i < end; i++) {
4024 this[i] = value
4025 }
4026 } else {
4027 var bytes = utf8ToBytes(value.toString())
4028 var len = bytes.length
4029 for (i = start; i < end; i++) {
4030 this[i] = bytes[i % len]
4031 }
4032 }
4033
4034 return this
4035 }
4036
4037 /**
4038 * Creates a new `ArrayBuffer` with the *copied* memory of the buffer instance.
4039 * Added in Node 0.12. Only available in browsers that support ArrayBuffer.
4040 */
4041 Buffer.prototype.toArrayBuffer = function toArrayBuffer () {
4042 if (typeof Uint8Array !== 'undefined') {
4043 if (Buffer.TYPED_ARRAY_SUPPORT) {
4044 return (new Buffer(this)).buffer
4045 } else {
4046 var buf = new Uint8Array(this.length)
4047 for (var i = 0, len = buf.length; i < len; i += 1) {
4048 buf[i] = this[i]
4049 }
4050 return buf.buffer
4051 }
4052 } else {
4053 throw new TypeError('Buffer.toArrayBuffer not supported in this browser')
4054 }
4055 }
4056
4057 // HELPER FUNCTIONS
4058 // ================
4059
4060 var BP = Buffer.prototype
4061
4062 /**
4063 * Augment a Uint8Array *instance* (not the Uint8Array class!) with Buffer methods
4064 */
4065 Buffer._augment = function _augment (arr) {
4066 arr.constructor = Buffer
4067 arr._isBuffer = true
4068
4069 // save reference to original Uint8Array set method before overwriting
4070 arr._set = arr.set
4071
4072 // deprecated
4073 arr.get = BP.get
4074 arr.set = BP.set
4075
4076 arr.write = BP.write
4077 arr.toString = BP.toString
4078 arr.toLocaleString = BP.toString
4079 arr.toJSON = BP.toJSON
4080 arr.equals = BP.equals
4081 arr.compare = BP.compare
4082 arr.indexOf = BP.indexOf
4083 arr.copy = BP.copy
4084 arr.slice = BP.slice
4085 arr.readUIntLE = BP.readUIntLE
4086 arr.readUIntBE = BP.readUIntBE
4087 arr.readUInt8 = BP.readUInt8
4088 arr.readUInt16LE = BP.readUInt16LE
4089 arr.readUInt16BE = BP.readUInt16BE
4090 arr.readUInt32LE = BP.readUInt32LE
4091 arr.readUInt32BE = BP.readUInt32BE
4092 arr.readIntLE = BP.readIntLE
4093 arr.readIntBE = BP.readIntBE
4094 arr.readInt8 = BP.readInt8
4095 arr.readInt16LE = BP.readInt16LE
4096 arr.readInt16BE = BP.readInt16BE
4097 arr.readInt32LE = BP.readInt32LE
4098 arr.readInt32BE = BP.readInt32BE
4099 arr.readFloatLE = BP.readFloatLE
4100 arr.readFloatBE = BP.readFloatBE
4101 arr.readDoubleLE = BP.readDoubleLE
4102 arr.readDoubleBE = BP.readDoubleBE
4103 arr.writeUInt8 = BP.writeUInt8
4104 arr.writeUIntLE = BP.writeUIntLE
4105 arr.writeUIntBE = BP.writeUIntBE
4106 arr.writeUInt16LE = BP.writeUInt16LE
4107 arr.writeUInt16BE = BP.writeUInt16BE
4108 arr.writeUInt32LE = BP.writeUInt32LE
4109 arr.writeUInt32BE = BP.writeUInt32BE
4110 arr.writeIntLE = BP.writeIntLE
4111 arr.writeIntBE = BP.writeIntBE
4112 arr.writeInt8 = BP.writeInt8
4113 arr.writeInt16LE = BP.writeInt16LE
4114 arr.writeInt16BE = BP.writeInt16BE
4115 arr.writeInt32LE = BP.writeInt32LE
4116 arr.writeInt32BE = BP.writeInt32BE
4117 arr.writeFloatLE = BP.writeFloatLE
4118 arr.writeFloatBE = BP.writeFloatBE
4119 arr.writeDoubleLE = BP.writeDoubleLE
4120 arr.writeDoubleBE = BP.writeDoubleBE
4121 arr.fill = BP.fill
4122 arr.inspect = BP.inspect
4123 arr.toArrayBuffer = BP.toArrayBuffer
4124
4125 return arr
4126 }
4127
4128 var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g
4129
4130 function base64clean (str) {
4131 // Node strips out invalid characters like \n and \t from the string, base64-js does not
4132 str = stringtrim(str).replace(INVALID_BASE64_RE, '')
4133 // Node converts strings with length < 2 to ''
4134 if (str.length < 2) return ''
4135 // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
4136 while (str.length % 4 !== 0) {
4137 str = str + '='
4138 }
4139 return str
4140 }
4141
4142 function stringtrim (str) {
4143 if (str.trim) return str.trim()
4144 return str.replace(/^\s+|\s+$/g, '')
4145 }
4146
4147 function toHex (n) {
4148 if (n < 16) return '0' + n.toString(16)
4149 return n.toString(16)
4150 }
4151
4152 function utf8ToBytes (string, units) {
4153 units = units || Infinity
4154 var codePoint
4155 var length = string.length
4156 var leadSurrogate = null
4157 var bytes = []
4158
4159 for (var i = 0; i < length; i++) {
4160 codePoint = string.charCodeAt(i)
4161
4162 // is surrogate component
4163 if (codePoint > 0xD7FF && codePoint < 0xE000) {
4164 // last char was a lead
4165 if (!leadSurrogate) {
4166 // no lead yet
4167 if (codePoint > 0xDBFF) {
4168 // unexpected trail
4169 if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
4170 continue
4171
4172 } else if (i + 1 === length) {
4173 // unpaired lead
4174 if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
4175 continue
4176 }
4177
4178 // valid lead
4179 leadSurrogate = codePoint
4180
4181 continue
4182 }
4183
4184 // 2 leads in a row
4185 if (codePoint < 0xDC00) {
4186 if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
4187 leadSurrogate = codePoint
4188 continue
4189 }
4190
4191 // valid surrogate pair
4192 codePoint = leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00 | 0x10000
4193
4194 } else if (leadSurrogate) {
4195 // valid bmp char, but last char was a lead
4196 if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
4197 }
4198
4199 leadSurrogate = null
4200
4201 // encode utf8
4202 if (codePoint < 0x80) {
4203 if ((units -= 1) < 0) break
4204 bytes.push(codePoint)
4205 } else if (codePoint < 0x800) {
4206 if ((units -= 2) < 0) break
4207 bytes.push(
4208 codePoint >> 0x6 | 0xC0,
4209 codePoint & 0x3F | 0x80
4210 )
4211 } else if (codePoint < 0x10000) {
4212 if ((units -= 3) < 0) break
4213 bytes.push(
4214 codePoint >> 0xC | 0xE0,
4215 codePoint >> 0x6 & 0x3F | 0x80,
4216 codePoint & 0x3F | 0x80
4217 )
4218 } else if (codePoint < 0x110000) {
4219 if ((units -= 4) < 0) break
4220 bytes.push(
4221 codePoint >> 0x12 | 0xF0,
4222 codePoint >> 0xC & 0x3F | 0x80,
4223 codePoint >> 0x6 & 0x3F | 0x80,
4224 codePoint & 0x3F | 0x80
4225 )
4226 } else {
4227 throw new Error('Invalid code point')
4228 }
4229 }
4230
4231 return bytes
4232 }
4233
4234 function asciiToBytes (str) {
4235 var byteArray = []
4236 for (var i = 0; i < str.length; i++) {
4237 // Node's code seems to be doing this and not & 0x7F..
4238 byteArray.push(str.charCodeAt(i) & 0xFF)
4239 }
4240 return byteArray
4241 }
4242
4243 function utf16leToBytes (str, units) {
4244 var c, hi, lo
4245 var byteArray = []
4246 for (var i = 0; i < str.length; i++) {
4247 if ((units -= 2) < 0) break
4248
4249 c = str.charCodeAt(i)
4250 hi = c >> 8
4251 lo = c % 256
4252 byteArray.push(lo)
4253 byteArray.push(hi)
4254 }
4255
4256 return byteArray
4257 }
4258
4259 function base64ToBytes (str) {
4260 return base64.toByteArray(base64clean(str))
4261 }
4262
4263 function blitBuffer (src, dst, offset, length) {
4264 for (var i = 0; i < length; i++) {
4265 if ((i + offset >= dst.length) || (i >= src.length)) break
4266 dst[i + offset] = src[i]
4267 }
4268 return i
4269 }
4270
4271 },{"base64-js":8,"ieee754":9,"is-array":10}],8:[function(require,module,exports){
4272 var lookup = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
4273
4274 ;(function (exports) {
4275 'use strict';
4276
4277 var Arr = (typeof Uint8Array !== 'undefined')
4278 ? Uint8Array
4279 : Array
4280
4281 var PLUS = '+'.charCodeAt(0)
4282 var SLASH = '/'.charCodeAt(0)
4283 var NUMBER = '0'.charCodeAt(0)
4284 var LOWER = 'a'.charCodeAt(0)
4285 var UPPER = 'A'.charCodeAt(0)
4286 var PLUS_URL_SAFE = '-'.charCodeAt(0)
4287 var SLASH_URL_SAFE = '_'.charCodeAt(0)
4288
4289 function decode (elt) {
4290 var code = elt.charCodeAt(0)
4291 if (code === PLUS ||
4292 code === PLUS_URL_SAFE)
4293 return 62 // '+'
4294 if (code === SLASH ||
4295 code === SLASH_URL_SAFE)
4296 return 63 // '/'
4297 if (code < NUMBER)
4298 return -1 //no match
4299 if (code < NUMBER + 10)
4300 return code - NUMBER + 26 + 26
4301 if (code < UPPER + 26)
4302 return code - UPPER
4303 if (code < LOWER + 26)
4304 return code - LOWER + 26
4305 }
4306
4307 function b64ToByteArray (b64) {
4308 var i, j, l, tmp, placeHolders, arr
4309
4310 if (b64.length % 4 > 0) {
4311 throw new Error('Invalid string. Length must be a multiple of 4')
4312 }
4313
4314 // the number of equal signs (place holders)
4315 // if there are two placeholders, than the two characters before it
4316 // represent one byte
4317 // if there is only one, then the three characters before it represent 2 bytes
4318 // this is just a cheap hack to not do indexOf twice
4319 var len = b64.length
4320 placeHolders = '=' === b64.charAt(len - 2) ? 2 : '=' === b64.charAt(len - 1) ? 1 : 0
4321
4322 // base64 is 4/3 + up to two characters of the original data
4323 arr = new Arr(b64.length * 3 / 4 - placeHolders)
4324
4325 // if there are placeholders, only get up to the last complete 4 chars
4326 l = placeHolders > 0 ? b64.length - 4 : b64.length
4327
4328 var L = 0
4329
4330 function push (v) {
4331 arr[L++] = v
4332 }
4333
4334 for (i = 0, j = 0; i < l; i += 4, j += 3) {
4335 tmp = (decode(b64.charAt(i)) << 18) | (decode(b64.charAt(i + 1)) << 12) | (decode(b64.charAt(i + 2)) << 6) | decode(b64.charAt(i + 3))
4336 push((tmp & 0xFF0000) >> 16)
4337 push((tmp & 0xFF00) >> 8)
4338 push(tmp & 0xFF)
4339 }
4340
4341 if (placeHolders === 2) {
4342 tmp = (decode(b64.charAt(i)) << 2) | (decode(b64.charAt(i + 1)) >> 4)
4343 push(tmp & 0xFF)
4344 } else if (placeHolders === 1) {
4345 tmp = (decode(b64.charAt(i)) << 10) | (decode(b64.charAt(i + 1)) << 4) | (decode(b64.charAt(i + 2)) >> 2)
4346 push((tmp >> 8) & 0xFF)
4347 push(tmp & 0xFF)
4348 }
4349
4350 return arr
4351 }
4352
4353 function uint8ToBase64 (uint8) {
4354 var i,
4355 extraBytes = uint8.length % 3, // if we have 1 byte left, pad 2 bytes
4356 output = "",
4357 temp, length
4358
4359 function encode (num) {
4360 return lookup.charAt(num)
4361 }
4362
4363 function tripletToBase64 (num) {
4364 return encode(num >> 18 & 0x3F) + encode(num >> 12 & 0x3F) + encode(num >> 6 & 0x3F) + encode(num & 0x3F)
4365 }
4366
4367 // go through the array every three bytes, we'll deal with trailing stuff later
4368 for (i = 0, length = uint8.length - extraBytes; i < length; i += 3) {
4369 temp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2])
4370 output += tripletToBase64(temp)
4371 }
4372
4373 // pad the end with zeros, but make sure to not forget the extra bytes
4374 switch (extraBytes) {
4375 case 1:
4376 temp = uint8[uint8.length - 1]
4377 output += encode(temp >> 2)
4378 output += encode((temp << 4) & 0x3F)
4379 output += '=='
4380 break
4381 case 2:
4382 temp = (uint8[uint8.length - 2] << 8) + (uint8[uint8.length - 1])
4383 output += encode(temp >> 10)
4384 output += encode((temp >> 4) & 0x3F)
4385 output += encode((temp << 2) & 0x3F)
4386 output += '='
4387 break
4388 }
4389
4390 return output
4391 }
4392
4393 exports.toByteArray = b64ToByteArray
4394 exports.fromByteArray = uint8ToBase64
4395 }(typeof exports === 'undefined' ? (this.base64js = {}) : exports))
4396
4397 },{}],9:[function(require,module,exports){
4398 exports.read = function (buffer, offset, isLE, mLen, nBytes) {
4399 var e, m
4400 var eLen = nBytes * 8 - mLen - 1
4401 var eMax = (1 << eLen) - 1
4402 var eBias = eMax >> 1
4403 var nBits = -7
4404 var i = isLE ? (nBytes - 1) : 0
4405 var d = isLE ? -1 : 1
4406 var s = buffer[offset + i]
4407
4408 i += d
4409
4410 e = s & ((1 << (-nBits)) - 1)
4411 s >>= (-nBits)
4412 nBits += eLen
4413 for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}
4414
4415 m = e & ((1 << (-nBits)) - 1)
4416 e >>= (-nBits)
4417 nBits += mLen
4418 for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}
4419
4420 if (e === 0) {
4421 e = 1 - eBias
4422 } else if (e === eMax) {
4423 return m ? NaN : ((s ? -1 : 1) * Infinity)
4424 } else {
4425 m = m + Math.pow(2, mLen)
4426 e = e - eBias
4427 }
4428 return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
4429 }
4430
4431 exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
4432 var e, m, c
4433 var eLen = nBytes * 8 - mLen - 1
4434 var eMax = (1 << eLen) - 1
4435 var eBias = eMax >> 1
4436 var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
4437 var i = isLE ? 0 : (nBytes - 1)
4438 var d = isLE ? 1 : -1
4439 var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
4440
4441 value = Math.abs(value)
4442
4443 if (isNaN(value) || value === Infinity) {
4444 m = isNaN(value) ? 1 : 0
4445 e = eMax
4446 } else {
4447 e = Math.floor(Math.log(value) / Math.LN2)
4448 if (value * (c = Math.pow(2, -e)) < 1) {
4449 e--
4450 c *= 2
4451 }
4452 if (e + eBias >= 1) {
4453 value += rt / c
4454 } else {
4455 value += rt * Math.pow(2, 1 - eBias)
4456 }
4457 if (value * c >= 2) {
4458 e++
4459 c /= 2
4460 }
4461
4462 if (e + eBias >= eMax) {
4463 m = 0
4464 e = eMax
4465 } else if (e + eBias >= 1) {
4466 m = (value * c - 1) * Math.pow(2, mLen)
4467 e = e + eBias
4468 } else {
4469 m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
4470 e = 0
4471 }
4472 }
4473
4474 for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
4475
4476 e = (e << mLen) | m
4477 eLen += mLen
4478 for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
4479
4480 buffer[offset + i - d] |= s * 128
4481 }
4482
4483 },{}],10:[function(require,module,exports){
4484
4485 /**
4486 * isArray
4487 */
4488
4489 var isArray = Array.isArray;
4490
4491 /**
4492 * toString
4493 */
4494
4495 var str = Object.prototype.toString;
4496
4497 /**
4498 * Whether or not the given `val`
4499 * is an array.
4500 *
4501 * example:
4502 *
4503 * isArray([]);
4504 * // > true
4505 * isArray(arguments);
4506 * // > false
4507 * isArray('');
4508 * // > false
4509 *
4510 * @param {mixed} val
4511 * @return {bool}
4512 */
4513
4514 module.exports = isArray || function (val) {
4515 return !! val && '[object Array]' == str.call(val);
4516 };
4517
4518 },{}],11:[function(require,module,exports){
4519 // Copyright Joyent, Inc. and other Node contributors.
4520 //
4521 // Permission is hereby granted, free of charge, to any person obtaining a
4522 // copy of this software and associated documentation files (the
4523 // "Software"), to deal in the Software without restriction, including
4524 // without limitation the rights to use, copy, modify, merge, publish,
4525 // distribute, sublicense, and/or sell copies of the Software, and to permit
4526 // persons to whom the Software is furnished to do so, subject to the
4527 // following conditions:
4528 //
4529 // The above copyright notice and this permission notice shall be included
4530 // in all copies or substantial portions of the Software.
4531 //
4532 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
4533 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
4534 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
4535 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
4536 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
4537 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
4538 // USE OR OTHER DEALINGS IN THE SOFTWARE.
4539
4540 function EventEmitter() {
4541 this._events = this._events || {};
4542 this._maxListeners = this._maxListeners || undefined;
4543 }
4544 module.exports = EventEmitter;
4545
4546 // Backwards-compat with node 0.10.x
4547 EventEmitter.EventEmitter = EventEmitter;
4548
4549 EventEmitter.prototype._events = undefined;
4550 EventEmitter.prototype._maxListeners = undefined;
4551
4552 // By default EventEmitters will print a warning if more than 10 listeners are
4553 // added to it. This is a useful default which helps finding memory leaks.
4554 EventEmitter.defaultMaxListeners = 10;
4555
4556 // Obviously not all Emitters should be limited to 10. This function allows
4557 // that to be increased. Set to zero for unlimited.
4558 EventEmitter.prototype.setMaxListeners = function(n) {
4559 if (!isNumber(n) || n < 0 || isNaN(n))
4560 throw TypeError('n must be a positive number');
4561 this._maxListeners = n;
4562 return this;
4563 };
4564
4565 EventEmitter.prototype.emit = function(type) {
4566 var er, handler, len, args, i, listeners;
4567
4568 if (!this._events)
4569 this._events = {};
4570
4571 // If there is no 'error' event listener then throw.
4572 if (type === 'error') {
4573 if (!this._events.error ||
4574 (isObject(this._events.error) && !this._events.error.length)) {
4575 er = arguments[1];
4576 if (er instanceof Error) {
4577 throw er; // Unhandled 'error' event
4578 }
4579 throw TypeError('Uncaught, unspecified "error" event.');
4580 }
4581 }
4582
4583 handler = this._events[type];
4584
4585 if (isUndefined(handler))
4586 return false;
4587
4588 if (isFunction(handler)) {
4589 switch (arguments.length) {
4590 // fast cases
4591 case 1:
4592 handler.call(this);
4593 break;
4594 case 2:
4595 handler.call(this, arguments[1]);
4596 break;
4597 case 3:
4598 handler.call(this, arguments[1], arguments[2]);
4599 break;
4600 // slower
4601 default:
4602 len = arguments.length;
4603 args = new Array(len - 1);
4604 for (i = 1; i < len; i++)
4605 args[i - 1] = arguments[i];
4606 handler.apply(this, args);
4607 }
4608 } else if (isObject(handler)) {
4609 len = arguments.length;
4610 args = new Array(len - 1);
4611 for (i = 1; i < len; i++)
4612 args[i - 1] = arguments[i];
4613
4614 listeners = handler.slice();
4615 len = listeners.length;
4616 for (i = 0; i < len; i++)
4617 listeners[i].apply(this, args);
4618 }
4619
4620 return true;
4621 };
4622
4623 EventEmitter.prototype.addListener = function(type, listener) {
4624 var m;
4625
4626 if (!isFunction(listener))
4627 throw TypeError('listener must be a function');
4628
4629 if (!this._events)
4630 this._events = {};
4631
4632 // To avoid recursion in the case that type === "newListener"! Before
4633 // adding it to the listeners, first emit "newListener".
4634 if (this._events.newListener)
4635 this.emit('newListener', type,
4636 isFunction(listener.listener) ?
4637 listener.listener : listener);
4638
4639 if (!this._events[type])
4640 // Optimize the case of one listener. Don't need the extra array object.
4641 this._events[type] = listener;
4642 else if (isObject(this._events[type]))
4643 // If we've already got an array, just append.
4644 this._events[type].push(listener);
4645 else
4646 // Adding the second element, need to change to array.
4647 this._events[type] = [this._events[type], listener];
4648
4649 // Check for listener leak
4650 if (isObject(this._events[type]) && !this._events[type].warned) {
4651 var m;
4652 if (!isUndefined(this._maxListeners)) {
4653 m = this._maxListeners;
4654 } else {
4655 m = EventEmitter.defaultMaxListeners;
4656 }
4657
4658 if (m && m > 0 && this._events[type].length > m) {
4659 this._events[type].warned = true;
4660 console.error('(node) warning: possible EventEmitter memory ' +
4661 'leak detected. %d listeners added. ' +
4662 'Use emitter.setMaxListeners() to increase limit.',
4663 this._events[type].length);
4664 if (typeof console.trace === 'function') {
4665 // not supported in IE 10
4666 console.trace();
4667 }
4668 }
4669 }
4670
4671 return this;
4672 };
4673
4674 EventEmitter.prototype.on = EventEmitter.prototype.addListener;
4675
4676 EventEmitter.prototype.once = function(type, listener) {
4677 if (!isFunction(listener))
4678 throw TypeError('listener must be a function');
4679
4680 var fired = false;
4681
4682 function g() {
4683 this.removeListener(type, g);
4684
4685 if (!fired) {
4686 fired = true;
4687 listener.apply(this, arguments);
4688 }
4689 }
4690
4691 g.listener = listener;
4692 this.on(type, g);
4693
4694 return this;
4695 };
4696
4697 // emits a 'removeListener' event iff the listener was removed
4698 EventEmitter.prototype.removeListener = function(type, listener) {
4699 var list, position, length, i;
4700
4701 if (!isFunction(listener))
4702 throw TypeError('listener must be a function');
4703
4704 if (!this._events || !this._events[type])
4705 return this;
4706
4707 list = this._events[type];
4708 length = list.length;
4709 position = -1;
4710
4711 if (list === listener ||
4712 (isFunction(list.listener) && list.listener === listener)) {
4713 delete this._events[type];
4714 if (this._events.removeListener)
4715 this.emit('removeListener', type, listener);
4716
4717 } else if (isObject(list)) {
4718 for (i = length; i-- > 0;) {
4719 if (list[i] === listener ||
4720 (list[i].listener && list[i].listener === listener)) {
4721 position = i;
4722 break;
4723 }
4724 }
4725
4726 if (position < 0)
4727 return this;
4728
4729 if (list.length === 1) {
4730 list.length = 0;
4731 delete this._events[type];
4732 } else {
4733 list.splice(position, 1);
4734 }
4735
4736 if (this._events.removeListener)
4737 this.emit('removeListener', type, listener);
4738 }
4739
4740 return this;
4741 };
4742
4743 EventEmitter.prototype.removeAllListeners = function(type) {
4744 var key, listeners;
4745
4746 if (!this._events)
4747 return this;
4748
4749 // not listening for removeListener, no need to emit
4750 if (!this._events.removeListener) {
4751 if (arguments.length === 0)
4752 this._events = {};
4753 else if (this._events[type])
4754 delete this._events[type];
4755 return this;
4756 }
4757
4758 // emit removeListener for all listeners on all events
4759 if (arguments.length === 0) {
4760 for (key in this._events) {
4761 if (key === 'removeListener') continue;
4762 this.removeAllListeners(key);
4763 }
4764 this.removeAllListeners('removeListener');
4765 this._events = {};
4766 return this;
4767 }
4768
4769 listeners = this._events[type];
4770
4771 if (isFunction(listeners)) {
4772 this.removeListener(type, listeners);
4773 } else {
4774 // LIFO order
4775 while (listeners.length)
4776 this.removeListener(type, listeners[listeners.length - 1]);
4777 }
4778 delete this._events[type];
4779
4780 return this;
4781 };
4782
4783 EventEmitter.prototype.listeners = function(type) {
4784 var ret;
4785 if (!this._events || !this._events[type])
4786 ret = [];
4787 else if (isFunction(this._events[type]))
4788 ret = [this._events[type]];
4789 else
4790 ret = this._events[type].slice();
4791 return ret;
4792 };
4793
4794 EventEmitter.listenerCount = function(emitter, type) {
4795 var ret;
4796 if (!emitter._events || !emitter._events[type])
4797 ret = 0;
4798 else if (isFunction(emitter._events[type]))
4799 ret = 1;
4800 else
4801 ret = emitter._events[type].length;
4802 return ret;
4803 };
4804
4805 function isFunction(arg) {
4806 return typeof arg === 'function';
4807 }
4808
4809 function isNumber(arg) {
4810 return typeof arg === 'number';
4811 }
4812
4813 function isObject(arg) {
4814 return typeof arg === 'object' && arg !== null;
4815 }
4816
4817 function isUndefined(arg) {
4818 return arg === void 0;
4819 }
4820
4821 },{}],12:[function(require,module,exports){
4822 if (typeof Object.create === 'function') {
4823 // implementation from standard node.js 'util' module
4824 module.exports = function inherits(ctor, superCtor) {
4825 ctor.super_ = superCtor
4826 ctor.prototype = Object.create(superCtor.prototype, {
4827 constructor: {
4828 value: ctor,
4829 enumerable: false,
4830 writable: true,
4831 configurable: true
4832 }
4833 });
4834 };
4835 } else {
4836 // old school shim for old browsers
4837 module.exports = function inherits(ctor, superCtor) {
4838 ctor.super_ = superCtor
4839 var TempCtor = function () {}
4840 TempCtor.prototype = superCtor.prototype
4841 ctor.prototype = new TempCtor()
4842 ctor.prototype.constructor = ctor
4843 }
4844 }
4845
4846 },{}],13:[function(require,module,exports){
4847 module.exports = Array.isArray || function (arr) {
4848 return Object.prototype.toString.call(arr) == '[object Array]';
4849 };
4850
4851 },{}],14:[function(require,module,exports){
4852 // shim for using process in browser
4853
4854 var process = module.exports = {};
4855 var queue = [];
4856 var draining = false;
4857 var currentQueue;
4858 var queueIndex = -1;
4859
4860 function cleanUpNextTick() {
4861 draining = false;
4862 if (currentQueue.length) {
4863 queue = currentQueue.concat(queue);
4864 } else {
4865 queueIndex = -1;
4866 }
4867 if (queue.length) {
4868 drainQueue();
4869 }
4870 }
4871
4872 function drainQueue() {
4873 if (draining) {
4874 return;
4875 }
4876 var timeout = setTimeout(cleanUpNextTick);
4877 draining = true;
4878
4879 var len = queue.length;
4880 while(len) {
4881 currentQueue = queue;
4882 queue = [];
4883 while (++queueIndex < len) {
4884 currentQueue[queueIndex].run();
4885 }
4886 queueIndex = -1;
4887 len = queue.length;
4888 }
4889 currentQueue = null;
4890 draining = false;
4891 clearTimeout(timeout);
4892 }
4893
4894 process.nextTick = function (fun) {
4895 var args = new Array(arguments.length - 1);
4896 if (arguments.length > 1) {
4897 for (var i = 1; i < arguments.length; i++) {
4898 args[i - 1] = arguments[i];
4899 }
4900 }
4901 queue.push(new Item(fun, args));
4902 if (queue.length === 1 && !draining) {
4903 setTimeout(drainQueue, 0);
4904 }
4905 };
4906
4907 // v8 likes predictible objects
4908 function Item(fun, array) {
4909 this.fun = fun;
4910 this.array = array;
4911 }
4912 Item.prototype.run = function () {
4913 this.fun.apply(null, this.array);
4914 };
4915 process.title = 'browser';
4916 process.browser = true;
4917 process.env = {};
4918 process.argv = [];
4919 process.version = ''; // empty string to avoid regexp issues
4920 process.versions = {};
4921
4922 function noop() {}
4923
4924 process.on = noop;
4925 process.addListener = noop;
4926 process.once = noop;
4927 process.off = noop;
4928 process.removeListener = noop;
4929 process.removeAllListeners = noop;
4930 process.emit = noop;
4931
4932 process.binding = function (name) {
4933 throw new Error('process.binding is not supported');
4934 };
4935
4936 // TODO(shtylman)
4937 process.cwd = function () { return '/' };
4938 process.chdir = function (dir) {
4939 throw new Error('process.chdir is not supported');
4940 };
4941 process.umask = function() { return 0; };
4942
4943 },{}],15:[function(require,module,exports){
4944 module.exports = require("./lib/_stream_duplex.js")
4945
4946 },{"./lib/_stream_duplex.js":16}],16:[function(require,module,exports){
4947 (function (process){
4948 // Copyright Joyent, Inc. and other Node contributors.
4949 //
4950 // Permission is hereby granted, free of charge, to any person obtaining a
4951 // copy of this software and associated documentation files (the
4952 // "Software"), to deal in the Software without restriction, including
4953 // without limitation the rights to use, copy, modify, merge, publish,
4954 // distribute, sublicense, and/or sell copies of the Software, and to permit
4955 // persons to whom the Software is furnished to do so, subject to the
4956 // following conditions:
4957 //
4958 // The above copyright notice and this permission notice shall be included
4959 // in all copies or substantial portions of the Software.
4960 //
4961 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
4962 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
4963 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
4964 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
4965 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
4966 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
4967 // USE OR OTHER DEALINGS IN THE SOFTWARE.
4968
4969 // a duplex stream is just a stream that is both readable and writable.
4970 // Since JS doesn't have multiple prototypal inheritance, this class
4971 // prototypally inherits from Readable, and then parasitically from
4972 // Writable.
4973
4974 module.exports = Duplex;
4975
4976 /*<replacement>*/
4977 var objectKeys = Object.keys || function (obj) {
4978 var keys = [];
4979 for (var key in obj) keys.push(key);
4980 return keys;
4981 }
4982 /*</replacement>*/
4983
4984
4985 /*<replacement>*/
4986 var util = require('core-util-is');
4987 util.inherits = require('inherits');
4988 /*</replacement>*/
4989
4990 var Readable = require('./_stream_readable');
4991 var Writable = require('./_stream_writable');
4992
4993 util.inherits(Duplex, Readable);
4994
4995 forEach(objectKeys(Writable.prototype), function(method) {
4996 if (!Duplex.prototype[method])
4997 Duplex.prototype[method] = Writable.prototype[method];
4998 });
4999
5000 function Duplex(options) {
5001 if (!(this instanceof Duplex))
5002 return new Duplex(options);
5003
5004 Readable.call(this, options);
5005 Writable.call(this, options);
5006
5007 if (options && options.readable === false)
5008 this.readable = false;
5009
5010 if (options && options.writable === false)
5011 this.writable = false;
5012
5013 this.allowHalfOpen = true;
5014 if (options && options.allowHalfOpen === false)
5015 this.allowHalfOpen = false;
5016
5017 this.once('end', onend);
5018 }
5019
5020 // the no-half-open enforcer
5021 function onend() {
5022 // if we allow half-open state, or if the writable side ended,
5023 // then we're ok.
5024 if (this.allowHalfOpen || this._writableState.ended)
5025 return;
5026
5027 // no more data can be written.
5028 // But allow more writes to happen in this tick.
5029 process.nextTick(this.end.bind(this));
5030 }
5031
5032 function forEach (xs, f) {
5033 for (var i = 0, l = xs.length; i < l; i++) {
5034 f(xs[i], i);
5035 }
5036 }
5037
5038 }).call(this,require('_process'))
5039 },{"./_stream_readable":18,"./_stream_writable":20,"_process":14,"core-util-is":21,"inherits":12}],17:[function(require,module,exports){
5040 // Copyright Joyent, Inc. and other Node contributors.
5041 //
5042 // Permission is hereby granted, free of charge, to any person obtaining a
5043 // copy of this software and associated documentation files (the
5044 // "Software"), to deal in the Software without restriction, including
5045 // without limitation the rights to use, copy, modify, merge, publish,
5046 // distribute, sublicense, and/or sell copies of the Software, and to permit
5047 // persons to whom the Software is furnished to do so, subject to the
5048 // following conditions:
5049 //
5050 // The above copyright notice and this permission notice shall be included
5051 // in all copies or substantial portions of the Software.
5052 //
5053 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
5054 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
5055 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
5056 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
5057 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
5058 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
5059 // USE OR OTHER DEALINGS IN THE SOFTWARE.
5060
5061 // a passthrough stream.
5062 // basically just the most minimal sort of Transform stream.
5063 // Every written chunk gets output as-is.
5064
5065 module.exports = PassThrough;
5066
5067 var Transform = require('./_stream_transform');
5068
5069 /*<replacement>*/
5070 var util = require('core-util-is');
5071 util.inherits = require('inherits');
5072 /*</replacement>*/
5073
5074 util.inherits(PassThrough, Transform);
5075
5076 function PassThrough(options) {
5077 if (!(this instanceof PassThrough))
5078 return new PassThrough(options);
5079
5080 Transform.call(this, options);
5081 }
5082
5083 PassThrough.prototype._transform = function(chunk, encoding, cb) {
5084 cb(null, chunk);
5085 };
5086
5087 },{"./_stream_transform":19,"core-util-is":21,"inherits":12}],18:[function(require,module,exports){
5088 (function (process){
5089 // Copyright Joyent, Inc. and other Node contributors.
5090 //
5091 // Permission is hereby granted, free of charge, to any person obtaining a
5092 // copy of this software and associated documentation files (the
5093 // "Software"), to deal in the Software without restriction, including
5094 // without limitation the rights to use, copy, modify, merge, publish,
5095 // distribute, sublicense, and/or sell copies of the Software, and to permit
5096 // persons to whom the Software is furnished to do so, subject to the
5097 // following conditions:
5098 //
5099 // The above copyright notice and this permission notice shall be included
5100 // in all copies or substantial portions of the Software.
5101 //
5102 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
5103 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
5104 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
5105 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
5106 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
5107 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
5108 // USE OR OTHER DEALINGS IN THE SOFTWARE.
5109
5110 module.exports = Readable;
5111
5112 /*<replacement>*/
5113 var isArray = require('isarray');
5114 /*</replacement>*/
5115
5116
5117 /*<replacement>*/
5118 var Buffer = require('buffer').Buffer;
5119 /*</replacement>*/
5120
5121 Readable.ReadableState = ReadableState;
5122
5123 var EE = require('events').EventEmitter;
5124
5125 /*<replacement>*/
5126 if (!EE.listenerCount) EE.listenerCount = function(emitter, type) {
5127 return emitter.listeners(type).length;
5128 };
5129 /*</replacement>*/
5130
5131 var Stream = require('stream');
5132
5133 /*<replacement>*/
5134 var util = require('core-util-is');
5135 util.inherits = require('inherits');
5136 /*</replacement>*/
5137
5138 var StringDecoder;
5139
5140
5141 /*<replacement>*/
5142 var debug = require('util');
5143 if (debug && debug.debuglog) {
5144 debug = debug.debuglog('stream');
5145 } else {
5146 debug = function () {};
5147 }
5148 /*</replacement>*/
5149
5150
5151 util.inherits(Readable, Stream);
5152
5153 function ReadableState(options, stream) {
5154 var Duplex = require('./_stream_duplex');
5155
5156 options = options || {};
5157
5158 // the point at which it stops calling _read() to fill the buffer
5159 // Note: 0 is a valid value, means "don't call _read preemptively ever"
5160 var hwm = options.highWaterMark;
5161 var defaultHwm = options.objectMode ? 16 : 16 * 1024;
5162 this.highWaterMark = (hwm || hwm === 0) ? hwm : defaultHwm;
5163
5164 // cast to ints.
5165 this.highWaterMark = ~~this.highWaterMark;
5166
5167 this.buffer = [];
5168 this.length = 0;
5169 this.pipes = null;
5170 this.pipesCount = 0;
5171 this.flowing = null;
5172 this.ended = false;
5173 this.endEmitted = false;
5174 this.reading = false;
5175
5176 // a flag to be able to tell if the onwrite cb is called immediately,
5177 // or on a later tick. We set this to true at first, because any
5178 // actions that shouldn't happen until "later" should generally also
5179 // not happen before the first write call.
5180 this.sync = true;
5181
5182 // whenever we return null, then we set a flag to say
5183 // that we're awaiting a 'readable' event emission.
5184 this.needReadable = false;
5185 this.emittedReadable = false;
5186 this.readableListening = false;
5187
5188
5189 // object stream flag. Used to make read(n) ignore n and to
5190 // make all the buffer merging and length checks go away
5191 this.objectMode = !!options.objectMode;
5192
5193 if (stream instanceof Duplex)
5194 this.objectMode = this.objectMode || !!options.readableObjectMode;
5195
5196 // Crypto is kind of old and crusty. Historically, its default string
5197 // encoding is 'binary' so we have to make this configurable.
5198 // Everything else in the universe uses 'utf8', though.
5199 this.defaultEncoding = options.defaultEncoding || 'utf8';
5200
5201 // when piping, we only care about 'readable' events that happen
5202 // after read()ing all the bytes and not getting any pushback.
5203 this.ranOut = false;
5204
5205 // the number of writers that are awaiting a drain event in .pipe()s
5206 this.awaitDrain = 0;
5207
5208 // if true, a maybeReadMore has been scheduled
5209 this.readingMore = false;
5210
5211 this.decoder = null;
5212 this.encoding = null;
5213 if (options.encoding) {
5214 if (!StringDecoder)
5215 StringDecoder = require('string_decoder/').StringDecoder;
5216 this.decoder = new StringDecoder(options.encoding);
5217 this.encoding = options.encoding;
5218 }
5219 }
5220
5221 function Readable(options) {
5222 var Duplex = require('./_stream_duplex');
5223
5224 if (!(this instanceof Readable))
5225 return new Readable(options);
5226
5227 this._readableState = new ReadableState(options, this);
5228
5229 // legacy
5230 this.readable = true;
5231
5232 Stream.call(this);
5233 }
5234
5235 // Manually shove something into the read() buffer.
5236 // This returns true if the highWaterMark has not been hit yet,
5237 // similar to how Writable.write() returns true if you should
5238 // write() some more.
5239 Readable.prototype.push = function(chunk, encoding) {
5240 var state = this._readableState;
5241
5242 if (util.isString(chunk) && !state.objectMode) {
5243 encoding = encoding || state.defaultEncoding;
5244 if (encoding !== state.encoding) {
5245 chunk = new Buffer(chunk, encoding);
5246 encoding = '';
5247 }
5248 }
5249
5250 return readableAddChunk(this, state, chunk, encoding, false);
5251 };
5252
5253 // Unshift should *always* be something directly out of read()
5254 Readable.prototype.unshift = function(chunk) {
5255 var state = this._readableState;
5256 return readableAddChunk(this, state, chunk, '', true);
5257 };
5258
5259 function readableAddChunk(stream, state, chunk, encoding, addToFront) {
5260 var er = chunkInvalid(state, chunk);
5261 if (er) {
5262 stream.emit('error', er);
5263 } else if (util.isNullOrUndefined(chunk)) {
5264 state.reading = false;
5265 if (!state.ended)
5266 onEofChunk(stream, state);
5267 } else if (state.objectMode || chunk && chunk.length > 0) {
5268 if (state.ended && !addToFront) {
5269 var e = new Error('stream.push() after EOF');
5270 stream.emit('error', e);
5271 } else if (state.endEmitted && addToFront) {
5272 var e = new Error('stream.unshift() after end event');
5273 stream.emit('error', e);
5274 } else {
5275 if (state.decoder && !addToFront && !encoding)
5276 chunk = state.decoder.write(chunk);
5277
5278 if (!addToFront)
5279 state.reading = false;
5280
5281 // if we want the data now, just emit it.
5282 if (state.flowing && state.length === 0 && !state.sync) {
5283 stream.emit('data', chunk);
5284 stream.read(0);
5285 } else {
5286 // update the buffer info.
5287 state.length += state.objectMode ? 1 : chunk.length;
5288 if (addToFront)
5289 state.buffer.unshift(chunk);
5290 else
5291 state.buffer.push(chunk);
5292
5293 if (state.needReadable)
5294 emitReadable(stream);
5295 }
5296
5297 maybeReadMore(stream, state);
5298 }
5299 } else if (!addToFront) {
5300 state.reading = false;
5301 }
5302
5303 return needMoreData(state);
5304 }
5305
5306
5307
5308 // if it's past the high water mark, we can push in some more.
5309 // Also, if we have no data yet, we can stand some
5310 // more bytes. This is to work around cases where hwm=0,
5311 // such as the repl. Also, if the push() triggered a
5312 // readable event, and the user called read(largeNumber) such that
5313 // needReadable was set, then we ought to push more, so that another
5314 // 'readable' event will be triggered.
5315 function needMoreData(state) {
5316 return !state.ended &&
5317 (state.needReadable ||
5318 state.length < state.highWaterMark ||
5319 state.length === 0);
5320 }
5321
5322 // backwards compatibility.
5323 Readable.prototype.setEncoding = function(enc) {
5324 if (!StringDecoder)
5325 StringDecoder = require('string_decoder/').StringDecoder;
5326 this._readableState.decoder = new StringDecoder(enc);
5327 this._readableState.encoding = enc;
5328 return this;
5329 };
5330
5331 // Don't raise the hwm > 128MB
5332 var MAX_HWM = 0x800000;
5333 function roundUpToNextPowerOf2(n) {
5334 if (n >= MAX_HWM) {
5335 n = MAX_HWM;
5336 } else {
5337 // Get the next highest power of 2
5338 n--;
5339 for (var p = 1; p < 32; p <<= 1) n |= n >> p;
5340 n++;
5341 }
5342 return n;
5343 }
5344
5345 function howMuchToRead(n, state) {
5346 if (state.length === 0 && state.ended)
5347 return 0;
5348
5349 if (state.objectMode)
5350 return n === 0 ? 0 : 1;
5351
5352 if (isNaN(n) || util.isNull(n)) {
5353 // only flow one buffer at a time
5354 if (state.flowing && state.buffer.length)
5355 return state.buffer[0].length;
5356 else
5357 return state.length;
5358 }
5359
5360 if (n <= 0)
5361 return 0;
5362
5363 // If we're asking for more than the target buffer level,
5364 // then raise the water mark. Bump up to the next highest
5365 // power of 2, to prevent increasing it excessively in tiny
5366 // amounts.
5367 if (n > state.highWaterMark)
5368 state.highWaterMark = roundUpToNextPowerOf2(n);
5369
5370 // don't have that much. return null, unless we've ended.
5371 if (n > state.length) {
5372 if (!state.ended) {
5373 state.needReadable = true;
5374 return 0;
5375 } else
5376 return state.length;
5377 }
5378
5379 return n;
5380 }
5381
5382 // you can override either this method, or the async _read(n) below.
5383 Readable.prototype.read = function(n) {
5384 debug('read', n);
5385 var state = this._readableState;
5386 var nOrig = n;
5387
5388 if (!util.isNumber(n) || n > 0)
5389 state.emittedReadable = false;
5390
5391 // if we're doing read(0) to trigger a readable event, but we
5392 // already have a bunch of data in the buffer, then just trigger
5393 // the 'readable' event and move on.
5394 if (n === 0 &&
5395 state.needReadable &&
5396 (state.length >= state.highWaterMark || state.ended)) {
5397 debug('read: emitReadable', state.length, state.ended);
5398 if (state.length === 0 && state.ended)
5399 endReadable(this);
5400 else
5401 emitReadable(this);
5402 return null;
5403 }
5404
5405 n = howMuchToRead(n, state);
5406
5407 // if we've ended, and we're now clear, then finish it up.
5408 if (n === 0 && state.ended) {
5409 if (state.length === 0)
5410 endReadable(this);
5411 return null;
5412 }
5413
5414 // All the actual chunk generation logic needs to be
5415 // *below* the call to _read. The reason is that in certain
5416 // synthetic stream cases, such as passthrough streams, _read
5417 // may be a completely synchronous operation which may change
5418 // the state of the read buffer, providing enough data when
5419 // before there was *not* enough.
5420 //
5421 // So, the steps are:
5422 // 1. Figure out what the state of things will be after we do
5423 // a read from the buffer.
5424 //
5425 // 2. If that resulting state will trigger a _read, then call _read.
5426 // Note that this may be asynchronous, or synchronous. Yes, it is
5427 // deeply ugly to write APIs this way, but that still doesn't mean
5428 // that the Readable class should behave improperly, as streams are
5429 // designed to be sync/async agnostic.
5430 // Take note if the _read call is sync or async (ie, if the read call
5431 // has returned yet), so that we know whether or not it's safe to emit
5432 // 'readable' etc.
5433 //
5434 // 3. Actually pull the requested chunks out of the buffer and return.
5435
5436 // if we need a readable event, then we need to do some reading.
5437 var doRead = state.needReadable;
5438 debug('need readable', doRead);
5439
5440 // if we currently have less than the highWaterMark, then also read some
5441 if (state.length === 0 || state.length - n < state.highWaterMark) {
5442 doRead = true;
5443 debug('length less than watermark', doRead);
5444 }
5445
5446 // however, if we've ended, then there's no point, and if we're already
5447 // reading, then it's unnecessary.
5448 if (state.ended || state.reading) {
5449 doRead = false;
5450 debug('reading or ended', doRead);
5451 }
5452
5453 if (doRead) {
5454 debug('do read');
5455 state.reading = true;
5456 state.sync = true;
5457 // if the length is currently zero, then we *need* a readable event.
5458 if (state.length === 0)
5459 state.needReadable = true;
5460 // call internal read method
5461 this._read(state.highWaterMark);
5462 state.sync = false;
5463 }
5464
5465 // If _read pushed data synchronously, then `reading` will be false,
5466 // and we need to re-evaluate how much data we can return to the user.
5467 if (doRead && !state.reading)
5468 n = howMuchToRead(nOrig, state);
5469
5470 var ret;
5471 if (n > 0)
5472 ret = fromList(n, state);
5473 else
5474 ret = null;
5475
5476 if (util.isNull(ret)) {
5477 state.needReadable = true;
5478 n = 0;
5479 }
5480
5481 state.length -= n;
5482
5483 // If we have nothing in the buffer, then we want to know
5484 // as soon as we *do* get something into the buffer.
5485 if (state.length === 0 && !state.ended)
5486 state.needReadable = true;
5487
5488 // If we tried to read() past the EOF, then emit end on the next tick.
5489 if (nOrig !== n && state.ended && state.length === 0)
5490 endReadable(this);
5491
5492 if (!util.isNull(ret))
5493 this.emit('data', ret);
5494
5495 return ret;
5496 };
5497
5498 function chunkInvalid(state, chunk) {
5499 var er = null;
5500 if (!util.isBuffer(chunk) &&
5501 !util.isString(chunk) &&
5502 !util.isNullOrUndefined(chunk) &&
5503 !state.objectMode) {
5504 er = new TypeError('Invalid non-string/buffer chunk');
5505 }
5506 return er;
5507 }
5508
5509
5510 function onEofChunk(stream, state) {
5511 if (state.decoder && !state.ended) {
5512 var chunk = state.decoder.end();
5513 if (chunk && chunk.length) {
5514 state.buffer.push(chunk);
5515 state.length += state.objectMode ? 1 : chunk.length;
5516 }
5517 }
5518 state.ended = true;
5519
5520 // emit 'readable' now to make sure it gets picked up.
5521 emitReadable(stream);
5522 }
5523
5524 // Don't emit readable right away in sync mode, because this can trigger
5525 // another read() call => stack overflow. This way, it might trigger
5526 // a nextTick recursion warning, but that's not so bad.
5527 function emitReadable(stream) {
5528 var state = stream._readableState;
5529 state.needReadable = false;
5530 if (!state.emittedReadable) {
5531 debug('emitReadable', state.flowing);
5532 state.emittedReadable = true;
5533 if (state.sync)
5534 process.nextTick(function() {
5535 emitReadable_(stream);
5536 });
5537 else
5538 emitReadable_(stream);
5539 }
5540 }
5541
5542 function emitReadable_(stream) {
5543 debug('emit readable');
5544 stream.emit('readable');
5545 flow(stream);
5546 }
5547
5548
5549 // at this point, the user has presumably seen the 'readable' event,
5550 // and called read() to consume some data. that may have triggered
5551 // in turn another _read(n) call, in which case reading = true if
5552 // it's in progress.
5553 // However, if we're not ended, or reading, and the length < hwm,
5554 // then go ahead and try to read some more preemptively.
5555 function maybeReadMore(stream, state) {
5556 if (!state.readingMore) {
5557 state.readingMore = true;
5558 process.nextTick(function() {
5559 maybeReadMore_(stream, state);
5560 });
5561 }
5562 }
5563
5564 function maybeReadMore_(stream, state) {
5565 var len = state.length;
5566 while (!state.reading && !state.flowing && !state.ended &&
5567 state.length < state.highWaterMark) {
5568 debug('maybeReadMore read 0');
5569 stream.read(0);
5570 if (len === state.length)
5571 // didn't get any data, stop spinning.
5572 break;
5573 else
5574 len = state.length;
5575 }
5576 state.readingMore = false;
5577 }
5578
5579 // abstract method. to be overridden in specific implementation classes.
5580 // call cb(er, data) where data is <= n in length.
5581 // for virtual (non-string, non-buffer) streams, "length" is somewhat
5582 // arbitrary, and perhaps not very meaningful.
5583 Readable.prototype._read = function(n) {
5584 this.emit('error', new Error('not implemented'));
5585 };
5586
5587 Readable.prototype.pipe = function(dest, pipeOpts) {
5588 var src = this;
5589 var state = this._readableState;
5590
5591 switch (state.pipesCount) {
5592 case 0:
5593 state.pipes = dest;
5594 break;
5595 case 1:
5596 state.pipes = [state.pipes, dest];
5597 break;
5598 default:
5599 state.pipes.push(dest);
5600 break;
5601 }
5602 state.pipesCount += 1;
5603 debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);
5604
5605 var doEnd = (!pipeOpts || pipeOpts.end !== false) &&
5606 dest !== process.stdout &&
5607 dest !== process.stderr;
5608
5609 var endFn = doEnd ? onend : cleanup;
5610 if (state.endEmitted)
5611 process.nextTick(endFn);
5612 else
5613 src.once('end', endFn);
5614
5615 dest.on('unpipe', onunpipe);
5616 function onunpipe(readable) {
5617 debug('onunpipe');
5618 if (readable === src) {
5619 cleanup();
5620 }
5621 }
5622
5623 function onend() {
5624 debug('onend');
5625 dest.end();
5626 }
5627
5628 // when the dest drains, it reduces the awaitDrain counter
5629 // on the source. This would be more elegant with a .once()
5630 // handler in flow(), but adding and removing repeatedly is
5631 // too slow.
5632 var ondrain = pipeOnDrain(src);
5633 dest.on('drain', ondrain);
5634
5635 function cleanup() {
5636 debug('cleanup');
5637 // cleanup event handlers once the pipe is broken
5638 dest.removeListener('close', onclose);
5639 dest.removeListener('finish', onfinish);
5640 dest.removeListener('drain', ondrain);
5641 dest.removeListener('error', onerror);
5642 dest.removeListener('unpipe', onunpipe);
5643 src.removeListener('end', onend);
5644 src.removeListener('end', cleanup);
5645 src.removeListener('data', ondata);
5646
5647 // if the reader is waiting for a drain event from this
5648 // specific writer, then it would cause it to never start
5649 // flowing again.
5650 // So, if this is awaiting a drain, then we just call it now.
5651 // If we don't know, then assume that we are waiting for one.
5652 if (state.awaitDrain &&
5653 (!dest._writableState || dest._writableState.needDrain))
5654 ondrain();
5655 }
5656
5657 src.on('data', ondata);
5658 function ondata(chunk) {
5659 debug('ondata');
5660 var ret = dest.write(chunk);
5661 if (false === ret) {
5662 debug('false write response, pause',
5663 src._readableState.awaitDrain);
5664 src._readableState.awaitDrain++;
5665 src.pause();
5666 }
5667 }
5668
5669 // if the dest has an error, then stop piping into it.
5670 // however, don't suppress the throwing behavior for this.
5671 function onerror(er) {
5672 debug('onerror', er);
5673 unpipe();
5674 dest.removeListener('error', onerror);
5675 if (EE.listenerCount(dest, 'error') === 0)
5676 dest.emit('error', er);
5677 }
5678 // This is a brutally ugly hack to make sure that our error handler
5679 // is attached before any userland ones. NEVER DO THIS.
5680 if (!dest._events || !dest._events.error)
5681 dest.on('error', onerror);
5682 else if (isArray(dest._events.error))
5683 dest._events.error.unshift(onerror);
5684 else
5685 dest._events.error = [onerror, dest._events.error];
5686
5687
5688
5689 // Both close and finish should trigger unpipe, but only once.
5690 function onclose() {
5691 dest.removeListener('finish', onfinish);
5692 unpipe();
5693 }
5694 dest.once('close', onclose);
5695 function onfinish() {
5696 debug('onfinish');
5697 dest.removeListener('close', onclose);
5698 unpipe();
5699 }
5700 dest.once('finish', onfinish);
5701
5702 function unpipe() {
5703 debug('unpipe');
5704 src.unpipe(dest);
5705 }
5706
5707 // tell the dest that it's being piped to
5708 dest.emit('pipe', src);
5709
5710 // start the flow if it hasn't been started already.
5711 if (!state.flowing) {
5712 debug('pipe resume');
5713 src.resume();
5714 }
5715
5716 return dest;
5717 };
5718
5719 function pipeOnDrain(src) {
5720 return function() {
5721 var state = src._readableState;
5722 debug('pipeOnDrain', state.awaitDrain);
5723 if (state.awaitDrain)
5724 state.awaitDrain--;
5725 if (state.awaitDrain === 0 && EE.listenerCount(src, 'data')) {
5726 state.flowing = true;
5727 flow(src);
5728 }
5729 };
5730 }
5731
5732
5733 Readable.prototype.unpipe = function(dest) {
5734 var state = this._readableState;
5735
5736 // if we're not piping anywhere, then do nothing.
5737 if (state.pipesCount === 0)
5738 return this;
5739
5740 // just one destination. most common case.
5741 if (state.pipesCount === 1) {
5742 // passed in one, but it's not the right one.
5743 if (dest && dest !== state.pipes)
5744 return this;
5745
5746 if (!dest)
5747 dest = state.pipes;
5748
5749 // got a match.
5750 state.pipes = null;
5751 state.pipesCount = 0;
5752 state.flowing = false;
5753 if (dest)
5754 dest.emit('unpipe', this);
5755 return this;
5756 }
5757
5758 // slow case. multiple pipe destinations.
5759
5760 if (!dest) {
5761 // remove all.
5762 var dests = state.pipes;
5763 var len = state.pipesCount;
5764 state.pipes = null;
5765 state.pipesCount = 0;
5766 state.flowing = false;
5767
5768 for (var i = 0; i < len; i++)
5769 dests[i].emit('unpipe', this);
5770 return this;
5771 }
5772
5773 // try to find the right one.
5774 var i = indexOf(state.pipes, dest);
5775 if (i === -1)
5776 return this;
5777
5778 state.pipes.splice(i, 1);
5779 state.pipesCount -= 1;
5780 if (state.pipesCount === 1)
5781 state.pipes = state.pipes[0];
5782
5783 dest.emit('unpipe', this);
5784
5785 return this;
5786 };
5787
5788 // set up data events if they are asked for
5789 // Ensure readable listeners eventually get something
5790 Readable.prototype.on = function(ev, fn) {
5791 var res = Stream.prototype.on.call(this, ev, fn);
5792
5793 // If listening to data, and it has not explicitly been paused,
5794 // then call resume to start the flow of data on the next tick.
5795 if (ev === 'data' && false !== this._readableState.flowing) {
5796 this.resume();
5797 }
5798
5799 if (ev === 'readable' && this.readable) {
5800 var state = this._readableState;
5801 if (!state.readableListening) {
5802 state.readableListening = true;
5803 state.emittedReadable = false;
5804 state.needReadable = true;
5805 if (!state.reading) {
5806 var self = this;
5807 process.nextTick(function() {
5808 debug('readable nexttick read 0');
5809 self.read(0);
5810 });
5811 } else if (state.length) {
5812 emitReadable(this, state);
5813 }
5814 }
5815 }
5816
5817 return res;
5818 };
5819 Readable.prototype.addListener = Readable.prototype.on;
5820
5821 // pause() and resume() are remnants of the legacy readable stream API
5822 // If the user uses them, then switch into old mode.
5823 Readable.prototype.resume = function() {
5824 var state = this._readableState;
5825 if (!state.flowing) {
5826 debug('resume');
5827 state.flowing = true;
5828 if (!state.reading) {
5829 debug('resume read 0');
5830 this.read(0);
5831 }
5832 resume(this, state);
5833 }
5834 return this;
5835 };
5836
5837 function resume(stream, state) {
5838 if (!state.resumeScheduled) {
5839 state.resumeScheduled = true;
5840 process.nextTick(function() {
5841 resume_(stream, state);
5842 });
5843 }
5844 }
5845
5846 function resume_(stream, state) {
5847 state.resumeScheduled = false;
5848 stream.emit('resume');
5849 flow(stream);
5850 if (state.flowing && !state.reading)
5851 stream.read(0);
5852 }
5853
5854 Readable.prototype.pause = function() {
5855 debug('call pause flowing=%j', this._readableState.flowing);
5856 if (false !== this._readableState.flowing) {
5857 debug('pause');
5858 this._readableState.flowing = false;
5859 this.emit('pause');
5860 }
5861 return this;
5862 };
5863
5864 function flow(stream) {
5865 var state = stream._readableState;
5866 debug('flow', state.flowing);
5867 if (state.flowing) {
5868 do {
5869 var chunk = stream.read();
5870 } while (null !== chunk && state.flowing);
5871 }
5872 }
5873
5874 // wrap an old-style stream as the async data source.
5875 // This is *not* part of the readable stream interface.
5876 // It is an ugly unfortunate mess of history.
5877 Readable.prototype.wrap = function(stream) {
5878 var state = this._readableState;
5879 var paused = false;
5880
5881 var self = this;
5882 stream.on('end', function() {
5883 debug('wrapped end');
5884 if (state.decoder && !state.ended) {
5885 var chunk = state.decoder.end();
5886 if (chunk && chunk.length)
5887 self.push(chunk);
5888 }
5889
5890 self.push(null);
5891 });
5892
5893 stream.on('data', function(chunk) {
5894 debug('wrapped data');
5895 if (state.decoder)
5896 chunk = state.decoder.write(chunk);
5897 if (!chunk || !state.objectMode && !chunk.length)
5898 return;
5899
5900 var ret = self.push(chunk);
5901 if (!ret) {
5902 paused = true;
5903 stream.pause();
5904 }
5905 });
5906
5907 // proxy all the other methods.
5908 // important when wrapping filters and duplexes.
5909 for (var i in stream) {
5910 if (util.isFunction(stream[i]) && util.isUndefined(this[i])) {
5911 this[i] = function(method) { return function() {
5912 return stream[method].apply(stream, arguments);
5913 }}(i);
5914 }
5915 }
5916
5917 // proxy certain important events.
5918 var events = ['error', 'close', 'destroy', 'pause', 'resume'];
5919 forEach(events, function(ev) {
5920 stream.on(ev, self.emit.bind(self, ev));
5921 });
5922
5923 // when we try to consume some more bytes, simply unpause the
5924 // underlying stream.
5925 self._read = function(n) {
5926 debug('wrapped _read', n);
5927 if (paused) {
5928 paused = false;
5929 stream.resume();
5930 }
5931 };
5932
5933 return self;
5934 };
5935
5936
5937
5938 // exposed for testing purposes only.
5939 Readable._fromList = fromList;
5940
5941 // Pluck off n bytes from an array of buffers.
5942 // Length is the combined lengths of all the buffers in the list.
5943 function fromList(n, state) {
5944 var list = state.buffer;
5945 var length = state.length;
5946 var stringMode = !!state.decoder;
5947 var objectMode = !!state.objectMode;
5948 var ret;
5949
5950 // nothing in the list, definitely empty.
5951 if (list.length === 0)
5952 return null;
5953
5954 if (length === 0)
5955 ret = null;
5956 else if (objectMode)
5957 ret = list.shift();
5958 else if (!n || n >= length) {
5959 // read it all, truncate the array.
5960 if (stringMode)
5961 ret = list.join('');
5962 else
5963 ret = Buffer.concat(list, length);
5964 list.length = 0;
5965 } else {
5966 // read just some of it.
5967 if (n < list[0].length) {
5968 // just take a part of the first list item.
5969 // slice is the same for buffers and strings.
5970 var buf = list[0];
5971 ret = buf.slice(0, n);
5972 list[0] = buf.slice(n);
5973 } else if (n === list[0].length) {
5974 // first list is a perfect match
5975 ret = list.shift();
5976 } else {
5977 // complex case.
5978 // we have enough to cover it, but it spans past the first buffer.
5979 if (stringMode)
5980 ret = '';
5981 else
5982 ret = new Buffer(n);
5983
5984 var c = 0;
5985 for (var i = 0, l = list.length; i < l && c < n; i++) {
5986 var buf = list[0];
5987 var cpy = Math.min(n - c, buf.length);
5988
5989 if (stringMode)
5990 ret += buf.slice(0, cpy);
5991 else
5992 buf.copy(ret, c, 0, cpy);
5993
5994 if (cpy < buf.length)
5995 list[0] = buf.slice(cpy);
5996 else
5997 list.shift();
5998
5999 c += cpy;
6000 }
6001 }
6002 }
6003
6004 return ret;
6005 }
6006
6007 function endReadable(stream) {
6008 var state = stream._readableState;
6009
6010 // If we get here before consuming all the bytes, then that is a
6011 // bug in node. Should never happen.
6012 if (state.length > 0)
6013 throw new Error('endReadable called on non-empty stream');
6014
6015 if (!state.endEmitted) {
6016 state.ended = true;
6017 process.nextTick(function() {
6018 // Check that we didn't get one last unshift.
6019 if (!state.endEmitted && state.length === 0) {
6020 state.endEmitted = true;
6021 stream.readable = false;
6022 stream.emit('end');
6023 }
6024 });
6025 }
6026 }
6027
6028 function forEach (xs, f) {
6029 for (var i = 0, l = xs.length; i < l; i++) {
6030 f(xs[i], i);
6031 }
6032 }
6033
6034 function indexOf (xs, x) {
6035 for (var i = 0, l = xs.length; i < l; i++) {
6036 if (xs[i] === x) return i;
6037 }
6038 return -1;
6039 }
6040
6041 }).call(this,require('_process'))
6042 },{"./_stream_duplex":16,"_process":14,"buffer":7,"core-util-is":21,"events":11,"inherits":12,"isarray":13,"stream":26,"string_decoder/":27,"util":6}],19:[function(require,module,exports){
6043 // Copyright Joyent, Inc. and other Node contributors.
6044 //
6045 // Permission is hereby granted, free of charge, to any person obtaining a
6046 // copy of this software and associated documentation files (the
6047 // "Software"), to deal in the Software without restriction, including
6048 // without limitation the rights to use, copy, modify, merge, publish,
6049 // distribute, sublicense, and/or sell copies of the Software, and to permit
6050 // persons to whom the Software is furnished to do so, subject to the
6051 // following conditions:
6052 //
6053 // The above copyright notice and this permission notice shall be included
6054 // in all copies or substantial portions of the Software.
6055 //
6056 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
6057 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
6058 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
6059 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
6060 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
6061 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
6062 // USE OR OTHER DEALINGS IN THE SOFTWARE.
6063
6064
6065 // a transform stream is a readable/writable stream where you do
6066 // something with the data. Sometimes it's called a "filter",
6067 // but that's not a great name for it, since that implies a thing where
6068 // some bits pass through, and others are simply ignored. (That would
6069 // be a valid example of a transform, of course.)
6070 //
6071 // While the output is causally related to the input, it's not a
6072 // necessarily symmetric or synchronous transformation. For example,
6073 // a zlib stream might take multiple plain-text writes(), and then
6074 // emit a single compressed chunk some time in the future.
6075 //
6076 // Here's how this works:
6077 //
6078 // The Transform stream has all the aspects of the readable and writable
6079 // stream classes. When you write(chunk), that calls _write(chunk,cb)
6080 // internally, and returns false if there's a lot of pending writes
6081 // buffered up. When you call read(), that calls _read(n) until
6082 // there's enough pending readable data buffered up.
6083 //
6084 // In a transform stream, the written data is placed in a buffer. When
6085 // _read(n) is called, it transforms the queued up data, calling the
6086 // buffered _write cb's as it consumes chunks. If consuming a single
6087 // written chunk would result in multiple output chunks, then the first
6088 // outputted bit calls the readcb, and subsequent chunks just go into
6089 // the read buffer, and will cause it to emit 'readable' if necessary.
6090 //
6091 // This way, back-pressure is actually determined by the reading side,
6092 // since _read has to be called to start processing a new chunk. However,
6093 // a pathological inflate type of transform can cause excessive buffering
6094 // here. For example, imagine a stream where every byte of input is
6095 // interpreted as an integer from 0-255, and then results in that many
6096 // bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in
6097 // 1kb of data being output. In this case, you could write a very small
6098 // amount of input, and end up with a very large amount of output. In
6099 // such a pathological inflating mechanism, there'd be no way to tell
6100 // the system to stop doing the transform. A single 4MB write could
6101 // cause the system to run out of memory.
6102 //
6103 // However, even in such a pathological case, only a single written chunk
6104 // would be consumed, and then the rest would wait (un-transformed) until
6105 // the results of the previous transformed chunk were consumed.
6106
6107 module.exports = Transform;
6108
6109 var Duplex = require('./_stream_duplex');
6110
6111 /*<replacement>*/
6112 var util = require('core-util-is');
6113 util.inherits = require('inherits');
6114 /*</replacement>*/
6115
6116 util.inherits(Transform, Duplex);
6117
6118
6119 function TransformState(options, stream) {
6120 this.afterTransform = function(er, data) {
6121 return afterTransform(stream, er, data);
6122 };
6123
6124 this.needTransform = false;
6125 this.transforming = false;
6126 this.writecb = null;
6127 this.writechunk = null;
6128 }
6129
6130 function afterTransform(stream, er, data) {
6131 var ts = stream._transformState;
6132 ts.transforming = false;
6133
6134 var cb = ts.writecb;
6135
6136 if (!cb)
6137 return stream.emit('error', new Error('no writecb in Transform class'));
6138
6139 ts.writechunk = null;
6140 ts.writecb = null;
6141
6142 if (!util.isNullOrUndefined(data))
6143 stream.push(data);
6144
6145 if (cb)
6146 cb(er);
6147
6148 var rs = stream._readableState;
6149 rs.reading = false;
6150 if (rs.needReadable || rs.length < rs.highWaterMark) {
6151 stream._read(rs.highWaterMark);
6152 }
6153 }
6154
6155
6156 function Transform(options) {
6157 if (!(this instanceof Transform))
6158 return new Transform(options);
6159
6160 Duplex.call(this, options);
6161
6162 this._transformState = new TransformState(options, this);
6163
6164 // when the writable side finishes, then flush out anything remaining.
6165 var stream = this;
6166
6167 // start out asking for a readable event once data is transformed.
6168 this._readableState.needReadable = true;
6169
6170 // we have implemented the _read method, and done the other things
6171 // that Readable wants before the first _read call, so unset the
6172 // sync guard flag.
6173 this._readableState.sync = false;
6174
6175 this.once('prefinish', function() {
6176 if (util.isFunction(this._flush))
6177 this._flush(function(er) {
6178 done(stream, er);
6179 });
6180 else
6181 done(stream);
6182 });
6183 }
6184
6185 Transform.prototype.push = function(chunk, encoding) {
6186 this._transformState.needTransform = false;
6187 return Duplex.prototype.push.call(this, chunk, encoding);
6188 };
6189
6190 // This is the part where you do stuff!
6191 // override this function in implementation classes.
6192 // 'chunk' is an input chunk.
6193 //
6194 // Call `push(newChunk)` to pass along transformed output
6195 // to the readable side. You may call 'push' zero or more times.
6196 //
6197 // Call `cb(err)` when you are done with this chunk. If you pass
6198 // an error, then that'll put the hurt on the whole operation. If you
6199 // never call cb(), then you'll never get another chunk.
6200 Transform.prototype._transform = function(chunk, encoding, cb) {
6201 throw new Error('not implemented');
6202 };
6203
6204 Transform.prototype._write = function(chunk, encoding, cb) {
6205 var ts = this._transformState;
6206 ts.writecb = cb;
6207 ts.writechunk = chunk;
6208 ts.writeencoding = encoding;
6209 if (!ts.transforming) {
6210 var rs = this._readableState;
6211 if (ts.needTransform ||
6212 rs.needReadable ||
6213 rs.length < rs.highWaterMark)
6214 this._read(rs.highWaterMark);
6215 }
6216 };
6217
6218 // Doesn't matter what the args are here.
6219 // _transform does all the work.
6220 // That we got here means that the readable side wants more data.
6221 Transform.prototype._read = function(n) {
6222 var ts = this._transformState;
6223
6224 if (!util.isNull(ts.writechunk) && ts.writecb && !ts.transforming) {
6225 ts.transforming = true;
6226 this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
6227 } else {
6228 // mark that we need a transform, so that any data that comes in
6229 // will get processed, now that we've asked for it.
6230 ts.needTransform = true;
6231 }
6232 };
6233
6234
6235 function done(stream, er) {
6236 if (er)
6237 return stream.emit('error', er);
6238
6239 // if there's nothing in the write buffer, then that means
6240 // that nothing more will ever be provided
6241 var ws = stream._writableState;
6242 var ts = stream._transformState;
6243
6244 if (ws.length)
6245 throw new Error('calling transform done when ws.length != 0');
6246
6247 if (ts.transforming)
6248 throw new Error('calling transform done when still transforming');
6249
6250 return stream.push(null);
6251 }
6252
6253 },{"./_stream_duplex":16,"core-util-is":21,"inherits":12}],20:[function(require,module,exports){
6254 (function (process){
6255 // Copyright Joyent, Inc. and other Node contributors.
6256 //
6257 // Permission is hereby granted, free of charge, to any person obtaining a
6258 // copy of this software and associated documentation files (the
6259 // "Software"), to deal in the Software without restriction, including
6260 // without limitation the rights to use, copy, modify, merge, publish,
6261 // distribute, sublicense, and/or sell copies of the Software, and to permit
6262 // persons to whom the Software is furnished to do so, subject to the
6263 // following conditions:
6264 //
6265 // The above copyright notice and this permission notice shall be included
6266 // in all copies or substantial portions of the Software.
6267 //
6268 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
6269 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
6270 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
6271 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
6272 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
6273 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
6274 // USE OR OTHER DEALINGS IN THE SOFTWARE.
6275
6276 // A bit simpler than readable streams.
6277 // Implement an async ._write(chunk, cb), and it'll handle all
6278 // the drain event emission and buffering.
6279
6280 module.exports = Writable;
6281
6282 /*<replacement>*/
6283 var Buffer = require('buffer').Buffer;
6284 /*</replacement>*/
6285
6286 Writable.WritableState = WritableState;
6287
6288
6289 /*<replacement>*/
6290 var util = require('core-util-is');
6291 util.inherits = require('inherits');
6292 /*</replacement>*/
6293
6294 var Stream = require('stream');
6295
6296 util.inherits(Writable, Stream);
6297
6298 function WriteReq(chunk, encoding, cb) {
6299 this.chunk = chunk;
6300 this.encoding = encoding;
6301 this.callback = cb;
6302 }
6303
6304 function WritableState(options, stream) {
6305 var Duplex = require('./_stream_duplex');
6306
6307 options = options || {};
6308
6309 // the point at which write() starts returning false
6310 // Note: 0 is a valid value, means that we always return false if
6311 // the entire buffer is not flushed immediately on write()
6312 var hwm = options.highWaterMark;
6313 var defaultHwm = options.objectMode ? 16 : 16 * 1024;
6314 this.highWaterMark = (hwm || hwm === 0) ? hwm : defaultHwm;
6315
6316 // object stream flag to indicate whether or not this stream
6317 // contains buffers or objects.
6318 this.objectMode = !!options.objectMode;
6319
6320 if (stream instanceof Duplex)
6321 this.objectMode = this.objectMode || !!options.writableObjectMode;
6322
6323 // cast to ints.
6324 this.highWaterMark = ~~this.highWaterMark;
6325
6326 this.needDrain = false;
6327 // at the start of calling end()
6328 this.ending = false;
6329 // when end() has been called, and returned
6330 this.ended = false;
6331 // when 'finish' is emitted
6332 this.finished = false;
6333
6334 // should we decode strings into buffers before passing to _write?
6335 // this is here so that some node-core streams can optimize string
6336 // handling at a lower level.
6337 var noDecode = options.decodeStrings === false;
6338 this.decodeStrings = !noDecode;
6339
6340 // Crypto is kind of old and crusty. Historically, its default string
6341 // encoding is 'binary' so we have to make this configurable.
6342 // Everything else in the universe uses 'utf8', though.
6343 this.defaultEncoding = options.defaultEncoding || 'utf8';
6344
6345 // not an actual buffer we keep track of, but a measurement
6346 // of how much we're waiting to get pushed to some underlying
6347 // socket or file.
6348 this.length = 0;
6349
6350 // a flag to see when we're in the middle of a write.
6351 this.writing = false;
6352
6353 // when true all writes will be buffered until .uncork() call
6354 this.corked = 0;
6355
6356 // a flag to be able to tell if the onwrite cb is called immediately,
6357 // or on a later tick. We set this to true at first, because any
6358 // actions that shouldn't happen until "later" should generally also
6359 // not happen before the first write call.
6360 this.sync = true;
6361
6362 // a flag to know if we're processing previously buffered items, which
6363 // may call the _write() callback in the same tick, so that we don't
6364 // end up in an overlapped onwrite situation.
6365 this.bufferProcessing = false;
6366
6367 // the callback that's passed to _write(chunk,cb)
6368 this.onwrite = function(er) {
6369 onwrite(stream, er);
6370 };
6371
6372 // the callback that the user supplies to write(chunk,encoding,cb)
6373 this.writecb = null;
6374
6375 // the amount that is being written when _write is called.
6376 this.writelen = 0;
6377
6378 this.buffer = [];
6379
6380 // number of pending user-supplied write callbacks
6381 // this must be 0 before 'finish' can be emitted
6382 this.pendingcb = 0;
6383
6384 // emit prefinish if the only thing we're waiting for is _write cbs
6385 // This is relevant for synchronous Transform streams
6386 this.prefinished = false;
6387
6388 // True if the error was already emitted and should not be thrown again
6389 this.errorEmitted = false;
6390 }
6391
6392 function Writable(options) {
6393 var Duplex = require('./_stream_duplex');
6394
6395 // Writable ctor is applied to Duplexes, though they're not
6396 // instanceof Writable, they're instanceof Readable.
6397 if (!(this instanceof Writable) && !(this instanceof Duplex))
6398 return new Writable(options);
6399
6400 this._writableState = new WritableState(options, this);
6401
6402 // legacy.
6403 this.writable = true;
6404
6405 Stream.call(this);
6406 }
6407
6408 // Otherwise people can pipe Writable streams, which is just wrong.
6409 Writable.prototype.pipe = function() {
6410 this.emit('error', new Error('Cannot pipe. Not readable.'));
6411 };
6412
6413
6414 function writeAfterEnd(stream, state, cb) {
6415 var er = new Error('write after end');
6416 // TODO: defer error events consistently everywhere, not just the cb
6417 stream.emit('error', er);
6418 process.nextTick(function() {
6419 cb(er);
6420 });
6421 }
6422
6423 // If we get something that is not a buffer, string, null, or undefined,
6424 // and we're not in objectMode, then that's an error.
6425 // Otherwise stream chunks are all considered to be of length=1, and the
6426 // watermarks determine how many objects to keep in the buffer, rather than
6427 // how many bytes or characters.
6428 function validChunk(stream, state, chunk, cb) {
6429 var valid = true;
6430 if (!util.isBuffer(chunk) &&
6431 !util.isString(chunk) &&
6432 !util.isNullOrUndefined(chunk) &&
6433 !state.objectMode) {
6434 var er = new TypeError('Invalid non-string/buffer chunk');
6435 stream.emit('error', er);
6436 process.nextTick(function() {
6437 cb(er);
6438 });
6439 valid = false;
6440 }
6441 return valid;
6442 }
6443
6444 Writable.prototype.write = function(chunk, encoding, cb) {
6445 var state = this._writableState;
6446 var ret = false;
6447
6448 if (util.isFunction(encoding)) {
6449 cb = encoding;
6450 encoding = null;
6451 }
6452
6453 if (util.isBuffer(chunk))
6454 encoding = 'buffer';
6455 else if (!encoding)
6456 encoding = state.defaultEncoding;
6457
6458 if (!util.isFunction(cb))
6459 cb = function() {};
6460
6461 if (state.ended)
6462 writeAfterEnd(this, state, cb);
6463 else if (validChunk(this, state, chunk, cb)) {
6464 state.pendingcb++;
6465 ret = writeOrBuffer(this, state, chunk, encoding, cb);
6466 }
6467
6468 return ret;
6469 };
6470
6471 Writable.prototype.cork = function() {
6472 var state = this._writableState;
6473
6474 state.corked++;
6475 };
6476
6477 Writable.prototype.uncork = function() {
6478 var state = this._writableState;
6479
6480 if (state.corked) {
6481 state.corked--;
6482
6483 if (!state.writing &&
6484 !state.corked &&
6485 !state.finished &&
6486 !state.bufferProcessing &&
6487 state.buffer.length)
6488 clearBuffer(this, state);
6489 }
6490 };
6491
6492 function decodeChunk(state, chunk, encoding) {
6493 if (!state.objectMode &&
6494 state.decodeStrings !== false &&
6495 util.isString(chunk)) {
6496 chunk = new Buffer(chunk, encoding);
6497 }
6498 return chunk;
6499 }
6500
6501 // if we're already writing something, then just put this
6502 // in the queue, and wait our turn. Otherwise, call _write
6503 // If we return false, then we need a drain event, so set that flag.
6504 function writeOrBuffer(stream, state, chunk, encoding, cb) {
6505 chunk = decodeChunk(state, chunk, encoding);
6506 if (util.isBuffer(chunk))
6507 encoding = 'buffer';
6508 var len = state.objectMode ? 1 : chunk.length;
6509
6510 state.length += len;
6511
6512 var ret = state.length < state.highWaterMark;
6513 // we must ensure that previous needDrain will not be reset to false.
6514 if (!ret)
6515 state.needDrain = true;
6516
6517 if (state.writing || state.corked)
6518 state.buffer.push(new WriteReq(chunk, encoding, cb));
6519 else
6520 doWrite(stream, state, false, len, chunk, encoding, cb);
6521
6522 return ret;
6523 }
6524
6525 function doWrite(stream, state, writev, len, chunk, encoding, cb) {
6526 state.writelen = len;
6527 state.writecb = cb;
6528 state.writing = true;
6529 state.sync = true;
6530 if (writev)
6531 stream._writev(chunk, state.onwrite);
6532 else
6533 stream._write(chunk, encoding, state.onwrite);
6534 state.sync = false;
6535 }
6536
6537 function onwriteError(stream, state, sync, er, cb) {
6538 if (sync)
6539 process.nextTick(function() {
6540 state.pendingcb--;
6541 cb(er);
6542 });
6543 else {
6544 state.pendingcb--;
6545 cb(er);
6546 }
6547
6548 stream._writableState.errorEmitted = true;
6549 stream.emit('error', er);
6550 }
6551
6552 function onwriteStateUpdate(state) {
6553 state.writing = false;
6554 state.writecb = null;
6555 state.length -= state.writelen;
6556 state.writelen = 0;
6557 }
6558
6559 function onwrite(stream, er) {
6560 var state = stream._writableState;
6561 var sync = state.sync;
6562 var cb = state.writecb;
6563
6564 onwriteStateUpdate(state);
6565
6566 if (er)
6567 onwriteError(stream, state, sync, er, cb);
6568 else {
6569 // Check if we're actually ready to finish, but don't emit yet
6570 var finished = needFinish(stream, state);
6571
6572 if (!finished &&
6573 !state.corked &&
6574 !state.bufferProcessing &&
6575 state.buffer.length) {
6576 clearBuffer(stream, state);
6577 }
6578
6579 if (sync) {
6580 process.nextTick(function() {
6581 afterWrite(stream, state, finished, cb);
6582 });
6583 } else {
6584 afterWrite(stream, state, finished, cb);
6585 }
6586 }
6587 }
6588
6589 function afterWrite(stream, state, finished, cb) {
6590 if (!finished)
6591 onwriteDrain(stream, state);
6592 state.pendingcb--;
6593 cb();
6594 finishMaybe(stream, state);
6595 }
6596
6597 // Must force callback to be called on nextTick, so that we don't
6598 // emit 'drain' before the write() consumer gets the 'false' return
6599 // value, and has a chance to attach a 'drain' listener.
6600 function onwriteDrain(stream, state) {
6601 if (state.length === 0 && state.needDrain) {
6602 state.needDrain = false;
6603 stream.emit('drain');
6604 }
6605 }
6606
6607
6608 // if there's something in the buffer waiting, then process it
6609 function clearBuffer(stream, state) {
6610 state.bufferProcessing = true;
6611
6612 if (stream._writev && state.buffer.length > 1) {
6613 // Fast case, write everything using _writev()
6614 var cbs = [];
6615 for (var c = 0; c < state.buffer.length; c++)
6616 cbs.push(state.buffer[c].callback);
6617
6618 // count the one we are adding, as well.
6619 // TODO(isaacs) clean this up
6620 state.pendingcb++;
6621 doWrite(stream, state, true, state.length, state.buffer, '', function(err) {
6622 for (var i = 0; i < cbs.length; i++) {
6623 state.pendingcb--;
6624 cbs[i](err);
6625 }
6626 });
6627
6628 // Clear buffer
6629 state.buffer = [];
6630 } else {
6631 // Slow case, write chunks one-by-one
6632 for (var c = 0; c < state.buffer.length; c++) {
6633 var entry = state.buffer[c];
6634 var chunk = entry.chunk;
6635 var encoding = entry.encoding;
6636 var cb = entry.callback;
6637 var len = state.objectMode ? 1 : chunk.length;
6638
6639 doWrite(stream, state, false, len, chunk, encoding, cb);
6640
6641 // if we didn't call the onwrite immediately, then
6642 // it means that we need to wait until it does.
6643 // also, that means that the chunk and cb are currently
6644 // being processed, so move the buffer counter past them.
6645 if (state.writing) {
6646 c++;
6647 break;
6648 }
6649 }
6650
6651 if (c < state.buffer.length)
6652 state.buffer = state.buffer.slice(c);
6653 else
6654 state.buffer.length = 0;
6655 }
6656
6657 state.bufferProcessing = false;
6658 }
6659
6660 Writable.prototype._write = function(chunk, encoding, cb) {
6661 cb(new Error('not implemented'));
6662
6663 };
6664
6665 Writable.prototype._writev = null;
6666
6667 Writable.prototype.end = function(chunk, encoding, cb) {
6668 var state = this._writableState;
6669
6670 if (util.isFunction(chunk)) {
6671 cb = chunk;
6672 chunk = null;
6673 encoding = null;
6674 } else if (util.isFunction(encoding)) {
6675 cb = encoding;
6676 encoding = null;
6677 }
6678
6679 if (!util.isNullOrUndefined(chunk))
6680 this.write(chunk, encoding);
6681
6682 // .end() fully uncorks
6683 if (state.corked) {
6684 state.corked = 1;
6685 this.uncork();
6686 }
6687
6688 // ignore unnecessary end() calls.
6689 if (!state.ending && !state.finished)
6690 endWritable(this, state, cb);
6691 };
6692
6693
6694 function needFinish(stream, state) {
6695 return (state.ending &&
6696 state.length === 0 &&
6697 !state.finished &&
6698 !state.writing);
6699 }
6700
6701 function prefinish(stream, state) {
6702 if (!state.prefinished) {
6703 state.prefinished = true;
6704 stream.emit('prefinish');
6705 }
6706 }
6707
6708 function finishMaybe(stream, state) {
6709 var need = needFinish(stream, state);
6710 if (need) {
6711 if (state.pendingcb === 0) {
6712 prefinish(stream, state);
6713 state.finished = true;
6714 stream.emit('finish');
6715 } else
6716 prefinish(stream, state);
6717 }
6718 return need;
6719 }
6720
6721 function endWritable(stream, state, cb) {
6722 state.ending = true;
6723 finishMaybe(stream, state);
6724 if (cb) {
6725 if (state.finished)
6726 process.nextTick(cb);
6727 else
6728 stream.once('finish', cb);
6729 }
6730 state.ended = true;
6731 }
6732
6733 }).call(this,require('_process'))
6734 },{"./_stream_duplex":16,"_process":14,"buffer":7,"core-util-is":21,"inherits":12,"stream":26}],21:[function(require,module,exports){
6735 (function (Buffer){
6736 // Copyright Joyent, Inc. and other Node contributors.
6737 //
6738 // Permission is hereby granted, free of charge, to any person obtaining a
6739 // copy of this software and associated documentation files (the
6740 // "Software"), to deal in the Software without restriction, including
6741 // without limitation the rights to use, copy, modify, merge, publish,
6742 // distribute, sublicense, and/or sell copies of the Software, and to permit
6743 // persons to whom the Software is furnished to do so, subject to the
6744 // following conditions:
6745 //
6746 // The above copyright notice and this permission notice shall be included
6747 // in all copies or substantial portions of the Software.
6748 //
6749 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
6750 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
6751 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
6752 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
6753 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
6754 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
6755 // USE OR OTHER DEALINGS IN THE SOFTWARE.
6756
6757 // NOTE: These type checking functions intentionally don't use `instanceof`
6758 // because it is fragile and can be easily faked with `Object.create()`.
6759 function isArray(ar) {
6760 return Array.isArray(ar);
6761 }
6762 exports.isArray = isArray;
6763
6764 function isBoolean(arg) {
6765 return typeof arg === 'boolean';
6766 }
6767 exports.isBoolean = isBoolean;
6768
6769 function isNull(arg) {
6770 return arg === null;
6771 }
6772 exports.isNull = isNull;
6773
6774 function isNullOrUndefined(arg) {
6775 return arg == null;
6776 }
6777 exports.isNullOrUndefined = isNullOrUndefined;
6778
6779 function isNumber(arg) {
6780 return typeof arg === 'number';
6781 }
6782 exports.isNumber = isNumber;
6783
6784 function isString(arg) {
6785 return typeof arg === 'string';
6786 }
6787 exports.isString = isString;
6788
6789 function isSymbol(arg) {
6790 return typeof arg === 'symbol';
6791 }
6792 exports.isSymbol = isSymbol;
6793
6794 function isUndefined(arg) {
6795 return arg === void 0;
6796 }
6797 exports.isUndefined = isUndefined;
6798
6799 function isRegExp(re) {
6800 return isObject(re) && objectToString(re) === '[object RegExp]';
6801 }
6802 exports.isRegExp = isRegExp;
6803
6804 function isObject(arg) {
6805 return typeof arg === 'object' && arg !== null;
6806 }
6807 exports.isObject = isObject;
6808
6809 function isDate(d) {
6810 return isObject(d) && objectToString(d) === '[object Date]';
6811 }
6812 exports.isDate = isDate;
6813
6814 function isError(e) {
6815 return isObject(e) &&
6816 (objectToString(e) === '[object Error]' || e instanceof Error);
6817 }
6818 exports.isError = isError;
6819
6820 function isFunction(arg) {
6821 return typeof arg === 'function';
6822 }
6823 exports.isFunction = isFunction;
6824
6825 function isPrimitive(arg) {
6826 return arg === null ||
6827 typeof arg === 'boolean' ||
6828 typeof arg === 'number' ||
6829 typeof arg === 'string' ||
6830 typeof arg === 'symbol' || // ES6 symbol
6831 typeof arg === 'undefined';
6832 }
6833 exports.isPrimitive = isPrimitive;
6834
6835 function isBuffer(arg) {
6836 return Buffer.isBuffer(arg);
6837 }
6838 exports.isBuffer = isBuffer;
6839
6840 function objectToString(o) {
6841 return Object.prototype.toString.call(o);
6842 }
6843 }).call(this,require("buffer").Buffer)
6844 },{"buffer":7}],22:[function(require,module,exports){
6845 module.exports = require("./lib/_stream_passthrough.js")
6846
6847 },{"./lib/_stream_passthrough.js":17}],23:[function(require,module,exports){
6848 exports = module.exports = require('./lib/_stream_readable.js');
6849 exports.Stream = require('stream');
6850 exports.Readable = exports;
6851 exports.Writable = require('./lib/_stream_writable.js');
6852 exports.Duplex = require('./lib/_stream_duplex.js');
6853 exports.Transform = require('./lib/_stream_transform.js');
6854 exports.PassThrough = require('./lib/_stream_passthrough.js');
6855
6856 },{"./lib/_stream_duplex.js":16,"./lib/_stream_passthrough.js":17,"./lib/_stream_readable.js":18,"./lib/_stream_transform.js":19,"./lib/_stream_writable.js":20,"stream":26}],24:[function(require,module,exports){
6857 module.exports = require("./lib/_stream_transform.js")
6858
6859 },{"./lib/_stream_transform.js":19}],25:[function(require,module,exports){
6860 module.exports = require("./lib/_stream_writable.js")
6861
6862 },{"./lib/_stream_writable.js":20}],26:[function(require,module,exports){
6863 // Copyright Joyent, Inc. and other Node contributors.
6864 //
6865 // Permission is hereby granted, free of charge, to any person obtaining a
6866 // copy of this software and associated documentation files (the
6867 // "Software"), to deal in the Software without restriction, including
6868 // without limitation the rights to use, copy, modify, merge, publish,
6869 // distribute, sublicense, and/or sell copies of the Software, and to permit
6870 // persons to whom the Software is furnished to do so, subject to the
6871 // following conditions:
6872 //
6873 // The above copyright notice and this permission notice shall be included
6874 // in all copies or substantial portions of the Software.
6875 //
6876 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
6877 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
6878 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
6879 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
6880 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
6881 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
6882 // USE OR OTHER DEALINGS IN THE SOFTWARE.
6883
6884 module.exports = Stream;
6885
6886 var EE = require('events').EventEmitter;
6887 var inherits = require('inherits');
6888
6889 inherits(Stream, EE);
6890 Stream.Readable = require('readable-stream/readable.js');
6891 Stream.Writable = require('readable-stream/writable.js');
6892 Stream.Duplex = require('readable-stream/duplex.js');
6893 Stream.Transform = require('readable-stream/transform.js');
6894 Stream.PassThrough = require('readable-stream/passthrough.js');
6895
6896 // Backwards-compat with node 0.4.x
6897 Stream.Stream = Stream;
6898
6899
6900
6901 // old-style streams. Note that the pipe method (the only relevant
6902 // part of this class) is overridden in the Readable class.
6903
6904 function Stream() {
6905 EE.call(this);
6906 }
6907
6908 Stream.prototype.pipe = function(dest, options) {
6909 var source = this;
6910
6911 function ondata(chunk) {
6912 if (dest.writable) {
6913 if (false === dest.write(chunk) && source.pause) {
6914 source.pause();
6915 }
6916 }
6917 }
6918
6919 source.on('data', ondata);
6920
6921 function ondrain() {
6922 if (source.readable && source.resume) {
6923 source.resume();
6924 }
6925 }
6926
6927 dest.on('drain', ondrain);
6928
6929 // If the 'end' option is not supplied, dest.end() will be called when
6930 // source gets the 'end' or 'close' events. Only dest.end() once.
6931 if (!dest._isStdio && (!options || options.end !== false)) {
6932 source.on('end', onend);
6933 source.on('close', onclose);
6934 }
6935
6936 var didOnEnd = false;
6937 function onend() {
6938 if (didOnEnd) return;
6939 didOnEnd = true;
6940
6941 dest.end();
6942 }
6943
6944
6945 function onclose() {
6946 if (didOnEnd) return;
6947 didOnEnd = true;
6948
6949 if (typeof dest.destroy === 'function') dest.destroy();
6950 }
6951
6952 // don't leave dangling pipes when there are errors.
6953 function onerror(er) {
6954 cleanup();
6955 if (EE.listenerCount(this, 'error') === 0) {
6956 throw er; // Unhandled stream error in pipe.
6957 }
6958 }
6959
6960 source.on('error', onerror);
6961 dest.on('error', onerror);
6962
6963 // remove all the event listeners that were added.
6964 function cleanup() {
6965 source.removeListener('data', ondata);
6966 dest.removeListener('drain', ondrain);
6967
6968 source.removeListener('end', onend);
6969 source.removeListener('close', onclose);
6970
6971 source.removeListener('error', onerror);
6972 dest.removeListener('error', onerror);
6973
6974 source.removeListener('end', cleanup);
6975 source.removeListener('close', cleanup);
6976
6977 dest.removeListener('close', cleanup);
6978 }
6979
6980 source.on('end', cleanup);
6981 source.on('close', cleanup);
6982
6983 dest.on('close', cleanup);
6984
6985 dest.emit('pipe', source);
6986
6987 // Allow for unix-like usage: A.pipe(B).pipe(C)
6988 return dest;
6989 };
6990
6991 },{"events":11,"inherits":12,"readable-stream/duplex.js":15,"readable-stream/passthrough.js":22,"readable-stream/readable.js":23,"readable-stream/transform.js":24,"readable-stream/writable.js":25}],27:[function(require,module,exports){
6992 // Copyright Joyent, Inc. and other Node contributors.
6993 //
6994 // Permission is hereby granted, free of charge, to any person obtaining a
6995 // copy of this software and associated documentation files (the
6996 // "Software"), to deal in the Software without restriction, including
6997 // without limitation the rights to use, copy, modify, merge, publish,
6998 // distribute, sublicense, and/or sell copies of the Software, and to permit
6999 // persons to whom the Software is furnished to do so, subject to the
7000 // following conditions:
7001 //
7002 // The above copyright notice and this permission notice shall be included
7003 // in all copies or substantial portions of the Software.
7004 //
7005 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
7006 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
7007 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
7008 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
7009 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
7010 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
7011 // USE OR OTHER DEALINGS IN THE SOFTWARE.
7012
7013 var Buffer = require('buffer').Buffer;
7014
7015 var isBufferEncoding = Buffer.isEncoding
7016 || function(encoding) {
7017 switch (encoding && encoding.toLowerCase()) {
7018 case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'binary': case 'base64': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': case 'raw': return true;
7019 default: return false;
7020 }
7021 }
7022
7023
7024 function assertEncoding(encoding) {
7025 if (encoding && !isBufferEncoding(encoding)) {
7026 throw new Error('Unknown encoding: ' + encoding);
7027 }
7028 }
7029
7030 // StringDecoder provides an interface for efficiently splitting a series of
7031 // buffers into a series of JS strings without breaking apart multi-byte
7032 // characters. CESU-8 is handled as part of the UTF-8 encoding.
7033 //
7034 // @TODO Handling all encodings inside a single object makes it very difficult
7035 // to reason about this code, so it should be split up in the future.
7036 // @TODO There should be a utf8-strict encoding that rejects invalid UTF-8 code
7037 // points as used by CESU-8.
7038 var StringDecoder = exports.StringDecoder = function(encoding) {
7039 this.encoding = (encoding || 'utf8').toLowerCase().replace(/[-_]/, '');
7040 assertEncoding(encoding);
7041 switch (this.encoding) {
7042 case 'utf8':
7043 // CESU-8 represents each of Surrogate Pair by 3-bytes
7044 this.surrogateSize = 3;
7045 break;
7046 case 'ucs2':
7047 case 'utf16le':
7048 // UTF-16 represents each of Surrogate Pair by 2-bytes
7049 this.surrogateSize = 2;
7050 this.detectIncompleteChar = utf16DetectIncompleteChar;
7051 break;
7052 case 'base64':
7053 // Base-64 stores 3 bytes in 4 chars, and pads the remainder.
7054 this.surrogateSize = 3;
7055 this.detectIncompleteChar = base64DetectIncompleteChar;
7056 break;
7057 default:
7058 this.write = passThroughWrite;
7059 return;
7060 }
7061
7062 // Enough space to store all bytes of a single character. UTF-8 needs 4
7063 // bytes, but CESU-8 may require up to 6 (3 bytes per surrogate).
7064 this.charBuffer = new Buffer(6);
7065 // Number of bytes received for the current incomplete multi-byte character.
7066 this.charReceived = 0;
7067 // Number of bytes expected for the current incomplete multi-byte character.
7068 this.charLength = 0;
7069 };
7070
7071
7072 // write decodes the given buffer and returns it as JS string that is
7073 // guaranteed to not contain any partial multi-byte characters. Any partial
7074 // character found at the end of the buffer is buffered up, and will be
7075 // returned when calling write again with the remaining bytes.
7076 //
7077 // Note: Converting a Buffer containing an orphan surrogate to a String
7078 // currently works, but converting a String to a Buffer (via `new Buffer`, or
7079 // Buffer#write) will replace incomplete surrogates with the unicode
7080 // replacement character. See https://codereview.chromium.org/121173009/ .
7081 StringDecoder.prototype.write = function(buffer) {
7082 var charStr = '';
7083 // if our last write ended with an incomplete multibyte character
7084 while (this.charLength) {
7085 // determine how many remaining bytes this buffer has to offer for this char
7086 var available = (buffer.length >= this.charLength - this.charReceived) ?
7087 this.charLength - this.charReceived :
7088 buffer.length;
7089
7090 // add the new bytes to the char buffer
7091 buffer.copy(this.charBuffer, this.charReceived, 0, available);
7092 this.charReceived += available;
7093
7094 if (this.charReceived < this.charLength) {
7095 // still not enough chars in this buffer? wait for more ...
7096 return '';
7097 }
7098
7099 // remove bytes belonging to the current character from the buffer
7100 buffer = buffer.slice(available, buffer.length);
7101
7102 // get the character that was split
7103 charStr = this.charBuffer.slice(0, this.charLength).toString(this.encoding);
7104
7105 // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character
7106 var charCode = charStr.charCodeAt(charStr.length - 1);
7107 if (charCode >= 0xD800 && charCode <= 0xDBFF) {
7108 this.charLength += this.surrogateSize;
7109 charStr = '';
7110 continue;
7111 }
7112 this.charReceived = this.charLength = 0;
7113
7114 // if there are no more bytes in this buffer, just emit our char
7115 if (buffer.length === 0) {
7116 return charStr;
7117 }
7118 break;
7119 }
7120
7121 // determine and set charLength / charReceived
7122 this.detectIncompleteChar(buffer);
7123
7124 var end = buffer.length;
7125 if (this.charLength) {
7126 // buffer the incomplete character bytes we got
7127 buffer.copy(this.charBuffer, 0, buffer.length - this.charReceived, end);
7128 end -= this.charReceived;
7129 }
7130
7131 charStr += buffer.toString(this.encoding, 0, end);
7132
7133 var end = charStr.length - 1;
7134 var charCode = charStr.charCodeAt(end);
7135 // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character
7136 if (charCode >= 0xD800 && charCode <= 0xDBFF) {
7137 var size = this.surrogateSize;
7138 this.charLength += size;
7139 this.charReceived += size;
7140 this.charBuffer.copy(this.charBuffer, size, 0, size);
7141 buffer.copy(this.charBuffer, 0, 0, size);
7142 return charStr.substring(0, end);
7143 }
7144
7145 // or just emit the charStr
7146 return charStr;
7147 };
7148
7149 // detectIncompleteChar determines if there is an incomplete UTF-8 character at
7150 // the end of the given buffer. If so, it sets this.charLength to the byte
7151 // length that character, and sets this.charReceived to the number of bytes
7152 // that are available for this character.
7153 StringDecoder.prototype.detectIncompleteChar = function(buffer) {
7154 // determine how many bytes we have to check at the end of this buffer
7155 var i = (buffer.length >= 3) ? 3 : buffer.length;
7156
7157 // Figure out if one of the last i bytes of our buffer announces an
7158 // incomplete char.
7159 for (; i > 0; i--) {
7160 var c = buffer[buffer.length - i];
7161
7162 // See http://en.wikipedia.org/wiki/UTF-8#Description
7163
7164 // 110XXXXX
7165 if (i == 1 && c >> 5 == 0x06) {
7166 this.charLength = 2;
7167 break;
7168 }
7169
7170 // 1110XXXX
7171 if (i <= 2 && c >> 4 == 0x0E) {
7172 this.charLength = 3;
7173 break;
7174 }
7175
7176 // 11110XXX
7177 if (i <= 3 && c >> 3 == 0x1E) {
7178 this.charLength = 4;
7179 break;
7180 }
7181 }
7182 this.charReceived = i;
7183 };
7184
7185 StringDecoder.prototype.end = function(buffer) {
7186 var res = '';
7187 if (buffer && buffer.length)
7188 res = this.write(buffer);
7189
7190 if (this.charReceived) {
7191 var cr = this.charReceived;
7192 var buf = this.charBuffer;
7193 var enc = this.encoding;
7194 res += buf.slice(0, cr).toString(enc);
7195 }
7196
7197 return res;
7198 };
7199
7200 function passThroughWrite(buffer) {
7201 return buffer.toString(this.encoding);
7202 }
7203
7204 function utf16DetectIncompleteChar(buffer) {
7205 this.charReceived = buffer.length % 2;
7206 this.charLength = this.charReceived ? 2 : 0;
7207 }
7208
7209 function base64DetectIncompleteChar(buffer) {
7210 this.charReceived = buffer.length % 3;
7211 this.charLength = this.charReceived ? 3 : 0;
7212 }
7213
7214 },{"buffer":7}],28:[function(require,module,exports){
7215 module.exports = function isBuffer(arg) {
7216 return arg && typeof arg === 'object'
7217 && typeof arg.copy === 'function'
7218 && typeof arg.fill === 'function'
7219 && typeof arg.readUInt8 === 'function';
7220 }
7221 },{}],29:[function(require,module,exports){
7222 (function (process,global){
7223 // Copyright Joyent, Inc. and other Node contributors.
7224 //
7225 // Permission is hereby granted, free of charge, to any person obtaining a
7226 // copy of this software and associated documentation files (the
7227 // "Software"), to deal in the Software without restriction, including
7228 // without limitation the rights to use, copy, modify, merge, publish,
7229 // distribute, sublicense, and/or sell copies of the Software, and to permit
7230 // persons to whom the Software is furnished to do so, subject to the
7231 // following conditions:
7232 //
7233 // The above copyright notice and this permission notice shall be included
7234 // in all copies or substantial portions of the Software.
7235 //
7236 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
7237 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
7238 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
7239 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
7240 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
7241 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
7242 // USE OR OTHER DEALINGS IN THE SOFTWARE.
7243
7244 var formatRegExp = /%[sdj%]/g;
7245 exports.format = function(f) {
7246 if (!isString(f)) {
7247 var objects = [];
7248 for (var i = 0; i < arguments.length; i++) {
7249 objects.push(inspect(arguments[i]));
7250 }
7251 return objects.join(' ');
7252 }
7253
7254 var i = 1;
7255 var args = arguments;
7256 var len = args.length;
7257 var str = String(f).replace(formatRegExp, function(x) {
7258 if (x === '%%') return '%';
7259 if (i >= len) return x;
7260 switch (x) {
7261 case '%s': return String(args[i++]);
7262 case '%d': return Number(args[i++]);
7263 case '%j':
7264 try {
7265 return JSON.stringify(args[i++]);
7266 } catch (_) {
7267 return '[Circular]';
7268 }
7269 default:
7270 return x;
7271 }
7272 });
7273 for (var x = args[i]; i < len; x = args[++i]) {
7274 if (isNull(x) || !isObject(x)) {
7275 str += ' ' + x;
7276 } else {
7277 str += ' ' + inspect(x);
7278 }
7279 }
7280 return str;
7281 };
7282
7283
7284 // Mark that a method should not be used.
7285 // Returns a modified function which warns once by default.
7286 // If --no-deprecation is set, then it is a no-op.
7287 exports.deprecate = function(fn, msg) {
7288 // Allow for deprecating things in the process of starting up.
7289 if (isUndefined(global.process)) {
7290 return function() {
7291 return exports.deprecate(fn, msg).apply(this, arguments);
7292 };
7293 }
7294
7295 if (process.noDeprecation === true) {
7296 return fn;
7297 }
7298
7299 var warned = false;
7300 function deprecated() {
7301 if (!warned) {
7302 if (process.throwDeprecation) {
7303 throw new Error(msg);
7304 } else if (process.traceDeprecation) {
7305 console.trace(msg);
7306 } else {
7307 console.error(msg);
7308 }
7309 warned = true;
7310 }
7311 return fn.apply(this, arguments);
7312 }
7313
7314 return deprecated;
7315 };
7316
7317
7318 var debugs = {};
7319 var debugEnviron;
7320 exports.debuglog = function(set) {
7321 if (isUndefined(debugEnviron))
7322 debugEnviron = process.env.NODE_DEBUG || '';
7323 set = set.toUpperCase();
7324 if (!debugs[set]) {
7325 if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) {
7326 var pid = process.pid;
7327 debugs[set] = function() {
7328 var msg = exports.format.apply(exports, arguments);
7329 console.error('%s %d: %s', set, pid, msg);
7330 };
7331 } else {
7332 debugs[set] = function() {};
7333 }
7334 }
7335 return debugs[set];
7336 };
7337
7338
7339 /**
7340 * Echos the value of a value. Trys to print the value out
7341 * in the best way possible given the different types.
7342 *
7343 * @param {Object} obj The object to print out.
7344 * @param {Object} opts Optional options object that alters the output.
7345 */
7346 /* legacy: obj, showHidden, depth, colors*/
7347 function inspect(obj, opts) {
7348 // default options
7349 var ctx = {
7350 seen: [],
7351 stylize: stylizeNoColor
7352 };
7353 // legacy...
7354 if (arguments.length >= 3) ctx.depth = arguments[2];
7355 if (arguments.length >= 4) ctx.colors = arguments[3];
7356 if (isBoolean(opts)) {
7357 // legacy...
7358 ctx.showHidden = opts;
7359 } else if (opts) {
7360 // got an "options" object
7361 exports._extend(ctx, opts);
7362 }
7363 // set default options
7364 if (isUndefined(ctx.showHidden)) ctx.showHidden = false;
7365 if (isUndefined(ctx.depth)) ctx.depth = 2;
7366 if (isUndefined(ctx.colors)) ctx.colors = false;
7367 if (isUndefined(ctx.customInspect)) ctx.customInspect = true;
7368 if (ctx.colors) ctx.stylize = stylizeWithColor;
7369 return formatValue(ctx, obj, ctx.depth);
7370 }
7371 exports.inspect = inspect;
7372
7373
7374 // http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
7375 inspect.colors = {
7376 'bold' : [1, 22],
7377 'italic' : [3, 23],
7378 'underline' : [4, 24],
7379 'inverse' : [7, 27],
7380 'white' : [37, 39],
7381 'grey' : [90, 39],
7382 'black' : [30, 39],
7383 'blue' : [34, 39],
7384 'cyan' : [36, 39],
7385 'green' : [32, 39],
7386 'magenta' : [35, 39],
7387 'red' : [31, 39],
7388 'yellow' : [33, 39]
7389 };
7390
7391 // Don't use 'blue' not visible on cmd.exe
7392 inspect.styles = {
7393 'special': 'cyan',
7394 'number': 'yellow',
7395 'boolean': 'yellow',
7396 'undefined': 'grey',
7397 'null': 'bold',
7398 'string': 'green',
7399 'date': 'magenta',
7400 // "name": intentionally not styling
7401 'regexp': 'red'
7402 };
7403
7404
7405 function stylizeWithColor(str, styleType) {
7406 var style = inspect.styles[styleType];
7407
7408 if (style) {
7409 return '\u001b[' + inspect.colors[style][0] + 'm' + str +
7410 '\u001b[' + inspect.colors[style][1] + 'm';
7411 } else {
7412 return str;
7413 }
7414 }
7415
7416
7417 function stylizeNoColor(str, styleType) {
7418 return str;
7419 }
7420
7421
7422 function arrayToHash(array) {
7423 var hash = {};
7424
7425 array.forEach(function(val, idx) {
7426 hash[val] = true;
7427 });
7428
7429 return hash;
7430 }
7431
7432
7433 function formatValue(ctx, value, recurseTimes) {
7434 // Provide a hook for user-specified inspect functions.
7435 // Check that value is an object with an inspect function on it
7436 if (ctx.customInspect &&
7437 value &&
7438 isFunction(value.inspect) &&
7439 // Filter out the util module, it's inspect function is special
7440 value.inspect !== exports.inspect &&
7441 // Also filter out any prototype objects using the circular check.
7442 !(value.constructor && value.constructor.prototype === value)) {
7443 var ret = value.inspect(recurseTimes, ctx);
7444 if (!isString(ret)) {
7445 ret = formatValue(ctx, ret, recurseTimes);
7446 }
7447 return ret;
7448 }
7449
7450 // Primitive types cannot have properties
7451 var primitive = formatPrimitive(ctx, value);
7452 if (primitive) {
7453 return primitive;
7454 }
7455
7456 // Look up the keys of the object.
7457 var keys = Object.keys(value);
7458 var visibleKeys = arrayToHash(keys);
7459
7460 if (ctx.showHidden) {
7461 keys = Object.getOwnPropertyNames(value);
7462 }
7463
7464 // IE doesn't make error fields non-enumerable
7465 // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx
7466 if (isError(value)
7467 && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {
7468 return formatError(value);
7469 }
7470
7471 // Some type of object without properties can be shortcutted.
7472 if (keys.length === 0) {
7473 if (isFunction(value)) {
7474 var name = value.name ? ': ' + value.name : '';
7475 return ctx.stylize('[Function' + name + ']', 'special');
7476 }
7477 if (isRegExp(value)) {
7478 return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
7479 }
7480 if (isDate(value)) {
7481 return ctx.stylize(Date.prototype.toString.call(value), 'date');
7482 }
7483 if (isError(value)) {
7484 return formatError(value);
7485 }
7486 }
7487
7488 var base = '', array = false, braces = ['{', '}'];
7489
7490 // Make Array say that they are Array
7491 if (isArray(value)) {
7492 array = true;
7493 braces = ['[', ']'];
7494 }
7495
7496 // Make functions say that they are functions
7497 if (isFunction(value)) {
7498 var n = value.name ? ': ' + value.name : '';
7499 base = ' [Function' + n + ']';
7500 }
7501
7502 // Make RegExps say that they are RegExps
7503 if (isRegExp(value)) {
7504 base = ' ' + RegExp.prototype.toString.call(value);
7505 }
7506
7507 // Make dates with properties first say the date
7508 if (isDate(value)) {
7509 base = ' ' + Date.prototype.toUTCString.call(value);
7510 }
7511
7512 // Make error with message first say the error
7513 if (isError(value)) {
7514 base = ' ' + formatError(value);
7515 }
7516
7517 if (keys.length === 0 && (!array || value.length == 0)) {
7518 return braces[0] + base + braces[1];
7519 }
7520
7521 if (recurseTimes < 0) {
7522 if (isRegExp(value)) {
7523 return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
7524 } else {
7525 return ctx.stylize('[Object]', 'special');
7526 }
7527 }
7528
7529 ctx.seen.push(value);
7530
7531 var output;
7532 if (array) {
7533 output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
7534 } else {
7535 output = keys.map(function(key) {
7536 return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
7537 });
7538 }
7539
7540 ctx.seen.pop();
7541
7542 return reduceToSingleString(output, base, braces);
7543 }
7544
7545
7546 function formatPrimitive(ctx, value) {
7547 if (isUndefined(value))
7548 return ctx.stylize('undefined', 'undefined');
7549 if (isString(value)) {
7550 var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '')
7551 .replace(/'/g, "\\'")
7552 .replace(/\\"/g, '"') + '\'';
7553 return ctx.stylize(simple, 'string');
7554 }
7555 if (isNumber(value))
7556 return ctx.stylize('' + value, 'number');
7557 if (isBoolean(value))
7558 return ctx.stylize('' + value, 'boolean');
7559 // For some reason typeof null is "object", so special case here.
7560 if (isNull(value))
7561 return ctx.stylize('null', 'null');
7562 }
7563
7564
7565 function formatError(value) {
7566 return '[' + Error.prototype.toString.call(value) + ']';
7567 }
7568
7569
7570 function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
7571 var output = [];
7572 for (var i = 0, l = value.length; i < l; ++i) {
7573 if (hasOwnProperty(value, String(i))) {
7574 output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
7575 String(i), true));
7576 } else {
7577 output.push('');
7578 }
7579 }
7580 keys.forEach(function(key) {
7581 if (!key.match(/^\d+$/)) {
7582 output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
7583 key, true));
7584 }
7585 });
7586 return output;
7587 }
7588
7589
7590 function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
7591 var name, str, desc;
7592 desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };
7593 if (desc.get) {
7594 if (desc.set) {
7595 str = ctx.stylize('[Getter/Setter]', 'special');
7596 } else {
7597 str = ctx.stylize('[Getter]', 'special');
7598 }
7599 } else {
7600 if (desc.set) {
7601 str = ctx.stylize('[Setter]', 'special');
7602 }
7603 }
7604 if (!hasOwnProperty(visibleKeys, key)) {
7605 name = '[' + key + ']';
7606 }
7607 if (!str) {
7608 if (ctx.seen.indexOf(desc.value) < 0) {
7609 if (isNull(recurseTimes)) {
7610 str = formatValue(ctx, desc.value, null);
7611 } else {
7612 str = formatValue(ctx, desc.value, recurseTimes - 1);
7613 }
7614 if (str.indexOf('\n') > -1) {
7615 if (array) {
7616 str = str.split('\n').map(function(line) {
7617 return ' ' + line;
7618 }).join('\n').substr(2);
7619 } else {
7620 str = '\n' + str.split('\n').map(function(line) {
7621 return ' ' + line;
7622 }).join('\n');
7623 }
7624 }
7625 } else {
7626 str = ctx.stylize('[Circular]', 'special');
7627 }
7628 }
7629 if (isUndefined(name)) {
7630 if (array && key.match(/^\d+$/)) {
7631 return str;
7632 }
7633 name = JSON.stringify('' + key);
7634 if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
7635 name = name.substr(1, name.length - 2);
7636 name = ctx.stylize(name, 'name');
7637 } else {
7638 name = name.replace(/'/g, "\\'")
7639 .replace(/\\"/g, '"')
7640 .replace(/(^"|"$)/g, "'");
7641 name = ctx.stylize(name, 'string');
7642 }
7643 }
7644
7645 return name + ': ' + str;
7646 }
7647
7648
7649 function reduceToSingleString(output, base, braces) {
7650 var numLinesEst = 0;
7651 var length = output.reduce(function(prev, cur) {
7652 numLinesEst++;
7653 if (cur.indexOf('\n') >= 0) numLinesEst++;
7654 return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1;
7655 }, 0);
7656
7657 if (length > 60) {
7658 return braces[0] +
7659 (base === '' ? '' : base + '\n ') +
7660 ' ' +
7661 output.join(',\n ') +
7662 ' ' +
7663 braces[1];
7664 }
7665
7666 return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
7667 }
7668
7669
7670 // NOTE: These type checking functions intentionally don't use `instanceof`
7671 // because it is fragile and can be easily faked with `Object.create()`.
7672 function isArray(ar) {
7673 return Array.isArray(ar);
7674 }
7675 exports.isArray = isArray;
7676
7677 function isBoolean(arg) {
7678 return typeof arg === 'boolean';
7679 }
7680 exports.isBoolean = isBoolean;
7681
7682 function isNull(arg) {
7683 return arg === null;
7684 }
7685 exports.isNull = isNull;
7686
7687 function isNullOrUndefined(arg) {
7688 return arg == null;
7689 }
7690 exports.isNullOrUndefined = isNullOrUndefined;
7691
7692 function isNumber(arg) {
7693 return typeof arg === 'number';
7694 }
7695 exports.isNumber = isNumber;
7696
7697 function isString(arg) {
7698 return typeof arg === 'string';
7699 }
7700 exports.isString = isString;
7701
7702 function isSymbol(arg) {
7703 return typeof arg === 'symbol';
7704 }
7705 exports.isSymbol = isSymbol;
7706
7707 function isUndefined(arg) {
7708 return arg === void 0;
7709 }
7710 exports.isUndefined = isUndefined;
7711
7712 function isRegExp(re) {
7713 return isObject(re) && objectToString(re) === '[object RegExp]';
7714 }
7715 exports.isRegExp = isRegExp;
7716
7717 function isObject(arg) {
7718 return typeof arg === 'object' && arg !== null;
7719 }
7720 exports.isObject = isObject;
7721
7722 function isDate(d) {
7723 return isObject(d) && objectToString(d) === '[object Date]';
7724 }
7725 exports.isDate = isDate;
7726
7727 function isError(e) {
7728 return isObject(e) &&
7729 (objectToString(e) === '[object Error]' || e instanceof Error);
7730 }
7731 exports.isError = isError;
7732
7733 function isFunction(arg) {
7734 return typeof arg === 'function';
7735 }
7736 exports.isFunction = isFunction;
7737
7738 function isPrimitive(arg) {
7739 return arg === null ||
7740 typeof arg === 'boolean' ||
7741 typeof arg === 'number' ||
7742 typeof arg === 'string' ||
7743 typeof arg === 'symbol' || // ES6 symbol
7744 typeof arg === 'undefined';
7745 }
7746 exports.isPrimitive = isPrimitive;
7747
7748 exports.isBuffer = require('./support/isBuffer');
7749
7750 function objectToString(o) {
7751 return Object.prototype.toString.call(o);
7752 }
7753
7754
7755 function pad(n) {
7756 return n < 10 ? '0' + n.toString(10) : n.toString(10);
7757 }
7758
7759
7760 var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',
7761 'Oct', 'Nov', 'Dec'];
7762
7763 // 26 Feb 16:19:34
7764 function timestamp() {
7765 var d = new Date();
7766 var time = [pad(d.getHours()),
7767 pad(d.getMinutes()),
7768 pad(d.getSeconds())].join(':');
7769 return [d.getDate(), months[d.getMonth()], time].join(' ');
7770 }
7771
7772
7773 // log is just a thin wrapper to console.log that prepends a timestamp
7774 exports.log = function() {
7775 console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));
7776 };
7777
7778
7779 /**
7780 * Inherit the prototype methods from one constructor into another.
7781 *
7782 * The Function.prototype.inherits from lang.js rewritten as a standalone
7783 * function (not on Function.prototype). NOTE: If this file is to be loaded
7784 * during bootstrapping this function needs to be rewritten using some native
7785 * functions as prototype setup using normal JavaScript does not work as
7786 * expected during bootstrapping (see mirror.js in r114903).
7787 *
7788 * @param {function} ctor Constructor function which needs to inherit the
7789 * prototype.
7790 * @param {function} superCtor Constructor function to inherit prototype from.
7791 */
7792 exports.inherits = require('inherits');
7793
7794 exports._extend = function(origin, add) {
7795 // Don't do anything if add isn't an object
7796 if (!add || !isObject(add)) return origin;
7797
7798 var keys = Object.keys(add);
7799 var i = keys.length;
7800 while (i--) {
7801 origin[keys[i]] = add[keys[i]];
7802 }
7803 return origin;
7804 };
7805
7806 function hasOwnProperty(obj, prop) {
7807 return Object.prototype.hasOwnProperty.call(obj, prop);
7808 }
7809
7810 }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
7811 },{"./support/isBuffer":28,"_process":14,"inherits":12}],30:[function(require,module,exports){
7812 // Base58 encoding/decoding
7813 // Originally written by Mike Hearn for BitcoinJ
7814 // Copyright (c) 2011 Google Inc
7815 // Ported to JavaScript by Stefan Thomas
7816 // Merged Buffer refactorings from base58-native by Stephen Pair
7817 // Copyright (c) 2013 BitPay Inc
7818
7819 var ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
7820 var ALPHABET_MAP = {}
7821 for(var i = 0; i < ALPHABET.length; i++) {
7822 ALPHABET_MAP[ALPHABET.charAt(i)] = i
7823 }
7824 var BASE = 58
7825
7826 function encode(buffer) {
7827 if (buffer.length === 0) return ''
7828
7829 var i, j, digits = [0]
7830 for (i = 0; i < buffer.length; i++) {
7831 for (j = 0; j < digits.length; j++) digits[j] <<= 8
7832
7833 digits[0] += buffer[i]
7834
7835 var carry = 0
7836 for (j = 0; j < digits.length; ++j) {
7837 digits[j] += carry
7838
7839 carry = (digits[j] / BASE) | 0
7840 digits[j] %= BASE
7841 }
7842
7843 while (carry) {
7844 digits.push(carry % BASE)
7845
7846 carry = (carry / BASE) | 0
7847 }
7848 }
7849
7850 // deal with leading zeros
7851 for (i = 0; buffer[i] === 0 && i < buffer.length - 1; i++) digits.push(0)
7852
7853 // convert digits to a string
7854 var stringOutput = ""
7855 for (var i = digits.length - 1; i >= 0; i--) {
7856 stringOutput = stringOutput + ALPHABET[digits[i]]
7857 }
7858 return stringOutput
7859 }
7860
7861 function decode(string) {
7862 if (string.length === 0) return []
7863
7864 var i, j, bytes = [0]
7865 for (i = 0; i < string.length; i++) {
7866 var c = string[i]
7867 if (!(c in ALPHABET_MAP)) throw new Error('Non-base58 character')
7868
7869 for (j = 0; j < bytes.length; j++) bytes[j] *= BASE
7870 bytes[0] += ALPHABET_MAP[c]
7871
7872 var carry = 0
7873 for (j = 0; j < bytes.length; ++j) {
7874 bytes[j] += carry
7875
7876 carry = bytes[j] >> 8
7877 bytes[j] &= 0xff
7878 }
7879
7880 while (carry) {
7881 bytes.push(carry & 0xff)
7882
7883 carry >>= 8
7884 }
7885 }
7886
7887 // deal with leading zeros
7888 for (i = 0; string[i] === '1' && i < string.length - 1; i++) bytes.push(0)
7889
7890 return bytes.reverse()
7891 }
7892
7893 module.exports = {
7894 encode: encode,
7895 decode: decode
7896 }
7897
7898 },{}],31:[function(require,module,exports){
7899 (function (Buffer){
7900 'use strict'
7901
7902 var base58 = require('bs58')
7903 var createHash = require('create-hash')
7904
7905 // SHA256(SHA256(buffer))
7906 function sha256x2 (buffer) {
7907 buffer = createHash('sha256').update(buffer).digest()
7908 return createHash('sha256').update(buffer).digest()
7909 }
7910
7911 // Encode a buffer as a base58-check encoded string
7912 function encode (payload) {
7913 var checksum = sha256x2(payload).slice(0, 4)
7914
7915 return base58.encode(Buffer.concat([
7916 payload,
7917 checksum
7918 ]))
7919 }
7920
7921 // Decode a base58-check encoded string to a buffer
7922 function decode (string) {
7923 var buffer = new Buffer(base58.decode(string))
7924
7925 var payload = buffer.slice(0, -4)
7926 var checksum = buffer.slice(-4)
7927 var newChecksum = sha256x2(payload).slice(0, 4)
7928
7929 for (var i = 0; i < newChecksum.length; ++i) {
7930 if (newChecksum[i] === checksum[i]) continue
7931
7932 throw new Error('Invalid checksum')
7933 }
7934
7935 return payload
7936 }
7937
7938 module.exports = {
7939 encode: encode,
7940 decode: decode
7941 }
7942
7943 }).call(this,require("buffer").Buffer)
7944 },{"bs58":30,"buffer":7,"create-hash":32}],32:[function(require,module,exports){
7945 (function (Buffer){
7946 'use strict';
7947 var inherits = require('inherits')
7948 var md5 = require('./md5')
7949 var rmd160 = require('ripemd160')
7950 var sha = require('sha.js')
7951
7952 var Transform = require('stream').Transform
7953
7954 function HashNoConstructor(hash) {
7955 Transform.call(this)
7956
7957 this._hash = hash
7958 this.buffers = []
7959 }
7960
7961 inherits(HashNoConstructor, Transform)
7962
7963 HashNoConstructor.prototype._transform = function (data, _, next) {
7964 this.buffers.push(data)
7965
7966 next()
7967 }
7968
7969 HashNoConstructor.prototype._flush = function (next) {
7970 this.push(this.digest())
7971 next()
7972 }
7973
7974 HashNoConstructor.prototype.update = function (data, enc) {
7975 if (typeof data === 'string') {
7976 data = new Buffer(data, enc)
7977 }
7978
7979 this.buffers.push(data)
7980 return this
7981 }
7982
7983 HashNoConstructor.prototype.digest = function (enc) {
7984 var buf = Buffer.concat(this.buffers)
7985 var r = this._hash(buf)
7986 this.buffers = null
7987
7988 return enc ? r.toString(enc) : r
7989 }
7990
7991 function Hash(hash) {
7992 Transform.call(this)
7993
7994 this._hash = hash
7995 }
7996
7997 inherits(Hash, Transform)
7998
7999 Hash.prototype._transform = function (data, enc, next) {
8000 if (enc) data = new Buffer(data, enc)
8001
8002 this._hash.update(data)
8003
8004 next()
8005 }
8006
8007 Hash.prototype._flush = function (next) {
8008 this.push(this._hash.digest())
8009 this._hash = null
8010
8011 next()
8012 }
8013
8014 Hash.prototype.update = function (data, enc) {
8015 if (typeof data === 'string') {
8016 data = new Buffer(data, enc)
8017 }
8018
8019 this._hash.update(data)
8020 return this
8021 }
8022
8023 Hash.prototype.digest = function (enc) {
8024 var outData = this._hash.digest()
8025
8026 return enc ? outData.toString(enc) : outData
8027 }
8028
8029 module.exports = function createHash (alg) {
8030 if ('md5' === alg) return new HashNoConstructor(md5)
8031 if ('rmd160' === alg) return new HashNoConstructor(rmd160)
8032
8033 return new Hash(sha(alg))
8034 }
8035
8036 }).call(this,require("buffer").Buffer)
8037 },{"./md5":34,"buffer":7,"inherits":35,"ripemd160":36,"sha.js":38,"stream":26}],33:[function(require,module,exports){
8038 (function (Buffer){
8039 'use strict';
8040 var intSize = 4;
8041 var zeroBuffer = new Buffer(intSize); zeroBuffer.fill(0);
8042 var chrsz = 8;
8043
8044 function toArray(buf, bigEndian) {
8045 if ((buf.length % intSize) !== 0) {
8046 var len = buf.length + (intSize - (buf.length % intSize));
8047 buf = Buffer.concat([buf, zeroBuffer], len);
8048 }
8049
8050 var arr = [];
8051 var fn = bigEndian ? buf.readInt32BE : buf.readInt32LE;
8052 for (var i = 0; i < buf.length; i += intSize) {
8053 arr.push(fn.call(buf, i));
8054 }
8055 return arr;
8056 }
8057
8058 function toBuffer(arr, size, bigEndian) {
8059 var buf = new Buffer(size);
8060 var fn = bigEndian ? buf.writeInt32BE : buf.writeInt32LE;
8061 for (var i = 0; i < arr.length; i++) {
8062 fn.call(buf, arr[i], i * 4, true);
8063 }
8064 return buf;
8065 }
8066
8067 function hash(buf, fn, hashSize, bigEndian) {
8068 if (!Buffer.isBuffer(buf)) buf = new Buffer(buf);
8069 var arr = fn(toArray(buf, bigEndian), buf.length * chrsz);
8070 return toBuffer(arr, hashSize, bigEndian);
8071 }
8072 exports.hash = hash;
8073 }).call(this,require("buffer").Buffer)
8074 },{"buffer":7}],34:[function(require,module,exports){
8075 'use strict';
8076 /*
8077 * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
8078 * Digest Algorithm, as defined in RFC 1321.
8079 * Version 2.1 Copyright (C) Paul Johnston 1999 - 2002.
8080 * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
8081 * Distributed under the BSD License
8082 * See http://pajhome.org.uk/crypt/md5 for more info.
8083 */
8084
8085 var helpers = require('./helpers');
8086
8087 /*
8088 * Calculate the MD5 of an array of little-endian words, and a bit length
8089 */
8090 function core_md5(x, len)
8091 {
8092 /* append padding */
8093 x[len >> 5] |= 0x80 << ((len) % 32);
8094 x[(((len + 64) >>> 9) << 4) + 14] = len;
8095
8096 var a = 1732584193;
8097 var b = -271733879;
8098 var c = -1732584194;
8099 var d = 271733878;
8100
8101 for(var i = 0; i < x.length; i += 16)
8102 {
8103 var olda = a;
8104 var oldb = b;
8105 var oldc = c;
8106 var oldd = d;
8107
8108 a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936);
8109 d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586);
8110 c = md5_ff(c, d, a, b, x[i+ 2], 17, 606105819);
8111 b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330);
8112 a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897);
8113 d = md5_ff(d, a, b, c, x[i+ 5], 12, 1200080426);
8114 c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341);
8115 b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983);
8116 a = md5_ff(a, b, c, d, x[i+ 8], 7 , 1770035416);
8117 d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417);
8118 c = md5_ff(c, d, a, b, x[i+10], 17, -42063);
8119 b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162);
8120 a = md5_ff(a, b, c, d, x[i+12], 7 , 1804603682);
8121 d = md5_ff(d, a, b, c, x[i+13], 12, -40341101);
8122 c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290);
8123 b = md5_ff(b, c, d, a, x[i+15], 22, 1236535329);
8124
8125 a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510);
8126 d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632);
8127 c = md5_gg(c, d, a, b, x[i+11], 14, 643717713);
8128 b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302);
8129 a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691);
8130 d = md5_gg(d, a, b, c, x[i+10], 9 , 38016083);
8131 c = md5_gg(c, d, a, b, x[i+15], 14, -660478335);
8132 b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848);
8133 a = md5_gg(a, b, c, d, x[i+ 9], 5 , 568446438);
8134 d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690);
8135 c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961);
8136 b = md5_gg(b, c, d, a, x[i+ 8], 20, 1163531501);
8137 a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467);
8138 d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784);
8139 c = md5_gg(c, d, a, b, x[i+ 7], 14, 1735328473);
8140 b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734);
8141
8142 a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558);
8143 d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463);
8144 c = md5_hh(c, d, a, b, x[i+11], 16, 1839030562);
8145 b = md5_hh(b, c, d, a, x[i+14], 23, -35309556);
8146 a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060);
8147 d = md5_hh(d, a, b, c, x[i+ 4], 11, 1272893353);
8148 c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632);
8149 b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640);
8150 a = md5_hh(a, b, c, d, x[i+13], 4 , 681279174);
8151 d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222);
8152 c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979);
8153 b = md5_hh(b, c, d, a, x[i+ 6], 23, 76029189);
8154 a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487);
8155 d = md5_hh(d, a, b, c, x[i+12], 11, -421815835);
8156 c = md5_hh(c, d, a, b, x[i+15], 16, 530742520);
8157 b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651);
8158
8159 a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844);
8160 d = md5_ii(d, a, b, c, x[i+ 7], 10, 1126891415);
8161 c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905);
8162 b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055);
8163 a = md5_ii(a, b, c, d, x[i+12], 6 , 1700485571);
8164 d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606);
8165 c = md5_ii(c, d, a, b, x[i+10], 15, -1051523);
8166 b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799);
8167 a = md5_ii(a, b, c, d, x[i+ 8], 6 , 1873313359);
8168 d = md5_ii(d, a, b, c, x[i+15], 10, -30611744);
8169 c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380);
8170 b = md5_ii(b, c, d, a, x[i+13], 21, 1309151649);
8171 a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070);
8172 d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379);
8173 c = md5_ii(c, d, a, b, x[i+ 2], 15, 718787259);
8174 b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551);
8175
8176 a = safe_add(a, olda);
8177 b = safe_add(b, oldb);
8178 c = safe_add(c, oldc);
8179 d = safe_add(d, oldd);
8180 }
8181 return Array(a, b, c, d);
8182
8183 }
8184
8185 /*
8186 * These functions implement the four basic operations the algorithm uses.
8187 */
8188 function md5_cmn(q, a, b, x, s, t)
8189 {
8190 return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b);
8191 }
8192 function md5_ff(a, b, c, d, x, s, t)
8193 {
8194 return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);
8195 }
8196 function md5_gg(a, b, c, d, x, s, t)
8197 {
8198 return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);
8199 }
8200 function md5_hh(a, b, c, d, x, s, t)
8201 {
8202 return md5_cmn(b ^ c ^ d, a, b, x, s, t);
8203 }
8204 function md5_ii(a, b, c, d, x, s, t)
8205 {
8206 return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);
8207 }
8208
8209 /*
8210 * Add integers, wrapping at 2^32. This uses 16-bit operations internally
8211 * to work around bugs in some JS interpreters.
8212 */
8213 function safe_add(x, y)
8214 {
8215 var lsw = (x & 0xFFFF) + (y & 0xFFFF);
8216 var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
8217 return (msw << 16) | (lsw & 0xFFFF);
8218 }
8219
8220 /*
8221 * Bitwise rotate a 32-bit number to the left.
8222 */
8223 function bit_rol(num, cnt)
8224 {
8225 return (num << cnt) | (num >>> (32 - cnt));
8226 }
8227
8228 module.exports = function md5(buf) {
8229 return helpers.hash(buf, core_md5, 16);
8230 };
8231 },{"./helpers":33}],35:[function(require,module,exports){
8232 arguments[4][12][0].apply(exports,arguments)
8233 },{"dup":12}],36:[function(require,module,exports){
8234 (function (Buffer){
8235 /*
8236 CryptoJS v3.1.2
8237 code.google.com/p/crypto-js
8238 (c) 2009-2013 by Jeff Mott. All rights reserved.
8239 code.google.com/p/crypto-js/wiki/License
8240 */
8241 /** @preserve
8242 (c) 2012 by Cédric Mesnil. All rights reserved.
8243
8244 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
8245
8246 - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
8247 - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8248
8249 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8250 */
8251
8252 // constants table
8253 var zl = [
8254 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
8255 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,
8256 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12,
8257 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2,
8258 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13
8259 ]
8260
8261 var zr = [
8262 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12,
8263 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2,
8264 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13,
8265 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14,
8266 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11
8267 ]
8268
8269 var sl = [
8270 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8,
8271 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12,
8272 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5,
8273 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12,
8274 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6
8275 ]
8276
8277 var sr = [
8278 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6,
8279 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11,
8280 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5,
8281 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8,
8282 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11
8283 ]
8284
8285 var hl = [0x00000000, 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xA953FD4E]
8286 var hr = [0x50A28BE6, 0x5C4DD124, 0x6D703EF3, 0x7A6D76E9, 0x00000000]
8287
8288 function bytesToWords (bytes) {
8289 var words = []
8290 for (var i = 0, b = 0; i < bytes.length; i++, b += 8) {
8291 words[b >>> 5] |= bytes[i] << (24 - b % 32)
8292 }
8293 return words
8294 }
8295
8296 function wordsToBytes (words) {
8297 var bytes = []
8298 for (var b = 0; b < words.length * 32; b += 8) {
8299 bytes.push((words[b >>> 5] >>> (24 - b % 32)) & 0xFF)
8300 }
8301 return bytes
8302 }
8303
8304 function processBlock (H, M, offset) {
8305 // swap endian
8306 for (var i = 0; i < 16; i++) {
8307 var offset_i = offset + i
8308 var M_offset_i = M[offset_i]
8309
8310 // Swap
8311 M[offset_i] = (
8312 (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) |
8313 (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00)
8314 )
8315 }
8316
8317 // Working variables
8318 var al, bl, cl, dl, el
8319 var ar, br, cr, dr, er
8320
8321 ar = al = H[0]
8322 br = bl = H[1]
8323 cr = cl = H[2]
8324 dr = dl = H[3]
8325 er = el = H[4]
8326
8327 // computation
8328 var t
8329 for (i = 0; i < 80; i += 1) {
8330 t = (al + M[offset + zl[i]]) | 0
8331 if (i < 16) {
8332 t += f1(bl, cl, dl) + hl[0]
8333 } else if (i < 32) {
8334 t += f2(bl, cl, dl) + hl[1]
8335 } else if (i < 48) {
8336 t += f3(bl, cl, dl) + hl[2]
8337 } else if (i < 64) {
8338 t += f4(bl, cl, dl) + hl[3]
8339 } else {// if (i<80) {
8340 t += f5(bl, cl, dl) + hl[4]
8341 }
8342 t = t | 0
8343 t = rotl(t, sl[i])
8344 t = (t + el) | 0
8345 al = el
8346 el = dl
8347 dl = rotl(cl, 10)
8348 cl = bl
8349 bl = t
8350
8351 t = (ar + M[offset + zr[i]]) | 0
8352 if (i < 16) {
8353 t += f5(br, cr, dr) + hr[0]
8354 } else if (i < 32) {
8355 t += f4(br, cr, dr) + hr[1]
8356 } else if (i < 48) {
8357 t += f3(br, cr, dr) + hr[2]
8358 } else if (i < 64) {
8359 t += f2(br, cr, dr) + hr[3]
8360 } else {// if (i<80) {
8361 t += f1(br, cr, dr) + hr[4]
8362 }
8363
8364 t = t | 0
8365 t = rotl(t, sr[i])
8366 t = (t + er) | 0
8367 ar = er
8368 er = dr
8369 dr = rotl(cr, 10)
8370 cr = br
8371 br = t
8372 }
8373
8374 // intermediate hash value
8375 t = (H[1] + cl + dr) | 0
8376 H[1] = (H[2] + dl + er) | 0
8377 H[2] = (H[3] + el + ar) | 0
8378 H[3] = (H[4] + al + br) | 0
8379 H[4] = (H[0] + bl + cr) | 0
8380 H[0] = t
8381 }
8382
8383 function f1 (x, y, z) {
8384 return ((x) ^ (y) ^ (z))
8385 }
8386
8387 function f2 (x, y, z) {
8388 return (((x) & (y)) | ((~x) & (z)))
8389 }
8390
8391 function f3 (x, y, z) {
8392 return (((x) | (~(y))) ^ (z))
8393 }
8394
8395 function f4 (x, y, z) {
8396 return (((x) & (z)) | ((y) & (~(z))))
8397 }
8398
8399 function f5 (x, y, z) {
8400 return ((x) ^ ((y) | (~(z))))
8401 }
8402
8403 function rotl (x, n) {
8404 return (x << n) | (x >>> (32 - n))
8405 }
8406
8407 function ripemd160 (message) {
8408 var H = [0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0]
8409
8410 if (typeof message === 'string') {
8411 message = new Buffer(message, 'utf8')
8412 }
8413
8414 var m = bytesToWords(message)
8415
8416 var nBitsLeft = message.length * 8
8417 var nBitsTotal = message.length * 8
8418
8419 // Add padding
8420 m[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32)
8421 m[(((nBitsLeft + 64) >>> 9) << 4) + 14] = (
8422 (((nBitsTotal << 8) | (nBitsTotal >>> 24)) & 0x00ff00ff) |
8423 (((nBitsTotal << 24) | (nBitsTotal >>> 8)) & 0xff00ff00)
8424 )
8425
8426 for (var i = 0; i < m.length; i += 16) {
8427 processBlock(H, m, i)
8428 }
8429
8430 // swap endian
8431 for (i = 0; i < 5; i++) {
8432 // shortcut
8433 var H_i = H[i]
8434
8435 // Swap
8436 H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) |
8437 (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00)
8438 }
8439
8440 var digestbytes = wordsToBytes(H)
8441 return new Buffer(digestbytes)
8442 }
8443
8444 module.exports = ripemd160
8445
8446 }).call(this,require("buffer").Buffer)
8447 },{"buffer":7}],37:[function(require,module,exports){
8448 (function (Buffer){
8449 // prototype class for hash functions
8450 function Hash (blockSize, finalSize) {
8451 this._block = new Buffer(blockSize)
8452 this._finalSize = finalSize
8453 this._blockSize = blockSize
8454 this._len = 0
8455 this._s = 0
8456 }
8457
8458 Hash.prototype.update = function (data, enc) {
8459 if (typeof data === 'string') {
8460 enc = enc || 'utf8'
8461 data = new Buffer(data, enc)
8462 }
8463
8464 var l = this._len += data.length
8465 var s = this._s || 0
8466 var f = 0
8467 var buffer = this._block
8468
8469 while (s < l) {
8470 var t = Math.min(data.length, f + this._blockSize - (s % this._blockSize))
8471 var ch = (t - f)
8472
8473 for (var i = 0; i < ch; i++) {
8474 buffer[(s % this._blockSize) + i] = data[i + f]
8475 }
8476
8477 s += ch
8478 f += ch
8479
8480 if ((s % this._blockSize) === 0) {
8481 this._update(buffer)
8482 }
8483 }
8484 this._s = s
8485
8486 return this
8487 }
8488
8489 Hash.prototype.digest = function (enc) {
8490 // Suppose the length of the message M, in bits, is l
8491 var l = this._len * 8
8492
8493 // Append the bit 1 to the end of the message
8494 this._block[this._len % this._blockSize] = 0x80
8495
8496 // and then k zero bits, where k is the smallest non-negative solution to the equation (l + 1 + k) === finalSize mod blockSize
8497 this._block.fill(0, this._len % this._blockSize + 1)
8498
8499 if (l % (this._blockSize * 8) >= this._finalSize * 8) {
8500 this._update(this._block)
8501 this._block.fill(0)
8502 }
8503
8504 // to this append the block which is equal to the number l written in binary
8505 // TODO: handle case where l is > Math.pow(2, 29)
8506 this._block.writeInt32BE(l, this._blockSize - 4)
8507
8508 var hash = this._update(this._block) || this._hash()
8509
8510 return enc ? hash.toString(enc) : hash
8511 }
8512
8513 Hash.prototype._update = function () {
8514 throw new Error('_update must be implemented by subclass')
8515 }
8516
8517 module.exports = Hash
8518
8519 }).call(this,require("buffer").Buffer)
8520 },{"buffer":7}],38:[function(require,module,exports){
8521 var exports = module.exports = function SHA (algorithm) {
8522 algorithm = algorithm.toLowerCase()
8523
8524 var Algorithm = exports[algorithm]
8525 if (!Algorithm) throw new Error(algorithm + ' is not supported (we accept pull requests)')
8526
8527 return new Algorithm()
8528 }
8529
8530 exports.sha = require('./sha')
8531 exports.sha1 = require('./sha1')
8532 exports.sha224 = require('./sha224')
8533 exports.sha256 = require('./sha256')
8534 exports.sha384 = require('./sha384')
8535 exports.sha512 = require('./sha512')
8536
8537 },{"./sha":39,"./sha1":40,"./sha224":41,"./sha256":42,"./sha384":43,"./sha512":44}],39:[function(require,module,exports){
8538 (function (Buffer){
8539 /*
8540 * A JavaScript implementation of the Secure Hash Algorithm, SHA-0, as defined
8541 * in FIPS PUB 180-1
8542 * This source code is derived from sha1.js of the same repository.
8543 * The difference between SHA-0 and SHA-1 is just a bitwise rotate left
8544 * operation was added.
8545 */
8546
8547 var inherits = require('inherits')
8548 var Hash = require('./hash')
8549
8550 var W = new Array(80)
8551
8552 function Sha () {
8553 this.init()
8554 this._w = W
8555
8556 Hash.call(this, 64, 56)
8557 }
8558
8559 inherits(Sha, Hash)
8560
8561 Sha.prototype.init = function () {
8562 this._a = 0x67452301 | 0
8563 this._b = 0xefcdab89 | 0
8564 this._c = 0x98badcfe | 0
8565 this._d = 0x10325476 | 0
8566 this._e = 0xc3d2e1f0 | 0
8567
8568 return this
8569 }
8570
8571 /*
8572 * Bitwise rotate a 32-bit number to the left.
8573 */
8574 function rol (num, cnt) {
8575 return (num << cnt) | (num >>> (32 - cnt))
8576 }
8577
8578 Sha.prototype._update = function (M) {
8579 var W = this._w
8580
8581 var a = this._a
8582 var b = this._b
8583 var c = this._c
8584 var d = this._d
8585 var e = this._e
8586
8587 var j = 0, k
8588
8589 /*
8590 * SHA-1 has a bitwise rotate left operation. But, SHA is not
8591 * function calcW() { return rol(W[j - 3] ^ W[j - 8] ^ W[j - 14] ^ W[j - 16], 1) }
8592 */
8593 function calcW () { return W[j - 3] ^ W[j - 8] ^ W[j - 14] ^ W[j - 16] }
8594 function loop (w, f) {
8595 W[j] = w
8596
8597 var t = rol(a, 5) + f + e + w + k
8598
8599 e = d
8600 d = c
8601 c = rol(b, 30)
8602 b = a
8603 a = t
8604 j++
8605 }
8606
8607 k = 1518500249
8608 while (j < 16) loop(M.readInt32BE(j * 4), (b & c) | ((~b) & d))
8609 while (j < 20) loop(calcW(), (b & c) | ((~b) & d))
8610 k = 1859775393
8611 while (j < 40) loop(calcW(), b ^ c ^ d)
8612 k = -1894007588
8613 while (j < 60) loop(calcW(), (b & c) | (b & d) | (c & d))
8614 k = -899497514
8615 while (j < 80) loop(calcW(), b ^ c ^ d)
8616
8617 this._a = (a + this._a) | 0
8618 this._b = (b + this._b) | 0
8619 this._c = (c + this._c) | 0
8620 this._d = (d + this._d) | 0
8621 this._e = (e + this._e) | 0
8622 }
8623
8624 Sha.prototype._hash = function () {
8625 var H = new Buffer(20)
8626
8627 H.writeInt32BE(this._a | 0, 0)
8628 H.writeInt32BE(this._b | 0, 4)
8629 H.writeInt32BE(this._c | 0, 8)
8630 H.writeInt32BE(this._d | 0, 12)
8631 H.writeInt32BE(this._e | 0, 16)
8632
8633 return H
8634 }
8635
8636 module.exports = Sha
8637
8638
8639 }).call(this,require("buffer").Buffer)
8640 },{"./hash":37,"buffer":7,"inherits":35}],40:[function(require,module,exports){
8641 (function (Buffer){
8642 /*
8643 * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined
8644 * in FIPS PUB 180-1
8645 * Version 2.1a Copyright Paul Johnston 2000 - 2002.
8646 * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
8647 * Distributed under the BSD License
8648 * See http://pajhome.org.uk/crypt/md5 for details.
8649 */
8650
8651 var inherits = require('inherits')
8652 var Hash = require('./hash')
8653
8654 var W = new Array(80)
8655
8656 function Sha1 () {
8657 this.init()
8658 this._w = W
8659
8660 Hash.call(this, 64, 56)
8661 }
8662
8663 inherits(Sha1, Hash)
8664
8665 Sha1.prototype.init = function () {
8666 this._a = 0x67452301 | 0
8667 this._b = 0xefcdab89 | 0
8668 this._c = 0x98badcfe | 0
8669 this._d = 0x10325476 | 0
8670 this._e = 0xc3d2e1f0 | 0
8671
8672 return this
8673 }
8674
8675 /*
8676 * Bitwise rotate a 32-bit number to the left.
8677 */
8678 function rol (num, cnt) {
8679 return (num << cnt) | (num >>> (32 - cnt))
8680 }
8681
8682 Sha1.prototype._update = function (M) {
8683 var W = this._w
8684
8685 var a = this._a
8686 var b = this._b
8687 var c = this._c
8688 var d = this._d
8689 var e = this._e
8690
8691 var j = 0, k
8692
8693 function calcW () { return rol(W[j - 3] ^ W[j - 8] ^ W[j - 14] ^ W[j - 16], 1) }
8694 function loop (w, f) {
8695 W[j] = w
8696
8697 var t = rol(a, 5) + f + e + w + k
8698
8699 e = d
8700 d = c
8701 c = rol(b, 30)
8702 b = a
8703 a = t
8704 j++
8705 }
8706
8707 k = 1518500249
8708 while (j < 16) loop(M.readInt32BE(j * 4), (b & c) | ((~b) & d))
8709 while (j < 20) loop(calcW(), (b & c) | ((~b) & d))
8710 k = 1859775393
8711 while (j < 40) loop(calcW(), b ^ c ^ d)
8712 k = -1894007588
8713 while (j < 60) loop(calcW(), (b & c) | (b & d) | (c & d))
8714 k = -899497514
8715 while (j < 80) loop(calcW(), b ^ c ^ d)
8716
8717 this._a = (a + this._a) | 0
8718 this._b = (b + this._b) | 0
8719 this._c = (c + this._c) | 0
8720 this._d = (d + this._d) | 0
8721 this._e = (e + this._e) | 0
8722 }
8723
8724 Sha1.prototype._hash = function () {
8725 var H = new Buffer(20)
8726
8727 H.writeInt32BE(this._a | 0, 0)
8728 H.writeInt32BE(this._b | 0, 4)
8729 H.writeInt32BE(this._c | 0, 8)
8730 H.writeInt32BE(this._d | 0, 12)
8731 H.writeInt32BE(this._e | 0, 16)
8732
8733 return H
8734 }
8735
8736 module.exports = Sha1
8737
8738 }).call(this,require("buffer").Buffer)
8739 },{"./hash":37,"buffer":7,"inherits":35}],41:[function(require,module,exports){
8740 (function (Buffer){
8741 /**
8742 * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined
8743 * in FIPS 180-2
8744 * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009.
8745 * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
8746 *
8747 */
8748
8749 var inherits = require('inherits')
8750 var Sha256 = require('./sha256')
8751 var Hash = require('./hash')
8752
8753 var W = new Array(64)
8754
8755 function Sha224 () {
8756 this.init()
8757
8758 this._w = W // new Array(64)
8759
8760 Hash.call(this, 64, 56)
8761 }
8762
8763 inherits(Sha224, Sha256)
8764
8765 Sha224.prototype.init = function () {
8766 this._a = 0xc1059ed8 | 0
8767 this._b = 0x367cd507 | 0
8768 this._c = 0x3070dd17 | 0
8769 this._d = 0xf70e5939 | 0
8770 this._e = 0xffc00b31 | 0
8771 this._f = 0x68581511 | 0
8772 this._g = 0x64f98fa7 | 0
8773 this._h = 0xbefa4fa4 | 0
8774
8775 return this
8776 }
8777
8778 Sha224.prototype._hash = function () {
8779 var H = new Buffer(28)
8780
8781 H.writeInt32BE(this._a, 0)
8782 H.writeInt32BE(this._b, 4)
8783 H.writeInt32BE(this._c, 8)
8784 H.writeInt32BE(this._d, 12)
8785 H.writeInt32BE(this._e, 16)
8786 H.writeInt32BE(this._f, 20)
8787 H.writeInt32BE(this._g, 24)
8788
8789 return H
8790 }
8791
8792 module.exports = Sha224
8793
8794 }).call(this,require("buffer").Buffer)
8795 },{"./hash":37,"./sha256":42,"buffer":7,"inherits":35}],42:[function(require,module,exports){
8796 (function (Buffer){
8797 /**
8798 * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined
8799 * in FIPS 180-2
8800 * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009.
8801 * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
8802 *
8803 */
8804
8805 var inherits = require('inherits')
8806 var Hash = require('./hash')
8807
8808 var K = [
8809 0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5,
8810 0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5,
8811 0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3,
8812 0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174,
8813 0xE49B69C1, 0xEFBE4786, 0x0FC19DC6, 0x240CA1CC,
8814 0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA,
8815 0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7,
8816 0xC6E00BF3, 0xD5A79147, 0x06CA6351, 0x14292967,
8817 0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13,
8818 0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85,
8819 0xA2BFE8A1, 0xA81A664B, 0xC24B8B70, 0xC76C51A3,
8820 0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070,
8821 0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5,
8822 0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3,
8823 0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208,
8824 0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2
8825 ]
8826
8827 var W = new Array(64)
8828
8829 function Sha256 () {
8830 this.init()
8831
8832 this._w = W // new Array(64)
8833
8834 Hash.call(this, 64, 56)
8835 }
8836
8837 inherits(Sha256, Hash)
8838
8839 Sha256.prototype.init = function () {
8840 this._a = 0x6a09e667 | 0
8841 this._b = 0xbb67ae85 | 0
8842 this._c = 0x3c6ef372 | 0
8843 this._d = 0xa54ff53a | 0
8844 this._e = 0x510e527f | 0
8845 this._f = 0x9b05688c | 0
8846 this._g = 0x1f83d9ab | 0
8847 this._h = 0x5be0cd19 | 0
8848
8849 return this
8850 }
8851
8852 function S (X, n) {
8853 return (X >>> n) | (X << (32 - n))
8854 }
8855
8856 function R (X, n) {
8857 return (X >>> n)
8858 }
8859
8860 function Ch (x, y, z) {
8861 return ((x & y) ^ ((~x) & z))
8862 }
8863
8864 function Maj (x, y, z) {
8865 return ((x & y) ^ (x & z) ^ (y & z))
8866 }
8867
8868 function Sigma0256 (x) {
8869 return (S(x, 2) ^ S(x, 13) ^ S(x, 22))
8870 }
8871
8872 function Sigma1256 (x) {
8873 return (S(x, 6) ^ S(x, 11) ^ S(x, 25))
8874 }
8875
8876 function Gamma0256 (x) {
8877 return (S(x, 7) ^ S(x, 18) ^ R(x, 3))
8878 }
8879
8880 function Gamma1256 (x) {
8881 return (S(x, 17) ^ S(x, 19) ^ R(x, 10))
8882 }
8883
8884 Sha256.prototype._update = function (M) {
8885 var W = this._w
8886
8887 var a = this._a | 0
8888 var b = this._b | 0
8889 var c = this._c | 0
8890 var d = this._d | 0
8891 var e = this._e | 0
8892 var f = this._f | 0
8893 var g = this._g | 0
8894 var h = this._h | 0
8895
8896 var j = 0
8897
8898 function calcW () { return Gamma1256(W[j - 2]) + W[j - 7] + Gamma0256(W[j - 15]) + W[j - 16] }
8899 function loop (w) {
8900 W[j] = w
8901
8902 var T1 = h + Sigma1256(e) + Ch(e, f, g) + K[j] + w
8903 var T2 = Sigma0256(a) + Maj(a, b, c)
8904
8905 h = g
8906 g = f
8907 f = e
8908 e = d + T1
8909 d = c
8910 c = b
8911 b = a
8912 a = T1 + T2
8913
8914 j++
8915 }
8916
8917 while (j < 16) loop(M.readInt32BE(j * 4))
8918 while (j < 64) loop(calcW())
8919
8920 this._a = (a + this._a) | 0
8921 this._b = (b + this._b) | 0
8922 this._c = (c + this._c) | 0
8923 this._d = (d + this._d) | 0
8924 this._e = (e + this._e) | 0
8925 this._f = (f + this._f) | 0
8926 this._g = (g + this._g) | 0
8927 this._h = (h + this._h) | 0
8928 }
8929
8930 Sha256.prototype._hash = function () {
8931 var H = new Buffer(32)
8932
8933 H.writeInt32BE(this._a, 0)
8934 H.writeInt32BE(this._b, 4)
8935 H.writeInt32BE(this._c, 8)
8936 H.writeInt32BE(this._d, 12)
8937 H.writeInt32BE(this._e, 16)
8938 H.writeInt32BE(this._f, 20)
8939 H.writeInt32BE(this._g, 24)
8940 H.writeInt32BE(this._h, 28)
8941
8942 return H
8943 }
8944
8945 module.exports = Sha256
8946
8947 }).call(this,require("buffer").Buffer)
8948 },{"./hash":37,"buffer":7,"inherits":35}],43:[function(require,module,exports){
8949 (function (Buffer){
8950 var inherits = require('inherits')
8951 var SHA512 = require('./sha512')
8952 var Hash = require('./hash')
8953
8954 var W = new Array(160)
8955
8956 function Sha384 () {
8957 this.init()
8958 this._w = W
8959
8960 Hash.call(this, 128, 112)
8961 }
8962
8963 inherits(Sha384, SHA512)
8964
8965 Sha384.prototype.init = function () {
8966 this._a = 0xcbbb9d5d | 0
8967 this._b = 0x629a292a | 0
8968 this._c = 0x9159015a | 0
8969 this._d = 0x152fecd8 | 0
8970 this._e = 0x67332667 | 0
8971 this._f = 0x8eb44a87 | 0
8972 this._g = 0xdb0c2e0d | 0
8973 this._h = 0x47b5481d | 0
8974
8975 this._al = 0xc1059ed8 | 0
8976 this._bl = 0x367cd507 | 0
8977 this._cl = 0x3070dd17 | 0
8978 this._dl = 0xf70e5939 | 0
8979 this._el = 0xffc00b31 | 0
8980 this._fl = 0x68581511 | 0
8981 this._gl = 0x64f98fa7 | 0
8982 this._hl = 0xbefa4fa4 | 0
8983
8984 return this
8985 }
8986
8987 Sha384.prototype._hash = function () {
8988 var H = new Buffer(48)
8989
8990 function writeInt64BE (h, l, offset) {
8991 H.writeInt32BE(h, offset)
8992 H.writeInt32BE(l, offset + 4)
8993 }
8994
8995 writeInt64BE(this._a, this._al, 0)
8996 writeInt64BE(this._b, this._bl, 8)
8997 writeInt64BE(this._c, this._cl, 16)
8998 writeInt64BE(this._d, this._dl, 24)
8999 writeInt64BE(this._e, this._el, 32)
9000 writeInt64BE(this._f, this._fl, 40)
9001
9002 return H
9003 }
9004
9005 module.exports = Sha384
9006
9007 }).call(this,require("buffer").Buffer)
9008 },{"./hash":37,"./sha512":44,"buffer":7,"inherits":35}],44:[function(require,module,exports){
9009 (function (Buffer){
9010 var inherits = require('inherits')
9011 var Hash = require('./hash')
9012
9013 var K = [
9014 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,
9015 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,
9016 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019,
9017 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,
9018 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe,
9019 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,
9020 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1,
9021 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,
9022 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3,
9023 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,
9024 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483,
9025 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,
9026 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210,
9027 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,
9028 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725,
9029 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,
9030 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926,
9031 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,
9032 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8,
9033 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,
9034 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001,
9035 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,
9036 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910,
9037 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,
9038 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53,
9039 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,
9040 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb,
9041 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,
9042 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60,
9043 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,
9044 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9,
9045 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,
9046 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207,
9047 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,
9048 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6,
9049 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,
9050 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493,
9051 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,
9052 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a,
9053 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817
9054 ]
9055
9056 var W = new Array(160)
9057
9058 function Sha512 () {
9059 this.init()
9060 this._w = W
9061
9062 Hash.call(this, 128, 112)
9063 }
9064
9065 inherits(Sha512, Hash)
9066
9067 Sha512.prototype.init = function () {
9068 this._a = 0x6a09e667 | 0
9069 this._b = 0xbb67ae85 | 0
9070 this._c = 0x3c6ef372 | 0
9071 this._d = 0xa54ff53a | 0
9072 this._e = 0x510e527f | 0
9073 this._f = 0x9b05688c | 0
9074 this._g = 0x1f83d9ab | 0
9075 this._h = 0x5be0cd19 | 0
9076
9077 this._al = 0xf3bcc908 | 0
9078 this._bl = 0x84caa73b | 0
9079 this._cl = 0xfe94f82b | 0
9080 this._dl = 0x5f1d36f1 | 0
9081 this._el = 0xade682d1 | 0
9082 this._fl = 0x2b3e6c1f | 0
9083 this._gl = 0xfb41bd6b | 0
9084 this._hl = 0x137e2179 | 0
9085
9086 return this
9087 }
9088
9089 function S (X, Xl, n) {
9090 return (X >>> n) | (Xl << (32 - n))
9091 }
9092
9093 function Ch (x, y, z) {
9094 return ((x & y) ^ ((~x) & z))
9095 }
9096
9097 function Maj (x, y, z) {
9098 return ((x & y) ^ (x & z) ^ (y & z))
9099 }
9100
9101 Sha512.prototype._update = function (M) {
9102 var W = this._w
9103
9104 var a = this._a | 0
9105 var b = this._b | 0
9106 var c = this._c | 0
9107 var d = this._d | 0
9108 var e = this._e | 0
9109 var f = this._f | 0
9110 var g = this._g | 0
9111 var h = this._h | 0
9112
9113 var al = this._al | 0
9114 var bl = this._bl | 0
9115 var cl = this._cl | 0
9116 var dl = this._dl | 0
9117 var el = this._el | 0
9118 var fl = this._fl | 0
9119 var gl = this._gl | 0
9120 var hl = this._hl | 0
9121
9122 var i = 0, j = 0
9123 var Wi, Wil
9124 function calcW () {
9125 var x = W[j - 15 * 2]
9126 var xl = W[j - 15 * 2 + 1]
9127 var gamma0 = S(x, xl, 1) ^ S(x, xl, 8) ^ (x >>> 7)
9128 var gamma0l = S(xl, x, 1) ^ S(xl, x, 8) ^ S(xl, x, 7)
9129
9130 x = W[j - 2 * 2]
9131 xl = W[j - 2 * 2 + 1]
9132 var gamma1 = S(x, xl, 19) ^ S(xl, x, 29) ^ (x >>> 6)
9133 var gamma1l = S(xl, x, 19) ^ S(x, xl, 29) ^ S(xl, x, 6)
9134
9135 // W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]
9136 var Wi7 = W[j - 7 * 2]
9137 var Wi7l = W[j - 7 * 2 + 1]
9138
9139 var Wi16 = W[j - 16 * 2]
9140 var Wi16l = W[j - 16 * 2 + 1]
9141
9142 Wil = gamma0l + Wi7l
9143 Wi = gamma0 + Wi7 + ((Wil >>> 0) < (gamma0l >>> 0) ? 1 : 0)
9144 Wil = Wil + gamma1l
9145 Wi = Wi + gamma1 + ((Wil >>> 0) < (gamma1l >>> 0) ? 1 : 0)
9146 Wil = Wil + Wi16l
9147 Wi = Wi + Wi16 + ((Wil >>> 0) < (Wi16l >>> 0) ? 1 : 0)
9148 }
9149
9150 function loop () {
9151 W[j] = Wi
9152 W[j + 1] = Wil
9153
9154 var maj = Maj(a, b, c)
9155 var majl = Maj(al, bl, cl)
9156
9157 var sigma0h = S(a, al, 28) ^ S(al, a, 2) ^ S(al, a, 7)
9158 var sigma0l = S(al, a, 28) ^ S(a, al, 2) ^ S(a, al, 7)
9159 var sigma1h = S(e, el, 14) ^ S(e, el, 18) ^ S(el, e, 9)
9160 var sigma1l = S(el, e, 14) ^ S(el, e, 18) ^ S(e, el, 9)
9161
9162 // t1 = h + sigma1 + ch + K[i] + W[i]
9163 var Ki = K[j]
9164 var Kil = K[j + 1]
9165
9166 var ch = Ch(e, f, g)
9167 var chl = Ch(el, fl, gl)
9168
9169 var t1l = hl + sigma1l
9170 var t1 = h + sigma1h + ((t1l >>> 0) < (hl >>> 0) ? 1 : 0)
9171 t1l = t1l + chl
9172 t1 = t1 + ch + ((t1l >>> 0) < (chl >>> 0) ? 1 : 0)
9173 t1l = t1l + Kil
9174 t1 = t1 + Ki + ((t1l >>> 0) < (Kil >>> 0) ? 1 : 0)
9175 t1l = t1l + Wil
9176 t1 = t1 + Wi + ((t1l >>> 0) < (Wil >>> 0) ? 1 : 0)
9177
9178 // t2 = sigma0 + maj
9179 var t2l = sigma0l + majl
9180 var t2 = sigma0h + maj + ((t2l >>> 0) < (sigma0l >>> 0) ? 1 : 0)
9181
9182 h = g
9183 hl = gl
9184 g = f
9185 gl = fl
9186 f = e
9187 fl = el
9188 el = (dl + t1l) | 0
9189 e = (d + t1 + ((el >>> 0) < (dl >>> 0) ? 1 : 0)) | 0
9190 d = c
9191 dl = cl
9192 c = b
9193 cl = bl
9194 b = a
9195 bl = al
9196 al = (t1l + t2l) | 0
9197 a = (t1 + t2 + ((al >>> 0) < (t1l >>> 0) ? 1 : 0)) | 0
9198
9199 i++
9200 j += 2
9201 }
9202
9203 while (i < 16) {
9204 Wi = M.readInt32BE(j * 4)
9205 Wil = M.readInt32BE(j * 4 + 4)
9206
9207 loop()
9208 }
9209
9210 while (i < 80) {
9211 calcW()
9212 loop()
9213 }
9214
9215 this._al = (this._al + al) | 0
9216 this._bl = (this._bl + bl) | 0
9217 this._cl = (this._cl + cl) | 0
9218 this._dl = (this._dl + dl) | 0
9219 this._el = (this._el + el) | 0
9220 this._fl = (this._fl + fl) | 0
9221 this._gl = (this._gl + gl) | 0
9222 this._hl = (this._hl + hl) | 0
9223
9224 this._a = (this._a + a + ((this._al >>> 0) < (al >>> 0) ? 1 : 0)) | 0
9225 this._b = (this._b + b + ((this._bl >>> 0) < (bl >>> 0) ? 1 : 0)) | 0
9226 this._c = (this._c + c + ((this._cl >>> 0) < (cl >>> 0) ? 1 : 0)) | 0
9227 this._d = (this._d + d + ((this._dl >>> 0) < (dl >>> 0) ? 1 : 0)) | 0
9228 this._e = (this._e + e + ((this._el >>> 0) < (el >>> 0) ? 1 : 0)) | 0
9229 this._f = (this._f + f + ((this._fl >>> 0) < (fl >>> 0) ? 1 : 0)) | 0
9230 this._g = (this._g + g + ((this._gl >>> 0) < (gl >>> 0) ? 1 : 0)) | 0
9231 this._h = (this._h + h + ((this._hl >>> 0) < (hl >>> 0) ? 1 : 0)) | 0
9232 }
9233
9234 Sha512.prototype._hash = function () {
9235 var H = new Buffer(64)
9236
9237 function writeInt64BE (h, l, offset) {
9238 H.writeInt32BE(h, offset)
9239 H.writeInt32BE(l, offset + 4)
9240 }
9241
9242 writeInt64BE(this._a, this._al, 0)
9243 writeInt64BE(this._b, this._bl, 8)
9244 writeInt64BE(this._c, this._cl, 16)
9245 writeInt64BE(this._d, this._dl, 24)
9246 writeInt64BE(this._e, this._el, 32)
9247 writeInt64BE(this._f, this._fl, 40)
9248 writeInt64BE(this._g, this._gl, 48)
9249 writeInt64BE(this._h, this._hl, 56)
9250
9251 return H
9252 }
9253
9254 module.exports = Sha512
9255
9256 }).call(this,require("buffer").Buffer)
9257 },{"./hash":37,"buffer":7,"inherits":35}],45:[function(require,module,exports){
9258 (function (Buffer){
9259 'use strict';
9260 var createHash = require('create-hash/browser');
9261 var inherits = require('inherits')
9262
9263 var Transform = require('stream').Transform
9264
9265 var ZEROS = new Buffer(128)
9266 ZEROS.fill(0)
9267
9268 function Hmac(alg, key) {
9269 Transform.call(this)
9270
9271 if (typeof key === 'string') {
9272 key = new Buffer(key)
9273 }
9274
9275 var blocksize = (alg === 'sha512' || alg === 'sha384') ? 128 : 64
9276
9277 this._alg = alg
9278 this._key = key
9279
9280 if (key.length > blocksize) {
9281 key = createHash(alg).update(key).digest()
9282
9283 } else if (key.length < blocksize) {
9284 key = Buffer.concat([key, ZEROS], blocksize)
9285 }
9286
9287 var ipad = this._ipad = new Buffer(blocksize)
9288 var opad = this._opad = new Buffer(blocksize)
9289
9290 for (var i = 0; i < blocksize; i++) {
9291 ipad[i] = key[i] ^ 0x36
9292 opad[i] = key[i] ^ 0x5C
9293 }
9294
9295 this._hash = createHash(alg).update(ipad)
9296 }
9297
9298 inherits(Hmac, Transform)
9299
9300 Hmac.prototype.update = function (data, enc) {
9301 this._hash.update(data, enc)
9302
9303 return this
9304 }
9305
9306 Hmac.prototype._transform = function (data, _, next) {
9307 this._hash.update(data)
9308
9309 next()
9310 }
9311
9312 Hmac.prototype._flush = function (next) {
9313 this.push(this.digest())
9314
9315 next()
9316 }
9317
9318 Hmac.prototype.digest = function (enc) {
9319 var h = this._hash.digest()
9320
9321 return createHash(this._alg).update(this._opad).update(h).digest(enc)
9322 }
9323
9324 module.exports = function createHmac(alg, key) {
9325 return new Hmac(alg, key)
9326 }
9327
9328 }).call(this,require("buffer").Buffer)
9329 },{"buffer":7,"create-hash/browser":32,"inherits":46,"stream":26}],46:[function(require,module,exports){
9330 arguments[4][12][0].apply(exports,arguments)
9331 },{"dup":12}],47:[function(require,module,exports){
9332 var assert = require('assert')
9333 var BigInteger = require('bigi')
9334
9335 var Point = require('./point')
9336
9337 function Curve(p, a, b, Gx, Gy, n, h) {
9338 this.p = p
9339 this.a = a
9340 this.b = b
9341 this.G = Point.fromAffine(this, Gx, Gy)
9342 this.n = n
9343 this.h = h
9344
9345 this.infinity = new Point(this, null, null, BigInteger.ZERO)
9346
9347 // result caching
9348 this.pOverFour = p.add(BigInteger.ONE).shiftRight(2)
9349 }
9350
9351 Curve.prototype.pointFromX = function(isOdd, x) {
9352 var alpha = x.pow(3).add(this.a.multiply(x)).add(this.b).mod(this.p)
9353 var beta = alpha.modPow(this.pOverFour, this.p) // XXX: not compatible with all curves
9354
9355 var y = beta
9356 if (beta.isEven() ^ !isOdd) {
9357 y = this.p.subtract(y) // -y % p
9358 }
9359
9360 return Point.fromAffine(this, x, y)
9361 }
9362
9363 Curve.prototype.isInfinity = function(Q) {
9364 if (Q === this.infinity) return true
9365
9366 return Q.z.signum() === 0 && Q.y.signum() !== 0
9367 }
9368
9369 Curve.prototype.isOnCurve = function(Q) {
9370 if (this.isInfinity(Q)) return true
9371
9372 var x = Q.affineX
9373 var y = Q.affineY
9374 var a = this.a
9375 var b = this.b
9376 var p = this.p
9377
9378 // Check that xQ and yQ are integers in the interval [0, p - 1]
9379 if (x.signum() < 0 || x.compareTo(p) >= 0) return false
9380 if (y.signum() < 0 || y.compareTo(p) >= 0) return false
9381
9382 // and check that y^2 = x^3 + ax + b (mod p)
9383 var lhs = y.square().mod(p)
9384 var rhs = x.pow(3).add(a.multiply(x)).add(b).mod(p)
9385 return lhs.equals(rhs)
9386 }
9387
9388 /**
9389 * Validate an elliptic curve point.
9390 *
9391 * See SEC 1, section 3.2.2.1: Elliptic Curve Public Key Validation Primitive
9392 */
9393 Curve.prototype.validate = function(Q) {
9394 // Check Q != O
9395 assert(!this.isInfinity(Q), 'Point is at infinity')
9396 assert(this.isOnCurve(Q), 'Point is not on the curve')
9397
9398 // Check nQ = O (where Q is a scalar multiple of G)
9399 var nQ = Q.multiply(this.n)
9400 assert(this.isInfinity(nQ), 'Point is not a scalar multiple of G')
9401
9402 return true
9403 }
9404
9405 module.exports = Curve
9406
9407 },{"./point":51,"assert":5,"bigi":3}],48:[function(require,module,exports){
9408 module.exports={
9409 "secp128r1": {
9410 "p": "fffffffdffffffffffffffffffffffff",
9411 "a": "fffffffdfffffffffffffffffffffffc",
9412 "b": "e87579c11079f43dd824993c2cee5ed3",
9413 "n": "fffffffe0000000075a30d1b9038a115",
9414 "h": "01",
9415 "Gx": "161ff7528b899b2d0c28607ca52c5b86",
9416 "Gy": "cf5ac8395bafeb13c02da292dded7a83"
9417 },
9418 "secp160k1": {
9419 "p": "fffffffffffffffffffffffffffffffeffffac73",
9420 "a": "00",
9421 "b": "07",
9422 "n": "0100000000000000000001b8fa16dfab9aca16b6b3",
9423 "h": "01",
9424 "Gx": "3b4c382ce37aa192a4019e763036f4f5dd4d7ebb",
9425 "Gy": "938cf935318fdced6bc28286531733c3f03c4fee"
9426 },
9427 "secp160r1": {
9428 "p": "ffffffffffffffffffffffffffffffff7fffffff",
9429 "a": "ffffffffffffffffffffffffffffffff7ffffffc",
9430 "b": "1c97befc54bd7a8b65acf89f81d4d4adc565fa45",
9431 "n": "0100000000000000000001f4c8f927aed3ca752257",
9432 "h": "01",
9433 "Gx": "4a96b5688ef573284664698968c38bb913cbfc82",
9434 "Gy": "23a628553168947d59dcc912042351377ac5fb32"
9435 },
9436 "secp192k1": {
9437 "p": "fffffffffffffffffffffffffffffffffffffffeffffee37",
9438 "a": "00",
9439 "b": "03",
9440 "n": "fffffffffffffffffffffffe26f2fc170f69466a74defd8d",
9441 "h": "01",
9442 "Gx": "db4ff10ec057e9ae26b07d0280b7f4341da5d1b1eae06c7d",
9443 "Gy": "9b2f2f6d9c5628a7844163d015be86344082aa88d95e2f9d"
9444 },
9445 "secp192r1": {
9446 "p": "fffffffffffffffffffffffffffffffeffffffffffffffff",
9447 "a": "fffffffffffffffffffffffffffffffefffffffffffffffc",
9448 "b": "64210519e59c80e70fa7e9ab72243049feb8deecc146b9b1",
9449 "n": "ffffffffffffffffffffffff99def836146bc9b1b4d22831",
9450 "h": "01",
9451 "Gx": "188da80eb03090f67cbf20eb43a18800f4ff0afd82ff1012",
9452 "Gy": "07192b95ffc8da78631011ed6b24cdd573f977a11e794811"
9453 },
9454 "secp256k1": {
9455 "p": "fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f",
9456 "a": "00",
9457 "b": "07",
9458 "n": "fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",
9459 "h": "01",
9460 "Gx": "79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",
9461 "Gy": "483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8"
9462 },
9463 "secp256r1": {
9464 "p": "ffffffff00000001000000000000000000000000ffffffffffffffffffffffff",
9465 "a": "ffffffff00000001000000000000000000000000fffffffffffffffffffffffc",
9466 "b": "5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b",
9467 "n": "ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551",
9468 "h": "01",
9469 "Gx": "6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296",
9470 "Gy": "4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5"
9471 }
9472 }
9473
9474 },{}],49:[function(require,module,exports){
9475 var Point = require('./point')
9476 var Curve = require('./curve')
9477
9478 var getCurveByName = require('./names')
9479
9480 module.exports = {
9481 Curve: Curve,
9482 Point: Point,
9483 getCurveByName: getCurveByName
9484 }
9485
9486 },{"./curve":47,"./names":50,"./point":51}],50:[function(require,module,exports){
9487 var BigInteger = require('bigi')
9488
9489 var curves = require('./curves')
9490 var Curve = require('./curve')
9491
9492 function getCurveByName(name) {
9493 var curve = curves[name]
9494 if (!curve) return null
9495
9496 var p = new BigInteger(curve.p, 16)
9497 var a = new BigInteger(curve.a, 16)
9498 var b = new BigInteger(curve.b, 16)
9499 var n = new BigInteger(curve.n, 16)
9500 var h = new BigInteger(curve.h, 16)
9501 var Gx = new BigInteger(curve.Gx, 16)
9502 var Gy = new BigInteger(curve.Gy, 16)
9503
9504 return new Curve(p, a, b, Gx, Gy, n, h)
9505 }
9506
9507 module.exports = getCurveByName
9508
9509 },{"./curve":47,"./curves":48,"bigi":3}],51:[function(require,module,exports){
9510 (function (Buffer){
9511 var assert = require('assert')
9512 var BigInteger = require('bigi')
9513
9514 var THREE = BigInteger.valueOf(3)
9515
9516 function Point(curve, x, y, z) {
9517 assert.notStrictEqual(z, undefined, 'Missing Z coordinate')
9518
9519 this.curve = curve
9520 this.x = x
9521 this.y = y
9522 this.z = z
9523 this._zInv = null
9524
9525 this.compressed = true
9526 }
9527
9528 Object.defineProperty(Point.prototype, 'zInv', {
9529 get: function() {
9530 if (this._zInv === null) {
9531 this._zInv = this.z.modInverse(this.curve.p)
9532 }
9533
9534 return this._zInv
9535 }
9536 })
9537
9538 Object.defineProperty(Point.prototype, 'affineX', {
9539 get: function() {
9540 return this.x.multiply(this.zInv).mod(this.curve.p)
9541 }
9542 })
9543
9544 Object.defineProperty(Point.prototype, 'affineY', {
9545 get: function() {
9546 return this.y.multiply(this.zInv).mod(this.curve.p)
9547 }
9548 })
9549
9550 Point.fromAffine = function(curve, x, y) {
9551 return new Point(curve, x, y, BigInteger.ONE)
9552 }
9553
9554 Point.prototype.equals = function(other) {
9555 if (other === this) return true
9556 if (this.curve.isInfinity(this)) return this.curve.isInfinity(other)
9557 if (this.curve.isInfinity(other)) return this.curve.isInfinity(this)
9558
9559 // u = Y2 * Z1 - Y1 * Z2
9560 var u = other.y.multiply(this.z).subtract(this.y.multiply(other.z)).mod(this.curve.p)
9561
9562 if (u.signum() !== 0) return false
9563
9564 // v = X2 * Z1 - X1 * Z2
9565 var v = other.x.multiply(this.z).subtract(this.x.multiply(other.z)).mod(this.curve.p)
9566
9567 return v.signum() === 0
9568 }
9569
9570 Point.prototype.negate = function() {
9571 var y = this.curve.p.subtract(this.y)
9572
9573 return new Point(this.curve, this.x, y, this.z)
9574 }
9575
9576 Point.prototype.add = function(b) {
9577 if (this.curve.isInfinity(this)) return b
9578 if (this.curve.isInfinity(b)) return this
9579
9580 var x1 = this.x
9581 var y1 = this.y
9582 var x2 = b.x
9583 var y2 = b.y
9584
9585 // u = Y2 * Z1 - Y1 * Z2
9586 var u = y2.multiply(this.z).subtract(y1.multiply(b.z)).mod(this.curve.p)
9587 // v = X2 * Z1 - X1 * Z2
9588 var v = x2.multiply(this.z).subtract(x1.multiply(b.z)).mod(this.curve.p)
9589
9590 if (v.signum() === 0) {
9591 if (u.signum() === 0) {
9592 return this.twice() // this == b, so double
9593 }
9594
9595 return this.curve.infinity // this = -b, so infinity
9596 }
9597
9598 var v2 = v.square()
9599 var v3 = v2.multiply(v)
9600 var x1v2 = x1.multiply(v2)
9601 var zu2 = u.square().multiply(this.z)
9602
9603 // x3 = v * (z2 * (z1 * u^2 - 2 * x1 * v^2) - v^3)
9604 var x3 = zu2.subtract(x1v2.shiftLeft(1)).multiply(b.z).subtract(v3).multiply(v).mod(this.curve.p)
9605 // y3 = z2 * (3 * x1 * u * v^2 - y1 * v^3 - z1 * u^3) + u * v^3
9606 var y3 = x1v2.multiply(THREE).multiply(u).subtract(y1.multiply(v3)).subtract(zu2.multiply(u)).multiply(b.z).add(u.multiply(v3)).mod(this.curve.p)
9607 // z3 = v^3 * z1 * z2
9608 var z3 = v3.multiply(this.z).multiply(b.z).mod(this.curve.p)
9609
9610 return new Point(this.curve, x3, y3, z3)
9611 }
9612
9613 Point.prototype.twice = function() {
9614 if (this.curve.isInfinity(this)) return this
9615 if (this.y.signum() === 0) return this.curve.infinity
9616
9617 var x1 = this.x
9618 var y1 = this.y
9619
9620 var y1z1 = y1.multiply(this.z)
9621 var y1sqz1 = y1z1.multiply(y1).mod(this.curve.p)
9622 var a = this.curve.a
9623
9624 // w = 3 * x1^2 + a * z1^2
9625 var w = x1.square().multiply(THREE)
9626
9627 if (a.signum() !== 0) {
9628 w = w.add(this.z.square().multiply(a))
9629 }
9630
9631 w = w.mod(this.curve.p)
9632 // x3 = 2 * y1 * z1 * (w^2 - 8 * x1 * y1^2 * z1)
9633 var x3 = w.square().subtract(x1.shiftLeft(3).multiply(y1sqz1)).shiftLeft(1).multiply(y1z1).mod(this.curve.p)
9634 // y3 = 4 * y1^2 * z1 * (3 * w * x1 - 2 * y1^2 * z1) - w^3
9635 var y3 = w.multiply(THREE).multiply(x1).subtract(y1sqz1.shiftLeft(1)).shiftLeft(2).multiply(y1sqz1).subtract(w.pow(3)).mod(this.curve.p)
9636 // z3 = 8 * (y1 * z1)^3
9637 var z3 = y1z1.pow(3).shiftLeft(3).mod(this.curve.p)
9638
9639 return new Point(this.curve, x3, y3, z3)
9640 }
9641
9642 // Simple NAF (Non-Adjacent Form) multiplication algorithm
9643 // TODO: modularize the multiplication algorithm
9644 Point.prototype.multiply = function(k) {
9645 if (this.curve.isInfinity(this)) return this
9646 if (k.signum() === 0) return this.curve.infinity
9647
9648 var e = k
9649 var h = e.multiply(THREE)
9650
9651 var neg = this.negate()
9652 var R = this
9653
9654 for (var i = h.bitLength() - 2; i > 0; --i) {
9655 R = R.twice()
9656
9657 var hBit = h.testBit(i)
9658 var eBit = e.testBit(i)
9659
9660 if (hBit != eBit) {
9661 R = R.add(hBit ? this : neg)
9662 }
9663 }
9664
9665 return R
9666 }
9667
9668 // Compute this*j + x*k (simultaneous multiplication)
9669 Point.prototype.multiplyTwo = function(j, x, k) {
9670 var i
9671
9672 if (j.bitLength() > k.bitLength())
9673 i = j.bitLength() - 1
9674 else
9675 i = k.bitLength() - 1
9676
9677 var R = this.curve.infinity
9678 var both = this.add(x)
9679
9680 while (i >= 0) {
9681 R = R.twice()
9682
9683 var jBit = j.testBit(i)
9684 var kBit = k.testBit(i)
9685
9686 if (jBit) {
9687 if (kBit) {
9688 R = R.add(both)
9689
9690 } else {
9691 R = R.add(this)
9692 }
9693
9694 } else {
9695 if (kBit) {
9696 R = R.add(x)
9697 }
9698 }
9699 --i
9700 }
9701
9702 return R
9703 }
9704
9705 Point.prototype.getEncoded = function(compressed) {
9706 if (compressed == undefined) compressed = this.compressed
9707 if (this.curve.isInfinity(this)) return new Buffer('00', 'hex') // Infinity point encoded is simply '00'
9708
9709 var x = this.affineX
9710 var y = this.affineY
9711
9712 var buffer
9713
9714 // Determine size of q in bytes
9715 var byteLength = Math.floor((this.curve.p.bitLength() + 7) / 8)
9716
9717 // 0x02/0x03 | X
9718 if (compressed) {
9719 buffer = new Buffer(1 + byteLength)
9720 buffer.writeUInt8(y.isEven() ? 0x02 : 0x03, 0)
9721
9722 // 0x04 | X | Y
9723 } else {
9724 buffer = new Buffer(1 + byteLength + byteLength)
9725 buffer.writeUInt8(0x04, 0)
9726
9727 y.toBuffer(byteLength).copy(buffer, 1 + byteLength)
9728 }
9729
9730 x.toBuffer(byteLength).copy(buffer, 1)
9731
9732 return buffer
9733 }
9734
9735 Point.decodeFrom = function(curve, buffer) {
9736 var type = buffer.readUInt8(0)
9737 var compressed = (type !== 4)
9738
9739 var byteLength = Math.floor((curve.p.bitLength() + 7) / 8)
9740 var x = BigInteger.fromBuffer(buffer.slice(1, 1 + byteLength))
9741
9742 var Q
9743 if (compressed) {
9744 assert.equal(buffer.length, byteLength + 1, 'Invalid sequence length')
9745 assert(type === 0x02 || type === 0x03, 'Invalid sequence tag')
9746
9747 var isOdd = (type === 0x03)
9748 Q = curve.pointFromX(isOdd, x)
9749
9750 } else {
9751 assert.equal(buffer.length, 1 + byteLength + byteLength, 'Invalid sequence length')
9752
9753 var y = BigInteger.fromBuffer(buffer.slice(1 + byteLength))
9754 Q = Point.fromAffine(curve, x, y)
9755 }
9756
9757 Q.compressed = compressed
9758 return Q
9759 }
9760
9761 Point.prototype.toString = function () {
9762 if (this.curve.isInfinity(this)) return '(INFINITY)'
9763
9764 return '(' + this.affineX.toString() + ',' + this.affineY.toString() + ')'
9765 }
9766
9767 module.exports = Point
9768
9769 }).call(this,require("buffer").Buffer)
9770 },{"assert":5,"bigi":3,"buffer":7}],52:[function(require,module,exports){
9771 (function (process,global,Buffer){
9772 'use strict';
9773
9774 var crypto = global.crypto || global.msCrypto
9775 if(crypto && crypto.getRandomValues) {
9776 module.exports = randomBytes;
9777 } else {
9778 module.exports = oldBrowser;
9779 }
9780 function randomBytes(size, cb) {
9781 var bytes = new Buffer(size); //in browserify, this is an extended Uint8Array
9782 /* This will not work in older browsers.
9783 * See https://developer.mozilla.org/en-US/docs/Web/API/window.crypto.getRandomValues
9784 */
9785
9786 crypto.getRandomValues(bytes);
9787 if (typeof cb === 'function') {
9788 return process.nextTick(function () {
9789 cb(null, bytes);
9790 });
9791 }
9792 return bytes;
9793 }
9794 function oldBrowser() {
9795 throw new Error(
9796 'secure random number generation not supported by this browser\n'+
9797 'use chrome, FireFox or Internet Explorer 11'
9798 )
9799 }
9800
9801 }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("buffer").Buffer)
9802 },{"_process":14,"buffer":7}],53:[function(require,module,exports){
9803 (function (Buffer){
9804 'use strict';
9805
9806 function getFunctionName(fn) {
9807 return fn.name || fn.toString().match(/function (.*?)\s*\(/)[1];
9808 }
9809
9810 function getTypeTypeName(type) {
9811 if (nativeTypes.Function(type)) {
9812 type = type.toJSON ? type.toJSON() : getFunctionName(type);
9813 }
9814 if (nativeTypes.Object(type)) return JSON.stringify(type);
9815
9816 return type;
9817 }
9818
9819 function getValueTypeName(value) {
9820 if (nativeTypes.Null(value)) return '';
9821
9822 return getFunctionName(value.constructor);
9823 }
9824
9825 function tfErrorString(type, value) {
9826 var typeTypeName = getTypeTypeName(type);
9827 var valueTypeName = getValueTypeName(value);
9828
9829 return 'Expected ' + typeTypeName + ', got ' + (valueTypeName && valueTypeName + ' ') + JSON.stringify(value);
9830 }
9831
9832 function tfPropertyErrorString(type, name, value) {
9833 return tfErrorString('property \"' + name + '\" of type ' + getTypeTypeName(type), value);
9834 }
9835
9836 var nativeTypes = {
9837 Array: (function (_Array) {
9838 function Array(_x) {
9839 return _Array.apply(this, arguments);
9840 }
9841
9842 Array.toString = function () {
9843 return _Array.toString();
9844 };
9845
9846 return Array;
9847 })(function (value) {
9848 return value !== null && value !== undefined && value.constructor === Array;
9849 }),
9850 Boolean: function Boolean(value) {
9851 return typeof value === 'boolean';
9852 },
9853 Buffer: (function (_Buffer) {
9854 function Buffer(_x2) {
9855 return _Buffer.apply(this, arguments);
9856 }
9857
9858 Buffer.toString = function () {
9859 return _Buffer.toString();
9860 };
9861
9862 return Buffer;
9863 })(function (value) {
9864 return Buffer.isBuffer(value);
9865 }),
9866 Function: function Function(value) {
9867 return typeof value === 'function';
9868 },
9869 Null: function Null(value) {
9870 return value === undefined || value === null;
9871 },
9872 Number: function Number(value) {
9873 return typeof value === 'number';
9874 },
9875 Object: function Object(value) {
9876 return typeof value === 'object';
9877 },
9878 String: function String(value) {
9879 return typeof value === 'string';
9880 },
9881 '': function _() {
9882 return true;
9883 }
9884 };
9885
9886 function tJSON(type) {
9887 return type && type.toJSON ? type.toJSON() : type;
9888 }
9889
9890 function sJSON(type) {
9891 var json = tJSON(type);
9892 return nativeTypes.Object(json) ? JSON.stringify(json) : json;
9893 }
9894
9895 var otherTypes = {
9896 arrayOf: function arrayOf(type) {
9897 function arrayOf(value, strict) {
9898 try {
9899 return nativeTypes.Array(value) && value.every(function (x) {
9900 return typeforce(type, x, strict);
9901 });
9902 } catch (e) {
9903 return false;
9904 }
9905 }
9906 arrayOf.toJSON = function () {
9907 return [tJSON(type)];
9908 };
9909
9910 return arrayOf;
9911 },
9912
9913 maybe: function maybe(type) {
9914 function maybe(value, strict) {
9915 return nativeTypes.Null(value) || typeforce(type, value, strict);
9916 }
9917 maybe.toJSON = function () {
9918 return '?' + sJSON(type);
9919 };
9920
9921 return maybe;
9922 },
9923
9924 object: function object(type) {
9925 function object(value, strict) {
9926 typeforce(nativeTypes.Object, value, strict);
9927
9928 var propertyName, propertyType, propertyValue;
9929
9930 try {
9931 for (propertyName in type) {
9932 propertyType = type[propertyName];
9933 propertyValue = value[propertyName];
9934
9935 typeforce(propertyType, propertyValue, strict);
9936 }
9937 } catch (e) {
9938 throw new TypeError(tfPropertyErrorString(propertyType, propertyName, propertyValue));
9939 }
9940
9941 if (strict) {
9942 for (propertyName in value) {
9943 if (type[propertyName]) continue;
9944
9945 throw new TypeError('Unexpected property "' + propertyName + '"');
9946 }
9947 }
9948
9949 return true;
9950 }
9951 object.toJSON = function () {
9952 return type;
9953 };
9954
9955 return object;
9956 },
9957
9958 oneOf: function oneOf() {
9959 for (var _len = arguments.length, types = Array(_len), _key = 0; _key < _len; _key++) {
9960 types[_key] = arguments[_key];
9961 }
9962
9963 function oneOf(value, strict) {
9964 return types.some(function (type) {
9965 try {
9966 return typeforce(type, value, strict);
9967 } catch (e) {
9968 return false;
9969 }
9970 });
9971 }
9972 oneOf.toJSON = function () {
9973 return types.map(sJSON).join('|');
9974 };
9975
9976 return oneOf;
9977 },
9978
9979 quacksLike: function quacksLike(type) {
9980 function quacksLike(value, strict) {
9981 return type === getValueTypeName(value);
9982 }
9983 quacksLike.toJSON = function () {
9984 return type;
9985 };
9986
9987 return quacksLike;
9988 },
9989
9990 tuple: function tuple() {
9991 for (var _len2 = arguments.length, types = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
9992 types[_key2] = arguments[_key2];
9993 }
9994
9995 function tuple(value, strict) {
9996 return types.every(function (type, i) {
9997 return typeforce(type, value[i], strict);
9998 });
9999 }
10000 tuple.toJSON = function () {
10001 return '(' + types.map(sJSON).join(', ') + ')';
10002 };
10003
10004 return tuple;
10005 },
10006
10007 value: function value(expected) {
10008 function value(actual) {
10009 return actual === expected;
10010 }
10011 value.toJSON = function () {
10012 return expected;
10013 };
10014
10015 return value;
10016 }
10017 };
10018
10019 function compile(type) {
10020 if (nativeTypes.String(type)) {
10021 if (type[0] === '?') return otherTypes.maybe(compile(type.slice(1)));
10022
10023 return nativeTypes[type] || otherTypes.quacksLike(type);
10024 } else if (type && nativeTypes.Object(type)) {
10025 if (nativeTypes.Array(type)) return otherTypes.arrayOf(compile(type[0]));
10026
10027 var compiled = {};
10028
10029 for (var propertyName in type) {
10030 compiled[propertyName] = compile(type[propertyName]);
10031 }
10032
10033 return otherTypes.object(compiled);
10034 } else if (nativeTypes.Function(type)) {
10035 return type;
10036 }
10037
10038 return otherTypes.value(type);
10039 }
10040
10041 function typeforce(_x3, _x4, _x5) {
10042 var _again = true;
10043
10044 _function: while (_again) {
10045 var type = _x3,
10046 value = _x4,
10047 strict = _x5;
10048 _again = false;
10049
10050 if (nativeTypes.Function(type)) {
10051 if (type(value, strict)) return true;
10052
10053 throw new TypeError(tfErrorString(type, value));
10054 }
10055
10056 // JIT
10057 _x3 = compile(type);
10058 _x4 = value;
10059 _x5 = strict;
10060 _again = true;
10061 continue _function;
10062 }
10063 }
10064
10065 // assign all types to typeforce function
10066 var typeName;
10067 Object.keys(nativeTypes).forEach(function (typeName) {
10068 var nativeType = nativeTypes[typeName];
10069 nativeType.toJSON = function () {
10070 return typeName;
10071 };
10072
10073 typeforce[typeName] = nativeType;
10074 });
10075
10076 for (typeName in otherTypes) {
10077 typeforce[typeName] = otherTypes[typeName];
10078 }
10079
10080 module.exports = typeforce;
10081 module.exports.compile = compile;
10082 }).call(this,require("buffer").Buffer)
10083 },{"buffer":7}],54:[function(require,module,exports){
10084 (function (Buffer){
10085 var assert = require('assert')
10086 var base58check = require('bs58check')
10087 var typeForce = require('typeforce')
10088 var networks = require('./networks')
10089 var scripts = require('./scripts')
10090
10091 function findScriptTypeByVersion (version) {
10092 for (var networkName in networks) {
10093 var network = networks[networkName]
10094
10095 if (version === network.pubKeyHash) return 'pubkeyhash'
10096 if (version === network.scriptHash) return 'scripthash'
10097 }
10098 }
10099
10100 function Address (hash, version) {
10101 typeForce('Buffer', hash)
10102
10103 assert.strictEqual(hash.length, 20, 'Invalid hash length')
10104 assert.strictEqual(version & 0xff, version, 'Invalid version byte')
10105
10106 this.hash = hash
10107 this.version = version
10108 }
10109
10110 Address.fromBase58Check = function (string) {
10111 var payload = base58check.decode(string)
10112 var version = payload.readUInt8(0)
10113 var hash = payload.slice(1)
10114
10115 return new Address(hash, version)
10116 }
10117
10118 Address.fromOutputScript = function (script, network) {
10119 network = network || networks.bitcoin
10120
10121 if (scripts.isPubKeyHashOutput(script)) return new Address(script.chunks[2], network.pubKeyHash)
10122 if (scripts.isScriptHashOutput(script)) return new Address(script.chunks[1], network.scriptHash)
10123
10124 assert(false, script.toASM() + ' has no matching Address')
10125 }
10126
10127 Address.prototype.toBase58Check = function () {
10128 var payload = new Buffer(21)
10129 payload.writeUInt8(this.version, 0)
10130 this.hash.copy(payload, 1)
10131
10132 return base58check.encode(payload)
10133 }
10134
10135 Address.prototype.toOutputScript = function () {
10136 var scriptType = findScriptTypeByVersion(this.version)
10137
10138 if (scriptType === 'pubkeyhash') return scripts.pubKeyHashOutput(this.hash)
10139 if (scriptType === 'scripthash') return scripts.scriptHashOutput(this.hash)
10140
10141 assert(false, this.toString() + ' has no matching Script')
10142 }
10143
10144 Address.prototype.toString = Address.prototype.toBase58Check
10145
10146 module.exports = Address
10147
10148 }).call(this,require("buffer").Buffer)
10149 },{"./networks":66,"./scripts":69,"assert":5,"bs58check":31,"buffer":7,"typeforce":53}],55:[function(require,module,exports){
10150 var bs58check = require('bs58check')
10151
10152 function decode () {
10153 console.warn('bs58check will be removed in 2.0.0. require("bs58check") instead.')
10154
10155 return bs58check.decode.apply(undefined, arguments)
10156 }
10157
10158 function encode () {
10159 console.warn('bs58check will be removed in 2.0.0. require("bs58check") instead.')
10160
10161 return bs58check.encode.apply(undefined, arguments)
10162 }
10163
10164 module.exports = {
10165 decode: decode,
10166 encode: encode
10167 }
10168
10169 },{"bs58check":31}],56:[function(require,module,exports){
10170 (function (Buffer){
10171 var assert = require('assert')
10172 var bufferutils = require('./bufferutils')
10173 var crypto = require('./crypto')
10174
10175 var Transaction = require('./transaction')
10176
10177 function Block () {
10178 this.version = 1
10179 this.prevHash = null
10180 this.merkleRoot = null
10181 this.timestamp = 0
10182 this.bits = 0
10183 this.nonce = 0
10184 }
10185
10186 Block.fromBuffer = function (buffer) {
10187 assert(buffer.length >= 80, 'Buffer too small (< 80 bytes)')
10188
10189 var offset = 0
10190 function readSlice (n) {
10191 offset += n
10192 return buffer.slice(offset - n, offset)
10193 }
10194
10195 function readUInt32 () {
10196 var i = buffer.readUInt32LE(offset)
10197 offset += 4
10198 return i
10199 }
10200
10201 var block = new Block()
10202 block.version = readUInt32()
10203 block.prevHash = readSlice(32)
10204 block.merkleRoot = readSlice(32)
10205 block.timestamp = readUInt32()
10206 block.bits = readUInt32()
10207 block.nonce = readUInt32()
10208
10209 if (buffer.length === 80) return block
10210
10211 function readVarInt () {
10212 var vi = bufferutils.readVarInt(buffer, offset)
10213 offset += vi.size
10214 return vi.number
10215 }
10216
10217 // FIXME: poor performance
10218 function readTransaction () {
10219 var tx = Transaction.fromBuffer(buffer.slice(offset), true)
10220
10221 offset += tx.toBuffer().length
10222 return tx
10223 }
10224
10225 var nTransactions = readVarInt()
10226 block.transactions = []
10227
10228 for (var i = 0; i < nTransactions; ++i) {
10229 var tx = readTransaction()
10230 block.transactions.push(tx)
10231 }
10232
10233 return block
10234 }
10235
10236 Block.fromHex = function (hex) {
10237 return Block.fromBuffer(new Buffer(hex, 'hex'))
10238 }
10239
10240 Block.prototype.getHash = function () {
10241 return crypto.hash256(this.toBuffer(true))
10242 }
10243
10244 Block.prototype.getId = function () {
10245 return bufferutils.reverse(this.getHash()).toString('hex')
10246 }
10247
10248 Block.prototype.getUTCDate = function () {
10249 var date = new Date(0) // epoch
10250 date.setUTCSeconds(this.timestamp)
10251
10252 return date
10253 }
10254
10255 Block.prototype.toBuffer = function (headersOnly) {
10256 var buffer = new Buffer(80)
10257
10258 var offset = 0
10259 function writeSlice (slice) {
10260 slice.copy(buffer, offset)
10261 offset += slice.length
10262 }
10263
10264 function writeUInt32 (i) {
10265 buffer.writeUInt32LE(i, offset)
10266 offset += 4
10267 }
10268
10269 writeUInt32(this.version)
10270 writeSlice(this.prevHash)
10271 writeSlice(this.merkleRoot)
10272 writeUInt32(this.timestamp)
10273 writeUInt32(this.bits)
10274 writeUInt32(this.nonce)
10275
10276 if (headersOnly || !this.transactions) return buffer
10277
10278 var txLenBuffer = bufferutils.varIntBuffer(this.transactions.length)
10279 var txBuffers = this.transactions.map(function (tx) {
10280 return tx.toBuffer()
10281 })
10282
10283 return Buffer.concat([buffer, txLenBuffer].concat(txBuffers))
10284 }
10285
10286 Block.prototype.toHex = function (headersOnly) {
10287 return this.toBuffer(headersOnly).toString('hex')
10288 }
10289
10290 module.exports = Block
10291
10292 }).call(this,require("buffer").Buffer)
10293 },{"./bufferutils":57,"./crypto":58,"./transaction":70,"assert":5,"buffer":7}],57:[function(require,module,exports){
10294 (function (Buffer){
10295 var assert = require('assert')
10296 var opcodes = require('./opcodes')
10297
10298 // https://github.com/feross/buffer/blob/master/index.js#L1127
10299 function verifuint (value, max) {
10300 assert(typeof value === 'number', 'cannot write a non-number as a number')
10301 assert(value >= 0, 'specified a negative value for writing an unsigned value')
10302 assert(value <= max, 'value is larger than maximum value for type')
10303 assert(Math.floor(value) === value, 'value has a fractional component')
10304 }
10305
10306 function pushDataSize (i) {
10307 return i < opcodes.OP_PUSHDATA1 ? 1
10308 : i < 0xff ? 2
10309 : i < 0xffff ? 3
10310 : 5
10311 }
10312
10313 function readPushDataInt (buffer, offset) {
10314 var opcode = buffer.readUInt8(offset)
10315 var number, size
10316
10317 // ~6 bit
10318 if (opcode < opcodes.OP_PUSHDATA1) {
10319 number = opcode
10320 size = 1
10321
10322 // 8 bit
10323 } else if (opcode === opcodes.OP_PUSHDATA1) {
10324 if (offset + 2 > buffer.length) return null
10325 number = buffer.readUInt8(offset + 1)
10326 size = 2
10327
10328 // 16 bit
10329 } else if (opcode === opcodes.OP_PUSHDATA2) {
10330 if (offset + 3 > buffer.length) return null
10331 number = buffer.readUInt16LE(offset + 1)
10332 size = 3
10333
10334 // 32 bit
10335 } else {
10336 if (offset + 5 > buffer.length) return null
10337 assert.equal(opcode, opcodes.OP_PUSHDATA4, 'Unexpected opcode')
10338
10339 number = buffer.readUInt32LE(offset + 1)
10340 size = 5
10341 }
10342
10343 return {
10344 opcode: opcode,
10345 number: number,
10346 size: size
10347 }
10348 }
10349
10350 function readUInt64LE (buffer, offset) {
10351 var a = buffer.readUInt32LE(offset)
10352 var b = buffer.readUInt32LE(offset + 4)
10353 b *= 0x100000000
10354
10355 verifuint(b + a, 0x001fffffffffffff)
10356
10357 return b + a
10358 }
10359
10360 function readVarInt (buffer, offset) {
10361 var t = buffer.readUInt8(offset)
10362 var number, size
10363
10364 // 8 bit
10365 if (t < 253) {
10366 number = t
10367 size = 1
10368
10369 // 16 bit
10370 } else if (t < 254) {
10371 number = buffer.readUInt16LE(offset + 1)
10372 size = 3
10373
10374 // 32 bit
10375 } else if (t < 255) {
10376 number = buffer.readUInt32LE(offset + 1)
10377 size = 5
10378
10379 // 64 bit
10380 } else {
10381 number = readUInt64LE(buffer, offset + 1)
10382 size = 9
10383 }
10384
10385 return {
10386 number: number,
10387 size: size
10388 }
10389 }
10390
10391 function writePushDataInt (buffer, number, offset) {
10392 var size = pushDataSize(number)
10393
10394 // ~6 bit
10395 if (size === 1) {
10396 buffer.writeUInt8(number, offset)
10397
10398 // 8 bit
10399 } else if (size === 2) {
10400 buffer.writeUInt8(opcodes.OP_PUSHDATA1, offset)
10401 buffer.writeUInt8(number, offset + 1)
10402
10403 // 16 bit
10404 } else if (size === 3) {
10405 buffer.writeUInt8(opcodes.OP_PUSHDATA2, offset)
10406 buffer.writeUInt16LE(number, offset + 1)
10407
10408 // 32 bit
10409 } else {
10410 buffer.writeUInt8(opcodes.OP_PUSHDATA4, offset)
10411 buffer.writeUInt32LE(number, offset + 1)
10412 }
10413
10414 return size
10415 }
10416
10417 function writeUInt64LE (buffer, value, offset) {
10418 verifuint(value, 0x001fffffffffffff)
10419
10420 buffer.writeInt32LE(value & -1, offset)
10421 buffer.writeUInt32LE(Math.floor(value / 0x100000000), offset + 4)
10422 }
10423
10424 function varIntSize (i) {
10425 return i < 253 ? 1
10426 : i < 0x10000 ? 3
10427 : i < 0x100000000 ? 5
10428 : 9
10429 }
10430
10431 function writeVarInt (buffer, number, offset) {
10432 var size = varIntSize(number)
10433
10434 // 8 bit
10435 if (size === 1) {
10436 buffer.writeUInt8(number, offset)
10437
10438 // 16 bit
10439 } else if (size === 3) {
10440 buffer.writeUInt8(253, offset)
10441 buffer.writeUInt16LE(number, offset + 1)
10442
10443 // 32 bit
10444 } else if (size === 5) {
10445 buffer.writeUInt8(254, offset)
10446 buffer.writeUInt32LE(number, offset + 1)
10447
10448 // 64 bit
10449 } else {
10450 buffer.writeUInt8(255, offset)
10451 writeUInt64LE(buffer, number, offset + 1)
10452 }
10453
10454 return size
10455 }
10456
10457 function varIntBuffer (i) {
10458 var size = varIntSize(i)
10459 var buffer = new Buffer(size)
10460 writeVarInt(buffer, i, 0)
10461
10462 return buffer
10463 }
10464
10465 function reverse (buffer) {
10466 var buffer2 = new Buffer(buffer)
10467 Array.prototype.reverse.call(buffer2)
10468 return buffer2
10469 }
10470
10471 module.exports = {
10472 pushDataSize: pushDataSize,
10473 readPushDataInt: readPushDataInt,
10474 readUInt64LE: readUInt64LE,
10475 readVarInt: readVarInt,
10476 reverse: reverse,
10477 varIntBuffer: varIntBuffer,
10478 varIntSize: varIntSize,
10479 writePushDataInt: writePushDataInt,
10480 writeUInt64LE: writeUInt64LE,
10481 writeVarInt: writeVarInt
10482 }
10483
10484 }).call(this,require("buffer").Buffer)
10485 },{"./opcodes":67,"assert":5,"buffer":7}],58:[function(require,module,exports){
10486 var createHash = require('create-hash')
10487
10488 function hash160 (buffer) {
10489 return ripemd160(sha256(buffer))
10490 }
10491
10492 function hash256 (buffer) {
10493 return sha256(sha256(buffer))
10494 }
10495
10496 function ripemd160 (buffer) {
10497 return createHash('rmd160').update(buffer).digest()
10498 }
10499
10500 function sha1 (buffer) {
10501 return createHash('sha1').update(buffer).digest()
10502 }
10503
10504 function sha256 (buffer) {
10505 return createHash('sha256').update(buffer).digest()
10506 }
10507
10508 // FIXME: Name not consistent with others
10509 var createHmac = require('create-hmac')
10510
10511 function HmacSHA256 (buffer, secret) {
10512 console.warn('Hmac* functions are deprecated for removal in 2.0.0, use node crypto instead')
10513 return createHmac('sha256', secret).update(buffer).digest()
10514 }
10515
10516 function HmacSHA512 (buffer, secret) {
10517 console.warn('Hmac* functions are deprecated for removal in 2.0.0, use node crypto instead')
10518 return createHmac('sha512', secret).update(buffer).digest()
10519 }
10520
10521 module.exports = {
10522 ripemd160: ripemd160,
10523 sha1: sha1,
10524 sha256: sha256,
10525 hash160: hash160,
10526 hash256: hash256,
10527 HmacSHA256: HmacSHA256,
10528 HmacSHA512: HmacSHA512
10529 }
10530
10531 },{"create-hash":32,"create-hmac":45}],59:[function(require,module,exports){
10532 (function (Buffer){
10533 var assert = require('assert')
10534 var createHmac = require('create-hmac')
10535 var typeForce = require('typeforce')
10536
10537 var BigInteger = require('bigi')
10538 var ECSignature = require('./ecsignature')
10539
10540 var ZERO = new Buffer([0])
10541 var ONE = new Buffer([1])
10542
10543 // https://tools.ietf.org/html/rfc6979#section-3.2
10544 function deterministicGenerateK (curve, hash, d, checkSig) {
10545 typeForce('Buffer', hash)
10546 typeForce('BigInteger', d)
10547
10548 // FIXME: remove/uncomment for 2.0.0
10549 // typeForce('Function', checkSig)
10550
10551 if (typeof checkSig !== 'function') {
10552 console.warn('deterministicGenerateK requires a checkSig callback in 2.0.0, see #337 for more information')
10553
10554 checkSig = function (k) {
10555 var G = curve.G
10556 var n = curve.n
10557 var e = BigInteger.fromBuffer(hash)
10558
10559 var Q = G.multiply(k)
10560
10561 if (curve.isInfinity(Q))
10562 return false
10563
10564 var r = Q.affineX.mod(n)
10565 if (r.signum() === 0)
10566 return false
10567
10568 var s = k.modInverse(n).multiply(e.add(d.multiply(r))).mod(n)
10569 if (s.signum() === 0)
10570 return false
10571
10572 return true
10573 }
10574 }
10575
10576 // sanity check
10577 assert.equal(hash.length, 32, 'Hash must be 256 bit')
10578
10579 var x = d.toBuffer(32)
10580 var k = new Buffer(32)
10581 var v = new Buffer(32)
10582
10583 // Step A, ignored as hash already provided
10584 // Step B
10585 v.fill(1)
10586
10587 // Step C
10588 k.fill(0)
10589
10590 // Step D
10591 k = createHmac('sha256', k)
10592 .update(v)
10593 .update(ZERO)
10594 .update(x)
10595 .update(hash)
10596 .digest()
10597
10598 // Step E
10599 v = createHmac('sha256', k).update(v).digest()
10600
10601 // Step F
10602 k = createHmac('sha256', k)
10603 .update(v)
10604 .update(ONE)
10605 .update(x)
10606 .update(hash)
10607 .digest()
10608
10609 // Step G
10610 v = createHmac('sha256', k).update(v).digest()
10611
10612 // Step H1/H2a, ignored as tlen === qlen (256 bit)
10613 // Step H2b
10614 v = createHmac('sha256', k).update(v).digest()
10615
10616 var T = BigInteger.fromBuffer(v)
10617
10618 // Step H3, repeat until T is within the interval [1, n - 1] and is suitable for ECDSA
10619 while ((T.signum() <= 0) || (T.compareTo(curve.n) >= 0) || !checkSig(T)) {
10620 k = createHmac('sha256', k)
10621 .update(v)
10622 .update(ZERO)
10623 .digest()
10624
10625 v = createHmac('sha256', k).update(v).digest()
10626
10627 // Step H1/H2a, again, ignored as tlen === qlen (256 bit)
10628 // Step H2b again
10629 v = createHmac('sha256', k).update(v).digest()
10630 T = BigInteger.fromBuffer(v)
10631 }
10632
10633 return T
10634 }
10635
10636 function sign (curve, hash, d) {
10637 var r, s
10638
10639 var e = BigInteger.fromBuffer(hash)
10640 var n = curve.n
10641 var G = curve.G
10642
10643 deterministicGenerateK(curve, hash, d, function (k) {
10644 var Q = G.multiply(k)
10645
10646 if (curve.isInfinity(Q))
10647 return false
10648
10649 r = Q.affineX.mod(n)
10650 if (r.signum() === 0)
10651 return false
10652
10653 s = k.modInverse(n).multiply(e.add(d.multiply(r))).mod(n)
10654 if (s.signum() === 0)
10655 return false
10656
10657 return true
10658 })
10659
10660 var N_OVER_TWO = n.shiftRight(1)
10661
10662 // enforce low S values, see bip62: 'low s values in signatures'
10663 if (s.compareTo(N_OVER_TWO) > 0) {
10664 s = n.subtract(s)
10665 }
10666
10667 return new ECSignature(r, s)
10668 }
10669
10670 function verifyRaw (curve, e, signature, Q) {
10671 var n = curve.n
10672 var G = curve.G
10673
10674 var r = signature.r
10675 var s = signature.s
10676
10677 // 1.4.1 Enforce r and s are both integers in the interval [1, n − 1]
10678 if (r.signum() <= 0 || r.compareTo(n) >= 0) return false
10679 if (s.signum() <= 0 || s.compareTo(n) >= 0) return false
10680
10681 // c = s^-1 mod n
10682 var c = s.modInverse(n)
10683
10684 // 1.4.4 Compute u1 = es^−1 mod n
10685 // u2 = rs^−1 mod n
10686 var u1 = e.multiply(c).mod(n)
10687 var u2 = r.multiply(c).mod(n)
10688
10689 // 1.4.5 Compute R = (xR, yR) = u1G + u2Q
10690 var R = G.multiplyTwo(u1, Q, u2)
10691 var v = R.affineX.mod(n)
10692
10693 // 1.4.5 (cont.) Enforce R is not at infinity
10694 if (curve.isInfinity(R)) return false
10695
10696 // 1.4.8 If v = r, output "valid", and if v != r, output "invalid"
10697 return v.equals(r)
10698 }
10699
10700 function verify (curve, hash, signature, Q) {
10701 // 1.4.2 H = Hash(M), already done by the user
10702 // 1.4.3 e = H
10703 var e = BigInteger.fromBuffer(hash)
10704
10705 return verifyRaw(curve, e, signature, Q)
10706 }
10707
10708 /**
10709 * Recover a public key from a signature.
10710 *
10711 * See SEC 1: Elliptic Curve Cryptography, section 4.1.6, "Public
10712 * Key Recovery Operation".
10713 *
10714 * http://www.secg.org/download/aid-780/sec1-v2.pdf
10715 */
10716 function recoverPubKey (curve, e, signature, i) {
10717 assert.strictEqual(i & 3, i, 'Recovery param is more than two bits')
10718
10719 var n = curve.n
10720 var G = curve.G
10721
10722 var r = signature.r
10723 var s = signature.s
10724
10725 assert(r.signum() > 0 && r.compareTo(n) < 0, 'Invalid r value')
10726 assert(s.signum() > 0 && s.compareTo(n) < 0, 'Invalid s value')
10727
10728 // A set LSB signifies that the y-coordinate is odd
10729 var isYOdd = i & 1
10730
10731 // The more significant bit specifies whether we should use the
10732 // first or second candidate key.
10733 var isSecondKey = i >> 1
10734
10735 // 1.1 Let x = r + jn
10736 var x = isSecondKey ? r.add(n) : r
10737 var R = curve.pointFromX(isYOdd, x)
10738
10739 // 1.4 Check that nR is at infinity
10740 var nR = R.multiply(n)
10741 assert(curve.isInfinity(nR), 'nR is not a valid curve point')
10742
10743 // Compute -e from e
10744 var eNeg = e.negate().mod(n)
10745
10746 // 1.6.1 Compute Q = r^-1 (sR - eG)
10747 // Q = r^-1 (sR + -eG)
10748 var rInv = r.modInverse(n)
10749
10750 var Q = R.multiplyTwo(s, G, eNeg).multiply(rInv)
10751 curve.validate(Q)
10752
10753 return Q
10754 }
10755
10756 /**
10757 * Calculate pubkey extraction parameter.
10758 *
10759 * When extracting a pubkey from a signature, we have to
10760 * distinguish four different cases. Rather than putting this
10761 * burden on the verifier, Bitcoin includes a 2-bit value with the
10762 * signature.
10763 *
10764 * This function simply tries all four cases and returns the value
10765 * that resulted in a successful pubkey recovery.
10766 */
10767 function calcPubKeyRecoveryParam (curve, e, signature, Q) {
10768 for (var i = 0; i < 4; i++) {
10769 var Qprime = recoverPubKey(curve, e, signature, i)
10770
10771 // 1.6.2 Verify Q
10772 if (Qprime.equals(Q)) {
10773 return i
10774 }
10775 }
10776
10777 throw new Error('Unable to find valid recovery factor')
10778 }
10779
10780 module.exports = {
10781 calcPubKeyRecoveryParam: calcPubKeyRecoveryParam,
10782 deterministicGenerateK: deterministicGenerateK,
10783 recoverPubKey: recoverPubKey,
10784 sign: sign,
10785 verify: verify,
10786 verifyRaw: verifyRaw
10787 }
10788
10789 }).call(this,require("buffer").Buffer)
10790 },{"./ecsignature":62,"assert":5,"bigi":3,"buffer":7,"create-hmac":45,"typeforce":53}],60:[function(require,module,exports){
10791 (function (Buffer){
10792 var assert = require('assert')
10793 var base58check = require('bs58check')
10794 var ecdsa = require('./ecdsa')
10795 var networks = require('./networks')
10796 var randomBytes = require('randombytes')
10797 var typeForce = require('typeforce')
10798
10799 var BigInteger = require('bigi')
10800 var ECPubKey = require('./ecpubkey')
10801
10802 var ecurve = require('ecurve')
10803 var secp256k1 = ecurve.getCurveByName('secp256k1')
10804
10805 function ECKey (d, compressed) {
10806 assert(d.signum() > 0, 'Private key must be greater than 0')
10807 assert(d.compareTo(ECKey.curve.n) < 0, 'Private key must be less than the curve order')
10808
10809 var Q = ECKey.curve.G.multiply(d)
10810
10811 this.d = d
10812 this.pub = new ECPubKey(Q, compressed)
10813 }
10814
10815 // Constants
10816 ECKey.curve = secp256k1
10817
10818 // Static constructors
10819 ECKey.fromWIF = function (string) {
10820 var payload = base58check.decode(string)
10821 var compressed = false
10822
10823 // Ignore the version byte
10824 payload = payload.slice(1)
10825
10826 if (payload.length === 33) {
10827 assert.strictEqual(payload[32], 0x01, 'Invalid compression flag')
10828
10829 // Truncate the compression flag
10830 payload = payload.slice(0, -1)
10831 compressed = true
10832 }
10833
10834 assert.equal(payload.length, 32, 'Invalid WIF payload length')
10835
10836 var d = BigInteger.fromBuffer(payload)
10837 return new ECKey(d, compressed)
10838 }
10839
10840 ECKey.makeRandom = function (compressed, rng) {
10841 rng = rng || randomBytes
10842
10843 var buffer = rng(32)
10844 typeForce('Buffer', buffer)
10845 assert.equal(buffer.length, 32, 'Expected 256-bit Buffer from RNG')
10846
10847 var d = BigInteger.fromBuffer(buffer)
10848 d = d.mod(ECKey.curve.n)
10849
10850 return new ECKey(d, compressed)
10851 }
10852
10853 // Export functions
10854 ECKey.prototype.toWIF = function (network) {
10855 network = network || networks.bitcoin
10856
10857 var bufferLen = this.pub.compressed ? 34 : 33
10858 var buffer = new Buffer(bufferLen)
10859
10860 buffer.writeUInt8(network.wif, 0)
10861 this.d.toBuffer(32).copy(buffer, 1)
10862
10863 if (this.pub.compressed) {
10864 buffer.writeUInt8(0x01, 33)
10865 }
10866
10867 return base58check.encode(buffer)
10868 }
10869
10870 // Operations
10871 ECKey.prototype.sign = function (hash) {
10872 return ecdsa.sign(ECKey.curve, hash, this.d)
10873 }
10874
10875 module.exports = ECKey
10876
10877 }).call(this,require("buffer").Buffer)
10878 },{"./ecdsa":59,"./ecpubkey":61,"./networks":66,"assert":5,"bigi":3,"bs58check":31,"buffer":7,"ecurve":49,"randombytes":52,"typeforce":53}],61:[function(require,module,exports){
10879 (function (Buffer){
10880 var crypto = require('./crypto')
10881 var ecdsa = require('./ecdsa')
10882 var typeForce = require('typeforce')
10883 var networks = require('./networks')
10884
10885 var Address = require('./address')
10886
10887 var ecurve = require('ecurve')
10888 var secp256k1 = ecurve.getCurveByName('secp256k1')
10889
10890 function ECPubKey (Q, compressed) {
10891 if (compressed === undefined) {
10892 compressed = true
10893 }
10894
10895 typeForce('Point', Q)
10896 typeForce('Boolean', compressed)
10897
10898 this.compressed = compressed
10899 this.Q = Q
10900 }
10901
10902 // Constants
10903 ECPubKey.curve = secp256k1
10904
10905 // Static constructors
10906 ECPubKey.fromBuffer = function (buffer) {
10907 var Q = ecurve.Point.decodeFrom(ECPubKey.curve, buffer)
10908 return new ECPubKey(Q, Q.compressed)
10909 }
10910
10911 ECPubKey.fromHex = function (hex) {
10912 return ECPubKey.fromBuffer(new Buffer(hex, 'hex'))
10913 }
10914
10915 // Operations
10916 ECPubKey.prototype.getAddress = function (network) {
10917 network = network || networks.bitcoin
10918
10919 return new Address(crypto.hash160(this.toBuffer()), network.pubKeyHash)
10920 }
10921
10922 ECPubKey.prototype.verify = function (hash, signature) {
10923 return ecdsa.verify(ECPubKey.curve, hash, signature, this.Q)
10924 }
10925
10926 // Export functions
10927 ECPubKey.prototype.toBuffer = function () {
10928 return this.Q.getEncoded(this.compressed)
10929 }
10930
10931 ECPubKey.prototype.toHex = function () {
10932 return this.toBuffer().toString('hex')
10933 }
10934
10935 module.exports = ECPubKey
10936
10937 }).call(this,require("buffer").Buffer)
10938 },{"./address":54,"./crypto":58,"./ecdsa":59,"./networks":66,"buffer":7,"ecurve":49,"typeforce":53}],62:[function(require,module,exports){
10939 (function (Buffer){
10940 var assert = require('assert')
10941 var typeForce = require('typeforce')
10942
10943 var BigInteger = require('bigi')
10944
10945 function ECSignature (r, s) {
10946 typeForce('BigInteger', r)
10947 typeForce('BigInteger', s)
10948
10949 this.r = r
10950 this.s = s
10951 }
10952
10953 ECSignature.parseCompact = function (buffer) {
10954 assert.equal(buffer.length, 65, 'Invalid signature length')
10955 var i = buffer.readUInt8(0) - 27
10956
10957 // At most 3 bits
10958 assert.equal(i, i & 7, 'Invalid signature parameter')
10959 var compressed = !!(i & 4)
10960
10961 // Recovery param only
10962 i = i & 3
10963
10964 var r = BigInteger.fromBuffer(buffer.slice(1, 33))
10965 var s = BigInteger.fromBuffer(buffer.slice(33))
10966
10967 return {
10968 compressed: compressed,
10969 i: i,
10970 signature: new ECSignature(r, s)
10971 }
10972 }
10973
10974 ECSignature.fromDER = function (buffer) {
10975 assert.equal(buffer.readUInt8(0), 0x30, 'Not a DER sequence')
10976 assert.equal(buffer.readUInt8(1), buffer.length - 2, 'Invalid sequence length')
10977 assert.equal(buffer.readUInt8(2), 0x02, 'Expected a DER integer')
10978
10979 var rLen = buffer.readUInt8(3)
10980 assert(rLen > 0, 'R length is zero')
10981
10982 var offset = 4 + rLen
10983 assert.equal(buffer.readUInt8(offset), 0x02, 'Expected a DER integer (2)')
10984
10985 var sLen = buffer.readUInt8(offset + 1)
10986 assert(sLen > 0, 'S length is zero')
10987
10988 var rB = buffer.slice(4, offset)
10989 var sB = buffer.slice(offset + 2)
10990 offset += 2 + sLen
10991
10992 if (rLen > 1 && rB.readUInt8(0) === 0x00) {
10993 assert(rB.readUInt8(1) & 0x80, 'R value excessively padded')
10994 }
10995
10996 if (sLen > 1 && sB.readUInt8(0) === 0x00) {
10997 assert(sB.readUInt8(1) & 0x80, 'S value excessively padded')
10998 }
10999
11000 assert.equal(offset, buffer.length, 'Invalid DER encoding')
11001 var r = BigInteger.fromDERInteger(rB)
11002 var s = BigInteger.fromDERInteger(sB)
11003
11004 assert(r.signum() >= 0, 'R value is negative')
11005 assert(s.signum() >= 0, 'S value is negative')
11006
11007 return new ECSignature(r, s)
11008 }
11009
11010 // BIP62: 1 byte hashType flag (only 0x01, 0x02, 0x03, 0x81, 0x82 and 0x83 are allowed)
11011 ECSignature.parseScriptSignature = function (buffer) {
11012 var hashType = buffer.readUInt8(buffer.length - 1)
11013 var hashTypeMod = hashType & ~0x80
11014
11015 assert(hashTypeMod > 0x00 && hashTypeMod < 0x04, 'Invalid hashType ' + hashType)
11016
11017 return {
11018 signature: ECSignature.fromDER(buffer.slice(0, -1)),
11019 hashType: hashType
11020 }
11021 }
11022
11023 ECSignature.prototype.toCompact = function (i, compressed) {
11024 if (compressed) {
11025 i += 4
11026 }
11027
11028 i += 27
11029
11030 var buffer = new Buffer(65)
11031 buffer.writeUInt8(i, 0)
11032
11033 this.r.toBuffer(32).copy(buffer, 1)
11034 this.s.toBuffer(32).copy(buffer, 33)
11035
11036 return buffer
11037 }
11038
11039 ECSignature.prototype.toDER = function () {
11040 var rBa = this.r.toDERInteger()
11041 var sBa = this.s.toDERInteger()
11042
11043 var sequence = []
11044
11045 // INTEGER
11046 sequence.push(0x02, rBa.length)
11047 sequence = sequence.concat(rBa)
11048
11049 // INTEGER
11050 sequence.push(0x02, sBa.length)
11051 sequence = sequence.concat(sBa)
11052
11053 // SEQUENCE
11054 sequence.unshift(0x30, sequence.length)
11055
11056 return new Buffer(sequence)
11057 }
11058
11059 ECSignature.prototype.toScriptSignature = function (hashType) {
11060 var hashTypeMod = hashType & ~0x80
11061 assert(hashTypeMod > 0x00 && hashTypeMod < 0x04, 'Invalid hashType ' + hashType)
11062
11063 var hashTypeBuffer = new Buffer(1)
11064 hashTypeBuffer.writeUInt8(hashType, 0)
11065
11066 return Buffer.concat([this.toDER(), hashTypeBuffer])
11067 }
11068
11069 module.exports = ECSignature
11070
11071 }).call(this,require("buffer").Buffer)
11072 },{"assert":5,"bigi":3,"buffer":7,"typeforce":53}],63:[function(require,module,exports){
11073 (function (Buffer){
11074 var assert = require('assert')
11075 var base58check = require('bs58check')
11076 var bcrypto = require('./crypto')
11077 var createHmac = require('create-hmac')
11078 var typeForce = require('typeforce')
11079 var networks = require('./networks')
11080
11081 var BigInteger = require('bigi')
11082 var ECKey = require('./eckey')
11083 var ECPubKey = require('./ecpubkey')
11084
11085 var ecurve = require('ecurve')
11086 var curve = ecurve.getCurveByName('secp256k1')
11087
11088 function findBIP32NetworkByVersion (version) {
11089 for (var name in networks) {
11090 var network = networks[name]
11091
11092 if (version === network.bip32.private || version === network.bip32.public) {
11093 return network
11094 }
11095 }
11096
11097 assert(false, 'Could not find network for ' + version.toString(16))
11098 }
11099
11100 function HDNode (K, chainCode, network) {
11101 network = network || networks.bitcoin
11102
11103 typeForce('Buffer', chainCode)
11104
11105 assert.equal(chainCode.length, 32, 'Expected chainCode length of 32, got ' + chainCode.length)
11106 assert(network.bip32, 'Unknown BIP32 constants for network')
11107
11108 this.chainCode = chainCode
11109 this.depth = 0
11110 this.index = 0
11111 this.parentFingerprint = 0x00000000
11112 this.network = network
11113
11114 if (K instanceof BigInteger) {
11115 this.privKey = new ECKey(K, true)
11116 this.pubKey = this.privKey.pub
11117 } else if (K instanceof ECKey) {
11118 assert(K.pub.compressed, 'ECKey must be compressed')
11119 this.privKey = K
11120 this.pubKey = K.pub
11121 } else if (K instanceof ECPubKey) {
11122 assert(K.compressed, 'ECPubKey must be compressed')
11123 this.pubKey = K
11124 } else {
11125 this.pubKey = new ECPubKey(K, true)
11126 }
11127 }
11128
11129 HDNode.MASTER_SECRET = new Buffer('Bitcoin seed')
11130 HDNode.HIGHEST_BIT = 0x80000000
11131 HDNode.LENGTH = 78
11132
11133 HDNode.fromSeedBuffer = function (seed, network) {
11134 typeForce('Buffer', seed)
11135
11136 assert(seed.length >= 16, 'Seed should be at least 128 bits')
11137 assert(seed.length <= 64, 'Seed should be at most 512 bits')
11138
11139 var I = createHmac('sha512', HDNode.MASTER_SECRET).update(seed).digest()
11140 var IL = I.slice(0, 32)
11141 var IR = I.slice(32)
11142
11143 // In case IL is 0 or >= n, the master key is invalid
11144 // This is handled by `new ECKey` in the HDNode constructor
11145 var pIL = BigInteger.fromBuffer(IL)
11146
11147 return new HDNode(pIL, IR, network)
11148 }
11149
11150 HDNode.fromSeedHex = function (hex, network) {
11151 return HDNode.fromSeedBuffer(new Buffer(hex, 'hex'), network)
11152 }
11153
11154 HDNode.fromBase58 = function (string, network) {
11155 return HDNode.fromBuffer(base58check.decode(string), network, true)
11156 }
11157
11158 // FIXME: remove in 2.x.y
11159 HDNode.fromBuffer = function (buffer, network, __ignoreDeprecation) {
11160 if (!__ignoreDeprecation) {
11161 console.warn('HDNode.fromBuffer() is deprecated for removal in 2.x.y, use fromBase58 instead')
11162 }
11163
11164 assert.strictEqual(buffer.length, HDNode.LENGTH, 'Invalid buffer length')
11165
11166 // 4 byte: version bytes
11167 var version = buffer.readUInt32BE(0)
11168
11169 if (network) {
11170 assert(version === network.bip32.private || version === network.bip32.public, "Network doesn't match")
11171
11172 // auto-detect
11173 } else {
11174 network = findBIP32NetworkByVersion(version)
11175 }
11176
11177 // 1 byte: depth: 0x00 for master nodes, 0x01 for level-1 descendants, ...
11178 var depth = buffer.readUInt8(4)
11179
11180 // 4 bytes: the fingerprint of the parent's key (0x00000000 if master key)
11181 var parentFingerprint = buffer.readUInt32BE(5)
11182 if (depth === 0) {
11183 assert.strictEqual(parentFingerprint, 0x00000000, 'Invalid parent fingerprint')
11184 }
11185
11186 // 4 bytes: child number. This is the number i in xi = xpar/i, with xi the key being serialized.
11187 // This is encoded in MSB order. (0x00000000 if master key)
11188 var index = buffer.readUInt32BE(9)
11189 assert(depth > 0 || index === 0, 'Invalid index')
11190
11191 // 32 bytes: the chain code
11192 var chainCode = buffer.slice(13, 45)
11193 var data, hd
11194
11195 // 33 bytes: private key data (0x00 + k)
11196 if (version === network.bip32.private) {
11197 assert.strictEqual(buffer.readUInt8(45), 0x00, 'Invalid private key')
11198 data = buffer.slice(46, 78)
11199 var d = BigInteger.fromBuffer(data)
11200 hd = new HDNode(d, chainCode, network)
11201
11202 // 33 bytes: public key data (0x02 + X or 0x03 + X)
11203 } else {
11204 data = buffer.slice(45, 78)
11205 var Q = ecurve.Point.decodeFrom(curve, data)
11206 assert.equal(Q.compressed, true, 'Invalid public key')
11207
11208 // Verify that the X coordinate in the public point corresponds to a point on the curve.
11209 // If not, the extended public key is invalid.
11210 curve.validate(Q)
11211
11212 hd = new HDNode(Q, chainCode, network)
11213 }
11214
11215 hd.depth = depth
11216 hd.index = index
11217 hd.parentFingerprint = parentFingerprint
11218
11219 return hd
11220 }
11221
11222 // FIXME: remove in 2.x.y
11223 HDNode.fromHex = function (hex, network) {
11224 return HDNode.fromBuffer(new Buffer(hex, 'hex'), network)
11225 }
11226
11227 HDNode.prototype.getIdentifier = function () {
11228 return bcrypto.hash160(this.pubKey.toBuffer())
11229 }
11230
11231 HDNode.prototype.getFingerprint = function () {
11232 return this.getIdentifier().slice(0, 4)
11233 }
11234
11235 HDNode.prototype.getAddress = function () {
11236 return this.pubKey.getAddress(this.network)
11237 }
11238
11239 HDNode.prototype.neutered = function () {
11240 var neutered = new HDNode(this.pubKey.Q, this.chainCode, this.network)
11241 neutered.depth = this.depth
11242 neutered.index = this.index
11243 neutered.parentFingerprint = this.parentFingerprint
11244
11245 return neutered
11246 }
11247
11248 HDNode.prototype.toBase58 = function (isPrivate) {
11249 return base58check.encode(this.toBuffer(isPrivate, true))
11250 }
11251
11252 // FIXME: remove in 2.x.y
11253 HDNode.prototype.toBuffer = function (isPrivate, __ignoreDeprecation) {
11254 if (isPrivate === undefined) {
11255 isPrivate = !!this.privKey
11256
11257 // FIXME: remove in 2.x.y
11258 } else {
11259 console.warn('isPrivate flag is deprecated, please use the .neutered() method instead')
11260 }
11261
11262 if (!__ignoreDeprecation) {
11263 console.warn('HDNode.toBuffer() is deprecated for removal in 2.x.y, use toBase58 instead')
11264 }
11265
11266 // Version
11267 var version = isPrivate ? this.network.bip32.private : this.network.bip32.public
11268 var buffer = new Buffer(HDNode.LENGTH)
11269
11270 // 4 bytes: version bytes
11271 buffer.writeUInt32BE(version, 0)
11272
11273 // Depth
11274 // 1 byte: depth: 0x00 for master nodes, 0x01 for level-1 descendants, ....
11275 buffer.writeUInt8(this.depth, 4)
11276
11277 // 4 bytes: the fingerprint of the parent's key (0x00000000 if master key)
11278 buffer.writeUInt32BE(this.parentFingerprint, 5)
11279
11280 // 4 bytes: child number. This is the number i in xi = xpar/i, with xi the key being serialized.
11281 // This is encoded in Big endian. (0x00000000 if master key)
11282 buffer.writeUInt32BE(this.index, 9)
11283
11284 // 32 bytes: the chain code
11285 this.chainCode.copy(buffer, 13)
11286
11287 // 33 bytes: the public key or private key data
11288 if (isPrivate) {
11289 // FIXME: remove in 2.x.y
11290 assert(this.privKey, 'Missing private key')
11291
11292 // 0x00 + k for private keys
11293 buffer.writeUInt8(0, 45)
11294 this.privKey.d.toBuffer(32).copy(buffer, 46)
11295 } else {
11296 // X9.62 encoding for public keys
11297 this.pubKey.toBuffer().copy(buffer, 45)
11298 }
11299
11300 return buffer
11301 }
11302
11303 // FIXME: remove in 2.x.y
11304 HDNode.prototype.toHex = function (isPrivate) {
11305 return this.toBuffer(isPrivate).toString('hex')
11306 }
11307
11308 // https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#child-key-derivation-ckd-functions
11309 HDNode.prototype.derive = function (index) {
11310 var isHardened = index >= HDNode.HIGHEST_BIT
11311 var indexBuffer = new Buffer(4)
11312 indexBuffer.writeUInt32BE(index, 0)
11313
11314 var data
11315
11316 // Hardened child
11317 if (isHardened) {
11318 assert(this.privKey, 'Could not derive hardened child key')
11319
11320 // data = 0x00 || ser256(kpar) || ser32(index)
11321 data = Buffer.concat([
11322 this.privKey.d.toBuffer(33),
11323 indexBuffer
11324 ])
11325
11326 // Normal child
11327 } else {
11328 // data = serP(point(kpar)) || ser32(index)
11329 // = serP(Kpar) || ser32(index)
11330 data = Buffer.concat([
11331 this.pubKey.toBuffer(),
11332 indexBuffer
11333 ])
11334 }
11335
11336 var I = createHmac('sha512', this.chainCode).update(data).digest()
11337 var IL = I.slice(0, 32)
11338 var IR = I.slice(32)
11339
11340 var pIL = BigInteger.fromBuffer(IL)
11341
11342 // In case parse256(IL) >= n, proceed with the next value for i
11343 if (pIL.compareTo(curve.n) >= 0) {
11344 return this.derive(index + 1)
11345 }
11346
11347 // Private parent key -> private child key
11348 var hd
11349 if (this.privKey) {
11350 // ki = parse256(IL) + kpar (mod n)
11351 var ki = pIL.add(this.privKey.d).mod(curve.n)
11352
11353 // In case ki == 0, proceed with the next value for i
11354 if (ki.signum() === 0) {
11355 return this.derive(index + 1)
11356 }
11357
11358 hd = new HDNode(ki, IR, this.network)
11359
11360 // Public parent key -> public child key
11361 } else {
11362 // Ki = point(parse256(IL)) + Kpar
11363 // = G*IL + Kpar
11364 var Ki = curve.G.multiply(pIL).add(this.pubKey.Q)
11365
11366 // In case Ki is the point at infinity, proceed with the next value for i
11367 if (curve.isInfinity(Ki)) {
11368 return this.derive(index + 1)
11369 }
11370
11371 hd = new HDNode(Ki, IR, this.network)
11372 }
11373
11374 hd.depth = this.depth + 1
11375 hd.index = index
11376 hd.parentFingerprint = this.getFingerprint().readUInt32BE(0)
11377
11378 return hd
11379 }
11380
11381 HDNode.prototype.deriveHardened = function (index) {
11382 // Only derives hardened private keys by default
11383 return this.derive(index + HDNode.HIGHEST_BIT)
11384 }
11385
11386 HDNode.prototype.toString = HDNode.prototype.toBase58
11387
11388 module.exports = HDNode
11389
11390 }).call(this,require("buffer").Buffer)
11391 },{"./crypto":58,"./eckey":60,"./ecpubkey":61,"./networks":66,"assert":5,"bigi":3,"bs58check":31,"buffer":7,"create-hmac":45,"ecurve":49,"typeforce":53}],64:[function(require,module,exports){
11392 module.exports = {
11393 Address: require('./address'),
11394 base58check: require('./base58check'),
11395 Block: require('./block'),
11396 bufferutils: require('./bufferutils'),
11397 crypto: require('./crypto'),
11398 ecdsa: require('./ecdsa'),
11399 ECKey: require('./eckey'),
11400 ECPubKey: require('./ecpubkey'),
11401 ECSignature: require('./ecsignature'),
11402 Message: require('./message'),
11403 opcodes: require('./opcodes'),
11404 HDNode: require('./hdnode'),
11405 Script: require('./script'),
11406 scripts: require('./scripts'),
11407 Transaction: require('./transaction'),
11408 TransactionBuilder: require('./transaction_builder'),
11409 networks: require('./networks'),
11410 Wallet: require('./wallet')
11411 }
11412
11413 },{"./address":54,"./base58check":55,"./block":56,"./bufferutils":57,"./crypto":58,"./ecdsa":59,"./eckey":60,"./ecpubkey":61,"./ecsignature":62,"./hdnode":63,"./message":65,"./networks":66,"./opcodes":67,"./script":68,"./scripts":69,"./transaction":70,"./transaction_builder":71,"./wallet":72}],65:[function(require,module,exports){
11414 (function (Buffer){
11415 var bufferutils = require('./bufferutils')
11416 var crypto = require('./crypto')
11417 var ecdsa = require('./ecdsa')
11418 var networks = require('./networks')
11419
11420 var BigInteger = require('bigi')
11421 var ECPubKey = require('./ecpubkey')
11422 var ECSignature = require('./ecsignature')
11423
11424 var ecurve = require('ecurve')
11425 var ecparams = ecurve.getCurveByName('secp256k1')
11426
11427 function magicHash (message, network) {
11428 var magicPrefix = new Buffer(network.magicPrefix)
11429 var messageBuffer = new Buffer(message)
11430 var lengthBuffer = bufferutils.varIntBuffer(messageBuffer.length)
11431
11432 var buffer = Buffer.concat([magicPrefix, lengthBuffer, messageBuffer])
11433 return crypto.hash256(buffer)
11434 }
11435
11436 function sign (privKey, message, network) {
11437 network = network || networks.bitcoin
11438
11439 var hash = magicHash(message, network)
11440 var signature = privKey.sign(hash)
11441 var e = BigInteger.fromBuffer(hash)
11442 var i = ecdsa.calcPubKeyRecoveryParam(ecparams, e, signature, privKey.pub.Q)
11443
11444 return signature.toCompact(i, privKey.pub.compressed)
11445 }
11446
11447 // TODO: network could be implied from address
11448 function verify (address, signature, message, network) {
11449 if (!Buffer.isBuffer(signature)) {
11450 signature = new Buffer(signature, 'base64')
11451 }
11452
11453 network = network || networks.bitcoin
11454
11455 var hash = magicHash(message, network)
11456 var parsed = ECSignature.parseCompact(signature)
11457 var e = BigInteger.fromBuffer(hash)
11458 var Q = ecdsa.recoverPubKey(ecparams, e, parsed.signature, parsed.i)
11459
11460 var pubKey = new ECPubKey(Q, parsed.compressed)
11461 return pubKey.getAddress(network).toString() === address.toString()
11462 }
11463
11464 module.exports = {
11465 magicHash: magicHash,
11466 sign: sign,
11467 verify: verify
11468 }
11469
11470 }).call(this,require("buffer").Buffer)
11471 },{"./bufferutils":57,"./crypto":58,"./ecdsa":59,"./ecpubkey":61,"./ecsignature":62,"./networks":66,"bigi":3,"buffer":7,"ecurve":49}],66:[function(require,module,exports){
11472 // https://en.bitcoin.it/wiki/List_of_address_prefixes
11473 // Dogecoin BIP32 is a proposed standard: https://bitcointalk.org/index.php?topic=409731
11474
11475 var networks = {
11476 bitcoin: {
11477 magicPrefix: '\x18Bitcoin Signed Message:\n',
11478 bip32: {
11479 public: 0x0488b21e,
11480 private: 0x0488ade4
11481 },
11482 pubKeyHash: 0x00,
11483 scriptHash: 0x05,
11484 wif: 0x80,
11485 dustThreshold: 546, // https://github.com/bitcoin/bitcoin/blob/v0.9.2/src/core.h#L151-L162
11486 feePerKb: 10000, // https://github.com/bitcoin/bitcoin/blob/v0.9.2/src/main.cpp#L53
11487 estimateFee: estimateFee('bitcoin')
11488 },
11489 testnet: {
11490 magicPrefix: '\x18Bitcoin Signed Message:\n',
11491 bip32: {
11492 public: 0x043587cf,
11493 private: 0x04358394
11494 },
11495 pubKeyHash: 0x6f,
11496 scriptHash: 0xc4,
11497 wif: 0xef,
11498 dustThreshold: 546,
11499 feePerKb: 10000,
11500 estimateFee: estimateFee('testnet')
11501 },
11502 litecoin: {
11503 magicPrefix: '\x19Litecoin Signed Message:\n',
11504 bip32: {
11505 public: 0x019da462,
11506 private: 0x019d9cfe
11507 },
11508 pubKeyHash: 0x30,
11509 scriptHash: 0x05,
11510 wif: 0xb0,
11511 dustThreshold: 0, // https://github.com/litecoin-project/litecoin/blob/v0.8.7.2/src/main.cpp#L360-L365
11512 dustSoftThreshold: 100000, // https://github.com/litecoin-project/litecoin/blob/v0.8.7.2/src/main.h#L53
11513 feePerKb: 100000, // https://github.com/litecoin-project/litecoin/blob/v0.8.7.2/src/main.cpp#L56
11514 estimateFee: estimateFee('litecoin')
11515 },
11516 dogecoin: {
11517 magicPrefix: '\x19Dogecoin Signed Message:\n',
11518 bip32: {
11519 public: 0x02facafd,
11520 private: 0x02fac398
11521 },
11522 pubKeyHash: 0x1e,
11523 scriptHash: 0x16,
11524 wif: 0x9e,
11525 dustThreshold: 0, // https://github.com/dogecoin/dogecoin/blob/v1.7.1/src/core.h#L155-L160
11526 dustSoftThreshold: 100000000, // https://github.com/dogecoin/dogecoin/blob/v1.7.1/src/main.h#L62
11527 feePerKb: 100000000, // https://github.com/dogecoin/dogecoin/blob/v1.7.1/src/main.cpp#L58
11528 estimateFee: estimateFee('dogecoin')
11529 },
11530 viacoin: {
11531 magicPrefix: '\x18Viacoin Signed Message:\n',
11532 bip32: {
11533 public: 0x0488b21e,
11534 private: 0x0488ade4
11535 },
11536 pubKeyHash: 0x47,
11537 scriptHash: 0x21,
11538 wif: 0xc7,
11539 dustThreshold: 560,
11540 dustSoftThreshold: 100000,
11541 feePerKb: 100000, //
11542 estimateFee: estimateFee('viacoin')
11543 },
11544 viacointestnet: {
11545 magicPrefix: '\x18Viacoin Signed Message:\n',
11546 bip32: {
11547 public: 0x043587cf,
11548 private: 0x04358394
11549 },
11550 pubKeyHash: 0x7f,
11551 scriptHash: 0xc4,
11552 wif: 0xff,
11553 dustThreshold: 560,
11554 dustSoftThreshold: 100000,
11555 feePerKb: 100000,
11556 estimateFee: estimateFee('viacointestnet')
11557 },
11558 gamerscoin: {
11559 magicPrefix: '\x19Gamerscoin Signed Message:\n',
11560 bip32: {
11561 public: 0x019da462,
11562 private: 0x019d9cfe
11563 },
11564 pubKeyHash: 0x26,
11565 scriptHash: 0x05,
11566 wif: 0xA6,
11567 dustThreshold: 0, // https://github.com/gamers-coin/gamers-coinv3/blob/master/src/main.cpp#L358-L363
11568 dustSoftThreshold: 100000, // https://github.com/gamers-coin/gamers-coinv3/blob/master/src/main.cpp#L51
11569 feePerKb: 100000, // https://github.com/gamers-coin/gamers-coinv3/blob/master/src/main.cpp#L54
11570 estimateFee: estimateFee('gamerscoin')
11571 },
11572 jumbucks: {
11573 magicPrefix: '\x19Jumbucks Signed Message:\n',
11574 bip32: {
11575 public: 0x037a689a,
11576 private: 0x037a6460
11577 },
11578 pubKeyHash: 0x2b,
11579 scriptHash: 0x05,
11580 wif: 0xab,
11581 dustThreshold: 0,
11582 dustSoftThreshold: 10000,
11583 feePerKb: 10000,
11584 estimateFee: estimateFee('jumbucks')
11585 },
11586 zetacoin: {
11587 magicPrefix: '\x18Zetacoin Signed Message:\n',
11588 bip32: {
11589 public: 0x0488b21e,
11590 private: 0x0488ade4
11591 },
11592 pubKeyHash: 0x50,
11593 scriptHash: 0x09,
11594 wif: 0xe0,
11595 dustThreshold: 546, // https://github.com/zetacoin/zetacoin/blob/master/src/core.h#L159
11596 feePerKb: 10000, // https://github.com/zetacoin/zetacoin/blob/master/src/main.cpp#L54
11597 estimateFee: estimateFee('zetacoin')
11598 }
11599 }
11600
11601 function estimateFee (type) {
11602 return function (tx) {
11603 var network = networks[type]
11604 var baseFee = network.feePerKb
11605 var byteSize = tx.toBuffer().length
11606
11607 var fee = baseFee * Math.ceil(byteSize / 1000)
11608 if (network.dustSoftThreshold === undefined) return fee
11609
11610 tx.outs.forEach(function (e) {
11611 if (e.value < network.dustSoftThreshold) {
11612 fee += baseFee
11613 }
11614 })
11615
11616 return fee
11617 }
11618 }
11619
11620 module.exports = networks
11621
11622 },{}],67:[function(require,module,exports){
11623 module.exports = {
11624 // push value
11625 OP_FALSE: 0,
11626 OP_0: 0,
11627 OP_PUSHDATA1: 76,
11628 OP_PUSHDATA2: 77,
11629 OP_PUSHDATA4: 78,
11630 OP_1NEGATE: 79,
11631 OP_RESERVED: 80,
11632 OP_1: 81,
11633 OP_TRUE: 81,
11634 OP_2: 82,
11635 OP_3: 83,
11636 OP_4: 84,
11637 OP_5: 85,
11638 OP_6: 86,
11639 OP_7: 87,
11640 OP_8: 88,
11641 OP_9: 89,
11642 OP_10: 90,
11643 OP_11: 91,
11644 OP_12: 92,
11645 OP_13: 93,
11646 OP_14: 94,
11647 OP_15: 95,
11648 OP_16: 96,
11649
11650 // control
11651 OP_NOP: 97,
11652 OP_VER: 98,
11653 OP_IF: 99,
11654 OP_NOTIF: 100,
11655 OP_VERIF: 101,
11656 OP_VERNOTIF: 102,
11657 OP_ELSE: 103,
11658 OP_ENDIF: 104,
11659 OP_VERIFY: 105,
11660 OP_RETURN: 106,
11661
11662 // stack ops
11663 OP_TOALTSTACK: 107,
11664 OP_FROMALTSTACK: 108,
11665 OP_2DROP: 109,
11666 OP_2DUP: 110,
11667 OP_3DUP: 111,
11668 OP_2OVER: 112,
11669 OP_2ROT: 113,
11670 OP_2SWAP: 114,
11671 OP_IFDUP: 115,
11672 OP_DEPTH: 116,
11673 OP_DROP: 117,
11674 OP_DUP: 118,
11675 OP_NIP: 119,
11676 OP_OVER: 120,
11677 OP_PICK: 121,
11678 OP_ROLL: 122,
11679 OP_ROT: 123,
11680 OP_SWAP: 124,
11681 OP_TUCK: 125,
11682
11683 // splice ops
11684 OP_CAT: 126,
11685 OP_SUBSTR: 127,
11686 OP_LEFT: 128,
11687 OP_RIGHT: 129,
11688 OP_SIZE: 130,
11689
11690 // bit logic
11691 OP_INVERT: 131,
11692 OP_AND: 132,
11693 OP_OR: 133,
11694 OP_XOR: 134,
11695 OP_EQUAL: 135,
11696 OP_EQUALVERIFY: 136,
11697 OP_RESERVED1: 137,
11698 OP_RESERVED2: 138,
11699
11700 // numeric
11701 OP_1ADD: 139,
11702 OP_1SUB: 140,
11703 OP_2MUL: 141,
11704 OP_2DIV: 142,
11705 OP_NEGATE: 143,
11706 OP_ABS: 144,
11707 OP_NOT: 145,
11708 OP_0NOTEQUAL: 146,
11709
11710 OP_ADD: 147,
11711 OP_SUB: 148,
11712 OP_MUL: 149,
11713 OP_DIV: 150,
11714 OP_MOD: 151,
11715 OP_LSHIFT: 152,
11716 OP_RSHIFT: 153,
11717
11718 OP_BOOLAND: 154,
11719 OP_BOOLOR: 155,
11720 OP_NUMEQUAL: 156,
11721 OP_NUMEQUALVERIFY: 157,
11722 OP_NUMNOTEQUAL: 158,
11723 OP_LESSTHAN: 159,
11724 OP_GREATERTHAN: 160,
11725 OP_LESSTHANOREQUAL: 161,
11726 OP_GREATERTHANOREQUAL: 162,
11727 OP_MIN: 163,
11728 OP_MAX: 164,
11729
11730 OP_WITHIN: 165,
11731
11732 // crypto
11733 OP_RIPEMD160: 166,
11734 OP_SHA1: 167,
11735 OP_SHA256: 168,
11736 OP_HASH160: 169,
11737 OP_HASH256: 170,
11738 OP_CODESEPARATOR: 171,
11739 OP_CHECKSIG: 172,
11740 OP_CHECKSIGVERIFY: 173,
11741 OP_CHECKMULTISIG: 174,
11742 OP_CHECKMULTISIGVERIFY: 175,
11743
11744 // expansion
11745 OP_NOP1: 176,
11746 OP_NOP2: 177,
11747 OP_NOP3: 178,
11748 OP_NOP4: 179,
11749 OP_NOP5: 180,
11750 OP_NOP6: 181,
11751 OP_NOP7: 182,
11752 OP_NOP8: 183,
11753 OP_NOP9: 184,
11754 OP_NOP10: 185,
11755
11756 // template matching params
11757 OP_PUBKEYHASH: 253,
11758 OP_PUBKEY: 254,
11759 OP_INVALIDOPCODE: 255
11760 }
11761
11762 },{}],68:[function(require,module,exports){
11763 (function (Buffer){
11764 var assert = require('assert')
11765 var bufferutils = require('./bufferutils')
11766 var crypto = require('./crypto')
11767 var typeForce = require('typeforce')
11768 var opcodes = require('./opcodes')
11769
11770 function Script (buffer, chunks) {
11771 typeForce('Buffer', buffer)
11772 typeForce('Array', chunks)
11773
11774 this.buffer = buffer
11775 this.chunks = chunks
11776 }
11777
11778 Script.fromASM = function (asm) {
11779 var strChunks = asm.split(' ')
11780 var chunks = strChunks.map(function (strChunk) {
11781 // opcode
11782 if (strChunk in opcodes) {
11783 return opcodes[strChunk]
11784
11785 // data chunk
11786 } else {
11787 return new Buffer(strChunk, 'hex')
11788 }
11789 })
11790
11791 return Script.fromChunks(chunks)
11792 }
11793
11794 Script.fromBuffer = function (buffer) {
11795 var chunks = []
11796 var i = 0
11797
11798 while (i < buffer.length) {
11799 var opcode = buffer.readUInt8(i)
11800
11801 // data chunk
11802 if ((opcode > opcodes.OP_0) && (opcode <= opcodes.OP_PUSHDATA4)) {
11803 var d = bufferutils.readPushDataInt(buffer, i)
11804
11805 // did reading a pushDataInt fail? return non-chunked script
11806 if (d === null) return new Script(buffer, [])
11807 i += d.size
11808
11809 // attempt to read too much data?
11810 if (i + d.number > buffer.length) return new Script(buffer, [])
11811
11812 var data = buffer.slice(i, i + d.number)
11813 i += d.number
11814
11815 chunks.push(data)
11816
11817 // opcode
11818 } else {
11819 chunks.push(opcode)
11820
11821 i += 1
11822 }
11823 }
11824
11825 return new Script(buffer, chunks)
11826 }
11827
11828 Script.fromChunks = function (chunks) {
11829 typeForce('Array', chunks)
11830
11831 var bufferSize = chunks.reduce(function (accum, chunk) {
11832 // data chunk
11833 if (Buffer.isBuffer(chunk)) {
11834 return accum + bufferutils.pushDataSize(chunk.length) + chunk.length
11835 }
11836
11837 // opcode
11838 return accum + 1
11839 }, 0.0)
11840
11841 var buffer = new Buffer(bufferSize)
11842 var offset = 0
11843
11844 chunks.forEach(function (chunk) {
11845 // data chunk
11846 if (Buffer.isBuffer(chunk)) {
11847 offset += bufferutils.writePushDataInt(buffer, chunk.length, offset)
11848
11849 chunk.copy(buffer, offset)
11850 offset += chunk.length
11851
11852 // opcode
11853 } else {
11854 buffer.writeUInt8(chunk, offset)
11855 offset += 1
11856 }
11857 })
11858
11859 assert.equal(offset, buffer.length, 'Could not decode chunks')
11860 return new Script(buffer, chunks)
11861 }
11862
11863 Script.fromHex = function (hex) {
11864 return Script.fromBuffer(new Buffer(hex, 'hex'))
11865 }
11866
11867 Script.EMPTY = Script.fromChunks([])
11868
11869 Script.prototype.getHash = function () {
11870 return crypto.hash160(this.buffer)
11871 }
11872
11873 // FIXME: doesn't work for data chunks, maybe time to use buffertools.compare...
11874 Script.prototype.without = function (needle) {
11875 return Script.fromChunks(this.chunks.filter(function (op) {
11876 return op !== needle
11877 }))
11878 }
11879
11880 var reverseOps = []
11881 for (var op in opcodes) {
11882 var code = opcodes[op]
11883 reverseOps[code] = op
11884 }
11885
11886 Script.prototype.toASM = function () {
11887 return this.chunks.map(function (chunk) {
11888 // data chunk
11889 if (Buffer.isBuffer(chunk)) {
11890 return chunk.toString('hex')
11891
11892 // opcode
11893 } else {
11894 return reverseOps[chunk]
11895 }
11896 }).join(' ')
11897 }
11898
11899 Script.prototype.toBuffer = function () {
11900 return this.buffer
11901 }
11902
11903 Script.prototype.toHex = function () {
11904 return this.toBuffer().toString('hex')
11905 }
11906
11907 module.exports = Script
11908
11909 }).call(this,require("buffer").Buffer)
11910 },{"./bufferutils":57,"./crypto":58,"./opcodes":67,"assert":5,"buffer":7,"typeforce":53}],69:[function(require,module,exports){
11911 (function (Buffer){
11912 var assert = require('assert')
11913 var ops = require('./opcodes')
11914 var typeForce = require('typeforce')
11915
11916 var ecurve = require('ecurve')
11917 var curve = ecurve.getCurveByName('secp256k1')
11918
11919 var ECSignature = require('./ecsignature')
11920 var Script = require('./script')
11921
11922 function isCanonicalPubKey (buffer) {
11923 if (!Buffer.isBuffer(buffer)) return false
11924
11925 try {
11926 ecurve.Point.decodeFrom(curve, buffer)
11927 } catch (e) {
11928 if (!(e.message.match(/Invalid sequence (length|tag)/)))
11929 throw e
11930
11931 return false
11932 }
11933
11934 return true
11935 }
11936
11937 function isCanonicalSignature (buffer) {
11938 if (!Buffer.isBuffer(buffer)) return false
11939
11940 try {
11941 ECSignature.parseScriptSignature(buffer)
11942 } catch (e) {
11943 if (!(e.message.match(/Not a DER sequence|Invalid sequence length|Expected a DER integer|R length is zero|S length is zero|R value excessively padded|S value excessively padded|R value is negative|S value is negative|Invalid hashType/))) {
11944 throw e
11945 }
11946
11947 return false
11948 }
11949
11950 return true
11951 }
11952
11953 function isPubKeyHashInput (script) {
11954 return script.chunks.length === 2 &&
11955 isCanonicalSignature(script.chunks[0]) &&
11956 isCanonicalPubKey(script.chunks[1])
11957 }
11958
11959 function isPubKeyHashOutput (script) {
11960 return script.chunks.length === 5 &&
11961 script.chunks[0] === ops.OP_DUP &&
11962 script.chunks[1] === ops.OP_HASH160 &&
11963 Buffer.isBuffer(script.chunks[2]) &&
11964 script.chunks[2].length === 20 &&
11965 script.chunks[3] === ops.OP_EQUALVERIFY &&
11966 script.chunks[4] === ops.OP_CHECKSIG
11967 }
11968
11969 function isPubKeyInput (script) {
11970 return script.chunks.length === 1 &&
11971 isCanonicalSignature(script.chunks[0])
11972 }
11973
11974 function isPubKeyOutput (script) {
11975 return script.chunks.length === 2 &&
11976 isCanonicalPubKey(script.chunks[0]) &&
11977 script.chunks[1] === ops.OP_CHECKSIG
11978 }
11979
11980 function isScriptHashInput (script, allowIncomplete) {
11981 if (script.chunks.length < 2) return false
11982
11983 var lastChunk = script.chunks[script.chunks.length - 1]
11984 if (!Buffer.isBuffer(lastChunk)) return false
11985
11986 var scriptSig = Script.fromChunks(script.chunks.slice(0, -1))
11987 var redeemScript = Script.fromBuffer(lastChunk)
11988
11989 // is redeemScript a valid script?
11990 if (redeemScript.chunks.length === 0) return false
11991
11992 return classifyInput(scriptSig, allowIncomplete) === classifyOutput(redeemScript)
11993 }
11994
11995 function isScriptHashOutput (script) {
11996 return script.chunks.length === 3 &&
11997 script.chunks[0] === ops.OP_HASH160 &&
11998 Buffer.isBuffer(script.chunks[1]) &&
11999 script.chunks[1].length === 20 &&
12000 script.chunks[2] === ops.OP_EQUAL
12001 }
12002
12003 // allowIncomplete is to account for combining signatures
12004 // See https://github.com/bitcoin/bitcoin/blob/f425050546644a36b0b8e0eb2f6934a3e0f6f80f/src/script/sign.cpp#L195-L197
12005 function isMultisigInput (script, allowIncomplete) {
12006 if (script.chunks.length < 2) return false
12007 if (script.chunks[0] !== ops.OP_0) return false
12008
12009 if (allowIncomplete) {
12010 return script.chunks.slice(1).every(function (chunk) {
12011 return chunk === ops.OP_0 || isCanonicalSignature(chunk)
12012 })
12013 }
12014
12015 return script.chunks.slice(1).every(isCanonicalSignature)
12016 }
12017
12018 function isMultisigOutput (script) {
12019 if (script.chunks.length < 4) return false
12020 if (script.chunks[script.chunks.length - 1] !== ops.OP_CHECKMULTISIG) return false
12021
12022 var mOp = script.chunks[0]
12023 if (mOp === ops.OP_0) return false
12024 if (mOp < ops.OP_1) return false
12025 if (mOp > ops.OP_16) return false
12026
12027 var nOp = script.chunks[script.chunks.length - 2]
12028 if (nOp === ops.OP_0) return false
12029 if (nOp < ops.OP_1) return false
12030 if (nOp > ops.OP_16) return false
12031
12032 var m = mOp - (ops.OP_1 - 1)
12033 var n = nOp - (ops.OP_1 - 1)
12034 if (n < m) return false
12035
12036 var pubKeys = script.chunks.slice(1, -2)
12037 if (n < pubKeys.length) return false
12038
12039 return pubKeys.every(isCanonicalPubKey)
12040 }
12041
12042 function isNullDataOutput (script) {
12043 return script.chunks[0] === ops.OP_RETURN
12044 }
12045
12046 function classifyOutput (script) {
12047 typeForce('Script', script)
12048
12049 if (isPubKeyHashOutput(script)) {
12050 return 'pubkeyhash'
12051 } else if (isScriptHashOutput(script)) {
12052 return 'scripthash'
12053 } else if (isMultisigOutput(script)) {
12054 return 'multisig'
12055 } else if (isPubKeyOutput(script)) {
12056 return 'pubkey'
12057 } else if (isNullDataOutput(script)) {
12058 return 'nulldata'
12059 }
12060
12061 return 'nonstandard'
12062 }
12063
12064 function classifyInput (script, allowIncomplete) {
12065 typeForce('Script', script)
12066
12067 if (isPubKeyHashInput(script)) {
12068 return 'pubkeyhash'
12069 } else if (isMultisigInput(script, allowIncomplete)) {
12070 return 'multisig'
12071 } else if (isScriptHashInput(script, allowIncomplete)) {
12072 return 'scripthash'
12073 } else if (isPubKeyInput(script)) {
12074 return 'pubkey'
12075 }
12076
12077 return 'nonstandard'
12078 }
12079
12080 // Standard Script Templates
12081 // {pubKey} OP_CHECKSIG
12082 function pubKeyOutput (pubKey) {
12083 return Script.fromChunks([
12084 pubKey.toBuffer(),
12085 ops.OP_CHECKSIG
12086 ])
12087 }
12088
12089 // OP_DUP OP_HASH160 {pubKeyHash} OP_EQUALVERIFY OP_CHECKSIG
12090 function pubKeyHashOutput (hash) {
12091 typeForce('Buffer', hash)
12092
12093 return Script.fromChunks([
12094 ops.OP_DUP,
12095 ops.OP_HASH160,
12096 hash,
12097 ops.OP_EQUALVERIFY,
12098 ops.OP_CHECKSIG
12099 ])
12100 }
12101
12102 // OP_HASH160 {scriptHash} OP_EQUAL
12103 function scriptHashOutput (hash) {
12104 typeForce('Buffer', hash)
12105
12106 return Script.fromChunks([
12107 ops.OP_HASH160,
12108 hash,
12109 ops.OP_EQUAL
12110 ])
12111 }
12112
12113 // m [pubKeys ...] n OP_CHECKMULTISIG
12114 function multisigOutput (m, pubKeys) {
12115 typeForce(['ECPubKey'], pubKeys)
12116
12117 assert(pubKeys.length >= m, 'Not enough pubKeys provided')
12118
12119 var pubKeyBuffers = pubKeys.map(function (pubKey) {
12120 return pubKey.toBuffer()
12121 })
12122 var n = pubKeys.length
12123
12124 return Script.fromChunks([].concat(
12125 (ops.OP_1 - 1) + m,
12126 pubKeyBuffers,
12127 (ops.OP_1 - 1) + n,
12128 ops.OP_CHECKMULTISIG
12129 ))
12130 }
12131
12132 // {signature}
12133 function pubKeyInput (signature) {
12134 typeForce('Buffer', signature)
12135
12136 return Script.fromChunks([signature])
12137 }
12138
12139 // {signature} {pubKey}
12140 function pubKeyHashInput (signature, pubKey) {
12141 typeForce('Buffer', signature)
12142
12143 return Script.fromChunks([signature, pubKey.toBuffer()])
12144 }
12145
12146 // <scriptSig> {serialized scriptPubKey script}
12147 function scriptHashInput (scriptSig, scriptPubKey) {
12148 return Script.fromChunks([].concat(
12149 scriptSig.chunks,
12150 scriptPubKey.toBuffer()
12151 ))
12152 }
12153
12154 // OP_0 [signatures ...]
12155 function multisigInput (signatures, scriptPubKey) {
12156 if (scriptPubKey) {
12157 assert(isMultisigOutput(scriptPubKey))
12158
12159 var mOp = scriptPubKey.chunks[0]
12160 var nOp = scriptPubKey.chunks[scriptPubKey.chunks.length - 2]
12161 var m = mOp - (ops.OP_1 - 1)
12162 var n = nOp - (ops.OP_1 - 1)
12163
12164 assert(signatures.length >= m, 'Not enough signatures provided')
12165 assert(signatures.length <= n, 'Too many signatures provided')
12166 }
12167
12168 return Script.fromChunks([].concat(ops.OP_0, signatures))
12169 }
12170
12171 function nullDataOutput (data) {
12172 return Script.fromChunks([ops.OP_RETURN, data])
12173 }
12174
12175 module.exports = {
12176 isCanonicalPubKey: isCanonicalPubKey,
12177 isCanonicalSignature: isCanonicalSignature,
12178 isPubKeyHashInput: isPubKeyHashInput,
12179 isPubKeyHashOutput: isPubKeyHashOutput,
12180 isPubKeyInput: isPubKeyInput,
12181 isPubKeyOutput: isPubKeyOutput,
12182 isScriptHashInput: isScriptHashInput,
12183 isScriptHashOutput: isScriptHashOutput,
12184 isMultisigInput: isMultisigInput,
12185 isMultisigOutput: isMultisigOutput,
12186 isNullDataOutput: isNullDataOutput,
12187 classifyOutput: classifyOutput,
12188 classifyInput: classifyInput,
12189 pubKeyOutput: pubKeyOutput,
12190 pubKeyHashOutput: pubKeyHashOutput,
12191 scriptHashOutput: scriptHashOutput,
12192 multisigOutput: multisigOutput,
12193 pubKeyInput: pubKeyInput,
12194 pubKeyHashInput: pubKeyHashInput,
12195 scriptHashInput: scriptHashInput,
12196 multisigInput: multisigInput,
12197 dataOutput: function (data) {
12198 console.warn('dataOutput is deprecated, use nullDataOutput by 2.0.0')
12199 return nullDataOutput(data)
12200 },
12201 nullDataOutput: nullDataOutput
12202 }
12203
12204 }).call(this,require("buffer").Buffer)
12205 },{"./ecsignature":62,"./opcodes":67,"./script":68,"assert":5,"buffer":7,"ecurve":49,"typeforce":53}],70:[function(require,module,exports){
12206 (function (Buffer){
12207 var assert = require('assert')
12208 var bufferutils = require('./bufferutils')
12209 var crypto = require('./crypto')
12210 var typeForce = require('typeforce')
12211 var opcodes = require('./opcodes')
12212 var scripts = require('./scripts')
12213
12214 var Address = require('./address')
12215 var ECSignature = require('./ecsignature')
12216 var Script = require('./script')
12217
12218 function Transaction () {
12219 this.version = 1
12220 this.locktime = 0
12221 this.ins = []
12222 this.outs = []
12223 }
12224
12225 Transaction.DEFAULT_SEQUENCE = 0xffffffff
12226 Transaction.SIGHASH_ALL = 0x01
12227 Transaction.SIGHASH_NONE = 0x02
12228 Transaction.SIGHASH_SINGLE = 0x03
12229 Transaction.SIGHASH_ANYONECANPAY = 0x80
12230
12231 Transaction.fromBuffer = function (buffer, __disableAssert) {
12232 var offset = 0
12233 function readSlice (n) {
12234 offset += n
12235 return buffer.slice(offset - n, offset)
12236 }
12237
12238 function readUInt32 () {
12239 var i = buffer.readUInt32LE(offset)
12240 offset += 4
12241 return i
12242 }
12243
12244 function readUInt64 () {
12245 var i = bufferutils.readUInt64LE(buffer, offset)
12246 offset += 8
12247 return i
12248 }
12249
12250 function readVarInt () {
12251 var vi = bufferutils.readVarInt(buffer, offset)
12252 offset += vi.size
12253 return vi.number
12254 }
12255
12256 function readScript () {
12257 return Script.fromBuffer(readSlice(readVarInt()))
12258 }
12259
12260 function readGenerationScript () {
12261 return new Script(readSlice(readVarInt()), [])
12262 }
12263
12264 var tx = new Transaction()
12265 tx.version = readUInt32()
12266
12267 var vinLen = readVarInt()
12268 for (var i = 0; i < vinLen; ++i) {
12269 var hash = readSlice(32)
12270
12271 if (Transaction.isCoinbaseHash(hash)) {
12272 tx.ins.push({
12273 hash: hash,
12274 index: readUInt32(),
12275 script: readGenerationScript(),
12276 sequence: readUInt32()
12277 })
12278 } else {
12279 tx.ins.push({
12280 hash: hash,
12281 index: readUInt32(),
12282 script: readScript(),
12283 sequence: readUInt32()
12284 })
12285 }
12286 }
12287
12288 var voutLen = readVarInt()
12289 for (i = 0; i < voutLen; ++i) {
12290 tx.outs.push({
12291 value: readUInt64(),
12292 script: readScript()
12293 })
12294 }
12295
12296 tx.locktime = readUInt32()
12297
12298 if (!__disableAssert) {
12299 assert.equal(offset, buffer.length, 'Transaction has unexpected data')
12300 }
12301
12302 return tx
12303 }
12304
12305 Transaction.fromHex = function (hex) {
12306 return Transaction.fromBuffer(new Buffer(hex, 'hex'))
12307 }
12308
12309 Transaction.isCoinbaseHash = function (buffer) {
12310 return Array.prototype.every.call(buffer, function (x) {
12311 return x === 0
12312 })
12313 }
12314
12315 /**
12316 * Create a new txIn.
12317 *
12318 * Can be called with any of:
12319 *
12320 * - A transaction and an index
12321 * - A transaction hash and an index
12322 *
12323 * Note that this method does not sign the created input.
12324 */
12325 Transaction.prototype.addInput = function (hash, index, sequence, script) {
12326 if (sequence === undefined || sequence === null) {
12327 sequence = Transaction.DEFAULT_SEQUENCE
12328 }
12329
12330 script = script || Script.EMPTY
12331
12332 if (typeof hash === 'string') {
12333 // TxId hex is big-endian, we need little-endian
12334 hash = bufferutils.reverse(new Buffer(hash, 'hex'))
12335 } else if (hash instanceof Transaction) {
12336 hash = hash.getHash()
12337 }
12338
12339 typeForce('Buffer', hash)
12340 typeForce('Number', index)
12341 typeForce('Number', sequence)
12342 typeForce('Script', script)
12343
12344 assert.equal(hash.length, 32, 'Expected hash length of 32, got ' + hash.length)
12345
12346 // Add the input and return the input's index
12347 return (this.ins.push({
12348 hash: hash,
12349 index: index,
12350 script: script,
12351 sequence: sequence
12352 }) - 1)
12353 }
12354
12355 /**
12356 * Create a new txOut.
12357 *
12358 * Can be called with:
12359 *
12360 * - A base58 address string and a value
12361 * - An Address object and a value
12362 * - A scriptPubKey Script and a value
12363 */
12364 Transaction.prototype.addOutput = function (scriptPubKey, value) {
12365 // Attempt to get a valid address if it's a base58 address string
12366 if (typeof scriptPubKey === 'string') {
12367 scriptPubKey = Address.fromBase58Check(scriptPubKey)
12368 }
12369
12370 // Attempt to get a valid script if it's an Address object
12371 if (scriptPubKey instanceof Address) {
12372 scriptPubKey = scriptPubKey.toOutputScript()
12373 }
12374
12375 typeForce('Script', scriptPubKey)
12376 typeForce('Number', value)
12377
12378 // Add the output and return the output's index
12379 return (this.outs.push({
12380 script: scriptPubKey,
12381 value: value
12382 }) - 1)
12383 }
12384
12385 Transaction.prototype.clone = function () {
12386 var newTx = new Transaction()
12387 newTx.version = this.version
12388 newTx.locktime = this.locktime
12389
12390 newTx.ins = this.ins.map(function (txIn) {
12391 return {
12392 hash: txIn.hash,
12393 index: txIn.index,
12394 script: txIn.script,
12395 sequence: txIn.sequence
12396 }
12397 })
12398
12399 newTx.outs = this.outs.map(function (txOut) {
12400 return {
12401 script: txOut.script,
12402 value: txOut.value
12403 }
12404 })
12405
12406 return newTx
12407 }
12408
12409 /**
12410 * Hash transaction for signing a specific input.
12411 *
12412 * Bitcoin uses a different hash for each signed transaction input. This
12413 * method copies the transaction, makes the necessary changes based on the
12414 * hashType, serializes and finally hashes the result. This hash can then be
12415 * used to sign the transaction input in question.
12416 */
12417 Transaction.prototype.hashForSignature = function (inIndex, prevOutScript, hashType) {
12418 // FIXME: remove in 2.x.y
12419 if (arguments[0] instanceof Script) {
12420 console.warn('hashForSignature(prevOutScript, inIndex, ...) has been deprecated. Use hashForSignature(inIndex, prevOutScript, ...)')
12421
12422 // swap the arguments (must be stored in tmp, arguments is special)
12423 var tmp = arguments[0]
12424 inIndex = arguments[1]
12425 prevOutScript = tmp
12426 }
12427
12428 typeForce('Number', inIndex)
12429 typeForce('Script', prevOutScript)
12430 typeForce('Number', hashType)
12431
12432 assert(inIndex >= 0, 'Invalid vin index')
12433 assert(inIndex < this.ins.length, 'Invalid vin index')
12434
12435 var txTmp = this.clone()
12436 var hashScript = prevOutScript.without(opcodes.OP_CODESEPARATOR)
12437
12438 // Blank out other inputs' signatures
12439 txTmp.ins.forEach(function (txIn) {
12440 txIn.script = Script.EMPTY
12441 })
12442 txTmp.ins[inIndex].script = hashScript
12443
12444 var hashTypeModifier = hashType & 0x1f
12445
12446 if (hashTypeModifier === Transaction.SIGHASH_NONE) {
12447 assert(false, 'SIGHASH_NONE not yet supported')
12448 } else if (hashTypeModifier === Transaction.SIGHASH_SINGLE) {
12449 assert(false, 'SIGHASH_SINGLE not yet supported')
12450 }
12451
12452 if (hashType & Transaction.SIGHASH_ANYONECANPAY) {
12453 assert(false, 'SIGHASH_ANYONECANPAY not yet supported')
12454 }
12455
12456 var hashTypeBuffer = new Buffer(4)
12457 hashTypeBuffer.writeInt32LE(hashType, 0)
12458
12459 var buffer = Buffer.concat([txTmp.toBuffer(), hashTypeBuffer])
12460 return crypto.hash256(buffer)
12461 }
12462
12463 Transaction.prototype.getHash = function () {
12464 return crypto.hash256(this.toBuffer())
12465 }
12466
12467 Transaction.prototype.getId = function () {
12468 // TxHash is little-endian, we need big-endian
12469 return bufferutils.reverse(this.getHash()).toString('hex')
12470 }
12471
12472 Transaction.prototype.toBuffer = function () {
12473 function scriptSize (script) {
12474 var length = script.buffer.length
12475
12476 return bufferutils.varIntSize(length) + length
12477 }
12478
12479 var buffer = new Buffer(
12480 8 +
12481 bufferutils.varIntSize(this.ins.length) +
12482 bufferutils.varIntSize(this.outs.length) +
12483 this.ins.reduce(function (sum, input) { return sum + 40 + scriptSize(input.script) }, 0) +
12484 this.outs.reduce(function (sum, output) { return sum + 8 + scriptSize(output.script) }, 0)
12485 )
12486
12487 var offset = 0
12488 function writeSlice (slice) {
12489 slice.copy(buffer, offset)
12490 offset += slice.length
12491 }
12492
12493 function writeUInt32 (i) {
12494 buffer.writeUInt32LE(i, offset)
12495 offset += 4
12496 }
12497
12498 function writeUInt64 (i) {
12499 bufferutils.writeUInt64LE(buffer, i, offset)
12500 offset += 8
12501 }
12502
12503 function writeVarInt (i) {
12504 var n = bufferutils.writeVarInt(buffer, i, offset)
12505 offset += n
12506 }
12507
12508 writeUInt32(this.version)
12509 writeVarInt(this.ins.length)
12510
12511 this.ins.forEach(function (txIn) {
12512 writeSlice(txIn.hash)
12513 writeUInt32(txIn.index)
12514 writeVarInt(txIn.script.buffer.length)
12515 writeSlice(txIn.script.buffer)
12516 writeUInt32(txIn.sequence)
12517 })
12518
12519 writeVarInt(this.outs.length)
12520 this.outs.forEach(function (txOut) {
12521 writeUInt64(txOut.value)
12522 writeVarInt(txOut.script.buffer.length)
12523 writeSlice(txOut.script.buffer)
12524 })
12525
12526 writeUInt32(this.locktime)
12527
12528 return buffer
12529 }
12530
12531 Transaction.prototype.toHex = function () {
12532 return this.toBuffer().toString('hex')
12533 }
12534
12535 Transaction.prototype.setInputScript = function (index, script) {
12536 typeForce('Number', index)
12537 typeForce('Script', script)
12538
12539 this.ins[index].script = script
12540 }
12541
12542 // FIXME: remove in 2.x.y
12543 Transaction.prototype.sign = function (index, privKey, hashType) {
12544 console.warn('Transaction.prototype.sign is deprecated. Use TransactionBuilder instead.')
12545
12546 var prevOutScript = privKey.pub.getAddress().toOutputScript()
12547 var signature = this.signInput(index, prevOutScript, privKey, hashType)
12548
12549 var scriptSig = scripts.pubKeyHashInput(signature, privKey.pub)
12550 this.setInputScript(index, scriptSig)
12551 }
12552
12553 // FIXME: remove in 2.x.y
12554 Transaction.prototype.signInput = function (index, prevOutScript, privKey, hashType) {
12555 console.warn('Transaction.prototype.signInput is deprecated. Use TransactionBuilder instead.')
12556
12557 hashType = hashType || Transaction.SIGHASH_ALL
12558
12559 var hash = this.hashForSignature(index, prevOutScript, hashType)
12560 var signature = privKey.sign(hash)
12561
12562 return signature.toScriptSignature(hashType)
12563 }
12564
12565 // FIXME: remove in 2.x.y
12566 Transaction.prototype.validateInput = function (index, prevOutScript, pubKey, buffer) {
12567 console.warn('Transaction.prototype.validateInput is deprecated. Use TransactionBuilder instead.')
12568
12569 var parsed = ECSignature.parseScriptSignature(buffer)
12570 var hash = this.hashForSignature(index, prevOutScript, parsed.hashType)
12571
12572 return pubKey.verify(hash, parsed.signature)
12573 }
12574
12575 module.exports = Transaction
12576
12577 }).call(this,require("buffer").Buffer)
12578 },{"./address":54,"./bufferutils":57,"./crypto":58,"./ecsignature":62,"./opcodes":67,"./script":68,"./scripts":69,"assert":5,"buffer":7,"typeforce":53}],71:[function(require,module,exports){
12579 (function (Buffer){
12580 var assert = require('assert')
12581 var ops = require('./opcodes')
12582 var scripts = require('./scripts')
12583
12584 var ECPubKey = require('./ecpubkey')
12585 var ECSignature = require('./ecsignature')
12586 var Script = require('./script')
12587 var Transaction = require('./transaction')
12588
12589 function extractInput (txIn) {
12590 var redeemScript
12591 var scriptSig = txIn.script
12592 var prevOutScript
12593 var prevOutType = scripts.classifyInput(scriptSig, true)
12594 var scriptType
12595
12596 // Re-classify if scriptHash
12597 if (prevOutType === 'scripthash') {
12598 redeemScript = Script.fromBuffer(scriptSig.chunks.slice(-1)[0])
12599 prevOutScript = scripts.scriptHashOutput(redeemScript.getHash())
12600
12601 scriptSig = Script.fromChunks(scriptSig.chunks.slice(0, -1))
12602 scriptType = scripts.classifyInput(scriptSig, true)
12603 } else {
12604 scriptType = prevOutType
12605 }
12606
12607 // Extract hashType, pubKeys and signatures
12608 var hashType, parsed, pubKeys, signatures
12609
12610 switch (scriptType) {
12611 case 'pubkeyhash': {
12612 parsed = ECSignature.parseScriptSignature(scriptSig.chunks[0])
12613 hashType = parsed.hashType
12614 pubKeys = [ECPubKey.fromBuffer(scriptSig.chunks[1])]
12615 signatures = [parsed.signature]
12616 prevOutScript = pubKeys[0].getAddress().toOutputScript()
12617
12618 break
12619 }
12620
12621 case 'pubkey': {
12622 parsed = ECSignature.parseScriptSignature(scriptSig.chunks[0])
12623 hashType = parsed.hashType
12624 signatures = [parsed.signature]
12625
12626 if (redeemScript) {
12627 pubKeys = [ECPubKey.fromBuffer(redeemScript.chunks[0])]
12628 }
12629
12630 break
12631 }
12632
12633 case 'multisig': {
12634 signatures = scriptSig.chunks.slice(1).map(function (chunk) {
12635 if (chunk === ops.OP_0) return chunk
12636
12637 var parsed = ECSignature.parseScriptSignature(chunk)
12638 hashType = parsed.hashType
12639
12640 return parsed.signature
12641 })
12642
12643 if (redeemScript) {
12644 pubKeys = redeemScript.chunks.slice(1, -2).map(ECPubKey.fromBuffer)
12645 }
12646
12647 break
12648 }
12649 }
12650
12651 return {
12652 hashType: hashType,
12653 prevOutScript: prevOutScript,
12654 prevOutType: prevOutType,
12655 pubKeys: pubKeys,
12656 redeemScript: redeemScript,
12657 scriptType: scriptType,
12658 signatures: signatures
12659 }
12660 }
12661
12662 function TransactionBuilder () {
12663 this.prevTxMap = {}
12664 this.prevOutScripts = {}
12665 this.prevOutTypes = {}
12666
12667 this.inputs = []
12668 this.tx = new Transaction()
12669 }
12670
12671 TransactionBuilder.fromTransaction = function (transaction) {
12672 var txb = new TransactionBuilder()
12673
12674 // Copy other transaction fields
12675 txb.tx.version = transaction.version
12676 txb.tx.locktime = transaction.locktime
12677
12678 // Extract/add inputs
12679 transaction.ins.forEach(function (txIn) {
12680 txb.addInput(txIn.hash, txIn.index, txIn.sequence)
12681 })
12682
12683 // Extract/add outputs
12684 transaction.outs.forEach(function (txOut) {
12685 txb.addOutput(txOut.script, txOut.value)
12686 })
12687
12688 // Extract/add signatures
12689 txb.inputs = transaction.ins.map(function (txIn) {
12690 // TODO: remove me after testcase added
12691 assert(!Transaction.isCoinbaseHash(txIn.hash), 'coinbase inputs not supported')
12692
12693 // Ignore empty scripts
12694 if (txIn.script.buffer.length === 0) return {}
12695
12696 return extractInput(txIn)
12697 })
12698
12699 return txb
12700 }
12701
12702 TransactionBuilder.prototype.addInput = function (prevTx, index, sequence, prevOutScript) {
12703 var prevOutHash
12704
12705 // txId
12706 if (typeof prevTx === 'string') {
12707 prevOutHash = new Buffer(prevTx, 'hex')
12708
12709 // TxId hex is big-endian, we want little-endian hash
12710 Array.prototype.reverse.call(prevOutHash)
12711
12712 // Transaction
12713 } else if (prevTx instanceof Transaction) {
12714 prevOutHash = prevTx.getHash()
12715 prevOutScript = prevTx.outs[index].script
12716
12717 // txHash
12718 } else {
12719 prevOutHash = prevTx
12720 }
12721
12722 var input = {}
12723 if (prevOutScript) {
12724 var prevOutType = scripts.classifyOutput(prevOutScript)
12725
12726 // if we can, extract pubKey information
12727 switch (prevOutType) {
12728 case 'multisig': {
12729 input.pubKeys = prevOutScript.chunks.slice(1, -2).map(ECPubKey.fromBuffer)
12730 break
12731 }
12732
12733 case 'pubkey': {
12734 input.pubKeys = prevOutScript.chunks.slice(0, 1).map(ECPubKey.fromBuffer)
12735 break
12736 }
12737 }
12738
12739 if (prevOutType !== 'scripthash') {
12740 input.scriptType = prevOutType
12741 }
12742
12743 input.prevOutScript = prevOutScript
12744 input.prevOutType = prevOutType
12745 }
12746
12747 assert(this.inputs.every(function (input2) {
12748 if (input2.hashType === undefined) return true
12749
12750 return input2.hashType & Transaction.SIGHASH_ANYONECANPAY
12751 }), 'No, this would invalidate signatures')
12752
12753 var prevOut = prevOutHash.toString('hex') + ':' + index
12754 assert(!(prevOut in this.prevTxMap), 'Transaction is already an input')
12755
12756 var vin = this.tx.addInput(prevOutHash, index, sequence)
12757 this.inputs[vin] = input
12758 this.prevTxMap[prevOut] = vin
12759
12760 return vin
12761 }
12762
12763 TransactionBuilder.prototype.addOutput = function (scriptPubKey, value) {
12764 assert(this.inputs.every(function (input) {
12765 if (input.hashType === undefined) return true
12766
12767 return (input.hashType & 0x1f) === Transaction.SIGHASH_SINGLE
12768 }), 'No, this would invalidate signatures')
12769
12770 return this.tx.addOutput(scriptPubKey, value)
12771 }
12772
12773 TransactionBuilder.prototype.build = function () {
12774 return this.__build(false)
12775 }
12776 TransactionBuilder.prototype.buildIncomplete = function () {
12777 return this.__build(true)
12778 }
12779
12780 var canSignTypes = {
12781 'pubkeyhash': true,
12782 'multisig': true,
12783 'pubkey': true
12784 }
12785
12786 TransactionBuilder.prototype.__build = function (allowIncomplete) {
12787 if (!allowIncomplete) {
12788 assert(this.tx.ins.length > 0, 'Transaction has no inputs')
12789 assert(this.tx.outs.length > 0, 'Transaction has no outputs')
12790 }
12791
12792 var tx = this.tx.clone()
12793
12794 // Create script signatures from signature meta-data
12795 this.inputs.forEach(function (input, index) {
12796 var scriptType = input.scriptType
12797 var scriptSig
12798
12799 if (!allowIncomplete) {
12800 assert(!!scriptType, 'Transaction is not complete')
12801 assert(scriptType in canSignTypes, scriptType + ' not supported')
12802 assert(input.signatures, 'Transaction is missing signatures')
12803 }
12804
12805 if (input.signatures) {
12806 switch (scriptType) {
12807 case 'pubkeyhash': {
12808 var pkhSignature = input.signatures[0].toScriptSignature(input.hashType)
12809 scriptSig = scripts.pubKeyHashInput(pkhSignature, input.pubKeys[0])
12810 break
12811 }
12812
12813 case 'multisig': {
12814 // Array.prototype.map is sparse-compatible
12815 var msSignatures = input.signatures.map(function (signature) {
12816 return signature && signature.toScriptSignature(input.hashType)
12817 })
12818
12819 // fill in blanks with OP_0
12820 if (allowIncomplete) {
12821 for (var i = 0; i < msSignatures.length; ++i) {
12822 if (msSignatures[i]) continue
12823
12824 msSignatures[i] = ops.OP_0
12825 }
12826 } else {
12827 // Array.prototype.filter returns non-sparse array
12828 msSignatures = msSignatures.filter(function (x) { return x })
12829 }
12830
12831 var redeemScript = allowIncomplete ? undefined : input.redeemScript
12832 scriptSig = scripts.multisigInput(msSignatures, redeemScript)
12833 break
12834 }
12835
12836 case 'pubkey': {
12837 var pkSignature = input.signatures[0].toScriptSignature(input.hashType)
12838 scriptSig = scripts.pubKeyInput(pkSignature)
12839 break
12840 }
12841 }
12842 }
12843
12844 // did we build a scriptSig?
12845 if (scriptSig) {
12846 // wrap as scriptHash if necessary
12847 if (input.prevOutType === 'scripthash') {
12848 scriptSig = scripts.scriptHashInput(scriptSig, input.redeemScript)
12849 }
12850
12851 tx.setInputScript(index, scriptSig)
12852 }
12853 })
12854
12855 return tx
12856 }
12857
12858 TransactionBuilder.prototype.sign = function (index, privKey, redeemScript, hashType) {
12859 assert(index in this.inputs, 'No input at index: ' + index)
12860 hashType = hashType || Transaction.SIGHASH_ALL
12861
12862 var input = this.inputs[index]
12863 var canSign = input.hashType &&
12864 input.prevOutScript &&
12865 input.prevOutType &&
12866 input.pubKeys &&
12867 input.scriptType &&
12868 input.signatures
12869
12870 // are we almost ready to sign?
12871 if (canSign) {
12872 // if redeemScript was provided, enforce consistency
12873 if (redeemScript) {
12874 assert.deepEqual(input.redeemScript, redeemScript, 'Inconsistent redeemScript')
12875 }
12876
12877 assert.equal(input.hashType, hashType, 'Inconsistent hashType')
12878
12879 // no? prepare
12880 } else {
12881 // must be pay-to-scriptHash?
12882 if (redeemScript) {
12883 // if we have a prevOutScript, enforce scriptHash equality to the redeemScript
12884 if (input.prevOutScript) {
12885 assert.equal(input.prevOutType, 'scripthash', 'PrevOutScript must be P2SH')
12886
12887 var scriptHash = input.prevOutScript.chunks[1]
12888 assert.deepEqual(scriptHash, redeemScript.getHash(), 'RedeemScript does not match ' + scriptHash.toString('hex'))
12889 }
12890
12891 var scriptType = scripts.classifyOutput(redeemScript)
12892 assert(scriptType in canSignTypes, 'RedeemScript not supported (' + scriptType + ')')
12893
12894 var pubKeys = []
12895 switch (scriptType) {
12896 case 'multisig': {
12897 pubKeys = redeemScript.chunks.slice(1, -2).map(ECPubKey.fromBuffer)
12898 break
12899 }
12900
12901 case 'pubkeyhash': {
12902 var pkh1 = redeemScript.chunks[2]
12903 var pkh2 = privKey.pub.getAddress().hash
12904
12905 assert.deepEqual(pkh1, pkh2, 'privateKey cannot sign for this input')
12906 pubKeys = [privKey.pub]
12907 break
12908 }
12909
12910 case 'pubkey': {
12911 pubKeys = redeemScript.chunks.slice(0, 1).map(ECPubKey.fromBuffer)
12912 break
12913 }
12914 }
12915
12916 if (!input.prevOutScript) {
12917 input.prevOutScript = scripts.scriptHashOutput(redeemScript.getHash())
12918 input.prevOutType = 'scripthash'
12919 }
12920
12921 input.pubKeys = pubKeys
12922 input.redeemScript = redeemScript
12923 input.scriptType = scriptType
12924
12925 // cannot be pay-to-scriptHash
12926 } else {
12927 assert.notEqual(input.prevOutType, 'scripthash', 'PrevOutScript is P2SH, missing redeemScript')
12928
12929 // can we otherwise sign this?
12930 if (input.scriptType) {
12931 assert(input.pubKeys, input.scriptType + ' not supported')
12932
12933 // we know nothin' Jon Snow, assume pubKeyHash
12934 } else {
12935 input.prevOutScript = privKey.pub.getAddress().toOutputScript()
12936 input.prevOutType = 'pubkeyhash'
12937 input.pubKeys = [privKey.pub]
12938 input.scriptType = input.prevOutType
12939 }
12940 }
12941
12942 input.hashType = hashType
12943 input.signatures = input.signatures || []
12944 }
12945
12946 var signatureScript = input.redeemScript || input.prevOutScript
12947 var signatureHash = this.tx.hashForSignature(index, signatureScript, hashType)
12948
12949 // enforce signature order matches public keys
12950 if (input.scriptType === 'multisig' && input.redeemScript && input.signatures.length !== input.pubKeys.length) {
12951 // maintain a local copy of unmatched signatures
12952 var unmatched = input.signatures.slice()
12953
12954 input.signatures = input.pubKeys.map(function (pubKey) {
12955 var match
12956
12957 // check for any matching signatures
12958 unmatched.some(function (signature, i) {
12959 if (!pubKey.verify(signatureHash, signature)) return false
12960 match = signature
12961
12962 // remove matched signature from unmatched
12963 unmatched.splice(i, 1)
12964
12965 return true
12966 })
12967
12968 return match || undefined
12969 })
12970 }
12971
12972 // enforce in order signing of public keys
12973 assert(input.pubKeys.some(function (pubKey, i) {
12974 if (!privKey.pub.Q.equals(pubKey.Q)) return false
12975
12976 assert(!input.signatures[i], 'Signature already exists')
12977 var signature = privKey.sign(signatureHash)
12978 input.signatures[i] = signature
12979
12980 return true
12981 }, this), 'privateKey cannot sign for this input')
12982 }
12983
12984 module.exports = TransactionBuilder
12985
12986 }).call(this,require("buffer").Buffer)
12987 },{"./ecpubkey":61,"./ecsignature":62,"./opcodes":67,"./script":68,"./scripts":69,"./transaction":70,"assert":5,"buffer":7}],72:[function(require,module,exports){
12988 (function (Buffer){
12989 var assert = require('assert')
12990 var bufferutils = require('./bufferutils')
12991 var typeForce = require('typeforce')
12992 var networks = require('./networks')
12993 var randomBytes = require('randombytes')
12994
12995 var Address = require('./address')
12996 var HDNode = require('./hdnode')
12997 var TransactionBuilder = require('./transaction_builder')
12998 var Script = require('./script')
12999
13000 function Wallet (seed, network) {
13001 console.warn('Wallet is deprecated and will be removed in 2.0.0, see #296')
13002
13003 seed = seed || randomBytes(32)
13004 network = network || networks.bitcoin
13005
13006 // Stored in a closure to make accidental serialization less likely
13007 var masterKey = HDNode.fromSeedBuffer(seed, network)
13008
13009 // HD first-level child derivation method should be hardened
13010 // See https://bitcointalk.org/index.php?topic=405179.msg4415254#msg4415254
13011 var accountZero = masterKey.deriveHardened(0)
13012 var externalAccount = accountZero.derive(0)
13013 var internalAccount = accountZero.derive(1)
13014
13015 this.addresses = []
13016 this.changeAddresses = []
13017 this.network = network
13018 this.unspents = []
13019
13020 // FIXME: remove in 2.0.0
13021 this.unspentMap = {}
13022
13023 // FIXME: remove in 2.0.0
13024 var me = this
13025 this.newMasterKey = function (seed) {
13026 console.warn('newMasterKey is deprecated, please make a new Wallet instance instead')
13027
13028 seed = seed || randomBytes(32)
13029 masterKey = HDNode.fromSeedBuffer(seed, network)
13030
13031 accountZero = masterKey.deriveHardened(0)
13032 externalAccount = accountZero.derive(0)
13033 internalAccount = accountZero.derive(1)
13034
13035 me.addresses = []
13036 me.changeAddresses = []
13037
13038 me.unspents = []
13039 me.unspentMap = {}
13040 }
13041
13042 this.getMasterKey = function () {
13043 return masterKey
13044 }
13045 this.getAccountZero = function () {
13046 return accountZero
13047 }
13048 this.getExternalAccount = function () {
13049 return externalAccount
13050 }
13051 this.getInternalAccount = function () {
13052 return internalAccount
13053 }
13054 }
13055
13056 Wallet.prototype.createTransaction = function (to, value, options) {
13057 // FIXME: remove in 2.0.0
13058 if (typeof options !== 'object') {
13059 if (options !== undefined) {
13060 console.warn('Non options object parameters are deprecated, use options object instead')
13061
13062 options = {
13063 fixedFee: arguments[2],
13064 changeAddress: arguments[3]
13065 }
13066 }
13067 }
13068
13069 options = options || {}
13070
13071 assert(value > this.network.dustThreshold, value + ' must be above dust threshold (' + this.network.dustThreshold + ' Satoshis)')
13072
13073 var changeAddress = options.changeAddress
13074 var fixedFee = options.fixedFee
13075 var minConf = options.minConf === undefined ? 0 : options.minConf // FIXME: change minConf:1 by default in 2.0.0
13076
13077 // filter by minConf, then pending and sort by descending value
13078 var unspents = this.unspents.filter(function (unspent) {
13079 return unspent.confirmations >= minConf
13080 }).filter(function (unspent) {
13081 return !unspent.pending
13082 }).sort(function (o1, o2) {
13083 return o2.value - o1.value
13084 })
13085
13086 var accum = 0
13087 var addresses = []
13088 var subTotal = value
13089
13090 var txb = new TransactionBuilder()
13091 txb.addOutput(to, value)
13092
13093 for (var i = 0; i < unspents.length; ++i) {
13094 var unspent = unspents[i]
13095 addresses.push(unspent.address)
13096
13097 txb.addInput(unspent.txHash, unspent.index)
13098
13099 var fee = fixedFee === undefined ? estimatePaddedFee(txb.buildIncomplete(), this.network) : fixedFee
13100
13101 accum += unspent.value
13102 subTotal = value + fee
13103
13104 if (accum >= subTotal) {
13105 var change = accum - subTotal
13106
13107 if (change > this.network.dustThreshold) {
13108 txb.addOutput(changeAddress || this.getChangeAddress(), change)
13109 }
13110
13111 break
13112 }
13113 }
13114
13115 assert(accum >= subTotal, 'Not enough funds (incl. fee): ' + accum + ' < ' + subTotal)
13116
13117 return this.signWith(txb, addresses).build()
13118 }
13119
13120 // FIXME: remove in 2.0.0
13121 Wallet.prototype.processPendingTx = function (tx) {
13122 this.__processTx(tx, true)
13123 }
13124
13125 // FIXME: remove in 2.0.0
13126 Wallet.prototype.processConfirmedTx = function (tx) {
13127 this.__processTx(tx, false)
13128 }
13129
13130 // FIXME: remove in 2.0.0
13131 Wallet.prototype.__processTx = function (tx, isPending) {
13132 console.warn('processTransaction is considered harmful, see issue #260 for more information')
13133
13134 var txId = tx.getId()
13135 var txHash = tx.getHash()
13136
13137 tx.outs.forEach(function (txOut, i) {
13138 var address
13139
13140 try {
13141 address = Address.fromOutputScript(txOut.script, this.network).toString()
13142 } catch (e) {
13143 if (!(e.message.match(/has no matching Address/)))
13144 throw e
13145 }
13146
13147 var myAddresses = this.addresses.concat(this.changeAddresses)
13148 if (myAddresses.indexOf(address) > -1) {
13149 var lookup = txId + ':' + i
13150 if (lookup in this.unspentMap) return
13151
13152 // its unique, add it
13153 var unspent = {
13154 address: address,
13155 confirmations: 0, // no way to determine this without more information
13156 index: i,
13157 txHash: txHash,
13158 txId: txId,
13159 value: txOut.value,
13160 pending: isPending
13161 }
13162
13163 this.unspentMap[lookup] = unspent
13164 this.unspents.push(unspent)
13165 }
13166 }, this)
13167
13168 tx.ins.forEach(function (txIn) {
13169 // copy and convert to big-endian hex
13170 var txInId = bufferutils.reverse(txIn.hash).toString('hex')
13171
13172 var lookup = txInId + ':' + txIn.index
13173 if (!(lookup in this.unspentMap)) return
13174
13175 var unspent = this.unspentMap[lookup]
13176
13177 if (isPending) {
13178 unspent.pending = true
13179 unspent.spent = true
13180 } else {
13181 delete this.unspentMap[lookup]
13182
13183 this.unspents = this.unspents.filter(function (unspent2) {
13184 return unspent !== unspent2
13185 })
13186 }
13187 }, this)
13188 }
13189
13190 Wallet.prototype.generateAddress = function () {
13191 var k = this.addresses.length
13192 var address = this.getExternalAccount().derive(k).getAddress()
13193
13194 this.addresses.push(address.toString())
13195
13196 return this.getReceiveAddress()
13197 }
13198
13199 Wallet.prototype.generateChangeAddress = function () {
13200 var k = this.changeAddresses.length
13201 var address = this.getInternalAccount().derive(k).getAddress()
13202
13203 this.changeAddresses.push(address.toString())
13204
13205 return this.getChangeAddress()
13206 }
13207
13208 Wallet.prototype.getAddress = function () {
13209 if (this.addresses.length === 0) {
13210 this.generateAddress()
13211 }
13212
13213 return this.addresses[this.addresses.length - 1]
13214 }
13215
13216 Wallet.prototype.getBalance = function (minConf) {
13217 minConf = minConf || 0
13218
13219 return this.unspents.filter(function (unspent) {
13220 return unspent.confirmations >= minConf
13221
13222 // FIXME: remove spent filter in 2.0.0
13223 }).filter(function (unspent) {
13224 return !unspent.spent
13225 }).reduce(function (accum, unspent) {
13226 return accum + unspent.value
13227 }, 0)
13228 }
13229
13230 Wallet.prototype.getChangeAddress = function () {
13231 if (this.changeAddresses.length === 0) {
13232 this.generateChangeAddress()
13233 }
13234
13235 return this.changeAddresses[this.changeAddresses.length - 1]
13236 }
13237
13238 Wallet.prototype.getInternalPrivateKey = function (index) {
13239 return this.getInternalAccount().derive(index).privKey
13240 }
13241
13242 Wallet.prototype.getPrivateKey = function (index) {
13243 return this.getExternalAccount().derive(index).privKey
13244 }
13245
13246 Wallet.prototype.getPrivateKeyForAddress = function (address) {
13247 var index
13248
13249 if ((index = this.addresses.indexOf(address)) > -1) {
13250 return this.getPrivateKey(index)
13251 }
13252
13253 if ((index = this.changeAddresses.indexOf(address)) > -1) {
13254 return this.getInternalPrivateKey(index)
13255 }
13256
13257 assert(false, 'Unknown address. Make sure the address is from the keychain and has been generated')
13258 }
13259
13260 Wallet.prototype.getUnspentOutputs = function (minConf) {
13261 minConf = minConf || 0
13262
13263 return this.unspents.filter(function (unspent) {
13264 return unspent.confirmations >= minConf
13265
13266 // FIXME: remove spent filter in 2.0.0
13267 }).filter(function (unspent) {
13268 return !unspent.spent
13269 }).map(function (unspent) {
13270 return {
13271 address: unspent.address,
13272 confirmations: unspent.confirmations,
13273 index: unspent.index,
13274 txId: unspent.txId,
13275 value: unspent.value,
13276
13277 // FIXME: remove in 2.0.0
13278 hash: unspent.txId,
13279 pending: unspent.pending
13280 }
13281 })
13282 }
13283
13284 Wallet.prototype.setUnspentOutputs = function (unspents) {
13285 this.unspentMap = {}
13286 this.unspents = unspents.map(function (unspent) {
13287 // FIXME: remove unspent.hash in 2.0.0
13288 var txId = unspent.txId || unspent.hash
13289 var index = unspent.index
13290
13291 // FIXME: remove in 2.0.0
13292 if (unspent.hash !== undefined) {
13293 console.warn('unspent.hash is deprecated, use unspent.txId instead')
13294 }
13295
13296 // FIXME: remove in 2.0.0
13297 if (index === undefined) {
13298 console.warn('unspent.outputIndex is deprecated, use unspent.index instead')
13299 index = unspent.outputIndex
13300 }
13301
13302 typeForce('String', txId)
13303 typeForce('Number', index)
13304 typeForce('Number', unspent.value)
13305
13306 assert.equal(txId.length, 64, 'Expected valid txId, got ' + txId)
13307 assert.doesNotThrow(function () {
13308 Address.fromBase58Check(unspent.address)
13309 }, 'Expected Base58 Address, got ' + unspent.address)
13310 assert(isFinite(index), 'Expected finite index, got ' + index)
13311
13312 // FIXME: remove branch in 2.0.0
13313 if (unspent.confirmations !== undefined) {
13314 typeForce('Number', unspent.confirmations)
13315 }
13316
13317 var txHash = bufferutils.reverse(new Buffer(txId, 'hex'))
13318
13319 unspent = {
13320 address: unspent.address,
13321 confirmations: unspent.confirmations || 0,
13322 index: index,
13323 txHash: txHash,
13324 txId: txId,
13325 value: unspent.value,
13326
13327 // FIXME: remove in 2.0.0
13328 pending: unspent.pending || false
13329 }
13330
13331 // FIXME: remove in 2.0.0
13332 this.unspentMap[txId + ':' + index] = unspent
13333
13334 return unspent
13335 }, this)
13336 }
13337
13338 Wallet.prototype.signWith = function (tx, addresses) {
13339 addresses.forEach(function (address, i) {
13340 var privKey = this.getPrivateKeyForAddress(address)
13341
13342 tx.sign(i, privKey)
13343 }, this)
13344
13345 return tx
13346 }
13347
13348 function estimatePaddedFee (tx, network) {
13349 var tmpTx = tx.clone()
13350 tmpTx.addOutput(Script.EMPTY, network.dustSoftThreshold || 0)
13351
13352 return network.estimateFee(tmpTx)
13353 }
13354
13355 // FIXME: 1.0.0 shims, remove in 2.0.0
13356 Wallet.prototype.getReceiveAddress = Wallet.prototype.getAddress
13357 Wallet.prototype.createTx = Wallet.prototype.createTransaction
13358
13359 module.exports = Wallet
13360
13361 }).call(this,require("buffer").Buffer)
13362 },{"./address":54,"./bufferutils":57,"./hdnode":63,"./networks":66,"./script":68,"./transaction_builder":71,"assert":5,"buffer":7,"randombytes":52,"typeforce":53}]},{},[64])(64)
13363 });</script>
13364 <script>bitcoin.networks.shadow = {
13365 magicPrefix: '\x19ShadowCash Signed Message:\n',
13366 bip32: {
13367 public: 0xEE80286A,
13368 private: 0xEE8031E8
13369 },
13370 pubKeyHash: 0x3f,
13371 scriptHash: 0x7d,
13372 wif: 0xbf,
13373 dustThreshold: 0,
13374 feePerKb: 1000,
13375 estimateFee: function() { return "unused in this app" },
13376 };
13377
13378 bitcoin.networks.shadowtn = {
13379 magicPrefix: '\x19ShadowCash Signed Message:\n',
13380 bip32: {
13381 public: 0x76C0FDFB,
13382 private: 0x76C1077A
13383 },
13384 pubKeyHash: 0x7f,
13385 scriptHash: 0xc4,
13386 wif: 0xff,
13387 dustThreshold: 0,
13388 feePerKb: 1000,
13389 estimateFee: function() { return "unused in this app" },
13390 };
13391
13392 bitcoin.networks.clam = {
13393 bip32: {
13394 public: 0xa8c26d64,
13395 private: 0xa8c17826
13396 },
13397 pubKeyHash: 0x89,
13398 wif: 0x85,
13399 };
13400
13401 bitcoin.networks.dash = {
13402 bip32: {
13403 public: 0x0488b21e,
13404 private: 0x0488ade4
13405 },
13406 pubKeyHash: 0x4c,
13407 scriptHash: 0x10,
13408 wif: 0xcc,
13409 };
13410
13411 bitcoin.networks.namecoin = {
13412 bip32: {
13413 public: 0x0488b21e,
13414 private: 0x0488ade4
13415 },
13416 pubKeyHash: 0x34,
13417 //scriptHash: 0x10,
13418 wif: 0x80,
13419 };
13420
13421 bitcoin.networks.peercoin = {
13422 bip32: {
13423 public: 0x0488b21e,
13424 private: 0x0488ade4
13425 },
13426 pubKeyHash: 0x37,
13427 //scriptHash: 0x10,
13428 wif: 0xb7,
13429 };
13430
13431 </script>
13432 <script>// Select components from sjcl to suit the crypto operations bip39 requires.
13433
13434 //// base.js
13435
13436 /** @fileOverview Javascript cryptography implementation.
13437 *
13438 * Crush to remove comments, shorten variable names and
13439 * generally reduce transmission size.
13440 *
13441 * @author Emily Stark
13442 * @author Mike Hamburg
13443 * @author Dan Boneh
13444 */
13445
13446 "use strict";
13447 /*jslint indent: 2, bitwise: false, nomen: false, plusplus: false, white: false, regexp: false */
13448 /*global document, window, escape, unescape, module, require, Uint32Array */
13449
13450 /** @namespace The Stanford Javascript Crypto Library, top-level namespace. */
13451 var sjcl = {
13452 /** @namespace Symmetric ciphers. */
13453 cipher: {},
13454
13455 /** @namespace Hash functions. Right now only SHA256 is implemented. */
13456 hash: {},
13457
13458 /** @namespace Key exchange functions. Right now only SRP is implemented. */
13459 keyexchange: {},
13460
13461 /** @namespace Block cipher modes of operation. */
13462 mode: {},
13463
13464 /** @namespace Miscellaneous. HMAC and PBKDF2. */
13465 misc: {},
13466
13467 /**
13468 * @namespace Bit array encoders and decoders.
13469 *
13470 * @description
13471 * The members of this namespace are functions which translate between
13472 * SJCL's bitArrays and other objects (usually strings). Because it
13473 * isn't always clear which direction is encoding and which is decoding,
13474 * the method names are "fromBits" and "toBits".
13475 */
13476 codec: {},
13477
13478 /** @namespace Exceptions. */
13479 exception: {
13480 /** @constructor Ciphertext is corrupt. */
13481 corrupt: function(message) {
13482 this.toString = function() { return "CORRUPT: "+this.message; };
13483 this.message = message;
13484 },
13485
13486 /** @constructor Invalid parameter. */
13487 invalid: function(message) {
13488 this.toString = function() { return "INVALID: "+this.message; };
13489 this.message = message;
13490 },
13491
13492 /** @constructor Bug or missing feature in SJCL. @constructor */
13493 bug: function(message) {
13494 this.toString = function() { return "BUG: "+this.message; };
13495 this.message = message;
13496 },
13497
13498 /** @constructor Something isn't ready. */
13499 notReady: function(message) {
13500 this.toString = function() { return "NOT READY: "+this.message; };
13501 this.message = message;
13502 }
13503 }
13504 };
13505
13506 if(typeof module !== 'undefined' && module.exports){
13507 module.exports = sjcl;
13508 }
13509 if (typeof define === "function") {
13510 define([], function () {
13511 return sjcl;
13512 });
13513 }
13514
13515
13516 //// bitArray.js
13517
13518 /** @fileOverview Arrays of bits, encoded as arrays of Numbers.
13519 *
13520 * @author Emily Stark
13521 * @author Mike Hamburg
13522 * @author Dan Boneh
13523 */
13524
13525 /** @namespace Arrays of bits, encoded as arrays of Numbers.
13526 *
13527 * @description
13528 * <p>
13529 * These objects are the currency accepted by SJCL's crypto functions.
13530 * </p>
13531 *
13532 * <p>
13533 * Most of our crypto primitives operate on arrays of 4-byte words internally,
13534 * but many of them can take arguments that are not a multiple of 4 bytes.
13535 * This library encodes arrays of bits (whose size need not be a multiple of 8
13536 * bits) as arrays of 32-bit words. The bits are packed, big-endian, into an
13537 * array of words, 32 bits at a time. Since the words are double-precision
13538 * floating point numbers, they fit some extra data. We use this (in a private,
13539 * possibly-changing manner) to encode the number of bits actually present
13540 * in the last word of the array.
13541 * </p>
13542 *
13543 * <p>
13544 * Because bitwise ops clear this out-of-band data, these arrays can be passed
13545 * to ciphers like AES which want arrays of words.
13546 * </p>
13547 */
13548 sjcl.bitArray = {
13549 /**
13550 * Array slices in units of bits.
13551 * @param {bitArray} a The array to slice.
13552 * @param {Number} bstart The offset to the start of the slice, in bits.
13553 * @param {Number} bend The offset to the end of the slice, in bits. If this is undefined,
13554 * slice until the end of the array.
13555 * @return {bitArray} The requested slice.
13556 */
13557 bitSlice: function (a, bstart, bend) {
13558 a = sjcl.bitArray._shiftRight(a.slice(bstart/32), 32 - (bstart & 31)).slice(1);
13559 return (bend === undefined) ? a : sjcl.bitArray.clamp(a, bend-bstart);
13560 },
13561
13562 /**
13563 * Extract a number packed into a bit array.
13564 * @param {bitArray} a The array to slice.
13565 * @param {Number} bstart The offset to the start of the slice, in bits.
13566 * @param {Number} length The length of the number to extract.
13567 * @return {Number} The requested slice.
13568 */
13569 extract: function(a, bstart, blength) {
13570 // FIXME: this Math.floor is not necessary at all, but for some reason
13571 // seems to suppress a bug in the Chromium JIT.
13572 var x, sh = Math.floor((-bstart-blength) & 31);
13573 if ((bstart + blength - 1 ^ bstart) & -32) {
13574 // it crosses a boundary
13575 x = (a[bstart/32|0] << (32 - sh)) ^ (a[bstart/32+1|0] >>> sh);
13576 } else {
13577 // within a single word
13578 x = a[bstart/32|0] >>> sh;
13579 }
13580 return x & ((1<<blength) - 1);
13581 },
13582
13583 /**
13584 * Concatenate two bit arrays.
13585 * @param {bitArray} a1 The first array.
13586 * @param {bitArray} a2 The second array.
13587 * @return {bitArray} The concatenation of a1 and a2.
13588 */
13589 concat: function (a1, a2) {
13590 if (a1.length === 0 || a2.length === 0) {
13591 return a1.concat(a2);
13592 }
13593
13594 var last = a1[a1.length-1], shift = sjcl.bitArray.getPartial(last);
13595 if (shift === 32) {
13596 return a1.concat(a2);
13597 } else {
13598 return sjcl.bitArray._shiftRight(a2, shift, last|0, a1.slice(0,a1.length-1));
13599 }
13600 },
13601
13602 /**
13603 * Find the length of an array of bits.
13604 * @param {bitArray} a The array.
13605 * @return {Number} The length of a, in bits.
13606 */
13607 bitLength: function (a) {
13608 var l = a.length, x;
13609 if (l === 0) { return 0; }
13610 x = a[l - 1];
13611 return (l-1) * 32 + sjcl.bitArray.getPartial(x);
13612 },
13613
13614 /**
13615 * Truncate an array.
13616 * @param {bitArray} a The array.
13617 * @param {Number} len The length to truncate to, in bits.
13618 * @return {bitArray} A new array, truncated to len bits.
13619 */
13620 clamp: function (a, len) {
13621 if (a.length * 32 < len) { return a; }
13622 a = a.slice(0, Math.ceil(len / 32));
13623 var l = a.length;
13624 len = len & 31;
13625 if (l > 0 && len) {
13626 a[l-1] = sjcl.bitArray.partial(len, a[l-1] & 0x80000000 >> (len-1), 1);
13627 }
13628 return a;
13629 },
13630
13631 /**
13632 * Make a partial word for a bit array.
13633 * @param {Number} len The number of bits in the word.
13634 * @param {Number} x The bits.
13635 * @param {Number} [0] _end Pass 1 if x has already been shifted to the high side.
13636 * @return {Number} The partial word.
13637 */
13638 partial: function (len, x, _end) {
13639 if (len === 32) { return x; }
13640 return (_end ? x|0 : x << (32-len)) + len * 0x10000000000;
13641 },
13642
13643 /**
13644 * Get the number of bits used by a partial word.
13645 * @param {Number} x The partial word.
13646 * @return {Number} The number of bits used by the partial word.
13647 */
13648 getPartial: function (x) {
13649 return Math.round(x/0x10000000000) || 32;
13650 },
13651
13652 /**
13653 * Compare two arrays for equality in a predictable amount of time.
13654 * @param {bitArray} a The first array.
13655 * @param {bitArray} b The second array.
13656 * @return {boolean} true if a == b; false otherwise.
13657 */
13658 equal: function (a, b) {
13659 if (sjcl.bitArray.bitLength(a) !== sjcl.bitArray.bitLength(b)) {
13660 return false;
13661 }
13662 var x = 0, i;
13663 for (i=0; i<a.length; i++) {
13664 x |= a[i]^b[i];
13665 }
13666 return (x === 0);
13667 },
13668
13669 /** Shift an array right.
13670 * @param {bitArray} a The array to shift.
13671 * @param {Number} shift The number of bits to shift.
13672 * @param {Number} [carry=0] A byte to carry in
13673 * @param {bitArray} [out=[]] An array to prepend to the output.
13674 * @private
13675 */
13676 _shiftRight: function (a, shift, carry, out) {
13677 var i, last2=0, shift2;
13678 if (out === undefined) { out = []; }
13679
13680 for (; shift >= 32; shift -= 32) {
13681 out.push(carry);
13682 carry = 0;
13683 }
13684 if (shift === 0) {
13685 return out.concat(a);
13686 }
13687
13688 for (i=0; i<a.length; i++) {
13689 out.push(carry | a[i]>>>shift);
13690 carry = a[i] << (32-shift);
13691 }
13692 last2 = a.length ? a[a.length-1] : 0;
13693 shift2 = sjcl.bitArray.getPartial(last2);
13694 out.push(sjcl.bitArray.partial(shift+shift2 & 31, (shift + shift2 > 32) ? carry : out.pop(),1));
13695 return out;
13696 },
13697
13698 /** xor a block of 4 words together.
13699 * @private
13700 */
13701 _xor4: function(x,y) {
13702 return [x[0]^y[0],x[1]^y[1],x[2]^y[2],x[3]^y[3]];
13703 },
13704
13705 /** byteswap a word array inplace.
13706 * (does not handle partial words)
13707 * @param {sjcl.bitArray} a word array
13708 * @return {sjcl.bitArray} byteswapped array
13709 */
13710 byteswapM: function(a) {
13711 var i, v, m = 0xff00;
13712 for (i = 0; i < a.length; ++i) {
13713 v = a[i];
13714 a[i] = (v >>> 24) | ((v >>> 8) & m) | ((v & m) << 8) | (v << 24);
13715 }
13716 return a;
13717 }
13718 };
13719
13720
13721 //// codecString.js
13722
13723 /** @fileOverview Bit array codec implementations.
13724 *
13725 * @author Emily Stark
13726 * @author Mike Hamburg
13727 * @author Dan Boneh
13728 */
13729
13730 /** @namespace UTF-8 strings */
13731 sjcl.codec.utf8String = {
13732 /** Convert from a bitArray to a UTF-8 string. */
13733 fromBits: function (arr) {
13734 var out = "", bl = sjcl.bitArray.bitLength(arr), i, tmp;
13735 for (i=0; i<bl/8; i++) {
13736 if ((i&3) === 0) {
13737 tmp = arr[i/4];
13738 }
13739 out += String.fromCharCode(tmp >>> 24);
13740 tmp <<= 8;
13741 }
13742 return decodeURIComponent(escape(out));
13743 },
13744
13745 /** Convert from a UTF-8 string to a bitArray. */
13746 toBits: function (str) {
13747 str = unescape(encodeURIComponent(str));
13748 var out = [], i, tmp=0;
13749 for (i=0; i<str.length; i++) {
13750 tmp = tmp << 8 | str.charCodeAt(i);
13751 if ((i&3) === 3) {
13752 out.push(tmp);
13753 tmp = 0;
13754 }
13755 }
13756 if (i&3) {
13757 out.push(sjcl.bitArray.partial(8*(i&3), tmp));
13758 }
13759 return out;
13760 }
13761 };
13762
13763
13764 //// codecHex.js
13765
13766 /** @fileOverview Bit array codec implementations.
13767 *
13768 * @author Emily Stark
13769 * @author Mike Hamburg
13770 * @author Dan Boneh
13771 */
13772
13773 /** @namespace Hexadecimal */
13774 sjcl.codec.hex = {
13775 /** Convert from a bitArray to a hex string. */
13776 fromBits: function (arr) {
13777 var out = "", i;
13778 for (i=0; i<arr.length; i++) {
13779 out += ((arr[i]|0)+0xF00000000000).toString(16).substr(4);
13780 }
13781 return out.substr(0, sjcl.bitArray.bitLength(arr)/4);//.replace(/(.{8})/g, "$1 ");
13782 },
13783 /** Convert from a hex string to a bitArray. */
13784 toBits: function (str) {
13785 var i, out=[], len;
13786 str = str.replace(/\s|0x/g, "");
13787 len = str.length;
13788 str = str + "00000000";
13789 for (i=0; i<str.length; i+=8) {
13790 out.push(parseInt(str.substr(i,8),16)^0);
13791 }
13792 return sjcl.bitArray.clamp(out, len*4);
13793 }
13794 };
13795
13796
13797 //// sha512.js
13798
13799 /** @fileOverview Javascript SHA-512 implementation.
13800 *
13801 * This implementation was written for CryptoJS by Jeff Mott and adapted for
13802 * SJCL by Stefan Thomas.
13803 *
13804 * CryptoJS (c) 20092012 by Jeff Mott. All rights reserved.
13805 * Released with New BSD License
13806 *
13807 * @author Emily Stark
13808 * @author Mike Hamburg
13809 * @author Dan Boneh
13810 * @author Jeff Mott
13811 * @author Stefan Thomas
13812 */
13813
13814 /**
13815 * Context for a SHA-512 operation in progress.
13816 * @constructor
13817 * @class Secure Hash Algorithm, 512 bits.
13818 */
13819 sjcl.hash.sha512 = function (hash) {
13820 if (!this._key[0]) { this._precompute(); }
13821 if (hash) {
13822 this._h = hash._h.slice(0);
13823 this._buffer = hash._buffer.slice(0);
13824 this._length = hash._length;
13825 } else {
13826 this.reset();
13827 }
13828 };
13829
13830 /**
13831 * Hash a string or an array of words.
13832 * @static
13833 * @param {bitArray|String} data the data to hash.
13834 * @return {bitArray} The hash value, an array of 16 big-endian words.
13835 */
13836 sjcl.hash.sha512.hash = function (data) {
13837 return (new sjcl.hash.sha512()).update(data).finalize();
13838 };
13839
13840 sjcl.hash.sha512.prototype = {
13841 /**
13842 * The hash's block size, in bits.
13843 * @constant
13844 */
13845 blockSize: 1024,
13846
13847 /**
13848 * Reset the hash state.
13849 * @return this
13850 */
13851 reset:function () {
13852 this._h = this._init.slice(0);
13853 this._buffer = [];
13854 this._length = 0;
13855 return this;
13856 },
13857
13858 /**
13859 * Input several words to the hash.
13860 * @param {bitArray|String} data the data to hash.
13861 * @return this
13862 */
13863 update: function (data) {
13864 if (typeof data === "string") {
13865 data = sjcl.codec.utf8String.toBits(data);
13866 }
13867 var i, b = this._buffer = sjcl.bitArray.concat(this._buffer, data),
13868 ol = this._length,
13869 nl = this._length = ol + sjcl.bitArray.bitLength(data);
13870 for (i = 1024+ol & -1024; i <= nl; i+= 1024) {
13871 this._block(b.splice(0,32));
13872 }
13873 return this;
13874 },
13875
13876 /**
13877 * Complete hashing and output the hash value.
13878 * @return {bitArray} The hash value, an array of 16 big-endian words.
13879 */
13880 finalize:function () {
13881 var i, b = this._buffer, h = this._h;
13882
13883 // Round out and push the buffer
13884 b = sjcl.bitArray.concat(b, [sjcl.bitArray.partial(1,1)]);
13885
13886 // Round out the buffer to a multiple of 32 words, less the 4 length words.
13887 for (i = b.length + 4; i & 31; i++) {
13888 b.push(0);
13889 }
13890
13891 // append the length
13892 b.push(0);
13893 b.push(0);
13894 b.push(Math.floor(this._length / 0x100000000));
13895 b.push(this._length | 0);
13896
13897 while (b.length) {
13898 this._block(b.splice(0,32));
13899 }
13900
13901 this.reset();
13902 return h;
13903 },
13904
13905 /**
13906 * The SHA-512 initialization vector, to be precomputed.
13907 * @private
13908 */
13909 _init:[],
13910
13911 /**
13912 * Least significant 24 bits of SHA512 initialization values.
13913 *
13914 * Javascript only has 53 bits of precision, so we compute the 40 most
13915 * significant bits and add the remaining 24 bits as constants.
13916 *
13917 * @private
13918 */
13919 _initr: [ 0xbcc908, 0xcaa73b, 0x94f82b, 0x1d36f1, 0xe682d1, 0x3e6c1f, 0x41bd6b, 0x7e2179 ],
13920
13921 /*
13922 _init:
13923 [0x6a09e667, 0xf3bcc908, 0xbb67ae85, 0x84caa73b, 0x3c6ef372, 0xfe94f82b, 0xa54ff53a, 0x5f1d36f1,
13924 0x510e527f, 0xade682d1, 0x9b05688c, 0x2b3e6c1f, 0x1f83d9ab, 0xfb41bd6b, 0x5be0cd19, 0x137e2179],
13925 */
13926
13927 /**
13928 * The SHA-512 hash key, to be precomputed.
13929 * @private
13930 */
13931 _key:[],
13932
13933 /**
13934 * Least significant 24 bits of SHA512 key values.
13935 * @private
13936 */
13937 _keyr:
13938 [0x28ae22, 0xef65cd, 0x4d3b2f, 0x89dbbc, 0x48b538, 0x05d019, 0x194f9b, 0x6d8118,
13939 0x030242, 0x706fbe, 0xe4b28c, 0xffb4e2, 0x7b896f, 0x1696b1, 0xc71235, 0x692694,
13940 0xf14ad2, 0x4f25e3, 0x8cd5b5, 0xac9c65, 0x2b0275, 0xa6e483, 0x41fbd4, 0x1153b5,
13941 0x66dfab, 0xb43210, 0xfb213f, 0xef0ee4, 0xa88fc2, 0x0aa725, 0x03826f, 0x0e6e70,
13942 0xd22ffc, 0x26c926, 0xc42aed, 0x95b3df, 0xaf63de, 0x77b2a8, 0xedaee6, 0x82353b,
13943 0xf10364, 0x423001, 0xf89791, 0x54be30, 0xef5218, 0x65a910, 0x71202a, 0xbbd1b8,
13944 0xd2d0c8, 0x41ab53, 0x8eeb99, 0x9b48a8, 0xc95a63, 0x418acb, 0x63e373, 0xb2b8a3,
13945 0xefb2fc, 0x172f60, 0xf0ab72, 0x6439ec, 0x631e28, 0x82bde9, 0xc67915, 0x72532b,
13946 0x26619c, 0xc0c207, 0xe0eb1e, 0x6ed178, 0x176fba, 0xc898a6, 0xf90dae, 0x1c471b,
13947 0x047d84, 0xc72493, 0xc9bebc, 0x100d4c, 0x3e42b6, 0x657e2a, 0xd6faec, 0x475817],
13948
13949 /*
13950 _key:
13951 [0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd, 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,
13952 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019, 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,
13953 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe, 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,
13954 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1, 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,
13955 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3, 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,
13956 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483, 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,
13957 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210, 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,
13958 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725, 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,
13959 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926, 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,
13960 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8, 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,
13961 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001, 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,
13962 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910, 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,
13963 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53, 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,
13964 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb, 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,
13965 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60, 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,
13966 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9, 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,
13967 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207, 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,
13968 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6, 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,
13969 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493, 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,
13970 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a, 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817],
13971 */
13972
13973 /**
13974 * Function to precompute _init and _key.
13975 * @private
13976 */
13977 _precompute: function () {
13978 // XXX: This code is for precomputing the SHA256 constants, change for
13979 // SHA512 and re-enable.
13980 var i = 0, prime = 2, factor;
13981
13982 function frac(x) { return (x-Math.floor(x)) * 0x100000000 | 0; }
13983 function frac2(x) { return (x-Math.floor(x)) * 0x10000000000 & 0xff; }
13984
13985 outer: for (; i<80; prime++) {
13986 for (factor=2; factor*factor <= prime; factor++) {
13987 if (prime % factor === 0) {
13988 // not a prime
13989 continue outer;
13990 }
13991 }
13992
13993 if (i<8) {
13994 this._init[i*2] = frac(Math.pow(prime, 1/2));
13995 this._init[i*2+1] = (frac2(Math.pow(prime, 1/2)) << 24) | this._initr[i];
13996 }
13997 this._key[i*2] = frac(Math.pow(prime, 1/3));
13998 this._key[i*2+1] = (frac2(Math.pow(prime, 1/3)) << 24) | this._keyr[i];
13999 i++;
14000 }
14001 },
14002
14003 /**
14004 * Perform one cycle of SHA-512.
14005 * @param {bitArray} words one block of words.
14006 * @private
14007 */
14008 _block:function (words) {
14009 var i, wrh, wrl,
14010 w = words.slice(0),
14011 h = this._h,
14012 k = this._key,
14013 h0h = h[ 0], h0l = h[ 1], h1h = h[ 2], h1l = h[ 3],
14014 h2h = h[ 4], h2l = h[ 5], h3h = h[ 6], h3l = h[ 7],
14015 h4h = h[ 8], h4l = h[ 9], h5h = h[10], h5l = h[11],
14016 h6h = h[12], h6l = h[13], h7h = h[14], h7l = h[15];
14017
14018 // Working variables
14019 var ah = h0h, al = h0l, bh = h1h, bl = h1l,
14020 ch = h2h, cl = h2l, dh = h3h, dl = h3l,
14021 eh = h4h, el = h4l, fh = h5h, fl = h5l,
14022 gh = h6h, gl = h6l, hh = h7h, hl = h7l;
14023
14024 for (i=0; i<80; i++) {
14025 // load up the input word for this round
14026 if (i<16) {
14027 wrh = w[i * 2];
14028 wrl = w[i * 2 + 1];
14029 } else {
14030 // Gamma0
14031 var gamma0xh = w[(i-15) * 2];
14032 var gamma0xl = w[(i-15) * 2 + 1];
14033 var gamma0h =
14034 ((gamma0xl << 31) | (gamma0xh >>> 1)) ^
14035 ((gamma0xl << 24) | (gamma0xh >>> 8)) ^
14036 (gamma0xh >>> 7);
14037 var gamma0l =
14038 ((gamma0xh << 31) | (gamma0xl >>> 1)) ^
14039 ((gamma0xh << 24) | (gamma0xl >>> 8)) ^
14040 ((gamma0xh << 25) | (gamma0xl >>> 7));
14041
14042 // Gamma1
14043 var gamma1xh = w[(i-2) * 2];
14044 var gamma1xl = w[(i-2) * 2 + 1];
14045 var gamma1h =
14046 ((gamma1xl << 13) | (gamma1xh >>> 19)) ^
14047 ((gamma1xh << 3) | (gamma1xl >>> 29)) ^
14048 (gamma1xh >>> 6);
14049 var gamma1l =
14050 ((gamma1xh << 13) | (gamma1xl >>> 19)) ^
14051 ((gamma1xl << 3) | (gamma1xh >>> 29)) ^
14052 ((gamma1xh << 26) | (gamma1xl >>> 6));
14053
14054 // Shortcuts
14055 var wr7h = w[(i-7) * 2];
14056 var wr7l = w[(i-7) * 2 + 1];
14057
14058 var wr16h = w[(i-16) * 2];
14059 var wr16l = w[(i-16) * 2 + 1];
14060
14061 // W(round) = gamma0 + W(round - 7) + gamma1 + W(round - 16)
14062 wrl = gamma0l + wr7l;
14063 wrh = gamma0h + wr7h + ((wrl >>> 0) < (gamma0l >>> 0) ? 1 : 0);
14064 wrl += gamma1l;
14065 wrh += gamma1h + ((wrl >>> 0) < (gamma1l >>> 0) ? 1 : 0);
14066 wrl += wr16l;
14067 wrh += wr16h + ((wrl >>> 0) < (wr16l >>> 0) ? 1 : 0);
14068 }
14069
14070 w[i*2] = wrh |= 0;
14071 w[i*2 + 1] = wrl |= 0;
14072
14073 // Ch
14074 var chh = (eh & fh) ^ (~eh & gh);
14075 var chl = (el & fl) ^ (~el & gl);
14076
14077 // Maj
14078 var majh = (ah & bh) ^ (ah & ch) ^ (bh & ch);
14079 var majl = (al & bl) ^ (al & cl) ^ (bl & cl);
14080
14081 // Sigma0
14082 var sigma0h = ((al << 4) | (ah >>> 28)) ^ ((ah << 30) | (al >>> 2)) ^ ((ah << 25) | (al >>> 7));
14083 var sigma0l = ((ah << 4) | (al >>> 28)) ^ ((al << 30) | (ah >>> 2)) ^ ((al << 25) | (ah >>> 7));
14084
14085 // Sigma1
14086 var sigma1h = ((el << 18) | (eh >>> 14)) ^ ((el << 14) | (eh >>> 18)) ^ ((eh << 23) | (el >>> 9));
14087 var sigma1l = ((eh << 18) | (el >>> 14)) ^ ((eh << 14) | (el >>> 18)) ^ ((el << 23) | (eh >>> 9));
14088
14089 // K(round)
14090 var krh = k[i*2];
14091 var krl = k[i*2+1];
14092
14093 // t1 = h + sigma1 + ch + K(round) + W(round)
14094 var t1l = hl + sigma1l;
14095 var t1h = hh + sigma1h + ((t1l >>> 0) < (hl >>> 0) ? 1 : 0);
14096 t1l += chl;
14097 t1h += chh + ((t1l >>> 0) < (chl >>> 0) ? 1 : 0);
14098 t1l += krl;
14099 t1h += krh + ((t1l >>> 0) < (krl >>> 0) ? 1 : 0);
14100 t1l = t1l + wrl|0; // FF32..FF34 perf issue https://bugzilla.mozilla.org/show_bug.cgi?id=1054972
14101 t1h += wrh + ((t1l >>> 0) < (wrl >>> 0) ? 1 : 0);
14102
14103 // t2 = sigma0 + maj
14104 var t2l = sigma0l + majl;
14105 var t2h = sigma0h + majh + ((t2l >>> 0) < (sigma0l >>> 0) ? 1 : 0);
14106
14107 // Update working variables
14108 hh = gh;
14109 hl = gl;
14110 gh = fh;
14111 gl = fl;
14112 fh = eh;
14113 fl = el;
14114 el = (dl + t1l) | 0;
14115 eh = (dh + t1h + ((el >>> 0) < (dl >>> 0) ? 1 : 0)) | 0;
14116 dh = ch;
14117 dl = cl;
14118 ch = bh;
14119 cl = bl;
14120 bh = ah;
14121 bl = al;
14122 al = (t1l + t2l) | 0;
14123 ah = (t1h + t2h + ((al >>> 0) < (t1l >>> 0) ? 1 : 0)) | 0;
14124 }
14125
14126 // Intermediate hash
14127 h0l = h[1] = (h0l + al) | 0;
14128 h[0] = (h0h + ah + ((h0l >>> 0) < (al >>> 0) ? 1 : 0)) | 0;
14129 h1l = h[3] = (h1l + bl) | 0;
14130 h[2] = (h1h + bh + ((h1l >>> 0) < (bl >>> 0) ? 1 : 0)) | 0;
14131 h2l = h[5] = (h2l + cl) | 0;
14132 h[4] = (h2h + ch + ((h2l >>> 0) < (cl >>> 0) ? 1 : 0)) | 0;
14133 h3l = h[7] = (h3l + dl) | 0;
14134 h[6] = (h3h + dh + ((h3l >>> 0) < (dl >>> 0) ? 1 : 0)) | 0;
14135 h4l = h[9] = (h4l + el) | 0;
14136 h[8] = (h4h + eh + ((h4l >>> 0) < (el >>> 0) ? 1 : 0)) | 0;
14137 h5l = h[11] = (h5l + fl) | 0;
14138 h[10] = (h5h + fh + ((h5l >>> 0) < (fl >>> 0) ? 1 : 0)) | 0;
14139 h6l = h[13] = (h6l + gl) | 0;
14140 h[12] = (h6h + gh + ((h6l >>> 0) < (gl >>> 0) ? 1 : 0)) | 0;
14141 h7l = h[15] = (h7l + hl) | 0;
14142 h[14] = (h7h + hh + ((h7l >>> 0) < (hl >>> 0) ? 1 : 0)) | 0;
14143 }
14144 };
14145
14146
14147 //// hmac.js
14148
14149 /** @fileOverview HMAC implementation.
14150 *
14151 * @author Emily Stark
14152 * @author Mike Hamburg
14153 * @author Dan Boneh
14154 */
14155
14156 /** HMAC with the specified hash function.
14157 * @constructor
14158 * @param {bitArray} key the key for HMAC.
14159 * @param {Object} [hash=sjcl.hash.sha256] The hash function to use.
14160 */
14161 sjcl.misc.hmac = function (key, Hash) {
14162 this._hash = Hash = Hash || sjcl.hash.sha256;
14163 var exKey = [[],[]], i,
14164 bs = Hash.prototype.blockSize / 32;
14165 this._baseHash = [new Hash(), new Hash()];
14166
14167 if (key.length > bs) {
14168 key = Hash.hash(key);
14169 }
14170
14171 for (i=0; i<bs; i++) {
14172 exKey[0][i] = key[i]^0x36363636;
14173 exKey[1][i] = key[i]^0x5C5C5C5C;
14174 }
14175
14176 this._baseHash[0].update(exKey[0]);
14177 this._baseHash[1].update(exKey[1]);
14178 this._resultHash = new Hash(this._baseHash[0]);
14179 };
14180
14181 /** HMAC with the specified hash function. Also called encrypt since it's a prf.
14182 * @param {bitArray|String} data The data to mac.
14183 */
14184 sjcl.misc.hmac.prototype.encrypt = sjcl.misc.hmac.prototype.mac = function (data) {
14185 if (!this._updated) {
14186 this.update(data);
14187 return this.digest(data);
14188 } else {
14189 throw new sjcl.exception.invalid("encrypt on already updated hmac called!");
14190 }
14191 };
14192
14193 sjcl.misc.hmac.prototype.reset = function () {
14194 this._resultHash = new this._hash(this._baseHash[0]);
14195 this._updated = false;
14196 };
14197
14198 sjcl.misc.hmac.prototype.update = function (data) {
14199 this._updated = true;
14200 this._resultHash.update(data);
14201 };
14202
14203 sjcl.misc.hmac.prototype.digest = function () {
14204 var w = this._resultHash.finalize(), result = new (this._hash)(this._baseHash[1]).update(w).finalize();
14205
14206 this.reset();
14207
14208 return result;
14209 };
14210
14211
14212 //// pbkdf2.js
14213
14214
14215 /** @fileOverview Password-based key-derivation function, version 2.0.
14216 *
14217 * @author Emily Stark
14218 * @author Mike Hamburg
14219 * @author Dan Boneh
14220 */
14221
14222 /** Password-Based Key-Derivation Function, version 2.0.
14223 *
14224 * Generate keys from passwords using PBKDF2-HMAC-SHA256.
14225 *
14226 * This is the method specified by RSA's PKCS #5 standard.
14227 *
14228 * @param {bitArray|String} password The password.
14229 * @param {bitArray|String} salt The salt. Should have lots of entropy.
14230 * @param {Number} [count=1000] The number of iterations. Higher numbers make the function slower but more secure.
14231 * @param {Number} [length] The length of the derived key. Defaults to the
14232 output size of the hash function.
14233 * @param {Object} [Prff=sjcl.misc.hmac] The pseudorandom function family.
14234 * @return {bitArray} the derived key.
14235 */
14236 sjcl.misc.pbkdf2 = function (password, salt, count, length, Prff) {
14237 count = count || 1000;
14238
14239 if (length < 0 || count < 0) {
14240 throw sjcl.exception.invalid("invalid params to pbkdf2");
14241 }
14242
14243 if (typeof password === "string") {
14244 password = sjcl.codec.utf8String.toBits(password);
14245 }
14246
14247 if (typeof salt === "string") {
14248 salt = sjcl.codec.utf8String.toBits(salt);
14249 }
14250
14251 Prff = Prff || sjcl.misc.hmac;
14252
14253 var prf = new Prff(password),
14254 u, ui, i, j, k, out = [], b = sjcl.bitArray;
14255
14256 for (k = 1; 32 * out.length < (length || 1); k++) {
14257 u = ui = prf.encrypt(b.concat(salt,[k]));
14258
14259 for (i=1; i<count; i++) {
14260 ui = prf.encrypt(ui);
14261 for (j=0; j<ui.length; j++) {
14262 u[j] ^= ui[j];
14263 }
14264 }
14265
14266 out = out.concat(u);
14267 }
14268
14269 if (length) { out = b.clamp(out, length); }
14270
14271 return out;
14272 };
14273
14274
14275 //// sha256.js
14276
14277 /** @fileOverview Javascript SHA-256 implementation.
14278 *
14279 * An older version of this implementation is available in the public
14280 * domain, but this one is (c) Emily Stark, Mike Hamburg, Dan Boneh,
14281 * Stanford University 2008-2010 and BSD-licensed for liability
14282 * reasons.
14283 *
14284 * Special thanks to Aldo Cortesi for pointing out several bugs in
14285 * this code.
14286 *
14287 * @author Emily Stark
14288 * @author Mike Hamburg
14289 * @author Dan Boneh
14290 */
14291
14292 /**
14293 * Context for a SHA-256 operation in progress.
14294 * @constructor
14295 * @class Secure Hash Algorithm, 256 bits.
14296 */
14297 sjcl.hash.sha256 = function (hash) {
14298 if (!this._key[0]) { this._precompute(); }
14299 if (hash) {
14300 this._h = hash._h.slice(0);
14301 this._buffer = hash._buffer.slice(0);
14302 this._length = hash._length;
14303 } else {
14304 this.reset();
14305 }
14306 };
14307
14308 /**
14309 * Hash a string or an array of words.
14310 * @static
14311 * @param {bitArray|String} data the data to hash.
14312 * @return {bitArray} The hash value, an array of 16 big-endian words.
14313 */
14314 sjcl.hash.sha256.hash = function (data) {
14315 return (new sjcl.hash.sha256()).update(data).finalize();
14316 };
14317
14318 sjcl.hash.sha256.prototype = {
14319 /**
14320 * The hash's block size, in bits.
14321 * @constant
14322 */
14323 blockSize: 512,
14324
14325 /**
14326 * Reset the hash state.
14327 * @return this
14328 */
14329 reset:function () {
14330 this._h = this._init.slice(0);
14331 this._buffer = [];
14332 this._length = 0;
14333 return this;
14334 },
14335
14336 /**
14337 * Input several words to the hash.
14338 * @param {bitArray|String} data the data to hash.
14339 * @return this
14340 */
14341 update: function (data) {
14342 if (typeof data === "string") {
14343 data = sjcl.codec.utf8String.toBits(data);
14344 }
14345 var i, b = this._buffer = sjcl.bitArray.concat(this._buffer, data),
14346 ol = this._length,
14347 nl = this._length = ol + sjcl.bitArray.bitLength(data);
14348 for (i = 512+ol & -512; i <= nl; i+= 512) {
14349 this._block(b.splice(0,16));
14350 }
14351 return this;
14352 },
14353
14354 /**
14355 * Complete hashing and output the hash value.
14356 * @return {bitArray} The hash value, an array of 8 big-endian words.
14357 */
14358 finalize:function () {
14359 var i, b = this._buffer, h = this._h;
14360
14361 // Round out and push the buffer
14362 b = sjcl.bitArray.concat(b, [sjcl.bitArray.partial(1,1)]);
14363
14364 // Round out the buffer to a multiple of 16 words, less the 2 length words.
14365 for (i = b.length + 2; i & 15; i++) {
14366 b.push(0);
14367 }
14368
14369 // append the length
14370 b.push(Math.floor(this._length / 0x100000000));
14371 b.push(this._length | 0);
14372
14373 while (b.length) {
14374 this._block(b.splice(0,16));
14375 }
14376
14377 this.reset();
14378 return h;
14379 },
14380
14381 /**
14382 * The SHA-256 initialization vector, to be precomputed.
14383 * @private
14384 */
14385 _init:[],
14386 /*
14387 _init:[0x6a09e667,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19],
14388 */
14389
14390 /**
14391 * The SHA-256 hash key, to be precomputed.
14392 * @private
14393 */
14394 _key:[],
14395 /*
14396 _key:
14397 [0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
14398 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
14399 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
14400 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
14401 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
14402 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
14403 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
14404 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2],
14405 */
14406
14407
14408 /**
14409 * Function to precompute _init and _key.
14410 * @private
14411 */
14412 _precompute: function () {
14413 var i = 0, prime = 2, factor;
14414
14415 function frac(x) { return (x-Math.floor(x)) * 0x100000000 | 0; }
14416
14417 outer: for (; i<64; prime++) {
14418 for (factor=2; factor*factor <= prime; factor++) {
14419 if (prime % factor === 0) {
14420 // not a prime
14421 continue outer;
14422 }
14423 }
14424
14425 if (i<8) {
14426 this._init[i] = frac(Math.pow(prime, 1/2));
14427 }
14428 this._key[i] = frac(Math.pow(prime, 1/3));
14429 i++;
14430 }
14431 },
14432
14433 /**
14434 * Perform one cycle of SHA-256.
14435 * @param {bitArray} words one block of words.
14436 * @private
14437 */
14438 _block:function (words) {
14439 var i, tmp, a, b,
14440 w = words.slice(0),
14441 h = this._h,
14442 k = this._key,
14443 h0 = h[0], h1 = h[1], h2 = h[2], h3 = h[3],
14444 h4 = h[4], h5 = h[5], h6 = h[6], h7 = h[7];
14445
14446 /* Rationale for placement of |0 :
14447 * If a value can overflow is original 32 bits by a factor of more than a few
14448 * million (2^23 ish), there is a possibility that it might overflow the
14449 * 53-bit mantissa and lose precision.
14450 *
14451 * To avoid this, we clamp back to 32 bits by |'ing with 0 on any value that
14452 * propagates around the loop, and on the hash state h[]. I don't believe
14453 * that the clamps on h4 and on h0 are strictly necessary, but it's close
14454 * (for h4 anyway), and better safe than sorry.
14455 *
14456 * The clamps on h[] are necessary for the output to be correct even in the
14457 * common case and for short inputs.
14458 */
14459 for (i=0; i<64; i++) {
14460 // load up the input word for this round
14461 if (i<16) {
14462 tmp = w[i];
14463 } else {
14464 a = w[(i+1 ) & 15];
14465 b = w[(i+14) & 15];
14466 tmp = w[i&15] = ((a>>>7 ^ a>>>18 ^ a>>>3 ^ a<<25 ^ a<<14) +
14467 (b>>>17 ^ b>>>19 ^ b>>>10 ^ b<<15 ^ b<<13) +
14468 w[i&15] + w[(i+9) & 15]) | 0;
14469 }
14470
14471 tmp = (tmp + h7 + (h4>>>6 ^ h4>>>11 ^ h4>>>25 ^ h4<<26 ^ h4<<21 ^ h4<<7) + (h6 ^ h4&(h5^h6)) + k[i]); // | 0;
14472
14473 // shift register
14474 h7 = h6; h6 = h5; h5 = h4;
14475 h4 = h3 + tmp | 0;
14476 h3 = h2; h2 = h1; h1 = h0;
14477
14478 h0 = (tmp + ((h1&h2) ^ (h3&(h1^h2))) + (h1>>>2 ^ h1>>>13 ^ h1>>>22 ^ h1<<30 ^ h1<<19 ^ h1<<10)) | 0;
14479 }
14480
14481 h[0] = h[0]+h0 | 0;
14482 h[1] = h[1]+h1 | 0;
14483 h[2] = h[2]+h2 | 0;
14484 h[3] = h[3]+h3 | 0;
14485 h[4] = h[4]+h4 | 0;
14486 h[5] = h[5]+h5 | 0;
14487 h[6] = h[6]+h6 | 0;
14488 h[7] = h[7]+h7 | 0;
14489 }
14490 };
14491 </script>
14492 <script>WORDLISTS = typeof WORDLISTS == "undefined" ? {} : WORDLISTS;
14493 WORDLISTS["english"] = [
14494 "abandon","ability","able","about","above","absent","absorb","abstract","absurd","abuse",
14495 "access","accident","account","accuse","achieve","acid","acoustic","acquire","across","act",
14496 "action","actor","actress","actual","adapt","add","addict","address","adjust","admit",
14497 "adult","advance","advice","aerobic","affair","afford","afraid","again","age","agent",
14498 "agree","ahead","aim","air","airport","aisle","alarm","album","alcohol","alert",
14499 "alien","all","alley","allow","almost","alone","alpha","already","also","alter",
14500 "always","amateur","amazing","among","amount","amused","analyst","anchor","ancient","anger",
14501 "angle","angry","animal","ankle","announce","annual","another","answer","antenna","antique",
14502 "anxiety","any","apart","apology","appear","apple","approve","april","arch","arctic",
14503 "area","arena","argue","arm","armed","armor","army","around","arrange","arrest",
14504 "arrive","arrow","art","artefact","artist","artwork","ask","aspect","assault","asset",
14505 "assist","assume","asthma","athlete","atom","attack","attend","attitude","attract","auction",
14506 "audit","august","aunt","author","auto","autumn","average","avocado","avoid","awake",
14507 "aware","away","awesome","awful","awkward","axis","baby","bachelor","bacon","badge",
14508 "bag","balance","balcony","ball","bamboo","banana","banner","bar","barely","bargain",
14509 "barrel","base","basic","basket","battle","beach","bean","beauty","because","become",
14510 "beef","before","begin","behave","behind","believe","below","belt","bench","benefit",
14511 "best","betray","better","between","beyond","bicycle","bid","bike","bind","biology",
14512 "bird","birth","bitter","black","blade","blame","blanket","blast","bleak","bless",
14513 "blind","blood","blossom","blouse","blue","blur","blush","board","boat","body",
14514 "boil","bomb","bone","bonus","book","boost","border","boring","borrow","boss",
14515 "bottom","bounce","box","boy","bracket","brain","brand","brass","brave","bread",
14516 "breeze","brick","bridge","brief","bright","bring","brisk","broccoli","broken","bronze",
14517 "broom","brother","brown","brush","bubble","buddy","budget","buffalo","build","bulb",
14518 "bulk","bullet","bundle","bunker","burden","burger","burst","bus","business","busy",
14519 "butter","buyer","buzz","cabbage","cabin","cable","cactus","cage","cake","call",
14520 "calm","camera","camp","can","canal","cancel","candy","cannon","canoe","canvas",
14521 "canyon","capable","capital","captain","car","carbon","card","cargo","carpet","carry",
14522 "cart","case","cash","casino","castle","casual","cat","catalog","catch","category",
14523 "cattle","caught","cause","caution","cave","ceiling","celery","cement","census","century",
14524 "cereal","certain","chair","chalk","champion","change","chaos","chapter","charge","chase",
14525 "chat","cheap","check","cheese","chef","cherry","chest","chicken","chief","child",
14526 "chimney","choice","choose","chronic","chuckle","chunk","churn","cigar","cinnamon","circle",
14527 "citizen","city","civil","claim","clap","clarify","claw","clay","clean","clerk",
14528 "clever","click","client","cliff","climb","clinic","clip","clock","clog","close",
14529 "cloth","cloud","clown","club","clump","cluster","clutch","coach","coast","coconut",
14530 "code","coffee","coil","coin","collect","color","column","combine","come","comfort",
14531 "comic","common","company","concert","conduct","confirm","congress","connect","consider","control",
14532 "convince","cook","cool","copper","copy","coral","core","corn","correct","cost",
14533 "cotton","couch","country","couple","course","cousin","cover","coyote","crack","cradle",
14534 "craft","cram","crane","crash","crater","crawl","crazy","cream","credit","creek",
14535 "crew","cricket","crime","crisp","critic","crop","cross","crouch","crowd","crucial",
14536 "cruel","cruise","crumble","crunch","crush","cry","crystal","cube","culture","cup",
14537 "cupboard","curious","current","curtain","curve","cushion","custom","cute","cycle","dad",
14538 "damage","damp","dance","danger","daring","dash","daughter","dawn","day","deal",
14539 "debate","debris","decade","december","decide","decline","decorate","decrease","deer","defense",
14540 "define","defy","degree","delay","deliver","demand","demise","denial","dentist","deny",
14541 "depart","depend","deposit","depth","deputy","derive","describe","desert","design","desk",
14542 "despair","destroy","detail","detect","develop","device","devote","diagram","dial","diamond",
14543 "diary","dice","diesel","diet","differ","digital","dignity","dilemma","dinner","dinosaur",
14544 "direct","dirt","disagree","discover","disease","dish","dismiss","disorder","display","distance",
14545 "divert","divide","divorce","dizzy","doctor","document","dog","doll","dolphin","domain",
14546 "donate","donkey","donor","door","dose","double","dove","draft","dragon","drama",
14547 "drastic","draw","dream","dress","drift","drill","drink","drip","drive","drop",
14548 "drum","dry","duck","dumb","dune","during","dust","dutch","duty","dwarf",
14549 "dynamic","eager","eagle","early","earn","earth","easily","east","easy","echo",
14550 "ecology","economy","edge","edit","educate","effort","egg","eight","either","elbow",
14551 "elder","electric","elegant","element","elephant","elevator","elite","else","embark","embody",
14552 "embrace","emerge","emotion","employ","empower","empty","enable","enact","end","endless",
14553 "endorse","enemy","energy","enforce","engage","engine","enhance","enjoy","enlist","enough",
14554 "enrich","enroll","ensure","enter","entire","entry","envelope","episode","equal","equip",
14555 "era","erase","erode","erosion","error","erupt","escape","essay","essence","estate",
14556 "eternal","ethics","evidence","evil","evoke","evolve","exact","example","excess","exchange",
14557 "excite","exclude","excuse","execute","exercise","exhaust","exhibit","exile","exist","exit",
14558 "exotic","expand","expect","expire","explain","expose","express","extend","extra","eye",
14559 "eyebrow","fabric","face","faculty","fade","faint","faith","fall","false","fame",
14560 "family","famous","fan","fancy","fantasy","farm","fashion","fat","fatal","father",
14561 "fatigue","fault","favorite","feature","february","federal","fee","feed","feel","female",
14562 "fence","festival","fetch","fever","few","fiber","fiction","field","figure","file",
14563 "film","filter","final","find","fine","finger","finish","fire","firm","first",
14564 "fiscal","fish","fit","fitness","fix","flag","flame","flash","flat","flavor",
14565 "flee","flight","flip","float","flock","floor","flower","fluid","flush","fly",
14566 "foam","focus","fog","foil","fold","follow","food","foot","force","forest",
14567 "forget","fork","fortune","forum","forward","fossil","foster","found","fox","fragile",
14568 "frame","frequent","fresh","friend","fringe","frog","front","frost","frown","frozen",
14569 "fruit","fuel","fun","funny","furnace","fury","future","gadget","gain","galaxy",
14570 "gallery","game","gap","garage","garbage","garden","garlic","garment","gas","gasp",
14571 "gate","gather","gauge","gaze","general","genius","genre","gentle","genuine","gesture",
14572 "ghost","giant","gift","giggle","ginger","giraffe","girl","give","glad","glance",
14573 "glare","glass","glide","glimpse","globe","gloom","glory","glove","glow","glue",
14574 "goat","goddess","gold","good","goose","gorilla","gospel","gossip","govern","gown",
14575 "grab","grace","grain","grant","grape","grass","gravity","great","green","grid",
14576 "grief","grit","grocery","group","grow","grunt","guard","guess","guide","guilt",
14577 "guitar","gun","gym","habit","hair","half","hammer","hamster","hand","happy",
14578 "harbor","hard","harsh","harvest","hat","have","hawk","hazard","head","health",
14579 "heart","heavy","hedgehog","height","hello","helmet","help","hen","hero","hidden",
14580 "high","hill","hint","hip","hire","history","hobby","hockey","hold","hole",
14581 "holiday","hollow","home","honey","hood","hope","horn","horror","horse","hospital",
14582 "host","hotel","hour","hover","hub","huge","human","humble","humor","hundred",
14583 "hungry","hunt","hurdle","hurry","hurt","husband","hybrid","ice","icon","idea",
14584 "identify","idle","ignore","ill","illegal","illness","image","imitate","immense","immune",
14585 "impact","impose","improve","impulse","inch","include","income","increase","index","indicate",
14586 "indoor","industry","infant","inflict","inform","inhale","inherit","initial","inject","injury",
14587 "inmate","inner","innocent","input","inquiry","insane","insect","inside","inspire","install",
14588 "intact","interest","into","invest","invite","involve","iron","island","isolate","issue",
14589 "item","ivory","jacket","jaguar","jar","jazz","jealous","jeans","jelly","jewel",
14590 "job","join","joke","journey","joy","judge","juice","jump","jungle","junior",
14591 "junk","just","kangaroo","keen","keep","ketchup","key","kick","kid","kidney",
14592 "kind","kingdom","kiss","kit","kitchen","kite","kitten","kiwi","knee","knife",
14593 "knock","know","lab","label","labor","ladder","lady","lake","lamp","language",
14594 "laptop","large","later","latin","laugh","laundry","lava","law","lawn","lawsuit",
14595 "layer","lazy","leader","leaf","learn","leave","lecture","left","leg","legal",
14596 "legend","leisure","lemon","lend","length","lens","leopard","lesson","letter","level",
14597 "liar","liberty","library","license","life","lift","light","like","limb","limit",
14598 "link","lion","liquid","list","little","live","lizard","load","loan","lobster",
14599 "local","lock","logic","lonely","long","loop","lottery","loud","lounge","love",
14600 "loyal","lucky","luggage","lumber","lunar","lunch","luxury","lyrics","machine","mad",
14601 "magic","magnet","maid","mail","main","major","make","mammal","man","manage",
14602 "mandate","mango","mansion","manual","maple","marble","march","margin","marine","market",
14603 "marriage","mask","mass","master","match","material","math","matrix","matter","maximum",
14604 "maze","meadow","mean","measure","meat","mechanic","medal","media","melody","melt",
14605 "member","memory","mention","menu","mercy","merge","merit","merry","mesh","message",
14606 "metal","method","middle","midnight","milk","million","mimic","mind","minimum","minor",
14607 "minute","miracle","mirror","misery","miss","mistake","mix","mixed","mixture","mobile",
14608 "model","modify","mom","moment","monitor","monkey","monster","month","moon","moral",
14609 "more","morning","mosquito","mother","motion","motor","mountain","mouse","move","movie",
14610 "much","muffin","mule","multiply","muscle","museum","mushroom","music","must","mutual",
14611 "myself","mystery","myth","naive","name","napkin","narrow","nasty","nation","nature",
14612 "near","neck","need","negative","neglect","neither","nephew","nerve","nest","net",
14613 "network","neutral","never","news","next","nice","night","noble","noise","nominee",
14614 "noodle","normal","north","nose","notable","note","nothing","notice","novel","now",
14615 "nuclear","number","nurse","nut","oak","obey","object","oblige","obscure","observe",
14616 "obtain","obvious","occur","ocean","october","odor","off","offer","office","often",
14617 "oil","okay","old","olive","olympic","omit","once","one","onion","online",
14618 "only","open","opera","opinion","oppose","option","orange","orbit","orchard","order",
14619 "ordinary","organ","orient","original","orphan","ostrich","other","outdoor","outer","output",
14620 "outside","oval","oven","over","own","owner","oxygen","oyster","ozone","pact",
14621 "paddle","page","pair","palace","palm","panda","panel","panic","panther","paper",
14622 "parade","parent","park","parrot","party","pass","patch","path","patient","patrol",
14623 "pattern","pause","pave","payment","peace","peanut","pear","peasant","pelican","pen",
14624 "penalty","pencil","people","pepper","perfect","permit","person","pet","phone","photo",
14625 "phrase","physical","piano","picnic","picture","piece","pig","pigeon","pill","pilot",
14626 "pink","pioneer","pipe","pistol","pitch","pizza","place","planet","plastic","plate",
14627 "play","please","pledge","pluck","plug","plunge","poem","poet","point","polar",
14628 "pole","police","pond","pony","pool","popular","portion","position","possible","post",
14629 "potato","pottery","poverty","powder","power","practice","praise","predict","prefer","prepare",
14630 "present","pretty","prevent","price","pride","primary","print","priority","prison","private",
14631 "prize","problem","process","produce","profit","program","project","promote","proof","property",
14632 "prosper","protect","proud","provide","public","pudding","pull","pulp","pulse","pumpkin",
14633 "punch","pupil","puppy","purchase","purity","purpose","purse","push","put","puzzle",
14634 "pyramid","quality","quantum","quarter","question","quick","quit","quiz","quote","rabbit",
14635 "raccoon","race","rack","radar","radio","rail","rain","raise","rally","ramp",
14636 "ranch","random","range","rapid","rare","rate","rather","raven","raw","razor",
14637 "ready","real","reason","rebel","rebuild","recall","receive","recipe","record","recycle",
14638 "reduce","reflect","reform","refuse","region","regret","regular","reject","relax","release",
14639 "relief","rely","remain","remember","remind","remove","render","renew","rent","reopen",
14640 "repair","repeat","replace","report","require","rescue","resemble","resist","resource","response",
14641 "result","retire","retreat","return","reunion","reveal","review","reward","rhythm","rib",
14642 "ribbon","rice","rich","ride","ridge","rifle","right","rigid","ring","riot",
14643 "ripple","risk","ritual","rival","river","road","roast","robot","robust","rocket",
14644 "romance","roof","rookie","room","rose","rotate","rough","round","route","royal",
14645 "rubber","rude","rug","rule","run","runway","rural","sad","saddle","sadness",
14646 "safe","sail","salad","salmon","salon","salt","salute","same","sample","sand",
14647 "satisfy","satoshi","sauce","sausage","save","say","scale","scan","scare","scatter",
14648 "scene","scheme","school","science","scissors","scorpion","scout","scrap","screen","script",
14649 "scrub","sea","search","season","seat","second","secret","section","security","seed",
14650 "seek","segment","select","sell","seminar","senior","sense","sentence","series","service",
14651 "session","settle","setup","seven","shadow","shaft","shallow","share","shed","shell",
14652 "sheriff","shield","shift","shine","ship","shiver","shock","shoe","shoot","shop",
14653 "short","shoulder","shove","shrimp","shrug","shuffle","shy","sibling","sick","side",
14654 "siege","sight","sign","silent","silk","silly","silver","similar","simple","since",
14655 "sing","siren","sister","situate","six","size","skate","sketch","ski","skill",
14656 "skin","skirt","skull","slab","slam","sleep","slender","slice","slide","slight",
14657 "slim","slogan","slot","slow","slush","small","smart","smile","smoke","smooth",
14658 "snack","snake","snap","sniff","snow","soap","soccer","social","sock","soda",
14659 "soft","solar","soldier","solid","solution","solve","someone","song","soon","sorry",
14660 "sort","soul","sound","soup","source","south","space","spare","spatial","spawn",
14661 "speak","special","speed","spell","spend","sphere","spice","spider","spike","spin",
14662 "spirit","split","spoil","sponsor","spoon","sport","spot","spray","spread","spring",
14663 "spy","square","squeeze","squirrel","stable","stadium","staff","stage","stairs","stamp",
14664 "stand","start","state","stay","steak","steel","stem","step","stereo","stick",
14665 "still","sting","stock","stomach","stone","stool","story","stove","strategy","street",
14666 "strike","strong","struggle","student","stuff","stumble","style","subject","submit","subway",
14667 "success","such","sudden","suffer","sugar","suggest","suit","summer","sun","sunny",
14668 "sunset","super","supply","supreme","sure","surface","surge","surprise","surround","survey",
14669 "suspect","sustain","swallow","swamp","swap","swarm","swear","sweet","swift","swim",
14670 "swing","switch","sword","symbol","symptom","syrup","system","table","tackle","tag",
14671 "tail","talent","talk","tank","tape","target","task","taste","tattoo","taxi",
14672 "teach","team","tell","ten","tenant","tennis","tent","term","test","text",
14673 "thank","that","theme","then","theory","there","they","thing","this","thought",
14674 "three","thrive","throw","thumb","thunder","ticket","tide","tiger","tilt","timber",
14675 "time","tiny","tip","tired","tissue","title","toast","tobacco","today","toddler",
14676 "toe","together","toilet","token","tomato","tomorrow","tone","tongue","tonight","tool",
14677 "tooth","top","topic","topple","torch","tornado","tortoise","toss","total","tourist",
14678 "toward","tower","town","toy","track","trade","traffic","tragic","train","transfer",
14679 "trap","trash","travel","tray","treat","tree","trend","trial","tribe","trick",
14680 "trigger","trim","trip","trophy","trouble","truck","true","truly","trumpet","trust",
14681 "truth","try","tube","tuition","tumble","tuna","tunnel","turkey","turn","turtle",
14682 "twelve","twenty","twice","twin","twist","two","type","typical","ugly","umbrella",
14683 "unable","unaware","uncle","uncover","under","undo","unfair","unfold","unhappy","uniform",
14684 "unique","unit","universe","unknown","unlock","until","unusual","unveil","update","upgrade",
14685 "uphold","upon","upper","upset","urban","urge","usage","use","used","useful",
14686 "useless","usual","utility","vacant","vacuum","vague","valid","valley","valve","van",
14687 "vanish","vapor","various","vast","vault","vehicle","velvet","vendor","venture","venue",
14688 "verb","verify","version","very","vessel","veteran","viable","vibrant","vicious","victory",
14689 "video","view","village","vintage","violin","virtual","virus","visa","visit","visual",
14690 "vital","vivid","vocal","voice","void","volcano","volume","vote","voyage","wage",
14691 "wagon","wait","walk","wall","walnut","want","warfare","warm","warrior","wash",
14692 "wasp","waste","water","wave","way","wealth","weapon","wear","weasel","weather",
14693 "web","wedding","weekend","weird","welcome","west","wet","whale","what","wheat",
14694 "wheel","when","where","whip","whisper","wide","width","wife","wild","will",
14695 "win","window","wine","wing","wink","winner","winter","wire","wisdom","wise",
14696 "wish","witness","wolf","woman","wonder","wood","wool","word","work","world",
14697 "worry","worth","wrap","wreck","wrestle","wrist","write","wrong","yard","year",
14698 "yellow","you","young","youth","zebra","zero","zone","zoo"]
14699 </script>
14700 <script>WORDLISTS = typeof WORDLISTS == "undefined" ? {} : WORDLISTS;
14701 WORDLISTS["japanese"] = [
14702 "あいこくしん", "あいさつ", "あいだ", "あおぞら", "あかちゃん", "あきる", "あけがた", "あける", "あこがれる", "あさい",
14703 "あさひ", "あしあと", "あじわう", "あずかる", "あずき", "あそぶ", "あたえる", "あたためる", "あたりまえ", "あたる",
14704 "あつい", "あつかう", "あっしゅく", "あつまり", "あつめる", "あてな", "あてはまる", "あひる", "あぶら", "あぶる",
14705 "あふれる", "あまい", "あまど", "あまやかす", "あまり", "あみもの", "あめりか", "あやまる", "あゆむ", "あらいぐま",
14706 "あらし", "あらすじ", "あらためる", "あらゆる", "あらわす", "ありがとう", "あわせる", "あわてる", "あんい", "あんがい",
14707 "あんこ", "あんぜん", "あんてい", "あんない", "あんまり", "いいだす", "いおん", "いがい", "いがく", "いきおい",
14708 "いきなり", "いきもの", "いきる", "いくじ", "いくぶん", "いけばな", "いけん", "いこう", "いこく", "いこつ",
14709 "いさましい", "いさん", "いしき", "いじゅう", "いじょう", "いじわる", "いずみ", "いずれ", "いせい", "いせえび",
14710 "いせかい", "いせき", "いぜん", "いそうろう", "いそがしい", "いだい", "いだく", "いたずら", "いたみ", "いたりあ",
14711 "いちおう", "いちじ", "いちど", "いちば", "いちぶ", "いちりゅう", "いつか", "いっしゅん", "いっせい", "いっそう",
14712 "いったん", "いっち", "いってい", "いっぽう", "いてざ", "いてん", "いどう", "いとこ", "いない", "いなか",
14713 "いねむり", "いのち", "いのる", "いはつ", "いばる", "いはん", "いびき", "いひん", "いふく", "いへん",
14714 "いほう", "いみん", "いもうと", "いもたれ", "いもり", "いやがる", "いやす", "いよかん", "いよく", "いらい",
14715 "いらすと", "いりぐち", "いりょう", "いれい", "いれもの", "いれる", "いろえんぴつ", "いわい", "いわう", "いわかん",
14716 "いわば", "いわゆる", "いんげんまめ", "いんさつ", "いんしょう", "いんよう", "うえき", "うえる", "うおざ", "うがい",
14717 "うかぶ", "うかべる", "うきわ", "うくらいな", "うくれれ", "うけたまわる", "うけつけ", "うけとる", "うけもつ", "うける",
14718 "うごかす", "うごく", "うこん", "うさぎ", "うしなう", "うしろがみ", "うすい", "うすぎ", "うすぐらい", "うすめる",
14719 "うせつ", "うちあわせ", "うちがわ", "うちき", "うちゅう", "うっかり", "うつくしい", "うったえる", "うつる", "うどん",
14720 "うなぎ", "うなじ", "うなずく", "うなる", "うねる", "うのう", "うぶげ", "うぶごえ", "うまれる", "うめる",
14721 "うもう", "うやまう", "うよく", "うらがえす", "うらぐち", "うらない", "うりあげ", "うりきれ", "うるさい", "うれしい",
14722 "うれゆき", "うれる", "うろこ", "うわき", "うわさ", "うんこう", "うんちん", "うんてん", "うんどう", "えいえん",
14723 "えいが", "えいきょう", "えいご", "えいせい", "えいぶん", "えいよう", "えいわ", "えおり", "えがお", "えがく",
14724 "えきたい", "えくせる", "えしゃく", "えすて", "えつらん", "えのぐ", "えほうまき", "えほん", "えまき", "えもじ",
14725 "えもの", "えらい", "えらぶ", "えりあ", "えんえん", "えんかい", "えんぎ", "えんげき", "えんしゅう", "えんぜつ",
14726 "えんそく", "えんちょう", "えんとつ", "おいかける", "おいこす", "おいしい", "おいつく", "おうえん", "おうさま", "おうじ",
14727 "おうせつ", "おうたい", "おうふく", "おうべい", "おうよう", "おえる", "おおい", "おおう", "おおどおり", "おおや",
14728 "おおよそ", "おかえり", "おかず", "おがむ", "おかわり", "おぎなう", "おきる", "おくさま", "おくじょう", "おくりがな",
14729 "おくる", "おくれる", "おこす", "おこなう", "おこる", "おさえる", "おさない", "おさめる", "おしいれ", "おしえる",
14730 "おじぎ", "おじさん", "おしゃれ", "おそらく", "おそわる", "おたがい", "おたく", "おだやか", "おちつく", "おっと",
14731 "おつり", "おでかけ", "おとしもの", "おとなしい", "おどり", "おどろかす", "おばさん", "おまいり", "おめでとう", "おもいで",
14732 "おもう", "おもたい", "おもちゃ", "おやつ", "おやゆび", "およぼす", "おらんだ", "おろす", "おんがく", "おんけい",
14733 "おんしゃ", "おんせん", "おんだん", "おんちゅう", "おんどけい", "かあつ", "かいが", "がいき", "がいけん", "がいこう",
14734 "かいさつ", "かいしゃ", "かいすいよく", "かいぜん", "かいぞうど", "かいつう", "かいてん", "かいとう", "かいふく", "がいへき",
14735 "かいほう", "かいよう", "がいらい", "かいわ", "かえる", "かおり", "かかえる", "かがく", "かがし", "かがみ",
14736 "かくご", "かくとく", "かざる", "がぞう", "かたい", "かたち", "がちょう", "がっきゅう", "がっこう", "がっさん",
14737 "がっしょう", "かなざわし", "かのう", "がはく", "かぶか", "かほう", "かほご", "かまう", "かまぼこ", "かめれおん",
14738 "かゆい", "かようび", "からい", "かるい", "かろう", "かわく", "かわら", "がんか", "かんけい", "かんこう",
14739 "かんしゃ", "かんそう", "かんたん", "かんち", "がんばる", "きあい", "きあつ", "きいろ", "ぎいん", "きうい",
14740 "きうん", "きえる", "きおう", "きおく", "きおち", "きおん", "きかい", "きかく", "きかんしゃ", "ききて",
14741 "きくばり", "きくらげ", "きけんせい", "きこう", "きこえる", "きこく", "きさい", "きさく", "きさま", "きさらぎ",
14742 "ぎじかがく", "ぎしき", "ぎじたいけん", "ぎじにってい", "ぎじゅつしゃ", "きすう", "きせい", "きせき", "きせつ", "きそう",
14743 "きぞく", "きぞん", "きたえる", "きちょう", "きつえん", "ぎっちり", "きつつき", "きつね", "きてい", "きどう",
14744 "きどく", "きない", "きなが", "きなこ", "きぬごし", "きねん", "きのう", "きのした", "きはく", "きびしい",
14745 "きひん", "きふく", "きぶん", "きぼう", "きほん", "きまる", "きみつ", "きむずかしい", "きめる", "きもだめし",
14746 "きもち", "きもの", "きゃく", "きやく", "ぎゅうにく", "きよう", "きょうりゅう", "きらい", "きらく", "きりん",
14747 "きれい", "きれつ", "きろく", "ぎろん", "きわめる", "ぎんいろ", "きんかくじ", "きんじょ", "きんようび", "ぐあい",
14748 "くいず", "くうかん", "くうき", "くうぐん", "くうこう", "ぐうせい", "くうそう", "ぐうたら", "くうふく", "くうぼ",
14749 "くかん", "くきょう", "くげん", "ぐこう", "くさい", "くさき", "くさばな", "くさる", "くしゃみ", "くしょう",
14750 "くすのき", "くすりゆび", "くせげ", "くせん", "ぐたいてき", "くださる", "くたびれる", "くちこみ", "くちさき", "くつした",
14751 "ぐっすり", "くつろぐ", "くとうてん", "くどく", "くなん", "くねくね", "くのう", "くふう", "くみあわせ", "くみたてる",
14752 "くめる", "くやくしょ", "くらす", "くらべる", "くるま", "くれる", "くろう", "くわしい", "ぐんかん", "ぐんしょく",
14753 "ぐんたい", "ぐんて", "けあな", "けいかく", "けいけん", "けいこ", "けいさつ", "げいじゅつ", "けいたい", "げいのうじん",
14754 "けいれき", "けいろ", "けおとす", "けおりもの", "げきか", "げきげん", "げきだん", "げきちん", "げきとつ", "げきは",
14755 "げきやく", "げこう", "げこくじょう", "げざい", "けさき", "げざん", "けしき", "けしごむ", "けしょう", "げすと",
14756 "けたば", "けちゃっぷ", "けちらす", "けつあつ", "けつい", "けつえき", "けっこん", "けつじょ", "けっせき", "けってい",
14757 "けつまつ", "げつようび", "げつれい", "けつろん", "げどく", "けとばす", "けとる", "けなげ", "けなす", "けなみ",
14758 "けぬき", "げねつ", "けねん", "けはい", "げひん", "けぶかい", "げぼく", "けまり", "けみかる", "けむし",
14759 "けむり", "けもの", "けらい", "けろけろ", "けわしい", "けんい", "けんえつ", "けんお", "けんか", "げんき",
14760 "けんげん", "けんこう", "けんさく", "けんしゅう", "けんすう", "げんそう", "けんちく", "けんてい", "けんとう", "けんない",
14761 "けんにん", "げんぶつ", "けんま", "けんみん", "けんめい", "けんらん", "けんり", "こあくま", "こいぬ", "こいびと",
14762 "ごうい", "こうえん", "こうおん", "こうかん", "ごうきゅう", "ごうけい", "こうこう", "こうさい", "こうじ", "こうすい",
14763 "ごうせい", "こうそく", "こうたい", "こうちゃ", "こうつう", "こうてい", "こうどう", "こうない", "こうはい", "ごうほう",
14764 "ごうまん", "こうもく", "こうりつ", "こえる", "こおり", "ごかい", "ごがつ", "ごかん", "こくご", "こくさい",
14765 "こくとう", "こくない", "こくはく", "こぐま", "こけい", "こける", "ここのか", "こころ", "こさめ", "こしつ",
14766 "こすう", "こせい", "こせき", "こぜん", "こそだて", "こたい", "こたえる", "こたつ", "こちょう", "こっか",
14767 "こつこつ", "こつばん", "こつぶ", "こてい", "こてん", "ことがら", "ことし", "ことば", "ことり", "こなごな",
14768 "こねこね", "このまま", "このみ", "このよ", "ごはん", "こひつじ", "こふう", "こふん", "こぼれる", "ごまあぶら",
14769 "こまかい", "ごますり", "こまつな", "こまる", "こむぎこ", "こもじ", "こもち", "こもの", "こもん", "こやく",
14770 "こやま", "こゆう", "こゆび", "こよい", "こよう", "こりる", "これくしょん", "ころっけ", "こわもて", "こわれる",
14771 "こんいん", "こんかい", "こんき", "こんしゅう", "こんすい", "こんだて", "こんとん", "こんなん", "こんびに", "こんぽん",
14772 "こんまけ", "こんや", "こんれい", "こんわく", "ざいえき", "さいかい", "さいきん", "ざいげん", "ざいこ", "さいしょ",
14773 "さいせい", "ざいたく", "ざいちゅう", "さいてき", "ざいりょう", "さうな", "さかいし", "さがす", "さかな", "さかみち",
14774 "さがる", "さぎょう", "さくし", "さくひん", "さくら", "さこく", "さこつ", "さずかる", "ざせき", "さたん",
14775 "さつえい", "ざつおん", "ざっか", "ざつがく", "さっきょく", "ざっし", "さつじん", "ざっそう", "さつたば", "さつまいも",
14776 "さてい", "さといも", "さとう", "さとおや", "さとし", "さとる", "さのう", "さばく", "さびしい", "さべつ",
14777 "さほう", "さほど", "さます", "さみしい", "さみだれ", "さむけ", "さめる", "さやえんどう", "さゆう", "さよう",
14778 "さよく", "さらだ", "ざるそば", "さわやか", "さわる", "さんいん", "さんか", "さんきゃく", "さんこう", "さんさい",
14779 "ざんしょ", "さんすう", "さんせい", "さんそ", "さんち", "さんま", "さんみ", "さんらん", "しあい", "しあげ",
14780 "しあさって", "しあわせ", "しいく", "しいん", "しうち", "しえい", "しおけ", "しかい", "しかく", "じかん",
14781 "しごと", "しすう", "じだい", "したうけ", "したぎ", "したて", "したみ", "しちょう", "しちりん", "しっかり",
14782 "しつじ", "しつもん", "してい", "してき", "してつ", "じてん", "じどう", "しなぎれ", "しなもの", "しなん",
14783 "しねま", "しねん", "しのぐ", "しのぶ", "しはい", "しばかり", "しはつ", "しはらい", "しはん", "しひょう",
14784 "しふく", "じぶん", "しへい", "しほう", "しほん", "しまう", "しまる", "しみん", "しむける", "じむしょ",
14785 "しめい", "しめる", "しもん", "しゃいん", "しゃうん", "しゃおん", "じゃがいも", "しやくしょ", "しゃくほう", "しゃけん",
14786 "しゃこ", "しゃざい", "しゃしん", "しゃせん", "しゃそう", "しゃたい", "しゃちょう", "しゃっきん", "じゃま", "しゃりん",
14787 "しゃれい", "じゆう", "じゅうしょ", "しゅくはく", "じゅしん", "しゅっせき", "しゅみ", "しゅらば", "じゅんばん", "しょうかい",
14788 "しょくたく", "しょっけん", "しょどう", "しょもつ", "しらせる", "しらべる", "しんか", "しんこう", "じんじゃ", "しんせいじ",
14789 "しんちく", "しんりん", "すあげ", "すあし", "すあな", "ずあん", "すいえい", "すいか", "すいとう", "ずいぶん",
14790 "すいようび", "すうがく", "すうじつ", "すうせん", "すおどり", "すきま", "すくう", "すくない", "すける", "すごい",
14791 "すこし", "ずさん", "すずしい", "すすむ", "すすめる", "すっかり", "ずっしり", "ずっと", "すてき", "すてる",
14792 "すねる", "すのこ", "すはだ", "すばらしい", "ずひょう", "ずぶぬれ", "すぶり", "すふれ", "すべて", "すべる",
14793 "ずほう", "すぼん", "すまい", "すめし", "すもう", "すやき", "すらすら", "するめ", "すれちがう", "すろっと",
14794 "すわる", "すんぜん", "すんぽう", "せあぶら", "せいかつ", "せいげん", "せいじ", "せいよう", "せおう", "せかいかん",
14795 "せきにん", "せきむ", "せきゆ", "せきらんうん", "せけん", "せこう", "せすじ", "せたい", "せたけ", "せっかく",
14796 "せっきゃく", "ぜっく", "せっけん", "せっこつ", "せっさたくま", "せつぞく", "せつだん", "せつでん", "せっぱん", "せつび",
14797 "せつぶん", "せつめい", "せつりつ", "せなか", "せのび", "せはば", "せびろ", "せぼね", "せまい", "せまる",
14798 "せめる", "せもたれ", "せりふ", "ぜんあく", "せんい", "せんえい", "せんか", "せんきょ", "せんく", "せんげん",
14799 "ぜんご", "せんさい", "せんしゅ", "せんすい", "せんせい", "せんぞ", "せんたく", "せんちょう", "せんてい", "せんとう",
14800 "せんぬき", "せんねん", "せんぱい", "ぜんぶ", "ぜんぽう", "せんむ", "せんめんじょ", "せんもん", "せんやく", "せんゆう",
14801 "せんよう", "ぜんら", "ぜんりゃく", "せんれい", "せんろ", "そあく", "そいとげる", "そいね", "そうがんきょう", "そうき",
14802 "そうご", "そうしん", "そうだん", "そうなん", "そうび", "そうめん", "そうり", "そえもの", "そえん", "そがい",
14803 "そげき", "そこう", "そこそこ", "そざい", "そしな", "そせい", "そせん", "そそぐ", "そだてる", "そつう",
14804 "そつえん", "そっかん", "そつぎょう", "そっけつ", "そっこう", "そっせん", "そっと", "そとがわ", "そとづら", "そなえる",
14805 "そなた", "そふぼ", "そぼく", "そぼろ", "そまつ", "そまる", "そむく", "そむりえ", "そめる", "そもそも",
14806 "そよかぜ", "そらまめ", "そろう", "そんかい", "そんけい", "そんざい", "そんしつ", "そんぞく", "そんちょう", "ぞんび",
14807 "ぞんぶん", "そんみん", "たあい", "たいいん", "たいうん", "たいえき", "たいおう", "だいがく", "たいき", "たいぐう",
14808 "たいけん", "たいこ", "たいざい", "だいじょうぶ", "だいすき", "たいせつ", "たいそう", "だいたい", "たいちょう", "たいてい",
14809 "だいどころ", "たいない", "たいねつ", "たいのう", "たいはん", "だいひょう", "たいふう", "たいへん", "たいほ", "たいまつばな",
14810 "たいみんぐ", "たいむ", "たいめん", "たいやき", "たいよう", "たいら", "たいりょく", "たいる", "たいわん", "たうえ",
14811 "たえる", "たおす", "たおる", "たおれる", "たかい", "たかね", "たきび", "たくさん", "たこく", "たこやき",
14812 "たさい", "たしざん", "だじゃれ", "たすける", "たずさわる", "たそがれ", "たたかう", "たたく", "ただしい", "たたみ",
14813 "たちばな", "だっかい", "だっきゃく", "だっこ", "だっしゅつ", "だったい", "たてる", "たとえる", "たなばた", "たにん",
14814 "たぬき", "たのしみ", "たはつ", "たぶん", "たべる", "たぼう", "たまご", "たまる", "だむる", "ためいき",
14815 "ためす", "ためる", "たもつ", "たやすい", "たよる", "たらす", "たりきほんがん", "たりょう", "たりる", "たると",
14816 "たれる", "たれんと", "たろっと", "たわむれる", "だんあつ", "たんい", "たんおん", "たんか", "たんき", "たんけん",
14817 "たんご", "たんさん", "たんじょうび", "だんせい", "たんそく", "たんたい", "だんち", "たんてい", "たんとう", "だんな",
14818 "たんにん", "だんねつ", "たんのう", "たんぴん", "だんぼう", "たんまつ", "たんめい", "だんれつ", "だんろ", "だんわ",
14819 "ちあい", "ちあん", "ちいき", "ちいさい", "ちえん", "ちかい", "ちから", "ちきゅう", "ちきん", "ちけいず",
14820 "ちけん", "ちこく", "ちさい", "ちしき", "ちしりょう", "ちせい", "ちそう", "ちたい", "ちたん", "ちちおや",
14821 "ちつじょ", "ちてき", "ちてん", "ちぬき", "ちぬり", "ちのう", "ちひょう", "ちへいせん", "ちほう", "ちまた",
14822 "ちみつ", "ちみどろ", "ちめいど", "ちゃんこなべ", "ちゅうい", "ちゆりょく", "ちょうし", "ちょさくけん", "ちらし", "ちらみ",
14823 "ちりがみ", "ちりょう", "ちるど", "ちわわ", "ちんたい", "ちんもく", "ついか", "ついたち", "つうか", "つうじょう",
14824 "つうはん", "つうわ", "つかう", "つかれる", "つくね", "つくる", "つけね", "つける", "つごう", "つたえる",
14825 "つづく", "つつじ", "つつむ", "つとめる", "つながる", "つなみ", "つねづね", "つのる", "つぶす", "つまらない",
14826 "つまる", "つみき", "つめたい", "つもり", "つもる", "つよい", "つるぼ", "つるみく", "つわもの", "つわり",
14827 "てあし", "てあて", "てあみ", "ていおん", "ていか", "ていき", "ていけい", "ていこく", "ていさつ", "ていし",
14828 "ていせい", "ていたい", "ていど", "ていねい", "ていひょう", "ていへん", "ていぼう", "てうち", "ておくれ", "てきとう",
14829 "てくび", "でこぼこ", "てさぎょう", "てさげ", "てすり", "てそう", "てちがい", "てちょう", "てつがく", "てつづき",
14830 "でっぱ", "てつぼう", "てつや", "でぬかえ", "てぬき", "てぬぐい", "てのひら", "てはい", "てぶくろ", "てふだ",
14831 "てほどき", "てほん", "てまえ", "てまきずし", "てみじか", "てみやげ", "てらす", "てれび", "てわけ", "てわたし",
14832 "でんあつ", "てんいん", "てんかい", "てんき", "てんぐ", "てんけん", "てんごく", "てんさい", "てんし", "てんすう",
14833 "でんち", "てんてき", "てんとう", "てんない", "てんぷら", "てんぼうだい", "てんめつ", "てんらんかい", "でんりょく", "でんわ",
14834 "どあい", "といれ", "どうかん", "とうきゅう", "どうぐ", "とうし", "とうむぎ", "とおい", "とおか", "とおく",
14835 "とおす", "とおる", "とかい", "とかす", "ときおり", "ときどき", "とくい", "とくしゅう", "とくてん", "とくに",
14836 "とくべつ", "とけい", "とける", "とこや", "とさか", "としょかん", "とそう", "とたん", "とちゅう", "とっきゅう",
14837 "とっくん", "とつぜん", "とつにゅう", "とどける", "ととのえる", "とない", "となえる", "となり", "とのさま", "とばす",
14838 "どぶがわ", "とほう", "とまる", "とめる", "ともだち", "ともる", "どようび", "とらえる", "とんかつ", "どんぶり",
14839 "ないかく", "ないこう", "ないしょ", "ないす", "ないせん", "ないそう", "なおす", "ながい", "なくす", "なげる",
14840 "なこうど", "なさけ", "なたでここ", "なっとう", "なつやすみ", "ななおし", "なにごと", "なにもの", "なにわ", "なのか",
14841 "なふだ", "なまいき", "なまえ", "なまみ", "なみだ", "なめらか", "なめる", "なやむ", "ならう", "ならび",
14842 "ならぶ", "なれる", "なわとび", "なわばり", "にあう", "にいがた", "にうけ", "におい", "にかい", "にがて",
14843 "にきび", "にくしみ", "にくまん", "にげる", "にさんかたんそ", "にしき", "にせもの", "にちじょう", "にちようび", "にっか",
14844 "にっき", "にっけい", "にっこう", "にっさん", "にっしょく", "にっすう", "にっせき", "にってい", "になう", "にほん",
14845 "にまめ", "にもつ", "にやり", "にゅういん", "にりんしゃ", "にわとり", "にんい", "にんか", "にんき", "にんげん",
14846 "にんしき", "にんずう", "にんそう", "にんたい", "にんち", "にんてい", "にんにく", "にんぷ", "にんまり", "にんむ",
14847 "にんめい", "にんよう", "ぬいくぎ", "ぬかす", "ぬぐいとる", "ぬぐう", "ぬくもり", "ぬすむ", "ぬまえび", "ぬめり",
14848 "ぬらす", "ぬんちゃく", "ねあげ", "ねいき", "ねいる", "ねいろ", "ねぐせ", "ねくたい", "ねくら", "ねこぜ",
14849 "ねこむ", "ねさげ", "ねすごす", "ねそべる", "ねだん", "ねつい", "ねっしん", "ねつぞう", "ねったいぎょ", "ねぶそく",
14850 "ねふだ", "ねぼう", "ねほりはほり", "ねまき", "ねまわし", "ねみみ", "ねむい", "ねむたい", "ねもと", "ねらう",
14851 "ねわざ", "ねんいり", "ねんおし", "ねんかん", "ねんきん", "ねんぐ", "ねんざ", "ねんし", "ねんちゃく", "ねんど",
14852 "ねんぴ", "ねんぶつ", "ねんまつ", "ねんりょう", "ねんれい", "のいず", "のおづま", "のがす", "のきなみ", "のこぎり",
14853 "のこす", "のこる", "のせる", "のぞく", "のぞむ", "のたまう", "のちほど", "のっく", "のばす", "のはら",
14854 "のべる", "のぼる", "のみもの", "のやま", "のらいぬ", "のらねこ", "のりもの", "のりゆき", "のれん", "のんき",
14855 "ばあい", "はあく", "ばあさん", "ばいか", "ばいく", "はいけん", "はいご", "はいしん", "はいすい", "はいせん",
14856 "はいそう", "はいち", "ばいばい", "はいれつ", "はえる", "はおる", "はかい", "ばかり", "はかる", "はくしゅ",
14857 "はけん", "はこぶ", "はさみ", "はさん", "はしご", "ばしょ", "はしる", "はせる", "ぱそこん", "はそん",
14858 "はたん", "はちみつ", "はつおん", "はっかく", "はづき", "はっきり", "はっくつ", "はっけん", "はっこう", "はっさん",
14859 "はっしん", "はったつ", "はっちゅう", "はってん", "はっぴょう", "はっぽう", "はなす", "はなび", "はにかむ", "はぶらし",
14860 "はみがき", "はむかう", "はめつ", "はやい", "はやし", "はらう", "はろうぃん", "はわい", "はんい", "はんえい",
14861 "はんおん", "はんかく", "はんきょう", "ばんぐみ", "はんこ", "はんしゃ", "はんすう", "はんだん", "ぱんち", "ぱんつ",
14862 "はんてい", "はんとし", "はんのう", "はんぱ", "はんぶん", "はんぺん", "はんぼうき", "はんめい", "はんらん", "はんろん",
14863 "ひいき", "ひうん", "ひえる", "ひかく", "ひかり", "ひかる", "ひかん", "ひくい", "ひけつ", "ひこうき",
14864 "ひこく", "ひさい", "ひさしぶり", "ひさん", "びじゅつかん", "ひしょ", "ひそか", "ひそむ", "ひたむき", "ひだり",
14865 "ひたる", "ひつぎ", "ひっこし", "ひっし", "ひつじゅひん", "ひっす", "ひつぜん", "ぴったり", "ぴっちり", "ひつよう",
14866 "ひてい", "ひとごみ", "ひなまつり", "ひなん", "ひねる", "ひはん", "ひびく", "ひひょう", "ひほう", "ひまわり",
14867 "ひまん", "ひみつ", "ひめい", "ひめじし", "ひやけ", "ひやす", "ひよう", "びょうき", "ひらがな", "ひらく",
14868 "ひりつ", "ひりょう", "ひるま", "ひるやすみ", "ひれい", "ひろい", "ひろう", "ひろき", "ひろゆき", "ひんかく",
14869 "ひんけつ", "ひんこん", "ひんしゅ", "ひんそう", "ぴんち", "ひんぱん", "びんぼう", "ふあん", "ふいうち", "ふうけい",
14870 "ふうせん", "ぷうたろう", "ふうとう", "ふうふ", "ふえる", "ふおん", "ふかい", "ふきん", "ふくざつ", "ふくぶくろ",
14871 "ふこう", "ふさい", "ふしぎ", "ふじみ", "ふすま", "ふせい", "ふせぐ", "ふそく", "ぶたにく", "ふたん",
14872 "ふちょう", "ふつう", "ふつか", "ふっかつ", "ふっき", "ふっこく", "ぶどう", "ふとる", "ふとん", "ふのう",
14873 "ふはい", "ふひょう", "ふへん", "ふまん", "ふみん", "ふめつ", "ふめん", "ふよう", "ふりこ", "ふりる",
14874 "ふるい", "ふんいき", "ぶんがく", "ぶんぐ", "ふんしつ", "ぶんせき", "ふんそう", "ぶんぽう", "へいあん", "へいおん",
14875 "へいがい", "へいき", "へいげん", "へいこう", "へいさ", "へいしゃ", "へいせつ", "へいそ", "へいたく", "へいてん",
14876 "へいねつ", "へいわ", "へきが", "へこむ", "べにいろ", "べにしょうが", "へらす", "へんかん", "べんきょう", "べんごし",
14877 "へんさい", "へんたい", "べんり", "ほあん", "ほいく", "ぼうぎょ", "ほうこく", "ほうそう", "ほうほう", "ほうもん",
14878 "ほうりつ", "ほえる", "ほおん", "ほかん", "ほきょう", "ぼきん", "ほくろ", "ほけつ", "ほけん", "ほこう",
14879 "ほこる", "ほしい", "ほしつ", "ほしゅ", "ほしょう", "ほせい", "ほそい", "ほそく", "ほたて", "ほたる",
14880 "ぽちぶくろ", "ほっきょく", "ほっさ", "ほったん", "ほとんど", "ほめる", "ほんい", "ほんき", "ほんけ", "ほんしつ",
14881 "ほんやく", "まいにち", "まかい", "まかせる", "まがる", "まける", "まこと", "まさつ", "まじめ", "ますく",
14882 "まぜる", "まつり", "まとめ", "まなぶ", "まぬけ", "まねく", "まほう", "まもる", "まゆげ", "まよう",
14883 "まろやか", "まわす", "まわり", "まわる", "まんが", "まんきつ", "まんぞく", "まんなか", "みいら", "みうち",
14884 "みえる", "みがく", "みかた", "みかん", "みけん", "みこん", "みじかい", "みすい", "みすえる", "みせる",
14885 "みっか", "みつかる", "みつける", "みてい", "みとめる", "みなと", "みなみかさい", "みねらる", "みのう", "みのがす",
14886 "みほん", "みもと", "みやげ", "みらい", "みりょく", "みわく", "みんか", "みんぞく", "むいか", "むえき",
14887 "むえん", "むかい", "むかう", "むかえ", "むかし", "むぎちゃ", "むける", "むげん", "むさぼる", "むしあつい",
14888 "むしば", "むじゅん", "むしろ", "むすう", "むすこ", "むすぶ", "むすめ", "むせる", "むせん", "むちゅう",
14889 "むなしい", "むのう", "むやみ", "むよう", "むらさき", "むりょう", "むろん", "めいあん", "めいうん", "めいえん",
14890 "めいかく", "めいきょく", "めいさい", "めいし", "めいそう", "めいぶつ", "めいれい", "めいわく", "めぐまれる", "めざす",
14891 "めした", "めずらしい", "めだつ", "めまい", "めやす", "めんきょ", "めんせき", "めんどう", "もうしあげる", "もうどうけん",
14892 "もえる", "もくし", "もくてき", "もくようび", "もちろん", "もどる", "もらう", "もんく", "もんだい", "やおや",
14893 "やける", "やさい", "やさしい", "やすい", "やすたろう", "やすみ", "やせる", "やそう", "やたい", "やちん",
14894 "やっと", "やっぱり", "やぶる", "やめる", "ややこしい", "やよい", "やわらかい", "ゆうき", "ゆうびんきょく", "ゆうべ",
14895 "ゆうめい", "ゆけつ", "ゆしゅつ", "ゆせん", "ゆそう", "ゆたか", "ゆちゃく", "ゆでる", "ゆにゅう", "ゆびわ",
14896 "ゆらい", "ゆれる", "ようい", "ようか", "ようきゅう", "ようじ", "ようす", "ようちえん", "よかぜ", "よかん",
14897 "よきん", "よくせい", "よくぼう", "よけい", "よごれる", "よさん", "よしゅう", "よそう", "よそく", "よっか",
14898 "よてい", "よどがわく", "よねつ", "よやく", "よゆう", "よろこぶ", "よろしい", "らいう", "らくがき", "らくご",
14899 "らくさつ", "らくだ", "らしんばん", "らせん", "らぞく", "らたい", "らっか", "られつ", "りえき", "りかい",
14900 "りきさく", "りきせつ", "りくぐん", "りくつ", "りけん", "りこう", "りせい", "りそう", "りそく", "りてん",
14901 "りねん", "りゆう", "りゅうがく", "りよう", "りょうり", "りょかん", "りょくちゃ", "りょこう", "りりく", "りれき",
14902 "りろん", "りんご", "るいけい", "るいさい", "るいじ", "るいせき", "るすばん", "るりがわら", "れいかん", "れいぎ",
14903 "れいせい", "れいぞうこ", "れいとう", "れいぼう", "れきし", "れきだい", "れんあい", "れんけい", "れんこん", "れんさい",
14904 "れんしゅう", "れんぞく", "れんらく", "ろうか", "ろうご", "ろうじん", "ろうそく", "ろくが", "ろこつ", "ろじうら",
14905 "ろしゅつ", "ろせん", "ろてん", "ろめん", "ろれつ", "ろんぎ", "ろんぱ", "ろんぶん", "ろんり", "わかす",
14906 "わかめ", "わかやま", "わかれる", "わしつ", "わじまし", "わすれもの", "わらう", "われる"]
14907 </script>
14908 <script>WORDLISTS = typeof WORDLISTS == "undefined" ? {} : WORDLISTS;
14909 WORDLISTS["spanish"] = [
14910 "ábaco", "abdomen", "abeja", "abierto", "abogado", "abono", "aborto", "abrazo", "abrir", "abuelo",
14911 "abuso", "acabar", "academia", "acceso", "acción", "aceite", "acelga", "acento", "aceptar", "ácido",
14912 "aclarar", "acné", "acoger", "acoso", "activo", "acto", "actriz", "actuar", "acudir", "acuerdo",
14913 "acusar", "adicto", "admitir", "adoptar", "adorno", "aduana", "adulto", "aéreo", "afectar", "afición",
14914 "afinar", "afirmar", "ágil", "agitar", "agonía", "agosto", "agotar", "agregar", "agrio", "agua",
14915 "agudo", "águila", "aguja", "ahogo", "ahorro", "aire", "aislar", "ajedrez", "ajeno", "ajuste",
14916 "alacrán", "alambre", "alarma", "alba", "álbum", "alcalde", "aldea", "alegre", "alejar", "alerta",
14917 "aleta", "alfiler", "alga", "algodón", "aliado", "aliento", "alivio", "alma", "almeja", "almíbar",
14918 "altar", "alteza", "altivo", "alto", "altura", "alumno", "alzar", "amable", "amante", "amapola",
14919 "amargo", "amasar", "ámbar", "ámbito", "ameno", "amigo", "amistad", "amor", "amparo", "amplio",
14920 "ancho", "anciano", "ancla", "andar", "andén", "anemia", "ángulo", "anillo", "ánimo", "anís",
14921 "anotar", "antena", "antiguo", "antojo", "anual", "anular", "anuncio", "añadir", "añejo", "año",
14922 "apagar", "aparato", "apetito", "apio", "aplicar", "apodo", "aporte", "apoyo", "aprender", "aprobar",
14923 "apuesta", "apuro", "arado", "araña", "arar", "árbitro", "árbol", "arbusto", "archivo", "arco",
14924 "arder", "ardilla", "arduo", "área", "árido", "aries", "armonía", "arnés", "aroma", "arpa",
14925 "arpón", "arreglo", "arroz", "arruga", "arte", "artista", "asa", "asado", "asalto", "ascenso",
14926 "asegurar", "aseo", "asesor", "asiento", "asilo", "asistir", "asno", "asombro", "áspero", "astilla",
14927 "astro", "astuto", "asumir", "asunto", "atajo", "ataque", "atar", "atento", "ateo", "ático",
14928 "atleta", "átomo", "atraer", "atroz", "atún", "audaz", "audio", "auge", "aula", "aumento",
14929 "ausente", "autor", "aval", "avance", "avaro", "ave", "avellana", "avena", "avestruz", "avión",
14930 "aviso", "ayer", "ayuda", "ayuno", "azafrán", "azar", "azote", "azúcar", "azufre", "azul",
14931 "baba", "babor", "bache", "bahía", "baile", "bajar", "balanza", "balcón", "balde", "bambú",
14932 "banco", "banda", "baño", "barba", "barco", "barniz", "barro", "báscula", "bastón", "basura",
14933 "batalla", "batería", "batir", "batuta", "baúl", "bazar", "bebé", "bebida", "bello", "besar",
14934 "beso", "bestia", "bicho", "bien", "bingo", "blanco", "bloque", "blusa", "boa", "bobina",
14935 "bobo", "boca", "bocina", "boda", "bodega", "boina", "bola", "bolero", "bolsa", "bomba",
14936 "bondad", "bonito", "bono", "bonsái", "borde", "borrar", "bosque", "bote", "botín", "bóveda",
14937 "bozal", "bravo", "brazo", "brecha", "breve", "brillo", "brinco", "brisa", "broca", "broma",
14938 "bronce", "brote", "bruja", "brusco", "bruto", "buceo", "bucle", "bueno", "buey", "bufanda",
14939 "bufón", "búho", "buitre", "bulto", "burbuja", "burla", "burro", "buscar", "butaca", "buzón",
14940 "caballo", "cabeza", "cabina", "cabra", "cacao", "cadáver", "cadena", "caer", "café", "caída",
14941 "caimán", "caja", "cajón", "cal", "calamar", "calcio", "caldo", "calidad", "calle", "calma",
14942 "calor", "calvo", "cama", "cambio", "camello", "camino", "campo", "cáncer", "candil", "canela",
14943 "canguro", "canica", "canto", "caña", "cañón", "caoba", "caos", "capaz", "capitán", "capote",
14944 "captar", "capucha", "cara", "carbón", "cárcel", "careta", "carga", "cariño", "carne", "carpeta",
14945 "carro", "carta", "casa", "casco", "casero", "caspa", "castor", "catorce", "catre", "caudal",
14946 "causa", "cazo", "cebolla", "ceder", "cedro", "celda", "célebre", "celoso", "célula", "cemento",
14947 "ceniza", "centro", "cerca", "cerdo", "cereza", "cero", "cerrar", "certeza", "césped", "cetro",
14948 "chacal", "chaleco", "champú", "chancla", "chapa", "charla", "chico", "chiste", "chivo", "choque",
14949 "choza", "chuleta", "chupar", "ciclón", "ciego", "cielo", "cien", "cierto", "cifra", "cigarro",
14950 "cima", "cinco", "cine", "cinta", "ciprés", "circo", "ciruela", "cisne", "cita", "ciudad",
14951 "clamor", "clan", "claro", "clase", "clave", "cliente", "clima", "clínica", "cobre", "cocción",
14952 "cochino", "cocina", "coco", "código", "codo", "cofre", "coger", "cohete", "cojín", "cojo",
14953 "cola", "colcha", "colegio", "colgar", "colina", "collar", "colmo", "columna", "combate", "comer",
14954 "comida", "cómodo", "compra", "conde", "conejo", "conga", "conocer", "consejo", "contar", "copa",
14955 "copia", "corazón", "corbata", "corcho", "cordón", "corona", "correr", "coser", "cosmos", "costa",
14956 "cráneo", "cráter", "crear", "crecer", "creído", "crema", "cría", "crimen", "cripta", "crisis",
14957 "cromo", "crónica", "croqueta", "crudo", "cruz", "cuadro", "cuarto", "cuatro", "cubo", "cubrir",
14958 "cuchara", "cuello", "cuento", "cuerda", "cuesta", "cueva", "cuidar", "culebra", "culpa", "culto",
14959 "cumbre", "cumplir", "cuna", "cuneta", "cuota", "cupón", "cúpula", "curar", "curioso", "curso",
14960 "curva", "cutis", "dama", "danza", "dar", "dardo", "dátil", "deber", "débil", "década",
14961 "decir", "dedo", "defensa", "definir", "dejar", "delfín", "delgado", "delito", "demora", "denso",
14962 "dental", "deporte", "derecho", "derrota", "desayuno", "deseo", "desfile", "desnudo", "destino", "desvío",
14963 "detalle", "detener", "deuda", "día", "diablo", "diadema", "diamante", "diana", "diario", "dibujo",
14964 "dictar", "diente", "dieta", "diez", "difícil", "digno", "dilema", "diluir", "dinero", "directo",
14965 "dirigir", "disco", "diseño", "disfraz", "diva", "divino", "doble", "doce", "dolor", "domingo",
14966 "don", "donar", "dorado", "dormir", "dorso", "dos", "dosis", "dragón", "droga", "ducha",
14967 "duda", "duelo", "dueño", "dulce", "dúo", "duque", "durar", "dureza", "duro", "ébano",
14968 "ebrio", "echar", "eco", "ecuador", "edad", "edición", "edificio", "editor", "educar", "efecto",
14969 "eficaz", "eje", "ejemplo", "elefante", "elegir", "elemento", "elevar", "elipse", "élite", "elixir",
14970 "elogio", "eludir", "embudo", "emitir", "emoción", "empate", "empeño", "empleo", "empresa", "enano",
14971 "encargo", "enchufe", "encía", "enemigo", "enero", "enfado", "enfermo", "engaño", "enigma", "enlace",
14972 "enorme", "enredo", "ensayo", "enseñar", "entero", "entrar", "envase", "envío", "época", "equipo",
14973 "erizo", "escala", "escena", "escolar", "escribir", "escudo", "esencia", "esfera", "esfuerzo", "espada",
14974 "espejo", "espía", "esposa", "espuma", "esquí", "estar", "este", "estilo", "estufa", "etapa",
14975 "eterno", "ética", "etnia", "evadir", "evaluar", "evento", "evitar", "exacto", "examen", "exceso",
14976 "excusa", "exento", "exigir", "exilio", "existir", "éxito", "experto", "explicar", "exponer", "extremo",
14977 "fábrica", "fábula", "fachada", "fácil", "factor", "faena", "faja", "falda", "fallo", "falso",
14978 "faltar", "fama", "familia", "famoso", "faraón", "farmacia", "farol", "farsa", "fase", "fatiga",
14979 "fauna", "favor", "fax", "febrero", "fecha", "feliz", "feo", "feria", "feroz", "fértil",
14980 "fervor", "festín", "fiable", "fianza", "fiar", "fibra", "ficción", "ficha", "fideo", "fiebre",
14981 "fiel", "fiera", "fiesta", "figura", "fijar", "fijo", "fila", "filete", "filial", "filtro",
14982 "fin", "finca", "fingir", "finito", "firma", "flaco", "flauta", "flecha", "flor", "flota",
14983 "fluir", "flujo", "flúor", "fobia", "foca", "fogata", "fogón", "folio", "folleto", "fondo",
14984 "forma", "forro", "fortuna", "forzar", "fosa", "foto", "fracaso", "frágil", "franja", "frase",
14985 "fraude", "freír", "freno", "fresa", "frío", "frito", "fruta", "fuego", "fuente", "fuerza",
14986 "fuga", "fumar", "función", "funda", "furgón", "furia", "fusil", "fútbol", "futuro", "gacela",
14987 "gafas", "gaita", "gajo", "gala", "galería", "gallo", "gamba", "ganar", "gancho", "ganga",
14988 "ganso", "garaje", "garza", "gasolina", "gastar", "gato", "gavilán", "gemelo", "gemir", "gen",
14989 "género", "genio", "gente", "geranio", "gerente", "germen", "gesto", "gigante", "gimnasio", "girar",
14990 "giro", "glaciar", "globo", "gloria", "gol", "golfo", "goloso", "golpe", "goma", "gordo",
14991 "gorila", "gorra", "gota", "goteo", "gozar", "grada", "gráfico", "grano", "grasa", "gratis",
14992 "grave", "grieta", "grillo", "gripe", "gris", "grito", "grosor", "grúa", "grueso", "grumo",
14993 "grupo", "guante", "guapo", "guardia", "guerra", "guía", "guiño", "guion", "guiso", "guitarra",
14994 "gusano", "gustar", "haber", "hábil", "hablar", "hacer", "hacha", "hada", "hallar", "hamaca",
14995 "harina", "haz", "hazaña", "hebilla", "hebra", "hecho", "helado", "helio", "hembra", "herir",
14996 "hermano", "héroe", "hervir", "hielo", "hierro", "hígado", "higiene", "hijo", "himno", "historia",
14997 "hocico", "hogar", "hoguera", "hoja", "hombre", "hongo", "honor", "honra", "hora", "hormiga",
14998 "horno", "hostil", "hoyo", "hueco", "huelga", "huerta", "hueso", "huevo", "huida", "huir",
14999 "humano", "húmedo", "humilde", "humo", "hundir", "huracán", "hurto", "icono", "ideal", "idioma",
15000 "ídolo", "iglesia", "iglú", "igual", "ilegal", "ilusión", "imagen", "imán", "imitar", "impar",
15001 "imperio", "imponer", "impulso", "incapaz", "índice", "inerte", "infiel", "informe", "ingenio", "inicio",
15002 "inmenso", "inmune", "innato", "insecto", "instante", "interés", "íntimo", "intuir", "inútil", "invierno",
15003 "ira", "iris", "ironía", "isla", "islote", "jabalí", "jabón", "jamón", "jarabe", "jardín",
15004 "jarra", "jaula", "jazmín", "jefe", "jeringa", "jinete", "jornada", "joroba", "joven", "joya",
15005 "juerga", "jueves", "juez", "jugador", "jugo", "juguete", "juicio", "junco", "jungla", "junio",
15006 "juntar", "júpiter", "jurar", "justo", "juvenil", "juzgar", "kilo", "koala", "labio", "lacio",
15007 "lacra", "lado", "ladrón", "lagarto", "lágrima", "laguna", "laico", "lamer", "lámina", "lámpara",
15008 "lana", "lancha", "langosta", "lanza", "lápiz", "largo", "larva", "lástima", "lata", "látex",
15009 "latir", "laurel", "lavar", "lazo", "leal", "lección", "leche", "lector", "leer", "legión",
15010 "legumbre", "lejano", "lengua", "lento", "leña", "león", "leopardo", "lesión", "letal", "letra",
15011 "leve", "leyenda", "libertad", "libro", "licor", "líder", "lidiar", "lienzo", "liga", "ligero",
15012 "lima", "límite", "limón", "limpio", "lince", "lindo", "línea", "lingote", "lino", "linterna",
15013 "líquido", "liso", "lista", "litera", "litio", "litro", "llaga", "llama", "llanto", "llave",
15014 "llegar", "llenar", "llevar", "llorar", "llover", "lluvia", "lobo", "loción", "loco", "locura",
15015 "lógica", "logro", "lombriz", "lomo", "lonja", "lote", "lucha", "lucir", "lugar", "lujo",
15016 "luna", "lunes", "lupa", "lustro", "luto", "luz", "maceta", "macho", "madera", "madre",
15017 "maduro", "maestro", "mafia", "magia", "mago", "maíz", "maldad", "maleta", "malla", "malo",
15018 "mamá", "mambo", "mamut", "manco", "mando", "manejar", "manga", "maniquí", "manjar", "mano",
15019 "manso", "manta", "mañana", "mapa", "máquina", "mar", "marco", "marea", "marfil", "margen",
15020 "marido", "mármol", "marrón", "martes", "marzo", "masa", "máscara", "masivo", "matar", "materia",
15021 "matiz", "matriz", "máximo", "mayor", "mazorca", "mecha", "medalla", "medio", "médula", "mejilla",
15022 "mejor", "melena", "melón", "memoria", "menor", "mensaje", "mente", "menú", "mercado", "merengue",
15023 "mérito", "mes", "mesón", "meta", "meter", "método", "metro", "mezcla", "miedo", "miel",
15024 "miembro", "miga", "mil", "milagro", "militar", "millón", "mimo", "mina", "minero", "mínimo",
15025 "minuto", "miope", "mirar", "misa", "miseria", "misil", "mismo", "mitad", "mito", "mochila",
15026 "moción", "moda", "modelo", "moho", "mojar", "molde", "moler", "molino", "momento", "momia",
15027 "monarca", "moneda", "monja", "monto", "moño", "morada", "morder", "moreno", "morir", "morro",
15028 "morsa", "mortal", "mosca", "mostrar", "motivo", "mover", "móvil", "mozo", "mucho", "mudar",
15029 "mueble", "muela", "muerte", "muestra", "mugre", "mujer", "mula", "muleta", "multa", "mundo",
15030 "muñeca", "mural", "muro", "músculo", "museo", "musgo", "música", "muslo", "nácar", "nación",
15031 "nadar", "naipe", "naranja", "nariz", "narrar", "nasal", "natal", "nativo", "natural", "náusea",
15032 "naval", "nave", "navidad", "necio", "néctar", "negar", "negocio", "negro", "neón", "nervio",
15033 "neto", "neutro", "nevar", "nevera", "nicho", "nido", "niebla", "nieto", "niñez", "niño",
15034 "nítido", "nivel", "nobleza", "noche", "nómina", "noria", "norma", "norte", "nota", "noticia",
15035 "novato", "novela", "novio", "nube", "nuca", "núcleo", "nudillo", "nudo", "nuera", "nueve",
15036 "nuez", "nulo", "número", "nutria", "oasis", "obeso", "obispo", "objeto", "obra", "obrero",
15037 "observar", "obtener", "obvio", "oca", "ocaso", "océano", "ochenta", "ocho", "ocio", "ocre",
15038 "octavo", "octubre", "oculto", "ocupar", "ocurrir", "odiar", "odio", "odisea", "oeste", "ofensa",
15039 "oferta", "oficio", "ofrecer", "ogro", "oído", "oír", "ojo", "ola", "oleada", "olfato",
15040 "olivo", "olla", "olmo", "olor", "olvido", "ombligo", "onda", "onza", "opaco", "opción",
15041 "ópera", "opinar", "oponer", "optar", "óptica", "opuesto", "oración", "orador", "oral", "órbita",
15042 "orca", "orden", "oreja", "órgano", "orgía", "orgullo", "oriente", "origen", "orilla", "oro",
15043 "orquesta", "oruga", "osadía", "oscuro", "osezno", "oso", "ostra", "otoño", "otro", "oveja",
15044 "óvulo", "óxido", "oxígeno", "oyente", "ozono", "pacto", "padre", "paella", "página", "pago",
15045 "país", "pájaro", "palabra", "palco", "paleta", "pálido", "palma", "paloma", "palpar", "pan",
15046 "panal", "pánico", "pantera", "pañuelo", "papá", "papel", "papilla", "paquete", "parar", "parcela",
15047 "pared", "parir", "paro", "párpado", "parque", "párrafo", "parte", "pasar", "paseo", "pasión",
15048 "paso", "pasta", "pata", "patio", "patria", "pausa", "pauta", "pavo", "payaso", "peatón",
15049 "pecado", "pecera", "pecho", "pedal", "pedir", "pegar", "peine", "pelar", "peldaño", "pelea",
15050 "peligro", "pellejo", "pelo", "peluca", "pena", "pensar", "peñón", "peón", "peor", "pepino",
15051 "pequeño", "pera", "percha", "perder", "pereza", "perfil", "perico", "perla", "permiso", "perro",
15052 "persona", "pesa", "pesca", "pésimo", "pestaña", "pétalo", "petróleo", "pez", "pezuña", "picar",
15053 "pichón", "pie", "piedra", "pierna", "pieza", "pijama", "pilar", "piloto", "pimienta", "pino",
15054 "pintor", "pinza", "piña", "piojo", "pipa", "pirata", "pisar", "piscina", "piso", "pista",
15055 "pitón", "pizca", "placa", "plan", "plata", "playa", "plaza", "pleito", "pleno", "plomo",
15056 "pluma", "plural", "pobre", "poco", "poder", "podio", "poema", "poesía", "poeta", "polen",
15057 "policía", "pollo", "polvo", "pomada", "pomelo", "pomo", "pompa", "poner", "porción", "portal",
15058 "posada", "poseer", "posible", "poste", "potencia", "potro", "pozo", "prado", "precoz", "pregunta",
15059 "premio", "prensa", "preso", "previo", "primo", "príncipe", "prisión", "privar", "proa", "probar",
15060 "proceso", "producto", "proeza", "profesor", "programa", "prole", "promesa", "pronto", "propio", "próximo",
15061 "prueba", "público", "puchero", "pudor", "pueblo", "puerta", "puesto", "pulga", "pulir", "pulmón",
15062 "pulpo", "pulso", "puma", "punto", "puñal", "puño", "pupa", "pupila", "puré", "quedar",
15063 "queja", "quemar", "querer", "queso", "quieto", "química", "quince", "quitar", "rábano", "rabia",
15064 "rabo", "ración", "radical", "raíz", "rama", "rampa", "rancho", "rango", "rapaz", "rápido",
15065 "rapto", "rasgo", "raspa", "rato", "rayo", "raza", "razón", "reacción", "realidad", "rebaño",
15066 "rebote", "recaer", "receta", "rechazo", "recoger", "recreo", "recto", "recurso", "red", "redondo",
15067 "reducir", "reflejo", "reforma", "refrán", "refugio", "regalo", "regir", "regla", "regreso", "rehén",
15068 "reino", "reír", "reja", "relato", "relevo", "relieve", "relleno", "reloj", "remar", "remedio",
15069 "remo", "rencor", "rendir", "renta", "reparto", "repetir", "reposo", "reptil", "res", "rescate",
15070 "resina", "respeto", "resto", "resumen", "retiro", "retorno", "retrato", "reunir", "revés", "revista",
15071 "rey", "rezar", "rico", "riego", "rienda", "riesgo", "rifa", "rígido", "rigor", "rincón",
15072 "riñón", "río", "riqueza", "risa", "ritmo", "rito", "rizo", "roble", "roce", "rociar",
15073 "rodar", "rodeo", "rodilla", "roer", "rojizo", "rojo", "romero", "romper", "ron", "ronco",
15074 "ronda", "ropa", "ropero", "rosa", "rosca", "rostro", "rotar", "rubí", "rubor", "rudo",
15075 "rueda", "rugir", "ruido", "ruina", "ruleta", "rulo", "rumbo", "rumor", "ruptura", "ruta",
15076 "rutina", "sábado", "saber", "sabio", "sable", "sacar", "sagaz", "sagrado", "sala", "saldo",
15077 "salero", "salir", "salmón", "salón", "salsa", "salto", "salud", "salvar", "samba", "sanción",
15078 "sandía", "sanear", "sangre", "sanidad", "sano", "santo", "sapo", "saque", "sardina", "sartén",
15079 "sastre", "satán", "sauna", "saxofón", "sección", "seco", "secreto", "secta", "sed", "seguir",
15080 "seis", "sello", "selva", "semana", "semilla", "senda", "sensor", "señal", "señor", "separar",
15081 "sepia", "sequía", "ser", "serie", "sermón", "servir", "sesenta", "sesión", "seta", "setenta",
15082 "severo", "sexo", "sexto", "sidra", "siesta", "siete", "siglo", "signo", "sílaba", "silbar",
15083 "silencio", "silla", "símbolo", "simio", "sirena", "sistema", "sitio", "situar", "sobre", "socio",
15084 "sodio", "sol", "solapa", "soldado", "soledad", "sólido", "soltar", "solución", "sombra", "sondeo",
15085 "sonido", "sonoro", "sonrisa", "sopa", "soplar", "soporte", "sordo", "sorpresa", "sorteo", "sostén",
15086 "sótano", "suave", "subir", "suceso", "sudor", "suegra", "suelo", "sueño", "suerte", "sufrir",
15087 "sujeto", "sultán", "sumar", "superar", "suplir", "suponer", "supremo", "sur", "surco", "sureño",
15088 "surgir", "susto", "sutil", "tabaco", "tabique", "tabla", "tabú", "taco", "tacto", "tajo",
15089 "talar", "talco", "talento", "talla", "talón", "tamaño", "tambor", "tango", "tanque", "tapa",
15090 "tapete", "tapia", "tapón", "taquilla", "tarde", "tarea", "tarifa", "tarjeta", "tarot", "tarro",
15091 "tarta", "tatuaje", "tauro", "taza", "tazón", "teatro", "techo", "tecla", "técnica", "tejado",
15092 "tejer", "tejido", "tela", "teléfono", "tema", "temor", "templo", "tenaz", "tender", "tener",
15093 "tenis", "tenso", "teoría", "terapia", "terco", "término", "ternura", "terror", "tesis", "tesoro",
15094 "testigo", "tetera", "texto", "tez", "tibio", "tiburón", "tiempo", "tienda", "tierra", "tieso",
15095 "tigre", "tijera", "tilde", "timbre", "tímido", "timo", "tinta", "tío", "típico", "tipo",
15096 "tira", "tirón", "titán", "títere", "título", "tiza", "toalla", "tobillo", "tocar", "tocino",
15097 "todo", "toga", "toldo", "tomar", "tono", "tonto", "topar", "tope", "toque", "tórax",
15098 "torero", "tormenta", "torneo", "toro", "torpedo", "torre", "torso", "tortuga", "tos", "tosco",
15099 "toser", "tóxico", "trabajo", "tractor", "traer", "tráfico", "trago", "traje", "tramo", "trance",
15100 "trato", "trauma", "trazar", "trébol", "tregua", "treinta", "tren", "trepar", "tres", "tribu",
15101 "trigo", "tripa", "triste", "triunfo", "trofeo", "trompa", "tronco", "tropa", "trote", "trozo",
15102 "truco", "trueno", "trufa", "tubería", "tubo", "tuerto", "tumba", "tumor", "túnel", "túnica",
15103 "turbina", "turismo", "turno", "tutor", "ubicar", "úlcera", "umbral", "unidad", "unir", "universo",
15104 "uno", "untar", "uña", "urbano", "urbe", "urgente", "urna", "usar", "usuario", "útil",
15105 "utopía", "uva", "vaca", "vacío", "vacuna", "vagar", "vago", "vaina", "vajilla", "vale",
15106 "válido", "valle", "valor", "válvula", "vampiro", "vara", "variar", "varón", "vaso", "vecino",
15107 "vector", "vehículo", "veinte", "vejez", "vela", "velero", "veloz", "vena", "vencer", "venda",
15108 "veneno", "vengar", "venir", "venta", "venus", "ver", "verano", "verbo", "verde", "vereda",
15109 "verja", "verso", "verter", "vía", "viaje", "vibrar", "vicio", "víctima", "vida", "vídeo",
15110 "vidrio", "viejo", "viernes", "vigor", "vil", "villa", "vinagre", "vino", "viñedo", "violín",
15111 "viral", "virgo", "virtud", "visor", "víspera", "vista", "vitamina", "viudo", "vivaz", "vivero",
15112 "vivir", "vivo", "volcán", "volumen", "volver", "voraz", "votar", "voto", "voz", "vuelo",
15113 "vulgar", "yacer", "yate", "yegua", "yema", "yerno", "yeso", "yodo", "yoga", "yogur",
15114 "zafiro", "zanja", "zapato", "zarza", "zona", "zorro", "zumo", "zurdo"]
15115 </script>
15116 <script>WORDLISTS = typeof WORDLISTS == "undefined" ? {} : WORDLISTS;
15117 WORDLISTS["chinese_simplified"] = [
15118 "的", "一", "是", "在", "不", "了", "有", "和", "人", "这",
15119 "中", "大", "为", "上", "个", "国", "我", "以", "要", "他",
15120 "时", "来", "用", "们", "生", "到", "作", "地", "于", "出",
15121 "就", "分", "对", "成", "会", "可", "主", "发", "年", "动",
15122 "同", "工", "也", "能", "下", "过", "子", "说", "产", "种",
15123 "面", "而", "方", "后", "多", "定", "行", "学", "法", "所",
15124 "民", "得", "经", "十", "三", "之", "进", "着", "等", "部",
15125 "度", "家", "电", "力", "里", "如", "水", "化", "高", "自",
15126 "二", "理", "起", "小", "物", "现", "实", "加", "量", "都",
15127 "两", "体", "制", "机", "当", "使", "点", "从", "业", "本",
15128 "去", "把", "性", "好", "应", "开", "它", "合", "还", "因",
15129 "由", "其", "些", "然", "前", "外", "天", "政", "四", "日",
15130 "那", "社", "义", "事", "平", "形", "相", "全", "表", "间",
15131 "样", "与", "关", "各", "重", "新", "线", "内", "数", "正",
15132 "心", "反", "你", "明", "看", "原", "又", "么", "利", "比",
15133 "或", "但", "质", "气", "第", "向", "道", "命", "此", "变",
15134 "条", "只", "没", "结", "解", "问", "意", "建", "月", "公",
15135 "无", "系", "军", "很", "情", "者", "最", "立", "代", "想",
15136 "已", "通", "并", "提", "直", "题", "党", "程", "展", "五",
15137 "果", "料", "象", "员", "革", "位", "入", "常", "文", "总",
15138 "次", "品", "式", "活", "设", "及", "管", "特", "件", "长",
15139 "求", "老", "头", "基", "资", "边", "流", "路", "级", "少",
15140 "图", "山", "统", "接", "知", "较", "将", "组", "见", "计",
15141 "别", "她", "手", "角", "期", "根", "论", "运", "农", "指",
15142 "几", "九", "区", "强", "放", "决", "西", "被", "干", "做",
15143 "必", "战", "先", "回", "则", "任", "取", "据", "处", "队",
15144 "南", "给", "色", "光", "门", "即", "保", "治", "北", "造",
15145 "百", "规", "热", "领", "七", "海", "口", "东", "导", "器",
15146 "压", "志", "世", "金", "增", "争", "济", "阶", "油", "思",
15147 "术", "极", "交", "受", "联", "什", "认", "六", "共", "权",
15148 "收", "证", "改", "清", "美", "再", "采", "转", "更", "单",
15149 "风", "切", "打", "白", "教", "速", "花", "带", "安", "场",
15150 "身", "车", "例", "真", "务", "具", "万", "每", "目", "至",
15151 "达", "走", "积", "示", "议", "声", "报", "斗", "完", "类",
15152 "八", "离", "华", "名", "确", "才", "科", "张", "信", "马",
15153 "节", "话", "米", "整", "空", "元", "况", "今", "集", "温",
15154 "传", "土", "许", "步", "群", "广", "石", "记", "需", "段",
15155 "研", "界", "拉", "林", "律", "叫", "且", "究", "观", "越",
15156 "织", "装", "影", "算", "低", "持", "音", "众", "书", "布",
15157 "复", "容", "儿", "须", "际", "商", "非", "验", "连", "断",
15158 "深", "难", "近", "矿", "千", "周", "委", "素", "技", "备",
15159 "半", "办", "青", "省", "列", "习", "响", "约", "支", "般",
15160 "史", "感", "劳", "便", "团", "往", "酸", "历", "市", "克",
15161 "何", "除", "消", "构", "府", "称", "太", "准", "精", "值",
15162 "号", "率", "族", "维", "划", "选", "标", "写", "存", "候",
15163 "毛", "亲", "快", "效", "斯", "院", "查", "江", "型", "眼",
15164 "王", "按", "格", "养", "易", "置", "派", "层", "片", "始",
15165 "却", "专", "状", "育", "厂", "京", "识", "适", "属", "圆",
15166 "包", "火", "住", "调", "满", "县", "局", "照", "参", "红",
15167 "细", "引", "听", "该", "铁", "价", "严", "首", "底", "液",
15168 "官", "德", "随", "病", "苏", "失", "尔", "死", "讲", "配",
15169 "女", "黄", "推", "显", "谈", "罪", "神", "艺", "呢", "席",
15170 "含", "企", "望", "密", "批", "营", "项", "防", "举", "球",
15171 "英", "氧", "势", "告", "李", "台", "落", "木", "帮", "轮",
15172 "破", "亚", "师", "围", "注", "远", "字", "材", "排", "供",
15173 "河", "态", "封", "另", "施", "减", "树", "溶", "怎", "止",
15174 "案", "言", "士", "均", "武", "固", "叶", "鱼", "波", "视",
15175 "仅", "费", "紧", "爱", "左", "章", "早", "朝", "害", "续",
15176 "轻", "服", "试", "食", "充", "兵", "源", "判", "护", "司",
15177 "足", "某", "练", "差", "致", "板", "田", "降", "黑", "犯",
15178 "负", "击", "范", "继", "兴", "似", "余", "坚", "曲", "输",
15179 "修", "故", "城", "夫", "够", "送", "笔", "船", "占", "右",
15180 "财", "吃", "富", "春", "职", "觉", "汉", "画", "功", "巴",
15181 "跟", "虽", "杂", "飞", "检", "吸", "助", "升", "阳", "互",
15182 "初", "创", "抗", "考", "投", "坏", "策", "古", "径", "换",
15183 "未", "跑", "留", "钢", "曾", "端", "责", "站", "简", "述",
15184 "钱", "副", "尽", "帝", "射", "草", "冲", "承", "独", "令",
15185 "限", "阿", "宣", "环", "双", "请", "超", "微", "让", "控",
15186 "州", "良", "轴", "找", "否", "纪", "益", "依", "优", "顶",
15187 "础", "载", "倒", "房", "突", "坐", "粉", "敌", "略", "客",
15188 "袁", "冷", "胜", "绝", "析", "块", "剂", "测", "丝", "协",
15189 "诉", "念", "陈", "仍", "罗", "盐", "友", "洋", "错", "苦",
15190 "夜", "刑", "移", "频", "逐", "靠", "混", "母", "短", "皮",
15191 "终", "聚", "汽", "村", "云", "哪", "既", "距", "卫", "停",
15192 "烈", "央", "察", "烧", "迅", "境", "若", "印", "洲", "刻",
15193 "括", "激", "孔", "搞", "甚", "室", "待", "核", "校", "散",
15194 "侵", "吧", "甲", "游", "久", "菜", "味", "旧", "模", "湖",
15195 "货", "损", "预", "阻", "毫", "普", "稳", "乙", "妈", "植",
15196 "息", "扩", "银", "语", "挥", "酒", "守", "拿", "序", "纸",
15197 "医", "缺", "雨", "吗", "针", "刘", "啊", "急", "唱", "误",
15198 "训", "愿", "审", "附", "获", "茶", "鲜", "粮", "斤", "孩",
15199 "脱", "硫", "肥", "善", "龙", "演", "父", "渐", "血", "欢",
15200 "械", "掌", "歌", "沙", "刚", "攻", "谓", "盾", "讨", "晚",
15201 "粒", "乱", "燃", "矛", "乎", "杀", "药", "宁", "鲁", "贵",
15202 "钟", "煤", "读", "班", "伯", "香", "介", "迫", "句", "丰",
15203 "培", "握", "兰", "担", "弦", "蛋", "沉", "假", "穿", "执",
15204 "答", "乐", "谁", "顺", "烟", "缩", "征", "脸", "喜", "松",
15205 "脚", "困", "异", "免", "背", "星", "福", "买", "染", "井",
15206 "概", "慢", "怕", "磁", "倍", "祖", "皇", "促", "静", "补",
15207 "评", "翻", "肉", "践", "尼", "衣", "宽", "扬", "棉", "希",
15208 "伤", "操", "垂", "秋", "宜", "氢", "套", "督", "振", "架",
15209 "亮", "末", "宪", "庆", "编", "牛", "触", "映", "雷", "销",
15210 "诗", "座", "居", "抓", "裂", "胞", "呼", "娘", "景", "威",
15211 "绿", "晶", "厚", "盟", "衡", "鸡", "孙", "延", "危", "胶",
15212 "屋", "乡", "临", "陆", "顾", "掉", "呀", "灯", "岁", "措",
15213 "束", "耐", "剧", "玉", "赵", "跳", "哥", "季", "课", "凯",
15214 "胡", "额", "款", "绍", "卷", "齐", "伟", "蒸", "殖", "永",
15215 "宗", "苗", "川", "炉", "岩", "弱", "零", "杨", "奏", "沿",
15216 "露", "杆", "探", "滑", "镇", "饭", "浓", "航", "怀", "赶",
15217 "库", "夺", "伊", "灵", "税", "途", "灭", "赛", "归", "召",
15218 "鼓", "播", "盘", "裁", "险", "康", "唯", "录", "菌", "纯",
15219 "借", "糖", "盖", "横", "符", "私", "努", "堂", "域", "枪",
15220 "润", "幅", "哈", "竟", "熟", "虫", "泽", "脑", "壤", "碳",
15221 "欧", "遍", "侧", "寨", "敢", "彻", "虑", "斜", "薄", "庭",
15222 "纳", "弹", "饲", "伸", "折", "麦", "湿", "暗", "荷", "瓦",
15223 "塞", "床", "筑", "恶", "户", "访", "塔", "奇", "透", "梁",
15224 "刀", "旋", "迹", "卡", "氯", "遇", "份", "毒", "泥", "退",
15225 "洗", "摆", "灰", "彩", "卖", "耗", "夏", "择", "忙", "铜",
15226 "献", "硬", "予", "繁", "圈", "雪", "函", "亦", "抽", "篇",
15227 "阵", "阴", "丁", "尺", "追", "堆", "雄", "迎", "泛", "爸",
15228 "楼", "避", "谋", "吨", "野", "猪", "旗", "累", "偏", "典",
15229 "馆", "索", "秦", "脂", "潮", "爷", "豆", "忽", "托", "惊",
15230 "塑", "遗", "愈", "朱", "替", "纤", "粗", "倾", "尚", "痛",
15231 "楚", "谢", "奋", "购", "磨", "君", "池", "旁", "碎", "骨",
15232 "监", "捕", "弟", "暴", "割", "贯", "殊", "释", "词", "亡",
15233 "壁", "顿", "宝", "午", "尘", "闻", "揭", "炮", "残", "冬",
15234 "桥", "妇", "警", "综", "招", "吴", "付", "浮", "遭", "徐",
15235 "您", "摇", "谷", "赞", "箱", "隔", "订", "男", "吹", "园",
15236 "纷", "唐", "败", "宋", "玻", "巨", "耕", "坦", "荣", "闭",
15237 "湾", "键", "凡", "驻", "锅", "救", "恩", "剥", "凝", "碱",
15238 "齿", "截", "炼", "麻", "纺", "禁", "废", "盛", "版", "缓",
15239 "净", "睛", "昌", "婚", "涉", "筒", "嘴", "插", "岸", "朗",
15240 "庄", "街", "藏", "姑", "贸", "腐", "奴", "啦", "惯", "乘",
15241 "伙", "恢", "匀", "纱", "扎", "辩", "耳", "彪", "臣", "亿",
15242 "璃", "抵", "脉", "秀", "萨", "俄", "网", "舞", "店", "喷",
15243 "纵", "寸", "汗", "挂", "洪", "贺", "闪", "柬", "爆", "烯",
15244 "津", "稻", "墙", "软", "勇", "像", "滚", "厘", "蒙", "芳",
15245 "肯", "坡", "柱", "荡", "腿", "仪", "旅", "尾", "轧", "冰",
15246 "贡", "登", "黎", "削", "钻", "勒", "逃", "障", "氨", "郭",
15247 "峰", "币", "港", "伏", "轨", "亩", "毕", "擦", "莫", "刺",
15248 "浪", "秘", "援", "株", "健", "售", "股", "岛", "甘", "泡",
15249 "睡", "童", "铸", "汤", "阀", "休", "汇", "舍", "牧", "绕",
15250 "炸", "哲", "磷", "绩", "朋", "淡", "尖", "启", "陷", "柴",
15251 "呈", "徒", "颜", "泪", "稍", "忘", "泵", "蓝", "拖", "洞",
15252 "授", "镜", "辛", "壮", "锋", "贫", "虚", "弯", "摩", "泰",
15253 "幼", "廷", "尊", "窗", "纲", "弄", "隶", "疑", "氏", "宫",
15254 "姐", "震", "瑞", "怪", "尤", "琴", "循", "描", "膜", "违",
15255 "夹", "腰", "缘", "珠", "穷", "森", "枝", "竹", "沟", "催",
15256 "绳", "忆", "邦", "剩", "幸", "浆", "栏", "拥", "牙", "贮",
15257 "礼", "滤", "钠", "纹", "罢", "拍", "咱", "喊", "袖", "埃",
15258 "勤", "罚", "焦", "潜", "伍", "墨", "欲", "缝", "姓", "刊",
15259 "饱", "仿", "奖", "铝", "鬼", "丽", "跨", "默", "挖", "链",
15260 "扫", "喝", "袋", "炭", "污", "幕", "诸", "弧", "励", "梅",
15261 "奶", "洁", "灾", "舟", "鉴", "苯", "讼", "抱", "毁", "懂",
15262 "寒", "智", "埔", "寄", "届", "跃", "渡", "挑", "丹", "艰",
15263 "贝", "碰", "拔", "爹", "戴", "码", "梦", "芽", "熔", "赤",
15264 "渔", "哭", "敬", "颗", "奔", "铅", "仲", "虎", "稀", "妹",
15265 "乏", "珍", "申", "桌", "遵", "允", "隆", "螺", "仓", "魏",
15266 "锐", "晓", "氮", "兼", "隐", "碍", "赫", "拨", "忠", "肃",
15267 "缸", "牵", "抢", "博", "巧", "壳", "兄", "杜", "讯", "诚",
15268 "碧", "祥", "柯", "页", "巡", "矩", "悲", "灌", "龄", "伦",
15269 "票", "寻", "桂", "铺", "圣", "恐", "恰", "郑", "趣", "抬",
15270 "荒", "腾", "贴", "柔", "滴", "猛", "阔", "辆", "妻", "填",
15271 "撤", "储", "签", "闹", "扰", "紫", "砂", "递", "戏", "吊",
15272 "陶", "伐", "喂", "疗", "瓶", "婆", "抚", "臂", "摸", "忍",
15273 "虾", "蜡", "邻", "胸", "巩", "挤", "偶", "弃", "槽", "劲",
15274 "乳", "邓", "吉", "仁", "烂", "砖", "租", "乌", "舰", "伴",
15275 "瓜", "浅", "丙", "暂", "燥", "橡", "柳", "迷", "暖", "牌",
15276 "秧", "胆", "详", "簧", "踏", "瓷", "谱", "呆", "宾", "糊",
15277 "洛", "辉", "愤", "竞", "隙", "怒", "粘", "乃", "绪", "肩",
15278 "籍", "敏", "涂", "熙", "皆", "侦", "悬", "掘", "享", "纠",
15279 "醒", "狂", "锁", "淀", "恨", "牲", "霸", "爬", "赏", "逆",
15280 "玩", "陵", "祝", "秒", "浙", "貌", "役", "彼", "悉", "鸭",
15281 "趋", "凤", "晨", "畜", "辈", "秩", "卵", "署", "梯", "炎",
15282 "滩", "棋", "驱", "筛", "峡", "冒", "啥", "寿", "译", "浸",
15283 "泉", "帽", "迟", "硅", "疆", "贷", "漏", "稿", "冠", "嫩",
15284 "胁", "芯", "牢", "叛", "蚀", "奥", "鸣", "岭", "羊", "凭",
15285 "串", "塘", "绘", "酵", "融", "盆", "锡", "庙", "筹", "冻",
15286 "辅", "摄", "袭", "筋", "拒", "僚", "旱", "钾", "鸟", "漆",
15287 "沈", "眉", "疏", "添", "棒", "穗", "硝", "韩", "逼", "扭",
15288 "侨", "凉", "挺", "碗", "栽", "炒", "杯", "患", "馏", "劝",
15289 "豪", "辽", "勃", "鸿", "旦", "吏", "拜", "狗", "埋", "辊",
15290 "掩", "饮", "搬", "骂", "辞", "勾", "扣", "估", "蒋", "绒",
15291 "雾", "丈", "朵", "姆", "拟", "宇", "辑", "陕", "雕", "偿",
15292 "蓄", "崇", "剪", "倡", "厅", "咬", "驶", "薯", "刷", "斥",
15293 "番", "赋", "奉", "佛", "浇", "漫", "曼", "扇", "钙", "桃",
15294 "扶", "仔", "返", "俗", "亏", "腔", "鞋", "棱", "覆", "框",
15295 "悄", "叔", "撞", "骗", "勘", "旺", "沸", "孤", "吐", "孟",
15296 "渠", "屈", "疾", "妙", "惜", "仰", "狠", "胀", "谐", "抛",
15297 "霉", "桑", "岗", "嘛", "衰", "盗", "渗", "脏", "赖", "涌",
15298 "甜", "曹", "阅", "肌", "哩", "厉", "烃", "纬", "毅", "昨",
15299 "伪", "症", "煮", "叹", "钉", "搭", "茎", "笼", "酷", "偷",
15300 "弓", "锥", "恒", "杰", "坑", "鼻", "翼", "纶", "叙", "狱",
15301 "逮", "罐", "络", "棚", "抑", "膨", "蔬", "寺", "骤", "穆",
15302 "冶", "枯", "册", "尸", "凸", "绅", "坯", "牺", "焰", "轰",
15303 "欣", "晋", "瘦", "御", "锭", "锦", "丧", "旬", "锻", "垄",
15304 "搜", "扑", "邀", "亭", "酯", "迈", "舒", "脆", "酶", "闲",
15305 "忧", "酚", "顽", "羽", "涨", "卸", "仗", "陪", "辟", "惩",
15306 "杭", "姚", "肚", "捉", "飘", "漂", "昆", "欺", "吾", "郎",
15307 "烷", "汁", "呵", "饰", "萧", "雅", "邮", "迁", "燕", "撒",
15308 "姻", "赴", "宴", "烦", "债", "帐", "斑", "铃", "旨", "醇",
15309 "董", "饼", "雏", "姿", "拌", "傅", "腹", "妥", "揉", "贤",
15310 "拆", "歪", "葡", "胺", "丢", "浩", "徽", "昂", "垫", "挡",
15311 "览", "贪", "慰", "缴", "汪", "慌", "冯", "诺", "姜", "谊",
15312 "凶", "劣", "诬", "耀", "昏", "躺", "盈", "骑", "乔", "溪",
15313 "丛", "卢", "抹", "闷", "咨", "刮", "驾", "缆", "悟", "摘",
15314 "铒", "掷", "颇", "幻", "柄", "惠", "惨", "佳", "仇", "腊",
15315 "窝", "涤", "剑", "瞧", "堡", "泼", "葱", "罩", "霍", "捞",
15316 "胎", "苍", "滨", "俩", "捅", "湘", "砍", "霞", "邵", "萄",
15317 "疯", "淮", "遂", "熊", "粪", "烘", "宿", "档", "戈", "驳",
15318 "嫂", "裕", "徙", "箭", "捐", "肠", "撑", "晒", "辨", "殿",
15319 "莲", "摊", "搅", "酱", "屏", "疫", "哀", "蔡", "堵", "沫",
15320 "皱", "畅", "叠", "阁", "莱", "敲", "辖", "钩", "痕", "坝",
15321 "巷", "饿", "祸", "丘", "玄", "溜", "曰", "逻", "彭", "尝",
15322 "卿", "妨", "艇", "吞", "韦", "怨", "矮", "歇" ]
15323 </script>
15324 <script>WORDLISTS = typeof WORDLISTS == "undefined" ? {} : WORDLISTS;
15325 WORDLISTS["chinese_traditional"] = [
15326 "的", "一", "是", "在", "不", "了", "有", "和", "人", "這",
15327 "中", "大", "為", "上", "個", "國", "我", "以", "要", "他",
15328 "時", "來", "用", "們", "生", "到", "作", "地", "於", "出",
15329 "就", "分", "對", "成", "會", "可", "主", "發", "年", "動",
15330 "同", "工", "也", "能", "下", "過", "子", "說", "產", "種",
15331 "面", "而", "方", "後", "多", "定", "行", "學", "法", "所",
15332 "民", "得", "經", "十", "三", "之", "進", "著", "等", "部",
15333 "度", "家", "電", "力", "裡", "如", "水", "化", "高", "自",
15334 "二", "理", "起", "小", "物", "現", "實", "加", "量", "都",
15335 "兩", "體", "制", "機", "當", "使", "點", "從", "業", "本",
15336 "去", "把", "性", "好", "應", "開", "它", "合", "還", "因",
15337 "由", "其", "些", "然", "前", "外", "天", "政", "四", "日",
15338 "那", "社", "義", "事", "平", "形", "相", "全", "表", "間",
15339 "樣", "與", "關", "各", "重", "新", "線", "內", "數", "正",
15340 "心", "反", "你", "明", "看", "原", "又", "麼", "利", "比",
15341 "或", "但", "質", "氣", "第", "向", "道", "命", "此", "變",
15342 "條", "只", "沒", "結", "解", "問", "意", "建", "月", "公",
15343 "無", "系", "軍", "很", "情", "者", "最", "立", "代", "想",
15344 "已", "通", "並", "提", "直", "題", "黨", "程", "展", "五",
15345 "果", "料", "象", "員", "革", "位", "入", "常", "文", "總",
15346 "次", "品", "式", "活", "設", "及", "管", "特", "件", "長",
15347 "求", "老", "頭", "基", "資", "邊", "流", "路", "級", "少",
15348 "圖", "山", "統", "接", "知", "較", "將", "組", "見", "計",
15349 "別", "她", "手", "角", "期", "根", "論", "運", "農", "指",
15350 "幾", "九", "區", "強", "放", "決", "西", "被", "幹", "做",
15351 "必", "戰", "先", "回", "則", "任", "取", "據", "處", "隊",
15352 "南", "給", "色", "光", "門", "即", "保", "治", "北", "造",
15353 "百", "規", "熱", "領", "七", "海", "口", "東", "導", "器",
15354 "壓", "志", "世", "金", "增", "爭", "濟", "階", "油", "思",
15355 "術", "極", "交", "受", "聯", "什", "認", "六", "共", "權",
15356 "收", "證", "改", "清", "美", "再", "採", "轉", "更", "單",
15357 "風", "切", "打", "白", "教", "速", "花", "帶", "安", "場",
15358 "身", "車", "例", "真", "務", "具", "萬", "每", "目", "至",
15359 "達", "走", "積", "示", "議", "聲", "報", "鬥", "完", "類",
15360 "八", "離", "華", "名", "確", "才", "科", "張", "信", "馬",
15361 "節", "話", "米", "整", "空", "元", "況", "今", "集", "溫",
15362 "傳", "土", "許", "步", "群", "廣", "石", "記", "需", "段",
15363 "研", "界", "拉", "林", "律", "叫", "且", "究", "觀", "越",
15364 "織", "裝", "影", "算", "低", "持", "音", "眾", "書", "布",
15365 "复", "容", "兒", "須", "際", "商", "非", "驗", "連", "斷",
15366 "深", "難", "近", "礦", "千", "週", "委", "素", "技", "備",
15367 "半", "辦", "青", "省", "列", "習", "響", "約", "支", "般",
15368 "史", "感", "勞", "便", "團", "往", "酸", "歷", "市", "克",
15369 "何", "除", "消", "構", "府", "稱", "太", "準", "精", "值",
15370 "號", "率", "族", "維", "劃", "選", "標", "寫", "存", "候",
15371 "毛", "親", "快", "效", "斯", "院", "查", "江", "型", "眼",
15372 "王", "按", "格", "養", "易", "置", "派", "層", "片", "始",
15373 "卻", "專", "狀", "育", "廠", "京", "識", "適", "屬", "圓",
15374 "包", "火", "住", "調", "滿", "縣", "局", "照", "參", "紅",
15375 "細", "引", "聽", "該", "鐵", "價", "嚴", "首", "底", "液",
15376 "官", "德", "隨", "病", "蘇", "失", "爾", "死", "講", "配",
15377 "女", "黃", "推", "顯", "談", "罪", "神", "藝", "呢", "席",
15378 "含", "企", "望", "密", "批", "營", "項", "防", "舉", "球",
15379 "英", "氧", "勢", "告", "李", "台", "落", "木", "幫", "輪",
15380 "破", "亞", "師", "圍", "注", "遠", "字", "材", "排", "供",
15381 "河", "態", "封", "另", "施", "減", "樹", "溶", "怎", "止",
15382 "案", "言", "士", "均", "武", "固", "葉", "魚", "波", "視",
15383 "僅", "費", "緊", "愛", "左", "章", "早", "朝", "害", "續",
15384 "輕", "服", "試", "食", "充", "兵", "源", "判", "護", "司",
15385 "足", "某", "練", "差", "致", "板", "田", "降", "黑", "犯",
15386 "負", "擊", "范", "繼", "興", "似", "餘", "堅", "曲", "輸",
15387 "修", "故", "城", "夫", "夠", "送", "筆", "船", "佔", "右",
15388 "財", "吃", "富", "春", "職", "覺", "漢", "畫", "功", "巴",
15389 "跟", "雖", "雜", "飛", "檢", "吸", "助", "昇", "陽", "互",
15390 "初", "創", "抗", "考", "投", "壞", "策", "古", "徑", "換",
15391 "未", "跑", "留", "鋼", "曾", "端", "責", "站", "簡", "述",
15392 "錢", "副", "盡", "帝", "射", "草", "衝", "承", "獨", "令",
15393 "限", "阿", "宣", "環", "雙", "請", "超", "微", "讓", "控",
15394 "州", "良", "軸", "找", "否", "紀", "益", "依", "優", "頂",
15395 "礎", "載", "倒", "房", "突", "坐", "粉", "敵", "略", "客",
15396 "袁", "冷", "勝", "絕", "析", "塊", "劑", "測", "絲", "協",
15397 "訴", "念", "陳", "仍", "羅", "鹽", "友", "洋", "錯", "苦",
15398 "夜", "刑", "移", "頻", "逐", "靠", "混", "母", "短", "皮",
15399 "終", "聚", "汽", "村", "雲", "哪", "既", "距", "衛", "停",
15400 "烈", "央", "察", "燒", "迅", "境", "若", "印", "洲", "刻",
15401 "括", "激", "孔", "搞", "甚", "室", "待", "核", "校", "散",
15402 "侵", "吧", "甲", "遊", "久", "菜", "味", "舊", "模", "湖",
15403 "貨", "損", "預", "阻", "毫", "普", "穩", "乙", "媽", "植",
15404 "息", "擴", "銀", "語", "揮", "酒", "守", "拿", "序", "紙",
15405 "醫", "缺", "雨", "嗎", "針", "劉", "啊", "急", "唱", "誤",
15406 "訓", "願", "審", "附", "獲", "茶", "鮮", "糧", "斤", "孩",
15407 "脫", "硫", "肥", "善", "龍", "演", "父", "漸", "血", "歡",
15408 "械", "掌", "歌", "沙", "剛", "攻", "謂", "盾", "討", "晚",
15409 "粒", "亂", "燃", "矛", "乎", "殺", "藥", "寧", "魯", "貴",
15410 "鐘", "煤", "讀", "班", "伯", "香", "介", "迫", "句", "豐",
15411 "培", "握", "蘭", "擔", "弦", "蛋", "沉", "假", "穿", "執",
15412 "答", "樂", "誰", "順", "煙", "縮", "徵", "臉", "喜", "松",
15413 "腳", "困", "異", "免", "背", "星", "福", "買", "染", "井",
15414 "概", "慢", "怕", "磁", "倍", "祖", "皇", "促", "靜", "補",
15415 "評", "翻", "肉", "踐", "尼", "衣", "寬", "揚", "棉", "希",
15416 "傷", "操", "垂", "秋", "宜", "氫", "套", "督", "振", "架",
15417 "亮", "末", "憲", "慶", "編", "牛", "觸", "映", "雷", "銷",
15418 "詩", "座", "居", "抓", "裂", "胞", "呼", "娘", "景", "威",
15419 "綠", "晶", "厚", "盟", "衡", "雞", "孫", "延", "危", "膠",
15420 "屋", "鄉", "臨", "陸", "顧", "掉", "呀", "燈", "歲", "措",
15421 "束", "耐", "劇", "玉", "趙", "跳", "哥", "季", "課", "凱",
15422 "胡", "額", "款", "紹", "卷", "齊", "偉", "蒸", "殖", "永",
15423 "宗", "苗", "川", "爐", "岩", "弱", "零", "楊", "奏", "沿",
15424 "露", "桿", "探", "滑", "鎮", "飯", "濃", "航", "懷", "趕",
15425 "庫", "奪", "伊", "靈", "稅", "途", "滅", "賽", "歸", "召",
15426 "鼓", "播", "盤", "裁", "險", "康", "唯", "錄", "菌", "純",
15427 "借", "糖", "蓋", "橫", "符", "私", "努", "堂", "域", "槍",
15428 "潤", "幅", "哈", "竟", "熟", "蟲", "澤", "腦", "壤", "碳",
15429 "歐", "遍", "側", "寨", "敢", "徹", "慮", "斜", "薄", "庭",
15430 "納", "彈", "飼", "伸", "折", "麥", "濕", "暗", "荷", "瓦",
15431 "塞", "床", "築", "惡", "戶", "訪", "塔", "奇", "透", "梁",
15432 "刀", "旋", "跡", "卡", "氯", "遇", "份", "毒", "泥", "退",
15433 "洗", "擺", "灰", "彩", "賣", "耗", "夏", "擇", "忙", "銅",
15434 "獻", "硬", "予", "繁", "圈", "雪", "函", "亦", "抽", "篇",
15435 "陣", "陰", "丁", "尺", "追", "堆", "雄", "迎", "泛", "爸",
15436 "樓", "避", "謀", "噸", "野", "豬", "旗", "累", "偏", "典",
15437 "館", "索", "秦", "脂", "潮", "爺", "豆", "忽", "托", "驚",
15438 "塑", "遺", "愈", "朱", "替", "纖", "粗", "傾", "尚", "痛",
15439 "楚", "謝", "奮", "購", "磨", "君", "池", "旁", "碎", "骨",
15440 "監", "捕", "弟", "暴", "割", "貫", "殊", "釋", "詞", "亡",
15441 "壁", "頓", "寶", "午", "塵", "聞", "揭", "炮", "殘", "冬",
15442 "橋", "婦", "警", "綜", "招", "吳", "付", "浮", "遭", "徐",
15443 "您", "搖", "谷", "贊", "箱", "隔", "訂", "男", "吹", "園",
15444 "紛", "唐", "敗", "宋", "玻", "巨", "耕", "坦", "榮", "閉",
15445 "灣", "鍵", "凡", "駐", "鍋", "救", "恩", "剝", "凝", "鹼",
15446 "齒", "截", "煉", "麻", "紡", "禁", "廢", "盛", "版", "緩",
15447 "淨", "睛", "昌", "婚", "涉", "筒", "嘴", "插", "岸", "朗",
15448 "莊", "街", "藏", "姑", "貿", "腐", "奴", "啦", "慣", "乘",
15449 "夥", "恢", "勻", "紗", "扎", "辯", "耳", "彪", "臣", "億",
15450 "璃", "抵", "脈", "秀", "薩", "俄", "網", "舞", "店", "噴",
15451 "縱", "寸", "汗", "掛", "洪", "賀", "閃", "柬", "爆", "烯",
15452 "津", "稻", "牆", "軟", "勇", "像", "滾", "厘", "蒙", "芳",
15453 "肯", "坡", "柱", "盪", "腿", "儀", "旅", "尾", "軋", "冰",
15454 "貢", "登", "黎", "削", "鑽", "勒", "逃", "障", "氨", "郭",
15455 "峰", "幣", "港", "伏", "軌", "畝", "畢", "擦", "莫", "刺",
15456 "浪", "秘", "援", "株", "健", "售", "股", "島", "甘", "泡",
15457 "睡", "童", "鑄", "湯", "閥", "休", "匯", "舍", "牧", "繞",
15458 "炸", "哲", "磷", "績", "朋", "淡", "尖", "啟", "陷", "柴",
15459 "呈", "徒", "顏", "淚", "稍", "忘", "泵", "藍", "拖", "洞",
15460 "授", "鏡", "辛", "壯", "鋒", "貧", "虛", "彎", "摩", "泰",
15461 "幼", "廷", "尊", "窗", "綱", "弄", "隸", "疑", "氏", "宮",
15462 "姐", "震", "瑞", "怪", "尤", "琴", "循", "描", "膜", "違",
15463 "夾", "腰", "緣", "珠", "窮", "森", "枝", "竹", "溝", "催",
15464 "繩", "憶", "邦", "剩", "幸", "漿", "欄", "擁", "牙", "貯",
15465 "禮", "濾", "鈉", "紋", "罷", "拍", "咱", "喊", "袖", "埃",
15466 "勤", "罰", "焦", "潛", "伍", "墨", "欲", "縫", "姓", "刊",
15467 "飽", "仿", "獎", "鋁", "鬼", "麗", "跨", "默", "挖", "鏈",
15468 "掃", "喝", "袋", "炭", "污", "幕", "諸", "弧", "勵", "梅",
15469 "奶", "潔", "災", "舟", "鑑", "苯", "訟", "抱", "毀", "懂",
15470 "寒", "智", "埔", "寄", "屆", "躍", "渡", "挑", "丹", "艱",
15471 "貝", "碰", "拔", "爹", "戴", "碼", "夢", "芽", "熔", "赤",
15472 "漁", "哭", "敬", "顆", "奔", "鉛", "仲", "虎", "稀", "妹",
15473 "乏", "珍", "申", "桌", "遵", "允", "隆", "螺", "倉", "魏",
15474 "銳", "曉", "氮", "兼", "隱", "礙", "赫", "撥", "忠", "肅",
15475 "缸", "牽", "搶", "博", "巧", "殼", "兄", "杜", "訊", "誠",
15476 "碧", "祥", "柯", "頁", "巡", "矩", "悲", "灌", "齡", "倫",
15477 "票", "尋", "桂", "鋪", "聖", "恐", "恰", "鄭", "趣", "抬",
15478 "荒", "騰", "貼", "柔", "滴", "猛", "闊", "輛", "妻", "填",
15479 "撤", "儲", "簽", "鬧", "擾", "紫", "砂", "遞", "戲", "吊",
15480 "陶", "伐", "餵", "療", "瓶", "婆", "撫", "臂", "摸", "忍",
15481 "蝦", "蠟", "鄰", "胸", "鞏", "擠", "偶", "棄", "槽", "勁",
15482 "乳", "鄧", "吉", "仁", "爛", "磚", "租", "烏", "艦", "伴",
15483 "瓜", "淺", "丙", "暫", "燥", "橡", "柳", "迷", "暖", "牌",
15484 "秧", "膽", "詳", "簧", "踏", "瓷", "譜", "呆", "賓", "糊",
15485 "洛", "輝", "憤", "競", "隙", "怒", "粘", "乃", "緒", "肩",
15486 "籍", "敏", "塗", "熙", "皆", "偵", "懸", "掘", "享", "糾",
15487 "醒", "狂", "鎖", "淀", "恨", "牲", "霸", "爬", "賞", "逆",
15488 "玩", "陵", "祝", "秒", "浙", "貌", "役", "彼", "悉", "鴨",
15489 "趨", "鳳", "晨", "畜", "輩", "秩", "卵", "署", "梯", "炎",
15490 "灘", "棋", "驅", "篩", "峽", "冒", "啥", "壽", "譯", "浸",
15491 "泉", "帽", "遲", "矽", "疆", "貸", "漏", "稿", "冠", "嫩",
15492 "脅", "芯", "牢", "叛", "蝕", "奧", "鳴", "嶺", "羊", "憑",
15493 "串", "塘", "繪", "酵", "融", "盆", "錫", "廟", "籌", "凍",
15494 "輔", "攝", "襲", "筋", "拒", "僚", "旱", "鉀", "鳥", "漆",
15495 "沈", "眉", "疏", "添", "棒", "穗", "硝", "韓", "逼", "扭",
15496 "僑", "涼", "挺", "碗", "栽", "炒", "杯", "患", "餾", "勸",
15497 "豪", "遼", "勃", "鴻", "旦", "吏", "拜", "狗", "埋", "輥",
15498 "掩", "飲", "搬", "罵", "辭", "勾", "扣", "估", "蔣", "絨",
15499 "霧", "丈", "朵", "姆", "擬", "宇", "輯", "陝", "雕", "償",
15500 "蓄", "崇", "剪", "倡", "廳", "咬", "駛", "薯", "刷", "斥",
15501 "番", "賦", "奉", "佛", "澆", "漫", "曼", "扇", "鈣", "桃",
15502 "扶", "仔", "返", "俗", "虧", "腔", "鞋", "棱", "覆", "框",
15503 "悄", "叔", "撞", "騙", "勘", "旺", "沸", "孤", "吐", "孟",
15504 "渠", "屈", "疾", "妙", "惜", "仰", "狠", "脹", "諧", "拋",
15505 "黴", "桑", "崗", "嘛", "衰", "盜", "滲", "臟", "賴", "湧",
15506 "甜", "曹", "閱", "肌", "哩", "厲", "烴", "緯", "毅", "昨",
15507 "偽", "症", "煮", "嘆", "釘", "搭", "莖", "籠", "酷", "偷",
15508 "弓", "錐", "恆", "傑", "坑", "鼻", "翼", "綸", "敘", "獄",
15509 "逮", "罐", "絡", "棚", "抑", "膨", "蔬", "寺", "驟", "穆",
15510 "冶", "枯", "冊", "屍", "凸", "紳", "坯", "犧", "焰", "轟",
15511 "欣", "晉", "瘦", "禦", "錠", "錦", "喪", "旬", "鍛", "壟",
15512 "搜", "撲", "邀", "亭", "酯", "邁", "舒", "脆", "酶", "閒",
15513 "憂", "酚", "頑", "羽", "漲", "卸", "仗", "陪", "闢", "懲",
15514 "杭", "姚", "肚", "捉", "飄", "漂", "昆", "欺", "吾", "郎",
15515 "烷", "汁", "呵", "飾", "蕭", "雅", "郵", "遷", "燕", "撒",
15516 "姻", "赴", "宴", "煩", "債", "帳", "斑", "鈴", "旨", "醇",
15517 "董", "餅", "雛", "姿", "拌", "傅", "腹", "妥", "揉", "賢",
15518 "拆", "歪", "葡", "胺", "丟", "浩", "徽", "昂", "墊", "擋",
15519 "覽", "貪", "慰", "繳", "汪", "慌", "馮", "諾", "姜", "誼",
15520 "兇", "劣", "誣", "耀", "昏", "躺", "盈", "騎", "喬", "溪",
15521 "叢", "盧", "抹", "悶", "諮", "刮", "駕", "纜", "悟", "摘",
15522 "鉺", "擲", "頗", "幻", "柄", "惠", "慘", "佳", "仇", "臘",
15523 "窩", "滌", "劍", "瞧", "堡", "潑", "蔥", "罩", "霍", "撈",
15524 "胎", "蒼", "濱", "倆", "捅", "湘", "砍", "霞", "邵", "萄",
15525 "瘋", "淮", "遂", "熊", "糞", "烘", "宿", "檔", "戈", "駁",
15526 "嫂", "裕", "徙", "箭", "捐", "腸", "撐", "曬", "辨", "殿",
15527 "蓮", "攤", "攪", "醬", "屏", "疫", "哀", "蔡", "堵", "沫",
15528 "皺", "暢", "疊", "閣", "萊", "敲", "轄", "鉤", "痕", "壩",
15529 "巷", "餓", "禍", "丘", "玄", "溜", "曰", "邏", "彭", "嘗",
15530 "卿", "妨", "艇", "吞", "韋", "怨", "矮", "歇" ]
15531 </script>
15532 <script>WORDLISTS = typeof WORDLISTS == "undefined" ? {} : WORDLISTS;
15533 WORDLISTS["french"] = [
15534 "abaisser", "abandon", "abdiquer", "abeille", "abolir", "aborder", "aboutir", "aboyer", "abrasif", "abreuver",
15535 "abriter", "abroger", "abrupt", "absence", "absolu", "absurde", "abusif", "abyssal", "académie", "acajou",
15536 "acarien", "accabler", "accepter", "acclamer", "accolade", "accroche", "accuser", "acerbe", "achat", "acheter",
15537 "aciduler", "acier", "acompte", "acquérir", "acronyme", "acteur", "actif", "actuel", "adepte", "adéquat",
15538 "adhésif", "adjectif", "adjuger", "admettre", "admirer", "adopter", "adorer", "adoucir", "adresse", "adroit",
15539 "adulte", "adverbe", "aérer", "aéronef", "affaire", "affecter", "affiche", "affreux", "affubler", "agacer",
15540 "agencer", "agile", "agiter", "agrafer", "agréable", "agrume", "aider", "aiguille", "ailier", "aimable",
15541 "aisance", "ajouter", "ajuster", "alarmer", "alchimie", "alerte", "algèbre", "algue", "aliéner", "aliment",
15542 "alléger", "alliage", "allouer", "allumer", "alourdir", "alpaga", "altesse", "alvéole", "amateur", "ambigu",
15543 "ambre", "aménager", "amertume", "amidon", "amiral", "amorcer", "amour", "amovible", "amphibie", "ampleur",
15544 "amusant", "analyse", "anaphore", "anarchie", "anatomie", "ancien", "anéantir", "angle", "angoisse", "anguleux",
15545 "animal", "annexer", "annonce", "annuel", "anodin", "anomalie", "anonyme", "anormal", "antenne", "antidote",
15546 "anxieux", "apaiser", "apéritif", "aplanir", "apologie", "appareil", "appeler", "apporter", "appuyer", "aquarium",
15547 "aqueduc", "arbitre", "arbuste", "ardeur", "ardoise", "argent", "arlequin", "armature", "armement", "armoire",
15548 "armure", "arpenter", "arracher", "arriver", "arroser", "arsenic", "artériel", "article", "aspect", "asphalte",
15549 "aspirer", "assaut", "asservir", "assiette", "associer", "assurer", "asticot", "astre", "astuce", "atelier",
15550 "atome", "atrium", "atroce", "attaque", "attentif", "attirer", "attraper", "aubaine", "auberge", "audace",
15551 "audible", "augurer", "aurore", "automne", "autruche", "avaler", "avancer", "avarice", "avenir", "averse",
15552 "aveugle", "aviateur", "avide", "avion", "aviser", "avoine", "avouer", "avril", "axial", "axiome",
15553 "badge", "bafouer", "bagage", "baguette", "baignade", "balancer", "balcon", "baleine", "balisage", "bambin",
15554 "bancaire", "bandage", "banlieue", "bannière", "banquier", "barbier", "baril", "baron", "barque", "barrage",
15555 "bassin", "bastion", "bataille", "bateau", "batterie", "baudrier", "bavarder", "belette", "bélier", "belote",
15556 "bénéfice", "berceau", "berger", "berline", "bermuda", "besace", "besogne", "bétail", "beurre", "biberon",
15557 "bicycle", "bidule", "bijou", "bilan", "bilingue", "billard", "binaire", "biologie", "biopsie", "biotype",
15558 "biscuit", "bison", "bistouri", "bitume", "bizarre", "blafard", "blague", "blanchir", "blessant", "blinder",
15559 "blond", "bloquer", "blouson", "bobard", "bobine", "boire", "boiser", "bolide", "bonbon", "bondir",
15560 "bonheur", "bonifier", "bonus", "bordure", "borne", "botte", "boucle", "boueux", "bougie", "boulon",
15561 "bouquin", "bourse", "boussole", "boutique", "boxeur", "branche", "brasier", "brave", "brebis", "brèche",
15562 "breuvage", "bricoler", "brigade", "brillant", "brioche", "brique", "brochure", "broder", "bronzer", "brousse",
15563 "broyeur", "brume", "brusque", "brutal", "bruyant", "buffle", "buisson", "bulletin", "bureau", "burin",
15564 "bustier", "butiner", "butoir", "buvable", "buvette", "cabanon", "cabine", "cachette", "cadeau", "cadre",
15565 "caféine", "caillou", "caisson", "calculer", "calepin", "calibre", "calmer", "calomnie", "calvaire", "camarade",
15566 "caméra", "camion", "campagne", "canal", "caneton", "canon", "cantine", "canular", "capable", "caporal",
15567 "caprice", "capsule", "capter", "capuche", "carabine", "carbone", "caresser", "caribou", "carnage", "carotte",
15568 "carreau", "carton", "cascade", "casier", "casque", "cassure", "causer", "caution", "cavalier", "caverne",
15569 "caviar", "cédille", "ceinture", "céleste", "cellule", "cendrier", "censurer", "central", "cercle", "cérébral",
15570 "cerise", "cerner", "cerveau", "cesser", "chagrin", "chaise", "chaleur", "chambre", "chance", "chapitre",
15571 "charbon", "chasseur", "chaton", "chausson", "chavirer", "chemise", "chenille", "chéquier", "chercher", "cheval",
15572 "chien", "chiffre", "chignon", "chimère", "chiot", "chlorure", "chocolat", "choisir", "chose", "chouette",
15573 "chrome", "chute", "cigare", "cigogne", "cimenter", "cinéma", "cintrer", "circuler", "cirer", "cirque",
15574 "citerne", "citoyen", "citron", "civil", "clairon", "clameur", "claquer", "classe", "clavier", "client",
15575 "cligner", "climat", "clivage", "cloche", "clonage", "cloporte", "cobalt", "cobra", "cocasse", "cocotier",
15576 "coder", "codifier", "coffre", "cogner", "cohésion", "coiffer", "coincer", "colère", "colibri", "colline",
15577 "colmater", "colonel", "combat", "comédie", "commande", "compact", "concert", "conduire", "confier", "congeler",
15578 "connoter", "consonne", "contact", "convexe", "copain", "copie", "corail", "corbeau", "cordage", "corniche",
15579 "corpus", "correct", "cortège", "cosmique", "costume", "coton", "coude", "coupure", "courage", "couteau",
15580 "couvrir", "coyote", "crabe", "crainte", "cravate", "crayon", "créature", "créditer", "crémeux", "creuser",
15581 "crevette", "cribler", "crier", "cristal", "critère", "croire", "croquer", "crotale", "crucial", "cruel",
15582 "crypter", "cubique", "cueillir", "cuillère", "cuisine", "cuivre", "culminer", "cultiver", "cumuler", "cupide",
15583 "curatif", "curseur", "cyanure", "cycle", "cylindre", "cynique", "daigner", "damier", "danger", "danseur",
15584 "dauphin", "débattre", "débiter", "déborder", "débrider", "débutant", "décaler", "décembre", "déchirer", "décider",
15585 "déclarer", "décorer", "décrire", "décupler", "dédale", "déductif", "déesse", "défensif", "défiler", "défrayer",
15586 "dégager", "dégivrer", "déglutir", "dégrafer", "déjeuner", "délice", "déloger", "demander", "demeurer", "démolir",
15587 "dénicher", "dénouer", "dentelle", "dénuder", "départ", "dépenser", "déphaser", "déplacer", "déposer", "déranger",
15588 "dérober", "désastre", "descente", "désert", "désigner", "désobéir", "dessiner", "destrier", "détacher", "détester",
15589 "détourer", "détresse", "devancer", "devenir", "deviner", "devoir", "diable", "dialogue", "diamant", "dicter",
15590 "différer", "digérer", "digital", "digne", "diluer", "dimanche", "diminuer", "dioxyde", "directif", "diriger",
15591 "discuter", "disposer", "dissiper", "distance", "divertir", "diviser", "docile", "docteur", "dogme", "doigt",
15592 "domaine", "domicile", "dompter", "donateur", "donjon", "donner", "dopamine", "dortoir", "dorure", "dosage",
15593 "doseur", "dossier", "dotation", "douanier", "double", "douceur", "douter", "doyen", "dragon", "draper",
15594 "dresser", "dribbler", "droiture", "duperie", "duplexe", "durable", "durcir", "dynastie", "éblouir", "écarter",
15595 "écharpe", "échelle", "éclairer", "éclipse", "éclore", "écluse", "école", "économie", "écorce", "écouter",
15596 "écraser", "écrémer", "écrivain", "écrou", "écume", "écureuil", "édifier", "éduquer", "effacer", "effectif",
15597 "effigie", "effort", "effrayer", "effusion", "égaliser", "égarer", "éjecter", "élaborer", "élargir", "électron",
15598 "élégant", "éléphant", "élève", "éligible", "élitisme", "éloge", "élucider", "éluder", "emballer", "embellir",
15599 "embryon", "émeraude", "émission", "emmener", "émotion", "émouvoir", "empereur", "employer", "emporter", "emprise",
15600 "émulsion", "encadrer", "enchère", "enclave", "encoche", "endiguer", "endosser", "endroit", "enduire", "énergie",
15601 "enfance", "enfermer", "enfouir", "engager", "engin", "englober", "énigme", "enjamber", "enjeu", "enlever",
15602 "ennemi", "ennuyeux", "enrichir", "enrobage", "enseigne", "entasser", "entendre", "entier", "entourer", "entraver",
15603 "énumérer", "envahir", "enviable", "envoyer", "enzyme", "éolien", "épaissir", "épargne", "épatant", "épaule",
15604 "épicerie", "épidémie", "épier", "épilogue", "épine", "épisode", "épitaphe", "époque", "épreuve", "éprouver",
15605 "épuisant", "équerre", "équipe", "ériger", "érosion", "erreur", "éruption", "escalier", "espadon", "espèce",
15606 "espiègle", "espoir", "esprit", "esquiver", "essayer", "essence", "essieu", "essorer", "estime", "estomac",
15607 "estrade", "étagère", "étaler", "étanche", "étatique", "éteindre", "étendoir", "éternel", "éthanol", "éthique",
15608 "ethnie", "étirer", "étoffer", "étoile", "étonnant", "étourdir", "étrange", "étroit", "étude", "euphorie",
15609 "évaluer", "évasion", "éventail", "évidence", "éviter", "évolutif", "évoquer", "exact", "exagérer", "exaucer",
15610 "exceller", "excitant", "exclusif", "excuse", "exécuter", "exemple", "exercer", "exhaler", "exhorter", "exigence",
15611 "exiler", "exister", "exotique", "expédier", "explorer", "exposer", "exprimer", "exquis", "extensif", "extraire",
15612 "exulter", "fable", "fabuleux", "facette", "facile", "facture", "faiblir", "falaise", "fameux", "famille",
15613 "farceur", "farfelu", "farine", "farouche", "fasciner", "fatal", "fatigue", "faucon", "fautif", "faveur",
15614 "favori", "fébrile", "féconder", "fédérer", "félin", "femme", "fémur", "fendoir", "féodal", "fermer",
15615 "féroce", "ferveur", "festival", "feuille", "feutre", "février", "fiasco", "ficeler", "fictif", "fidèle",
15616 "figure", "filature", "filetage", "filière", "filleul", "filmer", "filou", "filtrer", "financer", "finir",
15617 "fiole", "firme", "fissure", "fixer", "flairer", "flamme", "flasque", "flatteur", "fléau", "flèche",
15618 "fleur", "flexion", "flocon", "flore", "fluctuer", "fluide", "fluvial", "folie", "fonderie", "fongible",
15619 "fontaine", "forcer", "forgeron", "formuler", "fortune", "fossile", "foudre", "fougère", "fouiller", "foulure",
15620 "fourmi", "fragile", "fraise", "franchir", "frapper", "frayeur", "frégate", "freiner", "frelon", "frémir",
15621 "frénésie", "frère", "friable", "friction", "frisson", "frivole", "froid", "fromage", "frontal", "frotter",
15622 "fruit", "fugitif", "fuite", "fureur", "furieux", "furtif", "fusion", "futur", "gagner", "galaxie",
15623 "galerie", "gambader", "garantir", "gardien", "garnir", "garrigue", "gazelle", "gazon", "géant", "gélatine",
15624 "gélule", "gendarme", "général", "génie", "genou", "gentil", "géologie", "géomètre", "géranium", "germe",
15625 "gestuel", "geyser", "gibier", "gicler", "girafe", "givre", "glace", "glaive", "glisser", "globe",
15626 "gloire", "glorieux", "golfeur", "gomme", "gonfler", "gorge", "gorille", "goudron", "gouffre", "goulot",
15627 "goupille", "gourmand", "goutte", "graduel", "graffiti", "graine", "grand", "grappin", "gratuit", "gravir",
15628 "grenat", "griffure", "griller", "grimper", "grogner", "gronder", "grotte", "groupe", "gruger", "grutier",
15629 "gruyère", "guépard", "guerrier", "guide", "guimauve", "guitare", "gustatif", "gymnaste", "gyrostat", "habitude",
15630 "hachoir", "halte", "hameau", "hangar", "hanneton", "haricot", "harmonie", "harpon", "hasard", "hélium",
15631 "hématome", "herbe", "hérisson", "hermine", "héron", "hésiter", "heureux", "hiberner", "hibou", "hilarant",
15632 "histoire", "hiver", "homard", "hommage", "homogène", "honneur", "honorer", "honteux", "horde", "horizon",
15633 "horloge", "hormone", "horrible", "houleux", "housse", "hublot", "huileux", "humain", "humble", "humide",
15634 "humour", "hurler", "hydromel", "hygiène", "hymne", "hypnose", "idylle", "ignorer", "iguane", "illicite",
15635 "illusion", "image", "imbiber", "imiter", "immense", "immobile", "immuable", "impact", "impérial", "implorer",
15636 "imposer", "imprimer", "imputer", "incarner", "incendie", "incident", "incliner", "incolore", "indexer", "indice",
15637 "inductif", "inédit", "ineptie", "inexact", "infini", "infliger", "informer", "infusion", "ingérer", "inhaler",
15638 "inhiber", "injecter", "injure", "innocent", "inoculer", "inonder", "inscrire", "insecte", "insigne", "insolite",
15639 "inspirer", "instinct", "insulter", "intact", "intense", "intime", "intrigue", "intuitif", "inutile", "invasion",
15640 "inventer", "inviter", "invoquer", "ironique", "irradier", "irréel", "irriter", "isoler", "ivoire", "ivresse",
15641 "jaguar", "jaillir", "jambe", "janvier", "jardin", "jauger", "jaune", "javelot", "jetable", "jeton",
15642 "jeudi", "jeunesse", "joindre", "joncher", "jongler", "joueur", "jouissif", "journal", "jovial", "joyau",
15643 "joyeux", "jubiler", "jugement", "junior", "jupon", "juriste", "justice", "juteux", "juvénile", "kayak",
15644 "kimono", "kiosque", "label", "labial", "labourer", "lacérer", "lactose", "lagune", "laine", "laisser",
15645 "laitier", "lambeau", "lamelle", "lampe", "lanceur", "langage", "lanterne", "lapin", "largeur", "larme",
15646 "laurier", "lavabo", "lavoir", "lecture", "légal", "léger", "légume", "lessive", "lettre", "levier",
15647 "lexique", "lézard", "liasse", "libérer", "libre", "licence", "licorne", "liège", "lièvre", "ligature",
15648 "ligoter", "ligue", "limer", "limite", "limonade", "limpide", "linéaire", "lingot", "lionceau", "liquide",
15649 "lisière", "lister", "lithium", "litige", "littoral", "livreur", "logique", "lointain", "loisir", "lombric",
15650 "loterie", "louer", "lourd", "loutre", "louve", "loyal", "lubie", "lucide", "lucratif", "lueur",
15651 "lugubre", "luisant", "lumière", "lunaire", "lundi", "luron", "lutter", "luxueux", "machine", "magasin",
15652 "magenta", "magique", "maigre", "maillon", "maintien", "mairie", "maison", "majorer", "malaxer", "maléfice",
15653 "malheur", "malice", "mallette", "mammouth", "mandater", "maniable", "manquant", "manteau", "manuel", "marathon",
15654 "marbre", "marchand", "mardi", "maritime", "marqueur", "marron", "marteler", "mascotte", "massif", "matériel",
15655 "matière", "matraque", "maudire", "maussade", "mauve", "maximal", "méchant", "méconnu", "médaille", "médecin",
15656 "méditer", "méduse", "meilleur", "mélange", "mélodie", "membre", "mémoire", "menacer", "mener", "menhir",
15657 "mensonge", "mentor", "mercredi", "mérite", "merle", "messager", "mesure", "métal", "météore", "méthode",
15658 "métier", "meuble", "miauler", "microbe", "miette", "mignon", "migrer", "milieu", "million", "mimique",
15659 "mince", "minéral", "minimal", "minorer", "minute", "miracle", "miroiter", "missile", "mixte", "mobile",
15660 "moderne", "moelleux", "mondial", "moniteur", "monnaie", "monotone", "monstre", "montagne", "monument", "moqueur",
15661 "morceau", "morsure", "mortier", "moteur", "motif", "mouche", "moufle", "moulin", "mousson", "mouton",
15662 "mouvant", "multiple", "munition", "muraille", "murène", "murmure", "muscle", "muséum", "musicien", "mutation",
15663 "muter", "mutuel", "myriade", "myrtille", "mystère", "mythique", "nageur", "nappe", "narquois", "narrer",
15664 "natation", "nation", "nature", "naufrage", "nautique", "navire", "nébuleux", "nectar", "néfaste", "négation",
15665 "négliger", "négocier", "neige", "nerveux", "nettoyer", "neurone", "neutron", "neveu", "niche", "nickel",
15666 "nitrate", "niveau", "noble", "nocif", "nocturne", "noirceur", "noisette", "nomade", "nombreux", "nommer",
15667 "normatif", "notable", "notifier", "notoire", "nourrir", "nouveau", "novateur", "novembre", "novice", "nuage",
15668 "nuancer", "nuire", "nuisible", "numéro", "nuptial", "nuque", "nutritif", "obéir", "objectif", "obliger",
15669 "obscur", "observer", "obstacle", "obtenir", "obturer", "occasion", "occuper", "océan", "octobre", "octroyer",
15670 "octupler", "oculaire", "odeur", "odorant", "offenser", "officier", "offrir", "ogive", "oiseau", "oisillon",
15671 "olfactif", "olivier", "ombrage", "omettre", "onctueux", "onduler", "onéreux", "onirique", "opale", "opaque",
15672 "opérer", "opinion", "opportun", "opprimer", "opter", "optique", "orageux", "orange", "orbite", "ordonner",
15673 "oreille", "organe", "orgueil", "orifice", "ornement", "orque", "ortie", "osciller", "osmose", "ossature",
15674 "otarie", "ouragan", "ourson", "outil", "outrager", "ouvrage", "ovation", "oxyde", "oxygène", "ozone",
15675 "paisible", "palace", "palmarès", "palourde", "palper", "panache", "panda", "pangolin", "paniquer", "panneau",
15676 "panorama", "pantalon", "papaye", "papier", "papoter", "papyrus", "paradoxe", "parcelle", "paresse", "parfumer",
15677 "parler", "parole", "parrain", "parsemer", "partager", "parure", "parvenir", "passion", "pastèque", "paternel",
15678 "patience", "patron", "pavillon", "pavoiser", "payer", "paysage", "peigne", "peintre", "pelage", "pélican",
15679 "pelle", "pelouse", "peluche", "pendule", "pénétrer", "pénible", "pensif", "pénurie", "pépite", "péplum",
15680 "perdrix", "perforer", "période", "permuter", "perplexe", "persil", "perte", "peser", "pétale", "petit",
15681 "pétrir", "peuple", "pharaon", "phobie", "phoque", "photon", "phrase", "physique", "piano", "pictural",
15682 "pièce", "pierre", "pieuvre", "pilote", "pinceau", "pipette", "piquer", "pirogue", "piscine", "piston",
15683 "pivoter", "pixel", "pizza", "placard", "plafond", "plaisir", "planer", "plaque", "plastron", "plateau",
15684 "pleurer", "plexus", "pliage", "plomb", "plonger", "pluie", "plumage", "pochette", "poésie", "poète",
15685 "pointe", "poirier", "poisson", "poivre", "polaire", "policier", "pollen", "polygone", "pommade", "pompier",
15686 "ponctuel", "pondérer", "poney", "portique", "position", "posséder", "posture", "potager", "poteau", "potion",
15687 "pouce", "poulain", "poumon", "pourpre", "poussin", "pouvoir", "prairie", "pratique", "précieux", "prédire",
15688 "préfixe", "prélude", "prénom", "présence", "prétexte", "prévoir", "primitif", "prince", "prison", "priver",
15689 "problème", "procéder", "prodige", "profond", "progrès", "proie", "projeter", "prologue", "promener", "propre",
15690 "prospère", "protéger", "prouesse", "proverbe", "prudence", "pruneau", "psychose", "public", "puceron", "puiser",
15691 "pulpe", "pulsar", "punaise", "punitif", "pupitre", "purifier", "puzzle", "pyramide", "quasar", "querelle",
15692 "question", "quiétude", "quitter", "quotient", "racine", "raconter", "radieux", "ragondin", "raideur", "raisin",
15693 "ralentir", "rallonge", "ramasser", "rapide", "rasage", "ratisser", "ravager", "ravin", "rayonner", "réactif",
15694 "réagir", "réaliser", "réanimer", "recevoir", "réciter", "réclamer", "récolter", "recruter", "reculer", "recycler",
15695 "rédiger", "redouter", "refaire", "réflexe", "réformer", "refrain", "refuge", "régalien", "région", "réglage",
15696 "régulier", "réitérer", "rejeter", "rejouer", "relatif", "relever", "relief", "remarque", "remède", "remise",
15697 "remonter", "remplir", "remuer", "renard", "renfort", "renifler", "renoncer", "rentrer", "renvoi", "replier",
15698 "reporter", "reprise", "reptile", "requin", "réserve", "résineux", "résoudre", "respect", "rester", "résultat",
15699 "rétablir", "retenir", "réticule", "retomber", "retracer", "réunion", "réussir", "revanche", "revivre", "révolte",
15700 "révulsif", "richesse", "rideau", "rieur", "rigide", "rigoler", "rincer", "riposter", "risible", "risque",
15701 "rituel", "rival", "rivière", "rocheux", "romance", "rompre", "ronce", "rondin", "roseau", "rosier",
15702 "rotatif", "rotor", "rotule", "rouge", "rouille", "rouleau", "routine", "royaume", "ruban", "rubis",
15703 "ruche", "ruelle", "rugueux", "ruiner", "ruisseau", "ruser", "rustique", "rythme", "sabler", "saboter",
15704 "sabre", "sacoche", "safari", "sagesse", "saisir", "salade", "salive", "salon", "saluer", "samedi",
15705 "sanction", "sanglier", "sarcasme", "sardine", "saturer", "saugrenu", "saumon", "sauter", "sauvage", "savant",
15706 "savonner", "scalpel", "scandale", "scélérat", "scénario", "sceptre", "schéma", "science", "scinder", "score",
15707 "scrutin", "sculpter", "séance", "sécable", "sécher", "secouer", "sécréter", "sédatif", "séduire", "seigneur",
15708 "séjour", "sélectif", "semaine", "sembler", "semence", "séminal", "sénateur", "sensible", "sentence", "séparer",
15709 "séquence", "serein", "sergent", "sérieux", "serrure", "sérum", "service", "sésame", "sévir", "sevrage",
15710 "sextuple", "sidéral", "siècle", "siéger", "siffler", "sigle", "signal", "silence", "silicium", "simple",
15711 "sincère", "sinistre", "siphon", "sirop", "sismique", "situer", "skier", "social", "socle", "sodium",
15712 "soigneux", "soldat", "soleil", "solitude", "soluble", "sombre", "sommeil", "somnoler", "sonde", "songeur",
15713 "sonnette", "sonore", "sorcier", "sortir", "sosie", "sottise", "soucieux", "soudure", "souffle", "soulever",
15714 "soupape", "source", "soutirer", "souvenir", "spacieux", "spatial", "spécial", "sphère", "spiral", "stable",
15715 "station", "sternum", "stimulus", "stipuler", "strict", "studieux", "stupeur", "styliste", "sublime", "substrat",
15716 "subtil", "subvenir", "succès", "sucre", "suffixe", "suggérer", "suiveur", "sulfate", "superbe", "supplier",
15717 "surface", "suricate", "surmener", "surprise", "sursaut", "survie", "suspect", "syllabe", "symbole", "symétrie",
15718 "synapse", "syntaxe", "système", "tabac", "tablier", "tactile", "tailler", "talent", "talisman", "talonner",
15719 "tambour", "tamiser", "tangible", "tapis", "taquiner", "tarder", "tarif", "tartine", "tasse", "tatami",
15720 "tatouage", "taupe", "taureau", "taxer", "témoin", "temporel", "tenaille", "tendre", "teneur", "tenir",
15721 "tension", "terminer", "terne", "terrible", "tétine", "texte", "thème", "théorie", "thérapie", "thorax",
15722 "tibia", "tiède", "timide", "tirelire", "tiroir", "tissu", "titane", "titre", "tituber", "toboggan",
15723 "tolérant", "tomate", "tonique", "tonneau", "toponyme", "torche", "tordre", "tornade", "torpille", "torrent",
15724 "torse", "tortue", "totem", "toucher", "tournage", "tousser", "toxine", "traction", "trafic", "tragique",
15725 "trahir", "train", "trancher", "travail", "trèfle", "tremper", "trésor", "treuil", "triage", "tribunal",
15726 "tricoter", "trilogie", "triomphe", "tripler", "triturer", "trivial", "trombone", "tronc", "tropical", "troupeau",
15727 "tuile", "tulipe", "tumulte", "tunnel", "turbine", "tuteur", "tutoyer", "tuyau", "tympan", "typhon",
15728 "typique", "tyran", "ubuesque", "ultime", "ultrason", "unanime", "unifier", "union", "unique", "unitaire",
15729 "univers", "uranium", "urbain", "urticant", "usage", "usine", "usuel", "usure", "utile", "utopie",
15730 "vacarme", "vaccin", "vagabond", "vague", "vaillant", "vaincre", "vaisseau", "valable", "valise", "vallon",
15731 "valve", "vampire", "vanille", "vapeur", "varier", "vaseux", "vassal", "vaste", "vecteur", "vedette",
15732 "végétal", "véhicule", "veinard", "véloce", "vendredi", "vénérer", "venger", "venimeux", "ventouse", "verdure",
15733 "vérin", "vernir", "verrou", "verser", "vertu", "veston", "vétéran", "vétuste", "vexant", "vexer",
15734 "viaduc", "viande", "victoire", "vidange", "vidéo", "vignette", "vigueur", "vilain", "village", "vinaigre",
15735 "violon", "vipère", "virement", "virtuose", "virus", "visage", "viseur", "vision", "visqueux", "visuel",
15736 "vital", "vitesse", "viticole", "vitrine", "vivace", "vivipare", "vocation", "voguer", "voile", "voisin",
15737 "voiture", "volaille", "volcan", "voltiger", "volume", "vorace", "vortex", "voter", "vouloir", "voyage",
15738 "voyelle", "wagon", "xénon", "yacht", "zèbre", "zénith", "zeste", "zoologie"]
15739 </script>
15740 <script>WORDLISTS = typeof WORDLISTS == "undefined" ? {} : WORDLISTS;
15741 WORDLISTS["italian"] = [
15742 "abaco", "abbaglio", "abbinato", "abete", "abisso", "abolire", "abrasivo", "abrogato", "accadere", "accenno",
15743 "accusato", "acetone", "achille", "acido", "acqua", "acre", "acrilico", "acrobata", "acuto", "adagio",
15744 "addebito", "addome", "adeguato", "aderire", "adipe", "adottare", "adulare", "affabile", "affetto", "affisso",
15745 "affranto", "aforisma", "afoso", "africano", "agave", "agente", "agevole", "aggancio", "agire", "agitare",
15746 "agonismo", "agricolo", "agrumeto", "aguzzo", "alabarda", "alato", "albatro", "alberato", "albo", "albume",
15747 "alce", "alcolico", "alettone", "alfa", "algebra", "aliante", "alibi", "alimento", "allagato", "allegro",
15748 "allievo", "allodola", "allusivo", "almeno", "alogeno", "alpaca", "alpestre", "altalena", "alterno", "alticcio",
15749 "altrove", "alunno", "alveolo", "alzare", "amalgama", "amanita", "amarena", "ambito", "ambrato", "ameba",
15750 "america", "ametista", "amico", "ammasso", "ammenda", "ammirare", "ammonito", "amore", "ampio", "ampliare",
15751 "amuleto", "anacardo", "anagrafe", "analista", "anarchia", "anatra", "anca", "ancella", "ancora", "andare",
15752 "andrea", "anello", "angelo", "angolare", "angusto", "anima", "annegare", "annidato", "anno", "annuncio",
15753 "anonimo", "anticipo", "anzi", "apatico", "apertura", "apode", "apparire", "appetito", "appoggio", "approdo",
15754 "appunto", "aprile", "arabica", "arachide", "aragosta", "araldica", "arancio", "aratura", "arazzo", "arbitro",
15755 "archivio", "ardito", "arenile", "argento", "argine", "arguto", "aria", "armonia", "arnese", "arredato",
15756 "arringa", "arrosto", "arsenico", "arso", "artefice", "arzillo", "asciutto", "ascolto", "asepsi", "asettico",
15757 "asfalto", "asino", "asola", "aspirato", "aspro", "assaggio", "asse", "assoluto", "assurdo", "asta",
15758 "astenuto", "astice", "astratto", "atavico", "ateismo", "atomico", "atono", "attesa", "attivare", "attorno",
15759 "attrito", "attuale", "ausilio", "austria", "autista", "autonomo", "autunno", "avanzato", "avere", "avvenire",
15760 "avviso", "avvolgere", "azione", "azoto", "azzimo", "azzurro", "babele", "baccano", "bacino", "baco",
15761 "badessa", "badilata", "bagnato", "baita", "balcone", "baldo", "balena", "ballata", "balzano", "bambino",
15762 "bandire", "baraonda", "barbaro", "barca", "baritono", "barlume", "barocco", "basilico", "basso", "batosta",
15763 "battuto", "baule", "bava", "bavosa", "becco", "beffa", "belgio", "belva", "benda", "benevole",
15764 "benigno", "benzina", "bere", "berlina", "beta", "bibita", "bici", "bidone", "bifido", "biga",
15765 "bilancia", "bimbo", "binocolo", "biologo", "bipede", "bipolare", "birbante", "birra", "biscotto", "bisesto",
15766 "bisnonno", "bisonte", "bisturi", "bizzarro", "blando", "blatta", "bollito", "bonifico", "bordo", "bosco",
15767 "botanico", "bottino", "bozzolo", "braccio", "bradipo", "brama", "branca", "bravura", "bretella", "brevetto",
15768 "brezza", "briglia", "brillante", "brindare", "broccolo", "brodo", "bronzina", "brullo", "bruno", "bubbone",
15769 "buca", "budino", "buffone", "buio", "bulbo", "buono", "burlone", "burrasca", "bussola", "busta",
15770 "cadetto", "caduco", "calamaro", "calcolo", "calesse", "calibro", "calmo", "caloria", "cambusa", "camerata",
15771 "camicia", "cammino", "camola", "campale", "canapa", "candela", "cane", "canino", "canotto", "cantina",
15772 "capace", "capello", "capitolo", "capogiro", "cappero", "capra", "capsula", "carapace", "carcassa", "cardo",
15773 "carisma", "carovana", "carretto", "cartolina", "casaccio", "cascata", "caserma", "caso", "cassone", "castello",
15774 "casuale", "catasta", "catena", "catrame", "cauto", "cavillo", "cedibile", "cedrata", "cefalo", "celebre",
15775 "cellulare", "cena", "cenone", "centesimo", "ceramica", "cercare", "certo", "cerume", "cervello", "cesoia",
15776 "cespo", "ceto", "chela", "chiaro", "chicca", "chiedere", "chimera", "china", "chirurgo", "chitarra",
15777 "ciao", "ciclismo", "cifrare", "cigno", "cilindro", "ciottolo", "circa", "cirrosi", "citrico", "cittadino",
15778 "ciuffo", "civetta", "civile", "classico", "clinica", "cloro", "cocco", "codardo", "codice", "coerente",
15779 "cognome", "collare", "colmato", "colore", "colposo", "coltivato", "colza", "coma", "cometa", "commando",
15780 "comodo", "computer", "comune", "conciso", "condurre", "conferma", "congelare", "coniuge", "connesso", "conoscere",
15781 "consumo", "continuo", "convegno", "coperto", "copione", "coppia", "copricapo", "corazza", "cordata", "coricato",
15782 "cornice", "corolla", "corpo", "corredo", "corsia", "cortese", "cosmico", "costante", "cottura", "covato",
15783 "cratere", "cravatta", "creato", "credere", "cremoso", "crescita", "creta", "criceto", "crinale", "crisi",
15784 "critico", "croce", "cronaca", "crostata", "cruciale", "crusca", "cucire", "cuculo", "cugino", "cullato",
15785 "cupola", "curatore", "cursore", "curvo", "cuscino", "custode", "dado", "daino", "dalmata", "damerino",
15786 "daniela", "dannoso", "danzare", "datato", "davanti", "davvero", "debutto", "decennio", "deciso", "declino",
15787 "decollo", "decreto", "dedicato", "definito", "deforme", "degno", "delegare", "delfino", "delirio", "delta",
15788 "demenza", "denotato", "dentro", "deposito", "derapata", "derivare", "deroga", "descritto", "deserto", "desiderio",
15789 "desumere", "detersivo", "devoto", "diametro", "dicembre", "diedro", "difeso", "diffuso", "digerire", "digitale",
15790 "diluvio", "dinamico", "dinnanzi", "dipinto", "diploma", "dipolo", "diradare", "dire", "dirotto", "dirupo",
15791 "disagio", "discreto", "disfare", "disgelo", "disposto", "distanza", "disumano", "dito", "divano", "divelto",
15792 "dividere", "divorato", "doblone", "docente", "doganale", "dogma", "dolce", "domato", "domenica", "dominare",
15793 "dondolo", "dono", "dormire", "dote", "dottore", "dovuto", "dozzina", "drago", "druido", "dubbio",
15794 "dubitare", "ducale", "duna", "duomo", "duplice", "duraturo", "ebano", "eccesso", "ecco", "eclissi",
15795 "economia", "edera", "edicola", "edile", "editoria", "educare", "egemonia", "egli", "egoismo", "egregio",
15796 "elaborato", "elargire", "elegante", "elencato", "eletto", "elevare", "elfico", "elica", "elmo", "elsa",
15797 "eluso", "emanato", "emblema", "emesso", "emiro", "emotivo", "emozione", "empirico", "emulo", "endemico",
15798 "enduro", "energia", "enfasi", "enoteca", "entrare", "enzima", "epatite", "epilogo", "episodio", "epocale",
15799 "eppure", "equatore", "erario", "erba", "erboso", "erede", "eremita", "erigere", "ermetico", "eroe",
15800 "erosivo", "errante", "esagono", "esame", "esanime", "esaudire", "esca", "esempio", "esercito", "esibito",
15801 "esigente", "esistere", "esito", "esofago", "esortato", "esoso", "espanso", "espresso", "essenza", "esso",
15802 "esteso", "estimare", "estonia", "estroso", "esultare", "etilico", "etnico", "etrusco", "etto", "euclideo",
15803 "europa", "evaso", "evidenza", "evitato", "evoluto", "evviva", "fabbrica", "faccenda", "fachiro", "falco",
15804 "famiglia", "fanale", "fanfara", "fango", "fantasma", "fare", "farfalla", "farinoso", "farmaco", "fascia",
15805 "fastoso", "fasullo", "faticare", "fato", "favoloso", "febbre", "fecola", "fede", "fegato", "felpa",
15806 "feltro", "femmina", "fendere", "fenomeno", "fermento", "ferro", "fertile", "fessura", "festivo", "fetta",
15807 "feudo", "fiaba", "fiducia", "fifa", "figurato", "filo", "finanza", "finestra", "finire", "fiore",
15808 "fiscale", "fisico", "fiume", "flacone", "flamenco", "flebo", "flemma", "florido", "fluente", "fluoro",
15809 "fobico", "focaccia", "focoso", "foderato", "foglio", "folata", "folclore", "folgore", "fondente", "fonetico",
15810 "fonia", "fontana", "forbito", "forchetta", "foresta", "formica", "fornaio", "foro", "fortezza", "forzare",
15811 "fosfato", "fosso", "fracasso", "frana", "frassino", "fratello", "freccetta", "frenata", "fresco", "frigo",
15812 "frollino", "fronde", "frugale", "frutta", "fucilata", "fucsia", "fuggente", "fulmine", "fulvo", "fumante",
15813 "fumetto", "fumoso", "fune", "funzione", "fuoco", "furbo", "furgone", "furore", "fuso", "futile",
15814 "gabbiano", "gaffe", "galateo", "gallina", "galoppo", "gambero", "gamma", "garanzia", "garbo", "garofano",
15815 "garzone", "gasdotto", "gasolio", "gastrico", "gatto", "gaudio", "gazebo", "gazzella", "geco", "gelatina",
15816 "gelso", "gemello", "gemmato", "gene", "genitore", "gennaio", "genotipo", "gergo", "ghepardo", "ghiaccio",
15817 "ghisa", "giallo", "gilda", "ginepro", "giocare", "gioiello", "giorno", "giove", "girato", "girone",
15818 "gittata", "giudizio", "giurato", "giusto", "globulo", "glutine", "gnomo", "gobba", "golf", "gomito",
15819 "gommone", "gonfio", "gonna", "governo", "gracile", "grado", "grafico", "grammo", "grande", "grattare",
15820 "gravoso", "grazia", "greca", "gregge", "grifone", "grigio", "grinza", "grotta", "gruppo", "guadagno",
15821 "guaio", "guanto", "guardare", "gufo", "guidare", "ibernato", "icona", "identico", "idillio", "idolo",
15822 "idra", "idrico", "idrogeno", "igiene", "ignaro", "ignorato", "ilare", "illeso", "illogico", "illudere",
15823 "imballo", "imbevuto", "imbocco", "imbuto", "immane", "immerso", "immolato", "impacco", "impeto", "impiego",
15824 "importo", "impronta", "inalare", "inarcare", "inattivo", "incanto", "incendio", "inchino", "incisivo", "incluso",
15825 "incontro", "incrocio", "incubo", "indagine", "india", "indole", "inedito", "infatti", "infilare", "inflitto",
15826 "ingaggio", "ingegno", "inglese", "ingordo", "ingrosso", "innesco", "inodore", "inoltrare", "inondato", "insano",
15827 "insetto", "insieme", "insonnia", "insulina", "intasato", "intero", "intonaco", "intuito", "inumidire", "invalido",
15828 "invece", "invito", "iperbole", "ipnotico", "ipotesi", "ippica", "iride", "irlanda", "ironico", "irrigato",
15829 "irrorare", "isolato", "isotopo", "isterico", "istituto", "istrice", "italia", "iterare", "labbro", "labirinto",
15830 "lacca", "lacerato", "lacrima", "lacuna", "laddove", "lago", "lampo", "lancetta", "lanterna", "lardoso",
15831 "larga", "laringe", "lastra", "latenza", "latino", "lattuga", "lavagna", "lavoro", "legale", "leggero",
15832 "lembo", "lentezza", "lenza", "leone", "lepre", "lesivo", "lessato", "lesto", "letterale", "leva",
15833 "levigato", "libero", "lido", "lievito", "lilla", "limatura", "limitare", "limpido", "lineare", "lingua",
15834 "liquido", "lira", "lirica", "lisca", "lite", "litigio", "livrea", "locanda", "lode", "logica",
15835 "lombare", "londra", "longevo", "loquace", "lorenzo", "loto", "lotteria", "luce", "lucidato", "lumaca",
15836 "luminoso", "lungo", "lupo", "luppolo", "lusinga", "lusso", "lutto", "macabro", "macchina", "macero",
15837 "macinato", "madama", "magico", "maglia", "magnete", "magro", "maiolica", "malafede", "malgrado", "malinteso",
15838 "malsano", "malto", "malumore", "mana", "mancia", "mandorla", "mangiare", "manifesto", "mannaro", "manovra",
15839 "mansarda", "mantide", "manubrio", "mappa", "maratona", "marcire", "maretta", "marmo", "marsupio", "maschera",
15840 "massaia", "mastino", "materasso", "matricola", "mattone", "maturo", "mazurca", "meandro", "meccanico", "mecenate",
15841 "medesimo", "meditare", "mega", "melassa", "melis", "melodia", "meninge", "meno", "mensola", "mercurio",
15842 "merenda", "merlo", "meschino", "mese", "messere", "mestolo", "metallo", "metodo", "mettere", "miagolare",
15843 "mica", "micelio", "michele", "microbo", "midollo", "miele", "migliore", "milano", "milite", "mimosa",
15844 "minerale", "mini", "minore", "mirino", "mirtillo", "miscela", "missiva", "misto", "misurare", "mitezza",
15845 "mitigare", "mitra", "mittente", "mnemonico", "modello", "modifica", "modulo", "mogano", "mogio", "mole",
15846 "molosso", "monastero", "monco", "mondina", "monetario", "monile", "monotono", "monsone", "montato", "monviso",
15847 "mora", "mordere", "morsicato", "mostro", "motivato", "motosega", "motto", "movenza", "movimento", "mozzo",
15848 "mucca", "mucosa", "muffa", "mughetto", "mugnaio", "mulatto", "mulinello", "multiplo", "mummia", "munto",
15849 "muovere", "murale", "musa", "muscolo", "musica", "mutevole", "muto", "nababbo", "nafta", "nanometro",
15850 "narciso", "narice", "narrato", "nascere", "nastrare", "naturale", "nautica", "naviglio", "nebulosa", "necrosi",
15851 "negativo", "negozio", "nemmeno", "neofita", "neretto", "nervo", "nessuno", "nettuno", "neutrale", "neve",
15852 "nevrotico", "nicchia", "ninfa", "nitido", "nobile", "nocivo", "nodo", "nome", "nomina", "nordico",
15853 "normale", "norvegese", "nostrano", "notare", "notizia", "notturno", "novella", "nucleo", "nulla", "numero",
15854 "nuovo", "nutrire", "nuvola", "nuziale", "oasi", "obbedire", "obbligo", "obelisco", "oblio", "obolo",
15855 "obsoleto", "occasione", "occhio", "occidente", "occorrere", "occultare", "ocra", "oculato", "odierno", "odorare",
15856 "offerta", "offrire", "offuscato", "oggetto", "oggi", "ognuno", "olandese", "olfatto", "oliato", "oliva",
15857 "ologramma", "oltre", "omaggio", "ombelico", "ombra", "omega", "omissione", "ondoso", "onere", "onice",
15858 "onnivoro", "onorevole", "onta", "operato", "opinione", "opposto", "oracolo", "orafo", "ordine", "orecchino",
15859 "orefice", "orfano", "organico", "origine", "orizzonte", "orma", "ormeggio", "ornativo", "orologio", "orrendo",
15860 "orribile", "ortensia", "ortica", "orzata", "orzo", "osare", "oscurare", "osmosi", "ospedale", "ospite",
15861 "ossa", "ossidare", "ostacolo", "oste", "otite", "otre", "ottagono", "ottimo", "ottobre", "ovale",
15862 "ovest", "ovino", "oviparo", "ovocito", "ovunque", "ovviare", "ozio", "pacchetto", "pace", "pacifico",
15863 "padella", "padrone", "paese", "paga", "pagina", "palazzina", "palesare", "pallido", "palo", "palude",
15864 "pandoro", "pannello", "paolo", "paonazzo", "paprica", "parabola", "parcella", "parere", "pargolo", "pari",
15865 "parlato", "parola", "partire", "parvenza", "parziale", "passivo", "pasticca", "patacca", "patologia", "pattume",
15866 "pavone", "peccato", "pedalare", "pedonale", "peggio", "peloso", "penare", "pendice", "penisola", "pennuto",
15867 "penombra", "pensare", "pentola", "pepe", "pepita", "perbene", "percorso", "perdonato", "perforare", "pergamena",
15868 "periodo", "permesso", "perno", "perplesso", "persuaso", "pertugio", "pervaso", "pesatore", "pesista", "peso",
15869 "pestifero", "petalo", "pettine", "petulante", "pezzo", "piacere", "pianta", "piattino", "piccino", "picozza",
15870 "piega", "pietra", "piffero", "pigiama", "pigolio", "pigro", "pila", "pilifero", "pillola", "pilota",
15871 "pimpante", "pineta", "pinna", "pinolo", "pioggia", "piombo", "piramide", "piretico", "pirite", "pirolisi",
15872 "pitone", "pizzico", "placebo", "planare", "plasma", "platano", "plenario", "pochezza", "poderoso", "podismo",
15873 "poesia", "poggiare", "polenta", "poligono", "pollice", "polmonite", "polpetta", "polso", "poltrona", "polvere",
15874 "pomice", "pomodoro", "ponte", "popoloso", "porfido", "poroso", "porpora", "porre", "portata", "posa",
15875 "positivo", "possesso", "postulato", "potassio", "potere", "pranzo", "prassi", "pratica", "precluso", "predica",
15876 "prefisso", "pregiato", "prelievo", "premere", "prenotare", "preparato", "presenza", "pretesto", "prevalso", "prima",
15877 "principe", "privato", "problema", "procura", "produrre", "profumo", "progetto", "prolunga", "promessa", "pronome",
15878 "proposta", "proroga", "proteso", "prova", "prudente", "prugna", "prurito", "psiche", "pubblico", "pudica",
15879 "pugilato", "pugno", "pulce", "pulito", "pulsante", "puntare", "pupazzo", "pupilla", "puro", "quadro",
15880 "qualcosa", "quasi", "querela", "quota", "raccolto", "raddoppio", "radicale", "radunato", "raffica", "ragazzo",
15881 "ragione", "ragno", "ramarro", "ramingo", "ramo", "randagio", "rantolare", "rapato", "rapina", "rappreso",
15882 "rasatura", "raschiato", "rasente", "rassegna", "rastrello", "rata", "ravveduto", "reale", "recepire", "recinto",
15883 "recluta", "recondito", "recupero", "reddito", "redimere", "regalato", "registro", "regola", "regresso", "relazione",
15884 "remare", "remoto", "renna", "replica", "reprimere", "reputare", "resa", "residente", "responso", "restauro",
15885 "rete", "retina", "retorica", "rettifica", "revocato", "riassunto", "ribadire", "ribelle", "ribrezzo", "ricarica",
15886 "ricco", "ricevere", "riciclato", "ricordo", "ricreduto", "ridicolo", "ridurre", "rifasare", "riflesso", "riforma",
15887 "rifugio", "rigare", "rigettato", "righello", "rilassato", "rilevato", "rimanere", "rimbalzo", "rimedio", "rimorchio",
15888 "rinascita", "rincaro", "rinforzo", "rinnovo", "rinomato", "rinsavito", "rintocco", "rinuncia", "rinvenire", "riparato",
15889 "ripetuto", "ripieno", "riportare", "ripresa", "ripulire", "risata", "rischio", "riserva", "risibile", "riso",
15890 "rispetto", "ristoro", "risultato", "risvolto", "ritardo", "ritegno", "ritmico", "ritrovo", "riunione", "riva",
15891 "riverso", "rivincita", "rivolto", "rizoma", "roba", "robotico", "robusto", "roccia", "roco", "rodaggio",
15892 "rodere", "roditore", "rogito", "rollio", "romantico", "rompere", "ronzio", "rosolare", "rospo", "rotante",
15893 "rotondo", "rotula", "rovescio", "rubizzo", "rubrica", "ruga", "rullino", "rumine", "rumoroso", "ruolo",
15894 "rupe", "russare", "rustico", "sabato", "sabbiare", "sabotato", "sagoma", "salasso", "saldatura", "salgemma",
15895 "salivare", "salmone", "salone", "saltare", "saluto", "salvo", "sapere", "sapido", "saporito", "saraceno",
15896 "sarcasmo", "sarto", "sassoso", "satellite", "satira", "satollo", "saturno", "savana", "savio", "saziato",
15897 "sbadiglio", "sbalzo", "sbancato", "sbarra", "sbattere", "sbavare", "sbendare", "sbirciare", "sbloccato", "sbocciato",
15898 "sbrinare", "sbruffone", "sbuffare", "scabroso", "scadenza", "scala", "scambiare", "scandalo", "scapola", "scarso",
15899 "scatenare", "scavato", "scelto", "scenico", "scettro", "scheda", "schiena", "sciarpa", "scienza", "scindere",
15900 "scippo", "sciroppo", "scivolo", "sclerare", "scodella", "scolpito", "scomparto", "sconforto", "scoprire", "scorta",
15901 "scossone", "scozzese", "scriba", "scrollare", "scrutinio", "scuderia", "scultore", "scuola", "scuro", "scusare",
15902 "sdebitare", "sdoganare", "seccatura", "secondo", "sedano", "seggiola", "segnalato", "segregato", "seguito", "selciato",
15903 "selettivo", "sella", "selvaggio", "semaforo", "sembrare", "seme", "seminato", "sempre", "senso", "sentire",
15904 "sepolto", "sequenza", "serata", "serbato", "sereno", "serio", "serpente", "serraglio", "servire", "sestina",
15905 "setola", "settimana", "sfacelo", "sfaldare", "sfamato", "sfarzoso", "sfaticato", "sfera", "sfida", "sfilato",
15906 "sfinge", "sfocato", "sfoderare", "sfogo", "sfoltire", "sforzato", "sfratto", "sfruttato", "sfuggito", "sfumare",
15907 "sfuso", "sgabello", "sgarbato", "sgonfiare", "sgorbio", "sgrassato", "sguardo", "sibilo", "siccome", "sierra",
15908 "sigla", "signore", "silenzio", "sillaba", "simbolo", "simpatico", "simulato", "sinfonia", "singolo", "sinistro",
15909 "sino", "sintesi", "sinusoide", "sipario", "sisma", "sistole", "situato", "slitta", "slogatura", "sloveno",
15910 "smarrito", "smemorato", "smentito", "smeraldo", "smilzo", "smontare", "smottato", "smussato", "snellire", "snervato",
15911 "snodo", "sobbalzo", "sobrio", "soccorso", "sociale", "sodale", "soffitto", "sogno", "soldato", "solenne",
15912 "solido", "sollazzo", "solo", "solubile", "solvente", "somatico", "somma", "sonda", "sonetto", "sonnifero",
15913 "sopire", "soppeso", "sopra", "sorgere", "sorpasso", "sorriso", "sorso", "sorteggio", "sorvolato", "sospiro",
15914 "sosta", "sottile", "spada", "spalla", "spargere", "spatola", "spavento", "spazzola", "specie", "spedire",
15915 "spegnere", "spelatura", "speranza", "spessore", "spettrale", "spezzato", "spia", "spigoloso", "spillato", "spinoso",
15916 "spirale", "splendido", "sportivo", "sposo", "spranga", "sprecare", "spronato", "spruzzo", "spuntino", "squillo",
15917 "sradicare", "srotolato", "stabile", "stacco", "staffa", "stagnare", "stampato", "stantio", "starnuto", "stasera",
15918 "statuto", "stelo", "steppa", "sterzo", "stiletto", "stima", "stirpe", "stivale", "stizzoso", "stonato",
15919 "storico", "strappo", "stregato", "stridulo", "strozzare", "strutto", "stuccare", "stufo", "stupendo", "subentro",
15920 "succoso", "sudore", "suggerito", "sugo", "sultano", "suonare", "superbo", "supporto", "surgelato", "surrogato",
15921 "sussurro", "sutura", "svagare", "svedese", "sveglio", "svelare", "svenuto", "svezia", "sviluppo", "svista",
15922 "svizzera", "svolta", "svuotare", "tabacco", "tabulato", "tacciare", "taciturno", "tale", "talismano", "tampone",
15923 "tannino", "tara", "tardivo", "targato", "tariffa", "tarpare", "tartaruga", "tasto", "tattico", "taverna",
15924 "tavolata", "tazza", "teca", "tecnico", "telefono", "temerario", "tempo", "temuto", "tendone", "tenero",
15925 "tensione", "tentacolo", "teorema", "terme", "terrazzo", "terzetto", "tesi", "tesserato", "testato", "tetro",
15926 "tettoia", "tifare", "tigella", "timbro", "tinto", "tipico", "tipografo", "tiraggio", "tiro", "titanio",
15927 "titolo", "titubante", "tizio", "tizzone", "toccare", "tollerare", "tolto", "tombola", "tomo", "tonfo",
15928 "tonsilla", "topazio", "topologia", "toppa", "torba", "tornare", "torrone", "tortora", "toscano", "tossire",
15929 "tostatura", "totano", "trabocco", "trachea", "trafila", "tragedia", "tralcio", "tramonto", "transito", "trapano",
15930 "trarre", "trasloco", "trattato", "trave", "treccia", "tremolio", "trespolo", "tributo", "tricheco", "trifoglio",
15931 "trillo", "trincea", "trio", "tristezza", "triturato", "trivella", "tromba", "trono", "troppo", "trottola",
15932 "trovare", "truccato", "tubatura", "tuffato", "tulipano", "tumulto", "tunisia", "turbare", "turchino", "tuta",
15933 "tutela", "ubicato", "uccello", "uccisore", "udire", "uditivo", "uffa", "ufficio", "uguale", "ulisse",
15934 "ultimato", "umano", "umile", "umorismo", "uncinetto", "ungere", "ungherese", "unicorno", "unificato", "unisono",
15935 "unitario", "unte", "uovo", "upupa", "uragano", "urgenza", "urlo", "usanza", "usato", "uscito",
15936 "usignolo", "usuraio", "utensile", "utilizzo", "utopia", "vacante", "vaccinato", "vagabondo", "vagliato", "valanga",
15937 "valgo", "valico", "valletta", "valoroso", "valutare", "valvola", "vampata", "vangare", "vanitoso", "vano",
15938 "vantaggio", "vanvera", "vapore", "varano", "varcato", "variante", "vasca", "vedetta", "vedova", "veduto",
15939 "vegetale", "veicolo", "velcro", "velina", "velluto", "veloce", "venato", "vendemmia", "vento", "verace",
15940 "verbale", "vergogna", "verifica", "vero", "verruca", "verticale", "vescica", "vessillo", "vestale", "veterano",
15941 "vetrina", "vetusto", "viandante", "vibrante", "vicenda", "vichingo", "vicinanza", "vidimare", "vigilia", "vigneto",
15942 "vigore", "vile", "villano", "vimini", "vincitore", "viola", "vipera", "virgola", "virologo", "virulento",
15943 "viscoso", "visione", "vispo", "vissuto", "visura", "vita", "vitello", "vittima", "vivanda", "vivido",
15944 "viziare", "voce", "voga", "volatile", "volere", "volpe", "voragine", "vulcano", "zampogna", "zanna",
15945 "zappato", "zattera", "zavorra", "zefiro", "zelante", "zelo", "zenzero", "zerbino", "zibetto", "zinco",
15946 "zircone", "zitto", "zolla", "zotico", "zucchero", "zufolo", "zulu", "zuppa"]
15947 </script>
15948 <script>/*
15949 * Copyright (c) 2013 Pavol Rusnak
15950 *
15951 * Permission is hereby granted, free of charge, to any person obtaining a copy of
15952 * this software and associated documentation files (the "Software"), to deal in
15953 * the Software without restriction, including without limitation the rights to
15954 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
15955 * of the Software, and to permit persons to whom the Software is furnished to do
15956 * so, subject to the following conditions:
15957 *
15958 * The above copyright notice and this permission notice shall be included in all
15959 * copies or substantial portions of the Software.
15960 *
15961 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15962 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15963 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15964 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
15965 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
15966 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
15967 */
15968
15969 /*
15970 * Javascript port from python by Ian Coleman
15971 *
15972 * Requires code from sjcl
15973 * https://github.com/bitwiseshiftleft/sjcl
15974 */
15975
15976 var Mnemonic = function(language) {
15977
15978 var PBKDF2_ROUNDS = 2048;
15979 var RADIX = 2048;
15980
15981 var self = this;
15982 var wordlist = [];
15983
15984 var hmacSHA512 = function(key) {
15985 var hasher = new sjcl.misc.hmac(key, sjcl.hash.sha512);
15986 this.encrypt = function() {
15987 return hasher.encrypt.apply(hasher, arguments);
15988 };
15989 };
15990
15991 function init() {
15992 wordlist = WORDLISTS[language];
15993 if (wordlist.length != RADIX) {
15994 err = 'Wordlist should contain ' + RADIX + ' words, but it contains ' + wordlist.length + ' words.';
15995 throw err;
15996 }
15997 }
15998
15999 self.generate = function(strength) {
16000 strength = strength || 128;
16001 var r = strength % 32;
16002 if (r > 0) {
16003 throw 'Strength should be divisible by 32, but it is not (' + r + ').';
16004 }
16005 var hasStrongCrypto = 'crypto' in window && window['crypto'] !== null;
16006 if (!hasStrongCrypto) {
16007 throw 'Mnemonic should be generated with strong randomness, but crypto.getRandomValues is unavailable';
16008 }
16009 var buffer = new Uint8Array(strength / 8);
16010 var data = crypto.getRandomValues(buffer);
16011 return self.toMnemonic(data);
16012 }
16013
16014 self.toMnemonic = function(byteArray) {
16015 if (byteArray.length % 4 > 0) {
16016 throw 'Data length in bits should be divisible by 32, but it is not (' + byteArray.length + ' bytes = ' + byteArray.length*8 + ' bits).'
16017 }
16018
16019 //h = hashlib.sha256(data).hexdigest()
16020 var data = byteArrayToWordArray(byteArray);
16021 var hash = sjcl.hash.sha256.hash(data);
16022 var h = sjcl.codec.hex.fromBits(hash);
16023
16024 // b is a binary string, eg '00111010101100...'
16025 //b = bin(int(binascii.hexlify(data), 16))[2:].zfill(len(data) * 8) + \
16026 // bin(int(h, 16))[2:].zfill(256)[:len(data) * 8 / 32]
16027 //
16028 // a = bin(int(binascii.hexlify(data), 16))[2:].zfill(len(data) * 8)
16029 // c = bin(int(h, 16))[2:].zfill(256)
16030 // d = c[:len(data) * 8 / 32]
16031 var a = byteArrayToBinaryString(byteArray);
16032 var c = zfill(hexStringToBinaryString(h), 256);
16033 var d = c.substring(0, byteArray.length * 8 / 32);
16034 // b = line1 + line2
16035 var b = a + d;
16036
16037 var result = [];
16038 var blen = b.length / 11;
16039 for (var i=0; i<blen; i++) {
16040 var idx = parseInt(b.substring(i * 11, (i + 1) * 11), 2);
16041 result.push(wordlist[idx]);
16042 }
16043 return self.joinWords(result);
16044 }
16045
16046 self.check = function(mnemonic) {
16047 var mnemonic = self.splitWords(mnemonic);
16048 if (mnemonic.length % 3 > 0) {
16049 return false
16050 }
16051 // idx = map(lambda x: bin(self.wordlist.index(x))[2:].zfill(11), mnemonic)
16052 var idx = [];
16053 for (var i=0; i<mnemonic.length; i++) {
16054 var word = mnemonic[i];
16055 var wordIndex = wordlist.indexOf(word);
16056 if (wordIndex == -1) {
16057 return false;
16058 }
16059 var binaryIndex = zfill(wordIndex.toString(2), 11);
16060 idx.push(binaryIndex);
16061 }
16062 var b = idx.join('');
16063 var l = b.length;
16064 //d = b[:l / 33 * 32]
16065 //h = b[-l / 33:]
16066 var d = b.substring(0, l / 33 * 32);
16067 var h = b.substring(l - l / 33, l);
16068 //nd = binascii.unhexlify(hex(int(d, 2))[2:].rstrip('L').zfill(l / 33 * 8))
16069 var nd = binaryStringToWordArray(d);
16070 //nh = bin(int(hashlib.sha256(nd).hexdigest(), 16))[2:].zfill(256)[:l / 33]
16071 var ndHash = sjcl.hash.sha256.hash(nd);
16072 var ndHex = sjcl.codec.hex.fromBits(ndHash);
16073 var ndBstr = zfill(hexStringToBinaryString(ndHex), 256);
16074 var nh = ndBstr.substring(0,l/33);
16075 return h == nh;
16076 }
16077
16078 self.toSeed = function(mnemonic, passphrase) {
16079 passphrase = passphrase || '';
16080 mnemonic = self.joinWords(self.splitWords(self.normalizeString(mnemonic))); // removes blanks
16081 passphrase = self.normalizeString(passphrase)
16082 passphrase = "mnemonic" + passphrase;
16083 var mnemonicBits = sjcl.codec.utf8String.toBits(mnemonic);
16084 var passphraseBits = sjcl.codec.utf8String.toBits(passphrase);
16085 var result = sjcl.misc.pbkdf2(mnemonicBits, passphraseBits, PBKDF2_ROUNDS, 512, hmacSHA512);
16086 var hashHex = sjcl.codec.hex.fromBits(result);
16087 return hashHex;
16088 }
16089
16090 self.splitWords = function(mnemonic) {
16091 return mnemonic.split(/\s/g).filter(function(x) { return x.length; });
16092 }
16093
16094 self.joinWords = function(words) {
16095 // Set space correctly depending on the language
16096 // see https://github.com/bitcoin/bips/blob/master/bip-0039/bip-0039-wordlists.md#japanese
16097 var space = " ";
16098 if (language == "japanese") {
16099 space = "\u3000"; // ideographic space
16100 }
16101 return words.join(space);
16102 }
16103
16104 self.normalizeString = function(str) {
16105 if (typeof str.normalize == "function") {
16106 return str.normalize("NFKD");
16107 }
16108 else {
16109 // TODO decide how to handle this in the future.
16110 // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize
16111 return str;
16112 }
16113 }
16114
16115 function byteArrayToWordArray(data) {
16116 var a = [];
16117 for (var i=0; i<data.length/4; i++) {
16118 v = 0;
16119 v += data[i*4 + 0] << 8 * 3;
16120 v += data[i*4 + 1] << 8 * 2;
16121 v += data[i*4 + 2] << 8 * 1;
16122 v += data[i*4 + 3] << 8 * 0;
16123 a.push(v);
16124 }
16125 return a;
16126 }
16127
16128 function byteArrayToBinaryString(data) {
16129 var bin = "";
16130 for (var i=0; i<data.length; i++) {
16131 bin += zfill(data[i].toString(2), 8);
16132 }
16133 return bin;
16134 }
16135
16136 function hexStringToBinaryString(hexString) {
16137 binaryString = "";
16138 for (var i=0; i<hexString.length; i++) {
16139 binaryString += zfill(parseInt(hexString[i], 16).toString(2),4);
16140 }
16141 return binaryString;
16142 }
16143
16144 function binaryStringToWordArray(binary) {
16145 var aLen = binary.length / 32;
16146 var a = [];
16147 for (var i=0; i<aLen; i++) {
16148 var valueStr = binary.substring(0,32);
16149 var value = parseInt(valueStr, 2);
16150 a.push(value);
16151 binary = binary.slice(32);
16152 }
16153 return a;
16154 }
16155
16156 // Pad a numeric string on the left with zero digits until the given width
16157 // is reached.
16158 // Note this differs to the python implementation because it does not
16159 // handle numbers starting with a sign.
16160 function zfill(source, length) {
16161 source = source.toString();
16162 while (source.length < length) {
16163 source = '0' + source;
16164 }
16165 return source;
16166 }
16167
16168 init();
16169
16170 }
16171 </script>
16172 <script>(function() {
16173
16174 // mnemonics is populated as required by getLanguage
16175 var mnemonics = { "english": new Mnemonic("english") };
16176 var mnemonic = mnemonics["english"];
16177 var seed = null
16178 var bip32RootKey = null;
16179 var bip32ExtendedKey = null;
16180 var network = bitcoin.networks.bitcoin;
16181 var addressRowTemplate = $("#address-row-template");
16182
16183 var showIndex = true;
16184 var showAddress = true;
16185 var showPubKey = true;
16186 var showPrivKey = true;
16187
16188 var phraseChangeTimeoutEvent = null;
16189 var rootKeyChangedTimeoutEvent = null;
16190
16191 var DOM = {};
16192 DOM.network = $(".network");
16193 DOM.phraseNetwork = $("#network-phrase");
16194 DOM.phrase = $(".phrase");
16195 DOM.passphrase = $(".passphrase");
16196 DOM.generate = $(".generate");
16197 DOM.seed = $(".seed");
16198 DOM.rootKey = $(".root-key");
16199 DOM.extendedPrivKey = $(".extended-priv-key");
16200 DOM.extendedPubKey = $(".extended-pub-key");
16201 DOM.bip32tab = $("#bip32-tab");
16202 DOM.bip44tab = $("#bip44-tab");
16203 DOM.bip32panel = $("#bip32");
16204 DOM.bip44panel = $("#bip44");
16205 DOM.bip32path = $("#bip32-path");
16206 DOM.bip44path = $("#bip44-path");
16207 DOM.bip44purpose = $("#bip44 .purpose");
16208 DOM.bip44coin = $("#bip44 .coin");
16209 DOM.bip44account = $("#bip44 .account");
16210 DOM.bip44change = $("#bip44 .change");
16211 DOM.strength = $(".strength");
16212 DOM.hardenedAddresses = $(".hardened-addresses");
16213 DOM.addresses = $(".addresses");
16214 DOM.rowsToAdd = $(".rows-to-add");
16215 DOM.more = $(".more");
16216 DOM.feedback = $(".feedback");
16217 DOM.tab = $(".derivation-type a");
16218 DOM.indexToggle = $(".index-toggle");
16219 DOM.addressToggle = $(".address-toggle");
16220 DOM.publicKeyToggle = $(".public-key-toggle");
16221 DOM.privateKeyToggle = $(".private-key-toggle");
16222 DOM.languages = $(".languages a");
16223
16224 function init() {
16225 // Events
16226 DOM.network.on("change", networkChanged);
16227 DOM.phrase.on("input", delayedPhraseChanged);
16228 DOM.passphrase.on("input", delayedPhraseChanged);
16229 DOM.generate.on("click", generateClicked);
16230 DOM.more.on("click", showMore);
16231 DOM.rootKey.on("input", delayedRootKeyChanged);
16232 DOM.bip32path.on("input", calcForDerivationPath);
16233 DOM.bip44purpose.on("input", calcForDerivationPath);
16234 DOM.bip44coin.on("input", calcForDerivationPath);
16235 DOM.bip44account.on("input", calcForDerivationPath);
16236 DOM.bip44change.on("input", calcForDerivationPath);
16237 DOM.tab.on("shown.bs.tab", calcForDerivationPath);
16238 DOM.hardenedAddresses.on("change", calcForDerivationPath);
16239 DOM.indexToggle.on("click", toggleIndexes);
16240 DOM.addressToggle.on("click", toggleAddresses);
16241 DOM.publicKeyToggle.on("click", togglePublicKeys);
16242 DOM.privateKeyToggle.on("click", togglePrivateKeys);
16243 DOM.languages.on("click", languageChanged);
16244 disableForms();
16245 hidePending();
16246 hideValidationError();
16247 populateNetworkSelect();
16248 }
16249
16250 // Event handlers
16251
16252 function networkChanged(e) {
16253 var networkIndex = e.target.value;
16254 networks[networkIndex].onSelect();
16255 if (seed != null) {
16256 phraseChanged();
16257 }
16258 else {
16259 rootKeyChanged();
16260 }
16261 }
16262
16263 function delayedPhraseChanged() {
16264 hideValidationError();
16265 showPending();
16266 if (phraseChangeTimeoutEvent != null) {
16267 clearTimeout(phraseChangeTimeoutEvent);
16268 }
16269 phraseChangeTimeoutEvent = setTimeout(phraseChanged, 400);
16270 }
16271
16272 function phraseChanged() {
16273 showPending();
16274 hideValidationError();
16275 setMnemonicLanguage();
16276 // Get the mnemonic phrase
16277 var phrase = DOM.phrase.val();
16278 var errorText = findPhraseErrors(phrase);
16279 if (errorText) {
16280 showValidationError(errorText);
16281 return;
16282 }
16283 // Calculate and display
16284 var passphrase = DOM.passphrase.val();
16285 calcBip32RootKeyFromSeed(phrase, passphrase);
16286 calcForDerivationPath();
16287 hidePending();
16288 }
16289
16290 function delayedRootKeyChanged() {
16291 // Warn if there is an existing mnemonic or passphrase.
16292 if (DOM.phrase.val().length > 0 || DOM.passphrase.val().length > 0) {
16293 if (!confirm("This will clear existing mnemonic and passphrase")) {
16294 DOM.rootKey.val(bip32RootKey);
16295 return
16296 }
16297 }
16298 hideValidationError();
16299 showPending();
16300 // Clear existing mnemonic and passphrase
16301 DOM.phrase.val("");
16302 DOM.passphrase.val("");
16303 seed = null;
16304 if (rootKeyChangedTimeoutEvent != null) {
16305 clearTimeout(rootKeyChangedTimeoutEvent);
16306 }
16307 rootKeyChangedTimeoutEvent = setTimeout(rootKeyChanged, 400);
16308 }
16309
16310 function rootKeyChanged() {
16311 showPending();
16312 hideValidationError();
16313 // Validate the root key TODO
16314 var rootKeyBase58 = DOM.rootKey.val();
16315 var errorText = validateRootKey(rootKeyBase58);
16316 if (errorText) {
16317 showValidationError(errorText);
16318 return;
16319 }
16320 // Calculate and display
16321 calcBip32RootKeyFromBase58(rootKeyBase58);
16322 calcForDerivationPath();
16323 hidePending();
16324 }
16325
16326 function calcForDerivationPath() {
16327 showPending();
16328 hideValidationError();
16329 // Get the derivation path
16330 var derivationPath = getDerivationPath();
16331 var errorText = findDerivationPathErrors(derivationPath);
16332 if (errorText) {
16333 showValidationError(errorText);
16334 return;
16335 }
16336 calcBip32ExtendedKey(derivationPath);
16337 displayBip32Info();
16338 hidePending();
16339 }
16340
16341 function generateClicked() {
16342 clearDisplay();
16343 showPending();
16344 setTimeout(function() {
16345 setMnemonicLanguage();
16346 var phrase = generateRandomPhrase();
16347 if (!phrase) {
16348 return;
16349 }
16350 phraseChanged();
16351 }, 50);
16352 }
16353
16354 function languageChanged() {
16355 setTimeout(function() {
16356 setMnemonicLanguage();
16357 if (DOM.phrase.val().length > 0) {
16358 var newPhrase = convertPhraseToNewLanguage();
16359 DOM.phrase.val(newPhrase);
16360 phraseChanged();
16361 }
16362 else {
16363 DOM.generate.trigger("click");
16364 }
16365 }, 50);
16366 }
16367
16368 function toggleIndexes() {
16369 showIndex = !showIndex;
16370 $("td.index span").toggleClass("invisible");
16371 }
16372
16373 function toggleAddresses() {
16374 showAddress = !showAddress;
16375 $("td.address span").toggleClass("invisible");
16376 }
16377
16378 function togglePublicKeys() {
16379 showPubKey = !showPubKey;
16380 $("td.pubkey span").toggleClass("invisible");
16381 }
16382
16383 function togglePrivateKeys() {
16384 showPrivKey = !showPrivKey;
16385 $("td.privkey span").toggleClass("invisible");
16386 }
16387
16388 // Private methods
16389
16390 function generateRandomPhrase() {
16391 if (!hasStrongRandom()) {
16392 var errorText = "This browser does not support strong randomness";
16393 showValidationError(errorText);
16394 return;
16395 }
16396 var numWords = parseInt(DOM.strength.val());
16397 var strength = numWords / 3 * 32;
16398 var words = mnemonic.generate(strength);
16399 DOM.phrase.val(words);
16400 return words;
16401 }
16402
16403 function calcBip32RootKeyFromSeed(phrase, passphrase) {
16404 seed = mnemonic.toSeed(phrase, passphrase);
16405 bip32RootKey = bitcoin.HDNode.fromSeedHex(seed, network);
16406 }
16407
16408 function calcBip32RootKeyFromBase58(rootKeyBase58) {
16409 bip32RootKey = bitcoin.HDNode.fromBase58(rootKeyBase58, network);
16410 }
16411
16412 function calcBip32ExtendedKey(path) {
16413 bip32ExtendedKey = bip32RootKey;
16414 // Derive the key from the path
16415 var pathBits = path.split("/");
16416 for (var i=0; i<pathBits.length; i++) {
16417 var bit = pathBits[i];
16418 var index = parseInt(bit);
16419 if (isNaN(index)) {
16420 continue;
16421 }
16422 var hardened = bit[bit.length-1] == "'";
16423 if (hardened) {
16424 bip32ExtendedKey = bip32ExtendedKey.deriveHardened(index);
16425 }
16426 else {
16427 bip32ExtendedKey = bip32ExtendedKey.derive(index);
16428 }
16429 }
16430 }
16431
16432 function showValidationError(errorText) {
16433 DOM.feedback
16434 .text(errorText)
16435 .show();
16436 }
16437
16438 function hideValidationError() {
16439 DOM.feedback
16440 .text("")
16441 .hide();
16442 }
16443
16444 function findPhraseErrors(phrase) {
16445 // TODO make this right
16446 // Preprocess the words
16447 phrase = mnemonic.normalizeString(phrase);
16448 var words = phraseToWordArray(phrase);
16449 // Check each word
16450 for (var i=0; i<words.length; i++) {
16451 var word = words[i];
16452 var language = getLanguage();
16453 if (WORDLISTS[language].indexOf(word) == -1) {
16454 console.log("Finding closest match to " + word);
16455 var nearestWord = findNearestWord(word);
16456 return word + " not in wordlist, did you mean " + nearestWord + "?";
16457 }
16458 }
16459 // Check the words are valid
16460 var properPhrase = wordArrayToPhrase(words);
16461 var isValid = mnemonic.check(properPhrase);
16462 if (!isValid) {
16463 return "Invalid mnemonic";
16464 }
16465 return false;
16466 }
16467
16468 function validateRootKey(rootKeyBase58) {
16469 try {
16470 bitcoin.HDNode.fromBase58(rootKeyBase58);
16471 }
16472 catch (e) {
16473 return "Invalid root key";
16474 }
16475 return "";
16476 }
16477
16478 function getDerivationPath() {
16479 if (DOM.bip44tab.hasClass("active")) {
16480 var purpose = parseIntNoNaN(DOM.bip44purpose.val(), 44);
16481 var coin = parseIntNoNaN(DOM.bip44coin.val(), 0);
16482 var account = parseIntNoNaN(DOM.bip44account.val(), 0);
16483 var change = parseIntNoNaN(DOM.bip44change.val(), 0);
16484 var path = "m/";
16485 path += purpose + "'/";
16486 path += coin + "'/";
16487 path += account + "'/";
16488 path += change;
16489 DOM.bip44path.val(path);
16490 var derivationPath = DOM.bip44path.val();
16491 console.log("Using derivation path from BIP44 tab: " + derivationPath);
16492 return derivationPath;
16493 }
16494 else if (DOM.bip32tab.hasClass("active")) {
16495 var derivationPath = DOM.bip32path.val();
16496 console.log("Using derivation path from BIP32 tab: " + derivationPath);
16497 return derivationPath;
16498 }
16499 else {
16500 console.log("Unknown derivation path");
16501 }
16502 }
16503
16504 function findDerivationPathErrors(path) {
16505 // TODO is not perfect but is better than nothing
16506 // Inspired by
16507 // https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#test-vectors
16508 // and
16509 // https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#extended-keys
16510 var maxDepth = 255; // TODO verify this!!
16511 var maxIndexValue = Math.pow(2, 31); // TODO verify this!!
16512 if (path[0] != "m") {
16513 return "First character must be 'm'";
16514 }
16515 if (path.length > 1) {
16516 if (path[1] != "/") {
16517 return "Separator must be '/'";
16518 }
16519 var indexes = path.split("/");
16520 if (indexes.length > maxDepth) {
16521 return "Derivation depth is " + indexes.length + ", must be less than " + maxDepth;
16522 }
16523 for (var depth = 1; depth<indexes.length; depth++) {
16524 var index = indexes[depth];
16525 var invalidChars = index.replace(/^[0-9]+'?$/g, "")
16526 if (invalidChars.length > 0) {
16527 return "Invalid characters " + invalidChars + " found at depth " + depth;
16528 }
16529 var indexValue = parseInt(index.replace("'", ""));
16530 if (isNaN(depth)) {
16531 return "Invalid number at depth " + depth;
16532 }
16533 if (indexValue > maxIndexValue) {
16534 return "Value of " + indexValue + " at depth " + depth + " must be less than " + maxIndexValue;
16535 }
16536 }
16537 }
16538 return false;
16539 }
16540
16541 function displayBip32Info() {
16542 // Display the key
16543 DOM.seed.val(seed);
16544 var rootKey = bip32RootKey.toBase58();
16545 DOM.rootKey.val(rootKey);
16546 var extendedPrivKey = bip32ExtendedKey.toBase58();
16547 DOM.extendedPrivKey.val(extendedPrivKey);
16548 var extendedPubKey = bip32ExtendedKey.toBase58(false);
16549 DOM.extendedPubKey.val(extendedPubKey);
16550 // Display the addresses and privkeys
16551 clearAddressesList();
16552 displayAddresses(0, 20);
16553 }
16554
16555 function displayAddresses(start, total) {
16556 for (var i=0; i<total; i++) {
16557 var index = i + start;
16558 new TableRow(index);
16559 }
16560 }
16561
16562 function TableRow(index) {
16563
16564 var useHardenedAddresses = DOM.hardenedAddresses.prop("checked");
16565
16566 function init() {
16567 calculateValues();
16568 }
16569
16570 function calculateValues() {
16571 setTimeout(function() {
16572 var key = "";
16573 if (useHardenedAddresses) {
16574 key = bip32ExtendedKey.deriveHardened(index);
16575 }
16576 else {
16577 key = bip32ExtendedKey.derive(index);
16578 }
16579 var address = key.getAddress().toString();
16580 var privkey = key.privKey.toWIF(network);
16581 var pubkey = key.pubKey.toHex();
16582 var indexText = getDerivationPath() + "/" + index;
16583 if (useHardenedAddresses) {
16584 indexText = indexText + "'";
16585 }
16586 addAddressToList(indexText, address, pubkey, privkey);
16587 }, 50)
16588 }
16589
16590 init();
16591
16592 }
16593
16594 function showMore() {
16595 var start = DOM.addresses.children().length;
16596 var rowsToAdd = parseInt(DOM.rowsToAdd.val());
16597 if (isNaN(rowsToAdd)) {
16598 rowsToAdd = 20;
16599 DOM.rowsToAdd.val("20");
16600 }
16601 if (rowsToAdd > 200) {
16602 var msg = "Generating " + rowsToAdd + " rows could take a while. ";
16603 msg += "Do you want to continue?";
16604 if (!confirm(msg)) {
16605 return;
16606 }
16607 }
16608 displayAddresses(start, rowsToAdd);
16609 }
16610
16611 function clearDisplay() {
16612 clearAddressesList();
16613 clearKey();
16614 hideValidationError();
16615 }
16616
16617 function clearAddressesList() {
16618 DOM.addresses.empty();
16619 }
16620
16621 function clearKey() {
16622 DOM.rootKey.val("");
16623 DOM.extendedPrivKey.val("");
16624 DOM.extendedPubKey.val("");
16625 }
16626
16627 function addAddressToList(indexText, address, pubkey, privkey) {
16628 var row = $(addressRowTemplate.html());
16629 // Elements
16630 var indexCell = row.find(".index span");
16631 var addressCell = row.find(".address span");
16632 var pubkeyCell = row.find(".pubkey span");
16633 var privkeyCell = row.find(".privkey span");
16634 // Content
16635 indexCell.text(indexText);
16636 addressCell.text(address);
16637 pubkeyCell.text(pubkey);
16638 privkeyCell.text(privkey);
16639 // Visibility
16640 if (!showIndex) {
16641 indexCell.addClass("invisible");
16642 }
16643 if (!showAddress) {
16644 addressCell.addClass("invisible");
16645 }
16646 if (!showPubKey) {
16647 pubkeyCell.addClass("invisible");
16648 }
16649 if (!showPrivKey) {
16650 privkeyCell.addClass("invisible");
16651 }
16652 DOM.addresses.append(row);
16653 }
16654
16655 function hasStrongRandom() {
16656 return 'crypto' in window && window['crypto'] !== null;
16657 }
16658
16659 function disableForms() {
16660 $("form").on("submit", function(e) {
16661 e.preventDefault();
16662 });
16663 }
16664
16665 function parseIntNoNaN(val, defaultVal) {
16666 var v = parseInt(val);
16667 if (isNaN(v)) {
16668 return defaultVal;
16669 }
16670 return v;
16671 }
16672
16673 function showPending() {
16674 DOM.feedback
16675 .text("Calculating...")
16676 .show();
16677 }
16678
16679 function findNearestWord(word) {
16680 var language = getLanguage();
16681 var words = WORDLISTS[language];
16682 var minDistance = 99;
16683 var closestWord = words[0];
16684 for (var i=0; i<words.length; i++) {
16685 var comparedTo = words[i];
16686 var distance = Levenshtein.get(word, comparedTo);
16687 if (distance < minDistance) {
16688 closestWord = comparedTo;
16689 minDistance = distance;
16690 }
16691 }
16692 return closestWord;
16693 }
16694
16695 function hidePending() {
16696 DOM.feedback
16697 .text("")
16698 .hide();
16699 }
16700
16701 function populateNetworkSelect() {
16702 for (var i=0; i<networks.length; i++) {
16703 var network = networks[i];
16704 var option = $("<option>");
16705 option.attr("value", i);
16706 option.text(network.name);
16707 DOM.phraseNetwork.append(option);
16708 }
16709 }
16710
16711 function getLanguage() {
16712 var defaultLanguage = "english";
16713 // Try to get from existing phrase
16714 var language = getLanguageFromPhrase();
16715 // Try to get from url if not from phrase
16716 if (language.length == 0) {
16717 language = getLanguageFromUrl();
16718 }
16719 // Default to English if no other option
16720 if (language.length == 0) {
16721 language = defaultLanguage;
16722 }
16723 return language;
16724 }
16725
16726 function getLanguageFromPhrase(phrase) {
16727 // Check if how many words from existing phrase match a language.
16728 var language = "";
16729 if (!phrase) {
16730 phrase = DOM.phrase.val();
16731 }
16732 if (phrase.length > 0) {
16733 var words = phraseToWordArray(phrase);
16734 var languageMatches = {};
16735 for (l in WORDLISTS) {
16736 // Track how many words match in this language
16737 languageMatches[l] = 0;
16738 for (var i=0; i<words.length; i++) {
16739 var wordInLanguage = WORDLISTS[l].indexOf(words[i]) > -1;
16740 if (wordInLanguage) {
16741 languageMatches[l]++;
16742 }
16743 }
16744 // Find languages with most word matches.
16745 // This is made difficult due to commonalities between Chinese
16746 // simplified vs traditional.
16747 var mostMatches = 0;
16748 var mostMatchedLanguages = [];
16749 for (var l in languageMatches) {
16750 var numMatches = languageMatches[l];
16751 if (numMatches > mostMatches) {
16752 mostMatches = numMatches;
16753 mostMatchedLanguages = [l];
16754 }
16755 else if (numMatches == mostMatches) {
16756 mostMatchedLanguages.push(l);
16757 }
16758 }
16759 }
16760 if (mostMatchedLanguages.length > 0) {
16761 // Use first language and warn if multiple detected
16762 language = mostMatchedLanguages[0];
16763 if (mostMatchedLanguages.length > 1) {
16764 console.warn("Multiple possible languages");
16765 console.warn(mostMatchedLanguages);
16766 }
16767 }
16768 }
16769 return language;
16770 }
16771
16772 function getLanguageFromUrl() {
16773 return window.location.hash.substring(1);
16774 }
16775
16776 function setMnemonicLanguage() {
16777 var language = getLanguage();
16778 // Load the bip39 mnemonic generator for this language if required
16779 if (!(language in mnemonics)) {
16780 mnemonics[language] = new Mnemonic(language);
16781 }
16782 mnemonic = mnemonics[language];
16783 }
16784
16785 function convertPhraseToNewLanguage() {
16786 var oldLanguage = getLanguageFromPhrase();
16787 var newLanguage = getLanguageFromUrl();
16788 var oldPhrase = DOM.phrase.val();
16789 var oldWords = phraseToWordArray(oldPhrase);
16790 var newWords = [];
16791 for (var i=0; i<oldWords.length; i++) {
16792 var oldWord = oldWords[i];
16793 var index = WORDLISTS[oldLanguage].indexOf(oldWord);
16794 var newWord = WORDLISTS[newLanguage][index];
16795 newWords.push(newWord);
16796 }
16797 newPhrase = wordArrayToPhrase(newWords);
16798 return newPhrase;
16799 }
16800
16801 // TODO look at jsbip39 - mnemonic.splitWords
16802 function phraseToWordArray(phrase) {
16803 var words = phrase.split(/\s/g);
16804 var noBlanks = [];
16805 for (var i=0; i<words.length; i++) {
16806 var word = words[i];
16807 if (word.length > 0) {
16808 noBlanks.push(word);
16809 }
16810 }
16811 return noBlanks;
16812 }
16813
16814 // TODO look at jsbip39 - mnemonic.joinWords
16815 function wordArrayToPhrase(words) {
16816 var phrase = words.join(" ");
16817 var language = getLanguageFromPhrase(phrase);
16818 if (language == "japanese") {
16819 phrase = words.join("\u3000");
16820 }
16821 return phrase;
16822 }
16823
16824 var networks = [
16825 {
16826 name: "Bitcoin",
16827 onSelect: function() {
16828 network = bitcoin.networks.bitcoin;
16829 DOM.bip44coin.val(0);
16830 },
16831 },
16832 {
16833 name: "Bitcoin Testnet",
16834 onSelect: function() {
16835 network = bitcoin.networks.testnet;
16836 DOM.bip44coin.val(1);
16837 },
16838 },
16839 {
16840 name: "Litecoin",
16841 onSelect: function() {
16842 network = bitcoin.networks.litecoin;
16843 DOM.bip44coin.val(2);
16844 },
16845 },
16846 {
16847 name: "Dogecoin",
16848 onSelect: function() {
16849 network = bitcoin.networks.dogecoin;
16850 DOM.bip44coin.val(3);
16851 },
16852 },
16853 {
16854 name: "ShadowCash",
16855 onSelect: function() {
16856 network = bitcoin.networks.shadow;
16857 DOM.bip44coin.val(35);
16858 },
16859 },
16860 {
16861 name: "ShadowCash Testnet",
16862 onSelect: function() {
16863 network = bitcoin.networks.shadowtn;
16864 DOM.bip44coin.val(1);
16865 },
16866 },
16867 {
16868 name: "Viacoin",
16869 onSelect: function() {
16870 network = bitcoin.networks.viacoin;
16871 DOM.bip44coin.val(14);
16872 },
16873 },
16874 {
16875 name: "Viacoin Testnet",
16876 onSelect: function() {
16877 network = bitcoin.networks.viacointestnet;
16878 DOM.bip44coin.val(1);
16879 },
16880 },
16881 {
16882 name: "Jumbucks",
16883 onSelect: function() {
16884 network = bitcoin.networks.jumbucks;
16885 DOM.bip44coin.val(26);
16886 },
16887 },
16888 {
16889 name: "CLAM",
16890 onSelect: function() {
16891 network = bitcoin.networks.clam;
16892 DOM.bip44coin.val(23);
16893 },
16894 },
16895 {
16896 name: "DASH",
16897 onSelect: function() {
16898 network = bitcoin.networks.dash;
16899 DOM.bip44coin.val(5);
16900 },
16901 },
16902 {
16903 name: "Namecoin",
16904 onSelect: function() {
16905 network = bitcoin.networks.namecoin;
16906 DOM.bip44coin.val(7);
16907 },
16908 },
16909 {
16910 name: "Peercoin",
16911 onSelect: function() {
16912 network = bitcoin.networks.peercoin;
16913 DOM.bip44coin.val(6);
16914 },
16915 },
16916 ]
16917
16918 init();
16919
16920 })();
16921 </script>
16922 </body>
16923 </html>