text: "use strict";
  module.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){var n=r(1),o=r(65).default,i=r(75),s=r(83),a=n.createServer(function(e,t){return s.info("Starting Delegated Admin Extension - Version:","4.3.0"),o(e,t)});e.exports=function(e,t,r){t.x_wt&&t.x_wt.ectx&&t.x_wt.ectx.PUBLIC_WT_URL||!1||i.setValue("PUBLIC_WT_URL",n.urlHelpers.getWebtaskUrl(t)),a(e,t,r)}},function(e,t,r){const n=r(2),o=r(41),i=r(43),s=r(61);e.exports.createServer=n.createServer,e.exports.urlHelpers=o,e.exports.middlewares=i,e.exports.routes=s},function(e,t,r){const n=r(3),o=r(4);e.exports.createServer=function(e){const t=n.createServer(e);var r=null;return o.fromExpress(function(e,n){return r||(r=t(e.webtaskContext)),r(e,n)})}},function(e,t,r){const n=r(4),o=r(5),i=r(13),s=e.exports={};s.ArgumentError=o.ArgumentError,s.ForbiddenError=o.ForbiddenError,s.HookTokenError=o.HookTokenError,s.ManagementApiError=o.ManagementApiError,s.NotFoundError=o.NotFoundError,s.UnauthorizedError=o.UnauthorizedError,s.ValidationError=o.ValidationError,s.managementApi=r(19),s.FileStorageContext=i.FileStorageContext,s.WebtaskStorageContext=i.WebtaskStorageContext,s.BlobRecordProvider=r(25),s.config=r(34),s.configProvider=r(35),s.createServer=r(36).createServer,s.validateHookToken=r(37),s.SessionManager=r(38),s.createExpressServer=function(e){return n.fromExpress(s.createServer(e))},s.createHapiServer=function(e){return n.fromHapi(s.createServer(e))}},function(e,t){e.exports=require("webtask-tools")},function(e,t,r){e.exports.ArgumentError=r(6),e.exports.ForbiddenError=r(7),e.exports.HookTokenError=r(8),e.exports.ManagementApiError=r(9),e.exports.NotFoundError=r(10),e.exports.UnauthorizedError=r(11),e.exports.ValidationError=r(12)},function(e,t,r){function n(e){Error.call(this,e),this.name="ArgumentError",this.message=e,this.status=400}n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,e.exports=n},function(e,t,r){function n(e){Error.call(this,e),this.name="ForbiddenError",this.message=e,this.status=403}n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,e.exports=n},function(e,t,r){function n(e,t){Error.call(this,e),this.name="HookTokenError",this.message=e,this.status=401,this.innerError=t}n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,e.exports=n},function(e,t,r){function n(e,t,r){Error.call(this,t),this.name="ManagementApiError",this.code=e,this.message=t,this.status=r||400}n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,e.exports=n},function(e,t,r){function n(e){Error.call(this,e),this.name="NotFoundError",this.message=e,this.status=404}n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,e.exports=n},function(e,t,r){function n(e){Error.call(this,e),this.name="UnauthorizedError",this.message=e,this.status=401}n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,e.exports=n},function(e,t,r){function n(e){Error.call(this,e),this.name="ValidationError",this.message=e,this.status=400}n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,e.exports=n},function(e,t,r){e.exports.FileStorageContext=r(14),e.exports.WebtaskStorageContext=r(18)},function(e,t,r){const n=r(15),o=r(16),i=r(17),s=r(5).ArgumentError;function a(e,t){if(null===e||void 0===e)throw new s("Must provide the path to the file");if("string"!=typeof e||0===e.length)throw new s("The provided path is invalid: "+e);t=t||{mergeWrites:!0},this.path=e,this.mergeWrites=t.mergeWrites,this.defaultData=t.defaultData||{}}a.prototype.read=function(){const e=this;return new i(function(t,r){o.readFile(e.path,"utf8",function(n,o){if(n)return"ENOENT"===n.code?t(e.defaultData):r(n);try{return o&&o.length?t(JSON.parse(o)):t(e.defaultData)}catch(e){return r(e)}})})},a.prototype.write=function(e){const t=this;var r=i.resolve(e);return t.mergeWrites&&(r=r.then(function(e){return t.read().then(function(t){return n.extend({},t,e)})})),r.then(function(e){return new i(function(r,n){try{return o.writeFile(t.path,JSON.stringify(e,null,2),"utf8",function(e){return e?n(e):r()})}catch(e){return n(e)}})})},e.exports=a},function(e,t){e.exports=require("lodash@4.8.2")},function(e,t){e.exports=require("fs")},function(e,t){e.exports=require("bluebird@3.4.6")},function(e,t,r){const n=r(17),o=r(5).ArgumentError;function i(e,t){if(null===e||void 0===e)throw new o("Must provide the Webtask storage object");t=t||{force:1},this.storage=e,this.options=t,this.defaultData=t.defaultData||{}}i.prototype.read=function(){const e=this;return new n(function(t,r){e.storage.get(function(n,o){return n?r(n):t(o||e.defaultData)})})},i.prototype.write=function(e){const t=this;return new n(function(r,n){t.storage.set(e,t.options,function(e){return e?n(e):r()})})},i.prototype.writeRetryCondition=function(e){return 409===e.code},e.exports=i},function(e,t,r){const n=r(20),o=r(21),i=r(22),s=r(17),a=r(23),u=r(24),c=r(5).ArgumentError,d=r(5).ManagementApiError,l=function(e,t,r){return new s(function(n,o){u.post("https://"+e+"/oauth/token").send({audience:"https://"+e+"/api/v2/",client_id:t,client_secret:r,grant_type:"client_credentials"}).set("Accept","application/json").end(function(e,r){return e&&401===e.status?o(new d("unauthorized","Invalid credentials for "+t,e.status)):e&&r&&r.body&&r.body.error?o(new d(r.body.error,r.body.error_description||r.body.error,e.status)):e?o(e):r.ok&&r.body.access_token?n(r.body.access_token):o(new d("unknown_error","Unknown error from Management Api or no access token was provided: "+(r.text||r.status)))})})},_=s.promisify(a({load:function(e,t,r,n){l(e,t,r).then(function(e){return n(null,e)}).catch(function(e){return n(e)})},hash:function(e,t,r){return e+"-"+t+"-"+r},itemMaxAge:function(e,t,r,n){try{const e=o.decode(n),t=new Date(0);t.setUTCSeconds(e.exp);const r=(new Date).valueOf();return t.valueOf()-r-1e4}catch(e){return 1e3}},max:100,maxAge:n("1h")}));e.exports.getAccessToken=l,e.exports.getAccessTokenCached=_,e.exports.getClient=function(e){if(null===e||void 0===e)throw new c("An options object must be provided");if(null===e.domain||void 0===e.domain)throw new c("An options object must contain the domain");if("string"!=typeof e.domain||0===e.domain.length)throw new c("The provided domain is invalid: "+e.domain);if(e.accessToken){if("string"!=typeof e.accessToken||0===e.accessToken.length)throw new c("The provided accessToken is invalid");return s.resolve(new i.ManagementClient({domain:e.domain,token:e.accessToken}))}if(null===e.clientId||void 0===e.clientId)throw new c("An options object must contain the clientId");if("string"!=typeof e.clientId||0===e.clientId.length)throw new c("The provided clientId is invalid: "+e.clientId);if(null===e.clientSecret||void 0===e.clientSecret)throw new c("An options object must contain the clientSecret");if("string"!=typeof e.clientSecret||0===e.clientSecret.length)throw new c("The provided clientSecret is invalid");return _(e.domain,e.clientId,e.clientSecret).then(function(t){return new i.ManagementClient({domain:e.domain,token:t})})}},function(e,t){var r=1e3,n=60*r,o=60*n,i=24*o,s=365.25*i;function a(e,t,r){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+r:Math.ceil(e/t)+" "+r+"s"}e.exports=function(e,t){t=t||{};var u,c=typeof e;if("string"===c&&e.length>0)return function(e){if((e=String(e)).length>100)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var a=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return a*s;case"days":case"day":case"d":return a*i;case"hours":case"hour":case"hrs":case"hr":case"h":return a*o;case"minutes":case"minute":case"mins":case"min":case"m":return a*n;case"seconds":case"second":case"secs":case"sec":case"s":return a*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}(e);if("number"===c&&!1===isNaN(e))return t.long?a(u=e,i,"day")||a(u,o,"hour")||a(u,n,"minute")||a(u,r,"second")||u+" ms":function(e){if(e>=i)return Math.round(e/i)+"d";if(e>=o)return Math.round(e/o)+"h";if(e>=n)return Math.round(e/n)+"m";if(e>=r)return Math.round(e/r)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},function(e,t){e.exports=require("jsonwebtoken@7.1.9")},function(e,t){e.exports=require("auth0@2.8.0")},function(e,t){e.exports=require("lru-memoizer@1.10.0")},function(e,t){e.exports=require("superagent@3.8.3")},function(e,t,r){const n=r(15),o=r(26),i=r(27),s=r(32),a=r(5).ArgumentError,u=r(5).NotFoundError,c=r(5).ValidationError,d=function(e,t){return e.read(t).then(function(e){return e[t]=e[t]||[],e})};function l(e,t){if(null===e||void 0===e)throw new a("Must provide a storage context");this.storageContext=e,this.queue=s(),this.options=t||{concurrentWrites:!0}}l.prototype.write=function(e,t){const r=function(e,t){const r={retries:10,factor:2,minTimeout:100,maxTimeout:1/0,randomize:!1};return function(){return i(function(r){return t().catch(function(t){if((e.writeRetryCondition||function(){return!1})(t))return r(t);throw t})},r)}}(e,t);if(this.options.concurrentWrites)return r();const n=this.queue;return new Promise(function(e,t){n(r,function(r,n){return r?t(r):e(n)})})},l.prototype.getAll=function(e){return d(this.storageContext,e).then(function(t){return t[e]})},l.prototype.get=function(e,t){return this.getAll(e).then(function(r){const o=n.find(r,function(e){return e._id===t});return o||Promise.reject(new u("The record "+t+" in "+e+" does not exist."))})},l.prototype.create=function(e,t){const r=this.storageContext;return this.write(r,function(){return d(r,e).then(function(i){return t._id||(t._id=o.v4()),n.findIndex(i[e],function(e){return e._id===t._id})>-1?Promise.reject(new c("The record "+t._id+" in "+e+" already exists.")):(i[e].push(t),r.write(i).then(function(){return t}))})})},l.prototype.update=function(e,t,r,o){const i=this.storageContext;return this.write(i,function(){return d(i,e).then(function(s){const a=n.findIndex(s[e],function(e){return e._id===t});if(a<0&&!o)throw new u("The record "+t+" in "+e+" does not exist.");const c=n.extend({_id:t},a<0?{}:s[e][a],r);return a<0?s[e].push(c):s[e][a]=c,i.write(s).then(function(){return c})})})},l.prototype.delete=function(e,t){const r=this.storageContext;return this.write(r,function(){return d(r,e).then(function(o){const i=n.findIndex(o[e],function(e){return e._id===t});return!(i<0)&&(o[e].splice(i,1),r.write(o).then(function(){return!0}))})})},e.exports=l},function(e,t){e.exports=require("node-uuid@1.4.3")},function(e,t,r){"use strict";var n=r(28),o=r(29),i=Object.prototype.hasOwnProperty;function s(e){return e&&"EPROMISERETRY"===e.code&&i.call(e,"retried")}e.exports=function(e,t){var r,i;return"object"==typeof e&&"function"==typeof t&&(r=t,t=e,e=r),i=o.operation(t),new Promise(function(t,r){i.attempt(function(o){Promise.resolve().then(function(){return e(function(e){throw s(e)&&(e=e.retried),n("Retrying","EPROMISERETRY",{retried:e})},o)}).then(t,function(e){s(e)&&(e=e.retried,i.retry(e||new Error))||r(e)})})})}},function(e,t,r){"use strict";e.exports=function(e,t,r){var n,o=e instanceof Error?e:new Error(e);if("object"==typeof t?r=t:null!=t&&(o.code=t),r)for(n in r)o[n]=r[n];return o}},function(e,t,r){e.exports=r(30)},function(e,t,r){var n=r(31);t.operation=function(e){var r=t.timeouts(e);return new n(r,{forever:e&&e.forever,unref:e&&e.unref})},t.timeouts=function(e){if(e instanceof Array)return[].concat(e);var t={retries:10,factor:2,minTimeout:1e3,maxTimeout:1/0,randomize:!1};for(var r in e)t[r]=e[r];if(t.minTimeout>t.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var n=[],o=0;o<t.retries;o++)n.push(this.createTimeout(o,t));return e&&e.forever&&!n.length&&n.push(this.createTimeout(o,t)),n.sort(function(e,t){return e-t}),n},t.createTimeout=function(e,t){var r=t.randomize?Math.random()+1:1,n=Math.round(r*t.minTimeout*Math.pow(t.factor,e));return n=Math.min(n,t.maxTimeout)},t.wrap=function(e,r,n){if(r instanceof Array&&(n=r,r=null),!n)for(var o in n=[],e)"function"==typeof e[o]&&n.push(o);for(var i=0;i<n.length;i++){var s=n[i],a=e[s];e[s]=function(){var n=t.operation(r),o=Array.prototype.slice.call(arguments),i=o.pop();o.push(function(e){n.retry(e)||(e&&(arguments[0]=n.mainError()),i.apply(this,arguments))}),n.attempt(function(){a.apply(e,o)})},e[s].options=r}}},function(e,t){function r(e,t){"boolean"==typeof t&&(t={forever:t}),this._timeouts=e,this._options=t||{},this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}e.exports=r,r.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timeouts=[],this._cachedTimeouts=null},r.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;this._errors.push(e);var t=this._timeouts.shift();if(void 0===t){if(!this._cachedTimeouts)return!1;this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),t=this._timeouts.shift()}var r=this,n=setTimeout(function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout(function(){r._operationTimeoutCb(r._attempts)},r._operationTimeout),this._options.unref&&r._timeout.unref()),r._fn(r._attempts)},t);return this._options.unref&&n.unref(),!0},r.prototype.attempt=function(e,t){this._fn=e,t&&(t.timeout&&(this._operationTimeout=t.timeout),t.cb&&(this._operationTimeoutCb=t.cb));var r=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){r._operationTimeoutCb()},r._operationTimeout)),this._fn(this._attempts)},r.prototype.try=function(e){console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)},r.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)},r.prototype.start=r.prototype.try,r.prototype.errors=function(){return this._errors},r.prototype.attempts=function(){return this._attempts},r.prototype.mainError=function(){if(0===this._errors.length)return null;for(var e={},t=null,r=0,n=0;n<this._errors.length;n++){var o=this._errors[n],i=o.message,s=(e[i]||0)+1;e[i]=s,s>=r&&(t=o,r=s)}return t}},function(e,t,r){const n=r(33);e.exports=function(){const e=n.queue(function(e,t){e().then(function(e){t(null,e)}).catch(function(e){t(e)})},1);return e.push.bind(e)}},function(e,t){e.exports=require("async@2.1.2")},function(e,t){e.exports=function(){const e={};var t=null;const r=function(r){if(e&&e[r])return e[r];if(!t)throw new Error("A configuration provider has not been set");return t(r)};return r.setProvider=function(e){t=e},r.setValue=function(t,r){e[t]=r},r}},function(e,t,r){const n=r(15),o=r(5).ArgumentError;e.exports.fromWebtaskContext=function(e){if(null===e||void 0===e)throw new o("Must provide a webtask context");const t=n.assign({AUTH0_RTA:"auth0.auth0.com"},Object({WARN_DB_SIZE:409600,MAX_MULTISELECT_USERS:5,MULTISELECT_DEBOUNCE_MS:250,PER_PAGE:10,NODE_ENV:"production",CLIENT_VERSION:"4.3.0"}),e.params,e.secrets,{NODE_ENV:"production",HOSTING_ENV:"webtask"});return function(e){return t[e]}}},function(e,t,r){const n=r(35);e.exports.createServer=function(e){var t=null;return function(r){if(!t){const o=n.fromWebtaskContext(r);t=e(o,r.storage)}return t}}},function(e,t,r){const n=r(21),o=r(5).HookTokenError;e.exports=function(e,t,r,i,s){if(!s)throw new o("Hook token missing");try{return n.verify(s,i,{audience:t+r,issuer:"https://"+e}),!0}catch(e){throw new o("Invalid hook token",e)}}},function(e,t,r){const n=r(21),o=r(17),i=r(39),s=r(40),a=r(5).ArgumentError,u=r(5).UnauthorizedError,c=r(5).ValidationError;function d(e,t,r){if(null===e||void 0===e)throw new a("Must provide a valid domain");if("string"!=typeof e||0===e.length)throw new a("The provided rta is invalid: "+e);if(0===e.indexOf("https://")&&(e=e.replace("https://","")),null===t||void 0===t)throw new a("Must provide a valid domain");if("string"!=typeof t||0===t.length)throw new a("The provided domain is invalid: "+t);if(null===r||void 0===r)throw new a("Must provide a valid clientId");if("string"!=typeof r||0===r.length)throw new a("The provided clientId is invalid: "+r);this.options={rta:e,domain:t,clientId:r},this.jwksClient=i({cache:!0,rateLimit:!0,jwksRequestsPerMinute:10,jwksUri:"https://"+e+"/.well-known/jwks.json"}),this.managementApiAudience="https://"+t+"/api/v2/"}d.prototype.createAuthorizeUrl=function(e){if(null===e||void 0===e)throw new a("Must provide the options");if(null===e.redirectUri||void 0===e.redirectUri)throw new a("Must provide the redirectUri");if(null===e.nonce||void 0===e.nonce)e.nonce=s.randomBytes(16).toString("hex");else if("string"!=typeof e.nonce||0===e.nonce.length)throw new a("The provided nonce is invalid: "+e.nonce);if("string"!=typeof e.redirectUri||0===e.redirectUri.length)throw new a("The provided redirectUri is invalid: "+e.redirectUri);if(void 0!==e.state&&("string"!=typeof e.state||0===e.state.length))throw new a("The provided state is invalid: "+e.state);var t="openid name email";e.scopes&&e.scopes.length&&(t+=" "+e.scopes);var r=["https://"+this.options.rta+"/authorize","?client_id="+encodeURIComponent(this.options.clientId),"&response_type=token id_token","&response_mode=form_post","&scope="+encodeURIComponent(t),"&expiration="+(e.expiration||36e3),"&redirect_uri="+encodeURIComponent(e.redirectUri),"&audience="+encodeURIComponent(this.managementApiAudience),"&nonce="+encodeURIComponent(e.nonce)];return e.state&&r.push("&state="+encodeURIComponent(e.state)),r.join("")},d.prototype.validateToken=function(e,t,r){const i=this;return new o(function(e,o){const s=n.decode(r,{complete:!0});return null==s?o(new c("Unable to decoded the token.")):i.jwksClient.getSigningKey(s.header.kid,function(s,a){if(s)return o(s);const c=a.publicKey||a.rsaPublicKey;return n.verify(r,c,{algorithms:["RS256"]},function(r,n){return r?o(r):n.iss!=="https://"+i.options.rta+"/"?o(new u("Invalid issuer: "+n.iss)):n&&(n.aud===t||Array.isArray(n.aud)&&n.aud.indexOf(t)>-1)?e(n):o(new u("Audience mismatch for: "+t))})})})},d.prototype.create=function(e,t,r){if(null===e||void 0===e)return o.reject(new a("Must provide an id_token"));if("string"!=typeof e||0===e.length)return o.reject(new a("The provided id_token is invalid: "+e));if(null===t||void 0===t)return o.reject(new a("Must provide an access_token"));if("string"!=typeof t||0===t.length)return o.reject(new a("The provided access_token is invalid: "+t));if(null===r||void 0===r)return o.reject(new a("Must provide the options"));if(null===r.secret||void 0===r.secret)return o.reject(new a("Must provide the secret"));if("string"!=typeof r.secret||0===r.secret.length)return o.reject(new a("The provided secret is invalid: "+r.secret));if(null===r.audience||void 0===r.audience)return o.reject(new a("Must provide the audience"));if("string"!=typeof r.audience||0===r.audience.length)return o.reject(new a("The provided audience is invalid: "+r.audience));if(null===r.issuer||void 0===r.issuer)return o.reject(new a("Must provide the issuer"));if("string"!=typeof r.issuer||0===r.issuer.length)return o.reject(new a("The provided issuer is invalid: "+r.issuer));const i=this;return o.all([i.validateToken(i.options.clientId,i.options.clientId,e),i.validateToken(i.options.clientId,i.managementApiAudience,t)]).then(function(e){if(e[1].azp!==i.options.clientId)return o.reject(new u("The access_token's azp does not match the id_token"));if(e[0].sub!==e[1].sub)return o.reject(new u("Subjects don't match"));const s={sub:e[0].sub,email:e[0].email,exp:e[0].exp};return r.noAccessToken||(s.access_token=t),n.sign(s,r.secret,{algorithm:"HS256",issuer:r.issuer,audience:r.audience})})},e.exports=d},function(e,t){e.exports=require("jwks-rsa@1.1.1")},function(e,t){e.exports=require("crypto")},function(e,t,r){const n=r(42),o=3,i=2,s=1,a=/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g;e.exports.getBasePath=function(e){return t=e.originalUrl||"",r=e.path,(o=(o=n.parse(t).pathname||"").replace(r,"").replace(/^\/|\/$/g,"")).startsWith("/")||(o="/"+o),o.endsWith("/")||(o+="/"),o;var t,r,o},e.exports.getBaseUrl=function(e,t){var r=t;const o=n.parse(e.originalUrl||"").pathname||"";return n.format({protocol:r||"https",host:e.headers.host,pathname:o.replace(e.path,"").replace(/\/$/g,"")})},e.exports.getWebtaskUrl=function(e){const t=function(e){if(!e.container)return null;const t=e.container.replace(a,"\\$&"),r=e.jtn?e.jtn.replace(a,"\\$&"):"";if(e.url_format===s)return new RegExp("^/api/run/"+t+"/(?:"+r+"/?)?");if(e.url_format===i)return new RegExp("^/"+t+"/(?:"+r+"/?)?");if(e.url_format===o)return new RegExp("^/(?:"+r+"/?)?");throw new Error("Unsupported webtask URL format.")}(e.x_wt),r=e.url,u=e.url.replace(t,"/"),c=n.parse(u||"").pathname,d=e.x_wt&&e.x_wt.ectx&&e.x_wt.ectx.ISOLATED_DOMAIN||!1,l=n.parse(r||"").pathname||"";var _;if(d){_=n.format({protocol:"https",host:e.headers.host,pathname:l.replace(c,"").replace(/\/$/g,"")});const t=".it.auth0.com/api/run/"+e.x_wt.container+"/",r=function(e,t){if(!e)return null;const r=e.indexOf("sandbox8")>=0?"8":"";return"https://"+t+"."+(e.split(".it.auth0.com")[0].split("-")[1]||"us")+r+".webtask.io/"}(_,e.x_wt.container);_.indexOf(t)>=0&&(_=_.replace("https://"+e.headers.host+"/api/run/"+e.x_wt.container+"/",r))}else _=l;return _}},function(e,t){e.exports=require("url")},function(e,t,r){e.exports.authenticateAdmins=r(44),e.exports.authenticateUsers=r(55),e.exports.requireAuthentication=r(56),e.exports.errorHandler=r(57),e.exports.managementApiClient=r(58),e.exports.validateHookToken=r(59),e.exports.webtaskConfig=r(60)},function(e,t,r){const n=r(45),o=r(48),i=r(3),s=r(52);e.exports=function(e){if(!e||"object"!=typeof e)throw new i.ArgumentError("Must provide the options");if(null===e.secret||void 0===e.secret)throw new i.ArgumentError("Must provide a valid secret");if("string"!=typeof e.secret||0===e.secret.length)throw new i.ArgumentError("The provided secret is invalid: "+e.secret);if(null===e.audience||void 0===e.audience)throw new i.ArgumentError("Must provide a valid secret");if("string"!=typeof e.audience||0===e.audience.length)throw new i.ArgumentError("The provided audience is invalid: "+e.audience);if(null===e.baseUrl||void 0===e.baseUrl)throw new i.ArgumentError("Must provide a valid base URL");if("string"!=typeof e.baseUrl||0===e.baseUrl.length)throw new i.ArgumentError("The provided base URL is invalid: "+e.baseUrl);const t=o({audience:e.audience,issuer:e.baseUrl,secret:e.secret,algorithms:["HS256"],credentialsRequired:e.credentialsRequired||!0});return function(r,n,o){t(r,n,function(t){return t?o(t):e.onLoginSuccess?e.onLoginSuccess(r,n,o):o()})}},e.exports.optional=function(t){const r=e.exports(t);return s(function(e){if(e&&e.headers&&e.headers.authorization&&0===e.headers.authorization.indexOf("Bearer "))try{const r=n(e.headers.authorization.split(" ")[1]);return r&&r.iss===t.baseUrl}catch(e){return!1}return!1},r)}},function(e,t,r){"use strict";var n=r(46);function o(e){this.message=e}o.prototype=new Error,o.prototype.name="InvalidTokenError",e.exports=function(e,t){if("string"!=typeof e)throw new o("Invalid token specified");var r=!0===(t=t||{}).header?0:1;try{return JSON.parse(n(e.split(".")[r]))}catch(e){throw new o("Invalid token specified: "+e.message)}},e.exports.InvalidTokenError=o},function(e,t,r){var n=r(47);e.exports=function(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(e){return decodeURIComponent(n(e).replace(/(.)/g,function(e,t){var r=t.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}(t)}catch(e){return n(t)}}},function(e,t){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function n(e){this.message=e}n.prototype=new Error,n.prototype.name="InvalidCharacterError",e.exports="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new n("'atob' failed: The string to be decoded is not correctly encoded.");for(var o,i,s=0,a=0,u="";i=t.charAt(a++);~i&&(o=s%4?64*o+i:i,s++%4)?u+=String.fromCharCode(255&o>>(-2*s&6)):0)i=r.indexOf(i);return u}},function(e,t,r){var n=r(21),o=r(49),i=r(50),s=r(33),a=r(51),u=function(e,t,r){return r(null,!1)},c={}.toString;e.exports=function(e){if(!e||!e.secret)throw new Error("secret should be set");var t,r,d=e.secret;(r=d)&&"[object Function]"==c.call(r)||(t=d,d=function(e,r,n){return n(null,t)});var l=e.isRevoked||u,_=e.userProperty||e.requestProperty||"user",f=void 0===e.credentialsRequired||e.credentialsRequired,p=function(t,r,i){var u;if("OPTIONS"===t.method&&t.headers.hasOwnProperty("access-control-request-headers")&&!!~t.headers["access-control-request-headers"].split(",").map(function(e){return e.trim()}).indexOf("authorization"))return i();if(void 0!==e.skip&&(console.warn("WARN: express-jwt: options.skip is deprecated"),console.warn("WARN: use app.use(jwt(options).unless({path: '/x'}))"),e.skip.indexOf(t.url)>-1))return i();if(e.getToken&&"function"==typeof e.getToken)try{u=e.getToken(t)}catch(e){return i(e)}else if(t.headers&&t.headers.authorization){var c=t.headers.authorization.split(" ");if(2!=c.length)return i(new o("credentials_bad_format",{message:"Format is Authorization: Bearer [token]"}));var p=c[0],h=c[1];if(!/^Bearer$/i.test(p))return i(new o("credentials_bad_scheme",{message:"Format is Authorization: Bearer [token]"}));u=h}if(!u)return f?i(new o("credentials_required",{message:"No authorization token was found"})):i();var m=n.decode(u,{complete:!0})||{};s.waterfall([function(e){4==d.length?d(t,m.header,m.payload,e):d(t,m.payload,e)},function(t,r){n.verify(u,t,e,function(e,t){e&&f?r(new o("invalid_token",e)):r(null,t)})},function(e,r){l(t,m.payload,function(t,n){t?r(t):n?r(new o("revoked_token",{message:"The token has been revoked."})):r(null,e)})}],function(e,r){if(e)return i(e);a(t,_,r),i()})};return p.unless=i,p}},function(e,t){function r(e,t){Error.call(this,t.message),Error.captureStackTrace(this,this.constructor),this.name="UnauthorizedError",this.message=t.message,this.code=e,this.status=401,this.inner=t}r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,e.exports=r},function(e,t,r){var n=r(42);e.exports=function(e){var t=this,r="function"==typeof e?{custom:e}:e;return r.useOriginalUrl=void 0===r.useOriginalUrl||r.useOriginalUrl,function(e,o,i){var s=n.parse((r.useOriginalUrl?e.originalUrl:e.url)||e.url||"",!0),a=!1;r.custom&&(a=a||r.custom(e));var u=!r.path||Array.isArray(r.path)?r.path:[r.path];u&&(a=a||u.some(function(t){return function e(t,r){var n="string"==typeof t&&t===r||t instanceof RegExp&&!!t.exec(r);t instanceof RegExp&&(t.lastIndex=0);t&&t.url&&(n=e(t.url,r));return n}(t,s.pathname)&&function(e,t){if(!e)return!0;return!!~(e=Array.isArray(e)?e:[e]).indexOf(t)}(t.methods,e.method)}));var c=!r.ext||Array.isArray(r.ext)?r.ext:[r.ext];c&&(a=a||c.some(function(e){return s.pathname.substr(-1*e.length)===e}));var d=!r.method||Array.isArray(r.method)?r.method:[r.method];if(d&&(a=a||!!~d.indexOf(e.method)),a)return i();t(e,o,i)}}},function(e,t){var r="Expected a function",n="__lodash_hash_undefined__",o=1/0,i=9007199254740991,s="[object Function]",a="[object GeneratorFunction]",u="[object Symbol]",c=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,d=/^\w*$/,l=/^\./,_=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,f=/\\(\\)?/g,p=/^\[object .+?Constructor\]$/,h=/^(?:0|[1-9]\d*)$/,m="object"==typeof global&&global&&global.Object===Object&&global,E="object"==typeof self&&self&&self.Object===Object&&self,g=m||E||Function("return this")();var v,y=Array.prototype,O=Function.prototype,b=Object.prototype,w=g["__core-js_shared__"],A=(v=/[^.]+$/.exec(w&&w.keys&&w.keys.IE_PROTO||""))?"Symbol(src)_1."+v:"",T=O.toString,M=b.hasOwnProperty,x=b.toString,U=RegExp("^"+T.call(M).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),P=g.Symbol,I=y.splice,D=F(g,"Map"),C=F(Object,"create"),R=P?P.prototype:void 0,k=R?R.toString:void 0;function S(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function L(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function j(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function N(e,t,r){var n=e[t];M.call(e,t)&&G(n,r)&&(void 0!==r||t in e)||(e[t]=r)}function B(e,t){for(var r=e.length;r--;)if(G(e[r][0],t))return r;return-1}function q(e){return!(!J(e)||A&&A in e)&&(function(e){var t=J(e)?x.call(e):"";return t==s||t==a}(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?U:p).test(function(e){if(null!=e){try{return T.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function W(e,t,r,n){if(!J(e))return e;for(var o=-1,i=(t=function(e,t){if(X(e))return!1;var r=typeof e;if("number"==r||"symbol"==r||"boolean"==r||null==e||Y(e))return!0;return d.test(e)||!c.test(e)||null!=t&&e in Object(t)}(t,e)?[t]:function(e){return X(e)?e:$(e)}(t)).length,s=i-1,a=e;null!=a&&++o<i;){var u=V(t[o]),l=r;if(o!=s){var _=a[u];void 0===(l=n?n(_,u,a):void 0)&&(l=J(_)?_:H(t[o+1])?[]:{})}N(a,u,l),a=a[u]}return e}function K(e,t){var r,n,o=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof t?"string":"hash"]:o.map}function F(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return q(r)?r:void 0}function H(e,t){return!!(t=null==t?i:t)&&("number"==typeof e||h.test(e))&&e>-1&&e%1==0&&e<t}S.prototype.clear=function(){this.__data__=C?C(null):{}},S.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},S.prototype.get=function(e){var t=this.__data__;if(C){var r=t[e];return r===n?void 0:r}return M.call(t,e)?t[e]:void 0},S.prototype.has=function(e){var t=this.__data__;return C?void 0!==t[e]:M.call(t,e)},S.prototype.set=function(e,t){return this.__data__[e]=C&&void 0===t?n:t,this},L.prototype.clear=function(){this.__data__=[]},L.prototype.delete=function(e){var t=this.__data__,r=B(t,e);return!(r<0||(r==t.length-1?t.pop():I.call(t,r,1),0))},L.prototype.get=function(e){var t=this.__data__,r=B(t,e);return r<0?void 0:t[r][1]},L.prototype.has=function(e){return B(this.__data__,e)>-1},L.prototype.set=function(e,t){var r=this.__data__,n=B(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},j.prototype.clear=function(){this.__data__={hash:new S,map:new(D||L),string:new S}},j.prototype.delete=function(e){return K(this,e).delete(e)},j.prototype.get=function(e){return K(this,e).get(e)},j.prototype.has=function(e){return K(this,e).has(e)},j.prototype.set=function(e,t){return K(this,e).set(e,t),this};var $=z(function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(Y(e))return k?k.call(e):"";var t=e+"";return"0"==t&&1/e==-o?"-0":t}(t);var r=[];return l.test(e)&&r.push(""),e.replace(_,function(e,t,n,o){r.push(n?o.replace(f,"$1"):t||e)}),r});function V(e){if("string"==typeof e||Y(e))return e;var t=e+"";return"0"==t&&1/e==-o?"-0":t}function z(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError(r);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var s=e.apply(this,r);return n.cache=i.set(o,s),s};return n.cache=new(z.Cache||j),n}function G(e,t){return e===t||e!=e&&t!=t}z.Cache=j;var X=Array.isArray;function J(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Y(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&x.call(e)==u}e.exports=function(e,t,r){return null==e?e:W(e,t,r)}},function(e,t,r){"use strict";var n=r(53);e.exports=function(e,t,r){return function(o,i,s){var a=n(s);return!0===e||"function"==typeof e&&e(o,i,a)?t(o,i,a):r?r(o,i,a):a()}}},function(e,t,r){var n=r(54);function o(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function i(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},r=e.name||"Function wrapped with `once`";return t.onceError=r+" shouldn't be called more than once",t.called=!1,t}e.exports=n(o),e.exports.strict=n(i),o.proto=o(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return o(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return i(this)},configurable:!0})})},function(e,t){e.exports=function e(t,r){if(t&&r)return e(t)(r);if("function"!=typeof t)throw new TypeError("need wrapper function");Object.keys(t).forEach(function(e){n[e]=t[e]});return n;function n(){for(var e=new Array(arguments.length),r=0;r<e.length;r++)e[r]=arguments[r];var n=t.apply(this,e),o=e[e.length-1];return"function"==typeof n&&n!==o&&Object.keys(o).forEach(function(e){n[e]=o[e]}),n}}},function(e,t,r){const n=r(45),o=r(48),i=r(39),s=r(3),a=r(52),u=r(3).UnauthorizedError;e.exports=function(e){if(!e||"object"!=typeof e)throw new s.ArgumentError("Must provide the options");if(null===e.domain||void 0===e.domain)throw new s.ArgumentError("Must provide a valid domain");if("string"!=typeof e.domain||0===e.domain.length)throw new s.ArgumentError("The provided domain is invalid: "+e.domain);if(null===e.audience||void 0===e.audience)throw new s.ArgumentError("Must provide a valid audience");if("string"!=typeof e.audience||0===e.audience.length)throw new s.ArgumentError("The provided audience is invalid: "+e.audience);const t=o({secret:i.expressJwtSecret({cache:!0,rateLimit:!0,jwksRequestsPerMinute:5,jwksUri:"https://"+e.domain+"/.well-known/jwks.json",handleSigningKeyError:function(e,t){return e instanceof i.SigningKeyNotFoundError?t(new u("A token was provided with an invalid kid")):t(e)}}),audience:e.audience,issuer:"https://"+e.domain+"/",algorithms:["RS256"],credentialsRequired:e&&e.credentialsRequired||!0});return function(r,n,o){t(r,n,function(t){return t?o(t):e.onLoginSuccess?e.onLoginSuccess(r,n,o):o()})}},e.exports.optional=function(t){const r=e.exports(t);return a(function(e){if(e&&e.headers&&e.headers.authorization&&0===e.headers.authorization.indexOf("Bearer "))try{const r=n(e.headers.authorization.split(" ")[1]);return r&&r.iss==="https://"+t.domain+"/"}catch(e){return!1}return!1},r)}},function(e,t,r){const n=r(3).UnauthorizedError;e.exports=function(e,t,r){return e.user?r():r(new n("Authentication required for this endpoint."))}},function(e,t,r){e.exports=function(e){return function(t,r,n,o){return e&&e(t),t&&t.status?(n.status(t.status),n.json({error:t.code||t.name,message:t.message||t.name})):(n.status(t.status||500),n.json({error:"InternalServerError",message:t.message||t.name}))}}},function(e,t,r){const n=r(3);e.exports=function(e){return function(t,r,o){const i=t,s=t.user&&t.user.access_token&&t.user.access_token.length?{domain:e.domain,accessToken:t.user.access_token}:e;n.managementApi.getClient(s).then(function(e){return i.auth0=e,o(),null}).catch(function(e){o(e)})}}},function(e,t,r){const n=r(3);e.exports=function(e,t,r){if(null===e||void 0===e)throw new n.ArgumentError("Must provide the domain");if("string"!=typeof e||0===e.length)throw new n.ArgumentError("The provided domain is invalid: "+e);if(null===t||void 0===t)throw new n.ArgumentError("Must provide the webtaskUrl");if("string"!=typeof t||0===t.length)throw new n.ArgumentError("The provided webtaskUrl is invalid: "+t);if(null===r||void 0===r)throw new n.ArgumentError("Must provide the extensionSecret");if("string"!=typeof r||0===r.length)throw new n.ArgumentError("The provided extensionSecret is invalid: "+r);return function(o){if(null===o||void 0===o)throw new n.ArgumentError("Must provide the hookPath");if("string"!=typeof o||0===o.length)throw new n.ArgumentError("The provided hookPath is invalid: "+o);return function(i,s,a){if(i.headers.authorization&&"Bearer"===i.headers.authorization.split(" ")[0]){const s=i.headers.authorization.split(" ")[1];try{if(n.validateHookToken(e,t,o,r,s))return a()}catch(e){return a(e)}}return a(new n.HookTokenError("Hook token missing for the call to: "+o))}}}},function(e,t,r){const n=r(3);e.exports=function(e){return function(t,r,o){return t.webtaskContext&&e.setProvider(n.configProvider.fromWebtaskContext(t.webtaskContext)),o()}}},function(e,t,r){e.exports.dashboardAdmins=r(62)},function(e,t,r){const n=r(63),o=r(40),i=r(64),s=r(21),a=r(3),u=r(41);e.exports=function(e){if(!e||"object"!=typeof e)throw new a.ArgumentError("Must provide the options");if(null===e.secret||void 0===e.secret)throw new a.ArgumentError("Must provide a valid secret");if("string"!=typeof e.secret||0===e.secret.length)throw new a.ArgumentError("The provided secret is invalid: "+e.secret);if(null===e.audience||void 0===e.audience)throw new a.ArgumentError("Must provide a valid audience");if("string"!=typeof e.audience||0===e.audience.length)throw new a.ArgumentError("The provided audience is invalid: "+e.audience);if(null===e.rta||void 0===e.rta)throw new a.ArgumentError("Must provide a valid rta");if("string"!=typeof e.rta||0===e.rta.length)throw new a.ArgumentError("The provided rta is invalid: "+e.rta);if(null===e.domain||void 0===e.domain)throw new a.ArgumentError("Must provide a valid domain");if("string"!=typeof e.domain||0===e.domain.length)throw new a.ArgumentError("The provided domain is invalid: "+e.domain);if(null===e.baseUrl||void 0===e.baseUrl)throw new a.ArgumentError("Must provide a valid base URL");if("string"!=typeof e.baseUrl||0===e.baseUrl.length)throw new a.ArgumentError("The provided base URL is invalid: "+e.baseUrl);if(null===e.clientName||void 0===e.clientName)throw new a.ArgumentError("Must provide a valid client name");if("string"!=typeof e.clientName||0===e.clientName.length)throw new a.ArgumentError("The provided client name is invalid: "+e.clientName);if(void 0!==e.storageType&&"sessionStorage"!==e.storageType&&"localStorage"!==e.storageType)throw new a.ArgumentError('The storageType must be either "sessionStorage" or "localStorage". Incorrect storageType: '+e.storageType);const t=e.stateKey||"state",r=e.nonceKey||"nonce",c=e.urlPrefix||"",d=e.storageType||"sessionStorage",l=e.storageKey||e.sessionStorageKey||"apiToken",_=new a.SessionManager(e.rta,e.domain,e.baseUrl),f=n.Router();return f.get(c+"/login",function(n,i){const s=u.getBasePath(n),a=o.randomBytes(16).toString("hex"),d=o.randomBytes(16).toString("hex"),l={httpOnly:!0,path:s};i.cookie(t,a,Object.assign({},l,{sameSite:"None",secure:!0})),i.cookie(r,d,Object.assign({},l,{sameSite:"None",secure:!0})),i.cookie(t+"_compat",a,l),i.cookie(r+"_compat",d,l);const f=_.createAuthorizeUrl({redirectUri:u.getBaseUrl(n)+c+"/login/callback",scopes:e.scopes,expiration:e.expiration,nonce:d,state:a});i.redirect(f)}),f.post(c+"/login/callback",i(),function(n,o,i){var c;try{c=s.decode(n.body.id_token)}catch(e){c=null}if(!c)return i(new a.ValidationError("Login failed. Invalid token."));if(n.cookies&&n.cookies[r]&&n.cookies[r]!==c.nonce||n.cookies&&n.cookies[r+"_compat"]&&n.cookies[r+"_compat"]!==c.nonce)return i(new a.ValidationError("Login failed. Nonce mismatch."));if(n.cookies&&n.cookies[t]&&n.cookies[t]!==n.body.state||n.cookies&&n.cookies[t+"_compat"]&&n.cookies[t+"_compat"]!==n.body.state)return i(new a.ValidationError("Login failed. State mismatch."));const f=u.getBasePath(n);return _.create(n.body.id_token,n.body.access_token,{secret:e.secret,issuer:e.baseUrl,audience:e.audience,noAccessToken:e.noAccessToken}).then(function(e){o.clearCookie(t,{path:f}),o.clearCookie(r,{path:f}),o.clearCookie(t+"_compat",{path:f}),o.clearCookie(r+"_compat",{path:f}),o.header("Content-Type","text/html"),o.status(200).send('<html><head><script type="text/javascript">'+d+'.setItem("'+l+'", "'+e+'");window.location.href = "'+u.getBaseUrl(n)+'";<\/script></head></html>')}).catch(function(e){i(e)})}),f.get(c+"/logout",function(n,o){const i=u.getBasePath(n),s=encodeURIComponent(u.getBaseUrl(n));o.clearCookie(t,{path:i}),o.clearCookie(r,{path:i}),o.clearCookie(t+"_compat",{path:i}),o.clearCookie(r+"_compat",{path:i}),o.header("Content-Type","text/html"),o.status(200).send('<html><head><script type="text/javascript">'+d+'.removeItem("'+l+'");window.location.href = "https://'+e.rta+"/v2/logout/?returnTo="+s+"&client_id="+s+'";<\/script></head></html>')}),f.get("/.well-known/oauth2-client-configuration",function(t,r){r.header("Content-Type","application/json"),r.status(200).send({redirect_uris:[u.getBaseUrl(t)+c+"/login/callback"],client_name:e.clientName,post_logout_redirect_uris:[u.getBaseUrl(t)]})}),f}},function(e,t){e.exports=require("express@4.16.3")},function(e,t){e.exports=require("cookie-parser@1.3.5")},function(e,t,r){"use strict";r.r(t),function(e){var n=r(66),o=r.n(n),i=r(67),s=r.n(i),a=r(63),u=r.n(a),c=r(68),d=r.n(c),l=r(64),_=r.n(l),f=r(3),p=r(1),h=r(69),m=r(101),E=r(102),g=r(104),v=r(75),y=r.n(v),O=r(83),b=r.n(O),w=r(71);t.default=function(t,r){y.a.setProvider(t);var n=r?new f.WebtaskStorageContext(r,{force:1}):new f.FileStorageContext(o.a.join(e,"./data.json"),{mergeWrites:!0}),i=new u.a;return i.use(function(e,t,r){e.webtaskContext&&y.a.setProvider(f.configProvider.fromWebtaskContext(e.webtaskContext)),r()}),i.use(s()(":method :url :status :response-time ms - :res[content-length]",{stream:b.a.stream})),i.use(d.a.json()),i.use(d.a.urlencoded({extended:!1})),i.use(p.routes.dashboardAdmins({secret:y()("EXTENSION_SECRET"),audience:"urn:delegated-admin",rta:y()("AUTH0_RTA").replace("https://",""),domain:y()("AUTH0_DOMAIN"),baseUrl:y()("PUBLIC_WT_URL"),webtaskUrl:y()("PUBLIC_WT_URL"),clientName:"Delegated Administration",noAccessToken:!0,urlPrefix:"/admins",sessionStorageKey:"delegated-admin:apiToken",scopes:"read:clients delete:clients read:connections read:users update:users delete:users create:users read:logs read:device_credentials update:device_credentials delete:device_credentials delete:guardian_enrollments"})),i.use("/api",Object(h.default)(n)),i.use("/app",u.a.static(o.a.join(e,"../dist"))),i.use("/meta",Object(E.default)()),i.use("/.extensions",Object(m.default)()),i.get("*",_()(),Object(g.default)()),i.use(Object(w.errorHandler)(b.a.error)),i}}.call(this,"/")},function(e,t){e.exports=require("path")},function(e,t){e.exports=require("morgan@1.5.3")},function(e,t){e.exports=require("body-parser@1.12.4")},function(e,t,r){"use strict";r.r(t);var n=r(63),o=r(15),i=r.n(o),s=r(70),a=r.n(s),u=r(1),c=r(3),d=r.n(c),l=r(71),_=r(75),f=r.n(_),p=r(76),h=r(87),m=r(88),E=r(89),g=r(91),v=r(92),y=r(93),O=r(94),b=r(95);t.default=function(e){var t=new p.default(e),r=u.middlewares.managementApiClient({domain:f()("AUTH0_DOMAIN"),clientId:f()("AUTH0_CLIENT_ID"),clientSecret:f()("AUTH0_CLIENT_SECRET")}),o=Object(n.Router)(),s=function(e){return i.a.get(e,"headers.authorization","").split(" ")[1]},c=function(e,t){if(global.daeUser=global.daeUser||{},global.daeUser[t.sub]=global.daeUser[t.sub]||{exp:0,token:""},i.a.isFunction(global.daeUser[t.sub].then))return global.daeUser[t.sub];if(global.daeUser[t.sub].exp>a()().unix()&&e&&global.daeUser[t.sub].token===e)return i.a.assign(t,global.daeUser[t.sub]),Promise.resolve(t);e||console.error("no token found");var r=d.a.managementApi.getClient({domain:f()("AUTH0_DOMAIN"),clientId:f()("AUTH0_CLIENT_ID"),clientSecret:f()("AUTH0_CLIENT_SECRET")}).then(function(r){return r.users.get({id:t.sub}).then(function(r){return i.a.assign(t,r),t.token=e,global.daeUser[t.sub]=t,t})});return global.daeUser[t.sub]=r,global.daeUser[t.sub]};return o.use(u.middlewares.authenticateUsers.optional({domain:f()("AUTH0_CUSTOM_DOMAIN")||f()("AUTH0_DOMAIN"),audience:f()("EXTENSION_CLIENT_ID"),credentialsRequired:!1,onLoginSuccess:function(e,t,r){var n=e;return c(s(e),e.user).then(function(t){return n.user=t,n.user.scope=Object(h.default)(e.user),r()}).catch(r)}})),o.use(u.middlewares.authenticateAdmins.optional({credentialsRequired:!1,secret:f()("EXTENSION_SECRET"),audience:"urn:delegated-admin",baseUrl:f()("PUBLIC_WT_URL"),onLoginSuccess:function(e,t,r){var n=e;return c(s(e),e.user).then(function(e){return n.user=e,n.user.scope=[m.AUDITOR_PERMISSION,m.USER_PERMISSION,m.OPERATOR_PERMISSION,m.ADMIN_PERMISSION],r()}).catch(r)}})),o.use(function(e,t,r){t.setHeader("Cache-control","no-cache, no-store"),t.setHeader("Pragma","no-cache"),t.setHeader("Expires","0"),r()}),o.use(function(e,t,r){var n="get"===e.method.toLowerCase()?m.AUDITOR_PERMISSION:m.USER_PERMISSION;return Object(l.requireScope)(n)(e,t,r)}),o.use("/applications",r,Object(E.default)()),o.use("/connections",r,Object(g.default)(t)),o.use("/scripts",Object(l.requireScope)(m.ADMIN_PERMISSION),Object(v.default)(e,t)),o.use("/users",r,Object(b.default)(e,t)),o.use("/logs",r,Object(O.default)(t)),o.use("/me",Object(y.default)(t)),o.get("/settings",function(e,r,n){var o={request:{user:e.user},locale:e.headers["dae-locale"]};t.execute("settings",o).then(function(e){return r.json({settings:e||{}})}).catch(n)}),o}},function(e,t){e.exports=require("moment@2.11.2")},function(e,t,r){"use strict";r.r(t);var n=r(72);r.d(t,"verifyUserAccess",function(){return n.default});var o=r(73);r.d(t,"requireScope",function(){return o.default});var i=r(74);r.d(t,"errorHandler",function(){return i.default})},function(e,t,r){"use strict";r.r(t);var n=r(17),o=r.n(n),i=r(3);t.default=function(e,t){return function(r,n,s){return r.auth0.users.get({id:r.params.id}).then(function(n){if(!n)return o.a.reject(new i.NotFoundError(`User not found: ${r.params.id}`));var s={request:{user:r.user},payload:{user:n,action:e}};return t.execute("access",s).then(function(){r.targetUser=n})}).then(function(){return s()}).catch(s)}}},function(e,t,r){"use strict";r.r(t);var n=r(3);t.default=function(e){return function(t,r,o){return!t.user||!t.user.scope||t.user.scope.indexOf(e)<0?o(new n.ForbiddenError(`Cannot perform action. Missing scope ${e}`)):o()}}},function(e,t,r){"use strict";r.r(t),t.default=function(e){return function(t,r,n,o){return e&&e(t),t&&(t.status||t.statusCode)?(n.status(t.status||t.statusCode),n.json({error:t.code||t.name,message:t.message||t.name})):(n.status(500),n.json({error:"InternalServerError",message:t.message||t.name}))}}},function(e,t,r){var n=r(3).config(),o=function(e){return"AUTH0_CUSTOM_DOMAIN"===e?n("AUTH0_CUSTOM_DOMAIN")||n("AUTH0_DOMAIN"):"IS_APPLIANCE"===e?n("AUTH0_RTA")&&"auth0.auth0.com"!==n("AUTH0_RTA").replace("https://",""):n(e)};o.getValue=function(e){return n(e)},o.setValue=function(e,t){return n.setValue(e,t)},o.setProvider=function(e){return n.setProvider(e)},e.exports=o},function(e,t,r){"use strict";r.r(t),r.d(t,"default",function(){return v});var n=r(77),o=r.n(n),i=r(79),s=r.n(i),a=r(80),u=r.n(a),c=r(17),d=r.n(c),l=r(81),_=r.n(l),f=r(23),p=r.n(f),h=r(3),m=r(83),E=r.n(m),g=r(85),v=function(){function e(t){var r=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e4;if(s()(this,e),null===t||void 0===t)throw new h.ArgumentError("Must provide a storage object.");this.log=E.a.debug.bind(E.a),this.cache={},this.storage=t,this.getCached=d.a.promisify(p()({load:function(e,t){r.get(e).then(function(e){return t(null,e),null}).catch(t)},hash:function(e){return e},max:100,maxAge:n}))}return u()(e,[{key:"get",value:function(e){return this.storage.read().then(function(t){return t&&t.scripts?t.scripts[e]:null})}},{key:"save",value:function(e,t){var r=this;return this.storage.read().then(function(r){return r.scripts||(r.scripts={}),r.scripts[e]=t,r}).then(function(e){return r.storage.write(e)})}},{key:"readCustomData",value:function(){return this.storage.read().then(function(e){return e.customData||{}})}},{key:"writeCustomData",value:function(e){var t=this;return this.storage.read().then(function(t){return t.customData=e,t}).then(function(e){return t.storage.write(e)})}},{key:"createContext",value:function(e){return o()({log:this.log,global:this.cache,read:this.readCustomData.bind(this),write:this.writeCustomData.bind(this)},e)}},{key:"dynamicRequire",value:function(e){try{return require(e)}catch(e){}return r(86)(e)}},{key:"execute",value:function(e,t){var r=this;return this.getCached(e).then(function(n){return n?(E.a.debug(`Executing Delegated Admin hook: ${e}`),new d.a(function(o,i){try{_()(n,{require:r.dynamicRequire})(r.createContext(t),function(t,r){t?(E.a.error(`Failed to execute Delegated Admin hook (${e}): "${t}"`),i(Object(g.default)(t,e))):o(r)})}catch(t){E.a.error(`Failed to compile Delegated Admin hook (${e}): "${t}"`),i(Object(g.default)(t,e))}})):null})}}]),e}()},function(e,t,r){var n=r(78);e.exports=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),o.forEach(function(t){n(e,t,r[t])})}return e}},function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t){function r(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}},function(e,t,r){var n=r(82);e.exports=function(e,t,r){var o={},i="SAFE_EVAL_"+Math.floor(1e6*Math.random());o[i]={};return e="\n    (function(){\n      Function = undefined;\n      const keys = Object.getOwnPropertyNames(this).concat(['constructor']);\n      keys.forEach((key) => {\n        const item = this[key];\n        if(!item || typeof item.constructor !== 'function') return;\n        this[key].constructor = undefined;\n      });\n    })();\n  "+i+"="+e,t&&Object.keys(t).forEach(function(e){o[e]=t[e]}),n.runInNewContext(e,o,r),o[i]}},function(e,t){e.exports=require("vm")},function(e,t,r){var n=r(84);n.emitErrs=!0;var o=new n.Logger({transports:[new n.transports.Console({timestamp:!0,level:"debug",handleExceptions:!0,json:!1,colorize:!0})],exitOnError:!1});e.exports=o,e.exports.stream={write:function(e){o.info(e.replace(/\n$/,""))}}},function(e,t){e.exports=require("winston@1.0.0")},function(e,t,r){"use strict";r.r(t);var n=r(3);t.default=function(e,t){var r=new n.ValidationError(e.message||""),o=`${t}-script error`;return e.stack&&(o=e.stack.replace(/SAFE_EVAL_\d+/,`${t}-script error`).replace("evalmachine.<anonymous>","line")),r.stack=o.split("\n").slice(0,2).join(" "),r}},function(e,t){function r(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}r.keys=function(){return[]},r.resolve=r,e.exports=r,r.id=86},function(e,t,r){"use strict";r.r(t);var n=r(15),o=r.n(n),i=r(88),s=function(e,t){var r=o.a.find(e,function(e,t){return o.a.startsWith(t,"https:")&&o.a.endsWith(t,"auth0-delegated-admin")}),n=[e[t],e.app_metadata&&e.app_metadata[t],e.app_metadata&&e.app_metadata.authorization&&e.app_metadata.authorization[t],r&&r[t]];return o()(n).flatten().compact().uniq().value()};t.default=function(e){var t=s(e,"roles"),r=s(e,"permissions"),n=function(e){var t=-1;if(!e)return t;var r=Array.isArray(e)?e:e.replace(", ",",","g").split(",");return r.indexOf(i.AUDITOR_ROLE_NAME)>=0&&(t=i.AUDITOR_ACCESS_LEVEL),r.indexOf(i.USER_ROLE_NAME)>=0&&(t=i.USER_ACCESS_LEVEL),r.indexOf(i.OPERATOR_ROLE_NAME)>=0&&(t=i.OPERATOR_ACCESS_LEVEL),r.indexOf(i.ADMIN_ROLE_NAME)>=0&&(t=i.ADMIN_ACCESS_LEVEL),t}(t);return n>=i.AUDITOR_ACCESS_LEVEL&&r.indexOf(i.AUDITOR_PERMISSION)<0&&r.push(i.AUDITOR_PERMISSION),n>=i.USER_ACCESS_LEVEL&&r.indexOf(i.USER_PERMISSION)<0&&r.push(i.USER_PERMISSION),n>=i.OPERATOR_ACCESS_LEVEL&&r.indexOf(i.OPERATOR_PERMISSION)<0&&r.push(i.OPERATOR_PERMISSION),n===i.ADMIN_ACCESS_LEVEL&&r.indexOf(i.ADMIN_PERMISSION)<0&&r.push(i.ADMIN_PERMISSION),r}},function(e,t,r){"use strict";r.r(t),r.d(t,"AUDITOR_ACCESS_LEVEL",function(){return n}),r.d(t,"USER_ACCESS_LEVEL",function(){return o}),r.d(t,"OPERATOR_ACCESS_LEVEL",function(){return i}),r.d(t,"ADMIN_ACCESS_LEVEL",function(){return s}),r.d(t,"AUDITOR_ROLE_NAME",function(){return a}),r.d(t,"USER_ROLE_NAME",function(){return u}),r.d(t,"OPERATOR_ROLE_NAME",function(){return c}),r.d(t,"ADMIN_ROLE_NAME",function(){return d}),r.d(t,"AUDITOR_PERMISSION",function(){return l}),r.d(t,"USER_PERMISSION",function(){return _}),r.d(t,"OPERATOR_PERMISSION",function(){return f}),r.d(t,"ADMIN_PERMISSION",function(){return p}),r.d(t,"VALID_SCRIPTS",function(){return h});var n=0,o=1,i=2,s=3,a="Delegated Admin - Auditor",u="Delegated Admin - User",c="Delegated Admin - Operator",d="Delegated Admin - Administrator",l="read:users",_="manage:users",f="read:logs",p="manage:config",h=["access","filter","create","memberships","settings"]},function(e,t,r){"use strict";r.r(t);var n=r(15),o=r.n(n),i=r(63),s=r(90);t.default=function(){var e=Object(i.Router)();return e.get("/",function(e,t,r){Object(s.default)(e.auth0,"clients",{is_global:!1,fields:"client_id,name,app_type"}).then(function(e){return o.a.chain(e).filter(function(e){return"spa"===e.app_type||"native"===e.app_type||"regular_web"===e.app_type}).map(function(e){return{client_id:e.client_id,name:e.name}}).sortBy(function(e){return e.name.toLowerCase()}).value()}).then(function(e){return t.json(e)}).catch(r)}),e}},function(e,t,r){"use strict";r.r(t);var n=r(77),o=r.n(n),i=r(17),s=r.n(i),a=r(3);t.default=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:50,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:5;if(null===e||void 0===e)throw new a.ArgumentError("Must provide a auth0 client object.");if(!t&&!e[t])throw new a.ArgumentError("Must provide a valid entity for auth0 client.");var u=e[t].getAll,c=o()({},r,{per_page:n}),d=[],l=0,_=0,f=function(e){return u(o()({},c,{page:e})).then(function(e){return e.forEach(function(e){return d.push(e)}),null})};return u(o()({},c,{include_totals:!0,page:0})).then(function(e){return l=e.total||0,_=Math.ceil(l/n),(e[t]||e||[]).forEach(function(e){return d.push(e)}),null}).then(function(){if(0===l||d.length>=l)return d;for(var e=[],t=1;t<=_;t++)e.push(t);return s.a.map(e,f,{concurrency:i})}).then(function(){return d})}},function(e,t,r){"use strict";r.r(t);var n=r(15),o=r.n(n),i=r(63),s=r(90);t.default=function(e){var t=Object(i.Router)();return t.get("/",function(t,r,n){Object(s.default)(t.auth0,"connections",{strategy:"auth0",fields:"id,name,strategy,options"}).then(function(r){global.connections=r.map(function(e){return{name:e.name,id:e.id}});var n={request:{user:t.user},locale:t.headers["dae-locale"]};return e.execute("settings",n).then(function(e){var t=o.a.chain(r).sortBy(function(e){return e.name.toLowerCase()}).value();return e&&e.connections&&Array.isArray(e.connections)&&e.connections.length&&(t=t.filter(function(t){return e.connections.indexOf(t.name)>=0})),t})}).then(function(e){return e.map(function(e){return{id:e.id,name:e.name,strategy:e.strategy,options:e.options?{requires_username:e.options.requires_username}:null}})}).then(function(e){return r.json(e)}).catch(n)}),t}},function(e,t,r){"use strict";r.r(t);var n=r(63),o=r(3),i=r(88);t.default=function(e,t){var r=Object(n.Router)();return r.get("/:name",function(e,r,n){return i.VALID_SCRIPTS.indexOf(e.params.name)<0?n(new o.ValidationError(`Invalid script name: ${e.params.name}`)):t.get(e.params.name).then(function(e){return r.json({script:e})}).catch(n)}),r.post("/:name",function(e,r,n){return i.VALID_SCRIPTS.indexOf(e.params.name)<0?n(new o.ValidationError(`Invalid script name: ${e.params.name}`)):t.save(e.params.name,e.body.script).then(function(){return r.status(200).send()}).catch(n)}),r}},function(e,t,r){"use strict";r.r(t);var n=r(63),o=r.n(n),i=r(83),s=r.n(i),a=r(88);t.default=function(e){var t=o.a.Router();return t.get("/",function(t,r){var n=0;t.user.scope.indexOf(a.ADMIN_PERMISSION)>=0?n=3:t.user.scope.indexOf(a.OPERATOR_PERMISSION)>=0?n=2:t.user.scope.indexOf(a.USER_PERMISSION)>=0&&(n=1);var o={createMemberships:!1,memberships:[],role:n},i={request:{user:t.user},payload:{user:t.user}};e.execute("memberships",i).then(function(e){return e&&Array.isArray(e)?o.memberships=e:e&&(o.createMemberships=e.createMemberships||!1,o.memberships=e.memberships||[]),r.json(o)}).catch(function(e){s.a.error(e.message),r.json(o)})}),t}},function(e,t,r){"use strict";r.r(t);var n=r(17),o=r.n(n),i=r(63),s=r(3),a=r(71),u=r(88);t.default=function(e){var t=Object(i.Router)();return t.get("/",Object(a.requireScope)(u.OPERATOR_PERMISSION),function(e,t,r){e.auth0.logs.getAll({q:"NOT type: sapi AND NOT type:fapi",sort:"date:-1",per_page:20,page:e.query.page||0,fields:"type,date,client_name,user_name,description,connection"}).then(function(e){return t.json(e)}).catch(r)}),t.get("/:id",function(t,r,n){t.auth0.logs.get({id:t.params.id}).then(function(r){return!r||"fapi"!==r.type&&"sapi"!==r.type?t.user.scope.indexOf(u.OPERATOR_PERMISSION)>=0?r:t.auth0.users.get({id:r.user_id}).then(function(n){if(!n)throw new s.NotFoundError(`User not found: ${t.params.id}`);var o={request:{user:t.user},payload:{user:n}};return e.execute("access",o).then(function(){return r})}):o.a.reject(new Error("Invalid log record."))}).then(function(e){return r.json({log:e})}).catch(n)}),t}},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__);var lodash__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(15),lodash__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__),auth0__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(22),auth0__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(auth0__WEBPACK_IMPORTED_MODULE_1__),request__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(96),request__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(request__WEBPACK_IMPORTED_MODULE_2__),bluebird__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(17),bluebird__WEBPACK_IMPORTED_MODULE_3___default=__webpack_require__.n(bluebird__WEBPACK_IMPORTED_MODULE_3__),express__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(63),express__WEBPACK_IMPORTED_MODULE_4___default=__webpack_require__.n(express__WEBPACK_IMPORTED_MODULE_4__),auth0_extension_tools__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(3),auth0_extension_tools__WEBPACK_IMPORTED_MODULE_5___default=__webpack_require__.n(auth0_extension_tools__WEBPACK_IMPORTED_MODULE_5__),_lib_config__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(75),_lib_config__WEBPACK_IMPORTED_MODULE_6___default=__webpack_require__.n(_lib_config__WEBPACK_IMPORTED_MODULE_6__),_lib_logger__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(83),_lib_logger__WEBPACK_IMPORTED_MODULE_7___default=__webpack_require__.n(_lib_logger__WEBPACK_IMPORTED_MODULE_7__),_lib_middlewares__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(71),_lib_removeGuardian__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(97),_lib_userBlocks__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__(98),_lib_getApiToken__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__(99),_lib_getConnectionIdByName__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__(100),isValidField=function(e,t,r){return t&&lodash__WEBPACK_IMPORTED_MODULE_0___default.a.includes(t,r.property)||!t&&!1!==r[e]},checkCustomFieldValidation=function checkCustomFieldValidation(req,context,isEditRequest,onlyTheseFields){if(!context.userFields)return context.payload;var requiredErrorText=req.query&&req.query.requiredErrorText||"required",type=isEditRequest?"edit":"create",ignoredFields=lodash__WEBPACK_IMPORTED_MODULE_0___default.a.map(lodash__WEBPACK_IMPORTED_MODULE_0___default.a.filter(context.userFields,function(e){return!isValidField(type,onlyTheseFields,e)}),"property"),fieldsToValidate=lodash__WEBPACK_IMPORTED_MODULE_0___default.a.filter(context.userFields,function(e){return!lodash__WEBPACK_IMPORTED_MODULE_0___default.a.includes(ignoredFields,e.property)&&lodash__WEBPACK_IMPORTED_MODULE_0___default.a.isObject(e[type])&&(e[type].required||e[type].validationFunction)}),errorList={};if(fieldsToValidate.forEach(function(field){var value=lodash__WEBPACK_IMPORTED_MODULE_0___default.a.get(context.payload,field.property),errorKey=field.label||field.property;if(value&&0!==value.length){if(field[type].validationFunction)try{var validationFunction=eval(`(${field[type].validationFunction})`);if(lodash__WEBPACK_IMPORTED_MODULE_0___default.a.isFunction(validationFunction)){var error=validationFunction(value,context.payload);if(error)return void(errorList[errorKey]=error)}else _lib_logger__WEBPACK_IMPORTED_MODULE_7___default.a.warn(`warning: skipping invalid validation function: ${field[type].validationFunction}, because: it is not a function`)}catch(e){_lib_logger__WEBPACK_IMPORTED_MODULE_7___default.a.warn(`warning: skipping invalid validation function: ${field[type].validationFunction}, because: `,e.message)}if(field[type].options){var optionValue=lodash__WEBPACK_IMPORTED_MODULE_0___default.a.isObject(value)?value.value:value,options=lodash__WEBPACK_IMPORTED_MODULE_0___default.a.map(field[type].options,function(e){return lodash__WEBPACK_IMPORTED_MODULE_0___default.a.isObject(e)?e.value:e});if(options.indexOf(optionValue)<0)return void(errorList[errorKey]=`${optionValue} is not an allowed option`)}}else field[type].required&&(errorList[errorKey]=[requiredErrorText||"required"])}),Object.keys(errorList).length>0)throw new auth0_extension_tools__WEBPACK_IMPORTED_MODULE_5__.ValidationError(lodash__WEBPACK_IMPORTED_MODULE_0___default.a.map(errorList,function(e,t){return`${t}: ${e}`}).join("\n"));if(onlyTheseFields){var oldPayload=lodash__WEBPACK_IMPORTED_MODULE_0___default.a.cloneDeep(context.payload);context.payload={},onlyTheseFields.forEach(function(e){lodash__WEBPACK_IMPORTED_MODULE_0___default.a.set(context.payload,e,lodash__WEBPACK_IMPORTED_MODULE_0___default.a.get(oldPayload,e))})}return lodash__WEBPACK_IMPORTED_MODULE_0___default.a.omit(context.payload,ignoredFields)},executeWriteHook=function(e,t,r,n){var o=e.targetUser,i={method:"update",request:{user:e.user,originalUser:o},payload:e.body,userFields:r};try{i.payload=checkCustomFieldValidation(e,i,!0,n)}catch(e){return bluebird__WEBPACK_IMPORTED_MODULE_3___default.a.reject(e)}return t.execute("create",i)};__webpack_exports__.default=function(e,t){var r=Object(express__WEBPACK_IMPORTED_MODULE_4__.Router)();return r.post("/",function(e,r,n){var o={request:{user:e.user},locale:e.headers["dae-locale"]};t.execute("settings",o).then(function(o){var i=(o=o||{}).userFields,s={method:"create",request:{user:e.user},payload:e.body,defaultPayload:{email:e.body.email,username:e.body.username,password:e.body.password,connection:e.body.connection,app_metadata:e.body.memberships&&e.body.memberships.length&&{memberships:e.body.memberships}||{}},userFields:i};if(!1===(void 0===o.canCreateUser||o.canCreateUser))return n(new auth0_extension_tools__WEBPACK_IMPORTED_MODULE_5__.UnauthorizedError("Create user is forbidden"));if(!lodash__WEBPACK_IMPORTED_MODULE_0___default.a.find(i,{property:"repeatPassword"})&&e.body.repeatPassword!==e.body.password)return n(new auth0_extension_tools__WEBPACK_IMPORTED_MODULE_5__.ValidationError("The passwords do not match."));try{s.payload=checkCustomFieldValidation(e,s)}catch(e){return n(e)}return delete s.payload.repeatPassword,t.execute("create",s).then(function(e){if(!(e=e||s.defaultPayload).email||0===e.email.length)throw new auth0_extension_tools__WEBPACK_IMPORTED_MODULE_5__.ValidationError("The email address is required.");return e}).then(function(t){return e.auth0.users.create(t)}).then(function(){return r.status(201).send()}).catch(n)})}),r.get("/",function(e,r,n){var o={request:{user:e.user},payload:{search:e.query.search,filterBy:e.query.filterBy}},i=_lib_config__WEBPACK_IMPORTED_MODULE_6___default()("USER_SEARCH_ENGINE")||"v3",s="v2"===i?'"':"",a=e.query.search;e.query.filterBy&&e.query.filterBy.length>0&&(a=`${e.query.filterBy}:${s}${e.query.search}${s}`);var u=e.query.sortProperty&&e.query.sortOrder?`${e.query.sortProperty}:${e.query.sortOrder}`:"last_login:-1";t.execute("filter",o).then(function(t){var r=t&&void 0!==t.query?t.query:t,n={sort:u,q:a&&r?`(${a}) AND ${r}`:a||r,per_page:e.query.per_page||10,page:e.query.page||0,include_totals:!0,fields:"user_id,username,name,email,identities,picture,last_login,logins_count,multifactor,blocked,app_metadata,user_metadata",search_engine:i};return e.auth0.users.getAll(n)}).then(function(r){return bluebird__WEBPACK_IMPORTED_MODULE_3___default.a.map(r.users,function(n,o){return t.execute("access",{request:{user:e.user},payload:{user:n,action:"read:user"}}).then(function(e){r.users[o]=e||n})}).then(function(){return r})}).then(function(e){return r.json(e)}).catch(function(e){return n(e)})}),r.get("/:id",Object(_lib_middlewares__WEBPACK_IMPORTED_MODULE_8__.verifyUserAccess)("read:user",t),function(e,r,n){var o=e.targetUser,i={request:{user:e.user},payload:{user:o}};return t.execute("memberships",i).then(function(e){return e&&Array.isArray(e)?{user:o,memberships:e}:e&&e.memberships?{user:o,memberships:e.memberships}:{user:o,memberships:[]}}).then(function(t){if(!t.user.identities)return t.connection={},t;var r=t.user.identities.filter(function(e){return"auth0"===e.provider}),n=r[0]&&r[0].connection;return n?(t.user.connection=n,Object(_lib_getConnectionIdByName__WEBPACK_IMPORTED_MODULE_12__.default)(e.auth0,n).then(function(t){return t?e.auth0.connections.get({id:t,fields:"enabled_clients"}):{}}).then(function(e){return t.connection={enabled_clients:e.enabled_clients},t})):(t.connection={},t)}).then(function(t){return Object(_lib_getApiToken__WEBPACK_IMPORTED_MODULE_11__.default)(e).then(function(r){return Object(_lib_userBlocks__WEBPACK_IMPORTED_MODULE_10__.requestUserBlocks)(r,e.params.id).then(function(e){return e&&(t.user.blocked_for=e),r})}).then(function(n){return Object(_lib_removeGuardian__WEBPACK_IMPORTED_MODULE_9__.requestGuardianEnrollments)(n,e.params.id).then(function(e){return!t.user.multifactor||e&&e.length?!t.user.multifactor&&e&&(t.user.multifactor=["guardian"]):(t.user.multifactor=t.user.multifactor.filter(function(e){return"guardian"!==e}),t.user.multifactor=t.user.multifactor.length?t.user.multifactor:null),r.json(t)})})}).catch(function(e){_lib_logger__WEBPACK_IMPORTED_MODULE_7___default.a.error("Failed to get user because: ",e),n(e)})}),r.delete("/:id",Object(_lib_middlewares__WEBPACK_IMPORTED_MODULE_8__.verifyUserAccess)("delete:user",t),function(e,t,r){return e.user.sub===e.params.id?r(new auth0_extension_tools__WEBPACK_IMPORTED_MODULE_5__.ValidationError("You cannot delete yourself.")):e.auth0.users.delete({id:e.params.id}).then(function(){return t.sendStatus(204)}).catch(r)}),r.patch("/:id",Object(_lib_middlewares__WEBPACK_IMPORTED_MODULE_8__.verifyUserAccess)("change:profile",t),function(e,r,n){var o={request:{user:e.user},locale:e.headers["dae-locale"]};t.execute("settings",o).then(function(r){var n=["username","email","password","repeatPassword","connection"],o=lodash__WEBPACK_IMPORTED_MODULE_0___default.a.map(lodash__WEBPACK_IMPORTED_MODULE_0___default.a.filter(r.userFields,function(e){return e.edit&&!lodash__WEBPACK_IMPORTED_MODULE_0___default.a.includes(n,e.property)}),"property");return executeWriteHook(e,t,r.userFields,o)}).then(function(t){return e.auth0.users.update({id:e.params.id},t)}).then(function(){return r.status(204).send()}).catch(n)}),r.post("/:id/password-reset",Object(_lib_middlewares__WEBPACK_IMPORTED_MODULE_8__.verifyUserAccess)("reset:password",t),function(e,t,r){var n=new auth0__WEBPACK_IMPORTED_MODULE_1___default.a.AuthenticationClient({domain:_lib_config__WEBPACK_IMPORTED_MODULE_6___default()("AUTH0_DOMAIN"),clientId:_lib_config__WEBPACK_IMPORTED_MODULE_6___default()("AUTH0_CLIENT_ID")}),o={email:e.targetUser.email,connection:e.body.connection,client_id:e.body.clientId};return n.requestChangePasswordEmail(o).then(function(){return t.sendStatus(204)}).catch(r)}),r.put("/:id/change-password",Object(_lib_middlewares__WEBPACK_IMPORTED_MODULE_8__.verifyUserAccess)("change:password",t),function(e,r,n){if(e.body.password!==e.body.repeatPassword)return n(new auth0_extension_tools__WEBPACK_IMPORTED_MODULE_5__.ArgumentError("Passwords don't match"));var o={request:{user:e.user},locale:e.headers["dae-locale"]};return t.execute("settings",o).then(function(o){return o&&o.userFields?executeWriteHook(e,t,o.userFields,["password","repeatPassword"]).then(function(t){if(!t.password)throw new auth0_extension_tools__WEBPACK_IMPORTED_MODULE_5__.ValidationError("The password is required.");t=lodash__WEBPACK_IMPORTED_MODULE_0___default.a.pick(t,["password","connection","verify_password","app_metadata"]);var o=lodash__WEBPACK_IMPORTED_MODULE_0___default.a.defaults(t,{connection:e.body.connection,verify_password:!1});return e.auth0.users.update({id:e.params.id},o).then(function(){return r.sendStatus(204)}).catch(n)}):e.auth0.users.update({id:e.params.id},{password:e.body.password,connection:e.body.connection,verify_password:!1}).then(function(){return r.sendStatus(204)}).catch(n)}).catch(n)}),r.put("/:id/change-username",Object(_lib_middlewares__WEBPACK_IMPORTED_MODULE_8__.verifyUserAccess)("change:username",t),function(e,r,n){var o={request:{user:e.user},locale:e.headers["dae-locale"]};t.execute("settings",o).then(function(o){o&&o.userFields?executeWriteHook(e,t,o.userFields,["username"]).then(function(t){if(!t.username)throw new auth0_extension_tools__WEBPACK_IMPORTED_MODULE_5__.ValidationError("The username is required.");return e.auth0.users.update({id:e.params.id},t)}).then(function(){return r.status(204).send()}).catch(n):e.auth0.users.update({id:e.params.id},{username:e.body.username}).then(function(){return r.sendStatus(204)}).catch(n)}).catch(n)}),r.put("/:id/change-email",Object(_lib_middlewares__WEBPACK_IMPORTED_MODULE_8__.verifyUserAccess)("change:email",t),function(e,r,n){var o={request:{user:e.user},locale:e.headers["dae-locale"]};t.execute("settings",o).then(function(o){o&&o.userFields?executeWriteHook(e,t,o.userFields,["email"]).then(function(t){if(!t.email)throw new auth0_extension_tools__WEBPACK_IMPORTED_MODULE_5__.ValidationError("The email is required.");return e.auth0.users.update({id:e.params.id},t)}).then(function(){return r.status(204).send()}).catch(n):e.auth0.users.update({id:e.params.id},{email:e.body.email}).then(function(){return r.sendStatus(204)}).catch(n)}).catch(n)}),r.get("/:id/devices",Object(_lib_middlewares__WEBPACK_IMPORTED_MODULE_8__.verifyUserAccess)("read:devices",t),function(e,t,r){e.auth0.deviceCredentials.getAll({user_id:e.params.id}).then(function(e){return t.json({devices:e})}).catch(r)}),r.get("/:id/logs",Object(_lib_middlewares__WEBPACK_IMPORTED_MODULE_8__.verifyUserAccess)("read:logs",t),function(e,t,r){Object(_lib_getApiToken__WEBPACK_IMPORTED_MODULE_11__.default)(e).then(function(n){var o={uri:`https://${_lib_config__WEBPACK_IMPORTED_MODULE_6___default()("AUTH0_DOMAIN")}/api/v2/users/${encodeURIComponent(e.params.id)}/logs`,headers:{authorization:`Bearer ${n}`},json:!0};return request__WEBPACK_IMPORTED_MODULE_2___default.a.get(o,function(e,n,o){return e?r(e):n.statusCode<200||n.statusCode>=300?(_lib_logger__WEBPACK_IMPORTED_MODULE_7___default.a.error("Log response failed: ",n.headers),r(new Error(o&&(o.error||o.message||o.code)||`Request Error: ${n.statusCode}`))):t.json(o)})}).catch(r)}),r.delete("/:id/multifactor/:provider",Object(_lib_middlewares__WEBPACK_IMPORTED_MODULE_8__.verifyUserAccess)("remove:multifactor-provider",t),function(e,t,r){var n=e.params.provider,o=e.params.id;"duo"===n||"google-authenticator"===n?e.auth0.users.deleteMultifactorProvider({id:o,provider:n}).then(function(){return t.sendStatus(204)}).catch(r):Object(_lib_getApiToken__WEBPACK_IMPORTED_MODULE_11__.default)(e).then(function(e){return Object(_lib_removeGuardian__WEBPACK_IMPORTED_MODULE_9__.removeGuardian)(e,o)}).then(function(){return t.sendStatus(204)}).catch(r)}),r.put("/:id/block",Object(_lib_middlewares__WEBPACK_IMPORTED_MODULE_8__.verifyUserAccess)("block:user",t),function(e,t,r){e.auth0.users.update({id:e.params.id},{blocked:!0}).then(function(){return t.sendStatus(204)}).catch(r)}),r.put("/:id/unblock",Object(_lib_middlewares__WEBPACK_IMPORTED_MODULE_8__.verifyUserAccess)("unblock:user",t),function(e,t,r){e.auth0.users.update({id:e.params.id},{blocked:!1}).then(function(){return t.sendStatus(204)}).catch(r)}),r.delete("/:id/blocks",Object(_lib_middlewares__WEBPACK_IMPORTED_MODULE_8__.verifyUserAccess)("unblock:user",t),function(e,t,r){Object(_lib_getApiToken__WEBPACK_IMPORTED_MODULE_11__.default)(e).then(function(t){return Object(_lib_userBlocks__WEBPACK_IMPORTED_MODULE_10__.removeUserBlocks)(t,e.params.id)}).then(function(){return t.sendStatus(204)}).catch(r)}),r.post("/:id/send-verification-email",Object(_lib_middlewares__WEBPACK_IMPORTED_MODULE_8__.verifyUserAccess)("send:verification-email",t),function(e,t,r){var n={user_id:e.params.id};e.auth0.jobs.verifyEmail(n).then(function(){return t.status(204).send()}).catch(r)}),r}},function(e,t){e.exports=require("request@2.67.0")},function(e,t,r){"use strict";r.r(t),r.d(t,"requestGuardianEnrollments",function(){return c}),r.d(t,"removeGuardian",function(){return d});var n=r(17),o=r.n(n),i=r(24),s=r.n(i),a=r(75),u=r.n(a),c=function(e,t){return new o.a(function(r,n){s.a.get(`https://${u()("AUTH0_DOMAIN")}/api/v2/users/${t}/enrollments`).set("Authorization",`Bearer ${e}`).set("Content-Type","application/json").end(function(e,t){if(e)return n(e);var o=t&&t.body&&t.body[0]?t.body[0].id:null;return r(o)})})},d=function(e,t){return c(e,t).then(function(t){return function(e,t){return new o.a(function(r,n){return t?s.a.del(`https://${u()("AUTH0_DOMAIN")}/api/v2/guardian/enrollments/${t}`).set("Authorization",`Bearer ${e}`).set("Content-Type","application/json").end(function(e){return e?n(e):r()}):r(null)})}(e,t)})}},function(e,t,r){"use strict";r.r(t),r.d(t,"requestUserBlocks",function(){return c}),r.d(t,"removeUserBlocks",function(){return d});var n=r(17),o=r.n(n),i=r(24),s=r.n(i),a=r(75),u=r.n(a),c=function(e,t){return new o.a(function(r,n){s.a.get(`https://${u()("AUTH0_DOMAIN")}/api/v2/user-blocks/${t}`).set("Authorization",`Bearer ${e}`).set("Content-Type","application/json").end(function(e,t){if(e)return n(e);var o=t&&t.body&&t.body.blocked_for?t.body.blocked_for:null;return r(o)})})},d=function(e,t){return new o.a(function(r,n){s.a.del(`https://${u()("AUTH0_DOMAIN")}/api/v2/user-blocks/${t}`).set("Authorization",`Bearer ${e}`).set("Content-Type","application/json").end(function(e,t){return e?n(e):r(t)})})}},function(e,t,r){"use strict";r.r(t);var n=r(17),o=r.n(n),i=r(3),s=r(75),a=r.n(s);t.default=function(e){return e&&e.user&&e.user.access_token?new o.a(function(t){return t(e.user.access_token)}):i.managementApi.getAccessTokenCached(a()("AUTH0_DOMAIN"),a()("AUTH0_CLIENT_ID"),a()("AUTH0_CLIENT_SECRET"))}},function(e,t,r){"use strict";r.r(t);var n=r(17),o=r.n(n);t.default=function(e,t){var r=Array.isArray(global.connections)&&global.connections.filter(function(e){return e.name===t})[0];return r?o.a.resolve(r.id):e.connections.getAll({name:t,fields:"id"}).then(function(e){return e&&e[0]&&e[0].id})}},function(e,t,r){"use strict";r.r(t);var n=r(63),o=r(1),i=r(75),s=r.n(i),a=r(83),u=r.n(a);t.default=function(){var e=o.middlewares.validateHookToken(s()("AUTH0_DOMAIN"),s()("WT_URL"),s()("EXTENSION_SECRET")),t=Object(n.Router)();return t.use("/on-uninstall",e("/.extensions/on-uninstall")),t.use(o.middlewares.managementApiClient({domain:s()("AUTH0_DOMAIN"),clientId:s()("AUTH0_CLIENT_ID"),clientSecret:s()("AUTH0_CLIENT_SECRET")})),t.delete("/on-uninstall",function(e,t){u.a.debug("Uninstall running..."),e.auth0.clients.delete({client_id:s()("AUTH0_CLIENT_ID")}).then(function(){u.a.debug(`Deleted client: ${s()("AUTH0_CLIENT_ID")}`),t.sendStatus(204)}).catch(function(e){u.a.debug(`Error deleting client: ${s()("AUTH0_CLIENT_ID")}`),u.a.error(e),t.sendStatus(204)})}),t}},function(e,t,r){"use strict";r.r(t);var n=r(63),o=r.n(n),i=r(103);t.default=function(){var e=o.a.Router();return e.get("/",function(e,t){t.status(200).send(i)}),e}},function(e){e.exports={title:"Delegated Administration Dashboard",name:"auth0-delegated-admin",version:"4.3.0",author:"auth0",useHashName:!1,description:"This extension allows non-dashboard administrators to manage (a subset of) users.",type:"application",category:"end_user",logoUrl:"https://cdn.auth0.com/extensions/auth0-delegated-admin/assets/logo.svg",initialUrlPath:"/",docsUrl:"https://auth0.com/docs/extensions/delegated-admin",repository:"https://github.com/auth0-extensions/auth0-delegated-administration-extension",keywords:["auth0","extension"],auth0:{createClient:!0,onUninstallPath:"/.extensions/on-uninstall",scopes:"read:clients delete:clients read:connections read:users update:users delete:users create:users read:logs read:device_credentials update:device_credentials delete:device_credentials delete:guardian_enrollments"},secrets:{EXTENSION_CLIENT_ID:{description:"Client ID of the application you created in the Auth0 Dashboard",required:!0},TITLE:{description:"Custom title for the dashboard",example:"Fabrikam User Management",required:!1},CUSTOM_CSS:{description:"A CSS file containing custom styles for the extension",example:"https://cdn.fabrikam.com/static/extensions/theme/fabrikam.css",required:!1},FAVICON_PATH:{description:"Path to custom favicon",example:"https://cdn.fabrikam.com/static/extensions/theme/favicon.png",required:!1},AUTH0_CUSTOM_DOMAIN:{description:"Custom domain",example:"example.com",required:!1},USER_SEARCH_ENGINE:{description:"User search engine. Cloud only supports V3",type:"select",default:"v3",allowMultiple:!1,options:[{value:"v3",text:"v3"},{value:"v2",text:"v2"}]},FEDERATED_LOGOUT:{description:"Also sign out from the IDP when users logout?",type:"select",allowMultiple:!1,options:[{value:"false",text:"No"},{value:"true",text:"Yes"}]}}}},function(e,t,r){"use strict";r.r(t),function(e){r(77),r(16);var n=r(42),o=r.n(n),i=r(105),s=r.n(i),a=(r(66),r(1)),u=r(75),c=r.n(u);t.default=function(){var e='\n    <!DOCTYPE html>\n    <html lang="en">\n    <head>\n      <title><%= config.TITLE %></title>\n      <meta charset="UTF-8" />\n      <meta http-equiv="X-UA-Compatible" content="IE=Edge" />\n      <meta name="viewport" content="width=device-width, initial-scale=1.0" />\n      <link rel="shortcut icon" href="<%= assets.favIcon %>" />\n      <meta name="viewport" content="width=device-width, initial-scale=1">\n      <link rel="stylesheet" type="text/css" href="https://cdn.auth0.com/styles/zocial.min.css" />\n      <link rel="stylesheet" type="text/css" href="https://cdn.auth0.com/manage/v0.3.1672/css/index.min.css" />\n      <link rel="stylesheet" type="text/css" href="https://cdn.auth0.com/styleguide/4.6.13/index.min.css" />\n      <% if (assets.style) { %><link rel="stylesheet" type="text/css" href="/app/<%= assets.style %>" /><% } %>\n      <% if (assets.version) { %><link rel="stylesheet" type="text/css" href="<%= assets.cdnPath %>/auth0-delegated-admin.ui.<%= assets.version %>.css" /><% } %>\n      <% if (assets.customCss) { %><link rel="stylesheet" type="text/css" href="<%= assets.customCss %>" /><% } %>\n    </head>\n    <body>\n      <div id="app"></div>\n      <script src="https://cdn.auth0.com/js/auth0/9.8.2/auth0.min.js"><\/script>\n      <script type="text/javascript" src="//cdn.auth0.com/manage/v0.3.1672/js/bundle.js"><\/script>\n      <script type="text/javascript">window.config = <%- JSON.stringify(config) %>;<\/script>\n      <% if (assets.vendors) { %><script type="text/javascript" src="/app/<%= assets.vendors %>"><\/script><% } %>\n      <% if (assets.app) { %><script type="text/javascript" src="/app/<%= assets.app %>"><\/script><% } %>\n      <% if (assets.version) { %>\n      <script type="text/javascript" src="<%= assets.cdnPath %>/auth0-delegated-admin.ui.vendors.<%= assets.version %>.js"><\/script>\n      <script type="text/javascript" src="<%= assets.cdnPath %>/auth0-delegated-admin.ui.<%= assets.version %>.js"><\/script>\n      <% } %>\n    </body>\n    </html>\n    ';return function(t,r,n){if(0===t.url.indexOf("/api"))return n();var i=function(e){var t=a.urlHelpers.getBasePath(e),r=o.a.parse(e.originalUrl).pathname.replace(t,"").split("/");return["api","login","logs","configuration","users"].indexOf(r[0])<0&&""!==r[0]?r[0]:e.cookies["dae-locale"]||"en"}(t),u=a.urlHelpers.getBasePath(t);if(0!==t.url.indexOf("/login")&&(r.cookie("dae-locale",i),0!==t.url.indexOf(`/${i}`)))return r.redirect(`${u}${i}${t.url||"/login"}`);var d={AUTH0_DOMAIN:c()("AUTH0_DOMAIN"),AUTH0_CUSTOM_DOMAIN:c()("AUTH0_CUSTOM_DOMAIN"),IS_APPLIANCE:c()("IS_APPLIANCE"),AUTH0_CLIENT_ID:c()("EXTENSION_CLIENT_ID"),EXTEND_URL:c()("EXTEND_URL"),BASE_URL:a.urlHelpers.getBaseUrl(t),BASE_PATH:`${u}${i}/`,TITLE:c()("TITLE"),FEDERATED_LOGOUT:"true"===c()("FEDERATED_LOGOUT"),AUTH0_MANAGE_URL:c()("AUTH0_MANAGE_URL")||"https://manage.auth0.com",LOCALE:i},l=Object({WARN_DB_SIZE:409600,MAX_MULTISELECT_USERS:5,MULTISELECT_DEBOUNCE_MS:250,PER_PAGE:10,NODE_ENV:"production",CLIENT_VERSION:"4.3.0"}).PR_NUMBER,_=c()("FAVICON_PATH")||"https://cdn.auth0.com/styleguide/4.6.13/lib/logos/img/favicon.png",f=c()("CDN_PATH")||(l?`//s3.amazonaws.com/extensions-review/auth0-delegated-admin-pr-${l}/assets`:"//cdn.auth0.com/extensions/auth0-delegated-admin/assets");return r.send(s.a.render(e,{config:d,assets:{customCss:c()("CUSTOM_CSS"),version:"4.3.0",cdnPath:f,favIcon:_}}))}}}.call(this,"/")},function(e,t){e.exports=require("ejs@2.3.1")}]);