{"version":3,"sources":["jsdelivr-header.js","/npm/json2mq@0.2.0/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,IAAI,aAAe,QAAQ,+BAEvB,YAAc,SAAU,GAE1B,MADS,kBACC,KAAK,EACjB,EAEI,OAAS,SAAU,GACrB,IAAI,EAAK,GACL,EAAW,OAAO,KAAK,GAmB3B,OAlBA,EAAS,SAAQ,SAAU,EAAS,GAClC,IAAI,EAAQ,EAAI,GAChB,EAAU,aAAa,GAEnB,YAAY,IAA6B,iBAAV,IACjC,GAAgB,MAGhB,IADY,IAAV,EACI,GACa,IAAV,EACH,OAAS,EAET,IAAM,EAAU,KAAO,EAAQ,IAEnC,EAAQ,EAAS,OAAO,IAC1B,GAAM,QAEV,IACO,CACT,EAEI,QAAU,SAAU,GACtB,IAAI,EAAK,GACT,MAAqB,iBAAV,EACF,EAGL,aAAiB,OACnB,EAAM,SAAQ,SAAU,EAAG,GACzB,GAAM,OAAO,GACT,EAAQ,EAAM,OAAO,IACvB,GAAM,KAEV,IACO,GAGF,OAAO,EAChB,EAEA,OAAO,QAAU","file":"/npm/json2mq@0.2.0/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.37.0.\n * Original file: /npm/json2mq@0.2.0/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","var camel2hyphen = require('string-convert/camel2hyphen');\n\nvar isDimension = function (feature) {\n  var re = /[height|width]$/;\n  return re.test(feature);\n};\n\nvar obj2mq = function (obj) {\n  var mq = '';\n  var features = Object.keys(obj);\n  features.forEach(function (feature, index) {\n    var value = obj[feature];\n    feature = camel2hyphen(feature);\n    // Add px to dimension features\n    if (isDimension(feature) && typeof value === 'number') {\n      value = value + 'px';\n    }\n    if (value === true) {\n      mq += feature;\n    } else if (value === false) {\n      mq += 'not ' + feature;\n    } else {\n      mq += '(' + feature + ': ' + value + ')';\n    }\n    if (index < features.length-1) {\n      mq += ' and '\n    }\n  });\n  return mq;\n};\n\nvar json2mq = function (query) {\n  var mq = '';\n  if (typeof query === 'string') {\n    return query;\n  }\n  // Handling array of media queries\n  if (query instanceof Array) {\n    query.forEach(function (q, index) {\n      mq += obj2mq(q);\n      if (index < query.length-1) {\n        mq += ', '\n      }\n    });\n    return mq;\n  }\n  // Handling single media query\n  return obj2mq(query);\n};\n\nmodule.exports = json2mq;"]}