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,EAAE,GAAG,EAAE,CAAC,CAAC;gBAC1C,MAAM,CAAC,IAAI,EAAE,CAAC,GAAG,GAAG,GAAG,CAAC,IAAI,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;gBAC1C,MAAM,CAAC,IAAI,EAAE,CAAC,GAAG,GAAG,GAAG,CAAC,IAAI,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;gBAC1C,MAAM,CAAC,IAAI,EAAE,CAAC,GAAG,GAAG,GAAG,CAAC,IAAI,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC;gBACzC,MAAM,CAAC,IAAI,EAAE,CAAC,GAAG,GAAG,GAAG,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC;aACtC;SACJ;QAED,OAAO,MAAM,CAAC;IAClB,CAAC;IAzDe,wBAAY,eAyD3B,CAAA;AAEL,CAAC,EAtKgB,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAsK3B","file":"","sourceRoot":"/","sourcesContent":["export namespace StringUtils {\r\n export function getUrlParam(key: string): string {\r\n if (!window.location.search) {\r\n return \"\"; //微信版本没有此变量\r\n }\r\n const reg = new RegExp(\"(^|&)\" + key + \"=([^&]*)(&|$)\");\r\n const r = window.location.search.substr(1).match(reg);\r\n if (r != null) return decodeURI(r[2]);\r\n return \"\";\r\n }\r\n\r\n //js实现用传递的值替换占位符{0} {1} {2}\r\n export function format(str: string, ...args: any[]): string {\r\n if (args.length == 0) return str;\r\n for (let i = 0; i < args.length; i++)\r\n str = str.replace(new RegExp(\"\\\\{\" + i + \"\\\\}\", \"g\"), args[i]);\r\n return str;\r\n }\r\n\r\n export function str_repeat(i: string, m: number) {\r\n for (var o: string[] = []; m > 0; o[--m] = i);\r\n return o.join('');\r\n }\r\n\r\n export function sprintf(fmt: string, ...params: any[]): string {\r\n var i = 0, a, f = fmt, o: any[] = [], m, p, c, x, s = '';\r\n while (f) {\r\n if (m = /^[^\\x25]+/.exec(f)) {\r\n o.push(m[0]);\r\n }\r\n else if (m = /^\\x25{2}/.exec(f)) {\r\n o.push('%');\r\n }\r\n else if (m = /^\\x25(?:(\\d+)\\$)?(\\+)?(0|'[^$])?(-)?(\\d+)?(?:\\.(\\d+))?([b-fosuxX])/.exec(f)) {\r\n if (((a = params[(m[1] - 1) || i++]) == null) || (a == undefined)) {\r\n throw ('Too few arguments.');\r\n }\r\n if (/[^s]/.test(m[7]) && (typeof (a) != 'number')) {\r\n throw ('Expecting number but found ' + typeof (a));\r\n }\r\n switch (m[7]) {\r\n case 'b': a = a.toString(2); break;\r\n case 'c': a = String.fromCharCode(a); break;\r\n case 'd': a = parseInt(a); break;\r\n case 'e': a = m[6] ? a.toExponential(m[6]) : a.toExponential(); break;\r\n case 'f': a = m[6] ? parseFloat(a).toFixed(m[6]) : parseFloat(a); break;\r\n case 'o': a = a.toString(8); break;\r\n case 's': a = ((a = String(a)) && m[6] ? a.substring(0, m[6]) : a); break;\r\n case 'u': a = Math.abs(a); break;\r\n case 'x': a = a.toString(16); break;\r\n case 'X': a = a.toString(16).toUpperCase(); break;\r\n }\r\n a = (/[def]/.test(m[7]) && m[2] && a >= 0 ? '+' + a : a);\r\n c = m[3] ? m[3] == '0' ? '0' : m[3].charAt(1) : ' ';\r\n x = m[5] - String(a).length - s.length;\r\n p = m[5] ? str_repeat(c, x) : '';\r\n o.push(s + (m[4] ? a + p : p + a));\r\n }\r\n else {\r\n throw ('Huh ?!');\r\n }\r\n f = f.substring(m[0].length);\r\n }\r\n return o.join('');\r\n }\r\n\r\n export function utf8ArrToStr(aBytes: Uint8Array) {\r\n var sView = \"\";\r\n\r\n for (var nPart, nLen = aBytes.length, nIdx = 0; nIdx < nLen; nIdx++) {\r\n nPart = aBytes[nIdx];\r\n sView += String.fromCharCode(nPart > 251 && nPart < 254\r\n && nIdx + 5 < nLen ? /* six bytes */\r\n /* (nPart - 252 << 32) is not possible in ECMAScript! So...: */\r\n (nPart - 252) * 1073741824 + (aBytes[++nIdx] - 128 << 24)\r\n + (aBytes[++nIdx] - 128 << 18) + (aBytes[++nIdx] - 128 << 12)\r\n + (aBytes[++nIdx] - 128 << 6) + aBytes[++nIdx] - 128\r\n : nPart > 247 && nPart < 252 && nIdx + 4 < nLen ? /*\r\n * five\r\n * bytes\r\n */\r\n (nPart - 248 << 24) + (aBytes[++nIdx] - 128 << 18)\r\n + (aBytes[++nIdx] - 128 << 12)\r\n + (aBytes[++nIdx] - 128 << 6) + aBytes[++nIdx] - 128\r\n : nPart > 239 && nPart < 248 && nIdx + 3 < nLen ? /*\r\n * four\r\n * bytes\r\n */\r\n (nPart - 240 << 18) + (aBytes[++nIdx] - 128 << 12)\r\n + (aBytes[++nIdx] - 128 << 6) + aBytes[++nIdx]\r\n - 128 : nPart > 223 && nPart < 240\r\n && nIdx + 2 < nLen ? /* three bytes */\r\n (nPart - 224 << 12) + (aBytes[++nIdx] - 128 << 6)\r\n + aBytes[++nIdx] - 128 : nPart > 191\r\n && nPart < 224 && nIdx + 1 < nLen ? /* two bytes */\r\n (nPart - 192 << 6) + aBytes[++nIdx] - 128 : /*\r\n * nPart <\r\n * 127 ?\r\n *//*\r\n * one byte\r\n */\r\n nPart);\r\n }\r\n\r\n return sView;\r\n }\r\n\r\n export function strToUtf8Arr(sDOMStr: string) {\r\n var aBytes: Uint8Array, nChr, nStrLen = sDOMStr.length, nArrLen = 0;\r\n\r\n /* mapping... */\r\n\r\n for (var nMapIdx = 0; nMapIdx < nStrLen; nMapIdx++) {\r\n nChr = sDOMStr.charCodeAt(nMapIdx);\r\n nArrLen += nChr < 0x80 ? 1 : nChr < 0x800 ? 2 : nChr < 0x10000 ? 3\r\n : nChr < 0x200000 ? 4 : nChr < 0x4000000 ? 5 : 6;\r\n }\r\n\r\n aBytes = new Uint8Array(nArrLen);\r\n\r\n /* transcription... */\r\n\r\n for (var nIdx = 0, nChrIdx = 0; nIdx < nArrLen; nChrIdx++) {\r\n nChr = sDOMStr.charCodeAt(nChrIdx);\r\n if (nChr < 128) {\r\n /* one byte */\r\n aBytes[nIdx++] = nChr;\r\n } else if (nChr < 0x800) {\r\n /* two bytes */\r\n aBytes[nIdx++] = 192 + (nChr >>> 6);\r\n aBytes[nIdx++] = 128 + (nChr & 63);\r\n } else if (nChr < 0x10000) {\r\n /* three bytes */\r\n aBytes[nIdx++] = 224 + (nChr >>> 12);\r\n aBytes[nIdx++] = 128 + (nChr >>> 6 & 63);\r\n aBytes[nIdx++] = 128 + (nChr & 63);\r\n } else if (nChr < 0x200000) {\r\n /* four bytes */\r\n aBytes[nIdx++] = 240 + (nChr >>> 18);\r\n aBytes[nIdx++] = 128 + (nChr >>> 12 & 63);\r\n aBytes[nIdx++] = 128 + (nChr >>> 6 & 63);\r\n aBytes[nIdx++] = 128 + (nChr & 63);\r\n } else if (nChr < 0x4000000) {\r\n /* five bytes */\r\n aBytes[nIdx++] = 248 + (nChr >>> 24);\r\n aBytes[nIdx++] = 128 + (nChr >>> 18 & 63);\r\n aBytes[nIdx++] = 128 + (nChr >>> 12 & 63);\r\n aBytes[nIdx++] = 128 + (nChr >>> 6 & 63);\r\n aBytes[nIdx++] = 128 + (nChr & 63);\r\n } else /* if (nChr <= 0x7fffffff) */ {\r\n /* six bytes */\r\n aBytes[nIdx++] = 252 + /*\r\n * (nChr >>> 32) is not possible in\r\n * ECMAScript! So...:\r\n */(nChr / 1073741824);\r\n aBytes[nIdx++] = 128 + (nChr >>> 24 & 63);\r\n aBytes[nIdx++] = 128 + (nChr >>> 18 & 63);\r\n aBytes[nIdx++] = 128 + (nChr >>> 12 & 63);\r\n aBytes[nIdx++] = 128 + (nChr >>> 6 & 63);\r\n aBytes[nIdx++] = 128 + (nChr & 63);\r\n }\r\n }\r\n\r\n return aBytes;\r\n }\r\n\r\n}\r\n"]}