import { useContext as H, useState as $, useRef as U, useEffect as C, createContext as q, useCallback as B } from "react";
import { jsxs as v, jsx as i } from "react/jsx-runtime";
import T from "prop-types";
import { useSelector as _ } from "react-redux";
import { getUseSkeleton as D } from "@/store/reducers/SkeletonReducer";
const K = (e, a, n, r) => {
  var o, h, w, x;
  const g = [n, {
    code: a,
    ...r || {}
  }];
  if ((h = (o = e == null ? void 0 : e.services) == null ? void 0 : o.logger) != null && h.forward)
    return e.services.logger.forward(g, "warn", "react-i18next::", !0);
  f(g[0]) && (g[0] = `react-i18next:: ${g[0]}`), (x = (w = e == null ? void 0 : e.services) == null ? void 0 : w.logger) != null && x.warn ? e.services.logger.warn(...g) : console != null && console.warn && console.warn(...g);
}, F = {}, k = (e, a, n, r) => {
  f(n) && F[n] || (f(n) && (F[n] = /* @__PURE__ */ new Date()), K(e, a, n, r));
}, R = (e, a) => () => {
  if (e.isInitialized)
    a();
  else {
    const n = () => {
      setTimeout(() => {
        e.off("initialized", n);
      }, 0), a();
    };
    e.on("initialized", n);
  }
}, L = (e, a, n) => {
  e.loadNamespaces(a, R(e, n));
}, P = (e, a, n, r) => {
  if (f(n) && (n = [n]), e.options.preload && e.options.preload.indexOf(a) > -1) return L(e, n, r);
  n.forEach((o) => {
    e.options.ns.indexOf(o) < 0 && e.options.ns.push(o);
  }), e.loadLanguages(a, R(e, r));
}, M = (e, a, n = {}) => !a.languages || !a.languages.length ? (k(a, "NO_LANGUAGES", "i18n.languages were undefined or empty", {
  languages: a.languages
}), !0) : a.hasLoadedNamespace(e, {
  lng: n.lng,
  precheck: (r, o) => {
    if (n.bindI18n && n.bindI18n.indexOf("languageChanging") > -1 && r.services.backendConnector.backend && r.isLanguageChangingTo && !o(r.isLanguageChangingTo, e)) return !1;
  }
}), f = (e) => typeof e == "string", X = (e) => typeof e == "object" && e !== null, Y = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g, J = {
  "&amp;": "&",
  "&#38;": "&",
  "&lt;": "<",
  "&#60;": "<",
  "&gt;": ">",
  "&#62;": ">",
  "&apos;": "'",
  "&#39;": "'",
  "&quot;": '"',
  "&#34;": '"',
  "&nbsp;": " ",
  "&#160;": " ",
  "&copy;": "©",
  "&#169;": "©",
  "&reg;": "®",
  "&#174;": "®",
  "&hellip;": "…",
  "&#8230;": "…",
  "&#x2F;": "/",
  "&#47;": "/"
}, Q = (e) => J[e], W = (e) => e.replace(Y, Q);
let Z = {
  bindI18n: "languageChanged",
  bindI18nStore: "",
  transEmptyNodeValue: "",
  transSupportBasicHtmlNodes: !0,
  transWrapTextNodes: "",
  transKeepBasicHtmlNodesFor: ["br", "strong", "i", "p"],
  useSuspense: !0,
  unescape: W
};
const ee = () => Z;
let ae;
const ne = () => ae, se = q();
class re {
  constructor() {
    this.usedNamespaces = {};
  }
  addUsedNamespaces(a) {
    a.forEach((n) => {
      this.usedNamespaces[n] || (this.usedNamespaces[n] = !0);
    });
  }
  getUsedNamespaces() {
    return Object.keys(this.usedNamespaces);
  }
}
const te = (e, a) => {
  const n = U();
  return C(() => {
    n.current = e;
  }, [e, a]), n.current;
}, V = (e, a, n, r) => e.getFixedT(a, n, r), le = (e, a, n, r) => B(V(e, a, n, r), [e, a, n, r]), me = (e, a = {}) => {
  var n, r, o, h;
  const {
    i18n: w
  } = a, {
    i18n: x,
    defaultNS: g
  } = H(se) || {}, s = w || x || ne();
  if (s && !s.reportNamespaces && (s.reportNamespaces = new re()), !s) {
    k(s, "NO_I18NEXT_INSTANCE", "useTranslation: You will need to pass in an i18next instance by using initReactI18next");
    const l = (d, c) => f(c) ? c : X(c) && f(c.defaultValue) ? c.defaultValue : Array.isArray(d) ? d[d.length - 1] : d, u = [l, {}, !1];
    return u.t = l, u.i18n = {}, u.ready = !1, u;
  }
  (n = s.options.react) != null && n.wait && k(s, "DEPRECATED_OPTION", "useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");
  const N = {
    ...ee(),
    ...s.options.react,
    ...a
  }, {
    useSuspense: O,
    keyPrefix: E
  } = N;
  let t = g || ((r = s.options) == null ? void 0 : r.defaultNS);
  t = f(t) ? [t] : t || ["translation"], (h = (o = s.reportNamespaces).addUsedNamespaces) == null || h.call(o, t);
  const p = (s.isInitialized || s.initializedStoreOnce) && t.every((l) => M(l, s, N)), G = le(s, a.lng || null, N.nsMode === "fallback" ? t : t[0], E), j = () => G, I = () => V(s, a.lng || null, N.nsMode === "fallback" ? t : t[0], E), [A, y] = $(j);
  let b = t.join();
  a.lng && (b = `${a.lng}${b}`);
  const z = te(b), m = U(!0);
  C(() => {
    const {
      bindI18n: l,
      bindI18nStore: u
    } = N;
    m.current = !0, !p && !O && (a.lng ? P(s, a.lng, t, () => {
      m.current && y(I);
    }) : L(s, t, () => {
      m.current && y(I);
    })), p && z && z !== b && m.current && y(I);
    const d = () => {
      m.current && y(I);
    };
    return l && (s == null || s.on(l, d)), u && (s == null || s.store.on(u, d)), () => {
      m.current = !1, s && l && (l == null || l.split(" ").forEach((c) => s.off(c, d))), u && s && u.split(" ").forEach((c) => s.store.off(c, d));
    };
  }, [s, b]), C(() => {
    m.current && p && y(j);
  }, [s, E, p]);
  const S = [A, s, p];
  if (S.t = A, S.i18n = s, S.ready = p, p || !p && !O) return S;
  throw new Promise((l) => {
    a.lng ? P(s, a.lng, t, () => l()) : L(s, t, () => l());
  });
}, ie = ({
  children: e,
  isLoading: a
}) => !_(D) || !a ? e : /* @__PURE__ */ v("div", { className: "flex flex-col gap-2 w-full", children: [
  /* @__PURE__ */ v("div", { className: "flex justify-end gap-5 mb-5", children: [
    /* @__PURE__ */ i("div", { className: "bg-gray-300 animate-pulse rounded-sm w-40 h-10" }),
    /* @__PURE__ */ i("div", { className: "bg-gray-300 animate-pulse rounded-sm w-40 h-10" }),
    /* @__PURE__ */ i("div", { className: "bg-gray-300 animate-pulse rounded-sm w-40 h-10" })
  ] }),
  /* @__PURE__ */ i("div", { className: "bg-gray-300 animate-pulse rounded-sm w-full h-100" })
] });
ie.propTypes = {
  children: T.any,
  isLoading: T.any
};
const oe = ({ children: e, isLoading: a }) => !_(D) || !a ? e : /* @__PURE__ */ v("div", { className: "flex flex-col gap-5 p-5", children: [
  /* @__PURE__ */ i("div", { className: "bg-gray-300 animate-pulse rounded-sm w-[20%] h-10" }),
  /* @__PURE__ */ v("div", { className: "flex flex-wrap gap-5 justify-between my-10", children: [
    /* @__PURE__ */ i("div", { className: "bg-gray-300 animate-pulse rounded-sm w-[45%] h-15" }),
    /* @__PURE__ */ i("div", { className: "bg-gray-300 animate-pulse rounded-sm w-[45%] h-10" }),
    /* @__PURE__ */ i("div", { className: "bg-gray-300 animate-pulse rounded-sm w-[30%] h-10" }),
    /* @__PURE__ */ i("div", { className: "bg-gray-300 animate-pulse rounded-sm w-[30%] h-10" }),
    /* @__PURE__ */ i("div", { className: "bg-gray-300 animate-pulse rounded-sm w-[30%] h-10" })
  ] }),
  /* @__PURE__ */ i("div", { className: "bg-gray-300 animate-pulse rounded-sm w-40 h-10" }),
  /* @__PURE__ */ v("div", { className: "flex justify-end gap-5", children: [
    /* @__PURE__ */ i("div", { className: "bg-gray-300 animate-pulse rounded-sm w-40 h-10" }),
    /* @__PURE__ */ i("div", { className: "bg-gray-300 animate-pulse rounded-sm w-40 h-10" })
  ] })
] });
oe.propTypes = {
  children: T.any,
  isLoading: T.any
};
export {
  me as f,
  ie as i,
  oe as l
};
//# sourceMappingURL=ImmunizationSkeleton-D2tdv5k--B7SY-gnr.js.map
