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AAQ,MAAM,EAChB,CACF","file":"/npm/gltfjsx-webp@1.0.7/cli.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/gltfjsx-webp@1.0.7/cli.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","#!/usr/bin/env node\n'use strict'\nimport meow from 'meow'\nimport path from 'path'\nimport { fileURLToPath } from 'url'\nimport { dirname } from 'path'\nimport gltfjsx from './src/gltfjsx.js'\n\nconst __filename = fileURLToPath(import.meta.url)\nconst __dirname = dirname(__filename)\n\nconst cli = meow(\n  `\n\tUsage\n\t  $ npx gltfjsx [Model.js] [options]\n\n\tOptions\n    --types, -t         Add Typescript definitions\n    --keepnames, -k     Keep original names\n    --keepgroups, -K    Keep (empty) groups\n    --meta, -m          Include metadata (as userData)\n    --shadows, s        Let meshes cast and receive shadows\n    --printwidth, w     Prettier printWidth (default: 120)\n    --precision, -p     Number of fractional digits (default: 2)\n    --draco, -d         Draco binary path\n    --root, -r          Sets directory from which .gltf file is served\n    --instance, -i      Instance re-occuring geometry\n    --instanceall, -I   Instance every geometry (for cheaper re-use)\n    --transform, -T     Transform the asset for the web (draco, prune, resize)\n    --aggressive, -a    Aggressively prune the graph (empty groups, transform overlap) \n    --debug, -D         Debug output\n`,\n  {\n    importMeta: import.meta,\n    flags: {\n      types: { type: 'boolean', alias: 't' },\n      keepnames: { type: 'boolean', alias: 'k' },\n      keepgroups: { type: 'boolean', alias: 'K' },\n      shadows: { type: 'boolean', alias: 's' },\n      printwidth: { type: 'number', alias: 'p', default: 1000 },\n      meta: { type: 'boolean', alias: 'm' },\n      precision: { type: 'number', alias: 'p', default: 2 },\n      draco: { type: 'string', alias: 'd' },\n      root: { type: 'string', alias: 'r' },\n      instance: { type: 'boolean', alias: 'i' },\n      instanceall: { type: 'boolean', alias: 'I' },\n      transform: { type: 'boolean', alias: 'T' },\n      aggressive: { type: 'boolean', alias: 'a' },\n      debug: { type: 'boolean', alias: 'D' },\n    },\n  }\n)\n\nif (cli.input.length === 0) {\n  console.log(cli.help)\n} else {\n  const config = { ...cli.flags }\n  const file = cli.input[0]\n  const filePath = path.resolve(__dirname, file)\n  let nameExt = file.match(/[-_\\w]+[.][\\w]+$/i)[0]\n  let name = nameExt.split('.').slice(0, -1).join('.')\n  const output = name.charAt(0).toUpperCase() + name.slice(1) + (config.types ? '.tsx' : '.js')\n  const showLog = (log) => {\n    console.info('log:', log)\n  }\n  try {\n    const response = await gltfjsx(file, output, { ...config, showLog, timeout: 0, delay: 1 })\n  } catch (e) {\n    console.error(e)\n  }\n}\n"]}