{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 8de3655084796eaf9f98","webpack:///./dist/packages/common/dist/common.es5.js","webpack:///./node_modules/tslib/tslib.es6.js","webpack:///./dist/packages/logging/dist/logging.es5.js","webpack:///./build/packages/config-store/es5/src/providers/cachingConfigurationProvider.js","webpack:///./build/packages/config-store/es5/src/exceptions.js","webpack:///./build/packages/config-store/es5/index.js","webpack:///./build/packages/config-store/es5/src/configstore.js","webpack:///./build/packages/config-store/es5/src/configuration.js","webpack:///(webpack)/buildin/global.js","webpack:///./node_modules/adal-angular/lib/adal.js","webpack:///./build/packages/config-store/es5/src/providers/index.js","webpack:///./build/packages/config-store/es5/src/providers/spListConfigurationProvider.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC7DA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACoB;AACH;AACA;;AAEjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,uBAAuB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,uBAAuB;AAC3C;AACA;AACA;AACA,iCAAiC,mCAAmC,EAAE;AACtE,8BAA8B,6DAA6D,EAAE;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,WAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,qBAAqB;AACtD;AACA;AACA;AACA;AACA,+CAA+C,kBAAkB,EAAE,gBAAgB,aAAa;AAChG;AACA,8BAA8B,yBAAyB,EAAE;AACzD;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA,oCAAoC,kBAAkB;AACtD;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,iDAAiD;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,iCAAiC,cAAc;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,mDAAmD;AACrF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,sBAAsB,EAAE;AACjF;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,WAAW;AACzC,gCAAgC,aAAa;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,4BAA4B,uBAAuB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,6BAA6B,uEAAuE;AACpG;AACA;AACA;AACA;AACA,4BAA4B,uBAAuB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,0EAAoB,SAAS,2EAA2E;AACxG;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC;AACD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,4BAA4B;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,wBAAwB;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,uCAAuC;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,gCAAgC,2BAA2B;AAC3D;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,eAAe;AAC/C,kCAAkC,iBAAiB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC;;AAEO;AACR;;;;;;;;;;;;;;;;;;;;;;;;;;;AC7+BA;AAAA;AACA;AACA,+DAA+D;AAC/D;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,MAAM,gBAAgB,sCAAsC,iBAAiB,EAAE;AAC/E,qBAAqB,uDAAuD;;AAE5E;AACA;AACA,mBAAmB,sBAAsB;AACzC;AACA;;AAEA;AACA,4CAA4C,OAAO;AACnD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,4DAA4D,cAAc;AAC1E;AACA;AACA;;AAEA;AACA;AACA;AACA,4CAA4C,QAAQ;AACpD;AACA;;AAEA;AACA,mCAAmC,oCAAoC;AACvE;;AAEA;AACA;AACA;;AAEA;AACA;AACA,mCAAmC,MAAM,6BAA6B,EAAE,YAAY,WAAW,EAAE;AACjG,kCAAkC,MAAM,iCAAiC,EAAE,YAAY,WAAW,EAAE;AACpG,+BAA+B,iEAAiE,uBAAuB,EAAE,4BAA4B;AACrJ;AACA,KAAK;AACL;;AAEA;AACA,aAAa,6BAA6B,0BAA0B,aAAa,EAAE,qBAAqB;AACxG,gBAAgB,qDAAqD,oEAAoE,aAAa,EAAE;AACxJ,sBAAsB,sBAAsB,qBAAqB,GAAG;AACpE;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC;AACvC,kCAAkC,SAAS;AAC3C,kCAAkC,WAAW,UAAU;AACvD,yCAAyC,cAAc;AACvD;AACA,6GAA6G,OAAO,UAAU;AAC9H,gFAAgF,iBAAiB,OAAO;AACxG,wDAAwD,gBAAgB,QAAQ,OAAO;AACvF,8CAA8C,gBAAgB,gBAAgB,OAAO;AACrF;AACA,iCAAiC;AACjC;AACA;AACA,SAAS,YAAY,aAAa,OAAO,EAAE,UAAU,WAAW;AAChE,mCAAmC,SAAS;AAC5C;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,MAAM,gBAAgB;AACzC;AACA;AACA;AACA;AACA,iBAAiB,sBAAsB;AACvC;AACA;AACA;;AAEA;AACA,4BAA4B,sBAAsB;AAClD;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB,sFAAsF,aAAa,EAAE;AACtH,sBAAsB,gCAAgC,qCAAqC,0CAA0C,EAAE,EAAE,GAAG;AAC5I,2BAA2B,MAAM,eAAe,EAAE,YAAY,oBAAoB,EAAE;AACpF,sBAAsB,oGAAoG;AAC1H,6BAA6B,uBAAuB;AACpD,4BAA4B,wBAAwB;AACpD,2BAA2B,yDAAyD;AACpF;;AAEA;AACA;AACA,iBAAiB,4CAA4C,SAAS,EAAE,qDAAqD,aAAa,EAAE;AAC5I,yBAAyB,gCAAgC,oBAAoB,gDAAgD,gBAAgB,GAAG;AAChJ;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,gCAAgC,uCAAuC,aAAa,EAAE,EAAE,OAAO,kBAAkB;AACjH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,4CAA4C;AAC5C;;;;;;;;;;ACjLA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA,2CAA2C,4CAA4C,EAAE;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,yBAAyB;AACxD,6BAA6B,iCAAiC;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,yBAAyB;AACxD,6BAA6B,8CAA8C;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,wDAAwD;AACrF;AACA;AACA,CAAC;AACD;AACA;AACA,wCAAwC,kCAAkC;AAC1E,qCAAqC,kBAAkB;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,+BAA+B,yBAAyB;AACxD,kBAAkB,iCAAiC;AACnD;AACA;AACA;AACA,wDAAwD,8BAA8B,EAAE;AACxF;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAEO;AACR;;;;;;;;;;AC/M2B;AACS;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uBAAuB;AACtC,eAAe,OAAO;AACtB,eAAe,gBAAgB;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,2BAA2B;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA,wD;;;;;;;;;;AC3DA;AACiB;AACjB;AACA;AACA;AACA,6BAA6B,sFAAsF;AACnH;AACA;AACA,0EAAoB,SAAS,2EAA2E;AACxG;AACA;AACA;AACA,CAAC;AACO;AACR,sC;;;;;;;;;;;;;ACdA;AACA,iC;;;;;;;;;;;;;;ACDA;AACA;AACA;AACA,uC;;;;;;;;;ACHqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,IAAI;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,eAAe,uBAAuB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,gBAAgB,IAAI;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACO;AACR,yC;;;;;;ACxFA;;AAEA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;;AAEA;AACA;AACA,4CAA4C;;AAE5C;;;;;;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B,mBAAmB,MAAM,4BAA4B,oBAAoB;AACzE,mBAAmB,QAAQ;AAC3B,mBAAmB,OAAO;AAC1B,mBAAmB,SAAS;AAC5B,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B,mBAAmB,eAAe;AAClC,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B;;AAEA;AACA;AACA;AACA,eAAe,OAAO;AACtB;;AAEA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,mEAAmE;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,SAAS;AACT;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS;;AAET,8CAA8C,eAAe;AAC7D;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,kBAAkB,OAAO;AACzB,kBAAkB,OAAO;AACzB;;AAEA;AACA;AACA,iBAAiB,KAAK;AACtB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,+BAA+B,8DAA8D;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,SAAS;AACT;;AAEA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;;AAEA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,cAAc;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,2BAA2B,mCAAmC;AAC9D;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,KAAK;AACpB;;AAEA;AACA;AACA,eAAe,aAAa;AAC5B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,aAAa;AACb;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;;AAEA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,aAAa;AAChC,mBAAmB,QAAQ;AAC3B,mBAAmB,OAAO;AAC1B,mBAAmB,QAAQ;AAC3B;;AAEA;AACA;AACA,iBAAiB,YAAY;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;;AAEA;;AAEA;AACA;AACA,oDAAoD;AACpD;AACA;;AAEA;AACA;AACA;AACA;AACA,mCAAmC,kCAAkC;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,2BAA2B,yBAAyB;AACpD;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,2BAA2B,wBAAwB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,2BAA2B,+BAA+B;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,+DAA+D;AAC/D;AACA;;AAEA;;AAEA;AACA;AACA,sEAAsE;AACtE;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;;AAEA;AACA;AACA,2BAA2B,2CAA2C;AACtE;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;;AAEA;AACA;AACA,aAAa;AACb;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,aAAa;AACb;AACA;;AAEA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,0EAA0E;AAC1E;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA,uBAAuB,YAAY;AACnC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD;AACzD;AACA;AACA;AACA;AACA,8BAA8B;AAC9B,8BAA8B;AAC9B;AACA,8BAA8B;AAC9B,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,QAAQ;AACnC;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,6BAA6B;AAC7B,6BAA6B;AAC7B;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD,4DAA4D;AAC5D,gFAAgF;AAChF,0DAA0D;AAC1D,yEAAyE;AACzE,wBAAwB;AACxB,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD;AACrD,8DAA8D;AAC9D,kFAAkF;AAClF,4DAA4D;AAC5D,2EAA2E;AAC3E,wBAAwB;AACxB,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,CAAC;;;;;;;;;;;;ACl5DkD;AACD;AAClD,iC;;;;;;;;ACFkD;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA;AACA,mCAAmC,sBAAsB;AACzD,sCAAsC,wBAAwB;AAC9D,wCAAwC,0BAA0B;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,2BAA2B;AAC3C;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA,SAAS,IAAI,EAAE,EAAE;AACjB;AACA;AACA;AACA;AACA,gBAAgB,6BAA6B;AAC7C;AACA;AACA,kCAAkC,gFAAgF;AAClH;AACA;AACA;AACA,CAAC;AACD;AACA,uD","file":"config-store.es5.umd.bundle.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"pnp\"] = factory();\n\telse\n\t\troot[\"pnp\"] = factory();\n})(typeof self !== 'undefined' ? self : this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 5);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 8de3655084796eaf9f98","/**\n@license\n * @pnp/common v1.0.5-1 - pnp - provides shared functionality across all pnp libraries\n * MIT (https://github.com/pnp/pnpjs/blob/master/LICENSE)\n * Copyright (c) 2018 Microsoft\n * docs: https://pnp.github.io/pnpjs/\n * source: https:github.com/pnp/pnpjs\n * bugs: https://github.com/pnp/pnpjs/issues\n */\nimport { __extends } from 'tslib';\nimport { inject } from 'adal-angular';\nimport { Logger } from '@pnp/logging';\n\n/**\r\n * Gets a callback function which will maintain context across async calls.\r\n * Allows for the calling pattern getCtxCallback(thisobj, method, methodarg1, methodarg2, ...)\r\n *\r\n * @param context The object that will be the 'this' value in the callback\r\n * @param method The method to which we will apply the context and parameters\r\n * @param params Optional, additional arguments to supply to the wrapped method when it is invoked\r\n */\r\nfunction getCtxCallback(context, method) {\r\n var params = [];\r\n for (var _i = 2; _i < arguments.length; _i++) {\r\n params[_i - 2] = arguments[_i];\r\n }\r\n return function () {\r\n method.apply(context, params);\r\n };\r\n}\r\n/**\r\n * Adds a value to a date\r\n *\r\n * @param date The date to which we will add units, done in local time\r\n * @param interval The name of the interval to add, one of: ['year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second']\r\n * @param units The amount to add to date of the given interval\r\n *\r\n * http://stackoverflow.com/questions/1197928/how-to-add-30-minutes-to-a-javascript-date-object\r\n */\r\nfunction dateAdd(date, interval, units) {\r\n var ret = new Date(date); // don't change original date\r\n switch (interval.toLowerCase()) {\r\n case \"year\":\r\n ret.setFullYear(ret.getFullYear() + units);\r\n break;\r\n case \"quarter\":\r\n ret.setMonth(ret.getMonth() + 3 * units);\r\n break;\r\n case \"month\":\r\n ret.setMonth(ret.getMonth() + units);\r\n break;\r\n case \"week\":\r\n ret.setDate(ret.getDate() + 7 * units);\r\n break;\r\n case \"day\":\r\n ret.setDate(ret.getDate() + units);\r\n break;\r\n case \"hour\":\r\n ret.setTime(ret.getTime() + units * 3600000);\r\n break;\r\n case \"minute\":\r\n ret.setTime(ret.getTime() + units * 60000);\r\n break;\r\n case \"second\":\r\n ret.setTime(ret.getTime() + units * 1000);\r\n break;\r\n default:\r\n ret = undefined;\r\n break;\r\n }\r\n return ret;\r\n}\r\n/**\r\n * Combines an arbitrary set of paths ensuring and normalizes the slashes\r\n *\r\n * @param paths 0 to n path parts to combine\r\n */\r\nfunction combinePaths() {\r\n var paths = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n paths[_i] = arguments[_i];\r\n }\r\n return paths\r\n .filter(function (path) { return !stringIsNullOrEmpty(path); })\r\n .map(function (path) { return path.replace(/^[\\\\|\\/]/, \"\").replace(/[\\\\|\\/]$/, \"\"); })\r\n .join(\"/\")\r\n .replace(/\\\\/g, \"/\");\r\n}\r\n/**\r\n * Gets a random string of chars length\r\n *\r\n * https://stackoverflow.com/questions/1349404/generate-random-string-characters-in-javascript\r\n *\r\n * @param chars The length of the random string to generate\r\n */\r\nfunction getRandomString(chars) {\r\n var text = new Array(chars);\r\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\r\n for (var i = 0; i < chars; i++) {\r\n text[i] = possible.charAt(Math.floor(Math.random() * possible.length));\r\n }\r\n return text.join(\"\");\r\n}\r\n/**\r\n * Gets a random GUID value\r\n *\r\n * http://stackoverflow.com/questions/105034/create-guid-uuid-in-javascript\r\n */\r\n/* tslint:disable no-bitwise */\r\nfunction getGUID() {\r\n var d = new Date().getTime();\r\n var guid = \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, function (c) {\r\n var r = (d + Math.random() * 16) % 16 | 0;\r\n d = Math.floor(d / 16);\r\n return (c === \"x\" ? r : (r & 0x3 | 0x8)).toString(16);\r\n });\r\n return guid;\r\n}\r\n/* tslint:enable */\r\n/**\r\n * Determines if a given value is a function\r\n *\r\n * @param cf The thing to test for functionness\r\n */\r\nfunction isFunc(cf) {\r\n return typeof cf === \"function\";\r\n}\r\n/**\r\n * Determines if an object is both defined and not null\r\n * @param obj Object to test\r\n */\r\nfunction objectDefinedNotNull(obj) {\r\n return typeof obj !== \"undefined\" && obj !== null;\r\n}\r\n/**\r\n * @returns whether the provided parameter is a JavaScript Array or not.\r\n*/\r\nfunction isArray(array) {\r\n if (Array.isArray) {\r\n return Array.isArray(array);\r\n }\r\n return array && typeof array.length === \"number\" && array.constructor === Array;\r\n}\r\n/**\r\n * Provides functionality to extend the given object by doing a shallow copy\r\n *\r\n * @param target The object to which properties will be copied\r\n * @param source The source object from which properties will be copied\r\n * @param noOverwrite If true existing properties on the target are not overwritten from the source\r\n *\r\n */\r\nfunction extend(target, source, noOverwrite) {\r\n if (noOverwrite === void 0) { noOverwrite = false; }\r\n if (!objectDefinedNotNull(source)) {\r\n return target;\r\n }\r\n // ensure we don't overwrite things we don't want overwritten\r\n var check = noOverwrite ? function (o, i) { return !(i in o); } : function () { return true; };\r\n return Object.getOwnPropertyNames(source)\r\n .filter(function (v) { return check(target, v); })\r\n .reduce(function (t, v) {\r\n t[v] = source[v];\r\n return t;\r\n }, target);\r\n}\r\n/**\r\n * Determines if a given url is absolute\r\n *\r\n * @param url The url to check to see if it is absolute\r\n */\r\nfunction isUrlAbsolute(url) {\r\n return /^https?:\\/\\/|^\\/\\//i.test(url);\r\n}\r\n/**\r\n * Determines if a string is null or empty or undefined\r\n *\r\n * @param s The string to test\r\n */\r\nfunction stringIsNullOrEmpty(s) {\r\n return typeof s === \"undefined\" || s === null || s.length < 1;\r\n}\r\nvar Util = /** @class */ (function () {\r\n function Util() {\r\n }\r\n /**\r\n * Gets a callback function which will maintain context across async calls.\r\n * Allows for the calling pattern getCtxCallback(thisobj, method, methodarg1, methodarg2, ...)\r\n *\r\n * @param context The object that will be the 'this' value in the callback\r\n * @param method The method to which we will apply the context and parameters\r\n * @param params Optional, additional arguments to supply to the wrapped method when it is invoked\r\n */\r\n Util.getCtxCallback = getCtxCallback;\r\n /**\r\n * Adds a value to a date\r\n *\r\n * @param date The date to which we will add units, done in local time\r\n * @param interval The name of the interval to add, one of: ['year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second']\r\n * @param units The amount to add to date of the given interval\r\n *\r\n * http://stackoverflow.com/questions/1197928/how-to-add-30-minutes-to-a-javascript-date-object\r\n */\r\n Util.dateAdd = dateAdd;\r\n /**\r\n * Combines an arbitrary set of paths ensuring and normalizes the slashes\r\n *\r\n * @param paths 0 to n path parts to combine\r\n */\r\n Util.combinePaths = combinePaths;\r\n /**\r\n * Gets a random string of chars length\r\n *\r\n * @param chars The length of the random string to generate\r\n */\r\n Util.getRandomString = getRandomString;\r\n /**\r\n * Gets a random GUID value\r\n *\r\n * http://stackoverflow.com/questions/105034/create-guid-uuid-in-javascript\r\n */\r\n Util.getGUID = getGUID;\r\n /**\r\n * Determines if a given value is a function\r\n *\r\n * @param cf The thing to test for functionness\r\n */\r\n Util.isFunc = isFunc;\r\n /**\r\n * Determines if an object is both defined and not null\r\n * @param obj Object to test\r\n */\r\n Util.objectDefinedNotNull = objectDefinedNotNull;\r\n /**\r\n * @returns whether the provided parameter is a JavaScript Array or not.\r\n */\r\n Util.isArray = isArray;\r\n /**\r\n * Provides functionality to extend the given object by doing a shallow copy\r\n *\r\n * @param target The object to which properties will be copied\r\n * @param source The source object from which properties will be copied\r\n * @param noOverwrite If true existing properties on the target are not overwritten from the source\r\n *\r\n */\r\n Util.extend = extend;\r\n /**\r\n * Determines if a given url is absolute\r\n *\r\n * @param url The url to check to see if it is absolute\r\n */\r\n Util.isUrlAbsolute = isUrlAbsolute;\r\n /**\r\n * Determines if a string is null or empty or undefined\r\n *\r\n * @param s The string to test\r\n */\r\n Util.stringIsNullOrEmpty = stringIsNullOrEmpty;\r\n return Util;\r\n}());\n\nfunction mergeHeaders(target, source) {\r\n if (typeof source !== \"undefined\" && source !== null) {\r\n var temp = new Request(\"\", { headers: source });\r\n temp.headers.forEach(function (value, name) {\r\n target.append(name, value);\r\n });\r\n }\r\n}\r\nfunction mergeOptions(target, source) {\r\n if (objectDefinedNotNull(source)) {\r\n var headers = extend(target.headers || {}, source.headers);\r\n target = extend(target, source);\r\n target.headers = headers;\r\n }\r\n}\r\n/**\r\n * Makes requests using the global/window fetch API\r\n */\r\nvar FetchClient = /** @class */ (function () {\r\n function FetchClient() {\r\n }\r\n FetchClient.prototype.fetch = function (url, options) {\r\n return global.fetch(url, options);\r\n };\r\n return FetchClient;\r\n}());\r\n/**\r\n * Makes requests using the fetch API adding the supplied token to the Authorization header\r\n */\r\nvar BearerTokenFetchClient = /** @class */ (function (_super) {\r\n __extends(BearerTokenFetchClient, _super);\r\n function BearerTokenFetchClient(_token) {\r\n var _this = _super.call(this) || this;\r\n _this._token = _token;\r\n return _this;\r\n }\r\n Object.defineProperty(BearerTokenFetchClient.prototype, \"token\", {\r\n get: function () {\r\n return this._token;\r\n },\r\n set: function (token) {\r\n this._token = token;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n BearerTokenFetchClient.prototype.fetch = function (url, options) {\r\n if (options === void 0) { options = {}; }\r\n var headers = new Headers();\r\n mergeHeaders(headers, options.headers);\r\n headers.set(\"Authorization\", \"Bearer \" + this._token);\r\n options.headers = headers;\r\n return _super.prototype.fetch.call(this, url, options);\r\n };\r\n return BearerTokenFetchClient;\r\n}(FetchClient));\n\n/**\r\n * Azure AD Client for use in the browser\r\n */\r\nvar AdalClient = /** @class */ (function (_super) {\r\n __extends(AdalClient, _super);\r\n /**\r\n * Creates a new instance of AdalClient\r\n * @param clientId Azure App Id\r\n * @param tenant Office 365 tenant (Ex: {tenant}.onmicrosoft.com)\r\n * @param redirectUri The redirect url used to authenticate the\r\n */\r\n function AdalClient(clientId, tenant, redirectUri) {\r\n var _this = _super.call(this, null) || this;\r\n _this.clientId = clientId;\r\n _this.tenant = tenant;\r\n _this.redirectUri = redirectUri;\r\n return _this;\r\n }\r\n /**\r\n * Creates a new AdalClient using the values of the supplied SPFx context\r\n *\r\n * @param spfxContext Current SPFx context\r\n * @param clientId Optional client id to use instead of the built-in SPFx id\r\n * @description Using this method and the default clientId requires that the features described in\r\n * this article https://docs.microsoft.com/en-us/sharepoint/dev/spfx/use-aadhttpclient are activated in the tenant. If not you can\r\n * creat your own app, grant permissions and use that clientId here along with the SPFx context\r\n */\r\n AdalClient.fromSPFxContext = function (spfxContext, cliendId) {\r\n if (cliendId === void 0) { cliendId = \"c58637bb-e2e1-4312-8a00-04b5ffcd3403\"; }\r\n // this \"magic\" client id is the one to which permissions are granted behind the scenes\r\n // this redirectUrl is the page as used by spfx\r\n return new AdalClient(cliendId, spfxContext.pageContext.aadInfo.tenantId.toString(), combinePaths(window.location.origin, \"/_forms/spfxsinglesignon.aspx\"));\r\n };\r\n /**\r\n * Conducts the fetch opertation against the AAD secured resource\r\n *\r\n * @param url Absolute URL for the request\r\n * @param options Any fetch options passed to the underlying fetch implementation\r\n */\r\n AdalClient.prototype.fetch = function (url, options) {\r\n var _this = this;\r\n if (!isUrlAbsolute(url)) {\r\n throw new Error(\"You must supply absolute urls to AdalClient.fetch.\");\r\n }\r\n // the url we are calling is the resource\r\n return this.getToken(this.getResource(url)).then(function (token) {\r\n _this.token = token;\r\n return _super.prototype.fetch.call(_this, url, options);\r\n });\r\n };\r\n /**\r\n * Gets a token based on the current user\r\n *\r\n * @param resource The resource for which we are requesting a token\r\n */\r\n AdalClient.prototype.getToken = function (resource) {\r\n var _this = this;\r\n return new Promise(function (resolve, reject) {\r\n _this.ensureAuthContext().then(function (_) { return _this.login(); }).then(function (_) {\r\n AdalClient._authContext.acquireToken(resource, function (message, token) {\r\n if (message) {\r\n return reject(new Error(message));\r\n }\r\n resolve(token);\r\n });\r\n }).catch(reject);\r\n });\r\n };\r\n /**\r\n * Ensures we have created and setup the adal AuthenticationContext instance\r\n */\r\n AdalClient.prototype.ensureAuthContext = function () {\r\n var _this = this;\r\n return new Promise(function (resolve) {\r\n if (AdalClient._authContext === null) {\r\n AdalClient._authContext = inject({\r\n clientId: _this.clientId,\r\n displayCall: function (url) {\r\n if (_this._displayCallback) {\r\n _this._displayCallback(url);\r\n }\r\n },\r\n navigateToLoginRequestUrl: false,\r\n redirectUri: _this.redirectUri,\r\n tenant: _this.tenant,\r\n });\r\n }\r\n resolve();\r\n });\r\n };\r\n /**\r\n * Ensures the current user is logged in\r\n */\r\n AdalClient.prototype.login = function () {\r\n var _this = this;\r\n if (this._loginPromise) {\r\n return this._loginPromise;\r\n }\r\n this._loginPromise = new Promise(function (resolve, reject) {\r\n if (AdalClient._authContext.getCachedUser()) {\r\n return resolve();\r\n }\r\n _this._displayCallback = function (url) {\r\n var popupWindow = window.open(url, \"login\", \"width=483, height=600\");\r\n if (!popupWindow) {\r\n return reject(new Error(\"Could not open pop-up window for auth. Likely pop-ups are blocked by the browser.\"));\r\n }\r\n if (popupWindow && popupWindow.focus) {\r\n popupWindow.focus();\r\n }\r\n var pollTimer = window.setInterval(function () {\r\n if (!popupWindow || popupWindow.closed || popupWindow.closed === undefined) {\r\n window.clearInterval(pollTimer);\r\n }\r\n try {\r\n if (popupWindow.document.URL.indexOf(_this.redirectUri) !== -1) {\r\n window.clearInterval(pollTimer);\r\n AdalClient._authContext.handleWindowCallback(popupWindow.location.hash);\r\n popupWindow.close();\r\n resolve();\r\n }\r\n }\r\n catch (e) {\r\n reject(e);\r\n }\r\n }, 30);\r\n };\r\n // this triggers the login process\r\n _this.ensureAuthContext().then(function (_) {\r\n AdalClient._authContext._loginInProgress = false;\r\n AdalClient._authContext.login();\r\n _this._displayCallback = null;\r\n });\r\n });\r\n return this._loginPromise;\r\n };\r\n /**\r\n * Parses out the root of the request url to use as the resource when getting the token\r\n *\r\n * After: https://gist.github.com/jlong/2428561\r\n * @param url The url to parse\r\n */\r\n AdalClient.prototype.getResource = function (url) {\r\n var parser = document.createElement(\"a\");\r\n parser.href = url;\r\n return parser.protocol + \"//\" + parser.hostname;\r\n };\r\n /**\r\n * Our auth context\r\n */\r\n AdalClient._authContext = null;\r\n return AdalClient;\r\n}(BearerTokenFetchClient));\n\n/**\r\n * Reads a blob as text\r\n *\r\n * @param blob The data to read\r\n */\r\nfunction readBlobAsText(blob) {\r\n return readBlobAs(blob, \"string\");\r\n}\r\n/**\r\n * Reads a blob into an array buffer\r\n *\r\n * @param blob The data to read\r\n */\r\nfunction readBlobAsArrayBuffer(blob) {\r\n return readBlobAs(blob, \"buffer\");\r\n}\r\n/**\r\n * Generic method to read blob's content\r\n *\r\n * @param blob The data to read\r\n * @param mode The read mode\r\n */\r\nfunction readBlobAs(blob, mode) {\r\n return new Promise(function (resolve, reject) {\r\n try {\r\n var reader = new FileReader();\r\n reader.onload = function (e) {\r\n resolve(e.target.result);\r\n };\r\n switch (mode) {\r\n case \"string\":\r\n reader.readAsText(blob);\r\n break;\r\n case \"buffer\":\r\n reader.readAsArrayBuffer(blob);\r\n break;\r\n }\r\n }\r\n catch (e) {\r\n reject(e);\r\n }\r\n });\r\n}\n\n/**\r\n * Generic dictionary\r\n */\r\nvar Dictionary = /** @class */ (function () {\r\n /**\r\n * Creates a new instance of the Dictionary class\r\n *\r\n * @constructor\r\n */\r\n function Dictionary(keys, values) {\r\n if (keys === void 0) { keys = []; }\r\n if (values === void 0) { values = []; }\r\n this.keys = keys;\r\n this.values = values;\r\n }\r\n /**\r\n * Gets a value from the collection using the specified key\r\n *\r\n * @param key The key whose value we want to return, returns null if the key does not exist\r\n */\r\n Dictionary.prototype.get = function (key) {\r\n var index = this.keys.indexOf(key);\r\n if (index < 0) {\r\n return null;\r\n }\r\n return this.values[index];\r\n };\r\n /**\r\n * Adds the supplied key and value to the dictionary\r\n *\r\n * @param key The key to add\r\n * @param o The value to add\r\n */\r\n Dictionary.prototype.add = function (key, o) {\r\n var index = this.keys.indexOf(key);\r\n if (index > -1) {\r\n if (o === null) {\r\n this.remove(key);\r\n }\r\n else {\r\n this.values[index] = o;\r\n }\r\n }\r\n else {\r\n if (o !== null) {\r\n this.keys.push(key);\r\n this.values.push(o);\r\n }\r\n }\r\n };\r\n /**\r\n * Merges the supplied typed hash into this dictionary instance. Existing values are updated and new ones are created as appropriate.\r\n */\r\n Dictionary.prototype.merge = function (source) {\r\n var _this = this;\r\n if (\"getKeys\" in source) {\r\n var sourceAsDictionary_1 = source;\r\n sourceAsDictionary_1.getKeys().map(function (key) {\r\n _this.add(key, sourceAsDictionary_1.get(key));\r\n });\r\n }\r\n else {\r\n var sourceAsHash = source;\r\n for (var key in sourceAsHash) {\r\n if (sourceAsHash.hasOwnProperty(key)) {\r\n this.add(key, sourceAsHash[key]);\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * Removes a value from the dictionary\r\n *\r\n * @param key The key of the key/value pair to remove. Returns null if the key was not found.\r\n */\r\n Dictionary.prototype.remove = function (key) {\r\n var index = this.keys.indexOf(key);\r\n if (index < 0) {\r\n return null;\r\n }\r\n var val = this.values[index];\r\n this.keys.splice(index, 1);\r\n this.values.splice(index, 1);\r\n return val;\r\n };\r\n /**\r\n * Returns all the keys currently in the dictionary as an array\r\n */\r\n Dictionary.prototype.getKeys = function () {\r\n return this.keys;\r\n };\r\n /**\r\n * Returns all the values currently in the dictionary as an array\r\n */\r\n Dictionary.prototype.getValues = function () {\r\n return this.values;\r\n };\r\n /**\r\n * Clears the current dictionary\r\n */\r\n Dictionary.prototype.clear = function () {\r\n this.keys = [];\r\n this.values = [];\r\n };\r\n Object.defineProperty(Dictionary.prototype, \"count\", {\r\n /**\r\n * Gets a count of the items currently in the dictionary\r\n */\r\n get: function () {\r\n return this.keys.length;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return Dictionary;\r\n}());\n\nfunction deprecated(deprecationVersion, message) {\r\n return function (target, propertyKey, descriptor) {\r\n var method = descriptor.value;\r\n descriptor.value = function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n Logger.log({\r\n data: {\r\n descriptor: descriptor,\r\n propertyKey: propertyKey,\r\n target: target,\r\n },\r\n level: 2 /* Warning */,\r\n message: \"(\" + deprecationVersion + \") \" + message,\r\n });\r\n return method.apply(this, args);\r\n };\r\n };\r\n}\r\nfunction beta(message) {\r\n if (message === void 0) { message = \"This feature is flagged as beta and is subject to change.\"; }\r\n return function (target, propertyKey, descriptor) {\r\n var method = descriptor.value;\r\n descriptor.value = function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n Logger.log({\r\n data: {\r\n descriptor: descriptor,\r\n propertyKey: propertyKey,\r\n target: target,\r\n },\r\n level: 2 /* Warning */,\r\n message: message,\r\n });\r\n return method.apply(this, args);\r\n };\r\n };\r\n}\n\nvar UrlException = /** @class */ (function (_super) {\r\n __extends(UrlException, _super);\r\n function UrlException(msg) {\r\n var _this = _super.call(this, msg) || this;\r\n _this.name = \"UrlException\";\r\n Logger.log({ data: {}, level: 3 /* Error */, message: \"[\" + _this.name + \"]::\" + _this.message });\r\n return _this;\r\n }\r\n return UrlException;\r\n}(Error));\n\nfunction setup(config) {\r\n RuntimeConfig.extend(config);\r\n}\r\nvar RuntimeConfigImpl = /** @class */ (function () {\r\n function RuntimeConfigImpl() {\r\n this._v = new Dictionary();\r\n // setup defaults\r\n this._v.add(\"defaultCachingStore\", \"session\");\r\n this._v.add(\"defaultCachingTimeoutSeconds\", 60);\r\n this._v.add(\"globalCacheDisable\", false);\r\n this._v.add(\"enableCacheExpiration\", false);\r\n this._v.add(\"cacheExpirationIntervalMilliseconds\", 750);\r\n this._v.add(\"spfxContext\", null);\r\n }\r\n /**\r\n *\r\n * @param config The set of properties to add to the globa configuration instance\r\n */\r\n RuntimeConfigImpl.prototype.extend = function (config) {\r\n var _this = this;\r\n Object.keys(config).forEach(function (key) {\r\n _this._v.add(key, config[key]);\r\n });\r\n };\r\n RuntimeConfigImpl.prototype.get = function (key) {\r\n return this._v.get(key);\r\n };\r\n Object.defineProperty(RuntimeConfigImpl.prototype, \"defaultCachingStore\", {\r\n get: function () {\r\n return this.get(\"defaultCachingStore\");\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(RuntimeConfigImpl.prototype, \"defaultCachingTimeoutSeconds\", {\r\n get: function () {\r\n return this.get(\"defaultCachingTimeoutSeconds\");\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(RuntimeConfigImpl.prototype, \"globalCacheDisable\", {\r\n get: function () {\r\n return this.get(\"globalCacheDisable\");\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(RuntimeConfigImpl.prototype, \"enableCacheExpiration\", {\r\n get: function () {\r\n return this.get(\"enableCacheExpiration\");\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(RuntimeConfigImpl.prototype, \"cacheExpirationIntervalMilliseconds\", {\r\n get: function () {\r\n return this.get(\"cacheExpirationIntervalMilliseconds\");\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(RuntimeConfigImpl.prototype, \"spfxContext\", {\r\n get: function () {\r\n return this.get(\"spfxContext\");\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return RuntimeConfigImpl;\r\n}());\r\nvar _runtimeConfig = new RuntimeConfigImpl();\r\nvar RuntimeConfig = _runtimeConfig;\n\n/**\r\n * A wrapper class to provide a consistent interface to browser based storage\r\n *\r\n */\r\nvar PnPClientStorageWrapper = /** @class */ (function () {\r\n /**\r\n * Creates a new instance of the PnPClientStorageWrapper class\r\n *\r\n * @constructor\r\n */\r\n function PnPClientStorageWrapper(store, defaultTimeoutMinutes) {\r\n if (defaultTimeoutMinutes === void 0) { defaultTimeoutMinutes = -1; }\r\n this.store = store;\r\n this.defaultTimeoutMinutes = defaultTimeoutMinutes;\r\n this.enabled = this.test();\r\n // if the cache timeout is enabled call the handler\r\n // this will clear any expired items and set the timeout function\r\n if (RuntimeConfig.enableCacheExpiration) {\r\n Logger.write(\"Enabling cache expiration.\", 1 /* Info */);\r\n this.cacheExpirationHandler();\r\n }\r\n }\r\n /**\r\n * Get a value from storage, or null if that value does not exist\r\n *\r\n * @param key The key whose value we want to retrieve\r\n */\r\n PnPClientStorageWrapper.prototype.get = function (key) {\r\n if (!this.enabled) {\r\n return null;\r\n }\r\n var o = this.store.getItem(key);\r\n if (o == null) {\r\n return null;\r\n }\r\n var persistable = JSON.parse(o);\r\n if (new Date(persistable.expiration) <= new Date()) {\r\n Logger.write(\"Removing item with key '\" + key + \"' from cache due to expiration.\", 1 /* Info */);\r\n this.delete(key);\r\n return null;\r\n }\r\n else {\r\n return persistable.value;\r\n }\r\n };\r\n /**\r\n * Adds a value to the underlying storage\r\n *\r\n * @param key The key to use when storing the provided value\r\n * @param o The value to store\r\n * @param expire Optional, if provided the expiration of the item, otherwise the default is used\r\n */\r\n PnPClientStorageWrapper.prototype.put = function (key, o, expire) {\r\n if (this.enabled) {\r\n this.store.setItem(key, this.createPersistable(o, expire));\r\n }\r\n };\r\n /**\r\n * Deletes a value from the underlying storage\r\n *\r\n * @param key The key of the pair we want to remove from storage\r\n */\r\n PnPClientStorageWrapper.prototype.delete = function (key) {\r\n if (this.enabled) {\r\n this.store.removeItem(key);\r\n }\r\n };\r\n /**\r\n * Gets an item from the underlying storage, or adds it if it does not exist using the supplied getter function\r\n *\r\n * @param key The key to use when storing the provided value\r\n * @param getter A function which will upon execution provide the desired value\r\n * @param expire Optional, if provided the expiration of the item, otherwise the default is used\r\n */\r\n PnPClientStorageWrapper.prototype.getOrPut = function (key, getter, expire) {\r\n var _this = this;\r\n if (!this.enabled) {\r\n return getter();\r\n }\r\n return new Promise(function (resolve) {\r\n var o = _this.get(key);\r\n if (o == null) {\r\n getter().then(function (d) {\r\n _this.put(key, d, expire);\r\n resolve(d);\r\n });\r\n }\r\n else {\r\n resolve(o);\r\n }\r\n });\r\n };\r\n /**\r\n * Deletes any expired items placed in the store by the pnp library, leaves other items untouched\r\n */\r\n PnPClientStorageWrapper.prototype.deleteExpired = function () {\r\n var _this = this;\r\n return new Promise(function (resolve, reject) {\r\n if (!_this.enabled) {\r\n resolve();\r\n }\r\n try {\r\n for (var i = 0; i < _this.store.length; i++) {\r\n var key = _this.store.key(i);\r\n if (key !== null) {\r\n // test the stored item to see if we stored it\r\n if (/[\"|']?pnp[\"|']? ?: ?1/i.test(_this.store.getItem(key))) {\r\n // get those items as get will delete from cache if they are expired\r\n _this.get(key);\r\n }\r\n }\r\n }\r\n resolve();\r\n }\r\n catch (e) {\r\n reject(e);\r\n }\r\n });\r\n };\r\n /**\r\n * Used to determine if the wrapped storage is available currently\r\n */\r\n PnPClientStorageWrapper.prototype.test = function () {\r\n var str = \"test\";\r\n try {\r\n this.store.setItem(str, str);\r\n this.store.removeItem(str);\r\n return true;\r\n }\r\n catch (e) {\r\n return false;\r\n }\r\n };\r\n /**\r\n * Creates the persistable to store\r\n */\r\n PnPClientStorageWrapper.prototype.createPersistable = function (o, expire) {\r\n if (typeof expire === \"undefined\") {\r\n // ensure we are by default inline with the global library setting\r\n var defaultTimeout = RuntimeConfig.defaultCachingTimeoutSeconds;\r\n if (this.defaultTimeoutMinutes > 0) {\r\n defaultTimeout = this.defaultTimeoutMinutes * 60;\r\n }\r\n expire = dateAdd(new Date(), \"second\", defaultTimeout);\r\n }\r\n return JSON.stringify({ pnp: 1, expiration: expire, value: o });\r\n };\r\n /**\r\n * Deletes expired items added by this library in this.store and sets a timeout to call itself\r\n */\r\n PnPClientStorageWrapper.prototype.cacheExpirationHandler = function () {\r\n var _this = this;\r\n Logger.write(\"Called cache expiration handler.\", 0 /* Verbose */);\r\n this.deleteExpired().then(function (_) {\r\n // call ourself in the future\r\n setTimeout(getCtxCallback(_this, _this.cacheExpirationHandler), RuntimeConfig.cacheExpirationIntervalMilliseconds);\r\n }).catch(function (e) {\r\n // we've got some error - so just stop the loop and report the error\r\n Logger.log({\r\n data: e,\r\n level: 3 /* Error */,\r\n message: \"Error deleting expired cache entries, see data for details. Timeout not reset.\",\r\n });\r\n });\r\n };\r\n return PnPClientStorageWrapper;\r\n}());\r\n/**\r\n * A thin implementation of in-memory storage for use in nodejs\r\n */\r\nvar MemoryStorage = /** @class */ (function () {\r\n function MemoryStorage(_store) {\r\n if (_store === void 0) { _store = new Dictionary(); }\r\n this._store = _store;\r\n }\r\n Object.defineProperty(MemoryStorage.prototype, \"length\", {\r\n get: function () {\r\n return this._store.count;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n MemoryStorage.prototype.clear = function () {\r\n this._store.clear();\r\n };\r\n MemoryStorage.prototype.getItem = function (key) {\r\n return this._store.get(key);\r\n };\r\n MemoryStorage.prototype.key = function (index) {\r\n return this._store.getKeys()[index];\r\n };\r\n MemoryStorage.prototype.removeItem = function (key) {\r\n this._store.remove(key);\r\n };\r\n MemoryStorage.prototype.setItem = function (key, data) {\r\n this._store.add(key, data);\r\n };\r\n return MemoryStorage;\r\n}());\r\n/**\r\n * A class that will establish wrappers for both local and session storage\r\n */\r\nvar PnPClientStorage = /** @class */ (function () {\r\n /**\r\n * Creates a new instance of the PnPClientStorage class\r\n *\r\n * @constructor\r\n */\r\n function PnPClientStorage(_local, _session) {\r\n if (_local === void 0) { _local = null; }\r\n if (_session === void 0) { _session = null; }\r\n this._local = _local;\r\n this._session = _session;\r\n }\r\n Object.defineProperty(PnPClientStorage.prototype, \"local\", {\r\n /**\r\n * Provides access to the local storage of the browser\r\n */\r\n get: function () {\r\n if (this._local === null) {\r\n this._local = typeof localStorage !== \"undefined\" ? new PnPClientStorageWrapper(localStorage) : new PnPClientStorageWrapper(new MemoryStorage());\r\n }\r\n return this._local;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(PnPClientStorage.prototype, \"session\", {\r\n /**\r\n * Provides access to the session storage of the browser\r\n */\r\n get: function () {\r\n if (this._session === null) {\r\n this._session = typeof sessionStorage !== \"undefined\" ? new PnPClientStorageWrapper(sessionStorage) : new PnPClientStorageWrapper(new MemoryStorage());\r\n }\r\n return this._session;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return PnPClientStorage;\r\n}());\n\nexport { AdalClient, readBlobAsText, readBlobAsArrayBuffer, Dictionary, deprecated, beta, UrlException, setup, RuntimeConfigImpl, RuntimeConfig, mergeHeaders, mergeOptions, FetchClient, BearerTokenFetchClient, PnPClientStorageWrapper, PnPClientStorage, getCtxCallback, dateAdd, combinePaths, getRandomString, getGUID, isFunc, objectDefinedNotNull, isArray, extend, isUrlAbsolute, stringIsNullOrEmpty, Util };\n//# sourceMappingURL=common.es5.js.map\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./dist/packages/common/dist/common.es5.js\n// module id = 0\n// module chunks = 0","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\r\n t[p[i]] = s[p[i]];\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = y[op[0] & 2 ? \"return\" : op[0] ? \"throw\" : \"next\"]) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [0, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { if (o[n]) i[n] = function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; }; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator];\r\n return m ? m.call(o) : typeof __values === \"function\" ? __values(o) : o[Symbol.iterator]();\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/tslib/tslib.es6.js\n// module id = 1\n// module chunks = 0","/**\n@license\n * @pnp/logging v1.0.5-1 - pnp - light-weight, subscribable logging framework\n * MIT (https://github.com/pnp/pnpjs/blob/master/LICENSE)\n * Copyright (c) 2018 Microsoft\n * docs: https://pnp.github.io/pnpjs/\n * source: https:github.com/pnp/pnpjs\n * bugs: https://github.com/pnp/pnpjs/issues\n */\n/**\r\n * Class used to subscribe ILogListener and log messages throughout an application\r\n *\r\n */\r\nvar Logger = /** @class */ (function () {\r\n function Logger() {\r\n }\r\n Object.defineProperty(Logger, \"activeLogLevel\", {\r\n /**\r\n * Gets or sets the active log level to apply for log filtering\r\n */\r\n get: function () {\r\n return Logger.instance.activeLogLevel;\r\n },\r\n set: function (value) {\r\n Logger.instance.activeLogLevel = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Logger, \"instance\", {\r\n get: function () {\r\n if (typeof Logger._instance === \"undefined\" || Logger._instance === null) {\r\n Logger._instance = new LoggerImpl();\r\n }\r\n return Logger._instance;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Adds ILogListener instances to the set of subscribed listeners\r\n *\r\n * @param listeners One or more listeners to subscribe to this log\r\n */\r\n Logger.subscribe = function () {\r\n var listeners = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n listeners[_i] = arguments[_i];\r\n }\r\n listeners.map(function (listener) { return Logger.instance.subscribe(listener); });\r\n };\r\n /**\r\n * Clears the subscribers collection, returning the collection before modifiction\r\n */\r\n Logger.clearSubscribers = function () {\r\n return Logger.instance.clearSubscribers();\r\n };\r\n Object.defineProperty(Logger, \"count\", {\r\n /**\r\n * Gets the current subscriber count\r\n */\r\n get: function () {\r\n return Logger.instance.count;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Writes the supplied string to the subscribed listeners\r\n *\r\n * @param message The message to write\r\n * @param level [Optional] if supplied will be used as the level of the entry (Default: LogLevel.Verbose)\r\n */\r\n Logger.write = function (message, level) {\r\n if (level === void 0) { level = 0 /* Verbose */; }\r\n Logger.instance.log({ level: level, message: message });\r\n };\r\n /**\r\n * Writes the supplied string to the subscribed listeners\r\n *\r\n * @param json The json object to stringify and write\r\n * @param level [Optional] if supplied will be used as the level of the entry (Default: LogLevel.Verbose)\r\n */\r\n Logger.writeJSON = function (json, level) {\r\n if (level === void 0) { level = 0 /* Verbose */; }\r\n Logger.instance.log({ level: level, message: JSON.stringify(json) });\r\n };\r\n /**\r\n * Logs the supplied entry to the subscribed listeners\r\n *\r\n * @param entry The message to log\r\n */\r\n Logger.log = function (entry) {\r\n Logger.instance.log(entry);\r\n };\r\n /**\r\n * Logs an error object to the subscribed listeners\r\n *\r\n * @param err The error object\r\n */\r\n Logger.error = function (err) {\r\n Logger.instance.log({ data: err, level: 3 /* Error */, message: err.message });\r\n };\r\n return Logger;\r\n}());\r\nvar LoggerImpl = /** @class */ (function () {\r\n function LoggerImpl(activeLogLevel, subscribers) {\r\n if (activeLogLevel === void 0) { activeLogLevel = 2 /* Warning */; }\r\n if (subscribers === void 0) { subscribers = []; }\r\n this.activeLogLevel = activeLogLevel;\r\n this.subscribers = subscribers;\r\n }\r\n LoggerImpl.prototype.subscribe = function (listener) {\r\n this.subscribers.push(listener);\r\n };\r\n LoggerImpl.prototype.clearSubscribers = function () {\r\n var s = this.subscribers.slice(0);\r\n this.subscribers.length = 0;\r\n return s;\r\n };\r\n Object.defineProperty(LoggerImpl.prototype, \"count\", {\r\n get: function () {\r\n return this.subscribers.length;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n LoggerImpl.prototype.write = function (message, level) {\r\n if (level === void 0) { level = 0 /* Verbose */; }\r\n this.log({ level: level, message: message });\r\n };\r\n LoggerImpl.prototype.log = function (entry) {\r\n if (typeof entry !== \"undefined\" && this.activeLogLevel <= entry.level) {\r\n this.subscribers.map(function (subscriber) { return subscriber.log(entry); });\r\n }\r\n };\r\n return LoggerImpl;\r\n}());\n\n/**\r\n * Implementation of LogListener which logs to the console\r\n *\r\n */\r\nvar ConsoleListener = /** @class */ (function () {\r\n function ConsoleListener() {\r\n }\r\n /**\r\n * Any associated data that a given logging listener may choose to log or ignore\r\n *\r\n * @param entry The information to be logged\r\n */\r\n ConsoleListener.prototype.log = function (entry) {\r\n var msg = this.format(entry);\r\n switch (entry.level) {\r\n case 0 /* Verbose */:\r\n case 1 /* Info */:\r\n console.log(msg);\r\n break;\r\n case 2 /* Warning */:\r\n console.warn(msg);\r\n break;\r\n case 3 /* Error */:\r\n console.error(msg);\r\n break;\r\n }\r\n };\r\n /**\r\n * Formats the message\r\n *\r\n * @param entry The information to format into a string\r\n */\r\n ConsoleListener.prototype.format = function (entry) {\r\n var msg = [];\r\n msg.push(\"Message: \" + entry.message);\r\n if (typeof entry.data !== \"undefined\") {\r\n msg.push(\" Data: \" + JSON.stringify(entry.data));\r\n }\r\n return msg.join(\"\");\r\n };\r\n return ConsoleListener;\r\n}());\r\n/**\r\n * Implementation of LogListener which logs to the supplied function\r\n *\r\n */\r\nvar FunctionListener = /** @class */ (function () {\r\n /**\r\n * Creates a new instance of the FunctionListener class\r\n *\r\n * @constructor\r\n * @param method The method to which any logging data will be passed\r\n */\r\n function FunctionListener(method) {\r\n this.method = method;\r\n }\r\n /**\r\n * Any associated data that a given logging listener may choose to log or ignore\r\n *\r\n * @param entry The information to be logged\r\n */\r\n FunctionListener.prototype.log = function (entry) {\r\n this.method(entry);\r\n };\r\n return FunctionListener;\r\n}());\n\nexport { Logger, ConsoleListener, FunctionListener };\n//# sourceMappingURL=logging.es5.js.map\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./dist/packages/logging/dist/logging.es5.js\n// module id = 2\n// module chunks = 0","import { PnPClientStorage } from \"@pnp/common\";\r\nimport { NoCacheAvailableException } from \"../exceptions\";\r\n/**\r\n * A caching provider which can wrap other non-caching providers\r\n *\r\n */\r\nvar CachingConfigurationProvider = /** @class */ (function () {\r\n /**\r\n * Creates a new caching configuration provider\r\n * @constructor\r\n * @param {IConfigurationProvider} wrappedProvider Provider which will be used to fetch the configuration\r\n * @param {string} cacheKey Key that will be used to store cached items to the cache\r\n * @param {IPnPClientStore} cacheStore OPTIONAL storage, which will be used to store cached settings.\r\n */\r\n function CachingConfigurationProvider(wrappedProvider, cacheKey, cacheStore) {\r\n this.wrappedProvider = wrappedProvider;\r\n this.cacheKey = cacheKey;\r\n this.wrappedProvider = wrappedProvider;\r\n this.store = (cacheStore) ? cacheStore : this.selectPnPCache();\r\n }\r\n /**\r\n * Gets the wrapped configuration providers\r\n *\r\n * @return {IConfigurationProvider} Wrapped configuration provider\r\n */\r\n CachingConfigurationProvider.prototype.getWrappedProvider = function () {\r\n return this.wrappedProvider;\r\n };\r\n /**\r\n * Loads the configuration values either from the cache or from the wrapped provider\r\n *\r\n * @return {Promise>} Promise of loaded configuration values\r\n */\r\n CachingConfigurationProvider.prototype.getConfiguration = function () {\r\n var _this = this;\r\n // Cache not available, pass control to the wrapped provider\r\n if ((!this.store) || (!this.store.enabled)) {\r\n return this.wrappedProvider.getConfiguration();\r\n }\r\n return this.store.getOrPut(this.cacheKey, function () {\r\n return _this.wrappedProvider.getConfiguration().then(function (providedConfig) {\r\n _this.store.put(_this.cacheKey, providedConfig);\r\n return providedConfig;\r\n });\r\n });\r\n };\r\n CachingConfigurationProvider.prototype.selectPnPCache = function () {\r\n var pnpCache = new PnPClientStorage();\r\n if ((pnpCache.local) && (pnpCache.local.enabled)) {\r\n return pnpCache.local;\r\n }\r\n if ((pnpCache.session) && (pnpCache.session.enabled)) {\r\n return pnpCache.session;\r\n }\r\n throw new NoCacheAvailableException();\r\n };\r\n return CachingConfigurationProvider;\r\n}());\r\nexport default CachingConfigurationProvider;\r\n//# sourceMappingURL=cachingConfigurationProvider.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./build/packages/config-store/es5/src/providers/cachingConfigurationProvider.js\n// module id = 3\n// module chunks = 0","import * as tslib_1 from \"tslib\";\r\nimport { Logger } from \"@pnp/logging\";\r\nvar NoCacheAvailableException = /** @class */ (function (_super) {\r\n tslib_1.__extends(NoCacheAvailableException, _super);\r\n function NoCacheAvailableException(msg) {\r\n if (msg === void 0) { msg = \"Cannot create a caching configuration provider since cache is not available.\"; }\r\n var _this = _super.call(this, msg) || this;\r\n _this.name = \"NoCacheAvailableException\";\r\n Logger.log({ data: {}, level: 3 /* Error */, message: \"[\" + _this.name + \"]::\" + _this.message });\r\n return _this;\r\n }\r\n return NoCacheAvailableException;\r\n}(Error));\r\nexport { NoCacheAvailableException };\r\n//# sourceMappingURL=exceptions.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./build/packages/config-store/es5/src/exceptions.js\n// module id = 4\n// module chunks = 0","export * from \"./src/configstore\";\r\n//# sourceMappingURL=index.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./build/packages/config-store/es5/index.js\n// module id = 5\n// module chunks = 0","export * from \"./configuration\";\r\nexport * from \"./providers/index\";\r\nexport * from \"./exceptions\";\r\n//# sourceMappingURL=configstore.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./build/packages/config-store/es5/src/configstore.js\n// module id = 6\n// module chunks = 0","import { Dictionary } from \"@pnp/common\";\r\n/**\r\n * Class used to manage the current application settings\r\n *\r\n */\r\nvar Settings = /** @class */ (function () {\r\n /**\r\n * Creates a new instance of the settings class\r\n *\r\n * @constructor\r\n */\r\n function Settings() {\r\n this._settings = new Dictionary();\r\n }\r\n /**\r\n * Adds a new single setting, or overwrites a previous setting with the same key\r\n *\r\n * @param {string} key The key used to store this setting\r\n * @param {string} value The setting value to store\r\n */\r\n Settings.prototype.add = function (key, value) {\r\n this._settings.add(key, value);\r\n };\r\n /**\r\n * Adds a JSON value to the collection as a string, you must use getJSON to rehydrate the object when read\r\n *\r\n * @param {string} key The key used to store this setting\r\n * @param {any} value The setting value to store\r\n */\r\n Settings.prototype.addJSON = function (key, value) {\r\n this._settings.add(key, JSON.stringify(value));\r\n };\r\n /**\r\n * Applies the supplied hash to the setting collection overwriting any existing value, or created new values\r\n *\r\n * @param {TypedHash} hash The set of values to add\r\n */\r\n Settings.prototype.apply = function (hash) {\r\n var _this = this;\r\n return new Promise(function (resolve, reject) {\r\n try {\r\n _this._settings.merge(hash);\r\n resolve();\r\n }\r\n catch (e) {\r\n reject(e);\r\n }\r\n });\r\n };\r\n /**\r\n * Loads configuration settings into the collection from the supplied provider and returns a Promise\r\n *\r\n * @param {IConfigurationProvider} provider The provider from which we will load the settings\r\n */\r\n Settings.prototype.load = function (provider) {\r\n var _this = this;\r\n return new Promise(function (resolve, reject) {\r\n provider.getConfiguration().then(function (value) {\r\n _this._settings.merge(value);\r\n resolve();\r\n }).catch(reject);\r\n });\r\n };\r\n /**\r\n * Gets a value from the configuration\r\n *\r\n * @param {string} key The key whose value we want to return. Returns null if the key does not exist\r\n * @return {string} string value from the configuration\r\n */\r\n Settings.prototype.get = function (key) {\r\n return this._settings.get(key);\r\n };\r\n /**\r\n * Gets a JSON value, rehydrating the stored string to the original object\r\n *\r\n * @param {string} key The key whose value we want to return. Returns null if the key does not exist\r\n * @return {any} object from the configuration\r\n */\r\n Settings.prototype.getJSON = function (key) {\r\n var o = this.get(key);\r\n if (typeof o === \"undefined\" || o === null) {\r\n return o;\r\n }\r\n return JSON.parse(o);\r\n };\r\n return Settings;\r\n}());\r\nexport { Settings };\r\n//# sourceMappingURL=configuration.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./build/packages/config-store/es5/src/configuration.js\n// module id = 7\n// module chunks = 0","var g;\r\n\r\n// This works in non-strict mode\r\ng = (function() {\r\n\treturn this;\r\n})();\r\n\r\ntry {\r\n\t// This works if eval is allowed (see CSP)\r\n\tg = g || Function(\"return this\")() || (1,eval)(\"this\");\r\n} catch(e) {\r\n\t// This works if the window reference is available\r\n\tif(typeof window === \"object\")\r\n\t\tg = window;\r\n}\r\n\r\n// g can still be undefined, but nothing to do about it...\r\n// We return undefined, instead of nothing here, so it's\r\n// easier to handle this case. if(!global) { ...}\r\n\r\nmodule.exports = g;\r\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// (webpack)/buildin/global.js\n// module id = 8\n// module chunks = 0","//----------------------------------------------------------------------\r\n// AdalJS v1.0.17\r\n// @preserve Copyright (c) Microsoft Open Technologies, Inc.\r\n// All Rights Reserved\r\n// Apache License 2.0\r\n//\r\n// Licensed under the Apache License, Version 2.0 (the \"License\");\r\n// you may not use this file except in compliance with the License.\r\n// You may obtain a copy of the License at\r\n//\r\n// http://www.apache.org/licenses/LICENSE-2.0\r\n//id\r\n// Unless required by applicable law or agreed to in writing, software\r\n// distributed under the License is distributed on an \"AS IS\" BASIS,\r\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n// See the License for the specific language governing permissions and\r\n// limitations under the License.\r\n//----------------------------------------------------------------------\r\n\r\nvar AuthenticationContext = (function () {\r\n\r\n 'use strict';\r\n\r\n /**\r\n * Configuration options for Authentication Context.\r\n * @class config\r\n * @property {string} tenant - Your target tenant.\r\n * @property {string} clientId - Client ID assigned to your app by Azure Active Directory.\r\n * @property {string} redirectUri - Endpoint at which you expect to receive tokens.Defaults to `window.location.href`.\r\n * @property {string} instance - Azure Active Directory Instance.Defaults to `https://login.microsoftonline.com/`.\r\n * @property {Array} endpoints - Collection of {Endpoint-ResourceId} used for automatically attaching tokens in webApi calls.\r\n * @property {Boolean} popUp - Set this to true to enable login in a popup winodow instead of a full redirect.Defaults to `false`.\r\n * @property {string} localLoginUrl - Set this to redirect the user to a custom login page.\r\n * @property {function} displayCall - User defined function of handling the navigation to Azure AD authorization endpoint in case of login. Defaults to 'null'.\r\n * @property {string} postLogoutRedirectUri - Redirects the user to postLogoutRedirectUri after logout. Defaults is 'redirectUri'.\r\n * @property {string} cacheLocation - Sets browser storage to either 'localStorage' or sessionStorage'. Defaults to 'sessionStorage'.\r\n * @property {Array.} anonymousEndpoints Array of keywords or URI's. Adal will not attach a token to outgoing requests that have these keywords or uri. Defaults to 'null'.\r\n * @property {number} expireOffsetSeconds If the cached token is about to be expired in the expireOffsetSeconds (in seconds), Adal will renew the token instead of using the cached token. Defaults to 300 seconds.\r\n * @property {string} correlationId Unique identifier used to map the request with the response. Defaults to RFC4122 version 4 guid (128 bits).\r\n * @property {number} loadFrameTimeout The number of milliseconds of inactivity before a token renewal response from AAD should be considered timed out.\r\n */\r\n\r\n /**\r\n * Creates a new AuthenticationContext object.\r\n * @constructor\r\n * @param {config} config Configuration options for AuthenticationContext\r\n */\r\n\r\n AuthenticationContext = function (config) {\r\n /**\r\n * Enum for request type\r\n * @enum {string}\r\n */\r\n this.REQUEST_TYPE = {\r\n LOGIN: 'LOGIN',\r\n RENEW_TOKEN: 'RENEW_TOKEN',\r\n UNKNOWN: 'UNKNOWN'\r\n };\r\n\r\n this.RESPONSE_TYPE = {\r\n ID_TOKEN_TOKEN: 'id_token token',\r\n TOKEN: 'token'\r\n };\r\n\r\n /**\r\n * Enum for storage constants\r\n * @enum {string}\r\n */\r\n this.CONSTANTS = {\r\n ACCESS_TOKEN: 'access_token',\r\n EXPIRES_IN: 'expires_in',\r\n ID_TOKEN: 'id_token',\r\n ERROR_DESCRIPTION: 'error_description',\r\n SESSION_STATE: 'session_state',\r\n ERROR: 'error',\r\n STORAGE: {\r\n TOKEN_KEYS: 'adal.token.keys',\r\n ACCESS_TOKEN_KEY: 'adal.access.token.key',\r\n EXPIRATION_KEY: 'adal.expiration.key',\r\n STATE_LOGIN: 'adal.state.login',\r\n STATE_RENEW: 'adal.state.renew',\r\n NONCE_IDTOKEN: 'adal.nonce.idtoken',\r\n SESSION_STATE: 'adal.session.state',\r\n USERNAME: 'adal.username',\r\n IDTOKEN: 'adal.idtoken',\r\n ERROR: 'adal.error',\r\n ERROR_DESCRIPTION: 'adal.error.description',\r\n LOGIN_REQUEST: 'adal.login.request',\r\n LOGIN_ERROR: 'adal.login.error',\r\n RENEW_STATUS: 'adal.token.renew.status',\r\n ANGULAR_LOGIN_REQUEST: 'adal.angular.login.request'\r\n },\r\n RESOURCE_DELIMETER: '|',\r\n CACHE_DELIMETER: '||',\r\n LOADFRAME_TIMEOUT: 6000,\r\n TOKEN_RENEW_STATUS_CANCELED: 'Canceled',\r\n TOKEN_RENEW_STATUS_COMPLETED: 'Completed',\r\n TOKEN_RENEW_STATUS_IN_PROGRESS: 'In Progress',\r\n LOGGING_LEVEL: {\r\n ERROR: 0,\r\n WARN: 1,\r\n INFO: 2,\r\n VERBOSE: 3\r\n },\r\n LEVEL_STRING_MAP: {\r\n 0: 'ERROR:',\r\n 1: 'WARNING:',\r\n 2: 'INFO:',\r\n 3: 'VERBOSE:'\r\n },\r\n POPUP_WIDTH: 483,\r\n POPUP_HEIGHT: 600\r\n };\r\n\r\n if (AuthenticationContext.prototype._singletonInstance) {\r\n return AuthenticationContext.prototype._singletonInstance;\r\n }\r\n AuthenticationContext.prototype._singletonInstance = this;\r\n\r\n // public\r\n this.instance = 'https://login.microsoftonline.com/';\r\n this.config = {};\r\n this.callback = null;\r\n this.popUp = false;\r\n this.isAngular = false;\r\n\r\n // private\r\n this._user = null;\r\n this._activeRenewals = {};\r\n this._loginInProgress = false;\r\n this._acquireTokenInProgress = false;\r\n this._renewStates = [];\r\n this._callBackMappedToRenewStates = {};\r\n this._callBacksMappedToRenewStates = {};\r\n this._openedWindows = [];\r\n this._requestType = this.REQUEST_TYPE.LOGIN;\r\n window._adalInstance = this;\r\n\r\n // validate before constructor assignments\r\n if (config.displayCall && typeof config.displayCall !== 'function') {\r\n throw new Error('displayCall is not a function');\r\n }\r\n\r\n if (!config.clientId) {\r\n throw new Error('clientId is required');\r\n }\r\n\r\n this.config = this._cloneConfig(config);\r\n\r\n if (this.config.navigateToLoginRequestUrl === undefined)\r\n this.config.navigateToLoginRequestUrl = true;\r\n\r\n if (this.config.popUp)\r\n this.popUp = true;\r\n\r\n if (this.config.callback && typeof this.config.callback === 'function')\r\n this.callback = this.config.callback;\r\n\r\n if (this.config.instance) {\r\n this.instance = this.config.instance;\r\n }\r\n\r\n // App can request idtoken for itself using clientid as resource\r\n if (!this.config.loginResource) {\r\n this.config.loginResource = this.config.clientId;\r\n }\r\n\r\n // redirect and logout_redirect are set to current location by default\r\n if (!this.config.redirectUri) {\r\n // strip off query parameters or hashes from the redirect uri as AAD does not allow those.\r\n this.config.redirectUri = window.location.href.split(\"?\")[0].split(\"#\")[0];\r\n }\r\n\r\n if (!this.config.postLogoutRedirectUri) {\r\n // strip off query parameters or hashes from the post logout redirect uri as AAD does not allow those.\r\n this.config.postLogoutRedirectUri = window.location.href.split(\"?\")[0].split(\"#\")[0];\r\n }\r\n\r\n if (!this.config.anonymousEndpoints) {\r\n this.config.anonymousEndpoints = [];\r\n }\r\n\r\n if (this.config.isAngular) {\r\n this.isAngular = this.config.isAngular;\r\n }\r\n\r\n if (this.config.loadFrameTimeout) {\r\n this.CONSTANTS.LOADFRAME_TIMEOUT = this.config.loadFrameTimeout;\r\n }\r\n };\r\n\r\n if (typeof window !== 'undefined') {\r\n window.Logging = {\r\n piiLoggingEnabled: false,\r\n level: 0,\r\n log: function (message) { }\r\n };\r\n }\r\n\r\n /**\r\n * Initiates the login process by redirecting the user to Azure AD authorization endpoint.\r\n */\r\n AuthenticationContext.prototype.login = function () {\r\n if (this._loginInProgress) {\r\n this.info(\"Login in progress\");\r\n return;\r\n }\r\n\r\n this._loginInProgress = true;\r\n\r\n // Token is not present and user needs to login\r\n var expectedState = this._guid();\r\n this.config.state = expectedState;\r\n this._idTokenNonce = this._guid();\r\n var loginStartPage = this._getItem(this.CONSTANTS.STORAGE.ANGULAR_LOGIN_REQUEST);\r\n\r\n if (!loginStartPage || loginStartPage === \"\") {\r\n loginStartPage = window.location.href;\r\n }\r\n else {\r\n this._saveItem(this.CONSTANTS.STORAGE.ANGULAR_LOGIN_REQUEST, \"\")\r\n }\r\n\r\n this.verbose('Expected state: ' + expectedState + ' startPage:' + loginStartPage);\r\n this._saveItem(this.CONSTANTS.STORAGE.LOGIN_REQUEST, loginStartPage);\r\n this._saveItem(this.CONSTANTS.STORAGE.LOGIN_ERROR, '');\r\n this._saveItem(this.CONSTANTS.STORAGE.STATE_LOGIN, expectedState, true);\r\n this._saveItem(this.CONSTANTS.STORAGE.NONCE_IDTOKEN, this._idTokenNonce, true);\r\n this._saveItem(this.CONSTANTS.STORAGE.ERROR, '');\r\n this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION, '');\r\n var urlNavigate = this._getNavigateUrl('id_token', null) + '&nonce=' + encodeURIComponent(this._idTokenNonce);\r\n\r\n if (this.config.displayCall) {\r\n // User defined way of handling the navigation\r\n this.config.displayCall(urlNavigate);\r\n }\r\n else if (this.popUp) {\r\n this._saveItem(this.CONSTANTS.STORAGE.STATE_LOGIN, '');// so requestInfo does not match redirect case\r\n this._renewStates.push(expectedState);\r\n this.registerCallback(expectedState, this.config.clientId, this.callback);\r\n this._loginPopup(urlNavigate);\r\n }\r\n else {\r\n this.promptUser(urlNavigate);\r\n }\r\n };\r\n\r\n /**\r\n * Configures popup window for login.\r\n * @ignore\r\n */\r\n AuthenticationContext.prototype._openPopup = function (urlNavigate, title, popUpWidth, popUpHeight) {\r\n try {\r\n /**\r\n * adding winLeft and winTop to account for dual monitor\r\n * using screenLeft and screenTop for IE8 and earlier\r\n */\r\n var winLeft = window.screenLeft ? window.screenLeft : window.screenX;\r\n var winTop = window.screenTop ? window.screenTop : window.screenY;\r\n /**\r\n * window.innerWidth displays browser window's height and width excluding toolbars\r\n * using document.documentElement.clientWidth for IE8 and earlier\r\n */\r\n var width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;\r\n var height = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;\r\n var left = ((width / 2) - (popUpWidth / 2)) + winLeft;\r\n var top = ((height / 2) - (popUpHeight / 2)) + winTop;\r\n\r\n var popupWindow = window.open(urlNavigate, title, 'width=' + popUpWidth + ', height=' + popUpHeight + ', top=' + top + ', left=' + left);\r\n\r\n if (popupWindow.focus) {\r\n popupWindow.focus();\r\n }\r\n\r\n return popupWindow;\r\n } catch (e) {\r\n this.warn('Error opening popup, ' + e.message);\r\n this._loginInProgress = false;\r\n this._acquireTokenInProgress = false;\r\n return null;\r\n }\r\n }\r\n\r\n AuthenticationContext.prototype._handlePopupError = function (loginCallback, resource, error, errorDesc, loginError) {\r\n this.warn(errorDesc);\r\n this._saveItem(this.CONSTANTS.STORAGE.ERROR, error);\r\n this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION, errorDesc);\r\n this._saveItem(this.CONSTANTS.STORAGE.LOGIN_ERROR, loginError);\r\n\r\n if (resource && this._activeRenewals[resource]) {\r\n this._activeRenewals[resource] = null;\r\n }\r\n\r\n this._loginInProgress = false;\r\n this._acquireTokenInProgress = false;\r\n\r\n if (loginCallback) {\r\n loginCallback(errorDesc, null, error);\r\n }\r\n }\r\n\r\n /**\r\n * After authorization, the user will be sent to your specified redirect_uri with the user's bearer token\r\n * attached to the URI fragment as an id_token field. It closes popup window after redirection.\r\n * @ignore\r\n */\r\n AuthenticationContext.prototype._loginPopup = function (urlNavigate, resource, callback) {\r\n var popupWindow = this._openPopup(urlNavigate, \"login\", this.CONSTANTS.POPUP_WIDTH, this.CONSTANTS.POPUP_HEIGHT);\r\n var loginCallback = callback || this.callback;\r\n\r\n if (popupWindow == null) {\r\n var error = 'Error opening popup';\r\n var errorDesc = 'Popup Window is null. This can happen if you are using IE';\r\n this._handlePopupError(loginCallback, resource, error, errorDesc, errorDesc);\r\n return;\r\n }\r\n\r\n this._openedWindows.push(popupWindow);\r\n\r\n if (this.config.redirectUri.indexOf('#') != -1) {\r\n var registeredRedirectUri = this.config.redirectUri.split(\"#\")[0];\r\n }\r\n\r\n else {\r\n var registeredRedirectUri = this.config.redirectUri;\r\n }\r\n\r\n var that = this;\r\n\r\n var pollTimer = window.setInterval(function () {\r\n if (!popupWindow || popupWindow.closed || popupWindow.closed === undefined) {\r\n var error = 'Popup Window closed';\r\n var errorDesc = 'Popup Window closed by UI action/ Popup Window handle destroyed due to cross zone navigation in IE/Edge'\r\n\r\n if (that.isAngular) {\r\n that._broadcast('adal:popUpClosed', errorDesc + that.CONSTANTS.RESOURCE_DELIMETER + error);\r\n }\r\n\r\n that._handlePopupError(loginCallback, resource, error, errorDesc, errorDesc);\r\n window.clearInterval(pollTimer);\r\n return;\r\n }\r\n try {\r\n var popUpWindowLocation = popupWindow.location;\r\n if (encodeURI(popUpWindowLocation.href).indexOf(encodeURI(registeredRedirectUri)) != -1) {\r\n if (that.isAngular) {\r\n that._broadcast('adal:popUpHashChanged', popUpWindowLocation.hash);\r\n }\r\n else {\r\n that.handleWindowCallback(popUpWindowLocation.hash);\r\n }\r\n\r\n window.clearInterval(pollTimer);\r\n that._loginInProgress = false;\r\n that._acquireTokenInProgress = false;\r\n that.info(\"Closing popup window\");\r\n that._openedWindows = [];\r\n popupWindow.close();\r\n return;\r\n }\r\n } catch (e) {\r\n }\r\n }, 1);\r\n };\r\n\r\n AuthenticationContext.prototype._broadcast = function (eventName, data) {\r\n // Custom Event is not supported in IE, below IIFE will polyfill the CustomEvent() constructor functionality in Internet Explorer 9 and higher\r\n (function () {\r\n\r\n if (typeof window.CustomEvent === \"function\") {\r\n return false;\r\n }\r\n\r\n function CustomEvent(event, params) {\r\n params = params || { bubbles: false, cancelable: false, detail: undefined };\r\n var evt = document.createEvent('CustomEvent');\r\n evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);\r\n return evt;\r\n }\r\n\r\n CustomEvent.prototype = window.Event.prototype;\r\n window.CustomEvent = CustomEvent;\r\n })();\r\n\r\n var evt = new CustomEvent(eventName, { detail: data });\r\n window.dispatchEvent(evt);\r\n };\r\n\r\n AuthenticationContext.prototype.loginInProgress = function () {\r\n return this._loginInProgress;\r\n };\r\n\r\n /**\r\n * Checks for the resource in the cache. By default, cache location is Session Storage\r\n * @ignore\r\n * @returns {Boolean} 'true' if login is in progress, else returns 'false'.\r\n */\r\n AuthenticationContext.prototype._hasResource = function (key) {\r\n var keys = this._getItem(this.CONSTANTS.STORAGE.TOKEN_KEYS);\r\n return keys && !this._isEmpty(keys) && (keys.indexOf(key + this.CONSTANTS.RESOURCE_DELIMETER) > -1);\r\n };\r\n\r\n /**\r\n * Gets token for the specified resource from the cache.\r\n * @param {string} resource A URI that identifies the resource for which the token is requested.\r\n * @returns {string} token if if it exists and not expired, otherwise null.\r\n */\r\n AuthenticationContext.prototype.getCachedToken = function (resource) {\r\n if (!this._hasResource(resource)) {\r\n return null;\r\n }\r\n\r\n var token = this._getItem(this.CONSTANTS.STORAGE.ACCESS_TOKEN_KEY + resource);\r\n var expiry = this._getItem(this.CONSTANTS.STORAGE.EXPIRATION_KEY + resource);\r\n\r\n // If expiration is within offset, it will force renew\r\n var offset = this.config.expireOffsetSeconds || 300;\r\n\r\n if (expiry && (expiry > this._now() + offset)) {\r\n return token;\r\n } else {\r\n this._saveItem(this.CONSTANTS.STORAGE.ACCESS_TOKEN_KEY + resource, '');\r\n this._saveItem(this.CONSTANTS.STORAGE.EXPIRATION_KEY + resource, 0);\r\n return null;\r\n }\r\n };\r\n\r\n /**\r\n * User information from idtoken.\r\n * @class User\r\n * @property {string} userName - username assigned from upn or email.\r\n * @property {object} profile - properties parsed from idtoken.\r\n */\r\n\r\n /**\r\n * If user object exists, returns it. Else creates a new user object by decoding id_token from the cache.\r\n * @returns {User} user object\r\n */\r\n AuthenticationContext.prototype.getCachedUser = function () {\r\n if (this._user) {\r\n return this._user;\r\n }\r\n\r\n var idtoken = this._getItem(this.CONSTANTS.STORAGE.IDTOKEN);\r\n this._user = this._createUser(idtoken);\r\n return this._user;\r\n };\r\n\r\n /**\r\n * Adds the passed callback to the array of callbacks for the specified resource and puts the array on the window object. \r\n * @param {string} resource A URI that identifies the resource for which the token is requested.\r\n * @param {string} expectedState A unique identifier (guid).\r\n * @param {tokenCallback} callback - The callback provided by the caller. It will be called with token or error.\r\n */\r\n AuthenticationContext.prototype.registerCallback = function (expectedState, resource, callback) {\r\n this._activeRenewals[resource] = expectedState;\r\n\r\n if (!this._callBacksMappedToRenewStates[expectedState]) {\r\n this._callBacksMappedToRenewStates[expectedState] = [];\r\n }\r\n\r\n var self = this;\r\n this._callBacksMappedToRenewStates[expectedState].push(callback);\r\n\r\n if (!this._callBackMappedToRenewStates[expectedState]) {\r\n this._callBackMappedToRenewStates[expectedState] = function (errorDesc, token, error, tokenType) {\r\n self._activeRenewals[resource] = null;\r\n\r\n for (var i = 0; i < self._callBacksMappedToRenewStates[expectedState].length; ++i) {\r\n try {\r\n self._callBacksMappedToRenewStates[expectedState][i](errorDesc, token, error, tokenType);\r\n }\r\n catch (error) {\r\n self.warn(error);\r\n }\r\n }\r\n\r\n self._callBacksMappedToRenewStates[expectedState] = null;\r\n self._callBackMappedToRenewStates[expectedState] = null;\r\n };\r\n }\r\n };\r\n\r\n // var errorResponse = {error:'', error_description:''};\r\n // var token = 'string token';\r\n // callback(errorResponse, token)\r\n // with callback\r\n /**\r\n * Acquires access token with hidden iframe\r\n * @ignore\r\n */\r\n AuthenticationContext.prototype._renewToken = function (resource, callback, responseType) {\r\n // use iframe to try to renew token\r\n // use given resource to create new authz url\r\n this.info('renewToken is called for resource:' + resource);\r\n var frameHandle = this._addAdalFrame('adalRenewFrame' + resource);\r\n var expectedState = this._guid() + '|' + resource;\r\n this.config.state = expectedState;\r\n // renew happens in iframe, so it keeps javascript context\r\n this._renewStates.push(expectedState);\r\n this.verbose('Renew token Expected state: ' + expectedState);\r\n // remove the existing prompt=... query parameter and add prompt=none\r\n responseType = responseType || 'token';\r\n var urlNavigate = this._urlRemoveQueryStringParameter(this._getNavigateUrl(responseType, resource), 'prompt');\r\n\r\n if (responseType === this.RESPONSE_TYPE.ID_TOKEN_TOKEN) {\r\n this._idTokenNonce = this._guid();\r\n this._saveItem(this.CONSTANTS.STORAGE.NONCE_IDTOKEN, this._idTokenNonce, true);\r\n urlNavigate += '&nonce=' + encodeURIComponent(this._idTokenNonce);\r\n }\r\n\r\n urlNavigate = urlNavigate + '&prompt=none';\r\n urlNavigate = this._addHintParameters(urlNavigate);\r\n this.registerCallback(expectedState, resource, callback);\r\n this.verbosePii('Navigate to:' + urlNavigate);\r\n frameHandle.src = 'about:blank';\r\n this._loadFrameTimeout(urlNavigate, 'adalRenewFrame' + resource, resource);\r\n\r\n };\r\n\r\n /**\r\n * Renews idtoken for app's own backend when resource is clientId and calls the callback with token/error\r\n * @ignore\r\n */\r\n AuthenticationContext.prototype._renewIdToken = function (callback, responseType) {\r\n // use iframe to try to renew token\r\n this.info('renewIdToken is called');\r\n var frameHandle = this._addAdalFrame('adalIdTokenFrame');\r\n var expectedState = this._guid() + '|' + this.config.clientId;\r\n this._idTokenNonce = this._guid();\r\n this._saveItem(this.CONSTANTS.STORAGE.NONCE_IDTOKEN, this._idTokenNonce, true);\r\n this.config.state = expectedState;\r\n // renew happens in iframe, so it keeps javascript context\r\n this._renewStates.push(expectedState);\r\n this.verbose('Renew Idtoken Expected state: ' + expectedState);\r\n // remove the existing prompt=... query parameter and add prompt=none\r\n var resource = responseType === null || typeof (responseType) === \"undefined\" ? null : this.config.clientId;\r\n var responseType = responseType || 'id_token';\r\n var urlNavigate = this._urlRemoveQueryStringParameter(this._getNavigateUrl(responseType, resource), 'prompt');\r\n urlNavigate = urlNavigate + '&prompt=none';\r\n urlNavigate = this._addHintParameters(urlNavigate);\r\n urlNavigate += '&nonce=' + encodeURIComponent(this._idTokenNonce);\r\n this.registerCallback(expectedState, this.config.clientId, callback);\r\n this.verbosePii('Navigate to:' + urlNavigate);\r\n frameHandle.src = 'about:blank';\r\n this._loadFrameTimeout(urlNavigate, 'adalIdTokenFrame', this.config.clientId);\r\n };\r\n\r\n /**\r\n * Checks if the authorization endpoint URL contains query string parameters\r\n * @ignore\r\n */\r\n AuthenticationContext.prototype._urlContainsQueryStringParameter = function (name, url) {\r\n // regex to detect pattern of a ? or & followed by the name parameter and an equals character\r\n var regex = new RegExp(\"[\\\\?&]\" + name + \"=\");\r\n return regex.test(url);\r\n }\r\n\r\n /**\r\n * Removes the query string parameter from the authorization endpoint URL if it exists\r\n * @ignore\r\n */\r\n AuthenticationContext.prototype._urlRemoveQueryStringParameter = function (url, name) {\r\n // we remove &name=value, name=value& and name=value\r\n // &name=value\r\n var regex = new RegExp('(\\\\&' + name + '=)[^\\&]+');\r\n url = url.replace(regex, '');\r\n // name=value&\r\n regex = new RegExp('(' + name + '=)[^\\&]+&');\r\n url = url.replace(regex, '');\r\n // name=value\r\n regex = new RegExp('(' + name + '=)[^\\&]+');\r\n url = url.replace(regex, '');\r\n return url;\r\n }\r\n\r\n // Calling _loadFrame but with a timeout to signal failure in loadframeStatus. Callbacks are left\r\n // registered when network errors occur and subsequent token requests for same resource are registered to the pending request\r\n /**\r\n * @ignore\r\n */\r\n AuthenticationContext.prototype._loadFrameTimeout = function (urlNavigation, frameName, resource) {\r\n //set iframe session to pending\r\n this.verbose('Set loading state to pending for: ' + resource);\r\n this._saveItem(this.CONSTANTS.STORAGE.RENEW_STATUS + resource, this.CONSTANTS.TOKEN_RENEW_STATUS_IN_PROGRESS);\r\n this._loadFrame(urlNavigation, frameName);\r\n var self = this;\r\n\r\n setTimeout(function () {\r\n if (self._getItem(self.CONSTANTS.STORAGE.RENEW_STATUS + resource) === self.CONSTANTS.TOKEN_RENEW_STATUS_IN_PROGRESS) {\r\n // fail the iframe session if it's in pending state\r\n self.verbose('Loading frame has timed out after: ' + (self.CONSTANTS.LOADFRAME_TIMEOUT / 1000) + ' seconds for resource ' + resource);\r\n var expectedState = self._activeRenewals[resource];\r\n\r\n if (expectedState && self._callBackMappedToRenewStates[expectedState]) {\r\n self._callBackMappedToRenewStates[expectedState]('Token renewal operation failed due to timeout', null, 'Token Renewal Failed');\r\n }\r\n\r\n self._saveItem(self.CONSTANTS.STORAGE.RENEW_STATUS + resource, self.CONSTANTS.TOKEN_RENEW_STATUS_CANCELED);\r\n }\r\n }, self.CONSTANTS.LOADFRAME_TIMEOUT);\r\n }\r\n\r\n /**\r\n * Loads iframe with authorization endpoint URL\r\n * @ignore\r\n */\r\n AuthenticationContext.prototype._loadFrame = function (urlNavigate, frameName) {\r\n // This trick overcomes iframe navigation in IE\r\n // IE does not load the page consistently in iframe\r\n var self = this;\r\n self.info('LoadFrame: ' + frameName);\r\n var frameCheck = frameName;\r\n setTimeout(function () {\r\n var frameHandle = self._addAdalFrame(frameCheck);\r\n\r\n if (frameHandle.src === '' || frameHandle.src === 'about:blank') {\r\n frameHandle.src = urlNavigate;\r\n self._loadFrame(urlNavigate, frameCheck);\r\n }\r\n\r\n }, 500);\r\n };\r\n\r\n /**\r\n * @callback tokenCallback\r\n * @param {string} error_description error description returned from AAD if token request fails.\r\n * @param {string} token token returned from AAD if token request is successful.\r\n * @param {string} error error message returned from AAD if token request fails.\r\n */\r\n\r\n /**\r\n * Acquires token from the cache if it is not expired. Otherwise sends request to AAD to obtain a new token.\r\n * @param {string} resource ResourceUri identifying the target resource\r\n * @param {tokenCallback} callback - The callback provided by the caller. It will be called with token or error.\r\n */\r\n AuthenticationContext.prototype.acquireToken = function (resource, callback) {\r\n if (this._isEmpty(resource)) {\r\n this.warn('resource is required');\r\n callback('resource is required', null, 'resource is required');\r\n return;\r\n }\r\n\r\n var token = this.getCachedToken(resource);\r\n\r\n if (token) {\r\n this.info('Token is already in cache for resource:' + resource);\r\n callback(null, token, null);\r\n return;\r\n }\r\n\r\n if (!this._user && !(this.config.extraQueryParameter && this.config.extraQueryParameter.indexOf('login_hint') !== -1)) {\r\n this.warn('User login is required');\r\n callback('User login is required', null, 'login required');\r\n return;\r\n }\r\n\r\n // renew attempt with iframe\r\n // Already renewing for this resource, callback when we get the token.\r\n if (this._activeRenewals[resource]) {\r\n // Active renewals contains the state for each renewal.\r\n this.registerCallback(this._activeRenewals[resource], resource, callback);\r\n }\r\n else {\r\n this._requestType = this.REQUEST_TYPE.RENEW_TOKEN;\r\n if (resource === this.config.clientId) {\r\n // App uses idtoken to send to api endpoints\r\n // Default resource is tracked as clientid to store this token\r\n if (this._user) {\r\n this.verbose('renewing idtoken');\r\n this._renewIdToken(callback);\r\n }\r\n else {\r\n this.verbose('renewing idtoken and access_token');\r\n this._renewIdToken(callback, this.RESPONSE_TYPE.ID_TOKEN_TOKEN);\r\n }\r\n } else {\r\n if (this._user) {\r\n this.verbose('renewing access_token');\r\n this._renewToken(resource, callback);\r\n }\r\n else {\r\n this.verbose('renewing idtoken and access_token');\r\n this._renewToken(resource, callback, this.RESPONSE_TYPE.ID_TOKEN_TOKEN);\r\n }\r\n }\r\n }\r\n };\r\n\r\n /**\r\n * Acquires token (interactive flow using a popUp window) by sending request to AAD to obtain a new token.\r\n * @param {string} resource ResourceUri identifying the target resource\r\n * @param {string} extraQueryParameters extraQueryParameters to add to the authentication request\r\n * @param {tokenCallback} callback - The callback provided by the caller. It will be called with token or error.\r\n */\r\n AuthenticationContext.prototype.acquireTokenPopup = function (resource, extraQueryParameters, claims, callback) {\r\n if (this._isEmpty(resource)) {\r\n this.warn('resource is required');\r\n callback('resource is required', null, 'resource is required');\r\n return;\r\n }\r\n\r\n if (!this._user) {\r\n this.warn('User login is required');\r\n callback('User login is required', null, 'login required');\r\n return;\r\n }\r\n\r\n if (this._acquireTokenInProgress) {\r\n this.warn(\"Acquire token interactive is already in progress\")\r\n callback(\"Acquire token interactive is already in progress\", null, \"Acquire token interactive is already in progress\");\r\n return;\r\n }\r\n\r\n var expectedState = this._guid() + '|' + resource;\r\n this.config.state = expectedState;\r\n this._renewStates.push(expectedState);\r\n this._requestType = this.REQUEST_TYPE.RENEW_TOKEN;\r\n this.verbose('Renew token Expected state: ' + expectedState);\r\n // remove the existing prompt=... query parameter and add prompt=select_account\r\n var urlNavigate = this._urlRemoveQueryStringParameter(this._getNavigateUrl('token', resource), 'prompt');\r\n urlNavigate = urlNavigate + '&prompt=select_account';\r\n\r\n if (extraQueryParameters) {\r\n urlNavigate += extraQueryParameters;\r\n }\r\n\r\n if (claims && (urlNavigate.indexOf(\"&claims\") === -1)) {\r\n urlNavigate += '&claims=' + encodeURIComponent(claims);\r\n }\r\n else if (claims && (urlNavigate.indexOf(\"&claims\") !== -1)) {\r\n throw new Error('Claims cannot be passed as an extraQueryParameter');\r\n }\r\n\r\n urlNavigate = this._addHintParameters(urlNavigate);\r\n this._acquireTokenInProgress = true;\r\n this.info('acquireToken interactive is called for the resource ' + resource);\r\n this.registerCallback(expectedState, resource, callback);\r\n this._loginPopup(urlNavigate, resource, callback);\r\n\r\n };\r\n\r\n /**\r\n * Acquires token (interactive flow using a redirect) by sending request to AAD to obtain a new token. In this case the callback passed in the Authentication\r\n * request constructor will be called.\r\n * @param {string} resource ResourceUri identifying the target resource\r\n * @param {string} extraQueryParameters extraQueryParameters to add to the authentication request\r\n */\r\n AuthenticationContext.prototype.acquireTokenRedirect = function (resource, extraQueryParameters, claims) {\r\n if (this._isEmpty(resource)) {\r\n this.warn('resource is required');\r\n callback('resource is required', null, 'resource is required');\r\n return;\r\n }\r\n\r\n var callback = this.callback;\r\n\r\n if (!this._user) {\r\n this.warn('User login is required');\r\n callback('User login is required', null, 'login required');\r\n return;\r\n }\r\n\r\n if (this._acquireTokenInProgress) {\r\n this.warn(\"Acquire token interactive is already in progress\")\r\n callback(\"Acquire token interactive is already in progress\", null, \"Acquire token interactive is already in progress\");\r\n return;\r\n }\r\n\r\n var expectedState = this._guid() + '|' + resource;\r\n this.config.state = expectedState;\r\n this.verbose('Renew token Expected state: ' + expectedState);\r\n\r\n // remove the existing prompt=... query parameter and add prompt=select_account\r\n var urlNavigate = this._urlRemoveQueryStringParameter(this._getNavigateUrl('token', resource), 'prompt');\r\n urlNavigate = urlNavigate + '&prompt=select_account';\r\n if (extraQueryParameters) {\r\n urlNavigate += extraQueryParameters;\r\n }\r\n\r\n if (claims && (urlNavigate.indexOf(\"&claims\") === -1)) {\r\n urlNavigate += '&claims=' + encodeURIComponent(claims);\r\n }\r\n else if (claims && (urlNavigate.indexOf(\"&claims\") !== -1)) {\r\n throw new Error('Claims cannot be passed as an extraQueryParameter');\r\n }\r\n\r\n urlNavigate = this._addHintParameters(urlNavigate);\r\n this._acquireTokenInProgress = true;\r\n this.info('acquireToken interactive is called for the resource ' + resource);\r\n this._saveItem(this.CONSTANTS.STORAGE.LOGIN_REQUEST, window.location.href);\r\n this._saveItem(this.CONSTANTS.STORAGE.STATE_RENEW, expectedState, true);\r\n this.promptUser(urlNavigate);\r\n };\r\n /**\r\n * Redirects the browser to Azure AD authorization endpoint.\r\n * @param {string} urlNavigate Url of the authorization endpoint.\r\n */\r\n AuthenticationContext.prototype.promptUser = function (urlNavigate) {\r\n if (urlNavigate) {\r\n this.infoPii('Navigate to:' + urlNavigate);\r\n window.location.replace(urlNavigate);\r\n } else {\r\n this.info('Navigate url is empty');\r\n }\r\n };\r\n\r\n /**\r\n * Clears cache items.\r\n */\r\n AuthenticationContext.prototype.clearCache = function () {\r\n this._saveItem(this.CONSTANTS.STORAGE.LOGIN_REQUEST, '');\r\n this._saveItem(this.CONSTANTS.STORAGE.ANGULAR_LOGIN_REQUEST, '');\r\n this._saveItem(this.CONSTANTS.STORAGE.SESSION_STATE, '');\r\n this._saveItem(this.CONSTANTS.STORAGE.STATE_LOGIN, '');\r\n this._saveItem(this.CONSTANTS.STORAGE.STATE_RENEW, '');\r\n this._renewStates = [];\r\n this._saveItem(this.CONSTANTS.STORAGE.NONCE_IDTOKEN, '');\r\n this._saveItem(this.CONSTANTS.STORAGE.IDTOKEN, '');\r\n this._saveItem(this.CONSTANTS.STORAGE.ERROR, '');\r\n this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION, '');\r\n this._saveItem(this.CONSTANTS.STORAGE.LOGIN_ERROR, '');\r\n this._saveItem(this.CONSTANTS.STORAGE.LOGIN_ERROR, '');\r\n var keys = this._getItem(this.CONSTANTS.STORAGE.TOKEN_KEYS);\r\n\r\n if (!this._isEmpty(keys)) {\r\n keys = keys.split(this.CONSTANTS.RESOURCE_DELIMETER);\r\n for (var i = 0; i < keys.length && keys[i] !== \"\"; i++) {\r\n this._saveItem(this.CONSTANTS.STORAGE.ACCESS_TOKEN_KEY + keys[i], '');\r\n this._saveItem(this.CONSTANTS.STORAGE.EXPIRATION_KEY + keys[i], 0);\r\n }\r\n }\r\n\r\n this._saveItem(this.CONSTANTS.STORAGE.TOKEN_KEYS, '');\r\n };\r\n\r\n /**\r\n * Clears cache items for a given resource.\r\n * @param {string} resource a URI that identifies the resource.\r\n */\r\n AuthenticationContext.prototype.clearCacheForResource = function (resource) {\r\n this._saveItem(this.CONSTANTS.STORAGE.STATE_RENEW, '');\r\n this._saveItem(this.CONSTANTS.STORAGE.ERROR, '');\r\n this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION, '');\r\n\r\n if (this._hasResource(resource)) {\r\n this._saveItem(this.CONSTANTS.STORAGE.ACCESS_TOKEN_KEY + resource, '');\r\n this._saveItem(this.CONSTANTS.STORAGE.EXPIRATION_KEY + resource, 0);\r\n }\r\n };\r\n\r\n /**\r\n * Redirects user to logout endpoint.\r\n * After logout, it will redirect to postLogoutRedirectUri if added as a property on the config object.\r\n */\r\n AuthenticationContext.prototype.logOut = function () {\r\n this.clearCache();\r\n this._user = null;\r\n var urlNavigate;\r\n\r\n if (this.config.logOutUri) {\r\n urlNavigate = this.config.logOutUri;\r\n } else {\r\n var tenant = 'common';\r\n var logout = '';\r\n\r\n if (this.config.tenant) {\r\n tenant = this.config.tenant;\r\n }\r\n\r\n if (this.config.postLogoutRedirectUri) {\r\n logout = 'post_logout_redirect_uri=' + encodeURIComponent(this.config.postLogoutRedirectUri);\r\n }\r\n\r\n urlNavigate = this.instance + tenant + '/oauth2/logout?' + logout;\r\n }\r\n\r\n this.infoPii('Logout navigate to: ' + urlNavigate);\r\n this.promptUser(urlNavigate);\r\n };\r\n\r\n AuthenticationContext.prototype._isEmpty = function (str) {\r\n return (typeof str === 'undefined' || !str || 0 === str.length);\r\n };\r\n\r\n /**\r\n * @callback userCallback\r\n * @param {string} error error message if user info is not available.\r\n * @param {User} user user object retrieved from the cache.\r\n */\r\n\r\n /**\r\n * Calls the passed in callback with the user object or error message related to the user.\r\n * @param {userCallback} callback - The callback provided by the caller. It will be called with user or error.\r\n */\r\n AuthenticationContext.prototype.getUser = function (callback) {\r\n // IDToken is first call\r\n if (typeof callback !== 'function') {\r\n throw new Error('callback is not a function');\r\n }\r\n\r\n // user in memory\r\n if (this._user) {\r\n callback(null, this._user);\r\n return;\r\n }\r\n\r\n // frame is used to get idtoken\r\n var idtoken = this._getItem(this.CONSTANTS.STORAGE.IDTOKEN);\r\n\r\n if (!this._isEmpty(idtoken)) {\r\n this.info('User exists in cache: ');\r\n this._user = this._createUser(idtoken);\r\n callback(null, this._user);\r\n } else {\r\n this.warn('User information is not available');\r\n callback('User information is not available', null);\r\n }\r\n };\r\n\r\n /**\r\n * Adds login_hint to authorization URL which is used to pre-fill the username field of sign in page for the user if known ahead of time.\r\n * domain_hint can be one of users/organisations which when added skips the email based discovery process of the user.\r\n * @ignore\r\n */\r\n AuthenticationContext.prototype._addHintParameters = function (urlNavigate) {\r\n //If you don�t use prompt=none, then if the session does not exist, there will be a failure.\r\n //If sid is sent alongside domain or login hints, there will be a failure since request is ambiguous.\r\n //If sid is sent with a prompt value other than none or attempt_none, there will be a failure since the request is ambiguous.\r\n\r\n if (this._user && this._user.profile) {\r\n if (this._user.profile.sid && urlNavigate.indexOf('&prompt=none') !== -1) {\r\n // don't add sid twice if user provided it in the extraQueryParameter value\r\n if (!this._urlContainsQueryStringParameter(\"sid\", urlNavigate)) {\r\n // add sid\r\n urlNavigate += '&sid=' + encodeURIComponent(this._user.profile.sid);\r\n }\r\n }\r\n else if (this._user.profile.upn) {\r\n // don't add login_hint twice if user provided it in the extraQueryParameter value\r\n if (!this._urlContainsQueryStringParameter(\"login_hint\", urlNavigate)) {\r\n // add login_hint\r\n urlNavigate += '&login_hint=' + encodeURIComponent(this._user.profile.upn);\r\n }\r\n // don't add domain_hint twice if user provided it in the extraQueryParameter value\r\n if (!this._urlContainsQueryStringParameter(\"domain_hint\", urlNavigate) && this._user.profile.upn.indexOf('@') > -1) {\r\n var parts = this._user.profile.upn.split('@');\r\n // local part can include @ in quotes. Sending last part handles that.\r\n urlNavigate += '&domain_hint=' + encodeURIComponent(parts[parts.length - 1]);\r\n }\r\n }\r\n\r\n }\r\n\r\n return urlNavigate;\r\n }\r\n\r\n /**\r\n * Creates a user object by decoding the id_token\r\n * @ignore\r\n */\r\n AuthenticationContext.prototype._createUser = function (idToken) {\r\n var user = null;\r\n var parsedJson = this._extractIdToken(idToken);\r\n if (parsedJson && parsedJson.hasOwnProperty('aud')) {\r\n if (parsedJson.aud.toLowerCase() === this.config.clientId.toLowerCase()) {\r\n\r\n user = {\r\n userName: '',\r\n profile: parsedJson\r\n };\r\n\r\n if (parsedJson.hasOwnProperty('upn')) {\r\n user.userName = parsedJson.upn;\r\n } else if (parsedJson.hasOwnProperty('email')) {\r\n user.userName = parsedJson.email;\r\n }\r\n } else {\r\n this.warn('IdToken has invalid aud field');\r\n }\r\n\r\n }\r\n\r\n return user;\r\n };\r\n\r\n /**\r\n * Returns the anchor part(#) of the URL\r\n * @ignore\r\n */\r\n AuthenticationContext.prototype._getHash = function (hash) {\r\n if (hash.indexOf('#/') > -1) {\r\n hash = hash.substring(hash.indexOf('#/') + 2);\r\n } else if (hash.indexOf('#') > -1) {\r\n hash = hash.substring(1);\r\n }\r\n\r\n return hash;\r\n };\r\n\r\n /**\r\n * Checks if the URL fragment contains access token, id token or error_description.\r\n * @param {string} hash - Hash passed from redirect page\r\n * @returns {Boolean} true if response contains id_token, access_token or error, false otherwise.\r\n */\r\n AuthenticationContext.prototype.isCallback = function (hash) {\r\n hash = this._getHash(hash);\r\n var parameters = this._deserialize(hash);\r\n return (\r\n parameters.hasOwnProperty(this.CONSTANTS.ERROR_DESCRIPTION) ||\r\n parameters.hasOwnProperty(this.CONSTANTS.ACCESS_TOKEN) ||\r\n parameters.hasOwnProperty(this.CONSTANTS.ID_TOKEN)\r\n );\r\n };\r\n\r\n /**\r\n * Gets login error\r\n * @returns {string} error message related to login.\r\n */\r\n AuthenticationContext.prototype.getLoginError = function () {\r\n return this._getItem(this.CONSTANTS.STORAGE.LOGIN_ERROR);\r\n };\r\n\r\n /**\r\n * Request info object created from the response received from AAD.\r\n * @class RequestInfo\r\n * @property {object} parameters - object comprising of fields such as id_token/error, session_state, state, e.t.c.\r\n * @property {REQUEST_TYPE} requestType - either LOGIN, RENEW_TOKEN or UNKNOWN.\r\n * @property {boolean} stateMatch - true if state is valid, false otherwise.\r\n * @property {string} stateResponse - unique guid used to match the response with the request.\r\n * @property {boolean} valid - true if requestType contains id_token, access_token or error, false otherwise.\r\n */\r\n\r\n /**\r\n * Creates a requestInfo object from the URL fragment and returns it.\r\n * @returns {RequestInfo} an object created from the redirect response from AAD comprising of the keys - parameters, requestType, stateMatch, stateResponse and valid.\r\n */\r\n AuthenticationContext.prototype.getRequestInfo = function (hash) {\r\n hash = this._getHash(hash);\r\n var parameters = this._deserialize(hash);\r\n var requestInfo = {\r\n valid: false,\r\n parameters: {},\r\n stateMatch: false,\r\n stateResponse: '',\r\n requestType: this.REQUEST_TYPE.UNKNOWN,\r\n };\r\n\r\n if (parameters) {\r\n requestInfo.parameters = parameters;\r\n if (parameters.hasOwnProperty(this.CONSTANTS.ERROR_DESCRIPTION) ||\r\n parameters.hasOwnProperty(this.CONSTANTS.ACCESS_TOKEN) ||\r\n parameters.hasOwnProperty(this.CONSTANTS.ID_TOKEN)) {\r\n\r\n requestInfo.valid = true;\r\n\r\n // which call\r\n var stateResponse = '';\r\n if (parameters.hasOwnProperty('state')) {\r\n this.verbose('State: ' + parameters.state);\r\n stateResponse = parameters.state;\r\n } else {\r\n this.warn('No state returned');\r\n return requestInfo;\r\n }\r\n\r\n requestInfo.stateResponse = stateResponse;\r\n\r\n // async calls can fire iframe and login request at the same time if developer does not use the API as expected\r\n // incoming callback needs to be looked up to find the request type\r\n if (this._matchState(requestInfo)) { // loginRedirect or acquireTokenRedirect\r\n return requestInfo;\r\n }\r\n\r\n // external api requests may have many renewtoken requests for different resource\r\n if (!requestInfo.stateMatch && window.parent) {\r\n requestInfo.requestType = this._requestType;\r\n var statesInParentContext = this._renewStates;\r\n for (var i = 0; i < statesInParentContext.length; i++) {\r\n if (statesInParentContext[i] === requestInfo.stateResponse) {\r\n requestInfo.stateMatch = true;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return requestInfo;\r\n };\r\n\r\n /**\r\n * Matches nonce from the request with the response.\r\n * @ignore\r\n */\r\n AuthenticationContext.prototype._matchNonce = function (user) {\r\n var requestNonce = this._getItem(this.CONSTANTS.STORAGE.NONCE_IDTOKEN);\r\n\r\n if (requestNonce) {\r\n requestNonce = requestNonce.split(this.CONSTANTS.CACHE_DELIMETER);\r\n for (var i = 0; i < requestNonce.length; i++) {\r\n if (requestNonce[i] === user.profile.nonce) {\r\n return true;\r\n }\r\n }\r\n }\r\n\r\n return false;\r\n };\r\n\r\n /**\r\n * Matches state from the request with the response.\r\n * @ignore\r\n */\r\n AuthenticationContext.prototype._matchState = function (requestInfo) {\r\n var loginStates = this._getItem(this.CONSTANTS.STORAGE.STATE_LOGIN);\r\n\r\n if (loginStates) {\r\n loginStates = loginStates.split(this.CONSTANTS.CACHE_DELIMETER);\r\n for (var i = 0; i < loginStates.length; i++) {\r\n if (loginStates[i] === requestInfo.stateResponse) {\r\n requestInfo.requestType = this.REQUEST_TYPE.LOGIN;\r\n requestInfo.stateMatch = true;\r\n return true;\r\n }\r\n }\r\n }\r\n\r\n var acquireTokenStates = this._getItem(this.CONSTANTS.STORAGE.STATE_RENEW);\r\n\r\n if (acquireTokenStates) {\r\n acquireTokenStates = acquireTokenStates.split(this.CONSTANTS.CACHE_DELIMETER);\r\n for (var i = 0; i < acquireTokenStates.length; i++) {\r\n if (acquireTokenStates[i] === requestInfo.stateResponse) {\r\n requestInfo.requestType = this.REQUEST_TYPE.RENEW_TOKEN;\r\n requestInfo.stateMatch = true;\r\n return true;\r\n }\r\n }\r\n }\r\n\r\n return false;\r\n\r\n };\r\n\r\n /**\r\n * Extracts resource value from state.\r\n * @ignore\r\n */\r\n AuthenticationContext.prototype._getResourceFromState = function (state) {\r\n if (state) {\r\n var splitIndex = state.indexOf('|');\r\n\r\n if (splitIndex > -1 && splitIndex + 1 < state.length) {\r\n return state.substring(splitIndex + 1);\r\n }\r\n }\r\n\r\n return '';\r\n };\r\n\r\n /**\r\n * Saves token or error received in the response from AAD in the cache. In case of id_token, it also creates the user object.\r\n */\r\n AuthenticationContext.prototype.saveTokenFromHash = function (requestInfo) {\r\n this.info('State status:' + requestInfo.stateMatch + '; Request type:' + requestInfo.requestType);\r\n this._saveItem(this.CONSTANTS.STORAGE.ERROR, '');\r\n this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION, '');\r\n\r\n var resource = this._getResourceFromState(requestInfo.stateResponse);\r\n\r\n // Record error\r\n if (requestInfo.parameters.hasOwnProperty(this.CONSTANTS.ERROR_DESCRIPTION)) {\r\n this.infoPii('Error :' + requestInfo.parameters.error + '; Error description:' + requestInfo.parameters[this.CONSTANTS.ERROR_DESCRIPTION]);\r\n this._saveItem(this.CONSTANTS.STORAGE.ERROR, requestInfo.parameters.error);\r\n this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION, requestInfo.parameters[this.CONSTANTS.ERROR_DESCRIPTION]);\r\n\r\n if (requestInfo.requestType === this.REQUEST_TYPE.LOGIN) {\r\n this._loginInProgress = false;\r\n this._saveItem(this.CONSTANTS.STORAGE.LOGIN_ERROR, requestInfo.parameters.error_description);\r\n }\r\n } else {\r\n // It must verify the state from redirect\r\n if (requestInfo.stateMatch) {\r\n // record tokens to storage if exists\r\n this.info('State is right');\r\n if (requestInfo.parameters.hasOwnProperty(this.CONSTANTS.SESSION_STATE)) {\r\n this._saveItem(this.CONSTANTS.STORAGE.SESSION_STATE, requestInfo.parameters[this.CONSTANTS.SESSION_STATE]);\r\n }\r\n\r\n var keys;\r\n\r\n if (requestInfo.parameters.hasOwnProperty(this.CONSTANTS.ACCESS_TOKEN)) {\r\n this.info('Fragment has access token');\r\n\r\n if (!this._hasResource(resource)) {\r\n keys = this._getItem(this.CONSTANTS.STORAGE.TOKEN_KEYS) || '';\r\n this._saveItem(this.CONSTANTS.STORAGE.TOKEN_KEYS, keys + resource + this.CONSTANTS.RESOURCE_DELIMETER);\r\n }\r\n\r\n // save token with related resource\r\n this._saveItem(this.CONSTANTS.STORAGE.ACCESS_TOKEN_KEY + resource, requestInfo.parameters[this.CONSTANTS.ACCESS_TOKEN]);\r\n this._saveItem(this.CONSTANTS.STORAGE.EXPIRATION_KEY + resource, this._expiresIn(requestInfo.parameters[this.CONSTANTS.EXPIRES_IN]));\r\n }\r\n\r\n if (requestInfo.parameters.hasOwnProperty(this.CONSTANTS.ID_TOKEN)) {\r\n this.info('Fragment has id token');\r\n this._loginInProgress = false;\r\n this._user = this._createUser(requestInfo.parameters[this.CONSTANTS.ID_TOKEN]);\r\n if (this._user && this._user.profile) {\r\n if (!this._matchNonce(this._user)) {\r\n this._saveItem(this.CONSTANTS.STORAGE.LOGIN_ERROR, 'Nonce received: ' + this._user.profile.nonce + ' is not same as requested: ' +\r\n this._getItem(this.CONSTANTS.STORAGE.NONCE_IDTOKEN));\r\n this._user = null;\r\n } else {\r\n this._saveItem(this.CONSTANTS.STORAGE.IDTOKEN, requestInfo.parameters[this.CONSTANTS.ID_TOKEN]);\r\n\r\n // Save idtoken as access token for app itself\r\n resource = this.config.loginResource ? this.config.loginResource : this.config.clientId;\r\n\r\n if (!this._hasResource(resource)) {\r\n keys = this._getItem(this.CONSTANTS.STORAGE.TOKEN_KEYS) || '';\r\n this._saveItem(this.CONSTANTS.STORAGE.TOKEN_KEYS, keys + resource + this.CONSTANTS.RESOURCE_DELIMETER);\r\n }\r\n\r\n this._saveItem(this.CONSTANTS.STORAGE.ACCESS_TOKEN_KEY + resource, requestInfo.parameters[this.CONSTANTS.ID_TOKEN]);\r\n this._saveItem(this.CONSTANTS.STORAGE.EXPIRATION_KEY + resource, this._user.profile.exp);\r\n }\r\n }\r\n else {\r\n requestInfo.parameters['error'] = 'invalid id_token';\r\n requestInfo.parameters['error_description'] = 'Invalid id_token. id_token: ' + requestInfo.parameters[this.CONSTANTS.ID_TOKEN];\r\n this._saveItem(this.CONSTANTS.STORAGE.ERROR, 'invalid id_token');\r\n this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION, 'Invalid id_token. id_token: ' + requestInfo.parameters[this.CONSTANTS.ID_TOKEN]);\r\n }\r\n }\r\n } else {\r\n requestInfo.parameters['error'] = 'Invalid_state';\r\n requestInfo.parameters['error_description'] = 'Invalid_state. state: ' + requestInfo.stateResponse;\r\n this._saveItem(this.CONSTANTS.STORAGE.ERROR, 'Invalid_state');\r\n this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION, 'Invalid_state. state: ' + requestInfo.stateResponse);\r\n }\r\n }\r\n\r\n this._saveItem(this.CONSTANTS.STORAGE.RENEW_STATUS + resource, this.CONSTANTS.TOKEN_RENEW_STATUS_COMPLETED);\r\n };\r\n\r\n /**\r\n * Gets resource for given endpoint if mapping is provided with config.\r\n * @param {string} endpoint - The URI for which the resource Id is requested.\r\n * @returns {string} resource for this API endpoint.\r\n */\r\n AuthenticationContext.prototype.getResourceForEndpoint = function (endpoint) {\r\n\r\n // if user specified list of anonymous endpoints, no need to send token to these endpoints, return null.\r\n if (this.config && this.config.anonymousEndpoints) {\r\n for (var i = 0; i < this.config.anonymousEndpoints.length; i++) {\r\n if (endpoint.indexOf(this.config.anonymousEndpoints[i]) > -1) {\r\n return null;\r\n }\r\n }\r\n }\r\n\r\n if (this.config && this.config.endpoints) {\r\n for (var configEndpoint in this.config.endpoints) {\r\n // configEndpoint is like /api/Todo requested endpoint can be /api/Todo/1\r\n if (endpoint.indexOf(configEndpoint) > -1) {\r\n return this.config.endpoints[configEndpoint];\r\n }\r\n }\r\n }\r\n\r\n // default resource will be clientid if nothing specified\r\n // App will use idtoken for calls to itself\r\n // check if it's staring from http or https, needs to match with app host\r\n if (endpoint.indexOf('http://') > -1 || endpoint.indexOf('https://') > -1) {\r\n if (this._getHostFromUri(endpoint) === this._getHostFromUri(this.config.redirectUri)) {\r\n return this.config.loginResource;\r\n }\r\n }\r\n else {\r\n // in angular level, the url for $http interceptor call could be relative url,\r\n // if it's relative call, we'll treat it as app backend call. \r\n return this.config.loginResource;\r\n }\r\n\r\n // if not the app's own backend or not a domain listed in the endpoints structure\r\n return null;\r\n };\r\n\r\n /**\r\n * Strips the protocol part of the URL and returns it.\r\n * @ignore\r\n */\r\n AuthenticationContext.prototype._getHostFromUri = function (uri) {\r\n // remove http:// or https:// from uri\r\n var extractedUri = String(uri).replace(/^(https?:)\\/\\//, '');\r\n extractedUri = extractedUri.split('/')[0];\r\n return extractedUri;\r\n };\r\n\r\n /**\r\n * This method must be called for processing the response received from AAD. It extracts the hash, processes the token or error, saves it in the cache and calls the registered callbacks with the result.\r\n * @param {string} [hash=window.location.hash] - Hash fragment of Url.\r\n */\r\n AuthenticationContext.prototype.handleWindowCallback = function (hash) {\r\n // This is for regular javascript usage for redirect handling\r\n // need to make sure this is for callback\r\n if (hash == null) {\r\n hash = window.location.hash;\r\n }\r\n\r\n if (this.isCallback(hash)) {\r\n var self = null;\r\n var isPopup = false;\r\n\r\n if (this._openedWindows.length > 0 && this._openedWindows[this._openedWindows.length - 1].opener\r\n && this._openedWindows[this._openedWindows.length - 1].opener._adalInstance) {\r\n self = this._openedWindows[this._openedWindows.length - 1].opener._adalInstance;\r\n isPopup = true;\r\n }\r\n else if (window.parent && window.parent._adalInstance) {\r\n self = window.parent._adalInstance;\r\n }\r\n\r\n var requestInfo = self.getRequestInfo(hash);\r\n var token, tokenReceivedCallback, tokenType = null;\r\n\r\n if (isPopup || window.parent !== window) {\r\n tokenReceivedCallback = self._callBackMappedToRenewStates[requestInfo.stateResponse];\r\n }\r\n else {\r\n tokenReceivedCallback = self.callback;\r\n }\r\n\r\n self.info(\"Returned from redirect url\");\r\n self.saveTokenFromHash(requestInfo);\r\n\r\n if ((requestInfo.requestType === this.REQUEST_TYPE.RENEW_TOKEN) && window.parent) {\r\n if (window.parent !== window) {\r\n self.verbose(\"Window is in iframe, acquiring token silently\");\r\n } else {\r\n self.verbose(\"acquiring token interactive in progress\");\r\n }\r\n\r\n token = requestInfo.parameters[self.CONSTANTS.ACCESS_TOKEN] || requestInfo.parameters[self.CONSTANTS.ID_TOKEN];\r\n tokenType = self.CONSTANTS.ACCESS_TOKEN;\r\n } else if (requestInfo.requestType === this.REQUEST_TYPE.LOGIN) {\r\n token = requestInfo.parameters[self.CONSTANTS.ID_TOKEN];\r\n tokenType = self.CONSTANTS.ID_TOKEN;\r\n }\r\n\r\n var errorDesc = requestInfo.parameters[self.CONSTANTS.ERROR_DESCRIPTION];\r\n var error = requestInfo.parameters[self.CONSTANTS.ERROR];\r\n try {\r\n if (tokenReceivedCallback) {\r\n tokenReceivedCallback(errorDesc, token, error, tokenType);\r\n }\r\n\r\n } catch (err) {\r\n self.error(\"Error occurred in user defined callback function: \" + err);\r\n }\r\n\r\n if (window.parent === window && !isPopup) {\r\n if (self.config.navigateToLoginRequestUrl) {\r\n window.location.href = self._getItem(self.CONSTANTS.STORAGE.LOGIN_REQUEST);\r\n } else window.location.hash = '';\r\n }\r\n }\r\n };\r\n\r\n /**\r\n * Constructs the authorization endpoint URL and returns it.\r\n * @ignore\r\n */\r\n AuthenticationContext.prototype._getNavigateUrl = function (responseType, resource) {\r\n var tenant = 'common';\r\n if (this.config.tenant) {\r\n tenant = this.config.tenant;\r\n }\r\n\r\n var urlNavigate = this.instance + tenant + '/oauth2/authorize' + this._serialize(responseType, this.config, resource) + this._addLibMetadata();\r\n this.info('Navigate url:' + urlNavigate);\r\n return urlNavigate;\r\n };\r\n\r\n /**\r\n * Returns the decoded id_token.\r\n * @ignore\r\n */\r\n AuthenticationContext.prototype._extractIdToken = function (encodedIdToken) {\r\n // id token will be decoded to get the username\r\n var decodedToken = this._decodeJwt(encodedIdToken);\r\n\r\n if (!decodedToken) {\r\n return null;\r\n }\r\n\r\n try {\r\n var base64IdToken = decodedToken.JWSPayload;\r\n var base64Decoded = this._base64DecodeStringUrlSafe(base64IdToken);\r\n\r\n if (!base64Decoded) {\r\n this.info('The returned id_token could not be base64 url safe decoded.');\r\n return null;\r\n }\r\n\r\n // ECMA script has JSON built-in support\r\n return JSON.parse(base64Decoded);\r\n } catch (err) {\r\n this.error('The returned id_token could not be decoded', err);\r\n }\r\n\r\n return null;\r\n };\r\n\r\n /**\r\n * Decodes a string of data which has been encoded using base-64 encoding.\r\n * @ignore\r\n */\r\n AuthenticationContext.prototype._base64DecodeStringUrlSafe = function (base64IdToken) {\r\n // html5 should support atob function for decoding\r\n base64IdToken = base64IdToken.replace(/-/g, '+').replace(/_/g, '/');\r\n\r\n if (window.atob) {\r\n return decodeURIComponent(escape(window.atob(base64IdToken))); // jshint ignore:line\r\n }\r\n else {\r\n return decodeURIComponent(escape(this._decode(base64IdToken)));\r\n }\r\n };\r\n\r\n //Take https://cdnjs.cloudflare.com/ajax/libs/Base64/0.3.0/base64.js and https://en.wikipedia.org/wiki/Base64 as reference. \r\n AuthenticationContext.prototype._decode = function (base64IdToken) {\r\n var codes = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\r\n base64IdToken = String(base64IdToken).replace(/=+$/, '');\r\n\r\n var length = base64IdToken.length;\r\n\r\n if (length % 4 === 1) {\r\n throw new Error('The token to be decoded is not correctly encoded.');\r\n }\r\n\r\n var h1, h2, h3, h4, bits, c1, c2, c3, decoded = '';\r\n\r\n for (var i = 0; i < length; i += 4) {\r\n //Every 4 base64 encoded character will be converted to 3 byte string, which is 24 bits\r\n // then 6 bits per base64 encoded character\r\n h1 = codes.indexOf(base64IdToken.charAt(i));\r\n h2 = codes.indexOf(base64IdToken.charAt(i + 1));\r\n h3 = codes.indexOf(base64IdToken.charAt(i + 2));\r\n h4 = codes.indexOf(base64IdToken.charAt(i + 3));\r\n\r\n // For padding, if last two are '='\r\n if (i + 2 === length - 1) {\r\n bits = h1 << 18 | h2 << 12 | h3 << 6;\r\n c1 = bits >> 16 & 255;\r\n c2 = bits >> 8 & 255;\r\n decoded += String.fromCharCode(c1, c2);\r\n break;\r\n }\r\n // if last one is '='\r\n else if (i + 1 === length - 1) {\r\n bits = h1 << 18 | h2 << 12\r\n c1 = bits >> 16 & 255;\r\n decoded += String.fromCharCode(c1);\r\n break;\r\n }\r\n\r\n bits = h1 << 18 | h2 << 12 | h3 << 6 | h4;\r\n\r\n // then convert to 3 byte chars\r\n c1 = bits >> 16 & 255;\r\n c2 = bits >> 8 & 255;\r\n c3 = bits & 255;\r\n\r\n decoded += String.fromCharCode(c1, c2, c3);\r\n }\r\n\r\n return decoded;\r\n };\r\n\r\n /**\r\n * Decodes an id token into an object with header, payload and signature fields.\r\n * @ignore\r\n */\r\n // Adal.node js crack function\r\n AuthenticationContext.prototype._decodeJwt = function (jwtToken) {\r\n if (this._isEmpty(jwtToken)) {\r\n return null;\r\n };\r\n\r\n var idTokenPartsRegex = /^([^\\.\\s]*)\\.([^\\.\\s]+)\\.([^\\.\\s]*)$/;\r\n\r\n var matches = idTokenPartsRegex.exec(jwtToken);\r\n\r\n if (!matches || matches.length < 4) {\r\n this.warn('The returned id_token is not parseable.');\r\n return null;\r\n }\r\n\r\n var crackedToken = {\r\n header: matches[1],\r\n JWSPayload: matches[2],\r\n JWSSig: matches[3]\r\n };\r\n\r\n return crackedToken;\r\n };\r\n\r\n /**\r\n * Converts string to represent binary data in ASCII string format by translating it into a radix-64 representation and returns it\r\n * @ignore\r\n */\r\n AuthenticationContext.prototype._convertUrlSafeToRegularBase64EncodedString = function (str) {\r\n return str.replace('-', '+').replace('_', '/');\r\n };\r\n\r\n /**\r\n * Serializes the parameters for the authorization endpoint URL and returns the serialized uri string.\r\n * @ignore\r\n */\r\n AuthenticationContext.prototype._serialize = function (responseType, obj, resource) {\r\n var str = [];\r\n\r\n if (obj !== null) {\r\n str.push('?response_type=' + responseType);\r\n str.push('client_id=' + encodeURIComponent(obj.clientId));\r\n if (resource) {\r\n str.push('resource=' + encodeURIComponent(resource));\r\n }\r\n\r\n str.push('redirect_uri=' + encodeURIComponent(obj.redirectUri));\r\n str.push('state=' + encodeURIComponent(obj.state));\r\n\r\n if (obj.hasOwnProperty('slice')) {\r\n str.push('slice=' + encodeURIComponent(obj.slice));\r\n }\r\n\r\n if (obj.hasOwnProperty('extraQueryParameter')) {\r\n str.push(obj.extraQueryParameter);\r\n }\r\n\r\n var correlationId = obj.correlationId ? obj.correlationId : this._guid();\r\n str.push('client-request-id=' + encodeURIComponent(correlationId));\r\n }\r\n\r\n return str.join('&');\r\n };\r\n\r\n /**\r\n * Parses the query string parameters into a key-value pair object.\r\n * @ignore\r\n */\r\n AuthenticationContext.prototype._deserialize = function (query) {\r\n var match,\r\n pl = /\\+/g, // Regex for replacing addition symbol with a space\r\n search = /([^&=]+)=([^&]*)/g,\r\n decode = function (s) {\r\n return decodeURIComponent(s.replace(pl, ' '));\r\n },\r\n obj = {};\r\n match = search.exec(query);\r\n\r\n while (match) {\r\n obj[decode(match[1])] = decode(match[2]);\r\n match = search.exec(query);\r\n }\r\n\r\n return obj;\r\n };\r\n\r\n /**\r\n * Converts decimal value to hex equivalent\r\n * @ignore\r\n */\r\n AuthenticationContext.prototype._decimalToHex = function (number) {\r\n var hex = number.toString(16);\r\n\r\n while (hex.length < 2) {\r\n hex = '0' + hex;\r\n }\r\n return hex;\r\n }\r\n\r\n /**\r\n * Generates RFC4122 version 4 guid (128 bits)\r\n * @ignore\r\n */\r\n /* jshint ignore:start */\r\n AuthenticationContext.prototype._guid = function () {\r\n // RFC4122: The version 4 UUID is meant for generating UUIDs from truly-random or\r\n // pseudo-random numbers.\r\n // The algorithm is as follows:\r\n // Set the two most significant bits (bits 6 and 7) of the\r\n // clock_seq_hi_and_reserved to zero and one, respectively.\r\n // Set the four most significant bits (bits 12 through 15) of the\r\n // time_hi_and_version field to the 4-bit version number from\r\n // Section 4.1.3. Version4\r\n // Set all the other bits to randomly (or pseudo-randomly) chosen\r\n // values.\r\n // UUID = time-low \"-\" time-mid \"-\"time-high-and-version \"-\"clock-seq-reserved and low(2hexOctet)\"-\" node\r\n // time-low = 4hexOctet\r\n // time-mid = 2hexOctet\r\n // time-high-and-version = 2hexOctet\r\n // clock-seq-and-reserved = hexOctet:\r\n // clock-seq-low = hexOctet\r\n // node = 6hexOctet\r\n // Format: xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\r\n // y could be 1000, 1001, 1010, 1011 since most significant two bits needs to be 10\r\n // y values are 8, 9, A, B\r\n var cryptoObj = window.crypto || window.msCrypto; // for IE 11\r\n if (cryptoObj && cryptoObj.getRandomValues) {\r\n var buffer = new Uint8Array(16);\r\n cryptoObj.getRandomValues(buffer);\r\n //buffer[6] and buffer[7] represents the time_hi_and_version field. We will set the four most significant bits (4 through 7) of buffer[6] to represent decimal number 4 (UUID version number).\r\n buffer[6] |= 0x40; //buffer[6] | 01000000 will set the 6 bit to 1.\r\n buffer[6] &= 0x4f; //buffer[6] & 01001111 will set the 4, 5, and 7 bit to 0 such that bits 4-7 == 0100 = \"4\".\r\n //buffer[8] represents the clock_seq_hi_and_reserved field. We will set the two most significant bits (6 and 7) of the clock_seq_hi_and_reserved to zero and one, respectively.\r\n buffer[8] |= 0x80; //buffer[8] | 10000000 will set the 7 bit to 1.\r\n buffer[8] &= 0xbf; //buffer[8] & 10111111 will set the 6 bit to 0.\r\n return this._decimalToHex(buffer[0]) + this._decimalToHex(buffer[1]) + this._decimalToHex(buffer[2]) + this._decimalToHex(buffer[3]) + '-' + this._decimalToHex(buffer[4]) + this._decimalToHex(buffer[5]) + '-' + this._decimalToHex(buffer[6]) + this._decimalToHex(buffer[7]) + '-' +\r\n this._decimalToHex(buffer[8]) + this._decimalToHex(buffer[9]) + '-' + this._decimalToHex(buffer[10]) + this._decimalToHex(buffer[11]) + this._decimalToHex(buffer[12]) + this._decimalToHex(buffer[13]) + this._decimalToHex(buffer[14]) + this._decimalToHex(buffer[15]);\r\n }\r\n else {\r\n var guidHolder = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx';\r\n var hex = '0123456789abcdef';\r\n var r = 0;\r\n var guidResponse = \"\";\r\n for (var i = 0; i < 36; i++) {\r\n if (guidHolder[i] !== '-' && guidHolder[i] !== '4') {\r\n // each x and y needs to be random\r\n r = Math.random() * 16 | 0;\r\n }\r\n if (guidHolder[i] === 'x') {\r\n guidResponse += hex[r];\r\n } else if (guidHolder[i] === 'y') {\r\n // clock-seq-and-reserved first hex is filtered and remaining hex values are random\r\n r &= 0x3; // bit and with 0011 to set pos 2 to zero ?0??\r\n r |= 0x8; // set pos 3 to 1 as 1???\r\n guidResponse += hex[r];\r\n } else {\r\n guidResponse += guidHolder[i];\r\n }\r\n }\r\n return guidResponse;\r\n }\r\n };\r\n /* jshint ignore:end */\r\n\r\n /**\r\n * Calculates the expires in value in milliseconds for the acquired token\r\n * @ignore\r\n */\r\n AuthenticationContext.prototype._expiresIn = function (expires) {\r\n // if AAD did not send \"expires_in\" property, use default expiration of 3599 seconds, for some reason AAD sends 3599 as \"expires_in\" value instead of 3600\r\n if (!expires) expires = 3599;\r\n return this._now() + parseInt(expires, 10);\r\n };\r\n\r\n /**\r\n * Return the number of milliseconds since 1970/01/01\r\n * @ignore\r\n */\r\n AuthenticationContext.prototype._now = function () {\r\n return Math.round(new Date().getTime() / 1000.0);\r\n };\r\n\r\n /**\r\n * Adds the hidden iframe for silent token renewal\r\n * @ignore\r\n */\r\n AuthenticationContext.prototype._addAdalFrame = function (iframeId) {\r\n if (typeof iframeId === 'undefined') {\r\n return;\r\n }\r\n\r\n this.info('Add adal frame to document:' + iframeId);\r\n var adalFrame = document.getElementById(iframeId);\r\n\r\n if (!adalFrame) {\r\n if (document.createElement && document.documentElement &&\r\n (window.opera || window.navigator.userAgent.indexOf('MSIE 5.0') === -1)) {\r\n var ifr = document.createElement('iframe');\r\n ifr.setAttribute('id', iframeId);\r\n ifr.setAttribute('aria-hidden', 'true');\r\n ifr.style.visibility = 'hidden';\r\n ifr.style.position = 'absolute';\r\n ifr.style.width = ifr.style.height = ifr.borderWidth = '0px';\r\n\r\n adalFrame = document.getElementsByTagName('body')[0].appendChild(ifr);\r\n }\r\n else if (document.body && document.body.insertAdjacentHTML) {\r\n document.body.insertAdjacentHTML('beforeEnd', '');\r\n }\r\n if (window.frames && window.frames[iframeId]) {\r\n adalFrame = window.frames[iframeId];\r\n }\r\n }\r\n\r\n return adalFrame;\r\n };\r\n\r\n /**\r\n * Saves the key-value pair in the cache\r\n * @ignore\r\n */\r\n AuthenticationContext.prototype._saveItem = function (key, obj, preserve) {\r\n\r\n if (this.config && this.config.cacheLocation && this.config.cacheLocation === 'localStorage') {\r\n\r\n if (!this._supportsLocalStorage()) {\r\n this.info('Local storage is not supported');\r\n return false;\r\n }\r\n\r\n if (preserve) {\r\n var value = this._getItem(key) || '';\r\n localStorage.setItem(key, value + obj + this.CONSTANTS.CACHE_DELIMETER);\r\n }\r\n else {\r\n localStorage.setItem(key, obj);\r\n }\r\n\r\n return true;\r\n }\r\n\r\n // Default as session storage\r\n if (!this._supportsSessionStorage()) {\r\n this.info('Session storage is not supported');\r\n return false;\r\n }\r\n\r\n sessionStorage.setItem(key, obj);\r\n return true;\r\n };\r\n\r\n /**\r\n * Searches the value for the given key in the cache\r\n * @ignore\r\n */\r\n AuthenticationContext.prototype._getItem = function (key) {\r\n\r\n if (this.config && this.config.cacheLocation && this.config.cacheLocation === 'localStorage') {\r\n\r\n if (!this._supportsLocalStorage()) {\r\n this.info('Local storage is not supported');\r\n return null;\r\n }\r\n\r\n return localStorage.getItem(key);\r\n }\r\n\r\n // Default as session storage\r\n if (!this._supportsSessionStorage()) {\r\n this.info('Session storage is not supported');\r\n return null;\r\n }\r\n\r\n return sessionStorage.getItem(key);\r\n };\r\n\r\n /**\r\n * Returns true if browser supports localStorage, false otherwise.\r\n * @ignore\r\n */\r\n AuthenticationContext.prototype._supportsLocalStorage = function () {\r\n try {\r\n if (!window.localStorage) return false; // Test availability\r\n window.localStorage.setItem('storageTest', 'A'); // Try write\r\n if (window.localStorage.getItem('storageTest') != 'A') return false; // Test read/write\r\n window.localStorage.removeItem('storageTest'); // Try delete\r\n if (window.localStorage.getItem('storageTest')) return false; // Test delete\r\n return true; // Success\r\n } catch (e) {\r\n return false;\r\n }\r\n };\r\n\r\n /**\r\n * Returns true if browser supports sessionStorage, false otherwise.\r\n * @ignore\r\n */\r\n AuthenticationContext.prototype._supportsSessionStorage = function () {\r\n try {\r\n if (!window.sessionStorage) return false; // Test availability\r\n window.sessionStorage.setItem('storageTest', 'A'); // Try write\r\n if (window.sessionStorage.getItem('storageTest') != 'A') return false; // Test read/write\r\n window.sessionStorage.removeItem('storageTest'); // Try delete\r\n if (window.sessionStorage.getItem('storageTest')) return false; // Test delete\r\n return true; // Success\r\n } catch (e) {\r\n return false;\r\n }\r\n };\r\n\r\n /**\r\n * Returns a cloned copy of the passed object.\r\n * @ignore\r\n */\r\n AuthenticationContext.prototype._cloneConfig = function (obj) {\r\n if (null === obj || 'object' !== typeof obj) {\r\n return obj;\r\n }\r\n\r\n var copy = {};\r\n for (var attr in obj) {\r\n if (obj.hasOwnProperty(attr)) {\r\n copy[attr] = obj[attr];\r\n }\r\n }\r\n return copy;\r\n };\r\n\r\n /**\r\n * Adds the library version and returns it.\r\n * @ignore\r\n */\r\n AuthenticationContext.prototype._addLibMetadata = function () {\r\n // x-client-SKU\r\n // x-client-Ver\r\n return '&x-client-SKU=Js&x-client-Ver=' + this._libVersion();\r\n };\r\n\r\n /**\r\n * Checks the Logging Level, constructs the Log message and logs it. Users need to implement/override this method to turn on Logging. \r\n * @param {number} level - Level can be set 0,1,2 and 3 which turns on 'error', 'warning', 'info' or 'verbose' level logging respectively.\r\n * @param {string} message - Message to log.\r\n * @param {string} error - Error to log.\r\n */\r\n AuthenticationContext.prototype.log = function (level, message, error, containsPii) {\r\n\r\n if (level <= Logging.level) {\r\n\r\n if (!Logging.piiLoggingEnabled && containsPii)\r\n return;\r\n\r\n var timestamp = new Date().toUTCString();\r\n var formattedMessage = '';\r\n\r\n if (this.config.correlationId)\r\n formattedMessage = timestamp + ':' + this.config.correlationId + '-' + this._libVersion() + '-' + this.CONSTANTS.LEVEL_STRING_MAP[level] + ' ' + message;\r\n else\r\n formattedMessage = timestamp + ':' + this._libVersion() + '-' + this.CONSTANTS.LEVEL_STRING_MAP[level] + ' ' + message;\r\n\r\n if (error) {\r\n formattedMessage += '\\nstack:\\n' + error.stack;\r\n }\r\n\r\n Logging.log(formattedMessage);\r\n }\r\n };\r\n\r\n /**\r\n * Logs messages when Logging Level is set to 0.\r\n * @param {string} message - Message to log.\r\n * @param {string} error - Error to log.\r\n */\r\n AuthenticationContext.prototype.error = function (message, error) {\r\n this.log(this.CONSTANTS.LOGGING_LEVEL.ERROR, message, error);\r\n };\r\n\r\n /**\r\n * Logs messages when Logging Level is set to 1.\r\n * @param {string} message - Message to log.\r\n */\r\n AuthenticationContext.prototype.warn = function (message) {\r\n this.log(this.CONSTANTS.LOGGING_LEVEL.WARN, message, null);\r\n };\r\n\r\n /**\r\n * Logs messages when Logging Level is set to 2.\r\n * @param {string} message - Message to log.\r\n */\r\n AuthenticationContext.prototype.info = function (message) {\r\n this.log(this.CONSTANTS.LOGGING_LEVEL.INFO, message, null);\r\n };\r\n\r\n /**\r\n * Logs messages when Logging Level is set to 3.\r\n * @param {string} message - Message to log.\r\n */\r\n AuthenticationContext.prototype.verbose = function (message) {\r\n this.log(this.CONSTANTS.LOGGING_LEVEL.VERBOSE, message, null);\r\n };\r\n\r\n /**\r\n * Logs Pii messages when Logging Level is set to 0 and window.piiLoggingEnabled is set to true.\r\n * @param {string} message - Message to log.\r\n * @param {string} error - Error to log.\r\n */\r\n AuthenticationContext.prototype.errorPii = function (message, error) {\r\n this.log(this.CONSTANTS.LOGGING_LEVEL.ERROR, message, error, true);\r\n };\r\n\r\n /**\r\n * Logs Pii messages when Logging Level is set to 1 and window.piiLoggingEnabled is set to true.\r\n * @param {string} message - Message to log.\r\n */\r\n AuthenticationContext.prototype.warnPii = function (message) {\r\n this.log(this.CONSTANTS.LOGGING_LEVEL.WARN, message, null, true);\r\n };\r\n\r\n /**\r\n * Logs messages when Logging Level is set to 2 and window.piiLoggingEnabled is set to true.\r\n * @param {string} message - Message to log.\r\n */\r\n AuthenticationContext.prototype.infoPii = function (message) {\r\n this.log(this.CONSTANTS.LOGGING_LEVEL.INFO, message, null, true);\r\n };\r\n\r\n /**\r\n * Logs messages when Logging Level is set to 3 and window.piiLoggingEnabled is set to true.\r\n * @param {string} message - Message to log.\r\n */\r\n AuthenticationContext.prototype.verbosePii = function (message) {\r\n this.log(this.CONSTANTS.LOGGING_LEVEL.VERBOSE, message, null, true);\r\n };\r\n /**\r\n * Returns the library version.\r\n * @ignore\r\n */\r\n AuthenticationContext.prototype._libVersion = function () {\r\n return '1.0.17';\r\n };\r\n\r\n /**\r\n * Returns a reference of Authentication Context as a result of a require call.\r\n * @ignore\r\n */\r\n if (typeof module !== 'undefined' && module.exports) {\r\n module.exports = AuthenticationContext;\r\n module.exports.inject = function (conf) {\r\n return new AuthenticationContext(conf);\r\n };\r\n }\r\n\r\n return AuthenticationContext;\r\n\r\n}());\r\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/adal-angular/lib/adal.js\n// module id = 9\n// module chunks = 0","export { default as CachingConfigurationProvider, } from \"./cachingConfigurationProvider\";\r\nexport { default as SPListConfigurationProvider, } from \"./spListConfigurationProvider\";\r\n//# sourceMappingURL=index.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./build/packages/config-store/es5/src/providers/index.js\n// module id = 10\n// module chunks = 0","import { default as CachingConfigurationProvider } from \"./cachingConfigurationProvider\";\r\n/**\r\n * A configuration provider which loads configuration values from a SharePoint list\r\n *\r\n */\r\nvar SPListConfigurationProvider = /** @class */ (function () {\r\n /**\r\n * Creates a new SharePoint list based configuration provider\r\n * @constructor\r\n * @param {string} webUrl Url of the SharePoint site, where the configuration list is located\r\n * @param {string} listTitle Title of the SharePoint list, which contains the configuration settings (optional, default: \"config\")\r\n * @param {string} keyFieldName The name of the field in the list to use as the setting key (optional, default: \"Title\")\r\n * @param {string} valueFieldName The name of the field in the list to use as the setting value (optional, default: \"Value\")\r\n */\r\n function SPListConfigurationProvider(web, listTitle, keyFieldName, valueFieldName) {\r\n if (listTitle === void 0) { listTitle = \"config\"; }\r\n if (keyFieldName === void 0) { keyFieldName = \"Title\"; }\r\n if (valueFieldName === void 0) { valueFieldName = \"Value\"; }\r\n this.web = web;\r\n this.listTitle = listTitle;\r\n this.keyFieldName = keyFieldName;\r\n this.valueFieldName = valueFieldName;\r\n }\r\n /**\r\n * Loads the configuration values from the SharePoint list\r\n *\r\n * @return {Promise>} Promise of loaded configuration values\r\n */\r\n SPListConfigurationProvider.prototype.getConfiguration = function () {\r\n var _this = this;\r\n return this.web.lists.getByTitle(this.listTitle).items.select(this.keyFieldName, this.valueFieldName).get()\r\n .then(function (data) { return data.reduce(function (c, item) {\r\n c[item[_this.keyFieldName]] = item[_this.valueFieldName];\r\n return c;\r\n }, {}); });\r\n };\r\n /**\r\n * Wraps the current provider in a cache enabled provider\r\n *\r\n * @return {CachingConfigurationProvider} Caching providers which wraps the current provider\r\n */\r\n SPListConfigurationProvider.prototype.asCaching = function (cacheKey) {\r\n if (cacheKey === void 0) { cacheKey = \"pnp_configcache_splist_\" + this.web.toUrl() + \"+\" + this.listTitle; }\r\n return new CachingConfigurationProvider(this, cacheKey);\r\n };\r\n return SPListConfigurationProvider;\r\n}());\r\nexport default SPListConfigurationProvider;\r\n//# sourceMappingURL=spListConfigurationProvider.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./build/packages/config-store/es5/src/providers/spListConfigurationProvider.js\n// module id = 11\n// module chunks = 0"],"sourceRoot":""}