crm-sdk
Version:
Javasript Software Development Kit for Microsoft Dynamics CE Web API
2 lines • 206 kB
JavaScript
/*! CRM SDK 4.0.9 | (c) HSO Innovation */
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("CRMSDK",[],e):"object"==typeof exports?exports.CRMSDK=e():t.CRMSDK=e()}("undefined"!=typeof window?window:this,function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=129)}([function(t,e,n){var r=n(50)("wks"),o=n(26),i=n(2).Symbol,a="function"==typeof i;(t.exports=function(t){return r[t]||(r[t]=a&&i[t]||(a?i:o)("Symbol."+t))}).store=r},function(t,e,n){n(72)("asyncIterator")},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e,n){"use strict";var r=n(2),o=n(15),i=n(12),a=n(10),u=n(18),s=n(40).KEY,c=n(11),f=n(50),l=n(29),p=n(26),h=n(0),y=n(73),v=n(72),d=n(103),g=n(76),b=n(9),m=n(4),w=n(27),x=n(46),_=n(38),k=n(68),O=n(105),S=n(57),E=n(14),P=n(30),R=S.f,j=E.f,A=O.f,T=r.Symbol,L=r.JSON,C=L&&L.stringify,N=h("_hidden"),M=h("toPrimitive"),I={}.propertyIsEnumerable,B=f("symbol-registry"),D=f("symbols"),U=f("op-symbols"),F=Object.prototype,q="function"==typeof T,W=r.QObject,H=!W||!W.prototype||!W.prototype.findChild,V=i&&c(function(){return 7!=k(j({},"a",{get:function(){return j(this,"a",{value:7}).a}})).a})?function(t,e,n){var r=R(F,e);r&&delete F[e],j(t,e,n),r&&t!==F&&j(F,e,r)}:j,Y=function(t){var e=D[t]=k(T.prototype);return e._k=t,e},X=q&&"symbol"==typeof T.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof T},K=function(t,e,n){return t===F&&K(U,e,n),b(t),e=x(e,!0),b(n),o(D,e)?(n.enumerable?(o(t,N)&&t[N][e]&&(t[N][e]=!1),n=k(n,{enumerable:_(0,!1)})):(o(t,N)||j(t,N,_(1,{})),t[N][e]=!0),V(t,e,n)):j(t,e,n)},G=function(t,e){b(t);for(var n,r=d(e=w(e)),o=0,i=r.length;i>o;)K(t,n=r[o++],e[n]);return t},$=function(t){var e=I.call(this,t=x(t,!0));return!(this===F&&o(D,t)&&!o(U,t))&&(!(e||!o(this,t)||!o(D,t)||o(this,N)&&this[N][t])||e)},z=function(t,e){if(t=w(t),e=x(e,!0),t!==F||!o(D,e)||o(U,e)){var n=R(t,e);return!n||!o(D,e)||o(t,N)&&t[N][e]||(n.enumerable=!0),n}},J=function(t){for(var e,n=A(w(t)),r=[],i=0;n.length>i;)o(D,e=n[i++])||e==N||e==s||r.push(e);return r},Q=function(t){for(var e,n=t===F,r=A(n?U:w(t)),i=[],a=0;r.length>a;)!o(D,e=r[a++])||n&&!o(F,e)||i.push(D[e]);return i};q||(u((T=function(){if(this instanceof T)throw TypeError("Symbol is not a constructor!");var t=p(arguments.length>0?arguments[0]:void 0),e=function(n){this===F&&e.call(U,n),o(this,N)&&o(this[N],t)&&(this[N][t]=!1),V(this,t,_(1,n))};return i&&H&&V(F,t,{configurable:!0,set:e}),Y(t)}).prototype,"toString",function(){return this._k}),S.f=z,E.f=K,n(56).f=O.f=J,n(41).f=$,n(55).f=Q,i&&!n(25)&&u(F,"propertyIsEnumerable",$,!0),y.f=function(t){return Y(h(t))}),a(a.G+a.W+a.F*!q,{Symbol:T});for(var Z="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),tt=0;Z.length>tt;)h(Z[tt++]);for(var et=P(h.store),nt=0;et.length>nt;)v(et[nt++]);a(a.S+a.F*!q,"Symbol",{for:function(t){return o(B,t+="")?B[t]:B[t]=T(t)},keyFor:function(t){if(!X(t))throw TypeError(t+" is not a symbol!");for(var e in B)if(B[e]===t)return e},useSetter:function(){H=!0},useSimple:function(){H=!1}}),a(a.S+a.F*!q,"Object",{create:function(t,e){return void 0===e?k(t):G(k(t),e)},defineProperty:K,defineProperties:G,getOwnPropertyDescriptor:z,getOwnPropertyNames:J,getOwnPropertySymbols:Q}),L&&a(a.S+a.F*(!q||c(function(){var t=T();return"[null]"!=C([t])||"{}"!=C({a:t})||"{}"!=C(Object(t))})),"JSON",{stringify:function(t){for(var e,n,r=[t],o=1;arguments.length>o;)r.push(arguments[o++]);if(n=e=r[1],(m(e)||void 0!==t)&&!X(t))return g(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!X(e))return e}),r[1]=e,C.apply(L,r)}}),T.prototype[M]||n(13)(T.prototype,M,T.prototype.valueOf),l(T,"Symbol"),l(Math,"Math",!0),l(r.JSON,"JSON",!0)},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){"use strict";var r,o,i,a,u=n(25),s=n(2),c=n(24),f=n(47),l=n(10),p=n(4),h=n(39),y=n(42),v=n(58),d=n(69),g=n(79).set,b=n(108)(),m=n(80),w=n(109),x=n(110),_=n(111),k=s.TypeError,O=s.process,S=O&&O.versions,E=S&&S.v8||"",P=s.Promise,R="process"==f(O),j=function(){},A=o=m.f,T=!!function(){try{var t=P.resolve(1),e=(t.constructor={})[n(0)("species")]=function(t){t(j,j)};return(R||"function"==typeof PromiseRejectionEvent)&&t.then(j)instanceof e&&0!==E.indexOf("6.6")&&-1===x.indexOf("Chrome/66")}catch(t){}}(),L=function(t){var e;return!(!p(t)||"function"!=typeof(e=t.then))&&e},C=function(t,e){if(!t._n){t._n=!0;var n=t._c;b(function(){for(var r=t._v,o=1==t._s,i=0,a=function(e){var n,i,a,u=o?e.ok:e.fail,s=e.resolve,c=e.reject,f=e.domain;try{u?(o||(2==t._h&&I(t),t._h=1),!0===u?n=r:(f&&f.enter(),n=u(r),f&&(f.exit(),a=!0)),n===e.promise?c(k("Promise-chain cycle")):(i=L(n))?i.call(n,s,c):s(n)):c(r)}catch(t){f&&!a&&f.exit(),c(t)}};n.length>i;)a(n[i++]);t._c=[],t._n=!1,e&&!t._h&&N(t)})}},N=function(t){g.call(s,function(){var e,n,r,o=t._v,i=M(t);if(i&&(e=w(function(){R?O.emit("unhandledRejection",o,t):(n=s.onunhandledrejection)?n({promise:t,reason:o}):(r=s.console)&&r.error&&r.error("Unhandled promise rejection",o)}),t._h=R||M(t)?2:1),t._a=void 0,i&&e.e)throw e.v})},M=function(t){return 1!==t._h&&0===(t._a||t._c).length},I=function(t){g.call(s,function(){var e;R?O.emit("rejectionHandled",t):(e=s.onrejectionhandled)&&e({promise:t,reason:t._v})})},B=function(t){var e=this;e._d||(e._d=!0,(e=e._w||e)._v=t,e._s=2,e._a||(e._a=e._c.slice()),C(e,!0))},D=function(t){var e,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===t)throw k("Promise can't be resolved itself");(e=L(t))?b(function(){var r={_w:n,_d:!1};try{e.call(t,c(D,r,1),c(B,r,1))}catch(t){B.call(r,t)}}):(n._v=t,n._s=1,C(n,!1))}catch(t){B.call({_w:n,_d:!1},t)}}};T||(P=function(t){y(this,P,"Promise","_h"),h(t),r.call(this);try{t(c(D,this,1),c(B,this,1))}catch(t){B.call(this,t)}},(r=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=n(43)(P.prototype,{then:function(t,e){var n=A(d(this,P));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=R?O.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&C(this,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),i=function(){var t=new r;this.promise=t,this.resolve=c(D,t,1),this.reject=c(B,t,1)},m.f=A=function(t){return t===P||t===a?new i(t):o(t)}),l(l.G+l.W+l.F*!T,{Promise:P}),n(29)(P,"Promise"),n(96)("Promise"),a=n(23).Promise,l(l.S+l.F*!T,"Promise",{reject:function(t){var e=A(this);return(0,e.reject)(t),e.promise}}),l(l.S+l.F*(u||!T),"Promise",{resolve:function(t){return _(u&&this===a?P:this,t)}}),l(l.S+l.F*!(T&&n(70)(function(t){P.all(t).catch(j)})),"Promise",{all:function(t){var e=this,n=A(e),r=n.resolve,o=n.reject,i=w(function(){var n=[],i=0,a=1;v(t,!1,function(t){var u=i++,s=!1;n.push(void 0),a++,e.resolve(t).then(function(t){s||(s=!0,n[u]=t,--a||r(n))},o)}),--a||r(n)});return i.e&&o(i.v),n.promise},race:function(t){var e=this,n=A(e),r=n.reject,o=w(function(){v(t,!1,function(t){e.resolve(t).then(n.resolve,r)})});return o.e&&r(o.v),n.promise}})},function(t,e,n){var r=n(10);r(r.S,"Object",{setPrototypeOf:n(78).set})},function(t,e,n){"use strict";n.r(e);n(1),n(3),n(5),n(6),n(86),n(63),n(8),n(33),n(34),n(97),n(98);function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e,n,r,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void n(t)}u.done?e(s):Promise.resolve(s).then(r,o)}function i(t){return function(){var e=this,n=arguments;return new Promise(function(r,i){var a=t.apply(e,n);function u(t){o(a,r,i,u,s,"next",t)}function s(t){o(a,r,i,u,s,"throw",t)}u(void 0)})}}function a(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function u(t,e){return!e||"object"!==r(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function s(t){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function c(t,e){return(c=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var f=function(t){return function(e){function n(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),u(this,s(n).apply(this,arguments))}var r,o,f,l,p;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&c(t,e)}(n,t),r=n,o=null,f=[{key:"executeAction",value:(p=i(regeneratorRuntime.mark(function t(e,n,r,o){var i=arguments;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!r){t.next=4;break}return t.abrupt("return",this.executeBoundAction.apply(this,i));case 4:return t.abrupt("return",this.executeUnboundAction.apply(this,i));case 5:case"end":return t.stop()}},t,this)})),function(t,e,n,r){return p.apply(this,arguments)})},{key:"executeBoundAction",value:(l=i(regeneratorRuntime.mark(function t(e,n,r,o){var i;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getEntitySetName(r);case 2:return i=t.sent,t.abrupt("return",this.requestAndReturnBody("POST","".concat(i,"(").concat(o,")/Microsoft.Dynamics.CRM.").concat(e),n));case 4:case"end":return t.stop()}},t,this)})),function(t,e,n,r){return l.apply(this,arguments)})},{key:"executeUnboundAction",value:function(t,e){return this.requestAndReturnBody("POST","".concat(t),e)}}],o&&a(r.prototype,o),f&&a(r,f),n}()};function l(t){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function p(t,e,n,r,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void n(t)}u.done?e(s):Promise.resolve(s).then(r,o)}function h(t){return function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function a(t){p(i,r,o,a,u,"next",t)}function u(t){p(i,r,o,a,u,"throw",t)}a(void 0)})}}function y(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function v(t,e){return!e||"object"!==l(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function d(t){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function g(t,e){return(g=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var b=function(t){return function(e){function n(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),v(this,d(n).apply(this,arguments))}var r,o,i,a,u;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&g(t,e)}(n,t),r=n,o=null,i=[{key:"associateEntities",value:(u=h(regeneratorRuntime.mark(function t(e,n,r,o,i){var a,u,s;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getEntitySetName(e);case 2:return a=t.sent,u=this.webAPIPath,s={"@odata.id":"".concat(u,"/").concat(o,"(").concat(i,")")},t.abrupt("return",this.requestAndReturnBody("POST","".concat(a,"(").concat(n,")/").concat(r,"/$ref"),s));case 6:case"end":return t.stop()}},t,this)})),function(t,e,n,r,o){return u.apply(this,arguments)})},{key:"disassociateEntities",value:(a=h(regeneratorRuntime.mark(function t(e,n,r){var o,i,a,u=arguments;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return o=u.length>3&&void 0!==u[3]?u[3]:"",t.next=3,this.getEntitySetName(e);case 3:return i=t.sent,a="",o&&(a="(".concat(o,")")),t.abrupt("return",this.requestAndReturnBody("DELETE","".concat(i,"(").concat(n,")/").concat(r).concat(a,"/$ref")));case 7:case"end":return t.stop()}},t,this)})),function(t,e,n){return a.apply(this,arguments)})}],o&&y(r.prototype,o),i&&y(r,i),n}()},m=n(65),w=n(35);function x(t){return(x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _(t,e,n,r,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void n(t)}u.done?e(s):Promise.resolve(s).then(r,o)}function k(t){return function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function a(t){_(i,r,o,a,u,"next",t)}function u(t){_(i,r,o,a,u,"throw",t)}a(void 0)})}}function O(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function S(t,e){return!e||"object"!==x(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function E(t){return(E=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function P(t,e){return(P=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var R=function(t){return function(e){function n(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),S(this,E(n).apply(this,arguments))}var r,o,i,a,u;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&P(t,e)}(n,t),r=n,o=null,i=[{key:"createRecord",value:(u=k(regeneratorRuntime.mark(function t(e,n){var r;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if("undefined"==typeof window||!window.Xrm||!window.Xrm.WebApi){t.next=4;break}return t.abrupt("return",window.Xrm.WebApi.createRecord(e,n));case 4:return t.next=6,this.getEntitySetName(e);case 6:return r=t.sent,t.next=9,this.requestAndReturnBody("POST","".concat(r),n,{Prefer:"return=representation"});case 9:return t.abrupt("return",t.sent);case 10:case"end":return t.stop()}},t,this)})),function(t,e){return u.apply(this,arguments)})},{key:"createEntity",value:(a=k(regeneratorRuntime.mark(function t(e,n){var r;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return console.log("Deprecated: use WebApi.createRecord instead"),t.next=3,this.getEntitySetName(e);case 3:return r=t.sent,t.next=6,this.requestAndReturnBody("POST","".concat(r),n,{Prefer:"return=representation"});case 6:return t.abrupt("return",t.sent);case 7:case"end":return t.stop()}},t,this)})),function(t,e){return a.apply(this,arguments)})},{key:"getEntityIdFromHeader",value:function(t){return/\(([^)]+)\)/.exec(t)[1]}}],o&&O(r.prototype,o),i&&O(r,i),n}()};function j(t){return(j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function A(t,e,n,r,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void n(t)}u.done?e(s):Promise.resolve(s).then(r,o)}function T(t){return function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function a(t){A(i,r,o,a,u,"next",t)}function u(t){A(i,r,o,a,u,"throw",t)}a(void 0)})}}function L(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function C(t,e){return!e||"object"!==j(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function N(t){return(N=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function M(t,e){return(M=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var I=function(t){return function(e){function n(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),C(this,N(n).apply(this,arguments))}var r,o,i,a,u;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&M(t,e)}(n,t),r=n,o=null,i=[{key:"deleteRecord",value:(u=T(regeneratorRuntime.mark(function t(e,n){var r;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if("undefined"==typeof window||!window.Xrm||!window.Xrm.WebApi){t.next=4;break}return t.abrupt("return",window.Xrm.WebApi.deleteRecord(e,n));case 4:return t.next=6,this.getEntitySetName(e);case 6:return r=t.sent,t.abrupt("return",this.request("DELETE","".concat(r,"(").concat(n,")")));case 8:case"end":return t.stop()}},t,this)})),function(t,e){return u.apply(this,arguments)})},{key:"deleteEntity",value:(a=T(regeneratorRuntime.mark(function t(e,n){var r;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return console.log("Deprecated: use WebApi.deleteRecord instead"),t.next=3,this.getEntitySetName(e);case 3:return r=t.sent,t.abrupt("return",this.request("DELETE","".concat(r,"(").concat(n,")")));case 5:case"end":return t.stop()}},t,this)})),function(t,e){return a.apply(this,arguments)})}],o&&L(r.prototype,o),i&&L(r,i),n}()};function B(t){return(B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function D(t,e,n,r,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void n(t)}u.done?e(s):Promise.resolve(s).then(r,o)}function U(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function F(t,e){return!e||"object"!==B(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function q(t){return(q=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function W(t,e){return(W=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var H=function(t){return function(e){function n(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),F(this,q(n).apply(this,arguments))}var r,o,i,a,u;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&W(t,e)}(n,t),r=n,o=null,i=[{key:"executeFunction",value:function(t,e,n){return e?this.executeBoundFunction.apply(this,arguments):this.executeUnboundFunction.apply(this,arguments)}},{key:"executeBoundFunction",value:(a=regeneratorRuntime.mark(function t(e,n,r){var o;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getEntitySetName(n);case 2:return o=t.sent,t.abrupt("return",this.requestAndReturnBody("GET","".concat(o,"(").concat(r,")/Microsoft.Dynamics.CRM.").concat(e)));case 4:case"end":return t.stop()}},t,this)}),u=function(){var t=this,e=arguments;return new Promise(function(n,r){var o=a.apply(t,e);function i(t){D(o,n,r,i,u,"next",t)}function u(t){D(o,n,r,i,u,"throw",t)}i(void 0)})},function(t,e,n){return u.apply(this,arguments)})},{key:"executeUnboundFunction",value:function(t){return this.requestAndReturnBody("GET","".concat(t))}}],o&&U(r.prototype,o),i&&U(r,i),n}()},V=n(22);n(59),n(60);function Y(t){return(Y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function X(t,e,n,r,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void n(t)}u.done?e(s):Promise.resolve(s).then(r,o)}function K(t){return function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function a(t){X(i,r,o,a,u,"next",t)}function u(t){X(i,r,o,a,u,"throw",t)}a(void 0)})}}function G(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function $(t,e){return!e||"object"!==Y(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function z(t){return(z=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function J(t,e){return(J=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Q=function(t){return function(e){function n(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),$(this,z(n).apply(this,arguments))}var r,o,i,a,u,s,c,f,l;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&J(t,e)}(n,t),r=n,o=null,i=[{key:"retrieveRecord",value:(l=K(regeneratorRuntime.mark(function t(e,n,r){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if("undefined"==typeof window||!window.Xrm||!window.Xrm.WebApi){t.next=4;break}return t.abrupt("return",window.Xrm.WebApi.retrieveRecord(e,n,r));case 4:return t.abrupt("return",this.retrieveEntity(e,n,r.substr(1)));case 5:case"end":return t.stop()}},t,this)})),function(t,e,n){return l.apply(this,arguments)})},{key:"retrieveEntity",value:(f=K(regeneratorRuntime.mark(function t(e,n,r,o){var i;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getEntitySetName(e);case 2:return i=t.sent,t.abrupt("return",this.retrieveEntitySet(i,n,r,o));case 4:case"end":return t.stop()}},t,this)})),function(t,e,n,r){return f.apply(this,arguments)})},{key:"retrieveEntitySet",value:function(t,e,n,r){var o=this.buildQueryString(n),i=e?this.parseEntityId(e):null,a="".concat(t);return i&&(a+="(".concat(i,")")),a+="".concat(o),this.requestAndReturnBody("GET",a,null,r)}},{key:"retrieveMultipleRecords",value:(c=K(regeneratorRuntime.mark(function t(e,n,r){var o;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if("undefined"==typeof window||!window.Xrm||!window.Xrm.WebApi){t.next=4;break}return t.abrupt("return",window.Xrm.WebApi.retrieveMultipleRecords(e,n,r));case 4:return o=r?{Prefer:"odata.maxpagesize=".concat(r)}:{},t.abrupt("return",this.retrieveMultiple(e,n.substr(1),o));case 6:case"end":return t.stop()}},t,this)})),function(t,e,n){return c.apply(this,arguments)})},{key:"retrieveMultiple",value:(s=K(regeneratorRuntime.mark(function t(e,n,r){var o,i,a=this;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getEntitySetName(e);case 2:return o=t.sent,i=this.buildQueryString(n),t.abrupt("return",this.requestAndReturnBody("GET","".concat(o).concat(i),null,r).then(function(){var t=K(regeneratorRuntime.mark(function t(e){var n,o;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(n=r&&r.Prefer&&r.Prefer.includes("odata.maxpagesize"),!e["@odata.nextLink"]||n){t.next=7;break}return t.next=4,a.requestNextLinks(e["@odata.nextLink"]);case 4:o=t.sent,e.value=e.value.concat(o),delete e["@odata.nextLink"];case 7:return t.abrupt("return",e);case 8:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()));case 5:case"end":return t.stop()}},t,this)})),function(t,e,n){return s.apply(this,arguments)})},{key:"requestNextLinks",value:function(t){var e,n=this,r=[];return this.requestAndReturnBody("GET",decodeURI(t)).then((e=K(regeneratorRuntime.mark(function t(e){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.value,!e["@odata.nextLink"]){t.next=7;break}return t.t0=r,t.next=5,n.requestNextLinks(e["@odata.nextLink"]);case 5:t.t1=t.sent,r=t.t0.concat.call(t.t0,t.t1);case 7:return t.abrupt("return",r);case 8:case"end":return t.stop()}},t,this)})),function(t){return e.apply(this,arguments)}))}},{key:"executeFetchXml",value:(u=K(regeneratorRuntime.mark(function t(e,n){var r,o=this;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getEntitySetName(e);case 2:return r=t.sent,t.abrupt("return",this.requestAndReturnBody("GET","".concat(r,"?fetchXml=").concat(n)).then(function(){var t=K(regeneratorRuntime.mark(function t(e){var n;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!e["@odata.nextLink"]){t.next=6;break}return t.next=3,o.requestNextLinks(e["@odata.nextLink"]);case 3:n=t.sent,e.value=e.value.concat(n),delete e["@odata.nextLink"];case 6:return t.abrupt("return",e);case 7:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()));case 4:case"end":return t.stop()}},t,this)})),function(t,e){return u.apply(this,arguments)})},{key:"count",value:(a=K(regeneratorRuntime.mark(function t(e){var n,r;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getEntitySetName(e);case 2:return n=t.sent,t.next=5,this.requestAndReturnBody("GET","".concat(n,"/$count"));case 5:return r=t.sent,t.abrupt("return",r);case 7:case"end":return t.stop()}},t,this)})),function(t){return a.apply(this,arguments)})}],o&&G(r.prototype,o),i&&G(r,i),n}()},Z=(n(91),n(93));function tt(t){return(tt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function et(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function nt(t,e){return!e||"object"!==tt(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function rt(t){return(rt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ot(t,e){return(ot=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var it=function(t){return function(e){function n(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),nt(this,rt(n).apply(this,arguments))}var r,o,i;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ot(t,e)}(n,t),r=n,i=[{key:"request",value:function(t,e,n){var r,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=this.webAPIPath,a=this.bearer?Object.assign({},o,{Authorization:"Bearer ".concat(this.bearer)}):o;return r=0===e.indexOf("http")?e:"".concat(i,"/").concat(e),Object(Z.a)(r,t,n,a)}},{key:"requestAndReturnBody",value:function(t,e,n,r){return this.request(t,e,n,r).then(function(t){return t.body})}},{key:"requestAndReturnHeader",value:function(t,e,n,r){return this.request(t,e,n).then(function(t){return t.getResponseHeader(r)})}}],(o=null)&&et(r.prototype,o),i&&et(r,i),n}()};function at(t){return(at="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ut(t,e,n,r,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void n(t)}u.done?e(s):Promise.resolve(s).then(r,o)}function st(t){return function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function a(t){ut(i,r,o,a,u,"next",t)}function u(t){ut(i,r,o,a,u,"throw",t)}a(void 0)})}}function ct(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function ft(t,e){return!e||"object"!==at(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function lt(t){return(lt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function pt(t,e){return(pt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var ht=function(t){return function(e){function n(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),ft(this,lt(n).apply(this,arguments))}var r,o,i,a,u;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&pt(t,e)}(n,t),r=n,o=null,i=[{key:"updateRecord",value:(u=st(regeneratorRuntime.mark(function t(e,n,r){var o;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if("undefined"==typeof window||!window.Xrm||!window.Xrm.WebApi){t.next=4;break}return t.abrupt("return",window.Xrm.WebApi.updateRecord(e,n,r));case 4:return t.next=6,this.getEntitySetName(e);case 6:return o=t.sent,t.abrupt("return",this.request("PATCH","".concat(o,"(").concat(n,")"),r));case 8:case"end":return t.stop()}},t,this)})),function(t,e,n){return u.apply(this,arguments)})},{key:"updateEntity",value:(a=st(regeneratorRuntime.mark(function t(e,n,r){var o;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return console.log("Deprecated: use WebApi.updateRecord instead"),t.next=3,this.getEntitySetName(e);case 3:return o=t.sent,t.abrupt("return",this.request("PATCH","".concat(o,"(").concat(n,")"),r));case 5:case"end":return t.stop()}},t,this)})),function(t,e,n){return a.apply(this,arguments)})}],o&&ct(r.prototype,o),i&&ct(r,i),n}()};function yt(t){return(yt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function vt(t,e,n,r,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void n(t)}u.done?e(s):Promise.resolve(s).then(r,o)}function dt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function gt(t,e){return!e||"object"!==yt(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function bt(t){return(bt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function mt(t,e){return(mt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}n.d(e,"WebAPI",function(){return xt});var wt=new WeakMap;"undefined"!=typeof window&&void 0===window.Xrm&&void 0!==window.parent.Xrm&&(window.Xrm=window.parent.Xrm);var xt=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),gt(this,bt(e).apply(this,arguments))}var n,r,o;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&mt(t,e)}(e,f(b(R(I(H(Q(it(ht(m["a"]))))))))),n=e,r=null,o=[{key:"getEntityDefinitions",value:function(t){return V.a.getEntityDefinitions(t)}},{key:"getEntitySetName",value:function(){var t,e=(t=regeneratorRuntime.mark(function t(e){var n;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getEntityDefinitions(e);case 2:return n=t.sent,t.abrupt("return",n.EntitySetName);case 4:case"end":return t.stop()}},t,this)}),function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function a(t){vt(i,r,o,a,u,"next",t)}function u(t){vt(i,r,o,a,u,"throw",t)}a(void 0)})});return function(t){return e.apply(this,arguments)}}()},{key:"getOptionSet",value:function(t,e){return V.a.getOptionSet(t,e)}},{key:"parseEntityId",value:function(t){var e=t;if("object"===yt(t)){var n=[];for(var r in t)t.hasOwnProperty(r)&&n.push("".concat(r,"='").concat(t[r],"'"));e=n.join(",")}else t.startsWith("{")&&t.endsWith("}")&&(e=e.substr(1,e.length-2));return e}},{key:"buildQueryString",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=[];if("string"==typeof t)e.push(t);else{var n;if(t.select)n="object"===yt(t.select)?t.select.join(","):t.select,e.push("$select=".concat(n));t.top&&e.push("$top=".concat(t.top)),t.count&&e.push("$count=".concat(t.count))}return e.length?"?"+e.join("&"):""}},{key:"webAPIPath",get:function(){var t=w.a.version;return"".concat(w.a.clientUrl,"/api/data/").concat(t)}},{key:"bearer",get:function(){return wt.get(this)},set:function(t){wt.set(this,t)}}],r&&dt(n.prototype,r),o&&dt(n,o),e}();e.default=xt;"function"==typeof define&&define(function(){return xt})},function(t,e){!function(e){"use strict";var n,r=Object.prototype,o=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag",c="object"==typeof t,f=e.regeneratorRuntime;if(f)c&&(t.exports=f);else{(f=e.regeneratorRuntime=c?t.exports:{}).wrap=w;var l="suspendedStart",p="suspendedYield",h="executing",y="completed",v={},d={};d[a]=function(){return this};var g=Object.getPrototypeOf,b=g&&g(g(T([])));b&&b!==r&&o.call(b,a)&&(d=b);var m=O.prototype=_.prototype=Object.create(d);k.prototype=m.constructor=O,O.constructor=k,O[s]=k.displayName="GeneratorFunction",f.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===k||"GeneratorFunction"===(e.displayName||e.name))},f.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,O):(t.__proto__=O,s in t||(t[s]="GeneratorFunction")),t.prototype=Object.create(m),t},f.awrap=function(t){return{__await:t}},S(E.prototype),E.prototype[u]=function(){return this},f.AsyncIterator=E,f.async=function(t,e,n,r){var o=new E(w(t,e,n,r));return f.isGeneratorFunction(e)?o:o.next().then(function(t){return t.done?t.value:o.next()})},S(m),m[s]="Generator",m[a]=function(){return this},m.toString=function(){return"[object Generator]"},f.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},f.values=T,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(j),!t)for(var e in this)"t"===e.charAt(0)&&o.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=n)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,o){return u.type="throw",u.arg=t,e.next=r,o&&(e.method="next",e.arg=n),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var s=o.call(a,"catchLoc"),c=o.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),j(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;j(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:T(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=n),v}}}function w(t,e,n,r){var o=e&&e.prototype instanceof _?e:_,i=Object.create(o.prototype),a=new A(r||[]);return i._invoke=function(t,e,n){var r=l;return function(o,i){if(r===h)throw new Error("Generator is already running");if(r===y){if("throw"===o)throw i;return L()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var u=P(a,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===l)throw r=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=h;var s=x(t,e,n);if("normal"===s.type){if(r=n.done?y:p,s.arg===v)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r=y,n.method="throw",n.arg=s.arg)}}}(t,n,a),i}function x(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}function _(){}function k(){}function O(){}function S(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function E(t){var e;this._invoke=function(n,r){function i(){return new Promise(function(e,i){!function e(n,r,i,a){var u=x(t[n],t,r);if("throw"!==u.type){var s=u.arg,c=s.value;return c&&"object"==typeof c&&o.call(c,"__await")?Promise.resolve(c.__await).then(function(t){e("next",t,i,a)},function(t){e("throw",t,i,a)}):Promise.resolve(c).then(function(t){s.value=t,i(s)},a)}a(u.arg)}(n,r,e,i)})}return e=e?e.then(i,i):i()}}function P(t,e){var r=t.iterator[e.method];if(r===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=n,P(t,e),"throw"===e.method))return v;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var o=x(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,v;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=n),e.delegate=null,v):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,v)}function R(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(R,this),this.reset(!0)}function T(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r<t.length;)if(o.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=n,e.done=!0,e};return i.next=i}}return{next:L}}function L(){return{value:n,done:!0}}}(function(){return this}()||Function("return this")())},function(t,e,n){var r=n(4);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e,n){var r=n(2),o=n(23),i=n(13),a=n(18),u=n(24),s=function(t,e,n){var c,f,l,p,h=t&s.F,y=t&s.G,v=t&s.S,d=t&s.P,g=t&s.B,b=y?r:v?r[e]||(r[e]={}):(r[e]||{}).prototype,m=y?o:o[e]||(o[e]={}),w=m.prototype||(m.prototype={});for(c in y&&(n=e),n)l=((f=!h&&b&&void 0!==b[c])?b:n)[c],p=g&&f?u(l,r):d&&"function"==typeof l?u(Function.call,l):l,b&&a(b,c,l,t&s.U),m[c]!=l&&i(m,c,p),d&&w[c]!=l&&(w[c]=l)};r.core=o,s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,t.exports=s},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,n){t.exports=!n(11)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e,n){var r=n(14),o=n(38);t.exports=n(12)?function(t,e,n){return r.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var r=n(9),o=n(74),i=n(46),a=Object.defineProperty;e.f=n(12)?Object.defineProperty:function(t,e,n){if(r(t),e=i(e,!0),r(n),o)try{return a(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){var r=n(37),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},function(t,e,n){var r=n(142);t.exports=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),o.forEach(function(e){r(t,e,n[e])})}return t}},function(t,e,n){var r=n(2),o=n(13),i=n(15),a=n(26)("src"),u=Function.toString,s=(""+u).split("toString");n(23).inspectSource=function(t){return u.call(t)},(t.exports=function(t,e,n,u){var c="function"==typeof n;c&&(i(n,"name")||o(n,"name",e)),t[e]!==n&&(c&&(i(n,a)||o(n,a,t[e]?""+t[e]:s.join(String(e)))),t===r?t[e]=n:u?t[e]?t[e]=n:o(t,e,n):(delete t[e],o(t,e,n)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[a]||u.call(this)})},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e){function n(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}t.exports=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t}},function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}},function(t,e,n){"use strict";n(5),n(1),n(3),n(33),n(8);var r=n(7);function o(t,e,n,r,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void n(t)}u.done?e(s):Promise.resolve(s).then(r,o)}function i(t){return function(){var e=this,n=arguments;return new Promise(function(r,i){var a=t.apply(e,n);function u(t){o(a,r,i,u,s,"next",t)}function s(t){o(a,r,i,u,s,"throw",t)}u(void 0)})}}function a(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var u=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,n,o;return e=t,n=null,o=[{key:"getEntityDefinitions",value:function(){var t=i(regeneratorRuntime.mark(function t(e){var n=this;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if("string"==typeof e){t.next=2;break}throw Error("Invalid logicalName given");case 2:if(!this.cachedEntityDefinitions[e]){t.next=4;break}return t.abrupt("return",this.cachedEntityDefinitions[e]);case 4:return this.cachedEntityDefinitionsPromises[e]||(this.cachedEntityDefinitionsPromises[e]=r.default.retrieveEntitySet("EntityDefinitions",null,"$filter=LogicalName eq '".concat(e,"'&$expand=Attributes,ManyToOneRelationships")).then(function(t){var r=t.value[0];return n.cachedEntityDefinitions[e]=r,r})),t.abrupt("return",this.cachedEntityDefinitionsPromises[e]);case 6:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"getCachedEntityDefinitions",value:function(t){return this.cachedEntityDefinitions[t]}},{key:"getOptionSet",value:function(){var t=i(regeneratorRuntime.mark(function t(e,n){var r,o,i,a,u,s,c,f;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getEntityDefinitions(e);case 2:r=t.sent,o=!0,i=!1,a=void 0,t.prev=6,u=r.Attributes[Symbol.iterator]();case 8:if(o=(s=u.next()).done){t.next=22;break}if((c=s.value).LogicalName!==n){t.next=19;break}if("Picklist"!==(f=c.AttributeType)){t.next=16;break}return t.abrupt("return",this.getPicklistOptionSet(e,n));case 16:if("Boolean"!==f){t.next=18;break}return t.abrupt("return",this.getBooleanOptionSet(e,n));case 18:return t.abrupt("break",22);case 19:o=!0,t.next=8;break;case 22:t.next=28;break;case 24:t.prev=24,t.t0=t.catch(6),i=!0,a=t.t0;case 28:t.prev=28,t.prev=29,o||null==u.return||u.return();case 31:if(t.prev=31,!i){t.next=34;break}throw a;case 34:return t.finish(31);case 35:return t.finish(28);case 36:return t.abrupt("return",[]);case 37:case"end":return t.stop()}},t,this,[[6,24,28,36],[29,,31,35]])}));return function(e,n){return t.apply(this,arguments)}}()},{key:"getPicklistOptionSet",value:function(){var t=i(regeneratorRuntime.mark(function t(e,n){var o,i;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,r.default.retrieveEntitySet("EntityDefinitions(LogicalName='".concat(e,"')/Attributes(LogicalName='").concat(n,"')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata"),null,"$select=LogicalName&$expand=OptionSet");case 2:return o=t.sent,i=o.OptionSet.Options.map(function(t){return{value:t.Value,externalValue:t.ExternalValue,label:t.Label.UserLocalizedLabel.Label}}),t.abrupt("return",i);case 5:case"end":return t.stop()}},t,this)}));return function(e,n){return t.apply(this,arguments)}}()},{key:"getBooleanOptionSet",value:function(){var t=i(regeneratorRuntime.mark(function t(e,n){var o,i,a,u,s;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,r.default.retrieveEntitySet("EntityDefinitions(LogicalName='".concat(e,"')/Attributes(LogicalName='").concat(n,"')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata"),null,"$select=LogicalName&$expand=OptionSet");case 2:return o=t.sent,i=o.OptionSet,a=i.FalseOption,u=i.TrueOption,(s=[]).push({value:a.Value,label:a.Label.UserLocalizedLabel.Label}),s.push({value:u.Value,label:u.Label.UserLocalizedLabel.Label}),t.abrupt("return",s);case 10:case"end":return t.stop()}},t,this)}));return function(e,n){return t.apply(this,arguments)}}()},{key:"cachedEntityDefinitions",get:function(){return this.entityDef||(this.entityDef={}),this.entityDef}},{key:"cachedEntityDefinitionsPromises",get:function(){return this.entityDefProms||(this.entityDefProms={}),this.entityDefProms}}],n&&a(e.prototype,n),o&&a(e,o),t}();e.a=u},function(t,e){var n=t.exports={version:"2.6.1"};"number"==typeof __e&&(__e=n)},function(t,e,n){var r=n(39);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}}},function(t,e){t.exports=!1},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e,n){var r=n(52),o=n(36);t.exports=function(t){return r(o(t))}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e,n){var r=n(14).f,o=n(15),i=n(0)("toStringTag");t.exports=function(t,e,n){t&&!o(t=n?t:t.prototype,i)&&r(t,i,{configurable:!0,value:e})}},function(t,e,n){var r=n(75),o=n(54);t.exports=Object.keys||function(t){return r(t,o)}},function(t,e){t.exports={}},function(t,e,n){var r=n(36);t.exports=function(t){return Object(r(t))}},function(t,e,n){for(var r=n(34),o=n(30),i=n(18),a=n(2),u=n(13),s=n(31),c=n(0),f=c("iterator"),l=c("toStringTag"),p=s.Array,h={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},y=o(h),v=0;v<y.length;v++){