import {
  PollChangeSource
} from "./chunk-4MF3HKJA.js";
import {
  WebhookChangeSource
} from "./chunk-TIZXQU26.js";

// runtime/subsystems/integration/build-change-source.ts
function buildChangeSource(cfg, fetch, middlewares = []) {
  switch (cfg.mode) {
    case "poll":
      return new PollChangeSource({
        adapter: fetch,
        config: cfg,
        middlewares
      });
    case "webhook":
      return new WebhookChangeSource({
        queue: fetch,
        config: cfg,
        middlewares
      });
  }
}

export {
  buildChangeSource
};
//# sourceMappingURL=chunk-43SBT72G.js.map