mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
1 line
6.8 KiB
JSON
1 line
6.8 KiB
JSON
{"ast":null,"code":"import { bindReporter } from './lib/bindReporter.js';\nimport { getVisibilityWatcher } from './lib/getVisibilityWatcher.js';\nimport { initMetric } from './lib/initMetric.js';\nimport { observe } from './lib/observe.js';\nimport { onHidden } from './lib/onHidden.js';\n\n/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// https://wicg.github.io/largest-contentful-paint/#sec-largest-contentful-paint-interface\n\nvar reportedMetricIDs = {};\nvar getLCP = (onReport, reportAllChanges) => {\n var visibilityWatcher = getVisibilityWatcher();\n var metric = initMetric('LCP');\n let report;\n var entryHandler = entry => {\n // The startTime attribute returns the value of the renderTime if it is not 0,\n // and the value of the loadTime otherwise.\n var value = entry.startTime;\n\n // If the page was hidden prior to paint time of the entry,\n // ignore it and mark the metric as final, otherwise add the entry.\n if (value < visibilityWatcher.firstHiddenTime) {\n metric.value = value;\n metric.entries.push(entry);\n }\n if (report) {\n report();\n }\n };\n var po = observe('largest-contentful-paint', entryHandler);\n if (po) {\n report = bindReporter(onReport, metric, reportAllChanges);\n var stopListening = () => {\n if (!reportedMetricIDs[metric.id]) {\n po.takeRecords().map(entryHandler);\n po.disconnect();\n reportedMetricIDs[metric.id] = true;\n report(true);\n }\n };\n\n // Stop listening after input. Note: while scrolling is an input that\n // stop LCP observation, it's unreliable since it can be programmatically\n // generated. See: https://github.com/GoogleChrome/web-vitals/issues/75\n ['keydown', 'click'].forEach(type => {\n addEventListener(type, stopListening, {\n once: true,\n capture: true\n });\n });\n onHidden(stopListening, true);\n }\n};\nexport { getLCP };","map":{"version":3,"names":["bindReporter","getVisibilityWatcher","initMetric","observe","onHidden","reportedMetricIDs","getLCP","onReport","reportAllChanges","visibilityWatcher","metric","report","entryHandler","entry","value","startTime","firstHiddenTime","entries","push","po","stopListening","id","takeRecords","map","disconnect","forEach","type","addEventListener","once","capture"],"sources":["C:/Users/eudes.inacio/GabineteDigital/gabinete-digital-fo/node_modules/@sentry/tracing/esm/browser/web-vitals/getLCP.js"],"sourcesContent":["import { bindReporter } from './lib/bindReporter.js';\nimport { getVisibilityWatcher } from './lib/getVisibilityWatcher.js';\nimport { initMetric } from './lib/initMetric.js';\nimport { observe } from './lib/observe.js';\nimport { onHidden } from './lib/onHidden.js';\n\n/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// https://wicg.github.io/largest-contentful-paint/#sec-largest-contentful-paint-interface\n\nvar reportedMetricIDs = {};\n\nvar getLCP = (onReport, reportAllChanges) => {\n var visibilityWatcher = getVisibilityWatcher();\n var metric = initMetric('LCP');\n let report;\n\n var entryHandler = (entry) => {\n // The startTime attribute returns the value of the renderTime if it is not 0,\n // and the value of the loadTime otherwise.\n var value = entry.startTime;\n\n // If the page was hidden prior to paint time of the entry,\n // ignore it and mark the metric as final, otherwise add the entry.\n if (value < visibilityWatcher.firstHiddenTime) {\n metric.value = value;\n metric.entries.push(entry);\n }\n\n if (report) {\n report();\n }\n };\n\n var po = observe('largest-contentful-paint', entryHandler);\n\n if (po) {\n report = bindReporter(onReport, metric, reportAllChanges);\n\n var stopListening = () => {\n if (!reportedMetricIDs[metric.id]) {\n po.takeRecords().map(entryHandler );\n po.disconnect();\n reportedMetricIDs[metric.id] = true;\n report(true);\n }\n };\n\n // Stop listening after input. Note: while scrolling is an input that\n // stop LCP observation, it's unreliable since it can be programmatically\n // generated. See: https://github.com/GoogleChrome/web-vitals/issues/75\n ['keydown', 'click'].forEach(type => {\n addEventListener(type, stopListening, { once: true, capture: true });\n });\n\n onHidden(stopListening, true);\n }\n};\n\nexport { getLCP };\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,uBAAuB;AACpD,SAASC,oBAAoB,QAAQ,+BAA+B;AACpE,SAASC,UAAU,QAAQ,qBAAqB;AAChD,SAASC,OAAO,QAAQ,kBAAkB;AAC1C,SAASC,QAAQ,QAAQ,mBAAmB;;AAE5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,IAAIC,iBAAiB,GAAG,CAAC,CAAC;AAE1B,IAAIC,MAAM,GAAGA,CAACC,QAAQ,EAAEC,gBAAgB,KAAK;EAC3C,IAAIC,iBAAiB,GAAGR,oBAAoB,CAAC,CAAC;EAC9C,IAAIS,MAAM,GAAGR,UAAU,CAAC,KAAK,CAAC;EAC9B,IAAIS,MAAM;EAEV,IAAIC,YAAY,GAAIC,KAAK,IAAK;IAC5B;IACA;IACA,IAAIC,KAAK,GAAGD,KAAK,CAACE,SAAS;;IAE3B;IACA;IACA,IAAID,KAAK,GAAGL,iBAAiB,CAACO,eAAe,EAAE;MAC7CN,MAAM,CAACI,KAAK,GAAGA,KAAK;MACpBJ,MAAM,CAACO,OAAO,CAACC,IAAI,CAACL,KAAK,CAAC;IAC5B;IAEA,IAAIF,MAAM,EAAE;MACVA,MAAM,CAAC,CAAC;IACV;EACF,CAAC;EAED,IAAIQ,EAAE,GAAGhB,OAAO,CAAC,0BAA0B,EAAES,YAAY,CAAC;EAE1D,IAAIO,EAAE,EAAE;IACNR,MAAM,GAAGX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