import { defineComponent, getCurrentInstance, h, createCommentVNode } from 'vue';
import '../../../composables/index.mjs';
import { kebabCase } from '../../../utils/util.mjs';
import { hSlot } from '../../../utils/private/render.mjs';
import { show, enableMouseEvent, sourceUri, credit } from '../../../utils/cesium-props.mjs';
import useDatasources from '../../../composables/use-datasources/index.mjs';

var DatasourceCzml = defineComponent({
  name: "VcDatasourceCzml",
  props: {
    ...show,
    ...enableMouseEvent,
    entities: {
      type: Array,
      default: () => []
    },
    czml: {
      type: [String, Object],
      required: true
    },
    ...sourceUri,
    ...credit,
    destroy: {
      type: Boolean,
      default: false
    }
  },
  emits: ["beforeLoad", "ready", "destroyed", "definitionChanged", "clusterEvent", "collectionChanged", "changedEvent", "errorEvent", "loadingEvent"],
  setup(props, ctx) {
    const instance = getCurrentInstance();
    instance.cesiumClass = "CzmlDataSource";
    const datasourcesState = useDatasources(props, ctx, instance);
    if (datasourcesState === void 0) {
      return;
    }
    instance.createCesiumObject = async () => {
      const options = datasourcesState.transformProps(props);
      return Cesium.CzmlDataSource.load(props.czml, options);
    };
    return () => {
      var _a, _b;
      return ctx.slots.default ? h("i", {
        class: kebabCase(((_a = instance.proxy) == null ? void 0 : _a.$options.name) || ""),
        style: { display: "none !important" }
      }, hSlot(ctx.slots.default)) : createCommentVNode(kebabCase(((_b = instance.proxy) == null ? void 0 : _b.$options.name) || ""));
    };
  }
});

export { DatasourceCzml as default };
//# sourceMappingURL=index.mjs.map
