wstrade-api-amin
Version:
Wealthsimple Trade API Wrapper
2 lines • 196 kB
JavaScript
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("source-map-support"),require("node-fetch"),require("cloudscraper")):"function"==typeof define&&define.amd?define(["source-map-support","node-fetch","cloudscraper"],t):"object"==typeof exports?exports["wstrade-api"]=t(require("source-map-support"),require("node-fetch"),require("cloudscraper")):e["wstrade-api"]=t(e._,e._,e._)}(global,(function(e,t,r){return(()=>{var n={228:e=>{e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}},858:e=>{e.exports=function(e){if(Array.isArray(e))return e}},646:(e,t,r)=>{var n=r(228);e.exports=function(e){if(Array.isArray(e))return n(e)}},926:e=>{function t(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}e.exports=function(e){return function(){var r=this,n=arguments;return new Promise((function(i,a){var o=e.apply(r,n);function s(e){t(o,i,a,s,u,"next",e)}function u(e){t(o,i,a,s,u,"throw",e)}s(void 0)}))}}},575:e=>{e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},913:e=>{function t(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}},713:e=>{e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}},860:e=>{e.exports=function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}},884:e=>{e.exports=function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!t||r.length!==t);n=!0);}catch(e){i=!0,a=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}return r}}},521:e=>{e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},206:e=>{e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},38:(e,t,r)=>{var n=r(858),i=r(884),a=r(379),o=r(521);e.exports=function(e,t){return n(e)||i(e,t)||a(e,t)||o()}},319:(e,t,r)=>{var n=r(646),i=r(860),a=r(379),o=r(206);e.exports=function(e){return n(e)||i(e)||a(e)||o()}},379:(e,t,r)=>{var n=r(228);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}},757:(e,t,r)=>{e.exports=r(666)},391:(e,t,r)=>{"use strict";r.d(t,{Z:()=>v});var n=r(319),i=r.n(n),a=r(757),o=r.n(a),s=r(926),u=r.n(s),c=r(575),l=r.n(c),h=r(913),p=r.n(h),f=r(726),d=99,y=["sell","deposit","withdrawal","dividend","institutional_transfer","internal_transfer","refund","referral_bonus","affiliate","buy"];const v=function(){function e(t){l()(this,e),this.worker=t}var t,r,n,a,s,c,h,v,m;return p()(e,[{key:"all",value:(m=u()(o().mark((function e(){var t;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.worker.handleRequest(f.Z.ACCOUNT_IDS,{});case 2:return t=e.sent,e.abrupt("return",{tfsa:t.find((function(e){return e.startsWith("tfsa")})),rrsp:t.find((function(e){return e.startsWith("rrsp")})),crypto:t.find((function(e){return e.startsWith("non-registered-crypto")})),personal:t.find((function(e){return e.startsWith("non-registered")&&!e.startsWith("non-registered-crypto")}))});case 4:case"end":return e.stop()}}),e,this)}))),function(){return m.apply(this,arguments)})},{key:"data",value:(v=u()(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.worker.handleRequest(f.Z.LIST_ACCOUNT,{}));case 1:case"end":return e.stop()}}),e,this)}))),function(){return v.apply(this,arguments)})},{key:"me",value:(h=u()(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.worker.handleRequest(f.Z.ME,{}));case 1:case"end":return e.stop()}}),e,this)}))),function(){return h.apply(this,arguments)})},{key:"person",value:(c=u()(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.worker.handleRequest(f.Z.PERSON,{}));case 1:case"end":return e.stop()}}),e,this)}))),function(){return c.apply(this,arguments)})},{key:"history",value:(s=u()(o().mark((function e(t,r){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.worker.handleRequest(f.Z.HISTORY_ACCOUNT,{interval:t,accountId:r}));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return s.apply(this,arguments)})},{key:"activities",value:(a=u()(o().mark((function e(){var t,r,n,a,s,u,c,l,h,p,v=arguments;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(null!=(s=v.length>0&&void 0!==v[0]?v[0]:{})&&s.limit&&s.limit>d)){e.next=3;break}throw new Error("filters.limit can not exceed 99! Leave filters.limit undefined if you want to retrieve all.");case 3:if(null==s||!s.accounts||Array.isArray(s.accounts)){e.next=5;break}throw new Error("filters.accounts must be an array!");case 5:if(null==s||!s.type||Array.isArray(s.type)){e.next=7;break}throw new Error("filters.type must be an array!");case 7:return u=[],e.next=10,this.worker.handleRequest(f.Z.ACTIVITIES,{limit:null!==(t=null==s?void 0:s.limit)&&void 0!==t?t:d,accountIds:null!==(r=null==s||null===(n=s.accounts)||void 0===n?void 0:n.join())&&void 0!==r?r:"",bookmark:"",type:null!==(a=null==s?void 0:s.type)&&void 0!==a?a:y});case 10:if(c=e.sent,u.push.apply(u,i()(c.results)),null!=s&&s.limit){e.next=22;break}case 13:if(u.length%d!=0){e.next=22;break}return e.next=16,this.worker.handleRequest(f.Z.ACTIVITIES,{limit:d,accountIds:null!==(l=null==s||null===(h=s.accounts)||void 0===h?void 0:h.join())&&void 0!==l?l:"",bookmark:c.bookmark,type:null!==(p=null==s?void 0:s.type)&&void 0!==p?p:y});case 16:if(0!==(c=e.sent).results.length){e.next=19;break}return e.abrupt("break",22);case 19:u.push.apply(u,i()(c.results)),e.next=13;break;case 22:return e.abrupt("return",u);case 23:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"getBankAccounts",value:(n=u()(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.worker.handleRequest(f.Z.BANK_ACCOUNTS,{}));case 1:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"deposits",value:(r=u()(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.worker.handleRequest(f.Z.DEPOSITS,{}));case 1:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"positions",value:(t=u()(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.worker.handleRequest(f.Z.POSITIONS,{accountId:t}));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),e}()},726:(e,t,r)=>{"use strict";r.d(t,{Z:()=>i});var n={onFailure:function(e){return{status:e.statusCode,reason:e.statusMessage,body:e.body}},onSuccess:function(e){return e.body}};const i={LOGIN:{method:"POST",url:"https://trade-service.wealthsimple.com/auth/login",authenticated:!1,onSuccess:function(e){return{tokens:{access:e.headers["x-access-token"],refresh:e.headers["x-refresh-token"],expires:parseInt(e.headers["x-access-token-expires"],10)},accountInfo:e.body}},onFailure:n.onFailure},REFRESH:{method:"POST",url:"https://trade-service.wealthsimple.com/auth/refresh",authenticated:!1,onSuccess:function(e){return{tokens:{access:e.headers["x-access-token"],refresh:e.headers["x-refresh-token"],expires:parseInt(e.headers["x-access-token-expires"],10)}}},onFailure:n.onFailure},ACCOUNT_IDS:{method:"GET",url:"https://trade-service.wealthsimple.com/account/list",authenticated:!0,onSuccess:function(e){return e.body.results.map((function(e){return e.id}))},onFailure:n.onFailure},LIST_ACCOUNT:{method:"GET",url:"https://trade-service.wealthsimple.com/account/list",authenticated:!0,onSuccess:function(e){return e.body.results},onFailure:n.onFailure},ME:{method:"GET",url:"https://trade-service.wealthsimple.com/me",authenticated:!0,onSuccess:n.onSuccess,onFailure:n.onFailure},PERSON:{method:"GET",url:"https://trade-service.wealthsimple.com/person",authenticated:!0,onSuccess:n.onSuccess,onFailure:n.onFailure},HISTORY_ACCOUNT:{method:"GET",url:"https://trade-service.wealthsimple.com/account/history/{0}?account_id={1}",authenticated:!0,parameters:{0:"interval",1:"accountId"},onSuccess:n.onSuccess,onFailure:n.onFailure},ACTIVITIES:{method:"GET",url:"https://trade-service.wealthsimple.com/account/activities?limit={0}&account_ids={1}&[2]&bookmark={3}",authenticated:!0,parameters:{0:"limit",1:"accountIds",2:"type",3:"bookmark"},onSuccess:n.onSuccess,onFailure:n.onFailure},DEPOSITS:{method:"GET",url:"https://trade-service.wealthsimple.com/deposits",authenticated:!0,onSuccess:function(e){return e.body.results},onFailure:n.onFailure},BANK_ACCOUNTS:{method:"GET",url:"https://trade-service.wealthsimple.com/bank-accounts",authenticated:!0,onSuccess:function(e){return e.body.results},onFailure:n.onFailure},EXCHANGE_RATES:{method:"GET",url:"https://trade-service.wealthsimple.com/forex",authenticated:!0,onSuccess:n.onSuccess,onFailure:n.onFailure},SECURITY:{method:"GET",url:"https://trade-service.wealthsimple.com/securities?query={0}",authenticated:!0,parameters:{0:"ticker"},onSuccess:function(e){var t=e.body;if(0===t.results.length)throw new Error("Security does not exist");return t.results},onFailure:n.onFailure},EXTENSIVE_SECURITY_DETAILS:{method:"GET",url:"https://trade-service.wealthsimple.com/securities/{0}",authenticated:!0,parameters:{0:"id"},onSuccess:n.onSuccess,onFailure:n.onFailure},SECURITY_GROUPS:{method:"GET",url:"https://trade-service.wealthsimple.com/security-groups?limit=99",authenticated:!0,onSuccess:function(e){return e.body.results},onFailure:n.onFailure},SECURITY_GROUP:{method:"GET",url:"https://trade-service.wealthsimple.com/security-groups/{0}/securities",authenticated:!0,parameters:{0:"groupId"},onSuccess:function(e){return e.body.results},onFailure:n.onFailure},QUOTES_HISTORY:{method:"GET",url:"https://trade-service.wealthsimple.com/securities/{0}/historical_quotes/{1}?mic=XNAS",authenticated:!0,parameters:{0:"id",1:"interval"},onSuccess:n.onSuccess,onFailure:n.onFailure},POSITIONS:{method:"GET",url:"https://trade-service.wealthsimple.com/account/positions?account_id={0}",authenticated:!0,parameters:{0:"accountId"},onSuccess:function(e){return e.body.results},onFailure:n.onFailure},ORDERS_BY_PAGE:{method:"GET",url:"https://trade-service.wealthsimple.com/orders?offset={0}&account_id={1}",authenticated:!0,parameters:{0:"offset",1:"accountId"},onSuccess:function(e){var t=e.body;return{total:t.total,orders:t.results}},onFailure:n.onFailure},CANCEL_ORDER:{method:"DELETE",url:"https://trade-service.wealthsimple.com/orders/{0}",authenticated:!0,parameters:{0:"orderId"},onSuccess:n.onSuccess,onFailure:n.onFailure},PLACE_ORDER:{method:"POST",url:"https://trade-service.wealthsimple.com/orders",authenticated:!0,onSuccess:n.onSuccess,onFailure:n.onFailure}}},464:(e,t,r)=>{"use strict";r.d(t,{Z:()=>h});var n=r(757),i=r.n(n),a=r(926),o=r.n(a),s=r(575),u=r.n(s),c=r(913),l=r.n(c);const h=function(){function e(t){u()(this,e),this.worker=t}var t,r;return l()(e,[{key:"on",value:function(e,t){this.worker.on(e,t)}},{key:"use",value:function(e){this.worker.tokens.store(e)}},{key:"tokens",value:function(){return{access:this.worker.tokens.access,refresh:this.worker.tokens.refresh,expires:this.worker.tokens.expires}}},{key:"login",value:(r=o()(i().mark((function e(t,r){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.worker.login(t,r));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"refresh",value:(t=o()(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.worker.refreshAuthentication());case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}()},500:(e,t,r)=>{"use strict";r.d(t,{e:()=>a,Z:()=>o});var n=["implicit_token_refresh","securities_cache"],i=["securities_cache"],a=function(e){return!i.includes(e)};function o(e){if(!function(e){return null!=e&&e.startsWith("no_")?n.includes(e.substring("no_".length)):n.includes(e)}(e))throw new Error("'".concat(e,"' is not supported!"));if(null!=e&&e.startsWith("no_")){var t=e.substring(e.indexOf("_")+1);a(t)&&i.push(t)}else a(e)||i.splice(i.indexOf(e),1)}},657:(e,t,r)=>{"use strict";r.d(t,{Z:()=>l});var n=r(38),i=r.n(n),a=r(575),o=r.n(a),s=r(913),u=r.n(s),c=["NASDAQ","NYSE","TSX","TSX-V","AEQUITAS NEO EXCHANGE","CC"];const l=function(){function e(t){var r;if(o()(this,e),this.symbol=null,this.exchange=null,this.id=null,this.crypto=!1,"string"==typeof t){if(""===t)throw new Error("Empty ticker");var n=t.split(":"),a=i()(n,2);this.symbol=a[0],this.exchange=a[1]}else{if(!t.symbol&&!t.id)throw new Error("Invalid ticker '".concat(t,"'"));this.symbol=t.symbol||null,this.exchange=t.exchange||null,this.id=t.id||null}if("NEO"===this.exchange&&(this.exchange="AEQUITAS NEO EXCHANGE"),this.exchange&&!c.includes(this.exchange))throw new Error("Invalid exchange '".concat(this.exchange,"'!"));("CC"===this.exchange||null!==(r=this.id)&&void 0!==r&&r.startsWith("sec-z"))&&(this.crypto=!0)}return u()(e,[{key:"format",value:function(){return this.id?this.id:"AEQUITAS NEO EXCHANGE"===this.exchange?"".concat(this.symbol,":NEO"):"".concat(this.symbol).concat(this.exchange?":".concat(this.exchange):"")}},{key:"weakEquals",value:function(e){return!(!this.id||this.id!==e.id)||!(!this.symbol||this.symbol!==e.symbol||this.crypto!==e.crypto)}}]),e}()},752:(e,t,r)=>{"use strict";r.d(t,{Z:()=>g});var n=r(713),i=r.n(n),a=r(38),o=r.n(a),s=r(757),u=r.n(s),c=r(926),l=r.n(c),h=r(575),p=r.n(h),f=r(913),d=r.n(f),y=r(726),v=r(657),m=r(500),w=new(function(){function e(t){p()(this,e),this.cache=new Map,this.size=t}return d()(e,[{key:"insert",value:function(e,t){this.cache.size>=this.size&&this.cache.delete(this.cache.keys().next().value),this.cache.set(e,t)}},{key:"get",value:function(e){return this.cache.get(e)}}]),e}())(10);const k=function(e){var t=w.get(new v.Z(e).format());return void 0===t?null:t};function x(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function b(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?x(Object(r),!0).forEach((function(t){i()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):x(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const g=function(){function e(t){p()(this,e),this.worker=t}var t,r,n,a;return d()(e,[{key:"exchangeRates",value:(a=l()(u().mark((function e(){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.worker.handleRequest(y.Z.EXCHANGE_RATES,{}));case 1:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"getSecurity",value:(n=l()(u().mark((function e(t,r){var n,i,a,s;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=null,i=new v.Z(t),r||!(0,m.e)("securities_cache")){e.next=6;break}if(!(n=k(i))){e.next=6;break}return e.abrupt("return",n);case 6:if(!i.id){e.next=12;break}return e.next=9,this.worker.handleRequest(y.Z.EXTENSIVE_SECURITY_DETAILS,{id:i.id});case 9:n=e.sent,e.next=28;break;case 12:return e.next=14,this.worker.handleRequest(y.Z.SECURITY,{ticker:i.symbol});case 14:if(n=(n=e.sent).filter((function(e){return e.stock.symbol===i.symbol})),i.crypto?n=n.filter((function(e){return"cryptocurrency"===e.security_type})):i.exchange&&(n=n.filter((function(e){return e.stock.primary_exchange===i.exchange}))),!(n.length>1)){e.next=19;break}throw new Error("Multiple securities matched query.");case 19:if(0!==n.length){e.next=21;break}throw new Error("No securities matched query.");case 21:if(a=n,s=o()(a,1),n=s[0],!r){e.next=28;break}return e.next=27,this.worker.handleRequest(y.Z.EXTENSIVE_SECURITY_DETAILS,{id:n.id});case 27:n=e.sent;case 28:return(0,m.e)("securities_cache")&&null===k(i)&&(u=i,c=n,w.insert(new v.Z(u).format(),c)),e.abrupt("return",n);case 30:case"end":return e.stop()}var u,c}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"securityGroups",value:(r=l()(u().mark((function e(){var t;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.worker.handleRequest(y.Z.SECURITY_GROUPS,{});case 2:return t=e.sent,e.abrupt("return",t.reduce((function(e,t){return b(b({},e),{},i()({},t.name,t.external_security_group_id))}),{}));case 4:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"getSecurityGroup",value:(t=l()(u().mark((function e(t){var r,n;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t,null!=t&&t.startsWith("security-group")){e.next=8;break}return e.next=4,this.securityGroups();case 4:if(n=e.sent,t in n){e.next=7;break}throw new Error("'".concat(t,"' is not a valid group name!"));case 7:r=n[t];case 8:return e.abrupt("return",this.worker.handleRequest(y.Z.SECURITY_GROUP,{groupId:r}));case 9:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),e}()},568:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o});var n=r(319),i=r.n(n),a=new(r(545).Headers);const o={add:function(e,t){return a.append(e,t)},remove:function(e){return a.delete(e)},clear:function(){return i()(a).forEach((function(e){return a.delete(e[0])}))},values:function(){return i()(a)}}},352:(e,t,r)=>{r(949).install();var n=r(464).Z,i=r(568).Z,a=r(391).Z,o=r(764).Z,s=r(752).Z,u=r(889).Z,c=r(500).Z,l=r(190).Z,h=function(){var e=new l,t=new s(e);return{auth:new n(e),headers:i,accounts:new a(e),orders:new o(e,t),quotes:new u(e,t),data:t,config:c}},p=new h;p.Session=function(){return new h},e.exports=p},190:(e,t,r)=>{"use strict";r.d(t,{Z:()=>S});var n=r(757),i=r.n(n),a=r(38),o=r.n(a),s=r(926),u=r.n(s),c=r(575),l=r.n(c),h=r(913),p=r.n(h),f=r(713),d=r.n(f),y=r(214),v=r.n(y),m=r(568),w=r(726),k=r(500);const x=function(){function e(){l()(this,e),this.access=null,this.refresh=null,this.expires=null}return p()(e,[{key:"store",value:function(e){this.access=e.access,this.refresh=e.refresh,this.expires=e.expires}},{key:"expired",value:function(){return this.expires&&parseInt(Date.now()/1e3,10)>=this.expires}}]),e}();function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var g=200,E=201;function _(e,t){var r=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach((function(t){d()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},t),n=e.url;if(e.parameters)for(var i=0;i<Object.keys(e.parameters).length;i++){var a=e.parameters[i];if(null===r[a]||void 0===r[a])throw new Error("URL parameter '".concat(a,"' missing!"));if(n.indexOf("{".concat(i,"}"))>=0)n=n.replace("{".concat(i,"}"),r[e.parameters[i]]);else{if(!(n.indexOf("[".concat(i,"]"))>=0))throw new Error("Malformed URL! This is an internal error: raise an issue!");!function(){var t=e.parameters[i],a=r[t].map((function(e){return"".concat(t,"=").concat(e)})).join("&");n=n.replace("[".concat(i,"]"),a)}()}delete r[e.parameters[i]]}return["GET","HEAD"].includes(e.method)?{url:n,payload:void 0}:{url:n,payload:JSON.stringify(r)}}const S=function(){function e(){l()(this,e),this.tokens=new x,this.events={otp:null,refresh:null}}var t,r,n,a,s;return p()(e,[{key:"on",value:function(e,t){if(!(e in this.events))throw new Error("Unsupported authentication event '".concat(e,"'!"));this.events[e]=t}},{key:"talk",value:(s=u()(i().mark((function e(t,r){var n,a,s,u,c;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n={"Content-type":"application/json"},!t.authenticated){e.next=8;break}if(this.tokens.access){e.next=4;break}throw new Error("Authentication required for '".concat(t.url,"'"));case 4:if(!(0,k.e)("implicit_token_refresh")){e.next=7;break}return e.next=7,this.implicitTokenRefresh();case 7:n.Authorization=this.tokens.access;case 8:return m.Z.values().forEach((function(e){var t=o()(e,2),r=t[0],i=t[1];n[r]=i})),a=_(t,r),s=a.url,u=a.payload,c=null,e.next=13,v()({url:s,body:u,method:t.method,headers:n,callback:function(e,t){c=t}}).catch((function(){}));case 13:try{c.body=JSON.parse(c.body)}catch(e){}return e.abrupt("return",c);case 15:case"end":return e.stop()}}),e,this)}))),function(e,t){return s.apply(this,arguments)})},{key:"handleRequest",value:(a=u()(i().mark((function e(t,r){var n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.talk(t,r);case 2:if(n=e.sent,![g,E].includes(n.statusCode)){e.next=5;break}return e.abrupt("return",t.onSuccess(n));case 5:return e.abrupt("return",Promise.reject(t.onFailure(n)));case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"login",value:(n=u()(i().mark((function e(t,r){var n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=null,"function"!=typeof this.events.otp){e.next=4;break}return e.next=4,this.handleRequest(w.Z.LOGIN,{email:t,password:r}).catch((function(){}));case 4:if(e.prev=4,e.t0=this,e.t1=w.Z.LOGIN,e.t2=t,e.t3=r,"function"!=typeof this.events.otp){e.next=15;break}return e.next=12,this.events.otp();case 12:e.t4=e.sent,e.next=16;break;case 15:e.t4=this.events.otp;case 16:return e.t5=e.t4,e.t6={email:e.t2,password:e.t3,otp:e.t5},e.next=20,e.t0.handleRequest.call(e.t0,e.t1,e.t6);case 20:n=e.sent,e.next=28;break;case 23:if(e.prev=23,e.t7=e.catch(4),this.events.otp){e.next=27;break}throw new Error("OTP not provided!");case 27:throw e.t7;case 28:this.tokens.store(n.tokens);case 29:case"end":return e.stop()}}),e,this,[[4,23]])}))),function(e,t){return n.apply(this,arguments)})},{key:"refreshAuthentication",value:(r=u()(i().mark((function e(){var t;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.handleRequest(w.Z.REFRESH,{refresh_token:this.tokens.refresh});case 2:if(t=e.sent,this.tokens.store(t.tokens),e.prev=4,"function"!=typeof this.events.refresh){e.next=8;break}return e.next=8,this.events.refresh(this.tokens);case 8:e.next=13;break;case 10:throw e.prev=10,e.t0=e.catch(4),new Error("Error in auth.on() handler for 'refresh': ".concat(e.t0));case 13:case"end":return e.stop()}}),e,this,[[4,10]])}))),function(){return r.apply(this,arguments)})},{key:"implicitTokenRefresh",value:(t=u()(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.tokens.expired()){e.next=13;break}if(!this.tokens.refresh){e.next=12;break}return e.prev=2,e.next=5,this.refreshAuthentication();case 5:e.next=10;break;case 7:throw e.prev=7,e.t0=e.catch(2),new Error("Unable to refresh expired token: ".concat(e.t0));case 10:e.next=13;break;case 12:throw new Error("Access token expired");case 13:case"end":return e.stop()}}),e,this,[[2,7]])}))),function(){return t.apply(this,arguments)})}]),e}()},764:(e,t,r)=>{"use strict";r.d(t,{Z:()=>m});var n=r(319),i=r.n(n),a=r(757),o=r.n(a),s=r(926),u=r.n(s),c=r(575),l=r.n(c),h=r(913),p=r.n(h),f=r(726),d=r(657),y=function(e){return["TSX","TSX-V"].includes(e)};function v(e,t,r){var n=e.orders.filter((function(e){if(t){var n=new d.Z({symbol:e.symbol,id:e.security_id});if(!new d.Z(t).weakEquals(n))return!1}return e.status===r}));return{orders:n,total:n.length}}const m=function(){function e(t,r){l()(this,e),this.worker=t,this.data=r}var t,r,n,a,s,c,h,m,w,k,x,b,g;return p()(e,[{key:"page",value:(g=u()(o().mark((function e(t,r){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.worker.handleRequest(f.Z.ORDERS_BY_PAGE,{offset:20*(r-1),accountId:t}));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return g.apply(this,arguments)})},{key:"all",value:(b=u()(o().mark((function e(t){var r,n,a,s;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.page(t,1);case 2:if(r=e.sent,!((n=Math.ceil(r.total/20))>1)){e.next=12;break}for(a=[],s=2;s<=n;s++)a.push(this.page(t,s).then((function(e){return e.orders})));return e.next=9,Promise.all(a);case 9:e.sent.forEach((function(e){var t;return(t=r.orders).push.apply(t,i()(e))})),r.total=r.orders.length;case 12:return e.abrupt("return",r);case 13:case"end":return e.stop()}}),e,this)}))),function(e){return b.apply(this,arguments)})},{key:"pending",value:(x=u()(o().mark((function e(t,r){var n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.all(t);case 2:return n=e.sent,e.abrupt("return",v(n,r,"submitted"));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return x.apply(this,arguments)})},{key:"filled",value:(k=u()(o().mark((function e(t,r){var n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.all(t);case 2:return n=e.sent,e.abrupt("return",v(n,r,"posted"));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return k.apply(this,arguments)})},{key:"cancelled",value:(w=u()(o().mark((function e(t,r){var n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.all(t);case 2:return n=e.sent,e.abrupt("return",v(n,r,"cancelled"));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return w.apply(this,arguments)})},{key:"cancel",value:(m=u()(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=t,e.next=3,this.worker.handleRequest(f.Z.CANCEL_ORDER,{orderId:t});case 3:return e.t1=e.sent,e.abrupt("return",{order:e.t0,response:e.t1});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return m.apply(this,arguments)})},{key:"cancelPending",value:(h=u()(o().mark((function e(t){var r,n=this;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.pending(t);case 2:return r=e.sent,e.abrupt("return",Promise.all(r.orders.map(function(){var e=u()(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",n.cancel(t.order_id));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return h.apply(this,arguments)})},{key:"marketBuy",value:(c=u()(o().mark((function e(t,r,n){var i;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.data.getSecurity(r,!0);case 2:return i=e.sent,e.abrupt("return",this.worker.handleRequest(f.Z.PLACE_ORDER,{security_id:i.id,limit_price:new d.Z(r).crypto?void 0:i.quote.amount,quantity:n,order_type:"buy_quantity",order_sub_type:"market",time_in_force:"day",account_id:t}));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return c.apply(this,arguments)})},{key:"limitBuy",value:(s=u()(o().mark((function e(t,r,n,i){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=this.worker,e.t1=f.Z.PLACE_ORDER,e.next=4,this.data.getSecurity(r);case 4:return e.t2=e.sent.id,e.t3=n,e.t4=i,e.t5=t,e.t6={security_id:e.t2,limit_price:e.t3,quantity:e.t4,order_type:"buy_quantity",order_sub_type:"limit",time_in_force:"until_cancel",account_id:e.t5},e.abrupt("return",e.t0.handleRequest.call(e.t0,e.t1,e.t6));case 10:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n){return s.apply(this,arguments)})},{key:"stopLimitBuy",value:(a=u()(o().mark((function e(t,r,n,i,a){var s;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.data.getSecurity(r);case 2:if(s=e.sent,!y(s.stock.primary_exchange)||n===i){e.next=5;break}throw new Error("TSX/TSX-V securities must have an equivalent stop and limit price.");case 5:return e.abrupt("return",this.worker.handleRequest(f.Z.PLACE_ORDER,{security_id:s.id,stop_price:n,limit_price:i,quantity:a,order_type:"buy_quantity",order_sub_type:"stop_limit",time_in_force:"until_cancel",account_id:t}));case 6:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n,i){return a.apply(this,arguments)})},{key:"marketSell",value:(n=u()(o().mark((function e(t,r,n){var i;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.data.getSecurity(r,!0);case 2:return i=e.sent,e.abrupt("return",this.worker.handleRequest(f.Z.PLACE_ORDER,{security_id:i.id,market_value:new d.Z(r).crypto?void 0:i.quote.amount,quantity:n,order_type:"sell_quantity",order_sub_type:"market",time_in_force:"day",account_id:t}));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return n.apply(this,arguments)})},{key:"limitSell",value:(r=u()(o().mark((function e(t,r,n,i){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=this.worker,e.t1=f.Z.PLACE_ORDER,e.next=4,this.data.getSecurity(r);case 4:return e.t2=e.sent.id,e.t3=n,e.t4=i,e.t5=t,e.t6={security_id:e.t2,limit_price:e.t3,quantity:e.t4,order_type:"sell_quantity",order_sub_type:"limit",time_in_force:"until_cancel",account_id:e.t5},e.abrupt("return",e.t0.handleRequest.call(e.t0,e.t1,e.t6));case 10:case"end":return e.stop()}}),e,this)}))),function(e,t,n,i){return r.apply(this,arguments)})},{key:"stopLimitSell",value:(t=u()(o().mark((function e(t,r,n,i,a){var s;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.data.getSecurity(r);case 2:if(s=e.sent,!y(s.stock.primary_exchange)||n===i){e.next=5;break}throw new Error("TSX/TSX-V securities must have an equivalent stop and limit price.");case 5:return e.abrupt("return",this.worker.handleRequest(f.Z.PLACE_ORDER,{security_id:s.id,stop_price:n,limit_price:i,quantity:a,order_type:"sell_quantity",order_sub_type:"stop_limit",time_in_force:"until_cancel",account_id:t}));case 6:case"end":return e.stop()}}),e,this)}))),function(e,r,n,i,a){return t.apply(this,arguments)})}]),e}()},889:(e,t,r)=>{"use strict";r.d(t,{Z:()=>d});var n=r(757),i=r.n(n),a=r(926),o=r.n(a),s=r(575),u=r.n(s),c=r(913),l=r.n(c);const h=function(e){return{quote:function(t){return o()(i().mark((function r(){var n;return i().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,e.getSecurity(t,!0);case 2:return n=r.sent,r.abrupt("return",n.quote.amount);case 4:case"end":return r.stop()}}),r)})))()}}};var p=r(657),f=r(726);const d=function(){function e(t,r){u()(this,e),this.defaultProvider=new h(r),this.providers={},this.worker=t,this.data=r}var t,r;return l()(e,[{key:"use",value:function(e,t){if("function"!=typeof t.quote)throw new Error("Invalid quote provider for ".concat(e,"!"));this.providers[e]=t}},{key:"get",value:(r=o()(i().mark((function e(t){var r,n,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=null,!(n=new p.Z(t)).exchange){e.next=6;break}r=n.exchange,e.next=15;break;case 6:if(!n.crypto||!n.id){e.next=10;break}r="CC",e.next=15;break;case 10:if(!(Object.keys(this.providers).length>0)){e.next=15;break}return e.next=13,this.data.getSecurity(n,!1);case 13:a=e.sent,r=a.stock.primary_exchange;case 15:if(!(r in this.providers)){e.next=17;break}return e.abrupt("return",this.providers[r].quote(n));case 17:return e.abrupt("return",this.defaultProvider.quote(n));case 18:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"history",value:(t=o()(i().mark((function e(t,r){var n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((n=new p.Z(t)).id){e.next=5;break}return e.next=4,this.data.getSecurity(n);case 4:n.id=e.sent.id;case 5:return e.abrupt("return",this.worker.handleRequest(f.Z.QUOTES_HISTORY,{id:n.id,interval:r}));case 6:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),e}()},666:e=>{var t=function(e){"use strict";var t,r=Object.prototype,n=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(e,t,r,n){var i=t&&t.prototype instanceof y?t:y,a=Object.create(i.prototype),o=new T(n||[]);return a._invoke=function(e,t,r){var n=l;return function(i,a){if(n===p)throw new Error("Generator is already running");if(n===f){if("throw"===i)throw a;return I()}for(r.method=i,r.arg=a;;){var o=r.delegate;if(o){var s=_(o,r);if(s){if(s===d)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===l)throw n=f,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=p;var u=c(e,t,r);if("normal"===u.type){if(n=r.done?f:h,u.arg===d)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n=f,r.method="throw",r.arg=u.arg)}}}(e,r,o),a}function c(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var l="suspendedStart",h="suspendedYield",p="executing",f="completed",d={};function y(){}function v(){}function m(){}var w={};w[a]=function(){return this};var k=Object.getPrototypeOf,x=k&&k(k(R([])));x&&x!==r&&n.call(x,a)&&(w=x);var b=m.prototype=y.prototype=Object.create(w);function g(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function E(e,t){function r(i,a,o,s){var u=c(e[i],e,a);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==typeof h&&n.call(h,"__await")?t.resolve(h.__await).then((function(e){r("next",e,o,s)}),(function(e){r("throw",e,o,s)})):t.resolve(h).then((function(e){l.value=e,o(l)}),(function(e){return r("throw",e,o,s)}))}s(u.arg)}var i;this._invoke=function(e,n){function a(){return new t((function(t,i){r(e,n,t,i)}))}return i=i?i.then(a,a):a()}}function _(e,r){var n=e.iterator[r.method];if(n===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,_(e,r),"throw"===r.method))return d;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var i=c(n,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,d;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,d):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function R(e){if(e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return o.next=o}}return{next:I}}function I(){return{value:t,done:!0}}return v.prototype=b.constructor=m,m.constructor=v,m[s]=v.displayName="GeneratorFunction",e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,s in e||(e[s]="GeneratorFunction")),e.prototype=Object.create(b),e},e.awrap=function(e){return{__await:e}},g(E.prototype),E.prototype[o]=function(){return this},e.AsyncIterator=E,e.async=function(t,r,n,i,a){void 0===a&&(a=Promise);var o=new E(u(t,r,n,i),a);return e.isGeneratorFunction(r)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},g(b),b[s]="Generator",b[a]=function(){return this},b.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=R,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(O),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var u=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(u&&c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,d):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;O(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:R(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),d}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}},214:e=>{"use strict";e.exports=r},545:e=>{"use strict";e.exports=t},949:t=>{"use strict";t.exports=e}},i={};function a(e){if(i[e])return i[e].exports;var t=i[e]={exports:{}};return n[e](t,t.exports,a),t.exports}return a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a(352)})()}));
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly93c3RyYWRlLWFwaS93ZWJwYWNrL3VuaXZlcnNhbE1vZHVsZURlZmluaXRpb24iLCJ3ZWJwYWNrOi8vd3N0cmFkZS1hcGkvLi9ub2RlX21vZHVsZXMvQGJhYmVsL3J1bnRpbWU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