/** @license URI.js v3.0.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */ !function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r(e.URI=e.URI||{})}(this,function(e){"use strict";function r(){for(var e=arguments.length,r=Array(e),t=0;t1){r[0]=r[0].slice(0,-1);for(var n=r.length-1,o=1;o1&&(n=t[0]+"@",e=t[1]),e=e.replace(T,"."),n+s(e.split("."),r).join(".")}function f(e){for(var r=[],t=0,n=e.length;t=55296&&o<=56319&&t>6|192).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase():"%"+(r>>12|224).toString(16).toUpperCase()+"%"+(r>>6&63|128).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase()}function h(e){for(var r="",t=0,n=e.length;t=194&&o<224){if(n-t>=6){var a=parseInt(e.substr(t+4,2),16);r+=String.fromCharCode((31&o)<<6|63&a)}else r+=e.substr(t,6);t+=6}else if(o>=224){if(n-t>=9){var i=parseInt(e.substr(t+4,2),16),u=parseInt(e.substr(t+7,2),16);r+=String.fromCharCode((15&o)<<12|(63&i)<<6|63&u)}else r+=e.substr(t,9);t+=9}else r+=e.substr(t,3),t+=3}return r}function d(e,r){function t(e){var t=h(e);return t.match(r.UNRESERVED)?t:e}return e.scheme&&(e.scheme=String(e.scheme).replace(r.PCT_ENCODED,t).toLowerCase().replace(r.NOT_SCHEME,"")),e.userinfo!==undefined&&(e.userinfo=String(e.userinfo).replace(r.PCT_ENCODED,t).replace(r.NOT_USERINFO,c).replace(r.PCT_ENCODED,o)),e.host!==undefined&&(e.host=String(e.host).replace(r.PCT_ENCODED,t).toLowerCase().replace(r.NOT_HOST,c).replace(r.PCT_ENCODED,o)),e.path!==undefined&&(e.path=String(e.path).replace(r.PCT_ENCODED,t).replace(e.scheme?r.NOT_PATH:r.NOT_PATH_NOSCHEME,c).replace(r.PCT_ENCODED,o)),e.query!==undefined&&(e.query=String(e.query).replace(r.PCT_ENCODED,t).replace(r.NOT_QUERY,c).replace(r.PCT_ENCODED,o)),e.fragment!==undefined&&(e.fragment=String(e.fragment).replace(r.PCT_ENCODED,t).replace(r.NOT_FRAGMENT,c).replace(r.PCT_ENCODED,o)),e}function l(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},t={},n=r.iri!==!1?w:x;"suffix"===r.reference&&(e=(r.scheme?r.scheme+":":"")+"//"+e);var o=e.match(k);if(o){G?(t.scheme=o[1],t.userinfo=o[3],t.host=o[4],t.port=parseInt(o[5],10),t.path=o[6]||"",t.query=o[7],t.fragment=o[8],isNaN(t.port)&&(t.port=o[5])):(t.scheme=o[1]||undefined,t.userinfo=e.indexOf("@")!==-1?o[3]:undefined,t.host=e.indexOf("//")!==-1?o[4]:undefined,t.port=parseInt(o[5],10),t.path=o[6]||"",t.query=e.indexOf("?")!==-1?o[7]:undefined,t.fragment=e.indexOf("#")!==-1?o[8]:undefined,isNaN(t.port)&&(t.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?o[4]:undefined)),t.host&&(t.host=t.host.replace(n.IPV6ADDRESS,"$1")),t.scheme!==undefined||t.userinfo!==undefined||t.host!==undefined||t.port!==undefined||t.path||t.query!==undefined?t.scheme===undefined?t.reference="relative":t.fragment===undefined?t.reference="absolute":t.reference="uri":t.reference="same-document",r.reference&&"suffix"!==r.reference&&r.reference!==t.reference&&(t.error=t.error||"URI is not a "+r.reference+" reference.");var a=V[(r.scheme||t.scheme||"").toLowerCase()];if(r.unicodeSupport||a&&a.unicodeSupport)d(t,n);else{if(t.host&&(r.domainHost||a&&a.domainHost))try{t.host=Z.toASCII(t.host.replace(n.PCT_ENCODED,h).toLowerCase())}catch(i){t.error=t.error||"Host's domain name can not be converted to ASCII via punycode: "+i}d(t,x)}a&&a.parse&&a.parse(t,r)}else t.error=t.error||"URI can not be parsed.";return t}function g(e,r){var t=r.iri!==!1?w:x,n=[];return e.userinfo!==undefined&&(n.push(e.userinfo),n.push("@")),e.host!==undefined&&n.push(String(e.host).replace(t.IPV6ADDRESS,"[$1]")),"number"==typeof e.port&&(n.push(":"),n.push(e.port.toString(10))),n.length?n.join(""):undefined}function m(e){for(var r=[];e.length;)if(e.match(Q))e=e.replace(Q,"");else if(e.match(Y))e=e.replace(Y,"/");else if(e.match(B))e=e.replace(B,"/"),r.pop();else if("."===e||".."===e)e="";else{var t=e.match(J);if(!t)throw new Error("Unexpected dot segment condition");var n=t[0];e=e.slice(n.length),r.push(n)}return r.join("")}function v(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},t=r.iri?w:x,n=[],o=V[(r.scheme||e.scheme||"").toLowerCase()];if(o&&o.serialize&&o.serialize(e,r),e.host)if(t.IPV6ADDRESS.test(e.host));else if(r.domainHost||o&&o.domainHost)try{e.host=r.iri?Z.toUnicode(e.host):Z.toASCII(e.host.replace(t.PCT_ENCODED,h).toLowerCase())}catch(u){e.error=e.error||"Host's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+u}d(e,t),"suffix"!==r.reference&&e.scheme&&(n.push(e.scheme),n.push(":"));var a=g(e,r);if(a!==undefined&&("suffix"!==r.reference&&n.push("//"),n.push(a),e.path&&"/"!==e.path.charAt(0)&&n.push("/")),e.path!==undefined){var i=e.path;r.absolutePath||o&&o.absolutePath||(i=m(i)),a===undefined&&(i=i.replace(/^\/\//,"/%2F")),n.push(i)}return e.query!==undefined&&(n.push("?"),n.push(e.query)),e.fragment!==undefined&&(n.push("#"),n.push(e.fragment)),n.join("")}function E(e,r){var t=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{},n=arguments[3],o={};return n||(e=l(v(e,t),t),r=l(v(r,t),t)),t=t||{},!t.tolerant&&r.scheme?(o.scheme=r.scheme,o.userinfo=r.userinfo,o.host=r.host,o.port=r.port,o.path=m(r.path||""),o.query=r.query):(r.userinfo!==undefined||r.host!==undefined||r.port!==undefined?(o.userinfo=r.userinfo,o.host=r.host,o.port=r.port,o.path=m(r.path||""),o.query=r.query):(r.path?("/"===r.path.charAt(0)?o.path=m(r.path):(e.userinfo===undefined&&e.host===undefined&&e.port===undefined||e.path?e.path?o.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+r.path:o.path=r.path:o.path="/"+r.path,o.path=m(o.path)),o.query=r.query):(o.path=e.path,r.query!==undefined?o.query=r.query:o.query=e.query),o.userinfo=e.userinfo,o.host=e.host,o.port=e.port),o.scheme=e.scheme),o.fragment=r.fragment,o}function C(e,r,t){return v(E(l(e,t),l(r,t),t,!0),t)}function y(e,r){return"string"==typeof e?e=v(l(e,r),r):"object"===n(e)&&(e=l(v(e,r),r)),e}function S(e,r,t){return"string"==typeof e?e=v(l(e,t),t):"object"===n(e)&&(e=v(e,t)),"string"==typeof r?r=v(l(r,t),t):"object"===n(r)&&(r=v(r,t)),e===r}function A(e,r){return e&&e.toString().replace(r&&r.iri?w.ESCAPE:x.ESCAPE,c)}function D(e,r){return e&&e.toString().replace(r&&r.iri?w.PCT_ENCODED:x.PCT_ENCODED,h)}function F(e){var r=h(e);return r.match(oe)?r:e}var x=i(!1),w=i(!0),O=function(e){if(Array.isArray(e)){for(var r=0,t=Array(e.length);r= 0x80 (not a basic code point)","invalid-input":"Invalid input"},_=Math.floor,P=String.fromCharCode,U=function(e){return String.fromCodePoint.apply(String,O(e))},q=function(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:36},H=function(e,r){return e+22+75*(e<26)-((0!=r)<<5)},j=function(e,r,t){var n=0;for(e=t?_(e/700):e>>1,e+=_(e/r);e>455;n+=36)e=_(e/35);return _(n+36*e/(e+38))},z=function(e){var r=[],t=e.length,n=0,o=128,a=72,i=e.lastIndexOf("-");i<0&&(i=0);for(var s=0;s=128&&u("not-basic"),r.push(e.charCodeAt(s));for(var p=i>0?i+1:0;p=t&&u("invalid-input");var d=q(e.charCodeAt(p++));(d>=36||d>_((b-n)/c))&&u("overflow"),n+=d*c;var l=h<=a?1:h>=a+26?26:h-a;if(d_(b/g)&&u("overflow"),c*=g}var m=r.length+1;a=j(n-f,m,0==f),_(n/m)>b-o&&u("overflow"),o+=_(n/m),n%=m,r.splice(n++,0,o)}return String.fromCodePoint.apply(String,r)},L=function(e){var r=[];e=f(e);var t=e.length,n=128,o=0,a=72,i=!0,s=!1,p=undefined;try{for(var c,h=e[Symbol.iterator]();!(i=(c=h.next()).done);i=!0){var d=c.value;d<128&&r.push(P(d))}}catch(L){s=!0,p=L}finally{try{!i&&h["return"]&&h["return"]()}finally{if(s)throw p}}var l=r.length,g=l;for(l&&r.push("-");g=n&&A_((b-o)/D)&&u("overflow"),o+=(m-n)*D,n=m;var F=!0,x=!1,w=undefined;try{for(var O,N=e[Symbol.iterator]();!(F=(O=N.next()).done);F=!0){var I=O.value;if(Ib&&u("overflow"),I==n){for(var T=o,R=36;;R+=36){var U=R<=a?1:R>=a+26?26:R-a;if(TA-Z\\x5E-\\x7E]",'[\\"\\\\]'),oe=new RegExp(ee,"g"),ae=new RegExp(te,"g"),ie=new RegExp(r("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',ne),"g"),ue=new RegExp(r("[^]",ee,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),se=ue,pe={scheme:"mailto",parse:function(e,r){var t=e.to=e.path?e.path.split(","):[];if(e.path=undefined,e.query){for(var n=!1,o={},a=e.query.split("&"),i=0,u=a.length;i\[\]\^\`\{\|\}\~\x7F-\xFF]/g,c):"")}return e}},he=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,de={scheme:"urn:uuid",parse:function(e,r){return r.tolerant||e.path&&e.path.match(he)||(e.error=e.error||"UUID is not valid."),e},serialize:function(e,r){return r.tolerant||e.path&&e.path.match(he)?e.path=(e.path||"").toLowerCase():e.scheme=undefined,V.urn.serialize(e,r)}};V.http=K,V.https=W,V.mailto=pe,V.urn=ce,V["urn:uuid"]=de,e.SCHEMES=V,e.pctEncChar=c,e.pctDecChars=h,e.parse=l,e.removeDotSegments=m,e.serialize=v,e.resolveComponents=E,e.resolve=C,e.normalize=y,e.equal=S,e.escapeComponent=A,e.unescapeComponent=D,Object.defineProperty(e,"__esModule",{value:!0})}); //# sourceMappingURL=uri.all.min.js.map