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,EAAS,IAAI,4BAC9B,KAAM,EAAS,IAAI,iBAAmB,WACtC,QAAS,EAAS,IAAI,oBAEvB,KAAM,MAOP,GAHA,EAAE,OAAO,EAAQ,GAGb,EAAS,IAAI,qBAChB,IACC,IAAI,EAAmB,WAAW,SAAS,gBAC3C,EAAO,WAAa,CACnB,WAAY,EAAS,IAAI,qBAAqB,WAC9C,QAAS,EAAS,IAAI,qBAAqB,QAC3C,UAAW,EAAiB,cAAc,UAC1C,UAAW,EAAiB,cAAc,UAC1C,OAAQ,EAAS,IAAI,sBAAwB,GAC7C,QAAS,EAAS,IAAI,sBACtB,SAAU,WAAW,UAEtB,EAAO,qBAAuB,WAAW,sBAC1C,CAAE,MAAM,GACP,KAAU,wBAAN,EACG,IAAI,MAAM,wHAGV,CAER,CAID,EAAO,YAAc,EAAE,KAAK,EAAQ,IAAK,SAAU,UAAW,MAAO,KAAM,QAAS,OAAQ,cAE5F,IAAI,EAAO,EAAS,EAAE,OAAO,EAAQ,IAErC,EAAI,KAAK,EACV,EAWA,SAAS,UAAU,gBAAkB,SAAS,EAAM,EAAe,GAE9D,MAAM,QAAQ,GACjB,MAAM,KAAK,GAAM,SAAS,EAAK,GAC9B,EAAI,gBAAgB,EAAe,EACpC,GAAG,GACO,GAAQ,EAAK,gBACvB,EAAK,gBAAgB,EAAe,GAEpC,GAGF,EAQA,SAAS,UAAU,QAAU,CAAC,EAC9B,SAAS,UAAU,QAAQ,IAAM,SAAS,EAAM,GAE/C,GAAI,SAAS,IAAI,UAAW,CAC3B,IAAI,EAAS,uDACb,QAAQ,IAAI,EAAS,eAAiB,EAAO,QAAU,EAAM,EAC9D,CAED,EAQA,SAAS,QAAU,QAAQ,kBAAkB,QAI7C,SAAS,QAAU,QAAQ","file":"/npm/47pages-keystone@0.0.5/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.19.2.\n * Original file: /npm/47pages-keystone@0.0.5/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 fs = require('fs'),\n\tpath = require('path'),\n\t_ = require('underscore'),\n\texpress = require('express'),\n\tasync = require('async'),\n\tjade = require('jade'),\n\tmoment = require('moment'),\n\tnumeral = require('numeral'),\n\tcloudinary = require('cloudinary'),\n\tutils = require('keystone-utils'),\n\tauth = require('./routes/api/auth');\n\nvar templateCache = {};\n\n/**\n * Don't use process.cwd() as it breaks module encapsulation\n * Instead, let's use module.parent if it's present, or the module itself if there is no parent (probably testing keystone directly if that's the case)\n * This way, the consuming app/module can be an embedded node_module and path resolutions will still work\n * (process.cwd() breaks module encapsulation if the consuming app/module is itself a node_module)\n */\nvar moduleRoot = (function(_rootPath) {\n\tvar parts = _rootPath.split(path.sep);\n\tparts.pop(); //get rid of /node_modules from the end of the path\n\treturn parts.join(path.sep);\n})(module.parent ? module.parent.paths[0] : module.paths[0]);\n\n\n/**\n * Keystone Class\n *\n * @api public\n */\n\nvar Keystone = function() {\n\n\tthis.lists = {};\n\tthis.paths = {};\n\tthis._options = {\n\t\t'name': 'Keystone',\n\t\t'brand': 'Keystone',\n\t\t'compress': true,\n\t\t'headless': false,\n\t\t'logger': 'dev',\n\t\t'auto update': false,\n\t\t'model prefix': null\n\t};\n\tthis._pre = {\n\t\troutes: [],\n\t\trender: []\n\t};\n\tthis._redirects = {};\n\n\t// expose express\n\n\tthis.express = express;\n\n\n\t// init environment defaults\n\n\tthis.set('env', process.env.NODE_ENV || 'development');\n\n\tthis.set('port', process.env.PORT || process.env.OPENSHIFT_NODEJS_PORT);\n\tthis.set('host', process.env.HOST || process.env.IP || process.env.OPENSHIFT_NODEJS_IP);\n\tthis.set('listen', process.env.LISTEN);\n\n\tthis.set('ssl', process.env.SSL);\n\tthis.set('ssl port', process.env.SSL_PORT);\n\tthis.set('ssl host', process.env.SSL_HOST || process.env.SSL_IP);\n\tthis.set('ssl key', process.env.SSL_KEY);\n\tthis.set('ssl cert', process.env.SSL_CERT);\n\n\tthis.set('cookie secret', process.env.COOKIE_SECRET);\n\tthis.set('cookie signin', (this.get('env') === 'development') ? true : false);\n\n\tthis.set('embedly api key', process.env.EMBEDLY_API_KEY || process.env.EMBEDLY_APIKEY);\n\tthis.set('mandrill api key', process.env.MANDRILL_API_KEY || process.env.MANDRILL_APIKEY);\n\tthis.set('mandrill username', process.env.MANDRILL_USERNAME);\n\tthis.set('google api key', process.env.GOOGLE_BROWSER_KEY);\n\tthis.set('google server api key', process.env.GOOGLE_SERVER_KEY);\n\tthis.set('ga property', process.env.GA_PROPERTY);\n\tthis.set('ga domain', process.env.GA_DOMAIN);\n\tthis.set('chartbeat property', process.env.CHARTBEAT_PROPERTY);\n\tthis.set('chartbeat domain', process.env.CHARTBEAT_DOMAIN);\n\tthis.set('allowed ip ranges', process.env.ALLOWED_IP_RANGES);\n\n\tif (process.env.S3_BUCKET && process.env.S3_KEY && process.env.S3_SECRET) {\n\t\tthis.set('s3 config', { bucket: process.env.S3_BUCKET, key: process.env.S3_KEY, secret: process.env.S3_SECRET, region: process.env.S3_REGION });\n\t}\n\n\tif (process.env.AZURE_STORAGE_ACCOUNT && process.env.AZURE_STORAGE_ACCESS_KEY) {\n\t\tthis.set('azurefile config', { account: process.env.AZURE_STORAGE_ACCOUNT, key: process.env.AZURE_STORAGE_ACCESS_KEY });\n\t}\n\n\tif (process.env.CLOUDINARY_URL) {\n\t\t// process.env.CLOUDINARY_URL is processed by the cloudinary package when this is set\n\t\tthis.set('cloudinary config', true);\n\t}\n\n\t// Attach middleware packages, bound to this instance\n\tthis.initAPI = require('./lib/middleware/initAPI')(this);\n\n};\n\n_.extend(Keystone.prototype, require('./lib/core/options')(moduleRoot));\n\n\n/**\n * Registers a pre-event handler.\n *\n * Valid events include:\n * - `routes` - calls the function before any routes are matched, after all other middleware\n *\n * @param {String} event\n * @param {Function} function to call\n * @api public\n */\n\nKeystone.prototype.pre = function(event, fn) {\n\tif (!this._pre[event]) {\n\t\tthrow new Error('keystone.pre() Error: event ' + event + ' does not exist.');\n\t}\n\tthis._pre[event].push(fn);\n\treturn this;\n};\n\n\nKeystone.prototype.prefixModel = function (key) {\n\tvar modelPrefix = this.get('model prefix');\n\n\tif (modelPrefix)\n\t\tkey = modelPrefix + '_' + key;\n\n\treturn require('mongoose/lib/utils').toCollectionName(key);\n};\n\n/* Attach core functionality to Keystone.prototype */\nKeystone.prototype.init = require('./lib/core/init');\nKeystone.prototype.initNav = require('./lib/core/initNav');\nKeystone.prototype.connect = require('./lib/core/connect');\nKeystone.prototype.start = require('./lib/core/start');\nKeystone.prototype.mount = require('./lib/core/mount');\nKeystone.prototype.routes = require('./lib/core/routes');\nKeystone.prototype.static = require('./lib/core/static');\nKeystone.prototype.importer = require('./lib/core/importer');\nKeystone.prototype.createItems = require('./lib/core/createItems');\nKeystone.prototype.redirect = require('./lib/core/redirect');\nKeystone.prototype.list = require('./lib/core/list');\nKeystone.prototype.getOrphanedLists = require('./lib/core/getOrphanedLists');\nKeystone.prototype.bindEmailTestRoutes = require('./lib/core/bindEmailTestRoutes');\nKeystone.prototype.wrapHTMLError = require('./lib/core/wrapHTMLError');\n\n\n/**\n * The exports object is an instance of Keystone.\n *\n * @api public\n */\n\nvar keystone = module.exports = exports = new Keystone();\n\n// Expose modules and Classes\nkeystone.utils = utils;\nkeystone.content = require('./lib/content');\nkeystone.List = require('./lib/list');\nkeystone.Field = require('./lib/field');\nkeystone.Field.Types = require('./lib/fieldTypes');\nkeystone.View = require('./lib/view');\nkeystone.Email = require('./lib/email');\n\nkeystone.security = {\n\tcsrf: require('./lib/security/csrf')\n};\n\n\n/**\n * returns all .js modules (recursively) in the path specified, relative\n * to the module root (where the keystone project is being consumed from).\n *\n * ####Example:\n *\n *     var models = keystone.import('models');\n *\n * @param {String} dirname\n * @api public\n */\n\nKeystone.prototype.import = function(dirname) {\n\n\tvar initialPath = path.join(moduleRoot, dirname);\n\n\tvar doImport = function(fromPath) {\n\n\t\tvar imported = {};\n\n\t\tfs.readdirSync(fromPath).forEach(function(name) {\n\n\t\t\tvar fsPath = path.join(fromPath, name),\n\t\t\tinfo = fs.statSync(fsPath);\n\n\t\t\t// recur\n\t\t\tif (info.isDirectory()) {\n\t\t\t\timported[name] = doImport(fsPath);\n\t\t\t} else {\n\t\t\t\t// only import .js or .coffee files\n\t\t\t\tvar parts = name.split('.');\n\t\t\t\tvar ext = parts.pop();\n\t\t\t\tif (ext === 'js' || ext === 'coffee') {\n\t\t\t\t\timported[parts.join('-')] = require(fsPath);\n\t\t\t\t}\n\t\t\t}\n\n\t\t});\n\n\t\treturn imported;\n\t};\n\n\treturn doImport(initialPath);\n};\n\n\n/**\n * Applies Application updates\n */\n\nKeystone.prototype.applyUpdates = function(callback) {\n\trequire('./lib/updates').apply(callback);\n};\n\n\n/**\n * Renders a Keystone View\n *\n * @api private\n */\n\nKeystone.prototype.render = function(req, res, view, ext) {\n\n\tvar keystone = this;\n\n\tvar templatePath = __dirname + '/templates/views/' + view + '.jade';\n\n\tvar jadeOptions = {\n\t\tfilename: templatePath,\n\t\tpretty: keystone.get('env') !== 'production'\n\t};\n\n\t// TODO: Allow custom basePath for extensions... like this or similar\n\t// if (keystone.get('extensions')) {\n\t// \tjadeOptions.basedir = keystone.getPath('extensions') + '/templates';\n\t// }\n\n\tvar compileTemplate = function() {\n\t\treturn jade.compile(fs.readFileSync(templatePath, 'utf8'), jadeOptions);\n\t};\n\n\tvar template = this.get('viewCache')\n\t\t? templateCache[view] || (templateCache[view] = compileTemplate())\n\t\t: compileTemplate();\n\n\tvar flashMessages = {\n\t\tinfo: res.req.flash('info'),\n\t\tsuccess: res.req.flash('success'),\n\t\twarning: res.req.flash('warning'),\n\t\terror: res.req.flash('error'),\n\t\thilight: res.req.flash('hilight')\n\t};\n\n\tvar locals = {\n\t\t_: _,\n\t\tmoment: moment,\n\t\tnumeral: numeral,\n\t\tenv: this.get('env'),\n\t\tbrand: keystone.get('brand'),\n\t\tnav: keystone.nav,\n\t\tmessages: _.any(flashMessages, function(msgs) { return msgs.length; }) ? flashMessages : false,\n\t\tlists: keystone.lists,\n\t\tjs: 'javascript:;',\n\t\tutils: utils,\n\t\tUser: keystone.list(keystone.get('user model')),\n\t\tuser: req.user,\n\t\ttitle: 'Keystone',\n\t\tsignout: this.get('signout url'),\n\t\taccount_manager: this.get('account_manager url'),\n\t\tbackUrl: this.get('back url') || '/',\n\t\tsection: {},\n\t\tversion: this.version,\n\t\tcsrf_token_key: keystone.security.csrf.TOKEN_KEY,\n\t\tcsrf_token_value: keystone.security.csrf.getToken(req, res),\n\t\tcsrf_query: '&' + keystone.security.csrf.TOKEN_KEY + '=' + keystone.security.csrf.getToken(req, res),\n\t\tga: {\n\t\t\tproperty: this.get('ga property'),\n\t\t\tdomain: this.get('ga domain')\n\t\t},\n\t\twysiwygOptions: {\n\t\t\tenableImages: keystone.get('wysiwyg images') ? true : false,\n\t\t\tenableCloudinaryUploads: keystone.get('wysiwyg cloudinary images') ? true : false,\n\t\t\tadditionalButtons: keystone.get('wysiwyg additional buttons') || '',\n\t\t\tadditionalPlugins: keystone.get('wysiwyg additional plugins') || '',\n\t\t\tadditionalOptions: keystone.get('wysiwyg additional options') || {},\n\t\t\toverrideToolbar: keystone.get('wysiwyg override toolbar'),\n\t\t\tskin: keystone.get('wysiwyg skin') || 'keystone',\n\t\t\tmenubar: keystone.get('wysiwyg menubar')\n\t\t},\n\t\tauth: auth\n\t};\n\n\t// optional extensions to the local scope\n\t_.extend(locals, ext);\n\n\t// add cloudinary locals if configured\n\tif (keystone.get('cloudinary config')) {\n\t\ttry {\n\t\t\tvar cloudinaryUpload = cloudinary.uploader.direct_upload();\n\t\t\tlocals.cloudinary = {\n\t\t\t\tcloud_name: keystone.get('cloudinary config').cloud_name,\n\t\t\t\tapi_key: keystone.get('cloudinary config').api_key,\n\t\t\t\ttimestamp: cloudinaryUpload.hidden_fields.timestamp,\n\t\t\t\tsignature: cloudinaryUpload.hidden_fields.signature,\n\t\t\t\tprefix: keystone.get('cloudinary prefix') || '',\n\t\t\t\tfolders: keystone.get('cloudinary folders'),\n\t\t\t\tuploader: cloudinary.uploader\n\t\t\t};\n\t\t\tlocals.cloudinary_js_config = cloudinary.cloudinary_js_config();\n\t\t} catch(e) {\n\t\t\tif (e === 'Must supply api_key') {\n\t\t\t\tthrow new Error('Invalid Cloudinary Config Provided\\n\\n' +\n\t\t\t\t\t'See http://keystonejs.com/docs/configuration/#cloudinary for more information.');\n\t\t\t} else {\n\t\t\t\tthrow e;\n\t\t\t}\n\t\t}\n\t}\n\n\t// fieldLocals defines locals that are provided to each field's `render` method\n\tlocals.fieldLocals = _.pick(locals, '_', 'moment', 'numeral', 'env', 'js', 'utils', 'user', 'cloudinary');\n\n\tvar html = template(_.extend(locals, ext));\n\n\tres.send(html);\n};\n\n/**\n * Populates relationships on a document or array of documents\n *\n * WARNING: This is currently highly inefficient and should only be used in development, or for\n * small data sets. There are lots of things that can be done to improve performance... later.\n *\n * @api public\n */\n\nKeystone.prototype.populateRelated = function(docs, relationships, callback) {\n\n\tif (Array.isArray(docs)) {\n\t\tasync.each(docs, function(doc, done) {\n\t\t\tdoc.populateRelated(relationships, done);\n\t\t}, callback);\n\t} else if (docs && docs.populateRelated) {\n\t\tdocs.populateRelated(relationships, callback);\n\t} else {\n\t\tcallback();\n\t}\n\n};\n\n/**\n * Logs a configuration error to the console\n *\n * @api public\n */\n\nKeystone.prototype.console = {};\nKeystone.prototype.console.err = function(type, msg) {\n\n\tif (keystone.get('logger')) {\n\t\tvar dashes = '\\n------------------------------------------------\\n';\n\t\tconsole.log(dashes + 'KeystoneJS: ' + type + ':\\n\\n' + msg + dashes);\n\t}\n\n};\n\n/**\n * Keystone version\n *\n * @api public\n */\n\nkeystone.version = require('./package.json').version;\n\n\n// Expose Modules\nkeystone.session = require('./lib/session');\n"]}