From db0fb1cd25d6ffad364b7a8b9b917e8650413f1e Mon Sep 17 00:00:00 2001 From: n1474335 Date: Tue, 7 Feb 2017 16:48:31 +0000 Subject: [PATCH 1/7] Added CONTRIBUTING.md --- .github/CONTRIBUTING.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/CONTRIBUTING.md diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100644 index 00000000..6064121c --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,37 @@ +# Contributing + +Take a look through the [Wiki pages](https://github.com/gchq/CyberChef/wiki) for guides on [compiling CyberChef](https://github.com/gchq/CyberChef/wiki/Getting-started) and [adding new operations](https://github.com/gchq/CyberChef/wiki/Adding-a-new-operation). + +There are lots of opportunities to contribute to CyberChef. If you want ideas, take a look at any [Issues](https://github.com/gchq/CyberChef/issues) tagged with '[help wanted](https://github.com/gchq/CyberChef/labels/help%20wanted)'. + +Before your contributions can be accepted, you must: + + - Sign the [GCHQ Contributor Licence Agreement](https://github.com/gchq/Gaffer/wiki/GCHQ-OSS-Contributor-License-Agreement-V1.0) + - Push your changes to your fork. + - Submit a pull request. + + +## Coding conventions + +* Indentation: Each block should consist of 4 spaces +* Object/namespace identifiers: CamelCase +* Function/variable names: camelCase +* Constants: UNDERSCORE_UPPER_CASE +* Source code encoding: UTF-8 (without BOM) +* All source files must end with a newline +* Line endings: UNIX style (\n) + + +## Design Principals + +1. If at all possible, all operations and features should be client-side and not rely on connections to an external server. This increases the utility of CyberChef on closed networks and in virtual machines that are not connected to the Internet. Calls to external APIs may be accepted if there is no other option, but not for critical components. +2. Latency should be kept to a minimum to enhance the user experience. This means that all operation code should sit on the client, rather than being loaded dynamically from a server. +3. Use Vanilla JS if at all possible to reduce the number of libraries required and relied upon. Frameworks like jQuery, although included, should not be used unless absolutely necessary. +4. Minimise the use of large libraries, especially for niche operations that won't be used very often - these will be downloaded by everyone using the app, whether they use that operation or not (due to principal 2). + + +With these principals in mind, any changes or additions to CyberChef should keep it: + + - Standalone + - Efficient + - As small as possible From 6eacd213a30647494be3127c22d65442b5b764af Mon Sep 17 00:00:00 2001 From: n1474335 Date: Tue, 7 Feb 2017 18:05:05 +0000 Subject: [PATCH 2/7] Added ISSUE_TEMPLATE.md --- .github/ISSUE_TEMPLATE.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE.md diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 00000000..bce403ba --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,24 @@ + + + + + + +### Summary + + + +### Example + + + + +### Possible solutions + + + +### Environment + + +* Compile date: +* User-Agent: From 4f0d153e73e2b133b6ed3c05798165ec728d6962 Mon Sep 17 00:00:00 2001 From: n1474335 Date: Tue, 7 Feb 2017 20:31:15 +0000 Subject: [PATCH 3/7] Added 'Report a bug' tab to the 'About/Support' pane. --- Gruntfile.js | 1 + build/prod/cyberchef.htm | 10 +++++----- build/prod/index.html | 2 +- build/prod/scripts.js | 6 +++--- src/html/index.html | 14 +++++++++++++- src/js/.eslintrc.json | 10 +++++++++- src/js/operations/Code.js | 3 +++ src/js/operations/IP.js | 6 ++++++ src/js/views/html/ControlsWaiter.js | 20 ++++++++++++++++++-- src/js/views/html/Manager.js | 1 + src/js/views/html/main.js | 2 +- src/static/stats.txt | 8 ++++---- 12 files changed, 65 insertions(+), 18 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 5ec73d08..12d6a889 100755 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -181,6 +181,7 @@ module.exports = function(grunt) { var templateOptions = { data: { + compileTime: grunt.template.today("dd/mm/yyyy HH:MM:ss") + " UTC", compileMsg: grunt.option("compile-msg") || grunt.option("msg") || "", codebaseStats: grunt.file.read("src/static/stats.txt").split("\n").join("
") } diff --git a/build/prod/cyberchef.htm b/build/prod/cyberchef.htm index 1aaad02b..545286af 100755 --- a/build/prod/cyberchef.htm +++ b/build/prod/cyberchef.htm @@ -85,11 +85,11 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -*/.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.clo,.opn,.pun{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.kwd,.tag,.typ{font-weight:700}.str{color:#060}.kwd{color:#006}.com{color:#600;font-style:italic}.typ{color:#404}.lit{color:#044}.clo,.opn,.pun{color:#440}.tag{color:#006}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}#content-wrapper{top:0;left:0;width:100%;height:100%}#banner{height:30px;width:100%;text-align:center;line-height:30px}#wrapper{top:30px;bottom:0;width:100%}div#operations,div#recipe{width:50%;height:100%}div#input,div#output{width:100%;height:50%}.title{padding:10px;height:43px}.textarea-wrapper{top:43px;bottom:0;width:100%;overflow:hidden}#output-html,textarea{width:100%;height:100%;border:none;padding:3px;-moz-padding-start:3px;-moz-padding-end:3px}#input-text,#output-html,#output-text{position:relative;border-width:0;margin:0;resize:none;background-color:transparent;white-space:pre-wrap;word-wrap:break-word}#output-html{display:none;overflow-y:auto;-moz-padding-start:1px}.split{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;overflow:auto;position:relative}.gutter.gutter-horizontal,.split.split-horizontal{height:100%;float:left}#input-highlighter,#output-highlighter{position:absolute;left:0;top:0;width:100%;height:100%;padding:3px;margin:0;overflow:hidden;letter-spacing:normal;white-space:pre-wrap;word-wrap:break-word;color:#fff;background-color:transparent;border:none}#op-list,#rec-list,.op-list{margin:0;padding:0;list-style-type:none}#op-list,#rec-list{position:absolute;top:43px;bottom:0;width:100%}.io-btn-group,.io-info{margin-top:-4px;float:right}#rec-list{bottom:120px;overflow:auto}.operation{cursor:pointer;padding:10px;list-style-type:none;position:relative}#controls{position:absolute;width:100%;height:120px;bottom:0;padding:10px}.io-info{margin-right:20px;height:30px;text-align:right;line-height:10px}.arg-group,.inline-args input[type=checkbox]{margin-top:10px}#input-info{line-height:15px}.arg-group{display:table;width:100%}.arg-group-text{display:block}.inline-args{float:left;width:auto;margin-right:30px;height:34px}.inline-args input[type=number]{width:100px}.arg-input{display:table-cell;width:100%;padding:6px 12px}.short-string{width:150px}select{display:block}.arg[disabled]{cursor:not-allowed;opacity:1}textarea.arg{width:100%;min-height:50px;height:70px;margin-top:5px;border:1px solid #ddd;resize:vertical}.arg-label{display:table-cell;width:1px;padding-right:10px;font-weight:400;white-space:pre}.title,optgroup{font-weight:700}.editable-option{position:relative;display:inline-block}.editable-option-input{position:absolute;top:1px;left:1px;width:calc(100% - 20px);height:calc(100% - 2px)!important;border:none!important}#operational-controls{width:65%;float:left;text-align:center}#bake-group{display:table;width:100%}#bake{display:table-cell;width:100%;border-top-right-radius:0;border-bottom-right-radius:0}#auto-bake-label{display:table-cell;padding:1px;line-height:1.35;width:60px;border-top-left-radius:0;border-bottom-left-radius:0;border-left:1px solid #5cb85c}#auto-bake-label:hover{border-left-color:#398439}#auto-bake-label div{font-size:10px;padding:2px}#extra-controls{float:right;width:35%;padding-left:10px}.op-icon{float:right;margin-left:10px;margin-top:3px}.recip-icons{position:absolute;top:13px;right:10px;height:16px}.recip-icon{margin-right:10px;vertical-align:baseline;float:right}.disable-icon{width:16px;height:16px;margin-top:-1px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAACfElEQVQ4y6WTPWgTYRjHf8nlfVvuoDVIP4Yuki4WHKoUqggFRUTsUEGkVG2hmCq6OnTwIxYHB+eijZOKdLNDW1pKKyGigh8dBHUJElxyBgx3vEnukvdyDrUhRXDxGR+e/+/583xEwjDkfyIGwNVTzURm4tYAMA6MAoN/0tvAMrA48uL+l2bx4w0iYRjSuHKC6OnTZLqHk8CcaZq9bW1tSCkBqNVq+L5PpVIpAHdGfr5LN9bXiT7Z2nGgteb1/qFkLBJZ6OjowHEc8vk8pVIJgHg8TldXF52dnb2u6y5s7R/iuF5JSyAKkLl4eyAMwznLsrBtm1wu99Z13amk+BFJih8R13WXANrb27EsizAM5zIXbw+wC9Baj0spe5VSFAqFt4ZhXJ6ufXuK55E5cDKVSCTGenp6yGazKKWQUvZqrcebgCAIRqWUOI6DEOLR1K8POapVMgfPpoC7u2LLspYcx0FKSRAEo60OBg3DwPd9Jr5vPqWvj8zh83vEwL2J75vnfN/HMAy01oPNNQZBQBAEO1OvVsl0D/8lTuZfpYDd7gRBQKuD7XK5jGmarB679PIv8deVFJUKq8cuTZqmSblcRmu93QpYVkohhMCyrLE94n2/UlSrbJy5kRBCXBNCoJRCa73cClh0XbfgeR6WZZHNZunv719KvnmeYnWVVxdmJ2Ox2DMhxFHP83Bdt6C1XgR2LvHzQDvvb84npZQL8Xgc0zSJRqN7br7RaFCpVCiVStRqtZmhh9fTh754TQdMr82nPc+bsW27UCwWUUpRr9ep1+sopSgWi9i2XfA8b2Z6bT6ttabp4GMi0uz0aXbhn890+MFM85mO5MIdwP/Eb1pMUCdctYRzAAAAAElFTkSuQmCC) no-repeat}.disable-icon-selected{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACFUlEQVR4XqWTP0tbURjGn9zY3mjBwsUhBQtS6XKxiNypIGZJ6SKYUYdaKWg7OrrE3pYO+Qit3dpFuuQO6lI7Z4nESQdjlJbkJh0MksSb3Jvk9H0gjZFu9YWH83LO7zn/3nNCSincJobAeP1sEDBFi6J50UyPy4l2RNuioz756Ts0tt1OB4jH2a52Ne2HGh9PwrJm2EcxZx/HyPRYMDgB2u02/N3d1c7w8BZMM1ptNJBPp3GwsUExB/s4RoYsPf0JOkFgdoH34YkJ/D48xC/HyTTOzl5ayWSIktwxqlVo0SjIkKWnP0Hg+4swjGitVMJFNpu5o+svptfXv6DZBDIZezoWS3Db3A0ZsvRcH8H354dGR9EoFHA3EvlorqycwvOAXM4G8Pav+f7YmEOGLD1gsIzl54+V+vBK/Yw9ZAv1LQW1FrdFSnKVfQTK5liPUfRI9I8ArqiPjLAF9vcHVybyzlpasgcZeq7voNXKNSsV3DMMXB4fp/8xLyzYuLri2DIZsvQM3sFOzXURiUR4zsQNcyrFleFVKpNyP2/IkKVnsArbF65bbkqplJSJZrl5x5qbs7G3h3artSyV+arr+lMyZOnpP2Wp6ZFos3R+vvUgCGDNzgKalkA4rECIr07662J2i0X4nrfJJ33jJT6Zmvpcr9XWCicn5WI+j7rrAmKgmLOPY2TI0sPgb8TBZOi/PpN1qnDr7/wH3jxgB/FKIXkAAAAASUVORK5CYII=) no-repeat}.breakpoint{float:right;width:14px;height:14px;background-color:#eee;border:1px solid #aaa}.breakpoint-selected{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAXVBMVEXIUkvzUVHzTEzzn5785eXrbW24BgbzWVnze3vzVVXzY2Pyion509PzbW3zXV1UMxj0l5f1srKbRTRgOxzJDg796ur74ODfIyP5zs6LLx3pNTXYGxuxdkVZNhn////sCC1eAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsTAQCanBgAAABWSURBVBjTnc+7EoAgDERRTOQVxMEZFAf//z8FjAUFDbfb060QU2FwxngimxnCea3bjegSgz+0tguAfBgIy64QGfZQdg91dgAtqUZgnfz6IacYVWvu2AvR4wNAv0nxrAAAAABJRU5ErkJggg==) -2px -2px no-repeat #eee}.banner-right{float:right;margin-right:10px}#banner img{margin-bottom:2px;margin-left:8px}.category-title{display:block;padding:10px}.category{margin:0!important;border-radius:0!important;border:none}#search{border-radius:0;border:none}.loading_file{background:url(data:image/gif;base64,R0lGODlhPAA8APcAAAAAAAEBAQICAgMDAwQEBAUFBQYGBgcHBwgICAkJCQoKCgsLCwwMDA0NDQ4ODg8PDxAQEBERERISEhMTExQUFBUVFRYWFhcXFxgYGBkZGRoaGhsbGxwcHB0dHR4eHh8fHyAgICEhISIiIiMjIyQkJCUlJSYmJicnJygoKCkpKSoqKisrKywsLC0tLS4uLi8vLzAwMDExMTIyMjMzMzQ0NDU1NTY2Njc3Nzg4ODk5OTo6Ojs7Ozw8PD09PT4+Pj8/P0BAQEFBQUJCQkNDQ0REREVFRUZGRkdHR0hISElJSUpKSktLS0xMTE1NTU5OTk9PT1BQUFFRUVJSUlNTU1RUVFVVVVZWVldXV1hYWFlZWVpaWltbW1xcXF1dXV5eXl9fX2BgYGFhYWJiYmNjY2RkZGVlZWZmZmdnZ2hoaGlpaWpqamtra2xsbG1tbW5ubm9vb3BwcHFxcXJycnNzc3R0dHV1dXZ2dnd3d3h4eHl5eXp6ent7e3x8fH19fX5+fn9/f4CAgIGBgYKCgoODg4SEhIWFhYaGhoeHh4iIiImJiYqKiouLi4yMjI2NjY6Ojo+Pj5CQkJGRkZKSkpOTk5SUlJWVlZaWlpeXl5iYmJmZmZqampubm5ycnJ2dnZ6enp+fn6CgoKGhoaKioqOjo6SkpKWlpaampqenp6ioqKmpqaqqqqurq6ysrK2tra6urq+vr7CwsLGxsbKysrOzs7S0tLW1tba2tre3t7i4uLm5ubq6uru7u7y8vL29vb6+vr+/v8DAwMHBwcLCwsPDw8TExMXFxcbGxsfHx8jIyMnJycrKysvLy8zMzM3Nzc7Ozs/Pz9DQ0NHR0dLS0tPT09TU1NXV1dbW1tfX19jY2NnZ2dra2tvb29zc3N3d3d7e3t/f3+Dg4OHh4eLi4uPj4+Tk5OXl5ebm5ufn5+jo6Onp6erq6uvr6+zs7O3t7e7u7u/v7/Dw8PHx8fLy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{position:fixed;width:30%;margin:30px auto;top:10px;left:0;right:0;z-index:2000;display:none}#alert a{text-decoration:underline}.option-item .bootstrap-switch{margin:15px 10px}.option-item button{margin:10px}.option-item input[type=number]{margin:15px 10px;width:80px;height:28px;padding:3px 10px;vertical-align:middle}.option-item select{margin:10px;display:inline-block}button img,span.btn img{margin-right:3px;margin-bottom:1px}#edit-favourites{float:right;margin-top:-5px}#edit-favourites-list{margin:10px}.about-img-left{float:left;margin:10px 20px 20px 0}.about-img-right{float:right;margin:10px 0 20px 20px}.save-link-options{float:right}.save-link-options input{margin-left:10px}#save-footer{border-top:none;margin-top:0}a:focus,button{outline:0;-moz-outline-style:none}.btn-default{border-color:#ddd}.btn-default:focus{background-color:#fff;border-color:#adadad}.btn-default:active,.btn-default:hover{background-color:#ebebeb;border-color:#adadad}.alert,.btn,.btn-lg,.dropdown-menu,.form-control,.modal-content,.nav-tabs>li>a,.popover,.tooltip-inner{border-radius:0!important}input[type=search]{-webkit-appearance:searchfield;box-shadow:none}input[type=search]::-webkit-search-cancel-button{-webkit-appearance:searchfield-cancel-button}.modal{overflow-y:auto}.form-control{background-color:transparent}code{border:0;white-space:pre-wrap}.bootstrap-switch,.bootstrap-switch-container,.bootstrap-switch-handle-off,.bootstrap-switch-handle-on,.bootstrap-switch-label,pre{border-radius:0!important}#banner,.title{border-bottom:1px solid #ddd}blockquote{font-size:inherit}blockquote a{cursor:pointer}.panel-body:after,.panel-body:before{content:""}.sortable-ghost{opacity:.6}.colorpicker-element{float:left;margin-right:15px}.colorpicker-color,.colorpicker-color div{height:100px}.word-wrap{white-space:pre!important;word-wrap:normal!important;overflow-x:scroll!important}.clearfix{height:0}.blur{color:transparent!important;text-shadow:rgba(0,0,0,.95) 0 0 10px!important}.no-select{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.konami{-ms-transform:rotate(180deg);-webkit-transform:rotate(180deg);transform:rotate(180deg);-moz-transform:rotate(180deg)}.hl1,.hlyellow{background-color:#fff000}.hl2,.hlblue{background-color:#95dfff}.hl3,.hlred{background-color:#ffb6b6}.hl4,.hlorange{background-color:#fcf8e3}.hl5,.hlgreen{background-color:#8de768}.title{color:#424242;background-color:#fafafa}.gutter{background-color:#eee;background-repeat:no-repeat;background-position:50%}.gutter.gutter-horizontal{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAAeCAYAAAAGos/EAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAAlSURBVChTYzxz5sx/BiBgAhEgwPju3TtUEZZ79+6BGcNcDQMDACWJMFs4hNOSAAAAAElFTkSuQmCC);cursor:ew-resize}.gutter.gutter-vertical{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAACCAYAAABPJGxCAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAACHDwAAjA8AAP1SAACBQAAAfXkAAOmLAAA85QAAGcxzPIV3AAAKL2lDQ1BJQ0MgUHJvZmlsZQAASMedlndUVNcWh8+9d3qhzTDSGXqTLjCA9C4gHQRRGGYGGMoAwwxNbIioQEQREQFFkKCAAaOhSKyIYiEoqGAPSBBQYjCKqKhkRtZKfHl57+Xl98e939pn73P32XuftS4AJE8fLi8FlgIgmSfgB3o401eFR9Cx/QAGeIABpgAwWempvkHuwUAkLzcXerrICfyL3gwBSPy+ZejpT6eD/0/SrFS+AADIX8TmbE46S8T5Ik7KFKSK7TMipsYkihlGiZkvSlDEcmKOW+Sln30W2VHM7GQeW8TinFPZyWwx94h4e4aQI2LER8QFGVxOpohvi1gzSZjMFfFbcWwyh5kOAIoktgs4rHgRm4iYxA8OdBHxcgBwpLgvOOYLFnCyBOJDuaSkZvO5cfECui5Lj25qbc2ge3IykzgCgaE/k5XI5LPpLinJqUxeNgCLZ/4sGXFt6aIiW5paW1oamhmZflGo/7r4NyXu7SK9CvjcM4jW94ftr/xS6gBgzIpqs+sP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ZVRlvM0MzT2ZJZ/Gy+rL1s3dkT+S453y9DrWOta47Vy13c+7oeqf1tRugDTEbujdqbMzfOL7JY9PRzYTNiZt/yDPJK817vSVsS1e+cv6m/LGtHlubCyQK+AXD22y31WxHbedu799hvmP/jk+F7MJrRSZF5UUfilnF174y/ariq4WdsTv7SyxLDu7C7OLtGtrtsPtoqXRpTunYHt897WX0ssKy13uj9l4tX1Zes4+wT7hvpMKnonO/5v5d+z9UxlfeqXKuaq1Wqt5RPXeAfWDwoOPBlhrlmqKa94e4h+7WetS212nXlR/GHM44/LQ+tL73a8bXjQ0KDUUNH4/wjowcDTza02jV2Nik1FTSDDcLm6eORR67+Y3rN50thi21rbTWouPguPD4s2+jvx064X2i+yTjZMt3Wt9Vt1HaCtuh9uz2mY74jpHO8M6BUytOdXfZdrV9b/T9kdNqp6vOyJ4pOUs4m3924VzOudnzqeenL8RdGOuO6n5wcdXF2z0BPf2XvC9duex++WKvU++5K3ZXTl+1uXrqGuNax3XL6+19Fn1tP1j80NZv2d9+w+pG503rm10DywfODjoMXrjleuvyba/b1++svDMwFDJ0dzhyeOQu++7kvaR7L+9n3J9/sOkh+mHhI6lH5Y+VHtf9qPdj64jlyJlR19G+J0FPHoyxxp7/lP7Th/H8p+Sn5ROqE42TZpOnp9ynbj5b/Wz8eerz+emCn6V/rn6h++K7Xxx/6ZtZNTP+kv9y4dfiV/Kvjrxe9rp71n/28ZvkN/NzhW/l3x59x3jX+z7s/cR85gfsh4qPeh+7Pnl/eriQvLDwG/eE8/s3BCkeAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAI0lEQVQYV2M8c+bMfwYgUFJSAlEM9+7dA9O05jOBSboDBgYAtPcYZ1oUA30AAAAASUVORK5CYII=);cursor:ns-resize}.operation{border:1px solid #999;border-top-width:0}.op-list .operation{color:#3a87ad;background-color:#d9edf7;border-color:#bce8f1}#rec-list .operation{color:#468847;background-color:#dff0d8;border-color:#d6e9c6}.arg-input,select{height:34px;border:1px solid #ddd;background-color:#fff;color:#424242}#controls{border-top:1px solid #ddd;background-color:#fafafa}.textarea-wrapper div,.textarea-wrapper textarea{font-family:Consolas,monospace;font-size:inherit}.io-info{font-weight:400;font-size:8pt}.arg-title,.category-title{font-weight:700}.arg-input{font-size:15px;line-height:1.428571429}select{padding:6px 8px}.arg[disabled]{background-color:#eee}textarea.arg{color:#424242}.break{color:#b94a48!important;background-color:#f2dede!important;border-color:#eed3d7!important}.category-title{background-color:#fafafa;border-bottom:1px solid #eee}.category-title[aria-expanded=true],.category-title[href='#catFavourites']{border-bottom-color:#ddd}.category-title.collapsed{border-bottom-color:#eee}.category-title:hover{color:#3a87ad}#search{border-bottom:1px solid #e3e3e3}.dropping-file{border:5px dashed #3a87ad!important}.selected-op{color:#c09853!important;background-color:#fcf8e3!important;border-color:#fbeed5!important}.option-item input[type=number]{font-size:14px;line-height:1.428571429;color:#555;background-color:#fff;border:1px solid #ccc}.favourites-hover{color:#468847;background-color:#dff0d8;border:2px dashed #468847!important;padding:8px 8px 9px}#edit-favourites-list{border:1px solid #bce8f1}#edit-favourites-list .operation{border-left:none;border-right:none}#edit-favourites-list .operation:last-child{border-bottom:none}.subtext{font-style:italic;font-size:13px;color:#999}#save-footer{border-bottom:1px solid #e5e5e5}.flow-control-op{color:#396f3a!important;background-color:#c7e4ba!important;border-color:#b3dba2!important}.flow-control-op.break{color:#94312f!important;background-color:#eabfbf!important;border-color:#e2aeb5!important}#support-modal textarea{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif}#load-text,#save-text{font-family:Consolas,monospace}button.dropdown-toggle{background-color:#f4f4f4}::-webkit-scrollbar{width:10px;height:10px}::-webkit-scrollbar-track{background-color:#fafafa}::-webkit-scrollbar-thumb{background-color:#ccc}::-webkit-scrollbar-thumb:hover{background-color:#bbb}::-webkit-scrollbar-corner{background-color:#fafafa}.disabled{color:#999!important;background-color:#dfdfdf!important;border-color:#cdcdcd!important}.grey{color:#333;background-color:#f5f5f5;border-color:#ddd}.dark-blue{color:#fff;background-color:#428bca;border-color:#428bca}.red{color:#b94a48;background-color:#f2dede;border-color:#eed3d7}.amber{color:#c09853;background-color:#fcf8e3;border-color:#fbeed5}.green{color:#468847;background-color:#dff0d8;border-color:#d6e9c6}.blue{color:#3a87ad;background-color:#d9edf7;border-color:#bce8f1} Edit
Operations
    Recipe
      Input
      Output
      Operations
        Recipe
          Input
          Output
          \ No newline at end of file +outputType:"string",args:[]},"Parse ASN.1 hex string":{description:"Abstract Syntax Notation One (ASN.1) is a standard and notation that describes rules and structures for representing, encoding, transmitting, and decoding data in telecommunications and computer networking.

          This operation parses arbitrary ASN.1 data and presents the resulting tree.",run:PublicKey.runParseAsn1HexString,inputType:"string",outputType:"string",args:[{name:"Starting index",type:"number",value:0},{name:"Truncate octet strings longer than",type:"number",value:PublicKey.ASN1_TRUNCATE_LENGTH}]},"Detect File Type":{description:"Attempts to guess the MIME (Multipurpose Internet Mail Extensions) type of the data based on 'magic bytes'.

          Currently supports the following file types: 7z, amr, avi, bmp, bz2, class, cr2, crx, dex, dmg, doc, elf, eot, epub, exe, flac, flv, gif, gz, ico, iso, jpg, jxr, m4a, m4v, mid, mkv, mov, mp3, mp4, mpg, ogg, otf, pdf, png, ppt, ps, psd, rar, rtf, sqlite, swf, tar, tar.z, tif, ttf, utf8, vmdk, wav, webm, webp, wmv, woff, woff2, xls, xz, zip.",run:FileType.runDetect,inputType:"byteArray",outputType:"string",args:[]},"Scan for Embedded Files":{description:"Scans the data for potential embedded files by looking for magic bytes at all offsets. This operation is prone to false positives.

          WARNING: Files over about 100KB in size will take a VERY long time to process.",run:FileType.runScanForEmbeddedFiles,inputType:"byteArray",outputType:"string",args:[{name:"Ignore common byte sequences",type:"boolean",value:FileType.IGNORE_COMMON_BYTE_SEQUENCES}]},"Expand alphabet range":{description:"Expand an alphabet range string into a list of the characters in that range.

          e.g. a-z becomes abcdefghijklmnopqrstuvwxyz.",run:SeqUtils.runExpandAlphRange,inputType:"string",outputType:"string",args:[{name:"Delimiter",type:"binaryString",value:""}]},Diff:{description:"Compares two inputs (separated by the specified delimiter) and highlights the differences between them.",run:StrUtils.runDiff,inputType:"string",outputType:"html",args:[{name:"Sample delimiter",type:"binaryString",value:StrUtils.DIFF_SAMPLE_DELIMITER},{name:"Diff by",type:"option",value:StrUtils.DIFF_BY},{name:"Show added",type:"boolean",value:!0},{name:"Show removed",type:"boolean",value:!0},{name:"Ignore whitespace (relevant for word and line)",type:"boolean",value:!1}]},"Parse UNIX file permissions":{description:"Given a UNIX/Linux file permission string in octal or textual format, this operation explains which permissions are granted to which user groups.

          Input should be in either octal (e.g. 755) or textual (e.g. drwxr-xr-x) format.",run:OS.runParseUnixPerms,inputType:"string",outputType:"string",args:[]},"Swap endianness":{description:"Switches the data from big-endian to little-endian or vice-versa. Data can be read in as hexadecimal or raw bytes. It will be returned in the same format as it is entered.",run:Endian.runSwapEndianness,highlight:!0,highlightReverse:!0,inputType:"string",outputType:"string",args:[{name:"Data format",type:"option",value:Endian.DATA_FORMAT},{name:"Word length (bytes)",type:"number",value:Endian.WORD_LENGTH},{name:"Pad incomplete words",type:"boolean",value:Endian.PAD_INCOMPLETE_WORDS}]},"Syntax highlighter":{description:"Adds syntax highlighting to a range of source code languages. Note that this will not indent the code. Use one of the 'Beautify' operations for that.",run:Code.runSyntaxHighlight,highlight:!0,highlightReverse:!0,inputType:"string",outputType:"html",args:[{name:"Language/File extension",type:"option",value:Code.LANGUAGES},{name:"Display line numbers",type:"boolean",value:Code.LINE_NUMS}]},"Parse escaped string":{description:"Replaces escaped characters with the bytes they represent.

          e.g.Hello\\nWorld becomes Hello
          World
          ",run:StrUtils.runParseEscapedString,inputType:"string",outputType:"string",args:[]},"TCP/IP Checksum":{description:"Calculates the checksum for a TCP (Transport Control Protocol) or IP (Internet Protocol) header from an input of raw bytes.",run:Checksum.runTCPIP,inputType:"byteArray",outputType:"string",args:[]},"Parse colour code":{description:"Converts a colour code in a standard format to other standard formats and displays the colour itself.

          Example inputs
          • #d9edf7
          • rgba(217,237,247,1)
          • hsla(200,65%,91%,1)
          • cmyk(0.12, 0.04, 0.00, 0.03)
          ",run:HTML.runParseColourCode,inputType:"string",outputType:"html",args:[]},"Generate UUID":{description:"Generates an RFC 4122 version 4 compliant Universally Unique Identifier (UUID), also known as a Globally Unique Identifier (GUID).

          A version 4 UUID relies on random numbers, in this case generated using window.crypto if available and falling back to Math.random if not.",run:UUID.runGenerateV4,inputType:"string",outputType:"string",args:[]},Substitute:{description:"A substitution cipher allowing you to specify bytes to replace with other byte values. This can be used to create Caesar ciphers but is more powerful as any byte value can be substituted, not just letters, and the substitution values need not be in order.

          Enter the bytes you want to replace in the Plaintext field and the bytes to replace them with in the Ciphertext field.

          Non-printable bytes can be specified using string escape notation. For example, a line feed character can be written as either \\n or \\x0a.

          Byte ranges can be specified using a hyphen. For example, the sequence 0123456789 can be written as 0-9.",run:Cipher.runSubstitute,inputType:"byteArray",outputType:"byteArray",args:[{name:"Plaintext",type:"binaryString",value:Cipher.SUBS_PLAINTEXT},{name:"Ciphertext",type:"binaryString",value:Cipher.SUBS_CIPHERTEXT}]},"To Morse Code":{description:"Translates alphanumeric characters into International Morse Code.

          Ignores non-Morse characters.

          e.g. SOS becomes ... --- ...",run:MorseCode.runTo,inputType:"string",outputType:"string",args:[{name:"Format options",type:"option",value:MorseCode.FORMAT_OPTIONS},{name:"Letter delimiter",type:"option",value:MorseCode.LETTER_DELIM_OPTIONS},{name:"Word delimiter",type:"option",value:MorseCode.WORD_DELIM_OPTIONS}]},"From Morse Code":{description:"Translates Morse Code into (upper case) alphanumeric characters.",run:MorseCode.runFrom,inputType:"string",outputType:"string",args:[{name:"Letter delimiter",type:"option",value:MorseCode.LETTER_DELIM_OPTIONS},{name:"Word delimiter",type:"option",value:MorseCode.WORD_DELIM_OPTIONS}]}},ControlsWaiter=function(a,b){this.app=a,this.manager=b};ControlsWaiter.prototype.adjustWidth=function(){var a=document.getElementById("controls"),b=document.getElementById("step"),c=document.getElementById("clr-breaks"),d=document.querySelector("#save img"),e=document.querySelector("#load img"),f=document.querySelector("#step img"),g=document.querySelector("#clr-recipe img"),h=document.querySelector("#clr-breaks img");a.clientWidth<470?b.childNodes[1].nodeValue=" Step":b.childNodes[1].nodeValue=" Step through",a.clientWidth<400?(d.style.display="none",e.style.display="none",f.style.display="none",g.style.display="none",h.style.display="none"):(d.style.display="inline",e.style.display="inline",f.style.display="inline",g.style.display="inline",h.style.display="inline"),a.clientWidth<330?c.childNodes[1].nodeValue=" Clear breaks":c.childNodes[1].nodeValue=" Clear breakpoints"},ControlsWaiter.prototype.setAutoBake=function(a){var b=document.getElementById("auto-bake");b.checked!==a&&b.click()},ControlsWaiter.prototype.bakeClick=function(){this.app.bake(),$("#output-text").selectRange(0)},ControlsWaiter.prototype.stepClick=function(){this.app.bake(!0),$("#output-text").selectRange(0)},ControlsWaiter.prototype.autoBakeChange=function(){var a=document.getElementById("auto-bake-label"),b=document.getElementById("auto-bake");this.app.autoBake_=b.checked,b.checked?(a.classList.remove("btn-default"),a.classList.add("btn-success")):(a.classList.remove("btn-success"),a.classList.add("btn-default"))},ControlsWaiter.prototype.clearRecipeClick=function(){this.manager.recipe.clearRecipe()},ControlsWaiter.prototype.clearBreaksClick=function(){for(var a=document.querySelectorAll("#rec-list li.operation .breakpoint"),b=0;b0,b=b&&g.length>0&&g.length<8e3,a&&(e+="?recipe="+encodeURIComponent(f)),a&&b?e+="&input="+encodeURIComponent(g):b&&(e+="?input="+encodeURIComponent(g)),e},ControlsWaiter.prototype.saveTextChange=function(){try{var a=JSON.parse(document.getElementById("save-text").value);this.initialiseSaveLink(a)}catch(a){}},ControlsWaiter.prototype.saveClick=function(){var a=this.app.getRecipeConfig(),b=JSON.stringify(a).replace(/},{/g,"},\n{");document.getElementById("save-text").value=b,this.initialiseSaveLink(a),$("#save-modal").modal()},ControlsWaiter.prototype.slrCheckChange=function(){this.initialiseSaveLink()},ControlsWaiter.prototype.sliCheckChange=function(){this.initialiseSaveLink()},ControlsWaiter.prototype.loadClick=function(){this.populateLoadRecipesList(),$("#load-modal").modal()},ControlsWaiter.prototype.saveButtonClick=function(){var a=document.getElementById("save-name").value,b=document.getElementById("save-text").value;if(!a)return void this.app.alert("Please enter a recipe name","danger",2e3);var c=localStorage.savedRecipes?JSON.parse(localStorage.savedRecipes):[],d=localStorage.recipeId||0;c.push({id:++d,name:a,recipe:b}),localStorage.savedRecipes=JSON.stringify(c),localStorage.recipeId=d,this.app.alert('Recipe saved as "'+a+'".',"success",2e3)},ControlsWaiter.prototype.populateLoadRecipesList=function(){for(var a=document.getElementById("load-name"),b=a.options.length;b--;)a.remove(b);var c=localStorage.savedRecipes?JSON.parse(localStorage.savedRecipes):[];for(b=0;bend: "+e+"
          length: "+f},HighlighterWaiter.prototype.removeHighlights=function(){document.getElementById("input-highlighter").innerHTML="",document.getElementById("output-highlighter").innerHTML="",document.getElementById("input-selection-info").innerHTML="",document.getElementById("output-selection-info").innerHTML=""},HighlighterWaiter.prototype.generateHighlightList=function(){for(var a=this.app.getRecipeConfig(),b=[],c=0;c=0)return!1;var d="[startHighlight]",e=/\[startHighlight\]/g,f="[endHighlight]",g=/\[endHighlight\]/g,h=a.value;if(1===c.length){if(c[0].end/g,">").replace(/\n/g," ").replace(e,'').replace(g,"")+" ",b.style.width=a.clientWidth+"px",b.innerHTML=h,b.scrollTop=a.scrollTop,b.scrollLeft=a.scrollLeft};var HTMLApp=function(a,b,c,d){this.categories=a,this.operations=b,this.dfavourites=c,this.doptions=d,this.options=Utils.extend({},d),this.chef=new Chef,this.manager=new Manager(this),this.autoBake_=!1,this.progress=0,this.ingId=0,window.chef=this.chef};HTMLApp.prototype.setup=function(){document.dispatchEvent(this.manager.appstart),this.initialiseSplitter(),this.loadLocalStorage(),this.populateOperationsList(),this.manager.setup(),this.resetLayout(),this.setCompileMessage(),this.loadURIParams()},HTMLApp.prototype.handleError=function(a){console.error(a);var b=a.displayStr||a.toString();this.alert(b,"danger",this.options.errorTimeout,!this.options.showErrors)},HTMLApp.prototype.bake=function(a){var b;try{b=this.chef.bake(this.getInput(),this.getRecipeConfig(),this.options,this.progress,a)}catch(a){this.handleError(a)}b&&(b.error&&this.handleError(b.error),this.options=b.options,this.dishStr="html"===b.type?Utils.stripHtmlTags(b.result,!0):b.result,this.progress=b.progress,this.manager.recipe.updateBreakpointIndicator(b.progress),this.manager.output.set(b.result,b.type,b.duration),b.duration>this.options.autoBakeThreshold&&this.autoBake_&&(this.manager.controls.setAutoBake(!1),this.alert("Baking took longer than "+this.options.autoBakeThreshold+"ms, Auto Bake has been disabled.","warning",5e3)))},HTMLApp.prototype.autoBake=function(){this.autoBake_&&this.bake()},HTMLApp.prototype.silentBake=function(){var a=(new Date).getTime(),b=this.getRecipeConfig();return this.autoBake_&&this.chef.silentBake(b),(new Date).getTime()-a},HTMLApp.prototype.getInput=function(){var a=this.manager.input.get();return sessionStorage.setItem("inputLength",a.length),sessionStorage.setItem("input",a),a},HTMLApp.prototype.setInput=function(a){sessionStorage.setItem("inputLength",a.length),sessionStorage.setItem("input",a),this.manager.input.set(a)},HTMLApp.prototype.populateOperationsList=function(){document.body.appendChild(document.getElementById("edit-favourites"));for(var a="",b=0;b2?JSON.parse(localStorage.favourites):this.dfavourites;a=this.validFavourites(a),this.saveFavourites(a);var b=this.categories.filter(function(a){return"Favourites"===a.name})[0];b?b.ops=a:this.categories.unshift({name:"Favourites",ops:a})},HTMLApp.prototype.validFavourites=function(a){for(var b=[],c=0;c=0?void this.alert("'"+a+"' is already in your favourites","info",2e3):(b.push(a),this.saveFavourites(b),this.loadFavourites(),this.populateOperationsList(),void this.manager.recipe.initialiseOperationDragNDrop())},HTMLApp.prototype.loadURIParams=function(){this.queryString=function(a){if(""===a)return{};for(var b={},c=0;c"):d[e].value=a[b].args[e];a[b].disabled&&c.querySelector(".disable-icon").click(),a[b].breakpoint&&c.querySelector(".breakpoint").click(),this.progress=0}},HTMLApp.prototype.resetLayout=function(){this.columnSplitter.setSizes([20,30,50]),this.ioSplitter.setSizes([50,50]),this.manager.controls.adjustWidth(),this.manager.output.adjustWidth()},HTMLApp.prototype.setCompileMessage=function(){var a=new Date,b=Utils.fuzzyTime(a.getTime()-window.compileTime),c='Last build: '+b.substr(0,1).toUpperCase()+b.substr(1)+" ago";""!==window.compileMessage&&(c+=" - "+window.compileMessage),c+="",document.getElementById("notice").innerHTML=c},HTMLApp.prototype.alert=function(a,b,c,d){var e=new Date;if(console.log("["+e.toLocaleString()+"] "+a),!d){b=b||"danger",c=c||0;var f=document.getElementById("alert"),g=document.getElementById("alert-content");f.classList.remove("alert-danger"),f.classList.remove("alert-warning"),f.classList.remove("alert-info"),f.classList.remove("alert-success"),f.classList.add("alert-"+b),"block"===f.style.display?g.innerHTML+="

          ["+e.toLocaleTimeString()+"] "+a:g.innerHTML="["+e.toLocaleTimeString()+"] "+a,$("#alert").stop(),f.style.display="block",f.style.opacity=1,c>0&&(clearTimeout(this.alertTimeout),this.alertTimeout=setTimeout(function(){$("#alert").slideUp(100)},c))}},HTMLApp.prototype.confirm=function(a,b,c,d){d=d||this,document.getElementById("confirm-title").innerHTML=a,document.getElementById("confirm-body").innerHTML=b,document.getElementById("confirm-modal").style.display="block",this.confirmClosed=!1,$("#confirm-modal").modal().one("show.bs.modal",function(a){this.confirmClosed=!1}.bind(this)).one("click","#confirm-yes",function(){this.confirmClosed=!0,c.bind(d)(!0),$("#confirm-modal").modal("hide")}.bind(this)).one("hide.bs.modal",function(a){this.confirmClosed||c.bind(d)(!1),this.confirmClosed=!0}.bind(this))},HTMLApp.prototype.alertCloseClick=function(){document.getElementById("alert").style.display="none"},HTMLApp.prototype.stateChange=function(a){this.autoBake(),this.options.updateUrl&&(this.lastStateUrl=this.manager.controls.generateStateUrl(!0,!0),window.history.replaceState({},"CyberChef",this.lastStateUrl))},HTMLApp.prototype.popState=function(a){window.location.href.split("#")[0]!==this.lastStateUrl&&this.loadURIParams()},HTMLApp.prototype.callApi=function(a,b,c,d,e){b=b||"POST",c=c||{},d=d||void 0,e=e||"application/json";var f=null,g=!1;return $.ajax({url:a,async:!1,type:b,data:c,dataType:d,contentType:e,success:function(a){g=!0,f=a},error:function(a){g=!1,f=a}}),{success:g,response:f}};var HTMLCategory=function(a,b){this.name=a,this.selected=b,this.opList=[]};HTMLCategory.prototype.addOperation=function(a){this.opList.push(a)},HTMLCategory.prototype.toHtml=function(){for(var a="cat"+this.name.replace(/[\s\/-:_]/g,""),b="
          "+this.name+"
            ",c=0;c 
          ";switch(d+="
          ",this.type){case"string":case"binaryString":case"byteArray":d+="";break;case"shortString":case"binaryShortString":d+="";break;case"toggleString":for(d+="
          ";break;case"number":d+="";break;case"boolean":d+="",this.disableArgs&&this.manager.addDynamicListener("#"+this.id,"click",this.toggleDisableArgs,this);break;case"option":for(d+="";break;case"populateOption":for(d+="",this.manager.addDynamicListener("#"+this.id,"change",this.populateOptionChange,this);break;case"editableOption":for(d+="
          ",d+="",d+="",d+="
          ",this.manager.addDynamicListener("#sel-"+this.id,"change",this.editableOptionChange,this);break;case"text":d+=""}return d+="
          "},HTMLIngredient.prototype.toggleDisableArgs=function(a){for(var b,c=a.target,d=c.parentNode.parentNode,e=d.querySelectorAll(".arg-group"),f=0;f"),this.description&&(b+=""),b+=""},HTMLOperation.prototype.toFullHtml=function(){for(var a="
          "+this.name+"
          ",b=0;b=0&&(this.name=this.name.slice(0,b)+""+this.name.slice(b,b+a.length)+""+this.name.slice(b+a.length)),this.description&&c>=0&&(this.description=this.description.slice(0,c)+""+this.description.slice(c,c+a.length)+""+this.description.slice(c+a.length))};var InputWaiter=function(a,b){this.app=a,this.manager=b,this.badKeys=[16,17,18,19,20,27,33,34,35,36,37,38,39,40,44,91,92,93,112,113,114,115,116,117,118,119,120,121,122,123,144,145]};InputWaiter.prototype.get=function(){return document.getElementById("input-text").value},InputWaiter.prototype.set=function(a){document.getElementById("input-text").value=a,window.dispatchEvent(this.manager.statechange)},InputWaiter.prototype.setInputInfo=function(a,b){var c=a.toString().length;c=c<2?2:c;var d=Utils.pad(a.toString(),c," ").replace(/ /g," "),e=Utils.pad(b.toString(),c," ").replace(/ /g," ");document.getElementById("input-info").innerHTML="length: "+d+"
          lines: "+e},InputWaiter.prototype.inputChange=function(a){this.manager.highlighter.removeHighlights(),this.app.progress=0;var b=this.get(),c=b.count("\n")+1;this.setInputInfo(b.length,c),this.badKeys.indexOf(a.keyCode)<0&&window.dispatchEvent(this.manager.statechange)},InputWaiter.prototype.inputDragover=function(a){return"move"!==a.dataTransfer.effectAllowed&&(a.stopPropagation(),a.preventDefault(),void a.target.classList.add("dropping-file"))},InputWaiter.prototype.inputDragleave=function(a){a.stopPropagation(),a.preventDefault(),a.target.classList.remove("dropping-file")},InputWaiter.prototype.inputDrop=function(a){if("move"===a.dataTransfer.effectAllowed)return!1;a.stopPropagation(),a.preventDefault();var b=a.target,c=a.dataTransfer.files[0],d=a.dataTransfer.getData("Text"),e=new FileReader,f="",g=0,h=20480,i=function(){f.length>1e5&&this.app.autoBake_&&(this.manager.controls.setAutoBake(!1),this.app.alert("Turned off Auto Bake as the input is large","warning",5e3)),this.set(f);var a=this.app.getRecipeConfig();a[0]&&"From Hex"===a[0].op||(a.unshift({op:"From Hex",args:["Space"]}),this.app.setRecipeConfig(a)),b.classList.remove("loadingFile")}.bind(this),j=function(){if(g>=c.size)return void i();b.value="Processing... "+Math.round(g/c.size*100)+"%";var a=c.slice(g,g+h);e.readAsArrayBuffer(a)};e.onload=function(a){var b=new Uint8Array(e.result);f+=Utils.toHexFast(b),g+=h,j()},b.classList.remove("dropping-file"),c?(b.classList.add("loadingFile"),j()):d&&this.set(d)},InputWaiter.prototype.clearIoClick=function(){this.manager.highlighter.removeHighlights(),document.getElementById("input-text").value="",document.getElementById("output-text").value="",document.getElementById("input-info").innerHTML="",document.getElementById("output-info").innerHTML="",document.getElementById("input-selection-info").innerHTML="",document.getElementById("output-selection-info").innerHTML="",window.dispatchEvent(this.manager.statechange)};var Manager=function(a){this.app=a,this.appstart=new CustomEvent("appstart",{bubbles:!0}),this.operationadd=new CustomEvent("operationadd",{bubbles:!0}),this.operationremove=new CustomEvent("operationremove",{bubbles:!0}),this.oplistcreate=new CustomEvent("oplistcreate",{bubbles:!0}),this.statechange=new CustomEvent("statechange",{bubbles:!0}),this.window=new WindowWaiter(this.app),this.controls=new ControlsWaiter(this.app,this),this.recipe=new RecipeWaiter(this.app,this),this.ops=new OperationsWaiter(this.app,this),this.input=new InputWaiter(this.app,this),this.output=new OutputWaiter(this.app,this),this.options=new OptionsWaiter(this.app),this.highlighter=new HighlighterWaiter(this.app),this.seasonal=new SeasonalWaiter(this.app,this),this.dynamicHandlers={},this.initialiseEventListeners()};Manager.prototype.setup=function(){this.recipe.initialiseOperationDragNDrop(),this.controls.autoBakeChange(),this.seasonal.load()},Manager.prototype.initialiseEventListeners=function(){window.addEventListener("resize",this.window.windowResize.bind(this.window)),window.addEventListener("blur",this.window.windowBlur.bind(this.window)),window.addEventListener("focus",this.window.windowFocus.bind(this.window)),window.addEventListener("statechange",this.app.stateChange.bind(this.app)),window.addEventListener("popstate",this.app.popState.bind(this.app)),document.getElementById("bake").addEventListener("click",this.controls.bakeClick.bind(this.controls)),document.getElementById("auto-bake").addEventListener("change",this.controls.autoBakeChange.bind(this.controls)),document.getElementById("step").addEventListener("click",this.controls.stepClick.bind(this.controls)),document.getElementById("clr-recipe").addEventListener("click",this.controls.clearRecipeClick.bind(this.controls)),document.getElementById("clr-breaks").addEventListener("click",this.controls.clearBreaksClick.bind(this.controls)),document.getElementById("save").addEventListener("click",this.controls.saveClick.bind(this.controls)),document.getElementById("save-button").addEventListener("click",this.controls.saveButtonClick.bind(this.controls)),document.getElementById("save-link-recipe-checkbox").addEventListener("change",this.controls.slrCheckChange.bind(this.controls)),document.getElementById("save-link-input-checkbox").addEventListener("change",this.controls.sliCheckChange.bind(this.controls)),document.getElementById("load").addEventListener("click",this.controls.loadClick.bind(this.controls)),document.getElementById("load-delete-button").addEventListener("click",this.controls.loadDeleteClick.bind(this.controls)),document.getElementById("load-name").addEventListener("change",this.controls.loadNameChange.bind(this.controls)),document.getElementById("load-button").addEventListener("click",this.controls.loadButtonClick.bind(this.controls)),document.getElementById("support").addEventListener("click",this.controls.supportButtonClick.bind(this.controls)),this.addMultiEventListener("#save-text","keyup paste",this.controls.saveTextChange,this.controls),this.addMultiEventListener("#search","keyup paste search",this.ops.searchOperations,this.ops),this.addDynamicListener(".op-list li.operation","dblclick",this.ops.operationDblclick,this.ops),document.getElementById("edit-favourites").addEventListener("click",this.ops.editFavouritesClick.bind(this.ops)),document.getElementById("save-favourites").addEventListener("click",this.ops.saveFavouritesClick.bind(this.ops)),document.getElementById("reset-favourites").addEventListener("click",this.ops.resetFavouritesClick.bind(this.ops)),this.addDynamicListener(".op-list .op-icon","mouseover",this.ops.opIconMouseover,this.ops),this.addDynamicListener(".op-list .op-icon","mouseleave",this.ops.opIconMouseleave,this.ops),this.addDynamicListener(".op-list","oplistcreate",this.ops.opListCreate,this.ops),this.addDynamicListener("li.operation","operationadd",this.recipe.opAdd.bind(this.recipe)),this.addDynamicListener(".arg","keyup",this.recipe.ingChange,this.recipe),this.addDynamicListener(".arg","change",this.recipe.ingChange,this.recipe),this.addDynamicListener(".disable-icon","click",this.recipe.disableClick,this.recipe),this.addDynamicListener(".breakpoint","click",this.recipe.breakpointClick,this.recipe),this.addDynamicListener("#rec-list li.operation","dblclick",this.recipe.operationDblclick,this.recipe),this.addDynamicListener("#rec-list li.operation > div","dblclick",this.recipe.operationChildDblclick,this.recipe),this.addDynamicListener("#rec-list .input-group .dropdown-menu a","click",this.recipe.dropdownToggleClick,this.recipe),this.addDynamicListener("#rec-list","operationremove",this.recipe.opRemove.bind(this.recipe)),this.addMultiEventListener("#input-text","keyup paste",this.input.inputChange,this.input),document.getElementById("reset-layout").addEventListener("click",this.app.resetLayout.bind(this.app)),document.getElementById("clr-io").addEventListener("click",this.input.clearIoClick.bind(this.input)),document.getElementById("input-text").addEventListener("dragover",this.input.inputDragover.bind(this.input)),document.getElementById("input-text").addEventListener("dragleave",this.input.inputDragleave.bind(this.input)),document.getElementById("input-text").addEventListener("drop",this.input.inputDrop.bind(this.input)),document.getElementById("input-text").addEventListener("scroll",this.highlighter.inputScroll.bind(this.highlighter)),document.getElementById("input-text").addEventListener("mouseup",this.highlighter.inputMouseup.bind(this.highlighter)),document.getElementById("input-text").addEventListener("mousemove",this.highlighter.inputMousemove.bind(this.highlighter)),this.addMultiEventListener("#input-text","mousedown dblclick select",this.highlighter.inputMousedown,this.highlighter),document.getElementById("save-to-file").addEventListener("click",this.output.saveClick.bind(this.output)),document.getElementById("switch").addEventListener("click",this.output.switchClick.bind(this.output)),document.getElementById("undo-switch").addEventListener("click",this.output.undoSwitchClick.bind(this.output)),document.getElementById("maximise-output").addEventListener("click",this.output.maximiseOutputClick.bind(this.output)),document.getElementById("output-text").addEventListener("scroll",this.highlighter.outputScroll.bind(this.highlighter)),document.getElementById("output-text").addEventListener("mouseup",this.highlighter.outputMouseup.bind(this.highlighter)),document.getElementById("output-text").addEventListener("mousemove",this.highlighter.outputMousemove.bind(this.highlighter)),document.getElementById("output-html").addEventListener("mouseup",this.highlighter.outputHtmlMouseup.bind(this.highlighter)),document.getElementById("output-html").addEventListener("mousemove",this.highlighter.outputHtmlMousemove.bind(this.highlighter)),this.addMultiEventListener("#output-text","mousedown dblclick select",this.highlighter.outputMousedown,this.highlighter),this.addMultiEventListener("#output-html","mousedown dblclick select",this.highlighter.outputHtmlMousedown,this.highlighter),document.getElementById("options").addEventListener("click",this.options.optionsClick.bind(this.options)),document.getElementById("reset-options").addEventListener("click",this.options.resetOptionsClick.bind(this.options)),$(document).on("switchChange.bootstrapSwitch",".option-item input:checkbox",this.options.switchChange.bind(this.options)),$(document).on("switchChange.bootstrapSwitch",".option-item input:checkbox",this.options.setWordWrap.bind(this.options)),this.addDynamicListener(".option-item input[type=number]","keyup",this.options.numberChange,this.options),this.addDynamicListener(".option-item input[type=number]","change",this.options.numberChange,this.options),this.addDynamicListener(".option-item select","change",this.options.selectChange,this.options),document.getElementById("alert-close").addEventListener("click",this.app.alertCloseClick.bind(this.app))},Manager.prototype.addListeners=function(a,b,c,d){d=d||this,[].forEach.call(document.querySelectorAll(a),function(a){a.addEventListener(b,c.bind(d))})},Manager.prototype.addMultiEventListener=function(a,b,c,d){for(var e=b.split(" "),f=0;f-1&&(this.manager.recipe.addOperation(b[c].innerHTML),this.app.autoBake()))),13===a.keyCode)a.preventDefault();else if(40===a.keyCode)a.preventDefault(),b=document.querySelectorAll("#search-results li"),b.length&&(c=this.getSelectedOp(b),c>-1&&b[c].classList.remove("selected-op"),c===b.length-1&&(c=-1),b[c+1].classList.add("selected-op"));else if(38===a.keyCode)a.preventDefault(),b=document.querySelectorAll("#search-results li"),b.length&&(c=this.getSelectedOp(b),c>-1&&b[c].classList.remove("selected-op"),0===c&&(c=b.length),b[c-1].classList.add("selected-op"));else{for(var d=document.getElementById("search-results"),e=a.target,f=e.value;d.firstChild;)$(d.firstChild).popover("destroy"),d.removeChild(d.firstChild);if($("#categories .in").collapse("hide"),f){for(var g=this.filterOperations(f,!0),h="",i=0;i=0||h>=0){var i=new HTMLOperation(e,this.app.operations[e],this.app,this.manager);b&&i.highlightSearchString(a,g,h),g<0?c.push(i):d.push(i)}}return d.concat(c)},OperationsWaiter.prototype.getSelectedOp=function(a){for(var b=0;blength: "+e+"
          lines: "+f,document.getElementById("input-selection-info").innerHTML="",document.getElementById("output-selection-info").innerHTML=""},OutputWaiter.prototype.adjustWidth=function(){var a=document.getElementById("output"),b=document.getElementById("save-to-file"),c=document.getElementById("switch"),d=document.getElementById("undo-switch"),e=document.getElementById("maximise-output");a.clientWidth<680?(b.childNodes[1].nodeValue="",c.childNodes[1].nodeValue="",d.childNodes[1].nodeValue="",e.childNodes[1].nodeValue=""):(b.childNodes[1].nodeValue=" Save to file",c.childNodes[1].nodeValue=" Move output to input",d.childNodes[1].nodeValue=" Undo",e.childNodes[1].nodeValue="Maximise"===e.getAttribute("title")?" Max":" Restore")},OutputWaiter.prototype.saveClick=function(){var a=Utils.toBase64(this.app.dishStr),b=window.prompt("Please enter a filename:","download.dat");if(b){var c=document.createElement("a");c.setAttribute("href","data:application/octet-stream;base64;charset=utf-8,"+a),c.setAttribute("download",b),c.style.display="none",document.body.appendChild(c),c.click(),c.remove()}},OutputWaiter.prototype.switchClick=function(){this.switchOrigData=this.manager.input.get(),document.getElementById("undo-switch").disabled=!1,this.app.setInput(this.app.dishStr)},OutputWaiter.prototype.undoSwitchClick=function(){this.app.setInput(this.switchOrigData),document.getElementById("undo-switch").disabled=!0},OutputWaiter.prototype.maximiseOutputClick=function(a){var b="maximise-output"===a.target.id?a.target:a.target.parentNode;"Maximise"===b.getAttribute("title")?(this.app.columnSplitter.collapse(0),this.app.columnSplitter.collapse(1),this.app.ioSplitter.collapse(0),b.setAttribute("title","Restore"),b.innerHTML=" Restore",this.adjustWidth()):(b.setAttribute("title","Maximise"),b.innerHTML=" Max",this.app.resetLayout())};var RecipeWaiter=function(a,b){this.app=a,this.manager=b,this.removeIntent=!1};RecipeWaiter.prototype.initialiseOperationDragNDrop=function(){var a=document.getElementById("rec-list");Sortable.create(a,{group:"recipe",sort:!0,animation:0,delay:0,filter:".arg-input,.arg",setData:function(a,b){a.setData("Text",b.querySelector(".arg-title").textContent)},onEnd:function(a){this.removeIntent&&(a.item.remove(),a.target.dispatchEvent(this.manager.operationremove))}.bind(this)}),Sortable.utils.on(a,"dragover",function(){this.removeIntent=!1}.bind(this)),Sortable.utils.on(a,"dragleave",function(){this.removeIntent=!0,this.app.progress=0}.bind(this)),Sortable.utils.on(a,"touchend",function(b){var c=b.changedTouches[0],d=document.elementFromPoint(c.clientX,c.clientY);this.removeIntent=!a.contains(d)}.bind(this)),document.querySelector("#categories a").addEventListener("dragover",this.favDragover.bind(this)),document.querySelector("#categories a").addEventListener("dragleave",this.favDragleave.bind(this)),document.querySelector("#categories a").addEventListener("drop",this.favDrop.bind(this))},RecipeWaiter.prototype.createSortableSeedList=function(a){Sortable.create(a,{group:{name:"recipe",pull:"clone",put:!1},sort:!1,setData:function(a,b){a.setData("Text",b.textContent)},onStart:function(a){$(a.item).popover("destroy"),a.item.setAttribute("data-toggle","popover-disabled")},onEnd:this.opSortEnd.bind(this)})},RecipeWaiter.prototype.opSortEnd=function(a){return this.removeIntent?void("rec-list"===a.item.parentNode.id&&a.item.remove()):($(a.clone).popover(),$(a.clone).children("[data-toggle=popover]").popover(),void("rec-list"===a.item.parentNode.id&&(this.buildRecipeOperation(a.item),a.item.dispatchEvent(this.manager.operationadd))))},RecipeWaiter.prototype.favDragover=function(a){return"move"===a.dataTransfer.effectAllowed&&(a.stopPropagation(),a.preventDefault(),void(a.target.className&&a.target.className.indexOf("category-title")>-1?a.target.classList.add("favourites-hover"):a.target.parentNode.className&&a.target.parentNode.className.indexOf("category-title")>-1?a.target.parentNode.classList.add("favourites-hover"):a.target.parentNode.parentNode.className&&a.target.parentNode.parentNode.className.indexOf("category-title")>-1&&a.target.parentNode.parentNode.classList.add("favourites-hover")))},RecipeWaiter.prototype.favDragleave=function(a){a.stopPropagation(),a.preventDefault(),document.querySelector("#categories a").classList.remove("favourites-hover")},RecipeWaiter.prototype.favDrop=function(a){a.stopPropagation(),a.preventDefault(),a.target.classList.remove("favourites-hover");var b=a.dataTransfer.getData("Text");this.app.addFavourite(b)},RecipeWaiter.prototype.ingChange=function(){window.dispatchEvent(this.manager.statechange)},RecipeWaiter.prototype.disableClick=function(a){var b=a.target;"false"===b.getAttribute("disabled")?(b.setAttribute("disabled","true"),b.classList.add("disable-icon-selected"),b.parentNode.parentNode.classList.add("disabled")):(b.setAttribute("disabled","false"),b.classList.remove("disable-icon-selected"),b.parentNode.parentNode.classList.remove("disabled")),this.app.progress=0,window.dispatchEvent(this.manager.statechange)},RecipeWaiter.prototype.breakpointClick=function(a){var b=a.target;"false"===b.getAttribute("break")?(b.setAttribute("break","true"),b.classList.add("breakpoint-selected")):(b.setAttribute("break","false"),b.classList.remove("breakpoint-selected")),window.dispatchEvent(this.manager.statechange)},RecipeWaiter.prototype.operationDblclick=function(a){a.target.remove(),window.dispatchEvent(this.manager.statechange)},RecipeWaiter.prototype.operationChildDblclick=function(a){a.target.parentNode.remove(),window.dispatchEvent(this.manager.statechange)},RecipeWaiter.prototype.getConfig=function(){for(var a,b,c,d,e,f=[],g=document.querySelectorAll("#rec-list li.operation"),h=0;h",this.ingChange()},RecipeWaiter.prototype.opAdd=function(a){window.dispatchEvent(this.manager.statechange)},RecipeWaiter.prototype.opRemove=function(a){window.dispatchEvent(this.manager.statechange)};var SeasonalWaiter=function(a,b){this.app=a,this.manager=b};SeasonalWaiter.prototype.load=function(){var a=new Date;11===a.getMonth()&&a.getDate()>12&&(this.app.options.snow=!1,this.createSnowOption(),$(document).on("switchChange.bootstrapSwitch",".option-item input:checkbox[option='snow']",this.letItSnow.bind(this)),window.addEventListener("resize",this.letItSnow.bind(this)),this.manager.addListeners(".btn","click",this.shakeOffSnow,this),25===a.getDate()&&this.letItSnow()),this.kkeys=[],window.addEventListener("keydown",this.konamiCodeListener.bind(this))},SeasonalWaiter.prototype.insertSpiderIcons=function(){var a="iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAB3UlEQVQ4y2NgGJaAmYGBgVnf0oKJgYGBobWtXamqqoYTn2I4CI+LTzM2NTulpKbu+vPHz2dV5RWlluZmi3j5+KqFJSSEzpw8uQPdAEYYIzo5Kfjrl28rWFlZzjAzMYuEBQao3Lh+g+HGvbsMzExMDN++fWf4/PXLBzY2tqYNK1f2+4eHM2xcuRLigsT09Igf3384MTExbf767etBI319jU8fPsi+//jx/72HDxh5uLkZ7ty7y/Dz1687Avz8n2UUFR3Z2NjOySoqfmdhYGBg+PbtuwI7O8e5H79+8X379t357PnzYo+ePP7y6cuXc9++f69nYGRsvf/w4XdtLS2R799/bBUWFHr57sP7Jbs3b/ZkzswvUP3165fZ7z9//r988WIVAyPDr8tXr576+u3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BFht9fHDVCbEUt3LJxi08B8Xj6vTDESriq9lVWqBECgHujqiqAUmufb1X3cfRXoluhjZWiwkOnSUcUS6ZD8LUmmhks6b5j1ezkAkAKZBe5QvPPcNBnoCawMwT66Qxk0R2xwwRAui2iSDGuaPDcubzo3EJq8wcx/9Vmk3QryH42QBQCFF0UagIiJtjX6DskIXTLEucJSHIIIMuO0BOcjn3A3ybU/lu5RCUBc5qA0Ih0Q2EWiCPRk7VfMNhjLW1zETic1tLYZDMKyuSsdfh5l6bwho5+0il4kyA0VohlNcF5FP8DlWo/VB16HYB2hJ0pzgIe2mcXxP2IOumPRY17U0tll8KIkZNb+sppafOxYkQPSaYfchyYoL9GMqWYpTLRIq1QUcT4O3aPQgqVqPwIOIMwDhzX6mQUFIQAgo+9MzcrWrML3mj6+YIKiFCZyhL87RqVQKrEskF+P1BUvfLCAkfRwoPUtq6l5o5+lZb5SolJo6oT8avTCl+c9OTmat6pKW8mLkvBpGzlvsiGuQr4ZEEwA1EQgoR/gNtxIxKBluz+OtMJiF31jHxqXBiAqAUj4WRxpADFM0DCFlv1khvX7Wol4vF4AIldVVxdZqlrIfiCYQPHDy6bAGv7nKYRVY6JewExZVAP+ey5Rv+Ba97aaUHMW5NauLmMZFkegBb/EP14d6NoS9QLWFSzWBmuZza8CQmSpXsAqmGtVy14VALWuuYWWy+W3OteXa4jwceQX6+BKG6J1/8+2VCNkm2222WabbbbZZpttttlmm22rt38DCdA0vq3bcAkAAAAASUVORK5CYII="; +document.querySelector("link[rel=icon]").setAttribute("href","data:image/png;base64,"+a),document.querySelector("#bake img").setAttribute("src","data:image/png;base64,"+b),document.querySelector(".about-img-left").setAttribute("src","data:image/png;base64,"+c)},SeasonalWaiter.prototype.insertSpiderText=function(){document.title=document.title.replace(/Cyber/g,"Spider"),SeasonalWaiter.treeWalk(document.body,function(a){3===a.nodeType&&(a.nodeValue=a.nodeValue.replace(/Cyber/g,"Spider"))},!0),SeasonalWaiter.treeWalk(document.getElementById("bake-group"),function(a){3===a.nodeType&&(a.nodeValue=a.nodeValue.replace(/Bake/g,"Spin"))},!0),document.querySelector("#recipe .title").innerHTML="Web"},SeasonalWaiter.prototype.createSnowOption=function(){var a=document.getElementById("options-body"),b=document.createElement("div");b.className="option-item",b.innerHTML=" Let it snow",a.appendChild(b),this.manager.options.load()},SeasonalWaiter.prototype.letItSnow=function(){if($(document).snowfall("clear"),this.app.options.snow){var a={},b=navigator.userAgent.match(/Firefox\/(\d\d?)/);a=b&&parseInt(b[1],10)<30?{flakeCount:10,flakeColor:"#fff",flakePosition:"absolute",minSize:1,maxSize:2,minSpeed:1,maxSpeed:5,round:!1,shadow:!1,collection:!1,collectionHeight:20,deviceorientation:!0}:{flakeCount:35,flakeColor:"#fff",flakePosition:"absolute",minSize:5,maxSize:8,minSpeed:1,maxSpeed:5,round:!0,shadow:!0,collection:".btn",collectionHeight:20,deviceorientation:!0},$(document).snowfall(a)}},SeasonalWaiter.prototype.shakeOffSnow=function(a){for(var b=a.target,c=b.getBoundingClientRect(),d=document.querySelectorAll("canvas.snowfall-canvas"),e=null,f=function(){h.clearRect(0,0,e.width,e.height),$(this).fadeIn()},g=0;g6e4&&this.app.silentBake()};var main=function(){var a=["To Base64","From Base64","To Hex","From Hex","To Hexdump","From Hexdump","URL Decode","Regular expression","Entropy","Fork"],b={updateUrl:!0,showHighlighter:!0,treatAsUtf8:!0,wordWrap:!0,showErrors:!0,errorTimeout:4e3,autoBakeThreshold:200,attemptHighlight:!0,snow:!1};document.removeEventListener("DOMContentLoaded",main,!1),window.app=new HTMLApp(Categories,OperationConfig,a,b),window.app.setup()};window.console=console||{log:function(){},error:function(){}},window.compileTime=moment.tz("07/02/2017 20:29:54 UTC","DD/MM/YYYY HH:mm:ss z","UTC").valueOf(),window.compileMessage="",document.addEventListener("DOMContentLoaded",main,!1); \ No newline at end of file diff --git a/build/prod/index.html b/build/prod/index.html index 26cf30a7..04f425aa 100755 --- a/build/prod/index.html +++ b/build/prod/index.html @@ -18,4 +18,4 @@ See the License for the specific language governing permissions and limitations under the License. --> -CyberChef Edit
          Operations
            Recipe
              Input
              Output
              \ No newline at end of file +CyberChef Edit
              Operations
                Recipe
                  Input
                  Output
                  \ No newline at end of file diff --git a/build/prod/scripts.js b/build/prod/scripts.js index 29ef4027..c82c1049 100755 --- a/build/prod/scripts.js +++ b/build/prod/scripts.js @@ -286,6 +286,6 @@ if(d<0||d>127)return"CIDR must be less than 32 for IPv4 or 128 for IPv6";for(var "060a2b06010401823702010e":"certExtensions","060a2b06010401823702010f":"spcPelmageData","060a2b060104018237020112":"SPC_RAW_FILE_DATA_OBJID","060a2b060104018237020113":"SPC_STRUCTURED_STORAGE_DATA_OBJID","060a2b060104018237020114":"spcLink","060a2b060104018237020115":"individualCodeSigning","060a2b060104018237020116":"commercialCodeSigning","060a2b060104018237020119":"spcLink","060a2b06010401823702011a":"spcMinimalCriteriaInfo","060a2b06010401823702011b":"spcFinancialCriteriaInfo","060a2b06010401823702011c":"spcLink","060a2b06010401823702011d":"SPC_HASH_INFO_OBJID","060a2b06010401823702011e":"SPC_SIPINFO_OBJID","060a2b060104018237020104":"spcIndirectDataContext","060a2b0601040182370202":"CTL for Software Publishers Trusted CAs","060a2b060104018237020201":"szOID_TRUSTED_CODESIGNING_CA_LIST","060a2b060104018237020202":"szOID_TRUSTED_CLIENT_AUTH_CA_LIST","060a2b060104018237020203":"szOID_TRUSTED_SERVER_AUTH_CA_LIST","060a2b06010401823714":"Microsoft Enrollment Infrastructure","060a2b0601040182371401":"szOID_AUTO_ENROLL_CTL_USAGE","060a2b0601040182371402":"szOID_ENROLL_CERTTYPE_EXTENSION","060a2b060104018237140201":"szOID_ENROLLMENT_AGENT","060a2b060104018237140202":"szOID_KP_SMARTCARD_LOGON","060a2b060104018237140203":"szOID_NT_PRINCIPAL_NAME","060a2b0601040182371403":"szOID_CERT_MANIFOLD","06092b06010401823715":"Microsoft CertSrv Infrastructure","06092b0601040182371501":"szOID_CERTSRV_CA_VERSION","06092b0601040182371514":"Client Information","060a2b06010401823719":"Microsoft Directory Service","060a2b0601040182371901":"szOID_NTDS_REPLICATION","060a2b06010401823703":"Time Stamping","060a2b060104018237030201":"SPC_TIME_STAMP_REQUEST_OBJID","060a2b0601040182371e":"IIS","060a2b0601040182371f":"Windows updates and service packs","060a2b0601040182371f01":"szOID_PRODUCT_UPDATE","060a2b06010401823704":"Permissions","060a2b06010401823728":"Fonts","060a2b06010401823729":"Microsoft Licensing and Registration","060a2b0601040182372a":"Microsoft Corporate PKI (ITG)","060a2b06010401823758":"CAPICOM","060a2b0601040182375801":"szOID_CAPICOM_VERSION","060a2b0601040182375802":"szOID_CAPICOM_ATTRIBUTE","060a2b060104018237580201":"szOID_CAPICOM_DOCUMENT_NAME","060a2b060104018237580202":"szOID_CAPICOM_DOCUMENT_DESCRIPTION","060a2b0601040182375803":"szOID_CAPICOM_ENCRYPTED_DATA","060a2b060104018237580301":"szOID_CAPICOM_ENCRYPTED_CONTENT","06032b0601050507":"pkix","06032b060105050701":"privateExtension","06032b06010505070101":"authorityInfoAccess","06032b06010505070c02":"CMC Data","06032b060105050702":"policyQualifierIds","06032b06010505070202":"unotice","06032b060105050703":"keyPurpose","06032b06010505070301":"serverAuth","06032b06010505070302":"clientAuth","06032b06010505070303":"codeSigning","06032b06010505070304":"emailProtection","06032b06010505070305":"ipsecEndSystem","06032b06010505070306":"ipsecTunnel","06032b06010505070307":"ipsecUser","06032b06010505070308":"timeStamping","06032b060105050704":"cmpInformationTypes","06032b06010505070401":"caProtEncCert","06032b06010505070402":"signKeyPairTypes","06032b06010505070403":"encKeyPairTypes","06032b06010505070404":"preferredSymmAlg","06032b06010505070405":"caKeyUpdateInfo","06032b06010505070406":"currentCRL","06032b06010505073001":"ocsp","06032b06010505073002":"caIssuers","06032b06010505080101":"HMAC-MD5","06032b06010505080102":"HMAC-SHA","060360864801650201010a":"mosaicKeyManagementAlgorithm","060360864801650201010b":"sdnsKMandSigAlgorithm","060360864801650201010c":"mosaicKMandSigAlgorithm","060360864801650201010d":"SuiteASignatureAlgorithm","060360864801650201010e":"SuiteAConfidentialityAlgorithm","060360864801650201010f":"SuiteAIntegrityAlgorithm","06036086480186f84201":"cert-extension","06036086480186f842010a":"EntityLogo","06036086480186f842010b":"UserPicture","06036086480186f8420109":"HomePage-url","06036086480186f84202":"data-type","06036086480186f8420201":"GIF","06036086480186f8420202":"JPEG","06036086480186f8420203":"URL","06036086480186f8420204":"HTML","06036086480186f8420205":"netscape-cert-sequence","06036086480186f8420206":"netscape-cert-url","06036086480186f84203":"directory","06036086480186f8420401":"serverGatedCrypto","06036086480186f845010603":"Unknown Verisign extension","06036086480186f845010606":"Unknown Verisign extension","06036086480186f84501070101":"Verisign certificatePolicy","06036086480186f8450107010101":"Unknown Verisign policy qualifier","06036086480186f8450107010102":"Unknown Verisign policy qualifier","0603678105":"TCPA","060367810501":"tcpaSpecVersion","060367810502":"tcpaAttribute","06036781050201":"tcpaAtTpmManufacturer","0603678105020a":"tcpaAtSecurityQualities","0603678105020b":"tcpaAtTpmProtectionProfile","0603678105020c":"tcpaAtTpmSecurityTarget","0603678105020d":"tcpaAtFoundationProtectionProfile","0603678105020e":"tcpaAtFoundationSecurityTarget","0603678105020f":"tcpaAtTpmIdLabel","06036781050202":"tcpaAtTpmModel","06036781050203":"tcpaAtTpmVersion","06036781050204":"tcpaAtPlatformManufacturer","06036781050205":"tcpaAtPlatformModel","06036781050206":"tcpaAtPlatformVersion","06036781050207":"tcpaAtComponentManufacturer","06036781050208":"tcpaAtComponentModel","06036781050209":"tcpaAtComponentVersion","060367810503":"tcpaProtocol","06036781050301":"tcpaPrttTpmIdProtocol","0603672a00":"contentType","0603672a0000":"PANData","0603672a0001":"PANToken","0603672a0002":"PANOnly","0603672a01":"msgExt","0603672a0a":"national","0603672a0a8140":"Japan","0603672a02":"field","0603672a0200":"fullName","0603672a0201":"givenName","0603672a020a":"amount","0603672a0202":"familyName","0603672a0203":"birthFamilyName","0603672a0204":"placeName","0603672a0205":"identificationNumber","0603672a0206":"month","0603672a0207":"date","0603672a02070b":"accountNumber","0603672a02070c":"passPhrase","0603672a0208":"address","0603672a0209":"telephone","0603672a03":"attribute","0603672a0300":"cert","0603672a030000":"rootKeyThumb","0603672a030001":"additionalPolicy","0603672a04":"algorithm","0603672a05":"policy","0603672a0500":"root","0603672a06":"module","0603672a07":"certExt","0603672a0700":"hashedRootKey","0603672a0701":"certificateType","0603672a0702":"merchantData","0603672a0703":"cardCertRequired","0603672a0704":"tunneling","0603672a0705":"setExtensions","0603672a0706":"setQualifier","0603672a08":"brand","0603672a0801":"IATA-ATA","0603672a081e":"Diners","0603672a0822":"AmericanExpress","0603672a0804":"VISA","0603672a0805":"MasterCard","0603672a08ae7b":"Novus","0603672a09":"vendor","0603672a0900":"GlobeSet","0603672a0901":"IBM","0603672a090a":"Griffin","0603672a090b":"Certicom","0603672a090c":"OSS","0603672a090d":"TenthMountain","0603672a090e":"Antares","0603672a090f":"ECC","0603672a0910":"Maithean","0603672a0911":"Netscape","0603672a0912":"Verisign","0603672a0913":"BlueMoney","0603672a0902":"CyberCash","0603672a0914":"Lacerte","0603672a0915":"Fujitsu","0603672a0916":"eLab","0603672a0917":"Entrust","0603672a0918":"VIAnet","0603672a0919":"III","0603672a091a":"OpenMarket","0603672a091b":"Lexem","0603672a091c":"Intertrader","0603672a091d":"Persimmon","0603672a0903":"Terisa","0603672a091e":"NABLE","0603672a091f":"espace-net","0603672a0920":"Hitachi","0603672a0921":"Microsoft","0603672a0922":"NEC","0603672a0923":"Mitsubishi","0603672a0924":"NCR","0603672a0925":"e-COMM","0603672a0926":"Gemplus","0603672a0904":"RSADSI","0603672a0905":"VeriFone","0603672a0906":"TrinTech","0603672a0907":"BankGate","0603672a0908":"GTE","0603672a0909":"CompuSource","0603551d01":"authorityKeyIdentifier","0603551d0a":"basicConstraints","0603551d0b":"nameConstraints","0603551d0c":"policyConstraints","0603551d0d":"basicConstraints","0603551d0e":"subjectKeyIdentifier","0603551d0f":"keyUsage","0603551d10":"privateKeyUsagePeriod","0603551d11":"subjectAltName","0603551d12":"issuerAltName","0603551d13":"basicConstraints","0603551d02":"keyAttributes","0603551d14":"cRLNumber","0603551d15":"cRLReason","0603551d16":"expirationDate","0603551d17":"instructionCode","0603551d18":"invalidityDate","0603551d1a":"issuingDistributionPoint","0603551d1b":"deltaCRLIndicator","0603551d1c":"issuingDistributionPoint","0603551d1d":"certificateIssuer","0603551d03":"certificatePolicies","0603551d1e":"nameConstraints","0603551d1f":"cRLDistributionPoints","0603551d20":"certificatePolicies","0603551d21":"policyMappings","0603551d22":"policyConstraints","0603551d23":"authorityKeyIdentifier","0603551d24":"policyConstraints","0603551d25":"extKeyUsage","0603551d04":"keyUsageRestriction","0603551d05":"policyMapping","0603551d06":"subtreesConstraint","0603551d07":"subjectAltName","0603551d08":"issuerAltName","0603551d09":"subjectDirectoryAttributes","0603550400":"objectClass","0603550401":"aliasObjectName","060355040d":"description","060355040e":"searchGuide","060355040f":"businessCategory","0603550410":"postalAddress","0603550411":"postalCode","0603550412":"postOfficeBox","0603550413":"physicalDeliveryOfficeName","0603550402":"knowledgeInformation","0603550415":"telexNumber","0603550416":"teletexTerminalIdentifier","0603550417":"facsimileTelephoneNumber","0603550418":"x121Address","0603550419":"internationalISDNNumber","060355041a":"registeredAddress","060355041b":"destinationIndicator","060355041c":"preferredDeliveryMehtod","060355041d":"presentationAddress","060355041e":"supportedApplicationContext","060355041f":"member","0603550420":"owner","0603550421":"roleOccupant","0603550422":"seeAlso","0603550423":"userPassword","0603550424":"userCertificate","0603550425":"caCertificate","0603550426":"authorityRevocationList","0603550427":"certificateRevocationList","0603550428":"crossCertificatePair","0603550429":"givenName","0603550405":"serialNumber","0603550434":"supportedAlgorithms","0603550435":"deltaRevocationList","060355043a":"crossCertificatePair","06035508":"X.500-Algorithms","0603550801":"X.500-Alg-Encryption","060355080101":"rsa","0603604c0101":"DPC"};var Punycode={IDN:!1,runToAscii:function(a,b){var c=b[0];return c?punycode.ToASCII(a):punycode.encode(a)},runToUnicode:function(a,b){var c=b[0];return c?punycode.ToUnicode(a):punycode.decode(a)}},QuotedPrintable={runTo:function(a,b){var c=QuotedPrintable.mimeEncode(a);return c=c.replace(/\r?\n|\r/g,function(){return"\r\n"}).replace(/[\t ]+$/gm,function(a){return a.replace(/ /g,"=20").replace(/\t/g,"=09")}),QuotedPrintable._addSoftLinebreaks(c,"qp")},runFrom:function(a,b){var c=a.replace(/\=(?:\r?\n|$)/g,"");return QuotedPrintable.mimeDecode(c)},mimeDecode:function(a){for(var b,c,d=(a.match(/\=[\da-fA-F]{2}/g)||[]).length,e=a.length-2*d,f=new Array(e),g=0,h=0,i=a.length;h=0;c--)if(b[c].length){if(1===b[c].length&&a===b[c][0])return!0;if(2===b[c].length&&a>=b[c][0]&&a<=b[c][1])return!0}return!1},_addSoftLinebreaks:function(a,b){var c=76;return b=(b||"base64").toString().toLowerCase().trim(),"qp"===b?this._addQPSoftLinebreaks(a,c):this._addBase64SoftLinebreaks(a,c)},_addBase64SoftLinebreaks:function(a,b){return a=(a||"").toString().trim(),a.replace(new RegExp(".{"+b+"}","g"),"$&\r\n").trim()},_addQPSoftLinebreaks:function(a,b){for(var c,d,e,f=0,g=a.length,h=Math.floor(b/3),i="";fb-h&&(c=e.substr(-h).match(/[ \t\.,!\?][^ \t\.,!\?]*$/)))e=e.substr(0,e.length-(c[0].length-1));else if("\r"===e.substr(-1))e=e.substr(0,e.length-1);else if(e.match(/\=[\da-f]{0,2}$/i))for((c=e.match(/\=[\da-f]{0,1}$/i))&&(e=e.substr(0,e.length-c[0].length));e.length>3&&e.length=192)););f+e.length=65&&c<=90?(c=(c-65+d)%26,e[h]=c+65):f&&c>=97&&c<=122&&(c=(c-97+d)%26,e[h]=c+97)}return e},ROT47_AMOUNT:47,runRot47:function(a,b){var c,d=b[0],e=a;if(d){d<0&&(d=94-Math.abs(d)%94);for(var f=0;f=33&&c<=126&&(c=(c-33+d)%94,e[f]=c+33)}return e},_rotr:function(a){var b=(1&a)<<7;return a>>1|b},_rotl:function(a){var b=a>>7&1;return 255&(a<<1|b)},_rotrWhole:function(a,b){var c,d=0,e=[];b%=8;for(var f=0;f>>0;c=g>>b|d,d=(g&Math.pow(2,b)-1)<<8-b,e.push(c)}return e[0]|=d,e},_rotlWhole:function(a,b){var c,d=0,e=[];b%=8;for(var f=a.length-1;f>=0;f--){var g=a[f];c=255&(g<>8-b&Math.pow(2,b)-1,e[f]=c}return e[a.length-1]=e[a.length-1]|d,e}},SeqUtils={DELIMITER_OPTIONS:["Line feed","CRLF","Space","Comma","Semi-colon","Colon","Nothing (separate chars)"],SORT_REVERSE:!1,SORT_ORDER:["Alphabetical (case sensitive)","Alphabetical (case insensitive)","IP address"],runSort:function(a,b){var c=Utils.charRep[b[0]],d=b[1],e=b[2],f=a.split(c);return"Alphabetical (case sensitive)"===e?f=f.sort():"Alphabetical (case insensitive)"===e?f=f.sort(SeqUtils._caseInsensitiveSort):"IP address"===e&&(f=f.sort(SeqUtils._ipSort)),d&&f.reverse(),f.join(c)},runUnique:function(a,b){var c=Utils.charRep[b[0]];return a.split(c).unique().join(c)},SEARCH_TYPE:["Regex","Extended (\\n, \\t, \\x...)","Simple string"],runCount:function(a,b){var c=b[0].string,d=b[0].option;if("Regex"!==d||!c)return c?(0===d.indexOf("Extended")&&(c=Utils.parseEscapedChars(c)),a.count(c)):0;try{var e=new RegExp(c,"gi"),f=a.match(e);return f.length}catch(a){return 0}},REVERSE_BY:["Character","Line"],runReverse:function(a,b){if("Line"===b[0]){for(var c=[],d=[],e=[],f=0;f()\\[\\]{}\\s\\x7F-\\xFF]*(?:[.!,?]+[^.!,?;"\\x27<>()\\[\\]{}\\s\\x7F-\\xFF]+)*)?'},{name:"Domain",value:"(?:(https?):\\/\\/)?([-\\w.]+)\\.(com|net|org|biz|info|co|uk|onion|int|mobi|name|edu|gov|mil|eu|ac|ae|af|de|ca|ch|cn|cy|es|gb|hk|il|in|io|tv|me|nl|no|nz|ro|ru|tr|us|az|ir|kz|uz|pk)+"},{name:"Windows file path",value:"([A-Za-z]):\\\\((?:[A-Za-z\\d][A-Za-z\\d\\- \\x27_\\(\\)]{0,61}\\\\?)*[A-Za-z\\d][A-Za-z\\d\\- \\x27_\\(\\)]{0,61})(\\.[A-Za-z\\d]{1,6})?"},{name:"UNIX file path",value:"(?:/[A-Za-z\\d.][A-Za-z\\d\\-.]{0,61})+"},{name:"MAC address",value:"[A-Fa-f\\d]{2}(?:[:-][A-Fa-f\\d]{2}){5}"},{name:"Date (yyyy-mm-dd)",value:"((?:19|20)\\d\\d)[- /.](0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])"},{name:"Date (dd/mm/yyyy)",value:"(0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.]((?:19|20)\\d\\d)"},{name:"Date (mm/dd/yyyy)",value:"(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.]((?:19|20)\\d\\d)"},{name:"Strings",value:'[A-Za-z\\d/\\-:.,_$%\\x27"()<>= !\\[\\]{}@]{4,}'}],REGEX_CASE_INSENSITIVE:!0,REGEX_MULTILINE_MATCHING:!0,OUTPUT_FORMAT:["Highlight matches","List matches","List capture groups","List matches with capture groups"],DISPLAY_TOTAL:!1,runRegex:function(a,b){var c=b[1],d=b[2],e=b[3],f=b[4],g=b[5],h="g";if(d&&(h+="i"),e&&(h+="m"),!c||"^"===c||"$"===c)return Utils.escapeHtml(a);try{var i=new RegExp(c,h);switch(g){case"Highlight matches":return StrUtils._regexHighlight(a,i,f);case"List matches":return Utils.escapeHtml(StrUtils._regexList(a,i,f,!0,!1));case"List capture groups":return Utils.escapeHtml(StrUtils._regexList(a,i,f,!1,!0));case"List matches with capture groups":return Utils.escapeHtml(StrUtils._regexList(a,i,f,!0,!0));default:return"Error: Invalid output format"}}catch(a){return"Invalid regex. Details: "+a.message}},CASE_SCOPE:["All","Word","Sentence","Paragraph"],runUpper:function(a,b){var c=b[0];switch(c){case"Word":return a.replace(/(\b\w)/gi,function(a){return a.toUpperCase()});case"Sentence":return a.replace(/(?:\.|^)\s*(\b\w)/gi,function(a){return a.toUpperCase()});case"Paragraph":return a.replace(/(?:\n|^)\s*(\b\w)/gi,function(a){return a.toUpperCase()});case"All":default:return a.toUpperCase()}},runLower:function(a,b){return a.toLowerCase()},SEARCH_TYPE:["Regex","Extended (\\n, \\t, \\x...)","Simple string"],FIND_REPLACE_GLOBAL:!0,FIND_REPLACE_CASE:!1,FIND_REPLACE_MULTILINE:!0,runFindReplace:function(a,b){var c=b[0].string,d=b[0].option,e=b[1],f=b[2],g=b[3],h=b[4],i="";return f&&(i+="g"),g&&(i+="i"),h&&(i+="m"),"Regex"===d?c=new RegExp(c,i):0===d.indexOf("Extended")&&(c=Utils.parseEscapedChars(c)),a.replace(c,e,i)},SPLIT_DELIM:",",DELIMITER_OPTIONS:["Line feed","CRLF","Space","Comma","Semi-colon","Colon","Nothing (separate chars)"],runSplit:function(a,b){var c=b[0]||StrUtils.SPLIT_DELIM,d=Utils.charRep[b[1]],e=a.split(c);return e.join(d)},runFilter:function(a,b){var c=Utils.charRep[b[0]],d=b[2];try{var e=new RegExp(b[1])}catch(a){return"Invalid regex. Details: "+a.message}var f=function(a){return d^e.test(a)};return a.split(c).filter(f).join(c)},DIFF_SAMPLE_DELIMITER:"\\n\\n",DIFF_BY:["Character","Word","Line","Sentence","CSS","JSON"],runDiff:function(a,b){var c,d=b[0],e=b[1],f=b[2],g=b[3],h=b[4],i=a.split(d),j="";if(!i||2!==i.length)return"Incorrect number of samples, perhaps you need to modify the sample delimiter or add more samples?";switch(e){case"Character":c=JsDiff.diffChars(i[0],i[1]);break;case"Word":c=h?JsDiff.diffWords(i[0],i[1]):JsDiff.diffWordsWithSpace(i[0],i[1]);break;case"Line":c=h?JsDiff.diffTrimmedLines(i[0],i[1]):JsDiff.diffLines(i[0],i[1]);break;case"Sentence":c=JsDiff.diffSentences(i[0],i[1]);break;case"CSS":c=JsDiff.diffCss(i[0],i[1]);break;case"JSON":c=JsDiff.diffJson(i[0],i[1]);break;default:return"Invalid 'Diff by' option."}for(var k=0;k"+Utils.escapeHtml(c[k].value)+""):c[k].removed?g&&(j+=""+Utils.escapeHtml(c[k].value)+""):j+=Utils.escapeHtml(c[k].value);return j},OFF_CHK_SAMPLE_DELIMITER:"\\n\\n",runOffsetChecker:function(a,b){var c,d=b[0],e=a.split(d),f=[],g=0,h=0,i=!1,j=!1;if(!e||e.length<2)return"Not enough samples, perhaps you need to modify the sample delimiter or add more data?";for(h=0;h"),h===e.length-1&&(j=!1)):(i&&!j?(f[h]+=""+Utils.escapeHtml(e[h][g]),e[h].length===g+1&&(f[h]+=""),h===e.length-1&&(j=!0)):!i&&j?(f[h]+=""+Utils.escapeHtml(e[h][g]),h===e.length-1&&(j=!1)):(f[h]+=Utils.escapeHtml(e[h][g]),j&&e[h].length===g+1&&(f[h]+="",e[h].length-1!==g&&(j=!1))),e[0].length-1===g&&(j&&(f[h]+=""),f[h]+=Utils.escapeHtml(e[h].substring(g+1))))}return f.join(d)},runParseEscapedString:function(a,b){return Utils.parseEscapedChars(a)},_regexHighlight:function(a,b,c){for(var d,e="",f=1,g=0,h=0;d=b.exec(a);)e+=Utils.escapeHtml(a.slice(g,d.index)),e+=""+Utils.escapeHtml(d[0])+"",f=1===f?2:1,g=b.lastIndex,h++;return e+=Utils.escapeHtml(a.slice(g,a.length)),c&&(e="Total found: "+h+"\n\n"+e),e},_regexList:function(a,b,c,d,e){for(var f,g="",h=0;f=b.exec(a);)if(h++,d&&(g+=f[0]+"\n"),e)for(var i=1;ih?g[i][0].length:h;for(i=0;i1&&g[i][1].length?" = "+g[i][1]+"\n":"\n"}return d}return"Invalid URI"},_encodeAllChars:function(a){return encodeURIComponent(a).replace(/!/g,"%21").replace(/#/g,"%23").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A").replace(/\-/g,"%2D").replace(/\./g,"%2E").replace(/_/g,"%5F").replace(/~/g,"%7E")}},UUID={runGenerateV4:function(a,b){if("undefined"!=typeof window.crypto&&"undefined"!=typeof window.crypto.getRandomValues){var c=new Uint32Array(4),d=0;return window.crypto.getRandomValues(c),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var b=c[d>>3]>>d%8*4&15,e="x"===a?b:3&b|8;return d++,e.toString(16)})}return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var b=16*Math.random()|0,c="x"===a?b:3&b|8;return c.toString(16)})}},Chef=function(){this.dish=new Dish};Chef.prototype.bake=function(a,b,c,d,e){var f=(new Date).getTime(),g=new Recipe(b),h=g.containsFlowControl(),i=!1;c.hasOwnProperty("attemptHighlight")&&(c.attemptHighlight=!0),h&&(c.attemptHighlight=!1),d>=b.length&&(d=0),e&&(g.setBreakpoint(d,!1),g.setBreakpoint(d+1,!0)),d>0&&h&&(g.removeBreaksUpTo(d),d=0),0===d&&this.dish.set(a,Dish.STRING);try{d=g.execute(this.dish,d)}catch(a){i=a,d=a.progress}return{result:this.dish.type===Dish.HTML?this.dish.get(Dish.HTML):this.dish.get(Dish.STRING),type:Dish.enumLookup(this.dish.type),progress:d,options:c,duration:(new Date).getTime()-f,error:i}},Chef.prototype.silentBake=function(a){var b=(new Date).getTime(),c=new Recipe(a),d=new Dish("",Dish.STRING);try{c.execute(d)}catch(a){}return(new Date).getTime()-b};var Dish=function(a,b){this.value=a||"string"==typeof a?a:null,this.type=b||Dish.BYTE_ARRAY};Dish.BYTE_ARRAY=0,Dish.STRING=1,Dish.NUMBER=2,Dish.HTML=3,Dish.typeEnum=function(a){switch(a){case"byteArray":case"Byte array":return Dish.BYTE_ARRAY;case"string":case"String":return Dish.STRING;case"number":case"Number":return Dish.NUMBER;case"html":case"HTML":return Dish.HTML;default:throw"Invalid data type string. No matching enum."}},Dish.enumLookup=function(a){switch(a){case Dish.BYTE_ARRAY:return"byteArray";case Dish.STRING:return"string";case Dish.NUMBER:return"number";case Dish.HTML:return"html";default:throw"Invalid data type enum. No matching type."}},Dish.prototype.set=function(a,b){if(this.value=a,this.type=b,!this.valid()){var c=Utils.truncate(JSON.stringify(this.value),13);throw"Data is not a valid "+Dish.enumLookup(b)+": "+c}},Dish.prototype.get=function(a){return this.type!==a&&this.translate(a),this.value},Dish.prototype.translate=function(a){switch(this.type){case Dish.STRING:this.value=this.value?Utils.strToByteArray(this.value):[],this.type=Dish.BYTE_ARRAY;break;case Dish.NUMBER:this.value="number"==typeof this.value?Utils.strToByteArray(this.value.toString()):[],this.type=Dish.BYTE_ARRAY;break;case Dish.HTML:this.value=this.value?Utils.strToByteArray(Utils.stripHtmlTags(this.value,!0)):[],this.type=Dish.BYTE_ARRAY}switch(a){case Dish.STRING:case Dish.HTML:this.value=this.value?Utils.byteArrayToUtf8(this.value):"",this.type=Dish.STRING;break;case Dish.NUMBER:this.value=this.value?parseFloat(Utils.byteArrayToUtf8(this.value)):0,this.type=Dish.NUMBER}},Dish.prototype.valid=function(){switch(this.type){case Dish.BYTE_ARRAY:if(!(this.value instanceof Array))return!1;for(var a=0;a255)return!1;return!0;case Dish.STRING:case Dish.HTML:return"string"==typeof this.value;case Dish.NUMBER:return"number"==typeof this.value;default:return!1}};var FlowControl={FORK_DELIM:"\\n",MERGE_DELIM:"\\n",FORK_IGNORE_ERRORS:!1,runFork:function(a){var b=a.opList,c=b[a.progress].inputType,d=b[a.progress].outputType,e=a.dish.get(c),f=b[a.progress].getIngValues(),g=f[0],h=f[1],i=f[2],j=[],k=[];e&&(k=e.split(g));for(var l=a.progress+1;l=d?(a.progress++,a):(a.progress+=c,a.numJumps++,a)},runCondJump:function(a){var b=a.opList[a.progress].getIngValues(),c=a.dish,d=b[0],e=b[1],f=b[2];return a.numJumps>=f?(a.progress++,a):(""!==d&&c.get(Dish.STRING).search(d)>-1&&(a.progress+=e,a.numJumps++),a)},runReturn:function(a){return a.progress=a.opList.length,a}},Ingredient=function(a){this.name="",this.type="",this.value=null,a&&this._parseConfig(a)};Ingredient.prototype._parseConfig=function(a){this.name=a.name,this.type=a.type},Ingredient.prototype.getConfig=function(){return this.value},Ingredient.prototype.setValue=function(a){this.value=Ingredient.prepare(a,this.type)},Ingredient.prepare=function(a,b){switch(b){case"binaryString":case"binaryShortString":case"editableOption":return Utils.parseEscapedChars(a);case"byteArray":return"string"==typeof a?(a=a.replace(/\s+/g,""),Utils.hexToByteArray(a)):a;case"number":var c=parseFloat(a);if(isNaN(c)){var d=Utils.truncate(a.toString(),10);throw"Invalid ingredient value. Not a number: "+d}return c;default:return a}};var Operation=function(a,b){this.name=a,this.description="",this.inputType=-1,this.outputType=-1,this.run=null,this.highlight=null,this.highlightReverse=null,this.breakpoint=!1,this.disabled=!1,this.ingList=[],b&&this._parseConfig(b)};Operation.prototype._parseConfig=function(a){this.description=a.description,this.inputType=Dish.typeEnum(a.inputType),this.outputType=Dish.typeEnum(a.outputType),this.run=a.run,this.highlight=a.highlight,this.highlightReverse=a.highlightReverse,this.flowControl=a.flowControl;for(var b=0;b
                  Message: "+(i.displayStr||i.message):i.displayStr=c.name+" - "+(i.displayStr||i.message),i}}return this.opList.length},Recipe.prototype.toString=function(){return JSON.stringify(this.getConfig())},Recipe.prototype.fromString=function(a){var b=JSON.parse(a);this._parseConfig(b)};var Categories=[{name:"Favourites",ops:[]},{name:"Data format",ops:["To Hexdump","From Hexdump","To Hex","From Hex","To Charcode","From Charcode","To Decimal","From Decimal","To Binary","From Binary","To Base64","From Base64","Show Base64 offsets","To Base32","From Base32","To Base","From Base","To HTML Entity","From HTML Entity","URL Encode","URL Decode","Unescape Unicode Characters","To Quoted Printable","From Quoted Printable","To Punycode","From Punycode","To Hex Content","From Hex Content","PEM to Hex","Hex to PEM","Parse ASN.1 hex string","Change IP format","Text encoding","Swap endianness"]},{name:"Encryption / Encoding",ops:["AES Encrypt","AES Decrypt","Blowfish Encrypt","Blowfish Decrypt","DES Encrypt","DES Decrypt","Triple DES Encrypt","Triple DES Decrypt","Rabbit Encrypt","Rabbit Decrypt","RC4","RC4 Drop","ROT13","ROT47","XOR","XOR Brute Force","Vigen\xe8re Encode","Vigen\xe8re Decode","To Morse Code","From Morse Code","Substitute","Derive PBKDF2 key","Derive EVP key"]},{name:"Public Key",ops:["Parse X.509 certificate","Parse ASN.1 hex string","PEM to Hex","Hex to PEM","Hex to Object Identifier","Object Identifier to Hex"]},{name:"Logical operations",ops:["XOR","XOR Brute Force","OR","NOT","AND","ADD","SUB","Rotate left","Rotate right","ROT13"]},{name:"Networking",ops:["Strip HTTP headers","Parse User Agent","Parse IP range","Parse IPv6 address","Parse URI","URL Encode","URL Decode","Format MAC addresses","Change IP format","Group IP addresses"]},{name:"Language",ops:["Text encoding","Unescape Unicode Characters"]},{name:"Utils",ops:["Diff","Remove whitespace","Remove null bytes","To Upper case","To Lower case","Add line numbers","Remove line numbers","Reverse","Sort","Unique","Split","Filter","Count occurrences","Expand alphabet range","Parse escaped string","Drop bytes","Take bytes","Pad lines","Find / Replace","Regular expression","Offset checker","Convert distance","Convert area","Convert mass","Convert speed","Convert data units","Parse UNIX file permissions","Swap endianness","Parse colour code"]},{name:"Date / Time",ops:["Parse DateTime","Translate DateTime Format","From UNIX Timestamp","To UNIX Timestamp","Extract dates"]},{name:"Extractors",ops:["Strings","Extract IP addresses","Extract email addresses","Extract MAC addresses","Extract URLs","Extract domains","Extract file paths","Extract dates","Regular expression","XPath expression","CSS selector"]},{name:"Compression",ops:["Raw Deflate","Raw Inflate","Zlib Deflate","Zlib Inflate","Gzip","Gunzip","Zip","Unzip","Bzip2 Decompress"]},{name:"Hashing",ops:["Analyse hash","Generate all hashes","MD2","MD4","MD5","SHA0","SHA1","SHA224","SHA256","SHA384","SHA512","SHA3","RIPEMD-160","HMAC","Fletcher-8 Checksum","Fletcher-16 Checksum","Fletcher-32 Checksum","Fletcher-64 Checksum","Adler-32 Checksum","CRC-32 Checksum","TCP/IP Checksum"]},{name:"Code tidy",ops:["Syntax highlighter","Generic Code Beautify","JavaScript Parser","JavaScript Beautify","JavaScript Minify","JSON Beautify","JSON Minify","XML Beautify","XML Minify","SQL Beautify","SQL Minify","CSS Beautify","CSS Minify","XPath expression","CSS selector","Strip HTML tags","Diff"]},{name:"Other",ops:["Entropy","Frequency distribution","Detect File Type","Scan for Embedded Files","Generate UUID","Numberwang"]},{name:"Flow control",ops:["Fork","Merge","Jump","Conditional Jump","Return"]}],OperationConfig={Fork:{description:"Split the input data up based on the specified delimiter and run all subsequent operations on each branch separately.

                  For example, to decode multiple Base64 strings, enter them all on separate lines then add the 'Fork' and 'From Base64' operations to the recipe. Each string will be decoded separately.",run:FlowControl.runFork,inputType:"string",outputType:"string",flowControl:!0,args:[{name:"Split delimiter",type:"binaryShortString",value:FlowControl.FORK_DELIM},{name:"Merge delimiter",type:"binaryShortString",value:FlowControl.MERGE_DELIM},{name:"Ignore errors",type:"boolean",value:FlowControl.FORK_IGNORE_ERRORS}]},Merge:{description:"Consolidate all branches back into a single trunk. The opposite of Fork.",run:FlowControl.runMerge,inputType:"string",outputType:"string",flowControl:!0,args:[]},Jump:{description:"Jump forwards or backwards over the specified number of operations.",run:FlowControl.runJump,inputType:"string",outputType:"string",flowControl:!0,args:[{name:"Number of operations to jump over",type:"number",value:FlowControl.JUMP_NUM},{name:"Maximum jumps (if jumping backwards)",type:"number",value:FlowControl.MAX_JUMPS}]},"Conditional Jump":{description:"Conditionally jump forwards or backwards over the specified number of operations based on whether the data matches the specified regular expression.",run:FlowControl.runCondJump,inputType:"string",outputType:"string",flowControl:!0,args:[{name:"Match (regex)",type:"string",value:""},{name:"Number of operations to jump over if match found",type:"number",value:FlowControl.JUMP_NUM},{name:"Maximum jumps (if jumping backwards)",type:"number",value:FlowControl.MAX_JUMPS}]},Return:{description:"End execution of operations at this point in the recipe.",run:FlowControl.runReturn,inputType:"string",outputType:"string",flowControl:!0,args:[]},"From Base64":{description:"Base64 is a notation for encoding arbitrary byte data using a restricted set of symbols that can be conveniently used by humans and processed by computers.

                  This operation decodes data from an ASCII Base64 string back into its raw format.

                  e.g. aGVsbG8= becomes hello",run:Base64.runFrom,highlight:Base64.highlightFrom,highlightReverse:Base64.highlightTo,inputType:"string",outputType:"byteArray",args:[{name:"Alphabet",type:"editableOption",value:Base64.ALPHABET_OPTIONS},{name:"Remove non‑alphabet chars",type:"boolean",value:Base64.REMOVE_NON_ALPH_CHARS}]},"To Base64":{description:"Base64 is a notation for encoding arbitrary byte data using a restricted set of symbols that can be conveniently used by humans and processed by computers.

                  This operation encodes data in an ASCII Base64 string.

                  e.g. hello becomes aGVsbG8=",run:Base64.runTo,highlight:Base64.highlightTo,highlightReverse:Base64.highlightFrom,inputType:"byteArray",outputType:"string",args:[{name:"Alphabet",type:"editableOption",value:Base64.ALPHABET_OPTIONS}]},"From Base32":{description:"Base32 is a notation for encoding arbitrary byte data using a restricted set of symbols that can be conveniently used by humans and processed by computers. It uses a smaller set of characters than Base64, usually the uppercase alphabet and the numbers 2 to 7.",run:Base64.runFrom32,inputType:"string",outputType:"byteArray",args:[{name:"Alphabet",type:"binaryString",value:Base64.BASE32_ALPHABET},{name:"Remove non‑alphabet chars",type:"boolean",value:Base64.REMOVE_NON_ALPH_CHARS}]},"To Base32":{description:"Base32 is a notation for encoding arbitrary byte data using a restricted set of symbols that can be conveniently used by humans and processed by computers. It uses a smaller set of characters than Base64, usually the uppercase alphabet and the numbers 2 to 7.",run:Base64.runTo32,inputType:"byteArray",outputType:"string",args:[{name:"Alphabet",type:"binaryString",value:Base64.BASE32_ALPHABET}]},"Show Base64 offsets":{description:"When a string is within a block of data and the whole block is Base64'd, the string itself could be represented in Base64 in three distinct ways depending on its offset within the block.

                  This operation shows all possible offsets for a given string so that each possible encoding can be considered.",run:Base64.runOffsets,inputType:"byteArray",outputType:"html",args:[{name:"Alphabet",type:"binaryString",value:Base64.ALPHABET},{name:"Show variable chars and padding",type:"boolean",value:Base64.OFFSETS_SHOW_VARIABLE}]},XOR:{description:"XOR the input with the given key.
                  e.g. fe023da5

                  Options
                  Null preserving: If the current byte is 0x00 or the same as the key, skip it.

                  Scheme:
                  • Standard - key is unchanged after each round
                  • Input differential - key is set to the value of the previous unprocessed byte
                  • Output differential - key is set to the value of the previous processed byte
                  ",run:BitwiseOp.runXor,highlight:!0,highlightReverse:!0,inputType:"byteArray",outputType:"byteArray",args:[{name:"Key",type:"toggleString",value:"",toggleValues:BitwiseOp.KEY_FORMAT},{name:"Scheme",type:"option",value:BitwiseOp.XOR_SCHEME},{name:"Null preserving",type:"boolean",value:BitwiseOp.XOR_PRESERVE_NULLS}]},"XOR Brute Force":{description:"Enumerate all possible XOR solutions. Current maximum key length is 2 due to browser performance.

                  Optionally enter a regex string that you expect to find in the plaintext to filter results (crib).",run:BitwiseOp.runXorBrute,inputType:"byteArray",outputType:"string",args:[{name:"Key length",type:"option",value:BitwiseOp.XOR_BRUTE_KEY_LENGTH},{name:"Length of sample",type:"number",value:BitwiseOp.XOR_BRUTE_SAMPLE_LENGTH},{name:"Offset of sample",type:"number",value:BitwiseOp.XOR_BRUTE_SAMPLE_OFFSET},{name:"Null preserving",type:"boolean",value:BitwiseOp.XOR_PRESERVE_NULLS},{name:"Differential",type:"boolean",value:BitwiseOp.XOR_DIFFERENTIAL},{name:"Crib (known plaintext string)",type:"binaryString",value:""},{name:"Print key",type:"boolean",value:BitwiseOp.XOR_BRUTE_PRINT_KEY},{name:"Output as hex",type:"boolean",value:BitwiseOp.XOR_BRUTE_OUTPUT_HEX}]},NOT:{description:"Returns the inverse of each byte.",run:BitwiseOp.runNot,highlight:!0,highlightReverse:!0,inputType:"byteArray",outputType:"byteArray",args:[]},AND:{description:"AND the input with the given key.
                  e.g. fe023da5",run:BitwiseOp.runAnd,highlight:!0,highlightReverse:!0,inputType:"byteArray",outputType:"byteArray",args:[{name:"Key",type:"toggleString",value:"",toggleValues:BitwiseOp.KEY_FORMAT}]},OR:{description:"OR the input with the given key.
                  e.g. fe023da5",run:BitwiseOp.runOr,highlight:!0,highlightReverse:!0,inputType:"byteArray",outputType:"byteArray",args:[{name:"Key",type:"toggleString",value:"",toggleValues:BitwiseOp.KEY_FORMAT}]},ADD:{description:"ADD the input with the given key (e.g. fe023da5), MOD 255",run:BitwiseOp.runAdd,highlight:!0,highlightReverse:!0,inputType:"byteArray",outputType:"byteArray",args:[{name:"Key",type:"toggleString",value:"",toggleValues:BitwiseOp.KEY_FORMAT}]},SUB:{description:"SUB the input with the given key (e.g. fe023da5), MOD 255",run:BitwiseOp.runSub,highlight:!0,highlightReverse:!0,inputType:"byteArray",outputType:"byteArray",args:[{name:"Key",type:"toggleString",value:"",toggleValues:BitwiseOp.KEY_FORMAT}]},"From Hex":{description:"Converts a hexadecimal byte string back into a its raw value.

                  e.g. ce 93 ce b5 ce b9 ce ac 20 cf 83 ce bf cf 85 0a becomes the UTF-8 encoded string \u0393\u03b5\u03b9\u03ac \u03c3\u03bf\u03c5",run:ByteRepr.runFromHex,highlight:ByteRepr.highlightFrom,highlightReverse:ByteRepr.highlightTo,inputType:"string",outputType:"byteArray",args:[{name:"Delimiter",type:"option",value:ByteRepr.HEX_DELIM_OPTIONS}]},"To Hex":{description:"Converts the input string to hexadecimal bytes separated by the specified delimiter.

                  e.g. The UTF-8 encoded string \u0393\u03b5\u03b9\u03ac \u03c3\u03bf\u03c5 becomes ce 93 ce b5 ce b9 ce ac 20 cf 83 ce bf cf 85 0a",run:ByteRepr.runToHex,highlight:ByteRepr.highlightTo,highlightReverse:ByteRepr.highlightFrom,inputType:"byteArray",outputType:"string",args:[{name:"Delimiter",type:"option",value:ByteRepr.HEX_DELIM_OPTIONS}]},"From Charcode":{description:"Converts unicode character codes back into text.

                  e.g. 0393 03b5 03b9 03ac 20 03c3 03bf 03c5 becomes \u0393\u03b5\u03b9\u03ac \u03c3\u03bf\u03c5",run:ByteRepr.runFromCharcode,highlight:ByteRepr.highlightFrom,highlightReverse:ByteRepr.highlightTo,inputType:"string",outputType:"byteArray",args:[{name:"Delimiter",type:"option",value:ByteRepr.DELIM_OPTIONS},{name:"Base",type:"number",value:ByteRepr.CHARCODE_BASE}]},"To Charcode":{description:"Converts text to its unicode character code equivalent.

                  e.g. \u0393\u03b5\u03b9\u03ac \u03c3\u03bf\u03c5 becomes 0393 03b5 03b9 03ac 20 03c3 03bf 03c5",run:ByteRepr.runToCharcode,highlight:ByteRepr.highlightTo,highlightReverse:ByteRepr.highlightFrom,inputType:"string",outputType:"string",args:[{name:"Delimiter",type:"option",value:ByteRepr.DELIM_OPTIONS},{name:"Base",type:"number",value:ByteRepr.CHARCODE_BASE}]},"From Binary":{description:"Converts a binary string back into its raw form.

                  e.g. 01001000 01101001 becomes Hi",run:ByteRepr.runFromBinary,highlight:ByteRepr.highlightFromBinary,highlightReverse:ByteRepr.highlightToBinary,inputType:"string",outputType:"byteArray",args:[{name:"Delimiter",type:"option",value:ByteRepr.BIN_DELIM_OPTIONS}]},"To Binary":{description:"Displays the input data as a binary string.

                  e.g. Hi becomes 01001000 01101001",run:ByteRepr.runToBinary,highlight:ByteRepr.highlightToBinary,highlightReverse:ByteRepr.highlightFromBinary,inputType:"byteArray",outputType:"string",args:[{name:"Delimiter",type:"option",value:ByteRepr.BIN_DELIM_OPTIONS}]},"From Decimal":{description:"Converts the data from an ordinal integer array back into its raw form.

                  e.g. 72 101 108 108 111 becomes Hello",run:ByteRepr.runFromDecimal,inputType:"string",outputType:"byteArray",args:[{name:"Delimiter",type:"option",value:ByteRepr.DELIM_OPTIONS}]},"To Decimal":{description:"Converts the input data to an ordinal integer array.

                  e.g. Hello becomes 72 101 108 108 111",run:ByteRepr.runToDecimal,inputType:"byteArray",outputType:"string",args:[{name:"Delimiter",type:"option",value:ByteRepr.DELIM_OPTIONS}]},"From Hexdump":{description:"Attempts to convert a hexdump back into raw data. This operation supports many different hexdump variations, but probably not all. Make sure you verify that the data it gives you is correct before continuing analysis.",run:Hexdump.runFrom,highlight:Hexdump.highlightFrom,highlightReverse:Hexdump.highlightTo,inputType:"string",outputType:"byteArray",args:[]},"To Hexdump":{description:"Creates a hexdump of the input data, displaying both the hexademinal values of each byte and an ASCII representation alongside.",run:Hexdump.runTo,highlight:Hexdump.highlightTo,highlightReverse:Hexdump.highlightFrom,inputType:"byteArray",outputType:"string",args:[{name:"Width",type:"number",value:Hexdump.WIDTH},{name:"Upper case hex",type:"boolean",value:Hexdump.UPPER_CASE},{name:"Include final length",type:"boolean",value:Hexdump.INCLUDE_FINAL_LENGTH}]},"From Base":{description:"Converts a number to decimal from a given numerical base.",run:Base.runFrom,inputType:"string",outputType:"number",args:[{name:"Radix",type:"number",value:Base.DEFAULT_RADIX}]},"To Base":{description:"Converts a decimal number to a given numerical base.",run:Base.runTo,inputType:"number",outputType:"string",args:[{name:"Radix",type:"number",value:Base.DEFAULT_RADIX}]},"From HTML Entity":{description:"Converts HTML entities back to characters

                  e.g. &amp; becomes &",run:HTML.runFromEntity,inputType:"string",outputType:"string",args:[]},"To HTML Entity":{description:"Converts characters to HTML entities

                  e.g. & becomes &amp;",run:HTML.runToEntity,inputType:"string",outputType:"string",args:[{name:"Convert all characters",type:"boolean",value:HTML.CONVERT_ALL},{name:"Convert to",type:"option",value:HTML.CONVERT_OPTIONS}]},"Strip HTML tags":{description:"Removes all HTML tags from the input.",run:HTML.runStripTags,inputType:"string",outputType:"string",args:[{name:"Remove indentation",type:"boolean",value:HTML.REMOVE_INDENTATION},{name:"Remove excess line breaks",type:"boolean",value:HTML.REMOVE_LINE_BREAKS}]},"URL Decode":{description:"Converts URI/URL percent-encoded characters back to their raw values.

                  e.g. %3d becomes =",run:URL_.runFrom,inputType:"string",outputType:"string",args:[]},"URL Encode":{description:"Encodes problematic characters into percent-encoding, a format supported by URIs/URLs.

                  e.g. = becomes %3d",run:URL_.runTo,inputType:"string",outputType:"string",args:[{name:"Encode all special chars",type:"boolean",value:URL_.ENCODE_ALL}]},"Parse URI":{description:"Pretty prints complicated Uniform Resource Identifier (URI) strings for ease of reading. Particularly useful for Uniform Resource Locators (URLs) with a lot of arguments.",run:URL_.runParse,inputType:"string",outputType:"string",args:[]},"Unescape Unicode Characters":{description:"Converts unicode-escaped character notation back into raw characters.

                  Supports the prefixes:
                  • \\u
                  • %u
                  • U+
                  e.g. \\u03c3\\u03bf\\u03c5 becomes \u03c3\u03bf\u03c5",run:Unicode.runUnescape,inputType:"string",outputType:"string",args:[{name:"Prefix",type:"option",value:Unicode.PREFIXES}]},"From Quoted Printable":{description:"Converts QP-encoded text back to standard text.",run:QuotedPrintable.runFrom,inputType:"string",outputType:"byteArray",args:[]},"To Quoted Printable":{description:"Quoted-Printable, or QP encoding, is an encoding using printable ASCII characters (alphanumeric and the equals sign '=') to transmit 8-bit data over a 7-bit data path or, generally, over a medium which is not 8-bit clean. It is defined as a MIME content transfer encoding for use in e-mail.

                  QP works by using the equals sign '=' as an escape character. It also limits line length to 76, as some software has limits on line length.",run:QuotedPrintable.runTo,inputType:"byteArray",outputType:"string",args:[]},"From Punycode":{description:"Punycode is a way to represent Unicode with the limited character subset of ASCII supported by the Domain Name System.

                  e.g. mnchen-3ya decodes to m\xfcnchen",run:Punycode.runToUnicode,inputType:"string",outputType:"string",args:[{name:"Internationalised domain name",type:"boolean",value:Punycode.IDN}]},"To Punycode":{description:"Punycode is a way to represent Unicode with the limited character subset of ASCII supported by the Domain Name System.

                  e.g. m\xfcnchen encodes to mnchen-3ya",run:Punycode.runToAscii,inputType:"string",outputType:"string",args:[{name:"Internationalised domain name",type:"boolean",value:Punycode.IDN}]},"From Hex Content":{description:"Translates hexadecimal bytes in text back to raw bytes.

                  e.g. foo|3d|bar becomes foo=bar.",run:ByteRepr.runFromHexContent,inputType:"string",outputType:"byteArray",args:[]},"To Hex Content":{description:"Converts special characters in a string to hexadecimal.

                  e.g. foo=bar becomes foo|3d|bar.",run:ByteRepr.runToHexContent,inputType:"byteArray",outputType:"string",args:[{name:"Convert",type:"option",value:ByteRepr.HEX_CONTENT_CONVERT_WHICH},{name:"Print spaces between bytes",type:"boolean",value:ByteRepr.HEX_CONTENT_SPACES_BETWEEN_BYTES}]},"Change IP format":{description:"Convert an IP address from one format to another, e.g. 172.20.23.54 to ac141736",run:IP.runChangeIpFormat,inputType:"string",outputType:"string",args:[{name:"Input format",type:"option",value:IP.IP_FORMAT_LIST},{name:"Output format",type:"option",value:IP.IP_FORMAT_LIST}]},"Parse IP range":{description:"Given a CIDR range (e.g. 10.0.0.0/24) or a hyphenated range (e.g. 10.0.0.0 - 10.0.1.0), this operation provides network information and enumerates all IP addresses in the range.

                  IPv6 is supported but will not be enumerated.",run:IP.runParseIpRange,inputType:"string",outputType:"string",args:[{name:"Include network info",type:"boolean",value:IP.INCLUDE_NETWORK_INFO},{name:"Enumerate IP addresses",type:"boolean",value:IP.ENUMERATE_ADDRESSES},{name:"Allow large queries",type:"boolean",value:IP.ALLOW_LARGE_LIST}]},"Group IP addresses":{description:"Groups a list of IP addresses into subnets. Supports both IPv4 and IPv6 addresses.",run:IP.runGroupIps,inputType:"string",outputType:"string",args:[{name:"Delimiter",type:"option",value:IP.DELIM_OPTIONS},{name:"Subnet (CIDR)",type:"number",value:IP.GROUP_CIDR},{name:"Only show the subnets",type:"boolean",value:IP.GROUP_ONLY_SUBNET}]},"Parse IPv6 address":{description:"Displays the longhand and shorthand versions of a valid IPv6 address.

                  Recognises all reserved ranges and parses encapsulated or tunnelled addresses including Teredo and 6to4.",run:IP.runParseIpv6,inputType:"string",outputType:"string",args:[]},"Text encoding":{description:"Translates the data between different character encodings.

                  Supported charsets are:
                  • UTF8
                  • UTF16
                  • UTF16LE (little-endian)
                  • UTF16BE (big-endian)
                  • Hex
                  • Base64
                  • Latin1 (ISO-8859-1)
                  • Windows-1251
                  ",run:CharEnc.run,inputType:"string",outputType:"string",args:[{name:"Input type",type:"option",value:CharEnc.IO_FORMAT},{name:"Output type",type:"option",value:CharEnc.IO_FORMAT}]},"AES Decrypt":{description:"To successfully decrypt AES, you need either:
                  • The passphrase
                  • Or the key and IV
                  The IV should be the first 16 bytes of encrypted material.",run:Cipher.runAesDec,inputType:"string",outputType:"string",args:[{name:"Passphrase/Key",type:"toggleString",value:"",toggleValues:Cipher.IO_FORMAT2},{name:"IV",type:"toggleString",value:"",toggleValues:Cipher.IO_FORMAT1},{name:"Salt",type:"toggleString",value:"",toggleValues:Cipher.IO_FORMAT1},{name:"Mode",type:"option",value:Cipher.MODES},{name:"Padding",type:"option",value:Cipher.PADDING},{name:"Input format",type:"option",value:Cipher.IO_FORMAT1},{name:"Output format",type:"option",value:Cipher.IO_FORMAT2}]},"AES Encrypt":{description:"Input: Either enter a passphrase (which will be used to derive a key using the OpenSSL KDF) or both the key and IV.

                  Advanced Encryption Standard (AES) is a U.S. Federal Information Processing Standard (FIPS). It was selected after a 5-year process where 15 competing designs were evaluated.

                  AES-128, AES-192, and AES-256 are supported. The variant will be chosen based on the size of the key passed in. If a passphrase is used, a 256-bit key will be generated.",run:Cipher.runAesEnc,inputType:"string",outputType:"string",args:[{name:"Passphrase/Key",type:"toggleString",value:"",toggleValues:Cipher.IO_FORMAT2},{name:"IV",type:"toggleString",value:"",toggleValues:Cipher.IO_FORMAT1},{name:"Salt",type:"toggleString",value:"",toggleValues:Cipher.IO_FORMAT1},{name:"Mode",type:"option",value:Cipher.MODES},{name:"Padding",type:"option",value:Cipher.PADDING},{name:"Output result",type:"option",value:Cipher.RESULT_TYPE},{name:"Output format",type:"option",value:Cipher.IO_FORMAT1}]},"DES Decrypt":{description:"To successfully decrypt DES, you need either:
                  • The passphrase
                  • Or the key and IV
                  The IV should be the first 8 bytes of encrypted material.",run:Cipher.runDesDec,inputType:"string",outputType:"string",args:[{name:"Passphrase/Key",type:"toggleString",value:"",toggleValues:Cipher.IO_FORMAT2},{name:"IV",type:"toggleString",value:"",toggleValues:Cipher.IO_FORMAT1},{name:"Salt",type:"toggleString",value:"",toggleValues:Cipher.IO_FORMAT1},{name:"Mode",type:"option",value:Cipher.MODES},{name:"Padding",type:"option",value:Cipher.PADDING},{name:"Input format",type:"option",value:Cipher.IO_FORMAT1},{name:"Output format",type:"option",value:Cipher.IO_FORMAT2}]},"DES Encrypt":{description:"Input: Either enter a passphrase (which will be used to derive a key using the OpenSSL KDF) or both the key and IV.

                  DES is a previously dominant algorithm for encryption, and was published as an official U.S. Federal Information Processing Standard (FIPS). It is now considered to be insecure due to its small key size.",run:Cipher.runDesEnc,inputType:"string",outputType:"string",args:[{name:"Passphrase/Key",type:"toggleString",value:"",toggleValues:Cipher.IO_FORMAT2},{name:"IV",type:"toggleString",value:"",toggleValues:Cipher.IO_FORMAT1},{name:"Salt",type:"toggleString",value:"",toggleValues:Cipher.IO_FORMAT1},{name:"Mode",type:"option",value:Cipher.MODES},{name:"Padding",type:"option",value:Cipher.PADDING},{name:"Output result",type:"option",value:Cipher.RESULT_TYPE},{name:"Output format",type:"option",value:Cipher.IO_FORMAT1}]},"Triple DES Decrypt":{description:"To successfully decrypt Triple DES, you need either:
                  • The passphrase
                  • Or the key and IV
                  The IV should be the first 8 bytes of encrypted material.",run:Cipher.runTripleDesDec,inputType:"string",outputType:"string",args:[{name:"Passphrase/Key",type:"toggleString",value:"",toggleValues:Cipher.IO_FORMAT2},{name:"IV",type:"toggleString",value:"",toggleValues:Cipher.IO_FORMAT1},{name:"Salt",type:"toggleString",value:"",toggleValues:Cipher.IO_FORMAT1},{name:"Mode",type:"option",value:Cipher.MODES},{name:"Padding",type:"option",value:Cipher.PADDING},{name:"Input format",type:"option",value:Cipher.IO_FORMAT1},{name:"Output format",type:"option",value:Cipher.IO_FORMAT2}]},"Triple DES Encrypt":{description:"Input: Either enter a passphrase (which will be used to derive a key using the OpenSSL KDF) or both the key and IV.

                  Triple DES applies DES three times to each block to increase key size.",run:Cipher.runTripleDesEnc,inputType:"string",outputType:"string",args:[{name:"Passphrase/Key",type:"toggleString",value:"",toggleValues:Cipher.IO_FORMAT2},{name:"IV",type:"toggleString",value:"",toggleValues:Cipher.IO_FORMAT1},{name:"Salt",type:"toggleString",value:"",toggleValues:Cipher.IO_FORMAT1},{name:"Mode",type:"option",value:Cipher.MODES},{name:"Padding",type:"option",value:Cipher.PADDING},{name:"Output result",type:"option",value:Cipher.RESULT_TYPE},{name:"Output format",type:"option",value:Cipher.IO_FORMAT1}]},"Blowfish Decrypt":{description:"Blowfish is a symmetric-key block cipher designed in 1993 by Bruce Schneier and included in a large number of cipher suites and encryption products. AES now receives more attention.",run:Cipher.runBlowfishDec,inputType:"string",outputType:"string",args:[{name:"Key",type:"toggleString",value:"",toggleValues:Cipher.IO_FORMAT2},{name:"Mode",type:"option",value:Cipher.BLOWFISH_MODES},{name:"Input format",type:"option",value:Cipher.IO_FORMAT3}]},"Blowfish Encrypt":{description:"Blowfish is a symmetric-key block cipher designed in 1993 by Bruce Schneier and included in a large number of cipher suites and encryption products. AES now receives more attention.",run:Cipher.runBlowfishEnc,inputType:"string",outputType:"string",args:[{name:"Key",type:"toggleString",value:"",toggleValues:Cipher.IO_FORMAT2},{name:"Mode",type:"option",value:Cipher.BLOWFISH_MODES},{name:"Output format",type:"option",value:Cipher.IO_FORMAT3}]},"Rabbit Decrypt":{description:"To successfully decrypt Rabbit, you need either:
                  • The passphrase
                  • Or the key and IV (This is currently broken. You need the key and salt at the moment.)
                  The IV should be the first 8 bytes of encrypted material.",run:Cipher.runRabbitDec,inputType:"string",outputType:"string",args:[{name:"Passphrase/Key",type:"toggleString",value:"",toggleValues:Cipher.IO_FORMAT2},{name:"IV",type:"toggleString",value:"",toggleValues:Cipher.IO_FORMAT1},{name:"Salt",type:"toggleString",value:"",toggleValues:Cipher.IO_FORMAT1},{name:"Mode",type:"option",value:Cipher.MODES},{name:"Padding",type:"option",value:Cipher.PADDING},{name:"Input format",type:"option",value:Cipher.IO_FORMAT1},{name:"Output format",type:"option",value:Cipher.IO_FORMAT2}]},"Rabbit Encrypt":{description:"Input: Either enter a passphrase (which will be used to derive a key using the OpenSSL KDF) or both the key and IV.

                  Rabbit is a high-performance stream cipher and a finalist in the eSTREAM Portfolio. It is one of the four designs selected after a 3 1/2 year process where 22 designs were evaluated.",run:Cipher.runRabbitEnc,inputType:"string",outputType:"string",args:[{name:"Passphrase/Key",type:"toggleString",value:"",toggleValues:Cipher.IO_FORMAT2},{name:"IV",type:"toggleString",value:"",toggleValues:Cipher.IO_FORMAT1},{name:"Salt",type:"toggleString",value:"",toggleValues:Cipher.IO_FORMAT1},{name:"Mode",type:"option",value:Cipher.MODES},{name:"Padding",type:"option",value:Cipher.PADDING},{name:"Output result",type:"option",value:Cipher.RESULT_TYPE},{name:"Output format",type:"option",value:Cipher.IO_FORMAT1}]},RC4:{description:"RC4 is a widely-used stream cipher. It is used in popular protocols such as SSL and WEP. Although remarkable for its simplicity and speed, the algorithm's history doesn't inspire confidence in its security.",run:Cipher.runRc4,highlight:!0,highlightReverse:!0,inputType:"string",outputType:"string",args:[{name:"Passphrase",type:"toggleString",value:"",toggleValues:Cipher.IO_FORMAT2},{name:"Input format",type:"option",value:Cipher.IO_FORMAT4},{name:"Output format",type:"option",value:Cipher.IO_FORMAT4}]},"RC4 Drop":{description:"It was discovered that the first few bytes of the RC4 keystream are strongly non-random and leak information about the key. We can defend against this attack by discarding the initial portion of the keystream. This modified algorithm is traditionally called RC4-drop.",run:Cipher.runRc4drop,highlight:!0,highlightReverse:!0,inputType:"string",outputType:"string",args:[{name:"Passphrase",type:"toggleString",value:"",toggleValues:Cipher.IO_FORMAT2},{name:"Input format",type:"option",value:Cipher.IO_FORMAT4},{name:"Output format",type:"option",value:Cipher.IO_FORMAT4},{name:"Number of bytes to drop",type:"number",value:Cipher.RC4DROP_BYTES}]},"Derive PBKDF2 key":{description:"PBKDF2 is a password-based key derivation function. In many applications of cryptography, user security is ultimately dependent on a password, and because a password usually can't be used directly as a cryptographic key, some processing is required.

                  A salt provides a large set of keys for any given password, and an iteration count increases the cost of producing keys from a password, thereby also increasing the difficulty of attack.

                  Enter your passphrase as the input and then set the relevant options to generate a key.",run:Cipher.runPbkdf2,inputType:"string",outputType:"string",args:[{name:"Key size",type:"number",value:Cipher.KDF_KEY_SIZE},{name:"Iterations",type:"number",value:Cipher.KDF_ITERATIONS},{name:"Salt (hex)",type:"string",value:""},{name:"Input format",type:"option",value:Cipher.IO_FORMAT2},{name:"Output format",type:"option",value:Cipher.IO_FORMAT3}]},"Derive EVP key":{description:"EVP is a password-based key derivation function used extensively in OpenSSL. In many applications of cryptography, user security is ultimately dependent on a password, and because a password usually can't be used directly as a cryptographic key, some processing is required.

                  A salt provides a large set of keys for any given password, and an iteration count increases the cost of producing keys from a password, thereby also increasing the difficulty of attack.

                  Enter your passphrase as the input and then set the relevant options to generate a key.", run:Cipher.runEvpkdf,inputType:"string",outputType:"string",args:[{name:"Key size",type:"number",value:Cipher.KDF_KEY_SIZE},{name:"Iterations",type:"number",value:Cipher.KDF_ITERATIONS},{name:"Salt (hex)",type:"string",value:""},{name:"Input format",type:"option",value:Cipher.IO_FORMAT2},{name:"Output format",type:"option",value:Cipher.IO_FORMAT3}]},"Vigen\xe8re Encode":{description:"The Vigenere cipher is a method of encrypting alphabetic text by using a series of different Caesar ciphers based on the letters of a keyword. It is a simple form of polyalphabetic substitution.",run:Cipher.runVigenereEnc,highlight:!0,highlightReverse:!0,inputType:"string",outputType:"string",args:[{name:"Key",type:"string",value:""}]},"Vigen\xe8re Decode":{description:"The Vigenere cipher is a method of encrypting alphabetic text by using a series of different Caesar ciphers based on the letters of a keyword. It is a simple form of polyalphabetic substitution.",run:Cipher.runVigenereDec,highlight:!0,highlightReverse:!0,inputType:"string",outputType:"string",args:[{name:"Key",type:"string",value:""}]},"Rotate right":{description:"Rotates each byte to the right by the number of bits specified. Currently only supports 8-bit values.",run:Rotate.runRotr,highlight:!0,highlightReverse:!0,inputType:"byteArray",outputType:"byteArray",args:[{name:"Number of bits",type:"number",value:Rotate.ROTATE_AMOUNT},{name:"Rotate as a whole",type:"boolean",value:Rotate.ROTATE_WHOLE}]},"Rotate left":{description:"Rotates each byte to the left by the number of bits specified. Currently only supports 8-bit values.",run:Rotate.runRotl,highlight:!0,highlightReverse:!0,inputType:"byteArray",outputType:"byteArray",args:[{name:"Number of bits",type:"number",value:Rotate.ROTATE_AMOUNT},{name:"Rotate as a whole",type:"boolean",value:Rotate.ROTATE_WHOLE}]},ROT13:{description:"A simple caesar substitution cipher which rotates alphabet characters by the specified amount (default 13).",run:Rotate.runRot13,highlight:!0,highlightReverse:!0,inputType:"byteArray",outputType:"byteArray",args:[{name:"Rotate lower case chars",type:"boolean",value:Rotate.ROT13_LOWERCASE},{name:"Rotate upper case chars",type:"boolean",value:Rotate.ROT13_UPPERCASE},{name:"Amount",type:"number",value:Rotate.ROT13_AMOUNT}]},ROT47:{description:"A slightly more complex variation of a caesar cipher, which includes ASCII characters from 33 '!' to 126 '~'. Default rotation: 47.",run:Rotate.runRot47,highlight:!0,highlightReverse:!0,inputType:"byteArray",outputType:"byteArray",args:[{name:"Amount",type:"number",value:Rotate.ROT47_AMOUNT}]},"Strip HTTP headers":{description:"Removes HTTP headers from a request or response by looking for the first instance of a double newline.",run:HTTP.runStripHeaders,inputType:"string",outputType:"string",args:[]},"Parse User Agent":{description:"Attempts to identify and categorise information contained in a user-agent string.",run:HTTP.runParseUserAgent,inputType:"string",outputType:"string",args:[]},"Format MAC addresses":{description:"Displays given MAC addresses in multiple different formats.

                  Expects addresses in a list separated by newlines, spaces or commas.

                  WARNING: There are no validity checks.",run:MAC.runFormat,inputType:"string",outputType:"string",args:[{name:"Output case",type:"option",value:MAC.OUTPUT_CASE},{name:"No delimiter",type:"boolean",value:MAC.NO_DELIM},{name:"Dash delimiter",type:"boolean",value:MAC.DASH_DELIM},{name:"Colon delimiter",type:"boolean",value:MAC.COLON_DELIM},{name:"Cisco style",type:"boolean",value:MAC.CISCO_STYLE}]},"Offset checker":{description:"Compares multiple inputs (separated by the specified delimiter) and highlights matching characters which appear at the same position in all samples.",run:StrUtils.runOffsetChecker,inputType:"string",outputType:"html",args:[{name:"Sample delimiter",type:"binaryString",value:StrUtils.OFF_CHK_SAMPLE_DELIMITER}]},"Remove whitespace":{description:"Optionally removes all spaces, carriage returns, line feeds, tabs and form feeds from the input data.

                  This operation also supports the removal of full stops which are sometimes used to represent non-printable bytes in ASCII output.",run:Tidy.runRemoveWhitespace,inputType:"string",outputType:"string",args:[{name:"Spaces",type:"boolean",value:Tidy.REMOVE_SPACES},{name:"Carriage returns (\\r)",type:"boolean",value:Tidy.REMOVE_CARIAGE_RETURNS},{name:"Line feeds (\\n)",type:"boolean",value:Tidy.REMOVE_LINE_FEEDS},{name:"Tabs",type:"boolean",value:Tidy.REMOVE_TABS},{name:"Form feeds (\\f)",type:"boolean",value:Tidy.REMOVE_FORM_FEEDS},{name:"Full stops",type:"boolean",value:Tidy.REMOVE_FULL_STOPS}]},"Remove null bytes":{description:"Removes all null bytes (0x00) from the input.",run:Tidy.runRemoveNulls,inputType:"byteArray",outputType:"byteArray",args:[]},"Drop bytes":{description:"Cuts the specified number of bytes out of the data.",run:Tidy.runDropBytes,inputType:"byteArray",outputType:"byteArray",args:[{name:"Start",type:"number",value:Tidy.DROP_START},{name:"Length",type:"number",value:Tidy.DROP_LENGTH},{name:"Apply to each line",type:"boolean",value:Tidy.APPLY_TO_EACH_LINE}]},"Take bytes":{description:"Takes a slice of the specified number of bytes from the data.",run:Tidy.runTakeBytes,inputType:"byteArray",outputType:"byteArray",args:[{name:"Start",type:"number",value:Tidy.TAKE_START},{name:"Length",type:"number",value:Tidy.TAKE_LENGTH},{name:"Apply to each line",type:"boolean",value:Tidy.APPLY_TO_EACH_LINE}]},"Pad lines":{description:"Add the specified number of the specified character to the beginning or end of each line",run:Tidy.runPad,inputType:"string",outputType:"string",args:[{name:"Position",type:"option",value:Tidy.PAD_POSITION},{name:"Length",type:"number",value:Tidy.PAD_LENGTH},{name:"Character",type:"binaryShortString",value:Tidy.PAD_CHAR}]},Reverse:{description:"Reverses the input string.",run:SeqUtils.runReverse,inputType:"byteArray",outputType:"byteArray",args:[{name:"By",type:"option",value:SeqUtils.REVERSE_BY}]},Sort:{description:"Alphabetically sorts strings separated by the specified delimiter.

                  The IP address option supports IPv4 only.",run:SeqUtils.runSort,inputType:"string",outputType:"string",args:[{name:"Delimiter",type:"option",value:SeqUtils.DELIMITER_OPTIONS},{name:"Reverse",type:"boolean",value:SeqUtils.SORT_REVERSE},{name:"Order",type:"option",value:SeqUtils.SORT_ORDER}]},Unique:{description:"Removes duplicate strings from the input.",run:SeqUtils.runUnique,inputType:"string",outputType:"string",args:[{name:"Delimiter",type:"option",value:SeqUtils.DELIMITER_OPTIONS}]},"Count occurrences":{description:"Counts the number of times the provided string occurs in the input.",run:SeqUtils.runCount,inputType:"string",outputType:"number",args:[{name:"Search string",type:"toggleString",value:"",toggleValues:SeqUtils.SEARCH_TYPE}]},"Add line numbers":{description:"Adds line numbers to the output.",run:SeqUtils.runAddLineNumbers,inputType:"string",outputType:"string",args:[]},"Remove line numbers":{description:"Removes line numbers from the output if they can be trivially detected.",run:SeqUtils.runRemoveLineNumbers,inputType:"string",outputType:"string",args:[]},"Find / Replace":{description:"Replaces all occurrences of the first string with the second.

                  The three match options are only relevant to regex search strings.",run:StrUtils.runFindReplace,manualBake:!0,inputType:"string",outputType:"string",args:[{name:"Find",type:"toggleString",value:"",toggleValues:StrUtils.SEARCH_TYPE},{name:"Replace",type:"binaryString",value:""},{name:"Global match",type:"boolean",value:StrUtils.FIND_REPLACE_GLOBAL},{name:"Case insensitive",type:"boolean",value:StrUtils.FIND_REPLACE_CASE},{name:"Multiline matching",type:"boolean",value:StrUtils.FIND_REPLACE_MULTILINE}]},"To Upper case":{description:"Converts the input string to upper case, optionally limiting scope to only the first character in each word, sentence or paragraph.",run:StrUtils.runUpper,highlight:!0,highlightReverse:!0,inputType:"string",outputType:"string",args:[{name:"Scope",type:"option",value:StrUtils.CASE_SCOPE}]},"To Lower case":{description:"Converts every character in the input to lower case.",run:StrUtils.runLower,highlight:!0,highlightReverse:!0,inputType:"string",outputType:"string",args:[]},Split:{description:"Splits a string into sections around a given delimiter.",run:StrUtils.runSplit,inputType:"string",outputType:"string",args:[{name:"Split delimiter",type:"binaryShortString",value:StrUtils.SPLIT_DELIM},{name:"Join delimiter",type:"option",value:StrUtils.DELIMITER_OPTIONS}]},Filter:{description:"Splits up the input using the specified delimiter and then filters each branch based on a regular expression.",run:StrUtils.runFilter,manualBake:!0,inputType:"string",outputType:"string",args:[{name:"Delimiter",type:"option",value:StrUtils.DELIMITER_OPTIONS},{name:"Regex",type:"string",value:""},{name:"Invert condition",type:"boolean",value:SeqUtils.SORT_REVERSE}]},Strings:{description:"Extracts all strings from the input.",run:Extract.runStrings,inputType:"string",outputType:"string",args:[{name:"Minimum length",type:"number",value:Extract.MIN_STRING_LEN},{name:"Display total",type:"boolean",value:Extract.DISPLAY_TOTAL}]},"Extract IP addresses":{description:"Extracts all IPv4 and IPv6 addresses.

                  Warning: Given a string 710.65.0.456, this will match 10.65.0.45 so always check the original input!",run:Extract.runIp,inputType:"string",outputType:"string",args:[{name:"IPv4",type:"boolean",value:Extract.INCLUDE_IPV4},{name:"IPv6",type:"boolean",value:Extract.INCLUDE_IPV6},{name:"Remove local IPv4 addresses",type:"boolean",value:Extract.REMOVE_LOCAL},{name:"Display total",type:"boolean",value:Extract.DISPLAY_TOTAL}]},"Extract email addresses":{description:"Extracts all email addresses from the input.",run:Extract.runEmail,inputType:"string",outputType:"string",args:[{name:"Display total",type:"boolean",value:Extract.DISPLAY_TOTAL}]},"Extract MAC addresses":{description:"Extracts all Media Access Control (MAC) addresses from the input.",run:Extract.runMac,inputType:"string",outputType:"string",args:[{name:"Display total",type:"boolean",value:Extract.DISPLAY_TOTAL}]},"Extract URLs":{description:"Extracts Uniform Resource Locators (URLs) from the input. The protocol (http, ftp etc.) is required otherwise there will be far too many false positives.",run:Extract.runUrls,inputType:"string",outputType:"string",args:[{name:"Display total",type:"boolean",value:Extract.DISPLAY_TOTAL}]},"Extract domains":{description:"Extracts domain names with common Top-Level Domains (TLDs).
                  Note that this will not include paths. Use Extract URLs to find entire URLs.",run:Extract.runDomains,inputType:"string",outputType:"string",args:[{name:"Display total",type:"boolean",value:Extract.DISPLAY_TOTAL}]},"Extract file paths":{description:"Extracts anything that looks like a Windows or UNIX file path.

                  Note that if UNIX is selected, there will likely be a lot of false positives.",run:Extract.runFilePaths,inputType:"string",outputType:"string",args:[{name:"Windows",type:"boolean",value:Extract.INCLUDE_WIN_PATH},{name:"UNIX",type:"boolean",value:Extract.INCLUDE_UNIX_PATH},{name:"Display total",type:"boolean",value:Extract.DISPLAY_TOTAL}]},"Extract dates":{description:"Extracts dates in the following formats
                  • yyyy-mm-dd
                  • dd/mm/yyyy
                  • mm/dd/yyyy
                  Dividers can be any of /, -, . or space",run:Extract.runDates,inputType:"string",outputType:"string",args:[{name:"Display total",type:"boolean",value:Extract.DISPLAY_TOTAL}]},"Regular expression":{description:"Define your own regular expression to search the input data with, optionally choosing from a list of pre-defined patterns.",run:StrUtils.runRegex,manualBake:!0,inputType:"string",outputType:"html",args:[{name:"Built in regexes",type:"populateOption",value:StrUtils.REGEX_PRE_POPULATE,target:1},{name:"Regex",type:"text",value:""},{name:"Case insensitive",type:"boolean",value:StrUtils.REGEX_CASE_INSENSITIVE},{name:"Multiline matching",type:"boolean",value:StrUtils.REGEX_MULTILINE_MATCHING},{name:"Display total",type:"boolean",value:StrUtils.DISPLAY_TOTAL},{name:"Output format",type:"option",value:StrUtils.OUTPUT_FORMAT}]},"XPath expression":{description:"Extract information from an XML document with an XPath query",run:Code.runXpath,inputType:"string",outputType:"string",args:[{name:"XPath",type:"string",value:Code.XPATH_INITIAL},{name:"Result delimiter",type:"binaryShortString",value:Code.XPATH_DELIMITER}]},"CSS selector":{description:"Extract information from an HTML document with a CSS selector",run:Code.runCSSQuery,inputType:"string",outputType:"string",args:[{name:"CSS selector",type:"string",value:Code.CSS_SELECTOR_INITIAL},{name:"Delimiter",type:"binaryShortString",value:Code.CSS_QUERY_DELIMITER}]},"From UNIX Timestamp":{description:"Converts a UNIX timestamp to a datetime string.

                  e.g. 978346800 becomes Mon 1 January 2001 11:00:00 UTC",run:DateTime.runFromUnixTimestamp,inputType:"number",outputType:"string",args:[{name:"Units",type:"option",value:DateTime.UNITS}]},"To UNIX Timestamp":{description:"Parses a datetime string and returns the corresponding UNIX timestamp.

                  e.g. Mon 1 January 2001 11:00:00 UTC becomes 978346800",run:DateTime.runToUnixTimestamp,inputType:"string",outputType:"number",args:[{name:"Units",type:"option",value:DateTime.UNITS}]},"Translate DateTime Format":{description:"Parses a datetime string in one format and re-writes it in another.

                  Run with no input to see the relevant format string examples.",run:DateTime.runTranslateFormat,inputType:"string",outputType:"html",args:[{name:"Built in formats",type:"populateOption",value:DateTime.DATETIME_FORMATS,target:1},{name:"Input format string",type:"binaryString",value:DateTime.INPUT_FORMAT_STRING},{name:"Input timezone",type:"option",value:DateTime.TIMEZONES},{name:"Output format string",type:"binaryString",value:DateTime.OUTPUT_FORMAT_STRING},{name:"Output timezone",type:"option",value:DateTime.TIMEZONES}]},"Parse DateTime":{description:"Parses a DateTime string in your specified format and displays it in whichever timezone you choose with the following information:
                  • Date
                  • Time
                  • Period (AM/PM)
                  • Timezone
                  • UTC offset
                  • Daylight Saving Time
                  • Leap year
                  • Days in this month
                  • Day of year
                  • Week number
                  • Quarter
                  Run with no input to see format string examples if required.",run:DateTime.runParse,inputType:"string",outputType:"html",args:[{name:"Built in formats",type:"populateOption",value:DateTime.DATETIME_FORMATS,target:1},{name:"Input format string",type:"binaryString",value:DateTime.INPUT_FORMAT_STRING},{name:"Input timezone",type:"option",value:DateTime.TIMEZONES}]},"Convert distance":{description:"Converts a unit of distance to another format.",run:Convert.runDistance,inputType:"number",outputType:"number",args:[{name:"Input units",type:"option",value:Convert.DISTANCE_UNITS},{name:"Output units",type:"option",value:Convert.DISTANCE_UNITS}]},"Convert area":{description:"Converts a unit of area to another format.",run:Convert.runArea,inputType:"number",outputType:"number",args:[{name:"Input units",type:"option",value:Convert.AREA_UNITS},{name:"Output units",type:"option",value:Convert.AREA_UNITS}]},"Convert mass":{description:"Converts a unit of mass to another format.",run:Convert.runMass,inputType:"number",outputType:"number",args:[{name:"Input units",type:"option",value:Convert.MASS_UNITS},{name:"Output units",type:"option",value:Convert.MASS_UNITS}]},"Convert speed":{description:"Converts a unit of speed to another format.",run:Convert.runSpeed,inputType:"number",outputType:"number",args:[{name:"Input units",type:"option",value:Convert.SPEED_UNITS},{name:"Output units",type:"option",value:Convert.SPEED_UNITS}]},"Convert data units":{description:"Converts a unit of data to another format.",run:Convert.runDataSize,inputType:"number",outputType:"number",args:[{name:"Input units",type:"option",value:Convert.DATA_UNITS},{name:"Output units",type:"option",value:Convert.DATA_UNITS}]},"Raw Deflate":{description:"Compresses data using the deflate algorithm with no headers.",run:Compress.runRawDeflate,inputType:"byteArray",outputType:"byteArray",args:[{name:"Compression type",type:"option",value:Compress.COMPRESSION_TYPE}]},"Raw Inflate":{description:"Decompresses data which has been compressed using the deflate algorithm with no headers.",run:Compress.runRawInflate,inputType:"byteArray",outputType:"byteArray",args:[{name:"Start index",type:"number",value:Compress.INFLATE_INDEX},{name:"Initial output buffer size",type:"number",value:Compress.INFLATE_BUFFER_SIZE},{name:"Buffer expansion type",type:"option",value:Compress.INFLATE_BUFFER_TYPE},{name:"Resize buffer after decompression",type:"boolean",value:Compress.INFLATE_RESIZE},{name:"Verify result",type:"boolean",value:Compress.INFLATE_VERIFY}]},"Zlib Deflate":{description:"Compresses data using the deflate algorithm adding zlib headers.",run:Compress.runZlibDeflate,inputType:"byteArray",outputType:"byteArray",args:[{name:"Compression type",type:"option",value:Compress.COMPRESSION_TYPE}]},"Zlib Inflate":{description:"Decompresses data which has been compressed using the deflate algorithm with zlib headers.",run:Compress.runZlibInflate,inputType:"byteArray",outputType:"byteArray",args:[{name:"Start index",type:"number",value:Compress.INFLATE_INDEX},{name:"Initial output buffer size",type:"number",value:Compress.INFLATE_BUFFER_SIZE},{name:"Buffer expansion type",type:"option",value:Compress.INFLATE_BUFFER_TYPE},{name:"Resize buffer after decompression",type:"boolean",value:Compress.INFLATE_RESIZE},{name:"Verify result",type:"boolean",value:Compress.INFLATE_VERIFY}]},Gzip:{description:"Compresses data using the deflate algorithm with gzip headers.",run:Compress.runGzip,inputType:"byteArray",outputType:"byteArray",args:[{name:"Compression type",type:"option",value:Compress.COMPRESSION_TYPE},{name:"Filename (optional)",type:"string",value:""},{name:"Comment (optional)",type:"string",value:""},{name:"Include file checksum",type:"boolean",value:Compress.GZIP_CHECKSUM}]},Gunzip:{description:"Decompresses data which has been compressed using the deflate algorithm with gzip headers.",run:Compress.runGunzip,inputType:"byteArray",outputType:"byteArray",args:[]},Zip:{description:"Compresses data using the PKZIP algorithm with the given filename.

                  No support for multiple files at this time.",run:Compress.runPkzip,inputType:"byteArray",outputType:"byteArray",args:[{name:"Filename",type:"string",value:Compress.PKZIP_FILENAME},{name:"Comment",type:"string",value:""},{name:"Password",type:"binaryString",value:""},{name:"Compression method",type:"option",value:Compress.COMPRESSION_METHOD},{name:"Operating system",type:"option",value:Compress.OS},{name:"Compression type",type:"option",value:Compress.COMPRESSION_TYPE}]},Unzip:{description:"Decompresses data using the PKZIP algorithm and displays it per file, with support for passwords.",run:Compress.runPkunzip,inputType:"byteArray",outputType:"html",args:[{name:"Password",type:"binaryString",value:""},{name:"Verify result",type:"boolean",value:Compress.PKUNZIP_VERIFY}]},"Bzip2 Decompress":{description:"Decompresses data using the Bzip2 algorithm.",run:Compress.runBzip2Decompress,inputType:"byteArray",outputType:"string",args:[]},"Generic Code Beautify":{description:"Attempts to pretty print C-style languages such as C, C++, C#, Java, PHP, JavaScript etc.

                  This will not do a perfect job, and the resulting code may not work any more. This operation is designed purely to make obfuscated or minified code more easy to read and understand.

                  Things which will not work properly:
                  • For loop formatting
                  • Do-While loop formatting
                  • Switch/Case indentation
                  • Certain bit shift operators
                  ",run:Code.runGenericBeautify,inputType:"string",outputType:"string",args:[]},"JavaScript Parser":{description:"Returns an Abstract Syntax Tree for valid JavaScript code.",run:JS.runParse,inputType:"string",outputType:"string",args:[{name:"Location info",type:"boolean",value:JS.PARSE_LOC},{name:"Range info",type:"boolean",value:JS.PARSE_RANGE},{name:"Include tokens array",type:"boolean",value:JS.PARSE_TOKENS},{name:"Include comments array",type:"boolean",value:JS.PARSE_COMMENT},{name:"Report errors and try to continue",type:"boolean",value:JS.PARSE_TOLERANT}]},"JavaScript Beautify":{description:"Parses and pretty prints valid JavaScript code. Also works with JavaScript Object Notation (JSON).",run:JS.runBeautify,inputType:"string",outputType:"string",args:[{name:"Indent string",type:"binaryShortString",value:JS.BEAUTIFY_INDENT},{name:"Quotes",type:"option",value:JS.BEAUTIFY_QUOTES},{name:"Semicolons before closing braces",type:"boolean",value:JS.BEAUTIFY_SEMICOLONS},{name:"Include comments",type:"boolean",value:JS.BEAUTIFY_COMMENT}]},"JavaScript Minify":{description:"Compresses JavaScript code.",run:JS.runMinify,inputType:"string",outputType:"string",args:[]},"XML Beautify":{description:"Indents and prettifies eXtensible Markup Language (XML) code.",run:Code.runXmlBeautify,inputType:"string",outputType:"string",args:[{name:"Indent string",type:"binaryShortString",value:Code.BEAUTIFY_INDENT}]},"JSON Beautify":{description:"Indents and prettifies JavaScript Object Notation (JSON) code.",run:Code.runJsonBeautify,inputType:"string",outputType:"string",args:[{name:"Indent string",type:"binaryShortString",value:Code.BEAUTIFY_INDENT}]},"CSS Beautify":{description:"Indents and prettifies Cascading Style Sheets (CSS) code.",run:Code.runCssBeautify,inputType:"string",outputType:"string",args:[{name:"Indent string",type:"binaryShortString",value:Code.BEAUTIFY_INDENT}]},"SQL Beautify":{description:"Indents and prettifies Structured Query Language (SQL) code.",run:Code.runSqlBeautify,inputType:"string",outputType:"string",args:[{name:"Indent string",type:"binaryShortString",value:Code.BEAUTIFY_INDENT}]},"XML Minify":{description:"Compresses eXtensible Markup Language (XML) code.",run:Code.runXmlMinify,inputType:"string",outputType:"string",args:[{name:"Preserve comments",type:"boolean",value:Code.PRESERVE_COMMENTS}]},"JSON Minify":{description:"Compresses JavaScript Object Notation (JSON) code.",run:Code.runJsonMinify,inputType:"string",outputType:"string",args:[]},"CSS Minify":{description:"Compresses Cascading Style Sheets (CSS) code.",run:Code.runCssMinify,inputType:"string",outputType:"string",args:[{name:"Preserve comments",type:"boolean",value:Code.PRESERVE_COMMENTS}]},"SQL Minify":{description:"Compresses Structured Query Language (SQL) code.",run:Code.runSqlMinify,inputType:"string",outputType:"string",args:[]},"Analyse hash":{description:"Tries to determine information about a given hash and suggests which algorithm may have been used to generate it based on its length.",run:Hash.runAnalyse,inputType:"string",outputType:"string",args:[]},MD2:{description:"The MD2 (Message-Digest 2) algorithm is a cryptographic hash function developed by Ronald Rivest in 1989. The algorithm is optimized for 8-bit computers.

                  Although MD2 is no longer considered secure, even as of 2014, it remains in use in public key infrastructures as part of certificates generated with MD2 and RSA.",run:Hash.runMD2,inputType:"string",outputType:"string",args:[]},MD4:{description:"The MD4 (Message-Digest 4) algorithm is a cryptographic hash function developed by Ronald Rivest in 1990. The digest length is 128 bits. The algorithm has influenced later designs, such as the MD5, SHA-1 and RIPEMD algorithms.

                  The security of MD4 has been severely compromised.",run:Hash.runMD4,inputType:"string",outputType:"string",args:[]},MD5:{description:"MD5 (Message-Digest 5) is a widely used hash function. It has been used in a variety of security applications and is also commonly used to check the integrity of files.

                  However, MD5 is not collision resistant and it isn't suitable for applications like SSL/TLS certificates or digital signatures that rely on this property.",run:Hash.runMD5,inputType:"string",outputType:"string",args:[]},SHA0:{description:"SHA-0 is a retronym applied to the original version of the 160-bit hash function published in 1993 under the name 'SHA'. It was withdrawn shortly after publication due to an undisclosed 'significant flaw' and replaced by the slightly revised version SHA-1.",run:Hash.runSHA0,inputType:"string",outputType:"string",args:[]},SHA1:{description:"The SHA (Secure Hash Algorithm) hash functions were designed by the NSA. SHA-1 is the most established of the existing SHA hash functions and it is used in a variety of security applications and protocols.

                  However, SHA-1's collision resistance has been weakening as new attacks are discovered or improved.",run:Hash.runSHA1,inputType:"string",outputType:"string",args:[]},SHA224:{description:"SHA-224 is largely identical to SHA-256 but is truncated to 224 bytes.",run:Hash.runSHA224,inputType:"string",outputType:"string",args:[]},SHA256:{description:"SHA-256 is one of the four variants in the SHA-2 set. It isn't as widely used as SHA-1, though it provides much better security.",run:Hash.runSHA256,inputType:"string",outputType:"string",args:[]},SHA384:{description:"SHA-384 is largely identical to SHA-512 but is truncated to 384 bytes.",run:Hash.runSHA384,inputType:"string",outputType:"string",args:[]},SHA512:{description:"SHA-512 is largely identical to SHA-256 but operates on 64-bit words rather than 32.",run:Hash.runSHA512,inputType:"string",outputType:"string",args:[]},SHA3:{description:"This is an implementation of Keccak[c=2d]. SHA3 functions based on different implementations of Keccak will give different results.",run:Hash.runSHA3,inputType:"string",outputType:"string",args:[{name:"Output length",type:"option",value:Hash.SHA3_LENGTH}]},"RIPEMD-160":{description:"RIPEMD (RACE Integrity Primitives Evaluation Message Digest) is a family of cryptographic hash functions developed in Leuven, Belgium, by Hans Dobbertin, Antoon Bosselaers and Bart Preneel at the COSIC research group at the Katholieke Universiteit Leuven, and first published in 1996.

                  RIPEMD was based upon the design principles used in MD4, and is similar in performance to the more popular SHA-1.

                  RIPEMD-160 is an improved, 160-bit version of the original RIPEMD, and the most common version in the family.",run:Hash.runRIPEMD160,inputType:"string",outputType:"string",args:[]},HMAC:{description:"Keyed-Hash Message Authentication Codes (HMAC) are a mechanism for message authentication using cryptographic hash functions.",run:Hash.runHMAC,inputType:"string",outputType:"string",args:[{name:"Password",type:"binaryString",value:""},{name:"Hashing function",type:"option",value:Hash.HMAC_FUNCTIONS}]},"Fletcher-8 Checksum":{description:"The Fletcher checksum is an algorithm for computing a position-dependent checksum devised by John Gould Fletcher at Lawrence Livermore Labs in the late 1970s.

                  The objective of the Fletcher checksum was to provide error-detection properties approaching those of a cyclic redundancy check but with the lower computational effort associated with summation techniques.",run:Checksum.runFletcher8,inputType:"byteArray",outputType:"string",args:[]},"Fletcher-16 Checksum":{description:"The Fletcher checksum is an algorithm for computing a position-dependent checksum devised by John Gould Fletcher at Lawrence Livermore Labs in the late 1970s.

                  The objective of the Fletcher checksum was to provide error-detection properties approaching those of a cyclic redundancy check but with the lower computational effort associated with summation techniques.",run:Checksum.runFletcher16,inputType:"byteArray",outputType:"string",args:[]},"Fletcher-32 Checksum":{description:"The Fletcher checksum is an algorithm for computing a position-dependent checksum devised by John Gould Fletcher at Lawrence Livermore Labs in the late 1970s.

                  The objective of the Fletcher checksum was to provide error-detection properties approaching those of a cyclic redundancy check but with the lower computational effort associated with summation techniques.",run:Checksum.runFletcher32,inputType:"byteArray",outputType:"string",args:[]},"Fletcher-64 Checksum":{description:"The Fletcher checksum is an algorithm for computing a position-dependent checksum devised by John Gould Fletcher at Lawrence Livermore Labs in the late 1970s.

                  The objective of the Fletcher checksum was to provide error-detection properties approaching those of a cyclic redundancy check but with the lower computational effort associated with summation techniques.",run:Checksum.runFletcher64,inputType:"byteArray",outputType:"string",args:[]},"Adler-32 Checksum":{description:"Adler-32 is a checksum algorithm which was invented by Mark Adler in 1995, and is a modification of the Fletcher checksum. Compared to a cyclic redundancy check of the same length, it trades reliability for speed (preferring the latter).

                  Adler-32 is more reliable than Fletcher-16, and slightly less reliable than Fletcher-32.",run:Checksum.runAdler32,inputType:"byteArray",outputType:"string",args:[]},"CRC-32 Checksum":{description:"A cyclic redundancy check (CRC) is an error-detecting code commonly used in digital networks and storage devices to detect accidental changes to raw data.

                  The CRC was invented by W. Wesley Peterson in 1961; the 32-bit CRC function of Ethernet and many other standards is the work of several researchers and was published in 1975.",run:Checksum.runCRC32,inputType:"byteArray",outputType:"string",args:[]},"Generate all hashes":{description:"Generates all available hashes and checksums for the input.",run:Hash.runAll,inputType:"string",outputType:"string",args:[]},Entropy:{description:"Calculates the Shannon entropy of the input data which gives an idea of its randomness. 8 is the maximum.",run:Entropy.runEntropy,inputType:"byteArray",outputType:"html",args:[{name:"Chunk size",type:"number",value:Entropy.CHUNK_SIZE}]},"Frequency distribution":{description:"Displays the distribution of bytes in the data as a graph.",run:Entropy.runFreqDistrib,inputType:"byteArray",outputType:"html",args:[{name:"Show 0%'s",type:"boolean",value:Entropy.FREQ_ZEROS}]},Numberwang:{description:"Based on the popular gameshow by Mitchell and Webb.",run:Numberwang.run,inputType:"string",outputType:"string",args:[]},"Parse X.509 certificate":{description:"X.509 is an ITU-T standard for a public key infrastructure (PKI) and Privilege Management Infrastructure (PMI). It is commonly involved with SSL/TLS security.

                  This operation displays the contents of a certificate in a human readable format, similar to the openssl command line tool.",run:PublicKey.runParseX509,inputType:"string",outputType:"string",args:[{name:"Input format",type:"option",value:PublicKey.X509_INPUT_FORMAT}]},"PEM to Hex":{description:"Converts PEM (Privacy Enhanced Mail) format to a hexadecimal DER (Distinguished Encoding Rules) string.",run:PublicKey.runPemToHex,inputType:"string",outputType:"string",args:[]},"Hex to PEM":{description:"Converts a hexadecimal DER (Distinguished Encoding Rules) string into PEM (Privacy Enhanced Mail) format.",run:PublicKey.runHexToPem,inputType:"string",outputType:"string",args:[{name:"Header string",type:"string",value:PublicKey.PEM_HEADER_STRING}]},"Hex to Object Identifier":{description:"Converts a hexadecimal string into an object identifier (OID).",run:PublicKey.runHexToObjectIdentifier,inputType:"string",outputType:"string",args:[]},"Object Identifier to Hex":{description:"Converts an object identifier (OID) into a hexadecimal string.",run:PublicKey.runObjectIdentifierToHex,inputType:"string", -outputType:"string",args:[]},"Parse ASN.1 hex string":{description:"Abstract Syntax Notation One (ASN.1) is a standard and notation that describes rules and structures for representing, encoding, transmitting, and decoding data in telecommunications and computer networking.

                  This operation parses arbitrary ASN.1 data and presents the resulting tree.",run:PublicKey.runParseAsn1HexString,inputType:"string",outputType:"string",args:[{name:"Starting index",type:"number",value:0},{name:"Truncate octet strings longer than",type:"number",value:PublicKey.ASN1_TRUNCATE_LENGTH}]},"Detect File Type":{description:"Attempts to guess the MIME (Multipurpose Internet Mail Extensions) type of the data based on 'magic bytes'.

                  Currently supports the following file types: 7z, amr, avi, bmp, bz2, class, cr2, crx, dex, dmg, doc, elf, eot, epub, exe, flac, flv, gif, gz, ico, iso, jpg, jxr, m4a, m4v, mid, mkv, mov, mp3, mp4, mpg, ogg, otf, pdf, png, ppt, ps, psd, rar, rtf, sqlite, swf, tar, tar.z, tif, ttf, utf8, vmdk, wav, webm, webp, wmv, woff, woff2, xls, xz, zip.",run:FileType.runDetect,inputType:"byteArray",outputType:"string",args:[]},"Scan for Embedded Files":{description:"Scans the data for potential embedded files by looking for magic bytes at all offsets. This operation is prone to false positives.

                  WARNING: Files over about 100KB in size will take a VERY long time to process.",run:FileType.runScanForEmbeddedFiles,inputType:"byteArray",outputType:"string",args:[{name:"Ignore common byte sequences",type:"boolean",value:FileType.IGNORE_COMMON_BYTE_SEQUENCES}]},"Expand alphabet range":{description:"Expand an alphabet range string into a list of the characters in that range.

                  e.g. a-z becomes abcdefghijklmnopqrstuvwxyz.",run:SeqUtils.runExpandAlphRange,inputType:"string",outputType:"string",args:[{name:"Delimiter",type:"binaryString",value:""}]},Diff:{description:"Compares two inputs (separated by the specified delimiter) and highlights the differences between them.",run:StrUtils.runDiff,inputType:"string",outputType:"html",args:[{name:"Sample delimiter",type:"binaryString",value:StrUtils.DIFF_SAMPLE_DELIMITER},{name:"Diff by",type:"option",value:StrUtils.DIFF_BY},{name:"Show added",type:"boolean",value:!0},{name:"Show removed",type:"boolean",value:!0},{name:"Ignore whitespace (relevant for word and line)",type:"boolean",value:!1}]},"Parse UNIX file permissions":{description:"Given a UNIX/Linux file permission string in octal or textual format, this operation explains which permissions are granted to which user groups.

                  Input should be in either octal (e.g. 755) or textual (e.g. drwxr-xr-x) format.",run:OS.runParseUnixPerms,inputType:"string",outputType:"string",args:[]},"Swap endianness":{description:"Switches the data from big-endian to little-endian or vice-versa. Data can be read in as hexadecimal or raw bytes. It will be returned in the same format as it is entered.",run:Endian.runSwapEndianness,highlight:!0,highlightReverse:!0,inputType:"string",outputType:"string",args:[{name:"Data format",type:"option",value:Endian.DATA_FORMAT},{name:"Word length (bytes)",type:"number",value:Endian.WORD_LENGTH},{name:"Pad incomplete words",type:"boolean",value:Endian.PAD_INCOMPLETE_WORDS}]},"Syntax highlighter":{description:"Adds syntax highlighting to a range of source code languages. Note that this will not indent the code. Use one of the 'Beautify' operations for that.",run:Code.runSyntaxHighlight,highlight:!0,highlightReverse:!0,inputType:"string",outputType:"html",args:[{name:"Language/File extension",type:"option",value:Code.LANGUAGES},{name:"Display line numbers",type:"boolean",value:Code.LINE_NUMS}]},"Parse escaped string":{description:"Replaces escaped characters with the bytes they represent.

                  e.g.Hello\\nWorld becomes Hello
                  World
                  ",run:StrUtils.runParseEscapedString,inputType:"string",outputType:"string",args:[]},"TCP/IP Checksum":{description:"Calculates the checksum for a TCP (Transport Control Protocol) or IP (Internet Protocol) header from an input of raw bytes.",run:Checksum.runTCPIP,inputType:"byteArray",outputType:"string",args:[]},"Parse colour code":{description:"Converts a colour code in a standard format to other standard formats and displays the colour itself.

                  Example inputs
                  • #d9edf7
                  • rgba(217,237,247,1)
                  • hsla(200,65%,91%,1)
                  • cmyk(0.12, 0.04, 0.00, 0.03)
                  ",run:HTML.runParseColourCode,inputType:"string",outputType:"html",args:[]},"Generate UUID":{description:"Generates an RFC 4122 version 4 compliant Universally Unique Identifier (UUID), also known as a Globally Unique Identifier (GUID).

                  A version 4 UUID relies on random numbers, in this case generated using window.crypto if available and falling back to Math.random if not.",run:UUID.runGenerateV4,inputType:"string",outputType:"string",args:[]},Substitute:{description:"A substitution cipher allowing you to specify bytes to replace with other byte values. This can be used to create Caesar ciphers but is more powerful as any byte value can be substituted, not just letters, and the substitution values need not be in order.

                  Enter the bytes you want to replace in the Plaintext field and the bytes to replace them with in the Ciphertext field.

                  Non-printable bytes can be specified using string escape notation. For example, a line feed character can be written as either \\n or \\x0a.

                  Byte ranges can be specified using a hyphen. For example, the sequence 0123456789 can be written as 0-9.",run:Cipher.runSubstitute,inputType:"byteArray",outputType:"byteArray",args:[{name:"Plaintext",type:"binaryString",value:Cipher.SUBS_PLAINTEXT},{name:"Ciphertext",type:"binaryString",value:Cipher.SUBS_CIPHERTEXT}]},"To Morse Code":{description:"Translates alphanumeric characters into International Morse Code.

                  Ignores non-Morse characters.

                  e.g. SOS becomes ... --- ...",run:MorseCode.runTo,inputType:"string",outputType:"string",args:[{name:"Format options",type:"option",value:MorseCode.FORMAT_OPTIONS},{name:"Letter delimiter",type:"option",value:MorseCode.LETTER_DELIM_OPTIONS},{name:"Word delimiter",type:"option",value:MorseCode.WORD_DELIM_OPTIONS}]},"From Morse Code":{description:"Translates Morse Code into (upper case) alphanumeric characters.",run:MorseCode.runFrom,inputType:"string",outputType:"string",args:[{name:"Letter delimiter",type:"option",value:MorseCode.LETTER_DELIM_OPTIONS},{name:"Word delimiter",type:"option",value:MorseCode.WORD_DELIM_OPTIONS}]}},ControlsWaiter=function(a,b){this.app=a,this.manager=b};ControlsWaiter.prototype.adjustWidth=function(){var a=document.getElementById("controls"),b=document.getElementById("step"),c=document.getElementById("clr-breaks"),d=document.querySelector("#save img"),e=document.querySelector("#load img"),f=document.querySelector("#step img"),g=document.querySelector("#clr-recipe img"),h=document.querySelector("#clr-breaks img");a.clientWidth<470?b.childNodes[1].nodeValue=" Step":b.childNodes[1].nodeValue=" Step through",a.clientWidth<400?(d.style.display="none",e.style.display="none",f.style.display="none",g.style.display="none",h.style.display="none"):(d.style.display="inline",e.style.display="inline",f.style.display="inline",g.style.display="inline",h.style.display="inline"),a.clientWidth<330?c.childNodes[1].nodeValue=" Clear breaks":c.childNodes[1].nodeValue=" Clear breakpoints"},ControlsWaiter.prototype.setAutoBake=function(a){var b=document.getElementById("auto-bake");b.checked!==a&&b.click()},ControlsWaiter.prototype.bakeClick=function(){this.app.bake(),$("#output-text").selectRange(0)},ControlsWaiter.prototype.stepClick=function(){this.app.bake(!0),$("#output-text").selectRange(0)},ControlsWaiter.prototype.autoBakeChange=function(){var a=document.getElementById("auto-bake-label"),b=document.getElementById("auto-bake");this.app.autoBake_=b.checked,b.checked?(a.classList.remove("btn-default"),a.classList.add("btn-success")):(a.classList.remove("btn-success"),a.classList.add("btn-default"))},ControlsWaiter.prototype.clearRecipeClick=function(){this.manager.recipe.clearRecipe()},ControlsWaiter.prototype.clearBreaksClick=function(){for(var a=document.querySelectorAll("#rec-list li.operation .breakpoint"),b=0;b0,b=b&&f.length>0&&f.length<8e3,a&&(d+="?recipe="+encodeURIComponent(e)),a&&b?d+="&input="+encodeURIComponent(f):b&&(d+="?input="+encodeURIComponent(f)),d},ControlsWaiter.prototype.saveTextChange=function(){try{var a=JSON.parse(document.getElementById("save-text").value);this.initialiseSaveLink(a)}catch(a){}},ControlsWaiter.prototype.saveClick=function(){var a=this.app.getRecipeConfig(),b=JSON.stringify(a).replace(/},{/g,"},\n{");document.getElementById("save-text").value=b,this.initialiseSaveLink(a),$("#save-modal").modal()},ControlsWaiter.prototype.slrCheckChange=function(){this.initialiseSaveLink()},ControlsWaiter.prototype.sliCheckChange=function(){this.initialiseSaveLink()},ControlsWaiter.prototype.loadClick=function(){this.populateLoadRecipesList(),$("#load-modal").modal()},ControlsWaiter.prototype.saveButtonClick=function(){var a=document.getElementById("save-name").value,b=document.getElementById("save-text").value;if(!a)return void this.app.alert("Please enter a recipe name","danger",2e3);var c=localStorage.savedRecipes?JSON.parse(localStorage.savedRecipes):[],d=localStorage.recipeId||0;c.push({id:++d,name:a,recipe:b}),localStorage.savedRecipes=JSON.stringify(c),localStorage.recipeId=d,this.app.alert('Recipe saved as "'+a+'".',"success",2e3)},ControlsWaiter.prototype.populateLoadRecipesList=function(){for(var a=document.getElementById("load-name"),b=a.options.length;b--;)a.remove(b);var c=localStorage.savedRecipes?JSON.parse(localStorage.savedRecipes):[];for(b=0;bend: "+e+"
                  length: "+f},HighlighterWaiter.prototype.removeHighlights=function(){document.getElementById("input-highlighter").innerHTML="",document.getElementById("output-highlighter").innerHTML="",document.getElementById("input-selection-info").innerHTML="",document.getElementById("output-selection-info").innerHTML=""},HighlighterWaiter.prototype.generateHighlightList=function(){for(var a=this.app.getRecipeConfig(),b=[],c=0;c=0)return!1;var d="[startHighlight]",e=/\[startHighlight\]/g,f="[endHighlight]",g=/\[endHighlight\]/g,h=a.value;if(1===c.length){if(c[0].end/g,">").replace(/\n/g," ").replace(e,'').replace(g,"")+" ",b.style.width=a.clientWidth+"px",b.innerHTML=h,b.scrollTop=a.scrollTop,b.scrollLeft=a.scrollLeft};var HTMLApp=function(a,b,c,d){this.categories=a,this.operations=b,this.dfavourites=c,this.doptions=d,this.options=Utils.extend({},d),this.chef=new Chef,this.manager=new Manager(this),this.autoBake_=!1,this.progress=0,this.ingId=0,window.chef=this.chef};HTMLApp.prototype.setup=function(){document.dispatchEvent(this.manager.appstart),this.initialiseSplitter(),this.loadLocalStorage(),this.populateOperationsList(),this.manager.setup(),this.resetLayout(),this.setCompileMessage(),this.loadURIParams()},HTMLApp.prototype.handleError=function(a){console.error(a);var b=a.displayStr||a.toString();this.alert(b,"danger",this.options.errorTimeout,!this.options.showErrors)},HTMLApp.prototype.bake=function(a){var b;try{b=this.chef.bake(this.getInput(),this.getRecipeConfig(),this.options,this.progress,a)}catch(a){this.handleError(a)}b&&(b.error&&this.handleError(b.error),this.options=b.options,this.dishStr="html"===b.type?Utils.stripHtmlTags(b.result,!0):b.result,this.progress=b.progress,this.manager.recipe.updateBreakpointIndicator(b.progress),this.manager.output.set(b.result,b.type,b.duration),b.duration>this.options.autoBakeThreshold&&this.autoBake_&&(this.manager.controls.setAutoBake(!1),this.alert("Baking took longer than "+this.options.autoBakeThreshold+"ms, Auto Bake has been disabled.","warning",5e3)))},HTMLApp.prototype.autoBake=function(){this.autoBake_&&this.bake()},HTMLApp.prototype.silentBake=function(){var a=(new Date).getTime(),b=this.getRecipeConfig();return this.autoBake_&&this.chef.silentBake(b),(new Date).getTime()-a},HTMLApp.prototype.getInput=function(){var a=this.manager.input.get();return sessionStorage.setItem("inputLength",a.length),sessionStorage.setItem("input",a),a},HTMLApp.prototype.setInput=function(a){sessionStorage.setItem("inputLength",a.length),sessionStorage.setItem("input",a),this.manager.input.set(a)},HTMLApp.prototype.populateOperationsList=function(){document.body.appendChild(document.getElementById("edit-favourites"));for(var a="",b=0;b2?JSON.parse(localStorage.favourites):this.dfavourites;a=this.validFavourites(a),this.saveFavourites(a);var b=this.categories.filter(function(a){return"Favourites"===a.name})[0];b?b.ops=a:this.categories.unshift({name:"Favourites",ops:a})},HTMLApp.prototype.validFavourites=function(a){for(var b=[],c=0;c=0?void this.alert("'"+a+"' is already in your favourites","info",2e3):(b.push(a),this.saveFavourites(b),this.loadFavourites(),this.populateOperationsList(),void this.manager.recipe.initialiseOperationDragNDrop())},HTMLApp.prototype.loadURIParams=function(){this.queryString=function(a){if(""===a)return{};for(var b={},c=0;c"):d[e].value=a[b].args[e];a[b].disabled&&c.querySelector(".disable-icon").click(),a[b].breakpoint&&c.querySelector(".breakpoint").click(),this.progress=0}},HTMLApp.prototype.resetLayout=function(){this.columnSplitter.setSizes([20,30,50]),this.ioSplitter.setSizes([50,50]),this.manager.controls.adjustWidth(),this.manager.output.adjustWidth()},HTMLApp.prototype.setCompileMessage=function(){var a=new Date,b=Utils.fuzzyTime(a.getTime()-window.compileTime),c='Last build: '+b.substr(0,1).toUpperCase()+b.substr(1)+" ago";""!==window.compileMessage&&(c+=" - "+window.compileMessage),c+="",document.getElementById("notice").innerHTML=c},HTMLApp.prototype.alert=function(a,b,c,d){var e=new Date;if(console.log("["+e.toLocaleString()+"] "+a),!d){b=b||"danger",c=c||0;var f=document.getElementById("alert"),g=document.getElementById("alert-content");f.classList.remove("alert-danger"),f.classList.remove("alert-warning"),f.classList.remove("alert-info"),f.classList.remove("alert-success"),f.classList.add("alert-"+b),"block"===f.style.display?g.innerHTML+="

                  ["+e.toLocaleTimeString()+"] "+a:g.innerHTML="["+e.toLocaleTimeString()+"] "+a,$("#alert").stop(),f.style.display="block",f.style.opacity=1,c>0&&(clearTimeout(this.alertTimeout),this.alertTimeout=setTimeout(function(){$("#alert").slideUp(100)},c))}},HTMLApp.prototype.confirm=function(a,b,c,d){d=d||this,document.getElementById("confirm-title").innerHTML=a,document.getElementById("confirm-body").innerHTML=b,document.getElementById("confirm-modal").style.display="block",this.confirmClosed=!1,$("#confirm-modal").modal().one("show.bs.modal",function(a){this.confirmClosed=!1}.bind(this)).one("click","#confirm-yes",function(){this.confirmClosed=!0,c.bind(d)(!0),$("#confirm-modal").modal("hide")}.bind(this)).one("hide.bs.modal",function(a){this.confirmClosed||c.bind(d)(!1),this.confirmClosed=!0}.bind(this))},HTMLApp.prototype.alertCloseClick=function(){document.getElementById("alert").style.display="none"},HTMLApp.prototype.stateChange=function(a){this.autoBake(),this.options.updateUrl&&(this.lastStateUrl=this.manager.controls.generateStateUrl(!0,!0),window.history.replaceState({},"CyberChef",this.lastStateUrl))},HTMLApp.prototype.popState=function(a){window.location.href.split("#")[0]!==this.lastStateUrl&&this.loadURIParams()},HTMLApp.prototype.callApi=function(a,b,c,d,e){b=b||"POST",c=c||{},d=d||void 0,e=e||"application/json";var f=null,g=!1;return $.ajax({url:a,async:!1,type:b,data:c,dataType:d,contentType:e,success:function(a){g=!0,f=a},error:function(a){g=!1,f=a}}),{success:g,response:f}};var HTMLCategory=function(a,b){this.name=a,this.selected=b,this.opList=[]};HTMLCategory.prototype.addOperation=function(a){this.opList.push(a)},HTMLCategory.prototype.toHtml=function(){for(var a="cat"+this.name.replace(/[\s\/-:_]/g,""),b="
                  "+this.name+"
                    ",c=0;c 
                  ";switch(d+="
                  ",this.type){case"string":case"binaryString":case"byteArray":d+="";break;case"shortString":case"binaryShortString":d+="";break;case"toggleString":for(d+="
                  ";break;case"number":d+="";break;case"boolean":d+="",this.disableArgs&&this.manager.addDynamicListener("#"+this.id,"click",this.toggleDisableArgs,this);break;case"option":for(d+="";break;case"populateOption":for(d+="",this.manager.addDynamicListener("#"+this.id,"change",this.populateOptionChange,this);break;case"editableOption":for(d+="
                  ",d+="",d+="",d+="
                  ",this.manager.addDynamicListener("#sel-"+this.id,"change",this.editableOptionChange,this);break;case"text":d+=""}return d+="
                  "},HTMLIngredient.prototype.toggleDisableArgs=function(a){for(var b,c=a.target,d=c.parentNode.parentNode,e=d.querySelectorAll(".arg-group"),f=0;f"),this.description&&(b+=""),b+=""},HTMLOperation.prototype.toFullHtml=function(){for(var a="
                  "+this.name+"
                  ",b=0;b=0&&(this.name=this.name.slice(0,b)+""+this.name.slice(b,b+a.length)+""+this.name.slice(b+a.length)),this.description&&c>=0&&(this.description=this.description.slice(0,c)+""+this.description.slice(c,c+a.length)+""+this.description.slice(c+a.length))};var InputWaiter=function(a,b){this.app=a,this.manager=b,this.badKeys=[16,17,18,19,20,27,33,34,35,36,37,38,39,40,44,91,92,93,112,113,114,115,116,117,118,119,120,121,122,123,144,145]};InputWaiter.prototype.get=function(){return document.getElementById("input-text").value},InputWaiter.prototype.set=function(a){document.getElementById("input-text").value=a,window.dispatchEvent(this.manager.statechange)},InputWaiter.prototype.setInputInfo=function(a,b){var c=a.toString().length;c=c<2?2:c;var d=Utils.pad(a.toString(),c," ").replace(/ /g," "),e=Utils.pad(b.toString(),c," ").replace(/ /g," ");document.getElementById("input-info").innerHTML="length: "+d+"
                  lines: "+e},InputWaiter.prototype.inputChange=function(a){this.manager.highlighter.removeHighlights(),this.app.progress=0;var b=this.get(),c=b.count("\n")+1;this.setInputInfo(b.length,c),this.badKeys.indexOf(a.keyCode)<0&&window.dispatchEvent(this.manager.statechange)},InputWaiter.prototype.inputDragover=function(a){return"move"!==a.dataTransfer.effectAllowed&&(a.stopPropagation(),a.preventDefault(),void a.target.classList.add("dropping-file"))},InputWaiter.prototype.inputDragleave=function(a){a.stopPropagation(),a.preventDefault(),a.target.classList.remove("dropping-file")},InputWaiter.prototype.inputDrop=function(a){if("move"===a.dataTransfer.effectAllowed)return!1;a.stopPropagation(),a.preventDefault();var b=a.target,c=a.dataTransfer.files[0],d=a.dataTransfer.getData("Text"),e=new FileReader,f="",g=0,h=20480,i=function(){f.length>1e5&&this.app.autoBake_&&(this.manager.controls.setAutoBake(!1),this.app.alert("Turned off Auto Bake as the input is large","warning",5e3)),this.set(f);var a=this.app.getRecipeConfig();a[0]&&"From Hex"===a[0].op||(a.unshift({op:"From Hex",args:["Space"]}),this.app.setRecipeConfig(a)),b.classList.remove("loadingFile")}.bind(this),j=function(){if(g>=c.size)return void i();b.value="Processing... "+Math.round(g/c.size*100)+"%";var a=c.slice(g,g+h);e.readAsArrayBuffer(a)};e.onload=function(a){var b=new Uint8Array(e.result);f+=Utils.toHexFast(b),g+=h,j()},b.classList.remove("dropping-file"),c?(b.classList.add("loadingFile"),j()):d&&this.set(d)},InputWaiter.prototype.clearIoClick=function(){this.manager.highlighter.removeHighlights(),document.getElementById("input-text").value="",document.getElementById("output-text").value="",document.getElementById("input-info").innerHTML="",document.getElementById("output-info").innerHTML="",document.getElementById("input-selection-info").innerHTML="",document.getElementById("output-selection-info").innerHTML="",window.dispatchEvent(this.manager.statechange)};var Manager=function(a){this.app=a,this.appstart=new CustomEvent("appstart",{bubbles:!0}),this.operationadd=new CustomEvent("operationadd",{bubbles:!0}),this.operationremove=new CustomEvent("operationremove",{bubbles:!0}),this.oplistcreate=new CustomEvent("oplistcreate",{bubbles:!0}),this.statechange=new CustomEvent("statechange",{bubbles:!0}),this.window=new WindowWaiter(this.app),this.controls=new ControlsWaiter(this.app,this),this.recipe=new RecipeWaiter(this.app,this),this.ops=new OperationsWaiter(this.app,this),this.input=new InputWaiter(this.app,this),this.output=new OutputWaiter(this.app,this),this.options=new OptionsWaiter(this.app),this.highlighter=new HighlighterWaiter(this.app),this.seasonal=new SeasonalWaiter(this.app,this),this.dynamicHandlers={},this.initialiseEventListeners()};Manager.prototype.setup=function(){this.recipe.initialiseOperationDragNDrop(),this.controls.autoBakeChange(),this.seasonal.load()},Manager.prototype.initialiseEventListeners=function(){window.addEventListener("resize",this.window.windowResize.bind(this.window)),window.addEventListener("blur",this.window.windowBlur.bind(this.window)),window.addEventListener("focus",this.window.windowFocus.bind(this.window)),window.addEventListener("statechange",this.app.stateChange.bind(this.app)),window.addEventListener("popstate",this.app.popState.bind(this.app)),document.getElementById("bake").addEventListener("click",this.controls.bakeClick.bind(this.controls)),document.getElementById("auto-bake").addEventListener("change",this.controls.autoBakeChange.bind(this.controls)),document.getElementById("step").addEventListener("click",this.controls.stepClick.bind(this.controls)),document.getElementById("clr-recipe").addEventListener("click",this.controls.clearRecipeClick.bind(this.controls)),document.getElementById("clr-breaks").addEventListener("click",this.controls.clearBreaksClick.bind(this.controls)),document.getElementById("save").addEventListener("click",this.controls.saveClick.bind(this.controls)),document.getElementById("save-button").addEventListener("click",this.controls.saveButtonClick.bind(this.controls)),document.getElementById("save-link-recipe-checkbox").addEventListener("change",this.controls.slrCheckChange.bind(this.controls)),document.getElementById("save-link-input-checkbox").addEventListener("change",this.controls.sliCheckChange.bind(this.controls)),document.getElementById("load").addEventListener("click",this.controls.loadClick.bind(this.controls)),document.getElementById("load-delete-button").addEventListener("click",this.controls.loadDeleteClick.bind(this.controls)),document.getElementById("load-name").addEventListener("change",this.controls.loadNameChange.bind(this.controls)),document.getElementById("load-button").addEventListener("click",this.controls.loadButtonClick.bind(this.controls)),this.addMultiEventListener("#save-text","keyup paste",this.controls.saveTextChange,this.controls),this.addMultiEventListener("#search","keyup paste search",this.ops.searchOperations,this.ops),this.addDynamicListener(".op-list li.operation","dblclick",this.ops.operationDblclick,this.ops),document.getElementById("edit-favourites").addEventListener("click",this.ops.editFavouritesClick.bind(this.ops)),document.getElementById("save-favourites").addEventListener("click",this.ops.saveFavouritesClick.bind(this.ops)),document.getElementById("reset-favourites").addEventListener("click",this.ops.resetFavouritesClick.bind(this.ops)),this.addDynamicListener(".op-list .op-icon","mouseover",this.ops.opIconMouseover,this.ops),this.addDynamicListener(".op-list .op-icon","mouseleave",this.ops.opIconMouseleave,this.ops),this.addDynamicListener(".op-list","oplistcreate",this.ops.opListCreate,this.ops),this.addDynamicListener("li.operation","operationadd",this.recipe.opAdd.bind(this.recipe)),this.addDynamicListener(".arg","keyup",this.recipe.ingChange,this.recipe),this.addDynamicListener(".arg","change",this.recipe.ingChange,this.recipe),this.addDynamicListener(".disable-icon","click",this.recipe.disableClick,this.recipe),this.addDynamicListener(".breakpoint","click",this.recipe.breakpointClick,this.recipe),this.addDynamicListener("#rec-list li.operation","dblclick",this.recipe.operationDblclick,this.recipe),this.addDynamicListener("#rec-list li.operation > div","dblclick",this.recipe.operationChildDblclick,this.recipe),this.addDynamicListener("#rec-list .input-group .dropdown-menu a","click",this.recipe.dropdownToggleClick,this.recipe),this.addDynamicListener("#rec-list","operationremove",this.recipe.opRemove.bind(this.recipe)),this.addMultiEventListener("#input-text","keyup paste",this.input.inputChange,this.input),document.getElementById("reset-layout").addEventListener("click",this.app.resetLayout.bind(this.app)),document.getElementById("clr-io").addEventListener("click",this.input.clearIoClick.bind(this.input)),document.getElementById("input-text").addEventListener("dragover",this.input.inputDragover.bind(this.input)),document.getElementById("input-text").addEventListener("dragleave",this.input.inputDragleave.bind(this.input)),document.getElementById("input-text").addEventListener("drop",this.input.inputDrop.bind(this.input)),document.getElementById("input-text").addEventListener("scroll",this.highlighter.inputScroll.bind(this.highlighter)),document.getElementById("input-text").addEventListener("mouseup",this.highlighter.inputMouseup.bind(this.highlighter)),document.getElementById("input-text").addEventListener("mousemove",this.highlighter.inputMousemove.bind(this.highlighter)),this.addMultiEventListener("#input-text","mousedown dblclick select",this.highlighter.inputMousedown,this.highlighter),document.getElementById("save-to-file").addEventListener("click",this.output.saveClick.bind(this.output)),document.getElementById("switch").addEventListener("click",this.output.switchClick.bind(this.output)),document.getElementById("undo-switch").addEventListener("click",this.output.undoSwitchClick.bind(this.output)),document.getElementById("maximise-output").addEventListener("click",this.output.maximiseOutputClick.bind(this.output)),document.getElementById("output-text").addEventListener("scroll",this.highlighter.outputScroll.bind(this.highlighter)),document.getElementById("output-text").addEventListener("mouseup",this.highlighter.outputMouseup.bind(this.highlighter)),document.getElementById("output-text").addEventListener("mousemove",this.highlighter.outputMousemove.bind(this.highlighter)),document.getElementById("output-html").addEventListener("mouseup",this.highlighter.outputHtmlMouseup.bind(this.highlighter)),document.getElementById("output-html").addEventListener("mousemove",this.highlighter.outputHtmlMousemove.bind(this.highlighter)),this.addMultiEventListener("#output-text","mousedown dblclick select",this.highlighter.outputMousedown,this.highlighter),this.addMultiEventListener("#output-html","mousedown dblclick select",this.highlighter.outputHtmlMousedown,this.highlighter),document.getElementById("options").addEventListener("click",this.options.optionsClick.bind(this.options)),document.getElementById("reset-options").addEventListener("click",this.options.resetOptionsClick.bind(this.options)),$(document).on("switchChange.bootstrapSwitch",".option-item input:checkbox",this.options.switchChange.bind(this.options)),$(document).on("switchChange.bootstrapSwitch",".option-item input:checkbox",this.options.setWordWrap.bind(this.options)),this.addDynamicListener(".option-item input[type=number]","keyup",this.options.numberChange,this.options),this.addDynamicListener(".option-item input[type=number]","change",this.options.numberChange,this.options),this.addDynamicListener(".option-item select","change",this.options.selectChange,this.options),document.getElementById("alert-close").addEventListener("click",this.app.alertCloseClick.bind(this.app))},Manager.prototype.addListeners=function(a,b,c,d){d=d||this,[].forEach.call(document.querySelectorAll(a),function(a){a.addEventListener(b,c.bind(d))})},Manager.prototype.addMultiEventListener=function(a,b,c,d){for(var e=b.split(" "),f=0;f-1&&(this.manager.recipe.addOperation(b[c].innerHTML),this.app.autoBake()))),13===a.keyCode)a.preventDefault();else if(40===a.keyCode)a.preventDefault(),b=document.querySelectorAll("#search-results li"),b.length&&(c=this.getSelectedOp(b),c>-1&&b[c].classList.remove("selected-op"),c===b.length-1&&(c=-1),b[c+1].classList.add("selected-op"));else if(38===a.keyCode)a.preventDefault(),b=document.querySelectorAll("#search-results li"),b.length&&(c=this.getSelectedOp(b),c>-1&&b[c].classList.remove("selected-op"),0===c&&(c=b.length),b[c-1].classList.add("selected-op"));else{for(var d=document.getElementById("search-results"),e=a.target,f=e.value;d.firstChild;)$(d.firstChild).popover("destroy"),d.removeChild(d.firstChild);if($("#categories .in").collapse("hide"),f){for(var g=this.filterOperations(f,!0),h="",i=0;i=0||h>=0){var i=new HTMLOperation(e,this.app.operations[e],this.app,this.manager);b&&i.highlightSearchString(a,g,h),g<0?c.push(i):d.push(i)}}return d.concat(c)},OperationsWaiter.prototype.getSelectedOp=function(a){for(var b=0;blength: "+e+"
                  lines: "+f,document.getElementById("input-selection-info").innerHTML="",document.getElementById("output-selection-info").innerHTML=""},OutputWaiter.prototype.adjustWidth=function(){var a=document.getElementById("output"),b=document.getElementById("save-to-file"),c=document.getElementById("switch"),d=document.getElementById("undo-switch"),e=document.getElementById("maximise-output");a.clientWidth<680?(b.childNodes[1].nodeValue="",c.childNodes[1].nodeValue="",d.childNodes[1].nodeValue="",e.childNodes[1].nodeValue=""):(b.childNodes[1].nodeValue=" Save to file",c.childNodes[1].nodeValue=" Move output to input",d.childNodes[1].nodeValue=" Undo",e.childNodes[1].nodeValue="Maximise"===e.getAttribute("title")?" Max":" Restore")},OutputWaiter.prototype.saveClick=function(){var a=Utils.toBase64(this.app.dishStr),b=window.prompt("Please enter a filename:","download.dat");if(b){var c=document.createElement("a");c.setAttribute("href","data:application/octet-stream;base64;charset=utf-8,"+a),c.setAttribute("download",b),c.style.display="none",document.body.appendChild(c),c.click(),c.remove()}},OutputWaiter.prototype.switchClick=function(){this.switchOrigData=this.manager.input.get(),document.getElementById("undo-switch").disabled=!1,this.app.setInput(this.app.dishStr)},OutputWaiter.prototype.undoSwitchClick=function(){this.app.setInput(this.switchOrigData),document.getElementById("undo-switch").disabled=!0},OutputWaiter.prototype.maximiseOutputClick=function(a){var b="maximise-output"===a.target.id?a.target:a.target.parentNode;"Maximise"===b.getAttribute("title")?(this.app.columnSplitter.collapse(0),this.app.columnSplitter.collapse(1),this.app.ioSplitter.collapse(0),b.setAttribute("title","Restore"),b.innerHTML=" Restore",this.adjustWidth()):(b.setAttribute("title","Maximise"),b.innerHTML=" Max",this.app.resetLayout())};var RecipeWaiter=function(a,b){this.app=a,this.manager=b,this.removeIntent=!1};RecipeWaiter.prototype.initialiseOperationDragNDrop=function(){var a=document.getElementById("rec-list");Sortable.create(a,{group:"recipe",sort:!0,animation:0,delay:0,filter:".arg-input,.arg",setData:function(a,b){a.setData("Text",b.querySelector(".arg-title").textContent)},onEnd:function(a){this.removeIntent&&(a.item.remove(),a.target.dispatchEvent(this.manager.operationremove))}.bind(this)}),Sortable.utils.on(a,"dragover",function(){this.removeIntent=!1}.bind(this)),Sortable.utils.on(a,"dragleave",function(){this.removeIntent=!0,this.app.progress=0}.bind(this)),Sortable.utils.on(a,"touchend",function(b){var c=b.changedTouches[0],d=document.elementFromPoint(c.clientX,c.clientY);this.removeIntent=!a.contains(d)}.bind(this)),document.querySelector("#categories a").addEventListener("dragover",this.favDragover.bind(this)),document.querySelector("#categories a").addEventListener("dragleave",this.favDragleave.bind(this)),document.querySelector("#categories a").addEventListener("drop",this.favDrop.bind(this))},RecipeWaiter.prototype.createSortableSeedList=function(a){Sortable.create(a,{group:{name:"recipe",pull:"clone",put:!1},sort:!1,setData:function(a,b){a.setData("Text",b.textContent)},onStart:function(a){$(a.item).popover("destroy"),a.item.setAttribute("data-toggle","popover-disabled")},onEnd:this.opSortEnd.bind(this)})},RecipeWaiter.prototype.opSortEnd=function(a){return this.removeIntent?void("rec-list"===a.item.parentNode.id&&a.item.remove()):($(a.clone).popover(),$(a.clone).children("[data-toggle=popover]").popover(),void("rec-list"===a.item.parentNode.id&&(this.buildRecipeOperation(a.item),a.item.dispatchEvent(this.manager.operationadd))))},RecipeWaiter.prototype.favDragover=function(a){return"move"===a.dataTransfer.effectAllowed&&(a.stopPropagation(),a.preventDefault(),void(a.target.className&&a.target.className.indexOf("category-title")>-1?a.target.classList.add("favourites-hover"):a.target.parentNode.className&&a.target.parentNode.className.indexOf("category-title")>-1?a.target.parentNode.classList.add("favourites-hover"):a.target.parentNode.parentNode.className&&a.target.parentNode.parentNode.className.indexOf("category-title")>-1&&a.target.parentNode.parentNode.classList.add("favourites-hover")))},RecipeWaiter.prototype.favDragleave=function(a){a.stopPropagation(),a.preventDefault(),document.querySelector("#categories a").classList.remove("favourites-hover")},RecipeWaiter.prototype.favDrop=function(a){a.stopPropagation(),a.preventDefault(),a.target.classList.remove("favourites-hover");var b=a.dataTransfer.getData("Text");this.app.addFavourite(b)},RecipeWaiter.prototype.ingChange=function(){window.dispatchEvent(this.manager.statechange)},RecipeWaiter.prototype.disableClick=function(a){var b=a.target;"false"===b.getAttribute("disabled")?(b.setAttribute("disabled","true"),b.classList.add("disable-icon-selected"),b.parentNode.parentNode.classList.add("disabled")):(b.setAttribute("disabled","false"),b.classList.remove("disable-icon-selected"),b.parentNode.parentNode.classList.remove("disabled")),this.app.progress=0,window.dispatchEvent(this.manager.statechange)},RecipeWaiter.prototype.breakpointClick=function(a){var b=a.target;"false"===b.getAttribute("break")?(b.setAttribute("break","true"),b.classList.add("breakpoint-selected")):(b.setAttribute("break","false"),b.classList.remove("breakpoint-selected")),window.dispatchEvent(this.manager.statechange)},RecipeWaiter.prototype.operationDblclick=function(a){a.target.remove(),window.dispatchEvent(this.manager.statechange)},RecipeWaiter.prototype.operationChildDblclick=function(a){a.target.parentNode.remove(),window.dispatchEvent(this.manager.statechange)},RecipeWaiter.prototype.getConfig=function(){for(var a,b,c,d,e,f=[],g=document.querySelectorAll("#rec-list li.operation"),h=0;h",this.ingChange()},RecipeWaiter.prototype.opAdd=function(a){window.dispatchEvent(this.manager.statechange)},RecipeWaiter.prototype.opRemove=function(a){window.dispatchEvent(this.manager.statechange)};var SeasonalWaiter=function(a,b){this.app=a,this.manager=b};SeasonalWaiter.prototype.load=function(){var a=new Date;11===a.getMonth()&&a.getDate()>12&&(this.app.options.snow=!1,this.createSnowOption(),$(document).on("switchChange.bootstrapSwitch",".option-item input:checkbox[option='snow']",this.letItSnow.bind(this)),window.addEventListener("resize",this.letItSnow.bind(this)),this.manager.addListeners(".btn","click",this.shakeOffSnow,this),25===a.getDate()&&this.letItSnow()),this.kkeys=[],window.addEventListener("keydown",this.konamiCodeListener.bind(this))},SeasonalWaiter.prototype.insertSpiderIcons=function(){var a="iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJL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ZVAP+ey5Rv+Ba97aaUHMW5NauLmMZFkegBb/EP14d6NoS9QLWFSzWBmuZza8CQmSpXsAqmGtVy14VALWuuYWWy+W3OteXa4jwceQX6+BKG6J1/8+2VCNkm2222WabbbbZZpttttlmm22rt38DCdA0vq3bcAkAAAAASUVORK5CYII="; -document.querySelector("link[rel=icon]").setAttribute("href","data:image/png;base64,"+a),document.querySelector("#bake img").setAttribute("src","data:image/png;base64,"+b),document.querySelector(".about-img-left").setAttribute("src","data:image/png;base64,"+c)},SeasonalWaiter.prototype.insertSpiderText=function(){document.title=document.title.replace(/Cyber/g,"Spider"),SeasonalWaiter.treeWalk(document.body,function(a){3===a.nodeType&&(a.nodeValue=a.nodeValue.replace(/Cyber/g,"Spider"))},!0),SeasonalWaiter.treeWalk(document.getElementById("bake-group"),function(a){3===a.nodeType&&(a.nodeValue=a.nodeValue.replace(/Bake/g,"Spin"))},!0),document.querySelector("#recipe .title").innerHTML="Web"},SeasonalWaiter.prototype.createSnowOption=function(){var a=document.getElementById("options-body"),b=document.createElement("div");b.className="option-item",b.innerHTML=" Let it snow",a.appendChild(b),this.manager.options.load()},SeasonalWaiter.prototype.letItSnow=function(){if($(document).snowfall("clear"),this.app.options.snow){var a={},b=navigator.userAgent.match(/Firefox\/(\d\d?)/);a=b&&parseInt(b[1],10)<30?{flakeCount:10,flakeColor:"#fff",flakePosition:"absolute",minSize:1,maxSize:2,minSpeed:1,maxSpeed:5,round:!1,shadow:!1,collection:!1,collectionHeight:20,deviceorientation:!0}:{flakeCount:35,flakeColor:"#fff",flakePosition:"absolute",minSize:5,maxSize:8,minSpeed:1,maxSpeed:5,round:!0,shadow:!0,collection:".btn",collectionHeight:20,deviceorientation:!0},$(document).snowfall(a)}},SeasonalWaiter.prototype.shakeOffSnow=function(a){for(var b=a.target,c=b.getBoundingClientRect(),d=document.querySelectorAll("canvas.snowfall-canvas"),e=null,f=function(){h.clearRect(0,0,e.width,e.height),$(this).fadeIn()},g=0;g6e4&&this.app.silentBake()};var main=function(){var a=["To Base64","From Base64","To Hex","From Hex","To Hexdump","From Hexdump","URL Decode","Regular expression","Entropy","Fork"],b={updateUrl:!0,showHighlighter:!0,treatAsUtf8:!0,wordWrap:!0,showErrors:!0,errorTimeout:4e3,autoBakeThreshold:200,attemptHighlight:!0,snow:!1};document.removeEventListener("DOMContentLoaded",main,!1),window.app=new HTMLApp(Categories,OperationConfig,a,b),window.app.setup()};window.console=console||{log:function(){},error:function(){}},window.compileTime=moment.tz("Tue Feb 07 2017 15:00:04","ddd MMM D YYYY HH:mm:ss","UTC").valueOf(),window.compileMessage="",document.addEventListener("DOMContentLoaded",main,!1); \ No newline at end of file +outputType:"string",args:[]},"Parse ASN.1 hex string":{description:"Abstract Syntax Notation One (ASN.1) is a standard and notation that describes rules and structures for representing, encoding, transmitting, and decoding data in telecommunications and computer networking.

                  This operation parses arbitrary ASN.1 data and presents the resulting tree.",run:PublicKey.runParseAsn1HexString,inputType:"string",outputType:"string",args:[{name:"Starting index",type:"number",value:0},{name:"Truncate octet strings longer than",type:"number",value:PublicKey.ASN1_TRUNCATE_LENGTH}]},"Detect File Type":{description:"Attempts to guess the MIME (Multipurpose Internet Mail Extensions) type of the data based on 'magic bytes'.

                  Currently supports the following file types: 7z, amr, avi, bmp, bz2, class, cr2, crx, dex, dmg, doc, elf, eot, epub, exe, flac, flv, gif, gz, ico, iso, jpg, jxr, m4a, m4v, mid, mkv, mov, mp3, mp4, mpg, ogg, otf, pdf, png, ppt, ps, psd, rar, rtf, sqlite, swf, tar, tar.z, tif, ttf, utf8, vmdk, wav, webm, webp, wmv, woff, woff2, xls, xz, zip.",run:FileType.runDetect,inputType:"byteArray",outputType:"string",args:[]},"Scan for Embedded Files":{description:"Scans the data for potential embedded files by looking for magic bytes at all offsets. This operation is prone to false positives.

                  WARNING: Files over about 100KB in size will take a VERY long time to process.",run:FileType.runScanForEmbeddedFiles,inputType:"byteArray",outputType:"string",args:[{name:"Ignore common byte sequences",type:"boolean",value:FileType.IGNORE_COMMON_BYTE_SEQUENCES}]},"Expand alphabet range":{description:"Expand an alphabet range string into a list of the characters in that range.

                  e.g. a-z becomes abcdefghijklmnopqrstuvwxyz.",run:SeqUtils.runExpandAlphRange,inputType:"string",outputType:"string",args:[{name:"Delimiter",type:"binaryString",value:""}]},Diff:{description:"Compares two inputs (separated by the specified delimiter) and highlights the differences between them.",run:StrUtils.runDiff,inputType:"string",outputType:"html",args:[{name:"Sample delimiter",type:"binaryString",value:StrUtils.DIFF_SAMPLE_DELIMITER},{name:"Diff by",type:"option",value:StrUtils.DIFF_BY},{name:"Show added",type:"boolean",value:!0},{name:"Show removed",type:"boolean",value:!0},{name:"Ignore whitespace (relevant for word and line)",type:"boolean",value:!1}]},"Parse UNIX file permissions":{description:"Given a UNIX/Linux file permission string in octal or textual format, this operation explains which permissions are granted to which user groups.

                  Input should be in either octal (e.g. 755) or textual (e.g. drwxr-xr-x) format.",run:OS.runParseUnixPerms,inputType:"string",outputType:"string",args:[]},"Swap endianness":{description:"Switches the data from big-endian to little-endian or vice-versa. Data can be read in as hexadecimal or raw bytes. It will be returned in the same format as it is entered.",run:Endian.runSwapEndianness,highlight:!0,highlightReverse:!0,inputType:"string",outputType:"string",args:[{name:"Data format",type:"option",value:Endian.DATA_FORMAT},{name:"Word length (bytes)",type:"number",value:Endian.WORD_LENGTH},{name:"Pad incomplete words",type:"boolean",value:Endian.PAD_INCOMPLETE_WORDS}]},"Syntax highlighter":{description:"Adds syntax highlighting to a range of source code languages. Note that this will not indent the code. Use one of the 'Beautify' operations for that.",run:Code.runSyntaxHighlight,highlight:!0,highlightReverse:!0,inputType:"string",outputType:"html",args:[{name:"Language/File extension",type:"option",value:Code.LANGUAGES},{name:"Display line numbers",type:"boolean",value:Code.LINE_NUMS}]},"Parse escaped string":{description:"Replaces escaped characters with the bytes they represent.

                  e.g.Hello\\nWorld becomes Hello
                  World
                  ",run:StrUtils.runParseEscapedString,inputType:"string",outputType:"string",args:[]},"TCP/IP Checksum":{description:"Calculates the checksum for a TCP (Transport Control Protocol) or IP (Internet Protocol) header from an input of raw bytes.",run:Checksum.runTCPIP,inputType:"byteArray",outputType:"string",args:[]},"Parse colour code":{description:"Converts a colour code in a standard format to other standard formats and displays the colour itself.

                  Example inputs
                  • #d9edf7
                  • rgba(217,237,247,1)
                  • hsla(200,65%,91%,1)
                  • cmyk(0.12, 0.04, 0.00, 0.03)
                  ",run:HTML.runParseColourCode,inputType:"string",outputType:"html",args:[]},"Generate UUID":{description:"Generates an RFC 4122 version 4 compliant Universally Unique Identifier (UUID), also known as a Globally Unique Identifier (GUID).

                  A version 4 UUID relies on random numbers, in this case generated using window.crypto if available and falling back to Math.random if not.",run:UUID.runGenerateV4,inputType:"string",outputType:"string",args:[]},Substitute:{description:"A substitution cipher allowing you to specify bytes to replace with other byte values. This can be used to create Caesar ciphers but is more powerful as any byte value can be substituted, not just letters, and the substitution values need not be in order.

                  Enter the bytes you want to replace in the Plaintext field and the bytes to replace them with in the Ciphertext field.

                  Non-printable bytes can be specified using string escape notation. For example, a line feed character can be written as either \\n or \\x0a.

                  Byte ranges can be specified using a hyphen. For example, the sequence 0123456789 can be written as 0-9.",run:Cipher.runSubstitute,inputType:"byteArray",outputType:"byteArray",args:[{name:"Plaintext",type:"binaryString",value:Cipher.SUBS_PLAINTEXT},{name:"Ciphertext",type:"binaryString",value:Cipher.SUBS_CIPHERTEXT}]},"To Morse Code":{description:"Translates alphanumeric characters into International Morse Code.

                  Ignores non-Morse characters.

                  e.g. SOS becomes ... --- ...",run:MorseCode.runTo,inputType:"string",outputType:"string",args:[{name:"Format options",type:"option",value:MorseCode.FORMAT_OPTIONS},{name:"Letter delimiter",type:"option",value:MorseCode.LETTER_DELIM_OPTIONS},{name:"Word delimiter",type:"option",value:MorseCode.WORD_DELIM_OPTIONS}]},"From Morse Code":{description:"Translates Morse Code into (upper case) alphanumeric characters.",run:MorseCode.runFrom,inputType:"string",outputType:"string",args:[{name:"Letter delimiter",type:"option",value:MorseCode.LETTER_DELIM_OPTIONS},{name:"Word delimiter",type:"option",value:MorseCode.WORD_DELIM_OPTIONS}]}},ControlsWaiter=function(a,b){this.app=a,this.manager=b};ControlsWaiter.prototype.adjustWidth=function(){var a=document.getElementById("controls"),b=document.getElementById("step"),c=document.getElementById("clr-breaks"),d=document.querySelector("#save img"),e=document.querySelector("#load img"),f=document.querySelector("#step img"),g=document.querySelector("#clr-recipe img"),h=document.querySelector("#clr-breaks img");a.clientWidth<470?b.childNodes[1].nodeValue=" Step":b.childNodes[1].nodeValue=" Step through",a.clientWidth<400?(d.style.display="none",e.style.display="none",f.style.display="none",g.style.display="none",h.style.display="none"):(d.style.display="inline",e.style.display="inline",f.style.display="inline",g.style.display="inline",h.style.display="inline"),a.clientWidth<330?c.childNodes[1].nodeValue=" Clear breaks":c.childNodes[1].nodeValue=" Clear breakpoints"},ControlsWaiter.prototype.setAutoBake=function(a){var b=document.getElementById("auto-bake");b.checked!==a&&b.click()},ControlsWaiter.prototype.bakeClick=function(){this.app.bake(),$("#output-text").selectRange(0)},ControlsWaiter.prototype.stepClick=function(){this.app.bake(!0),$("#output-text").selectRange(0)},ControlsWaiter.prototype.autoBakeChange=function(){var a=document.getElementById("auto-bake-label"),b=document.getElementById("auto-bake");this.app.autoBake_=b.checked,b.checked?(a.classList.remove("btn-default"),a.classList.add("btn-success")):(a.classList.remove("btn-success"),a.classList.add("btn-default"))},ControlsWaiter.prototype.clearRecipeClick=function(){this.manager.recipe.clearRecipe()},ControlsWaiter.prototype.clearBreaksClick=function(){for(var a=document.querySelectorAll("#rec-list li.operation .breakpoint"),b=0;b0,b=b&&g.length>0&&g.length<8e3,a&&(e+="?recipe="+encodeURIComponent(f)),a&&b?e+="&input="+encodeURIComponent(g):b&&(e+="?input="+encodeURIComponent(g)),e},ControlsWaiter.prototype.saveTextChange=function(){try{var a=JSON.parse(document.getElementById("save-text").value);this.initialiseSaveLink(a)}catch(a){}},ControlsWaiter.prototype.saveClick=function(){var a=this.app.getRecipeConfig(),b=JSON.stringify(a).replace(/},{/g,"},\n{");document.getElementById("save-text").value=b,this.initialiseSaveLink(a),$("#save-modal").modal()},ControlsWaiter.prototype.slrCheckChange=function(){this.initialiseSaveLink()},ControlsWaiter.prototype.sliCheckChange=function(){this.initialiseSaveLink()},ControlsWaiter.prototype.loadClick=function(){this.populateLoadRecipesList(),$("#load-modal").modal()},ControlsWaiter.prototype.saveButtonClick=function(){var a=document.getElementById("save-name").value,b=document.getElementById("save-text").value;if(!a)return void this.app.alert("Please enter a recipe name","danger",2e3);var c=localStorage.savedRecipes?JSON.parse(localStorage.savedRecipes):[],d=localStorage.recipeId||0;c.push({id:++d,name:a,recipe:b}),localStorage.savedRecipes=JSON.stringify(c),localStorage.recipeId=d,this.app.alert('Recipe saved as "'+a+'".',"success",2e3)},ControlsWaiter.prototype.populateLoadRecipesList=function(){for(var a=document.getElementById("load-name"),b=a.options.length;b--;)a.remove(b);var c=localStorage.savedRecipes?JSON.parse(localStorage.savedRecipes):[];for(b=0;bend: "+e+"
                  length: "+f},HighlighterWaiter.prototype.removeHighlights=function(){document.getElementById("input-highlighter").innerHTML="",document.getElementById("output-highlighter").innerHTML="",document.getElementById("input-selection-info").innerHTML="",document.getElementById("output-selection-info").innerHTML=""},HighlighterWaiter.prototype.generateHighlightList=function(){for(var a=this.app.getRecipeConfig(),b=[],c=0;c=0)return!1;var d="[startHighlight]",e=/\[startHighlight\]/g,f="[endHighlight]",g=/\[endHighlight\]/g,h=a.value;if(1===c.length){if(c[0].end/g,">").replace(/\n/g," ").replace(e,'').replace(g,"")+" ",b.style.width=a.clientWidth+"px",b.innerHTML=h,b.scrollTop=a.scrollTop,b.scrollLeft=a.scrollLeft};var HTMLApp=function(a,b,c,d){this.categories=a,this.operations=b,this.dfavourites=c,this.doptions=d,this.options=Utils.extend({},d),this.chef=new Chef,this.manager=new Manager(this),this.autoBake_=!1,this.progress=0,this.ingId=0,window.chef=this.chef};HTMLApp.prototype.setup=function(){document.dispatchEvent(this.manager.appstart),this.initialiseSplitter(),this.loadLocalStorage(),this.populateOperationsList(),this.manager.setup(),this.resetLayout(),this.setCompileMessage(),this.loadURIParams()},HTMLApp.prototype.handleError=function(a){console.error(a);var b=a.displayStr||a.toString();this.alert(b,"danger",this.options.errorTimeout,!this.options.showErrors)},HTMLApp.prototype.bake=function(a){var b;try{b=this.chef.bake(this.getInput(),this.getRecipeConfig(),this.options,this.progress,a)}catch(a){this.handleError(a)}b&&(b.error&&this.handleError(b.error),this.options=b.options,this.dishStr="html"===b.type?Utils.stripHtmlTags(b.result,!0):b.result,this.progress=b.progress,this.manager.recipe.updateBreakpointIndicator(b.progress),this.manager.output.set(b.result,b.type,b.duration),b.duration>this.options.autoBakeThreshold&&this.autoBake_&&(this.manager.controls.setAutoBake(!1),this.alert("Baking took longer than "+this.options.autoBakeThreshold+"ms, Auto Bake has been disabled.","warning",5e3)))},HTMLApp.prototype.autoBake=function(){this.autoBake_&&this.bake()},HTMLApp.prototype.silentBake=function(){var a=(new Date).getTime(),b=this.getRecipeConfig();return this.autoBake_&&this.chef.silentBake(b),(new Date).getTime()-a},HTMLApp.prototype.getInput=function(){var a=this.manager.input.get();return sessionStorage.setItem("inputLength",a.length),sessionStorage.setItem("input",a),a},HTMLApp.prototype.setInput=function(a){sessionStorage.setItem("inputLength",a.length),sessionStorage.setItem("input",a),this.manager.input.set(a)},HTMLApp.prototype.populateOperationsList=function(){document.body.appendChild(document.getElementById("edit-favourites"));for(var a="",b=0;b2?JSON.parse(localStorage.favourites):this.dfavourites;a=this.validFavourites(a),this.saveFavourites(a);var b=this.categories.filter(function(a){return"Favourites"===a.name})[0];b?b.ops=a:this.categories.unshift({name:"Favourites",ops:a})},HTMLApp.prototype.validFavourites=function(a){for(var b=[],c=0;c=0?void this.alert("'"+a+"' is already in your favourites","info",2e3):(b.push(a),this.saveFavourites(b),this.loadFavourites(),this.populateOperationsList(),void this.manager.recipe.initialiseOperationDragNDrop())},HTMLApp.prototype.loadURIParams=function(){this.queryString=function(a){if(""===a)return{};for(var b={},c=0;c"):d[e].value=a[b].args[e];a[b].disabled&&c.querySelector(".disable-icon").click(),a[b].breakpoint&&c.querySelector(".breakpoint").click(),this.progress=0}},HTMLApp.prototype.resetLayout=function(){this.columnSplitter.setSizes([20,30,50]),this.ioSplitter.setSizes([50,50]),this.manager.controls.adjustWidth(),this.manager.output.adjustWidth()},HTMLApp.prototype.setCompileMessage=function(){var a=new Date,b=Utils.fuzzyTime(a.getTime()-window.compileTime),c='Last build: '+b.substr(0,1).toUpperCase()+b.substr(1)+" ago";""!==window.compileMessage&&(c+=" - "+window.compileMessage),c+="",document.getElementById("notice").innerHTML=c},HTMLApp.prototype.alert=function(a,b,c,d){var e=new Date;if(console.log("["+e.toLocaleString()+"] "+a),!d){b=b||"danger",c=c||0;var f=document.getElementById("alert"),g=document.getElementById("alert-content");f.classList.remove("alert-danger"),f.classList.remove("alert-warning"),f.classList.remove("alert-info"),f.classList.remove("alert-success"),f.classList.add("alert-"+b),"block"===f.style.display?g.innerHTML+="

                  ["+e.toLocaleTimeString()+"] "+a:g.innerHTML="["+e.toLocaleTimeString()+"] "+a,$("#alert").stop(),f.style.display="block",f.style.opacity=1,c>0&&(clearTimeout(this.alertTimeout),this.alertTimeout=setTimeout(function(){$("#alert").slideUp(100)},c))}},HTMLApp.prototype.confirm=function(a,b,c,d){d=d||this,document.getElementById("confirm-title").innerHTML=a,document.getElementById("confirm-body").innerHTML=b,document.getElementById("confirm-modal").style.display="block",this.confirmClosed=!1,$("#confirm-modal").modal().one("show.bs.modal",function(a){this.confirmClosed=!1}.bind(this)).one("click","#confirm-yes",function(){this.confirmClosed=!0,c.bind(d)(!0),$("#confirm-modal").modal("hide")}.bind(this)).one("hide.bs.modal",function(a){this.confirmClosed||c.bind(d)(!1),this.confirmClosed=!0}.bind(this))},HTMLApp.prototype.alertCloseClick=function(){document.getElementById("alert").style.display="none"},HTMLApp.prototype.stateChange=function(a){this.autoBake(),this.options.updateUrl&&(this.lastStateUrl=this.manager.controls.generateStateUrl(!0,!0),window.history.replaceState({},"CyberChef",this.lastStateUrl))},HTMLApp.prototype.popState=function(a){window.location.href.split("#")[0]!==this.lastStateUrl&&this.loadURIParams()},HTMLApp.prototype.callApi=function(a,b,c,d,e){b=b||"POST",c=c||{},d=d||void 0,e=e||"application/json";var f=null,g=!1;return $.ajax({url:a,async:!1,type:b,data:c,dataType:d,contentType:e,success:function(a){g=!0,f=a},error:function(a){g=!1,f=a}}),{success:g,response:f}};var HTMLCategory=function(a,b){this.name=a,this.selected=b,this.opList=[]};HTMLCategory.prototype.addOperation=function(a){this.opList.push(a)},HTMLCategory.prototype.toHtml=function(){for(var a="cat"+this.name.replace(/[\s\/-:_]/g,""),b="
                  "+this.name+"
                    ",c=0;c 
                  ";switch(d+="
                  ",this.type){case"string":case"binaryString":case"byteArray":d+="";break;case"shortString":case"binaryShortString":d+="";break;case"toggleString":for(d+="
                  ";break;case"number":d+="";break;case"boolean":d+="",this.disableArgs&&this.manager.addDynamicListener("#"+this.id,"click",this.toggleDisableArgs,this);break;case"option":for(d+="";break;case"populateOption":for(d+="",this.manager.addDynamicListener("#"+this.id,"change",this.populateOptionChange,this);break;case"editableOption":for(d+="
                  ",d+="",d+="",d+="
                  ",this.manager.addDynamicListener("#sel-"+this.id,"change",this.editableOptionChange,this);break;case"text":d+=""}return d+="
                  "},HTMLIngredient.prototype.toggleDisableArgs=function(a){for(var b,c=a.target,d=c.parentNode.parentNode,e=d.querySelectorAll(".arg-group"),f=0;f"),this.description&&(b+=""),b+=""},HTMLOperation.prototype.toFullHtml=function(){for(var a="
                  "+this.name+"
                  ",b=0;b=0&&(this.name=this.name.slice(0,b)+""+this.name.slice(b,b+a.length)+""+this.name.slice(b+a.length)),this.description&&c>=0&&(this.description=this.description.slice(0,c)+""+this.description.slice(c,c+a.length)+""+this.description.slice(c+a.length))};var InputWaiter=function(a,b){this.app=a,this.manager=b,this.badKeys=[16,17,18,19,20,27,33,34,35,36,37,38,39,40,44,91,92,93,112,113,114,115,116,117,118,119,120,121,122,123,144,145]};InputWaiter.prototype.get=function(){return document.getElementById("input-text").value},InputWaiter.prototype.set=function(a){document.getElementById("input-text").value=a,window.dispatchEvent(this.manager.statechange)},InputWaiter.prototype.setInputInfo=function(a,b){var c=a.toString().length;c=c<2?2:c;var d=Utils.pad(a.toString(),c," ").replace(/ /g," "),e=Utils.pad(b.toString(),c," ").replace(/ /g," ");document.getElementById("input-info").innerHTML="length: "+d+"
                  lines: "+e},InputWaiter.prototype.inputChange=function(a){this.manager.highlighter.removeHighlights(),this.app.progress=0;var b=this.get(),c=b.count("\n")+1;this.setInputInfo(b.length,c),this.badKeys.indexOf(a.keyCode)<0&&window.dispatchEvent(this.manager.statechange)},InputWaiter.prototype.inputDragover=function(a){return"move"!==a.dataTransfer.effectAllowed&&(a.stopPropagation(),a.preventDefault(),void a.target.classList.add("dropping-file"))},InputWaiter.prototype.inputDragleave=function(a){a.stopPropagation(),a.preventDefault(),a.target.classList.remove("dropping-file")},InputWaiter.prototype.inputDrop=function(a){if("move"===a.dataTransfer.effectAllowed)return!1;a.stopPropagation(),a.preventDefault();var b=a.target,c=a.dataTransfer.files[0],d=a.dataTransfer.getData("Text"),e=new FileReader,f="",g=0,h=20480,i=function(){f.length>1e5&&this.app.autoBake_&&(this.manager.controls.setAutoBake(!1),this.app.alert("Turned off Auto Bake as the input is large","warning",5e3)),this.set(f);var a=this.app.getRecipeConfig();a[0]&&"From Hex"===a[0].op||(a.unshift({op:"From Hex",args:["Space"]}),this.app.setRecipeConfig(a)),b.classList.remove("loadingFile")}.bind(this),j=function(){if(g>=c.size)return void i();b.value="Processing... "+Math.round(g/c.size*100)+"%";var a=c.slice(g,g+h);e.readAsArrayBuffer(a)};e.onload=function(a){var b=new Uint8Array(e.result);f+=Utils.toHexFast(b),g+=h,j()},b.classList.remove("dropping-file"),c?(b.classList.add("loadingFile"),j()):d&&this.set(d)},InputWaiter.prototype.clearIoClick=function(){this.manager.highlighter.removeHighlights(),document.getElementById("input-text").value="",document.getElementById("output-text").value="",document.getElementById("input-info").innerHTML="",document.getElementById("output-info").innerHTML="",document.getElementById("input-selection-info").innerHTML="",document.getElementById("output-selection-info").innerHTML="",window.dispatchEvent(this.manager.statechange)};var Manager=function(a){this.app=a,this.appstart=new CustomEvent("appstart",{bubbles:!0}),this.operationadd=new CustomEvent("operationadd",{bubbles:!0}),this.operationremove=new CustomEvent("operationremove",{bubbles:!0}),this.oplistcreate=new CustomEvent("oplistcreate",{bubbles:!0}),this.statechange=new CustomEvent("statechange",{bubbles:!0}),this.window=new WindowWaiter(this.app),this.controls=new ControlsWaiter(this.app,this),this.recipe=new RecipeWaiter(this.app,this),this.ops=new OperationsWaiter(this.app,this),this.input=new InputWaiter(this.app,this),this.output=new OutputWaiter(this.app,this),this.options=new OptionsWaiter(this.app),this.highlighter=new HighlighterWaiter(this.app),this.seasonal=new SeasonalWaiter(this.app,this),this.dynamicHandlers={},this.initialiseEventListeners()};Manager.prototype.setup=function(){this.recipe.initialiseOperationDragNDrop(),this.controls.autoBakeChange(),this.seasonal.load()},Manager.prototype.initialiseEventListeners=function(){window.addEventListener("resize",this.window.windowResize.bind(this.window)),window.addEventListener("blur",this.window.windowBlur.bind(this.window)),window.addEventListener("focus",this.window.windowFocus.bind(this.window)),window.addEventListener("statechange",this.app.stateChange.bind(this.app)),window.addEventListener("popstate",this.app.popState.bind(this.app)),document.getElementById("bake").addEventListener("click",this.controls.bakeClick.bind(this.controls)),document.getElementById("auto-bake").addEventListener("change",this.controls.autoBakeChange.bind(this.controls)),document.getElementById("step").addEventListener("click",this.controls.stepClick.bind(this.controls)),document.getElementById("clr-recipe").addEventListener("click",this.controls.clearRecipeClick.bind(this.controls)),document.getElementById("clr-breaks").addEventListener("click",this.controls.clearBreaksClick.bind(this.controls)),document.getElementById("save").addEventListener("click",this.controls.saveClick.bind(this.controls)),document.getElementById("save-button").addEventListener("click",this.controls.saveButtonClick.bind(this.controls)),document.getElementById("save-link-recipe-checkbox").addEventListener("change",this.controls.slrCheckChange.bind(this.controls)),document.getElementById("save-link-input-checkbox").addEventListener("change",this.controls.sliCheckChange.bind(this.controls)),document.getElementById("load").addEventListener("click",this.controls.loadClick.bind(this.controls)),document.getElementById("load-delete-button").addEventListener("click",this.controls.loadDeleteClick.bind(this.controls)),document.getElementById("load-name").addEventListener("change",this.controls.loadNameChange.bind(this.controls)),document.getElementById("load-button").addEventListener("click",this.controls.loadButtonClick.bind(this.controls)),document.getElementById("support").addEventListener("click",this.controls.supportButtonClick.bind(this.controls)),this.addMultiEventListener("#save-text","keyup paste",this.controls.saveTextChange,this.controls),this.addMultiEventListener("#search","keyup paste search",this.ops.searchOperations,this.ops),this.addDynamicListener(".op-list li.operation","dblclick",this.ops.operationDblclick,this.ops),document.getElementById("edit-favourites").addEventListener("click",this.ops.editFavouritesClick.bind(this.ops)),document.getElementById("save-favourites").addEventListener("click",this.ops.saveFavouritesClick.bind(this.ops)),document.getElementById("reset-favourites").addEventListener("click",this.ops.resetFavouritesClick.bind(this.ops)),this.addDynamicListener(".op-list .op-icon","mouseover",this.ops.opIconMouseover,this.ops),this.addDynamicListener(".op-list .op-icon","mouseleave",this.ops.opIconMouseleave,this.ops),this.addDynamicListener(".op-list","oplistcreate",this.ops.opListCreate,this.ops),this.addDynamicListener("li.operation","operationadd",this.recipe.opAdd.bind(this.recipe)),this.addDynamicListener(".arg","keyup",this.recipe.ingChange,this.recipe),this.addDynamicListener(".arg","change",this.recipe.ingChange,this.recipe),this.addDynamicListener(".disable-icon","click",this.recipe.disableClick,this.recipe),this.addDynamicListener(".breakpoint","click",this.recipe.breakpointClick,this.recipe),this.addDynamicListener("#rec-list li.operation","dblclick",this.recipe.operationDblclick,this.recipe),this.addDynamicListener("#rec-list li.operation > div","dblclick",this.recipe.operationChildDblclick,this.recipe),this.addDynamicListener("#rec-list .input-group .dropdown-menu a","click",this.recipe.dropdownToggleClick,this.recipe),this.addDynamicListener("#rec-list","operationremove",this.recipe.opRemove.bind(this.recipe)),this.addMultiEventListener("#input-text","keyup paste",this.input.inputChange,this.input),document.getElementById("reset-layout").addEventListener("click",this.app.resetLayout.bind(this.app)),document.getElementById("clr-io").addEventListener("click",this.input.clearIoClick.bind(this.input)),document.getElementById("input-text").addEventListener("dragover",this.input.inputDragover.bind(this.input)),document.getElementById("input-text").addEventListener("dragleave",this.input.inputDragleave.bind(this.input)),document.getElementById("input-text").addEventListener("drop",this.input.inputDrop.bind(this.input)),document.getElementById("input-text").addEventListener("scroll",this.highlighter.inputScroll.bind(this.highlighter)),document.getElementById("input-text").addEventListener("mouseup",this.highlighter.inputMouseup.bind(this.highlighter)),document.getElementById("input-text").addEventListener("mousemove",this.highlighter.inputMousemove.bind(this.highlighter)),this.addMultiEventListener("#input-text","mousedown dblclick select",this.highlighter.inputMousedown,this.highlighter),document.getElementById("save-to-file").addEventListener("click",this.output.saveClick.bind(this.output)),document.getElementById("switch").addEventListener("click",this.output.switchClick.bind(this.output)),document.getElementById("undo-switch").addEventListener("click",this.output.undoSwitchClick.bind(this.output)),document.getElementById("maximise-output").addEventListener("click",this.output.maximiseOutputClick.bind(this.output)),document.getElementById("output-text").addEventListener("scroll",this.highlighter.outputScroll.bind(this.highlighter)),document.getElementById("output-text").addEventListener("mouseup",this.highlighter.outputMouseup.bind(this.highlighter)),document.getElementById("output-text").addEventListener("mousemove",this.highlighter.outputMousemove.bind(this.highlighter)),document.getElementById("output-html").addEventListener("mouseup",this.highlighter.outputHtmlMouseup.bind(this.highlighter)),document.getElementById("output-html").addEventListener("mousemove",this.highlighter.outputHtmlMousemove.bind(this.highlighter)),this.addMultiEventListener("#output-text","mousedown dblclick select",this.highlighter.outputMousedown,this.highlighter),this.addMultiEventListener("#output-html","mousedown dblclick select",this.highlighter.outputHtmlMousedown,this.highlighter),document.getElementById("options").addEventListener("click",this.options.optionsClick.bind(this.options)),document.getElementById("reset-options").addEventListener("click",this.options.resetOptionsClick.bind(this.options)),$(document).on("switchChange.bootstrapSwitch",".option-item input:checkbox",this.options.switchChange.bind(this.options)),$(document).on("switchChange.bootstrapSwitch",".option-item input:checkbox",this.options.setWordWrap.bind(this.options)),this.addDynamicListener(".option-item input[type=number]","keyup",this.options.numberChange,this.options),this.addDynamicListener(".option-item input[type=number]","change",this.options.numberChange,this.options),this.addDynamicListener(".option-item select","change",this.options.selectChange,this.options),document.getElementById("alert-close").addEventListener("click",this.app.alertCloseClick.bind(this.app))},Manager.prototype.addListeners=function(a,b,c,d){d=d||this,[].forEach.call(document.querySelectorAll(a),function(a){a.addEventListener(b,c.bind(d))})},Manager.prototype.addMultiEventListener=function(a,b,c,d){for(var e=b.split(" "),f=0;f-1&&(this.manager.recipe.addOperation(b[c].innerHTML),this.app.autoBake()))),13===a.keyCode)a.preventDefault();else if(40===a.keyCode)a.preventDefault(),b=document.querySelectorAll("#search-results li"),b.length&&(c=this.getSelectedOp(b),c>-1&&b[c].classList.remove("selected-op"),c===b.length-1&&(c=-1),b[c+1].classList.add("selected-op"));else if(38===a.keyCode)a.preventDefault(),b=document.querySelectorAll("#search-results li"),b.length&&(c=this.getSelectedOp(b),c>-1&&b[c].classList.remove("selected-op"),0===c&&(c=b.length),b[c-1].classList.add("selected-op"));else{for(var d=document.getElementById("search-results"),e=a.target,f=e.value;d.firstChild;)$(d.firstChild).popover("destroy"),d.removeChild(d.firstChild);if($("#categories .in").collapse("hide"),f){for(var g=this.filterOperations(f,!0),h="",i=0;i=0||h>=0){var i=new HTMLOperation(e,this.app.operations[e],this.app,this.manager);b&&i.highlightSearchString(a,g,h),g<0?c.push(i):d.push(i)}}return d.concat(c)},OperationsWaiter.prototype.getSelectedOp=function(a){for(var b=0;blength: "+e+"
                  lines: "+f,document.getElementById("input-selection-info").innerHTML="",document.getElementById("output-selection-info").innerHTML=""},OutputWaiter.prototype.adjustWidth=function(){var a=document.getElementById("output"),b=document.getElementById("save-to-file"),c=document.getElementById("switch"),d=document.getElementById("undo-switch"),e=document.getElementById("maximise-output");a.clientWidth<680?(b.childNodes[1].nodeValue="",c.childNodes[1].nodeValue="",d.childNodes[1].nodeValue="",e.childNodes[1].nodeValue=""):(b.childNodes[1].nodeValue=" Save to file",c.childNodes[1].nodeValue=" Move output to input",d.childNodes[1].nodeValue=" Undo",e.childNodes[1].nodeValue="Maximise"===e.getAttribute("title")?" Max":" Restore")},OutputWaiter.prototype.saveClick=function(){var a=Utils.toBase64(this.app.dishStr),b=window.prompt("Please enter a filename:","download.dat");if(b){var c=document.createElement("a");c.setAttribute("href","data:application/octet-stream;base64;charset=utf-8,"+a),c.setAttribute("download",b),c.style.display="none",document.body.appendChild(c),c.click(),c.remove()}},OutputWaiter.prototype.switchClick=function(){this.switchOrigData=this.manager.input.get(),document.getElementById("undo-switch").disabled=!1,this.app.setInput(this.app.dishStr)},OutputWaiter.prototype.undoSwitchClick=function(){this.app.setInput(this.switchOrigData),document.getElementById("undo-switch").disabled=!0},OutputWaiter.prototype.maximiseOutputClick=function(a){var b="maximise-output"===a.target.id?a.target:a.target.parentNode;"Maximise"===b.getAttribute("title")?(this.app.columnSplitter.collapse(0),this.app.columnSplitter.collapse(1),this.app.ioSplitter.collapse(0),b.setAttribute("title","Restore"),b.innerHTML=" Restore",this.adjustWidth()):(b.setAttribute("title","Maximise"),b.innerHTML=" Max",this.app.resetLayout())};var RecipeWaiter=function(a,b){this.app=a,this.manager=b,this.removeIntent=!1};RecipeWaiter.prototype.initialiseOperationDragNDrop=function(){var a=document.getElementById("rec-list");Sortable.create(a,{group:"recipe",sort:!0,animation:0,delay:0,filter:".arg-input,.arg",setData:function(a,b){a.setData("Text",b.querySelector(".arg-title").textContent)},onEnd:function(a){this.removeIntent&&(a.item.remove(),a.target.dispatchEvent(this.manager.operationremove))}.bind(this)}),Sortable.utils.on(a,"dragover",function(){this.removeIntent=!1}.bind(this)),Sortable.utils.on(a,"dragleave",function(){this.removeIntent=!0,this.app.progress=0}.bind(this)),Sortable.utils.on(a,"touchend",function(b){var c=b.changedTouches[0],d=document.elementFromPoint(c.clientX,c.clientY);this.removeIntent=!a.contains(d)}.bind(this)),document.querySelector("#categories a").addEventListener("dragover",this.favDragover.bind(this)),document.querySelector("#categories a").addEventListener("dragleave",this.favDragleave.bind(this)),document.querySelector("#categories a").addEventListener("drop",this.favDrop.bind(this))},RecipeWaiter.prototype.createSortableSeedList=function(a){Sortable.create(a,{group:{name:"recipe",pull:"clone",put:!1},sort:!1,setData:function(a,b){a.setData("Text",b.textContent)},onStart:function(a){$(a.item).popover("destroy"),a.item.setAttribute("data-toggle","popover-disabled")},onEnd:this.opSortEnd.bind(this)})},RecipeWaiter.prototype.opSortEnd=function(a){return this.removeIntent?void("rec-list"===a.item.parentNode.id&&a.item.remove()):($(a.clone).popover(),$(a.clone).children("[data-toggle=popover]").popover(),void("rec-list"===a.item.parentNode.id&&(this.buildRecipeOperation(a.item),a.item.dispatchEvent(this.manager.operationadd))))},RecipeWaiter.prototype.favDragover=function(a){return"move"===a.dataTransfer.effectAllowed&&(a.stopPropagation(),a.preventDefault(),void(a.target.className&&a.target.className.indexOf("category-title")>-1?a.target.classList.add("favourites-hover"):a.target.parentNode.className&&a.target.parentNode.className.indexOf("category-title")>-1?a.target.parentNode.classList.add("favourites-hover"):a.target.parentNode.parentNode.className&&a.target.parentNode.parentNode.className.indexOf("category-title")>-1&&a.target.parentNode.parentNode.classList.add("favourites-hover")))},RecipeWaiter.prototype.favDragleave=function(a){a.stopPropagation(),a.preventDefault(),document.querySelector("#categories a").classList.remove("favourites-hover")},RecipeWaiter.prototype.favDrop=function(a){a.stopPropagation(),a.preventDefault(),a.target.classList.remove("favourites-hover");var b=a.dataTransfer.getData("Text");this.app.addFavourite(b)},RecipeWaiter.prototype.ingChange=function(){window.dispatchEvent(this.manager.statechange)},RecipeWaiter.prototype.disableClick=function(a){var b=a.target;"false"===b.getAttribute("disabled")?(b.setAttribute("disabled","true"),b.classList.add("disable-icon-selected"),b.parentNode.parentNode.classList.add("disabled")):(b.setAttribute("disabled","false"),b.classList.remove("disable-icon-selected"),b.parentNode.parentNode.classList.remove("disabled")),this.app.progress=0,window.dispatchEvent(this.manager.statechange)},RecipeWaiter.prototype.breakpointClick=function(a){var b=a.target;"false"===b.getAttribute("break")?(b.setAttribute("break","true"),b.classList.add("breakpoint-selected")):(b.setAttribute("break","false"),b.classList.remove("breakpoint-selected")),window.dispatchEvent(this.manager.statechange)},RecipeWaiter.prototype.operationDblclick=function(a){a.target.remove(),window.dispatchEvent(this.manager.statechange)},RecipeWaiter.prototype.operationChildDblclick=function(a){a.target.parentNode.remove(),window.dispatchEvent(this.manager.statechange)},RecipeWaiter.prototype.getConfig=function(){for(var a,b,c,d,e,f=[],g=document.querySelectorAll("#rec-list li.operation"),h=0;h",this.ingChange()},RecipeWaiter.prototype.opAdd=function(a){window.dispatchEvent(this.manager.statechange)},RecipeWaiter.prototype.opRemove=function(a){window.dispatchEvent(this.manager.statechange)};var SeasonalWaiter=function(a,b){this.app=a,this.manager=b};SeasonalWaiter.prototype.load=function(){var a=new Date;11===a.getMonth()&&a.getDate()>12&&(this.app.options.snow=!1,this.createSnowOption(),$(document).on("switchChange.bootstrapSwitch",".option-item input:checkbox[option='snow']",this.letItSnow.bind(this)),window.addEventListener("resize",this.letItSnow.bind(this)),this.manager.addListeners(".btn","click",this.shakeOffSnow,this),25===a.getDate()&&this.letItSnow()),this.kkeys=[],window.addEventListener("keydown",this.konamiCodeListener.bind(this))},SeasonalWaiter.prototype.insertSpiderIcons=function(){var a="iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAB3UlEQVQ4y2NgGJaAmYGBgVnf0oKJgYGBobWtXamqqoYTn2I4CI+LTzM2NTulpKbu+vPHz2dV5RWlluZmi3j5+KqFJSSEzpw8uQPdAEYYIzo5Kfjrl28rWFlZzjAzMYuEBQao3Lh+g+HGvbsMzExMDN++fWf4/PXLBzY2tqYNK1f2+4eHM2xcuRLigsT09Igf3384MTExbf767etBI319jU8fP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I5rT0M+gSf3y9K5LIA1LUEIlL1k0AhCYBH5r9TCqBqib4D+c/1PyInGOThkvuaHCYALhlpbQWBMGR/4IpzTqlpbKQyf0045vdoe0zATHagSYMeWFMkbscnHRYPZjoFJaIiUkz9EJy15j/X3qCsAIqMcFjSWrNE1Iygg0fEmrtLzEUTdT/OhBFht9fHDVCbEUt3LJxi08B8Xj6vTDESriq9lVWqBECgHujqiqAUmufb1X3cfRXoluhjZWiwkOnSUcUS6ZD8LUmmhks6b5j1ezkAkAKZBe5QvPPcNBnoCawMwT66Qxk0R2xwwRAui2iSDGuaPDcubzo3EJq8wcx/9Vmk3QryH42QBQCFF0UagIiJtjX6DskIXTLEucJSHIIIMuO0BOcjn3A3ybU/lu5RCUBc5qA0Ih0Q2EWiCPRk7VfMNhjLW1zETic1tLYZDMKyuSsdfh5l6bwho5+0il4kyA0VohlNcF5FP8DlWo/VB16HYB2hJ0pzgIe2mcXxP2IOumPRY17U0tll8KIkZNb+sppafOxYkQPSaYfchyYoL9GMqWYpTLRIq1QUcT4O3aPQgqVqPwIOIMwDhzX6mQUFIQAgo+9MzcrWrML3mj6+YIKiFCZyhL87RqVQKrEskF+P1BUvfLCAkfRwoPUtq6l5o5+lZb5SolJo6oT8avTCl+c9OTmat6pKW8mLkvBpGzlvsiGuQr4ZEEwA1EQgoR/gNtxIxKBluz+OtMJiF31jHxqXBiAqAUj4WRxpADFM0DCFlv1khvX7Wol4vF4AIldVVxdZqlrIfiCYQPHDy6bAGv7nKYRVY6JewExZVAP+ey5Rv+Ba97aaUHMW5NauLmMZFkegBb/EP14d6NoS9QLWFSzWBmuZza8CQmSpXsAqmGtVy14VALWuuYWWy+W3OteXa4jwceQX6+BKG6J1/8+2VCNkm2222WabbbbZZpttttlmm22rt38DCdA0vq3bcAkAAAAASUVORK5CYII="; +document.querySelector("link[rel=icon]").setAttribute("href","data:image/png;base64,"+a),document.querySelector("#bake img").setAttribute("src","data:image/png;base64,"+b),document.querySelector(".about-img-left").setAttribute("src","data:image/png;base64,"+c)},SeasonalWaiter.prototype.insertSpiderText=function(){document.title=document.title.replace(/Cyber/g,"Spider"),SeasonalWaiter.treeWalk(document.body,function(a){3===a.nodeType&&(a.nodeValue=a.nodeValue.replace(/Cyber/g,"Spider"))},!0),SeasonalWaiter.treeWalk(document.getElementById("bake-group"),function(a){3===a.nodeType&&(a.nodeValue=a.nodeValue.replace(/Bake/g,"Spin"))},!0),document.querySelector("#recipe .title").innerHTML="Web"},SeasonalWaiter.prototype.createSnowOption=function(){var a=document.getElementById("options-body"),b=document.createElement("div");b.className="option-item",b.innerHTML=" Let it snow",a.appendChild(b),this.manager.options.load()},SeasonalWaiter.prototype.letItSnow=function(){if($(document).snowfall("clear"),this.app.options.snow){var a={},b=navigator.userAgent.match(/Firefox\/(\d\d?)/);a=b&&parseInt(b[1],10)<30?{flakeCount:10,flakeColor:"#fff",flakePosition:"absolute",minSize:1,maxSize:2,minSpeed:1,maxSpeed:5,round:!1,shadow:!1,collection:!1,collectionHeight:20,deviceorientation:!0}:{flakeCount:35,flakeColor:"#fff",flakePosition:"absolute",minSize:5,maxSize:8,minSpeed:1,maxSpeed:5,round:!0,shadow:!0,collection:".btn",collectionHeight:20,deviceorientation:!0},$(document).snowfall(a)}},SeasonalWaiter.prototype.shakeOffSnow=function(a){for(var b=a.target,c=b.getBoundingClientRect(),d=document.querySelectorAll("canvas.snowfall-canvas"),e=null,f=function(){h.clearRect(0,0,e.width,e.height),$(this).fadeIn()},g=0;g6e4&&this.app.silentBake()};var main=function(){var a=["To Base64","From Base64","To Hex","From Hex","To Hexdump","From Hexdump","URL Decode","Regular expression","Entropy","Fork"],b={updateUrl:!0,showHighlighter:!0,treatAsUtf8:!0,wordWrap:!0,showErrors:!0,errorTimeout:4e3,autoBakeThreshold:200,attemptHighlight:!0,snow:!1};document.removeEventListener("DOMContentLoaded",main,!1),window.app=new HTMLApp(Categories,OperationConfig,a,b),window.app.setup()};window.console=console||{log:function(){},error:function(){}},window.compileTime=moment.tz("07/02/2017 20:29:54 UTC","DD/MM/YYYY HH:mm:ss z","UTC").valueOf(),window.compileMessage="",document.addEventListener("DOMContentLoaded",main,!1); \ No newline at end of file diff --git a/src/html/index.html b/src/html/index.html index 79ba4923..794e7dd2 100755 --- a/src/html/index.html +++ b/src/html/index.html @@ -274,7 +274,7 @@
                  +
                  +
                  +

                  If you find a bug in CyberChef, please raise an issue in our GitHub repository explaining it in as much detail as possible. Copy and include the following information if relevant.

                  +
                  +
                  
                  +                                    
                  + Raise issue on GitHub +

                  If you're a nerd like me, you might find statistics really fun! Here's some about the CyberChef code base:

                  diff --git a/src/js/.eslintrc.json b/src/js/.eslintrc.json index 1128f36b..651d5f48 100755 --- a/src/js/.eslintrc.json +++ b/src/js/.eslintrc.json @@ -62,7 +62,15 @@ "properties": "always" }], "semi": ["error", "always"], - "unicode-bom": "error" + "unicode-bom": "error", + "require-jsdoc": ["error", { + "require": { + "FunctionDeclaration": true, + "MethodDefinition": true, + "ClassDeclaration": true, + "ArrowFunctionExpression": true + } + }] }, "globals": { /* core/* */ diff --git a/src/js/operations/Code.js b/src/js/operations/Code.js index 807ec64d..f71578f9 100755 --- a/src/js/operations/Code.js +++ b/src/js/operations/Code.js @@ -296,6 +296,9 @@ var Code = { return code; + /** + * Replaces a matched token with a placeholder value. + */ function preserveToken(str, match, t) { preservedTokens[t] = match[0]; return str.substring(0, match.index) + diff --git a/src/js/operations/IP.js b/src/js/operations/IP.js index 744adf49..02e7fe9c 100755 --- a/src/js/operations/IP.js +++ b/src/js/operations/IP.js @@ -639,6 +639,9 @@ var IP = { return result; + /** + * Converts a list of 4 numeric strings in the range 0-255 to a list of numbers. + */ function parseBlocks(blocks) { if (blocks.length !== 4) throw "More than 4 blocks."; @@ -703,6 +706,9 @@ var IP = { } return ipv6; + /** + * Converts a list of 3-8 numeric hex strings in the range 0-65535 to a list of numbers. + */ function parseBlocks(blocks) { if (blocks.length < 3 || blocks.length > 8) throw "Badly formatted IPv6 address."; diff --git a/src/js/views/html/ControlsWaiter.js b/src/js/views/html/ControlsWaiter.js index aefa4292..2c67927f 100755 --- a/src/js/views/html/ControlsWaiter.js +++ b/src/js/views/html/ControlsWaiter.js @@ -1,3 +1,5 @@ +/* globals moment */ + /** * Waiter to handle events related to the CyberChef controls (i.e. Bake, Step, Save, Load etc.) * @@ -154,12 +156,13 @@ ControlsWaiter.prototype.initialiseSaveLink = function(recipeConfig) { * @param {boolean} includeRecipe - Whether to include the recipe in the URL. * @param {boolean} includeInput - Whether to include the input in the URL. * @param {Object[]} [recipeConfig] - The recipe configuration object array. + * @param {string} [baseURL] - The CyberChef URL, set to the current URL if not included * @returns {string} */ -ControlsWaiter.prototype.generateStateUrl = function(includeRecipe, includeInput, recipeConfig) { +ControlsWaiter.prototype.generateStateUrl = function(includeRecipe, includeInput, recipeConfig, baseURL) { recipeConfig = recipeConfig || this.app.getRecipeConfig(); - var link = window.location.protocol + "//" + + var link = baseURL || window.location.protocol + "//" + window.location.host + window.location.pathname, recipeStr = JSON.stringify(recipeConfig), @@ -337,3 +340,16 @@ ControlsWaiter.prototype.loadButtonClick = function() { this.app.alert("Invalid recipe", "danger", 2000); } }; + + +/** + * Populates the bug report information box with useful technical info. + */ +ControlsWaiter.prototype.supportButtonClick = function() { + var reportBugInfo = document.getElementById("report-bug-info"), + saveLink = this.generateStateUrl(true, true, null, "https://gchq.github.io/CyberChef/"); + + reportBugInfo.innerHTML = "* CyberChef compile time: <%= compileTime %>\n" + + "* User-Agent: \n" + navigator.userAgent + "\n" + + "* [Link to reproduce](" + saveLink + ")\n\n"; +}; diff --git a/src/js/views/html/Manager.js b/src/js/views/html/Manager.js index 90a9b4cc..d8f8d284 100755 --- a/src/js/views/html/Manager.js +++ b/src/js/views/html/Manager.js @@ -86,6 +86,7 @@ Manager.prototype.initialiseEventListeners = function() { document.getElementById("load-delete-button").addEventListener("click", this.controls.loadDeleteClick.bind(this.controls)); document.getElementById("load-name").addEventListener("change", this.controls.loadNameChange.bind(this.controls)); document.getElementById("load-button").addEventListener("click", this.controls.loadButtonClick.bind(this.controls)); + document.getElementById("support").addEventListener("click", this.controls.supportButtonClick.bind(this.controls)); this.addMultiEventListener("#save-text", "keyup paste", this.controls.saveTextChange, this.controls); // Operations diff --git a/src/js/views/html/main.js b/src/js/views/html/main.js index dbe6e342..df175e67 100755 --- a/src/js/views/html/main.js +++ b/src/js/views/html/main.js @@ -43,7 +43,7 @@ var main = function() { // Fix issues with browsers that don't support console.log() window.console = console || {log: function() {}, error: function() {}}; -window.compileTime = moment.tz("<%= grunt.template.today() %>", "ddd MMM D YYYY HH:mm:ss", "UTC").valueOf(); +window.compileTime = moment.tz("<%= compileTime %>", "DD/MM/YYYY HH:mm:ss z", "UTC").valueOf(); window.compileMessage = "<%= compileMsg %>"; document.addEventListener("DOMContentLoaded", main, false); diff --git a/src/static/stats.txt b/src/static/stats.txt index 6b1374a4..8ef4e091 100644 --- a/src/static/stats.txt +++ b/src/static/stats.txt @@ -1,9 +1,9 @@ 212 source files -115060 lines +115106 lines 4.3M size 142 JavaScript source files -105900 lines +105926 lines 3.8M size 83 third party JavaScript source files @@ -11,10 +11,10 @@ 3.0M size 59 first party JavaScript source files -19642 lines +19668 lines 740K size -3.4M uncompressed JavaScript size +3.5M uncompressed JavaScript size 1.9M compressed JavaScript size 15 categories From b8b51e04bbf384a393c4d12d87da0986cde303f8 Mon Sep 17 00:00:00 2001 From: n1474335 Date: Tue, 7 Feb 2017 20:30:44 +0000 Subject: [PATCH 4/7] Updated ISSUE_TEMPLATE.md --- .github/ISSUE_TEMPLATE.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index bce403ba..9e029351 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -20,5 +20,6 @@ ### Environment -* Compile date: +* CyberChef compile time: * User-Agent: +* [Link to reproduce]() From 2750be36da29f97ed680b5e3b60d1b1b8c3fb2f5 Mon Sep 17 00:00:00 2001 From: Matt C Date: Wed, 8 Feb 2017 11:51:37 +0000 Subject: [PATCH 5/7] Adds Affine/Atbash Cipher encryption/decryption - 3 new operations - Affine Encode, Decode and Atbash Cipher - Added 3 new utils - mod, GCD and modInv --- build/prod/cyberchef.htm | 24 +++---- build/prod/index.html | 2 +- build/prod/scripts.js | 20 +++--- src/js/config/Categories.js | 3 + src/js/config/OperationConfig.js | 69 ++++++++++++++++--- src/js/core/Utils.js | 114 +++++++++++++++++++------------ src/js/operations/Cipher.js | 84 ++++++++++++++++++++++- src/static/stats.txt | 14 ++-- 8 files changed, 247 insertions(+), 83 deletions(-) diff --git a/build/prod/cyberchef.htm b/build/prod/cyberchef.htm index 1aaad02b..b665e5b9 100755 --- a/build/prod/cyberchef.htm +++ b/build/prod/cyberchef.htm @@ -85,11 +85,11 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -*/.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.clo,.opn,.pun{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.kwd,.tag,.typ{font-weight:700}.str{color:#060}.kwd{color:#006}.com{color:#600;font-style:italic}.typ{color:#404}.lit{color:#044}.clo,.opn,.pun{color:#440}.tag{color:#006}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}#content-wrapper{top:0;left:0;width:100%;height:100%}#banner{height:30px;width:100%;text-align:center;line-height:30px}#wrapper{top:30px;bottom:0;width:100%}div#operations,div#recipe{width:50%;height:100%}div#input,div#output{width:100%;height:50%}.title{padding:10px;height:43px}.textarea-wrapper{top:43px;bottom:0;width:100%;overflow:hidden}#output-html,textarea{width:100%;height:100%;border:none;padding:3px;-moz-padding-start:3px;-moz-padding-end:3px}#input-text,#output-html,#output-text{position:relative;border-width:0;margin:0;resize:none;background-color:transparent;white-space:pre-wrap;word-wrap:break-word}#output-html{display:none;overflow-y:auto;-moz-padding-start:1px}.split{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;overflow:auto;position:relative}.gutter.gutter-horizontal,.split.split-horizontal{height:100%;float:left}#input-highlighter,#output-highlighter{position:absolute;left:0;top:0;width:100%;height:100%;padding:3px;margin:0;overflow:hidden;letter-spacing:normal;white-space:pre-wrap;word-wrap:break-word;color:#fff;background-color:transparent;border:none}#op-list,#rec-list,.op-list{margin:0;padding:0;list-style-type:none}#op-list,#rec-list{position:absolute;top:43px;bottom:0;width:100%}.io-btn-group,.io-info{margin-top:-4px;float:right}#rec-list{bottom:120px;overflow:auto}.operation{cursor:pointer;padding:10px;list-style-type:none;position:relative}#controls{position:absolute;width:100%;height:120px;bottom:0;padding:10px}.io-info{margin-right:20px;height:30px;text-align:right;line-height:10px}.arg-group,.inline-args input[type=checkbox]{margin-top:10px}#input-info{line-height:15px}.arg-group{display:table;width:100%}.arg-group-text{display:block}.inline-args{float:left;width:auto;margin-right:30px;height:34px}.inline-args input[type=number]{width:100px}.arg-input{display:table-cell;width:100%;padding:6px 12px}.short-string{width:150px}select{display:block}.arg[disabled]{cursor:not-allowed;opacity:1}textarea.arg{width:100%;min-height:50px;height:70px;margin-top:5px;border:1px solid #ddd;resize:vertical}.arg-label{display:table-cell;width:1px;padding-right:10px;font-weight:400;white-space:pre}.title,optgroup{font-weight:700}.editable-option{position:relative;display:inline-block}.editable-option-input{position:absolute;top:1px;left:1px;width:calc(100% - 20px);height:calc(100% - 2px)!important;border:none!important}#operational-controls{width:65%;float:left;text-align:center}#bake-group{display:table;width:100%}#bake{display:table-cell;width:100%;border-top-right-radius:0;border-bottom-right-radius:0}#auto-bake-label{display:table-cell;padding:1px;line-height:1.35;width:60px;border-top-left-radius:0;border-bottom-left-radius:0;border-left:1px solid #5cb85c}#auto-bake-label:hover{border-left-color:#398439}#auto-bake-label div{font-size:10px;padding:2px}#extra-controls{float:right;width:35%;padding-left:10px}.op-icon{float:right;margin-left:10px;margin-top:3px}.recip-icons{position:absolute;top:13px;right:10px;height:16px}.recip-icon{margin-right:10px;vertical-align:baseline;float:right}.disable-icon{width:16px;height:16px;margin-top:-1px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAACfElEQVQ4y6WTPWgTYRjHf8nlfVvuoDVIP4Yuki4WHKoUqggFRUTsUEGkVG2hmCq6OnTwIxYHB+eijZOKdLNDW1pKKyGigh8dBHUJElxyBgx3vEnukvdyDrUhRXDxGR+e/+/583xEwjDkfyIGwNVTzURm4tYAMA6MAoN/0tvAMrA48uL+l2bx4w0iYRjSuHKC6OnTZLqHk8CcaZq9bW1tSCkBqNVq+L5PpVIpAHdGfr5LN9bXiT7Z2nGgteb1/qFkLBJZ6OjowHEc8vk8pVIJgHg8TldXF52dnb2u6y5s7R/iuF5JSyAKkLl4eyAMwznLsrBtm1wu99Z13amk+BFJih8R13WXANrb27EsizAM5zIXbw+wC9Baj0spe5VSFAqFt4ZhXJ6ufXuK55E5cDKVSCTGenp6yGazKKWQUvZqrcebgCAIRqWUOI6DEOLR1K8POapVMgfPpoC7u2LLspYcx0FKSRAEo60OBg3DwPd9Jr5vPqWvj8zh83vEwL2J75vnfN/HMAy01oPNNQZBQBAEO1OvVsl0D/8lTuZfpYDd7gRBQKuD7XK5jGmarB679PIv8deVFJUKq8cuTZqmSblcRmu93QpYVkohhMCyrLE94n2/UlSrbJy5kRBCXBNCoJRCa73cClh0XbfgeR6WZZHNZunv719KvnmeYnWVVxdmJ2Ox2DMhxFHP83Bdt6C1XgR2LvHzQDvvb84npZQL8Xgc0zSJRqN7br7RaFCpVCiVStRqtZmhh9fTh754TQdMr82nPc+bsW27UCwWUUpRr9ep1+sopSgWi9i2XfA8b2Z6bT6ttabp4GMi0uz0aXbhn890+MFM85mO5MIdwP/Eb1pMUCdctYRzAAAAAElFTkSuQmCC) no-repeat}.disable-icon-selected{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACFUlEQVR4XqWTP0tbURjGn9zY3mjBwsUhBQtS6XKxiNypIGZJ6SKYUYdaKWg7OrrE3pYO+Qit3dpFuuQO6lI7Z4nESQdjlJbkJh0MksSb3Jvk9H0gjZFu9YWH83LO7zn/3nNCSincJobAeP1sEDBFi6J50UyPy4l2RNuioz756Ts0tt1OB4jH2a52Ne2HGh9PwrJm2EcxZx/HyPRYMDgB2u02/N3d1c7w8BZMM1ptNJBPp3GwsUExB/s4RoYsPf0JOkFgdoH34YkJ/D48xC/HyTTOzl5ayWSIktwxqlVo0SjIkKWnP0Hg+4swjGitVMJFNpu5o+svptfXv6DZBDIZezoWS3Db3A0ZsvRcH8H354dGR9EoFHA3EvlorqycwvOAXM4G8Pav+f7YmEOGLD1gsIzl54+V+vBK/Yw9ZAv1LQW1FrdFSnKVfQTK5liPUfRI9I8ArqiPjLAF9vcHVybyzlpasgcZeq7voNXKNSsV3DMMXB4fp/8xLyzYuLri2DIZsvQM3sFOzXURiUR4zsQNcyrFleFVKpNyP2/IkKVnsArbF65bbkqplJSJZrl5x5qbs7G3h3artSyV+arr+lMyZOnpP2Wp6ZFos3R+vvUgCGDNzgKalkA4rECIr07662J2i0X4nrfJJ33jJT6Zmvpcr9XWCicn5WI+j7rrAmKgmLOPY2TI0sPgb8TBZOi/PpN1qnDr7/wH3jxgB/FKIXkAAAAASUVORK5CYII=) no-repeat}.breakpoint{float:right;width:14px;height:14px;background-color:#eee;border:1px solid #aaa}.breakpoint-selected{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAXVBMVEXIUkvzUVHzTEzzn5785eXrbW24BgbzWVnze3vzVVXzY2Pyion509PzbW3zXV1UMxj0l5f1srKbRTRgOxzJDg796ur74ODfIyP5zs6LLx3pNTXYGxuxdkVZNhn////sCC1eAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsTAQCanBgAAABWSURBVBjTnc+7EoAgDERRTOQVxMEZFAf//z8FjAUFDbfb060QU2FwxngimxnCea3bjegSgz+0tguAfBgIy64QGfZQdg91dgAtqUZgnfz6IacYVWvu2AvR4wNAv0nxrAAAAABJRU5ErkJggg==) -2px -2px no-repeat #eee}.banner-right{float:right;margin-right:10px}#banner img{margin-bottom:2px;margin-left:8px}.category-title{display:block;padding:10px}.category{margin:0!important;border-radius:0!important;border:none}#search{border-radius:0;border:none}.loading_file{background:url(data:image/gif;base64,R0lGODlhPAA8APcAAAAAAAEBAQICAgMDAwQEBAUFBQYGBgcHBwgICAkJCQoKCgsLCwwMDA0NDQ4ODg8PDxAQEBERERISEhMTExQUFBUVFRYWFhcXFxgYGBkZGRoaGhsbGxwcHB0dHR4eHh8fHyAgICEhISIiIiMjIyQkJCUlJSYmJicnJygoKCkpKSoqKisrKywsLC0tLS4uLi8vLzAwMDExMTIyMjMzMzQ0NDU1NTY2Njc3Nzg4ODk5OTo6Ojs7Ozw8PD09PT4+Pj8/P0BAQEFBQUJCQkNDQ0REREVFRUZGRkdHR0hISElJSUpKSktLS0xMTE1NTU5OTk9PT1BQUFFRUVJSUlNTU1RUVFVVVVZWVldXV1hYWFlZWVpaWltbW1xcXF1dXV5eXl9fX2BgYGFhYWJiYmNjY2RkZGVlZWZmZmdnZ2hoaGlpaWpqamtra2xsbG1tbW5ubm9vb3BwcHFxcXJycnNzc3R0dHV1dXZ2dnd3d3h4eHl5eXp6ent7e3x8fH19fX5+fn9/f4CAgIGBgYKCgoODg4SEhIWFhYaGhoeHh4iIiImJiYqKiouLi4yMjI2NjY6Ojo+Pj5C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RxIsKBAUkUOGVxYUE0CAAVwMGRoiwOAiww+TTToisJFiIo2GlTxEYO/jd1OEtzRAUa7fAztIUGSxF7BffwmfhsyoycTcyIJwtLRc8YOWUEHjhNSlAi3pAO7EZkxRBVUgtE+XbvKtaC7ciq5bspzZ0/XXXHMqO3D9ZFatXfaXVWF5u0dru0stUGz52nXYbi6Ch7MkF/Yq/z2lRIFq2u/UJkiN76aTFPkTKKAQo226bKoclf9iYqsKTDXfrRIBSPMurVrfuXAuRPczRkzZ/q4yrPNjFm0wyLL9e4d7R5XacOldWUHLZo04En90YPuWnA8eYL3nStXTh31iem4IXOfF3q7eHZc1Yk3R54ru3Pn1hXMl3tjv3swCa47h256QAA7) center center no-repeat #f5f5f5}#alert{position:fixed;width:30%;margin:30px auto;top:10px;left:0;right:0;z-index:2000;display:none}#alert a{text-decoration:underline}.option-item .bootstrap-switch{margin:15px 10px}.option-item button{margin:10px}.option-item input[type=number]{margin:15px 10px;width:80px;height:28px;padding:3px 10px;vertical-align:middle}.option-item select{margin:10px;display:inline-block}button img,span.btn img{margin-right:3px;margin-bottom:1px}#edit-favourites{float:right;margin-top:-5px}#edit-favourites-list{margin:10px}.about-img-left{float:left;margin:10px 20px 20px 0}.about-img-right{float:right;margin:10px 0 20px 20px}.save-link-options{float:right}.save-link-options input{margin-left:10px}#save-footer{border-top:none;margin-top:0}a:focus,button{outline:0;-moz-outline-style:none}.btn-default{border-color:#ddd}.btn-default:focus{background-color:#fff;border-color:#adadad}.btn-default:active,.btn-default:hover{background-color:#ebebeb;border-color:#adadad}.alert,.btn,.btn-lg,.dropdown-menu,.form-control,.modal-content,.nav-tabs>li>a,.popover,.tooltip-inner{border-radius:0!important}input[type=search]{-webkit-appearance:searchfield;box-shadow:none}input[type=search]::-webkit-search-cancel-button{-webkit-appearance:searchfield-cancel-button}.modal{overflow-y:auto}.form-control{background-color:transparent}code{border:0;white-space:pre-wrap}.bootstrap-switch,.bootstrap-switch-container,.bootstrap-switch-handle-off,.bootstrap-switch-handle-on,.bootstrap-switch-label,pre{border-radius:0!important}#banner,.title{border-bottom:1px solid #ddd}blockquote{font-size:inherit}blockquote a{cursor:pointer}.panel-body:after,.panel-body:before{content:""}.sortable-ghost{opacity:.6}.colorpicker-element{float:left;margin-right:15px}.colorpicker-color,.colorpicker-color div{height:100px}.word-wrap{white-space:pre!important;word-wrap:normal!important;overflow-x:scroll!important}.clearfix{height:0}.blur{color:transparent!important;text-shadow:rgba(0,0,0,.95) 0 0 10px!important}.no-select{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.konami{-ms-transform:rotate(180deg);-webkit-transform:rotate(180deg);transform:rotate(180deg);-moz-transform:rotate(180deg)}.hl1,.hlyellow{background-color:#fff000}.hl2,.hlblue{background-color:#95dfff}.hl3,.hlred{background-color:#ffb6b6}.hl4,.hlorange{background-color:#fcf8e3}.hl5,.hlgreen{background-color:#8de768}.title{color:#424242;background-color:#fafafa}.gutter{background-color:#eee;background-repeat:no-repeat;background-position:50%}.gutter.gutter-horizontal{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAAeCAYAAAAGos/EAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAAlSURBVChTYzxz5sx/BiBgAhEgwPju3TtUEZZ79+6BGcNcDQMDACWJMFs4hNOSAAAAAElFTkSuQmCC);cursor:ew-resize}.gutter.gutter-vertical{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAACCAYAAABPJGxCAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAACHDwAAjA8AAP1SAACBQAAAfXkAAOmLAAA85QAAGcxzPIV3AAAKL2lDQ1BJQ0MgUHJvZmlsZQAASMedlndUVNcWh8+9d3qhzTDSGXqTLjCA9C4gHQRRGGYGGMoAwwxNbIioQEQREQFFkKCAAaOhSKyIYiEoqGAPSBBQYjCKqKhkR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n5ROqE42TZpOnp9ynbj5b/Wz8eerz+emCn6V/rn6h++K7Xxx/6ZtZNTP+kv9y4dfiV/Kvjrxe9rp71n/28ZvkN/NzhW/l3x59x3jX+z7s/cR85gfsh4qPeh+7Pnl/eriQvLDwG/eE8/s3BCkeAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAI0lEQVQYV2M8c+bMfwYgUFJSAlEM9+7dA9O05jOBSboDBgYAtPcYZ1oUA30AAAAASUVORK5CYII=);cursor:ns-resize}.operation{border:1px solid #999;border-top-width:0}.op-list .operation{color:#3a87ad;background-color:#d9edf7;border-color:#bce8f1}#rec-list .operation{color:#468847;background-color:#dff0d8;border-color:#d6e9c6}.arg-input,select{height:34px;border:1px solid #ddd;background-color:#fff;color:#424242}#controls{border-top:1px solid #ddd;background-color:#fafafa}.textarea-wrapper div,.textarea-wrapper textarea{font-family:Consolas,monospace;font-size:inherit}.io-info{font-weight:400;font-size:8pt}.arg-title,.category-title{font-weight:700}.arg-input{font-size:15px;line-height:1.428571429}select{padding:6px 8px}.arg[disabled]{background-color:#eee}textarea.arg{color:#424242}.break{color:#b94a48!important;background-color:#f2dede!important;border-color:#eed3d7!important}.category-title{background-color:#fafafa;border-bottom:1px solid #eee}.category-title[aria-expanded=true],.category-title[href='#catFavourites']{border-bottom-color:#ddd}.category-title.collapsed{border-bottom-color:#eee}.category-title:hover{color:#3a87ad}#search{border-bottom:1px solid #e3e3e3}.dropping-file{border:5px dashed #3a87ad!important}.selected-op{color:#c09853!important;background-color:#fcf8e3!important;border-color:#fbeed5!important}.option-item input[type=number]{font-size:14px;line-height:1.428571429;color:#555;background-color:#fff;border:1px solid #ccc}.favourites-hover{color:#468847;background-color:#dff0d8;border:2px dashed #468847!important;padding:8px 8px 9px}#edit-favourites-list{border:1px solid #bce8f1}#edit-favourites-list .operation{border-left:none;border-right:none}#edit-favourites-list .operation:last-child{border-bottom:none}.subtext{font-style:italic;font-size:13px;color:#999}#save-footer{border-bottom:1px solid #e5e5e5}.flow-control-op{color:#396f3a!important;background-color:#c7e4ba!important;border-color:#b3dba2!important}.flow-control-op.break{color:#94312f!important;background-color:#eabfbf!important;border-color:#e2aeb5!important}#support-modal textarea{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif}#load-text,#save-text{font-family:Consolas,monospace}button.dropdown-toggle{background-color:#f4f4f4}::-webkit-scrollbar{width:10px;height:10px}::-webkit-scrollbar-track{background-color:#fafafa}::-webkit-scrollbar-thumb{background-color:#ccc}::-webkit-scrollbar-thumb:hover{background-color:#bbb}::-webkit-scrollbar-corner{background-color:#fafafa}.disabled{color:#999!important;background-color:#dfdfdf!important;border-color:#cdcdcd!important}.grey{color:#333;background-color:#f5f5f5;border-color:#ddd}.dark-blue{color:#fff;background-color:#428bca;border-color:#428bca}.red{color:#b94a48;background-color:#f2dede;border-color:#eed3d7}.amber{color:#c09853;background-color:#fcf8e3;border-color:#fbeed5}.green{color:#468847;background-color:#dff0d8;border-color:#d6e9c6}.blue{color:#3a87ad;background-color:#d9edf7;border-color:#bce8f1} Edit
                  Operations
                    Recipe
                      Input
                      Output
                      Operations
                        Recipe
                          Input
                          Output
                          \ No newline at end of file +},padRight:function(a,b,c){return c=c||" ",a.lengthb&&(a=a.slice(0,b-c.length)+c),a},hex:function(a,b){return a="string"==typeof a?Utils.ord(a):a,b=b||2,Utils.pad(a.toString(16),b)},bin:function(a,b){return a="string"==typeof a?Utils.ord(a):a,b=b||8,Utils.pad(a.toString(2),b)},printable:function(a,b){window&&window.app&&!window.app.options.treatAsUtf8&&(a=Utils.byteArrayToChars(Utils.strToByteArray(a)));var c=/[\0-\x08\x0B-\x0C\x0E-\x1F\x7F-\x9F\xAD\u0378\u0379\u037F-\u0383\u038B\u038D\u03A2\u0528-\u0530\u0557\u0558\u0560\u0588\u058B-\u058E\u0590\u05C8-\u05CF\u05EB-\u05EF\u05F5-\u0605\u061C\u061D\u06DD\u070E\u070F\u074B\u074C\u07B2-\u07BF\u07FB-\u07FF\u082E\u082F\u083F\u085C\u085D\u085F-\u089F\u08A1\u08AD-\u08E3\u08FF\u0978\u0980\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FC-\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0C00\u0C04\u0C0D\u0C11\u0C29\u0C34\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5A-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C80\u0C81\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0D01\u0D04\u0D0D\u0D11\u0D3B\u0D3C\u0D45\u0D49\u0D4F-\u0D56\u0D58-\u0D5F\u0D64\u0D65\u0D76-\u0D78\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F5-\u13FF\u169D-\u169F\u16F1-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180F\u181A-\u181F\u1878-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191D-\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C80-\u1CBF\u1CC8-\u1CCF\u1CF7-\u1CFF\u1DE7-\u1DFB\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u200B-\u200F\u202A-\u202E\u2060-\u206F\u2072\u2073\u208F\u209D-\u209F\u20BB-\u20CF\u20F1-\u20FF\u218A-\u218F\u23F4-\u23FF\u2427-\u243F\u244B-\u245F\u2700\u2B4D-\u2B4F\u2B5A-\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E3C-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u312E-\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FCD-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA698-\uA69E\uA6F8-\uA6FF\uA78F\uA794-\uA79F\uA7AB-\uA7F7\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C5-\uA8CD\uA8DA-\uA8DF\uA8FC-\uA8FF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9E0-\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAA7C-\uAA7F\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F-\uABBF\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE27-\uFE2F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD-\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFFB\uFFFE\uFFFF]/g,d=/[\x09-\x10\x0D\u2028\u2029]/g;return a=a.replace(c,"."),b||(a=a.replace(d,".")),a},parseEscapedChars:function(a){return a.replace(/(\\)?\\([nrtbf]|x[\da-f]{2})/g,function(a,b,c){if("\\"===b)return"\\"+c;switch(c[0]){case"n":return"\n";case"r":return"\r";case"t":return"\t";case"b":return"\b";case"f":return"\f";case"x":return Utils.chr(parseInt(c.substr(1),16))}})},expandAlphRange:function(a){for(var b=[],c=0;c255)return Utils.strToUtf8ByteArray(a);return c},strToUtf8ByteArray:function(a){var b=CryptoJS.enc.Utf8.parse(a),c=Utils.wordArrayToByteArray(b);return a.length!==b.sigBytes&&(window.app.options.attemptHighlight=!1),c},strToCharcode:function(a){for(var b=new Array(a.length),c=a.length;c--;)b[c]=a.charCodeAt(c);return b},byteArrayToUtf8:function(a){try{for(var b=[],c=0;c>>2]|=a[c]<<24-c%4*8;var d=new CryptoJS.lib.WordArray.init(b,a.length),e=CryptoJS.enc.Utf8.stringify(d);return e.length!==d.sigBytes&&(window.app.options.attemptHighlight=!1),e}catch(b){return Utils.byteArrayToChars(a)}},byteArrayToChars:function(a){if(!a)return"";for(var b="",c=0;c>>2]>>>24-d%4*8&255);return c},UNIC_WIN1251_MAP:{0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,10:10,11:11,12:12,13:13,14:14,15:15,16:16,17:17,18:18,19:19,20:20,21:21,22:22,23:23,24:24,25:25,26:26,27:27,28:28,29:29,30:30,31:31,32:32,33:33,34:34,35:35,36:36,37:37,38:38,39:39,40:40,41:41,42:42,43:43,44:44,45:45,46:46,47:47,48:48,49:49,50:50,51:51,52:52,53:53,54:54,55:55,56:56,57:57,58:58,59:59,60:60,61:61,62:62,63:63,64:64,65:65,66:66,67:67,68:68,69:69,70:70,71:71,72:72,73:73,74:74,75:75,76:76,77:77,78:78,79:79,80:80,81:81,82:82,83:83,84:84,85:85,86:86,87:87,88:88,89:89,90:90,91:91,92:92,93:93,94:94,95:95,96:96,97:97,98:98,99:99,100:100,101:101,102:102,103:103,104:104,105:105,106:106,107:107,108:108,109:109,110:110,111:111,112:112,113:113,114:114,115:115,116:116,117:117,118:118,119:119,120:120,121:121,122:122,123:123,124:124,125:125,126:126,127:127,1027:129,8225:135,1046:198,8222:132,1047:199,1168:165,1048:200,1113:154,1049:201,1045:197,1050:202,1028:170,160:160,1040:192,1051:203,164:164,166:166,167:167,169:169,171:171,172:172,173:173,174:174,1053:205,176:176,177:177,1114:156,181:181,182:182,183:183,8221:148,187:187,1029:189,1056:208,1057:209,1058:210,8364:136,1112:188,1115:158,1059:211,1060:212,1030:178,1061:213,1062:214,1063:215,1116:157,1064:216,1065:217,1031:175,1066:218,1067:219,1068:220,1069:221,1070:222,1032:163,8226:149,1071:223,1072:224,8482:153,1073:225,8240:137,1118:162,1074:226,1110:179,8230:133,1075:227,1033:138,1076:228,1077:229,8211:150,1078:230,1119:159,1079:231,1042:194,1080:232,1034:140,1025:168,1081:233,1082:234,8212:151,1083:235,1169:180,1084:236,1052:204,1085:237,1035:142,1086:238,1087:239,1088:240,1089:241,1090:242,1036:141,1041:193,1091:243,1092:244,8224:134,1093:245,8470:185,1094:246,1054:206,1095:247,1096:248,8249:139,1097:249,1098:250,1044:196,1099:251,1111:191,1055:207,1100:252,1038:161,8220:147,1101:253,8250:155,1102:254,8216:145,1103:255,1043:195,1105:184,1039:143,1026:128,1106:144,8218:130,1107:131,8217:146,1108:186,1109:190},WIN1251_UNIC_MAP:{0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,10:10,11:11,12:12,13:13,14:14,15:15,16:16,17:17,18:18,19:19,20:20,21:21,22:22,23:23,24:24,25:25,26:26,27:27,28:28,29:29,30:30,31:31,32:32,33:33,34:34,35:35,36:36,37:37,38:38,39:39,40:40,41:41,42:42,43:43,44:44,45:45,46:46,47:47,48:48,49:49,50:50,51:51,52:52,53:53,54:54,55:55,56:56,57:57,58:58,59:59,60:60,61:61,62:62,63:63,64:64,65:65,66:66,67:67,68:68,69:69,70:70,71:71,72:72,73:73,74:74,75:75,76:76,77:77,78:78,79:79,80:80,81:81,82:82,83:83,84:84,85:85,86:86,87:87,88:88,89:89,90:90,91:91,92:92,93:93,94:94,95:95,96:96,97:97,98:98,99:99,100:100,101:101,102:102,103:103,104:104,105:105,106:106,107:107,108:108,109:109,110:110,111:111,112:112,113:113,114:114,115:115,116:116,117:117,118:118,119:119,120:120,121:121,122:122,123:123,124:124,125:125,126:126,127:127,160:160,164:164,166:166,167:167,169:169,171:171,172:172,173:173,174:174,176:176,177:177,181:181,182:182,183:183,187:187,168:1025,128:1026,129:1027,170:1028,189:1029,178:1030,175:1031,163:1032,138:1033,140:1034,142:1035,141:1036,161:1038,143:1039,192:1040,193:1041,194:1042,195:1043,196:1044,197:1045,198:1046,199:1047,200:1048,201:1049,202:1050,203:1051,204:1052,205:1053,206:1054,207:1055,208:1056,209:1057,210:1058,211:1059,212:1060,213:1061,214:1062,215:1063,216:1064,217:1065,218:1066,219:1067,220:1068,221:1069,222:1070,223:1071,224:1072,225:1073,226:1074,227:1075,228:1076,229:1077,230:1078,231:1079,232:1080,233:1081,234:1082,235:1083,236:1084,237:1085,238:1086,239:1087,240:1088,241:1089,242:1090,243:1091,244:1092,245:1093,246:1094,247:1095,248:1096,249:1097,250:1098,251:1099,252:1100,253:1101,254:1102,255:1103,184:1105,144:1106,131:1107,186:1108,190:1109,179:1110,191:1111,188:1112,154:1113,156:1114,158:1115,157:1116,162:1118,159:1119,165:1168,180:1169,150:8211,151:8212,145:8216,146:8217,130:8218,147:8220,148:8221,132:8222,134:8224,135:8225,149:8226,133:8230,137:8240,139:8249,155:8250,136:8364,185:8470,153:8482},unicodeToWin1251:function(a){for(var b=[],c=0;c>2,g=(3&c)<<4|d>>4,h=(15&d)<<2|e>>6,i=63&e,isNaN(d)?h=i=64:isNaN(e)&&(i=64),j+=b.charAt(f)+b.charAt(g)+b.charAt(h)+b.charAt(i);return j},fromBase64:function(a,b,c,d){if(c=c||"string",!a)return"string"===c?"":[];b=b?Utils.expandAlphRange(b).join(""):"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",void 0===d&&(d=!0);var e,f,g,h,i,j,k,l=[],m=0;if(d){var n=new RegExp("[^"+b.replace(/[\[\]\\\-^$]/g,"\\$&")+"]","g");a=a.replace(n,"")}for(;m>4,f=(15&i)<<4|j>>2,g=(3&j)<<6|k,l.push(e),64!==j&&l.push(f),64!==k&&l.push(g);return"string"===c?Utils.byteArrayToUtf8(l):l},toHex:function(a,b,c){if(!a)return"";b="string"==typeof b?b:" ",c=c||2;for(var d="",e=0;e>>4).toString(16)),b.push((15&a[c]).toString(16));return b.join("")},fromHex:function(a,b,c){if(b=b||(a.indexOf(" ")>=0?"Space":"None"),c=c||2,"None"!==b){var d=Utils.regexRep[b];a=a.replace(d,"")}for(var e=[],f=0;f]*>.*<\/(script|style)>/gim,"")),a.replace(/<[^>\n]+>/g,"")},escapeHtml:function(a){return a.replace(/>>3]|=parseInt(a.substr(d,2),16)<<24-d%8*4;return new CryptoJS.lib.WordArray.init(c,b/2)};var Base={DEFAULT_RADIX:36,runTo:function(a,b){if(!a)throw"Error: Input must be a number";var c=b[0]||Base.DEFAULT_RADIX;if(c<2||c>36)throw"Error: Radix argument must be between 2 and 36";return a.toString(c)},runFrom:function(a,b){var c=b[0]||Base.DEFAULT_RADIX;if(c<2||c>36)throw"Error: Radix argument must be between 2 and 36";return parseInt(a.replace(/\s/g,""),c)}},Base64={ALPHABET:"A-Za-z0-9+/=",ALPHABET_OPTIONS:[{name:"Standard: A-Za-z0-9+/=",value:"A-Za-z0-9+/="},{name:"URL safe: A-Za-z0-9-_",value:"A-Za-z0-9-_"},{name:"Filename safe: A-Za-z0-9+-=",value:"A-Za-z0-9+\\-="},{name:"itoa64: ./0-9A-Za-z=",value:"./0-9A-Za-z="},{name:"XML: A-Za-z0-9_.",value:"A-Za-z0-9_."},{name:"y64: A-Za-z0-9._-",value:"A-Za-z0-9._-"},{name:"z64: 0-9a-zA-Z+/=",value:"0-9a-zA-Z+/="},{name:"Radix-64: 0-9A-Za-z+/=",value:"0-9A-Za-z+/="},{name:"Uuencoding: [space]-_",value:" -_"},{name:"Xxencoding: +-0-9A-Za-z",value:"+\\-0-9A-Za-z"},{name:"BinHex: !-,-0-689@A-NP-VX-Z[`a-fh-mp-r",value:"!-,-0-689@A-NP-VX-Z[`a-fh-mp-r"},{name:"ROT13: N-ZA-Mn-za-m0-9+/=",value:"N-ZA-Mn-za-m0-9+/="}],runTo:function(a,b){var c=b[0]||Base64.ALPHABET;return Utils.toBase64(a,c)},REMOVE_NON_ALPH_CHARS:!0,runFrom:function(a,b){var c=b[0]||Base64.ALPHABET,d=b[1];return Utils.fromBase64(a,c,"byteArray",d)},BASE32_ALPHABET:"A-Z2-7=",runTo32:function(a,b){if(!a)return"";for(var c,d,e,f,g,h,i,j,k,l,m,n,o,p=b[0]?Utils.expandAlphRange(b[0]).join(""):"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",q="",r=0;r>3,i=(7&c)<<2|d>>6,j=d>>1&31,k=(1&d)<<4|e>>4,l=(15&e)<<1|f>>7,m=f>>2&63,n=(3&f)<<3|g>>5,o=31&g,isNaN(d)?j=k=l=m=n=o=32:isNaN(e)?l=m=n=o=32:isNaN(f)?m=n=o=32:isNaN(g)&&(o=32),q+=p.charAt(h)+p.charAt(i)+p.charAt(j)+p.charAt(k)+p.charAt(l)+p.charAt(m)+p.charAt(n)+p.charAt(o);return q},runFrom32:function(a,b){if(!a)return[];var c,d,e,f,g,h,i,j,k,l,m,n,o,p=b[0]?Utils.expandAlphRange(b[0]).join(""):"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",q=b[0],r=[],s=0;if(q){var t=new RegExp("[^"+p.replace(/[\]\\\-^]/g,"\\$&")+"]","g");a=a.replace(t,"")}for(;s>2,d=(3&i)<<6|j<<1|k>>4,e=(15&k)<<4|l>>1,f=(1&l)<<7|m<<2|n>>3,g=(7&n)<<5|o,r.push(c),(i&!0||32!==j)&&r.push(d),(k&!0||32!==l)&&r.push(e),(l&!0||32!==m)&&r.push(f),(n&!0||32!==o)&&r.push(g);return r},SHOW_IN_BINARY:!1,OFFSETS_SHOW_VARIABLE:!0,runOffsets:function(a,b){var c=b[0]||Base64.ALPHABET,d=b[1],e=Utils.toBase64(a,c),f=Utils.toBase64([0].concat(a),c),g=Utils.toBase64([0,0].concat(a),c),h=e.indexOf("="),i=f.indexOf("="),j=g.indexOf("="),k=" \ No newline at end of file diff --git a/build/prod/index.html b/build/prod/index.html index 26cf30a7..f48370e5 100755 --- a/build/prod/index.html +++ b/build/prod/index.html @@ -18,4 +18,4 @@ See the License for the specific language governing permissions and limitations under the License. --> -CyberChef Edit
                          Operations
                            Recipe
                              Input
                              Output
                              \ No newline at end of file +CyberChef Edit
                              Operations
                                Recipe
                                  Input
                                  Output
                                  \ No newline at end of file diff --git a/build/prod/scripts.js b/build/prod/scripts.js index 29ef4027..ec01a6cd 100755 --- a/build/prod/scripts.js +++ b/build/prod/scripts.js @@ -279,13 +279,13 @@ function(a){"function"==typeof define&&define.amd?define(a):"undefined"!=typeof function(){function a(a){this.code=a,this.message=Vc[a]}function b(b){var c=b.match(/\$?(?:(?![0-9-])(?:\w[\w.-]*|\*):)?(?![0-9-])(?:\w[\w.-]*|\*)|\(:|:\)|\/\/|\.\.|::|\d+(?:\.\d*)?(?:[eE][+-]?\d+)?|\.\d+(?:[eE][+-]?\d+)?|"[^"]*(?:""[^"]*)*"|'[^']*(?:''[^']*)*'|<<|>>|[!<>]=|(?![0-9-])[\w-]+:\*|\s+|./g);if(c){for(var d=0,e=0,f=c.length;e0)}function e(){this.dataTypes={},this.documents={},this.functions={},this.collations={},this.collections={}}function f(a,b,c){Xc[a]=c,Yc[a]=b}function g(a,b){Zc[a]=b}function h(c,d){var e=new b(c),f=l(e,d);if(!e.eof())throw new a("XPST0003");if(!f)throw new a("XPST0003");this.internalExpression=f}function i(){}function j(){}function k(){this.items=[]}function l(b,c){var d;if(!b.eof()&&(d=m(b,c))){var e=new k;for(e.items.push(d);","==b.peek();){if(b.next(),b.eof()||!(d=m(b,c)))throw new a("XPST0003");e.items.push(d)}return e}}function m(a,b){if(!a.eof())return s(a,b)||o(a,b)||u(a,b)||K(a,b)}function n(){this.bindings=[],this.returnExpr=null}function o(b,c){if("for"==b.peek()&&"$"==b.peek(1).substr(0,1)){b.next();var d,e=new n;do e.bindings.push(q(b,c));while(","==b.peek()&&b.next());if("return"!=b.peek())throw new a("XPST0003");if(b.next(),b.eof()||!(d=m(b,c)))throw new a("XPST0003");return e.returnExpr=d,e}}function p(a,b,c,d){this.prefix=a,this.localName=b,this.namespaceURI=c,this.inExpr=d}function q(b,c){var d=b.peek().substr(1).match(id);if(!d)throw new a("XPST0003");if("*"==d[1]||"*"==d[2])throw new a("XPST0003");if(b.next(),"in"!=b.peek())throw new a("XPST0003");b.next();var e;if(b.eof()||!(e=m(b,c)))throw new a("XPST0003");return new p(d[1]||null,d[2],d[1]?c.getURIForPrefix(d[1]):null,e)}function r(a,b,c){this.condExpr=a,this.thenExpr=b,this.elseExpr=c}function s(b,c){var d,e,f;if("if"==b.peek()&&"("==b.peek(1)){if(b.next(2),b.eof()||!(d=l(b,c)))throw new a("XPST0003");if(")"!=b.peek())throw new a("XPST0003");if(b.next(),"then"!=b.peek())throw new a("XPST0003");if(b.next(),b.eof()||!(e=m(b,c)))throw new a("XPST0003");if("else"!=b.peek())throw new a("XPST0003");if(b.next(),b.eof()||!(f=m(b,c)))throw new a("XPST0003");return new r(d,e,f)}}function t(a){this.quantifier=a,this.bindings=[],this.satisfiesExpr=null}function u(b,c){var d=b.peek();if(("some"==d||"every"==d)&&"$"==b.peek(1).substr(0,1)){b.next();var e,f=new t(d);do f.bindings.push(w(b,c));while(","==b.peek()&&b.next());if("satisfies"!=b.peek())throw new a("XPST0003");if(b.next(),b.eof()||!(e=m(b,c)))throw new a("XPST0003");return f.satisfiesExpr=e,f}}function v(a,b,c,d){this.prefix=a,this.localName=b,this.namespaceURI=c,this.inExpr=d}function w(b,c){var d=b.peek().substr(1).match(id);if(!d)throw new a("XPST0003");if("*"==d[1]||"*"==d[2])throw new a("XPST0003");if(b.next(),"in"!=b.peek())throw new a("XPST0003");b.next();var e;if(b.eof()||!(e=m(b,c)))throw new a("XPST0003");return new v(d[1]||null,d[2],d[1]?c.getURIForPrefix(d[1]):null,e)}function x(a,b,c){this.left=a,this.right=b,this.operator=c}function y(b,c){var d,e;if(!b.eof()&&(d=ya(b,c))){if(!(b.peek()in cd))return d;var f=b.peek();if(b.next(),b.eof()||!(e=ya(b,c)))throw new a("XPST0003");return new x(d,e,f)}}function z(a,b){var c=vc(a.left.evaluate(b),b);if(!c.length)return new Xa(!1);var d=vc(a.right.evaluate(b),b);if(!d.length)return new Xa(!1);for(var e,f,g=!1,h=0,i=c.length;hj)throw new a("XPST0017");if(i1)throw new a("XPTY0004")}else if("+"==d){if(e<1)throw new a("XPTY0004")}else if("*"!=d&&1!=e)throw new a("XPTY0004")}function va(a){this.left=a,this.items=[]}function wa(b,c){var d,e;if(!b.eof()&&(d=Ca(b,c))){if("intersect"!=(e=b.peek())&&"except"!=e)return d;for(var f=new va(d);"intersect"==(e=b.peek())||"except"==e;){if(b.next(),b.eof()||!(d=Ca(b,c)))throw new a("XPST0003");f.items.push([e,d])}return f}}function xa(a,b){this.left=a,this.right=b}function ya(b,c){var d,e;if(!b.eof()&&(d=D(b,c))){if("to"!=b.peek())return d;if(b.next(),b.eof()||!(e=D(b,c)))throw new a("XPST0003");return new xa(d,e)}}function za(a){this.left=a,this.items=[]}function Aa(b,c){var d,e;if(!b.eof()&&(d=wa(b,c))){if("|"!=(e=b.peek())&&"union"!=e)return d;for(var f=new za(d);"|"==(e=b.peek())||"union"==e;){if(b.next(),b.eof()||!(d=wa(b,c)))throw new a("XPST0003");f.items.push(d)}return f}}function Ba(a,b){this.expression=a,this.type=b}function Ca(b,c){var d,e;if(!b.eof()&&(d=Ea(b,c))){if("instance"!=b.peek()||"of"!=b.peek(1))return d;if(b.next(2),b.eof()||!(e=Oa(b,c)))throw new a("XPST0003");return new Ba(d,e)}}function Da(a,b){this.expression=a,this.type=b}function Ea(b,c){var d,e;if(!b.eof()&&(d=Ga(b,c))){if("treat"!=b.peek()||"as"!=b.peek(1))return d;if(b.next(2),b.eof()||!(e=Oa(b,c)))throw new a("XPST0003");return new Da(d,e)}}function Fa(a,b){this.expression=a,this.type=b}function Ga(b,c){var d,e;if(!b.eof()&&(d=Ia(b,c))){if("castable"!=b.peek()||"as"!=b.peek(1))return d;if(b.next(2),b.eof()||!(e=Qa(b,c)))throw new a("XPST0003");return new Fa(d,e)}}function Ha(a,b){this.expression=a,this.type=b}function Ia(b,c){var d,e;if(!b.eof()&&(d=H(b,c))){if("cast"!=b.peek()||"as"!=b.peek(1))return d;if(b.next(2),b.eof()||!(e=Qa(b,c)))throw new a("XPST0003");return new Ha(d,e)}}function Ja(a,b,c){this.prefix=a,this.localName=b,this.namespaceURI=c}function Ka(b,c){var d=b.peek().match(id);if(d){if("*"==d[1]||"*"==d[2])throw new a("XPST0003");return b.next(),new Ja(d[1]||null,d[2],d[1]?c.getURIForPrefix(d[1]):null)}}function La(a){this.test=a}function Ma(b,c){if(!b.eof()){var d;if("item"==b.peek()&&"("==b.peek(1)){if(b.next(2),")"!=b.peek())throw new a("XPST0003");return b.next(),new La}return(d=Z(b,c))?new La(d):(d=Ka(b,c))?new La(d):void 0}}function Na(a,b){this.itemType=a||null,this.occurence=b||null}function Oa(b,c){if(!b.eof()){if("empty-sequence"==b.peek()&&"("==b.peek(1)){if(b.next(2),")"!=b.peek())throw new a("XPST0003");return b.next(),new Na}var d,e;return!b.eof()&&(d=Ma(b,c))?(e=b.peek(),"?"==e||"*"==e||"+"==e?b.next():e=null,new Na(d,e)):void 0}}function Pa(a,b){this.itemType=a||null,this.occurence=b||null}function Qa(a,b){var c,d;if(!a.eof()&&(c=Ka(a,b)))return d=a.peek(),"?"==d?a.next():d=null,new Pa(c,d)}function Ra(){}function Sa(){}function Ta(){}function Ua(a){return a instanceof lb||a instanceof gb||a instanceof fb}function Va(a,b,c,d,e){this.scheme=a,this.authority=b,this.path=c,this.query=d,this.fragment=e}function Wa(a){this.value=a}function Xa(a){this.value=a}function Ya(a,b,c,d,e){this.year=a,this.month=b,this.day=c,this.timezone=d,this.negative=e}function Za(a,b){return 2==b&&(a%400==0||a%100!=0&&a%4==0)?29:pd[b-1]}function $a(a,b){if(!b){var c=Za(a.year,a.month);if(a.day>c)for(;a.day>c;)a.month+=1,a.month>12&&(a.year+=1,0==a.year&&(a.year=1),a.month=1),a.day-=c,c=Za(a.year,a.month);else if(a.day<1)for(;a.day<1;)a.month-=1,a.month<1&&(a.year-=1,0==a.year&&(a.year=-1),a.month=12),c=Za(a.year,a.month),a.day+=c}return a.month>12?(a.year+=~~(a.month/12),0==a.year&&(a.year=1),a.month=a.month%12):a.month<1&&(a.year+=~~(a.month/12)-1,0==a.year&&(a.year=-1),a.month=a.month%12+12),a}function _a(a,b,c,d,e,f,g,h){this.year=a,this.month=b,this.day=c,this.hours=d,this.minutes=e,this.seconds=f,this.timezone=g,this.negative=h}function ab(a,b){var c=Ac(a);return arguments.length<2&&(b=2),(c.length0?"+":"-")+ab(Gc.abs(~~(b/60)))+":"+ab(Gc.abs(b%60)):"Z"}function cb(a){return(a.negative?"-":"")+ab(a.year,4)+"-"+ab(a.month)+"-"+ab(a.day)}function db(a){var b=Ac(a.seconds).split(".");return ab(a.hours)+":"+ab(a.minutes)+":"+ab(b[0])+(b.length>1?"."+b[1]:"")}function eb(a){return $a(wb(a))}function fb(a){this.value=a}function gb(a){this.value=a}function hb(a,b,c,d,e,f,g){this.year=a,this.month=b,this.day=c,this.hours=d,this.minutes=e,this.seconds=f,this.negative=g}function ib(a){return(a.year?a.year+"Y":"")+(a.month?a.month+"M":"")}function jb(a){return(a.day?a.day+"D":"")+(a.hours||a.minutes||a.seconds?"T"+(a.hours?a.hours+"H":"")+(a.minutes?a.minutes+"M":"")+(a.seconds?a.seconds+"S":""):"")}function kb(a){return zb(Bb(a))}function lb(a){this.value=a}function mb(a,b){this.day=a,this.timezone=b}function nb(a,b){this.month=a,this.timezone=b}function ob(a,b,c){this.month=a,this.day=b,this.timezone=c}function pb(a,b){this.year=a,this.timezone=b}function qb(a,b,c){this.year=a,this.month=b,this.timezone=c}function rb(a){this.value=a}function sb(){}function tb(a,b,c){this.prefix=a,this.localName=b,this.namespaceURI=c}function ub(a){this.value=a}function vb(a,b,c,d){this.hours=a,this.minutes=b,this.seconds=c,this.timezone=d}function wb(a){return(a.seconds>=60||a.seconds<0)&&(a.minutes+=~~(a.seconds/60)-(a.seconds<0&&a.seconds%60?1:0),a.seconds=a.seconds%60+(a.seconds<0&&a.seconds%60?60:0)),(a.minutes>=60||a.minutes<0)&&(a.hours+=~~(a.minutes/60)-(a.minutes<0&&a.minutes%60?1:0),a.minutes=a.minutes%60+(a.minutes<0&&a.minutes%60?60:0)),(a.hours>=24||a.hours<0)&&(a instanceof _a&&(a.day+=~~(a.hours/24)-(a.hours<0&&a.hours%24?1:0)),a.hours=a.hours%24+(a.hours<0&&a.hours%24?24:0)),a}function xb(a){this.value=a}function yb(a,b,c){hb.call(this,a,b,0,0,0,0,c)}function zb(a){return a.month>=12&&(a.year+=~~(a.month/12),a.month%=12),a}function Ab(a,b,c,d,e){hb.call(this,0,0,a,b,c,d,e)}function Bb(a){return a.seconds>=60&&(a.minutes+=~~(a.seconds/60),a.seconds%=60),a.minutes>=60&&(a.hours+=~~(a.minutes/60),a.minutes%=60),a.hours>=24&&(a.day+=~~(a.hours/24),a.hours%=24),a}function Cb(a){this.value=a}function Db(a){this.value=a}function Eb(a){this.value=a}function Fb(a){this.value=a}function Gb(a){this.value=a}function Hb(a){this.value=a}function Ib(a){this.value=a}function Jb(a){this.value=a}function Kb(a){this.value=a}function Lb(a){this.value=a}function Mb(a){this.value=a}function Nb(a){this.value=a}function Ob(a){this.value=a}function Pb(a){this.value=a}function Qb(a){this.value=a}function Rb(a){this.value=a}function Sb(a){this.value=a}function Tb(a){this.value=a}function Ub(a){this.value=a}function Vb(a){this.value=a}function Wb(a){this.value=a}function Xb(a){this.value=a}function Yb(){}function Zb(){}function $b(){}function _b(){}function ac(){}function bc(){}function cc(){}function dc(){}function ec(a,b,c){var d=nc(a),e=nc(b);return new Xa("lt"==c?de:d==e)}function fc(a,b,c){return gc(_a.cast(a),_a.cast(b),c)}function gc(a,b,c){var d=new Ab(0,0,0,0),e=tc(a,d).toString(),f=tc(b,d).toString();return new Xa("lt"==c?ef:e==f)}function hc(a,b,c){var d;a instanceof Ya?d=new Ya(a.year,a.month,a.day,a.timezone,a.negative):a instanceof _a&&(d=new _a(a.year,a.month,a.day,a.hours,a.minutes,a.seconds,a.timezone,a.negative)),d.year=d.year+b.year*("-"==c?-1:1),d.month=d.month+b.month*("-"==c?-1:1),$a(d,!0);var e=Za(d.year,d.month);return d.day>e&&(d.day=e),d}function ic(a,b,c){var d;if(a instanceof Ya){var e=60*(60*b.hours+b.minutes)+b.seconds;d=new Ya(a.year,a.month,a.day,a.timezone,a.negative),d.day=d.day+b.day*("-"==c?-1:1)-1*(e&&"-"==c),$a(d)}else a instanceof _a&&(d=new _a(a.year,a.month,a.day,a.hours,a.minutes,a.seconds,a.timezone,a.negative),d.seconds=d.seconds+b.seconds*("-"==c?-1:1),d.minutes=d.minutes+b.minutes*("-"==c?-1:1),d.hours=d.hours+b.hours*("-"==c?-1:1),d.day=d.day+b.day*("-"==c?-1:1),eb(d));return d}function jc(a){return(60*(60*(24*a.day+a.hours)+a.minutes)+a.seconds)*(a.negative?-1:1)}function kc(a){var b=(a=Gc.round(a))<0,c=~~((a=Gc.abs(a))/86400),d=~~((a-=3600*c*24)/3600),e=~~((a-=3600*d)/60),f=a-=60*e;return new Ab(c,d,e,f,b)}function lc(a){return(12*a.year+a.month)*(a.negative?-1:1)}function mc(a){var b=(a=Gc.round(a))<0,c=~~((a=Gc.abs(a))/12),d=a-=12*c;return new yb(c,d,b)}function nc(a){return a.seconds+60*(a.minutes-(null!=a.timezone?a.timezone%60:0)+60*(a.hours-(null!=a.timezone?~~(a.timezone/60):0)))}function oc(a){var b=new Ec((a.negative?-1:1)*a.year,a.month,a.day,0,0,0,0);return a instanceof _a&&(b.setHours(a.hours),b.setMinutes(a.minutes),b.setSeconds(a.seconds)),null!=a.timezone&&b.setMinutes(b.getMinutes()-a.timezone),b.getTime()/1e3}function pc(a,b){if(Ic(a)||Gc.abs(a)==Lc||Ic(b)||Gc.abs(b)==Lc)return 0;var c=Ac(a).match(jd),d=Ac(b).match(jd),e=Gc.max(1,(c[2]||c[3]||"").length+(c[5]||0)*("+"==c[4]?-1:1),(d[2]||d[3]||"").length+(d[5]||0)*("+"==d[4]?-1:1));return e+(e%2?0:1)}function qc(a,b,c){return new(a instanceof Cb&&b instanceof Cb&&c==Gc.round(c)?Cb:fb)(c)}function rc(a,b){if(null==a)return null;var c=a[b]*(a.negative?-1:1);return"seconds"==b?new fb(c):new Cb(c)}function sc(a,b){if(null==a)return null;if("timezone"==b){var c=a.timezone;return null==c?null:new Ab(0,Gc.abs(~~(c/60)),Gc.abs(c%60),0,c<0)}var d=a[b];return a instanceof Ya||"hours"==b&&24==d&&(d=0),a instanceof vb||(d*=a.negative?-1:1),"seconds"==b?new fb(d):new Cb(d)}function tc(a,b){if(null==a)return null;var c;if(c=a instanceof Ya?new Ya(a.year,a.month,a.day,a.timezone,a.negative):a instanceof vb?new vb(a.hours,a.minutes,a.seconds,a.timezone,a.negative):new _a(a.year,a.month,a.day,a.hours,a.minutes,a.seconds,a.timezone,a.negative),null==b)c.timezone=null;else{var d=jc(b)/60;if(null!=a.timezone){var e=d-a.timezone;a instanceof Ya?e<0&&c.day--:(c.minutes+=e%60,c.hours+=~~(e/60)),eb(c)}c.timezone=d}return c}function uc(b,c){if(!b.length)return!1;var d=b[0];if(c.DOMAdapter.isNode(d))return!0;if(1==b.length){if(d instanceof Xa)return d.value.valueOf();if(d instanceof ub)return!!d.valueOf().length;if(Ua(d))return!(Ic(d.valueOf())||0==d.valueOf());throw new a("FORG0006")}throw new a("FORG0006")}function vc(a,b){for(var c,d,e=[],f=0,g=a.length;f=0,j=c.indexOf("x")>=0;if(i||j){c=c.replace(/[sx]/g,"");for(var k,l=[],m=/\s/,n=0,o=b.length,p=!1,q="";n0},b.prototype.eof=function(){return this.index>=this.length},c.prototype.isNode=function(a){return a&&!!a.nodeType},c.prototype.getProperty=function(a,b){return a[b]},c.prototype.isSameNode=function(a,b){return a==b},c.prototype.compareDocumentPosition=function(a,b){return a.compareDocumentPosition(b)},c.prototype.lookupNamespaceURI=function(a,b){return a.lookupNamespaceURI(b)},c.prototype.getElementById=function(a,b){return a.getElementById(b)},c.prototype.getElementsByTagNameNS=function(a,b,c){return a.getElementsByTagNameNS(b,c)},d.prototype.item=null,d.prototype.position=0,d.prototype.size=0,d.prototype.scope=null,d.prototype.stack=null,d.prototype.dateTime=null,d.prototype.timezone=null,d.prototype.staticContext=null,d.prototype.pushVariable=function(a,b){this.stack.hasOwnProperty(a)||(this.stack[a]=[]),this.stack[a].push(this.scope[a]),this.scope[a]=b},d.prototype.popVariable=function(a){this.stack.hasOwnProperty(a)&&(this.scope[a]=this.stack[a].pop(),this.stack[a].length||(delete this.stack[a],"undefined"==typeof this.scope[a]&&delete this.scope[a]))},e.prototype.baseURI=null,e.prototype.dataTypes=null,e.prototype.documents=null,e.prototype.functions=null,e.prototype.defaultFunctionNamespace=null,e.prototype.collations=null,e.prototype.defaultCollationName=Sc+"/collation/codepoint",e.prototype.collections=null,e.prototype.namespaceResolver=null,e.prototype.defaultElementNamespace=null;var Wc=/^(?:\{([^\}]+)\})?(.+)$/;e.prototype.setDataType=function(a,b){var c=a.match(Wc);c&&c[1]!=Rc&&(this.dataTypes[a]=b)},e.prototype.getDataType=function(a){var b=a.match(Wc);if(b)return b[1]==Rc?Zc[b[2]]:this.dataTypes[a]},e.prototype.setDocument=function(a,b){this.documents[a]=b},e.prototype.getDocument=function(a){return this.documents[a]},e.prototype.setFunction=function(a,b){var c=a.match(Wc);c&&c[1]!=Sc&&(this.functions[a]=b)},e.prototype.getFunction=function(a){var b=a.match(Wc);if(b)return b[1]==Sc?Xc[b[2]]:this.functions[a]},e.prototype.setCollation=function(a,b){this.collations[a]=b},e.prototype.getCollation=function(a){return this.collations[a]},e.prototype.setCollection=function(a,b){this.collections[a]=b},e.prototype.getCollection=function(a){return this.collections[a]},e.prototype.getURIForPrefix=function(b){var c,d=this.namespaceResolver,e=d&&d.lookupNamespaceURI?d.lookupNamespaceURI:d;if(e instanceof Fc&&(c=e.call(d,b)))return c;if("fn"==b)return Sc;if("xs"==b)return Rc;if("xml"==b)return Uc;if("xmlns"==b)return Tc;throw new a("XPST0081")},e.js2xs=function(a){return a="boolean"==typeof a?new Xa(a):"number"==typeof a?Ic(a)||!Jc(a)?new gb(a):ja(Ac(a)):new ub(Ac(a))},e.xs2js=function(a){return a=a instanceof Xa?a.valueOf():Ua(a)?a.valueOf():a.toString()};var Xc={},Yc={},Zc={},$c={};h.prototype.internalExpression=null,h.prototype.evaluate=function(a){return this.internalExpression.evaluate(a)},i.prototype.equals=function(a,b){throw"Not implemented"},i.prototype.compare=function(a,b){throw"Not implemented"},j.ANYSIMPLETYPE_DT=1,j.STRING_DT=2,j.BOOLEAN_DT=3,j.DECIMAL_DT=4,j.FLOAT_DT=5,j.DOUBLE_DT=6,j.DURATION_DT=7,j.DATETIME_DT=8,j.TIME_DT=9,j.DATE_DT=10,j.GYEARMONTH_DT=11,j.GYEAR_DT=12,j.GMONTHDAY_DT=13,j.GDAY_DT=14,j.GMONTH_DT=15,j.HEXBINARY_DT=16,j.BASE64BINARY_DT=17,j.ANYURI_DT=18,j.QNAME_DT=19,j.NOTATION_DT=20,j.NORMALIZEDSTRING_DT=21,j.TOKEN_DT=22,j.LANGUAGE_DT=23,j.NMTOKEN_DT=24,j.NAME_DT=25,j.NCNAME_DT=26,j.ID_DT=27,j.IDREF_DT=28,j.ENTITY_DT=29,j.INTEGER_DT=30,j.NONPOSITIVEINTEGER_DT=31,j.NEGATIVEINTEGER_DT=32,j.LONG_DT=33,j.INT_DT=34,j.SHORT_DT=35,j.BYTE_DT=36,j.NONNEGATIVEINTEGER_DT=37,j.UNSIGNEDLONG_DT=38,j.UNSIGNEDINT_DT=39,j.UNSIGNEDSHORT_DT=40,j.UNSIGNEDBYTE_DT=41,j.POSITIVEINTEGER_DT=42,j.LISTOFUNION_DT=43,j.LIST_DT=44,j.UNAVAILABLE_DT=45,j.DATETIMESTAMP_DT=46,j.DAYMONTHDURATION_DT=47,j.DAYTIMEDURATION_DT=48,j.PRECISIONDECIMAL_DT=49,j.ANYATOMICTYPE_DT=50,j.ANYTYPE_DT=51,j.XT_YEARMONTHDURATION_DT=-1,j.XT_UNTYPEDATOMIC_DT=-2,k.prototype.items=null,k.prototype.evaluate=function(a){for(var b=[],c=0,d=this.items.length;c":"gt","<":"lt",">=":"ge","<=":"le"},ad={};ad.eq=function(b,c,d){var e="";if(Ua(b))Ua(c)&&(e="numeric-equal");else if(b instanceof Xa)c instanceof Xa&&(e="boolean-equal");else if(b instanceof ub){if(c instanceof ub)return $c["numeric-equal"].call(d,Xc.compare.call(d,b,c),new Cb(0))}else b instanceof Ya?c instanceof Ya&&(e="date-equal"):b instanceof vb?c instanceof vb&&(e="time-equal"):b instanceof _a?c instanceof _a&&(e="dateTime-equal"):b instanceof hb?c instanceof hb&&(e="duration-equal"):b instanceof qb?c instanceof qb&&(e="gYearMonth-equal"):b instanceof pb?c instanceof pb&&(e="gYear-equal"):b instanceof ob?c instanceof ob&&(e="gMonthDay-equal"):b instanceof nb?c instanceof nb&&(e="gMonth-equal"):b instanceof mb?c instanceof mb&&(e="gDay-equal"):b instanceof tb?c instanceof tb&&(e="QName-equal"):b instanceof rb?c instanceof rb&&(e="hexBinary-equal"):b instanceof Wa&&c instanceof Wa&&(e="base64Binary-equal");if(e)return $c[e].call(d,b,c);throw new a("XPTY0004")},ad.ne=function(a,b,c){return new Xa(!ad.eq(a,b,c).valueOf())},ad.gt=function(b,c,d){var e="";if(Ua(b))Ua(c)&&(e="numeric-greater-than");else if(b instanceof Xa)c instanceof Xa&&(e="boolean-greater-than");else if(b instanceof ub){if(c instanceof ub)return $c["numeric-greater-than"].call(d,Xc.compare.call(d,b,c),new Cb(0))}else b instanceof Ya?c instanceof Ya&&(e="date-greater-than"):b instanceof vb?c instanceof vb&&(e="time-greater-than"):b instanceof _a?c instanceof _a&&(e="dateTime-greater-than"):b instanceof yb?c instanceof yb&&(e="yearMonthDuration-greater-than"):b instanceof Ab&&c instanceof Ab&&(e="dayTimeDuration-greater-than"); if(e)return $c[e].call(d,b,c);throw new a("XPTY0004")},ad.lt=function(b,c,d){var e="";if(Ua(b))Ua(c)&&(e="numeric-less-than");else if(b instanceof Xa)c instanceof Xa&&(e="boolean-less-than");else if(b instanceof ub){if(c instanceof ub)return $c["numeric-less-than"].call(d,Xc.compare.call(d,b,c),new Cb(0))}else b instanceof Ya?c instanceof Ya&&(e="date-less-than"):b instanceof vb?c instanceof vb&&(e="time-less-than"):b instanceof _a?c instanceof _a&&(e="dateTime-less-than"):b instanceof yb?c instanceof yb&&(e="yearMonthDuration-less-than"):b instanceof Ab&&c instanceof Ab&&(e="dayTimeDuration-less-than");if(e)return $c[e].call(d,b,c);throw new a("XPTY0004")},ad.ge=function(b,c,d){var e="";if(Ua(b))Ua(c)&&(e="numeric-less-than");else if(b instanceof Xa)c instanceof Xa&&(e="boolean-less-than");else if(b instanceof ub){if(c instanceof ub)return $c["numeric-greater-than"].call(d,Xc.compare.call(d,b,c),new Cb(-1))}else b instanceof Ya?c instanceof Ya&&(e="date-less-than"):b instanceof vb?c instanceof vb&&(e="time-less-than"):b instanceof _a?c instanceof _a&&(e="dateTime-less-than"):b instanceof yb?c instanceof yb&&(e="yearMonthDuration-less-than"):b instanceof Ab&&c instanceof Ab&&(e="dayTimeDuration-less-than");if(e)return new Xa(!$c[e].call(d,b,c).valueOf());throw new a("XPTY0004")},ad.le=function(b,c,d){var e="";if(Ua(b))Ua(c)&&(e="numeric-greater-than");else if(b instanceof Xa)c instanceof Xa&&(e="boolean-greater-than");else if(b instanceof ub){if(c instanceof ub)return $c["numeric-less-than"].call(d,Xc.compare.call(d,b,c),new Cb(1))}else b instanceof Ya?c instanceof Ya&&(e="date-greater-than"):b instanceof vb?c instanceof vb&&(e="time-greater-than"):b instanceof _a?c instanceof _a&&(e="dateTime-greater-than"):b instanceof yb?c instanceof yb&&(e="yearMonthDuration-greater-than"):b instanceof Ab&&c instanceof Ab&&(e="dayTimeDuration-greater-than");if(e)return new Xa(!$c[e].call(d,b,c).valueOf());throw new a("XPTY0004")};var bd={};bd.is=function(a,b,c){return $c["is-same-node"].call(c,a,b)},bd[">>"]=function(a,b,c){return $c["node-after"].call(c,a,b)},bd["<<"]=function(a,b,c){return $c["node-before"].call(c,a,b)};var cd={"=":z,"!=":z,"<":z,"<=":z,">":z,">=":z,eq:A,ne:A,lt:A,le:A,gt:A,ge:A,is:B,">>":B,"<<":B};C.prototype.left=null,C.prototype.items=null;var dd={};dd["+"]=function(b,c,d){var e="",f=!1;if(Ua(b)?Ua(c)&&(e="numeric-add"):b instanceof Ya?c instanceof yb?e="add-yearMonthDuration-to-date":c instanceof Ab&&(e="add-dayTimeDuration-to-date"):b instanceof yb?c instanceof Ya?(e="add-yearMonthDuration-to-date",f=!0):c instanceof _a?(e="add-yearMonthDuration-to-dateTime",f=!0):c instanceof yb&&(e="add-yearMonthDurations"):b instanceof Ab?c instanceof Ya?(e="add-dayTimeDuration-to-date",f=!0):c instanceof vb?(e="add-dayTimeDuration-to-time",f=!0):c instanceof _a?(e="add-dayTimeDuration-to-dateTime",f=!0):c instanceof Ab&&(e="add-dayTimeDurations"):b instanceof vb?c instanceof Ab&&(e="add-dayTimeDuration-to-time"):b instanceof _a&&(c instanceof yb?e="add-yearMonthDuration-to-dateTime":c instanceof Ab&&(e="add-dayTimeDuration-to-dateTime")),e)return $c[e].call(d,f?c:b,f?b:c);throw new a("XPTY0004")},dd["-"]=function(b,c,d){var e="";if(Ua(b)?Ua(c)&&(e="numeric-subtract"):b instanceof Ya?c instanceof Ya?e="subtract-dates":c instanceof yb?e="subtract-yearMonthDuration-from-date":c instanceof Ab&&(e="subtract-dayTimeDuration-from-date"):b instanceof vb?c instanceof vb?e="subtract-times":c instanceof Ab&&(e="subtract-dayTimeDuration-from-time"):b instanceof _a?c instanceof _a?e="subtract-dateTimes":c instanceof yb?e="subtract-yearMonthDuration-from-dateTime":c instanceof Ab&&(e="subtract-dayTimeDuration-from-dateTime"):b instanceof yb?c instanceof yb&&(e="subtract-yearMonthDurations"):b instanceof Ab&&c instanceof Ab&&(e="subtract-dayTimeDurations"),e)return $c[e].call(d,b,c);throw new a("XPTY0004")},C.prototype.evaluate=function(a){var b=vc(this.left.evaluate(a),a);if(!b.length)return[];ua(a,b,"?");var c=b[0];c instanceof xb&&(c=gb.cast(c));for(var d,e,f=0,g=this.items.length;f1)return[new Xa(!1)];if(!c.length)return[new Xa("?"==e)];try{d.cast(vc(c,b)[0])}catch(b){if("XPST0051"==b.code)throw b;if("XPST0017"==b.code)throw new a("XPST0080");return[new Xa(!1)]}return[new Xa(!0)]},Ha.prototype.expression=null,Ha.prototype.type=null,Ha.prototype.evaluate=function(a){var b=this.expression.evaluate(a);return ua(a,b,this.type.occurence),b.length?[this.type.itemType.cast(vc(b,a)[0],a)]:[]},Ja.prototype.prefix=null,Ja.prototype.localName=null,Ja.prototype.namespaceURI=null,Ja.prototype.test=function(b,c){var d=(this.namespaceURI?"{"+this.namespaceURI+"}":"")+this.localName,e=this.namespaceURI==Rc?Zc[this.localName]:c.staticContext.getDataType(d);if(e)return b instanceof e;throw new a("XPST0051")},Ja.prototype.cast=function(b,c){var d=(this.namespaceURI?"{"+this.namespaceURI+"}":"")+this.localName,e=this.namespaceURI==Rc?Zc[this.localName]:c.staticContext.getDataType(d);if(e)return e.cast(b);throw new a("XPST0051")},La.prototype.test=null,Na.prototype.itemType=null,Na.prototype.occurence=null,Pa.prototype.itemType=null,Pa.prototype.occurence=null,Ra.prototype.builtInKind=j.ANYTYPE_DT,Sa.prototype=new Ra,Sa.prototype.builtInKind=j.ANYSIMPLETYPE_DT,Sa.prototype.primitiveKind=null,Sa.PRIMITIVE_ANYURI="anyURI",Sa.PRIMITIVE_BASE64BINARY="base64Binary",Sa.PRIMITIVE_BOOLEAN="boolean",Sa.PRIMITIVE_DATE="date",Sa.PRIMITIVE_DATETIME="dateTime",Sa.PRIMITIVE_DECIMAL="decimal",Sa.PRIMITIVE_DOUBLE="double",Sa.PRIMITIVE_DURATION="duration",Sa.PRIMITIVE_FLOAT="float",Sa.PRIMITIVE_GDAY="gDay",Sa.PRIMITIVE_GMONTH="gMonth",Sa.PRIMITIVE_GMONTHDAY="gMonthDay",Sa.PRIMITIVE_GYEAR="gYear",Sa.PRIMITIVE_GYEARMONTH="gYearMonth",Sa.PRIMITIVE_HEXBINARY="hexBinary",Sa.PRIMITIVE_NOTATION="NOTATION",Sa.PRIMITIVE_QNAME="QName",Sa.PRIMITIVE_STRING="string",Sa.PRIMITIVE_TIME="time",Ta.prototype=new Sa,Ta.prototype.builtInKind=j.ANYATOMICTYPE_DT,Ta.cast=function(b){throw new a("XPST0017")},g("anyAtomicType",Ta),Va.prototype=new Ta,Va.prototype.builtInKind=j.ANYURI_DT,Va.prototype.primitiveKind=Sa.PRIMITIVE_ANYURI,Va.prototype.scheme=null,Va.prototype.authority=null,Va.prototype.path=null,Va.prototype.query=null,Va.prototype.fragment=null,Va.prototype.toString=function(){return(this.scheme?this.scheme+":":"")+(this.authority?"//"+this.authority:"")+(this.path?this.path:"")+(this.query?"?"+this.query:"")+(this.fragment?"#"+this.fragment:"")};var ld=/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;Va.cast=function(b){if(b instanceof Va)return b;if(b instanceof ub||b instanceof xb){var c;if(c=Pc(b).match(ld))return new Va(c[2],c[4],c[5],c[7],c[9]);throw new a("FORG0001")}throw new a("XPTY0004")},g("anyURI",Va),Wa.prototype=new Ta,Wa.prototype.builtInKind=j.BASE64BINARY_DT,Wa.prototype.primitiveKind=Sa.PRIMITIVE_BASE64BINARY,Wa.prototype.value=null,Wa.prototype.valueOf=function(){return this.value},Wa.prototype.toString=function(){return this.value};var md=/^((([A-Za-z0-9+\/]\s*){4})*(([A-Za-z0-9+\/]\s*){3}[A-Za-z0-9+\/]|([A-Za-z0-9+\/]\s*){2}[AEIMQUYcgkosw048]\s*=|[A-Za-z0-9+\/]\s*[AQgw]\s*=\s*=))?$/;Wa.cast=function(b){if(b instanceof Wa)return b;if(b instanceof ub||b instanceof xb){var c=Pc(b).match(md);if(c)return new Wa(c[0]);throw new a("FORG0001")}if(b instanceof rb){for(var c=b.valueOf().match(/.{2}/g),d=[],e=0,f=c.length;e=-0x8000000000000000)return new Fb(c.value);throw new a("FORG0001")},g("long",Fb),Gb.prototype=new Fb,Gb.prototype.builtInKind=j.INT_DT,Gb.cast=function(b){var c;try{c=Cb.cast(b)}catch(a){throw a}if(c.value<=2147483647&&c.value>=-2147483648)return new Gb(c.value);throw new a("FORG0001")},g("int",Gb),Hb.prototype=new Gb,Hb.prototype.builtInKind=j.SHORT_DT,Hb.cast=function(b){var c;try{c=Cb.cast(b)}catch(a){throw a}if(c.value<=32767&&c.value>=-32768)return new Hb(c.value);throw new a("FORG0001")},g("short",Hb),Ib.prototype=new Hb,Ib.prototype.builtInKind=j.BYTE_DT,Ib.cast=function(b){var c;try{c=Cb.cast(b)}catch(a){throw a}if(c.value<=127&&c.value>=-128)return new Ib(c.value);throw new a("FORG0001")},g("byte",Ib),Jb.prototype=new Cb,Jb.prototype.builtInKind=j.NONNEGATIVEINTEGER_DT,Jb.cast=function(b){var c;try{c=Cb.cast(b)}catch(a){throw a}if(c.value>=0)return new Jb(c.value);throw new a("FORG0001")},g("nonNegativeInteger",Jb),Kb.prototype=new Jb,Kb.prototype.builtInKind=j.POSITIVEINTEGER_DT,Kb.cast=function(b){var c;try{c=Cb.cast(b)}catch(a){throw a}if(c.value>=1)return new Kb(c.value);throw new a("FORG0001")},g("positiveInteger",Kb),Lb.prototype=new Jb,Lb.prototype.builtInKind=j.UNSIGNEDLONG_DT,Lb.cast=function(b){var c;try{c=Cb.cast(b)}catch(a){throw a}if(c.value>=1&&c.value<=0x10000000000000000)return new Lb(c.value);throw new a("FORG0001")},g("unsignedLong",Lb),Mb.prototype=new Jb,Mb.prototype.builtInKind=j.UNSIGNEDINT_DT,Mb.cast=function(b){var c;try{c=Cb.cast(b)}catch(a){throw a}if(c.value>=1&&c.value<=4294967295)return new Mb(c.value);throw new a("FORG0001")},g("unsignedInt",Mb),Nb.prototype=new Mb,Nb.prototype.builtInKind=j.UNSIGNEDSHORT_DT,Nb.cast=function(b){var c;try{c=Cb.cast(b)}catch(a){throw a}if(c.value>=1&&c.value<=65535)return new Nb(c.value);throw new a("FORG0001")},g("unsignedShort",Nb),Ob.prototype=new Nb,Ob.prototype.builtInKind=j.UNSIGNEDBYTE_DT, Ob.cast=function(b){var c;try{c=Cb.cast(b)}catch(a){throw a}if(c.value>=1&&c.value<=255)return new Ob(c.value);throw new a("FORG0001")},g("unsignedByte",Ob),Pb.prototype=new ub,Pb.prototype.builtInKind=j.NORMALIZEDSTRING_DT,Pb.cast=function(a){return new Pb(Ac(a))},g("normalizedString",Pb),Qb.prototype=new Pb,Qb.prototype.builtInKind=j.TOKEN_DT,Qb.cast=function(a){return new Qb(Ac(a))},g("token",Qb),Rb.prototype=new Qb,Rb.prototype.builtInKind=j.NAME_DT,Rb.cast=function(a){return new Rb(Ac(a))},g("Name",Rb),Sb.prototype=new Rb,Sb.prototype.builtInKind=j.NCNAME_DT,Sb.cast=function(a){return new Sb(Ac(a))},g("NCName",Sb),Tb.prototype=new Sb,Tb.prototype.builtInKind=j.ENTITY_DT,Tb.cast=function(a){return new Tb(Ac(a))},g("ENTITY",Tb),Ub.prototype=new Sb,Ub.prototype.builtInKind=j.ID_DT,Ub.cast=function(a){return new Ub(Ac(a))},g("ID",Ub),Vb.prototype=new Sb,Vb.prototype.builtInKind=j.IDREF_DT,Vb.cast=function(a){return new Vb(Ac(a))},g("IDREF",Vb),Wb.prototype=new Qb,Wb.prototype.builtInKind=j.LANGUAGE_DT,Wb.cast=function(a){return new Wb(Ac(a))},g("language",Wb),Xb.prototype=new Qb,Xb.prototype.builtInKind=j.NMTOKEN_DT,Xb.cast=function(a){return new Xb(Ac(a))},g("NMTOKEN",Xb),Zb.prototype=new Yb,$b.prototype=new Zb,_b.prototype=new Zb,ac.prototype=new Zb,bc.prototype=new Zb,cc.prototype=new Zb,dc.prototype=new Zb,$c["hexBinary-equal"]=function(a,b){return new Xa(a.valueOf()==b.valueOf())},$c["base64Binary-equal"]=function(a,b){return new Xa(a.valueOf()==b.valueOf())},$c["boolean-equal"]=function(a,b){return new Xa(a.valueOf()==b.valueOf())},$c["boolean-less-than"]=function(a,b){return new Xa(a.valueOf()b.valueOf())},$c["yearMonthDuration-less-than"]=function(a,b){return new Xa(lc(a)lc(b))},$c["dayTimeDuration-less-than"]=function(a,b){return new Xa(jc(a)jc(b))},$c["duration-equal"]=function(a,b){return new Xa(a.negative==b.negative&&lc(a)==lc(b)&&jc(a)==jc(b))},$c["dateTime-equal"]=function(a,b){return gc(a,b,"eq")},$c["dateTime-less-than"]=function(a,b){return gc(a,b,"lt")},$c["dateTime-greater-than"]=function(a,b){return gc(a,b,"gt")},$c["date-equal"]=function(a,b){return fc(a,b,"eq")},$c["date-less-than"]=function(a,b){return fc(a,b,"lt")},$c["date-greater-than"]=function(a,b){return fc(a,b,"gt")},$c["time-equal"]=function(a,b){return ec(a,b,"eq")},$c["time-less-than"]=function(a,b){return ec(a,b,"lt")},$c["time-greater-than"]=function(a,b){return ec(a,b,"gt")},$c["gYearMonth-equal"]=function(a,b){return gc(new _a(a.year,a.month,Za(a.year,a.month),0,0,0,null==a.timezone?this.timezone:a.timezone),new _a(b.year,b.month,Za(b.year,b.month),0,0,0,null==b.timezone?this.timezone:b.timezone),"eq")},$c["gYear-equal"]=function(a,b){return gc(new _a(a.year,1,1,0,0,0,null==a.timezone?this.timezone:a.timezone),new _a(b.year,1,1,0,0,0,null==b.timezone?this.timezone:b.timezone),"eq")},$c["gMonthDay-equal"]=function(a,b){return gc(new _a(1972,a.month,a.day,0,0,0,null==a.timezone?this.timezone:a.timezone),new _a(1972,b.month,b.day,0,0,0,null==b.timezone?this.timezone:b.timezone),"eq")},$c["gMonth-equal"]=function(a,b){return gc(new _a(1972,a.month,Za(1972,b.month),0,0,0,null==a.timezone?this.timezone:a.timezone),new _a(1972,b.month,Za(1972,b.month),0,0,0,null==b.timezone?this.timezone:b.timezone),"eq")},$c["gDay-equal"]=function(a,b){return gc(new _a(1972,12,a.day,0,0,0,null==a.timezone?this.timezone:a.timezone),new _a(1972,12,b.day,0,0,0,null==b.timezone?this.timezone:b.timezone),"eq")},$c["add-yearMonthDurations"]=function(a,b){return mc(lc(a)+lc(b))},$c["subtract-yearMonthDurations"]=function(a,b){return mc(lc(a)-lc(b))},$c["multiply-yearMonthDuration"]=function(a,b){return mc(lc(a)*b)},$c["divide-yearMonthDuration"]=function(a,b){return mc(lc(a)/b)},$c["divide-yearMonthDuration-by-yearMonthDuration"]=function(a,b){return new fb(lc(a)/lc(b))},$c["add-dayTimeDurations"]=function(a,b){return kc(jc(a)+jc(b))},$c["subtract-dayTimeDurations"]=function(a,b){return kc(jc(a)-jc(b))},$c["multiply-dayTimeDuration"]=function(a,b){return kc(jc(a)*b)},$c["divide-dayTimeDuration"]=function(a,b){return kc(jc(a)/b)},$c["divide-dayTimeDuration-by-dayTimeDuration"]=function(a,b){return new fb(jc(a)/jc(b))},$c["subtract-dateTimes"]=function(a,b){return kc(oc(a)-oc(b))},$c["subtract-dates"]=function(a,b){return kc(oc(a)-oc(b))},$c["subtract-times"]=function(a,b){return kc(nc(a)-nc(b))},$c["add-yearMonthDuration-to-dateTime"]=function(a,b){return hc(a,b,"+")},$c["add-dayTimeDuration-to-dateTime"]=function(a,b){return ic(a,b,"+")},$c["subtract-yearMonthDuration-from-dateTime"]=function(a,b){return hc(a,b,"-")},$c["subtract-dayTimeDuration-from-dateTime"]=function(a,b){return ic(a,b,"-")},$c["add-yearMonthDuration-to-date"]=function(a,b){return hc(a,b,"+")},$c["add-dayTimeDuration-to-date"]=function(a,b){return ic(a,b,"+")},$c["subtract-yearMonthDuration-from-date"]=function(a,b){return hc(a,b,"-")},$c["subtract-dayTimeDuration-from-date"]=function(a,b){return ic(a,b,"-")},$c["add-dayTimeDuration-to-time"]=function(a,b){var c=new vb(a.hours,a.minutes,a.seconds,a.timezone);return c.hours+=b.hours,c.minutes+=b.minutes,c.seconds+=b.seconds,wb(c)},$c["subtract-dayTimeDuration-from-time"]=function(a,b){var c=new vb(a.hours,a.minutes,a.seconds,a.timezone);return c.hours-=b.hours,c.minutes-=b.minutes,c.seconds-=b.seconds,wb(c)},$c["is-same-node"]=function(a,b){return new Xa(this.DOMAdapter.isSameNode(a,b))},$c["node-before"]=function(a,b){return new Xa(!!(4&this.DOMAdapter.compareDocumentPosition(a,b)))},$c["node-after"]=function(a,b){return new Xa(!!(2&this.DOMAdapter.compareDocumentPosition(a,b)))},$c["numeric-add"]=function(a,b){var c=a.valueOf(),d=b.valueOf(),e=Gc.pow(10,pc(c,d));return qc(a,b,(c*e+d*e)/e)},$c["numeric-subtract"]=function(a,b){var c=a.valueOf(),d=b.valueOf(),e=Gc.pow(10,pc(c,d));return qc(a,b,(c*e-d*e)/e)},$c["numeric-multiply"]=function(a,b){var c=a.valueOf(),d=b.valueOf(),e=Gc.pow(10,pc(c,d));return qc(a,b,c*e*(d*e)/(e*e))},$c["numeric-divide"]=function(a,b){var c=a.valueOf(),d=b.valueOf(),e=Gc.pow(10,pc(c,d));return qc(a,b,a*e/(b*e))},$c["numeric-integer-divide"]=function(a,b){var c=a/b;return new Cb(Gc.floor(c)+(c<0))},$c["numeric-mod"]=function(a,b){var c=a.valueOf(),d=b.valueOf(),e=Gc.pow(10,pc(c,d));return qc(a,b,c*e%(d*e)/e)},$c["numeric-unary-plus"]=function(a){return a},$c["numeric-unary-minus"]=function(a){return a.value*=-1,a},$c["numeric-equal"]=function(a,b){return new Xa(a.valueOf()==b.valueOf())},$c["numeric-less-than"]=function(a,b){return new Xa(a.valueOf()b.valueOf())},$c["QName-equal"]=function(a,b){return new Xa(a.localName==b.localName&&a.namespaceURI==b.namespaceURI)},$c.concatenate=function(a,b){return a.concat(b)},$c.union=function(b,c){for(var d,e=[],f=0,g=b.length;fh?g.pop():(g.push(f[i]),h++):"."!=f[i]&&g.push(f[i]);".."!=f[--i]&&"."!=f[i]||g.push(""),d.path=g.join("/")}return d}),f("true",[],function(){return new Xa(!0)}),f("false",[],function(){return new Xa(!1)}),f("not",[[Yb,"*"]],function(a){return new Xa(!uc(a,this))}),f("position",[],function(){return new Cb(this.position)}),f("last",[],function(){return new Cb(this.size)}),f("current-dateTime",[],function(){return this.dateTime}),f("current-date",[],function(){return Ya.cast(this.dateTime)}),f("current-time",[],function(){return vb.cast(this.dateTime)}),f("implicit-timezone",[],function(){return this.timezone}),f("default-collation",[],function(){return new ub(this.staticContext.defaultCollationName)}),f("static-base-uri",[],function(){return Va.cast(new ub(this.staticContext.baseURI||""))}),f("years-from-duration",[[hb,"?"]],function(a){return rc(a,"year")}),f("months-from-duration",[[hb,"?"]],function(a){return rc(a,"month")}),f("days-from-duration",[[hb,"?"]],function(a){return rc(a,"day")}),f("hours-from-duration",[[hb,"?"]],function(a){return rc(a,"hours")}),f("minutes-from-duration",[[hb,"?"]],function(a){return rc(a,"minutes")}),f("seconds-from-duration",[[hb,"?"]],function(a){return rc(a,"seconds")}),f("year-from-dateTime",[[_a,"?"]],function(a){return sc(a,"year")}),f("month-from-dateTime",[[_a,"?"]],function(a){return sc(a,"month")}),f("day-from-dateTime",[[_a,"?"]],function(a){return sc(a,"day")}),f("hours-from-dateTime",[[_a,"?"]],function(a){return sc(a,"hours")}),f("minutes-from-dateTime",[[_a,"?"]],function(a){return sc(a,"minutes")}),f("seconds-from-dateTime",[[_a,"?"]],function(a){return sc(a,"seconds")}),f("timezone-from-dateTime",[[_a,"?"]],function(a){return sc(a,"timezone")}),f("year-from-date",[[Ya,"?"]],function(a){return sc(a,"year")}),f("month-from-date",[[Ya,"?"]],function(a){return sc(a,"month")}),f("day-from-date",[[Ya,"?"]],function(a){return sc(a,"day")}),f("timezone-from-date",[[Ya,"?"]],function(a){return sc(a,"timezone")}),f("hours-from-time",[[vb,"?"]],function(a){return sc(a,"hours")}),f("minutes-from-time",[[vb,"?"]],function(a){return sc(a,"minutes")}),f("seconds-from-time",[[vb,"?"]],function(a){return sc(a,"seconds")}),f("timezone-from-time",[[vb,"?"]],function(a){return sc(a,"timezone")}),f("adjust-dateTime-to-timezone",[[_a,"?"],[Ab,"?",!0]],function(a,b){return tc(a,arguments.length>1&&null!=b?arguments.length>1?b:this.timezone:null)});f("adjust-date-to-timezone",[[Ya,"?"],[Ab,"?",!0]],function(a,b){return tc(a,arguments.length>1&&null!=b?arguments.length>1?b:this.timezone:null)});f("adjust-time-to-timezone",[[vb,"?"],[Ab,"?",!0]],function(a,b){return tc(a,arguments.length>1&&null!=b?arguments.length>1?b:this.timezone:null)}),f("name",[[Zb,"?",!0]],function(b){if(arguments.length){if(null==b)return new ub("")}else{if(!this.DOMAdapter.isNode(this.item))throw new a("XPTY0004");b=this.item}var c=Xc["node-name"].call(this,b);return new ub(null==c?"":c.toString())}),f("local-name",[[Zb,"?",!0]],function(b){if(arguments.length){if(null==b)return new ub("")}else{if(!this.DOMAdapter.isNode(this.item))throw new a("XPTY0004");b=this.item}return new ub(this.DOMAdapter.getProperty(b,"localName")||"")}),f("namespace-uri",[[Zb,"?",!0]],function(b){if(arguments.length){if(null==b)return Va.cast(new ub(""))}else{if(!this.DOMAdapter.isNode(this.item))throw new a("XPTY0004");b=this.item}return Va.cast(new ub(this.DOMAdapter.getProperty(b,"namespaceURI")||""))}),f("number",[[Ta,"?",!0]],function(b){if(!arguments.length){if(!this.item)throw new a("XPDY0002");b=vc([this.item],this)[0]}var c=new gb(Kc);if(null!=b)try{c=gb.cast(b)}catch(a){}return c}),f("lang",[[ub,"?"],[Zb,"",!0]],function(b,c){if(arguments.length<2){if(!this.DOMAdapter.isNode(this.item))throw new a("XPTY0004");c=this.item}var d=this.DOMAdapter.getProperty;2==d(c,"nodeType")&&(c=d(c,"ownerElement"));for(var e;c;c=d(c,"parentNode"))if(e=d(c,"attributes"))for(var f=0,g=e.length;f1?b.valueOf():0;if(c<0){var d=new Cb(Gc.pow(10,-c)),e=Gc.round($c["numeric-divide"].call(this,a,d)),f=new Cb(e);return nDecimal=Gc.abs($c["numeric-subtract"].call(this,f,$c["numeric-divide"].call(this,a,d))),$c["numeric-multiply"].call(this,$c["numeric-add"].call(this,f,new fb(.5==nDecimal&&e%2?-1:0)),d)}var d=new Cb(Gc.pow(10,c)),e=Gc.round($c["numeric-multiply"].call(this,a,d)),f=new Cb(e);return nDecimal=Gc.abs($c["numeric-subtract"].call(this,f,$c["numeric-multiply"].call(this,a,d))),$c["numeric-divide"].call(this,$c["numeric-add"].call(this,f,new fb(.5==nDecimal&&e%2?-1:0)),d)}),f("resolve-QName",[[ub,"?"],[bc]],function(b,c){if(null==b)return null;var d=b.valueOf(),e=d.match(Bd);if(!e)throw new a("FOCA0002");var f=e[1]||null,g=e[2],h=this.DOMAdapter.lookupNamespaceURI(c,f);if(null!=f&&!h)throw new a("FONS0004");return new tb(f,g,h||null)}),f("QName",[[ub,"?"],[ub]],function(b,c){var d=c.valueOf(),e=d.match(Bd);if(!e)throw new a("FOCA0002");return new tb(e[1]||null,e[2]||null,null==b?"":b.valueOf())}),f("prefix-from-QName",[[tb,"?"]],function(a){return null!=a&&a.prefix?new Sb(a.prefix):null}),f("local-name-from-QName",[[tb,"?"]],function(a){return null==a?null:new Sb(a.localName)}),f("namespace-uri-from-QName",[[tb,"?"]],function(a){return null==a?null:Va.cast(new ub(a.namespaceURI||""))}),f("namespace-uri-for-prefix",[[ub,"?"],[bc]],function(a,b){var c=null==a?"":a.valueOf(),d=this.DOMAdapter.lookupNamespaceURI(b,c||null);return null==d?null:Va.cast(new ub(d))}),f("in-scope-prefixes",[[bc]],function(a){throw"Function 'in-scope-prefixes' not implemented"}),f("boolean",[[Yb,"*"]],function(a){return new Xa(uc(a,this))}),f("index-of",[[Ta,"*"],[Ta],[ub,"",!0]],function(a,b,c){if(!a.length||null==b)return[];var d=b;d instanceof xb&&(d=ub.cast(d));for(var e,f=[],g=0,h=a.length;g1)throw"Collation parameter in function 'distinct-values' is not implemented";if(!a.length)return null;for(var c,d=[],e=0,f=a.length;ed&&(e=d+1);for(var f=[],g=0;gc)return a;for(var e=[],f=0;f2?Gc.round(c):a.length-d+1;return a.slice(d-1,d-1+e)}),f("unordered",[[Yb,"*"]],function(a){return a}),f("zero-or-one",[[Yb,"*"]],function(b){if(b.length>1)throw new a("FORG0003");return b}),f("one-or-more",[[Yb,"*"]],function(b){if(!b.length)throw new a("FORG0004");return b}),f("exactly-one",[[Yb,"*"]],function(b){if(1!=b.length)throw new a("FORG0005");return b}),f("deep-equal",[[Yb,"*"],[Yb,"*"],[ub,"",!0]],function(a,b,c){throw"Function 'deep-equal' not implemented"}),f("count",[[Yb,"*"]],function(a){return new Cb(a.length)}),f("avg",[[Ta,"*"]],function(b){if(!b.length)return null;try{var c=b[0];c instanceof xb&&(c=gb.cast(c));for(var d,e=1,f=b.length;e1?c:new gb(0);try{var d=b[0];d instanceof xb&&(d=gb.cast(d));for(var e,f=1,g=b.length;f2&&(f=d.valueOf()),e=f==Sc+"/collation/codepoint"?Gd:this.staticContext.getCollation(f),!e)throw new a("FOCH0002");return new Cb(e.compare(b.valueOf(),c.valueOf()))}),f("codepoint-equal",[[ub,"?"],[ub,"?"]],function(a,b){return null==a||null==b?null:new Xa(a.valueOf()==b.valueOf())}),f("concat",null,function(){if(arguments.length<2)throw new a("XPST0017");for(var b,c=[],d=0,e=arguments.length;d2?e+Gc.round(c):d.length;return new ub(f>e?d.substring(e,f):"")}),f("string-length",[[ub,"?",!0]],function(b){if(!arguments.length){if(!this.item)throw new a("XPDY0002");b=ub.cast(vc([this.item],this)[0])}return new Cb(null==b?0:b.valueOf().length)}),f("normalize-space",[[ub,"?",!0]],function(b){if(!arguments.length){if(!this.item)throw new a("XPDY0002");b=ub.cast(vc([this.item],this)[0])}return new ub(null==b?"":Pc(b).replace(/\s\s+/g," "))}),f("normalize-unicode",[[ub,"?"],[ub,"",!0]],function(a,b){throw"Function 'normalize-unicode' not implemented"}),f("upper-case",[[ub,"?"]],function(a){return new ub(null==a?"":a.valueOf().toUpperCase())}),f("lower-case",[[ub,"?"]],function(a){return new ub(null==a?"":a.valueOf().toLowerCase())}),f("translate",[[ub,"?"],[ub],[ub]],function(a,b,c){if(null==a)return new ub("");for(var d,e=a.valueOf().split(""),f=b.valueOf().split(""),g=c.valueOf().split(""),h=g.length,i=[],j=0,k=e.length;j126)&&(c[d]=window.encodeURIComponent(c[d]));return new ub(c.join(""))}),f("contains",[[ub,"?"],[ub,"?"],[ub,"",!0]],function(a,b,c){if(arguments.length>2)throw"Collation parameter in function 'contains' is not implemented";return new Xa((null==a?"":a.valueOf()).indexOf(null==b?"":b.valueOf())>=0)}),f("starts-with",[[ub,"?"],[ub,"?"],[ub,"",!0]],function(a,b,c){if(arguments.length>2)throw"Collation parameter in function 'starts-with' is not implemented";return new Xa(0==(null==a?"":a.valueOf()).indexOf(null==b?"":b.valueOf()))}),f("ends-with",[[ub,"?"],[ub,"?"],[ub,"",!0]],function(a,b,c){if(arguments.length>2)throw"Collation parameter in function 'ends-with' is not implemented";var d=null==a?"":a.valueOf(),e=null==b?"":b.valueOf();return new Xa(d.indexOf(e)==d.length-e.length)}),f("substring-before",[[ub,"?"],[ub,"?"],[ub,"",!0]],function(a,b,c){if(arguments.length>2)throw"Collation parameter in function 'substring-before' is not implemented";var d,e=null==a?"":a.valueOf(),f=null==b?"":b.valueOf();return new ub((d=e.indexOf(f))>=0?e.substring(0,d):"")}),f("substring-after",[[ub,"?"],[ub,"?"],[ub,"",!0]],function(a,b,c){if(arguments.length>2)throw"Collation parameter in function 'substring-after' is not implemented";var d,e=null==a?"":a.valueOf(),f=null==b?"":b.valueOf();return new ub((d=e.indexOf(f))>=0?e.substring(d+f.length):"")}),f("matches",[[ub,"?"],[ub],[ub,"",!0]],function(a,b,c){var d=null==a?"":a.valueOf(),e=xc(b.valueOf(),arguments.length>2?c.valueOf():"");return new Xa(e.test(d))}),f("replace",[[ub,"?"],[ub],[ub],[ub,"",!0]],function(a,b,c,d){var e=null==a?"":a.valueOf(),f=xc(b.valueOf(),arguments.length>3?d.valueOf():"");return new Xa(e.replace(f,c.valueOf()))}),f("tokenize",[[ub,"?"],[ub],[ub,"",!0]],function(a,b,c){for(var d=null==a?"":a.valueOf(),e=xc(b.valueOf(),arguments.length>2?c.valueOf():""),f=[],g=0,h=d.split(e),i=h.length;gb?1:-1},yc.prototype=new c;var Hd=new e;yc.prototype.getProperty=function(a,b){if(b in a)return a[b];if("baseURI"==b){for(var c,d="",e=Hd.getFunction("{http://www.w3.org/2005/xpath-functions}resolve-uri"),f=Hd.getDataType("{http://www.w3.org/2001/XMLSchema}string"),g=a;g;g=g.parentNode)1==g.nodeType&&(c=g.getAttribute("xml:base"))&&(d=e(new f(c),new f(d)).toString());return d}if("textContent"==b){var h=[];return function(a){for(var b,c=0;b=a.childNodes[c];c++)3==b.nodeType||4==b.nodeType?h.push(b.data):1==b.nodeType&&b.firstChild&&arguments.callee(b)}(a),h.join("")}},yc.prototype.compareDocumentPosition=function(a,b){if("compareDocumentPosition"in a)return a.compareDocumentPosition(b);if(b==a)return 0;var c,d,e,f,g,h=null,i=null;if(2==a.nodeType&&(h=a,a=this.getProperty(h,"ownerElement")),2==b.nodeType&&(i=b,b=this.getProperty(i,"ownerElement")),h&&i&&a&&a==b)for(f=0,c=this.getProperty(a,"attributes"),g=c.length;fMath.round(a.width/50))&&(e=Math.round(a.width/50)),(!f||f>Math.round(a.width/50))&&(f=Math.round(a.height/50));var h=a.getContext("2d"),i=.08*a.width,j=.03*a.width,k=.08*a.height,l=.15*a.height,m=a.height-k-l,n=a.width-i-j,o=k+m,p=k;h.font=g+"px Arial",h.lineWidth="1.0",h.strokeStyle="#444",CanvasComponents.draw_line(h,i,o,n+i,o),CanvasComponents.draw_line(h,i,o,i,p);var q=.003*n,r=(n-q*b.length)/b.length,s=i+q,t=Math.max.apply(Math,b);h.fillStyle="green";for(var u=0;u=b.length)for(var u=0;u<=b.length;u++)h.fillText(u,s,o+.3*l),s+=r+q;else for(var u=0;u<=e;u++){var w=Math.ceil(b.length/e*u);s=n/e*u+i,h.fillText(w,s,o+.3*l)}h.textAlign="right";var x;if(f>=t)for(var u=0;u<=t;u++)x=o-u/t*m+g/3,h.fillText(u,.8*i,x);else for(var u=0;u<=f;u++){var w=Math.ceil(t/f*u);x=o-w/t*m+g/3,h.fillText(w,.8*i,x)}if(c&&(h.textAlign="center",h.fillText(c,n/2+i,o+.8*l)),d){h.save();var y=.3*i,z=m/2+k;h.translate(y,z),h.rotate(-Math.PI/2),h.textAlign="center",h.fillText(d,0,0),h.restore()}},draw_scale_bar:function(a,b,c,d){var e=a.getContext("2d"),f=.01*a.width,g=.01*a.width,h=.1*a.height,i=.3*a.height,j=a.height-h-i,k=a.width-f-g,l=b/c;e.strokeRect(f,h,k,j);var m=e.createLinearGradient(f,0,k+f,0);m.addColorStop(0,"green"),m.addColorStop(.5,"gold"),m.addColorStop(1,"red"),e.fillStyle=m,e.fillRect(f,h,k*l,j);var n,o,p,q;e.fillStyle="black",e.textAlign="center",e.font="13px Arial";for(var r=0;r=.9*c?(e.textAlign="right",n=p):d[r].max<=.1*c?e.textAlign="left":n+=(p-n)/2,o=h+j+.8*i,e.fillText(d[r].label,n,o)}},Utils={chr:function(a){return String.fromCharCode(a)},ord:function(a){return a.charCodeAt(0)},padLeft:function(a,b,c){c=c||"0";var d=c.length-(b-a.length);return d=d<0?0:d,a.lengthb&&(a=a.slice(0,b-c.length)+c),a},hex:function(a,b){return a="string"==typeof a?Utils.ord(a):a,b=b||2,Utils.pad(a.toString(16),b)},bin:function(a,b){return a="string"==typeof a?Utils.ord(a):a,b=b||8,Utils.pad(a.toString(2),b)},printable:function(a,b){window&&window.app&&!window.app.options.treatAsUtf8&&(a=Utils.byteArrayToChars(Utils.strToByteArray(a)));var c=/[\0-\x08\x0B-\x0C\x0E-\x1F\x7F-\x9F\xAD\u0378\u0379\u037F-\u0383\u038B\u038D\u03A2\u0528-\u0530\u0557\u0558\u0560\u0588\u058B-\u058E\u0590\u05C8-\u05CF\u05EB-\u05EF\u05F5-\u0605\u061C\u061D\u06DD\u070E\u070F\u074B\u074C\u07B2-\u07BF\u07FB-\u07FF\u082E\u082F\u083F\u085C\u085D\u085F-\u089F\u08A1\u08AD-\u08E3\u08FF\u0978\u0980\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FC-\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0C00\u0C04\u0C0D\u0C11\u0C29\u0C34\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5A-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C80\u0C81\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0D01\u0D04\u0D0D\u0D11\u0D3B\u0D3C\u0D45\u0D49\u0D4F-\u0D56\u0D58-\u0D5F\u0D64\u0D65\u0D76-\u0D78\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F5-\u13FF\u169D-\u169F\u16F1-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180F\u181A-\u181F\u1878-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191D-\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C80-\u1CBF\u1CC8-\u1CCF\u1CF7-\u1CFF\u1DE7-\u1DFB\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u200B-\u200F\u202A-\u202E\u2060-\u206F\u2072\u2073\u208F\u209D-\u209F\u20BB-\u20CF\u20F1-\u20FF\u218A-\u218F\u23F4-\u23FF\u2427-\u243F\u244B-\u245F\u2700\u2B4D-\u2B4F\u2B5A-\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E3C-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u312E-\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FCD-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA698-\uA69E\uA6F8-\uA6FF\uA78F\uA794-\uA79F\uA7AB-\uA7F7\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C5-\uA8CD\uA8DA-\uA8DF\uA8FC-\uA8FF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9E0-\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAA7C-\uAA7F\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F-\uABBF\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE27-\uFE2F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD-\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFFB\uFFFE\uFFFF]/g,d=/[\x09-\x10\x0D\u2028\u2029]/g;return a=a.replace(c,"."),b||(a=a.replace(d,".")),a},parseEscapedChars:function(a){return a.replace(/(\\)?\\([nrtbf]|x[\da-f]{2})/g,function(a,b,c){if("\\"===b)return"\\"+c;switch(c[0]){case"n":return"\n";case"r":return"\r";case"t":return"\t";case"b":return"\b";case"f":return"\f";case"x":return Utils.chr(parseInt(c.substr(1),16))}})},expandAlphRange:function(a){for(var b=[],c=0;c255)return Utils.strToUtf8ByteArray(a);return c},strToUtf8ByteArray:function(a){var b=CryptoJS.enc.Utf8.parse(a),c=Utils.wordArrayToByteArray(b);return a.length!==b.sigBytes&&(window.app.options.attemptHighlight=!1),c},strToCharcode:function(a){for(var b=new Array(a.length),c=a.length;c--;)b[c]=a.charCodeAt(c);return b},byteArrayToUtf8:function(a){try{for(var b=[],c=0;c>>2]|=a[c]<<24-c%4*8;var d=new CryptoJS.lib.WordArray.init(b,a.length),e=CryptoJS.enc.Utf8.stringify(d);return e.length!==d.sigBytes&&(window.app.options.attemptHighlight=!1),e}catch(b){return Utils.byteArrayToChars(a)}},byteArrayToChars:function(a){if(!a)return"";for(var b="",c=0;c>>2]>>>24-d%4*8&255);return c},UNIC_WIN1251_MAP:{0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,10:10,11:11,12:12,13:13,14:14,15:15,16:16,17:17,18:18,19:19,20:20,21:21,22:22,23:23,24:24,25:25,26:26,27:27,28:28,29:29,30:30,31:31,32:32,33:33,34:34,35:35,36:36,37:37,38:38,39:39,40:40,41:41,42:42,43:43,44:44,45:45,46:46,47:47,48:48,49:49,50:50,51:51,52:52,53:53,54:54,55:55,56:56,57:57,58:58,59:59,60:60,61:61,62:62,63:63,64:64,65:65,66:66,67:67,68:68,69:69,70:70,71:71,72:72,73:73,74:74,75:75,76:76,77:77,78:78,79:79,80:80,81:81,82:82,83:83,84:84,85:85,86:86,87:87,88:88,89:89,90:90,91:91,92:92,93:93,94:94,95:95,96:96,97:97,98:98,99:99,100:100,101:101,102:102,103:103,104:104,105:105,106:106,107:107,108:108,109:109,110:110,111:111,112:112,113:113,114:114,115:115,116:116,117:117,118:118,119:119,120:120,121:121,122:122,123:123,124:124,125:125,126:126,127:127,1027:129,8225:135,1046:198,8222:132,1047:199,1168:165,1048:200,1113:154,1049:201,1045:197,1050:202,1028:170,160:160,1040:192,1051:203,164:164,166:166,167:167,169:169,171:171,172:172,173:173,174:174,1053:205,176:176,177:177,1114:156,181:181,182:182,183:183,8221:148,187:187,1029:189,1056:208,1057:209,1058:210,8364:136,1112:188,1115:158,1059:211,1060:212,1030:178,1061:213,1062:214,1063:215,1116:157,1064:216,1065:217,1031:175,1066:218,1067:219,1068:220,1069:221,1070:222,1032:163,8226:149,1071:223,1072:224,8482:153,1073:225,8240:137,1118:162,1074:226,1110:179,8230:133,1075:227,1033:138,1076:228,1077:229,8211:150,1078:230,1119:159,1079:231,1042:194,1080:232,1034:140,1025:168,1081:233,1082:234,8212:151,1083:235,1169:180,1084:236,1052:204,1085:237,1035:142,1086:238,1087:239,1088:240,1089:241,1090:242,1036:141,1041:193,1091:243,1092:244,8224:134,1093:245,8470:185,1094:246,1054:206,1095:247,1096:248,8249:139,1097:249,1098:250,1044:196,1099:251,1111:191,1055:207,1100:252,1038:161,8220:147,1101:253,8250:155,1102:254,8216:145,1103:255,1043:195,1105:184,1039:143,1026:128,1106:144,8218:130,1107:131,8217:146,1108:186,1109:190},WIN1251_UNIC_MAP:{0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,10:10,11:11,12:12,13:13,14:14,15:15,16:16,17:17,18:18,19:19,20:20,21:21,22:22,23:23,24:24,25:25,26:26,27:27,28:28,29:29,30:30,31:31,32:32,33:33,34:34,35:35,36:36,37:37,38:38,39:39,40:40,41:41,42:42,43:43,44:44,45:45,46:46,47:47,48:48,49:49,50:50,51:51,52:52,53:53,54:54,55:55,56:56,57:57,58:58,59:59,60:60,61:61,62:62,63:63,64:64,65:65,66:66,67:67,68:68,69:69,70:70,71:71,72:72,73:73,74:74,75:75,76:76,77:77,78:78,79:79,80:80,81:81,82:82,83:83,84:84,85:85,86:86,87:87,88:88,89:89,90:90,91:91,92:92,93:93,94:94,95:95,96:96,97:97,98:98,99:99,100:100,101:101,102:102,103:103,104:104,105:105,106:106,107:107,108:108,109:109,110:110,111:111,112:112,113:113,114:114,115:115,116:116,117:117,118:118,119:119,120:120,121:121,122:122,123:123,124:124,125:125,126:126,127:127,160:160,164:164,166:166,167:167,169:169,171:171,172:172,173:173,174:174,176:176,177:177,181:181,182:182,183:183,187:187,168:1025,128:1026,129:1027,170:1028,189:1029,178:1030,175:1031,163:1032,138:1033,140:1034,142:1035,141:1036,161:1038,143:1039,192:1040,193:1041,194:1042,195:1043,196:1044,197:1045,198:1046,199:1047,200:1048,201:1049,202:1050,203:1051,204:1052,205:1053,206:1054,207:1055,208:1056,209:1057,210:1058,211:1059,212:1060,213:1061,214:1062,215:1063,216:1064,217:1065,218:1066,219:1067,220:1068,221:1069,222:1070,223:1071,224:1072,225:1073,226:1074,227:1075,228:1076,229:1077,230:1078,231:1079,232:1080,233:1081,234:1082,235:1083,236:1084,237:1085,238:1086,239:1087,240:1088,241:1089,242:1090,243:1091,244:1092,245:1093,246:1094,247:1095,248:1096,249:1097,250:1098,251:1099,252:1100,253:1101,254:1102,255:1103,184:1105,144:1106,131:1107,186:1108,190:1109,179:1110,191:1111,188:1112,154:1113,156:1114,158:1115,157:1116,162:1118,159:1119,165:1168,180:1169,150:8211,151:8212,145:8216,146:8217,130:8218,147:8220,148:8221,132:8222,134:8224,135:8225,149:8226,133:8230,137:8240,139:8249,155:8250,136:8364,185:8470,153:8482},unicodeToWin1251:function(a){for(var b=[],c=0;c>2,g=(3&c)<<4|d>>4,h=(15&d)<<2|e>>6,i=63&e,isNaN(d)?h=i=64:isNaN(e)&&(i=64),j+=b.charAt(f)+b.charAt(g)+b.charAt(h)+b.charAt(i);return j},fromBase64:function(a,b,c,d){if(c=c||"string",!a)return"string"===c?"":[];b=b?Utils.expandAlphRange(b).join(""):"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",void 0===d&&(d=!0);var e,f,g,h,i,j,k,l=[],m=0;if(d){var n=new RegExp("[^"+b.replace(/[\[\]\\\-^$]/g,"\\$&")+"]","g");a=a.replace(n,"")}for(;m>4,f=(15&i)<<4|j>>2,g=(3&j)<<6|k,l.push(e),64!==j&&l.push(f),64!==k&&l.push(g);return"string"===c?Utils.byteArrayToUtf8(l):l},toHex:function(a,b,c){if(!a)return"";b="string"==typeof b?b:" ",c=c||2;for(var d="",e=0;e>>4).toString(16)),b.push((15&a[c]).toString(16));return b.join("")},fromHex:function(a,b,c){if(b=b||(a.indexOf(" ")>=0?"Space":"None"),c=c||2,"None"!==b){var d=Utils.regexRep[b];a=a.replace(d,"")}for(var e=[],f=0;f]*>.*<\/(script|style)>/gim,"")),a.replace(/<[^>\n]+>/g,"")},escapeHtml:function(a){return a.replace(/>>3]|=parseInt(a.substr(d,2),16)<<24-d%8*4;return new CryptoJS.lib.WordArray.init(c,b/2)};var Base={DEFAULT_RADIX:36,runTo:function(a,b){if(!a)throw"Error: Input must be a number";var c=b[0]||Base.DEFAULT_RADIX;if(c<2||c>36)throw"Error: Radix argument must be between 2 and 36";return a.toString(c)},runFrom:function(a,b){var c=b[0]||Base.DEFAULT_RADIX;if(c<2||c>36)throw"Error: Radix argument must be between 2 and 36";return parseInt(a.replace(/\s/g,""),c)}},Base64={ALPHABET:"A-Za-z0-9+/=",ALPHABET_OPTIONS:[{name:"Standard: A-Za-z0-9+/=",value:"A-Za-z0-9+/="},{name:"URL safe: A-Za-z0-9-_",value:"A-Za-z0-9-_"},{name:"Filename safe: A-Za-z0-9+-=",value:"A-Za-z0-9+\\-="},{name:"itoa64: ./0-9A-Za-z=",value:"./0-9A-Za-z="},{name:"XML: A-Za-z0-9_.",value:"A-Za-z0-9_."},{name:"y64: A-Za-z0-9._-",value:"A-Za-z0-9._-"},{name:"z64: 0-9a-zA-Z+/=",value:"0-9a-zA-Z+/="},{name:"Radix-64: 0-9A-Za-z+/=",value:"0-9A-Za-z+/="},{name:"Uuencoding: [space]-_",value:" -_"},{name:"Xxencoding: +-0-9A-Za-z",value:"+\\-0-9A-Za-z"},{name:"BinHex: !-,-0-689@A-NP-VX-Z[`a-fh-mp-r",value:"!-,-0-689@A-NP-VX-Z[`a-fh-mp-r"},{name:"ROT13: N-ZA-Mn-za-m0-9+/=",value:"N-ZA-Mn-za-m0-9+/="}],runTo:function(a,b){var c=b[0]||Base64.ALPHABET;return Utils.toBase64(a,c)},REMOVE_NON_ALPH_CHARS:!0,runFrom:function(a,b){var c=b[0]||Base64.ALPHABET,d=b[1];return Utils.fromBase64(a,c,"byteArray",d)},BASE32_ALPHABET:"A-Z2-7=",runTo32:function(a,b){if(!a)return"";for(var c,d,e,f,g,h,i,j,k,l,m,n,o,p=b[0]?Utils.expandAlphRange(b[0]).join(""):"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",q="",r=0;r>3,i=(7&c)<<2|d>>6,j=d>>1&31,k=(1&d)<<4|e>>4,l=(15&e)<<1|f>>7,m=f>>2&63,n=(3&f)<<3|g>>5,o=31&g,isNaN(d)?j=k=l=m=n=o=32:isNaN(e)?l=m=n=o=32:isNaN(f)?m=n=o=32:isNaN(g)&&(o=32),q+=p.charAt(h)+p.charAt(i)+p.charAt(j)+p.charAt(k)+p.charAt(l)+p.charAt(m)+p.charAt(n)+p.charAt(o);return q},runFrom32:function(a,b){if(!a)return[];var c,d,e,f,g,h,i,j,k,l,m,n,o,p=b[0]?Utils.expandAlphRange(b[0]).join(""):"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",q=b[0],r=[],s=0;if(q){var t=new RegExp("[^"+p.replace(/[\]\\\-^]/g,"\\$&")+"]","g");a=a.replace(t,"")}for(;s>2,d=(3&i)<<6|j<<1|k>>4,e=(15&k)<<4|l>>1,f=(1&l)<<7|m<<2|n>>3,g=(7&n)<<5|o,r.push(c),(i&!0||32!==j)&&r.push(d),(k&!0||32!==l)&&r.push(e),(l&!0||32!==m)&&r.push(f),(n&!0||32!==o)&&r.push(g);return r},SHOW_IN_BINARY:!1,OFFSETS_SHOW_VARIABLE:!0,runOffsets:function(a,b){var c=b[0]||Base64.ALPHABET,d=b[1],e=Utils.toBase64(a,c),f=Utils.toBase64([0].concat(a),c),g=Utils.toBase64([0,0].concat(a),c),h=e.indexOf("="),i=f.indexOf("="),j=g.indexOf("="),k=""; - + var chunkEntropy = 0; if (chunkSize !== 0) { for (var i = 0; i < input.length; i += chunkSize) { @@ -64,17 +64,17 @@ var Entropy = { } else { output += "Chunk size cannot be 0."; } - + return output; }, - - + + /** * @constant * @default */ FREQ_ZEROS: false, - + /** * Frequency distribution operation. * @@ -84,29 +84,29 @@ var Entropy = { */ runFreqDistrib: function (input, args) { if (!input.length) return "No data"; - + var distrib = new Array(256), percentages = new Array(256), len = input.length, showZeroes = args[0]; - + // Initialise distrib to 0 for (var i = 0; i < 256; i++) { distrib[i] = 0; } - + // Count bytes for (i = 0; i < len; i++) { distrib[input[i]]++; } - + // Calculate percentages var repr = 0; for (i = 0; i < 256; i++) { if (distrib[i] > 0) repr++; percentages[i] = distrib[i] / len * 100; } - + // Print var output = "
                                  " + "Total data length: " + len + @@ -123,7 +123,7 @@ var Entropy = { \ CanvasComponents.drawBarChart(canvas, scores, 'Byte', 'Frequency %', 16, 6);\ "; - + for (i = 0; i < 256; i++) { if (distrib[i] || showZeroes) { output += " " + Utils.hex(i, 2) + " (" + @@ -131,11 +131,11 @@ var Entropy = { Array(Math.ceil(percentages[i])+1).join("|") + "\n"; } } - + return output; }, - - + + /** * Calculates the Shannon entropy for a given chunk of data. * @@ -147,19 +147,19 @@ var Entropy = { var prob = [], uniques = data.unique(), str = Utils.byteArrayToChars(data); - + for (var i = 0; i < uniques.length; i++) { prob.push(str.count(Utils.chr(uniques[i])) / data.length); } - + var entropy = 0, p; - + for (i = 0; i < prob.length; i++) { p = prob[i]; entropy += p * Math.log(p) / Math.log(2); } - + return -entropy; }, diff --git a/src/js/operations/Extract.js b/src/js/operations/Extract.js index 64390a3c..ac0899bf 100755 --- a/src/js/operations/Extract.js +++ b/src/js/operations/Extract.js @@ -24,17 +24,17 @@ var Extract = { var output = "", total = 0, match; - + while ((match = searchRegex.exec(input))) { if (removeRegex && removeRegex.test(match[0])) continue; total++; output += match[0] + "\n"; } - + if (includeTotal) output = "Total found: " + total + "\n\n" + output; - + return output; }, @@ -49,7 +49,7 @@ var Extract = { * @default */ DISPLAY_TOTAL: false, - + /** * Strings operation. * @@ -62,11 +62,11 @@ var Extract = { displayTotal = args[1], strings = "[A-Z\\d/\\-:.,_$%'\"()<>= !\\[\\]{}@]", regex = new RegExp(strings + "{" + minLen + ",}", "ig"); - + return Extract._search(input, regex, null, displayTotal); }, - - + + /** * @constant * @default @@ -82,7 +82,7 @@ var Extract = { * @default */ REMOVE_LOCAL: false, - + /** * Extract IP addresses operation. * @@ -98,7 +98,7 @@ var Extract = { ipv4 = "(?:(?:\\d|[01]?\\d\\d|2[0-4]\\d|25[0-5])\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d|\\d)(?:\\/\\d{1,2})?", ipv6 = "((?=.*::)(?!.*::.+::)(::)?([\\dA-F]{1,4}:(:|\\b)|){5}|([\\dA-F]{1,4}:){6})((([\\dA-F]{1,4}((?!\\3)::|:\\b|(?![\\dA-F])))|(?!\\2\\3)){2}|(((2[0-4]|1\\d|[1-9])?\\d|25[0-5])\\.?\\b){4})", ips = ""; - + if (includeIpv4 && includeIpv6) { ips = ipv4 + "|" + ipv6; } else if (includeIpv4) { @@ -106,10 +106,10 @@ var Extract = { } else if (includeIpv6) { ips = ipv6; } - + if (ips) { var regex = new RegExp(ips, "ig"); - + if (removeLocal) { var ten = "10\\..+", oneninetwo = "192\\.168\\..+", @@ -117,7 +117,7 @@ var Extract = { onetwoseven = "127\\..+", removeRegex = new RegExp("^(?:" + ten + "|" + oneninetwo + "|" + oneseventwo + "|" + onetwoseven + ")"); - + return Extract._search(input, regex, removeRegex, displayTotal); } else { return Extract._search(input, regex, null, displayTotal); @@ -126,8 +126,8 @@ var Extract = { return ""; } }, - - + + /** * Extract email addresses operation. * @@ -138,11 +138,11 @@ var Extract = { runEmail: function(input, args) { var displayTotal = args[0], regex = /\w[-.\w]*@[-\w]+(?:\.[-\w]+)*\.[A-Z]{2,4}/ig; - + return Extract._search(input, regex, null, displayTotal); }, - - + + /** * Extract MAC addresses operation. * @@ -153,11 +153,11 @@ var Extract = { runMac: function(input, args) { var displayTotal = args[0], regex = /[A-F\d]{2}(?:[:-][A-F\d]{2}){5}/ig; - + return Extract._search(input, regex, null, displayTotal); }, - - + + /** * Extract URLs operation. * @@ -171,14 +171,14 @@ var Extract = { hostname = "[-\\w]+(?:\\.\\w[-\\w]*)+", port = ":\\d+", path = "/[^.!,?;\"'<>()\\[\\]{}\\s\\x7F-\\xFF]*"; - + path += "(?:[.!,?]+[^.!,?;\"'<>()\\[\\]{}\\s\\x7F-\\xFF]+)*"; var regex = new RegExp(protocol + hostname + "(?:" + port + ")?(?:" + path + ")?", "ig"); return Extract._search(input, regex, null, displayTotal); }, - - + + /** * Extract domains operation. * @@ -192,11 +192,11 @@ var Extract = { hostname = "[-\\w\\.]+", tld = "\\.(?:com|net|org|biz|info|co|uk|onion|int|mobi|name|edu|gov|mil|eu|ac|ae|af|de|ca|ch|cn|cy|es|gb|hk|il|in|io|tv|me|nl|no|nz|ro|ru|tr|us|az|ir|kz|uz|pk)+", regex = new RegExp("(?:" + protocol + ")?" + hostname + tld, "ig"); - + return Extract._search(input, regex, null, displayTotal); }, - - + + /** * @constant * @default @@ -207,7 +207,7 @@ var Extract = { * @default */ INCLUDE_UNIX_PATH: true, - + /** * Extract file paths operation. * @@ -226,7 +226,7 @@ var Extract = { "(?:\\." + winExt + ")?", unixPath = "(?:/[A-Z\\d.][A-Z\\d\\-.]{0,61})+", filePaths = ""; - + if (includeWinPath && includeUnixPath) { filePaths = winPath + "|" + unixPath; } else if (includeWinPath) { @@ -234,7 +234,7 @@ var Extract = { } else if (includeUnixPath) { filePaths = unixPath; } - + if (filePaths) { var regex = new RegExp(filePaths, "ig"); return Extract._search(input, regex, null, displayTotal); @@ -242,8 +242,8 @@ var Extract = { return ""; } }, - - + + /** * Extract dates operation. * @@ -257,11 +257,11 @@ var Extract = { date2 = "(?:0[1-9]|[12][0-9]|3[01])[- /.](?:0[1-9]|1[012])[- /.](?:19|20)\\d\\d", // dd/mm/yyyy date3 = "(?:0[1-9]|1[012])[- /.](?:0[1-9]|[12][0-9]|3[01])[- /.](?:19|20)\\d\\d", // mm/dd/yyyy regex = new RegExp(date1 + "|" + date2 + "|" + date3, "ig"); - + return Extract._search(input, regex, null, displayTotal); }, - - + + /** * Extract all identifiers operation. * @@ -273,22 +273,22 @@ var Extract = { var output = ""; output += "IP addresses\n"; output += Extract.runIp(input, [true, true, false]); - + output += "\nEmail addresses\n"; output += Extract.runEmail(input, []); - + output += "\nMAC addresses\n"; output += Extract.runMac(input, []); - + output += "\nURLs\n"; output += Extract.runUrls(input, []); - + output += "\nDomain names\n"; output += Extract.runDomains(input, []); - + output += "\nFile paths\n"; output += Extract.runFilePaths(input, [true, true]); - + output += "\nDates\n"; output += Extract.runDates(input, []); return output; diff --git a/src/js/operations/HTML.js b/src/js/operations/HTML.js index c07d43f0..6a82933d 100755 --- a/src/js/operations/HTML.js +++ b/src/js/operations/HTML.js @@ -243,7 +243,6 @@ var HTML = { }, - /** * Converts an HSL color value to RGB. Conversion formula * adapted from http://en.wikipedia.org/wiki/HSL_colorSpace. @@ -309,7 +308,7 @@ var HTML = { } else { var d = max - min; s = l > 0.5 ? d / (2 - max - min) : d / (max + min); - switch(max) { + switch (max) { case r: h = (g - b) / d + (g < b ? 6 : 0); break; case g: h = (b - r) / d + 2; break; case b: h = (r - g) / d + 4; break; diff --git a/src/js/operations/HTTP.js b/src/js/operations/HTTP.js index 23ab44e8..eab2abf8 100755 --- a/src/js/operations/HTTP.js +++ b/src/js/operations/HTTP.js @@ -10,7 +10,7 @@ * @namespace */ var HTTP = { - + /** * Strip HTTP headers operation. * @@ -21,11 +21,11 @@ var HTTP = { runStripHeaders: function(input, args) { var headerEnd = input.indexOf("\r\n\r\n") + (headerEnd < 0) ? input.indexOf("\n\n") + 2 : headerEnd + 4; - + return (headerEnd < 2) ? input : input.slice(headerEnd, input.length); }, - - + + /** * Parse User Agent operation. * @@ -35,7 +35,7 @@ var HTTP = { */ runParseUserAgent: function(input, args) { var ua = UAS_parser.parse(input); // eslint-disable-line camelcase - + return "Type: " + ua.type + "\n" + "Family: " + ua.uaFamily + "\n" + "Name: " + ua.uaName + "\n" + diff --git a/src/js/operations/Hash.js b/src/js/operations/Hash.js index 2d43e3de..ed30c1c1 100755 --- a/src/js/operations/Hash.js +++ b/src/js/operations/Hash.js @@ -34,7 +34,7 @@ var Hash = { return Utils.toHexFast(CryptoApi.hash("md4", input, {})); }, - + /** * MD5 operation. * @@ -58,8 +58,8 @@ var Hash = { runSHA0: function (input, args) { return Utils.toHexFast(CryptoApi.hash("sha0", input, {})); }, - - + + /** * SHA1 operation. * @@ -72,7 +72,7 @@ var Hash = { return CryptoJS.SHA1(input).toString(CryptoJS.enc.Hex); }, - + /** * SHA224 operation. * @@ -84,8 +84,8 @@ var Hash = { input = CryptoJS.enc.Latin1.parse(input); return CryptoJS.SHA224(input).toString(CryptoJS.enc.Hex); }, - - + + /** * SHA256 operation. * @@ -97,8 +97,8 @@ var Hash = { input = CryptoJS.enc.Latin1.parse(input); return CryptoJS.SHA256(input).toString(CryptoJS.enc.Hex); }, - - + + /** * SHA384 operation. * @@ -110,8 +110,8 @@ var Hash = { input = CryptoJS.enc.Latin1.parse(input); return CryptoJS.SHA384(input).toString(CryptoJS.enc.Hex); }, - - + + /** * SHA512 operation. * @@ -123,14 +123,14 @@ var Hash = { input = CryptoJS.enc.Latin1.parse(input); return CryptoJS.SHA512(input).toString(CryptoJS.enc.Hex); }, - - + + /** * @constant * @default */ SHA3_LENGTH: ["512", "384", "256", "224"], - + /** * SHA3 operation. * @@ -146,8 +146,8 @@ var Hash = { }; return CryptoJS.SHA3(input, options).toString(CryptoJS.enc.Hex); }, - - + + /** * RIPEMD-160 operation. * @@ -160,13 +160,13 @@ var Hash = { return CryptoJS.RIPEMD160(input).toString(CryptoJS.enc.Hex); }, - + /** * @constant * @default */ HMAC_FUNCTIONS: ["MD5", "SHA1", "SHA224", "SHA256", "SHA384", "SHA512", "SHA3", "RIPEMD-160"], - + /** * HMAC operation. * @@ -189,8 +189,8 @@ var Hash = { }; return execute[hashFunc].toString(CryptoJS.enc.Hex); }, - - + + /** * Generate all hashes operation. * @@ -221,11 +221,11 @@ var Hash = { "\nFletcher-64: " + Checksum.runFletcher64(byteArray, []) + "\nAdler-32: " + Checksum.runAdler32(byteArray, []) + "\nCRC-32: " + Checksum.runCRC32(byteArray, []); - + return output; }, - - + + /** * Analyse hash operation. * @@ -235,21 +235,21 @@ var Hash = { */ runAnalyse: function(input, args) { input = input.replace(/\s/g, ""); - + var output = "", byteLength = input.length / 2, bitLength = byteLength * 8, possibleHashFunctions = []; - + if (!/^[a-f0-9]+$/i.test(input)) { return "Invalid hash"; } - + output += "Hash length: " + input.length + "\n" + "Byte length: " + byteLength + "\n" + "Bit length: " + bitLength + "\n\n" + "Based on the length, this hash could have been generated by one of the following hashing functions:\n"; - + switch (bitLength) { case 4: possibleHashFunctions = [ @@ -376,8 +376,8 @@ var Hash = { ]; break; } - + return output + possibleHashFunctions.join("\n"); }, - + }; diff --git a/src/js/operations/Hexdump.js b/src/js/operations/Hexdump.js index fba95414..bca7c667 100755 --- a/src/js/operations/Hexdump.js +++ b/src/js/operations/Hexdump.js @@ -26,7 +26,7 @@ var Hexdump = { * @default */ INCLUDE_FINAL_LENGTH: false, - + /** * To Hexdump operation. * @@ -38,7 +38,7 @@ var Hexdump = { var length = args[0] || Hexdump.WIDTH; var upperCase = args[1]; var includeFinalLength = args[2]; - + var output = "", padding = 2; for (var i = 0; i < input.length; i += length) { var buff = input.slice(i, i+length); @@ -46,27 +46,27 @@ var Hexdump = { for (var j = 0; j < buff.length; j++) { hexa += Utils.hex(buff[j], padding) + " "; } - + var lineNo = Utils.hex(i, 8); - + if (upperCase) { hexa = hexa.toUpperCase(); lineNo = lineNo.toUpperCase(); } - + output += lineNo + " " + Utils.padRight(hexa, (length*(padding+1))) + " |" + Utils.padRight(Utils.printable(Utils.byteArrayToChars(buff)), buff.length) + "|\n"; - + if (includeFinalLength && i+buff.length === input.length) { output += Utils.hex(i+buff.length, 8) + "\n"; } } - + return output.slice(0, -1); }, - - + + /** * From Hexdump operation. * @@ -78,7 +78,7 @@ var Hexdump = { var output = [], regex = /^\s*(?:[\dA-F]{4,16}:?)?\s*((?:[\dA-F]{2}\s){1,8}(?:\s|[\dA-F]{2}-)(?:[\dA-F]{2}\s){1,8}|(?:[\dA-F]{2}\s|[\dA-F]{4}\s)+)/igm, block, line; - + while ((block = regex.exec(input))) { line = Utils.fromHex(block[1].replace(/-/g, " ")); for (var i = 0; i < line.length; i++) { @@ -94,8 +94,8 @@ var Hexdump = { } return output; }, - - + + /** * Highlight to hexdump * @@ -113,9 +113,9 @@ var Hexdump = { offset = pos[0].start % w, start = 0, end = 0; - + pos[0].start = line*width + 10 + offset*3; - + line = Math.floor(pos[0].end / w); offset = pos[0].end % w; if (offset === 0) { @@ -123,11 +123,11 @@ var Hexdump = { offset = w; } pos[0].end = line*width + 10 + offset*3 - 1; - + // Set up multiple selections for bytes var startLineNum = Math.floor(pos[0].start / width); var endLineNum = Math.floor(pos[0].end / width); - + if (startLineNum === endLineNum) { pos.push(pos[0]); } else { @@ -142,7 +142,7 @@ var Hexdump = { pos.push({ start: start, end: end }); } } - + // Set up multiple selections for ASCII var len = pos.length, lineNum = 0; start = 0; @@ -155,8 +155,8 @@ var Hexdump = { } return pos; }, - - + + /** * Highlight from hexdump * @@ -169,10 +169,10 @@ var Hexdump = { highlightFrom: function(pos, args) { var w = args[0] || 16; var width = 14 + (w*4); - + var line = Math.floor(pos[0].start / width); var offset = pos[0].start % width; - + if (offset < 10) { // In line number section pos[0].start = line*w; } else if (offset > 10+(w*3)) { // In ASCII section @@ -180,10 +180,10 @@ var Hexdump = { } else { // In byte section pos[0].start = line*w + Math.floor((offset-10)/3); } - + line = Math.floor(pos[0].end / width); offset = pos[0].end % width; - + if (offset < 10) { // In line number section pos[0].end = line*w; } else if (offset > 10+(w*3)) { // In ASCII section @@ -191,8 +191,8 @@ var Hexdump = { } else { // In byte section pos[0].end = line*w + Math.ceil((offset-10)/3); } - + return pos; }, - + }; diff --git a/src/js/operations/IP.js b/src/js/operations/IP.js index 02e7fe9c..a8df40d0 100755 --- a/src/js/operations/IP.js +++ b/src/js/operations/IP.js @@ -26,7 +26,7 @@ var IP = { * @default */ ALLOW_LARGE_LIST: false, - + /** * Parse IP range operation. * @@ -38,14 +38,14 @@ var IP = { var includeNetworkInfo = args[0], enumerateAddresses = args[1], allowLargeList = args[2]; - + // Check what type of input we are looking at var ipv4CidrRegex = /^\s*((?:\d{1,3}\.){3}\d{1,3})\/(\d\d?)\s*$/, ipv4RangeRegex = /^\s*((?:\d{1,3}\.){3}\d{1,3})\s*-\s*((?:\d{1,3}\.){3}\d{1,3})\s*$/, ipv6CidrRegex = /^\s*(((?=.*::)(?!.*::.+::)(::)?([\dA-F]{1,4}:(:|\b)|){5}|([\dA-F]{1,4}:){6})((([\dA-F]{1,4}((?!\4)::|:\b|(?![\dA-F])))|(?!\3\4)){2}|(((2[0-4]|1\d|[1-9])?\d|25[0-5])\.?\b){4}))\/(\d\d?\d?)\s*$/i, ipv6RangeRegex = /^\s*(((?=.*::)(?!.*::[^-]+::)(::)?([\dA-F]{1,4}:(:|\b)|){5}|([\dA-F]{1,4}:){6})((([\dA-F]{1,4}((?!\4)::|:\b|(?![\dA-F])))|(?!\3\4)){2}|(((2[0-4]|1\d|[1-9])?\d|25[0-5])\.?\b){4}))\s*-\s*(((?=.*::)(?!.*::.+::)(::)?([\dA-F]{1,4}:(:|\b)|){5}|([\dA-F]{1,4}:){6})((([\dA-F]{1,4}((?!\17)::|:\b|(?![\dA-F])))|(?!\16\17)){2}|(((2[0-4]|1\d|[1-9])?\d|25[0-5])\.?\b){4}))\s*$/i, match; - + if ((match = ipv4CidrRegex.exec(input))) { return IP._ipv4CidrRange(match, includeNetworkInfo, enumerateAddresses, allowLargeList); } else if ((match = ipv4RangeRegex.exec(input))) { @@ -58,8 +58,8 @@ var IP = { return "Invalid input.\n\nEnter either a CIDR range (e.g. 10.0.0.0/24) or a hyphenated range (e.g. 10.0.0.0 - 10.0.1.0). IPv6 also supported."; } }, - - + + /** * @constant * @default @@ -70,7 +70,7 @@ var IP = { * @default */ IPV6_REGEX: /^\s*(((?=.*::)(?!.*::.+::)(::)?([\dA-F]{1,4}:(:|\b)|){5}|([\dA-F]{1,4}:){6})((([\dA-F]{1,4}((?!\4)::|:\b|(?![\dA-F])))|(?!\3\4)){2}|(((2[0-4]|1\d|[1-9])?\d|25[0-5])\.?\b){4}))\s*$/i, - + /** * Parse IPv6 address operation. * @@ -81,14 +81,14 @@ var IP = { runParseIpv6: function (input, args) { var match, output = ""; - + if ((match = IP.IPV6_REGEX.exec(input))) { var ipv6 = IP._strToIpv6(match[1]), longhand = IP._ipv6ToStr(ipv6), shorthand = IP._ipv6ToStr(ipv6, true); - + output += "Longhand: " + longhand + "\nShorthand: " + shorthand + "\n"; - + // Detect reserved addresses if (shorthand === "::") { // Unspecified address @@ -131,34 +131,34 @@ var IP = { flagRandom1 = (ipv6[4] >>> 10) & 15, flagUg = (ipv6[4] >>> 8) & 3, flagRandom2 = ipv6[4] & 255; - + output += "\nServer IPv4 address: " + IP._ipv4ToStr(serverIpv4) + "\nClient IPv4 address: " + IP._ipv4ToStr(clientIpv4) + "\nClient UDP port: " + udpPort + "\nFlags:" + "\n\tCone: " + flagCone; - + if (flagCone) { output += " (Client is behind a cone NAT)"; } else { output += " (Client is not behind a cone NAT)"; } - + output += "\n\tR: " + flagR; - + if (flagR) { output += " Error: This flag should be set to 0. See RFC 5991 and RFC 4380."; } - + output += "\n\tRandom1: " + Utils.bin(flagRandom1, 4) + "\n\tUG: " + Utils.bin(flagUg, 2); - + if (flagUg) { output += " Error: This flag should be set to 00. See RFC 4380."; } - + output += "\n\tRandom2: " + Utils.bin(flagRandom2, 8); - + if (!flagR && !flagUg && flagRandom1 && flagRandom2) { output += "\n\nThis is a valid Teredo address which complies with RFC 4380 and RFC 5991."; } else if (!flagR && !flagUg) { @@ -186,12 +186,12 @@ var IP = { // 6to4 output += "\n6to4 transition IPv6 address detected. See RFC 3056 for more details." + "\n6to4 prefix range: 2002::/16"; - + var v4Addr = IP._ipv4ToStr((ipv6[1] << 16) + ipv6[2]), slaId = ipv6[3], interfaceIdStr = ipv6[4].toString(16) + ipv6[5].toString(16) + ipv6[6].toString(16) + ipv6[7].toString(16), interfaceId = new BigInteger(interfaceIdStr, 16); - + output += "\n\nEncapsulated IPv4 address: " + v4Addr + "\nSLA ID: " + slaId + "\nInterface ID (base 16): " + interfaceIdStr + @@ -214,14 +214,14 @@ var IP = { } return output; }, - - + + /** * @constant * @default */ IP_FORMAT_LIST: ["Dotted Decimal", "Decimal", "Hex"], - + /** * Change IP format operation. * @@ -235,17 +235,17 @@ var IP = { lines = input.split("\n"), output = "", j = 0; - - + + for (var i = 0; i < lines.length; i++) { if (lines[i] === "") continue; var baIp = []; - + if (inFormat === outFormat) { output += lines[i] + "\n"; continue; } - + // Convert to byte array IP from input format switch (inFormat) { case "Dotted Decimal": @@ -267,7 +267,7 @@ var IP = { default: throw "Unsupported input IP format"; } - + // Convert byte array IP to output format switch (outFormat) { case "Dotted Decimal": @@ -292,11 +292,11 @@ var IP = { throw "Unsupported output IP format"; } } - + return output.slice(0, output.length-1); }, - - + + /** * @constant * @default @@ -312,7 +312,7 @@ var IP = { * @default */ GROUP_ONLY_SUBNET: false, - + /** * Group IP addresses operation. * @@ -334,17 +334,17 @@ var IP = { ip = null, network = null, networkStr = ""; - + if (cidr < 0 || cidr > 127) { return "CIDR must be less than 32 for IPv4 or 128 for IPv6"; } - + // Parse all IPs and add to network dictionary for (var i = 0; i < ips.length; i++) { if ((match = IP.IPV4_REGEX.exec(ips[i]))) { ip = IP._strToIpv4(match[1]) >>> 0; network = ip & ipv4Mask; - + if (ipv4Networks.hasOwnProperty(network)) { ipv4Networks[network].push(ip); } else { @@ -354,13 +354,13 @@ var IP = { ip = IP._strToIpv6(match[1]); network = []; networkStr = ""; - + for (var j = 0; j < 8; j++) { network.push(ip[j] & ipv6Mask[j]); } - + networkStr = IP._ipv6ToStr(network, true); - + if (ipv6Networks.hasOwnProperty(networkStr)) { ipv6Networks[networkStr].push(ip); } else { @@ -368,13 +368,13 @@ var IP = { } } } - + // Sort IPv4 network dictionaries and print for (network in ipv4Networks) { ipv4Networks[network] = ipv4Networks[network].sort(); - + output += IP._ipv4ToStr(network) + "/" + cidr + "\n"; - + if (!onlySubnets) { for (i = 0; i < ipv4Networks[network].length; i++) { output += " " + IP._ipv4ToStr(ipv4Networks[network][i]) + "\n"; @@ -382,13 +382,13 @@ var IP = { output += "\n"; } } - + // Sort IPv6 network dictionaries and print for (networkStr in ipv6Networks) { //ipv6Networks[networkStr] = ipv6Networks[networkStr].sort(); TODO - + output += networkStr + "/" + cidr + "\n"; - + if (!onlySubnets) { for (i = 0; i < ipv6Networks[networkStr].length; i++) { output += " " + IP._ipv6ToStr(ipv6Networks[networkStr][i], true) + "\n"; @@ -399,15 +399,15 @@ var IP = { return output; }, - - + + /** * @constant * @default * @private */ _LARGE_RANGE_ERROR: "The specified range contains more than 65,536 addresses. Running this query could crash your browser. If you want to run it, select the \"Allow large queries\" option. You are advised to turn off \"Auto Bake\" whilst editing large ranges.", - + /** * Parses an IPv4 CIDR range (e.g. 192.168.0.0/24) and displays information about it. * @@ -422,15 +422,15 @@ var IP = { var output = "", network = IP._strToIpv4(cidr[1]), cidrRange = parseInt(cidr[2], 10); - + if (cidrRange < 0 || cidrRange > 31) { return "IPv4 CIDR must be less than 32"; } - + var mask = ~(0xFFFFFFFF >>> cidrRange), ip1 = network & mask, ip2 = ip1 | ~mask; - + if (includeNetworkInfo) { output += "Network: " + IP._ipv4ToStr(network) + "\n"; output += "CIDR: " + cidrRange + "\n"; @@ -438,7 +438,7 @@ var IP = { output += "Range: " + IP._ipv4ToStr(ip1) + " - " + IP._ipv4ToStr(ip2) + "\n"; output += "Total addresses in range: " + (((ip2 - ip1) >>> 0) + 1) + "\n\n"; } - + if (enumerateAddresses) { if (cidrRange >= 16 || allowLargeList) { output += IP._generateIpv4Range(ip1, ip2).join("\n"); @@ -448,8 +448,8 @@ var IP = { } return output; }, - - + + /** * Parses an IPv6 CIDR range (e.g. ff00::/48) and displays information about it. * @@ -462,22 +462,22 @@ var IP = { var output = "", network = IP._strToIpv6(cidr[1]), cidrRange = parseInt(cidr[cidr.length-1], 10); - + if (cidrRange < 0 || cidrRange > 127) { return "IPv6 CIDR must be less than 128"; } - + var mask = IP._genIpv6Mask(cidrRange), ip1 = new Array(8), ip2 = new Array(8), totalDiff = "", total = new Array(128); - + for (var i = 0; i < 8; i++) { ip1[i] = network[i] & mask[i]; ip2[i] = ip1[i] | (~mask[i] & 0x0000FFFF); totalDiff = (ip2[i] - ip1[i]).toString(2); - + if (totalDiff !== "0") { for (var n = 0; n < totalDiff.length; n++) { total[i*16 + 16-(totalDiff.length-n)] = totalDiff[n]; @@ -493,11 +493,11 @@ var IP = { output += "Range: " + IP._ipv6ToStr(ip1) + " - " + IP._ipv6ToStr(ip2) + "\n"; output += "Total addresses in range: " + (parseInt(total.join(""), 2) + 1) + "\n\n"; } - + return output; }, - - + + /** * Generates an IPv6 subnet mask given a CIDR value. * @@ -508,7 +508,7 @@ var IP = { _genIpv6Mask: function(cidr) { var mask = new Array(8), shift; - + for (var i = 0; i < 8; i++) { if (cidr > ((i+1)*16)) { mask[i] = 0x0000FFFF; @@ -518,11 +518,11 @@ var IP = { mask[i] = ~((0x0000FFFF >>> shift) | 0xFFFF0000); } } - + return mask; }, - - + + /** * Parses an IPv4 hyphenated range (e.g. 192.168.0.0 - 192.168.0.255) and displays information * about it. @@ -538,23 +538,23 @@ var IP = { var output = "", ip1 = IP._strToIpv4(range[1]), ip2 = IP._strToIpv4(range[2]); - + // Calculate mask var diff = ip1 ^ ip2, cidr = 32, mask = 0; - + while (diff !== 0) { diff >>= 1; cidr--; mask = (mask << 1) | 1; } - + mask = ~mask >>> 0; var network = ip1 & mask, subIp1 = network & mask, subIp2 = subIp1 | ~mask; - + if (includeNetworkInfo) { output += "Minimum subnet required to hold this range:\n"; output += "\tNetwork: " + IP._ipv4ToStr(network) + "\n"; @@ -565,7 +565,7 @@ var IP = { output += "Range: " + IP._ipv4ToStr(ip1) + " - " + IP._ipv4ToStr(ip2) + "\n"; output += "Total addresses in range: " + (((ip2 - ip1) >>> 0) + 1) + "\n\n"; } - + if (enumerateAddresses) { if (((ip2 - ip1) >>> 0) <= 65536 || allowLargeList) { output += IP._generateIpv4Range(ip1, ip2).join("\n"); @@ -575,8 +575,8 @@ var IP = { } return output; }, - - + + /** * Parses an IPv6 hyphenated range (e.g. ff00:: - ffff::) and displays information about it. * @@ -589,14 +589,14 @@ var IP = { var output = "", ip1 = IP._strToIpv6(range[1]), ip2 = IP._strToIpv6(range[14]); - + var t = "", total = new Array(128); - + // Initialise total array to "0" for (var i = 0; i < 128; i++) total[i] = "0"; - + for (i = 0; i < 8; i++) { t = (ip2[i] - ip1[i]).toString(2); if (t !== "0") { @@ -605,17 +605,17 @@ var IP = { } } } - + if (includeNetworkInfo) { output += "Range: " + IP._ipv6ToStr(ip1) + " - " + IP._ipv6ToStr(ip2) + "\n"; output += "Shorthand range: " + IP._ipv6ToStr(ip1, true) + " - " + IP._ipv6ToStr(ip2, true) + "\n"; output += "Total addresses in range: " + (parseInt(total.join(""), 2) + 1) + "\n\n"; } - + return output; }, - - + + /** * Converts an IPv4 address from string format to numerical format. * @@ -631,21 +631,21 @@ var IP = { var blocks = ipStr.split("."), numBlocks = parseBlocks(blocks), result = 0; - + result += numBlocks[0] << 24; result += numBlocks[1] << 16; result += numBlocks[2] << 8; result += numBlocks[3]; - + return result; - + /** * Converts a list of 4 numeric strings in the range 0-255 to a list of numbers. */ function parseBlocks(blocks) { if (blocks.length !== 4) throw "More than 4 blocks."; - + var numBlocks = []; for (var i = 0; i < 4; i++) { numBlocks[i] = parseInt(blocks[i], 10); @@ -655,8 +655,8 @@ var IP = { return numBlocks; } }, - - + + /** * Converts an IPv4 address from numerical format to string format. * @@ -673,11 +673,11 @@ var IP = { blockB = (ipInt >> 16) & 255, blockC = (ipInt >> 8) & 255, blockD = ipInt & 255; - + return blockA + "." + blockB + "." + blockC + "." + blockD; }, - - + + /** * Converts an IPv6 address from string format to numerical array format. * @@ -694,7 +694,7 @@ var IP = { numBlocks = parseBlocks(blocks), j = 0, ipv6 = new Array(8); - + for (var i = 0; i < 8; i++) { if (isNaN(numBlocks[j])) { ipv6[i] = 0; @@ -705,7 +705,7 @@ var IP = { } } return ipv6; - + /** * Converts a list of 3-8 numeric hex strings in the range 0-65535 to a list of numbers. */ @@ -721,8 +721,8 @@ var IP = { return numBlocks; } }, - - + + /** * Converts an IPv6 address from numerical array format to string format. * @@ -741,13 +741,13 @@ var IP = { _ipv6ToStr: function(ipv6, compact) { var output = "", i = 0; - + if (compact) { var start = -1, end = -1, s = 0, e = -1; - + for (i = 0; i < 8; i++) { if (ipv6[i] === 0 && e === (i-1)) { e = i; @@ -759,7 +759,7 @@ var IP = { end = e; } } - + for (i = 0; i < 8; i++) { if (i !== start) { output += Utils.hex(ipv6[i], 1) + ":"; @@ -778,8 +778,8 @@ var IP = { } return output.slice(0, output.length-1); }, - - + + /** * Generates a list of IPv4 addresses in string format between two given numerical values. * diff --git a/src/js/operations/JS.js b/src/js/operations/JS.js index 0f109eee..a2f94dcf 100755 --- a/src/js/operations/JS.js +++ b/src/js/operations/JS.js @@ -10,7 +10,7 @@ * @namespace */ var JS = { - + /** * @constant * @default @@ -36,7 +36,7 @@ var JS = { * @default */ PARSE_TOLERANT: false, - + /** * JavaScript Parser operation. * @@ -58,12 +58,12 @@ var JS = { comment: parseComment, tolerant: parseTolerant }; - + result = esprima.parse(input, options); return JSON.stringify(result, null, 2); }, - - + + /** * @constant * @default @@ -84,7 +84,7 @@ var JS = { * @default */ BEAUTIFY_COMMENT: true, - + /** * JavaScript Beautify operation. * @@ -99,14 +99,14 @@ var JS = { beautifyComment = args[3], result = "", AST; - + try { AST = esprima.parse(input, { range: true, tokens: true, comment: true }); - + var options = { format: { indent: { @@ -117,19 +117,19 @@ var JS = { }, comment: beautifyComment }; - + if (options.comment) AST = escodegen.attachComments(AST, AST.comments, AST.tokens); - + result = escodegen.generate(AST, options); - } catch(e) { + } catch (e) { // Leave original error so the user can see the detail throw "Unable to parse JavaScript.
                                  " + e.message; } return result; }, - - + + /** * JavaScript Minify operation. * @@ -142,7 +142,7 @@ var JS = { AST = esprima.parse(input), optimisedAST = esmangle.optimize(AST, null), mangledAST = esmangle.mangle(optimisedAST); - + result = escodegen.generate(mangledAST, { format: { renumber: true, diff --git a/src/js/operations/MAC.js b/src/js/operations/MAC.js index 8fdd0906..93457e36 100755 --- a/src/js/operations/MAC.js +++ b/src/js/operations/MAC.js @@ -44,7 +44,7 @@ var MAC = { */ runFormat: function(input, args) { if (!input) return ""; - + var outputCase = args[0], noDelim = args[1], dashDelim = args[2], @@ -58,7 +58,7 @@ var MAC = { macHyphen = cleanMac.replace(/(.{2}(?=.))/g, "$1-"), macColon = cleanMac.replace(/(.{2}(?=.))/g, "$1:"), macCisco = cleanMac.replace(/(.{4}(?=.))/g, "$1."); - + if (outputCase === "Lower only") { if (noDelim) outputList.push(cleanMac); if (dashDelim) outputList.push(macHyphen); @@ -75,7 +75,7 @@ var MAC = { if (colonDelim) outputList.push(macColon, macColon.toUpperCase()); if (ciscoStyle) outputList.push(macCisco, macCisco.toUpperCase()); } - + outputList.push( "" // Empty line to delimit groups ); diff --git a/src/js/operations/MorseCode.js b/src/js/operations/MorseCode.js index fbab4aed..52a39ed5 100644 --- a/src/js/operations/MorseCode.js +++ b/src/js/operations/MorseCode.js @@ -89,7 +89,7 @@ var MorseCode = { words = Array.prototype.map.call(words, function(word) { var letters = Array.prototype.map.call(word, function(character) { var letter = character.toUpperCase(); - if(typeof MorseCode.MORSE_TABLE[letter] == "undefined") { + if (typeof MorseCode.MORSE_TABLE[letter] == "undefined") { return ""; } @@ -106,7 +106,7 @@ var MorseCode = { input = input.replace( /|||/g, function(match) { - switch(match) { + switch (match) { case "": return dash; case "": return dot; case "": return letterDelim; @@ -131,14 +131,14 @@ var MorseCode = { var reverseTable = function() { reversedTable = {}; - for(var letter in MorseCode.MORSE_TABLE) { + for (var letter in MorseCode.MORSE_TABLE) { var signal = MorseCode.MORSE_TABLE[letter]; reversedTable[signal] = letter; } }; return function(input, args) { - if(reversedTable === null) { + if (reversedTable === null) { reverseTable(); } diff --git a/src/js/operations/Numberwang.js b/src/js/operations/Numberwang.js index a178b0b8..d19a590d 100755 --- a/src/js/operations/Numberwang.js +++ b/src/js/operations/Numberwang.js @@ -23,5 +23,5 @@ var Numberwang = { return "Sorry, that's not Numberwang. Let's rotate the board!"; } }, - + }; diff --git a/src/js/operations/PublicKey.js b/src/js/operations/PublicKey.js index d73ca286..cb43026a 100755 --- a/src/js/operations/PublicKey.js +++ b/src/js/operations/PublicKey.js @@ -10,13 +10,13 @@ * @namespace */ var PublicKey = { - + /** * @constant * @default */ X509_INPUT_FORMAT: ["PEM", "DER Hex", "Base64", "Raw"], - + /** * Parse X.509 certificate operation. * @@ -27,11 +27,11 @@ var PublicKey = { runParseX509: function (input, args) { var cert = new X509(), inputFormat = args[0]; - + if (!input.length) { return "No input"; } - + switch (inputFormat) { case "DER Hex": input = input.replace(/\s/g, ""); @@ -53,7 +53,7 @@ var PublicKey = { default: throw "Undefined input format"; } - + var version = ASN1HEX.getDecendantHexVByNthList(cert.hex, 0, [0, 0, 0]), sn = cert.getSerialNumberHex(), algorithm = KJUR.asn1.x509.OID.oid2name(KJUR.asn1.ASN1Util.oidHexToInt(ASN1HEX.getDecendantHexVByNthList(cert.hex, 0, [0, 2, 0]))), @@ -69,7 +69,7 @@ var PublicKey = { certSig = ASN1HEX.getDecendantHexVByNthList(cert.hex, 0, [2]).substr(2), sigStr = "", extensions = ASN1HEX.dump(ASN1HEX.getDecendantHexVByNthList(cert.hex, 0, [0, 7])); - + // Public Key fields if (pk.type === "EC") { // ECDSA pkFields.push({ @@ -120,7 +120,7 @@ var PublicKey = { value: "Unknown Public Key type" }); } - + // Signature fields if (ASN1HEX.dump(certSig).indexOf("SEQUENCE") === 0) { // DSA or ECDSA sigStr = " r: " + PublicKey._formatByteStr(ASN1HEX.getDecendantHexVByNthList(certSig, 0, [0]), 16, 18) + "\n" + @@ -128,7 +128,7 @@ var PublicKey = { } else { // RSA sigStr = " Signature: " + PublicKey._formatByteStr(certSig, 16, 18) + "\n"; } - + // Format Public Key fields for (var i = 0; i < pkFields.length; i++) { pkStr += " " + pkFields[i].key + ":" + @@ -138,12 +138,12 @@ var PublicKey = { " " ); } - + var issuerStr = PublicKey._formatDnStr(issuer, 2), nbDate = PublicKey._formatDate(notBefore), naDate = PublicKey._formatDate(notAfter), subjectStr = PublicKey._formatDnStr(subject, 2); - + var output = "Version: " + (parseInt(version, 16) + 1) + " (0x" + version + ")\n" + "Serial number: " + new BigInteger(sn, 16).toString() + " (0x" + sn + ")\n" + "Algorithm ID: " + algorithm + "\n" + @@ -162,11 +162,11 @@ var PublicKey = { sigStr + "\nExtensions (parsed ASN.1)\n" + extensions; - + return output; }, - + /** * PEM to Hex operation. * @@ -185,14 +185,14 @@ var PublicKey = { } return KEYUTIL.getHexFromPEM(input); }, - - + + /** * @constant * @default */ PEM_HEADER_STRING: "CERTIFICATE", - + /** * Hex to PEM operation. * @@ -203,8 +203,8 @@ var PublicKey = { runHexToPem: function(input, args) { return KJUR.asn1.ASN1Util.getPEMStringFromHex(input.replace(/\s/g, ""), args[0]); }, - - + + /** * Hex to Object Identifier operation. * @@ -215,8 +215,8 @@ var PublicKey = { runHexToObjectIdentifier: function(input, args) { return KJUR.asn1.ASN1Util.oidHexToInt(input.replace(/\s/g, "")); }, - - + + /** * Object Identifier to Hex operation. * @@ -227,14 +227,14 @@ var PublicKey = { runObjectIdentifierToHex: function(input, args) { return KJUR.asn1.ASN1Util.oidIntToHex(input); }, - - + + /** * @constant * @default */ ASN1_TRUNCATE_LENGTH: 32, - + /** * Parse ASN.1 hex string operation. * @@ -249,8 +249,8 @@ var PublicKey = { "ommitLongOctet": truncateLen }, index); }, - - + + /** * Formats Distinguished Name (DN) strings. * @@ -266,29 +266,29 @@ var PublicKey = { key, value, str; - + for (var i = 0; i < fields.length; i++) { if (!fields[i].length) continue; - + key = fields[i].split("=")[0]; - + maxKeyLen = key.length > maxKeyLen ? key.length : maxKeyLen; } - + for (i = 0; i < fields.length; i++) { if (!fields[i].length) continue; - + key = fields[i].split("=")[0]; value = fields[i].split("=")[1]; str = Utils.padRight(key, maxKeyLen) + " = " + value + "\n"; - + output += Utils.padLeft(str, indent + str.length, " "); } - + return output; }, - - + + /** * Formats byte strings by adding line breaks and delimiters. * @@ -302,7 +302,7 @@ var PublicKey = { byteStr = Utils.toHex(Utils.fromHex(byteStr), ":"); length = length * 3; var output = ""; - + for (var i = 0; i < byteStr.length; i += length) { var str = byteStr.slice(i, i + length) + "\n"; if (i === 0) { @@ -311,11 +311,11 @@ var PublicKey = { output += Utils.padLeft(str, indent + str.length, " "); } } - + return output.slice(0, output.length-1); }, - - + + /** * Formats dates. * @@ -331,7 +331,7 @@ var PublicKey = { dateStr[8] + dateStr[9] + ":" + dateStr[10] + dateStr[11]; }, - + }; diff --git a/src/js/operations/Punycode.js b/src/js/operations/Punycode.js index edc1293a..8fb80579 100755 --- a/src/js/operations/Punycode.js +++ b/src/js/operations/Punycode.js @@ -16,7 +16,7 @@ var Punycode = { * @default */ IDN: false, - + /** * To Punycode operation. * @@ -26,15 +26,15 @@ var Punycode = { */ runToAscii: function(input, args) { var idn = args[0]; - + if (idn) { return punycode.ToASCII(input); } else { return punycode.encode(input); } }, - - + + /** * From Punycode operation. * @@ -44,12 +44,12 @@ var Punycode = { */ runToUnicode: function(input, args) { var idn = args[0]; - + if (idn) { return punycode.ToUnicode(input); } else { return punycode.decode(input); } }, - + }; diff --git a/src/js/operations/QuotedPrintable.js b/src/js/operations/QuotedPrintable.js index 7e3645e8..c19a11b4 100755 --- a/src/js/operations/QuotedPrintable.js +++ b/src/js/operations/QuotedPrintable.js @@ -2,14 +2,14 @@ ======================================================================== mimelib: http://github.com/andris9/mimelib Copyright (c) 2011-2012 Andris Reinman - + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -31,7 +31,7 @@ * @namespace */ var QuotedPrintable = { - + /** * To Quoted Printable operation. * @@ -41,7 +41,7 @@ var QuotedPrintable = { */ runTo: function (input, args) { var mimeEncodedStr = QuotedPrintable.mimeEncode(input); - + // fix line breaks mimeEncodedStr = mimeEncodedStr.replace(/\r?\n|\r/g, function() { return "\r\n"; @@ -51,8 +51,8 @@ var QuotedPrintable = { return QuotedPrintable._addSoftLinebreaks(mimeEncodedStr, "qp"); }, - - + + /** * From Quoted Printable operation. * @@ -64,8 +64,8 @@ var QuotedPrintable = { var str = input.replace(/\=(?:\r?\n|$)/g, ""); return QuotedPrintable.mimeDecode(str); }, - - + + /** * Decodes mime-encoded data. * @@ -91,8 +91,8 @@ var QuotedPrintable = { return buffer; }, - - + + /** * Encodes mime data. * @@ -123,8 +123,8 @@ var QuotedPrintable = { return result; }, - - + + /** * Checks if a given number falls within a given set of ranges. * @@ -145,7 +145,7 @@ var QuotedPrintable = { return false; }, - + /** * Adds soft line breaks to a string. * Lines can't be longer that 76 + = 78 bytes @@ -168,7 +168,7 @@ var QuotedPrintable = { } }, - + /** * Adds soft line breaks to a base64 string. * @@ -182,7 +182,7 @@ var QuotedPrintable = { return base64EncodedStr.replace(new RegExp(".{" + lineLengthMax + "}", "g"), "$&\r\n").trim(); }, - + /** * Adds soft line breaks to a quoted printable string. * @@ -266,5 +266,5 @@ var QuotedPrintable = { return result; }, - + }; diff --git a/src/js/operations/Rotate.js b/src/js/operations/Rotate.js index 4a423cae..accb93d1 100755 --- a/src/js/operations/Rotate.js +++ b/src/js/operations/Rotate.js @@ -21,7 +21,7 @@ var Rotate = { * @default */ ROTATE_WHOLE: false, - + /** * Runs rotation operations across the input data. * @@ -42,8 +42,8 @@ var Rotate = { } return result; }, - - + + /** * Rotate right operation. * @@ -58,8 +58,8 @@ var Rotate = { return Rotate._rot(input, args[0], Rotate._rotr); } }, - - + + /** * Rotate left operation. * @@ -74,8 +74,8 @@ var Rotate = { return Rotate._rot(input, args[0], Rotate._rotl); } }, - - + + /** * @constant * @default @@ -105,12 +105,12 @@ var Rotate = { chr, rot13Lowercase = args[0], rot13Upperacse = args[1]; - + if (amount) { if (amount < 0) { amount = 26 - (Math.abs(amount) % 26); } - + for (var i = 0; i < input.length; i++) { chr = input[i]; if (rot13Upperacse && chr >= 65 && chr <= 90) { // Upper case @@ -173,8 +173,8 @@ var Rotate = { var bit = (b & 1) << 7; return (b >> 1) | bit; }, - - + + /** * Rotate left bitwise op. * @@ -186,8 +186,8 @@ var Rotate = { var bit = (b >> 7) & 1; return ((b << 1) | bit) & 0xFF; }, - - + + /** * Rotates a byte array to the right by a specific amount as a whole, so that bits are wrapped * from the end of the array to the beginning. @@ -201,7 +201,7 @@ var Rotate = { var carryBits = 0, newByte, result = []; - + amount = amount % 8; for (var i = 0; i < data.length; i++) { var oldByte = data[i] >>> 0; @@ -212,8 +212,8 @@ var Rotate = { result[0] |= carryBits; return result; }, - - + + /** * Rotates a byte array to the left by a specific amount as a whole, so that bits are wrapped * from the beginning of the array to the end. @@ -227,7 +227,7 @@ var Rotate = { var carryBits = 0, newByte, result = []; - + amount = amount % 8; for (var i = data.length-1; i >= 0; i--) { var oldByte = data[i]; diff --git a/src/js/operations/SeqUtils.js b/src/js/operations/SeqUtils.js index 7100d5c5..cd6ac99b 100755 --- a/src/js/operations/SeqUtils.js +++ b/src/js/operations/SeqUtils.js @@ -24,7 +24,7 @@ var SeqUtils = { * @default */ SORT_ORDER: ["Alphabetical (case sensitive)", "Alphabetical (case insensitive)", "IP address"], - + /** * Sort operation. * @@ -37,7 +37,7 @@ var SeqUtils = { sortReverse = args[1], order = args[2], sorted = input.split(delim); - + if (order === "Alphabetical (case sensitive)") { sorted = sorted.sort(); } else if (order === "Alphabetical (case insensitive)") { @@ -45,12 +45,12 @@ var SeqUtils = { } else if (order === "IP address") { sorted = sorted.sort(SeqUtils._ipSort); } - + if (sortReverse) sorted.reverse(); return sorted.join(delim); }, - - + + /** * Unique operation. * @@ -62,14 +62,14 @@ var SeqUtils = { var delim = Utils.charRep[args[0]]; return input.split(delim).unique().join(delim); }, - - + + /** * @constant * @default */ SEARCH_TYPE: ["Regex", "Extended (\\n, \\t, \\x...)", "Simple string"], - + /** * Count occurrences operation. * @@ -80,13 +80,13 @@ var SeqUtils = { runCount: function(input, args) { var search = args[0].string, type = args[0].option; - + if (type === "Regex" && search) { try { var regex = new RegExp(search, "gi"), matches = input.match(regex); return matches.length; - } catch(err) { + } catch (err) { return 0; } } else if (search) { @@ -98,14 +98,14 @@ var SeqUtils = { return 0; } }, - - + + /** * @constant * @default */ REVERSE_BY: ["Character", "Line"], - + /** * Reverse operation. * @@ -137,8 +137,8 @@ var SeqUtils = { return input.reverse(); } }, - - + + /** * Add line numbers operation. * @@ -150,14 +150,14 @@ var SeqUtils = { var lines = input.split("\n"), output = "", width = lines.length.toString().length; - + for (var n = 0; n < lines.length; n++) { output += Utils.pad((n+1).toString(), width, " ") + " " + lines[n] + "\n"; } return output.slice(0, output.length-1); }, - - + + /** * Remove line numbers operation. * @@ -168,8 +168,8 @@ var SeqUtils = { runRemoveLineNumbers: function(input, args) { return input.replace(/^[ \t]{0,5}\d+[\s:|\-,.)\]]/gm, ""); }, - - + + /** * Expand alphabet range operation. * @@ -180,8 +180,8 @@ var SeqUtils = { runExpandAlphRange: function(input, args) { return Utils.expandAlphRange(input).join(args[0]); }, - - + + /** * Comparison operation for sorting of strings ignoring case. * @@ -193,8 +193,8 @@ var SeqUtils = { _caseInsensitiveSort: function(a, b) { return a.toLowerCase().localeCompare(b.toLowerCase()); }, - - + + /** * Comparison operation for sorting of IPv4 addresses. * @@ -206,15 +206,15 @@ var SeqUtils = { _ipSort: function(a, b) { var a_ = a.split("."), b_ = b.split("."); - + a_ = a_[0] * 0x1000000 + a_[1] * 0x10000 + a_[2] * 0x100 + a_[3] * 1; b_ = b_[0] * 0x1000000 + b_[1] * 0x10000 + b_[2] * 0x100 + b_[3] * 1; - + if (isNaN(a_) && !isNaN(b_)) return 1; if (!isNaN(a_) && isNaN(b_)) return -1; if (isNaN(a_) && isNaN(b_)) return a.localeCompare(b); - + return a_ - b_; }, - + }; diff --git a/src/js/operations/StrUtils.js b/src/js/operations/StrUtils.js index 8f13e28a..ee2e38aa 100755 --- a/src/js/operations/StrUtils.js +++ b/src/js/operations/StrUtils.js @@ -89,7 +89,7 @@ var StrUtils = { * @default */ DISPLAY_TOTAL: false, - + /** * Regular expression operation. * @@ -104,14 +104,14 @@ var StrUtils = { displayTotal = args[4], outputFormat = args[5], modifiers = "g"; - + if (i) modifiers += "i"; if (m) modifiers += "m"; - + if (userRegex && userRegex !== "^" && userRegex !== "$") { try { var regex = new RegExp(userRegex, modifiers); - + switch (outputFormat) { case "Highlight matches": return StrUtils._regexHighlight(input, regex, displayTotal); @@ -132,13 +132,13 @@ var StrUtils = { } }, - + /** * @constant * @default */ CASE_SCOPE: ["All", "Word", "Sentence", "Paragraph"], - + /** * To Upper case operation. * @@ -148,7 +148,7 @@ var StrUtils = { */ runUpper: function (input, args) { var scope = args[0]; - + switch (scope) { case "Word": return input.replace(/(\b\w)/gi, function(m) { @@ -168,8 +168,8 @@ var StrUtils = { return input.toUpperCase(); } }, - - + + /** * To Upper case operation. * @@ -180,8 +180,8 @@ var StrUtils = { runLower: function (input, args) { return input.toLowerCase(); }, - - + + /** * @constant * @default @@ -202,7 +202,7 @@ var StrUtils = { * @default */ FIND_REPLACE_MULTILINE : true, - + /** * Find / Replace operation. * @@ -218,24 +218,24 @@ var StrUtils = { i = args[3], m = args[4], modifiers = ""; - + if (g) modifiers += "g"; if (i) modifiers += "i"; if (m) modifiers += "m"; - + if (type === "Regex") { find = new RegExp(find, modifiers); } else if (type.indexOf("Extended") === 0) { find = Utils.parseEscapedChars(find); } - + return input.replace(find, replace, modifiers); // Non-standard addition of flags in the third argument. This will work in Firefox but // probably nowhere else. The purpose is to allow global matching when the `find` parameter // is just a string. }, - - + + /** * @constant * @default @@ -246,7 +246,7 @@ var StrUtils = { * @default */ DELIMITER_OPTIONS: ["Line feed", "CRLF", "Space", "Comma", "Semi-colon", "Colon", "Nothing (separate chars)"], - + /** * Split operation. * @@ -258,7 +258,7 @@ var StrUtils = { var splitDelim = args[0] || StrUtils.SPLIT_DELIM, joinDelim = Utils.charRep[args[1]], sections = input.split(splitDelim); - + return sections.join(joinDelim); }, @@ -287,8 +287,8 @@ var StrUtils = { return input.split(delim).filter(regexFilter).join(delim); }, - - + + /** * @constant * @default @@ -299,7 +299,7 @@ var StrUtils = { * @default */ DIFF_BY: ["Character", "Word", "Line", "Sentence", "CSS", "JSON"], - + /** * Diff operation. * @@ -316,11 +316,11 @@ var StrUtils = { samples = input.split(sampleDelim), output = "", diff; - + if (!samples || samples.length !== 2) { return "Incorrect number of samples, perhaps you need to modify the sample delimiter or add more samples?"; } - + switch (diffBy) { case "Character": diff = JsDiff.diffChars(samples[0], samples[1]); @@ -351,7 +351,7 @@ var StrUtils = { default: return "Invalid 'Diff by' option."; } - + for (var i = 0; i < diff.length; i++) { if (diff[i].added) { if (showAdded) output += "" + Utils.escapeHtml(diff[i].value) + ""; @@ -361,17 +361,17 @@ var StrUtils = { output += Utils.escapeHtml(diff[i].value); } } - + return output; }, - - + + /** * @constant * @default */ OFF_CHK_SAMPLE_DELIMITER: "\\n\\n", - + /** * Offset checker operation. * @@ -388,21 +388,21 @@ var StrUtils = { match = false, inMatch = false, chr; - + if (!samples || samples.length < 2) { return "Not enough samples, perhaps you need to modify the sample delimiter or add more data?"; } - + // Initialise output strings for (s = 0; s < samples.length; s++) { outputs[s] = ""; } - + // Loop through each character in the first sample for (i = 0; i < samples[0].length; i++) { chr = samples[0][i]; match = false; - + // Loop through each sample to see if the chars are the same for (s = 1; s < samples.length; s++) { if (samples[s][i] !== chr) { @@ -411,7 +411,7 @@ var StrUtils = { } match = true; } - + // Write output for each sample for (s = 0; s < samples.length; s++) { if (samples[s].length <= i) { @@ -419,7 +419,7 @@ var StrUtils = { if (s === samples.length - 1) inMatch = false; continue; } - + if (match && !inMatch) { outputs[s] += "" + Utils.escapeHtml(samples[s][i]); if (samples[s].length === i + 1) outputs[s] += ""; @@ -434,18 +434,18 @@ var StrUtils = { if (samples[s].length - 1 !== i) inMatch = false; } } - + if (samples[0].length - 1 === i) { if (inMatch) outputs[s] += ""; outputs[s] += Utils.escapeHtml(samples[s].substring(i + 1)); } } } - + return outputs.join(sampleDelim); }, - - + + /** * Parse escaped string operation. * @@ -456,8 +456,8 @@ var StrUtils = { runParseEscapedString: function(input, args) { return Utils.parseEscapedChars(input); }, - - + + /** * Adds HTML highlights to matches within a string. * @@ -473,31 +473,31 @@ var StrUtils = { hl = 1, i = 0, total = 0; - + while ((m = regex.exec(input))) { // Add up to match output += Utils.escapeHtml(input.slice(i, m.index)); - + // Add match with highlighting output += "" + Utils.escapeHtml(m[0]) + ""; - + // Switch highlight hl = hl === 1 ? 2 : 1; - + i = regex.lastIndex; total++; } - + // Add all after final match output += Utils.escapeHtml(input.slice(i, input.length)); - + if (displayTotal) output = "Total found: " + total + "\n\n" + output; return output; }, - - + + /** * Creates a string listing the matches within a string. * @@ -513,7 +513,7 @@ var StrUtils = { var output = "", total = 0, match; - + while ((match = regex.exec(input))) { total++; if (matches) { @@ -528,11 +528,11 @@ var StrUtils = { } } } - + if (displayTotal) output = "Total found: " + total + "\n\n" + output; - + return output; }, - + }; diff --git a/src/js/operations/Tidy.js b/src/js/operations/Tidy.js index 8b708c89..1fe0a3ed 100755 --- a/src/js/operations/Tidy.js +++ b/src/js/operations/Tidy.js @@ -39,7 +39,7 @@ var Tidy = { * @default */ REMOVE_FULL_STOPS : false, - + /** * Remove whitespace operation. * @@ -55,7 +55,7 @@ var Tidy = { removeFormFeeds = args[4], removeFullStops = args[5], data = input; - + if (removeSpaces) data = data.replace(/ /g, ""); if (removeCariageReturns) data = data.replace(/\r/g, ""); if (removeLineFeeds) data = data.replace(/\n/g, ""); @@ -64,8 +64,8 @@ var Tidy = { if (removeFullStops) data = data.replace(/\./g, ""); return data; }, - - + + /** * Remove null bytes operation. * @@ -80,8 +80,8 @@ var Tidy = { } return output; }, - - + + /** * @constant * @default @@ -97,7 +97,7 @@ var Tidy = { * @default */ DROP_LENGTH : 5, - + /** * Drop bytes operation. * @@ -109,17 +109,17 @@ var Tidy = { var start = args[0], length = args[1], applyToEachLine = args[2]; - + if (start < 0 || length < 0) throw "Error: Invalid value"; - + if (!applyToEachLine) return input.slice(0, start).concat(input.slice(start+length, input.length)); - + // Split input into lines var lines = [], line = []; - + for (var i = 0; i < input.length; i++) { if (input[i] === 0x0a) { lines.push(line); @@ -129,7 +129,7 @@ var Tidy = { } } lines.push(line); - + var output = []; for (i = 0; i < lines.length; i++) { output = output.concat(lines[i].slice(0, start).concat(lines[i].slice(start+length, lines[i].length))); @@ -137,8 +137,8 @@ var Tidy = { } return output.slice(0, output.length-1); }, - - + + /** * @constant * @default @@ -149,7 +149,7 @@ var Tidy = { * @default */ TAKE_LENGTH: 5, - + /** * Take bytes operation. * @@ -161,17 +161,17 @@ var Tidy = { var start = args[0], length = args[1], applyToEachLine = args[2]; - + if (start < 0 || length < 0) throw "Error: Invalid value"; - + if (!applyToEachLine) return input.slice(start, start+length); - + // Split input into lines var lines = [], line = []; - + for (var i = 0; i < input.length; i++) { if (input[i] === 0x0a) { lines.push(line); @@ -181,7 +181,7 @@ var Tidy = { } } lines.push(line); - + var output = []; for (i = 0; i < lines.length; i++) { output = output.concat(lines[i].slice(start, start+length)); @@ -189,8 +189,8 @@ var Tidy = { } return output.slice(0, output.length-1); }, - - + + /** * @constant * @default @@ -206,7 +206,7 @@ var Tidy = { * @default */ PAD_CHAR : " ", - + /** * Pad lines operation. * @@ -221,7 +221,7 @@ var Tidy = { lines = input.split("\n"), output = "", i = 0; - + if (position === "Start") { for (i = 0; i < lines.length; i++) { output += Utils.padLeft(lines[i], lines[i].length+len, chr) + "\n"; @@ -231,8 +231,8 @@ var Tidy = { output += Utils.padRight(lines[i], lines[i].length+len, chr) + "\n"; } } - + return output.slice(0, output.length-1); }, - + }; diff --git a/src/js/operations/URL.js b/src/js/operations/URL.js index 4ed0f923..a42f47a1 100755 --- a/src/js/operations/URL.js +++ b/src/js/operations/URL.js @@ -17,7 +17,7 @@ var URL_ = { * @default */ ENCODE_ALL: false, - + /** * URL Encode operation. * @@ -29,8 +29,8 @@ var URL_ = { var encodeAll = args[0]; return encodeAll ? URL_._encodeAllChars(input) : encodeURI(input); }, - - + + /** * URL Decode operation. * @@ -42,12 +42,12 @@ var URL_ = { var data = input.replace(/\+/g, "%20"); try { return decodeURIComponent(data); - } catch(err) { + } catch (err) { return unescape(data); } }, - - + + /** * Parse URI operation. * @@ -57,11 +57,11 @@ var URL_ = { */ runParse: function(input, args) { var a = document.createElement("a"); - + // Overwrite base href which will be the current CyberChef URL to reduce confusion. a.href = "http://example.com/"; a.href = input; - + if (a.protocol) { var output = ""; if (a.hostname !== window.location.hostname) { @@ -69,7 +69,7 @@ var URL_ = { if (a.hostname) output += "Hostname:\t" + a.hostname + "\n"; if (a.port) output += "Port:\t\t" + a.port + "\n"; } - + if (a.pathname && a.pathname !== window.location.pathname) { var pathname = a.pathname; if (pathname.indexOf(window.location.pathname) === 0) @@ -77,11 +77,11 @@ var URL_ = { if (pathname) output += "Path name:\t" + pathname + "\n"; } - + if (a.hash && a.hash !== window.location.hash) { output += "Hash:\t\t" + a.hash + "\n"; } - + if (a.search && a.search !== window.location.search) { output += "Arguments:\n"; var args_ = (a.search.slice(1, a.search.length)).split("&"); @@ -97,14 +97,14 @@ var URL_ = { else output += "\n"; } } - + return output; } - + return "Invalid URI"; }, - - + + /** * URL encodes additional special characters beyond the standard set. * @@ -126,5 +126,5 @@ var URL_ = { .replace(/_/g, "%5F") .replace(/~/g, "%7E"); }, - + }; diff --git a/src/js/operations/Unicode.js b/src/js/operations/Unicode.js index d93ed9e5..2ab39c86 100755 --- a/src/js/operations/Unicode.js +++ b/src/js/operations/Unicode.js @@ -28,25 +28,25 @@ var Unicode = { output = "", m, i = 0; - + while ((m = regex.exec(input))) { // Add up to match output += input.slice(i, m.index); i = m.index; - + // Add match output += Utils.chr(parseInt(m[1], 16)); - + i = regex.lastIndex; } - + // Add all after final match output += input.slice(i, input.length); - + return output; }, - - + + /** * Lookup table to add prefixes to unicode delimiters so that they can be used in a regex. * diff --git a/src/js/views/html/ControlsWaiter.js b/src/js/views/html/ControlsWaiter.js index 2c67927f..a53a6e4f 100755 --- a/src/js/views/html/ControlsWaiter.js +++ b/src/js/views/html/ControlsWaiter.js @@ -30,13 +30,13 @@ ControlsWaiter.prototype.adjustWidth = function() { stepImg = document.querySelector("#step img"), clrRecipImg = document.querySelector("#clr-recipe img"), clrBreaksImg = document.querySelector("#clr-breaks img"); - + if (controls.clientWidth < 470) { step.childNodes[1].nodeValue = " Step"; } else { step.childNodes[1].nodeValue = " Step through"; } - + if (controls.clientWidth < 400) { saveImg.style.display = "none"; loadImg.style.display = "none"; @@ -50,7 +50,7 @@ ControlsWaiter.prototype.adjustWidth = function() { clrRecipImg.style.display = "inline"; clrBreaksImg.style.display = "inline"; } - + if (controls.clientWidth < 330) { clrBreaks.childNodes[1].nodeValue = " Clear breaks"; } else { @@ -66,7 +66,7 @@ ControlsWaiter.prototype.adjustWidth = function() { */ ControlsWaiter.prototype.setAutoBake = function(value) { var autoBakeCheckbox = document.getElementById("auto-bake"); - + if (autoBakeCheckbox.checked !== value) { autoBakeCheckbox.click(); } @@ -97,9 +97,9 @@ ControlsWaiter.prototype.stepClick = function() { ControlsWaiter.prototype.autoBakeChange = function() { var autoBakeLabel = document.getElementById("auto-bake-label"), autoBakeCheckbox = document.getElementById("auto-bake"); - + this.app.autoBake_ = autoBakeCheckbox.checked; - + if (autoBakeCheckbox.checked) { autoBakeLabel.classList.remove("btn-default"); autoBakeLabel.classList.add("btn-success"); @@ -124,7 +124,7 @@ ControlsWaiter.prototype.clearRecipeClick = function() { */ ControlsWaiter.prototype.clearBreaksClick = function() { var bps = document.querySelectorAll("#rec-list li.operation .breakpoint"); - + for (var i = 0; i < bps.length; i++) { bps[i].setAttribute("break", "false"); bps[i].classList.remove("breakpoint-selected"); @@ -139,12 +139,12 @@ ControlsWaiter.prototype.clearBreaksClick = function() { */ ControlsWaiter.prototype.initialiseSaveLink = function(recipeConfig) { recipeConfig = recipeConfig || this.app.getRecipeConfig(); - + var includeRecipe = document.getElementById("save-link-recipe-checkbox").checked, includeInput = document.getElementById("save-link-input-checkbox").checked, saveLinkEl = document.getElementById("save-link"), saveLink = this.generateStateUrl(includeRecipe, includeInput, recipeConfig); - + saveLinkEl.innerHTML = Utils.truncate(saveLink, 120); saveLinkEl.setAttribute("href", saveLink); }; @@ -161,26 +161,26 @@ ControlsWaiter.prototype.initialiseSaveLink = function(recipeConfig) { */ ControlsWaiter.prototype.generateStateUrl = function(includeRecipe, includeInput, recipeConfig, baseURL) { recipeConfig = recipeConfig || this.app.getRecipeConfig(); - + var link = baseURL || window.location.protocol + "//" + window.location.host + window.location.pathname, recipeStr = JSON.stringify(recipeConfig), inputStr = Utils.toBase64(this.app.getInput(), "A-Za-z0-9+/"); // B64 alphabet with no padding - + includeRecipe = includeRecipe && (recipeConfig.length > 0); includeInput = includeInput && (inputStr.length > 0) && (inputStr.length < 8000); if (includeRecipe) { link += "?recipe=" + encodeURIComponent(recipeStr); } - + if (includeRecipe && includeInput) { link += "&input=" + encodeURIComponent(inputStr); } else if (includeInput) { link += "?input=" + encodeURIComponent(inputStr); } - + return link; }; @@ -192,7 +192,7 @@ ControlsWaiter.prototype.saveTextChange = function() { try { var recipeConfig = JSON.parse(document.getElementById("save-text").value); this.initialiseSaveLink(recipeConfig); - } catch(err) {} + } catch (err) {} }; @@ -202,9 +202,9 @@ ControlsWaiter.prototype.saveTextChange = function() { ControlsWaiter.prototype.saveClick = function() { var recipeConfig = this.app.getRecipeConfig(), recipeStr = JSON.stringify(recipeConfig).replace(/},{/g, "},\n{"); - + document.getElementById("save-text").value = recipeStr; - + this.initialiseSaveLink(recipeConfig); $("#save-modal").modal(); }; @@ -241,25 +241,25 @@ ControlsWaiter.prototype.loadClick = function() { ControlsWaiter.prototype.saveButtonClick = function() { var recipeName = document.getElementById("save-name").value, recipeStr = document.getElementById("save-text").value; - + if (!recipeName) { this.app.alert("Please enter a recipe name", "danger", 2000); return; } - + var savedRecipes = localStorage.savedRecipes ? JSON.parse(localStorage.savedRecipes) : [], recipeId = localStorage.recipeId || 0; - + savedRecipes.push({ id: ++recipeId, name: recipeName, recipe: recipeStr }); - + localStorage.savedRecipes = JSON.stringify(savedRecipes); localStorage.recipeId = recipeId; - + this.app.alert("Recipe saved as \"" + recipeName + "\".", "success", 2000); }; @@ -269,7 +269,7 @@ ControlsWaiter.prototype.saveButtonClick = function() { */ ControlsWaiter.prototype.populateLoadRecipesList = function() { var loadNameEl = document.getElementById("load-name"); - + // Remove current recipes from select var i = loadNameEl.options.length; while (i--) { @@ -279,15 +279,15 @@ ControlsWaiter.prototype.populateLoadRecipesList = function() { // Add recipes to select var savedRecipes = localStorage.savedRecipes ? JSON.parse(localStorage.savedRecipes) : []; - + for (i = 0; i < savedRecipes.length; i++) { var opt = document.createElement("option"); opt.value = savedRecipes[i].id; opt.innerHTML = savedRecipes[i].name; - + loadNameEl.appendChild(opt); } - + // Populate textarea with first recipe document.getElementById("load-text").value = savedRecipes.length ? savedRecipes[0].recipe : ""; }; @@ -300,11 +300,11 @@ ControlsWaiter.prototype.loadDeleteClick = function() { var id = parseInt(document.getElementById("load-name").value, 10), savedRecipes = localStorage.savedRecipes ? JSON.parse(localStorage.savedRecipes) : []; - + savedRecipes = savedRecipes.filter(function(r) { return r.id !== id; }); - + localStorage.savedRecipes = JSON.stringify(savedRecipes); this.populateLoadRecipesList(); }; @@ -318,11 +318,11 @@ ControlsWaiter.prototype.loadNameChange = function(e) { savedRecipes = localStorage.savedRecipes ? JSON.parse(localStorage.savedRecipes) : [], id = parseInt(el.value, 10); - + var recipe = savedRecipes.filter(function(r) { return r.id === id; })[0]; - + document.getElementById("load-text").value = recipe.recipe; }; @@ -336,7 +336,7 @@ ControlsWaiter.prototype.loadButtonClick = function() { this.app.setRecipeConfig(recipeConfig); $("#rec-list [data-toggle=popover]").popover(); - } catch(e) { + } catch (e) { this.app.alert("Invalid recipe", "danger", 2000); } }; diff --git a/src/js/views/html/HTMLApp.js b/src/js/views/html/HTMLApp.js index b4930da4..4e7aa78d 100755 --- a/src/js/views/html/HTMLApp.js +++ b/src/js/views/html/HTMLApp.js @@ -362,13 +362,13 @@ HTMLApp.prototype.loadURIParams = function() { try { var recipeConfig = JSON.parse(this.queryString.recipe); this.setRecipeConfig(recipeConfig); - } catch(err) {} + } catch (err) {} } else if (this.queryString.op) { // If there's no recipe, look for single operations this.manager.recipe.clearRecipe(); try { this.manager.recipe.addOperation(this.queryString.op); - } catch(err) { + } catch (err) { // If no exact match, search for nearest match and add that var matchedOps = this.manager.ops.filterOperations(this.queryString.op, false); if (matchedOps.length) { @@ -388,7 +388,7 @@ HTMLApp.prototype.loadURIParams = function() { try { var inputData = Utils.fromBase64(this.queryString.input); this.setInput(inputData); - } catch(err) {} + } catch (err) {} } // Restore auto-bake state diff --git a/src/js/views/html/HTMLCategory.js b/src/js/views/html/HTMLCategory.js index 071d3b81..fff68c39 100755 --- a/src/js/views/html/HTMLCategory.js +++ b/src/js/views/html/HTMLCategory.js @@ -40,11 +40,11 @@ HTMLCategory.prototype.toHtml = function() { \
                                    "; - + for (var i = 0; i < this.opList.length; i++) { html += this.opList[i].toStubHtml(); } - + html += "
                                  "; return html; }; diff --git a/src/js/views/html/HTMLIngredient.js b/src/js/views/html/HTMLIngredient.js index 909b16cd..641da53c 100755 --- a/src/js/views/html/HTMLIngredient.js +++ b/src/js/views/html/HTMLIngredient.js @@ -13,7 +13,7 @@ var HTMLIngredient = function(config, app, manager) { this.app = app; this.manager = manager; - + this.name = config.name; this.type = config.type; this.value = config.value; @@ -39,11 +39,11 @@ HTMLIngredient.prototype.toHtml = function() { this.type === "binaryShortString"), html = inline ? "" : "
                                   
                                  ", i, m; - + html += "
                                  "; - + switch (this.type) { case "string": case "binaryString": @@ -83,7 +83,7 @@ HTMLIngredient.prototype.toHtml = function() { html += ""; - + if (this.disableArgs) { this.manager.addDynamicListener("#" + this.id, "click", this.toggleDisableArgs, this); } @@ -116,7 +116,7 @@ HTMLIngredient.prototype.toHtml = function() { } } html += ""; - + this.manager.addDynamicListener("#" + this.id, "change", this.populateOptionChange, this); break; case "editableOption": @@ -132,8 +132,8 @@ HTMLIngredient.prototype.toHtml = function() { (this.disabled ? " disabled='disabled'" : "") + (this.placeholder ? " placeholder='" + this.placeholder + "'" : "") + ">"; html += "
                                  "; - - + + this.manager.addDynamicListener("#sel-" + this.id, "change", this.editableOptionChange, this); break; case "text": @@ -146,7 +146,7 @@ HTMLIngredient.prototype.toHtml = function() { break; } html += ""; - + return html; }; @@ -162,10 +162,10 @@ HTMLIngredient.prototype.toggleDisableArgs = function(e) { op = el.parentNode.parentNode, args = op.querySelectorAll(".arg-group"), els; - + for (var i = 0; i < this.disableArgs.length; i++) { els = args[this.disableArgs[i]].querySelectorAll("input, select, button"); - + for (var j = 0; j < els.length; j++) { if (els[j].getAttribute("disabled")) { els[j].removeAttribute("disabled"); @@ -174,7 +174,7 @@ HTMLIngredient.prototype.toggleDisableArgs = function(e) { } } } - + this.manager.recipe.ingChange(); }; @@ -191,7 +191,7 @@ HTMLIngredient.prototype.populateOptionChange = function(e) { target = op.querySelectorAll(".arg-group")[this.target].querySelector("input, select, textarea"); target.value = el.childNodes[el.selectedIndex].getAttribute("populate-value"); - + this.manager.recipe.ingChange(); }; @@ -207,6 +207,6 @@ HTMLIngredient.prototype.editableOptionChange = function(e) { input = select.nextSibling; input.value = select.childNodes[select.selectedIndex].value; - + this.manager.recipe.ingChange(); }; diff --git a/src/js/views/html/HTMLOperation.js b/src/js/views/html/HTMLOperation.js index 48a33661..d58d81ed 100755 --- a/src/js/views/html/HTMLOperation.js +++ b/src/js/views/html/HTMLOperation.js @@ -14,13 +14,13 @@ var HTMLOperation = function(name, config, app, manager) { this.app = app; this.manager = manager; - + this.name = name; this.description = config.description; this.manualBake = config.manualBake || false; this.config = config; this.ingList = []; - + for (var i = 0; i < config.args.length; i++) { var ing = new HTMLIngredient(config.args[i], this.app, this.manager); this.ingList.push(ing); @@ -45,25 +45,25 @@ HTMLOperation.REMOVE_ICON = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABwkl */ HTMLOperation.prototype.toStubHtml = function(removeIcon) { var html = "
                                • "; } - + if (this.description) { html += ""; } - + html += "
                                • "; - + return html; }; @@ -79,15 +79,15 @@ HTMLOperation.prototype.toFullHtml = function() { for (var i = 0; i < this.ingList.length; i++) { html += this.ingList[i].toHtml(); } - + html += "
                                  \
                                  \
                                  "; - + html += "
                                  \
                                   
                                  "; - + return html; }; @@ -105,7 +105,7 @@ HTMLOperation.prototype.highlightSearchString = function(searchStr, namePos, des this.name.slice(namePos, namePos + searchStr.length) + "" + this.name.slice(namePos + searchStr.length); } - + if (this.description && descPos >= 0) { this.description = this.description.slice(0, descPos) + "" + this.description.slice(descPos, descPos + searchStr.length) + "" + diff --git a/src/js/views/html/InputWaiter.js b/src/js/views/html/InputWaiter.js index 6ffc498f..e28669a9 100755 --- a/src/js/views/html/InputWaiter.js +++ b/src/js/views/html/InputWaiter.js @@ -12,7 +12,7 @@ var InputWaiter = function(app, manager) { this.app = app; this.manager = manager; - + // Define keys that don't change the input so we don't have to autobake when they are pressed this.badKeys = [ 16, //Shift @@ -65,10 +65,10 @@ InputWaiter.prototype.set = function(input) { InputWaiter.prototype.setInputInfo = function(length, lines) { var width = length.toString().length; width = width < 2 ? 2 : width; - + var lengthStr = Utils.pad(length.toString(), width, " ").replace(/ /g, " "); var linesStr = Utils.pad(lines.toString(), width, " ").replace(/ /g, " "); - + document.getElementById("input-info").innerHTML = "length: " + lengthStr + "
                                  lines: " + linesStr; }; @@ -84,17 +84,17 @@ InputWaiter.prototype.setInputInfo = function(length, lines) { InputWaiter.prototype.inputChange = function(e) { // Remove highlighting from input and output panes as the offsets might be different now this.manager.highlighter.removeHighlights(); - + // Reset recipe progress as any previous processing will be redundant now this.app.progress = 0; - + // Update the input metadata info var inputText = this.get(), lines = inputText.count("\n") + 1; - + this.setInputInfo(inputText.length, lines); - - + + if (this.badKeys.indexOf(e.keyCode) < 0) { // Fire the statechange event as the input has been modified window.dispatchEvent(this.manager.statechange); @@ -112,7 +112,7 @@ InputWaiter.prototype.inputDragover = function(e) { // This will be set if we're dragging an operation if (e.dataTransfer.effectAllowed === "move") return false; - + e.stopPropagation(); e.preventDefault(); e.target.classList.add("dropping-file"); @@ -142,10 +142,10 @@ InputWaiter.prototype.inputDrop = function(e) { // This will be set if we're dragging an operation if (e.dataTransfer.effectAllowed === "move") return false; - + e.stopPropagation(); e.preventDefault(); - + var el = e.target, file = e.dataTransfer.files[0], text = e.dataTransfer.getData("Text"), @@ -153,23 +153,23 @@ InputWaiter.prototype.inputDrop = function(e) { inputCharcode = "", offset = 0, CHUNK_SIZE = 20480; // 20KB - + var setInput = function() { if (inputCharcode.length > 100000 && this.app.autoBake_) { this.manager.controls.setAutoBake(false); this.app.alert("Turned off Auto Bake as the input is large", "warning", 5000); } - + this.set(inputCharcode); var recipeConfig = this.app.getRecipeConfig(); if (!recipeConfig[0] || recipeConfig[0].op !== "From Hex") { recipeConfig.unshift({op:"From Hex", args:["Space"]}); this.app.setRecipeConfig(recipeConfig); } - + el.classList.remove("loadingFile"); }.bind(this); - + var seek = function() { if (offset >= file.size) { setInput(); @@ -179,17 +179,17 @@ InputWaiter.prototype.inputDrop = function(e) { var slice = file.slice(offset, offset + CHUNK_SIZE); reader.readAsArrayBuffer(slice); }; - + reader.onload = function(e) { var data = new Uint8Array(reader.result); inputCharcode += Utils.toHexFast(data); offset += CHUNK_SIZE; seek(); }; - - + + el.classList.remove("dropping-file"); - + if (file) { el.classList.add("loadingFile"); seek(); diff --git a/src/js/views/html/Manager.js b/src/js/views/html/Manager.js index d8f8d284..8bcb2d06 100755 --- a/src/js/views/html/Manager.js +++ b/src/js/views/html/Manager.js @@ -10,7 +10,7 @@ */ var Manager = function(app) { this.app = app; - + // Define custom events /** * @event Manager#appstart @@ -32,7 +32,7 @@ var Manager = function(app) { * @event Manager#statechange */ this.statechange = new CustomEvent("statechange", {bubbles: true}); - + // Define Waiter objects to handle various areas this.window = new WindowWaiter(this.app); this.controls = new ControlsWaiter(this.app, this); @@ -43,10 +43,10 @@ var Manager = function(app) { this.options = new OptionsWaiter(this.app); this.highlighter = new HighlighterWaiter(this.app); this.seasonal = new SeasonalWaiter(this.app, this); - + // Object to store dynamic handlers to fire on elements that may not exist yet this.dynamicHandlers = {}; - + this.initialiseEventListeners(); }; @@ -71,7 +71,7 @@ Manager.prototype.initialiseEventListeners = function() { window.addEventListener("focus", this.window.windowFocus.bind(this.window)); window.addEventListener("statechange", this.app.stateChange.bind(this.app)); window.addEventListener("popstate", this.app.popState.bind(this.app)); - + // Controls document.getElementById("bake").addEventListener("click", this.controls.bakeClick.bind(this.controls)); document.getElementById("auto-bake").addEventListener("change", this.controls.autoBakeChange.bind(this.controls)); @@ -88,7 +88,7 @@ Manager.prototype.initialiseEventListeners = function() { document.getElementById("load-button").addEventListener("click", this.controls.loadButtonClick.bind(this.controls)); document.getElementById("support").addEventListener("click", this.controls.supportButtonClick.bind(this.controls)); this.addMultiEventListener("#save-text", "keyup paste", this.controls.saveTextChange, this.controls); - + // Operations this.addMultiEventListener("#search", "keyup paste search", this.ops.searchOperations, this.ops); this.addDynamicListener(".op-list li.operation", "dblclick", this.ops.operationDblclick, this.ops); @@ -99,7 +99,7 @@ Manager.prototype.initialiseEventListeners = function() { this.addDynamicListener(".op-list .op-icon", "mouseleave", this.ops.opIconMouseleave, this.ops); this.addDynamicListener(".op-list", "oplistcreate", this.ops.opListCreate, this.ops); this.addDynamicListener("li.operation", "operationadd", this.recipe.opAdd.bind(this.recipe)); - + // Recipe this.addDynamicListener(".arg", "keyup", this.recipe.ingChange, this.recipe); this.addDynamicListener(".arg", "change", this.recipe.ingChange, this.recipe); @@ -109,7 +109,7 @@ Manager.prototype.initialiseEventListeners = function() { this.addDynamicListener("#rec-list li.operation > div", "dblclick", this.recipe.operationChildDblclick, this.recipe); this.addDynamicListener("#rec-list .input-group .dropdown-menu a", "click", this.recipe.dropdownToggleClick, this.recipe); this.addDynamicListener("#rec-list", "operationremove", this.recipe.opRemove.bind(this.recipe)); - + // Input this.addMultiEventListener("#input-text", "keyup paste", this.input.inputChange, this.input); document.getElementById("reset-layout").addEventListener("click", this.app.resetLayout.bind(this.app)); @@ -121,7 +121,7 @@ Manager.prototype.initialiseEventListeners = function() { document.getElementById("input-text").addEventListener("mouseup", this.highlighter.inputMouseup.bind(this.highlighter)); document.getElementById("input-text").addEventListener("mousemove", this.highlighter.inputMousemove.bind(this.highlighter)); this.addMultiEventListener("#input-text", "mousedown dblclick select", this.highlighter.inputMousedown, this.highlighter); - + // Output document.getElementById("save-to-file").addEventListener("click", this.output.saveClick.bind(this.output)); document.getElementById("switch").addEventListener("click", this.output.switchClick.bind(this.output)); @@ -134,7 +134,7 @@ Manager.prototype.initialiseEventListeners = function() { document.getElementById("output-html").addEventListener("mousemove", this.highlighter.outputHtmlMousemove.bind(this.highlighter)); this.addMultiEventListener("#output-text", "mousedown dblclick select", this.highlighter.outputMousedown, this.highlighter); this.addMultiEventListener("#output-html", "mousedown dblclick select", this.highlighter.outputHtmlMousedown, this.highlighter); - + // Options document.getElementById("options").addEventListener("click", this.options.optionsClick.bind(this.options)); document.getElementById("reset-options").addEventListener("click", this.options.resetOptionsClick.bind(this.options)); @@ -143,7 +143,7 @@ Manager.prototype.initialiseEventListeners = function() { this.addDynamicListener(".option-item input[type=number]", "keyup", this.options.numberChange, this.options); this.addDynamicListener(".option-item input[type=number]", "change", this.options.numberChange, this.options); this.addDynamicListener(".option-item select", "change", this.options.selectChange, this.options); - + // Misc document.getElementById("alert-close").addEventListener("click", this.app.alertCloseClick.bind(this.app)); }; @@ -231,7 +231,7 @@ Manager.prototype.addDynamicListener = function(selector, eventType, callback, s selector: selector, callback: callback.bind(scope || this) }; - + if (this.dynamicHandlers.hasOwnProperty(eventType)) { // Listener already exists, add new handler to the appropriate list this.dynamicHandlers[eventType].push(eventConfig); @@ -256,7 +256,7 @@ Manager.prototype.dynamicListenerHandler = function(e) { e.target.mozMatchesSelector || e.target.msMatchesSelector || e.target.oMatchesSelector; - + for (var i = 0; i < handlers.length; i++) { if (matches && e.target[matches.name](handlers[i].selector)) { handlers[i].callback(e); diff --git a/src/js/views/html/OperationsWaiter.js b/src/js/views/html/OperationsWaiter.js index 3b9b4e2d..ad788c01 100755 --- a/src/js/views/html/OperationsWaiter.js +++ b/src/js/views/html/OperationsWaiter.js @@ -14,7 +14,7 @@ var OperationsWaiter = function(app, manager) { this.app = app; this.manager = manager; - + this.options = {}; this.removeIntent = false; }; @@ -28,7 +28,7 @@ var OperationsWaiter = function(app, manager) { */ OperationsWaiter.prototype.searchOperations = function(e) { var ops, selected; - + if (e.type === "search") { // Search e.preventDefault(); ops = document.querySelectorAll("#search-results li"); @@ -40,7 +40,7 @@ OperationsWaiter.prototype.searchOperations = function(e) { } } } - + if (e.keyCode === 13) { // Return e.preventDefault(); } else if (e.keyCode === 40) { // Down @@ -69,21 +69,21 @@ OperationsWaiter.prototype.searchOperations = function(e) { var searchResultsEl = document.getElementById("search-results"), el = e.target, str = el.value; - + while (searchResultsEl.firstChild) { $(searchResultsEl.firstChild).popover("destroy"); searchResultsEl.removeChild(searchResultsEl.firstChild); } - + $("#categories .in").collapse("hide"); if (str) { var matchedOps = this.filterOperations(str, true), matchedOpsHtml = ""; - + for (var i = 0; i < matchedOps.length; i++) { matchedOpsHtml += matchedOps[i].toStubHtml(); } - + searchResultsEl.innerHTML = matchedOpsHtml; searchResultsEl.dispatchEvent(this.manager.oplistcreate); } @@ -102,20 +102,20 @@ OperationsWaiter.prototype.searchOperations = function(e) { OperationsWaiter.prototype.filterOperations = function(searchStr, highlight) { var matchedOps = [], matchedDescs = []; - + searchStr = searchStr.toLowerCase(); - + for (var opName in this.app.operations) { var op = this.app.operations[opName], namePos = opName.toLowerCase().indexOf(searchStr), descPos = op.description.toLowerCase().indexOf(searchStr); - + if (namePos >= 0 || descPos >= 0) { var operation = new HTMLOperation(opName, this.app.operations[opName], this.app, this.manager); if (highlight) { operation.highlightSearchString(searchStr, namePos, descPos); } - + if (namePos < 0) { matchedOps.push(operation); } else { @@ -123,7 +123,7 @@ OperationsWaiter.prototype.filterOperations = function(searchStr, highlight) { } } } - + return matchedDescs.concat(matchedOps); }; @@ -165,7 +165,7 @@ OperationsWaiter.prototype.opListCreate = function(e) { */ OperationsWaiter.prototype.operationDblclick = function(e) { var li = e.target; - + this.manager.recipe.addOperation(li.textContent); this.app.autoBake(); }; @@ -180,23 +180,23 @@ OperationsWaiter.prototype.operationDblclick = function(e) { OperationsWaiter.prototype.editFavouritesClick = function(e) { e.preventDefault(); e.stopPropagation(); - + // Add favourites to modal var favCat = this.app.categories.filter(function(c) { return c.name === "Favourites"; })[0]; - + var html = ""; for (var i = 0; i < favCat.ops.length; i++) { var opName = favCat.ops[i]; var operation = new HTMLOperation(opName, this.app.operations[opName], this.app, this.manager); html += operation.toStubHtml(true); } - + var editFavouritesList = document.getElementById("edit-favourites-list"); editFavouritesList.innerHTML = html; this.removeIntent = false; - + var editableList = Sortable.create(editFavouritesList, { filter: ".remove-icon", onFilter: function (evt) { @@ -210,15 +210,15 @@ OperationsWaiter.prototype.editFavouritesClick = function(e) { if (this.removeIntent) evt.item.remove(); }.bind(this), }); - + Sortable.utils.on(editFavouritesList, "dragleave", function() { this.removeIntent = true; }.bind(this)); - + Sortable.utils.on(editFavouritesList, "dragover", function() { this.removeIntent = false; }.bind(this)); - + $("#edit-favourites-list [data-toggle=popover]").popover(); $("#favourites-modal").modal(); }; @@ -231,7 +231,7 @@ OperationsWaiter.prototype.editFavouritesClick = function(e) { OperationsWaiter.prototype.saveFavouritesClick = function() { var favouritesList = [], favs = document.querySelectorAll("#edit-favourites-list li"); - + for (var i = 0; i < favs.length; i++) { favouritesList.push(favs[i].textContent); } @@ -276,7 +276,7 @@ OperationsWaiter.prototype.opIconMouseover = function(e) { OperationsWaiter.prototype.opIconMouseleave = function(e) { var opEl = e.target.parentNode, toEl = e.toElement || e.relatedElement; - + if (e.target.getAttribute("data-toggle") === "popover" && toEl === opEl) { $(opEl).popover("show"); } diff --git a/src/js/views/html/OptionsWaiter.js b/src/js/views/html/OptionsWaiter.js index 3650fce5..e04a09ca 100755 --- a/src/js/views/html/OptionsWaiter.js +++ b/src/js/views/html/OptionsWaiter.js @@ -23,11 +23,11 @@ OptionsWaiter.prototype.load = function(options) { size: "small", animate: false, }); - + for (var option in options) { this.app.options[option] = options[option]; } - + // Set options to match object var cboxes = document.querySelectorAll("#options-body input[type=checkbox]"); for (var i = 0; i < cboxes.length; i++) { @@ -39,7 +39,7 @@ OptionsWaiter.prototype.load = function(options) { nboxes[i].value = this.app.options[nboxes[i].getAttribute("option")]; nboxes[i].dispatchEvent(new CustomEvent("change", {bubbles: true})); } - + var selects = document.querySelectorAll("#options-body select"); for (i = 0; i < selects.length; i++) { selects[i].value = this.app.options[selects[i].getAttribute("option")]; @@ -76,7 +76,7 @@ OptionsWaiter.prototype.resetOptionsClick = function() { OptionsWaiter.prototype.switchChange = function(e, state) { var el = e.target, option = el.getAttribute("option"); - + this.app.options[option] = state; localStorage.setItem("options", JSON.stringify(this.app.options)); }; @@ -91,7 +91,7 @@ OptionsWaiter.prototype.switchChange = function(e, state) { OptionsWaiter.prototype.numberChange = function(e) { var el = e.target, option = el.getAttribute("option"); - + this.app.options[option] = parseInt(el.value, 10); localStorage.setItem("options", JSON.stringify(this.app.options)); }; @@ -106,7 +106,7 @@ OptionsWaiter.prototype.numberChange = function(e) { OptionsWaiter.prototype.selectChange = function(e) { var el = e.target, option = el.getAttribute("option"); - + this.app.options[option] = el.value; localStorage.setItem("options", JSON.stringify(this.app.options)); }; @@ -121,7 +121,7 @@ OptionsWaiter.prototype.setWordWrap = function() { document.getElementById("output-html").classList.remove("word-wrap"); document.getElementById("input-highlighter").classList.remove("word-wrap"); document.getElementById("output-highlighter").classList.remove("word-wrap"); - + if (!this.app.options.wordWrap) { document.getElementById("input-text").classList.add("word-wrap"); document.getElementById("output-text").classList.add("word-wrap"); diff --git a/src/js/views/html/OutputWaiter.js b/src/js/views/html/OutputWaiter.js index b7bb3d74..d651047d 100755 --- a/src/js/views/html/OutputWaiter.js +++ b/src/js/views/html/OutputWaiter.js @@ -43,10 +43,10 @@ OutputWaiter.prototype.set = function(dataStr, type, duration) { outputHtml.style.display = "block"; outputHighlighter.display = "none"; inputHighlighter.display = "none"; - + outputText.value = ""; outputHtml.innerHTML = dataStr; - + // Execute script sections var scriptElements = outputHtml.querySelectorAll("script"); for (var i = 0; i < scriptElements.length; i++) { @@ -61,11 +61,11 @@ OutputWaiter.prototype.set = function(dataStr, type, duration) { outputHtml.style.display = "none"; outputHighlighter.display = "block"; inputHighlighter.display = "block"; - + outputText.value = Utils.printable(dataStr, true); outputHtml.innerHTML = ""; } - + this.manager.highlighter.removeHighlights(); var lines = dataStr.count("\n") + 1; this.setOutputInfo(dataStr.length, lines, duration); @@ -82,11 +82,11 @@ OutputWaiter.prototype.set = function(dataStr, type, duration) { OutputWaiter.prototype.setOutputInfo = function(length, lines, duration) { var width = length.toString().length; width = width < 4 ? 4 : width; - + var lengthStr = Utils.pad(length.toString(), width, " ").replace(/ /g, " "); var linesStr = Utils.pad(lines.toString(), width, " ").replace(/ /g, " "); var timeStr = Utils.pad(duration.toString() + "ms", width, " ").replace(/ /g, " "); - + document.getElementById("output-info").innerHTML = "time: " + timeStr + "
                                  length: " + lengthStr + "
                                  lines: " + linesStr; @@ -105,7 +105,7 @@ OutputWaiter.prototype.adjustWidth = function() { switchIO = document.getElementById("switch"), undoSwitch = document.getElementById("undo-switch"), maximiseOutput = document.getElementById("maximise-output"); - + if (output.clientWidth < 680) { saveToFile.childNodes[1].nodeValue = ""; switchIO.childNodes[1].nodeValue = ""; @@ -128,16 +128,16 @@ OutputWaiter.prototype.adjustWidth = function() { OutputWaiter.prototype.saveClick = function() { var data = Utils.toBase64(this.app.dishStr), filename = window.prompt("Please enter a filename:", "download.dat"); - + if (filename) { var el = document.createElement("a"); el.setAttribute("href", "data:application/octet-stream;base64;charset=utf-8," + data); el.setAttribute("download", filename); - + // Firefox requires that the element be added to the DOM before it can be clicked el.style.display = "none"; document.body.appendChild(el); - + el.click(); el.remove(); } diff --git a/src/js/views/html/RecipeWaiter.js b/src/js/views/html/RecipeWaiter.js index 1d259474..5d57dd08 100755 --- a/src/js/views/html/RecipeWaiter.js +++ b/src/js/views/html/RecipeWaiter.js @@ -23,8 +23,8 @@ var RecipeWaiter = function(app, manager) { */ RecipeWaiter.prototype.initialiseOperationDragNDrop = function() { var recList = document.getElementById("rec-list"); - - + + // Recipe list Sortable.create(recList, { group: "recipe", @@ -42,11 +42,11 @@ RecipeWaiter.prototype.initialiseOperationDragNDrop = function() { } }.bind(this) }); - + Sortable.utils.on(recList, "dragover", function() { this.removeIntent = false; }.bind(this)); - + Sortable.utils.on(recList, "dragleave", function() { this.removeIntent = true; this.app.progress = 0; @@ -58,7 +58,7 @@ RecipeWaiter.prototype.initialiseOperationDragNDrop = function() { this.removeIntent = !recList.contains(target); }.bind(this)); - + // Favourites category document.querySelector("#categories a").addEventListener("dragover", this.favDragover.bind(this)); document.querySelector("#categories a").addEventListener("dragleave", this.favDragleave.bind(this)); @@ -106,16 +106,16 @@ RecipeWaiter.prototype.opSortEnd = function(evt) { } return; } - + // Reinitialise the popover on the original element in the ops list because for some reason it // gets destroyed and recreated. $(evt.clone).popover(); $(evt.clone).children("[data-toggle=popover]").popover(); - + if (evt.item.parentNode.id !== "rec-list") { return; } - + this.buildRecipeOperation(evt.item); evt.item.dispatchEvent(this.manager.operationadd); }; @@ -131,7 +131,7 @@ RecipeWaiter.prototype.opSortEnd = function(evt) { RecipeWaiter.prototype.favDragover = function(e) { if (e.dataTransfer.effectAllowed !== "move") return false; - + e.stopPropagation(); e.preventDefault(); if (e.target.className && e.target.className.indexOf("category-title") > -1) { @@ -170,7 +170,7 @@ RecipeWaiter.prototype.favDrop = function(e) { e.stopPropagation(); e.preventDefault(); e.target.classList.remove("favourites-hover"); - + var opName = e.dataTransfer.getData("Text"); this.app.addFavourite(opName); }; @@ -195,7 +195,7 @@ RecipeWaiter.prototype.ingChange = function() { */ RecipeWaiter.prototype.disableClick = function(e) { var icon = e.target; - + if (icon.getAttribute("disabled") === "false") { icon.setAttribute("disabled", "true"); icon.classList.add("disable-icon-selected"); @@ -205,7 +205,7 @@ RecipeWaiter.prototype.disableClick = function(e) { icon.classList.remove("disable-icon-selected"); icon.parentNode.parentNode.classList.remove("disabled"); } - + this.app.progress = 0; window.dispatchEvent(this.manager.statechange); }; @@ -228,7 +228,7 @@ RecipeWaiter.prototype.breakpointClick = function(e) { bp.setAttribute("break", "false"); bp.classList.remove("breakpoint-selected"); } - + window.dispatchEvent(this.manager.statechange); }; @@ -267,13 +267,13 @@ RecipeWaiter.prototype.operationChildDblclick = function(e) { RecipeWaiter.prototype.getConfig = function() { var config = [], ingredients, ingList, disabled, bp, item, operations = document.querySelectorAll("#rec-list li.operation"); - + for (var i = 0; i < operations.length; i++) { ingredients = []; disabled = operations[i].querySelector(".disable-icon"); bp = operations[i].querySelector(".breakpoint"); ingList = operations[i].querySelectorAll(".arg"); - + for (var j = 0; j < ingList.length; j++) { if (ingList[j].getAttribute("type") === "checkbox") { // checkbox @@ -289,23 +289,23 @@ RecipeWaiter.prototype.getConfig = function() { ingredients[j] = ingList[j].value; } } - + item = { op: operations[i].querySelector(".arg-title").textContent, args: ingredients }; - + if (disabled && disabled.getAttribute("disabled") === "true") { item.disabled = true; } - + if (bp && bp.getAttribute("break") === "true") { item.breakpoint = true; } - + config.push(item); } - + return config; }; @@ -337,11 +337,11 @@ RecipeWaiter.prototype.buildRecipeOperation = function(el) { var opName = el.textContent; var op = new HTMLOperation(opName, this.app.operations[opName], this.app, this.manager); el.innerHTML = op.toFullHtml(); - + if (this.app.operations[opName].flowControl) { el.classList.add("flow-control-op"); } - + // Disable auto-bake if this is a manual op - this should be moved to the 'operationadd' // handler after event restructuring if (op.manualBake && this.app.autoBake_) { @@ -359,12 +359,12 @@ RecipeWaiter.prototype.buildRecipeOperation = function(el) { */ RecipeWaiter.prototype.addOperation = function(name) { var item = document.createElement("li"); - + item.classList.add("operation"); item.innerHTML = name; this.buildRecipeOperation(item); document.getElementById("rec-list").appendChild(item); - + item.dispatchEvent(this.manager.operationadd); return item; }; @@ -393,7 +393,7 @@ RecipeWaiter.prototype.clearRecipe = function() { RecipeWaiter.prototype.dropdownToggleClick = function(e) { var el = e.target, button = el.parentNode.parentNode.previousSibling; - + button.innerHTML = el.textContent + " "; this.ingChange(); }; diff --git a/src/js/views/html/SeasonalWaiter.js b/src/js/views/html/SeasonalWaiter.js index a4e6cecf..d8685d03 100755 --- a/src/js/views/html/SeasonalWaiter.js +++ b/src/js/views/html/SeasonalWaiter.js @@ -227,7 +227,7 @@ SeasonalWaiter.treeWalk = (function() { while (node && node !== parent) { if (allNodes || node.nodeType === 1) { if (fn(node) === false) { - return(false); + return false; } } // If it's an element && diff --git a/src/js/views/html/main.js b/src/js/views/html/main.js index df175e67..72f891ee 100755 --- a/src/js/views/html/main.js +++ b/src/js/views/html/main.js @@ -22,7 +22,7 @@ var main = function() { "Entropy", "Fork" ]; - + var defaultOptions = { updateUrl : true, showHighlighter : true,