import { CallingPackage } from "./CallingPackage";
import { CometChatUIKit } from "../shared/CometChatUiKit/CometChatUIKit";
import { ChatConfigurator } from "../shared/framework";
import { CallingExtensionDecorator } from "./CallingExtentionDecorator";
const CometChatCalls = CallingPackage.CometChatCalls;
export class CallingExtension {
    configuration;
    CallingExtension({ configuration }) {
        if (configuration)
            this.configuration = configuration;
    }
    enable() {
        ChatConfigurator.enable((dataSource) => {
            const callAppSettings = new CometChatCalls.CallAppSettingsBuilder()
                .setAppId(CometChatUIKit.uiKitSettings.appId)
                .setRegion(CometChatUIKit.uiKitSettings.region)
                .build();
            CometChatCalls.init(callAppSettings).then(() => {
                console.log('CometChatCalls initialization completed successfully');
            }, error => {
                console.log('CometChatCalls initialization failed with error:', error);
            });
            return new CallingExtensionDecorator({
                dataSource,
                configuration: this.configuration
            });
        });
    }
}
//# sourceMappingURL=CallingExtension.js.map