{ // 获取包含Hugging Face文本的span元素 const spans = link.querySelectorAll('span.whitespace-nowrap, span.hidden.whitespace-nowrap'); spans.forEach(span => { if (span.textContent && span.textContent.trim().match(/Hugging\s*Face/i)) { span.textContent = 'AI快站'; } }); }); // 替换logo图片的alt属性 document.querySelectorAll('img[alt*="Hugging"], img[alt*="Face"]').forEach(img => { if (img.alt.match(/Hugging\s*Face/i)) { img.alt = 'AI快站 logo'; } }); } // 替换导航栏中的链接 function replaceNavigationLinks() { // 已替换标记,防止重复运行 if (window._navLinksReplaced) { return; } // 已经替换过的链接集合,防止重复替换 const replacedLinks = new Set(); // 只在导航栏区域查找和替换链接 const headerArea = document.querySelector('header') || document.querySelector('nav'); if (!headerArea) { return; } // 在导航区域内查找链接 const navLinks = headerArea.querySelectorAll('a'); navLinks.forEach(link => { // 如果已经替换过,跳过 if (replacedLinks.has(link)) return; const linkText = link.textContent.trim(); const linkHref = link.getAttribute('href') || ''; // 替换Spaces链接 - 仅替换一次 if ( (linkHref.includes('/spaces') || linkHref === '/spaces' || linkText === 'Spaces' || linkText.match(/^s*Spacess*$/i)) && linkText !== 'OCR模型免费转Markdown' && linkText !== 'OCR模型免费转Markdown' ) { link.textContent = 'OCR模型免费转Markdown'; link.href = 'https://fast360.xyz'; link.setAttribute('target', '_blank'); link.setAttribute('rel', 'noopener noreferrer'); replacedLinks.add(link); } // 删除Posts链接 else if ( (linkHref.includes('/posts') || linkHref === '/posts' || linkText === 'Posts' || linkText.match(/^s*Postss*$/i)) ) { if (link.parentNode) { link.parentNode.removeChild(link); } replacedLinks.add(link); } // 替换Docs链接 - 仅替换一次 else if ( (linkHref.includes('/docs') || linkHref === '/docs' || linkText === 'Docs' || linkText.match(/^s*Docss*$/i)) && linkText !== '模型下载攻略' ) { link.textContent = '模型下载攻略'; link.href = '/'; replacedLinks.add(link); } // 删除Enterprise链接 else if ( (linkHref.includes('/enterprise') || linkHref === '/enterprise' || linkText === 'Enterprise' || linkText.match(/^s*Enterprises*$/i)) ) { if (link.parentNode) { link.parentNode.removeChild(link); } replacedLinks.add(link); } }); // 查找可能嵌套的Spaces和Posts文本 const textNodes = []; function findTextNodes(element) { if (element.nodeType === Node.TEXT_NODE) { const text = element.textContent.trim(); if (text === 'Spaces' || text === 'Posts' || text === 'Enterprise') { textNodes.push(element); } } else { for (const child of element.childNodes) { findTextNodes(child); } } } // 只在导航区域内查找文本节点 findTextNodes(headerArea); // 替换找到的文本节点 textNodes.forEach(node => { const text = node.textContent.trim(); if (text === 'Spaces') { node.textContent = node.textContent.replace(/Spaces/g, 'OCR模型免费转Markdown'); } else if (text === 'Posts') { // 删除Posts文本节点 if (node.parentNode) { node.parentNode.removeChild(node); } } else if (text === 'Enterprise') { // 删除Enterprise文本节点 if (node.parentNode) { node.parentNode.removeChild(node); } } }); // 标记已替换完成 window._navLinksReplaced = true; } // 替换代码区域中的域名 function replaceCodeDomains() { // 特别处理span.hljs-string和span.njs-string元素 document.querySelectorAll('span.hljs-string, span.njs-string, span[class*="hljs-string"], span[class*="njs-string"]').forEach(span => { if (span.textContent && span.textContent.includes('huggingface.co')) { span.textContent = span.textContent.replace(/huggingface.co/g, 'aifasthub.com'); } }); // 替换hljs-string类的span中的域名(移除多余的转义符号) document.querySelectorAll('span.hljs-string, span[class*="hljs-string"]').forEach(span => { if (span.textContent && span.textContent.includes('huggingface.co')) { span.textContent = span.textContent.replace(/huggingface.co/g, 'aifasthub.com'); } }); // 替换pre和code标签中包含git clone命令的域名 document.querySelectorAll('pre, code').forEach(element => { if (element.textContent && element.textContent.includes('git clone')) { const text = element.innerHTML; if (text.includes('huggingface.co')) { element.innerHTML = text.replace(/huggingface.co/g, 'aifasthub.com'); } } }); // 处理特定的命令行示例 document.querySelectorAll('pre, code').forEach(element => { const text = element.innerHTML; if (text.includes('huggingface.co')) { // 针对git clone命令的专门处理 if (text.includes('git clone') || text.includes('GIT_LFS_SKIP_SMUDGE=1')) { element.innerHTML = text.replace(/huggingface.co/g, 'aifasthub.com'); } } }); // 特别处理模型下载页面上的代码片段 document.querySelectorAll('.flex.border-t, .svelte_hydrator, .inline-block').forEach(container => { const content = container.innerHTML; if (content && content.includes('huggingface.co')) { container.innerHTML = content.replace(/huggingface.co/g, 'aifasthub.com'); } }); // 特别处理模型仓库克隆对话框中的代码片段 try { // 查找包含"Clone this model repository"标题的对话框 const cloneDialog = document.querySelector('.svelte_hydration_boundary, [data-target="MainHeader"]'); if (cloneDialog) { // 查找对话框中所有的代码片段和命令示例 const codeElements = cloneDialog.querySelectorAll('pre, code, span'); codeElements.forEach(element => { if (element.textContent && element.textContent.includes('huggingface.co')) { if (element.innerHTML.includes('huggingface.co')) { element.innerHTML = element.innerHTML.replace(/huggingface.co/g, 'aifasthub.com'); } else { element.textContent = element.textContent.replace(/huggingface.co/g, 'aifasthub.com'); } } }); } // 更精确地定位克隆命令中的域名 document.querySelectorAll('[data-target]').forEach(container => { const codeBlocks = container.querySelectorAll('pre, code, span.hljs-string'); codeBlocks.forEach(block => { if (block.textContent && block.textContent.includes('huggingface.co')) { if (block.innerHTML.includes('huggingface.co')) { block.innerHTML = block.innerHTML.replace(/huggingface.co/g, 'aifasthub.com'); } else { block.textContent = block.textContent.replace(/huggingface.co/g, 'aifasthub.com'); } } }); }); } catch (e) { // 错误处理但不打印日志 } } // 当DOM加载完成后执行替换 if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', () => { replaceHeaderBranding(); replaceNavigationLinks(); replaceCodeDomains(); // 只在必要时执行替换 - 3秒后再次检查 setTimeout(() => { if (!window._navLinksReplaced) { console.log('[Client] 3秒后重新检查导航链接'); replaceNavigationLinks(); } }, 3000); }); } else { replaceHeaderBranding(); replaceNavigationLinks(); replaceCodeDomains(); // 只在必要时执行替换 - 3秒后再次检查 setTimeout(() => { if (!window._navLinksReplaced) { console.log('[Client] 3秒后重新检查导航链接'); replaceNavigationLinks(); } }, 3000); } // 增加一个MutationObserver来处理可能的动态元素加载 const observer = new MutationObserver(mutations => { // 检查是否导航区域有变化 const hasNavChanges = mutations.some(mutation => { // 检查是否存在header或nav元素变化 return Array.from(mutation.addedNodes).some(node => { if (node.nodeType === Node.ELEMENT_NODE) { // 检查是否是导航元素或其子元素 if (node.tagName === 'HEADER' || node.tagName === 'NAV' || node.querySelector('header, nav')) { return true; } // 检查是否在导航元素内部 let parent = node.parentElement; while (parent) { if (parent.tagName === 'HEADER' || parent.tagName === 'NAV') { return true; } parent = parent.parentElement; } } return false; }); }); // 只在导航区域有变化时执行替换 if (hasNavChanges) { // 重置替换状态,允许再次替换 window._navLinksReplaced = false; replaceHeaderBranding(); replaceNavigationLinks(); } }); // 开始观察document.body的变化,包括子节点 if (document.body) { observer.observe(document.body, { childList: true, subtree: true }); } else { document.addEventListener('DOMContentLoaded', () => { observer.observe(document.body, { childList: true, subtree: true }); }); } })(); \n \n \"\"\", headers: {'content-type': 'text/html'});\n }\n}\n"},"__index_level_0__":{"kind":"number","value":0,"string":"0"}}},{"rowIdx":146317,"cells":{"repo_id":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages"},"file_path":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/http_multi_server/http_multi_server.dart"},"content":{"kind":"string","value":"// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file\n// for details. All rights reserved. Use of this source code is governed by a\n// BSD-style license that can be found in the LICENSE file.\n\nimport 'dart:async';\nimport 'dart:io';\n\nimport 'package:async/async.dart';\n\nimport 'src/multi_headers.dart';\nimport 'src/utils.dart';\n\n/// The error code for an error caused by a port already being in use.\nfinal _addressInUseErrno = _computeAddressInUseErrno();\nint _computeAddressInUseErrno() {\n if (Platform.isWindows) return 10048;\n if (Platform.isMacOS) return 48;\n assert(Platform.isLinux);\n return 98;\n}\n\n/// An implementation of `dart:io`'s [HttpServer] that wraps multiple servers\n/// and forwards methods to all of them.\n///\n/// This is useful for serving the same application on multiple network\n/// interfaces while still having a unified way of controlling the servers. In\n/// particular, it supports serving on both the IPv4 and IPv6 loopback addresses\n/// using [HttpMultiServer.loopback].\nclass HttpMultiServer extends StreamView implements HttpServer {\n /// The wrapped servers.\n final Set _servers;\n\n /// Returns the default value of the `Server` header for all responses\n /// generated by each server.\n ///\n /// If the wrapped servers have different default values, it's not defined\n /// which value is returned.\n @override\n String get serverHeader => _servers.first.serverHeader;\n @override\n set serverHeader(String value) {\n for (var server in _servers) {\n server.serverHeader = value;\n }\n }\n\n /// Returns the default set of headers added to all response objects.\n ///\n /// If the wrapped servers have different default headers, it's not defined\n /// which header is returned for accessor methods.\n @override\n final HttpHeaders defaultResponseHeaders;\n\n @override\n Duration get idleTimeout => _servers.first.idleTimeout;\n @override\n set idleTimeout(Duration value) {\n for (var server in _servers) {\n server.idleTimeout = value;\n }\n }\n\n @override\n bool get autoCompress => _servers.first.autoCompress;\n @override\n set autoCompress(bool value) {\n for (var server in _servers) {\n server.autoCompress = value;\n }\n }\n\n /// Returns the port that one of the wrapped servers is listening on.\n ///\n /// If the wrapped servers are listening on different ports, it's not defined\n /// which port is returned.\n @override\n int get port => _servers.first.port;\n\n /// Returns the address that one of the wrapped servers is listening on.\n ///\n /// If the wrapped servers are listening on different addresses, it's not\n /// defined which address is returned.\n @override\n InternetAddress get address => _servers.first.address;\n\n @override\n set sessionTimeout(int value) {\n for (var server in _servers) {\n server.sessionTimeout = value;\n }\n }\n\n /// Creates an [HttpMultiServer] wrapping [servers].\n ///\n /// All [servers] should have the same configuration and none should be\n /// listened to when this is called.\n HttpMultiServer(Iterable servers)\n : _servers = servers.toSet(),\n defaultResponseHeaders = MultiHeaders(\n servers.map((server) => server.defaultResponseHeaders)),\n super(StreamGroup.merge(servers));\n\n /// Creates an [HttpServer] listening on all available loopback addresses for\n /// this computer.\n ///\n /// See [HttpServer.bind].\n static Future loopback(int port,\n {int backlog, bool v6Only = false, bool shared = false}) {\n backlog ??= 0;\n\n return _loopback(\n port,\n (address, port) => HttpServer.bind(address, port,\n backlog: backlog, v6Only: v6Only, shared: shared));\n }\n\n /// Like [loopback], but supports HTTPS requests.\n ///\n /// See [HttpServer.bindSecure].\n static Future loopbackSecure(int port, SecurityContext context,\n {int backlog,\n bool v6Only = false,\n bool requestClientCertificate = false,\n bool shared = false}) {\n backlog ??= 0;\n\n return _loopback(\n port,\n (address, port) => HttpServer.bindSecure(address, port, context,\n backlog: backlog,\n v6Only: v6Only,\n shared: shared,\n requestClientCertificate: requestClientCertificate));\n }\n\n /// Bind an [HttpServer] with handling for special addresses 'localhost' and\n /// 'any'.\n ///\n /// For address 'localhost' behaves like [loopback]. For 'any' listens on\n /// [InternetAddress.anyIPv6] which listens on all hostnames for both IPv4 and\n /// IPV6. For any other address forwards directly to `HttpServer.bind` where\n /// the IPvX support may vary.\n ///\n /// See [HttpServer.bind].\n static Future bind(dynamic address, int port,\n {int backlog = 0, bool v6Only = false, bool shared = false}) {\n if (address == 'localhost') {\n return HttpMultiServer.loopback(port,\n backlog: backlog, v6Only: v6Only, shared: shared);\n }\n if (address == 'any') {\n return HttpServer.bind(InternetAddress.anyIPv6, port,\n backlog: backlog, v6Only: v6Only, shared: shared);\n }\n return HttpServer.bind(address, port,\n backlog: backlog, v6Only: v6Only, shared: shared);\n }\n\n /// A helper method for initializing loopback servers.\n ///\n /// [bind] should forward to either [HttpServer.bind] or\n /// [HttpServer.bindSecure].\n static Future _loopback(\n int port, Future Function(InternetAddress, int port) bind,\n [int remainingRetries]) async {\n remainingRetries ??= 5;\n\n if (!await supportsIPv4) {\n return await bind(InternetAddress.loopbackIPv6, port);\n }\n\n var v4Server = await bind(InternetAddress.loopbackIPv4, port);\n if (!await supportsIPv6) return v4Server;\n\n try {\n // Reuse the IPv4 server's port so that if [port] is 0, both servers use\n // the same ephemeral port.\n var v6Server = await bind(InternetAddress.loopbackIPv6, v4Server.port);\n return HttpMultiServer([v4Server, v6Server]);\n } on SocketException catch (error) {\n // If there is already a server listening we'll lose the reference on a\n // rethrow.\n await v4Server.close();\n\n if (error.osError.errorCode != _addressInUseErrno) rethrow;\n if (port != 0) rethrow;\n if (remainingRetries == 0) rethrow;\n\n // A port being available on IPv4 doesn't necessarily mean that the same\n // port is available on IPv6. If it's not (which is rare in practice),\n // we try again until we find one that's available on both.\n return await _loopback(port, bind, remainingRetries - 1);\n }\n }\n\n @override\n Future close({bool force = false}) =>\n Future.wait(_servers.map((server) => server.close(force: force)));\n\n /// Returns an HttpConnectionsInfo object summarizing the total number of\n /// current connections handled by all the servers.\n @override\n HttpConnectionsInfo connectionsInfo() {\n var info = HttpConnectionsInfo();\n for (var server in _servers) {\n var subInfo = server.connectionsInfo();\n info.total += subInfo.total;\n info.active += subInfo.active;\n info.idle += subInfo.idle;\n info.closing += subInfo.closing;\n }\n return info;\n }\n}\n"},"__index_level_0__":{"kind":"number","value":0,"string":"0"}}},{"rowIdx":146318,"cells":{"repo_id":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/http_multi_server"},"file_path":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/http_multi_server/src/multi_headers.dart"},"content":{"kind":"string","value":"// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file\n// for details. All rights reserved. Use of this source code is governed by a\n// BSD-style license that can be found in the LICENSE file.\n\nimport 'dart:io';\n\n/// A class that delegates header access and setting to many [HttpHeaders]\n/// instances.\nclass MultiHeaders implements HttpHeaders {\n /// The wrapped headers.\n final Set _headers;\n\n @override\n bool get chunkedTransferEncoding => _headers.first.chunkedTransferEncoding;\n @override\n set chunkedTransferEncoding(bool value) {\n for (var headers in _headers) {\n headers.chunkedTransferEncoding = value;\n }\n }\n\n @override\n int get contentLength => _headers.first.contentLength;\n @override\n set contentLength(int value) {\n for (var headers in _headers) {\n headers.contentLength = value;\n }\n }\n\n @override\n ContentType get contentType => _headers.first.contentType;\n @override\n set contentType(ContentType value) {\n for (var headers in _headers) {\n headers.contentType = value;\n }\n }\n\n @override\n DateTime get date => _headers.first.date;\n @override\n set date(DateTime value) {\n for (var headers in _headers) {\n headers.date = value;\n }\n }\n\n @override\n DateTime get expires => _headers.first.expires;\n @override\n set expires(DateTime value) {\n for (var headers in _headers) {\n headers.expires = value;\n }\n }\n\n @override\n String get host => _headers.first.host;\n @override\n set host(String value) {\n for (var headers in _headers) {\n headers.host = value;\n }\n }\n\n @override\n DateTime get ifModifiedSince => _headers.first.ifModifiedSince;\n @override\n set ifModifiedSince(DateTime value) {\n for (var headers in _headers) {\n headers.ifModifiedSince = value;\n }\n }\n\n @override\n bool get persistentConnection => _headers.first.persistentConnection;\n @override\n set persistentConnection(bool value) {\n for (var headers in _headers) {\n headers.persistentConnection = value;\n }\n }\n\n @override\n int get port => _headers.first.port;\n @override\n set port(int value) {\n for (var headers in _headers) {\n headers.port = value;\n }\n }\n\n MultiHeaders(Iterable headers) : _headers = headers.toSet();\n\n @override\n void add(String name, Object value, {bool preserveHeaderCase = false}) {\n for (var headers in _headers) {\n headers.add(name, value);\n }\n }\n\n @override\n void forEach(void Function(String name, List values) f) =>\n _headers.first.forEach(f);\n\n @override\n void noFolding(String name) {\n for (var headers in _headers) {\n headers.noFolding(name);\n }\n }\n\n @override\n void remove(String name, Object value) {\n for (var headers in _headers) {\n headers.remove(name, value);\n }\n }\n\n @override\n void removeAll(String name) {\n for (var headers in _headers) {\n headers.removeAll(name);\n }\n }\n\n @override\n void set(String name, Object value, {bool preserveHeaderCase = false}) {\n for (var headers in _headers) {\n headers.set(name, value);\n }\n }\n\n @override\n String value(String name) => _headers.first.value(name);\n\n @override\n List operator [](String name) => _headers.first[name];\n\n @override\n void clear() {\n for (var headers in _headers) {\n headers.clear();\n }\n }\n}\n"},"__index_level_0__":{"kind":"number","value":0,"string":"0"}}},{"rowIdx":146319,"cells":{"repo_id":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/http_multi_server"},"file_path":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/http_multi_server/src/utils.dart"},"content":{"kind":"string","value":"// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file\n// for details. All rights reserved. Use of this source code is governed by a\n// BSD-style license that can be found in the LICENSE file.\n\nimport 'dart:async';\nimport 'dart:io';\n\n/// Returns whether this computer supports binding to IPv6 addresses.\nfinal Future supportsIPv6 = () async {\n try {\n var socket = await ServerSocket.bind(InternetAddress.loopbackIPv6, 0);\n await socket.close();\n return true;\n } on SocketException catch (_) {\n return false;\n }\n}();\n\n/// Returns whether this computer supports binding to IPv4 addresses.\nfinal Future supportsIPv4 = () async {\n try {\n var socket = await ServerSocket.bind(InternetAddress.loopbackIPv4, 0);\n await socket.close();\n return true;\n } on SocketException catch (_) {\n return false;\n }\n}();\n"},"__index_level_0__":{"kind":"number","value":0,"string":"0"}}},{"rowIdx":146320,"cells":{"repo_id":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages"},"file_path":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/protobuf.dart"},"content":{"kind":"string","value":"// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file\n// for details. All rights reserved. Use of this source code is governed by a\n// BSD-style license that can be found in the LICENSE file.\n\nlibrary protobuf;\n\nimport 'dart:collection' show ListBase, MapBase;\nimport 'dart:convert'\n show base64Decode, base64Encode, jsonEncode, jsonDecode, Utf8Codec;\nimport 'dart:math' as math;\nimport 'dart:typed_data' show TypedData, Uint8List, ByteData, Endian;\n\nimport 'package:fixnum/fixnum.dart' show Int64;\n\nimport 'src/protobuf/json_parsing_context.dart';\nimport 'src/protobuf/permissive_compare.dart';\nimport 'src/protobuf/type_registry.dart';\nexport 'src/protobuf/type_registry.dart' show TypeRegistry;\n\npart 'src/protobuf/coded_buffer.dart';\npart 'src/protobuf/coded_buffer_reader.dart';\npart 'src/protobuf/coded_buffer_writer.dart';\npart 'src/protobuf/builder_info.dart';\npart 'src/protobuf/event_plugin.dart';\npart 'src/protobuf/exceptions.dart';\npart 'src/protobuf/extension.dart';\npart 'src/protobuf/extension_field_set.dart';\npart 'src/protobuf/extension_registry.dart';\npart 'src/protobuf/field_error.dart';\npart 'src/protobuf/field_info.dart';\npart 'src/protobuf/field_set.dart';\npart 'src/protobuf/field_type.dart';\npart 'src/protobuf/generated_message.dart';\npart 'src/protobuf/generated_service.dart';\npart 'src/protobuf/json.dart';\npart 'src/protobuf/pb_list.dart';\npart 'src/protobuf/pb_map.dart';\npart 'src/protobuf/protobuf_enum.dart';\npart 'src/protobuf/proto3_json.dart';\npart 'src/protobuf/readonly_message.dart';\npart 'src/protobuf/rpc_client.dart';\npart 'src/protobuf/unknown_field_set.dart';\npart 'src/protobuf/utils.dart';\npart 'src/protobuf/unpack.dart';\npart 'src/protobuf/wire_format.dart';\n\n// TODO(sra): Remove this method when clients upgrade to protoc 0.3.5\nInt64 makeLongInt(int n) => Int64(n);\n\n// TODO(sra): Use Int64.parse() when available - see http://dartbug.com/21915.\nInt64 parseLongInt(String text) {\n if (text.startsWith('0x')) return Int64.parseHex(text.substring(2));\n if (text.startsWith('+0x')) return Int64.parseHex(text.substring(3));\n if (text.startsWith('-0x')) return -Int64.parseHex(text.substring(3));\n return Int64.parseInt(text);\n}\n\nconst _utf8 = Utf8Codec(allowMalformed: true);\n"},"__index_level_0__":{"kind":"number","value":0,"string":"0"}}},{"rowIdx":146321,"cells":{"repo_id":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages"},"file_path":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/meta.dart"},"content":{"kind":"string","value":"// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file\n// for details. All rights reserved. Use of this source code is governed by a\n// BSD-style license that can be found in the LICENSE file.\n\n/// Provides metadata about GeneratedMessage and ProtobufEnum to\n/// dart-protoc-plugin. (Experimental API; subject to change.)\nlibrary protobuf.meta;\n\n// List of names which cannot be used in a subclass of GeneratedMessage.\nconst GeneratedMessage_reservedNames = [\n '==',\n 'GeneratedMessage',\n 'Object',\n 'addExtension',\n 'check',\n 'clear',\n 'clearExtension',\n 'clearField',\n 'clone',\n 'copyWith',\n 'createEmptyInstance',\n 'createMapField',\n 'createRepeatedField',\n 'eventPlugin',\n 'extensionsAreInitialized',\n 'freeze',\n 'fromBuffer',\n 'fromJson',\n 'getDefaultForField',\n 'getExtension',\n 'getField',\n 'getFieldOrNull',\n 'getTagNumber',\n 'hasExtension',\n 'hasField',\n 'hasRequiredFields',\n 'hashCode',\n 'info_',\n 'isFrozen',\n 'isInitialized',\n 'mergeFromBuffer',\n 'mergeFromCodedBufferReader',\n 'mergeFromJson',\n 'mergeFromJsonMap',\n 'mergeFromMessage',\n 'mergeFromProto3Json',\n 'mergeUnknownFields',\n 'noSuchMethod',\n 'runtimeType',\n 'setExtension',\n 'setField',\n 'toBuilder',\n 'toDebugString',\n 'toProto3Json',\n 'toString',\n 'unknownFields',\n 'writeToBuffer',\n 'writeToCodedBufferWriter',\n 'writeToJson',\n 'writeToJsonMap',\n r'$_defaultFor',\n r'$_ensure',\n r'$_get',\n r'$_getI64',\n r'$_getList',\n r'$_getMap',\n r'$_getN',\n r'$_getB',\n r'$_getBF',\n r'$_getI',\n r'$_getIZ',\n r'$_getS',\n r'$_getSZ',\n r'$_has',\n r'$_setBool',\n r'$_setBytes',\n r'$_setDouble',\n r'$_setFloat',\n r'$_setInt64',\n r'$_setSignedInt32',\n r'$_setString',\n r'$_setUnsignedInt32',\n r'$_whichOneof',\n];\n\n// List of names which cannot be used in a subclass of ProtobufEnum.\nconst ProtobufEnum_reservedNames = [\n '==',\n 'Object',\n 'ProtobufEnum',\n 'hashCode',\n 'initByValue',\n 'noSuchMethod',\n 'runtimeType',\n 'toString'\n];\n"},"__index_level_0__":{"kind":"number","value":0,"string":"0"}}},{"rowIdx":146322,"cells":{"repo_id":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src"},"file_path":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src/protobuf/extension.dart"},"content":{"kind":"string","value":"// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file\n// for details. All rights reserved. Use of this source code is governed by a\n// BSD-style license that can be found in the LICENSE file.\n\npart of protobuf;\n\n/// An object representing an extension field.\nclass Extension extends FieldInfo {\n final String extendee;\n\n Extension(this.extendee, String name, int tagNumber, int fieldType,\n {dynamic defaultOrMaker,\n CreateBuilderFunc subBuilder,\n ValueOfFunc valueOf,\n List enumValues,\n String protoName})\n : super(name, tagNumber, null, fieldType,\n defaultOrMaker: defaultOrMaker,\n subBuilder: subBuilder,\n valueOf: valueOf,\n enumValues: enumValues,\n protoName: protoName);\n\n Extension.repeated(this.extendee, String name, int tagNumber, int fieldType,\n {CheckFunc check,\n CreateBuilderFunc subBuilder,\n ValueOfFunc valueOf,\n List enumValues,\n String protoName})\n : super.repeated(name, tagNumber, null, fieldType, check, subBuilder,\n valueOf: valueOf, enumValues: enumValues, protoName: protoName);\n\n @override\n int get hashCode => extendee.hashCode * 31 + tagNumber;\n\n @override\n bool operator ==(other) {\n if (other is! Extension) return false;\n\n Extension o = other;\n return extendee == o.extendee && tagNumber == o.tagNumber;\n }\n}\n"},"__index_level_0__":{"kind":"number","value":0,"string":"0"}}},{"rowIdx":146323,"cells":{"repo_id":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src"},"file_path":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src/protobuf/pb_list.dart"},"content":{"kind":"string","value":"// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file\n// for details. All rights reserved. Use of this source code is governed by a\n// BSD-style license that can be found in the LICENSE file.\n\npart of protobuf;\n\ntypedef CheckFunc = void Function(E x);\n\nclass FrozenPbList extends PbListBase {\n FrozenPbList._(List wrappedList) : super._(wrappedList);\n\n factory FrozenPbList.from(PbList other) =>\n FrozenPbList._(other._wrappedList);\n\n UnsupportedError _unsupported(String method) =>\n UnsupportedError('Cannot call $method on an unmodifiable list');\n\n @override\n void operator []=(int index, E value) => throw _unsupported('set');\n @override\n set length(int newLength) => throw _unsupported('set length');\n @override\n void setAll(int at, Iterable iterable) => throw _unsupported('setAll');\n @override\n void add(E value) => throw _unsupported('add');\n @override\n void addAll(Iterable iterable) => throw _unsupported('addAll');\n @override\n void insert(int index, E element) => throw _unsupported('insert');\n @override\n void insertAll(int at, Iterable iterable) =>\n throw _unsupported('insertAll');\n @override\n bool remove(Object element) => throw _unsupported('remove');\n @override\n void removeWhere(bool Function(E element) test) =>\n throw _unsupported('removeWhere');\n @override\n void retainWhere(bool Function(E element) test) =>\n throw _unsupported('retainWhere');\n @override\n void sort([Comparator compare]) => throw _unsupported('sort');\n @override\n void shuffle([math.Random random]) => throw _unsupported('shuffle');\n @override\n void clear() => throw _unsupported('clear');\n @override\n E removeAt(int index) => throw _unsupported('removeAt');\n @override\n E removeLast() => throw _unsupported('removeLast');\n @override\n void setRange(int start, int end, Iterable iterable,\n [int skipCount = 0]) =>\n throw _unsupported('setRange');\n @override\n void removeRange(int start, int end) => throw _unsupported('removeRange');\n @override\n void replaceRange(int start, int end, Iterable iterable) =>\n throw _unsupported('replaceRange');\n @override\n void fillRange(int start, int end, [E fillValue]) =>\n throw _unsupported('fillRange');\n}\n\nclass PbList extends PbListBase {\n PbList({check = _checkNotNull}) : super._noList(check: check);\n\n PbList.from(List from) : super._from(from);\n\n @Deprecated('Instead use the default constructor with a check function.'\n 'This constructor will be removed in the next major version.')\n PbList.forFieldType(int fieldType)\n : super._noList(check: getCheckFunction(fieldType));\n\n /// Freezes the list by converting to [FrozenPbList].\n FrozenPbList toFrozenPbList() => FrozenPbList.from(this);\n\n /// Adds [value] at the end of the list, extending the length by one.\n /// Throws an [UnsupportedError] if the list is not extendable.\n @override\n void add(E value) {\n check(value);\n _wrappedList.add(value);\n }\n\n /// Appends all elements of the [collection] to the end of list.\n /// Extends the length of the list by the length of [collection].\n /// Throws an [UnsupportedError] if the list is not extendable.\n @override\n void addAll(Iterable collection) {\n collection.forEach(check);\n _wrappedList.addAll(collection);\n }\n\n /// Returns an [Iterable] of the objects in this list in reverse order.\n @override\n Iterable get reversed => _wrappedList.reversed;\n\n /// Sorts this list according to the order specified by the [compare]\n /// function.\n @override\n void sort([int Function(E a, E b) compare]) => _wrappedList.sort(compare);\n\n /// Shuffles the elements of this list randomly.\n @override\n void shuffle([math.Random random]) => _wrappedList.shuffle(random);\n\n /// Removes all objects from this list; the length of the list becomes zero.\n @override\n void clear() => _wrappedList.clear();\n\n /// Inserts a new element in the list.\n /// The element must be valid (and not nullable) for the PbList type.\n @override\n void insert(int index, E element) {\n check(element);\n _wrappedList.insert(index, element);\n }\n\n /// Inserts all elements of [iterable] at position [index] in the list.\n ///\n /// Elements in [iterable] must be valid and not nullable for the PbList type.\n @override\n void insertAll(int index, Iterable iterable) {\n iterable.forEach(check);\n _wrappedList.insertAll(index, iterable);\n }\n\n /// Overwrites elements of `this` with elements of [iterable] starting at\n /// position [index] in the list.\n ///\n /// Elements in [iterable] must be valid and not nullable for the PbList type.\n @override\n void setAll(int index, Iterable iterable) {\n iterable.forEach(check);\n _wrappedList.setAll(index, iterable);\n }\n\n /// Removes the first occurrence of [value] from this list.\n @override\n bool remove(Object value) => _wrappedList.remove(value);\n\n /// Removes the object at position [index] from this list.\n @override\n E removeAt(int index) => _wrappedList.removeAt(index);\n\n /// Pops and returns the last object in this list.\n @override\n E removeLast() => _wrappedList.removeLast();\n\n /// Removes all objects from this list that satisfy [test].\n @override\n void removeWhere(bool Function(E element) test) =>\n _wrappedList.removeWhere(test);\n\n /// Removes all objects from this list that fail to satisfy [test].\n @override\n void retainWhere(bool Function(E element) test) =>\n _wrappedList.retainWhere(test);\n\n /// Copies [:end - start:] elements of the [from] array, starting from\n /// [skipCount], into [:this:], starting at [start].\n /// Throws an [UnsupportedError] if the list is not extendable.\n @override\n void setRange(int start, int end, Iterable from, [int skipCount = 0]) {\n // NOTE: In case `take()` returns less than `end - start` elements, the\n // _wrappedList will fail with a `StateError`.\n from.skip(skipCount).take(end - start).forEach(check);\n _wrappedList.setRange(start, end, from, skipCount);\n }\n\n /// Removes the objects in the range [start] inclusive to [end] exclusive.\n @override\n void removeRange(int start, int end) => _wrappedList.removeRange(start, end);\n\n /// Sets the objects in the range [start] inclusive to [end] exclusive to the\n /// given [fillValue].\n @override\n void fillRange(int start, int end, [E fillValue]) {\n check(fillValue);\n _wrappedList.fillRange(start, end, fillValue);\n }\n\n /// Removes the objects in the range [start] inclusive to [end] exclusive and\n /// inserts the contents of [replacement] in its place.\n @override\n void replaceRange(int start, int end, Iterable replacement) {\n final values = replacement.toList();\n replacement.forEach(check);\n _wrappedList.replaceRange(start, end, values);\n }\n}\n\nabstract class PbListBase extends ListBase {\n final List _wrappedList;\n final CheckFunc check;\n\n PbListBase._(this._wrappedList, {this.check = _checkNotNull});\n\n PbListBase._noList({this.check = _checkNotNull}) : _wrappedList = [] {\n assert(check != null);\n }\n\n PbListBase._from(List from)\n // TODO(sra): Should this be validated?\n : _wrappedList = List.from(from),\n check = _checkNotNull;\n\n @override\n bool operator ==(other) =>\n (other is PbListBase) && _areListsEqual(other, this);\n\n @override\n int get hashCode => _HashUtils._hashObjects(_wrappedList);\n\n /// Returns an [Iterator] for the list.\n @override\n Iterator get iterator => _wrappedList.iterator;\n\n /// Returns a new lazy [Iterable] with elements that are created by calling\n /// `f` on each element of this `PbListBase` in iteration order.\n @override\n Iterable map(T Function(E e) f) => _wrappedList.map(f);\n\n /// Returns a new lazy [Iterable] with all elements that satisfy the predicate\n /// [test].\n @override\n Iterable where(bool Function(E element) test) => _wrappedList.where(test);\n\n /// Expands each element of this [Iterable] into zero or more elements.\n @override\n Iterable expand(Iterable Function(E element) f) =>\n _wrappedList.expand(f);\n\n /// Returns true if the collection contains an element equal to [element].\n @override\n bool contains(Object element) => _wrappedList.contains(element);\n\n /// Applies the function [f] to each element of this list in iteration order.\n @override\n void forEach(void Function(E element) f) {\n _wrappedList.forEach(f);\n }\n\n /// Reduces a collection to a single value by iteratively combining elements\n /// of the collection using the provided function.\n @override\n E reduce(E Function(E value, E element) combine) =>\n _wrappedList.reduce(combine);\n\n /// Reduces a collection to a single value by iteratively combining each\n /// element of the collection with an existing value.\n @override\n T fold(T initialValue, T Function(T previousValue, E element) combine) =>\n _wrappedList.fold(initialValue, combine);\n\n /// Checks whether every element of this iterable satisfies [test].\n @override\n bool every(bool Function(E element) test) => _wrappedList.every(test);\n\n /// Converts each element to a [String] and concatenates the strings.\n @override\n String join([String separator = '']) => _wrappedList.join(separator);\n\n /// Checks whether any element of this iterable satisfies [test].\n @override\n bool any(bool Function(E element) test) => _wrappedList.any(test);\n\n /// Creates a [List] containing the elements of this [Iterable].\n @override\n List toList({bool growable = true}) =>\n _wrappedList.toList(growable: growable);\n\n /// Creates a [Set] containing the same elements as this iterable.\n @override\n Set toSet() => _wrappedList.toSet();\n\n /// Returns `true` if there are no elements in this collection.\n @override\n bool get isEmpty => _wrappedList.isEmpty;\n\n /// Returns `true` if there is at least one element in this collection.\n @override\n bool get isNotEmpty => _wrappedList.isNotEmpty;\n\n /// Returns a lazy iterable of the [count] first elements of this iterable.\n @override\n Iterable take(int count) => _wrappedList.take(count);\n\n /// Returns a lazy iterable of the leading elements satisfying [test].\n @override\n Iterable takeWhile(bool Function(E value) test) =>\n _wrappedList.takeWhile(test);\n\n /// Returns an [Iterable] that provides all but the first [count] elements.\n @override\n Iterable skip(int count) => _wrappedList.skip(count);\n\n /// Returns an `Iterable` that skips leading elements while [test] is\n /// satisfied.\n @override\n Iterable skipWhile(bool Function(E value) test) =>\n _wrappedList.skipWhile(test);\n\n /// Returns the first element.\n @override\n E get first => _wrappedList.first;\n\n /// Returns the last element.\n @override\n E get last => _wrappedList.last;\n\n /// Checks that this iterable has only one element, and returns that element.\n @override\n E get single => _wrappedList.single;\n\n /// Returns the first element that satisfies the given predicate [test].\n @override\n E firstWhere(bool Function(E element) test, {E Function() orElse}) =>\n _wrappedList.firstWhere(test, orElse: orElse);\n\n /// Returns the last element that satisfies the given predicate [test].\n @override\n E lastWhere(bool Function(E element) test, {E Function() orElse}) =>\n _wrappedList.lastWhere(test, orElse: orElse);\n\n /// Returns the single element that satisfies [test].\n // TODO(jakobr): Implement once Dart 2 corelib changes have landed.\n //E singleWhere(bool test(E element), {E orElse()}) =>\n // _wrappedList.singleWhere(test, orElse: orElse);\n\n /// Returns the [index]th element.\n @override\n E elementAt(int index) => _wrappedList.elementAt(index);\n\n /// Returns a string representation of (some of) the elements of `this`.\n @override\n String toString() => _wrappedList.toString();\n\n /// Returns the element at the given [index] in the list or throws an\n /// [IndexOutOfRangeException] if [index] is out of bounds.\n @override\n E operator [](int index) => _wrappedList[index];\n\n /// Returns the number of elements in this collection.\n @override\n int get length => _wrappedList.length;\n\n // TODO(jakobr): E instead of Object once dart-lang/sdk#31311 is fixed.\n /// Returns the first index of [element] in this list.\n @override\n int indexOf(Object element, [int start = 0]) =>\n _wrappedList.indexOf(element, start);\n\n // TODO(jakobr): E instead of Object once dart-lang/sdk#31311 is fixed.\n /// Returns the last index of [element] in this list.\n @override\n int lastIndexOf(Object element, [int start]) =>\n _wrappedList.lastIndexOf(element, start);\n\n /// Returns a new list containing the objects from [start] inclusive to [end]\n /// exclusive.\n @override\n List sublist(int start, [int end]) => _wrappedList.sublist(start, end);\n\n /// Returns an [Iterable] that iterates over the objects in the range [start]\n /// inclusive to [end] exclusive.\n @override\n Iterable getRange(int start, int end) => _wrappedList.getRange(start, end);\n\n /// Returns an unmodifiable [Map] view of `this`.\n @override\n Map asMap() => _wrappedList.asMap();\n\n /// Sets the entry at the given [index] in the list to [value].\n /// Throws an [IndexOutOfRangeException] if [index] is out of bounds.\n @override\n void operator []=(int index, E value) {\n check(value);\n _wrappedList[index] = value;\n }\n\n /// Unsupported -- violated non-null constraint imposed by protobufs.\n ///\n /// Changes the length of the list. If [newLength] is greater than the current\n /// [length], entries are initialized to [:null:]. Throws an\n /// [UnsupportedError] if the list is not extendable.\n @override\n set length(int newLength) {\n if (newLength > length) {\n throw UnsupportedError('Extending protobuf lists is not supported');\n }\n _wrappedList.length = newLength;\n }\n}\n"},"__index_level_0__":{"kind":"number","value":0,"string":"0"}}},{"rowIdx":146324,"cells":{"repo_id":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src"},"file_path":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src/protobuf/pb_map.dart"},"content":{"kind":"string","value":"// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file\n// for details. All rights reserved. Use of this source code is governed by a\n// BSD-style license that can be found in the LICENSE file.\n\npart of protobuf;\n\nclass PbMap extends MapBase {\n final int keyFieldType;\n final int valueFieldType;\n\n static const int _keyFieldNumber = 1;\n static const int _valueFieldNumber = 2;\n\n final Map _wrappedMap;\n final BuilderInfo _entryBuilderInfo;\n\n bool _isReadonly = false;\n _FieldSet _entryFieldSet() => _FieldSet(null, _entryBuilderInfo, null);\n\n PbMap(this.keyFieldType, this.valueFieldType, this._entryBuilderInfo)\n : _wrappedMap = {};\n\n PbMap.unmodifiable(PbMap other)\n : keyFieldType = other.keyFieldType,\n valueFieldType = other.valueFieldType,\n _wrappedMap = Map.unmodifiable(other._wrappedMap),\n _entryBuilderInfo = other._entryBuilderInfo,\n _isReadonly = other._isReadonly;\n\n @override\n V operator [](Object key) => _wrappedMap[key];\n\n @override\n void operator []=(K key, V value) {\n if (_isReadonly) {\n throw UnsupportedError('Attempted to change a read-only map field');\n }\n _checkNotNull(key);\n _checkNotNull(value);\n _wrappedMap[key] = value;\n }\n\n /// A [PbMap] is equal to another [PbMap] with equal key/value\n /// pairs in any order.\n @override\n bool operator ==(other) {\n if (identical(other, this)) {\n return true;\n }\n if (other is! PbMap) {\n return false;\n }\n if (other.length != length) {\n return false;\n }\n for (final key in keys) {\n if (!other.containsKey(key)) {\n return false;\n }\n }\n for (final key in keys) {\n if (other[key] != this[key]) {\n return false;\n }\n }\n return true;\n }\n\n /// A [PbMap] is equal to another [PbMap] with equal key/value\n /// pairs in any order. Then, the `hashCode` is guaranteed to be the same.\n @override\n int get hashCode {\n return _wrappedMap.entries\n .fold(0, (h, entry) => h ^ _HashUtils._hash2(entry.key, entry.value));\n }\n\n @override\n void clear() {\n if (_isReadonly) {\n throw UnsupportedError('Attempted to change a read-only map field');\n }\n _wrappedMap.clear();\n }\n\n @override\n Iterable get keys => _wrappedMap.keys;\n\n @override\n V remove(Object key) {\n if (_isReadonly) {\n throw UnsupportedError('Attempted to change a read-only map field');\n }\n return _wrappedMap.remove(key);\n }\n\n @Deprecated('This function was not intended to be public. '\n 'It will be removed from the public api in next major version. ')\n void add(CodedBufferReader input, [ExtensionRegistry registry]) {\n _mergeEntry(input, registry);\n }\n\n void _mergeEntry(CodedBufferReader input, [ExtensionRegistry registry]) {\n var length = input.readInt32();\n var oldLimit = input._currentLimit;\n input._currentLimit = input._bufferPos + length;\n var entryFieldSet = _entryFieldSet();\n _mergeFromCodedBufferReader(entryFieldSet, input, registry);\n input.checkLastTagWas(0);\n input._currentLimit = oldLimit;\n var key = entryFieldSet._$get(0, null);\n var value = entryFieldSet._$get(1, null);\n _wrappedMap[key] = value;\n }\n\n void _checkNotNull(Object val) {\n if (val == null) {\n throw ArgumentError(\"Can't add a null to a map field\");\n }\n }\n\n PbMap freeze() {\n _isReadonly = true;\n if (_isGroupOrMessage(valueFieldType)) {\n for (var subMessage in values as Iterable) {\n subMessage.freeze();\n }\n }\n return this;\n }\n}\n"},"__index_level_0__":{"kind":"number","value":0,"string":"0"}}},{"rowIdx":146325,"cells":{"repo_id":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src"},"file_path":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src/protobuf/exceptions.dart"},"content":{"kind":"string","value":"// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file\n// for details. All rights reserved. Use of this source code is governed by a\n// BSD-style license that can be found in the LICENSE file.\n\npart of protobuf;\n\nclass InvalidProtocolBufferException implements Exception {\n final String message;\n\n InvalidProtocolBufferException._(this.message);\n\n @override\n String toString() => 'InvalidProtocolBufferException: $message';\n\n InvalidProtocolBufferException.invalidEndTag()\n : this._('Protocol message end-group tag did not match expected tag.');\n\n InvalidProtocolBufferException.invalidTag()\n : this._('Protocol message contained an invalid tag (zero).');\n\n InvalidProtocolBufferException.invalidWireType()\n : this._('Protocol message tag had invalid wire type.');\n\n InvalidProtocolBufferException.malformedVarint()\n : this._('CodedBufferReader encountered a malformed varint.');\n\n InvalidProtocolBufferException.recursionLimitExceeded() : this._('''\nProtocol message had too many levels of nesting. May be malicious.\nUse CodedBufferReader.setRecursionLimit() to increase the depth limit.\n''');\n\n InvalidProtocolBufferException.truncatedMessage() : this._('''\nWhile parsing a protocol message, the input ended unexpectedly\nin the middle of a field. This could mean either than the\ninput has been truncated or that an embedded message\nmisreported its own length.\n''');\n\n InvalidProtocolBufferException.wrongAnyMessage(\n String anyTypeName, unpackerTypeName)\n : this._('''\nThe type of the Any message ($anyTypeName) does not match the given\nunpacker ($unpackerTypeName).\n''');\n}\n"},"__index_level_0__":{"kind":"number","value":0,"string":"0"}}},{"rowIdx":146326,"cells":{"repo_id":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src"},"file_path":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src/protobuf/coded_buffer_reader.dart"},"content":{"kind":"string","value":"// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file\n// for details. All rights reserved. Use of this source code is governed by a\n// BSD-style license that can be found in the LICENSE file.\n\npart of protobuf;\n\nclass CodedBufferReader {\n static const int DEFAULT_RECURSION_LIMIT = 64;\n static const int DEFAULT_SIZE_LIMIT = 64 << 20;\n\n final Uint8List _buffer;\n int _bufferPos = 0;\n int _currentLimit = -1;\n int _lastTag = 0;\n int _recursionDepth = 0;\n final int _recursionLimit;\n final int _sizeLimit;\n\n CodedBufferReader(List buffer,\n {int recursionLimit = DEFAULT_RECURSION_LIMIT,\n int sizeLimit = DEFAULT_SIZE_LIMIT})\n : _buffer = buffer is Uint8List ? buffer : Uint8List.fromList(buffer),\n _recursionLimit = recursionLimit,\n _sizeLimit = math.min(sizeLimit, buffer.length) {\n _currentLimit = _sizeLimit;\n }\n\n void checkLastTagWas(int value) {\n if (_lastTag != value) {\n throw InvalidProtocolBufferException.invalidEndTag();\n }\n }\n\n bool isAtEnd() => _bufferPos >= _currentLimit;\n\n void _withLimit(int byteLimit, callback) {\n if (byteLimit < 0) {\n throw ArgumentError(\n 'CodedBufferReader encountered an embedded string or message'\n ' which claimed to have negative size.');\n }\n byteLimit += _bufferPos;\n var oldLimit = _currentLimit;\n if ((oldLimit != -1 && byteLimit > oldLimit) || byteLimit > _sizeLimit) {\n throw InvalidProtocolBufferException.truncatedMessage();\n }\n _currentLimit = byteLimit;\n callback();\n _currentLimit = oldLimit;\n }\n\n void _checkLimit(int increment) {\n assert(_currentLimit != -1);\n _bufferPos += increment;\n if (_bufferPos > _currentLimit) {\n throw InvalidProtocolBufferException.truncatedMessage();\n }\n }\n\n void readGroup(int fieldNumber, GeneratedMessage message,\n ExtensionRegistry extensionRegistry) {\n if (_recursionDepth >= _recursionLimit) {\n throw InvalidProtocolBufferException.recursionLimitExceeded();\n }\n ++_recursionDepth;\n message.mergeFromCodedBufferReader(this, extensionRegistry);\n checkLastTagWas(makeTag(fieldNumber, WIRETYPE_END_GROUP));\n --_recursionDepth;\n }\n\n UnknownFieldSet readUnknownFieldSetGroup(int fieldNumber) {\n if (_recursionDepth >= _recursionLimit) {\n throw InvalidProtocolBufferException.recursionLimitExceeded();\n }\n ++_recursionDepth;\n var unknownFieldSet = UnknownFieldSet();\n unknownFieldSet.mergeFromCodedBufferReader(this);\n checkLastTagWas(makeTag(fieldNumber, WIRETYPE_END_GROUP));\n --_recursionDepth;\n return unknownFieldSet;\n }\n\n void readMessage(\n GeneratedMessage message, ExtensionRegistry extensionRegistry) {\n var length = readInt32();\n if (_recursionDepth >= _recursionLimit) {\n throw InvalidProtocolBufferException.recursionLimitExceeded();\n }\n if (length < 0) {\n throw ArgumentError(\n 'CodedBufferReader encountered an embedded string or message'\n ' which claimed to have negative size.');\n }\n\n var oldLimit = _currentLimit;\n _currentLimit = _bufferPos + length;\n if (_currentLimit > oldLimit) {\n throw InvalidProtocolBufferException.truncatedMessage();\n }\n ++_recursionDepth;\n message.mergeFromCodedBufferReader(this, extensionRegistry);\n checkLastTagWas(0);\n --_recursionDepth;\n _currentLimit = oldLimit;\n }\n\n int readEnum() => readInt32();\n int readInt32() => _readRawVarint32(true);\n Int64 readInt64() => _readRawVarint64();\n int readUint32() => _readRawVarint32(false);\n Int64 readUint64() => _readRawVarint64();\n int readSint32() => _decodeZigZag32(readUint32());\n Int64 readSint64() => _decodeZigZag64(readUint64());\n int readFixed32() => _readByteData(4).getUint32(0, Endian.little);\n Int64 readFixed64() => readSfixed64();\n int readSfixed32() => _readByteData(4).getInt32(0, Endian.little);\n Int64 readSfixed64() {\n var data = _readByteData(8);\n var view = Uint8List.view(data.buffer, data.offsetInBytes, 8);\n return Int64.fromBytes(view);\n }\n\n bool readBool() => _readRawVarint32(true) != 0;\n List readBytes() {\n var length = readInt32();\n _checkLimit(length);\n return Uint8List.view(\n _buffer.buffer, _buffer.offsetInBytes + _bufferPos - length, length);\n }\n\n String readString() => _utf8.decode(readBytes());\n double readFloat() => _readByteData(4).getFloat32(0, Endian.little);\n double readDouble() => _readByteData(8).getFloat64(0, Endian.little);\n\n int readTag() {\n if (isAtEnd()) {\n _lastTag = 0;\n return 0;\n }\n\n _lastTag = readUint32();\n if (getTagFieldNumber(_lastTag) == 0) {\n throw InvalidProtocolBufferException.invalidTag();\n }\n return _lastTag;\n }\n\n static int _decodeZigZag32(int value) {\n if ((value & 0x1) == 1) {\n return -(value >> 1) - 1;\n } else {\n return value >> 1;\n }\n }\n\n static Int64 _decodeZigZag64(Int64 value) {\n if ((value & 0x1) == 1) value = -value;\n return value >> 1;\n }\n\n int _readRawVarintByte() {\n _checkLimit(1);\n return _buffer[_bufferPos - 1];\n }\n\n int _readRawVarint32(bool signed) {\n // Read up to 10 bytes.\n // We use a local [bufferPos] variable to avoid repeatedly loading/store the\n // this._bufferpos field.\n var bufferPos = _bufferPos;\n var bytes = _currentLimit - bufferPos;\n if (bytes > 10) bytes = 10;\n var result = 0;\n for (var i = 0; i < bytes; i++) {\n var byte = _buffer[bufferPos++];\n result |= (byte & 0x7f) << (i * 7);\n if ((byte & 0x80) == 0) {\n result &= 0xffffffff;\n _bufferPos = bufferPos;\n return signed ? result - 2 * (0x80000000 & result) : result;\n }\n }\n _bufferPos = bufferPos;\n throw InvalidProtocolBufferException.malformedVarint();\n }\n\n Int64 _readRawVarint64() {\n var lo = 0;\n var hi = 0;\n\n // Read low 28 bits.\n for (var i = 0; i < 4; i++) {\n var byte = _readRawVarintByte();\n lo |= (byte & 0x7f) << (i * 7);\n if ((byte & 0x80) == 0) return Int64.fromInts(hi, lo);\n }\n\n // Read middle 7 bits: 4 low belong to low part above,\n // 3 remaining belong to hi.\n var byte = _readRawVarintByte();\n lo |= (byte & 0xf) << 28;\n hi = (byte >> 4) & 0x7;\n if ((byte & 0x80) == 0) {\n return Int64.fromInts(hi, lo);\n }\n\n // Read remaining bits of hi.\n for (var i = 0; i < 5; i++) {\n var byte = _readRawVarintByte();\n hi |= (byte & 0x7f) << ((i * 7) + 3);\n if ((byte & 0x80) == 0) return Int64.fromInts(hi, lo);\n }\n throw InvalidProtocolBufferException.malformedVarint();\n }\n\n ByteData _readByteData(int sizeInBytes) {\n _checkLimit(sizeInBytes);\n return ByteData.view(_buffer.buffer,\n _buffer.offsetInBytes + _bufferPos - sizeInBytes, sizeInBytes);\n }\n}\n"},"__index_level_0__":{"kind":"number","value":0,"string":"0"}}},{"rowIdx":146327,"cells":{"repo_id":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src"},"file_path":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src/protobuf/readonly_message.dart"},"content":{"kind":"string","value":"// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file\n// for details. All rights reserved. Use of this source code is governed by a\n// BSD-style license that can be found in the LICENSE file.\n\npart of protobuf;\n\n/// Modifies a GeneratedMessage so that it's read-only.\nabstract class ReadonlyMessageMixin {\n BuilderInfo get info_;\n\n void addExtension(Extension extension, var value) =>\n _readonly('addExtension');\n\n void clear() => _readonly('clear');\n\n void clearExtension(Extension extension) => _readonly('clearExtension');\n\n void clearField(int tagNumber) => _readonly('clearField');\n\n List createRepeatedField(int tagNumber, FieldInfo fi) {\n _readonly('createRepeatedField');\n return null; // not reached\n }\n\n void mergeFromBuffer(List input,\n [ExtensionRegistry extensionRegistry = ExtensionRegistry.EMPTY]) =>\n _readonly('mergeFromBuffer');\n\n void mergeFromCodedBufferReader(CodedBufferReader input,\n [ExtensionRegistry extensionRegistry = ExtensionRegistry.EMPTY]) =>\n _readonly('mergeFromCodedBufferReader');\n\n void mergeFromJson(String data,\n [ExtensionRegistry extensionRegistry = ExtensionRegistry.EMPTY]) =>\n _readonly('mergeFromJson');\n\n void mergeFromJsonMap(Map json,\n [ExtensionRegistry extensionRegistry = ExtensionRegistry.EMPTY]) =>\n _readonly('mergeFromJsonMap');\n\n void mergeFromMessage(GeneratedMessage other) =>\n _readonly('mergeFromMessage');\n\n void mergeUnknownFields(UnknownFieldSet unknownFieldSet) =>\n _readonly('mergeUnknownFields');\n\n void setExtension(Extension extension, var value) =>\n _readonly('setExtension');\n\n void setField(int tagNumber, var value, [int fieldType]) =>\n _readonly('setField');\n\n void _readonly(String methodName) {\n var messageType = info_.qualifiedMessageName;\n frozenMessageModificationHandler(messageType, methodName);\n }\n}\n"},"__index_level_0__":{"kind":"number","value":0,"string":"0"}}},{"rowIdx":146328,"cells":{"repo_id":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src"},"file_path":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src/protobuf/permissive_compare.dart"},"content":{"kind":"string","value":"// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file\n// for details. All rights reserved. Use of this source code is governed by a\n// BSD-style license that can be found in the LICENSE file.\n\n/// Returns true if [a] and [b] are the same ignoring case and all instances of\n/// `-` and `_`.\n///\n/// This is specialized code for comparing enum names.\n/// Works only for ascii strings containing letters and `_` and `-`.\nbool permissiveCompare(String a, String b) {\n const dash = 45;\n const underscore = 95;\n\n var i = 0;\n var j = 0;\n\n while (true) {\n int ca, cb;\n do {\n ca = i < a.length ? a.codeUnitAt(i++) : -1;\n } while (ca == dash || ca == underscore);\n do {\n cb = j < b.length ? b.codeUnitAt(j++) : -1;\n } while (cb == dash || cb == underscore);\n if (ca == cb) {\n if (ca == -1) return true; // Both at end\n continue;\n }\n if (ca ^ cb != 0x20 || !_isAsciiLetter(ca)) {\n return false;\n }\n }\n}\n\nbool _isAsciiLetter(int char) {\n const lowerA = 97;\n const lowerZ = 122;\n const capitalA = 65;\n char |= lowerA ^ capitalA;\n return lowerA <= char && char <= lowerZ;\n}\n"},"__index_level_0__":{"kind":"number","value":0,"string":"0"}}},{"rowIdx":146329,"cells":{"repo_id":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src"},"file_path":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src/protobuf/field_info.dart"},"content":{"kind":"string","value":"// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file\n// for details. All rights reserved. Use of this source code is governed by a\n// BSD-style license that can be found in the LICENSE file.\n\npart of protobuf;\n\n/// An object representing a protobuf message field.\nclass FieldInfo {\n FrozenPbList _emptyList;\n\n /// Name of this field as the `json_name` reported by protoc.\n ///\n /// This will typically be in camel case.\n final String name;\n\n /// The name of this field as written in the proto-definition.\n ///\n /// This will typically consist of words separated with underscores.\n final String protoName;\n\n final int tagNumber;\n final int index; // index of the field's value. Null for extensions.\n final int type;\n\n // Constructs the default value of a field.\n // (Only used for repeated fields where check is null.)\n final MakeDefaultFunc makeDefault;\n\n // Creates an empty message or group when decoding a message.\n // Not used for other types.\n // see GeneratedMessage._getEmptyMessage\n final CreateBuilderFunc subBuilder;\n\n // List of all enum enumValues.\n // (Not used for other types.)\n final List enumValues;\n\n // Looks up the enum value given its integer code.\n // (Not used for other types.)\n // see GeneratedMessage._getValueOfFunc\n final ValueOfFunc valueOf;\n\n // Verifies an item being added to a repeated field\n // (Not used for non-repeated fields.)\n final CheckFunc check;\n\n FieldInfo(this.name, this.tagNumber, this.index, this.type,\n {dynamic defaultOrMaker,\n this.subBuilder,\n this.valueOf,\n this.enumValues,\n String protoName})\n : makeDefault = findMakeDefault(type, defaultOrMaker),\n check = null,\n protoName = protoName ?? _unCamelCase(name),\n assert(type != 0),\n assert(!_isGroupOrMessage(type) ||\n subBuilder != null ||\n _isMapField(type)),\n assert(!_isEnum(type) || valueOf != null);\n\n // Represents a field that has been removed by a program transformation.\n FieldInfo.dummy(this.index)\n : name = '',\n protoName = '',\n tagNumber = 0,\n type = 0,\n makeDefault = null,\n valueOf = null,\n check = null,\n enumValues = null,\n subBuilder = null;\n\n FieldInfo.repeated(this.name, this.tagNumber, this.index, this.type,\n this.check, this.subBuilder,\n {this.valueOf, this.enumValues, String protoName})\n : makeDefault = (() => PbList(check: check)),\n protoName = protoName ?? _unCamelCase(name) {\n assert(name != null);\n assert(tagNumber != null);\n assert(_isRepeated(type));\n assert(check != null);\n assert(!_isEnum(type) || valueOf != null);\n }\n\n static MakeDefaultFunc findMakeDefault(int type, dynamic defaultOrMaker) {\n if (defaultOrMaker == null) return PbFieldType._defaultForType(type);\n if (defaultOrMaker is MakeDefaultFunc) return defaultOrMaker;\n return () => defaultOrMaker;\n }\n\n /// Returns `true` if this represents a dummy field standing in for a field\n /// that has been removed by a program transformation.\n bool get _isDummy => tagNumber == 0;\n\n bool get isRequired => _isRequired(type);\n bool get isRepeated => _isRepeated(type);\n bool get isGroupOrMessage => _isGroupOrMessage(type);\n bool get isEnum => _isEnum(type);\n bool get isMapField => _isMapField(type);\n\n /// Returns a read-only default value for a field.\n /// (Unlike getField, doesn't create a repeated field.)\n dynamic get readonlyDefault {\n if (isRepeated) {\n return _emptyList ??= FrozenPbList._([]);\n }\n return makeDefault();\n }\n\n /// Returns true if the field's value is okay to transmit.\n /// That is, it doesn't contain any required fields that aren't initialized.\n bool _hasRequiredValues(value) {\n if (value == null) return !isRequired; // missing is okay if optional\n if (!_isGroupOrMessage(type)) return true; // primitive and present\n\n if (!isRepeated) {\n // A required message: recurse.\n GeneratedMessage message = value;\n return message._fieldSet._hasRequiredValues();\n }\n\n List list = value;\n if (list.isEmpty) return true;\n\n // For message types that (recursively) contain no required fields,\n // short-circuit the loop.\n if (!list[0]._fieldSet._hasRequiredFields) return true;\n\n // Recurse on each item in the list.\n return list.every((GeneratedMessage m) => m._fieldSet._hasRequiredValues());\n }\n\n /// Appends the dotted path to each required field that's missing a value.\n void _appendInvalidFields(List problems, value, String prefix) {\n if (value == null) {\n if (isRequired) problems.add('$prefix$name');\n } else if (!_isGroupOrMessage(type)) {\n // primitive and present\n } else if (!isRepeated) {\n // Required message/group: recurse.\n GeneratedMessage message = value;\n message._fieldSet._appendInvalidFields(problems, '$prefix$name.');\n } else {\n final list = value as List;\n if (list.isEmpty) return;\n\n // For message types that (recursively) contain no required fields,\n // short-circuit the loop.\n if (!list[0]._fieldSet._hasRequiredFields) return;\n\n // Recurse on each item in the list.\n var position = 0;\n for (var message in list) {\n message._fieldSet\n ._appendInvalidFields(problems, '$prefix$name[$position].');\n position++;\n }\n }\n }\n\n /// Creates a repeated field to be attached to the given message.\n ///\n /// Delegates actual list creation to the message, so that it can\n /// be overridden by a mixin.\n List _createRepeatedField(GeneratedMessage m) {\n assert(isRepeated);\n return m.createRepeatedField(tagNumber, this);\n }\n\n /// Same as above, but allow a tighter typed List to be created.\n List _createRepeatedFieldWithType(GeneratedMessage m) {\n assert(isRepeated);\n return m.createRepeatedField(tagNumber, this);\n }\n\n /// Convenience method to thread this FieldInfo's reified type parameter to\n /// _FieldSet._ensureRepeatedField.\n List _ensureRepeatedField(_FieldSet fs) {\n return fs._ensureRepeatedField(this);\n }\n\n @override\n String toString() => name;\n}\n\nfinal RegExp _upperCase = RegExp('[A-Z]');\n\nString _unCamelCase(String name) {\n return name.replaceAllMapped(\n _upperCase, (match) => '_${match.group(0).toLowerCase()}');\n}\n\nclass MapFieldInfo extends FieldInfo> {\n final int keyFieldType;\n final int valueFieldType;\n\n /// Creates a new empty instance of the value type.\n ///\n /// `null` if the value type is not a Message type.\n final CreateBuilderFunc valueCreator;\n\n final BuilderInfo mapEntryBuilderInfo;\n\n MapFieldInfo(\n String name,\n int tagNumber,\n int index,\n int type,\n this.keyFieldType,\n this.valueFieldType,\n this.mapEntryBuilderInfo,\n this.valueCreator,\n {String protoName})\n : super(name, tagNumber, index, type,\n defaultOrMaker: () =>\n PbMap(keyFieldType, valueFieldType, mapEntryBuilderInfo),\n protoName: protoName) {\n assert(name != null);\n assert(tagNumber != null);\n assert(_isMapField(type));\n assert(!_isEnum(type) || valueOf != null);\n }\n\n FieldInfo get valueFieldInfo =>\n mapEntryBuilderInfo.fieldInfo[PbMap._valueFieldNumber];\n\n Map _ensureMapField(_FieldSet fs) {\n return fs._ensureMapField(this);\n }\n\n Map _createMapField(GeneratedMessage m) {\n assert(isMapField);\n return m.createMapField(tagNumber, this);\n }\n}\n"},"__index_level_0__":{"kind":"number","value":0,"string":"0"}}},{"rowIdx":146330,"cells":{"repo_id":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src"},"file_path":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src/protobuf/type_registry.dart"},"content":{"kind":"string","value":"// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file\n// for details. All rights reserved. Use of this source code is governed by a\n// BSD-style license that can be found in the LICENSE file.\n\nimport '../../protobuf.dart';\n\n/// A TypeRegistry is used to resolve Any messages in the proto3 JSON conversion.\n///\n/// You must provide a TypeRegistry containing all message types used in\n/// Any message fields, or the JSON conversion will fail because data\n/// in Any message fields is unrecognizable. You don't need to supply a\n/// TypeRegistry if you don't use Any message fields.\nclass TypeRegistry {\n final Map _mapping;\n\n /// Constructs a new TypeRegistry recognizing the given types of messages.\n ///\n /// You can use an empty message of the given type to represent the type. Eg:\n ///\n /// ```dart\n /// TypeRegistry([Foo(), Bar()]);\n /// ```\n TypeRegistry(Iterable types)\n : _mapping = Map.fromEntries(types.map((message) =>\n MapEntry(message.info_.qualifiedMessageName, message.info_)));\n\n const TypeRegistry.empty() : _mapping = const {};\n\n BuilderInfo lookup(String qualifiedName) {\n return _mapping[qualifiedName];\n }\n}\n"},"__index_level_0__":{"kind":"number","value":0,"string":"0"}}},{"rowIdx":146331,"cells":{"repo_id":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src"},"file_path":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src/protobuf/field_set.dart"},"content":{"kind":"string","value":"// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file\n// for details. All rights reserved. Use of this source code is governed by a\n// BSD-style license that can be found in the LICENSE file.\n\npart of protobuf;\n\ntypedef FrozenMessageErrorHandler = void Function(String messageName,\n [String methodName]);\n\nvoid defaultFrozenMessageModificationHandler(String messageName,\n [String methodName]) {\n if (methodName != null) {\n throw UnsupportedError(\n 'Attempted to call $methodName on a read-only message ($messageName)');\n }\n throw UnsupportedError(\n 'Attempted to change a read-only message ($messageName)');\n}\n\n/// Invoked when an attempt is made to modify a frozen message.\n///\n/// This handler can log the attempt, throw an exception, or ignore the attempt\n/// altogether.\n///\n/// If the handler returns normally, the modification is allowed, and execution\n/// proceeds as if the message was writable.\nFrozenMessageErrorHandler _frozenMessageModificationHandler =\n defaultFrozenMessageModificationHandler;\nFrozenMessageErrorHandler get frozenMessageModificationHandler =>\n _frozenMessageModificationHandler;\nset frozenMessageModificationHandler(FrozenMessageErrorHandler value) {\n _hashCodesCanBeMemoized = false;\n _frozenMessageModificationHandler = value;\n}\n\n/// Indicator for whether the FieldSet hashCodes can be memoized.\n///\n/// HashCode memoization relies on the [defaultFrozenMessageModificationHandler]\n/// behavior--that is, after freezing, field set values can't ever be changed.\n/// This keeps track of whether an application has ever modified the\n/// [FrozenMessageErrorHandler] used, not allowing hashCodes to be memoized if\n/// it ever changed.\nbool _hashCodesCanBeMemoized = true;\n\n/// All the data in a GeneratedMessage.\n///\n/// These fields and methods are in a separate class to avoid\n/// polymorphic access due to inheritance. This turns out to\n/// be faster when compiled to JavaScript.\nclass _FieldSet {\n final GeneratedMessage _message;\n final BuilderInfo _meta;\n final EventPlugin _eventPlugin;\n\n /// The value of each non-extension field in a fixed-length array.\n /// The index of a field can be found in [FieldInfo.index].\n /// A null entry indicates that the field has no value.\n final List _values;\n\n /// Contains all the extension fields, or null if there aren't any.\n _ExtensionFieldSet _extensions;\n\n /// Contains all the unknown fields, or null if there aren't any.\n UnknownFieldSet _unknownFields;\n\n /// Encodes whether `this` has been frozen, and if so, also memoizes the\n /// hash code.\n ///\n /// Will always be a `bool` or `int`.\n ///\n /// If the message is mutable: `false`\n /// If the message is frozen and no hash code has been computed: `true`\n /// If the message is frozen and a hash code has been computed: the hash\n /// code as an `int`.\n Object _frozenState = false;\n\n /// Returns the value of [_frozenState] as if it were a boolean indicator\n /// for whether `this` is read-only (has been frozen).\n ///\n /// If the value is not a `bool`, then it must contain the memoized hash code\n /// value, in which case the proto must be read-only.\n bool get _isReadOnly => _frozenState is bool ? _frozenState : true;\n\n /// Returns the value of [_frozenState] if it contains the pre-computed value\n /// of the hashCode for the frozen field sets.\n ///\n /// Computing the hashCode of a proto object can be very expensive for large\n /// protos. Frozen protos don't allow any mutations, which means the contents\n /// of the field set should be stable.\n ///\n /// If [_frozenState] contains a boolean, the hashCode hasn't been memoized,\n /// so it will return null.\n int get _memoizedHashCode => _frozenState is int ? _frozenState : null;\n\n // Maps a oneof decl index to the tag number which is currently set. If the\n // index is not present, the oneof field is unset.\n final Map _oneofCases;\n\n _FieldSet(this._message, BuilderInfo meta, this._eventPlugin)\n : _meta = meta,\n _values = _makeValueList(meta.byIndex.length),\n _oneofCases = meta.oneofs.isEmpty ? null : {};\n\n static List _makeValueList(int length) {\n if (length == 0) return _zeroList;\n return List(length);\n }\n\n // Use a fixed length list and not a constant list to ensure that _values\n // always has the same implementation type.\n static final List _zeroList = List(0);\n\n // Metadata about multiple fields\n\n String get _messageName => _meta.qualifiedMessageName;\n bool get _hasRequiredFields => _meta.hasRequiredFields;\n\n /// The FieldInfo for each non-extension field.\n Iterable get _infos => _meta.fieldInfo.values;\n\n /// The FieldInfo for each non-extension field in tag order.\n Iterable get _infosSortedByTag => _meta.sortedByTag;\n\n /// Returns true if we should send events to the plugin.\n bool get _hasObservers => _eventPlugin != null && _eventPlugin.hasObservers;\n\n bool get _hasExtensions => _extensions != null;\n bool get _hasUnknownFields => _unknownFields != null;\n\n _ExtensionFieldSet _ensureExtensions() {\n if (!_hasExtensions) _extensions = _ExtensionFieldSet(this);\n return _extensions;\n }\n\n UnknownFieldSet _ensureUnknownFields() {\n if (_unknownFields == null) {\n if (_isReadOnly) return UnknownFieldSet.emptyUnknownFieldSet;\n _unknownFields = UnknownFieldSet();\n }\n return _unknownFields;\n }\n\n // Metadata about single fields\n\n /// Returns FieldInfo for a non-extension field, or null if not found.\n FieldInfo _nonExtensionInfo(int tagNumber) => _meta.fieldInfo[tagNumber];\n\n /// Returns FieldInfo for a non-extension field.\n FieldInfo _nonExtensionInfoByIndex(int index) => _meta.byIndex[index];\n\n /// Returns the FieldInfo for a regular or extension field.\n /// throws ArgumentException if no info is found.\n FieldInfo _ensureInfo(int tagNumber) {\n var fi = _getFieldInfoOrNull(tagNumber);\n if (fi != null) return fi;\n throw ArgumentError('tag $tagNumber not defined in $_messageName');\n }\n\n /// Returns the FieldInfo for a regular or extension field.\n FieldInfo _getFieldInfoOrNull(int tagNumber) {\n var fi = _nonExtensionInfo(tagNumber);\n if (fi != null) return fi;\n if (!_hasExtensions) return null;\n return _extensions._getInfoOrNull(tagNumber);\n }\n\n void _markReadOnly() {\n if (_isReadOnly) return;\n _frozenState = true;\n for (var field in _meta.sortedByTag) {\n if (field.isRepeated) {\n final entries = _values[field.index];\n if (entries == null) continue;\n if (field.isGroupOrMessage) {\n for (var subMessage in entries as List) {\n subMessage.freeze();\n }\n }\n _values[field.index] = entries.toFrozenPbList();\n } else if (field.isMapField) {\n PbMap map = _values[field.index];\n if (map == null) continue;\n _values[field.index] = map.freeze();\n } else if (field.isGroupOrMessage) {\n final entry = _values[field.index];\n if (entry != null) {\n (entry as GeneratedMessage).freeze();\n }\n }\n }\n if (_hasExtensions) {\n _ensureExtensions()._markReadOnly();\n }\n\n if (_hasUnknownFields) {\n _ensureUnknownFields()._markReadOnly();\n }\n }\n\n void _ensureWritable() {\n if (_isReadOnly) frozenMessageModificationHandler(_messageName);\n }\n\n // Single-field operations\n\n /// Gets a field with full error-checking.\n ///\n /// Works for both extended and non-extended fields.\n /// Creates repeated fields (unless read-only).\n /// Suitable for public API.\n dynamic _getField(int tagNumber) {\n var fi = _nonExtensionInfo(tagNumber);\n if (fi != null) {\n var value = _values[fi.index];\n if (value != null) return value;\n return _getDefault(fi);\n }\n if (_hasExtensions) {\n var fi = _extensions._getInfoOrNull(tagNumber);\n if (fi != null) {\n return _extensions._getFieldOrDefault(fi);\n }\n }\n throw ArgumentError('tag $tagNumber not defined in $_messageName');\n }\n\n dynamic _getDefault(FieldInfo fi) {\n if (!fi.isRepeated) return fi.makeDefault();\n if (_isReadOnly) return fi.readonlyDefault;\n\n // TODO(skybrian) we could avoid this by generating another\n // method for repeated fields:\n // msg.mutableFoo().add(123);\n var value = fi._createRepeatedField(_message);\n _setNonExtensionFieldUnchecked(fi, value);\n return value;\n }\n\n List _getDefaultList(FieldInfo fi) {\n assert(fi.isRepeated);\n if (_isReadOnly) return List.unmodifiable(const []);\n\n // TODO(skybrian) we could avoid this by generating another\n // method for repeated fields:\n // msg.mutableFoo().add(123);\n var value = fi._createRepeatedFieldWithType(_message);\n _setNonExtensionFieldUnchecked(fi, value);\n return value;\n }\n\n Map _getDefaultMap(MapFieldInfo fi) {\n assert(fi.isMapField);\n\n if (_isReadOnly) {\n return PbMap.unmodifiable(PbMap(\n fi.keyFieldType, fi.valueFieldType, fi.mapEntryBuilderInfo));\n }\n\n var value = fi._createMapField(_message);\n _setNonExtensionFieldUnchecked(fi, value);\n return value;\n }\n\n dynamic _getFieldOrNullByTag(int tagNumber) {\n var fi = _getFieldInfoOrNull(tagNumber);\n if (fi == null) return null;\n return _getFieldOrNull(fi);\n }\n\n /// Returns the field's value or null if not set.\n ///\n /// Works for both extended and non-extend fields.\n /// Works for both repeated and non-repeated fields.\n dynamic _getFieldOrNull(FieldInfo fi) {\n if (fi.index != null) return _values[fi.index];\n if (!_hasExtensions) return null;\n return _extensions._getFieldOrNull(fi);\n }\n\n bool _hasField(int tagNumber) {\n var fi = _nonExtensionInfo(tagNumber);\n if (fi != null) return _$has(fi.index);\n if (!_hasExtensions) return false;\n return _extensions._hasField(tagNumber);\n }\n\n void _clearField(int tagNumber) {\n _ensureWritable();\n var fi = _nonExtensionInfo(tagNumber);\n if (fi != null) {\n // clear a non-extension field\n if (_hasObservers) _eventPlugin.beforeClearField(fi);\n _values[fi.index] = null;\n\n if (_meta.oneofs.containsKey(fi.tagNumber)) {\n _oneofCases.remove(_meta.oneofs[fi.tagNumber]);\n }\n\n var oneofIndex = _meta.oneofs[fi.tagNumber];\n if (oneofIndex != null) _oneofCases[oneofIndex] = 0;\n return;\n }\n\n if (_hasExtensions) {\n var fi = _extensions._getInfoOrNull(tagNumber);\n if (fi != null) {\n _extensions._clearField(fi);\n return;\n }\n }\n\n // neither a regular field nor an extension.\n // TODO(skybrian) throw?\n }\n\n /// Sets a non-repeated field with error-checking.\n ///\n /// Works for both extended and non-extended fields.\n /// Suitable for public API.\n void _setField(int tagNumber, value) {\n if (value == null) throw ArgumentError('value is null');\n\n var fi = _nonExtensionInfo(tagNumber);\n if (fi == null) {\n if (!_hasExtensions) {\n throw ArgumentError('tag $tagNumber not defined in $_messageName');\n }\n _extensions._setField(tagNumber, value);\n return;\n }\n\n if (fi.isRepeated) {\n throw ArgumentError(_setFieldFailedMessage(\n fi, value, 'repeating field (use get + .add())'));\n }\n _validateField(fi, value);\n _setNonExtensionFieldUnchecked(fi, value);\n }\n\n /// Sets a non-repeated field without validating it.\n ///\n /// Works for both extended and non-extended fields.\n /// Suitable for decoders that do their own validation.\n void _setFieldUnchecked(FieldInfo fi, value) {\n assert(fi != null);\n assert(!fi.isRepeated);\n if (fi.index == null) {\n _ensureExtensions()\n .._addInfoUnchecked(fi)\n .._setFieldUnchecked(fi, value);\n } else {\n _setNonExtensionFieldUnchecked(fi, value);\n }\n }\n\n /// Returns the list to use for adding to a repeated field.\n ///\n /// Works for both extended and non-extended fields.\n /// Creates and stores the repeated field if it doesn't exist.\n /// If it's an extension and the list doesn't exist, validates and stores it.\n /// Suitable for decoders.\n List _ensureRepeatedField(FieldInfo fi) {\n assert(!_isReadOnly);\n assert(fi.isRepeated);\n if (fi.index == null) {\n return _ensureExtensions()._ensureRepeatedField(fi);\n }\n var value = _getFieldOrNull(fi);\n if (value != null) return value as List;\n\n var newValue = fi._createRepeatedField(_message);\n _setNonExtensionFieldUnchecked(fi, newValue);\n return newValue;\n }\n\n PbMap _ensureMapField(MapFieldInfo fi) {\n assert(!_isReadOnly);\n assert(fi.isMapField);\n assert(fi.index != null); // Map fields are not allowed to be extensions.\n\n var value = _getFieldOrNull(fi);\n if (value != null) return value as Map;\n\n var newValue = fi._createMapField(_message);\n _setNonExtensionFieldUnchecked(fi, newValue);\n return newValue;\n }\n\n /// Sets a non-extended field and fires events.\n void _setNonExtensionFieldUnchecked(FieldInfo fi, value) {\n var tag = fi.tagNumber;\n var oneofIndex = _meta.oneofs[tag];\n if (oneofIndex != null) {\n _clearField(_oneofCases[oneofIndex]);\n _oneofCases[oneofIndex] = tag;\n }\n\n // It is important that the callback to the observers is not moved to the\n // beginning of this method but happens just before the value is set.\n // Otherwise the observers will be notified about 'clearField' and\n // 'setField' events in an incorrect order.\n if (_hasObservers) {\n _eventPlugin.beforeSetField(fi, value);\n }\n _values[fi.index] = value;\n }\n\n // Generated method implementations\n\n /// The implementation of a generated getter.\n T _$get(int index, T defaultValue) {\n var value = _values[index];\n if (value != null) return value as T;\n if (defaultValue != null) return defaultValue;\n return _getDefault(_nonExtensionInfoByIndex(index)) as T;\n }\n\n /// The implementation of a generated getter for a default value determined by\n /// the field definition value. Common case for submessages. dynamic type\n /// pushes the type check to the caller.\n dynamic _$getND(int index) {\n var value = _values[index];\n if (value != null) return value;\n return _getDefault(_nonExtensionInfoByIndex(index));\n }\n\n T _$ensure(int index) {\n if (!_$has(index)) {\n dynamic value = _nonExtensionInfoByIndex(index).subBuilder();\n _$set(index, value);\n return value;\n }\n // The implicit downcast at the return is always correct by construction\n // from the protoc generator. See `GeneratedMessage.$_getN` for details.\n return _$getND(index);\n }\n\n /// The implementation of a generated getter for repeated fields.\n List _$getList(int index) {\n var value = _values[index];\n if (value != null) return value as List;\n return _getDefaultList(_nonExtensionInfoByIndex(index));\n }\n\n /// The implementation of a generated getter for map fields.\n Map _$getMap(int index) {\n var value = _values[index];\n if (value != null) return value as Map;\n return _getDefaultMap(_nonExtensionInfoByIndex(index));\n }\n\n /// The implementation of a generated getter for `bool` fields.\n bool _$getB(int index, bool defaultValue) {\n var value = _values[index];\n if (value == null) {\n if (defaultValue != null) return defaultValue;\n value = _getDefault(_nonExtensionInfoByIndex(index));\n }\n bool result = value;\n return result;\n }\n\n /// The implementation of a generated getter for `bool` fields that default to\n /// `false`.\n bool _$getBF(int index) {\n var value = _values[index];\n if (value == null) return false;\n bool result = value;\n return result;\n }\n\n /// The implementation of a generated getter for int fields.\n int _$getI(int index, int defaultValue) {\n var value = _values[index];\n if (value == null) {\n if (defaultValue != null) return defaultValue;\n value = _getDefault(_nonExtensionInfoByIndex(index));\n }\n int result = value;\n return result;\n }\n\n /// The implementation of a generated getter for `int` fields (int32, uint32,\n /// fixed32, sfixed32) that default to `0`.\n int _$getIZ(int index) {\n var value = _values[index];\n if (value == null) return 0;\n int result = value;\n return result;\n }\n\n /// The implementation of a generated getter for String fields.\n String _$getS(int index, String defaultValue) {\n var value = _values[index];\n if (value == null) {\n if (defaultValue != null) return defaultValue;\n value = _getDefault(_nonExtensionInfoByIndex(index));\n }\n String result = value;\n return result;\n }\n\n /// The implementation of a generated getter for String fields that default to\n /// the empty string.\n String _$getSZ(int index) {\n var value = _values[index];\n if (value == null) return '';\n String result = value;\n return result;\n }\n\n /// The implementation of a generated getter for Int64 fields.\n Int64 _$getI64(int index) {\n var value = _values[index];\n value ??= _getDefault(_nonExtensionInfoByIndex(index));\n Int64 result = value;\n return result;\n }\n\n /// The implementation of a generated 'has' method.\n bool _$has(int index) {\n var value = _values[index];\n if (value == null) return false;\n if (value is List) return value.isNotEmpty;\n return true;\n }\n\n /// The implementation of a generated setter.\n ///\n /// In production, does no validation other than a null check.\n /// Only handles non-repeated, non-extension fields.\n /// Also, doesn't handle enums or messages which need per-type validation.\n void _$set(int index, value) {\n assert(!_nonExtensionInfoByIndex(index).isRepeated);\n assert(_$check(index, value));\n _ensureWritable();\n if (value == null) {\n _$check(index, value); // throw exception for null value\n }\n if (_hasObservers) {\n _eventPlugin.beforeSetField(_nonExtensionInfoByIndex(index), value);\n }\n var tag = _meta.byIndex[index].tagNumber;\n var oneofIndex = _meta.oneofs[tag];\n\n if (oneofIndex != null) {\n _clearField(_oneofCases[oneofIndex]);\n _oneofCases[oneofIndex] = tag;\n }\n _values[index] = value;\n }\n\n bool _$check(int index, var newValue) {\n _validateField(_nonExtensionInfoByIndex(index), newValue);\n return true; // Allows use in an assertion.\n }\n\n // Bulk operations reading or writing multiple fields\n\n void _clear() {\n _ensureWritable();\n if (_unknownFields != null) {\n _unknownFields.clear();\n }\n\n if (_hasObservers) {\n for (var fi in _infos) {\n if (_values[fi.index] != null) {\n _eventPlugin.beforeClearField(fi);\n }\n }\n if (_hasExtensions) {\n for (var key in _extensions._tagNumbers) {\n var fi = _extensions._getInfoOrNull(key);\n _eventPlugin.beforeClearField(fi);\n }\n }\n }\n if (_values.isNotEmpty) _values.fillRange(0, _values.length, null);\n if (_hasExtensions) _extensions._clearValues();\n }\n\n bool _equals(_FieldSet o) {\n if (_meta != o._meta) return false;\n for (var i = 0; i < _values.length; i++) {\n if (!_equalFieldValues(_values[i], o._values[i])) return false;\n }\n\n if (!_hasExtensions || !_extensions._hasValues) {\n // Check if other extensions are logically empty.\n // (Don't create them unnecessarily.)\n if (o._hasExtensions && o._extensions._hasValues) {\n return false;\n }\n } else {\n if (!_extensions._equalValues(o._extensions)) return false;\n }\n\n if (_unknownFields == null || _unknownFields.isEmpty) {\n // Check if other unknown fields is logically empty.\n // (Don't create them unnecessarily.)\n if (o._unknownFields != null && o._unknownFields.isNotEmpty) return false;\n } else {\n // Check if the other unknown fields has the same fields.\n if (_unknownFields != o._unknownFields) return false;\n }\n\n return true;\n }\n\n bool _equalFieldValues(left, right) {\n if (left != null && right != null) return _deepEquals(left, right);\n\n var val = left ?? right;\n\n // Two uninitialized fields are equal.\n if (val == null) return true;\n\n // One field is null. We are comparing an initialized field\n // with its default value.\n\n // An empty repeated field is the same as uninitialized.\n // This is because accessing a repeated field automatically creates it.\n // We don't want reading a field to change equality comparisons.\n if (val is List && val.isEmpty) return true;\n\n // For now, initialized and uninitialized fields are different.\n // TODO(skybrian) consider other cases; should we compare with the\n // default value or not?\n return false;\n }\n\n /// Calculates a hash code based on the contents of the protobuf.\n ///\n /// The hash may change when any field changes (recursively).\n /// Therefore, protobufs used as map keys shouldn't be changed.\n ///\n /// If the protobuf contents have been frozen, and the\n /// [FrozenMessageErrorHandler] has not been changed from the default\n /// behavior, the hashCode can be memoized to speed up performance.\n int get _hashCode {\n if (_hashCodesCanBeMemoized && _memoizedHashCode != null) {\n return _memoizedHashCode;\n }\n // Hashes the value of one field (recursively).\n int hashField(int hash, FieldInfo fi, value) {\n if (value is List && value.isEmpty) {\n return hash; // It's either repeated or an empty byte array.\n }\n\n hash = _HashUtils._combine(hash, fi.tagNumber);\n if (_isBytes(fi.type)) {\n // Bytes are represented as a List (Usually with byte-data).\n // We special case that to match our equality semantics.\n hash = _HashUtils._combine(hash, _HashUtils._hashObjects(value));\n } else if (!_isEnum(fi.type)) {\n hash = _HashUtils._combine(hash, value.hashCode);\n } else if (fi.isRepeated) {\n hash = _HashUtils._hashObjects(value.map((enm) => enm.value));\n } else {\n ProtobufEnum enm = value;\n hash = _HashUtils._combine(hash, enm.value);\n }\n\n return hash;\n }\n\n int hashEachField(int hash) {\n //non-extension fields\n hash = _infosSortedByTag.where((fi) => _values[fi.index] != null).fold(\n hash, (int h, FieldInfo fi) => hashField(h, fi, _values[fi.index]));\n\n if (!_hasExtensions) return hash;\n\n hash =\n _sorted(_extensions._tagNumbers).fold(hash, (int h, int tagNumber) {\n var fi = _extensions._getInfoOrNull(tagNumber);\n return hashField(h, fi, _extensions._getFieldOrNull(fi));\n });\n\n return hash;\n }\n\n // Hash with descriptor.\n var hash = _HashUtils._combine(0, _meta.hashCode);\n // Hash with fields.\n hash = hashEachField(hash);\n // Hash with unknown fields.\n if (_hasUnknownFields) {\n hash = _HashUtils._combine(hash, _unknownFields.hashCode);\n }\n\n if (_isReadOnly && _hashCodesCanBeMemoized) {\n _frozenState = hash;\n }\n return hash;\n }\n\n void writeString(StringBuffer out, String indent) {\n void renderValue(key, value) {\n if (value is GeneratedMessage) {\n out.write('$indent$key: {\\n');\n value._fieldSet.writeString(out, '$indent ');\n out.write('$indent}\\n');\n } else if (value is MapEntry) {\n out.write('$indent$key: {${value.key} : ${value.value}} \\n');\n } else {\n out.write('$indent$key: $value\\n');\n }\n }\n\n void writeFieldValue(fieldValue, String name) {\n if (fieldValue == null) return;\n if (fieldValue is ByteData) {\n // TODO(skybrian): possibly unused. Delete?\n final value = fieldValue.getUint64(0, Endian.little);\n renderValue(name, value);\n } else if (fieldValue is PbListBase) {\n for (var value in fieldValue) {\n renderValue(name, value);\n }\n } else if (fieldValue is PbMap) {\n for (var entry in fieldValue.entries) {\n renderValue(name, entry);\n }\n } else {\n renderValue(name, fieldValue);\n }\n }\n\n _infosSortedByTag\n .forEach((FieldInfo fi) => writeFieldValue(_values[fi.index], fi.name));\n\n if (_hasExtensions) {\n _extensions._info.keys.toList()\n ..sort()\n ..forEach((int tagNumber) => writeFieldValue(\n _extensions._values[tagNumber],\n '[${_extensions._info[tagNumber].name}]'));\n }\n if (_hasUnknownFields) {\n out.write(_unknownFields.toString());\n } else {\n out.write(UnknownFieldSet().toString());\n }\n }\n\n /// Merges the contents of the [other] into this message.\n ///\n /// Singular fields that are set in [other] overwrite the corresponding fields\n /// in this message. Repeated fields are appended. Singular sub-messages are\n /// recursively merged.\n void _mergeFromMessage(_FieldSet other) {\n // TODO(https://github.com/dart-lang/protobuf/issues/60): Recognize\n // when [this] and [other] are the same protobuf (e.g. from cloning). In\n // this case, we can merge the non-extension fields without field lookups or\n // validation checks.\n\n for (var fi in other._infosSortedByTag) {\n var value = other._values[fi.index];\n if (value != null) _mergeField(fi, value, isExtension: false);\n }\n if (other._hasExtensions) {\n var others = other._extensions;\n for (var tagNumber in others._tagNumbers) {\n var extension = others._getInfoOrNull(tagNumber);\n var value = others._getFieldOrNull(extension);\n _mergeField(extension, value, isExtension: true);\n }\n }\n\n if (other._hasUnknownFields) {\n _ensureUnknownFields().mergeFromUnknownFieldSet(other._unknownFields);\n }\n }\n\n void _mergeField(FieldInfo otherFi, fieldValue, {bool isExtension}) {\n var tagNumber = otherFi.tagNumber;\n\n // Determine the FieldInfo to use.\n // Don't allow regular fields to be overwritten by extensions.\n var fi = _nonExtensionInfo(tagNumber);\n if (fi == null && isExtension) {\n // This will overwrite any existing extension field info.\n fi = otherFi;\n }\n\n var mustClone = _isGroupOrMessage(otherFi.type);\n\n if (fi.isMapField) {\n MapFieldInfo f = fi;\n mustClone = _isGroupOrMessage(f.valueFieldType);\n PbMap map = f._ensureMapField(this);\n if (mustClone) {\n for (MapEntry entry in fieldValue.entries) {\n map[entry.key] = (entry.value as GeneratedMessage).deepCopy();\n }\n } else {\n map.addAll(fieldValue);\n }\n return;\n }\n\n if (fi.isRepeated) {\n if (mustClone) {\n // fieldValue must be a PbListBase of GeneratedMessage.\n PbListBase pbList = fieldValue;\n var repeatedFields = fi._ensureRepeatedField(this);\n for (var i = 0; i < pbList.length; ++i) {\n repeatedFields.add(pbList[i].deepCopy());\n }\n } else {\n // fieldValue must be at least a PbListBase.\n PbListBase pbList = fieldValue;\n fi._ensureRepeatedField(this).addAll(pbList);\n }\n return;\n }\n\n if (otherFi.isGroupOrMessage) {\n final currentFi = isExtension\n ? _ensureExtensions()._getFieldOrNull(fi)\n : _values[fi.index];\n\n if (currentFi == null) {\n fieldValue = (fieldValue as GeneratedMessage).deepCopy();\n } else {\n fieldValue = currentFi..mergeFromMessage(fieldValue);\n }\n }\n\n if (isExtension) {\n _ensureExtensions()._setFieldAndInfo(fi, fieldValue);\n } else {\n _validateField(fi, fieldValue);\n _setNonExtensionFieldUnchecked(fi, fieldValue);\n }\n }\n\n // Error-checking\n\n /// Checks the value for a field that's about to be set.\n void _validateField(FieldInfo fi, var newValue) {\n _ensureWritable();\n var message = _getFieldError(fi.type, newValue);\n if (message != null) {\n throw ArgumentError(_setFieldFailedMessage(fi, newValue, message));\n }\n }\n\n String _setFieldFailedMessage(FieldInfo fi, var value, String detail) {\n return 'Illegal to set field ${fi.name} (${fi.tagNumber}) of $_messageName'\n ' to value ($value): $detail';\n }\n\n bool _hasRequiredValues() {\n if (!_hasRequiredFields) return true;\n for (var fi in _infos) {\n var value = _values[fi.index];\n if (!fi._hasRequiredValues(value)) return false;\n }\n return _hasRequiredExtensionValues();\n }\n\n bool _hasRequiredExtensionValues() {\n if (!_hasExtensions) return true;\n for (var fi in _extensions._infos) {\n var value = _extensions._getFieldOrNull(fi);\n if (!fi._hasRequiredValues(value)) return false;\n }\n return true; // No problems found.\n }\n\n /// Adds the path to each uninitialized field to the list.\n void _appendInvalidFields(List problems, String prefix) {\n if (!_hasRequiredFields) return;\n for (var fi in _infos) {\n var value = _values[fi.index];\n fi._appendInvalidFields(problems, value, prefix);\n }\n // TODO(skybrian): search extensions as well\n // https://github.com/dart-lang/protobuf/issues/46\n }\n\n /// Makes a shallow copy of all values from [original] to this.\n ///\n /// Map fields and repeated fields are copied.\n void _shallowCopyValues(_FieldSet original) {\n _values.setRange(0, original._values.length, original._values);\n for (var index = 0; index < _meta.byIndex.length; index++) {\n var fieldInfo = _meta.byIndex[index];\n if (fieldInfo.isMapField) {\n PbMap map = _values[index];\n if (map != null) {\n _values[index] = (fieldInfo as MapFieldInfo)._createMapField(_message)\n ..addAll(map);\n }\n } else if (fieldInfo.isRepeated) {\n PbListBase list = _values[index];\n if (list != null) {\n _values[index] = fieldInfo._createRepeatedField(_message)\n ..addAll(list);\n }\n }\n }\n\n if (original._hasExtensions) {\n _ensureExtensions()._shallowCopyValues(original._extensions);\n }\n\n if (original._hasUnknownFields) {\n _ensureUnknownFields()._fields?.addAll(original._unknownFields._fields);\n }\n\n _oneofCases?.addAll(original._oneofCases);\n }\n}\n"},"__index_level_0__":{"kind":"number","value":0,"string":"0"}}},{"rowIdx":146332,"cells":{"repo_id":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src"},"file_path":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src/protobuf/generated_message.dart"},"content":{"kind":"string","value":"// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file\n// for details. All rights reserved. Use of this source code is governed by a\n// BSD-style license that can be found in the LICENSE file.\n\npart of protobuf;\n\ntypedef CreateBuilderFunc = GeneratedMessage Function();\ntypedef MakeDefaultFunc = Function();\ntypedef ValueOfFunc = ProtobufEnum Function(int value);\n\n/// The base class for all protobuf message types.\n///\n/// The protoc plugin generates subclasses providing type-specific\n/// properties and methods.\n///\n/// Public properties and methods added here should also be added to\n/// GeneratedMessage_reservedNames and should be unlikely to be used in\n/// a proto file.\nabstract class GeneratedMessage {\n _FieldSet _fieldSet;\n\n GeneratedMessage() {\n _fieldSet = _FieldSet(this, info_, eventPlugin);\n if (eventPlugin != null) eventPlugin.attach(this);\n }\n\n GeneratedMessage.fromBuffer(\n List input, ExtensionRegistry extensionRegistry) {\n _fieldSet = _FieldSet(this, info_, eventPlugin);\n if (eventPlugin != null) eventPlugin.attach(this);\n mergeFromBuffer(input, extensionRegistry);\n }\n\n GeneratedMessage.fromJson(String input, ExtensionRegistry extensionRegistry) {\n _fieldSet = _FieldSet(this, info_, eventPlugin);\n if (eventPlugin != null) eventPlugin.attach(this);\n mergeFromJson(input, extensionRegistry);\n }\n\n // Overridden by subclasses.\n BuilderInfo get info_;\n\n /// Subclasses can override this getter to be notified of changes\n /// to protobuf fields.\n EventPlugin get eventPlugin => null;\n\n /// Creates a deep copy of the fields in this message.\n /// (The generated code uses [mergeFromMessage].)\n @Deprecated('Using this can add significant size overhead to your binary. '\n 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '\n 'Will be removed in next major version')\n GeneratedMessage clone();\n\n /// Creates an empty instance of the same message type as this.\n GeneratedMessage createEmptyInstance();\n\n UnknownFieldSet get unknownFields => _fieldSet._ensureUnknownFields();\n\n /// Make this message read-only.\n ///\n /// Marks this message, and any sub-messages, as read-only.\n GeneratedMessage freeze() {\n _fieldSet._markReadOnly();\n return this;\n }\n\n /// Returns `true` if this message is marked read-only. Otherwise `false`.\n ///\n /// Even when `false`, some sub-message could be read-only.\n ///\n /// If `true` all sub-messages are frozen.\n bool get isFrozen => _fieldSet._isReadOnly;\n\n /// Returns a writable, shallow copy of this message.\n ///\n /// Sub messages will be shared with [this] and will still be frozen if [this]\n /// is frozen.\n ///\n /// The lists representing repeated fields are copied. But their elements will\n /// be shared with the corresponding list in [this].\n ///\n /// Similarly for map fields, the maps will be copied, but share the elements.\n // TODO(nichite, sigurdm): Consider returning an actual builder object that\n // lazily creates builders.\n GeneratedMessage toBuilder() {\n final result = createEmptyInstance();\n result._fieldSet._shallowCopyValues(_fieldSet);\n return result;\n }\n\n /// Apply [updates] to a copy of this message.\n ///\n /// Makes a writable shawwol copy of this message, applies the [updates] to\n /// it, and marks the copy read-only before returning it.\n @Deprecated('Using this can add significant size overhead to your binary. '\n 'Use [GeneratedMessageGenericExtensions.rebuild] instead. '\n 'Will be removed in next major version')\n GeneratedMessage copyWith(void Function(GeneratedMessage) updates) {\n final builder = toBuilder();\n updates(builder);\n return builder.freeze();\n }\n\n bool hasRequiredFields() => info_.hasRequiredFields;\n\n /// Returns [:true:] if all required fields in the message and all embedded\n /// messages are set, false otherwise.\n bool isInitialized() => _fieldSet._hasRequiredValues();\n\n /// Clears all data that was set in this message.\n ///\n /// After calling [clear], [getField] will still return default values for\n /// unset fields.\n void clear() => _fieldSet._clear();\n\n // TODO(antonm): move to getters.\n int getTagNumber(String fieldName) => info_.tagNumber(fieldName);\n\n @override\n bool operator ==(other) {\n if (identical(this, other)) return true;\n return other is GeneratedMessage\n ? _fieldSet._equals(other._fieldSet)\n : false;\n }\n\n /// Calculates a hash code based on the contents of the protobuf.\n ///\n /// The hash may change when any field changes (recursively).\n /// Therefore, protobufs used as map keys shouldn't be changed.\n @override\n int get hashCode => _fieldSet._hashCode;\n\n /// Returns a String representation of this message.\n ///\n /// This representation is similar to, but not quite, the Protocol Buffer\n /// TextFormat. Each field is printed on its own line. Sub-messages are\n /// indented two spaces farther than their parent messages.\n ///\n /// Note that this format is absolutely subject to change, and should only\n /// ever be used for debugging.\n @override\n String toString() => toDebugString();\n\n /// Returns a String representation of this message.\n ///\n /// This generates the same output as [toString], but can be used by mixins\n /// to compose debug strings with additional information.\n String toDebugString() {\n var out = StringBuffer();\n _fieldSet.writeString(out, '');\n return out.toString();\n }\n\n void check() {\n if (!isInitialized()) {\n var invalidFields = [];\n _fieldSet._appendInvalidFields(invalidFields, '');\n var missingFields = (invalidFields..sort()).join(', ');\n throw StateError('Message missing required fields: $missingFields');\n }\n }\n\n Uint8List writeToBuffer() {\n var out = CodedBufferWriter();\n writeToCodedBufferWriter(out);\n return out.toBuffer();\n }\n\n void writeToCodedBufferWriter(CodedBufferWriter output) =>\n _writeToCodedBufferWriter(_fieldSet, output);\n\n void mergeFromCodedBufferReader(CodedBufferReader input,\n [ExtensionRegistry extensionRegistry = ExtensionRegistry.EMPTY]) =>\n _mergeFromCodedBufferReader(_fieldSet, input, extensionRegistry);\n\n /// Merges serialized protocol buffer data into this message.\n ///\n /// For each field in [input] that is already present in this message:\n ///\n /// * If it's a repeated field, this appends to the end of our list.\n /// * Else, if it's a scalar, this overwrites our field.\n /// * Else, (it's a non-repeated sub-message), this recursively merges into\n /// the existing sub-message.\n void mergeFromBuffer(List input,\n [ExtensionRegistry extensionRegistry = ExtensionRegistry.EMPTY]) {\n var codedInput = CodedBufferReader(input);\n _mergeFromCodedBufferReader(_fieldSet, codedInput, extensionRegistry);\n codedInput.checkLastTagWas(0);\n }\n\n // JSON support.\n\n /// Returns the JSON encoding of this message as a Dart [Map].\n ///\n /// The encoding is described in [GeneratedMessage.writeToJson].\n Map writeToJsonMap() => _writeToJsonMap(_fieldSet);\n\n /// Returns a JSON string that encodes this message.\n ///\n /// Each message (top level or nested) is represented as an object delimited\n /// by curly braces. Within a message, elements are indexed by tag number\n /// (surrounded by quotes). Repeated elements are represented as arrays.\n ///\n /// Boolean values, strings, and floating-point values are represented as\n /// literals. Values with a 32-bit integer datatype are represented as integer\n /// literals; values with a 64-bit integer datatype (regardless of their\n /// actual runtime value) are represented as strings. Enumerated values are\n /// represented as their integer value.\n ///\n /// For the proto3 JSON format use: [toProto3JSON].\n String writeToJson() => jsonEncode(writeToJsonMap());\n\n /// Returns an Object representing Proto3 JSON serialization of [this].\n ///\n /// The key for each field is be the camel-cased name of the field.\n ///\n /// Well-known types and their special JSON encoding are supported.\n /// If a well-known type cannot be encoded (eg. a `google.protobuf.Timestamp`\n /// with negative `nanoseconds`) an error is thrown.\n ///\n /// Extensions and unknown fields are not encoded.\n ///\n /// The [typeRegistry] is be used for encoding `Any` messages. If an `Any`\n /// message encoding a type not in [typeRegistry] is encountered, an\n /// error is thrown.\n Object toProto3Json(\n {TypeRegistry typeRegistry = const TypeRegistry.empty()}) =>\n _writeToProto3Json(_fieldSet, typeRegistry);\n\n /// Merges field values from [json], a JSON object using proto3 encoding.\n ///\n /// Well-known types and their special JSON encoding are supported.\n ///\n /// If [ignoreUnknownFields] is `false` (the default) an\n /// [FormatException] is be thrown if an unknown field or enum name\n /// is encountered. Otherwise the unknown field or enum is ignored.\n ///\n /// If [supportNamesWithUnderscores] is `true` (the default) field names in\n /// the JSON can be represented as either camel-case JSON-names or names with\n /// underscores.\n /// If `false` only the JSON names are supported.\n ///\n /// If [permissiveEnums] is `true` (default `false`) enum values in the\n /// JSON will be matched without case insensitivity and ignoring `-`s and `_`.\n /// This allows JSON values like `camelCase` and `kebab-case` to match the\n /// enum values `CAMEL_CASE` and `KEBAB_CASE`.\n /// In case of ambiguities between the enum values, the first matching value\n /// will be found.\n ///\n /// The [typeRegistry] is be used for decoding `Any` messages. If an `Any`\n /// message encoding a type not in [typeRegistry] is encountered, a\n /// [FormatException] is thrown.\n ///\n /// If the JSON is otherwise not formatted correctly (a String where a\n /// number was expected etc.) a [FormatException] is thrown.\n void mergeFromProto3Json(Object json,\n {TypeRegistry typeRegistry = const TypeRegistry.empty(),\n bool ignoreUnknownFields = false,\n bool supportNamesWithUnderscores = true,\n bool permissiveEnums = false}) =>\n _mergeFromProto3Json(json, _fieldSet, typeRegistry, ignoreUnknownFields,\n supportNamesWithUnderscores, permissiveEnums);\n\n /// Merges field values from [data], a JSON object, encoded as described by\n /// [GeneratedMessage.writeToJson].\n ///\n /// For the proto3 JSON format use: [mergeFromProto3JSON].\n void mergeFromJson(String data,\n [ExtensionRegistry extensionRegistry = ExtensionRegistry.EMPTY]) {\n /// Disable lazy creation of Dart objects for a dart2js speedup.\n /// This is a slight regression on the Dart VM.\n /// TODO(skybrian) we could skip the reviver if we're running\n /// on the Dart VM for a slight speedup.\n final jsonMap =\n jsonDecode(data, reviver: _emptyReviver) as Map;\n _mergeFromJsonMap(_fieldSet, jsonMap, extensionRegistry);\n }\n\n static dynamic _emptyReviver(k, v) => v;\n\n /// Merges field values from a JSON object represented as a Dart map.\n ///\n /// The encoding is described in [GeneratedMessage.writeToJson].\n void mergeFromJsonMap(Map json,\n [ExtensionRegistry extensionRegistry = ExtensionRegistry.EMPTY]) {\n _mergeFromJsonMap(_fieldSet, json, extensionRegistry);\n }\n\n /// Adds an extension field value to a repeated field.\n ///\n /// The backing [List] will be created if necessary.\n /// If the list already exists, the old extension won't be overwritten.\n void addExtension(Extension extension, var value) {\n if (!extension.isRepeated) {\n throw ArgumentError(\n 'Cannot add to a non-repeated field (use setExtension())');\n }\n _fieldSet._ensureExtensions().._ensureRepeatedField(extension).add(value);\n }\n\n /// Clears an extension field and also removes the extension.\n void clearExtension(Extension extension) {\n if (_fieldSet._hasExtensions) {\n _fieldSet._extensions._clearFieldAndInfo(extension);\n }\n }\n\n /// Clears the contents of a given field.\n ///\n /// If it's an extension field, the Extension will be kept.\n /// The tagNumber should be a valid tag or extension.\n void clearField(int tagNumber) => _fieldSet._clearField(tagNumber);\n\n int $_whichOneof(int oneofIndex) => _fieldSet._oneofCases[oneofIndex] ?? 0;\n\n bool extensionsAreInitialized() => _fieldSet._hasRequiredExtensionValues();\n\n /// Returns the value of [extension].\n ///\n /// If not set, returns the extension's default value.\n dynamic getExtension(Extension extension) {\n return _fieldSet._ensureExtensions()._getFieldOrDefault(extension);\n }\n\n /// Returns the value of the field associated with [tagNumber], or the\n /// default value if it is not set.\n dynamic getField(int tagNumber) => _fieldSet._getField(tagNumber);\n\n /// Creates List implementing a mutable repeated field.\n ///\n /// Mixins may override this method to change the List type. To ensure\n /// that the protobuf can be encoded correctly, the returned List must\n /// validate all items added to it. This can most easily be done\n /// using the FieldInfo.check function.\n List createRepeatedField(int tagNumber, FieldInfo fi) {\n return PbList(check: fi.check);\n }\n\n /// Creates a Map representing a map field.\n Map createMapField(int tagNumber, MapFieldInfo fi) {\n return PbMap(\n fi.keyFieldType, fi.valueFieldType, fi.mapEntryBuilderInfo);\n }\n\n /// Returns the value of a field, ignoring any defaults.\n ///\n /// For unset or cleared fields, returns null.\n /// Also returns null for unknown tag numbers.\n dynamic getFieldOrNull(int tagNumber) =>\n _fieldSet._getFieldOrNullByTag(tagNumber);\n\n /// Returns the default value for the given field.\n ///\n /// For repeated fields, returns an immutable empty list\n /// (unlike [getField]). For all other fields, returns\n /// the same thing that getField() would for a cleared field.\n dynamic getDefaultForField(int tagNumber) =>\n _fieldSet._ensureInfo(tagNumber).readonlyDefault;\n\n /// Returns [:true:] if a value of [extension] is present.\n bool hasExtension(Extension extension) =>\n _fieldSet._hasExtensions &&\n _fieldSet._extensions._getFieldOrNull(extension) != null;\n\n /// Returns [:true:] if this message has a field associated with [tagNumber].\n bool hasField(int tagNumber) => _fieldSet._hasField(tagNumber);\n\n /// Merges the contents of the [other] into this message.\n ///\n /// Singular fields that are set in [other] overwrite the corresponding fields\n /// in this message. Repeated fields are appended. Singular sub-messages are\n /// recursively merged.\n void mergeFromMessage(GeneratedMessage other) =>\n _fieldSet._mergeFromMessage(other._fieldSet);\n\n void mergeUnknownFields(UnknownFieldSet unknownFieldSet) => _fieldSet\n ._ensureUnknownFields()\n .mergeFromUnknownFieldSet(unknownFieldSet);\n\n /// Sets the value of a non-repeated extension field to [value].\n void setExtension(Extension extension, value) {\n if (value == null) throw ArgumentError('value is null');\n if (_isRepeated(extension.type)) {\n throw ArgumentError(_fieldSet._setFieldFailedMessage(\n extension, value, 'repeating field (use get + .add())'));\n }\n _fieldSet._ensureExtensions()._setFieldAndInfo(extension, value);\n }\n\n /// Sets the value of a field by its [tagNumber].\n ///\n /// Throws an [:ArgumentError:] if [value] does not match the type\n /// associated with [tagNumber].\n ///\n /// Throws an [:ArgumentError:] if [value] is [:null:]. To clear a field of\n /// it's current value, use [clearField] instead.\n void setField(int tagNumber, value) {\n _fieldSet._setField(tagNumber, value);\n return; // ignore: dead_code\n return; // ignore: dead_code\n }\n\n /// For generated code only.\n T $_get(int index, T defaultValue) =>\n _fieldSet._$get(index, defaultValue);\n\n /// For generated code only.\n T $_getN(int index) {\n // The implicit downcast at the return is always correct by construction\n // from the protoc generator. dart2js will omit the implicit downcast when\n // compiling with `-O3` or higher. We should introduce some way to\n // communicate that the downcast cannot fail to the other compilers.\n //\n // TODO(sra): With NNDB we will need to add 'as T', and a dart2js annotation\n // (to be implemented) to omit the 'as' check.\n return _fieldSet._$getND(index);\n }\n\n /// For generated code only.\n T $_ensure(int index) {\n return _fieldSet._$ensure(index);\n }\n\n /// For generated code only.\n List $_getList(int index) => _fieldSet._$getList(index);\n\n /// For generated code only.\n Map $_getMap(int index) => _fieldSet._$getMap(index);\n\n /// For generated code only.\n bool $_getB(int index, bool defaultValue) =>\n _fieldSet._$getB(index, defaultValue);\n\n /// For generated code only.\n bool $_getBF(int index) => _fieldSet._$getBF(index);\n\n /// For generated code only.\n int $_getI(int index, int defaultValue) =>\n _fieldSet._$getI(index, defaultValue);\n\n /// For generated code only.\n int $_getIZ(int index) => _fieldSet._$getIZ(index);\n\n /// For generated code only.\n String $_getS(int index, String defaultValue) =>\n _fieldSet._$getS(index, defaultValue);\n\n /// For generated code only.\n String $_getSZ(int index) => _fieldSet._$getSZ(index);\n\n /// For generated code only.\n Int64 $_getI64(int index) => _fieldSet._$getI64(index);\n\n /// For generated code only.\n bool $_has(int index) => _fieldSet._$has(index);\n\n /// For generated code only.\n void $_setBool(int index, bool value) => _fieldSet._$set(index, value);\n\n /// For generated code only.\n void $_setBytes(int index, List value) => _fieldSet._$set(index, value);\n\n /// For generated code only.\n void $_setString(int index, String value) => _fieldSet._$set(index, value);\n\n /// For generated code only.\n void $_setFloat(int index, double value) {\n if (value == null || !_isFloat32(value)) {\n _fieldSet._$check(index, value);\n }\n _fieldSet._$set(index, value);\n }\n\n /// For generated code only.\n void $_setDouble(int index, double value) => _fieldSet._$set(index, value);\n\n /// For generated code only.\n void $_setSignedInt32(int index, int value) {\n if (value == null || !_isSigned32(value)) {\n _fieldSet._$check(index, value);\n }\n _fieldSet._$set(index, value);\n }\n\n /// For generated code only.\n void $_setUnsignedInt32(int index, int value) {\n if (value == null || !_isUnsigned32(value)) {\n _fieldSet._$check(index, value);\n }\n _fieldSet._$set(index, value);\n }\n\n /// For generated code only.\n void $_setInt64(int index, Int64 value) => _fieldSet._$set(index, value);\n\n // Support for generating a read-only default singleton instance.\n\n static final Map _defaultMakers = {};\n\n static T Function() _defaultMakerFor(\n T Function() createFn) {\n return _defaultMakers[createFn] ??= _createDefaultMakerFor(createFn);\n }\n\n static T Function() _createDefaultMakerFor(\n T Function() createFn) {\n T defaultValue;\n T defaultMaker() {\n return defaultValue ??= createFn()..freeze();\n }\n\n return defaultMaker;\n }\n\n /// For generated code only.\n static T $_defaultFor(T Function() createFn) =>\n _defaultMakerFor(createFn)();\n}\n\n/// The package name of a protobuf message.\nclass PackageName {\n final String name;\n const PackageName(this.name);\n String get prefix => name == '' ? '' : '$name.';\n}\n\nextension GeneratedMessageGenericExtensions on T {\n /// Apply [updates] to a copy of this message.\n ///\n /// Throws an [ArgumentError] if `this` is not already frozen.\n ///\n /// Makes a writable shallow copy of this message, applies the [updates] to\n /// it, and marks the copy read-only before returning it.\n T rebuild(void Function(T) updates) {\n if (!isFrozen) {\n throw ArgumentError('Rebuilding only works on frozen messages.');\n }\n final t = toBuilder();\n updates(t);\n return t..freeze();\n }\n\n /// Returns a writable deep copy of this message.\n T deepCopy() => info_.createEmptyInstance()..mergeFromMessage(this);\n}\n"},"__index_level_0__":{"kind":"number","value":0,"string":"0"}}},{"rowIdx":146333,"cells":{"repo_id":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src"},"file_path":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src/protobuf/unknown_field_set.dart"},"content":{"kind":"string","value":"// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file\n// for details. All rights reserved. Use of this source code is governed by a\n// BSD-style license that can be found in the LICENSE file.\n\npart of protobuf;\n\nclass UnknownFieldSet {\n static final UnknownFieldSet emptyUnknownFieldSet = UnknownFieldSet()\n .._markReadOnly();\n final Map _fields = {};\n\n UnknownFieldSet();\n\n UnknownFieldSet._clone(UnknownFieldSet unknownFieldSet) {\n mergeFromUnknownFieldSet(unknownFieldSet);\n }\n\n UnknownFieldSet clone() => UnknownFieldSet._clone(this);\n\n bool get isEmpty => _fields.isEmpty;\n bool get isNotEmpty => _fields.isNotEmpty;\n bool _isReadOnly = false;\n\n Map asMap() => Map.from(_fields);\n\n void clear() {\n _ensureWritable('clear');\n _fields.clear();\n }\n\n UnknownFieldSetField getField(int tagNumber) => _fields[tagNumber];\n\n bool hasField(int tagNumber) => _fields.containsKey(tagNumber);\n\n void addField(int number, UnknownFieldSetField field) {\n _ensureWritable('addField');\n _checkFieldNumber(number);\n _fields[number] = field;\n }\n\n void mergeField(int number, UnknownFieldSetField field) {\n _ensureWritable('mergeField');\n _getField(number)\n ..varints.addAll(field.varints)\n ..fixed32s.addAll(field.fixed32s)\n ..fixed64s.addAll(field.fixed64s)\n ..lengthDelimited.addAll(field.lengthDelimited)\n ..groups.addAll(field.groups);\n }\n\n bool mergeFieldFromBuffer(int tag, CodedBufferReader input) {\n _ensureWritable('mergeFieldFromBuffer');\n var number = getTagFieldNumber(tag);\n switch (getTagWireType(tag)) {\n case WIRETYPE_VARINT:\n mergeVarintField(number, input.readInt64());\n return true;\n case WIRETYPE_FIXED64:\n mergeFixed64Field(number, input.readFixed64());\n return true;\n case WIRETYPE_LENGTH_DELIMITED:\n mergeLengthDelimitedField(number, input.readBytes());\n return true;\n case WIRETYPE_START_GROUP:\n var subGroup = input.readUnknownFieldSetGroup(number);\n mergeGroupField(number, subGroup);\n return true;\n case WIRETYPE_END_GROUP:\n return false;\n case WIRETYPE_FIXED32:\n mergeFixed32Field(number, input.readFixed32());\n return true;\n default:\n throw InvalidProtocolBufferException.invalidWireType();\n }\n }\n\n void mergeFromCodedBufferReader(CodedBufferReader input) {\n _ensureWritable('mergeFromCodedBufferReader');\n while (true) {\n var tag = input.readTag();\n if (tag == 0 || !mergeFieldFromBuffer(tag, input)) {\n break;\n }\n }\n }\n\n void mergeFromUnknownFieldSet(UnknownFieldSet other) {\n _ensureWritable('mergeFromUnknownFieldSet');\n for (var key in other._fields.keys) {\n mergeField(key, other._fields[key]);\n }\n }\n\n void _checkFieldNumber(int number) {\n if (number == 0) {\n throw ArgumentError('Zero is not a valid field number.');\n }\n }\n\n void mergeFixed32Field(int number, int value) {\n _ensureWritable('mergeFixed32Field');\n _getField(number).addFixed32(value);\n }\n\n void mergeFixed64Field(int number, Int64 value) {\n _ensureWritable('mergeFixed64Field');\n _getField(number).addFixed64(value);\n }\n\n void mergeGroupField(int number, UnknownFieldSet value) {\n _ensureWritable('mergeGroupField');\n _getField(number).addGroup(value);\n }\n\n void mergeLengthDelimitedField(int number, List value) {\n _ensureWritable('mergeLengthDelimitedField');\n _getField(number).addLengthDelimited(value);\n }\n\n void mergeVarintField(int number, Int64 value) {\n _ensureWritable('mergeVarintField');\n _getField(number).addVarint(value);\n }\n\n UnknownFieldSetField _getField(int number) {\n _checkFieldNumber(number);\n if (_isReadOnly) assert(_fields.containsKey(number));\n return _fields.putIfAbsent(number, () => UnknownFieldSetField());\n }\n\n @override\n bool operator ==(other) {\n if (other is! UnknownFieldSet) return false;\n\n UnknownFieldSet o = other;\n return _areMapsEqual(o._fields, _fields);\n }\n\n @override\n int get hashCode {\n var hash = 0;\n _fields.forEach((int number, Object value) {\n hash = 0x1fffffff & ((37 * hash) + number);\n hash = 0x1fffffff & ((53 * hash) + value.hashCode);\n });\n return hash;\n }\n\n @override\n String toString() => _toString('');\n\n String _toString(String indent) {\n var stringBuffer = StringBuffer();\n\n for (var tag in _sorted(_fields.keys)) {\n var field = _fields[tag];\n for (var value in field.values) {\n if (value is UnknownFieldSet) {\n stringBuffer\n ..write('${indent}${tag}: {\\n')\n ..write(value._toString('$indent '))\n ..write('${indent}}\\n');\n } else {\n if (value is ByteData) {\n // TODO(antonm): fix for longs.\n value = value.getUint64(0, Endian.little);\n }\n stringBuffer.write('${indent}${tag}: ${value}\\n');\n }\n }\n }\n\n return stringBuffer.toString();\n }\n\n void writeToCodedBufferWriter(CodedBufferWriter output) {\n for (var key in _fields.keys) {\n _fields[key].writeTo(key, output);\n }\n }\n\n void _markReadOnly() {\n if (_isReadOnly) return;\n _fields.values.forEach((UnknownFieldSetField f) => f._markReadOnly());\n _isReadOnly = true;\n }\n\n void _ensureWritable(String methodName) {\n if (_isReadOnly) {\n frozenMessageModificationHandler('UnknownFieldSet', methodName);\n }\n }\n}\n\nclass UnknownFieldSetField {\n List> _lengthDelimited = >[];\n List _varints = [];\n List _fixed32s = [];\n List _fixed64s = [];\n List _groups = [];\n\n List> get lengthDelimited => _lengthDelimited;\n List get varints => _varints;\n List get fixed32s => _fixed32s;\n List get fixed64s => _fixed64s;\n List get groups => _groups;\n\n bool _isReadOnly = false;\n\n void _markReadOnly() {\n if (_isReadOnly) return;\n _isReadOnly = true;\n _lengthDelimited = List.unmodifiable(_lengthDelimited);\n _varints = List.unmodifiable(_varints);\n _fixed32s = List.unmodifiable(_fixed32s);\n _fixed64s = List.unmodifiable(_fixed64s);\n _groups = List.unmodifiable(_groups);\n }\n\n @override\n bool operator ==(other) {\n if (other is! UnknownFieldSetField) return false;\n\n UnknownFieldSetField o = other;\n if (lengthDelimited.length != o.lengthDelimited.length) return false;\n for (var i = 0; i < lengthDelimited.length; i++) {\n if (!_areListsEqual(o.lengthDelimited[i], lengthDelimited[i])) {\n return false;\n }\n }\n if (!_areListsEqual(o.varints, varints)) return false;\n if (!_areListsEqual(o.fixed32s, fixed32s)) return false;\n if (!_areListsEqual(o.fixed64s, fixed64s)) return false;\n if (!_areListsEqual(o.groups, groups)) return false;\n\n return true;\n }\n\n @override\n int get hashCode {\n var hash = 0;\n for (final value in lengthDelimited) {\n for (var i = 0; i < value.length; i++) {\n hash = 0x1fffffff & (hash + value[i]);\n hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10));\n hash = hash ^ (hash >> 6);\n }\n hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3));\n hash = hash ^ (hash >> 11);\n hash = 0x1fffffff & (hash + ((0x00003fff & hash) << 15));\n }\n for (final value in varints) {\n hash = 0x1fffffff & (hash + (7 * value.hashCode));\n }\n for (final value in fixed32s) {\n hash = 0x1fffffff & (hash + (37 * value.hashCode));\n }\n for (final value in fixed64s) {\n hash = 0x1fffffff & (hash + (53 * value.hashCode));\n }\n for (final value in groups) {\n hash = 0x1fffffff & (hash + value.hashCode);\n }\n return hash;\n }\n\n List get values => []\n ..addAll(lengthDelimited)\n ..addAll(varints)\n ..addAll(fixed32s)\n ..addAll(fixed64s)\n ..addAll(groups);\n\n void writeTo(int fieldNumber, CodedBufferWriter output) {\n void write(type, value) {\n output.writeField(fieldNumber, type, value);\n }\n\n write(PbFieldType._REPEATED_UINT64, varints);\n write(PbFieldType._REPEATED_FIXED32, fixed32s);\n write(PbFieldType._REPEATED_FIXED64, fixed64s);\n write(PbFieldType._REPEATED_BYTES, lengthDelimited);\n write(PbFieldType._REPEATED_GROUP, groups);\n }\n\n void addGroup(UnknownFieldSet value) {\n groups.add(value);\n }\n\n void addLengthDelimited(List value) {\n lengthDelimited.add(value);\n }\n\n void addFixed32(int value) {\n fixed32s.add(value);\n }\n\n void addFixed64(Int64 value) {\n fixed64s.add(value);\n }\n\n void addVarint(Int64 value) {\n varints.add(value);\n }\n\n bool hasRequiredFields() => false;\n\n bool isInitialized() => true;\n\n int get length => values.length;\n}\n"},"__index_level_0__":{"kind":"number","value":0,"string":"0"}}},{"rowIdx":146334,"cells":{"repo_id":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src"},"file_path":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src/protobuf/generated_service.dart"},"content":{"kind":"string","value":"// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file\n// for details. All rights reserved. Use of this source code is governed by a\n// BSD-style license that can be found in the LICENSE file.\n\npart of protobuf;\n\n/// Server side context.\nclass ServerContext {\n // TODO: Place server specific information in this class.\n}\n\n/// The implementation of a Service API.\n///\n/// The protoc plugin generates subclasses (with names ending with ServiceBase)\n/// that extend GeneratedService and dispatch requests by method.\nabstract class GeneratedService {\n /// Creates a message object that can deserialize a request.\n GeneratedMessage createRequest(String methodName);\n\n /// Dispatches the call. The request object should come from [createRequest].\n Future handleCall(\n ServerContext ctx, String methodName, GeneratedMessage request);\n}\n"},"__index_level_0__":{"kind":"number","value":0,"string":"0"}}},{"rowIdx":146335,"cells":{"repo_id":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src"},"file_path":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src/protobuf/rpc_client.dart"},"content":{"kind":"string","value":"// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file\n// for details. All rights reserved. Use of this source code is governed by a\n// BSD-style license that can be found in the LICENSE file.\n\npart of protobuf;\n\n/// Client side context.\nclass ClientContext {\n /// The desired timeout of the RPC call.\n final Duration timeout;\n\n ClientContext({this.timeout});\n}\n\n/// Client-side transport for making calls to a service.\n///\n/// Subclasses implement whatever serialization and networking is needed\n/// to make a call. They should serialize the request to binary or JSON as\n/// appropriate and merge the response into the supplied emptyResponse\n/// before returning it.\n///\n/// The protoc plugin generates a client-side stub for each service that\n/// takes an RpcClient as a constructor parameter.\nabstract class RpcClient {\n /// Sends a request to a server and returns the reply.\n ///\n /// The implementation should serialize the request as binary or JSON, as\n /// appropriate. It should merge the reply into [emptyResponse] and\n /// return it.\n Future invoke(\n ClientContext ctx,\n String serviceName,\n String methodName,\n GeneratedMessage request,\n T emptyResponse);\n}\n"},"__index_level_0__":{"kind":"number","value":0,"string":"0"}}},{"rowIdx":146336,"cells":{"repo_id":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src"},"file_path":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src/protobuf/json.dart"},"content":{"kind":"string","value":"// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file\n// for details. All rights reserved. Use of this source code is governed by a\n// BSD-style license that can be found in the LICENSE file.\n\npart of protobuf;\n\nMap _writeToJsonMap(_FieldSet fs) {\n dynamic convertToMap(dynamic fieldValue, int fieldType) {\n var baseType = PbFieldType._baseType(fieldType);\n\n if (_isRepeated(fieldType)) {\n return List.from(fieldValue.map((e) => convertToMap(e, baseType)));\n }\n\n switch (baseType) {\n case PbFieldType._BOOL_BIT:\n case PbFieldType._STRING_BIT:\n case PbFieldType._FLOAT_BIT:\n case PbFieldType._DOUBLE_BIT:\n case PbFieldType._INT32_BIT:\n case PbFieldType._SINT32_BIT:\n case PbFieldType._UINT32_BIT:\n case PbFieldType._FIXED32_BIT:\n case PbFieldType._SFIXED32_BIT:\n return fieldValue;\n case PbFieldType._BYTES_BIT:\n // Encode 'bytes' as a base64-encoded string.\n return base64Encode(fieldValue as List);\n case PbFieldType._ENUM_BIT:\n return fieldValue.value; // assume |value| < 2^52\n case PbFieldType._INT64_BIT:\n case PbFieldType._SINT64_BIT:\n case PbFieldType._SFIXED64_BIT:\n return fieldValue.toString();\n case PbFieldType._UINT64_BIT:\n case PbFieldType._FIXED64_BIT:\n return fieldValue.toStringUnsigned();\n case PbFieldType._GROUP_BIT:\n case PbFieldType._MESSAGE_BIT:\n return fieldValue.writeToJsonMap();\n default:\n throw 'Unknown type $fieldType';\n }\n }\n\n List _writeMap(dynamic fieldValue, MapFieldInfo fi) =>\n List.from(fieldValue.entries.map((MapEntry e) => {\n '${PbMap._keyFieldNumber}': convertToMap(e.key, fi.keyFieldType),\n '${PbMap._valueFieldNumber}':\n convertToMap(e.value, fi.valueFieldType)\n }));\n\n var result = {};\n for (var fi in fs._infosSortedByTag) {\n var value = fs._values[fi.index];\n if (value == null || (value is List && value.isEmpty)) {\n continue; // It's missing, repeated, or an empty byte array.\n }\n if (_isMapField(fi.type)) {\n result['${fi.tagNumber}'] = _writeMap(value, fi);\n continue;\n }\n result['${fi.tagNumber}'] = convertToMap(value, fi.type);\n }\n if (fs._hasExtensions) {\n for (var tagNumber in _sorted(fs._extensions._tagNumbers)) {\n var value = fs._extensions._values[tagNumber];\n if (value is List && value.isEmpty) {\n continue; // It's repeated or an empty byte array.\n }\n var fi = fs._extensions._getInfoOrNull(tagNumber);\n result['$tagNumber'] = convertToMap(value, fi.type);\n }\n }\n return result;\n}\n\n// Merge fields from a previously decoded JSON object.\n// (Called recursively on nested messages.)\nvoid _mergeFromJsonMap(\n _FieldSet fs, Map json, ExtensionRegistry registry) {\n var keys = json.keys;\n var meta = fs._meta;\n for (var key in keys) {\n var fi = meta.byTagAsString[key];\n if (fi == null) {\n if (registry == null) continue; // Unknown tag; skip\n fi = registry.getExtension(fs._messageName, int.parse(key));\n if (fi == null) continue; // Unknown tag; skip\n }\n if (fi.isMapField) {\n _appendJsonMap(fs, json[key], fi, registry);\n } else if (fi.isRepeated) {\n _appendJsonList(fs, json[key], fi, registry);\n } else {\n _setJsonField(fs, json[key], fi, registry);\n }\n }\n}\n\nvoid _appendJsonList(\n _FieldSet fs, List jsonList, FieldInfo fi, ExtensionRegistry registry) {\n var repeated = fi._ensureRepeatedField(fs);\n // Micro optimization. Using \"for in\" generates the following and iterator\n // alloc:\n // for (t1 = J.get$iterator$ax(json), t2 = fi.tagNumber, t3 = fi.type,\n // t4 = J.getInterceptor$ax(repeated); t1.moveNext$0();)\n for (var i = 0, len = jsonList.length; i < len; i++) {\n var value = jsonList[i];\n var convertedValue =\n _convertJsonValue(fs, value, fi.tagNumber, fi.type, registry);\n if (convertedValue != null) {\n repeated.add(convertedValue);\n }\n }\n}\n\nvoid _appendJsonMap(\n _FieldSet fs, List jsonList, MapFieldInfo fi, ExtensionRegistry registry) {\n PbMap map = fi._ensureMapField(fs);\n for (Map jsonEntry in jsonList) {\n var entryFieldSet = map._entryFieldSet();\n final convertedKey = _convertJsonValue(\n entryFieldSet,\n jsonEntry['${PbMap._keyFieldNumber}'],\n PbMap._keyFieldNumber,\n fi.keyFieldType,\n registry);\n final convertedValue = _convertJsonValue(\n entryFieldSet,\n jsonEntry['${PbMap._valueFieldNumber}'],\n PbMap._valueFieldNumber,\n fi.valueFieldType,\n registry);\n map[convertedKey] = convertedValue;\n }\n}\n\nvoid _setJsonField(\n _FieldSet fs, json, FieldInfo fi, ExtensionRegistry registry) {\n var value = _convertJsonValue(fs, json, fi.tagNumber, fi.type, registry);\n if (value == null) return;\n // _convertJsonValue throws exception when it fails to do conversion.\n // Therefore we run _validateField for debug builds only to validate\n // correctness of conversion.\n assert(() {\n fs._validateField(fi, value);\n return true;\n }());\n fs._setFieldUnchecked(fi, value);\n}\n\n/// Converts [value] from the Json format to the Dart data type\n/// suitable for inserting into the corresponding [GeneratedMessage] field.\n///\n/// Returns the converted value. This function returns [null] if the caller\n/// should ignore the field value, because it is an unknown enum value.\n/// This function throws [ArgumentError] if it cannot convert the value.\ndynamic _convertJsonValue(_FieldSet fs, value, int tagNumber, int fieldType,\n ExtensionRegistry registry) {\n String expectedType; // for exception message\n switch (PbFieldType._baseType(fieldType)) {\n case PbFieldType._BOOL_BIT:\n if (value is bool) {\n return value;\n } else if (value is String) {\n if (value == 'true') {\n return true;\n } else if (value == 'false') {\n return false;\n }\n } else if (value is num) {\n if (value == 1) {\n return true;\n } else if (value == 0) {\n return false;\n }\n }\n expectedType = 'bool (true, false, \"true\", \"false\", 1, 0)';\n break;\n case PbFieldType._BYTES_BIT:\n if (value is String) {\n return base64Decode(value);\n }\n expectedType = 'Base64 String';\n break;\n case PbFieldType._STRING_BIT:\n if (value is String) {\n return value;\n }\n expectedType = 'String';\n break;\n case PbFieldType._FLOAT_BIT:\n case PbFieldType._DOUBLE_BIT:\n // Allow quoted values, although we don't emit them.\n if (value is double) {\n return value;\n } else if (value is num) {\n return value.toDouble();\n } else if (value is String) {\n return double.parse(value);\n }\n expectedType = 'num or stringified num';\n break;\n case PbFieldType._ENUM_BIT:\n // Allow quoted values, although we don't emit them.\n if (value is String) {\n value = int.parse(value);\n }\n if (value is int) {\n // The following call will return null if the enum value is unknown.\n // In that case, we want the caller to ignore this value, so we return\n // null from this method as well.\n return fs._meta._decodeEnum(tagNumber, registry, value);\n }\n expectedType = 'int or stringified int';\n break;\n case PbFieldType._INT32_BIT:\n case PbFieldType._SINT32_BIT:\n case PbFieldType._UINT32_BIT:\n case PbFieldType._FIXED32_BIT:\n case PbFieldType._SFIXED32_BIT:\n if (value is int) return value;\n if (value is String) return int.parse(value);\n expectedType = 'int or stringified int';\n break;\n case PbFieldType._INT64_BIT:\n case PbFieldType._SINT64_BIT:\n case PbFieldType._UINT64_BIT:\n case PbFieldType._FIXED64_BIT:\n case PbFieldType._SFIXED64_BIT:\n if (value is int) return Int64(value);\n if (value is String) return Int64.parseInt(value);\n expectedType = 'int or stringified int';\n break;\n case PbFieldType._GROUP_BIT:\n case PbFieldType._MESSAGE_BIT:\n if (value is Map) {\n Map messageValue = value;\n var subMessage = fs._meta._makeEmptyMessage(tagNumber, registry);\n _mergeFromJsonMap(subMessage._fieldSet, messageValue, registry);\n return subMessage;\n }\n expectedType = 'nested message or group';\n break;\n default:\n throw ArgumentError('Unknown type $fieldType');\n }\n throw ArgumentError('Expected type $expectedType, got $value');\n}\n"},"__index_level_0__":{"kind":"number","value":0,"string":"0"}}},{"rowIdx":146337,"cells":{"repo_id":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src"},"file_path":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src/protobuf/coded_buffer.dart"},"content":{"kind":"string","value":"// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file\n// for details. All rights reserved. Use of this source code is governed by a\n// BSD-style license that can be found in the LICENSE file.\n\npart of protobuf;\n\nvoid _writeToCodedBufferWriter(_FieldSet fs, CodedBufferWriter out) {\n // Sorting by tag number isn't required, but it sometimes enables\n // performance optimizations for the receiver. See:\n // https://developers.google.com/protocol-buffers/docs/encoding?hl=en#order\n\n for (var fi in fs._infosSortedByTag) {\n var value = fs._values[fi.index];\n if (value == null) continue;\n out.writeField(fi.tagNumber, fi.type, value);\n }\n\n if (fs._hasExtensions) {\n for (var tagNumber in _sorted(fs._extensions._tagNumbers)) {\n var fi = fs._extensions._getInfoOrNull(tagNumber);\n out.writeField(tagNumber, fi.type, fs._extensions._getFieldOrNull(fi));\n }\n }\n if (fs._hasUnknownFields) {\n fs._unknownFields.writeToCodedBufferWriter(out);\n }\n}\n\nvoid _mergeFromCodedBufferReader(\n _FieldSet fs, CodedBufferReader input, ExtensionRegistry registry) {\n assert(registry != null);\n\n while (true) {\n var tag = input.readTag();\n if (tag == 0) return;\n var wireType = tag & 0x7;\n var tagNumber = tag >> 3;\n\n var fi = fs._nonExtensionInfo(tagNumber);\n fi ??= registry.getExtension(fs._messageName, tagNumber);\n\n if (fi == null || !_wireTypeMatches(fi.type, wireType)) {\n if (!fs._ensureUnknownFields().mergeFieldFromBuffer(tag, input)) {\n return;\n }\n continue;\n }\n\n // Ignore required/optional packed/unpacked.\n var fieldType = fi.type;\n fieldType &= ~(PbFieldType._PACKED_BIT | PbFieldType._REQUIRED_BIT);\n switch (fieldType) {\n case PbFieldType._OPTIONAL_BOOL:\n fs._setFieldUnchecked(fi, input.readBool());\n break;\n case PbFieldType._OPTIONAL_BYTES:\n fs._setFieldUnchecked(fi, input.readBytes());\n break;\n case PbFieldType._OPTIONAL_STRING:\n fs._setFieldUnchecked(fi, input.readString());\n break;\n case PbFieldType._OPTIONAL_FLOAT:\n fs._setFieldUnchecked(fi, input.readFloat());\n break;\n case PbFieldType._OPTIONAL_DOUBLE:\n fs._setFieldUnchecked(fi, input.readDouble());\n break;\n case PbFieldType._OPTIONAL_ENUM:\n var rawValue = input.readEnum();\n var value = fs._meta._decodeEnum(tagNumber, registry, rawValue);\n if (value == null) {\n var unknown = fs._ensureUnknownFields();\n unknown.mergeVarintField(tagNumber, Int64(rawValue));\n } else {\n fs._setFieldUnchecked(fi, value);\n }\n break;\n case PbFieldType._OPTIONAL_GROUP:\n var subMessage = fs._meta._makeEmptyMessage(tagNumber, registry);\n var oldValue = fs._getFieldOrNull(fi);\n if (oldValue != null) {\n subMessage.mergeFromMessage(oldValue);\n }\n input.readGroup(tagNumber, subMessage, registry);\n fs._setFieldUnchecked(fi, subMessage);\n break;\n case PbFieldType._OPTIONAL_INT32:\n fs._setFieldUnchecked(fi, input.readInt32());\n break;\n case PbFieldType._OPTIONAL_INT64:\n fs._setFieldUnchecked(fi, input.readInt64());\n break;\n case PbFieldType._OPTIONAL_SINT32:\n fs._setFieldUnchecked(fi, input.readSint32());\n break;\n case PbFieldType._OPTIONAL_SINT64:\n fs._setFieldUnchecked(fi, input.readSint64());\n break;\n case PbFieldType._OPTIONAL_UINT32:\n fs._setFieldUnchecked(fi, input.readUint32());\n break;\n case PbFieldType._OPTIONAL_UINT64:\n fs._setFieldUnchecked(fi, input.readUint64());\n break;\n case PbFieldType._OPTIONAL_FIXED32:\n fs._setFieldUnchecked(fi, input.readFixed32());\n break;\n case PbFieldType._OPTIONAL_FIXED64:\n fs._setFieldUnchecked(fi, input.readFixed64());\n break;\n case PbFieldType._OPTIONAL_SFIXED32:\n fs._setFieldUnchecked(fi, input.readSfixed32());\n break;\n case PbFieldType._OPTIONAL_SFIXED64:\n fs._setFieldUnchecked(fi, input.readSfixed64());\n break;\n case PbFieldType._OPTIONAL_MESSAGE:\n var subMessage = fs._meta._makeEmptyMessage(tagNumber, registry);\n var oldValue = fs._getFieldOrNull(fi);\n if (oldValue != null) {\n subMessage.mergeFromMessage(oldValue);\n }\n input.readMessage(subMessage, registry);\n fs._setFieldUnchecked(fi, subMessage);\n break;\n case PbFieldType._REPEATED_BOOL:\n _readPackable(fs, input, wireType, fi, input.readBool);\n break;\n case PbFieldType._REPEATED_BYTES:\n fs._ensureRepeatedField(fi).add(input.readBytes());\n break;\n case PbFieldType._REPEATED_STRING:\n fs._ensureRepeatedField(fi).add(input.readString());\n break;\n case PbFieldType._REPEATED_FLOAT:\n _readPackable(fs, input, wireType, fi, input.readFloat);\n break;\n case PbFieldType._REPEATED_DOUBLE:\n _readPackable(fs, input, wireType, fi, input.readDouble);\n break;\n case PbFieldType._REPEATED_ENUM:\n _readPackableToListEnum(fs, input, wireType, fi, tagNumber, registry);\n break;\n case PbFieldType._REPEATED_GROUP:\n var subMessage = fs._meta._makeEmptyMessage(tagNumber, registry);\n input.readGroup(tagNumber, subMessage, registry);\n fs._ensureRepeatedField(fi).add(subMessage);\n break;\n case PbFieldType._REPEATED_INT32:\n _readPackable(fs, input, wireType, fi, input.readInt32);\n break;\n case PbFieldType._REPEATED_INT64:\n _readPackable(fs, input, wireType, fi, input.readInt64);\n break;\n case PbFieldType._REPEATED_SINT32:\n _readPackable(fs, input, wireType, fi, input.readSint32);\n break;\n case PbFieldType._REPEATED_SINT64:\n _readPackable(fs, input, wireType, fi, input.readSint64);\n break;\n case PbFieldType._REPEATED_UINT32:\n _readPackable(fs, input, wireType, fi, input.readUint32);\n break;\n case PbFieldType._REPEATED_UINT64:\n _readPackable(fs, input, wireType, fi, input.readUint64);\n break;\n case PbFieldType._REPEATED_FIXED32:\n _readPackable(fs, input, wireType, fi, input.readFixed32);\n break;\n case PbFieldType._REPEATED_FIXED64:\n _readPackable(fs, input, wireType, fi, input.readFixed64);\n break;\n case PbFieldType._REPEATED_SFIXED32:\n _readPackable(fs, input, wireType, fi, input.readSfixed32);\n break;\n case PbFieldType._REPEATED_SFIXED64:\n _readPackable(fs, input, wireType, fi, input.readSfixed64);\n break;\n case PbFieldType._REPEATED_MESSAGE:\n var subMessage = fs._meta._makeEmptyMessage(tagNumber, registry);\n input.readMessage(subMessage, registry);\n fs._ensureRepeatedField(fi).add(subMessage);\n break;\n case PbFieldType._MAP:\n fs._ensureMapField(fi)._mergeEntry(input, registry);\n break;\n default:\n throw 'Unknown field type $fieldType';\n }\n }\n}\n\nvoid _readPackable(_FieldSet fs, CodedBufferReader input, int wireType,\n FieldInfo fi, Function readFunc) {\n void readToList(List list) => list.add(readFunc());\n _readPackableToList(fs, input, wireType, fi, readToList);\n}\n\nvoid _readPackableToListEnum(_FieldSet fs, CodedBufferReader input,\n int wireType, FieldInfo fi, int tagNumber, ExtensionRegistry registry) {\n void readToList(List list) {\n var rawValue = input.readEnum();\n var value = fs._meta._decodeEnum(tagNumber, registry, rawValue);\n if (value == null) {\n var unknown = fs._ensureUnknownFields();\n unknown.mergeVarintField(tagNumber, Int64(rawValue));\n } else {\n list.add(value);\n }\n }\n\n _readPackableToList(fs, input, wireType, fi, readToList);\n}\n\nvoid _readPackableToList(_FieldSet fs, CodedBufferReader input, int wireType,\n FieldInfo fi, Function readToList) {\n var list = fs._ensureRepeatedField(fi);\n\n if (wireType == WIRETYPE_LENGTH_DELIMITED) {\n // Packed.\n input._withLimit(input.readInt32(), () {\n while (!input.isAtEnd()) {\n readToList(list);\n }\n });\n } else {\n // Not packed.\n readToList(list);\n }\n}\n"},"__index_level_0__":{"kind":"number","value":0,"string":"0"}}},{"rowIdx":146338,"cells":{"repo_id":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src"},"file_path":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src/protobuf/protobuf_enum.dart"},"content":{"kind":"string","value":"// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file\n// for details. All rights reserved. Use of this source code is governed by a\n// BSD-style license that can be found in the LICENSE file.\n\npart of protobuf;\n\n/// A base class for all Protocol Buffer enum types.\n///\n/// All Protocol Buffer [:enum:] classes inherit from ProtobufEnum. For\n/// example, given the following enum defined in a .proto file:\n///\n/// message MyMessage {\n/// enum Color {\n/// RED = 0;\n/// GREEN = 1;\n/// BLUE = 2;\n/// };\n/// // ...\n/// }\n///\n/// the generated Dart file will include a [:MyMessage_Color:] class that\n/// [:extends ProtobufEnum:]. It will also include a [:const MyMessage_Color:]\n/// for each of the three values defined. Here are some examples:\n///\n/// MyMessage_Color.RED // => a MyMessage_Color instance\n/// MyMessage_Color.GREEN.value // => 1\n/// MyMessage_Color.GREEN.name // => \"GREEN\"\nclass ProtobufEnum {\n /// This enum's integer value, as specified in the .proto file.\n final int value;\n\n /// This enum's name, as specified in the .proto file.\n final String name;\n\n /// Returns a new constant ProtobufEnum using [value] and [name].\n const ProtobufEnum(this.value, this.name);\n\n /// Returns a Map for all of the [ProtobufEnum]s in [byIndex], mapping each\n /// [ProtobufEnum]'s [value] to the [ProtobufEnum].\n static Map initByValue(List byIndex) {\n var byValue = {};\n for (var v in byIndex) {\n byValue[v.value] = v;\n }\n return byValue;\n }\n\n // Subclasses will typically have a private constructor and a fixed set of\n // instances, so `Object.operator==()` will work, and does not need to\n // be overridden explicitly.\n @override\n bool operator ==(Object o);\n\n @override\n int get hashCode => value;\n\n /// Returns this enum's [name].\n @override\n String toString() => name;\n}\n"},"__index_level_0__":{"kind":"number","value":0,"string":"0"}}},{"rowIdx":146339,"cells":{"repo_id":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src"},"file_path":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src/protobuf/json_parsing_context.dart"},"content":{"kind":"string","value":"// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file\n// for details. All rights reserved. Use of this source code is governed by a\n// BSD-style license that can be found in the LICENSE file.\n\nclass JsonParsingContext {\n // A list of indices into maps and lists pointing to the current root.\n final List _path = [];\n final bool ignoreUnknownFields;\n final bool supportNamesWithUnderscores;\n final bool permissiveEnums;\n\n JsonParsingContext(this.ignoreUnknownFields, this.supportNamesWithUnderscores,\n this.permissiveEnums);\n\n void addMapIndex(String index) {\n _path.add(index);\n }\n\n void addListIndex(int index) {\n _path.add(index.toString());\n }\n\n void popIndex() {\n _path.removeLast();\n }\n\n /// Returns a FormatException indicating the indices to the current [path].\n Exception parseException(String message, Object source) {\n var formattedPath = _path.map((s) => '[\\\"$s\\\"]').join();\n return FormatException(\n 'Protobuf JSON decoding failed at: root$formattedPath. $message',\n source);\n }\n}\n"},"__index_level_0__":{"kind":"number","value":0,"string":"0"}}},{"rowIdx":146340,"cells":{"repo_id":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src"},"file_path":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src/protobuf/field_type.dart"},"content":{"kind":"string","value":"// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file\n// for details. All rights reserved. Use of this source code is governed by a\n// BSD-style license that can be found in the LICENSE file.\n\npart of protobuf;\n\nbool _isRepeated(int fieldType) => (fieldType & PbFieldType._REPEATED_BIT) != 0;\n\nbool _isRequired(int fieldType) => (fieldType & PbFieldType._REQUIRED_BIT) != 0;\n\nbool _isEnum(int fieldType) =>\n PbFieldType._baseType(fieldType) == PbFieldType._ENUM_BIT;\n\nbool _isBytes(int fieldType) =>\n PbFieldType._baseType(fieldType) == PbFieldType._BYTES_BIT;\n\nbool _isGroupOrMessage(int fieldType) =>\n (fieldType & (PbFieldType._GROUP_BIT | PbFieldType._MESSAGE_BIT)) != 0;\n\nbool _isMapField(int fieldType) => (fieldType & PbFieldType._MAP_BIT) != 0;\n\n/// Defines constants and functions for dealing with fieldType bits.\nclass PbFieldType {\n /// Returns the base field type without any of the required, repeated\n /// and packed bits.\n static int _baseType(int fieldType) =>\n fieldType & ~(_REQUIRED_BIT | _REPEATED_BIT | _PACKED_BIT | _MAP_BIT);\n\n static MakeDefaultFunc _defaultForType(int type) {\n switch (type) {\n case _OPTIONAL_BOOL:\n case _REQUIRED_BOOL:\n return _BOOL_FALSE;\n case _OPTIONAL_BYTES:\n case _REQUIRED_BYTES:\n return _BYTES_EMPTY;\n case _OPTIONAL_STRING:\n case _REQUIRED_STRING:\n return _STRING_EMPTY;\n case _OPTIONAL_FLOAT:\n case _REQUIRED_FLOAT:\n case _OPTIONAL_DOUBLE:\n case _REQUIRED_DOUBLE:\n return _DOUBLE_ZERO;\n case _OPTIONAL_INT32:\n case _REQUIRED_INT32:\n case _OPTIONAL_INT64:\n case _REQUIRED_INT64:\n case _OPTIONAL_SINT32:\n case _REQUIRED_SINT32:\n case _OPTIONAL_SINT64:\n case _REQUIRED_SINT64:\n case _OPTIONAL_UINT32:\n case _REQUIRED_UINT32:\n case _OPTIONAL_UINT64:\n case _REQUIRED_UINT64:\n case _OPTIONAL_FIXED32:\n case _REQUIRED_FIXED32:\n case _OPTIONAL_FIXED64:\n case _REQUIRED_FIXED64:\n case _OPTIONAL_SFIXED32:\n case _REQUIRED_SFIXED32:\n case _OPTIONAL_SFIXED64:\n case _REQUIRED_SFIXED64:\n return _INT_ZERO;\n default:\n return null;\n }\n }\n\n // Closures commonly used by initializers.\n static String _STRING_EMPTY() => '';\n static List _BYTES_EMPTY() => [];\n static bool _BOOL_FALSE() => false;\n static int _INT_ZERO() => 0;\n static double _DOUBLE_ZERO() => 0.0;\n\n static const int _REQUIRED_BIT = 0x1;\n static const int _REPEATED_BIT = 0x2;\n static const int _PACKED_BIT = 0x4;\n\n static const int _BOOL_BIT = 0x10;\n static const int _BYTES_BIT = 0x20;\n static const int _STRING_BIT = 0x40;\n static const int _DOUBLE_BIT = 0x80;\n static const int _FLOAT_BIT = 0x100;\n static const int _ENUM_BIT = 0x200;\n static const int _GROUP_BIT = 0x400;\n static const int _INT32_BIT = 0x800;\n static const int _INT64_BIT = 0x1000;\n static const int _SINT32_BIT = 0x2000;\n static const int _SINT64_BIT = 0x4000;\n static const int _UINT32_BIT = 0x8000;\n static const int _UINT64_BIT = 0x10000;\n static const int _FIXED32_BIT = 0x20000;\n static const int _FIXED64_BIT = 0x40000;\n static const int _SFIXED32_BIT = 0x80000;\n static const int _SFIXED64_BIT = 0x100000;\n static const int _MESSAGE_BIT = 0x200000;\n static const int _MAP_BIT = 0x400000;\n\n static const int _OPTIONAL_BOOL = _BOOL_BIT;\n static const int _OPTIONAL_BYTES = _BYTES_BIT;\n static const int _OPTIONAL_STRING = _STRING_BIT;\n static const int _OPTIONAL_FLOAT = _FLOAT_BIT;\n static const int _OPTIONAL_DOUBLE = _DOUBLE_BIT;\n static const int _OPTIONAL_ENUM = _ENUM_BIT;\n static const int _OPTIONAL_GROUP = _GROUP_BIT;\n static const int _OPTIONAL_INT32 = _INT32_BIT;\n static const int _OPTIONAL_INT64 = _INT64_BIT;\n static const int _OPTIONAL_SINT32 = _SINT32_BIT;\n static const int _OPTIONAL_SINT64 = _SINT64_BIT;\n static const int _OPTIONAL_UINT32 = _UINT32_BIT;\n static const int _OPTIONAL_UINT64 = _UINT64_BIT;\n static const int _OPTIONAL_FIXED32 = _FIXED32_BIT;\n static const int _OPTIONAL_FIXED64 = _FIXED64_BIT;\n static const int _OPTIONAL_SFIXED32 = _SFIXED32_BIT;\n static const int _OPTIONAL_SFIXED64 = _SFIXED64_BIT;\n static const int _OPTIONAL_MESSAGE = _MESSAGE_BIT;\n\n static const int _REQUIRED_BOOL = _REQUIRED_BIT | _BOOL_BIT;\n static const int _REQUIRED_BYTES = _REQUIRED_BIT | _BYTES_BIT;\n static const int _REQUIRED_STRING = _REQUIRED_BIT | _STRING_BIT;\n static const int _REQUIRED_FLOAT = _REQUIRED_BIT | _FLOAT_BIT;\n static const int _REQUIRED_DOUBLE = _REQUIRED_BIT | _DOUBLE_BIT;\n static const int _REQUIRED_ENUM = _REQUIRED_BIT | _ENUM_BIT;\n static const int _REQUIRED_GROUP = _REQUIRED_BIT | _GROUP_BIT;\n static const int _REQUIRED_INT32 = _REQUIRED_BIT | _INT32_BIT;\n static const int _REQUIRED_INT64 = _REQUIRED_BIT | _INT64_BIT;\n static const int _REQUIRED_SINT32 = _REQUIRED_BIT | _SINT32_BIT;\n static const int _REQUIRED_SINT64 = _REQUIRED_BIT | _SINT64_BIT;\n static const int _REQUIRED_UINT32 = _REQUIRED_BIT | _UINT32_BIT;\n static const int _REQUIRED_UINT64 = _REQUIRED_BIT | _UINT64_BIT;\n static const int _REQUIRED_FIXED32 = _REQUIRED_BIT | _FIXED32_BIT;\n static const int _REQUIRED_FIXED64 = _REQUIRED_BIT | _FIXED64_BIT;\n static const int _REQUIRED_SFIXED32 = _REQUIRED_BIT | _SFIXED32_BIT;\n static const int _REQUIRED_SFIXED64 = _REQUIRED_BIT | _SFIXED64_BIT;\n static const int _REQUIRED_MESSAGE = _REQUIRED_BIT | _MESSAGE_BIT;\n\n static const int _REPEATED_BOOL = _REPEATED_BIT | _BOOL_BIT;\n static const int _REPEATED_BYTES = _REPEATED_BIT | _BYTES_BIT;\n static const int _REPEATED_STRING = _REPEATED_BIT | _STRING_BIT;\n static const int _REPEATED_FLOAT = _REPEATED_BIT | _FLOAT_BIT;\n static const int _REPEATED_DOUBLE = _REPEATED_BIT | _DOUBLE_BIT;\n static const int _REPEATED_ENUM = _REPEATED_BIT | _ENUM_BIT;\n static const int _REPEATED_GROUP = _REPEATED_BIT | _GROUP_BIT;\n static const int _REPEATED_INT32 = _REPEATED_BIT | _INT32_BIT;\n static const int _REPEATED_INT64 = _REPEATED_BIT | _INT64_BIT;\n static const int _REPEATED_SINT32 = _REPEATED_BIT | _SINT32_BIT;\n static const int _REPEATED_SINT64 = _REPEATED_BIT | _SINT64_BIT;\n static const int _REPEATED_UINT32 = _REPEATED_BIT | _UINT32_BIT;\n static const int _REPEATED_UINT64 = _REPEATED_BIT | _UINT64_BIT;\n static const int _REPEATED_FIXED32 = _REPEATED_BIT | _FIXED32_BIT;\n static const int _REPEATED_FIXED64 = _REPEATED_BIT | _FIXED64_BIT;\n static const int _REPEATED_SFIXED32 = _REPEATED_BIT | _SFIXED32_BIT;\n static const int _REPEATED_SFIXED64 = _REPEATED_BIT | _SFIXED64_BIT;\n static const int _REPEATED_MESSAGE = _REPEATED_BIT | _MESSAGE_BIT;\n\n static const int _PACKED_BOOL = _REPEATED_BIT | _PACKED_BIT | _BOOL_BIT;\n static const int _PACKED_FLOAT = _REPEATED_BIT | _PACKED_BIT | _FLOAT_BIT;\n static const int _PACKED_DOUBLE = _REPEATED_BIT | _PACKED_BIT | _DOUBLE_BIT;\n static const int _PACKED_ENUM = _REPEATED_BIT | _PACKED_BIT | _ENUM_BIT;\n static const int _PACKED_INT32 = _REPEATED_BIT | _PACKED_BIT | _INT32_BIT;\n static const int _PACKED_INT64 = _REPEATED_BIT | _PACKED_BIT | _INT64_BIT;\n static const int _PACKED_SINT32 = _REPEATED_BIT | _PACKED_BIT | _SINT32_BIT;\n static const int _PACKED_SINT64 = _REPEATED_BIT | _PACKED_BIT | _SINT64_BIT;\n static const int _PACKED_UINT32 = _REPEATED_BIT | _PACKED_BIT | _UINT32_BIT;\n static const int _PACKED_UINT64 = _REPEATED_BIT | _PACKED_BIT | _UINT64_BIT;\n static const int _PACKED_FIXED32 = _REPEATED_BIT | _PACKED_BIT | _FIXED32_BIT;\n static const int _PACKED_FIXED64 = _REPEATED_BIT | _PACKED_BIT | _FIXED64_BIT;\n static const int _PACKED_SFIXED32 =\n _REPEATED_BIT | _PACKED_BIT | _SFIXED32_BIT;\n static const int _PACKED_SFIXED64 =\n _REPEATED_BIT | _PACKED_BIT | _SFIXED64_BIT;\n\n static const int _MAP = _MAP_BIT | _MESSAGE_BIT;\n // Short names for use in generated code.\n\n // _O_ptional.\n static const int OB = _OPTIONAL_BOOL;\n static const int OY = _OPTIONAL_BYTES;\n static const int OS = _OPTIONAL_STRING;\n static const int OF = _OPTIONAL_FLOAT;\n static const int OD = _OPTIONAL_DOUBLE;\n static const int OE = _OPTIONAL_ENUM;\n static const int OG = _OPTIONAL_GROUP;\n static const int O3 = _OPTIONAL_INT32;\n static const int O6 = _OPTIONAL_INT64;\n static const int OS3 = _OPTIONAL_SINT32;\n static const int OS6 = _OPTIONAL_SINT64;\n static const int OU3 = _OPTIONAL_UINT32;\n static const int OU6 = _OPTIONAL_UINT64;\n static const int OF3 = _OPTIONAL_FIXED32;\n static const int OF6 = _OPTIONAL_FIXED64;\n static const int OSF3 = _OPTIONAL_SFIXED32;\n static const int OSF6 = _OPTIONAL_SFIXED64;\n static const int OM = _OPTIONAL_MESSAGE;\n\n // re_Q_uired.\n static const int QB = _REQUIRED_BOOL;\n static const int QY = _REQUIRED_BYTES;\n static const int QS = _REQUIRED_STRING;\n static const int QF = _REQUIRED_FLOAT;\n static const int QD = _REQUIRED_DOUBLE;\n static const int QE = _REQUIRED_ENUM;\n static const int QG = _REQUIRED_GROUP;\n static const int Q3 = _REQUIRED_INT32;\n static const int Q6 = _REQUIRED_INT64;\n static const int QS3 = _REQUIRED_SINT32;\n static const int QS6 = _REQUIRED_SINT64;\n static const int QU3 = _REQUIRED_UINT32;\n static const int QU6 = _REQUIRED_UINT64;\n static const int QF3 = _REQUIRED_FIXED32;\n static const int QF6 = _REQUIRED_FIXED64;\n static const int QSF3 = _REQUIRED_SFIXED32;\n static const int QSF6 = _REQUIRED_SFIXED64;\n static const int QM = _REQUIRED_MESSAGE;\n\n // re_P_eated.\n static const int PB = _REPEATED_BOOL;\n static const int PY = _REPEATED_BYTES;\n static const int PS = _REPEATED_STRING;\n static const int PF = _REPEATED_FLOAT;\n static const int PD = _REPEATED_DOUBLE;\n static const int PE = _REPEATED_ENUM;\n static const int PG = _REPEATED_GROUP;\n static const int P3 = _REPEATED_INT32;\n static const int P6 = _REPEATED_INT64;\n static const int PS3 = _REPEATED_SINT32;\n static const int PS6 = _REPEATED_SINT64;\n static const int PU3 = _REPEATED_UINT32;\n static const int PU6 = _REPEATED_UINT64;\n static const int PF3 = _REPEATED_FIXED32;\n static const int PF6 = _REPEATED_FIXED64;\n static const int PSF3 = _REPEATED_SFIXED32;\n static const int PSF6 = _REPEATED_SFIXED64;\n static const int PM = _REPEATED_MESSAGE;\n\n // pac_K_ed.\n static const int KB = _PACKED_BOOL;\n static const int KE = _PACKED_ENUM;\n static const int KF = _PACKED_FLOAT;\n static const int KD = _PACKED_DOUBLE;\n static const int K3 = _PACKED_INT32;\n static const int K6 = _PACKED_INT64;\n static const int KS3 = _PACKED_SINT32;\n static const int KS6 = _PACKED_SINT64;\n static const int KU3 = _PACKED_UINT32;\n static const int KU6 = _PACKED_UINT64;\n static const int KF3 = _PACKED_FIXED32;\n static const int KF6 = _PACKED_FIXED64;\n static const int KSF3 = _PACKED_SFIXED32;\n static const int KSF6 = _PACKED_SFIXED64;\n\n static const int M = _MAP;\n}\n"},"__index_level_0__":{"kind":"number","value":0,"string":"0"}}},{"rowIdx":146341,"cells":{"repo_id":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src"},"file_path":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src/protobuf/event_plugin.dart"},"content":{"kind":"string","value":"part of protobuf;\n\n/// An EventPlugin receives callbacks when the fields of a GeneratedMessage\n/// change.\n///\n/// A GeneratedMessage mixin can install a plugin by overriding the eventPlugin\n/// property. The intent is provide mechanism, not policy; each mixin defines\n/// its own public API, perhaps using streams.\n///\n/// This is a low-level, synchronous API. Event handlers are called in the\n/// middle of protobuf changes. To avoid exposing half-finished changes\n/// to user code, plugins should buffer events and send them asynchronously.\n/// (See event_mixin.dart for an example.)\nabstract class EventPlugin {\n /// Initializes the plugin.\n ///\n /// GeneratedMessage calls this once in its constructors.\n void attach(GeneratedMessage parent);\n\n /// If false, GeneratedMessage will skip calls to event handlers.\n bool get hasObservers;\n\n /// Called before setting a field.\n ///\n /// For repeated fields, this will be called when the list is created.\n /// (For example in getField and merge methods.)\n void beforeSetField(FieldInfo fi, newValue);\n\n /// Called before clearing a field.\n void beforeClearField(FieldInfo fi);\n}\n"},"__index_level_0__":{"kind":"number","value":0,"string":"0"}}},{"rowIdx":146342,"cells":{"repo_id":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src"},"file_path":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src/protobuf/field_error.dart"},"content":{"kind":"string","value":"// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file\n// for details. All rights reserved. Use of this source code is governed by a\n// BSD-style license that can be found in the LICENSE file.\n\npart of protobuf;\n\n/// Returns the error message for an invalid field value,\n/// or null if it's valid.\n///\n/// For enums, group, and message fields, this check is only approximate,\n/// because the exact type isn't included in [fieldType].\nString _getFieldError(int fieldType, var value) {\n switch (PbFieldType._baseType(fieldType)) {\n case PbFieldType._BOOL_BIT:\n if (value is! bool) return 'not type bool';\n return null;\n case PbFieldType._BYTES_BIT:\n if (value is! List) return 'not List';\n return null;\n case PbFieldType._STRING_BIT:\n if (value is! String) return 'not type String';\n return null;\n case PbFieldType._FLOAT_BIT:\n if (value is! double) return 'not type double';\n if (!_isFloat32(value)) return 'out of range for float';\n return null;\n case PbFieldType._DOUBLE_BIT:\n if (value is! double) return 'not type double';\n return null;\n case PbFieldType._ENUM_BIT:\n if (value is! ProtobufEnum) return 'not type ProtobufEnum';\n return null;\n\n case PbFieldType._INT32_BIT:\n case PbFieldType._SINT32_BIT:\n case PbFieldType._SFIXED32_BIT:\n if (value is! int) return 'not type int';\n if (!_isSigned32(value)) return 'out of range for signed 32-bit int';\n return null;\n\n case PbFieldType._UINT32_BIT:\n case PbFieldType._FIXED32_BIT:\n if (value is! int) return 'not type int';\n if (!_isUnsigned32(value)) return 'out of range for unsigned 32-bit int';\n return null;\n\n case PbFieldType._INT64_BIT:\n case PbFieldType._SINT64_BIT:\n case PbFieldType._UINT64_BIT:\n case PbFieldType._FIXED64_BIT:\n case PbFieldType._SFIXED64_BIT:\n // We always use the full range of the same Dart type.\n // It's up to the caller to treat the Int64 as signed or unsigned.\n // See: https://github.com/dart-lang/protobuf/issues/44\n if (value is! Int64) return 'not Int64';\n return null;\n\n case PbFieldType._GROUP_BIT:\n case PbFieldType._MESSAGE_BIT:\n if (value is! GeneratedMessage) return 'not a GeneratedMessage';\n return null;\n default:\n return 'field has unknown type $fieldType';\n }\n}\n\n// entry points for generated code\n\n// generated checkItem for message, group, enum calls this\nvoid checkItemFailed(val, String className) {\n throw ArgumentError('Value ($val) is not an instance of ${className}');\n}\n\n/// Returns a function for validating items in a repeated field.\n///\n/// For most types this is a not-null check, except for floats, and signed and\n/// unsigned 32 bit ints where there also is a range check.\nCheckFunc getCheckFunction(int fieldType) {\n switch (fieldType & ~0x7) {\n case PbFieldType._BOOL_BIT:\n case PbFieldType._BYTES_BIT:\n case PbFieldType._STRING_BIT:\n case PbFieldType._DOUBLE_BIT:\n case PbFieldType._ENUM_BIT:\n case PbFieldType._GROUP_BIT:\n case PbFieldType._MESSAGE_BIT:\n\n case PbFieldType._INT64_BIT:\n case PbFieldType._SINT64_BIT:\n case PbFieldType._SFIXED64_BIT:\n case PbFieldType._UINT64_BIT:\n case PbFieldType._FIXED64_BIT:\n // We always use the full range of the same Dart type.\n // It's up to the caller to treat the Int64 as signed or unsigned.\n // See: https://github.com/dart-lang/protobuf/issues/44\n return _checkNotNull;\n\n case PbFieldType._FLOAT_BIT:\n return _checkFloat;\n\n case PbFieldType._INT32_BIT:\n case PbFieldType._SINT32_BIT:\n case PbFieldType._SFIXED32_BIT:\n return _checkSigned32;\n\n case PbFieldType._UINT32_BIT:\n case PbFieldType._FIXED32_BIT:\n return _checkUnsigned32;\n }\n throw ArgumentError('check function not implemented: ${fieldType}');\n}\n\n// check functions for repeated fields\n\nvoid _checkNotNull(Object val) {\n if (val == null) {\n throw ArgumentError(\"Can't add a null to a repeated field\");\n }\n}\n\nvoid _checkFloat(Object val) {\n if (!_isFloat32(val)) throw _createFieldRangeError(val, 'a float');\n}\n\nvoid _checkSigned32(Object val) {\n if (!_isSigned32(val)) throw _createFieldRangeError(val, 'a signed int32');\n}\n\nvoid _checkUnsigned32(Object val) {\n if (!_isUnsigned32(val)) {\n throw _createFieldRangeError(val, 'an unsigned int32');\n }\n}\n\nRangeError _createFieldRangeError(val, String wantedType) =>\n RangeError('Value ($val) is not ${wantedType}');\n\nbool _isSigned32(int value) => (-2147483648 <= value) && (value <= 2147483647);\n\nbool _isUnsigned32(int value) => (0 <= value) && (value <= 4294967295);\n\nbool _isFloat32(double value) =>\n value.isNaN ||\n value.isInfinite ||\n (-3.4028234663852886E38 <= value) && (value <= 3.4028234663852886E38);\n"},"__index_level_0__":{"kind":"number","value":0,"string":"0"}}},{"rowIdx":146343,"cells":{"repo_id":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src"},"file_path":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src/protobuf/wire_format.dart"},"content":{"kind":"string","value":"// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file\n// for details. All rights reserved. Use of this source code is governed by a\n// BSD-style license that can be found in the LICENSE file.\n\npart of protobuf;\n\nconst int TAG_TYPE_BITS = 3;\nconst int TAG_TYPE_MASK = (1 << TAG_TYPE_BITS) - 1;\n\nconst int WIRETYPE_VARINT = 0;\nconst int WIRETYPE_FIXED64 = 1;\nconst int WIRETYPE_LENGTH_DELIMITED = 2;\nconst int WIRETYPE_START_GROUP = 3;\nconst int WIRETYPE_END_GROUP = 4;\nconst int WIRETYPE_FIXED32 = 5;\n\nint getTagFieldNumber(int tag) => tag >> TAG_TYPE_BITS;\n\nint getTagWireType(int tag) => tag & TAG_TYPE_MASK;\n\nint makeTag(int fieldNumber, int tag) => (fieldNumber << TAG_TYPE_BITS) | tag;\n\n/// Returns true if the wireType can be merged into the given fieldType.\nbool _wireTypeMatches(int fieldType, int wireType) {\n switch (PbFieldType._baseType(fieldType)) {\n case PbFieldType._BOOL_BIT:\n case PbFieldType._ENUM_BIT:\n case PbFieldType._INT32_BIT:\n case PbFieldType._INT64_BIT:\n case PbFieldType._SINT32_BIT:\n case PbFieldType._SINT64_BIT:\n case PbFieldType._UINT32_BIT:\n case PbFieldType._UINT64_BIT:\n return wireType == WIRETYPE_VARINT ||\n wireType == WIRETYPE_LENGTH_DELIMITED;\n case PbFieldType._FLOAT_BIT:\n case PbFieldType._FIXED32_BIT:\n case PbFieldType._SFIXED32_BIT:\n return wireType == WIRETYPE_FIXED32 ||\n wireType == WIRETYPE_LENGTH_DELIMITED;\n case PbFieldType._DOUBLE_BIT:\n case PbFieldType._FIXED64_BIT:\n case PbFieldType._SFIXED64_BIT:\n return wireType == WIRETYPE_FIXED64 ||\n wireType == WIRETYPE_LENGTH_DELIMITED;\n case PbFieldType._BYTES_BIT:\n case PbFieldType._STRING_BIT:\n case PbFieldType._MESSAGE_BIT:\n return wireType == WIRETYPE_LENGTH_DELIMITED;\n case PbFieldType._GROUP_BIT:\n return wireType == WIRETYPE_START_GROUP;\n default:\n return false;\n }\n}\n"},"__index_level_0__":{"kind":"number","value":0,"string":"0"}}},{"rowIdx":146344,"cells":{"repo_id":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src"},"file_path":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src/protobuf/utils.dart"},"content":{"kind":"string","value":"// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file\n// for details. All rights reserved. Use of this source code is governed by a\n// BSD-style license that can be found in the LICENSE file.\n\npart of protobuf;\n\n// TODO(antonm): reconsider later if PbList should take care of equality.\nbool _deepEquals(lhs, rhs) {\n // Some GeneratedMessages implement Map, so test this first.\n if (lhs is GeneratedMessage) return lhs == rhs;\n if (rhs is GeneratedMessage) return false;\n if ((lhs is List) && (rhs is List)) return _areListsEqual(lhs, rhs);\n if ((lhs is Map) && (rhs is Map)) return _areMapsEqual(lhs, rhs);\n if ((lhs is ByteData) && (rhs is ByteData)) {\n return _areByteDataEqual(lhs, rhs);\n }\n return lhs == rhs;\n}\n\nbool _areListsEqual(List lhs, List rhs) {\n if (lhs.length != rhs.length) return false;\n for (var i = 0; i < lhs.length; i++) {\n if (!_deepEquals(lhs[i], rhs[i])) return false;\n }\n return true;\n}\n\nbool _areMapsEqual(Map lhs, Map rhs) {\n if (lhs.length != rhs.length) return false;\n return lhs.keys.every((key) => _deepEquals(lhs[key], rhs[key]));\n}\n\nbool _areByteDataEqual(ByteData lhs, ByteData rhs) {\n Uint8List asBytes(d) =>\n Uint8List.view(d.buffer, d.offsetInBytes, d.lengthInBytes);\n return _areListsEqual(asBytes(lhs), asBytes(rhs));\n}\n\n@Deprecated('This function was not intended to be public. '\n 'It will be removed from the public api in next major version. ')\nList sorted(Iterable list) => List.from(list)..sort();\n\nList _sorted(Iterable list) => List.from(list)..sort();\n\nclass _HashUtils {\n// Jenkins hash functions copied from https://github.com/google/quiver-dart/blob/master/lib/src/core/hash.dart.\n\n static int _combine(int hash, int value) {\n hash = 0x1fffffff & (hash + value);\n hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10));\n return hash ^ (hash >> 6);\n }\n\n static int _finish(int hash) {\n hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3));\n hash = hash ^ (hash >> 11);\n return 0x1fffffff & (hash + ((0x00003fff & hash) << 15));\n }\n\n /// Generates a hash code for multiple [objects].\n static int _hashObjects(Iterable objects) =>\n _finish(objects.fold(0, (h, i) => _combine(h, i.hashCode)));\n\n /// Generates a hash code for two objects.\n static int _hash2(a, b) =>\n _finish(_combine(_combine(0, a.hashCode), b.hashCode));\n}\n"},"__index_level_0__":{"kind":"number","value":0,"string":"0"}}},{"rowIdx":146345,"cells":{"repo_id":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src"},"file_path":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src/protobuf/unpack.dart"},"content":{"kind":"string","value":"// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file\n// for details. All rights reserved. Use of this source code is governed by a\n// BSD-style license that can be found in the LICENSE file.\n\npart of protobuf;\n\n/// Unpacks the message in [value] into [instance].\n///\n/// Throws a [InvalidProtocolBufferException] if [typeUrl] does not correspond\n/// with the type of [instance].\n///\n/// This is a helper method for `Any.unpackInto`.\nvoid unpackIntoHelper(\n List value, T instance, String typeUrl,\n {ExtensionRegistry extensionRegistry = ExtensionRegistry.EMPTY}) {\n // From \"google/protobuf/any.proto\":\n //\n // The pack methods provided by protobuf library will by default use\n // 'type.googleapis.com/full.type.name' as the type URL and the unpack\n // methods only use the fully qualified type name after the last '/'\n // in the type URL, for example \"foo.bar.com/x/y.z\" will yield type\n // name \"y.z\".\n if (!canUnpackIntoHelper(instance, typeUrl)) {\n var typeName = instance.info_.qualifiedMessageName;\n throw InvalidProtocolBufferException.wrongAnyMessage(\n _typeNameFromUrl(typeUrl), typeName);\n }\n instance.mergeFromBuffer(value, extensionRegistry);\n}\n\n/// Returns `true` if the type of [instance] is described by\n/// `typeUrl`.\n///\n/// This is a helper method for `Any.canUnpackInto`.\nbool canUnpackIntoHelper(GeneratedMessage instance, String typeUrl) {\n return instance.info_.qualifiedMessageName == _typeNameFromUrl(typeUrl);\n}\n\nString _typeNameFromUrl(String typeUrl) {\n var index = typeUrl.lastIndexOf('/');\n return index == -1 ? '' : typeUrl.substring(index + 1);\n}\n"},"__index_level_0__":{"kind":"number","value":0,"string":"0"}}},{"rowIdx":146346,"cells":{"repo_id":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src"},"file_path":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src/protobuf/proto3_json.dart"},"content":{"kind":"string","value":"// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file\n// for details. All rights reserved. Use of this source code is governed by a\n// BSD-style license that can be found in the LICENSE file.\n\npart of protobuf;\n\nObject _writeToProto3Json(_FieldSet fs, TypeRegistry typeRegistry) {\n String convertToMapKey(dynamic key, int keyType) {\n var baseType = PbFieldType._baseType(keyType);\n\n assert(!_isRepeated(keyType));\n\n switch (baseType) {\n case PbFieldType._BOOL_BIT:\n return key ? 'true' : 'false';\n case PbFieldType._STRING_BIT:\n return key;\n case PbFieldType._UINT64_BIT:\n return (key as Int64).toStringUnsigned();\n case PbFieldType._INT32_BIT:\n case PbFieldType._SINT32_BIT:\n case PbFieldType._UINT32_BIT:\n case PbFieldType._FIXED32_BIT:\n case PbFieldType._SFIXED32_BIT:\n case PbFieldType._INT64_BIT:\n case PbFieldType._SINT64_BIT:\n case PbFieldType._SFIXED64_BIT:\n case PbFieldType._FIXED64_BIT:\n return key.toString();\n default:\n throw StateError('Not a valid key type $keyType');\n }\n }\n\n Object valueToProto3Json(dynamic fieldValue, int fieldType) {\n if (fieldValue == null) return null;\n\n if (_isGroupOrMessage(fieldType)) {\n return _writeToProto3Json(\n (fieldValue as GeneratedMessage)._fieldSet, typeRegistry);\n } else if (_isEnum(fieldType)) {\n return (fieldValue as ProtobufEnum).name;\n } else {\n var baseType = PbFieldType._baseType(fieldType);\n switch (baseType) {\n case PbFieldType._BOOL_BIT:\n return fieldValue ? true : false;\n case PbFieldType._STRING_BIT:\n return fieldValue;\n case PbFieldType._INT32_BIT:\n case PbFieldType._SINT32_BIT:\n case PbFieldType._UINT32_BIT:\n case PbFieldType._FIXED32_BIT:\n case PbFieldType._SFIXED32_BIT:\n return fieldValue;\n case PbFieldType._INT64_BIT:\n case PbFieldType._SINT64_BIT:\n case PbFieldType._SFIXED64_BIT:\n case PbFieldType._FIXED64_BIT:\n return fieldValue.toString();\n case PbFieldType._FLOAT_BIT:\n case PbFieldType._DOUBLE_BIT:\n double value = fieldValue;\n if (value.isNaN) return 'NaN';\n if (value.isInfinite) {\n if (value.isNegative) {\n return '-Infinity';\n } else {\n return 'Infinity';\n }\n }\n return value;\n case PbFieldType._UINT64_BIT:\n return (fieldValue as Int64).toStringUnsigned();\n case PbFieldType._BYTES_BIT:\n return base64Encode(fieldValue);\n default:\n throw StateError(\n 'Invariant violation: unexpected value type $fieldType');\n }\n }\n }\n\n if (fs._meta.toProto3Json != null) {\n return fs._meta.toProto3Json(fs._message, typeRegistry);\n }\n\n var result = {};\n for (var fieldInfo in fs._infosSortedByTag) {\n var value = fs._values[fieldInfo.index];\n if (value == null || (value is List && value.isEmpty)) {\n continue; // It's missing, repeated, or an empty byte array.\n }\n dynamic jsonValue;\n if (fieldInfo.isMapField) {\n jsonValue = (value as PbMap).map((key, entryValue) {\n var mapEntryInfo = fieldInfo as MapFieldInfo;\n return MapEntry(convertToMapKey(key, mapEntryInfo.keyFieldType),\n valueToProto3Json(entryValue, mapEntryInfo.valueFieldType));\n });\n } else if (fieldInfo.isRepeated) {\n jsonValue = (value as PbListBase)\n .map((element) => valueToProto3Json(element, fieldInfo.type))\n .toList();\n } else {\n jsonValue = valueToProto3Json(value, fieldInfo.type);\n }\n result[fieldInfo.name] = jsonValue;\n }\n // Extensions and unknown fields are not encoded by proto3 JSON.\n return result;\n}\n\nvoid _mergeFromProto3Json(\n Object json,\n _FieldSet fieldSet,\n TypeRegistry typeRegistry,\n bool ignoreUnknownFields,\n bool supportNamesWithUnderscores,\n bool permissiveEnums) {\n var context = JsonParsingContext(\n ignoreUnknownFields, supportNamesWithUnderscores, permissiveEnums);\n\n void recursionHelper(Object json, _FieldSet fieldSet) {\n int tryParse32Bit(String s) {\n return int.tryParse(s) ??\n (throw context.parseException('expected integer', s));\n }\n\n int check32BitSigned(int n) {\n if (n < -2147483648 || n > 2147483647) {\n throw context.parseException('expected 32 bit unsigned integer', n);\n }\n return n;\n }\n\n int check32BitUnsigned(int n) {\n if (n < 0 || n > 0xFFFFFFFF) {\n throw context.parseException('expected 32 bit unsigned integer', n);\n }\n return n;\n }\n\n Int64 tryParse64Bit(String s) {\n Int64 result;\n try {\n result = Int64.parseInt(s);\n } on FormatException {\n throw context.parseException('expected integer', json);\n }\n return result;\n }\n\n Object convertProto3JsonValue(Object value, FieldInfo fieldInfo) {\n if (value == null) {\n return fieldInfo.makeDefault();\n }\n var fieldType = fieldInfo.type;\n switch (PbFieldType._baseType(fieldType)) {\n case PbFieldType._BOOL_BIT:\n if (value is bool) {\n return value;\n }\n throw context.parseException('Expected bool value', json);\n case PbFieldType._BYTES_BIT:\n if (value is String) {\n Uint8List result;\n try {\n result = base64Decode(value);\n } on FormatException {\n throw context.parseException(\n 'Expected bytes encoded as base64 String', json);\n }\n return result;\n }\n throw context.parseException(\n 'Expected bytes encoded as base64 String', value);\n case PbFieldType._STRING_BIT:\n if (value is String) {\n return value;\n }\n throw context.parseException('Expected String value', value);\n case PbFieldType._FLOAT_BIT:\n case PbFieldType._DOUBLE_BIT:\n if (value is double) {\n return value;\n } else if (value is num) {\n return value.toDouble();\n } else if (value is String) {\n return double.tryParse(value) ??\n (throw context.parseException(\n 'Expected String to encode a double', value));\n }\n throw context.parseException(\n 'Expected a double represented as a String or number', value);\n case PbFieldType._ENUM_BIT:\n if (value is String) {\n // TODO(sigurdm): Do we want to avoid linear search here? Measure...\n final result = permissiveEnums\n ? fieldInfo.enumValues.firstWhere(\n (e) => permissiveCompare(e.name, value),\n orElse: () => null)\n : fieldInfo.enumValues\n .firstWhere((e) => e.name == value, orElse: () => null);\n if ((result != null) || ignoreUnknownFields) return result;\n throw context.parseException('Unknown enum value', value);\n } else if (value is int) {\n return fieldInfo.valueOf(value) ??\n (ignoreUnknownFields\n ? null\n : (throw context.parseException(\n 'Unknown enum value', value)));\n }\n throw context.parseException(\n 'Expected enum as a string or integer', value);\n case PbFieldType._UINT32_BIT:\n int result;\n if (value is int) {\n result = value;\n } else if (value is String) {\n result = tryParse32Bit(value);\n } else {\n throw context.parseException(\n 'Expected int or stringified int', value);\n }\n return check32BitUnsigned(result);\n case PbFieldType._INT32_BIT:\n case PbFieldType._SINT32_BIT:\n case PbFieldType._FIXED32_BIT:\n case PbFieldType._SFIXED32_BIT:\n int result;\n if (value is int) {\n result = value;\n } else if (value is String) {\n result = tryParse32Bit(value);\n } else {\n throw context.parseException(\n 'Expected int or stringified int', value);\n }\n check32BitSigned(result);\n return result;\n case PbFieldType._UINT64_BIT:\n Int64 result;\n if (value is int) {\n result = Int64(value);\n } else if (value is String) {\n result = tryParse64Bit(value);\n } else {\n throw context.parseException(\n 'Expected int or stringified int', value);\n }\n return result;\n case PbFieldType._INT64_BIT:\n case PbFieldType._SINT64_BIT:\n case PbFieldType._FIXED64_BIT:\n case PbFieldType._SFIXED64_BIT:\n if (value is int) return Int64(value);\n if (value is String) {\n Int64 result;\n try {\n result = Int64.parseInt(value);\n } on FormatException {\n throw context.parseException(\n 'Expected int or stringified int', value);\n }\n return result;\n }\n throw context.parseException(\n 'Expected int or stringified int', value);\n case PbFieldType._GROUP_BIT:\n case PbFieldType._MESSAGE_BIT:\n var subMessage = fieldInfo.subBuilder();\n recursionHelper(value, subMessage._fieldSet);\n return subMessage;\n default:\n throw StateError('Unknown type $fieldType');\n }\n }\n\n Object decodeMapKey(String key, int fieldType) {\n switch (PbFieldType._baseType(fieldType)) {\n case PbFieldType._BOOL_BIT:\n switch (key) {\n case 'true':\n return true;\n case 'false':\n return false;\n default:\n throw context.parseException(\n 'Wrong boolean key, should be one of (\"true\", \"false\")', key);\n }\n // ignore: dead_code\n throw StateError('(Should have been) unreachable statement');\n case PbFieldType._STRING_BIT:\n return key;\n case PbFieldType._UINT64_BIT:\n // TODO(sigurdm): We do not throw on negative values here.\n // That would probably require going via bignum.\n return tryParse64Bit(key);\n case PbFieldType._INT64_BIT:\n case PbFieldType._SINT64_BIT:\n case PbFieldType._SFIXED64_BIT:\n case PbFieldType._FIXED64_BIT:\n return tryParse64Bit(key);\n case PbFieldType._INT32_BIT:\n case PbFieldType._SINT32_BIT:\n case PbFieldType._FIXED32_BIT:\n case PbFieldType._SFIXED32_BIT:\n return check32BitSigned(tryParse32Bit(key));\n case PbFieldType._UINT32_BIT:\n return check32BitUnsigned(tryParse32Bit(key));\n default:\n throw StateError('Not a valid key type $fieldType');\n }\n }\n\n if (json == null) {\n // `null` represents the default value. Do nothing more.\n return;\n }\n\n var info = fieldSet._meta;\n\n final wellKnownConverter = info.fromProto3Json;\n if (wellKnownConverter != null) {\n wellKnownConverter(fieldSet._message, json, typeRegistry, context);\n } else {\n if (json is Map) {\n var byName = info.byName;\n\n json.forEach((key, value) {\n if (key is! String) {\n throw context.parseException('Key was not a String', key);\n }\n context.addMapIndex(key);\n\n var fieldInfo = byName[key];\n if (fieldInfo == null && supportNamesWithUnderscores) {\n // We don't optimize for field names with underscores, instead do a\n // linear search for the index.\n fieldInfo = byName.values.firstWhere(\n (FieldInfo info) => info.protoName == key,\n orElse: () => null);\n }\n if (fieldInfo == null) {\n if (ignoreUnknownFields) {\n return;\n } else {\n throw context.parseException('Unknown field name \\'$key\\'', key);\n }\n }\n\n if (_isMapField(fieldInfo.type)) {\n if (value is Map) {\n MapFieldInfo mapFieldInfo = fieldInfo;\n Map fieldValues = fieldSet._ensureMapField(fieldInfo);\n value.forEach((subKey, subValue) {\n if (subKey is! String) {\n throw context.parseException('Expected a String key', subKey);\n }\n context.addMapIndex(subKey);\n final result = fieldValues[\n decodeMapKey(subKey, mapFieldInfo.keyFieldType)] =\n convertProto3JsonValue(\n subValue, mapFieldInfo.valueFieldInfo);\n context.popIndex();\n return result;\n });\n } else {\n throw context.parseException('Expected a map', value);\n }\n } else if (_isRepeated(fieldInfo.type)) {\n if (value == null) {\n // `null` is accepted as the empty list [].\n fieldSet._ensureRepeatedField(fieldInfo);\n } else if (value is List) {\n var values = fieldSet._ensureRepeatedField(fieldInfo);\n for (var i = 0; i < value.length; i++) {\n final entry = value[i];\n context.addListIndex(i);\n values.add(convertProto3JsonValue(entry, fieldInfo));\n context.popIndex();\n }\n } else {\n throw context.parseException('Expected a list', value);\n }\n } else if (_isGroupOrMessage(fieldInfo.type)) {\n // TODO(sigurdm) consider a cleaner separation between parsing and merging.\n GeneratedMessage parsedSubMessage =\n convertProto3JsonValue(value, fieldInfo);\n GeneratedMessage original = fieldSet._values[fieldInfo.index];\n if (original == null) {\n fieldSet._values[fieldInfo.index] = parsedSubMessage;\n } else {\n original.mergeFromMessage(parsedSubMessage);\n }\n } else {\n fieldSet._setFieldUnchecked(\n fieldInfo, convertProto3JsonValue(value, fieldInfo));\n }\n context.popIndex();\n });\n } else {\n throw context.parseException('Expected JSON object', json);\n }\n }\n }\n\n recursionHelper(json, fieldSet);\n}\n"},"__index_level_0__":{"kind":"number","value":0,"string":"0"}}},{"rowIdx":146347,"cells":{"repo_id":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src"},"file_path":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src/protobuf/extension_field_set.dart"},"content":{"kind":"string","value":"// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file\n// for details. All rights reserved. Use of this source code is governed by a\n// BSD-style license that can be found in the LICENSE file.\n\npart of protobuf;\n\nclass _ExtensionFieldSet {\n final _FieldSet _parent;\n final Map _info = {};\n final Map _values = {};\n bool _isReadOnly = false;\n\n _ExtensionFieldSet(this._parent);\n\n Extension _getInfoOrNull(int tagNumber) => _info[tagNumber];\n\n dynamic _getFieldOrDefault(Extension fi) {\n if (fi.isRepeated) return _getList(fi);\n _validateInfo(fi);\n // TODO(skybrian) seems unnecessary to add info?\n // I think this was originally here for repeated extensions.\n _addInfoUnchecked(fi);\n var value = _getFieldOrNull(fi);\n if (value == null) {\n _checkNotInUnknown(fi);\n return fi.makeDefault();\n }\n return value;\n }\n\n bool _hasField(int tagNumber) {\n var value = _values[tagNumber];\n if (value == null) return false;\n if (value is List) return value.isNotEmpty;\n return true;\n }\n\n /// Ensures that the list exists and an extension is present.\n ///\n /// If it doesn't exist, creates the list and saves the extension.\n /// Suitable for public API and decoders.\n List _ensureRepeatedField(Extension fi) {\n assert(!_isReadOnly);\n assert(fi.isRepeated);\n assert(fi.extendee == '' || fi.extendee == _parent._messageName);\n\n var list = _values[fi.tagNumber];\n if (list != null) return list as List;\n\n return _addInfoAndCreateList(fi);\n }\n\n List _getList(Extension fi) {\n var value = _values[fi.tagNumber];\n if (value != null) return value as List;\n _checkNotInUnknown(fi);\n if (_isReadOnly) return List.unmodifiable(const []);\n return _addInfoAndCreateList(fi);\n }\n\n List _addInfoAndCreateList(Extension fi) {\n _validateInfo(fi);\n var newList = fi._createRepeatedField(_parent._message);\n _addInfoUnchecked(fi);\n _setFieldUnchecked(fi, newList);\n return newList;\n }\n\n dynamic _getFieldOrNull(Extension extension) => _values[extension.tagNumber];\n\n void _clearFieldAndInfo(Extension fi) {\n _clearField(fi);\n _info.remove(fi.tagNumber);\n }\n\n void _clearField(Extension fi) {\n _ensureWritable();\n _validateInfo(fi);\n if (_parent._hasObservers) _parent._eventPlugin.beforeClearField(fi);\n _values.remove(fi.tagNumber);\n }\n\n /// Sets a value for a non-repeated extension that has already been added.\n /// Does error-checking.\n void _setField(int tagNumber, value) {\n var fi = _getInfoOrNull(tagNumber);\n if (fi == null) {\n throw ArgumentError(\n 'tag $tagNumber not defined in $_parent._messageName');\n }\n if (fi.isRepeated) {\n throw ArgumentError(_parent._setFieldFailedMessage(\n fi, value, 'repeating field (use get + .add())'));\n }\n _ensureWritable();\n _parent._validateField(fi, value);\n _setFieldUnchecked(fi, value);\n }\n\n /// Sets a non-repeated value and extension.\n /// Overwrites any existing extension.\n void _setFieldAndInfo(Extension fi, value) {\n _ensureWritable();\n if (fi.isRepeated) {\n throw ArgumentError(_parent._setFieldFailedMessage(\n fi, value, 'repeating field (use get + .add())'));\n }\n _ensureWritable();\n _validateInfo(fi);\n _parent._validateField(fi, value);\n _addInfoUnchecked(fi);\n _setFieldUnchecked(fi, value);\n }\n\n void _ensureWritable() {\n if (_isReadOnly) frozenMessageModificationHandler(_parent._messageName);\n }\n\n void _validateInfo(Extension fi) {\n if (fi.extendee != _parent._messageName) {\n throw ArgumentError(\n 'Extension $fi not legal for message ${_parent._messageName}');\n }\n }\n\n void _addInfoUnchecked(Extension fi) {\n assert(fi.extendee == _parent._messageName);\n _info[fi.tagNumber] = fi;\n }\n\n void _setFieldUnchecked(Extension fi, value) {\n if (_parent._hasObservers) {\n _parent._eventPlugin.beforeSetField(fi, value);\n }\n _values[fi.tagNumber] = value;\n }\n\n // Bulk operations\n\n Iterable get _tagNumbers => _values.keys;\n Iterable get _infos => _info.values;\n\n bool get _hasValues => _values.isNotEmpty;\n\n bool _equalValues(_ExtensionFieldSet other) =>\n other != null && _areMapsEqual(_values, other._values);\n\n void _clearValues() => _values.clear();\n\n /// Makes a shallow copy of all values from [original] to this.\n ///\n /// Repeated fields are copied.\n /// Extensions cannot contain map fields.\n void _shallowCopyValues(_ExtensionFieldSet original) {\n for (var tagNumber in original._tagNumbers) {\n var extension = original._getInfoOrNull(tagNumber);\n _addInfoUnchecked(extension);\n\n final value = original._getFieldOrNull(extension);\n if (value == null) continue;\n if (extension.isRepeated) {\n assert(value is PbListBase);\n _ensureRepeatedField(extension)..addAll(value);\n } else {\n _setFieldUnchecked(extension, value);\n }\n }\n }\n\n void _markReadOnly() {\n if (_isReadOnly) return;\n _isReadOnly = true;\n for (var field in _info.values) {\n if (field.isRepeated) {\n final entries = _values[field.tagNumber];\n if (entries == null) continue;\n if (field.isGroupOrMessage) {\n for (var subMessage in entries as List) {\n subMessage.freeze();\n }\n }\n _values[field.tagNumber] = entries.toFrozenPbList();\n } else if (field.isGroupOrMessage) {\n final entry = _values[field.tagNumber];\n if (entry != null) {\n (entry as GeneratedMessage).freeze();\n }\n }\n }\n }\n\n void _checkNotInUnknown(Extension extension) {\n if (_parent._hasUnknownFields &&\n _parent._unknownFields.hasField(extension.tagNumber)) {\n throw StateError(\n 'Trying to get $extension that is present as an unknown field. '\n 'Parse the message with this extension in the extension registry or '\n 'use `ExtensionRegistry.reparseMessage`.');\n }\n }\n}\n"},"__index_level_0__":{"kind":"number","value":0,"string":"0"}}},{"rowIdx":146348,"cells":{"repo_id":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src"},"file_path":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src/protobuf/coded_buffer_writer.dart"},"content":{"kind":"string","value":"// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file\n// for details. All rights reserved. Use of this source code is governed by a\n// BSD-style license that can be found in the LICENSE file.\n\npart of protobuf;\n\n/// Writer used for converting [GeneratedMessage]s into binary\n/// representation.\n///\n/// Note that it is impossible to serialize protobuf messages using a one pass\n/// streaming serialization as some values are serialized using\n/// length-delimited representation, which means that they are represented as\n/// a varint encoded length followed by specified number of bytes of data.\n///\n/// Due to this [CodedBufferWritter] maintains two output buffers:\n/// [_outputChunks] which contains all continuously written bytes and\n/// [_splices] which describes additional bytes to splice in-between\n/// [_outputChunks] bytes.\n///\nclass CodedBufferWriter {\n /// Array of splices representing the data written into the writer.\n /// Each element might be one of:\n /// * a TypedData object - represents a sequence of bytes that need to be\n /// emitted into the result as-is;\n /// * a positive integer - a number of bytes to copy from [_outputChunks]\n /// into resulting buffer;\n /// * a non-positive integer - a positive number that needs to be emitted\n /// into result buffer as a varint;\n final List _splices = [];\n\n /// Number of bytes written into [_outputChunk] and [_outputChunks] since\n /// the last splice was recorded.\n int _lastSplicePos = 0;\n\n /// Size of the [_outputChunk].\n static const _chunkLength = 512;\n\n /// Current chunk used to write data into. Once it is full it is\n /// pushed into [_outputChunks] and a new one is allocated.\n Uint8List _outputChunk;\n\n /// Number of bytes written into the [_outputChunk].\n int _bytesInChunk = 0;\n\n /// ByteData pointing to [_outputChunk]. Used to write primitive values\n /// more efficiently.\n ByteData _outputChunkAsByteData;\n\n /// Array of pairs - chunks are\n /// pushed into this array once they are full.\n final List _outputChunks = [];\n\n /// Total amount of bytes used in all chunks.\n int _outputChunksBytes = 0;\n\n /// Total amount of bytes written into this writer.\n int _bytesTotal = 0;\n int get lengthInBytes => _bytesTotal;\n\n CodedBufferWriter() {\n // Initialize [_outputChunk].\n _commitChunk(true);\n }\n\n void writeField(int fieldNumber, int fieldType, fieldValue) {\n final valueType = fieldType & ~0x07;\n\n if ((fieldType & PbFieldType._PACKED_BIT) != 0) {\n if (!fieldValue.isEmpty) {\n _writeTag(fieldNumber, WIRETYPE_LENGTH_DELIMITED);\n final mark = _startLengthDelimited();\n for (var value in fieldValue) {\n _writeValueAs(valueType, value);\n }\n _endLengthDelimited(mark);\n }\n return;\n }\n\n final wireFormat = _wireTypes[_valueTypeIndex(valueType)];\n\n if ((fieldType & PbFieldType._MAP_BIT) != 0) {\n final keyWireFormat =\n _wireTypes[_valueTypeIndex(fieldValue.keyFieldType)];\n final valueWireFormat =\n _wireTypes[_valueTypeIndex(fieldValue.valueFieldType)];\n\n fieldValue.forEach((key, value) {\n _writeTag(fieldNumber, WIRETYPE_LENGTH_DELIMITED);\n final mark = _startLengthDelimited();\n _writeValue(\n PbMap._keyFieldNumber, fieldValue.keyFieldType, key, keyWireFormat);\n _writeValue(PbMap._valueFieldNumber, fieldValue.valueFieldType, value,\n valueWireFormat);\n _endLengthDelimited(mark);\n });\n return;\n }\n\n if ((fieldType & PbFieldType._REPEATED_BIT) != 0) {\n for (var i = 0; i < fieldValue.length; i++) {\n _writeValue(fieldNumber, valueType, fieldValue[i], wireFormat);\n }\n return;\n }\n _writeValue(fieldNumber, valueType, fieldValue, wireFormat);\n }\n\n Uint8List toBuffer() {\n var result = Uint8List(_bytesTotal);\n writeTo(result);\n return result;\n }\n\n /// Serializes everything written to this writer so far to [buffer], starting\n /// from [offset] in [buffer]. Returns `true` on success.\n bool writeTo(Uint8List buffer, [int offset = 0]) {\n if (buffer.length - offset < _bytesTotal) {\n return false;\n }\n\n // Move the current output chunk into _outputChunks and commit the current\n // splice for uniformity.\n _commitChunk(false);\n _commitSplice();\n\n var outPos = offset; // Output position in the buffer.\n var chunkIndex = 0, chunkPos = 0; // Position within _outputChunks.\n for (var i = 0; i < _splices.length; i++) {\n final action = _splices[i];\n if (action is int) {\n if (action <= 0) {\n // action is a positive varint to be emitted into the output buffer.\n var v = 0 - action; // Note: 0 - action to avoid -0.0 in JS.\n while (v >= 0x80) {\n buffer[outPos++] = 0x80 | (v & 0x7f);\n v >>= 7;\n }\n buffer[outPos++] = v;\n } else {\n // action is an amount of bytes to copy from _outputChunks into the\n // buffer.\n var bytesToCopy = action;\n while (bytesToCopy > 0) {\n final Uint8List chunk = _outputChunks[chunkIndex];\n final int bytesInChunk = _outputChunks[chunkIndex + 1];\n\n // Copy at most bytesToCopy bytes from the current chunk.\n final leftInChunk = bytesInChunk - chunkPos;\n final bytesToCopyFromChunk =\n leftInChunk > bytesToCopy ? bytesToCopy : leftInChunk;\n final endPos = chunkPos + bytesToCopyFromChunk;\n while (chunkPos < endPos) {\n buffer[outPos++] = chunk[chunkPos++];\n }\n bytesToCopy -= bytesToCopyFromChunk;\n\n // Move to the next chunk if the current one is exhausted.\n if (chunkPos == bytesInChunk) {\n chunkIndex += 2;\n chunkPos = 0;\n }\n }\n }\n } else {\n // action is a TypedData containing bytes to emit into the output\n // buffer.\n outPos = _copyInto(buffer, outPos, action);\n }\n }\n\n return true;\n }\n\n /// Move the current [_outputChunk] into [_outputChunks].\n ///\n /// If [allocateNew] is [true] then allocate a new chunk, otherwise\n /// set [_outputChunk] to null.\n void _commitChunk(bool allocateNew) {\n if (_bytesInChunk != 0) {\n _outputChunks.add(_outputChunk);\n _outputChunks.add(_bytesInChunk);\n _outputChunksBytes += _bytesInChunk;\n }\n\n if (allocateNew) {\n _outputChunk = Uint8List(_chunkLength);\n _bytesInChunk = 0;\n _outputChunkAsByteData = ByteData.view(_outputChunk.buffer);\n } else {\n _outputChunk = _outputChunkAsByteData = null;\n _bytesInChunk = 0;\n }\n }\n\n /// Check if [count] bytes would fit into the current chunk. If they will\n /// not then allocate a new [_outputChunk].\n ///\n /// [count] is assumed to be small enough to fit into the newly allocated\n /// chunk.\n void _ensureBytes(int count) {\n if ((_bytesInChunk + count) > _chunkLength) {\n _commitChunk(true);\n }\n }\n\n /// Record number of bytes written into output chunks since last splice.\n ///\n /// This is used before reserving space for an unknown varint splice or\n /// adding a TypedData array splice.\n void _commitSplice() {\n final pos = _bytesInChunk + _outputChunksBytes;\n final bytes = pos - _lastSplicePos;\n if (bytes > 0) {\n _splices.add(bytes);\n }\n _lastSplicePos = pos;\n }\n\n /// Add TypedData splice - these bytes would be directly copied into the\n /// output buffer by [writeTo].\n void writeRawBytes(TypedData value) {\n _commitSplice();\n _splices.add(value);\n _bytesTotal += value.lengthInBytes;\n }\n\n /// Start writing a length-delimited data.\n ///\n /// This reserves the space for varint splice in the splices array and\n /// return its index. Once the writing is finished [_endLengthDelimited]\n /// would be called with this index - which would put the actual amount\n /// of bytes written into the reserved slice space.\n int _startLengthDelimited() {\n _commitSplice();\n var index = _splices.length;\n // Reserve a space for a splice and use it to record the current number of\n // bytes written so that we can compute the length of data later in\n // _endLengthDelimited.\n _splices.add(_bytesTotal);\n return index;\n }\n\n void _endLengthDelimited(int index) {\n final int writtenSizeInBytes = _bytesTotal - _splices[index];\n // Note: 0 - writtenSizeInBytes to avoid -0.0 in JavaScript.\n _splices[index] = 0 - writtenSizeInBytes;\n _bytesTotal += _varint32LengthInBytes(writtenSizeInBytes);\n }\n\n int _varint32LengthInBytes(int value) {\n value &= 0xFFFFFFFF;\n if (value < 0x80) return 1;\n if (value < 0x4000) return 2;\n if (value < 0x200000) return 3;\n if (value < 0x10000000) return 4;\n return 5;\n }\n\n void _writeVarint32(int value) {\n _ensureBytes(5);\n var i = _bytesInChunk;\n while (value >= 0x80) {\n _outputChunk[i++] = 0x80 | (value & 0x7f);\n value >>= 7;\n }\n _outputChunk[i++] = value;\n _bytesTotal += (i - _bytesInChunk);\n _bytesInChunk = i;\n }\n\n void _writeVarint64(Int64 value) {\n _ensureBytes(10);\n var i = _bytesInChunk;\n var lo = value.toUnsigned(32).toInt();\n var hi = (value >> 32).toUnsigned(32).toInt();\n while (hi > 0 || lo >= 0x80) {\n _outputChunk[i++] = 0x80 | (lo & 0x7f);\n lo = (lo >> 7) | ((hi & 0x7f) << 25);\n hi >>= 7;\n }\n _outputChunk[i++] = lo;\n _bytesTotal += (i - _bytesInChunk);\n _bytesInChunk = i;\n }\n\n void _writeDouble(double value) {\n if (value.isNaN) {\n _writeInt32(0x00000000);\n _writeInt32(0x7ff80000);\n return;\n }\n _ensureBytes(8);\n _outputChunkAsByteData.setFloat64(_bytesInChunk, value, Endian.little);\n _bytesInChunk += 8;\n _bytesTotal += 8;\n }\n\n void _writeFloat(double value) {\n const MIN_FLOAT_DENORM = 1.401298464324817E-45;\n const MAX_FLOAT = 3.4028234663852886E38;\n if (value.isNaN) {\n _writeInt32(0x7fc00000);\n } else if (value.abs() < MIN_FLOAT_DENORM) {\n _writeInt32(value.isNegative ? 0x80000000 : 0x00000000);\n } else if (value.isInfinite || value.abs() > MAX_FLOAT) {\n _writeInt32(value.isNegative ? 0xff800000 : 0x7f800000);\n } else {\n const sz = 4;\n _ensureBytes(sz);\n _outputChunkAsByteData.setFloat32(_bytesInChunk, value, Endian.little);\n _bytesInChunk += sz;\n _bytesTotal += sz;\n }\n }\n\n void _writeInt32(int value) {\n const sizeInBytes = 4;\n _ensureBytes(sizeInBytes);\n _outputChunkAsByteData.setInt32(\n _bytesInChunk, value & 0xFFFFFFFF, Endian.little);\n _bytesInChunk += sizeInBytes;\n _bytesTotal += sizeInBytes;\n }\n\n void _writeInt64(Int64 value) {\n _writeInt32(value.toUnsigned(32).toInt());\n _writeInt32((value >> 32).toUnsigned(32).toInt());\n }\n\n void _writeValueAs(int valueType, dynamic value) {\n switch (valueType) {\n case PbFieldType._BOOL_BIT:\n _writeVarint32(value ? 1 : 0);\n break;\n case PbFieldType._BYTES_BIT:\n _writeBytesNoTag(\n value is TypedData ? value : Uint8List.fromList(value));\n break;\n case PbFieldType._STRING_BIT:\n _writeBytesNoTag(_utf8.encode(value));\n break;\n case PbFieldType._DOUBLE_BIT:\n _writeDouble(value);\n break;\n case PbFieldType._FLOAT_BIT:\n _writeFloat(value);\n break;\n case PbFieldType._ENUM_BIT:\n _writeVarint32(value.value & 0xffffffff);\n break;\n case PbFieldType._GROUP_BIT:\n value.writeToCodedBufferWriter(this);\n break;\n case PbFieldType._INT32_BIT:\n _writeVarint64(Int64(value));\n break;\n case PbFieldType._INT64_BIT:\n _writeVarint64(value);\n break;\n case PbFieldType._SINT32_BIT:\n _writeVarint32(_encodeZigZag32(value));\n break;\n case PbFieldType._SINT64_BIT:\n _writeVarint64(_encodeZigZag64(value));\n break;\n case PbFieldType._UINT32_BIT:\n _writeVarint32(value);\n break;\n case PbFieldType._UINT64_BIT:\n _writeVarint64(value);\n break;\n case PbFieldType._FIXED32_BIT:\n _writeInt32(value);\n break;\n case PbFieldType._FIXED64_BIT:\n _writeInt64(value);\n break;\n case PbFieldType._SFIXED32_BIT:\n _writeInt32(value);\n break;\n case PbFieldType._SFIXED64_BIT:\n _writeInt64(value);\n break;\n case PbFieldType._MESSAGE_BIT:\n final mark = _startLengthDelimited();\n value.writeToCodedBufferWriter(this);\n _endLengthDelimited(mark);\n break;\n }\n }\n\n void _writeBytesNoTag(dynamic value) {\n writeInt32NoTag(value.length);\n writeRawBytes(value);\n }\n\n void _writeTag(int fieldNumber, int wireFormat) {\n writeInt32NoTag(makeTag(fieldNumber, wireFormat));\n }\n\n void _writeValue(\n int fieldNumber, int valueType, dynamic value, int wireFormat) {\n _writeTag(fieldNumber, wireFormat);\n _writeValueAs(valueType, value);\n if (valueType == PbFieldType._GROUP_BIT) {\n _writeTag(fieldNumber, WIRETYPE_END_GROUP);\n }\n }\n\n void writeInt32NoTag(int value) {\n _writeVarint32(value & 0xFFFFFFFF);\n }\n\n /// Copy bytes from the given typed data array into the output buffer.\n ///\n /// Has a specialization for Uint8List for performance.\n int _copyInto(Uint8List buffer, int pos, TypedData value) {\n if (value is Uint8List) {\n var len = value.length;\n for (var j = 0; j < len; j++) {\n buffer[pos++] = value[j];\n }\n return pos;\n } else {\n var len = value.lengthInBytes;\n var u8 = Uint8List.view(\n value.buffer, value.offsetInBytes, value.lengthInBytes);\n for (var j = 0; j < len; j++) {\n buffer[pos++] = u8[j];\n }\n return pos;\n }\n }\n\n /// This function maps a power-of-2 value (2^0 .. 2^31) to a unique value\n /// in the 0..31 range.\n ///\n /// For more details see \"Using de Bruijn Sequences to Index a 1 in\n /// a Computer Word\"[1]\n ///\n /// Note: this is guaranteed to work after compilation to JavaScript\n /// where multiplication becomes a floating point multiplication.\n ///\n /// [1] http://supertech.csail.mit.edu/papers/debruijn.pdf\n static int _valueTypeIndex(int powerOf2) =>\n ((0x077CB531 * powerOf2) >> 27) & 31;\n\n /// Precomputed indices for all FbFieldType._XYZ_BIT values:\n ///\n /// _XYZ_BIT_INDEX = _valueTypeIndex(FbFieldType._XYZ_BIT)\n ///\n static const _BOOL_BIT_INDEX = 14;\n static const _BYTES_BIT_INDEX = 29;\n static const _STRING_BIT_INDEX = 27;\n static const _DOUBLE_BIT_INDEX = 23;\n static const _FLOAT_BIT_INDEX = 15;\n static const _ENUM_BIT_INDEX = 31;\n static const _GROUP_BIT_INDEX = 30;\n static const _INT32_BIT_INDEX = 28;\n static const _INT64_BIT_INDEX = 25;\n static const _SINT32_BIT_INDEX = 18;\n static const _SINT64_BIT_INDEX = 5;\n static const _UINT32_BIT_INDEX = 11;\n static const _UINT64_BIT_INDEX = 22;\n static const _FIXED32_BIT_INDEX = 13;\n static const _FIXED64_BIT_INDEX = 26;\n static const _SFIXED32_BIT_INDEX = 21;\n static const _SFIXED64_BIT_INDEX = 10;\n static const _MESSAGE_BIT_INDEX = 20;\n\n /// Mapping from value types to wire-types indexed by _valueTypeIndex(...).\n static final Uint8List _wireTypes = Uint8List(32)\n ..[_BOOL_BIT_INDEX] = WIRETYPE_VARINT\n ..[_BYTES_BIT_INDEX] = WIRETYPE_LENGTH_DELIMITED\n ..[_STRING_BIT_INDEX] = WIRETYPE_LENGTH_DELIMITED\n ..[_DOUBLE_BIT_INDEX] = WIRETYPE_FIXED64\n ..[_FLOAT_BIT_INDEX] = WIRETYPE_FIXED32\n ..[_ENUM_BIT_INDEX] = WIRETYPE_VARINT\n ..[_GROUP_BIT_INDEX] = WIRETYPE_START_GROUP\n ..[_INT32_BIT_INDEX] = WIRETYPE_VARINT\n ..[_INT64_BIT_INDEX] = WIRETYPE_VARINT\n ..[_SINT32_BIT_INDEX] = WIRETYPE_VARINT\n ..[_SINT64_BIT_INDEX] = WIRETYPE_VARINT\n ..[_UINT32_BIT_INDEX] = WIRETYPE_VARINT\n ..[_UINT64_BIT_INDEX] = WIRETYPE_VARINT\n ..[_FIXED32_BIT_INDEX] = WIRETYPE_FIXED32\n ..[_FIXED64_BIT_INDEX] = WIRETYPE_FIXED64\n ..[_SFIXED32_BIT_INDEX] = WIRETYPE_FIXED32\n ..[_SFIXED64_BIT_INDEX] = WIRETYPE_FIXED64\n ..[_MESSAGE_BIT_INDEX] = WIRETYPE_LENGTH_DELIMITED;\n}\n\nint _encodeZigZag32(int value) => (value << 1) ^ (value >> 31);\nInt64 _encodeZigZag64(Int64 value) => (value << 1) ^ (value >> 63);\n"},"__index_level_0__":{"kind":"number","value":0,"string":"0"}}},{"rowIdx":146349,"cells":{"repo_id":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src"},"file_path":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src/protobuf/extension_registry.dart"},"content":{"kind":"string","value":"// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file\n// for details. All rights reserved. Use of this source code is governed by a\n// BSD-style license that can be found in the LICENSE file.\n\npart of protobuf;\n\n/// A collection of [Extension] objects, organized by the message type they\n/// extend.\nclass ExtensionRegistry {\n final Map> _extensions =\n >{};\n\n static const ExtensionRegistry EMPTY = _EmptyExtensionRegistry();\n\n /// Stores an [extension] in the registry.\n void add(Extension extension) {\n var map =\n _extensions.putIfAbsent(extension.extendee, () => {});\n map[extension.tagNumber] = extension;\n }\n\n /// Stores all [extensions] in the registry.\n void addAll(Iterable extensions) {\n extensions.forEach(add);\n }\n\n /// Retrieves an extension from the registry that adds tag number [tagNumber]\n /// to the [messageName] message type.\n Extension getExtension(String messageName, int tagNumber) {\n var map = _extensions[messageName];\n if (map != null) {\n return map[tagNumber];\n }\n return null;\n }\n\n /// Returns a shallow copy of [message], with all extensions in [this] parsed\n /// from the unknown fields of [message] and of every nested submessage.\n ///\n /// Extensions already present in [message] will be preserved.\n ///\n /// If [message] is frozen, the result will be as well.\n ///\n /// Returns the original message if no new extensions are parsed.\n ///\n /// Throws an [InvalidProtocolBufferException] if the parsed extensions are\n /// malformed.\n ///\n /// Using this method to retrieve extensions is more expensive overall than\n /// using an [ExtensionRegistry] with all the needed extensions when doing\n /// [GeneratedMessage.fromBuffer].\n ///\n /// Example:\n ///\n /// `sample.proto`\n /// ```proto\n /// syntax = \"proto2\";\n ///\n /// message Foo {\n /// extensions 1 to max;\n /// }\n ///\n /// extend Foo {\n /// optional string val1 = 1;\n /// optional string val2 = 2;\n /// }\n /// ```\n /// `main.dart`\n /// ```\n /// import 'package:protobuf/protobuf.dart';\n /// import 'package:test/test.dart';\n /// import 'src/generated/sample.pb.dart';\n ///\n /// void main() {\n /// ExtensionRegistry r1 = ExtensionRegistry()..add(Sample.val1);\n /// ExtensionRegistry r2 = ExtensionRegistry()..add(Sample.val2);\n /// Foo original = Foo()..setExtension(Sample.val1, 'a')..setExtension(Sample.val2, 'b');\n /// Foo withUnknownFields = Foo.fromBuffer(original.writeToBuffer());\n /// Foo reparsed1 = r1.reparseMessage(withUnknownFields);\n /// Foo reparsed2 = r2.reparseMessage(reparsed1);\n /// expect(withUnknownFields.hasExtension(Sample.val1), isFalse);\n /// expect(withUnknownFields.hasExtension(Sample.val2), isFalse);\n /// expect(reparsed1.hasExtension(Sample.val1), isTrue);\n /// expect(reparsed1.hasExtension(Sample.val2), isFalse);\n /// expect(reparsed2.hasExtension(Sample.val1), isTrue);\n /// expect(reparsed2.hasExtension(Sample.val2), isTrue);\n /// }\n /// ```\n T reparseMessage(T message) =>\n _reparseMessage(message, this);\n}\n\nT _reparseMessage(\n T message, ExtensionRegistry extensionRegistry) {\n T result;\n T ensureResult() {\n if (result == null) {\n result ??= message.createEmptyInstance();\n result._fieldSet._shallowCopyValues(message._fieldSet);\n }\n return result;\n }\n\n UnknownFieldSet resultUnknownFields;\n UnknownFieldSet ensureUnknownFields() =>\n resultUnknownFields ??= ensureResult()._fieldSet._unknownFields;\n\n var messageUnknownFields = message._fieldSet._unknownFields;\n if (messageUnknownFields != null) {\n var codedBufferWriter = CodedBufferWriter();\n extensionRegistry._extensions[message.info_.qualifiedMessageName]\n ?.forEach((tagNumber, extension) {\n final unknownField = messageUnknownFields._fields[tagNumber];\n if (unknownField != null) {\n unknownField.writeTo(tagNumber, codedBufferWriter);\n ensureUnknownFields()._fields.remove(tagNumber);\n }\n });\n\n if (codedBufferWriter.toBuffer().isNotEmpty) {\n ensureResult()\n .mergeFromBuffer(codedBufferWriter.toBuffer(), extensionRegistry);\n }\n }\n\n message._fieldSet._meta.byIndex.forEach((FieldInfo field) {\n PbList resultEntries;\n PbList ensureEntries() =>\n resultEntries ??= ensureResult()._fieldSet._values[field.index];\n\n PbMap resultMap;\n PbMap ensureMap() =>\n resultMap ??= ensureResult()._fieldSet._values[field.index];\n\n if (field.isRepeated) {\n final messageEntries = message._fieldSet._values[field.index];\n if (messageEntries == null) return;\n if (field.isGroupOrMessage) {\n for (var i = 0; i < messageEntries.length; i++) {\n final GeneratedMessage entry = messageEntries[i];\n final reparsedEntry = _reparseMessage(entry, extensionRegistry);\n if (!identical(entry, reparsedEntry)) {\n ensureEntries()[i] = reparsedEntry;\n }\n }\n }\n } else if (field is MapFieldInfo) {\n final messageMap = message._fieldSet._values[field.index];\n if (messageMap == null) return;\n if (_isGroupOrMessage(field.valueFieldType)) {\n for (var key in messageMap.keys) {\n final GeneratedMessage value = messageMap[key];\n final reparsedValue = _reparseMessage(value, extensionRegistry);\n if (!identical(value, reparsedValue)) {\n ensureMap()[key] = reparsedValue;\n }\n }\n }\n } else if (field.isGroupOrMessage) {\n final messageSubField = message._fieldSet._values[field.index];\n if (messageSubField == null) return;\n final reparsedSubField =\n _reparseMessage(messageSubField, extensionRegistry);\n if (!identical(messageSubField, reparsedSubField)) {\n ensureResult()._fieldSet._values[field.index] = reparsedSubField;\n }\n }\n });\n\n if (result != null && message.isFrozen) {\n result.freeze();\n }\n\n return result ?? message;\n}\n\nclass _EmptyExtensionRegistry implements ExtensionRegistry {\n const _EmptyExtensionRegistry();\n\n @override\n Map> get _extensions =>\n const >{};\n\n @override\n void add(Extension extension) {\n throw UnsupportedError('Immutable ExtensionRegistry');\n }\n\n @override\n void addAll(Iterable extensions) {\n throw UnsupportedError('Immutable ExtensionRegistry');\n }\n\n @override\n Extension getExtension(String messageName, int tagNumber) => null;\n\n @override\n T reparseMessage(T message) =>\n _reparseMessage(message, this);\n}\n"},"__index_level_0__":{"kind":"number","value":0,"string":"0"}}},{"rowIdx":146350,"cells":{"repo_id":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src"},"file_path":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src/protobuf/builder_info.dart"},"content":{"kind":"string","value":"// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file\n// for details. All rights reserved. Use of this source code is governed by a\n// BSD-style license that can be found in the LICENSE file.\n\npart of protobuf;\n\n/// Per-message type setup.\nclass BuilderInfo {\n /// The fully qualified name of this message.\n final String qualifiedMessageName;\n final List byIndex = [];\n final Map fieldInfo = {};\n final Map byTagAsString = {};\n final Map byName = {};\n // Maps a tag number to the corresponding oneof index (if any).\n final Map oneofs = {};\n bool hasExtensions = false;\n bool hasRequiredFields = true;\n List _sortedByTag;\n\n // For well-known types.\n final Object Function(GeneratedMessage message, TypeRegistry typeRegistry)\n toProto3Json;\n final Function(GeneratedMessage targetMessage, Object json,\n TypeRegistry typeRegistry, JsonParsingContext context) fromProto3Json;\n final CreateBuilderFunc createEmptyInstance;\n\n BuilderInfo(String messageName,\n {PackageName package = const PackageName(''),\n this.createEmptyInstance,\n this.toProto3Json,\n this.fromProto3Json})\n : qualifiedMessageName = '${package.prefix}$messageName';\n\n void add(\n int tagNumber,\n String name,\n int fieldType,\n dynamic defaultOrMaker,\n CreateBuilderFunc subBuilder,\n ValueOfFunc valueOf,\n List enumValues,\n {String protoName}) {\n var index = byIndex.length;\n final fieldInfo = (tagNumber == 0)\n ? FieldInfo.dummy(index)\n : FieldInfo(name, tagNumber, index, fieldType,\n defaultOrMaker: defaultOrMaker,\n subBuilder: subBuilder,\n valueOf: valueOf,\n enumValues: enumValues,\n protoName: protoName);\n _addField(fieldInfo);\n }\n\n void addMapField(\n int tagNumber,\n String name,\n int keyFieldType,\n int valueFieldType,\n BuilderInfo mapEntryBuilderInfo,\n CreateBuilderFunc valueCreator,\n {String protoName}) {\n var index = byIndex.length;\n _addField(MapFieldInfo(name, tagNumber, index, PbFieldType.M,\n keyFieldType, valueFieldType, mapEntryBuilderInfo, valueCreator,\n protoName: protoName));\n }\n\n void addRepeated(\n int tagNumber,\n String name,\n int fieldType,\n CheckFunc check,\n CreateBuilderFunc subBuilder,\n ValueOfFunc valueOf,\n List enumValues,\n {String protoName}) {\n var index = byIndex.length;\n _addField(FieldInfo.repeated(\n name, tagNumber, index, fieldType, check, subBuilder,\n valueOf: valueOf, enumValues: enumValues, protoName: protoName));\n }\n\n void _addField(FieldInfo fi) {\n byIndex.add(fi);\n assert(byIndex[fi.index] == fi);\n // Fields with tag number 0 are considered dummy fields added to avoid\n // index calculations add up. They should not be reflected in the following\n // maps.\n if (!fi._isDummy) {\n fieldInfo[fi.tagNumber] = fi;\n byTagAsString['${fi.tagNumber}'] = fi;\n byName[fi.name] = fi;\n }\n }\n\n void a(int tagNumber, String name, int fieldType,\n {dynamic defaultOrMaker,\n CreateBuilderFunc subBuilder,\n ValueOfFunc valueOf,\n List enumValues,\n String protoName}) {\n add(tagNumber, name, fieldType, defaultOrMaker, subBuilder, valueOf,\n enumValues,\n protoName: protoName);\n }\n\n /// Adds PbFieldType.OS String with no default value to reduce generated\n /// code size.\n void aOS(int tagNumber, String name, {String protoName}) {\n add(tagNumber, name, PbFieldType.OS, null, null, null, null,\n protoName: protoName);\n }\n\n /// Adds PbFieldType.PS String with no default value.\n void pPS(int tagNumber, String name, {String protoName}) {\n addRepeated(tagNumber, name, PbFieldType.PS,\n getCheckFunction(PbFieldType.PS), null, null, null,\n protoName: protoName);\n }\n\n /// Adds PbFieldType.QS String with no default value.\n void aQS(int tagNumber, String name, {String protoName}) {\n add(tagNumber, name, PbFieldType.QS, null, null, null, null,\n protoName: protoName);\n }\n\n /// Adds Int64 field with Int64.ZERO default.\n void aInt64(int tagNumber, String name, {String protoName}) {\n add(tagNumber, name, PbFieldType.O6, Int64.ZERO, null, null, null,\n protoName: protoName);\n }\n\n /// Adds a boolean with no default value.\n void aOB(int tagNumber, String name, {String protoName}) {\n add(tagNumber, name, PbFieldType.OB, null, null, null, null,\n protoName: protoName);\n }\n\n // Enum.\n void e(int tagNumber, String name, int fieldType,\n {dynamic defaultOrMaker,\n ValueOfFunc valueOf,\n List enumValues,\n String protoName}) {\n add(\n tagNumber, name, fieldType, defaultOrMaker, null, valueOf, enumValues,\n protoName: protoName);\n }\n\n // Repeated, not a message, group, or enum.\n void p(int tagNumber, String name, int fieldType, {String protoName}) {\n assert(!_isGroupOrMessage(fieldType) && !_isEnum(fieldType));\n addRepeated(tagNumber, name, fieldType, getCheckFunction(fieldType),\n null, null, null,\n protoName: protoName);\n }\n\n // Repeated message, group, or enum.\n void pc(int tagNumber, String name, int fieldType,\n {CreateBuilderFunc subBuilder,\n ValueOfFunc valueOf,\n List enumValues,\n String protoName}) {\n assert(_isGroupOrMessage(fieldType) || _isEnum(fieldType));\n addRepeated(tagNumber, name, fieldType, _checkNotNull, subBuilder,\n valueOf, enumValues,\n protoName: protoName);\n }\n\n void aOM(int tagNumber, String name,\n {T Function() subBuilder, String protoName}) {\n add(\n tagNumber,\n name,\n PbFieldType.OM,\n GeneratedMessage._defaultMakerFor(subBuilder),\n subBuilder,\n null,\n null,\n protoName: protoName);\n }\n\n void aQM(int tagNumber, String name,\n {T Function() subBuilder, String protoName}) {\n add(\n tagNumber,\n name,\n PbFieldType.QM,\n GeneratedMessage._defaultMakerFor(subBuilder),\n subBuilder,\n null,\n null,\n protoName: protoName);\n }\n\n // oneof declarations.\n void oo(int oneofIndex, List tags) {\n tags.forEach((int tag) => oneofs[tag] = oneofIndex);\n }\n\n // Map field.\n void m(int tagNumber, String name,\n {String entryClassName,\n int keyFieldType,\n int valueFieldType,\n CreateBuilderFunc valueCreator,\n ValueOfFunc valueOf,\n List enumValues,\n PackageName packageName = const PackageName(''),\n String protoName}) {\n var mapEntryBuilderInfo = BuilderInfo(entryClassName, package: packageName)\n ..add(PbMap._keyFieldNumber, 'key', keyFieldType, null, null, null, null)\n ..add(PbMap._valueFieldNumber, 'value', valueFieldType, null,\n valueCreator, valueOf, enumValues);\n\n addMapField(tagNumber, name, keyFieldType, valueFieldType,\n mapEntryBuilderInfo, valueCreator,\n protoName: protoName);\n }\n\n bool containsTagNumber(int tagNumber) => fieldInfo.containsKey(tagNumber);\n\n dynamic defaultValue(int tagNumber) {\n var func = makeDefault(tagNumber);\n return func == null ? null : func();\n }\n\n // Returns the field name for a given tag number, for debugging purposes.\n String fieldName(int tagNumber) {\n var i = fieldInfo[tagNumber];\n return i != null ? i.name : null;\n }\n\n int fieldType(int tagNumber) {\n var i = fieldInfo[tagNumber];\n return i != null ? i.type : null;\n }\n\n MakeDefaultFunc makeDefault(int tagNumber) {\n var i = fieldInfo[tagNumber];\n return i != null ? i.makeDefault : null;\n }\n\n CreateBuilderFunc subBuilder(int tagNumber) {\n var i = fieldInfo[tagNumber];\n return i != null ? i.subBuilder : null;\n }\n\n int tagNumber(String fieldName) {\n var i = byName[fieldName];\n return i != null ? i.tagNumber : null;\n }\n\n ValueOfFunc valueOfFunc(int tagNumber) {\n var i = fieldInfo[tagNumber];\n return i != null ? i.valueOf : null;\n }\n\n /// The FieldInfo for each field in tag number order.\n List get sortedByTag => _sortedByTag ??= _computeSortedByTag();\n\n /// The message name. Also see [qualifiedMessageName].\n String get messageName {\n final lastDot = qualifiedMessageName.lastIndexOf('.');\n return lastDot == -1\n ? qualifiedMessageName\n : qualifiedMessageName.substring(lastDot + 1);\n }\n\n List _computeSortedByTag() {\n // TODO(skybrian): perhaps the code generator should insert the FieldInfos\n // in tag number order, to avoid sorting them?\n return List.from(fieldInfo.values, growable: false)\n ..sort((FieldInfo a, FieldInfo b) => a.tagNumber.compareTo(b.tagNumber));\n }\n\n GeneratedMessage _makeEmptyMessage(\n int tagNumber, ExtensionRegistry extensionRegistry) {\n var subBuilderFunc = subBuilder(tagNumber);\n if (subBuilderFunc == null && extensionRegistry != null) {\n subBuilderFunc = extensionRegistry\n .getExtension(qualifiedMessageName, tagNumber)\n .subBuilder;\n }\n return subBuilderFunc();\n }\n\n ProtobufEnum _decodeEnum(\n int tagNumber, ExtensionRegistry registry, int rawValue) {\n var f = valueOfFunc(tagNumber);\n if (f == null && registry != null) {\n f = registry.getExtension(qualifiedMessageName, tagNumber).valueOf;\n }\n return f(rawValue);\n }\n}\n\n/// Annotation for marking accessors that belong together.\nclass TagNumber {\n final int tagNumber;\n\n /// Annotation for marking accessors that belong together.\n ///\n /// Allows tooling to associate related accessors.\n /// [tagNumber] is the protobuf tagnumber associated with the annotated\n /// accessor.\n const TagNumber(this.tagNumber);\n}\n"},"__index_level_0__":{"kind":"number","value":0,"string":"0"}}},{"rowIdx":146351,"cells":{"repo_id":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src/protobuf"},"file_path":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src/protobuf/mixins/map_mixin.dart"},"content":{"kind":"string","value":"// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file\n// for details. All rights reserved. Use of this source code is governed by a\n// BSD-style license that can be found in the LICENSE file.\n\nlibrary protobuf.mixins.map;\n\nimport 'package:protobuf/protobuf.dart' show BuilderInfo;\n\n/// Note that this class does not claim to implement [Map]. Instead, this needs\n/// to be specified using a dart_options.imports clause specifying MapMixin as a\n/// parent mixin to PbMapMixin.\n///\n/// Since PbMapMixin is built in, this is done automatically, so this mixin can\n/// be enabled by specifying only a dart_options.mixin option.\nabstract class PbMapMixin {\n // GeneratedMessage properties and methods used by this mixin.\n\n BuilderInfo get info_;\n void clear();\n int getTagNumber(String fieldName);\n dynamic getField(int tagNumber);\n void setField(int tagNumber, var value);\n\n dynamic operator [](key) {\n if (key is! String) return null;\n var tag = getTagNumber(key);\n if (tag == null) return null;\n return getField(tag);\n }\n\n operator []=(key, val) {\n var tag = getTagNumber(key as String);\n if (tag == null) {\n throw ArgumentError(\n \"field '${key}' not found in ${info_.qualifiedMessageName}\");\n }\n setField(tag, val);\n }\n\n Iterable get keys => info_.byName.keys;\n\n bool containsKey(Object key) => info_.byName.containsKey(key);\n\n int get length => info_.byName.length;\n\n dynamic remove(key) {\n throw UnsupportedError(\n 'remove() not supported by ${info_.qualifiedMessageName}');\n }\n}\n"},"__index_level_0__":{"kind":"number","value":0,"string":"0"}}},{"rowIdx":146352,"cells":{"repo_id":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src/protobuf"},"file_path":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src/protobuf/mixins/event_mixin.dart"},"content":{"kind":"string","value":"// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file\n// for details. All rights reserved. Use of this source code is governed by a\n// BSD-style license that can be found in the LICENSE file.\n\nlibrary protobuf.mixins.event;\n\nimport 'dart:async' show StreamController, scheduleMicrotask;\nimport 'dart:collection' show UnmodifiableListView;\n\nimport 'package:protobuf/protobuf.dart'\n show GeneratedMessage, FieldInfo, EventPlugin;\n\n/// Provides a stream of changes to fields in a GeneratedMessage.\n/// (Experimental.)\n///\n/// This mixin is enabled via an option in\n/// dart_options.proto in dart-protoc-plugin.\nabstract class PbEventMixin {\n final eventPlugin = EventBuffer();\n\n /// A stream of changes to fields in the GeneratedMessage.\n ///\n /// Events are buffered and delivered via a microtask or in\n /// the next call to [deliverChanges], whichever happens first.\n Stream> get changes => eventPlugin.changes;\n\n /// Delivers buffered field change events synchronously,\n /// instead of waiting for the microtask to run.\n void deliverChanges() => eventPlugin.deliverChanges();\n}\n\n/// A change to a field in a GeneratedMessage.\nclass PbFieldChange {\n final GeneratedMessage message;\n final FieldInfo info;\n final oldValue;\n final newValue;\n\n PbFieldChange(this.message, this.info, this.oldValue, this.newValue);\n\n int get tag => info.tagNumber;\n}\n\n/// A buffering implementation of event delivery.\n/// (Loosely based on package:observe's ChangeNotifier.)\nclass EventBuffer extends EventPlugin {\n // An EventBuffer is created for each GeneratedMessage, so\n // initialization should be fast; create fields lazily.\n\n GeneratedMessage _parent;\n StreamController> _controller;\n\n // If _buffer is non-null, at least one event is in the buffer\n // and a microtask has been scheduled to empty it.\n List _buffer;\n\n @override\n void attach(GeneratedMessage newParent) {\n assert(_parent == null);\n assert(newParent != null);\n _parent = newParent;\n }\n\n Stream> get changes {\n _controller ??= StreamController.broadcast(sync: true);\n return _controller.stream;\n }\n\n @override\n bool get hasObservers => _controller != null && _controller.hasListener;\n\n void deliverChanges() {\n var records = _buffer;\n _buffer = null;\n if (records != null && hasObservers) {\n _controller.add(UnmodifiableListView(records));\n }\n }\n\n void addEvent(PbFieldChange change) {\n if (!hasObservers) return;\n if (_buffer == null) {\n _buffer = [];\n scheduleMicrotask(deliverChanges);\n }\n _buffer.add(change);\n }\n\n @override\n void beforeSetField(FieldInfo fi, newValue) {\n var oldValue = _parent.getFieldOrNull(fi.tagNumber);\n oldValue ??= fi.readonlyDefault;\n if (identical(oldValue, newValue)) return;\n addEvent(PbFieldChange(_parent, fi, oldValue, newValue));\n }\n\n @override\n void beforeClearField(FieldInfo fi) {\n var oldValue = _parent.getFieldOrNull(fi.tagNumber);\n if (oldValue == null) return;\n var newValue = fi.readonlyDefault;\n addEvent(PbFieldChange(_parent, fi, oldValue, newValue));\n }\n}\n"},"__index_level_0__":{"kind":"number","value":0,"string":"0"}}},{"rowIdx":146353,"cells":{"repo_id":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src/protobuf"},"file_path":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/protobuf/src/protobuf/mixins/well_known.dart"},"content":{"kind":"string","value":"// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file\n// for details. All rights reserved. Use of this source code is governed by a\n// BSD-style license that can be found in the LICENSE file.\n\nimport 'dart:convert';\n\nimport 'package:fixnum/fixnum.dart';\n\nimport '../json_parsing_context.dart';\nimport '../../../protobuf.dart';\nimport '../type_registry.dart';\n\nabstract class AnyMixin implements GeneratedMessage {\n String get typeUrl;\n set typeUrl(String value);\n List get value;\n set value(List value);\n\n /// Returns `true` if the encoded message matches the type of [instance].\n ///\n /// Can be used with a default instance:\n /// `any.canUnpackInto(Message.getDefault())`\n bool canUnpackInto(GeneratedMessage instance) {\n return canUnpackIntoHelper(instance, typeUrl);\n }\n\n /// Unpacks the message in [value] into [instance].\n ///\n /// Throws a [InvalidProtocolBufferException] if [typeUrl] does not correspond\n /// to the type of [instance].\n ///\n /// A typical usage would be `any.unpackInto(Message())`.\n ///\n /// Returns [instance].\n T unpackInto(T instance,\n {ExtensionRegistry extensionRegistry = ExtensionRegistry.EMPTY}) {\n unpackIntoHelper(value, instance, typeUrl,\n extensionRegistry: extensionRegistry);\n return instance;\n }\n\n /// Updates [target] to be the packed representation of [message].\n ///\n /// The [typeUrl] will be [typeUrlPrefix]/`fullName` where `fullName` is\n /// the fully qualified name of the type of [message].\n static void packIntoAny(AnyMixin target, GeneratedMessage message,\n {String typeUrlPrefix = 'type.googleapis.com'}) {\n target.value = message.writeToBuffer();\n target.typeUrl = '${typeUrlPrefix}/${message.info_.qualifiedMessageName}';\n }\n\n // From google/protobuf/any.proto:\n // JSON\n // ====\n // The JSON representation of an `Any` value uses the regular\n // representation of the deserialized, embedded message, with an\n // additional field `@type` which contains the type URL. Example:\n //\n // package google.profile;\n // message Person {\n // string first_name = 1;\n // string last_name = 2;\n // }\n //\n // {\n // \"@type\": \"type.googleapis.com/google.profile.Person\",\n // \"firstName\": ,\n // \"lastName\": \n // }\n //\n // If the embedded message type is well-known and has a custom JSON\n // representation, that representation will be embedded adding a field\n // `value` which holds the custom JSON in addition to the `@type`\n // field. Example (for message [google.protobuf.Duration][]):\n //\n // {\n // \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n // \"value\": \"1.212s\"\n // }\n static Object toProto3JsonHelper(\n GeneratedMessage message, TypeRegistry typeRegistry) {\n var any = message as AnyMixin;\n var info = typeRegistry.lookup(_typeNameFromUrl(any.typeUrl));\n if (info == null) {\n throw ArgumentError(\n 'The type of the Any message (${any.typeUrl}) is not in the given typeRegistry.');\n }\n var unpacked = info.createEmptyInstance()..mergeFromBuffer(any.value);\n var proto3Json = unpacked.toProto3Json();\n if (info.toProto3Json == null) {\n var map = proto3Json as Map;\n map['@type'] = any.typeUrl;\n return map;\n } else {\n return {'@type': any.typeUrl, 'value': proto3Json};\n }\n }\n\n static void fromProto3JsonHelper(GeneratedMessage message, Object json,\n TypeRegistry typeRegistry, JsonParsingContext context) {\n if (json is! Map) {\n throw context.parseException(\n 'Expected Any message encoded as {@type,...},', json);\n }\n final object = json as Map;\n final typeUrl = object['@type'];\n\n if (typeUrl is String) {\n var any = message as AnyMixin;\n var info = typeRegistry.lookup(_typeNameFromUrl(typeUrl));\n if (info == null) {\n throw context.parseException(\n 'Decoding Any of type ${typeUrl} not in TypeRegistry $typeRegistry',\n json);\n }\n\n Object subJson = info.fromProto3Json == null\n // TODO(sigurdm): avoid cloning [object] here.\n ? (Map.from(object)..remove('@type'))\n : object['value'];\n // TODO(sigurdm): We lose [context.path].\n var packedMessage = info.createEmptyInstance()\n ..mergeFromProto3Json(subJson,\n typeRegistry: typeRegistry,\n supportNamesWithUnderscores: context.supportNamesWithUnderscores,\n ignoreUnknownFields: context.ignoreUnknownFields,\n permissiveEnums: context.permissiveEnums);\n\n any.value = packedMessage.writeToBuffer();\n any.typeUrl = typeUrl;\n } else {\n throw context.parseException('Expected a string', json);\n }\n }\n}\n\nString _typeNameFromUrl(String typeUrl) {\n var index = typeUrl.lastIndexOf('/');\n return index < 0 ? '' : typeUrl.substring(index + 1);\n}\n\nabstract class TimestampMixin {\n static final RegExp finalGroupsOfThreeZeroes = RegExp(r'(?:000)*$');\n\n Int64 get seconds;\n set seconds(Int64 value);\n\n int get nanos;\n set nanos(int value);\n\n /// Converts an instance to [DateTime].\n ///\n /// The result is in UTC time zone and has microsecond precision, as\n /// [DateTime] does not support nanosecond precision.\n DateTime toDateTime() => DateTime.fromMicrosecondsSinceEpoch(\n seconds.toInt() * Duration.microsecondsPerSecond + nanos ~/ 1000,\n isUtc: true);\n\n /// Updates [target] to be the time at [datetime].\n ///\n /// Time zone information will not be preserved.\n static void setFromDateTime(TimestampMixin target, DateTime dateTime) {\n var micros = dateTime.microsecondsSinceEpoch;\n target.seconds = Int64(micros ~/ Duration.microsecondsPerSecond);\n target.nanos = (micros % Duration.microsecondsPerSecond).toInt() * 1000;\n }\n\n static String _twoDigits(int n) {\n if (n >= 10) return '${n}';\n return '0${n}';\n }\n\n static final DateTime _minTimestamp = DateTime.utc(1);\n static final DateTime _maxTimestamp = DateTime.utc(9999, 13, 31, 23, 59, 59);\n\n // From google/protobuf/timestamp.proto:\n // # JSON Mapping\n //\n // In JSON format, the Timestamp type is encoded as a string in the\n // [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the\n // format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\"\n // where {year} is always expressed using four digits while {month}, {day},\n // {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional\n // seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),\n // are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone\n // is required. A proto3 JSON serializer should always use UTC (as indicated by\n // \"Z\") when printing the Timestamp type and a proto3 JSON parser should be\n // able to accept both UTC and other timezones (as indicated by an offset).\n //\n // For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past\n // 01:30 UTC on January 15, 2017.\n static Object toProto3JsonHelper(\n GeneratedMessage message, TypeRegistry typeRegistry) {\n var timestamp = message as TimestampMixin;\n var dateTime = timestamp.toDateTime();\n\n if (timestamp.nanos < 0) {\n throw ArgumentError(\n 'Timestamp with negative `nanos`: ${timestamp.nanos}');\n }\n if (timestamp.nanos > 999999999) {\n throw ArgumentError(\n 'Timestamp with `nanos` out of range: ${timestamp.nanos}');\n }\n if (dateTime.isBefore(_minTimestamp) || dateTime.isAfter(_maxTimestamp)) {\n throw ArgumentError('Timestamp Must be from 0001-01-01T00:00:00Z to '\n '9999-12-31T23:59:59Z inclusive. Was: ${dateTime.toIso8601String()}');\n }\n\n // Because [DateTime] doesn't have nano-second precision, we cannot use\n // dateTime.toIso8601String().\n var y = '${dateTime.year}'.padLeft(4, '0');\n var m = _twoDigits(dateTime.month);\n var d = _twoDigits(dateTime.day);\n var h = _twoDigits(dateTime.hour);\n var min = _twoDigits(dateTime.minute);\n var sec = _twoDigits(dateTime.second);\n var secFrac = '';\n if (timestamp.nanos > 0) {\n secFrac = '.' +\n timestamp.nanos\n .toString()\n .padLeft(9, '0')\n .replaceFirst(finalGroupsOfThreeZeroes, '');\n }\n return '$y-$m-${d}T$h:$min:$sec${secFrac}Z';\n }\n\n static void fromProto3JsonHelper(GeneratedMessage message, Object json,\n TypeRegistry typeRegistry, JsonParsingContext context) {\n if (json is String) {\n var jsonWithoutFracSec = json;\n var nanos = 0;\n Match fracSecsMatch = RegExp(r'\\.(\\d+)').firstMatch(json);\n if (fracSecsMatch != null) {\n var fracSecs = fracSecsMatch[1];\n if (fracSecs.length > 9) {\n throw context.parseException(\n 'Timestamp can have at most than 9 decimal digits', json);\n }\n nanos = int.parse(fracSecs.padRight(9, '0'));\n jsonWithoutFracSec =\n json.replaceRange(fracSecsMatch.start, fracSecsMatch.end, '');\n }\n var dateTimeWithoutFractionalSeconds =\n DateTime.tryParse(jsonWithoutFracSec) ??\n (throw context.parseException(\n 'Timestamp not well formatted. ', json));\n\n var timestamp = message as TimestampMixin;\n setFromDateTime(timestamp, dateTimeWithoutFractionalSeconds);\n timestamp.nanos = nanos;\n } else {\n throw context.parseException(\n 'Expected timestamp represented as String', json);\n }\n }\n}\n\nabstract class DurationMixin {\n Int64 get seconds;\n set seconds(Int64 value);\n\n int get nanos;\n set nanos(int value);\n\n static final RegExp finalZeroes = RegExp(r'0+$');\n\n static Object toProto3JsonHelper(\n GeneratedMessage message, TypeRegistry typeRegistry) {\n var duration = message as DurationMixin;\n var secFrac = duration.nanos\n // nanos and seconds should always have the same sign.\n .abs()\n .toString()\n .padLeft(9, '0')\n .replaceFirst(finalZeroes, '');\n var secPart = secFrac == '' ? '' : '.$secFrac';\n return '${duration.seconds}${secPart}s';\n }\n\n static final RegExp durationPattern = RegExp(r'(-?\\d*)(?:\\.(\\d*))?s$');\n\n static void fromProto3JsonHelper(GeneratedMessage message, Object json,\n TypeRegistry typeRegistry, JsonParsingContext context) {\n var duration = message as DurationMixin;\n if (json is String) {\n var match = durationPattern.matchAsPrefix(json);\n if (match == null) {\n throw context.parseException(\n 'Expected a String of the form `.s`', json);\n } else {\n var secondsString = match[1];\n var seconds =\n secondsString == '' ? Int64.ZERO : Int64.parseInt(secondsString);\n duration.seconds = seconds;\n var nanos = int.parse((match[2] ?? '').padRight(9, '0'));\n duration.nanos = seconds < 0 ? -nanos : nanos;\n }\n } else {\n throw context.parseException(\n 'Expected a String of the form `.s`', json);\n }\n }\n}\n\nabstract class StructMixin implements GeneratedMessage {\n Map get fields;\n static const _fieldsFieldTagNumber = 1;\n\n // From google/protobuf/struct.proto:\n // The JSON representation for `Struct` is JSON object.\n static Object toProto3JsonHelper(\n GeneratedMessage message, TypeRegistry typeRegistry) {\n var struct = message as StructMixin;\n return struct.fields.map((key, value) =>\n MapEntry(key, ValueMixin.toProto3JsonHelper(value, typeRegistry)));\n }\n\n static void fromProto3JsonHelper(GeneratedMessage message, Object json,\n TypeRegistry typeRegistry, JsonParsingContext context) {\n if (json is Map) {\n // Check for emptiness to avoid setting `.fields` if there are no\n // values.\n if (json.isNotEmpty) {\n var fields = (message as StructMixin).fields;\n var valueCreator =\n (message.info_.fieldInfo[_fieldsFieldTagNumber] as MapFieldInfo)\n .valueCreator;\n\n json.forEach((key, value) {\n if (key is! String) {\n throw context.parseException('Expected String key', json);\n }\n ValueMixin v = valueCreator();\n context.addMapIndex(key);\n ValueMixin.fromProto3JsonHelper(v, value, typeRegistry, context);\n context.popIndex();\n fields[key] = v;\n });\n }\n } else {\n throw context.parseException(\n 'Expected a JSON object literal (map)', json);\n }\n }\n}\n\nabstract class ValueMixin implements GeneratedMessage {\n bool hasNullValue();\n ProtobufEnum get nullValue;\n set nullValue(covariant ProtobufEnum value);\n bool hasNumberValue();\n double get numberValue;\n set numberValue(double v);\n bool hasStringValue();\n String get stringValue;\n set stringValue(String v);\n bool hasBoolValue();\n bool get boolValue;\n set boolValue(bool v);\n bool hasStructValue();\n StructMixin get structValue;\n set structValue(covariant StructMixin v);\n bool hasListValue();\n ListValueMixin get listValue;\n set listValue(covariant ListValueMixin v);\n\n // From google/protobuf/struct.proto:\n // The JSON representation for `Value` is JSON value\n static Object toProto3JsonHelper(\n GeneratedMessage message, TypeRegistry typeRegistry) {\n var value = message as ValueMixin;\n // This would ideally be a switch, but we cannot import the enum we are\n // switching over.\n if (value.hasNullValue()) {\n return null;\n } else if (value.hasNumberValue()) {\n return value.numberValue;\n } else if (value.hasStringValue()) {\n return value.stringValue;\n } else if (value.hasBoolValue()) {\n return value.boolValue;\n } else if (value.hasStructValue()) {\n return StructMixin.toProto3JsonHelper(value.structValue, typeRegistry);\n } else if (value.hasListValue()) {\n return ListValueMixin.toProto3JsonHelper(value.listValue, typeRegistry);\n } else {\n throw ArgumentError('Serializing google.protobuf.Value with no value');\n }\n }\n\n static void fromProto3JsonHelper(GeneratedMessage message, Object json,\n TypeRegistry typeRegistry, JsonParsingContext context) {\n var value = message as ValueMixin;\n if (json == null) {\n // Rely on the getter retrieving the default to provide an instance.\n value.nullValue = value.nullValue;\n } else if (json is num) {\n value.numberValue = json.toDouble();\n } else if (json is String) {\n value.stringValue = json;\n } else if (json is bool) {\n value.boolValue = json;\n } else if (json is Map) {\n // Clone because the default instance is frozen.\n var structValue = value.structValue.deepCopy();\n StructMixin.fromProto3JsonHelper(\n structValue, json, typeRegistry, context);\n value.structValue = structValue;\n } else if (json is List) {\n // Clone because the default instance is frozen.\n var listValue = value.listValue.deepCopy();\n ListValueMixin.fromProto3JsonHelper(\n listValue, json, typeRegistry, context);\n value.listValue = listValue;\n } else {\n throw context.parseException(\n 'Expected a json-value (Map, List, String, number, bool or null)',\n json);\n }\n }\n}\n\nabstract class ListValueMixin implements GeneratedMessage {\n List get values;\n\n // From google/protobuf/struct.proto:\n // The JSON representation for `ListValue` is JSON array.\n static Object toProto3JsonHelper(\n GeneratedMessage message, TypeRegistry typeRegistry) {\n var list = message as ListValueMixin;\n return list.values\n .map((value) => ValueMixin.toProto3JsonHelper(value, typeRegistry))\n .toList();\n }\n\n static const _valueFieldTagNumber = 1;\n\n static void fromProto3JsonHelper(GeneratedMessage message, Object json,\n TypeRegistry typeRegistry, JsonParsingContext context) {\n var list = message as ListValueMixin;\n if (json is List) {\n var subBuilder = message.info_.subBuilder(_valueFieldTagNumber);\n for (var i = 0; i < json.length; i++) {\n Object element = json[i];\n ValueMixin v = subBuilder();\n context.addListIndex(i);\n ValueMixin.fromProto3JsonHelper(v, element, typeRegistry, context);\n context.popIndex();\n list.values.add(v);\n }\n } else {\n throw context.parseException('Expected a json-List', json);\n }\n }\n}\n\nabstract class FieldMaskMixin {\n List get paths;\n\n // From google/protobuf/field_mask.proto:\n // # JSON Encoding of Field Masks\n //\n // In JSON, a field mask is encoded as a single string where paths are\n // separated by a comma. Fields name in each path are converted\n // to/from lower-camel naming conventions.\n static Object toProto3JsonHelper(\n GeneratedMessage message, TypeRegistry typeRegistry) {\n var fieldMask = message as FieldMaskMixin;\n for (var path in fieldMask.paths) {\n if (path.contains(RegExp('[A-Z]|_[^a-z]'))) {\n throw ArgumentError(\n 'Bad fieldmask $path. Does not round-trip to json.');\n }\n }\n return fieldMask.paths.map(_toCamelCase).join(',');\n }\n\n static void fromProto3JsonHelper(GeneratedMessage message, Object json,\n TypeRegistry typeRegistry, JsonParsingContext context) {\n if (json is String) {\n if (json.contains('_')) {\n throw context.parseException(\n 'Invalid Character `_` in FieldMask', json);\n }\n if (json == '') {\n // The empty string splits to a single value. So this is a special case.\n return;\n }\n (message as FieldMaskMixin).paths\n ..addAll(json.split(',').map(_fromCamelCase));\n } else {\n throw context.parseException(\n 'Expected String formatted as FieldMask', json);\n }\n }\n\n static String _toCamelCase(String name) {\n return name.replaceAllMapped(\n RegExp('_([a-z])'), (Match m) => '${m.group(1).toUpperCase()}');\n }\n\n static String _fromCamelCase(String name) {\n return name.replaceAllMapped(\n RegExp('[A-Z]'), (Match m) => '_${m.group(0).toLowerCase()}');\n }\n}\n\nabstract class DoubleValueMixin {\n double get value;\n set value(double value);\n\n // From google/protobuf/wrappers.proto:\n // The JSON representation for `DoubleValue` is JSON number.\n static Object toProto3JsonHelper(\n GeneratedMessage message, TypeRegistry typeRegistry) {\n return (message as DoubleValueMixin).value;\n }\n\n static void fromProto3JsonHelper(GeneratedMessage message, Object json,\n TypeRegistry typeRegistry, JsonParsingContext context) {\n if (json is num) {\n (message as DoubleValueMixin).value = json.toDouble();\n } else if (json is String) {\n (message as DoubleValueMixin).value = double.tryParse(json) ??\n (throw context.parseException(\n 'Expected string to encode a double', json));\n } else {\n throw context.parseException(\n 'Expected a double as a String or number', json);\n }\n }\n}\n\nabstract class FloatValueMixin {\n double get value;\n set value(double value);\n\n // From google/protobuf/wrappers.proto:\n // The JSON representation for `FloatValue` is JSON number.\n static Object toProto3JsonHelper(\n GeneratedMessage message, TypeRegistry typeRegistry) {\n return (message as FloatValueMixin).value;\n }\n\n static void fromProto3JsonHelper(GeneratedMessage message, Object json,\n TypeRegistry typeRegistry, JsonParsingContext context) {\n if (json is num) {\n (message as FloatValueMixin).value = json.toDouble();\n } else if (json is String) {\n (message as FloatValueMixin).value = double.tryParse(json) ??\n (throw context.parseException(\n 'Expected a float as a String or number', json));\n } else {\n throw context.parseException(\n 'Expected a float as a String or number', json);\n }\n }\n}\n\nabstract class Int64ValueMixin {\n Int64 get value;\n set value(Int64 value);\n\n // From google/protobuf/wrappers.proto:\n // The JSON representation for `Int64Value` is JSON string.\n static Object toProto3JsonHelper(\n GeneratedMessage message, TypeRegistry typeRegistry) {\n return (message as Int64ValueMixin).value.toString();\n }\n\n static void fromProto3JsonHelper(GeneratedMessage message, Object json,\n TypeRegistry typeRegistry, JsonParsingContext context) {\n if (json is int) {\n (message as Int64ValueMixin).value = Int64(json);\n } else if (json is String) {\n try {\n (message as Int64ValueMixin).value = Int64.parseInt(json);\n } on FormatException {\n throw context.parseException('Expected string to encode integer', json);\n }\n } else {\n throw context.parseException(\n 'Expected an integer encoded as a String or number', json);\n }\n }\n}\n\nabstract class UInt64ValueMixin {\n Int64 get value;\n set value(Int64 value);\n\n // From google/protobuf/wrappers.proto:\n // The JSON representation for `UInt64Value` is JSON string.\n static Object toProto3JsonHelper(\n GeneratedMessage message, TypeRegistry typeRegistry) {\n return (message as UInt64ValueMixin).value.toStringUnsigned();\n }\n\n static void fromProto3JsonHelper(GeneratedMessage message, Object json,\n TypeRegistry typeRegistry, JsonParsingContext context) {\n if (json is int) {\n (message as UInt64ValueMixin).value = Int64(json);\n } else if (json is String) {\n try {\n (message as UInt64ValueMixin).value = Int64.parseInt(json);\n } on FormatException {\n throw context.parseException(\n 'Expected string to encode unsigned integer', json);\n }\n } else {\n throw context.parseException(\n 'Expected an unsigned integer as a String or integer', json);\n }\n }\n}\n\nabstract class Int32ValueMixin {\n int get value;\n set value(int value);\n\n // From google/protobuf/wrappers.proto:\n // The JSON representation for `Int32Value` is JSON number.\n static Object toProto3JsonHelper(\n GeneratedMessage message, TypeRegistry typeRegistry) {\n return (message as Int32ValueMixin).value;\n }\n\n static void fromProto3JsonHelper(GeneratedMessage message, Object json,\n TypeRegistry typeRegistry, JsonParsingContext context) {\n if (json is int) {\n (message as Int32ValueMixin).value = json;\n } else if (json is String) {\n (message as Int32ValueMixin).value = int.tryParse(json) ??\n (throw context.parseException(\n 'Expected string to encode integer', json));\n } else {\n throw context.parseException(\n 'Expected an integer encoded as a String or number', json);\n }\n }\n}\n\nabstract class UInt32ValueMixin {\n int get value;\n set value(int value);\n static Object toProto3JsonHelper(\n GeneratedMessage message, TypeRegistry typeRegistry) {\n return (message as UInt32ValueMixin).value;\n }\n\n // From google/protobuf/wrappers.proto:\n // The JSON representation for `UInt32Value` is JSON number.\n static void fromProto3JsonHelper(GeneratedMessage message, Object json,\n TypeRegistry typeRegistry, JsonParsingContext context) {\n if (json is int) {\n (message as UInt32ValueMixin).value = json;\n } else if (json is String) {\n (message as UInt32ValueMixin).value = int.tryParse(json) ??\n (throw context.parseException(\n 'Expected String to encode an integer', json));\n } else {\n throw context.parseException(\n 'Expected an unsigned integer as a String or integer', json);\n }\n }\n}\n\nabstract class BoolValueMixin {\n bool get value;\n set value(bool value);\n\n // From google/protobuf/wrappers.proto:\n // The JSON representation for `BoolValue` is JSON `true` and `false`\n static Object toProto3JsonHelper(\n GeneratedMessage message, TypeRegistry typeRegistry) {\n return (message as BoolValueMixin).value;\n }\n\n static void fromProto3JsonHelper(GeneratedMessage message, Object json,\n TypeRegistry typeRegistry, JsonParsingContext context) {\n if (json is bool) {\n (message as BoolValueMixin).value = json;\n } else {\n throw context.parseException('Expected a bool', json);\n }\n }\n}\n\nabstract class StringValueMixin {\n String get value;\n set value(String value);\n\n // From google/protobuf/wrappers.proto:\n // The JSON representation for `StringValue` is JSON string.\n static Object toProto3JsonHelper(\n GeneratedMessage message, TypeRegistry typeRegistry) {\n return (message as StringValueMixin).value;\n }\n\n static void fromProto3JsonHelper(GeneratedMessage message, Object json,\n TypeRegistry typeRegistry, JsonParsingContext context) {\n if (json is String) {\n (message as StringValueMixin).value = json;\n } else {\n throw context.parseException('Expected a String', json);\n }\n }\n}\n\nabstract class BytesValueMixin {\n List get value;\n set value(List value);\n\n // From google/protobuf/wrappers.proto:\n // The JSON representation for `BytesValue` is JSON string.\n static Object toProto3JsonHelper(\n GeneratedMessage message, TypeRegistry typeRegistry) {\n return base64.encode((message as BytesValueMixin).value);\n }\n\n static void fromProto3JsonHelper(GeneratedMessage message, Object json,\n TypeRegistry typeRegistry, JsonParsingContext context) {\n if (json is String) {\n try {\n (message as BytesValueMixin).value = base64.decode(json);\n } on FormatException {\n throw context.parseException(\n 'Expected bytes encoded as base64 String', json);\n }\n } else {\n throw context.parseException(\n 'Expected bytes encoded as base64 String', json);\n }\n }\n}\n"},"__index_level_0__":{"kind":"number","value":0,"string":"0"}}},{"rowIdx":146354,"cells":{"repo_id":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages"},"file_path":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/path/path.dart"},"content":{"kind":"string","value":"// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file\n// for details. All rights reserved. Use of this source code is governed by a\n// BSD-style license that can be found in the LICENSE file.\n\n/// A comprehensive, cross-platform path manipulation library.\n///\n/// The path library was designed to be imported with a prefix, though you don't\n/// have to if you don't want to:\n///\n/// import 'package:path/path.dart' as p;\n///\n/// The most common way to use the library is through the top-level functions.\n/// These manipulate path strings based on your current working directory and\n/// the path style (POSIX, Windows, or URLs) of the host platform. For example:\n///\n/// p.join('directory', 'file.txt');\n///\n/// This calls the top-level [join] function to join \"directory\" and \"file.txt\"\n/// using the current platform's directory separator.\n///\n/// If you want to work with paths for a specific platform regardless of the\n/// underlying platform that the program is running on, you can create a\n/// [Context] and give it an explicit [Style]:\n///\n/// var context = p.Context(style: Style.windows);\n/// context.join('directory', 'file.txt');\n///\n/// This will join \"directory\" and \"file.txt\" using the Windows path separator,\n/// even when the program is run on a POSIX machine.\nimport 'src/context.dart';\nimport 'src/style.dart';\n\nexport 'src/context.dart' hide createInternal;\nexport 'src/path_exception.dart';\nexport 'src/path_map.dart';\nexport 'src/path_set.dart';\nexport 'src/style.dart';\n\n/// A default context for manipulating POSIX paths.\nfinal Context posix = Context(style: Style.posix);\n\n/// A default context for manipulating Windows paths.\nfinal Context windows = Context(style: Style.windows);\n\n/// A default context for manipulating URLs.\n///\n/// URL path equality is undefined for paths that differ only in their\n/// percent-encoding or only in the case of their host segment.\nfinal Context url = Context(style: Style.url);\n\n/// The system path context.\n///\n/// This differs from a context created with [new Context] in that its\n/// [Context.current] is always the current working directory, rather than being\n/// set once when the context is created.\nfinal Context context = createInternal();\n\n/// Returns the [Style] of the current context.\n///\n/// This is the style that all top-level path functions will use.\nStyle get style => context.style;\n\n/// Gets the path to the current working directory.\n///\n/// In the browser, this means the current URL, without the last file segment.\nString get current {\n // If the current working directory gets deleted out from under the program,\n // accessing it will throw an IO exception. In order to avoid transient\n // errors, if we already have a cached working directory, catch the error and\n // use that.\n Uri uri;\n try {\n uri = Uri.base;\n } on Exception {\n if (_current != null) return _current;\n rethrow;\n }\n\n // Converting the base URI to a file path is pretty slow, and the base URI\n // rarely changes in practice, so we cache the result here.\n if (uri == _currentUriBase) return _current;\n _currentUriBase = uri;\n\n if (Style.platform == Style.url) {\n _current = uri.resolve('.').toString();\n } else {\n final path = uri.toFilePath();\n // Remove trailing '/' or '\\' unless it is the only thing left\n // (for instance the root on Linux).\n final lastIndex = path.length - 1;\n assert(path[lastIndex] == '/' || path[lastIndex] == '\\\\');\n _current = lastIndex == 0 ? path : path.substring(0, lastIndex);\n }\n return _current;\n}\n\n/// The last value returned by [Uri.base].\n///\n/// This is used to cache the current working directory.\nUri _currentUriBase;\n\n/// The last known value of the current working directory.\n///\n/// This is cached because [current] is called frequently but rarely actually\n/// changes.\nString _current;\n\n/// Gets the path separator for the current platform. This is `\\` on Windows\n/// and `/` on other platforms (including the browser).\nString get separator => context.separator;\n\n/// Creates a new path by appending the given path parts to [current].\n/// Equivalent to [join()] with [current] as the first argument. Example:\n///\n/// p.absolute('path', 'to/foo'); // -> '/your/current/dir/path/to/foo'\nString absolute(String part1,\n [String part2,\n String part3,\n String part4,\n String part5,\n String part6,\n String part7]) =>\n context.absolute(part1, part2, part3, part4, part5, part6, part7);\n\n/// Gets the part of [path] after the last separator.\n///\n/// p.basename('path/to/foo.dart'); // -> 'foo.dart'\n/// p.basename('path/to'); // -> 'to'\n///\n/// Trailing separators are ignored.\n///\n/// p.basename('path/to/'); // -> 'to'\nString basename(String path) => context.basename(path);\n\n/// Gets the part of [path] after the last separator, and without any trailing\n/// file extension.\n///\n/// p.basenameWithoutExtension('path/to/foo.dart'); // -> 'foo'\n///\n/// Trailing separators are ignored.\n///\n/// p.basenameWithoutExtension('path/to/foo.dart/'); // -> 'foo'\nString basenameWithoutExtension(String path) =>\n context.basenameWithoutExtension(path);\n\n/// Gets the part of [path] before the last separator.\n///\n/// p.dirname('path/to/foo.dart'); // -> 'path/to'\n/// p.dirname('path/to'); // -> 'path'\n///\n/// Trailing separators are ignored.\n///\n/// p.dirname('path/to/'); // -> 'path'\n///\n/// If an absolute path contains no directories, only a root, then the root\n/// is returned.\n///\n/// p.dirname('/'); // -> '/' (posix)\n/// p.dirname('c:\\'); // -> 'c:\\' (windows)\n///\n/// If a relative path has no directories, then '.' is returned.\n///\n/// p.dirname('foo'); // -> '.'\n/// p.dirname(''); // -> '.'\nString dirname(String path) => context.dirname(path);\n\n/// Gets the file extension of [path]: the portion of [basename] from the last\n/// `.` to the end (including the `.` itself).\n///\n/// p.extension('path/to/foo.dart'); // -> '.dart'\n/// p.extension('path/to/foo'); // -> ''\n/// p.extension('path.to/foo'); // -> ''\n/// p.extension('path/to/foo.dart.js'); // -> '.js'\n///\n/// If the file name starts with a `.`, then that is not considered the\n/// extension:\n///\n/// p.extension('~/.bashrc'); // -> ''\n/// p.extension('~/.notes.txt'); // -> '.txt'\n///\n/// Takes an optional parameter `level` which makes possible to return\n/// multiple extensions having `level` number of dots. If `level` exceeds the\n/// number of dots, the full extension is returned. The value of `level` must\n/// be greater than 0, else `RangeError` is thrown.\n///\n/// p.extension('foo.bar.dart.js', 2); // -> '.dart.js\n/// p.extension('foo.bar.dart.js', 3); // -> '.bar.dart.js'\n/// p.extension('foo.bar.dart.js', 10); // -> '.bar.dart.js'\n/// p.extension('path/to/foo.bar.dart.js', 2); // -> '.dart.js'\nString extension(String path, [int level = 1]) =>\n context.extension(path, level);\n\n/// Returns the root of [path], if it's absolute, or the empty string if it's\n/// relative.\n///\n/// // Unix\n/// p.rootPrefix('path/to/foo'); // -> ''\n/// p.rootPrefix('/path/to/foo'); // -> '/'\n///\n/// // Windows\n/// p.rootPrefix(r'path\\to\\foo'); // -> ''\n/// p.rootPrefix(r'C:\\path\\to\\foo'); // -> r'C:\\'\n/// p.rootPrefix(r'\\\\server\\share\\a\\b'); // -> r'\\\\server\\share'\n///\n/// // URL\n/// p.rootPrefix('path/to/foo'); // -> ''\n/// p.rootPrefix('https://dart.dev/path/to/foo');\n/// // -> 'https://dart.dev'\nString rootPrefix(String path) => context.rootPrefix(path);\n\n/// Returns `true` if [path] is an absolute path and `false` if it is a\n/// relative path.\n///\n/// On POSIX systems, absolute paths start with a `/` (forward slash). On\n/// Windows, an absolute path starts with `\\\\`, or a drive letter followed by\n/// `:/` or `:\\`. For URLs, absolute paths either start with a protocol and\n/// optional hostname (e.g. `https://dart.dev`, `file://`) or with a `/`.\n///\n/// URLs that start with `/` are known as \"root-relative\", since they're\n/// relative to the root of the current URL. Since root-relative paths are still\n/// absolute in every other sense, [isAbsolute] will return true for them. They\n/// can be detected using [isRootRelative].\nbool isAbsolute(String path) => context.isAbsolute(path);\n\n/// Returns `true` if [path] is a relative path and `false` if it is absolute.\n/// On POSIX systems, absolute paths start with a `/` (forward slash). On\n/// Windows, an absolute path starts with `\\\\`, or a drive letter followed by\n/// `:/` or `:\\`.\nbool isRelative(String path) => context.isRelative(path);\n\n/// Returns `true` if [path] is a root-relative path and `false` if it's not.\n///\n/// URLs that start with `/` are known as \"root-relative\", since they're\n/// relative to the root of the current URL. Since root-relative paths are still\n/// absolute in every other sense, [isAbsolute] will return true for them. They\n/// can be detected using [isRootRelative].\n///\n/// No POSIX and Windows paths are root-relative.\nbool isRootRelative(String path) => context.isRootRelative(path);\n\n/// Joins the given path parts into a single path using the current platform's\n/// [separator]. Example:\n///\n/// p.join('path', 'to', 'foo'); // -> 'path/to/foo'\n///\n/// If any part ends in a path separator, then a redundant separator will not\n/// be added:\n///\n/// p.join('path/', 'to', 'foo'); // -> 'path/to/foo\n///\n/// If a part is an absolute path, then anything before that will be ignored:\n///\n/// p.join('path', '/to', 'foo'); // -> '/to/foo'\nString join(String part1,\n [String part2,\n String part3,\n String part4,\n String part5,\n String part6,\n String part7,\n String part8]) =>\n context.join(part1, part2, part3, part4, part5, part6, part7, part8);\n\n/// Joins the given path parts into a single path using the current platform's\n/// [separator]. Example:\n///\n/// p.joinAll(['path', 'to', 'foo']); // -> 'path/to/foo'\n///\n/// If any part ends in a path separator, then a redundant separator will not\n/// be added:\n///\n/// p.joinAll(['path/', 'to', 'foo']); // -> 'path/to/foo\n///\n/// If a part is an absolute path, then anything before that will be ignored:\n///\n/// p.joinAll(['path', '/to', 'foo']); // -> '/to/foo'\n///\n/// For a fixed number of parts, [join] is usually terser.\nString joinAll(Iterable parts) => context.joinAll(parts);\n\n/// Splits [path] into its components using the current platform's [separator].\n///\n/// p.split('path/to/foo'); // -> ['path', 'to', 'foo']\n///\n/// The path will *not* be normalized before splitting.\n///\n/// p.split('path/../foo'); // -> ['path', '..', 'foo']\n///\n/// If [path] is absolute, the root directory will be the first element in the\n/// array. Example:\n///\n/// // Unix\n/// p.split('/path/to/foo'); // -> ['/', 'path', 'to', 'foo']\n///\n/// // Windows\n/// p.split(r'C:\\path\\to\\foo'); // -> [r'C:\\', 'path', 'to', 'foo']\n/// p.split(r'\\\\server\\share\\path\\to\\foo');\n/// // -> [r'\\\\server\\share', 'foo', 'bar', 'baz']\n///\n/// // Browser\n/// p.split('https://dart.dev/path/to/foo');\n/// // -> ['https://dart.dev', 'path', 'to', 'foo']\nList split(String path) => context.split(path);\n\n/// Canonicalizes [path].\n///\n/// This is guaranteed to return the same path for two different input paths\n/// if and only if both input paths point to the same location. Unlike\n/// [normalize], it returns absolute paths when possible and canonicalizes\n/// ASCII case on Windows.\n///\n/// Note that this does not resolve symlinks.\n///\n/// If you want a map that uses path keys, it's probably more efficient to\n/// pass [equals] and [hash] to [new HashMap] than it is to canonicalize every\n/// key.\nString canonicalize(String path) => context.canonicalize(path);\n\n/// Normalizes [path], simplifying it by handling `..`, and `.`, and\n/// removing redundant path separators whenever possible.\n///\n/// Note that this is *not* guaranteed to return the same result for two\n/// equivalent input paths. For that, see [canonicalize]. Or, if you're using\n/// paths as map keys, pass [equals] and [hash] to [new HashMap].\n///\n/// p.normalize('path/./to/..//file.text'); // -> 'path/file.txt'\nString normalize(String path) => context.normalize(path);\n\n/// Attempts to convert [path] to an equivalent relative path from the current\n/// directory.\n///\n/// // Given current directory is /root/path:\n/// p.relative('/root/path/a/b.dart'); // -> 'a/b.dart'\n/// p.relative('/root/other.dart'); // -> '../other.dart'\n///\n/// If the [from] argument is passed, [path] is made relative to that instead.\n///\n/// p.relative('/root/path/a/b.dart', from: '/root/path'); // -> 'a/b.dart'\n/// p.relative('/root/other.dart', from: '/root/path');\n/// // -> '../other.dart'\n///\n/// If [path] and/or [from] are relative paths, they are assumed to be relative\n/// to the current directory.\n///\n/// Since there is no relative path from one drive letter to another on Windows,\n/// or from one hostname to another for URLs, this will return an absolute path\n/// in those cases.\n///\n/// // Windows\n/// p.relative(r'D:\\other', from: r'C:\\home'); // -> 'D:\\other'\n///\n/// // URL\n/// p.relative('https://dart.dev', from: 'https://pub.dev');\n/// // -> 'https://dart.dev'\nString relative(String path, {String from}) =>\n context.relative(path, from: from);\n\n/// Returns `true` if [child] is a path beneath `parent`, and `false` otherwise.\n///\n/// p.isWithin('/root/path', '/root/path/a'); // -> true\n/// p.isWithin('/root/path', '/root/other'); // -> false\n/// p.isWithin('/root/path', '/root/path') // -> false\nbool isWithin(String parent, String child) => context.isWithin(parent, child);\n\n/// Returns `true` if [path1] points to the same location as [path2], and\n/// `false` otherwise.\n///\n/// The [hash] function returns a hash code that matches these equality\n/// semantics.\nbool equals(String path1, String path2) => context.equals(path1, path2);\n\n/// Returns a hash code for [path] such that, if [equals] returns `true` for two\n/// paths, their hash codes are the same.\n///\n/// Note that the same path may have different hash codes on different platforms\n/// or with different [current] directories.\nint hash(String path) => context.hash(path);\n\n/// Removes a trailing extension from the last part of [path].\n///\n/// p.withoutExtension('path/to/foo.dart'); // -> 'path/to/foo'\nString withoutExtension(String path) => context.withoutExtension(path);\n\n/// Returns [path] with the trailing extension set to [extension].\n///\n/// If [path] doesn't have a trailing extension, this just adds [extension] to\n/// the end.\n///\n/// p.setExtension('path/to/foo.dart', '.js') // -> 'path/to/foo.js'\n/// p.setExtension('path/to/foo.dart.js', '.map')\n/// // -> 'path/to/foo.dart.map'\n/// p.setExtension('path/to/foo', '.js') // -> 'path/to/foo.js'\nString setExtension(String path, String extension) =>\n context.setExtension(path, extension);\n\n/// Returns the path represented by [uri], which may be a [String] or a [Uri].\n///\n/// For POSIX and Windows styles, [uri] must be a `file:` URI. For the URL\n/// style, this will just convert [uri] to a string.\n///\n/// // POSIX\n/// p.fromUri('file:///path/to/foo') // -> '/path/to/foo'\n///\n/// // Windows\n/// p.fromUri('file:///C:/path/to/foo') // -> r'C:\\path\\to\\foo'\n///\n/// // URL\n/// p.fromUri('https://dart.dev/path/to/foo')\n/// // -> 'https://dart.dev/path/to/foo'\n///\n/// If [uri] is relative, a relative path will be returned.\n///\n/// p.fromUri('path/to/foo'); // -> 'path/to/foo'\nString fromUri(uri) => context.fromUri(uri);\n\n/// Returns the URI that represents [path].\n///\n/// For POSIX and Windows styles, this will return a `file:` URI. For the URL\n/// style, this will just convert [path] to a [Uri].\n///\n/// // POSIX\n/// p.toUri('/path/to/foo')\n/// // -> Uri.parse('file:///path/to/foo')\n///\n/// // Windows\n/// p.toUri(r'C:\\path\\to\\foo')\n/// // -> Uri.parse('file:///C:/path/to/foo')\n///\n/// // URL\n/// p.toUri('https://dart.dev/path/to/foo')\n/// // -> Uri.parse('https://dart.dev/path/to/foo')\n///\n/// If [path] is relative, a relative URI will be returned.\n///\n/// p.toUri('path/to/foo') // -> Uri.parse('path/to/foo')\nUri toUri(String path) => context.toUri(path);\n\n/// Returns a terse, human-readable representation of [uri].\n///\n/// [uri] can be a [String] or a [Uri]. If it can be made relative to the\n/// current working directory, that's done. Otherwise, it's returned as-is. This\n/// gracefully handles non-`file:` URIs for [Style.posix] and [Style.windows].\n///\n/// The returned value is meant for human consumption, and may be either URI-\n/// or path-formatted.\n///\n/// // POSIX at \"/root/path\"\n/// p.prettyUri('file:///root/path/a/b.dart'); // -> 'a/b.dart'\n/// p.prettyUri('https://dart.dev/'); // -> 'https://dart.dev'\n///\n/// // Windows at \"C:\\root\\path\"\n/// p.prettyUri('file:///C:/root/path/a/b.dart'); // -> r'a\\b.dart'\n/// p.prettyUri('https://dart.dev/'); // -> 'https://dart.dev'\n///\n/// // URL at \"https://dart.dev/root/path\"\n/// p.prettyUri('https://dart.dev/root/path/a/b.dart'); // -> r'a/b.dart'\n/// p.prettyUri('file:///root/path'); // -> 'file:///root/path'\nString prettyUri(uri) => context.prettyUri(uri);\n"},"__index_level_0__":{"kind":"number","value":0,"string":"0"}}},{"rowIdx":146355,"cells":{"repo_id":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/path"},"file_path":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/path/src/style.dart"},"content":{"kind":"string","value":"// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file\n// for details. All rights reserved. Use of this source code is governed by a\n// BSD-style license that can be found in the LICENSE file.\n\nimport 'context.dart';\nimport 'style/posix.dart';\nimport 'style/url.dart';\nimport 'style/windows.dart';\n\n/// An enum type describing a \"flavor\" of path.\nabstract class Style {\n /// POSIX-style paths use \"/\" (forward slash) as separators. Absolute paths\n /// start with \"/\". Used by UNIX, Linux, Mac OS X, and others.\n static final Style posix = PosixStyle();\n\n /// Windows paths use `\\` (backslash) as separators. Absolute paths start with\n /// a drive letter followed by a colon (example, `C:`) or two backslashes\n /// (`\\\\`) for UNC paths.\n static final Style windows = WindowsStyle();\n\n /// URLs aren't filesystem paths, but they're supported to make it easier to\n /// manipulate URL paths in the browser.\n ///\n /// URLs use \"/\" (forward slash) as separators. Absolute paths either start\n /// with a protocol and optional hostname (e.g. `https://dart.dev`,\n /// `file://`) or with \"/\".\n static final Style url = UrlStyle();\n\n /// The style of the host platform.\n ///\n /// When running on the command line, this will be [windows] or [posix] based\n /// on the host operating system. On a browser, this will be [url].\n static final Style platform = _getPlatformStyle();\n\n /// Gets the type of the host platform.\n static Style _getPlatformStyle() {\n // If we're running a Dart file in the browser from a `file:` URI,\n // [Uri.base] will point to a file. If we're running on the standalone,\n // it will point to a directory. We can use that fact to determine which\n // style to use.\n if (Uri.base.scheme != 'file') return Style.url;\n if (!Uri.base.path.endsWith('/')) return Style.url;\n if (Uri(path: 'a/b').toFilePath() == 'a\\\\b') return Style.windows;\n return Style.posix;\n }\n\n /// The name of this path style. Will be \"posix\" or \"windows\".\n String get name;\n\n /// A [Context] that uses this style.\n Context get context => Context(style: this);\n\n @Deprecated('Most Style members will be removed in path 2.0.')\n String get separator;\n\n @Deprecated('Most Style members will be removed in path 2.0.')\n Pattern get separatorPattern;\n\n @Deprecated('Most Style members will be removed in path 2.0.')\n Pattern get needsSeparatorPattern;\n\n @Deprecated('Most Style members will be removed in path 2.0.')\n Pattern get rootPattern;\n\n @Deprecated('Most Style members will be removed in path 2.0.')\n Pattern get relativeRootPattern;\n\n @Deprecated('Most style members will be removed in path 2.0.')\n String getRoot(String path);\n\n @Deprecated('Most style members will be removed in path 2.0.')\n String getRelativeRoot(String path);\n\n @Deprecated('Most style members will be removed in path 2.0.')\n String pathFromUri(Uri uri);\n\n @Deprecated('Most style members will be removed in path 2.0.')\n Uri relativePathToUri(String path);\n\n @Deprecated('Most style members will be removed in path 2.0.')\n Uri absolutePathToUri(String path);\n\n @override\n String toString() => name;\n}\n"},"__index_level_0__":{"kind":"number","value":0,"string":"0"}}},{"rowIdx":146356,"cells":{"repo_id":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/path"},"file_path":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/path/src/parsed_path.dart"},"content":{"kind":"string","value":"// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file\n// for details. All rights reserved. Use of this source code is governed by a\n// BSD-style license that can be found in the LICENSE file.\n\nimport 'internal_style.dart';\nimport 'style.dart';\n\nclass ParsedPath {\n /// The [InternalStyle] that was used to parse this path.\n InternalStyle style;\n\n /// The absolute root portion of the path, or `null` if the path is relative.\n /// On POSIX systems, this will be `null` or \"/\". On Windows, it can be\n /// `null`, \"//\" for a UNC path, or something like \"C:\\\" for paths with drive\n /// letters.\n String root;\n\n /// Whether this path is root-relative.\n ///\n /// See [Context.isRootRelative].\n bool isRootRelative;\n\n /// The path-separated parts of the path. All but the last will be\n /// directories.\n List parts;\n\n /// The path separators preceding each part.\n ///\n /// The first one will be an empty string unless the root requires a separator\n /// between it and the path. The last one will be an empty string unless the\n /// path ends with a trailing separator.\n List separators;\n\n /// The file extension of the last non-empty part, or \"\" if it doesn't have\n /// one.\n String extension([int level]) => _splitExtension(level)[1];\n\n /// `true` if this is an absolute path.\n bool get isAbsolute => root != null;\n\n factory ParsedPath.parse(String path, InternalStyle style) {\n // Remove the root prefix, if any.\n final root = style.getRoot(path);\n final isRootRelative = style.isRootRelative(path);\n if (root != null) path = path.substring(root.length);\n\n // Split the parts on path separators.\n final parts = [];\n final separators = [];\n\n var start = 0;\n\n if (path.isNotEmpty && style.isSeparator(path.codeUnitAt(0))) {\n separators.add(path[0]);\n start = 1;\n } else {\n separators.add('');\n }\n\n for (var i = start; i < path.length; i++) {\n if (style.isSeparator(path.codeUnitAt(i))) {\n parts.add(path.substring(start, i));\n separators.add(path[i]);\n start = i + 1;\n }\n }\n\n // Add the final part, if any.\n if (start < path.length) {\n parts.add(path.substring(start));\n separators.add('');\n }\n\n return ParsedPath._(style, root, isRootRelative, parts, separators);\n }\n\n ParsedPath._(\n this.style, this.root, this.isRootRelative, this.parts, this.separators);\n\n String get basename {\n final copy = clone();\n copy.removeTrailingSeparators();\n if (copy.parts.isEmpty) return root ?? '';\n return copy.parts.last;\n }\n\n String get basenameWithoutExtension => _splitExtension()[0];\n\n bool get hasTrailingSeparator =>\n parts.isNotEmpty && (parts.last == '' || separators.last != '');\n\n void removeTrailingSeparators() {\n while (parts.isNotEmpty && parts.last == '') {\n parts.removeLast();\n separators.removeLast();\n }\n if (separators.isNotEmpty) separators[separators.length - 1] = '';\n }\n\n void normalize({bool canonicalize = false}) {\n // Handle '.', '..', and empty parts.\n var leadingDoubles = 0;\n final newParts = [];\n for (var part in parts) {\n if (part == '.' || part == '') {\n // Do nothing. Ignore it.\n } else if (part == '..') {\n // Pop the last part off.\n if (newParts.isNotEmpty) {\n newParts.removeLast();\n } else {\n // Backed out past the beginning, so preserve the \"..\".\n leadingDoubles++;\n }\n } else {\n newParts.add(canonicalize ? style.canonicalizePart(part) : part);\n }\n }\n\n // A relative path can back out from the start directory.\n if (!isAbsolute) {\n newParts.insertAll(0, List.filled(leadingDoubles, '..'));\n }\n\n // If we collapsed down to nothing, do \".\".\n if (newParts.isEmpty && !isAbsolute) {\n newParts.add('.');\n }\n\n // Canonicalize separators.\n final newSeparators = List.generate(\n newParts.length, (_) => style.separator,\n growable: true);\n newSeparators.insert(\n 0,\n isAbsolute && newParts.isNotEmpty && style.needsSeparator(root)\n ? style.separator\n : '');\n\n parts = newParts;\n separators = newSeparators;\n\n // Normalize the Windows root if needed.\n if (root != null && style == Style.windows) {\n if (canonicalize) root = root.toLowerCase();\n root = root.replaceAll('/', '\\\\');\n }\n removeTrailingSeparators();\n }\n\n @override\n String toString() {\n final builder = StringBuffer();\n if (root != null) builder.write(root);\n for (var i = 0; i < parts.length; i++) {\n builder.write(separators[i]);\n builder.write(parts[i]);\n }\n builder.write(separators.last);\n\n return builder.toString();\n }\n\n /// Returns k-th last index of the `character` in the `path`.\n ///\n /// If `k` exceeds the count of `character`s in `path`, the left most index\n /// of the `character` is returned.\n int _kthLastIndexOf(String path, String character, int k) {\n var count = 0, leftMostIndexedCharacter = 0;\n for (var index = path.length - 1; index >= 0; --index) {\n if (path[index] == character) {\n leftMostIndexedCharacter = index;\n ++count;\n if (count == k) {\n return index;\n }\n }\n }\n return leftMostIndexedCharacter;\n }\n\n /// Splits the last non-empty part of the path into a `[basename, extension]`\n /// pair.\n ///\n /// Takes an optional parameter `level` which makes possible to return\n /// multiple extensions having `level` number of dots. If `level` exceeds the\n /// number of dots, the path is split at the first most dot. The value of\n /// `level` must be greater than 0, else `RangeError` is thrown.\n ///\n /// Returns a two-element list. The first is the name of the file without any\n /// extension. The second is the extension or \"\" if it has none.\n List _splitExtension([int level = 1]) {\n if (level == null) throw ArgumentError.notNull('level');\n if (level <= 0) {\n throw RangeError.value(\n level, 'level', \"level's value must be greater than 0\");\n }\n\n final file = parts.lastWhere((p) => p != '', orElse: () => null);\n\n if (file == null) return ['', ''];\n if (file == '..') return ['..', ''];\n\n final lastDot = _kthLastIndexOf(file, '.', level);\n\n // If there is no dot, or it's the first character, like '.bashrc', it\n // doesn't count.\n if (lastDot <= 0) return [file, ''];\n\n return [file.substring(0, lastDot), file.substring(lastDot)];\n }\n\n ParsedPath clone() => ParsedPath._(\n style, root, isRootRelative, List.from(parts), List.from(separators));\n}\n"},"__index_level_0__":{"kind":"number","value":0,"string":"0"}}},{"rowIdx":146357,"cells":{"repo_id":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/path"},"file_path":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/path/src/path_set.dart"},"content":{"kind":"string","value":"// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file\n// for details. All rights reserved. Use of this source code is governed by a\n// BSD-style license that can be found in the LICENSE file.\n\nimport 'dart:collection';\n\nimport '../path.dart' as p;\n\n/// A set containing paths, compared using [equals] and [hash].\nclass PathSet extends IterableBase implements Set {\n /// The set to which we forward implementation methods.\n final Set _inner;\n\n /// Creates an empty [PathSet] whose contents are compared using\n /// `context.equals` and `context.hash`.\n ///\n /// The [context] defaults to the current path context.\n PathSet({p.Context context}) : _inner = _create(context);\n\n /// Creates a [PathSet] with the same contents as [other] whose elements are\n /// compared using `context.equals` and `context.hash`.\n ///\n /// The [context] defaults to the current path context. If multiple elements\n /// in [other] represent the same logical path, the first value will be\n /// used.\n PathSet.of(Iterable other, {p.Context context})\n : _inner = _create(context)..addAll(other);\n\n /// Creates a set that uses [context] for equality and hashing.\n static Set _create(p.Context context) {\n context ??= p.context;\n return LinkedHashSet(\n equals: (path1, path2) {\n if (path1 == null) return path2 == null;\n if (path2 == null) return false;\n return context.equals(path1, path2);\n },\n hashCode: (path) => path == null ? 0 : context.hash(path),\n isValidKey: (path) => path is String || path == null);\n }\n\n // Normally we'd use DelegatingSetView from the collection package to\n // implement these, but we want to avoid adding dependencies from path because\n // it's so widely used that even brief version skew can be very painful.\n\n @override\n Iterator get iterator => _inner.iterator;\n\n @override\n int get length => _inner.length;\n\n @override\n bool add(String value) => _inner.add(value);\n\n @override\n void addAll(Iterable elements) => _inner.addAll(elements);\n\n @override\n Set cast() => _inner.cast();\n\n @override\n void clear() => _inner.clear();\n\n @override\n bool contains(Object element) => _inner.contains(element);\n\n @override\n bool containsAll(Iterable other) => _inner.containsAll(other);\n\n @override\n Set difference(Set other) => _inner.difference(other);\n\n @override\n Set intersection(Set other) => _inner.intersection(other);\n\n @override\n String lookup(Object element) => _inner.lookup(element);\n\n @override\n bool remove(Object value) => _inner.remove(value);\n\n @override\n void removeAll(Iterable elements) => _inner.removeAll(elements);\n\n @override\n void removeWhere(bool Function(String) test) => _inner.removeWhere(test);\n\n @override\n void retainAll(Iterable elements) => _inner.retainAll(elements);\n\n @override\n void retainWhere(bool Function(String) test) => _inner.retainWhere(test);\n\n @override\n Set union(Set other) => _inner.union(other);\n\n @override\n Set toSet() => _inner.toSet();\n}\n"},"__index_level_0__":{"kind":"number","value":0,"string":"0"}}},{"rowIdx":146358,"cells":{"repo_id":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/path"},"file_path":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/path/src/characters.dart"},"content":{"kind":"string","value":"// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file\n// for details. All rights reserved. Use of this source code is governed by a\n// BSD-style license that can be found in the LICENSE file.\n\n/// This library contains character-code definitions.\nconst plus = 0x2b;\nconst minus = 0x2d;\nconst period = 0x2e;\nconst slash = 0x2f;\nconst zero = 0x30;\nconst nine = 0x39;\nconst colon = 0x3a;\nconst upperA = 0x41;\nconst upperZ = 0x5a;\nconst lowerA = 0x61;\nconst lowerZ = 0x7a;\nconst backslash = 0x5c;\n"},"__index_level_0__":{"kind":"number","value":0,"string":"0"}}},{"rowIdx":146359,"cells":{"repo_id":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/path"},"file_path":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/path/src/path_exception.dart"},"content":{"kind":"string","value":"// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file\n// for details. All rights reserved. Use of this source code is governed by a\n// BSD-style license that can be found in the LICENSE file.\n\n/// An exception class that's thrown when a path operation is unable to be\n/// computed accurately.\nclass PathException implements Exception {\n String message;\n\n PathException(this.message);\n\n @override\n String toString() => 'PathException: $message';\n}\n"},"__index_level_0__":{"kind":"number","value":0,"string":"0"}}},{"rowIdx":146360,"cells":{"repo_id":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/path"},"file_path":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/path/src/path_map.dart"},"content":{"kind":"string","value":"// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file\n// for details. All rights reserved. Use of this source code is governed by a\n// BSD-style license that can be found in the LICENSE file.\n\nimport 'dart:collection';\n\nimport '../path.dart' as p;\n\n/// A map whose keys are paths, compared using [equals] and [hash].\nclass PathMap extends MapView {\n /// Creates an empty [PathMap] whose keys are compared using `context.equals`\n /// and `context.hash`.\n ///\n /// The [context] defaults to the current path context.\n PathMap({p.Context context}) : super(_create(context));\n\n /// Creates a [PathMap] with the same keys and values as [other] whose keys\n /// are compared using `context.equals` and `context.hash`.\n ///\n /// The [context] defaults to the current path context. If multiple keys in\n /// [other] represent the same logical path, the last key's value will be\n /// used.\n PathMap.of(Map other, {p.Context context})\n : super(_create(context)..addAll(other));\n\n /// Creates a map that uses [context] for equality and hashing.\n static Map _create(p.Context context) {\n context ??= p.context;\n return LinkedHashMap(\n equals: (path1, path2) {\n if (path1 == null) return path2 == null;\n if (path2 == null) return false;\n return context.equals(path1, path2);\n },\n hashCode: (path) => path == null ? 0 : context.hash(path),\n isValidKey: (path) => path is String || path == null);\n }\n}\n"},"__index_level_0__":{"kind":"number","value":0,"string":"0"}}},{"rowIdx":146361,"cells":{"repo_id":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/path"},"file_path":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/path/src/internal_style.dart"},"content":{"kind":"string","value":"// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file\n// for details. All rights reserved. Use of this source code is governed by a\n// BSD-style license that can be found in the LICENSE file.\n\nimport 'context.dart';\nimport 'style.dart';\n\n/// The internal interface for the [Style] type.\n///\n/// Users should be able to pass around instances of [Style] like an enum, but\n/// the members that [Context] uses should be hidden from them. Those members\n/// are defined on this class instead.\nabstract class InternalStyle extends Style {\n /// The default path separator for this style.\n ///\n /// On POSIX, this is `/`. On Windows, it's `\\`.\n @override\n String get separator;\n\n /// Returns whether [path] contains a separator.\n bool containsSeparator(String path);\n\n /// Returns whether [codeUnit] is the character code of a separator.\n bool isSeparator(int codeUnit);\n\n /// Returns whether this path component needs a separator after it.\n ///\n /// Windows and POSIX styles just need separators when the previous component\n /// doesn't already end in a separator, but the URL always needs to place a\n /// separator between the root and the first component, even if the root\n /// already ends in a separator character. For example, to join \"file://\" and\n /// \"usr\", an additional \"/\" is needed (making \"file:///usr\").\n bool needsSeparator(String path);\n\n /// Returns the number of characters of the root part.\n ///\n /// Returns 0 if the path is relative and 1 if the path is root-relative.\n ///\n /// If [withDrive] is `true`, this should include the drive letter for `file:`\n /// URLs. Non-URL styles may ignore the parameter.\n int rootLength(String path, {bool withDrive = false});\n\n /// Gets the root prefix of [path] if path is absolute. If [path] is relative,\n /// returns `null`.\n @override\n String getRoot(String path) {\n final length = rootLength(path);\n if (length > 0) return path.substring(0, length);\n return isRootRelative(path) ? path[0] : null;\n }\n\n /// Returns whether [path] is root-relative.\n ///\n /// If [path] is relative or absolute and not root-relative, returns `false`.\n bool isRootRelative(String path);\n\n /// Returns the path represented by [uri] in this style.\n @override\n String pathFromUri(Uri uri);\n\n /// Returns the URI that represents the relative path made of [parts].\n @override\n Uri relativePathToUri(String path) {\n final segments = context.split(path);\n\n // Ensure that a trailing slash in the path produces a trailing slash in the\n // URL.\n if (isSeparator(path.codeUnitAt(path.length - 1))) segments.add('');\n return Uri(pathSegments: segments);\n }\n\n /// Returns the URI that represents [path], which is assumed to be absolute.\n @override\n Uri absolutePathToUri(String path);\n\n /// Returns whether [codeUnit1] and [codeUnit2] are considered equivalent for\n /// this style.\n bool codeUnitsEqual(int codeUnit1, int codeUnit2) => codeUnit1 == codeUnit2;\n\n /// Returns whether [path1] and [path2] are equivalent.\n ///\n /// This only needs to handle character-by-character comparison; it can assume\n /// the paths are normalized and contain no `..` components.\n bool pathsEqual(String path1, String path2) => path1 == path2;\n\n int canonicalizeCodeUnit(int codeUnit) => codeUnit;\n\n String canonicalizePart(String part) => part;\n}\n"},"__index_level_0__":{"kind":"number","value":0,"string":"0"}}},{"rowIdx":146362,"cells":{"repo_id":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/path"},"file_path":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/path/src/utils.dart"},"content":{"kind":"string","value":"// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file\n// for details. All rights reserved. Use of this source code is governed by a\n// BSD-style license that can be found in the LICENSE file.\n\nimport 'characters.dart' as chars;\n\n/// Returns whether [char] is the code for an ASCII letter (uppercase or\n/// lowercase).\nbool isAlphabetic(int char) =>\n (char >= chars.upperA && char <= chars.upperZ) ||\n (char >= chars.lowerA && char <= chars.lowerZ);\n\n/// Returns whether [char] is the code for an ASCII digit.\nbool isNumeric(int char) => char >= chars.zero && char <= chars.nine;\n\n/// Returns whether [path] has a URL-formatted Windows drive letter beginning at\n/// [index].\nbool isDriveLetter(String path, int index) {\n if (path.length < index + 2) return false;\n if (!isAlphabetic(path.codeUnitAt(index))) return false;\n if (path.codeUnitAt(index + 1) != chars.colon) return false;\n if (path.length == index + 2) return true;\n return path.codeUnitAt(index + 2) == chars.slash;\n}\n"},"__index_level_0__":{"kind":"number","value":0,"string":"0"}}},{"rowIdx":146363,"cells":{"repo_id":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/path"},"file_path":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/path/src/context.dart"},"content":{"kind":"string","value":"// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file\n// for details. All rights reserved. Use of this source code is governed by a\n// BSD-style license that can be found in the LICENSE file.\n\nimport 'dart:math' as math;\n\nimport '../path.dart' as p;\nimport 'characters.dart' as chars;\nimport 'internal_style.dart';\nimport 'parsed_path.dart';\nimport 'path_exception.dart';\nimport 'style.dart';\n\nContext createInternal() => Context._internal();\n\n/// An instantiable class for manipulating paths. Unlike the top-level\n/// functions, this lets you explicitly select what platform the paths will use.\nclass Context {\n /// Creates a new path context for the given style and current directory.\n ///\n /// If [style] is omitted, it uses the host operating system's path style. If\n /// only [current] is omitted, it defaults \".\". If *both* [style] and\n /// [current] are omitted, [current] defaults to the real current working\n /// directory.\n ///\n /// On the browser, [style] defaults to [Style.url] and [current] defaults to\n /// the current URL.\n factory Context({Style style, String current}) {\n if (current == null) {\n if (style == null) {\n current = p.current;\n } else {\n current = '.';\n }\n }\n\n if (style == null) {\n style = Style.platform;\n } else if (style is! InternalStyle) {\n throw ArgumentError('Only styles defined by the path package are '\n 'allowed.');\n }\n\n return Context._(style as InternalStyle, current);\n }\n\n /// Create a [Context] to be used internally within path.\n Context._internal()\n : style = Style.platform as InternalStyle,\n _current = null;\n\n Context._(this.style, this._current);\n\n /// The style of path that this context works with.\n final InternalStyle style;\n\n /// The current directory given when Context was created. If null, current\n /// directory is evaluated from 'p.current'.\n final String _current;\n\n /// The current directory that relative paths are relative to.\n String get current => _current ?? p.current;\n\n /// Gets the path separator for the context's [style]. On Mac and Linux,\n /// this is `/`. On Windows, it's `\\`.\n String get separator => style.separator;\n\n /// Creates a new path by appending the given path parts to [current].\n /// Equivalent to [join()] with [current] as the first argument. Example:\n ///\n /// var context = Context(current: '/root');\n /// context.absolute('path', 'to', 'foo'); // -> '/root/path/to/foo'\n ///\n /// If [current] isn't absolute, this won't return an absolute path.\n String absolute(String part1,\n [String part2,\n String part3,\n String part4,\n String part5,\n String part6,\n String part7]) {\n _validateArgList(\n 'absolute', [part1, part2, part3, part4, part5, part6, part7]);\n\n // If there's a single absolute path, just return it. This is a lot faster\n // for the common case of `p.absolute(path)`.\n if (part2 == null && isAbsolute(part1) && !isRootRelative(part1)) {\n return part1;\n }\n\n return join(current, part1, part2, part3, part4, part5, part6, part7);\n }\n\n /// Gets the part of [path] after the last separator on the context's\n /// platform.\n ///\n /// context.basename('path/to/foo.dart'); // -> 'foo.dart'\n /// context.basename('path/to'); // -> 'to'\n ///\n /// Trailing separators are ignored.\n ///\n /// context.basename('path/to/'); // -> 'to'\n String basename(String path) => _parse(path).basename;\n\n /// Gets the part of [path] after the last separator on the context's\n /// platform, and without any trailing file extension.\n ///\n /// context.basenameWithoutExtension('path/to/foo.dart'); // -> 'foo'\n ///\n /// Trailing separators are ignored.\n ///\n /// context.basenameWithoutExtension('path/to/foo.dart/'); // -> 'foo'\n String basenameWithoutExtension(String path) =>\n _parse(path).basenameWithoutExtension;\n\n /// Gets the part of [path] before the last separator.\n ///\n /// context.dirname('path/to/foo.dart'); // -> 'path/to'\n /// context.dirname('path/to'); // -> 'path'\n ///\n /// Trailing separators are ignored.\n ///\n /// context.dirname('path/to/'); // -> 'path'\n String dirname(String path) {\n final parsed = _parse(path);\n parsed.removeTrailingSeparators();\n if (parsed.parts.isEmpty) return parsed.root ?? '.';\n if (parsed.parts.length == 1) return parsed.root ?? '.';\n parsed.parts.removeLast();\n parsed.separators.removeLast();\n parsed.removeTrailingSeparators();\n return parsed.toString();\n }\n\n /// Gets the file extension of [path]: the portion of [basename] from the last\n /// `.` to the end (including the `.` itself).\n ///\n /// context.extension('path/to/foo.dart'); // -> '.dart'\n /// context.extension('path/to/foo'); // -> ''\n /// context.extension('path.to/foo'); // -> ''\n /// context.extension('path/to/foo.dart.js'); // -> '.js'\n ///\n /// If the file name starts with a `.`, then it is not considered an\n /// extension:\n ///\n /// context.extension('~/.bashrc'); // -> ''\n /// context.extension('~/.notes.txt'); // -> '.txt'\n ///\n /// Takes an optional parameter `level` which makes possible to return\n /// multiple extensions having `level` number of dots. If `level` exceeds the\n /// number of dots, the full extension is returned. The value of `level` must\n /// be greater than 0, else `RangeError` is thrown.\n ///\n /// context.extension('foo.bar.dart.js', 2); // -> '.dart.js\n /// context.extension('foo.bar.dart.js', 3); // -> '.bar.dart.js'\n /// context.extension('foo.bar.dart.js', 10); // -> '.bar.dart.js'\n /// context.extension('path/to/foo.bar.dart.js', 2); // -> '.dart.js'\n String extension(String path, [int level = 1]) =>\n _parse(path).extension(level);\n\n /// Returns the root of [path] if it's absolute, or an empty string if it's\n /// relative.\n ///\n /// // Unix\n /// context.rootPrefix('path/to/foo'); // -> ''\n /// context.rootPrefix('/path/to/foo'); // -> '/'\n ///\n /// // Windows\n /// context.rootPrefix(r'path\\to\\foo'); // -> ''\n /// context.rootPrefix(r'C:\\path\\to\\foo'); // -> r'C:\\'\n /// context.rootPrefix(r'\\\\server\\share\\a\\b'); // -> r'\\\\server\\share'\n ///\n /// // URL\n /// context.rootPrefix('path/to/foo'); // -> ''\n /// context.rootPrefix('https://dart.dev/path/to/foo');\n /// // -> 'https://dart.dev'\n String rootPrefix(String path) => path.substring(0, style.rootLength(path));\n\n /// Returns `true` if [path] is an absolute path and `false` if it is a\n /// relative path.\n ///\n /// On POSIX systems, absolute paths start with a `/` (forward slash). On\n /// Windows, an absolute path starts with `\\\\`, or a drive letter followed by\n /// `:/` or `:\\`. For URLs, absolute paths either start with a protocol and\n /// optional hostname (e.g. `https://dart.dev`, `file://`) or with a `/`.\n ///\n /// URLs that start with `/` are known as \"root-relative\", since they're\n /// relative to the root of the current URL. Since root-relative paths are\n /// still absolute in every other sense, [isAbsolute] will return true for\n /// them. They can be detected using [isRootRelative].\n bool isAbsolute(String path) => style.rootLength(path) > 0;\n\n /// Returns `true` if [path] is a relative path and `false` if it is absolute.\n /// On POSIX systems, absolute paths start with a `/` (forward slash). On\n /// Windows, an absolute path starts with `\\\\`, or a drive letter followed by\n /// `:/` or `:\\`.\n bool isRelative(String path) => !isAbsolute(path);\n\n /// Returns `true` if [path] is a root-relative path and `false` if it's not.\n ///\n /// URLs that start with `/` are known as \"root-relative\", since they're\n /// relative to the root of the current URL. Since root-relative paths are\n /// still absolute in every other sense, [isAbsolute] will return true for\n /// them. They can be detected using [isRootRelative].\n ///\n /// No POSIX and Windows paths are root-relative.\n bool isRootRelative(String path) => style.isRootRelative(path);\n\n /// Joins the given path parts into a single path. Example:\n ///\n /// context.join('path', 'to', 'foo'); // -> 'path/to/foo'\n ///\n /// If any part ends in a path separator, then a redundant separator will not\n /// be added:\n ///\n /// context.join('path/', 'to', 'foo'); // -> 'path/to/foo\n ///\n /// If a part is an absolute path, then anything before that will be ignored:\n ///\n /// context.join('path', '/to', 'foo'); // -> '/to/foo'\n ///\n String join(String part1,\n [String part2,\n String part3,\n String part4,\n String part5,\n String part6,\n String part7,\n String part8]) {\n final parts = [\n part1,\n part2,\n part3,\n part4,\n part5,\n part6,\n part7,\n part8\n ];\n _validateArgList('join', parts);\n return joinAll(parts.where((part) => part != null));\n }\n\n /// Joins the given path parts into a single path. Example:\n ///\n /// context.joinAll(['path', 'to', 'foo']); // -> 'path/to/foo'\n ///\n /// If any part ends in a path separator, then a redundant separator will not\n /// be added:\n ///\n /// context.joinAll(['path/', 'to', 'foo']); // -> 'path/to/foo\n ///\n /// If a part is an absolute path, then anything before that will be ignored:\n ///\n /// context.joinAll(['path', '/to', 'foo']); // -> '/to/foo'\n ///\n /// For a fixed number of parts, [join] is usually terser.\n String joinAll(Iterable parts) {\n final buffer = StringBuffer();\n var needsSeparator = false;\n var isAbsoluteAndNotRootRelative = false;\n\n for (var part in parts.where((part) => part != '')) {\n if (isRootRelative(part) && isAbsoluteAndNotRootRelative) {\n // If the new part is root-relative, it preserves the previous root but\n // replaces the path after it.\n final parsed = _parse(part);\n final path = buffer.toString();\n parsed.root =\n path.substring(0, style.rootLength(path, withDrive: true));\n if (style.needsSeparator(parsed.root)) {\n parsed.separators[0] = style.separator;\n }\n buffer.clear();\n buffer.write(parsed.toString());\n } else if (isAbsolute(part)) {\n isAbsoluteAndNotRootRelative = !isRootRelative(part);\n // An absolute path discards everything before it.\n buffer.clear();\n buffer.write(part);\n } else {\n if (part.isNotEmpty && style.containsSeparator(part[0])) {\n // The part starts with a separator, so we don't need to add one.\n } else if (needsSeparator) {\n buffer.write(separator);\n }\n\n buffer.write(part);\n }\n\n // Unless this part ends with a separator, we'll need to add one before\n // the next part.\n needsSeparator = style.needsSeparator(part);\n }\n\n return buffer.toString();\n }\n\n /// Splits [path] into its components using the current platform's\n /// [separator]. Example:\n ///\n /// context.split('path/to/foo'); // -> ['path', 'to', 'foo']\n ///\n /// The path will *not* be normalized before splitting.\n ///\n /// context.split('path/../foo'); // -> ['path', '..', 'foo']\n ///\n /// If [path] is absolute, the root directory will be the first element in the\n /// array. Example:\n ///\n /// // Unix\n /// context.split('/path/to/foo'); // -> ['/', 'path', 'to', 'foo']\n ///\n /// // Windows\n /// context.split(r'C:\\path\\to\\foo'); // -> [r'C:\\', 'path', 'to', 'foo']\n /// context.split(r'\\\\server\\share\\path\\to\\foo');\n /// // -> [r'\\\\server\\share', 'foo', 'bar', 'baz']\n ///\n /// // Browser\n /// context.split('https://dart.dev/path/to/foo');\n /// // -> ['https://dart.dev', 'path', 'to', 'foo']\n List split(String path) {\n final parsed = _parse(path);\n // Filter out empty parts that exist due to multiple separators in a row.\n parsed.parts = parsed.parts.where((part) => part.isNotEmpty).toList();\n if (parsed.root != null) parsed.parts.insert(0, parsed.root);\n return parsed.parts;\n }\n\n /// Canonicalizes [path].\n ///\n /// This is guaranteed to return the same path for two different input paths\n /// if and only if both input paths point to the same location. Unlike\n /// [normalize], it returns absolute paths when possible and canonicalizes\n /// ASCII case on Windows.\n ///\n /// Note that this does not resolve symlinks.\n ///\n /// If you want a map that uses path keys, it's probably more efficient to\n /// pass [equals] and [hash] to [new HashMap] than it is to canonicalize every\n /// key.\n String canonicalize(String path) {\n path = absolute(path);\n if (style != Style.windows && !_needsNormalization(path)) return path;\n\n final parsed = _parse(path);\n parsed.normalize(canonicalize: true);\n return parsed.toString();\n }\n\n /// Normalizes [path], simplifying it by handling `..`, and `.`, and\n /// removing redundant path separators whenever possible.\n ///\n /// Note that this is *not* guaranteed to return the same result for two\n /// equivalent input paths. For that, see [canonicalize]. Or, if you're using\n /// paths as map keys, pass [equals] and [hash] to [new HashMap].\n ///\n /// context.normalize('path/./to/..//file.text'); // -> 'path/file.txt'\n String normalize(String path) {\n if (!_needsNormalization(path)) return path;\n\n final parsed = _parse(path);\n parsed.normalize();\n return parsed.toString();\n }\n\n /// Returns whether [path] needs to be normalized.\n bool _needsNormalization(String path) {\n var start = 0;\n final codeUnits = path.codeUnits;\n int previousPrevious;\n int previous;\n\n // Skip past the root before we start looking for snippets that need\n // normalization. We want to normalize \"//\", but not when it's part of\n // \"http://\".\n final root = style.rootLength(path);\n if (root != 0) {\n start = root;\n previous = chars.slash;\n\n // On Windows, the root still needs to be normalized if it contains a\n // forward slash.\n if (style == Style.windows) {\n for (var i = 0; i < root; i++) {\n if (codeUnits[i] == chars.slash) return true;\n }\n }\n }\n\n for (var i = start; i < codeUnits.length; i++) {\n final codeUnit = codeUnits[i];\n if (style.isSeparator(codeUnit)) {\n // Forward slashes in Windows paths are normalized to backslashes.\n if (style == Style.windows && codeUnit == chars.slash) return true;\n\n // Multiple separators are normalized to single separators.\n if (previous != null && style.isSeparator(previous)) return true;\n\n // Single dots and double dots are normalized to directory traversals.\n //\n // This can return false positives for \".../\", but that's unlikely\n // enough that it's probably not going to cause performance issues.\n if (previous == chars.period &&\n (previousPrevious == null ||\n previousPrevious == chars.period ||\n style.isSeparator(previousPrevious))) {\n return true;\n }\n }\n\n previousPrevious = previous;\n previous = codeUnit;\n }\n\n // Empty paths are normalized to \".\".\n if (previous == null) return true;\n\n // Trailing separators are removed.\n if (style.isSeparator(previous)) return true;\n\n // Single dots and double dots are normalized to directory traversals.\n if (previous == chars.period &&\n (previousPrevious == null ||\n style.isSeparator(previousPrevious) ||\n previousPrevious == chars.period)) {\n return true;\n }\n\n return false;\n }\n\n /// Attempts to convert [path] to an equivalent relative path relative to\n /// [current].\n ///\n /// var context = Context(current: '/root/path');\n /// context.relative('/root/path/a/b.dart'); // -> 'a/b.dart'\n /// context.relative('/root/other.dart'); // -> '../other.dart'\n ///\n /// If the [from] argument is passed, [path] is made relative to that instead.\n ///\n /// context.relative('/root/path/a/b.dart',\n /// from: '/root/path'); // -> 'a/b.dart'\n /// context.relative('/root/other.dart',\n /// from: '/root/path'); // -> '../other.dart'\n ///\n /// If [path] and/or [from] are relative paths, they are assumed to be\n /// relative to [current].\n ///\n /// Since there is no relative path from one drive letter to another on\n /// Windows, this will return an absolute path in that case.\n ///\n /// context.relative(r'D:\\other', from: r'C:\\other'); // -> 'D:\\other'\n ///\n /// This will also return an absolute path if an absolute [path] is passed to\n /// a context with a relative path for [current].\n ///\n /// var context = Context(r'some/relative/path');\n /// context.relative(r'/absolute/path'); // -> '/absolute/path'\n ///\n /// If [current] is relative, it may be impossible to determine a path from\n /// [from] to [path]. For example, if [current] and [path] are \".\" and [from]\n /// is \"/\", no path can be determined. In this case, a [PathException] will be\n /// thrown.\n String relative(String path, {String from}) {\n // Avoid expensive computation if the path is already relative.\n if (from == null && isRelative(path)) return normalize(path);\n\n from = from == null ? current : absolute(from);\n\n // We can't determine the path from a relative path to an absolute path.\n if (isRelative(from) && isAbsolute(path)) {\n return normalize(path);\n }\n\n // If the given path is relative, resolve it relative to the context's\n // current directory.\n if (isRelative(path) || isRootRelative(path)) {\n path = absolute(path);\n }\n\n // If the path is still relative and `from` is absolute, we're unable to\n // find a path from `from` to `path`.\n if (isRelative(path) && isAbsolute(from)) {\n throw PathException('Unable to find a path to \"$path\" from \"$from\".');\n }\n\n final fromParsed = _parse(from)..normalize();\n final pathParsed = _parse(path)..normalize();\n\n if (fromParsed.parts.isNotEmpty && fromParsed.parts[0] == '.') {\n return pathParsed.toString();\n }\n\n // If the root prefixes don't match (for example, different drive letters\n // on Windows), then there is no relative path, so just return the absolute\n // one. In Windows, drive letters are case-insenstive and we allow\n // calculation of relative paths, even if a path has not been normalized.\n if (fromParsed.root != pathParsed.root &&\n ((fromParsed.root == null || pathParsed.root == null) ||\n !style.pathsEqual(fromParsed.root, pathParsed.root))) {\n return pathParsed.toString();\n }\n\n // Strip off their common prefix.\n while (fromParsed.parts.isNotEmpty &&\n pathParsed.parts.isNotEmpty &&\n style.pathsEqual(fromParsed.parts[0], pathParsed.parts[0])) {\n fromParsed.parts.removeAt(0);\n fromParsed.separators.removeAt(1);\n pathParsed.parts.removeAt(0);\n pathParsed.separators.removeAt(1);\n }\n\n // If there are any directories left in the from path, we need to walk up\n // out of them. If a directory left in the from path is '..', it cannot\n // be cancelled by adding a '..'.\n if (fromParsed.parts.isNotEmpty && fromParsed.parts[0] == '..') {\n throw PathException('Unable to find a path to \"$path\" from \"$from\".');\n }\n pathParsed.parts.insertAll(0, List.filled(fromParsed.parts.length, '..'));\n pathParsed.separators[0] = '';\n pathParsed.separators\n .insertAll(1, List.filled(fromParsed.parts.length, style.separator));\n\n // Corner case: the paths completely collapsed.\n if (pathParsed.parts.isEmpty) return '.';\n\n // Corner case: path was '.' and some '..' directories were added in front.\n // Don't add a final '/.' in that case.\n if (pathParsed.parts.length > 1 && pathParsed.parts.last == '.') {\n pathParsed.parts.removeLast();\n pathParsed.separators\n ..removeLast()\n ..removeLast()\n ..add('');\n }\n\n // Make it relative.\n pathParsed.root = '';\n pathParsed.removeTrailingSeparators();\n\n return pathParsed.toString();\n }\n\n /// Returns `true` if [child] is a path beneath `parent`, and `false`\n /// otherwise.\n ///\n /// path.isWithin('/root/path', '/root/path/a'); // -> true\n /// path.isWithin('/root/path', '/root/other'); // -> false\n /// path.isWithin('/root/path', '/root/path'); // -> false\n bool isWithin(String parent, String child) =>\n _isWithinOrEquals(parent, child) == _PathRelation.within;\n\n /// Returns `true` if [path1] points to the same location as [path2], and\n /// `false` otherwise.\n ///\n /// The [hash] function returns a hash code that matches these equality\n /// semantics.\n bool equals(String path1, String path2) =>\n _isWithinOrEquals(path1, path2) == _PathRelation.equal;\n\n /// Compares two paths and returns an enum value indicating their relationship\n /// to one another.\n ///\n /// This never returns [_PathRelation.inconclusive].\n _PathRelation _isWithinOrEquals(String parent, String child) {\n // Make both paths the same level of relative. We're only able to do the\n // quick comparison if both paths are in the same format, and making a path\n // absolute is faster than making it relative.\n final parentIsAbsolute = isAbsolute(parent);\n final childIsAbsolute = isAbsolute(child);\n if (parentIsAbsolute && !childIsAbsolute) {\n child = absolute(child);\n if (style.isRootRelative(parent)) parent = absolute(parent);\n } else if (childIsAbsolute && !parentIsAbsolute) {\n parent = absolute(parent);\n if (style.isRootRelative(child)) child = absolute(child);\n } else if (childIsAbsolute && parentIsAbsolute) {\n final childIsRootRelative = style.isRootRelative(child);\n final parentIsRootRelative = style.isRootRelative(parent);\n\n if (childIsRootRelative && !parentIsRootRelative) {\n child = absolute(child);\n } else if (parentIsRootRelative && !childIsRootRelative) {\n parent = absolute(parent);\n }\n }\n\n final result = _isWithinOrEqualsFast(parent, child);\n if (result != _PathRelation.inconclusive) return result;\n\n String relative;\n try {\n relative = this.relative(child, from: parent);\n } on PathException catch (_) {\n // If no relative path from [parent] to [child] is found, [child]\n // definitely isn't a child of [parent].\n return _PathRelation.different;\n }\n\n if (!isRelative(relative)) return _PathRelation.different;\n if (relative == '.') return _PathRelation.equal;\n if (relative == '..') return _PathRelation.different;\n return (relative.length >= 3 &&\n relative.startsWith('..') &&\n style.isSeparator(relative.codeUnitAt(2)))\n ? _PathRelation.different\n : _PathRelation.within;\n }\n\n /// An optimized implementation of [_isWithinOrEquals] that doesn't handle a\n /// few complex cases.\n _PathRelation _isWithinOrEqualsFast(String parent, String child) {\n // Normally we just bail when we see \".\" path components, but we can handle\n // a single dot easily enough.\n if (parent == '.') parent = '';\n\n final parentRootLength = style.rootLength(parent);\n final childRootLength = style.rootLength(child);\n\n // If the roots aren't the same length, we know both paths are absolute or\n // both are root-relative, and thus that the roots are meaningfully\n // different.\n //\n // isWithin(\"C:/bar\", \"//foo/bar/baz\") //=> false\n // isWithin(\"http://example.com/\", \"http://google.com/bar\") //=> false\n if (parentRootLength != childRootLength) return _PathRelation.different;\n\n // Make sure that the roots are textually the same as well.\n //\n // isWithin(\"C:/bar\", \"D:/bar/baz\") //=> false\n // isWithin(\"http://example.com/\", \"http://example.org/bar\") //=> false\n for (var i = 0; i < parentRootLength; i++) {\n final parentCodeUnit = parent.codeUnitAt(i);\n final childCodeUnit = child.codeUnitAt(i);\n if (!style.codeUnitsEqual(parentCodeUnit, childCodeUnit)) {\n return _PathRelation.different;\n }\n }\n\n // Start by considering the last code unit as a separator, since\n // semantically we're starting at a new path component even if we're\n // comparing relative paths.\n var lastCodeUnit = chars.slash;\n\n /// The index of the last separator in [parent].\n int lastParentSeparator;\n\n // Iterate through both paths as long as they're semantically identical.\n var parentIndex = parentRootLength;\n var childIndex = childRootLength;\n while (parentIndex < parent.length && childIndex < child.length) {\n var parentCodeUnit = parent.codeUnitAt(parentIndex);\n var childCodeUnit = child.codeUnitAt(childIndex);\n if (style.codeUnitsEqual(parentCodeUnit, childCodeUnit)) {\n if (style.isSeparator(parentCodeUnit)) {\n lastParentSeparator = parentIndex;\n }\n\n lastCodeUnit = parentCodeUnit;\n parentIndex++;\n childIndex++;\n continue;\n }\n\n // Ignore multiple separators in a row.\n if (style.isSeparator(parentCodeUnit) &&\n style.isSeparator(lastCodeUnit)) {\n lastParentSeparator = parentIndex;\n parentIndex++;\n continue;\n } else if (style.isSeparator(childCodeUnit) &&\n style.isSeparator(lastCodeUnit)) {\n childIndex++;\n continue;\n }\n\n // If a dot comes after a separator, it may be a directory traversal\n // operator. To check that, we need to know if it's followed by either\n // \"/\" or \"./\". Otherwise, it's just a normal non-matching character.\n //\n // isWithin(\"foo/./bar\", \"foo/bar/baz\") //=> true\n // isWithin(\"foo/bar/../baz\", \"foo/bar/.foo\") //=> false\n if (parentCodeUnit == chars.period && style.isSeparator(lastCodeUnit)) {\n parentIndex++;\n\n // We've hit \"/.\" at the end of the parent path, which we can ignore,\n // since the paths were equivalent up to this point.\n if (parentIndex == parent.length) break;\n parentCodeUnit = parent.codeUnitAt(parentIndex);\n\n // We've hit \"/./\", which we can ignore.\n if (style.isSeparator(parentCodeUnit)) {\n lastParentSeparator = parentIndex;\n parentIndex++;\n continue;\n }\n\n // We've hit \"/..\", which may be a directory traversal operator that\n // we can't handle on the fast track.\n if (parentCodeUnit == chars.period) {\n parentIndex++;\n if (parentIndex == parent.length ||\n style.isSeparator(parent.codeUnitAt(parentIndex))) {\n return _PathRelation.inconclusive;\n }\n }\n\n // If this isn't a directory traversal, fall through so we hit the\n // normal handling for mismatched paths.\n }\n\n // This is the same logic as above, but for the child path instead of the\n // parent.\n if (childCodeUnit == chars.period && style.isSeparator(lastCodeUnit)) {\n childIndex++;\n if (childIndex == child.length) break;\n childCodeUnit = child.codeUnitAt(childIndex);\n\n if (style.isSeparator(childCodeUnit)) {\n childIndex++;\n continue;\n }\n\n if (childCodeUnit == chars.period) {\n childIndex++;\n if (childIndex == child.length ||\n style.isSeparator(child.codeUnitAt(childIndex))) {\n return _PathRelation.inconclusive;\n }\n }\n }\n\n // If we're here, we've hit two non-matching, non-significant characters.\n // As long as the remainders of the two paths don't have any unresolved\n // \"..\" components, we can be confident that [child] is not within\n // [parent].\n final childDirection = _pathDirection(child, childIndex);\n if (childDirection != _PathDirection.belowRoot) {\n return _PathRelation.inconclusive;\n }\n\n final parentDirection = _pathDirection(parent, parentIndex);\n if (parentDirection != _PathDirection.belowRoot) {\n return _PathRelation.inconclusive;\n }\n\n return _PathRelation.different;\n }\n\n // If the child is shorter than the parent, it's probably not within the\n // parent. The only exception is if the parent has some weird \"..\" stuff\n // going on, in which case we do the slow check.\n //\n // isWithin(\"foo/bar/baz\", \"foo/bar\") //=> false\n // isWithin(\"foo/bar/baz/../..\", \"foo/bar\") //=> true\n if (childIndex == child.length) {\n if (parentIndex == parent.length ||\n style.isSeparator(parent.codeUnitAt(parentIndex))) {\n lastParentSeparator = parentIndex;\n } else {\n lastParentSeparator ??= math.max(0, parentRootLength - 1);\n }\n\n final direction =\n _pathDirection(parent, lastParentSeparator ?? parentRootLength - 1);\n if (direction == _PathDirection.atRoot) return _PathRelation.equal;\n return direction == _PathDirection.aboveRoot\n ? _PathRelation.inconclusive\n : _PathRelation.different;\n }\n\n // We've reached the end of the parent path, which means it's time to make a\n // decision. Before we do, though, we'll check the rest of the child to see\n // what that tells us.\n final direction = _pathDirection(child, childIndex);\n\n // If there are no more components in the child, then it's the same as\n // the parent.\n //\n // isWithin(\"foo/bar\", \"foo/bar\") //=> false\n // isWithin(\"foo/bar\", \"foo/bar//\") //=> false\n // equals(\"foo/bar\", \"foo/bar\") //=> true\n // equals(\"foo/bar\", \"foo/bar//\") //=> true\n if (direction == _PathDirection.atRoot) return _PathRelation.equal;\n\n // If there are unresolved \"..\" components in the child, no decision we make\n // will be valid. We'll abort and do the slow check instead.\n //\n // isWithin(\"foo/bar\", \"foo/bar/..\") //=> false\n // isWithin(\"foo/bar\", \"foo/bar/baz/bang/../../..\") //=> false\n // isWithin(\"foo/bar\", \"foo/bar/baz/bang/../../../bar/baz\") //=> true\n if (direction == _PathDirection.aboveRoot) {\n return _PathRelation.inconclusive;\n }\n\n // The child is within the parent if and only if we're on a separator\n // boundary.\n //\n // isWithin(\"foo/bar\", \"foo/bar/baz\") //=> true\n // isWithin(\"foo/bar/\", \"foo/bar/baz\") //=> true\n // isWithin(\"foo/bar\", \"foo/barbaz\") //=> false\n return (style.isSeparator(child.codeUnitAt(childIndex)) ||\n style.isSeparator(lastCodeUnit))\n ? _PathRelation.within\n : _PathRelation.different;\n }\n\n // Returns a [_PathDirection] describing the path represented by [codeUnits]\n // starting at [index].\n //\n // This ignores leading separators.\n //\n // pathDirection(\"foo\") //=> below root\n // pathDirection(\"foo/bar/../baz\") //=> below root\n // pathDirection(\"//foo/bar/baz\") //=> below root\n // pathDirection(\"/\") //=> at root\n // pathDirection(\"foo/..\") //=> at root\n // pathDirection(\"foo/../baz\") //=> reaches root\n // pathDirection(\"foo/../..\") //=> above root\n // pathDirection(\"foo/../../foo/bar/baz\") //=> above root\n _PathDirection _pathDirection(String path, int index) {\n var depth = 0;\n var reachedRoot = false;\n var i = index;\n while (i < path.length) {\n // Ignore initial separators or doubled separators.\n while (i < path.length && style.isSeparator(path.codeUnitAt(i))) {\n i++;\n }\n\n // If we're at the end, stop.\n if (i == path.length) break;\n\n // Move through the path component to the next separator.\n final start = i;\n while (i < path.length && !style.isSeparator(path.codeUnitAt(i))) {\n i++;\n }\n\n // See if the path component is \".\", \"..\", or a name.\n if (i - start == 1 && path.codeUnitAt(start) == chars.period) {\n // Don't change the depth.\n } else if (i - start == 2 &&\n path.codeUnitAt(start) == chars.period &&\n path.codeUnitAt(start + 1) == chars.period) {\n // \"..\" backs out a directory.\n depth--;\n\n // If we work back beyond the root, stop.\n if (depth < 0) break;\n\n // Record that we reached the root so we don't return\n // [_PathDirection.belowRoot].\n if (depth == 0) reachedRoot = true;\n } else {\n // Step inside a directory.\n depth++;\n }\n\n // If we're at the end, stop.\n if (i == path.length) break;\n\n // Move past the separator.\n i++;\n }\n\n if (depth < 0) return _PathDirection.aboveRoot;\n if (depth == 0) return _PathDirection.atRoot;\n if (reachedRoot) return _PathDirection.reachesRoot;\n return _PathDirection.belowRoot;\n }\n\n /// Returns a hash code for [path] that matches the semantics of [equals].\n ///\n /// Note that the same path may have different hash codes in different\n /// [Context]s.\n int hash(String path) {\n // Make [path] absolute to ensure that equivalent relative and absolute\n // paths have the same hash code.\n path = absolute(path);\n\n final result = _hashFast(path);\n if (result != null) return result;\n\n final parsed = _parse(path);\n parsed.normalize();\n return _hashFast(parsed.toString());\n }\n\n /// An optimized implementation of [hash] that doesn't handle internal `..`\n /// components.\n ///\n /// This will handle `..` components that appear at the beginning of the path.\n int _hashFast(String path) {\n var hash = 4603;\n var beginning = true;\n var wasSeparator = true;\n for (var i = 0; i < path.length; i++) {\n final codeUnit = style.canonicalizeCodeUnit(path.codeUnitAt(i));\n\n // Take advantage of the fact that collisions are allowed to ignore\n // separators entirely. This lets us avoid worrying about cases like\n // multiple trailing slashes.\n if (style.isSeparator(codeUnit)) {\n wasSeparator = true;\n continue;\n }\n\n if (codeUnit == chars.period && wasSeparator) {\n // If a dot comes after a separator, it may be a directory traversal\n // operator. To check that, we need to know if it's followed by either\n // \"/\" or \"./\". Otherwise, it's just a normal character.\n //\n // hash(\"foo/./bar\") == hash(\"foo/bar\")\n\n // We've hit \"/.\" at the end of the path, which we can ignore.\n if (i + 1 == path.length) break;\n\n final next = path.codeUnitAt(i + 1);\n\n // We can just ignore \"/./\", since they don't affect the semantics of\n // the path.\n if (style.isSeparator(next)) continue;\n\n // If the path ends with \"/..\" or contains \"/../\", we need to\n // canonicalize it before we can hash it. We make an exception for \"..\"s\n // at the beginning of the path, since those may appear even in a\n // canonicalized path.\n if (!beginning &&\n next == chars.period &&\n (i + 2 == path.length ||\n style.isSeparator(path.codeUnitAt(i + 2)))) {\n return null;\n }\n }\n\n // Make sure [hash] stays under 32 bits even after multiplication.\n hash &= 0x3FFFFFF;\n hash *= 33;\n hash ^= codeUnit;\n wasSeparator = false;\n beginning = false;\n }\n return hash;\n }\n\n /// Removes a trailing extension from the last part of [path].\n ///\n /// context.withoutExtension('path/to/foo.dart'); // -> 'path/to/foo'\n String withoutExtension(String path) {\n final parsed = _parse(path);\n\n for (var i = parsed.parts.length - 1; i >= 0; i--) {\n if (parsed.parts[i].isNotEmpty) {\n parsed.parts[i] = parsed.basenameWithoutExtension;\n break;\n }\n }\n\n return parsed.toString();\n }\n\n /// Returns [path] with the trailing extension set to [extension].\n ///\n /// If [path] doesn't have a trailing extension, this just adds [extension] to\n /// the end.\n ///\n /// context.setExtension('path/to/foo.dart', '.js')\n /// // -> 'path/to/foo.js'\n /// context.setExtension('path/to/foo.dart.js', '.map')\n /// // -> 'path/to/foo.dart.map'\n /// context.setExtension('path/to/foo', '.js')\n /// // -> 'path/to/foo.js'\n String setExtension(String path, String extension) =>\n withoutExtension(path) + extension;\n\n /// Returns the path represented by [uri], which may be a [String] or a [Uri].\n ///\n /// For POSIX and Windows styles, [uri] must be a `file:` URI. For the URL\n /// style, this will just convert [uri] to a string.\n ///\n /// // POSIX\n /// context.fromUri('file:///path/to/foo')\n /// // -> '/path/to/foo'\n ///\n /// // Windows\n /// context.fromUri('file:///C:/path/to/foo')\n /// // -> r'C:\\path\\to\\foo'\n ///\n /// // URL\n /// context.fromUri('https://dart.dev/path/to/foo')\n /// // -> 'https://dart.dev/path/to/foo'\n ///\n /// If [uri] is relative, a relative path will be returned.\n ///\n /// path.fromUri('path/to/foo'); // -> 'path/to/foo'\n String fromUri(uri) => style.pathFromUri(_parseUri(uri));\n\n /// Returns the URI that represents [path].\n ///\n /// For POSIX and Windows styles, this will return a `file:` URI. For the URL\n /// style, this will just convert [path] to a [Uri].\n ///\n /// // POSIX\n /// context.toUri('/path/to/foo')\n /// // -> Uri.parse('file:///path/to/foo')\n ///\n /// // Windows\n /// context.toUri(r'C:\\path\\to\\foo')\n /// // -> Uri.parse('file:///C:/path/to/foo')\n ///\n /// // URL\n /// context.toUri('https://dart.dev/path/to/foo')\n /// // -> Uri.parse('https://dart.dev/path/to/foo')\n Uri toUri(String path) {\n if (isRelative(path)) {\n return style.relativePathToUri(path);\n } else {\n return style.absolutePathToUri(join(current, path));\n }\n }\n\n /// Returns a terse, human-readable representation of [uri].\n ///\n /// [uri] can be a [String] or a [Uri]. If it can be made relative to the\n /// current working directory, that's done. Otherwise, it's returned as-is.\n /// This gracefully handles non-`file:` URIs for [Style.posix] and\n /// [Style.windows].\n ///\n /// The returned value is meant for human consumption, and may be either URI-\n /// or path-formatted.\n ///\n /// // POSIX\n /// var context = Context(current: '/root/path');\n /// context.prettyUri('file:///root/path/a/b.dart'); // -> 'a/b.dart'\n /// context.prettyUri('https://dart.dev/'); // -> 'https://dart.dev'\n ///\n /// // Windows\n /// var context = Context(current: r'C:\\root\\path');\n /// context.prettyUri('file:///C:/root/path/a/b.dart'); // -> r'a\\b.dart'\n /// context.prettyUri('https://dart.dev/'); // -> 'https://dart.dev'\n ///\n /// // URL\n /// var context = Context(current: 'https://dart.dev/root/path');\n /// context.prettyUri('https://dart.dev/root/path/a/b.dart');\n /// // -> r'a/b.dart'\n /// context.prettyUri('file:///root/path'); // -> 'file:///root/path'\n String prettyUri(uri) {\n final typedUri = _parseUri(uri);\n if (typedUri.scheme == 'file' && style == Style.url) {\n return typedUri.toString();\n } else if (typedUri.scheme != 'file' &&\n typedUri.scheme != '' &&\n style != Style.url) {\n return typedUri.toString();\n }\n\n final path = normalize(fromUri(typedUri));\n final rel = relative(path);\n\n // Only return a relative path if it's actually shorter than the absolute\n // path. This avoids ugly things like long \"../\" chains to get to the root\n // and then go back down.\n return split(rel).length > split(path).length ? path : rel;\n }\n\n ParsedPath _parse(String path) => ParsedPath.parse(path, style);\n}\n\n/// Parses argument if it's a [String] or returns it intact if it's a [Uri].\n///\n/// Throws an [ArgumentError] otherwise.\nUri _parseUri(uri) {\n if (uri is String) return Uri.parse(uri);\n if (uri is Uri) return uri;\n throw ArgumentError.value(uri, 'uri', 'Value must be a String or a Uri');\n}\n\n/// Validates that there are no non-null arguments following a null one and\n/// throws an appropriate [ArgumentError] on failure.\nvoid _validateArgList(String method, List args) {\n for (var i = 1; i < args.length; i++) {\n // Ignore nulls hanging off the end.\n if (args[i] == null || args[i - 1] != null) continue;\n\n int numArgs;\n for (numArgs = args.length; numArgs >= 1; numArgs--) {\n if (args[numArgs - 1] != null) break;\n }\n\n // Show the arguments.\n final message = StringBuffer();\n message.write('$method(');\n message.write(args\n .take(numArgs)\n .map((arg) => arg == null ? 'null' : '\"$arg\"')\n .join(', '));\n message.write('): part ${i - 1} was null, but part $i was not.');\n throw ArgumentError(message.toString());\n }\n}\n\n/// An enum of possible return values for [Context._pathDirection].\nclass _PathDirection {\n /// The path contains enough \"..\" components that at some point it reaches\n /// above its original root.\n ///\n /// Note that this applies even if the path ends beneath its original root. It\n /// takes precendence over any other return values that may apple.\n static const aboveRoot = _PathDirection('above root');\n\n /// The path contains enough \"..\" components that it ends at its original\n /// root.\n static const atRoot = _PathDirection('at root');\n\n /// The path contains enough \"..\" components that at some point it reaches its\n /// original root, but it ends beneath that root.\n static const reachesRoot = _PathDirection('reaches root');\n\n /// The path never reaches to or above its original root.\n static const belowRoot = _PathDirection('below root');\n\n final String name;\n\n const _PathDirection(this.name);\n\n @override\n String toString() => name;\n}\n\n/// An enum of possible return values for [Context._isWithinOrEquals].\nclass _PathRelation {\n /// The first path is a proper parent of the second.\n ///\n /// For example, `foo` is a proper parent of `foo/bar`, but not of `foo`.\n static const within = _PathRelation('within');\n\n /// The two paths are equivalent.\n ///\n /// For example, `foo//bar` is equivalent to `foo/bar`.\n static const equal = _PathRelation('equal');\n\n /// The first path is neither a parent of nor equal to the second.\n static const different = _PathRelation('different');\n\n /// We couldn't quickly determine any information about the paths'\n /// relationship to each other.\n ///\n /// Only returned by [Context._isWithinOrEqualsFast].\n static const inconclusive = _PathRelation('inconclusive');\n\n final String name;\n\n const _PathRelation(this.name);\n\n @override\n String toString() => name;\n}\n"},"__index_level_0__":{"kind":"number","value":0,"string":"0"}}},{"rowIdx":146364,"cells":{"repo_id":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/path/src"},"file_path":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/path/src/style/windows.dart"},"content":{"kind":"string","value":"// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file\n// for details. All rights reserved. Use of this source code is governed by a\n// BSD-style license that can be found in the LICENSE file.\n\nimport '../characters.dart' as chars;\nimport '../internal_style.dart';\nimport '../parsed_path.dart';\nimport '../utils.dart';\n\n// `0b100000` can be bitwise-ORed with uppercase ASCII letters to get their\n// lowercase equivalents.\nconst _asciiCaseBit = 0x20;\n\n/// The style for Windows paths.\nclass WindowsStyle extends InternalStyle {\n WindowsStyle();\n\n @override\n final name = 'windows';\n @override\n final separator = '\\\\';\n final separators = const ['/', '\\\\'];\n\n // Deprecated properties.\n\n @override\n final separatorPattern = RegExp(r'[/\\\\]');\n @override\n final needsSeparatorPattern = RegExp(r'[^/\\\\]$');\n @override\n final rootPattern = RegExp(r'^(\\\\\\\\[^\\\\]+\\\\[^\\\\/]+|[a-zA-Z]:[/\\\\])');\n @override\n final relativeRootPattern = RegExp(r'^[/\\\\](?![/\\\\])');\n\n @override\n bool containsSeparator(String path) => path.contains('/');\n\n @override\n bool isSeparator(int codeUnit) =>\n codeUnit == chars.slash || codeUnit == chars.backslash;\n\n @override\n bool needsSeparator(String path) {\n if (path.isEmpty) return false;\n return !isSeparator(path.codeUnitAt(path.length - 1));\n }\n\n @override\n int rootLength(String path, {bool withDrive = false}) {\n if (path.isEmpty) return 0;\n if (path.codeUnitAt(0) == chars.slash) return 1;\n if (path.codeUnitAt(0) == chars.backslash) {\n if (path.length < 2 || path.codeUnitAt(1) != chars.backslash) return 1;\n // The path is a network share. Search for up to two '\\'s, as they are\n // the server and share - and part of the root part.\n var index = path.indexOf('\\\\', 2);\n if (index > 0) {\n index = path.indexOf('\\\\', index + 1);\n if (index > 0) return index;\n }\n return path.length;\n }\n // If the path is of the form 'C:/' or 'C:\\', with C being any letter, it's\n // a root part.\n if (path.length < 3) return 0;\n // Check for the letter.\n if (!isAlphabetic(path.codeUnitAt(0))) return 0;\n // Check for the ':'.\n if (path.codeUnitAt(1) != chars.colon) return 0;\n // Check for either '/' or '\\'.\n if (!isSeparator(path.codeUnitAt(2))) return 0;\n return 3;\n }\n\n @override\n bool isRootRelative(String path) => rootLength(path) == 1;\n\n @override\n String getRelativeRoot(String path) {\n final length = rootLength(path);\n if (length == 1) return path[0];\n return null;\n }\n\n @override\n String pathFromUri(Uri uri) {\n if (uri.scheme != '' && uri.scheme != 'file') {\n throw ArgumentError(\"Uri $uri must have scheme 'file:'.\");\n }\n\n var path = uri.path;\n if (uri.host == '') {\n // Drive-letter paths look like \"file:///C:/path/to/file\". The\n // replaceFirst removes the extra initial slash. Otherwise, leave the\n // slash to match IE's interpretation of \"/foo\" as a root-relative path.\n if (path.length >= 3 && path.startsWith('/') && isDriveLetter(path, 1)) {\n path = path.replaceFirst('/', '');\n }\n } else {\n // Network paths look like \"file://hostname/path/to/file\".\n path = '\\\\\\\\${uri.host}$path';\n }\n return Uri.decodeComponent(path.replaceAll('/', '\\\\'));\n }\n\n @override\n Uri absolutePathToUri(String path) {\n final parsed = ParsedPath.parse(path, this);\n if (parsed.root.startsWith(r'\\\\')) {\n // Network paths become \"file://server/share/path/to/file\".\n\n // The root is of the form \"\\\\server\\share\". We want \"server\" to be the\n // URI host, and \"share\" to be the first element of the path.\n final rootParts = parsed.root.split('\\\\').where((part) => part != '');\n parsed.parts.insert(0, rootParts.last);\n\n if (parsed.hasTrailingSeparator) {\n // If the path has a trailing slash, add a single empty component so the\n // URI has a trailing slash as well.\n parsed.parts.add('');\n }\n\n return Uri(\n scheme: 'file', host: rootParts.first, pathSegments: parsed.parts);\n } else {\n // Drive-letter paths become \"file:///C:/path/to/file\".\n\n // If the path is a bare root (e.g. \"C:\\\"), [parsed.parts] will currently\n // be empty. We add an empty component so the URL constructor produces\n // \"file:///C:/\", with a trailing slash. We also add an empty component if\n // the URL otherwise has a trailing slash.\n if (parsed.parts.isEmpty || parsed.hasTrailingSeparator) {\n parsed.parts.add('');\n }\n\n // Get rid of the trailing \"\\\" in \"C:\\\" because the URI constructor will\n // add a separator on its own.\n parsed.parts\n .insert(0, parsed.root.replaceAll('/', '').replaceAll('\\\\', ''));\n\n return Uri(scheme: 'file', pathSegments: parsed.parts);\n }\n }\n\n @override\n bool codeUnitsEqual(int codeUnit1, int codeUnit2) {\n if (codeUnit1 == codeUnit2) return true;\n\n /// Forward slashes and backslashes are equivalent on Windows.\n if (codeUnit1 == chars.slash) return codeUnit2 == chars.backslash;\n if (codeUnit1 == chars.backslash) return codeUnit2 == chars.slash;\n\n // If this check fails, the code units are definitely different. If it\n // succeeds *and* either codeUnit is an ASCII letter, they're equivalent.\n if (codeUnit1 ^ codeUnit2 != _asciiCaseBit) return false;\n\n // Now we just need to verify that one of the code units is an ASCII letter.\n final upperCase1 = codeUnit1 | _asciiCaseBit;\n return upperCase1 >= chars.lowerA && upperCase1 <= chars.lowerZ;\n }\n\n @override\n bool pathsEqual(String path1, String path2) {\n if (identical(path1, path2)) return true;\n if (path1.length != path2.length) return false;\n for (var i = 0; i < path1.length; i++) {\n if (!codeUnitsEqual(path1.codeUnitAt(i), path2.codeUnitAt(i))) {\n return false;\n }\n }\n return true;\n }\n\n @override\n int canonicalizeCodeUnit(int codeUnit) {\n if (codeUnit == chars.slash) return chars.backslash;\n if (codeUnit < chars.upperA) return codeUnit;\n if (codeUnit > chars.upperZ) return codeUnit;\n return codeUnit | _asciiCaseBit;\n }\n\n @override\n String canonicalizePart(String part) => part.toLowerCase();\n}\n"},"__index_level_0__":{"kind":"number","value":0,"string":"0"}}},{"rowIdx":146365,"cells":{"repo_id":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/path/src"},"file_path":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/path/src/style/posix.dart"},"content":{"kind":"string","value":"// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file\n// for details. All rights reserved. Use of this source code is governed by a\n// BSD-style license that can be found in the LICENSE file.\n\nimport '../characters.dart' as chars;\nimport '../internal_style.dart';\nimport '../parsed_path.dart';\n\n/// The style for POSIX paths.\nclass PosixStyle extends InternalStyle {\n PosixStyle();\n\n @override\n final name = 'posix';\n @override\n final separator = '/';\n final separators = const ['/'];\n\n // Deprecated properties.\n\n @override\n final separatorPattern = RegExp(r'/');\n @override\n final needsSeparatorPattern = RegExp(r'[^/]$');\n @override\n final rootPattern = RegExp(r'^/');\n @override\n final relativeRootPattern = null;\n\n @override\n bool containsSeparator(String path) => path.contains('/');\n\n @override\n bool isSeparator(int codeUnit) => codeUnit == chars.slash;\n\n @override\n bool needsSeparator(String path) =>\n path.isNotEmpty && !isSeparator(path.codeUnitAt(path.length - 1));\n\n @override\n int rootLength(String path, {bool withDrive = false}) {\n if (path.isNotEmpty && isSeparator(path.codeUnitAt(0))) return 1;\n return 0;\n }\n\n @override\n bool isRootRelative(String path) => false;\n\n @override\n String getRelativeRoot(String path) => null;\n\n @override\n String pathFromUri(Uri uri) {\n if (uri.scheme == '' || uri.scheme == 'file') {\n return Uri.decodeComponent(uri.path);\n }\n throw ArgumentError(\"Uri $uri must have scheme 'file:'.\");\n }\n\n @override\n Uri absolutePathToUri(String path) {\n final parsed = ParsedPath.parse(path, this);\n if (parsed.parts.isEmpty) {\n // If the path is a bare root (e.g. \"/\"), [components] will\n // currently be empty. We add two empty components so the URL constructor\n // produces \"file:///\", with a trailing slash.\n parsed.parts.addAll(['', '']);\n } else if (parsed.hasTrailingSeparator) {\n // If the path has a trailing slash, add a single empty component so the\n // URI has a trailing slash as well.\n parsed.parts.add('');\n }\n\n return Uri(scheme: 'file', pathSegments: parsed.parts);\n }\n}\n"},"__index_level_0__":{"kind":"number","value":0,"string":"0"}}},{"rowIdx":146366,"cells":{"repo_id":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/path/src"},"file_path":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/path/src/style/url.dart"},"content":{"kind":"string","value":"// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file\n// for details. All rights reserved. Use of this source code is governed by a\n// BSD-style license that can be found in the LICENSE file.\n\nimport '../characters.dart' as chars;\nimport '../internal_style.dart';\nimport '../utils.dart';\n\n/// The style for URL paths.\nclass UrlStyle extends InternalStyle {\n UrlStyle();\n\n @override\n final name = 'url';\n @override\n final separator = '/';\n final separators = const ['/'];\n\n // Deprecated properties.\n\n @override\n final separatorPattern = RegExp(r'/');\n @override\n final needsSeparatorPattern = RegExp(r'(^[a-zA-Z][-+.a-zA-Z\\d]*://|[^/])$');\n @override\n final rootPattern = RegExp(r'[a-zA-Z][-+.a-zA-Z\\d]*://[^/]*');\n @override\n final relativeRootPattern = RegExp(r'^/');\n\n @override\n bool containsSeparator(String path) => path.contains('/');\n\n @override\n bool isSeparator(int codeUnit) => codeUnit == chars.slash;\n\n @override\n bool needsSeparator(String path) {\n if (path.isEmpty) return false;\n\n // A URL that doesn't end in \"/\" always needs a separator.\n if (!isSeparator(path.codeUnitAt(path.length - 1))) return true;\n\n // A URI that's just \"scheme://\" needs an extra separator, despite ending\n // with \"/\".\n return path.endsWith('://') && rootLength(path) == path.length;\n }\n\n @override\n int rootLength(String path, {bool withDrive = false}) {\n if (path.isEmpty) return 0;\n if (isSeparator(path.codeUnitAt(0))) return 1;\n\n for (var i = 0; i < path.length; i++) {\n final codeUnit = path.codeUnitAt(i);\n if (isSeparator(codeUnit)) return 0;\n if (codeUnit == chars.colon) {\n if (i == 0) return 0;\n\n // The root part is up until the next '/', or the full path. Skip ':'\n // (and '//' if it exists) and search for '/' after that.\n if (path.startsWith('//', i + 1)) i += 3;\n final index = path.indexOf('/', i);\n if (index <= 0) return path.length;\n\n // file: URLs sometimes consider Windows drive letters part of the root.\n // See https://url.spec.whatwg.org/#file-slash-state.\n if (!withDrive || path.length < index + 3) return index;\n if (!path.startsWith('file://')) return index;\n if (!isDriveLetter(path, index + 1)) return index;\n return path.length == index + 3 ? index + 3 : index + 4;\n }\n }\n\n return 0;\n }\n\n @override\n bool isRootRelative(String path) =>\n path.isNotEmpty && isSeparator(path.codeUnitAt(0));\n\n @override\n String getRelativeRoot(String path) => isRootRelative(path) ? '/' : null;\n\n @override\n String pathFromUri(Uri uri) => uri.toString();\n\n @override\n Uri relativePathToUri(String path) => Uri.parse(path);\n @override\n Uri absolutePathToUri(String path) => Uri.parse(path);\n}\n"},"__index_level_0__":{"kind":"number","value":0,"string":"0"}}},{"rowIdx":146367,"cells":{"repo_id":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages"},"file_path":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/uuid/uuid_util.dart"},"content":{"kind":"string","value":"library uuid_util;\n\nimport 'dart:math';\n\nclass UuidUtil {\n /// Math.Random()-based RNG. All platforms, fast, not cryptographically strong. Optional Seed passable.\n static List mathRNG({int seed = -1}) {\n var b = List(16);\n\n var rand = (seed == -1) ? Random() : Random(seed);\n for (var i = 0; i < 16; i++) {\n b[i] = rand.nextInt(256);\n }\n\n (seed == -1) ? b.shuffle() : b.shuffle(Random(seed));\n\n return b;\n }\n\n /// Crypto-Strong RNG. All platforms, unknown speed, cryptographically strong (theoretically)\n static List cryptoRNG() {\n var b = List(16);\n var rand = Random.secure();\n for (var i = 0; i < 16; i++) {\n b[i] = rand.nextInt(256);\n }\n return b;\n }\n}\n"},"__index_level_0__":{"kind":"number","value":0,"string":"0"}}},{"rowIdx":146368,"cells":{"repo_id":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages"},"file_path":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/uuid/uuid.dart"},"content":{"kind":"string","value":"library uuid;\n\nimport 'uuid_util.dart';\nimport 'package:crypto/crypto.dart' as crypto;\nimport 'package:convert/convert.dart' as convert;\n\n/// uuid for Dart\n/// Author: Yulian Kuncheff\n/// Released under MIT License.\n\nclass Uuid {\n // RFC4122 provided namespaces for v3 and v5 namespace based UUIDs\n static const NAMESPACE_DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';\n static const NAMESPACE_URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';\n static const NAMESPACE_OID = '6ba7b812-9dad-11d1-80b4-00c04fd430c8';\n static const NAMESPACE_X500 = '6ba7b814-9dad-11d1-80b4-00c04fd430c8';\n static const NAMESPACE_NIL = '00000000-0000-0000-0000-000000000000';\n\n var _seedBytes, _nodeId, _clockSeq, _lastMSecs = 0, _lastNSecs = 0;\n Function _globalRNG;\n List _byteToHex;\n Map _hexToByte;\n\n Uuid({Map options}) {\n options = (options != null) ? options : {};\n _byteToHex = List(256);\n _hexToByte = {};\n\n // Easy number <-> hex conversion\n for (var i = 0; i < 256; i++) {\n var hex = [];\n hex.add(i);\n _byteToHex[i] = convert.hex.encode(hex);\n _hexToByte[_byteToHex[i]] = i;\n }\n\n // Sets initial seedBytes, node, and clock seq based on mathRNG.\n var v1PositionalArgs = (options['v1rngPositionalArgs'] != null)\n ? options['v1rngPositionalArgs']\n : [];\n var v1NamedArgs = (options['v1rngNamedArgs'] != null)\n ? options['v1rngNamedArgs'] as Map\n : const {};\n _seedBytes = (options['v1rng'] != null)\n ? Function.apply(options['v1rng'], v1PositionalArgs, v1NamedArgs)\n : UuidUtil.mathRNG();\n\n // Set the globalRNG function to mathRNG with the option to set an alternative globally\n var gPositionalArgs = (options['grngPositionalArgs'] != null)\n ? options['grngPositionalArgs']\n : [];\n var gNamedArgs = (options['grngNamedArgs'] != null)\n ? options['grngNamedArgs'] as Map\n : const {};\n _globalRNG = () {\n return (options['grng'] != null)\n ? Function.apply(options['grng'], gPositionalArgs, gNamedArgs)\n : UuidUtil.mathRNG();\n };\n\n // Per 4.5, create a 48-bit node id (47 random bits + multicast bit = 1)\n _nodeId = [\n _seedBytes[0] | 0x01,\n _seedBytes[1],\n _seedBytes[2],\n _seedBytes[3],\n _seedBytes[4],\n _seedBytes[5]\n ];\n\n // Per 4.2.2, randomize (14 bit) clockseq\n _clockSeq = (_seedBytes[6] << 8 | _seedBytes[7]) & 0x3ffff;\n }\n\n ///Parses the provided [uuid] into a list of byte values.\n /// Can optionally be provided a [buffer] to write into and\n /// a positional [offset] for where to start inputting into the buffer.\n List parse(String uuid, {List buffer, int offset = 0}) {\n var i = offset, ii = 0;\n\n // Create a 16 item buffer if one hasn't been provided.\n buffer = (buffer != null) ? buffer : List(16);\n\n // Convert to lowercase and replace all hex with bytes then\n // string.replaceAll() does a lot of work that I don't need, and a manual\n // regex gives me more control.\n final regex = RegExp('[0-9a-f]{2}');\n for (Match match in regex.allMatches(uuid.toLowerCase())) {\n if (ii < 16) {\n var hex = uuid.toLowerCase().substring(match.start, match.end);\n buffer[i + ii++] = _hexToByte[hex];\n }\n }\n\n // Zero out any left over bytes if the string was too short.\n while (ii < 16) {\n buffer[i + ii++] = 0;\n }\n\n return buffer;\n }\n\n /// Unparses a [buffer] of bytes and outputs a proper UUID string.\n /// An optional [offset] is allowed if you want to start at a different point\n /// in the buffer.\n String unparse(List buffer, {int offset = 0}) {\n var i = offset;\n return '${_byteToHex[buffer[i++]]}${_byteToHex[buffer[i++]]}'\n '${_byteToHex[buffer[i++]]}${_byteToHex[buffer[i++]]}-'\n '${_byteToHex[buffer[i++]]}${_byteToHex[buffer[i++]]}-'\n '${_byteToHex[buffer[i++]]}${_byteToHex[buffer[i++]]}-'\n '${_byteToHex[buffer[i++]]}${_byteToHex[buffer[i++]]}-'\n '${_byteToHex[buffer[i++]]}${_byteToHex[buffer[i++]]}'\n '${_byteToHex[buffer[i++]]}${_byteToHex[buffer[i++]]}'\n '${_byteToHex[buffer[i++]]}${_byteToHex[buffer[i++]]}';\n }\n\n /// v1() Generates a time-based version 1 UUID\n ///\n /// By default it will generate a string based off current time, and will\n /// return a string.\n ///\n /// If an optional [buffer] list is provided, it will put the byte data into\n /// that buffer and return a buffer.\n ///\n /// Optionally an [offset] can be provided with a start position in the buffer.\n ///\n /// The first argument is an options map that takes various configuration\n /// options detailed in the readme.\n ///\n /// http://tools.ietf.org/html/rfc4122.html#section-4.2.2\n String v1({Map options}) {\n var i = 0;\n var buf = List(16);\n options = (options != null) ? options : {};\n\n var clockSeq =\n (options['clockSeq'] != null) ? options['clockSeq'] : _clockSeq;\n\n // UUID timestamps are 100 nano-second units since the Gregorian epoch,\n // (1582-10-15 00:00). Time is handled internally as 'msecs' (integer\n // milliseconds) and 'nsecs' (100-nanoseconds offset from msecs) since unix\n // epoch, 1970-01-01 00:00.\n var mSecs = (options['mSecs'] != null)\n ? options['mSecs']\n : (DateTime.now()).millisecondsSinceEpoch;\n\n // Per 4.2.1.2, use count of uuid's generated during the current clock\n // cycle to simulate higher resolution clock\n var nSecs = (options['nSecs'] != null) ? options['nSecs'] : _lastNSecs + 1;\n\n // Time since last uuid creation (in msecs)\n var dt = (mSecs - _lastMSecs) + (nSecs - _lastNSecs) / 10000;\n\n // Per 4.2.1.2, Bump clockseq on clock regression\n if (dt < 0 && options['clockSeq'] == null) {\n clockSeq = clockSeq + 1 & 0x3fff;\n }\n\n // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new\n // time interval\n if ((dt < 0 || mSecs > _lastMSecs) && options['nSecs'] == null) {\n nSecs = 0;\n }\n\n // Per 4.2.1.2 Throw error if too many uuids are requested\n if (nSecs >= 10000) {\n throw Exception('uuid.v1(): Can\\'t create more than 10M uuids/sec');\n }\n\n _lastMSecs = mSecs;\n _lastNSecs = nSecs;\n _clockSeq = clockSeq;\n\n // Per 4.1.4 - Convert from unix epoch to Gregorian epoch\n mSecs += 12219292800000;\n\n // time Low\n var tl = ((mSecs & 0xfffffff) * 10000 + nSecs) % 0x100000000;\n buf[i++] = tl >> 24 & 0xff;\n buf[i++] = tl >> 16 & 0xff;\n buf[i++] = tl >> 8 & 0xff;\n buf[i++] = tl & 0xff;\n\n // time mid\n var tmh = (mSecs / 0x100000000 * 10000).floor() & 0xfffffff;\n buf[i++] = tmh >> 8 & 0xff;\n buf[i++] = tmh & 0xff;\n\n // time high and version\n buf[i++] = tmh >> 24 & 0xf | 0x10; // include version\n buf[i++] = tmh >> 16 & 0xff;\n\n // clockSeq high and reserved (Per 4.2.2 - include variant)\n buf[i++] = (clockSeq & 0x3F00) >> 8 | 0x80;\n\n // clockSeq low\n buf[i++] = clockSeq & 0xff;\n\n // node\n var node = (options['node'] != null) ? options['node'] : _nodeId;\n for (var n = 0; n < 6; n++) {\n buf[i + n] = node[n];\n }\n\n return unparse(buf);\n }\n\n /// v1buffer() Generates a time-based version 1 UUID\n ///\n /// By default it will generate a string based off current time, and will\n /// place the result into the provided [buffer]. The [buffer] will also be returned..\n ///\n /// Optionally an [offset] can be provided with a start position in the buffer.\n ///\n /// The first argument is an options map that takes various configuration\n /// options detailed in the readme.\n ///\n /// http://tools.ietf.org/html/rfc4122.html#section-4.2.2\n List v1buffer(\n List buffer, {\n Map options,\n int offset = 0,\n }) {\n var _buf = parse(v1(options: options));\n\n if (buffer != null) {\n buffer.setRange(offset, offset + 16, _buf);\n }\n\n return buffer;\n }\n\n /// v4() Generates a RNG version 4 UUID\n ///\n /// By default it will generate a string based mathRNG, and will return\n /// a string. If you wish to use crypto-strong RNG, pass in UuidUtil.cryptoRNG\n ///\n /// The first argument is an options map that takes various configuration\n /// options detailed in the readme.\n ///\n /// http://tools.ietf.org/html/rfc4122.html#section-4.4\n String v4({Map options}) {\n options = (options != null) ? options : {};\n\n // Use the built-in RNG or a custom provided RNG\n var positionalArgs =\n (options['positionalArgs'] != null) ? options['positionalArgs'] : [];\n var namedArgs = (options['namedArgs'] != null)\n ? options['namedArgs'] as Map\n : const {};\n var rng = (options['rng'] != null)\n ? Function.apply(options['rng'], positionalArgs, namedArgs)\n : _globalRNG();\n\n // Use provided values over RNG\n var rnds = (options['random'] != null) ? options['random'] : rng;\n\n // per 4.4, set bits for version and clockSeq high and reserved\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n\n return unparse(rnds);\n }\n\n /// v4buffer() Generates a RNG version 4 UUID\n ///\n /// By default it will generate a string based off mathRNG, and will\n /// place the result into the provided [buffer]. The [buffer] will also be returned.\n /// If you wish to have crypto-strong RNG, pass in UuidUtil.cryptoRNG.\n ///\n /// Optionally an [offset] can be provided with a start position in the buffer.\n ///\n /// The first argument is an options map that takes various configuration\n /// options detailed in the readme.\n ///\n /// http://tools.ietf.org/html/rfc4122.html#section-4.4\n List v4buffer(\n List buffer, {\n Map options,\n int offset = 0,\n }) {\n var _buf = parse(v4(options: options));\n\n if (buffer != null) {\n buffer.setRange(offset, offset + 16, _buf);\n }\n\n return buffer;\n }\n\n /// v5() Generates a namspace & name-based version 5 UUID\n ///\n /// By default it will generate a string based on a provided uuid namespace and\n /// name, and will return a string.\n ///\n /// The first argument is an options map that takes various configuration\n /// options detailed in the readme.\n ///\n /// http://tools.ietf.org/html/rfc4122.html#section-4.4\n String v5(String namespace, String name, {Map options}) {\n options = (options != null) ? options : {};\n\n // Check if user wants a random namespace generated by v4() or a NIL namespace.\n var useRandom = (options['randomNamespace'] != null)\n ? options['randomNamespace']\n : true;\n\n // If useRandom is true, generate UUIDv4, else use NIL\n var blankNS = useRandom ? v4() : NAMESPACE_NIL;\n\n // Use provided namespace, or use whatever is decided by options.\n namespace = (namespace != null) ? namespace : blankNS;\n\n // Use provided name,\n name = (name != null) ? name : '';\n\n // Convert namespace UUID to Byte List\n var bytes = parse(namespace);\n\n // Convert name to a list of bytes\n var nameBytes = [];\n for (var singleChar in name.codeUnits) {\n nameBytes.add(singleChar);\n }\n\n // Generate SHA1 using namespace concatenated with name\n List hashBytes =\n crypto.sha1.convert(List.from(bytes)..addAll(nameBytes)).bytes;\n\n // per 4.4, set bits for version and clockSeq high and reserved\n hashBytes[6] = (hashBytes[6] & 0x0f) | 0x50;\n hashBytes[8] = (hashBytes[8] & 0x3f) | 0x80;\n\n return unparse(hashBytes);\n }\n\n /// v5buffer() Generates a RNG version 4 UUID\n ///\n /// By default it will generate a string based off current time, and will\n /// place the result into the provided [buffer]. The [buffer] will also be returned..\n ///\n /// Optionally an [offset] can be provided with a start position in the buffer.\n ///\n /// The first argument is an options map that takes various configuration\n /// options detailed in the readme.\n ///\n /// http://tools.ietf.org/html/rfc4122.html#section-4.4\n List v5buffer(\n String namespace,\n String name,\n List buffer, {\n Map options,\n int offset = 0,\n }) {\n var _buf = parse(v5(namespace, name, options: options));\n\n if (buffer != null) {\n buffer.setRange(offset, offset + 16, _buf);\n }\n\n return buffer;\n }\n}\n"},"__index_level_0__":{"kind":"number","value":0,"string":"0"}}},{"rowIdx":146369,"cells":{"repo_id":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages"},"file_path":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/html/dom.dart"},"content":{"kind":"string","value":"/// A simple tree API that results from parsing html. Intended to be compatible\n/// with dart:html, but it is missing many types and APIs.\nlibrary dom;\n\n// TODO(jmesserly): lots to do here. Originally I wanted to generate this using\n// our Blink IDL generator, but another idea is to directly use the excellent\n// http://dom.spec.whatwg.org/ and http://html.spec.whatwg.org/ and just\n// implement that.\n\nimport 'dart:collection';\n\nimport 'package:source_span/source_span.dart';\n\nimport 'dom_parsing.dart';\nimport 'parser.dart';\nimport 'src/constants.dart';\nimport 'src/css_class_set.dart';\nimport 'src/list_proxy.dart';\nimport 'src/query_selector.dart' as query;\nimport 'src/token.dart';\nimport 'src/tokenizer.dart';\n\nexport 'src/css_class_set.dart' show CssClassSet;\n\n// TODO(jmesserly): this needs to be replaced by an AttributeMap for attributes\n// that exposes namespace info.\nclass AttributeName implements Comparable {\n /// The namespace prefix, e.g. `xlink`.\n final String prefix;\n\n /// The attribute name, e.g. `title`.\n final String name;\n\n /// The namespace url, e.g. `http://www.w3.org/1999/xlink`\n final String namespace;\n\n const AttributeName(this.prefix, this.name, this.namespace);\n\n @override\n String toString() {\n // Implement:\n // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-end.html#serializing-html-fragments\n // If we get here we know we are xml, xmlns, or xlink, because of\n // [HtmlParser.adjustForeignAttriubtes] is the only place we create\n // an AttributeName.\n return prefix != null ? '$prefix:$name' : name;\n }\n\n @override\n int get hashCode {\n var h = prefix.hashCode;\n h = 37 * (h & 0x1FFFFF) + name.hashCode;\n h = 37 * (h & 0x1FFFFF) + namespace.hashCode;\n return h & 0x3FFFFFFF;\n }\n\n @override\n int compareTo(other) {\n // Not sure about this sort order\n if (other is! AttributeName) return 1;\n var cmp = (prefix ?? '').compareTo((other.prefix ?? ''));\n if (cmp != 0) return cmp;\n cmp = name.compareTo(other.name);\n if (cmp != 0) return cmp;\n return namespace.compareTo(other.namespace);\n }\n\n @override\n bool operator ==(x) {\n if (x is! AttributeName) return false;\n return prefix == x.prefix && name == x.name && namespace == x.namespace;\n }\n}\n\n// http://dom.spec.whatwg.org/#parentnode\nabstract class _ParentNode implements Node {\n // TODO(jmesserly): this is only a partial implementation\n\n /// Seaches for the first descendant node matching the given selectors, using\n /// a preorder traversal.\n ///\n /// NOTE: Not all selectors from\n /// [selectors level 4](http://dev.w3.org/csswg/selectors-4/)\n /// are implemented. For example, nth-child does not implement An+B syntax\n /// and *-of-type is not implemented. If a selector is not implemented this\n /// method will throw [UniplmentedError].\n Element querySelector(String selector) => query.querySelector(this, selector);\n\n /// Returns all descendant nodes matching the given selectors, using a\n /// preorder traversal.\n ///\n /// NOTE: Not all selectors from\n /// [selectors level 4](http://dev.w3.org/csswg/selectors-4/)\n /// are implemented. For example, nth-child does not implement An+B syntax\n /// and *-of-type is not implemented. If a selector is not implemented this\n /// method will throw [UniplmentedError].\n List querySelectorAll(String selector) =>\n query.querySelectorAll(this, selector);\n}\n\n// http://dom.spec.whatwg.org/#interface-nonelementparentnode\nabstract class _NonElementParentNode implements _ParentNode {\n // TODO(jmesserly): could be faster, should throw on invalid id.\n Element getElementById(String id) => querySelector('#$id');\n}\n\n// This doesn't exist as an interface in the spec, but it's useful to merge\n// common methods from these:\n// http://dom.spec.whatwg.org/#interface-document\n// http://dom.spec.whatwg.org/#element\nabstract class _ElementAndDocument implements _ParentNode {\n // TODO(jmesserly): could be faster, should throw on invalid tag/class names.\n\n List getElementsByTagName(String localName) =>\n querySelectorAll(localName);\n\n List getElementsByClassName(String classNames) =>\n querySelectorAll(classNames.splitMapJoin(' ',\n onNonMatch: (m) => m.isNotEmpty ? '.$m' : m, onMatch: (m) => ''));\n}\n\n/// Really basic implementation of a DOM-core like Node.\nabstract class Node {\n static const int ATTRIBUTE_NODE = 2;\n static const int CDATA_SECTION_NODE = 4;\n static const int COMMENT_NODE = 8;\n static const int DOCUMENT_FRAGMENT_NODE = 11;\n static const int DOCUMENT_NODE = 9;\n static const int DOCUMENT_TYPE_NODE = 10;\n static const int ELEMENT_NODE = 1;\n static const int ENTITY_NODE = 6;\n static const int ENTITY_REFERENCE_NODE = 5;\n static const int NOTATION_NODE = 12;\n static const int PROCESSING_INSTRUCTION_NODE = 7;\n static const int TEXT_NODE = 3;\n\n /// The parent of the current node (or null for the document node).\n Node parentNode;\n\n /// The parent element of this node.\n ///\n /// Returns null if this node either does not have a parent or its parent is\n /// not an element.\n Element get parent => parentNode is Element ? parentNode : null;\n\n // TODO(jmesserly): should move to Element.\n /// A map holding name, value pairs for attributes of the node.\n ///\n /// Note that attribute order needs to be stable for serialization, so we use\n /// a LinkedHashMap. Each key is a [String] or [AttributeName].\n LinkedHashMap attributes = LinkedHashMap();\n\n /// A list of child nodes of the current node. This must\n /// include all elements but not necessarily other node types.\n final NodeList nodes = NodeList._();\n\n List _elements;\n\n // TODO(jmesserly): consider using an Expando for this, and put it in\n // dom_parsing. Need to check the performance affect.\n /// The source span of this node, if it was created by the [HtmlParser].\n FileSpan sourceSpan;\n\n /// The attribute spans if requested. Otherwise null.\n LinkedHashMap _attributeSpans;\n LinkedHashMap _attributeValueSpans;\n\n Node._() {\n nodes._parent = this;\n }\n\n /// If [sourceSpan] is available, this contains the spans of each attribute.\n /// The span of an attribute is the entire attribute, including the name and\n /// quotes (if any). For example, the span of \"attr\" in ``\n /// would be the text `attr=\"value\"`.\n LinkedHashMap get attributeSpans {\n _ensureAttributeSpans();\n return _attributeSpans;\n }\n\n /// If [sourceSpan] is available, this contains the spans of each attribute's\n /// value. Unlike [attributeSpans], this span will inlcude only the value.\n /// For example, the value span of \"attr\" in `` would be the\n /// text `value`.\n LinkedHashMap get attributeValueSpans {\n _ensureAttributeSpans();\n return _attributeValueSpans;\n }\n\n List get children => _elements ??= FilteredElementList(this);\n\n /// Returns a copy of this node.\n ///\n /// If [deep] is `true`, then all of this node's children and decendents are\n /// copied as well. If [deep] is `false`, then only this node is copied.\n Node clone(bool deep);\n\n int get nodeType;\n\n // http://domparsing.spec.whatwg.org/#extensions-to-the-element-interface\n String get _outerHtml {\n var str = StringBuffer();\n _addOuterHtml(str);\n return str.toString();\n }\n\n String get _innerHtml {\n var str = StringBuffer();\n _addInnerHtml(str);\n return str.toString();\n }\n\n // Implemented per: http://dom.spec.whatwg.org/#dom-node-textcontent\n String get text => null;\n set text(String value) {}\n\n void append(Node node) => nodes.add(node);\n\n Node get firstChild => nodes.isNotEmpty ? nodes[0] : null;\n\n void _addOuterHtml(StringBuffer str);\n\n void _addInnerHtml(StringBuffer str) {\n for (var child in nodes) {\n child._addOuterHtml(str);\n }\n }\n\n Node remove() {\n // TODO(jmesserly): is parent == null an error?\n if (parentNode != null) {\n parentNode.nodes.remove(this);\n }\n return this;\n }\n\n /// Insert [node] as a child of the current node, before [refNode] in the\n /// list of child nodes. Raises [UnsupportedOperationException] if [refNode]\n /// is not a child of the current node. If refNode is null, this adds to the\n /// end of the list.\n void insertBefore(Node node, Node refNode) {\n if (refNode == null) {\n nodes.add(node);\n } else {\n nodes.insert(nodes.indexOf(refNode), node);\n }\n }\n\n /// Replaces this node with another node.\n Node replaceWith(Node otherNode) {\n if (parentNode == null) {\n throw UnsupportedError('Node must have a parent to replace it.');\n }\n parentNode.nodes[parentNode.nodes.indexOf(this)] = otherNode;\n return this;\n }\n\n // TODO(jmesserly): should this be a property or remove?\n /// Return true if the node has children or text.\n bool hasContent() => nodes.isNotEmpty;\n\n /// Move all the children of the current node to [newParent].\n /// This is needed so that trees that don't store text as nodes move the\n /// text in the correct way.\n void reparentChildren(Node newParent) {\n newParent.nodes.addAll(nodes);\n nodes.clear();\n }\n\n bool hasChildNodes() => nodes.isNotEmpty;\n\n bool contains(Node node) => nodes.contains(node);\n\n /// Initialize [attributeSpans] using [sourceSpan].\n void _ensureAttributeSpans() {\n if (_attributeSpans != null) return;\n\n _attributeSpans = LinkedHashMap();\n _attributeValueSpans = LinkedHashMap();\n\n if (sourceSpan == null) return;\n\n var tokenizer = HtmlTokenizer(sourceSpan.text,\n generateSpans: true, attributeSpans: true);\n\n tokenizer.moveNext();\n var token = tokenizer.current as StartTagToken;\n\n if (token.attributeSpans == null) return; // no attributes\n\n for (var attr in token.attributeSpans) {\n var offset = sourceSpan.start.offset;\n _attributeSpans[attr.name] =\n sourceSpan.file.span(offset + attr.start, offset + attr.end);\n if (attr.startValue != null) {\n _attributeValueSpans[attr.name] = sourceSpan.file\n .span(offset + attr.startValue, offset + attr.endValue);\n }\n }\n }\n\n Node _clone(Node shallowClone, bool deep) {\n if (deep) {\n for (var child in nodes) {\n shallowClone.append(child.clone(true));\n }\n }\n return shallowClone;\n }\n}\n\nclass Document extends Node\n with _ParentNode, _NonElementParentNode, _ElementAndDocument {\n Document() : super._();\n factory Document.html(String html) => parse(html);\n\n @override\n int get nodeType => Node.DOCUMENT_NODE;\n\n // TODO(jmesserly): optmize this if needed\n Element get documentElement => querySelector('html');\n Element get head => documentElement.querySelector('head');\n Element get body => documentElement.querySelector('body');\n\n /// Returns a fragment of HTML or XML that represents the element and its\n /// contents.\n // TODO(jmesserly): this API is not specified in:\n // nor is it in dart:html, instead\n // only Element has outerHtml. However it is quite useful. Should we move it\n // to dom_parsing, where we keep other custom APIs?\n String get outerHtml => _outerHtml;\n\n @override\n String toString() => '#document';\n\n @override\n void _addOuterHtml(StringBuffer str) => _addInnerHtml(str);\n\n @override\n Document clone(bool deep) => _clone(Document(), deep);\n\n Element createElement(String tag) => Element.tag(tag);\n\n // TODO(jmesserly): this is only a partial implementation of:\n // http://dom.spec.whatwg.org/#dom-document-createelementns\n Element createElementNS(String namespaceUri, String tag) {\n if (namespaceUri == '') namespaceUri = null;\n return Element._(tag, namespaceUri);\n }\n\n DocumentFragment createDocumentFragment() => DocumentFragment();\n}\n\nclass DocumentFragment extends Node with _ParentNode, _NonElementParentNode {\n DocumentFragment() : super._();\n factory DocumentFragment.html(String html) => parseFragment(html);\n\n @override\n int get nodeType => Node.DOCUMENT_FRAGMENT_NODE;\n\n /// Returns a fragment of HTML or XML that represents the element and its\n /// contents.\n // TODO(jmesserly): this API is not specified in:\n // nor is it in dart:html, instead\n // only Element has outerHtml. However it is quite useful. Should we move it\n // to dom_parsing, where we keep other custom APIs?\n String get outerHtml => _outerHtml;\n\n @override\n String toString() => '#document-fragment';\n\n @override\n DocumentFragment clone(bool deep) => _clone(DocumentFragment(), deep);\n\n @override\n void _addOuterHtml(StringBuffer str) => _addInnerHtml(str);\n\n @override\n String get text => _getText(this);\n @override\n set text(String value) => _setText(this, value);\n}\n\nclass DocumentType extends Node {\n final String name;\n final String publicId;\n final String systemId;\n\n DocumentType(this.name, this.publicId, this.systemId) : super._();\n\n @override\n int get nodeType => Node.DOCUMENT_TYPE_NODE;\n\n @override\n String toString() {\n if (publicId != null || systemId != null) {\n // TODO(jmesserly): the html5 serialization spec does not add these. But\n // it seems useful, and the parser can handle it, so for now keeping it.\n var pid = publicId ?? '';\n var sid = systemId ?? '';\n return '';\n } else {\n return '';\n }\n }\n\n @override\n void _addOuterHtml(StringBuffer str) {\n str.write(toString());\n }\n\n @override\n DocumentType clone(bool deep) => DocumentType(name, publicId, systemId);\n}\n\nclass Text extends Node {\n /// The text node's data, stored as either a String or StringBuffer.\n /// We support storing a StringBuffer here to support fast [appendData].\n /// It will flatten back to a String on read.\n dynamic _data;\n\n Text(String data)\n : _data = data ?? '',\n super._();\n\n @override\n int get nodeType => Node.TEXT_NODE;\n\n String get data => _data = _data.toString();\n set data(String value) {\n _data = value ?? '';\n }\n\n @override\n String toString() => '\"$data\"';\n\n @override\n void _addOuterHtml(StringBuffer str) => writeTextNodeAsHtml(str, this);\n\n @override\n Text clone(bool deep) => Text(data);\n\n void appendData(String data) {\n if (_data is! StringBuffer) _data = StringBuffer(_data);\n StringBuffer sb = _data;\n sb.write(data);\n }\n\n @override\n String get text => data;\n @override\n set text(String value) {\n data = value;\n }\n}\n\n// TODO(jmesserly): Elements should have a pointer back to their document\nclass Element extends Node with _ParentNode, _ElementAndDocument {\n final String namespaceUri;\n\n /// The [local name](http://dom.spec.whatwg.org/#concept-element-local-name)\n /// of this element.\n final String localName;\n\n // TODO(jmesserly): consider using an Expando for this, and put it in\n // dom_parsing. Need to check the performance affect.\n /// The source span of the end tag this element, if it was created by the\n /// [HtmlParser]. May be `null` if does not have an implicit end tag.\n FileSpan endSourceSpan;\n\n Element._(this.localName, [this.namespaceUri]) : super._();\n\n Element.tag(this.localName)\n : namespaceUri = Namespaces.html,\n super._();\n\n static final _startTagRegexp = RegExp('<(\\\\w+)');\n\n static final _customParentTagMap = const {\n 'body': 'html',\n 'head': 'html',\n 'caption': 'table',\n 'td': 'tr',\n 'colgroup': 'table',\n 'col': 'colgroup',\n 'tr': 'tbody',\n 'tbody': 'table',\n 'tfoot': 'table',\n 'thead': 'table',\n 'track': 'audio',\n };\n\n // TODO(jmesserly): this is from dart:html _ElementFactoryProvider...\n // TODO(jmesserly): have a look at fixing some things in dart:html, in\n // particular: is the parent tag map complete? Is it faster without regexp?\n // TODO(jmesserly): for our version we can do something smarter in the parser.\n // All we really need is to set the correct parse state.\n factory Element.html(String html) {\n // TODO(jacobr): this method can be made more robust and performant.\n // 1) Cache the dummy parent elements required to use innerHTML rather than\n // creating them every call.\n // 2) Verify that the html does not contain leading or trailing text nodes.\n // 3) Verify that the html does not contain both and tags.\n // 4) Detatch the created element from its dummy parent.\n var parentTag = 'div';\n String tag;\n final match = _startTagRegexp.firstMatch(html);\n if (match != null) {\n tag = match.group(1).toLowerCase();\n if (_customParentTagMap.containsKey(tag)) {\n parentTag = _customParentTagMap[tag];\n }\n }\n\n var fragment = parseFragment(html, container: parentTag);\n Element element;\n if (fragment.children.length == 1) {\n element = fragment.children[0];\n } else if (parentTag == 'html' && fragment.children.length == 2) {\n // You'll always get a head and a body when starting from html.\n element = fragment.children[tag == 'head' ? 0 : 1];\n } else {\n throw ArgumentError('HTML had ${fragment.children.length} '\n 'top level elements but 1 expected');\n }\n element.remove();\n return element;\n }\n\n @override\n int get nodeType => Node.ELEMENT_NODE;\n\n // TODO(jmesserly): we can make this faster\n Element get previousElementSibling {\n if (parentNode == null) return null;\n var siblings = parentNode.nodes;\n for (var i = siblings.indexOf(this) - 1; i >= 0; i--) {\n var s = siblings[i];\n if (s is Element) return s;\n }\n return null;\n }\n\n Element get nextElementSibling {\n if (parentNode == null) return null;\n var siblings = parentNode.nodes;\n for (var i = siblings.indexOf(this) + 1; i < siblings.length; i++) {\n var s = siblings[i];\n if (s is Element) return s;\n }\n return null;\n }\n\n @override\n String toString() {\n var prefix = Namespaces.getPrefix(namespaceUri);\n return \"<${prefix == null ? '' : '$prefix '}$localName>\";\n }\n\n @override\n String get text => _getText(this);\n @override\n set text(String value) => _setText(this, value);\n\n /// Returns a fragment of HTML or XML that represents the element and its\n /// contents.\n String get outerHtml => _outerHtml;\n\n /// Returns a fragment of HTML or XML that represents the element's contents.\n /// Can be set, to replace the contents of the element with nodes parsed from\n /// the given string.\n String get innerHtml => _innerHtml;\n // TODO(jmesserly): deprecate in favor of:\n // \n set innerHtml(String value) {\n nodes.clear();\n // TODO(jmesserly): should be able to get the same effect by adding the\n // fragment directly.\n nodes.addAll(parseFragment(value, container: localName).nodes);\n }\n\n @override\n void _addOuterHtml(StringBuffer str) {\n // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-end.html#serializing-html-fragments\n // Element is the most complicated one.\n str.write('<');\n str.write(_getSerializationPrefix(namespaceUri));\n str.write(localName);\n\n if (attributes.isNotEmpty) {\n attributes.forEach((key, v) {\n // Note: AttributeName.toString handles serialization of attribute\n // namespace, if needed.\n str.write(' ');\n str.write(key);\n str.write('=\"');\n str.write(htmlSerializeEscape(v, attributeMode: true));\n str.write('\"');\n });\n }\n\n str.write('>');\n\n if (nodes.isNotEmpty) {\n if (localName == 'pre' ||\n localName == 'textarea' ||\n localName == 'listing') {\n final first = nodes[0];\n if (first is Text && first.data.startsWith('\\n')) {\n // These nodes will remove a leading \\n at parse time, so if we still\n // have one, it means we started with two. Add it back.\n str.write('\\n');\n }\n }\n\n _addInnerHtml(str);\n }\n\n // void elements must not have an end tag\n // http://dev.w3.org/html5/markup/syntax.html#void-elements\n if (!isVoidElement(localName)) str.write('');\n }\n\n static String _getSerializationPrefix(String uri) {\n if (uri == null ||\n uri == Namespaces.html ||\n uri == Namespaces.mathml ||\n uri == Namespaces.svg) {\n return '';\n }\n var prefix = Namespaces.getPrefix(uri);\n // TODO(jmesserly): the spec doesn't define \"qualified name\".\n // I'm not sure if this is correct, but it should parse reasonably.\n return prefix == null ? '' : '$prefix:';\n }\n\n @override\n Element clone(bool deep) {\n var result = Element._(localName, namespaceUri)\n ..attributes = LinkedHashMap.from(attributes);\n return _clone(result, deep);\n }\n\n // http://dom.spec.whatwg.org/#dom-element-id\n String get id {\n var result = attributes['id'];\n return result ?? '';\n }\n\n set id(String value) {\n attributes['id'] = '$value';\n }\n\n // http://dom.spec.whatwg.org/#dom-element-classname\n String get className {\n var result = attributes['class'];\n return result ?? '';\n }\n\n set className(String value) {\n attributes['class'] = '$value';\n }\n\n /// The set of CSS classes applied to this element.\n ///\n /// This set makes it easy to add, remove or toggle the classes applied to\n /// this element.\n ///\n /// element.classes.add('selected');\n /// element.classes.toggle('isOnline');\n /// element.classes.remove('selected');\n CssClassSet get classes => ElementCssClassSet(this);\n}\n\nclass Comment extends Node {\n String data;\n\n Comment(this.data) : super._();\n\n @override\n int get nodeType => Node.COMMENT_NODE;\n\n @override\n String toString() => '';\n\n @override\n void _addOuterHtml(StringBuffer str) {\n str.write('');\n }\n\n @override\n Comment clone(bool deep) => Comment(data);\n\n @override\n String get text => data;\n @override\n set text(String value) {\n data = value;\n }\n}\n\n// TODO(jmesserly): fix this to extend one of the corelib classes if possible.\n// (The requirement to remove the node from the old node list makes it tricky.)\n// TODO(jmesserly): is there any way to share code with the _NodeListImpl?\nclass NodeList extends ListProxy {\n // Note: this is conceptually final, but because of circular reference\n // between Node and NodeList we initialize it after construction.\n Node _parent;\n\n NodeList._();\n\n Node _setParent(Node node) {\n // Note: we need to remove the node from its previous parent node, if any,\n // before updating its parent pointer to point at our parent.\n node.remove();\n node.parentNode = _parent;\n return node;\n }\n\n @override\n void add(Node value) {\n if (value is DocumentFragment) {\n addAll(value.nodes);\n } else {\n super.add(_setParent(value));\n }\n }\n\n void addLast(Node value) => add(value);\n\n @override\n void addAll(Iterable collection) {\n // Note: we need to be careful if collection is another NodeList.\n // In particular:\n // 1. we need to copy the items before updating their parent pointers,\n // _flattenDocFragments does a copy internally.\n // 2. we should update parent pointers in reverse order. That way they\n // are removed from the original NodeList (if any) from the end, which\n // is faster.\n var list = _flattenDocFragments(collection);\n for (var node in list.reversed) {\n _setParent(node);\n }\n super.addAll(list);\n }\n\n @override\n void insert(int index, Node value) {\n if (value is DocumentFragment) {\n insertAll(index, value.nodes);\n } else {\n super.insert(index, _setParent(value));\n }\n }\n\n @override\n Node removeLast() => super.removeLast()..parentNode = null;\n\n @override\n Node removeAt(int i) => super.removeAt(i)..parentNode = null;\n\n @override\n void clear() {\n for (var node in this) {\n node.parentNode = null;\n }\n super.clear();\n }\n\n @override\n void operator []=(int index, Node value) {\n if (value is DocumentFragment) {\n removeAt(index);\n insertAll(index, value.nodes);\n } else {\n this[index].parentNode = null;\n super[index] = _setParent(value);\n }\n }\n\n // TODO(jmesserly): These aren't implemented in DOM _NodeListImpl, see\n // http://code.google.com/p/dart/issues/detail?id=5371\n @override\n void setRange(int start, int rangeLength, Iterable from,\n [int startFrom = 0]) {\n var fromVar = from as List;\n if (fromVar is NodeList) {\n // Note: this is presumed to make a copy\n fromVar = fromVar.sublist(startFrom, startFrom + rangeLength);\n }\n // Note: see comment in [addAll]. We need to be careful about the order of\n // operations if [from] is also a NodeList.\n for (var i = rangeLength - 1; i >= 0; i--) {\n this[start + i] = fromVar[startFrom + i];\n }\n }\n\n @override\n void replaceRange(int start, int end, Iterable newContents) {\n removeRange(start, end);\n insertAll(start, newContents);\n }\n\n @override\n void removeRange(int start, int rangeLength) {\n for (var i = start; i < rangeLength; i++) {\n this[i].parentNode = null;\n }\n super.removeRange(start, rangeLength);\n }\n\n @override\n void removeWhere(bool Function(Node) test) {\n for (var node in where(test)) {\n node.parentNode = null;\n }\n super.removeWhere(test);\n }\n\n @override\n void retainWhere(bool Function(Node) test) {\n for (var node in where((n) => !test(n))) {\n node.parentNode = null;\n }\n super.retainWhere(test);\n }\n\n @override\n void insertAll(int index, Iterable collection) {\n // Note: we need to be careful how we copy nodes. See note in addAll.\n var list = _flattenDocFragments(collection);\n for (var node in list.reversed) {\n _setParent(node);\n }\n super.insertAll(index, list);\n }\n\n List _flattenDocFragments(Iterable collection) {\n // Note: this function serves two purposes:\n // * it flattens document fragments\n // * it creates a copy of [collections] when `collection is NodeList`.\n var result = [];\n for (var node in collection) {\n if (node is DocumentFragment) {\n result.addAll(node.nodes);\n } else {\n result.add(node);\n }\n }\n return result;\n }\n}\n\n/// An indexable collection of a node's descendants in the document tree,\n/// filtered so that only elements are in the collection.\n// TODO(jmesserly): this was copied from dart:html\n// TODO(jmesserly): \"implements List\" is a workaround for analyzer bug.\nclass FilteredElementList extends IterableBase\n with ListMixin\n implements List {\n final List _childNodes;\n\n /// Creates a collection of the elements that descend from a node.\n ///\n /// Example usage:\n ///\n /// var filteredElements = new FilteredElementList(query(\"#container\"));\n /// // filteredElements is [a, b, c].\n FilteredElementList(Node node) : _childNodes = node.nodes;\n\n // We can't memoize this, since it's possible that children will be messed\n // with externally to this class.\n //\n // TODO(nweiz): we don't always need to create a new list. For example\n // forEach, every, any, ... could directly work on the _childNodes.\n List get _filtered => _childNodes.whereType().toList();\n\n @override\n void forEach(void Function(Element) f) {\n _filtered.forEach(f);\n }\n\n @override\n void operator []=(int index, Element value) {\n this[index].replaceWith(value);\n }\n\n @override\n set length(int newLength) {\n final len = length;\n if (newLength >= len) {\n return;\n } else if (newLength < 0) {\n throw ArgumentError('Invalid list length');\n }\n\n removeRange(newLength, len);\n }\n\n @override\n String join([String separator = '']) => _filtered.join(separator);\n\n @override\n void add(Element value) {\n _childNodes.add(value);\n }\n\n @override\n void addAll(Iterable iterable) {\n for (var element in iterable) {\n add(element);\n }\n }\n\n @override\n bool contains(Object element) {\n return element is Element && _childNodes.contains(element);\n }\n\n @override\n Iterable get reversed => _filtered.reversed;\n\n @override\n void sort([int Function(Element, Element) compare]) {\n throw UnsupportedError('TODO(jacobr): should we impl?');\n }\n\n @override\n void setRange(int start, int end, Iterable iterable,\n [int skipCount = 0]) {\n throw UnimplementedError();\n }\n\n @override\n void fillRange(int start, int end, [Element fillValue]) {\n throw UnimplementedError();\n }\n\n @override\n void replaceRange(int start, int end, Iterable iterable) {\n throw UnimplementedError();\n }\n\n @override\n void removeRange(int start, int end) {\n _filtered.sublist(start, end).forEach((el) => el.remove());\n }\n\n @override\n void clear() {\n // Currently, ElementList#clear clears even non-element nodes, so we follow\n // that behavior.\n _childNodes.clear();\n }\n\n @override\n Element removeLast() {\n final result = last;\n if (result != null) {\n result.remove();\n }\n return result;\n }\n\n @override\n Iterable map(T Function(Element) f) => _filtered.map(f);\n @override\n Iterable where(bool Function(Element) f) => _filtered.where(f);\n @override\n Iterable expand(Iterable Function(Element) f) => _filtered.expand(f);\n\n @override\n void insert(int index, Element value) {\n _childNodes.insert(index, value);\n }\n\n @override\n void insertAll(int index, Iterable iterable) {\n _childNodes.insertAll(index, iterable);\n }\n\n @override\n Element removeAt(int index) {\n final result = this[index];\n result.remove();\n return result;\n }\n\n @override\n bool remove(Object element) {\n if (element is! Element) return false;\n for (var i = 0; i < length; i++) {\n var indexElement = this[i];\n if (identical(indexElement, element)) {\n indexElement.remove();\n return true;\n }\n }\n return false;\n }\n\n @override\n Element reduce(Element Function(Element, Element) combine) {\n return _filtered.reduce(combine);\n }\n\n @override\n T fold(\n T initialValue, T Function(T previousValue, Element element) combine) {\n return _filtered.fold(initialValue, combine);\n }\n\n @override\n bool every(bool Function(Element) f) => _filtered.every(f);\n @override\n bool any(bool Function(Element) f) => _filtered.any(f);\n @override\n List toList({bool growable = true}) =>\n List.from(this, growable: growable);\n @override\n Set toSet() => Set.from(this);\n @override\n Element firstWhere(bool Function(Element) test, {Element Function() orElse}) {\n return _filtered.firstWhere(test, orElse: orElse);\n }\n\n @override\n Element lastWhere(bool Function(Element) test, {Element Function() orElse}) {\n return _filtered.lastWhere(test, orElse: orElse);\n }\n\n @override\n Element singleWhere(bool Function(Element) test,\n {Element Function() orElse}) {\n if (orElse != null) throw UnimplementedError('orElse');\n return _filtered.singleWhere(test);\n }\n\n @override\n Element elementAt(int index) {\n return this[index];\n }\n\n @override\n bool get isEmpty => _filtered.isEmpty;\n @override\n int get length => _filtered.length;\n @override\n Element operator [](int index) => _filtered[index];\n @override\n Iterator get iterator => _filtered.iterator;\n @override\n List sublist(int start, [int end]) => _filtered.sublist(start, end);\n @override\n Iterable getRange(int start, int end) =>\n _filtered.getRange(start, end);\n // TODO(sigmund): this should be typed Element, but we currently run into a\n // bug where ListMixin.indexOf() expects Object as the argument.\n @override\n int indexOf(Object element, [int start = 0]) =>\n _filtered.indexOf(element, start);\n\n // TODO(sigmund): this should be typed Element, but we currently run into a\n // bug where ListMixin.lastIndexOf() expects Object as the argument.\n @override\n int lastIndexOf(Object element, [int start]) {\n start ??= length - 1;\n return _filtered.lastIndexOf(element, start);\n }\n\n @override\n Element get first => _filtered.first;\n\n @override\n Element get last => _filtered.last;\n\n @override\n Element get single => _filtered.single;\n}\n\n// http://dom.spec.whatwg.org/#dom-node-textcontent\n// For Element and DocumentFragment\nString _getText(Node node) => (_ConcatTextVisitor()..visit(node)).toString();\n\nvoid _setText(Node node, String value) {\n node.nodes.clear();\n node.append(Text(value));\n}\n\nclass _ConcatTextVisitor extends TreeVisitor {\n final _str = StringBuffer();\n\n @override\n String toString() => _str.toString();\n\n @override\n void visitText(Text node) {\n _str.write(node.data);\n }\n}\n"},"__index_level_0__":{"kind":"number","value":0,"string":"0"}}},{"rowIdx":146370,"cells":{"repo_id":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages"},"file_path":{"kind":"string","value":"mirrored_repositories/chat_ui_stream_iii_example/firebase/functions/build/packages/html/dom_parsing.dart"},"content":{"kind":"string","value":"/// This library contains extra APIs that aren't in the DOM, but are useful\n/// when interacting with the parse tree.\nlibrary dom_parsing;\n\nimport 'dom.dart';\nimport 'src/constants.dart' show rcdataElements;\n\n/// A simple tree visitor for the DOM nodes.\nclass TreeVisitor {\n void visit(Node node) {\n switch (node.nodeType) {\n case Node.ELEMENT_NODE:\n return visitElement(node);\n case Node.TEXT_NODE:\n return visitText(node);\n case Node.COMMENT_NODE:\n return visitComment(node);\n case Node.DOCUMENT_FRAGMENT_NODE:\n return visitDocumentFragment(node);\n case Node.DOCUMENT_NODE:\n return visitDocument(node);\n case Node.DOCUMENT_TYPE_NODE:\n return visitDocumentType(node);\n default:\n throw UnsupportedError('DOM node type ${node.nodeType}');\n }\n }\n\n void visitChildren(Node node) {\n // Allow for mutations (remove works) while iterating.\n for (var child in node.nodes.toList()) {\n visit(child);\n }\n }\n\n /// The fallback handler if the more specific visit method hasn't been\n /// overriden. Only use this from a subclass of [TreeVisitor], otherwise\n /// call [visit] instead.\n void visitNodeFallback(Node node) => visitChildren(node);\n\n void visitDocument(Document node) => visitNodeFallback(node);\n\n void visitDocumentType(DocumentType node) => visitNodeFallback(node);\n\n void visitText(Text node) => visitNodeFallback(node);\n\n // TODO(jmesserly): visit attributes.\n void visitElement(Element node) => visitNodeFallback(node);\n\n void visitComment(Comment node) => visitNodeFallback(node);\n\n void visitDocumentFragment(DocumentFragment node) => visitNodeFallback(node);\n}\n\n/// Converts the DOM tree into an HTML string with code markup suitable for\n/// displaying the HTML's source code with CSS colors for different parts of the\n/// markup. See also [CodeMarkupVisitor].\nString htmlToCodeMarkup(Node node) {\n return (CodeMarkupVisitor()..visit(node)).toString();\n}\n\n/// Converts the DOM tree into an HTML string with code markup suitable for\n/// displaying the HTML's source code with CSS colors for different parts of the\n/// markup. See also [htmlToCodeMarkup].\nclass CodeMarkupVisitor extends TreeVisitor {\n final StringBuffer _str;\n\n CodeMarkupVisitor() : _str = StringBuffer();\n\n @override\n String toString() => _str.toString();\n\n @override\n void visitDocument(Document node) {\n _str.write('
');\n    visitChildren(node);\n    _str.write('
');\n }\n\n @override\n void visitDocumentType(DocumentType node) {\n _str.write('&lt;!DOCTYPE ${node.name}>'\n '');\n }\n\n @override\n void visitText(Text node) {\n writeTextNodeAsHtml(_str, node);\n }\n\n @override\n void visitElement(Element node) {\n final tag = node.localName;\n _str.write('&lt;$tag');\n if (node.attributes.isNotEmpty) {\n node.attributes.forEach((key, v) {\n v = htmlSerializeEscape(v, attributeMode: true);\n _str.write(' $key'\n '=\"$v\"');\n });\n }\n if (node.nodes.isNotEmpty) {\n _str.write('>');\n visitChildren(node);\n } else if (isVoidElement(tag)) {\n _str.write('>');\n return;\n }\n _str.write('&lt;/$tag>');\n }\n\n @override\n void visitComment(Comment node) {\n var data = htmlSerializeEscape(node.data);\n _str.write('&lt;!--$data-->');\n }\n}\n\n// TODO(jmesserly): reconcile this with dart:web htmlEscape.\n// This one might be more useful, as it is HTML5 spec compliant.\n/// Escapes [text] for use in the\n/// [HTML fragment serialization algorithm][1]. In particular, as described\n/// in the [specification][2]:\n///\n/// - Replace any occurrence of the `&` character by the string `&amp;`.\n/// - Replace any occurrences of the U+00A0 NO-BREAK SPACE character by the\n/// string `&nbsp;`.\n/// - If the algorithm was invoked in [attributeMode], replace any occurrences\n/// of the `\"` character by the string `&quot;`.\n/// - If the algorithm was not invoked in [attributeMode], replace any\n/// occurrences of the `<` character by the string `&lt;`, and any occurrences\n/// of the `>` character by the string `&gt;`.\n///\n/// [1]: http://www.whatwg.org/specs/web-apps/current-work/multipage/the-end.html#serializing-html-fragments\n/// [2]: http://www.whatwg.org/specs/web-apps/current-work/multipage/the-end.html#escapingString\nString htmlSerializeEscape(String text, {bool attributeMode = false}) {\n // TODO(jmesserly): is it faster to build up a list of codepoints?\n // StringBuffer seems cleaner assuming Dart can unbox 1-char strings.\n StringBuffer result;\n for (var i = 0; i < text.length; i++) {\n var ch = text[i];\n String replace;\n switch (ch) {\n case '&':\n replace = '&amp;';\n break;\n case '\\u00A0' /*NO-BREAK SPACE*/ :\n replace = '&nbsp;';\n break;\n case '\"':\n if (attributeMode) replace = '&quot;';\n break;\n case '<':\n if (!attributeMode) replace = '&lt;';\n break;\n case '>':\n if (!attributeMode) replace = '&gt;';\n break;\n }\n if (replace != null) {\n result ??= StringBuffer(text.substring(0, i));\n result.write(replace);\n } else if (result != null) {\n result.write(ch);\n }\n }\n\n return result != null ? result.toString() : text;\n}\n\n/// Returns true if this tag name is a void element.\n/// This method is useful to a pretty printer, because void elements must not\n/// have an end tag.\n/// See also: .\nbool isVoidElement(String tagName) {\n switch (tagName) {\n case 'area':\n case 'base':\n case 'br':\n case 'col':\n case 'command':\n case 'embed':\n case 'hr':\n case 'img':\n case 'input':\n case 'keygen':\n case 'link':\n case 'meta':\n case 'param':\n case 'source':\n case 'track':\n case 'wbr':\n return true;\n }\n return false;\n}\n\n/// Serialize text node according to:\n/// \nvoid writeTextNodeAsHtml(StringBuffer str, Text node) {\n // Don't escape text for certain elements, notably