{"version":3,"file":"JSONIterableNode.cjs","sources":["../../../../../.yarn/__virtual__/react-json-tree-virtual-6a28170cd8/4/.yarn/berry/cache/react-json-tree-npm-0.19.0-c65c86bc20-10c0.zip/node_modules/react-json-tree/lib/JSONIterableNode.js"],"sourcesContent":["import React from 'react';\nimport JSONNestedNode from './JSONNestedNode.js';\n// Returns the \"n Items\" string for this node,\n// generating and caching it if it hasn't been created yet.\nfunction createItemString(data, limit) {\n    let count = 0;\n    let hasMore = false;\n    if (Number.isSafeInteger(data.size)) {\n        count = data.size;\n    }\n    else {\n        // eslint-disable-next-line no-unused-vars\n        for (const entry of data) {\n            if (limit && count + 1 > limit) {\n                hasMore = true;\n                break;\n            }\n            count += 1;\n        }\n    }\n    return `${hasMore ? '>' : ''}${count} ${count !== 1 ? 'entries' : 'entry'}`;\n}\n// Configures <JSONNestedNode> to render an iterable\nexport default function JSONIterableNode(props) {\n    return (React.createElement(JSONNestedNode, { ...props, nodeType: \"Iterable\", nodeTypeIndicator: \"()\", createItemString: createItemString, expandable: true }));\n}\n"],"names":["React"],"mappings":";;;;;AAIA,SAAS,iBAAiB,MAAM,OAAO;AACnC,MAAI,QAAQ;AACZ,MAAI,UAAU;AACd,MAAI,OAAO,cAAc,KAAK,IAAI,GAAG;AACjC,YAAQ,KAAK;AAAA,EACjB,OACK;AAED,eAAW,SAAS,MAAM;AACtB,UAAI,SAAS,QAAQ,IAAI,OAAO;AAC5B,kBAAU;AACV;AAAA,MACJ;AACA,eAAS;AAAA,IACb;AAAA,EACJ;AACA,SAAO,GAAG,UAAU,MAAM,EAAE,GAAG,KAAK,IAAI,UAAU,IAAI,YAAY,OAAO;AAC7E;AAEe,SAAS,iBAAiB,OAAO;AAC5C,SAAQA,eAAAA,QAAM,cAAc,gBAAgB,EAAE,GAAG,OAAO,UAAU,YAAY,mBAAmB,MAAM,kBAAoC,YAAY,KAAI,CAAE;AACjK;;","x_google_ignoreList":[0]}