{"version":3,"sources":["jsdelivr-header.js","/npm/ice-plugin-fusion-material@0.1.2/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,MAAM,KAAO,QAAQ,QACf,GAAK,QAAQ,MACb,WAAa,QAAQ,sBAGrB,kBAAoB,CAAC,EAAiB,EAAM,EAAO,KACvD,MAAM,EAAW,GAAG,aAAa,EAAiB,QAC5C,EAAU,KAAK,MAAM,GAC3B,IAAK,IAAI,EAAI,EAAG,EAAI,EAAM,OAAQ,IAChC,EAAQ,GAAM,MAAM,GAAG,KAAO,EAAM,GACpC,EAAQ,GAAM,MAAM,GAAG,WAAa,EAAY,GAElD,GAAG,cAAc,EAAiB,KAAK,UAAU,EAAS,KAAM,MAAM,EAGxE,OAAO,QAAU,EACf,UACA,aAGA,EAAO,cAAc,KAEnB,MAAM,IAAE,EAAG,QAAE,GAAY,EACnB,EAAkB,KAAK,KAAK,EAAS,gBACrC,EAAiB,KAAK,KAAK,EAAS,QAAS,SACnD,GAAG,UAAU,GAEb,MAAM,EAAQ,GACR,EAAc,GACpB,GAAI,EAAI,aAAe,EAAI,YAAY,MAErC,WAAW,EAAS,oBAAqB,gCAAiC,iCAAkC,KAC5G,kBAAkB,EAAiB,cAAe,CAAC,gCAAiC,CAAC,qCAElF,GAAI,EAAI,gBAAkB,EAAI,eAAe,MAAO,CAEvD,IAAK,IAAI,EAAI,EAAG,EAAI,EAAI,eAAe,MAAM,OAAQ,IACnD,WAAW,EAAS,oBAAqB,qBAAqB,QAAS,qBAAqB,SAAU,IAAM,EAAI,eAAe,MAAM,GAAG,MACxI,EAAM,KAAK,mBAAmB,UAC9B,EAAY,KAAK,mBAAmB,SAEtC,kBAAkB,EAAiB,iBAAkB,EAAO,EAC9D,IACA","file":"/npm/ice-plugin-fusion-material@0.1.2/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/ice-plugin-fusion-material@0.1.2/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","const path = require('path');\nconst fs = require('fs');\nconst screenShot = require('./utils/screenShot');\n\n// Update package.json\nconst updatePackageJson = (packageJsonPath, type, htmls, screenshots) => {\n  const jsonData = fs.readFileSync(packageJsonPath, 'utf8');\n  const jsonObj = JSON.parse(jsonData);\n  for (let i = 0; i < htmls.length; i++) {\n    jsonObj[type].views[i].html = htmls[i];\n    jsonObj[type].views[i].screenshot = screenshots[i];\n  }\n  fs.writeFileSync(packageJsonPath, JSON.stringify(jsonObj, null, '  '));\n};\n\nmodule.exports = ({\n  context,\n  onHook,\n}) => {\n  // after the build script finished\n  onHook('afterBuild', () => {\n    // get package.json and rootDir\n    const { pkg, rootDir } = context;\n    const packageJsonPath = path.join(rootDir, 'package.json');\n    const outputRootPath = path.join(rootDir, 'build', 'views');\n    fs.mkdirSync(outputRootPath);\n    // get htmls and screenshots if blockConfig.views or scaffoldConfig.views exist\n    const htmls = [];\n    const screenshots = [];\n    if (pkg.blockConfig && pkg.blockConfig.views) {\n      // block type\n      screenShot(rootDir, '/build/index.html', './build/views/block_view1.png', './build/views/block_view1.html', 2000);\n      updatePackageJson(packageJsonPath, 'blockConfig', ['build/views/block_view1.html'], ['build/views/block_view1.png']);\n    } \n    else if (pkg.scaffoldConfig && pkg.scaffoldConfig.views) {\n      // scaffold type\n      for (let i = 0; i < pkg.scaffoldConfig.views.length; i++) {\n        screenShot(rootDir, '/build/index.html', `./build/views/page${i}.png`, `./build/views/page${i}.html`, 2000, pkg.scaffoldConfig.views[i].path);\n        htmls.push(`build/views/page${i}.html`);\n        screenshots.push(`build/views/page${i}.png`);\n      }\n      updatePackageJson(packageJsonPath, 'scaffoldConfig', htmls, screenshots);\n    }\n  });\n};\n"]}