UNPKG

react

Version:

React is a JavaScript library for building user interfaces.

31 lines (27 loc) • 7.53 kB
/* React react.react-server.production.min.js Copyright (c) Meta Platforms, Inc. and affiliates. This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree. */ 'use strict';var m=Object.assign,n={current:null};function p(){return new Map} if("function"===typeof fetch){var q=fetch,r=function(a,b){var d=n.current;if(!d||b&&b.signal&&b.signal!==d.getCacheSignal())return q(a,b);if("string"!==typeof a||b){var c="string"===typeof a||a instanceof URL?new Request(a,b):a;if("GET"!==c.method&&"HEAD"!==c.method||c.keepalive)return q(a,b);var e=JSON.stringify([c.method,Array.from(c.headers.entries()),c.mode,c.redirect,c.credentials,c.referrer,c.referrerPolicy,c.integrity]);c=c.url}else e='["GET",[],null,"follow",null,null,null,null]',c=a;var f= d.getCacheForType(p);d=f.get(c);if(void 0===d)a=q(a,b),f.set(c,[e,a]);else{c=0;for(f=d.length;c<f;c+=2){var g=d[c+1];if(d[c]===e)return a=g,a.then(function(k){return k.clone()})}a=q(a,b);d.push(e,a)}return a.then(function(k){return k.clone()})};m(r,q);try{fetch=r}catch(a){try{globalThis.fetch=r}catch(b){console.warn("React was unable to patch the fetch() function in this environment. Suspensey APIs might not work correctly as a result.")}}} var t={current:null},u={current:null},v={ReactCurrentDispatcher:t,ReactCurrentOwner:u},w={ReactCurrentCache:n};function x(a){var b="https://react.dev/errors/"+a;if(1<arguments.length){b+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)b+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+a+"; visit "+b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."} var y=Array.isArray,z=Symbol.for("react.element"),A=Symbol.for("react.portal"),B=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),D=Symbol.for("react.profiler"),E=Symbol.for("react.forward_ref"),F=Symbol.for("react.suspense"),G=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),I=Symbol.iterator;function J(a){if(null===a||"object"!==typeof a)return null;a=I&&a[I]||a["@@iterator"];return"function"===typeof a?a:null}var K=Object.prototype.hasOwnProperty; function L(a,b,d,c,e){return{$$typeof:z,type:a,key:b,ref:d,props:e,_owner:c}}function M(a,b){return L(a.type,b,a.ref,a._owner,a.props)}function N(a){return"object"===typeof a&&null!==a&&a.$$typeof===z}function escape(a){var b={"=":"=0",":":"=2"};return"$"+a.replace(/[=:]/g,function(d){return b[d]})}var O=/\/+/g;function P(a,b){return"object"===typeof a&&null!==a&&null!=a.key?escape(""+a.key):b.toString(36)}function Q(){} function R(a){switch(a.status){case "fulfilled":return a.value;case "rejected":throw a.reason;default:switch("string"===typeof a.status?a.then(Q,Q):(a.status="pending",a.then(function(b){"pending"===a.status&&(a.status="fulfilled",a.value=b)},function(b){"pending"===a.status&&(a.status="rejected",a.reason=b)})),a.status){case "fulfilled":return a.value;case "rejected":throw a.reason;}}throw a;} function S(a,b,d,c,e){var f=typeof a;if("undefined"===f||"boolean"===f)a=null;var g=!1;if(null===a)g=!0;else switch(f){case "string":case "number":g=!0;break;case "object":switch(a.$$typeof){case z:case A:g=!0;break;case H:return g=a._init,S(g(a._payload),b,d,c,e)}}if(g)return e=e(a),g=""===c?"."+P(a,0):c,y(e)?(d="",null!=g&&(d=g.replace(O,"$&/")+"/"),S(e,b,d,"",function(l){return l})):null!=e&&(N(e)&&(e=M(e,d+(!e.key||a&&a.key===e.key?"":(""+e.key).replace(O,"$&/")+"/")+g)),b.push(e)),1;g=0;var k= ""===c?".":c+":";if(y(a))for(var h=0;h<a.length;h++)c=a[h],f=k+P(c,h),g+=S(c,b,d,f,e);else if(h=J(a),"function"===typeof h)for(a=h.call(a),h=0;!(c=a.next()).done;)c=c.value,f=k+P(c,h++),g+=S(c,b,d,f,e);else if("object"===f){if("function"===typeof a.then)return S(R(a),b,d,c,e);b=String(a);throw Error(x(31,"[object Object]"===b?"object with keys {"+Object.keys(a).join(", ")+"}":b));}return g} function T(a,b,d){if(null==a)return a;var c=[],e=0;S(a,c,"","",function(f){return b.call(d,f,e++)});return c}function U(a){if(-1===a._status){var b=a._result;b=b();b.then(function(d){if(0===a._status||-1===a._status)a._status=1,a._result=d},function(d){if(0===a._status||-1===a._status)a._status=2,a._result=d});-1===a._status&&(a._status=0,a._result=b)}if(1===a._status)return a._result.default;throw a._result;}function V(){return new WeakMap}function W(){return{s:0,v:void 0,o:null,p:null}}var X={transition:null}; function Y(){}var Z="function"===typeof reportError?reportError:function(a){console.error(a)};exports.Children={map:T,forEach:function(a,b,d){T(a,function(){b.apply(this,arguments)},d)},count:function(a){var b=0;T(a,function(){b++});return b},toArray:function(a){return T(a,function(b){return b})||[]},only:function(a){if(!N(a))throw Error(x(143));return a}};exports.Fragment=B;exports.Profiler=D;exports.StrictMode=C;exports.Suspense=F;exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=v; exports.__SECRET_SERVER_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=w; exports.cache=function(a){return function(){var b=n.current;if(!b)return a.apply(null,arguments);var d=b.getCacheForType(V);b=d.get(a);void 0===b&&(b=W(),d.set(a,b));d=0;for(var c=arguments.length;d<c;d++){var e=arguments[d];if("function"===typeof e||"object"===typeof e&&null!==e){var f=b.o;null===f&&(b.o=f=new WeakMap);b=f.get(e);void 0===b&&(b=W(),f.set(e,b))}else f=b.p,null===f&&(b.p=f=new Map),b=f.get(e),void 0===b&&(b=W(),f.set(e,b))}if(1===b.s)return b.v;if(2===b.s)throw b.v;try{var g=a.apply(null, arguments);d=b;d.s=1;return d.v=g}catch(k){throw g=b,g.s=2,g.v=k,k;}}}; exports.cloneElement=function(a,b,d){if(null===a||void 0===a)throw Error(x(267,a));var c=m({},a.props),e=a.key,f=a.ref,g=a._owner;if(null!=b){void 0!==b.ref&&(f=b.ref,g=u.current);void 0!==b.key&&(e=""+b.key);if(a.type&&a.type.defaultProps)var k=a.type.defaultProps;for(h in b)K.call(b,h)&&"key"!==h&&"ref"!==h&&"__self"!==h&&"__source"!==h&&(c[h]=void 0===b[h]&&void 0!==k?k[h]:b[h])}var h=arguments.length-2;if(1===h)c.children=d;else if(1<h){k=Array(h);for(var l=0;l<h;l++)k[l]=arguments[l+2];c.children= k}return L(a.type,e,f,g,c)};exports.createElement=function(a,b,d){var c,e={},f=null,g=null;if(null!=b)for(c in void 0!==b.ref&&(g=b.ref),void 0!==b.key&&(f=""+b.key),b)K.call(b,c)&&"key"!==c&&"ref"!==c&&"__self"!==c&&"__source"!==c&&(e[c]=b[c]);var k=arguments.length-2;if(1===k)e.children=d;else if(1<k){for(var h=Array(k),l=0;l<k;l++)h[l]=arguments[l+2];e.children=h}if(a&&a.defaultProps)for(c in k=a.defaultProps,k)void 0===e[c]&&(e[c]=k[c]);return L(a,f,g,u.current,e)};exports.createRef=function(){return{current:null}}; exports.forwardRef=function(a){return{$$typeof:E,render:a}};exports.isValidElement=N;exports.lazy=function(a){return{$$typeof:H,_payload:{_status:-1,_result:a},_init:U}};exports.memo=function(a,b){return{$$typeof:G,type:a,compare:void 0===b?null:b}}; exports.startTransition=function(a){var b=X.transition,d=new Set;X.transition={_callbacks:d};var c=X.transition;try{var e=a();"object"===typeof e&&null!==e&&"function"===typeof e.then&&(d.forEach(function(f){return f(c,e)}),e.then(Y,Z))}catch(f){Z(f)}finally{X.transition=b}};exports.use=function(a){return t.current.use(a)};exports.useCallback=function(a,b){return t.current.useCallback(a,b)};exports.useDebugValue=function(){};exports.useId=function(){return t.current.useId()}; exports.useMemo=function(a,b){return t.current.useMemo(a,b)};exports.version="18.3.0-canary-f0e808e5b-20240214"; //# sourceMappingURL=react.react-server.production.min.js.map