From bac7f62eeaee67873e15752d3d531c1b35d752e4 Mon Sep 17 00:00:00 2001 From: htyxyt <62530172+htyxyt@users.noreply.github.com> Date: Fri, 14 Feb 2025 14:56:58 +0800 Subject: [PATCH] Update background.thunderfird.js --- src/background.thunderfird.js | 253 +++++++++++++++++++++++++++++++++- 1 file changed, 249 insertions(+), 4 deletions(-) diff --git a/src/background.thunderfird.js b/src/background.thunderfird.js index e165905..153088f 100644 --- a/src/background.thunderfird.js +++ b/src/background.thunderfird.js @@ -1,9 +1,254 @@ -/*! For license information please see background.js.LICENSE.txt */ -(()=>{var e={6501:function(e,t){!function(e){"use strict";var t=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,983,6,110,6,6,9,4759,9,787719,239],r=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,757,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],n="\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0898-\u089f\u08ca-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3c\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0cf3\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ece\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u180f-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf-\u1ace\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1dff\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\u30fb\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f\uff65",i="\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u0870-\u0887\u0889-\u088e\u08a0-\u08c9\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c5d\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cdd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u1711\u171f-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4c\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7ca\ua7d0\ua7d1\ua7d3\ua7d5-\ua7d9\ua7f2-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc",a={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},s="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",o={5:s,"5module":s+" export import",6:s+" const class extends export import super"},c=/^in(stanceof)?$/,u=new RegExp("["+i+"]"),l=new RegExp("["+i+n+"]");function h(e,t){for(var r=65536,n=0;ne)return!1;if((r+=t[n+1])>=e)return!0}return!1}function p(e,t){return e<65?36===e:e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&u.test(String.fromCharCode(e)):!1!==t&&h(e,r)))}function f(e,n){return e<48?36===e:e<58||!(e<65)&&(e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&l.test(String.fromCharCode(e)):!1!==n&&(h(e,r)||h(e,t)))))}var d=function(e,t){void 0===t&&(t={}),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function g(e,t){return new d(e,{beforeExpr:!0,binop:t})}var m={beforeExpr:!0},y={startsExpr:!0},v={};function b(e,t){return void 0===t&&(t={}),t.keyword=e,v[e]=new d(e,t)}var x={num:new d("num",y),regexp:new d("regexp",y),string:new d("string",y),name:new d("name",y),privateId:new d("privateId",y),eof:new d("eof"),bracketL:new d("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new d("]"),braceL:new d("{",{beforeExpr:!0,startsExpr:!0}),braceR:new d("}"),parenL:new d("(",{beforeExpr:!0,startsExpr:!0}),parenR:new d(")"),comma:new d(",",m),semi:new d(";",m),colon:new d(":",m),dot:new d("."),question:new d("?",m),questionDot:new d("?."),arrow:new d("=>",m),template:new d("template"),invalidTemplate:new d("invalidTemplate"),ellipsis:new d("...",m),backQuote:new d("`",y),dollarBraceL:new d("${",{beforeExpr:!0,startsExpr:!0}),eq:new d("=",{beforeExpr:!0,isAssign:!0}),assign:new d("_=",{beforeExpr:!0,isAssign:!0}),incDec:new d("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new d("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:g("||",1),logicalAND:g("&&",2),bitwiseOR:g("|",3),bitwiseXOR:g("^",4),bitwiseAND:g("&",5),equality:g("==/!=/===/!==",6),relational:g("/<=/>=",7),bitShift:g("<>/>>>",8),plusMin:new d("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:g("%",10),star:g("*",10),slash:g("/",10),starstar:new d("**",{beforeExpr:!0}),coalesce:g("??",1),_break:b("break"),_case:b("case",m),_catch:b("catch"),_continue:b("continue"),_debugger:b("debugger"),_default:b("default",m),_do:b("do",{isLoop:!0,beforeExpr:!0}),_else:b("else",m),_finally:b("finally"),_for:b("for",{isLoop:!0}),_function:b("function",y),_if:b("if"),_return:b("return",m),_switch:b("switch"),_throw:b("throw",m),_try:b("try"),_var:b("var"),_const:b("const"),_while:b("while",{isLoop:!0}),_with:b("with"),_new:b("new",{beforeExpr:!0,startsExpr:!0}),_this:b("this",y),_super:b("super",y),_class:b("class",y),_extends:b("extends",m),_export:b("export"),_import:b("import",y),_null:b("null",y),_true:b("true",y),_false:b("false",y),_in:b("in",{beforeExpr:!0,binop:7}),_instanceof:b("instanceof",{beforeExpr:!0,binop:7}),_typeof:b("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:b("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:b("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},w=/\r\n?|\n|\u2028|\u2029/,A=new RegExp(w.source,"g");function k(e){return 10===e||13===e||8232===e||8233===e}function S(e,t,r){void 0===r&&(r=e.length);for(var n=t;n>10),56320+(1023&e)))}var L=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,V=function(e,t){this.line=e,this.column=t};V.prototype.offset=function(e){return new V(this.line,this.column+e)};var D=function(e,t,r){this.start=t,this.end=r,null!==e.sourceFile&&(this.source=e.sourceFile)};function M(e,t){for(var r=1,n=0;;){var i=S(e,n,t);if(i<0)return new V(r,t-n);++r,n=i}}var F={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},B=!1;function U(e){var t={};for(var r in F)t[r]=e&&I(e,r)?e[r]:F[r];if("latest"===t.ecmaVersion?t.ecmaVersion=1e8:null==t.ecmaVersion?(!B&&"object"===typeof console&&console.warn&&(B=!0,console.warn("Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future.")),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),null==t.allowReserved&&(t.allowReserved=t.ecmaVersion<5),e&&null!=e.allowHashBang||(t.allowHashBang=t.ecmaVersion>=14),O(t.onToken)){var n=t.onToken;t.onToken=function(e){return n.push(e)}}return O(t.onComment)&&(t.onComment=q(t,t.onComment)),t}function q(e,t){return function(r,n,i,a,s,o){var c={type:r?"Block":"Line",value:n,start:i,end:a};e.locations&&(c.loc=new D(this,s,o)),e.ranges&&(c.range=[i,a]),t.push(c)}}var z=1,W=2,H=4,G=8,K=16,$=32,J=64,Z=128,X=256,Q=z|W|X;function Y(e,t){return W|(e?H:0)|(t?G:0)}var ee=0,te=1,re=2,ne=3,ie=4,ae=5,se=function(e,t,r){this.options=e=U(e),this.sourceFile=e.sourceFile,this.keywords=j(o[e.ecmaVersion>=6?6:"module"===e.sourceType?"5module":5]);var n="";!0!==e.allowReserved&&(n=a[e.ecmaVersion>=6?6:5===e.ecmaVersion?5:3],"module"===e.sourceType&&(n+=" await")),this.reservedWords=j(n);var i=(n?n+" ":"")+a.strict;this.reservedWordsStrict=j(i),this.reservedWordsStrictBind=j(i+" "+a.strictBind),this.input=String(t),this.containsEsc=!1,r?(this.pos=r,this.lineStart=this.input.lastIndexOf("\n",r-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(w).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=x.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule="module"===e.sourceType,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),0===this.pos&&e.allowHashBang&&"#!"===this.input.slice(0,2)&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(z),this.regexpState=null,this.privateNameStack=[]},oe={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};se.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)},oe.inFunction.get=function(){return(this.currentVarScope().flags&W)>0},oe.inGenerator.get=function(){return(this.currentVarScope().flags&G)>0&&!this.currentVarScope().inClassFieldInit},oe.inAsync.get=function(){return(this.currentVarScope().flags&H)>0&&!this.currentVarScope().inClassFieldInit},oe.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e];if(t.inClassFieldInit||t.flags&X)return!1;if(t.flags&W)return(t.flags&H)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},oe.allowSuper.get=function(){var e=this.currentThisScope(),t=e.flags,r=e.inClassFieldInit;return(t&J)>0||r||this.options.allowSuperOutsideMethod},oe.allowDirectSuper.get=function(){return(this.currentThisScope().flags&Z)>0},oe.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},oe.allowNewDotTarget.get=function(){var e=this.currentThisScope(),t=e.flags,r=e.inClassFieldInit;return(t&(W|X))>0||r},oe.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&X)>0},se.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var r=this,n=0;n=,?^&]/.test(i)||"!"===i&&"="===this.input.charAt(n+1))}e+=t[0].length,_.lastIndex=e,e+=_.exec(this.input)[0].length,";"===this.input[e]&&e++}},ce.eat=function(e){return this.type===e&&(this.next(),!0)},ce.isContextual=function(e){return this.type===x.name&&this.value===e&&!this.containsEsc},ce.eatContextual=function(e){return!!this.isContextual(e)&&(this.next(),!0)},ce.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},ce.canInsertSemicolon=function(){return this.type===x.eof||this.type===x.braceR||w.test(this.input.slice(this.lastTokEnd,this.start))},ce.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},ce.semicolon=function(){this.eat(x.semi)||this.insertSemicolon()||this.unexpected()},ce.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},ce.expect=function(e){this.eat(e)||this.unexpected()},ce.unexpected=function(e){this.raise(null!=e?e:this.start,"Unexpected token")};var le=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};ce.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var r=t?e.parenthesizedAssign:e.parenthesizedBind;r>-1&&this.raiseRecoverable(r,t?"Assigning to rvalue":"Parenthesized pattern")}},ce.checkExpressionErrors=function(e,t){if(!e)return!1;var r=e.shorthandAssign,n=e.doubleProto;if(!t)return r>=0||n>=0;r>=0&&this.raise(r,"Shorthand property assignments are valid only in destructuring patterns"),n>=0&&this.raiseRecoverable(n,"Redefinition of __proto__ property")},ce.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos55295&&n<56320)return!0;if(p(n,!0)){for(var i=r+1;f(n=this.input.charCodeAt(i),!0);)++i;if(92===n||n>55295&&n<56320)return!0;var a=this.input.slice(r,i);if(!c.test(a))return!0}return!1},he.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;_.lastIndex=this.pos;var e,t=_.exec(this.input),r=this.pos+t[0].length;return!w.test(this.input.slice(this.pos,r))&&"function"===this.input.slice(r,r+8)&&(r+8===this.input.length||!(f(e=this.input.charCodeAt(r+8))||e>55295&&e<56320))},he.parseStatement=function(e,t,r){var n,i=this.type,a=this.startNode();switch(this.isLet(e)&&(i=x._var,n="let"),i){case x._break:case x._continue:return this.parseBreakContinueStatement(a,i.keyword);case x._debugger:return this.parseDebuggerStatement(a);case x._do:return this.parseDoStatement(a);case x._for:return this.parseForStatement(a);case x._function:return e&&(this.strict||"if"!==e&&"label"!==e)&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(a,!1,!e);case x._class:return e&&this.unexpected(),this.parseClass(a,!0);case x._if:return this.parseIfStatement(a);case x._return:return this.parseReturnStatement(a);case x._switch:return this.parseSwitchStatement(a);case x._throw:return this.parseThrowStatement(a);case x._try:return this.parseTryStatement(a);case x._const:case x._var:return n=n||this.value,e&&"var"!==n&&this.unexpected(),this.parseVarStatement(a,n);case x._while:return this.parseWhileStatement(a);case x._with:return this.parseWithStatement(a);case x.braceL:return this.parseBlock(!0,a);case x.semi:return this.parseEmptyStatement(a);case x._export:case x._import:if(this.options.ecmaVersion>10&&i===x._import){_.lastIndex=this.pos;var s=_.exec(this.input),o=this.pos+s[0].length,c=this.input.charCodeAt(o);if(40===c||46===c)return this.parseExpressionStatement(a,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),i===x._import?this.parseImport(a):this.parseExport(a,r);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(a,!0,!e);var u=this.value,l=this.parseExpression();return i===x.name&&"Identifier"===l.type&&this.eat(x.colon)?this.parseLabeledStatement(a,u,l,e):this.parseExpressionStatement(a,l)}},he.parseBreakContinueStatement=function(e,t){var r="break"===t;this.next(),this.eat(x.semi)||this.insertSemicolon()?e.label=null:this.type!==x.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var n=0;n=6?this.eat(x.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")},he.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(pe),this.enterScope(0),this.expect(x.parenL),this.type===x.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var r=this.isLet();if(this.type===x._var||this.type===x._const||r){var n=this.startNode(),i=r?"let":this.value;return this.next(),this.parseVar(n,!0,i),this.finishNode(n,"VariableDeclaration"),(this.type===x._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&1===n.declarations.length?(this.options.ecmaVersion>=9&&(this.type===x._in?t>-1&&this.unexpected(t):e.await=t>-1),this.parseForIn(e,n)):(t>-1&&this.unexpected(t),this.parseFor(e,n))}var a=this.isContextual("let"),s=!1,o=new le,c=this.parseExpression(!(t>-1)||"await",o);return this.type===x._in||(s=this.options.ecmaVersion>=6&&this.isContextual("of"))?(this.options.ecmaVersion>=9&&(this.type===x._in?t>-1&&this.unexpected(t):e.await=t>-1),a&&s&&this.raise(c.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(c,!1,o),this.checkLValPattern(c),this.parseForIn(e,c)):(this.checkExpressionErrors(o,!0),t>-1&&this.unexpected(t),this.parseFor(e,c))},he.parseFunctionStatement=function(e,t,r){return this.next(),this.parseFunction(e,ge|(r?0:me),!1,t)},he.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(x._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")},he.parseReturnStatement=function(e){return this.inFunction||this.options.allowReturnOutsideFunction||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(x.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")},he.parseSwitchStatement=function(e){var t;this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(x.braceL),this.labels.push(fe),this.enterScope(0);for(var r=!1;this.type!==x.braceR;)if(this.type===x._case||this.type===x._default){var n=this.type===x._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),n?t.test=this.parseExpression():(r&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),r=!0,t.test=null),this.expect(x.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")},he.parseThrowStatement=function(e){return this.next(),w.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var de=[];he.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t="Identifier"===e.type;return this.enterScope(t?$:0),this.checkLValPattern(e,t?ie:re),this.expect(x.parenR),e},he.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===x._catch){var t=this.startNode();this.next(),this.eat(x.parenL)?t.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0)),t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(x._finally)?this.parseBlock():null,e.handler||e.finalizer||this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")},he.parseVarStatement=function(e,t,r){return this.next(),this.parseVar(e,!1,t,r),this.semicolon(),this.finishNode(e,"VariableDeclaration")},he.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(pe),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")},he.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")},he.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")},he.parseLabeledStatement=function(e,t,r,n){for(var i=0,a=this.labels;i=0;o--){var c=this.labels[o];if(c.statementStart!==e.start)break;c.statementStart=this.start,c.kind=s}return this.labels.push({name:t,kind:s,statementStart:this.start}),e.body=this.parseStatement(n?-1===n.indexOf("label")?n+"label":n:"label"),this.labels.pop(),e.label=r,this.finishNode(e,"LabeledStatement")},he.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")},he.parseBlock=function(e,t,r){for(void 0===e&&(e=!0),void 0===t&&(t=this.startNode()),t.body=[],this.expect(x.braceL),e&&this.enterScope(0);this.type!==x.braceR;){var n=this.parseStatement(null);t.body.push(n)}return r&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,"BlockStatement")},he.parseFor=function(e,t){return e.init=t,this.expect(x.semi),e.test=this.type===x.semi?null:this.parseExpression(),this.expect(x.semi),e.update=this.type===x.parenR?null:this.parseExpression(),this.expect(x.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")},he.parseForIn=function(e,t){var r=this.type===x._in;return this.next(),"VariableDeclaration"===t.type&&null!=t.declarations[0].init&&(!r||this.options.ecmaVersion<8||this.strict||"var"!==t.kind||"Identifier"!==t.declarations[0].id.type)&&this.raise(t.start,(r?"for-in":"for-of")+" loop variable declaration may not have an initializer"),e.left=t,e.right=r?this.parseExpression():this.parseMaybeAssign(),this.expect(x.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,r?"ForInStatement":"ForOfStatement")},he.parseVar=function(e,t,r,n){for(e.declarations=[],e.kind=r;;){var i=this.startNode();if(this.parseVarId(i,r),this.eat(x.eq)?i.init=this.parseMaybeAssign(t):n||"const"!==r||this.type===x._in||this.options.ecmaVersion>=6&&this.isContextual("of")?n||"Identifier"===i.id.type||t&&(this.type===x._in||this.isContextual("of"))?i.init=null:this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):this.unexpected(),e.declarations.push(this.finishNode(i,"VariableDeclarator")),!this.eat(x.comma))break}return e},he.parseVarId=function(e,t){e.id=this.parseBindingAtom(),this.checkLValPattern(e.id,"var"===t?te:re,!1)};var ge=1,me=2,ye=4;function ve(e,t){var r=t.key.name,n=e[r],i="true";return"MethodDefinition"!==t.type||"get"!==t.kind&&"set"!==t.kind||(i=(t.static?"s":"i")+t.kind),"iget"===n&&"iset"===i||"iset"===n&&"iget"===i||"sget"===n&&"sset"===i||"sset"===n&&"sget"===i?(e[r]="true",!1):!!n||(e[r]=i,!1)}function be(e,t){var r=e.computed,n=e.key;return!r&&("Identifier"===n.type&&n.name===t||"Literal"===n.type&&n.value===t)}he.parseFunction=function(e,t,r,n,i){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!n)&&(this.type===x.star&&t&me&&this.unexpected(),e.generator=this.eat(x.star)),this.options.ecmaVersion>=8&&(e.async=!!n),t&ge&&(e.id=t&ye&&this.type!==x.name?null:this.parseIdent(),!e.id||t&me||this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?te:re:ne));var a=this.yieldPos,s=this.awaitPos,o=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Y(e.async,e.generator)),t&ge||(e.id=this.type===x.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,r,!1,i),this.yieldPos=a,this.awaitPos=s,this.awaitIdentPos=o,this.finishNode(e,t&ge?"FunctionDeclaration":"FunctionExpression")},he.parseFunctionParams=function(e){this.expect(x.parenL),e.params=this.parseBindingList(x.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},he.parseClass=function(e,t){this.next();var r=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var n=this.enterClassBody(),i=this.startNode(),a=!1;for(i.body=[],this.expect(x.braceL);this.type!==x.braceR;){var s=this.parseClassElement(null!==e.superClass);s&&(i.body.push(s),"MethodDefinition"===s.type&&"constructor"===s.kind?(a&&this.raiseRecoverable(s.start,"Duplicate constructor in the same class"),a=!0):s.key&&"PrivateIdentifier"===s.key.type&&ve(n,s)&&this.raiseRecoverable(s.key.start,"Identifier '#"+s.key.name+"' has already been declared"))}return this.strict=r,this.next(),e.body=this.finishNode(i,"ClassBody"),this.exitClassBody(),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")},he.parseClassElement=function(e){if(this.eat(x.semi))return null;var t=this.options.ecmaVersion,r=this.startNode(),n="",i=!1,a=!1,s="method",o=!1;if(this.eatContextual("static")){if(t>=13&&this.eat(x.braceL))return this.parseClassStaticBlock(r),r;this.isClassElementNameStart()||this.type===x.star?o=!0:n="static"}if(r.static=o,!n&&t>=8&&this.eatContextual("async")&&(!this.isClassElementNameStart()&&this.type!==x.star||this.canInsertSemicolon()?n="async":a=!0),!n&&(t>=9||!a)&&this.eat(x.star)&&(i=!0),!n&&!a&&!i){var c=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?s=c:n=c)}if(n?(r.computed=!1,r.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),r.key.name=n,this.finishNode(r.key,"Identifier")):this.parseClassElementName(r),t<13||this.type===x.parenL||"method"!==s||i||a){var u=!r.static&&be(r,"constructor"),l=u&&e;u&&"method"!==s&&this.raise(r.key.start,"Constructor can't have get/set modifier"),r.kind=u?"constructor":s,this.parseClassMethod(r,i,a,l)}else this.parseClassField(r);return r},he.isClassElementNameStart=function(){return this.type===x.name||this.type===x.privateId||this.type===x.num||this.type===x.string||this.type===x.bracketL||this.type.keyword},he.parseClassElementName=function(e){this.type===x.privateId?("constructor"===this.value&&this.raise(this.start,"Classes can't have an element named '#constructor'"),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)},he.parseClassMethod=function(e,t,r,n){var i=e.key;"constructor"===e.kind?(t&&this.raise(i.start,"Constructor can't be a generator"),r&&this.raise(i.start,"Constructor can't be an async method")):e.static&&be(e,"prototype")&&this.raise(i.start,"Classes may not have a static property named prototype");var a=e.value=this.parseMethod(t,r,n);return"get"===e.kind&&0!==a.params.length&&this.raiseRecoverable(a.start,"getter should have no params"),"set"===e.kind&&1!==a.params.length&&this.raiseRecoverable(a.start,"setter should have exactly one param"),"set"===e.kind&&"RestElement"===a.params[0].type&&this.raiseRecoverable(a.params[0].start,"Setter cannot use rest params"),this.finishNode(e,"MethodDefinition")},he.parseClassField=function(e){if(be(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&be(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat(x.eq)){var t=this.currentThisScope(),r=t.inClassFieldInit;t.inClassFieldInit=!0,e.value=this.parseMaybeAssign(),t.inClassFieldInit=r}else e.value=null;return this.semicolon(),this.finishNode(e,"PropertyDefinition")},he.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(X|J);this.type!==x.braceR;){var r=this.parseStatement(null);e.body.push(r)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,"StaticBlock")},he.parseClassId=function(e,t){this.type===x.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,re,!1)):(!0===t&&this.unexpected(),e.id=null)},he.parseClassSuper=function(e){e.superClass=this.eat(x._extends)?this.parseExprSubscripts(null,!1):null},he.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared},he.exitClassBody=function(){var e=this.privateNameStack.pop(),t=e.declared,r=e.used;if(this.options.checkPrivateFields)for(var n=this.privateNameStack.length,i=0===n?null:this.privateNameStack[n-1],a=0;a=11&&(this.eatContextual("as")?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==x.string&&this.unexpected(),e.source=this.parseExprAtom(),this.semicolon(),this.finishNode(e,"ExportAllDeclaration")},he.parseExport=function(e,t){if(this.next(),this.eat(x.star))return this.parseExportAllDeclaration(e,t);if(this.eat(x._default))return this.checkExport(t,"default",this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),"VariableDeclaration"===e.declaration.type?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null;else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))this.type!==x.string&&this.unexpected(),e.source=this.parseExprAtom();else{for(var r=0,n=e.specifiers;r=13&&this.type===x.string){var e=this.parseLiteral(this.value);return L.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(!0)},he.adaptDirectivePrologue=function(e){for(var t=0;t=5&&"ExpressionStatement"===e.type&&"Literal"===e.expression.type&&"string"===typeof e.expression.value&&('"'===this.input[e.start]||"'"===this.input[e.start])};var xe=se.prototype;xe.toAssignable=function(e,t,r){if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":this.inAsync&&"await"===e.name&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",r&&this.checkPatternErrors(r,!0);for(var n=0,i=e.properties;n=8&&!o&&"async"===c.name&&!this.canInsertSemicolon()&&this.eat(x._function))return this.overrideContext(Ae.f_expr),this.parseFunction(this.startNodeAt(a,s),0,!1,!0,t);if(i&&!this.canInsertSemicolon()){if(this.eat(x.arrow))return this.parseArrowExpression(this.startNodeAt(a,s),[c],!1,t);if(this.options.ecmaVersion>=8&&"async"===c.name&&this.type===x.name&&!o&&(!this.potentialArrowInForAwait||"of"!==this.value||this.containsEsc))return c=this.parseIdent(!1),!this.canInsertSemicolon()&&this.eat(x.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAt(a,s),[c],!0,t)}return c;case x.regexp:var u=this.value;return(n=this.parseLiteral(u.value)).regex={pattern:u.pattern,flags:u.flags},n;case x.num:case x.string:return this.parseLiteral(this.value);case x._null:case x._true:case x._false:return(n=this.startNode()).value=this.type===x._null?null:this.type===x._true,n.raw=this.type.keyword,this.next(),this.finishNode(n,"Literal");case x.parenL:var l=this.start,h=this.parseParenAndDistinguishExpression(i,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(h)&&(e.parenthesizedAssign=l),e.parenthesizedBind<0&&(e.parenthesizedBind=l)),h;case x.bracketL:return n=this.startNode(),this.next(),n.elements=this.parseExprList(x.bracketR,!0,!0,e),this.finishNode(n,"ArrayExpression");case x.braceL:return this.overrideContext(Ae.b_expr),this.parseObj(!1,e);case x._function:return n=this.startNode(),this.next(),this.parseFunction(n,0);case x._class:return this.parseClass(this.startNode(),!1);case x._new:return this.parseNew();case x.backQuote:return this.parseTemplate();case x._import:return this.options.ecmaVersion>=11?this.parseExprImport(r):this.unexpected();default:return this.parseExprAtomDefault()}},Se.parseExprAtomDefault=function(){this.unexpected()},Se.parseExprImport=function(e){var t=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===x.parenL&&!e)return this.parseDynamicImport(t);if(this.type===x.dot){var r=this.startNodeAt(t.start,t.loc&&t.loc.start);return r.name="import",t.meta=this.finishNode(r,"Identifier"),this.parseImportMeta(t)}this.unexpected()},Se.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),!this.eat(x.parenR)){var t=this.start;this.eat(x.comma)&&this.eat(x.parenR)?this.raiseRecoverable(t,"Trailing comma is not allowed in import()"):this.unexpected(t)}return this.finishNode(e,"ImportExpression")},Se.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),"meta"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),t&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),"module"===this.options.sourceType||this.options.allowImportExportEverywhere||this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")},Se.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),110===t.raw.charCodeAt(t.raw.length-1)&&(t.bigint=t.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(t,"Literal")},Se.parseParenExpression=function(){this.expect(x.parenL);var e=this.parseExpression();return this.expect(x.parenR),e},Se.shouldParseArrow=function(e){return!this.canInsertSemicolon()},Se.parseParenAndDistinguishExpression=function(e,t){var r,n=this.start,i=this.startLoc,a=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var s,o=this.start,c=this.startLoc,u=[],l=!0,h=!1,p=new le,f=this.yieldPos,d=this.awaitPos;for(this.yieldPos=0,this.awaitPos=0;this.type!==x.parenR;){if(l?l=!1:this.expect(x.comma),a&&this.afterTrailingComma(x.parenR,!0)){h=!0;break}if(this.type===x.ellipsis){s=this.start,u.push(this.parseParenItem(this.parseRestBinding())),this.type===x.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}u.push(this.parseMaybeAssign(!1,p,this.parseParenItem))}var g=this.lastTokEnd,m=this.lastTokEndLoc;if(this.expect(x.parenR),e&&this.shouldParseArrow(u)&&this.eat(x.arrow))return this.checkPatternErrors(p,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=f,this.awaitPos=d,this.parseParenArrowList(n,i,u,t);u.length&&!h||this.unexpected(this.lastTokStart),s&&this.unexpected(s),this.checkExpressionErrors(p,!0),this.yieldPos=f||this.yieldPos,this.awaitPos=d||this.awaitPos,u.length>1?((r=this.startNodeAt(o,c)).expressions=u,this.finishNodeAt(r,"SequenceExpression",g,m)):r=u[0]}else r=this.parseParenExpression();if(this.options.preserveParens){var y=this.startNodeAt(n,i);return y.expression=r,this.finishNode(y,"ParenthesizedExpression")}return r},Se.parseParenItem=function(e){return e},Se.parseParenArrowList=function(e,t,r,n){return this.parseArrowExpression(this.startNodeAt(e,t),r,!1,n)};var _e=[];Se.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===x.dot){var t=this.startNodeAt(e.start,e.loc&&e.loc.start);t.name="new",e.meta=this.finishNode(t,"Identifier"),this.next();var r=this.containsEsc;return e.property=this.parseIdent(!0),"target"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),r&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block"),this.finishNode(e,"MetaProperty")}var n=this.start,i=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),n,i,!0,!1),this.eat(x.parenL)?e.arguments=this.parseExprList(x.parenR,this.options.ecmaVersion>=8,!1):e.arguments=_e,this.finishNode(e,"NewExpression")},Se.parseTemplateElement=function(e){var t=e.isTagged,r=this.startNode();return this.type===x.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),r.value={raw:this.value,cooked:null}):r.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,"\n"),cooked:this.value},this.next(),r.tail=this.type===x.backQuote,this.finishNode(r,"TemplateElement")},Se.parseTemplate=function(e){void 0===e&&(e={});var t=e.isTagged;void 0===t&&(t=!1);var r=this.startNode();this.next(),r.expressions=[];var n=this.parseTemplateElement({isTagged:t});for(r.quasis=[n];!n.tail;)this.type===x.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(x.dollarBraceL),r.expressions.push(this.parseExpression()),this.expect(x.braceR),r.quasis.push(n=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(r,"TemplateLiteral")},Se.isAsyncProp=function(e){return!e.computed&&"Identifier"===e.key.type&&"async"===e.key.name&&(this.type===x.name||this.type===x.num||this.type===x.string||this.type===x.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===x.star)&&!w.test(this.input.slice(this.lastTokEnd,this.start))},Se.parseObj=function(e,t){var r=this.startNode(),n=!0,i={};for(r.properties=[],this.next();!this.eat(x.braceR);){if(n)n=!1;else if(this.expect(x.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(x.braceR))break;var a=this.parseProperty(e,t);e||this.checkPropClash(a,i,t),r.properties.push(a)}return this.finishNode(r,e?"ObjectPattern":"ObjectExpression")},Se.parseProperty=function(e,t){var r,n,i,a,s=this.startNode();if(this.options.ecmaVersion>=9&&this.eat(x.ellipsis))return e?(s.argument=this.parseIdent(!1),this.type===x.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(s,"RestElement")):(s.argument=this.parseMaybeAssign(!1,t),this.type===x.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(s,"SpreadElement"));this.options.ecmaVersion>=6&&(s.method=!1,s.shorthand=!1,(e||t)&&(i=this.start,a=this.startLoc),e||(r=this.eat(x.star)));var o=this.containsEsc;return this.parsePropertyName(s),!e&&!o&&this.options.ecmaVersion>=8&&!r&&this.isAsyncProp(s)?(n=!0,r=this.options.ecmaVersion>=9&&this.eat(x.star),this.parsePropertyName(s)):n=!1,this.parsePropertyValue(s,e,r,n,i,a,t,o),this.finishNode(s,"Property")},Se.parseGetterSetter=function(e){e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);var t="get"===e.kind?0:1;if(e.value.params.length!==t){var r=e.value.start;"get"===e.kind?this.raiseRecoverable(r,"getter should have no params"):this.raiseRecoverable(r,"setter should have exactly one param")}else"set"===e.kind&&"RestElement"===e.value.params[0].type&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")},Se.parsePropertyValue=function(e,t,r,n,i,a,s,o){(r||n)&&this.type===x.colon&&this.unexpected(),this.eat(x.colon)?(e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,s),e.kind="init"):this.options.ecmaVersion>=6&&this.type===x.parenL?(t&&this.unexpected(),e.kind="init",e.method=!0,e.value=this.parseMethod(r,n)):t||o||!(this.options.ecmaVersion>=5)||e.computed||"Identifier"!==e.key.type||"get"!==e.key.name&&"set"!==e.key.name||this.type===x.comma||this.type===x.braceR||this.type===x.eq?this.options.ecmaVersion>=6&&!e.computed&&"Identifier"===e.key.type?((r||n)&&this.unexpected(),this.checkUnreserved(e.key),"await"!==e.key.name||this.awaitIdentPos||(this.awaitIdentPos=i),e.kind="init",t?e.value=this.parseMaybeDefault(i,a,this.copyNode(e.key)):this.type===x.eq&&s?(s.shorthandAssign<0&&(s.shorthandAssign=this.start),e.value=this.parseMaybeDefault(i,a,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.shorthand=!0):this.unexpected():((r||n)&&this.unexpected(),this.parseGetterSetter(e))},Se.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(x.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(x.bracketR),e.key;e.computed=!1}return e.key=this.type===x.num||this.type===x.string?this.parseExprAtom():this.parseIdent("never"!==this.options.allowReserved)},Se.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},Se.parseMethod=function(e,t,r){var n=this.startNode(),i=this.yieldPos,a=this.awaitPos,s=this.awaitIdentPos;return this.initFunction(n),this.options.ecmaVersion>=6&&(n.generator=e),this.options.ecmaVersion>=8&&(n.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Y(t,n.generator)|J|(r?Z:0)),this.expect(x.parenL),n.params=this.parseBindingList(x.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(n,!1,!0,!1),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=s,this.finishNode(n,"FunctionExpression")},Se.parseArrowExpression=function(e,t,r,n){var i=this.yieldPos,a=this.awaitPos,s=this.awaitIdentPos;return this.enterScope(Y(r,!1)|K),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!r),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1,n),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=s,this.finishNode(e,"ArrowFunctionExpression")},Se.parseFunctionBody=function(e,t,r,n){var i=t&&this.type!==x.braceL,a=this.strict,s=!1;if(i)e.body=this.parseMaybeAssign(n),e.expression=!0,this.checkParams(e,!1);else{var o=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);a&&!o||(s=this.strictDirective(this.end))&&o&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list");var c=this.labels;this.labels=[],s&&(this.strict=!0),this.checkParams(e,!a&&!s&&!t&&!r&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,ae),e.body=this.parseBlock(!1,void 0,s&&!a),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=c}this.exitScope()},Se.isSimpleParamList=function(e){for(var t=0,r=e;t-1||i.functions.indexOf(e)>-1||i.var.indexOf(e)>-1,i.lexical.push(e),this.inModule&&i.flags&z&&delete this.undefinedExports[e]}else if(t===ie)this.currentScope().lexical.push(e);else if(t===ne){var a=this.currentScope();n=this.treatFunctionsAsVar?a.lexical.indexOf(e)>-1:a.lexical.indexOf(e)>-1||a.var.indexOf(e)>-1,a.functions.push(e)}else for(var s=this.scopeStack.length-1;s>=0;--s){var o=this.scopeStack[s];if(o.lexical.indexOf(e)>-1&&!(o.flags&$&&o.lexical[0]===e)||!this.treatFunctionsAsVarInScope(o)&&o.functions.indexOf(e)>-1){n=!0;break}if(o.var.push(e),this.inModule&&o.flags&z&&delete this.undefinedExports[e],o.flags&Q)break}n&&this.raiseRecoverable(r,"Identifier '"+e+"' has already been declared")},Pe.checkLocalExport=function(e){-1===this.scopeStack[0].lexical.indexOf(e.name)&&-1===this.scopeStack[0].var.indexOf(e.name)&&(this.undefinedExports[e.name]=e)},Pe.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},Pe.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&Q)return t}},Pe.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&Q&&!(t.flags&K))return t}};var Ie=function(e,t,r){this.type="",this.start=t,this.end=0,e.options.locations&&(this.loc=new D(e,r)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[t,0])},Oe=se.prototype;function Ne(e,t,r,n){return e.type=t,e.end=r,this.options.locations&&(e.loc.end=n),this.options.ranges&&(e.range[1]=r),e}Oe.startNode=function(){return new Ie(this,this.start,this.startLoc)},Oe.startNodeAt=function(e,t){return new Ie(this,e,t)},Oe.finishNode=function(e,t){return Ne.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},Oe.finishNodeAt=function(e,t,r,n){return Ne.call(this,e,t,r,n)},Oe.copyNode=function(e){var t=new Ie(this,e.start,this.startLoc);for(var r in e)t[r]=e[r];return t};var je="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",Re=je+" Extended_Pictographic",Le=Re+" EBase EComp EMod EPres ExtPict",Ve={9:je,10:Re,11:Re,12:Le,13:Le,14:Le},De={9:"",10:"",11:"",12:"",13:"",14:"Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji"},Me="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",Fe="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",Be=Fe+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",Ue=Be+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",qe=Ue+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",ze=qe+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",We={9:Fe,10:Be,11:Ue,12:qe,13:ze,14:ze+" Hrkt Katakana_Or_Hiragana Kawi Nag_Mundari Nagm Unknown Zzzz"},He={};function Ge(e){var t=He[e]={binary:j(Ve[e]+" "+Me),binaryOfStrings:j(De[e]),nonBinary:{General_Category:j(Me),Script:j(We[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}for(var Ke=0,$e=[9,10,11,12,13,14];Ke<$e.length;Ke+=1)Ge($e[Ke]);var Je=se.prototype,Ze=function(e){this.parser=e,this.validFlags="gim"+(e.options.ecmaVersion>=6?"uy":"")+(e.options.ecmaVersion>=9?"s":"")+(e.options.ecmaVersion>=13?"d":"")+(e.options.ecmaVersion>=15?"v":""),this.unicodeProperties=He[e.options.ecmaVersion>=14?14:e.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=[],this.backReferenceNames=[]};function Xe(e){return 36===e||e>=40&&e<=43||46===e||63===e||e>=91&&e<=94||e>=123&&e<=125}function Qe(e){return p(e,!0)||36===e||95===e}function Ye(e){return f(e,!0)||36===e||95===e||8204===e||8205===e}function et(e){return e>=65&&e<=90||e>=97&&e<=122}function tt(e){return e>=0&&e<=1114111}Ze.prototype.reset=function(e,t,r){var n=-1!==r.indexOf("v"),i=-1!==r.indexOf("u");this.start=0|e,this.source=t+"",this.flags=r,n&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=i&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=i&&this.parser.options.ecmaVersion>=9)},Ze.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+e)},Ze.prototype.at=function(e,t){void 0===t&&(t=!1);var r=this.source,n=r.length;if(e>=n)return-1;var i=r.charCodeAt(e);if(!t&&!this.switchU||i<=55295||i>=57344||e+1>=n)return i;var a=r.charCodeAt(e+1);return a>=56320&&a<=57343?(i<<10)+a-56613888:i},Ze.prototype.nextIndex=function(e,t){void 0===t&&(t=!1);var r=this.source,n=r.length;if(e>=n)return n;var i,a=r.charCodeAt(e);return!t&&!this.switchU||a<=55295||a>=57344||e+1>=n||(i=r.charCodeAt(e+1))<56320||i>57343?e+1:e+2},Ze.prototype.current=function(e){return void 0===e&&(e=!1),this.at(this.pos,e)},Ze.prototype.lookahead=function(e){return void 0===e&&(e=!1),this.at(this.nextIndex(this.pos,e),e)},Ze.prototype.advance=function(e){void 0===e&&(e=!1),this.pos=this.nextIndex(this.pos,e)},Ze.prototype.eat=function(e,t){return void 0===t&&(t=!1),this.current(t)===e&&(this.advance(t),!0)},Ze.prototype.eatChars=function(e,t){void 0===t&&(t=!1);for(var r=this.pos,n=0,i=e;n-1&&this.raise(e.start,"Duplicate regular expression flag"),"u"===s&&(n=!0),"v"===s&&(i=!0)}this.options.ecmaVersion>=15&&n&&i&&this.raise(e.start,"Invalid regular expression flag")},Je.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&e.groupNames.length>0&&(e.switchN=!0,this.regexp_pattern(e))},Je.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames.length=0,e.backReferenceNames.length=0,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var t=0,r=e.backReferenceNames;t=9&&(r=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!r,!0}return e.pos=t,!1},Je.regexp_eatQuantifier=function(e,t){return void 0===t&&(t=!1),!!this.regexp_eatQuantifierPrefix(e,t)&&(e.eat(63),!0)},Je.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},Je.regexp_eatBracedQuantifier=function(e,t){var r=e.pos;if(e.eat(123)){var n=0,i=-1;if(this.regexp_eatDecimalDigits(e)&&(n=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(i=e.lastIntValue),e.eat(125)))return-1!==i&&i=9?this.regexp_groupSpecifier(e):63===e.current()&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1},Je.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)},Je.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1},Je.regexp_eatSyntaxCharacter=function(e){var t=e.current();return!!Xe(t)&&(e.lastIntValue=t,e.advance(),!0)},Je.regexp_eatPatternCharacters=function(e){for(var t=e.pos,r=0;-1!==(r=e.current())&&!Xe(r);)e.advance();return e.pos!==t},Je.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return!(-1===t||36===t||t>=40&&t<=43||46===t||63===t||91===t||94===t||124===t)&&(e.advance(),!0)},Je.regexp_groupSpecifier=function(e){if(e.eat(63)){if(this.regexp_eatGroupName(e))return-1!==e.groupNames.indexOf(e.lastStringValue)&&e.raise("Duplicate capture group name"),void e.groupNames.push(e.lastStringValue);e.raise("Invalid group")}},Je.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise("Invalid capture group name")}return!1},Je.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=R(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=R(e.lastIntValue);return!0}return!1},Je.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,r=this.options.ecmaVersion>=11,n=e.current(r);return e.advance(r),92===n&&this.regexp_eatRegExpUnicodeEscapeSequence(e,r)&&(n=e.lastIntValue),Qe(n)?(e.lastIntValue=n,!0):(e.pos=t,!1)},Je.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,r=this.options.ecmaVersion>=11,n=e.current(r);return e.advance(r),92===n&&this.regexp_eatRegExpUnicodeEscapeSequence(e,r)&&(n=e.lastIntValue),Ye(n)?(e.lastIntValue=n,!0):(e.pos=t,!1)},Je.regexp_eatAtomEscape=function(e){return!!(this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e))||(e.switchU&&(99===e.current()&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)},Je.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var r=e.lastIntValue;if(e.switchU)return r>e.maxBackReference&&(e.maxBackReference=r),!0;if(r<=e.numCapturingParens)return!0;e.pos=t}return!1},Je.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1},Je.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)},Je.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},Je.regexp_eatZero=function(e){return 48===e.current()&&!ht(e.lookahead())&&(e.lastIntValue=0,e.advance(),!0)},Je.regexp_eatControlEscape=function(e){var t=e.current();return 116===t?(e.lastIntValue=9,e.advance(),!0):110===t?(e.lastIntValue=10,e.advance(),!0):118===t?(e.lastIntValue=11,e.advance(),!0):102===t?(e.lastIntValue=12,e.advance(),!0):114===t&&(e.lastIntValue=13,e.advance(),!0)},Je.regexp_eatControlLetter=function(e){var t=e.current();return!!et(t)&&(e.lastIntValue=t%32,e.advance(),!0)},Je.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){void 0===t&&(t=!1);var r=e.pos,n=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var i=e.lastIntValue;if(n&&i>=55296&&i<=56319){var a=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var s=e.lastIntValue;if(s>=56320&&s<=57343)return e.lastIntValue=1024*(i-55296)+(s-56320)+65536,!0}e.pos=a,e.lastIntValue=i}return!0}if(n&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&tt(e.lastIntValue))return!0;n&&e.raise("Invalid unicode escape"),e.pos=r}return!1},Je.regexp_eatIdentityEscape=function(e){if(e.switchU)return!!this.regexp_eatSyntaxCharacter(e)||!!e.eat(47)&&(e.lastIntValue=47,!0);var t=e.current();return!(99===t||e.switchN&&107===t)&&(e.lastIntValue=t,e.advance(),!0)},Je.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do{e.lastIntValue=10*e.lastIntValue+(t-48),e.advance()}while((t=e.current())>=48&&t<=57);return!0}return!1};var rt=0,nt=1,it=2;function at(e){return 100===e||68===e||115===e||83===e||119===e||87===e}function st(e){return et(e)||95===e}function ot(e){return st(e)||ht(e)}function ct(e){return 33===e||e>=35&&e<=38||e>=42&&e<=44||46===e||e>=58&&e<=64||94===e||96===e||126===e}function ut(e){return 40===e||41===e||45===e||47===e||e>=91&&e<=93||e>=123&&e<=125}function lt(e){return 33===e||35===e||37===e||38===e||44===e||45===e||e>=58&&e<=62||64===e||96===e||126===e}function ht(e){return e>=48&&e<=57}function pt(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function ft(e){return e>=65&&e<=70?e-65+10:e>=97&&e<=102?e-97+10:e-48}function dt(e){return e>=48&&e<=55}Je.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(at(t))return e.lastIntValue=-1,e.advance(),nt;var r=!1;if(e.switchU&&this.options.ecmaVersion>=9&&((r=80===t)||112===t)){var n;if(e.lastIntValue=-1,e.advance(),e.eat(123)&&(n=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return r&&n===it&&e.raise("Invalid property name"),n;e.raise("Invalid property name")}return rt},Je.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var r=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var n=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,r,n),nt}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var i=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,i)}return rt},Je.regexp_validateUnicodePropertyNameAndValue=function(e,t,r){I(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(r)||e.raise("Invalid property value")},Je.regexp_validateUnicodePropertyNameOrValue=function(e,t){return e.unicodeProperties.binary.test(t)?nt:e.switchV&&e.unicodeProperties.binaryOfStrings.test(t)?it:void e.raise("Invalid property name")},Je.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";st(t=e.current());)e.lastStringValue+=R(t),e.advance();return""!==e.lastStringValue},Je.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";ot(t=e.current());)e.lastStringValue+=R(t),e.advance();return""!==e.lastStringValue},Je.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},Je.regexp_eatCharacterClass=function(e){if(e.eat(91)){var t=e.eat(94),r=this.regexp_classContents(e);return e.eat(93)||e.raise("Unterminated character class"),t&&r===it&&e.raise("Negated character class may contain strings"),!0}return!1},Je.regexp_classContents=function(e){return 93===e.current()?nt:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),nt)},Je.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var r=e.lastIntValue;!e.switchU||-1!==t&&-1!==r||e.raise("Invalid character class"),-1!==t&&-1!==r&&t>r&&e.raise("Range out of order in character class")}}},Je.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var r=e.current();(99===r||dt(r))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=t}var n=e.current();return 93!==n&&(e.lastIntValue=n,e.advance(),!0)},Je.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)},Je.regexp_classSetExpression=function(e){var t,r=nt;if(this.regexp_eatClassSetRange(e));else if(t=this.regexp_eatClassSetOperand(e)){t===it&&(r=it);for(var n=e.pos;e.eatChars([38,38]);)38!==e.current()&&(t=this.regexp_eatClassSetOperand(e))?t!==it&&(r=nt):e.raise("Invalid character in character class");if(n!==e.pos)return r;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise("Invalid character in character class");if(n!==e.pos)return r}else e.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(e)){if(!(t=this.regexp_eatClassSetOperand(e)))return r;t===it&&(r=it)}},Je.regexp_eatClassSetRange=function(e){var t=e.pos;if(this.regexp_eatClassSetCharacter(e)){var r=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var n=e.lastIntValue;return-1!==r&&-1!==n&&r>n&&e.raise("Range out of order in character class"),!0}e.pos=t}return!1},Je.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?nt:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)},Je.regexp_eatNestedClass=function(e){var t=e.pos;if(e.eat(91)){var r=e.eat(94),n=this.regexp_classContents(e);if(e.eat(93))return r&&n===it&&e.raise("Negated character class may contain strings"),n;e.pos=t}if(e.eat(92)){var i=this.regexp_eatCharacterClassEscape(e);if(i)return i;e.pos=t}return null},Je.regexp_eatClassStringDisjunction=function(e){var t=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var r=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return r}else e.raise("Invalid escape");e.pos=t}return null},Je.regexp_classStringDisjunctionContents=function(e){for(var t=this.regexp_classString(e);e.eat(124);)this.regexp_classString(e)===it&&(t=it);return t},Je.regexp_classString=function(e){for(var t=0;this.regexp_eatClassSetCharacter(e);)t++;return 1===t?nt:it},Je.regexp_eatClassSetCharacter=function(e){var t=e.pos;if(e.eat(92))return!(!this.regexp_eatCharacterEscape(e)&&!this.regexp_eatClassSetReservedPunctuator(e))||(e.eat(98)?(e.lastIntValue=8,!0):(e.pos=t,!1));var r=e.current();return!(r<0||r===e.lookahead()&&ct(r))&&!ut(r)&&(e.advance(),e.lastIntValue=r,!0)},Je.regexp_eatClassSetReservedPunctuator=function(e){var t=e.current();return!!lt(t)&&(e.lastIntValue=t,e.advance(),!0)},Je.regexp_eatClassControlLetter=function(e){var t=e.current();return!(!ht(t)&&95!==t)&&(e.lastIntValue=t%32,e.advance(),!0)},Je.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise("Invalid escape"),e.pos=t}return!1},Je.regexp_eatDecimalDigits=function(e){var t=e.pos,r=0;for(e.lastIntValue=0;ht(r=e.current());)e.lastIntValue=10*e.lastIntValue+(r-48),e.advance();return e.pos!==t},Je.regexp_eatHexDigits=function(e){var t=e.pos,r=0;for(e.lastIntValue=0;pt(r=e.current());)e.lastIntValue=16*e.lastIntValue+ft(r),e.advance();return e.pos!==t},Je.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var r=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=64*t+8*r+e.lastIntValue:e.lastIntValue=8*t+r}else e.lastIntValue=t;return!0}return!1},Je.regexp_eatOctalDigit=function(e){var t=e.current();return dt(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)},Je.regexp_eatFixedHexDigits=function(e,t){var r=e.pos;e.lastIntValue=0;for(var n=0;n=this.input.length?this.finishToken(x.eof):e.override?e.override(this):void this.readToken(this.fullCharCodeAtPos())},mt.readToken=function(e){return p(e,this.options.ecmaVersion>=6)||92===e?this.readWord():this.getTokenFromCode(e)},mt.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);if(e<=55295||e>=56320)return e;var t=this.input.charCodeAt(this.pos+1);return t<=56319||t>=57344?e:(e<<10)+t-56613888},mt.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,r=this.input.indexOf("*/",this.pos+=2);if(-1===r&&this.raise(this.pos-2,"Unterminated comment"),this.pos=r+2,this.options.locations)for(var n=void 0,i=t;(n=S(this.input,i,this.pos))>-1;)++this.curLine,i=this.lineStart=n;this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,r),t,this.pos,e,this.curPosition())},mt.skipLineComment=function(e){for(var t=this.pos,r=this.options.onComment&&this.curPosition(),n=this.input.charCodeAt(this.pos+=e);this.pos8&&e<14||e>=5760&&E.test(String.fromCharCode(e))))break e;++this.pos}}},mt.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var r=this.type;this.type=e,this.value=t,this.updateContext(r)},mt.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&46===e&&46===t?(this.pos+=3,this.finishToken(x.ellipsis)):(++this.pos,this.finishToken(x.dot))},mt.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):61===e?this.finishOp(x.assign,2):this.finishOp(x.slash,1)},mt.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),r=1,n=42===e?x.star:x.modulo;return this.options.ecmaVersion>=7&&42===e&&42===t&&(++r,n=x.starstar,t=this.input.charCodeAt(this.pos+2)),61===t?this.finishOp(x.assign,r+1):this.finishOp(n,r)},mt.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?this.options.ecmaVersion>=12&&61===this.input.charCodeAt(this.pos+2)?this.finishOp(x.assign,3):this.finishOp(124===e?x.logicalOR:x.logicalAND,2):61===t?this.finishOp(x.assign,2):this.finishOp(124===e?x.bitwiseOR:x.bitwiseAND,1)},mt.readToken_caret=function(){return 61===this.input.charCodeAt(this.pos+1)?this.finishOp(x.assign,2):this.finishOp(x.bitwiseXOR,1)},mt.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?45!==t||this.inModule||62!==this.input.charCodeAt(this.pos+2)||0!==this.lastTokEnd&&!w.test(this.input.slice(this.lastTokEnd,this.pos))?this.finishOp(x.incDec,2):(this.skipLineComment(3),this.skipSpace(),this.nextToken()):61===t?this.finishOp(x.assign,2):this.finishOp(x.plusMin,1)},mt.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),r=1;return t===e?(r=62===e&&62===this.input.charCodeAt(this.pos+2)?3:2,61===this.input.charCodeAt(this.pos+r)?this.finishOp(x.assign,r+1):this.finishOp(x.bitShift,r)):33!==t||60!==e||this.inModule||45!==this.input.charCodeAt(this.pos+2)||45!==this.input.charCodeAt(this.pos+3)?(61===t&&(r=2),this.finishOp(x.relational,r)):(this.skipLineComment(4),this.skipSpace(),this.nextToken())},mt.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return 61===t?this.finishOp(x.equality,61===this.input.charCodeAt(this.pos+2)?3:2):61===e&&62===t&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(x.arrow)):this.finishOp(61===e?x.eq:x.prefix,1)},mt.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(46===t){var r=this.input.charCodeAt(this.pos+2);if(r<48||r>57)return this.finishOp(x.questionDot,2)}if(63===t)return e>=12&&61===this.input.charCodeAt(this.pos+2)?this.finishOp(x.assign,3):this.finishOp(x.coalesce,2)}return this.finishOp(x.question,1)},mt.readToken_numberSign=function(){var e=35;if(this.options.ecmaVersion>=13&&(++this.pos,p(e=this.fullCharCodeAtPos(),!0)||92===e))return this.finishToken(x.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+R(e)+"'")},mt.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(x.parenL);case 41:return++this.pos,this.finishToken(x.parenR);case 59:return++this.pos,this.finishToken(x.semi);case 44:return++this.pos,this.finishToken(x.comma);case 91:return++this.pos,this.finishToken(x.bracketL);case 93:return++this.pos,this.finishToken(x.bracketR);case 123:return++this.pos,this.finishToken(x.braceL);case 125:return++this.pos,this.finishToken(x.braceR);case 58:return++this.pos,this.finishToken(x.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(x.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(120===t||88===t)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(111===t||79===t)return this.readRadixNumber(8);if(98===t||66===t)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(x.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+R(e)+"'")},mt.finishOp=function(e,t){var r=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,r)},mt.readRegexp=function(){for(var e,t,r=this.pos;;){this.pos>=this.input.length&&this.raise(r,"Unterminated regular expression");var n=this.input.charAt(this.pos);if(w.test(n)&&this.raise(r,"Unterminated regular expression"),e)e=!1;else{if("["===n)t=!0;else if("]"===n&&t)t=!1;else if("/"===n&&!t)break;e="\\"===n}++this.pos}var i=this.input.slice(r,this.pos);++this.pos;var a=this.pos,s=this.readWord1();this.containsEsc&&this.unexpected(a);var o=this.regexpState||(this.regexpState=new Ze(this));o.reset(r,i,s),this.validateRegExpFlags(o),this.validateRegExpPattern(o);var c=null;try{c=new RegExp(i,s)}catch(u){}return this.finishToken(x.regexp,{pattern:i,flags:s,value:c})},mt.readInt=function(e,t,r){for(var n=this.options.ecmaVersion>=12&&void 0===t,i=r&&48===this.input.charCodeAt(this.pos),a=this.pos,s=0,o=0,c=0,u=null==t?1/0:t;c=97?l-97+10:l>=65?l-65+10:l>=48&&l<=57?l-48:1/0)>=e)break;o=l,s=s*e+h}}return n&&95===o&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===a||null!=t&&this.pos-a!==t?null:s},mt.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var r=this.readInt(e);return null==r&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&110===this.input.charCodeAt(this.pos)?(r=vt(this.input.slice(t,this.pos)),++this.pos):p(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(x.num,r)},mt.readNumber=function(e){var t=this.pos;e||null!==this.readInt(10,void 0,!0)||this.raise(t,"Invalid number");var r=this.pos-t>=2&&48===this.input.charCodeAt(t);r&&this.strict&&this.raise(t,"Invalid number");var n=this.input.charCodeAt(this.pos);if(!r&&!e&&this.options.ecmaVersion>=11&&110===n){var i=vt(this.input.slice(t,this.pos));return++this.pos,p(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(x.num,i)}r&&/[89]/.test(this.input.slice(t,this.pos))&&(r=!1),46!==n||r||(++this.pos,this.readInt(10),n=this.input.charCodeAt(this.pos)),69!==n&&101!==n||r||(43!==(n=this.input.charCodeAt(++this.pos))&&45!==n||++this.pos,null===this.readInt(10)&&this.raise(t,"Invalid number")),p(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var a=yt(this.input.slice(t,this.pos),r);return this.finishToken(x.num,a)},mt.readCodePoint=function(){var e;if(123===this.input.charCodeAt(this.pos)){this.options.ecmaVersion<6&&this.unexpected();var t=++this.pos;e=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,e>1114111&&this.invalidStringToken(t,"Code point out of bounds")}else e=this.readHexChar(4);return e},mt.readString=function(e){for(var t="",r=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var n=this.input.charCodeAt(this.pos);if(n===e)break;92===n?(t+=this.input.slice(r,this.pos),t+=this.readEscapedChar(!1),r=this.pos):8232===n||8233===n?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(k(n)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(r,this.pos++),this.finishToken(x.string,t)};var bt={};mt.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e!==bt)throw e;this.readInvalidTemplateToken()}this.inTemplateElement=!1},mt.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw bt;this.raise(e,t)},mt.readTmplToken=function(){for(var e="",t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var r=this.input.charCodeAt(this.pos);if(96===r||36===r&&123===this.input.charCodeAt(this.pos+1))return this.pos!==this.start||this.type!==x.template&&this.type!==x.invalidTemplate?(e+=this.input.slice(t,this.pos),this.finishToken(x.template,e)):36===r?(this.pos+=2,this.finishToken(x.dollarBraceL)):(++this.pos,this.finishToken(x.backQuote));if(92===r)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(k(r)){switch(e+=this.input.slice(t,this.pos),++this.pos,r){case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:e+="\n";break;default:e+=String.fromCharCode(r)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}},mt.readInvalidTemplateToken=function(){for(;this.pos=48&&t<=55){var n=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],i=parseInt(n,8);return i>255&&(n=n.slice(0,-1),i=parseInt(n,8)),this.pos+=n.length-1,t=this.input.charCodeAt(this.pos),"0"===n&&56!==t&&57!==t||!this.strict&&!e||this.invalidStringToken(this.pos-1-n.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(i)}return k(t)?"":String.fromCharCode(t)}},mt.readHexChar=function(e){var t=this.pos,r=this.readInt(16,e);return null===r&&this.invalidStringToken(t,"Bad character escape sequence"),r},mt.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,r=this.pos,n=this.options.ecmaVersion>=6;this.pos=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}var j={RES:void 0},R={RES:void 0},L=O("continue"),V=O("break"),D=O("super"),M=O("supercall"),F=O("noctor"),B=O("clsctor"),U=O("newtarget"),q=O("private"),z=O("noinit"),W=O("deadzone"),H=O("import"),G=O("exports"),K="0.5.2",$=function(){function e(e,t){this.kind=e,this.value=t}return e.prototype.get=function(){return this.value},e.prototype.set=function(e){if("const"===this.kind)throw new TypeError("Assignment to constant variable");return this.value=e},e}(),J=function(){function e(e,t){this.object=e,this.property=t}return e.prototype.get=function(){return this.object[this.property]},e.prototype.set=function(e){return this.object[this.property]=e,!0},e.prototype.del=function(){return delete this.object[this.property]},e}(),Z=function(){function e(e,t){void 0===e&&(e=null),void 0===t&&(t=!1),this.context=x(null),this.parent=e,this.isolated=t}return e.prototype.global=function(){for(var e=this;e.parent;)e=e.parent;return e},e.prototype.clone=function(){var t=new e(this.parent,this.isolated);for(var r in this.context){var n=this.context[r];t[n.kind](r,n.get())}return t},e.prototype.find=function(e){if(this.context[e])return this.context[e];if(this.parent)return this.parent.find(e);var t=this.global().find("window").get();return e in t?new J(t,e):null},e.prototype.var=function(e,t){for(var r=this;r.parent&&!r.isolated;)r=r.parent;var n=r.context[e];if(n){if("var"!==n.kind)throw new SyntaxError("Identifier '"+e+"' has already been declared");t!==z&&n.set(t)}else r.context[e]=new $("var",t===z?void 0:t);if(!r.parent){var i=r.find("window").get();t!==z&&o(i,e,{value:t,writable:!0,enumerable:!0})}},e.prototype.let=function(e,t){var r=this.context[e];if(r&&r.get()!==W)throw new SyntaxError("Identifier '"+e+"' has already been declared");this.context[e]=new $("let",t)},e.prototype.const=function(e,t){var r=this.context[e];if(r&&r.get()!==W)throw new SyntaxError("Identifier '"+e+"' has already been declared");this.context[e]=new $("const",t)},e.prototype.func=function(e,t){var r=this.context[e];if(r&&"var"!==r.kind)throw new SyntaxError("Identifier '"+e+"' has already been declared");this.context[e]=new $("var",t)},e}();function X(e,t){var r,n,i,a,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:o(0),throw:o(1),return:o(2)},"function"===typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function o(e){return function(t){return c([e,t])}}function c(a){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===a[0]||2===a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}function Y(e,t){var r="function"===typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,a=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)s.push(n.value)}catch(o){i={error:o}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return s}function ee(){for(var e=[],t=0;t":return r>n;case">=":return r>=n;case"<<":return r<>":return r>>n;case">>>":return r>>>n;case"+":return r+n;case"-":return r-n;case"*":return r*n;case"**":return Math.pow(r,n);case"/":return r/n;case"%":return r%n;case"|":return r|n;case"^":return r^n;case"&":return r&n;case"in":return r in n;case"instanceof":return r instanceof n;default:throw new SyntaxError("Unexpected token "+e.operator)}}function pe(e,t){var r,n,i=e.left;if("Identifier"===i.type){if(!(n=te(i,t,{getVar:!0,throwErr:!1}))){var a=t.global().find("window").get();n=new J(a,i.name)}}else{if("MemberExpression"!==i.type)return Mr(i,t,{feed:Me(e.right,t)});n=de(i,t,{getVar:!0})}var s=Me(e.right,t);switch(e.operator){case"=":return n.set(s),n.get();case"+=":return n.set(n.get()+s),n.get();case"-=":return n.set(n.get()-s),n.get();case"*=":return n.set(n.get()*s),n.get();case"/=":return n.set(n.get()/s),n.get();case"%=":return n.set(n.get()%s),n.get();case"**=":return n.set(Math.pow(n.get(),s)),n.get();case"<<=":return n.set(n.get()<>=":return n.set(n.get()>>s),n.get();case">>>=":return n.set(n.get()>>>s),n.get();case"|=":return n.set(n.get()|s),n.get();case"^=":return n.set(n.get()^s),n.get();case"&=":return n.set(n.get()&s),n.get();case"??=":return n.set(null!==(r=n.get())&&void 0!==r?r:s),n.get();case"&&=":return n.set(n.get()&&s),n.get();case"||=":return n.set(n.get()||s),n.get();default:throw new SyntaxError("Unexpected token "+e.operator)}}function fe(e,t){var r;switch(e.operator){case"||":return Me(e.left,t)||Me(e.right,t);case"&&":return Me(e.left,t)&&Me(e.right,t);case"??":return null!==(r=Me(e.left,t))&&void 0!==r?r:Me(e.right,t);default:throw new SyntaxError("Unexpected token "+e.operator)}}function de(e,t,r){void 0===r&&(r={});var n,i,a=r.getObj,s=void 0!==a&&a,c=r.getVar,u=void 0!==c&&c;if(n="Super"===e.object.type?Ee(e.object,t,{getProto:!0}):Me(e.object,t),s)return n;var l=!1;if(e.computed?i=Me(e.property,t):"PrivateIdentifier"===e.property.type?(i=e.property.name,l=!0):i=e.property.name,l&&(n=n[q]),u){var h=b(n,i);if("Super"===e.object.type&&h){var p=t.find("this").get(),f=O(i);return o(p,f,{set:h}),new J(p,f)}return new J(n,i)}var d=v(n,i);if("Super"===e.object.type&&d){if(p=t.find("this").get(),e.optional&&null==p)return;return d.call(p)}return e.optional&&null==n?void 0:n[i]}function ge(e,t){return Me(e.test,t)?Me(e.consequent,t):Me(e.alternate,t)}function me(e,t){var r,n;if("MemberExpression"===e.callee.type){if(n=de(e.callee,t,{getObj:!0}),e.callee.optional&&null==n)return;var i=void 0,a=!1;e.callee.computed?i=Me(e.callee.property,t):"PrivateIdentifier"===e.callee.property.type?(i=e.callee.property.name,a=!0):i=e.callee.property.name;var s=n;if(a&&(s=s[q]),"Super"===e.callee.object.type){var o=t.find("this").get();r=s[i].bind(o)}else r=s[i];if(e.optional&&null==r)return;if("function"!==typeof r)throw new TypeError(i+" is not a function");if(r[B])throw new TypeError("Class constructor "+i+" cannot be invoked without 'new'")}else{if(n=t.find("this").get(),r=Me(e.callee,t),e.optional&&null==r)return;if("function"!==typeof r||"Super"!==e.callee.type&&r[B]){var c;if("Identifier"===e.callee.type)c=e.callee.name;else try{c=JSON.stringify(r)}catch(zr){c=""+r}throw"function"!==typeof r?new TypeError(c+" is not a function"):new TypeError("Class constructor "+c+" cannot be invoked without 'new'")}}for(var u=[],l=0;l":return[2,r>n];case">=":return[2,r>=n];case"<<":return[2,r<>":return[2,r>>n];case">>>":return[2,r>>>n];case"+":return[2,r+n];case"-":return[2,r-n];case"*":return[2,r*n];case"**":return[2,Math.pow(r,n)];case"/":return[2,r/n];case"%":return[2,r%n];case"|":return[2,r|n];case"^":return[2,r^n];case"&":return[2,r&n];case"in":return[2,r in n];case"instanceof":return[2,r instanceof n];default:throw new SyntaxError("Unexpected token "+e.operator)}}}))}function _t(e,t){var r,n,i,a,s,o;return X(this,(function(c){switch(c.label){case 0:return"Identifier"!==(r=e.left).type?[3,2]:[5,Q(gt(r,t,{getVar:!0,throwErr:!1}))];case 1:return(n=c.sent())||(i=t.global().find("window").get(),n=new J(i,r.name)),[3,7];case 2:return"MemberExpression"!==r.type?[3,4]:[5,Q(Pt(r,t,{getVar:!0}))];case 3:return n=c.sent(),[3,7];case 4:case 7:return[5,Q(Qt(e.right,t))];case 5:return a=c.sent(),[5,Q(Nr(r,t,{feed:a}))];case 6:return[2,c.sent()];case 8:switch(s=c.sent(),e.operator){case"=":return n.set(s),[2,n.get()];case"+=":return n.set(n.get()+s),[2,n.get()];case"-=":return n.set(n.get()-s),[2,n.get()];case"*=":return n.set(n.get()*s),[2,n.get()];case"/=":return n.set(n.get()/s),[2,n.get()];case"%=":return n.set(n.get()%s),[2,n.get()];case"**=":return n.set(Math.pow(n.get(),s)),[2,n.get()];case"<<=":return n.set(n.get()<>=":return n.set(n.get()>>s),[2,n.get()];case">>>=":return n.set(n.get()>>>s),[2,n.get()];case"|=":return n.set(n.get()|s),[2,n.get()];case"^=":return n.set(n.get()^s),[2,n.get()];case"&=":return n.set(n.get()&s),[2,n.get()];case"??=":return n.set(null!==(o=n.get())&&void 0!==o?o:s),[2,n.get()];case"&&=":return n.set(n.get()&&s),[2,n.get()];case"||=":return n.set(n.get()||s),[2,n.get()];default:throw new SyntaxError("Unexpected token "+e.operator)}}}))}function Ct(e,t){var r,n,i,a;return X(this,(function(s){switch(s.label){case 0:switch(e.operator){case"||":return[3,1];case"&&":return[3,5];case"??":return[3,9]}return[3,14];case 1:return[5,Q(Qt(e.left,t))];case 2:return(r=s.sent())?[3,4]:[5,Q(Qt(e.right,t))];case 3:r=s.sent(),s.label=4;case 4:return[2,r];case 5:return[5,Q(Qt(e.left,t))];case 6:return(n=s.sent())?[5,Q(Qt(e.right,t))]:[3,8];case 7:n=s.sent(),s.label=8;case 8:return[2,n];case 9:return[5,Q(Qt(e.left,t))];case 10:return null===(a=s.sent())||void 0===a?[3,11]:(i=a,[3,13]);case 11:return[5,Q(Qt(e.right,t))];case 12:i=s.sent(),s.label=13;case 13:return[2,i];case 14:throw new SyntaxError("Unexpected token "+e.operator)}}))}function Pt(e,t,r){var n,i,a,s,c,u,l,h,p,f,d;return void 0===r&&(r={}),X(this,(function(g){switch(g.label){case 0:return n=r.getObj,i=void 0!==n&&n,a=r.getVar,s=void 0!==a&&a,"Super"!==e.object.type?[3,2]:[5,Q(Ft(e.object,t,{getProto:!0}))];case 1:return c=g.sent(),[3,4];case 2:return[5,Q(Qt(e.object,t))];case 3:c=g.sent(),g.label=4;case 4:return i?[2,c]:(l=!1,e.computed?[5,Q(Qt(e.property,t))]:[3,6]);case 5:return u=g.sent(),[3,7];case 6:"PrivateIdentifier"===e.property.type?(u=e.property.name,l=!0):u=e.property.name,g.label=7;case 7:return l&&(c=c[q]),s?(h=b(c,u),"Super"===e.object.type&&h?(d=t.find("this").get(),p=O(u),o(d,p,{set:h}),[2,new J(d,p)]):[2,new J(c,u)]):(f=v(c,u),"Super"===e.object.type&&f?(d=t.find("this").get(),e.optional&&null==d?[2,void 0]:[2,f.call(d)]):e.optional&&null==c?[2,void 0]:[2,c[u]])}}))}function Tt(e,t){var r;return X(this,(function(n){switch(n.label){case 0:return[5,Q(Qt(e.test,t))];case 1:return n.sent()?[5,Q(Qt(e.consequent,t))]:[3,3];case 2:return r=n.sent(),[3,5];case 3:return[5,Q(Qt(e.alternate,t))];case 4:r=n.sent(),n.label=5;case 5:return[2,r]}}))}function It(e,t){var r,n,i,a,s,o,c,u,l,h,p,f,d,g;return X(this,(function(m){switch(m.label){case 0:return"MemberExpression"!==e.callee.type?[3,5]:[5,Q(Pt(e.callee,t,{getObj:!0}))];case 1:return n=m.sent(),e.callee.optional&&null==n?[2,void 0]:(i=void 0,a=!1,e.callee.computed?[5,Q(Qt(e.callee.property,t))]:[3,3]);case 2:return i=m.sent(),[3,4];case 3:"PrivateIdentifier"===e.callee.property.type?(i=e.callee.property.name,a=!0):i=e.callee.property.name,m.label=4;case 4:if(s=n,a&&(s=s[q]),"Super"===e.callee.object.type?(o=t.find("this").get(),r=s[i].bind(o)):r=s[i],e.optional&&null==r)return[2,void 0];if("function"!==typeof r)throw new TypeError(i+" is not a function");if(r[B])throw new TypeError("Class constructor "+i+" cannot be invoked without 'new'");return[3,7];case 5:return n=t.find("this").get(),[5,Q(Qt(e.callee,t))];case 6:if(r=m.sent(),e.optional&&null==r)return[2,void 0];if("function"!==typeof r||"Super"!==e.callee.type&&r[B]){if("Identifier"===e.callee.type)c=e.callee.name;else try{c=JSON.stringify(r)}catch(zr){c=""+r}throw"function"!==typeof r?new TypeError(c+" is not a function"):new TypeError("Class constructor "+c+" cannot be invoked without 'new'")}m.label=7;case 7:u=[],l=0,m.label=8;case 8:return l-1;c--)e.body.splice(s[c],1);e.body=a.concat(e.body)}return[2]}}))}function Or(e,t){var r,n,i,a,s;return X(this,(function(o){switch(o.label){case 0:switch(e.type){case"VariableDeclaration":return[3,1];case"ForInStatement":case"ForOfStatement":return[3,3];case"ForStatement":return[3,5];case"WhileStatement":case"DoWhileStatement":return[3,7];case"IfStatement":return[3,9];case"BlockStatement":return[3,13];case"SwitchStatement":return[3,18];case"TryStatement":return[3,25]}return[3,38];case 1:return[5,Q(vr(e,t,{hoist:!0}))];case 2:return o.sent(),[3,38];case 3:return"VariableDeclaration"!==e.left.type?[3,5]:[5,Q(vr(e.left,t,{hoist:!0}))];case 4:o.sent(),o.label=5;case 5:return"ForStatement"!==e.type||"VariableDeclaration"!==e.init.type?[3,7]:[5,Q(vr(e.init,t,{hoist:!0}))];case 6:o.sent(),o.label=7;case 7:return[5,Q(Or(e.body,t))];case 8:return o.sent(),[3,38];case 9:return[5,Q(Or(e.consequent,t))];case 10:return o.sent(),e.alternate?[5,Q(Or(e.alternate,t))]:[3,12];case 11:o.sent(),o.label=12;case 12:return[3,38];case 13:s=0,o.label=14;case 14:return s-1;o--)e.body.splice(s[o],1);e.body=a.concat(e.body)}}function Dr(e,t){switch(e.type){case"VariableDeclaration":it(e,t,{hoist:!0});break;case"ForInStatement":case"ForOfStatement":"VariableDeclaration"===e.left.type&&it(e.left,t,{hoist:!0});case"ForStatement":"ForStatement"===e.type&&"VariableDeclaration"===e.init.type&&it(e.init,t,{hoist:!0});case"WhileStatement":case"DoWhileStatement":Dr(e.body,t);break;case"IfStatement":Dr(e.consequent,t),e.alternate&&Dr(e.alternate,t);break;case"BlockStatement":for(var r=0;rqr))throw new Error("unsupported ecmaVer");if(this.options.ecmaVersion=r,this.options.sourceType=s,i){var o=I();this.scope.let("globalThis",o),this.scope.let("window",o),this.scope.let("this",o)}else this.scope.let("globalThis",E),this.scope.let("window",E),this.scope.let("this",E);this.scope.const("module"===s?G:"exports",this.exports={})}return t.prototype.import=function(e,t){var r;if("string"===typeof e&&((r={})[e]=t,e=r),"object"===typeof e)for(var n=h(e),i=0;i{const r={alarms:{clear:{minArgs:0,maxArgs:1},clearAll:{minArgs:0,maxArgs:0},get:{minArgs:0,maxArgs:1},getAll:{minArgs:0,maxArgs:0}},bookmarks:{create:{minArgs:1,maxArgs:1},get:{minArgs:1,maxArgs:1},getChildren:{minArgs:1,maxArgs:1},getRecent:{minArgs:1,maxArgs:1},getSubTree:{minArgs:1,maxArgs:1},getTree:{minArgs:0,maxArgs:0},move:{minArgs:2,maxArgs:2},remove:{minArgs:1,maxArgs:1},removeTree:{minArgs:1,maxArgs:1},search:{minArgs:1,maxArgs:1},update:{minArgs:2,maxArgs:2}},browserAction:{disable:{minArgs:0,maxArgs:1,fallbackToNoCallback:!0},enable:{minArgs:0,maxArgs:1,fallbackToNoCallback:!0},getBadgeBackgroundColor:{minArgs:1,maxArgs:1},getBadgeText:{minArgs:1,maxArgs:1},getPopup:{minArgs:1,maxArgs:1},getTitle:{minArgs:1,maxArgs:1},openPopup:{minArgs:0,maxArgs:0},setBadgeBackgroundColor:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},setBadgeText:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},setIcon:{minArgs:1,maxArgs:1},setPopup:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},setTitle:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0}},browsingData:{remove:{minArgs:2,maxArgs:2},removeCache:{minArgs:1,maxArgs:1},removeCookies:{minArgs:1,maxArgs:1},removeDownloads:{minArgs:1,maxArgs:1},removeFormData:{minArgs:1,maxArgs:1},removeHistory:{minArgs:1,maxArgs:1},removeLocalStorage:{minArgs:1,maxArgs:1},removePasswords:{minArgs:1,maxArgs:1},removePluginData:{minArgs:1,maxArgs:1},settings:{minArgs:0,maxArgs:0}},commands:{getAll:{minArgs:0,maxArgs:0}},menus:{remove:{minArgs:1,maxArgs:1},removeAll:{minArgs:0,maxArgs:0},update:{minArgs:2,maxArgs:2}},cookies:{get:{minArgs:1,maxArgs:1},getAll:{minArgs:1,maxArgs:1},getAllCookieStores:{minArgs:0,maxArgs:0},remove:{minArgs:1,maxArgs:1},set:{minArgs:1,maxArgs:1}},devtools:{inspectedWindow:{eval:{minArgs:1,maxArgs:2,singleCallbackArg:!1}},panels:{create:{minArgs:3,maxArgs:3,singleCallbackArg:!0},elements:{createSidebarPane:{minArgs:1,maxArgs:1}}}},downloads:{cancel:{minArgs:1,maxArgs:1},download:{minArgs:1,maxArgs:1},erase:{minArgs:1,maxArgs:1},getFileIcon:{minArgs:1,maxArgs:2},open:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},pause:{minArgs:1,maxArgs:1},removeFile:{minArgs:1,maxArgs:1},resume:{minArgs:1,maxArgs:1},search:{minArgs:1,maxArgs:1},show:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0}},extension:{isAllowedFileSchemeAccess:{minArgs:0,maxArgs:0},isAllowedIncognitoAccess:{minArgs:0,maxArgs:0}},history:{addUrl:{minArgs:1,maxArgs:1},deleteAll:{minArgs:0,maxArgs:0},deleteRange:{minArgs:1,maxArgs:1},deleteUrl:{minArgs:1,maxArgs:1},getVisits:{minArgs:1,maxArgs:1},search:{minArgs:1,maxArgs:1}},i18n:{detectLanguage:{minArgs:1,maxArgs:1},getAcceptLanguages:{minArgs:0,maxArgs:0}},identity:{launchWebAuthFlow:{minArgs:1,maxArgs:1}},idle:{queryState:{minArgs:1,maxArgs:1}},management:{get:{minArgs:1,maxArgs:1},getAll:{minArgs:0,maxArgs:0},getSelf:{minArgs:0,maxArgs:0},setEnabled:{minArgs:2,maxArgs:2},uninstallSelf:{minArgs:0,maxArgs:1}},notifications:{clear:{minArgs:1,maxArgs:1},create:{minArgs:1,maxArgs:2},getAll:{minArgs:0,maxArgs:0},getPermissionLevel:{minArgs:0,maxArgs:0},update:{minArgs:2,maxArgs:2}},pageAction:{getPopup:{minArgs:1,maxArgs:1},getTitle:{minArgs:1,maxArgs:1},hide:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},setIcon:{minArgs:1,maxArgs:1},setPopup:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},setTitle:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},show:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0}},permissions:{contains:{minArgs:1,maxArgs:1},getAll:{minArgs:0,maxArgs:0},remove:{minArgs:1,maxArgs:1},request:{minArgs:1,maxArgs:1}},runtime:{getBackgroundPage:{minArgs:0,maxArgs:0},getPlatformInfo:{minArgs:0,maxArgs:0},openOptionsPage:{minArgs:0,maxArgs:0},requestUpdateCheck:{minArgs:0,maxArgs:0},sendMessage:{minArgs:1,maxArgs:3},sendNativeMessage:{minArgs:2,maxArgs:2},setUninstallURL:{minArgs:1,maxArgs:1}},sessions:{getDevices:{minArgs:0,maxArgs:1},getRecentlyClosed:{minArgs:0,maxArgs:1},restore:{minArgs:0,maxArgs:1}},storage:{local:{clear:{minArgs:0,maxArgs:0},get:{minArgs:0,maxArgs:1},getBytesInUse:{minArgs:0,maxArgs:1},remove:{minArgs:1,maxArgs:1},set:{minArgs:1,maxArgs:1}},managed:{get:{minArgs:0,maxArgs:1},getBytesInUse:{minArgs:0,maxArgs:1}},sync:{clear:{minArgs:0,maxArgs:0},get:{minArgs:0,maxArgs:1},getBytesInUse:{minArgs:0,maxArgs:1},remove:{minArgs:1,maxArgs:1},set:{minArgs:1,maxArgs:1}}},tabs:{captureVisibleTab:{minArgs:0,maxArgs:2},create:{minArgs:1,maxArgs:1},detectLanguage:{minArgs:0,maxArgs:1},discard:{minArgs:0,maxArgs:1},duplicate:{minArgs:1,maxArgs:1},executeScript:{minArgs:1,maxArgs:2},get:{minArgs:1,maxArgs:1},getCurrent:{minArgs:0,maxArgs:0},getZoom:{minArgs:0,maxArgs:1},getZoomSettings:{minArgs:0,maxArgs:1},goBack:{minArgs:0,maxArgs:1},goForward:{minArgs:0,maxArgs:1},highlight:{minArgs:1,maxArgs:1},insertCSS:{minArgs:1,maxArgs:2},move:{minArgs:2,maxArgs:2},query:{minArgs:1,maxArgs:1},reload:{minArgs:0,maxArgs:2},remove:{minArgs:1,maxArgs:1},removeCSS:{minArgs:1,maxArgs:2},sendMessage:{minArgs:2,maxArgs:3},setZoom:{minArgs:1,maxArgs:2},setZoomSettings:{minArgs:1,maxArgs:2},update:{minArgs:1,maxArgs:2}},topSites:{get:{minArgs:0,maxArgs:0}},webNavigation:{getAllFrames:{minArgs:1,maxArgs:1},getFrame:{minArgs:1,maxArgs:1}},webRequest:{handlerBehaviorChanged:{minArgs:0,maxArgs:0}},windows:{create:{minArgs:0,maxArgs:1},get:{minArgs:1,maxArgs:2},getAll:{minArgs:0,maxArgs:1},getCurrent:{minArgs:0,maxArgs:1},getLastFocused:{minArgs:0,maxArgs:1},remove:{minArgs:1,maxArgs:1},update:{minArgs:2,maxArgs:2}}};if(0===Object.keys(r).length)throw new Error("api-metadata.json has not been included in browser-polyfill");class n extends WeakMap{constructor(e){super(arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0),this.createItem=e}get(e){return this.has(e)||this.set(e,this.createItem(e)),super.get(e)}}const i=e=>e&&"object"===typeof e&&"function"===typeof e.then,a=(t,r)=>function(){for(var n=arguments.length,i=new Array(n),a=0;a1==e?"argument":"arguments",o=(e,t)=>function(r){for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;ot.maxArgs)throw new Error("Expected at most ".concat(t.maxArgs," ").concat(s(t.maxArgs)," for ").concat(e,"(), got ").concat(i.length));return new Promise(((n,s)=>{if(t.fallbackToNoCallback)try{r[e](...i,a({resolve:n,reject:s},t))}catch(o){console.warn("".concat(e," API method doesn't seem to support the callback parameter, ")+"falling back to call it without a callback: ",o),r[e](...i),t.fallbackToNoCallback=!1,t.noCallback=!0,n()}else t.noCallback?(r[e](...i),n()):r[e](...i,a({resolve:n,reject:s},t))}))},c=(e,t,r)=>new Proxy(t,{apply:(t,n,i)=>r.call(n,e,...i)});let u=Function.call.bind(Object.prototype.hasOwnProperty);const l=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=Object.create(null),i={has:(t,r)=>r in e||r in n,get(i,a,s){if(a in n)return n[a];if(!(a in e))return;let h=e[a];if("function"===typeof h)if("function"===typeof t[a])h=c(e,e[a],t[a]);else if(u(r,a)){let t=o(a,r[a]);h=c(e,e[a],t)}else h=h.bind(e);else if("object"===typeof h&&null!==h&&(u(t,a)||u(r,a)))h=l(h,t[a],r[a]);else{if(!u(r,"*"))return Object.defineProperty(n,a,{configurable:!0,enumerable:!0,get:()=>e[a],set(t){e[a]=t}}),h;h=l(h,t[a],r["*"])}return n[a]=h,h},set:(t,r,i,a)=>(r in n?n[r]=i:e[r]=i,!0),defineProperty:(e,t,r)=>Reflect.defineProperty(n,t,r),deleteProperty:(e,t)=>Reflect.deleteProperty(n,t)},a=Object.create(e);return new Proxy(a,i)},h=e=>({addListener(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),a=2;at.hasListener(e.get(r)),removeListener(t,r){t.removeListener(e.get(r))}}),p=new n((e=>"function"!==typeof e?e:function(t){const r=l(t,{},{getContent:{minArgs:0,maxArgs:0}});e(r)})),f=new n((e=>"function"!==typeof e?e:function(t,r,n){let a,s,o=!1,c=new Promise((e=>{a=function(t){o=!0,e(t)}}));try{s=e(t,r,a)}catch(h){s=Promise.reject(h)}const u=!0!==s&&i(s);if(!0!==s&&!u&&!o)return!1;const l=e=>{e.then((e=>{n(e)}),(e=>{let t;t=e&&(e instanceof Error||"string"===typeof e.message)?e.message:"An unexpected error occurred",n({__mozWebExtensionPolyfillReject__:!0,message:t})})).catch((e=>{console.error("Failed to send onMessage rejected reply",e)}))};return l(u?s:c),!0})),d=(r,n)=>{let{reject:i,resolve:a}=r;e.runtime.lastError?e.runtime.lastError.message===t?a():i(new Error(e.runtime.lastError.message)):n&&n.__mozWebExtensionPolyfillReject__?i(new Error(n.message)):a(n)},g=function(e,t,r){for(var n=arguments.length,i=new Array(n>3?n-3:0),a=3;at.maxArgs)throw new Error("Expected at most ".concat(t.maxArgs," ").concat(s(t.maxArgs)," for ").concat(e,"(), got ").concat(i.length));return new Promise(((e,t)=>{const n=d.bind(null,{resolve:e,reject:t});i.push(n),r.sendMessage(...i)}))},m={devtools:{network:{onRequestFinished:h(p)}},runtime:{onMessage:h(f),onMessageExternal:h(f),sendMessage:g.bind(null,"sendMessage",{minArgs:1,maxArgs:3})},tabs:{sendMessage:g.bind(null,"sendMessage",{minArgs:2,maxArgs:3})}},y={clear:{minArgs:1,maxArgs:1},get:{minArgs:1,maxArgs:1},set:{minArgs:1,maxArgs:1}};return r.privacy={network:{"*":y},services:{"*":y},websites:{"*":y}},l(e,m,r)};e.exports=r(chrome)}else e.exports=globalThis.browser},void 0===(i="function"===typeof r?r.apply(t,n):r)||(e.exports=i)}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var a=t[n]={exports:{}};return e[n].call(a.exports,a,a.exports,r),a.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";var e={};r.r(e),r.d(e,{exclude:()=>It,extract:()=>St,parse:()=>Et,parseUrl:()=>Ct,pick:()=>Tt,stringify:()=>_t,stringifyUrl:()=>Pt});var t=r(2465),n=r.n(t);const i="br",a="bn",s="brToDiv",o="bnToDiv",c=["-",i,a,s,o];const u="*",l="-",h=":is(li, p, h1, h2, h3, h4, h5, h6, dd, blockquote, .kiss-p)",p="code, img, svg, pre",f={pattern:"",selector:"",keepSelector:"",terms:"",translator:u,fromLang:u,toLang:u,textStyle:u,transOpen:u,bgColor:"",textDiyStyle:"",selectStyle:"",parentStyle:"",injectJs:"",injectCss:"",transOnly:u,transTiming:u,transTag:u,transTitle:u,detectRemote:u,skipLangs:[],fixerSelector:"",fixerFunc:u,transStartHook:"",transEndHook:"",transRemoveHook:""},d={translator:l,fromLang:l,toLang:l,textStyle:l,transOpen:l,bgColor:"",textDiyStyle:"color: #666;\nbackground: linear-gradient(\n 45deg,\n LightGreen 20%,\n LightPink 20% 40%,\n LightSalmon 40% 60%,\n LightSeaGreen 60% 80%,\n LightSkyBlue 80%\n);\n&:hover {\n color: #333;\n};"},g={"www.google.com/search":{selector:"h3, .IsZvec, .VwiC3b"},"news.google.com":{selector:"[data-n-tid], ".concat(h)},"www.foxnews.com":{selector:'h1, h2, .title, .sidebar [data-type="Title"], .article-content '.concat(h,'; [data-spotim-module="conversation"]>div >>> [data-spot-im-class="message-text"] p, [data-spot-im-class="message-text"]')},"bearblog.dev, www.theverge.com, www.tampermonkey.net/documentation.php":{selector:"".concat(h)},"themessenger.com":{selector:".leading-tight, .leading-tighter, .my-2 p, .font-body p, article ".concat(h)},"www.telegraph.co.uk, go.dev/doc/":{selector:"article ".concat(h)},"www.theguardian.com":{selector:".show-underline, .dcr-hup5wm div, .dcr-7vl6y8 div, .dcr-12evv1c, figcaption, article ".concat(h,', [data-cy="mostviewed-footer"] h4')},"www.semafor.com":{selector:"".concat(h,', .styles_intro__IYj__, [class*="styles_description"]')},"www.noemamag.com":{selector:".splash__title, .single-card__title, .single-card__type, .single-card__topic, .highlighted-content__title, .single-card__author, article ".concat(h,", .quote__text, .wp-caption-text div")},"restofworld.org":{selector:"".concat(h,", .recirc-story__headline, .recirc-story__dek")},"www.axios.com":{selector:".h7, ".concat(h)},"www.newyorker.com":{selector:".summary-item__hed, .summary-item__dek, .summary-collection-grid__dek, .dqtvfu, .rubric__link, .caption, article ".concat(h,", .HEhan ").concat(h,", .ContributorBioBio-fBolsO, .BaseText-ewhhUZ")},"time.com":{selector:"h1, h3, .summary, .video-title, #article-body ".concat(h,", .image-wrap-container .credit.body-caption, .media-heading")},"www.dw.com":{selector:".ts-teaser-title a, .news-title a, .title a, .teaser-description a, .hbudab h3, .hbudab p, figcaption ,article ".concat(h)},"www.bbc.com":{selector:"h1, h2, .media__link, .media__summary, article ".concat(h,", .ssrcss-y7krbn-Stack, .ssrcss-17zglt8-PromoHeadline, .ssrcss-18cjaf3-Headline, .gs-c-promo-heading__title, .gs-c-promo-summary, .media__content h3, .article__intro, .lx-c-summary-points>li")},"www.chinadaily.com.cn":{selector:'h1, .tMain [shape="rect"], .cMain [shape="rect"], .photo_art [shape="rect"], .mai_r [shape="rect"], .lisBox li, #Content '.concat(h)},"www.facebook.com":{selector:'[role="main"] [dir="auto"]'},"www.reddit.com, new.reddit.com, sh.reddit.com":{selector:":is(#AppRouter-main-content, #overlayScrollContainer) :is([class^=tbIA],[class^=_1zP],[class^=ULWj],[class^=_2Jj], [class^=_334],[class^=_2Gr],[class^=_7T4],[class^=_1WO], ".concat(h,'); [id^="post-title"], :is([slot="text-body"], [slot="comment"]) ').concat(h,", recent-posts h3, aside :is(span:has(>h2), p); shreddit-subreddit-header >>> :is(#title, #description)")},"www.quora.com":{selector:".qu-wordBreak--break-word"},"edition.cnn.com":{selector:'.container__title, .container__headline, .headline__text, .image__caption, [data-type="Title"], .article__content '.concat(h)},"www.reuters.com":{selector:'#main-content [data-testid="Heading"], #main-content [data-testid="Body"], .article-body__content__17Yit '.concat(h)},"www.bloomberg.com":{selector:'[data-component="headline"], [data-component="related-item-headline"], [data-component="title"], article '.concat(h)},"deno.land, docs.github.com":{selector:"main ".concat(h),keepSelector:p},"doc.rust-lang.org":{selector:".content ".concat(h),keepSelector:p},"www.indiehackers.com":{selector:"h1, h3, .content ".concat(h,", .feed-item__title-link")},"platform.openai.com/docs":{selector:".docs-body ".concat(h),keepSelector:p},"en.wikipedia.org":{selector:"h1, .mw-parser-output ".concat(h),keepSelector:".mwe-math-element"},"stackoverflow.com, serverfault.com, superuser.com, stackexchange.com, askubuntu.com, stackapps.com, mathoverflow.net":{selector:".s-prose ".concat(h,", .comment-copy, .question-hyperlink, .s-post-summary--content-title, .s-post-summary--content-excerpt"),keepSelector:"".concat(p,", .math-container")},"www.npmjs.com/package, developer.chrome.com/docs, medium.com, react.dev, create-react-app.dev, pytorch.org":{selector:"article ".concat(h)},"news.ycombinator.com":{selector:".title, p",fixerSelector:".toptext, .commtext",fixerFunc:i},"github.com":{selector:".markdown-body ".concat(h,', .repo-description p, .Layout-sidebar .f4, .container-lg .py-4 .f5, .container-lg .my-4 .f5, .Box-row .pr-4, .Box-row article .mt-1, [itemprop="description"], .markdown-title, bdi, .ws-pre-wrap, .status-meta, span.status-meta, .col-10.color-fg-muted, .TimelineItem-body, .pinned-item-list-item-content .color-fg-muted, .markdown-body td, .markdown-body th'),keepSelector:p},"twitter.com":{selector:'[data-testid="tweetText"], [data-testid="birdwatch-pivot"]>div.css-1rynq56',keepSelector:"img, a, .r-18u37iz, .css-175oi2r"},"m.youtube.com":{selector:".slim-video-information-title .yt-core-attributed-string, .media-item-headline .yt-core-attributed-string, .comment-text .yt-core-attributed-string, .typography-body-2b .yt-core-attributed-string, #ytp-caption-window-container .ytp-caption-segment",selectStyle:"-webkit-line-clamp: unset; max-height: none; height: auto;",parentStyle:"-webkit-line-clamp: unset; max-height: none; height: auto;",keepSelector:"img, #content-text>a"},"www.youtube.com":{selector:"h1, #video-title, #content-text, #title, yt-attributed-string>span>span, #ytp-caption-window-container .ytp-caption-segment",selectStyle:"-webkit-line-clamp: unset; max-height: none; height: auto;",parentStyle:"-webkit-line-clamp: unset; max-height: none; height: auto;",keepSelector:"img, #content-text>a"},"bard.google.com":{selector:".query-content ".concat(h,", message-content ").concat(h)},"www.bing.com, copilot.microsoft.com":{selector:".b_algoSlug, .rwrl_padref; .cib-serp-main >>> .ac-textBlock ".concat(h,", .text-message-content div")},"www.phoronix.com":{selector:"article ".concat(h),fixerSelector:".content",fixerFunc:i},"wx2.qq.com":{selector:".js_message_plain"},"app.slack.com/client/":{selector:".p-rich_text_section, .c-message_attachment__text, .p-rich_text_list li"},"discord.com/channels/":{selector:"div[class^=message], div[class^=headerText], div[class^=name_], section[aria-label='Search Results'] div[id^=message-content], div[id^=message]",keepSelector:"li[class^='card'] div[class^='message'], [class^='embedFieldValue'], [data-list-item-id^='forum-channel-list'] div[class^='headerText']"},"t.me/s/":{selector:".js-message_text ".concat(h),fixerSelector:".tgme_widget_message_text",fixerFunc:i},"web.telegram.org/k":{selector:"div.kiss-p",keepSelector:"div[class^=time], .peer-title, .document-wrapper, .message.spoilers-container custom-emoji-element, reactions-element",fixerSelector:".message",fixerFunc:o},"web.telegram.org/a":{selector:".text-content > .kiss-p",keepSelector:".Reactions, .time, .peer-title, .document-wrapper, .message.spoilers-container custom-emoji-element",fixerSelector:".text-content",fixerFunc:s},"www.instagram.com/":{selector:"h1, article span[dir=auto] > span[dir=auto], ._ab1y"},"www.instagram.com/p/,www.instagram.com/reels/":{selector:"h1, div[class='x9f619 xjbqb8w x78zum5 x168nmei x13lgxp2 x5pf9jr xo71vjh x1uhb9sk x1plvlek xryxfnj x1c4vz4f x2lah0s xdt5ytf xqjyukv x1cy8zhl x1oa3qoh x1nhvcw1'] > span[class='x1lliihq x1plvlek xryxfnj x1n2onr6 x193iq5w xeuugli x1fj9vlw x13faqbe x1vvkbs x1s928wv xhkezso x1gmr53x x1cpjm7i x1fgarty x1943h6x x1i0vuye xvs91rp xo1l8bm x5n08af x10wh9bi x1wdrske x8viiok x18hxmgj'], span[class='x193iq5w xeuugli x1fj9vlw x13faqbe x1vvkbs xt0psk2 x1i0vuye xvs91rp xo1l8bm x5n08af x10wh9bi x1wdrske x8viiok x18hxmgj']"},"mail.google.com":{selector:".a3s.aiL ".concat(h,", span[data-thread-id]"),fixerSelector:".a3s.aiL",fixerFunc:i},"web.whatsapp.com":{selector:".copyable-text > span"},"chat.openai.com":{selector:"div[data-message-author-role] > div ".concat(h),fixerSelector:"div[data-message-author-role='user'] > div",fixerFunc:a},"forum.ru-board.com":{selector:".tit, .dats, .kiss-p, .lgf ".concat(h),fixerSelector:"span.post",fixerFunc:i},"education.github.com":{selector:"".concat(h,", a, summary, span.Button-content")},"blogs.windows.com":{selector:"".concat(h,", .c-uhf-nav-link, figcaption"),fixerSelector:".t-content>div>ul>li",fixerFunc:i},"developer.apple.com/documentation/":{selector:"#main ".concat(h,", #main .abstract .content, #main .abstract.content, #main .link span"),keepSelector:p},"greasyfork.org":{selector:"h2, .script-link, .script-description, #additional-info ".concat(h)},"www.fmkorea.com":{selector:"#container ".concat(h)},"forum.arduino.cc":{selector:".top-row>.title, .featured-topic>.title, .link-top-line>.title, .category-description, .topic-excerpt, .fancy-title, .cooked ".concat(h)},"docs.arduino.cc":{selector:'[class^="tutorial-module--left"] '.concat(h)},"www.historydefined.net":{selector:".wp-element-caption, ".concat(h)},"gobyexample.com":{selector:".docs p",keepSelector:"code"},"go.dev/tour":{selector:"#left-side ".concat(h),keepSelector:"code, img, svg >>> code"},"pkg.go.dev":{selector:".Documentation-content ".concat(h),keepSelector:"".concat(p,", a, span")},"docs.rs":{selector:".docblock ".concat(h,", .docblock-short"),keepSelector:"code >>> code"},"randomnerdtutorials.com":{selector:"article ".concat(h)},"notebooks.githubusercontent.com/view/ipynb":{selector:"#notebook-container ".concat(h),keepSelector:p},"developers.cloudflare.com":{selector:"article ".concat(h,", .WorkerStarter--description"),keepSelector:"a[rel='noopener'], code"},"ubuntuforums.org":{fixerSelector:".postcontent",fixerFunc:i},"play.google.com/store/apps/details":{fixerSelector:'[data-g-id="description"]',fixerFunc:i},"news.yahoo.co.jp/articles/":{fixerSelector:".sc-cTsKDU",fixerFunc:a},"chromereleases.googleblog.com":{fixerSelector:".post-content, .post-content > span, li > span",fixerFunc:i}},m=Object.entries(g).sort(((e,t)=>e[0].localeCompare(t[0]))).map((e=>{let[t,r]=e;return{...f,...r,pattern:t}})),y="KISS Translator".trim().split(/\s+/).join("-"),v=y.toLowerCase(),b='["en", "English - English"],\n["zh-CN", "Simplified Chinese - \u7b80\u4f53\u4e2d\u6587"],\n["zh-TW", "Traditional Chinese - \u7e41\u9ad4\u4e2d\u6587"],\n["ar", "Arabic - \u0627\u0644\u0639\u0631\u0628\u064a\u0629"],\n["bg", "Bulgarian - \u0411\u044a\u043b\u0433\u0430\u0440\u0441\u043a\u0438"],\n["ca", "Catalan - Catal\xe0"],\n["hr", "Croatian - Hrvatski"],\n["cs", "Czech - \u010ce\u0161tina"],\n["da", "Danish - Dansk"],\n["nl", "Dutch - Nederlands"],\n["fi", "Finnish - Suomi"],\n["fr", "French - Fran\xe7ais"],\n["de", "German - Deutsch"],\n["el", "Greek - \u0395\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ac"],\n["hi", "Hindi - \u0939\u093f\u0928\u094d\u0926\u0940"],\n["hu", "Hungarian - Magyar"],\n["id", "Indonesian - Indonesia"],\n["it", "Italian - Italiano"],\n["ja", "Japanese - \u65e5\u672c\u8a9e"],\n["ko", "Korean - \ud55c\uad6d\uc5b4"],\n["ms", "Malay - Melayu"],\n["mt", "Maltese - Malti"],\n["nb", "Norwegian - Norsk Bokm\xe5l"],\n["pl", "Polish - Polski"],\n["pt", "Portuguese - Portugu\xeas"],\n["ro", "Romanian - Rom\xe2n\u0103"],\n["ru", "Russian - \u0420\u0443\u0441\u0441\u043a\u0438\u0439"],\n["sk", "Slovak - Sloven\u010dina"],\n["sl", "Slovenian - Sloven\u0161\u010dina"],\n["es", "Spanish - Espa\xf1ol"],\n["sv", "Swedish - Svenska"],\n["ta", "Tamil - \u0ba4\u0bae\u0bbf\u0bb4\u0bcd"],\n["te", "Telugu - \u0c24\u0c46\u0c32\u0c41\u0c17\u0c41"],\n["th", "Thai - \u0e44\u0e17\u0e22"],\n["tr", "Turkish - T\xfcrk\xe7e"],\n["uk", "Ukrainian - \u0423\u043a\u0440\u0430\u0457\u043d\u0441\u044c\u043a\u0430"],\n["vi", "Vietnamese - Ti\u1ebfng Vi\u1ec7t"],\n',x='// URL\nhttps://translate.googleapis.com/translate_a/single?client=gtx&dj=1&dt=t&ie=UTF-8&q={{text}}&sl=en&tl=zh-CN\n\n// Request Hook\n(text, from, to, url, key) => [url, {\n headers: {\n "Content-type": "application/json",\n },\n method: "GET",\n body: null,\n}]\n\n// Response Hook\n(res, text, from, to) => [res.sentences.map((item) => item.trans).join(" "), to === res.src]',w=('// \u8bf7\u6c42\u6570\u636e\u9ed8\u8ba4\u683c\u5f0f\n{\n "url": "{{url}}",\n "method": "POST",\n "headers": {\n "Content-type": "application/json",\n "Authorization": "Bearer {{key}}"\n },\n "body": {\n "text": "{{text}}", // \u5f85\u7ffb\u8bd1\u6587\u5b57\n "from": "{{from}}", // \u6587\u5b57\u7684\u8bed\u8a00\uff08\u53ef\u80fd\u4e3a\u7a7a\uff09\n "to": "{{to}}", // \u76ee\u6807\u8bed\u8a00\n },\n}\n\n\n// \u8fd4\u56de\u6570\u636e\u9ed8\u8ba4\u683c\u5f0f\n{\n text: "", // \u7ffb\u8bd1\u540e\u7684\u6587\u5b57\n from: "", // \u8bc6\u522b\u7684\u6e90\u8bed\u8a00\n to: "", // \u76ee\u6807\u8bed\u8a00\uff08\u53ef\u9009\uff09\n}\n\n\n// Hook \u8303\u4f8b\n'.concat(x,"\n\n\n// \u652f\u6301\u7684\u8bed\u8a00\u4ee3\u7801\u5982\u4e0b\n").concat(b,"\n"),'// Default request\n{\n "url": "{{url}}",\n "method": "POST",\n "headers": {\n "Content-type": "application/json",\n "Authorization": "Bearer {{key}}"\n },\n "body": {\n "text": "{{text}}", // Text to be translated\n "from": "{{from}}", // The language of the text (may be empty)\n "to": "{{to}}", // Target language\n },\n}\n\n\n// Default response\n{\n text: "", // translated text\n from: "", // Recognized source language\n to: "", // Target language (optional)\n}\n\n\n/// Hook Example\n'.concat(x,"\n\n\n// The supported language codes are as follows\n").concat(b,"\n"),"\u8bf7 [\u70b9\u51fb\u8fd9\u91cc](".concat("https://github.com/fishjar/kiss-translator",") \u67e5\u770b\u8be6\u60c5\u3002"),"Please [click here](".concat("https://github.com/fishjar/kiss-translator",") for details."),"".concat(y,"_msauth")),A=("".concat(y,"_bdauth"),"".concat(y,"_setting")),k="".concat(y,"_rules"),S="".concat(y,"_words"),E="".concat(y,"_sync"),_=("".concat(y,"_fab"),"".concat(y,"_rulescache_")),C="toggleTranslate",P="toggleStyle",T="openOptions",I="openTranbox",O=["chrome","edge","firefox"],N="".concat(y,"_cache"),j="fetch",R="get_httpcache",L="trans_toggle",V="trans_toggle_style",D="open_tranbox",M=("https://".concat(v,"/translate"),"https://translate.googleapis.com/translate_a/single"),F="https://transmart.qq.com/api/imt",B="Google",U="Microsoft",q="DeepL",z="DeepLX",W="DeepLFree",H="NiuTrans",G="Baidu",K="Tencent",$="OpenAI",J="OpenAI2",Z="OpenAI3",X="Gemini",Q="CloudflareAI",Y="Ollama",ee="Ollama2",te="Ollama3",re="Custom",ne="Custom2",ie="Custom3",ae="Custom4",se="Custom5",oe=[B,U,G,K,q,W,z,H,$,J,Z,X,Q,Y,ee,te,re,ne,ie,ae,se],ce=[["en","English - English"],["zh-CN","Simplified Chinese - \u7b80\u4f53\u4e2d\u6587"],["zh-TW","Traditional Chinese - \u7e41\u9ad4\u4e2d\u6587"],["ar","Arabic - \u0627\u0644\u0639\u0631\u0628\u064a\u0629"],["bg","Bulgarian - \u0411\u044a\u043b\u0433\u0430\u0440\u0441\u043a\u0438"],["ca","Catalan - Catal\xe0"],["hr","Croatian - Hrvatski"],["cs","Czech - \u010ce\u0161tina"],["da","Danish - Dansk"],["nl","Dutch - Nederlands"],["fi","Finnish - Suomi"],["fr","French - Fran\xe7ais"],["de","German - Deutsch"],["el","Greek - \u0395\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ac"],["hi","Hindi - \u0939\u093f\u0928\u094d\u0926\u0940"],["hu","Hungarian - Magyar"],["id","Indonesian - Indonesia"],["it","Italian - Italiano"],["ja","Japanese - \u65e5\u672c\u8a9e"],["ko","Korean - \ud55c\uad6d\uc5b4"],["ms","Malay - Melayu"],["mt","Maltese - Malti"],["nb","Norwegian - Norsk Bokm\xe5l"],["pl","Polish - Polski"],["pt","Portuguese - Portugu\xeas"],["ro","Romanian - Rom\xe2n\u0103"],["ru","Russian - \u0420\u0443\u0441\u0441\u043a\u0438\u0439"],["sk","Slovak - Sloven\u010dina"],["sl","Slovenian - Sloven\u0161\u010dina"],["es","Spanish - Espa\xf1ol"],["sv","Swedish - Svenska"],["ta","Tamil - \u0ba4\u0bae\u0bbf\u0bb4\u0bcd"],["te","Telugu - \u0c24\u0c46\u0c32\u0c41\u0c17\u0c41"],["th","Thai - \u0e44\u0e17\u0e22"],["tr","Turkish - T\xfcrk\xe7e"],["uk","Ukrainian - \u0423\u043a\u0440\u0430\u0457\u043d\u0441\u044c\u043a\u0430"],["vi","Vietnamese - Ti\u1ebfng Vi\u1ec7t"]],ue=[["auto","Auto-detect"],...ce],le={[B]:new Map(ue.map((e=>{let[t]=e;return[t,t]}))),[U]:new Map([...ue.map((e=>{let[t]=e;return[t,t]})),["auto",""],["zh-CN","zh-Hans"],["zh-TW","zh-Hant"]]),[q]:new Map([...ue.map((e=>{let[t]=e;return[t,t.toUpperCase()]})),["auto",""],["zh-CN","ZH"],["zh-TW","ZH"]]),[W]:new Map([...ue.map((e=>{let[t]=e;return[t,t.toUpperCase()]})),["auto","auto"],["zh-CN","ZH"],["zh-TW","ZH"]]),[z]:new Map([...ue.map((e=>{let[t]=e;return[t,t.toUpperCase()]})),["auto","auto"],["zh-CN","ZH"],["zh-TW","ZH"]]),[H]:new Map([...ue.map((e=>{let[t]=e;return[t,t]})),["auto","auto"],["zh-CN","zh"],["zh-TW","cht"]]),[G]:new Map([...ue.map((e=>{let[t]=e;return[t,t]})),["zh-CN","zh"],["zh-TW","cht"],["ar","ara"],["bg","bul"],["ca","cat"],["hr","hrv"],["da","dan"],["fi","fin"],["fr","fra"],["hi","mai"],["ja","jp"],["ko","kor"],["ms","may"],["mt","mlt"],["nb","nor"],["ro","rom"],["ru","ru"],["sl","slo"],["es","spa"],["sv","swe"],["ta","tam"],["te","tel"],["uk","ukr"],["vi","vie"]]),[K]:new Map([["auto","auto"],["zh-CN","zh"],["zh-TW","zh"],["en","en"],["ar","ar"],["de","de"],["ru","ru"],["fr","fr"],["fi","fil"],["ko","ko"],["ms","ms"],["pt","pt"],["ja","ja"],["th","th"],["tr","tr"],["es","es"],["it","it"],["hi","hi"],["id","id"],["vi","vi"]]),[$]:new Map(ue.map((e=>{let[t,r]=e;return[t,r.split(" - ")[0]]}))),[J]:new Map(ue.map((e=>{let[t,r]=e;return[t,r.split(" - ")[0]]}))),[Z]:new Map(ue.map((e=>{let[t,r]=e;return[t,r.split(" - ")[0]]}))),[X]:new Map(ue.map((e=>{let[t,r]=e;return[t,r.split(" - ")[0]]}))),[Y]:new Map(ue.map((e=>{let[t,r]=e;return[t,r.split(" - ")[0]]}))),[ee]:new Map(ue.map((e=>{let[t,r]=e;return[t,r.split(" - ")[0]]}))),[te]:new Map(ue.map((e=>{let[t,r]=e;return[t,r.split(" - ")[0]]}))),[Q]:new Map([["auto",""],["zh-CN","chinese"],["zh-TW","chinese"],["en","english"],["ar","arabic"],["de","german"],["ru","russian"],["fr","french"],["pt","portuguese"],["ja","japanese"],["es","spanish"],["hi","hindi"]]),[re]:new Map([...ue.map((e=>{let[t]=e;return[t,t]})),["auto",""]]),[ne]:new Map([...ue.map((e=>{let[t]=e;return[t,t]})),["auto",""]]),[ie]:new Map([...ue.map((e=>{let[t]=e;return[t,t]})),["auto",""]]),[ae]:new Map([...ue.map((e=>{let[t]=e;return[t,t]})),["auto",""]]),[se]:new Map([...ue.map((e=>{let[t]=e;return[t,t]})),["auto",""]])},he=(ce.map((e=>{let[t]=e;return t})),new Map(Array.from(le[U].entries()).map((e=>{let[t,r]=e;return[r,t]}))),new Map(Array.from(le[G].entries()).map((e=>{let[t,r]=e;return[r,t]}))),new Map(Array.from(le[K].entries()).map((e=>{let[t,r]=e;return[r,t]}))));he.set("zh","zh-CN");const pe="under_line",fe="dot_line",de="dash_line",ge="wavy_line",me="highlight",ye="blockquote",ve=["style_none",pe,fe,de,ge,"fuzzy",me,ye,"diy_style"],be="mk_pagescroll",xe=[be,"mk_pageopen","mk_mouseover","mk_ctrlKey","mk_shiftKey","mk_altKey"],we=10,Ae=100,ke="{{from}}",Se="{{to}}",Ee="{{text}}",_e="{{key}}",Ce="{{model}}",Pe="-webkit-line-clamp: unset; max-height: none; height: auto;",Te={pattern:"*",selector:h,keepSelector:p,terms:"",translator:U,fromLang:"auto",toLang:"zh-CN",textStyle:de,transOpen:"false",bgColor:"",textDiyStyle:"",selectStyle:Pe,parentStyle:Pe,injectJs:"",injectCss:"",transOnly:"false",transTiming:be,transTag:"span",transTitle:"false",detectRemote:"false",skipLangs:[],fixerSelector:"",fixerFunc:"-",transStartHook:"",transEndHook:"",transRemoveHook:""},Ie={transOpen:!0,translator:U,fromLang:"auto",toLang:"en",triggerShortcut:["AltLeft","KeyI"],triggerCount:1,triggerTime:200,transSign:"/"},Oe="click",Ne={transOpen:!0,translator:U,fromLang:"auto",toLang:"zh-CN",toLang2:"en",tranboxShortcut:["AltLeft","KeyS"],btnOffsetX:10,btnOffsetY:10,boxOffsetX:0,boxOffsetY:10,hideTranBtn:!1,hideClickAway:!1,simpleStyle:!1,followSelection:!1,triggerMode:Oe,extStyles:"",enDict:"Baidu"},je={url:"",key:"",customOption:"",reqHook:"",resHook:"",fetchLimit:we,fetchInterval:Ae},Re={url:"https://api.openai.com/v1/chat/completions",key:"",model:"gpt-4",prompt:"You will be provided with a sentence in ".concat(ke,", and your task is to translate it into ").concat(Se,"."),temperature:0,maxTokens:256,fetchLimit:1,fetchInterval:500},Le={url:"http://localhost:11434/api/generate",key:"",model:"llama3",prompt:"Translate the following text from ".concat(ke," to ").concat(Se,":\n\n").concat(Ee),fetchLimit:1,fetchInterval:500},Ve={[B]:{url:M,key:"",fetchLimit:we,fetchInterval:Ae},[U]:{fetchLimit:we,fetchInterval:Ae},[G]:{fetchLimit:we,fetchInterval:Ae},[K]:{fetchLimit:we,fetchInterval:Ae},[q]:{url:"https://api-free.deepl.com/v2/translate",key:"",fetchLimit:1,fetchInterval:500},[W]:{fetchLimit:1,fetchInterval:500},[z]:{url:"http://localhost:1188/translate",key:"",fetchLimit:1,fetchInterval:500},[H]:{url:"https://api.niutrans.com/NiuTransServer/translation",key:"",dictNo:"",memoryNo:"",fetchLimit:we,fetchInterval:Ae},[$]:Re,[J]:Re,[Z]:Re,[X]:{url:"https://generativelanguage.googleapis.com/v1/models/".concat(Ce,":generateContent?key=").concat(_e),key:"",model:"gemini-pro",prompt:"Translate the following text from ".concat(ke," to ").concat(Se,":\n\n").concat(Ee),fetchLimit:1,fetchInterval:500},[Q]:{url:"https://api.cloudflare.com/client/v4/accounts/{{ACCOUNT_ID}}/ai/run/@cf/meta/m2m100-1.2b",key:"",fetchLimit:1,fetchInterval:500},[Y]:Le,[ee]:Le,[te]:Le,[re]:je,[ne]:je,[ie]:je,[ae]:je,[se]:je},De=["https://github.com"],Me={darkMode:!1,uiLang:"en",minLength:5,maxLength:5e3,newlineLength:20,clearCache:!1,injectRules:!0,contextMenuType:1,subrulesList:[{url:"https://fishjar.github.io/kiss-rules/kiss-rules.json",selected:!1},{url:"https://fishjar.github.io/kiss-rules/kiss-rules-on.json",selected:!0},{url:"https://fishjar.github.io/kiss-rules/kiss-rules-off.json",selected:!1}],owSubrule:d,transApis:Ve,shortcuts:{toggleTranslate:["AltLeft","KeyQ"],toggleStyle:["AltLeft","KeyC"],togglePopup:["AltLeft","KeyK"],openSetting:["AltLeft","KeyO"]},inputRule:Ie,tranboxSetting:Ne,touchTranslate:2,blacklist:["https://fishjar.github.io/kiss-translator/options.html","https://translate.google.com","https://www.deepl.com/translator","oapi.dingtalk.com","login.dingtalk.com"].join(",\n"),csplist:De.join(",\n"),transInterval:500,langDetector:U},Fe=[Te],Be="KISS-Worker",Ue="WebDAV",qe={syncType:Be,syncUrl:"",syncUser:"",syncKey:"",syncMeta:{},subRulesSyncAt:0,dataCaches:{}},ze="chrome",We=O.includes(ze),He=!1;const Ge=function(){try{return r(2465)}catch(e){}}(),Ke=()=>"BACKGROUND"===(null===globalThis||void 0===globalThis?void 0:globalThis.ContextType),$e=(e,t)=>{let r="[KISS-Translator]";t&&(r+="[".concat(t,"]")),console.log("".concat(r," ").concat(e))};async function Je(e,t){We?await Ge.storage.local.set({[e]:t}):He?await(window.KISS_GM||GM).setValue(e,t):window.localStorage.setItem(e,t)}async function Ze(e){if(We){return(await Ge.storage.local.get([e]))[e]}if(He){return await(window.KISS_GM||GM).getValue(e)}return window.localStorage.getItem(e)}async function Xe(e,t){await Je(e,JSON.stringify(t))}async function Qe(e,t){await Ze(e)||await Xe(e,t)}async function Ye(e){const t=await Ze(e);return t&&JSON.parse(t)}async function et(e,t){var r;const n=null!==(r=await Ye(e))&&void 0!==r?r:{};await Xe(e,{...n,...t})}const tt=async()=>({...Me,...await Ye(A)||{}}),rt=async()=>await Ye(k)||Fe,nt=e=>Xe(k,e),it=async()=>await Ye(S)||{},at=async()=>await Ye(E)||qe,st=e=>et(E,e),ot="%[a-f0-9]{2}",ct=new RegExp("("+ot+")|([^%]+?)","gi"),ut=new RegExp("("+ot+")+","gi");function lt(e,t){try{return[decodeURIComponent(e.join(""))]}catch{}if(1===e.length)return e;t=t||1;const r=e.slice(0,t),n=e.slice(t);return Array.prototype.concat.call([],lt(r),lt(n))}function ht(e){try{return decodeURIComponent(e)}catch{let t=e.match(ct)||[];for(let r=1;rnull===e||void 0===e,mt=e=>encodeURIComponent(e).replace(/[!'()*]/g,(e=>"%".concat(e.charCodeAt(0).toString(16).toUpperCase()))),yt=Symbol("encodeFragmentIdentifier");function vt(e){if("string"!==typeof e||1!==e.length)throw new TypeError("arrayFormatSeparator must be single character string")}function bt(e,t){return t.encode?t.strict?mt(e):encodeURIComponent(e):e}function xt(e,t){return t.decode?pt(e):e}function wt(e){return Array.isArray(e)?e.sort():"object"===typeof e?wt(Object.keys(e)).sort(((e,t)=>Number(e)-Number(t))).map((t=>e[t])):e}function At(e){const t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function kt(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"===typeof e&&""!==e.trim()?e=Number(e):!t.parseBooleans||null===e||"true"!==e.toLowerCase()&&"false"!==e.toLowerCase()||(e="true"===e.toLowerCase()),e}function St(e){const t=(e=At(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function Et(e,t){vt((t={decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,...t}).arrayFormatSeparator);const r=function(e){let t;switch(e.arrayFormat){case"index":return(e,r,n)=>{t=/\[(\d*)]$/.exec(e),e=e.replace(/\[\d*]$/,""),t?(void 0===n[e]&&(n[e]={}),n[e][t[1]]=r):n[e]=r};case"bracket":return(e,r,n)=>{t=/(\[])$/.exec(e),e=e.replace(/\[]$/,""),t?void 0!==n[e]?n[e]=[...n[e],r]:n[e]=[r]:n[e]=r};case"colon-list-separator":return(e,r,n)=>{t=/(:list)$/.exec(e),e=e.replace(/:list$/,""),t?void 0!==n[e]?n[e]=[...n[e],r]:n[e]=[r]:n[e]=r};case"comma":case"separator":return(t,r,n)=>{const i="string"===typeof r&&r.includes(e.arrayFormatSeparator),a="string"===typeof r&&!i&&xt(r,e).includes(e.arrayFormatSeparator);r=a?xt(r,e):r;const s=i||a?r.split(e.arrayFormatSeparator).map((t=>xt(t,e))):null===r?r:xt(r,e);n[t]=s};case"bracket-separator":return(t,r,n)=>{const i=/(\[])$/.test(t);if(t=t.replace(/\[]$/,""),!i)return void(n[t]=r?xt(r,e):r);const a=null===r?[]:r.split(e.arrayFormatSeparator).map((t=>xt(t,e)));void 0!==n[t]?n[t]=[...n[t],...a]:n[t]=a};default:return(e,t,r)=>{void 0!==r[e]?r[e]=[...[r[e]].flat(),t]:r[e]=t}}}(t),n=Object.create(null);if("string"!==typeof e)return n;if(!(e=e.trim().replace(/^[?#&]/,"")))return n;for(const i of e.split("&")){if(""===i)continue;const e=t.decode?i.replace(/\+/g," "):i;let[a,s]=ft(e,"=");void 0===a&&(a=e),s=void 0===s?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?s:xt(s,t),r(xt(a,t),s,n)}for(const[i,a]of Object.entries(n))if("object"===typeof a&&null!==a)for(const[e,r]of Object.entries(a))a[e]=kt(r,t);else n[i]=kt(a,t);return!1===t.sort?n:(!0===t.sort?Object.keys(n).sort():Object.keys(n).sort(t.sort)).reduce(((e,t)=>{const r=n[t];return Boolean(r)&&"object"===typeof r&&!Array.isArray(r)?e[t]=wt(r):e[t]=r,e}),Object.create(null))}function _t(e,t){if(!e)return"";vt((t={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...t}).arrayFormatSeparator);const r=r=>t.skipNull&>(e[r])||t.skipEmptyString&&""===e[r],n=function(e){switch(e.arrayFormat){case"index":return t=>(r,n)=>{const i=r.length;return void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[bt(t,e),"[",i,"]"].join("")]:[...r,[bt(t,e),"[",bt(i,e),"]=",bt(n,e)].join("")]};case"bracket":return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[bt(t,e),"[]"].join("")]:[...r,[bt(t,e),"[]=",bt(n,e)].join("")];case"colon-list-separator":return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[bt(t,e),":list="].join("")]:[...r,[bt(t,e),":list=",bt(n,e)].join("")];case"comma":case"separator":case"bracket-separator":{const t="bracket-separator"===e.arrayFormat?"[]=":"=";return r=>(n,i)=>void 0===i||e.skipNull&&null===i||e.skipEmptyString&&""===i?n:(i=null===i?"":i,0===n.length?[[bt(r,e),t,bt(i,e)].join("")]:[[n,bt(i,e)].join(e.arrayFormatSeparator)])}default:return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,bt(t,e)]:[...r,[bt(t,e),"=",bt(n,e)].join("")]}}(t),i={};for(const[s,o]of Object.entries(e))r(s)||(i[s]=o);const a=Object.keys(i);return!1!==t.sort&&a.sort(t.sort),a.map((r=>{const i=e[r];return void 0===i?"":null===i?bt(r,t):Array.isArray(i)?0===i.length&&"bracket-separator"===t.arrayFormat?bt(r,t)+"[]":i.reduce(n(r),[]).join("&"):bt(r,t)+"="+bt(i,t)})).filter((e=>e.length>0)).join("&")}function Ct(e,t){var r,n;t={decode:!0,...t};let[i,a]=ft(e,"#");return void 0===i&&(i=e),{url:null!==(r=null===(n=i)||void 0===n||null===(n=n.split("?"))||void 0===n?void 0:n[0])&&void 0!==r?r:"",query:Et(St(e),t),...t&&t.parseFragmentIdentifier&&a?{fragmentIdentifier:xt(a,t)}:{}}}function Pt(e,t){t={encode:!0,strict:!0,[yt]:!0,...t};const r=At(e.url).split("?")[0]||"";let n=_t({...Et(St(e.url),{sort:!1}),...e.query},t);n&&(n="?".concat(n));let i=function(e){let t="";const r=e.indexOf("#");return-1!==r&&(t=e.slice(r)),t}(e.url);if(e.fragmentIdentifier){const n=new URL(r);n.hash=e.fragmentIdentifier,i=t[yt]?n.hash:"#".concat(e.fragmentIdentifier)}return"".concat(r).concat(n).concat(i)}function Tt(e,t,r){r={parseFragmentIdentifier:!0,[yt]:!1,...r};const{url:n,query:i,fragmentIdentifier:a}=Ct(e,r);return Pt({url:n,query:dt(i,t),fragmentIdentifier:a},r)}function It(e,t,r){return Tt(e,Array.isArray(t)?e=>!t.includes(e):(e,r)=>!t(e,r),r)}const Ot=e,Nt=async()=>(await(async()=>{const[e]=await Ge.tabs.query({active:!0,lastFocusedWindow:!0});return e})()).id,jt=(e,t)=>Ge.runtime.sendMessage({action:e,args:t}),Rt=async(e,t)=>{const r=await Nt();return Ge.tabs.sendMessage(r,{action:e,args:t})},Lt=(()=>{let{token:e,exp:t}={};return async()=>{const r=Date.now();if(e&&1e3*t>r+1e3)return[e,t];const n=await Ye(w);return e=null===n||void 0===n?void 0:n.token,t=null===n||void 0===n?void 0:n.exp,e&&1e3*t>r+1e3||(e=await Xt({input:"https://edge.microsoft.com/translate/auth"}),t=(e=>{try{return JSON.parse(atob(e.split(".")[1])).exp}catch(t){$e(t,"parseMSToken")}return 0})(e),await(e=>Xe(w,e))({token:e,exp:t})),[e,t]}})();let Vt=1e4*Math.round(1e4*Math.random());var Dt=r(5021);const Mt=new(r.n(Dt)())({ecmaVer:"latest",sourceType:"script",sandBox:!0}),Ft=new Map,Bt=new Map,Ut=function(e){var t;let r=arguments.length>2?arguments[2]:void 0;const n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"").split(/\n|,/).map((e=>e.trim())).filter(Boolean);if(0===n.length)return"";const i=((null!==(t=r.get(e))&&void 0!==t?t:-1)+1)%n.length;return r.set(e,i),n[i]},qt=(e,t)=>{let{translator:r,text:n,from:i,to:a}=e;const s={text:n,from:i,to:a,...t};switch(r){case q:case $:case J:case Z:case X:case Q:case Y:case ee:case te:case H:s.key=Ut(r,s.key,Ft);break;case z:s.url=Ut(r,s.url,Bt)}switch(r){case B:return(e=>{let{text:t,from:r,to:n,url:i,key:a}=e;const s={client:"gtx",dt:"t",dj:1,ie:"UTF-8",sl:r,tl:n,q:t},o="".concat(i,"?").concat(Ot.stringify(s)),c={headers:{"Content-type":"application/json"}};return a&&(c.headers.Authorization="Bearer ".concat(a)),[o,c]})(s);case U:return(async e=>{let{text:t,from:r,to:n}=e;const[i]=await Lt(),a={from:r,to:n,"api-version":"3.0"};return["".concat("https://api-edge.cognitive.microsofttranslator.com/translate","?").concat(Ot.stringify(a)),{headers:{"Content-type":"application/json",Authorization:"Bearer ".concat(i)},method:"POST",body:JSON.stringify([{Text:t}])}]})(s);case q:return(e=>{let{text:t,from:r,to:n,url:i,key:a}=e;const s={text:[t],target_lang:n,source_lang:r};return[i,{headers:{"Content-type":"application/json",Authorization:"DeepL-Auth-Key ".concat(a)},method:"POST",body:JSON.stringify(s)}]})(s);case W:return(e=>{let{text:t,from:r,to:n}=e;const i=(t.match(/[i]/g)||[]).length+1;let a=Date.now();a+=i-a%i,Vt++;let s=JSON.stringify({jsonrpc:"2.0",method:"LMT_handle_texts",params:{splitting:"newlines",lang:{target_lang:n,source_lang_user_selected:r},commonJobParams:{wasSpoken:!1,transcribe_as:""},id:Vt,timestamp:a,texts:[{text:t,requestAlternatives:3}]}});return s=s.replace('method":"',(Vt+3)%13===0||(Vt+5)%29===0?'method" : "':'method": "'),["https://www2.deepl.com/jsonrpc",{headers:{"Content-Type":"application/json",Accept:"*/*","x-app-os-name":"iOS","x-app-os-version":"16.3.0","Accept-Language":"en-US,en;q=0.9","Accept-Encoding":"gzip, deflate, br","x-app-device":"iPhone13,2","User-Agent":"DeepL-iOS/2.9.1 iOS 16.3.0 (iPhone13,2)","x-app-build":"510265","x-app-version":"2.9.1"},method:"POST",body:s}]})(s);case z:return(e=>{let{text:t,from:r,to:n,url:i,key:a}=e;const s={text:t,target_lang:n,source_lang:r},o={headers:{"Content-type":"application/json"},method:"POST",body:JSON.stringify(s)};return a&&(o.headers.Authorization="Bearer ".concat(a)),[i,o]})(s);case H:return(e=>{let{text:t,from:r,to:n,url:i,key:a,dictNo:s,memoryNo:o}=e;const c={from:r,to:n,apikey:a,src_text:t,dictNo:s,memoryNo:o};return[i,{headers:{"Content-type":"application/json"},method:"POST",body:JSON.stringify(c)}]})(s);case G:return(async e=>{let{text:t,from:r,to:n}=e;const i={from:r,to:n,query:t,source:"txt"};return["https://fanyi.baidu.com/transapi",{headers:{"content-type":"application/x-www-form-urlencoded; charset=UTF-8","User-Agent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36"},method:"POST",body:Ot.stringify(i)}]})(s);case K:return(e=>{let{text:t,from:r,to:n}=e;const i={header:{fn:"auto_translation_block"},source:{text_block:t,lang:r},target:{lang:n}},a={headers:{"Content-Type":"application/json"},method:"POST",body:JSON.stringify(i)};return[F,a]})(s);case $:case J:case Z:return(e=>{let{text:t,from:r,to:n,url:i,key:a,prompt:s,model:o,temperature:c,maxTokens:u}=e;s=s.replaceAll(ke,r).replaceAll(Se,n);const l={model:o,messages:[{role:"system",content:s},{role:"user",content:t}],temperature:c,max_tokens:u};return[i,{headers:{"Content-type":"application/json",Authorization:"Bearer ".concat(a),"api-key":a},method:"POST",body:JSON.stringify(l)}]})(s);case X:return(e=>{let{text:t,from:r,to:n,url:i,key:a,prompt:s,model:o}=e;i=i.replaceAll(Ce,o).replaceAll(_e,a),s=s.replaceAll(ke,r).replaceAll(Se,n).replaceAll(Ee,t);const c={contents:[{parts:[{text:s}]}]};return[i,{headers:{"Content-type":"application/json"},method:"POST",body:JSON.stringify(c)}]})(s);case Q:return(e=>{let{text:t,from:r,to:n,url:i,key:a}=e;const s={text:t,source_lang:r,target_lang:n};return[i,{headers:{"Content-type":"application/json",Authorization:"Bearer ".concat(a)},method:"POST",body:JSON.stringify(s)}]})(s);case Y:case ee:case te:return(e=>{let{text:t,from:r,to:n,url:i,key:a,prompt:s,model:o}=e;s=s.replaceAll(ke,r).replaceAll(Se,n).replaceAll(Ee,t);const c={model:o,prompt:s,stream:!1},u={headers:{"Content-type":"application/json"},method:"POST",body:JSON.stringify(c)};return a&&(u.headers.Authorization="Bearer ".concat(a)),[i,u]})(s);case re:case ne:case ie:case ae:case se:return(e=>{let{text:t,from:r,to:n,url:i,key:a,reqHook:s}=e;i=i.replaceAll("{{url}}",i).replaceAll(ke,r).replaceAll(Se,n).replaceAll(Ee,t).replaceAll(_e,a);let o={};if(null!==s&&void 0!==s&&s.trim())return Mt.run("exports.reqHook = ".concat(s)),[i,o]=Mt.exports.reqHook(t,r,n,i,a),[i,o];const c={text:t,from:r,to:n};return o={headers:{"Content-type":"application/json"},method:"POST",body:JSON.stringify(c)},a&&(o.headers.Authorization="Bearer ".concat(a)),[i,o]})(s);default:throw new Error("[trans] translator: ".concat(r," not support"))}},zt=(e,t)=>0===e.length||e.includes(t)?t:e[0],Wt=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;for(;rObject.prototype.toString.call(e).match(/\[object (.*?)\]/)[1].toLowerCase(),Gt=async(e,t)=>{const r=(new TextEncoder).encode(e+t),n=await crypto.subtle.digest({name:"SHA-256"},r);return[...new Uint8Array(n)].map((e=>e.toString(16).padStart(2,"0"))).join("")},Kt=async(e,t)=>{let r=new Request(e,t);if("GET"!==r.method){const e=await r.text(),t=new URL(r.url);t.pathname+=e,r=new Request(t.toString(),{method:"GET"})}return r},$t=async(e,t,r,n)=>{var i;if(null!==r&&void 0!==r&&r.translator&&([e,t]=await qt(r,n)),!e)throw new Error("url is empty");if(He){var a,s,o,c;let r;r=window.KISS_GM?await window.KISS_GM.getInfo():GM.info;const n=(null===(a=r)||void 0===a||null===(s=a.script)||void 0===s?void 0:s.connects)||(null===(o=r)||void 0===o||null===(c=o.script)||void 0===c?void 0:c.connect)||[],i=new URL(e);if(n.find((e=>i.hostname.endsWith(e)))){const{body:r,headers:n,status:i,statusText:a}=window.KISS_GM?await window.KISS_GM.fetch(e,t):await async function(e){let{method:t="GET",headers:r,body:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(((i,a)=>{GM.xmlHttpRequest({method:t,url:e,headers:r,data:n,timeout:5e3,onload:e=>{let{response:t,responseHeaders:r,status:n,statusText:a}=e;const s={};r.split("\n").forEach((e=>{const[t,r]=e.split(":").map((e=>e.trim()));t&&r&&(s[t]=r)})),i({body:t,headers:s,status:n,statusText:a})},onerror:a})}))}(e,t);return new Response(r,{headers:new Headers(n),status:i,statusText:a})}}return null!==(i=AbortSignal)&&void 0!==i&&i.timeout&&Object.assign(t,{signal:AbortSignal.timeout(5e3)}),fetch(e,t)},Jt=async e=>{if(!e)return null;const t=e.headers.get("Content-Type");if(null!==t&&void 0!==t&&t.includes("json"))return await e.json();if(null!==t&&void 0!==t&&t.includes("audio")){const t=await e.blob();return await(e=>new Promise((t=>{const r=new FileReader;r.onloadend=()=>t(r.result),r.readAsDataURL(e)})))(t)}return await e.text()},Zt=async(e,t)=>{let{method:r,headers:n,body:i}=t;try{const t=await Kt(e,{method:r,headers:n,body:i}),a=await caches.open(N),s=await a.match(t);return Jt(s)}catch(a){$e(a,"get cache")}return null},Xt=async e=>{let{input:t,useCache:r,transOpts:n,apiSetting:i,...a}=e;const s=await $t(t,a,n,i);if(!s)throw new Error("Unknow error");if(!s.ok){var o;const e={url:s.url,status:s.status};throw null!==(o=s.headers.get("Content-Type"))&&void 0!==o&&o.includes("json")&&(e.response=await s.json()),new Error(JSON.stringify(e))}return r&&await(async(e,t,r)=>{let{method:n,headers:i,body:a}=t;try{const t=await Kt(e,{method:n,headers:i,body:a}),s=await caches.open(N);await s.put(t,r)}catch(s){$e(s,"put cache")}})(t,a,s.clone()),Jt(s)},Qt=e=>We&&!Ke()?jt(j,e):Xt(e),Yt=function(e,t){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1e3;const n=[];let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:100,a=0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:100,o=null;const c=async()=>{if(o&&clearTimeout(o),o=setTimeout(c,s),a{clearTimeout(e),n.push({args:s,resolve:o,reject:c,retry:l+1})}),r)}else c(u)}finally{a--}}}};return{push:async e=>(o||c(),new Promise(((t,r)=>{n.push({args:e,resolve:t,reject:r,retry:0})}))),update:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;e>=0&&e<=5e3&&e!==s&&(s=e),t>=1&&t<=100&&t!==i&&(i=t)},clear:()=>{n.length=0,a=0,o&&clearTimeout(o),o=null}}}(Qt,null,Ae,we),er=async function(e){let{useCache:t,usePool:r,...n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===e||void 0===e||!e.trim())throw new Error("URL is empty");if(t){const t=await((e,t)=>We&&!Ke()?jt(R,{input:e,init:t}):Zt(e,t))(e,n);if(t)return t}return r?Yt.push({input:e,useCache:t,...n}):Qt({input:e,useCache:t,...n})};var tr={584:e=>{function t(e,t,i){e instanceof RegExp&&(e=r(e,i)),t instanceof RegExp&&(t=r(t,i));var a=n(e,t,i);return a&&{start:a[0],end:a[1],pre:i.slice(0,a[0]),body:i.slice(a[0]+e.length,a[1]),post:i.slice(a[1]+t.length)}}function r(e,t){var r=t.match(e);return r?r[0]:null}function n(e,t,r){var n,i,a,s,o,c=r.indexOf(e),u=r.indexOf(t,c+1),l=c;if(c>=0&&u>0){for(n=[],a=r.length;l>=0&&!o;)l==c?(n.push(l),c=r.indexOf(e,l+1)):1==n.length?o=[n.pop(),u]:((i=n.pop())=0?c:u;n.length&&(o=[a,s])}return o}e.exports=t,t.range=n},146:function(e,t,r){var n;function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}e=r.nmd(e),function(a){var s="object"==i(t)&&t,o="object"==i(e)&&e&&e.exports==s&&e,c="object"==("undefined"==typeof global?"undefined":i(global))&&global;c.global!==c&&c.window!==c||(a=c);var u=function(e){this.message=e};(u.prototype=new Error).name="InvalidCharacterError";var l=function(e){throw new u(e)},h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",p=/[\t\n\f\r ]/g,f={encode:function(e){e=String(e),/[^\0-\xFF]/.test(e)&&l("The string to be encoded contains characters outside of the Latin1 range.");for(var t,r,n,i,a=e.length%3,s="",o=-1,c=e.length-a;++o>18&63)+h.charAt(i>>12&63)+h.charAt(i>>6&63)+h.charAt(63&i);return 2==a?(t=e.charCodeAt(o)<<8,r=e.charCodeAt(++o),s+=h.charAt((i=t+r)>>10)+h.charAt(i>>4&63)+h.charAt(i<<2&63)+"="):1==a&&(i=e.charCodeAt(o),s+=h.charAt(i>>2)+h.charAt(i<<4&63)+"=="),s},decode:function(e){var t=(e=String(e).replace(p,"")).length;t%4==0&&(t=(e=e.replace(/==?$/,"")).length),(t%4==1||/[^+a-zA-Z0-9/]/.test(e))&&l("Invalid character: the string to be decoded is not correctly encoded.");for(var r,n,i=0,a="",s=-1;++s>(-2*i&6)));return a},version:"1.0.0"};if("object"==i(r.amdO)&&r.amdO)void 0===(n=function(){return f}.call(t,r,t,e))||(e.exports=n);else if(s&&!s.nodeType)if(o)o.exports=f;else for(var d in f)f.hasOwnProperty(d)&&(s[d]=f[d]);else a.base64=f}(this)},918:(e,t)=>{t.k=function(e){if(!e)return 0;for(var t=(e=e.toString()).length,r=e.length;r--;){var n=e.charCodeAt(r);56320<=n&&n<=57343&&r--,127{var t={utf8:{stringToBytes:function(e){return t.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(t.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],r=0;r{var t,r;t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r={rotl:function(e,t){return e<>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&r.rotl(e,8)|4278255360&r.rotl(e,24);for(var t=0;t0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],r=0,n=0;r>>5]|=e[r]<<24-n%32;return t},wordsToBytes:function(e){for(var t=[],r=0;r<32*e.length;r+=8)t.push(e[r>>>5]>>>24-r%32&255);return t},bytesToHex:function(e){for(var t=[],r=0;r>>4).toString(16)),t.push((15&e[r]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],r=0;r>>6*(3-a)&63)):r.push("=");return r.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var r=[],n=0,i=0;n>>6-2*i);return r}},e.exports=r},5:(e,t,r)=>{var n=r(135),i=r(586),a=r(39);e.exports={XMLParser:i,XMLValidator:n,XMLBuilder:a}},410:(e,t)=>{var r=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",n="["+r+"]["+r+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*",i=new RegExp("^"+n+"$");t.isExist=function(e){return void 0!==e},t.isEmptyObject=function(e){return 0===Object.keys(e).length},t.merge=function(e,t,r){if(t)for(var n=Object.keys(t),i=n.length,a=0;a{var n=r(410),i={allowBooleanAttributes:!1,unpairedTags:[]};function a(e){return" "===e||"\t"===e||"\n"===e||"\r"===e}function s(e,t){for(var r=t;t5&&"xml"===n)return d("InvalidXml","XML declaration allowed only at the start of the document.",m(e,t));if("?"==e[t]&&">"==e[t+1]){t++;break}}return t}function o(e,t){if(e.length>t+5&&"-"===e[t+1]&&"-"===e[t+2]){for(t+=3;t"===e[t+2]){t+=2;break}}else if(e.length>t+8&&"D"===e[t+1]&&"O"===e[t+2]&&"C"===e[t+3]&&"T"===e[t+4]&&"Y"===e[t+5]&&"P"===e[t+6]&&"E"===e[t+7]){var r=1;for(t+=8;t"===e[t]&&0==--r)break}else if(e.length>t+9&&"["===e[t+1]&&"C"===e[t+2]&&"D"===e[t+3]&&"A"===e[t+4]&&"T"===e[t+5]&&"A"===e[t+6]&&"["===e[t+7])for(t+=8;t"===e[t+2]){t+=2;break}return t}t.validate=function(e,t){t=Object.assign({},i,t);var r,c=[],u=!1,h=!1;"\ufeff"===e[0]&&(e=e.substr(1));for(var g=0;g"!==e[g]&&" "!==e[g]&&"\t"!==e[g]&&"\n"!==e[g]&&"\r"!==e[g];g++)b+=e[g];if("/"===(b=b.trim())[b.length-1]&&(b=b.substring(0,b.length-1),g--),r=b,!n.isName(r))return d("InvalidTag",0===b.trim().length?"Invalid space after '<'.":"Tag '"+b+"' is an invalid name.",m(e,g));var x=l(e,g);if(!1===x)return d("InvalidAttr","Attributes for '"+b+"' have open quote.",m(e,g));var w=x.value;if(g=x.index,"/"===w[w.length-1]){var A=g-w.length,k=p(w=w.substring(0,w.length-1),t);if(!0!==k)return d(k.err.code,k.err.msg,m(e,A+k.err.line));u=!0}else if(v){if(!x.tagClosed)return d("InvalidTag","Closing tag '"+b+"' doesn't have proper closing.",m(e,g));if(w.trim().length>0)return d("InvalidTag","Closing tag '"+b+"' can't have attributes or invalid starting.",m(e,y));var S=c.pop();if(b!==S.tagName){var E=m(e,S.tagStartPos);return d("InvalidTag","Expected closing tag '"+S.tagName+"' (opened in line "+E.line+", col "+E.col+") instead of closing tag '"+b+"'.",m(e,y))}0==c.length&&(h=!0)}else{var _=p(w,t);if(!0!==_)return d(_.err.code,_.err.msg,m(e,g-w.length+_.err.line));if(!0===h)return d("InvalidXml","Multiple possible root nodes found.",m(e,g));-1!==t.unpairedTags.indexOf(b)||c.push({tagName:b,tagStartPos:y}),u=!0}for(g++;g0)||d("InvalidXml","Invalid '"+JSON.stringify(c.map((function(e){return e.tagName})),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):d("InvalidXml","Start tag expected.",1)};var c='"',u="'";function l(e,t){for(var r="",n="",i=!1;t"===e[t]&&""===n){i=!0;break}r+=e[t]}return""===n&&{value:r,index:t,tagClosed:i}}var h=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function p(e,t){for(var r=n.getAllMatches(e,h),i={},a=0;a{function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}var i=r(354),a={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&"},{regex:new RegExp(">","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function s(e){this.options=Object.assign({},a,e),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=u),this.processTextOrObjNode=o,this.options.format?(this.indentate=c,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function o(e,t,r){var n=this.j2x(e,r+1);return void 0!==e[this.options.textNodeName]&&1===Object.keys(e).length?this.buildTextValNode(e[this.options.textNodeName],t,n.attrStr,r):this.buildObjectNode(n.val,t,n.attrStr,r)}function c(e){return this.options.indentBy.repeat(e)}function u(e){return!(!e.startsWith(this.options.attributeNamePrefix)||e===this.options.textNodeName)&&e.substr(this.attrPrefixLen)}s.prototype.build=function(e){return this.options.preserveOrder?i(e,this.options):(Array.isArray(e)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(t={},n=e,(r=this.options.arrayNodeName)in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,e=t),this.j2x(e,0).val);var t,r,n},s.prototype.j2x=function(e,t){var r="",i="";for(var a in e)if(void 0===e[a])this.isAttribute(a)&&(i+="");else if(null===e[a])this.isAttribute(a)?i+="":"?"===a[0]?i+=this.indentate(t)+"<"+a+"?"+this.tagEndChar:i+=this.indentate(t)+"<"+a+"/"+this.tagEndChar;else if(e[a]instanceof Date)i+=this.buildTextValNode(e[a],a,"",t);else if("object"!==n(e[a])){var s=this.isAttribute(a);if(s)r+=this.buildAttrPairStr(s,""+e[a]);else if(a===this.options.textNodeName){var o=this.options.tagValueProcessor(a,""+e[a]);i+=this.replaceEntitiesValue(o)}else i+=this.buildTextValNode(e[a],a,"",t)}else if(Array.isArray(e[a])){for(var c=e[a].length,u="",l=0;l"+e+i},s.prototype.closeTag=function(e){var t="";return-1!==this.options.unpairedTags.indexOf(e)?this.options.suppressUnpairedNode||(t="/"):t=this.options.suppressEmptyNode?"/":">")+this.newLine;if(!1!==this.options.commentPropName&&t===this.options.commentPropName)return this.indentate(n)+"\x3c!--".concat(e,"--\x3e")+this.newLine;if("?"===t[0])return this.indentate(n)+"<"+t+r+"?"+this.tagEndChar;var i=this.options.tagValueProcessor(t,e);return""===(i=this.replaceEntitiesValue(i))?this.indentate(n)+"<"+t+r+this.closeTag(t)+this.tagEndChar:this.indentate(n)+"<"+t+r+">"+i+"0&&this.options.processEntities)for(var t=0;t{function t(e,s,o,c){for(var u="",l=!1,h=0;h":u+=y+"/>":v&&0!==v.length||!s.suppressEmptyNode?v&&v.endsWith(">")?u+=y+">".concat(v).concat(c,""):(u+=y+">",v&&""!==c&&(v.includes("/>")||v.includes("")):u+=y+"/>",l=!0}else{var b=n(f[":@"],s),x="?xml"===d?"":c,w=f[d][0][s.textNodeName];w=0!==w.length?" "+w:"",u+=x+"<".concat(d).concat(w).concat(b,"?>"),l=!0}else u+=c+"\x3c!--".concat(f[d][0][s.textNodeName],"--\x3e"),l=!0;else l&&(u+=c),u+=""),l=!1;else{var A=f[d];i(p,s)||(A=a(A=s.tagValueProcessor(d,A),s)),l&&(u+=c),u+=A,l=!1}}return u}function r(e){for(var t=Object.keys(e),r=0;r0&&t.processEntities)for(var r=0;r0&&(n="\n"),t(e,r,"",n)}},895:(e,t,r)=>{function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,a=[],s=!0,o=!1;try{for(r=r.call(e);!(s=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);s=!0);}catch(e){o=!0,i=e}finally{try{s||null==r.return||r.return()}finally{if(o)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r"===e[t]){if(f?"-"===e[t-1]&&"-"===e[t-2]&&(f=!1,i--):i--,0===i)break}else"["===e[t]?a=!0:e[t];else{if(a&&c(e,t)){var d=n(s(e,(t+=7)+1),3);entityName=d[0],val=d[1],t=d[2],-1===val.indexOf("&")&&(r[p(entityName)]={regx:RegExp("&".concat(entityName,";"),"g"),val:val})}else if(a&&u(e,t))t+=8;else if(a&&l(e,t))t+=8;else if(a&&h(e,t))t+=9;else{if(!o)throw new Error("Invalid DOCTYPE");f=!0}i++}if(0!==i)throw new Error("Unclosed DOCTYPE");return{entities:r,i:t}}},282:(e,t)=>{var r={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},stopNodes:[],alwaysCreateTextNode:!1,isArray:function(){return!1},commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,t,r){return e}};t.buildOptions=function(e){return Object.assign({},r,e)},t.defaultOptions=r},502:(e,t,r)=>{function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function a(e,t){for(var r=0;r))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g,s.nameRegexp),function(e,t,r){return t&&a(e.prototype,t),r&&a(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}((function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.options=t,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"\xa2"},pound:{regex:/&(pound|#163);/g,val:"\xa3"},yen:{regex:/&(yen|#165);/g,val:"\xa5"},euro:{regex:/&(euro|#8364);/g,val:"\u20ac"},copyright:{regex:/&(copy|#169);/g,val:"\xa9"},reg:{regex:/&(reg|#174);/g,val:"\xae"},inr:{regex:/&(inr|#8377);/g,val:"\u20b9"}},this.addExternalEntities=h,this.parseXml=m,this.parseTextData=p,this.resolveNameSpace=f,this.buildAttributesMap=g,this.isItStopNode=x,this.replaceEntitiesValue=v,this.readStopNodeData=k,this.saveTextToParentTag=b,this.addChild=y})));function h(e){for(var t=Object.keys(e),r=0;r0)){o||(e=this.replaceEntitiesValue(e));var c=this.options.tagValueProcessor(t,e,r,a,s);return null==c?e:i(c)!==i(e)||c!==e?c:this.options.trimValues||e.trim()===e?S(e,this.options.parseTagValue,this.options.numberParseOptions):e}}function f(e){if(this.options.removeNSPrefix){var t=e.split(":"),r="/"===e.charAt(0)?"/":"";if("xmlns"===t[0])return"";2===t.length&&(e=r+t[1])}return e}var d=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function g(e,t,r){if(!this.options.ignoreAttributes&&"string"==typeof e){for(var n=s.getAllMatches(e,d),a=n.length,o={},c=0;c",s,"Closing Tag is not closed."),l=e.substring(s+2,u).trim();if(this.options.removeNSPrefix){var h=l.indexOf(":");-1!==h&&(l=l.substr(h+1))}this.options.transformTagName&&(l=this.options.transformTagName(l)),r&&(i=this.saveTextToParentTag(i,r,a));var p=a.substring(a.lastIndexOf(".")+1);if(l&&-1!==this.options.unpairedTags.indexOf(l))throw new Error("Unpaired tag can not be used as closing tag: "));var f=0;p&&-1!==this.options.unpairedTags.indexOf(p)?(f=a.lastIndexOf(".",a.lastIndexOf(".")-1),this.tagsNodeStack.pop()):f=a.lastIndexOf("."),a=a.substring(0,f),r=this.tagsNodeStack.pop(),i="",s=u}else if("?"===e[s+1]){var d=A(e,s,!1,"?>");if(!d)throw new Error("Pi Tag is not closed.");if(i=this.saveTextToParentTag(i,r,a),this.options.ignoreDeclaration&&"?xml"===d.tagName||this.options.ignorePiTags);else{var g=new o(d.tagName);g.add(this.options.textNodeName,""),d.tagName!==d.tagExp&&d.attrExpPresent&&(g[":@"]=this.buildAttributesMap(d.tagExp,a,d.tagName)),this.addChild(r,g,a)}s=d.closeIndex+1}else if("!--"===e.substr(s+1,3)){var m=w(e,"--\x3e",s+4,"Comment is not closed.");if(this.options.commentPropName){var y=e.substring(s+4,m-2);i=this.saveTextToParentTag(i,r,a),r.add(this.options.commentPropName,[n({},this.options.textNodeName,y)])}s=m}else if("!D"===e.substr(s+1,2)){var v=c(e,s);this.docTypeEntities=v.entities,s=v.i}else if("!["===e.substr(s+1,2)){var b=w(e,"]]>",s,"CDATA is not closed.")-2,x=e.substring(s+9,b);if(i=this.saveTextToParentTag(i,r,a),this.options.cdataPropName)r.add(this.options.cdataPropName,[n({},this.options.textNodeName,x)]);else{var k=this.parseTextData(x,r.tagname,a,!0,!1,!0);null==k&&(k=""),r.add(this.options.textNodeName,k)}s=b+2}else{var S=A(e,s,this.options.removeNSPrefix),E=S.tagName,_=S.tagExp,C=S.attrExpPresent,P=S.closeIndex;this.options.transformTagName&&(E=this.options.transformTagName(E)),r&&i&&"!xml"!==r.tagname&&(i=this.saveTextToParentTag(i,r,a,!1));var T=r;if(T&&-1!==this.options.unpairedTags.indexOf(T.tagname)&&(r=this.tagsNodeStack.pop(),a=a.substring(0,a.lastIndexOf("."))),E!==t.tagname&&(a+=a?"."+E:E),this.isItStopNode(this.options.stopNodes,a,E)){var I="";if(_.length>0&&_.lastIndexOf("/")===_.length-1)s=S.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(E))s=S.closeIndex;else{var O=this.readStopNodeData(e,E,P+1);if(!O)throw new Error("Unexpected end of ".concat(E));s=O.i,I=O.tagContent}var N=new o(E);E!==_&&C&&(N[":@"]=this.buildAttributesMap(_,a,E)),I&&(I=this.parseTextData(I,E,a,!0,C,!0,!0)),a=a.substr(0,a.lastIndexOf(".")),N.add(this.options.textNodeName,I),this.addChild(r,N,a)}else{if(_.length>0&&_.lastIndexOf("/")===_.length-1){"/"===E[E.length-1]?(E=E.substr(0,E.length-1),a=a.substr(0,a.length-1),_=E):_=_.substr(0,_.length-1),this.options.transformTagName&&(E=this.options.transformTagName(E));var j=new o(E);E!==_&&C&&(j[":@"]=this.buildAttributesMap(_,a,E)),this.addChild(r,j,a),a=a.substr(0,a.lastIndexOf("."))}else{var R=new o(E);this.tagsNodeStack.push(r),E!==_&&C&&(R[":@"]=this.buildAttributesMap(_,a,E)),this.addChild(r,R,a),r=R}i="",s=P}}else i+=e[s];return t.child};function y(e,t,r){var n=this.options.updateTag(t.tagname,r,t[":@"]);!1===n||("string"==typeof n?(t.tagname=n,e.addChild(t)):e.addChild(t))}var v=function(e){if(this.options.processEntities){for(var t in this.docTypeEntities){var r=this.docTypeEntities[t];e=e.replace(r.regx,r.val)}for(var n in this.lastEntities){var i=this.lastEntities[n];e=e.replace(i.regex,i.val)}if(this.options.htmlEntities)for(var a in this.htmlEntities){var s=this.htmlEntities[a];e=e.replace(s.regex,s.val)}e=e.replace(this.ampEntity.regex,this.ampEntity.val)}return e};function b(e,t,r,n){return e&&(void 0===n&&(n=0===Object.keys(t.child).length),void 0!==(e=this.parseTextData(e,t.tagname,r,!1,!!t[":@"]&&0!==Object.keys(t[":@"]).length,n))&&""!==e&&t.add(this.options.textNodeName,e),e=""),e}function x(e,t,r){var n="*."+r;for(var i in e){var a=e[i];if(n===a||t===a)return!0}return!1}function w(e,t,r,n){var i=e.indexOf(t,r);if(-1===i)throw new Error(n);return i+t.length-1}function A(e,t,r){var n=function(e,t){for(var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:">",i="",a=t;a3&&void 0!==arguments[3]?arguments[3]:">");if(n){var i=n.data,a=n.index,s=i.search(/\s/),o=i,c=!0;if(-1!==s&&(o=i.substr(0,s).replace(/\s\s*$/,""),i=i.substr(s+1)),r){var u=o.indexOf(":");-1!==u&&(c=(o=o.substr(u+1))!==n.data.substr(u+1))}return{tagName:o,tagExp:i,closeIndex:a,attrExpPresent:c}}}function k(e,t,r){for(var n=r,i=1;r",r,"".concat(t," is not closed"));if(e.substring(r+2,a).trim()===t&&0==--i)return{tagContent:e.substring(n,r),i:a};r=a}else if("?"===e[r+1])r=w(e,"?>",r+1,"StopNode is not closed.");else if("!--"===e.substr(r+1,3))r=w(e,"--\x3e",r+3,"StopNode is not closed.");else if("!["===e.substr(r+1,2))r=w(e,"]]>",r,"StopNode is not closed.")-2;else{var s=A(e,r,">");s&&((s&&s.tagName)===t&&"/"!==s.tagExp[s.tagExp.length-1]&&i++,r=s.closeIndex)}}function S(e,t,r){if(t&&"string"==typeof e){var n=e.trim();return"true"===n||"false"!==n&&u(e,r)}return s.isExist(e)?e:""}e.exports=l},586:(e,t,r)=>{var n=r(282).buildOptions,i=r(502),a=r(869).prettify,s=r(135),o=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.externalEntities={},this.options=n(t)}var t,r;return t=e,(r=[{key:"parse",value:function(e,t){if("string"==typeof e);else{if(!e.toString)throw new Error("XML data is accepted in String or Bytes[] form.");e=e.toString()}if(t){!0===t&&(t={});var r=s.validate(e,t);if(!0!==r)throw Error("".concat(r.err.msg,":").concat(r.err.line,":").concat(r.err.col))}var n=new i(this.options);n.addExternalEntities(this.externalEntities);var o=n.parseXml(e);return this.options.preserveOrder||void 0===o?o:a(o,this.options)}},{key:"addEntity",value:function(e,t){if(-1!==t.indexOf("&"))throw new Error("Entity value can't have '&'");if(-1!==e.indexOf("&")||-1!==e.indexOf(";"))throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for ' '");if("&"===t)throw new Error("An entity with value '&' is not permitted");this.externalEntities[e]=t}}])&&function(e,t){for(var r=0;r{function r(e,t,s){for(var o,c={},u=0;u0&&(c[t.textNodeName]=o):void 0!==o&&(c[t.textNodeName]=o),c}function n(e){for(var t=Object.keys(e),r=0;r{function t(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var r=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.tagname=t,this.child=[],this[":@"]={}}var r,n;return r=e,(n=[{key:"add",value:function(e,r){"__proto__"===e&&(e="#__proto__"),this.child.push(t({},e,r))}},{key:"addChild",value:function(e){var r;"__proto__"===e.tagname&&(e.tagname="#__proto__"),e[":@"]&&Object.keys(e[":@"]).length>0?this.child.push((t(r={},e.tagname,e.child),t(r,":@",e[":@"]),r)):this.child.push(t({},e.tagname,e.child))}}])&&function(e,t){for(var r=0;r{function t(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}e.exports=function(e){return null!=e&&(t(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&t(e.slice(0,0))}(e)||!!e._isBuffer)}},243:(e,t,r)=>{var n,i,a,s,o;n=r(718),i=r(106).utf8,a=r(163),s=r(106).bin,(o=function e(t,r){t.constructor==String?t=r&&"binary"===r.encoding?s.stringToBytes(t):i.stringToBytes(t):a(t)?t=Array.prototype.slice.call(t,0):Array.isArray(t)||t.constructor===Uint8Array||(t=t.toString());for(var o=n.bytesToWords(t),c=8*t.length,u=1732584193,l=-271733879,h=-1732584194,p=271733878,f=0;f>>24)|4278255360&(o[f]<<24|o[f]>>>8);o[c>>>5]|=128<>>9<<4)]=c;var d=e._ff,g=e._gg,m=e._hh,y=e._ii;for(f=0;f>>0,l=l+b>>>0,h=h+x>>>0,p=p+w>>>0}return n.endian([u,l,h,p])})._ff=function(e,t,r,n,i,a,s){var o=e+(t&r|~t&n)+(i>>>0)+s;return(o<>>32-a)+t},o._gg=function(e,t,r,n,i,a,s){var o=e+(t&n|r&~n)+(i>>>0)+s;return(o<>>32-a)+t},o._hh=function(e,t,r,n,i,a,s){var o=e+(t^r^n)+(i>>>0)+s;return(o<>>32-a)+t},o._ii=function(e,t,r,n,i,a,s){var o=e+(r^(t|~n))+(i>>>0)+s;return(o<>>32-a)+t},o._blocksize=16,o._digestsize=16,e.exports=function(e,t){if(null==e)throw new Error("Illegal argument "+e);var r=n.wordsToBytes(o(e,t));return t&&t.asBytes?r:t&&t.asString?s.bytesToString(r):n.bytesToHex(r)}},637:(e,t,r)=>{var n=r(584);e.exports=function(e){return e?("{}"===e.substr(0,2)&&(e="\\{\\}"+e.substr(2)),m(function(e){return e.split("\\\\").join(i).split("\\{").join(a).split("\\}").join(s).split("\\,").join(o).split("\\.").join(c)}(e),!0).map(l)):[]};var i="\0SLASH"+Math.random()+"\0",a="\0OPEN"+Math.random()+"\0",s="\0CLOSE"+Math.random()+"\0",o="\0COMMA"+Math.random()+"\0",c="\0PERIOD"+Math.random()+"\0";function u(e){return parseInt(e,10)==e?parseInt(e,10):e.charCodeAt(0)}function l(e){return e.split(i).join("\\").split(a).join("{").split(s).join("}").split(o).join(",").split(c).join(".")}function h(e){if(!e)return[""];var t=[],r=n("{","}",e);if(!r)return e.split(",");var i=r.pre,a=r.body,s=r.post,o=i.split(",");o[o.length-1]+="{"+a+"}";var c=h(s);return s.length&&(o[o.length-1]+=c.shift(),o.push.apply(o,c)),t.push.apply(t,o),t}function p(e){return"{"+e+"}"}function f(e){return/^-?0\d/.test(e)}function d(e,t){return e<=t}function g(e,t){return e>=t}function m(e,t){var r=[],i=n("{","}",e);if(!i)return[e];var a=i.pre,o=i.post.length?m(i.post,!1):[""];if(/\$$/.test(i.pre))for(var c=0;c=0;if(!w&&!A)return i.post.match(/,.*\}/)?m(e=i.pre+"{"+i.body+s+i.post):[e];if(w)y=i.body.split(/\.\./);else if(1===(y=h(i.body)).length&&1===(y=m(y[0],!1).map(p)).length)return o.map((function(e){return i.pre+y[0]+e}));if(w){var k=u(y[0]),S=u(y[1]),E=Math.max(y[0].length,y[1].length),_=3==y.length?Math.abs(u(y[2])):1,C=d;S0){var N=new Array(O+1).join("0");I=T<0?"-"+N+I.slice(1):N+I}}v.push(I)}}else{v=[];for(var j=0;j{function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}function r(e){var t="function"==typeof Map?new Map:void 0;return r=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,s)}function s(){return n(e,arguments,a(this).constructor)}return s.prototype=Object.create(e.prototype,{constructor:{value:s,enumerable:!1,writable:!0,configurable:!0}}),i(s,e)},r(e)}function n(e,t,r){return n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var a=new(Function.bind.apply(e,n));return r&&i(a,r.prototype),a},n.apply(null,arguments)}function i(e,t){return i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},i(e,t)}function a(e){return a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},a(e)}var s=function(e){function r(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),(n=function(e,r){return!r||"object"!==t(r)&&"function"!=typeof r?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):r}(this,a(r).call(this,e))).name="ObjectPrototypeMutationError",n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}(r,e),r}(r(Error));function o(e,r){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},i=r.split("."),a=i.length,s=function(t){var r=i[t];if(!e)return{v:void 0};if("+"===r){if(Array.isArray(e))return{v:e.map((function(r,a){var s=i.slice(t+1);return s.length>0?o(r,s.join("."),n):n(e,a,i,t)}))};var a=i.slice(0,t).join(".");throw new Error("Object at wildcard (".concat(a,") is not an array"))}e=n(e,r,i,t)},c=0;c2&&void 0!==arguments[2]?arguments[2]:{};if("object"!=t(e)||null===e)return!1;if(void 0===r)return!1;if("number"==typeof r)return r in e;try{var i=!1;return o(e,r,(function(e,t,r,a){if(!c(r,a))return e&&e[t];i=n.own?e.hasOwnProperty(t):t in e})),i}catch(e){return!1}},hasOwn:function(e,t,r){return this.has(e,t,r||{own:!0})},isIn:function(e,r,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if("object"!=t(e)||null===e)return!1;if(void 0===r)return!1;try{var a=!1,s=!1;return o(e,r,(function(e,r,i,o){return a=a||e===n||!!e&&e[r]===n,s=c(i,o)&&"object"===t(e)&&r in e,e&&e[r]})),i.validPath?a&&s:a}catch(e){return!1}},ObjectPrototypeMutationError:s}},441:(e,t,r)=>{function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}var i=r(930),a=function(e){return"string"==typeof e};function s(e,t){for(var r=[],n=0;n=-1&&!t;r--){var n=r>=0?arguments[r]:process.cwd();if(!a(n))throw new TypeError("Arguments to path.resolve must be strings");n&&(e=n+"/"+e,t="/"===n.charAt(0))}return(t?"/":"")+(e=s(e.split("/"),!t).join("/"))||"."},c.normalize=function(e){var t=c.isAbsolute(e),r="/"===e.substr(-1);return(e=s(e.split("/"),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},c.isAbsolute=function(e){return"/"===e.charAt(0)},c.join=function(){for(var e="",t=0;t=0&&""===e[r];r--);return t>r?[]:e.slice(t,r+1)}e=c.resolve(e).substr(1),t=c.resolve(t).substr(1);for(var n=r(e.split("/")),i=r(t.split("/")),a=Math.min(n.length,i.length),s=a,o=0;o{var r=Object.prototype.hasOwnProperty;function n(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}function i(e){try{return encodeURIComponent(e)}catch(e){return null}}t.stringify=function(e,t){t=t||"";var n,a,s=[];for(a in"string"!=typeof t&&(t="?"),e)if(r.call(e,a)){if((n=e[a])||null!=n&&!isNaN(n)||(n=""),a=i(a),n=i(n),null===a||null===n)continue;s.push(a+"="+n)}return s.length?t+s.join("&"):""},t.parse=function(e){for(var t,r=/([^=?#&]+)=?([^&]*)/g,i={};t=r.exec(e);){var a=n(t[1]),s=n(t[2]);null===a||null===s||a in i||(i[a]=s)}return i}},620:e=>{e.exports=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e}},512:e=>{var t=/^[-+]?0x[a-fA-F0-9]+$/,r=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);var n={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};e.exports=function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(i=Object.assign({},n,i),!e||"string"!=typeof e)return e;var a=e.trim();if(void 0!==i.skipLike&&i.skipLike.test(a))return e;if(i.hex&&t.test(a))return Number.parseInt(a,16);var s=r.exec(a);if(s){var o=s[1],c=s[2],u=function(e){return e&&-1!==e.indexOf(".")?("."===(e=e.replace(/0+$/,""))?e="0":"."===e[0]?e="0"+e:"."===e[e.length-1]&&(e=e.substr(0,e.length-1)),e):e}(s[3]),l=s[4]||s[6];if(!i.leadingZeros&&c.length>0&&o&&"."!==a[2])return e;if(!i.leadingZeros&&c.length>0&&!o&&"."!==a[1])return e;var h=Number(a),p=""+h;return-1!==p.search(/[eE]/)||l?i.eNotation?h:e:-1!==a.indexOf(".")?"0"===p&&""===u||p===u||o&&p==="-"+u?h:e:c?u===p||o+u===p?h:e:a===p||a===o+p?h:e}return e}},95:(e,t,r)=>{function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}var i=r(620),a=r(361),s=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,o=/[\n\r\t]/g,c=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,u=/:\d+$/,l=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,h=/^[a-zA-Z]:/;function p(e){return(e||"").toString().replace(s,"")}var f=[["#","hash"],["?","query"],function(e,t){return m(t.protocol)?e.replace(/\\/g,"/"):e},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],d={hash:1,query:1};function g(e){var t,r=("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{}).location||{},i={},a=n(e=e||r);if("blob:"===e.protocol)i=new v(unescape(e.pathname),{});else if("string"===a)for(t in i=new v(e,{}),d)delete i[t];else if("object"===a){for(t in e)t in d||(i[t]=e[t]);void 0===i.slashes&&(i.slashes=c.test(e.href))}return i}function m(e){return"file:"===e||"ftp:"===e||"http:"===e||"https:"===e||"ws:"===e||"wss:"===e}function y(e,t){e=(e=p(e)).replace(o,""),t=t||{};var r,n=l.exec(e),i=n[1]?n[1].toLowerCase():"",a=!!n[2],s=!!n[3],c=0;return a?s?(r=n[2]+n[3]+n[4],c=n[2].length+n[3].length):(r=n[2]+n[4],c=n[2].length):s?(r=n[3]+n[4],c=n[3].length):r=n[4],"file:"===i?c>=2&&(r=r.slice(2)):m(i)?r=n[4]:i?a&&(r=r.slice(2)):c>=2&&m(t.protocol)&&(r=n[4]),{protocol:i,slashes:a||m(i),slashesCount:c,rest:r}}function v(e,t,r){if(e=(e=p(e)).replace(o,""),!(this instanceof v))return new v(e,t,r);var s,c,u,l,d,b,x=f.slice(),w=n(t),A=this,k=0;for("object"!==w&&"string"!==w&&(r=t,t=null),r&&"function"!=typeof r&&(r=a.parse),s=!(c=y(e||"",t=g(t))).protocol&&!c.slashes,A.slashes=c.slashes||s&&t.slashes,A.protocol=c.protocol||t.protocol||"",e=c.rest,("file:"===c.protocol&&(2!==c.slashesCount||h.test(e))||!c.slashes&&(c.protocol||c.slashesCount<2||!m(A.protocol)))&&(x[3]=[/(.*)/,"pathname"]);k{},227:()=>{},347:()=>{},724:()=>{}},rr={};function nr(e){var t=rr[e];if(void 0!==t)return t.exports;var r=rr[e]={id:e,loaded:!1,exports:{}};return tr[e].call(r.exports,r,r.exports,nr),r.loaded=!0,r.exports}nr.amdO={},nr.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return nr.d(t,{a:t}),t},nr.d=(e,t)=>{for(var r in t)nr.o(t,r)&&!nr.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},nr.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),nr.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var ir={};(()=>{nr.d(ir,{Gr:()=>T,jK:()=>I,cf:()=>j,HM:()=>R,eI:()=>kr,lD:()=>q,yY:()=>kt,sw:()=>wt,np:()=>pt,_M:()=>St});var e=nr(95),t=nr.n(e);function r(e){if(!n(e))throw new Error("Parameter was not an error")}function n(e){return"[object Error]"===(t=e,Object.prototype.toString.call(t))||e instanceof Error;var t}function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function s(e,t){for(var r=0;r1){var r=e.shift();e[0]=r+e[0]}e[0].match(/^file:\/\/\//)?e[0]=e[0].replace(/^([^/:]+):\/*/,"$1:///"):e[0]=e[0].replace(/^([^/:]+):\/*/,"$1://");for(var n=0;n0&&(i=i.replace(/^[\/]+/,"")),i=n0?"?":"")+s.join("&")}("object"===d(arguments[0])?arguments[0]:[].slice.call(arguments))}(t.reduce((function(e,t,r){return(0===r||"/"!==t||"/"===t&&"/"!==e[e.length-1])&&e.push(t),e}),[]))}var k=nr(243),S=nr.n(k);function E(e,t){var r=e.url.replace("//",""),n=-1==r.indexOf("/")?"/":r.slice(r.indexOf("/")),i=e.method?e.method.toUpperCase():"GET",a=!!/(^|,)\s*auth\s*($|,)/.test(t.qop)&&"auth",s="00000000".concat(t.nc).slice(-8),o=function(e,t,r,n,i,a,s){var o=s||S()("".concat(t,":").concat(r,":").concat(n));return e&&"md5-sess"===e.toLowerCase()?S()("".concat(o,":").concat(i,":").concat(a)):o}(t.algorithm,t.username,t.realm,t.password,t.nonce,t.cnonce,t.ha1),c=S()("".concat(i,":").concat(n)),u=a?S()("".concat(o,":").concat(t.nonce,":").concat(s,":").concat(t.cnonce,":").concat(a,":").concat(c)):S()("".concat(o,":").concat(t.nonce,":").concat(c)),l={username:t.username,realm:t.realm,nonce:t.nonce,uri:n,qop:a,response:u,nc:s,cnonce:t.cnonce,algorithm:t.algorithm,opaque:t.opaque},h=[];for(var p in l)l[p]&&("qop"===p||"nc"===p||"algorithm"===p?h.push("".concat(p,"=").concat(l[p])):h.push("".concat(p,'="').concat(l[p],'"')));return"Digest ".concat(h.join(", "))}var _=nr(146),C=nr.n(_);function P(e){return C().decode(e)}var T,I,O="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:"undefined"!=typeof window?window:globalThis,N=O.fetch.bind(O),j=(O.Headers,O.Request),R=O.Response;function L(){for(var e=arguments.length,t=new Array(e),r=0;r0;)i=[t.shift().apply(this,i)];return i[0]}}function V(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]&&arguments[1];if(!e||e.__type__!==D)throw new Error("Failed taking control of target HotPatcher instance: Invalid type or object");return Object.keys(e.configuration.registry).forEach((function(n){t.configuration.registry.hasOwnProperty(n)?r&&(t.configuration.registry[n]=Object.assign({},e.configuration.registry[n])):t.configuration.registry[n]=Object.assign({},e.configuration.registry[n])})),e._configuration=this.configuration,this}},{key:"execute",value:function(e){for(var t=this.get(e)||M,r=arguments.length,n=new Array(r>1?r-1:0),i=1;i2&&void 0!==arguments[2]?arguments[2]:{}).chain,n=void 0!==r&&r;if(this.configuration.registry[e]&&this.configuration.registry[e].final)throw new Error("Failed patching '".concat(e,"': Method marked as being final"));if("function"!=typeof t)throw new Error("Failed patching '".concat(e,"': Provided method is not a function"));if(n)this.configuration.registry[e]?this.configuration.registry[e].methods.push(t):this.configuration.registry[e]=F(t);else if(this.isPatched(e)){var i=this.configuration.registry[e].original;this.configuration.registry[e]=Object.assign(F(t),{original:i})}else this.configuration.registry[e]=F(t);return this}},{key:"patchInline",value:function(e,t){this.isPatched(e)||this.patch(e,t);for(var r=arguments.length,n=new Array(r>2?r-2:0),i=2;i1?r-1:0),i=1;ie.length)&&(t=e.length);for(var r=0,n=new Array(t);r0;){var a=i.shift();n=n?$(n,a):G(a)}return n}function $(e,t){var r=G(e);return Object.keys(t).forEach((function(e){r.hasOwnProperty(e)?Array.isArray(t[e])?r[e]=Array.isArray(r[e])?[].concat(z(r[e]),z(t[e])):z(t[e]):"object"===H(t[e])&&t[e]?r[e]="object"===H(r[e])&&r[e]?$(r[e],t[e]):G(t[e]):r[e]=t[e]:r[e]=t[e]})),r}function J(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,o=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){o=!0,a=e},f:function(){try{s||null==r.return||r.return()}finally{if(o)throw a}}}}(e.keys());try{for(n.s();!(t=n.n()).done;){var i=t.value;r[i]=e.get(i)}}catch(e){n.e(e)}finally{n.f()}return r}function X(){for(var e=arguments.length,t=new Array(e),r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);rp?i.push(fe(p)+"-"+fe(f)):f===p&&i.push(fe(f)),p="",s++):e.startsWith("-]",s+1)?(i.push(fe(f+"-")),s+=2):e.startsWith("-",s+1)?(p=f,s+=2):(i.push(fe(f)),s++)}else u=!0,s++}else l=!0,s++}if(h=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,o=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){o=!0,a=e},f:function(){try{s||null==r.return||r.return()}finally{if(o)throw a}}}}function ve(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function be(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xe(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r2&&void 0!==arguments[2]?arguments[2]:{};return st(t),!(!r.nocomment&&"#"===t.charAt(0))&&new ut(t,r).match(e)};const Te=Pe;var Ie=/^\*+([^+@!?\*\[\(]*)$/,Oe=function(e){return function(t){return!t.startsWith(".")&&t.endsWith(e)}},Ne=function(e){return function(t){return t.endsWith(e)}},je=function(e){return e=e.toLowerCase(),function(t){return!t.startsWith(".")&&t.toLowerCase().endsWith(e)}},Re=function(e){return e=e.toLowerCase(),function(t){return t.toLowerCase().endsWith(e)}},Le=/^\*+\.\*+$/,Ve=function(e){return!e.startsWith(".")&&e.includes(".")},De=function(e){return"."!==e&&".."!==e&&e.includes(".")},Me=/^\.\*+$/,Fe=function(e){return"."!==e&&".."!==e&&e.startsWith(".")},Be=/^\*+$/,Ue=function(e){return 0!==e.length&&!e.startsWith(".")},qe=function(e){return 0!==e.length&&"."!==e&&".."!==e},ze=/^\?+([^+@!?\*\[\(]*)?$/,We=function(e){var t=Ee(e,2),r=t[0],n=t[1],i=void 0===n?"":n,a=$e([r]);return i?(i=i.toLowerCase(),function(e){return a(e)&&e.toLowerCase().endsWith(i)}):a},He=function(e){var t=Ee(e,2),r=t[0],n=t[1],i=void 0===n?"":n,a=Je([r]);return i?(i=i.toLowerCase(),function(e){return a(e)&&e.toLowerCase().endsWith(i)}):a},Ge=function(e){var t=Ee(e,2),r=t[0],n=t[1],i=void 0===n?"":n,a=Je([r]);return i?function(e){return a(e)&&e.endsWith(i)}:a},Ke=function(e){var t=Ee(e,2),r=t[0],n=t[1],i=void 0===n?"":n,a=$e([r]);return i?function(e){return a(e)&&e.endsWith(i)}:a},$e=function(e){var t=Ee(e,1)[0].length;return function(e){return e.length===t&&!e.startsWith(".")}},Je=function(e){var t=Ee(e,1)[0].length;return function(e){return e.length===t&&"."!==e&&".."!==e}},Ze="object"===("undefined"==typeof process?"undefined":Se(process))&&process?"object"===Se({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_CLIENT:"chrome",REACT_APP_NAME:"KISS Translator",REACT_APP_NAME_CN:"\u7b80\u7ea6\u7ffb\u8bd1",REACT_APP_VERSION:"1.8.11",REACT_APP_HOMEPAGE:"https://github.com/fishjar/kiss-translator",REACT_APP_OPTIONSPAGE:"https://fishjar.github.io/kiss-translator/options.html",REACT_APP_OPTIONSPAGE_DEV:"http://localhost:3000/options.html",REACT_APP_LOGOURL:"https://fishjar.github.io/kiss-translator/images/logo192.png",REACT_APP_RULESURL:"https://fishjar.github.io/kiss-rules/kiss-rules.json",REACT_APP_RULESURL_ON:"https://fishjar.github.io/kiss-rules/kiss-rules-on.json",REACT_APP_RULESURL_OFF:"https://fishjar.github.io/kiss-rules/kiss-rules-off.json",REACT_APP_USERSCRIPT_DOWNLOADURL:"https://fishjar.github.io/kiss-translator/kiss-translator.user.js",REACT_APP_USERSCRIPT_IOS_DOWNLOADURL:"https://fishjar.github.io/kiss-translator/kiss-translator-ios-safari.user.js"})&&{NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_CLIENT:"chrome",REACT_APP_NAME:"KISS Translator",REACT_APP_NAME_CN:"\u7b80\u7ea6\u7ffb\u8bd1",REACT_APP_VERSION:"1.8.11",REACT_APP_HOMEPAGE:"https://github.com/fishjar/kiss-translator",REACT_APP_OPTIONSPAGE:"https://fishjar.github.io/kiss-translator/options.html",REACT_APP_OPTIONSPAGE_DEV:"http://localhost:3000/options.html",REACT_APP_LOGOURL:"https://fishjar.github.io/kiss-translator/images/logo192.png",REACT_APP_RULESURL:"https://fishjar.github.io/kiss-rules/kiss-rules.json",REACT_APP_RULESURL_ON:"https://fishjar.github.io/kiss-rules/kiss-rules-on.json",REACT_APP_RULESURL_OFF:"https://fishjar.github.io/kiss-rules/kiss-rules-off.json",REACT_APP_USERSCRIPT_DOWNLOADURL:"https://fishjar.github.io/kiss-translator/kiss-translator.user.js",REACT_APP_USERSCRIPT_IOS_DOWNLOADURL:"https://fishjar.github.io/kiss-translator/kiss-translator-ios-safari.user.js"}&&{NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_CLIENT:"chrome",REACT_APP_NAME:"KISS Translator",REACT_APP_NAME_CN:"\u7b80\u7ea6\u7ffb\u8bd1",REACT_APP_VERSION:"1.8.11",REACT_APP_HOMEPAGE:"https://github.com/fishjar/kiss-translator",REACT_APP_OPTIONSPAGE:"https://fishjar.github.io/kiss-translator/options.html",REACT_APP_OPTIONSPAGE_DEV:"http://localhost:3000/options.html",REACT_APP_LOGOURL:"https://fishjar.github.io/kiss-translator/images/logo192.png",REACT_APP_RULESURL:"https://fishjar.github.io/kiss-rules/kiss-rules.json",REACT_APP_RULESURL_ON:"https://fishjar.github.io/kiss-rules/kiss-rules-on.json",REACT_APP_RULESURL_OFF:"https://fishjar.github.io/kiss-rules/kiss-rules-off.json",REACT_APP_USERSCRIPT_DOWNLOADURL:"https://fishjar.github.io/kiss-translator/kiss-translator.user.js",REACT_APP_USERSCRIPT_IOS_DOWNLOADURL:"https://fishjar.github.io/kiss-translator/kiss-translator-ios-safari.user.js"}.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix";Pe.sep="win32"===Ze?"\\":"/";var Xe=Symbol("globstar **");Pe.GLOBSTAR=Xe;var Qe={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},Ye="[^/]",et=Ye+"*?",tt=function(e){return e.split("").reduce((function(e,t){return e[t]=!0,e}),{})},rt=tt("().*{}+?[]^$\\!"),nt=tt("[.(");Pe.filter=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(r){return Pe(r,e,t)}};var it=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object.assign({},e,t)};Pe.defaults=function(e){if(!e||"object"!==Se(e)||!Object.keys(e).length)return Pe;var t=Pe;return Object.assign((function(r,n){return t(r,n,it(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}))}),{Minimatch:function(r){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ae(e,t)}(s,r);var n,i,a=(n=s,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=ke(n);if(i){var r=ke(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Se(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function s(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return be(this,s),a.call(this,t,it(e,r))}return we(s,null,[{key:"defaults",value:function(r){return t.defaults(it(e,r)).Minimatch}}]),s}(t.Minimatch),unescape:function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.unescape(r,it(e,n))},escape:function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.escape(r,it(e,n))},filter:function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.filter(r,it(e,n))},defaults:function(r){return t.defaults(it(e,r))},makeRe:function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.makeRe(r,it(e,n))},braceExpand:function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.braceExpand(r,it(e,n))},match:function(r,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t.match(r,n,it(e,i))},sep:t.sep,GLOBSTAR:Xe})};var at=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return st(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:ue(e)};Pe.braceExpand=at;var st=function(e){if("string"!=typeof e)throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")};Pe.makeRe=function(e){return new ut(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).makeRe()},Pe.match=function(e,t){var r=new ut(t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{});return e=e.filter((function(e){return r.match(e)})),r.options.nonull&&!e.length&&e.push(t),e};var ot=/[?*]|[+@!]\(.*?\)|\[|\]/,ct=function(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},ut=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};be(this,e),ve(this,"options",void 0),ve(this,"set",void 0),ve(this,"pattern",void 0),ve(this,"windowsPathsNoEscape",void 0),ve(this,"nonegate",void 0),ve(this,"negate",void 0),ve(this,"comment",void 0),ve(this,"empty",void 0),ve(this,"preserveMultipleSlashes",void 0),ve(this,"partial",void 0),ve(this,"globSet",void 0),ve(this,"globParts",void 0),ve(this,"nocase",void 0),ve(this,"isWindows",void 0),ve(this,"platform",void 0),ve(this,"windowsNoMagicRoot",void 0),ve(this,"regexp",void 0),st(t),r=r||{},this.options=r,this.pattern=t,this.platform=r.platform||Ze,this.isWindows="win32"===this.platform,this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||!1===r.allowWindowsEscape,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!r.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!r.nonegate,this.comment=!1,this.empty=!1,this.partial=!!r.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=void 0!==r.windowsNoMagicRoot?r.windowsNoMagicRoot:!(!this.isWindows||!this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}return we(e,[{key:"hasMagic",value:function(){if(this.options.magicalBraces&&this.set.length>1)return!0;var e,t=ye(this.set);try{for(t.s();!(e=t.n()).done;){var r,n=ye(e.value);try{for(n.s();!(r=n.n()).done;)if("string"!=typeof r.value)return!0}catch(e){n.e(e)}finally{n.f()}}}catch(e){t.e(e)}finally{t.f()}return!1}},{key:"debug",value:function(){}},{key:"make",value:function(){var e=this,t=this.pattern,r=this.options;if(r.nocomment||"#"!==t.charAt(0))if(t){this.parseNegate(),this.globSet=me(new Set(this.braceExpand())),r.debug&&(this.debug=function(){var e;return(e=console).error.apply(e,arguments)}),this.debug(this.pattern,this.globSet);var n=this.globSet.map((function(t){return e.slashSplit(t)}));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);var i=this.globParts.map((function(t,r,n){if(e.isWindows&&e.windowsNoMagicRoot){var i=!(""!==t[0]||""!==t[1]||"?"!==t[2]&&ot.test(t[2])||ot.test(t[3])),a=/^[a-z]:/i.test(t[0]);if(i)return[].concat(me(t.slice(0,4)),me(t.slice(4).map((function(t){return e.parse(t)}))));if(a)return[t[0]].concat(me(t.slice(1).map((function(t){return e.parse(t)}))))}return t.map((function(t){return e.parse(t)}))}));if(this.debug(this.pattern,i),this.set=i.filter((function(e){return-1===e.indexOf(!1)})),this.isWindows)for(var a=0;a=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):e=i>=1?this.levelOneOptimize(e):this.adjascentGlobstarOptimize(e),e}},{key:"adjascentGlobstarOptimize",value:function(e){return e.map((function(e){for(var t=-1;-1!==(t=e.indexOf("**",t+1));){for(var r=t;"**"===e[r+1];)r++;r!==t&&e.splice(t,r-t)}return e}))}},{key:"levelOneOptimize",value:function(e){return e.map((function(e){return 0===(e=e.reduce((function(e,t){var r=e[e.length-1];return"**"===t&&"**"===r?e:".."===t&&r&&".."!==r&&"."!==r&&"**"!==r?(e.pop(),e):(e.push(t),e)}),[])).length?[""]:e}))}},{key:"levelTwoFileOptimize",value:function(e){Array.isArray(e)||(e=this.slashSplit(e));var t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(var r=1;ra&&i.splice(a+1,s-a);var o=i[a+1],c=i[a+2],u=i[a+3];if(".."===o&&c&&"."!==c&&".."!==c&&u&&"."!==u&&".."!==u){t=!0,i.splice(a,1);var l=i.slice(0);l[a]="**",e.push(l),a--}}if(!this.preserveMultipleSlashes){for(var h=1;h2&&void 0!==arguments[2]&&arguments[2],n=0,i=0,a=[],s="";n2&&void 0!==arguments[2]&&arguments[2],n=this.options;if(this.isWindows){var i=""===e[0]&&""===e[1]&&"?"===e[2]&&"string"==typeof e[3]&&/^[a-z]:$/i.test(e[3]),a=""===t[0]&&""===t[1]&&"?"===t[2]&&"string"==typeof t[3]&&/^[a-z]:$/i.test(t[3]);if(i&&a){var s=e[3],o=t[3];s.toLowerCase()===o.toLowerCase()&&(e[3]=o)}else if(a&&"string"==typeof e[0]){var c=t[3],u=e[0];c.toLowerCase()===u.toLowerCase()&&(t[3]=u,t=t.slice(3))}else if(i&&"string"==typeof t[0]){var l=e[3];l.toLowerCase()===t[0].toLowerCase()&&(t[0]=l,e=e.slice(3))}}var h=this.options.optimizationLevel;(void 0===h?1:h)>=2&&(e=this.levelTwoFileOptimize(e)),this.debug("matchOne",this,{file:e,pattern:t}),this.debug("matchOne",e.length,t.length);for(var p=0,f=0,d=e.length,g=t.length;p>> no match, partial?",e,v,t,b),v!==d))}var w=void 0;if("string"==typeof m?(w=y===m,this.debug("string match",m,y,w)):(w=m.test(y),this.debug("pattern match",m,y,w)),!w)return!1}if(p===d&&f===g)return!0;if(p===d)return r;if(f===g)return p===d-1&&""===e[p];throw new Error("wtf?")}},{key:"braceExpand",value:function(){return at(this.pattern,this.options)}},{key:"parse",value:function(e){var t=this;st(e);var r,n=this.options;if("**"===e)return Xe;if(""===e)return"";var i=null;(r=e.match(Be))?i=n.dot?qe:Ue:(r=e.match(Ie))?i=(n.nocase?n.dot?Re:je:n.dot?Ne:Oe)(r[1]):(r=e.match(ze))?i=(n.nocase?n.dot?He:We:n.dot?Ge:Ke)(r):(r=e.match(Le))?i=n.dot?De:Ve:(r=e.match(Me))&&(i=Fe);for(var a,s,o="",c=!1,u=!1,l=[],h=[],p=!1,f=!1,d="."===e.charAt(0),g=n.dot||d,m=function(e){return"."===e.charAt(0)?"":n.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)"},y=function(){if(p){switch(p){case"*":o+=et,c=!0;break;case"?":o+=Ye,c=!0;break;default:o+="\\"+p}t.debug("clearStateChar %j %j",p,o),p=!1}},v=0;v-1;I--){for(var O=h[I],N=o.slice(0,O.reStart),j=o.slice(O.reStart,O.reEnd-8),R=o.slice(O.reEnd),L=o.slice(O.reEnd-8,O.reEnd)+R,V=N.split(")").length,D=N.split("(").length-V,M=R,F=0;F1&&void 0!==arguments[1]?arguments[1]:this.partial;if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return""===e;if("/"===e&&t)return!0;var r=this.options;this.isWindows&&(e=e.split("\\").join("/"));var n=this.slashSplit(e);this.debug(this.pattern,"split",n);var i=this.set;this.debug(this.pattern,"set",i);var a=n[n.length-1];if(!a)for(var s=n.length-2;!a&&s>=0;s--)a=n[s];for(var o=0;o1&&void 0!==arguments[1]?arguments[1]:"","Invalid response: ").concat(e.status," ").concat(e.statusText));return t.status=e.status,t.response=e,t}function ht(e,t){var r=t.status;if(401===r&&e.digest)return t;if(r>=400)throw lt(t);return t}function pt(e,t){return arguments.length>2&&void 0!==arguments[2]&&arguments[2]?{data:t,headers:e.headers?Z(e.headers):{},status:e.status,statusText:e.statusText}:t}Pe.Minimatch=ut,Pe.escape=function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).windowsPathsNoEscape;return void 0!==t&&t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&")},Pe.unescape=function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).windowsPathsNoEscape;return void 0!==t&&t?e.replace(/\[([^\/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1")};var ft,dt=function(e){return function(){for(var t=[],r=0;r3&&void 0!==arguments[3]?arguments[3]:{},s=ce({url:A(e.remoteURL,b(t)),method:"COPY",headers:{Destination:A(e.remoteURL,b(r))}},e,a);return i=function(t){ht(e,t)},(n=oe(s))&&n.then||(n=Promise.resolve(n)),i?n.then(i):n})),gt=nr(5),mt=nr(421),yt=nr.n(mt);function vt(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r2&&void 0!==arguments[2]?arguments[2]:ft.Original,n=yt().get(e,t);return"array"===r&&!1===Array.isArray(n)?[n]:"object"===r&&Array.isArray(n)?n[0]:n}function wt(e){return new Promise((function(t){t(function(e){var t=e.multistatus;if(""===t)return{multistatus:{response:[]}};if(!t)throw new Error("Invalid response: No root multistatus found");var r={multistatus:Array.isArray(t)?t[0]:t};return yt().set(r,"multistatus.response",xt(r,"multistatus.response",ft.Array)),yt().set(r,"multistatus.response",yt().get(r,"multistatus.response").map((function(e){return function(e){var t=Object.assign({},e);return t.status?yt().set(t,"status",xt(t,"status",ft.Object)):(yt().set(t,"propstat",xt(t,"propstat",ft.Object)),yt().set(t,"propstat.prop",xt(t,"propstat.prop",ft.Object))),t}(e)}))),r}(new gt.XMLParser({removeNSPrefix:!0,numberParseOptions:{hex:!0,leadingZeros:!1}}).parse(e)))}))}function At(e,t){var r,n,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=e.getlastmodified,s=void 0===a?null:a,o=e.getcontentlength,c=void 0===o?"0":o,u=e.resourcetype,l=void 0===u?null:u,h=e.getcontenttype,p=void 0===h?null:h,f=e.getetag,d=void 0===f?null:f,g=l&&"object"===bt(l)&&void 0!==l.collection?"directory":"file",y=(r=t,(n=document.createElement("textarea")).innerHTML=r,n.value),v={filename:y,basename:m().basename(y),lastmod:s,size:parseInt(c,10),type:g,etag:"string"==typeof d?d.replace(/"/g,""):null};return"file"===g&&(v.mime=p&&"string"==typeof p?p.split(";")[0]:""),i&&(v.props=e),v}function kt(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=null;try{e.multistatus.response[0].propstat&&(n=e.multistatus.response[0])}catch(e){}if(!n)throw new Error("Failed getting item stat: bad response");var i,a=n.propstat,s=a.prop,o=(3,function(e){if(Array.isArray(e))return e}(i=a.status.split(" ",3))||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,a=[],s=!0,o=!1;try{for(r=r.call(e);!(s=(n=r.next()).done)&&(a.push(n.value),3!==a.length);s=!0);}catch(e){o=!0,i=e}finally{try{s||null==r.return||r.return()}finally{if(o)throw i}}return a}}(i)||function(e,t){if(e){if("string"==typeof e)return vt(e,3);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?vt(e,3):void 0}}(i)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),c=(o[0],o[1]),u=o[2],l=parseInt(c,10);if(l>=400){var h=new Error("Invalid response: ".concat(l," ").concat(u));throw h.status=l,h}return At(s,w(t),r)}function St(e){switch(e.toString()){case"-3":return"unlimited";case"-2":case"-1":return"unknown";default:return parseInt(e,10)}}function Et(e,t,r){return r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}!function(e){e.Array="array",e.Object="object",e.Original="original"}(ft||(ft={}));var _t=function(e){return function(){for(var t=[],r=0;r2&&void 0!==arguments[2]?arguments[2]:{},n=r.details,i=void 0!==n&&n,a=ce({url:A(e.remoteURL,b(t)),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:"0"}},e,r);return Et(oe(a),(function(r){return ht(e,r),Et(r.text(),(function(e){return Et(wt(e),(function(e){var n=kt(e,t,i);return pt(r,n,i)}))}))}))}));function Ct(e,t,r){return r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function Pt(e){return function(){for(var t=[],r=0;r2&&void 0!==arguments[2]?arguments[2]:{},n=function(e){if(!e||"/"===e)return[];var t=e,r=[];do{r.push(t),t=m().dirname(t)}while(t&&"/"!==t);return r}(w(t));n.sort((function(e,t){return e.length>t.length?1:t.length>e.length?-1:0}));var i=!1;return function(e,t,r){if("function"==typeof e[Ot]){var n,i,a,s=e[Ot]();if(function e(r){try{for(;!(n=s.next()).done;)if((r=t(n.value))&&r.then){if(!Rt(r))return void r.then(e,a||(a=Nt.bind(null,i=new jt,2)));r=r.v}i?Nt(i,1,r):i=r}catch(e){Nt(i||(i=new jt),2,e)}}(),s.return){var o=function(e){try{n.done||s.return()}catch(e){}return e};if(i&&i.then)return i.then(o,(function(e){throw o(e)}));o()}return i}if(!("length"in e))throw new TypeError("Object is not iterable");for(var c=[],u=0;u2&&void 0!==arguments[2]?arguments[2]:{};if(!0===r.recursive)return Mt(e,t,r);var n,i=ce({url:A(e.remoteURL,(n=b(t),n.endsWith("/")?n:n+"/")),method:"MKCOL"},e,r);return Ct(oe(i),(function(t){ht(e,t)}))})),Bt=nr(227),Ut=nr.n(Bt);function qt(e){return qt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qt(e)}var zt=function(e){return function(){for(var t=[],r=0;r2&&void 0!==arguments[2]?arguments[2]:{},n={};if("object"===qt(r.range)&&"number"==typeof r.range.start){var i="bytes=".concat(r.range.start,"-");"number"==typeof r.range.end&&(i="".concat(i).concat(r.range.end)),n.Range=i}var a,s,o=ce({url:A(e.remoteURL,b(t)),method:"GET",headers:n},e,r);return s=function(t){if(ht(e,t),n.Range&&206!==t.status){var i=new Error("Invalid response code for partial request: ".concat(t.status));throw i.status=t.status,i}return r.callback&&setTimeout((function(){r.callback(t)}),0),t.body},(a=oe(o))&&a.then||(a=Promise.resolve(a)),s?a.then(s):a})),Wt=function(){},Ht=function(e){return function(){for(var t=[],r=0;r2&&void 0!==arguments[2]?arguments[2]:{},a=ce({url:A(e.remoteURL,b(t)),method:"DELETE"},e,i);return n=function(t){ht(e,t)},(r=oe(a))&&r.then||(r=Promise.resolve(r)),n?r.then(n):r})),Kt=function(e){return function(){for(var t=[],r=0;r2&&void 0!==arguments[2]?arguments[2]:{};return function(n,i){try{var a=(s=_t(e,t,r),o=function(){return!0},s&&s.then||(s=Promise.resolve(s)),o?s.then(o):s)}catch(e){return i(e)}var s,o;return a&&a.then?a.then(void 0,i):a}(0,(function(e){if(404===e.status)return!1;throw e}))}));function $t(e,t,r){return r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}var Jt=function(e){return function(){for(var t=[],r=0;r2&&void 0!==arguments[2]?arguments[2]:{},n=ce({url:A(e.remoteURL,b(t),"/"),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:r.deep?"infinity":"1"}},e,r);return $t(oe(n),(function(n){return ht(e,n),$t(n.text(),(function(i){if(!i)throw new Error("Failed parsing directory contents: Empty response");return $t(wt(i),(function(i){var a=x(t),s=function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=m().join(t,"/"),s=e.multistatus.response.map((function(e){var t=function(e){try{return e.replace(/^https?:\/\/[^\/]+/,"")}catch(e){throw new f(e,"Failed normalising HREF")}}(e.href);return At(e.propstat.prop,"/"===a?decodeURIComponent(w(t)):decodeURIComponent(w(m().relative(a,t))),n)}));return i?s:s.filter((function(e){return e.basename&&("file"===e.type||e.filename!==r.replace(/\/$/,""))}))}(i,x(e.remoteBasePath||e.remotePath),a,r.details,r.includeSelf);return r.glob&&(s=function(e,t){return e.filter((function(e){return Te(e.filename,t,{matchBase:!0})}))}(s,r.glob)),pt(n,s,r.details)}))}))}))}));function Zt(e){return function(){for(var t=[],r=0;r2&&void 0!==arguments[2]?arguments[2]:{},n=ce({url:A(e.remoteURL,b(t)),method:"GET",headers:{Accept:"text/plain"},transformResponse:[tr]},e,r);return Qt(oe(n),(function(t){return ht(e,t),Qt(t.text(),(function(e){return pt(t,e,r.details)}))}))}));function Qt(e,t,r){return r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}var Yt=Zt((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=ce({url:A(e.remoteURL,b(t)),method:"GET"},e,r);return Qt(oe(n),(function(t){var n;return ht(e,t),function(e,t){var r=e();return r&&r.then?r.then(t):t()}((function(){return Qt(t.arrayBuffer(),(function(e){n=e}))}),(function(){return pt(t,n,r.details)}))}))})),er=Zt((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.format,i=void 0===n?"binary":n;if("binary"!==i&&"text"!==i)throw new f({info:{code:I.InvalidOutputFormat}},"Invalid output format: ".concat(i));return"text"===i?Xt(e,t,r):Yt(e,t,r)})),tr=function(e){return e};function rr(e){return rr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rr(e)}function ar(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function sr(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function or(e){return new gt.XMLBuilder({attributeNamePrefix:"@_",format:!0,ignoreAttributes:!1,suppressEmptyNode:!0}).build(cr({lockinfo:{"@_xmlns:d":"DAV:",lockscope:{exclusive:{}},locktype:{write:{}},owner:{href:e}}},"d"))}function cr(e,t){var r=function(e){for(var t=1;t3&&void 0!==arguments[3]?arguments[3]:{},i=ce({url:A(e.remoteURL,b(t)),method:"UNLOCK",headers:{"Lock-Token":r}},e,n);return ur(oe(i),(function(t){if(ht(e,t),204!==t.status&&200!==t.status)throw lt(t)}))})),pr=lr((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.refreshToken,i=r.timeout,a={Accept:"text/plain,application/xml",Timeout:void 0===i?fr:i};n&&(a.If=n);var s=ce({url:A(e.remoteURL,b(t)),method:"LOCK",headers:a,data:or(e.contactHref)},e,r);return ur(oe(s),(function(t){return ht(e,t),ur(t.text(),(function(e){var r,n=(r=e,new gt.XMLParser({removeNSPrefix:!0,parseAttributeValue:!0,parseTagValue:!0}).parse(r)),i=yt().get(n,"prop.lockdiscovery.activelock.locktoken.href"),a=yt().get(n,"prop.lockdiscovery.activelock.timeout");if(!i)throw lt(t,"No lock token received: ");return{token:i,serverTimeout:a}}))}))})),fr="Infinite, Second-4100000000";function dr(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]?arguments[1]:{},r=t.path||"/",n=ce({url:A(e.remoteURL,r),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:"0"}},e,t);return gr(oe(n),(function(r){return ht(e,r),gr(r.text(),(function(e){return gr(wt(e),(function(e){var n=function(e){try{var t=(i=e.multistatus.response,1,function(e){if(Array.isArray(e))return e}(i)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,a=[],s=!0,o=!1;try{for(r=r.call(e);!(s=(n=r.next()).done)&&(a.push(n.value),1!==a.length);s=!0);}catch(e){o=!0,i=e}finally{try{s||null==r.return||r.return()}finally{if(o)throw i}}return a}}(i)||function(e,t){if(e){if("string"==typeof e)return dr(e,1);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?dr(e,1):void 0}}(i)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0].propstat.prop,r=t["quota-used-bytes"],n=t["quota-available-bytes"];return void 0!==r&&void 0!==n?{used:parseInt(r,10),available:St(n)}:null}catch(e){}var i;return null}(e);return pt(r,n,t.details)}))}))}))}));function yr(e,t,r){return r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}var vr=function(e){return function(){for(var t=[],r=0;r2&&void 0!==arguments[2]?arguments[2]:{},n=r.details,i=void 0!==n&&n,a=ce({url:A(e.remoteURL,b(t)),method:"SEARCH",headers:{Accept:"text/plain,application/xml","Content-Type":e.headers["Content-Type"]||"application/xml; charset=utf-8"}},e,r);return yr(oe(a),(function(r){return ht(e,r),yr(r.text(),(function(e){return yr(wt(e),(function(e){var n=function(e,t,r){var n={truncated:!1,results:[]};return n.truncated=e.multistatus.response.some((function(e){var r,n;return"507"===(null===(r=(e.status||(null===(n=e.propstat)||void 0===n?void 0:n.status)).split(" ",3))||void 0===r?void 0:r[1])&&e.href.replace(/\/$/,"").endsWith(b(t).replace(/\/$/,""))})),e.multistatus.response.forEach((function(e){if(void 0!==e.propstat){var t=e.href.split("/").map(decodeURIComponent).join("/");n.results.push(At(e.propstat.prop,t,r))}})),n}(e,t,i);return pt(r,n,i)}))}))}))})),br=function(e){return function(){for(var t=[],r=0;r3&&void 0!==arguments[3]?arguments[3]:{},s=ce({url:A(e.remoteURL,b(t)),method:"MOVE",headers:{Destination:A(e.remoteURL,b(r))}},e,a);return i=function(t){ht(e,t)},(n=oe(s))&&n.then||(n=Promise.resolve(n)),i?n.then(i):n})),xr=nr(918),wr=function(e){return function(){for(var t=[],r=0;r3&&void 0!==arguments[3]?arguments[3]:{},i=n.contentLength,a=void 0===i||i,s=n.overwrite,o=void 0===s||s,c={"Content-Type":"application/octet-stream"};!1===a||(c["Content-Length"]="".concat("number"==typeof a?a:function(e){if(ee(e))return e.byteLength;if(te(e))return e.length;if("string"==typeof e)return(0,xr.k)(e);throw new f({info:{code:I.DataTypeNoLength}},"Cannot calculate data length: Invalid type")}(r))),o||(c["If-None-Match"]="*");var u,l,h=ce({url:A(e.remoteURL,b(t)),method:"PUT",headers:c,data:r},e,n);return l=function(t){try{ht(e,t)}catch(e){var r=e;if(412!==r.status||o)throw r;return!1}return!0},(u=oe(h))&&u.then||(u=Promise.resolve(u)),l?u.then(l):u})),Ar="https://github.com/perry-mitchell/webdav-client/blob/master/LOCK_CONTACT.md";function kr(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.authType,i=void 0===n?null:n,a=r.remoteBasePath,s=r.contactHref,o=void 0===s?Ar:s,c=r.ha1,u=r.headers,l=void 0===u?{}:u,h=r.httpAgent,p=r.httpsAgent,d=r.password,g=r.token,m=r.username,y=r.withCredentials,v=i;v||(v=m||d?T.Password:T.None);var x,k,S={authType:v,remoteBasePath:a,contactHref:o,ha1:c,headers:Object.assign({},l),httpAgent:h,httpsAgent:p,password:d,remotePath:(x=e,k=new(t())(x).pathname,k.length<=0&&(k="/"),w(k)),remoteURL:e,token:g,username:m,withCredentials:y};return function(e,t,r,n,i){switch(e.authType){case T.Digest:e.digest=function(e,t,r){return{username:e,password:t,ha1:r,nc:0,algorithm:"md5",hasDigestAuth:!1}}(t,r,i);break;case T.None:break;case T.Password:e.headers.Authorization=function(e,t){var r,n=(r="".concat(e,":").concat(t),C().encode(r));return"Basic ".concat(n)}(t,r);break;case T.Token:e.headers.Authorization="".concat((a=n).token_type," ").concat(a.access_token);break;default:throw new f({info:{code:I.InvalidAuthType}},"Invalid auth type: ".concat(e.authType))}var a}(S,m,d,g,c),{copyFile:function(e,t,r){return dt(S,e,t,r)},createDirectory:function(e,t){return Ft(S,e,t)},createReadStream:function(e,t){return function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=new(0,Ut().PassThrough);return zt(e,t,r).then((function(e){e.pipe(n)})).catch((function(e){n.emit("error",e)})),n}(S,e,t)},createWriteStream:function(e,t,r){return function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Wt,i=new(0,Ut().PassThrough),a={};!1===r.overwrite&&(a["If-None-Match"]="*");var s=ce({url:A(e.remoteURL,b(t)),method:"PUT",headers:a,data:i,maxRedirects:0},e,r);return oe(s).then((function(t){return ht(e,t)})).then((function(e){setTimeout((function(){n(e)}),0)})).catch((function(e){i.emit("error",e)})),i}(S,e,t,r)},customRequest:function(e,t){return Ht(S,e,t)},deleteFile:function(e,t){return Gt(S,e,t)},exists:function(e,t){return Kt(S,e,t)},getDirectoryContents:function(e,t){return Jt(S,e,t)},getFileContents:function(e,t){return er(S,e,t)},getFileDownloadLink:function(e){return function(e,t){var r=A(e.remoteURL,b(t)),n=/^https:/i.test(r)?"https":"http";switch(e.authType){case T.None:break;case T.Password:var i=P(e.headers.Authorization.replace(/^Basic /i,"").trim());r=r.replace(/^https?:\/\//,"".concat(n,"://").concat(i,"@"));break;default:throw new f({info:{code:I.LinkUnsupportedAuthType}},"Unsupported auth type for file link: ".concat(e.authType))}return r}(S,e)},getFileUploadLink:function(e){return function(e,t){var r="".concat(A(e.remoteURL,b(t)),"?Content-Type=application/octet-stream"),n=/^https:/i.test(r)?"https":"http";switch(e.authType){case T.None:break;case T.Password:var i=P(e.headers.Authorization.replace(/^Basic /i,"").trim());r=r.replace(/^https?:\/\//,"".concat(n,"://").concat(i,"@"));break;default:throw new f({info:{code:I.LinkUnsupportedAuthType}},"Unsupported auth type for file link: ".concat(e.authType))}return r}(S,e)},getHeaders:function(){return Object.assign({},S.headers)},getQuota:function(e){return mr(S,e)},lock:function(e,t){return pr(S,e,t)},moveFile:function(e,t,r){return br(S,e,t,r)},putFileContents:function(e,t,r){return wr(S,e,t,r)},search:function(e,t){return vr(S,e,t)},setHeaders:function(e){S.headers=Object.assign({},e)},stat:function(e,t){return _t(S,e,t)},unlock:function(e,t,r){return hr(S,e,t,r)}}}})();var ar=ir.eI;(0,ir.lD)().patch("request",(e=>$t(e.url,{method:e.method,headers:e.headers,body:e.data})));const sr=async(e,t)=>{let{syncUrl:r,syncKey:n}=t;return r=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=e.length;for(;n>e.length-r&&e[n-1]===t;)n--;return e.slice(0,n)}(r,"/"),await(async(e,t,r)=>er(e,{headers:{"Content-type":"application/json",Authorization:"Bearer ".concat(await Gt(t,"KISS-Translator-SYNC"))},method:"POST",body:JSON.stringify(r)}))("".concat(r,"/sync"),n,e)},or=async(e,t)=>{const{syncType:r,syncUrl:n,syncUser:i,syncKey:a,syncMeta:s={}}=await at();if(!n||!a||r===Ue&&!i)return;let{updateAt:o=0,syncAt:c=0}=s[e]||{};0===c&&(o=0);const u=await t(),l={key:e,value:JSON.stringify(u),updateAt:o},h={syncUrl:n,syncUser:i,syncKey:a},p=r===Ue?await(async(e,t)=>{let{syncUrl:r,syncUser:n,syncKey:i}=t;const a=ar(r,{username:n,password:i}),s="/".concat(v),o="/".concat(v,"/").concat(e.key);if(!1===await a.exists(s)&&await a.createDirectory(s),await a.exists(o)){const t=await a.getFileContents(o,{format:"text"}),r=JSON.parse(t);if(r.updateAt>=e.updateAt)return r}return await a.putFileContents(o,JSON.stringify(e,null,2)),e})(l,h):await sr(l,h);return s[e]={updateAt:p.updateAt,syncAt:Date.now()},await st({syncMeta:s}),{value:JSON.parse(p.value),isNew:p.updateAt>o}},cr=async()=>{const e=await or("kiss-setting.json",tt);null!==e&&void 0!==e&&e.isNew&&await(e=>Xe(A,e))(e.value)},ur=async()=>{const e=await or("kiss-rules.json",rt);null!==e&&void 0!==e&&e.isNew&&await nt(e.value)},lr=async()=>{try{await ur()}catch(e){$e(e,"sync user rules")}},hr=async()=>{const e=await or("kiss-words.json",it);null!==e&&void 0!==e&&e.isNew&&await(e=>Xe(S,e))(e.value)},pr=async()=>{await(async()=>{try{await cr()}catch(e){$e(e,"sync setting")}})(),await lr(),await(async()=>{try{await hr()}catch(e){$e(e,"sync fav words")}})()},fr=async e=>{const t=await rt(),r=t.find((t=>((e,t)=>{if(0===e.length||0===t.length)return!1;t="*"+t+"*";let[r,n]=[0,0],[i,a]=[-1,-1];for(;r{const{dataCaches:t={}}=await at();t[e]=Date.now(),await st({dataCaches:t})},gr=async e=>{const t=await(e=>er(e))(e),r=(e=>{if("string"===Ht(e)&&(e=JSON.parse(e)),"array"!==Ht(e))throw new Error("data error");const t=ue.map((e=>e[0])),r=ce.map((e=>e[0])),n=new Set;return e.filter((e=>"object"===Ht(e))).filter((e=>{let{pattern:t}=e;return"string"===Ht(t)&&!n.has(t.trim())&&(n.add(t.trim()),!0)})).map((e=>{let{pattern:n,selector:i,keepSelector:a,terms:s,selectStyle:o,parentStyle:l,injectJs:h,injectCss:p,translator:f,fromLang:d,toLang:g,textStyle:m,transOpen:y,bgColor:v,textDiyStyle:b,transOnly:x,transTiming:w,transTag:A,transTitle:k,detectRemote:S,skipLangs:E,fixerSelector:_,fixerFunc:C,transStartHook:P,transEndHook:T,transRemoveHook:I}=e;return{pattern:n.trim(),selector:"string"===Ht(i)?i:"",keepSelector:"string"===Ht(a)?a:"",terms:"string"===Ht(s)?s:"",selectStyle:"string"===Ht(o)?o:"",parentStyle:"string"===Ht(l)?l:"",injectJs:"string"===Ht(h)?h:"",injectCss:"string"===Ht(p)?p:"",bgColor:"string"===Ht(v)?v:"",textDiyStyle:"string"===Ht(b)?b:"",translator:zt([u,...oe],f),fromLang:zt([u,...t],d),toLang:zt([u,...r],g),textStyle:zt([u,...ve],m),transOpen:zt([u,"true","false"],y),transOnly:zt([u,"true","false"],x),transTiming:zt([u,...xe],w),transTag:zt([u,"span","font"],A),transTitle:zt([u,"true","false"],k),detectRemote:zt([u,"true","false"],S),skipLangs:"array"===Ht(E)?E:[],fixerSelector:"string"===Ht(_)?_:"",transStartHook:"string"===Ht(P)?P:"",transEndHook:"string"===Ht(T)?T:"",transRemoveHook:"string"===Ht(I)?I:"",fixerFunc:zt([u,...c],C)}}))})(t).filter((e=>{let{pattern:t}=e;return!Wt(t,u)}));return r.length>0&&await((e,t)=>Xe(_+e,t))(e,r),r},mr=async e=>{let{subrulesList:t}=e;try{const{subRulesSyncAt:e}=await at(),r=Date.now();r-e>864e5&&(await(async e=>{for(const r of e)try{await gr(r.url),await dr(r.url)}catch(t){$e(t,"sync subrule error: ".concat(r.url))}})(t),await st({subRulesSyncAt:r}))}catch(r){$e(r,"try sync all subrules")}},yr=e=>{var t;const r=document.createElement("script");r.setAttribute("data-source","KISS-Calendar injectInlineJs"),r.setAttribute("type","text/javascript"),r.textContent=e,null===(t=document.body)||void 0===t||t.appendChild(r)},vr=e=>{var t;const r=document.createElement("style");r.setAttribute("data-source","KISS-Calendar injectInternalCss"),r.textContent=e,null===(t=document.head)||void 0===t||t.appendChild(r)};globalThis.ContextType="BACKGROUND";const br=["content-security-policy","content-security-policy-report-only","x-webkit-csp","x-content-security-policy"];async function xr(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;try{await n().menus.removeAll()}catch(t){}switch(e){case 1:n().menus.create({id:C,title:n().i18n.getMessage("app_name"),contexts:["page","selection"]});break;case 2:n().menus.create({id:C,title:n().i18n.getMessage("toggle_translate"),contexts:["page","selection"]}),n().menus.create({id:P,title:n().i18n.getMessage("toggle_style"),contexts:["page","selection"]}),n().menus.create({id:I,title:n().i18n.getMessage("open_tranbox"),contexts:["page","selection"]}),n().menus.create({id:"options_separator",type:"separator",contexts:["page","selection"]}),n().menus.create({id:T,title:n().i18n.getMessage("open_options"),contexts:["page","selection"]})}}async function wr(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:De.join(",\n");try{const t=e.split(/\n|,/).map((e=>e.trim())).filter(Boolean).map(((e,t)=>({id:t+1,action:{type:"modifyHeaders",responseHeaders:br.map((e=>({operation:"remove",header:e})))},condition:{urlFilter:e,resourceTypes:["main_frame","sub_frame"]}}))),r=(await n().declarativeNetRequest.getDynamicRules()).map((e=>e.id));await n().declarativeNetRequest.updateDynamicRules({removeRuleIds:r,addRules:t})}catch(t){$e(t,"update csp rules")}}n().runtime.onInstalled.addListener((()=>{(async()=>{try{await Qe(A,Me),await Qe(k,Fe),await Qe(E,qe),await Qe("".concat(_).concat("https://fishjar.github.io/kiss-rules/kiss-rules.json"),m)}catch(e){$e(e,"init default")}})(),xr(),wr()})),n().runtime.onStartup.addListener((async()=>{await pr();const{clearCache:e,contextMenuType:t,subrulesList:r,csplist:n}=await tt();e&&(async()=>{try{caches.delete(N)}catch(e){$e(e,"clean caches")}})(),xr(t),wr(n),mr({subrulesList:r})})),n().runtime.onMessage.addListener((async e=>{let{action:t,args:r}=e;switch(t){case j:return await Xt(r);case R:const{input:e,init:i}=r;return await Zt(e,i);case"open_options":return await n().runtime.openOptionsPage();case"save_rule":return await fr(r);case"inject_js":return await n().scripting.executeScript({target:{tabId:await Nt(),allFrames:!0},func:yr,args:[r],world:"MAIN"});case"inject_css":return await n().scripting.executeScript({target:{tabId:await Nt(),allFrames:!0},func:vr,args:[r],world:"MAIN"});case"update_csp":return await wr(r);case"context_menus":return await xr(r);case"command_shortcuts":return await n().commands.getAll();default:throw new Error("message action is unavailable: ".concat(t))}})),n().commands.onCommand.addListener((e=>{switch(e){case C:Rt(L);break;case I:Rt(D);break;case P:Rt(V);break;case T:n().runtime.openOptionsPage()}})),n().menus.onClicked.addListener((e=>{let{menuItemId:t}=e;switch(t){case C:Rt(L);break;case P:Rt(V);break;case I:Rt(D);break;case T:n().runtime.openOptionsPage()}}))})() +import browser from "webextension-polyfill"; +import { + MSG_FETCH, + MSG_GET_HTTPCACHE, + MSG_TRANS_TOGGLE, + MSG_OPEN_OPTIONS, + MSG_SAVE_RULE, + MSG_TRANS_TOGGLE_STYLE, + MSG_OPEN_TRANBOX, + MSG_CONTEXT_MENUS, + MSG_COMMAND_SHORTCUTS, + MSG_INJECT_JS, + MSG_INJECT_CSS, + MSG_UPDATE_CSP, + DEFAULT_CSPLIST, + CMD_TOGGLE_TRANSLATE, + CMD_TOGGLE_STYLE, + CMD_OPEN_OPTIONS, + CMD_OPEN_TRANBOX, +} from "./config"; +import { getSettingWithDefault, tryInitDefaultData } from "./libs/storage"; +import { trySyncSettingAndRules } from "./libs/sync"; +import { fetchHandle, getHttpCache } from "./libs/fetch"; +import { sendTabMsg } from "./libs/msg"; +import { trySyncAllSubRules } from "./libs/subRules"; +import { tryClearCaches } from "./libs"; +import { saveRule } from "./libs/rules"; +import { getCurTabId } from "./libs/msg"; +import { injectInlineJs, injectInternalCss } from "./libs/injector"; +import { kissLog } from "./libs/log"; + +globalThis.ContextType = "BACKGROUND"; + +const REMOVE_HEADERS = [ + `content-security-policy`, + `content-security-policy-report-only`, + `x-webkit-csp`, + `x-content-security-policy`, +]; + +/** + * 添加右键菜单 + */ +async function addmenus(contextMenuType = 1) { + // 添加前先删除,避免重复ID的错误 + try { + await browser.menus.removeAll(); + } catch (err) { + // + } + + switch (contextMenuType) { + case 1: + browser.menus.create({ + id: CMD_TOGGLE_TRANSLATE, + title: browser.i18n.getMessage("app_name"), + contexts: ["page", "selection"], + }); + break; + case 2: + browser.menus.create({ + id: CMD_TOGGLE_TRANSLATE, + title: browser.i18n.getMessage("toggle_translate"), + contexts: ["page", "selection"], + }); + browser.menus.create({ + id: CMD_TOGGLE_STYLE, + title: browser.i18n.getMessage("toggle_style"), + contexts: ["page", "selection"], + }); + browser.menus.create({ + id: CMD_OPEN_TRANBOX, + title: browser.i18n.getMessage("open_tranbox"), + contexts: ["page", "selection"], + }); + browser.menus.create({ + id: "options_separator", + type: "separator", + contexts: ["page", "selection"], + }); + browser.menus.create({ + id: CMD_OPEN_OPTIONS, + title: browser.i18n.getMessage("open_options"), + contexts: ["page", "selection"], + }); + break; + default: + } +} + +/** + * 更新CSP策略 + * @param {*} csplist + */ +async function updateCspRules(csplist = DEFAULT_CSPLIST.join(",\n")) { + try { + const newRules = csplist + .split(/\n|,/) + .map((url) => url.trim()) + .filter(Boolean) + .map((url, idx) => ({ + id: idx + 1, + action: { + type: "modifyHeaders", + responseHeaders: REMOVE_HEADERS.map((header) => ({ + operation: "remove", + header, + })), + }, + condition: { + urlFilter: url, + resourceTypes: ["main_frame", "sub_frame"], + }, + })); + const oldRules = await browser.declarativeNetRequest.getDynamicRules(); + const oldRuleIds = oldRules.map((rule) => rule.id); + await browser.declarativeNetRequest.updateDynamicRules({ + removeRuleIds: oldRuleIds, + addRules: newRules, + }); + } catch (err) { + kissLog(err, "update csp rules"); + } +} + +/** + * 插件安装 + */ +browser.runtime.onInstalled.addListener(() => { + tryInitDefaultData(); + + // 右键菜单 + addmenus(); + + // 禁用CSP + updateCspRules(); +}); + +/** + * 浏览器启动 + */ +browser.runtime.onStartup.addListener(async () => { + // 同步数据 + await trySyncSettingAndRules(); + + const { clearCache, contextMenuType, subrulesList, csplist } = + await getSettingWithDefault(); + + // 清除缓存 + if (clearCache) { + tryClearCaches(); + } + + // 右键菜单 + // firefox重启后菜单会消失,故重复添加 + addmenus(contextMenuType); + + // 禁用CSP + updateCspRules(csplist); + + // 同步订阅规则 + trySyncAllSubRules({ subrulesList }); +}); + +/** + * 监听消息 + */ +browser.runtime.onMessage.addListener(async ({ action, args }) => { + switch (action) { + case MSG_FETCH: + return await fetchHandle(args); + case MSG_GET_HTTPCACHE: + const { input, init } = args; + return await getHttpCache(input, init); + case MSG_OPEN_OPTIONS: + return await browser.runtime.openOptionsPage(); + case MSG_SAVE_RULE: + return await saveRule(args); + case MSG_INJECT_JS: + return await browser.scripting.executeScript({ + target: { tabId: await getCurTabId(), allFrames: true }, + func: injectInlineJs, + args: [args], + world: "MAIN", + }); + case MSG_INJECT_CSS: + return await browser.scripting.executeScript({ + target: { tabId: await getCurTabId(), allFrames: true }, + func: injectInternalCss, + args: [args], + world: "MAIN", + }); + case MSG_UPDATE_CSP: + return await updateCspRules(args); + case MSG_CONTEXT_MENUS: + return await addmenus(args); + case MSG_COMMAND_SHORTCUTS: + return await browser.commands.getAll(); + default: + throw new Error(`message action is unavailable: ${action}`); + } +}); + +/** + * 监听快捷键 + */ +browser.commands.onCommand.addListener((command) => { + // console.log(`Command: ${command}`); + switch (command) { + case CMD_TOGGLE_TRANSLATE: + sendTabMsg(MSG_TRANS_TOGGLE); + break; + case CMD_OPEN_TRANBOX: + sendTabMsg(MSG_OPEN_TRANBOX); + break; + case CMD_TOGGLE_STYLE: + sendTabMsg(MSG_TRANS_TOGGLE_STYLE); + break; + case CMD_OPEN_OPTIONS: + browser.runtime.openOptionsPage(); + break; + default: + } +}); + +/** + * 监听右键菜单 + */ +browser.menus.onClicked.addListener(({ menuItemId }) => { + switch (menuItemId) { + case CMD_TOGGLE_TRANSLATE: + sendTabMsg(MSG_TRANS_TOGGLE); + break; + case CMD_TOGGLE_STYLE: + sendTabMsg(MSG_TRANS_TOGGLE_STYLE); + break; + case CMD_OPEN_TRANBOX: + sendTabMsg(MSG_OPEN_TRANBOX); + break; + case CMD_OPEN_OPTIONS: + browser.runtime.openOptionsPage(); + break; + default: + } +}); +/** + * 邮件显示中注册脚本 + */ async function registerMsgDisplayScript() { await messenger.messageDisplayScripts.register({ js: [{file: "/content.js"}] }); } - registerMsgDisplayScript(); -})(); \ No newline at end of file +registerMsgDisplayScript();