{"version":3,"sources":["meteor://💻app/packages/srm:accounts-esri/esri.js"],"names":["Accounts","oauth","registerService","Meteor","isClient","loginWithEsri","options","callback","credentialRequestCompleteCallback","credentialRequestCompleteHandler","Esri","requestCredential","registerClientLoginFunction","applyLoginFunction","arguments","addAutopublishFields","forLoggedInUser","forOtherUsers"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AACAA,QAAQ,CAACC,KAAT,CAAeC,eAAf,CAA+B,MAA/B;;AAEA,IAAIC,MAAM,CAACC,QAAX,EAAqB;AACnB,QAAMC,aAAa,GAAG,UAAUC,OAAV,EAAmBC,QAAnB,EAA6B;AACjD;AACA,QAAI,CAACA,QAAD,IAAa,OAAOD,OAAP,KAAmB,UAApC,EAAgD;AAC9CC,cAAQ,GAAGD,OAAX;AACAA,aAAO,GAAG,IAAV;AACD;;AAED,UAAME,iCAAiC,GACvCR,QAAQ,CAACC,KAAT,CAAeQ,gCAAf,CAAgDF,QAAhD,CADA;AAEAG,QAAI,CAACC,iBAAL,CAAuBL,OAAvB,EAAgCE,iCAAhC;AACD,GAVD;;AAWAR,UAAQ,CAACY,2BAAT,CAAqC,MAArC,EAA6CP,aAA7C;;AACAF,QAAM,CAACE,aAAP,GAAuB,YAAY;AACjC,WAAOL,QAAQ,CAACa,kBAAT,CAA4B,MAA5B,EAAoCC,SAApC,CAAP;AACD,GAFD;AAGD,CAhBD,MAgBO;AACLd,UAAQ,CAACe,oBAAT,CAA8B;AAC5B;AACA;AACA;AACA;AACA;AACAC,mBAAe,EAAE,CAAC,eAAD,CANW;AAO5BC,iBAAa,EAAE,CAAC,qBAAD;AAPa,GAA9B;AASD,C","file":"/packages/srm_accounts-esri.js","sourcesContent":["/* eslint-disable no-param-reassign, func-names, prefer-rest-params */\nAccounts.oauth.registerService('esri');\n\nif (Meteor.isClient) {\n const loginWithEsri = function (options, callback) {\n // support a callback without options\n if (!callback && typeof options === 'function') {\n callback = options;\n options = null;\n }\n\n const credentialRequestCompleteCallback =\n Accounts.oauth.credentialRequestCompleteHandler(callback);\n Esri.requestCredential(options, credentialRequestCompleteCallback);\n };\n Accounts.registerClientLoginFunction('esri', loginWithEsri);\n Meteor.loginWithEsri = function () {\n return Accounts.applyLoginFunction('esri', arguments);\n };\n} else {\n Accounts.addAutopublishFields({\n // publish all fields including access token, which can legitimately\n // be used from the client (if transmitted over ssl or on\n // localhost)\n // https://developers.arcgis.com/rest/users-groups-and-items/user.htm,\n // \"Sharing of Access Tokens\"\n forLoggedInUser: ['services.esri'],\n forOtherUsers: ['services.esri.email'],\n });\n}\n"]}