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B,KAAK,SAAS,YAAc,EAC5B,KAAK,SAAS,WACX,OAAO,KAAK,SAAS,WACrB,SAAQ,SAAS,GAChB,EAAS,EACb,IACO,IACT,CAEA,EAAM,KAAK,eAAiB,WAC1B,KAAK,SAAW,EAChB,KAAK,QAAU,EAEf,IAAI,EAAW,gBAIf,OAHA,KAAK,SAAW,EAChB,KAAK,QAAQ,GAEN,IACT,CACF,CAEsB,oBAAX,QAA0B,OAAO,QAC1C,OAAO,QAAU,MACU,oBAAX,YACW,IAAjB,OAAO,OAAuB,MAAM,OAAO,YAE5B,IAAf,KAAK,OAAuB,MAAM,KAAK","file":"/npm/sinon-stub-promise@4.0.0/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/sinon-stub-promise@4.0.0/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","function buildThenable() {\n  return {\n    onFulfilled: [],\n    onRejected: [],\n    onFinally: [],\n    then: function(onFulfill, onReject) {\n      try {\n        if (this.resolved && !this.rejected) {\n          var returned = onFulfill(this.resolveValue);\n\n          // promise returned, return that for next handler in chain\n          if (returned && returned.then) {\n            return returned;\n          }\n\n          // update resolve value for next promise in chain\n          if (returned !== undefined) {\n            this.resolveValue = returned;\n          }\n\n          return this;\n        }\n      } catch(error) {\n        if (error.constructor.name.match(/AssertionError/)) {\n          throw error;\n        }\n        this.rejectValue = error;\n        this.rejected = true;\n      }\n\n      if (this.rejected && onReject) {\n        return this.catch(onReject);\n      }\n      if (!this.rejected && onFulfill) {\n        this.onFulfilled.push(onFulfill);\n      }\n      if (!this.resolved && onReject) {\n        this.onRejected.push(onReject);\n      }\n      return this;\n    },\n\n    catch: function(onReject) {\n      if (this.rejected) {\n        try {\n          const value = onReject(this.rejectValue);\n\n          if (value && value.then) {\n            return value;\n          }\n \n          this.resolved = true;\n          this.rejected = false;\n          this.resolveValue = value;\n          this.rejectValue = undefined;\n        } catch (e) {\n          this.rejectValue = e;\n        }\n        return this;\n      }\n      if (!this.resolved) {\n        this.onRejected.push(onReject);\n      }\n      return this;\n    },\n\n    finally: function(callback) {\n      if (this.resolved || this.rejected) {\n        callback();\n        return;\n      }\n      this.onFinally.push(callback);\n    }\n  };\n}\n\nfunction setup(sinon) {\n  function resolves(value) {\n    this.thenable.resolved = true;\n    this.thenable.rejected = false;\n    this.thenable.resolveValue = value;\n    this.thenable.onFulfilled\n      .concat(this.thenable.onFinally)\n      .forEach(function(callback) {\n        callback(value);\n    });\n    return this;\n  }\n\n  function rejects(value) {\n    this.thenable.rejected = true;\n    this.thenable.resolved = false;\n    this.thenable.rejectValue = value;\n    this.thenable.onRejected\n      .concat(this.thenable.onFinally)\n      .forEach(function(callback) {\n        callback(value);\n    });\n    return this;\n  }\n\n  sinon.stub.returnsPromise = function() {\n    this.resolves = resolves;\n    this.rejects = rejects;\n\n    var thenable = buildThenable();\n    this.thenable = thenable;\n    this.returns(thenable);\n\n    return this;\n  };\n}\n\nif (typeof module !== 'undefined' && module.exports) {\n  module.exports = setup;\n} else if (typeof window !== 'undefined') {\n  if(typeof window.sinon !== 'undefined') setup(window.sinon);\n} else {\n  if(typeof this.sinon !== 'undefined') setup(this.sinon);\n}\n"]}