import {
  appInit
} from "./chunk-N2SKTCDK.js";
import "./chunk-HKSNADSX.js";
import "./chunk-SKMFMGCD.js";
import "./chunk-4KY4XKJV.js";
import "./chunk-SA7APTJR.js";
import "./chunk-HJ6L54YS.js";
import "./chunk-LSEFWW72.js";
import "./chunk-SKREEF3H.js";
import "./chunk-HYOEWQ5P.js";
import "./chunk-HBW42TDT.js";
import "./chunk-G6O3URDN.js";
import "./chunk-FN5XPUPH.js";
import "./chunk-IIT367QZ.js";
import "./chunk-RZGEKL77.js";
import "./chunk-UI7OCM2A.js";
import "./chunk-YZK37YCC.js";
import "./chunk-7EMWHCVW.js";
import "./chunk-7IYJZZQI.js";
import {
  copyMerge
} from "./chunk-M3J4MINX.js";
import "./chunk-PF4DSFDR.js";
import "./chunk-QH6W3NVF.js";
import "./chunk-NOEAT6CX.js";
import "./chunk-4UWS5Y3N.js";
import "./chunk-DD4R5P6W.js";
import "./chunk-JNITUVXP.js";
import "./chunk-KSGA62R2.js";
import "./chunk-LOZEKOES.js";
import "./chunk-TOU7EVFQ.js";
import "./chunk-OAWQ6LOO.js";
import "./chunk-TLT4YIG3.js";
import "./chunk-KYBIQBXE.js";
import "./chunk-I6Y4O3RR.js";
import "./chunk-OMR2DT66.js";
import "./chunk-DQC5FFGV.js";
import "./chunk-HFNDKYVF.js";

// gdc/singlecell.ts
var gdcGenome = "hg38";
var gdcDslabel = "GDC";
async function init(arg, holder, genomes) {
  const plotAppApi = await appInit({
    holder,
    state: {
      genome: gdcGenome,
      dslabel: gdcDslabel,
      termfilter: { filter0: arg.filter0 },
      plots: arg.state?.plots || [{ chartType: "singleCellPlot" }]
    },
    genome: genomes[gdcGenome],
    app: copyMerge({}, arg.opts?.app || {}),
    opts: {
      singleCellPlot: arg.opts?.singleCellPlot || {}
    }
  });
  const api = {
    update: async (updateArg) => {
      if (!plotAppApi) return;
      if ("filter0" in updateArg) {
        plotAppApi.dispatch({
          type: "app_refresh",
          subactions: [
            {
              type: "filter_replace",
              filter0: updateArg.filter0
            }
          ]
        });
      } else {
        plotAppApi.dispatch({
          type: "plot_edit",
          id: plotAppApi.getState().plots[0].id,
          config: updateArg
        });
      }
    }
  };
  return api;
}
export {
  init
};
//# sourceMappingURL=singlecell-BGJZB7MF.js.map
