This repository has been archived by the owner on Dec 5, 2018. It is now read-only.
/
omnipath.min.js
13 lines (13 loc) · 35.9 KB
/
omnipath.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
/*!
* Omnipath v2.0.3 (January 17th 2018)
*
* https://github.com/JS-DevTools/omnipath
*
* @author James Messinger (https://jamesmessinger.com)
* @license MIT
*/
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.OmniPath=f()}})(function(){var define,module,exports;return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){"use strict";module.exports=require("./omni-path"),module.exports.Posix=module.exports.posix=require("./omni-posix"),module.exports.Windows=module.exports.windows=module.exports.win32=require("./omni-windows"),module.exports.Url=module.exports.url=require("./omni-url")},{"./omni-path":4,"./omni-posix":5,"./omni-url":6,"./omni-windows":7}],2:[function(require,module,exports){(function(process){!function(){"use strict";var r=require("path");if(r.posix&&r.windows)module.exports=r;else{var e="win32"===process.platform,t=require("../util"),n=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/,o=/^([\s\S]*?)((?:\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))(?:[\\\/]*)$/,i={resolve:function(){for(var r="",e="",n=!1,o=arguments.length-1;o>=-1;o--){var i;if(o>=0?i=arguments[o]:r?(i=process.env["="+r])&&i.substr(0,3).toLowerCase()===r.toLowerCase()+"\\"||(i=r+"\\"):i=process.cwd(),!t.isString(i))throw new TypeError("Arguments to path.resolve must be strings");if(i){var s=c(i),a=s.device,l=s.isUnc,f=s.isAbsolute,h=s.tail;if((!a||!r||a.toLowerCase()===r.toLowerCase())&&(r||(r=a),n||(e=h+"\\"+e,n=f),r&&n))break}}return l&&(r=p(r)),e=u(e.split(/[\\\/]+/),!n).join("\\"),r+(n?"\\":"")+e||"."},normalize:function(r){var e=c(r),t=e.device,n=e.isUnc,o=e.isAbsolute,i=e.tail,s=/[\\\/]$/.test(i);return(i=u(i.split(/[\\\/]+/),!o).join("\\"))||o||(i="."),i&&s&&(i+="\\"),n&&(t=p(t)),t+(o?"\\":"")+i},isAbsolute:function(r){return c(r).isAbsolute},join:function(){for(var r=[],e=0;e<arguments.length;e++){var n=arguments[e];if(!t.isString(n))throw new TypeError("Arguments to path.join must be strings");n&&r.push(n)}var o=r.join("\\");return/^[\\\/]{2}[^\\\/]/.test(r[0])||(o=o.replace(/^[\\\/]{2,}/,"\\")),i.normalize(o)},relative:function(r,e){r=i.resolve(r),e=i.resolve(e);for(var t=r.toLowerCase(),n=e.toLowerCase(),o=l(e.split("\\")),s=l(t.split("\\")),a=l(n.split("\\")),u=Math.min(s.length,a.length),f=u,c=0;c<u;c++)if(s[c]!==a[c]){f=c;break}if(0==f)return e;var p=[];for(c=f;c<s.length;c++)p.push("..");return(p=p.concat(o.slice(f))).join("\\")},_makeLong:function(r){if(!t.isString(r))return r;if(!r)return"";var e=i.resolve(r);return/^[a-zA-Z]\:\\/.test(e)?"\\\\?\\"+e:/^\\\\[^?.]/.test(e)?"\\\\?\\UNC\\"+e.substring(2):r},dirname:function(r){var e=f(r),t=e[0],n=e[1];return t||n?(n&&(n=n.substr(0,n.length-1)),t+n):"."},basename:function(r,e){var t=f(r)[2];return e&&t.substr(-1*e.length)===e&&(t=t.substr(0,t.length-e.length)),t},extname:function(r){return f(r)[3]},format:function(r){if(!t.isObject(r))throw new TypeError("Parameter 'pathObject' must be an object, not "+typeof r);var e=r.root||"";if(!t.isString(e))throw new TypeError("'pathObject.root' must be a string or undefined, not "+typeof r.root);var n=r.dir,o=r.base||"";return n?n[n.length-1]===i.sep?n+o:n+i.sep+o:o},parse:function(r){if(!t.isString(r))throw new TypeError("Parameter 'pathString' must be a string, not "+typeof r);var e=f(r);if(!e||4!==e.length)throw new TypeError("Invalid path '"+r+"'");return{root:e[0],dir:e[0]+e[1].slice(0,-1),base:e[2],ext:e[3],name:e[2].slice(0,e[2].length-e[3].length)}},sep:"\\",delimiter:";"},s=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,a={resolve:function(){for(var r="",e=!1,n=arguments.length-1;n>=-1&&!e;n--){var o=n>=0?arguments[n]:process.cwd();if(!t.isString(o))throw new TypeError("Arguments to path.resolve must be strings");o&&(r=o+"/"+r,e="/"===o[0])}return r=u(r.split("/"),!e).join("/"),(e?"/":"")+r||"."},normalize:function(r){var e=a.isAbsolute(r),t=r&&"/"===r[r.length-1];return(r=u(r.split("/"),!e).join("/"))||e||(r="."),r&&t&&(r+="/"),(e?"/":"")+r},isAbsolute:function(r){return"/"===r.charAt(0)},join:function(){for(var r="",e=0;e<arguments.length;e++){var n=arguments[e];if(!t.isString(n))throw new TypeError("Arguments to path.join must be strings");n&&(r+=r?"/"+n:n)}return a.normalize(r)},relative:function(r,e){r=a.resolve(r).substr(1),e=a.resolve(e).substr(1);for(var t=l(r.split("/")),n=l(e.split("/")),o=Math.min(t.length,n.length),i=o,s=0;s<o;s++)if(t[s]!==n[s]){i=s;break}var u=[];for(s=i;s<t.length;s++)u.push("..");return(u=u.concat(n.slice(i))).join("/")},_makeLong:function(r){return r},dirname:function(r){var e=h(r),t=e[0],n=e[1];return t||n?(n&&(n=n.substr(0,n.length-1)),t+n):"."},basename:function(r,e){var t=h(r)[2];return e&&t.substr(-1*e.length)===e&&(t=t.substr(0,t.length-e.length)),t},extname:function(r){return h(r)[3]},format:function(r){if(!t.isObject(r))throw new TypeError("Parameter 'pathObject' must be an object, not "+typeof r);var e=r.root||"";if(!t.isString(e))throw new TypeError("'pathObject.root' must be a string or undefined, not "+typeof r.root);return(r.dir?r.dir+a.sep:"")+(r.base||"")},parse:function(r){if(!t.isString(r))throw new TypeError("Parameter 'pathString' must be a string, not "+typeof r);var e=h(r);if(!e||4!==e.length)throw new TypeError("Invalid path '"+r+"'");return e[1]=e[1]||"",e[2]=e[2]||"",e[3]=e[3]||"",{root:e[0],dir:e[0]+e[1].slice(0,-1),base:e[2],ext:e[3],name:e[2].slice(0,e[2].length-e[3].length)}},sep:"/",delimiter:":"};module.exports=e?i:a,module.exports.posix=a,module.exports.win32=i}function u(r,e){for(var t=[],n=0;n<r.length;n++){var o=r[n];o&&"."!==o&&(".."===o?t.length&&".."!==t[t.length-1]?t.pop():e&&t.push(".."):t.push(o))}return t}function l(r){for(var e=r.length-1,t=0;t<=e&&!r[t];t++);for(var n=e;n>=0&&!r[n];n--);return 0===t&&n===e?r:t>n?[]:r.slice(t,n+1)}function f(r){var e=n.exec(r),t=(e[1]||"")+(e[2]||""),i=e[3]||"",s=o.exec(i);return[t,s[1],s[2],s[3]]}function c(r){var e=n.exec(r),t=e[1]||"",o=!!t&&":"!==t[1];return{device:t,isUnc:o,isAbsolute:o||!!e[2],tail:e[3]}}function p(r){return"\\\\"+r.replace(/^[\\\/]+/,"").replace(/[\\\/]+/g,"\\")}function h(r){return s.exec(r).slice(1)}}()}).call(this,require("_process"))},{"../util":8,_process:9,path:2}],3:[function(require,module,exports){!function(){"use strict";var t=require("path");if(t.posix&&t.windows)module.exports=require("url");else{var s=require("punycode"),h=require("../util");exports.parse=y,exports.resolve=function(t,s){return y(t,!1,!0).resolve(s)},exports.resolveObject=function(t,s){if(!t)return s;return y(t,!1,!0).resolveObject(s)},exports.format=function(t){h.isString(t)&&(t=y(t));if(!(t instanceof g))return g.prototype.format.call(t);return t.format()},exports.Url=g;var e=/^([a-z0-9.+-]+:)/i,r=/:[0-9]*$/,a=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,o=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),n=["'"].concat(o),i=["%","/","?",";","#"].concat(n),l=["/","?","#"],p=/^[+a-z0-9A-Z_-]{0,63}$/,u=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,c={javascript:!0,"javascript:":!0},f={javascript:!0,"javascript:":!0},m={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},v=require("querystring");g.prototype.parse=function(t,r,o){if(!h.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var g=t.indexOf("?"),y=-1!==g&&g<t.indexOf("#")?"?":"#",b=t.split(y);b[0]=b[0].replace(/\\/g,"/");var q=t=b.join(y);if(q=q.trim(),!o&&1===t.split("#").length){var d=a.exec(q);if(d)return this.path=q,this.href=q,this.pathname=d[1],d[2]?(this.search=d[2],this.query=r?v.parse(this.search.substr(1)):this.search.substr(1)):r&&(this.search="",this.query={}),this}var x=e.exec(q);if(x){var O=(x=x[0]).toLowerCase();this.protocol=O,q=q.substr(x.length)}if(o||x||q.match(/^\/\/[^@\/]+@[^@\/]+/)){var j="//"===q.substr(0,2);!j||x&&f[x]||(q=q.substr(2),this.slashes=!0)}if(!f[x]&&(j||x&&!m[x])){for(var A,w,C=-1,I=0;I<l.length;I++){-1!==(U=q.indexOf(l[I]))&&(-1===C||U<C)&&(C=U)}-1!==(w=-1===C?q.lastIndexOf("@"):q.lastIndexOf("@",C))&&(A=q.slice(0,w),q=q.slice(w+1),this.auth=decodeURIComponent(A)),C=-1;for(I=0;I<i.length;I++){var U;-1!==(U=q.indexOf(i[I]))&&(-1===C||U<C)&&(C=U)}-1===C&&(C=q.length),this.host=q.slice(0,C),q=q.slice(C),this.parseHost(),this.hostname=this.hostname||"";var k="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!k)for(var N=this.hostname.split(/\./),R=(I=0,N.length);I<R;I++){var S=N[I];if(S&&!S.match(p)){for(var $="",z=0,H=S.length;z<H;z++)S.charCodeAt(z)>127?$+="x":$+=S[z];if(!$.match(p)){var L=N.slice(0,I),Z=N.slice(I+1),_=S.match(u);_&&(L.push(_[1]),Z.unshift(_[2])),Z.length&&(q="/"+Z.join(".")+q),this.hostname=L.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),k||(this.hostname=s.toASCII(this.hostname));var E=this.port?":"+this.port:"",P=this.hostname||"";this.host=P+E,this.href+=this.host,k&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==q[0]&&(q="/"+q))}if(!c[O])for(I=0,R=n.length;I<R;I++){var T=n[I];if(-1!==q.indexOf(T)){var B=encodeURIComponent(T);B===T&&(B=escape(T)),q=q.split(T).join(B)}}var D=q.indexOf("#");-1!==D&&(this.hash=q.substr(D),q=q.slice(0,D));var F=q.indexOf("?");if(-1!==F?(this.search=q.substr(F),this.query=q.substr(F+1),r&&(this.query=v.parse(this.query)),q=q.slice(0,F)):r&&(this.search="",this.query={}),q&&(this.pathname=q),m[O]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){E=this.pathname||"";var G=this.search||"";this.path=E+G}return this.href=this.format(),this},g.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var s=this.protocol||"",e=this.pathname||"",r=this.hash||"",a=!1,o="";this.host?a=t+this.host:this.hostname&&(a=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(a+=":"+this.port)),this.query&&h.isObject(this.query)&&Object.keys(this.query).length&&(o=v.stringify(this.query));var n=this.search||o&&"?"+o||"";return s&&":"!==s.substr(-1)&&(s+=":"),this.slashes||(!s||m[s])&&!1!==a?(a="//"+(a||""),e&&"/"!==e.charAt(0)&&(e="/"+e)):a||(a=""),r&&"#"!==r.charAt(0)&&(r="#"+r),n&&"?"!==n.charAt(0)&&(n="?"+n),s+a+(e=e.replace(/[?#]/g,function(t){return encodeURIComponent(t)}))+(n=n.replace("#","%23"))+r},g.prototype.resolve=function(t){return this.resolveObject(y(t,!1,!0)).format()},g.prototype.resolveObject=function(t){if(h.isString(t)){var s=new g;s.parse(t,!1,!0),t=s}for(var e=new g,r=Object.keys(this),a=0;a<r.length;a++){var o=r[a];e[o]=this[o]}if(e.hash=t.hash,""===t.href)return e.href=e.format(),e;if(t.slashes&&!t.protocol){for(var n=Object.keys(t),i=0;i<n.length;i++){var l=n[i];"protocol"!==l&&(e[l]=t[l])}return m[e.protocol]&&e.hostname&&!e.pathname&&(e.path=e.pathname="/"),e.href=e.format(),e}if(t.protocol&&t.protocol!==e.protocol){if(!m[t.protocol]){for(var p=Object.keys(t),u=0;u<p.length;u++){var c=p[u];e[c]=t[c]}return e.href=e.format(),e}if(e.protocol=t.protocol,t.host||f[t.protocol])e.pathname=t.pathname;else{for(var v=(t.pathname||"").split("/");v.length&&!(t.host=v.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==v[0]&&v.unshift(""),v.length<2&&v.unshift(""),e.pathname=v.join("/")}if(e.search=t.search,e.query=t.query,e.host=t.host||"",e.auth=t.auth,e.hostname=t.hostname||t.host,e.port=t.port,e.pathname||e.search){var y=e.pathname||"",b=e.search||"";e.path=y+b}return e.slashes=e.slashes||t.slashes,e.href=e.format(),e}var q=e.pathname&&"/"===e.pathname.charAt(0),d=t.host||t.pathname&&"/"===t.pathname.charAt(0),x=d||q||e.host&&t.pathname,O=x,j=e.pathname&&e.pathname.split("/")||[],A=(v=t.pathname&&t.pathname.split("/")||[],e.protocol&&!m[e.protocol]);if(A&&(e.hostname="",e.port=null,e.host&&(""===j[0]?j[0]=e.host:j.unshift(e.host)),e.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===v[0]?v[0]=t.host:v.unshift(t.host)),t.host=null),x=x&&(""===v[0]||""===j[0])),d)e.host=t.host||""===t.host?t.host:e.host,e.hostname=t.hostname||""===t.hostname?t.hostname:e.hostname,e.search=t.search,e.query=t.query,j=v;else if(v.length)j||(j=[]),j.pop(),j=j.concat(v),e.search=t.search,e.query=t.query;else if(!h.isNullOrUndefined(t.search)){if(A)e.hostname=e.host=j.shift(),(k=!!(e.host&&e.host.indexOf("@")>0)&&e.host.split("@"))&&(e.auth=k.shift(),e.host=e.hostname=k.shift());return e.search=t.search,e.query=t.query,h.isNull(e.pathname)&&h.isNull(e.search)||(e.path=(e.pathname?e.pathname:"")+(e.search?e.search:"")),e.href=e.format(),e}if(!j.length)return e.pathname=null,e.search?e.path="/"+e.search:e.path=null,e.href=e.format(),e;for(var w=j.slice(-1)[0],C=(e.host||t.host)&&("."===w||".."===w)||""===w,I=0,U=j.length;U>=0;U--)"."===(w=j[U])?j.splice(U,1):".."===w?(j.splice(U,1),I++):I&&(j.splice(U,1),I--);if(!x&&!O)for(;I--;I)j.unshift("..");!x||""===j[0]||j[0]&&"/"===j[0].charAt(0)||j.unshift(""),C&&"/"!==j.join("/").substr(-1)&&j.push("");var k,N=""===j[0]||j[0]&&"/"===j[0].charAt(0);A&&(e.hostname=e.host=N?"":j.length?j.shift():"",(k=!!(e.host&&e.host.indexOf("@")>0)&&e.host.split("@"))&&(e.auth=k.shift(),e.host=e.hostname=k.shift()));return(x=x||e.host&&j.length)&&!N&&j.unshift(""),j.length?e.pathname=j.join("/"):(e.pathname=null,e.path=null),h.isNull(e.pathname)&&h.isNull(e.search)||(e.path=(e.pathname?e.pathname:"")+(e.search?e.search:"")),e.auth=t.auth||e.auth,e.slashes=e.slashes||t.slashes,e.href=e.format(),e},g.prototype.parseHost=function(){var t=this.host,s=r.exec(t);s&&(":"!==(s=s[0])&&(this.port=s.substr(1)),t=t.substr(0,t.length-s.length)),t&&(this.hostname=t)}}function g(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function y(t,s,e){if(t&&h.isObject(t)&&t instanceof g)return t;var r=new g;return r.parse(t,s,e),r}}()},{"../util":8,path:2,punycode:10,querystring:13,url:3}],4:[function(require,module,exports){(function(process){"use strict";module.exports=OmniPath;var path=require("./node/path"),url=require("./node/url"),util=require("./util"),querystring=require("querystring"),parts=["protocol","slashes","hostname","port","host","dir","base","pathname","query","search","path","hash"];function OmniPath(t,i){if(t instanceof OmniPath)return t.clone(i);t=util.toString(t);var r=util.getType(t);return r.isUrl?new OmniPath.Url(t,i):r.isWindows?new OmniPath.Windows(t,i):new OmniPath.Posix(t,i)}function callSubclassMethod(t,i){var r=util.getType(i[0]);return r.isUrl?OmniPath.Url[t].apply(OmniPath.Url,i):r.isWindows?OmniPath.Windows[t].apply(OmniPath.Windows,i):OmniPath.Posix[t].apply(OmniPath.Posix,i)}["isUrl","isPosix","isWindows"].forEach(function(t){OmniPath[t]=function(i){return i instanceof OmniPath?i[t]:!!util.getType(i)[t]}}),util.props.forEach(function(t){void 0===OmniPath[t]&&(OmniPath[t]=function(i,r){return new this(i,r)[t]})}),OmniPath.dirname=function(t,i){return new this(t,i).dirname()},OmniPath.prototype.dirname=function(){return this._path.dirname(this.pathname)},OmniPath.basename=function(t,i,r){"object"==typeof i&&(r=i,i=void 0);return new this(t,r).basename(i)},OmniPath.prototype.basename=function(t){return this._path.basename(this.base,t)},OmniPath.extname=OmniPath.ext,OmniPath.prototype.extname=function(){return this.ext},OmniPath.join=function(t,i){return callSubclassMethod("join",arguments)},OmniPath.prototype.join=function(t,i){var r=[this].concat(Array.prototype.slice.call(arguments)),n=util.fastParse(r,!1,!0);return this._path.join.apply(this._path,n.pathnames)+n.searches[n.last]+n.hashes[n.last]},OmniPath.resolve=function(t,i,r){return callSubclassMethod("resolve",arguments)},OmniPath.prototype.resolve=function(t,i){var r=[this].concat(Array.prototype.slice.call(arguments)),n=util.fastParse(r),a=n.pathnames;if(n.hasUrls)return OmniPath.Url.resolve.apply(OmniPath.Url,n.hrefs);process.browser&&(a=[OmniPath.cwd()].concat(n.pathnames));for(var s=this._path.resolve.apply(this._path,a),e="",h="",o=0;o<=n.last;o++)n.searches[o]?(e=n.searches[o],h=n.hashes[o]):n.hashes[o]&&(h=n.hashes[o]);return s+e+h},OmniPath.normalize=function(t,i){return new this(t,i).normalize()},OmniPath.prototype.normalize=function(){var t=this.pathname||this._path.format(this);return this._path.normalize(t)+this._getFormattedSearchAndHash()},OmniPath.format=function(t,i){return new this(t,i).format()},OmniPath.prototype.format=function(){return this._path.format(this)+this._getFormattedSearchAndHash()},OmniPath.formatPart=function(t,i,r){return new this(t,r).formatPart(i)},OmniPath.prototype.formatPart=function(t){t=parts.indexOf(t);var i=this.clone();return t<0&&(i.protocol=""),t<1&&(i.slashes=!1),t<2&&(i.hostname=""),t<3&&(i.port=""),t<4&&(i.host=""),t<5&&(i.dir=""),t<6&&(i.base=""),t<7&&(i.pathname=""),t<8&&(i.query=""),t<9&&(i.search=""),t<10&&(i.path=""),t<11&&(i.hash=""),i.format()},OmniPath.prototype.toString=OmniPath.prototype.format,OmniPath.prototype.valueOf=OmniPath.prototype.format,OmniPath.toUrl=function(t,i){return new this(t,i).toUrl()},OmniPath.prototype.toUrl=function(){return url.parse(this.toUrlString(),!0)},OmniPath.toUrlString=function(t,i){return new this(t,i).toUrlString()},OmniPath.prototype.toUrlString=function(){var t=this.hostname,i=this.pathname,r=this.search,n=this.hash;i=i.replace(util.backslashPattern,"%5C"),r=r.replace(util.backslashPattern,"%5C"),n=n.replace(util.backslashPattern,"%5C");var a=url.format({protocol:"file:",slashes:!0,hostname:t,pathname:i,search:r,hash:n});return url.parse(a).format()},OmniPath.cwd=function(){if(process.browser){var t=new OmniPath.Url(window.location.href).formatPart("dir");return t.substr(-1)!==OmniPath.Url.sep&&(t+=OmniPath.Url.sep),t}return process.cwd()+path.sep},OmniPath.parse=function(t,i){return new this(t,i)},OmniPath.prototype.parse=function(t,i){return t instanceof this.constructor?(util.copy(t,this),void(this._options=i||t._options||this._options)):(this.isUrl=!1,this.isFS=!1,this.isPosix=!1,this.isWindows=!1,this.isUnc=!1,this.isAbsolute=!1,this.sep="",this.delimiter="",this.href="",this.protocol="",this.slashes=!1,this.auth="",this.host="",this.hostname="",this.port="",this.path="",this.pathname="",this.root="",this.dir="",this.base="",this.name="",this.ext="",this.search="",this.query={},this.hash="",this._options=i||this._options||t&&t._options,util.toString(t))},OmniPath.prototype.toJSON=function(){for(var t={},i=0;i<util.props.length;i++){var r=util.props[i];t[r]=this[r]}return t},OmniPath.prototype.clone=function(t){return new(0,this.constructor)(this,t)},OmniPath.prototype._getFormattedSearchAndHash=function(){var t=this.search||"",i=this.hash||"";if(t)"?"!==t[0]&&(t="?"+t);else if(this.query){var r=querystring.stringify(this.query);r&&(t="?"+r)}return i&&"#"!==i[0]&&(i="#"+i),t+i}}).call(this,require("_process"))},{"./node/path":2,"./node/url":3,"./util":8,_process:9,querystring:13}],5:[function(require,module,exports){"use strict";module.exports=OmniPosix;var posix=require("./node/path").posix,OmniPath=require("./index"),util=require("./util");function OmniPosix(i,t){if(!(this instanceof OmniPosix))throw new TypeError('Use the "new" keyword when creating an instance of OmniPath.Posix');this._path=posix,this.parse(i,t)}util.inherits(OmniPosix,OmniPath),OmniPosix.sep=posix.sep,OmniPosix.delimiter=posix.delimiter,OmniPosix.isUrl=function(){return!1},OmniPosix.isPosix=function(){return!0},OmniPosix.isWindows=function(){return!1},OmniPosix.prototype.parse=function(i,t){if("string"==typeof(i=OmniPath.prototype.parse.apply(this,arguments))){var s=util.parsePath(i,this._options),e=posix.parse(s.pathname);this.isFS=!0,this.isPosix=!0,this.isAbsolute=posix.isAbsolute(s.pathname),this.sep=posix.sep,this.delimiter=posix.delimiter,this.href=i,this.path=s.pathname+s.search,this.pathname=s.pathname,this.root=e.root,this.dir=e.dir,this.base=e.base,this.name=e.name,this.ext=e.ext,this.search=s.search,this.query=s.query,this.hash=s.hash}return this},OmniPosix.join=function(i,t){return OmniPath.prototype.join.apply({_path:posix,href:""},arguments)},OmniPosix.resolve=function(i,t,s){return OmniPath.prototype.resolve.apply({_path:posix,href:""},arguments)},OmniPosix.cwd=function(){var i=OmniPath.cwd();return posix.normalize(i)}},{"./index":1,"./node/path":2,"./util":8}],6:[function(require,module,exports){"use strict";module.exports=OmniUrl;var posix=require("./node/path").posix,url=require("./node/url"),OmniPath=require("./omni-path"),util=require("./util"),slashesPattern=/^\/*/,looseProtocolPattern=/^[a-z0-9.+-]+:/i;function OmniUrl(t,r){if(!(this instanceof OmniUrl))throw new TypeError('Use the "new" keyword when creating an instance of OmniPath.Url');this._path=posix,this.parse(t,r)}util.inherits(OmniUrl,OmniPath),OmniUrl.sep=posix.sep,OmniUrl.isUrl=function(){return!0},OmniUrl.isPosix=function(){return!1},OmniUrl.isWindows=function(){return!1},OmniUrl.prototype.parse=function(t,r){if("string"==typeof(t=OmniPath.prototype.parse.apply(this,arguments))){var i=url.parse(t,!0),e=posix.parse(i.pathname||"");this.isUrl=!0,this.isAbsolute=!!i.protocol||!!i.host||posix.isAbsolute(i.pathname||""),this.sep=posix.sep,this.href=i.href||"",this.protocol=i.protocol||"",this.slashes=i.slashes||!1,this.auth=i.auth||"",this.host=i.host||"",this.hostname=i.hostname||"",this.port=i.port||"",this.path=i.path||"",this.pathname=i.pathname||"",this.root=e.root,this.dir=e.dir,this.base=e.base,this.name=e.name,this.ext=e.ext,this.search=i.search||"",this.query=i.query||{},this.hash=i.hash||""}return this},OmniUrl.prototype.normalize=function(){var t=this.pathname||this._getFormattedPathname(),r=posix.normalize(t),i=!1;"."===r&&(r="",i=!0);var e=this.clone();return e.pathname=r,""===(t=url.format(e))&&i?".":t},OmniUrl.prototype.format=function(){var t=this.clone();return t.pathname=this._getFormattedPathname(),url.format(t)},OmniUrl.prototype.toUrlString=function(){return url.format(this)},OmniUrl.join=function(t,r){for(var i=util.fastParse(arguments,!0),e=i.pathnames[0],s=1;s<i.pathnames.length;s++){var n=i.pathnames[s];n&&(n===posix.sep||"\\"===n?s===i.pathnames.length-1&&(e+=posix.sep):util.endsWithAnySeparator(e)||util.startsWithAnySeparator(n)?e+=n:e+=posix.sep+n)}return new OmniUrl(e+=i.searches[i.last]+i.hashes[i.last]).normalize()},OmniUrl.prototype.join=function(t,r){return OmniUrl.join.apply(OmniUrl,[this].concat(Array.prototype.slice.call(arguments)))},OmniUrl.resolve=function(t,r,i){var e=util.getArgs(arguments).paths;r=util.toString(e[e.length-1]);for(var s=e.length-2;s>=0;s--)if(t=util.toString(e[s]),r=url.resolve(t,r),looseProtocolPattern.test(r))return r;return url.resolve(OmniPath.cwd(),r)},OmniUrl.prototype.resolve=function(t,r){return OmniUrl.resolve.apply(OmniUrl,[this].concat(Array.prototype.slice.call(arguments)))},OmniUrl.cwd=function(){var t=OmniPath.cwd();return OmniUrl.normalize(t)},OmniUrl.prototype._getFormattedPathname=function(){var t=this.pathname;if(this.dir||this.base){var r=t;if(this.dir===this.sep)t=(slashesPattern.exec(this.pathname)||[""])[0]+this.base;else t=posix.format(this);util.endsWithAnySeparator(r)&&!util.endsWithAnySeparator(t)&&(t+=posix.sep)}return t}},{"./node/path":2,"./node/url":3,"./omni-path":4,"./util":8}],7:[function(require,module,exports){"use strict";module.exports=OmniWindows;var win32=require("./node/path").win32,OmniPath=require("./index"),util=require("./util"),uncPattern=/^[\\\/]{2}([^\\\/]+)[\\\/]+[^\\\/]+/,splitUncPattern=/^\/+([^\/]+)(.*)/;function OmniWindows(i,t){if(!(this instanceof OmniWindows))throw new TypeError('Use the "new" keyword when creating an instance of OmniPath.Windows');this._path=win32,this.parse(i,t)}util.inherits(OmniWindows,OmniPath),OmniWindows.sep=win32.sep,OmniWindows.delimiter=win32.delimiter,OmniWindows.isUrl=function(){return!1},OmniWindows.isPosix=function(){return!1},OmniWindows.isWindows=function(){return!0},OmniWindows.prototype.parse=function(i,t){if("string"==typeof(i=OmniPath.prototype.parse.apply(this,arguments))){var n=util.parsePath(i,this._options),s=win32.parse(n.pathname),e=uncPattern.exec(n.pathname);this.isFS=!0,this.isWindows=!0,this.isAbsolute=win32.isAbsolute(n.pathname),this.isUnc=!!e,this.sep=win32.sep,this.delimiter=win32.delimiter,this.href=i,this.path=n.pathname+n.search,this.pathname=n.pathname,this.root=s.root,this.dir=s.dir,this.base=s.base,this.name=s.name,this.ext=s.ext,this.search=n.search,this.query=n.query,this.hash=n.hash,this.isUnc&&(this.host=this.hostname=e[1])}return this},OmniWindows.prototype.format=function(){return!this.isUnc||!this.host&&!this.hostname||this.dir||this.base?OmniPath.prototype.format.apply(this,arguments):"\\\\"+(this.hostname||this.host)},OmniWindows.prototype.toUrlString=function(){var i=this.clone();if(i.pathname=i.pathname.replace(util.backslashPattern,"/"),this.isUnc){var t=splitUncPattern.exec(i.pathname);t&&(i.hostname=t[1],i.pathname=t[2]||"/")}return OmniPath.prototype.toUrlString.apply(i,arguments)},OmniWindows.join=function(i,t){return OmniPath.prototype.join.apply({_path:win32,href:""},arguments)},OmniWindows.resolve=function(i,t,n){return OmniPath.prototype.resolve.apply({_path:win32,href:""},arguments)},OmniWindows.cwd=function(){var i=OmniPath.cwd();return win32.normalize(i)}},{"./index":1,"./node/path":2,"./util":8}],8:[function(require,module,exports){(function(process){"use strict";var util=module.exports={props:["isUrl","isFS","isPosix","isWindows","isUnc","isAbsolute","sep","delimiter","href","protocol","slashes","auth","host","hostname","port","path","pathname","root","dir","base","name","ext","search","query","hash"],backslashPattern:/\\/g,isString:isString,isObject:isObject,isNull:isNull,isNullOrUndefined:isNullOrUndefined,toString:toString,inherits:inherits,copy:copy,getType:getType,parsePath:parsePath,fastParse:fastParse,getArgs:getArgs,startsWithAnySeparator:startsWithAnySeparator,endsWithAnySeparator:endsWithAnySeparator},OmniPath=require("./omni-path"),url=require("./node/url"),querystring=require("querystring"),protocolPattern=/^[a-z0-9.+-]+:\/\//i;function isString(t){return"string"==typeof t}function isObject(t){return"object"==typeof t&&null!==t}function isNull(t){return null===t}function isNullOrUndefined(t){return null===t||void 0===t}function toString(t){if("string"==typeof t)return t;if(t instanceof url.Url)return t.format();if(t instanceof OmniPath)return t.format();if(t&&"string"==typeof t.href)return t.href;throw new Error("Expected a file path or URL, but got "+typeof t+" "+t)}function inherits(t,r){t.prototype=Object.create(r.prototype),t.prototype.constructor=t,Object.keys(r).forEach(function(e){"function"==typeof r[e]?t[e]=function(){return r[e].apply(t,arguments)}:t[e]=r[e]})}function copy(t,r){for(var e=0;e<util.props.length;e++){var s=util.props[e];r[s]=t[s]}return r}function getType(t){return t instanceof OmniPath?t:("string"!=typeof t&&(t=toString(t)),protocolPattern.test(t)?{isUrl:!0}:process.browser?{isUrl:!0}:"win32"===process.platform?{isWindows:!0}:{isPosix:!0})}function parsePath(t,r){var e="",s="",n={};if((r=r||{}).allowFileHash){var a=t.indexOf("#");a>=0&&(e=t.substr(a),t=t.substr(0,a))}if(r.allowFileQuery){var i=t.lastIndexOf("?");i>=0&&(n=(s=t.substr(i)).substr(1),(r.parseQueryString||void 0===r.parseQueryString)&&(n=querystring.parse(n)),t=t.substr(0,i))}return{pathname:t,search:s,query:n,hash:e}}function fastParse(t,r,e){for(var s=(t=getArgs(t)).paths,n=t.options,a={last:s.length-1,hasUrls:!1,hrefs:[],pathnames:[],searches:[],hashes:[]},i=0;i<s.length;i++){var o,l,h,p,u,f=s[i];f instanceof OmniPath?(r||f.isUrl?(a.hasUrls=!0,o=f.href,l=f.formatPart("pathname")):o=l=f.pathname,h=f.search,p=f.hash,0!==i||n||(n=f._options)):(o=toString(f),r||!e&&protocolPattern.test(o)?(a.hasUrls=!0,l=(u=parsePath(o,{allowFileQuery:!0,allowFileHash:!0,parseQueryString:!1})).pathname,h=u.search,p=u.hash):n?(l=(u=parsePath(o,{allowFileQuery:n.allowFileQuery,allowFileHash:n.allowFileHash,parseQueryString:!1})).pathname,h=u.search,p=u.hash):(l=o,h=p="")),a.hrefs.push(o),a.pathnames.push(l),a.searches.push(h),a.hashes.push(p)}return a}function getArgs(t){var r={paths:[],options:null};if(t&&t.length>0){var e=t[t.length-1];"string"==typeof e||e instanceof OmniPath||e instanceof url.Url?r.paths=Array.prototype.slice.call(t):(r.options=e,r.paths=Array.prototype.slice.call(t,0,t.length-1))}return r}function startsWithAnySeparator(t){var r=t[0];return"/"===r||"\\"===r}function endsWithAnySeparator(t){var r=t.substr(-1);return"/"===r||"\\"===r}}).call(this,require("_process"))},{"./node/url":3,"./omni-path":4,_process:9,querystring:13}],9:[function(require,module,exports){var cachedSetTimeout,cachedClearTimeout,process=module.exports={};function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}function runTimeout(e){if(cachedSetTimeout===setTimeout)return setTimeout(e,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(e,0);try{return cachedSetTimeout(e,0)}catch(t){try{return cachedSetTimeout.call(null,e,0)}catch(t){return cachedSetTimeout.call(this,e,0)}}}function runClearTimeout(e){if(cachedClearTimeout===clearTimeout)return clearTimeout(e);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(e);try{return cachedClearTimeout(e)}catch(t){try{return cachedClearTimeout.call(null,e)}catch(t){return cachedClearTimeout.call(this,e)}}}!function(){try{cachedSetTimeout="function"==typeof setTimeout?setTimeout:defaultSetTimout}catch(e){cachedSetTimeout=defaultSetTimout}try{cachedClearTimeout="function"==typeof clearTimeout?clearTimeout:defaultClearTimeout}catch(e){cachedClearTimeout=defaultClearTimeout}}();var currentQueue,queue=[],draining=!1,queueIndex=-1;function cleanUpNextTick(){draining&¤tQueue&&(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var e=runTimeout(cleanUpNextTick);draining=!0;for(var t=queue.length;t;){for(currentQueue=queue,queue=[];++queueIndex<t;)currentQueue&¤tQueue[queueIndex].run();queueIndex=-1,t=queue.length}currentQueue=null,draining=!1,runClearTimeout(e)}}function Item(e,t){this.fun=e,this.array=t}function noop(){}process.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];queue.push(new Item(e,t)),1!==queue.length||draining||runTimeout(drainQueue)},Item.prototype.run=function(){this.fun.apply(null,this.array)},process.title="browser",process.browser=!0,process.env={},process.argv=[],process.version="",process.versions={},process.on=noop,process.addListener=noop,process.once=noop,process.off=noop,process.removeListener=noop,process.removeAllListeners=noop,process.emit=noop,process.prependListener=noop,process.prependOnceListener=noop,process.listeners=function(e){return[]},process.binding=function(e){throw new Error("process.binding is not supported")},process.cwd=function(){return"/"},process.chdir=function(e){throw new Error("process.chdir is not supported")},process.umask=function(){return 0}},{}],10:[function(require,module,exports){(function(global){
/*! https://mths.be/punycode v1.4.1 by @mathias */
!function(e){var o="object"==typeof exports&&exports&&!exports.nodeType&&exports,n="object"==typeof module&&module&&!module.nodeType&&module,t="object"==typeof global&&global;t.global!==t&&t.window!==t&&t.self!==t||(e=t);var r,u,i=2147483647,f=36,c=1,l=26,s=38,d=700,p=72,a=128,h="-",v=/^xn--/,g=/[^\x20-\x7E]/,w=/[\x2E\u3002\uFF0E\uFF61]/g,x={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},b=f-c,y=Math.floor,C=String.fromCharCode;function m(e){throw new RangeError(x[e])}function j(e,o){for(var n=e.length,t=[];n--;)t[n]=o(e[n]);return t}function A(e,o){var n=e.split("@"),t="";return n.length>1&&(t=n[0]+"@",e=n[1]),t+j((e=e.replace(w,".")).split("."),o).join(".")}function I(e){for(var o,n,t=[],r=0,u=e.length;r<u;)(o=e.charCodeAt(r++))>=55296&&o<=56319&&r<u?56320==(64512&(n=e.charCodeAt(r++)))?t.push(((1023&o)<<10)+(1023&n)+65536):(t.push(o),r--):t.push(o);return t}function E(e){return j(e,function(e){var o="";return e>65535&&(o+=C((e-=65536)>>>10&1023|55296),e=56320|1023&e),o+=C(e)}).join("")}function F(e,o){return e+22+75*(e<26)-((0!=o)<<5)}function O(e,o,n){var t=0;for(e=n?y(e/d):e>>1,e+=y(e/o);e>b*l>>1;t+=f)e=y(e/b);return y(t+(b+1)*e/(e+s))}function S(e){var o,n,t,r,u,s,d,v,g,w,x,b=[],C=e.length,j=0,A=a,I=p;for((n=e.lastIndexOf(h))<0&&(n=0),t=0;t<n;++t)e.charCodeAt(t)>=128&&m("not-basic"),b.push(e.charCodeAt(t));for(r=n>0?n+1:0;r<C;){for(u=j,s=1,d=f;r>=C&&m("invalid-input"),((v=(x=e.charCodeAt(r++))-48<10?x-22:x-65<26?x-65:x-97<26?x-97:f)>=f||v>y((i-j)/s))&&m("overflow"),j+=v*s,!(v<(g=d<=I?c:d>=I+l?l:d-I));d+=f)s>y(i/(w=f-g))&&m("overflow"),s*=w;I=O(j-u,o=b.length+1,0==u),y(j/o)>i-A&&m("overflow"),A+=y(j/o),j%=o,b.splice(j++,0,A)}return E(b)}function T(e){var o,n,t,r,u,s,d,v,g,w,x,b,j,A,E,S=[];for(b=(e=I(e)).length,o=a,n=0,u=p,s=0;s<b;++s)(x=e[s])<128&&S.push(C(x));for(t=r=S.length,r&&S.push(h);t<b;){for(d=i,s=0;s<b;++s)(x=e[s])>=o&&x<d&&(d=x);for(d-o>y((i-n)/(j=t+1))&&m("overflow"),n+=(d-o)*j,o=d,s=0;s<b;++s)if((x=e[s])<o&&++n>i&&m("overflow"),x==o){for(v=n,g=f;!(v<(w=g<=u?c:g>=u+l?l:g-u));g+=f)E=v-w,A=f-w,S.push(C(F(w+E%A,0))),v=y(E/A);S.push(C(F(v,0))),u=O(n,j,t==r),n=0,++t}++n,++o}return S.join("")}if(r={version:"1.4.1",ucs2:{decode:I,encode:E},decode:S,encode:T,toASCII:function(e){return A(e,function(e){return g.test(e)?"xn--"+T(e):e})},toUnicode:function(e){return A(e,function(e){return v.test(e)?S(e.slice(4).toLowerCase()):e})}},"function"==typeof define&&"object"==typeof define.amd&&define.amd)define("punycode",function(){return r});else if(o&&n)if(module.exports==o)n.exports=r;else for(u in r)r.hasOwnProperty(u)&&(o[u]=r[u]);else e.punycode=r}(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],11:[function(require,module,exports){"use strict";function hasOwnProperty(r,e){return Object.prototype.hasOwnProperty.call(r,e)}module.exports=function(r,e,t,n){e=e||"&",t=t||"=";var o={};if("string"!=typeof r||0===r.length)return o;var a=/\+/g;r=r.split(e);var s=1e3;n&&"number"==typeof n.maxKeys&&(s=n.maxKeys);var p=r.length;s>0&&p>s&&(p=s);for(var y=0;y<p;++y){var u,c,i,l,f=r[y].replace(a,"%20"),v=f.indexOf(t);v>=0?(u=f.substr(0,v),c=f.substr(v+1)):(u=f,c=""),i=decodeURIComponent(u),l=decodeURIComponent(c),hasOwnProperty(o,i)?isArray(o[i])?o[i].push(l):o[i]=[o[i],l]:o[i]=l}return o};var isArray=Array.isArray||function(r){return"[object Array]"===Object.prototype.toString.call(r)}},{}],12:[function(require,module,exports){"use strict";var stringifyPrimitive=function(r){switch(typeof r){case"string":return r;case"boolean":return r?"true":"false";case"number":return isFinite(r)?r:"";default:return""}};module.exports=function(r,e,t,n){return e=e||"&",t=t||"=",null===r&&(r=void 0),"object"==typeof r?map(objectKeys(r),function(n){var i=encodeURIComponent(stringifyPrimitive(n))+t;return isArray(r[n])?map(r[n],function(r){return i+encodeURIComponent(stringifyPrimitive(r))}).join(e):i+encodeURIComponent(stringifyPrimitive(r[n]))}).join(e):n?encodeURIComponent(stringifyPrimitive(n))+t+encodeURIComponent(stringifyPrimitive(r)):""};var isArray=Array.isArray||function(r){return"[object Array]"===Object.prototype.toString.call(r)};function map(r,e){if(r.map)return r.map(e);for(var t=[],n=0;n<r.length;n++)t.push(e(r[n],n));return t}var objectKeys=Object.keys||function(r){var e=[];for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&e.push(t);return e}},{}],13:[function(require,module,exports){"use strict";exports.decode=exports.parse=require("./decode"),exports.encode=exports.stringify=require("./encode")},{"./decode":11,"./encode":12}]},{},[1])(1)});
//# sourceMappingURL=omnipath.min.js.map
//# sourceMappingURL=omnipath.min.js.map