@globus/sdk 5.3.0 → 5.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,122 @@
1
+ /**
2
+ * Splits a scope string into an array of individual scopes, accounting for nested, space-separated scopes.
3
+ * @private
4
+ */
5
+ export function splitScopeString(scope) {
6
+ const scopes = [];
7
+ let currentScope = '';
8
+ let openBrackets = 0;
9
+ scope.split('').forEach((char, i) => {
10
+ currentScope += char;
11
+ if (char === '[') {
12
+ openBrackets += 1;
13
+ }
14
+ if (char === ']') {
15
+ openBrackets -= 1;
16
+ }
17
+ /**
18
+ * If we encounter a space outside of brackets, or if we're at the end of the string and there is `currentScope`
19
+ * value, push it to the `scopes` array.
20
+ */
21
+ if ((char === ' ' && openBrackets === 0) || (i === scope.length - 1 && currentScope)) {
22
+ scopes.push(currentScope.trim());
23
+ currentScope = '';
24
+ }
25
+ });
26
+ return scopes;
27
+ }
28
+ /**
29
+ * Parses a scope string into a normalized structure (leaf) for easier comparison.
30
+ */
31
+ function parseScope(s) {
32
+ let parsedScope = s;
33
+ const revocable = parsedScope.startsWith('*');
34
+ if (revocable) {
35
+ parsedScope = parsedScope.replace(/^\*\s*/, '');
36
+ }
37
+ let children = [];
38
+ /**
39
+ * If there is no bracket, then there are no children and we can return the parsed scope.
40
+ */
41
+ const firstBracket = parsedScope.indexOf('[');
42
+ if (firstBracket === -1) {
43
+ return {
44
+ scope: parsedScope,
45
+ atomically_revocable: revocable,
46
+ children: [],
47
+ };
48
+ }
49
+ /**
50
+ * The top-level scope is everything before the first encountered bracket.
51
+ */
52
+ const topLevelScope = parsedScope.slice(0, firstBracket);
53
+ /**
54
+ * The children are everything inside the brackets.
55
+ */
56
+ const dependentScope = parsedScope.slice(firstBracket + 1, -1);
57
+ children = splitScopeString(dependentScope).map(parseScope);
58
+ return {
59
+ scope: topLevelScope,
60
+ atomically_revocable: revocable,
61
+ children,
62
+ };
63
+ }
64
+ /**
65
+ * Converts a scope string into a tree structure for easier comparison.
66
+ */
67
+ export function toScopeTree(scope) {
68
+ return splitScopeString(scope).map(parseScope);
69
+ }
70
+ /**
71
+ * Given a list of consent entries and a scope string, determine if **all** scopes have been approved.
72
+ *
73
+ * @param consents An array of consent entries (sourced from the Globus Auth API) that will be used as the "haystack" for the search.
74
+ * @param scope A full scope string that will be parsed into a tree, and compared against the `consents`.
75
+ * @returns boolean
76
+ */
77
+ export function hasConsentForScope(consents, scope) {
78
+ const tree = toScopeTree(scope);
79
+ /**
80
+ * Determine if a leaf of the scope tree has a consent entry (including all `children`).
81
+ * @param leaf The leaf of the scope tree we are checking for consent.
82
+ * @param path The current, expected path to the leaf when processing `children`.
83
+ * @returns boolean
84
+ */
85
+ function hasConsentEntry(leaf, path) {
86
+ /**
87
+ * Find the consent entry that matches the current leaf, and the current path.
88
+ */
89
+ const entry = consents.find((c) => c.scope_name === leaf.scope &&
90
+ /**
91
+ * If a `path` is provided, we need to make sure the entry is at the proper depth.
92
+ */
93
+ (path
94
+ ? c.dependency_path.join(',') === [...path, c.id].join(',')
95
+ : /**
96
+ * If there is no `path`, then the entry must be a "top-level" scope.
97
+ */
98
+ c.dependency_path.length === 1));
99
+ /**
100
+ * If no entry was found, then the scope has not be explicitly approved (or denied).
101
+ */
102
+ if (!entry)
103
+ return false;
104
+ /**
105
+ * If we found an entry, and there are no `children` to process on the leaf,
106
+ * then we can use the `status` of the entry to determine if the scope has been approved.
107
+ */
108
+ if (!leaf.children.length)
109
+ return entry.status === 'approved';
110
+ /**
111
+ * If there are `children` to process, then we need to check if all `children` have been approved.
112
+ */
113
+ return leaf.children.every((s) => hasConsentEntry(s,
114
+ /**
115
+ * If there is a `path`, make sure to pass it down to account for deeply nested scopes, otherwise
116
+ * the `entry` can be considered to "root".
117
+ */
118
+ path ? [...path, entry.id] : [entry.id]));
119
+ }
120
+ return tree.every((l) => hasConsentEntry(l));
121
+ }
122
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/services/auth/utils.ts"],"names":[],"mappings":"AAQA;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAa;IAC5C,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,IAAI,YAAY,GAAG,EAAE,CAAC;IACtB,IAAI,YAAY,GAAG,CAAC,CAAC;IACrB,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE;QAClC,YAAY,IAAI,IAAI,CAAC;QACrB,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;YACjB,YAAY,IAAI,CAAC,CAAC;QACpB,CAAC;QACD,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;YACjB,YAAY,IAAI,CAAC,CAAC;QACpB,CAAC;QACD;;;WAGG;QACH,IAAI,CAAC,IAAI,KAAK,GAAG,IAAI,YAAY,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,YAAY,CAAC,EAAE,CAAC;YACrF,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC;YACjC,YAAY,GAAG,EAAE,CAAC;QACpB,CAAC;IACH,CAAC,CAAC,CAAC;IACH,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;GAEG;AACH,SAAS,UAAU,CAAC,CAAS;IAC3B,IAAI,WAAW,GAAG,CAAC,CAAC;IACpB,MAAM,SAAS,GAAG,WAAW,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IAC9C,IAAI,SAAS,EAAE,CAAC;QACd,WAAW,GAAG,WAAW,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IAClD,CAAC;IACD,IAAI,QAAQ,GAAoB,EAAE,CAAC;IACnC;;OAEG;IACH,MAAM,YAAY,GAAG,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAC9C,IAAI,YAAY,KAAK,CAAC,CAAC,EAAE,CAAC;QACxB,OAAO;YACL,KAAK,EAAE,WAAW;YAClB,oBAAoB,EAAE,SAAS;YAC/B,QAAQ,EAAE,EAAE;SACb,CAAC;IACJ,CAAC;IACD;;OAEG;IACH,MAAM,aAAa,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC;IACzD;;OAEG;IACH,MAAM,cAAc,GAAG,WAAW,CAAC,KAAK,CAAC,YAAY,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAC/D,QAAQ,GAAG,gBAAgB,CAAC,cAAc,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAC5D,OAAO;QACL,KAAK,EAAE,aAAa;QACpB,oBAAoB,EAAE,SAAS;QAC/B,QAAQ;KACT,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,KAAa;IACvC,OAAO,gBAAgB,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;AACjD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAAC,QAAmB,EAAE,KAAa;IACnE,MAAM,IAAI,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC;IAChC;;;;;OAKG;IACH,SAAS,eAAe,CAAC,IAAmB,EAAE,IAAe;QAC3D;;WAEG;QACH,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CACzB,CAAC,CAAC,EAAE,EAAE,CACJ,CAAC,CAAC,UAAU,KAAK,IAAI,CAAC,KAAK;YAC3B;;eAEG;YACH,CAAC,IAAI;gBACH,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;gBAC3D,CAAC,CAAC;;qBAEG;oBACH,CAAC,CAAC,eAAe,CAAC,MAAM,KAAK,CAAC,CAAC,CACtC,CAAC;QACF;;WAEG;QACH,IAAI,CAAC,KAAK;YAAE,OAAO,KAAK,CAAC;QACzB;;;WAGG;QACH,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM;YAAE,OAAO,KAAK,CAAC,MAAM,KAAK,UAAU,CAAC;QAC9D;;WAEG;QACH,OAAO,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAC/B,eAAe,CACb,CAAC;QACD;;;WAGG;QACH,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CACxC,CACF,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;AAC/C,CAAC"}
@@ -1,3 +1,3 @@
1
- var globus=(()=>{var Ar=Object.create;var pe=Object.defineProperty;var Mr=Object.getOwnPropertyDescriptor;var Cr=Object.getOwnPropertyNames;var wr=Object.getPrototypeOf,Lr=Object.prototype.hasOwnProperty;var kr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),u=(e,t)=>{for(var r in t)pe(e,r,{get:t[r],enumerable:!0})},Jt=(e,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Cr(t))!Lr.call(e,a)&&a!==r&&pe(e,a,{get:()=>t[a],enumerable:!(s=Mr(t,a))||s.enumerable});return e};var Nr=(e,t,r)=>(r=e!=null?Ar(wr(e)):{},Jt(t||!e||!e.__esModule?pe(r,"default",{value:e,enumerable:!0}):r,e)),Ir=e=>Jt(pe({},"__esModule",{value:!0}),e);var or=kr((G,rr)=>{var ye=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof global<"u"&&global,Se=function(){function e(){this.fetch=!1,this.DOMException=ye.DOMException}return e.prototype=ye,new e}();(function(e){var t=function(r){var s=typeof e<"u"&&e||typeof self<"u"&&self||typeof global<"u"&&global||{},a={searchParams:"URLSearchParams"in s,iterable:"Symbol"in s&&"iterator"in Symbol,blob:"FileReader"in s&&"Blob"in s&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in s,arrayBuffer:"ArrayBuffer"in s};function l(n){return n&&DataView.prototype.isPrototypeOf(n)}if(a.arrayBuffer)var b=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],E=ArrayBuffer.isView||function(n){return n&&b.indexOf(Object.prototype.toString.call(n))>-1};function O(n){if(typeof n!="string"&&(n=String(n)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(n)||n==="")throw new TypeError('Invalid character in header field name: "'+n+'"');return n.toLowerCase()}function q(n){return typeof n!="string"&&(n=String(n)),n}function w(n){var i={next:function(){var d=n.shift();return{done:d===void 0,value:d}}};return a.iterable&&(i[Symbol.iterator]=function(){return i}),i}function f(n){this.map={},n instanceof f?n.forEach(function(i,d){this.append(d,i)},this):Array.isArray(n)?n.forEach(function(i){if(i.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+i.length);this.append(i[0],i[1])},this):n&&Object.getOwnPropertyNames(n).forEach(function(i){this.append(i,n[i])},this)}f.prototype.append=function(n,i){n=O(n),i=q(i);var d=this.map[n];this.map[n]=d?d+", "+i:i},f.prototype.delete=function(n){delete this.map[O(n)]},f.prototype.get=function(n){return n=O(n),this.has(n)?this.map[n]:null},f.prototype.has=function(n){return this.map.hasOwnProperty(O(n))},f.prototype.set=function(n,i){this.map[O(n)]=q(i)},f.prototype.forEach=function(n,i){for(var d in this.map)this.map.hasOwnProperty(d)&&n.call(i,this.map[d],d,this)},f.prototype.keys=function(){var n=[];return this.forEach(function(i,d){n.push(d)}),w(n)},f.prototype.values=function(){var n=[];return this.forEach(function(i){n.push(i)}),w(n)},f.prototype.entries=function(){var n=[];return this.forEach(function(i,d){n.push([d,i])}),w(n)},a.iterable&&(f.prototype[Symbol.iterator]=f.prototype.entries);function C(n){if(!n._noBody){if(n.bodyUsed)return Promise.reject(new TypeError("Already read"));n.bodyUsed=!0}}function $(n){return new Promise(function(i,d){n.onload=function(){i(n.result)},n.onerror=function(){d(n.error)}})}function qt(n){var i=new FileReader,d=$(i);return i.readAsArrayBuffer(n),d}function j(n){var i=new FileReader,d=$(i),h=/charset=([A-Za-z0-9_-]+)/.exec(n.type),y=h?h[1]:"utf-8";return i.readAsText(n,y),d}function Er(n){for(var i=new Uint8Array(n),d=new Array(i.length),h=0;h<i.length;h++)d[h]=String.fromCharCode(i[h]);return d.join("")}function jt(n){if(n.slice)return n.slice(0);var i=new Uint8Array(n.byteLength);return i.set(new Uint8Array(n)),i.buffer}function Ut(){return this.bodyUsed=!1,this._initBody=function(n){this.bodyUsed=this.bodyUsed,this._bodyInit=n,n?typeof n=="string"?this._bodyText=n:a.blob&&Blob.prototype.isPrototypeOf(n)?this._bodyBlob=n:a.formData&&FormData.prototype.isPrototypeOf(n)?this._bodyFormData=n:a.searchParams&&URLSearchParams.prototype.isPrototypeOf(n)?this._bodyText=n.toString():a.arrayBuffer&&a.blob&&l(n)?(this._bodyArrayBuffer=jt(n.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(n)||E(n))?this._bodyArrayBuffer=jt(n):this._bodyText=n=Object.prototype.toString.call(n):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof n=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):a.searchParams&&URLSearchParams.prototype.isPrototypeOf(n)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},a.blob&&(this.blob=function(){var n=C(this);if(n)return n;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var n=C(this);return n||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(a.blob)return this.blob().then(qt);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var n=C(this);if(n)return n;if(this._bodyBlob)return j(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(Er(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},a.formData&&(this.formData=function(){return this.text().then(Pr)}),this.json=function(){return this.text().then(JSON.parse)},this}var Or=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function br(n){var i=n.toUpperCase();return Or.indexOf(i)>-1?i:n}function k(n,i){if(!(this instanceof k))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');i=i||{};var d=i.body;if(n instanceof k){if(n.bodyUsed)throw new TypeError("Already read");this.url=n.url,this.credentials=n.credentials,i.headers||(this.headers=new f(n.headers)),this.method=n.method,this.mode=n.mode,this.signal=n.signal,!d&&n._bodyInit!=null&&(d=n._bodyInit,n.bodyUsed=!0)}else this.url=String(n);if(this.credentials=i.credentials||this.credentials||"same-origin",(i.headers||!this.headers)&&(this.headers=new f(i.headers)),this.method=br(i.method||this.method||"GET"),this.mode=i.mode||this.mode||null,this.signal=i.signal||this.signal||function(){if("AbortController"in s){var m=new AbortController;return m.signal}}(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&d)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(d),(this.method==="GET"||this.method==="HEAD")&&(i.cache==="no-store"||i.cache==="no-cache")){var h=/([?&])_=[^&]*/;if(h.test(this.url))this.url=this.url.replace(h,"$1_="+new Date().getTime());else{var y=/\?/;this.url+=(y.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}k.prototype.clone=function(){return new k(this,{body:this._bodyInit})};function Pr(n){var i=new FormData;return n.trim().split("&").forEach(function(d){if(d){var h=d.split("="),y=h.shift().replace(/\+/g," "),m=h.join("=").replace(/\+/g," ");i.append(decodeURIComponent(y),decodeURIComponent(m))}}),i}function xr(n){var i=new f,d=n.replace(/\r?\n[\t ]+/g," ");return d.split("\r").map(function(h){return h.indexOf(`
2
- `)===0?h.substr(1,h.length):h}).forEach(function(h){var y=h.split(":"),m=y.shift().trim();if(m){var ae=y.join(":").trim();try{i.append(m,ae)}catch(Ee){console.warn("Response "+Ee.message)}}}),i}Ut.call(k.prototype);function A(n,i){if(!(this instanceof A))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(i||(i={}),this.type="default",this.status=i.status===void 0?200:i.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=i.statusText===void 0?"":""+i.statusText,this.headers=new f(i.headers),this.url=i.url||"",this._initBody(n)}Ut.call(A.prototype),A.prototype.clone=function(){return new A(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new f(this.headers),url:this.url})},A.error=function(){var n=new A(null,{status:200,statusText:""});return n.ok=!1,n.status=0,n.type="error",n};var Dr=[301,302,303,307,308];A.redirect=function(n,i){if(Dr.indexOf(i)===-1)throw new RangeError("Invalid status code");return new A(null,{status:i,headers:{location:n}})},r.DOMException=s.DOMException;try{new r.DOMException}catch{r.DOMException=function(i,d){this.message=i,this.name=d;var h=Error(i);this.stack=h.stack},r.DOMException.prototype=Object.create(Error.prototype),r.DOMException.prototype.constructor=r.DOMException}function Re(n,i){return new Promise(function(d,h){var y=new k(n,i);if(y.signal&&y.signal.aborted)return h(new r.DOMException("Aborted","AbortError"));var m=new XMLHttpRequest;function ae(){m.abort()}m.onload=function(){var R={statusText:m.statusText,headers:xr(m.getAllResponseHeaders()||"")};y.url.indexOf("file://")===0&&(m.status<200||m.status>599)?R.status=200:R.status=m.status,R.url="responseURL"in m?m.responseURL:R.headers.get("X-Request-URL");var U="response"in m?m.response:m.responseText;setTimeout(function(){d(new A(U,R))},0)},m.onerror=function(){setTimeout(function(){h(new TypeError("Network request failed"))},0)},m.ontimeout=function(){setTimeout(function(){h(new TypeError("Network request timed out"))},0)},m.onabort=function(){setTimeout(function(){h(new r.DOMException("Aborted","AbortError"))},0)};function Ee(R){try{return R===""&&s.location.href?s.location.href:R}catch{return R}}if(m.open(y.method,Ee(y.url),!0),y.credentials==="include"?m.withCredentials=!0:y.credentials==="omit"&&(m.withCredentials=!1),"responseType"in m&&(a.blob?m.responseType="blob":a.arrayBuffer&&(m.responseType="arraybuffer")),i&&typeof i.headers=="object"&&!(i.headers instanceof f||s.Headers&&i.headers instanceof s.Headers)){var Ht=[];Object.getOwnPropertyNames(i.headers).forEach(function(R){Ht.push(O(R)),m.setRequestHeader(R,q(i.headers[R]))}),y.headers.forEach(function(R,U){Ht.indexOf(U)===-1&&m.setRequestHeader(U,R)})}else y.headers.forEach(function(R,U){m.setRequestHeader(U,R)});y.signal&&(y.signal.addEventListener("abort",ae),m.onreadystatechange=function(){m.readyState===4&&y.signal.removeEventListener("abort",ae)}),m.send(typeof y._bodyInit>"u"?null:y._bodyInit)})}return Re.polyfill=!0,s.fetch||(s.fetch=Re,s.Headers=f,s.Request=k,s.Response=A),r.Headers=f,r.Request=k,r.Response=A,r.fetch=Re,r}({})})(Se);Se.fetch.ponyfill=!0;delete Se.fetch.polyfill;var V=ye.fetch?ye:Se;G=V.fetch;G.default=V.fetch;G.fetch=V.fetch;G.Headers=V.Headers;G.Request=V.Request;G.Response=V.Response;rr.exports=G});var Fn={};u(Fn,{auth:()=>ze,authorization:()=>We,compute:()=>Gt,errors:()=>Fe,flows:()=>Et,gcs:()=>kt,groups:()=>_t,info:()=>Pe,logger:()=>De,search:()=>gt,timer:()=>Nt,transfer:()=>dt,webapp:()=>Ft});var Pe={};u(Pe,{CLIENT_INFO:()=>Wt,VERSION:()=>Kt,addClientInfo:()=>jr,getClientInfo:()=>Yt,getClientInfoRequestHeaders:()=>be});var $t="X-Globus-Client-Info",Gr=!0;function Bt(){return Gr}var Fr=";",qr=",";function zt(e){return(Array.isArray(e)?e:[e]).map(r=>Object.entries(r).map(([s,a])=>`${s}=${a}`).join(qr)).join(Fr)}var Vt="5.3.0";var Kt=Vt,Wt={product:"javascript-sdk",version:Kt},Oe=[Wt];function jr(e){Oe=Oe.concat(e)}function Yt(){return zt(Oe)}function be(){return Bt()?{[$t]:Yt()}:{}}var De={};u(De,{log:()=>_,setLogLevel:()=>Hr,setLogger:()=>Ur});var xe=["debug","info","warn","error"],ce,Qt=xe.indexOf("error");function Ur(e){ce=e}function Hr(e){Qt=xe.indexOf(e)}function _(e,...t){if(!ce||xe.indexOf(e)<Qt)return;(ce[e]??ce.log)(...t)}var We={};u(We,{AuthorizationManager:()=>ne,create:()=>ho});var H=class extends Error{};H.prototype.name="InvalidTokenError";function Jr(e){return decodeURIComponent(atob(e).replace(/(.)/g,(t,r)=>{let s=r.charCodeAt(0).toString(16).toUpperCase();return s.length<2&&(s="0"+s),"%"+s}))}function $r(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return Jr(t)}catch{return atob(t)}}function Xt(e,t){if(typeof e!="string")throw new H("Invalid token specified: must be a string");t||(t={});let r=t.header===!0?0:1,s=e.split(".")[r];if(typeof s!="string")throw new H(`Invalid token specified: missing part #${r+1}`);let a;try{a=$r(s)}catch(l){throw new H(`Invalid token specified: invalid base64 for part #${r+1} (${l.message})`)}try{return JSON.parse(a)}catch(l){throw new H(`Invalid token specified: invalid json for part #${r+1} (${l.message})`)}}var ze={};u(ze,{CONFIG:()=>$e,getAuthorizationEndpoint:()=>Be,getTokenEndpoint:()=>po,identities:()=>He,isGlobusAuthTokenResponse:()=>ve,isRefreshToken:()=>te,isToken:()=>K,oauth2:()=>F});var ge={};u(ge,{HOSTS:()=>Ne,ID:()=>S,RESOURCE_SERVERS:()=>Q,SCOPES:()=>B});var ue={};u(ue,{HOSTS:()=>Ae,ID:()=>p,SCOPES:()=>c});var p="TRANSFER",c={ALL:"urn:globus:auth:scope:transfer.api.globus.org:all"},Ae={sandbox:"transfer.api.sandbox.globuscs.info",production:"transfer.api.globusonline.org",staging:"transfer.api.staging.globuscs.info",integration:"transfer.api.integration.globuscs.info",test:"transfer.api.test.globuscs.info",preview:"transfer.api.preview.globus.org"};var de={};u(de,{HOSTS:()=>Me,ID:()=>T,SCOPES:()=>D});var T="FLOWS",Me={sandbox:"sandbox.flows.automate.globus.org",production:"flows.globus.org",staging:"staging.flows.automate.globus.org",integration:"integration.flows.automate.globus.org",test:"test.flows.automate.globus.org",preview:"preview.flows.automate.globus.org"},D={MANAGE_FLOWS:"https://auth.globus.org/scopes/eec9b274-0c81-4334-bdc2-54e90e689b9a/manage_flows",VIEW_FLOWS:"https://auth.globus.org/scopes/eec9b274-0c81-4334-bdc2-54e90e689b9a/view_flows",RUN:"https://auth.globus.org/scopes/eec9b274-0c81-4334-bdc2-54e90e689b9a/run",RUN_STATUS:"https://auth.globus.org/scopes/eec9b274-0c81-4334-bdc2-54e90e689b9a/run_status",RUN_MANAGE:"https://auth.globus.org/scopes/eec9b274-0c81-4334-bdc2-54e90e689b9a/run_manage"};var le={};u(le,{HOSTS:()=>Ce,ID:()=>L});var L="TIMER",Ce={sandbox:"sandbox.timer.automate.globus.org",production:"timer.automate.globus.org",staging:"staging.timer.automate.globus.org",integration:"integration.timer.automate.globus.org",test:"test.timer.automate.globus.org",preview:"preview.timer.automate.globus.org"};var me={};u(me,{HOSTS:()=>we,ID:()=>P,SCOPES:()=>N});var P="GROUPS",we={sandbox:"groups.api.sandbox.globuscs.info",production:"groups.api.globus.org",staging:"groups.api.staging.globuscs.info",integration:"groups.api.integration.globuscs.info",test:"groups.api.test.globuscs.info",preview:"groups.api.preview.globuscs.info"},N={ALL:"urn:globus:auth:scope:groups.api.globus.org:all",VIEW_MY:"urn:globus:auth:scope:groups.api.globus.org:view_my_groups_and_membership"};var he={};u(he,{HOSTS:()=>Le,ID:()=>v,SCOPES:()=>x});var v="SEARCH",Le={sandbox:"search.api.sandbox.globuscs.info",production:"search.api.globus.org",staging:"search.api.staging.globuscs.info",integration:"search.api.integration.globuscs.info",test:"search.api.test.globuscs.info",preview:"search.api.preview.globus.org"},x={ALL:"urn:globus:auth:scope:search.api.globus.org:all",INGEST:"urn:globus:auth:scope:search.api.globus.org:ingest",SEARCH:"urn:globus:auth:scope:search.api.globus.org:search"};var fe={};u(fe,{HOSTS:()=>ke,ID:()=>M,SCOPES:()=>Y});var M="COMPUTE",ke={sandbox:"compute.api.sandbox.globuscs.info",production:"compute.api.globus.org",staging:"compute.api.staging.globuscs.info",integration:"compute.api.integration.globuscs.info",test:"compute.api.test.globuscs.info",preview:"compute.api.preview.globus.org"},Y={ALL:"https://auth.globus.org/scopes/facd7ccc-c5f4-42aa-916b-a0e270e2c2a9/all"};var S="AUTH",Ne={integration:"auth.integration.globuscs.info",sandbox:"auth.sandbox.globuscs.info",production:"auth.globus.org",test:"auth.test.globuscs.info",staging:"auth.staging.globuscs.info",preview:"auth.preview.globus.org"},B={VIEW_IDENTITIES:"urn:globus:auth:scope:auth.globus.org:view_identities"},Q={[S]:"auth.globus.org",[p]:"transfer.api.globus.org",[T]:"flows.globus.org",[P]:"groups.api.globus.org",[v]:"search.api.globus.org",[L]:"524230d7-ea86-4a52-8312-86065a9e0417",[M]:"funcx_service"};var Fe={};u(Fe,{EnvironmentConfigurationError:()=>X,isAuthorizationRequirementsError:()=>Z,isConsentRequiredError:()=>Ie,isErrorWellFormed:()=>Zt,toAuthorizationQueryParams:()=>Ge});var X=class extends Error{name="EnvironmentConfigurationError";constructor(t,r){super(),this.message=`Invalid configuration value provided for ${t} (${r}).`}};function Zt(e){return typeof e=="object"&&e!==null&&"code"in e&&"message"in e}function Ie(e){return Zt(e)&&e.code==="ConsentRequired"&&"required_scopes"in e&&Array.isArray(e.required_scopes)}var Br=["required_scopes"];function Ge(e){let t={scope:e.authorization_parameters.required_scopes?.join(" "),...e.authorization_parameters};return Object.entries(t).reduce((r,[s,a])=>{if(Br.includes(s)||a===void 0||a===null)return r;let l=a;return Array.isArray(l)?l=l.join(","):typeof a=="boolean"&&(l=l?"true":"false"),{...r,[s]:l}},{})}function Z(e){return typeof e=="object"&&e!==null&&"authorization_parameters"in e&&typeof e.authorization_parameters=="object"&&e.authorization_parameters!==null}function zr(){return typeof window<"u"?window:process}function Vr(e){return typeof window==typeof e}function qe(e,t){let r=zr(),s;return Vr(r)?s=r:s=r.env,e in s?s[e]:t}var er={PRODUCTION:"production",PREVIEW:"preview",STAGING:"staging",SANDBOX:"sandbox",INTEGRATION:"integration",TEST:"test"},I={[S]:S,[p]:p,[T]:T,[P]:P,[v]:v,[L]:L,[M]:M},Kr={[S]:Ne,[p]:Ae,[T]:Me,[P]:we,[v]:Le,[L]:Ce,[M]:ke};function je(e){let t=qe("GLOBUS_SDK_OPTIONS",{});return typeof t=="string"&&(t=JSON.parse(t)),{...t,...e,fetch:{...t?.fetch,...e?.fetch,options:{...t?.fetch?.options,...e?.fetch?.options,headers:{...t?.fetch?.options?.headers,...e?.fetch?.options?.headers}}}}}function z(){let e=je(),t=qe("GLOBUS_SDK_ENVIRONMENT",e?.environment??er.PRODUCTION);if(e?.environment&&t!==e.environment&&_("debug","GLOBUS_SDK_ENVIRONMENT and GLOBUS_SDK_OPTIONS.environment are set to different values. GLOBUS_SDK_ENVIRONMENT will take precedence"),!t||!Object.values(er).includes(t))throw new X("GLOBUS_SDK_ENVIRONMENT",t);return t}function Wr(e,t=z()){return Kr[e][t]}function tr(e,t=z()){let r=Wr(e,t);return qe(`GLOBUS_SDK_SERVICE_URL_${e}`,r?`https://${r}`:void 0)}function Yr(e){let t=new URLSearchParams;return Array.from(Object.entries(e)).forEach(([r,s])=>{Array.isArray(s)?t.set(r,s.join(",")):s!==void 0&&t.set(r,String(s))}),t.toString()}function Qr(e,t="",r=z()){let s=tr(e,r);return new URL(t,s)}function ee(e,t,r,s){let a;return typeof e=="object"?a=new URL(t,e.host):a=Qr(e,t,s?.environment),r&&r.search&&(a.search=Yr(r.search)),a.toString()}var He={};u(He,{consents:()=>Ue,get:()=>Zr,getAll:()=>eo});var sr=Nr(or());async function o(e,t,r){let s=je(r),a=s?.fetch?.options||{},l={...be(),...t?.headers,...a.headers},b=s?.manager,E;if(e.resource_server&&b&&(E=b.tokens.getByResourceServer(e.resource_server),E&&(l.Authorization=`Bearer ${E.access_token}`)),e.scope&&b&&(typeof e.service=="string"||"endpoint_id"in e.service)){let j=typeof e.service=="string"?Q[e.service]:e.service.endpoint_id;E=b.tokens.getByResourceServer(j),E&&(l.Authorization=`Bearer ${E.access_token}`)}let O=t?.body;!O&&t?.payload&&(O=JSON.stringify(t.payload)),!l?.["Content-Type"]&&O&&(l["Content-Type"]="application/json");let q=ee(e.service,e.path,{search:t?.query},s),w={method:e.method,body:O,...a,headers:l},f=sr.default;if(a?.__callable&&(f=a.__callable.bind(this),delete w.__callable),e.preventRetry||!b||!E||!te(E))return f(q,w);let C=await f(q,w);if(C.ok)return C;let $;try{$=Z(await C.clone().json())}catch{$=!1}if(C.status===401&&!$){let j=await b.refreshToken(E);return j?f(q,{...w,headers:{...w.headers,Authorization:`Bearer ${j.access_token}`}}):C}return C}var Ue={};u(Ue,{getAll:()=>Xr});var Xr=function(e,t={},r){return o({service:S,scope:B.VIEW_IDENTITIES,path:`/v2/api/identities/${e}/consents`},t,r)};var Zr=function(e,t={},r){return o({service:S,scope:B.VIEW_IDENTITIES,path:`/v2/api/identities/${e}`},t,r)},eo=function(e={},t){return o({service:S,scope:B.VIEW_IDENTITIES,path:"/v2/api/identities"},e,t)};var F={};u(F,{token:()=>Je,userinfo:()=>ao});var Je={};u(Je,{exchange:()=>ro,introspect:()=>oo,refresh:()=>no,revoke:()=>so,token:()=>nr,validate:()=>io});function to(e){return new URLSearchParams(e)}function re(e){return{...e,body:e.payload?to(e.payload):void 0,headers:{...e?.headers||{},Accept:"application/json","Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}}}var nr=function(e={},t){return o({service:S,scope:void 0,path:"/v2/oauth2/token",method:"POST",preventRetry:!0},re(e),t)},ro=nr,oo=function(e,t){if(!e?.payload)throw new Error("'payload' is required for introspect");return o({service:S,scope:void 0,path:"/v2/oauth2/token/introspect",method:"POST",preventRetry:!0},re(e),t)},so=function(e,t){if(!e?.payload)throw new Error("'payload' is required for revoke");return o({service:S,scope:void 0,path:"/v2/oauth2/token/revoke",method:"POST",preventRetry:!0},re(e),t)},no=function(e,t){if(!e?.payload)throw new Error("'payload' is required for revoke");return o({service:S,scope:void 0,path:"/v2/oauth2/token",method:"POST",preventRetry:!0},re(e),t)},io=function(e,t){if(!e?.payload)throw new Error("'payload' is required for validate");return o({service:S,scope:void 0,path:"/v2/oauth2/token/validate",method:"POST",preventRetry:!0},re(e),t)};var ao=function(e,t){return o({service:S,scope:void 0,path:"/v2/oauth2/userinfo",method:"GET"},e,t)};var $e=ge;function Be(){return ee(S,"/v2/oauth2/authorize")}function po(){return ee(S,"/v2/oauth2/token")}function K(e){return typeof e=="object"&&e!==null&&"access_token"in e}function te(e){return K(e)&&e!==null&&"refresh_token"in e}function ve(e){return K(e)&&e!==null&&"resource_server"in e}var oe=class{constructor(t){this.name=t}#e=[];addListener(t){return this.#e.push(t),()=>this.removeListener(t)}removeListener(t){this.#e=this.#e.filter(r=>r!==t)}clearListeners(){this.#e=[]}async dispatch(t){await Promise.all(this.#e.map(r=>r(t)))}};function ar(){return"crypto"in globalThis}function Ke(){return"webcrypto"in globalThis.crypto?globalThis.crypto.webcrypto:globalThis.crypto}var co=e=>btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");async function uo(e){let t=await Ke().subtle.digest("SHA-256",new TextEncoder().encode(e));return String.fromCharCode(...new Uint8Array(t))}var Ve="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",ir=`${Ve}-._~`;function pr(){return Array.from(Ke().getRandomValues(new Uint8Array(43))).map(e=>ir[e%ir.length]).join("")}async function cr(e){let t=await uo(e);return co(t)}function ur(){return Array.from(Ke().getRandomValues(new Uint8Array(16))).map(e=>Ve[e%Ve.length]).join("")}var W={PKCE_STATE:"pkce_state",PKCE_CODE_VERIFIER:"pkce_code_verifier"};function lo(){sessionStorage.removeItem(W.PKCE_STATE),sessionStorage.removeItem(W.PKCE_CODE_VERIFIER)}var _e=class e{#e;constructor(t){if(this.#e=t,e.supported===!1)throw new Error("RedirectTransport is not supported in this environment.")}static supported=ar();async send(){let t=pr(),r=await cr(t),s=this.#e.params?.state??ur();sessionStorage.setItem(W.PKCE_CODE_VERIFIER,t),sessionStorage.setItem(W.PKCE_STATE,s);let a={response_type:"code",client_id:this.#e.client,scope:this.#e.scopes||"",redirect_uri:this.#e.redirect,state:s,code_challenge:r,code_challenge_method:"S256",...this.#e.params||{}},l=new URL(Be());l.search=new URLSearchParams(a).toString(),window.location.assign(l.toString())}async getToken(t={shouldReplace:!0,includeConsentedScopes:!1}){let r=new URL(window.location.href),s=new URLSearchParams(r.search);if(s.get("error"))throw new Error(s.get("error_description")||"An error occurred during the authorization process.");let a=s.get("code");if(!a)return;let l=sessionStorage.getItem(W.PKCE_STATE),b=sessionStorage.getItem(W.PKCE_CODE_VERIFIER);if(lo(),s.get("state")!==l)throw new Error('Invalid State. The received "state" parameter does not match the expected state.');if(!b)throw new Error("Invalid Code Verifier");let E={code:a,client_id:this.#e.client,code_verifier:b,redirect_uri:this.#e.redirect,grant_type:"authorization_code"},O=await(await F.token.exchange({query:t.includeConsentedScopes?{include_consented_scopes:!0}:void 0,payload:E})).json();return t.shouldReplace&&(s.delete("code"),s.delete("state"),r.search=s.toString(),window.location.replace(r)),O}};var Te=class{#e;constructor(t){this.#e=t.manager}#r(t){let r=this.#e.storage.getItem(t)||"null",s=null;try{let a=JSON.parse(r);K(a)&&(s=a)}catch{}return s}#t(t){let r=$e.RESOURCE_SERVERS?.[t];return this.getByResourceServer(r)}getByResourceServer(t){return this.#r(`${this.#e.storageKeyPrefix}${t}`)}get auth(){return this.#t(I.AUTH)}get transfer(){return this.#t(I.TRANSFER)}get flows(){return this.#t(I.FLOWS)}get groups(){return this.#t(I.GROUPS)}get search(){return this.#t(I.SEARCH)}get timer(){return this.#t(I.TIMER)}get compute(){return this.#t(I.COMPUTE)}gcs(t){return this.getByResourceServer(t)}getAll(){return Object.keys(this.#e.storage).reduce((r,s)=>(s.startsWith(this.#e.storageKeyPrefix)&&r.push(this.#r(s)),r),[]).filter(K)}add(t){let r=Date.now(),s=r+t.expires_in*1e3;this.#e.storage.setItem(`${this.#e.storageKeyPrefix}${t.resource_server}`,JSON.stringify({...t,__metadata:{created:r,expires:s}})),"other_tokens"in t&&t.other_tokens?.forEach(a=>{this.add(a)})}remove(t){this.#e.storage.removeItem(`${this.#e.storageKeyPrefix}${t.resource_server}`)}static isTokenExpired(t,r=0){if(!(!t||!t.__metadata||typeof t.__metadata.expires!="number"))return Date.now()+r>=t.__metadata.expires}};var se=class{#e={};getItem(t){return this.#e[t]!==void 0?this.#e[t]:null}setItem(t,r){this.#e[t]=r}removeItem(t){delete this.#e[t]}key(t){return Object.keys(this.#e)[t]}clear(){this.#e={}}get length(){return Object.keys(this.#e).length}};var mo={redirect:_e},dr={useRefreshTokens:!1,defaultScopes:"openid profile email",transport:"redirect"},lr={execute:!0,additionalParams:void 0},ne=class{#e;configuration;storage;#r=!1;get authenticated(){return this.#r}set authenticated(t){t!==this.#r&&(this.#r=t,this.#n())}tokens;events={authenticated:new oe("authenticated"),revoke:new oe("revoke")};constructor(t){if(!t.client)throw new Error("You must provide a `client` for your application.");let r=t.defaultScopes===!1?"":t.defaultScopes??dr.defaultScopes;this.configuration={...dr,...t,scopes:[t.scopes?t.scopes:"",r].filter(s=>s.length).join(" ")},this.storage=t.storage||new se,this.configuration.events&&Object.entries(this.configuration.events).forEach(([s,a])=>{s in this.events&&this.events[s].addListener(a)}),this.tokens=new Te({manager:this}),this.#t()}get storageKeyPrefix(){return`${this.configuration.client}:`}get user(){let t=this.getGlobusAuthToken();return t&&t.id_token?Xt(t.id_token):null}async refreshTokens(){_("debug","AuthorizationManager.refreshTokens");let t=await Promise.allSettled(this.tokens.getAll().map(r=>te(r)?this.refreshToken(r):Promise.resolve(null)));return this.#t(),t}async refreshToken(t){_("debug",`AuthorizationManager.refreshToken | resource_server=${t.resource_server}`);try{let r=await(await F.token.refresh({payload:{client_id:this.configuration.client,refresh_token:t.refresh_token,grant_type:"refresh_token"}})).json();if(ve(r))return this.addTokenResponse(r),r}catch{_("error",`AuthorizationManager.refreshToken | resource_server=${t.resource_server}`)}return null}hasGlobusAuthToken(){return this.getGlobusAuthToken()!==null}getGlobusAuthToken(){let t=this.storage.getItem(`${this.storageKeyPrefix}${Q.AUTH}`);return t?JSON.parse(t):null}#t(){_("debug","AuthorizationManager.#checkAuthorizationState"),this.hasGlobusAuthToken()&&(this.authenticated=!0)}async#n(){let t=this.authenticated,r=this.getGlobusAuthToken()??void 0;await this.events.authenticated.dispatch({isAuthenticated:t,token:r})}reset(){Object.keys(this.storage).forEach(t=>{t.startsWith(this.storageKeyPrefix)&&this.storage.removeItem(t)}),this.authenticated=!1}#s(t){return`${t}${this.configuration.useRefreshTokens?" offline_access":""}`}#o(t){let{scopes:r,...s}=t??{},a=mo[this.configuration.transport||"redirect"],l=this.#s(r??(this.configuration.scopes||""));return this.storage instanceof se&&(l=[...new Set(l.split(" ").concat((this.configuration?.scopes||"").split(" ")))].join(" ")),new a({client:this.configuration.client,redirect:this.configuration.redirect,scopes:l,...s,params:{...s?.params}})}async login(t={additionalParams:{}}){_("debug","AuthorizationManager.login"),this.reset(),await this.#o({params:t?.additionalParams}).send()}async prompt(t){_("debug","AuthorizationManager.prompt"),await this.#o(t).send()}async handleCodeRedirect(t={shouldReplace:!0,additionalParams:{}}){_("debug","AuthorizationManager.handleCodeRedirect");let r=await this.#o({params:t?.additionalParams}).getToken({shouldReplace:t?.shouldReplace,includeConsentedScopes:t?.includeConsentedScopes});return ve(r)&&(_("debug",`AuthorizationManager.handleCodeRedirect | response=${JSON.stringify(r)}`),this.addTokenResponse(r)),r}async handleErrorResponse(t,r){let s=typeof r=="boolean"?{...lr,execute:r}:{...lr,...r};_("debug",`AuthorizationManager.handleErrorResponse | response=${JSON.stringify(t)} execute=${s.execute}`);let a=async()=>{};return Z(t)&&(_("debug","AuthorizationManager.handleErrorResponse | error=AuthorizationRequirementsError"),a=async()=>{await this.handleAuthorizationRequirementsError(t,{additionalParams:s.additionalParams})}),Ie(t)&&(_("debug","AuthorizationManager.handleErrorResponse | error=ConsentRequiredError"),a=async()=>{await this.handleConsentRequiredError(t,{additionalParams:s.additionalParams})}),"code"in t&&t.code==="AuthenticationFailed"&&(_("debug","AuthorizationManager.handleErrorResponse | error=AuthenticationFailed"),a=async()=>{await this.revoke()}),s.execute===!0?await a():a}async handleAuthorizationRequirementsError(t,r){this.#e=this.#o({params:{prompt:"login",...Ge(t),...r?.additionalParams}}),await this.#e.send()}async handleConsentRequiredError(t,r){this.#e=this.#o({scopes:this.#s(t.required_scopes.join(" ")),params:{...r?.additionalParams}}),await this.#e.send()}addTokenResponse=t=>{this.tokens.add(t),this.#t()};async revoke(){_("debug","AuthorizationManager.revoke");let t=Promise.all(this.tokens.getAll().map(this.#i.bind(this)));this.reset(),await t,await this.events.revoke.dispatch()}#i(t){return _("debug",`AuthorizationManager.revokeToken | resource_server=${t.resource_server}`),F.token.revoke({payload:{client_id:this.configuration.client,token:t.access_token}})}};function ho(e){return new ne(e)}var dt={};u(dt,{CONFIG:()=>fs,access:()=>et,collectionBookmarks:()=>tt,endpoint:()=>Xe,endpointManager:()=>nt,endpointSearch:()=>mr,fileOperations:()=>Ye,task:()=>Ze,taskSubmission:()=>Qe,utils:()=>ut});var mr=function(e,t){let r={...e,query:e?.query};return o({service:p,scope:c.ALL,path:"/v0.10/endpoint_search"},r,t)};var Ye={};u(Ye,{ls:()=>fo,mkdir:()=>go,rename:()=>yo,stat:()=>vo,symlink:()=>So});function J(e){return e==="GET"?{}:{"Content-Type":"application/json"}}var fo=function(e,t,r){return o({service:p,scope:c.ALL,path:`/v0.10/operation/endpoint/${e}/ls`},t,r)},go=function(e,t,r){let s={payload:{DATA_TYPE:"mkdir",...t?.payload},headers:{...J("POST"),...t?.headers}};return o({service:p,scope:c.ALL,path:`/v0.10/operation/endpoint/${e}/mkdir`,method:"POST"},s,r)},yo=function(e,t,r){let s={payload:{DATA_TYPE:"rename",...t?.payload},headers:{...J("POST"),...t?.headers}};return o({service:p,scope:c.ALL,path:`/v0.10/operation/endpoint/${e}/rename`,method:"POST"},s,r)},So=function(e,t,r){let s={payload:{DATA_TYPE:"symlink",...t?.payload},headers:{...J("POST"),...t?.headers}};return o({service:p,scope:c.ALL,path:`/v0.10/operation/endpoint/${e}/symlink`,method:"POST"},s,r)},vo=function(e,t,r){return o({service:p,scope:c.ALL,path:`/v0.10/operation/endpoint/${e}/stat`},t,r)};var Qe={};u(Qe,{submissionId:()=>Ro,submitDelete:()=>_o,submitTransfer:()=>To});var _o=function(e,t){let r={payload:{DATA_TYPE:"delete",...e?.payload},headers:{...J("POST"),...e?.headers}};return o({service:p,scope:c.ALL,path:"/v0.10/delete",method:"POST"},r,t)},To=function(e,t){let r={payload:{DATA_TYPE:"transfer",...e?.payload},headers:{...J("POST"),...e?.headers}};return o({service:p,scope:c.ALL,path:"/v0.10/transfer",method:"POST"},r,t)},Ro=function(e,t){return o({service:p,scope:c.ALL,path:"/v0.10/submission_id"},e,t)};var Xe={};u(Xe,{create:()=>Oo,get:()=>Eo,remove:()=>Po,update:()=>bo});var Eo=function(e,t,r){return o({service:p,scope:c.ALL,path:`/v0.10/endpoint/${e}`},t,r)},Oo=function(e,t){return e?.payload&&Object.assign(e.payload,{DATA_TYPE:"shared_endpoint"}),o({service:p,scope:c.ALL,path:"/v0.10/shared_endpoint",method:"POST"},e,t)},bo=function(e,t,r){return t?.payload&&Object.assign(t.payload,{DATA_TYPE:"endpoint"}),o({service:p,scope:c.ALL,path:`/v0.10/endpoint/${e}`,method:"PUT"},t,r)},Po=function(e,t,r){return o({service:p,scope:c.ALL,path:`/v0.10/endpoint/${e}`,method:"DELETE"},t,r)};var Ze={};u(Ze,{cancel:()=>Mo,get:()=>Do,getAll:()=>xo,getEventList:()=>wo,getPauseInfo:()=>No,getSkippedErrors:()=>ko,getSuccessfulTransfers:()=>Lo,remove:()=>Co,update:()=>Ao});var xo=function(e={},t){return o({service:p,scope:c.ALL,path:"/v0.10/task_list"},e,t)},Do=function(e,t,r){return o({service:p,scope:c.ALL,path:`/v0.10/task/${e}`},t,r)},Ao=function(e,t,r){return o({service:p,scope:c.ALL,path:`/v0.10/task/${e}`,method:"PUT"},t,r)},Mo=function(e,t,r){return o({service:p,scope:c.ALL,path:`/v0.10/task/${e}/cancel`,method:"POST"},t,r)},Co=function(e,t,r){return o({service:p,scope:c.ALL,path:`/v0.10/task/${e}/remove`,method:"POST"},t,r)},wo=function(e,t,r){return o({service:p,scope:c.ALL,path:`/v0.10/task/${e}/event_list`},t,r)},Lo=function(e,t,r){return o({service:p,scope:c.ALL,path:`/v0.10/task/${e}/successful_transfers`},t,r)},ko=function(e,t,r){return o({service:p,scope:c.ALL,path:`/v0.10/task/${e}/skipped_errors`},t,r)},No=function(e,t,r){return o({service:p,scope:c.ALL,path:`/v0.10/task/${e}/pause_info`},t,r)};var et={};u(et,{create:()=>Go,get:()=>Fo,getAll:()=>Io,remove:()=>jo,update:()=>qo});var Io=function(e,t,r){return o({service:p,scope:c.ALL,path:`/v0.10/endpoint/${e}/access_list`},t,r)},Go=function(e,t,r){return o({service:p,scope:c.ALL,path:`/v0.10/endpoint/${e}/access`,method:"POST"},t,r)},Fo=function({endpoint_xid:e,id:t},r,s){return o({service:p,scope:c.ALL,path:`/v0.10/endpoint/${e}/access/${t}`},r,s)},qo=function({endpoint_xid:e,id:t},r,s){return o({service:p,scope:c.ALL,path:`/v0.10/endpoint/${e}/access/${t}`,method:"PUT"},r,s)},jo=function({endpoint_xid:e,id:t},r,s){return o({service:p,scope:c.ALL,path:`/v0.10/endpoint/${e}/access/${t}`,method:"DELETE"},r,s)};var tt={};u(tt,{create:()=>Ho,get:()=>Jo,getAll:()=>Uo,remove:()=>Bo,update:()=>$o});var Uo=function(e,t){return o({service:p,scope:c.ALL,path:"/v0.10/bookmark_list"},e,t)},Ho=function(e,t){return o({service:p,scope:c.ALL,path:"/v0.10/bookmark",method:"POST"},e,t)},Jo=function(e,t,r){return o({service:p,scope:c.ALL,path:`/v0.10/bookmark/${e}`},t,r)},$o=function(e,t,r){return o({service:p,scope:c.ALL,path:`/v0.10/bookmark/${e}`,method:"PUT"},t,r)},Bo=function(e,t,r){return o({service:p,scope:c.ALL,path:`/v0.10/bookmark/${e}`,method:"DELETE"},t,r)};var nt={};u(nt,{endpoint:()=>rt,pauseRule:()=>ot,task:()=>st});var rt={};u(rt,{get:()=>zo,getAccessList:()=>Ko,getHostedEndpoints:()=>Vo,getMonitoredEndpoints:()=>Wo});var zo=function(e,t,r){return o({service:p,scope:c.ALL,path:`/v0.10/endpoint_manager/endpoint/${e}`},t,r)},Vo=function(e,t,r){return o({service:p,scope:c.ALL,path:`/v0.10/endpoint_manager/endpoint/${e}/hosted_endpoint_list`},t,r)},Ko=function(e,t,r){return o({service:p,scope:c.ALL,path:`/v0.10/endpoint_manager/endpoint/${e}/access_list`},t,r)},Wo=function(e={},t){return o({service:p,scope:c.ALL,path:"/v0.10/endpoint_manager/monitored_endpoints"},e,t)};var ot={};u(ot,{create:()=>Qo,get:()=>Xo,getAll:()=>Yo,remove:()=>es,update:()=>Zo});var Yo=function(e,t){return o({service:p,scope:c.ALL,path:"/v0.10/endpoint_manager/pause_rule_list"},e,t)},Qo=function(e,t){return o({service:p,scope:c.ALL,path:"/v0.10/endpoint_manager/pause_rule",method:"POST"},e,t)},Xo=function(e,t,r){return o({service:p,scope:c.ALL,path:`/v0.10/endpoint_manager/pause_rule/${e}`},t,r)},Zo=function(e,t,r){return o({service:p,scope:c.ALL,path:`/v0.10/endpoint_manager/pause_rule/${e}`,method:"PUT"},t,r)},es=function(e,t,r){return o({service:p,scope:c.ALL,path:`/v0.10/endpoint_manager/pause_rule/${e}`,method:"DELETE"},t,r)};var st={};u(st,{cancel:()=>os,get:()=>rs,getAdminCancel:()=>ss,getAll:()=>ts,getEventList:()=>ns,getPauseInfo:()=>us,getSkippedErrors:()=>as,getSuccessfulTransfers:()=>is,pause:()=>ps,resume:()=>cs});var ts=function(e={},t){return o({service:p,scope:c.ALL,path:"/v0.10/task_list"},e,t)},rs=function(e,t,r){return o({service:p,scope:c.ALL,path:`/v0.10/endpoint_manager/task/${e}`},t,r)},os=function(e,t){return o({service:p,scope:c.ALL,path:"/v0.10/endpoint_manager/admin_cancel",method:"POST"},e,t)},ss=function(e,t,r){return o({service:p,scope:c.ALL,path:`/v0.10/endpoint_manager/admin_cancel/${e}`,method:"POST"},t,r)},ns=function(e,t,r){return o({service:p,scope:c.ALL,path:`/v0.10/endpoint_manager/task/${e}/event_list`},t,r)},is=function(e,t,r){return o({service:p,scope:c.ALL,path:`/v0.10/endpoint_manager/task/${e}/successful_transfers`},t,r)},as=function(e,t,r){return o({service:p,scope:c.ALL,path:`/v0.10/endpoint_manager/task/${e}/skipped_errors`},t,r)},ps=function(e,t){return o({service:p,scope:c.ALL,path:"/v0.10/endpoint_manager/admin_pause",method:"POST"},e,t)},cs=function(e,t){return o({service:p,scope:c.ALL,path:"/v0.10/endpoint_manager/admin_resume",method:"POST"},e,t)},us=function(e,t,r){return o({service:p,scope:c.ALL,path:`/v0.10/endpoint_manager/task/${e}/pause_info`},t,r)};var ut={};u(ut,{getDomainFromEndpoint:()=>hs,isDirectory:()=>ds,isFileDocument:()=>fr,readableBytes:()=>ls});function fr(e){return typeof e=="object"&&e!==null&&"DATA_TYPE"in e&&e.DATA_TYPE==="file"}function ds(e){return fr(e)&&e.type==="dir"}var it=1e3,at=it*1e3,pt=at*1e3,ct=pt*1e3,hr=ct*1e3;function ls(e,t=2){let r="B",s=1;if(e<it)return`${e} ${r}`;e<at?(r="KB",s=it):e<pt?(r="MB",s=at):e<ct?(r="GB",s=pt):e<hr?(r="TB",s=ct):(r="PB",s=hr);let a=e/s,[l,b]=`${a}`.split("."),E=`${l}`;if(b&&b.length){let O=b.slice(0,t);O.length&&(E=`${l}.${O}`)}return`${E} ${r}`}var ms=["dnsteam.globuscs.info","data.globus.org","dn.glob.us"];function hs(e){let{tlsftp_server:t}=e;if(!t||typeof t!="string")return null;let{hostname:r}=new URL(t.replace("tlsftp","https"));return!ms.find(l=>r.endsWith(l))&&/(?:[gm]-\w{6}.)?(\w+(\.\w+)+)$/.exec(r)?.[1]||r||null}var fs=ue;var gt={};u(gt,{CONFIG:()=>Ps,entry:()=>ht,index:()=>ft,query:()=>lt,subject:()=>mt});var lt={};u(lt,{get:()=>gs,post:()=>ys});var gs=function(e,t,r){return o({service:v,scope:x.SEARCH,path:`/v1/index/${e}/search`},t,r)},ys=function(e,t,r){return o({service:v,scope:x.SEARCH,path:`/v1/index/${e}/search`,method:"POST"},t,r)};var mt={};u(mt,{get:()=>Ss});var Ss=function(e,t,r){return o({service:v,scope:x.SEARCH,path:`/v1/index/${e}/subject`},t,r)};var ht={};u(ht,{get:()=>vs});var vs=function(e,t,r){return o({service:v,scope:x.SEARCH,path:`/v1/index/${e}/entry`},t,r)};var ft={};u(ft,{create:()=>Rs,get:()=>_s,getAll:()=>Ts,ingest:()=>bs,remove:()=>Es,reopen:()=>Os});var _s=function(e,t,r){return o({service:v,path:`/v1/index/${e}`},t,r)},Ts=function(e,t){return o({service:v,scope:x.ALL,path:"/v1/index_list"},e,t)},Rs=function(e,t){return o({service:v,scope:x.ALL,path:"/v1/index",method:"POST"},e,t)},Es=function(e,t,r){return o({service:v,scope:x.ALL,path:`/v1/index/${e}`,method:"DELETE"},t,r)},Os=function(e,t,r){return o({service:v,scope:x.ALL,path:`/v1/index/${e}/reopen`,method:"POST"},t,r)},bs=function(e,t,r){return o({service:v,scope:x.ALL,path:`/v1/index/${e}/ingest`,method:"POST"},t,r)};var Ps=he;var _t={};u(_t,{CONFIG:()=>Cs,groups:()=>yt,membership:()=>vt,policies:()=>St});var yt={};u(yt,{get:()=>Ds,getMyGroups:()=>xs});var xs=function(e,t){return o({scope:N.ALL,path:"/v2/groups/my_groups",service:P},e,t)},Ds=function(e,t,r){return o({service:P,scope:N.ALL,path:`/v2/groups/${e}`},t,r)};var St={};u(St,{get:()=>As});var As=function(e,t,r){return o({scope:N.ALL,path:`/v2/groups/${e}/policies`,service:P},t,r)};var vt={};u(vt,{act:()=>Ms});var Ms=function(e,t,r){if(!t?.payload)throw new Error("payload is required.");return o({service:P,scope:N.ALL,path:`/v2/groups/${e}`,method:"POST"},t,r)};var Cs=me;var Et={};u(Et,{CONFIG:()=>Us,flows:()=>Tt,runs:()=>Rt});var Tt={};u(Tt,{create:()=>gr,deploy:()=>Gs,get:()=>Ls,getAll:()=>ws,remove:()=>ks,run:()=>Ns,validate:()=>Is});var ws=function(e,t){return o({service:T,scope:D.VIEW_FLOWS,path:"/flows"},e,t)},Ls=function(e,t,r){return o({service:T,scope:D.VIEW_FLOWS,path:`/flows/${e}`},t,r)},ks=function(e,t,r){return o({scope:D.MANAGE_FLOWS,service:T,path:`/flows/${e}`,method:"DELETE"},t,r)},Ns=function(e,t,r){return o({service:T,scope:D.VIEW_FLOWS,path:`/flows/${e}/run`,method:"POST"},t,r)},Is=function(e,t){return o({service:T,scope:D.MANAGE_FLOWS,path:"/flows/validate",method:"POST"},e,t)},gr=function(e,t){return o({service:T,scope:D.MANAGE_FLOWS,path:"/flows",method:"POST"},e,t)},Gs=gr;var Rt={};u(Rt,{cancel:()=>qs,getAll:()=>Fs,getLog:()=>js});var Fs=function(e={},t){return o({service:T,scope:D.RUN_MANAGE,path:"/runs"},e,t)},qs=function(e,t,r){return o({service:T,scope:D.RUN_MANAGE,path:`/runs/${e}/cancel`,method:"POST"},t,r)},js=function(e,t,r){return o({service:T,scope:D.RUN_MANAGE,path:`/runs/${e}/log`},t,r)};var Us=de;var kt={};u(kt,{collections:()=>Ot,endpoint:()=>bt,getScopes:()=>Mn,https:()=>Pt,nodes:()=>xt,roles:()=>Dt,storageGateways:()=>At,userCredentials:()=>Mt,utils:()=>Lt,versioning:()=>wt});var Ot={};u(Ot,{create:()=>Bs,get:()=>Js,getAll:()=>Hs,patch:()=>Vs,remove:()=>$s,resetOwnerString:()=>Ws,update:()=>zs,updateOwnerString:()=>Ks});var Hs=function(e,t,r){return o({service:e,resource_server:e.endpoint_id,path:"/api/collections"},t,r)},Js=function(e,t,r,s){return o({service:e,resource_server:e.endpoint_id,path:`/api/collections/${t}`},r,s)},$s=function(e,t,r,s){return o({service:e,resource_server:e.endpoint_id,path:`/api/collections/${t}`,method:"DELETE"},r,s)},Bs=function(e,t,r){return o({service:e,resource_server:e.endpoint_id,path:"/api/collections",method:"POST"},t,r)},zs=function(e,t,r,s){return o({service:e,resource_server:e.endpoint_id,path:`/api/collections/${t}`,method:"PUT"},r,s)},Vs=function(e,t,r,s){return o({service:e,resource_server:e.endpoint_id,path:`/api/collections/${t}`,method:"PATCH"},r,s)},Ks=function(e,t,r,s){return o({service:e,resource_server:e.endpoint_id,path:`/api/collections/${t}/owner_string`,method:"PUT"},r,s)},Ws=function(e,t,r,s){return o({service:e,resource_server:e.endpoint_id,path:`/api/collections/${t}/owner_string`,method:"DELETE"},r,s)};var bt={};u(bt,{get:()=>Ys,patch:()=>Xs,resetOwnerString:()=>rn,update:()=>Qs,updateOwner:()=>en,updateOwnerString:()=>tn,updateSubscriptionId:()=>Zs});var Ys=function(e,t,r){return o({service:e,resource_server:e.endpoint_id,path:"/api/endpoint"},t,r)},Qs=function(e,t,r){return o({service:e,resource_server:e.endpoint_id,path:"/api/endpoint",method:"PUT"},t,r)},Xs=function(e,t,r){return o({service:e,resource_server:e.endpoint_id,path:"/api/endpoint",method:"PATCH"},t,r)},Zs=function(e,t,r){return o({service:e,resource_server:e.endpoint_id,path:"/api/endpoint/subscription_id",method:"PUT"},t,r)},en=function(e,t,r){return o({service:e,resource_server:e.endpoint_id,path:"/api/endpoint/owner",method:"PUT"},t,r)},tn=function(e,t,r){return o({service:e,resource_server:e.endpoint_id,path:"/api/endpoint/owner_string",method:"PUT"},t,r)},rn=function(e,t,r){return o({service:e,resource_server:e.endpoint_id,path:"/api/endpoint/owner_string",method:"DELETE"},t,r)};var Pt={};u(Pt,{get:()=>on,remove:()=>sn,update:()=>nn});var on=function(e,t,r,s){return o({service:e,resource_server:e.endpoint_id,path:t},r,s)},sn=function(e,t,r,s){return o({service:e,resource_server:e.endpoint_id,path:t,method:"DELETE"},r,s)},nn=function(e,t,r,s){return o({service:e,resource_server:e.endpoint_id,path:t,method:"PUT"},r,s)};var xt={};u(xt,{create:()=>un,get:()=>pn,getAll:()=>an,patch:()=>ln,remove:()=>cn,update:()=>dn});var an=function(e,t,r){return o({service:e,resource_server:e.endpoint_id,path:"/api/nodes"},t,r)},pn=function(e,t,r,s){return o({service:e,resource_server:e.endpoint_id,path:`/api/nodes/${t}`},r,s)},cn=function(e,t,r,s){return o({service:e,resource_server:e.endpoint_id,path:`/api/nodes/${t}`,method:"DELETE"},r,s)},un=function(e,t,r){return o({service:e,resource_server:e.endpoint_id,path:"/api/nodes",method:"POST"},t,r)},dn=function(e,t,r,s){return o({service:e,resource_server:e.endpoint_id,path:`/api/nodes/${t}`,method:"PUT"},r,s)},ln=function(e,t,r,s){return o({service:e,resource_server:e.endpoint_id,path:`/api/nodes/${t}`,method:"PATCH"},r,s)};var Dt={};u(Dt,{create:()=>gn,get:()=>hn,getAll:()=>mn,remove:()=>fn});var mn=function(e,t,r){return o({service:e,resource_server:e.endpoint_id,path:"/api/roles"},t,r)},hn=function(e,t,r,s){return o({service:e,resource_server:e.endpoint_id,path:`/api/roles/${t}`},r,s)},fn=function(e,t,r,s){return o({service:e,resource_server:e.endpoint_id,path:`/api/roles/${t}`,method:"DELETE"},r,s)},gn=function(e,t,r){return o({service:e,resource_server:e.endpoint_id,path:"/api/roles",method:"POST"},t,r)};var At={};u(At,{create:()=>_n,get:()=>Sn,getAll:()=>yn,patch:()=>Rn,remove:()=>vn,update:()=>Tn});var yn=function(e,t,r){return o({service:e,resource_server:e.endpoint_id,path:"/api/storage_gateways"},t,r)},Sn=function(e,t,r,s){return o({service:e,resource_server:e.endpoint_id,path:`/api/storage_gateways/${t}`},r,s)},vn=function(e,t,r,s){return o({service:e,resource_server:e.endpoint_id,path:`/api/storage_gateways/${t}`,method:"DELETE"},r,s)},_n=function(e,t,r){return o({service:e,resource_server:e.endpoint_id,path:"/api/storage_gateways",method:"POST"},t,r)},Tn=function(e,t,r,s){return o({service:e,resource_server:e.endpoint_id,path:`/api/storage_gateways/${t}`,method:"PUT"},r,s)},Rn=function(e,t,r,s){return o({service:e,resource_server:e.endpoint_id,path:`/api/storage_gateways/${t}`,method:"PATCH"},r,s)};var Mt={};u(Mt,{create:()=>Pn,get:()=>On,getAll:()=>En,patch:()=>Dn,remove:()=>bn,update:()=>xn});var En=function(e,t,r){return o({service:e,resource_server:e.endpoint_id,path:"/api/user_credentials"},t,r)},On=function(e,t,r,s){return o({service:e,resource_server:e.endpoint_id,path:`/api/user_credentials/${t}`},r,s)},bn=function(e,t,r,s){return o({service:e,resource_server:e.endpoint_id,path:`/api/user_credentials/${t}`,method:"DELETE"},r,s)},Pn=function(e,t,r){return o({service:e,resource_server:e.endpoint_id,path:"/api/user_credentials",method:"POST"},t,r)},xn=function(e,t,r,s){return o({service:e,resource_server:e.endpoint_id,path:`/api/user_credentials/${t}`,method:"PUT"},r,s)},Dn=function(e,t,r,s){return o({service:e,resource_server:e.endpoint_id,path:`/api/user_credentials/${t}`,method:"PATCH"},r,s)};var wt={};u(wt,{info:()=>Ct});var Ct=function(e,t,r){return o({service:e,path:"/api/info"},t,r)};var Lt={};u(Lt,{getEndpointIdFromURL:()=>An,getGCSDomainFromURL:()=>yr});var ie="data.globus.org";function yr(e){let{host:t}=typeof e=="string"?new URL(e):e;if(!t.endsWith(ie))return t;let[r]=t.split(`.${ie}`),s=r.split(".");return(s.length===2?[...s,ie]:[s[1],s[2],ie]).join(".")}async function An(e){let t=typeof e=="string"?new URL(e):e;if(!t.host.endsWith(ie))return null;let a=(await(await Ct({host:`https://${yr(t)}`})).json()).data?.filter(l=>l.DATA_TYPE.startsWith("info#"))[0];return a&&"endpoint_id"in a?a.endpoint_id:null}var Sr={HIGH_ASSURANCE:"urn:globus:auth:scope:<ENDPOINT_ID>:manage_collections",NON_HIGH_ASSURANCE:"urn:globus:auth:scope:<ENDPOINT_ID>:manage_collections[*https://auth.globus.org/scopes/<MAPPED_COLLECTION_ID>/data_access]"};function Mn(e,t){let{endpoint_id:r}=e;if(!r)throw new Error("An 'endpoint_id' is required to determine the required scopes");return t?Sr[t].replace("<ENDPOINT_ID>",r):Object.entries(Sr).reduce((s,[a,l])=>({...s,[a]:l.replace("<ENDPOINT_ID>",r)}),{})}var Nt={};u(Nt,{CONFIG:()=>Cn,create:()=>vr});var vr=function(e,t){return o({service:L,scope:"https://auth.globus.org/scopes/524230d7-ea86-4a52-8312-86065a9e0417/timer",path:"/v2/timer",method:"POST"},e,t)};var Cn=le;var Gt={};u(Gt,{CONFIG:()=>Nn,endpoints:()=>It});var It={};u(It,{get:()=>Ln,getAll:()=>wn,getStatus:()=>kn});var wn=function(e,t){return o({service:M,scope:Y.ALL,path:"/v2/endpoints",method:"GET"},e,t)},Ln=function(e,t,r){return o({service:M,scope:Y.ALL,path:`/v2/endpoints/${e}`,method:"GET"},t,r)},kn=function(e,t,r){return o({service:M,scope:Y.ALL,path:`/v2/endpoints/${e}/status`},t,r)};var Nn=fe;var Ft={};u(Ft,{HOSTS:()=>_r,host:()=>Tr,url:()=>Rr,urlFor:()=>Gn});var _r={integration:"app.integration.globuscs.info",sandbox:"app.sandbox.globuscs.info",test:"app.test.globuscs.info",staging:"app.staging.globuscs.info",preview:"app.preview.globus.org",production:"app.globus.org"};function Tr(e=z()){return _r[e]}function Rr(e,t){return new URL(e||"",`https://${Tr(t?.environment)}`)}var In={TASK:"/activity/%s/overview",COLLECTION:"/file-manager/collections/%s/overview",ENDPOINT:"/file-manager/collections/%s/overview"};function Gn(e,t,r){let s=In[e].replace(/%s/g,t?.join("/")||"");return Rr(s,r)}return Ir(Fn);})();
1
+ var globus=(()=>{var Lr=Object.create;var pe=Object.defineProperty;var kr=Object.getOwnPropertyDescriptor;var Nr=Object.getOwnPropertyNames;var Ir=Object.getPrototypeOf,Gr=Object.prototype.hasOwnProperty;var Fr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),u=(e,t)=>{for(var r in t)pe(e,r,{get:t[r],enumerable:!0})},Bt=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Nr(t))!Gr.call(e,a)&&a!==r&&pe(e,a,{get:()=>t[a],enumerable:!(o=kr(t,a))||o.enumerable});return e};var qr=(e,t,r)=>(r=e!=null?Lr(Ir(e)):{},Bt(t||!e||!e.__esModule?pe(r,"default",{value:e,enumerable:!0}):r,e)),jr=e=>Bt(pe({},"__esModule",{value:!0}),e);var nr=Fr((G,sr)=>{var ye=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof global<"u"&&global,Se=function(){function e(){this.fetch=!1,this.DOMException=ye.DOMException}return e.prototype=ye,new e}();(function(e){var t=function(r){var o=typeof e<"u"&&e||typeof self<"u"&&self||typeof global<"u"&&global||{},a={searchParams:"URLSearchParams"in o,iterable:"Symbol"in o&&"iterator"in Symbol,blob:"FileReader"in o&&"Blob"in o&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in o,arrayBuffer:"ArrayBuffer"in o};function d(n){return n&&DataView.prototype.isPrototypeOf(n)}if(a.arrayBuffer)var v=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],y=ArrayBuffer.isView||function(n){return n&&v.indexOf(Object.prototype.toString.call(n))>-1};function b(n){if(typeof n!="string"&&(n=String(n)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(n)||n==="")throw new TypeError('Invalid character in header field name: "'+n+'"');return n.toLowerCase()}function q(n){return typeof n!="string"&&(n=String(n)),n}function w(n){var i={next:function(){var l=n.shift();return{done:l===void 0,value:l}}};return a.iterable&&(i[Symbol.iterator]=function(){return i}),i}function h(n){this.map={},n instanceof h?n.forEach(function(i,l){this.append(l,i)},this):Array.isArray(n)?n.forEach(function(i){if(i.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+i.length);this.append(i[0],i[1])},this):n&&Object.getOwnPropertyNames(n).forEach(function(i){this.append(i,n[i])},this)}h.prototype.append=function(n,i){n=b(n),i=q(i);var l=this.map[n];this.map[n]=l?l+", "+i:i},h.prototype.delete=function(n){delete this.map[b(n)]},h.prototype.get=function(n){return n=b(n),this.has(n)?this.map[n]:null},h.prototype.has=function(n){return this.map.hasOwnProperty(b(n))},h.prototype.set=function(n,i){this.map[b(n)]=q(i)},h.prototype.forEach=function(n,i){for(var l in this.map)this.map.hasOwnProperty(l)&&n.call(i,this.map[l],l,this)},h.prototype.keys=function(){var n=[];return this.forEach(function(i,l){n.push(l)}),w(n)},h.prototype.values=function(){var n=[];return this.forEach(function(i){n.push(i)}),w(n)},h.prototype.entries=function(){var n=[];return this.forEach(function(i,l){n.push([l,i])}),w(n)},a.iterable&&(h.prototype[Symbol.iterator]=h.prototype.entries);function M(n){if(!n._noBody){if(n.bodyUsed)return Promise.reject(new TypeError("Already read"));n.bodyUsed=!0}}function $(n){return new Promise(function(i,l){n.onload=function(){i(n.result)},n.onerror=function(){l(n.error)}})}function Ut(n){var i=new FileReader,l=$(i);return i.readAsArrayBuffer(n),l}function j(n){var i=new FileReader,l=$(i),f=/charset=([A-Za-z0-9_-]+)/.exec(n.type),S=f?f[1]:"utf-8";return i.readAsText(n,S),l}function xr(n){for(var i=new Uint8Array(n),l=new Array(i.length),f=0;f<i.length;f++)l[f]=String.fromCharCode(i[f]);return l.join("")}function Ht(n){if(n.slice)return n.slice(0);var i=new Uint8Array(n.byteLength);return i.set(new Uint8Array(n)),i.buffer}function Jt(){return this.bodyUsed=!1,this._initBody=function(n){this.bodyUsed=this.bodyUsed,this._bodyInit=n,n?typeof n=="string"?this._bodyText=n:a.blob&&Blob.prototype.isPrototypeOf(n)?this._bodyBlob=n:a.formData&&FormData.prototype.isPrototypeOf(n)?this._bodyFormData=n:a.searchParams&&URLSearchParams.prototype.isPrototypeOf(n)?this._bodyText=n.toString():a.arrayBuffer&&a.blob&&d(n)?(this._bodyArrayBuffer=Ht(n.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(n)||y(n))?this._bodyArrayBuffer=Ht(n):this._bodyText=n=Object.prototype.toString.call(n):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof n=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):a.searchParams&&URLSearchParams.prototype.isPrototypeOf(n)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},a.blob&&(this.blob=function(){var n=M(this);if(n)return n;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var n=M(this);return n||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(a.blob)return this.blob().then(Ut);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var n=M(this);if(n)return n;if(this._bodyBlob)return j(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(xr(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},a.formData&&(this.formData=function(){return this.text().then(Cr)}),this.json=function(){return this.text().then(JSON.parse)},this}var Dr=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function Ar(n){var i=n.toUpperCase();return Dr.indexOf(i)>-1?i:n}function k(n,i){if(!(this instanceof k))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');i=i||{};var l=i.body;if(n instanceof k){if(n.bodyUsed)throw new TypeError("Already read");this.url=n.url,this.credentials=n.credentials,i.headers||(this.headers=new h(n.headers)),this.method=n.method,this.mode=n.mode,this.signal=n.signal,!l&&n._bodyInit!=null&&(l=n._bodyInit,n.bodyUsed=!0)}else this.url=String(n);if(this.credentials=i.credentials||this.credentials||"same-origin",(i.headers||!this.headers)&&(this.headers=new h(i.headers)),this.method=Ar(i.method||this.method||"GET"),this.mode=i.mode||this.mode||null,this.signal=i.signal||this.signal||function(){if("AbortController"in o){var m=new AbortController;return m.signal}}(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&l)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(l),(this.method==="GET"||this.method==="HEAD")&&(i.cache==="no-store"||i.cache==="no-cache")){var f=/([?&])_=[^&]*/;if(f.test(this.url))this.url=this.url.replace(f,"$1_="+new Date().getTime());else{var S=/\?/;this.url+=(S.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}k.prototype.clone=function(){return new k(this,{body:this._bodyInit})};function Cr(n){var i=new FormData;return n.trim().split("&").forEach(function(l){if(l){var f=l.split("="),S=f.shift().replace(/\+/g," "),m=f.join("=").replace(/\+/g," ");i.append(decodeURIComponent(S),decodeURIComponent(m))}}),i}function Mr(n){var i=new h,l=n.replace(/\r?\n[\t ]+/g," ");return l.split("\r").map(function(f){return f.indexOf(`
2
+ `)===0?f.substr(1,f.length):f}).forEach(function(f){var S=f.split(":"),m=S.shift().trim();if(m){var ae=S.join(":").trim();try{i.append(m,ae)}catch(Ee){console.warn("Response "+Ee.message)}}}),i}Jt.call(k.prototype);function A(n,i){if(!(this instanceof A))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(i||(i={}),this.type="default",this.status=i.status===void 0?200:i.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=i.statusText===void 0?"":""+i.statusText,this.headers=new h(i.headers),this.url=i.url||"",this._initBody(n)}Jt.call(A.prototype),A.prototype.clone=function(){return new A(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new h(this.headers),url:this.url})},A.error=function(){var n=new A(null,{status:200,statusText:""});return n.ok=!1,n.status=0,n.type="error",n};var wr=[301,302,303,307,308];A.redirect=function(n,i){if(wr.indexOf(i)===-1)throw new RangeError("Invalid status code");return new A(null,{status:i,headers:{location:n}})},r.DOMException=o.DOMException;try{new r.DOMException}catch{r.DOMException=function(i,l){this.message=i,this.name=l;var f=Error(i);this.stack=f.stack},r.DOMException.prototype=Object.create(Error.prototype),r.DOMException.prototype.constructor=r.DOMException}function Re(n,i){return new Promise(function(l,f){var S=new k(n,i);if(S.signal&&S.signal.aborted)return f(new r.DOMException("Aborted","AbortError"));var m=new XMLHttpRequest;function ae(){m.abort()}m.onload=function(){var O={statusText:m.statusText,headers:Mr(m.getAllResponseHeaders()||"")};S.url.indexOf("file://")===0&&(m.status<200||m.status>599)?O.status=200:O.status=m.status,O.url="responseURL"in m?m.responseURL:O.headers.get("X-Request-URL");var U="response"in m?m.response:m.responseText;setTimeout(function(){l(new A(U,O))},0)},m.onerror=function(){setTimeout(function(){f(new TypeError("Network request failed"))},0)},m.ontimeout=function(){setTimeout(function(){f(new TypeError("Network request timed out"))},0)},m.onabort=function(){setTimeout(function(){f(new r.DOMException("Aborted","AbortError"))},0)};function Ee(O){try{return O===""&&o.location.href?o.location.href:O}catch{return O}}if(m.open(S.method,Ee(S.url),!0),S.credentials==="include"?m.withCredentials=!0:S.credentials==="omit"&&(m.withCredentials=!1),"responseType"in m&&(a.blob?m.responseType="blob":a.arrayBuffer&&(m.responseType="arraybuffer")),i&&typeof i.headers=="object"&&!(i.headers instanceof h||o.Headers&&i.headers instanceof o.Headers)){var $t=[];Object.getOwnPropertyNames(i.headers).forEach(function(O){$t.push(b(O)),m.setRequestHeader(O,q(i.headers[O]))}),S.headers.forEach(function(O,U){$t.indexOf(U)===-1&&m.setRequestHeader(U,O)})}else S.headers.forEach(function(O,U){m.setRequestHeader(U,O)});S.signal&&(S.signal.addEventListener("abort",ae),m.onreadystatechange=function(){m.readyState===4&&S.signal.removeEventListener("abort",ae)}),m.send(typeof S._bodyInit>"u"?null:S._bodyInit)})}return Re.polyfill=!0,o.fetch||(o.fetch=Re,o.Headers=h,o.Request=k,o.Response=A),r.Headers=h,r.Request=k,r.Response=A,r.fetch=Re,r}({})})(Se);Se.fetch.ponyfill=!0;delete Se.fetch.polyfill;var V=ye.fetch?ye:Se;G=V.fetch;G.default=V.fetch;G.fetch=V.fetch;G.Headers=V.Headers;G.Request=V.Request;G.Response=V.Response;sr.exports=G});var Jn={};u(Jn,{auth:()=>Ke,authorization:()=>Qe,compute:()=>qt,errors:()=>Fe,flows:()=>bt,gcs:()=>It,groups:()=>Rt,info:()=>Pe,logger:()=>De,search:()=>St,timer:()=>Gt,transfer:()=>mt,webapp:()=>jt});var Pe={};u(Pe,{CLIENT_INFO:()=>Qt,VERSION:()=>Yt,addClientInfo:()=>$r,getClientInfo:()=>Xt,getClientInfoRequestHeaders:()=>be});var zt="X-Globus-Client-Info",Ur=!0;function Vt(){return Ur}var Hr=";",Jr=",";function Kt(e){return(Array.isArray(e)?e:[e]).map(r=>Object.entries(r).map(([o,a])=>`${o}=${a}`).join(Jr)).join(Hr)}var Wt="5.4.0";var Yt=Wt,Qt={product:"javascript-sdk",version:Yt},Oe=[Qt];function $r(e){Oe=Oe.concat(e)}function Xt(){return Kt(Oe)}function be(){return Vt()?{[zt]:Xt()}:{}}var De={};u(De,{log:()=>R,setLogLevel:()=>zr,setLogger:()=>Br});var xe=["debug","info","warn","error"],ce,Zt=xe.indexOf("error");function Br(e){ce=e}function zr(e){Zt=xe.indexOf(e)}function R(e,...t){if(!ce||xe.indexOf(e)<Zt)return;(ce[e]??ce.log)(...t)}var Qe={};u(Qe,{AuthorizationManager:()=>ne,create:()=>vo});var H=class extends Error{};H.prototype.name="InvalidTokenError";function Vr(e){return decodeURIComponent(atob(e).replace(/(.)/g,(t,r)=>{let o=r.charCodeAt(0).toString(16).toUpperCase();return o.length<2&&(o="0"+o),"%"+o}))}function Kr(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return Vr(t)}catch{return atob(t)}}function er(e,t){if(typeof e!="string")throw new H("Invalid token specified: must be a string");t||(t={});let r=t.header===!0?0:1,o=e.split(".")[r];if(typeof o!="string")throw new H(`Invalid token specified: missing part #${r+1}`);let a;try{a=Kr(o)}catch(d){throw new H(`Invalid token specified: invalid base64 for part #${r+1} (${d.message})`)}try{return JSON.parse(a)}catch(d){throw new H(`Invalid token specified: invalid json for part #${r+1} (${d.message})`)}}var Ke={};u(Ke,{CONFIG:()=>ze,getAuthorizationEndpoint:()=>Ve,getTokenEndpoint:()=>fo,identities:()=>He,isGlobusAuthTokenResponse:()=>ve,isRefreshToken:()=>te,isToken:()=>K,oauth2:()=>F,utils:()=>Be});var ge={};u(ge,{HOSTS:()=>Ne,ID:()=>_,RESOURCE_SERVERS:()=>Q,SCOPES:()=>B});var ue={};u(ue,{HOSTS:()=>Ae,ID:()=>p,SCOPES:()=>c});var p="TRANSFER",c={ALL:"urn:globus:auth:scope:transfer.api.globus.org:all"},Ae={sandbox:"transfer.api.sandbox.globuscs.info",production:"transfer.api.globusonline.org",staging:"transfer.api.staging.globuscs.info",integration:"transfer.api.integration.globuscs.info",test:"transfer.api.test.globuscs.info",preview:"transfer.api.preview.globus.org"};var de={};u(de,{HOSTS:()=>Ce,ID:()=>E,SCOPES:()=>D});var E="FLOWS",Ce={sandbox:"sandbox.flows.automate.globus.org",production:"flows.globus.org",staging:"staging.flows.automate.globus.org",integration:"integration.flows.automate.globus.org",test:"test.flows.automate.globus.org",preview:"preview.flows.automate.globus.org"},D={MANAGE_FLOWS:"https://auth.globus.org/scopes/eec9b274-0c81-4334-bdc2-54e90e689b9a/manage_flows",VIEW_FLOWS:"https://auth.globus.org/scopes/eec9b274-0c81-4334-bdc2-54e90e689b9a/view_flows",RUN:"https://auth.globus.org/scopes/eec9b274-0c81-4334-bdc2-54e90e689b9a/run",RUN_STATUS:"https://auth.globus.org/scopes/eec9b274-0c81-4334-bdc2-54e90e689b9a/run_status",RUN_MANAGE:"https://auth.globus.org/scopes/eec9b274-0c81-4334-bdc2-54e90e689b9a/run_manage"};var le={};u(le,{HOSTS:()=>Me,ID:()=>L});var L="TIMER",Me={sandbox:"sandbox.timer.automate.globus.org",production:"timer.automate.globus.org",staging:"staging.timer.automate.globus.org",integration:"integration.timer.automate.globus.org",test:"test.timer.automate.globus.org",preview:"preview.timer.automate.globus.org"};var me={};u(me,{HOSTS:()=>we,ID:()=>P,SCOPES:()=>N});var P="GROUPS",we={sandbox:"groups.api.sandbox.globuscs.info",production:"groups.api.globus.org",staging:"groups.api.staging.globuscs.info",integration:"groups.api.integration.globuscs.info",test:"groups.api.test.globuscs.info",preview:"groups.api.preview.globuscs.info"},N={ALL:"urn:globus:auth:scope:groups.api.globus.org:all",VIEW_MY:"urn:globus:auth:scope:groups.api.globus.org:view_my_groups_and_membership"};var fe={};u(fe,{HOSTS:()=>Le,ID:()=>T,SCOPES:()=>x});var T="SEARCH",Le={sandbox:"search.api.sandbox.globuscs.info",production:"search.api.globus.org",staging:"search.api.staging.globuscs.info",integration:"search.api.integration.globuscs.info",test:"search.api.test.globuscs.info",preview:"search.api.preview.globus.org"},x={ALL:"urn:globus:auth:scope:search.api.globus.org:all",INGEST:"urn:globus:auth:scope:search.api.globus.org:ingest",SEARCH:"urn:globus:auth:scope:search.api.globus.org:search"};var he={};u(he,{HOSTS:()=>ke,ID:()=>C,SCOPES:()=>Y});var C="COMPUTE",ke={sandbox:"compute.api.sandbox.globuscs.info",production:"compute.api.globus.org",staging:"compute.api.staging.globuscs.info",integration:"compute.api.integration.globuscs.info",test:"compute.api.test.globuscs.info",preview:"compute.api.preview.globus.org"},Y={ALL:"https://auth.globus.org/scopes/facd7ccc-c5f4-42aa-916b-a0e270e2c2a9/all"};var _="AUTH",Ne={integration:"auth.integration.globuscs.info",sandbox:"auth.sandbox.globuscs.info",production:"auth.globus.org",test:"auth.test.globuscs.info",staging:"auth.staging.globuscs.info",preview:"auth.preview.globus.org"},B={VIEW_IDENTITIES:"urn:globus:auth:scope:auth.globus.org:view_identities"},Q={[_]:"auth.globus.org",[p]:"transfer.api.globus.org",[E]:"flows.globus.org",[P]:"groups.api.globus.org",[T]:"search.api.globus.org",[L]:"524230d7-ea86-4a52-8312-86065a9e0417",[C]:"funcx_service"};var Fe={};u(Fe,{EnvironmentConfigurationError:()=>X,isAuthorizationRequirementsError:()=>Z,isConsentRequiredError:()=>Ie,isErrorWellFormed:()=>tr,toAuthorizationQueryParams:()=>Ge});var X=class extends Error{name="EnvironmentConfigurationError";constructor(t,r){super(),this.message=`Invalid configuration value provided for ${t} (${r}).`}};function tr(e){return typeof e=="object"&&e!==null&&"code"in e&&"message"in e}function Ie(e){return tr(e)&&e.code==="ConsentRequired"&&"required_scopes"in e&&Array.isArray(e.required_scopes)}var Wr=["required_scopes"];function Ge(e){let t={scope:e.authorization_parameters.required_scopes?.join(" "),...e.authorization_parameters};return Object.entries(t).reduce((r,[o,a])=>{if(Wr.includes(o)||a===void 0||a===null)return r;let d=a;return Array.isArray(d)?d=d.join(","):typeof a=="boolean"&&(d=d?"true":"false"),{...r,[o]:d}},{})}function Z(e){return typeof e=="object"&&e!==null&&"authorization_parameters"in e&&typeof e.authorization_parameters=="object"&&e.authorization_parameters!==null}function Yr(){return typeof window<"u"?window:process}function Qr(e){return typeof window==typeof e}function qe(e,t){let r=Yr(),o;return Qr(r)?o=r:o=r.env,e in o?o[e]:t}var rr={PRODUCTION:"production",PREVIEW:"preview",STAGING:"staging",SANDBOX:"sandbox",INTEGRATION:"integration",TEST:"test"},I={[_]:_,[p]:p,[E]:E,[P]:P,[T]:T,[L]:L,[C]:C},Xr={[_]:Ne,[p]:Ae,[E]:Ce,[P]:we,[T]:Le,[L]:Me,[C]:ke};function je(e){let t=qe("GLOBUS_SDK_OPTIONS",{});return typeof t=="string"&&(t=JSON.parse(t)),{...t,...e,fetch:{...t?.fetch,...e?.fetch,options:{...t?.fetch?.options,...e?.fetch?.options,headers:{...t?.fetch?.options?.headers,...e?.fetch?.options?.headers}}}}}function z(){let e=je(),t=qe("GLOBUS_SDK_ENVIRONMENT",e?.environment??rr.PRODUCTION);if(e?.environment&&t!==e.environment&&R("debug","GLOBUS_SDK_ENVIRONMENT and GLOBUS_SDK_OPTIONS.environment are set to different values. GLOBUS_SDK_ENVIRONMENT will take precedence"),!t||!Object.values(rr).includes(t))throw new X("GLOBUS_SDK_ENVIRONMENT",t);return t}function Zr(e,t=z()){return Xr[e][t]}function or(e,t=z()){let r=Zr(e,t);return qe(`GLOBUS_SDK_SERVICE_URL_${e}`,r?`https://${r}`:void 0)}function eo(e){let t=new URLSearchParams;return Array.from(Object.entries(e)).forEach(([r,o])=>{Array.isArray(o)?t.set(r,o.join(",")):o!==void 0&&t.set(r,String(o))}),t.toString()}function to(e,t="",r=z()){let o=or(e,r);return new URL(t,o)}function ee(e,t,r,o){let a;return typeof e=="object"?a=new URL(t,e.host):a=to(e,t,o?.environment),r&&r.search&&(a.search=eo(r.search)),a.toString()}var He={};u(He,{consents:()=>Ue,get:()=>oo,getAll:()=>so});var ir=qr(nr());async function s(e,t,r){let o=je(r),a=o?.fetch?.options||{},d={...be(),...t?.headers,...a.headers},v=o?.manager,y;if(e.resource_server&&v&&(y=v.tokens.getByResourceServer(e.resource_server),y&&(d.Authorization=`Bearer ${y.access_token}`)),e.scope&&v&&(typeof e.service=="string"||"endpoint_id"in e.service)){let j=typeof e.service=="string"?Q[e.service]:e.service.endpoint_id;y=v.tokens.getByResourceServer(j),y&&(d.Authorization=`Bearer ${y.access_token}`)}let b=t?.body;!b&&t?.payload&&(b=JSON.stringify(t.payload)),!d?.["Content-Type"]&&b&&(d["Content-Type"]="application/json");let q=ee(e.service,e.path,{search:t?.query},o),w={method:e.method,body:b,...a,headers:d},h=ir.default;if(a?.__callable&&(h=a.__callable.bind(this),delete w.__callable),e.preventRetry||!v||!y||!te(y))return h(q,w);let M=await h(q,w);if(M.ok)return M;let $;try{$=Z(await M.clone().json())}catch{$=!1}if(M.status===401&&!$){let j=await v.refreshToken(y);return j?h(q,{...w,headers:{...w.headers,Authorization:`Bearer ${j.access_token}`}}):M}return M}var Ue={};u(Ue,{getAll:()=>ro});var ro=function(e,t={},r){return s({service:_,scope:B.VIEW_IDENTITIES,path:`/v2/api/identities/${e}/consents`},t,r)};var oo=function(e,t={},r){return s({service:_,scope:B.VIEW_IDENTITIES,path:`/v2/api/identities/${e}`},t,r)},so=function(e={},t){return s({service:_,scope:B.VIEW_IDENTITIES,path:"/v2/api/identities"},e,t)};var F={};u(F,{token:()=>Je,userinfo:()=>lo});var Je={};u(Je,{exchange:()=>io,introspect:()=>ao,refresh:()=>co,revoke:()=>po,token:()=>ar,validate:()=>uo});function no(e){return new URLSearchParams(e)}function re(e){return{...e,body:e.payload?no(e.payload):void 0,headers:{...e?.headers||{},Accept:"application/json","Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}}}var ar=function(e={},t){return s({service:_,scope:void 0,path:"/v2/oauth2/token",method:"POST",preventRetry:!0},re(e),t)},io=ar,ao=function(e,t){if(!e?.payload)throw new Error("'payload' is required for introspect");return s({service:_,scope:void 0,path:"/v2/oauth2/token/introspect",method:"POST",preventRetry:!0},re(e),t)},po=function(e,t){if(!e?.payload)throw new Error("'payload' is required for revoke");return s({service:_,scope:void 0,path:"/v2/oauth2/token/revoke",method:"POST",preventRetry:!0},re(e),t)},co=function(e,t){if(!e?.payload)throw new Error("'payload' is required for revoke");return s({service:_,scope:void 0,path:"/v2/oauth2/token",method:"POST",preventRetry:!0},re(e),t)},uo=function(e,t){if(!e?.payload)throw new Error("'payload' is required for validate");return s({service:_,scope:void 0,path:"/v2/oauth2/token/validate",method:"POST",preventRetry:!0},re(e),t)};var lo=function(e,t){return s({service:_,scope:void 0,path:"/v2/oauth2/userinfo",method:"GET"},e,t)};var Be={};u(Be,{hasConsentForScope:()=>mo,splitScopeString:()=>$e,toScopeTree:()=>cr});function $e(e){let t=[],r="",o=0;return e.split("").forEach((a,d)=>{r+=a,a==="["&&(o+=1),a==="]"&&(o-=1),(a===" "&&o===0||d===e.length-1&&r)&&(t.push(r.trim()),r="")}),t}function pr(e){let t=e,r=t.startsWith("*");r&&(t=t.replace(/^\*\s*/,""));let o=[],a=t.indexOf("[");if(a===-1)return{scope:t,atomically_revocable:r,children:[]};let d=t.slice(0,a),v=t.slice(a+1,-1);return o=$e(v).map(pr),{scope:d,atomically_revocable:r,children:o}}function cr(e){return $e(e).map(pr)}function mo(e,t){let r=cr(t);function o(a,d){let v=e.find(y=>y.scope_name===a.scope&&(d?y.dependency_path.join(",")===[...d,y.id].join(","):y.dependency_path.length===1));return v?a.children.length?a.children.every(y=>o(y,d?[...d,v.id]:[v.id])):v.status==="approved":!1}return r.every(a=>o(a))}var ze=ge;function Ve(){return ee(_,"/v2/oauth2/authorize")}function fo(){return ee(_,"/v2/oauth2/token")}function K(e){return typeof e=="object"&&e!==null&&"access_token"in e}function te(e){return K(e)&&e!==null&&"refresh_token"in e}function ve(e){return K(e)&&e!==null&&"resource_server"in e}var oe=class{constructor(t){this.name=t}#e=[];addListener(t){return this.#e.push(t),()=>this.removeListener(t)}removeListener(t){this.#e=this.#e.filter(r=>r!==t)}clearListeners(){this.#e=[]}async dispatch(t){await Promise.all(this.#e.map(r=>r(t)))}};function dr(){return"crypto"in globalThis}function Ye(){return"webcrypto"in globalThis.crypto?globalThis.crypto.webcrypto:globalThis.crypto}var ho=e=>btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");async function go(e){let t=await Ye().subtle.digest("SHA-256",new TextEncoder().encode(e));return String.fromCharCode(...new Uint8Array(t))}var We="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",ur=`${We}-._~`;function lr(){return Array.from(Ye().getRandomValues(new Uint8Array(43))).map(e=>ur[e%ur.length]).join("")}async function mr(e){let t=await go(e);return ho(t)}function fr(){return Array.from(Ye().getRandomValues(new Uint8Array(16))).map(e=>We[e%We.length]).join("")}var W={PKCE_STATE:"pkce_state",PKCE_CODE_VERIFIER:"pkce_code_verifier"};function yo(){sessionStorage.removeItem(W.PKCE_STATE),sessionStorage.removeItem(W.PKCE_CODE_VERIFIER)}var _e=class e{#e;constructor(t){if(this.#e=t,e.supported===!1)throw new Error("RedirectTransport is not supported in this environment.")}static supported=dr();async send(){let t=lr(),r=await mr(t),o=this.#e.params?.state??fr();sessionStorage.setItem(W.PKCE_CODE_VERIFIER,t),sessionStorage.setItem(W.PKCE_STATE,o);let a={response_type:"code",client_id:this.#e.client,scope:this.#e.scopes||"",redirect_uri:this.#e.redirect,state:o,code_challenge:r,code_challenge_method:"S256",...this.#e.params||{}},d=new URL(Ve());d.search=new URLSearchParams(a).toString(),window.location.assign(d.toString())}async getToken(t={shouldReplace:!0,includeConsentedScopes:!1}){let r=new URL(window.location.href),o=new URLSearchParams(r.search);if(o.get("error"))throw new Error(o.get("error_description")||"An error occurred during the authorization process.");let a=o.get("code");if(!a)return;let d=sessionStorage.getItem(W.PKCE_STATE),v=sessionStorage.getItem(W.PKCE_CODE_VERIFIER);if(yo(),o.get("state")!==d)throw new Error('Invalid State. The received "state" parameter does not match the expected state.');if(!v)throw new Error("Invalid Code Verifier");let y={code:a,client_id:this.#e.client,code_verifier:v,redirect_uri:this.#e.redirect,grant_type:"authorization_code"},b=await(await F.token.exchange({query:t.includeConsentedScopes?{include_consented_scopes:!0}:void 0,payload:y})).json();return t.shouldReplace&&(o.delete("code"),o.delete("state"),r.search=o.toString(),window.location.replace(r)),b}};var Te=class{#e;constructor(t){this.#e=t.manager}#r(t){let r=this.#e.storage.getItem(t)||"null",o=null;try{let a=JSON.parse(r);K(a)&&(o=a)}catch{}return o}#t(t){let r=ze.RESOURCE_SERVERS?.[t];return this.getByResourceServer(r)}getByResourceServer(t){return this.#r(`${this.#e.storageKeyPrefix}${t}`)}get auth(){return this.#t(I.AUTH)}get transfer(){return this.#t(I.TRANSFER)}get flows(){return this.#t(I.FLOWS)}get groups(){return this.#t(I.GROUPS)}get search(){return this.#t(I.SEARCH)}get timer(){return this.#t(I.TIMER)}get compute(){return this.#t(I.COMPUTE)}gcs(t){return this.getByResourceServer(t)}getAll(){return Object.keys(this.#e.storage).reduce((r,o)=>(o.startsWith(this.#e.storageKeyPrefix)&&r.push(this.#r(o)),r),[]).filter(K)}add(t){let r=Date.now(),o=r+t.expires_in*1e3;this.#e.storage.setItem(`${this.#e.storageKeyPrefix}${t.resource_server}`,JSON.stringify({...t,__metadata:{created:r,expires:o}})),"other_tokens"in t&&t.other_tokens?.forEach(a=>{this.add(a)})}remove(t){this.#e.storage.removeItem(`${this.#e.storageKeyPrefix}${t.resource_server}`)}static isTokenExpired(t,r=0){if(!(!t||!t.__metadata||typeof t.__metadata.expires!="number"))return Date.now()+r>=t.__metadata.expires}};var se=class{#e={};getItem(t){return this.#e[t]!==void 0?this.#e[t]:null}setItem(t,r){this.#e[t]=r}removeItem(t){delete this.#e[t]}key(t){return Object.keys(this.#e)[t]}clear(){this.#e={}}get length(){return Object.keys(this.#e).length}};var So={redirect:_e},hr={useRefreshTokens:!1,defaultScopes:"openid profile email",transport:"redirect"},gr={execute:!0,additionalParams:void 0},ne=class{#e;configuration;storage;#r=!1;get authenticated(){return this.#r}set authenticated(t){t!==this.#r&&(this.#r=t,this.#n())}tokens;events={authenticated:new oe("authenticated"),revoke:new oe("revoke")};constructor(t){if(!t.client)throw new Error("You must provide a `client` for your application.");let r=t.defaultScopes===!1?"":t.defaultScopes??hr.defaultScopes;this.configuration={...hr,...t,scopes:[t.scopes?t.scopes:"",r].filter(o=>o.length).join(" ")},this.storage=t.storage||new se,this.configuration.events&&Object.entries(this.configuration.events).forEach(([o,a])=>{o in this.events&&this.events[o].addListener(a)}),this.tokens=new Te({manager:this}),this.#t()}get storageKeyPrefix(){return`${this.configuration.client}:`}get user(){let t=this.getGlobusAuthToken();return t&&t.id_token?er(t.id_token):null}async refreshTokens(){R("debug","AuthorizationManager.refreshTokens");let t=await Promise.allSettled(this.tokens.getAll().map(r=>te(r)?this.refreshToken(r):Promise.resolve(null)));return this.#t(),t}async refreshToken(t){R("debug",`AuthorizationManager.refreshToken | resource_server=${t.resource_server}`);try{let r=await(await F.token.refresh({payload:{client_id:this.configuration.client,refresh_token:t.refresh_token,grant_type:"refresh_token"}})).json();if(ve(r))return this.addTokenResponse(r),r}catch{R("error",`AuthorizationManager.refreshToken | resource_server=${t.resource_server}`)}return null}hasGlobusAuthToken(){return this.getGlobusAuthToken()!==null}getGlobusAuthToken(){let t=this.storage.getItem(`${this.storageKeyPrefix}${Q.AUTH}`);return t?JSON.parse(t):null}#t(){R("debug","AuthorizationManager.#checkAuthorizationState"),this.hasGlobusAuthToken()&&(this.authenticated=!0)}async#n(){let t=this.authenticated,r=this.getGlobusAuthToken()??void 0;await this.events.authenticated.dispatch({isAuthenticated:t,token:r})}reset(){Object.keys(this.storage).forEach(t=>{t.startsWith(this.storageKeyPrefix)&&this.storage.removeItem(t)}),this.authenticated=!1}#s(t){return`${t}${this.configuration.useRefreshTokens?" offline_access":""}`}#o(t){let{scopes:r,...o}=t??{},a=So[this.configuration.transport||"redirect"],d=this.#s(r??(this.configuration.scopes||""));return this.storage instanceof se&&(d=[...new Set(d.split(" ").concat((this.configuration?.scopes||"").split(" ")))].join(" ")),new a({client:this.configuration.client,redirect:this.configuration.redirect,scopes:d,...o,params:{...o?.params}})}async login(t={additionalParams:{}}){R("debug","AuthorizationManager.login"),this.reset(),await this.#o({params:t?.additionalParams}).send()}async prompt(t){R("debug","AuthorizationManager.prompt"),await this.#o(t).send()}async handleCodeRedirect(t={shouldReplace:!0,additionalParams:{}}){R("debug","AuthorizationManager.handleCodeRedirect");let r=await this.#o({params:t?.additionalParams}).getToken({shouldReplace:t?.shouldReplace,includeConsentedScopes:t?.includeConsentedScopes});return ve(r)&&(R("debug",`AuthorizationManager.handleCodeRedirect | response=${JSON.stringify(r)}`),this.addTokenResponse(r)),r}async handleErrorResponse(t,r){let o=typeof r=="boolean"?{...gr,execute:r}:{...gr,...r};R("debug",`AuthorizationManager.handleErrorResponse | response=${JSON.stringify(t)} execute=${o.execute}`);let a=async()=>{};return Z(t)&&(R("debug","AuthorizationManager.handleErrorResponse | error=AuthorizationRequirementsError"),a=async()=>{await this.handleAuthorizationRequirementsError(t,{additionalParams:o.additionalParams})}),Ie(t)&&(R("debug","AuthorizationManager.handleErrorResponse | error=ConsentRequiredError"),a=async()=>{await this.handleConsentRequiredError(t,{additionalParams:o.additionalParams})}),"code"in t&&t.code==="AuthenticationFailed"&&(R("debug","AuthorizationManager.handleErrorResponse | error=AuthenticationFailed"),a=async()=>{await this.revoke()}),o.execute===!0?await a():a}async handleAuthorizationRequirementsError(t,r){this.#e=this.#o({params:{prompt:"login",...Ge(t),...r?.additionalParams}}),await this.#e.send()}async handleConsentRequiredError(t,r){this.#e=this.#o({scopes:this.#s(t.required_scopes.join(" ")),params:{...r?.additionalParams}}),await this.#e.send()}addTokenResponse=t=>{this.tokens.add(t),this.#t()};async revoke(){R("debug","AuthorizationManager.revoke");let t=Promise.all(this.tokens.getAll().map(this.#i.bind(this)));this.reset(),await t,await this.events.revoke.dispatch()}#i(t){return R("debug",`AuthorizationManager.revokeToken | resource_server=${t.resource_server}`),F.token.revoke({payload:{client_id:this.configuration.client,token:t.access_token}})}};function vo(e){return new ne(e)}var mt={};u(mt,{CONFIG:()=>_s,access:()=>rt,collectionBookmarks:()=>ot,endpoint:()=>et,endpointManager:()=>at,endpointSearch:()=>yr,fileOperations:()=>Xe,task:()=>tt,taskSubmission:()=>Ze,utils:()=>lt});var yr=function(e,t){let r={...e,query:e?.query};return s({service:p,scope:c.ALL,path:"/v0.10/endpoint_search"},r,t)};var Xe={};u(Xe,{ls:()=>_o,mkdir:()=>To,rename:()=>Ro,stat:()=>Oo,symlink:()=>Eo});function J(e){return e==="GET"?{}:{"Content-Type":"application/json"}}var _o=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/operation/endpoint/${e}/ls`},t,r)},To=function(e,t,r){let o={payload:{DATA_TYPE:"mkdir",...t?.payload},headers:{...J("POST"),...t?.headers}};return s({service:p,scope:c.ALL,path:`/v0.10/operation/endpoint/${e}/mkdir`,method:"POST"},o,r)},Ro=function(e,t,r){let o={payload:{DATA_TYPE:"rename",...t?.payload},headers:{...J("POST"),...t?.headers}};return s({service:p,scope:c.ALL,path:`/v0.10/operation/endpoint/${e}/rename`,method:"POST"},o,r)},Eo=function(e,t,r){let o={payload:{DATA_TYPE:"symlink",...t?.payload},headers:{...J("POST"),...t?.headers}};return s({service:p,scope:c.ALL,path:`/v0.10/operation/endpoint/${e}/symlink`,method:"POST"},o,r)},Oo=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/operation/endpoint/${e}/stat`},t,r)};var Ze={};u(Ze,{submissionId:()=>xo,submitDelete:()=>bo,submitTransfer:()=>Po});var bo=function(e,t){let r={payload:{DATA_TYPE:"delete",...e?.payload},headers:{...J("POST"),...e?.headers}};return s({service:p,scope:c.ALL,path:"/v0.10/delete",method:"POST"},r,t)},Po=function(e,t){let r={payload:{DATA_TYPE:"transfer",...e?.payload},headers:{...J("POST"),...e?.headers}};return s({service:p,scope:c.ALL,path:"/v0.10/transfer",method:"POST"},r,t)},xo=function(e,t){return s({service:p,scope:c.ALL,path:"/v0.10/submission_id"},e,t)};var et={};u(et,{create:()=>Ao,get:()=>Do,remove:()=>Mo,update:()=>Co});var Do=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/endpoint/${e}`},t,r)},Ao=function(e,t){return e?.payload&&Object.assign(e.payload,{DATA_TYPE:"shared_endpoint"}),s({service:p,scope:c.ALL,path:"/v0.10/shared_endpoint",method:"POST"},e,t)},Co=function(e,t,r){return t?.payload&&Object.assign(t.payload,{DATA_TYPE:"endpoint"}),s({service:p,scope:c.ALL,path:`/v0.10/endpoint/${e}`,method:"PUT"},t,r)},Mo=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/endpoint/${e}`,method:"DELETE"},t,r)};var tt={};u(tt,{cancel:()=>No,get:()=>Lo,getAll:()=>wo,getEventList:()=>Go,getPauseInfo:()=>jo,getSkippedErrors:()=>qo,getSuccessfulTransfers:()=>Fo,remove:()=>Io,update:()=>ko});var wo=function(e={},t){return s({service:p,scope:c.ALL,path:"/v0.10/task_list"},e,t)},Lo=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/task/${e}`},t,r)},ko=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/task/${e}`,method:"PUT"},t,r)},No=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/task/${e}/cancel`,method:"POST"},t,r)},Io=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/task/${e}/remove`,method:"POST"},t,r)},Go=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/task/${e}/event_list`},t,r)},Fo=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/task/${e}/successful_transfers`},t,r)},qo=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/task/${e}/skipped_errors`},t,r)},jo=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/task/${e}/pause_info`},t,r)};var rt={};u(rt,{create:()=>Ho,get:()=>Jo,getAll:()=>Uo,remove:()=>Bo,update:()=>$o});var Uo=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/endpoint/${e}/access_list`},t,r)},Ho=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/endpoint/${e}/access`,method:"POST"},t,r)},Jo=function({endpoint_xid:e,id:t},r,o){return s({service:p,scope:c.ALL,path:`/v0.10/endpoint/${e}/access/${t}`},r,o)},$o=function({endpoint_xid:e,id:t},r,o){return s({service:p,scope:c.ALL,path:`/v0.10/endpoint/${e}/access/${t}`,method:"PUT"},r,o)},Bo=function({endpoint_xid:e,id:t},r,o){return s({service:p,scope:c.ALL,path:`/v0.10/endpoint/${e}/access/${t}`,method:"DELETE"},r,o)};var ot={};u(ot,{create:()=>Vo,get:()=>Ko,getAll:()=>zo,remove:()=>Yo,update:()=>Wo});var zo=function(e,t){return s({service:p,scope:c.ALL,path:"/v0.10/bookmark_list"},e,t)},Vo=function(e,t){return s({service:p,scope:c.ALL,path:"/v0.10/bookmark",method:"POST"},e,t)},Ko=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/bookmark/${e}`},t,r)},Wo=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/bookmark/${e}`,method:"PUT"},t,r)},Yo=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/bookmark/${e}`,method:"DELETE"},t,r)};var at={};u(at,{endpoint:()=>st,pauseRule:()=>nt,task:()=>it});var st={};u(st,{get:()=>Qo,getAccessList:()=>Zo,getHostedEndpoints:()=>Xo,getMonitoredEndpoints:()=>es});var Qo=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/endpoint_manager/endpoint/${e}`},t,r)},Xo=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/endpoint_manager/endpoint/${e}/hosted_endpoint_list`},t,r)},Zo=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/endpoint_manager/endpoint/${e}/access_list`},t,r)},es=function(e={},t){return s({service:p,scope:c.ALL,path:"/v0.10/endpoint_manager/monitored_endpoints"},e,t)};var nt={};u(nt,{create:()=>rs,get:()=>os,getAll:()=>ts,remove:()=>ns,update:()=>ss});var ts=function(e,t){return s({service:p,scope:c.ALL,path:"/v0.10/endpoint_manager/pause_rule_list"},e,t)},rs=function(e,t){return s({service:p,scope:c.ALL,path:"/v0.10/endpoint_manager/pause_rule",method:"POST"},e,t)},os=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/endpoint_manager/pause_rule/${e}`},t,r)},ss=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/endpoint_manager/pause_rule/${e}`,method:"PUT"},t,r)},ns=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/endpoint_manager/pause_rule/${e}`,method:"DELETE"},t,r)};var it={};u(it,{cancel:()=>ps,get:()=>as,getAdminCancel:()=>cs,getAll:()=>is,getEventList:()=>us,getPauseInfo:()=>hs,getSkippedErrors:()=>ls,getSuccessfulTransfers:()=>ds,pause:()=>ms,resume:()=>fs});var is=function(e={},t){return s({service:p,scope:c.ALL,path:"/v0.10/task_list"},e,t)},as=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/endpoint_manager/task/${e}`},t,r)},ps=function(e,t){return s({service:p,scope:c.ALL,path:"/v0.10/endpoint_manager/admin_cancel",method:"POST"},e,t)},cs=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/endpoint_manager/admin_cancel/${e}`,method:"POST"},t,r)},us=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/endpoint_manager/task/${e}/event_list`},t,r)},ds=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/endpoint_manager/task/${e}/successful_transfers`},t,r)},ls=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/endpoint_manager/task/${e}/skipped_errors`},t,r)},ms=function(e,t){return s({service:p,scope:c.ALL,path:"/v0.10/endpoint_manager/admin_pause",method:"POST"},e,t)},fs=function(e,t){return s({service:p,scope:c.ALL,path:"/v0.10/endpoint_manager/admin_resume",method:"POST"},e,t)},hs=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/endpoint_manager/task/${e}/pause_info`},t,r)};var lt={};u(lt,{getDomainFromEndpoint:()=>vs,isDirectory:()=>gs,isFileDocument:()=>vr,readableBytes:()=>ys});function vr(e){return typeof e=="object"&&e!==null&&"DATA_TYPE"in e&&e.DATA_TYPE==="file"}function gs(e){return vr(e)&&e.type==="dir"}var pt=1e3,ct=pt*1e3,ut=ct*1e3,dt=ut*1e3,Sr=dt*1e3;function ys(e,t=2){let r="B",o=1;if(e<pt)return`${e} ${r}`;e<ct?(r="KB",o=pt):e<ut?(r="MB",o=ct):e<dt?(r="GB",o=ut):e<Sr?(r="TB",o=dt):(r="PB",o=Sr);let a=e/o,[d,v]=`${a}`.split("."),y=`${d}`;if(v&&v.length){let b=v.slice(0,t);b.length&&(y=`${d}.${b}`)}return`${y} ${r}`}var Ss=["dnsteam.globuscs.info","data.globus.org","dn.glob.us"];function vs(e){let{tlsftp_server:t}=e;if(!t||typeof t!="string")return null;let{hostname:r}=new URL(t.replace("tlsftp","https"));return!Ss.find(d=>r.endsWith(d))&&/(?:[gm]-\w{6}.)?(\w+(\.\w+)+)$/.exec(r)?.[1]||r||null}var _s=ue;var St={};u(St,{CONFIG:()=>Ms,entry:()=>gt,index:()=>yt,query:()=>ft,subject:()=>ht});var ft={};u(ft,{get:()=>Ts,post:()=>Rs});var Ts=function(e,t,r){return s({service:T,scope:x.SEARCH,path:`/v1/index/${e}/search`},t,r)},Rs=function(e,t,r){return s({service:T,scope:x.SEARCH,path:`/v1/index/${e}/search`,method:"POST"},t,r)};var ht={};u(ht,{get:()=>Es});var Es=function(e,t,r){return s({service:T,scope:x.SEARCH,path:`/v1/index/${e}/subject`},t,r)};var gt={};u(gt,{get:()=>Os});var Os=function(e,t,r){return s({service:T,scope:x.SEARCH,path:`/v1/index/${e}/entry`},t,r)};var yt={};u(yt,{create:()=>xs,get:()=>bs,getAll:()=>Ps,ingest:()=>Cs,remove:()=>Ds,reopen:()=>As});var bs=function(e,t,r){return s({service:T,path:`/v1/index/${e}`},t,r)},Ps=function(e,t){return s({service:T,scope:x.ALL,path:"/v1/index_list"},e,t)},xs=function(e,t){return s({service:T,scope:x.ALL,path:"/v1/index",method:"POST"},e,t)},Ds=function(e,t,r){return s({service:T,scope:x.ALL,path:`/v1/index/${e}`,method:"DELETE"},t,r)},As=function(e,t,r){return s({service:T,scope:x.ALL,path:`/v1/index/${e}/reopen`,method:"POST"},t,r)},Cs=function(e,t,r){return s({service:T,scope:x.ALL,path:`/v1/index/${e}/ingest`,method:"POST"},t,r)};var Ms=fe;var Rt={};u(Rt,{CONFIG:()=>Is,groups:()=>vt,membership:()=>Tt,policies:()=>_t});var vt={};u(vt,{get:()=>Ls,getMyGroups:()=>ws});var ws=function(e,t){return s({scope:N.ALL,path:"/v2/groups/my_groups",service:P},e,t)},Ls=function(e,t,r){return s({service:P,scope:N.ALL,path:`/v2/groups/${e}`},t,r)};var _t={};u(_t,{get:()=>ks});var ks=function(e,t,r){return s({scope:N.ALL,path:`/v2/groups/${e}/policies`,service:P},t,r)};var Tt={};u(Tt,{act:()=>Ns});var Ns=function(e,t,r){if(!t?.payload)throw new Error("payload is required.");return s({service:P,scope:N.ALL,path:`/v2/groups/${e}`,method:"POST"},t,r)};var Is=me;var bt={};u(bt,{CONFIG:()=>zs,flows:()=>Et,runs:()=>Ot});var Et={};u(Et,{create:()=>_r,deploy:()=>Hs,get:()=>Fs,getAll:()=>Gs,remove:()=>qs,run:()=>js,validate:()=>Us});var Gs=function(e,t){return s({service:E,scope:D.VIEW_FLOWS,path:"/flows"},e,t)},Fs=function(e,t,r){return s({service:E,scope:D.VIEW_FLOWS,path:`/flows/${e}`},t,r)},qs=function(e,t,r){return s({scope:D.MANAGE_FLOWS,service:E,path:`/flows/${e}`,method:"DELETE"},t,r)},js=function(e,t,r){return s({service:E,scope:D.VIEW_FLOWS,path:`/flows/${e}/run`,method:"POST"},t,r)},Us=function(e,t){return s({service:E,scope:D.MANAGE_FLOWS,path:"/flows/validate",method:"POST"},e,t)},_r=function(e,t){return s({service:E,scope:D.MANAGE_FLOWS,path:"/flows",method:"POST"},e,t)},Hs=_r;var Ot={};u(Ot,{cancel:()=>$s,getAll:()=>Js,getLog:()=>Bs});var Js=function(e={},t){return s({service:E,scope:D.RUN_MANAGE,path:"/runs"},e,t)},$s=function(e,t,r){return s({service:E,scope:D.RUN_MANAGE,path:`/runs/${e}/cancel`,method:"POST"},t,r)},Bs=function(e,t,r){return s({service:E,scope:D.RUN_MANAGE,path:`/runs/${e}/log`},t,r)};var zs=de;var It={};u(It,{collections:()=>Pt,endpoint:()=>xt,getScopes:()=>Nn,https:()=>Dt,nodes:()=>At,roles:()=>Ct,storageGateways:()=>Mt,userCredentials:()=>wt,utils:()=>Nt,versioning:()=>kt});var Pt={};u(Pt,{create:()=>Ys,get:()=>Ks,getAll:()=>Vs,patch:()=>Xs,remove:()=>Ws,resetOwnerString:()=>en,update:()=>Qs,updateOwnerString:()=>Zs});var Vs=function(e,t,r){return s({service:e,resource_server:e.endpoint_id,path:"/api/collections"},t,r)},Ks=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:`/api/collections/${t}`},r,o)},Ws=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:`/api/collections/${t}`,method:"DELETE"},r,o)},Ys=function(e,t,r){return s({service:e,resource_server:e.endpoint_id,path:"/api/collections",method:"POST"},t,r)},Qs=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:`/api/collections/${t}`,method:"PUT"},r,o)},Xs=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:`/api/collections/${t}`,method:"PATCH"},r,o)},Zs=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:`/api/collections/${t}/owner_string`,method:"PUT"},r,o)},en=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:`/api/collections/${t}/owner_string`,method:"DELETE"},r,o)};var xt={};u(xt,{get:()=>tn,patch:()=>on,resetOwnerString:()=>pn,update:()=>rn,updateOwner:()=>nn,updateOwnerString:()=>an,updateSubscriptionId:()=>sn});var tn=function(e,t,r){return s({service:e,resource_server:e.endpoint_id,path:"/api/endpoint"},t,r)},rn=function(e,t,r){return s({service:e,resource_server:e.endpoint_id,path:"/api/endpoint",method:"PUT"},t,r)},on=function(e,t,r){return s({service:e,resource_server:e.endpoint_id,path:"/api/endpoint",method:"PATCH"},t,r)},sn=function(e,t,r){return s({service:e,resource_server:e.endpoint_id,path:"/api/endpoint/subscription_id",method:"PUT"},t,r)},nn=function(e,t,r){return s({service:e,resource_server:e.endpoint_id,path:"/api/endpoint/owner",method:"PUT"},t,r)},an=function(e,t,r){return s({service:e,resource_server:e.endpoint_id,path:"/api/endpoint/owner_string",method:"PUT"},t,r)},pn=function(e,t,r){return s({service:e,resource_server:e.endpoint_id,path:"/api/endpoint/owner_string",method:"DELETE"},t,r)};var Dt={};u(Dt,{get:()=>cn,remove:()=>un,update:()=>dn});var cn=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:t},r,o)},un=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:t,method:"DELETE"},r,o)},dn=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:t,method:"PUT"},r,o)};var At={};u(At,{create:()=>hn,get:()=>mn,getAll:()=>ln,patch:()=>yn,remove:()=>fn,update:()=>gn});var ln=function(e,t,r){return s({service:e,resource_server:e.endpoint_id,path:"/api/nodes"},t,r)},mn=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:`/api/nodes/${t}`},r,o)},fn=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:`/api/nodes/${t}`,method:"DELETE"},r,o)},hn=function(e,t,r){return s({service:e,resource_server:e.endpoint_id,path:"/api/nodes",method:"POST"},t,r)},gn=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:`/api/nodes/${t}`,method:"PUT"},r,o)},yn=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:`/api/nodes/${t}`,method:"PATCH"},r,o)};var Ct={};u(Ct,{create:()=>Tn,get:()=>vn,getAll:()=>Sn,remove:()=>_n});var Sn=function(e,t,r){return s({service:e,resource_server:e.endpoint_id,path:"/api/roles"},t,r)},vn=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:`/api/roles/${t}`},r,o)},_n=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:`/api/roles/${t}`,method:"DELETE"},r,o)},Tn=function(e,t,r){return s({service:e,resource_server:e.endpoint_id,path:"/api/roles",method:"POST"},t,r)};var Mt={};u(Mt,{create:()=>bn,get:()=>En,getAll:()=>Rn,patch:()=>xn,remove:()=>On,update:()=>Pn});var Rn=function(e,t,r){return s({service:e,resource_server:e.endpoint_id,path:"/api/storage_gateways"},t,r)},En=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:`/api/storage_gateways/${t}`},r,o)},On=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:`/api/storage_gateways/${t}`,method:"DELETE"},r,o)},bn=function(e,t,r){return s({service:e,resource_server:e.endpoint_id,path:"/api/storage_gateways",method:"POST"},t,r)},Pn=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:`/api/storage_gateways/${t}`,method:"PUT"},r,o)},xn=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:`/api/storage_gateways/${t}`,method:"PATCH"},r,o)};var wt={};u(wt,{create:()=>Mn,get:()=>An,getAll:()=>Dn,patch:()=>Ln,remove:()=>Cn,update:()=>wn});var Dn=function(e,t,r){return s({service:e,resource_server:e.endpoint_id,path:"/api/user_credentials"},t,r)},An=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:`/api/user_credentials/${t}`},r,o)},Cn=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:`/api/user_credentials/${t}`,method:"DELETE"},r,o)},Mn=function(e,t,r){return s({service:e,resource_server:e.endpoint_id,path:"/api/user_credentials",method:"POST"},t,r)},wn=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:`/api/user_credentials/${t}`,method:"PUT"},r,o)},Ln=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:`/api/user_credentials/${t}`,method:"PATCH"},r,o)};var kt={};u(kt,{info:()=>Lt});var Lt=function(e,t,r){return s({service:e,path:"/api/info"},t,r)};var Nt={};u(Nt,{getEndpointIdFromURL:()=>kn,getGCSDomainFromURL:()=>Tr});var ie="data.globus.org";function Tr(e){let{host:t}=typeof e=="string"?new URL(e):e;if(!t.endsWith(ie))return t;let[r]=t.split(`.${ie}`),o=r.split(".");return(o.length===2?[...o,ie]:[o[1],o[2],ie]).join(".")}async function kn(e){let t=typeof e=="string"?new URL(e):e;if(!t.host.endsWith(ie))return null;let a=(await(await Lt({host:`https://${Tr(t)}`})).json()).data?.filter(d=>d.DATA_TYPE.startsWith("info#"))[0];return a&&"endpoint_id"in a?a.endpoint_id:null}var Rr={HIGH_ASSURANCE:"urn:globus:auth:scope:<ENDPOINT_ID>:manage_collections",NON_HIGH_ASSURANCE:"urn:globus:auth:scope:<ENDPOINT_ID>:manage_collections[*https://auth.globus.org/scopes/<MAPPED_COLLECTION_ID>/data_access]"};function Nn(e,t){let{endpoint_id:r}=e;if(!r)throw new Error("An 'endpoint_id' is required to determine the required scopes");return t?Rr[t].replace("<ENDPOINT_ID>",r):Object.entries(Rr).reduce((o,[a,d])=>({...o,[a]:d.replace("<ENDPOINT_ID>",r)}),{})}var Gt={};u(Gt,{CONFIG:()=>In,create:()=>Er});var Er=function(e,t){return s({service:L,scope:"https://auth.globus.org/scopes/524230d7-ea86-4a52-8312-86065a9e0417/timer",path:"/v2/timer",method:"POST"},e,t)};var In=le;var qt={};u(qt,{CONFIG:()=>jn,endpoints:()=>Ft});var Ft={};u(Ft,{get:()=>Fn,getAll:()=>Gn,getStatus:()=>qn});var Gn=function(e,t){return s({service:C,scope:Y.ALL,path:"/v2/endpoints",method:"GET"},e,t)},Fn=function(e,t,r){return s({service:C,scope:Y.ALL,path:`/v2/endpoints/${e}`,method:"GET"},t,r)},qn=function(e,t,r){return s({service:C,scope:Y.ALL,path:`/v2/endpoints/${e}/status`},t,r)};var jn=he;var jt={};u(jt,{HOSTS:()=>Or,host:()=>br,url:()=>Pr,urlFor:()=>Hn});var Or={integration:"app.integration.globuscs.info",sandbox:"app.sandbox.globuscs.info",test:"app.test.globuscs.info",staging:"app.staging.globuscs.info",preview:"app.preview.globus.org",production:"app.globus.org"};function br(e=z()){return Or[e]}function Pr(e,t){return new URL(e||"",`https://${br(t?.environment)}`)}var Un={TASK:"/activity/%s/overview",COLLECTION:"/file-manager/collections/%s/overview",ENDPOINT:"/file-manager/collections/%s/overview"};function Hn(e,t,r){let o=Un[e].replace(/%s/g,t?.join("/")||"");return Pr(o,r)}return jr(Jn);})();
3
3
  //# sourceMappingURL=globus.production.js.map