@learningpool/json-schema-mapper
Version:
A json-schema mapper
40 lines • 71.8 kB
JavaScript
"use strict";var e=require("events"),t=require("util"),r=require("path");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=n(e),i=n(t),a=n(r),s="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function u(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function c(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})})),r}var l="1.13.7",p="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||Function("return this")()||{},f=Array.prototype,h=Object.prototype,d="undefined"!=typeof Symbol?Symbol.prototype:null,m=f.push,g=f.slice,v=h.toString,y=h.hasOwnProperty,b="undefined"!=typeof ArrayBuffer,_="undefined"!=typeof DataView,w=Array.isArray,x=Object.keys,k=Object.create,S=b&&ArrayBuffer.isView,j=isNaN,A=isFinite,z=!{toString:null}.propertyIsEnumerable("toString"),I=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],E=Math.pow(2,53)-1;function O(e,t){return t=null==t?e.length-1:+t,function(){for(var r=Math.max(arguments.length-t,0),n=Array(r),o=0;o<r;o++)n[o]=arguments[o+t];switch(t){case 0:return e.call(this,n);case 1:return e.call(this,arguments[0],n);case 2:return e.call(this,arguments[0],arguments[1],n)}var i=Array(t+1);for(o=0;o<t;o++)i[o]=arguments[o];return i[t]=n,e.apply(this,i)}}function P(e){var t=typeof e;return"function"===t||"object"===t&&!!e}function Q(e){return null===e}function R(e){return void 0===e}function q(e){return!0===e||!1===e||"[object Boolean]"===v.call(e)}function T(e){return!(!e||1!==e.nodeType)}function U(e){var t="[object "+e+"]";return function(e){return v.call(e)===t}}var F=U("String"),C=U("Number"),B=U("Date"),D=U("RegExp"),M=U("Error"),$=U("Symbol"),H=U("ArrayBuffer"),N=U("Function"),L=p.document&&p.document.childNodes;"function"!=typeof/./&&"object"!=typeof Int8Array&&"function"!=typeof L&&(N=function(e){return"function"==typeof e||!1});var V=N,Z=U("Object"),W=_&&(!/\[native code\]/.test(String(DataView))||Z(new DataView(new ArrayBuffer(8)))),J="undefined"!=typeof Map&&Z(new Map),K=U("DataView");var G=W?function(e){return null!=e&&V(e.getInt8)&&H(e.buffer)}:K,X=w||U("Array");function Y(e,t){return null!=e&&y.call(e,t)}var ee=U("Arguments");!function(){ee(arguments)||(ee=function(e){return Y(e,"callee")})}();var te=ee;function re(e){return!$(e)&&A(e)&&!isNaN(parseFloat(e))}function ne(e){return C(e)&&j(e)}function oe(e){return function(){return e}}function ie(e){return function(t){var r=e(t);return"number"==typeof r&&r>=0&&r<=E}}function ae(e){return function(t){return null==t?void 0:t[e]}}var se=ae("byteLength"),ue=ie(se),ce=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;var le=b?function(e){return S?S(e)&&!G(e):ue(e)&&ce.test(v.call(e))}:oe(!1),pe=ae("length");function fe(e,t){t=function(e){for(var t={},r=e.length,n=0;n<r;++n)t[e[n]]=!0;return{contains:function(e){return!0===t[e]},push:function(r){return t[r]=!0,e.push(r)}}}(t);var r=I.length,n=e.constructor,o=V(n)&&n.prototype||h,i="constructor";for(Y(e,i)&&!t.contains(i)&&t.push(i);r--;)(i=I[r])in e&&e[i]!==o[i]&&!t.contains(i)&&t.push(i)}function he(e){if(!P(e))return[];if(x)return x(e);var t=[];for(var r in e)Y(e,r)&&t.push(r);return z&&fe(e,t),t}function de(e){if(null==e)return!0;var t=pe(e);return"number"==typeof t&&(X(e)||F(e)||te(e))?0===t:0===pe(he(e))}function me(e,t){var r=he(t),n=r.length;if(null==e)return!n;for(var o=Object(e),i=0;i<n;i++){var a=r[i];if(t[a]!==o[a]||!(a in o))return!1}return!0}function ge(e){return e instanceof ge?e:this instanceof ge?void(this._wrapped=e):new ge(e)}function ve(e){return new Uint8Array(e.buffer||e,e.byteOffset||0,se(e))}ge.VERSION=l,ge.prototype.value=function(){return this._wrapped},ge.prototype.valueOf=ge.prototype.toJSON=ge.prototype.value,ge.prototype.toString=function(){return String(this._wrapped)};var ye="[object DataView]";function be(e,t,r,n){if(e===t)return 0!==e||1/e==1/t;if(null==e||null==t)return!1;if(e!=e)return t!=t;var o=typeof e;return("function"===o||"object"===o||"object"==typeof t)&&_e(e,t,r,n)}function _e(e,t,r,n){e instanceof ge&&(e=e._wrapped),t instanceof ge&&(t=t._wrapped);var o=v.call(e);if(o!==v.call(t))return!1;if(W&&"[object Object]"==o&&G(e)){if(!G(t))return!1;o=ye}switch(o){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!=+e?+t!=+t:0==+e?1/+e==1/t:+e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object Symbol]":return d.valueOf.call(e)===d.valueOf.call(t);case"[object ArrayBuffer]":case ye:return _e(ve(e),ve(t),r,n)}var i="[object Array]"===o;if(!i&&le(e)){if(se(e)!==se(t))return!1;if(e.buffer===t.buffer&&e.byteOffset===t.byteOffset)return!0;i=!0}if(!i){if("object"!=typeof e||"object"!=typeof t)return!1;var a=e.constructor,s=t.constructor;if(a!==s&&!(V(a)&&a instanceof a&&V(s)&&s instanceof s)&&"constructor"in e&&"constructor"in t)return!1}n=n||[];for(var u=(r=r||[]).length;u--;)if(r[u]===e)return n[u]===t;if(r.push(e),n.push(t),i){if((u=e.length)!==t.length)return!1;for(;u--;)if(!be(e[u],t[u],r,n))return!1}else{var c,l=he(e);if(u=l.length,he(t).length!==u)return!1;for(;u--;)if(!Y(t,c=l[u])||!be(e[c],t[c],r,n))return!1}return r.pop(),n.pop(),!0}function we(e,t){return be(e,t)}function xe(e){if(!P(e))return[];var t=[];for(var r in e)t.push(r);return z&&fe(e,t),t}function ke(e){var t=pe(e);return function(r){if(null==r)return!1;var n=xe(r);if(pe(n))return!1;for(var o=0;o<t;o++)if(!V(r[e[o]]))return!1;return e!==Ie||!V(r[Se])}}var Se="forEach",je=["clear","delete"],Ae=["get","has","set"],ze=je.concat(Se,Ae),Ie=je.concat(Ae),Ee=["add"].concat(je,Se,"has"),Oe=J?ke(ze):U("Map"),Pe=J?ke(Ie):U("WeakMap"),Qe=J?ke(Ee):U("Set"),Re=U("WeakSet");function qe(e){for(var t=he(e),r=t.length,n=Array(r),o=0;o<r;o++)n[o]=e[t[o]];return n}function Te(e){for(var t=he(e),r=t.length,n=Array(r),o=0;o<r;o++)n[o]=[t[o],e[t[o]]];return n}function Ue(e){for(var t={},r=he(e),n=0,o=r.length;n<o;n++)t[e[r[n]]]=r[n];return t}function Fe(e){var t=[];for(var r in e)V(e[r])&&t.push(r);return t.sort()}function Ce(e,t){return function(r){var n=arguments.length;if(t&&(r=Object(r)),n<2||null==r)return r;for(var o=1;o<n;o++)for(var i=arguments[o],a=e(i),s=a.length,u=0;u<s;u++){var c=a[u];t&&void 0!==r[c]||(r[c]=i[c])}return r}}var Be=Ce(xe),De=Ce(he),Me=Ce(xe,!0);function $e(e){if(!P(e))return{};if(k)return k(e);var t=function(){};t.prototype=e;var r=new t;return t.prototype=null,r}function He(e,t){var r=$e(e);return t&&De(r,t),r}function Ne(e){return P(e)?X(e)?e.slice():Be({},e):e}function Le(e,t){return t(e),e}function Ve(e){return X(e)?e:[e]}function Ze(e){return ge.toPath(e)}function We(e,t){for(var r=t.length,n=0;n<r;n++){if(null==e)return;e=e[t[n]]}return r?e:void 0}function Je(e,t,r){var n=We(e,Ze(t));return R(n)?r:n}function Ke(e,t){for(var r=(t=Ze(t)).length,n=0;n<r;n++){var o=t[n];if(!Y(e,o))return!1;e=e[o]}return!!r}function Ge(e){return e}function Xe(e){return e=De({},e),function(t){return me(t,e)}}function Ye(e){return e=Ze(e),function(t){return We(t,e)}}function et(e,t,r){if(void 0===t)return e;switch(null==r?3:r){case 1:return function(r){return e.call(t,r)};case 3:return function(r,n,o){return e.call(t,r,n,o)};case 4:return function(r,n,o,i){return e.call(t,r,n,o,i)}}return function(){return e.apply(t,arguments)}}function tt(e,t,r){return null==e?Ge:V(e)?et(e,t,r):P(e)&&!X(e)?Xe(e):Ye(e)}function rt(e,t){return tt(e,t,1/0)}function nt(e,t,r){return ge.iteratee!==rt?ge.iteratee(e,t):tt(e,t,r)}function ot(e,t,r){t=nt(t,r);for(var n=he(e),o=n.length,i={},a=0;a<o;a++){var s=n[a];i[s]=t(e[s],s,e)}return i}function it(){}function at(e){return null==e?it:function(t){return Je(e,t)}}function st(e,t,r){var n=Array(Math.max(0,e));t=et(t,r,1);for(var o=0;o<e;o++)n[o]=t(o);return n}function ut(e,t){return null==t&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))}ge.toPath=Ve,ge.iteratee=rt;var ct=Date.now||function(){return(new Date).getTime()};function lt(e){var t=function(t){return e[t]},r="(?:"+he(e).join("|")+")",n=RegExp(r),o=RegExp(r,"g");return function(e){return e=null==e?"":""+e,n.test(e)?e.replace(o,t):e}}var pt={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},ft=lt(pt),ht=lt(Ue(pt)),dt=ge.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},mt=/(.)^/,gt={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},vt=/\\|'|\r|\n|\u2028|\u2029/g;function yt(e){return"\\"+gt[e]}var bt=/^\s*(\w|\$)+\s*$/;function _t(e,t,r){!t&&r&&(t=r),t=Me({},t,ge.templateSettings);var n=RegExp([(t.escape||mt).source,(t.interpolate||mt).source,(t.evaluate||mt).source].join("|")+"|$","g"),o=0,i="__p+='";e.replace(n,(function(t,r,n,a,s){return i+=e.slice(o,s).replace(vt,yt),o=s+t.length,r?i+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'":n?i+="'+\n((__t=("+n+"))==null?'':__t)+\n'":a&&(i+="';\n"+a+"\n__p+='"),t})),i+="';\n";var a,s=t.variable;if(s){if(!bt.test(s))throw new Error("variable is not a bare identifier: "+s)}else i="with(obj||{}){\n"+i+"}\n",s="obj";i="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+i+"return __p;\n";try{a=new Function(s,"_",i)}catch(e){throw e.source=i,e}var u=function(e){return a.call(this,e,ge)};return u.source="function("+s+"){\n"+i+"}",u}function wt(e,t,r){var n=(t=Ze(t)).length;if(!n)return V(r)?r.call(e):r;for(var o=0;o<n;o++){var i=null==e?void 0:e[t[o]];void 0===i&&(i=r,o=n),e=V(i)?i.call(e):i}return e}var xt=0;function kt(e){var t=++xt+"";return e?e+t:t}function St(e){var t=ge(e);return t._chain=!0,t}function jt(e,t,r,n,o){if(!(n instanceof t))return e.apply(r,o);var i=$e(e.prototype),a=e.apply(i,o);return P(a)?a:i}var At=O((function(e,t){var r=At.placeholder,n=function(){for(var o=0,i=t.length,a=Array(i),s=0;s<i;s++)a[s]=t[s]===r?arguments[o++]:t[s];for(;o<arguments.length;)a.push(arguments[o++]);return jt(e,n,this,this,a)};return n}));At.placeholder=ge;var zt=O((function(e,t,r){if(!V(e))throw new TypeError("Bind must be called on a function");var n=O((function(o){return jt(e,n,t,this,r.concat(o))}));return n})),It=ie(pe);function Et(e,t,r,n){if(n=n||[],t||0===t){if(t<=0)return n.concat(e)}else t=1/0;for(var o=n.length,i=0,a=pe(e);i<a;i++){var s=e[i];if(It(s)&&(X(s)||te(s)))if(t>1)Et(s,t-1,r,n),o=n.length;else for(var u=0,c=s.length;u<c;)n[o++]=s[u++];else r||(n[o++]=s)}return n}var Ot=O((function(e,t){var r=(t=Et(t,!1,!1)).length;if(r<1)throw new Error("bindAll must be passed function names");for(;r--;){var n=t[r];e[n]=zt(e[n],e)}return e}));function Pt(e,t){var r=function(n){var o=r.cache,i=""+(t?t.apply(this,arguments):n);return Y(o,i)||(o[i]=e.apply(this,arguments)),o[i]};return r.cache={},r}var Qt=O((function(e,t,r){return setTimeout((function(){return e.apply(null,r)}),t)})),Rt=At(Qt,ge,1);function qt(e,t,r){var n,o,i,a,s=0;r||(r={});var u=function(){s=!1===r.leading?0:ct(),n=null,a=e.apply(o,i),n||(o=i=null)},c=function(){var c=ct();s||!1!==r.leading||(s=c);var l=t-(c-s);return o=this,i=arguments,l<=0||l>t?(n&&(clearTimeout(n),n=null),s=c,a=e.apply(o,i),n||(o=i=null)):n||!1===r.trailing||(n=setTimeout(u,l)),a};return c.cancel=function(){clearTimeout(n),s=0,n=o=i=null},c}function Tt(e,t,r){var n,o,i,a,s,u=function(){var c=ct()-o;t>c?n=setTimeout(u,t-c):(n=null,r||(a=e.apply(s,i)),n||(i=s=null))},c=O((function(c){return s=this,i=c,o=ct(),n||(n=setTimeout(u,t),r&&(a=e.apply(s,i))),a}));return c.cancel=function(){clearTimeout(n),n=i=s=null},c}function Ut(e,t){return At(t,e)}function Ft(e){return function(){return!e.apply(this,arguments)}}function Ct(){var e=arguments,t=e.length-1;return function(){for(var r=t,n=e[t].apply(this,arguments);r--;)n=e[r].call(this,n);return n}}function Bt(e,t){return function(){if(--e<1)return t.apply(this,arguments)}}function Dt(e,t){var r;return function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=null),r}}var Mt=At(Dt,2);function $t(e,t,r){t=nt(t,r);for(var n,o=he(e),i=0,a=o.length;i<a;i++)if(t(e[n=o[i]],n,e))return n}function Ht(e){return function(t,r,n){r=nt(r,n);for(var o=pe(t),i=e>0?0:o-1;i>=0&&i<o;i+=e)if(r(t[i],i,t))return i;return-1}}var Nt=Ht(1),Lt=Ht(-1);function Vt(e,t,r,n){for(var o=(r=nt(r,n,1))(t),i=0,a=pe(e);i<a;){var s=Math.floor((i+a)/2);r(e[s])<o?i=s+1:a=s}return i}function Zt(e,t,r){return function(n,o,i){var a=0,s=pe(n);if("number"==typeof i)e>0?a=i>=0?i:Math.max(i+s,a):s=i>=0?Math.min(i+1,s):i+s+1;else if(r&&i&&s)return n[i=r(n,o)]===o?i:-1;if(o!=o)return(i=t(g.call(n,a,s),ne))>=0?i+a:-1;for(i=e>0?a:s-1;i>=0&&i<s;i+=e)if(n[i]===o)return i;return-1}}var Wt=Zt(1,Nt,Vt),Jt=Zt(-1,Lt);function Kt(e,t,r){var n=(It(e)?Nt:$t)(e,t,r);if(void 0!==n&&-1!==n)return e[n]}function Gt(e,t){return Kt(e,Xe(t))}function Xt(e,t,r){var n,o;if(t=et(t,r),It(e))for(n=0,o=e.length;n<o;n++)t(e[n],n,e);else{var i=he(e);for(n=0,o=i.length;n<o;n++)t(e[i[n]],i[n],e)}return e}function Yt(e,t,r){t=nt(t,r);for(var n=!It(e)&&he(e),o=(n||e).length,i=Array(o),a=0;a<o;a++){var s=n?n[a]:a;i[a]=t(e[s],s,e)}return i}function er(e){return function(t,r,n,o){var i=arguments.length>=3;return function(t,r,n,o){var i=!It(t)&&he(t),a=(i||t).length,s=e>0?0:a-1;for(o||(n=t[i?i[s]:s],s+=e);s>=0&&s<a;s+=e){var u=i?i[s]:s;n=r(n,t[u],u,t)}return n}(t,et(r,o,4),n,i)}}var tr=er(1),rr=er(-1);function nr(e,t,r){var n=[];return t=nt(t,r),Xt(e,(function(e,r,o){t(e,r,o)&&n.push(e)})),n}function or(e,t,r){return nr(e,Ft(nt(t)),r)}function ir(e,t,r){t=nt(t,r);for(var n=!It(e)&&he(e),o=(n||e).length,i=0;i<o;i++){var a=n?n[i]:i;if(!t(e[a],a,e))return!1}return!0}function ar(e,t,r){t=nt(t,r);for(var n=!It(e)&&he(e),o=(n||e).length,i=0;i<o;i++){var a=n?n[i]:i;if(t(e[a],a,e))return!0}return!1}function sr(e,t,r,n){return It(e)||(e=qe(e)),("number"!=typeof r||n)&&(r=0),Wt(e,t,r)>=0}var ur=O((function(e,t,r){var n,o;return V(t)?o=t:(t=Ze(t),n=t.slice(0,-1),t=t[t.length-1]),Yt(e,(function(e){var i=o;if(!i){if(n&&n.length&&(e=We(e,n)),null==e)return;i=e[t]}return null==i?i:i.apply(e,r)}))}));function cr(e,t){return Yt(e,Ye(t))}function lr(e,t){return nr(e,Xe(t))}function pr(e,t,r){var n,o,i=-1/0,a=-1/0;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e)for(var s=0,u=(e=It(e)?e:qe(e)).length;s<u;s++)null!=(n=e[s])&&n>i&&(i=n);else t=nt(t,r),Xt(e,(function(e,r,n){((o=t(e,r,n))>a||o===-1/0&&i===-1/0)&&(i=e,a=o)}));return i}function fr(e,t,r){var n,o,i=1/0,a=1/0;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e)for(var s=0,u=(e=It(e)?e:qe(e)).length;s<u;s++)null!=(n=e[s])&&n<i&&(i=n);else t=nt(t,r),Xt(e,(function(e,r,n){((o=t(e,r,n))<a||o===1/0&&i===1/0)&&(i=e,a=o)}));return i}var hr=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function dr(e){return e?X(e)?g.call(e):F(e)?e.match(hr):It(e)?Yt(e,Ge):qe(e):[]}function mr(e,t,r){if(null==t||r)return It(e)||(e=qe(e)),e[ut(e.length-1)];var n=dr(e),o=pe(n);t=Math.max(Math.min(t,o),0);for(var i=o-1,a=0;a<t;a++){var s=ut(a,i),u=n[a];n[a]=n[s],n[s]=u}return n.slice(0,t)}function gr(e){return mr(e,1/0)}function vr(e,t,r){var n=0;return t=nt(t,r),cr(Yt(e,(function(e,r,o){return{value:e,index:n++,criteria:t(e,r,o)}})).sort((function(e,t){var r=e.criteria,n=t.criteria;if(r!==n){if(r>n||void 0===r)return 1;if(r<n||void 0===n)return-1}return e.index-t.index})),"value")}function yr(e,t){return function(r,n,o){var i=t?[[],[]]:{};return n=nt(n,o),Xt(r,(function(t,o){var a=n(t,o,r);e(i,t,a)})),i}}var br=yr((function(e,t,r){Y(e,r)?e[r].push(t):e[r]=[t]})),_r=yr((function(e,t,r){e[r]=t})),wr=yr((function(e,t,r){Y(e,r)?e[r]++:e[r]=1})),xr=yr((function(e,t,r){e[r?0:1].push(t)}),!0);function kr(e){return null==e?0:It(e)?e.length:he(e).length}function Sr(e,t,r){return t in r}var jr=O((function(e,t){var r={},n=t[0];if(null==e)return r;V(n)?(t.length>1&&(n=et(n,t[1])),t=xe(e)):(n=Sr,t=Et(t,!1,!1),e=Object(e));for(var o=0,i=t.length;o<i;o++){var a=t[o],s=e[a];n(s,a,e)&&(r[a]=s)}return r})),Ar=O((function(e,t){var r,n=t[0];return V(n)?(n=Ft(n),t.length>1&&(r=t[1])):(t=Yt(Et(t,!1,!1),String),n=function(e,r){return!sr(t,r)}),jr(e,n,r)}));function zr(e,t,r){return g.call(e,0,Math.max(0,e.length-(null==t||r?1:t)))}function Ir(e,t,r){return null==e||e.length<1?null==t||r?void 0:[]:null==t||r?e[0]:zr(e,e.length-t)}function Er(e,t,r){return g.call(e,null==t||r?1:t)}function Or(e,t,r){return null==e||e.length<1?null==t||r?void 0:[]:null==t||r?e[e.length-1]:Er(e,Math.max(0,e.length-t))}function Pr(e){return nr(e,Boolean)}function Qr(e,t){return Et(e,t,!1)}var Rr=O((function(e,t){return t=Et(t,!0,!0),nr(e,(function(e){return!sr(t,e)}))})),qr=O((function(e,t){return Rr(e,t)}));function Tr(e,t,r,n){q(t)||(n=r,r=t,t=!1),null!=r&&(r=nt(r,n));for(var o=[],i=[],a=0,s=pe(e);a<s;a++){var u=e[a],c=r?r(u,a,e):u;t&&!r?(a&&i===c||o.push(u),i=c):r?sr(i,c)||(i.push(c),o.push(u)):sr(o,u)||o.push(u)}return o}var Ur=O((function(e){return Tr(Et(e,!0,!0))}));function Fr(e){for(var t=[],r=arguments.length,n=0,o=pe(e);n<o;n++){var i=e[n];if(!sr(t,i)){var a;for(a=1;a<r&&sr(arguments[a],i);a++);a===r&&t.push(i)}}return t}function Cr(e){for(var t=e&&pr(e,pe).length||0,r=Array(t),n=0;n<t;n++)r[n]=cr(e,n);return r}var Br=O(Cr);function Dr(e,t){for(var r={},n=0,o=pe(e);n<o;n++)t?r[e[n]]=t[n]:r[e[n][0]]=e[n][1];return r}function Mr(e,t,r){null==t&&(t=e||0,e=0),r||(r=t<e?-1:1);for(var n=Math.max(Math.ceil((t-e)/r),0),o=Array(n),i=0;i<n;i++,e+=r)o[i]=e;return o}function $r(e,t){if(null==t||t<1)return[];for(var r=[],n=0,o=e.length;n<o;)r.push(g.call(e,n,n+=t));return r}function Hr(e,t){return e._chain?ge(t).chain():t}function Nr(e){return Xt(Fe(e),(function(t){var r=ge[t]=e[t];ge.prototype[t]=function(){var e=[this._wrapped];return m.apply(e,arguments),Hr(this,r.apply(ge,e))}})),ge}Xt(["pop","push","reverse","shift","sort","splice","unshift"],(function(e){var t=f[e];ge.prototype[e]=function(){var r=this._wrapped;return null!=r&&(t.apply(r,arguments),"shift"!==e&&"splice"!==e||0!==r.length||delete r[0]),Hr(this,r)}})),Xt(["concat","join","slice"],(function(e){var t=f[e];ge.prototype[e]=function(){var e=this._wrapped;return null!=e&&(e=t.apply(e,arguments)),Hr(this,e)}}));var Lr=Nr(Object.freeze({__proto__:null,VERSION:l,restArguments:O,isObject:P,isNull:Q,isUndefined:R,isBoolean:q,isElement:T,isString:F,isNumber:C,isDate:B,isRegExp:D,isError:M,isSymbol:$,isArrayBuffer:H,isDataView:G,isArray:X,isFunction:V,isArguments:te,isFinite:re,isNaN:ne,isTypedArray:le,isEmpty:de,isMatch:me,isEqual:we,isMap:Oe,isWeakMap:Pe,isSet:Qe,isWeakSet:Re,keys:he,allKeys:xe,values:qe,pairs:Te,invert:Ue,functions:Fe,methods:Fe,extend:Be,extendOwn:De,assign:De,defaults:Me,create:He,clone:Ne,tap:Le,get:Je,has:Ke,mapObject:ot,identity:Ge,constant:oe,noop:it,toPath:Ve,property:Ye,propertyOf:at,matcher:Xe,matches:Xe,times:st,random:ut,now:ct,escape:ft,unescape:ht,templateSettings:dt,template:_t,result:wt,uniqueId:kt,chain:St,iteratee:rt,partial:At,bind:zt,bindAll:Ot,memoize:Pt,delay:Qt,defer:Rt,throttle:qt,debounce:Tt,wrap:Ut,negate:Ft,compose:Ct,after:Bt,before:Dt,once:Mt,findKey:$t,findIndex:Nt,findLastIndex:Lt,sortedIndex:Vt,indexOf:Wt,lastIndexOf:Jt,find:Kt,detect:Kt,findWhere:Gt,each:Xt,forEach:Xt,map:Yt,collect:Yt,reduce:tr,foldl:tr,inject:tr,reduceRight:rr,foldr:rr,filter:nr,select:nr,reject:or,every:ir,all:ir,some:ar,any:ar,contains:sr,includes:sr,include:sr,invoke:ur,pluck:cr,where:lr,max:pr,min:fr,shuffle:gr,sample:mr,sortBy:vr,groupBy:br,indexBy:_r,countBy:wr,partition:xr,toArray:dr,size:kr,pick:jr,omit:Ar,first:Ir,head:Ir,take:Ir,initial:zr,last:Or,rest:Er,tail:Er,drop:Er,compact:Pr,flatten:Qr,without:qr,uniq:Tr,unique:Tr,union:Ur,intersection:Fr,difference:Rr,unzip:Cr,transpose:Cr,zip:Br,object:Dr,range:Mr,chunk:$r,mixin:Nr,default:ge}));Lr._=Lr;var Vr,Zr=c(Object.freeze({__proto__:null,default:Lr,VERSION:l,restArguments:O,isObject:P,isNull:Q,isUndefined:R,isBoolean:q,isElement:T,isString:F,isNumber:C,isDate:B,isRegExp:D,isError:M,isSymbol:$,isArrayBuffer:H,isDataView:G,isArray:X,isFunction:V,isArguments:te,isFinite:re,isNaN:ne,isTypedArray:le,isEmpty:de,isMatch:me,isEqual:we,isMap:Oe,isWeakMap:Pe,isSet:Qe,isWeakSet:Re,keys:he,allKeys:xe,values:qe,pairs:Te,invert:Ue,functions:Fe,methods:Fe,extend:Be,extendOwn:De,assign:De,defaults:Me,create:He,clone:Ne,tap:Le,get:Je,has:Ke,mapObject:ot,identity:Ge,constant:oe,noop:it,toPath:Ve,property:Ye,propertyOf:at,matcher:Xe,matches:Xe,times:st,random:ut,now:ct,escape:ft,unescape:ht,templateSettings:dt,template:_t,result:wt,uniqueId:kt,chain:St,iteratee:rt,partial:At,bind:zt,bindAll:Ot,memoize:Pt,delay:Qt,defer:Rt,throttle:qt,debounce:Tt,wrap:Ut,negate:Ft,compose:Ct,after:Bt,before:Dt,once:Mt,findKey:$t,findIndex:Nt,findLastIndex:Lt,sortedIndex:Vt,indexOf:Wt,lastIndexOf:Jt,find:Kt,detect:Kt,findWhere:Gt,each:Xt,forEach:Xt,map:Yt,collect:Yt,reduce:tr,foldl:tr,inject:tr,reduceRight:rr,foldr:rr,filter:nr,select:nr,reject:or,every:ir,all:ir,some:ar,any:ar,contains:sr,includes:sr,include:sr,invoke:ur,pluck:cr,where:lr,max:pr,min:fr,shuffle:gr,sample:mr,sortBy:vr,groupBy:br,indexBy:_r,countBy:wr,partition:xr,toArray:dr,size:kr,pick:jr,omit:Ar,first:Ir,head:Ir,take:Ir,initial:zr,last:Or,rest:Er,tail:Er,drop:Er,compact:Pr,flatten:Qr,without:qr,uniq:Tr,unique:Tr,union:Ur,intersection:Fr,difference:Rr,unzip:Cr,transpose:Cr,zip:Br,object:Dr,range:Mr,chunk:$r,mixin:Nr})),Wr={exports:{}},Jr={exports:{}},Kr=Jr.exports;var Gr,Xr={exports:{}},Yr=Xr.exports;
/*!
* URI.js - Mutating URLs
* IPv6 Support
*
* Version: 1.19.11
*
* Author: Rodney Rehm
* Web: http://medialize.github.io/URI.js/
*
* Licensed under
* MIT License http://www.opensource.org/licenses/mit-license
*
*/var en,tn={exports:{}},rn=tn.exports;
/*!
* URI.js - Mutating URLs
* Second Level Domain (SLD) Support
*
* Version: 1.19.11
*
* Author: Rodney Rehm
* Web: http://medialize.github.io/URI.js/
*
* Licensed under
* MIT License http://www.opensource.org/licenses/mit-license
*
*/
/*!
* URI.js - Mutating URLs
*
* Version: 1.19.11
*
* Author: Rodney Rehm
* Web: http://medialize.github.io/URI.js/
*
* Licensed under
* MIT License http://www.opensource.org/licenses/mit-license
*
*/
var nn,on,an,sn=Wr.exports;function un(){return nn||(nn=1,function(e){!function(t,r){e.exports?e.exports=r((Vr||(Vr=1,function(e,t){!function(r){var n=t&&!t.nodeType&&t,o=e&&!e.nodeType&&e,i="object"==typeof s&&s;i.global!==i&&i.window!==i&&i.self!==i||(r=i);var a,u,c=2147483647,l=36,p=/^xn--/,f=/[^\x20-\x7E]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,d={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=Math.floor,g=String.fromCharCode;function v(e){throw new RangeError(d[e])}function y(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function b(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+y((e=e.replace(h,".")).split("."),t).join(".")}function _(e){for(var t,r,n=[],o=0,i=e.length;o<i;)(t=e.charCodeAt(o++))>=55296&&t<=56319&&o<i?56320==(64512&(r=e.charCodeAt(o++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),o--):n.push(t);return n}function w(e){return y(e,(function(e){var t="";return e>65535&&(t+=g((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+g(e)})).join("")}function x(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function k(e,t,r){var n=0;for(e=r?m(e/700):e>>1,e+=m(e/t);e>455;n+=l)e=m(e/35);return m(n+36*e/(e+38))}function S(e){var t,r,n,o,i,a,s,u,p,f,h,d=[],g=e.length,y=0,b=128,_=72;for((r=e.lastIndexOf("-"))<0&&(r=0),n=0;n<r;++n)e.charCodeAt(n)>=128&&v("not-basic"),d.push(e.charCodeAt(n));for(o=r>0?r+1:0;o<g;){for(i=y,a=1,s=l;o>=g&&v("invalid-input"),((u=(h=e.charCodeAt(o++))-48<10?h-22:h-65<26?h-65:h-97<26?h-97:l)>=l||u>m((c-y)/a))&&v("overflow"),y+=u*a,!(u<(p=s<=_?1:s>=_+26?26:s-_));s+=l)a>m(c/(f=l-p))&&v("overflow"),a*=f;_=k(y-i,t=d.length+1,0==i),m(y/t)>c-b&&v("overflow"),b+=m(y/t),y%=t,d.splice(y++,0,b)}return w(d)}function j(e){var t,r,n,o,i,a,s,u,p,f,h,d,y,b,w,S=[];for(d=(e=_(e)).length,t=128,r=0,i=72,a=0;a<d;++a)(h=e[a])<128&&S.push(g(h));for(n=o=S.length,o&&S.push("-");n<d;){for(s=c,a=0;a<d;++a)(h=e[a])>=t&&h<s&&(s=h);for(s-t>m((c-r)/(y=n+1))&&v("overflow"),r+=(s-t)*y,t=s,a=0;a<d;++a)if((h=e[a])<t&&++r>c&&v("overflow"),h==t){for(u=r,p=l;!(u<(f=p<=i?1:p>=i+26?26:p-i));p+=l)w=u-f,b=l-f,S.push(g(x(f+w%b,0))),u=m(w/b);S.push(g(x(u,0))),i=k(r,y,n==o),r=0,++n}++r,++t}return S.join("")}if(a={version:"1.3.2",ucs2:{decode:_,encode:w},decode:S,encode:j,toASCII:function(e){return b(e,(function(e){return f.test(e)?"xn--"+j(e):e}))},toUnicode:function(e){return b(e,(function(e){return p.test(e)?S(e.slice(4).toLowerCase()):e}))}},n&&o)if(e.exports==n)o.exports=a;else for(u in a)a.hasOwnProperty(u)&&(n[u]=a[u]);else r.punycode=a}(Kr)}(Jr,Jr.exports)),Jr.exports),(Gr||(Gr=1,function(e){!function(t,r){e.exports?e.exports=r():t.IPv6=r(t)}(Yr,(function(e){var t=e&&e.IPv6;return{best:function(e){var t,r,n=e.toLowerCase().split(":"),o=n.length,i=8;for(""===n[0]&&""===n[1]&&""===n[2]?(n.shift(),n.shift()):""===n[0]&&""===n[1]?n.shift():""===n[o-1]&&""===n[o-2]&&n.pop(),-1!==n[(o=n.length)-1].indexOf(".")&&(i=7),t=0;t<o&&""!==n[t];t++);if(t<i)for(n.splice(t,1,"0000");n.length<i;)n.splice(t,0,"0000");for(var a=0;a<i;a++){r=n[a].split("");for(var s=0;s<3&&"0"===r[0]&&r.length>1;s++)r.splice(0,1);n[a]=r.join("")}var u=-1,c=0,l=0,p=-1,f=!1;for(a=0;a<i;a++)f?"0"===n[a]?l+=1:(f=!1,l>c&&(u=p,c=l)):"0"===n[a]&&(f=!0,p=a,l=1);l>c&&(u=p,c=l),c>1&&n.splice(u,c,""),o=n.length;var h="";for(""===n[0]&&(h=":"),a=0;a<o&&(h+=n[a],a!==o-1);a++)h+=":";return""===n[o-1]&&(h+=":"),h},noConflict:function(){return e.IPv6===this&&(e.IPv6=t),this}}}))}(Xr)),Xr.exports),(en||(en=1,function(e){!function(t,r){e.exports?e.exports=r():t.SecondLevelDomains=r(t)}(rn,(function(e){var t=e&&e.SecondLevelDomains,r={list:{ac:" com gov mil net org ",ae:" ac co gov mil name net org pro sch ",af:" com edu gov net org ",al:" com edu gov mil net org ",ao:" co ed gv it og pb ",ar:" com edu gob gov int mil net org tur ",at:" ac co gv or ",au:" asn com csiro edu gov id net org ",ba:" co com edu gov mil net org rs unbi unmo unsa untz unze ",bb:" biz co com edu gov info net org store tv ",bh:" biz cc com edu gov info net org ",bn:" com edu gov net org ",bo:" com edu gob gov int mil net org tv ",br:" adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ",bs:" com edu gov net org ",bz:" du et om ov rg ",ca:" ab bc mb nb nf nl ns nt nu on pe qc sk yk ",ck:" biz co edu gen gov info net org ",cn:" ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ",co:" com edu gov mil net nom org ",cr:" ac c co ed fi go or sa ",cy:" ac biz com ekloges gov ltd name net org parliament press pro tm ",do:" art com edu gob gov mil net org sld web ",dz:" art asso com edu gov net org pol ",ec:" com edu fin gov info med mil net org pro ",eg:" com edu eun gov mil name net org sci ",er:" com edu gov ind mil net org rochest w ",es:" com edu gob nom org ",et:" biz com edu gov info name net org ",fj:" ac biz com info mil name net org pro ",fk:" ac co gov net nom org ",fr:" asso com f gouv nom prd presse tm ",gg:" co net org ",gh:" com edu gov mil org ",gn:" ac com gov net org ",gr:" com edu gov mil net org ",gt:" com edu gob ind mil net org ",gu:" com edu gov net org ",hk:" com edu gov idv net org ",hu:" 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ",id:" ac co go mil net or sch web ",il:" ac co gov idf k12 muni net org ",in:" ac co edu ernet firm gen gov i ind mil net nic org res ",iq:" com edu gov i mil net org ",ir:" ac co dnssec gov i id net org sch ",it:" edu gov ",je:" co net org ",jo:" com edu gov mil name net org sch ",jp:" ac ad co ed go gr lg ne or ",ke:" ac co go info me mobi ne or sc ",kh:" com edu gov mil net org per ",ki:" biz com de edu gov info mob net org tel ",km:" asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ",kn:" edu gov net org ",kr:" ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ",kw:" com edu gov net org ",ky:" com edu gov net org ",kz:" com edu gov mil net org ",lb:" com edu gov net org ",lk:" assn com edu gov grp hotel int ltd net ngo org sch soc web ",lr:" com edu gov net org ",lv:" asn com conf edu gov id mil net org ",ly:" com edu gov id med net org plc sch ",ma:" ac co gov m net org press ",mc:" asso tm ",me:" ac co edu gov its net org priv ",mg:" com edu gov mil nom org prd tm ",mk:" com edu gov inf name net org pro ",ml:" com edu gov net org presse ",mn:" edu gov org ",mo:" com edu gov net org ",mt:" com edu gov net org ",mv:" aero biz com coop edu gov info int mil museum name net org pro ",mw:" ac co com coop edu gov int museum net org ",mx:" com edu gob net org ",my:" com edu gov mil name net org sch ",nf:" arts com firm info net other per rec store web ",ng:" biz com edu gov mil mobi name net org sch ",ni:" ac co com edu gob mil net nom org ",np:" com edu gov mil net org ",nr:" biz com edu gov info net org ",om:" ac biz co com edu gov med mil museum net org pro sch ",pe:" com edu gob mil net nom org sld ",ph:" com edu gov i mil net ngo org ",pk:" biz com edu fam gob gok gon gop gos gov net org web ",pl:" art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ",pr:" ac biz com edu est gov info isla name net org pro prof ",ps:" com edu gov net org plo sec ",pw:" belau co ed go ne or ",ro:" arts com firm info nom nt org rec store tm www ",rs:" ac co edu gov in org ",sb:" com edu gov net org ",sc:" com edu gov net org ",sh:" co com edu gov net nom org ",sl:" com edu gov net org ",st:" co com consulado edu embaixada gov mil net org principe saotome store ",sv:" com edu gob org red ",sz:" ac co org ",tr:" av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ",tt:" aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ",tw:" club com ebiz edu game gov idv mil net org ",mu:" ac co com gov net or org ",mz:" ac co edu gov org ",na:" co com ",nz:" ac co cri geek gen govt health iwi maori mil net org parliament school ",pa:" abo ac com edu gob ing med net nom org sld ",pt:" com edu gov int net nome org publ ",py:" com edu gov mil net org ",qa:" com edu gov mil net org ",re:" asso com nom ",ru:" ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ",rw:" ac co com edu gouv gov int mil net ",sa:" com edu gov med net org pub sch ",sd:" com edu gov info med net org tv ",se:" a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ",sg:" com edu gov idn net org per ",sn:" art com edu gouv org perso univ ",sy:" com edu gov mil net news org ",th:" ac co go in mi net or ",tj:" ac biz co com edu go gov info int mil name net nic org test web ",tn:" agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ",tz:" ac co go ne or ",ua:" biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ",ug:" ac co go ne or org sc ",uk:" ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ",us:" dni fed isa kids nsn ",uy:" com edu gub mil net org ",ve:" co com edu gob info mil net org web ",vi:" co com k12 net org ",vn:" ac biz com edu gov health info int name net org pro ",ye:" co com gov ltd me net org plc ",yu:" ac co edu gov org ",za:" ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ",zm:" ac co com edu gov net org sch ",com:"ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ",net:"gb jp se uk ",org:"ae",de:"com "},has:function(e){var t=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return!1;var n=e.lastIndexOf(".",t-1);if(n<=0||n>=t-1)return!1;var o=r.list[e.slice(t+1)];return!!o&&o.indexOf(" "+e.slice(n+1,t)+" ")>=0},is:function(e){var t=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return!1;if(e.lastIndexOf(".",t-1)>=0)return!1;var n=r.list[e.slice(t+1)];return!!n&&n.indexOf(" "+e.slice(0,t)+" ")>=0},get:function(e){var t=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return null;var n=e.lastIndexOf(".",t-1);if(n<=0||n>=t-1)return null;var o=r.list[e.slice(t+1)];return o?o.indexOf(" "+e.slice(n+1,t)+" ")<0?null:e.slice(n+1):null},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return r}))}(tn)),tn.exports)):t.URI=r(t.punycode,t.IPv6,t.SecondLevelDomains,t)}(sn,(function(e,t,r,n){var o=n&&n.URI;function i(e,t){var r=arguments.length>=1;if(!(this instanceof i))return r?arguments.length>=2?new i(e,t):new i(e):new i;if(void 0===e){if(r)throw new TypeError("undefined is not a valid argument for URI");e="undefined"!=typeof location?location.href+"":""}if(null===e&&r)throw new TypeError("null is not a valid argument for URI");return this.href(e),void 0!==t?this.absoluteTo(t):this}i.version="1.19.11";var a=i.prototype,s=Object.prototype.hasOwnProperty;function u(e){return e.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function c(e){return void 0===e?"Undefined":String(Object.prototype.toString.call(e)).slice(8,-1)}function l(e){return"Array"===c(e)}function p(e,t){var r,n,o={};if("RegExp"===c(t))o=null;else if(l(t))for(r=0,n=t.length;r<n;r++)o[t[r]]=!0;else o[t]=!0;for(r=0,n=e.length;r<n;r++){(o&&void 0!==o[e[r]]||!o&&t.test(e[r]))&&(e.splice(r,1),n--,r--)}return e}function f(e,t){var r,n;if(l(t)){for(r=0,n=t.length;r<n;r++)if(!f(e,t[r]))return!1;return!0}var o=c(t);for(r=0,n=e.length;r<n;r++)if("RegExp"===o){if("string"==typeof e[r]&&e[r].match(t))return!0}else if(e[r]===t)return!0;return!1}function h(e,t){if(!l(e)||!l(t))return!1;if(e.length!==t.length)return!1;e.sort(),t.sort();for(var r=0,n=e.length;r<n;r++)if(e[r]!==t[r])return!1;return!0}function d(e){return e.replace(/^\/+|\/+$/g,"")}function m(e){return escape(e)}function g(e){return encodeURIComponent(e).replace(/[!'()*]/g,m).replace(/\*/g,"%2A")}i._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:i.preventInvalidHostname,duplicateQueryParameters:i.duplicateQueryParameters,escapeQuerySpace:i.escapeQuerySpace}},i.preventInvalidHostname=!1,i.duplicateQueryParameters=!1,i.escapeQuerySpace=!0,i.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,i.idn_expression=/[^a-z0-9\._-]/i,i.punycode_expression=/(xn--)/i,i.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,i.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,i.find_uri_expression=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/gi,i.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},i.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,i.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,i.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},i.hostProtocols=["http","https"],i.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,i.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},i.getDomAttribute=function(e){if(e&&e.nodeName){var t=e.nodeName.toLowerCase();if("input"!==t||"image"===e.type)return i.domAttributes[t]}},i.encode=g,i.decode=decodeURIComponent,i.iso8859=function(){i.encode=escape,i.decode=unescape},i.unicode=function(){i.encode=g,i.decode=decodeURIComponent},i.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/gi,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/gi,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/gi,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},i.encodeQuery=function(e,t){var r=i.encode(e+"");return void 0===t&&(t=i.escapeQuerySpace),t?r.replace(/%20/g,"+"):r},i.decodeQuery=function(e,t){e+="",void 0===t&&(t=i.escapeQuerySpace);try{return i.decode(t?e.replace(/\+/g,"%20"):e)}catch(t){return e}};var v,y={encode:"encode",decode:"decode"},b=function(e,t){return function(r){try{return i[t](r+"").replace(i.characters[e][t].expression,(function(r){return i.characters[e][t].map[r]}))}catch(e){return r}}};for(v in y)i[v+"PathSegment"]=b("pathname",y[v]),i[v+"UrnPathSegment"]=b("urnpath",y[v]);var _=function(e,t,r){return function(n){var o;o=r?function(e){return i[t](i[r](e))}:i[t];for(var a=(n+"").split(e),s=0,u=a.length;s<u;s++)a[s]=o(a[s]);return a.join(e)}};function w(e){return function(t,r){return void 0===t?this._parts[e]||"":(this._parts[e]=t||null,this.build(!r),this)}}function x(e,t){return function(r,n){return void 0===r?this._parts[e]||"":(null!==r&&(r+="").charAt(0)===t&&(r=r.substring(1)),this._parts[e]=r,this.build(!n),this)}}i.decodePath=_("/","decodePathSegment"),i.decodeUrnPath=_(":","decodeUrnPathSegment"),i.recodePath=_("/","encodePathSegment","decode"),i.recodeUrnPath=_(":","encodeUrnPathSegment","decode"),i.encodeReserved=b("reserved","encode"),i.parse=function(e,t){var r;return t||(t={preventInvalidHostname:i.preventInvalidHostname}),(r=(e=(e=e.replace(i.leading_whitespace_expression,"")).replace(i.ascii_tab_whitespace,"")).indexOf("#"))>-1&&(t.fragment=e.substring(r+1)||null,e=e.substring(0,r)),(r=e.indexOf("?"))>-1&&(t.query=e.substring(r+1)||null,e=e.substring(0,r)),"//"===(e=(e=e.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://")).replace(/^[/\\]{2,}/i,"//")).substring(0,2)?(t.protocol=null,e=e.substring(2),e=i.parseAuthority(e,t)):(r=e.indexOf(":"))>-1&&(t.protocol=e.substring(0,r)||null,t.protocol&&!t.protocol.match(i.protocol_expression)?t.protocol=void 0:"//"===e.substring(r+1,r+3).replace(/\\/g,"/")?(e=e.substring(r+3),e=i.parseAuthority(e,t)):(e=e.substring(r+1),t.urn=!0)),t.path=e,t},i.parseHost=function(e,t){e||(e="");var r,n,o=(e=e.replace(/\\/g,"/")).indexOf("/");if(-1===o&&(o=e.length),"["===e.charAt(0))r=e.indexOf("]"),t.hostname=e.substring(1,r)||null,t.port=e.substring(r+2,o)||null,"/"===t.port&&(t.port=null);else{var a=e.indexOf(":"),s=e.indexOf("/"),u=e.indexOf(":",a+1);-1!==u&&(-1===s||u<s)?(t.hostname=e.substring(0,o)||null,t.port=null):(n=e.substring(0,o).split(":"),t.hostname=n[0]||null,t.port=n[1]||null)}return t.hostname&&"/"!==e.substring(o).charAt(0)&&(o++,e="/"+e),t.preventInvalidHostname&&i.ensureValidHostname(t.hostname,t.protocol),t.port&&i.ensureValidPort(t.port),e.substring(o)||"/"},i.parseAuthority=function(e,t){return e=i.parseUserinfo(e,t),i.parseHost(e,t)},i.parseUserinfo=function(e,t){var r=e;-1!==e.indexOf("\\")&&(e=e.replace(/\\/g,"/"));var n,o=e.indexOf("/"),a=e.lastIndexOf("@",o>-1?o:e.length-1);return a>-1&&(-1===o||a<o)?(n=e.substring(0,a).split(":"),t.username=n[0]?i.decode(n[0]):null,n.shift(),t.password=n[0]?i.decode(n.join(":")):null,e=r.substring(a+1)):(t.username=null,t.password=null),e},i.parseQuery=function(e,t){if(!e)return{};if(!(e=e.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,"")))return{};for(var r,n,o,a={},u=e.split("&"),c=u.length,l=0;l<c;l++)r=u[l].split("="),n=i.decodeQuery(r.shift(),t),o=r.length?i.decodeQuery(r.join("="),t):null,"__proto__"!==n&&(s.call(a,n)?("string"!=typeof a[n]&&null!==a[n]||(a[n]=[a[n]]),a[n].push(o)):a[n]=o);return a},i.build=function(e){var t="",r=!1;return e.protocol&&(t+=e.protocol+":"),e.urn||!t&&!e.hostname||(t+="//",r=!0),t+=i.buildAuthority(e)||"","string"==typeof e.path&&("/"!==e.path.charAt(0)&&r&&(t+="/"),t+=e.path),"string"==typeof e.query&&e.query&&(t+="?"+e.query),"string"==typeof e.fragment&&e.fragment&&(t+="#"+e.fragment),t},i.buildHost=function(e){var t="";return e.hostname?(i.ip6_expression.test(e.hostname)?t+="["+e.hostname+"]":t+=e.hostname,e.port&&(t+=":"+e.port),t):""},i.buildAuthority=function(e){return i.buildUserinfo(e)+i.buildHost(e)},i.buildUserinfo=function(e){var t="";return e.username&&(t+=i.encode(e.username)),e.password&&(t+=":"+i.encode(e.password)),t&&(t+="@"),t},i.buildQuery=function(e,t,r){var n,o,a,u,c="";for(o in e)if("__proto__"!==o&&s.call(e,o))if(l(e[o]))for(n={},a=0,u=e[o].length;a<u;a++)void 0!==e[o][a]&&void 0===n[e[o][a]+""]&&(c+="&"+i.buildQueryParameter(o,e[o][a],r),!0!==t&&(n[e[o][a]+""]=!0));else void 0!==e[o]&&(c+="&"+i.buildQueryParameter(o,e[o],r));return c.substring(1)},i.buildQueryParameter=function(e,t,r){return i.encodeQuery(e,r)+(null!==t?"="+i.encodeQuery(t,r):"")},i.addQuery=function(e,t,r){if("object"==typeof t)for(var n in t)s.call(t,n)&&i.addQuery(e,n,t[n]);else{if("string"!=typeof t)throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");if(void 0===e[t])return void(e[t]=r);"string"==typeof e[t]&&(e[t]=[e[t]]),l(r)||(r=[r]),e[t]=(e[t]||[]).concat(r)}},i.setQuery=function(e,t,r){if("object"==typeof t)for(var n in t)s.call(t,n)&&i.setQuery(e,n,t[n]);else{if("string"!=typeof t)throw new TypeError("URI.setQuery() accepts an object, string as the name parameter");e[t]=void 0===r?null:r}},i.removeQuery=function(e,t,r){var n,o,a;if(l(t))for(n=0,o=t.length;n<o;n++)e[t[n]]=void 0;else if("RegExp"===c(t))for(a in e)t.test(a)&&(e[a]=void 0);else if("object"==typeof t)for(a in t)s.call(t,a)&&i.removeQuery(e,a,t[a]);else{if("string"!=typeof t)throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter");void 0!==r?"RegExp"===c(r)?!l(e[t])&&r.test(e[t])?e[t]=void 0:e[t]=p(e[t],r):e[t]!==String(r)||l(r)&&1!==r.length?l(e[t])&&(e[t]=p(e[t],r)):e[t]=void 0:e[t]=void 0}},i.hasQuery=function(e,t,r,n){switch(c(t)){case"String":break;case"RegExp":for(var o in e)if(s.call(e,o)&&t.test(o)&&(void 0===r||i.hasQuery(e,o,r)))return!0;return!1;case"Object":for(var a in t)if(s.call(t,a)&&!i.hasQuery(e,a,t[a]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(c(r)){case"Undefined":return t in e;case"Boolean":return r===Boolean(l(e[t])?e[t].length:e[t]);case"Function":return!!r(e[t],t,e);case"Array":return!!l(e[t])&&(n?f:h)(e[t],r);case"RegExp":return l(e[t])?!!n&&f(e[t],r):Boolean(e[t]&&e[t].match(r));case"Number":r=String(r);case"String":return l(e[t])?!!n&&f(e[t],r):e[t]===r;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},i.joinPaths=function(){for(var e=[],t=[],r=0,n=0;n<arguments.length;n++){var o=new i(arguments[n]);e.push(o);for(var a=o.segment(),s=0;s<a.length;s++)"string"==typeof a[s]&&t.push(a[s]),a[s]&&r++}if(!t.length||!r)return new i("");var u=new i("").segment(t);return""!==e[0].path()&&"/"!==e[0].path().slice(0,1)||u.path("/"+u.path()),u.normalize()},i.commonPath=function(e,t){var r,n=Math.min(e.length,t.length);for(r=0;r<n;r++)if(e.charAt(r)!==t.charAt(r)){r--;break}return r<1?e.charAt(0)===t.charAt(0)&&"/"===e.charAt(0)?"/":"":("/"===e.charAt(r)&&"/"===t.charAt(r)||(r=e.substring(0,r).lastIndexOf("/")),e.substring(0,r+1))},i.withinString=function(e,t,r){r||(r={});var n=r.start||i.findUri.start,o=r.end||i.findUri.end,a=r.trim||i.findUri.trim,s=r.parens||i.findUri.parens,u=/[a-z0-9-]=["']?$/i;for(n.lastIndex=0;;){var c=n.exec(e);if(!c)break;var l=c.index;if(r.ignoreHtml){var p=e.slice(Math.max(l-3,0),l);if(p&&u.test(p))continue}for(var f=l+e.slice(l).search(o),h=e.slice(l,f),d=-1;;){var m=s.exec(h);if(!m)break;var g=m.index+m[0].length;d=Math.max(d,g)}if(!((h=d>-1?h.slice(0,d)+h.slice(d).replace(a,""):h.replace(a,"")).length<=c[0].length||r.ignore&&r.ignore.test(h))){var v=t(h,l,f=l+h.length,e);void 0!==v?(v=String(v),e=e.slice(0,l)+v+e.slice(f),n.lastIndex=l+v.length):n.lastIndex=f}}return n.lastIndex=0,e},i.ensureValidHostname=function(t,r){var n=!!t,o=!1;if(!!r&&(o=f(i.hostProtocols,r)),o&&!n)throw new TypeError("Hostname cannot be empty, if protocol is "+r);if(t&&t.match(i.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(t).match(i.invalid_hostname_characters))throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-:_]')}},i.ensureValidPort=function(e){if(e){var t=Number(e);if(!(/^[0-9]+$/.test(t)&&t>0&&t<65536))throw new TypeError('Port "'+e+'" is not a valid port')}},i.noConflict=function(e){if(e){var t={URI:this.noConflict()};return n.URITemplate&&"function"==typeof n.URITemplate.noConflict&&(t.URITemplate=n.URITemplate.noConflict()),n.IPv6&&"function"==typeof n.IPv6.noConflict&&(t.IPv6=n.IPv6.noConflict()),n.SecondLevelDomains&&"function"==typeof n.SecondLevelDomains.noConflict&&(t.SecondLevelDomains=n.SecondLevelDomains.noConflict()),t}return n.URI===this&&(n.URI=o),this},a.build=function(e){return!0===e?this._deferred_build=!0:(void 0===e||this._deferred_build)&&(this._string=i.build(this._parts),this._deferred_build=!1),this},a.clone=function(){return new i(this)},a.valueOf=a.toString=function(){return this.build(!1)._string},a.protocol=w("protocol"),a.username=w("username"),a.password=w("password"),a.hostname=w("hostname"),a.port=w("port"),a.query=x("query","?"),a.fragment=x("fragment","#"),a.search=function(e,t){var r=this.query(e,t);return"string"==typeof r&&r.length?"?"+r:r},a.hash=function(e,t){var r=this.fragment(e,t);return"string"==typeof r&&r.length?"#"+r:r},a.pathname=function(e,t){if(void 0===e||!0===e){var r=this._parts.path||(this._parts.hostname?"/":"");return e?(this._parts.urn?i.decodeUrnPath:i.decodePath)(r):r}return this._parts.urn?this._parts.path=e?i.recodeUrnPath(e):"":this._parts.path=e?i.recodePath(e):"/",this.build(!t),this},a.path=a.pathname,a.href=function(e,t){var r;if(void 0===e)return this.toString();this._string="",this._parts=i._parts();var n=e instanceof i,o="object"==typeof e&&(e.hostname||e.path||e.pathname);e.nodeName&&(e=e[i.getDomAttribute(e)]||"",o=!1);if(!n&&o&&void 0!==e.pathname&&(e=e.toString()),"string"==typeof e||e instanceof String)this._parts=i.parse(String(e),this._parts);else{if(!n&&!o)throw new TypeError("invalid input");var a=n?e._parts:e;for(r in a)"query"!==r&&s.call(this._parts,r)&&(this._parts[r]=a[r]);a.query&&this.query(a.query,!1)}return this.build(!t),this},a.is=function(e){var t=!1,n=!1,o=!1,a=!1,s=!1,u=!1,c=!1,l=!this._parts.urn;switch(this._parts.hostname&&(l=!1,n=i.ip4_expression.test(this._parts.hostname),o=i.ip6_expression.test(this._parts.hostname),s=(a=!(t=n||o))&&r&&r.has(this._parts.hostname),u=a&&i.idn_expression.test(this._parts.host