@ahooksjs/use-url-state
Advanced tools
Comparing version 2.5.0 to 2.5.1
@@ -1,2 +0,7 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("React")):"function"==typeof define&&define.amd?define(["React"],e):"object"==typeof exports?exports.ahooksUseUrlState=e(require("React")):t.ahooksUseUrlState=e(t.React)}(this,(function(t){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=17)}([function(e,r){e.exports=t},function(t,e,r){t.exports=r(12)()},function(t,e,r){"use strict";const n=r(9),o=r(10),i=r(11);function a(t){if("string"!=typeof t||1!==t.length)throw new TypeError("arrayFormatSeparator must be single character string")}function c(t,e){return e.encode?e.strict?n(t):encodeURIComponent(t):t}function s(t,e){return e.decode?o(t):t}function u(t){const e=t.indexOf("#");return-1!==e&&(t=t.slice(0,e)),t}function f(t){const e=(t=u(t)).indexOf("?");return-1===e?"":t.slice(e+1)}function p(t,e){return e.parseNumbers&&!Number.isNaN(Number(t))&&"string"==typeof t&&""!==t.trim()?t=Number(t):!e.parseBooleans||null===t||"true"!==t.toLowerCase()&&"false"!==t.toLowerCase()||(t="true"===t.toLowerCase()),t}function l(t,e){a((e=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},e)).arrayFormatSeparator);const r=function(t){let e;switch(t.arrayFormat){case"index":return(t,r,n)=>{e=/\[(\d*)\]$/.exec(t),t=t.replace(/\[\d*\]$/,""),e?(void 0===n[t]&&(n[t]={}),n[t][e[1]]=r):n[t]=r};case"bracket":return(t,r,n)=>{e=/(\[\])$/.exec(t),t=t.replace(/\[\]$/,""),e?void 0!==n[t]?n[t]=[].concat(n[t],r):n[t]=[r]:n[t]=r};case"comma":case"separator":return(e,r,n)=>{const o="string"==typeof r&&r.split("").indexOf(t.arrayFormatSeparator)>-1?r.split(t.arrayFormatSeparator).map(e=>s(e,t)):null===r?r:s(r,t);n[e]=o};default:return(t,e,r)=>{void 0!==r[t]?r[t]=[].concat(r[t],e):r[t]=e}}}(e),n=Object.create(null);if("string"!=typeof t)return n;if(!(t=t.trim().replace(/^[?#&]/,"")))return n;for(const o of t.split("&")){let[t,a]=i(e.decode?o.replace(/\+/g," "):o,"=");a=void 0===a?null:["comma","separator"].includes(e.arrayFormat)?a:s(a,e),r(s(t,e),a,n)}for(const t of Object.keys(n)){const r=n[t];if("object"==typeof r&&null!==r)for(const t of Object.keys(r))r[t]=p(r[t],e);else n[t]=p(r,e)}return!1===e.sort?n:(!0===e.sort?Object.keys(n).sort():Object.keys(n).sort(e.sort)).reduce((t,e)=>{const r=n[e];return Boolean(r)&&"object"==typeof r&&!Array.isArray(r)?t[e]=function t(e){return Array.isArray(e)?e.sort():"object"==typeof e?t(Object.keys(e)).sort((t,e)=>Number(t)-Number(e)).map(t=>e[t]):e}(r):t[e]=r,t},Object.create(null))}e.extract=f,e.parse=l,e.stringify=(t,e)=>{if(!t)return"";a((e=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},e)).arrayFormatSeparator);const r=r=>e.skipNull&&null==t[r]||e.skipEmptyString&&""===t[r],n=function(t){switch(t.arrayFormat){case"index":return e=>(r,n)=>{const o=r.length;return void 0===n||t.skipNull&&null===n||t.skipEmptyString&&""===n?r:null===n?[...r,[c(e,t),"[",o,"]"].join("")]:[...r,[c(e,t),"[",c(o,t),"]=",c(n,t)].join("")]};case"bracket":return e=>(r,n)=>void 0===n||t.skipNull&&null===n||t.skipEmptyString&&""===n?r:null===n?[...r,[c(e,t),"[]"].join("")]:[...r,[c(e,t),"[]=",c(n,t)].join("")];case"comma":case"separator":return e=>(r,n)=>null==n||0===n.length?r:0===r.length?[[c(e,t),"=",c(n,t)].join("")]:[[r,c(n,t)].join(t.arrayFormatSeparator)];default:return e=>(r,n)=>void 0===n||t.skipNull&&null===n||t.skipEmptyString&&""===n?r:null===n?[...r,c(e,t)]:[...r,[c(e,t),"=",c(n,t)].join("")]}}(e),o={};for(const e of Object.keys(t))r(e)||(o[e]=t[e]);const i=Object.keys(o);return!1!==e.sort&&i.sort(e.sort),i.map(r=>{const o=t[r];return void 0===o?"":null===o?c(r,e):Array.isArray(o)?o.reduce(n(r),[]).join("&"):c(r,e)+"="+c(o,e)}).filter(t=>t.length>0).join("&")},e.parseUrl=(t,e)=>{e=Object.assign({decode:!0},e);const[r,n]=i(t,"#");return Object.assign({url:r.split("?")[0]||"",query:l(f(t),e)},e&&e.parseFragmentIdentifier&&n?{fragmentIdentifier:s(n,e)}:{})},e.stringifyUrl=(t,r)=>{r=Object.assign({encode:!0,strict:!0},r);const n=u(t.url).split("?")[0]||"",o=e.extract(t.url),i=e.parse(o,{sort:!1}),a=Object.assign(i,t.query);let s=e.stringify(a,r);s&&(s="?"+s);let f=function(t){let e="";const r=t.indexOf("#");return-1!==r&&(e=t.slice(r)),e}(t.url);return t.fragmentIdentifier&&(f="#"+c(t.fragmentIdentifier,r)),`${n}${s}${f}`}},function(t,e){t.exports=function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}},function(t,e,r){var n=r(15);t.exports=y,t.exports.parse=i,t.exports.compile=function(t,e){return c(i(t,e),e)},t.exports.tokensToFunction=c,t.exports.tokensToRegExp=l;var o=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function i(t,e){for(var r,n=[],i=0,a=0,c="",f=e&&e.delimiter||"/";null!=(r=o.exec(t));){var p=r[0],l=r[1],y=r.index;if(c+=t.slice(a,y),a=y+p.length,l)c+=l[1];else{var h=t[a],d=r[2],m=r[3],v=r[4],g=r[5],b=r[6],x=r[7];c&&(n.push(c),c="");var j=null!=d&&null!=h&&h!==d,O="+"===b||"*"===b,S="?"===b||"*"===b,w=r[2]||f,E=v||g;n.push({name:m||i++,prefix:d||"",delimiter:w,optional:S,repeat:O,partial:j,asterisk:!!x,pattern:E?u(E):x?".*":"[^"+s(w)+"]+?"})}}return a<t.length&&(c+=t.substr(a)),c&&n.push(c),n}function a(t){return encodeURI(t).replace(/[\/?#]/g,(function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()}))}function c(t,e){for(var r=new Array(t.length),o=0;o<t.length;o++)"object"==typeof t[o]&&(r[o]=new RegExp("^(?:"+t[o].pattern+")$",p(e)));return function(e,o){for(var i="",c=e||{},s=(o||{}).pretty?a:encodeURIComponent,u=0;u<t.length;u++){var f=t[u];if("string"!=typeof f){var p,l=c[f.name];if(null==l){if(f.optional){f.partial&&(i+=f.prefix);continue}throw new TypeError('Expected "'+f.name+'" to be defined')}if(n(l)){if(!f.repeat)throw new TypeError('Expected "'+f.name+'" to not repeat, but received `'+JSON.stringify(l)+"`");if(0===l.length){if(f.optional)continue;throw new TypeError('Expected "'+f.name+'" to not be empty')}for(var y=0;y<l.length;y++){if(p=s(l[y]),!r[u].test(p))throw new TypeError('Expected all "'+f.name+'" to match "'+f.pattern+'", but received `'+JSON.stringify(p)+"`");i+=(0===y?f.prefix:f.delimiter)+p}}else{if(p=f.asterisk?encodeURI(l).replace(/[?#]/g,(function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})):s(l),!r[u].test(p))throw new TypeError('Expected "'+f.name+'" to match "'+f.pattern+'", but received "'+p+'"');i+=f.prefix+p}}else i+=f}return i}}function s(t){return t.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function u(t){return t.replace(/([=!:$\/()])/g,"\\$1")}function f(t,e){return t.keys=e,t}function p(t){return t&&t.sensitive?"":"i"}function l(t,e,r){n(e)||(r=e||r,e=[]);for(var o=(r=r||{}).strict,i=!1!==r.end,a="",c=0;c<t.length;c++){var u=t[c];if("string"==typeof u)a+=s(u);else{var l=s(u.prefix),y="(?:"+u.pattern+")";e.push(u),u.repeat&&(y+="(?:"+l+y+")*"),a+=y=u.optional?u.partial?l+"("+y+")?":"(?:"+l+"("+y+"))?":l+"("+y+")"}}var h=s(r.delimiter||"/"),d=a.slice(-h.length)===h;return o||(a=(d?a.slice(0,-h.length):a)+"(?:"+h+"(?=$))?"),a+=i?"$":o&&d?"":"(?="+h+"|$)",f(new RegExp("^"+a,p(r)),e)}function y(t,e,r){return n(e)||(r=e||r,e=[]),r=r||{},t instanceof RegExp?function(t,e){var r=t.source.match(/\((?!\?)/g);if(r)for(var n=0;n<r.length;n++)e.push({name:n,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,asterisk:!1,pattern:null});return f(t,e)}(t,e):n(t)?function(t,e,r){for(var n=[],o=0;o<t.length;o++)n.push(y(t[o],e,r).source);return f(new RegExp("(?:"+n.join("|")+")",p(r)),e)}(t,e,r):function(t,e,r){return l(i(t,r),e,r)}(t,e,r)}},,function(t,e,r){"use strict";t.exports=r(16)},function(t,e,r){"use strict";(function(e){var r="__global_unique_id__";t.exports=function(){return e[r]=(e[r]||0)+1}}).call(this,r(14))},function(t,e,r){"use strict";var n=r(6),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},c={};function s(t){return n.isMemo(t)?a:c[t.$$typeof]||o}c[n.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},c[n.Memo]=a;var u=Object.defineProperty,f=Object.getOwnPropertyNames,p=Object.getOwnPropertySymbols,l=Object.getOwnPropertyDescriptor,y=Object.getPrototypeOf,h=Object.prototype;t.exports=function t(e,r,n){if("string"!=typeof r){if(h){var o=y(r);o&&o!==h&&t(e,o,n)}var a=f(r);p&&(a=a.concat(p(r)));for(var c=s(e),d=s(r),m=0;m<a.length;++m){var v=a[m];if(!(i[v]||n&&n[v]||d&&d[v]||c&&c[v])){var g=l(r,v);try{u(e,v,g)}catch(t){}}}}return e}},function(t,e,r){"use strict";t.exports=t=>encodeURIComponent(t).replace(/[!'()*]/g,t=>"%"+t.charCodeAt(0).toString(16).toUpperCase())},function(t,e,r){"use strict";var n=new RegExp("%[a-f0-9]{2}","gi"),o=new RegExp("(%[a-f0-9]{2})+","gi");function i(t,e){try{return decodeURIComponent(t.join(""))}catch(t){}if(1===t.length)return t;e=e||1;var r=t.slice(0,e),n=t.slice(e);return Array.prototype.concat.call([],i(r),i(n))}function a(t){try{return decodeURIComponent(t)}catch(o){for(var e=t.match(n),r=1;r<e.length;r++)e=(t=i(e,r).join("")).match(n);return t}}t.exports=function(t){if("string"!=typeof t)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof t+"`");try{return t=t.replace(/\+/g," "),decodeURIComponent(t)}catch(e){return function(t){for(var e={"%FE%FF":"��","%FF%FE":"��"},r=o.exec(t);r;){try{e[r[0]]=decodeURIComponent(r[0])}catch(t){var n=a(r[0]);n!==r[0]&&(e[r[0]]=n)}r=o.exec(t)}e["%C2"]="�";for(var i=Object.keys(e),c=0;c<i.length;c++){var s=i[c];t=t.replace(new RegExp(s,"g"),e[s])}return t}(t)}}},function(t,e,r){"use strict";t.exports=(t,e)=>{if("string"!=typeof t||"string"!=typeof e)throw new TypeError("Expected the arguments to be of type `string`");if(""===e)return[t];const r=t.indexOf(e);return-1===r?[t]:[t.slice(0,r),t.slice(r+e.length)]}},function(t,e,r){"use strict";var n=r(13);function o(){}function i(){}i.resetWarningCache=o,t.exports=function(){function t(t,e,r,o,i,a){if(a!==n){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}function e(){return t}t.isRequired=t;var r={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:i,resetWarningCache:o};return r.PropTypes=r,r}},function(t,e,r){"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e){t.exports=Array.isArray||function(t){return"[object Array]"==Object.prototype.toString.call(t)}},function(t,e,r){"use strict"; | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("React")):"function"==typeof define&&define.amd?define(["React"],e):"object"==typeof exports?exports.ahooksUseUrlState=e(require("React")):t.ahooksUseUrlState=e(t.React)}(this,(function(t){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=16)}([function(e,n){e.exports=t},function(t,e,n){t.exports=n(11)()},function(t,e,n){"use strict";var r=n(9),o=n(10);function i(t,e){return e.encode?e.strict?r(t):encodeURIComponent(t):t}e.extract=function(t){return t.split("?")[1]||""},e.parse=function(t,e){var n=function(t){var e;switch(t.arrayFormat){case"index":return function(t,n,r){e=/\[(\d*)\]$/.exec(t),t=t.replace(/\[\d*\]$/,""),e?(void 0===r[t]&&(r[t]={}),r[t][e[1]]=n):r[t]=n};case"bracket":return function(t,n,r){e=/(\[\])$/.exec(t),t=t.replace(/\[\]$/,""),e?void 0!==r[t]?r[t]=[].concat(r[t],n):r[t]=[n]:r[t]=n};default:return function(t,e,n){void 0!==n[t]?n[t]=[].concat(n[t],e):n[t]=e}}}(e=o({arrayFormat:"none"},e)),r=Object.create(null);return"string"!=typeof t?r:(t=t.trim().replace(/^(\?|#|&)/,""))?(t.split("&").forEach((function(t){var e=t.replace(/\+/g," ").split("="),o=e.shift(),i=e.length>0?e.join("="):void 0;i=void 0===i?null:decodeURIComponent(i),n(decodeURIComponent(o),i,r)})),Object.keys(r).sort().reduce((function(t,e){var n=r[e];return Boolean(n)&&"object"==typeof n&&!Array.isArray(n)?t[e]=function t(e){return Array.isArray(e)?e.sort():"object"==typeof e?t(Object.keys(e)).sort((function(t,e){return Number(t)-Number(e)})).map((function(t){return e[t]})):e}(n):t[e]=n,t}),Object.create(null))):r},e.stringify=function(t,e){var n=function(t){switch(t.arrayFormat){case"index":return function(e,n,r){return null===n?[i(e,t),"[",r,"]"].join(""):[i(e,t),"[",i(r,t),"]=",i(n,t)].join("")};case"bracket":return function(e,n){return null===n?i(e,t):[i(e,t),"[]=",i(n,t)].join("")};default:return function(e,n){return null===n?i(e,t):[i(e,t),"=",i(n,t)].join("")}}}(e=o({encode:!0,strict:!0,arrayFormat:"none"},e));return t?Object.keys(t).sort().map((function(r){var o=t[r];if(void 0===o)return"";if(null===o)return i(r,e);if(Array.isArray(o)){var a=[];return o.slice().forEach((function(t){void 0!==t&&a.push(n(r,t,a.length))})),a.join("&")}return i(r,e)+"="+i(o,e)})).filter((function(t){return t.length>0})).join("&"):""}},function(t,e){t.exports=function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}},function(t,e,n){var r=n(14);t.exports=h,t.exports.parse=i,t.exports.compile=function(t,e){return c(i(t,e),e)},t.exports.tokensToFunction=c,t.exports.tokensToRegExp=l;var o=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function i(t,e){for(var n,r=[],i=0,a=0,c="",f=e&&e.delimiter||"/";null!=(n=o.exec(t));){var p=n[0],l=n[1],h=n.index;if(c+=t.slice(a,h),a=h+p.length,l)c+=l[1];else{var y=t[a],d=n[2],v=n[3],m=n[4],g=n[5],b=n[6],x=n[7];c&&(r.push(c),c="");var j=null!=d&&null!=y&&y!==d,O="+"===b||"*"===b,w="?"===b||"*"===b,S=n[2]||f,P=m||g;r.push({name:v||i++,prefix:d||"",delimiter:S,optional:w,repeat:O,partial:j,asterisk:!!x,pattern:P?s(P):x?".*":"[^"+u(S)+"]+?"})}}return a<t.length&&(c+=t.substr(a)),c&&r.push(c),r}function a(t){return encodeURI(t).replace(/[\/?#]/g,(function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()}))}function c(t,e){for(var n=new Array(t.length),o=0;o<t.length;o++)"object"==typeof t[o]&&(n[o]=new RegExp("^(?:"+t[o].pattern+")$",p(e)));return function(e,o){for(var i="",c=e||{},u=(o||{}).pretty?a:encodeURIComponent,s=0;s<t.length;s++){var f=t[s];if("string"!=typeof f){var p,l=c[f.name];if(null==l){if(f.optional){f.partial&&(i+=f.prefix);continue}throw new TypeError('Expected "'+f.name+'" to be defined')}if(r(l)){if(!f.repeat)throw new TypeError('Expected "'+f.name+'" to not repeat, but received `'+JSON.stringify(l)+"`");if(0===l.length){if(f.optional)continue;throw new TypeError('Expected "'+f.name+'" to not be empty')}for(var h=0;h<l.length;h++){if(p=u(l[h]),!n[s].test(p))throw new TypeError('Expected all "'+f.name+'" to match "'+f.pattern+'", but received `'+JSON.stringify(p)+"`");i+=(0===h?f.prefix:f.delimiter)+p}}else{if(p=f.asterisk?encodeURI(l).replace(/[?#]/g,(function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})):u(l),!n[s].test(p))throw new TypeError('Expected "'+f.name+'" to match "'+f.pattern+'", but received "'+p+'"');i+=f.prefix+p}}else i+=f}return i}}function u(t){return t.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function s(t){return t.replace(/([=!:$\/()])/g,"\\$1")}function f(t,e){return t.keys=e,t}function p(t){return t&&t.sensitive?"":"i"}function l(t,e,n){r(e)||(n=e||n,e=[]);for(var o=(n=n||{}).strict,i=!1!==n.end,a="",c=0;c<t.length;c++){var s=t[c];if("string"==typeof s)a+=u(s);else{var l=u(s.prefix),h="(?:"+s.pattern+")";e.push(s),s.repeat&&(h+="(?:"+l+h+")*"),a+=h=s.optional?s.partial?l+"("+h+")?":"(?:"+l+"("+h+"))?":l+"("+h+")"}}var y=u(n.delimiter||"/"),d=a.slice(-y.length)===y;return o||(a=(d?a.slice(0,-y.length):a)+"(?:"+y+"(?=$))?"),a+=i?"$":o&&d?"":"(?="+y+"|$)",f(new RegExp("^"+a,p(n)),e)}function h(t,e,n){return r(e)||(n=e||n,e=[]),n=n||{},t instanceof RegExp?function(t,e){var n=t.source.match(/\((?!\?)/g);if(n)for(var r=0;r<n.length;r++)e.push({name:r,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,asterisk:!1,pattern:null});return f(t,e)}(t,e):r(t)?function(t,e,n){for(var r=[],o=0;o<t.length;o++)r.push(h(t[o],e,n).source);return f(new RegExp("(?:"+r.join("|")+")",p(n)),e)}(t,e,n):function(t,e,n){return l(i(t,n),e,n)}(t,e,n)}},,function(t,e,n){"use strict";t.exports=n(15)},function(t,e,n){"use strict";(function(e){var n="__global_unique_id__";t.exports=function(){return e[n]=(e[n]||0)+1}}).call(this,n(13))},function(t,e,n){"use strict";var r=n(6),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},c={};function u(t){return r.isMemo(t)?a:c[t.$$typeof]||o}c[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},c[r.Memo]=a;var s=Object.defineProperty,f=Object.getOwnPropertyNames,p=Object.getOwnPropertySymbols,l=Object.getOwnPropertyDescriptor,h=Object.getPrototypeOf,y=Object.prototype;t.exports=function t(e,n,r){if("string"!=typeof n){if(y){var o=h(n);o&&o!==y&&t(e,o,r)}var a=f(n);p&&(a=a.concat(p(n)));for(var c=u(e),d=u(n),v=0;v<a.length;++v){var m=a[v];if(!(i[m]||r&&r[m]||d&&d[m]||c&&c[m])){var g=l(n,m);try{s(e,m,g)}catch(t){}}}}return e}},function(t,e,n){"use strict";t.exports=function(t){return encodeURIComponent(t).replace(/[!'()*]/g,(function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()}))}},function(t,e,n){"use strict"; | ||
/* | ||
object-assign | ||
(c) Sindre Sorhus | ||
@license MIT | ||
*/var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function a(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}t.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(t){r[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var n,c,u=a(t),s=1;s<arguments.length;s++){for(var f in n=Object(arguments[s]))o.call(n,f)&&(u[f]=n[f]);if(r){c=r(n);for(var p=0;p<c.length;p++)i.call(n,c[p])&&(u[c[p]]=n[c[p]])}}return u}},function(t,e,n){"use strict";var r=n(12);function o(){}function i(){}i.resetWarningCache=o,t.exports=function(){function t(t,e,n,o,i,a){if(a!==r){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}function e(){return t}t.isRequired=t;var n={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},function(t,e,n){"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e){t.exports=Array.isArray||function(t){return"[object Array]"==Object.prototype.toString.call(t)}},function(t,e,n){"use strict"; | ||
/** @license React v16.13.1 | ||
@@ -9,2 +14,2 @@ * react-is.production.min.js | ||
* LICENSE file in the root directory of this source tree. | ||
*/var n="function"==typeof Symbol&&Symbol.for,o=n?Symbol.for("react.element"):60103,i=n?Symbol.for("react.portal"):60106,a=n?Symbol.for("react.fragment"):60107,c=n?Symbol.for("react.strict_mode"):60108,s=n?Symbol.for("react.profiler"):60114,u=n?Symbol.for("react.provider"):60109,f=n?Symbol.for("react.context"):60110,p=n?Symbol.for("react.async_mode"):60111,l=n?Symbol.for("react.concurrent_mode"):60111,y=n?Symbol.for("react.forward_ref"):60112,h=n?Symbol.for("react.suspense"):60113,d=n?Symbol.for("react.suspense_list"):60120,m=n?Symbol.for("react.memo"):60115,v=n?Symbol.for("react.lazy"):60116,g=n?Symbol.for("react.block"):60121,b=n?Symbol.for("react.fundamental"):60117,x=n?Symbol.for("react.responder"):60118,j=n?Symbol.for("react.scope"):60119;function O(t){if("object"==typeof t&&null!==t){var e=t.$$typeof;switch(e){case o:switch(t=t.type){case p:case l:case a:case s:case c:case h:return t;default:switch(t=t&&t.$$typeof){case f:case y:case v:case m:case u:return t;default:return e}}case i:return e}}}function S(t){return O(t)===l}e.AsyncMode=p,e.ConcurrentMode=l,e.ContextConsumer=f,e.ContextProvider=u,e.Element=o,e.ForwardRef=y,e.Fragment=a,e.Lazy=v,e.Memo=m,e.Portal=i,e.Profiler=s,e.StrictMode=c,e.Suspense=h,e.isAsyncMode=function(t){return S(t)||O(t)===p},e.isConcurrentMode=S,e.isContextConsumer=function(t){return O(t)===f},e.isContextProvider=function(t){return O(t)===u},e.isElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===o},e.isForwardRef=function(t){return O(t)===y},e.isFragment=function(t){return O(t)===a},e.isLazy=function(t){return O(t)===v},e.isMemo=function(t){return O(t)===m},e.isPortal=function(t){return O(t)===i},e.isProfiler=function(t){return O(t)===s},e.isStrictMode=function(t){return O(t)===c},e.isSuspense=function(t){return O(t)===h},e.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===a||t===l||t===s||t===c||t===h||t===d||"object"==typeof t&&null!==t&&(t.$$typeof===v||t.$$typeof===m||t.$$typeof===u||t.$$typeof===f||t.$$typeof===y||t.$$typeof===b||t.$$typeof===x||t.$$typeof===j||t.$$typeof===g)},e.typeOf=O},function(t,e,r){"use strict";r.r(e);var n=r(2),o=r(0),i=r.n(o);function a(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var c=r(1),s=r.n(c);function u(){return(Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(this,arguments)}function f(t){return"/"===t.charAt(0)}function p(t,e){for(var r=e,n=r+1,o=t.length;n<o;r+=1,n+=1)t[r]=t[n];t.pop()}var l=function(t,e){void 0===e&&(e="");var r,n=t&&t.split("/")||[],o=e&&e.split("/")||[],i=t&&f(t),a=e&&f(e),c=i||a;if(t&&f(t)?o=n:n.length&&(o.pop(),o=o.concat(n)),!o.length)return"/";if(o.length){var s=o[o.length-1];r="."===s||".."===s||""===s}else r=!1;for(var u=0,l=o.length;l>=0;l--){var y=o[l];"."===y?p(o,l):".."===y?(p(o,l),u++):u&&(p(o,l),u--)}if(!c)for(;u--;u)o.unshift("..");!c||""===o[0]||o[0]&&f(o[0])||o.unshift("");var h=o.join("/");return r&&"/"!==h.substr(-1)&&(h+="/"),h};var y=function(t,e){if(!t)throw new Error("Invariant failed")};function h(t){var e=t.pathname,r=t.search,n=t.hash,o=e||"/";return r&&"?"!==r&&("?"===r.charAt(0)?r:"?"+r),n&&"#"!==n&&("#"===n.charAt(0)?n:"#"+n),o}function d(t,e,r,n){var o;"string"==typeof t?(function(t){var e=t||"/",r="",n="",o=e.indexOf("#");-1!==o&&(e.substr(o),e.substr(0,o));var i=e.indexOf("?");return-1!==i&&(e.substr(i),e.substr(0,i)),{pathname:e,search:"?"===r?"":r,hash:"#"===n?"":n}}(t)).state=e:(void 0===u({},t).pathname&&(o.pathname=""),o.search?"?"!==o.search.charAt(0)&&(o.search="?"+o.search):o.search="",o.hash?"#"!==o.hash.charAt(0)&&(o.hash="#"+o.hash):o.hash="",void 0!==e&&void 0===o.state&&(o.state=e));try{o.pathname=decodeURI(o.pathname)}catch(t){throw t instanceof URIError?new URIError('Pathname "'+o.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):t}return r&&(o.key=r),n?o.pathname?"/"!==o.pathname.charAt(0)&&(o.pathname=l(o.pathname,n.pathname)):o.pathname=n.pathname:o.pathname||(o.pathname="/"),o}function m(){var t=null;var e=[];return{setPrompt:function(e){return e,function(){t===e&&null}},confirmTransitionTo:function(e,r,n,o){if(null!=t){var i="function"==typeof t?t(e,r):t;"string"==typeof i?"function"==typeof n?n(i,o):o(!0):o(!1!==i)}else o(!0)},appendListener:function(t){var r=!0;function n(){r&&t.apply(void 0,arguments)}return e.push(n),function(){!1,e.filter((function(t){return t!==n}))}},notifyListeners:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];e.forEach((function(t){return t.apply(void 0,r)}))}}}"undefined"==typeof window||!window.document||window.document.createElement;function v(t,e,r){return Math.min(Math.max(t,e),r)}function g(t){void 0===t&&{};var e=t,r=e.getUserConfirmation,n=e.initialEntries,o=void 0===n?["/"]:n,i=e.initialIndex,a=void 0===i?0:i,c=e.keyLength,s=void 0===c?6:c,f=m();function p(t){u(j,t),j.length=j.entries.length,f.notifyListeners(j.location,j.action)}function l(){return Math.random().toString(36).substr(2,s)}var y=v(a,0,o.length-1),g=o.map((function(t){return d(t,void 0,"string"==typeof t?l():t.key||l())})),b=h;function x(t){var e=v(j.index+t,0,j.entries.length-1),n=j.entries[e];f.confirmTransitionTo(n,"POP",r,(function(t){t?p({action:"POP",location:n,index:e}):p()}))}var j={length:g.length,action:"POP",location:g[y],index:y,entries:g,createHref:b,push:function(t,e){var n=d(t,e,l(),j.location);f.confirmTransitionTo(n,"PUSH",r,(function(t){if(t){var e=j.index+1,r=j.entries.slice(0);r.length>e?r.splice(e,r.length-e,n):r.push(n),p({action:"PUSH",location:n,index:e,entries:r})}}))},replace:function(t,e){var n=d(t,e,l(),j.location);f.confirmTransitionTo(n,"REPLACE",r,(function(t){t&&(j.entries[j.index]=n,p({action:"REPLACE",location:n}))}))},go:x,goBack:function(){x(-1)},goForward:function(){x(1)},canGo:function(t){var e=j.index+t;return e>=0&&e<j.entries.length},block:function(t){return void 0===t&&!1,f.setPrompt(t)},listen:function(t){return f.appendListener(t)}};return j}var b=r(3),x=r.n(b),j=r(7),O=r.n(j);function S(t){var e=[];return{on:function(t){e.push(t)},off:function(t){e=e.filter((function(e){return e!==t}))},get:function(){return t},set:function(r,n){t=r,e.forEach((function(e){return e(t,n)}))}}}var w=i.a.createContext||function(t,e){var r,n,i="__create-react-context-"+O()()+"__",a=function(t){function r(){var e;return(e=t.apply(this,arguments)||this).emitter=S(e.props.value),e}x()(r,t);var n=r.prototype;return n.getChildContext=function(){var t;return(t={})[i]=this.emitter,t},n.componentWillReceiveProps=function(t){if(this.props.value!==t.value){var r,n=this.props.value,o=t.value;((i=n)===(a=o)?0!==i||1/i==1/a:i!=i&&a!=a)?r=0:(r="function"==typeof e?e(n,o):1073741823,0!==(r|=0)&&this.emitter.set(t.value,r))}var i,a},n.render=function(){return this.props.children},r}(o.Component);a.childContextTypes=((r={})[i]=s.a.object.isRequired,r);var c=function(e){function r(){var t;return(t=e.apply(this,arguments)||this).state={value:t.getValue()},t.onUpdate=function(e,r){0!=((0|t.observedBits)&r)&&t.setState({value:t.getValue()})},t}x()(r,e);var n=r.prototype;return n.componentWillReceiveProps=function(t){var e=t.observedBits;this.observedBits=null==e?1073741823:e},n.componentDidMount=function(){this.context[i]&&this.context[i].on(this.onUpdate);var t=this.props.observedBits;this.observedBits=null==t?1073741823:t},n.componentWillUnmount=function(){this.context[i]&&this.context[i].off(this.onUpdate)},n.getValue=function(){return this.context[i]?this.context[i].get():t},n.render=function(){return(t=this.props.children,Array.isArray(t)?t[0]:t)(this.state.value);var t},r}(o.Component);return c.contextTypes=((n={})[i]=s.a.object,n),{Provider:a,Consumer:c}},E=r(4),C=r.n(E);r(6);function P(t,e){if(null==t)return{};var r,n,o={},i=Object.keys(t);for(0;n<i.length;n++)i[n],e.indexOf(r)>=0||(o[r]=t[r]);return o}r(8);var $=function(t){var e=w();return e.displayName=t,e}("Router"),_=function(t){function e(e){var r;return(r=t.call(this,e)||this).state={location:e.history.location},r._isMounted=!1,r._pendingLocation=null,e.staticContext||(r.unlisten=e.history.listen((function(t){r._isMounted?r.setState({location:t}):r._pendingLocation=t}))),r}a(e,t),e.computeRootMatch=function(t){return{path:"/",url:"/",params:{},isExact:"/"===t}};var r=e.prototype;return r.componentDidMount=function(){this._isMounted=!0,this._pendingLocation&&this.setState({location:this._pendingLocation})},r.componentWillUnmount=function(){this.unlisten&&this.unlisten()},r.render=function(){return i.a.createElement($.Provider,{children:this.props.children||null,value:{history:this.props.history,location:this.state.location,match:e.computeRootMatch(this.state.location.pathname),staticContext:this.props.staticContext}})},e}(i.a.Component);i.a.Component;i.a.Component;var R={},k=0;function T(t,e){void 0===e&&{},("string"==typeof e||Array.isArray(e))&&{path:e};var r=e,n=r.path,o=r.exact,i=void 0!==o&&o,a=r.strict,c=void 0!==a&&a,s=r.sensitive,u=void 0!==s&&s;return[].concat(n).reduce((function(e,r){if(!r&&""!==r)return null;if(e)return e;var n=function(t,e){var r=""+e.end+e.strict+e.sensitive,n=R[r]||(R[r]={});if(n[t])return n[t];var o=[],i={regexp:C()(t,o,e),keys:o};return k<1e4&&(n[t]=i),i}(r,{end:i,strict:c,sensitive:u}),o=n.regexp,a=n.keys,s=o.exec(t);if(!s)return null;var f=s[0],p=s.slice(1),l=t===f;return i&&!l?null:{path:r,url:"/"===r&&""===f?"/":f,isExact:l,params:a.reduce((function(t,e,r){return t[e.name]=p[r],t}),{})}}),null)}i.a.Component;function U(t){return"/"===t.charAt(0)?t:"/"+t}function A(t,e){if(!t)return e;var r=U(t);return 0!==e.pathname.indexOf(r)?e:u({},e,{pathname:e.pathname.substr(r.length)})}function F(t){return"string"==typeof t?t:h(t)}function M(t){return function(){y(!1)}}function I(){}i.a.Component;i.a.Component;var N=i.a.useContext;function L(){return N($).location}var B=function(){return(B=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},D=function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},q={skipNull:!0,skipEmptyString:!0,parseNumbers:!1,parseBooleans:!1};e.default=function(t,e){var r=(e||{}).navigateMode,i=void 0===r?"push":r,a=L(),c=N($).history,s=D(Object(o.useState)(!1),2)[1],u=Object(o.useRef)("function"==typeof t?t():t||{}),f=Object(o.useMemo)((function(){return Object(n.parse)(a.search,q)}),[a.search]),p=B(B({},u.current),f);return[p,function(t){var e="function"==typeof t?t(p):t;s((function(t){return!t})),c[i]({hash:a.hash,search:Object(n.stringify)(B(B({},f),e),q)||"?"})}]}}])})); | ||
*/var r="function"==typeof Symbol&&Symbol.for,o=r?Symbol.for("react.element"):60103,i=r?Symbol.for("react.portal"):60106,a=r?Symbol.for("react.fragment"):60107,c=r?Symbol.for("react.strict_mode"):60108,u=r?Symbol.for("react.profiler"):60114,s=r?Symbol.for("react.provider"):60109,f=r?Symbol.for("react.context"):60110,p=r?Symbol.for("react.async_mode"):60111,l=r?Symbol.for("react.concurrent_mode"):60111,h=r?Symbol.for("react.forward_ref"):60112,y=r?Symbol.for("react.suspense"):60113,d=r?Symbol.for("react.suspense_list"):60120,v=r?Symbol.for("react.memo"):60115,m=r?Symbol.for("react.lazy"):60116,g=r?Symbol.for("react.block"):60121,b=r?Symbol.for("react.fundamental"):60117,x=r?Symbol.for("react.responder"):60118,j=r?Symbol.for("react.scope"):60119;function O(t){if("object"==typeof t&&null!==t){var e=t.$$typeof;switch(e){case o:switch(t=t.type){case p:case l:case a:case u:case c:case y:return t;default:switch(t=t&&t.$$typeof){case f:case h:case m:case v:case s:return t;default:return e}}case i:return e}}}function w(t){return O(t)===l}e.AsyncMode=p,e.ConcurrentMode=l,e.ContextConsumer=f,e.ContextProvider=s,e.Element=o,e.ForwardRef=h,e.Fragment=a,e.Lazy=m,e.Memo=v,e.Portal=i,e.Profiler=u,e.StrictMode=c,e.Suspense=y,e.isAsyncMode=function(t){return w(t)||O(t)===p},e.isConcurrentMode=w,e.isContextConsumer=function(t){return O(t)===f},e.isContextProvider=function(t){return O(t)===s},e.isElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===o},e.isForwardRef=function(t){return O(t)===h},e.isFragment=function(t){return O(t)===a},e.isLazy=function(t){return O(t)===m},e.isMemo=function(t){return O(t)===v},e.isPortal=function(t){return O(t)===i},e.isProfiler=function(t){return O(t)===u},e.isStrictMode=function(t){return O(t)===c},e.isSuspense=function(t){return O(t)===y},e.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===a||t===l||t===u||t===c||t===y||t===d||"object"==typeof t&&null!==t&&(t.$$typeof===m||t.$$typeof===v||t.$$typeof===s||t.$$typeof===f||t.$$typeof===h||t.$$typeof===b||t.$$typeof===x||t.$$typeof===j||t.$$typeof===g)},e.typeOf=O},function(t,e,n){"use strict";n.r(e);var r=n(2),o=n(0),i=n.n(o);function a(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var c=n(1),u=n.n(c);function s(){return(Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function f(t){return"/"===t.charAt(0)}function p(t,e){for(var n=e,r=n+1,o=t.length;r<o;n+=1,r+=1)t[n]=t[r];t.pop()}var l=function(t,e){void 0===e&&(e="");var n,r=t&&t.split("/")||[],o=e&&e.split("/")||[],i=t&&f(t),a=e&&f(e),c=i||a;if(t&&f(t)?o=r:r.length&&(o.pop(),o=o.concat(r)),!o.length)return"/";if(o.length){var u=o[o.length-1];n="."===u||".."===u||""===u}else n=!1;for(var s=0,l=o.length;l>=0;l--){var h=o[l];"."===h?p(o,l):".."===h?(p(o,l),s++):s&&(p(o,l),s--)}if(!c)for(;s--;s)o.unshift("..");!c||""===o[0]||o[0]&&f(o[0])||o.unshift("");var y=o.join("/");return n&&"/"!==y.substr(-1)&&(y+="/"),y};var h=function(t,e){if(!t)throw new Error("Invariant failed")};function y(t){var e=t.pathname,n=t.search,r=t.hash,o=e||"/";return n&&"?"!==n&&("?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&("#"===r.charAt(0)?r:"#"+r),o}function d(t,e,n,r){var o;"string"==typeof t?(function(t){var e=t||"/",n="",r="",o=e.indexOf("#");-1!==o&&(e.substr(o),e.substr(0,o));var i=e.indexOf("?");return-1!==i&&(e.substr(i),e.substr(0,i)),{pathname:e,search:"?"===n?"":n,hash:"#"===r?"":r}}(t)).state=e:(void 0===s({},t).pathname&&(o.pathname=""),o.search?"?"!==o.search.charAt(0)&&(o.search="?"+o.search):o.search="",o.hash?"#"!==o.hash.charAt(0)&&(o.hash="#"+o.hash):o.hash="",void 0!==e&&void 0===o.state&&(o.state=e));try{o.pathname=decodeURI(o.pathname)}catch(t){throw t instanceof URIError?new URIError('Pathname "'+o.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):t}return n&&(o.key=n),r?o.pathname?"/"!==o.pathname.charAt(0)&&(o.pathname=l(o.pathname,r.pathname)):o.pathname=r.pathname:o.pathname||(o.pathname="/"),o}function v(){var t=null;var e=[];return{setPrompt:function(e){return e,function(){t===e&&null}},confirmTransitionTo:function(e,n,r,o){if(null!=t){var i="function"==typeof t?t(e,n):t;"string"==typeof i?"function"==typeof r?r(i,o):o(!0):o(!1!==i)}else o(!0)},appendListener:function(t){var n=!0;function r(){n&&t.apply(void 0,arguments)}return e.push(r),function(){!1,e.filter((function(t){return t!==r}))}},notifyListeners:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];e.forEach((function(t){return t.apply(void 0,n)}))}}}"undefined"==typeof window||!window.document||window.document.createElement;function m(t,e,n){return Math.min(Math.max(t,e),n)}function g(t){void 0===t&&{};var e=t,n=e.getUserConfirmation,r=e.initialEntries,o=void 0===r?["/"]:r,i=e.initialIndex,a=void 0===i?0:i,c=e.keyLength,u=void 0===c?6:c,f=v();function p(t){s(j,t),j.length=j.entries.length,f.notifyListeners(j.location,j.action)}function l(){return Math.random().toString(36).substr(2,u)}var h=m(a,0,o.length-1),g=o.map((function(t){return d(t,void 0,"string"==typeof t?l():t.key||l())})),b=y;function x(t){var e=m(j.index+t,0,j.entries.length-1),r=j.entries[e];f.confirmTransitionTo(r,"POP",n,(function(t){t?p({action:"POP",location:r,index:e}):p()}))}var j={length:g.length,action:"POP",location:g[h],index:h,entries:g,createHref:b,push:function(t,e){var r=d(t,e,l(),j.location);f.confirmTransitionTo(r,"PUSH",n,(function(t){if(t){var e=j.index+1,n=j.entries.slice(0);n.length>e?n.splice(e,n.length-e,r):n.push(r),p({action:"PUSH",location:r,index:e,entries:n})}}))},replace:function(t,e){var r=d(t,e,l(),j.location);f.confirmTransitionTo(r,"REPLACE",n,(function(t){t&&(j.entries[j.index]=r,p({action:"REPLACE",location:r}))}))},go:x,goBack:function(){x(-1)},goForward:function(){x(1)},canGo:function(t){var e=j.index+t;return e>=0&&e<j.entries.length},block:function(t){return void 0===t&&!1,f.setPrompt(t)},listen:function(t){return f.appendListener(t)}};return j}var b=n(3),x=n.n(b),j=n(7),O=n.n(j);function w(t){var e=[];return{on:function(t){e.push(t)},off:function(t){e=e.filter((function(e){return e!==t}))},get:function(){return t},set:function(n,r){t=n,e.forEach((function(e){return e(t,r)}))}}}var S=i.a.createContext||function(t,e){var n,r,i="__create-react-context-"+O()()+"__",a=function(t){function n(){var e;return(e=t.apply(this,arguments)||this).emitter=w(e.props.value),e}x()(n,t);var r=n.prototype;return r.getChildContext=function(){var t;return(t={})[i]=this.emitter,t},r.componentWillReceiveProps=function(t){if(this.props.value!==t.value){var n,r=this.props.value,o=t.value;((i=r)===(a=o)?0!==i||1/i==1/a:i!=i&&a!=a)?n=0:(n="function"==typeof e?e(r,o):1073741823,0!==(n|=0)&&this.emitter.set(t.value,n))}var i,a},r.render=function(){return this.props.children},n}(o.Component);a.childContextTypes=((n={})[i]=u.a.object.isRequired,n);var c=function(e){function n(){var t;return(t=e.apply(this,arguments)||this).state={value:t.getValue()},t.onUpdate=function(e,n){0!=((0|t.observedBits)&n)&&t.setState({value:t.getValue()})},t}x()(n,e);var r=n.prototype;return r.componentWillReceiveProps=function(t){var e=t.observedBits;this.observedBits=null==e?1073741823:e},r.componentDidMount=function(){this.context[i]&&this.context[i].on(this.onUpdate);var t=this.props.observedBits;this.observedBits=null==t?1073741823:t},r.componentWillUnmount=function(){this.context[i]&&this.context[i].off(this.onUpdate)},r.getValue=function(){return this.context[i]?this.context[i].get():t},r.render=function(){return(t=this.props.children,Array.isArray(t)?t[0]:t)(this.state.value);var t},n}(o.Component);return c.contextTypes=((r={})[i]=u.a.object,r),{Provider:a,Consumer:c}},P=n(4),C=n.n(P);n(6);function _(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(0;r<i.length;r++)i[r],e.indexOf(n)>=0||(o[n]=t[n]);return o}n(8);var E=function(t){var e=S();return e.displayName=t,e}("Router"),$=function(t){function e(e){var n;return(n=t.call(this,e)||this).state={location:e.history.location},n._isMounted=!1,n._pendingLocation=null,e.staticContext||(n.unlisten=e.history.listen((function(t){n._isMounted?n.setState({location:t}):n._pendingLocation=t}))),n}a(e,t),e.computeRootMatch=function(t){return{path:"/",url:"/",params:{},isExact:"/"===t}};var n=e.prototype;return n.componentDidMount=function(){this._isMounted=!0,this._pendingLocation&&this.setState({location:this._pendingLocation})},n.componentWillUnmount=function(){this.unlisten&&this.unlisten()},n.render=function(){return i.a.createElement(E.Provider,{children:this.props.children||null,value:{history:this.props.history,location:this.state.location,match:e.computeRootMatch(this.state.location.pathname),staticContext:this.props.staticContext}})},e}(i.a.Component);i.a.Component;i.a.Component;var T={},R=0;function k(t,e){void 0===e&&{},("string"==typeof e||Array.isArray(e))&&{path:e};var n=e,r=n.path,o=n.exact,i=void 0!==o&&o,a=n.strict,c=void 0!==a&&a,u=n.sensitive,s=void 0!==u&&u;return[].concat(r).reduce((function(e,n){if(!n&&""!==n)return null;if(e)return e;var r=function(t,e){var n=""+e.end+e.strict+e.sensitive,r=T[n]||(T[n]={});if(r[t])return r[t];var o=[],i={regexp:C()(t,o,e),keys:o};return R<1e4&&(r[t]=i),i}(n,{end:i,strict:c,sensitive:s}),o=r.regexp,a=r.keys,u=o.exec(t);if(!u)return null;var f=u[0],p=u.slice(1),l=t===f;return i&&!l?null:{path:n,url:"/"===n&&""===f?"/":f,isExact:l,params:a.reduce((function(t,e,n){return t[e.name]=p[n],t}),{})}}),null)}i.a.Component;function A(t){return"/"===t.charAt(0)?t:"/"+t}function U(t,e){if(!t)return e;var n=A(t);return 0!==e.pathname.indexOf(n)?e:s({},e,{pathname:e.pathname.substr(n.length)})}function M(t){return"string"==typeof t?t:y(t)}function I(t){return function(){h(!1)}}function F(){}i.a.Component;i.a.Component;var L=i.a.useContext;function N(){return L(E).location}var B=function(){return(B=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},D=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},q={skipNull:!0,skipEmptyString:!0,parseNumbers:!1,parseBooleans:!1};e.default=function(t,e){var n=(e||{}).navigateMode,i=void 0===n?"push":n,a=N(),c=L(E).history,u=D(Object(o.useState)(!1),2)[1],s=Object(o.useRef)("function"==typeof t?t():t||{}),f=Object(o.useMemo)((function(){return Object(r.parse)(a.search,q)}),[a.search]),p=B(B({},s.current),f);return[p,function(t){var e="function"==typeof t?t(p):t;u((function(t){return!t})),c[i]({hash:a.hash,search:Object(r.stringify)(B(B({},f),e),q)||"?"})}]}}])})); |
@@ -0,1 +1,2 @@ | ||
/// <reference types="react" /> | ||
export interface Options { | ||
@@ -7,3 +8,3 @@ navigateMode?: 'push' | 'replace'; | ||
} | ||
declare const _default: <S extends UrlState>(initialState?: S | (() => S) | undefined, options?: Options | undefined) => readonly [{}, (s: React.SetStateAction<UrlState>) => void]; | ||
declare const _default: <S extends UrlState = UrlState>(initialState?: S | (() => S) | undefined, options?: Options | undefined) => readonly [Partial<{ [key in keyof S]: any; }>, (s: import("react").SetStateAction<Partial<{ [key in keyof S]: any; }>>) => void]; | ||
export default _default; |
@@ -0,1 +1,2 @@ | ||
/// <reference types="react" /> | ||
export interface Options { | ||
@@ -7,3 +8,3 @@ navigateMode?: 'push' | 'replace'; | ||
} | ||
declare const _default: <S extends UrlState>(initialState?: S | (() => S) | undefined, options?: Options | undefined) => readonly [{}, (s: React.SetStateAction<UrlState>) => void]; | ||
declare const _default: <S extends UrlState = UrlState>(initialState?: S | (() => S) | undefined, options?: Options | undefined) => readonly [Partial<{ [key in keyof S]: any; }>, (s: import("react").SetStateAction<Partial<{ [key in keyof S]: any; }>>) => void]; | ||
export default _default; |
{ | ||
"name": "@ahooksjs/use-url-state", | ||
"version": "2.5.0", | ||
"version": "2.5.1", | ||
"description": "A hook that stores the state into url query parameters.", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
27964
209
2