{"version":3,"sources":["jsdelivr-header.js","/npm/cs-blue-button-generate@1.5.11/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,aAOA,MAAM,IAAM,QAAQ,oBAEd,OAAS,QAAQ,gBACjB,cAAgB,QAAQ,uBAExB,KAAO,IAAI,OAEX,cAAgB,QAAQ,qBAExB,cAAgB,WAClB,MAAM,EAAO,CACT,cAAe,SAAU,GACrB,IAAI,EAAQ,KAAK,WAAW,IAAiB,EAG7C,QAFE,EACF,KAAK,WAAW,GAAgB,EACzB,IAAM,EAAe,CAChC,EACA,cAAe,SAAU,GAErB,MAAO,IAAM,GADC,KAAK,WAAW,IAAiB,EAEnD,GAGJ,OAAO,SAAU,GACb,MAAM,EAAS,OAAO,OAAO,GAS7B,OARA,EAAO,WAAa,CAAC,EACjB,EAAQ,MAAQ,EAAQ,aACxB,EAAO,OAAS,KAAK,UAAU,EAAQ,KAAM,4BAE7C,EAAO,OAAS,KAEpB,EAAO,kBAAoB,EAAQ,kBAE5B,CACX,CACH,CA1BqB,GA4BhB,SAAW,QAAQ,SAAW,SAAU,EAAU,EAAO,GACtD,EAAQ,gBACT,EAAQ,cAAgB,eAG5B,MAAM,EAAU,cAAc,GAC9B,OAAO,OAAO,OAAO,cAAc,KAAK,EAAQ,eAAgB,EAAO,EAC3E,EAEA,QAAQ,YAAc,SAAU,EAAO,GAGnC,OAFA,EAAU,GAAW,CAAC,GACd,KAAO,EAAM,KACd,SAAS,cAAc,IAAK,EAAO,EAC9C,EAEA,QAAQ,WAAa,QAAQ,oBAC7B,QAAQ,WAAa,QAAQ,oBAC7B,QAAQ,UAAY,QAAQ,mBAC5B,QAAQ,gBAAkB,QAAQ,yBAClC,QAAQ,UAAY,QAAQ","file":"/npm/cs-blue-button-generate@1.5.11/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/cs-blue-button-generate@1.5.11/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","\"use strict\";\r\n\r\n/*\r\nThis script converts CCDA data in JSON format (originally generated from a Continuity of Care Document (CCD) in\r\nstandard XML/CCDA format) back to XML/CCDA format.\r\n*/\r\n\r\nconst bbu = require(\"blue-button-util\");\r\n\r\nconst engine = require('./lib/engine');\r\nconst documentLevel = require('./lib/documentLevel');\r\n\r\nconst bbuo = bbu.object;\r\n\r\nconst html_renderer = require('./lib/htmlHeaders');\r\n\r\nconst createContext = (function () {\r\n    const base = {\r\n        nextReference: function (referenceKey) {\r\n            let index = this.references[referenceKey] || 0;\r\n            ++index;\r\n            this.references[referenceKey] = index;\r\n            return \"#\" + referenceKey + index;\r\n        },\r\n        sameReference: function (referenceKey) {\r\n            const index = this.references[referenceKey] || 0;\r\n            return \"#\" + referenceKey + index;\r\n        }\r\n    };\r\n\r\n    return function (options) {\r\n        const result = Object.create(base);\r\n        result.references = {};\r\n        if (options.meta && options.addUniqueIds) {\r\n            result.rootId = bbuo.deepValue(options.meta, 'identifiers.0.identifier');\r\n        } else {\r\n            result.rootId = null;\r\n        }\r\n        result.preventNullFlavor = options.preventNullFlavor;\r\n\r\n        return result;\r\n    };\r\n})();\r\n\r\nconst generate = exports.generate = function (template, input, options) {\r\n    if (!options.html_renderer) {\r\n        options.html_renderer = html_renderer;\r\n    }\r\n\r\n    const context = createContext(options);\r\n    return engine.create(documentLevel.ccd2(options.html_renderer), input, context);\r\n};\r\n\r\nexports.generateCCD = function (input, options) {\r\n    options = options || {};\r\n    options.meta = input.meta;\r\n    return generate(documentLevel.ccd, input, options);\r\n};\r\n\r\nexports.fieldLevel = require(\"./lib/fieldLevel\");\r\nexports.entryLevel = require(\"./lib/entryLevel\");\r\nexports.leafLevel = require('./lib/leafLevel');\r\nexports.contentModifier = require(\"./lib/contentModifier\");\r\nexports.condition = require('./lib/condition');\r\n"]}