Guest User

Untitled

a guest
Apr 18th, 2017
2,647
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*! jQuery v3.2.1 | (c) JS Foundation and other contributors | jquery.org/license */
  2.  
  3. !function(a,b){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){"use strict";var c=[],d=a.document,e=Object.getPrototypeOf,f=c.slice,g=c.concat,h=c.push,i=c.indexOf,j={},k=j.toString,l=j.hasOwnProperty,m=l.toString,n=m.call(Object),o={};function p(a,b){b=b||d;var c=b.createElement("script");c.text=a,b.head.appendChild(c).parentNode.removeChild(c)}var q="3.2.1",r=function(a,b){return new r.fn.init(a,b)},s=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,t=/^-ms-/,u=/-([a-z])/g,v=function(a,b){return b.toUpperCase()};r.fn=r.prototype={jquery:q,constructor:r,length:0,toArray:function(){return f.call(this)},get:function(a){return null==a?f.call(this):a<0?this[a+this.length]:this[a]},pushStack:function(a){var b=r.merge(this.constructor(),a);return b.prevObject=this,b},each:function(a){return r.each(this,a)},map:function(a){return this.pushStack(r.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(f.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(a<0?b:0);return this.pushStack(c>=0&&c<b?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:h,sort:c.sort,splice:c.splice},r.extend=r.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||r.isFunction(g)||(g={}),h===i&&(g=this,h--);h<i;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(r.isPlainObject(d)||(e=Array.isArray(d)))?(e?(e=!1,f=c&&Array.isArray(c)?c:[]):f=c&&r.isPlainObject(c)?c:{},g[b]=r.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},r.extend({expando:"jQuery"+(q+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===r.type(a)},isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){var b=r.type(a);return("number"===b||"string"===b)&&!isNaN(a-parseFloat(a))},isPlainObject:function(a){var b,c;return!(!a||"[object Object]"!==k.call(a))&&(!(b=e(a))||(c=l.call(b,"constructor")&&b.constructor,"function"==typeof c&&m.call(c)===n))},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?j[k.call(a)]||"object":typeof a},globalEval:function(a){p(a)},camelCase:function(a){return a.replace(t,"ms-").replace(u,v)},each:function(a,b){var c,d=0;if(w(a)){for(c=a.length;d<c;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(s,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(w(Object(a))?r.merge(c,"string"==typeof a?[a]:a):h.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:i.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;d<c;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;f<g;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,f=0,h=[];if(w(a))for(d=a.length;f<d;f++)e=b(a[f],f,c),null!=e&&h.push(e);else for(f in a)e=b(a[f],f,c),null!=e&&h.push(e);return g.apply([],h)},guid:1,proxy:function(a,b){var c,d,e;if("string"==typeof b&&(c=a[b],b=a,a=c),r.isFunction(a))return d=f.call(arguments,2),e=function(){return a.apply(b||this,d.concat(f.call(arguments)))},e.guid=a.guid=a.guid||r.guid++,e},now:Date.now,support:o}),"function"==typeof Symbol&&(r.fn[Symbol.iterator]=c[Symbol.iterator]),r.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){j["[object "+b+"]"]=b.toLowerCase()});function w(a){var b=!!a&&"length"in a&&a.length,c=r.type(a);return"function"!==c&&!r.isWindow(a)&&("array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a)}var x=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=function(a,b){for(var c=0,d=a.length;c<d;c++)if(a[c]===b)return c;return-1},J="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",K="[\\x20\\t\\r\\n\\f]",L="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",M="\\["+K+"*("+L+")(?:"+K+"*([*^$|!~]?=)"+K+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+L+"))|)"+K+"*\\]",N=":("+L+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+M+")*)|.*)\\)|)",O=new RegExp(K+"+","g"),P=new RegExp("^"+K+"+|((?:^|[^\\\\])(?:\\\\.)*)"+K+"+$","g"),Q=new RegExp("^"+K+"*,"+K+"*"),R=new RegExp("^"+K+"*([>+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(N),U=new RegExp("^"+L+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L+"|[*])"),ATTR:new RegExp("^"+M),PSEUDO:new RegExp("^"+N),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),aa=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:d<0?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ba=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ca=function(a,b){return b?"\0"===a?"\ufffd":a.slice(0,-1)+"\\"+a.charCodeAt(a.length-1).toString(16)+" ":"\\"+a},da=function(){m()},ea=ta(function(a){return a.disabled===!0&&("form"in a||"label"in a)},{dir:"parentNode",next:"legend"});try{G.apply(D=H.call(v.childNodes),v.childNodes),D[v.childNodes.length].nodeType}catch(fa){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s=b&&b.ownerDocument,w=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==w&&9!==w&&11!==w)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==w&&(l=Z.exec(a)))if(f=l[1]){if(9===w){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(s&&(j=s.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(l[2])return G.apply(d,b.getElementsByTagName(a)),d;if((f=l[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==w)s=b,r=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(ba,ca):b.setAttribute("id",k=u),o=g(a),h=o.length;while(h--)o[h]="#"+k+" "+sa(o[h]);r=o.join(","),s=$.test(a)&&qa(b.parentNode)||b}if(r)try{return G.apply(d,s.querySelectorAll(r)),d}catch(x){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(P,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("fieldset");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&a.sourceIndex-b.sourceIndex;if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return function(b){return"form"in b?b.parentNode&&b.disabled===!1?"label"in b?"label"in b.parentNode?b.parentNode.disabled===a:b.disabled===a:b.isDisabled===a||b.isDisabled!==!a&&ea(b)===a:b.disabled===a:"label"in b&&b.disabled===a}}function pa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function qa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return!!b&&"HTML"!==b.nodeName},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),v!==n&&(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(n.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){return a.getAttribute("id")===b}},d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}}):(d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}},d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c,d,e,f=b.getElementById(a);if(f){if(c=f.getAttributeNode("id"),c&&c.value===a)return[f];e=b.getElementsByName(a),d=0;while(f=e[d++])if(c=f.getAttributeNode("id"),c&&c.value===a)return[f]}return[]}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){if("undefined"!=typeof b.getElementsByClassName&&p)return b.getElementsByClassName(a)},r=[],q=[],(c.qsa=Y.test(n.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\r\\' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){a.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+K+"*[*^$|!~]?="),2!==a.querySelectorAll(":enabled").length&&q.push(":enabled",":disabled"),o.appendChild(a).disabled=!0,2!==a.querySelectorAll(":disabled").length&&q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Y.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"*"),s.call(a,"[s!='']:x"),r.push("!=",N)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Y.test(o.compareDocumentPosition),t=b||Y.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?I(k,a)-I(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?I(k,a)-I(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?la(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(S,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.escape=function(a){return(a+"").replace(ba,ca)},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(_,aa),a[3]=(a[3]||a[4]||a[5]||"").replace(_,aa),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return V.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&T.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(_,aa).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:!b||(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(O," ")+" ").indexOf(c)>-1:"|="===b&&(e===c||e.slice(0,c.length+1)===c+"-"))}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(P,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(_,aa),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return U.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(_,aa).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:oa(!1),disabled:oa(!0),checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:pa(function(){return[0]}),last:pa(function(a,b){return[b-1]}),eq:pa(function(a,b,c){return[c<0?c+b:c]}),even:pa(function(a,b){for(var c=0;c<b;c+=2)a.push(c);return a}),odd:pa(function(a,b){for(var c=1;c<b;c+=2)a.push(c);return a}),lt:pa(function(a,b,c){for(var d=c<0?c+b:c;--d>=0;)a.push(d);return a}),gt:pa(function(a,b,c){for(var d=c<0?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=ma(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=na(b);function ra(){}ra.prototype=d.filters=d.pseudos,d.setFilters=new ra,g=ga.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){c&&!(e=Q.exec(h))||(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=R.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(P," ")}),h=h.slice(c.length));for(g in d.filter)!(e=V[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?ga.error(a):z(a,i).slice(0)};function sa(a){for(var b=0,c=a.length,d="";b<c;b++)d+=a[b].value;return d}function ta(a,b,c){var d=b.dir,e=b.next,f=e||d,g=c&&"parentNode"===f,h=x++;return b.first?function(b,c,e){while(b=b[d])if(1===b.nodeType||g)return a(b,c,e);return!1}:function(b,c,i){var j,k,l,m=[w,h];if(i){while(b=b[d])if((1===b.nodeType||g)&&a(b,c,i))return!0}else while(b=b[d])if(1===b.nodeType||g)if(l=b[u]||(b[u]={}),k=l[b.uniqueID]||(l[b.uniqueID]={}),e&&e===b.nodeName.toLowerCase())b=b[d]||b;else{if((j=k[f])&&j[0]===w&&j[1]===h)return m[2]=j[2];if(k[f]=m,m[2]=a(b,c,i))return!0}return!1}}function ua(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function va(a,b,c){for(var d=0,e=b.length;d<e;d++)ga(a,b[d],c);return c}function wa(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;h<i;h++)(f=a[h])&&(c&&!c(f,d,e)||(g.push(f),j&&b.push(h)));return g}function xa(a,b,c,d,e,f){return d&&!d[u]&&(d=xa(d)),e&&!e[u]&&(e=xa(e,f)),ia(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||va(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:wa(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=wa(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?I(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=wa(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ya(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ta(function(a){return a===b},h,!0),l=ta(function(a){return I(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];i<f;i++)if(c=d.relative[a[i].type])m=[ta(ua(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;e<f;e++)if(d.relative[a[e].type])break;return xa(i>1&&ua(m),i>1&&sa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(P,"$1"),c,i<e&&ya(a.slice(i,e)),e<f&&ya(a=a.slice(e)),e<f&&sa(a))}m.push(c)}return ua(m)}function za(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=E.call(i));u=wa(u)}G.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&ga.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=ya(b[c]),f[u]?d.push(f):e.push(f);f=A(a,za(e,d)),f.selector=a}return f},i=ga.select=function(a,b,c,e){var f,i,j,k,l,m="function"==typeof a&&a,n=!e&&g(a=m.selector||a);if(c=c||[],1===n.length){if(i=n[0]=n[0].slice(0),i.length>2&&"ID"===(j=i[0]).type&&9===b.nodeType&&p&&d.relative[i[1].type]){if(b=(d.find.ID(j.matches[0].replace(_,aa),b)||[])[0],!b)return c;m&&(b=b.parentNode),a=a.slice(i.shift().value.length)}f=V.needsContext.test(a)?0:i.length;while(f--){if(j=i[f],d.relative[k=j.type])break;if((l=d.find[k])&&(e=l(j.matches[0].replace(_,aa),$.test(i[0].type)&&qa(b.parentNode)||b))){if(i.splice(f,1),a=e.length&&sa(i),!a)return G.apply(c,e),c;break}}}return(m||h(a,n))(e,b,!p,c,!b||$.test(a)&&qa(b.parentNode)||b),c},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("fieldset"))}),ja(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){if(!c)return a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){if(!c&&"input"===a.nodeName.toLowerCase())return a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(J,function(a,b,c){var d;if(!c)return a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);r.find=x,r.expr=x.selectors,r.expr[":"]=r.expr.pseudos,r.uniqueSort=r.unique=x.uniqueSort,r.text=x.getText,r.isXMLDoc=x.isXML,r.contains=x.contains,r.escapeSelector=x.escape;var y=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&r(a).is(c))break;d.push(a)}return d},z=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},A=r.expr.match.needsContext;function B(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()}var C=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,D=/^.[^:#\[\.,]*$/;function E(a,b,c){return r.isFunction(b)?r.grep(a,function(a,d){return!!b.call(a,d,a)!==c}):b.nodeType?r.grep(a,function(a){return a===b!==c}):"string"!=typeof b?r.grep(a,function(a){return i.call(b,a)>-1!==c}):D.test(b)?r.filter(b,a,c):(b=r.filter(b,a),r.grep(a,function(a){return i.call(b,a)>-1!==c&&1===a.nodeType}))}r.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?r.find.matchesSelector(d,a)?[d]:[]:r.find.matches(a,r.grep(b,function(a){return 1===a.nodeType}))},r.fn.extend({find:function(a){var b,c,d=this.length,e=this;if("string"!=typeof a)return this.pushStack(r(a).filter(function(){for(b=0;b<d;b++)if(r.contains(e[b],this))return!0}));for(c=this.pushStack([]),b=0;b<d;b++)r.find(a,e[b],c);return d>1?r.uniqueSort(c):c},filter:function(a){return this.pushStack(E(this,a||[],!1))},not:function(a){return this.pushStack(E(this,a||[],!0))},is:function(a){return!!E(this,"string"==typeof a&&A.test(a)?r(a):a||[],!1).length}});var F,G=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,H=r.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||F,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:G.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof r?b[0]:b,r.merge(this,r.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),C.test(e[1])&&r.isPlainObject(b))for(e in b)r.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&(this[0]=f,this.length=1),this}return a.nodeType?(this[0]=a,this.length=1,this):r.isFunction(a)?void 0!==c.ready?c.ready(a):a(r):r.makeArray(a,this)};H.prototype=r.fn,F=r(d);var I=/^(?:parents|prev(?:Until|All))/,J={children:!0,contents:!0,next:!0,prev:!0};r.fn.extend({has:function(a){var b=r(a,this),c=b.length;return this.filter(function(){for(var a=0;a<c;a++)if(r.contains(this,b[a]))return!0})},closest:function(a,b){var c,d=0,e=this.length,f=[],g="string"!=typeof a&&r(a);if(!A.test(a))for(;d<e;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&r.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?r.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?i.call(r(a),this[0]):i.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(r.uniqueSort(r.merge(this.get(),r(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function K(a,b){while((a=a[b])&&1!==a.nodeType);return a}r.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return y(a,"parentNode")},parentsUntil:function(a,b,c){return y(a,"parentNode",c)},next:function(a){return K(a,"nextSibling")},prev:function(a){return K(a,"previousSibling")},nextAll:function(a){return y(a,"nextSibling")},prevAll:function(a){return y(a,"previousSibling")},nextUntil:function(a,b,c){return y(a,"nextSibling",c)},prevUntil:function(a,b,c){return y(a,"previousSibling",c)},siblings:function(a){return z((a.parentNode||{}).firstChild,a)},children:function(a){return z(a.firstChild)},contents:function(a){return B(a,"iframe")?a.contentDocument:(B(a,"template")&&(a=a.content||a),r.merge([],a.childNodes))}},function(a,b){r.fn[a]=function(c,d){var e=r.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=r.filter(d,e)),this.length>1&&(J[a]||r.uniqueSort(e),I.test(a)&&e.reverse()),this.pushStack(e)}});var L=/[^\x20\t\r\n\f]+/g;function M(a){var b={};return r.each(a.match(L)||[],function(a,c){b[c]=!0}),b}r.Callbacks=function(a){a="string"==typeof a?M(a):r.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=e||a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h<f.length)f[h].apply(c[0],c[1])===!1&&a.stopOnFalse&&(h=f.length,c=!1)}a.memory||(c=!1),b=!1,e&&(f=c?[]:"")},j={add:function(){return f&&(c&&!b&&(h=f.length-1,g.push(c)),function d(b){r.each(b,function(b,c){r.isFunction(c)?a.unique&&j.has(c)||f.push(c):c&&c.length&&"string"!==r.type(c)&&d(c)})}(arguments),c&&!b&&i()),this},remove:function(){return r.each(arguments,function(a,b){var c;while((c=r.inArray(b,f,c))>-1)f.splice(c,1),c<=h&&h--}),this},has:function(a){return a?r.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||b||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j};function N(a){return a}function O(a){throw a}function P(a,b,c,d){var e;try{a&&r.isFunction(e=a.promise)?e.call(a).done(b).fail(c):a&&r.isFunction(e=a.then)?e.call(a,b,c):b.apply(void 0,[a].slice(d))}catch(a){c.apply(void 0,[a])}}r.extend({Deferred:function(b){var c=[["notify","progress",r.Callbacks("memory"),r.Callbacks("memory"),2],["resolve","done",r.Callbacks("once memory"),r.Callbacks("once memory"),0,"resolved"],["reject","fail",r.Callbacks("once memory"),r.Callbacks("once memory"),1,"rejected"]],d="pending",e={state:function(){return d},always:function(){return f.done(arguments).fail(arguments),this},"catch":function(a){return e.then(null,a)},pipe:function(){var a=arguments;return r.Deferred(function(b){r.each(c,function(c,d){var e=r.isFunction(a[d[4]])&&a[d[4]];f[d[1]](function(){var a=e&&e.apply(this,arguments);a&&r.isFunction(a.promise)?a.promise().progress(b.notify).done(b.resolve).fail(b.reject):b[d[0]+"With"](this,e?[a]:arguments)})}),a=null}).promise()},then:function(b,d,e){var f=0;function g(b,c,d,e){return function(){var h=this,i=arguments,j=function(){var a,j;if(!(b<f)){if(a=d.apply(h,i),a===c.promise())throw new TypeError("Thenable self-resolution");j=a&&("object"==typeof a||"function"==typeof a)&&a.then,r.isFunction(j)?e?j.call(a,g(f,c,N,e),g(f,c,O,e)):(f++,j.call(a,g(f,c,N,e),g(f,c,O,e),g(f,c,N,c.notifyWith))):(d!==N&&(h=void 0,i=[a]),(e||c.resolveWith)(h,i))}},k=e?j:function(){try{j()}catch(a){r.Deferred.exceptionHook&&r.Deferred.exceptionHook(a,k.stackTrace),b+1>=f&&(d!==O&&(h=void 0,i=[a]),c.rejectWith(h,i))}};b?k():(r.Deferred.getStackHook&&(k.stackTrace=r.Deferred.getStackHook()),a.setTimeout(k))}}return r.Deferred(function(a){c[0][3].add(g(0,a,r.isFunction(e)?e:N,a.notifyWith)),c[1][3].add(g(0,a,r.isFunction(b)?b:N)),c[2][3].add(g(0,a,r.isFunction(d)?d:O))}).promise()},promise:function(a){return null!=a?r.extend(a,e):e}},f={};return r.each(c,function(a,b){var g=b[2],h=b[5];e[b[1]]=g.add,h&&g.add(function(){d=h},c[3-a][2].disable,c[0][2].lock),g.add(b[3].fire),f[b[0]]=function(){return f[b[0]+"With"](this===f?void 0:this,arguments),this},f[b[0]+"With"]=g.fireWith}),e.promise(f),b&&b.call(f,f),f},when:function(a){var b=arguments.length,c=b,d=Array(c),e=f.call(arguments),g=r.Deferred(),h=function(a){return function(c){d[a]=this,e[a]=arguments.length>1?f.call(arguments):c,--b||g.resolveWith(d,e)}};if(b<=1&&(P(a,g.done(h(c)).resolve,g.reject,!b),"pending"===g.state()||r.isFunction(e[c]&&e[c].then)))return g.then();while(c--)P(e[c],h(c),g.reject);return g.promise()}});var Q=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;r.Deferred.exceptionHook=function(b,c){a.console&&a.console.warn&&b&&Q.test(b.name)&&a.console.warn("jQuery.Deferred exception: "+b.message,b.stack,c)},r.readyException=function(b){a.setTimeout(function(){throw b})};var R=r.Deferred();r.fn.ready=function(a){return R.then(a)["catch"](function(a){r.readyException(a)}),this},r.extend({isReady:!1,readyWait:1,ready:function(a){(a===!0?--r.readyWait:r.isReady)||(r.isReady=!0,a!==!0&&--r.readyWait>0||R.resolveWith(d,[r]))}}),r.ready.then=R.then;function S(){d.removeEventListener("DOMContentLoaded",S),
  4. a.removeEventListener("load",S),r.ready()}"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(r.ready):(d.addEventListener("DOMContentLoaded",S),a.addEventListener("load",S));var T=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===r.type(c)){e=!0;for(h in c)T(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,r.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(r(a),c)})),b))for(;h<i;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},U=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function V(){this.expando=r.expando+V.uid++}V.uid=1,V.prototype={cache:function(a){var b=a[this.expando];return b||(b={},U(a)&&(a.nodeType?a[this.expando]=b:Object.defineProperty(a,this.expando,{value:b,configurable:!0}))),b},set:function(a,b,c){var d,e=this.cache(a);if("string"==typeof b)e[r.camelCase(b)]=c;else for(d in b)e[r.camelCase(d)]=b[d];return e},get:function(a,b){return void 0===b?this.cache(a):a[this.expando]&&a[this.expando][r.camelCase(b)]},access:function(a,b,c){return void 0===b||b&&"string"==typeof b&&void 0===c?this.get(a,b):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d=a[this.expando];if(void 0!==d){if(void 0!==b){Array.isArray(b)?b=b.map(r.camelCase):(b=r.camelCase(b),b=b in d?[b]:b.match(L)||[]),c=b.length;while(c--)delete d[b[c]]}(void 0===b||r.isEmptyObject(d))&&(a.nodeType?a[this.expando]=void 0:delete a[this.expando])}},hasData:function(a){var b=a[this.expando];return void 0!==b&&!r.isEmptyObject(b)}};var W=new V,X=new V,Y=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Z=/[A-Z]/g;function $(a){return"true"===a||"false"!==a&&("null"===a?null:a===+a+""?+a:Y.test(a)?JSON.parse(a):a)}function _(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(Z,"-$&").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c=$(c)}catch(e){}X.set(a,b,c)}else c=void 0;return c}r.extend({hasData:function(a){return X.hasData(a)||W.hasData(a)},data:function(a,b,c){return X.access(a,b,c)},removeData:function(a,b){X.remove(a,b)},_data:function(a,b,c){return W.access(a,b,c)},_removeData:function(a,b){W.remove(a,b)}}),r.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=X.get(f),1===f.nodeType&&!W.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=r.camelCase(d.slice(5)),_(f,d,e[d])));W.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){X.set(this,a)}):T(this,function(b){var c;if(f&&void 0===b){if(c=X.get(f,a),void 0!==c)return c;if(c=_(f,a),void 0!==c)return c}else this.each(function(){X.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){X.remove(this,a)})}}),r.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=W.get(a,b),c&&(!d||Array.isArray(c)?d=W.access(a,b,r.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=r.queue(a,b),d=c.length,e=c.shift(),f=r._queueHooks(a,b),g=function(){r.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return W.get(a,c)||W.access(a,c,{empty:r.Callbacks("once memory").add(function(){W.remove(a,[b+"queue",c])})})}}),r.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?r.queue(this[0],a):void 0===b?this:this.each(function(){var c=r.queue(this,a,b);r._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&r.dequeue(this,a)})},dequeue:function(a){return this.each(function(){r.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=r.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=W.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var aa=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,ba=new RegExp("^(?:([+-])=|)("+aa+")([a-z%]*)$","i"),ca=["Top","Right","Bottom","Left"],da=function(a,b){return a=b||a,"none"===a.style.display||""===a.style.display&&r.contains(a.ownerDocument,a)&&"none"===r.css(a,"display")},ea=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};function fa(a,b,c,d){var e,f=1,g=20,h=d?function(){return d.cur()}:function(){return r.css(a,b,"")},i=h(),j=c&&c[3]||(r.cssNumber[b]?"":"px"),k=(r.cssNumber[b]||"px"!==j&&+i)&&ba.exec(r.css(a,b));if(k&&k[3]!==j){j=j||k[3],c=c||[],k=+i||1;do f=f||".5",k/=f,r.style(a,b,k+j);while(f!==(f=h()/i)&&1!==f&&--g)}return c&&(k=+k||+i||0,e=c[1]?k+(c[1]+1)*c[2]:+c[2],d&&(d.unit=j,d.start=k,d.end=e)),e}var ga={};function ha(a){var b,c=a.ownerDocument,d=a.nodeName,e=ga[d];return e?e:(b=c.body.appendChild(c.createElement(d)),e=r.css(b,"display"),b.parentNode.removeChild(b),"none"===e&&(e="block"),ga[d]=e,e)}function ia(a,b){for(var c,d,e=[],f=0,g=a.length;f<g;f++)d=a[f],d.style&&(c=d.style.display,b?("none"===c&&(e[f]=W.get(d,"display")||null,e[f]||(d.style.display="")),""===d.style.display&&da(d)&&(e[f]=ha(d))):"none"!==c&&(e[f]="none",W.set(d,"display",c)));for(f=0;f<g;f++)null!=e[f]&&(a[f].style.display=e[f]);return a}r.fn.extend({show:function(){return ia(this,!0)},hide:function(){return ia(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){da(this)?r(this).show():r(this).hide()})}});var ja=/^(?:checkbox|radio)$/i,ka=/<([a-z][^\/\0>\x20\t\r\n\f]+)/i,la=/^$|\/(?:java|ecma)script/i,ma={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};ma.optgroup=ma.option,ma.tbody=ma.tfoot=ma.colgroup=ma.caption=ma.thead,ma.th=ma.td;function na(a,b){var c;return c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[],void 0===b||b&&B(a,b)?r.merge([a],c):c}function oa(a,b){for(var c=0,d=a.length;c<d;c++)W.set(a[c],"globalEval",!b||W.get(b[c],"globalEval"))}var pa=/<|&#?\w+;/;function qa(a,b,c,d,e){for(var f,g,h,i,j,k,l=b.createDocumentFragment(),m=[],n=0,o=a.length;n<o;n++)if(f=a[n],f||0===f)if("object"===r.type(f))r.merge(m,f.nodeType?[f]:f);else if(pa.test(f)){g=g||l.appendChild(b.createElement("div")),h=(ka.exec(f)||["",""])[1].toLowerCase(),i=ma[h]||ma._default,g.innerHTML=i[1]+r.htmlPrefilter(f)+i[2],k=i[0];while(k--)g=g.lastChild;r.merge(m,g.childNodes),g=l.firstChild,g.textContent=""}else m.push(b.createTextNode(f));l.textContent="",n=0;while(f=m[n++])if(d&&r.inArray(f,d)>-1)e&&e.push(f);else if(j=r.contains(f.ownerDocument,f),g=na(l.appendChild(f),"script"),j&&oa(g),c){k=0;while(f=g[k++])la.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),o.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="<textarea>x</textarea>",o.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var ra=d.documentElement,sa=/^key/,ta=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,ua=/^([^.]*)(?:\.(.+)|)/;function va(){return!0}function wa(){return!1}function xa(){try{return d.activeElement}catch(a){}}function ya(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)ya(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=wa;else if(!e)return a;return 1===f&&(g=e,e=function(a){return r().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=r.guid++)),a.each(function(){r.event.add(this,b,e,d,c)})}r.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=W.get(a);if(q){c.handler&&(f=c,c=f.handler,e=f.selector),e&&r.find.matchesSelector(ra,e),c.guid||(c.guid=r.guid++),(i=q.events)||(i=q.events={}),(g=q.handle)||(g=q.handle=function(b){return"undefined"!=typeof r&&r.event.triggered!==b.type?r.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(L)||[""],j=b.length;while(j--)h=ua.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n&&(l=r.event.special[n]||{},n=(e?l.delegateType:l.bindType)||n,l=r.event.special[n]||{},k=r.extend({type:n,origType:p,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&r.expr.match.needsContext.test(e),namespace:o.join(".")},f),(m=i[n])||(m=i[n]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,o,g)!==!1||a.addEventListener&&a.addEventListener(n,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),r.event.global[n]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=W.hasData(a)&&W.get(a);if(q&&(i=q.events)){b=(b||"").match(L)||[""],j=b.length;while(j--)if(h=ua.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n){l=r.event.special[n]||{},n=(d?l.delegateType:l.bindType)||n,m=i[n]||[],h=h[2]&&new RegExp("(^|\\.)"+o.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&p!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,o,q.handle)!==!1||r.removeEvent(a,n,q.handle),delete i[n])}else for(n in i)r.event.remove(a,n+b[j],c,d,!0);r.isEmptyObject(i)&&W.remove(a,"handle events")}},dispatch:function(a){var b=r.event.fix(a),c,d,e,f,g,h,i=new Array(arguments.length),j=(W.get(this,"events")||{})[b.type]||[],k=r.event.special[b.type]||{};for(i[0]=b,c=1;c<arguments.length;c++)i[c]=arguments[c];if(b.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,b)!==!1){h=r.event.handlers.call(this,b,j),c=0;while((f=h[c++])&&!b.isPropagationStopped()){b.currentTarget=f.elem,d=0;while((g=f.handlers[d++])&&!b.isImmediatePropagationStopped())b.rnamespace&&!b.rnamespace.test(g.namespace)||(b.handleObj=g,b.data=g.data,e=((r.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(b.result=e)===!1&&(b.preventDefault(),b.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,b),b.result}},handlers:function(a,b){var c,d,e,f,g,h=[],i=b.delegateCount,j=a.target;if(i&&j.nodeType&&!("click"===a.type&&a.button>=1))for(;j!==this;j=j.parentNode||this)if(1===j.nodeType&&("click"!==a.type||j.disabled!==!0)){for(f=[],g={},c=0;c<i;c++)d=b[c],e=d.selector+" ",void 0===g[e]&&(g[e]=d.needsContext?r(e,this).index(j)>-1:r.find(e,this,null,[j]).length),g[e]&&f.push(d);f.length&&h.push({elem:j,handlers:f})}return j=this,i<b.length&&h.push({elem:j,handlers:b.slice(i)}),h},addProp:function(a,b){Object.defineProperty(r.Event.prototype,a,{enumerable:!0,configurable:!0,get:r.isFunction(b)?function(){if(this.originalEvent)return b(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[a]},set:function(b){Object.defineProperty(this,a,{enumerable:!0,configurable:!0,writable:!0,value:b})}})},fix:function(a){return a[r.expando]?a:new r.Event(a)},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==xa()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===xa()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if("checkbox"===this.type&&this.click&&B(this,"input"))return this.click(),!1},_default:function(a){return B(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}}},r.removeEvent=function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c)},r.Event=function(a,b){return this instanceof r.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?va:wa,this.target=a.target&&3===a.target.nodeType?a.target.parentNode:a.target,this.currentTarget=a.currentTarget,this.relatedTarget=a.relatedTarget):this.type=a,b&&r.extend(this,b),this.timeStamp=a&&a.timeStamp||r.now(),void(this[r.expando]=!0)):new r.Event(a,b)},r.Event.prototype={constructor:r.Event,isDefaultPrevented:wa,isPropagationStopped:wa,isImmediatePropagationStopped:wa,isSimulated:!1,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=va,a&&!this.isSimulated&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=va,a&&!this.isSimulated&&a.stopPropagation()},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=va,a&&!this.isSimulated&&a.stopImmediatePropagation(),this.stopPropagation()}},r.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(a){var b=a.button;return null==a.which&&sa.test(a.type)?null!=a.charCode?a.charCode:a.keyCode:!a.which&&void 0!==b&&ta.test(a.type)?1&b?1:2&b?3:4&b?2:0:a.which}},r.event.addProp),r.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){r.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return e&&(e===d||r.contains(d,e))||(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),r.fn.extend({on:function(a,b,c,d){return ya(this,a,b,c,d)},one:function(a,b,c,d){return ya(this,a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,r(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return b!==!1&&"function"!=typeof b||(c=b,b=void 0),c===!1&&(c=wa),this.each(function(){r.event.remove(this,a,c,b)})}});var za=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,Aa=/<script|<style|<link/i,Ba=/checked\s*(?:[^=]|=\s*.checked.)/i,Ca=/^true\/(.*)/,Da=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function Ea(a,b){return B(a,"table")&&B(11!==b.nodeType?b:b.firstChild,"tr")?r(">tbody",a)[0]||a:a}function Fa(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function Ga(a){var b=Ca.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Ha(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(W.hasData(a)&&(f=W.access(a),g=W.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;c<d;c++)r.event.add(b,e,j[e][c])}X.hasData(a)&&(h=X.access(a),i=r.extend({},h),X.set(b,i))}}function Ia(a,b){var c=b.nodeName.toLowerCase();"input"===c&&ja.test(a.type)?b.checked=a.checked:"input"!==c&&"textarea"!==c||(b.defaultValue=a.defaultValue)}function Ja(a,b,c,d){b=g.apply([],b);var e,f,h,i,j,k,l=0,m=a.length,n=m-1,q=b[0],s=r.isFunction(q);if(s||m>1&&"string"==typeof q&&!o.checkClone&&Ba.test(q))return a.each(function(e){var f=a.eq(e);s&&(b[0]=q.call(this,e,f.html())),Ja(f,b,c,d)});if(m&&(e=qa(b,a[0].ownerDocument,!1,a,d),f=e.firstChild,1===e.childNodes.length&&(e=f),f||d)){for(h=r.map(na(e,"script"),Fa),i=h.length;l<m;l++)j=e,l!==n&&(j=r.clone(j,!0,!0),i&&r.merge(h,na(j,"script"))),c.call(a[l],j,l);if(i)for(k=h[h.length-1].ownerDocument,r.map(h,Ga),l=0;l<i;l++)j=h[l],la.test(j.type||"")&&!W.access(j,"globalEval")&&r.contains(k,j)&&(j.src?r._evalUrl&&r._evalUrl(j.src):p(j.textContent.replace(Da,""),k))}return a}function Ka(a,b,c){for(var d,e=b?r.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||r.cleanData(na(d)),d.parentNode&&(c&&r.contains(d.ownerDocument,d)&&oa(na(d,"script")),d.parentNode.removeChild(d));return a}r.extend({htmlPrefilter:function(a){return a.replace(za,"<$1></$2>")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=r.contains(a.ownerDocument,a);if(!(o.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||r.isXMLDoc(a)))for(g=na(h),f=na(a),d=0,e=f.length;d<e;d++)Ia(f[d],g[d]);if(b)if(c)for(f=f||na(a),g=g||na(h),d=0,e=f.length;d<e;d++)Ha(f[d],g[d]);else Ha(a,h);return g=na(h,"script"),g.length>0&&oa(g,!i&&na(a,"script")),h},cleanData:function(a){for(var b,c,d,e=r.event.special,f=0;void 0!==(c=a[f]);f++)if(U(c)){if(b=c[W.expando]){if(b.events)for(d in b.events)e[d]?r.event.remove(c,d):r.removeEvent(c,d,b.handle);c[W.expando]=void 0}c[X.expando]&&(c[X.expando]=void 0)}}}),r.fn.extend({detach:function(a){return Ka(this,a,!0)},remove:function(a){return Ka(this,a)},text:function(a){return T(this,function(a){return void 0===a?r.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=a)})},null,a,arguments.length)},append:function(){return Ja(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ea(this,a);b.appendChild(a)}})},prepend:function(){return Ja(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ea(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return Ja(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return Ja(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(r.cleanData(na(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null!=a&&a,b=null==b?a:b,this.map(function(){return r.clone(this,a,b)})},html:function(a){return T(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!Aa.test(a)&&!ma[(ka.exec(a)||["",""])[1].toLowerCase()]){a=r.htmlPrefilter(a);try{for(;c<d;c++)b=this[c]||{},1===b.nodeType&&(r.cleanData(na(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return Ja(this,arguments,function(b){var c=this.parentNode;r.inArray(this,a)<0&&(r.cleanData(na(this)),c&&c.replaceChild(b,this))},a)}}),r.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){r.fn[a]=function(a){for(var c,d=[],e=r(a),f=e.length-1,g=0;g<=f;g++)c=g===f?this:this.clone(!0),r(e[g])[b](c),h.apply(d,c.get());return this.pushStack(d)}});var La=/^margin/,Ma=new RegExp("^("+aa+")(?!px)[a-z%]+$","i"),Na=function(b){var c=b.ownerDocument.defaultView;return c&&c.opener||(c=a),c.getComputedStyle(b)};!function(){function b(){if(i){i.style.cssText="box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",i.innerHTML="",ra.appendChild(h);var b=a.getComputedStyle(i);c="1%"!==b.top,g="2px"===b.marginLeft,e="4px"===b.width,i.style.marginRight="50%",f="4px"===b.marginRight,ra.removeChild(h),i=null}}var c,e,f,g,h=d.createElement("div"),i=d.createElement("div");i.style&&(i.style.backgroundClip="content-box",i.cloneNode(!0).style.backgroundClip="",o.clearCloneStyle="content-box"===i.style.backgroundClip,h.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",h.appendChild(i),r.extend(o,{pixelPosition:function(){return b(),c},boxSizingReliable:function(){return b(),e},pixelMarginRight:function(){return b(),f},reliableMarginLeft:function(){return b(),g}}))}();function Oa(a,b,c){var d,e,f,g,h=a.style;return c=c||Na(a),c&&(g=c.getPropertyValue(b)||c[b],""!==g||r.contains(a.ownerDocument,a)||(g=r.style(a,b)),!o.pixelMarginRight()&&Ma.test(g)&&La.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0!==g?g+"":g}function Pa(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}var Qa=/^(none|table(?!-c[ea]).+)/,Ra=/^--/,Sa={position:"absolute",visibility:"hidden",display:"block"},Ta={letterSpacing:"0",fontWeight:"400"},Ua=["Webkit","Moz","ms"],Va=d.createElement("div").style;function Wa(a){if(a in Va)return a;var b=a[0].toUpperCase()+a.slice(1),c=Ua.length;while(c--)if(a=Ua[c]+b,a in Va)return a}function Xa(a){var b=r.cssProps[a];return b||(b=r.cssProps[a]=Wa(a)||a),b}function Ya(a,b,c){var d=ba.exec(b);return d?Math.max(0,d[2]-(c||0))+(d[3]||"px"):b}function Za(a,b,c,d,e){var f,g=0;for(f=c===(d?"border":"content")?4:"width"===b?1:0;f<4;f+=2)"margin"===c&&(g+=r.css(a,c+ca[f],!0,e)),d?("content"===c&&(g-=r.css(a,"padding"+ca[f],!0,e)),"margin"!==c&&(g-=r.css(a,"border"+ca[f]+"Width",!0,e))):(g+=r.css(a,"padding"+ca[f],!0,e),"padding"!==c&&(g+=r.css(a,"border"+ca[f]+"Width",!0,e)));return g}function $a(a,b,c){var d,e=Na(a),f=Oa(a,b,e),g="border-box"===r.css(a,"boxSizing",!1,e);return Ma.test(f)?f:(d=g&&(o.boxSizingReliable()||f===a.style[b]),"auto"===f&&(f=a["offset"+b[0].toUpperCase()+b.slice(1)]),f=parseFloat(f)||0,f+Za(a,b,c||(g?"border":"content"),d,e)+"px")}r.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Oa(a,"opacity");return""===c?"1":c}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=r.camelCase(b),i=Ra.test(b),j=a.style;return i||(b=Xa(h)),g=r.cssHooks[b]||r.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:j[b]:(f=typeof c,"string"===f&&(e=ba.exec(c))&&e[1]&&(c=fa(a,b,e),f="number"),null!=c&&c===c&&("number"===f&&(c+=e&&e[3]||(r.cssNumber[h]?"":"px")),o.clearCloneStyle||""!==c||0!==b.indexOf("background")||(j[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i?j.setProperty(b,c):j[b]=c)),void 0)}},css:function(a,b,c,d){var e,f,g,h=r.camelCase(b),i=Ra.test(b);return i||(b=Xa(h)),g=r.cssHooks[b]||r.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=Oa(a,b,d)),"normal"===e&&b in Ta&&(e=Ta[b]),""===c||c?(f=parseFloat(e),c===!0||isFinite(f)?f||0:e):e}}),r.each(["height","width"],function(a,b){r.cssHooks[b]={get:function(a,c,d){if(c)return!Qa.test(r.css(a,"display"))||a.getClientRects().length&&a.getBoundingClientRect().width?$a(a,b,d):ea(a,Sa,function(){return $a(a,b,d)})},set:function(a,c,d){var e,f=d&&Na(a),g=d&&Za(a,b,d,"border-box"===r.css(a,"boxSizing",!1,f),f);return g&&(e=ba.exec(c))&&"px"!==(e[3]||"px")&&(a.style[b]=c,c=r.css(a,b)),Ya(a,c,g)}}}),r.cssHooks.marginLeft=Pa(o.reliableMarginLeft,function(a,b){if(b)return(parseFloat(Oa(a,"marginLeft"))||a.getBoundingClientRect().left-ea(a,{marginLeft:0},function(){return a.getBoundingClientRect().left}))+"px"}),r.each({margin:"",padding:"",border:"Width"},function(a,b){r.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];d<4;d++)e[a+ca[d]+b]=f[d]||f[d-2]||f[0];return e}},La.test(a)||(r.cssHooks[a+b].set=Ya)}),r.fn.extend({css:function(a,b){return T(this,function(a,b,c){var d,e,f={},g=0;if(Array.isArray(b)){for(d=Na(a),e=b.length;g<e;g++)f[b[g]]=r.css(a,b[g],!1,d);return f}return void 0!==c?r.style(a,b,c):r.css(a,b)},a,b,arguments.length>1)}});function _a(a,b,c,d,e){return new _a.prototype.init(a,b,c,d,e)}r.Tween=_a,_a.prototype={constructor:_a,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||r.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(r.cssNumber[c]?"":"px")},cur:function(){var a=_a.propHooks[this.prop];return a&&a.get?a.get(this):_a.propHooks._default.get(this)},run:function(a){var b,c=_a.propHooks[this.prop];return this.options.duration?this.pos=b=r.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):_a.propHooks._default.set(this),this}},_a.prototype.init.prototype=_a.prototype,_a.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=r.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){r.fx.step[a.prop]?r.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[r.cssProps[a.prop]]&&!r.cssHooks[a.prop]?a.elem[a.prop]=a.now:r.style(a.elem,a.prop,a.now+a.unit)}}},_a.propHooks.scrollTop=_a.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},r.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},r.fx=_a.prototype.init,r.fx.step={};var ab,bb,cb=/^(?:toggle|show|hide)$/,db=/queueHooks$/;function eb(){bb&&(d.hidden===!1&&a.requestAnimationFrame?a.requestAnimationFrame(eb):a.setTimeout(eb,r.fx.interval),r.fx.tick())}function fb(){return a.setTimeout(function(){ab=void 0}),ab=r.now()}function gb(a,b){var c,d=0,e={height:a};for(b=b?1:0;d<4;d+=2-b)c=ca[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function hb(a,b,c){for(var d,e=(kb.tweeners[b]||[]).concat(kb.tweeners["*"]),f=0,g=e.length;f<g;f++)if(d=e[f].call(c,b,a))return d}function ib(a,b,c){var d,e,f,g,h,i,j,k,l="width"in b||"height"in b,m=this,n={},o=a.style,p=a.nodeType&&da(a),q=W.get(a,"fxshow");c.queue||(g=r._queueHooks(a,"fx"),null==g.unqueued&&(g.unqueued=0,h=g.empty.fire,g.empty.fire=function(){g.unqueued||h()}),g.unqueued++,m.always(function(){m.always(function(){g.unqueued--,r.queue(a,"fx").length||g.empty.fire()})}));for(d in b)if(e=b[d],cb.test(e)){if(delete b[d],f=f||"toggle"===e,e===(p?"hide":"show")){if("show"!==e||!q||void 0===q[d])continue;p=!0}n[d]=q&&q[d]||r.style(a,d)}if(i=!r.isEmptyObject(b),i||!r.isEmptyObject(n)){l&&1===a.nodeType&&(c.overflow=[o.overflow,o.overflowX,o.overflowY],j=q&&q.display,null==j&&(j=W.get(a,"display")),k=r.css(a,"display"),"none"===k&&(j?k=j:(ia([a],!0),j=a.style.display||j,k=r.css(a,"display"),ia([a]))),("inline"===k||"inline-block"===k&&null!=j)&&"none"===r.css(a,"float")&&(i||(m.done(function(){o.display=j}),null==j&&(k=o.display,j="none"===k?"":k)),o.display="inline-block")),c.overflow&&(o.overflow="hidden",m.always(function(){o.overflow=c.overflow[0],o.overflowX=c.overflow[1],o.overflowY=c.overflow[2]})),i=!1;for(d in n)i||(q?"hidden"in q&&(p=q.hidden):q=W.access(a,"fxshow",{display:j}),f&&(q.hidden=!p),p&&ia([a],!0),m.done(function(){p||ia([a]),W.remove(a,"fxshow");for(d in n)r.style(a,d,n[d])})),i=hb(p?q[d]:0,d,m),d in q||(q[d]=i.start,p&&(i.end=i.start,i.start=0))}}function jb(a,b){var c,d,e,f,g;for(c in a)if(d=r.camelCase(c),e=b[d],f=a[c],Array.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=r.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function kb(a,b,c){var d,e,f=0,g=kb.prefilters.length,h=r.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=ab||fb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;g<i;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),f<1&&i?c:(i||h.notifyWith(a,[j,1,0]),h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:r.extend({},b),opts:r.extend(!0,{specialEasing:{},easing:r.easing._default},c),originalProperties:b,originalOptions:c,startTime:ab||fb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=r.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;c<d;c++)j.tweens[c].run(1);return b?(h.notifyWith(a,[j,1,0]),h.resolveWith(a,[j,b])):h.rejectWith(a,[j,b]),this}}),k=j.props;for(jb(k,j.opts.specialEasing);f<g;f++)if(d=kb.prefilters[f].call(j,a,k,j.opts))return r.isFunction(d.stop)&&(r._queueHooks(j.elem,j.opts.queue).stop=r.proxy(d.stop,d)),d;return r.map(k,hb,j),r.isFunction(j.opts.start)&&j.opts.start.call(a,j),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always),r.fx.timer(r.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j}r.Animation=r.extend(kb,{tweeners:{"*":[function(a,b){var c=this.createTween(a,b);return fa(c.elem,a,ba.exec(b),c),c}]},tweener:function(a,b){r.isFunction(a)?(b=a,a=["*"]):a=a.match(L);for(var c,d=0,e=a.length;d<e;d++)c=a[d],kb.tweeners[c]=kb.tweeners[c]||[],kb.tweeners[c].unshift(b)},prefilters:[ib],prefilter:function(a,b){b?kb.prefilters.unshift(a):kb.prefilters.push(a)}}),r.speed=function(a,b,c){var d=a&&"object"==typeof a?r.extend({},a):{complete:c||!c&&b||r.isFunction(a)&&a,duration:a,easing:c&&b||b&&!r.isFunction(b)&&b};return r.fx.off?d.duration=0:"number"!=typeof d.duration&&(d.duration in r.fx.speeds?d.duration=r.fx.speeds[d.duration]:d.duration=r.fx.speeds._default),null!=d.queue&&d.queue!==!0||(d.queue="fx"),d.old=d.complete,d.complete=function(){r.isFunction(d.old)&&d.old.call(this),d.queue&&r.dequeue(this,d.queue)},d},r.fn.extend({fadeTo:function(a,b,c,d){return this.filter(da).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=r.isEmptyObject(a),f=r.speed(b,c,d),g=function(){var b=kb(this,r.extend({},a),f);(e||W.get(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=r.timers,g=W.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&db.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));!b&&c||r.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=W.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=r.timers,g=d?d.length:0;for(c.finish=!0,r.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;b<g;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),r.each(["toggle","show","hide"],function(a,b){var c=r.fn[b];r.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(gb(b,!0),a,d,e)}}),r.each({slideDown:gb("show"),slideUp:gb("hide"),slideToggle:gb("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){r.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),r.timers=[],r.fx.tick=function(){var a,b=0,c=r.timers;for(ab=r.now();b<c.length;b++)a=c[b],a()||c[b]!==a||c.splice(b--,1);c.length||r.fx.stop(),ab=void 0},r.fx.timer=function(a){r.timers.push(a),r.fx.start()},r.fx.interval=13,r.fx.start=function(){bb||(bb=!0,eb())},r.fx.stop=function(){bb=null},r.fx.speeds={slow:600,fast:200,_default:400},r.fn.delay=function(b,c){return b=r.fx?r.fx.speeds[b]||b:b,c=c||"fx",this.queue(c,function(c,d){var e=a.setTimeout(c,b);d.stop=function(){a.clearTimeout(e)}})},function(){var a=d.createElement("input"),b=d.createElement("select"),c=b.appendChild(d.createElement("option"));a.type="checkbox",o.checkOn=""!==a.value,o.optSelected=c.selected,a=d.createElement("input"),a.value="t",a.type="radio",o.radioValue="t"===a.value}();var lb,mb=r.expr.attrHandle;r.fn.extend({attr:function(a,b){return T(this,r.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){r.removeAttr(this,a)})}}),r.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?r.prop(a,b,c):(1===f&&r.isXMLDoc(a)||(e=r.attrHooks[b.toLowerCase()]||(r.expr.match.bool.test(b)?lb:void 0)),void 0!==c?null===c?void r.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=r.find.attr(a,b),
  5. null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!o.radioValue&&"radio"===b&&B(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d=0,e=b&&b.match(L);if(e&&1===a.nodeType)while(c=e[d++])a.removeAttribute(c)}}),lb={set:function(a,b,c){return b===!1?r.removeAttr(a,c):a.setAttribute(c,c),c}},r.each(r.expr.match.bool.source.match(/\w+/g),function(a,b){var c=mb[b]||r.find.attr;mb[b]=function(a,b,d){var e,f,g=b.toLowerCase();return d||(f=mb[g],mb[g]=e,e=null!=c(a,b,d)?g:null,mb[g]=f),e}});var nb=/^(?:input|select|textarea|button)$/i,ob=/^(?:a|area)$/i;r.fn.extend({prop:function(a,b){return T(this,r.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[r.propFix[a]||a]})}}),r.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&r.isXMLDoc(a)||(b=r.propFix[b]||b,e=r.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=r.find.attr(a,"tabindex");return b?parseInt(b,10):nb.test(a.nodeName)||ob.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),o.optSelected||(r.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),r.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){r.propFix[this.toLowerCase()]=this});function pb(a){var b=a.match(L)||[];return b.join(" ")}function qb(a){return a.getAttribute&&a.getAttribute("class")||""}r.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).addClass(a.call(this,b,qb(this)))});if("string"==typeof a&&a){b=a.match(L)||[];while(c=this[i++])if(e=qb(c),d=1===c.nodeType&&" "+pb(e)+" "){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=pb(d),e!==h&&c.setAttribute("class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).removeClass(a.call(this,b,qb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(L)||[];while(c=this[i++])if(e=qb(c),d=1===c.nodeType&&" "+pb(e)+" "){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=pb(d),e!==h&&c.setAttribute("class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):r.isFunction(a)?this.each(function(c){r(this).toggleClass(a.call(this,c,qb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=r(this),f=a.match(L)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=qb(this),b&&W.set(this,"__className__",b),this.setAttribute&&this.setAttribute("class",b||a===!1?"":W.get(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+pb(qb(c))+" ").indexOf(b)>-1)return!0;return!1}});var rb=/\r/g;r.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=r.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,r(this).val()):a,null==e?e="":"number"==typeof e?e+="":Array.isArray(e)&&(e=r.map(e,function(a){return null==a?"":a+""})),b=r.valHooks[this.type]||r.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=r.valHooks[e.type]||r.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(rb,""):null==c?"":c)}}}),r.extend({valHooks:{option:{get:function(a){var b=r.find.attr(a,"value");return null!=b?b:pb(r.text(a))}},select:{get:function(a){var b,c,d,e=a.options,f=a.selectedIndex,g="select-one"===a.type,h=g?null:[],i=g?f+1:e.length;for(d=f<0?i:g?f:0;d<i;d++)if(c=e[d],(c.selected||d===f)&&!c.disabled&&(!c.parentNode.disabled||!B(c.parentNode,"optgroup"))){if(b=r(c).val(),g)return b;h.push(b)}return h},set:function(a,b){var c,d,e=a.options,f=r.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=r.inArray(r.valHooks.option.get(d),f)>-1)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),r.each(["radio","checkbox"],function(){r.valHooks[this]={set:function(a,b){if(Array.isArray(b))return a.checked=r.inArray(r(a).val(),b)>-1}},o.checkOn||(r.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var sb=/^(?:focusinfocus|focusoutblur)$/;r.extend(r.event,{trigger:function(b,c,e,f){var g,h,i,j,k,m,n,o=[e||d],p=l.call(b,"type")?b.type:b,q=l.call(b,"namespace")?b.namespace.split("."):[];if(h=i=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!sb.test(p+r.event.triggered)&&(p.indexOf(".")>-1&&(q=p.split("."),p=q.shift(),q.sort()),k=p.indexOf(":")<0&&"on"+p,b=b[r.expando]?b:new r.Event(p,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=q.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:r.makeArray(c,[b]),n=r.event.special[p]||{},f||!n.trigger||n.trigger.apply(e,c)!==!1)){if(!f&&!n.noBubble&&!r.isWindow(e)){for(j=n.delegateType||p,sb.test(j+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),i=h;i===(e.ownerDocument||d)&&o.push(i.defaultView||i.parentWindow||a)}g=0;while((h=o[g++])&&!b.isPropagationStopped())b.type=g>1?j:n.bindType||p,m=(W.get(h,"events")||{})[b.type]&&W.get(h,"handle"),m&&m.apply(h,c),m=k&&h[k],m&&m.apply&&U(h)&&(b.result=m.apply(h,c),b.result===!1&&b.preventDefault());return b.type=p,f||b.isDefaultPrevented()||n._default&&n._default.apply(o.pop(),c)!==!1||!U(e)||k&&r.isFunction(e[p])&&!r.isWindow(e)&&(i=e[k],i&&(e[k]=null),r.event.triggered=p,e[p](),r.event.triggered=void 0,i&&(e[k]=i)),b.result}},simulate:function(a,b,c){var d=r.extend(new r.Event,c,{type:a,isSimulated:!0});r.event.trigger(d,null,b)}}),r.fn.extend({trigger:function(a,b){return this.each(function(){r.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];if(c)return r.event.trigger(a,b,c,!0)}}),r.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(a,b){r.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),r.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),o.focusin="onfocusin"in a,o.focusin||r.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){r.event.simulate(b,a.target,r.event.fix(a))};r.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=W.access(d,b);e||d.addEventListener(a,c,!0),W.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=W.access(d,b)-1;e?W.access(d,b,e):(d.removeEventListener(a,c,!0),W.remove(d,b))}}});var tb=a.location,ub=r.now(),vb=/\?/;r.parseXML=function(b){var c;if(!b||"string"!=typeof b)return null;try{c=(new a.DOMParser).parseFromString(b,"text/xml")}catch(d){c=void 0}return c&&!c.getElementsByTagName("parsererror").length||r.error("Invalid XML: "+b),c};var wb=/\[\]$/,xb=/\r?\n/g,yb=/^(?:submit|button|image|reset|file)$/i,zb=/^(?:input|select|textarea|keygen)/i;function Ab(a,b,c,d){var e;if(Array.isArray(b))r.each(b,function(b,e){c||wb.test(a)?d(a,e):Ab(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==r.type(b))d(a,b);else for(e in b)Ab(a+"["+e+"]",b[e],c,d)}r.param=function(a,b){var c,d=[],e=function(a,b){var c=r.isFunction(b)?b():b;d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(null==c?"":c)};if(Array.isArray(a)||a.jquery&&!r.isPlainObject(a))r.each(a,function(){e(this.name,this.value)});else for(c in a)Ab(c,a[c],b,e);return d.join("&")},r.fn.extend({serialize:function(){return r.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=r.prop(this,"elements");return a?r.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!r(this).is(":disabled")&&zb.test(this.nodeName)&&!yb.test(a)&&(this.checked||!ja.test(a))}).map(function(a,b){var c=r(this).val();return null==c?null:Array.isArray(c)?r.map(c,function(a){return{name:b.name,value:a.replace(xb,"\r\n")}}):{name:b.name,value:c.replace(xb,"\r\n")}}).get()}});var Bb=/%20/g,Cb=/#.*$/,Db=/([?&])_=[^&]*/,Eb=/^(.*?):[ \t]*([^\r\n]*)$/gm,Fb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Gb=/^(?:GET|HEAD)$/,Hb=/^\/\//,Ib={},Jb={},Kb="*/".concat("*"),Lb=d.createElement("a");Lb.href=tb.href;function Mb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(L)||[];if(r.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Nb(a,b,c,d){var e={},f=a===Jb;function g(h){var i;return e[h]=!0,r.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Ob(a,b){var c,d,e=r.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&r.extend(!0,a,d),a}function Pb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}if(f)return f!==i[0]&&i.unshift(f),c[f]}function Qb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}r.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:tb.href,type:"GET",isLocal:Fb.test(tb.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Kb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":r.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Ob(Ob(a,r.ajaxSettings),b):Ob(r.ajaxSettings,a)},ajaxPrefilter:Mb(Ib),ajaxTransport:Mb(Jb),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var e,f,g,h,i,j,k,l,m,n,o=r.ajaxSetup({},c),p=o.context||o,q=o.context&&(p.nodeType||p.jquery)?r(p):r.event,s=r.Deferred(),t=r.Callbacks("once memory"),u=o.statusCode||{},v={},w={},x="canceled",y={readyState:0,getResponseHeader:function(a){var b;if(k){if(!h){h={};while(b=Eb.exec(g))h[b[1].toLowerCase()]=b[2]}b=h[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return k?g:null},setRequestHeader:function(a,b){return null==k&&(a=w[a.toLowerCase()]=w[a.toLowerCase()]||a,v[a]=b),this},overrideMimeType:function(a){return null==k&&(o.mimeType=a),this},statusCode:function(a){var b;if(a)if(k)y.always(a[y.status]);else for(b in a)u[b]=[u[b],a[b]];return this},abort:function(a){var b=a||x;return e&&e.abort(b),A(0,b),this}};if(s.promise(y),o.url=((b||o.url||tb.href)+"").replace(Hb,tb.protocol+"//"),o.type=c.method||c.type||o.method||o.type,o.dataTypes=(o.dataType||"*").toLowerCase().match(L)||[""],null==o.crossDomain){j=d.createElement("a");try{j.href=o.url,j.href=j.href,o.crossDomain=Lb.protocol+"//"+Lb.host!=j.protocol+"//"+j.host}catch(z){o.crossDomain=!0}}if(o.data&&o.processData&&"string"!=typeof o.data&&(o.data=r.param(o.data,o.traditional)),Nb(Ib,o,c,y),k)return y;l=r.event&&o.global,l&&0===r.active++&&r.event.trigger("ajaxStart"),o.type=o.type.toUpperCase(),o.hasContent=!Gb.test(o.type),f=o.url.replace(Cb,""),o.hasContent?o.data&&o.processData&&0===(o.contentType||"").indexOf("application/x-www-form-urlencoded")&&(o.data=o.data.replace(Bb,"+")):(n=o.url.slice(f.length),o.data&&(f+=(vb.test(f)?"&":"?")+o.data,delete o.data),o.cache===!1&&(f=f.replace(Db,"$1"),n=(vb.test(f)?"&":"?")+"_="+ub++ +n),o.url=f+n),o.ifModified&&(r.lastModified[f]&&y.setRequestHeader("If-Modified-Since",r.lastModified[f]),r.etag[f]&&y.setRequestHeader("If-None-Match",r.etag[f])),(o.data&&o.hasContent&&o.contentType!==!1||c.contentType)&&y.setRequestHeader("Content-Type",o.contentType),y.setRequestHeader("Accept",o.dataTypes[0]&&o.accepts[o.dataTypes[0]]?o.accepts[o.dataTypes[0]]+("*"!==o.dataTypes[0]?", "+Kb+"; q=0.01":""):o.accepts["*"]);for(m in o.headers)y.setRequestHeader(m,o.headers[m]);if(o.beforeSend&&(o.beforeSend.call(p,y,o)===!1||k))return y.abort();if(x="abort",t.add(o.complete),y.done(o.success),y.fail(o.error),e=Nb(Jb,o,c,y)){if(y.readyState=1,l&&q.trigger("ajaxSend",[y,o]),k)return y;o.async&&o.timeout>0&&(i=a.setTimeout(function(){y.abort("timeout")},o.timeout));try{k=!1,e.send(v,A)}catch(z){if(k)throw z;A(-1,z)}}else A(-1,"No Transport");function A(b,c,d,h){var j,m,n,v,w,x=c;k||(k=!0,i&&a.clearTimeout(i),e=void 0,g=h||"",y.readyState=b>0?4:0,j=b>=200&&b<300||304===b,d&&(v=Pb(o,y,d)),v=Qb(o,v,y,j),j?(o.ifModified&&(w=y.getResponseHeader("Last-Modified"),w&&(r.lastModified[f]=w),w=y.getResponseHeader("etag"),w&&(r.etag[f]=w)),204===b||"HEAD"===o.type?x="nocontent":304===b?x="notmodified":(x=v.state,m=v.data,n=v.error,j=!n)):(n=x,!b&&x||(x="error",b<0&&(b=0))),y.status=b,y.statusText=(c||x)+"",j?s.resolveWith(p,[m,x,y]):s.rejectWith(p,[y,x,n]),y.statusCode(u),u=void 0,l&&q.trigger(j?"ajaxSuccess":"ajaxError",[y,o,j?m:n]),t.fireWith(p,[y,x]),l&&(q.trigger("ajaxComplete",[y,o]),--r.active||r.event.trigger("ajaxStop")))}return y},getJSON:function(a,b,c){return r.get(a,b,c,"json")},getScript:function(a,b){return r.get(a,void 0,b,"script")}}),r.each(["get","post"],function(a,b){r[b]=function(a,c,d,e){return r.isFunction(c)&&(e=e||d,d=c,c=void 0),r.ajax(r.extend({url:a,type:b,dataType:e,data:c,success:d},r.isPlainObject(a)&&a))}}),r._evalUrl=function(a){return r.ajax({url:a,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},r.fn.extend({wrapAll:function(a){var b;return this[0]&&(r.isFunction(a)&&(a=a.call(this[0])),b=r(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this},wrapInner:function(a){return r.isFunction(a)?this.each(function(b){r(this).wrapInner(a.call(this,b))}):this.each(function(){var b=r(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=r.isFunction(a);return this.each(function(c){r(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(a){return this.parent(a).not("body").each(function(){r(this).replaceWith(this.childNodes)}),this}}),r.expr.pseudos.hidden=function(a){return!r.expr.pseudos.visible(a)},r.expr.pseudos.visible=function(a){return!!(a.offsetWidth||a.offsetHeight||a.getClientRects().length)},r.ajaxSettings.xhr=function(){try{return new a.XMLHttpRequest}catch(b){}};var Rb={0:200,1223:204},Sb=r.ajaxSettings.xhr();o.cors=!!Sb&&"withCredentials"in Sb,o.ajax=Sb=!!Sb,r.ajaxTransport(function(b){var c,d;if(o.cors||Sb&&!b.crossDomain)return{send:function(e,f){var g,h=b.xhr();if(h.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(g in b.xhrFields)h[g]=b.xhrFields[g];b.mimeType&&h.overrideMimeType&&h.overrideMimeType(b.mimeType),b.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest");for(g in e)h.setRequestHeader(g,e[g]);c=function(a){return function(){c&&(c=d=h.onload=h.onerror=h.onabort=h.onreadystatechange=null,"abort"===a?h.abort():"error"===a?"number"!=typeof h.status?f(0,"error"):f(h.status,h.statusText):f(Rb[h.status]||h.status,h.statusText,"text"!==(h.responseType||"text")||"string"!=typeof h.responseText?{binary:h.response}:{text:h.responseText},h.getAllResponseHeaders()))}},h.onload=c(),d=h.onerror=c("error"),void 0!==h.onabort?h.onabort=d:h.onreadystatechange=function(){4===h.readyState&&a.setTimeout(function(){c&&d()})},c=c("abort");try{h.send(b.hasContent&&b.data||null)}catch(i){if(c)throw i}},abort:function(){c&&c()}}}),r.ajaxPrefilter(function(a){a.crossDomain&&(a.contents.script=!1)}),r.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return r.globalEval(a),a}}}),r.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),r.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(e,f){b=r("<script>").prop({charset:a.scriptCharset,src:a.url}).on("load error",c=function(a){b.remove(),c=null,a&&f("error"===a.type?404:200,a.type)}),d.head.appendChild(b[0])},abort:function(){c&&c()}}}});var Tb=[],Ub=/(=)\?(?=&|$)|\?\?/;r.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Tb.pop()||r.expando+"_"+ub++;return this[a]=!0,a}}),r.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(Ub.test(b.url)?"url":"string"==typeof b.data&&0===(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ub.test(b.data)&&"data");if(h||"jsonp"===b.dataTypes[0])return e=b.jsonpCallback=r.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(Ub,"$1"+e):b.jsonp!==!1&&(b.url+=(vb.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||r.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){void 0===f?r(a).removeProp(e):a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,Tb.push(e)),g&&r.isFunction(f)&&f(g[0]),g=f=void 0}),"script"}),o.createHTMLDocument=function(){var a=d.implementation.createHTMLDocument("").body;return a.innerHTML="<form></form><form></form>",2===a.childNodes.length}(),r.parseHTML=function(a,b,c){if("string"!=typeof a)return[];"boolean"==typeof b&&(c=b,b=!1);var e,f,g;return b||(o.createHTMLDocument?(b=d.implementation.createHTMLDocument(""),e=b.createElement("base"),e.href=d.location.href,b.head.appendChild(e)):b=d),f=C.exec(a),g=!c&&[],f?[b.createElement(f[1])]:(f=qa([a],b,g),g&&g.length&&r(g).remove(),r.merge([],f.childNodes))},r.fn.load=function(a,b,c){var d,e,f,g=this,h=a.indexOf(" ");return h>-1&&(d=pb(a.slice(h)),a=a.slice(0,h)),r.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&r.ajax({url:a,type:e||"GET",dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?r("<div>").append(r.parseHTML(a)).find(d):a)}).always(c&&function(a,b){g.each(function(){c.apply(this,f||[a.responseText,b,a])})}),this},r.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){r.fn[b]=function(a){return this.on(b,a)}}),r.expr.pseudos.animated=function(a){return r.grep(r.timers,function(b){return a===b.elem}).length},r.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=r.css(a,"position"),l=r(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=r.css(a,"top"),i=r.css(a,"left"),j=("absolute"===k||"fixed"===k)&&(f+i).indexOf("auto")>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),r.isFunction(b)&&(b=b.call(a,c,r.extend({},h))),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},r.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){r.offset.setOffset(this,a,b)});var b,c,d,e,f=this[0];if(f)return f.getClientRects().length?(d=f.getBoundingClientRect(),b=f.ownerDocument,c=b.documentElement,e=b.defaultView,{top:d.top+e.pageYOffset-c.clientTop,left:d.left+e.pageXOffset-c.clientLeft}):{top:0,left:0}},position:function(){if(this[0]){var a,b,c=this[0],d={top:0,left:0};return"fixed"===r.css(c,"position")?b=c.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),B(a[0],"html")||(d=a.offset()),d={top:d.top+r.css(a[0],"borderTopWidth",!0),left:d.left+r.css(a[0],"borderLeftWidth",!0)}),{top:b.top-d.top-r.css(c,"marginTop",!0),left:b.left-d.left-r.css(c,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent;while(a&&"static"===r.css(a,"position"))a=a.offsetParent;return a||ra})}}),r.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c="pageYOffset"===b;r.fn[a]=function(d){return T(this,function(a,d,e){var f;return r.isWindow(a)?f=a:9===a.nodeType&&(f=a.defaultView),void 0===e?f?f[b]:a[d]:void(f?f.scrollTo(c?f.pageXOffset:e,c?e:f.pageYOffset):a[d]=e)},a,d,arguments.length)}}),r.each(["top","left"],function(a,b){r.cssHooks[b]=Pa(o.pixelPosition,function(a,c){if(c)return c=Oa(a,b),Ma.test(c)?r(a).position()[b]+"px":c})}),r.each({Height:"height",Width:"width"},function(a,b){r.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){r.fn[d]=function(e,f){var g=arguments.length&&(c||"boolean"!=typeof e),h=c||(e===!0||f===!0?"margin":"border");return T(this,function(b,c,e){var f;return r.isWindow(b)?0===d.indexOf("outer")?b["inner"+a]:b.document.documentElement["client"+a]:9===b.nodeType?(f=b.documentElement,Math.max(b.body["scroll"+a],f["scroll"+a],b.body["offset"+a],f["offset"+a],f["client"+a])):void 0===e?r.css(b,c,h):r.style(b,c,e,h)},b,g?e:void 0,g)}})}),r.fn.extend({bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}}),r.holdReady=function(a){a?r.readyWait++:r.ready(!0)},r.isArray=Array.isArray,r.parseJSON=JSON.parse,r.nodeName=B,"function"==typeof define&&define.amd&&define("jquery",[],function(){return r});var Vb=a.jQuery,Wb=a.$;return r.noConflict=function(b){return a.$===r&&(a.$=Wb),b&&a.jQuery===r&&(a.jQuery=Vb),r},b||(a.jQuery=a.$=r),r});
  6.  
  7. /* es6-promise.min.js */
  8.  
  9. !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.ES6Promise=e()}(this,function(){"use strict";function t(t){return"function"==typeof t||"object"==typeof t&&null!==t}function e(t){return"function"==typeof t}function n(t){I=t}function r(t){J=t}function o(){return function(){return process.nextTick(a)}}function i(){return"undefined"!=typeof H?function(){H(a)}:c()}function s(){var t=0,e=new V(a),n=document.createTextNode("");return e.observe(n,{characterData:!0}),function(){n.data=t=++t%2}}function u(){var t=new MessageChannel;return t.port1.onmessage=a,function(){return t.port2.postMessage(0)}}function c(){var t=setTimeout;return function(){return t(a,1)}}function a(){for(var t=0;t<G;t+=2){var e=$[t],n=$[t+1];e(n),$[t]=void 0,$[t+1]=void 0}G=0}function f(){try{var t=require,e=t("vertx");return H=e.runOnLoop||e.runOnContext,i()}catch(n){return c()}}function l(t,e){var n=arguments,r=this,o=new this.constructor(p);void 0===o[et]&&k(o);var i=r._state;return i?!function(){var t=n[i-1];J(function(){return x(i,o,t,r._result)})}():E(r,o,t,e),o}function h(t){var e=this;if(t&&"object"==typeof t&&t.constructor===e)return t;var n=new e(p);return g(n,t),n}function p(){}function v(){return new TypeError("You cannot resolve a promise with itself")}function d(){return new TypeError("A promises callback cannot return that same promise.")}function _(t){try{return t.then}catch(e){return it.error=e,it}}function y(t,e,n,r){try{t.call(e,n,r)}catch(o){return o}}function m(t,e,n){J(function(t){var r=!1,o=y(n,e,function(n){r||(r=!0,e!==n?g(t,n):S(t,n))},function(e){r||(r=!0,j(t,e))},"Settle: "+(t._label||" unknown promise"));!r&&o&&(r=!0,j(t,o))},t)}function b(t,e){e._state===rt?S(t,e._result):e._state===ot?j(t,e._result):E(e,void 0,function(e){return g(t,e)},function(e){return j(t,e)})}function w(t,n,r){n.constructor===t.constructor&&r===l&&n.constructor.resolve===h?b(t,n):r===it?(j(t,it.error),it.error=null):void 0===r?S(t,n):e(r)?m(t,n,r):S(t,n)}function g(e,n){e===n?j(e,v()):t(n)?w(e,n,_(n)):S(e,n)}function A(t){t._onerror&&t._onerror(t._result),T(t)}function S(t,e){t._state===nt&&(t._result=e,t._state=rt,0!==t._subscribers.length&&J(T,t))}function j(t,e){t._state===nt&&(t._state=ot,t._result=e,J(A,t))}function E(t,e,n,r){var o=t._subscribers,i=o.length;t._onerror=null,o[i]=e,o[i+rt]=n,o[i+ot]=r,0===i&&t._state&&J(T,t)}function T(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var r=void 0,o=void 0,i=t._result,s=0;s<e.length;s+=3)r=e[s],o=e[s+n],r?x(n,r,o,i):o(i);t._subscribers.length=0}}function M(){this.error=null}function P(t,e){try{return t(e)}catch(n){return st.error=n,st}}function x(t,n,r,o){var i=e(r),s=void 0,u=void 0,c=void 0,a=void 0;if(i){if(s=P(r,o),s===st?(a=!0,u=s.error,s.error=null):c=!0,n===s)return void j(n,d())}else s=o,c=!0;n._state!==nt||(i&&c?g(n,s):a?j(n,u):t===rt?S(n,s):t===ot&&j(n,s))}function C(t,e){try{e(function(e){g(t,e)},function(e){j(t,e)})}catch(n){j(t,n)}}function O(){return ut++}function k(t){t[et]=ut++,t._state=void 0,t._result=void 0,t._subscribers=[]}function Y(t,e){this._instanceConstructor=t,this.promise=new t(p),this.promise[et]||k(this.promise),B(e)?(this._input=e,this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?S(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&S(this.promise,this._result))):j(this.promise,q())}function q(){return new Error("Array Methods must be provided an Array")}function F(t){return new Y(this,t).promise}function D(t){var e=this;return new e(B(t)?function(n,r){for(var o=t.length,i=0;i<o;i++)e.resolve(t[i]).then(n,r)}:function(t,e){return e(new TypeError("You must pass an array to race."))})}function K(t){var e=this,n=new e(p);return j(n,t),n}function L(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function N(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function U(t){this[et]=O(),this._result=this._state=void 0,this._subscribers=[],p!==t&&("function"!=typeof t&&L(),this instanceof U?C(this,t):N())}function W(){var t=void 0;if("undefined"!=typeof global)t=global;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var n=t.Promise;if(n){var r=null;try{r=Object.prototype.toString.call(n.resolve())}catch(e){}if("[object Promise]"===r&&!n.cast)return}t.Promise=U}var z=void 0;z=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};var B=z,G=0,H=void 0,I=void 0,J=function(t,e){$[G]=t,$[G+1]=e,G+=2,2===G&&(I?I(a):tt())},Q="undefined"!=typeof window?window:void 0,R=Q||{},V=R.MutationObserver||R.WebKitMutationObserver,X="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),Z="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,$=new Array(1e3),tt=void 0;tt=X?o():V?s():Z?u():void 0===Q&&"function"==typeof require?f():c();var et=Math.random().toString(36).substring(16),nt=void 0,rt=1,ot=2,it=new M,st=new M,ut=0;return Y.prototype._enumerate=function(){for(var t=this.length,e=this._input,n=0;this._state===nt&&n<t;n++)this._eachEntry(e[n],n)},Y.prototype._eachEntry=function(t,e){var n=this._instanceConstructor,r=n.resolve;if(r===h){var o=_(t);if(o===l&&t._state!==nt)this._settledAt(t._state,e,t._result);else if("function"!=typeof o)this._remaining--,this._result[e]=t;else if(n===U){var i=new n(p);w(i,t,o),this._willSettleAt(i,e)}else this._willSettleAt(new n(function(e){return e(t)}),e)}else this._willSettleAt(r(t),e)},Y.prototype._settledAt=function(t,e,n){var r=this.promise;r._state===nt&&(this._remaining--,t===ot?j(r,n):this._result[e]=n),0===this._remaining&&S(r,this._result)},Y.prototype._willSettleAt=function(t,e){var n=this;E(t,void 0,function(t){return n._settledAt(rt,e,t)},function(t){return n._settledAt(ot,e,t)})},U.all=F,U.race=D,U.resolve=h,U.reject=K,U._setScheduler=n,U._setAsap=r,U._asap=J,U.prototype={constructor:U,then:l,"catch":function(t){return this.then(null,t)}},U.polyfill=W,U.Promise=U,U});
  10.  
  11. /* fetch */
  12.  
  13. (function(self) {
  14.   'use strict';
  15.  
  16.   if (self.fetch) {
  17.     return
  18.   }
  19.  
  20.   var support = {
  21.     searchParams: 'URLSearchParams' in self,
  22.     iterable: 'Symbol' in self && 'iterator' in Symbol,
  23.     blob: 'FileReader' in self && 'Blob' in self && (function() {
  24.       try {
  25.         new Blob()
  26.         return true
  27.       } catch(e) {
  28.         return false
  29.       }
  30.     })(),
  31.     formData: 'FormData' in self,
  32.     arrayBuffer: 'ArrayBuffer' in self
  33.   }
  34.  
  35.   if (support.arrayBuffer) {
  36.     var viewClasses = [
  37.       '[object Int8Array]',
  38.       '[object Uint8Array]',
  39.       '[object Uint8ClampedArray]',
  40.       '[object Int16Array]',
  41.       '[object Uint16Array]',
  42.       '[object Int32Array]',
  43.       '[object Uint32Array]',
  44.       '[object Float32Array]',
  45.       '[object Float64Array]'
  46.     ]
  47.  
  48.     var isDataView = function(obj) {
  49.       return obj && DataView.prototype.isPrototypeOf(obj)
  50.     }
  51.  
  52.     var isArrayBufferView = ArrayBuffer.isView || function(obj) {
  53.       return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1
  54.     }
  55.   }
  56.  
  57.   function normalizeName(name) {
  58.     if (typeof name !== 'string') {
  59.       name = String(name)
  60.     }
  61.     if (/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(name)) {
  62.       throw new TypeError('Invalid character in header field name')
  63.     }
  64.     return name.toLowerCase()
  65.   }
  66.  
  67.   function normalizeValue(value) {
  68.     if (typeof value !== 'string') {
  69.       value = String(value)
  70.     }
  71.     return value
  72.   }
  73.  
  74.   // Build a destructive iterator for the value list
  75.   function iteratorFor(items) {
  76.     var iterator = {
  77.       next: function() {
  78.         var value = items.shift()
  79.         return {done: value === undefined, value: value}
  80.       }
  81.     }
  82.  
  83.     if (support.iterable) {
  84.       iterator[Symbol.iterator] = function() {
  85.         return iterator
  86.       }
  87.     }
  88.  
  89.     return iterator
  90.   }
  91.  
  92.   function Headers(headers) {
  93.     this.map = {}
  94.  
  95.     if (headers instanceof Headers) {
  96.       headers.forEach(function(value, name) {
  97.         this.append(name, value)
  98.       }, this)
  99.     } else if (Array.isArray(headers)) {
  100.       headers.forEach(function(header) {
  101.         this.append(header[0], header[1])
  102.       }, this)
  103.     } else if (headers) {
  104.       Object.getOwnPropertyNames(headers).forEach(function(name) {
  105.         this.append(name, headers[name])
  106.       }, this)
  107.     }
  108.   }
  109.  
  110.   Headers.prototype.append = function(name, value) {
  111.     name = normalizeName(name)
  112.     value = normalizeValue(value)
  113.     var oldValue = this.map[name]
  114.     this.map[name] = oldValue ? oldValue+','+value : value
  115.   }
  116.  
  117.   Headers.prototype['delete'] = function(name) {
  118.     delete this.map[normalizeName(name)]
  119.   }
  120.  
  121.   Headers.prototype.get = function(name) {
  122.     name = normalizeName(name)
  123.     return this.has(name) ? this.map[name] : null
  124.   }
  125.  
  126.   Headers.prototype.has = function(name) {
  127.     return this.map.hasOwnProperty(normalizeName(name))
  128.   }
  129.  
  130.   Headers.prototype.set = function(name, value) {
  131.     this.map[normalizeName(name)] = normalizeValue(value)
  132.   }
  133.  
  134.   Headers.prototype.forEach = function(callback, thisArg) {
  135.     for (var name in this.map) {
  136.       if (this.map.hasOwnProperty(name)) {
  137.         callback.call(thisArg, this.map[name], name, this)
  138.       }
  139.     }
  140.   }
  141.  
  142.   Headers.prototype.keys = function() {
  143.     var items = []
  144.     this.forEach(function(value, name) { items.push(name) })
  145.     return iteratorFor(items)
  146.   }
  147.  
  148.   Headers.prototype.values = function() {
  149.     var items = []
  150.     this.forEach(function(value) { items.push(value) })
  151.     return iteratorFor(items)
  152.   }
  153.  
  154.   Headers.prototype.entries = function() {
  155.     var items = []
  156.     this.forEach(function(value, name) { items.push([name, value]) })
  157.     return iteratorFor(items)
  158.   }
  159.  
  160.   if (support.iterable) {
  161.     Headers.prototype[Symbol.iterator] = Headers.prototype.entries
  162.   }
  163.  
  164.   function consumed(body) {
  165.     if (body.bodyUsed) {
  166.       return Promise.reject(new TypeError('Already read'))
  167.     }
  168.     body.bodyUsed = true
  169.   }
  170.  
  171.   function fileReaderReady(reader) {
  172.     return new Promise(function(resolve, reject) {
  173.       reader.onload = function() {
  174.         resolve(reader.result)
  175.       }
  176.       reader.onerror = function() {
  177.         reject(reader.error)
  178.       }
  179.     })
  180.   }
  181.  
  182.   function readBlobAsArrayBuffer(blob) {
  183.     var reader = new FileReader()
  184.     var promise = fileReaderReady(reader)
  185.     reader.readAsArrayBuffer(blob)
  186.     return promise
  187.   }
  188.  
  189.   function readBlobAsText(blob) {
  190.     var reader = new FileReader()
  191.     var promise = fileReaderReady(reader)
  192.     reader.readAsText(blob)
  193.     return promise
  194.   }
  195.  
  196.   function readArrayBufferAsText(buf) {
  197.     var view = new Uint8Array(buf)
  198.     var chars = new Array(view.length)
  199.  
  200.     for (var i = 0; i < view.length; i++) {
  201.       chars[i] = String.fromCharCode(view[i])
  202.     }
  203.     return chars.join('')
  204.   }
  205.  
  206.   function bufferClone(buf) {
  207.     if (buf.slice) {
  208.       return buf.slice(0)
  209.     } else {
  210.       var view = new Uint8Array(buf.byteLength)
  211.       view.set(new Uint8Array(buf))
  212.       return view.buffer
  213.     }
  214.   }
  215.  
  216.   function Body() {
  217.     this.bodyUsed = false
  218.  
  219.     this._initBody = function(body) {
  220.       this._bodyInit = body
  221.       if (!body) {
  222.         this._bodyText = ''
  223.       } else if (typeof body === 'string') {
  224.         this._bodyText = body
  225.       } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {
  226.         this._bodyBlob = body
  227.       } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {
  228.         this._bodyFormData = body
  229.       } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
  230.         this._bodyText = body.toString()
  231.       } else if (support.arrayBuffer && support.blob && isDataView(body)) {
  232.         this._bodyArrayBuffer = bufferClone(body.buffer)
  233.         // IE 10-11 can't handle a DataView body.
  234.         this._bodyInit = new Blob([this._bodyArrayBuffer])
  235.       } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {
  236.         this._bodyArrayBuffer = bufferClone(body)
  237.       } else {
  238.         throw new Error('unsupported BodyInit type')
  239.       }
  240.  
  241.       if (!this.headers.get('content-type')) {
  242.         if (typeof body === 'string') {
  243.           this.headers.set('content-type', 'text/plain;charset=UTF-8')
  244.         } else if (this._bodyBlob && this._bodyBlob.type) {
  245.           this.headers.set('content-type', this._bodyBlob.type)
  246.         } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
  247.           this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8')
  248.         }
  249.       }
  250.     }
  251.  
  252.     if (support.blob) {
  253.       this.blob = function() {
  254.         var rejected = consumed(this)
  255.         if (rejected) {
  256.           return rejected
  257.         }
  258.  
  259.         if (this._bodyBlob) {
  260.           return Promise.resolve(this._bodyBlob)
  261.         } else if (this._bodyArrayBuffer) {
  262.           return Promise.resolve(new Blob([this._bodyArrayBuffer]))
  263.         } else if (this._bodyFormData) {
  264.           throw new Error('could not read FormData body as blob')
  265.         } else {
  266.           return Promise.resolve(new Blob([this._bodyText]))
  267.         }
  268.       }
  269.  
  270.       this.arrayBuffer = function() {
  271.         if (this._bodyArrayBuffer) {
  272.           return consumed(this) || Promise.resolve(this._bodyArrayBuffer)
  273.         } else {
  274.           return this.blob().then(readBlobAsArrayBuffer)
  275.         }
  276.       }
  277.     }
  278.  
  279.     this.text = function() {
  280.       var rejected = consumed(this)
  281.       if (rejected) {
  282.         return rejected
  283.       }
  284.  
  285.       if (this._bodyBlob) {
  286.         return readBlobAsText(this._bodyBlob)
  287.       } else if (this._bodyArrayBuffer) {
  288.         return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))
  289.       } else if (this._bodyFormData) {
  290.         throw new Error('could not read FormData body as text')
  291.       } else {
  292.         return Promise.resolve(this._bodyText)
  293.       }
  294.     }
  295.  
  296.     if (support.formData) {
  297.       this.formData = function() {
  298.         return this.text().then(decode)
  299.       }
  300.     }
  301.  
  302.     this.json = function() {
  303.       return this.text().then(JSON.parse)
  304.     }
  305.  
  306.     return this
  307.   }
  308.  
  309.   // HTTP methods whose capitalization should be normalized
  310.   var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']
  311.  
  312.   function normalizeMethod(method) {
  313.     var upcased = method.toUpperCase()
  314.     return (methods.indexOf(upcased) > -1) ? upcased : method
  315.   }
  316.  
  317.   function Request(input, options) {
  318.     options = options || {}
  319.     var body = options.body
  320.  
  321.     if (input instanceof Request) {
  322.       if (input.bodyUsed) {
  323.         throw new TypeError('Already read')
  324.       }
  325.       this.url = input.url
  326.       this.credentials = input.credentials
  327.       if (!options.headers) {
  328.         this.headers = new Headers(input.headers)
  329.       }
  330.       this.method = input.method
  331.       this.mode = input.mode
  332.       if (!body && input._bodyInit != null) {
  333.         body = input._bodyInit
  334.         input.bodyUsed = true
  335.       }
  336.     } else {
  337.       this.url = String(input)
  338.     }
  339.  
  340.     this.credentials = options.credentials || this.credentials || 'omit'
  341.     if (options.headers || !this.headers) {
  342.       this.headers = new Headers(options.headers)
  343.     }
  344.     this.method = normalizeMethod(options.method || this.method || 'GET')
  345.     this.mode = options.mode || this.mode || null
  346.     this.referrer = null
  347.  
  348.     if ((this.method === 'GET' || this.method === 'HEAD') && body) {
  349.       throw new TypeError('Body not allowed for GET or HEAD requests')
  350.     }
  351.     this._initBody(body)
  352.   }
  353.  
  354.   Request.prototype.clone = function() {
  355.     return new Request(this, { body: this._bodyInit })
  356.   }
  357.  
  358.   function decode(body) {
  359.     var form = new FormData()
  360.     body.trim().split('&').forEach(function(bytes) {
  361.       if (bytes) {
  362.         var split = bytes.split('=')
  363.         var name = split.shift().replace(/\+/g, ' ')
  364.         var value = split.join('=').replace(/\+/g, ' ')
  365.         form.append(decodeURIComponent(name), decodeURIComponent(value))
  366.       }
  367.     })
  368.     return form
  369.   }
  370.  
  371.   function parseHeaders(rawHeaders) {
  372.     var headers = new Headers()
  373.     // Replace instances of \r\n and \n followed by at least one space or horizontal tab with a space
  374.     // https://tools.ietf.org/html/rfc7230#section-3.2
  375.     var preProcessedHeaders = rawHeaders.replace(/\r?\n[\t ]+/g, ' ')
  376.     preProcessedHeaders.split(/\r?\n/).forEach(function(line) {
  377.       var parts = line.split(':')
  378.       var key = parts.shift().trim()
  379.       if (key) {
  380.         var value = parts.join(':').trim()
  381.         headers.append(key, value)
  382.       }
  383.     })
  384.     return headers
  385.   }
  386.  
  387.   Body.call(Request.prototype)
  388.  
  389.   function Response(bodyInit, options) {
  390.     if (!options) {
  391.       options = {}
  392.     }
  393.  
  394.     this.type = 'default'
  395.     this.status = 'status' in options ? options.status : 200
  396.     this.ok = this.status >= 200 && this.status < 300
  397.     this.statusText = 'statusText' in options ? options.statusText : 'OK'
  398.     this.headers = new Headers(options.headers)
  399.     this.url = options.url || ''
  400.     this._initBody(bodyInit)
  401.   }
  402.  
  403.   Body.call(Response.prototype)
  404.  
  405.   Response.prototype.clone = function() {
  406.     return new Response(this._bodyInit, {
  407.       status: this.status,
  408.       statusText: this.statusText,
  409.       headers: new Headers(this.headers),
  410.       url: this.url
  411.     })
  412.   }
  413.  
  414.   Response.error = function() {
  415.     var response = new Response(null, {status: 0, statusText: ''})
  416.     response.type = 'error'
  417.     return response
  418.   }
  419.  
  420.   var redirectStatuses = [301, 302, 303, 307, 308]
  421.  
  422.   Response.redirect = function(url, status) {
  423.     if (redirectStatuses.indexOf(status) === -1) {
  424.       throw new RangeError('Invalid status code')
  425.     }
  426.  
  427.     return new Response(null, {status: status, headers: {location: url}})
  428.   }
  429.  
  430.   self.Headers = Headers
  431.   self.Request = Request
  432.   self.Response = Response
  433.  
  434.   self.fetch = function(input, init) {
  435.     return new Promise(function(resolve, reject) {
  436.       var request = new Request(input, init)
  437.       var xhr = new XMLHttpRequest()
  438.  
  439.       xhr.onload = function() {
  440.         var options = {
  441.           status: xhr.status,
  442.           statusText: xhr.statusText,
  443.           headers: parseHeaders(xhr.getAllResponseHeaders() || '')
  444.         }
  445.         options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL')
  446.         var body = 'response' in xhr ? xhr.response : xhr.responseText
  447.         resolve(new Response(body, options))
  448.       }
  449.  
  450.       xhr.onerror = function() {
  451.         reject(new TypeError('Network request failed'))
  452.       }
  453.  
  454.       xhr.ontimeout = function() {
  455.         reject(new TypeError('Network request failed'))
  456.       }
  457.  
  458.       xhr.open(request.method, request.url, true)
  459.  
  460.       if (request.credentials === 'include') {
  461.         xhr.withCredentials = true
  462.       }
  463.  
  464.       if ('responseType' in xhr && support.blob) {
  465.         xhr.responseType = 'blob'
  466.       }
  467.  
  468.       request.headers.forEach(function(value, name) {
  469.         xhr.setRequestHeader(name, value)
  470.       })
  471.  
  472.       xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)
  473.     })
  474.   }
  475.   self.fetch.polyfill = true
  476. })(typeof self !== 'undefined' ? self : this);
  477.  
  478. /* PNP */
  479.  
  480. /**
  481.  * sp-pnp-js v2.0.3 - A JavaScript library for SharePoint development.
  482.  * MIT (https://github.com/SharePoint/PnP-JS-Core/blob/master/LICENSE)
  483.  * Copyright (c) 2017 Microsoft
  484.  * docs: http://officedev.github.io/PnP-JS-Core
  485.  * source: https://github.com/SharePoint/PnP-JS-Core
  486.  * bugs: https://github.com/SharePoint/PnP-JS-Core/issues
  487.  */
  488. (function webpackUniversalModuleDefinition(root, factory) {
  489.     if(typeof exports === 'object' && typeof module === 'object')
  490.         module.exports = factory();
  491.     else if(typeof define === 'function' && define.amd)
  492.         define([], factory);
  493.     else if(typeof exports === 'object')
  494.         exports["$pnp"] = factory();
  495.     else
  496.         root["$pnp"] = factory();
  497. })(this, function() {
  498. return /******/ (function(modules) { // webpackBootstrap
  499. /******/    // The module cache
  500. /******/    var installedModules = {};
  501. /******/
  502. /******/    // The require function
  503. /******/    function __webpack_require__(moduleId) {
  504. /******/
  505. /******/        // Check if module is in cache
  506. /******/        if(installedModules[moduleId])
  507. /******/            return installedModules[moduleId].exports;
  508. /******/
  509. /******/        // Create a new module (and put it into the cache)
  510. /******/        var module = installedModules[moduleId] = {
  511. /******/            i: moduleId,
  512. /******/            l: false,
  513. /******/            exports: {}
  514. /******/        };
  515. /******/
  516. /******/        // Execute the module function
  517. /******/        modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  518. /******/
  519. /******/        // Flag the module as loaded
  520. /******/        module.l = true;
  521. /******/
  522. /******/        // Return the exports of the module
  523. /******/        return module.exports;
  524. /******/    }
  525. /******/
  526. /******/
  527. /******/    // expose the modules object (__webpack_modules__)
  528. /******/    __webpack_require__.m = modules;
  529. /******/
  530. /******/    // expose the module cache
  531. /******/    __webpack_require__.c = installedModules;
  532. /******/
  533. /******/    // identity function for calling harmony imports with the correct context
  534. /******/    __webpack_require__.i = function(value) { return value; };
  535. /******/
  536. /******/    // define getter function for harmony exports
  537. /******/    __webpack_require__.d = function(exports, name, getter) {
  538. /******/        if(!__webpack_require__.o(exports, name)) {
  539. /******/            Object.defineProperty(exports, name, {
  540. /******/                configurable: false,
  541. /******/                enumerable: true,
  542. /******/                get: getter
  543. /******/            });
  544. /******/        }
  545. /******/    };
  546. /******/
  547. /******/    // getDefaultExport function for compatibility with non-harmony modules
  548. /******/    __webpack_require__.n = function(module) {
  549. /******/        var getter = module && module.__esModule ?
  550. /******/            function getDefault() { return module['default']; } :
  551. /******/            function getModuleExports() { return module; };
  552. /******/        __webpack_require__.d(getter, 'a', getter);
  553. /******/        return getter;
  554. /******/    };
  555. /******/
  556. /******/    // Object.prototype.hasOwnProperty.call
  557. /******/    __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  558. /******/
  559. /******/    // __webpack_public_path__
  560. /******/    __webpack_require__.p = "/assets/";
  561. /******/
  562. /******/    // Load entry module and return exports
  563. /******/    return __webpack_require__(__webpack_require__.s = 41);
  564. /******/ })
  565. /************************************************************************/
  566. /******/ ([
  567. /* 0 */
  568. /***/ (function(module, exports, __webpack_require__) {
  569.  
  570. "use strict";
  571. /* WEBPACK VAR INJECTION */(function(global) {
  572. var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
  573.     var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  574.     if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  575.     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;
  576.     return c > 3 && r && Object.defineProperty(target, key, r), r;
  577. };
  578. Object.defineProperty(exports, "__esModule", { value: true });
  579. var decorators_1 = __webpack_require__(31);
  580. var pnplibconfig_1 = __webpack_require__(4);
  581. var Util = (function () {
  582.     function Util() {
  583.     }
  584.     /**
  585.      * Gets a callback function which will maintain context across async calls.
  586.      * Allows for the calling pattern getCtxCallback(thisobj, method, methodarg1, methodarg2, ...)
  587.      *
  588.      * @param context The object that will be the 'this' value in the callback
  589.      * @param method The method to which we will apply the context and parameters
  590.      * @param params Optional, additional arguments to supply to the wrapped method when it is invoked
  591.      */
  592.     Util.getCtxCallback = function (context, method) {
  593.         var params = [];
  594.         for (var _i = 2; _i < arguments.length; _i++) {
  595.             params[_i - 2] = arguments[_i];
  596.         }
  597.         return function () {
  598.             method.apply(context, params);
  599.         };
  600.     };
  601.     /**
  602.      * Tests if a url param exists
  603.      *
  604.      * @param name The name of the url paramter to check
  605.      */
  606.     Util.urlParamExists = function (name) {
  607.         name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
  608.         var regex = new RegExp("[\\?&]" + name + "=([^&#]*)");
  609.         return regex.test(location.search);
  610.     };
  611.     /**
  612.      * Gets a url param value by name
  613.      *
  614.      * @param name The name of the paramter for which we want the value
  615.      */
  616.     Util.getUrlParamByName = function (name) {
  617.         name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
  618.         var regex = new RegExp("[\\?&]" + name + "=([^&#]*)");
  619.         var results = regex.exec(location.search);
  620.         return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
  621.     };
  622.     /**
  623.      * Gets a url param by name and attempts to parse a bool value
  624.      *
  625.      * @param name The name of the paramter for which we want the boolean value
  626.      */
  627.     Util.getUrlParamBoolByName = function (name) {
  628.         var p = this.getUrlParamByName(name);
  629.         var isFalse = (p === "" || /false|0/i.test(p));
  630.         return !isFalse;
  631.     };
  632.     /**
  633.      * Inserts the string s into the string target as the index specified by index
  634.      *
  635.      * @param target The string into which we will insert s
  636.      * @param index The location in target to insert s (zero based)
  637.      * @param s The string to insert into target at position index
  638.      */
  639.     Util.stringInsert = function (target, index, s) {
  640.         if (index > 0) {
  641.             return target.substring(0, index) + s + target.substring(index, target.length);
  642.         }
  643.         return s + target;
  644.     };
  645.     /**
  646.      * Adds a value to a date
  647.      *
  648.      * @param date The date to which we will add units, done in local time
  649.      * @param interval The name of the interval to add, one of: ['year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second']
  650.      * @param units The amount to add to date of the given interval
  651.      *
  652.      * http://stackoverflow.com/questions/1197928/how-to-add-30-minutes-to-a-javascript-date-object
  653.      */
  654.     Util.dateAdd = function (date, interval, units) {
  655.         var ret = new Date(date.toLocaleString()); // don't change original date
  656.         switch (interval.toLowerCase()) {
  657.             case "year":
  658.                 ret.setFullYear(ret.getFullYear() + units);
  659.                 break;
  660.             case "quarter":
  661.                 ret.setMonth(ret.getMonth() + 3 * units);
  662.                 break;
  663.             case "month":
  664.                 ret.setMonth(ret.getMonth() + units);
  665.                 break;
  666.             case "week":
  667.                 ret.setDate(ret.getDate() + 7 * units);
  668.                 break;
  669.             case "day":
  670.                 ret.setDate(ret.getDate() + units);
  671.                 break;
  672.             case "hour":
  673.                 ret.setTime(ret.getTime() + units * 3600000);
  674.                 break;
  675.             case "minute":
  676.                 ret.setTime(ret.getTime() + units * 60000);
  677.                 break;
  678.             case "second":
  679.                 ret.setTime(ret.getTime() + units * 1000);
  680.                 break;
  681.             default:
  682.                 ret = undefined;
  683.                 break;
  684.         }
  685.         return ret;
  686.     };
  687.     /**
  688.      * Loads a stylesheet into the current page
  689.      *
  690.      * @param path The url to the stylesheet
  691.      * @param avoidCache If true a value will be appended as a query string to avoid browser caching issues
  692.      */
  693.     Util.loadStylesheet = function (path, avoidCache) {
  694.         if (avoidCache) {
  695.             path += "?" + encodeURIComponent((new Date()).getTime().toString());
  696.         }
  697.         var head = document.getElementsByTagName("head");
  698.         if (head.length > 0) {
  699.             var e = document.createElement("link");
  700.             head[0].appendChild(e);
  701.             e.setAttribute("type", "text/css");
  702.             e.setAttribute("rel", "stylesheet");
  703.             e.setAttribute("href", path);
  704.         }
  705.     };
  706.     /**
  707.      * Combines an arbitrary set of paths ensuring that the slashes are normalized
  708.      *
  709.      * @param paths 0 to n path parts to combine
  710.      */
  711.     Util.combinePaths = function () {
  712.         var paths = [];
  713.         for (var _i = 0; _i < arguments.length; _i++) {
  714.             paths[_i] = arguments[_i];
  715.         }
  716.         return paths
  717.             .filter(function (path) { return typeof path !== "undefined" && path !== null; })
  718.             .map(function (path) { return path.replace(/^[\\|\/]/, "").replace(/[\\|\/]$/, ""); })
  719.             .join("/")
  720.             .replace(/\\/g, "/");
  721.     };
  722.     /**
  723.      * Gets a random string of chars length
  724.      *
  725.      * @param chars The length of the random string to generate
  726.      */
  727.     Util.getRandomString = function (chars) {
  728.         var text = new Array(chars);
  729.         var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
  730.         for (var i = 0; i < chars; i++) {
  731.             text[i] = possible.charAt(Math.floor(Math.random() * possible.length));
  732.         }
  733.         return text.join("");
  734.     };
  735.     /**
  736.      * Gets a random GUID value
  737.      *
  738.      * http://stackoverflow.com/questions/105034/create-guid-uuid-in-javascript
  739.      */
  740.     /* tslint:disable no-bitwise */
  741.     Util.getGUID = function () {
  742.         var d = new Date().getTime();
  743.         var guid = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) {
  744.             var r = (d + Math.random() * 16) % 16 | 0;
  745.             d = Math.floor(d / 16);
  746.             return (c === "x" ? r : (r & 0x3 | 0x8)).toString(16);
  747.         });
  748.         return guid;
  749.     };
  750.     /* tslint:enable */
  751.     /**
  752.      * Determines if a given value is a function
  753.      *
  754.      * @param candidateFunction The thing to test for being a function
  755.      */
  756.     Util.isFunction = function (candidateFunction) {
  757.         return typeof candidateFunction === "function";
  758.     };
  759.     /**
  760.      * @returns whether the provided parameter is a JavaScript Array or not.
  761.     */
  762.     Util.isArray = function (array) {
  763.         if (Array.isArray) {
  764.             return Array.isArray(array);
  765.         }
  766.         return array && typeof array.length === "number" && array.constructor === Array;
  767.     };
  768.     /**
  769.      * Determines if a string is null or empty or undefined
  770.      *
  771.      * @param s The string to test
  772.      */
  773.     Util.stringIsNullOrEmpty = function (s) {
  774.         return typeof s === "undefined" || s === null || s === "";
  775.     };
  776.     /**
  777.      * Provides functionality to extend the given object by doing a shallow copy
  778.      *
  779.      * @param target The object to which properties will be copied
  780.      * @param source The source object from which properties will be copied
  781.      * @param noOverwrite If true existing properties on the target are not overwritten from the source
  782.      *
  783.      */
  784.     Util.extend = function (target, source, noOverwrite) {
  785.         if (noOverwrite === void 0) { noOverwrite = false; }
  786.         if (source === null || typeof source === "undefined") {
  787.             return target;
  788.         }
  789.         // ensure we don't overwrite things we don't want overwritten
  790.         var check = noOverwrite ? function (o, i) { return !(i in o); } : function () { return true; };
  791.         return Object.getOwnPropertyNames(source)
  792.             .filter(function (v) { return check(target, v); })
  793.             .reduce(function (t, v) {
  794.             t[v] = source[v];
  795.             return t;
  796.         }, target);
  797.     };
  798.     /**
  799.      * Determines if a given url is absolute
  800.      *
  801.      * @param url The url to check to see if it is absolute
  802.      */
  803.     Util.isUrlAbsolute = function (url) {
  804.         return /^https?:\/\/|^\/\//i.test(url);
  805.     };
  806.     /**
  807.      * Attempts to make the supplied relative url absolute based on the _spPageContextInfo object, if available
  808.      *
  809.      * @param url The relative url to make absolute
  810.      */
  811.     Util.makeUrlAbsolute = function (url) {
  812.         if (Util.isUrlAbsolute(url)) {
  813.             return url;
  814.         }
  815.         if (typeof global._spPageContextInfo !== "undefined") {
  816.             if (global._spPageContextInfo.hasOwnProperty("webAbsoluteUrl")) {
  817.                 return Util.combinePaths(global._spPageContextInfo.webAbsoluteUrl, url);
  818.             }
  819.             else if (global._spPageContextInfo.hasOwnProperty("webServerRelativeUrl")) {
  820.                 return Util.combinePaths(global._spPageContextInfo.webServerRelativeUrl, url);
  821.             }
  822.         }
  823.         else {
  824.             return url;
  825.         }
  826.     };
  827.     /**
  828.      * Ensures that a given url is absolute for the current web based on context
  829.      *
  830.      * @param candidateUrl The url to make absolute
  831.      *
  832.      */
  833.     Util.toAbsoluteUrl = function (candidateUrl) {
  834.         return new Promise(function (resolve) {
  835.             if (Util.isUrlAbsolute(candidateUrl)) {
  836.                 // if we are already absolute, then just return the url
  837.                 return resolve(candidateUrl);
  838.             }
  839.             if (pnplibconfig_1.RuntimeConfig.baseUrl !== null) {
  840.                 // base url specified either with baseUrl of spfxContext config property
  841.                 return resolve(Util.combinePaths(pnplibconfig_1.RuntimeConfig.baseUrl, candidateUrl));
  842.             }
  843.             if (typeof global._spPageContextInfo !== "undefined") {
  844.                 // operating in classic pages
  845.                 if (global._spPageContextInfo.hasOwnProperty("webAbsoluteUrl")) {
  846.                     return resolve(Util.combinePaths(global._spPageContextInfo.webAbsoluteUrl, candidateUrl));
  847.                 }
  848.                 else if (global._spPageContextInfo.hasOwnProperty("webServerRelativeUrl")) {
  849.                     return resolve(Util.combinePaths(global._spPageContextInfo.webServerRelativeUrl, candidateUrl));
  850.                 }
  851.             }
  852.             // does window.location exist and have _layouts in it?
  853.             if (typeof global.location !== "undefined") {
  854.                 var index = global.location.toString().toLowerCase().indexOf("/_layouts/");
  855.                 if (index > 0) {
  856.                     // we are likely in the workbench in /_layouts/
  857.                     return resolve(Util.combinePaths(global.location.toString().substr(0, index), candidateUrl));
  858.                 }
  859.             }
  860.             return resolve(candidateUrl);
  861.         });
  862.     };
  863.     return Util;
  864. }());
  865. __decorate([
  866.     decorators_1.deprecated("The Util.makeUrlAbsolute method is deprecated and will be removed from future releases. Use Util.toAbsoluteUrl instead")
  867. ], Util, "makeUrlAbsolute", null);
  868. exports.Util = Util;
  869.  
  870. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(32)))
  871.  
  872. /***/ }),
  873. /* 1 */
  874. /***/ (function(module, exports, __webpack_require__) {
  875.  
  876. "use strict";
  877.  
  878. var __extends = (this && this.__extends) || (function () {
  879.     var extendStatics = Object.setPrototypeOf ||
  880.         ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  881.         function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  882.     return function (d, b) {
  883.         extendStatics(d, b);
  884.         function __() { this.constructor = d; }
  885.         d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  886.     };
  887. })();
  888. Object.defineProperty(exports, "__esModule", { value: true });
  889. var util_1 = __webpack_require__(0);
  890. var collections_1 = __webpack_require__(6);
  891. var odata_1 = __webpack_require__(2);
  892. var pnplibconfig_1 = __webpack_require__(4);
  893. var exceptions_1 = __webpack_require__(3);
  894. var queryablerequest_1 = __webpack_require__(45);
  895. var logging_1 = __webpack_require__(5);
  896. /**
  897.  * Queryable Base Class
  898.  *
  899.  */
  900. var Queryable = (function () {
  901.     /**
  902.      * Creates a new instance of the Queryable class
  903.      *
  904.      * @constructor
  905.      * @param baseUrl A string or Queryable that should form the base part of the url
  906.      *
  907.      */
  908.     function Queryable(baseUrl, path) {
  909.         this._query = new collections_1.Dictionary();
  910.         this._batch = null;
  911.         if (typeof baseUrl === "string") {
  912.             // we need to do some extra parsing to get the parent url correct if we are
  913.             // being created from just a string.
  914.             var urlStr = baseUrl;
  915.             if (util_1.Util.isUrlAbsolute(urlStr) || urlStr.lastIndexOf("/") < 0) {
  916.                 this._parentUrl = urlStr;
  917.                 this._url = util_1.Util.combinePaths(urlStr, path);
  918.             }
  919.             else if (urlStr.lastIndexOf("/") > urlStr.lastIndexOf("(")) {
  920.                 // .../items(19)/fields
  921.                 var index = urlStr.lastIndexOf("/");
  922.                 this._parentUrl = urlStr.slice(0, index);
  923.                 path = util_1.Util.combinePaths(urlStr.slice(index), path);
  924.                 this._url = util_1.Util.combinePaths(this._parentUrl, path);
  925.             }
  926.             else {
  927.                 // .../items(19)
  928.                 var index = urlStr.lastIndexOf("(");
  929.                 this._parentUrl = urlStr.slice(0, index);
  930.                 this._url = util_1.Util.combinePaths(urlStr, path);
  931.             }
  932.         }
  933.         else {
  934.             var q = baseUrl;
  935.             this._parentUrl = q._url;
  936.             var target = q._query.get("@target");
  937.             if (target !== null) {
  938.                 this._query.add("@target", target);
  939.             }
  940.             this._url = util_1.Util.combinePaths(this._parentUrl, path);
  941.         }
  942.     }
  943.     /**
  944.      * Directly concatonates the supplied string to the current url, not normalizing "/" chars
  945.      *
  946.      * @param pathPart The string to concatonate to the url
  947.      */
  948.     Queryable.prototype.concat = function (pathPart) {
  949.         this._url += pathPart;
  950.     };
  951.     /**
  952.      * Appends the given string and normalizes "/" chars
  953.      *
  954.      * @param pathPart The string to append
  955.      */
  956.     Queryable.prototype.append = function (pathPart) {
  957.         this._url = util_1.Util.combinePaths(this._url, pathPart);
  958.     };
  959.     /**
  960.      * Blocks a batch call from occuring, MUST be cleared by calling the returned function
  961.      */
  962.     Queryable.prototype.addBatchDependency = function () {
  963.         if (this.hasBatch) {
  964.             return this._batch.addDependency();
  965.         }
  966.         return function () { return null; };
  967.     };
  968.     Object.defineProperty(Queryable.prototype, "hasBatch", {
  969.         /**
  970.          * Indicates if the current query has a batch associated
  971.          *
  972.          */
  973.         get: function () {
  974.             return this._batch !== null;
  975.         },
  976.         enumerable: true,
  977.         configurable: true
  978.     });
  979.     Object.defineProperty(Queryable.prototype, "batch", {
  980.         /**
  981.          * The batch currently associated with this query or null
  982.          *
  983.          */
  984.         get: function () {
  985.             return this.hasBatch ? this._batch : null;
  986.         },
  987.         enumerable: true,
  988.         configurable: true
  989.     });
  990.     Object.defineProperty(Queryable.prototype, "parentUrl", {
  991.         /**
  992.          * Gets the parent url used when creating this instance
  993.          *
  994.          */
  995.         get: function () {
  996.             return this._parentUrl;
  997.         },
  998.         enumerable: true,
  999.         configurable: true
  1000.     });
  1001.     Object.defineProperty(Queryable.prototype, "query", {
  1002.         /**
  1003.          * Provides access to the query builder for this url
  1004.          *
  1005.          */
  1006.         get: function () {
  1007.             return this._query;
  1008.         },
  1009.         enumerable: true,
  1010.         configurable: true
  1011.     });
  1012.     /**
  1013.      * Creates a new instance of the supplied factory and extends this into that new instance
  1014.      *
  1015.      * @param factory constructor for the new queryable
  1016.      */
  1017.     Queryable.prototype.as = function (factory) {
  1018.         var o = new factory(this._url, null);
  1019.         return util_1.Util.extend(o, this, true);
  1020.     };
  1021.     /**
  1022.      * Adds this query to the supplied batch
  1023.      *
  1024.      * @example
  1025.      * ```
  1026.      *
  1027.      * let b = pnp.sp.createBatch();
  1028.      * pnp.sp.web.inBatch(b).get().then(...);
  1029.      * b.execute().then(...)
  1030.      * ```
  1031.      */
  1032.     Queryable.prototype.inBatch = function (batch) {
  1033.         if (this._batch !== null) {
  1034.             throw new exceptions_1.AlreadyInBatchException();
  1035.         }
  1036.         this._batch = batch;
  1037.         return this;
  1038.     };
  1039.     /**
  1040.      * Enables caching for this request
  1041.      *
  1042.      * @param options Defines the options used when caching this request
  1043.      */
  1044.     Queryable.prototype.usingCaching = function (options) {
  1045.         if (!pnplibconfig_1.RuntimeConfig.globalCacheDisable) {
  1046.             this._useCaching = true;
  1047.             this._cachingOptions = options;
  1048.         }
  1049.         return this;
  1050.     };
  1051.     /**
  1052.      * Gets the currentl url, made absolute based on the availability of the _spPageContextInfo object
  1053.      *
  1054.      */
  1055.     Queryable.prototype.toUrl = function () {
  1056.         return this._url;
  1057.     };
  1058.     /**
  1059.      * Gets the full url with query information
  1060.      *
  1061.      */
  1062.     Queryable.prototype.toUrlAndQuery = function () {
  1063.         var aliasedParams = new collections_1.Dictionary();
  1064.         var url = this.toUrl().replace(/'!(@.*?)::(.*?)'/ig, function (match, labelName, value) {
  1065.             logging_1.Logger.write("Rewriting aliased parameter from match " + match + " to label: " + labelName + " value: " + value, logging_1.LogLevel.Verbose);
  1066.             aliasedParams.add(labelName, "'" + value + "'");
  1067.             return labelName;
  1068.         });
  1069.         // inlude our explicitly set query string params
  1070.         aliasedParams.merge(this._query);
  1071.         if (aliasedParams.count() > 0) {
  1072.             url += "?" + aliasedParams.getKeys().map(function (key) { return key + "=" + aliasedParams.get(key); }).join("&");
  1073.         }
  1074.         return url;
  1075.     };
  1076.     /**
  1077.      * Gets a parent for this instance as specified
  1078.      *
  1079.      * @param factory The contructor for the class to create
  1080.      */
  1081.     Queryable.prototype.getParent = function (factory, baseUrl, path, batch) {
  1082.         if (baseUrl === void 0) { baseUrl = this.parentUrl; }
  1083.         var parent = new factory(baseUrl, path);
  1084.         var target = this.query.get("@target");
  1085.         if (target !== null) {
  1086.             parent.query.add("@target", target);
  1087.         }
  1088.         if (typeof batch !== "undefined") {
  1089.             parent = parent.inBatch(batch);
  1090.         }
  1091.         return parent;
  1092.     };
  1093.     /**
  1094.      * Clones this queryable into a new queryable instance of T
  1095.      * @param factory Constructor used to create the new instance
  1096.      * @param additionalPath Any additional path to include in the clone
  1097.      * @param includeBatch If true this instance's batch will be added to the cloned instance
  1098.      */
  1099.     Queryable.prototype.clone = function (factory, additionalPath, includeBatch) {
  1100.         if (includeBatch === void 0) { includeBatch = false; }
  1101.         var clone = new factory(this, additionalPath);
  1102.         var target = this.query.get("@target");
  1103.         if (target !== null) {
  1104.             clone.query.add("@target", target);
  1105.         }
  1106.         if (includeBatch && this.hasBatch) {
  1107.             clone = clone.inBatch(this.batch);
  1108.         }
  1109.         return clone;
  1110.     };
  1111.     /**
  1112.      * Executes the currently built request
  1113.      *
  1114.      * @param parser Allows you to specify a parser to handle the result
  1115.      * @param getOptions The options used for this request
  1116.      */
  1117.     Queryable.prototype.get = function (parser, getOptions) {
  1118.         if (parser === void 0) { parser = new odata_1.ODataDefaultParser(); }
  1119.         if (getOptions === void 0) { getOptions = {}; }
  1120.         return this.toRequestContext("GET", getOptions, parser).then(function (context) { return queryablerequest_1.pipe(context); });
  1121.     };
  1122.     Queryable.prototype.getAs = function (parser, getOptions) {
  1123.         if (parser === void 0) { parser = new odata_1.ODataDefaultParser(); }
  1124.         if (getOptions === void 0) { getOptions = {}; }
  1125.         return this.toRequestContext("GET", getOptions, parser).then(function (context) { return queryablerequest_1.pipe(context); });
  1126.     };
  1127.     Queryable.prototype.post = function (postOptions, parser) {
  1128.         if (postOptions === void 0) { postOptions = {}; }
  1129.         if (parser === void 0) { parser = new odata_1.ODataDefaultParser(); }
  1130.         return this.toRequestContext("POST", postOptions, parser).then(function (context) { return queryablerequest_1.pipe(context); });
  1131.     };
  1132.     Queryable.prototype.postAs = function (postOptions, parser) {
  1133.         if (postOptions === void 0) { postOptions = {}; }
  1134.         if (parser === void 0) { parser = new odata_1.ODataDefaultParser(); }
  1135.         return this.toRequestContext("POST", postOptions, parser).then(function (context) { return queryablerequest_1.pipe(context); });
  1136.     };
  1137.     Queryable.prototype.patch = function (patchOptions, parser) {
  1138.         if (patchOptions === void 0) { patchOptions = {}; }
  1139.         if (parser === void 0) { parser = new odata_1.ODataDefaultParser(); }
  1140.         return this.toRequestContext("PATCH", patchOptions, parser).then(function (context) { return queryablerequest_1.pipe(context); });
  1141.     };
  1142.     Queryable.prototype.delete = function (deleteOptions, parser) {
  1143.         if (deleteOptions === void 0) { deleteOptions = {}; }
  1144.         if (parser === void 0) { parser = new odata_1.ODataDefaultParser(); }
  1145.         return this.toRequestContext("DELETE", deleteOptions, parser).then(function (context) { return queryablerequest_1.pipe(context); });
  1146.     };
  1147.     Queryable.prototype.toRequestContext = function (verb, options, parser) {
  1148.         var _this = this;
  1149.         if (options === void 0) { options = {}; }
  1150.         var dependencyDispose = this.hasBatch ? this.addBatchDependency() : function () { return; };
  1151.         return util_1.Util.toAbsoluteUrl(this.toUrlAndQuery()).then(function (url) {
  1152.             // build our request context
  1153.             var context = {
  1154.                 batch: _this._batch,
  1155.                 batchDependency: dependencyDispose,
  1156.                 cachingOptions: _this._cachingOptions,
  1157.                 isBatched: _this.hasBatch,
  1158.                 isCached: _this._useCaching,
  1159.                 options: options,
  1160.                 parser: parser,
  1161.                 requestAbsoluteUrl: url,
  1162.                 requestId: util_1.Util.getGUID(),
  1163.                 verb: verb,
  1164.             };
  1165.             return context;
  1166.         });
  1167.     };
  1168.     return Queryable;
  1169. }());
  1170. exports.Queryable = Queryable;
  1171. /**
  1172.  * Represents a REST collection which can be filtered, paged, and selected
  1173.  *
  1174.  */
  1175. var QueryableCollection = (function (_super) {
  1176.     __extends(QueryableCollection, _super);
  1177.     function QueryableCollection() {
  1178.         return _super !== null && _super.apply(this, arguments) || this;
  1179.     }
  1180.     /**
  1181.      * Filters the returned collection (https://msdn.microsoft.com/en-us/library/office/fp142385.aspx#bk_supported)
  1182.      *
  1183.      * @param filter The string representing the filter query
  1184.      */
  1185.     QueryableCollection.prototype.filter = function (filter) {
  1186.         this._query.add("$filter", filter);
  1187.         return this;
  1188.     };
  1189.     /**
  1190.      * Choose which fields to return
  1191.      *
  1192.      * @param selects One or more fields to return
  1193.      */
  1194.     QueryableCollection.prototype.select = function () {
  1195.         var selects = [];
  1196.         for (var _i = 0; _i < arguments.length; _i++) {
  1197.             selects[_i] = arguments[_i];
  1198.         }
  1199.         if (selects.length > 0) {
  1200.             this._query.add("$select", selects.join(","));
  1201.         }
  1202.         return this;
  1203.     };
  1204.     /**
  1205.      * Expands fields such as lookups to get additional data
  1206.      *
  1207.      * @param expands The Fields for which to expand the values
  1208.      */
  1209.     QueryableCollection.prototype.expand = function () {
  1210.         var expands = [];
  1211.         for (var _i = 0; _i < arguments.length; _i++) {
  1212.             expands[_i] = arguments[_i];
  1213.         }
  1214.         if (expands.length > 0) {
  1215.             this._query.add("$expand", expands.join(","));
  1216.         }
  1217.         return this;
  1218.     };
  1219.     /**
  1220.      * Orders based on the supplied fields ascending
  1221.      *
  1222.      * @param orderby The name of the field to sort on
  1223.      * @param ascending If false DESC is appended, otherwise ASC (default)
  1224.      */
  1225.     QueryableCollection.prototype.orderBy = function (orderBy, ascending) {
  1226.         if (ascending === void 0) { ascending = true; }
  1227.         var keys = this._query.getKeys();
  1228.         var query = [];
  1229.         var asc = ascending ? " asc" : " desc";
  1230.         for (var i = 0; i < keys.length; i++) {
  1231.             if (keys[i] === "$orderby") {
  1232.                 query.push(this._query.get("$orderby"));
  1233.                 break;
  1234.             }
  1235.         }
  1236.         query.push("" + orderBy + asc);
  1237.         this._query.add("$orderby", query.join(","));
  1238.         return this;
  1239.     };
  1240.     /**
  1241.      * Skips the specified number of items
  1242.      *
  1243.      * @param skip The number of items to skip
  1244.      */
  1245.     QueryableCollection.prototype.skip = function (skip) {
  1246.         this._query.add("$skip", skip.toString());
  1247.         return this;
  1248.     };
  1249.     /**
  1250.      * Limits the query to only return the specified number of items
  1251.      *
  1252.      * @param top The query row limit
  1253.      */
  1254.     QueryableCollection.prototype.top = function (top) {
  1255.         this._query.add("$top", top.toString());
  1256.         return this;
  1257.     };
  1258.     return QueryableCollection;
  1259. }(Queryable));
  1260. exports.QueryableCollection = QueryableCollection;
  1261. /**
  1262.  * Represents an instance that can be selected
  1263.  *
  1264.  */
  1265. var QueryableInstance = (function (_super) {
  1266.     __extends(QueryableInstance, _super);
  1267.     function QueryableInstance() {
  1268.         return _super !== null && _super.apply(this, arguments) || this;
  1269.     }
  1270.     /**
  1271.      * Choose which fields to return
  1272.      *
  1273.      * @param selects One or more fields to return
  1274.      */
  1275.     QueryableInstance.prototype.select = function () {
  1276.         var selects = [];
  1277.         for (var _i = 0; _i < arguments.length; _i++) {
  1278.             selects[_i] = arguments[_i];
  1279.         }
  1280.         if (selects.length > 0) {
  1281.             this._query.add("$select", selects.join(","));
  1282.         }
  1283.         return this;
  1284.     };
  1285.     /**
  1286.      * Expands fields such as lookups to get additional data
  1287.      *
  1288.      * @param expands The Fields for which to expand the values
  1289.      */
  1290.     QueryableInstance.prototype.expand = function () {
  1291.         var expands = [];
  1292.         for (var _i = 0; _i < arguments.length; _i++) {
  1293.             expands[_i] = arguments[_i];
  1294.         }
  1295.         if (expands.length > 0) {
  1296.             this._query.add("$expand", expands.join(","));
  1297.         }
  1298.         return this;
  1299.     };
  1300.     return QueryableInstance;
  1301. }(Queryable));
  1302. exports.QueryableInstance = QueryableInstance;
  1303.  
  1304.  
  1305. /***/ }),
  1306. /* 2 */
  1307. /***/ (function(module, exports, __webpack_require__) {
  1308.  
  1309. "use strict";
  1310.  
  1311. var __extends = (this && this.__extends) || (function () {
  1312.     var extendStatics = Object.setPrototypeOf ||
  1313.         ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  1314.         function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  1315.     return function (d, b) {
  1316.         extendStatics(d, b);
  1317.         function __() { this.constructor = d; }
  1318.         d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  1319.     };
  1320. })();
  1321. Object.defineProperty(exports, "__esModule", { value: true });
  1322. var util_1 = __webpack_require__(0);
  1323. var logging_1 = __webpack_require__(5);
  1324. var httpclient_1 = __webpack_require__(15);
  1325. var pnplibconfig_1 = __webpack_require__(4);
  1326. var exceptions_1 = __webpack_require__(3);
  1327. var exceptions_2 = __webpack_require__(3);
  1328. function extractOdataId(candidate) {
  1329.     if (candidate.hasOwnProperty("odata.id")) {
  1330.         return candidate["odata.id"];
  1331.     }
  1332.     else if (candidate.hasOwnProperty("__metadata") && candidate.__metadata.hasOwnProperty("id")) {
  1333.         return candidate.__metadata.id;
  1334.     }
  1335.     else {
  1336.         throw new exceptions_1.ODataIdException(candidate);
  1337.     }
  1338. }
  1339. exports.extractOdataId = extractOdataId;
  1340. var ODataParserBase = (function () {
  1341.     function ODataParserBase() {
  1342.     }
  1343.     ODataParserBase.prototype.parse = function (r) {
  1344.         var _this = this;
  1345.         return new Promise(function (resolve, reject) {
  1346.             if (_this.handleError(r, reject)) {
  1347.                 if ((r.headers.has("Content-Length") && parseFloat(r.headers.get("Content-Length")) === 0) || r.status === 204) {
  1348.                     resolve({});
  1349.                 }
  1350.                 else {
  1351.                     r.json().then(function (json) { return resolve(_this.parseODataJSON(json)); }).catch(function (e) { return reject(e); });
  1352.                 }
  1353.             }
  1354.         });
  1355.     };
  1356.     ODataParserBase.prototype.handleError = function (r, reject) {
  1357.         if (!r.ok) {
  1358.             r.json().then(function (json) {
  1359.                 // include the headers as they contain diagnostic information
  1360.                 var data = {
  1361.                     responseBody: json,
  1362.                     responseHeaders: r.headers,
  1363.                 };
  1364.                 reject(new exceptions_2.ProcessHttpClientResponseException(r.status, r.statusText, data));
  1365.             }).catch(function (e) {
  1366.                 // we failed to read the body - possibly it is empty. Let's report the original status that caused
  1367.                 // the request to fail and log the error with parsing the body if anyone needs it for debugging
  1368.                 logging_1.Logger.log({
  1369.                     data: e,
  1370.                     level: logging_1.LogLevel.Warning,
  1371.                     message: "There was an error parsing the error response body. See data for details.",
  1372.                 });
  1373.                 // include the headers as they contain diagnostic information
  1374.                 var data = {
  1375.                     responseBody: "[[body not available]]",
  1376.                     responseHeaders: r.headers,
  1377.                 };
  1378.                 reject(new exceptions_2.ProcessHttpClientResponseException(r.status, r.statusText, data));
  1379.             });
  1380.         }
  1381.         return r.ok;
  1382.     };
  1383.     ODataParserBase.prototype.parseODataJSON = function (json) {
  1384.         var result = json;
  1385.         if (json.hasOwnProperty("d")) {
  1386.             if (json.d.hasOwnProperty("results")) {
  1387.                 result = json.d.results;
  1388.             }
  1389.             else {
  1390.                 result = json.d;
  1391.             }
  1392.         }
  1393.         else if (json.hasOwnProperty("value")) {
  1394.             result = json.value;
  1395.         }
  1396.         return result;
  1397.     };
  1398.     return ODataParserBase;
  1399. }());
  1400. exports.ODataParserBase = ODataParserBase;
  1401. var ODataDefaultParser = (function (_super) {
  1402.     __extends(ODataDefaultParser, _super);
  1403.     function ODataDefaultParser() {
  1404.         return _super !== null && _super.apply(this, arguments) || this;
  1405.     }
  1406.     return ODataDefaultParser;
  1407. }(ODataParserBase));
  1408. exports.ODataDefaultParser = ODataDefaultParser;
  1409. var ODataRawParserImpl = (function () {
  1410.     function ODataRawParserImpl() {
  1411.     }
  1412.     ODataRawParserImpl.prototype.parse = function (r) {
  1413.         return r.json();
  1414.     };
  1415.     return ODataRawParserImpl;
  1416. }());
  1417. exports.ODataRawParserImpl = ODataRawParserImpl;
  1418. var ODataValueParserImpl = (function (_super) {
  1419.     __extends(ODataValueParserImpl, _super);
  1420.     function ODataValueParserImpl() {
  1421.         return _super !== null && _super.apply(this, arguments) || this;
  1422.     }
  1423.     ODataValueParserImpl.prototype.parse = function (r) {
  1424.         return _super.prototype.parse.call(this, r).then(function (d) { return d; });
  1425.     };
  1426.     return ODataValueParserImpl;
  1427. }(ODataParserBase));
  1428. var ODataEntityParserImpl = (function (_super) {
  1429.     __extends(ODataEntityParserImpl, _super);
  1430.     function ODataEntityParserImpl(factory) {
  1431.         var _this = _super.call(this) || this;
  1432.         _this.factory = factory;
  1433.         return _this;
  1434.     }
  1435.     ODataEntityParserImpl.prototype.parse = function (r) {
  1436.         var _this = this;
  1437.         return _super.prototype.parse.call(this, r).then(function (d) {
  1438.             var o = new _this.factory(getEntityUrl(d), null);
  1439.             return util_1.Util.extend(o, d);
  1440.         });
  1441.     };
  1442.     return ODataEntityParserImpl;
  1443. }(ODataParserBase));
  1444. var ODataEntityArrayParserImpl = (function (_super) {
  1445.     __extends(ODataEntityArrayParserImpl, _super);
  1446.     function ODataEntityArrayParserImpl(factory) {
  1447.         var _this = _super.call(this) || this;
  1448.         _this.factory = factory;
  1449.         return _this;
  1450.     }
  1451.     ODataEntityArrayParserImpl.prototype.parse = function (r) {
  1452.         var _this = this;
  1453.         return _super.prototype.parse.call(this, r).then(function (d) {
  1454.             return d.map(function (v) {
  1455.                 var o = new _this.factory(getEntityUrl(v), null);
  1456.                 return util_1.Util.extend(o, v);
  1457.             });
  1458.         });
  1459.     };
  1460.     return ODataEntityArrayParserImpl;
  1461. }(ODataParserBase));
  1462. function getEntityUrl(entity) {
  1463.     if (entity.hasOwnProperty("odata.editLink")) {
  1464.         // we are dealign with minimal metadata (default)
  1465.         return util_1.Util.combinePaths("_api", entity["odata.editLink"]);
  1466.     }
  1467.     else if (entity.hasOwnProperty("__metadata")) {
  1468.         // we are dealing with verbose, which has an absolute uri
  1469.         return entity.__metadata.uri;
  1470.     }
  1471.     else {
  1472.         // we are likely dealing with nometadata, so don't error but we won't be able to
  1473.         // chain off these objects
  1474.         logging_1.Logger.write("No uri information found in ODataEntity parsing, chaining will fail for this object.", logging_1.LogLevel.Warning);
  1475.         return "";
  1476.     }
  1477. }
  1478. exports.getEntityUrl = getEntityUrl;
  1479. exports.ODataRaw = new ODataRawParserImpl();
  1480. function ODataValue() {
  1481.     return new ODataValueParserImpl();
  1482. }
  1483. exports.ODataValue = ODataValue;
  1484. function ODataEntity(factory) {
  1485.     return new ODataEntityParserImpl(factory);
  1486. }
  1487. exports.ODataEntity = ODataEntity;
  1488. function ODataEntityArray(factory) {
  1489.     return new ODataEntityArrayParserImpl(factory);
  1490. }
  1491. exports.ODataEntityArray = ODataEntityArray;
  1492. /**
  1493.  * Manages a batch of OData operations
  1494.  */
  1495. var ODataBatch = (function () {
  1496.     function ODataBatch(baseUrl, _batchId) {
  1497.         if (_batchId === void 0) { _batchId = util_1.Util.getGUID(); }
  1498.         this.baseUrl = baseUrl;
  1499.         this._batchId = _batchId;
  1500.         this._requests = [];
  1501.         this._dependencies = [];
  1502.     }
  1503.     /**
  1504.      * Adds a request to a batch (not designed for public use)
  1505.      *
  1506.      * @param url The full url of the request
  1507.      * @param method The http method GET, POST, etc
  1508.      * @param options Any options to include in the request
  1509.      * @param parser The parser that will hadle the results of the request
  1510.      */
  1511.     ODataBatch.prototype.add = function (url, method, options, parser) {
  1512.         var info = {
  1513.             method: method.toUpperCase(),
  1514.             options: options,
  1515.             parser: parser,
  1516.             reject: null,
  1517.             resolve: null,
  1518.             url: url,
  1519.         };
  1520.         var p = new Promise(function (resolve, reject) {
  1521.             info.resolve = resolve;
  1522.             info.reject = reject;
  1523.         });
  1524.         this._requests.push(info);
  1525.         return p;
  1526.     };
  1527.     /**
  1528.      * Adds a dependency insuring that some set of actions will occur before a batch is processed.
  1529.      * MUST be cleared using the returned resolve delegate to allow batches to run
  1530.      */
  1531.     ODataBatch.prototype.addDependency = function () {
  1532.         var resolver;
  1533.         var promise = new Promise(function (resolve) {
  1534.             resolver = resolve;
  1535.         });
  1536.         this._dependencies.push(promise);
  1537.         return resolver;
  1538.     };
  1539.     /**
  1540.      * Execute the current batch and resolve the associated promises
  1541.      *
  1542.      * @returns A promise which will be resolved once all of the batch's child promises have resolved
  1543.      */
  1544.     ODataBatch.prototype.execute = function () {
  1545.         var _this = this;
  1546.         // we need to check the dependencies twice due to how different engines handle things.
  1547.         // We can get a second set of promises added after the first set resolve
  1548.         return Promise.all(this._dependencies).then(function () { return Promise.all(_this._dependencies); }).then(function () { return _this.executeImpl(); });
  1549.     };
  1550.     ODataBatch.prototype.executeImpl = function () {
  1551.         var _this = this;
  1552.         logging_1.Logger.write("Executing batch with " + this._requests.length + " requests.", logging_1.LogLevel.Info);
  1553.         // if we don't have any requests, don't bother sending anything
  1554.         // this could be due to caching further upstream, or just an empty batch
  1555.         if (this._requests.length < 1) {
  1556.             logging_1.Logger.write("Resolving empty batch.", logging_1.LogLevel.Info);
  1557.             return Promise.resolve();
  1558.         }
  1559.         // creating the client here allows the url to be populated for nodejs client as well as potentially
  1560.         // any other hacks needed for other types of clients. Essentially allows the absoluteRequestUrl
  1561.         // below to be correct
  1562.         var client = new httpclient_1.HttpClient();
  1563.         // due to timing we need to get the absolute url here so we can use it for all the individual requests
  1564.         // and for sending the entire batch
  1565.         return util_1.Util.toAbsoluteUrl(this.baseUrl).then(function (absoluteRequestUrl) {
  1566.             // build all the requests, send them, pipe results in order to parsers
  1567.             var batchBody = [];
  1568.             var currentChangeSetId = "";
  1569.             _this._requests.map(function (reqInfo) {
  1570.                 if (reqInfo.method === "GET") {
  1571.                     if (currentChangeSetId.length > 0) {
  1572.                         // end an existing change set
  1573.                         batchBody.push("--changeset_" + currentChangeSetId + "--\n\n");
  1574.                         currentChangeSetId = "";
  1575.                     }
  1576.                     batchBody.push("--batch_" + _this._batchId + "\n");
  1577.                 }
  1578.                 else {
  1579.                     if (currentChangeSetId.length < 1) {
  1580.                         // start new change set
  1581.                         currentChangeSetId = util_1.Util.getGUID();
  1582.                         batchBody.push("--batch_" + _this._batchId + "\n");
  1583.                         batchBody.push("Content-Type: multipart/mixed; boundary=\"changeset_" + currentChangeSetId + "\"\n\n");
  1584.                     }
  1585.                     batchBody.push("--changeset_" + currentChangeSetId + "\n");
  1586.                 }
  1587.                 // common batch part prefix
  1588.                 batchBody.push("Content-Type: application/http\n");
  1589.                 batchBody.push("Content-Transfer-Encoding: binary\n\n");
  1590.                 var headers = {
  1591.                     "Accept": "application/json;",
  1592.                 };
  1593.                 // this is the url of the individual request within the batch
  1594.                 var url = util_1.Util.isUrlAbsolute(reqInfo.url) ? reqInfo.url : util_1.Util.combinePaths(absoluteRequestUrl, reqInfo.url);
  1595.                 logging_1.Logger.write("Adding request " + reqInfo.method + " " + url + " to batch.", logging_1.LogLevel.Verbose);
  1596.                 if (reqInfo.method !== "GET") {
  1597.                     var method = reqInfo.method;
  1598.                     if (reqInfo.hasOwnProperty("options") && reqInfo.options.hasOwnProperty("headers") && typeof reqInfo.options.headers["X-HTTP-Method"] !== "undefined") {
  1599.                         method = reqInfo.options.headers["X-HTTP-Method"];
  1600.                         delete reqInfo.options.headers["X-HTTP-Method"];
  1601.                     }
  1602.                     batchBody.push(method + " " + url + " HTTP/1.1\n");
  1603.                     headers = util_1.Util.extend(headers, { "Content-Type": "application/json;odata=verbose;charset=utf-8" });
  1604.                 }
  1605.                 else {
  1606.                     batchBody.push(reqInfo.method + " " + url + " HTTP/1.1\n");
  1607.                 }
  1608.                 if (typeof pnplibconfig_1.RuntimeConfig.headers !== "undefined") {
  1609.                     headers = util_1.Util.extend(headers, pnplibconfig_1.RuntimeConfig.headers);
  1610.                 }
  1611.                 if (reqInfo.options && reqInfo.options.headers) {
  1612.                     headers = util_1.Util.extend(headers, reqInfo.options.headers);
  1613.                 }
  1614.                 for (var name_1 in headers) {
  1615.                     if (headers.hasOwnProperty(name_1)) {
  1616.                         batchBody.push(name_1 + ": " + headers[name_1] + "\n");
  1617.                     }
  1618.                 }
  1619.                 batchBody.push("\n");
  1620.                 if (reqInfo.options.body) {
  1621.                     batchBody.push(reqInfo.options.body + "\n\n");
  1622.                 }
  1623.             });
  1624.             if (currentChangeSetId.length > 0) {
  1625.                 // Close the changeset
  1626.                 batchBody.push("--changeset_" + currentChangeSetId + "--\n\n");
  1627.                 currentChangeSetId = "";
  1628.             }
  1629.             batchBody.push("--batch_" + _this._batchId + "--\n");
  1630.             var batchHeaders = {
  1631.                 "Content-Type": "multipart/mixed; boundary=batch_" + _this._batchId,
  1632.             };
  1633.             var batchOptions = {
  1634.                 "body": batchBody.join(""),
  1635.                 "headers": batchHeaders,
  1636.             };
  1637.             logging_1.Logger.write("Sending batch request.", logging_1.LogLevel.Info);
  1638.             return client.post(util_1.Util.combinePaths(absoluteRequestUrl, "/_api/$batch"), batchOptions)
  1639.                 .then(function (r) { return r.text(); })
  1640.                 .then(_this._parseResponse)
  1641.                 .then(function (responses) {
  1642.                 if (responses.length !== _this._requests.length) {
  1643.                     throw new exceptions_1.BatchParseException("Could not properly parse responses to match requests in batch.");
  1644.                 }
  1645.                 logging_1.Logger.write("Resolving batched requests.", logging_1.LogLevel.Info);
  1646.                 return responses.reduce(function (chain, response, index) {
  1647.                     var request = _this._requests[index];
  1648.                     logging_1.Logger.write("Resolving request " + request.method + " " + request.url + ".", logging_1.LogLevel.Verbose);
  1649.                     return chain.then(function (_) { return request.parser.parse(response).then(request.resolve).catch(request.reject); });
  1650.                 }, Promise.resolve());
  1651.             });
  1652.         });
  1653.     };
  1654.     /**
  1655.      * Parses the response from a batch request into an array of Response instances
  1656.      *
  1657.      * @param body Text body of the response from the batch request
  1658.      */
  1659.     ODataBatch.prototype._parseResponse = function (body) {
  1660.         return new Promise(function (resolve, reject) {
  1661.             var responses = [];
  1662.             var header = "--batchresponse_";
  1663.             // Ex. "HTTP/1.1 500 Internal Server Error"
  1664.             var statusRegExp = new RegExp("^HTTP/[0-9.]+ +([0-9]+) +(.*)", "i");
  1665.             var lines = body.split("\n");
  1666.             var state = "batch";
  1667.             var status;
  1668.             var statusText;
  1669.             for (var i = 0; i < lines.length; ++i) {
  1670.                 var line = lines[i];
  1671.                 switch (state) {
  1672.                     case "batch":
  1673.                         if (line.substr(0, header.length) === header) {
  1674.                             state = "batchHeaders";
  1675.                         }
  1676.                         else {
  1677.                             if (line.trim() !== "") {
  1678.                                 throw new exceptions_1.BatchParseException("Invalid response, line " + i);
  1679.                             }
  1680.                         }
  1681.                         break;
  1682.                     case "batchHeaders":
  1683.                         if (line.trim() === "") {
  1684.                             state = "status";
  1685.                         }
  1686.                         break;
  1687.                     case "status":
  1688.                         var parts = statusRegExp.exec(line);
  1689.                         if (parts.length !== 3) {
  1690.                             throw new exceptions_1.BatchParseException("Invalid status, line " + i);
  1691.                         }
  1692.                         status = parseInt(parts[1], 10);
  1693.                         statusText = parts[2];
  1694.                         state = "statusHeaders";
  1695.                         break;
  1696.                     case "statusHeaders":
  1697.                         if (line.trim() === "") {
  1698.                             state = "body";
  1699.                         }
  1700.                         break;
  1701.                     case "body":
  1702.                         responses.push((status === 204) ? new Response() : new Response(line, { status: status, statusText: statusText }));
  1703.                         state = "batch";
  1704.                         break;
  1705.                 }
  1706.             }
  1707.             if (state !== "status") {
  1708.                 reject(new exceptions_1.BatchParseException("Unexpected end of input"));
  1709.             }
  1710.             resolve(responses);
  1711.         });
  1712.     };
  1713.     return ODataBatch;
  1714. }());
  1715. exports.ODataBatch = ODataBatch;
  1716. var TextFileParser = (function () {
  1717.     function TextFileParser() {
  1718.     }
  1719.     TextFileParser.prototype.parse = function (r) {
  1720.         return r.text();
  1721.     };
  1722.     return TextFileParser;
  1723. }());
  1724. exports.TextFileParser = TextFileParser;
  1725. var BlobFileParser = (function () {
  1726.     function BlobFileParser() {
  1727.     }
  1728.     BlobFileParser.prototype.parse = function (r) {
  1729.         return r.blob();
  1730.     };
  1731.     return BlobFileParser;
  1732. }());
  1733. exports.BlobFileParser = BlobFileParser;
  1734. var JSONFileParser = (function () {
  1735.     function JSONFileParser() {
  1736.     }
  1737.     JSONFileParser.prototype.parse = function (r) {
  1738.         return r.json();
  1739.     };
  1740.     return JSONFileParser;
  1741. }());
  1742. exports.JSONFileParser = JSONFileParser;
  1743. var BufferFileParser = (function () {
  1744.     function BufferFileParser() {
  1745.     }
  1746.     BufferFileParser.prototype.parse = function (r) {
  1747.         if (util_1.Util.isFunction(r.arrayBuffer)) {
  1748.             return r.arrayBuffer();
  1749.         }
  1750.         return r.buffer();
  1751.     };
  1752.     return BufferFileParser;
  1753. }());
  1754. exports.BufferFileParser = BufferFileParser;
  1755.  
  1756.  
  1757. /***/ }),
  1758. /* 3 */
  1759. /***/ (function(module, exports, __webpack_require__) {
  1760.  
  1761. "use strict";
  1762.  
  1763. var __extends = (this && this.__extends) || (function () {
  1764.     var extendStatics = Object.setPrototypeOf ||
  1765.         ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  1766.         function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  1767.     return function (d, b) {
  1768.         extendStatics(d, b);
  1769.         function __() { this.constructor = d; }
  1770.         d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  1771.     };
  1772. })();
  1773. Object.defineProperty(exports, "__esModule", { value: true });
  1774. var logging_1 = __webpack_require__(5);
  1775. function defaultLog(error) {
  1776.     logging_1.Logger.log({ data: {}, level: logging_1.LogLevel.Error, message: "[" + error.name + "]::" + error.message });
  1777. }
  1778. /**
  1779.  * Represents an exception with an HttpClient request
  1780.  *
  1781.  */
  1782. var ProcessHttpClientResponseException = (function (_super) {
  1783.     __extends(ProcessHttpClientResponseException, _super);
  1784.     function ProcessHttpClientResponseException(status, statusText, data) {
  1785.         var _this = _super.call(this, "Error making HttpClient request in queryable: [" + status + "] " + statusText) || this;
  1786.         _this.status = status;
  1787.         _this.statusText = statusText;
  1788.         _this.data = data;
  1789.         _this.name = "ProcessHttpClientResponseException";
  1790.         logging_1.Logger.log({ data: _this.data, level: logging_1.LogLevel.Error, message: _this.message });
  1791.         return _this;
  1792.     }
  1793.     return ProcessHttpClientResponseException;
  1794. }(Error));
  1795. exports.ProcessHttpClientResponseException = ProcessHttpClientResponseException;
  1796. var NoCacheAvailableException = (function (_super) {
  1797.     __extends(NoCacheAvailableException, _super);
  1798.     function NoCacheAvailableException(msg) {
  1799.         if (msg === void 0) { msg = "Cannot create a caching configuration provider since cache is not available."; }
  1800.         var _this = _super.call(this, msg) || this;
  1801.         _this.name = "NoCacheAvailableException";
  1802.         defaultLog(_this);
  1803.         return _this;
  1804.     }
  1805.     return NoCacheAvailableException;
  1806. }(Error));
  1807. exports.NoCacheAvailableException = NoCacheAvailableException;
  1808. var APIUrlException = (function (_super) {
  1809.     __extends(APIUrlException, _super);
  1810.     function APIUrlException(msg) {
  1811.         if (msg === void 0) { msg = "Unable to determine API url."; }
  1812.         var _this = _super.call(this, msg) || this;
  1813.         _this.name = "APIUrlException";
  1814.         defaultLog(_this);
  1815.         return _this;
  1816.     }
  1817.     return APIUrlException;
  1818. }(Error));
  1819. exports.APIUrlException = APIUrlException;
  1820. var AuthUrlException = (function (_super) {
  1821.     __extends(AuthUrlException, _super);
  1822.     function AuthUrlException(data, msg) {
  1823.         if (msg === void 0) { msg = "Auth URL Endpoint could not be determined from data. Data logged."; }
  1824.         var _this = _super.call(this, msg) || this;
  1825.         _this.name = "APIUrlException";
  1826.         logging_1.Logger.log({ data: data, level: logging_1.LogLevel.Error, message: _this.message });
  1827.         return _this;
  1828.     }
  1829.     return AuthUrlException;
  1830. }(Error));
  1831. exports.AuthUrlException = AuthUrlException;
  1832. var NodeFetchClientUnsupportedException = (function (_super) {
  1833.     __extends(NodeFetchClientUnsupportedException, _super);
  1834.     function NodeFetchClientUnsupportedException(msg) {
  1835.         if (msg === void 0) { msg = "Using NodeFetchClient in the browser is not supported."; }
  1836.         var _this = _super.call(this, msg) || this;
  1837.         _this.name = "NodeFetchClientUnsupportedException";
  1838.         defaultLog(_this);
  1839.         return _this;
  1840.     }
  1841.     return NodeFetchClientUnsupportedException;
  1842. }(Error));
  1843. exports.NodeFetchClientUnsupportedException = NodeFetchClientUnsupportedException;
  1844. var SPRequestExecutorUndefinedException = (function (_super) {
  1845.     __extends(SPRequestExecutorUndefinedException, _super);
  1846.     function SPRequestExecutorUndefinedException() {
  1847.         var _this = this;
  1848.         var msg = [
  1849.             "SP.RequestExecutor is undefined. ",
  1850.             "Load the SP.RequestExecutor.js library (/_layouts/15/SP.RequestExecutor.js) before loading the PnP JS Core library.",
  1851.         ].join(" ");
  1852.         _this = _super.call(this, msg) || this;
  1853.         _this.name = "SPRequestExecutorUndefinedException";
  1854.         defaultLog(_this);
  1855.         return _this;
  1856.     }
  1857.     return SPRequestExecutorUndefinedException;
  1858. }(Error));
  1859. exports.SPRequestExecutorUndefinedException = SPRequestExecutorUndefinedException;
  1860. var MaxCommentLengthException = (function (_super) {
  1861.     __extends(MaxCommentLengthException, _super);
  1862.     function MaxCommentLengthException(msg) {
  1863.         if (msg === void 0) { msg = "The maximum comment length is 1023 characters."; }
  1864.         var _this = _super.call(this, msg) || this;
  1865.         _this.name = "MaxCommentLengthException";
  1866.         defaultLog(_this);
  1867.         return _this;
  1868.     }
  1869.     return MaxCommentLengthException;
  1870. }(Error));
  1871. exports.MaxCommentLengthException = MaxCommentLengthException;
  1872. var NotSupportedInBatchException = (function (_super) {
  1873.     __extends(NotSupportedInBatchException, _super);
  1874.     function NotSupportedInBatchException(operation) {
  1875.         if (operation === void 0) { operation = "This operation"; }
  1876.         var _this = _super.call(this, operation + " is not supported as part of a batch.") || this;
  1877.         _this.name = "NotSupportedInBatchException";
  1878.         defaultLog(_this);
  1879.         return _this;
  1880.     }
  1881.     return NotSupportedInBatchException;
  1882. }(Error));
  1883. exports.NotSupportedInBatchException = NotSupportedInBatchException;
  1884. var ODataIdException = (function (_super) {
  1885.     __extends(ODataIdException, _super);
  1886.     function ODataIdException(data, msg) {
  1887.         if (msg === void 0) { msg = "Could not extract odata id in object, you may be using nometadata. Object data logged to logger."; }
  1888.         var _this = _super.call(this, msg) || this;
  1889.         _this.name = "ODataIdException";
  1890.         logging_1.Logger.log({ data: data, level: logging_1.LogLevel.Error, message: _this.message });
  1891.         return _this;
  1892.     }
  1893.     return ODataIdException;
  1894. }(Error));
  1895. exports.ODataIdException = ODataIdException;
  1896. var BatchParseException = (function (_super) {
  1897.     __extends(BatchParseException, _super);
  1898.     function BatchParseException(msg) {
  1899.         var _this = _super.call(this, msg) || this;
  1900.         _this.name = "BatchParseException";
  1901.         defaultLog(_this);
  1902.         return _this;
  1903.     }
  1904.     return BatchParseException;
  1905. }(Error));
  1906. exports.BatchParseException = BatchParseException;
  1907. var AlreadyInBatchException = (function (_super) {
  1908.     __extends(AlreadyInBatchException, _super);
  1909.     function AlreadyInBatchException(msg) {
  1910.         if (msg === void 0) { msg = "This query is already part of a batch."; }
  1911.         var _this = _super.call(this, msg) || this;
  1912.         _this.name = "AlreadyInBatchException";
  1913.         defaultLog(_this);
  1914.         return _this;
  1915.     }
  1916.     return AlreadyInBatchException;
  1917. }(Error));
  1918. exports.AlreadyInBatchException = AlreadyInBatchException;
  1919. var FunctionExpectedException = (function (_super) {
  1920.     __extends(FunctionExpectedException, _super);
  1921.     function FunctionExpectedException(msg) {
  1922.         if (msg === void 0) { msg = "This query is already part of a batch."; }
  1923.         var _this = _super.call(this, msg) || this;
  1924.         _this.name = "FunctionExpectedException";
  1925.         defaultLog(_this);
  1926.         return _this;
  1927.     }
  1928.     return FunctionExpectedException;
  1929. }(Error));
  1930. exports.FunctionExpectedException = FunctionExpectedException;
  1931. var UrlException = (function (_super) {
  1932.     __extends(UrlException, _super);
  1933.     function UrlException(msg) {
  1934.         var _this = _super.call(this, msg) || this;
  1935.         _this.name = "UrlException";
  1936.         defaultLog(_this);
  1937.         return _this;
  1938.     }
  1939.     return UrlException;
  1940. }(Error));
  1941. exports.UrlException = UrlException;
  1942.  
  1943.  
  1944. /***/ }),
  1945. /* 4 */
  1946. /***/ (function(module, exports, __webpack_require__) {
  1947.  
  1948. "use strict";
  1949.  
  1950. Object.defineProperty(exports, "__esModule", { value: true });
  1951. var fetchclient_1 = __webpack_require__(21);
  1952. var RuntimeConfigImpl = (function () {
  1953.     function RuntimeConfigImpl() {
  1954.         // these are our default values for the library
  1955.         this._headers = null;
  1956.         this._defaultCachingStore = "session";
  1957.         this._defaultCachingTimeoutSeconds = 60;
  1958.         this._globalCacheDisable = false;
  1959.         this._fetchClientFactory = function () { return new fetchclient_1.FetchClient(); };
  1960.         this._baseUrl = null;
  1961.         this._spfxContext = null;
  1962.     }
  1963.     RuntimeConfigImpl.prototype.set = function (config) {
  1964.         if (config.hasOwnProperty("headers")) {
  1965.             this._headers = config.headers;
  1966.         }
  1967.         if (config.hasOwnProperty("globalCacheDisable")) {
  1968.             this._globalCacheDisable = config.globalCacheDisable;
  1969.         }
  1970.         if (config.hasOwnProperty("defaultCachingStore")) {
  1971.             this._defaultCachingStore = config.defaultCachingStore;
  1972.         }
  1973.         if (config.hasOwnProperty("defaultCachingTimeoutSeconds")) {
  1974.             this._defaultCachingTimeoutSeconds = config.defaultCachingTimeoutSeconds;
  1975.         }
  1976.         if (config.hasOwnProperty("fetchClientFactory")) {
  1977.             this._fetchClientFactory = config.fetchClientFactory;
  1978.         }
  1979.         if (config.hasOwnProperty("baseUrl")) {
  1980.             this._baseUrl = config.baseUrl;
  1981.         }
  1982.         if (config.hasOwnProperty("spFXContext")) {
  1983.             this._spfxContext = config.spfxContext;
  1984.         }
  1985.     };
  1986.     Object.defineProperty(RuntimeConfigImpl.prototype, "headers", {
  1987.         get: function () {
  1988.             return this._headers;
  1989.         },
  1990.         enumerable: true,
  1991.         configurable: true
  1992.     });
  1993.     Object.defineProperty(RuntimeConfigImpl.prototype, "defaultCachingStore", {
  1994.         get: function () {
  1995.             return this._defaultCachingStore;
  1996.         },
  1997.         enumerable: true,
  1998.         configurable: true
  1999.     });
  2000.     Object.defineProperty(RuntimeConfigImpl.prototype, "defaultCachingTimeoutSeconds", {
  2001.         get: function () {
  2002.             return this._defaultCachingTimeoutSeconds;
  2003.         },
  2004.         enumerable: true,
  2005.         configurable: true
  2006.     });
  2007.     Object.defineProperty(RuntimeConfigImpl.prototype, "globalCacheDisable", {
  2008.         get: function () {
  2009.             return this._globalCacheDisable;
  2010.         },
  2011.         enumerable: true,
  2012.         configurable: true
  2013.     });
  2014.     Object.defineProperty(RuntimeConfigImpl.prototype, "fetchClientFactory", {
  2015.         get: function () {
  2016.             return this._fetchClientFactory;
  2017.         },
  2018.         enumerable: true,
  2019.         configurable: true
  2020.     });
  2021.     Object.defineProperty(RuntimeConfigImpl.prototype, "baseUrl", {
  2022.         get: function () {
  2023.             if (this._baseUrl !== null) {
  2024.                 return this._baseUrl;
  2025.             }
  2026.             else if (this._spfxContext !== null) {
  2027.                 return this._spfxContext.pageContext.web.absoluteUrl;
  2028.             }
  2029.             return null;
  2030.         },
  2031.         enumerable: true,
  2032.         configurable: true
  2033.     });
  2034.     return RuntimeConfigImpl;
  2035. }());
  2036. exports.RuntimeConfigImpl = RuntimeConfigImpl;
  2037. var _runtimeConfig = new RuntimeConfigImpl();
  2038. exports.RuntimeConfig = _runtimeConfig;
  2039. function setRuntimeConfig(config) {
  2040.     _runtimeConfig.set(config);
  2041. }
  2042. exports.setRuntimeConfig = setRuntimeConfig;
  2043.  
  2044.  
  2045. /***/ }),
  2046. /* 5 */
  2047. /***/ (function(module, exports, __webpack_require__) {
  2048.  
  2049. "use strict";
  2050.  
  2051. Object.defineProperty(exports, "__esModule", { value: true });
  2052. /**
  2053.  * A set of logging levels
  2054.  *
  2055.  */
  2056. var LogLevel;
  2057. (function (LogLevel) {
  2058.     LogLevel[LogLevel["Verbose"] = 0] = "Verbose";
  2059.     LogLevel[LogLevel["Info"] = 1] = "Info";
  2060.     LogLevel[LogLevel["Warning"] = 2] = "Warning";
  2061.     LogLevel[LogLevel["Error"] = 3] = "Error";
  2062.     LogLevel[LogLevel["Off"] = 99] = "Off";
  2063. })(LogLevel = exports.LogLevel || (exports.LogLevel = {}));
  2064. /**
  2065.  * Class used to subscribe ILogListener and log messages throughout an application
  2066.  *
  2067.  */
  2068. var Logger = (function () {
  2069.     function Logger() {
  2070.     }
  2071.     Object.defineProperty(Logger, "activeLogLevel", {
  2072.         get: function () {
  2073.             return Logger.instance.activeLogLevel;
  2074.         },
  2075.         set: function (value) {
  2076.             Logger.instance.activeLogLevel = value;
  2077.         },
  2078.         enumerable: true,
  2079.         configurable: true
  2080.     });
  2081.     Object.defineProperty(Logger, "instance", {
  2082.         get: function () {
  2083.             if (typeof Logger._instance === "undefined" || Logger._instance === null) {
  2084.                 Logger._instance = new LoggerImpl();
  2085.             }
  2086.             return Logger._instance;
  2087.         },
  2088.         enumerable: true,
  2089.         configurable: true
  2090.     });
  2091.     /**
  2092.      * Adds ILogListener instances to the set of subscribed listeners
  2093.      *
  2094.      * @param listeners One or more listeners to subscribe to this log
  2095.      */
  2096.     Logger.subscribe = function () {
  2097.         var listeners = [];
  2098.         for (var _i = 0; _i < arguments.length; _i++) {
  2099.             listeners[_i] = arguments[_i];
  2100.         }
  2101.         listeners.map(function (listener) { return Logger.instance.subscribe(listener); });
  2102.     };
  2103.     /**
  2104.      * Clears the subscribers collection, returning the collection before modifiction
  2105.      */
  2106.     Logger.clearSubscribers = function () {
  2107.         return Logger.instance.clearSubscribers();
  2108.     };
  2109.     Object.defineProperty(Logger, "count", {
  2110.         /**
  2111.          * Gets the current subscriber count
  2112.          */
  2113.         get: function () {
  2114.             return Logger.instance.count;
  2115.         },
  2116.         enumerable: true,
  2117.         configurable: true
  2118.     });
  2119.     /**
  2120.      * Writes the supplied string to the subscribed listeners
  2121.      *
  2122.      * @param message The message to write
  2123.      * @param level [Optional] if supplied will be used as the level of the entry (Default: LogLevel.Verbose)
  2124.      */
  2125.     Logger.write = function (message, level) {
  2126.         if (level === void 0) { level = LogLevel.Verbose; }
  2127.         Logger.instance.log({ level: level, message: message });
  2128.     };
  2129.     /**
  2130.      * Writes the supplied string to the subscribed listeners
  2131.      *
  2132.      * @param json The json object to stringify and write
  2133.      * @param level [Optional] if supplied will be used as the level of the entry (Default: LogLevel.Verbose)
  2134.      */
  2135.     Logger.writeJSON = function (json, level) {
  2136.         if (level === void 0) { level = LogLevel.Verbose; }
  2137.         Logger.instance.log({ level: level, message: JSON.stringify(json) });
  2138.     };
  2139.     /**
  2140.      * Logs the supplied entry to the subscribed listeners
  2141.      *
  2142.      * @param entry The message to log
  2143.      */
  2144.     Logger.log = function (entry) {
  2145.         Logger.instance.log(entry);
  2146.     };
  2147.     /**
  2148.      * Logs performance tracking data for the the execution duration of the supplied function using console.profile
  2149.      *
  2150.      * @param name The name of this profile boundary
  2151.      * @param f The function to execute and track within this performance boundary
  2152.      */
  2153.     Logger.measure = function (name, f) {
  2154.         return Logger.instance.measure(name, f);
  2155.     };
  2156.     return Logger;
  2157. }());
  2158. exports.Logger = Logger;
  2159. var LoggerImpl = (function () {
  2160.     function LoggerImpl(activeLogLevel, subscribers) {
  2161.         if (activeLogLevel === void 0) { activeLogLevel = LogLevel.Warning; }
  2162.         if (subscribers === void 0) { subscribers = []; }
  2163.         this.activeLogLevel = activeLogLevel;
  2164.         this.subscribers = subscribers;
  2165.     }
  2166.     LoggerImpl.prototype.subscribe = function (listener) {
  2167.         this.subscribers.push(listener);
  2168.     };
  2169.     LoggerImpl.prototype.clearSubscribers = function () {
  2170.         var s = this.subscribers.slice(0);
  2171.         this.subscribers.length = 0;
  2172.         return s;
  2173.     };
  2174.     Object.defineProperty(LoggerImpl.prototype, "count", {
  2175.         get: function () {
  2176.             return this.subscribers.length;
  2177.         },
  2178.         enumerable: true,
  2179.         configurable: true
  2180.     });
  2181.     LoggerImpl.prototype.write = function (message, level) {
  2182.         if (level === void 0) { level = LogLevel.Verbose; }
  2183.         this.log({ level: level, message: message });
  2184.     };
  2185.     LoggerImpl.prototype.log = function (entry) {
  2186.         if (typeof entry === "undefined" || entry.level < this.activeLogLevel) {
  2187.             return;
  2188.         }
  2189.         this.subscribers.map(function (subscriber) { return subscriber.log(entry); });
  2190.     };
  2191.     LoggerImpl.prototype.measure = function (name, f) {
  2192.         console.profile(name);
  2193.         try {
  2194.             return f();
  2195.         }
  2196.         finally {
  2197.             console.profileEnd();
  2198.         }
  2199.     };
  2200.     return LoggerImpl;
  2201. }());
  2202. /**
  2203.  * Implementation of ILogListener which logs to the browser console
  2204.  *
  2205.  */
  2206. var ConsoleListener = (function () {
  2207.     function ConsoleListener() {
  2208.     }
  2209.     /**
  2210.      * Any associated data that a given logging listener may choose to log or ignore
  2211.      *
  2212.      * @param entry The information to be logged
  2213.      */
  2214.     ConsoleListener.prototype.log = function (entry) {
  2215.         var msg = this.format(entry);
  2216.         switch (entry.level) {
  2217.             case LogLevel.Verbose:
  2218.             case LogLevel.Info:
  2219.                 console.log(msg);
  2220.                 break;
  2221.             case LogLevel.Warning:
  2222.                 console.warn(msg);
  2223.                 break;
  2224.             case LogLevel.Error:
  2225.                 console.error(msg);
  2226.                 break;
  2227.         }
  2228.     };
  2229.     /**
  2230.      * Formats the message
  2231.      *
  2232.      * @param entry The information to format into a string
  2233.      */
  2234.     ConsoleListener.prototype.format = function (entry) {
  2235.         return "Message: " + entry.message + " Data: " + JSON.stringify(entry.data);
  2236.     };
  2237.     return ConsoleListener;
  2238. }());
  2239. exports.ConsoleListener = ConsoleListener;
  2240. /**
  2241.  * Implementation of ILogListener which logs to the supplied function
  2242.  *
  2243.  */
  2244. var FunctionListener = (function () {
  2245.     /**
  2246.      * Creates a new instance of the FunctionListener class
  2247.      *
  2248.      * @constructor
  2249.      * @param  method The method to which any logging data will be passed
  2250.      */
  2251.     function FunctionListener(method) {
  2252.         this.method = method;
  2253.     }
  2254.     /**
  2255.      * Any associated data that a given logging listener may choose to log or ignore
  2256.      *
  2257.      * @param entry The information to be logged
  2258.      */
  2259.     FunctionListener.prototype.log = function (entry) {
  2260.         this.method(entry);
  2261.     };
  2262.     return FunctionListener;
  2263. }());
  2264. exports.FunctionListener = FunctionListener;
  2265.  
  2266.  
  2267. /***/ }),
  2268. /* 6 */
  2269. /***/ (function(module, exports, __webpack_require__) {
  2270.  
  2271. "use strict";
  2272.  
  2273. Object.defineProperty(exports, "__esModule", { value: true });
  2274. /**
  2275.  * Generic dictionary
  2276.  */
  2277. var Dictionary = (function () {
  2278.     /**
  2279.      * Creates a new instance of the Dictionary<T> class
  2280.      *
  2281.      * @constructor
  2282.      */
  2283.     function Dictionary(keys, values) {
  2284.         if (keys === void 0) { keys = []; }
  2285.         if (values === void 0) { values = []; }
  2286.         this.keys = keys;
  2287.         this.values = values;
  2288.     }
  2289.     /**
  2290.      * Gets a value from the collection using the specified key
  2291.      *
  2292.      * @param key The key whose value we want to return, returns null if the key does not exist
  2293.      */
  2294.     Dictionary.prototype.get = function (key) {
  2295.         var index = this.keys.indexOf(key);
  2296.         if (index < 0) {
  2297.             return null;
  2298.         }
  2299.         return this.values[index];
  2300.     };
  2301.     /**
  2302.      * Adds the supplied key and value to the dictionary
  2303.      *
  2304.      * @param key The key to add
  2305.      * @param o The value to add
  2306.      */
  2307.     Dictionary.prototype.add = function (key, o) {
  2308.         var index = this.keys.indexOf(key);
  2309.         if (index > -1) {
  2310.             this.values[index] = o;
  2311.         }
  2312.         else {
  2313.             this.keys.push(key);
  2314.             this.values.push(o);
  2315.         }
  2316.     };
  2317.     /**
  2318.      * Merges the supplied typed hash into this dictionary instance. Existing values are updated and new ones are created as appropriate.
  2319.      */
  2320.     Dictionary.prototype.merge = function (source) {
  2321.         var _this = this;
  2322.         if ("getKeys" in source) {
  2323.             var sourceAsDictionary_1 = source;
  2324.             sourceAsDictionary_1.getKeys().map(function (key) {
  2325.                 _this.add(key, sourceAsDictionary_1.get(key));
  2326.             });
  2327.         }
  2328.         else {
  2329.             var sourceAsHash = source;
  2330.             for (var key in sourceAsHash) {
  2331.                 if (sourceAsHash.hasOwnProperty(key)) {
  2332.                     this.add(key, sourceAsHash[key]);
  2333.                 }
  2334.             }
  2335.         }
  2336.     };
  2337.     /**
  2338.      * Removes a value from the dictionary
  2339.      *
  2340.      * @param key The key of the key/value pair to remove. Returns null if the key was not found.
  2341.      */
  2342.     Dictionary.prototype.remove = function (key) {
  2343.         var index = this.keys.indexOf(key);
  2344.         if (index < 0) {
  2345.             return null;
  2346.         }
  2347.         var val = this.values[index];
  2348.         this.keys.splice(index, 1);
  2349.         this.values.splice(index, 1);
  2350.         return val;
  2351.     };
  2352.     /**
  2353.      * Returns all the keys currently in the dictionary as an array
  2354.      */
  2355.     Dictionary.prototype.getKeys = function () {
  2356.         return this.keys;
  2357.     };
  2358.     /**
  2359.      * Returns all the values currently in the dictionary as an array
  2360.      */
  2361.     Dictionary.prototype.getValues = function () {
  2362.         return this.values;
  2363.     };
  2364.     /**
  2365.      * Clears the current dictionary
  2366.      */
  2367.     Dictionary.prototype.clear = function () {
  2368.         this.keys = [];
  2369.         this.values = [];
  2370.     };
  2371.     /**
  2372.      * Gets a count of the items currently in the dictionary
  2373.      */
  2374.     Dictionary.prototype.count = function () {
  2375.         return this.keys.length;
  2376.     };
  2377.     return Dictionary;
  2378. }());
  2379. exports.Dictionary = Dictionary;
  2380.  
  2381.  
  2382. /***/ }),
  2383. /* 7 */
  2384. /***/ (function(module, exports, __webpack_require__) {
  2385.  
  2386. "use strict";
  2387.  
  2388. var __extends = (this && this.__extends) || (function () {
  2389.     var extendStatics = Object.setPrototypeOf ||
  2390.         ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  2391.         function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  2392.     return function (d, b) {
  2393.         extendStatics(d, b);
  2394.         function __() { this.constructor = d; }
  2395.         d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  2396.     };
  2397. })();
  2398. var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
  2399.     var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  2400.     if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  2401.     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;
  2402.     return c > 3 && r && Object.defineProperty(target, key, r), r;
  2403. };
  2404. Object.defineProperty(exports, "__esModule", { value: true });
  2405. var queryable_1 = __webpack_require__(1);
  2406. var lists_1 = __webpack_require__(11);
  2407. var fields_1 = __webpack_require__(24);
  2408. var navigation_1 = __webpack_require__(25);
  2409. var sitegroups_1 = __webpack_require__(18);
  2410. var contenttypes_1 = __webpack_require__(16);
  2411. var folders_1 = __webpack_require__(9);
  2412. var roles_1 = __webpack_require__(17);
  2413. var files_1 = __webpack_require__(8);
  2414. var util_1 = __webpack_require__(0);
  2415. var lists_2 = __webpack_require__(11);
  2416. var siteusers_1 = __webpack_require__(30);
  2417. var usercustomactions_1 = __webpack_require__(19);
  2418. var odata_1 = __webpack_require__(2);
  2419. var features_1 = __webpack_require__(23);
  2420. var decorators_1 = __webpack_require__(31);
  2421. var queryableshareable_1 = __webpack_require__(12);
  2422. var relateditems_1 = __webpack_require__(46);
  2423. var Webs = (function (_super) {
  2424.     __extends(Webs, _super);
  2425.     function Webs(baseUrl, webPath) {
  2426.         if (webPath === void 0) { webPath = "webs"; }
  2427.         return _super.call(this, baseUrl, webPath) || this;
  2428.     }
  2429.     /**
  2430.      * Adds a new web to the collection
  2431.      *
  2432.      * @param title The new web's title
  2433.      * @param url The new web's relative url
  2434.      * @param description The web web's description
  2435.      * @param template The web's template
  2436.      * @param language The language code to use for this web
  2437.      * @param inheritPermissions If true permissions will be inherited from the partent web
  2438.      * @param additionalSettings Will be passed as part of the web creation body
  2439.      */
  2440.     Webs.prototype.add = function (title, url, description, template, language, inheritPermissions, additionalSettings) {
  2441.         if (description === void 0) { description = ""; }
  2442.         if (template === void 0) { template = "STS"; }
  2443.         if (language === void 0) { language = 1033; }
  2444.         if (inheritPermissions === void 0) { inheritPermissions = true; }
  2445.         if (additionalSettings === void 0) { additionalSettings = {}; }
  2446.         var props = util_1.Util.extend({
  2447.             Description: description,
  2448.             Language: language,
  2449.             Title: title,
  2450.             Url: url,
  2451.             UseSamePermissionsAsParentSite: inheritPermissions,
  2452.             WebTemplate: template,
  2453.         }, additionalSettings);
  2454.         var postBody = JSON.stringify({
  2455.             "parameters": util_1.Util.extend({
  2456.                 "__metadata": { "type": "SP.WebCreationInformation" },
  2457.             }, props),
  2458.         });
  2459.         return this.clone(Webs, "add", true).post({ body: postBody }).then(function (data) {
  2460.             return {
  2461.                 data: data,
  2462.                 web: new Web(odata_1.extractOdataId(data).replace(/_api\/web\/?/i, "")),
  2463.             };
  2464.         });
  2465.     };
  2466.     return Webs;
  2467. }(queryable_1.QueryableCollection));
  2468. exports.Webs = Webs;
  2469. /**
  2470.  * Describes a web
  2471.  *
  2472.  */
  2473. var Web = (function (_super) {
  2474.     __extends(Web, _super);
  2475.     function Web(baseUrl, path) {
  2476.         if (path === void 0) { path = "_api/web"; }
  2477.         return _super.call(this, baseUrl, path) || this;
  2478.     }
  2479.     /**
  2480.      * Creates a new web instance from the given url by indexing the location of the /_api/
  2481.      * segment. If this is not found the method creates a new web with the entire string as
  2482.      * supplied.
  2483.      *
  2484.      * @param url
  2485.      */
  2486.     Web.fromUrl = function (url, path) {
  2487.         if (url === null) {
  2488.             return new Web("");
  2489.         }
  2490.         var index = url.indexOf("_api/");
  2491.         if (index > -1) {
  2492.             return new Web(url.substr(0, index), path);
  2493.         }
  2494.         return new Web(url, path);
  2495.     };
  2496.     Object.defineProperty(Web.prototype, "webs", {
  2497.         get: function () {
  2498.             return new Webs(this);
  2499.         },
  2500.         enumerable: true,
  2501.         configurable: true
  2502.     });
  2503.     Object.defineProperty(Web.prototype, "contentTypes", {
  2504.         /**
  2505.          * Get the content types available in this web
  2506.          *
  2507.          */
  2508.         get: function () {
  2509.             return new contenttypes_1.ContentTypes(this);
  2510.         },
  2511.         enumerable: true,
  2512.         configurable: true
  2513.     });
  2514.     Object.defineProperty(Web.prototype, "lists", {
  2515.         /**
  2516.          * Get the lists in this web
  2517.          *
  2518.          */
  2519.         get: function () {
  2520.             return new lists_1.Lists(this);
  2521.         },
  2522.         enumerable: true,
  2523.         configurable: true
  2524.     });
  2525.     Object.defineProperty(Web.prototype, "fields", {
  2526.         /**
  2527.          * Gets the fields in this web
  2528.          *
  2529.          */
  2530.         get: function () {
  2531.             return new fields_1.Fields(this);
  2532.         },
  2533.         enumerable: true,
  2534.         configurable: true
  2535.     });
  2536.     Object.defineProperty(Web.prototype, "features", {
  2537.         /**
  2538.          * Gets the active features for this web
  2539.          *
  2540.          */
  2541.         get: function () {
  2542.             return new features_1.Features(this);
  2543.         },
  2544.         enumerable: true,
  2545.         configurable: true
  2546.     });
  2547.     Object.defineProperty(Web.prototype, "availablefields", {
  2548.         /**
  2549.          * Gets the available fields in this web
  2550.          *
  2551.          */
  2552.         get: function () {
  2553.             return new fields_1.Fields(this, "availablefields");
  2554.         },
  2555.         enumerable: true,
  2556.         configurable: true
  2557.     });
  2558.     Object.defineProperty(Web.prototype, "navigation", {
  2559.         /**
  2560.          * Get the navigation options in this web
  2561.          *
  2562.          */
  2563.         get: function () {
  2564.             return new navigation_1.Navigation(this);
  2565.         },
  2566.         enumerable: true,
  2567.         configurable: true
  2568.     });
  2569.     Object.defineProperty(Web.prototype, "siteUsers", {
  2570.         /**
  2571.          * Gets the site users
  2572.          *
  2573.          */
  2574.         get: function () {
  2575.             return new siteusers_1.SiteUsers(this);
  2576.         },
  2577.         enumerable: true,
  2578.         configurable: true
  2579.     });
  2580.     Object.defineProperty(Web.prototype, "siteGroups", {
  2581.         /**
  2582.          * Gets the site groups
  2583.          *
  2584.          */
  2585.         get: function () {
  2586.             return new sitegroups_1.SiteGroups(this);
  2587.         },
  2588.         enumerable: true,
  2589.         configurable: true
  2590.     });
  2591.     Object.defineProperty(Web.prototype, "currentUser", {
  2592.         /**
  2593.          * Gets the current user
  2594.          */
  2595.         get: function () {
  2596.             return new siteusers_1.CurrentUser(this);
  2597.         },
  2598.         enumerable: true,
  2599.         configurable: true
  2600.     });
  2601.     Object.defineProperty(Web.prototype, "folders", {
  2602.         /**
  2603.          * Get the folders in this web
  2604.          *
  2605.          */
  2606.         get: function () {
  2607.             return new folders_1.Folders(this);
  2608.         },
  2609.         enumerable: true,
  2610.         configurable: true
  2611.     });
  2612.     Object.defineProperty(Web.prototype, "userCustomActions", {
  2613.         /**
  2614.          * Get all custom actions on a site
  2615.          *
  2616.          */
  2617.         get: function () {
  2618.             return new usercustomactions_1.UserCustomActions(this);
  2619.         },
  2620.         enumerable: true,
  2621.         configurable: true
  2622.     });
  2623.     Object.defineProperty(Web.prototype, "roleDefinitions", {
  2624.         /**
  2625.          * Gets the collection of RoleDefinition resources.
  2626.          *
  2627.          */
  2628.         get: function () {
  2629.             return new roles_1.RoleDefinitions(this);
  2630.         },
  2631.         enumerable: true,
  2632.         configurable: true
  2633.     });
  2634.     Object.defineProperty(Web.prototype, "relatedItems", {
  2635.         /**
  2636.          * Provides an interface to manage related items
  2637.          *
  2638.          */
  2639.         get: function () {
  2640.             return relateditems_1.RelatedItemManagerImpl.FromUrl(this.toUrl());
  2641.         },
  2642.         enumerable: true,
  2643.         configurable: true
  2644.     });
  2645.     /**
  2646.      * Creates a new batch for requests within the context of context this web
  2647.      *
  2648.      */
  2649.     Web.prototype.createBatch = function () {
  2650.         return new odata_1.ODataBatch(this.parentUrl);
  2651.     };
  2652.     Object.defineProperty(Web.prototype, "rootFolder", {
  2653.         /**
  2654.          * The root folder of the web
  2655.          */
  2656.         get: function () {
  2657.             return new folders_1.Folder(this, "rootFolder");
  2658.         },
  2659.         enumerable: true,
  2660.         configurable: true
  2661.     });
  2662.     Object.defineProperty(Web.prototype, "associatedOwnerGroup", {
  2663.         get: function () {
  2664.             return new sitegroups_1.SiteGroup(this, "associatedownergroup");
  2665.         },
  2666.         enumerable: true,
  2667.         configurable: true
  2668.     });
  2669.     Object.defineProperty(Web.prototype, "associatedMemberGroup", {
  2670.         get: function () {
  2671.             return new sitegroups_1.SiteGroup(this, "associatedmembergroup");
  2672.         },
  2673.         enumerable: true,
  2674.         configurable: true
  2675.     });
  2676.     Object.defineProperty(Web.prototype, "associatedVisitorGroup", {
  2677.         get: function () {
  2678.             return new sitegroups_1.SiteGroup(this, "associatedvisitorgroup");
  2679.         },
  2680.         enumerable: true,
  2681.         configurable: true
  2682.     });
  2683.     /**
  2684.      * Get a folder by server relative url
  2685.      *
  2686.      * @param folderRelativeUrl the server relative path to the folder (including /sites/ if applicable)
  2687.      */
  2688.     Web.prototype.getFolderByServerRelativeUrl = function (folderRelativeUrl) {
  2689.         return new folders_1.Folder(this, "getFolderByServerRelativeUrl('" + folderRelativeUrl + "')");
  2690.     };
  2691.     /**
  2692.      * Get a file by server relative url
  2693.      *
  2694.      * @param fileRelativeUrl the server relative path to the file (including /sites/ if applicable)
  2695.      */
  2696.     Web.prototype.getFileByServerRelativeUrl = function (fileRelativeUrl) {
  2697.         return new files_1.File(this, "getFileByServerRelativeUrl('" + fileRelativeUrl + "')");
  2698.     };
  2699.     /**
  2700.      * Get a list by server relative url (list's root folder)
  2701.      *
  2702.      * @param listRelativeUrl the server relative path to the list's root folder (including /sites/ if applicable)
  2703.      */
  2704.     Web.prototype.getList = function (listRelativeUrl) {
  2705.         return new lists_2.List(this, "getList('" + listRelativeUrl + "')");
  2706.     };
  2707.     /**
  2708.      * Updates this web intance with the supplied properties
  2709.      *
  2710.      * @param properties A plain object hash of values to update for the web
  2711.      */
  2712.     Web.prototype.update = function (properties) {
  2713.         var _this = this;
  2714.         var postBody = JSON.stringify(util_1.Util.extend({
  2715.             "__metadata": { "type": "SP.Web" },
  2716.         }, properties));
  2717.         return this.post({
  2718.             body: postBody,
  2719.             headers: {
  2720.                 "X-HTTP-Method": "MERGE",
  2721.             },
  2722.         }).then(function (data) {
  2723.             return {
  2724.                 data: data,
  2725.                 web: _this,
  2726.             };
  2727.         });
  2728.     };
  2729.     /**
  2730.      * Delete this web
  2731.      *
  2732.      */
  2733.     Web.prototype.delete = function () {
  2734.         return _super.prototype.delete.call(this);
  2735.     };
  2736.     /**
  2737.      * Applies the theme specified by the contents of each of the files specified in the arguments to the site.
  2738.      *
  2739.      * @param colorPaletteUrl Server-relative URL of the color palette file.
  2740.      * @param fontSchemeUrl Server-relative URL of the font scheme.
  2741.      * @param backgroundImageUrl Server-relative URL of the background image.
  2742.      * @param shareGenerated true to store the generated theme files in the root site, or false to store them in this site.
  2743.      */
  2744.     Web.prototype.applyTheme = function (colorPaletteUrl, fontSchemeUrl, backgroundImageUrl, shareGenerated) {
  2745.         var postBody = JSON.stringify({
  2746.             backgroundImageUrl: backgroundImageUrl,
  2747.             colorPaletteUrl: colorPaletteUrl,
  2748.             fontSchemeUrl: fontSchemeUrl,
  2749.             shareGenerated: shareGenerated,
  2750.         });
  2751.         return this.clone(Web, "applytheme", true).post({ body: postBody });
  2752.     };
  2753.     /**
  2754.      * Applies the specified site definition or site template to the Web site that has no template applied to it.
  2755.      *
  2756.      * @param template Name of the site definition or the name of the site template
  2757.      */
  2758.     Web.prototype.applyWebTemplate = function (template) {
  2759.         var q = this.clone(Web, "applywebtemplate", true);
  2760.         q.concat("(@t)");
  2761.         q.query.add("@t", template);
  2762.         return q.post();
  2763.     };
  2764.     /**
  2765.      * Returns whether the current user has the given set of permissions.
  2766.      *
  2767.      * @param perms The high and low permission range.
  2768.      */
  2769.     Web.prototype.doesUserHavePermissions = function (perms) {
  2770.         var q = this.clone(Web, "doesuserhavepermissions", true);
  2771.         q.concat("(@p)");
  2772.         q.query.add("@p", JSON.stringify(perms));
  2773.         return q.get();
  2774.     };
  2775.     /**
  2776.      * Checks whether the specified login name belongs to a valid user in the site. If the user doesn't exist, adds the user to the site.
  2777.      *
  2778.      * @param loginName The login name of the user (ex: i:0#.f|membership|user@domain.onmicrosoft.com)
  2779.      */
  2780.     Web.prototype.ensureUser = function (loginName) {
  2781.         var postBody = JSON.stringify({
  2782.             logonName: loginName,
  2783.         });
  2784.         return this.clone(Web, "ensureuser", true).post({ body: postBody }).then(function (data) {
  2785.             return {
  2786.                 data: data,
  2787.                 user: new siteusers_1.SiteUser(odata_1.extractOdataId(data)),
  2788.             };
  2789.         });
  2790.     };
  2791.     /**
  2792.      * Returns a collection of site templates available for the site.
  2793.      *
  2794.      * @param language The LCID of the site templates to get.
  2795.      * @param true to include language-neutral site templates; otherwise false
  2796.      */
  2797.     Web.prototype.availableWebTemplates = function (language, includeCrossLanugage) {
  2798.         if (language === void 0) { language = 1033; }
  2799.         if (includeCrossLanugage === void 0) { includeCrossLanugage = true; }
  2800.         return new queryable_1.QueryableCollection(this, "getavailablewebtemplates(lcid=" + language + ", doincludecrosslanguage=" + includeCrossLanugage + ")");
  2801.     };
  2802.     /**
  2803.      * Returns the list gallery on the site.
  2804.      *
  2805.      * @param type The gallery type - WebTemplateCatalog = 111, WebPartCatalog = 113 ListTemplateCatalog = 114,
  2806.      * MasterPageCatalog = 116, SolutionCatalog = 121, ThemeCatalog = 123, DesignCatalog = 124, AppDataCatalog = 125
  2807.      */
  2808.     Web.prototype.getCatalog = function (type) {
  2809.         return this.clone(Web, "getcatalog(" + type + ")", true).select("Id").get().then(function (data) {
  2810.             return new lists_2.List(odata_1.extractOdataId(data));
  2811.         });
  2812.     };
  2813.     /**
  2814.      * Returns the collection of changes from the change log that have occurred within the list, based on the specified query.
  2815.      */
  2816.     Web.prototype.getChanges = function (query) {
  2817.         var postBody = JSON.stringify({ "query": util_1.Util.extend({ "__metadata": { "type": "SP.ChangeQuery" } }, query) });
  2818.         return this.clone(Web, "getchanges", true).post({ body: postBody });
  2819.     };
  2820.     Object.defineProperty(Web.prototype, "customListTemplate", {
  2821.         /**
  2822.          * Gets the custom list templates for the site.
  2823.          *
  2824.          */
  2825.         get: function () {
  2826.             return new queryable_1.QueryableCollection(this, "getcustomlisttemplates");
  2827.         },
  2828.         enumerable: true,
  2829.         configurable: true
  2830.     });
  2831.     /**
  2832.      * Returns the user corresponding to the specified member identifier for the current site.
  2833.      *
  2834.      * @param id The ID of the user.
  2835.      */
  2836.     Web.prototype.getUserById = function (id) {
  2837.         return new siteusers_1.SiteUser(this, "getUserById(" + id + ")");
  2838.     };
  2839.     /**
  2840.      * Returns the name of the image file for the icon that is used to represent the specified file.
  2841.      *
  2842.      * @param filename The file name. If this parameter is empty, the server returns an empty string.
  2843.      * @param size The size of the icon: 16x16 pixels = 0, 32x32 pixels = 1.
  2844.      * @param progId The ProgID of the application that was used to create the file, in the form OLEServerName.ObjectName
  2845.      */
  2846.     Web.prototype.mapToIcon = function (filename, size, progId) {
  2847.         if (size === void 0) { size = 0; }
  2848.         if (progId === void 0) { progId = ""; }
  2849.         return this.clone(Web, "maptoicon(filename='" + filename + "', progid='" + progId + "', size=" + size + ")", true).get();
  2850.     };
  2851.     return Web;
  2852. }(queryableshareable_1.QueryableShareableWeb));
  2853. __decorate([
  2854.     decorators_1.deprecated("This method will be removed in future releases. Please use the methods found in queryable securable.")
  2855. ], Web.prototype, "doesUserHavePermissions", null);
  2856. exports.Web = Web;
  2857.  
  2858.  
  2859. /***/ }),
  2860. /* 8 */
  2861. /***/ (function(module, exports, __webpack_require__) {
  2862.  
  2863. "use strict";
  2864.  
  2865. var __extends = (this && this.__extends) || (function () {
  2866.     var extendStatics = Object.setPrototypeOf ||
  2867.         ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  2868.         function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  2869.     return function (d, b) {
  2870.         extendStatics(d, b);
  2871.         function __() { this.constructor = d; }
  2872.         d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  2873.     };
  2874. })();
  2875. Object.defineProperty(exports, "__esModule", { value: true });
  2876. var queryable_1 = __webpack_require__(1);
  2877. var odata_1 = __webpack_require__(2);
  2878. var util_1 = __webpack_require__(0);
  2879. var exceptions_1 = __webpack_require__(3);
  2880. var webparts_1 = __webpack_require__(50);
  2881. var items_1 = __webpack_require__(10);
  2882. var queryableshareable_1 = __webpack_require__(12);
  2883. var odata_2 = __webpack_require__(2);
  2884. /**
  2885.  * Describes a collection of File objects
  2886.  *
  2887.  */
  2888. var Files = (function (_super) {
  2889.     __extends(Files, _super);
  2890.     /**
  2891.      * Creates a new instance of the Files class
  2892.      *
  2893.      * @param baseUrl The url or Queryable which forms the parent of this fields collection
  2894.      */
  2895.     function Files(baseUrl, path) {
  2896.         if (path === void 0) { path = "files"; }
  2897.         return _super.call(this, baseUrl, path) || this;
  2898.     }
  2899.     /**
  2900.      * Gets a File by filename
  2901.      *
  2902.      * @param name The name of the file, including extension.
  2903.      */
  2904.     Files.prototype.getByName = function (name) {
  2905.         var f = new File(this);
  2906.         f.concat("('" + name + "')");
  2907.         return f;
  2908.     };
  2909.     /**
  2910.      * Uploads a file. Not supported for batching
  2911.      *
  2912.      * @param url The folder-relative url of the file.
  2913.      * @param content The file contents blob.
  2914.      * @param shouldOverWrite Should a file with the same name in the same location be overwritten? (default: true)
  2915.      * @returns The new File and the raw response.
  2916.      */
  2917.     Files.prototype.add = function (url, content, shouldOverWrite) {
  2918.         var _this = this;
  2919.         if (shouldOverWrite === void 0) { shouldOverWrite = true; }
  2920.         return new Files(this, "add(overwrite=" + shouldOverWrite + ",url='" + url + "')")
  2921.             .post({
  2922.             body: content,
  2923.         }).then(function (response) {
  2924.             return {
  2925.                 data: response,
  2926.                 file: _this.getByName(url),
  2927.             };
  2928.         });
  2929.     };
  2930.     /**
  2931.      * Uploads a file. Not supported for batching
  2932.      *
  2933.      * @param url The folder-relative url of the file.
  2934.      * @param content The Blob file content to add
  2935.      * @param progress A callback function which can be used to track the progress of the upload
  2936.      * @param shouldOverWrite Should a file with the same name in the same location be overwritten? (default: true)
  2937.      * @param chunkSize The size of each file slice, in bytes (default: 10485760)
  2938.      * @returns The new File and the raw response.
  2939.      */
  2940.     Files.prototype.addChunked = function (url, content, progress, shouldOverWrite, chunkSize) {
  2941.         var _this = this;
  2942.         if (shouldOverWrite === void 0) { shouldOverWrite = true; }
  2943.         if (chunkSize === void 0) { chunkSize = 10485760; }
  2944.         var adder = this.clone(Files, "add(overwrite=" + shouldOverWrite + ",url='" + url + "')");
  2945.         return adder.post().then(function () { return _this.getByName(url); }).then(function (file) { return file.setContentChunked(content, progress, chunkSize); }).then(function (response) {
  2946.             return {
  2947.                 data: response,
  2948.                 file: _this.getByName(url),
  2949.             };
  2950.         });
  2951.     };
  2952.     /**
  2953.      * Adds a ghosted file to an existing list or document library. Not supported for batching.
  2954.      *
  2955.      * @param fileUrl The server-relative url where you want to save the file.
  2956.      * @param templateFileType The type of use to create the file.
  2957.      * @returns The template file that was added and the raw response.
  2958.      */
  2959.     Files.prototype.addTemplateFile = function (fileUrl, templateFileType) {
  2960.         var _this = this;
  2961.         return this.clone(Files, "addTemplateFile(urloffile='" + fileUrl + "',templatefiletype=" + templateFileType + ")")
  2962.             .post().then(function (response) {
  2963.             return {
  2964.                 data: response,
  2965.                 file: _this.getByName(fileUrl),
  2966.             };
  2967.         });
  2968.     };
  2969.     return Files;
  2970. }(queryable_1.QueryableCollection));
  2971. exports.Files = Files;
  2972. /**
  2973.  * Describes a single File instance
  2974.  *
  2975.  */
  2976. var File = (function (_super) {
  2977.     __extends(File, _super);
  2978.     function File() {
  2979.         return _super !== null && _super.apply(this, arguments) || this;
  2980.     }
  2981.     Object.defineProperty(File.prototype, "listItemAllFields", {
  2982.         /**
  2983.          * Gets a value that specifies the list item field values for the list item corresponding to the file.
  2984.          *
  2985.          */
  2986.         get: function () {
  2987.             return new queryable_1.QueryableCollection(this, "listItemAllFields");
  2988.         },
  2989.         enumerable: true,
  2990.         configurable: true
  2991.     });
  2992.     Object.defineProperty(File.prototype, "versions", {
  2993.         /**
  2994.          * Gets a collection of versions
  2995.          *
  2996.          */
  2997.         get: function () {
  2998.             return new Versions(this);
  2999.         },
  3000.         enumerable: true,
  3001.         configurable: true
  3002.     });
  3003.     /**
  3004.      * Approves the file submitted for content approval with the specified comment.
  3005.      * Only documents in lists that are enabled for content approval can be approved.
  3006.      *
  3007.      * @param comment The comment for the approval.
  3008.      */
  3009.     File.prototype.approve = function (comment) {
  3010.         return this.clone(File, "approve(comment='" + comment + "')", true).post();
  3011.     };
  3012.     /**
  3013.      * Stops the chunk upload session without saving the uploaded data. Does not support batching.
  3014.      * If the file doesn’t already exist in the library, the partially uploaded file will be deleted.
  3015.      * Use this in response to user action (as in a request to cancel an upload) or an error or exception.
  3016.      * Use the uploadId value that was passed to the StartUpload method that started the upload session.
  3017.      * This method is currently available only on Office 365.
  3018.      *
  3019.      * @param uploadId The unique identifier of the upload session.
  3020.      */
  3021.     File.prototype.cancelUpload = function (uploadId) {
  3022.         return this.clone(File, "cancelUpload(uploadId=guid'" + uploadId + "')", false).post();
  3023.     };
  3024.     /**
  3025.      * Checks the file in to a document library based on the check-in type.
  3026.      *
  3027.      * @param comment A comment for the check-in. Its length must be <= 1023.
  3028.      * @param checkinType The check-in type for the file.
  3029.      */
  3030.     File.prototype.checkin = function (comment, checkinType) {
  3031.         if (comment === void 0) { comment = ""; }
  3032.         if (checkinType === void 0) { checkinType = CheckinType.Major; }
  3033.         if (comment.length > 1023) {
  3034.             throw new exceptions_1.MaxCommentLengthException();
  3035.         }
  3036.         return this.clone(File, "checkin(comment='" + comment + "',checkintype=" + checkinType + ")", true).post();
  3037.     };
  3038.     /**
  3039.      * Checks out the file from a document library.
  3040.      */
  3041.     File.prototype.checkout = function () {
  3042.         return this.clone(File, "checkout", true).post();
  3043.     };
  3044.     /**
  3045.      * Copies the file to the destination url.
  3046.      *
  3047.      * @param url The absolute url or server relative url of the destination file path to copy to.
  3048.      * @param shouldOverWrite Should a file with the same name in the same location be overwritten?
  3049.      */
  3050.     File.prototype.copyTo = function (url, shouldOverWrite) {
  3051.         if (shouldOverWrite === void 0) { shouldOverWrite = true; }
  3052.         return this.clone(File, "copyTo(strnewurl='" + url + "',boverwrite=" + shouldOverWrite + ")", true).post();
  3053.     };
  3054.     /**
  3055.      * Delete this file.
  3056.      *
  3057.      * @param eTag Value used in the IF-Match header, by default "*"
  3058.      */
  3059.     File.prototype.delete = function (eTag) {
  3060.         if (eTag === void 0) { eTag = "*"; }
  3061.         return this.clone(File, null, true).post({
  3062.             headers: {
  3063.                 "IF-Match": eTag,
  3064.                 "X-HTTP-Method": "DELETE",
  3065.             },
  3066.         });
  3067.     };
  3068.     /**
  3069.      * Denies approval for a file that was submitted for content approval.
  3070.      * Only documents in lists that are enabled for content approval can be denied.
  3071.      *
  3072.      * @param comment The comment for the denial.
  3073.      */
  3074.     File.prototype.deny = function (comment) {
  3075.         if (comment === void 0) { comment = ""; }
  3076.         if (comment.length > 1023) {
  3077.             throw new exceptions_1.MaxCommentLengthException();
  3078.         }
  3079.         return this.clone(File, "deny(comment='" + comment + "')", true).post();
  3080.     };
  3081.     /**
  3082.      * Specifies the control set used to access, modify, or add Web Parts associated with this Web Part Page and view.
  3083.      * An exception is thrown if the file is not an ASPX page.
  3084.      *
  3085.      * @param scope The WebPartsPersonalizationScope view on the Web Parts page.
  3086.      */
  3087.     File.prototype.getLimitedWebPartManager = function (scope) {
  3088.         if (scope === void 0) { scope = WebPartsPersonalizationScope.Shared; }
  3089.         return new webparts_1.LimitedWebPartManager(this, "getLimitedWebPartManager(scope=" + scope + ")");
  3090.     };
  3091.     /**
  3092.      * Moves the file to the specified destination url.
  3093.      *
  3094.      * @param url The absolute url or server relative url of the destination file path to move to.
  3095.      * @param moveOperations The bitwise MoveOperations value for how to move the file.
  3096.      */
  3097.     File.prototype.moveTo = function (url, moveOperations) {
  3098.         if (moveOperations === void 0) { moveOperations = MoveOperations.Overwrite; }
  3099.         return this.clone(File, "moveTo(newurl='" + url + "',flags=" + moveOperations + ")", true).post();
  3100.     };
  3101.     /**
  3102.      * Submits the file for content approval with the specified comment.
  3103.      *
  3104.      * @param comment The comment for the published file. Its length must be <= 1023.
  3105.      */
  3106.     File.prototype.publish = function (comment) {
  3107.         if (comment === void 0) { comment = ""; }
  3108.         if (comment.length > 1023) {
  3109.             throw new exceptions_1.MaxCommentLengthException();
  3110.         }
  3111.         return this.clone(File, "publish(comment='" + comment + "')", true).post();
  3112.     };
  3113.     /**
  3114.      * Moves the file to the Recycle Bin and returns the identifier of the new Recycle Bin item.
  3115.      *
  3116.      * @returns The GUID of the recycled file.
  3117.      */
  3118.     File.prototype.recycle = function () {
  3119.         return this.clone(File, "recycle", true).post();
  3120.     };
  3121.     /**
  3122.      * Reverts an existing checkout for the file.
  3123.      *
  3124.      */
  3125.     File.prototype.undoCheckout = function () {
  3126.         return this.clone(File, "undoCheckout", true).post();
  3127.     };
  3128.     /**
  3129.      * Removes the file from content approval or unpublish a major version.
  3130.      *
  3131.      * @param comment The comment for the unpublish operation. Its length must be <= 1023.
  3132.      */
  3133.     File.prototype.unpublish = function (comment) {
  3134.         if (comment === void 0) { comment = ""; }
  3135.         if (comment.length > 1023) {
  3136.             throw new exceptions_1.MaxCommentLengthException();
  3137.         }
  3138.         return this.clone(File, "unpublish(comment='" + comment + "')", true).post();
  3139.     };
  3140.     /**
  3141.      * Gets the contents of the file as text. Not supported in batching.
  3142.      *
  3143.      */
  3144.     File.prototype.getText = function () {
  3145.         return this.clone(File, "$value").get(new odata_1.TextFileParser(), { headers: { "binaryStringResponseBody": "true" } });
  3146.     };
  3147.     /**
  3148.      * Gets the contents of the file as a blob, does not work in Node.js. Not supported in batching.
  3149.      *
  3150.      */
  3151.     File.prototype.getBlob = function () {
  3152.         return this.clone(File, "$value").get(new odata_1.BlobFileParser(), { headers: { "binaryStringResponseBody": "true" } });
  3153.     };
  3154.     /**
  3155.      * Gets the contents of a file as an ArrayBuffer, works in Node.js. Not supported in batching.
  3156.      */
  3157.     File.prototype.getBuffer = function () {
  3158.         return this.clone(File, "$value").get(new odata_1.BufferFileParser(), { headers: { "binaryStringResponseBody": "true" } });
  3159.     };
  3160.     /**
  3161.      * Gets the contents of a file as an ArrayBuffer, works in Node.js. Not supported in batching.
  3162.      */
  3163.     File.prototype.getJSON = function () {
  3164.         return this.clone(File, "$value").get(new odata_1.JSONFileParser(), { headers: { "binaryStringResponseBody": "true" } });
  3165.     };
  3166.     /**
  3167.      * Sets the content of a file, for large files use setContentChunked. Not supported in batching.
  3168.      *
  3169.      * @param content The file content
  3170.      *
  3171.      */
  3172.     File.prototype.setContent = function (content) {
  3173.         var _this = this;
  3174.         return this.clone(File, "$value").post({
  3175.             body: content,
  3176.             headers: {
  3177.                 "X-HTTP-Method": "PUT",
  3178.             },
  3179.         }).then(function (_) { return new File(_this); });
  3180.     };
  3181.     /**
  3182.      * Gets the associated list item for this folder, loading the default properties
  3183.      */
  3184.     File.prototype.getItem = function () {
  3185.         var selects = [];
  3186.         for (var _i = 0; _i < arguments.length; _i++) {
  3187.             selects[_i] = arguments[_i];
  3188.         }
  3189.         var q = this.listItemAllFields;
  3190.         return q.select.apply(q, selects).get().then(function (d) {
  3191.             return util_1.Util.extend(new items_1.Item(odata_2.getEntityUrl(d)), d);
  3192.         });
  3193.     };
  3194.     /**
  3195.      * Sets the contents of a file using a chunked upload approach. Not supported in batching.
  3196.      *
  3197.      * @param file The file to upload
  3198.      * @param progress A callback function which can be used to track the progress of the upload
  3199.      * @param chunkSize The size of each file slice, in bytes (default: 10485760)
  3200.      */
  3201.     File.prototype.setContentChunked = function (file, progress, chunkSize) {
  3202.         if (chunkSize === void 0) { chunkSize = 10485760; }
  3203.         if (typeof progress === "undefined") {
  3204.             progress = function () { return null; };
  3205.         }
  3206.         var self = this;
  3207.         var fileSize = file.size;
  3208.         var blockCount = parseInt((file.size / chunkSize).toString(), 10) + ((file.size % chunkSize === 0) ? 1 : 0);
  3209.         var uploadId = util_1.Util.getGUID();
  3210.         // start the chain with the first fragment
  3211.         progress({ blockNumber: 1, chunkSize: chunkSize, currentPointer: 0, fileSize: fileSize, stage: "starting", totalBlocks: blockCount });
  3212.         var chain = self.startUpload(uploadId, file.slice(0, chunkSize));
  3213.         var _loop_1 = function (i) {
  3214.             chain = chain.then(function (pointer) {
  3215.                 progress({ blockNumber: i, chunkSize: chunkSize, currentPointer: pointer, fileSize: fileSize, stage: "continue", totalBlocks: blockCount });
  3216.                 return self.continueUpload(uploadId, pointer, file.slice(pointer, pointer + chunkSize));
  3217.             });
  3218.         };
  3219.         // skip the first and last blocks
  3220.         for (var i = 2; i < blockCount; i++) {
  3221.             _loop_1(i);
  3222.         }
  3223.         return chain.then(function (pointer) {
  3224.             progress({ blockNumber: blockCount, chunkSize: chunkSize, currentPointer: pointer, fileSize: fileSize, stage: "finishing", totalBlocks: blockCount });
  3225.             return self.finishUpload(uploadId, pointer, file.slice(pointer));
  3226.         }).then(function (_) {
  3227.             return self;
  3228.         });
  3229.     };
  3230.     /**
  3231.      * Starts a new chunk upload session and uploads the first fragment.
  3232.      * The current file content is not changed when this method completes.
  3233.      * The method is idempotent (and therefore does not change the result) as long as you use the same values for uploadId and stream.
  3234.      * The upload session ends either when you use the CancelUpload method or when you successfully
  3235.      * complete the upload session by passing the rest of the file contents through the ContinueUpload and FinishUpload methods.
  3236.      * The StartUpload and ContinueUpload methods return the size of the running total of uploaded data in bytes,
  3237.      * so you can pass those return values to subsequent uses of ContinueUpload and FinishUpload.
  3238.      * This method is currently available only on Office 365.
  3239.      *
  3240.      * @param uploadId The unique identifier of the upload session.
  3241.      * @param fragment The file contents.
  3242.      * @returns The size of the total uploaded data in bytes.
  3243.      */
  3244.     File.prototype.startUpload = function (uploadId, fragment) {
  3245.         return this.clone(File, "startUpload(uploadId=guid'" + uploadId + "')").postAs({ body: fragment }).then(function (n) { return parseFloat(n); });
  3246.     };
  3247.     /**
  3248.      * Continues the chunk upload session with an additional fragment.
  3249.      * The current file content is not changed.
  3250.      * Use the uploadId value that was passed to the StartUpload method that started the upload session.
  3251.      * This method is currently available only on Office 365.
  3252.      *
  3253.      * @param uploadId The unique identifier of the upload session.
  3254.      * @param fileOffset The size of the offset into the file where the fragment starts.
  3255.      * @param fragment The file contents.
  3256.      * @returns The size of the total uploaded data in bytes.
  3257.      */
  3258.     File.prototype.continueUpload = function (uploadId, fileOffset, fragment) {
  3259.         return this.clone(File, "continueUpload(uploadId=guid'" + uploadId + "',fileOffset=" + fileOffset + ")").postAs({ body: fragment }).then(function (n) { return parseFloat(n); });
  3260.     };
  3261.     /**
  3262.      * Uploads the last file fragment and commits the file. The current file content is changed when this method completes.
  3263.      * Use the uploadId value that was passed to the StartUpload method that started the upload session.
  3264.      * This method is currently available only on Office 365.
  3265.      *
  3266.      * @param uploadId The unique identifier of the upload session.
  3267.      * @param fileOffset The size of the offset into the file where the fragment starts.
  3268.      * @param fragment The file contents.
  3269.      * @returns The newly uploaded file.
  3270.      */
  3271.     File.prototype.finishUpload = function (uploadId, fileOffset, fragment) {
  3272.         return this.clone(File, "finishUpload(uploadId=guid'" + uploadId + "',fileOffset=" + fileOffset + ")")
  3273.             .postAs({ body: fragment }).then(function (response) {
  3274.             return {
  3275.                 data: response,
  3276.                 file: new File(response.ServerRelativeUrl),
  3277.             };
  3278.         });
  3279.     };
  3280.     return File;
  3281. }(queryableshareable_1.QueryableShareableFile));
  3282. exports.File = File;
  3283. /**
  3284.  * Describes a collection of Version objects
  3285.  *
  3286.  */
  3287. var Versions = (function (_super) {
  3288.     __extends(Versions, _super);
  3289.     /**
  3290.      * Creates a new instance of the File class
  3291.      *
  3292.      * @param baseUrl The url or Queryable which forms the parent of this fields collection
  3293.      */
  3294.     function Versions(baseUrl, path) {
  3295.         if (path === void 0) { path = "versions"; }
  3296.         return _super.call(this, baseUrl, path) || this;
  3297.     }
  3298.     /**
  3299.      * Gets a version by id
  3300.      *
  3301.      * @param versionId The id of the version to retrieve
  3302.      */
  3303.     Versions.prototype.getById = function (versionId) {
  3304.         var v = new Version(this);
  3305.         v.concat("(" + versionId + ")");
  3306.         return v;
  3307.     };
  3308.     /**
  3309.      * Deletes all the file version objects in the collection.
  3310.      *
  3311.      */
  3312.     Versions.prototype.deleteAll = function () {
  3313.         return new Versions(this, "deleteAll").post();
  3314.     };
  3315.     /**
  3316.      * Deletes the specified version of the file.
  3317.      *
  3318.      * @param versionId The ID of the file version to delete.
  3319.      */
  3320.     Versions.prototype.deleteById = function (versionId) {
  3321.         return this.clone(Versions, "deleteById(vid=" + versionId + ")", true).post();
  3322.     };
  3323.     /**
  3324.      * Deletes the file version object with the specified version label.
  3325.      *
  3326.      * @param label The version label of the file version to delete, for example: 1.2
  3327.      */
  3328.     Versions.prototype.deleteByLabel = function (label) {
  3329.         return this.clone(Versions, "deleteByLabel(versionlabel='" + label + "')", true).post();
  3330.     };
  3331.     /**
  3332.      * Creates a new file version from the file specified by the version label.
  3333.      *
  3334.      * @param label The version label of the file version to restore, for example: 1.2
  3335.      */
  3336.     Versions.prototype.restoreByLabel = function (label) {
  3337.         return this.clone(Versions, "restoreByLabel(versionlabel='" + label + "')", true).post();
  3338.     };
  3339.     return Versions;
  3340. }(queryable_1.QueryableCollection));
  3341. exports.Versions = Versions;
  3342. /**
  3343.  * Describes a single Version instance
  3344.  *
  3345.  */
  3346. var Version = (function (_super) {
  3347.     __extends(Version, _super);
  3348.     function Version() {
  3349.         return _super !== null && _super.apply(this, arguments) || this;
  3350.     }
  3351.     /**
  3352.     * Delete a specific version of a file.
  3353.     *
  3354.     * @param eTag Value used in the IF-Match header, by default "*"
  3355.     */
  3356.     Version.prototype.delete = function (eTag) {
  3357.         if (eTag === void 0) { eTag = "*"; }
  3358.         return this.post({
  3359.             headers: {
  3360.                 "IF-Match": eTag,
  3361.                 "X-HTTP-Method": "DELETE",
  3362.             },
  3363.         });
  3364.     };
  3365.     return Version;
  3366. }(queryable_1.QueryableInstance));
  3367. exports.Version = Version;
  3368. var CheckinType;
  3369. (function (CheckinType) {
  3370.     CheckinType[CheckinType["Minor"] = 0] = "Minor";
  3371.     CheckinType[CheckinType["Major"] = 1] = "Major";
  3372.     CheckinType[CheckinType["Overwrite"] = 2] = "Overwrite";
  3373. })(CheckinType = exports.CheckinType || (exports.CheckinType = {}));
  3374. var WebPartsPersonalizationScope;
  3375. (function (WebPartsPersonalizationScope) {
  3376.     WebPartsPersonalizationScope[WebPartsPersonalizationScope["User"] = 0] = "User";
  3377.     WebPartsPersonalizationScope[WebPartsPersonalizationScope["Shared"] = 1] = "Shared";
  3378. })(WebPartsPersonalizationScope = exports.WebPartsPersonalizationScope || (exports.WebPartsPersonalizationScope = {}));
  3379. var MoveOperations;
  3380. (function (MoveOperations) {
  3381.     MoveOperations[MoveOperations["Overwrite"] = 1] = "Overwrite";
  3382.     MoveOperations[MoveOperations["AllowBrokenThickets"] = 8] = "AllowBrokenThickets";
  3383. })(MoveOperations = exports.MoveOperations || (exports.MoveOperations = {}));
  3384. var TemplateFileType;
  3385. (function (TemplateFileType) {
  3386.     TemplateFileType[TemplateFileType["StandardPage"] = 0] = "StandardPage";
  3387.     TemplateFileType[TemplateFileType["WikiPage"] = 1] = "WikiPage";
  3388.     TemplateFileType[TemplateFileType["FormPage"] = 2] = "FormPage";
  3389. })(TemplateFileType = exports.TemplateFileType || (exports.TemplateFileType = {}));
  3390.  
  3391.  
  3392. /***/ }),
  3393. /* 9 */
  3394. /***/ (function(module, exports, __webpack_require__) {
  3395.  
  3396. "use strict";
  3397.  
  3398. var __extends = (this && this.__extends) || (function () {
  3399.     var extendStatics = Object.setPrototypeOf ||
  3400.         ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  3401.         function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  3402.     return function (d, b) {
  3403.         extendStatics(d, b);
  3404.         function __() { this.constructor = d; }
  3405.         d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  3406.     };
  3407. })();
  3408. Object.defineProperty(exports, "__esModule", { value: true });
  3409. var queryable_1 = __webpack_require__(1);
  3410. var queryableshareable_1 = __webpack_require__(12);
  3411. var files_1 = __webpack_require__(8);
  3412. var util_1 = __webpack_require__(0);
  3413. var odata_1 = __webpack_require__(2);
  3414. var items_1 = __webpack_require__(10);
  3415. /**
  3416.  * Describes a collection of Folder objects
  3417.  *
  3418.  */
  3419. var Folders = (function (_super) {
  3420.     __extends(Folders, _super);
  3421.     /**
  3422.      * Creates a new instance of the Folders class
  3423.      *
  3424.      * @param baseUrl The url or Queryable which forms the parent of this fields collection
  3425.      */
  3426.     function Folders(baseUrl, path) {
  3427.         if (path === void 0) { path = "folders"; }
  3428.         return _super.call(this, baseUrl, path) || this;
  3429.     }
  3430.     /**
  3431.      * Gets a folder by folder name
  3432.      *
  3433.      */
  3434.     Folders.prototype.getByName = function (name) {
  3435.         var f = new Folder(this);
  3436.         f.concat("('" + name + "')");
  3437.         return f;
  3438.     };
  3439.     /**
  3440.      * Adds a new folder to the current folder (relative) or any folder (absolute)
  3441.      *
  3442.      * @param url The relative or absolute url where the new folder will be created. Urls starting with a forward slash are absolute.
  3443.      * @returns The new Folder and the raw response.
  3444.      */
  3445.     Folders.prototype.add = function (url) {
  3446.         var _this = this;
  3447.         return this.clone(Folders, "add('" + url + "')", true).post().then(function (response) {
  3448.             return {
  3449.                 data: response,
  3450.                 folder: _this.getByName(url),
  3451.             };
  3452.         });
  3453.     };
  3454.     return Folders;
  3455. }(queryable_1.QueryableCollection));
  3456. exports.Folders = Folders;
  3457. /**
  3458.  * Describes a single Folder instance
  3459.  *
  3460.  */
  3461. var Folder = (function (_super) {
  3462.     __extends(Folder, _super);
  3463.     function Folder() {
  3464.         return _super !== null && _super.apply(this, arguments) || this;
  3465.     }
  3466.     Object.defineProperty(Folder.prototype, "contentTypeOrder", {
  3467.         /**
  3468.          * Specifies the sequence in which content types are displayed.
  3469.          *
  3470.          */
  3471.         get: function () {
  3472.             return new queryable_1.QueryableCollection(this, "contentTypeOrder");
  3473.         },
  3474.         enumerable: true,
  3475.         configurable: true
  3476.     });
  3477.     Object.defineProperty(Folder.prototype, "files", {
  3478.         /**
  3479.          * Gets this folder's files
  3480.          *
  3481.          */
  3482.         get: function () {
  3483.             return new files_1.Files(this);
  3484.         },
  3485.         enumerable: true,
  3486.         configurable: true
  3487.     });
  3488.     Object.defineProperty(Folder.prototype, "folders", {
  3489.         /**
  3490.          * Gets this folder's sub folders
  3491.          *
  3492.          */
  3493.         get: function () {
  3494.             return new Folders(this);
  3495.         },
  3496.         enumerable: true,
  3497.         configurable: true
  3498.     });
  3499.     Object.defineProperty(Folder.prototype, "listItemAllFields", {
  3500.         /**
  3501.          * Gets this folder's list item field values
  3502.          *
  3503.          */
  3504.         get: function () {
  3505.             return new queryable_1.QueryableCollection(this, "listItemAllFields");
  3506.         },
  3507.         enumerable: true,
  3508.         configurable: true
  3509.     });
  3510.     Object.defineProperty(Folder.prototype, "parentFolder", {
  3511.         /**
  3512.          * Gets the parent folder, if available
  3513.          *
  3514.          */
  3515.         get: function () {
  3516.             return new Folder(this, "parentFolder");
  3517.         },
  3518.         enumerable: true,
  3519.         configurable: true
  3520.     });
  3521.     Object.defineProperty(Folder.prototype, "properties", {
  3522.         /**
  3523.          * Gets this folder's properties
  3524.          *
  3525.          */
  3526.         get: function () {
  3527.             return new queryable_1.QueryableInstance(this, "properties");
  3528.         },
  3529.         enumerable: true,
  3530.         configurable: true
  3531.     });
  3532.     Object.defineProperty(Folder.prototype, "serverRelativeUrl", {
  3533.         /**
  3534.          * Gets this folder's server relative url
  3535.          *
  3536.          */
  3537.         get: function () {
  3538.             return new queryable_1.Queryable(this, "serverRelativeUrl");
  3539.         },
  3540.         enumerable: true,
  3541.         configurable: true
  3542.     });
  3543.     Object.defineProperty(Folder.prototype, "uniqueContentTypeOrder", {
  3544.         /**
  3545.          * Gets a value that specifies the content type order.
  3546.          *
  3547.          */
  3548.         get: function () {
  3549.             return new queryable_1.QueryableCollection(this, "uniqueContentTypeOrder");
  3550.         },
  3551.         enumerable: true,
  3552.         configurable: true
  3553.     });
  3554.     Folder.prototype.update = function (properties) {
  3555.         var _this = this;
  3556.         var postBody = JSON.stringify(util_1.Util.extend({
  3557.             "__metadata": { "type": "SP.Folder" },
  3558.         }, properties));
  3559.         return this.post({
  3560.             body: postBody,
  3561.             headers: {
  3562.                 "X-HTTP-Method": "MERGE",
  3563.             },
  3564.         }).then(function (data) {
  3565.             return {
  3566.                 data: data,
  3567.                 folder: _this,
  3568.             };
  3569.         });
  3570.     };
  3571.     /**
  3572.     * Delete this folder
  3573.     *
  3574.     * @param eTag Value used in the IF-Match header, by default "*"
  3575.     */
  3576.     Folder.prototype.delete = function (eTag) {
  3577.         if (eTag === void 0) { eTag = "*"; }
  3578.         return this.clone(Folder, null, true).post({
  3579.             headers: {
  3580.                 "IF-Match": eTag,
  3581.                 "X-HTTP-Method": "DELETE",
  3582.             },
  3583.         });
  3584.     };
  3585.     /**
  3586.      * Moves the folder to the Recycle Bin and returns the identifier of the new Recycle Bin item.
  3587.      */
  3588.     Folder.prototype.recycle = function () {
  3589.         return this.clone(Folder, "recycle", true).post();
  3590.     };
  3591.     /**
  3592.      * Gets the associated list item for this folder, loading the default properties
  3593.      */
  3594.     Folder.prototype.getItem = function () {
  3595.         var selects = [];
  3596.         for (var _i = 0; _i < arguments.length; _i++) {
  3597.             selects[_i] = arguments[_i];
  3598.         }
  3599.         var q = this.listItemAllFields;
  3600.         return q.select.apply(q, selects).get().then(function (d) {
  3601.             return util_1.Util.extend(new items_1.Item(odata_1.getEntityUrl(d)), d);
  3602.         });
  3603.     };
  3604.     return Folder;
  3605. }(queryableshareable_1.QueryableShareableFolder));
  3606. exports.Folder = Folder;
  3607.  
  3608.  
  3609. /***/ }),
  3610. /* 10 */
  3611. /***/ (function(module, exports, __webpack_require__) {
  3612.  
  3613. "use strict";
  3614.  
  3615. var __extends = (this && this.__extends) || (function () {
  3616.     var extendStatics = Object.setPrototypeOf ||
  3617.         ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  3618.         function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  3619.     return function (d, b) {
  3620.         extendStatics(d, b);
  3621.         function __() { this.constructor = d; }
  3622.         d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  3623.     };
  3624. })();
  3625. Object.defineProperty(exports, "__esModule", { value: true });
  3626. var queryable_1 = __webpack_require__(1);
  3627. var queryableshareable_1 = __webpack_require__(12);
  3628. var folders_1 = __webpack_require__(9);
  3629. var files_1 = __webpack_require__(8);
  3630. var contenttypes_1 = __webpack_require__(16);
  3631. var util_1 = __webpack_require__(0);
  3632. var odata_1 = __webpack_require__(2);
  3633. var attachmentfiles_1 = __webpack_require__(42);
  3634. var lists_1 = __webpack_require__(11);
  3635. /**
  3636.  * Describes a collection of Item objects
  3637.  *
  3638.  */
  3639. var Items = (function (_super) {
  3640.     __extends(Items, _super);
  3641.     /**
  3642.      * Creates a new instance of the Items class
  3643.      *
  3644.      * @param baseUrl The url or Queryable which forms the parent of this fields collection
  3645.      */
  3646.     function Items(baseUrl, path) {
  3647.         if (path === void 0) { path = "items"; }
  3648.         return _super.call(this, baseUrl, path) || this;
  3649.     }
  3650.     /**
  3651.      * Gets an Item by id
  3652.      *
  3653.      * @param id The integer id of the item to retrieve
  3654.      */
  3655.     Items.prototype.getById = function (id) {
  3656.         var i = new Item(this);
  3657.         i.concat("(" + id + ")");
  3658.         return i;
  3659.     };
  3660.     /**
  3661.      * Skips the specified number of items (https://msdn.microsoft.com/en-us/library/office/fp142385.aspx#sectionSection6)
  3662.      *
  3663.      * @param skip The starting id where the page should start, use with top to specify pages
  3664.      */
  3665.     Items.prototype.skip = function (skip) {
  3666.         this._query.add("$skiptoken", encodeURIComponent("Paged=TRUE&p_ID=" + skip));
  3667.         return this;
  3668.     };
  3669.     /**
  3670.      * Gets a collection designed to aid in paging through data
  3671.      *
  3672.      */
  3673.     Items.prototype.getPaged = function () {
  3674.         return this.getAs(new PagedItemCollectionParser());
  3675.     };
  3676.     //
  3677.     /**
  3678.      * Adds a new item to the collection
  3679.      *
  3680.      * @param properties The new items's properties
  3681.      */
  3682.     Items.prototype.add = function (properties, listItemEntityTypeFullName) {
  3683.         var _this = this;
  3684.         if (properties === void 0) { properties = {}; }
  3685.         if (listItemEntityTypeFullName === void 0) { listItemEntityTypeFullName = null; }
  3686.         var removeDependency = this.addBatchDependency();
  3687.         return this.ensureListItemEntityTypeName(listItemEntityTypeFullName).then(function (listItemEntityType) {
  3688.             var postBody = JSON.stringify(util_1.Util.extend({
  3689.                 "__metadata": { "type": listItemEntityType },
  3690.             }, properties));
  3691.             var promise = _this.clone(Items, null, true).postAs({ body: postBody }).then(function (data) {
  3692.                 return {
  3693.                     data: data,
  3694.                     item: _this.getById(data.Id),
  3695.                 };
  3696.             });
  3697.             removeDependency();
  3698.             return promise;
  3699.         });
  3700.     };
  3701.     /**
  3702.      * Ensures we have the proper list item entity type name, either from the value provided or from the list
  3703.      *
  3704.      * @param candidatelistItemEntityTypeFullName The potential type name
  3705.      */
  3706.     Items.prototype.ensureListItemEntityTypeName = function (candidatelistItemEntityTypeFullName) {
  3707.         return candidatelistItemEntityTypeFullName ?
  3708.             Promise.resolve(candidatelistItemEntityTypeFullName) :
  3709.             this.getParent(lists_1.List).getListItemEntityTypeFullName();
  3710.     };
  3711.     return Items;
  3712. }(queryable_1.QueryableCollection));
  3713. exports.Items = Items;
  3714. /**
  3715.  * Descrines a single Item instance
  3716.  *
  3717.  */
  3718. var Item = (function (_super) {
  3719.     __extends(Item, _super);
  3720.     function Item() {
  3721.         return _super !== null && _super.apply(this, arguments) || this;
  3722.     }
  3723.     Object.defineProperty(Item.prototype, "attachmentFiles", {
  3724.         /**
  3725.          * Gets the set of attachments for this item
  3726.          *
  3727.          */
  3728.         get: function () {
  3729.             return new attachmentfiles_1.AttachmentFiles(this);
  3730.         },
  3731.         enumerable: true,
  3732.         configurable: true
  3733.     });
  3734.     Object.defineProperty(Item.prototype, "contentType", {
  3735.         /**
  3736.          * Gets the content type for this item
  3737.          *
  3738.          */
  3739.         get: function () {
  3740.             return new contenttypes_1.ContentType(this, "ContentType");
  3741.         },
  3742.         enumerable: true,
  3743.         configurable: true
  3744.     });
  3745.     Object.defineProperty(Item.prototype, "effectiveBasePermissions", {
  3746.         /**
  3747.          * Gets the effective base permissions for the item
  3748.          *
  3749.          */
  3750.         get: function () {
  3751.             return new queryable_1.Queryable(this, "EffectiveBasePermissions");
  3752.         },
  3753.         enumerable: true,
  3754.         configurable: true
  3755.     });
  3756.     Object.defineProperty(Item.prototype, "effectiveBasePermissionsForUI", {
  3757.         /**
  3758.          * Gets the effective base permissions for the item in a UI context
  3759.          *
  3760.          */
  3761.         get: function () {
  3762.             return new queryable_1.Queryable(this, "EffectiveBasePermissionsForUI");
  3763.         },
  3764.         enumerable: true,
  3765.         configurable: true
  3766.     });
  3767.     Object.defineProperty(Item.prototype, "fieldValuesAsHTML", {
  3768.         /**
  3769.          * Gets the field values for this list item in their HTML representation
  3770.          *
  3771.          */
  3772.         get: function () {
  3773.             return new queryable_1.QueryableInstance(this, "FieldValuesAsHTML");
  3774.         },
  3775.         enumerable: true,
  3776.         configurable: true
  3777.     });
  3778.     Object.defineProperty(Item.prototype, "fieldValuesAsText", {
  3779.         /**
  3780.          * Gets the field values for this list item in their text representation
  3781.          *
  3782.          */
  3783.         get: function () {
  3784.             return new queryable_1.QueryableInstance(this, "FieldValuesAsText");
  3785.         },
  3786.         enumerable: true,
  3787.         configurable: true
  3788.     });
  3789.     Object.defineProperty(Item.prototype, "fieldValuesForEdit", {
  3790.         /**
  3791.          * Gets the field values for this list item for use in editing controls
  3792.          *
  3793.          */
  3794.         get: function () {
  3795.             return new queryable_1.QueryableInstance(this, "FieldValuesForEdit");
  3796.         },
  3797.         enumerable: true,
  3798.         configurable: true
  3799.     });
  3800.     Object.defineProperty(Item.prototype, "folder", {
  3801.         /**
  3802.          * Gets the folder associated with this list item (if this item represents a folder)
  3803.          *
  3804.          */
  3805.         get: function () {
  3806.             return new folders_1.Folder(this, "folder");
  3807.         },
  3808.         enumerable: true,
  3809.         configurable: true
  3810.     });
  3811.     Object.defineProperty(Item.prototype, "file", {
  3812.         /**
  3813.          * Gets the folder associated with this list item (if this item represents a folder)
  3814.          *
  3815.          */
  3816.         get: function () {
  3817.             return new files_1.File(this, "file");
  3818.         },
  3819.         enumerable: true,
  3820.         configurable: true
  3821.     });
  3822.     /**
  3823.      * Updates this list intance with the supplied properties
  3824.      *
  3825.      * @param properties A plain object hash of values to update for the list
  3826.      * @param eTag Value used in the IF-Match header, by default "*"
  3827.      */
  3828.     Item.prototype.update = function (properties, eTag) {
  3829.         var _this = this;
  3830.         if (eTag === void 0) { eTag = "*"; }
  3831.         return new Promise(function (resolve, reject) {
  3832.             var removeDependency = _this.addBatchDependency();
  3833.             var parentList = _this.getParent(queryable_1.QueryableInstance, _this.parentUrl.substr(0, _this.parentUrl.lastIndexOf("/")));
  3834.             parentList.select("ListItemEntityTypeFullName").getAs().then(function (d) {
  3835.                 var postBody = JSON.stringify(util_1.Util.extend({
  3836.                     "__metadata": { "type": d.ListItemEntityTypeFullName },
  3837.                 }, properties));
  3838.                 removeDependency();
  3839.                 return _this.post({
  3840.                     body: postBody,
  3841.                     headers: {
  3842.                         "IF-Match": eTag,
  3843.                         "X-HTTP-Method": "MERGE",
  3844.                     },
  3845.                 }, new ItemUpdatedParser()).then(function (data) {
  3846.                     resolve({
  3847.                         data: data,
  3848.                         item: _this,
  3849.                     });
  3850.                 });
  3851.             }).catch(function (e) { return reject(e); });
  3852.         });
  3853.     };
  3854.     /**
  3855.      * Delete this item
  3856.      *
  3857.      * @param eTag Value used in the IF-Match header, by default "*"
  3858.      */
  3859.     Item.prototype.delete = function (eTag) {
  3860.         if (eTag === void 0) { eTag = "*"; }
  3861.         return this.post({
  3862.             headers: {
  3863.                 "IF-Match": eTag,
  3864.                 "X-HTTP-Method": "DELETE",
  3865.             },
  3866.         });
  3867.     };
  3868.     /**
  3869.      * Moves the list item to the Recycle Bin and returns the identifier of the new Recycle Bin item.
  3870.      */
  3871.     Item.prototype.recycle = function () {
  3872.         return this.clone(Item, "recycle", true).post();
  3873.     };
  3874.     /**
  3875.      * Gets a string representation of the full URL to the WOPI frame.
  3876.      * If there is no associated WOPI application, or no associated action, an empty string is returned.
  3877.      *
  3878.      * @param action Display mode: 0: view, 1: edit, 2: mobileView, 3: interactivePreview
  3879.      */
  3880.     Item.prototype.getWopiFrameUrl = function (action) {
  3881.         if (action === void 0) { action = 0; }
  3882.         var i = this.clone(Item, "getWOPIFrameUrl(@action)", true);
  3883.         i._query.add("@action", action);
  3884.         return i.post().then(function (data) {
  3885.             return data.GetWOPIFrameUrl;
  3886.         });
  3887.     };
  3888.     /**
  3889.      * Validates and sets the values of the specified collection of fields for the list item.
  3890.      *
  3891.      * @param formValues The fields to change and their new values.
  3892.      * @param newDocumentUpdate true if the list item is a document being updated after upload; otherwise false.
  3893.      */
  3894.     Item.prototype.validateUpdateListItem = function (formValues, newDocumentUpdate) {
  3895.         if (newDocumentUpdate === void 0) { newDocumentUpdate = false; }
  3896.         return this.clone(Item, "validateupdatelistitem", true).post({
  3897.             body: JSON.stringify({ "formValues": formValues, bNewDocumentUpdate: newDocumentUpdate }),
  3898.         });
  3899.     };
  3900.     return Item;
  3901. }(queryableshareable_1.QueryableShareableItem));
  3902. exports.Item = Item;
  3903. /**
  3904.  * Provides paging functionality for list items
  3905.  */
  3906. var PagedItemCollection = (function () {
  3907.     function PagedItemCollection(nextUrl, results) {
  3908.         this.nextUrl = nextUrl;
  3909.         this.results = results;
  3910.     }
  3911.     Object.defineProperty(PagedItemCollection.prototype, "hasNext", {
  3912.         /**
  3913.          * If true there are more results available in the set, otherwise there are not
  3914.          */
  3915.         get: function () {
  3916.             return typeof this.nextUrl === "string" && this.nextUrl.length > 0;
  3917.         },
  3918.         enumerable: true,
  3919.         configurable: true
  3920.     });
  3921.     /**
  3922.      * Gets the next set of results, or resolves to null if no results are available
  3923.      */
  3924.     PagedItemCollection.prototype.getNext = function () {
  3925.         if (this.hasNext) {
  3926.             var items = new Items(this.nextUrl, null);
  3927.             return items.getPaged();
  3928.         }
  3929.         return new Promise(function (r) { return r(null); });
  3930.     };
  3931.     return PagedItemCollection;
  3932. }());
  3933. exports.PagedItemCollection = PagedItemCollection;
  3934. var PagedItemCollectionParser = (function (_super) {
  3935.     __extends(PagedItemCollectionParser, _super);
  3936.     function PagedItemCollectionParser() {
  3937.         return _super !== null && _super.apply(this, arguments) || this;
  3938.     }
  3939.     PagedItemCollectionParser.prototype.parse = function (r) {
  3940.         var _this = this;
  3941.         return new Promise(function (resolve, reject) {
  3942.             if (_this.handleError(r, reject)) {
  3943.                 r.json().then(function (json) {
  3944.                     var nextUrl = json.hasOwnProperty("d") && json.d.hasOwnProperty("__next") ? json.d.__next : json["odata.nextLink"];
  3945.                     resolve(new PagedItemCollection(nextUrl, _this.parseODataJSON(json)));
  3946.                 });
  3947.             }
  3948.         });
  3949.     };
  3950.     return PagedItemCollectionParser;
  3951. }(odata_1.ODataParserBase));
  3952. var ItemUpdatedParser = (function (_super) {
  3953.     __extends(ItemUpdatedParser, _super);
  3954.     function ItemUpdatedParser() {
  3955.         return _super !== null && _super.apply(this, arguments) || this;
  3956.     }
  3957.     ItemUpdatedParser.prototype.parse = function (r) {
  3958.         var _this = this;
  3959.         return new Promise(function (resolve, reject) {
  3960.             if (_this.handleError(r, reject)) {
  3961.                 resolve({
  3962.                     "odata.etag": r.headers.get("etag"),
  3963.                 });
  3964.             }
  3965.         });
  3966.     };
  3967.     return ItemUpdatedParser;
  3968. }(odata_1.ODataParserBase));
  3969.  
  3970.  
  3971. /***/ }),
  3972. /* 11 */
  3973. /***/ (function(module, exports, __webpack_require__) {
  3974.  
  3975. "use strict";
  3976.  
  3977. var __extends = (this && this.__extends) || (function () {
  3978.     var extendStatics = Object.setPrototypeOf ||
  3979.         ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  3980.         function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  3981.     return function (d, b) {
  3982.         extendStatics(d, b);
  3983.         function __() { this.constructor = d; }
  3984.         d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  3985.     };
  3986. })();
  3987. Object.defineProperty(exports, "__esModule", { value: true });
  3988. var items_1 = __webpack_require__(10);
  3989. var views_1 = __webpack_require__(49);
  3990. var contenttypes_1 = __webpack_require__(16);
  3991. var fields_1 = __webpack_require__(24);
  3992. var forms_1 = __webpack_require__(43);
  3993. var subscriptions_1 = __webpack_require__(47);
  3994. var queryable_1 = __webpack_require__(1);
  3995. var queryablesecurable_1 = __webpack_require__(26);
  3996. var util_1 = __webpack_require__(0);
  3997. var usercustomactions_1 = __webpack_require__(19);
  3998. var odata_1 = __webpack_require__(2);
  3999. var exceptions_1 = __webpack_require__(3);
  4000. var folders_1 = __webpack_require__(9);
  4001. /**
  4002.  * Describes a collection of List objects
  4003.  *
  4004.  */
  4005. var Lists = (function (_super) {
  4006.     __extends(Lists, _super);
  4007.     /**
  4008.      * Creates a new instance of the Lists class
  4009.      *
  4010.      * @param baseUrl The url or Queryable which forms the parent of this fields collection
  4011.      */
  4012.     function Lists(baseUrl, path) {
  4013.         if (path === void 0) { path = "lists"; }
  4014.         return _super.call(this, baseUrl, path) || this;
  4015.     }
  4016.     /**
  4017.      * Gets a list from the collection by title
  4018.      *
  4019.      * @param title The title of the list
  4020.      */
  4021.     Lists.prototype.getByTitle = function (title) {
  4022.         return new List(this, "getByTitle('" + title + "')");
  4023.     };
  4024.     /**
  4025.      * Gets a list from the collection by guid id
  4026.      *
  4027.      * @param id The Id of the list (GUID)
  4028.      */
  4029.     Lists.prototype.getById = function (id) {
  4030.         var list = new List(this);
  4031.         list.concat("('" + id + "')");
  4032.         return list;
  4033.     };
  4034.     /**
  4035.      * Adds a new list to the collection
  4036.      *
  4037.      * @param title The new list's title
  4038.      * @param description The new list's description
  4039.      * @param template The list template value
  4040.      * @param enableContentTypes If true content types will be allowed and enabled, otherwise they will be disallowed and not enabled
  4041.      * @param additionalSettings Will be passed as part of the list creation body
  4042.      */
  4043.     Lists.prototype.add = function (title, description, template, enableContentTypes, additionalSettings) {
  4044.         var _this = this;
  4045.         if (description === void 0) { description = ""; }
  4046.         if (template === void 0) { template = 100; }
  4047.         if (enableContentTypes === void 0) { enableContentTypes = false; }
  4048.         if (additionalSettings === void 0) { additionalSettings = {}; }
  4049.         var addSettings = util_1.Util.extend({
  4050.             "AllowContentTypes": enableContentTypes,
  4051.             "BaseTemplate": template,
  4052.             "ContentTypesEnabled": enableContentTypes,
  4053.             "Description": description,
  4054.             "Title": title,
  4055.             "__metadata": { "type": "SP.List" },
  4056.         }, additionalSettings);
  4057.         return this.post({ body: JSON.stringify(addSettings) }).then(function (data) {
  4058.             return { data: data, list: _this.getByTitle(addSettings.Title) };
  4059.         });
  4060.     };
  4061.     /**
  4062.      * Ensures that the specified list exists in the collection (note: this method not supported for batching)
  4063.      *
  4064.      * @param title The new list's title
  4065.      * @param description The new list's description
  4066.      * @param template The list template value
  4067.      * @param enableContentTypes If true content types will be allowed and enabled, otherwise they will be disallowed and not enabled
  4068.      * @param additionalSettings Will be passed as part of the list creation body or used to update an existing list
  4069.      */
  4070.     Lists.prototype.ensure = function (title, description, template, enableContentTypes, additionalSettings) {
  4071.         var _this = this;
  4072.         if (description === void 0) { description = ""; }
  4073.         if (template === void 0) { template = 100; }
  4074.         if (enableContentTypes === void 0) { enableContentTypes = false; }
  4075.         if (additionalSettings === void 0) { additionalSettings = {}; }
  4076.         if (this.hasBatch) {
  4077.             throw new exceptions_1.NotSupportedInBatchException("The ensure list method");
  4078.         }
  4079.         return new Promise(function (resolve, reject) {
  4080.             var addOrUpdateSettings = util_1.Util.extend(additionalSettings, { Title: title, Description: description, ContentTypesEnabled: enableContentTypes }, true);
  4081.             var list = _this.getByTitle(addOrUpdateSettings.Title);
  4082.             list.get().then(function (_) {
  4083.                 list.update(addOrUpdateSettings).then(function (d) {
  4084.                     resolve({ created: false, data: d, list: _this.getByTitle(addOrUpdateSettings.Title) });
  4085.                 }).catch(function (e) { return reject(e); });
  4086.             }).catch(function (_) {
  4087.                 _this.add(title, description, template, enableContentTypes, addOrUpdateSettings).then(function (r) {
  4088.                     resolve({ created: true, data: r.data, list: _this.getByTitle(addOrUpdateSettings.Title) });
  4089.                 }).catch(function (e) { return reject(e); });
  4090.             });
  4091.         });
  4092.     };
  4093.     /**
  4094.      * Gets a list that is the default asset location for images or other files, which the users upload to their wiki pages.
  4095.      */
  4096.     Lists.prototype.ensureSiteAssetsLibrary = function () {
  4097.         return this.clone(Lists, "ensuresiteassetslibrary", true).post().then(function (json) {
  4098.             return new List(odata_1.extractOdataId(json));
  4099.         });
  4100.     };
  4101.     /**
  4102.      * Gets a list that is the default location for wiki pages.
  4103.      */
  4104.     Lists.prototype.ensureSitePagesLibrary = function () {
  4105.         return this.clone(Lists, "ensuresitepageslibrary", true).post().then(function (json) {
  4106.             return new List(odata_1.extractOdataId(json));
  4107.         });
  4108.     };
  4109.     return Lists;
  4110. }(queryable_1.QueryableCollection));
  4111. exports.Lists = Lists;
  4112. /**
  4113.  * Describes a single List instance
  4114.  *
  4115.  */
  4116. var List = (function (_super) {
  4117.     __extends(List, _super);
  4118.     function List() {
  4119.         return _super !== null && _super.apply(this, arguments) || this;
  4120.     }
  4121.     Object.defineProperty(List.prototype, "contentTypes", {
  4122.         /**
  4123.          * Gets the content types in this list
  4124.          *
  4125.          */
  4126.         get: function () {
  4127.             return new contenttypes_1.ContentTypes(this);
  4128.         },
  4129.         enumerable: true,
  4130.         configurable: true
  4131.     });
  4132.     Object.defineProperty(List.prototype, "items", {
  4133.         /**
  4134.          * Gets the items in this list
  4135.          *
  4136.          */
  4137.         get: function () {
  4138.             return new items_1.Items(this);
  4139.         },
  4140.         enumerable: true,
  4141.         configurable: true
  4142.     });
  4143.     Object.defineProperty(List.prototype, "views", {
  4144.         /**
  4145.          * Gets the views in this list
  4146.          *
  4147.          */
  4148.         get: function () {
  4149.             return new views_1.Views(this);
  4150.         },
  4151.         enumerable: true,
  4152.         configurable: true
  4153.     });
  4154.     Object.defineProperty(List.prototype, "fields", {
  4155.         /**
  4156.          * Gets the fields in this list
  4157.          *
  4158.          */
  4159.         get: function () {
  4160.             return new fields_1.Fields(this);
  4161.         },
  4162.         enumerable: true,
  4163.         configurable: true
  4164.     });
  4165.     Object.defineProperty(List.prototype, "forms", {
  4166.         /**
  4167.          * Gets the forms in this list
  4168.          *
  4169.          */
  4170.         get: function () {
  4171.             return new forms_1.Forms(this);
  4172.         },
  4173.         enumerable: true,
  4174.         configurable: true
  4175.     });
  4176.     Object.defineProperty(List.prototype, "defaultView", {
  4177.         /**
  4178.          * Gets the default view of this list
  4179.          *
  4180.          */
  4181.         get: function () {
  4182.             return new queryable_1.QueryableInstance(this, "DefaultView");
  4183.         },
  4184.         enumerable: true,
  4185.         configurable: true
  4186.     });
  4187.     Object.defineProperty(List.prototype, "userCustomActions", {
  4188.         /**
  4189.          * Get all custom actions on a site collection
  4190.          *
  4191.          */
  4192.         get: function () {
  4193.             return new usercustomactions_1.UserCustomActions(this);
  4194.         },
  4195.         enumerable: true,
  4196.         configurable: true
  4197.     });
  4198.     Object.defineProperty(List.prototype, "effectiveBasePermissions", {
  4199.         /**
  4200.          * Gets the effective base permissions of this list
  4201.          *
  4202.          */
  4203.         get: function () {
  4204.             return new queryable_1.Queryable(this, "EffectiveBasePermissions");
  4205.         },
  4206.         enumerable: true,
  4207.         configurable: true
  4208.     });
  4209.     Object.defineProperty(List.prototype, "eventReceivers", {
  4210.         /**
  4211.          * Gets the event receivers attached to this list
  4212.          *
  4213.          */
  4214.         get: function () {
  4215.             return new queryable_1.QueryableCollection(this, "EventReceivers");
  4216.         },
  4217.         enumerable: true,
  4218.         configurable: true
  4219.     });
  4220.     Object.defineProperty(List.prototype, "relatedFields", {
  4221.         /**
  4222.          * Gets the related fields of this list
  4223.          *
  4224.          */
  4225.         get: function () {
  4226.             return new queryable_1.Queryable(this, "getRelatedFields");
  4227.         },
  4228.         enumerable: true,
  4229.         configurable: true
  4230.     });
  4231.     Object.defineProperty(List.prototype, "informationRightsManagementSettings", {
  4232.         /**
  4233.          * Gets the IRM settings for this list
  4234.          *
  4235.          */
  4236.         get: function () {
  4237.             return new queryable_1.Queryable(this, "InformationRightsManagementSettings");
  4238.         },
  4239.         enumerable: true,
  4240.         configurable: true
  4241.     });
  4242.     Object.defineProperty(List.prototype, "subscriptions", {
  4243.         /**
  4244.          * Gets the webhook subscriptions of this list
  4245.          *
  4246.          */
  4247.         get: function () {
  4248.             return new subscriptions_1.Subscriptions(this);
  4249.         },
  4250.         enumerable: true,
  4251.         configurable: true
  4252.     });
  4253.     Object.defineProperty(List.prototype, "rootFolder", {
  4254.         /**
  4255.          * The root folder of the list
  4256.          */
  4257.         get: function () {
  4258.             return new folders_1.Folder(this, "rootFolder");
  4259.         },
  4260.         enumerable: true,
  4261.         configurable: true
  4262.     });
  4263.     /**
  4264.      * Gets a view by view guid id
  4265.      *
  4266.      */
  4267.     List.prototype.getView = function (viewId) {
  4268.         return new views_1.View(this, "getView('" + viewId + "')");
  4269.     };
  4270.     /**
  4271.      * Updates this list intance with the supplied properties
  4272.      *
  4273.      * @param properties A plain object hash of values to update for the list
  4274.      * @param eTag Value used in the IF-Match header, by default "*"
  4275.      */
  4276.     /* tslint:disable no-string-literal */
  4277.     List.prototype.update = function (properties, eTag) {
  4278.         var _this = this;
  4279.         if (eTag === void 0) { eTag = "*"; }
  4280.         var postBody = JSON.stringify(util_1.Util.extend({
  4281.             "__metadata": { "type": "SP.List" },
  4282.         }, properties));
  4283.         return this.post({
  4284.             body: postBody,
  4285.             headers: {
  4286.                 "IF-Match": eTag,
  4287.                 "X-HTTP-Method": "MERGE",
  4288.             },
  4289.         }).then(function (data) {
  4290.             var retList = _this;
  4291.             if (properties.hasOwnProperty("Title")) {
  4292.                 retList = _this.getParent(List, _this.parentUrl, "getByTitle('" + properties["Title"] + "')");
  4293.             }
  4294.             return {
  4295.                 data: data,
  4296.                 list: retList,
  4297.             };
  4298.         });
  4299.     };
  4300.     /* tslint:enable */
  4301.     /**
  4302.      * Delete this list
  4303.      *
  4304.      * @param eTag Value used in the IF-Match header, by default "*"
  4305.      */
  4306.     List.prototype.delete = function (eTag) {
  4307.         if (eTag === void 0) { eTag = "*"; }
  4308.         return this.post({
  4309.             headers: {
  4310.                 "IF-Match": eTag,
  4311.                 "X-HTTP-Method": "DELETE",
  4312.             },
  4313.         });
  4314.     };
  4315.     /**
  4316.      * Returns the collection of changes from the change log that have occurred within the list, based on the specified query.
  4317.      */
  4318.     List.prototype.getChanges = function (query) {
  4319.         return this.clone(List, "getchanges", true).post({
  4320.             body: JSON.stringify({ "query": util_1.Util.extend({ "__metadata": { "type": "SP.ChangeQuery" } }, query) }),
  4321.         });
  4322.     };
  4323.     /**
  4324.      * Returns a collection of items from the list based on the specified query.
  4325.      *
  4326.      * @param CamlQuery The Query schema of Collaborative Application Markup
  4327.      * Language (CAML) is used in various ways within the context of Microsoft SharePoint Foundation
  4328.      * to define queries against list data.
  4329.      * see:
  4330.      *
  4331.      * https://msdn.microsoft.com/en-us/library/office/ms467521.aspx
  4332.      *
  4333.      * @param expands A URI with a $expand System Query Option indicates that Entries associated with
  4334.      * the Entry or Collection of Entries identified by the Resource Path
  4335.      * section of the URI must be represented inline (i.e. eagerly loaded).
  4336.      * see:
  4337.      *
  4338.      * https://msdn.microsoft.com/en-us/library/office/fp142385.aspx
  4339.      *
  4340.      * http://www.odata.org/documentation/odata-version-2-0/uri-conventions/#ExpandSystemQueryOption
  4341.      */
  4342.     List.prototype.getItemsByCAMLQuery = function (query) {
  4343.         var expands = [];
  4344.         for (var _i = 1; _i < arguments.length; _i++) {
  4345.             expands[_i - 1] = arguments[_i];
  4346.         }
  4347.         var q = this.clone(List, "getitems", true);
  4348.         return q.expand.apply(q, expands).post({
  4349.             body: JSON.stringify({ "query": util_1.Util.extend({ "__metadata": { "type": "SP.CamlQuery" } }, query) }),
  4350.         });
  4351.     };
  4352.     /**
  4353.      * See: https://msdn.microsoft.com/en-us/library/office/dn292554.aspx
  4354.      */
  4355.     List.prototype.getListItemChangesSinceToken = function (query) {
  4356.         return this.clone(List, "getlistitemchangessincetoken", true).post({
  4357.             body: JSON.stringify({ "query": util_1.Util.extend({ "__metadata": { "type": "SP.ChangeLogItemQuery" } }, query) }),
  4358.         }, { parse: function (r) { return r.text(); } });
  4359.     };
  4360.     /**
  4361.      * Moves the list to the Recycle Bin and returns the identifier of the new Recycle Bin item.
  4362.      */
  4363.     List.prototype.recycle = function () {
  4364.         return this.clone(List, "recycle", true).post().then(function (data) {
  4365.             if (data.hasOwnProperty("Recycle")) {
  4366.                 return data.Recycle;
  4367.             }
  4368.             else {
  4369.                 return data;
  4370.             }
  4371.         });
  4372.     };
  4373.     /**
  4374.      * Renders list data based on the view xml provided
  4375.      */
  4376.     List.prototype.renderListData = function (viewXml) {
  4377.         var q = this.clone(List, "renderlistdata(@viewXml)");
  4378.         q.query.add("@viewXml", "'" + viewXml + "'");
  4379.         return q.post().then(function (data) {
  4380.             // data will be a string, so we parse it again
  4381.             data = JSON.parse(data);
  4382.             if (data.hasOwnProperty("RenderListData")) {
  4383.                 return data.RenderListData;
  4384.             }
  4385.             else {
  4386.                 return data;
  4387.             }
  4388.         });
  4389.     };
  4390.     /**
  4391.      * Gets the field values and field schema attributes for a list item.
  4392.      */
  4393.     List.prototype.renderListFormData = function (itemId, formId, mode) {
  4394.         return this.clone(List, "renderlistformdata(itemid=" + itemId + ", formid='" + formId + "', mode='" + mode + "')", true).post().then(function (data) {
  4395.             // data will be a string, so we parse it again
  4396.             data = JSON.parse(data);
  4397.             if (data.hasOwnProperty("ListData")) {
  4398.                 return data.ListData;
  4399.             }
  4400.             else {
  4401.                 return data;
  4402.             }
  4403.         });
  4404.     };
  4405.     /**
  4406.      * Reserves a list item ID for idempotent list item creation.
  4407.      */
  4408.     List.prototype.reserveListItemId = function () {
  4409.         return this.clone(List, "reservelistitemid", true).post().then(function (data) {
  4410.             if (data.hasOwnProperty("ReserveListItemId")) {
  4411.                 return data.ReserveListItemId;
  4412.             }
  4413.             else {
  4414.                 return data;
  4415.             }
  4416.         });
  4417.     };
  4418.     /**
  4419.      * Returns the ListItemEntityTypeFullName for this list, used when adding/updating list items. Does not support batching.
  4420.      *
  4421.      */
  4422.     List.prototype.getListItemEntityTypeFullName = function () {
  4423.         return this.clone(List, null).select("ListItemEntityTypeFullName").getAs().then(function (o) { return o.ListItemEntityTypeFullName; });
  4424.     };
  4425.     return List;
  4426. }(queryablesecurable_1.QueryableSecurable));
  4427. exports.List = List;
  4428.  
  4429.  
  4430. /***/ }),
  4431. /* 12 */
  4432. /***/ (function(module, exports, __webpack_require__) {
  4433.  
  4434. "use strict";
  4435.  
  4436. var __extends = (this && this.__extends) || (function () {
  4437.     var extendStatics = Object.setPrototypeOf ||
  4438.         ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  4439.         function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  4440.     return function (d, b) {
  4441.         extendStatics(d, b);
  4442.         function __() { this.constructor = d; }
  4443.         d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  4444.     };
  4445. })();
  4446. Object.defineProperty(exports, "__esModule", { value: true });
  4447. var util_1 = __webpack_require__(0);
  4448. var webs_1 = __webpack_require__(7);
  4449. var odata_1 = __webpack_require__(2);
  4450. var queryable_1 = __webpack_require__(1);
  4451. var queryablesecurable_1 = __webpack_require__(26);
  4452. var types_1 = __webpack_require__(13);
  4453. /**
  4454.  * Internal helper class used to augment classes to include sharing functionality
  4455.  */
  4456. var QueryableShareable = (function (_super) {
  4457.     __extends(QueryableShareable, _super);
  4458.     function QueryableShareable() {
  4459.         return _super !== null && _super.apply(this, arguments) || this;
  4460.     }
  4461.     /**
  4462.      * Gets a sharing link for the supplied
  4463.      *
  4464.      * @param kind The kind of link to share
  4465.      * @param expiration The optional expiration for this link
  4466.      */
  4467.     QueryableShareable.prototype.getShareLink = function (kind, expiration) {
  4468.         if (expiration === void 0) { expiration = null; }
  4469.         // date needs to be an ISO string or null
  4470.         var expString = expiration !== null ? expiration.toISOString() : null;
  4471.         // clone using the factory and send the request
  4472.         return this.clone(QueryableShareable, "shareLink", true).postAs({
  4473.             body: JSON.stringify({
  4474.                 request: {
  4475.                     createLink: true,
  4476.                     emailData: null,
  4477.                     settings: {
  4478.                         expiration: expString,
  4479.                         linkKind: kind,
  4480.                     },
  4481.                 },
  4482.             }),
  4483.         });
  4484.     };
  4485.     /**
  4486.      * Shares this instance with the supplied users
  4487.      *
  4488.      * @param loginNames Resolved login names to share
  4489.      * @param role The role
  4490.      * @param requireSignin True to require the user is authenticated, otherwise false
  4491.      * @param propagateAcl True to apply this share to all children
  4492.      * @param emailData If supplied an email will be sent with the indicated properties
  4493.      */
  4494.     QueryableShareable.prototype.shareWith = function (loginNames, role, requireSignin, propagateAcl, emailData) {
  4495.         var _this = this;
  4496.         if (requireSignin === void 0) { requireSignin = true; }
  4497.         if (propagateAcl === void 0) { propagateAcl = false; }
  4498.         // handle the multiple input types
  4499.         if (!Array.isArray(loginNames)) {
  4500.             loginNames = [loginNames];
  4501.         }
  4502.         var userStr = JSON.stringify(loginNames.map(function (login) { return { Key: login }; }));
  4503.         var roleFilter = role === types_1.SharingRole.Edit ? types_1.RoleType.Contributor : types_1.RoleType.Reader;
  4504.         // start by looking up the role definition id we need to set the roleValue
  4505.         return webs_1.Web.fromUrl(this.toUrl()).roleDefinitions.select("Id").filter("RoleTypeKind eq " + roleFilter).get().then(function (def) {
  4506.             if (!Array.isArray(def) || def.length < 1) {
  4507.                 throw new Error("Could not locate a role defintion with RoleTypeKind " + roleFilter);
  4508.             }
  4509.             var postBody = {
  4510.                 includeAnonymousLinkInEmail: requireSignin,
  4511.                 peoplePickerInput: userStr,
  4512.                 propagateAcl: propagateAcl,
  4513.                 roleValue: "role:" + def[0].Id,
  4514.                 useSimplifiedRoles: true,
  4515.             };
  4516.             if (typeof emailData !== "undefined") {
  4517.                 postBody = util_1.Util.extend(postBody, {
  4518.                     emailBody: emailData.body,
  4519.                     emailSubject: typeof emailData.subject !== "undefined" ? "" : emailData.subject,
  4520.                     sendEmail: true,
  4521.                 });
  4522.             }
  4523.             return _this.clone(QueryableShareable, "shareObject", true).postAs({
  4524.                 body: JSON.stringify(postBody),
  4525.             });
  4526.         });
  4527.     };
  4528.     /**
  4529.      * Shares an object based on the supplied options
  4530.      *
  4531.      * @param options The set of options to send to the ShareObject method
  4532.      * @param bypass If true any processing is skipped and the options are sent directly to the ShareObject method
  4533.      */
  4534.     QueryableShareable.prototype.shareObject = function (options, bypass) {
  4535.         var _this = this;
  4536.         if (bypass === void 0) { bypass = false; }
  4537.         if (bypass) {
  4538.             // if the bypass flag is set send the supplied parameters directly to the service
  4539.             return this.sendShareObjectRequest(options);
  4540.         }
  4541.         // extend our options with some defaults
  4542.         options = util_1.Util.extend(options, {
  4543.             group: null,
  4544.             includeAnonymousLinkInEmail: false,
  4545.             propagateAcl: false,
  4546.             useSimplifiedRoles: true,
  4547.         }, true);
  4548.         return this.getRoleValue(options.role, options.group).then(function (roleValue) {
  4549.             // handle the multiple input types
  4550.             if (!Array.isArray(options.loginNames)) {
  4551.                 options.loginNames = [options.loginNames];
  4552.             }
  4553.             var userStr = JSON.stringify(options.loginNames.map(function (login) { return { Key: login }; }));
  4554.             var postBody = {
  4555.                 peoplePickerInput: userStr,
  4556.                 roleValue: roleValue,
  4557.                 url: options.url,
  4558.             };
  4559.             if (typeof options.emailData !== "undefined" && options.emailData !== null) {
  4560.                 postBody = util_1.Util.extend(postBody, {
  4561.                     emailBody: options.emailData.body,
  4562.                     emailSubject: typeof options.emailData.subject !== "undefined" ? "Shared for you." : options.emailData.subject,
  4563.                     sendEmail: true,
  4564.                 });
  4565.             }
  4566.             return _this.sendShareObjectRequest(postBody);
  4567.         });
  4568.     };
  4569.     /**
  4570.      * Calls the web's UnshareObject method
  4571.      *
  4572.      * @param url The url of the object to unshare
  4573.      */
  4574.     QueryableShareable.prototype.unshareObjectWeb = function (url) {
  4575.         return this.clone(QueryableShareable, "unshareObject", true).postAs({
  4576.             body: JSON.stringify({
  4577.                 url: url,
  4578.             }),
  4579.         });
  4580.     };
  4581.     /**
  4582.      * Checks Permissions on the list of Users and returns back role the users have on the Item.
  4583.      *
  4584.      * @param recipients The array of Entities for which Permissions need to be checked.
  4585.      */
  4586.     QueryableShareable.prototype.checkPermissions = function (recipients) {
  4587.         return this.clone(QueryableShareable, "checkPermissions", true).postAs({
  4588.             body: JSON.stringify({
  4589.                 recipients: recipients,
  4590.             }),
  4591.         });
  4592.     };
  4593.     /**
  4594.      * Get Sharing Information.
  4595.      *
  4596.      * @param request The SharingInformationRequest Object.
  4597.      */
  4598.     QueryableShareable.prototype.getSharingInformation = function (request) {
  4599.         if (request === void 0) { request = null; }
  4600.         return this.clone(QueryableShareable, "getSharingInformation", true).postAs({
  4601.             body: JSON.stringify({
  4602.                 request: request,
  4603.             }),
  4604.         });
  4605.     };
  4606.     /**
  4607.      * Gets the sharing settings of an item.
  4608.      *
  4609.      * @param useSimplifiedRoles Determines whether to use simplified roles.
  4610.      */
  4611.     QueryableShareable.prototype.getObjectSharingSettings = function (useSimplifiedRoles) {
  4612.         if (useSimplifiedRoles === void 0) { useSimplifiedRoles = true; }
  4613.         return this.clone(QueryableShareable, "getObjectSharingSettings", true).postAs({
  4614.             body: JSON.stringify({
  4615.                 useSimplifiedRoles: useSimplifiedRoles,
  4616.             }),
  4617.         });
  4618.     };
  4619.     /**
  4620.      * Unshares this object
  4621.      */
  4622.     QueryableShareable.prototype.unshareObject = function () {
  4623.         return this.clone(QueryableShareable, "unshareObject", true).postAs();
  4624.     };
  4625.     /**
  4626.      * Deletes a link by type
  4627.      *
  4628.      * @param kind Deletes a sharing link by the kind of link
  4629.      */
  4630.     QueryableShareable.prototype.deleteLinkByKind = function (kind) {
  4631.         return this.clone(QueryableShareable, "deleteLinkByKind", true).post({
  4632.             body: JSON.stringify({ linkKind: kind }),
  4633.         });
  4634.     };
  4635.     /**
  4636.      * Removes the specified link to the item.
  4637.      *
  4638.      * @param kind The kind of link to be deleted.
  4639.      * @param shareId
  4640.      */
  4641.     QueryableShareable.prototype.unshareLink = function (kind, shareId) {
  4642.         if (shareId === void 0) { shareId = "00000000-0000-0000-0000-000000000000"; }
  4643.         return this.clone(QueryableShareable, "unshareLink", true).post({
  4644.             body: JSON.stringify({ linkKind: kind, shareId: shareId }),
  4645.         });
  4646.     };
  4647.     /**
  4648.      * Calculates the roleValue string used in the sharing query
  4649.      *
  4650.      * @param role The Sharing Role
  4651.      * @param group The Group type
  4652.      */
  4653.     QueryableShareable.prototype.getRoleValue = function (role, group) {
  4654.         // we will give group precedence, because we had to make a choice
  4655.         if (typeof group !== "undefined" && group !== null) {
  4656.             switch (group) {
  4657.                 case types_1.RoleType.Contributor:
  4658.                     return webs_1.Web.fromUrl(this.toUrl()).associatedMemberGroup.select("Id").getAs().then(function (g) { return "group: " + g.Id; });
  4659.                 case types_1.RoleType.Reader:
  4660.                 case types_1.RoleType.Guest:
  4661.                     return webs_1.Web.fromUrl(this.toUrl()).associatedVisitorGroup.select("Id").getAs().then(function (g) { return "group: " + g.Id; });
  4662.                 default:
  4663.                     throw new Error("Could not determine role value for supplied value. Contributor, Reader, and Guest are supported");
  4664.             }
  4665.         }
  4666.         else {
  4667.             var roleFilter = role === types_1.SharingRole.Edit ? types_1.RoleType.Contributor : types_1.RoleType.Reader;
  4668.             return webs_1.Web.fromUrl(this.toUrl()).roleDefinitions.select("Id").top(1).filter("RoleTypeKind eq " + roleFilter).getAs().then(function (def) {
  4669.                 if (def.length < 1) {
  4670.                     throw new Error("Could not locate associated role definition for supplied role. Edit and View are supported");
  4671.                 }
  4672.                 return "role: " + def[0].Id;
  4673.             });
  4674.         }
  4675.     };
  4676.     QueryableShareable.prototype.getShareObjectWeb = function (candidate) {
  4677.         return Promise.resolve(webs_1.Web.fromUrl(candidate, "/_api/SP.Web.ShareObject"));
  4678.     };
  4679.     QueryableShareable.prototype.sendShareObjectRequest = function (options) {
  4680.         return this.getShareObjectWeb(this.toUrl()).then(function (web) {
  4681.             return web.expand("UsersWithAccessRequests", "GroupsSharedWith").as(QueryableShareable).post({
  4682.                 body: JSON.stringify(options),
  4683.             });
  4684.         });
  4685.     };
  4686.     return QueryableShareable;
  4687. }(queryable_1.Queryable));
  4688. exports.QueryableShareable = QueryableShareable;
  4689. var QueryableShareableWeb = (function (_super) {
  4690.     __extends(QueryableShareableWeb, _super);
  4691.     function QueryableShareableWeb() {
  4692.         return _super !== null && _super.apply(this, arguments) || this;
  4693.     }
  4694.     /**
  4695.      * Shares this web with the supplied users
  4696.      * @param loginNames The resolved login names to share
  4697.      * @param role The role to share this web
  4698.      * @param emailData Optional email data
  4699.      */
  4700.     QueryableShareableWeb.prototype.shareWith = function (loginNames, role, emailData) {
  4701.         var _this = this;
  4702.         if (role === void 0) { role = types_1.SharingRole.View; }
  4703.         var dependency = this.addBatchDependency();
  4704.         return webs_1.Web.fromUrl(this.toUrl(), "/_api/web/url").get().then(function (url) {
  4705.             dependency();
  4706.             return _this.shareObject(util_1.Util.combinePaths(url, "/_layouts/15/aclinv.aspx?forSharing=1&mbypass=1"), loginNames, role, emailData);
  4707.         });
  4708.     };
  4709.     /**
  4710.      * Provides direct access to the static web.ShareObject method
  4711.      *
  4712.      * @param url The url to share
  4713.      * @param loginNames Resolved loginnames string[] of a single login name string
  4714.      * @param roleValue Role value
  4715.      * @param emailData Optional email data
  4716.      * @param groupId Optional group id
  4717.      * @param propagateAcl
  4718.      * @param includeAnonymousLinkInEmail
  4719.      * @param useSimplifiedRoles
  4720.      */
  4721.     QueryableShareableWeb.prototype.shareObject = function (url, loginNames, role, emailData, group, propagateAcl, includeAnonymousLinkInEmail, useSimplifiedRoles) {
  4722.         if (propagateAcl === void 0) { propagateAcl = false; }
  4723.         if (includeAnonymousLinkInEmail === void 0) { includeAnonymousLinkInEmail = false; }
  4724.         if (useSimplifiedRoles === void 0) { useSimplifiedRoles = true; }
  4725.         return this.clone(QueryableShareable, null, true).shareObject({
  4726.             emailData: emailData,
  4727.             group: group,
  4728.             includeAnonymousLinkInEmail: includeAnonymousLinkInEmail,
  4729.             loginNames: loginNames,
  4730.             propagateAcl: propagateAcl,
  4731.             role: role,
  4732.             url: url,
  4733.             useSimplifiedRoles: useSimplifiedRoles,
  4734.         });
  4735.     };
  4736.     /**
  4737.      * Supplies a method to pass any set of arguments to ShareObject
  4738.      *
  4739.      * @param options The set of options to send to ShareObject
  4740.      */
  4741.     QueryableShareableWeb.prototype.shareObjectRaw = function (options) {
  4742.         return this.clone(QueryableShareable, null, true).shareObject(options, true);
  4743.     };
  4744.     /**
  4745.      * Unshares the object
  4746.      *
  4747.      * @param url The url of the object to stop sharing
  4748.      */
  4749.     QueryableShareableWeb.prototype.unshareObject = function (url) {
  4750.         return this.clone(QueryableShareable, null, true).unshareObjectWeb(url);
  4751.     };
  4752.     return QueryableShareableWeb;
  4753. }(queryablesecurable_1.QueryableSecurable));
  4754. exports.QueryableShareableWeb = QueryableShareableWeb;
  4755. var QueryableShareableItem = (function (_super) {
  4756.     __extends(QueryableShareableItem, _super);
  4757.     function QueryableShareableItem() {
  4758.         return _super !== null && _super.apply(this, arguments) || this;
  4759.     }
  4760.     /**
  4761.      * Gets a link suitable for sharing for this item
  4762.      *
  4763.      * @param kind The type of link to share
  4764.      * @param expiration The optional expiration date
  4765.      */
  4766.     QueryableShareableItem.prototype.getShareLink = function (kind, expiration) {
  4767.         if (kind === void 0) { kind = types_1.SharingLinkKind.OrganizationView; }
  4768.         if (expiration === void 0) { expiration = null; }
  4769.         return this.clone(QueryableShareable, null, true).getShareLink(kind, expiration);
  4770.     };
  4771.     /**
  4772.      * Shares this item with one or more users
  4773.      *
  4774.      * @param loginNames string or string[] of resolved login names to which this item will be shared
  4775.      * @param role The role (View | Edit) applied to the share
  4776.      * @param emailData Optional, if inlucded an email will be sent. Note subject currently has no effect.
  4777.      */
  4778.     QueryableShareableItem.prototype.shareWith = function (loginNames, role, requireSignin, emailData) {
  4779.         if (role === void 0) { role = types_1.SharingRole.View; }
  4780.         if (requireSignin === void 0) { requireSignin = true; }
  4781.         return this.clone(QueryableShareable, null, true).shareWith(loginNames, role, requireSignin, false, emailData);
  4782.     };
  4783.     /**
  4784.      * Checks Permissions on the list of Users and returns back role the users have on the Item.
  4785.      *
  4786.      * @param recipients The array of Entities for which Permissions need to be checked.
  4787.      */
  4788.     QueryableShareableItem.prototype.checkSharingPermissions = function (recipients) {
  4789.         return this.clone(QueryableShareable, null, true).checkPermissions(recipients);
  4790.     };
  4791.     /**
  4792.      * Get Sharing Information.
  4793.      *
  4794.      * @param request The SharingInformationRequest Object.
  4795.      */
  4796.     QueryableShareableItem.prototype.getSharingInformation = function (request) {
  4797.         if (request === void 0) { request = null; }
  4798.         return this.clone(QueryableShareable, null, true).getSharingInformation(request);
  4799.     };
  4800.     /**
  4801.      * Gets the sharing settings of an item.
  4802.      *
  4803.      * @param useSimplifiedRoles Determines whether to use simplified roles.
  4804.      */
  4805.     QueryableShareableItem.prototype.getObjectSharingSettings = function (useSimplifiedRoles) {
  4806.         if (useSimplifiedRoles === void 0) { useSimplifiedRoles = true; }
  4807.         return this.clone(QueryableShareable, null, true).getObjectSharingSettings(useSimplifiedRoles);
  4808.     };
  4809.     /**
  4810.      * Unshare this item
  4811.      */
  4812.     QueryableShareableItem.prototype.unshare = function () {
  4813.         return this.clone(QueryableShareable, null, true).unshareObject();
  4814.     };
  4815.     /**
  4816.      * Deletes a sharing link by kind
  4817.      *
  4818.      * @param kind Deletes a sharing link by the kind of link
  4819.      */
  4820.     QueryableShareableItem.prototype.deleteSharingLinkByKind = function (kind) {
  4821.         return this.clone(QueryableShareable, null, true).deleteLinkByKind(kind);
  4822.     };
  4823.     /**
  4824.      * Removes the specified link to the item.
  4825.      *
  4826.      * @param kind The kind of link to be deleted.
  4827.      * @param shareId
  4828.      */
  4829.     QueryableShareableItem.prototype.unshareLink = function (kind, shareId) {
  4830.         return this.clone(QueryableShareable, null, true).unshareLink(kind, shareId);
  4831.     };
  4832.     return QueryableShareableItem;
  4833. }(queryablesecurable_1.QueryableSecurable));
  4834. exports.QueryableShareableItem = QueryableShareableItem;
  4835. var FileFolderShared = (function (_super) {
  4836.     __extends(FileFolderShared, _super);
  4837.     function FileFolderShared() {
  4838.         return _super !== null && _super.apply(this, arguments) || this;
  4839.     }
  4840.     /**
  4841.      * Gets a link suitable for sharing
  4842.      *
  4843.      * @param kind The kind of link to get
  4844.      * @param expiration Optional, an expiration for this link
  4845.      */
  4846.     FileFolderShared.prototype.getShareLink = function (kind, expiration) {
  4847.         if (kind === void 0) { kind = types_1.SharingLinkKind.OrganizationView; }
  4848.         if (expiration === void 0) { expiration = null; }
  4849.         var dependency = this.addBatchDependency();
  4850.         return this.getShareable().then(function (shareable) {
  4851.             dependency();
  4852.             return shareable.getShareLink(kind, expiration);
  4853.         });
  4854.     };
  4855.     /**
  4856.          * Checks Permissions on the list of Users and returns back role the users have on the Item.
  4857.          *
  4858.          * @param recipients The array of Entities for which Permissions need to be checked.
  4859.          */
  4860.     FileFolderShared.prototype.checkSharingPermissions = function (recipients) {
  4861.         var dependency = this.addBatchDependency();
  4862.         return this.getShareable().then(function (shareable) {
  4863.             dependency();
  4864.             return shareable.checkPermissions(recipients);
  4865.         });
  4866.     };
  4867.     /**
  4868.      * Get Sharing Information.
  4869.      *
  4870.      * @param request The SharingInformationRequest Object.
  4871.      */
  4872.     FileFolderShared.prototype.getSharingInformation = function (request) {
  4873.         if (request === void 0) { request = null; }
  4874.         var dependency = this.addBatchDependency();
  4875.         return this.getShareable().then(function (shareable) {
  4876.             dependency();
  4877.             return shareable.getSharingInformation(request);
  4878.         });
  4879.     };
  4880.     /**
  4881.      * Gets the sharing settings of an item.
  4882.      *
  4883.      * @param useSimplifiedRoles Determines whether to use simplified roles.
  4884.      */
  4885.     FileFolderShared.prototype.getObjectSharingSettings = function (useSimplifiedRoles) {
  4886.         if (useSimplifiedRoles === void 0) { useSimplifiedRoles = true; }
  4887.         var dependency = this.addBatchDependency();
  4888.         return this.getShareable().then(function (shareable) {
  4889.             dependency();
  4890.             return shareable.getObjectSharingSettings(useSimplifiedRoles);
  4891.         });
  4892.     };
  4893.     /**
  4894.      * Unshare this item
  4895.      */
  4896.     FileFolderShared.prototype.unshare = function () {
  4897.         var dependency = this.addBatchDependency();
  4898.         return this.getShareable().then(function (shareable) {
  4899.             dependency();
  4900.             return shareable.unshareObject();
  4901.         });
  4902.     };
  4903.     /**
  4904.      * Deletes a sharing link by the kind of link
  4905.      *
  4906.      * @param kind The kind of link to be deleted.
  4907.      */
  4908.     FileFolderShared.prototype.deleteSharingLinkByKind = function (kind) {
  4909.         var dependency = this.addBatchDependency();
  4910.         return this.getShareable().then(function (shareable) {
  4911.             dependency();
  4912.             return shareable.deleteLinkByKind(kind);
  4913.         });
  4914.     };
  4915.     /**
  4916.      * Removes the specified link to the item.
  4917.      *
  4918.      * @param kind The kind of link to be deleted.
  4919.      * @param shareId The share id to delete
  4920.      */
  4921.     FileFolderShared.prototype.unshareLink = function (kind, shareId) {
  4922.         var dependency = this.addBatchDependency();
  4923.         return this.getShareable().then(function (shareable) {
  4924.             dependency();
  4925.             return shareable.unshareLink(kind, shareId);
  4926.         });
  4927.     };
  4928.     /**
  4929.      * For files and folders we need to use the associated item end point
  4930.      */
  4931.     FileFolderShared.prototype.getShareable = function () {
  4932.         var _this = this;
  4933.         // sharing only works on the item end point, not the file one - so we create a folder instance with the item url internally
  4934.         return this.clone(QueryableShareableFile, "listItemAllFields", false).select("odata.editlink").get().then(function (d) {
  4935.             var shareable = new QueryableShareable(odata_1.getEntityUrl(d));
  4936.             // we need to handle batching
  4937.             if (_this.hasBatch) {
  4938.                 shareable = shareable.inBatch(_this.batch);
  4939.             }
  4940.             return shareable;
  4941.         });
  4942.     };
  4943.     return FileFolderShared;
  4944. }(queryable_1.QueryableInstance));
  4945. exports.FileFolderShared = FileFolderShared;
  4946. var QueryableShareableFile = (function (_super) {
  4947.     __extends(QueryableShareableFile, _super);
  4948.     function QueryableShareableFile() {
  4949.         return _super !== null && _super.apply(this, arguments) || this;
  4950.     }
  4951.     /**
  4952.      * Shares this item with one or more users
  4953.      *
  4954.      * @param loginNames string or string[] of resolved login names to which this item will be shared
  4955.      * @param role The role (View | Edit) applied to the share
  4956.      * @param shareEverything Share everything in this folder, even items with unique permissions.
  4957.      * @param requireSignin If true the user must signin to view link, otherwise anyone with the link can access the resource
  4958.      * @param emailData Optional, if inlucded an email will be sent. Note subject currently has no effect.
  4959.      */
  4960.     QueryableShareableFile.prototype.shareWith = function (loginNames, role, requireSignin, emailData) {
  4961.         if (role === void 0) { role = types_1.SharingRole.View; }
  4962.         if (requireSignin === void 0) { requireSignin = true; }
  4963.         var dependency = this.addBatchDependency();
  4964.         return this.getShareable().then(function (shareable) {
  4965.             dependency();
  4966.             return shareable.shareWith(loginNames, role, requireSignin, false, emailData);
  4967.         });
  4968.     };
  4969.     return QueryableShareableFile;
  4970. }(FileFolderShared));
  4971. exports.QueryableShareableFile = QueryableShareableFile;
  4972. var QueryableShareableFolder = (function (_super) {
  4973.     __extends(QueryableShareableFolder, _super);
  4974.     function QueryableShareableFolder() {
  4975.         return _super !== null && _super.apply(this, arguments) || this;
  4976.     }
  4977.     /**
  4978.      * Shares this item with one or more users
  4979.      *
  4980.      * @param loginNames string or string[] of resolved login names to which this item will be shared
  4981.      * @param role The role (View | Edit) applied to the share
  4982.      * @param shareEverything Share everything in this folder, even items with unique permissions.
  4983.      * @param requireSignin If true the user must signin to view link, otherwise anyone with the link can access the resource
  4984.      * @param emailData Optional, if inlucded an email will be sent. Note subject currently has no effect.
  4985.      */
  4986.     QueryableShareableFolder.prototype.shareWith = function (loginNames, role, requireSignin, shareEverything, emailData) {
  4987.         if (role === void 0) { role = types_1.SharingRole.View; }
  4988.         if (requireSignin === void 0) { requireSignin = true; }
  4989.         if (shareEverything === void 0) { shareEverything = false; }
  4990.         var dependency = this.addBatchDependency();
  4991.         return this.getShareable().then(function (shareable) {
  4992.             dependency();
  4993.             return shareable.shareWith(loginNames, role, requireSignin, shareEverything, emailData);
  4994.         });
  4995.     };
  4996.     return QueryableShareableFolder;
  4997. }(FileFolderShared));
  4998. exports.QueryableShareableFolder = QueryableShareableFolder;
  4999.  
  5000.  
  5001. /***/ }),
  5002. /* 13 */
  5003. /***/ (function(module, exports, __webpack_require__) {
  5004.  
  5005. "use strict";
  5006. // reference: https://msdn.microsoft.com/en-us/library/office/dn600183.aspx
  5007.  
  5008. Object.defineProperty(exports, "__esModule", { value: true });
  5009. /**
  5010.  * Determines the display mode of the given control or view
  5011.  */
  5012. var ControlMode;
  5013. (function (ControlMode) {
  5014.     ControlMode[ControlMode["Display"] = 1] = "Display";
  5015.     ControlMode[ControlMode["Edit"] = 2] = "Edit";
  5016.     ControlMode[ControlMode["New"] = 3] = "New";
  5017. })(ControlMode = exports.ControlMode || (exports.ControlMode = {}));
  5018. /**
  5019.  * Specifies the type of the field.
  5020.  */
  5021. var FieldTypes;
  5022. (function (FieldTypes) {
  5023.     FieldTypes[FieldTypes["Invalid"] = 0] = "Invalid";
  5024.     FieldTypes[FieldTypes["Integer"] = 1] = "Integer";
  5025.     FieldTypes[FieldTypes["Text"] = 2] = "Text";
  5026.     FieldTypes[FieldTypes["Note"] = 3] = "Note";
  5027.     FieldTypes[FieldTypes["DateTime"] = 4] = "DateTime";
  5028.     FieldTypes[FieldTypes["Counter"] = 5] = "Counter";
  5029.     FieldTypes[FieldTypes["Choice"] = 6] = "Choice";
  5030.     FieldTypes[FieldTypes["Lookup"] = 7] = "Lookup";
  5031.     FieldTypes[FieldTypes["Boolean"] = 8] = "Boolean";
  5032.     FieldTypes[FieldTypes["Number"] = 9] = "Number";
  5033.     FieldTypes[FieldTypes["Currency"] = 10] = "Currency";
  5034.     FieldTypes[FieldTypes["URL"] = 11] = "URL";
  5035.     FieldTypes[FieldTypes["Computed"] = 12] = "Computed";
  5036.     FieldTypes[FieldTypes["Threading"] = 13] = "Threading";
  5037.     FieldTypes[FieldTypes["Guid"] = 14] = "Guid";
  5038.     FieldTypes[FieldTypes["MultiChoice"] = 15] = "MultiChoice";
  5039.     FieldTypes[FieldTypes["GridChoice"] = 16] = "GridChoice";
  5040.     FieldTypes[FieldTypes["Calculated"] = 17] = "Calculated";
  5041.     FieldTypes[FieldTypes["File"] = 18] = "File";
  5042.     FieldTypes[FieldTypes["Attachments"] = 19] = "Attachments";
  5043.     FieldTypes[FieldTypes["User"] = 20] = "User";
  5044.     FieldTypes[FieldTypes["Recurrence"] = 21] = "Recurrence";
  5045.     FieldTypes[FieldTypes["CrossProjectLink"] = 22] = "CrossProjectLink";
  5046.     FieldTypes[FieldTypes["ModStat"] = 23] = "ModStat";
  5047.     FieldTypes[FieldTypes["Error"] = 24] = "Error";
  5048.     FieldTypes[FieldTypes["ContentTypeId"] = 25] = "ContentTypeId";
  5049.     FieldTypes[FieldTypes["PageSeparator"] = 26] = "PageSeparator";
  5050.     FieldTypes[FieldTypes["ThreadIndex"] = 27] = "ThreadIndex";
  5051.     FieldTypes[FieldTypes["WorkflowStatus"] = 28] = "WorkflowStatus";
  5052.     FieldTypes[FieldTypes["AllDayEvent"] = 29] = "AllDayEvent";
  5053.     FieldTypes[FieldTypes["WorkflowEventType"] = 30] = "WorkflowEventType";
  5054. })(FieldTypes = exports.FieldTypes || (exports.FieldTypes = {}));
  5055. var DateTimeFieldFormatType;
  5056. (function (DateTimeFieldFormatType) {
  5057.     DateTimeFieldFormatType[DateTimeFieldFormatType["DateOnly"] = 0] = "DateOnly";
  5058.     DateTimeFieldFormatType[DateTimeFieldFormatType["DateTime"] = 1] = "DateTime";
  5059. })(DateTimeFieldFormatType = exports.DateTimeFieldFormatType || (exports.DateTimeFieldFormatType = {}));
  5060. /**
  5061.  * Specifies the control settings while adding a field.
  5062.  */
  5063. var AddFieldOptions;
  5064. (function (AddFieldOptions) {
  5065.     /**
  5066.      *  Specify that a new field added to the list must also be added to the default content type in the site collection
  5067.      */
  5068.     AddFieldOptions[AddFieldOptions["DefaultValue"] = 0] = "DefaultValue";
  5069.     /**
  5070.      * Specify that a new field added to the list must also be added to the default content type in the site collection.
  5071.      */
  5072.     AddFieldOptions[AddFieldOptions["AddToDefaultContentType"] = 1] = "AddToDefaultContentType";
  5073.     /**
  5074.      * Specify that a new field must not be added to any other content type
  5075.      */
  5076.     AddFieldOptions[AddFieldOptions["AddToNoContentType"] = 2] = "AddToNoContentType";
  5077.     /**
  5078.      *  Specify that a new field that is added to the specified list must also be added to all content types in the site collection
  5079.      */
  5080.     AddFieldOptions[AddFieldOptions["AddToAllContentTypes"] = 4] = "AddToAllContentTypes";
  5081.     /**
  5082.      * Specify adding an internal field name hint for the purpose of avoiding possible database locking or field renaming operations
  5083.      */
  5084.     AddFieldOptions[AddFieldOptions["AddFieldInternalNameHint"] = 8] = "AddFieldInternalNameHint";
  5085.     /**
  5086.      * Specify that a new field that is added to the specified list must also be added to the default list view
  5087.      */
  5088.     AddFieldOptions[AddFieldOptions["AddFieldToDefaultView"] = 16] = "AddFieldToDefaultView";
  5089.     /**
  5090.      * Specify to confirm that no other field has the same display name
  5091.      */
  5092.     AddFieldOptions[AddFieldOptions["AddFieldCheckDisplayName"] = 32] = "AddFieldCheckDisplayName";
  5093. })(AddFieldOptions = exports.AddFieldOptions || (exports.AddFieldOptions = {}));
  5094. var CalendarType;
  5095. (function (CalendarType) {
  5096.     CalendarType[CalendarType["Gregorian"] = 1] = "Gregorian";
  5097.     CalendarType[CalendarType["Japan"] = 3] = "Japan";
  5098.     CalendarType[CalendarType["Taiwan"] = 4] = "Taiwan";
  5099.     CalendarType[CalendarType["Korea"] = 5] = "Korea";
  5100.     CalendarType[CalendarType["Hijri"] = 6] = "Hijri";
  5101.     CalendarType[CalendarType["Thai"] = 7] = "Thai";
  5102.     CalendarType[CalendarType["Hebrew"] = 8] = "Hebrew";
  5103.     CalendarType[CalendarType["GregorianMEFrench"] = 9] = "GregorianMEFrench";
  5104.     CalendarType[CalendarType["GregorianArabic"] = 10] = "GregorianArabic";
  5105.     CalendarType[CalendarType["GregorianXLITEnglish"] = 11] = "GregorianXLITEnglish";
  5106.     CalendarType[CalendarType["GregorianXLITFrench"] = 12] = "GregorianXLITFrench";
  5107.     CalendarType[CalendarType["KoreaJapanLunar"] = 14] = "KoreaJapanLunar";
  5108.     CalendarType[CalendarType["ChineseLunar"] = 15] = "ChineseLunar";
  5109.     CalendarType[CalendarType["SakaEra"] = 16] = "SakaEra";
  5110.     CalendarType[CalendarType["UmAlQura"] = 23] = "UmAlQura";
  5111. })(CalendarType = exports.CalendarType || (exports.CalendarType = {}));
  5112. var UrlFieldFormatType;
  5113. (function (UrlFieldFormatType) {
  5114.     UrlFieldFormatType[UrlFieldFormatType["Hyperlink"] = 0] = "Hyperlink";
  5115.     UrlFieldFormatType[UrlFieldFormatType["Image"] = 1] = "Image";
  5116. })(UrlFieldFormatType = exports.UrlFieldFormatType || (exports.UrlFieldFormatType = {}));
  5117. var PermissionKind;
  5118. (function (PermissionKind) {
  5119.     /**
  5120.      * Has no permissions on the Site. Not available through the user interface.
  5121.      */
  5122.     PermissionKind[PermissionKind["EmptyMask"] = 0] = "EmptyMask";
  5123.     /**
  5124.      * View items in lists, documents in document libraries, and Web discussion comments.
  5125.      */
  5126.     PermissionKind[PermissionKind["ViewListItems"] = 1] = "ViewListItems";
  5127.     /**
  5128.      * Add items to lists, documents to document libraries, and Web discussion comments.
  5129.      */
  5130.     PermissionKind[PermissionKind["AddListItems"] = 2] = "AddListItems";
  5131.     /**
  5132.      * Edit items in lists, edit documents in document libraries, edit Web discussion comments
  5133.      * in documents, and customize Web Part Pages in document libraries.
  5134.      */
  5135.     PermissionKind[PermissionKind["EditListItems"] = 3] = "EditListItems";
  5136.     /**
  5137.      * Delete items from a list, documents from a document library, and Web discussion
  5138.      * comments in documents.
  5139.      */
  5140.     PermissionKind[PermissionKind["DeleteListItems"] = 4] = "DeleteListItems";
  5141.     /**
  5142.      * Approve a minor version of a list item or document.
  5143.      */
  5144.     PermissionKind[PermissionKind["ApproveItems"] = 5] = "ApproveItems";
  5145.     /**
  5146.      * View the source of documents with server-side file handlers.
  5147.      */
  5148.     PermissionKind[PermissionKind["OpenItems"] = 6] = "OpenItems";
  5149.     /**
  5150.      * View past versions of a list item or document.
  5151.      */
  5152.     PermissionKind[PermissionKind["ViewVersions"] = 7] = "ViewVersions";
  5153.     /**
  5154.      * Delete past versions of a list item or document.
  5155.      */
  5156.     PermissionKind[PermissionKind["DeleteVersions"] = 8] = "DeleteVersions";
  5157.     /**
  5158.      * Discard or check in a document which is checked out to another user.
  5159.      */
  5160.     PermissionKind[PermissionKind["CancelCheckout"] = 9] = "CancelCheckout";
  5161.     /**
  5162.      * Create, change, and delete personal views of lists.
  5163.      */
  5164.     PermissionKind[PermissionKind["ManagePersonalViews"] = 10] = "ManagePersonalViews";
  5165.     /**
  5166.      * Create and delete lists, add or remove columns in a list, and add or remove public views of a list.
  5167.      */
  5168.     PermissionKind[PermissionKind["ManageLists"] = 12] = "ManageLists";
  5169.     /**
  5170.      * View forms, views, and application pages, and enumerate lists.
  5171.      */
  5172.     PermissionKind[PermissionKind["ViewFormPages"] = 13] = "ViewFormPages";
  5173.     /**
  5174.      * Make content of a list or document library retrieveable for anonymous users through SharePoint search.
  5175.      * The list permissions in the site do not change.
  5176.      */
  5177.     PermissionKind[PermissionKind["AnonymousSearchAccessList"] = 14] = "AnonymousSearchAccessList";
  5178.     /**
  5179.      * Allow users to open a Site, list, or folder to access items inside that container.
  5180.      */
  5181.     PermissionKind[PermissionKind["Open"] = 17] = "Open";
  5182.     /**
  5183.      * View pages in a Site.
  5184.      */
  5185.     PermissionKind[PermissionKind["ViewPages"] = 18] = "ViewPages";
  5186.     /**
  5187.      * Add, change, or delete HTML pages or Web Part Pages, and edit the Site using
  5188.      * a Windows SharePoint Services compatible editor.
  5189.      */
  5190.     PermissionKind[PermissionKind["AddAndCustomizePages"] = 19] = "AddAndCustomizePages";
  5191.     /**
  5192.      * Apply a theme or borders to the entire Site.
  5193.      */
  5194.     PermissionKind[PermissionKind["ApplyThemeAndBorder"] = 20] = "ApplyThemeAndBorder";
  5195.     /**
  5196.      * Apply a style sheet (.css file) to the Site.
  5197.      */
  5198.     PermissionKind[PermissionKind["ApplyStyleSheets"] = 21] = "ApplyStyleSheets";
  5199.     /**
  5200.      * View reports on Site usage.
  5201.      */
  5202.     PermissionKind[PermissionKind["ViewUsageData"] = 22] = "ViewUsageData";
  5203.     /**
  5204.      * Create a Site using Self-Service Site Creation.
  5205.      */
  5206.     PermissionKind[PermissionKind["CreateSSCSite"] = 23] = "CreateSSCSite";
  5207.     /**
  5208.      * Create subsites such as team sites, Meeting Workspace sites, and Document Workspace sites.
  5209.      */
  5210.     PermissionKind[PermissionKind["ManageSubwebs"] = 24] = "ManageSubwebs";
  5211.     /**
  5212.      * Create a group of users that can be used anywhere within the site collection.
  5213.      */
  5214.     PermissionKind[PermissionKind["CreateGroups"] = 25] = "CreateGroups";
  5215.     /**
  5216.      * Create and change permission levels on the Site and assign permissions to users
  5217.      * and groups.
  5218.      */
  5219.     PermissionKind[PermissionKind["ManagePermissions"] = 26] = "ManagePermissions";
  5220.     /**
  5221.      * Enumerate files and folders in a Site using Microsoft Office SharePoint Designer
  5222.      * and WebDAV interfaces.
  5223.      */
  5224.     PermissionKind[PermissionKind["BrowseDirectories"] = 27] = "BrowseDirectories";
  5225.     /**
  5226.      * View information about users of the Site.
  5227.      */
  5228.     PermissionKind[PermissionKind["BrowseUserInfo"] = 28] = "BrowseUserInfo";
  5229.     /**
  5230.      * Add or remove personal Web Parts on a Web Part Page.
  5231.      */
  5232.     PermissionKind[PermissionKind["AddDelPrivateWebParts"] = 29] = "AddDelPrivateWebParts";
  5233.     /**
  5234.      * Update Web Parts to display personalized information.
  5235.      */
  5236.     PermissionKind[PermissionKind["UpdatePersonalWebParts"] = 30] = "UpdatePersonalWebParts";
  5237.     /**
  5238.      * Grant the ability to perform all administration tasks for the Site as well as
  5239.      * manage content, activate, deactivate, or edit properties of Site scoped Features
  5240.      * through the object model or through the user interface (UI). When granted on the
  5241.      * root Site of a Site Collection, activate, deactivate, or edit properties of
  5242.      * site collection scoped Features through the object model. To browse to the Site
  5243.      * Collection Features page and activate or deactivate Site Collection scoped Features
  5244.      * through the UI, you must be a Site Collection administrator.
  5245.      */
  5246.     PermissionKind[PermissionKind["ManageWeb"] = 31] = "ManageWeb";
  5247.     /**
  5248.      * Content of lists and document libraries in the Web site will be retrieveable for anonymous users through
  5249.      * SharePoint search if the list or document library has AnonymousSearchAccessList set.
  5250.      */
  5251.     PermissionKind[PermissionKind["AnonymousSearchAccessWebLists"] = 32] = "AnonymousSearchAccessWebLists";
  5252.     /**
  5253.      * Use features that launch client applications. Otherwise, users must work on documents
  5254.      * locally and upload changes.
  5255.      */
  5256.     PermissionKind[PermissionKind["UseClientIntegration"] = 37] = "UseClientIntegration";
  5257.     /**
  5258.      * Use SOAP, WebDAV, or Microsoft Office SharePoint Designer interfaces to access the Site.
  5259.      */
  5260.     PermissionKind[PermissionKind["UseRemoteAPIs"] = 38] = "UseRemoteAPIs";
  5261.     /**
  5262.      * Manage alerts for all users of the Site.
  5263.      */
  5264.     PermissionKind[PermissionKind["ManageAlerts"] = 39] = "ManageAlerts";
  5265.     /**
  5266.      * Create e-mail alerts.
  5267.      */
  5268.     PermissionKind[PermissionKind["CreateAlerts"] = 40] = "CreateAlerts";
  5269.     /**
  5270.      * Allows a user to change his or her user information, such as adding a picture.
  5271.      */
  5272.     PermissionKind[PermissionKind["EditMyUserInfo"] = 41] = "EditMyUserInfo";
  5273.     /**
  5274.      * Enumerate permissions on Site, list, folder, document, or list item.
  5275.      */
  5276.     PermissionKind[PermissionKind["EnumeratePermissions"] = 63] = "EnumeratePermissions";
  5277.     /**
  5278.      * Has all permissions on the Site. Not available through the user interface.
  5279.      */
  5280.     PermissionKind[PermissionKind["FullMask"] = 65] = "FullMask";
  5281. })(PermissionKind = exports.PermissionKind || (exports.PermissionKind = {}));
  5282. var PrincipalType;
  5283. (function (PrincipalType) {
  5284.     PrincipalType[PrincipalType["None"] = 0] = "None";
  5285.     PrincipalType[PrincipalType["User"] = 1] = "User";
  5286.     PrincipalType[PrincipalType["DistributionList"] = 2] = "DistributionList";
  5287.     PrincipalType[PrincipalType["SecurityGroup"] = 4] = "SecurityGroup";
  5288.     PrincipalType[PrincipalType["SharePointGroup"] = 8] = "SharePointGroup";
  5289.     PrincipalType[PrincipalType["All"] = 15] = "All";
  5290. })(PrincipalType = exports.PrincipalType || (exports.PrincipalType = {}));
  5291. var RoleType;
  5292. (function (RoleType) {
  5293.     RoleType[RoleType["None"] = 0] = "None";
  5294.     RoleType[RoleType["Guest"] = 1] = "Guest";
  5295.     RoleType[RoleType["Reader"] = 2] = "Reader";
  5296.     RoleType[RoleType["Contributor"] = 3] = "Contributor";
  5297.     RoleType[RoleType["WebDesigner"] = 4] = "WebDesigner";
  5298.     RoleType[RoleType["Administrator"] = 5] = "Administrator";
  5299. })(RoleType = exports.RoleType || (exports.RoleType = {}));
  5300. var PageType;
  5301. (function (PageType) {
  5302.     PageType[PageType["Invalid"] = -1] = "Invalid";
  5303.     PageType[PageType["DefaultView"] = 0] = "DefaultView";
  5304.     PageType[PageType["NormalView"] = 1] = "NormalView";
  5305.     PageType[PageType["DialogView"] = 2] = "DialogView";
  5306.     PageType[PageType["View"] = 3] = "View";
  5307.     PageType[PageType["DisplayForm"] = 4] = "DisplayForm";
  5308.     PageType[PageType["DisplayFormDialog"] = 5] = "DisplayFormDialog";
  5309.     PageType[PageType["EditForm"] = 6] = "EditForm";
  5310.     PageType[PageType["EditFormDialog"] = 7] = "EditFormDialog";
  5311.     PageType[PageType["NewForm"] = 8] = "NewForm";
  5312.     PageType[PageType["NewFormDialog"] = 9] = "NewFormDialog";
  5313.     PageType[PageType["SolutionForm"] = 10] = "SolutionForm";
  5314.     PageType[PageType["PAGE_MAXITEMS"] = 11] = "PAGE_MAXITEMS";
  5315. })(PageType = exports.PageType || (exports.PageType = {}));
  5316. var SharingLinkKind;
  5317. (function (SharingLinkKind) {
  5318.     /**
  5319.      * Uninitialized link
  5320.      */
  5321.     SharingLinkKind[SharingLinkKind["Uninitialized"] = 0] = "Uninitialized";
  5322.     /**
  5323.      * Direct link to the object being shared
  5324.      */
  5325.     SharingLinkKind[SharingLinkKind["Direct"] = 1] = "Direct";
  5326.     /**
  5327.      * Organization-shareable link to the object being shared with view permissions
  5328.      */
  5329.     SharingLinkKind[SharingLinkKind["OrganizationView"] = 2] = "OrganizationView";
  5330.     /**
  5331.      * Organization-shareable link to the object being shared with edit permissions
  5332.      */
  5333.     SharingLinkKind[SharingLinkKind["OrganizationEdit"] = 3] = "OrganizationEdit";
  5334.     /**
  5335.      * View only anonymous link
  5336.      */
  5337.     SharingLinkKind[SharingLinkKind["AnonymousView"] = 4] = "AnonymousView";
  5338.     /**
  5339.      * Read/Write anonymous link
  5340.      */
  5341.     SharingLinkKind[SharingLinkKind["AnonymousEdit"] = 5] = "AnonymousEdit";
  5342.     /**
  5343.      * Flexible sharing Link where properties can change without affecting link URL
  5344.      */
  5345.     SharingLinkKind[SharingLinkKind["Flexible"] = 6] = "Flexible";
  5346. })(SharingLinkKind = exports.SharingLinkKind || (exports.SharingLinkKind = {}));
  5347. ;
  5348. /**
  5349.  * Indicates the role of the sharing link
  5350.  */
  5351. var SharingRole;
  5352. (function (SharingRole) {
  5353.     SharingRole[SharingRole["None"] = 0] = "None";
  5354.     SharingRole[SharingRole["View"] = 1] = "View";
  5355.     SharingRole[SharingRole["Edit"] = 2] = "Edit";
  5356.     SharingRole[SharingRole["Owner"] = 3] = "Owner";
  5357. })(SharingRole = exports.SharingRole || (exports.SharingRole = {}));
  5358. var SharingOperationStatusCode;
  5359. (function (SharingOperationStatusCode) {
  5360.     /**
  5361.      * The share operation completed without errors.
  5362.      */
  5363.     SharingOperationStatusCode[SharingOperationStatusCode["CompletedSuccessfully"] = 0] = "CompletedSuccessfully";
  5364.     /**
  5365.      * The share operation completed and generated requests for access.
  5366.      */
  5367.     SharingOperationStatusCode[SharingOperationStatusCode["AccessRequestsQueued"] = 1] = "AccessRequestsQueued";
  5368.     /**
  5369.      * The share operation failed as there were no resolved users.
  5370.      */
  5371.     SharingOperationStatusCode[SharingOperationStatusCode["NoResolvedUsers"] = -1] = "NoResolvedUsers";
  5372.     /**
  5373.      * The share operation failed due to insufficient permissions.
  5374.      */
  5375.     SharingOperationStatusCode[SharingOperationStatusCode["AccessDenied"] = -2] = "AccessDenied";
  5376.     /**
  5377.      * The share operation failed when attempting a cross site share, which is not supported.
  5378.      */
  5379.     SharingOperationStatusCode[SharingOperationStatusCode["CrossSiteRequestNotSupported"] = -3] = "CrossSiteRequestNotSupported";
  5380.     /**
  5381.      * The sharing operation failed due to an unknown error.
  5382.      */
  5383.     SharingOperationStatusCode[SharingOperationStatusCode["UnknowError"] = -4] = "UnknowError";
  5384.     /**
  5385.      * The text you typed is too long. Please shorten it.
  5386.      */
  5387.     SharingOperationStatusCode[SharingOperationStatusCode["EmailBodyTooLong"] = -5] = "EmailBodyTooLong";
  5388.     /**
  5389.      * The maximum number of unique scopes in the list has been exceeded.
  5390.      */
  5391.     SharingOperationStatusCode[SharingOperationStatusCode["ListUniqueScopesExceeded"] = -6] = "ListUniqueScopesExceeded";
  5392.     /**
  5393.      * The share operation failed because a sharing capability is disabled in the site.
  5394.      */
  5395.     SharingOperationStatusCode[SharingOperationStatusCode["CapabilityDisabled"] = -7] = "CapabilityDisabled";
  5396.     /**
  5397.      * The specified object for the share operation is not supported.
  5398.      */
  5399.     SharingOperationStatusCode[SharingOperationStatusCode["ObjectNotSupported"] = -8] = "ObjectNotSupported";
  5400.     /**
  5401.      * A SharePoint group cannot contain another SharePoint group.
  5402.      */
  5403.     SharingOperationStatusCode[SharingOperationStatusCode["NestedGroupsNotSupported"] = -9] = "NestedGroupsNotSupported";
  5404. })(SharingOperationStatusCode = exports.SharingOperationStatusCode || (exports.SharingOperationStatusCode = {}));
  5405. var SPSharedObjectType;
  5406. (function (SPSharedObjectType) {
  5407.     SPSharedObjectType[SPSharedObjectType["Unknown"] = 0] = "Unknown";
  5408.     SPSharedObjectType[SPSharedObjectType["File"] = 1] = "File";
  5409.     SPSharedObjectType[SPSharedObjectType["Folder"] = 2] = "Folder";
  5410.     SPSharedObjectType[SPSharedObjectType["Item"] = 3] = "Item";
  5411.     SPSharedObjectType[SPSharedObjectType["List"] = 4] = "List";
  5412.     SPSharedObjectType[SPSharedObjectType["Web"] = 5] = "Web";
  5413.     SPSharedObjectType[SPSharedObjectType["Max"] = 6] = "Max";
  5414. })(SPSharedObjectType = exports.SPSharedObjectType || (exports.SPSharedObjectType = {}));
  5415. var SharingDomainRestrictionMode;
  5416. (function (SharingDomainRestrictionMode) {
  5417.     SharingDomainRestrictionMode[SharingDomainRestrictionMode["None"] = 0] = "None";
  5418.     SharingDomainRestrictionMode[SharingDomainRestrictionMode["AllowList"] = 1] = "AllowList";
  5419.     SharingDomainRestrictionMode[SharingDomainRestrictionMode["BlockList"] = 2] = "BlockList";
  5420. })(SharingDomainRestrictionMode = exports.SharingDomainRestrictionMode || (exports.SharingDomainRestrictionMode = {}));
  5421. ;
  5422.  
  5423.  
  5424. /***/ }),
  5425. /* 14 */
  5426. /***/ (function(module, exports, __webpack_require__) {
  5427.  
  5428. "use strict";
  5429.  
  5430. Object.defineProperty(exports, "__esModule", { value: true });
  5431. var util_1 = __webpack_require__(0);
  5432. var collections_1 = __webpack_require__(6);
  5433. var pnplibconfig_1 = __webpack_require__(4);
  5434. /**
  5435.  * A wrapper class to provide a consistent interface to browser based storage
  5436.  *
  5437.  */
  5438. var PnPClientStorageWrapper = (function () {
  5439.     /**
  5440.      * Creates a new instance of the PnPClientStorageWrapper class
  5441.      *
  5442.      * @constructor
  5443.      */
  5444.     function PnPClientStorageWrapper(store, defaultTimeoutMinutes) {
  5445.         this.store = store;
  5446.         this.defaultTimeoutMinutes = defaultTimeoutMinutes;
  5447.         this.defaultTimeoutMinutes = (defaultTimeoutMinutes === void 0) ? -1 : defaultTimeoutMinutes;
  5448.         this.enabled = this.test();
  5449.     }
  5450.     /**
  5451.      * Get a value from storage, or null if that value does not exist
  5452.      *
  5453.      * @param key The key whose value we want to retrieve
  5454.      */
  5455.     PnPClientStorageWrapper.prototype.get = function (key) {
  5456.         if (!this.enabled) {
  5457.             return null;
  5458.         }
  5459.         var o = this.store.getItem(key);
  5460.         if (o == null) {
  5461.             return null;
  5462.         }
  5463.         var persistable = JSON.parse(o);
  5464.         if (new Date(persistable.expiration) <= new Date()) {
  5465.             this.delete(key);
  5466.             return null;
  5467.         }
  5468.         else {
  5469.             return persistable.value;
  5470.         }
  5471.     };
  5472.     /**
  5473.      * Adds a value to the underlying storage
  5474.      *
  5475.      * @param key The key to use when storing the provided value
  5476.      * @param o The value to store
  5477.      * @param expire Optional, if provided the expiration of the item, otherwise the default is used
  5478.      */
  5479.     PnPClientStorageWrapper.prototype.put = function (key, o, expire) {
  5480.         if (this.enabled) {
  5481.             this.store.setItem(key, this.createPersistable(o, expire));
  5482.         }
  5483.     };
  5484.     /**
  5485.      * Deletes a value from the underlying storage
  5486.      *
  5487.      * @param key The key of the pair we want to remove from storage
  5488.      */
  5489.     PnPClientStorageWrapper.prototype.delete = function (key) {
  5490.         if (this.enabled) {
  5491.             this.store.removeItem(key);
  5492.         }
  5493.     };
  5494.     /**
  5495.      * Gets an item from the underlying storage, or adds it if it does not exist using the supplied getter function
  5496.      *
  5497.      * @param key The key to use when storing the provided value
  5498.      * @param getter A function which will upon execution provide the desired value
  5499.      * @param expire Optional, if provided the expiration of the item, otherwise the default is used
  5500.      */
  5501.     PnPClientStorageWrapper.prototype.getOrPut = function (key, getter, expire) {
  5502.         var _this = this;
  5503.         if (!this.enabled) {
  5504.             return getter();
  5505.         }
  5506.         return new Promise(function (resolve) {
  5507.             var o = _this.get(key);
  5508.             if (o == null) {
  5509.                 getter().then(function (d) {
  5510.                     _this.put(key, d, expire);
  5511.                     resolve(d);
  5512.                 });
  5513.             }
  5514.             else {
  5515.                 resolve(o);
  5516.             }
  5517.         });
  5518.     };
  5519.     /**
  5520.      * Used to determine if the wrapped storage is available currently
  5521.      */
  5522.     PnPClientStorageWrapper.prototype.test = function () {
  5523.         var str = "test";
  5524.         try {
  5525.             this.store.setItem(str, str);
  5526.             this.store.removeItem(str);
  5527.             return true;
  5528.         }
  5529.         catch (e) {
  5530.             return false;
  5531.         }
  5532.     };
  5533.     /**
  5534.      * Creates the persistable to store
  5535.      */
  5536.     PnPClientStorageWrapper.prototype.createPersistable = function (o, expire) {
  5537.         if (typeof expire === "undefined") {
  5538.             // ensure we are by default inline with the global library setting
  5539.             var defaultTimeout = pnplibconfig_1.RuntimeConfig.defaultCachingTimeoutSeconds;
  5540.             if (this.defaultTimeoutMinutes > 0) {
  5541.                 defaultTimeout = this.defaultTimeoutMinutes * 60;
  5542.             }
  5543.             expire = util_1.Util.dateAdd(new Date(), "second", defaultTimeout);
  5544.         }
  5545.         return JSON.stringify({ expiration: expire, value: o });
  5546.     };
  5547.     return PnPClientStorageWrapper;
  5548. }());
  5549. exports.PnPClientStorageWrapper = PnPClientStorageWrapper;
  5550. /**
  5551.  * A thin implementation of in-memory storage for use in nodejs
  5552.  */
  5553. var MemoryStorage = (function () {
  5554.     function MemoryStorage(_store) {
  5555.         if (_store === void 0) { _store = new collections_1.Dictionary(); }
  5556.         this._store = _store;
  5557.     }
  5558.     Object.defineProperty(MemoryStorage.prototype, "length", {
  5559.         get: function () {
  5560.             return this._store.count();
  5561.         },
  5562.         enumerable: true,
  5563.         configurable: true
  5564.     });
  5565.     MemoryStorage.prototype.clear = function () {
  5566.         this._store.clear();
  5567.     };
  5568.     MemoryStorage.prototype.getItem = function (key) {
  5569.         return this._store.get(key);
  5570.     };
  5571.     MemoryStorage.prototype.key = function (index) {
  5572.         return this._store.getKeys()[index];
  5573.     };
  5574.     MemoryStorage.prototype.removeItem = function (key) {
  5575.         this._store.remove(key);
  5576.     };
  5577.     MemoryStorage.prototype.setItem = function (key, data) {
  5578.         this._store.add(key, data);
  5579.     };
  5580.     return MemoryStorage;
  5581. }());
  5582. /**
  5583.  * A class that will establish wrappers for both local and session storage
  5584.  */
  5585. var PnPClientStorage = (function () {
  5586.     /**
  5587.      * Creates a new instance of the PnPClientStorage class
  5588.      *
  5589.      * @constructor
  5590.      */
  5591.     function PnPClientStorage() {
  5592.         this.local = typeof localStorage !== "undefined" ? new PnPClientStorageWrapper(localStorage) : new PnPClientStorageWrapper(new MemoryStorage());
  5593.         this.session = typeof sessionStorage !== "undefined" ? new PnPClientStorageWrapper(sessionStorage) : new PnPClientStorageWrapper(new MemoryStorage());
  5594.     }
  5595.     return PnPClientStorage;
  5596. }());
  5597. exports.PnPClientStorage = PnPClientStorage;
  5598.  
  5599.  
  5600. /***/ }),
  5601. /* 15 */
  5602. /***/ (function(module, exports, __webpack_require__) {
  5603.  
  5604. "use strict";
  5605.  
  5606. Object.defineProperty(exports, "__esModule", { value: true });
  5607. var digestcache_1 = __webpack_require__(38);
  5608. var util_1 = __webpack_require__(0);
  5609. var pnplibconfig_1 = __webpack_require__(4);
  5610. var exceptions_1 = __webpack_require__(3);
  5611. var HttpClient = (function () {
  5612.     function HttpClient() {
  5613.         this._impl = pnplibconfig_1.RuntimeConfig.fetchClientFactory();
  5614.         this._digestCache = new digestcache_1.DigestCache(this);
  5615.     }
  5616.     HttpClient.prototype.fetch = function (url, options) {
  5617.         var _this = this;
  5618.         if (options === void 0) { options = {}; }
  5619.         var opts = util_1.Util.extend(options, { cache: "no-cache", credentials: "same-origin" }, true);
  5620.         var headers = new Headers();
  5621.         // first we add the global headers so they can be overwritten by any passed in locally to this call
  5622.         this.mergeHeaders(headers, pnplibconfig_1.RuntimeConfig.headers);
  5623.         // second we add the local options so we can overwrite the globals
  5624.         this.mergeHeaders(headers, options.headers);
  5625.         // lastly we apply any default headers we need that may not exist
  5626.         if (!headers.has("Accept")) {
  5627.             headers.append("Accept", "application/json");
  5628.         }
  5629.         if (!headers.has("Content-Type")) {
  5630.             headers.append("Content-Type", "application/json;odata=verbose;charset=utf-8");
  5631.         }
  5632.         if (!headers.has("X-ClientService-ClientTag")) {
  5633.             headers.append("X-ClientService-ClientTag", "PnPCoreJS:2.0.3");
  5634.         }
  5635.         opts = util_1.Util.extend(opts, { headers: headers });
  5636.         if (opts.method && opts.method.toUpperCase() !== "GET") {
  5637.             if (!headers.has("X-RequestDigest")) {
  5638.                 var index = url.indexOf("_api/");
  5639.                 if (index < 0) {
  5640.                     throw new exceptions_1.APIUrlException();
  5641.                 }
  5642.                 var webUrl = url.substr(0, index);
  5643.                 return this._digestCache.getDigest(webUrl)
  5644.                     .then(function (digest) {
  5645.                     headers.append("X-RequestDigest", digest);
  5646.                     return _this.fetchRaw(url, opts);
  5647.                 });
  5648.             }
  5649.         }
  5650.         return this.fetchRaw(url, opts);
  5651.     };
  5652.     HttpClient.prototype.fetchRaw = function (url, options) {
  5653.         var _this = this;
  5654.         if (options === void 0) { options = {}; }
  5655.         // here we need to normalize the headers
  5656.         var rawHeaders = new Headers();
  5657.         this.mergeHeaders(rawHeaders, options.headers);
  5658.         options = util_1.Util.extend(options, { headers: rawHeaders });
  5659.         var retry = function (ctx) {
  5660.             _this._impl.fetch(url, options).then(function (response) { return ctx.resolve(response); }).catch(function (response) {
  5661.                 // grab our current delay
  5662.                 var delay = ctx.delay;
  5663.                 // Check if request was throttled - http status code 429
  5664.                 // Check is request failed due to server unavailable - http status code 503
  5665.                 if (response.status !== 429 && response.status !== 503) {
  5666.                     ctx.reject(response);
  5667.                 }
  5668.                 // Increment our counters.
  5669.                 ctx.delay *= 2;
  5670.                 ctx.attempts++;
  5671.                 // If we have exceeded the retry count, reject.
  5672.                 if (ctx.retryCount <= ctx.attempts) {
  5673.                     ctx.reject(response);
  5674.                 }
  5675.                 // Set our retry timeout for {delay} milliseconds.
  5676.                 setTimeout(util_1.Util.getCtxCallback(_this, retry, ctx), delay);
  5677.             });
  5678.         };
  5679.         return new Promise(function (resolve, reject) {
  5680.             var retryContext = {
  5681.                 attempts: 0,
  5682.                 delay: 100,
  5683.                 reject: reject,
  5684.                 resolve: resolve,
  5685.                 retryCount: 7,
  5686.             };
  5687.             retry.call(_this, retryContext);
  5688.         });
  5689.     };
  5690.     HttpClient.prototype.get = function (url, options) {
  5691.         if (options === void 0) { options = {}; }
  5692.         var opts = util_1.Util.extend(options, { method: "GET" });
  5693.         return this.fetch(url, opts);
  5694.     };
  5695.     HttpClient.prototype.post = function (url, options) {
  5696.         if (options === void 0) { options = {}; }
  5697.         var opts = util_1.Util.extend(options, { method: "POST" });
  5698.         return this.fetch(url, opts);
  5699.     };
  5700.     HttpClient.prototype.patch = function (url, options) {
  5701.         if (options === void 0) { options = {}; }
  5702.         var opts = util_1.Util.extend(options, { method: "PATCH" });
  5703.         return this.fetch(url, opts);
  5704.     };
  5705.     HttpClient.prototype.delete = function (url, options) {
  5706.         if (options === void 0) { options = {}; }
  5707.         var opts = util_1.Util.extend(options, { method: "DELETE" });
  5708.         return this.fetch(url, opts);
  5709.     };
  5710.     HttpClient.prototype.mergeHeaders = function (target, source) {
  5711.         if (typeof source !== "undefined" && source !== null) {
  5712.             var temp = new Request("", { headers: source });
  5713.             temp.headers.forEach(function (value, name) {
  5714.                 target.append(name, value);
  5715.             });
  5716.         }
  5717.     };
  5718.     return HttpClient;
  5719. }());
  5720. exports.HttpClient = HttpClient;
  5721. ;
  5722.  
  5723.  
  5724. /***/ }),
  5725. /* 16 */
  5726. /***/ (function(module, exports, __webpack_require__) {
  5727.  
  5728. "use strict";
  5729.  
  5730. var __extends = (this && this.__extends) || (function () {
  5731.     var extendStatics = Object.setPrototypeOf ||
  5732.         ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  5733.         function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  5734.     return function (d, b) {
  5735.         extendStatics(d, b);
  5736.         function __() { this.constructor = d; }
  5737.         d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  5738.     };
  5739. })();
  5740. Object.defineProperty(exports, "__esModule", { value: true });
  5741. var util_1 = __webpack_require__(0);
  5742. var queryable_1 = __webpack_require__(1);
  5743. /**
  5744.  * Describes a collection of content types
  5745.  *
  5746.  */
  5747. var ContentTypes = (function (_super) {
  5748.     __extends(ContentTypes, _super);
  5749.     /**
  5750.      * Creates a new instance of the ContentTypes class
  5751.      *
  5752.      * @param baseUrl The url or Queryable which forms the parent of this content types collection
  5753.      */
  5754.     function ContentTypes(baseUrl, path) {
  5755.         if (path === void 0) { path = "contenttypes"; }
  5756.         return _super.call(this, baseUrl, path) || this;
  5757.     }
  5758.     /**
  5759.      * Gets a ContentType by content type id
  5760.      */
  5761.     ContentTypes.prototype.getById = function (id) {
  5762.         var ct = new ContentType(this);
  5763.         ct.concat("('" + id + "')");
  5764.         return ct;
  5765.     };
  5766.     /**
  5767.      * Adds an existing contenttype to a content type collection
  5768.      *
  5769.      * @param contentTypeId in the following format, for example: 0x010102
  5770.      */
  5771.     ContentTypes.prototype.addAvailableContentType = function (contentTypeId) {
  5772.         var _this = this;
  5773.         var postBody = JSON.stringify({
  5774.             "contentTypeId": contentTypeId,
  5775.         });
  5776.         return this.clone(ContentTypes, "addAvailableContentType", true).postAs({ body: postBody }).then(function (data) {
  5777.             return {
  5778.                 contentType: _this.getById(data.id),
  5779.                 data: data,
  5780.             };
  5781.         });
  5782.     };
  5783.     /**
  5784.      * Adds a new content type to the collection
  5785.      *
  5786.      * @param id The desired content type id for the new content type (also determines the parent content type)
  5787.      * @param name The name of the content type
  5788.      * @param description The description of the content type
  5789.      * @param group The group in which to add the content type
  5790.      * @param additionalSettings Any additional settings to provide when creating the content type
  5791.      *
  5792.      */
  5793.     ContentTypes.prototype.add = function (id, name, description, group, additionalSettings) {
  5794.         var _this = this;
  5795.         if (description === void 0) { description = ""; }
  5796.         if (group === void 0) { group = "Custom Content Types"; }
  5797.         if (additionalSettings === void 0) { additionalSettings = {}; }
  5798.         var postBody = JSON.stringify(util_1.Util.extend({
  5799.             "Description": description,
  5800.             "Group": group,
  5801.             "Id": { "StringValue": id },
  5802.             "Name": name,
  5803.             "__metadata": { "type": "SP.ContentType" },
  5804.         }, additionalSettings));
  5805.         return this.post({ body: postBody }).then(function (data) {
  5806.             return { contentType: _this.getById(data.id), data: data };
  5807.         });
  5808.     };
  5809.     return ContentTypes;
  5810. }(queryable_1.QueryableCollection));
  5811. exports.ContentTypes = ContentTypes;
  5812. /**
  5813.  * Describes a single ContentType instance
  5814.  *
  5815.  */
  5816. var ContentType = (function (_super) {
  5817.     __extends(ContentType, _super);
  5818.     function ContentType() {
  5819.         return _super !== null && _super.apply(this, arguments) || this;
  5820.     }
  5821.     Object.defineProperty(ContentType.prototype, "fieldLinks", {
  5822.         /**
  5823.          * Gets the column (also known as field) references in the content type.
  5824.         */
  5825.         get: function () {
  5826.             return new FieldLinks(this);
  5827.         },
  5828.         enumerable: true,
  5829.         configurable: true
  5830.     });
  5831.     Object.defineProperty(ContentType.prototype, "fields", {
  5832.         /**
  5833.          * Gets a value that specifies the collection of fields for the content type.
  5834.          */
  5835.         get: function () {
  5836.             return new queryable_1.QueryableCollection(this, "fields");
  5837.         },
  5838.         enumerable: true,
  5839.         configurable: true
  5840.     });
  5841.     Object.defineProperty(ContentType.prototype, "parent", {
  5842.         /**
  5843.          * Gets the parent content type of the content type.
  5844.          */
  5845.         get: function () {
  5846.             return new ContentType(this, "parent");
  5847.         },
  5848.         enumerable: true,
  5849.         configurable: true
  5850.     });
  5851.     Object.defineProperty(ContentType.prototype, "workflowAssociations", {
  5852.         /**
  5853.          * Gets a value that specifies the collection of workflow associations for the content type.
  5854.          */
  5855.         get: function () {
  5856.             return new queryable_1.QueryableCollection(this, "workflowAssociations");
  5857.         },
  5858.         enumerable: true,
  5859.         configurable: true
  5860.     });
  5861.     /**
  5862.      * Delete this content type
  5863.      */
  5864.     ContentType.prototype.delete = function () {
  5865.         return this.post({
  5866.             headers: {
  5867.                 "X-HTTP-Method": "DELETE",
  5868.             },
  5869.         });
  5870.     };
  5871.     return ContentType;
  5872. }(queryable_1.QueryableInstance));
  5873. exports.ContentType = ContentType;
  5874. /**
  5875.  * Represents a collection of field link instances
  5876.  */
  5877. var FieldLinks = (function (_super) {
  5878.     __extends(FieldLinks, _super);
  5879.     /**
  5880.      * Creates a new instance of the ContentType class
  5881.      *
  5882.      * @param baseUrl The url or Queryable which forms the parent of this content type instance
  5883.      */
  5884.     function FieldLinks(baseUrl, path) {
  5885.         if (path === void 0) { path = "fieldlinks"; }
  5886.         return _super.call(this, baseUrl, path) || this;
  5887.     }
  5888.     /**
  5889.      * Gets a FieldLink by GUID id
  5890.      *
  5891.      * @param id The GUID id of the field link
  5892.      */
  5893.     FieldLinks.prototype.getById = function (id) {
  5894.         var fl = new FieldLink(this);
  5895.         fl.concat("(guid'" + id + "')");
  5896.         return fl;
  5897.     };
  5898.     return FieldLinks;
  5899. }(queryable_1.QueryableCollection));
  5900. exports.FieldLinks = FieldLinks;
  5901. /**
  5902.  * Represents a field link instance
  5903.  */
  5904. var FieldLink = (function (_super) {
  5905.     __extends(FieldLink, _super);
  5906.     function FieldLink() {
  5907.         return _super !== null && _super.apply(this, arguments) || this;
  5908.     }
  5909.     return FieldLink;
  5910. }(queryable_1.QueryableInstance));
  5911. exports.FieldLink = FieldLink;
  5912.  
  5913.  
  5914. /***/ }),
  5915. /* 17 */
  5916. /***/ (function(module, exports, __webpack_require__) {
  5917.  
  5918. "use strict";
  5919.  
  5920. var __extends = (this && this.__extends) || (function () {
  5921.     var extendStatics = Object.setPrototypeOf ||
  5922.         ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  5923.         function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  5924.     return function (d, b) {
  5925.         extendStatics(d, b);
  5926.         function __() { this.constructor = d; }
  5927.         d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  5928.     };
  5929. })();
  5930. Object.defineProperty(exports, "__esModule", { value: true });
  5931. var queryable_1 = __webpack_require__(1);
  5932. var sitegroups_1 = __webpack_require__(18);
  5933. var util_1 = __webpack_require__(0);
  5934. /**
  5935.  * Describes a set of role assignments for the current scope
  5936.  *
  5937.  */
  5938. var RoleAssignments = (function (_super) {
  5939.     __extends(RoleAssignments, _super);
  5940.     /**
  5941.      * Creates a new instance of the RoleAssignments class
  5942.      *
  5943.      * @param baseUrl The url or Queryable which forms the parent of this fields collection
  5944.      */
  5945.     function RoleAssignments(baseUrl, path) {
  5946.         if (path === void 0) { path = "roleassignments"; }
  5947.         return _super.call(this, baseUrl, path) || this;
  5948.     }
  5949.     /**
  5950.      * Adds a new role assignment with the specified principal and role definitions to the collection.
  5951.      *
  5952.      * @param principalId The ID of the user or group to assign permissions to
  5953.      * @param roleDefId The ID of the role definition that defines the permissions to assign
  5954.      *
  5955.      */
  5956.     RoleAssignments.prototype.add = function (principalId, roleDefId) {
  5957.         return this.clone(RoleAssignments, "addroleassignment(principalid=" + principalId + ", roledefid=" + roleDefId + ")", true).post();
  5958.     };
  5959.     /**
  5960.      * Removes the role assignment with the specified principal and role definition from the collection
  5961.      *
  5962.      * @param principalId The ID of the user or group in the role assignment.
  5963.      * @param roleDefId The ID of the role definition in the role assignment
  5964.      *
  5965.      */
  5966.     RoleAssignments.prototype.remove = function (principalId, roleDefId) {
  5967.         return this.clone(RoleAssignments, "removeroleassignment(principalid=" + principalId + ", roledefid=" + roleDefId + ")", true).post();
  5968.     };
  5969.     /**
  5970.      * Gets the role assignment associated with the specified principal ID from the collection.
  5971.      *
  5972.      * @param id The id of the role assignment
  5973.      */
  5974.     RoleAssignments.prototype.getById = function (id) {
  5975.         var ra = new RoleAssignment(this);
  5976.         ra.concat("(" + id + ")");
  5977.         return ra;
  5978.     };
  5979.     return RoleAssignments;
  5980. }(queryable_1.QueryableCollection));
  5981. exports.RoleAssignments = RoleAssignments;
  5982. var RoleAssignment = (function (_super) {
  5983.     __extends(RoleAssignment, _super);
  5984.     function RoleAssignment() {
  5985.         return _super !== null && _super.apply(this, arguments) || this;
  5986.     }
  5987.     Object.defineProperty(RoleAssignment.prototype, "groups", {
  5988.         get: function () {
  5989.             return new sitegroups_1.SiteGroups(this, "groups");
  5990.         },
  5991.         enumerable: true,
  5992.         configurable: true
  5993.     });
  5994.     Object.defineProperty(RoleAssignment.prototype, "bindings", {
  5995.         /**
  5996.          * Get the role definition bindings for this role assignment
  5997.          *
  5998.          */
  5999.         get: function () {
  6000.             return new RoleDefinitionBindings(this);
  6001.         },
  6002.         enumerable: true,
  6003.         configurable: true
  6004.     });
  6005.     /**
  6006.      * Delete this role assignment
  6007.      *
  6008.      */
  6009.     RoleAssignment.prototype.delete = function () {
  6010.         return this.post({
  6011.             headers: {
  6012.                 "X-HTTP-Method": "DELETE",
  6013.             },
  6014.         });
  6015.     };
  6016.     return RoleAssignment;
  6017. }(queryable_1.QueryableInstance));
  6018. exports.RoleAssignment = RoleAssignment;
  6019. var RoleDefinitions = (function (_super) {
  6020.     __extends(RoleDefinitions, _super);
  6021.     /**
  6022.      * Creates a new instance of the RoleDefinitions class
  6023.      *
  6024.      * @param baseUrl The url or Queryable which forms the parent of this fields collection
  6025.      * @param path
  6026.      *
  6027.      */
  6028.     function RoleDefinitions(baseUrl, path) {
  6029.         if (path === void 0) { path = "roledefinitions"; }
  6030.         return _super.call(this, baseUrl, path) || this;
  6031.     }
  6032.     /**
  6033.      * Gets the role definition with the specified ID from the collection.
  6034.      *
  6035.      * @param id The ID of the role definition.
  6036.      *
  6037.      */
  6038.     RoleDefinitions.prototype.getById = function (id) {
  6039.         return new RoleDefinition(this, "getById(" + id + ")");
  6040.     };
  6041.     /**
  6042.      * Gets the role definition with the specified name.
  6043.      *
  6044.      * @param name The name of the role definition.
  6045.      *
  6046.      */
  6047.     RoleDefinitions.prototype.getByName = function (name) {
  6048.         return new RoleDefinition(this, "getbyname('" + name + "')");
  6049.     };
  6050.     /**
  6051.      * Gets the role definition with the specified type.
  6052.      *
  6053.      * @param name The name of the role definition.
  6054.      *
  6055.      */
  6056.     RoleDefinitions.prototype.getByType = function (roleTypeKind) {
  6057.         return new RoleDefinition(this, "getbytype(" + roleTypeKind + ")");
  6058.     };
  6059.     /**
  6060.      * Create a role definition
  6061.      *
  6062.      * @param name The new role definition's name
  6063.      * @param description The new role definition's description
  6064.      * @param order The order in which the role definition appears
  6065.      * @param basePermissions The permissions mask for this role definition
  6066.      *
  6067.      */
  6068.     RoleDefinitions.prototype.add = function (name, description, order, basePermissions) {
  6069.         var _this = this;
  6070.         var postBody = JSON.stringify({
  6071.             BasePermissions: util_1.Util.extend({ __metadata: { type: "SP.BasePermissions" } }, basePermissions),
  6072.             Description: description,
  6073.             Name: name,
  6074.             Order: order,
  6075.             __metadata: { "type": "SP.RoleDefinition" },
  6076.         });
  6077.         return this.post({ body: postBody }).then(function (data) {
  6078.             return {
  6079.                 data: data,
  6080.                 definition: _this.getById(data.Id),
  6081.             };
  6082.         });
  6083.     };
  6084.     return RoleDefinitions;
  6085. }(queryable_1.QueryableCollection));
  6086. exports.RoleDefinitions = RoleDefinitions;
  6087. var RoleDefinition = (function (_super) {
  6088.     __extends(RoleDefinition, _super);
  6089.     function RoleDefinition() {
  6090.         return _super !== null && _super.apply(this, arguments) || this;
  6091.     }
  6092.     /**
  6093.      * Updates this web intance with the supplied properties
  6094.      *
  6095.      * @param properties A plain object hash of values to update for the web
  6096.      */
  6097.     /* tslint:disable no-string-literal */
  6098.     RoleDefinition.prototype.update = function (properties) {
  6099.         var _this = this;
  6100.         if (typeof properties.hasOwnProperty("BasePermissions") !== "undefined") {
  6101.             properties["BasePermissions"] = util_1.Util.extend({ __metadata: { type: "SP.BasePermissions" } }, properties["BasePermissions"]);
  6102.         }
  6103.         var postBody = JSON.stringify(util_1.Util.extend({
  6104.             "__metadata": { "type": "SP.RoleDefinition" },
  6105.         }, properties));
  6106.         return this.post({
  6107.             body: postBody,
  6108.             headers: {
  6109.                 "X-HTTP-Method": "MERGE",
  6110.             },
  6111.         }).then(function (data) {
  6112.             var retDef = _this;
  6113.             if (properties.hasOwnProperty("Name")) {
  6114.                 var parent_1 = _this.getParent(RoleDefinitions, _this.parentUrl, "");
  6115.                 retDef = parent_1.getByName(properties["Name"]);
  6116.             }
  6117.             return {
  6118.                 data: data,
  6119.                 definition: retDef,
  6120.             };
  6121.         });
  6122.     };
  6123.     /* tslint:enable */
  6124.     /**
  6125.      * Delete this role definition
  6126.      *
  6127.      */
  6128.     RoleDefinition.prototype.delete = function () {
  6129.         return this.post({
  6130.             headers: {
  6131.                 "X-HTTP-Method": "DELETE",
  6132.             },
  6133.         });
  6134.     };
  6135.     return RoleDefinition;
  6136. }(queryable_1.QueryableInstance));
  6137. exports.RoleDefinition = RoleDefinition;
  6138. var RoleDefinitionBindings = (function (_super) {
  6139.     __extends(RoleDefinitionBindings, _super);
  6140.     function RoleDefinitionBindings(baseUrl, path) {
  6141.         if (path === void 0) { path = "roledefinitionbindings"; }
  6142.         return _super.call(this, baseUrl, path) || this;
  6143.     }
  6144.     return RoleDefinitionBindings;
  6145. }(queryable_1.QueryableCollection));
  6146. exports.RoleDefinitionBindings = RoleDefinitionBindings;
  6147.  
  6148.  
  6149. /***/ }),
  6150. /* 18 */
  6151. /***/ (function(module, exports, __webpack_require__) {
  6152.  
  6153. "use strict";
  6154.  
  6155. var __extends = (this && this.__extends) || (function () {
  6156.     var extendStatics = Object.setPrototypeOf ||
  6157.         ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  6158.         function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  6159.     return function (d, b) {
  6160.         extendStatics(d, b);
  6161.         function __() { this.constructor = d; }
  6162.         d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  6163.     };
  6164. })();
  6165. Object.defineProperty(exports, "__esModule", { value: true });
  6166. var queryable_1 = __webpack_require__(1);
  6167. var siteusers_1 = __webpack_require__(30);
  6168. var util_1 = __webpack_require__(0);
  6169. /**
  6170.  * Principal Type enum
  6171.  *
  6172.  */
  6173. var PrincipalType;
  6174. (function (PrincipalType) {
  6175.     PrincipalType[PrincipalType["None"] = 0] = "None";
  6176.     PrincipalType[PrincipalType["User"] = 1] = "User";
  6177.     PrincipalType[PrincipalType["DistributionList"] = 2] = "DistributionList";
  6178.     PrincipalType[PrincipalType["SecurityGroup"] = 4] = "SecurityGroup";
  6179.     PrincipalType[PrincipalType["SharePointGroup"] = 8] = "SharePointGroup";
  6180.     PrincipalType[PrincipalType["All"] = 15] = "All";
  6181. })(PrincipalType = exports.PrincipalType || (exports.PrincipalType = {}));
  6182. /**
  6183.  * Describes a collection of site users
  6184.  *
  6185.  */
  6186. var SiteGroups = (function (_super) {
  6187.     __extends(SiteGroups, _super);
  6188.     /**
  6189.      * Creates a new instance of the SiteUsers class
  6190.      *
  6191.      * @param baseUrl The url or Queryable which forms the parent of this user collection
  6192.      */
  6193.     function SiteGroups(baseUrl, path) {
  6194.         if (path === void 0) { path = "sitegroups"; }
  6195.         return _super.call(this, baseUrl, path) || this;
  6196.     }
  6197.     /**
  6198.      * Adds a new group to the site collection
  6199.      *
  6200.      * @param props The properties to be updated
  6201.      */
  6202.     SiteGroups.prototype.add = function (properties) {
  6203.         var _this = this;
  6204.         var postBody = JSON.stringify(util_1.Util.extend({ "__metadata": { "type": "SP.Group" } }, properties));
  6205.         return this.post({ body: postBody }).then(function (data) {
  6206.             return {
  6207.                 data: data,
  6208.                 group: _this.getById(data.Id),
  6209.             };
  6210.         });
  6211.     };
  6212.     /**
  6213.      * Gets a group from the collection by name
  6214.      *
  6215.      * @param email The name of the group
  6216.      */
  6217.     SiteGroups.prototype.getByName = function (groupName) {
  6218.         return new SiteGroup(this, "getByName('" + groupName + "')");
  6219.     };
  6220.     /**
  6221.      * Gets a group from the collection by id
  6222.      *
  6223.      * @param id The id of the group
  6224.      */
  6225.     SiteGroups.prototype.getById = function (id) {
  6226.         var sg = new SiteGroup(this);
  6227.         sg.concat("(" + id + ")");
  6228.         return sg;
  6229.     };
  6230.     /**
  6231.      * Removes the group with the specified member ID from the collection.
  6232.      *
  6233.      * @param id The id of the group to remove
  6234.      */
  6235.     SiteGroups.prototype.removeById = function (id) {
  6236.         return this.clone(SiteGroups, "removeById('" + id + "')", true).post();
  6237.     };
  6238.     /**
  6239.      * Removes a user from the collection by login name
  6240.      *
  6241.      * @param loginName The login name of the user
  6242.      */
  6243.     SiteGroups.prototype.removeByLoginName = function (loginName) {
  6244.         return this.clone(SiteGroups, "removeByLoginName('" + loginName + "')", true).post();
  6245.     };
  6246.     return SiteGroups;
  6247. }(queryable_1.QueryableCollection));
  6248. exports.SiteGroups = SiteGroups;
  6249. /**
  6250.  * Describes a single group
  6251.  *
  6252.  */
  6253. var SiteGroup = (function (_super) {
  6254.     __extends(SiteGroup, _super);
  6255.     function SiteGroup() {
  6256.         return _super !== null && _super.apply(this, arguments) || this;
  6257.     }
  6258.     Object.defineProperty(SiteGroup.prototype, "users", {
  6259.         /**
  6260.          * Get's the users for this group
  6261.          *
  6262.          */
  6263.         get: function () {
  6264.             return new siteusers_1.SiteUsers(this, "users");
  6265.         },
  6266.         enumerable: true,
  6267.         configurable: true
  6268.     });
  6269.     /**
  6270.     * Updates this group instance with the supplied properties
  6271.     *
  6272.     * @param properties A GroupWriteableProperties object of property names and values to update for the user
  6273.     */
  6274.     /* tslint:disable no-string-literal */
  6275.     SiteGroup.prototype.update = function (properties) {
  6276.         var _this = this;
  6277.         var postBody = util_1.Util.extend({ "__metadata": { "type": "SP.Group" } }, properties);
  6278.         return this.post({
  6279.             body: JSON.stringify(postBody),
  6280.             headers: {
  6281.                 "X-HTTP-Method": "MERGE",
  6282.             },
  6283.         }).then(function (data) {
  6284.             var retGroup = _this;
  6285.             if (properties.hasOwnProperty("Title")) {
  6286.                 retGroup = _this.getParent(SiteGroup, _this.parentUrl, "getByName('" + properties["Title"] + "')");
  6287.             }
  6288.             return {
  6289.                 data: data,
  6290.                 group: retGroup,
  6291.             };
  6292.         });
  6293.     };
  6294.     return SiteGroup;
  6295. }(queryable_1.QueryableInstance));
  6296. exports.SiteGroup = SiteGroup;
  6297.  
  6298.  
  6299. /***/ }),
  6300. /* 19 */
  6301. /***/ (function(module, exports, __webpack_require__) {
  6302.  
  6303. "use strict";
  6304.  
  6305. var __extends = (this && this.__extends) || (function () {
  6306.     var extendStatics = Object.setPrototypeOf ||
  6307.         ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  6308.         function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  6309.     return function (d, b) {
  6310.         extendStatics(d, b);
  6311.         function __() { this.constructor = d; }
  6312.         d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  6313.     };
  6314. })();
  6315. Object.defineProperty(exports, "__esModule", { value: true });
  6316. var queryable_1 = __webpack_require__(1);
  6317. var util_1 = __webpack_require__(0);
  6318. var UserCustomActions = (function (_super) {
  6319.     __extends(UserCustomActions, _super);
  6320.     function UserCustomActions(baseUrl, path) {
  6321.         if (path === void 0) { path = "usercustomactions"; }
  6322.         return _super.call(this, baseUrl, path) || this;
  6323.     }
  6324.     /**
  6325.      * Returns the custom action with the specified identifier.
  6326.      *
  6327.      * @param id The GUID ID of the user custom action to get.
  6328.      */
  6329.     UserCustomActions.prototype.getById = function (id) {
  6330.         var uca = new UserCustomAction(this);
  6331.         uca.concat("('" + id + "')");
  6332.         return uca;
  6333.     };
  6334.     /**
  6335.      * Create a custom action
  6336.      *
  6337.      * @param creationInfo The information which defines the new custom action
  6338.      *
  6339.      */
  6340.     UserCustomActions.prototype.add = function (properties) {
  6341.         var _this = this;
  6342.         var postBody = JSON.stringify(util_1.Util.extend({ __metadata: { "type": "SP.UserCustomAction" } }, properties));
  6343.         return this.post({ body: postBody }).then(function (data) {
  6344.             return {
  6345.                 action: _this.getById(data.Id),
  6346.                 data: data,
  6347.             };
  6348.         });
  6349.     };
  6350.     /**
  6351.      * Deletes all custom actions in the collection.
  6352.      *
  6353.      */
  6354.     UserCustomActions.prototype.clear = function () {
  6355.         return this.clone(UserCustomActions, "clear", true).post();
  6356.     };
  6357.     return UserCustomActions;
  6358. }(queryable_1.QueryableCollection));
  6359. exports.UserCustomActions = UserCustomActions;
  6360. var UserCustomAction = (function (_super) {
  6361.     __extends(UserCustomAction, _super);
  6362.     function UserCustomAction() {
  6363.         return _super !== null && _super.apply(this, arguments) || this;
  6364.     }
  6365.     UserCustomAction.prototype.update = function (properties) {
  6366.         var _this = this;
  6367.         var postBody = JSON.stringify(util_1.Util.extend({
  6368.             "__metadata": { "type": "SP.UserCustomAction" },
  6369.         }, properties));
  6370.         return this.post({
  6371.             body: postBody,
  6372.             headers: {
  6373.                 "X-HTTP-Method": "MERGE",
  6374.             },
  6375.         }).then(function (data) {
  6376.             return {
  6377.                 action: _this,
  6378.                 data: data,
  6379.             };
  6380.         });
  6381.     };
  6382.     /**
  6383.     * Remove a custom action
  6384.     *
  6385.     */
  6386.     UserCustomAction.prototype.delete = function () {
  6387.         return _super.prototype.delete.call(this);
  6388.     };
  6389.     return UserCustomAction;
  6390. }(queryable_1.QueryableInstance));
  6391. exports.UserCustomAction = UserCustomAction;
  6392.  
  6393.  
  6394. /***/ }),
  6395. /* 20 */
  6396. /***/ (function(module, exports, __webpack_require__) {
  6397.  
  6398. "use strict";
  6399.  
  6400. Object.defineProperty(exports, "__esModule", { value: true });
  6401. var storage = __webpack_require__(14);
  6402. var exceptions_1 = __webpack_require__(3);
  6403. /**
  6404.  * A caching provider which can wrap other non-caching providers
  6405.  *
  6406.  */
  6407. var CachingConfigurationProvider = (function () {
  6408.     /**
  6409.      * Creates a new caching configuration provider
  6410.      * @constructor
  6411.      * @param {IConfigurationProvider} wrappedProvider Provider which will be used to fetch the configuration
  6412.      * @param {string} cacheKey Key that will be used to store cached items to the cache
  6413.      * @param {IPnPClientStore} cacheStore OPTIONAL storage, which will be used to store cached settings.
  6414.      */
  6415.     function CachingConfigurationProvider(wrappedProvider, cacheKey, cacheStore) {
  6416.         this.wrappedProvider = wrappedProvider;
  6417.         this.store = (cacheStore) ? cacheStore : this.selectPnPCache();
  6418.         this.cacheKey = "_configcache_" + cacheKey;
  6419.     }
  6420.     /**
  6421.      * Gets the wrapped configuration providers
  6422.      *
  6423.      * @return {IConfigurationProvider} Wrapped configuration provider
  6424.      */
  6425.     CachingConfigurationProvider.prototype.getWrappedProvider = function () {
  6426.         return this.wrappedProvider;
  6427.     };
  6428.     /**
  6429.      * Loads the configuration values either from the cache or from the wrapped provider
  6430.      *
  6431.      * @return {Promise<TypedHash<string>>} Promise of loaded configuration values
  6432.      */
  6433.     CachingConfigurationProvider.prototype.getConfiguration = function () {
  6434.         var _this = this;
  6435.         // Cache not available, pass control to  the wrapped provider
  6436.         if ((!this.store) || (!this.store.enabled)) {
  6437.             return this.wrappedProvider.getConfiguration();
  6438.         }
  6439.         // Value is found in cache, return it directly
  6440.         var cachedConfig = this.store.get(this.cacheKey);
  6441.         if (cachedConfig) {
  6442.             return new Promise(function (resolve) {
  6443.                 resolve(cachedConfig);
  6444.             });
  6445.         }
  6446.         // Get and cache value from the wrapped provider
  6447.         var providerPromise = this.wrappedProvider.getConfiguration();
  6448.         providerPromise.then(function (providedConfig) {
  6449.             _this.store.put(_this.cacheKey, providedConfig);
  6450.         });
  6451.         return providerPromise;
  6452.     };
  6453.     CachingConfigurationProvider.prototype.selectPnPCache = function () {
  6454.         var pnpCache = new storage.PnPClientStorage();
  6455.         if ((pnpCache.local) && (pnpCache.local.enabled)) {
  6456.             return pnpCache.local;
  6457.         }
  6458.         if ((pnpCache.session) && (pnpCache.session.enabled)) {
  6459.             return pnpCache.session;
  6460.         }
  6461.         throw new exceptions_1.NoCacheAvailableException();
  6462.     };
  6463.     return CachingConfigurationProvider;
  6464. }());
  6465. exports.default = CachingConfigurationProvider;
  6466.  
  6467.  
  6468. /***/ }),
  6469. /* 21 */
  6470. /***/ (function(module, exports, __webpack_require__) {
  6471.  
  6472. "use strict";
  6473. /* WEBPACK VAR INJECTION */(function(global) {
  6474. Object.defineProperty(exports, "__esModule", { value: true });
  6475. /**
  6476.  * Makes requests using the fetch API
  6477.  */
  6478. var FetchClient = (function () {
  6479.     function FetchClient() {
  6480.     }
  6481.     FetchClient.prototype.fetch = function (url, options) {
  6482.         return global.fetch(url, options);
  6483.     };
  6484.     return FetchClient;
  6485. }());
  6486. exports.FetchClient = FetchClient;
  6487.  
  6488. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(32)))
  6489.  
  6490. /***/ }),
  6491. /* 22 */
  6492. /***/ (function(module, exports, __webpack_require__) {
  6493.  
  6494. "use strict";
  6495.  
  6496. Object.defineProperty(exports, "__esModule", { value: true });
  6497. var storage_1 = __webpack_require__(14);
  6498. var util_1 = __webpack_require__(0);
  6499. var pnplibconfig_1 = __webpack_require__(4);
  6500. var CachingOptions = (function () {
  6501.     function CachingOptions(key) {
  6502.         this.key = key;
  6503.         this.expiration = util_1.Util.dateAdd(new Date(), "second", pnplibconfig_1.RuntimeConfig.defaultCachingTimeoutSeconds);
  6504.         this.storeName = pnplibconfig_1.RuntimeConfig.defaultCachingStore;
  6505.     }
  6506.     Object.defineProperty(CachingOptions.prototype, "store", {
  6507.         get: function () {
  6508.             if (this.storeName === "local") {
  6509.                 return CachingOptions.storage.local;
  6510.             }
  6511.             else {
  6512.                 return CachingOptions.storage.session;
  6513.             }
  6514.         },
  6515.         enumerable: true,
  6516.         configurable: true
  6517.     });
  6518.     return CachingOptions;
  6519. }());
  6520. CachingOptions.storage = new storage_1.PnPClientStorage();
  6521. exports.CachingOptions = CachingOptions;
  6522. var CachingParserWrapper = (function () {
  6523.     function CachingParserWrapper(_parser, _cacheOptions) {
  6524.         this._parser = _parser;
  6525.         this._cacheOptions = _cacheOptions;
  6526.     }
  6527.     CachingParserWrapper.prototype.parse = function (response) {
  6528.         var _this = this;
  6529.         // add this to the cache based on the options
  6530.         return this._parser.parse(response).then(function (data) {
  6531.             if (_this._cacheOptions.store !== null) {
  6532.                 _this._cacheOptions.store.put(_this._cacheOptions.key, data, _this._cacheOptions.expiration);
  6533.             }
  6534.             return data;
  6535.         });
  6536.     };
  6537.     return CachingParserWrapper;
  6538. }());
  6539. exports.CachingParserWrapper = CachingParserWrapper;
  6540.  
  6541.  
  6542. /***/ }),
  6543. /* 23 */
  6544. /***/ (function(module, exports, __webpack_require__) {
  6545.  
  6546. "use strict";
  6547.  
  6548. var __extends = (this && this.__extends) || (function () {
  6549.     var extendStatics = Object.setPrototypeOf ||
  6550.         ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  6551.         function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  6552.     return function (d, b) {
  6553.         extendStatics(d, b);
  6554.         function __() { this.constructor = d; }
  6555.         d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  6556.     };
  6557. })();
  6558. Object.defineProperty(exports, "__esModule", { value: true });
  6559. var queryable_1 = __webpack_require__(1);
  6560. /**
  6561.  * Describes a collection of List objects
  6562.  *
  6563.  */
  6564. var Features = (function (_super) {
  6565.     __extends(Features, _super);
  6566.     /**
  6567.      * Creates a new instance of the Lists class
  6568.      *
  6569.      * @param baseUrl The url or Queryable which forms the parent of this fields collection
  6570.      */
  6571.     function Features(baseUrl, path) {
  6572.         if (path === void 0) { path = "features"; }
  6573.         return _super.call(this, baseUrl, path) || this;
  6574.     }
  6575.     /**
  6576.      * Gets a list from the collection by guid id
  6577.      *
  6578.      * @param id The Id of the feature (GUID)
  6579.      */
  6580.     Features.prototype.getById = function (id) {
  6581.         var feature = new Feature(this);
  6582.         feature.concat("('" + id + "')");
  6583.         return feature;
  6584.     };
  6585.     /**
  6586.      * Adds a new list to the collection
  6587.      *
  6588.      * @param id The Id of the feature (GUID)
  6589.      * @param force If true the feature activation will be forced
  6590.      */
  6591.     Features.prototype.add = function (id, force) {
  6592.         var _this = this;
  6593.         if (force === void 0) { force = false; }
  6594.         return this.clone(Features, "add", true).post({
  6595.             body: JSON.stringify({
  6596.                 featdefScope: 0,
  6597.                 featureId: id,
  6598.                 force: force,
  6599.             }),
  6600.         }).then(function (data) {
  6601.             return {
  6602.                 data: data,
  6603.                 feature: _this.getById(id),
  6604.             };
  6605.         });
  6606.     };
  6607.     /**
  6608.      * Removes (deactivates) a feature from the collection
  6609.      *
  6610.      * @param id The Id of the feature (GUID)
  6611.      * @param force If true the feature deactivation will be forced
  6612.      */
  6613.     Features.prototype.remove = function (id, force) {
  6614.         if (force === void 0) { force = false; }
  6615.         return this.clone(Features, "remove", true).post({
  6616.             body: JSON.stringify({
  6617.                 featureId: id,
  6618.                 force: force,
  6619.             }),
  6620.         });
  6621.     };
  6622.     return Features;
  6623. }(queryable_1.QueryableCollection));
  6624. exports.Features = Features;
  6625. var Feature = (function (_super) {
  6626.     __extends(Feature, _super);
  6627.     function Feature() {
  6628.         return _super !== null && _super.apply(this, arguments) || this;
  6629.     }
  6630.     /**
  6631.      * Removes (deactivates) a feature from the collection
  6632.      *
  6633.      * @param force If true the feature deactivation will be forced
  6634.      */
  6635.     Feature.prototype.deactivate = function (force) {
  6636.         var _this = this;
  6637.         if (force === void 0) { force = false; }
  6638.         var removeDependency = this.addBatchDependency();
  6639.         var idGet = new Feature(this).select("DefinitionId");
  6640.         return idGet.getAs().then(function (feature) {
  6641.             var promise = _this.getParent(Features, _this.parentUrl, "", _this.batch).remove(feature.DefinitionId, force);
  6642.             removeDependency();
  6643.             return promise;
  6644.         });
  6645.     };
  6646.     return Feature;
  6647. }(queryable_1.QueryableInstance));
  6648. exports.Feature = Feature;
  6649.  
  6650.  
  6651. /***/ }),
  6652. /* 24 */
  6653. /***/ (function(module, exports, __webpack_require__) {
  6654.  
  6655. "use strict";
  6656.  
  6657. var __extends = (this && this.__extends) || (function () {
  6658.     var extendStatics = Object.setPrototypeOf ||
  6659.         ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  6660.         function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  6661.     return function (d, b) {
  6662.         extendStatics(d, b);
  6663.         function __() { this.constructor = d; }
  6664.         d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  6665.     };
  6666. })();
  6667. Object.defineProperty(exports, "__esModule", { value: true });
  6668. var queryable_1 = __webpack_require__(1);
  6669. var util_1 = __webpack_require__(0);
  6670. var types_1 = __webpack_require__(13);
  6671. /**
  6672.  * Describes a collection of Field objects
  6673.  *
  6674.  */
  6675. var Fields = (function (_super) {
  6676.     __extends(Fields, _super);
  6677.     /**
  6678.      * Creates a new instance of the Fields class
  6679.      *
  6680.      * @param baseUrl The url or Queryable which forms the parent of this fields collection
  6681.      */
  6682.     function Fields(baseUrl, path) {
  6683.         if (path === void 0) { path = "fields"; }
  6684.         return _super.call(this, baseUrl, path) || this;
  6685.     }
  6686.     /**
  6687.      * Gets a field from the collection by title
  6688.      *
  6689.      * @param title The case-sensitive title of the field
  6690.      */
  6691.     Fields.prototype.getByTitle = function (title) {
  6692.         return new Field(this, "getByTitle('" + title + "')");
  6693.     };
  6694.     /**
  6695.      * Gets a field from the collection by using internal name or title
  6696.      *
  6697.      * @param name The case-sensitive internal name or title of the field
  6698.      */
  6699.     Fields.prototype.getByInternalNameOrTitle = function (name) {
  6700.         return new Field(this, "getByInternalNameOrTitle('" + name + "')");
  6701.     };
  6702.     /**
  6703.      * Gets a list from the collection by guid id
  6704.      *
  6705.      * @param title The Id of the list
  6706.      */
  6707.     Fields.prototype.getById = function (id) {
  6708.         var f = new Field(this);
  6709.         f.concat("('" + id + "')");
  6710.         return f;
  6711.     };
  6712.     /**
  6713.      * Creates a field based on the specified schema
  6714.      */
  6715.     Fields.prototype.createFieldAsXml = function (xml) {
  6716.         var _this = this;
  6717.         var info;
  6718.         if (typeof xml === "string") {
  6719.             info = { SchemaXml: xml };
  6720.         }
  6721.         else {
  6722.             info = xml;
  6723.         }
  6724.         var postBody = JSON.stringify({
  6725.             "parameters": util_1.Util.extend({
  6726.                 "__metadata": {
  6727.                     "type": "SP.XmlSchemaFieldCreationInformation",
  6728.                 },
  6729.             }, info),
  6730.         });
  6731.         return this.clone(Fields, "createfieldasxml", true).postAs({ body: postBody }).then(function (data) {
  6732.             return {
  6733.                 data: data,
  6734.                 field: _this.getById(data.Id),
  6735.             };
  6736.         });
  6737.     };
  6738.     /**
  6739.      * Adds a new list to the collection
  6740.      *
  6741.      * @param title The new field's title
  6742.      * @param fieldType The new field's type (ex: SP.FieldText)
  6743.      * @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx)
  6744.      */
  6745.     Fields.prototype.add = function (title, fieldType, properties) {
  6746.         var _this = this;
  6747.         if (properties === void 0) { properties = {}; }
  6748.         var postBody = JSON.stringify(util_1.Util.extend({
  6749.             "Title": title,
  6750.             "__metadata": { "type": fieldType },
  6751.         }, properties));
  6752.         return this.clone(Fields, null, true).postAs({ body: postBody }).then(function (data) {
  6753.             return {
  6754.                 data: data,
  6755.                 field: _this.getById(data.Id),
  6756.             };
  6757.         });
  6758.     };
  6759.     /**
  6760.      * Adds a new SP.FieldText to the collection
  6761.      *
  6762.      * @param title The field title
  6763.      * @param maxLength The maximum number of characters allowed in the value of the field.
  6764.      * @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx)
  6765.      */
  6766.     Fields.prototype.addText = function (title, maxLength, properties) {
  6767.         if (maxLength === void 0) { maxLength = 255; }
  6768.         var props = {
  6769.             FieldTypeKind: 2,
  6770.             MaxLength: maxLength,
  6771.         };
  6772.         return this.add(title, "SP.FieldText", util_1.Util.extend(props, properties));
  6773.     };
  6774.     /**
  6775.      * Adds a new SP.FieldCalculated to the collection
  6776.      *
  6777.      * @param title The field title.
  6778.      * @param formula The formula for the field.
  6779.      * @param dateFormat The date and time format that is displayed in the field.
  6780.      * @param outputType Specifies the output format for the field. Represents a FieldType value.
  6781.      * @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx)
  6782.      */
  6783.     Fields.prototype.addCalculated = function (title, formula, dateFormat, outputType, properties) {
  6784.         if (outputType === void 0) { outputType = types_1.FieldTypes.Text; }
  6785.         var props = {
  6786.             DateFormat: dateFormat,
  6787.             FieldTypeKind: 17,
  6788.             Formula: formula,
  6789.             OutputType: outputType,
  6790.         };
  6791.         return this.add(title, "SP.FieldCalculated", util_1.Util.extend(props, properties));
  6792.     };
  6793.     /**
  6794.      * Adds a new SP.FieldDateTime to the collection
  6795.      *
  6796.      * @param title The field title
  6797.      * @param displayFormat The format of the date and time that is displayed in the field.
  6798.      * @param calendarType Specifies the calendar type of the field.
  6799.      * @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx)
  6800.      */
  6801.     Fields.prototype.addDateTime = function (title, displayFormat, calendarType, friendlyDisplayFormat, properties) {
  6802.         if (displayFormat === void 0) { displayFormat = types_1.DateTimeFieldFormatType.DateOnly; }
  6803.         if (calendarType === void 0) { calendarType = types_1.CalendarType.Gregorian; }
  6804.         if (friendlyDisplayFormat === void 0) { friendlyDisplayFormat = 0; }
  6805.         var props = {
  6806.             DateTimeCalendarType: calendarType,
  6807.             DisplayFormat: displayFormat,
  6808.             FieldTypeKind: 4,
  6809.             FriendlyDisplayFormat: friendlyDisplayFormat,
  6810.         };
  6811.         return this.add(title, "SP.FieldDateTime", util_1.Util.extend(props, properties));
  6812.     };
  6813.     /**
  6814.      * Adds a new SP.FieldNumber to the collection
  6815.      *
  6816.      * @param title The field title
  6817.      * @param minValue The field's minimum value
  6818.      * @param maxValue The field's maximum value
  6819.      * @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx)
  6820.      */
  6821.     Fields.prototype.addNumber = function (title, minValue, maxValue, properties) {
  6822.         var props = { FieldTypeKind: 9 };
  6823.         if (typeof minValue !== "undefined") {
  6824.             props = util_1.Util.extend({ MinimumValue: minValue }, props);
  6825.         }
  6826.         if (typeof maxValue !== "undefined") {
  6827.             props = util_1.Util.extend({ MaximumValue: maxValue }, props);
  6828.         }
  6829.         return this.add(title, "SP.FieldNumber", util_1.Util.extend(props, properties));
  6830.     };
  6831.     /**
  6832.      * Adds a new SP.FieldCurrency to the collection
  6833.      *
  6834.      * @param title The field title
  6835.      * @param minValue The field's minimum value
  6836.      * @param maxValue The field's maximum value
  6837.      * @param currencyLocalId Specifies the language code identifier (LCID) used to format the value of the field
  6838.      * @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx)
  6839.      */
  6840.     Fields.prototype.addCurrency = function (title, minValue, maxValue, currencyLocalId, properties) {
  6841.         if (currencyLocalId === void 0) { currencyLocalId = 1033; }
  6842.         var props = {
  6843.             CurrencyLocaleId: currencyLocalId,
  6844.             FieldTypeKind: 10,
  6845.         };
  6846.         if (typeof minValue !== "undefined") {
  6847.             props = util_1.Util.extend({ MinimumValue: minValue }, props);
  6848.         }
  6849.         if (typeof maxValue !== "undefined") {
  6850.             props = util_1.Util.extend({ MaximumValue: maxValue }, props);
  6851.         }
  6852.         return this.add(title, "SP.FieldCurrency", util_1.Util.extend(props, properties));
  6853.     };
  6854.     /**
  6855.      * Adds a new SP.FieldMultiLineText to the collection
  6856.      *
  6857.      * @param title The field title
  6858.      * @param numberOfLines Specifies the number of lines of text to display for the field.
  6859.      * @param richText Specifies whether the field supports rich formatting.
  6860.      * @param restrictedMode Specifies whether the field supports a subset of rich formatting.
  6861.      * @param appendOnly Specifies whether all changes to the value of the field are displayed in list forms.
  6862.      * @param allowHyperlink Specifies whether a hyperlink is allowed as a value of the field.
  6863.      * @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx)
  6864.      *
  6865.      */
  6866.     Fields.prototype.addMultilineText = function (title, numberOfLines, richText, restrictedMode, appendOnly, allowHyperlink, properties) {
  6867.         if (numberOfLines === void 0) { numberOfLines = 6; }
  6868.         if (richText === void 0) { richText = true; }
  6869.         if (restrictedMode === void 0) { restrictedMode = false; }
  6870.         if (appendOnly === void 0) { appendOnly = false; }
  6871.         if (allowHyperlink === void 0) { allowHyperlink = true; }
  6872.         var props = {
  6873.             AllowHyperlink: allowHyperlink,
  6874.             AppendOnly: appendOnly,
  6875.             FieldTypeKind: 3,
  6876.             NumberOfLines: numberOfLines,
  6877.             RestrictedMode: restrictedMode,
  6878.             RichText: richText,
  6879.         };
  6880.         return this.add(title, "SP.FieldMultiLineText", util_1.Util.extend(props, properties));
  6881.     };
  6882.     /**
  6883.      * Adds a new SP.FieldUrl to the collection
  6884.      *
  6885.      * @param title The field title
  6886.      */
  6887.     Fields.prototype.addUrl = function (title, displayFormat, properties) {
  6888.         if (displayFormat === void 0) { displayFormat = types_1.UrlFieldFormatType.Hyperlink; }
  6889.         var props = {
  6890.             DisplayFormat: displayFormat,
  6891.             FieldTypeKind: 11,
  6892.         };
  6893.         return this.add(title, "SP.FieldUrl", util_1.Util.extend(props, properties));
  6894.     };
  6895.     return Fields;
  6896. }(queryable_1.QueryableCollection));
  6897. exports.Fields = Fields;
  6898. /**
  6899.  * Describes a single of Field instance
  6900.  *
  6901.  */
  6902. var Field = (function (_super) {
  6903.     __extends(Field, _super);
  6904.     function Field() {
  6905.         return _super !== null && _super.apply(this, arguments) || this;
  6906.     }
  6907.     /**
  6908.      * Updates this field intance with the supplied properties
  6909.      *
  6910.      * @param properties A plain object hash of values to update for the list
  6911.      * @param fieldType The type value, required to update child field type properties
  6912.      */
  6913.     Field.prototype.update = function (properties, fieldType) {
  6914.         var _this = this;
  6915.         if (fieldType === void 0) { fieldType = "SP.Field"; }
  6916.         var postBody = JSON.stringify(util_1.Util.extend({
  6917.             "__metadata": { "type": fieldType },
  6918.         }, properties));
  6919.         return this.post({
  6920.             body: postBody,
  6921.             headers: {
  6922.                 "X-HTTP-Method": "MERGE",
  6923.             },
  6924.         }).then(function (data) {
  6925.             return {
  6926.                 data: data,
  6927.                 field: _this,
  6928.             };
  6929.         });
  6930.     };
  6931.     /**
  6932.      * Delete this fields
  6933.      *
  6934.      */
  6935.     Field.prototype.delete = function () {
  6936.         return this.post({
  6937.             headers: {
  6938.                 "X-HTTP-Method": "DELETE",
  6939.             },
  6940.         });
  6941.     };
  6942.     /**
  6943.      * Sets the value of the ShowInDisplayForm property for this field.
  6944.      */
  6945.     Field.prototype.setShowInDisplayForm = function (show) {
  6946.         return this.clone(Field, "setshowindisplayform(" + show + ")", true).post();
  6947.     };
  6948.     /**
  6949.      * Sets the value of the ShowInEditForm property for this field.
  6950.      */
  6951.     Field.prototype.setShowInEditForm = function (show) {
  6952.         return this.clone(Field, "setshowineditform(" + show + ")", true).post();
  6953.     };
  6954.     /**
  6955.      * Sets the value of the ShowInNewForm property for this field.
  6956.      */
  6957.     Field.prototype.setShowInNewForm = function (show) {
  6958.         return this.clone(Field, "setshowinnewform(" + show + ")", true).post();
  6959.     };
  6960.     return Field;
  6961. }(queryable_1.QueryableInstance));
  6962. exports.Field = Field;
  6963.  
  6964.  
  6965. /***/ }),
  6966. /* 25 */
  6967. /***/ (function(module, exports, __webpack_require__) {
  6968.  
  6969. "use strict";
  6970.  
  6971. var __extends = (this && this.__extends) || (function () {
  6972.     var extendStatics = Object.setPrototypeOf ||
  6973.         ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  6974.         function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  6975.     return function (d, b) {
  6976.         extendStatics(d, b);
  6977.         function __() { this.constructor = d; }
  6978.         d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  6979.     };
  6980. })();
  6981. Object.defineProperty(exports, "__esModule", { value: true });
  6982. var util_1 = __webpack_require__(0);
  6983. var queryable_1 = __webpack_require__(1);
  6984. /**
  6985.  * Represents a collection of navigation nodes
  6986.  *
  6987.  */
  6988. var NavigationNodes = (function (_super) {
  6989.     __extends(NavigationNodes, _super);
  6990.     function NavigationNodes() {
  6991.         return _super !== null && _super.apply(this, arguments) || this;
  6992.     }
  6993.     /**
  6994.      * Gets a navigation node by id
  6995.      *
  6996.      * @param id The id of the node
  6997.      */
  6998.     NavigationNodes.prototype.getById = function (id) {
  6999.         var node = new NavigationNode(this);
  7000.         node.concat("(" + id + ")");
  7001.         return node;
  7002.     };
  7003.     /**
  7004.      * Adds a new node to the collection
  7005.      *
  7006.      * @param title Display name of the node
  7007.      * @param url The url of the node
  7008.      * @param visible If true the node is visible, otherwise it is hidden (default: true)
  7009.      */
  7010.     NavigationNodes.prototype.add = function (title, url, visible) {
  7011.         var _this = this;
  7012.         if (visible === void 0) { visible = true; }
  7013.         var postBody = JSON.stringify({
  7014.             IsVisible: visible,
  7015.             Title: title,
  7016.             Url: url,
  7017.             "__metadata": { "type": "SP.NavigationNode" },
  7018.         });
  7019.         return this.clone(NavigationNodes, null, true).post({ body: postBody }).then(function (data) {
  7020.             return {
  7021.                 data: data,
  7022.                 node: _this.getById(data.Id),
  7023.             };
  7024.         });
  7025.     };
  7026.     /**
  7027.      * Moves a node to be after another node in the navigation
  7028.      *
  7029.      * @param nodeId Id of the node to move
  7030.      * @param previousNodeId Id of the node after which we move the node specified by nodeId
  7031.      */
  7032.     NavigationNodes.prototype.moveAfter = function (nodeId, previousNodeId) {
  7033.         var postBody = JSON.stringify({
  7034.             nodeId: nodeId,
  7035.             previousNodeId: previousNodeId,
  7036.         });
  7037.         return this.clone(NavigationNodes, "MoveAfter", true).post({ body: postBody });
  7038.     };
  7039.     return NavigationNodes;
  7040. }(queryable_1.QueryableCollection));
  7041. exports.NavigationNodes = NavigationNodes;
  7042. var NavigationNode = (function (_super) {
  7043.     __extends(NavigationNode, _super);
  7044.     function NavigationNode() {
  7045.         return _super !== null && _super.apply(this, arguments) || this;
  7046.     }
  7047.     Object.defineProperty(NavigationNode.prototype, "children", {
  7048.         /**
  7049.          * Represents the child nodes of this node
  7050.          */
  7051.         get: function () {
  7052.             return new NavigationNodes(this, "Children");
  7053.         },
  7054.         enumerable: true,
  7055.         configurable: true
  7056.     });
  7057.     /**
  7058.      * Updates this node based on the supplied properties
  7059.      *
  7060.      * @param properties The hash of key/value pairs to update
  7061.      */
  7062.     NavigationNode.prototype.update = function (properties) {
  7063.         var _this = this;
  7064.         var postBody = JSON.stringify(util_1.Util.extend({
  7065.             "__metadata": { "type": "SP.NavigationNode" },
  7066.         }, properties));
  7067.         return this.post({
  7068.             body: postBody,
  7069.             headers: {
  7070.                 "X-HTTP-Method": "MERGE",
  7071.             },
  7072.         }).then(function (data) {
  7073.             return {
  7074.                 data: data,
  7075.                 node: _this,
  7076.             };
  7077.         });
  7078.     };
  7079.     /**
  7080.      * Deletes this node and any child nodes
  7081.      */
  7082.     NavigationNode.prototype.delete = function () {
  7083.         return _super.prototype.delete.call(this);
  7084.     };
  7085.     return NavigationNode;
  7086. }(queryable_1.QueryableInstance));
  7087. exports.NavigationNode = NavigationNode;
  7088. /**
  7089.  * Exposes the navigation components
  7090.  *
  7091.  */
  7092. var Navigation = (function (_super) {
  7093.     __extends(Navigation, _super);
  7094.     /**
  7095.      * Creates a new instance of the Lists class
  7096.      *
  7097.      * @param baseUrl The url or Queryable which forms the parent of this fields collection
  7098.      */
  7099.     function Navigation(baseUrl, path) {
  7100.         if (path === void 0) { path = "navigation"; }
  7101.         return _super.call(this, baseUrl, path) || this;
  7102.     }
  7103.     Object.defineProperty(Navigation.prototype, "quicklaunch", {
  7104.         /**
  7105.          * Gets the quicklaunch navigation for the current context
  7106.          *
  7107.          */
  7108.         get: function () {
  7109.             return new NavigationNodes(this, "quicklaunch");
  7110.         },
  7111.         enumerable: true,
  7112.         configurable: true
  7113.     });
  7114.     Object.defineProperty(Navigation.prototype, "topNavigationBar", {
  7115.         /**
  7116.          * Gets the top bar navigation navigation for the current context
  7117.          *
  7118.          */
  7119.         get: function () {
  7120.             return new NavigationNodes(this, "topnavigationbar");
  7121.         },
  7122.         enumerable: true,
  7123.         configurable: true
  7124.     });
  7125.     return Navigation;
  7126. }(queryable_1.Queryable));
  7127. exports.Navigation = Navigation;
  7128.  
  7129.  
  7130. /***/ }),
  7131. /* 26 */
  7132. /***/ (function(module, exports, __webpack_require__) {
  7133.  
  7134. "use strict";
  7135.  
  7136. var __extends = (this && this.__extends) || (function () {
  7137.     var extendStatics = Object.setPrototypeOf ||
  7138.         ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  7139.         function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  7140.     return function (d, b) {
  7141.         extendStatics(d, b);
  7142.         function __() { this.constructor = d; }
  7143.         d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  7144.     };
  7145. })();
  7146. Object.defineProperty(exports, "__esModule", { value: true });
  7147. var webs_1 = __webpack_require__(7);
  7148. var roles_1 = __webpack_require__(17);
  7149. var types_1 = __webpack_require__(13);
  7150. var queryable_1 = __webpack_require__(1);
  7151. var QueryableSecurable = (function (_super) {
  7152.     __extends(QueryableSecurable, _super);
  7153.     function QueryableSecurable() {
  7154.         return _super !== null && _super.apply(this, arguments) || this;
  7155.     }
  7156.     Object.defineProperty(QueryableSecurable.prototype, "roleAssignments", {
  7157.         /**
  7158.          * Gets the set of role assignments for this item
  7159.          *
  7160.          */
  7161.         get: function () {
  7162.             return new roles_1.RoleAssignments(this);
  7163.         },
  7164.         enumerable: true,
  7165.         configurable: true
  7166.     });
  7167.     Object.defineProperty(QueryableSecurable.prototype, "firstUniqueAncestorSecurableObject", {
  7168.         /**
  7169.          * Gets the closest securable up the security hierarchy whose permissions are applied to this list item
  7170.          *
  7171.          */
  7172.         get: function () {
  7173.             return new queryable_1.QueryableInstance(this, "FirstUniqueAncestorSecurableObject");
  7174.         },
  7175.         enumerable: true,
  7176.         configurable: true
  7177.     });
  7178.     /**
  7179.      * Gets the effective permissions for the user supplied
  7180.      *
  7181.      * @param loginName The claims username for the user (ex: i:0#.f|membership|user@domain.com)
  7182.      */
  7183.     QueryableSecurable.prototype.getUserEffectivePermissions = function (loginName) {
  7184.         var q = this.clone(queryable_1.Queryable, "getUserEffectivePermissions(@user)", true);
  7185.         q.query.add("@user", "'" + encodeURIComponent(loginName) + "'");
  7186.         return q.getAs();
  7187.     };
  7188.     /**
  7189.      * Gets the effective permissions for the current user
  7190.      */
  7191.     QueryableSecurable.prototype.getCurrentUserEffectivePermissions = function () {
  7192.         var _this = this;
  7193.         var w = webs_1.Web.fromUrl(this.toUrl());
  7194.         return w.currentUser.select("LoginName").getAs().then(function (user) {
  7195.             return _this.getUserEffectivePermissions(user.LoginName);
  7196.         });
  7197.     };
  7198.     /**
  7199.      * Breaks the security inheritance at this level optinally copying permissions and clearing subscopes
  7200.      *
  7201.      * @param copyRoleAssignments If true the permissions are copied from the current parent scope
  7202.      * @param clearSubscopes Optional. true to make all child securable objects inherit role assignments from the current object
  7203.      */
  7204.     QueryableSecurable.prototype.breakRoleInheritance = function (copyRoleAssignments, clearSubscopes) {
  7205.         if (copyRoleAssignments === void 0) { copyRoleAssignments = false; }
  7206.         if (clearSubscopes === void 0) { clearSubscopes = false; }
  7207.         return this.clone(QueryableSecurable, "breakroleinheritance(copyroleassignments=" + copyRoleAssignments + ", clearsubscopes=" + clearSubscopes + ")", true).post();
  7208.     };
  7209.     /**
  7210.      * Removes the local role assignments so that it re-inherit role assignments from the parent object.
  7211.      *
  7212.      */
  7213.     QueryableSecurable.prototype.resetRoleInheritance = function () {
  7214.         return this.clone(QueryableSecurable, "resetroleinheritance", true).post();
  7215.     };
  7216.     /**
  7217.      * Determines if a given user has the appropriate permissions
  7218.      *
  7219.      * @param loginName The user to check
  7220.      * @param permission The permission being checked
  7221.      */
  7222.     QueryableSecurable.prototype.userHasPermissions = function (loginName, permission) {
  7223.         var _this = this;
  7224.         return this.getUserEffectivePermissions(loginName).then(function (perms) {
  7225.             return _this.hasPermissions(perms, permission);
  7226.         });
  7227.     };
  7228.     /**
  7229.      * Determines if the current user has the requested permissions
  7230.      *
  7231.      * @param permission The permission we wish to check
  7232.      */
  7233.     QueryableSecurable.prototype.currentUserHasPermissions = function (permission) {
  7234.         var _this = this;
  7235.         return this.getCurrentUserEffectivePermissions().then(function (perms) {
  7236.             return _this.hasPermissions(perms, permission);
  7237.         });
  7238.     };
  7239.     /**
  7240.      * Taken from sp.js, checks the supplied permissions against the mask
  7241.      *
  7242.      * @param value The security principal's permissions on the given object
  7243.      * @param perm The permission checked against the value
  7244.      */
  7245.     /* tslint:disable:no-bitwise */
  7246.     QueryableSecurable.prototype.hasPermissions = function (value, perm) {
  7247.         if (!perm) {
  7248.             return true;
  7249.         }
  7250.         if (perm === types_1.PermissionKind.FullMask) {
  7251.             return (value.High & 32767) === 32767 && value.Low === 65535;
  7252.         }
  7253.         perm = perm - 1;
  7254.         var num = 1;
  7255.         if (perm >= 0 && perm < 32) {
  7256.             num = num << perm;
  7257.             return 0 !== (value.Low & num);
  7258.         }
  7259.         else if (perm >= 32 && perm < 64) {
  7260.             num = num << perm - 32;
  7261.             return 0 !== (value.High & num);
  7262.         }
  7263.         return false;
  7264.     };
  7265.     return QueryableSecurable;
  7266. }(queryable_1.QueryableInstance));
  7267. exports.QueryableSecurable = QueryableSecurable;
  7268.  
  7269.  
  7270. /***/ }),
  7271. /* 27 */
  7272. /***/ (function(module, exports, __webpack_require__) {
  7273.  
  7274. "use strict";
  7275.  
  7276. var __extends = (this && this.__extends) || (function () {
  7277.     var extendStatics = Object.setPrototypeOf ||
  7278.         ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  7279.         function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  7280.     return function (d, b) {
  7281.         extendStatics(d, b);
  7282.         function __() { this.constructor = d; }
  7283.         d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  7284.     };
  7285. })();
  7286. Object.defineProperty(exports, "__esModule", { value: true });
  7287. var queryable_1 = __webpack_require__(1);
  7288. var util_1 = __webpack_require__(0);
  7289. /**
  7290.  * Describes the search API
  7291.  *
  7292.  */
  7293. var Search = (function (_super) {
  7294.     __extends(Search, _super);
  7295.     /**
  7296.      * Creates a new instance of the Search class
  7297.      *
  7298.      * @param baseUrl The url for the search context
  7299.      * @param query The SearchQuery object to execute
  7300.      */
  7301.     function Search(baseUrl, path) {
  7302.         if (path === void 0) { path = "_api/search/postquery"; }
  7303.         return _super.call(this, baseUrl, path) || this;
  7304.     }
  7305.     /**
  7306.      * .......
  7307.      * @returns Promise
  7308.      */
  7309.     Search.prototype.execute = function (query) {
  7310.         var formattedBody;
  7311.         formattedBody = query;
  7312.         if (formattedBody.SelectProperties) {
  7313.             formattedBody.SelectProperties = { results: query.SelectProperties };
  7314.         }
  7315.         if (formattedBody.RefinementFilters) {
  7316.             formattedBody.RefinementFilters = { results: query.RefinementFilters };
  7317.         }
  7318.         if (formattedBody.SortList) {
  7319.             formattedBody.SortList = { results: query.SortList };
  7320.         }
  7321.         if (formattedBody.HithighlightedProperties) {
  7322.             formattedBody.HithighlightedProperties = { results: query.HithighlightedProperties };
  7323.         }
  7324.         if (formattedBody.ReorderingRules) {
  7325.             formattedBody.ReorderingRules = { results: query.ReorderingRules };
  7326.         }
  7327.         if (formattedBody.Properties) {
  7328.             formattedBody.Properties = { results: query.Properties };
  7329.         }
  7330.         var postBody = JSON.stringify({
  7331.             request: util_1.Util.extend({
  7332.                 "__metadata": { "type": "Microsoft.Office.Server.Search.REST.SearchRequest" },
  7333.             }, formattedBody),
  7334.         });
  7335.         return this.post({ body: postBody }).then(function (data) { return new SearchResults(data); });
  7336.     };
  7337.     return Search;
  7338. }(queryable_1.QueryableInstance));
  7339. exports.Search = Search;
  7340. /**
  7341.  * Describes the SearchResults class, which returns the formatted and raw version of the query response
  7342.  */
  7343. var SearchResults = (function () {
  7344.     /**
  7345.      * Creates a new instance of the SearchResult class
  7346.      *
  7347.      */
  7348.     function SearchResults(rawResponse) {
  7349.         var response = rawResponse.postquery ? rawResponse.postquery : rawResponse;
  7350.         this.PrimarySearchResults = this.formatSearchResults(response.PrimaryQueryResult.RelevantResults.Table.Rows);
  7351.         this.RawSearchResults = response;
  7352.         this.ElapsedTime = response.ElapsedTime;
  7353.         this.RowCount = response.PrimaryQueryResult.RelevantResults.RowCount;
  7354.         this.TotalRows = response.PrimaryQueryResult.RelevantResults.TotalRows;
  7355.         this.TotalRowsIncludingDuplicates = response.PrimaryQueryResult.RelevantResults.TotalRowsIncludingDuplicates;
  7356.     }
  7357.     /**
  7358.      * Formats a search results array
  7359.      *
  7360.      * @param rawResults The array to process
  7361.      */
  7362.     SearchResults.prototype.formatSearchResults = function (rawResults) {
  7363.         var results = new Array(), tempResults = rawResults.results ? rawResults.results : rawResults;
  7364.         for (var _i = 0, tempResults_1 = tempResults; _i < tempResults_1.length; _i++) {
  7365.             var i = tempResults_1[_i];
  7366.             results.push(new SearchResult(i.Cells));
  7367.         }
  7368.         return results;
  7369.     };
  7370.     return SearchResults;
  7371. }());
  7372. exports.SearchResults = SearchResults;
  7373. /**
  7374.  * Describes the SearchResult class
  7375.  */
  7376. var SearchResult = (function () {
  7377.     /**
  7378.      * Creates a new instance of the SearchResult class
  7379.      *
  7380.      */
  7381.     function SearchResult(rawItem) {
  7382.         var item = rawItem.results ? rawItem.results : rawItem;
  7383.         for (var _i = 0, item_1 = item; _i < item_1.length; _i++) {
  7384.             var i = item_1[_i];
  7385.             Object.defineProperty(this, i.Key, {
  7386.                 configurable: false,
  7387.                 enumerable: false,
  7388.                 value: i.Value,
  7389.                 writable: false,
  7390.             });
  7391.         }
  7392.     }
  7393.     return SearchResult;
  7394. }());
  7395. exports.SearchResult = SearchResult;
  7396. /**
  7397.  * defines the SortDirection enum
  7398.  */
  7399. var SortDirection;
  7400. (function (SortDirection) {
  7401.     SortDirection[SortDirection["Ascending"] = 0] = "Ascending";
  7402.     SortDirection[SortDirection["Descending"] = 1] = "Descending";
  7403.     SortDirection[SortDirection["FQLFormula"] = 2] = "FQLFormula";
  7404. })(SortDirection = exports.SortDirection || (exports.SortDirection = {}));
  7405. /**
  7406.  * defines the ReorderingRuleMatchType  enum
  7407.  */
  7408. var ReorderingRuleMatchType;
  7409. (function (ReorderingRuleMatchType) {
  7410.     ReorderingRuleMatchType[ReorderingRuleMatchType["ResultContainsKeyword"] = 0] = "ResultContainsKeyword";
  7411.     ReorderingRuleMatchType[ReorderingRuleMatchType["TitleContainsKeyword"] = 1] = "TitleContainsKeyword";
  7412.     ReorderingRuleMatchType[ReorderingRuleMatchType["TitleMatchesKeyword"] = 2] = "TitleMatchesKeyword";
  7413.     ReorderingRuleMatchType[ReorderingRuleMatchType["UrlStartsWith"] = 3] = "UrlStartsWith";
  7414.     ReorderingRuleMatchType[ReorderingRuleMatchType["UrlExactlyMatches"] = 4] = "UrlExactlyMatches";
  7415.     ReorderingRuleMatchType[ReorderingRuleMatchType["ContentTypeIs"] = 5] = "ContentTypeIs";
  7416.     ReorderingRuleMatchType[ReorderingRuleMatchType["FileExtensionMatches"] = 6] = "FileExtensionMatches";
  7417.     ReorderingRuleMatchType[ReorderingRuleMatchType["ResultHasTag"] = 7] = "ResultHasTag";
  7418.     ReorderingRuleMatchType[ReorderingRuleMatchType["ManualCondition"] = 8] = "ManualCondition";
  7419. })(ReorderingRuleMatchType = exports.ReorderingRuleMatchType || (exports.ReorderingRuleMatchType = {}));
  7420. /**
  7421.  * Specifies the type value for the property
  7422.  */
  7423. var QueryPropertyValueType;
  7424. (function (QueryPropertyValueType) {
  7425.     QueryPropertyValueType[QueryPropertyValueType["None"] = 0] = "None";
  7426.     QueryPropertyValueType[QueryPropertyValueType["StringType"] = 1] = "StringType";
  7427.     QueryPropertyValueType[QueryPropertyValueType["Int32TYpe"] = 2] = "Int32TYpe";
  7428.     QueryPropertyValueType[QueryPropertyValueType["BooleanType"] = 3] = "BooleanType";
  7429.     QueryPropertyValueType[QueryPropertyValueType["StringArrayType"] = 4] = "StringArrayType";
  7430.     QueryPropertyValueType[QueryPropertyValueType["UnSupportedType"] = 5] = "UnSupportedType";
  7431. })(QueryPropertyValueType = exports.QueryPropertyValueType || (exports.QueryPropertyValueType = {}));
  7432.  
  7433.  
  7434. /***/ }),
  7435. /* 28 */
  7436. /***/ (function(module, exports, __webpack_require__) {
  7437.  
  7438. "use strict";
  7439.  
  7440. var __extends = (this && this.__extends) || (function () {
  7441.     var extendStatics = Object.setPrototypeOf ||
  7442.         ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  7443.         function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  7444.     return function (d, b) {
  7445.         extendStatics(d, b);
  7446.         function __() { this.constructor = d; }
  7447.         d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  7448.     };
  7449. })();
  7450. Object.defineProperty(exports, "__esModule", { value: true });
  7451. var queryable_1 = __webpack_require__(1);
  7452. var SearchSuggest = (function (_super) {
  7453.     __extends(SearchSuggest, _super);
  7454.     function SearchSuggest(baseUrl, path) {
  7455.         if (path === void 0) { path = "_api/search/suggest"; }
  7456.         return _super.call(this, baseUrl, path) || this;
  7457.     }
  7458.     SearchSuggest.prototype.execute = function (query) {
  7459.         this.mapQueryToQueryString(query);
  7460.         return this.get().then(function (response) { return new SearchSuggestResult(response); });
  7461.     };
  7462.     SearchSuggest.prototype.mapQueryToQueryString = function (query) {
  7463.         this.query.add("querytext", "'" + query.querytext + "'");
  7464.         if (query.hasOwnProperty("count")) {
  7465.             this.query.add("inumberofquerysuggestions", query.count.toString());
  7466.         }
  7467.         if (query.hasOwnProperty("personalCount")) {
  7468.             this.query.add("inumberofresultsuggestions", query.personalCount.toString());
  7469.         }
  7470.         if (query.hasOwnProperty("preQuery")) {
  7471.             this.query.add("fprequerysuggestions", query.preQuery.toString());
  7472.         }
  7473.         if (query.hasOwnProperty("hitHighlighting")) {
  7474.             this.query.add("fhithighlighting", query.hitHighlighting.toString());
  7475.         }
  7476.         if (query.hasOwnProperty("capitalize")) {
  7477.             this.query.add("fcapitalizefirstletters", query.capitalize.toString());
  7478.         }
  7479.         if (query.hasOwnProperty("culture")) {
  7480.             this.query.add("culture", query.culture.toString());
  7481.         }
  7482.         if (query.hasOwnProperty("stemming")) {
  7483.             this.query.add("enablestemming", query.stemming.toString());
  7484.         }
  7485.         if (query.hasOwnProperty("includePeople")) {
  7486.             this.query.add("showpeoplenamesuggestions", query.includePeople.toString());
  7487.         }
  7488.         if (query.hasOwnProperty("queryRules")) {
  7489.             this.query.add("enablequeryrules", query.queryRules.toString());
  7490.         }
  7491.         if (query.hasOwnProperty("prefixMatch")) {
  7492.             this.query.add("fprefixmatchallterms", query.prefixMatch.toString());
  7493.         }
  7494.     };
  7495.     return SearchSuggest;
  7496. }(queryable_1.QueryableInstance));
  7497. exports.SearchSuggest = SearchSuggest;
  7498. var SearchSuggestResult = (function () {
  7499.     function SearchSuggestResult(json) {
  7500.         if (json.hasOwnProperty("suggest")) {
  7501.             // verbose
  7502.             this.PeopleNames = json.suggest.PeopleNames.results;
  7503.             this.PersonalResults = json.suggest.PersonalResults.results;
  7504.             this.Queries = json.suggest.Queries.results;
  7505.         }
  7506.         else {
  7507.             this.PeopleNames = json.PeopleNames;
  7508.             this.PersonalResults = json.PersonalResults;
  7509.             this.Queries = json.Queries;
  7510.         }
  7511.     }
  7512.     return SearchSuggestResult;
  7513. }());
  7514. exports.SearchSuggestResult = SearchSuggestResult;
  7515.  
  7516.  
  7517. /***/ }),
  7518. /* 29 */
  7519. /***/ (function(module, exports, __webpack_require__) {
  7520.  
  7521. "use strict";
  7522.  
  7523. var __extends = (this && this.__extends) || (function () {
  7524.     var extendStatics = Object.setPrototypeOf ||
  7525.         ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  7526.         function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  7527.     return function (d, b) {
  7528.         extendStatics(d, b);
  7529.         function __() { this.constructor = d; }
  7530.         d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  7531.     };
  7532. })();
  7533. Object.defineProperty(exports, "__esModule", { value: true });
  7534. var queryable_1 = __webpack_require__(1);
  7535. var webs_1 = __webpack_require__(7);
  7536. var usercustomactions_1 = __webpack_require__(19);
  7537. var odata_1 = __webpack_require__(2);
  7538. var features_1 = __webpack_require__(23);
  7539. /**
  7540.  * Describes a site collection
  7541.  *
  7542.  */
  7543. var Site = (function (_super) {
  7544.     __extends(Site, _super);
  7545.     /**
  7546.      * Creates a new instance of the RoleAssignments class
  7547.      *
  7548.      * @param baseUrl The url or Queryable which forms the parent of this fields collection
  7549.      */
  7550.     function Site(baseUrl, path) {
  7551.         if (path === void 0) { path = "_api/site"; }
  7552.         return _super.call(this, baseUrl, path) || this;
  7553.     }
  7554.     Object.defineProperty(Site.prototype, "rootWeb", {
  7555.         /**
  7556.          * Gets the root web of the site collection
  7557.          *
  7558.          */
  7559.         get: function () {
  7560.             return new webs_1.Web(this, "rootweb");
  7561.         },
  7562.         enumerable: true,
  7563.         configurable: true
  7564.     });
  7565.     Object.defineProperty(Site.prototype, "features", {
  7566.         /**
  7567.          * Gets the active features for this site
  7568.          *
  7569.          */
  7570.         get: function () {
  7571.             return new features_1.Features(this);
  7572.         },
  7573.         enumerable: true,
  7574.         configurable: true
  7575.     });
  7576.     Object.defineProperty(Site.prototype, "userCustomActions", {
  7577.         /**
  7578.          * Get all custom actions on a site collection
  7579.          *
  7580.          */
  7581.         get: function () {
  7582.             return new usercustomactions_1.UserCustomActions(this);
  7583.         },
  7584.         enumerable: true,
  7585.         configurable: true
  7586.     });
  7587.     /**
  7588.      * Gets the context information for the site.
  7589.      */
  7590.     Site.prototype.getContextInfo = function () {
  7591.         var q = new Site(this.parentUrl, "_api/contextinfo");
  7592.         return q.post().then(function (data) {
  7593.             if (data.hasOwnProperty("GetContextWebInformation")) {
  7594.                 var info = data.GetContextWebInformation;
  7595.                 info.SupportedSchemaVersions = info.SupportedSchemaVersions.results;
  7596.                 return info;
  7597.             }
  7598.             else {
  7599.                 return data;
  7600.             }
  7601.         });
  7602.     };
  7603.     /**
  7604.      * Gets the document libraries on a site. Static method. (SharePoint Online only)
  7605.      *
  7606.      * @param absoluteWebUrl The absolute url of the web whose document libraries should be returned
  7607.      */
  7608.     Site.prototype.getDocumentLibraries = function (absoluteWebUrl) {
  7609.         var q = new queryable_1.Queryable("", "_api/sp.web.getdocumentlibraries(@v)");
  7610.         q.query.add("@v", "'" + absoluteWebUrl + "'");
  7611.         return q.get().then(function (data) {
  7612.             if (data.hasOwnProperty("GetDocumentLibraries")) {
  7613.                 return data.GetDocumentLibraries;
  7614.             }
  7615.             else {
  7616.                 return data;
  7617.             }
  7618.         });
  7619.     };
  7620.     /**
  7621.      * Gets the site URL from a page URL.
  7622.      *
  7623.      * @param absolutePageUrl The absolute url of the page
  7624.      */
  7625.     Site.prototype.getWebUrlFromPageUrl = function (absolutePageUrl) {
  7626.         var q = new queryable_1.Queryable("", "_api/sp.web.getweburlfrompageurl(@v)");
  7627.         q.query.add("@v", "'" + absolutePageUrl + "'");
  7628.         return q.get().then(function (data) {
  7629.             if (data.hasOwnProperty("GetWebUrlFromPageUrl")) {
  7630.                 return data.GetWebUrlFromPageUrl;
  7631.             }
  7632.             else {
  7633.                 return data;
  7634.             }
  7635.         });
  7636.     };
  7637.     /**
  7638.      * Creates a new batch for requests within the context of context this site
  7639.      *
  7640.      */
  7641.     Site.prototype.createBatch = function () {
  7642.         return new odata_1.ODataBatch(this.parentUrl);
  7643.     };
  7644.     return Site;
  7645. }(queryable_1.QueryableInstance));
  7646. exports.Site = Site;
  7647.  
  7648.  
  7649. /***/ }),
  7650. /* 30 */
  7651. /***/ (function(module, exports, __webpack_require__) {
  7652.  
  7653. "use strict";
  7654.  
  7655. var __extends = (this && this.__extends) || (function () {
  7656.     var extendStatics = Object.setPrototypeOf ||
  7657.         ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  7658.         function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  7659.     return function (d, b) {
  7660.         extendStatics(d, b);
  7661.         function __() { this.constructor = d; }
  7662.         d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  7663.     };
  7664. })();
  7665. Object.defineProperty(exports, "__esModule", { value: true });
  7666. var queryable_1 = __webpack_require__(1);
  7667. var sitegroups_1 = __webpack_require__(18);
  7668. var util_1 = __webpack_require__(0);
  7669. /**
  7670.  * Describes a collection of all site collection users
  7671.  *
  7672.  */
  7673. var SiteUsers = (function (_super) {
  7674.     __extends(SiteUsers, _super);
  7675.     /**
  7676.      * Creates a new instance of the Users class
  7677.      *
  7678.      * @param baseUrl The url or Queryable which forms the parent of this user collection
  7679.      */
  7680.     function SiteUsers(baseUrl, path) {
  7681.         if (path === void 0) { path = "siteusers"; }
  7682.         return _super.call(this, baseUrl, path) || this;
  7683.     }
  7684.     /**
  7685.      * Gets a user from the collection by email
  7686.      *
  7687.      * @param email The email of the user
  7688.      */
  7689.     SiteUsers.prototype.getByEmail = function (email) {
  7690.         return new SiteUser(this, "getByEmail('" + email + "')");
  7691.     };
  7692.     /**
  7693.      * Gets a user from the collection by id
  7694.      *
  7695.      * @param id The id of the user
  7696.      */
  7697.     SiteUsers.prototype.getById = function (id) {
  7698.         return new SiteUser(this, "getById(" + id + ")");
  7699.     };
  7700.     /**
  7701.      * Gets a user from the collection by login name
  7702.      *
  7703.      * @param loginName The email address of the user
  7704.      */
  7705.     SiteUsers.prototype.getByLoginName = function (loginName) {
  7706.         var su = new SiteUser(this);
  7707.         su.concat("(@v)");
  7708.         su.query.add("@v", "'" + encodeURIComponent(loginName) + "'");
  7709.         return su;
  7710.     };
  7711.     /**
  7712.      * Removes a user from the collection by id
  7713.      *
  7714.      * @param id The id of the user
  7715.      */
  7716.     SiteUsers.prototype.removeById = function (id) {
  7717.         return this.clone(SiteUsers, "removeById(" + id + ")", true).post();
  7718.     };
  7719.     /**
  7720.      * Removes a user from the collection by login name
  7721.      *
  7722.      * @param loginName The login name of the user
  7723.      */
  7724.     SiteUsers.prototype.removeByLoginName = function (loginName) {
  7725.         var o = this.clone(SiteUsers, "removeByLoginName(@v)", true);
  7726.         o.query.add("@v", "'" + encodeURIComponent(loginName) + "'");
  7727.         return o.post();
  7728.     };
  7729.     /**
  7730.      * Add a user to a group
  7731.      *
  7732.      * @param loginName The login name of the user to add to the group
  7733.      *
  7734.      */
  7735.     SiteUsers.prototype.add = function (loginName) {
  7736.         var _this = this;
  7737.         return this.clone(SiteUsers, null, true).post({
  7738.             body: JSON.stringify({ "__metadata": { "type": "SP.User" }, LoginName: loginName }),
  7739.         }).then(function () { return _this.getByLoginName(loginName); });
  7740.     };
  7741.     return SiteUsers;
  7742. }(queryable_1.QueryableCollection));
  7743. exports.SiteUsers = SiteUsers;
  7744. /**
  7745.  * Describes a single user
  7746.  *
  7747.  */
  7748. var SiteUser = (function (_super) {
  7749.     __extends(SiteUser, _super);
  7750.     function SiteUser() {
  7751.         return _super !== null && _super.apply(this, arguments) || this;
  7752.     }
  7753.     Object.defineProperty(SiteUser.prototype, "groups", {
  7754.         /**
  7755.          * Get's the groups for this user.
  7756.          *
  7757.          */
  7758.         get: function () {
  7759.             return new sitegroups_1.SiteGroups(this, "groups");
  7760.         },
  7761.         enumerable: true,
  7762.         configurable: true
  7763.     });
  7764.     /**
  7765.     * Updates this user instance with the supplied properties
  7766.     *
  7767.     * @param properties A plain object of property names and values to update for the user
  7768.     */
  7769.     SiteUser.prototype.update = function (properties) {
  7770.         var _this = this;
  7771.         var postBody = util_1.Util.extend({ "__metadata": { "type": "SP.User" } }, properties);
  7772.         return this.post({
  7773.             body: JSON.stringify(postBody),
  7774.             headers: {
  7775.                 "X-HTTP-Method": "MERGE",
  7776.             },
  7777.         }).then(function (data) {
  7778.             return {
  7779.                 data: data,
  7780.                 user: _this,
  7781.             };
  7782.         });
  7783.     };
  7784.     /**
  7785.      * Delete this user
  7786.      *
  7787.      */
  7788.     SiteUser.prototype.delete = function () {
  7789.         return this.post({
  7790.             headers: {
  7791.                 "X-HTTP-Method": "DELETE",
  7792.             },
  7793.         });
  7794.     };
  7795.     return SiteUser;
  7796. }(queryable_1.QueryableInstance));
  7797. exports.SiteUser = SiteUser;
  7798. /**
  7799.  * Represents the current user
  7800.  */
  7801. var CurrentUser = (function (_super) {
  7802.     __extends(CurrentUser, _super);
  7803.     function CurrentUser(baseUrl, path) {
  7804.         if (path === void 0) { path = "currentuser"; }
  7805.         return _super.call(this, baseUrl, path) || this;
  7806.     }
  7807.     return CurrentUser;
  7808. }(queryable_1.QueryableInstance));
  7809. exports.CurrentUser = CurrentUser;
  7810.  
  7811.  
  7812. /***/ }),
  7813. /* 31 */
  7814. /***/ (function(module, exports, __webpack_require__) {
  7815.  
  7816. "use strict";
  7817.  
  7818. Object.defineProperty(exports, "__esModule", { value: true });
  7819. var logging_1 = __webpack_require__(5);
  7820. function deprecated(message) {
  7821.     return function (target, propertyKey, descriptor) {
  7822.         var method = descriptor.value;
  7823.         descriptor.value = function () {
  7824.             var args = [];
  7825.             for (var _i = 0; _i < arguments.length; _i++) {
  7826.                 args[_i] = arguments[_i];
  7827.             }
  7828.             logging_1.Logger.log({
  7829.                 data: {
  7830.                     descriptor: descriptor,
  7831.                     propertyKey: propertyKey,
  7832.                     target: target,
  7833.                 },
  7834.                 level: logging_1.LogLevel.Warning,
  7835.                 message: message,
  7836.             });
  7837.             return method.apply(this, args);
  7838.         };
  7839.     };
  7840. }
  7841. exports.deprecated = deprecated;
  7842.  
  7843.  
  7844. /***/ }),
  7845. /* 32 */
  7846. /***/ (function(module, exports) {
  7847.  
  7848. var g;
  7849.  
  7850. // This works in non-strict mode
  7851. g = (function() {
  7852.     return this;
  7853. })();
  7854.  
  7855. try {
  7856.     // This works if eval is allowed (see CSP)
  7857.     g = g || Function("return this")() || (1,eval)("this");
  7858. } catch(e) {
  7859.     // This works if the window reference is available
  7860.     if(typeof window === "object")
  7861.         g = window;
  7862. }
  7863.  
  7864. // g can still be undefined, but nothing to do about it...
  7865. // We return undefined, instead of nothing here, so it's
  7866. // easier to handle this case. if(!global) { ...}
  7867.  
  7868. module.exports = g;
  7869.  
  7870.  
  7871. /***/ }),
  7872. /* 33 */
  7873. /***/ (function(module, exports, __webpack_require__) {
  7874.  
  7875. "use strict";
  7876.  
  7877. Object.defineProperty(exports, "__esModule", { value: true });
  7878. var collections_1 = __webpack_require__(6);
  7879. /**
  7880.  * Class used to manage the current application settings
  7881.  *
  7882.  */
  7883. var Settings = (function () {
  7884.     /**
  7885.      * Creates a new instance of the settings class
  7886.      *
  7887.      * @constructor
  7888.      */
  7889.     function Settings() {
  7890.         this._settings = new collections_1.Dictionary();
  7891.     }
  7892.     /**
  7893.      * Adds a new single setting, or overwrites a previous setting with the same key
  7894.      *
  7895.      * @param {string} key The key used to store this setting
  7896.      * @param {string} value The setting value to store
  7897.      */
  7898.     Settings.prototype.add = function (key, value) {
  7899.         this._settings.add(key, value);
  7900.     };
  7901.     /**
  7902.      * Adds a JSON value to the collection as a string, you must use getJSON to rehydrate the object when read
  7903.      *
  7904.      * @param {string} key The key used to store this setting
  7905.      * @param {any} value The setting value to store
  7906.      */
  7907.     Settings.prototype.addJSON = function (key, value) {
  7908.         this._settings.add(key, JSON.stringify(value));
  7909.     };
  7910.     /**
  7911.      * Applies the supplied hash to the setting collection overwriting any existing value, or created new values
  7912.      *
  7913.      * @param {TypedHash<any>} hash The set of values to add
  7914.      */
  7915.     Settings.prototype.apply = function (hash) {
  7916.         var _this = this;
  7917.         return new Promise(function (resolve, reject) {
  7918.             try {
  7919.                 _this._settings.merge(hash);
  7920.                 resolve();
  7921.             }
  7922.             catch (e) {
  7923.                 reject(e);
  7924.             }
  7925.         });
  7926.     };
  7927.     /**
  7928.      * Loads configuration settings into the collection from the supplied provider and returns a Promise
  7929.      *
  7930.      * @param {IConfigurationProvider} provider The provider from which we will load the settings
  7931.      */
  7932.     Settings.prototype.load = function (provider) {
  7933.         var _this = this;
  7934.         return new Promise(function (resolve, reject) {
  7935.             provider.getConfiguration().then(function (value) {
  7936.                 _this._settings.merge(value);
  7937.                 resolve();
  7938.             }).catch(function (reason) {
  7939.                 reject(reason);
  7940.             });
  7941.         });
  7942.     };
  7943.     /**
  7944.      * Gets a value from the configuration
  7945.      *
  7946.      * @param {string} key The key whose value we want to return. Returns null if the key does not exist
  7947.      * @return {string} string value from the configuration
  7948.      */
  7949.     Settings.prototype.get = function (key) {
  7950.         return this._settings.get(key);
  7951.     };
  7952.     /**
  7953.      * Gets a JSON value, rehydrating the stored string to the original object
  7954.      *
  7955.      * @param {string} key The key whose value we want to return. Returns null if the key does not exist
  7956.      * @return {any} object from the configuration
  7957.      */
  7958.     Settings.prototype.getJSON = function (key) {
  7959.         var o = this.get(key);
  7960.         if (typeof o === "undefined" || o === null) {
  7961.             return o;
  7962.         }
  7963.         return JSON.parse(o);
  7964.     };
  7965.     return Settings;
  7966. }());
  7967. exports.Settings = Settings;
  7968.  
  7969.  
  7970. /***/ }),
  7971. /* 34 */
  7972. /***/ (function(module, exports, __webpack_require__) {
  7973.  
  7974. "use strict";
  7975.  
  7976. Object.defineProperty(exports, "__esModule", { value: true });
  7977. var search_1 = __webpack_require__(27);
  7978. var searchsuggest_1 = __webpack_require__(28);
  7979. var site_1 = __webpack_require__(29);
  7980. var webs_1 = __webpack_require__(7);
  7981. var util_1 = __webpack_require__(0);
  7982. var userprofiles_1 = __webpack_require__(48);
  7983. var exceptions_1 = __webpack_require__(3);
  7984. /**
  7985.  * Root of the SharePoint REST module
  7986.  */
  7987. var Rest = (function () {
  7988.     function Rest() {
  7989.     }
  7990.     /**
  7991.      * Executes a search against this web context
  7992.      *
  7993.      * @param query The SearchQuery definition
  7994.      */
  7995.     Rest.prototype.searchSuggest = function (query) {
  7996.         var finalQuery;
  7997.         if (typeof query === "string") {
  7998.             finalQuery = { querytext: query };
  7999.         }
  8000.         else {
  8001.             finalQuery = query;
  8002.         }
  8003.         return new searchsuggest_1.SearchSuggest("").execute(finalQuery);
  8004.     };
  8005.     /**
  8006.      * Executes a search against this web context
  8007.      *
  8008.      * @param query The SearchQuery definition
  8009.      */
  8010.     Rest.prototype.search = function (query) {
  8011.         var finalQuery;
  8012.         if (typeof query === "string") {
  8013.             finalQuery = { Querytext: query };
  8014.         }
  8015.         else {
  8016.             finalQuery = query;
  8017.         }
  8018.         return new search_1.Search("").execute(finalQuery);
  8019.     };
  8020.     Object.defineProperty(Rest.prototype, "site", {
  8021.         /**
  8022.          * Begins a site collection scoped REST request
  8023.          *
  8024.          */
  8025.         get: function () {
  8026.             return new site_1.Site("");
  8027.         },
  8028.         enumerable: true,
  8029.         configurable: true
  8030.     });
  8031.     Object.defineProperty(Rest.prototype, "web", {
  8032.         /**
  8033.          * Begins a web scoped REST request
  8034.          *
  8035.          */
  8036.         get: function () {
  8037.             return new webs_1.Web("");
  8038.         },
  8039.         enumerable: true,
  8040.         configurable: true
  8041.     });
  8042.     Object.defineProperty(Rest.prototype, "profiles", {
  8043.         /**
  8044.          * Access to user profile methods
  8045.          *
  8046.          */
  8047.         get: function () {
  8048.             return new userprofiles_1.UserProfileQuery("");
  8049.         },
  8050.         enumerable: true,
  8051.         configurable: true
  8052.     });
  8053.     /**
  8054.      * Creates a new batch object for use with the Queryable.addToBatch method
  8055.      *
  8056.      */
  8057.     Rest.prototype.createBatch = function () {
  8058.         return this.web.createBatch();
  8059.     };
  8060.     /**
  8061.      * Begins a cross-domain, host site scoped REST request, for use in add-in webs
  8062.      *
  8063.      * @param addInWebUrl The absolute url of the add-in web
  8064.      * @param hostWebUrl The absolute url of the host web
  8065.      */
  8066.     Rest.prototype.crossDomainSite = function (addInWebUrl, hostWebUrl) {
  8067.         return this._cdImpl(site_1.Site, addInWebUrl, hostWebUrl, "site");
  8068.     };
  8069.     /**
  8070.      * Begins a cross-domain, host web scoped REST request, for use in add-in webs
  8071.      *
  8072.      * @param addInWebUrl The absolute url of the add-in web
  8073.      * @param hostWebUrl The absolute url of the host web
  8074.      */
  8075.     Rest.prototype.crossDomainWeb = function (addInWebUrl, hostWebUrl) {
  8076.         return this._cdImpl(webs_1.Web, addInWebUrl, hostWebUrl, "web");
  8077.     };
  8078.     /**
  8079.      * Implements the creation of cross domain REST urls
  8080.      *
  8081.      * @param factory The constructor of the object to create Site | Web
  8082.      * @param addInWebUrl The absolute url of the add-in web
  8083.      * @param hostWebUrl The absolute url of the host web
  8084.      * @param urlPart String part to append to the url "site" | "web"
  8085.      */
  8086.     Rest.prototype._cdImpl = function (factory, addInWebUrl, hostWebUrl, urlPart) {
  8087.         if (!util_1.Util.isUrlAbsolute(addInWebUrl)) {
  8088.             throw new exceptions_1.UrlException("The addInWebUrl parameter must be an absolute url.");
  8089.         }
  8090.         if (!util_1.Util.isUrlAbsolute(hostWebUrl)) {
  8091.             throw new exceptions_1.UrlException("The hostWebUrl parameter must be an absolute url.");
  8092.         }
  8093.         var url = util_1.Util.combinePaths(addInWebUrl, "_api/SP.AppContextSite(@target)");
  8094.         var instance = new factory(url, urlPart);
  8095.         instance.query.add("@target", "'" + encodeURIComponent(hostWebUrl) + "'");
  8096.         return instance;
  8097.     };
  8098.     return Rest;
  8099. }());
  8100. exports.Rest = Rest;
  8101.  
  8102.  
  8103. /***/ }),
  8104. /* 35 */
  8105. /***/ (function(module, exports, __webpack_require__) {
  8106.  
  8107. "use strict";
  8108.  
  8109. function __export(m) {
  8110.     for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  8111. }
  8112. Object.defineProperty(exports, "__esModule", { value: true });
  8113. __export(__webpack_require__(44));
  8114. var httpclient_1 = __webpack_require__(15);
  8115. exports.HttpClient = httpclient_1.HttpClient;
  8116. var sprequestexecutorclient_1 = __webpack_require__(40);
  8117. exports.SPRequestExecutorClient = sprequestexecutorclient_1.SPRequestExecutorClient;
  8118. var nodefetchclient_1 = __webpack_require__(39);
  8119. exports.NodeFetchClient = nodefetchclient_1.NodeFetchClient;
  8120. var fetchclient_1 = __webpack_require__(21);
  8121. exports.FetchClient = fetchclient_1.FetchClient;
  8122. __export(__webpack_require__(36));
  8123. var collections_1 = __webpack_require__(6);
  8124. exports.Dictionary = collections_1.Dictionary;
  8125. var util_1 = __webpack_require__(0);
  8126. exports.Util = util_1.Util;
  8127. __export(__webpack_require__(5));
  8128. __export(__webpack_require__(3));
  8129.  
  8130.  
  8131. /***/ }),
  8132. /* 36 */
  8133. /***/ (function(module, exports, __webpack_require__) {
  8134.  
  8135. "use strict";
  8136.  
  8137. Object.defineProperty(exports, "__esModule", { value: true });
  8138. var cachingConfigurationProvider_1 = __webpack_require__(20);
  8139. exports.CachingConfigurationProvider = cachingConfigurationProvider_1.default;
  8140. var spListConfigurationProvider_1 = __webpack_require__(37);
  8141. exports.SPListConfigurationProvider = spListConfigurationProvider_1.default;
  8142.  
  8143.  
  8144. /***/ }),
  8145. /* 37 */
  8146. /***/ (function(module, exports, __webpack_require__) {
  8147.  
  8148. "use strict";
  8149.  
  8150. Object.defineProperty(exports, "__esModule", { value: true });
  8151. var cachingConfigurationProvider_1 = __webpack_require__(20);
  8152. /**
  8153.  * A configuration provider which loads configuration values from a SharePoint list
  8154.  *
  8155.  */
  8156. var SPListConfigurationProvider = (function () {
  8157.     /**
  8158.      * Creates a new SharePoint list based configuration provider
  8159.      * @constructor
  8160.      * @param {string} webUrl Url of the SharePoint site, where the configuration list is located
  8161.      * @param {string} listTitle Title of the SharePoint list, which contains the configuration settings (optional, default = "config")
  8162.      */
  8163.     function SPListConfigurationProvider(sourceWeb, sourceListTitle) {
  8164.         if (sourceListTitle === void 0) { sourceListTitle = "config"; }
  8165.         this.sourceWeb = sourceWeb;
  8166.         this.sourceListTitle = sourceListTitle;
  8167.     }
  8168.     Object.defineProperty(SPListConfigurationProvider.prototype, "web", {
  8169.         /**
  8170.          * Gets the url of the SharePoint site, where the configuration list is located
  8171.          *
  8172.          * @return {string} Url address of the site
  8173.          */
  8174.         get: function () {
  8175.             return this.sourceWeb;
  8176.         },
  8177.         enumerable: true,
  8178.         configurable: true
  8179.     });
  8180.     Object.defineProperty(SPListConfigurationProvider.prototype, "listTitle", {
  8181.         /**
  8182.          * Gets the title of the SharePoint list, which contains the configuration settings
  8183.          *
  8184.          * @return {string} List title
  8185.          */
  8186.         get: function () {
  8187.             return this.sourceListTitle;
  8188.         },
  8189.         enumerable: true,
  8190.         configurable: true
  8191.     });
  8192.     /**
  8193.      * Loads the configuration values from the SharePoint list
  8194.      *
  8195.      * @return {Promise<TypedHash<string>>} Promise of loaded configuration values
  8196.      */
  8197.     SPListConfigurationProvider.prototype.getConfiguration = function () {
  8198.         return this.web.lists.getByTitle(this.listTitle).items.select("Title", "Value")
  8199.             .getAs().then(function (data) {
  8200.             return data.reduce(function (configuration, item) {
  8201.                 return Object.defineProperty(configuration, item.Title, {
  8202.                     configurable: false,
  8203.                     enumerable: false,
  8204.                     value: item.Value,
  8205.                     writable: false,
  8206.                 });
  8207.             }, {});
  8208.         });
  8209.     };
  8210.     /**
  8211.      * Wraps the current provider in a cache enabled provider
  8212.      *
  8213.      * @return {CachingConfigurationProvider} Caching providers which wraps the current provider
  8214.      */
  8215.     SPListConfigurationProvider.prototype.asCaching = function () {
  8216.         var cacheKey = "splist_" + this.web.toUrl() + "+" + this.listTitle;
  8217.         return new cachingConfigurationProvider_1.default(this, cacheKey);
  8218.     };
  8219.     return SPListConfigurationProvider;
  8220. }());
  8221. exports.default = SPListConfigurationProvider;
  8222.  
  8223.  
  8224. /***/ }),
  8225. /* 38 */
  8226. /***/ (function(module, exports, __webpack_require__) {
  8227.  
  8228. "use strict";
  8229.  
  8230. Object.defineProperty(exports, "__esModule", { value: true });
  8231. var collections_1 = __webpack_require__(6);
  8232. var util_1 = __webpack_require__(0);
  8233. var odata_1 = __webpack_require__(2);
  8234. var CachedDigest = (function () {
  8235.     function CachedDigest() {
  8236.     }
  8237.     return CachedDigest;
  8238. }());
  8239. exports.CachedDigest = CachedDigest;
  8240. // allows for the caching of digests across all HttpClient's which each have their own DigestCache wrapper.
  8241. var digests = new collections_1.Dictionary();
  8242. var DigestCache = (function () {
  8243.     function DigestCache(_httpClient, _digests) {
  8244.         if (_digests === void 0) { _digests = digests; }
  8245.         this._httpClient = _httpClient;
  8246.         this._digests = _digests;
  8247.     }
  8248.     DigestCache.prototype.getDigest = function (webUrl) {
  8249.         var _this = this;
  8250.         var cachedDigest = this._digests.get(webUrl);
  8251.         if (cachedDigest !== null) {
  8252.             var now = new Date();
  8253.             if (now < cachedDigest.expiration) {
  8254.                 return Promise.resolve(cachedDigest.value);
  8255.             }
  8256.         }
  8257.         var url = util_1.Util.combinePaths(webUrl, "/_api/contextinfo");
  8258.         return this._httpClient.fetchRaw(url, {
  8259.             cache: "no-cache",
  8260.             credentials: "same-origin",
  8261.             headers: {
  8262.                 "Accept": "application/json;odata=verbose",
  8263.                 "Content-type": "application/json;odata=verbose;charset=utf-8",
  8264.             },
  8265.             method: "POST",
  8266.         }).then(function (response) {
  8267.             var parser = new odata_1.ODataDefaultParser();
  8268.             return parser.parse(response).then(function (d) { return d.GetContextWebInformation; });
  8269.         }).then(function (data) {
  8270.             var newCachedDigest = new CachedDigest();
  8271.             newCachedDigest.value = data.FormDigestValue;
  8272.             var seconds = data.FormDigestTimeoutSeconds;
  8273.             var expiration = new Date();
  8274.             expiration.setTime(expiration.getTime() + 1000 * seconds);
  8275.             newCachedDigest.expiration = expiration;
  8276.             _this._digests.add(webUrl, newCachedDigest);
  8277.             return newCachedDigest.value;
  8278.         });
  8279.     };
  8280.     DigestCache.prototype.clear = function () {
  8281.         this._digests.clear();
  8282.     };
  8283.     return DigestCache;
  8284. }());
  8285. exports.DigestCache = DigestCache;
  8286.  
  8287.  
  8288. /***/ }),
  8289. /* 39 */
  8290. /***/ (function(module, exports, __webpack_require__) {
  8291.  
  8292. "use strict";
  8293.  
  8294. Object.defineProperty(exports, "__esModule", { value: true });
  8295. var exceptions_1 = __webpack_require__(3);
  8296. /**
  8297.  * This module is substituted for the NodeFetchClient.ts during the packaging process. This helps to reduce the pnp.js file size by
  8298.  * not including all of the node dependencies
  8299.  */
  8300. var NodeFetchClient = (function () {
  8301.     function NodeFetchClient() {
  8302.     }
  8303.     /**
  8304.      * Always throws an error that NodeFetchClient is not supported for use in the browser
  8305.      */
  8306.     NodeFetchClient.prototype.fetch = function () {
  8307.         throw new exceptions_1.NodeFetchClientUnsupportedException();
  8308.     };
  8309.     return NodeFetchClient;
  8310. }());
  8311. exports.NodeFetchClient = NodeFetchClient;
  8312.  
  8313.  
  8314. /***/ }),
  8315. /* 40 */
  8316. /***/ (function(module, exports, __webpack_require__) {
  8317.  
  8318. "use strict";
  8319.  
  8320. Object.defineProperty(exports, "__esModule", { value: true });
  8321. var util_1 = __webpack_require__(0);
  8322. var exceptions_1 = __webpack_require__(3);
  8323. /**
  8324.  * Makes requests using the SP.RequestExecutor library.
  8325.  */
  8326. var SPRequestExecutorClient = (function () {
  8327.     function SPRequestExecutorClient() {
  8328.         /**
  8329.          * Converts a SharePoint REST API response to a fetch API response.
  8330.          */
  8331.         this.convertToResponse = function (spResponse) {
  8332.             var responseHeaders = new Headers();
  8333.             for (var h in spResponse.headers) {
  8334.                 if (spResponse.headers[h]) {
  8335.                     responseHeaders.append(h, spResponse.headers[h]);
  8336.                 }
  8337.             }
  8338.             // issue #256, Cannot have an empty string body when creating a Response with status 204
  8339.             var body = spResponse.statusCode === 204 ? null : spResponse.body;
  8340.             return new Response(body, {
  8341.                 headers: responseHeaders,
  8342.                 status: spResponse.statusCode,
  8343.                 statusText: spResponse.statusText,
  8344.             });
  8345.         };
  8346.     }
  8347.     /**
  8348.      * Fetches a URL using the SP.RequestExecutor library.
  8349.      */
  8350.     SPRequestExecutorClient.prototype.fetch = function (url, options) {
  8351.         var _this = this;
  8352.         if (typeof SP === "undefined" || typeof SP.RequestExecutor === "undefined") {
  8353.             throw new exceptions_1.SPRequestExecutorUndefinedException();
  8354.         }
  8355.         var addinWebUrl = url.substring(0, url.indexOf("/_api")), executor = new SP.RequestExecutor(addinWebUrl);
  8356.         var headers = {}, iterator, temp;
  8357.         if (options.headers && options.headers instanceof Headers) {
  8358.             iterator = options.headers.entries();
  8359.             temp = iterator.next();
  8360.             while (!temp.done) {
  8361.                 headers[temp.value[0]] = temp.value[1];
  8362.                 temp = iterator.next();
  8363.             }
  8364.         }
  8365.         else {
  8366.             headers = options.headers;
  8367.         }
  8368.         return new Promise(function (resolve, reject) {
  8369.             var requestOptions = {
  8370.                 error: function (error) {
  8371.                     reject(_this.convertToResponse(error));
  8372.                 },
  8373.                 headers: headers,
  8374.                 method: options.method,
  8375.                 success: function (response) {
  8376.                     resolve(_this.convertToResponse(response));
  8377.                 },
  8378.                 url: url,
  8379.             };
  8380.             if (options.body) {
  8381.                 requestOptions = util_1.Util.extend(requestOptions, { body: options.body });
  8382.             }
  8383.             else {
  8384.                 requestOptions = util_1.Util.extend(requestOptions, { binaryStringRequestBody: true });
  8385.             }
  8386.             executor.executeAsync(requestOptions);
  8387.         });
  8388.     };
  8389.     return SPRequestExecutorClient;
  8390. }());
  8391. exports.SPRequestExecutorClient = SPRequestExecutorClient;
  8392.  
  8393.  
  8394. /***/ }),
  8395. /* 41 */
  8396. /***/ (function(module, exports, __webpack_require__) {
  8397.  
  8398. "use strict";
  8399.  
  8400. function __export(m) {
  8401.     for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  8402. }
  8403. Object.defineProperty(exports, "__esModule", { value: true });
  8404. var util_1 = __webpack_require__(0);
  8405. var storage_1 = __webpack_require__(14);
  8406. var configuration_1 = __webpack_require__(33);
  8407. var logging_1 = __webpack_require__(5);
  8408. var rest_1 = __webpack_require__(34);
  8409. var pnplibconfig_1 = __webpack_require__(4);
  8410. /**
  8411.  * Root class of the Patterns and Practices namespace, provides an entry point to the library
  8412.  */
  8413. /**
  8414.  * Utility methods
  8415.  */
  8416. exports.util = util_1.Util;
  8417. /**
  8418.  * Provides access to the REST interface
  8419.  */
  8420. exports.sp = new rest_1.Rest();
  8421. /**
  8422.  * Provides access to local and session storage
  8423.  */
  8424. exports.storage = new storage_1.PnPClientStorage();
  8425. /**
  8426.  * Global configuration instance to which providers can be added
  8427.  */
  8428. exports.config = new configuration_1.Settings();
  8429. /**
  8430.  * Global logging instance to which subscribers can be registered and messages written
  8431.  */
  8432. exports.log = logging_1.Logger;
  8433. /**
  8434.  * Allows for the configuration of the library
  8435.  */
  8436. exports.setup = pnplibconfig_1.setRuntimeConfig;
  8437. /**
  8438.  * Expose a subset of classes from the library for public consumption
  8439.  */
  8440. __export(__webpack_require__(35));
  8441. // creating this class instead of directly assigning to default fixes issue #116
  8442. var Def = {
  8443.     /**
  8444.      * Global configuration instance to which providers can be added
  8445.      */
  8446.     config: exports.config,
  8447.     /**
  8448.      * Global logging instance to which subscribers can be registered and messages written
  8449.      */
  8450.     log: exports.log,
  8451.     /**
  8452.      * Provides access to local and session storage
  8453.      */
  8454.     setup: exports.setup,
  8455.     /**
  8456.      * Provides access to the REST interface
  8457.      */
  8458.     sp: exports.sp,
  8459.     /**
  8460.      * Provides access to local and session storage
  8461.      */
  8462.     storage: exports.storage,
  8463.     /**
  8464.      * Utility methods
  8465.      */
  8466.     util: exports.util,
  8467. };
  8468. /**
  8469.  * Enables use of the import pnp from syntax
  8470.  */
  8471. exports.default = Def;
  8472.  
  8473.  
  8474. /***/ }),
  8475. /* 42 */
  8476. /***/ (function(module, exports, __webpack_require__) {
  8477.  
  8478. "use strict";
  8479.  
  8480. var __extends = (this && this.__extends) || (function () {
  8481.     var extendStatics = Object.setPrototypeOf ||
  8482.         ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  8483.         function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  8484.     return function (d, b) {
  8485.         extendStatics(d, b);
  8486.         function __() { this.constructor = d; }
  8487.         d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  8488.     };
  8489. })();
  8490. Object.defineProperty(exports, "__esModule", { value: true });
  8491. var queryable_1 = __webpack_require__(1);
  8492. var odata_1 = __webpack_require__(2);
  8493. /**
  8494.  * Describes a collection of Item objects
  8495.  *
  8496.  */
  8497. var AttachmentFiles = (function (_super) {
  8498.     __extends(AttachmentFiles, _super);
  8499.     /**
  8500.      * Creates a new instance of the AttachmentFiles class
  8501.      *
  8502.      * @param baseUrl The url or Queryable which forms the parent of this attachments collection
  8503.      */
  8504.     function AttachmentFiles(baseUrl, path) {
  8505.         if (path === void 0) { path = "AttachmentFiles"; }
  8506.         return _super.call(this, baseUrl, path) || this;
  8507.     }
  8508.     /**
  8509.      * Gets a Attachment File by filename
  8510.      *
  8511.      * @param name The name of the file, including extension.
  8512.      */
  8513.     AttachmentFiles.prototype.getByName = function (name) {
  8514.         var f = new AttachmentFile(this);
  8515.         f.concat("('" + name + "')");
  8516.         return f;
  8517.     };
  8518.     /**
  8519.      * Adds a new attachment to the collection. Not supported for batching.
  8520.      *
  8521.      * @param name The name of the file, including extension.
  8522.      * @param content The Base64 file content.
  8523.      */
  8524.     AttachmentFiles.prototype.add = function (name, content) {
  8525.         var _this = this;
  8526.         return this.clone(AttachmentFiles, "add(FileName='" + name + "')").post({
  8527.             body: content,
  8528.         }).then(function (response) {
  8529.             return {
  8530.                 data: response,
  8531.                 file: _this.getByName(name),
  8532.             };
  8533.         });
  8534.     };
  8535.     /**
  8536.      * Adds mjultiple new attachment to the collection. Not supported for batching.
  8537.      *
  8538.      * @files name The collection of files to add
  8539.      */
  8540.     AttachmentFiles.prototype.addMultiple = function (files) {
  8541.         var _this = this;
  8542.         // add the files in series so we don't get update conflicts
  8543.         return files.reduce(function (chain, file) { return chain.then(function () { return _this.clone(AttachmentFiles, "add(FileName='" + file.name + "')").post({
  8544.             body: file.content,
  8545.         }); }); }, Promise.resolve());
  8546.     };
  8547.     return AttachmentFiles;
  8548. }(queryable_1.QueryableCollection));
  8549. exports.AttachmentFiles = AttachmentFiles;
  8550. /**
  8551.  * Describes a single attachment file instance
  8552.  *
  8553.  */
  8554. var AttachmentFile = (function (_super) {
  8555.     __extends(AttachmentFile, _super);
  8556.     function AttachmentFile() {
  8557.         return _super !== null && _super.apply(this, arguments) || this;
  8558.     }
  8559.     /**
  8560.      * Gets the contents of the file as text
  8561.      *
  8562.      */
  8563.     AttachmentFile.prototype.getText = function () {
  8564.         return this.clone(AttachmentFile, "$value").get(new odata_1.TextFileParser());
  8565.     };
  8566.     /**
  8567.      * Gets the contents of the file as a blob, does not work in Node.js
  8568.      *
  8569.      */
  8570.     AttachmentFile.prototype.getBlob = function () {
  8571.         return this.clone(AttachmentFile, "$value").get(new odata_1.BlobFileParser());
  8572.     };
  8573.     /**
  8574.      * Gets the contents of a file as an ArrayBuffer, works in Node.js
  8575.      */
  8576.     AttachmentFile.prototype.getBuffer = function () {
  8577.         return this.clone(AttachmentFile, "$value").get(new odata_1.BufferFileParser());
  8578.     };
  8579.     /**
  8580.      * Gets the contents of a file as an ArrayBuffer, works in Node.js
  8581.      */
  8582.     AttachmentFile.prototype.getJSON = function () {
  8583.         return this.clone(AttachmentFile, "$value").get(new odata_1.JSONFileParser());
  8584.     };
  8585.     /**
  8586.      * Sets the content of a file. Not supported for batching
  8587.      *
  8588.      * @param content The value to set for the file contents
  8589.      */
  8590.     AttachmentFile.prototype.setContent = function (content) {
  8591.         var _this = this;
  8592.         return this.clone(AttachmentFile, "$value").post({
  8593.             body: content,
  8594.             headers: {
  8595.                 "X-HTTP-Method": "PUT",
  8596.             },
  8597.         }).then(function (_) { return new AttachmentFile(_this); });
  8598.     };
  8599.     /**
  8600.      * Delete this attachment file
  8601.      *
  8602.      * @param eTag Value used in the IF-Match header, by default "*"
  8603.      */
  8604.     AttachmentFile.prototype.delete = function (eTag) {
  8605.         if (eTag === void 0) { eTag = "*"; }
  8606.         return this.post({
  8607.             headers: {
  8608.                 "IF-Match": eTag,
  8609.                 "X-HTTP-Method": "DELETE",
  8610.             },
  8611.         });
  8612.     };
  8613.     return AttachmentFile;
  8614. }(queryable_1.QueryableInstance));
  8615. exports.AttachmentFile = AttachmentFile;
  8616.  
  8617.  
  8618. /***/ }),
  8619. /* 43 */
  8620. /***/ (function(module, exports, __webpack_require__) {
  8621.  
  8622. "use strict";
  8623.  
  8624. var __extends = (this && this.__extends) || (function () {
  8625.     var extendStatics = Object.setPrototypeOf ||
  8626.         ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  8627.         function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  8628.     return function (d, b) {
  8629.         extendStatics(d, b);
  8630.         function __() { this.constructor = d; }
  8631.         d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  8632.     };
  8633. })();
  8634. Object.defineProperty(exports, "__esModule", { value: true });
  8635. var queryable_1 = __webpack_require__(1);
  8636. /**
  8637.  * Describes a collection of Field objects
  8638.  *
  8639.  */
  8640. var Forms = (function (_super) {
  8641.     __extends(Forms, _super);
  8642.     /**
  8643.      * Creates a new instance of the Fields class
  8644.      *
  8645.      * @param baseUrl The url or Queryable which forms the parent of this fields collection
  8646.      */
  8647.     function Forms(baseUrl, path) {
  8648.         if (path === void 0) { path = "forms"; }
  8649.         return _super.call(this, baseUrl, path) || this;
  8650.     }
  8651.     /**
  8652.      * Gets a form by id
  8653.      *
  8654.      * @param id The guid id of the item to retrieve
  8655.      */
  8656.     Forms.prototype.getById = function (id) {
  8657.         var i = new Form(this);
  8658.         i.concat("('" + id + "')");
  8659.         return i;
  8660.     };
  8661.     return Forms;
  8662. }(queryable_1.QueryableCollection));
  8663. exports.Forms = Forms;
  8664. /**
  8665.  * Describes a single of Form instance
  8666.  *
  8667.  */
  8668. var Form = (function (_super) {
  8669.     __extends(Form, _super);
  8670.     function Form() {
  8671.         return _super !== null && _super.apply(this, arguments) || this;
  8672.     }
  8673.     return Form;
  8674. }(queryable_1.QueryableInstance));
  8675. exports.Form = Form;
  8676.  
  8677.  
  8678. /***/ }),
  8679. /* 44 */
  8680. /***/ (function(module, exports, __webpack_require__) {
  8681.  
  8682. "use strict";
  8683.  
  8684. function __export(m) {
  8685.     for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  8686. }
  8687. Object.defineProperty(exports, "__esModule", { value: true });
  8688. __export(__webpack_require__(22));
  8689. var files_1 = __webpack_require__(8);
  8690. exports.CheckinType = files_1.CheckinType;
  8691. exports.WebPartsPersonalizationScope = files_1.WebPartsPersonalizationScope;
  8692. exports.MoveOperations = files_1.MoveOperations;
  8693. exports.TemplateFileType = files_1.TemplateFileType;
  8694. var folders_1 = __webpack_require__(9);
  8695. exports.Folder = folders_1.Folder;
  8696. exports.Folders = folders_1.Folders;
  8697. var items_1 = __webpack_require__(10);
  8698. exports.Item = items_1.Item;
  8699. exports.Items = items_1.Items;
  8700. exports.PagedItemCollection = items_1.PagedItemCollection;
  8701. var navigation_1 = __webpack_require__(25);
  8702. exports.NavigationNodes = navigation_1.NavigationNodes;
  8703. exports.NavigationNode = navigation_1.NavigationNode;
  8704. var lists_1 = __webpack_require__(11);
  8705. exports.List = lists_1.List;
  8706. exports.Lists = lists_1.Lists;
  8707. var odata_1 = __webpack_require__(2);
  8708. exports.extractOdataId = odata_1.extractOdataId;
  8709. exports.ODataParserBase = odata_1.ODataParserBase;
  8710. exports.ODataDefaultParser = odata_1.ODataDefaultParser;
  8711. exports.ODataRaw = odata_1.ODataRaw;
  8712. exports.ODataValue = odata_1.ODataValue;
  8713. exports.ODataEntity = odata_1.ODataEntity;
  8714. exports.ODataEntityArray = odata_1.ODataEntityArray;
  8715. exports.TextFileParser = odata_1.TextFileParser;
  8716. exports.BlobFileParser = odata_1.BlobFileParser;
  8717. exports.BufferFileParser = odata_1.BufferFileParser;
  8718. exports.JSONFileParser = odata_1.JSONFileParser;
  8719. var queryable_1 = __webpack_require__(1);
  8720. exports.Queryable = queryable_1.Queryable;
  8721. exports.QueryableInstance = queryable_1.QueryableInstance;
  8722. exports.QueryableCollection = queryable_1.QueryableCollection;
  8723. var roles_1 = __webpack_require__(17);
  8724. exports.RoleDefinitionBindings = roles_1.RoleDefinitionBindings;
  8725. var search_1 = __webpack_require__(27);
  8726. exports.Search = search_1.Search;
  8727. exports.SearchResult = search_1.SearchResult;
  8728. exports.SearchResults = search_1.SearchResults;
  8729. exports.SortDirection = search_1.SortDirection;
  8730. exports.ReorderingRuleMatchType = search_1.ReorderingRuleMatchType;
  8731. exports.QueryPropertyValueType = search_1.QueryPropertyValueType;
  8732. var searchsuggest_1 = __webpack_require__(28);
  8733. exports.SearchSuggest = searchsuggest_1.SearchSuggest;
  8734. exports.SearchSuggestResult = searchsuggest_1.SearchSuggestResult;
  8735. var site_1 = __webpack_require__(29);
  8736. exports.Site = site_1.Site;
  8737. __export(__webpack_require__(13));
  8738. var webs_1 = __webpack_require__(7);
  8739. exports.Web = webs_1.Web;
  8740.  
  8741.  
  8742. /***/ }),
  8743. /* 45 */
  8744. /***/ (function(module, exports, __webpack_require__) {
  8745.  
  8746. "use strict";
  8747.  
  8748. var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
  8749.     var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  8750.     if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  8751.     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;
  8752.     return c > 3 && r && Object.defineProperty(target, key, r), r;
  8753. };
  8754. Object.defineProperty(exports, "__esModule", { value: true });
  8755. var caching_1 = __webpack_require__(22);
  8756. var httpclient_1 = __webpack_require__(15);
  8757. var logging_1 = __webpack_require__(5);
  8758. var util_1 = __webpack_require__(0);
  8759. /**
  8760.  * Processes a given context through the request pipeline
  8761.  *
  8762.  * @param context The request context we are processing
  8763.  */
  8764. function pipe(context) {
  8765.     // this is the beginning of the extensible pipeline in future versions
  8766.     var pipeline = [
  8767.         PipelineMethods.logStart,
  8768.         PipelineMethods.caching,
  8769.         PipelineMethods.send,
  8770.         PipelineMethods.logEnd,
  8771.     ];
  8772.     return pipeline.reduce(function (chain, next) { return chain.then(function (c) { return next(c); }); }, Promise.resolve(context))
  8773.         .then(function (ctx) { return PipelineMethods.returnResult(ctx); })
  8774.         .catch(function (e) {
  8775.         logging_1.Logger.log({
  8776.             data: e,
  8777.             level: logging_1.LogLevel.Error,
  8778.             message: "Error in request pipeline: " + e.message,
  8779.         });
  8780.         throw e;
  8781.     });
  8782. }
  8783. exports.pipe = pipe;
  8784. /**
  8785.  * decorator factory applied to methods in the pipeline to control behavior
  8786.  */
  8787. function requestPipelineMethod(alwaysRun) {
  8788.     if (alwaysRun === void 0) { alwaysRun = false; }
  8789.     return function (target, propertyKey, descriptor) {
  8790.         var method = descriptor.value;
  8791.         descriptor.value = function () {
  8792.             var args = [];
  8793.             for (var _i = 0; _i < arguments.length; _i++) {
  8794.                 args[_i] = arguments[_i];
  8795.             }
  8796.             // if we have a result already in the pipeline, pass it along and don't call the tagged method
  8797.             if (!alwaysRun && args.length > 0 && args[0].hasOwnProperty("hasResult") && args[0].hasResult) {
  8798.                 logging_1.Logger.write("[" + args[0].requestId + "] (" + (new Date()).getTime() + ") Skipping request pipeline method " + propertyKey + ", existing result in pipeline.", logging_1.LogLevel.Verbose);
  8799.                 return Promise.resolve(args[0]);
  8800.             }
  8801.             // apply the tagged method
  8802.             logging_1.Logger.write("[" + args[0].requestId + "] (" + (new Date()).getTime() + ") Calling request pipeline method " + propertyKey + ".", logging_1.LogLevel.Verbose);
  8803.             return method.apply(target, args);
  8804.         };
  8805.     };
  8806. }
  8807. /**
  8808.  * Contains the methods used within the request pipeline
  8809.  */
  8810. var PipelineMethods = (function () {
  8811.     function PipelineMethods() {
  8812.     }
  8813.     /**
  8814.      * Logs the start of the request
  8815.      */
  8816.     PipelineMethods.logStart = function (context) {
  8817.         return new Promise(function (resolve) {
  8818.             logging_1.Logger.log({
  8819.                 data: logging_1.Logger.activeLogLevel === logging_1.LogLevel.Info ? {} : context,
  8820.                 level: logging_1.LogLevel.Info,
  8821.                 message: "[" + context.requestId + "] (" + (new Date()).getTime() + ") Beginning " + context.verb + " request to " + context.requestAbsoluteUrl,
  8822.             });
  8823.             resolve(context);
  8824.         });
  8825.     };
  8826.     /**
  8827.      * Handles caching of the request
  8828.      */
  8829.     PipelineMethods.caching = function (context) {
  8830.         return new Promise(function (resolve) {
  8831.             // handle caching, if applicable
  8832.             if (context.verb === "GET" && context.isCached) {
  8833.                 logging_1.Logger.write("[" + context.requestId + "] (" + (new Date()).getTime() + ") Caching is enabled for request, checking cache...", logging_1.LogLevel.Info);
  8834.                 var cacheOptions = new caching_1.CachingOptions(context.requestAbsoluteUrl.toLowerCase());
  8835.                 if (typeof context.cachingOptions !== "undefined") {
  8836.                     cacheOptions = util_1.Util.extend(cacheOptions, context.cachingOptions);
  8837.                 }
  8838.                 // we may not have a valid store, i.e. on node
  8839.                 if (cacheOptions.store !== null) {
  8840.                     // check if we have the data in cache and if so resolve the promise and return
  8841.                     var data = cacheOptions.store.get(cacheOptions.key);
  8842.                     if (data !== null) {
  8843.                         // ensure we clear any help batch dependency we are resolving from the cache
  8844.                         logging_1.Logger.log({
  8845.                             data: logging_1.Logger.activeLogLevel === logging_1.LogLevel.Info ? {} : data,
  8846.                             level: logging_1.LogLevel.Info,
  8847.                             message: "[" + context.requestId + "] (" + (new Date()).getTime() + ") Value returned from cache.",
  8848.                         });
  8849.                         context.batchDependency();
  8850.                         return PipelineMethods.setResult(context, data).then(function (ctx) { return resolve(ctx); });
  8851.                     }
  8852.                 }
  8853.                 logging_1.Logger.write("[" + context.requestId + "] (" + (new Date()).getTime() + ") Value not found in cache.", logging_1.LogLevel.Info);
  8854.                 // if we don't then wrap the supplied parser in the caching parser wrapper
  8855.                 // and send things on their way
  8856.                 context.parser = new caching_1.CachingParserWrapper(context.parser, cacheOptions);
  8857.             }
  8858.             return resolve(context);
  8859.         });
  8860.     };
  8861.     /**
  8862.      * Sends the request
  8863.      */
  8864.     PipelineMethods.send = function (context) {
  8865.         return new Promise(function (resolve, reject) {
  8866.             // send or batch the request
  8867.             if (context.isBatched) {
  8868.                 // we are in a batch, so add to batch, remove dependency, and resolve with the batch's promise
  8869.                 var p = context.batch.add(context.requestAbsoluteUrl, context.verb, context.options, context.parser);
  8870.                 // we release the dependency here to ensure the batch does not execute until the request is added to the batch
  8871.                 context.batchDependency();
  8872.                 logging_1.Logger.write("[" + context.requestId + "] (" + (new Date()).getTime() + ") Batching request.", logging_1.LogLevel.Info);
  8873.                 resolve(p.then(function (result) { return PipelineMethods.setResult(context, result); }));
  8874.             }
  8875.             else {
  8876.                 logging_1.Logger.write("[" + context.requestId + "] (" + (new Date()).getTime() + ") Sending request.", logging_1.LogLevel.Info);
  8877.                 // we are not part of a batch, so proceed as normal
  8878.                 var client = new httpclient_1.HttpClient();
  8879.                 var opts = util_1.Util.extend(context.options || {}, { method: context.verb });
  8880.                 client.fetch(context.requestAbsoluteUrl, opts)
  8881.                     .then(function (response) { return context.parser.parse(response); })
  8882.                     .then(function (result) { return PipelineMethods.setResult(context, result); })
  8883.                     .then(function (ctx) { return resolve(ctx); })
  8884.                     .catch(function (e) { return reject(e); });
  8885.             }
  8886.         });
  8887.     };
  8888.     /**
  8889.      * Logs the end of the request
  8890.      */
  8891.     PipelineMethods.logEnd = function (context) {
  8892.         return new Promise(function (resolve) {
  8893.             logging_1.Logger.log({
  8894.                 data: logging_1.Logger.activeLogLevel === logging_1.LogLevel.Info ? {} : context,
  8895.                 level: logging_1.LogLevel.Info,
  8896.                 message: "[" + context.requestId + "] (" + (new Date()).getTime() + ") Completing " + context.verb + " request to " + context.requestAbsoluteUrl,
  8897.             });
  8898.             resolve(context);
  8899.         });
  8900.     };
  8901.     /**
  8902.      * At the end of the pipeline resolves the request's result
  8903.      */
  8904.     PipelineMethods.returnResult = function (context) {
  8905.         logging_1.Logger.log({
  8906.             data: context.result,
  8907.             level: logging_1.LogLevel.Verbose,
  8908.             message: "[" + context.requestId + "] (" + (new Date()).getTime() + ") Returning, see data property for value.",
  8909.         });
  8910.         return Promise.resolve(context.result);
  8911.     };
  8912.     /**
  8913.      * Sets the result on the context
  8914.      */
  8915.     PipelineMethods.setResult = function (context, value) {
  8916.         return new Promise(function (resolve) {
  8917.             context.result = value;
  8918.             context.hasResult = true;
  8919.             resolve(context);
  8920.         });
  8921.     };
  8922.     return PipelineMethods;
  8923. }());
  8924. __decorate([
  8925.     requestPipelineMethod(true)
  8926. ], PipelineMethods, "logStart", null);
  8927. __decorate([
  8928.     requestPipelineMethod()
  8929. ], PipelineMethods, "caching", null);
  8930. __decorate([
  8931.     requestPipelineMethod()
  8932. ], PipelineMethods, "send", null);
  8933. __decorate([
  8934.     requestPipelineMethod(true)
  8935. ], PipelineMethods, "logEnd", null);
  8936. __decorate([
  8937.     requestPipelineMethod(true)
  8938. ], PipelineMethods, "returnResult", null);
  8939.  
  8940.  
  8941. /***/ }),
  8942. /* 46 */
  8943. /***/ (function(module, exports, __webpack_require__) {
  8944.  
  8945. "use strict";
  8946.  
  8947. var __extends = (this && this.__extends) || (function () {
  8948.     var extendStatics = Object.setPrototypeOf ||
  8949.         ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  8950.         function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  8951.     return function (d, b) {
  8952.         extendStatics(d, b);
  8953.         function __() { this.constructor = d; }
  8954.         d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  8955.     };
  8956. })();
  8957. Object.defineProperty(exports, "__esModule", { value: true });
  8958. var queryable_1 = __webpack_require__(1);
  8959. var RelatedItemManagerImpl = (function (_super) {
  8960.     __extends(RelatedItemManagerImpl, _super);
  8961.     function RelatedItemManagerImpl(baseUrl, path) {
  8962.         if (path === void 0) { path = "_api/SP.RelatedItemManager"; }
  8963.         return _super.call(this, baseUrl, path) || this;
  8964.     }
  8965.     RelatedItemManagerImpl.FromUrl = function (url) {
  8966.         if (url === null) {
  8967.             return new RelatedItemManagerImpl("");
  8968.         }
  8969.         var index = url.indexOf("_api/");
  8970.         if (index > -1) {
  8971.             return new RelatedItemManagerImpl(url.substr(0, index));
  8972.         }
  8973.         return new RelatedItemManagerImpl(url);
  8974.     };
  8975.     RelatedItemManagerImpl.prototype.getRelatedItems = function (sourceListName, sourceItemId) {
  8976.         var query = this.clone(RelatedItemManagerImpl, null, true);
  8977.         query.concat(".GetRelatedItems");
  8978.         return query.post({
  8979.             body: JSON.stringify({
  8980.                 SourceItemID: sourceItemId,
  8981.                 SourceListName: sourceListName,
  8982.             }),
  8983.         });
  8984.     };
  8985.     RelatedItemManagerImpl.prototype.getPageOneRelatedItems = function (sourceListName, sourceItemId) {
  8986.         var query = this.clone(RelatedItemManagerImpl, null, true);
  8987.         query.concat(".GetPageOneRelatedItems");
  8988.         return query.post({
  8989.             body: JSON.stringify({
  8990.                 SourceItemID: sourceItemId,
  8991.                 SourceListName: sourceListName,
  8992.             }),
  8993.         });
  8994.     };
  8995.     RelatedItemManagerImpl.prototype.addSingleLink = function (sourceListName, sourceItemId, sourceWebUrl, targetListName, targetItemID, targetWebUrl, tryAddReverseLink) {
  8996.         if (tryAddReverseLink === void 0) { tryAddReverseLink = false; }
  8997.         var query = this.clone(RelatedItemManagerImpl, null, true);
  8998.         query.concat(".AddSingleLink");
  8999.         return query.post({
  9000.             body: JSON.stringify({
  9001.                 SourceItemID: sourceItemId,
  9002.                 SourceListName: sourceListName,
  9003.                 SourceWebUrl: sourceWebUrl,
  9004.                 TargetItemID: targetItemID,
  9005.                 TargetListName: targetListName,
  9006.                 TargetWebUrl: targetWebUrl,
  9007.                 TryAddReverseLink: tryAddReverseLink,
  9008.             }),
  9009.         });
  9010.     };
  9011.     /**
  9012.      * Adds a related item link from an item specified by list name and item id, to an item specified by url
  9013.      *
  9014.      * @param sourceListName The source list name or list id
  9015.      * @param sourceItemId The source item id
  9016.      * @param targetItemUrl The target item url
  9017.      * @param tryAddReverseLink If set to true try to add the reverse link (will not return error if it fails)
  9018.      */
  9019.     RelatedItemManagerImpl.prototype.addSingleLinkToUrl = function (sourceListName, sourceItemId, targetItemUrl, tryAddReverseLink) {
  9020.         if (tryAddReverseLink === void 0) { tryAddReverseLink = false; }
  9021.         var query = this.clone(RelatedItemManagerImpl, null, true);
  9022.         query.concat(".AddSingleLinkToUrl");
  9023.         return query.post({
  9024.             body: JSON.stringify({
  9025.                 SourceItemID: sourceItemId,
  9026.                 SourceListName: sourceListName,
  9027.                 TargetItemUrl: targetItemUrl,
  9028.                 TryAddReverseLink: tryAddReverseLink,
  9029.             }),
  9030.         });
  9031.     };
  9032.     /**
  9033.      * Adds a related item link from an item specified by url, to an item specified by list name and item id
  9034.      *
  9035.      * @param sourceItemUrl The source item url
  9036.      * @param targetListName The target list name or list id
  9037.      * @param targetItemId The target item id
  9038.      * @param tryAddReverseLink If set to true try to add the reverse link (will not return error if it fails)
  9039.      */
  9040.     RelatedItemManagerImpl.prototype.addSingleLinkFromUrl = function (sourceItemUrl, targetListName, targetItemId, tryAddReverseLink) {
  9041.         if (tryAddReverseLink === void 0) { tryAddReverseLink = false; }
  9042.         var query = this.clone(RelatedItemManagerImpl, null, true);
  9043.         query.concat(".AddSingleLinkFromUrl");
  9044.         return query.post({
  9045.             body: JSON.stringify({
  9046.                 SourceItemUrl: sourceItemUrl,
  9047.                 TargetItemID: targetItemId,
  9048.                 TargetListName: targetListName,
  9049.                 TryAddReverseLink: tryAddReverseLink,
  9050.             }),
  9051.         });
  9052.     };
  9053.     RelatedItemManagerImpl.prototype.deleteSingleLink = function (sourceListName, sourceItemId, sourceWebUrl, targetListName, targetItemId, targetWebUrl, tryDeleteReverseLink) {
  9054.         if (tryDeleteReverseLink === void 0) { tryDeleteReverseLink = false; }
  9055.         var query = this.clone(RelatedItemManagerImpl, null, true);
  9056.         query.concat(".DeleteSingleLink");
  9057.         return query.post({
  9058.             body: JSON.stringify({
  9059.                 SourceItemID: sourceItemId,
  9060.                 SourceListName: sourceListName,
  9061.                 SourceWebUrl: sourceWebUrl,
  9062.                 TargetItemID: targetItemId,
  9063.                 TargetListName: targetListName,
  9064.                 TargetWebUrl: targetWebUrl,
  9065.                 TryDeleteReverseLink: tryDeleteReverseLink,
  9066.             }),
  9067.         });
  9068.     };
  9069.     return RelatedItemManagerImpl;
  9070. }(queryable_1.Queryable));
  9071. exports.RelatedItemManagerImpl = RelatedItemManagerImpl;
  9072.  
  9073.  
  9074. /***/ }),
  9075. /* 47 */
  9076. /***/ (function(module, exports, __webpack_require__) {
  9077.  
  9078. "use strict";
  9079.  
  9080. var __extends = (this && this.__extends) || (function () {
  9081.     var extendStatics = Object.setPrototypeOf ||
  9082.         ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  9083.         function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  9084.     return function (d, b) {
  9085.         extendStatics(d, b);
  9086.         function __() { this.constructor = d; }
  9087.         d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  9088.     };
  9089. })();
  9090. Object.defineProperty(exports, "__esModule", { value: true });
  9091. var queryable_1 = __webpack_require__(1);
  9092. /**
  9093.  * Describes a collection of webhook subscriptions
  9094.  *
  9095.  */
  9096. var Subscriptions = (function (_super) {
  9097.     __extends(Subscriptions, _super);
  9098.     /**
  9099.      * Creates a new instance of the Subscriptions class
  9100.      *
  9101.      * @param baseUrl - The url or Queryable which forms the parent of this webhook subscriptions collection
  9102.      */
  9103.     function Subscriptions(baseUrl, path) {
  9104.         if (path === void 0) { path = "subscriptions"; }
  9105.         return _super.call(this, baseUrl, path) || this;
  9106.     }
  9107.     /**
  9108.      * Returns all the webhook subscriptions or the specified webhook subscription
  9109.      *
  9110.      */
  9111.     Subscriptions.prototype.getById = function (subscriptionId) {
  9112.         var subscription = new Subscription(this);
  9113.         subscription.concat("('" + subscriptionId + "')");
  9114.         return subscription;
  9115.     };
  9116.     /**
  9117.      * Create a new webhook subscription
  9118.      *
  9119.      */
  9120.     Subscriptions.prototype.add = function (notificationUrl, expirationDate, clientState) {
  9121.         var _this = this;
  9122.         var postBody = JSON.stringify({
  9123.             "clientState": clientState || "pnp-js-core-subscription",
  9124.             "expirationDateTime": expirationDate,
  9125.             "notificationUrl": notificationUrl,
  9126.             "resource": this.toUrl(),
  9127.         });
  9128.         return this.post({ body: postBody, headers: { "Content-Type": "application/json" } }).then(function (result) {
  9129.             return { data: result, subscription: _this.getById(result.id) };
  9130.         });
  9131.     };
  9132.     return Subscriptions;
  9133. }(queryable_1.QueryableCollection));
  9134. exports.Subscriptions = Subscriptions;
  9135. /**
  9136.  * Describes a single webhook subscription instance
  9137.  *
  9138.  */
  9139. var Subscription = (function (_super) {
  9140.     __extends(Subscription, _super);
  9141.     function Subscription() {
  9142.         return _super !== null && _super.apply(this, arguments) || this;
  9143.     }
  9144.     /**
  9145.      * Update a webhook subscription
  9146.      *
  9147.      */
  9148.     Subscription.prototype.update = function (expirationDate) {
  9149.         var _this = this;
  9150.         var postBody = JSON.stringify({
  9151.             "expirationDateTime": expirationDate,
  9152.         });
  9153.         return this.patch({ body: postBody, headers: { "Content-Type": "application/json" } }).then(function (data) {
  9154.             return { data: data, subscription: _this };
  9155.         });
  9156.     };
  9157.     /**
  9158.      * Remove a webhook subscription
  9159.      *
  9160.      */
  9161.     Subscription.prototype.delete = function () {
  9162.         return _super.prototype.delete.call(this);
  9163.     };
  9164.     return Subscription;
  9165. }(queryable_1.QueryableInstance));
  9166. exports.Subscription = Subscription;
  9167.  
  9168.  
  9169. /***/ }),
  9170. /* 48 */
  9171. /***/ (function(module, exports, __webpack_require__) {
  9172.  
  9173. "use strict";
  9174.  
  9175. var __extends = (this && this.__extends) || (function () {
  9176.     var extendStatics = Object.setPrototypeOf ||
  9177.         ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  9178.         function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  9179.     return function (d, b) {
  9180.         extendStatics(d, b);
  9181.         function __() { this.constructor = d; }
  9182.         d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  9183.     };
  9184. })();
  9185. Object.defineProperty(exports, "__esModule", { value: true });
  9186. var queryable_1 = __webpack_require__(1);
  9187. var files_1 = __webpack_require__(51);
  9188. var odata_1 = __webpack_require__(2);
  9189. var UserProfileQuery = (function (_super) {
  9190.     __extends(UserProfileQuery, _super);
  9191.     function UserProfileQuery(baseUrl, path) {
  9192.         if (path === void 0) { path = "_api/sp.userprofiles.peoplemanager"; }
  9193.         var _this = _super.call(this, baseUrl, path) || this;
  9194.         _this.profileLoader = new ProfileLoader(baseUrl);
  9195.         return _this;
  9196.     }
  9197.     Object.defineProperty(UserProfileQuery.prototype, "editProfileLink", {
  9198.         /**
  9199.          * The URL of the edit profile page for the current user.
  9200.          */
  9201.         get: function () {
  9202.             return this.clone(UserProfileQuery, "EditProfileLink").getAs(odata_1.ODataValue());
  9203.         },
  9204.         enumerable: true,
  9205.         configurable: true
  9206.     });
  9207.     Object.defineProperty(UserProfileQuery.prototype, "isMyPeopleListPublic", {
  9208.         /**
  9209.          * A Boolean value that indicates whether the current user's People I'm Following list is public.
  9210.          */
  9211.         get: function () {
  9212.             return this.clone(UserProfileQuery, "IsMyPeopleListPublic").getAs(odata_1.ODataValue());
  9213.         },
  9214.         enumerable: true,
  9215.         configurable: true
  9216.     });
  9217.     /**
  9218.      * A Boolean value that indicates whether the current user's People I'm Following list is public.
  9219.      *
  9220.      * @param loginName The account name of the user
  9221.      */
  9222.     UserProfileQuery.prototype.amIFollowedBy = function (loginName) {
  9223.         var q = this.clone(UserProfileQuery, "amifollowedby(@v)", true);
  9224.         q.query.add("@v", "'" + encodeURIComponent(loginName) + "'");
  9225.         return q.get();
  9226.     };
  9227.     /**
  9228.      * Checks whether the current user is following the specified user.
  9229.      *
  9230.      * @param loginName The account name of the user
  9231.      */
  9232.     UserProfileQuery.prototype.amIFollowing = function (loginName) {
  9233.         var q = this.clone(UserProfileQuery, "amifollowing(@v)", true);
  9234.         q.query.add("@v", "'" + encodeURIComponent(loginName) + "'");
  9235.         return q.get();
  9236.     };
  9237.     /**
  9238.      * Gets tags that the user is following.
  9239.      *
  9240.      * @param maxCount The maximum number of tags to get.
  9241.      */
  9242.     UserProfileQuery.prototype.getFollowedTags = function (maxCount) {
  9243.         if (maxCount === void 0) { maxCount = 20; }
  9244.         return this.clone(UserProfileQuery, "getfollowedtags(" + maxCount + ")", true).get();
  9245.     };
  9246.     /**
  9247.      * Gets the people who are following the specified user.
  9248.      *
  9249.      * @param loginName The account name of the user.
  9250.      */
  9251.     UserProfileQuery.prototype.getFollowersFor = function (loginName) {
  9252.         var q = this.clone(UserProfileQuery, "getfollowersfor(@v)", true);
  9253.         q.query.add("@v", "'" + encodeURIComponent(loginName) + "'");
  9254.         return q.get();
  9255.     };
  9256.     Object.defineProperty(UserProfileQuery.prototype, "myFollowers", {
  9257.         /**
  9258.          * Gets the people who are following the current user.
  9259.          *
  9260.          */
  9261.         get: function () {
  9262.             return new queryable_1.QueryableCollection(this, "getmyfollowers");
  9263.         },
  9264.         enumerable: true,
  9265.         configurable: true
  9266.     });
  9267.     Object.defineProperty(UserProfileQuery.prototype, "myProperties", {
  9268.         /**
  9269.          * Gets user properties for the current user.
  9270.          *
  9271.          */
  9272.         get: function () {
  9273.             return new UserProfileQuery(this, "getmyproperties");
  9274.         },
  9275.         enumerable: true,
  9276.         configurable: true
  9277.     });
  9278.     /**
  9279.      * Gets the people who the specified user is following.
  9280.      *
  9281.      * @param loginName The account name of the user.
  9282.      */
  9283.     UserProfileQuery.prototype.getPeopleFollowedBy = function (loginName) {
  9284.         var q = this.clone(UserProfileQuery, "getpeoplefollowedby(@v)", true);
  9285.         q.query.add("@v", "'" + encodeURIComponent(loginName) + "'");
  9286.         return q.get();
  9287.     };
  9288.     /**
  9289.      * Gets user properties for the specified user.
  9290.      *
  9291.      * @param loginName The account name of the user.
  9292.      */
  9293.     UserProfileQuery.prototype.getPropertiesFor = function (loginName) {
  9294.         var q = this.clone(UserProfileQuery, "getpropertiesfor(@v)", true);
  9295.         q.query.add("@v", "'" + encodeURIComponent(loginName) + "'");
  9296.         return q.get();
  9297.     };
  9298.     Object.defineProperty(UserProfileQuery.prototype, "trendingTags", {
  9299.         /**
  9300.          * Gets the most popular tags.
  9301.          *
  9302.          */
  9303.         get: function () {
  9304.             var q = this.clone(UserProfileQuery, null, true);
  9305.             q.concat(".gettrendingtags");
  9306.             return q.get();
  9307.         },
  9308.         enumerable: true,
  9309.         configurable: true
  9310.     });
  9311.     /**
  9312.      * Gets the specified user profile property for the specified user.
  9313.      *
  9314.      * @param loginName The account name of the user.
  9315.      * @param propertyName The case-sensitive name of the property to get.
  9316.      */
  9317.     UserProfileQuery.prototype.getUserProfilePropertyFor = function (loginName, propertyName) {
  9318.         var q = this.clone(UserProfileQuery, "getuserprofilepropertyfor(accountname=@v, propertyname='" + propertyName + "')", true);
  9319.         q.query.add("@v", "'" + encodeURIComponent(loginName) + "'");
  9320.         return q.get();
  9321.     };
  9322.     /**
  9323.      * Removes the specified user from the user's list of suggested people to follow.
  9324.      *
  9325.      * @param loginName The account name of the user.
  9326.      */
  9327.     UserProfileQuery.prototype.hideSuggestion = function (loginName) {
  9328.         var q = this.clone(UserProfileQuery, "hidesuggestion(@v)", true);
  9329.         q.query.add("@v", "'" + encodeURIComponent(loginName) + "'");
  9330.         return q.post();
  9331.     };
  9332.     /**
  9333.      * Checks whether the first user is following the second user.
  9334.      *
  9335.      * @param follower The account name of the user who might be following followee.
  9336.      * @param followee The account name of the user who might be followed.
  9337.      */
  9338.     UserProfileQuery.prototype.isFollowing = function (follower, followee) {
  9339.         var q = this.clone(UserProfileQuery, null, true);
  9340.         q.concat(".isfollowing(possiblefolloweraccountname=@v, possiblefolloweeaccountname=@y)");
  9341.         q.query.add("@v", "'" + encodeURIComponent(follower) + "'");
  9342.         q.query.add("@y", "'" + encodeURIComponent(followee) + "'");
  9343.         return q.get();
  9344.     };
  9345.     /**
  9346.      * Uploads and sets the user profile picture. Not supported for batching.
  9347.      *
  9348.      * @param profilePicSource Blob data representing the user's picture
  9349.      */
  9350.     UserProfileQuery.prototype.setMyProfilePic = function (profilePicSource) {
  9351.         var _this = this;
  9352.         return new Promise(function (resolve, reject) {
  9353.             files_1.readBlobAsArrayBuffer(profilePicSource).then(function (buffer) {
  9354.                 var request = new UserProfileQuery(_this, "setmyprofilepicture");
  9355.                 request.post({
  9356.                     body: String.fromCharCode.apply(null, new Uint16Array(buffer)),
  9357.                 }).then(function (_) { return resolve(); });
  9358.             }).catch(function (e) { return reject(e); });
  9359.         });
  9360.     };
  9361.     /**
  9362.      * Provisions one or more users' personal sites. (My Site administrator on SharePoint Online only)
  9363.      *
  9364.      * @param emails The email addresses of the users to provision sites for
  9365.      */
  9366.     UserProfileQuery.prototype.createPersonalSiteEnqueueBulk = function () {
  9367.         var emails = [];
  9368.         for (var _i = 0; _i < arguments.length; _i++) {
  9369.             emails[_i] = arguments[_i];
  9370.         }
  9371.         return this.profileLoader.createPersonalSiteEnqueueBulk(emails);
  9372.     };
  9373.     Object.defineProperty(UserProfileQuery.prototype, "ownerUserProfile", {
  9374.         /**
  9375.          * Gets the user profile of the site owner.
  9376.          *
  9377.          */
  9378.         get: function () {
  9379.             return this.profileLoader.ownerUserProfile;
  9380.         },
  9381.         enumerable: true,
  9382.         configurable: true
  9383.     });
  9384.     Object.defineProperty(UserProfileQuery.prototype, "userProfile", {
  9385.         /**
  9386.          * Gets the user profile that corresponds to the current user.
  9387.          */
  9388.         get: function () {
  9389.             return this.profileLoader.userProfile;
  9390.         },
  9391.         enumerable: true,
  9392.         configurable: true
  9393.     });
  9394.     /**
  9395.      * Enqueues creating a personal site for this user, which can be used to share documents, web pages, and other files.
  9396.      *
  9397.      * @param interactiveRequest true if interactively (web) initiated request, or false if non-interactively (client) initiated request
  9398.      */
  9399.     UserProfileQuery.prototype.createPersonalSite = function (interactiveRequest) {
  9400.         if (interactiveRequest === void 0) { interactiveRequest = false; }
  9401.         return this.profileLoader.createPersonalSite(interactiveRequest);
  9402.     };
  9403.     /**
  9404.      * Sets the privacy settings for this profile.
  9405.      *
  9406.      * @param share true to make all social data public; false to make all social data private.
  9407.      */
  9408.     UserProfileQuery.prototype.shareAllSocialData = function (share) {
  9409.         return this.profileLoader.shareAllSocialData(share);
  9410.     };
  9411.     return UserProfileQuery;
  9412. }(queryable_1.QueryableInstance));
  9413. exports.UserProfileQuery = UserProfileQuery;
  9414. var ProfileLoader = (function (_super) {
  9415.     __extends(ProfileLoader, _super);
  9416.     function ProfileLoader(baseUrl, path) {
  9417.         if (path === void 0) { path = "_api/sp.userprofiles.profileloader.getprofileloader"; }
  9418.         return _super.call(this, baseUrl, path) || this;
  9419.     }
  9420.     /**
  9421.      * Provisions one or more users' personal sites. (My Site administrator on SharePoint Online only)
  9422.      *
  9423.      * @param emails The email addresses of the users to provision sites for
  9424.      */
  9425.     ProfileLoader.prototype.createPersonalSiteEnqueueBulk = function (emails) {
  9426.         return this.clone(ProfileLoader, "createpersonalsiteenqueuebulk").post({
  9427.             body: JSON.stringify({ "emailIDs": emails }),
  9428.         });
  9429.     };
  9430.     Object.defineProperty(ProfileLoader.prototype, "ownerUserProfile", {
  9431.         /**
  9432.          * Gets the user profile of the site owner.
  9433.          *
  9434.          */
  9435.         get: function () {
  9436.             var q = this.getParent(ProfileLoader, this.parentUrl, "_api/sp.userprofiles.profileloader.getowneruserprofile");
  9437.             if (this.hasBatch) {
  9438.                 q = q.inBatch(this.batch);
  9439.             }
  9440.             return q.postAs();
  9441.         },
  9442.         enumerable: true,
  9443.         configurable: true
  9444.     });
  9445.     Object.defineProperty(ProfileLoader.prototype, "userProfile", {
  9446.         /**
  9447.          * Gets the user profile that corresponds to the current user.
  9448.          *
  9449.          */
  9450.         get: function () {
  9451.             return this.clone(ProfileLoader, "getuserprofile", true).postAs();
  9452.         },
  9453.         enumerable: true,
  9454.         configurable: true
  9455.     });
  9456.     /**
  9457.      * Enqueues creating a personal site for this user, which can be used to share documents, web pages, and other files.
  9458.      *
  9459.      * @param interactiveRequest true if interactively (web) initiated request, or false if non-interactively (client) initiated request
  9460.      */
  9461.     ProfileLoader.prototype.createPersonalSite = function (interactiveRequest) {
  9462.         if (interactiveRequest === void 0) { interactiveRequest = false; }
  9463.         return this.clone(ProfileLoader, "getuserprofile/createpersonalsiteenque(" + interactiveRequest + ")", true).post();
  9464.     };
  9465.     /**
  9466.      * Sets the privacy settings for this profile.
  9467.      *
  9468.      * @param share true to make all social data public; false to make all social data private.
  9469.      */
  9470.     ProfileLoader.prototype.shareAllSocialData = function (share) {
  9471.         return this.clone(ProfileLoader, "getuserprofile/shareallsocialdata(" + share + ")", true).post();
  9472.     };
  9473.     return ProfileLoader;
  9474. }(queryable_1.Queryable));
  9475.  
  9476.  
  9477. /***/ }),
  9478. /* 49 */
  9479. /***/ (function(module, exports, __webpack_require__) {
  9480.  
  9481. "use strict";
  9482.  
  9483. var __extends = (this && this.__extends) || (function () {
  9484.     var extendStatics = Object.setPrototypeOf ||
  9485.         ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  9486.         function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  9487.     return function (d, b) {
  9488.         extendStatics(d, b);
  9489.         function __() { this.constructor = d; }
  9490.         d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  9491.     };
  9492. })();
  9493. Object.defineProperty(exports, "__esModule", { value: true });
  9494. var queryable_1 = __webpack_require__(1);
  9495. var util_1 = __webpack_require__(0);
  9496. /**
  9497.  * Describes the views available in the current context
  9498.  *
  9499.  */
  9500. var Views = (function (_super) {
  9501.     __extends(Views, _super);
  9502.     /**
  9503.      * Creates a new instance of the Views class
  9504.      *
  9505.      * @param baseUrl The url or Queryable which forms the parent of this fields collection
  9506.      */
  9507.     function Views(baseUrl, path) {
  9508.         if (path === void 0) { path = "views"; }
  9509.         return _super.call(this, baseUrl, path) || this;
  9510.     }
  9511.     /**
  9512.      * Gets a view by guid id
  9513.      *
  9514.      * @param id The GUID id of the view
  9515.      */
  9516.     Views.prototype.getById = function (id) {
  9517.         var v = new View(this);
  9518.         v.concat("('" + id + "')");
  9519.         return v;
  9520.     };
  9521.     /**
  9522.      * Gets a view by title (case-sensitive)
  9523.      *
  9524.      * @param title The case-sensitive title of the view
  9525.      */
  9526.     Views.prototype.getByTitle = function (title) {
  9527.         return new View(this, "getByTitle('" + title + "')");
  9528.     };
  9529.     /**
  9530.      * Adds a new view to the collection
  9531.      *
  9532.      * @param title The new views's title
  9533.      * @param personalView True if this is a personal view, otherwise false, default = false
  9534.      * @param additionalSettings Will be passed as part of the view creation body
  9535.      */
  9536.     /*tslint:disable max-line-length */
  9537.     Views.prototype.add = function (title, personalView, additionalSettings) {
  9538.         var _this = this;
  9539.         if (personalView === void 0) { personalView = false; }
  9540.         if (additionalSettings === void 0) { additionalSettings = {}; }
  9541.         var postBody = JSON.stringify(util_1.Util.extend({
  9542.             "PersonalView": personalView,
  9543.             "Title": title,
  9544.             "__metadata": { "type": "SP.View" },
  9545.         }, additionalSettings));
  9546.         return this.clone(Views, null, true).postAs({ body: postBody }).then(function (data) {
  9547.             return {
  9548.                 data: data,
  9549.                 view: _this.getById(data.Id),
  9550.             };
  9551.         });
  9552.     };
  9553.     return Views;
  9554. }(queryable_1.QueryableCollection));
  9555. exports.Views = Views;
  9556. /**
  9557.  * Describes a single View instance
  9558.  *
  9559.  */
  9560. var View = (function (_super) {
  9561.     __extends(View, _super);
  9562.     function View() {
  9563.         return _super !== null && _super.apply(this, arguments) || this;
  9564.     }
  9565.     Object.defineProperty(View.prototype, "fields", {
  9566.         get: function () {
  9567.             return new ViewFields(this);
  9568.         },
  9569.         enumerable: true,
  9570.         configurable: true
  9571.     });
  9572.     /**
  9573.      * Updates this view intance with the supplied properties
  9574.      *
  9575.      * @param properties A plain object hash of values to update for the view
  9576.      */
  9577.     View.prototype.update = function (properties) {
  9578.         var _this = this;
  9579.         var postBody = JSON.stringify(util_1.Util.extend({
  9580.             "__metadata": { "type": "SP.View" },
  9581.         }, properties));
  9582.         return this.post({
  9583.             body: postBody,
  9584.             headers: {
  9585.                 "X-HTTP-Method": "MERGE",
  9586.             },
  9587.         }).then(function (data) {
  9588.             return {
  9589.                 data: data,
  9590.                 view: _this,
  9591.             };
  9592.         });
  9593.     };
  9594.     /**
  9595.      * Delete this view
  9596.      *
  9597.      */
  9598.     View.prototype.delete = function () {
  9599.         return this.post({
  9600.             headers: {
  9601.                 "X-HTTP-Method": "DELETE",
  9602.             },
  9603.         });
  9604.     };
  9605.     /**
  9606.      * Returns the list view as HTML.
  9607.      *
  9608.      */
  9609.     View.prototype.renderAsHtml = function () {
  9610.         return this.clone(queryable_1.Queryable, "renderashtml", true).get();
  9611.     };
  9612.     return View;
  9613. }(queryable_1.QueryableInstance));
  9614. exports.View = View;
  9615. var ViewFields = (function (_super) {
  9616.     __extends(ViewFields, _super);
  9617.     function ViewFields(baseUrl, path) {
  9618.         if (path === void 0) { path = "viewfields"; }
  9619.         return _super.call(this, baseUrl, path) || this;
  9620.     }
  9621.     /**
  9622.      * Gets a value that specifies the XML schema that represents the collection.
  9623.      */
  9624.     ViewFields.prototype.getSchemaXml = function () {
  9625.         return this.clone(queryable_1.Queryable, "schemaxml", true).get();
  9626.     };
  9627.     /**
  9628.      * Adds the field with the specified field internal name or display name to the collection.
  9629.      *
  9630.      * @param fieldTitleOrInternalName The case-sensitive internal name or display name of the field to add.
  9631.      */
  9632.     ViewFields.prototype.add = function (fieldTitleOrInternalName) {
  9633.         return this.clone(ViewFields, "addviewfield('" + fieldTitleOrInternalName + "')", true).post();
  9634.     };
  9635.     /**
  9636.      * Moves the field with the specified field internal name to the specified position in the collection.
  9637.      *
  9638.      * @param fieldInternalName The case-sensitive internal name of the field to move.
  9639.      * @param index The zero-based index of the new position for the field.
  9640.      */
  9641.     ViewFields.prototype.move = function (fieldInternalName, index) {
  9642.         return this.clone(ViewFields, "moveviewfieldto", true).post({
  9643.             body: JSON.stringify({ "field": fieldInternalName, "index": index }),
  9644.         });
  9645.     };
  9646.     /**
  9647.      * Removes all the fields from the collection.
  9648.      */
  9649.     ViewFields.prototype.removeAll = function () {
  9650.         return this.clone(ViewFields, "removeallviewfields", true).post();
  9651.     };
  9652.     /**
  9653.      * Removes the field with the specified field internal name from the collection.
  9654.      *
  9655.      * @param fieldInternalName The case-sensitive internal name of the field to remove from the view.
  9656.      */
  9657.     ViewFields.prototype.remove = function (fieldInternalName) {
  9658.         return this.clone(ViewFields, "removeviewfield('" + fieldInternalName + "')", true).post();
  9659.     };
  9660.     return ViewFields;
  9661. }(queryable_1.QueryableCollection));
  9662. exports.ViewFields = ViewFields;
  9663.  
  9664.  
  9665. /***/ }),
  9666. /* 50 */
  9667. /***/ (function(module, exports, __webpack_require__) {
  9668.  
  9669. "use strict";
  9670.  
  9671. var __extends = (this && this.__extends) || (function () {
  9672.     var extendStatics = Object.setPrototypeOf ||
  9673.         ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  9674.         function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  9675.     return function (d, b) {
  9676.         extendStatics(d, b);
  9677.         function __() { this.constructor = d; }
  9678.         d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  9679.     };
  9680. })();
  9681. Object.defineProperty(exports, "__esModule", { value: true });
  9682. var queryable_1 = __webpack_require__(1);
  9683. var LimitedWebPartManager = (function (_super) {
  9684.     __extends(LimitedWebPartManager, _super);
  9685.     function LimitedWebPartManager() {
  9686.         return _super !== null && _super.apply(this, arguments) || this;
  9687.     }
  9688.     Object.defineProperty(LimitedWebPartManager.prototype, "webparts", {
  9689.         /**
  9690.          * Gets the set of web part definitions contained by this web part manager
  9691.          *
  9692.          */
  9693.         get: function () {
  9694.             return new WebPartDefinitions(this, "webparts");
  9695.         },
  9696.         enumerable: true,
  9697.         configurable: true
  9698.     });
  9699.     /**
  9700.      * Exports a webpart definition
  9701.      *
  9702.      * @param id the GUID id of the definition to export
  9703.      */
  9704.     LimitedWebPartManager.prototype.export = function (id) {
  9705.         return this.clone(LimitedWebPartManager, "ExportWebPart", true).post({
  9706.             body: JSON.stringify({ webPartId: id }),
  9707.         });
  9708.     };
  9709.     /**
  9710.      * Imports a webpart
  9711.      *
  9712.      * @param xml webpart definition which must be valid XML in the .dwp or .webpart format
  9713.      */
  9714.     LimitedWebPartManager.prototype.import = function (xml) {
  9715.         return this.clone(LimitedWebPartManager, "ImportWebPart", true).post({
  9716.             body: JSON.stringify({ webPartXml: xml }),
  9717.         });
  9718.     };
  9719.     return LimitedWebPartManager;
  9720. }(queryable_1.Queryable));
  9721. exports.LimitedWebPartManager = LimitedWebPartManager;
  9722. var WebPartDefinitions = (function (_super) {
  9723.     __extends(WebPartDefinitions, _super);
  9724.     function WebPartDefinitions() {
  9725.         return _super !== null && _super.apply(this, arguments) || this;
  9726.     }
  9727.     /**
  9728.      * Gets a web part definition from the collection by id
  9729.      *
  9730.      * @param id GUID id of the web part definition to get
  9731.      */
  9732.     WebPartDefinitions.prototype.getById = function (id) {
  9733.         return new WebPartDefinition(this, "getbyid('" + id + "')");
  9734.     };
  9735.     return WebPartDefinitions;
  9736. }(queryable_1.QueryableCollection));
  9737. exports.WebPartDefinitions = WebPartDefinitions;
  9738. var WebPartDefinition = (function (_super) {
  9739.     __extends(WebPartDefinition, _super);
  9740.     function WebPartDefinition() {
  9741.         return _super !== null && _super.apply(this, arguments) || this;
  9742.     }
  9743.     Object.defineProperty(WebPartDefinition.prototype, "webpart", {
  9744.         /**
  9745.          * Gets the webpart information associated with this definition
  9746.          */
  9747.         get: function () {
  9748.             return new WebPart(this);
  9749.         },
  9750.         enumerable: true,
  9751.         configurable: true
  9752.     });
  9753.     /**
  9754.      * Removes a webpart from a page, all settings will be lost
  9755.      */
  9756.     WebPartDefinition.prototype.delete = function () {
  9757.         return this.clone(WebPartDefinition, "DeleteWebPart", true).post();
  9758.     };
  9759.     return WebPartDefinition;
  9760. }(queryable_1.QueryableInstance));
  9761. exports.WebPartDefinition = WebPartDefinition;
  9762. var WebPart = (function (_super) {
  9763.     __extends(WebPart, _super);
  9764.     /**
  9765.      * Creates a new instance of the WebPart class
  9766.      *
  9767.      * @param baseUrl The url or Queryable which forms the parent of this fields collection
  9768.      * @param path Optional, if supplied will be appended to the supplied baseUrl
  9769.      */
  9770.     function WebPart(baseUrl, path) {
  9771.         if (path === void 0) { path = "webpart"; }
  9772.         return _super.call(this, baseUrl, path) || this;
  9773.     }
  9774.     return WebPart;
  9775. }(queryable_1.QueryableInstance));
  9776. exports.WebPart = WebPart;
  9777.  
  9778.  
  9779. /***/ }),
  9780. /* 51 */
  9781. /***/ (function(module, exports, __webpack_require__) {
  9782.  
  9783. "use strict";
  9784.  
  9785. Object.defineProperty(exports, "__esModule", { value: true });
  9786. /**
  9787.  * Reads a blob as text
  9788.  *
  9789.  * @param blob The data to read
  9790.  */
  9791. function readBlobAsText(blob) {
  9792.     return readBlobAs(blob, "string");
  9793. }
  9794. exports.readBlobAsText = readBlobAsText;
  9795. /**
  9796.  * Reads a blob into an array buffer
  9797.  *
  9798.  * @param blob The data to read
  9799.  */
  9800. function readBlobAsArrayBuffer(blob) {
  9801.     return readBlobAs(blob, "buffer");
  9802. }
  9803. exports.readBlobAsArrayBuffer = readBlobAsArrayBuffer;
  9804. /**
  9805.  * Generic method to read blob's content
  9806.  *
  9807.  * @param blob The data to read
  9808.  * @param mode The read mode
  9809.  */
  9810. function readBlobAs(blob, mode) {
  9811.     return new Promise(function (resolve, reject) {
  9812.         try {
  9813.             var reader = new FileReader();
  9814.             reader.onload = function (e) {
  9815.                 resolve(e.target.result);
  9816.             };
  9817.             switch (mode) {
  9818.                 case "string":
  9819.                     reader.readAsText(blob);
  9820.                     break;
  9821.                 case "buffer":
  9822.                     reader.readAsArrayBuffer(blob);
  9823.                     break;
  9824.             }
  9825.         }
  9826.         catch (e) {
  9827.             reject(e);
  9828.         }
  9829.     });
  9830. }
  9831.  
  9832.  
  9833. /***/ })
  9834. /******/ ]);
  9835. });
  9836. //# sourceMappingURL=pnp.js.map
  9837.  
  9838. var pnp = $pnp;
Add Comment
Please, Sign In to add comment