WordPress/wp-includes/js/dist/url.min.js

1 line
9.3 KiB
JavaScript

this.wp=this.wp||{},this.wp.url=function(e){var r={};function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var o in e)t.d(n,o,function(r){return e[r]}.bind(null,o));return n},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p="",t(t.s=362)}({120:function(e,r,t){"use strict";var n=t(363),o=t(364),i=t(158);e.exports={formats:i,parse:o,stringify:n}},157:function(e,r,t){"use strict";var n=Object.prototype.hasOwnProperty,o=function(){for(var e=[],r=0;r<256;++r)e.push("%"+((r<16?"0":"")+r.toString(16)).toUpperCase());return e}(),i=function(e,r){for(var t=r&&r.plainObjects?Object.create(null):{},n=0;n<e.length;++n)void 0!==e[n]&&(t[n]=e[n]);return t};e.exports={arrayToObject:i,assign:function(e,r){return Object.keys(r).reduce(function(e,t){return e[t]=r[t],e},e)},compact:function(e){for(var r=[{obj:{o:e},prop:"o"}],t=[],n=0;n<r.length;++n)for(var o=r[n],i=o.obj[o.prop],a=Object.keys(i),c=0;c<a.length;++c){var l=a[c],u=i[l];"object"==typeof u&&null!==u&&-1===t.indexOf(u)&&(r.push({obj:i,prop:l}),t.push(u))}return function(e){for(var r;e.length;){var t=e.pop();if(r=t.obj[t.prop],Array.isArray(r)){for(var n=[],o=0;o<r.length;++o)void 0!==r[o]&&n.push(r[o]);t.obj[t.prop]=n}}return r}(r)},decode:function(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(r){return e}},encode:function(e){if(0===e.length)return e;for(var r="string"==typeof e?e:String(e),t="",n=0;n<r.length;++n){var i=r.charCodeAt(n);45===i||46===i||95===i||126===i||i>=48&&i<=57||i>=65&&i<=90||i>=97&&i<=122?t+=r.charAt(n):i<128?t+=o[i]:i<2048?t+=o[192|i>>6]+o[128|63&i]:i<55296||i>=57344?t+=o[224|i>>12]+o[128|i>>6&63]+o[128|63&i]:(n+=1,i=65536+((1023&i)<<10|1023&r.charCodeAt(n)),t+=o[240|i>>18]+o[128|i>>12&63]+o[128|i>>6&63]+o[128|63&i])}return t},isBuffer:function(e){return null!==e&&void 0!==e&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},merge:function e(r,t,o){if(!t)return r;if("object"!=typeof t){if(Array.isArray(r))r.push(t);else{if("object"!=typeof r)return[r,t];(o.plainObjects||o.allowPrototypes||!n.call(Object.prototype,t))&&(r[t]=!0)}return r}if("object"!=typeof r)return[r].concat(t);var a=r;return Array.isArray(r)&&!Array.isArray(t)&&(a=i(r,o)),Array.isArray(r)&&Array.isArray(t)?(t.forEach(function(t,i){n.call(r,i)?r[i]&&"object"==typeof r[i]?r[i]=e(r[i],t,o):r.push(t):r[i]=t}),r):Object.keys(t).reduce(function(r,i){var a=t[i];return n.call(r,i)?r[i]=e(r[i],a,o):r[i]=a,r},a)}}},158:function(e,r,t){"use strict";var n=String.prototype.replace,o=/%20/g;e.exports={default:"RFC3986",formatters:{RFC1738:function(e){return n.call(e,o,"+")},RFC3986:function(e){return e}},RFC1738:"RFC1738",RFC3986:"RFC3986"}},16:function(e,r,t){"use strict";function n(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}t.d(r,"a",function(){return n})},362:function(e,r,t){"use strict";t.r(r),t.d(r,"isURL",function(){return l}),t.d(r,"addQueryArgs",function(){return u}),t.d(r,"prependHTTP",function(){return s});var n=t(9),o=t(120),i=/^(?:https?:)?\/\/\S+$/i,a=/^(mailto:)?[a-z0-9._%+-]+@[a-z0-9][a-z0-9.-]*\.[a-z]{2,63}$/i,c=/^(?:[a-z]+:|#|\?|\.|\/)/i;function l(e){return i.test(e)}function u(e,r){var t=e.indexOf("?"),i=-1!==t?Object(o.parse)(e.substr(t+1)):{};return(-1!==t?e.substr(0,t):e)+"?"+Object(o.stringify)(Object(n.a)({},i,r))}function s(e){return c.test(e)||a.test(e)?e:"http://"+e}},363:function(e,r,t){"use strict";var n=t(157),o=t(158),i={brackets:function(e){return e+"[]"},indices:function(e,r){return e+"["+r+"]"},repeat:function(e){return e}},a=Date.prototype.toISOString,c={delimiter:"&",encode:!0,encoder:n.encode,encodeValuesOnly:!1,serializeDate:function(e){return a.call(e)},skipNulls:!1,strictNullHandling:!1},l=function e(r,t,o,i,a,l,u,s,f,p,d,y){var b=r;if("function"==typeof u)b=u(t,b);else if(b instanceof Date)b=p(b);else if(null===b){if(i)return l&&!y?l(t,c.encoder):t;b=""}if("string"==typeof b||"number"==typeof b||"boolean"==typeof b||n.isBuffer(b))return l?[d(y?t:l(t,c.encoder))+"="+d(l(b,c.encoder))]:[d(t)+"="+d(String(b))];var v,g=[];if(void 0===b)return g;if(Array.isArray(u))v=u;else{var m=Object.keys(b);v=s?m.sort(s):m}for(var O=0;O<v.length;++O){var j=v[O];a&&null===b[j]||(g=Array.isArray(b)?g.concat(e(b[j],o(t,j),o,i,a,l,u,s,f,p,d,y)):g.concat(e(b[j],t+(f?"."+j:"["+j+"]"),o,i,a,l,u,s,f,p,d,y)))}return g};e.exports=function(e,r){var t=e,a=r?n.assign({},r):{};if(null!==a.encoder&&void 0!==a.encoder&&"function"!=typeof a.encoder)throw new TypeError("Encoder has to be a function.");var u=void 0===a.delimiter?c.delimiter:a.delimiter,s="boolean"==typeof a.strictNullHandling?a.strictNullHandling:c.strictNullHandling,f="boolean"==typeof a.skipNulls?a.skipNulls:c.skipNulls,p="boolean"==typeof a.encode?a.encode:c.encode,d="function"==typeof a.encoder?a.encoder:c.encoder,y="function"==typeof a.sort?a.sort:null,b=void 0!==a.allowDots&&a.allowDots,v="function"==typeof a.serializeDate?a.serializeDate:c.serializeDate,g="boolean"==typeof a.encodeValuesOnly?a.encodeValuesOnly:c.encodeValuesOnly;if(void 0===a.format)a.format=o.default;else if(!Object.prototype.hasOwnProperty.call(o.formatters,a.format))throw new TypeError("Unknown format option provided.");var m,O,j=o.formatters[a.format];"function"==typeof a.filter?t=(O=a.filter)("",t):Array.isArray(a.filter)&&(m=O=a.filter);var h,w=[];if("object"!=typeof t||null===t)return"";h=a.arrayFormat in i?a.arrayFormat:"indices"in a?a.indices?"indices":"repeat":"indices";var A=i[h];m||(m=Object.keys(t)),y&&m.sort(y);for(var x=0;x<m.length;++x){var P=m[x];f&&null===t[P]||(w=w.concat(l(t[P],P,A,s,f,p?d:null,O,y,b,v,j,g)))}var D=w.join(u),N=!0===a.addQueryPrefix?"?":"";return D.length>0?N+D:""}},364:function(e,r,t){"use strict";var n=t(157),o=Object.prototype.hasOwnProperty,i={allowDots:!1,allowPrototypes:!1,arrayLimit:20,decoder:n.decode,delimiter:"&",depth:5,parameterLimit:1e3,plainObjects:!1,strictNullHandling:!1},a=function(e,r,t){if(e){var n=t.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,i=/(\[[^[\]]*])/g,a=/(\[[^[\]]*])/.exec(n),c=a?n.slice(0,a.index):n,l=[];if(c){if(!t.plainObjects&&o.call(Object.prototype,c)&&!t.allowPrototypes)return;l.push(c)}for(var u=0;null!==(a=i.exec(n))&&u<t.depth;){if(u+=1,!t.plainObjects&&o.call(Object.prototype,a[1].slice(1,-1))&&!t.allowPrototypes)return;l.push(a[1])}return a&&l.push("["+n.slice(a.index)+"]"),function(e,r,t){for(var n=r,o=e.length-1;o>=0;--o){var i,a=e[o];if("[]"===a)i=(i=[]).concat(n);else{i=t.plainObjects?Object.create(null):{};var c="["===a.charAt(0)&&"]"===a.charAt(a.length-1)?a.slice(1,-1):a,l=parseInt(c,10);!isNaN(l)&&a!==c&&String(l)===c&&l>=0&&t.parseArrays&&l<=t.arrayLimit?(i=[])[l]=n:i[c]=n}n=i}return n}(l,r,t)}};e.exports=function(e,r){var t=r?n.assign({},r):{};if(null!==t.decoder&&void 0!==t.decoder&&"function"!=typeof t.decoder)throw new TypeError("Decoder has to be a function.");if(t.ignoreQueryPrefix=!0===t.ignoreQueryPrefix,t.delimiter="string"==typeof t.delimiter||n.isRegExp(t.delimiter)?t.delimiter:i.delimiter,t.depth="number"==typeof t.depth?t.depth:i.depth,t.arrayLimit="number"==typeof t.arrayLimit?t.arrayLimit:i.arrayLimit,t.parseArrays=!1!==t.parseArrays,t.decoder="function"==typeof t.decoder?t.decoder:i.decoder,t.allowDots="boolean"==typeof t.allowDots?t.allowDots:i.allowDots,t.plainObjects="boolean"==typeof t.plainObjects?t.plainObjects:i.plainObjects,t.allowPrototypes="boolean"==typeof t.allowPrototypes?t.allowPrototypes:i.allowPrototypes,t.parameterLimit="number"==typeof t.parameterLimit?t.parameterLimit:i.parameterLimit,t.strictNullHandling="boolean"==typeof t.strictNullHandling?t.strictNullHandling:i.strictNullHandling,""===e||null===e||void 0===e)return t.plainObjects?Object.create(null):{};for(var c="string"==typeof e?function(e,r){for(var t={},n=r.ignoreQueryPrefix?e.replace(/^\?/,""):e,a=r.parameterLimit===1/0?void 0:r.parameterLimit,c=n.split(r.delimiter,a),l=0;l<c.length;++l){var u,s,f=c[l],p=f.indexOf("]="),d=-1===p?f.indexOf("="):p+1;-1===d?(u=r.decoder(f,i.decoder),s=r.strictNullHandling?null:""):(u=r.decoder(f.slice(0,d),i.decoder),s=r.decoder(f.slice(d+1),i.decoder)),o.call(t,u)?t[u]=[].concat(t[u]).concat(s):t[u]=s}return t}(e,t):e,l=t.plainObjects?Object.create(null):{},u=Object.keys(c),s=0;s<u.length;++s){var f=u[s],p=a(f,c[f],t);l=n.merge(l,p,t)}return n.compact(l)}},9:function(e,r,t){"use strict";t.d(r,"a",function(){return o});var n=t(16);function o(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},o=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),o.forEach(function(r){Object(n.a)(e,r,t[r])})}return e}}});