From 78abacdadcaca62b9bc099369c5f89009116d07c Mon Sep 17 00:00:00 2001 From: toby Date: Sun, 12 Mar 2017 12:51:04 -0400 Subject: [PATCH 1/4] Add download button for displayFilesAsHTML files + Added bytes attribute for "file objects" in untar and unzip + Added download button on files displayed by displayFilesAsHTML --- src/js/core/Utils.js | 31 +++++++++++++++++++++++++++---- src/js/operations/Compress.js | 21 +++++++++++++-------- 2 files changed, 40 insertions(+), 12 deletions(-) diff --git a/src/js/core/Utils.js b/src/js/core/Utils.js index 9ef0b2b1..abee0c50 100755 --- a/src/js/core/Utils.js +++ b/src/js/core/Utils.js @@ -1028,20 +1028,43 @@ var Utils = { }; var formatFile = function(file, i) { + var blob = new Blob( + [new Uint8Array(file.bytes)], + {type: "octet/stream"} + ); + var blobUrl = window.URL.createObjectURL(blob); + + var downloadAnchorElem = $("") + .html("\u21B4") + .attr("href", blobUrl) + .attr("title", "Download '" + file.fileName + "'") + .attr("download", file.fileName); + + var expandFileContentsElem = $("") + .html("🔍") + .addClass("collapsed") + .attr("data-toggle", "collapse") + .attr("aria-expanded", "true") + .attr("aria-controls", "collapse" + i) + .attr("href", "#collapse" + i) + .attr("title", "Show/hide contents of '" + file.fileName + "'"); + var html = "
" + "" + "
Date: Tue, 21 Mar 2017 23:06:51 +0000 Subject: [PATCH 2/4] Removed jQuery and reference to window object from Utils code. --- src/js/core/Utils.js | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/src/js/core/Utils.js b/src/js/core/Utils.js index abee0c50..405249a1 100755 --- a/src/js/core/Utils.js +++ b/src/js/core/Utils.js @@ -1032,32 +1032,26 @@ var Utils = { [new Uint8Array(file.bytes)], {type: "octet/stream"} ); - var blobUrl = window.URL.createObjectURL(blob); + var blobUrl = URL.createObjectURL(blob); - var downloadAnchorElem = $("") - .html("\u21B4") - .attr("href", blobUrl) - .attr("title", "Download '" + file.fileName + "'") - .attr("download", file.fileName); + var downloadAnchorElem = "\u21B4"; - var expandFileContentsElem = $("") - .html("🔍") - .addClass("collapsed") - .attr("data-toggle", "collapse") - .attr("aria-expanded", "true") - .attr("aria-controls", "collapse" + i) - .attr("href", "#collapse" + i) - .attr("title", "Show/hide contents of '" + file.fileName + "'"); + var expandFileContentsElem = "🔍"; var html = "
" + " \ No newline at end of file +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){var b={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`"};return a.replace(/[&<>"'\/`]/g,function(a){return b[a]})},unescapeHtml:function(a){var b={"&":"&","<":"<",">":">",""":'"',"'":"'","/":"/","`":"`"};return a.replace(/&#?x?[a-z0-9]{2,4};/gi,function(a){return b[a]||a})},fuzzyTime:function(a){return moment.duration(a,"milliseconds").humanize()},extend:function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return a},displayFilesAsHTML:function(a){var b=function(a){var b="
";return b},c=function(a,b){var c=new Blob([new Uint8Array(a.bytes)],{type:"octet/stream"}),d=URL.createObjectURL(c),e="\u21b4",f="",g="
"+Utils.escapeHtml(a.contents)+"
";return g},d="
"+a.length+" file(s) found
\n";return a.forEach(function(a,e){d+="undefined"!=typeof a.contents?c(a,e):b(a)}),d},mod:function(a,b){return(a%b+b)%b},gcd:function(a,b){return b?Utils.gcd(b,a%b):a},modInv:function(a,b){a%=b;for(var c=1;c>>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)}},Base58={ALPHABET_OPTIONS:[{name:"Bitcoin",value:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"},{name:"Ripple",value:"rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz"}],REMOVE_NON_ALPH_CHARS:!0,runTo:function(a,b){var c=b[0]||Base58.ALPHABET_OPTIONS[0].value,d=[0];if(c=Utils.expandAlphRange(c).join(""),58!==c.length||58!==[].unique.call(c).length)throw"Error: alphabet must be of length 58";if(0===a.length)return"";for(a.forEach(function(a){var b=(d[0]<<8)+a;d[0]=b%58,b=b/58|0;for(var c=1;c0;)d.push(b%58),b=b/58|0}),d=d.map(function(a){return c[a]}).reverse().join("");d.length>=8;for(var h=1;h>=8;for(;g>0;)e.push(255&g),g>>=8}),e.reverse())}},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+/="},{name:"UNIX crypt: ./0-9A-Za-z",value:"./0-9A-Za-z"}],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 83716d6d..d69e6c61 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 25c9bdbe..0bf65a3a 100755 --- a/build/prod/scripts.js +++ b/build/prod/scripts.js @@ -280,13 +280,13 @@ var a=new MessageChannel;return a.port1.onmessage=j,function(){return a.port2.po 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.drawLine(h,i,o,n+i,o),CanvasComponents.drawLine(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(u=0;u<=b.length;u++)h.fillText(u,s,o+.3*l),s+=r+q;else for(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(u=0;u<=t;u++)x=o-u/t*m+g/3,h.fillText(u,.8*i,x);else for(u=0;u<=f;u++)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()}},drawScaleBar: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){var b={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`"};return a.replace(/[&<>"'\/`]/g,function(a){return b[a]})},unescapeHtml:function(a){var b={"&":"&","<":"<",">":">",""":'"',"'":"'","/":"/","`":"`"};return a.replace(/&#?x?[a-z0-9]{2,4};/gi,function(a){return b[a]||a})},fuzzyTime:function(a){return moment.duration(a,"milliseconds").humanize()},extend:function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return a},displayFilesAsHTML:function(a){var b=function(a){var b="
          ";return b},c=function(a,b){var c="";return c},d="
          "+a.length+" file(s) found
          \n";return a.forEach(function(a,e){d+="undefined"!=typeof a.contents?c(a,e):b(a)}),d},mod:function(a,b){return(a%b+b)%b},gcd:function(a,b){return b?Utils.gcd(b,a%b):a},modInv:function(a,b){a%=b;for(var c=1;c>>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)}},Base58={ALPHABET_OPTIONS:[{name:"Bitcoin",value:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"},{name:"Ripple",value:"rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz"}],REMOVE_NON_ALPH_CHARS:!0,runTo:function(a,b){var c=b[0]||Base58.ALPHABET_OPTIONS[0].value,d=[0];if(c=Utils.expandAlphRange(c).join(""),58!==c.length||58!==[].unique.call(c).length)throw"Error: alphabet must be of length 58";if(0===a.length)return"";for(a.forEach(function(a){var b=(d[0]<<8)+a;d[0]=b%58,b=b/58|0;for(var c=1;c0;)d.push(b%58),b=b/58|0}),d=d.map(function(a){return c[a]}).reverse().join("");d.length>=8;for(var h=1;h>=8;for(;g>0;)e.push(255&g),g>>=8}),e.reverse())}},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+/="},{name:"UNIX crypt: ./0-9A-Za-z",value:"./0-9A-Za-z"}],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="