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T,SAAS,GAWX,GARuB,iBAAZ,IACT,EAAK,QAAU,GAGM,iBAAZ,IACT,EAAU,CAAC,QAG0B,IAA5B,EAAQ,gBAAgC,CACjD,IAAI,EAAW,SAAU,EAAQ,SACjC,EAAQ,QAAU,EAAU,EAAQ,gBACtC,CAKA,GAHA,EAAK,QAAU,EAAQ,SAAW,EAAK,QACvC,EAAK,QAAU,EAAQ,SAAW,EAAK,aAEF,IAA1B,EAAQ,cAUjB,OADA,EAAgB,EAAQ,cACjB,EAAc,GAAO,MAAK,SAAS,GACpC,EAAI,KACN,EAAG,KAAM,EAEb,IAAG,OAAO,IACR,EAAG,KAAM,EAAK,IAdhB,IAAI,OAAO,CAAC,IAAO,MAAK,SAAS,GAE3B,EAAI,KACN,EAAG,KAAM,EAEb,IACA,GAAW,CAtDb,MAFE,EAAG,KAAK,EAqEZ,GACF,EACA,IAAK","file":"/npm/gulp-prompt@1.2.0/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.37.0.\n * Original file: /npm/gulp-prompt@1.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 inq = require('inquirer'),\n  es  = require('event-stream'),\n  template = require(\"lodash.template\");\n\nmodule.exports = {\n\n  /**\n   * The following method will act as a proxy to the inquirer\n   * prompt function.  It will pass the questions object directly to \n   * inqurier's prompt function\n   * @param {*} questions\n   * @param {*} callback\n   */\n  prompt: function(questions, callback) {\n    var prompted = false;\n    return es.map(function(file, cb) {\n\n      /**\n       * The following chainHandler was designed to be called recursively so as to allow\n       * users the ability to chain multple calls to inquirer together.  It will stop \n       * calls to the chain handler when the chain function returns undefined.\n       * @param {objects} options \n       */\n      var chainHandler = function( options ){\n        \n        return new Promise( (resolve,reject)=>{\n            inq.prompt([options]).then( resp =>{\n              let opts = chainFunction( options, resp );\n              if( typeof opts === 'undefined'){\n                return resolve('response');\n              }else{\n                chainHandler( opts );\n              }\n            }).catch( err =>{\n              reject( 'Unexpected Error');\n            });\n        });\n      }\n\n      if (prompted === true) {\n        cb(null,file);\n        return;\n      }\n\n      if (!questions instanceof Array) {\n        questions = [questions];\n      }\n\n      if (typeof callback !== 'function') {\n        callback = function(){};\n      }\n      if( typeof questions.chainFunction === 'undefined' ){\n        inq.prompt(questions).then(function(res) {\n          callback(res);\n          cb(null, file);\n        });\n\n        prompted = true;\n      }else{\n        chainFunction = questions.chainFunction;\n        return chainHandler( questions ).then(function(res) {\n          if (res.val) {\n            cb(null, file);\n          }\n        }).catch( err => {\n          cb(null, file);\n        });\n  \n        prompted = true;\n      }\n    });\n  },\n\n  confirm: function(options) {\n    var prompted = false;\n    var chainFunction;\n    return es.map(function(file, cb) {\n\n      if (prompted === true) {\n        cb(null,file);\n        return;\n      }\n\n      /**\n       * The following chainHandler was designed to be called recursively so as to allow\n       * users the ability to chain multple calls to inquirer together.  It will stop \n       * calls to the chain handler when the chain function returns undefined.\n       * @param {objects} options \n       */\n      var chainHandler = function( options ){\n        \n        return new Promise( (resolve,reject)=>{\n            inq.prompt([options]).then( resp =>{\n              var opts = chainFunction( options, resp );\n              if( typeof opts === 'undefined'){\n                return resolve('response');\n              }else{\n                chainHandler( opts );\n              }\n            }).catch( err =>{\n              reject( 'Unexpected Error');\n            });\n        });\n      }\n\n      var opts = {\n        type: 'confirm',\n        name: 'val',\n        message: 'Are you sure?',\n        default: false\n      };\n\n      if (typeof options === 'string') {\n        opts.message = options;\n      }\n\n      if (typeof options !== 'object') {\n        options = {};\n      }\n\n      if( typeof options.templateOptions !== 'undefined'){\n        var compiled = template( options.message );\n        options.message = compiled( options.templateOptions);\n      }\n\n      opts.message = options.message || opts.message;\n      opts.default = options.default || opts.default;\n\n      if( typeof options.chainFunction === 'undefined'){\n        inq.prompt([opts]).then(function(res) {\n          \n          if (res.val) {\n            cb(null, file);\n          }\n        });\n        prompted = true;\n      }else{\n        chainFunction = options.chainFunction;\n        return chainHandler( opts ).then(function(res) {\n          if (res.val) {\n            cb(null, file);\n          }\n        }).catch( err => {\n          cb(null, file);\n        });\n  \n        prompted = true;\n      }\n    });\n  },\n  inq: inq\n};\n"]}