{"ScriptPreparationCode":"window.rfc2396 = (function () {\r\nfunction isURI (input) {\r\n return URI_reference(input, 0) === input.length\r\n}\r\n\r\n// URI-reference = [ absoluteURI | relativeURI ] [ \u0022#\u0022 fragment ]\r\nfunction URI_reference (input, next) {\r\n var next2 = absoluteURI(input, next) || relativeURI(input, next)\r\n if (next2) {\r\n if (input.charAt(next2) === \u0027#\u0027) {\r\n return fragment(input, next2 \u002B 1) || next2\r\n }\r\n return next2\r\n }\r\n if (input.charAt(next) === \u0027#\u0027) {\r\n return fragment(input, next \u002B 1) || next\r\n }\r\n return next\r\n}\r\n\r\n// absoluteURI = scheme \u0022:\u0022 ( hier_part | opaque_part )\r\nfunction absoluteURI (input, next) {\r\n next = scheme(input, next)\r\n if (next \u0026\u0026 input.charAt(next) === \u0027:\u0027) {\r\n return hier_part(input, \u002B\u002Bnext) || opaque_part(input, next)\r\n }\r\n}\r\n\r\n// relativeURI = ( net_path | abs_path | rel_path ) [ \u0022?\u0022 query ]\r\nfunction relativeURI (input, next) {\r\n next = net_path(input, next) || abs_path(input, next) ||\r\n rel_path(input, next)\r\n if (next \u0026\u0026 input.charAt(next) === \u0027?\u0027) {\r\n return query(input, next \u002B 1) || next\r\n }\r\n return next\r\n}\r\n\r\n// hier_part = ( net_path | abs_path ) [ \u0022?\u0022 query ]\r\nfunction hier_part (input, next) {\r\n next = net_path(input, next) || abs_path(input, next)\r\n if (next \u0026\u0026 input.charAt(next) === \u0027?\u0027) {\r\n return query(input, next \u002B 1) || next\r\n }\r\n return next\r\n}\r\n\r\n// opaque_part = uric_no_slash *uric\r\nfunction opaque_part (input, next) {\r\n next = uric_no_slash(input, next)\r\n if (next) {\r\n for (;;) {\r\n var next2 = uric(input, next)\r\n if (!next2) {\r\n break\r\n }\r\n next = next2\r\n }\r\n return next\r\n }\r\n}\r\n\r\n// uric_no_slash = unreserved | escaped | \u0022;\u0022 | \u0022?\u0022 | \u0022:\u0022 | \u0022@\u0022 |\r\n// \u0022\u0026\u0022 | \u0022=\u0022 | \u0022\u002B\u0022 | \u0022$\u0022 | \u0022,\u0022\r\nfunction uric_no_slash (input, next) {\r\n return unreserved(input, next) || escaped(input, next) ||\r\n [\u0027;\u0027, \u0027?\u0027, \u0027:\u0027, \u0027@\u0027, \u0027\u0026\u0027, \u0027=\u0027, \u0027\u002B\u0027, \u0027$\u0027, \u0027,\u0027].indexOf(\r\n input.charAt(next)) \u003E= 0 ? next \u002B 1 : 0\r\n}\r\n\r\n// net_path = \u0022//\u0022 authority [ abs_path ]\r\nfunction net_path (input, next) {\r\n if (input.charAt(next) === \u0027/\u0027 \u0026\u0026 input.charAt(next \u002B 1) === \u0027/\u0027) {\r\n next = authority(input, next \u002B 2)\r\n return abs_path(input, next) || next\r\n }\r\n}\r\n\r\n// abs_path = \u0022/\u0022 path_segments\r\nfunction abs_path (input, next) {\r\n return input.charAt(next) === \u0027/\u0027 \u0026\u0026 path_segments(input, next \u002B 1)\r\n}\r\n\r\n// rel_path = rel_segment [ abs_path ]\r\nfunction rel_path (input, next) {\r\n next = rel_segment(input, next)\r\n if (next) {\r\n return abs_path(input, next) || next\r\n }\r\n}\r\n\r\n// rel_segment = 1*( unreserved | escaped |\r\n// \u0022;\u0022 | \u0022@\u0022 | \u0022\u0026\u0022 | \u0022=\u0022 | \u0022\u002B\u0022 | \u0022$\u0022 | \u0022,\u0022 )\r\nfunction rel_segment (input, next) {\r\n next = check()\r\n if (next) {\r\n for (;;) {\r\n var next2 = check()\r\n if (!next2) {\r\n break\r\n }\r\n next = next2\r\n }\r\n return next\r\n }\r\n\r\n function check () {\r\n return unreserved(input, next) || escaped(input, next) || [\u0027;\u0027, \u0027@\u0027, \u0027\u0026\u0027,\r\n \u0027=\u0027, \u0027\u002B\u0027, \u0027$\u0027, \u0027,\u0027].indexOf(input.charAt(next)) \u003E= 0 ? next \u002B 1 : 0\r\n }\r\n}\r\n\r\n// scheme = alpha *( alpha | digit | \u0022\u002B\u0022 | \u0022-\u0022 | \u0022.\u0022 )\r\nfunction scheme (input, next) {\r\n next = alpha(input, next)\r\n if (next) {\r\n for (;;) {\r\n var next2 = alpha(input, next) || digit(input, next) || [\u0027\u002B\u0027, \u0027-\u0027,\r\n \u0027.\u0027, ].indexOf(input.charAt(next)) \u003E= 0 ? next \u002B 1 : 0\r\n if (!next2) {\r\n break\r\n }\r\n next = next2\r\n }\r\n return next\r\n }\r\n}\r\n\r\n// authority = server | reg_name\r\nfunction authority (input, next) {\r\n return server(input, next) || reg_name(input, next)\r\n}\r\n\r\n// reg_name = 1*( unreserved | escaped | \u0022$\u0022 | \u0022,\u0022 |\r\n// \u0022;\u0022 | \u0022:\u0022 | \u0022@\u0022 | \u0022\u0026\u0022 | \u0022=\u0022 | \u0022\u002B\u0022 )\r\nfunction reg_name (input, next) {\r\n next = check()\r\n if (next) {\r\n for (;;) {\r\n var next2 = check()\r\n if (!next2) {\r\n break\r\n }\r\n next = next2\r\n }\r\n return next\r\n }\r\n\r\n function check () {\r\n return unreserved(input, next) || escaped(input, next) || [\u0027$\u0027, \u0027,\u0027, \u0027;\u0027,\r\n \u0027:\u0027, \u0027@\u0027, \u0027\u0026\u0027, \u0027=\u0027, \u0027\u002B\u0027].indexOf(input.charAt(next)) \u003E= 0 ? next \u002B 1 : 0\r\n }\r\n}\r\n\r\n// server = [ [ userinfo \u0022@\u0022 ] hostport ]\r\nfunction server (input, next) {\r\n var next2 = userinfo(input, next)\r\n if (next2 \u0026\u0026 input.charAt(next2) === \u0027@\u0027) {\r\n next = next2 \u002B 1\r\n }\r\n return hostport(input, next) || next\r\n}\r\n\r\n// userinfo = *( unreserved | escaped |\r\n// \u0022;\u0022 | \u0022:\u0022 | \u0022\u0026\u0022 | \u0022=\u0022 | \u0022\u002B\u0022 | \u0022$\u0022 | \u0022,\u0022 )\r\nfunction userinfo (input, next) {\r\n for (;;) {\r\n var next2 = unreserved(input, next) || escaped(input, next) || [\u0027;\u0027, \u0027:\u0027,\r\n \u0027\u0026\u0027, \u0027=\u0027, \u0027\u002B\u0027, \u0027$\u0027, \u0027,\u0027].indexOf(input.charAt(next)) \u003E= 0 ? next \u002B 1 : 0\r\n if (!next2) {\r\n break\r\n }\r\n next = next2\r\n }\r\n return next\r\n}\r\n\r\n// hostport = host [ \u0022:\u0022 port ]\r\nfunction hostport (input, next) {\r\n next = host(input, next)\r\n if (next \u0026\u0026 input.charAt(next) === \u0027:\u0027) {\r\n return port(input, next \u002B 1) || next\r\n }\r\n return next\r\n}\r\n\r\n// host = hostname | IPv4address\r\nfunction host (input, next) {\r\n return hostname(input, next) || IPv4address(input, next)\r\n}\r\n\r\n// hostname = *( domainlabel \u0022.\u0022 ) toplabel [ \u0022.\u0022 ]\r\nfunction hostname (input, next) {\r\n for (;;) {\r\n var next2 = domainlabel(input, next)\r\n if (!next2 || input.charAt(next2) !== \u0027.\u0027) {\r\n break\r\n }\r\n next = next2 \u002B 1\r\n }\r\n next = toplabel(input, next)\r\n if (next \u0026\u0026 input.charAt(next) === \u0027.\u0027) {\r\n \u002B\u002Bnext\r\n }\r\n return next\r\n}\r\n\r\n// domainlabel = alphanum | alphanum *( alphanum | \u0022-\u0022 ) alphanum\r\nfunction domainlabel (input, next) {\r\n next = alphanum(input, next)\r\n if (next) {\r\n for (;;) {\r\n var next2 = alphanum(input, next)\r\n if (!next2 \u0026\u0026 input.charAt(next) === \u0027.\u0027) {\r\n next2 = next \u002B 1\r\n }\r\n if (!next2) {\r\n break\r\n }\r\n next = next2\r\n }\r\n return alphanum(input, next) || next\r\n }\r\n}\r\n\r\n// toplabel = alpha | alpha *( alphanum | \u0022-\u0022 ) alphanum\r\nfunction toplabel (input, next) {\r\n next = alpha(input, next)\r\n if (next) {\r\n for (;;) {\r\n var next2 = alphanum(input, next)\r\n if (!next2 \u0026\u0026 input.charAt(next) === \u0027.\u0027) {\r\n next2 = next \u002B 1\r\n }\r\n if (!next2) {\r\n break\r\n }\r\n next = next2\r\n }\r\n return alphanum(input, next) || next\r\n }\r\n}\r\n\r\n// IPv4address = 1*digit \u0022.\u0022 1*digit \u0022.\u0022 1*digit \u0022.\u0022 1*digit\r\nfunction IPv4address (input, next) {\r\n next = check()\r\n if (next \u0026\u0026 input.charAt(next) === \u0027.\u0027) {\r\n \u002B\u002Bnext\r\n next = check()\r\n if (next \u0026\u0026 input.charAt(next) === \u0027.\u0027) {\r\n \u002B\u002Bnext\r\n next = check()\r\n if (next \u0026\u0026 input.charAt(next) === \u0027.\u0027) {\r\n \u002B\u002Bnext\r\n return check()\r\n }\r\n }\r\n }\r\n\r\n function check () {\r\n next = digit(input, next)\r\n if (next) {\r\n for (;;) {\r\n var next2 = digit(input, next)\r\n if (!next2) {\r\n break\r\n }\r\n next = next2\r\n }\r\n return next\r\n }\r\n }\r\n}\r\n\r\n// port = *digit\r\nfunction port (input, next) {\r\n for (;;) {\r\n var next2 = digit(input, next)\r\n if (!next2) {\r\n break\r\n }\r\n next = next2\r\n }\r\n return next\r\n}\r\n\r\n// path = [ abs_path | opaque_part ]\r\nfunction path (input, next) {\r\n return abs_path(input, next) || opaque_part(input, next) || next\r\n}\r\n\r\n// path_segments = segment *( \u0022/\u0022 segment )\r\nfunction path_segments (input, next) {\r\n next = segment(input, next)\r\n if (next) {\r\n for (;;) {\r\n if (input.charAt(next) !== \u0027/\u0027) {\r\n break\r\n }\r\n var next2 = segment(input, next \u002B 1)\r\n if (!next2) {\r\n break\r\n }\r\n next = next2\r\n }\r\n return next\r\n }\r\n}\r\n\r\n// segment = *pchar *( \u0022;\u0022 param )\r\nfunction segment (input, next) {\r\n for (;;) {\r\n var next2 = pchar(input, next)\r\n if (!next2) {\r\n break\r\n }\r\n next = next2\r\n }\r\n for (;;) {\r\n if (input.charAt(next) !== \u0027/\u0027) {\r\n break\r\n }\r\n var next2 = segment(input, next \u002B 1)\r\n if (!next2) {\r\n break\r\n }\r\n next = next2\r\n }\r\n return next\r\n}\r\n\r\n// param = *pchar\r\nfunction param (input, next) {\r\n for (;;) {\r\n var next2 = pchar(input, next)\r\n if (!next2) {\r\n break\r\n }\r\n next = next2\r\n }\r\n return next\r\n}\r\n\r\n// pchar = unreserved | escaped |\r\n// \u0022:\u0022 | \u0022@\u0022 | \u0022\u0026\u0022 | \u0022=\u0022 | \u0022\u002B\u0022 | \u0022$\u0022 | \u0022,\u0022\r\nfunction pchar (input, next) {\r\n return unreserved(input, next) || escaped(input, next) || [\u0027:\u0027, \u0027@\u0027, \u0027\u0026\u0027,\r\n \u0027=\u0027, \u0027\u002B\u0027, \u0027$\u0027, \u0027,\u0027].indexOf(input.charAt(next)) \u003E= 0 ? next \u002B 1 : 0\r\n}\r\n\r\n// query = *uric\r\nfunction query (input, next) {\r\n for (;;) {\r\n var next2 = uric(input, next)\r\n if (!next2) {\r\n break\r\n }\r\n next = next2\r\n }\r\n return next\r\n}\r\n\r\n// fragment = *uric\r\nfunction fragment (input, next) {\r\n for (;;) {\r\n var next2 = uric(input, next)\r\n if (!next2) {\r\n break\r\n }\r\n next = next2\r\n }\r\n return next\r\n}\r\n\r\n// uric = reserved | unreserved | escaped\r\nfunction uric (input, next) {\r\n return reserved(input, next) || unreserved(input, next) ||\r\n escaped(input, next)\r\n}\r\n\r\n// reserved = \u0022;\u0022 | \u0022/\u0022 | \u0022?\u0022 | \u0022:\u0022 | \u0022@\u0022 | \u0022\u0026\u0022 | \u0022=\u0022 | \u0022\u002B\u0022 |\r\n// \u0022$\u0022 | \u0022,\u0022\r\nfunction reserved (input, next) {\r\n return [\u0027;\u0027, \u0027/\u0027, \u0027?\u0027, \u0027:\u0027, \u0027@\u0027, \u0027\u0026\u0027, \u0027=\u0027, \u0027\u002B\u0027, \u0027$\u0027, \u0027,\u0027].indexOf(\r\n input.charAt(next)) \u003E= 0 ? next \u002B 1 : 0\r\n}\r\n\r\n// unreserved = alphanum | mark\r\nfunction unreserved (input, next) {\r\n return alphanum(input, next) || mark(input, next)\r\n}\r\n\r\n// mark = \u0022-\u0022 | \u0022_\u0022 | \u0022.\u0022 | \u0022!\u0022 | \u0022~\u0022 | \u0022*\u0022 | \u0022\u0027\u0022 |\r\n// \u0022(\u0022 | \u0022)\u0022\r\nfunction mark (input, next) {\r\n return [\u0027-\u0027, \u0027_\u0027, \u0027.\u0027, \u0027!\u0027, \u0027~\u0027, \u0027*\u0027, \u0027\\\u0027\u0027, \u0027(\u0027, \u0027)\u0027].indexOf(\r\n input.charAt(next)) \u003E= 0 ? next \u002B 1 : 0\r\n}\r\n\r\n// escaped = \u0022%\u0022 hex hex\r\nfunction escaped (input, next) {\r\n if (input.charAt(next) === \u0027%\u0027) {\r\n next = hex(input, next \u002B 1)\r\n return next \u0026\u0026 hex(input, next)\r\n }\r\n}\r\n\r\n// hex = digit | \u0022A\u0022 | \u0022B\u0022 | \u0022C\u0022 | \u0022D\u0022 | \u0022E\u0022 | \u0022F\u0022 |\r\n// \u0022a\u0022 | \u0022b\u0022 | \u0022c\u0022 | \u0022d\u0022 | \u0022e\u0022 | \u0022f\u0022\r\nfunction hex (input, next) {\r\n return digit(input, next) || [\u0027A\u0027, \u0027B\u0027, \u0027C\u0027, \u0027D\u0027, \u0027E\u0027, \u0027F\u0027, \u0027a\u0027, \u0027b\u0027, \u0027c\u0027,\r\n \u0027d\u0027, \u0027e\u0027, \u0027f\u0027].indexOf(input.charAt(next)) \u003E= 0 ? next \u002B 1 : 0\r\n}\r\n\r\n// alphanum = alpha | digit\r\nfunction alphanum (input, next) {\r\n return alpha(input, next) || digit(input, next)\r\n}\r\n\r\n// alpha = lowalpha | upalpha\r\nfunction alpha (input, next) {\r\n return lowalpha(input, next) || upalpha(input, next)\r\n}\r\n\r\n// lowalpha = \u0022a\u0022 | \u0022b\u0022 | \u0022c\u0022 | \u0022d\u0022 | \u0022e\u0022 | \u0022f\u0022 | \u0022g\u0022 | \u0022h\u0022 | \u0022i\u0022 |\r\n// \u0022j\u0022 | \u0022k\u0022 | \u0022l\u0022 | \u0022m\u0022 | \u0022n\u0022 | \u0022o\u0022 | \u0022p\u0022 | \u0022q\u0022 | \u0022r\u0022 |\r\n// \u0022s\u0022 | \u0022t\u0022 | \u0022u\u0022 | \u0022v\u0022 | \u0022w\u0022 | \u0022x\u0022 | \u0022y\u0022 | \u0022z\u0022\r\nfunction lowalpha (input, next) {\r\n return [\u0027a\u0027, \u0027b\u0027, \u0027c\u0027, \u0027d\u0027, \u0027e\u0027, \u0027f\u0027, \u0027g\u0027, \u0027h\u0027, \u0027i\u0027, \u0027j\u0027, \u0027k\u0027, \u0027l\u0027, \u0027m\u0027,\r\n \u0027n\u0027, \u0027o\u0027, \u0027p\u0027, \u0027q\u0027, \u0027r\u0027, \u0027s\u0027, \u0027t\u0027, \u0027u\u0027, \u0027v\u0027, \u0027w\u0027, \u0027x\u0027, \u0027y\u0027, \u0027z\u0027].indexOf(\r\n input.charAt(next)) \u003E= 0 ? next \u002B 1 : 0\r\n}\r\n\r\n// upalpha = \u0022A\u0022 | \u0022B\u0022 | \u0022C\u0022 | \u0022D\u0022 | \u0022E\u0022 | \u0022F\u0022 | \u0022G\u0022 | \u0022H\u0022 | \u0022I\u0022 |\r\n// \u0022J\u0022 | \u0022K\u0022 | \u0022L\u0022 | \u0022M\u0022 | \u0022N\u0022 | \u0022O\u0022 | \u0022P\u0022 | \u0022Q\u0022 | \u0022R\u0022 |\r\n// \u0022S\u0022 | \u0022T\u0022 | \u0022U\u0022 | \u0022V\u0022 | \u0022W\u0022 | \u0022X\u0022 | \u0022Y\u0022 | \u0022Z\u0022\r\nfunction upalpha (input, next) {\r\n return [\u0027A\u0027, \u0027B\u0027, \u0027C\u0027, \u0027D\u0027, \u0027E\u0027, \u0027F\u0027, \u0027G\u0027, \u0027H\u0027, \u0027I\u0027, \u0027J\u0027, \u0027K\u0027, \u0027L\u0027, \u0027M\u0027,\r\n \u0027N\u0027, \u0027O\u0027, \u0027P\u0027, \u0027Q\u0027, \u0027R\u0027, \u0027S\u0027, \u0027T\u0027, \u0027U\u0027, \u0027V\u0027, \u0027W\u0027, \u0027X\u0027, \u0027Y\u0027, \u0027Z\u0027].indexOf(\r\n input.charAt(next)) \u003E= 0 ? next \u002B 1 : 0\r\n}\r\n\r\n// digit = \u00220\u0022 | \u00221\u0022 | \u00222\u0022 | \u00223\u0022 | \u00224\u0022 | \u00225\u0022 | \u00226\u0022 | \u00227\u0022 |\r\n// \u00228\u0022 | \u00229\u0022\r\nfunction digit (input, next) {\r\n return [\u00270\u0027, \u00271\u0027, \u00272\u0027, \u00273\u0027, \u00274\u0027, \u00275\u0027, \u00276\u0027, \u00277\u0027, \u00278\u0027, \u00279\u0027].indexOf(\r\n input.charAt(next)) \u003E= 0 ? next \u002B 1 : 0\r\n}\r\n\r\nreturn {\r\n isURI: isURI\r\n}\r\n}())\r\n\r\nwindow.rfc3986 = (function () {\r\nfunction isURI (input) {\r\n return URI(input, 0) === input.length\r\n}\r\n\r\n// URI = scheme \u0022:\u0022 hier-part [ \u0022?\u0022 query ] [ \u0022#\u0022 fragment ]\r\nfunction URI (input, next) {\r\n var next2\r\n next = scheme(input, next)\r\n if (next \u0026\u0026 input.charAt(next) === \u0027:\u0027) {\r\n next = hier_part(input, next \u002B 1)\r\n if (next) {\r\n if (input.charAt(next) === \u0027?\u0027) {\r\n next2 = query(input, next \u002B 1)\r\n if (next2) {\r\n next = next2\r\n }\r\n }\r\n if (input.charAt(next) === \u0027#\u0027) {\r\n next2 = fragment(input, next \u002B 1)\r\n if (next2) {\r\n next = next2\r\n }\r\n }\r\n }\r\n return next\r\n }\r\n}\r\n\r\n// hier-part = \u0022//\u0022 authority path-abempty\r\n// / path-absolute\r\n// / path-rootless\r\n// / path-empty\r\nfunction hier_part (input, next) {\r\n if (input.charAt(next) === \u0027/\u0027 \u0026\u0026 input.charAt(next \u002B 1) === \u0027/\u0027) {\r\n var next2 = authority(input, next \u002B 2)\r\n if (next2) {\r\n next2 = path_abempty(input, next2)\r\n if (next2) {\r\n return next2\r\n }\r\n }\r\n }\r\n return path_absolute(input, next) || path_rootless(input, next) ||\r\n path_empty(input, next)\r\n}\r\n\r\n// URI-reference = URI / relative-ref\r\nfunction URI_reference (input, next) {\r\n return URI(input, next) || relative_ref(input, next)\r\n}\r\n\r\n// absolute-URI = scheme \u0022:\u0022 hier-part [ \u0022?\u0022 query ]\r\nfunction absoluteURI (input, next) {\r\n next = scheme(input, next)\r\n if (next \u0026\u0026 input.charAt(next) === \u0027:\u0027) {\r\n next = hier_part(input, next \u002B 1)\r\n if (next \u0026\u0026 input.charAt(next) === \u0027?\u0027) {\r\n return query(input, next \u002B 1) || next\r\n }\r\n return next\r\n }\r\n}\r\n\r\n// relative-ref = relative-part [ \u0022?\u0022 query ] [ \u0022#\u0022 fragment ]\r\nfunction relative_ref (input, next) {\r\n var next2\r\n next = relative_part(input, next)\r\n if (next) {\r\n if (input.charAt(next) === \u0027?\u0027) {\r\n next2 = query(input, next \u002B 1)\r\n if (next2) {\r\n next = next2\r\n }\r\n }\r\n if (input.charAt(next) === \u0027#\u0027) {\r\n next2 = fragment(input, next \u002B 1)\r\n if (next2) {\r\n next = next2\r\n }\r\n }\r\n }\r\n return next\r\n}\r\n\r\n// relative-part = \u0022//\u0022 authority path-abempty\r\n// / path-absolute\r\n// / path-noscheme\r\n// / path-empty\r\nfunction relative_part (input, next) {\r\n if (input.charAt(next) === \u0027/\u0027 \u0026\u0026 input.charAt(next \u002B 1) === \u0027/\u0027) {\r\n var next2 = authority(input, next \u002B 2)\r\n if (next2) {\r\n next2 = path_abempty(input, next2)\r\n if (next2) {\r\n return next2\r\n }\r\n }\r\n }\r\n return path_absolute(input, next) || path_noscheme(input, next) ||\r\n path_empty(input, next)\r\n}\r\n\r\n// scheme = ALPHA *( ALPHA / DIGIT / \u0022\u002B\u0022 / \u0022-\u0022 / \u0022.\u0022 )\r\nfunction scheme (input, next) {\r\n next = alpha(input, next)\r\n if (next) {\r\n for (;;) {\r\n var next2 = alpha(input, next) || digit(input, next) || ([\u0027\u002B\u0027, \u0027-\u0027,\r\n \u0027.\u0027, ].indexOf(input.charAt(next)) \u003E= 0 ? next \u002B 1 : 0)\r\n if (!next2) {\r\n break\r\n }\r\n next = next2\r\n }\r\n return next\r\n }\r\n}\r\n\r\n// authority = [ userinfo \u0022@\u0022 ] host [ \u0022:\u0022 port ]\r\nfunction authority (input, next) {\r\n var next2 = userinfo(input, next)\r\n if (next2 \u0026\u0026 input.charAt(next2) === \u0027@\u0027) {\r\n next = next2 \u002B 1\r\n }\r\n next = host(input, next)\r\n if (next) {\r\n if (input.charAt(next) === \u0027:\u0027) {\r\n return port(input, next \u002B 1) || next\r\n }\r\n return next\r\n }\r\n}\r\n\r\n// userinfo = *( unreserved / pct-encoded / sub-delims / \u0022:\u0022 )\r\nfunction userinfo (input, next) {\r\n for (;;) {\r\n var next2 = unreserved(input, next) || pct_encoded(input, next) ||\r\n sub_delims(input, next) || (input.charAt(next) === \u0027:\u0027 ? next \u002B 1 : 0)\r\n if (!next2) {\r\n break\r\n }\r\n next = next2\r\n }\r\n return next\r\n}\r\n\r\n// host = IP-literal / IPv4address / reg-name\r\nfunction host (input, next) {\r\n return IP_literal(input, next) || IPv4address(input, next) ||\r\n reg_name(input, next)\r\n}\r\n\r\n// port = *DIGIT\r\nfunction port (input, next) {\r\n for (;;) {\r\n var next2 = digit(input, next)\r\n if (!next2) {\r\n break\r\n }\r\n next = next2\r\n }\r\n return next\r\n}\r\n\r\n// IP-literal = \u0022[\u0022 ( IPv6address / IPvFuture ) \u0022]\u0022\r\nfunction IP_literal (input, next) {\r\n if (input.charAt(next) === \u0027[\u0027) {\r\n next = IPv6address(input, next) || IPvFuture(input, next)\r\n if (next \u0026\u0026 input.charAt(next) === \u0027]\u0027) {\r\n return next \u002B 1\r\n }\r\n }\r\n}\r\n\r\n// IPvFuture = \u0022v\u0022 1*HEXDIG \u0022.\u0022 1*( unreserved / sub-delims / \u0022:\u0022 )\r\nfunction IPvFuture (input, next) {\r\n var next2\r\n if (input.charAt(next) === \u0027v\u0027) {\r\n next = hexdig(input, next \u002B 1)\r\n if (next) {\r\n for (;;) {\r\n next2 = hexdig(input, next)\r\n if (!next2) {\r\n break\r\n }\r\n next = next2\r\n }\r\n if (input.charAt(next) === \u0027.\u0027) {\r\n \u002B\u002Bnext\r\n next = check()\r\n if (next) {\r\n for (;;) {\r\n next2 = check()\r\n if (!next2) {\r\n break\r\n }\r\n next = next2\r\n }\r\n return next\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\n// IPv6address = 6( h16 \u0022:\u0022 ) ls32\r\n// / \u0022::\u0022 5( h16 \u0022:\u0022 ) ls32\r\n// / [ h16 ] \u0022::\u0022 4( h16 \u0022:\u0022 ) ls32\r\n// / [ *1( h16 \u0022:\u0022 ) h16 ] \u0022::\u0022 3( h16 \u0022:\u0022 ) ls32\r\n// / [ *2( h16 \u0022:\u0022 ) h16 ] \u0022::\u0022 2( h16 \u0022:\u0022 ) ls32\r\n// / [ *3( h16 \u0022:\u0022 ) h16 ] \u0022::\u0022 h16 \u0022:\u0022 ls32\r\n// / [ *4( h16 \u0022:\u0022 ) h16 ] \u0022::\u0022 ls32\r\n// / [ *5( h16 \u0022:\u0022 ) h16 ] \u0022::\u0022 h16\r\n// / [ *6( h16 \u0022:\u0022 ) h16 ] \u0022::\u0022\r\nfunction IPv6address (input, next) {\r\n return 0\r\n}\r\n\r\n// h16 = 1*4HEXDIG\r\nfunction h16 (input, next) {\r\n next = pchar(input, next)\r\n if (next) {\r\n for (var i = 0; i \u003C 3; \u002B\u002Bi) {\r\n var next2 = pchar(input, next)\r\n if (!next2) {\r\n break\r\n }\r\n next = next2\r\n }\r\n return next\r\n }\r\n}\r\n\r\n// ls32 = ( h16 \u0022:\u0022 h16 ) / IPv4address\r\nfunction ls32 (input, next) {\r\n var next2 = h16(input, next)\r\n if (next2) {\r\n next2 = input.charAt(next2) === \u0027.\u0027 \u0026\u0026 h16(input, next2 \u002B 1)\r\n if (next2) {\r\n return next2\r\n }\r\n }\r\n return IPv4address(input, next)\r\n}\r\n\r\n// IPv4address = dec-octet \u0022.\u0022 dec-octet \u0022.\u0022 dec-octet \u0022.\u0022 dec-octet\r\nfunction IPv4address (input, next) {\r\n next = dec_octet(input, next)\r\n if (next \u0026\u0026 input.charAt(next) === \u0027.\u0027) {\r\n next = dec_octet(input, next \u002B 1)\r\n if (next \u0026\u0026 input.charAt(next) === \u0027.\u0027) {\r\n next = dec_octet(input, next \u002B 1)\r\n if (next \u0026\u0026 input.charAt(next) === \u0027.\u0027) {\r\n return dec_octet(input, next \u002B 1)\r\n }\r\n }\r\n }\r\n}\r\n\r\n// dec-octet = DIGIT ; 0-9\r\n// / %x31-39 DIGIT ; 10-99\r\n// / \u00221\u0022 2DIGIT ; 100-199\r\n// / \u00222\u0022 %x30-34 DIGIT ; 200-249\r\n// / \u002225\u0022 %x30-35 ; 250-255\r\nfunction dec_octet (input, next) {\r\n var next2 = digit(input, next)\r\n if (next2) {\r\n return next2\r\n }\r\n next2 = [\u00271\u0027, \u00272\u0027, \u00273\u0027, \u00274\u0027, \u00275\u0027, \u00276\u0027, \u00277\u0027, \u00278\u0027, \u00279\u0027].indexOf(\r\n input.charAt(next)) \u003E= 0 ? next \u002B 1 : 0\r\n if (next2) {\r\n next2 = digit(input, next2)\r\n if (next2) {\r\n return next2\r\n }\r\n }\r\n if (input.charAt(next) === \u00271\u0027) {\r\n next2 = twodigit(input, next \u002B 1)\r\n if (next2) {\r\n return next2\r\n }\r\n }\r\n if (input.charAt(next) === \u00272\u0027) {\r\n next2 = [\u00270\u0027, \u00271\u0027, \u00272\u0027, \u00273\u0027, \u00274\u0027].indexOf(\r\n input.charAt(next \u002B 1)) \u003E= 0 ? next \u002B 1 : 0\r\n if (next2) {\r\n next2 = digit(input, next2)\r\n if (next2) {\r\n return next2\r\n }\r\n }\r\n }\r\n if (input.charAt(next) === \u00272\u0027 \u0026\u0026 input.charAt(next) === \u00275\u0027) {\r\n next2 = [\u00270\u0027, \u00271\u0027, \u00272\u0027, \u00273\u0027, \u00274\u0027, \u00275\u0027].indexOf(\r\n input.charAt(next \u002B 2)) \u003E= 0 ? next \u002B 1 : 0\r\n if (next2) {\r\n return next2\r\n }\r\n }\r\n}\r\n\r\n// reg-name = *( unreserved / pct-encoded / sub-delims )\r\nfunction reg_name (input, next) {\r\n for (;;) {\r\n var next2 = unreserved(input, next) || pct_encoded(input, next) ||\r\n sub_delims(input, next)\r\n if (!next2) {\r\n break\r\n }\r\n next = next2\r\n }\r\n return next\r\n}\r\n\r\n// path = path-abempty ; begins with \u0022/\u0022 or is empty\r\n// / path-absolute ; begins with \u0022/\u0022 but not \u0022//\u0022\r\n// / path-noscheme ; begins with a non-colon segment\r\n// / path-rootless ; begins with a segment\r\n// / path-empty ; zero characters\r\nfunction path (input, next) {\r\n return path_abempty(input, next) || path_absolute(input, next) ||\r\n path_noscheme(input, next) || path_rootless(input, next) ||\r\n path_empty(input, next)\r\n}\r\n\r\n// path-abempty = *( \u0022/\u0022 segment )\r\nfunction path_abempty (input, next) {\r\n for (;;) {\r\n if (input.charAt(next) !== \u0027/\u0027) {\r\n break\r\n }\r\n var next2 = segment(input, next \u002B 1)\r\n if (!next2) {\r\n break\r\n }\r\n next = next2\r\n }\r\n return next\r\n}\r\n\r\n// path-absolute = \u0022/\u0022 [ segment-nz *( \u0022/\u0022 segment ) ]\r\nfunction path_absolute (input, next) {\r\n if (input.charAt(next) === \u0027/\u0027) {\r\n var next2 = segment_nz(input, \u002B\u002Bnext)\r\n if (next2) {\r\n for (;;) {\r\n if (input.charAt(next2) !== \u0027/\u0027) {\r\n break\r\n }\r\n var next3 = segment(input, next2 \u002B 1)\r\n if (!next3) {\r\n break\r\n }\r\n next2 = next3\r\n }\r\n return next2\r\n }\r\n return next\r\n }\r\n}\r\n\r\n// path-noscheme = segment-nz-nc *( \u0022/\u0022 segment )\r\nfunction path_noscheme (input, next) {\r\n var next = segment_nz_nc(input, next)\r\n if (next) {\r\n for (;;) {\r\n if (input.charAt(next) !== \u0027/\u0027) {\r\n break\r\n }\r\n var next2 = segment(input, next \u002B 1)\r\n if (!next2) {\r\n break\r\n }\r\n next = next2\r\n }\r\n return next\r\n }\r\n}\r\n\r\n// path-rootless = segment-nz *( \u0022/\u0022 segment )\r\nfunction path_rootless (input, next) {\r\n var next = segment_nz(input, next)\r\n if (next) {\r\n for (;;) {\r\n if (input.charAt(next) !== \u0027/\u0027) {\r\n break\r\n }\r\n var next2 = segment(input, next \u002B 1)\r\n if (!next2) {\r\n break\r\n }\r\n next = next2\r\n }\r\n return next\r\n }\r\n}\r\n\r\n// path-empty = 0\u003Cpchar\u003E\r\nfunction path_empty (input, next) {\r\n return input.length === next ? next : 0\r\n}\r\n\r\n// segment = *pchar\r\nfunction segment (input, next) {\r\n for (;;) {\r\n var next2 = pchar(input, next)\r\n if (!next2) {\r\n break\r\n }\r\n next = next2\r\n }\r\n return next\r\n}\r\n\r\n// segment-nz = 1*pchar\r\nfunction segment_nz (input, next) {\r\n next = pchar(input, next)\r\n if (next) {\r\n for (;;) {\r\n var next2 = pchar(input, next)\r\n if (!next2) {\r\n break\r\n }\r\n next = next2\r\n }\r\n return next\r\n }\r\n}\r\n\r\n// segment-nz-nc = 1*( unreserved / pct-encoded / sub-delims / \u0022@\u0022 )\r\n// ; non-zero-length segment without any colon \u0022:\u0022\r\nfunction segment_nz_nc (input, next) {\r\n next = check()\r\n if (next) {\r\n for (;;) {\r\n var next2 = check()\r\n if (!next2) {\r\n break\r\n }\r\n next = next2\r\n }\r\n return next\r\n }\r\n\r\n function check () {\r\n return unreserved(input, next) || pct_encoded(input, next) ||\r\n sub_delims(input, next) || (input.charAt(next) === \u0027@\u0027 ? next \u002B 1 : 0)\r\n }\r\n}\r\n\r\n// pchar = unreserved / pct-encoded / sub-delims / \u0022:\u0022 / \u0022@\u0022\r\nfunction pchar (input, next) {\r\n return unreserved(input, next) || pct_encoded(input, next) ||\r\n sub_delims(input, next) || ([\u0027:\u0027, \u0027@\u0027].indexOf(\r\n input.charAt(next)) \u003E= 0 ? next \u002B 1 : 0)\r\n}\r\n\r\n// query = *( pchar / \u0022/\u0022 / \u0022?\u0022 )\r\nfunction query (input, next) {\r\n for (;;) {\r\n var next2 = pchar(input, next)\r\n if (!next2) {\r\n next2 = [\u0027/\u0027, \u0027?\u0027].indexOf(input.charAt(next)) \u003E= 0 ? next \u002B 1 : 0\r\n if (!next2) {\r\n break\r\n }\r\n }\r\n next = next2\r\n }\r\n return next\r\n}\r\n\r\n// fragment = *( pchar / \u0022/\u0022 / \u0022?\u0022 )\r\nfunction fragment (input, next) {\r\n for (;;) {\r\n var next2 = pchar(input, next)\r\n if (!next2) {\r\n next2 = [\u0027/\u0027, \u0027?\u0027].indexOf(input.charAt(next)) \u003E= 0 ? next \u002B 1 : 0\r\n if (!next2) {\r\n break\r\n }\r\n }\r\n next = next2\r\n }\r\n return next\r\n}\r\n\r\n// pct-encoded = \u0022%\u0022 HEXDIG HEXDIG\r\nfunction pct_encoded (input, next) {\r\n if (input.charAt(next) === \u0027%\u0027) {\r\n next = hexdig(input, next \u002B 1)\r\n return next \u0026\u0026 hexdig(input, next)\r\n }\r\n}\r\n\r\n// unreserved = ALPHA / DIGIT / \u0022-\u0022 / \u0022.\u0022 / \u0022_\u0022 / \u0022~\u0022\r\nfunction unreserved (input, next) {\r\n return alpha(input, next) || digit(input, next) || [\u0027-\u0027, \u0027.\u0027, \u0027_\u0027, \u0027~\u0027\r\n ].indexOf(input.charAt(next)) \u003E= 0 ? next \u002B 1 : 0\r\n}\r\n\r\n// reserved = gen-delims / sub-delims\r\nfunction reserved (input, next) {\r\n return gen_delims(input, next) || sub_delims(input, next)\r\n}\r\n\r\n// gen-delims = \u0022:\u0022 / \u0022/\u0022 / \u0022?\u0022 / \u0022#\u0022 / \u0022[\u0022 / \u0022]\u0022 / \u0022@\u0022\r\nfunction gen_delims (input, next) {\r\n return [\u0027:\u0027, \u0027/\u0027, \u0027?\u0027, \u0027#\u0027, \u0027[\u0027, \u0027]\u0027, \u0027@\u0027].indexOf(\r\n input.charAt(next)) \u003E= 0 ? next \u002B 1 : 0\r\n}\r\n\r\n// sub-delims = \u0022!\u0022 / \u0022$\u0022 / \u0022\u0026\u0022 / \u0022\u0027\u0022 / \u0022(\u0022 / \u0022)\u0022\r\n// / \u0022*\u0022 / \u0022\u002B\u0022 / \u0022,\u0022 / \u0022;\u0022 / \u0022=\u0022\r\nfunction sub_delims (input, next) {\r\n return [\u0027!\u0027, \u0027$\u0027, \u0027\u0026\u0027, \u0027\\\u0027\u0027, \u0027(\u0027, \u0027)\u0027, \u0027*\u0027, \u0027\u002B\u0027, \u0027,\u0027, \u0027;\u0027, \u0027=\u0027].indexOf(\r\n input.charAt(next)) \u003E= 0 ? next \u002B 1 : 0\r\n}\r\n\r\n// hexdig = digit / \u0022A\u0022 / \u0022B\u0022 / \u0022C\u0022 / \u0022D\u0022 / \u0022E\u0022 / \u0022F\u0022 /\r\n// \u0022a\u0022 / \u0022b\u0022 / \u0022c\u0022 / \u0022d\u0022 / \u0022e\u0022 / \u0022f\u0022\r\nfunction hexdig (input, next) {\r\n return digit(input, next) || ([\u0027A\u0027, \u0027B\u0027, \u0027C\u0027, \u0027D\u0027, \u0027E\u0027, \u0027F\u0027, \u0027a\u0027, \u0027b\u0027, \u0027c\u0027,\r\n \u0027d\u0027, \u0027e\u0027, \u0027f\u0027].indexOf(input.charAt(next)) \u003E= 0 ? next \u002B 1 : 0)\r\n}\r\n\r\n// alpha = lowalpha / upalpha\r\nfunction alpha (input, next) {\r\n return lowalpha(input, next) || upalpha(input, next)\r\n}\r\n\r\n// lowalpha = \u0022a\u0022 / \u0022b\u0022 / \u0022c\u0022 / \u0022d\u0022 / \u0022e\u0022 / \u0022f\u0022 / \u0022g\u0022 / \u0022h\u0022 / \u0022i\u0022 /\r\n// \u0022j\u0022 / \u0022k\u0022 / \u0022l\u0022 / \u0022m\u0022 / \u0022n\u0022 / \u0022o\u0022 / \u0022p\u0022 / \u0022q\u0022 / \u0022r\u0022 /\r\n// \u0022s\u0022 / \u0022t\u0022 / \u0022u\u0022 / \u0022v\u0022 / \u0022w\u0022 / \u0022x\u0022 / \u0022y\u0022 / \u0022z\u0022\r\nfunction lowalpha (input, next) {\r\n return [\u0027a\u0027, \u0027b\u0027, \u0027c\u0027, \u0027d\u0027, \u0027e\u0027, \u0027f\u0027, \u0027g\u0027, \u0027h\u0027, \u0027i\u0027, \u0027j\u0027, \u0027k\u0027, \u0027l\u0027, \u0027m\u0027,\r\n \u0027n\u0027, \u0027o\u0027, \u0027p\u0027, \u0027q\u0027, \u0027r\u0027, \u0027s\u0027, \u0027t\u0027, \u0027u\u0027, \u0027v\u0027, \u0027w\u0027, \u0027x\u0027, \u0027y\u0027, \u0027z\u0027].indexOf(\r\n input.charAt(next)) \u003E= 0 ? next \u002B 1 : 0\r\n}\r\n\r\n// upalpha = \u0022A\u0022 / \u0022B\u0022 / \u0022C\u0022 / \u0022D\u0022 / \u0022E\u0022 / \u0022F\u0022 / \u0022G\u0022 / \u0022H\u0022 / \u0022I\u0022 /\r\n// \u0022J\u0022 / \u0022K\u0022 / \u0022L\u0022 / \u0022M\u0022 / \u0022N\u0022 / \u0022O\u0022 / \u0022P\u0022 / \u0022Q\u0022 / \u0022R\u0022 /\r\n// \u0022S\u0022 / \u0022T\u0022 / \u0022U\u0022 / \u0022V\u0022 / \u0022W\u0022 / \u0022X\u0022 / \u0022Y\u0022 / \u0022Z\u0022\r\nfunction upalpha (input, next) {\r\n return [\u0027A\u0027, \u0027B\u0027, \u0027C\u0027, \u0027D\u0027, \u0027E\u0027, \u0027F\u0027, \u0027G\u0027, \u0027H\u0027, \u0027I\u0027, \u0027J\u0027, \u0027K\u0027, \u0027L\u0027, \u0027M\u0027,\r\n \u0027N\u0027, \u0027O\u0027, \u0027P\u0027, \u0027Q\u0027, \u0027R\u0027, \u0027S\u0027, \u0027T\u0027, \u0027U\u0027, \u0027V\u0027, \u0027W\u0027, \u0027X\u0027, \u0027Y\u0027, \u0027Z\u0027].indexOf(\r\n input.charAt(next)) \u003E= 0 ? next \u002B 1 : 0\r\n}\r\n\r\n// digit = \u00220\u0022 / \u00221\u0022 / \u00222\u0022 / \u00223\u0022 / \u00224\u0022 / \u00225\u0022 / \u00226\u0022 / \u00227\u0022 /\r\n// \u00228\u0022 / \u00229\u0022\r\nfunction digit (input, next) {\r\n return [\u00270\u0027, \u00271\u0027, \u00272\u0027, \u00273\u0027, \u00274\u0027, \u00275\u0027, \u00276\u0027, \u00277\u0027, \u00278\u0027, \u00279\u0027].indexOf(\r\n input.charAt(next)) \u003E= 0 ? next \u002B 1 : 0\r\n}\r\n\r\nreturn {\r\n isURI: isURI\r\n}\r\n}())\r\n\r\nwindow.regexp = (function () {\r\n// URI = scheme \u0022:\u0022 hier-part [ \u0022?\u0022 query ] [ \u0022#\u0022 fragment ]\r\n// hier-part = \u0022//\u0022 authority path-abempty\r\n// / path-absolute\r\n// / path-rootless\r\n// / path-empty\r\n// ^(([^:/?#]\u002B):)?(?://([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?\r\n// 12 3 4 5 6 7 8\r\n// ^(?:([^:/?#]\u002B):)?(?:(//)([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?\r\n// 1 2 3 4 5 6\r\nvar uriRegExp = new RegExp(\r\n \u0027^(?:([^:/?#]\u002B):)?(?:(//)([^/?#]*))?([^?#]*)(?:\\\\?([^#]*))?(?:#(.*))?$\u0027)\r\n\r\n// scheme = ALPHA *( ALPHA / DIGIT / \u0022\u002B\u0022 / \u0022-\u0022 / \u0022.\u0022 )\r\nvar schemeRegExp = new RegExp(\u0027^[a-zA-Z](?:[a-zA-Z]|[0-9]|[-\u002B.])*$\u0027)\r\n\r\n// authority = [ userinfo \u0022@\u0022 ] host [ \u0022:\u0022 port ]\r\nvar authorityRegExp = new RegExp(\u0027^(?:([^@]\u002B)@)?([^:]\u002B)(?::([0-9]\u002B))?$\u0027)\r\n\r\n// userinfo = *( unreserved / pct-encoded / sub-delims / \u0022:\u0022 )\r\nvar userinfoRegExp = new RegExp(\u0027^[-a-zA-Z0-9._~%!$\u0026\\\u0027()*\u002B,;=:]*$\u0027)\r\n\r\n// host = IP-literal / IPv4address / reg-name\r\n// IP-literal = \u0022[\u0022 ( IPv6address / IPvFuture ) \u0022]\u0022\r\n// IPvFuture = \u0022v\u0022 1*HEXDIG \u0022.\u0022 1*( unreserved / sub-delims / \u0022:\u0022 )\r\n// IPv6address = 6( h16 \u0022:\u0022 ) ls32\r\n// / \u0022::\u0022 5( h16 \u0022:\u0022 ) ls32\r\n// / [ h16 ] \u0022::\u0022 4( h16 \u0022:\u0022 ) ls32\r\n// / [ *1( h16 \u0022:\u0022 ) h16 ] \u0022::\u0022 3( h16 \u0022:\u0022 ) ls32\r\n// / [ *2( h16 \u0022:\u0022 ) h16 ] \u0022::\u0022 2( h16 \u0022:\u0022 ) ls32\r\n// / [ *3( h16 \u0022:\u0022 ) h16 ] \u0022::\u0022 h16 \u0022:\u0022 ls32\r\n// / [ *4( h16 \u0022:\u0022 ) h16 ] \u0022::\u0022 ls32\r\n// / [ *5( h16 \u0022:\u0022 ) h16 ] \u0022::\u0022 h16\r\n// / [ *6( h16 \u0022:\u0022 ) h16 ] \u0022::\u0022\r\n// ls32 = ( h16 \u0022:\u0022 h16 ) / IPv4address\r\n// ; least-significant 32 bits of address\r\n// h16 = 1*4HEXDIG\r\n// ; 16 bits of address represented in hexadecimal\r\n\r\n// IPv4address = dec-octet \u0022.\u0022 dec-octet \u0022.\u0022 dec-octet \u0022.\u0022 dec-octet\r\nvar IPv4addressRegExp = new RegExp(\u0027^([0-9]\u002B)\\.([0-9]\u002B)\\.([0-9]\u002B)\\.([0-9]\u002B)$\u0027)\r\n\r\n// dec-octet = DIGIT ; 0-9\r\n// / %x31-39 DIGIT ; 10-99\r\n// / \u00221\u0022 2DIGIT ; 100-199\r\n// / \u00222\u0022 %x30-34 DIGIT ; 200-249\r\n// / \u002225\u0022 %x30-35 ; 250-255\r\n\r\n// reg-name = *( unreserved / pct-encoded / sub-delims )\r\nvar regnameRegExp = new RegExp(\u0027^[-a-zA-Z0-9._~%!$\u0026\\\u0027()*\u002B,;=]*$\u0027)\r\n\r\n// port = *DIGIT\r\n// unreserved = ALPHA / DIGIT / \u0022-\u0022 / \u0022.\u0022 / \u0022_\u0022 / \u0022~\u0022\r\n// reserved = gen-delims / sub-delims\r\n// gen-delims = \u0022:\u0022 / \u0022/\u0022 / \u0022?\u0022 / \u0022#\u0022 / \u0022[\u0022 / \u0022]\u0022 / \u0022@\u0022\r\n// sub-delims = \u0022!\u0022 / \u0022$\u0022 / \u0022\u0026\u0022 / \u0022\u0027\u0022 / \u0022(\u0022 / \u0022)\u0022\r\n// / \u0022*\u0022 / \u0022\u002B\u0022 / \u0022,\u0022 / \u0022;\u0022 / \u0022=\u0022\r\n// pct-encoded = \u0022%\u0022 HEXDIG HEXDIG\r\n\r\n// path = path-abempty ; begins with \u0022/\u0022 or is empty\r\n// / path-absolute ; begins with \u0022/\u0022 but not \u0022//\u0022\r\n// / path-noscheme ; begins with a non-colon segment\r\n// / path-rootless ; begins with a segment\r\n// / path-empty ; zero characters\r\n// path-abempty = *( \u0022/\u0022 segment )\r\n// path-absolute = \u0022/\u0022 [ segment-nz *( \u0022/\u0022 segment ) ]\r\n// path-noscheme = segment-nz-nc *( \u0022/\u0022 segment )\r\n// path-rootless = segment-nz *( \u0022/\u0022 segment )\r\n// path-empty = 0\u003Cpchar\u003E\r\n\r\n// segment = *pchar\r\nvar segmentRegExp = new RegExp(\u0027^[-a-zA-Z0-9._~%!$\u0026\\\u0027()*\u002B,;=:@]*$\u0027)\r\n\r\n// segment-nz = 1*pchar\r\nvar segmentNzRegExp = new RegExp(\u0027^[-a-zA-Z0-9._~%!$\u0026\\\u0027()*\u002B,;=:@]\u002B\u0027)\r\n\r\n// segment-nz-nc = 1*( unreserved / pct-encoded / sub-delims / \u0022@\u0022 )\r\n// ; non-zero-length segment without any colon \u0022:\u0022\r\n// pchar = unreserved / pct-encoded / sub-delims / \u0022:\u0022 / \u0022@\u0022\r\n\r\n// query = *( pchar / \u0022/\u0022 / \u0022?\u0022 )\r\nvar queryRegExp = new RegExp(\u0027^[-a-zA-Z0-9._~%!$\u0026\\\u0027()*\u002B,;=:@/?]*$\u0027)\r\n\r\n// fragment = *( pchar / \u0022/\u0022 / \u0022?\u0022 )\r\nvar fragmentRegExp = queryRegExp\r\n\r\nfunction parseURI (input) {\r\n var match = uriRegExp.exec(input)\r\n if (!match) {\r\n throw new SyntaxError(\u0027Invalid URI.\u0027)\r\n }\r\n var uri = convertMatch(match)\r\n return checkParts(uri)\r\n}\r\n\r\nfunction isURI (input) {\r\n try {\r\n parseURI(input)\r\n return true\r\n } catch (error) {\r\n return false\r\n }\r\n}\r\n\r\nfunction validateURI (input) {\r\n parseURI(input)\r\n}\r\n\r\nfunction convertMatch (match) {\r\n return {\r\n scheme: match[1],\r\n location: match[2],\r\n authority: match[3],\r\n path: match[4],\r\n query: match[5],\r\n fragment: match[6]\r\n }\r\n}\r\n\r\nfunction checkParts (uri) {\r\n checkScheme(uri.scheme)\r\n if (uri.location) {\r\n delete uri.location\r\n var authority = checkAuthority(uri.authority)\r\n uri.userinfo = authority.userinfo\r\n uri.host = authority.host\r\n uri.port = authority.port\r\n checkRestOfPath(uri.path)\r\n } else {\r\n checkBeginOfPath(uri.path)\r\n }\r\n checkQuery(uri.query)\r\n checkFragment(uri.fragment)\r\n return uri\r\n}\r\n\r\nfunction checkScheme (scheme) {\r\n if (!scheme) {\r\n throw new SyntaxError(\u0027Missing URI scheme.\u0027)\r\n }\r\n if (!schemeRegExp.test(scheme)) {\r\n throw new SyntaxError(\u0027Invalid URI scheme.\u0027)\r\n }\r\n}\r\n\r\nfunction checkAuthority (authority) {\r\n var match = authorityRegExp.exec(authority)\r\n if (!match) {\r\n throw new SyntaxError(\u0027Invalid URI authority.\u0027)\r\n }\r\n var userinfo = match[1]\r\n checkUserinfo(userinfo)\r\n var host = match[2]\r\n checkHost(host)\r\n var port = match[3]\r\n return {\r\n userinfo: userinfo,\r\n host: host,\r\n port: port\r\n }\r\n}\r\n\r\nfunction checkUserinfo (userinfo) {\r\n if (userinfo) {\r\n if (!userinfoRegExp.test(userinfo)) {\r\n throw new SyntaxError(\u0027Invalid URI userinfo.\u0027)\r\n }\r\n checkPercents(userinfo)\r\n }\r\n}\r\n\r\nfunction checkHost (host) {\r\n if (!host) {\r\n throw new SyntaxError(\u0027Missing URI host.\u0027)\r\n }\r\n if (checkIPv4address(host)) {\r\n return true\r\n }\r\n checkHostname(host)\r\n}\r\n\r\nfunction checkIPv4address (address) {\r\n var match = IPv4addressRegExp.exec(address)\r\n if (match) {\r\n if (match.some(function (octet, index) {\r\n return index \u0026\u0026 octet \u003E 255\r\n })) {\r\n throw new SyntaxError(\u0027Invalid IPv4 address.\u0027)\r\n }\r\n return true\r\n }\r\n}\r\n\r\nfunction checkHostname (host) {\r\n if (!regnameRegExp.test(host)) {\r\n throw new SyntaxError(\u0027Invalid URI hostname.\u0027)\r\n }\r\n}\r\n\r\nfunction checkBeginOfPath (path) {\r\n if (path) {\r\n if (path[0] === \u0027/\u0027) {\r\n path = path.substr(1)\r\n }\r\n var match = segmentNzRegExp.exec(path)\r\n if (!match) {\r\n throw new SyntaxError(\u0027Invalid URI path.\u0027)\r\n }\r\n match = match[0]\r\n checkPercents(match)\r\n checkRestOfPath(path.substr(match.length))\r\n }\r\n}\r\n\r\nfunction checkRestOfPath (path) {\r\n if (path) {\r\n path.split(\u0027/\u0027).forEach(checkPathSegment)\r\n checkPercents(path)\r\n }\r\n}\r\n\r\nfunction checkPathSegment (segment) {\r\n if (!segmentRegExp.test(segment)) {\r\n throw new SyntaxError(\u0027Invalid URI path segment.\u0027)\r\n }\r\n}\r\n\r\nfunction checkQuery (query) {\r\n if (query) {\r\n if (!queryRegExp.test(query)) {\r\n throw new SyntaxError(\u0027Invalid URI query.\u0027)\r\n }\r\n checkPercents(query)\r\n }\r\n}\r\n\r\nfunction checkFragment (fragment) {\r\n if (fragment) {\r\n if (!fragmentRegExp.test(fragment)) {\r\n throw new SyntaxError(\u0027Invalid URI fragment.\u0027)\r\n }\r\n checkPercents(fragment)\r\n }\r\n}\r\n\r\nfunction checkPercents (part) {\r\n for (var start = 0, length = part.length;;) {\r\n var percent = part.indexOf(\u0027%\u0027, start)\r\n if (percent \u003C 0) {\r\n break\r\n }\r\n percent \u002B= 3\r\n if (percent \u003C= length \u0026\u0026 check(percent - 2) \u0026\u0026 check(percent - 1)) {\r\n start = percent\r\n continue\r\n }\r\n throw new SyntaxError(\u0027Invalid percent encoding.\u0027)\r\n }\r\n\r\n function check(index) {\r\n code = part.codePointAt(index)\r\n if (code \u003E= 48 \u0026\u0026 code \u003C= 57) {\r\n return true\r\n }\r\n code \u0026= ~32\r\n if (code \u003E= 65 \u0026\u0026 code \u003C= 70) {\r\n return true\r\n }\r\n }\r\n}\r\n\r\nreturn {\r\n isURI: isURI\r\n}\r\n}())\r\n\r\nwindow.builtin = (function () {\r\nfunction parseURI (input) {\r\n return new URL(input)\r\n}\r\n\r\nfunction isURI (input) {\r\n try {\r\n parseURI(input)\r\n return true\r\n } catch (error) {\r\n return false\r\n }\r\n}\r\n\r\nreturn {\r\n isURI: isURI\r\n}\r\n}())\r\n\r\nwindow.url_parse = (function () {\r\nvar /*required = require(\u0027requires-port\u0027)\r\n , qs = require(\u0027querystringify\u0027)\r\n ,*/ protocolre = /^([a-z][a-z0-9.\u002B-]*:)?(\\/\\/)?([\\S\\s]*)/i\r\n , slashes = /^[A-Za-z][A-Za-z0-9\u002B-.]*:\\/\\//;\r\n\r\n/**\r\n * These are the parse rules for the URL parser, it informs the parser\r\n * about:\r\n *\r\n * 0. The char it Needs to parse, if it\u0027s a string it should be done using\r\n * indexOf, RegExp using exec and NaN means set as current value.\r\n * 1. The property we should set when parsing this value.\r\n * 2. Indication if it\u0027s backwards or forward parsing, when set as number it\u0027s\r\n * the value of extra chars that should be split off.\r\n * 3. Inherit from location if non existing in the parser.\r\n * 4. \u0060toLowerCase\u0060 the resulting value.\r\n */\r\nvar rules = [\r\n [\u0027#\u0027, \u0027hash\u0027], // Extract from the back.\r\n [\u0027?\u0027, \u0027query\u0027], // Extract from the back.\r\n [\u0027/\u0027, \u0027pathname\u0027], // Extract from the back.\r\n [\u0027@\u0027, \u0027auth\u0027, 1], // Extract from the front.\r\n [NaN, \u0027host\u0027, undefined, 1, 1], // Set left over value.\r\n [/:(\\d\u002B)$/, \u0027port\u0027, undefined, 1], // RegExp the back.\r\n [NaN, \u0027hostname\u0027, undefined, 1, 1] // Set left over.\r\n];\r\n\r\n/**\r\n * These properties should not be copied or inherited from. This is only needed\r\n * for all non blob URL\u0027s as a blob URL does not include a hash, only the\r\n * origin.\r\n *\r\n * @type {Object}\r\n * @private\r\n */\r\nvar ignore = { hash: 1, query: 1 };\r\n\r\n/**\r\n * The location object differs when your code is loaded through a normal page,\r\n * Worker or through a worker using a blob. And with the blobble begins the\r\n * trouble as the location object will contain the URL of the blob, not the\r\n * location of the page where our code is loaded in. The actual origin is\r\n * encoded in the \u0060pathname\u0060 so we can thankfully generate a good \u0022default\u0022\r\n * location from it so we can generate proper relative URL\u0027s again.\r\n *\r\n * @param {Object|String} loc Optional default location object.\r\n * @returns {Object} lolcation object.\r\n * @api public\r\n */\r\nfunction lolcation(loc) {\r\n loc = loc || global.location || {};\r\n\r\n var finaldestination = {}\r\n , type = typeof loc\r\n , key;\r\n\r\n if (\u0027blob:\u0027 === loc.protocol) {\r\n finaldestination = new URL(unescape(loc.pathname), {});\r\n } else if (\u0027string\u0027 === type) {\r\n finaldestination = new URL(loc, {});\r\n for (key in ignore) delete finaldestination[key];\r\n } else if (\u0027object\u0027 === type) {\r\n for (key in loc) {\r\n if (key in ignore) continue;\r\n finaldestination[key] = loc[key];\r\n }\r\n\r\n if (finaldestination.slashes === undefined) {\r\n finaldestination.slashes = slashes.test(loc.href);\r\n }\r\n }\r\n\r\n return finaldestination;\r\n}\r\n\r\n/**\r\n * @typedef ProtocolExtract\r\n * @type Object\r\n * @property {String} protocol Protocol matched in the URL, in lowercase.\r\n * @property {Boolean} slashes \u0060true\u0060 if protocol is followed by \u0022//\u0022, else \u0060false\u0060.\r\n * @property {String} rest Rest of the URL that is not part of the protocol.\r\n */\r\n\r\n/**\r\n * Extract protocol information from a URL with/without double slash (\u0022//\u0022).\r\n *\r\n * @param {String} address URL we want to extract from.\r\n * @return {ProtocolExtract} Extracted information.\r\n * @api private\r\n */\r\nfunction extractProtocol(address) {\r\n var match = protocolre.exec(address);\r\n\r\n return {\r\n protocol: match[1] ? match[1].toLowerCase() : \u0027\u0027,\r\n slashes: !!match[2],\r\n rest: match[3]\r\n };\r\n}\r\n\r\n/**\r\n * Resolve a relative URL pathname against a base URL pathname.\r\n *\r\n * @param {String} relative Pathname of the relative URL.\r\n * @param {String} base Pathname of the base URL.\r\n * @return {String} Resolved pathname.\r\n * @api private\r\n */\r\nfunction resolve(relative, base) {\r\n var path = (base || \u0027/\u0027).split(\u0027/\u0027).slice(0, -1).concat(relative.split(\u0027/\u0027))\r\n , i = path.length\r\n , last = path[i - 1]\r\n , unshift = false\r\n , up = 0;\r\n\r\n while (i--) {\r\n if (path[i] === \u0027.\u0027) {\r\n path.splice(i, 1);\r\n } else if (path[i] === \u0027..\u0027) {\r\n path.splice(i, 1);\r\n up\u002B\u002B;\r\n } else if (up) {\r\n if (i === 0) unshift = true;\r\n path.splice(i, 1);\r\n up--;\r\n }\r\n }\r\n\r\n if (unshift) path.unshift(\u0027\u0027);\r\n if (last === \u0027.\u0027 || last === \u0027..\u0027) path.push(\u0027\u0027);\r\n\r\n return path.join(\u0027/\u0027);\r\n}\r\n\r\n/**\r\n * The actual URL instance. Instead of returning an object we\u0027ve opted-in to\r\n * create an actual constructor as it\u0027s much more memory efficient and\r\n * faster and it pleases my OCD.\r\n *\r\n * @constructor\r\n * @param {String} address URL we want to parse.\r\n * @param {Object|String} location Location defaults for relative paths.\r\n * @param {Boolean|Function} parser Parser for the query string.\r\n * @api public\r\n */\r\nfunction URL(address, location, parser) {\r\n if (!(this instanceof URL)) {\r\n return new URL(address, location, parser);\r\n }\r\n\r\n var relative, extracted, parse, instruction, index, key\r\n , instructions = rules.slice()\r\n , type = typeof location\r\n , url = this\r\n , i = 0;\r\n\r\n //\r\n // The following if statements allows this module two have compatibility with\r\n // 2 different API:\r\n //\r\n // 1. Node.js\u0027s \u0060url.parse\u0060 api which accepts a URL, boolean as arguments\r\n // where the boolean indicates that the query string should also be parsed.\r\n //\r\n // 2. The \u0060URL\u0060 interface of the browser which accepts a URL, object as\r\n // arguments. The supplied object will be used as default values / fall-back\r\n // for relative paths.\r\n //\r\n if (\u0027object\u0027 !== type \u0026\u0026 \u0027string\u0027 !== type) {\r\n parser = location;\r\n location = null;\r\n }\r\n\r\n //if (parser \u0026\u0026 \u0027function\u0027 !== typeof parser) parser = qs.parse;\r\n\r\n location = lolcation(location);\r\n\r\n //\r\n // Extract protocol information before running the instructions.\r\n //\r\n extracted = extractProtocol(address || \u0027\u0027);\r\n relative = !extracted.protocol \u0026\u0026 !extracted.slashes;\r\n url.slashes = extracted.slashes || relative \u0026\u0026 location.slashes;\r\n url.protocol = extracted.protocol || location.protocol || \u0027\u0027;\r\n address = extracted.rest;\r\n\r\n //\r\n // When the authority component is absent the URL starts with a path\r\n // component.\r\n //\r\n if (!extracted.slashes) instructions[2] = [/(.*)/, \u0027pathname\u0027];\r\n\r\n for (; i \u003C instructions.length; i\u002B\u002B) {\r\n instruction = instructions[i];\r\n parse = instruction[0];\r\n key = instruction[1];\r\n\r\n if (parse !== parse) {\r\n url[key] = address;\r\n } else if (\u0027string\u0027 === typeof parse) {\r\n if (~(index = address.indexOf(parse))) {\r\n if (\u0027number\u0027 === typeof instruction[2]) {\r\n url[key] = address.slice(0, index);\r\n address = address.slice(index \u002B instruction[2]);\r\n } else {\r\n url[key] = address.slice(index);\r\n address = address.slice(0, index);\r\n }\r\n }\r\n } else if ((index = parse.exec(address))) {\r\n url[key] = index[1];\r\n address = address.slice(0, index.index);\r\n }\r\n\r\n url[key] = url[key] || (\r\n relative \u0026\u0026 instruction[3] ? location[key] || \u0027\u0027 : \u0027\u0027\r\n );\r\n\r\n //\r\n // Hostname, host and protocol should be lowercased so they can be used to\r\n // create a proper \u0060origin\u0060.\r\n //\r\n if (instruction[4]) url[key] = url[key].toLowerCase();\r\n }\r\n\r\n //\r\n // Also parse the supplied query string in to an object. If we\u0027re supplied\r\n // with a custom parser as function use that instead of the default build-in\r\n // parser.\r\n //\r\n if (parser) url.query = parser(url.query);\r\n\r\n //\r\n // If the URL is relative, resolve the pathname against the base URL.\r\n //\r\n if (\r\n relative\r\n \u0026\u0026 location.slashes\r\n \u0026\u0026 url.pathname.charAt(0) !== \u0027/\u0027\r\n \u0026\u0026 (url.pathname !== \u0027\u0027 || location.pathname !== \u0027\u0027)\r\n ) {\r\n url.pathname = resolve(url.pathname, location.pathname);\r\n }\r\n\r\n //\r\n // We should not add port numbers if they are already the default port number\r\n // for a given protocol. As the host also contains the port number we\u0027re going\r\n // override it with the hostname which contains no port number.\r\n //\r\n //if (!required(url.port, url.protocol)) {\r\n // url.host = url.hostname;\r\n // url.port = \u0027\u0027;\r\n //}\r\n\r\n //\r\n // Parse down the \u0060auth\u0060 for the username and password.\r\n //\r\n url.username = url.password = \u0027\u0027;\r\n if (url.auth) {\r\n instruction = url.auth.split(\u0027:\u0027);\r\n url.username = instruction[0] || \u0027\u0027;\r\n url.password = instruction[1] || \u0027\u0027;\r\n }\r\n\r\n url.origin = url.protocol \u0026\u0026 url.host \u0026\u0026 url.protocol !== \u0027file:\u0027\r\n ? url.protocol \u002B\u0027//\u0027\u002B url.host\r\n : \u0027null\u0027;\r\n\r\n //\r\n // The href is just the compiled result.\r\n //\r\n url.href = url.toString();\r\n}\r\n\r\n/**\r\n * This is convenience method for changing properties in the URL instance to\r\n * insure that they all propagate correctly.\r\n *\r\n * @param {String} part Property we need to adjust.\r\n * @param {Mixed} value The newly assigned value.\r\n * @param {Boolean|Function} fn When setting the query, it will be the function\r\n * used to parse the query.\r\n * When setting the protocol, double slash will be\r\n * removed from the final url if it is true.\r\n * @returns {URL}\r\n * @api public\r\n */\r\nfunction set(part, value, fn) {\r\n var url = this;\r\n\r\n switch (part) {\r\n case \u0027query\u0027:\r\n //if (\u0027string\u0027 === typeof value \u0026\u0026 value.length) {\r\n // value = (fn || qs.parse)(value);\r\n //}\r\n\r\n url[part] = value;\r\n break;\r\n\r\n case \u0027port\u0027:\r\n url[part] = value;\r\n\r\n //if (!required(value, url.protocol)) {\r\n // url.host = url.hostname;\r\n // url[part] = \u0027\u0027;\r\n //} else if (value) {\r\n url.host = url.hostname \u002B\u0027:\u0027\u002B value;\r\n //}\r\n\r\n break;\r\n\r\n case \u0027hostname\u0027:\r\n url[part] = value;\r\n\r\n if (url.port) value \u002B= \u0027:\u0027\u002B url.port;\r\n url.host = value;\r\n break;\r\n\r\n case \u0027host\u0027:\r\n url[part] = value;\r\n\r\n if (/:\\d\u002B$/.test(value)) {\r\n value = value.split(\u0027:\u0027);\r\n url.port = value.pop();\r\n url.hostname = value.join(\u0027:\u0027);\r\n } else {\r\n url.hostname = value;\r\n url.port = \u0027\u0027;\r\n }\r\n\r\n break;\r\n\r\n case \u0027protocol\u0027:\r\n url.protocol = value.toLowerCase();\r\n url.slashes = !fn;\r\n break;\r\n\r\n case \u0027pathname\u0027:\r\n case \u0027hash\u0027:\r\n if (value) {\r\n var char = part === \u0027pathname\u0027 ? \u0027/\u0027 : \u0027#\u0027;\r\n url[part] = value.charAt(0) !== char ? char \u002B value : value;\r\n } else {\r\n url[part] = value;\r\n }\r\n break;\r\n\r\n default:\r\n url[part] = value;\r\n }\r\n\r\n for (var i = 0; i \u003C rules.length; i\u002B\u002B) {\r\n var ins = rules[i];\r\n\r\n if (ins[4]) url[ins[1]] = url[ins[1]].toLowerCase();\r\n }\r\n\r\n url.origin = url.protocol \u0026\u0026 url.host \u0026\u0026 url.protocol !== \u0027file:\u0027\r\n ? url.protocol \u002B\u0027//\u0027\u002B url.host\r\n : \u0027null\u0027;\r\n\r\n url.href = url.toString();\r\n\r\n return url;\r\n}\r\n\r\n/**\r\n * Transform the properties back in to a valid and full URL string.\r\n *\r\n * @param {Function} stringify Optional query stringify function.\r\n * @returns {String}\r\n * @api public\r\n */\r\nfunction toString(stringify) {\r\n //if (!stringify || \u0027function\u0027 !== typeof stringify) stringify = qs.stringify;\r\n\r\n var query\r\n , url = this\r\n , protocol = url.protocol;\r\n\r\n if (protocol \u0026\u0026 protocol.charAt(protocol.length - 1) !== \u0027:\u0027) protocol \u002B= \u0027:\u0027;\r\n\r\n var result = protocol \u002B (url.slashes ? \u0027//\u0027 : \u0027\u0027);\r\n\r\n if (url.username) {\r\n result \u002B= url.username;\r\n if (url.password) result \u002B= \u0027:\u0027\u002B url.password;\r\n result \u002B= \u0027@\u0027;\r\n }\r\n\r\n result \u002B= url.host \u002B url.pathname;\r\n\r\n query = \u0027object\u0027 === typeof url.query ? stringify(url.query) : url.query;\r\n if (query) result \u002B= \u0027?\u0027 !== query.charAt(0) ? \u0027?\u0027\u002B query : query;\r\n\r\n if (url.hash) result \u002B= url.hash;\r\n\r\n return result;\r\n}\r\n\r\nURL.prototype = { set: set, toString: toString };\r\n\r\n//\r\n// Expose the URL parser and some additional properties that might be useful for\r\n// others or testing.\r\n//\r\nURL.extractProtocol = extractProtocol;\r\nURL.location = lolcation;\r\n//URL.qs = qs;\r\n\r\nfunction isURI (input) {\r\n try {\r\n new URL(input)\r\n return true\r\n } catch (error) {\r\n return false\r\n }\r\n}\r\n\r\nreturn {\r\n isURI: isURI\r\n}\r\n}())\r\n\r\nwindow.urlparser = (function () {\r\n/*\r\nCopyright (c) 2014 Petka Antonov\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a copy\r\nof this software and associated documentation files (the \u0022Software\u0022), to deal\r\nin the Software without restriction, including without limitation the rights\r\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\ncopies of the Software, and to permit persons to whom the Software is\r\nfurnished to do so, subject to the following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be included in\r\nall copies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \u0022AS IS\u0022, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r\nTHE SOFTWARE.\r\n*/\r\nfunction Url() {\r\n //For more efficient internal representation and laziness.\r\n //The non-underscore versions of these properties are accessor functions\r\n //defined on the prototype.\r\n this._protocol = null;\r\n this._href = \u0022\u0022;\r\n this._port = -1;\r\n this._query = null;\r\n\r\n this.auth = null;\r\n this.slashes = null;\r\n this.host = null;\r\n this.hostname = null;\r\n this.hash = null;\r\n this.search = null;\r\n this.pathname = null;\r\n\r\n this._prependSlash = false;\r\n}\r\n\r\nvar querystring /*= require(\u0022querystring\u0022)*/;\r\n\r\nUrl.queryString = querystring;\r\n\r\nUrl.prototype.parse =\r\nfunction Url$parse(str, parseQueryString, hostDenotesSlash, disableAutoEscapeChars) {\r\n if (typeof str !== \u0022string\u0022) {\r\n throw new TypeError(\u0022Parameter \u0027url\u0027 must be a string, not \u0022 \u002B\r\n typeof str);\r\n }\r\n var start = 0;\r\n var end = str.length - 1;\r\n\r\n //Trim leading and trailing ws\r\n while (str.charCodeAt(start) \u003C= 0x20 /*\u0027 \u0027*/) start\u002B\u002B;\r\n while (str.charCodeAt(end) \u003C= 0x20 /*\u0027 \u0027*/) end--;\r\n\r\n start = this._parseProtocol(str, start, end);\r\n\r\n //Javascript doesn\u0027t have host\r\n if (this._protocol !== \u0022javascript\u0022) {\r\n start = this._parseHost(str, start, end, hostDenotesSlash);\r\n var proto = this._protocol;\r\n if (!this.hostname \u0026\u0026\r\n (this.slashes || (proto \u0026\u0026 !slashProtocols[proto]))) {\r\n this.hostname = this.host = \u0022\u0022;\r\n }\r\n }\r\n\r\n if (start \u003C= end) {\r\n var ch = str.charCodeAt(start);\r\n\r\n if (ch === 0x2F /*\u0027/\u0027*/ || ch === 0x5C /*\u0027\\\u0027*/) {\r\n this._parsePath(str, start, end, disableAutoEscapeChars);\r\n }\r\n else if (ch === 0x3F /*\u0027?\u0027*/) {\r\n this._parseQuery(str, start, end, disableAutoEscapeChars);\r\n }\r\n else if (ch === 0x23 /*\u0027#\u0027*/) {\r\n this._parseHash(str, start, end, disableAutoEscapeChars);\r\n }\r\n else if (this._protocol !== \u0022javascript\u0022) {\r\n this._parsePath(str, start, end, disableAutoEscapeChars);\r\n }\r\n else { //For javascript the pathname is just the rest of it\r\n this.pathname = str.slice(start, end \u002B 1 );\r\n }\r\n\r\n }\r\n\r\n if (!this.pathname \u0026\u0026 this.hostname \u0026\u0026\r\n this._slashProtocols[this._protocol]) {\r\n this.pathname = \u0022/\u0022;\r\n }\r\n\r\n if (parseQueryString) {\r\n var search = this.search;\r\n if (search == null) {\r\n search = this.search = \u0022\u0022;\r\n }\r\n if (search.charCodeAt(0) === 0x3F /*\u0027?\u0027*/) {\r\n search = search.slice(1);\r\n }\r\n //This calls a setter function, there is no .query data property\r\n this.query = Url.queryString.parse(search);\r\n }\r\n};\r\n\r\nUrl.prototype.resolve = function Url$resolve(relative) {\r\n return this.resolveObject(Url.parse(relative, false, true)).format();\r\n};\r\n\r\nUrl.prototype.format = function Url$format() {\r\n var auth = this.auth || \u0022\u0022;\r\n\r\n if (auth) {\r\n auth = encodeURIComponent(auth);\r\n auth = auth.replace(/%3A/i, \u0022:\u0022);\r\n auth \u002B= \u0022@\u0022;\r\n }\r\n\r\n var protocol = this.protocol || \u0022\u0022;\r\n var pathname = this.pathname || \u0022\u0022;\r\n var hash = this.hash || \u0022\u0022;\r\n var search = this.search || \u0022\u0022;\r\n var query = \u0022\u0022;\r\n var hostname = this.hostname || \u0022\u0022;\r\n var port = this.port || \u0022\u0022;\r\n var host = false;\r\n var scheme = \u0022\u0022;\r\n\r\n //Cache the result of the getter function\r\n var q = this.query;\r\n if (q \u0026\u0026 typeof q === \u0022object\u0022) {\r\n query = Url.queryString.stringify(q);\r\n }\r\n\r\n if (!search) {\r\n search = query ? \u0022?\u0022 \u002B query : \u0022\u0022;\r\n }\r\n\r\n if (protocol \u0026\u0026 protocol.charCodeAt(protocol.length - 1) !== 0x3A /*\u0027:\u0027*/)\r\n protocol \u002B= \u0022:\u0022;\r\n\r\n if (this.host) {\r\n host = auth \u002B this.host;\r\n }\r\n else if (hostname) {\r\n var ip6 = hostname.indexOf(\u0022:\u0022) \u003E -1;\r\n if (ip6) hostname = \u0022[\u0022 \u002B hostname \u002B \u0022]\u0022;\r\n host = auth \u002B hostname \u002B (port ? \u0022:\u0022 \u002B port : \u0022\u0022);\r\n }\r\n\r\n var slashes = this.slashes ||\r\n ((!protocol ||\r\n slashProtocols[protocol]) \u0026\u0026 host !== false);\r\n\r\n\r\n if (protocol) scheme = protocol \u002B (slashes ? \u0022//\u0022 : \u0022\u0022);\r\n else if (slashes) scheme = \u0022//\u0022;\r\n\r\n if (slashes \u0026\u0026 pathname \u0026\u0026 pathname.charCodeAt(0) !== 0x2F /*\u0027/\u0027*/) {\r\n pathname = \u0022/\u0022 \u002B pathname;\r\n }\r\n if (search \u0026\u0026 search.charCodeAt(0) !== 0x3F /*\u0027?\u0027*/)\r\n search = \u0022?\u0022 \u002B search;\r\n if (hash \u0026\u0026 hash.charCodeAt(0) !== 0x23 /*\u0027#\u0027*/)\r\n hash = \u0022#\u0022 \u002B hash;\r\n\r\n pathname = escapePathName(pathname);\r\n search = escapeSearch(search);\r\n\r\n return scheme \u002B (host === false ? \u0022\u0022 : host) \u002B pathname \u002B search \u002B hash;\r\n};\r\n\r\nUrl.prototype.resolveObject = function Url$resolveObject(relative) {\r\n if (typeof relative === \u0022string\u0022)\r\n relative = Url.parse(relative, false, true);\r\n\r\n var result = this._clone();\r\n\r\n // hash is always overridden, no matter what.\r\n // even href=\u0022\u0022 will remove it.\r\n result.hash = relative.hash;\r\n\r\n // if the relative url is empty, then there\u0022s nothing left to do here.\r\n if (!relative.href) {\r\n result._href = \u0022\u0022;\r\n return result;\r\n }\r\n\r\n // hrefs like //foo/bar always cut to the protocol.\r\n if (relative.slashes \u0026\u0026 !relative._protocol) {\r\n relative._copyPropsTo(result, true);\r\n\r\n if (slashProtocols[result._protocol] \u0026\u0026\r\n result.hostname \u0026\u0026 !result.pathname) {\r\n result.pathname = \u0022/\u0022;\r\n }\r\n result._href = \u0022\u0022;\r\n return result;\r\n }\r\n\r\n if (relative._protocol \u0026\u0026 relative._protocol !== result._protocol) {\r\n // if it\u0022s a known url protocol, then changing\r\n // the protocol does weird things\r\n // first, if it\u0022s not file:, then we MUST have a host,\r\n // and if there was a path\r\n // to begin with, then we MUST have a path.\r\n // if it is file:, then the host is dropped,\r\n // because that\u0022s known to be hostless.\r\n // anything else is assumed to be absolute.\r\n if (!slashProtocols[relative._protocol]) {\r\n relative._copyPropsTo(result, false);\r\n result._href = \u0022\u0022;\r\n return result;\r\n }\r\n\r\n result._protocol = relative._protocol;\r\n if (!relative.host \u0026\u0026 relative._protocol !== \u0022javascript\u0022) {\r\n var relPath = (relative.pathname || \u0022\u0022).split(\u0022/\u0022);\r\n while (relPath.length \u0026\u0026 !(relative.host = relPath.shift()));\r\n if (!relative.host) relative.host = \u0022\u0022;\r\n if (!relative.hostname) relative.hostname = \u0022\u0022;\r\n if (relPath[0] !== \u0022\u0022) relPath.unshift(\u0022\u0022);\r\n if (relPath.length \u003C 2) relPath.unshift(\u0022\u0022);\r\n result.pathname = relPath.join(\u0022/\u0022);\r\n } else {\r\n result.pathname = relative.pathname;\r\n }\r\n\r\n result.search = relative.search;\r\n result.host = relative.host || \u0022\u0022;\r\n result.auth = relative.auth;\r\n result.hostname = relative.hostname || relative.host;\r\n result._port = relative._port;\r\n result.slashes = result.slashes || relative.slashes;\r\n result._href = \u0022\u0022;\r\n return result;\r\n }\r\n\r\n var isSourceAbs =\r\n (result.pathname \u0026\u0026 result.pathname.charCodeAt(0) === 0x2F /*\u0027/\u0027*/);\r\n var isRelAbs = (\r\n relative.host ||\r\n (relative.pathname \u0026\u0026\r\n relative.pathname.charCodeAt(0) === 0x2F /*\u0027/\u0027*/)\r\n );\r\n var mustEndAbs = (isRelAbs || isSourceAbs ||\r\n (result.host \u0026\u0026 relative.pathname));\r\n\r\n var removeAllDots = mustEndAbs;\r\n\r\n var srcPath = result.pathname \u0026\u0026 result.pathname.split(\u0022/\u0022) || [];\r\n var relPath = relative.pathname \u0026\u0026 relative.pathname.split(\u0022/\u0022) || [];\r\n var psychotic = result._protocol \u0026\u0026 !slashProtocols[result._protocol];\r\n\r\n // if the url is a non-slashed url, then relative\r\n // links like ../.. should be able\r\n // to crawl up to the hostname, as well. This is strange.\r\n // result.protocol has already been set by now.\r\n // Later on, put the first path part into the host field.\r\n if (psychotic) {\r\n result.hostname = \u0022\u0022;\r\n result._port = -1;\r\n if (result.host) {\r\n if (srcPath[0] === \u0022\u0022) srcPath[0] = result.host;\r\n else srcPath.unshift(result.host);\r\n }\r\n result.host = \u0022\u0022;\r\n if (relative._protocol) {\r\n relative.hostname = \u0022\u0022;\r\n relative._port = -1;\r\n if (relative.host) {\r\n if (relPath[0] === \u0022\u0022) relPath[0] = relative.host;\r\n else relPath.unshift(relative.host);\r\n }\r\n relative.host = \u0022\u0022;\r\n }\r\n mustEndAbs = mustEndAbs \u0026\u0026 (relPath[0] === \u0022\u0022 || srcPath[0] === \u0022\u0022);\r\n }\r\n\r\n if (isRelAbs) {\r\n // it\u0022s absolute.\r\n result.host = relative.host ?\r\n relative.host : result.host;\r\n result.hostname = relative.hostname ?\r\n relative.hostname : result.hostname;\r\n result.search = relative.search;\r\n srcPath = relPath;\r\n // fall through to the dot-handling below.\r\n } else if (relPath.length) {\r\n // it\u0022s relative\r\n // throw away the existing file, and take the new path instead.\r\n if (!srcPath) srcPath = [];\r\n srcPath.pop();\r\n srcPath = srcPath.concat(relPath);\r\n result.search = relative.search;\r\n } else if (relative.search) {\r\n // just pull out the search.\r\n // like href=\u0022?foo\u0022.\r\n // Put this after the other two cases because it simplifies the booleans\r\n if (psychotic) {\r\n result.hostname = result.host = srcPath.shift();\r\n //occationaly the auth can get stuck only in host\r\n //this especialy happens in cases like\r\n //url.resolveObject(\u0022mailto:local1@domain1\u0022, \u0022local2@domain2\u0022)\r\n var authInHost = result.host \u0026\u0026 result.host.indexOf(\u0022@\u0022) \u003E 0 ?\r\n result.host.split(\u0022@\u0022) : false;\r\n if (authInHost) {\r\n result.auth = authInHost.shift();\r\n result.host = result.hostname = authInHost.shift();\r\n }\r\n }\r\n result.search = relative.search;\r\n result._href = \u0022\u0022;\r\n return result;\r\n }\r\n\r\n if (!srcPath.length) {\r\n // no path at all. easy.\r\n // we\u0022ve already handled the other stuff above.\r\n result.pathname = null;\r\n result._href = \u0022\u0022;\r\n return result;\r\n }\r\n\r\n // if a url ENDs in . or .., then it must get a trailing slash.\r\n // however, if it ends in anything else non-slashy,\r\n // then it must NOT get a trailing slash.\r\n var last = srcPath.slice(-1)[0];\r\n var hasTrailingSlash = (\r\n (result.host || relative.host) \u0026\u0026 (last === \u0022.\u0022 || last === \u0022..\u0022) ||\r\n last === \u0022\u0022);\r\n\r\n // strip single dots, resolve double dots to parent dir\r\n // if the path tries to go above the root, \u0060up\u0060 ends up \u003E 0\r\n var up = 0;\r\n for (var i = srcPath.length; i \u003E= 0; i--) {\r\n last = srcPath[i];\r\n if (last === \u0022.\u0022) {\r\n srcPath.splice(i, 1);\r\n } else if (last === \u0022..\u0022) {\r\n srcPath.splice(i, 1);\r\n up\u002B\u002B;\r\n } else if (up) {\r\n srcPath.splice(i, 1);\r\n up--;\r\n }\r\n }\r\n\r\n // if the path is allowed to go above the root, restore leading ..s\r\n if (!mustEndAbs \u0026\u0026 !removeAllDots) {\r\n for (; up--; up) {\r\n srcPath.unshift(\u0022..\u0022);\r\n }\r\n }\r\n\r\n if (mustEndAbs \u0026\u0026 srcPath[0] !== \u0022\u0022 \u0026\u0026\r\n (!srcPath[0] || srcPath[0].charCodeAt(0) !== 0x2F /*\u0027/\u0027*/)) {\r\n srcPath.unshift(\u0022\u0022);\r\n }\r\n\r\n if (hasTrailingSlash \u0026\u0026 (srcPath.join(\u0022/\u0022).substr(-1) !== \u0022/\u0022)) {\r\n srcPath.push(\u0022\u0022);\r\n }\r\n\r\n var isAbsolute = srcPath[0] === \u0022\u0022 ||\r\n (srcPath[0] \u0026\u0026 srcPath[0].charCodeAt(0) === 0x2F /*\u0027/\u0027*/);\r\n\r\n // put the host back\r\n if (psychotic) {\r\n result.hostname = result.host = isAbsolute ? \u0022\u0022 :\r\n srcPath.length ? srcPath.shift() : \u0022\u0022;\r\n //occationaly the auth can get stuck only in host\r\n //this especialy happens in cases like\r\n //url.resolveObject(\u0022mailto:local1@domain1\u0022, \u0022local2@domain2\u0022)\r\n var authInHost = result.host \u0026\u0026 result.host.indexOf(\u0022@\u0022) \u003E 0 ?\r\n result.host.split(\u0022@\u0022) : false;\r\n if (authInHost) {\r\n result.auth = authInHost.shift();\r\n result.host = result.hostname = authInHost.shift();\r\n }\r\n }\r\n\r\n mustEndAbs = mustEndAbs || (result.host \u0026\u0026 srcPath.length);\r\n\r\n if (mustEndAbs \u0026\u0026 !isAbsolute) {\r\n srcPath.unshift(\u0022\u0022);\r\n }\r\n\r\n result.pathname = srcPath.length === 0 ? null : srcPath.join(\u0022/\u0022);\r\n result.auth = relative.auth || result.auth;\r\n result.slashes = result.slashes || relative.slashes;\r\n result._href = \u0022\u0022;\r\n return result;\r\n};\r\n\r\nvar punycode /*= require(\u0022punycode\u0022)*/;\r\nUrl.prototype._hostIdna = function Url$_hostIdna(hostname) {\r\n // IDNA Support: Returns a punycoded representation of \u0022domain\u0022.\r\n // It only converts parts of the domain name that\r\n // have non-ASCII characters, i.e. it doesn\u0027t matter if\r\n // you call it with a domain that already is ASCII-only.\r\n return hostname;//punycode.toASCII(hostname);\r\n};\r\n\r\nvar escapePathName = Url.prototype._escapePathName =\r\nfunction Url$_escapePathName(pathname) {\r\n if (!containsCharacter2(pathname, 0x23 /*\u0027#\u0027*/, 0x3F /*\u0027?\u0027*/)) {\r\n return pathname;\r\n }\r\n //Avoid closure creation to keep this inlinable\r\n return _escapePath(pathname);\r\n};\r\n\r\nvar escapeSearch = Url.prototype._escapeSearch =\r\nfunction Url$_escapeSearch(search) {\r\n if (!containsCharacter2(search, 0x23 /*\u0027#\u0027*/, -1)) return search;\r\n //Avoid closure creation to keep this inlinable\r\n return _escapeSearch(search);\r\n};\r\n\r\nUrl.prototype._parseProtocol = function Url$_parseProtocol(str, start, end) {\r\n var doLowerCase = false;\r\n var protocolCharacters = this._protocolCharacters;\r\n\r\n for (var i = start; i \u003C= end; \u002B\u002Bi) {\r\n var ch = str.charCodeAt(i);\r\n\r\n if (ch === 0x3A /*\u0027:\u0027*/) {\r\n var protocol = str.slice(start, i);\r\n if (doLowerCase) protocol = protocol.toLowerCase();\r\n this._protocol = protocol;\r\n return i \u002B 1;\r\n }\r\n else if (protocolCharacters[ch] === 1) {\r\n if (ch \u003C 0x61 /*\u0027a\u0027*/)\r\n doLowerCase = true;\r\n }\r\n else {\r\n return start;\r\n }\r\n\r\n }\r\n return start;\r\n};\r\n\r\nUrl.prototype._parseAuth = function Url$_parseAuth(str, start, end, decode) {\r\n var auth = str.slice(start, end \u002B 1);\r\n if (decode) {\r\n auth = decodeURIComponent(auth);\r\n }\r\n this.auth = auth;\r\n};\r\n\r\nUrl.prototype._parsePort = function Url$_parsePort(str, start, end) {\r\n //Internal format is integer for more efficient parsing\r\n //and for efficient trimming of leading zeros\r\n var port = 0;\r\n //Distinguish between :0 and : (no port number at all)\r\n var hadChars = false;\r\n var validPort = true;\r\n\r\n for (var i = start; i \u003C= end; \u002B\u002Bi) {\r\n var ch = str.charCodeAt(i);\r\n\r\n if (0x30 /*\u00270\u0027*/ \u003C= ch \u0026\u0026 ch \u003C= 0x39 /*\u00279\u0027*/) {\r\n port = (10 * port) \u002B (ch - 0x30 /*\u00270\u0027*/);\r\n hadChars = true;\r\n }\r\n else {\r\n validPort = false;\r\n if (ch === 0x5C/*\u0027\\\u0027*/ || ch === 0x2F/*\u0027/\u0027*/) {\r\n validPort = true;\r\n }\r\n break;\r\n }\r\n\r\n }\r\n if ((port === 0 \u0026\u0026 !hadChars) || !validPort) {\r\n if (!validPort) {\r\n this._port = -2;\r\n }\r\n return 0;\r\n }\r\n\r\n this._port = port;\r\n return i - start;\r\n};\r\n\r\nUrl.prototype._parseHost =\r\nfunction Url$_parseHost(str, start, end, slashesDenoteHost) {\r\n var hostEndingCharacters = this._hostEndingCharacters;\r\n var first = str.charCodeAt(start);\r\n var second = str.charCodeAt(start \u002B 1);\r\n if ((first === 0x2F /*\u0027/\u0027*/ || first === 0x5C /*\u0027\\\u0027*/) \u0026\u0026\r\n (second === 0x2F /*\u0027/\u0027*/ || second === 0x5C /*\u0027\\\u0027*/)) {\r\n this.slashes = true;\r\n\r\n //The string starts with //\r\n if (start === 0) {\r\n //The string is just \u0022//\u0022\r\n if (end \u003C 2) return start;\r\n //If slashes do not denote host and there is no auth,\r\n //there is no host when the string starts with //\r\n var hasAuth =\r\n containsCharacter(str, 0x40 /*\u0027@\u0027*/, 2, hostEndingCharacters);\r\n if (!hasAuth \u0026\u0026 !slashesDenoteHost) {\r\n this.slashes = null;\r\n return start;\r\n }\r\n }\r\n //There is a host that starts after the //\r\n start \u002B= 2;\r\n }\r\n //If there is no slashes, there is no hostname if\r\n //1. there was no protocol at all\r\n else if (!this._protocol ||\r\n //2. there was a protocol that requires slashes\r\n //e.g. in \u0027http:asd\u0027 \u0027asd\u0027 is not a hostname\r\n slashProtocols[this._protocol]\r\n ) {\r\n return start;\r\n }\r\n\r\n var doLowerCase = false;\r\n var idna = false;\r\n var hostNameStart = start;\r\n var hostNameEnd = end;\r\n var lastCh = -1;\r\n var portLength = 0;\r\n var charsAfterDot = 0;\r\n var authNeedsDecoding = false;\r\n\r\n var j = -1;\r\n\r\n //Find the last occurrence of an @-sign until hostending character is met\r\n //also mark if decoding is needed for the auth portion\r\n for (var i = start; i \u003C= end; \u002B\u002Bi) {\r\n var ch = str.charCodeAt(i);\r\n\r\n if (ch === 0x40 /*\u0027@\u0027*/) {\r\n j = i;\r\n }\r\n //This check is very, very cheap. Unneeded decodeURIComponent is very\r\n //very expensive\r\n else if (ch === 0x25 /*\u0027%\u0027*/) {\r\n authNeedsDecoding = true;\r\n }\r\n else if (hostEndingCharacters[ch] === 1) {\r\n break;\r\n }\r\n }\r\n\r\n //@-sign was found at index j, everything to the left from it\r\n //is auth part\r\n if (j \u003E -1) {\r\n this._parseAuth(str, start, j - 1, authNeedsDecoding);\r\n //hostname starts after the last @-sign\r\n start = hostNameStart = j \u002B 1;\r\n }\r\n\r\n //Host name is starting with a [\r\n if (str.charCodeAt(start) === 0x5B /*\u0027[\u0027*/) {\r\n for (var i = start \u002B 1; i \u003C= end; \u002B\u002Bi) {\r\n var ch = str.charCodeAt(i);\r\n\r\n //Assume valid IP6 is between the brackets\r\n if (ch === 0x5D /*\u0027]\u0027*/) {\r\n if (str.charCodeAt(i \u002B 1) === 0x3A /*\u0027:\u0027*/) {\r\n portLength = this._parsePort(str, i \u002B 2, end) \u002B 1;\r\n }\r\n var hostname = str.slice(start \u002B 1, i).toLowerCase();\r\n this.hostname = hostname;\r\n this.host = this._port \u003E 0 ?\r\n \u0022[\u0022 \u002B hostname \u002B \u0022]:\u0022 \u002B this._port :\r\n \u0022[\u0022 \u002B hostname \u002B \u0022]\u0022;\r\n this.pathname = \u0022/\u0022;\r\n return i \u002B portLength \u002B 1;\r\n }\r\n }\r\n //Empty hostname, [ starts a path\r\n return start;\r\n }\r\n\r\n for (var i = start; i \u003C= end; \u002B\u002Bi) {\r\n if (charsAfterDot \u003E 62) {\r\n this.hostname = this.host = str.slice(start, i);\r\n return i;\r\n }\r\n var ch = str.charCodeAt(i);\r\n\r\n if (ch === 0x3A /*\u0027:\u0027*/) {\r\n portLength = this._parsePort(str, i \u002B 1, end) \u002B 1;\r\n hostNameEnd = i - 1;\r\n break;\r\n }\r\n else if (ch \u003C 0x61 /*\u0027a\u0027*/) {\r\n if (ch === 0x2E /*\u0027.\u0027*/) {\r\n //Node.js ignores this error\r\n /*\r\n if (lastCh === DOT || lastCh === -1) {\r\n this.hostname = this.host = \u0022\u0022;\r\n return start;\r\n }\r\n */\r\n charsAfterDot = -1;\r\n }\r\n else if (0x41 /*\u0027A\u0027*/ \u003C= ch \u0026\u0026 ch \u003C= 0x5A /*\u0027Z\u0027*/) {\r\n doLowerCase = true;\r\n }\r\n //Valid characters other than ASCII letters -, _, \u002B, 0-9\r\n else if (!(ch === 0x2D /*\u0027-\u0027*/ ||\r\n ch === 0x5F /*\u0027_\u0027*/ ||\r\n ch === 0x2B /*\u0027\u002B\u0027*/ ||\r\n (0x30 /*\u00270\u0027*/ \u003C= ch \u0026\u0026 ch \u003C= 0x39 /*\u00279\u0027*/))\r\n ) {\r\n if (hostEndingCharacters[ch] === 0 \u0026\u0026\r\n this._noPrependSlashHostEnders[ch] === 0) {\r\n this._prependSlash = true;\r\n }\r\n hostNameEnd = i - 1;\r\n break;\r\n }\r\n }\r\n else if (ch \u003E= 0x7B /*\u0027{\u0027*/) {\r\n if (ch \u003C= 0x7E /*\u0027~\u0027*/) {\r\n if (this._noPrependSlashHostEnders[ch] === 0) {\r\n this._prependSlash = true;\r\n }\r\n hostNameEnd = i - 1;\r\n break;\r\n }\r\n idna = true;\r\n }\r\n lastCh = ch;\r\n charsAfterDot\u002B\u002B;\r\n }\r\n\r\n //Node.js ignores this error\r\n /*\r\n if (lastCh === DOT) {\r\n hostNameEnd--;\r\n }\r\n */\r\n\r\n if (hostNameEnd \u002B 1 !== start \u0026\u0026\r\n hostNameEnd - hostNameStart \u003C= 256) {\r\n var hostname = str.slice(hostNameStart, hostNameEnd \u002B 1);\r\n if (doLowerCase) hostname = hostname.toLowerCase();\r\n if (idna) hostname = this._hostIdna(hostname);\r\n this.hostname = hostname;\r\n this.host = this._port \u003E 0 ? hostname \u002B \u0022:\u0022 \u002B this._port : hostname;\r\n }\r\n\r\n return hostNameEnd \u002B 1 \u002B portLength;\r\n\r\n};\r\n\r\nUrl.prototype._copyPropsTo = function Url$_copyPropsTo(input, noProtocol) {\r\n if (!noProtocol) {\r\n input._protocol = this._protocol;\r\n }\r\n input._href = this._href;\r\n input._port = this._port;\r\n input._prependSlash = this._prependSlash;\r\n input.auth = this.auth;\r\n input.slashes = this.slashes;\r\n input.host = this.host;\r\n input.hostname = this.hostname;\r\n input.hash = this.hash;\r\n input.search = this.search;\r\n input.pathname = this.pathname;\r\n};\r\n\r\nUrl.prototype._clone = function Url$_clone() {\r\n var ret = new Url();\r\n ret._protocol = this._protocol;\r\n ret._href = this._href;\r\n ret._port = this._port;\r\n ret._prependSlash = this._prependSlash;\r\n ret.auth = this.auth;\r\n ret.slashes = this.slashes;\r\n ret.host = this.host;\r\n ret.hostname = this.hostname;\r\n ret.hash = this.hash;\r\n ret.search = this.search;\r\n ret.pathname = this.pathname;\r\n return ret;\r\n};\r\n\r\nUrl.prototype._getComponentEscaped =\r\nfunction Url$_getComponentEscaped(str, start, end, isAfterQuery) {\r\n var cur = start;\r\n var i = start;\r\n var ret = \u0022\u0022;\r\n var autoEscapeMap = isAfterQuery ?\r\n this._afterQueryAutoEscapeMap : this._autoEscapeMap;\r\n for (; i \u003C= end; \u002B\u002Bi) {\r\n var ch = str.charCodeAt(i);\r\n var escaped = autoEscapeMap[ch];\r\n\r\n if (escaped !== \u0022\u0022 \u0026\u0026 escaped !== undefined) {\r\n if (cur \u003C i) ret \u002B= str.slice(cur, i);\r\n ret \u002B= escaped;\r\n cur = i \u002B 1;\r\n }\r\n }\r\n if (cur \u003C i \u002B 1) ret \u002B= str.slice(cur, i);\r\n return ret;\r\n};\r\n\r\nUrl.prototype._parsePath =\r\nfunction Url$_parsePath(str, start, end, disableAutoEscapeChars) {\r\n var pathStart = start;\r\n var pathEnd = end;\r\n var escape = false;\r\n var autoEscapeCharacters = this._autoEscapeCharacters;\r\n var prePath = this._port === -2 ? \u0022/:\u0022 : \u0022\u0022;\r\n\r\n for (var i = start; i \u003C= end; \u002B\u002Bi) {\r\n var ch = str.charCodeAt(i);\r\n if (ch === 0x23 /*\u0027#\u0027*/) {\r\n this._parseHash(str, i, end, disableAutoEscapeChars);\r\n pathEnd = i - 1;\r\n break;\r\n }\r\n else if (ch === 0x3F /*\u0027?\u0027*/) {\r\n this._parseQuery(str, i, end, disableAutoEscapeChars);\r\n pathEnd = i - 1;\r\n break;\r\n }\r\n else if (!disableAutoEscapeChars \u0026\u0026 !escape \u0026\u0026 autoEscapeCharacters[ch] === 1) {\r\n escape = true;\r\n }\r\n }\r\n\r\n if (pathStart \u003E pathEnd) {\r\n this.pathname = prePath === \u0022\u0022 ? \u0022/\u0022 : prePath;\r\n return;\r\n }\r\n\r\n var path;\r\n if (escape) {\r\n path = this._getComponentEscaped(str, pathStart, pathEnd, false);\r\n }\r\n else {\r\n path = str.slice(pathStart, pathEnd \u002B 1);\r\n }\r\n this.pathname = prePath === \u0022\u0022\r\n ? (this._prependSlash ? \u0022/\u0022 \u002B path : path)\r\n : prePath \u002B path;\r\n};\r\n\r\nUrl.prototype._parseQuery = function Url$_parseQuery(str, start, end, disableAutoEscapeChars) {\r\n var queryStart = start;\r\n var queryEnd = end;\r\n var escape = false;\r\n var autoEscapeCharacters = this._autoEscapeCharacters;\r\n\r\n for (var i = start; i \u003C= end; \u002B\u002Bi) {\r\n var ch = str.charCodeAt(i);\r\n\r\n if (ch === 0x23 /*\u0027#\u0027*/) {\r\n this._parseHash(str, i, end, disableAutoEscapeChars);\r\n queryEnd = i - 1;\r\n break;\r\n }\r\n else if (!disableAutoEscapeChars \u0026\u0026 !escape \u0026\u0026 autoEscapeCharacters[ch] === 1) {\r\n escape = true;\r\n }\r\n }\r\n\r\n if (queryStart \u003E queryEnd) {\r\n this.search = \u0022\u0022;\r\n return;\r\n }\r\n\r\n var query;\r\n if (escape) {\r\n query = this._getComponentEscaped(str, queryStart, queryEnd, true);\r\n }\r\n else {\r\n query = str.slice(queryStart, queryEnd \u002B 1);\r\n }\r\n this.search = query;\r\n};\r\n\r\nUrl.prototype._parseHash = function Url$_parseHash(str, start, end, disableAutoEscapeChars) {\r\n if (start \u003E end) {\r\n this.hash = \u0022\u0022;\r\n return;\r\n }\r\n\r\n this.hash = disableAutoEscapeChars ?\r\n str.slice(start, end \u002B 1) : this._getComponentEscaped(str, start, end, true);\r\n};\r\n\r\nObject.defineProperty(Url.prototype, \u0022port\u0022, {\r\n get: function() {\r\n if (this._port \u003E= 0) {\r\n return (\u0022\u0022 \u002B this._port);\r\n }\r\n return null;\r\n },\r\n set: function(v) {\r\n if (v == null) {\r\n this._port = -1;\r\n }\r\n else {\r\n this._port = parseInt(v, 10);\r\n }\r\n }\r\n});\r\n\r\nObject.defineProperty(Url.prototype, \u0022query\u0022, {\r\n get: function() {\r\n var query = this._query;\r\n if (query != null) {\r\n return query;\r\n }\r\n var search = this.search;\r\n\r\n if (search) {\r\n if (search.charCodeAt(0) === 0x3F /*\u0027?\u0027*/) {\r\n search = search.slice(1);\r\n }\r\n if (search !== \u0022\u0022) {\r\n this._query = search;\r\n return search;\r\n }\r\n }\r\n return search;\r\n },\r\n set: function(v) {\r\n this._query = v;\r\n }\r\n});\r\n\r\nObject.defineProperty(Url.prototype, \u0022path\u0022, {\r\n get: function() {\r\n var p = this.pathname || \u0022\u0022;\r\n var s = this.search || \u0022\u0022;\r\n if (p || s) {\r\n return p \u002B s;\r\n }\r\n return (p == null \u0026\u0026 s) ? (\u0022/\u0022 \u002B s) : null;\r\n },\r\n set: function() {}\r\n});\r\n\r\nObject.defineProperty(Url.prototype, \u0022protocol\u0022, {\r\n get: function() {\r\n var proto = this._protocol;\r\n return proto ? proto \u002B \u0022:\u0022 : proto;\r\n },\r\n set: function(v) {\r\n if (typeof v === \u0022string\u0022) {\r\n var end = v.length - 1;\r\n if (v.charCodeAt(end) === 0x3A /*\u0027:\u0027*/) {\r\n this._protocol = v.slice(0, end);\r\n }\r\n else {\r\n this._protocol = v;\r\n }\r\n }\r\n else if (v == null) {\r\n this._protocol = null;\r\n }\r\n }\r\n});\r\n\r\nObject.defineProperty(Url.prototype, \u0022href\u0022, {\r\n get: function() {\r\n var href = this._href;\r\n if (!href) {\r\n href = this._href = this.format();\r\n }\r\n return href;\r\n },\r\n set: function(v) {\r\n this._href = v;\r\n }\r\n});\r\n\r\nUrl.parse = function Url$Parse(str, parseQueryString, hostDenotesSlash, disableAutoEscapeChars) {\r\n if (str instanceof Url) return str;\r\n var ret = new Url();\r\n ret.parse(str, !!parseQueryString, !!hostDenotesSlash, !!disableAutoEscapeChars);\r\n return ret;\r\n};\r\n\r\nUrl.format = function Url$Format(obj) {\r\n if (typeof obj === \u0022string\u0022) {\r\n obj = Url.parse(obj);\r\n }\r\n if (!(obj instanceof Url)) {\r\n return Url.prototype.format.call(obj);\r\n }\r\n return obj.format();\r\n};\r\n\r\nUrl.resolve = function Url$Resolve(source, relative) {\r\n return Url.parse(source, false, true).resolve(relative);\r\n};\r\n\r\nUrl.resolveObject = function Url$ResolveObject(source, relative) {\r\n if (!source) return relative;\r\n return Url.parse(source, false, true).resolveObject(relative);\r\n};\r\n\r\nfunction _escapePath(pathname) {\r\n return pathname.replace(/[?#]/g, function(match) {\r\n return encodeURIComponent(match);\r\n });\r\n}\r\n\r\nfunction _escapeSearch(search) {\r\n return search.replace(/#/g, function(match) {\r\n return encodeURIComponent(match);\r\n });\r\n}\r\n\r\n//Search \u0060char1\u0060 (integer code for a character) in \u0060string\u0060\r\n//starting from \u0060fromIndex\u0060 and ending at \u0060string.length - 1\u0060\r\n//or when a stop character is found\r\nfunction containsCharacter(string, char1, fromIndex, stopCharacterTable) {\r\n var len = string.length;\r\n for (var i = fromIndex; i \u003C len; \u002B\u002Bi) {\r\n var ch = string.charCodeAt(i);\r\n\r\n if (ch === char1) {\r\n return true;\r\n }\r\n else if (stopCharacterTable[ch] === 1) {\r\n return false;\r\n }\r\n }\r\n return false;\r\n}\r\n\r\n//See if \u0060char1\u0060 or \u0060char2\u0060 (integer codes for characters)\r\n//is contained in \u0060string\u0060\r\nfunction containsCharacter2(string, char1, char2) {\r\n for (var i = 0, len = string.length; i \u003C len; \u002B\u002Bi) {\r\n var ch = string.charCodeAt(i);\r\n if (ch === char1 || ch === char2) return true;\r\n }\r\n return false;\r\n}\r\n\r\n//Makes an array of 128 uint8\u0027s which represent boolean values.\r\n//Spec is an array of ascii code points or ascii code point ranges\r\n//ranges are expressed as [start, end]\r\n\r\n//Create a table with the characters 0x30-0x39 (decimals \u00270\u0027 - \u00279\u0027) and\r\n//0x7A (lowercaseletter \u0027z\u0027) as \u0060true\u0060:\r\n//\r\n//var a = makeAsciiTable([[0x30, 0x39], 0x7A]);\r\n//a[0x30]; //1\r\n//a[0x15]; //0\r\n//a[0x35]; //1\r\nfunction makeAsciiTable(spec) {\r\n var ret = new Uint8Array(128);\r\n spec.forEach(function(item){\r\n if (typeof item === \u0022number\u0022) {\r\n ret[item] = 1;\r\n }\r\n else {\r\n var start = item[0];\r\n var end = item[1];\r\n for (var j = start; j \u003C= end; \u002B\u002Bj) {\r\n ret[j] = 1;\r\n }\r\n }\r\n });\r\n\r\n return ret;\r\n}\r\n\r\n\r\nvar autoEscape = [\u0022\u003C\u0022, \u0022\u003E\u0022, \u0022\\\u0022\u0022, \u0022\u0060\u0022, \u0022 \u0022, \u0022\\r\u0022, \u0022\\n\u0022,\r\n \u0022\\t\u0022, \u0022{\u0022, \u0022}\u0022, \u0022|\u0022, \u0022\\\\\u0022, \u0022^\u0022, \u0022\u0060\u0022, \u0022\u0027\u0022];\r\n\r\nvar autoEscapeMap = new Array(128);\r\n\r\n\r\n\r\nfor (var i = 0, len = autoEscapeMap.length; i \u003C len; \u002B\u002Bi) {\r\n autoEscapeMap[i] = \u0022\u0022;\r\n}\r\n\r\nfor (var i = 0, len = autoEscape.length; i \u003C len; \u002B\u002Bi) {\r\n var c = autoEscape[i];\r\n var esc = encodeURIComponent(c);\r\n if (esc === c) {\r\n esc = escape(c);\r\n }\r\n autoEscapeMap[c.charCodeAt(0)] = esc;\r\n}\r\nvar afterQueryAutoEscapeMap = autoEscapeMap.slice();\r\nautoEscapeMap[0x5C /*\u0027\\\u0027*/] = \u0022/\u0022;\r\n\r\nvar slashProtocols = Url.prototype._slashProtocols = {\r\n http: true,\r\n https: true,\r\n gopher: true,\r\n file: true,\r\n ftp: true,\r\n\r\n \u0022http:\u0022: true,\r\n \u0022https:\u0022: true,\r\n \u0022gopher:\u0022: true,\r\n \u0022file:\u0022: true,\r\n \u0022ftp:\u0022: true\r\n};\r\n\r\n//Optimize back from normalized object caused by non-identifier keys\r\nfunction f(){}\r\nf.prototype = slashProtocols;\r\n\r\nUrl.prototype._protocolCharacters = makeAsciiTable([\r\n [0x61 /*\u0027a\u0027*/, 0x7A /*\u0027z\u0027*/],\r\n [0x41 /*\u0027A\u0027*/, 0x5A /*\u0027Z\u0027*/],\r\n 0x2E /*\u0027.\u0027*/, 0x2B /*\u0027\u002B\u0027*/, 0x2D /*\u0027-\u0027*/\r\n]);\r\n\r\nUrl.prototype._hostEndingCharacters = makeAsciiTable([\r\n 0x23 /*\u0027#\u0027*/, 0x3F /*\u0027?\u0027*/, 0x2F /*\u0027/\u0027*/, 0x5C /*\u0027\\\u0027*/\r\n]);\r\n\r\nUrl.prototype._autoEscapeCharacters = makeAsciiTable(\r\n autoEscape.map(function(v) {\r\n return v.charCodeAt(0);\r\n })\r\n);\r\n\r\n//If these characters end a host name, the path will not be prepended a /\r\nUrl.prototype._noPrependSlashHostEnders = makeAsciiTable(\r\n [\r\n \u0022\u003C\u0022, \u0022\u003E\u0022, \u0022\u0027\u0022, \u0022\u0060\u0022, \u0022 \u0022, \u0022\\r\u0022,\r\n \u0022\\n\u0022, \u0022\\t\u0022, \u0022{\u0022, \u0022}\u0022, \u0022|\u0022,\r\n \u0022^\u0022, \u0022\u0060\u0022, \u0022\\\u0022\u0022, \u0022%\u0022, \u0022;\u0022\r\n ].map(function(v) {\r\n return v.charCodeAt(0);\r\n })\r\n);\r\n\r\nUrl.prototype._autoEscapeMap = autoEscapeMap;\r\nUrl.prototype._afterQueryAutoEscapeMap = afterQueryAutoEscapeMap;\r\n\r\nUrl.replace = function Url$Replace() {\r\n require.cache.url = {\r\n exports: Url\r\n };\r\n};\r\n\r\nfunction isURI (input) {\r\n try {\r\n new Url(input)\r\n return true\r\n } catch (error) {\r\n return false\r\n }\r\n}\r\n\r\nreturn {\r\n isURI: isURI\r\n}\r\n}())\r\n\r\nwindow.uri_parse = (function () {\r\n/**\r\n * Created by hustcc on 17/11/11.\r\n * Contract: i@hust.cc\r\n */\r\n\r\n/*\r\n * graph from https://github.com/Xsoda/url\r\n * parse url like this\r\n *\r\n * schema://username:password@host:port/path?key=value#fragment;key=value\r\n * \\____/ \\______/ \\______/ \\__/ \\__/ \\__/ \\_______/ \\______/ \\______/\r\n * | | | | | | | | |\r\n * schema | password | port | query fragment |\r\n * username host path extension\r\n *\r\n * note:\r\n * - username, password, port, path, query, fragment, extension is optional.\r\n * - scheme, host must be setting.\r\n * - username and password must be paired.\r\n */\r\n\r\nfunction URI(uri) {\r\n this.uri = uri;\r\n this._pos = 0;\r\n\r\n // the instance has properties below:\r\n //\r\n // this.schema\r\n // this.username\r\n // this.password\r\n // this.host\r\n // this.port\r\n // this.path\r\n // this.query\r\n // this.fragment\r\n // this.extension\r\n\r\n this._parse();\r\n}\r\n\r\nURI.prototype._end = function() {\r\n return this._pos \u003E= this.uri.length;\r\n};\r\n\r\nURI.prototype._next = function() {\r\n return this.uri[this._pos \u002B= 1];\r\n};\r\n\r\nURI.prototype._current = function() {\r\n return this.uri[this._pos];\r\n};\r\n\r\nURI.prototype._skip = function(s) {\r\n if (!s) this._pos = this.uri.length;\r\n // skip all char without keyword\r\n else while (s.indexOf(this._next()) === -1 \u0026\u0026 !this._end());\r\n};\r\n\r\nURI.prototype._sub = function(i) {\r\n return this.uri.substring(i, this._pos);\r\n};\r\n\r\nURI.prototype.all = function() {\r\n return {\r\n schema: this.schema,\r\n host: this.host,\r\n port: this.port,\r\n username: this.username,\r\n password: this.password,\r\n path: this.path,\r\n query: this.query,\r\n fragment: this.fragment,\r\n extension: this.extension\r\n };\r\n};\r\n\r\nURI.prototype.toURI = function() {\r\n var uri = \u0027\u0027, _t;\r\n uri \u002B= this.schema \u002B \u0027://\u0027;\r\n uri \u002B= this.username \u0026\u0026 this.password ? this.username \u002B \u0027:\u0027 \u002B this.password \u002B \u0027@\u0027 : \u0027\u0027;\r\n uri \u002B= this.host;\r\n uri \u002B= this.port ? \u0027:\u0027 \u002B this.port : \u0027\u0027;\r\n uri \u002B= this.path ? \u0027/\u0027 \u002B this.path : \u0027\u0027;\r\n\r\n _t = this._stringifyQuery(this.query);\r\n uri \u002B= _t ? \u0027?\u0027 \u002B _t : \u0027\u0027;\r\n\r\n uri \u002B= this.fragment ? \u0027#\u0027 \u002B this.fragment : \u0027\u0027;\r\n\r\n _t = this._stringifyQuery(this.extension);\r\n uri \u002B= _t ? \u0027;\u0027 \u002B _t : \u0027\u0027;\r\n\r\n return uri;\r\n};\r\n\r\nURI.prototype._parseQuery = function(query) {\r\n var qs = query.split(\u0027\u0026\u0027),\r\n len = qs.length,\r\n r = {},\r\n t;\r\n for (var i = 0; i \u003C len; i \u002B\u002B) {\r\n t = qs[i].split(\u0027=\u0027);\r\n if (t[0]) r[t[0]] = t[1];\r\n }\r\n return r;\r\n};\r\n\r\nURI.prototype._stringifyQuery = function(query) {\r\n if (!query) return \u0027\u0027;\r\n var q = [];\r\n Object.keys(query).forEach(function(key) {\r\n q.push(key \u002B \u0027=\u0027 \u002B (query[key] ? query[key] : \u0027\u0027));\r\n });\r\n return q.join(\u0027\u0026\u0027);\r\n};\r\n\r\n\r\nURI.prototype._parse = function() {\r\n var i = 0;\r\n // 1. scheme\r\n var index = this.uri.indexOf(\u0027://\u0027);\r\n if (index === -1) throw new Error(\u0027scheme should followed by \u0022://\u0022.\u0027);\r\n this._pos = index;\r\n this.schema = this._sub(i);\r\n this._pos = index \u002B 3; // skip ://\r\n i = this._pos;\r\n\r\n // 2. user:pass\r\n if (this.uri.indexOf(\u0027@\u0027, this._pos) !== -1) {\r\n this._skip(\u0027@\u0027);\r\n const up = this._sub(i).split(\u0027:\u0027);\r\n if (up.length !== 2) throw new Error(\u0027username and password must be paired.\u0027);\r\n this.username = up[0];\r\n this.password = up[1];\r\n\r\n this._next(); // skip @\r\n i = this._pos;\r\n }\r\n\r\n // 3. host:port\r\n this._skip(\u0027/?#;\u0027);\r\n const hp = this._sub(i).split(\u0027:\u0027);\r\n this.host = hp[0];\r\n this.port = hp[1];\r\n i = this._pos;\r\n\r\n // /path, ?query, #fragment, ;extension\r\n // 4. path\r\n if (this._current() === \u0027/\u0027) {\r\n this._skip(\u0027?#;\u0027);\r\n this.path = this._sub(i \u002B 1);\r\n i = this._pos;\r\n }\r\n\r\n // 5. query\r\n if (this._current() === \u0027?\u0027) {\r\n this._skip(\u0027#;\u0027);\r\n this.query = this._parseQuery(this._sub(i \u002B 1));\r\n i = this._pos;\r\n }\r\n\r\n // 6. fragment\r\n if (this._current() === \u0027#\u0027) {\r\n this._skip(\u0027;\u0027);\r\n this.fragment = this._sub(i \u002B 1);\r\n i = this._pos;\r\n }\r\n\r\n // 7. extension\r\n if (this._current() === \u0027;\u0027) {\r\n this._skip();\r\n this.extension = this._parseQuery(this._sub(i \u002B 1));\r\n }\r\n};\r\n\r\nfunction isURI (input) {\r\n try {\r\n new URI(input)\r\n return true\r\n } catch (error) {\r\n return false\r\n }\r\n}\r\n\r\nreturn {\r\n isURI: isURI\r\n}\r\n}())\r\n\r\nwindow.webcomponents = (function (scope) {\r\n \u0027use strict\u0027;\r\n\r\n var relative = Object.create(null);\r\n relative[\u0027ftp\u0027] = 21;\r\n relative[\u0027file\u0027] = 0;\r\n relative[\u0027gopher\u0027] = 70;\r\n relative[\u0027http\u0027] = 80;\r\n relative[\u0027https\u0027] = 443;\r\n relative[\u0027ws\u0027] = 80;\r\n relative[\u0027wss\u0027] = 443;\r\n\r\n var relativePathDotMapping = Object.create(null);\r\n relativePathDotMapping[\u0027%2e\u0027] = \u0027.\u0027;\r\n relativePathDotMapping[\u0027.%2e\u0027] = \u0027..\u0027;\r\n relativePathDotMapping[\u0027%2e.\u0027] = \u0027..\u0027;\r\n relativePathDotMapping[\u0027%2e%2e\u0027] = \u0027..\u0027;\r\n\r\n function isRelativeScheme(scheme) {\r\n return relative[scheme] !== undefined;\r\n }\r\n\r\n function invalid() {\r\n clear.call(this);\r\n this._isInvalid = true;\r\n }\r\n\r\n function IDNAToASCII(h) {\r\n if (\u0027\u0027 == h) {\r\n invalid.call(this)\r\n }\r\n // XXX\r\n return h.toLowerCase()\r\n }\r\n\r\n function percentEscape(c) {\r\n var unicode = c.charCodeAt(0);\r\n if (unicode \u003E 0x20 \u0026\u0026\r\n unicode \u003C 0x7F \u0026\u0026\r\n // \u0022 # \u003C \u003E ? \u0060\r\n [0x22, 0x23, 0x3C, 0x3E, 0x3F, 0x60].indexOf(unicode) == -1\r\n ) {\r\n return c;\r\n }\r\n return encodeURIComponent(c);\r\n }\r\n\r\n function percentEscapeQuery(c) {\r\n // XXX This actually needs to encode c using encoding and then\r\n // convert the bytes one-by-one.\r\n\r\n var unicode = c.charCodeAt(0);\r\n if (unicode \u003E 0x20 \u0026\u0026\r\n unicode \u003C 0x7F \u0026\u0026\r\n // \u0022 # \u003C \u003E \u0060 (do not escape \u0027?\u0027)\r\n [0x22, 0x23, 0x3C, 0x3E, 0x60].indexOf(unicode) == -1\r\n ) {\r\n return c;\r\n }\r\n return encodeURIComponent(c);\r\n }\r\n\r\n var EOF = undefined,\r\n ALPHA = /[a-zA-Z]/,\r\n ALPHANUMERIC = /[a-zA-Z0-9\\\u002B\\-\\.]/;\r\n\r\n function parse(input, stateOverride, base) {\r\n function err(message) {\r\n errors.push(message)\r\n }\r\n\r\n var state = stateOverride || \u0027scheme start\u0027,\r\n cursor = 0,\r\n buffer = \u0027\u0027,\r\n seenAt = false,\r\n seenBracket = false,\r\n errors = [];\r\n\r\n loop: while ((input[cursor - 1] != EOF || cursor == 0) \u0026\u0026 !this._isInvalid) {\r\n var c = input[cursor];\r\n switch (state) {\r\n case \u0027scheme start\u0027:\r\n if (c \u0026\u0026 ALPHA.test(c)) {\r\n buffer \u002B= c.toLowerCase(); // ASCII-safe\r\n state = \u0027scheme\u0027;\r\n } else if (!stateOverride) {\r\n buffer = \u0027\u0027;\r\n state = \u0027no scheme\u0027;\r\n continue;\r\n } else {\r\n err(\u0027Invalid scheme.\u0027);\r\n break loop;\r\n }\r\n break;\r\n\r\n case \u0027scheme\u0027:\r\n if (c \u0026\u0026 ALPHANUMERIC.test(c)) {\r\n buffer \u002B= c.toLowerCase(); // ASCII-safe\r\n } else if (\u0027:\u0027 == c) {\r\n this._scheme = buffer;\r\n buffer = \u0027\u0027;\r\n if (stateOverride) {\r\n break loop;\r\n }\r\n if (isRelativeScheme(this._scheme)) {\r\n this._isRelative = true;\r\n }\r\n if (\u0027file\u0027 == this._scheme) {\r\n state = \u0027relative\u0027;\r\n } else if (this._isRelative \u0026\u0026 base \u0026\u0026 base._scheme == this._scheme) {\r\n state = \u0027relative or authority\u0027;\r\n } else if (this._isRelative) {\r\n state = \u0027authority first slash\u0027;\r\n } else {\r\n state = \u0027scheme data\u0027;\r\n }\r\n } else if (!stateOverride) {\r\n buffer = \u0027\u0027;\r\n cursor = 0;\r\n state = \u0027no scheme\u0027;\r\n continue;\r\n } else if (EOF == c) {\r\n break loop;\r\n } else {\r\n err(\u0027Code point not allowed in scheme: \u0027 \u002B c)\r\n break loop;\r\n }\r\n break;\r\n\r\n case \u0027scheme data\u0027:\r\n if (\u0027?\u0027 == c) {\r\n this._query = \u0027?\u0027;\r\n state = \u0027query\u0027;\r\n } else if (\u0027#\u0027 == c) {\r\n this._fragment = \u0027#\u0027;\r\n state = \u0027fragment\u0027;\r\n } else {\r\n // XXX error handling\r\n if (EOF != c \u0026\u0026 \u0027\\t\u0027 != c \u0026\u0026 \u0027\\n\u0027 != c \u0026\u0026 \u0027\\r\u0027 != c) {\r\n this._schemeData \u002B= percentEscape(c);\r\n }\r\n }\r\n break;\r\n\r\n case \u0027no scheme\u0027:\r\n if (!base || !(isRelativeScheme(base._scheme))) {\r\n err(\u0027Missing scheme.\u0027);\r\n invalid.call(this);\r\n } else {\r\n state = \u0027relative\u0027;\r\n continue;\r\n }\r\n break;\r\n\r\n case \u0027relative or authority\u0027:\r\n if (\u0027/\u0027 == c \u0026\u0026 \u0027/\u0027 == input[cursor\u002B1]) {\r\n state = \u0027authority ignore slashes\u0027;\r\n } else {\r\n err(\u0027Expected /, got: \u0027 \u002B c);\r\n state = \u0027relative\u0027;\r\n continue\r\n }\r\n break;\r\n\r\n case \u0027relative\u0027:\r\n this._isRelative = true;\r\n if (\u0027file\u0027 != this._scheme)\r\n this._scheme = base._scheme;\r\n if (EOF == c) {\r\n this._host = base._host;\r\n this._port = base._port;\r\n this._path = base._path.slice();\r\n this._query = base._query;\r\n this._username = base._username;\r\n this._password = base._password;\r\n break loop;\r\n } else if (\u0027/\u0027 == c || \u0027\\\\\u0027 == c) {\r\n if (\u0027\\\\\u0027 == c)\r\n err(\u0027\\\\ is an invalid code point.\u0027);\r\n state = \u0027relative slash\u0027;\r\n } else if (\u0027?\u0027 == c) {\r\n this._host = base._host;\r\n this._port = base._port;\r\n this._path = base._path.slice();\r\n this._query = \u0027?\u0027;\r\n this._username = base._username;\r\n this._password = base._password;\r\n state = \u0027query\u0027;\r\n } else if (\u0027#\u0027 == c) {\r\n this._host = base._host;\r\n this._port = base._port;\r\n this._path = base._path.slice();\r\n this._query = base._query;\r\n this._fragment = \u0027#\u0027;\r\n this._username = base._username;\r\n this._password = base._password;\r\n state = \u0027fragment\u0027;\r\n } else {\r\n var nextC = input[cursor\u002B1]\r\n var nextNextC = input[cursor\u002B2]\r\n if (\r\n \u0027file\u0027 != this._scheme || !ALPHA.test(c) ||\r\n (nextC != \u0027:\u0027 \u0026\u0026 nextC != \u0027|\u0027) ||\r\n (EOF != nextNextC \u0026\u0026 \u0027/\u0027 != nextNextC \u0026\u0026 \u0027\\\\\u0027 != nextNextC \u0026\u0026 \u0027?\u0027 != nextNextC \u0026\u0026 \u0027#\u0027 != nextNextC)) {\r\n this._host = base._host;\r\n this._port = base._port;\r\n this._username = base._username;\r\n this._password = base._password;\r\n this._path = base._path.slice();\r\n this._path.pop();\r\n }\r\n state = \u0027relative path\u0027;\r\n continue;\r\n }\r\n break;\r\n\r\n case \u0027relative slash\u0027:\r\n if (\u0027/\u0027 == c || \u0027\\\\\u0027 == c) {\r\n if (\u0027\\\\\u0027 == c) {\r\n err(\u0027\\\\ is an invalid code point.\u0027);\r\n }\r\n if (\u0027file\u0027 == this._scheme) {\r\n state = \u0027file host\u0027;\r\n } else {\r\n state = \u0027authority ignore slashes\u0027;\r\n }\r\n } else {\r\n if (\u0027file\u0027 != this._scheme) {\r\n this._host = base._host;\r\n this._port = base._port;\r\n this._username = base._username;\r\n this._password = base._password;\r\n }\r\n state = \u0027relative path\u0027;\r\n continue;\r\n }\r\n break;\r\n\r\n case \u0027authority first slash\u0027:\r\n if (\u0027/\u0027 == c) {\r\n state = \u0027authority second slash\u0027;\r\n } else {\r\n err(\u0022Expected \u0027/\u0027, got: \u0022 \u002B c);\r\n state = \u0027authority ignore slashes\u0027;\r\n continue;\r\n }\r\n break;\r\n\r\n case \u0027authority second slash\u0027:\r\n state = \u0027authority ignore slashes\u0027;\r\n if (\u0027/\u0027 != c) {\r\n err(\u0022Expected \u0027/\u0027, got: \u0022 \u002B c);\r\n continue;\r\n }\r\n break;\r\n\r\n case \u0027authority ignore slashes\u0027:\r\n if (\u0027/\u0027 != c \u0026\u0026 \u0027\\\\\u0027 != c) {\r\n state = \u0027authority\u0027;\r\n continue;\r\n } else {\r\n err(\u0027Expected authority, got: \u0027 \u002B c);\r\n }\r\n break;\r\n\r\n case \u0027authority\u0027:\r\n if (\u0027@\u0027 == c) {\r\n if (seenAt) {\r\n err(\u0027@ already seen.\u0027);\r\n buffer \u002B= \u0027%40\u0027;\r\n }\r\n seenAt = true;\r\n for (var i = 0; i \u003C buffer.length; i\u002B\u002B) {\r\n var cp = buffer[i];\r\n if (\u0027\\t\u0027 == cp || \u0027\\n\u0027 == cp || \u0027\\r\u0027 == cp) {\r\n err(\u0027Invalid whitespace in authority.\u0027);\r\n continue;\r\n }\r\n // XXX check URL code points\r\n if (\u0027:\u0027 == cp \u0026\u0026 null === this._password) {\r\n this._password = \u0027\u0027;\r\n continue;\r\n }\r\n var tempC = percentEscape(cp);\r\n (null !== this._password) ? this._password \u002B= tempC : this._username \u002B= tempC;\r\n }\r\n buffer = \u0027\u0027;\r\n } else if (EOF == c || \u0027/\u0027 == c || \u0027\\\\\u0027 == c || \u0027?\u0027 == c || \u0027#\u0027 == c) {\r\n cursor -= buffer.length;\r\n buffer = \u0027\u0027;\r\n state = \u0027host\u0027;\r\n continue;\r\n } else {\r\n buffer \u002B= c;\r\n }\r\n break;\r\n\r\n case \u0027file host\u0027:\r\n if (EOF == c || \u0027/\u0027 == c || \u0027\\\\\u0027 == c || \u0027?\u0027 == c || \u0027#\u0027 == c) {\r\n if (buffer.length == 2 \u0026\u0026 ALPHA.test(buffer[0]) \u0026\u0026 (buffer[1] == \u0027:\u0027 || buffer[1] == \u0027|\u0027)) {\r\n state = \u0027relative path\u0027;\r\n } else if (buffer.length == 0) {\r\n state = \u0027relative path start\u0027;\r\n } else {\r\n this._host = IDNAToASCII.call(this, buffer);\r\n buffer = \u0027\u0027;\r\n state = \u0027relative path start\u0027;\r\n }\r\n continue;\r\n } else if (\u0027\\t\u0027 == c || \u0027\\n\u0027 == c || \u0027\\r\u0027 == c) {\r\n err(\u0027Invalid whitespace in file host.\u0027);\r\n } else {\r\n buffer \u002B= c;\r\n }\r\n break;\r\n\r\n case \u0027host\u0027:\r\n case \u0027hostname\u0027:\r\n if (\u0027:\u0027 == c \u0026\u0026 !seenBracket) {\r\n // XXX host parsing\r\n this._host = IDNAToASCII.call(this, buffer);\r\n buffer = \u0027\u0027;\r\n state = \u0027port\u0027;\r\n if (\u0027hostname\u0027 == stateOverride) {\r\n break loop;\r\n }\r\n } else if (EOF == c || \u0027/\u0027 == c || \u0027\\\\\u0027 == c || \u0027?\u0027 == c || \u0027#\u0027 == c) {\r\n this._host = IDNAToASCII.call(this, buffer);\r\n buffer = \u0027\u0027;\r\n state = \u0027relative path start\u0027;\r\n if (stateOverride) {\r\n break loop;\r\n }\r\n continue;\r\n } else if (\u0027\\t\u0027 != c \u0026\u0026 \u0027\\n\u0027 != c \u0026\u0026 \u0027\\r\u0027 != c) {\r\n if (\u0027[\u0027 == c) {\r\n seenBracket = true;\r\n } else if (\u0027]\u0027 == c) {\r\n seenBracket = false;\r\n }\r\n buffer \u002B= c;\r\n } else {\r\n err(\u0027Invalid code point in host/hostname: \u0027 \u002B c);\r\n }\r\n break;\r\n\r\n case \u0027port\u0027:\r\n if (/[0-9]/.test(c)) {\r\n buffer \u002B= c;\r\n } else if (EOF == c || \u0027/\u0027 == c || \u0027\\\\\u0027 == c || \u0027?\u0027 == c || \u0027#\u0027 == c || stateOverride) {\r\n if (\u0027\u0027 != buffer) {\r\n var temp = parseInt(buffer, 10);\r\n if (temp != relative[this._scheme]) {\r\n this._port = temp \u002B \u0027\u0027;\r\n }\r\n buffer = \u0027\u0027;\r\n }\r\n if (stateOverride) {\r\n break loop;\r\n }\r\n state = \u0027relative path start\u0027;\r\n continue;\r\n } else if (\u0027\\t\u0027 == c || \u0027\\n\u0027 == c || \u0027\\r\u0027 == c) {\r\n err(\u0027Invalid code point in port: \u0027 \u002B c);\r\n } else {\r\n invalid.call(this);\r\n }\r\n break;\r\n\r\n case \u0027relative path start\u0027:\r\n if (\u0027\\\\\u0027 == c)\r\n err(\u0022\u0027\\\\\u0027 not allowed in path.\u0022);\r\n state = \u0027relative path\u0027;\r\n if (\u0027/\u0027 != c \u0026\u0026 \u0027\\\\\u0027 != c) {\r\n continue;\r\n }\r\n break;\r\n\r\n case \u0027relative path\u0027:\r\n if (EOF == c || \u0027/\u0027 == c || \u0027\\\\\u0027 == c || (!stateOverride \u0026\u0026 (\u0027?\u0027 == c || \u0027#\u0027 == c))) {\r\n if (\u0027\\\\\u0027 == c) {\r\n err(\u0027\\\\ not allowed in relative path.\u0027);\r\n }\r\n var tmp;\r\n if (tmp = relativePathDotMapping[buffer.toLowerCase()]) {\r\n buffer = tmp;\r\n }\r\n if (\u0027..\u0027 == buffer) {\r\n this._path.pop();\r\n if (\u0027/\u0027 != c \u0026\u0026 \u0027\\\\\u0027 != c) {\r\n this._path.push(\u0027\u0027);\r\n }\r\n } else if (\u0027.\u0027 == buffer \u0026\u0026 \u0027/\u0027 != c \u0026\u0026 \u0027\\\\\u0027 != c) {\r\n this._path.push(\u0027\u0027);\r\n } else if (\u0027.\u0027 != buffer) {\r\n if (\u0027file\u0027 == this._scheme \u0026\u0026 this._path.length == 0 \u0026\u0026 buffer.length == 2 \u0026\u0026 ALPHA.test(buffer[0]) \u0026\u0026 buffer[1] == \u0027|\u0027) {\r\n buffer = buffer[0] \u002B \u0027:\u0027;\r\n }\r\n this._path.push(buffer);\r\n }\r\n buffer = \u0027\u0027;\r\n if (\u0027?\u0027 == c) {\r\n this._query = \u0027?\u0027;\r\n state = \u0027query\u0027;\r\n } else if (\u0027#\u0027 == c) {\r\n this._fragment = \u0027#\u0027;\r\n state = \u0027fragment\u0027;\r\n }\r\n } else if (\u0027\\t\u0027 != c \u0026\u0026 \u0027\\n\u0027 != c \u0026\u0026 \u0027\\r\u0027 != c) {\r\n buffer \u002B= percentEscape(c);\r\n }\r\n break;\r\n\r\n case \u0027query\u0027:\r\n if (!stateOverride \u0026\u0026 \u0027#\u0027 == c) {\r\n this._fragment = \u0027#\u0027;\r\n state = \u0027fragment\u0027;\r\n } else if (EOF != c \u0026\u0026 \u0027\\t\u0027 != c \u0026\u0026 \u0027\\n\u0027 != c \u0026\u0026 \u0027\\r\u0027 != c) {\r\n this._query \u002B= percentEscapeQuery(c);\r\n }\r\n break;\r\n\r\n case \u0027fragment\u0027:\r\n if (EOF != c \u0026\u0026 \u0027\\t\u0027 != c \u0026\u0026 \u0027\\n\u0027 != c \u0026\u0026 \u0027\\r\u0027 != c) {\r\n this._fragment \u002B= c;\r\n }\r\n break;\r\n }\r\n\r\n cursor\u002B\u002B;\r\n }\r\n }\r\n\r\n function clear() {\r\n this._scheme = \u0027\u0027;\r\n this._schemeData = \u0027\u0027;\r\n this._username = \u0027\u0027;\r\n this._password = null;\r\n this._host = \u0027\u0027;\r\n this._port = \u0027\u0027;\r\n this._path = [];\r\n this._query = \u0027\u0027;\r\n this._fragment = \u0027\u0027;\r\n this._isInvalid = false;\r\n this._isRelative = false;\r\n }\r\n\r\n // Does not process domain names or IP addresses.\r\n // Does not handle encoding for the query parameter.\r\n function jURL(url, base /* , encoding */) {\r\n if (base !== undefined \u0026\u0026 !(base instanceof jURL))\r\n base = new jURL(String(base));\r\n\r\n this._url = url;\r\n clear.call(this);\r\n\r\n var input = url.replace(/^[ \\t\\r\\n\\f]\u002B|[ \\t\\r\\n\\f]\u002B$/g, \u0027\u0027);\r\n // encoding = encoding || \u0027utf-8\u0027\r\n\r\n parse.call(this, input, null, base);\r\n }\r\n\r\n jURL.prototype = {\r\n toString: function() {\r\n return this.href;\r\n },\r\n get href() {\r\n if (this._isInvalid)\r\n return this._url;\r\n\r\n var authority = \u0027\u0027;\r\n if (\u0027\u0027 != this._username || null != this._password) {\r\n authority = this._username \u002B\r\n (null != this._password ? \u0027:\u0027 \u002B this._password : \u0027\u0027) \u002B \u0027@\u0027;\r\n }\r\n\r\n return this.protocol \u002B\r\n (this._isRelative ? \u0027//\u0027 \u002B authority \u002B this.host : \u0027\u0027) \u002B\r\n this.pathname \u002B this._query \u002B this._fragment;\r\n },\r\n set href(href) {\r\n clear.call(this);\r\n parse.call(this, href);\r\n },\r\n\r\n get protocol() {\r\n return this._scheme \u002B \u0027:\u0027;\r\n },\r\n set protocol(protocol) {\r\n if (this._isInvalid)\r\n return;\r\n parse.call(this, protocol \u002B \u0027:\u0027, \u0027scheme start\u0027);\r\n },\r\n\r\n get host() {\r\n return this._isInvalid ? \u0027\u0027 : this._port ?\r\n this._host \u002B \u0027:\u0027 \u002B this._port : this._host;\r\n },\r\n set host(host) {\r\n if (this._isInvalid || !this._isRelative)\r\n return;\r\n parse.call(this, host, \u0027host\u0027);\r\n },\r\n\r\n get hostname() {\r\n return this._host;\r\n },\r\n set hostname(hostname) {\r\n if (this._isInvalid || !this._isRelative)\r\n return;\r\n parse.call(this, hostname, \u0027hostname\u0027);\r\n },\r\n\r\n get port() {\r\n return this._port;\r\n },\r\n set port(port) {\r\n if (this._isInvalid || !this._isRelative)\r\n return;\r\n parse.call(this, port, \u0027port\u0027);\r\n },\r\n\r\n get pathname() {\r\n return this._isInvalid ? \u0027\u0027 : this._isRelative ?\r\n \u0027/\u0027 \u002B this._path.join(\u0027/\u0027) : this._schemeData;\r\n },\r\n set pathname(pathname) {\r\n if (this._isInvalid || !this._isRelative)\r\n return;\r\n this._path = [];\r\n parse.call(this, pathname, \u0027relative path start\u0027);\r\n },\r\n\r\n get search() {\r\n return this._isInvalid || !this._query || \u0027?\u0027 == this._query ?\r\n \u0027\u0027 : this._query;\r\n },\r\n set search(search) {\r\n if (this._isInvalid || !this._isRelative)\r\n return;\r\n this._query = \u0027?\u0027;\r\n if (\u0027?\u0027 == search[0])\r\n search = search.slice(1);\r\n parse.call(this, search, \u0027query\u0027);\r\n },\r\n\r\n get hash() {\r\n return this._isInvalid || !this._fragment || \u0027#\u0027 == this._fragment ?\r\n \u0027\u0027 : this._fragment;\r\n },\r\n set hash(hash) {\r\n if (this._isInvalid)\r\n return;\r\n this._fragment = \u0027#\u0027;\r\n if (\u0027#\u0027 == hash[0])\r\n hash = hash.slice(1);\r\n parse.call(this, hash, \u0027fragment\u0027);\r\n },\r\n\r\n get origin() {\r\n var host;\r\n if (this._isInvalid || !this._scheme) {\r\n return \u0027\u0027;\r\n }\r\n // javascript: Gecko returns String(\u0022\u0022), WebKit/Blink String(\u0022null\u0022)\r\n // Gecko throws error for \u0022data://\u0022\r\n // data: Gecko returns \u0022\u0022, Blink returns \u0022data://\u0022, WebKit returns \u0022null\u0022\r\n // Gecko returns String(\u0022\u0022) for file: mailto:\r\n // WebKit/Blink returns String(\u0022SCHEME://\u0022) for file: mailto:\r\n switch (this._scheme) {\r\n case \u0027data\u0027:\r\n case \u0027file\u0027:\r\n case \u0027javascript\u0027:\r\n case \u0027mailto\u0027:\r\n return \u0027null\u0027;\r\n }\r\n host = this.host;\r\n if (!host) {\r\n return \u0027\u0027;\r\n }\r\n return this._scheme \u002B \u0027://\u0027 \u002B host;\r\n }\r\n };\r\n\r\n // Copy over the static methods\r\n var OriginalURL = scope.URL;\r\n if (OriginalURL) {\r\n jURL.createObjectURL = function(blob) {\r\n // IE extension allows a second optional options argument.\r\n // http://msdn.microsoft.com/en-us/library/ie/hh772302(v=vs.85).aspx\r\n return OriginalURL.createObjectURL.apply(OriginalURL, arguments);\r\n };\r\n jURL.revokeObjectURL = function(url) {\r\n OriginalURL.revokeObjectURL(url);\r\n };\r\n }\r\n\r\n scope.URL = jURL;\r\n\r\nfunction isURI (input) {\r\n try {\r\n new jURL(input)\r\n return true\r\n } catch (error) {\r\n return false\r\n }\r\n}\r\n\r\nreturn {\r\n isURI: isURI\r\n}\r\n}(window))\r\n\r\nwindow.native = (function () {\r\nfunction isURI (input) {\r\n try {\r\n new URL(input)\r\n } catch (error) {}\r\n}\r\n\r\n\r\nreturn {\r\n isURI: isURI\r\n}\r\n}())\r\n","TestCases":[{"Name":"webcomponents/URL module","Code":"webcomponents.isURI(\u0027http://localhost/\u0027)\r\nwebcomponents.isURI(\u0027http://example.w3.org/path%20with%20spaces.html\u0027)\r\nwebcomponents.isURI(\u0027http://example.w3.org/%20\u0027)\r\nwebcomponents.isURI(\u0027ftp://ftp.is.co.za/rfc/rfc1808.txt\u0027)\r\nwebcomponents.isURI(\u0027ftp://ftp.is.co.za/../../../rfc/rfc1808.txt\u0027)\r\nwebcomponents.isURI(\u0027http://www.ietf.org/rfc/webcomponents.isURI.txt\u0027)\r\nwebcomponents.isURI(\u0027mailto:John.Doe@example.com\u0027)\r\nwebcomponents.isURI(\u0027news:comp.infosystems.www.servers.unix\u0027)\r\nwebcomponents.isURI(\u0027tel:\u002B1-816-555-1212\u0027)\r\nwebcomponents.isURI(\u0027telnet://192.0.2.16:80/\u0027)\r\nwebcomponents.isURI(\u0027urn:oasis:names:specification:docbook:dtd:xml:4.1.2\u0027)","IsDeferred":false},{"Name":"uri-parse module","Code":"uri_parse.isURI(\u0027http://localhost/\u0027)\r\nuri_parse.isURI(\u0027http://example.w3.org/path%20with%20spaces.html\u0027)\r\nuri_parse.isURI(\u0027http://example.w3.org/%20\u0027)\r\nuri_parse.isURI(\u0027ftp://ftp.is.co.za/rfc/rfc1808.txt\u0027)\r\nuri_parse.isURI(\u0027ftp://ftp.is.co.za/../../../rfc/rfc1808.txt\u0027)\r\nuri_parse.isURI(\u0027http://www.ietf.org/rfc/uri_parse.isURI.txt\u0027)\r\nuri_parse.isURI(\u0027mailto:John.Doe@example.com\u0027)\r\nuri_parse.isURI(\u0027news:comp.infosystems.www.servers.unix\u0027)\r\nuri_parse.isURI(\u0027tel:\u002B1-816-555-1212\u0027)\r\nuri_parse.isURI(\u0027telnet://192.0.2.16:80/\u0027)\r\nuri_parse.isURI(\u0027urn:oasis:names:specification:docbook:dtd:xml:4.1.2\u0027)","IsDeferred":false},{"Name":"url-parse module","Code":"url_parse.isURI(\u0027http://localhost/\u0027)\r\nurl_parse.isURI(\u0027http://example.w3.org/path%20with%20spaces.html\u0027)\r\nurl_parse.isURI(\u0027http://example.w3.org/%20\u0027)\r\nurl_parse.isURI(\u0027ftp://ftp.is.co.za/rfc/rfc1808.txt\u0027)\r\nurl_parse.isURI(\u0027ftp://ftp.is.co.za/../../../rfc/rfc1808.txt\u0027)\r\nurl_parse.isURI(\u0027http://www.ietf.org/rfc/url_parse.isURI.txt\u0027)\r\nurl_parse.isURI(\u0027mailto:John.Doe@example.com\u0027)\r\nurl_parse.isURI(\u0027news:comp.infosystems.www.servers.unix\u0027)\r\nurl_parse.isURI(\u0027tel:\u002B1-816-555-1212\u0027)\r\nurl_parse.isURI(\u0027telnet://192.0.2.16:80/\u0027)\r\nurl_parse.isURI(\u0027urn:oasis:names:specification:docbook:dtd:xml:4.1.2\u0027)","IsDeferred":false},{"Name":"urlparser module","Code":"urlparser.isURI(\u0027http://localhost/\u0027)\r\nurlparser.isURI(\u0027http://example.w3.org/path%20with%20spaces.html\u0027)\r\nurlparser.isURI(\u0027http://example.w3.org/%20\u0027)\r\nurlparser.isURI(\u0027ftp://ftp.is.co.za/rfc/rfc1808.txt\u0027)\r\nurlparser.isURI(\u0027ftp://ftp.is.co.za/../../../rfc/rfc1808.txt\u0027)\r\nurlparser.isURI(\u0027http://www.ietf.org/rfc/urlparser.isURI.txt\u0027)\r\nurlparser.isURI(\u0027mailto:John.Doe@example.com\u0027)\r\nurlparser.isURI(\u0027news:comp.infosystems.www.servers.unix\u0027)\r\nurlparser.isURI(\u0027tel:\u002B1-816-555-1212\u0027)\r\nurlparser.isURI(\u0027telnet://192.0.2.16:80/\u0027)\r\nurlparser.isURI(\u0027urn:oasis:names:specification:docbook:dtd:xml:4.1.2\u0027)","IsDeferred":false},{"Name":"BNF from RFC 3986","Code":"rfc3986.isURI(\u0027http://localhost/\u0027)\r\nrfc3986.isURI(\u0027http://example.w3.org/path%20with%20spaces.html\u0027)\r\nrfc3986.isURI(\u0027http://example.w3.org/%20\u0027)\r\nrfc3986.isURI(\u0027ftp://ftp.is.co.za/rfc/rfc1808.txt\u0027)\r\nrfc3986.isURI(\u0027ftp://ftp.is.co.za/../../../rfc/rfc1808.txt\u0027)\r\nrfc3986.isURI(\u0027http://www.ietf.org/rfc/rfc3986.isURI.txt\u0027)\r\nrfc3986.isURI(\u0027mailto:John.Doe@example.com\u0027)\r\nrfc3986.isURI(\u0027news:comp.infosystems.www.servers.unix\u0027)\r\nrfc3986.isURI(\u0027tel:\u002B1-816-555-1212\u0027)\r\nrfc3986.isURI(\u0027telnet://192.0.2.16:80/\u0027)\r\nrfc3986.isURI(\u0027urn:oasis:names:specification:docbook:dtd:xml:4.1.2\u0027)","IsDeferred":false},{"Name":"RegExp from RFC 3986 plus additional checks","Code":"regexp.isURI(\u0027http://localhost/\u0027)\r\nregexp.isURI(\u0027http://example.w3.org/path%20with%20spaces.html\u0027)\r\nregexp.isURI(\u0027http://example.w3.org/%20\u0027)\r\nregexp.isURI(\u0027ftp://ftp.is.co.za/rfc/rfc1808.txt\u0027)\r\nregexp.isURI(\u0027ftp://ftp.is.co.za/../../../rfc/rfc1808.txt\u0027)\r\nregexp.isURI(\u0027http://www.ietf.org/rfc/regexp.isURI.txt\u0027)\r\nregexp.isURI(\u0027mailto:John.Doe@example.com\u0027)\r\nregexp.isURI(\u0027news:comp.infosystems.www.servers.unix\u0027)\r\nregexp.isURI(\u0027tel:\u002B1-816-555-1212\u0027)\r\nregexp.isURI(\u0027telnet://192.0.2.16:80/\u0027)\r\nregexp.isURI(\u0027urn:oasis:names:specification:docbook:dtd:xml:4.1.2\u0027)","IsDeferred":false},{"Name":"BNF from RFC 2396","Code":"rfc2396.isURI(\u0027http://localhost/\u0027)\r\nrfc2396.isURI(\u0027http://example.w3.org/path%20with%20spaces.html\u0027)\r\nrfc2396.isURI(\u0027http://example.w3.org/%20\u0027)\r\nrfc2396.isURI(\u0027ftp://ftp.is.co.za/rfc/rfc1808.txt\u0027)\r\nrfc2396.isURI(\u0027ftp://ftp.is.co.za/../../../rfc/rfc1808.txt\u0027)\r\nrfc2396.isURI(\u0027http://www.ietf.org/rfc/rfc3986.isURI.txt\u0027)\r\nrfc2396.isURI(\u0027mailto:John.Doe@example.com\u0027)\r\nrfc2396.isURI(\u0027news:comp.infosystems.www.servers.unix\u0027)\r\nrfc2396.isURI(\u0027tel:\u002B1-816-555-1212\u0027)\r\nrfc2396.isURI(\u0027telnet://192.0.2.16:80/\u0027)\r\nrfc2396.isURI(\u0027urn:oasis:names:specification:docbook:dtd:xml:4.1.2\u0027)","IsDeferred":false},{"Name":"native browser URL","Code":"native.isURI(\u0027http://localhost/\u0027)\r\nnative.isURI(\u0027http://example.w3.org/path%20with%20spaces.html\u0027)\r\nnative.isURI(\u0027http://example.w3.org/%20\u0027)\r\nnative.isURI(\u0027ftp://ftp.is.co.za/rfc/rfc1808.txt\u0027)\r\nnative.isURI(\u0027ftp://ftp.is.co.za/../../../rfc/rfc1808.txt\u0027)\r\nnative.isURI(\u0027http://www.ietf.org/rfc/native.isURI.txt\u0027)\r\nnative.isURI(\u0027mailto:John.Doe@example.com\u0027)\r\nnative.isURI(\u0027news:comp.infosystems.www.servers.unix\u0027)\r\nnative.isURI(\u0027tel:\u002B1-816-555-1212\u0027)\r\nnative.isURI(\u0027telnet://192.0.2.16:80/\u0027)\r\nnative.isURI(\u0027urn:oasis:names:specification:docbook:dtd:xml:4.1.2\u0027)","IsDeferred":false}]}