jiuyiUniapp/service/node_modules/react-devtools-core/dist/parseHookNames.chunk.js

2 lines
2.4 MiB
JavaScript
Raw Normal View History

2025-02-13 09:59:20 +08:00
exports.id=641,exports.ids=[641],exports.modules={2648:(e,t,r)=>{"use strict";r.r(t),r.d(t,{parseHookNames:()=>x,parseSourceAndMetadata:()=>T,purgeCachedMetadata:()=>g});var n=r(8057),i=r(474),s=r.n(i),a=r(3303),o=r(2078);function l(e,t){return null!=t&&(void 0===e.mappings?e.sections.some((e=>l(e.map,t))):e.sources.some((e=>"Inline Babel script"===e||t.endsWith(e))))}const c={cache:"force-cache"},p=1e8;function u(e){if("function"==typeof atob)return atob(e);if("undefined"!=typeof Buffer&&null!==Buffer&&"function"==typeof Buffer.from)return Buffer.from(e,"base64");throw Error("Cannot decode base64 string")}function d(e,t="fetchFile"){return(0,n.OB)(`${t}("${e}")`,(r=>new Promise(((n,i)=>{fetch(e,c).then((s=>{s.ok?s.text().then((e=>{r(),n(e)})).catch((n=>{a.p&&console.log(`${t}() Could not read text for url "${e}"`),r(),i(null)})):(a.p&&console.log(`${t}() Got bad response for url "${e}"`),r(),i(null))}),(e=>{a.p&&console.log(`${t}() Could not fetch file: ${e.message}`),r(),i(null)}))}))))}function h(e){const t=[];return(0,n.Y7)("flattenHooksList()",(()=>{f(e,t)})),a.p&&console.log("flattenHooksList() hooksList:",t),t}function f(e,t){for(let r=0;r<e.length;r++){const n=e[r];m(n)?a.p&&console.log("flattenHooksListImpl() Skipping unnamed hook",n):(t.push(n),n.subHooks.length>0&&f(n.subHooks,t))}}function m(e){return["Effect","ImperativeHandle","LayoutEffect","DebugValue"].includes(e.name)}const y=s()();function T(e,t){return y.parseSourceAndMetadata(e,t)}const g=y.purgeCachedMetadata,b=new Map;async function x(e,t){return(0,n.WV)("parseHookNames",(async()=>{const r=h(e);return 0===r.length?b:T(r,await async function(e,t){return(0,n.WV)("loadSourceAndMetadata()",(async()=>{const r=(0,n.Y7)("initializeHookSourceAndMetadata",(()=>function(e){const t=new Map;for(let r=0;r<e.length;r++){const n=e[r].hookSource;if(null==n)throw Error("Hook source code location not found.");const i=(0,o.qG)(n);if(!t.has(i)){const e={hookSource:n,runtimeSourceCode:null,runtimeSourceURL:n.fileName,sourceMapJSON:null,sourceMapURL:null};t.set(i,e)}}return t}(e)));return await(0,n.WV)("loadSourceFiles()",(()=>function(e,t){const r=new Map,i=[];return e.forEach((e=>{const{runtimeSourceURL:s}=e;let o=d;null!=t&&(o=e=>(0,n.WV)(`fetchFileWithCaching("${e}")`,(()=>t(e))));const l=r.get(s)||o(s).then((e=>{if(e.length>p)throw Error("Source code too large to parse");return a.p&&(console.groupCollapsed(`loadSourceFiles() runtimeSourceURL "${s}"`),console.log(e),console.groupEnd()),e}));r.set(s,l),i.push(l.then((t=>{e.runtimeSourceCode=t})))})),Promise.all(i)}(r,t))),await(0,n.WV)("extractAndLoadSourceMapJSON()",(()=>function(e){const t=new Map;a.p&&console.log("extractAndLoadSourceMapJSON() load",e.size,"source maps");const r=[];return e.forEach((e=>{const i=/ ?sourceMappingURL=([^\s'"]+)/gm,s=e.runtimeSourceCode;let o=(0,n.Y7)("sourceMapRegex.exec(runtimeSourceCode)",(()=>i.exec(s)));if(null==o)a.p&&console.log("extractAndLoadSourceMapJSON() No source map found");else{const c=[];for(;null!=o;){const{runtimeSourceURL:t}=e,r=o[1];if(r.indexOf("base64,")>=0)try{const i=r.match(/base64,([a-zA-Z0-9+\/=]+)/)[1],s=(0,n.Y7)("decodeBase64String()",(()=>u(i))),o=(0,n.Y7)("JSON.parse(decoded)",(()=>JSON.parse(s)));if(a.p&&(console.groupCollapsed("extractAndLoadSourceMapJSON() Inline source map"),console.log(o),console.groupEnd()),l(o,t)){e.sourceMapJSON=o,e.runtimeSourceCode=null;break}}catch(e){}else c.push(r);o=(0,n.Y7)("sourceMapRegex.exec(runtimeSourceCode)",(()=>i.exec(s)))}null===e.sourceMapJSON&&c.forEach(((i,s)=>{if(s!==c.length-1)return void console.warn(`More than one external source map detected in the source file; skipping "${i}"`);const{runtimeSourceURL:o}=e;let l=i;l.startsWith("http")||l.startsWith("/")||-1!==o.lastIndexOf("/")&&(l=`${o.slice(0,o.lastIndexOf("/"))}/${l}`),e.sourceMapURL=l;const p=t.get(l)||d(l).then((e=>(0,n.Y7)("JSON.parse(sourceMapContents)",(()=>JSON.parse(e)))),(e=>null));a.p&&(t.has(l)||console.log(`extractAndLoadSourceMapJSON() External source map "${l}"`)),t.set(l,p),r.push(p.then((t=>{null!==t&&(e.sourceMapJSON=t,e.runtimeSourceCo
//# sourceMappingURL=parseHookNames.chunk.js.map