import React__default from 'react';
import { i as i18nIntl } from '../_verture/intl-4a9f1b44.js';
import { GetLanguage } from '@iam-com/lib';
import { d as defaultModalLocale } from '../_verture/index-65bbd1e4.js';
import '../_verture/typeof-498dd2b1.js';

//confirm 默认中文
var confirmRuntimeLocale = Object.assign({}, defaultModalLocale['zh']);
var changeConfirmLocale = function changeConfirmLocale(newLocale) {
  var confirmLocale = newLocale['Confirm'];
  if (confirmLocale) {
    confirmRuntimeLocale = Object.assign(Object.assign({}, confirmRuntimeLocale), confirmLocale);
  } else {
    confirmRuntimeLocale = Object.assign({}, defaultModalLocale['zh']);
  }
};
var getConfirmLocale = function getConfirmLocale() {
  var lang = GetLanguage();
  return (defaultModalLocale === null || defaultModalLocale === void 0 ? void 0 : defaultModalLocale[lang]) || defaultModalLocale['zh'];
};

var GlobalContext = /*#__PURE__*/React__default.createContext({
  language: GetLanguage(),
  // 防止不包provider,有国际化组件报错
  intlFormat: function intlFormat(comName, defI18nData) {
    return function (ops, params) {
      var lang = GetLanguage();
      return i18nIntl({
        ops: ops,
        i18nData: {},
        lang: lang,
        params: params,
        defI18nData: defI18nData
      });
    };
  },
  // 每个组件的默认props
  componentsProps: {}
});

export { changeConfirmLocale, GlobalContext as default, getConfirmLocale };
