moyasar-payment-form 2.0.5 → 2.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * name: moyasar-payment-form
3
- * version: v2.0.5
3
+ * version: v2.0.6
4
4
  * description: Moyasar payment form utilities
5
5
  * author: Jan Jagieła - Railwaymen Team
6
6
  * homepage: https://docs.moyasar.com/credit-card
package/dist/moyasar.css CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * name: moyasar-payment-form
3
- * version: v2.0.5
3
+ * version: v2.0.6
4
4
  * description: Moyasar payment form utilities
5
5
  * author: Jan Jagieła - Railwaymen Team
6
6
  * homepage: https://docs.moyasar.com/credit-card
package/dist/moyasar.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * name: moyasar-payment-form
3
- * version: v2.0.5
3
+ * version: v2.0.6
4
4
  * description: Moyasar payment form utilities
5
5
  * author: Jan Jagieła - Railwaymen Team
6
6
  * homepage: https://docs.moyasar.com/credit-card
@@ -164,7 +164,7 @@ function ht(e) {
164
164
  };
165
165
  }
166
166
  function ot(e, t, n, r, o, a, i, s, u, l) {
167
- var d, c, h, p, _, g, m, y, v, b, w, k, x, D, T, L, A = t.type;
167
+ var d, c, h, p, _, g, m, y, v, b, w, k, x, D, T, V, A = t.type;
168
168
  if (t.constructor !== void 0) return null;
169
169
  128 & n.__u && (u = !!(32 & n.__u), a = [s = t.__e = n.__e]), (d = E.__b) && d(t);
170
170
  e: if (typeof A == "function") try {
@@ -187,7 +187,7 @@ function ot(e, t, n, r, o, a, i, s, u, l) {
187
187
  } else do
188
188
  c.__d = !1, x && x(t), d = c.render(c.props, c.state, c.context), c.state = c.__s;
189
189
  while (c.__d && ++D < 25);
190
- c.state = c.__s, c.getChildContext != null && (r = $($({}, r), c.getChildContext())), v && !h && c.getSnapshotBeforeUpdate != null && (g = c.getSnapshotBeforeUpdate(p, _)), Zt(e, Ie(L = d != null && d.type === ee && d.key == null ? d.props.children : d) ? L : [L], t, n, r, o, a, i, s, u, l), c.base = t.__e, t.__u &= -161, c.__h.length && i.push(c), m && (c.__E = c.__ = null);
190
+ c.state = c.__s, c.getChildContext != null && (r = $($({}, r), c.getChildContext())), v && !h && c.getSnapshotBeforeUpdate != null && (g = c.getSnapshotBeforeUpdate(p, _)), Zt(e, Ie(V = d != null && d.type === ee && d.key == null ? d.props.children : d) ? V : [V], t, n, r, o, a, i, s, u, l), c.base = t.__e, t.__u &= -161, c.__h.length && i.push(c), m && (c.__E = c.__ = null);
191
191
  } catch (C) {
192
192
  t.__v = null, u || a != null ? (t.__e = s, t.__u |= u ? 160 : 32, a[a.indexOf(s)] = null) : (t.__e = n.__e, t.__k = n.__k), E.__e(C, t, n);
193
193
  }
@@ -310,7 +310,7 @@ function f(e, t, n, r, o, a) {
310
310
  if (typeof e == "function" && (i = e.defaultProps)) for (s in i) u[s] === void 0 && (u[s] = i[s]);
311
311
  return E.vnode && E.vnode(l), l;
312
312
  }
313
- const Jt = "2.0.5", z = it({});
313
+ const Jt = "2.0.6", z = it({});
314
314
  var se, R, Ge, yt, fe = 0, Wt = [], N = E, vt = N.__b, gt = N.__r, bt = N.diffed, wt = N.__c, kt = N.unmount, xt = N.__;
315
315
  function Ne(e, t) {
316
316
  N.__h && N.__h(R, e, fe || t), fe = 0;
@@ -932,8 +932,8 @@ function ce(e, t, n) {
932
932
  }, []);
933
933
  var b = ae(function() {
934
934
  var w = function(A) {
935
- var C = s.current, V = u.current;
936
- return s.current = u.current = null, a.current = A, l.current = d.current.apply(V, C);
935
+ var C = s.current, U = u.current;
936
+ return s.current = u.current = null, a.current = A, l.current = d.current.apply(U, C);
937
937
  }, k = function(A, C) {
938
938
  p && cancelAnimationFrame(i.current), i.current = p ? requestAnimationFrame(A) : setTimeout(A, C);
939
939
  }, x = function(A) {
@@ -946,10 +946,10 @@ function ce(e, t, n) {
946
946
  var C = Date.now();
947
947
  if (x(C)) return D(C);
948
948
  if (c.current) {
949
- var V = t - (C - o.current), Y = m ? Math.min(V, v - (C - a.current)) : V;
949
+ var U = t - (C - o.current), Y = m ? Math.min(U, v - (C - a.current)) : U;
950
950
  k(A, Y);
951
951
  }
952
- }, L = function() {
952
+ }, V = function() {
953
953
  if (h || y) {
954
954
  var A = Date.now(), C = x(A);
955
955
  if (s.current = [].slice.call(arguments), u.current = r, o.current = A, C) {
@@ -959,13 +959,13 @@ function ce(e, t, n) {
959
959
  return i.current || k(T, t), l.current;
960
960
  }
961
961
  };
962
- return L.cancel = function() {
962
+ return V.cancel = function() {
963
963
  i.current && (p ? cancelAnimationFrame(i.current) : clearTimeout(i.current)), a.current = 0, s.current = o.current = u.current = i.current = null;
964
- }, L.isPending = function() {
964
+ }, V.isPending = function() {
965
965
  return !!i.current;
966
- }, L.flush = function() {
966
+ }, V.flush = function() {
967
967
  return i.current ? D(Date.now()) : l.current;
968
- }, L;
968
+ }, V;
969
969
  }, [_, m, t, v, g, p, h, y]);
970
970
  return b;
971
971
  }
@@ -1378,8 +1378,8 @@ const ar = () => {
1378
1378
  an(T) || (T && (w && w(T), o && !x && (yield cr({
1379
1379
  payment: T,
1380
1380
  on_completed: o
1381
- }).catch((L) => {
1382
- console.error(L);
1381
+ }).catch((V) => {
1382
+ console.error(V);
1383
1383
  })), T.status === "paid" && (p(!0), setTimeout(() => {
1384
1384
  lr(t, T, r).catch(() => {
1385
1385
  });
@@ -1433,26 +1433,26 @@ const ar = () => {
1433
1433
  loading: g,
1434
1434
  error: m,
1435
1435
  setError: y
1436
- } = me({ defaultError: d }), [v, b] = I(""), [w, k] = I(""), [x, D] = I(""), T = (U) => {
1437
- const M = /^05[503649187][0-9]{7}$/.test(B(U));
1436
+ } = me({ defaultError: d }), [v, b] = I(""), [w, k] = I(""), [x, D] = I(""), T = (L) => {
1437
+ const M = /^05[503649187][0-9]{7}$/.test(B(L));
1438
1438
  return y((K) => O(S({}, K), {
1439
1439
  phone: M ? "" : "error.invalid_mobile"
1440
1440
  })), M;
1441
- }, L = (U) => {
1442
- const M = /^[0-9]{4,}$/.test(B(U));
1441
+ }, V = (L) => {
1442
+ const M = /^[0-9]{4,}$/.test(B(L));
1443
1443
  return y((K) => O(S({}, K), {
1444
1444
  otp: M ? "" : "error.invalid_otp"
1445
1445
  })), M;
1446
- }, A = (U) => {
1447
- const { value: M, name: K } = U.target, Q = M.trim();
1446
+ }, A = (L) => {
1447
+ const { value: M, name: K } = L.target, Q = M.trim();
1448
1448
  if (l(!1), !Q) {
1449
1449
  l(!Q);
1450
1450
  return;
1451
1451
  }
1452
- K === "mysr-stc-mobile" && T(Q), K === "mysr-stc-otp" && L(Q);
1452
+ K === "mysr-stc-mobile" && T(Q), K === "mysr-stc-otp" && V(Q);
1453
1453
  }, C = () => {
1454
1454
  if (!T(v)) return;
1455
- function U(M) {
1455
+ function L(M) {
1456
1456
  const { transaction_url: K } = M.source;
1457
1457
  D(K), s((/* @__PURE__ */ new Date()).getTime() + 5 * 60 * 1e3);
1458
1458
  }
@@ -1463,14 +1463,14 @@ const ar = () => {
1463
1463
  mobile: B(v)
1464
1464
  }
1465
1465
  },
1466
- onSuccess: U,
1466
+ onSuccess: L,
1467
1467
  initPayment: !0
1468
1468
  }).catch((M) => {
1469
1469
  console.error(M);
1470
1470
  });
1471
- }, V = () => {
1472
- if (!i || !L(w)) return;
1473
- function U(M) {
1471
+ }, U = () => {
1472
+ if (!i || !V(w)) return;
1473
+ function L(M) {
1474
1474
  var K;
1475
1475
  M.status === "failed" && ((K = M.source) == null ? void 0 : K.message) === "Invalid OTP" && (y((Q) => O(S({}, Q), {
1476
1476
  otp: "error.invalid_otp"
@@ -1481,21 +1481,21 @@ const ar = () => {
1481
1481
  otp_value: B(w)
1482
1482
  },
1483
1483
  path: x,
1484
- onFailed: U
1484
+ onFailed: L
1485
1485
  }).catch((M) => {
1486
1486
  console.error(M);
1487
1487
  });
1488
- }, Y = (U) => {
1489
- if (U.preventDefault(), y(d), !i) {
1488
+ }, Y = (L) => {
1489
+ if (L.preventDefault(), y(d), !i) {
1490
1490
  C();
1491
1491
  return;
1492
1492
  }
1493
- V();
1494
- }, _e = (U) => {
1495
- U > 0 || (y((M) => O(S({}, M), {
1493
+ U();
1494
+ }, _e = (L) => {
1495
+ L > 0 || (y((M) => O(S({}, M), {
1496
1496
  otp: "error.otp_time_out"
1497
1497
  })), k(""), s(null));
1498
- }, ye = ae(() => m.phone || i && m.otp && m.otp !== "error.otp_time_out" ? !0 : u || g, [m, u, g]), ue = (U) => o((M) => O(S({}, M), { showForm: U })), [ie, de] = I(!1), ve = () => {
1498
+ }, ye = ae(() => m.phone || i && m.otp && m.otp !== "error.otp_time_out" ? !0 : u || g, [m, u, g]), ue = (L) => o((M) => O(S({}, M), { showForm: L })), [ie, de] = I(!1), ve = () => {
1499
1499
  de(!0);
1500
1500
  }, Ve = () => {
1501
1501
  ie && (b(""), k(""), y(d), ue(!1), de(!1), l(!1));
@@ -1585,7 +1585,7 @@ const ar = () => {
1585
1585
  }
1586
1586
  )
1587
1587
  ] }),
1588
- /* @__PURE__ */ f("p", { class: "flex flex-col gap-2 text-xs font-medium text-error empty:hidden", children: Object.entries(m).map(([U, M]) => /* @__PURE__ */ f("span", { class: "empty:hidden", children: e(M) }, U)) })
1588
+ /* @__PURE__ */ f("p", { class: "flex flex-col gap-2 text-xs font-medium text-error empty:hidden", children: Object.entries(m).map(([L, M]) => /* @__PURE__ */ f("span", { class: "empty:hidden", children: e(M) }, L)) })
1589
1589
  ]
1590
1590
  }
1591
1591
  ) })
@@ -1711,7 +1711,7 @@ const ar = () => {
1711
1711
  if (j(() => q(void 0, null, function* () {
1712
1712
  if (!_ || !t)
1713
1713
  return;
1714
- const m = r == null ? void 0 : r.filter((v) => v !== "mada").map((v) => v.toLowerCase()), y = {
1714
+ const m = r == null ? void 0 : r.map((v) => v.toLowerCase()), y = {
1715
1715
  version: t.version.toString(),
1716
1716
  serviceId: t.service_id,
1717
1717
  protocol: "PROTOCOL_3DS",
@@ -1731,7 +1731,7 @@ const ar = () => {
1731
1731
  currency: o,
1732
1732
  total: a
1733
1733
  }
1734
- }, L = () => {
1734
+ }, V = () => {
1735
1735
  _.notify({
1736
1736
  status: "CHARGED",
1737
1737
  provider: "Moyasar"
@@ -1742,8 +1742,8 @@ const ar = () => {
1742
1742
  status: "REJECTED",
1743
1743
  provider: "Moyasar"
1744
1744
  });
1745
- let V = "Payment failed.";
1746
- C instanceof Payment && C.isFailed() ? V += " Error: " + ((Y = C.source) == null ? void 0 : Y.message) : C instanceof Response ? V += " Error: " + C.statusText : typeof C == "string" && (V += " Error: " + C);
1745
+ let U = "Payment failed.";
1746
+ C instanceof Payment && C.isFailed() ? U += " Error: " + ((Y = C.source) == null ? void 0 : Y.message) : C instanceof Response ? U += " Error: " + C.statusText : typeof C == "string" && (U += " Error: " + C), console.log("Samsung Pay error: ", U);
1747
1747
  };
1748
1748
  try {
1749
1749
  const C = yield _.loadPaymentSheet(
@@ -1759,7 +1759,7 @@ const ar = () => {
1759
1759
  }
1760
1760
  },
1761
1761
  onFailed: A,
1762
- onSuccess: L
1762
+ onSuccess: V
1763
1763
  });
1764
1764
  } catch (C) {
1765
1765
  try {
@@ -1767,7 +1767,7 @@ const ar = () => {
1767
1767
  status: "ERRED",
1768
1768
  provider: "Moyasar"
1769
1769
  });
1770
- } catch (V) {
1770
+ } catch (U) {
1771
1771
  }
1772
1772
  console.log("Samsung Pay error: ", C);
1773
1773
  }
@@ -1846,11 +1846,11 @@ const ar = () => {
1846
1846
  }, y = Object.assign({}, g);
1847
1847
  y.allowedPaymentMethods = [m];
1848
1848
  const v = () => q(void 0, null, function* () {
1849
- const { country: x, label: D, merchant_id: T } = n, L = D || (r == null ? void 0 : r.label), A = x || (r == null ? void 0 : r.country), C = O(S({}, g), {
1849
+ const { country: x, label: D, merchant_id: T } = n, V = D || (r == null ? void 0 : r.label), A = x || (r == null ? void 0 : r.country), C = O(S({}, g), {
1850
1850
  allowedPaymentMethods: [k],
1851
1851
  merchantInfo: {
1852
1852
  merchantId: T,
1853
- merchantName: L
1853
+ merchantName: V
1854
1854
  },
1855
1855
  transactionInfo: {
1856
1856
  countryCode: A,
@@ -1860,18 +1860,18 @@ const ar = () => {
1860
1860
  }
1861
1861
  });
1862
1862
  try {
1863
- const V = yield c.loadPaymentData(C);
1863
+ const U = yield c.loadPaymentData(C);
1864
1864
  d({
1865
1865
  initPayment: !0,
1866
1866
  data: {
1867
1867
  source: {
1868
1868
  type: "googlepay",
1869
- token: V.paymentMethodData.tokenizationData.token
1869
+ token: U.paymentMethodData.tokenizationData.token
1870
1870
  }
1871
1871
  }
1872
1872
  });
1873
- } catch (V) {
1874
- console.error(V);
1873
+ } catch (U) {
1874
+ console.error(U);
1875
1875
  }
1876
1876
  }), b = () => {
1877
1877
  const x = c.createButton({
@@ -2434,18 +2434,18 @@ const ar = () => {
2434
2434
  } = me({ defaultError: y });
2435
2435
  return /* @__PURE__ */ f("form", { class: "space-y-6", onSubmit: (C) => {
2436
2436
  C.preventDefault();
2437
- const { isValid: V } = ln(s), Y = B(l), _e = B(p), ye = B(c), ue = g(Y), ie = m(Y, ue), { isValid: de } = cn(ye, ue), { isValid: ve } = fn(_e);
2438
- if (!V || !ie || !de || !ve) {
2437
+ const { isValid: U } = ln(s), Y = B(l), _e = B(p), ye = B(c), ue = g(Y), ie = m(Y, ue), { isValid: de } = cn(ye, ue), { isValid: ve } = fn(_e);
2438
+ if (!U || !ie || !de || !ve) {
2439
2439
  const Z = S({}, y);
2440
- V || (Z.name = e("error.invalid_name")), ie || (Z.cc = e("error.invalid_cc_number")), de || (Z.csc = e("error.invalid_csc")), ve || (Z.exp = e("error.invalid_date")), T(Z);
2440
+ U || (Z.name = e("error.invalid_name")), ie || (Z.cc = e("error.invalid_cc_number")), de || (Z.csc = e("error.invalid_csc")), ve || (Z.exp = e("error.invalid_date")), T(Z);
2441
2441
  return;
2442
2442
  }
2443
- const [Ve, U] = _e.split("/"), M = {
2443
+ const [Ve, L] = _e.split("/"), M = {
2444
2444
  type: "creditcard",
2445
2445
  name: s,
2446
2446
  number: Y,
2447
2447
  month: Ve,
2448
- year: U,
2448
+ year: L,
2449
2449
  cvc: ye
2450
2450
  };
2451
2451
  r != null && r.manual && (M.manual = !0), r != null && r.save_card && (M.save_card = !0), o && (M.statement_descriptor = o);
@@ -3080,7 +3080,7 @@ var Lr = function() {
3080
3080
  }, e;
3081
3081
  }();
3082
3082
  const Yr = new qr({
3083
- key: "95fc54a8-f3ef-454c-b93d-e7e765de19f0",
3083
+ key: void 0,
3084
3084
  revision: Jt
3085
3085
  });
3086
3086
  var Jr = /* @__PURE__ */ function() {
@@ -3136,7 +3136,7 @@ function Qr({ config: e }) {
3136
3136
  minimumFractionDigits: s
3137
3137
  }).format(u), [d, c] = I(O(S({
3138
3138
  version: Jt,
3139
- base_url: "https://api.moyasar.com"
3139
+ base_url: void 0
3140
3140
  }, e), {
3141
3141
  translations: Rn(o),
3142
3142
  formattedAmount: l,
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * name: moyasar-payment-form
3
- * version: v2.0.5
3
+ * version: v2.0.6
4
4
  * description: Moyasar payment form utilities
5
5
  * author: Jan Jagieła - Railwaymen Team
6
6
  * homepage: https://docs.moyasar.com/credit-card
7
7
  */
8
- (function(M,g){typeof exports=="object"&&typeof module!="undefined"?module.exports=g():typeof define=="function"&&define.amd?define(g):(M=typeof globalThis!="undefined"?globalThis:M||self,M.Moyasar=g())})(this,function(){"use strict";var so=Object.defineProperty,lo=Object.defineProperties;var co=Object.getOwnPropertyDescriptors;var He=Object.getOwnPropertySymbols;var mn=Object.prototype.hasOwnProperty,hn=Object.prototype.propertyIsEnumerable;var _n=Math.pow,fn=(M,g,F)=>g in M?so(M,g,{enumerable:!0,configurable:!0,writable:!0,value:F}):M[g]=F,S=(M,g)=>{for(var F in g||(g={}))mn.call(g,F)&&fn(M,F,g[F]);if(He)for(var F of He(g))hn.call(g,F)&&fn(M,F,g[F]);return M},R=(M,g)=>lo(M,co(g));var Ke=(M,g)=>{var F={};for(var V in M)mn.call(M,V)&&g.indexOf(V)<0&&(F[V]=M[V]);if(M!=null&&He)for(var V of He(M))g.indexOf(V)<0&&hn.call(M,V)&&(F[V]=M[V]);return F};var X=(M,g,F)=>new Promise((V,he)=>{var xe=J=>{try{ie(F.next(J))}catch(se){he(se)}},_e=J=>{try{ie(F.throw(J))}catch(se){he(se)}},ie=J=>J.done?V(J.value):Promise.resolve(J.value).then(xe,_e);ie((F=F.apply(M,g)).next())});var M,g,F,V,he,xe,_e,ie,J,se,pt,ye={},ft=[],yn=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Pe=Array.isArray;function ne(e,t){for(var n in t)e[n]=t[n];return e}function mt(e){var t=e.parentNode;t&&t.removeChild(e)}function Ze(e,t,n){var r,o,a,i={};for(a in t)a=="key"?r=t[a]:a=="ref"?o=t[a]:i[a]=t[a];if(arguments.length>2&&(i.children=arguments.length>3?M.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(a in e.defaultProps)i[a]===void 0&&(i[a]=e.defaultProps[a]);return Ee(e,i,r,o,null)}function Ee(e,t,n,r,o){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:o==null?++F:o,__i:-1,__u:0};return o==null&&g.vnode!=null&&g.vnode(a),a}function re(e){return e.children}function Q(e,t){this.props=e,this.context=t}function le(e,t){if(t==null)return e.__?le(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?le(e):null}function ht(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return ht(e)}}function qe(e){(!e.__d&&(e.__d=!0)&&V.push(e)&&!Se.__r++||he!==g.debounceRendering)&&((he=g.debounceRendering)||xe)(Se)}function Se(){var e,t,n,r,o,a,i,s;for(V.sort(_e);e=V.shift();)e.__d&&(t=V.length,r=void 0,a=(o=(n=e).__v).__e,i=[],s=[],n.__P&&((r=ne({},o)).__v=o.__v+1,g.vnode&&g.vnode(r),Ye(n.__P,r,o,n.__n,n.__P.namespaceURI,32&o.__u?[a]:null,i,a==null?le(o):a,!!(32&o.__u),s),r.__v=o.__v,r.__.__k[r.__i]=r,bt(i,r,s),r.__e!=a&&ht(r)),V.length>t&&V.sort(_e));Se.__r=0}function _t(e,t,n,r,o,a,i,s,u,l,d){var c,h,p,_,b,m=r&&r.__k||ft,y=t.length;for(n.__d=u,vn(n,t,m),u=n.__d,c=0;c<y;c++)(p=n.__k[c])!=null&&typeof p!="boolean"&&typeof p!="function"&&(h=p.__i===-1?ye:m[p.__i]||ye,p.__i=c,Ye(e,p,h,o,a,i,s,u,l,d),_=p.__e,p.ref&&h.ref!=p.ref&&(h.ref&&Je(h.ref,null,p),d.push(p.ref,p.__c||_,p)),b==null&&_!=null&&(b=_),65536&p.__u||h.__k===p.__k?(u&&typeof p.type=="string"&&!e.contains(u)&&(u=le(h)),u=yt(p,u,e)):typeof p.type=="function"&&p.__d!==void 0?u=p.__d:_&&(u=_.nextSibling),p.__d=void 0,p.__u&=-196609);n.__d=u,n.__e=b}function vn(e,t,n){var r,o,a,i,s,u=t.length,l=n.length,d=l,c=0;for(e.__k=[],r=0;r<u;r++)i=r+c,(o=e.__k[r]=(o=t[r])==null||typeof o=="boolean"||typeof o=="function"?null:typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?Ee(null,o,null,null,null):Pe(o)?Ee(re,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?Ee(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o)!=null?(o.__=e,o.__b=e.__b+1,s=gn(o,n,i,d),o.__i=s,a=null,s!==-1&&(d--,(a=n[s])&&(a.__u|=131072)),a==null||a.__v===null?(s==-1&&c--,typeof o.type!="function"&&(o.__u|=65536)):s!==i&&(s==i-1?c=s-i:s==i+1?c++:s>i?d>u-i?c+=s-i:c--:s<i&&c++,s!==r+c&&(o.__u|=65536))):(a=n[i])&&a.key==null&&a.__e&&!(131072&a.__u)&&(a.__e==e.__d&&(e.__d=le(a)),We(a,a,!1),n[i]=null,d--);if(d)for(r=0;r<l;r++)(a=n[r])!=null&&!(131072&a.__u)&&(a.__e==e.__d&&(e.__d=le(a)),We(a,a))}function yt(e,t,n){var r,o;if(typeof e.type=="function"){for(r=e.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=e,t=yt(r[o],t,n));return t}e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType===8);return t}function Ce(e,t){return t=t||[],e==null||typeof e=="boolean"||(Pe(e)?e.some(function(n){Ce(n,t)}):t.push(e)),t}function gn(e,t,n,r){var o=e.key,a=e.type,i=n-1,s=n+1,u=t[n];if(u===null||u&&o==u.key&&a===u.type&&!(131072&u.__u))return n;if(r>(u!=null&&!(131072&u.__u)?1:0))for(;i>=0||s<t.length;){if(i>=0){if((u=t[i])&&!(131072&u.__u)&&o==u.key&&a===u.type)return i;i--}if(s<t.length){if((u=t[s])&&!(131072&u.__u)&&o==u.key&&a===u.type)return s;s++}}return-1}function vt(e,t,n){t[0]==="-"?e.setProperty(t,n==null?"":n):e[t]=n==null?"":typeof n!="number"||yn.test(t)?n:n+"px"}function Ae(e,t,n,r,o){var a;e:if(t==="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||vt(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||vt(e.style,t,n[t])}else if(t[0]==="o"&&t[1]==="n")a=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,"$1")),t=t.toLowerCase()in e||t==="onFocusOut"||t==="onFocusIn"?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+a]=n,n?r?n.u=r.u:(n.u=ie,e.addEventListener(t,a?se:J,a)):e.removeEventListener(t,a?se:J,a);else{if(o=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=n==null?"":n;break e}catch(i){}typeof n=="function"||(n==null||n===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n))}}function gt(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t.t==null)t.t=ie++;else if(t.t<n.u)return;return n(g.event?g.event(t):t)}}}function Ye(e,t,n,r,o,a,i,s,u,l){var d,c,h,p,_,b,m,y,v,w,k,x,P,T,D,B,A=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(u=!!(32&n.__u),a=[s=t.__e=n.__e]),(d=g.__b)&&d(t);e:if(typeof A=="function")try{if(y=t.props,v="prototype"in A&&A.prototype.render,w=(d=A.contextType)&&r[d.__c],k=d?w?w.props.value:d.__:r,n.__c?m=(c=t.__c=n.__c).__=c.__E:(v?t.__c=c=new A(y,k):(t.__c=c=new Q(y,k),c.constructor=A,c.render=wn),w&&w.sub(c),c.props=y,c.state||(c.state={}),c.context=k,c.__n=r,h=c.__d=!0,c.__h=[],c._sb=[]),v&&c.__s==null&&(c.__s=c.state),v&&A.getDerivedStateFromProps!=null&&(c.__s==c.state&&(c.__s=ne({},c.__s)),ne(c.__s,A.getDerivedStateFromProps(y,c.__s))),p=c.props,_=c.state,c.__v=t,h)v&&A.getDerivedStateFromProps==null&&c.componentWillMount!=null&&c.componentWillMount(),v&&c.componentDidMount!=null&&c.__h.push(c.componentDidMount);else{if(v&&A.getDerivedStateFromProps==null&&y!==p&&c.componentWillReceiveProps!=null&&c.componentWillReceiveProps(y,k),!c.__e&&(c.shouldComponentUpdate!=null&&c.shouldComponentUpdate(y,c.__s,k)===!1||t.__v===n.__v)){for(t.__v!==n.__v&&(c.props=y,c.state=c.__s,c.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(C){C&&(C.__=t)}),x=0;x<c._sb.length;x++)c.__h.push(c._sb[x]);c._sb=[],c.__h.length&&i.push(c);break e}c.componentWillUpdate!=null&&c.componentWillUpdate(y,c.__s,k),v&&c.componentDidUpdate!=null&&c.__h.push(function(){c.componentDidUpdate(p,_,b)})}if(c.context=k,c.props=y,c.__P=e,c.__e=!1,P=g.__r,T=0,v){for(c.state=c.__s,c.__d=!1,P&&P(t),d=c.render(c.props,c.state,c.context),D=0;D<c._sb.length;D++)c.__h.push(c._sb[D]);c._sb=[]}else do c.__d=!1,P&&P(t),d=c.render(c.props,c.state,c.context),c.state=c.__s;while(c.__d&&++T<25);c.state=c.__s,c.getChildContext!=null&&(r=ne(ne({},r),c.getChildContext())),v&&!h&&c.getSnapshotBeforeUpdate!=null&&(b=c.getSnapshotBeforeUpdate(p,_)),_t(e,Pe(B=d!=null&&d.type===re&&d.key==null?d.props.children:d)?B:[B],t,n,r,o,a,i,s,u,l),c.base=t.__e,t.__u&=-161,c.__h.length&&i.push(c),m&&(c.__E=c.__=null)}catch(C){t.__v=null,u||a!=null?(t.__e=s,t.__u|=u?160:32,a[a.indexOf(s)]=null):(t.__e=n.__e,t.__k=n.__k),g.__e(C,t,n)}else a==null&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=bn(n.__e,t,n,r,o,a,i,u,l);(d=g.diffed)&&d(t)}function bt(e,t,n){t.__d=void 0;for(var r=0;r<n.length;r++)Je(n[r],n[++r],n[++r]);g.__c&&g.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(a){a.call(o)})}catch(a){g.__e(a,o.__v)}})}function bn(e,t,n,r,o,a,i,s,u){var l,d,c,h,p,_,b,m=n.props,y=t.props,v=t.type;if(v==="svg"?o="http://www.w3.org/2000/svg":v==="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),a!=null){for(l=0;l<a.length;l++)if((p=a[l])&&"setAttribute"in p==!!v&&(v?p.localName===v:p.nodeType===3)){e=p,a[l]=null;break}}if(e==null){if(v===null)return document.createTextNode(y);e=document.createElementNS(o,v,y.is&&y),a=null,s=!1}if(v===null)m===y||s&&e.data===y||(e.data=y);else{if(a=a&&M.call(e.childNodes),m=n.props||ye,!s&&a!=null)for(m={},l=0;l<e.attributes.length;l++)m[(p=e.attributes[l]).name]=p.value;for(l in m)if(p=m[l],l!="children"){if(l=="dangerouslySetInnerHTML")c=p;else if(l!=="key"&&!(l in y)){if(l=="value"&&"defaultValue"in y||l=="checked"&&"defaultChecked"in y)continue;Ae(e,l,null,p,o)}}for(l in y)p=y[l],l=="children"?h=p:l=="dangerouslySetInnerHTML"?d=p:l=="value"?_=p:l=="checked"?b=p:l==="key"||s&&typeof p!="function"||m[l]===p||Ae(e,l,p,m[l],o);if(d)s||c&&(d.__html===c.__html||d.__html===e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(c&&(e.innerHTML=""),_t(e,Pe(h)?h:[h],t,n,r,v==="foreignObject"?"http://www.w3.org/1999/xhtml":o,a,i,a?a[0]:n.__k&&le(n,0),s,u),a!=null)for(l=a.length;l--;)a[l]!=null&&mt(a[l]);s||(l="value",_!==void 0&&(_!==e[l]||v==="progress"&&!_||v==="option"&&_!==m[l])&&Ae(e,l,_,m[l],o),l="checked",b!==void 0&&b!==e[l]&&Ae(e,l,b,m[l],o))}return e}function Je(e,t,n){try{typeof e=="function"?e(t):e.current=t}catch(r){g.__e(r,n)}}function We(e,t,n){var r,o;if(g.unmount&&g.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||Je(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(a){g.__e(a,t)}r.base=r.__P=null}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&We(r[o],t,n||typeof e.type!="function");n||e.__e==null||mt(e.__e),e.__c=e.__=e.__e=e.__d=void 0}function wn(e,t,n){return this.constructor(e,n)}function wt(e,t,n){var r,o,a,i;g.__&&g.__(e,t),o=(r=typeof n=="function")?null:t.__k,a=[],i=[],Ye(t,e=(!r&&n||t).__k=Ze(re,null,[e]),o||ye,ye,t.namespaceURI,!r&&n?[n]:o?null:t.firstChild?M.call(t.childNodes):null,a,!r&&n?n:o?o.__e:t.firstChild,r,i),bt(a,e,i)}function Xe(e,t){var n={__c:t="__cC"+pt++,__:e,Consumer:function(r,o){return r.children(o)},Provider:function(r){var o,a;return this.getChildContext||(o=[],(a={})[t]=this,this.getChildContext=function(){return a},this.componentWillUnmount=function(){o=null},this.shouldComponentUpdate=function(i){this.props.value!==i.value&&o.some(function(s){s.__e=!0,qe(s)})},this.sub=function(i){o.push(i);var s=i.componentWillUnmount;i.componentWillUnmount=function(){o&&o.splice(o.indexOf(i),1),s&&s.call(i)}}),r.children}};return n.Provider.__=n.Consumer.contextType=n}M=ft.slice,g={__e:function(e,t,n,r){for(var o,a,i;t=t.__;)if((o=t.__c)&&!o.__)try{if((a=o.constructor)&&a.getDerivedStateFromError!=null&&(o.setState(a.getDerivedStateFromError(e)),i=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,r||{}),i=o.__d),i)return o.__E=o}catch(s){e=s}throw e}},F=0,Q.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=ne({},this.state),typeof e=="function"&&(e=e(ne({},n),this.props)),e&&ne(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),qe(this))},Q.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),qe(this))},Q.prototype.render=re,V=[],xe=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,_e=function(e,t){return e.__v.__b-t.__v.__b},Se.__r=0,ie=0,J=gt(!1),se=gt(!0),pt=0;var kn=0;function f(e,t,n,r,o,a){t||(t={});var i,s,u=t;if("ref"in u)for(s in u={},t)s=="ref"?i=t[s]:u[s]=t[s];var l={type:e,props:u,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--kn,__i:-1,__u:0,__source:o,__self:a};if(typeof e=="function"&&(i=e.defaultProps))for(s in i)u[s]===void 0&&(u[s]=i[s]);return g.vnode&&g.vnode(l),l}const kt="2.0.5",j=Xe({});var de,I,Qe,xt,ve=0,Pt=[],U=g,Et=U.__b,St=U.__r,Ct=U.diffed,At=U.__c,Tt=U.unmount,Dt=U.__;function Te(e,t){U.__h&&U.__h(I,e,ve||t),ve=0;var n=I.__H||(I.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function N(e){return ve=1,xn(It,e)}function xn(e,t,n){var r=Te(de++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):It(void 0,t),function(s){var u=r.__N?r.__N[0]:r.__[0],l=r.t(u,s);u!==l&&(r.__N=[l,r.__[1]],r.__c.setState({}))}],r.__c=I,!I.u)){var o=function(s,u,l){if(!r.__c.__H)return!0;var d=r.__c.__H.__.filter(function(h){return!!h.__c});if(d.every(function(h){return!h.__N}))return!a||a.call(this,s,u,l);var c=!1;return d.forEach(function(h){if(h.__N){var p=h.__[0];h.__=h.__N,h.__N=void 0,p!==h.__[0]&&(c=!0)}}),!(!c&&r.__c.props===s)&&(!a||a.call(this,s,u,l))};I.u=!0;var a=I.shouldComponentUpdate,i=I.componentWillUpdate;I.componentWillUpdate=function(s,u,l){if(this.__e){var d=a;a=void 0,o(s,u,l),a=d}i&&i.call(this,s,u,l)},I.shouldComponentUpdate=o}return r.__N||r.__}function Z(e,t){var n=Te(de++,3);!U.__s&&Rt(n.__H,t)&&(n.__=e,n.i=t,I.__H.__h.push(n))}function $(e){return ve=5,ce(function(){return{current:e}},[])}function ce(e,t){var n=Te(de++,7);return Rt(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Mt(e,t){return ve=8,ce(function(){return e},t)}function L(e){var t=I.context[e.__c],n=Te(de++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(I)),t.props.value):e.__}function Pn(){for(var e;e=Pt.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(De),e.__H.__h.forEach($e),e.__H.__h=[]}catch(t){e.__H.__h=[],U.__e(t,e.__v)}}U.__b=function(e){I=null,Et&&Et(e)},U.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Dt&&Dt(e,t)},U.__r=function(e){St&&St(e),de=0;var t=(I=e.__c).__H;t&&(Qe===I?(t.__h=[],I.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.i=n.__N=void 0})):(t.__h.forEach(De),t.__h.forEach($e),t.__h=[],de=0)),Qe=I},U.diffed=function(e){Ct&&Ct(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Pt.push(t)!==1&&xt===U.requestAnimationFrame||((xt=U.requestAnimationFrame)||En)(Pn)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.i=void 0})),Qe=I=null},U.__c=function(e,t){t.some(function(n){try{n.__h.forEach(De),n.__h=n.__h.filter(function(r){return!r.__||$e(r)})}catch(r){t.some(function(o){o.__h&&(o.__h=[])}),t=[],U.__e(r,n.__v)}}),At&&At(e,t)},U.unmount=function(e){Tt&&Tt(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{De(r)}catch(o){t=o}}),n.__H=void 0,t&&U.__e(t,n.__v))};var Ot=typeof requestAnimationFrame=="function";function En(e){var t,n=function(){clearTimeout(r),Ot&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);Ot&&(t=requestAnimationFrame(n))}function De(e){var t=I,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),I=t}function $e(e){var t=I;e.__c=e.__(),I=t}function Rt(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function It(e,t){return typeof t=="function"?t(e):t}function q(){const{language:e,translations:t}=L(j);function n(r){if(!t)return r;const o=t[e][r];return o||t.en[r]||r}return{t:n}}const Sn=()=>{const{t:e}=q(),{isTestMode:t}=L(j);return f("footer",{class:"flex flex-col items-center gap-4 text-xs",children:[f("a",{href:"https://moyasar.com/?ref=payment-form-v1.14.0",target:"_blank",class:"text-black/70",children:[e("form.powered_by")," ",f("strong",{children:e("common.moyasar")})]}),t&&f("span",{class:"text-red-600",children:e("common.test_mode_disclaimer")})]})},Cn={"error.authentication_error":"خطأ في المصادقة، الخدمة غير متوفرة حالياً","error.authorization_error":"خطأ في التفويض، الخدمة غير متوفرة حالياً","error.network":"خطأ في الشبكة","error.unknown":"حدث خطأ غير متوقع","error.invalid_mobile":"رقم الجوال غير صحيح","error.invalid_otp":"رمز التحقق غير صحيح","error.invalid_request_error":"طلب دفع غير صحيح","error.mobile_not_registered":"رقم الجوال غير مسجل","error.account_inactive_error":"حساب التاجر غير نشط","error.invalid_name":"يجب إدخال الاسم الأول والأخير","error.unsupported_cc_type":"نوع البطاقة الإئتمانية غير مدعوم","error.invalid_cc_number":"رقم البطاقة الإئتمانية غير صحيح","error.invalid_date":"تاريخ الإنتهاء غير صحيح","error.invalid_month":"شهر الإنتهاء غير صحيح","error.invalid_year":"سنة الإنتهاء غير صحيحة","error.invalid_csc":"رمز الأمان للبطاقة غير صحيح","error.cant_start_payment":"خطأ في بدء عملية الدفع، يرجى المحاولة لاحقاً","error.otp_time_out":"انتهت مدة رمز التحقق، يرجى المحاولة مرة أخرى","error.api_error":"حدث خطأ، يرجى تحديث الصفحة والمحاولة مرة أخرى","error.applePay":"تعذر الاتصال أو تفويض العملية","error.m070":"غير مسموح للتاجر بإجراء عمليات في نظام 3Ds","error.m071":"غير مسموح للتاجر بإجراء عمليات مباشرة بدون نظام 3Ds","error.m072":"لا يوجد للبائع حساب بنكي فعال","error.m074":"بلد البطاقة الائتمانية غير مسموح به","error.m075":"حساب التاجر غير مشترك في فواتير ميسر","error.m076":"حساب التاجر غير مسموح له باستخدام طريقة الدفع هذه","error.m077":"حساب التاجر لا يمكنه استخدام طريقة دفع STC Pay","form.cc":"بطاقة ائتمانية","form.code":"الرمز","form.mobile":"رقم الجوال","form.otp":"رمز التحقق","form.required":"مطلوب","form.name_on_card":"الاسم على البطاقة","form.last_name":"اسم العائلة","form.card_info":"معلومات البطاقة","form.date":"تاريخ الانتهاء","form.csc":"رمز التحقق CVC","form.or_pay_with_card":"أو ادفع بالبطاقة","form.powered_by":"مدعوم بواسطة","form.save_card_notice":"سيتم حفظ بيانات بطاقتك عند الإرسال","button.pay":"ادفع","button.pay-with":"ادفع باستخدام","button.buy":"اشتر باستخدام","button.donate":"تبرع باستخدام","button.book":"احجز باستخدام","button.check-out":"اتمام الشراء باستخدام","button.subscribe":"اشترك باستخدام","button.add-money":"أضف رصيد باستخدام","button.contribute":"ساهم باستخدام","button.order":"اطلب باستخدام","button.reload":"أعد الشحن باستخدام","button.rent":"استأجر باستخدام","button.support":"ادعم باستخدام","button.tip":"اترك إكرامية باستخدام","button.top-up":"اشحن باستخدام","button.continue":"المتابعة للدفع","button.verify":"تحقق","button.proceed":"متابعة","button.cancel":"إلغاء","validation.is_invalid":":attr غير صحيح","validation.can_t_be_blank":":attr مطلوب","validation.should_be_english_letters_only":"الاسم يجب أن يحتوي على أحرف إنجليزية ومسافات فقط","validation.first_and_last_name_required":"يجب إدخال الاسم الأول والأخير","common.moyasar":"ميسر","common.test_mode_disclaimer":"وضع الاختبار مفعل: يرجى عدم الاستخدام في بيئة غير تجريبية!"},An={"error.authentication_error":"Authentication error, service is unavailable now","error.authorization_error":"Authorization error, service is unavailable now","error.network":"Network Error","error.unknown":"Unexpected error occurred","error.invalid_mobile":"Invalid mobile number","error.invalid_otp":"Invalid verification code","error.invalid_request_error":"Invalid payment request","error.mobile_not_registered":"Mobile number is not registered","error.account_inactive_error":"Merchant account is not active","error.invalid_name":"First and last names are required","error.unsupported_cc_type":"Unsupported card type","error.invalid_cc_number":"Invalid credit card","error.invalid_date":"Invalid date","error.invalid_month":"Invalid month","error.invalid_year":"Invalid year","error.invalid_csc":"Invalid CVC number","error.cant_start_payment":"Error initiating payment, please try again later","error.otp_time_out":"OTP time has finished, please try again","error.api_error":"An error has occurred, please refresh the page and try again.","error.applePay":"Unable to connect or authorize transaction","error.m070":"Merchant is not allowed to transact in 3Ds","error.m071":"Merchant is not allowed to transact directly without 3Ds","error.m072":"Merchant does not have bank MID specified","error.m074":"Credit card country is not allowed","error.m075":"Merchant account is not subscribed to Moyasar invoices","error.m076":"Merchant account is not allowed to use this payment method","error.m077":"Merchant account cannot use stc pay method","form.cc":"Credit Card","form.code":"Code","form.mobile":"Mobile number","form.otp":"Verification code","form.required":"Required","form.name_on_card":"Name on card","form.last_name":"Last name","form.card_info":"Card information","form.date":"Expiry date","form.csc":"CVC","form.or_pay_with_card":"Or pay with card","form.powered_by":"Powered by","form.save_card_notice":"You card data will be saved upon submit.","button.pay":"Pay","button.pay-with":"Pay with","button.buy":"Buy with","button.donate":"Donate with","button.book":"Book with","button.check-out":"Check out with","button.subscribe":"Subscribe with","button.add-money":"Add money with","button.contribute":"Contribute with","button.order":"Order with","button.reload":"Reload with","button.rent":"Rent with","button.support":"Support with","button.tip":"Tip with","button.top-up":"Top Up with","button.continue":"Continue with payment","button.verify":"Verify","button.proceed":"Proceed","button.cancel":"Cancel","validation.is_invalid":"Invalid :attr","validation.can_t_be_blank":":attr is required","validation.should_be_english_letters_only":"Name may only have English alphabet and spaces","validation.first_and_last_name_required":"Both first and last name are required","common.moyasar":"Moyasar","common.test_mode_disclaimer":"Test Mode Enabled: Please do not use in production!"},Tn=e=>{const t={en:An,ar:Cn};return e&&Object.entries(e).forEach(([n,r])=>{t[n]||(t[n]={}),Object.entries(r).forEach(([o,a])=>{t[n][o]=a})}),t},Dn="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20width='100%25'%20height='100%25'%20viewBox='0%200%20450%20133'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20xml:space='preserve'%20xmlns:serif='http://www.serif.com/'%20style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;'%3e%3cg%3e%3cpath%20d='M291.862,97.715l0,-69.89l11.852,0l0,5.604c3.607,-4.509%208.954,-6.957%2015.588,-6.957c13.656,0%2023.447,10.886%2023.447,26.474c0,15.588%20-9.855,26.668%20-23.447,26.668c-6.699,0%20-11.981,-2.577%20-15.588,-7.086l0,25.186l-11.852,0l0,0.001Zm11.853,-51.209l-0,12.883c2.512,5.218%207.021,9.018%2013.527,9.018c7.859,0%2013.141,-5.862%2013.141,-15.524c-0,-9.533%20-5.282,-15.331%20-13.141,-15.331c-6.506,0.064%20-11.015,3.607%20-13.527,8.954'%20style='fill:%2302aa7c;fill-rule:nonzero;'/%3e%3cpath%20d='M350.415,63.769c0,-8.503%205.282,-14.429%2014.042,-15.524l20.162,-2.577l0,-2.512c0,-3.027%20-1.546,-4.638%20-4.38,-4.638l-25.315,0l0,-10.757l25.766,0c10.242,0%2015.846,5.024%2015.846,13.914l0,36.394l-11.981,0l0,-6.119c-3.478,4.896%20-9.211,7.665%20-16.619,7.665c-10.435,0%20-17.521,-6.377%20-17.521,-15.846m20.419,6.183c6.055,0%2011.659,-3.414%2013.72,-8.438l0,-6.313l-15.395,2.126c-4.251,0.58%20-6.635,2.834%20-6.635,6.506c0.001,3.929%203.028,6.119%208.31,6.119'%20style='fill:%2302aa7c;fill-rule:nonzero;'/%3e%3cpath%20d='M405.167,86.958l8.632,0c3.285,0%204.767,-1.353%205.862,-4.445l1.546,-4.445l-18.294,-50.308l12.368,0l11.401,35.042l0.258,0l10.886,-35.042l12.174,0l-20.033,57.78c-2.705,7.923%20-6.313,12.174%20-15.137,12.174l-9.662,0l-0.001,-10.756Z'%20style='fill:%2302aa7c;fill-rule:nonzero;'/%3e%3cpath%20d='M43.48,132.306c13.785,0%2025.122,-4.316%2032.594,-11.53c5.604,-5.54%208.889,-13.012%208.889,-21.643c0,-7.794%20-2.899,-14.815%20-8.245,-20.162c-5.346,-5.347%20-13.012,-9.276%20-22.674,-11.144l-15.846,-3.092c-6.57,-1.224%20-10.306,-4.509%20-10.306,-9.082c0,-5.991%205.797,-10.113%2015.073,-10.113c5.797,0%2010.757,1.868%2014.042,5.153c2.061,2.255%203.478,5.153%203.929,8.438l22.867,-5.153c-0.644,-6.57%20-3.736,-12.368%20-8.438,-17.134c-7.536,-7.408%20-19.067,-12.11%20-32.658,-12.11c-12.561,0%20-23.06,4.123%20-30.339,10.693c-6.184,5.797%20-9.662,13.591%20-9.662,22.287c0,7.601%202.448,14.042%207.408,18.938c4.96,4.96%2012.174,8.632%2021.643,10.95l15.653,3.736c7.859,1.868%2011.337,4.767%2011.337,9.92c0,6.377%20-5.797,10.113%20-15.266,10.113c-6.828,0%20-12.368,-2.255%20-15.846,-5.991c-2.448,-2.448%20-3.929,-5.797%20-4.123,-9.469l-23.512,5.154c0.644,7.021%203.929,13.205%208.889,18.165c7.794,8.18%2020.42,13.076%2034.591,13.076m174.048,0c15.266,0%2026.99,-5.54%2035.041,-13.398c6.377,-6.184%2010.306,-13.398%2012.368,-20.806l-24.091,-8.052c-1.031,3.736%20-3.092,7.665%20-6.377,10.693c-3.929,3.736%20-9.276,6.377%20-16.941,6.377c-7.021,0%20-13.591,-2.705%20-18.358,-7.408c-4.767,-4.96%20-7.665,-12.174%20-7.665,-21.257c-0,-9.276%202.899,-16.297%207.665,-21.257c4.702,-4.767%2011.144,-7.214%2018.165,-7.214c7.408,-0%2012.561,2.448%2016.297,6.184c3.092,3.092%204.96,7.021%206.184,10.95l24.542,-8.245c-1.868,-7.214%20-5.797,-14.429%20-11.53,-20.419c-8.245,-8.052%20-20.226,-13.785%20-36.072,-13.785c-14.622,-0%20-27.827,5.54%20-37.296,15.073c-9.469,9.662%20-15.266,23.125%20-15.266,38.778c0,15.653%205.991,29.051%2015.653,38.778c9.403,9.468%2022.801,15.008%2037.681,15.008m-83.288,0c10.693,0%2018.358,-3.285%2021.643,-6.184l0,-22.287c-2.512,1.868%20-7.408,4.123%20-13.849,4.123c-4.573,0%20-7.859,-1.031%20-10.306,-3.285c-2.061,-2.061%20-3.092,-5.604%20-3.092,-10.306l0,-94.367l-27.247,0l0,27.827l54.43,0l0,26.41l-54.43,0l0,46.829c0,9.469%202.899,17.134%208.052,22.481c5.797,5.667%2014.299,8.759%2024.799,8.759'%20style='fill:%23fff;fill-rule:nonzero;'/%3e%3c/g%3e%3c/svg%3e";function Nt(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Nt(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Mn(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Nt(e))&&(r&&(r+=" "),r+=t);return r}const oe=(...e)=>Mn(e),et=e=>{const p=e,{children:t,type:n="button",variant:r="primary",onClick:o,disabled:a,busy:i,fail:s,success:u}=p,l=Ke(p,["children","type","variant","onClick","disabled","busy","fail","success"]),{isProcessing:d}=L(j),c={primary:"bg-primary text-white",stc:"bg-stc text-white",error:"bg-error text-white pointer-events-none",success:"bg-success text-white"};function h(){return s?c.error:u?c.success:c[r]}return f("button",R(S({},l),{type:n,disabled:d||a,onClick:o,class:oe(["flex h-11 w-full cursor-pointer items-center justify-center gap-2 rounded-lg px-3 py-2 transition-colors disabled:cursor-default disabled:opacity-70",h(),e.class,d&&!s&&"pointer-events-none grayscale"]),children:[s?f("svg",{class:"h-5 w-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:[f("circle",{cx:"12",cy:"12",r:"10"}),f("path",{d:"m15 9-6 6"}),f("path",{d:"m9 9 6 6"})]}):t,i&&f("svg",{class:"h-4 w-4 animate-spin text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[f("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),f("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),u&&f("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"h-4 w-4",children:[f("path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5"}),f("path",{class:"animate-fade-in",d:"m9 11 3 3L22 4"})]})]}))},pe=e=>{const u=e,{name:t,placeholder:n,type:r="text",onBlur:o,disabled:a}=u,i=Ke(u,["name","placeholder","type","onBlur","disabled"]),{isProcessing:s}=L(j);return f("input",R(S({},i),{dir:"ltr",id:t,name:t,disabled:s||a,class:oe(["relative block w-full rounded-lg border-0 px-4 py-2 text-sm text-black shadow-input placeholder:text-black/70 focus:z-[2] focus:shadow-input-focus focus:outline-none",e.class,s&&"pointer-events-none grayscale",e.error&&"z-[1] shadow-input-error"]),type:r,placeholder:n,onBlur:l=>{const d=l.target;d.classList.add("shadow-input-error","z-[1]"),d.value.trim()&&d.classList.remove("shadow-input-error","z-[1]"),o&&typeof o=="function"&&o(l)}}))},tt=Xe({});function On(e,t){for(var n in t)e[n]=t[n];return e}function Ft(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return!0;for(var r in t)if(r!=="__source"&&e[r]!==t[r])return!0;return!1}function Ut(e,t){this.props=e,this.context=t}(Ut.prototype=new Q).isPureReactComponent=!0,Ut.prototype.shouldComponentUpdate=function(e,t){return Ft(this.props,e)||Ft(this.state,t)};var Lt=g.__b;g.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Lt&&Lt(e)};var Rn=g.__e;g.__e=function(e,t,n,r){if(e.then){for(var o,a=t;a=a.__;)if((o=a.__c)&&o.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k),o.__c(e,t)}Rn(e,t,n,r)};var Vt=g.unmount;function Gt(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),e.__c.__H=null),(e=On({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(r){return Gt(r,t,n)})),e}function Bt(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(r){return Bt(r,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function nt(){this.__u=0,this.t=null,this.__b=null}function zt(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function Me(){this.u=null,this.o=null}g.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Vt&&Vt(e)},(nt.prototype=new Q).__c=function(e,t){var n=t.__c,r=this;r.t==null&&(r.t=[]),r.t.push(n);var o=zt(r.__v),a=!1,i=function(){a||(a=!0,n.__R=null,o?o(s):s())};n.__R=i;var s=function(){if(!--r.__u){if(r.state.__a){var u=r.state.__a;r.__v.__k[0]=Bt(u,u.__c.__P,u.__c.__O)}var l;for(r.setState({__a:r.__b=null});l=r.t.pop();)l.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(i,i)},nt.prototype.componentWillUnmount=function(){this.t=[]},nt.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=Gt(this.__b,n,r.__O=r.__P)}this.__b=null}var o=t.__a&&Ze(re,null,e.fallback);return o&&(o.__u&=-33),[Ze(re,null,t.__a?null:e.children),o]};var jt=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.u=n=n[2]}};(Me.prototype=new Q).__a=function(e){var t=this,n=zt(t.__v),r=t.o.get(e);return r[0]++,function(o){var a=function(){t.props.revealOrder?(r.push(o),jt(t,e,r)):o()};n?n(a):a()}},Me.prototype.render=function(e){this.u=null,this.o=new Map;var t=Ce(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},Me.prototype.componentDidUpdate=Me.prototype.componentDidMount=function(){var e=this;this.o.forEach(function(t,n){jt(e,n,t)})};var In=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.element")||60103,Nn=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Fn=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Un=/[A-Z0-9]/g,Ln=typeof document!="undefined",Vn=function(e){return(typeof Symbol!="undefined"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};Q.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(Q.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var Ht=g.event;function Gn(){}function Bn(){return this.cancelBubble}function zn(){return this.defaultPrevented}g.event=function(e){return Ht&&(e=Ht(e)),e.persist=Gn,e.isPropagationStopped=Bn,e.isDefaultPrevented=zn,e.nativeEvent=e};var jn={enumerable:!1,configurable:!0,get:function(){return this.class}},Kt=g.vnode;g.vnode=function(e){typeof e.type=="string"&&function(t){var n=t.props,r=t.type,o={};for(var a in n){var i=n[a];if(!(a==="value"&&"defaultValue"in n&&i==null||Ln&&a==="children"&&r==="noscript"||a==="class"||a==="className")){var s=a.toLowerCase();a==="defaultValue"&&"value"in n&&n.value==null?a="value":a==="download"&&i===!0?i="":s==="translate"&&i==="no"?i=!1:s==="ondoubleclick"?a="ondblclick":s!=="onchange"||r!=="input"&&r!=="textarea"||Vn(n.type)?s==="onfocus"?a="onfocusin":s==="onblur"?a="onfocusout":Fn.test(a)?a=s:r.indexOf("-")===-1&&Nn.test(a)?a=a.replace(Un,"-$&").toLowerCase():i===null&&(i=void 0):s=a="oninput",s==="oninput"&&o[a=s]&&(a="oninputCapture"),o[a]=i}}r=="select"&&o.multiple&&Array.isArray(o.value)&&(o.value=Ce(n.children).forEach(function(u){u.props.selected=o.value.indexOf(u.props.value)!=-1})),r=="select"&&o.defaultValue!=null&&(o.value=Ce(n.children).forEach(function(u){u.props.selected=o.multiple?o.defaultValue.indexOf(u.props.value)!=-1:o.defaultValue==u.props.value})),n.class&&!n.className?(o.class=n.class,Object.defineProperty(o,"className",jn)):(n.className&&!n.class||n.class&&n.className)&&(o.class=o.className=n.className),t.props=o}(e),e.$$typeof=In,Kt&&Kt(e)};var Zt=g.__r;g.__r=function(e){Zt&&Zt(e),e.__c};var qt=g.diffed;g.diffed=function(e){qt&&qt(e);var t=e.props,n=e.__e;n!=null&&e.type==="textarea"&&"value"in t&&t.value!==n.value&&(n.value=t.value==null?"":t.value)};function fe(e,t,n){var r=this,o=$(null),a=$(0),i=$(null),s=$([]),u=$(),l=$(),d=$(e),c=$(!0);d.current=e;var h=typeof window!="undefined",p=!t&&t!==0&&h;if(typeof e!="function")throw new TypeError("Expected a function");t=+t||0;var _=!!(n=n||{}).leading,b=!("trailing"in n)||!!n.trailing,m="maxWait"in n,y="debounceOnServer"in n&&!!n.debounceOnServer,v=m?Math.max(+n.maxWait||0,t):null;Z(function(){return c.current=!0,function(){c.current=!1}},[]);var w=ce(function(){var k=function(A){var C=s.current,z=u.current;return s.current=u.current=null,a.current=A,l.current=d.current.apply(z,C)},x=function(A,C){p&&cancelAnimationFrame(i.current),i.current=p?requestAnimationFrame(A):setTimeout(A,C)},P=function(A){if(!c.current)return!1;var C=A-o.current;return!o.current||C>=t||C<0||m&&A-a.current>=v},T=function(A){return i.current=null,b&&s.current?k(A):(s.current=u.current=null,l.current)},D=function A(){var C=Date.now();if(P(C))return T(C);if(c.current){var z=t-(C-o.current),te=m?Math.min(z,v-(C-a.current)):z;x(A,te)}},B=function(){if(h||y){var A=Date.now(),C=P(A);if(s.current=[].slice.call(arguments),u.current=r,o.current=A,C){if(!i.current&&c.current)return a.current=o.current,x(D,t),_?k(o.current):l.current;if(m)return x(D,t),k(o.current)}return i.current||x(D,t),l.current}};return B.cancel=function(){i.current&&(p?cancelAnimationFrame(i.current):clearTimeout(i.current)),a.current=0,s.current=o.current=u.current=i.current=null},B.isPending=function(){return!!i.current},B.flush=function(){return i.current?T(Date.now()):l.current},B},[_,m,t,v,b,p,h,y]);return w}var Hn=Object.defineProperty,Kn=(e,t,n)=>t in e?Hn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Oe=(e,t,n)=>Kn(e,typeof t!="symbol"?t+"":t,n);const Yt={"#":{pattern:/[0-9]/},"@":{pattern:/[a-zA-Z]/},"*":{pattern:/[a-zA-Z0-9]/}},Jt=(e,t,n)=>e.replaceAll(t,"").replace(n,".").replace("..",".").replace(/[^.\d]/g,""),Wt=(e,t,n)=>{var o;var r;return new Intl.NumberFormat((o=(r=n.number)==null?void 0:r.locale)!=null?o:"en",{minimumFractionDigits:e,maximumFractionDigits:t,roundingMode:"trunc"})},Zn=(e,t=!0,n)=>{var m,y,v;var r,o,a,i;const s=((r=n.number)==null?void 0:r.unsigned)==null&&e.startsWith("-")?"-":"",u=(m=(o=n.number)==null?void 0:o.fraction)!=null?m:0;let l=Wt(0,u,n);const d=l.formatToParts(1000.12),c=(y=(a=d.find(w=>w.type==="group"))==null?void 0:a.value)!=null?y:" ",h=(v=(i=d.find(w=>w.type==="decimal"))==null?void 0:i.value)!=null?v:".",p=Jt(e,c,h);if(Number.isNaN(parseFloat(p)))return s;const _=p.split(".");if(_[1]!=null&&_[1].length>=1){const w=_[1].length<=u?_[1].length:u;l=Wt(w,u,n)}let b=l.format(parseFloat(p));return t?u>0&&p.endsWith(".")&&!p.slice(0,-1).includes(".")&&(b+=h):b=Jt(b,c,h),s+b};class qn{constructor(t={}){var r;Oe(this,"opts",{}),Oe(this,"memo",new Map);const n=S({},t);if(n.tokens!=null){n.tokens=n.tokensReplace?S({},n.tokens):S(S({},Yt),n.tokens);for(const o of Object.values(n.tokens))typeof o.pattern=="string"&&(o.pattern=new RegExp(o.pattern))}else n.tokens=Yt;Array.isArray(n.mask)&&(n.mask.length>1?n.mask=[...n.mask].sort((o,a)=>o.length-a.length):n.mask=(r=n.mask[0])!=null?r:""),n.mask===""&&(n.mask=null),this.opts=n}masked(t){return this.process(t,this.findMask(t))}unmasked(t){return this.process(t,this.findMask(t),!1)}isEager(){return this.opts.eager===!0}isReversed(){return this.opts.reversed===!0}completed(t){const n=this.findMask(t);if(this.opts.mask==null||n==null)return!1;const r=this.process(t,n).length;return typeof this.opts.mask=="string"?r>=this.opts.mask.length:r>=n.length}findMask(t){var o,a;const n=this.opts.mask;if(n==null)return null;if(typeof n=="string")return n;if(typeof n=="function")return n(t);const r=this.process(t,(o=n.slice(-1).pop())!=null?o:"",!1);return(a=n.find(i=>this.process(t,i,!1).length>=r.length))!=null?a:""}escapeMask(t){const n=[],r=[];return t.split("").forEach((o,a)=>{o==="!"&&t[a-1]!=="!"?r.push(a-r.length):n.push(o)}),{mask:n.join(""),escaped:r}}process(t,n,r=!0){if(this.opts.number!=null)return Zn(t,r,this.opts);if(n==null)return t;const o=`v=${t},mr=${n},m=${r?1:0}`;if(this.memo.has(o))return this.memo.get(o);const{mask:a,escaped:i}=this.escapeMask(n),s=[],u=this.opts.tokens!=null?this.opts.tokens:{},l=this.isReversed()?-1:1,d=this.isReversed()?"unshift":"push",c=this.isReversed()?0:a.length-1,h=this.isReversed()?()=>m>-1&&y>-1:()=>m<a.length&&y<t.length,p=w=>!this.isReversed()&&w<=c||this.isReversed()&&w>=c;let _,b=-1,m=this.isReversed()?a.length-1:0,y=this.isReversed()?t.length-1:0,v=!1;for(;h();){const w=a.charAt(m),k=u[w],x=(k==null?void 0:k.transform)!=null?k.transform(t.charAt(y)):t.charAt(y);if(!i.includes(m)&&k!=null?(x.match(k.pattern)!=null?(s[d](x),k.repeated?(b===-1?b=m:m===c&&m!==b&&(m=b-l),c===b&&(m-=l)):k.multiple&&(v=!0,m-=l),m+=l):k.multiple?v&&(m+=l,y-=l,v=!1):x===_?_=void 0:k.optional&&(m+=l,y-=l),y+=l):(r&&!this.isEager()&&s[d](w),x===w&&!this.isEager()?y+=l:_=w,this.isEager()||(m+=l)),this.isEager())for(;p(m)&&(u[a.charAt(m)]==null||i.includes(m));){if(r){if(s[d](a.charAt(m)),t.charAt(y)===a.charAt(m)){m+=l,y+=l;continue}}else a.charAt(m)===t.charAt(y)&&(y+=l);m+=l}}return this.memo.set(o,s.join("")),this.memo.get(o)}}const Xt=e=>JSON.parse(e.replaceAll("'",'"')),Yn=(e,t={})=>{const n=S({},t);e.dataset.maska!=null&&e.dataset.maska!==""&&(n.mask=Jn(e.dataset.maska)),e.dataset.maskaEager!=null&&(n.eager=Re(e.dataset.maskaEager)),e.dataset.maskaReversed!=null&&(n.reversed=Re(e.dataset.maskaReversed)),e.dataset.maskaTokensReplace!=null&&(n.tokensReplace=Re(e.dataset.maskaTokensReplace)),e.dataset.maskaTokens!=null&&(n.tokens=Wn(e.dataset.maskaTokens));const r={};return e.dataset.maskaNumberLocale!=null&&(r.locale=e.dataset.maskaNumberLocale),e.dataset.maskaNumberFraction!=null&&(r.fraction=parseInt(e.dataset.maskaNumberFraction)),e.dataset.maskaNumberUnsigned!=null&&(r.unsigned=Re(e.dataset.maskaNumberUnsigned)),(e.dataset.maskaNumber!=null||Object.values(r).length>0)&&(n.number=r),n},Re=e=>e!==""?!!JSON.parse(e):!0,Jn=e=>e.startsWith("[")&&e.endsWith("]")?Xt(e):e,Wn=e=>{if(e.startsWith("{")&&e.endsWith("}"))return Xt(e);const t={};return e.split("|").forEach(n=>{const r=n.split(":");t[r[0]]={pattern:new RegExp(r[1]),optional:r[2]==="optional",multiple:r[2]==="multiple",repeated:r[2]==="repeated"}}),t};class Ie{constructor(t,n={}){Oe(this,"items",new Map),Oe(this,"onInput",r=>{if(r instanceof CustomEvent&&r.type==="input"&&!r.isTrusted&&!r.bubbles)return;const o=r.target,a=this.items.get(o),i="inputType"in r&&r.inputType.startsWith("delete"),s=a.isEager(),u=i&&s&&a.unmasked(o.value)===""?"":o.value;this.fixCursor(o,i,()=>this.setValue(o,u))}),this.options=n,this.init(this.getInputs(t))}update(t={}){this.options=S({},t),this.init(Array.from(this.items.keys()))}updateValue(t){t.value!==""&&t.value!==this.processInput(t).masked&&this.setValue(t,t.value)}destroy(){for(const t of this.items.keys())t.removeEventListener("input",this.onInput);this.items.clear()}init(t){const n=this.getOptions(this.options);for(const r of t){this.items.has(r)||r.addEventListener("input",this.onInput,{capture:!0});const o=new qn(Yn(r,n));this.items.set(r,o),queueMicrotask(()=>this.updateValue(r)),r.selectionStart===null&&o.isEager()&&console.warn("Maska: input of `%s` type is not supported",r.type)}}getInputs(t){return typeof t=="string"?Array.from(document.querySelectorAll(t)):"length"in t?Array.from(t):[t]}getOptions(t){const i=t,{onMaska:n,preProcess:r,postProcess:o}=i;return Ke(i,["onMaska","preProcess","postProcess"])}fixCursor(t,n,r){const o=t.selectionStart,a=t.value;if(r(),o===null||o===a.length&&!n)return;const i=t.value,s=a.slice(0,o),u=i.slice(0,o),l=this.processInput(t,s).unmasked,d=this.processInput(t,u).unmasked;let c=o;s!==u&&(c+=n?i.length-a.length:l.length-d.length),t.setSelectionRange(c,c)}setValue(t,n){const r=this.processInput(t,n);t.value=r.masked,this.options.onMaska!=null&&(Array.isArray(this.options.onMaska)?this.options.onMaska.forEach(o=>o(r)):this.options.onMaska(r)),t.dispatchEvent(new CustomEvent("maska",{detail:r})),t.dispatchEvent(new CustomEvent("input",{detail:r.masked}))}processInput(t,n){const r=this.items.get(t);let o=n!=null?n:t.value;this.options.preProcess!=null&&(o=this.options.preProcess(o));let a=r.masked(o);return this.options.postProcess!=null&&(a=this.options.postProcess(a)),{masked:a,unmasked:r.unmasked(o),completed:r.completed(o)}}}const Xn=({showOtp:e,value:t,setValue:n})=>{const{t:r}=q(),{handleBlur:o,err:a}=L(tt),i="### ### ####",s=l=>{const d=l.target,{value:c}=d;n(c)},u=fe(o,1e3);return Z(()=>{new Ie('[name="mysr-stc-mobile"]')},[]),f(pe,{name:"mysr-stc-mobile",label:r("form.mobile"),type:"text",inputMode:"numeric",maxLength:i.length,autocomplete:"tel-national",placeholder:"05x xxx xxxx",class:oe(["animate-fade-in text-center",!e&&"hidden"]),onAnimationEnd:l=>{l.target&&l.target.focus()},value:t,onKeyUp:l=>{s(l),u(l)},onBlur:o,error:a.phone,"data-maska":i,"data-maska-eager":!0})},Qn=({showPhone:e,value:t,setValue:n})=>{const{t:r}=q(),{handleBlur:o,err:a}=L(tt),i=u=>{const l=u.target,{value:d}=l;n(d)},s=fe(o,1e3);return Z(()=>{new Ie('[name="mysr-stc-otp"]')},[]),f(pe,{name:"mysr-stc-otp",label:r("form.otp"),type:"text",inputMode:"numeric",autocomplete:"one-time-code",placeholder:r("form.code"),class:oe(["animate-fade-in text-center",e&&"hidden"]),onAnimationEnd:u=>{u.target&&u.target.focus()},value:t,onKeyUp:u=>{i(u),s(u)},onBlur:o,error:a.otp,"data-maska":"### ###","data-maska-eager":!0})},H=e=>e.split(" ").join(""),$n=({countTo:e,callback:t})=>{const n=$(null),r=Mt(()=>{const s=e?new Date(e).getTime()-new Date().getTime():0;return s<0?0:s},[e]),[o,a]=N(r());Z(()=>(n.current=setInterval(()=>{a(r())},500),()=>{n.current&&clearInterval(n.current)}),[r]),Z(()=>{o===0&&(n.current&&clearInterval(n.current),typeof t=="function"&&t(0))},[t,o]);const i=()=>{const s=Math.floor(o/1e3/60/60),u=Math.floor((o/1e3/60/60-s)*60),l=Math.floor(((o/1e3/60/60-s)*60-u)*60);return f("span",{children:[u,":",l<10?`0${l}`:l]})};return!e||!o?null:f("div",{class:oe("inline-flex gap-2 text-sm"),children:i()})},er="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20width='100%25'%20height='100%25'%20viewBox='0%200%20512%20174'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20xml:space='preserve'%20xmlns:serif='http://www.serif.com/'%20style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;'%3e%3cg%3e%3cpath%20d='M326.531,121.529l-0,-74.676l12.663,0l0,5.988c3.854,-4.818%209.567,-7.433%2016.655,-7.433c14.592,-0%2025.053,11.631%2025.053,28.286c-0,16.656%20-10.53,28.494%20-25.053,28.494c-7.157,0%20-12.801,-2.753%20-16.655,-7.571l0,26.911l-12.663,-0l-0,0.001Zm12.664,-54.716l0,13.765c2.684,5.576%207.502,9.636%2014.453,9.636c8.398,-0%2014.041,-6.264%2014.041,-16.587c0,-10.186%20-5.643,-16.381%20-14.041,-16.381c-6.951,0.069%20-11.769,3.854%20-14.453,9.567'%20style='fill:%2302aa7c;fill-rule:nonzero;'%20/%3e%3cpath%20d='M389.093,85.258c-0,-9.085%205.643,-15.417%2015.003,-16.587l21.543,-2.753l-0,-2.684c-0,-3.234%20-1.652,-4.956%20-4.68,-4.956l-27.048,0l-0,-11.493l27.53,-0c10.943,-0%2016.931,5.368%2016.931,14.867l-0,38.885l-12.802,0l0,-6.538c-3.716,5.232%20-9.841,8.19%20-17.757,8.19c-11.149,0%20-18.72,-6.813%20-18.72,-16.931m21.817,6.607c6.469,-0%2012.457,-3.648%2014.659,-9.016l0,-6.745l-16.449,2.271c-4.542,0.62%20-7.089,3.028%20-7.089,6.952c0.001,4.198%203.235,6.538%208.879,6.538'%20style='fill:%2302aa7c;fill-rule:nonzero;'%20/%3e%3cpath%20d='M447.594,110.035l9.223,0c3.51,0%205.093,-1.446%206.263,-4.749l1.652,-4.75l-19.547,-53.752l13.215,-0l12.182,37.441l0.275,0l11.632,-37.441l13.007,-0l-21.404,61.736c-2.891,8.465%20-6.746,13.008%20-16.174,13.008l-10.323,-0l-0.001,-11.493Z'%20style='fill:%2302aa7c;fill-rule:nonzero;'%20/%3e%3cpath%20d='M61.142,158.488c14.729,0%2026.842,-4.611%2034.826,-12.319c5.987,-5.92%209.497,-13.903%209.497,-23.125c0,-8.328%20-3.097,-15.83%20-8.809,-21.543c-5.712,-5.713%20-13.903,-9.911%20-24.227,-11.907l-16.931,-3.304c-7.02,-1.307%20-11.011,-4.817%20-11.011,-9.703c-0,-6.402%206.194,-10.806%2016.105,-10.806c6.194,0%2011.493,1.996%2015.003,5.506c2.202,2.409%203.716,5.506%204.198,9.016l24.433,-5.506c-0.688,-7.02%20-3.992,-13.215%20-9.016,-18.307c-8.052,-7.915%20-20.372,-12.939%20-34.894,-12.939c-13.421,-0%20-24.639,4.405%20-32.416,11.425c-6.608,6.194%20-10.324,14.521%20-10.324,23.813c0,8.121%202.616,15.003%207.915,20.234c5.3,5.3%2013.008,9.223%2023.125,11.7l16.725,3.992c8.397,1.996%2012.113,5.093%2012.113,10.599c0,6.814%20-6.194,10.806%20-16.311,10.806c-7.295,-0%20-13.215,-2.41%20-16.931,-6.402c-2.616,-2.615%20-4.198,-6.194%20-4.405,-10.117l-25.122,5.507c0.688,7.502%204.198,14.109%209.498,19.409c8.327,8.74%2021.818,13.971%2036.959,13.971m185.965,0c16.311,0%2028.838,-5.919%2037.44,-14.315c6.814,-6.608%2011.012,-14.316%2013.215,-22.231l-25.74,-8.603c-1.102,3.992%20-3.304,8.19%20-6.814,11.425c-4.198,3.992%20-9.911,6.814%20-18.101,6.814c-7.502,-0%20-14.522,-2.891%20-19.615,-7.916c-5.093,-5.299%20-8.19,-13.007%20-8.19,-22.712c0,-9.911%203.098,-17.413%208.19,-22.713c5.024,-5.093%2011.907,-7.708%2019.409,-7.708c7.915,0%2013.421,2.616%2017.413,6.608c3.303,3.304%205.299,7.502%206.607,11.7l26.222,-8.81c-1.995,-7.708%20-6.193,-15.417%20-12.319,-21.817c-8.81,-8.603%20-21.611,-14.729%20-38.542,-14.729c-15.623,0%20-29.732,5.919%20-39.849,16.105c-10.118,10.324%20-16.312,24.709%20-16.312,41.433c0,16.725%206.401,31.04%2016.725,41.433c10.047,10.117%2024.362,16.036%2040.261,16.036m-88.991,0c11.425,0%2019.615,-3.51%2023.125,-6.607l0,-23.813c-2.684,1.996%20-7.915,4.405%20-14.797,4.405c-4.886,-0%20-8.397,-1.102%20-11.012,-3.51c-2.202,-2.202%20-3.303,-5.988%20-3.303,-11.012l-0,-100.828l-29.113,0l0,29.732l58.157,0l-0,28.219l-58.157,-0l0,50.035c0,10.117%203.097,18.307%208.603,24.02c6.194,6.055%2015.278,9.359%2026.497,9.359'%20style='fill:%23502c84;fill-rule:nonzero;'%20/%3e%3c/g%3e%3c/svg%3e";function Qt(e){return e.errors!==void 0}const tr=()=>{const{t:e}=q(),[t,n]=N(!1),{amount:r,currency:o,description:a,publishable_api_key:i,metadata:s,invoice_id:u,version:l,base_url:d,on_failure:c,setFormSettings:h}=L(j),p=v=>{h&&(n(v),h(w=>R(S({},w),{isProcessing:v})))},_={amount:r,currency:o,description:a,publishable_api_key:i};s&&Object.keys(s).length>0&&(_.metadata=s),u&&(_.invoice_id=u.toLowerCase());const b=v=>{h&&h(w=>R(S({},w),{apiError:`${e("error."+v.type)}, ${v.message}`}))},m=()=>{h&&h(v=>R(S({},v),{apiError:""}))};return{processing:t,postData:k=>X(this,[k],function*({data:v,path:w}){p(!0),m();const x=w||`${d}/v1/payments`;try{const P=yield fetch(x,{method:"POST",headers:{"Content-Type":"application/json","X-Moyasar-Form-Version":l},body:JSON.stringify(S(S({},_),v))});if(!P.ok){if(typeof P=="object"){const T=yield P.json();if(console.log("fetch error:",T),!Qt(T)){b({type:"api_error",message:`Error code: ${P.status}`,errors:null});return}return b(T),T}return yield Promise.reject(P)}return P.json()}catch(P){if(c)try{yield c(P)}catch(T){console.error("An error happened when firing failure callback"),console.error(T)}console.error(P)}finally{p(!1)}})}},nr=()=>{const{apiError:e}=L(j),[t,n]=N(!1);return Z(()=>{n(!!e)},[e]),Z(()=>{let r=null;return t&&(r=setTimeout(()=>{n(!1)},3e3)),()=>{r&&clearTimeout(r)}},[t]),{fail:t}},rr=n=>X(this,[n],function*({on_initiating:e,setFormSettings:t}){const r=a=>{if(typeof a!="object"||!t)return;const i=["callback_url","description","metadata","amount"];for(const s in a)if(!i.includes(s))throw new Error(`Changing ${s} is not allowed!`);t(s=>S(S({},s),a))};if(!e)return Promise.resolve();if(typeof e!="function")throw new Error("Invalid on_initiating handler");const o=yield e();if(typeof o=="boolean")return o;if(typeof o=="object")return r(o),!0;throw new Error(`Invalid on_initiating handler result: ${o}`)}),or=(e,t,n)=>X(this,null,function*(){var o;const r=`${e}${e.indexOf("?")>-1?"&":"?"}id=${t.id}&status=${t.status}&message=${(o=t.source)==null?void 0:o.message}`;n&&typeof n=="function"?yield n(r):window.location.href=r}),ar=n=>X(this,[n],function*({payment:e,on_completed:t}){if(t!==null){if(typeof t!="function")throw new Error("Invalid on_completed handler");try{yield t(e)}catch(r){throw new Error("Unexpected error while handling on_completed callback")}}}),ge=({defaultError:e})=>{const{callback_url:t,on_initiating:n,on_redirect:r,on_completed:o,setFormSettings:a}=L(j),[i,s]=N(e),{processing:u,postData:l}=tr(),[d,c]=N(!1),[h,p]=N(!1),{fail:_}=nr();function b(T){return X(this,arguments,function*({data:v,path:w,onSuccess:k,onFailed:x,initPayment:P}){const D=yield l({data:v,path:w});Qt(D)||(D&&(k&&k(D),o&&!P&&(yield ar({payment:D,on_completed:o}).catch(B=>{console.error(B)})),D.status==="paid"&&(p(!0),setTimeout(()=>{or(t,D,r).catch(()=>{})},100)),D.status==="failed"&&x&&x(D)),c(!1))})}function m(v){return X(this,null,function*(){if(c(!0),v.initPayment){try{const w=yield rr({on_initiating:n,setFormSettings:a});if(typeof w=="boolean"&&!w){c(!1);return}yield b(v)}catch(w){console.error(w),c(!1)}return}yield b(v)})}const y=ce(()=>u||d,[u,d]);return{makePayment:m,busy:d,fail:_,success:h,processing:u,loading:y,error:i,setError:s}},$t=({inForm:e=!1})=>{const{apiError:t,showForm:n}=L(j);return n&&!e?null:f("p",{class:"flex flex-col gap-2 rounded-md border border-error bg-red-100 px-4 py-2 text-xs font-medium text-error empty:hidden",children:t})},ir=()=>{const{t:e}=q(),{formattedAmount:t,isRtl:n,fixed_width:r,setFormSettings:o,showForm:a}=L(j),[i,s]=N(null),[u,l]=N(!1),d={phone:"",otp:""},{makePayment:c,busy:h,fail:p,success:_,loading:b,error:m,setError:y}=ge({defaultError:d}),[v,w]=N(""),[k,x]=N(""),[P,T]=N(""),D=G=>{const O=/^05[503649187][0-9]{7}$/.test(H(G));return y(Y=>R(S({},Y),{phone:O?"":"error.invalid_mobile"})),O},B=G=>{const O=/^[0-9]{4,}$/.test(H(G));return y(Y=>R(S({},Y),{otp:O?"":"error.invalid_otp"})),O},A=G=>{const{value:O,name:Y}=G.target,ae=O.trim();if(l(!1),!ae){l(!ae);return}Y==="mysr-stc-mobile"&&D(ae),Y==="mysr-stc-otp"&&B(ae)},C=()=>{if(!D(v))return;function G(O){const{transaction_url:Y}=O.source;T(Y),s(new Date().getTime()+5*60*1e3)}c({data:{source:{type:"stcpay",mobile:H(v)}},onSuccess:G,initPayment:!0}).catch(O=>{console.error(O)})},z=()=>{if(!i||!B(k))return;function G(O){var Y;O.status==="failed"&&((Y=O.source)==null?void 0:Y.message)==="Invalid OTP"&&(y(ae=>R(S({},ae),{otp:"error.invalid_otp"})),x(""),s(null))}c({data:{otp_value:H(k)},path:P,onFailed:G}).catch(O=>{console.error(O)})},te=G=>{if(G.preventDefault(),y(d),!i){C();return}z()},Be=G=>{G>0||(y(O=>R(S({},O),{otp:"error.otp_time_out"})),x(""),s(null))},ze=ce(()=>m.phone||i&&m.otp&&m.otp!=="error.otp_time_out"?!0:u||b,[m,u,b]),we=G=>o(O=>R(S({},O),{showForm:G})),[me,ke]=N(!1),je=()=>{ke(!0)},dt=()=>{me&&(w(""),x(""),y(d),we(!1),ke(!1),l(!1))};return f(tt.Provider,{value:{err:m,setErr:y,handleBlur:A},children:f(re,{children:[f(et,{variant:"stc",onClick:()=>we(!0),children:f("img",{class:"pointer-events-none h-4 max-h-full",height:16,width:55,alt:"STC Pay",src:Dn})}),a&&f(re,{children:[f("div",{class:oe(["fixed inset-0 z-[9] bg-gray-500/75 transition-opacity",me?"animate-fade-out duration-300":"animate-fade-in duration-200"])}),f("div",{class:"fixed inset-0 z-10 flex flex-col justify-end md:justify-center",children:f("div",{class:oe(["flex w-full origin-bottom flex-col gap-4 rounded-t-lg border-neutral-300 bg-slate-100 p-4 shadow transition-all md:rounded-b-lg lg:p-10",r&&"md:mx-auto md:max-w-96 lg:max-w-screen-sm",me?"animate-dialog-out-mobile duration-200 md:animate-dialog-out":"animate-dialog-in-mobile duration-300 md:animate-dialog-in"]),onAnimationEnd:dt,children:[f($t,{inForm:!0}),f("div",{class:"flex items-center",children:[f("img",{alt:"",src:er,class:"h-5"}),f("button",{onClick:je,class:"ms-auto",children:"Cancel"})]}),f("form",{class:"flex flex-col gap-4",onSubmit:te,children:[f("div",{class:"space-y-2",children:[f("div",{class:"flex items-end justify-between text-xs font-medium",children:[i?f("label",{for:"mysr-stc-mobile",children:e("form.otp")}):f("label",{for:"mysr-stc-otp",children:e("form.mobile")}),u&&f("span",{class:"uppercase text-error",children:e("form.required")})]}),f(Xn,{value:v,setValue:w,showOtp:!i&&typeof i!="number"}),f(Qn,{value:k,setValue:x,showPhone:!i&&typeof i!="number"})]}),f(et,{success:_,fail:p,busy:h,variant:"stc",class:"flex gap-1",disabled:ze,type:"submit",children:[!n&&e("button.pay")," ",i?f($n,{countTo:i,callback:Be}):t]})]}),f("p",{class:"flex flex-col gap-2 text-xs font-medium text-error empty:hidden",children:Object.entries(m).map(([G,O])=>f("span",{class:"empty:hidden",children:e(O)},G))})]})})]})]})})},sr=()=>{const{t:e}=q(),{base_url:t,payment_button_type:n,publishable_api_key:r,apple_pay:o,payment_options:a,currency:i,supported_networks:s,decimalAmount:u,statement_descriptor:l,setFormSettings:d}=L(j),{makePayment:c}=ge({defaultError:{}});function h(){if(!ApplePaySession)return;const p=(o==null?void 0:o.label)||(a==null?void 0:a.label),b={countryCode:(o==null?void 0:o.country)||(a==null?void 0:a.country),currencyCode:i,supportedNetworks:s,merchantCapabilities:o.merchant_capabilities,total:{label:p,amount:u}},m=new ApplePaySession(o.version,b);m.onvalidatemerchant=y=>{const v={validation_url:y.validationURL,display_name:p,domain_name:window.location.hostname,publishable_api_key:r},w=o.validate_merchant_url||`${t}/v1/applepay/initiate`;fetch(w,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(v)}).then(k=>k.ok?k:Promise.reject(k)).then(k=>k.json()).then(k=>{m.completeMerchantValidation(k)}).catch(k=>{console.error("Apple Pay error:",k),d(x=>R(S({},x),{apiError:e("error.applePay")})),m.abort()})},m.onpaymentauthorized=y=>{const v={source:{type:"applepay",token:JSON.stringify(y.payment.token)}};l&&(v.statement_descriptor=l);function w(x){var T;console.error(x),m.completePayment({status:ApplePaySession.STATUS_FAILURE,errors:[]});let P="Payment failed.";x instanceof Response?P+=" Error: "+x.statusText:typeof x=="string"?P+=" Error: "+x:x.status==="failed"&&(P+=" Error: "+((T=x.source)==null?void 0:T.message)),d(D=>R(S({},D),{apiError:P}))}function k(x){console.error(x),m.completePayment({status:ApplePaySession.STATUS_SUCCESS})}c({data:v,onFailed:w,onSuccess:k}).catch(x=>{console.error(x)})},m.oncancel=()=>{try{m.abort()}catch(y){console.error(y)}},m.begin()}return f("button",{class:"apple-pay-button",style:{"-apple-pay-button-type":n},onClick:h})},lr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAeEAAABLCAMAAABwZM8AAAADAFBMVEUAAAD////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////9/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f3+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7LtSl7AAAA/3RSTlMAAQIDBAUGBwgJCgsMDQ4PEBESExQVFhcYGRobHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2Nz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LrRRhwsGsUCwJqVViVO85pDOXlFai82v6VfSTFOhmCKmK01UJ0YWnlH1Zv+4/YuSQXnbpiZKPUKGW3gg9RDnjkEpppXiSv7fgGx7L+67vz/9CotKWr7y1xuZCsEFMMrzeSixvg0YVHxiUd3Mp3y8Y0NF+qP6PncqDxo+tn7WyuoQrEKzBKspWqqg0RLdf+bSlSnAlIqoz8mle1UhXICTG20D7q3VVP6sC4ZRKLKsu4QqEQN+j5qgUjK1uwxUIbe8G9mlzleBKhLBqcZ++XDXSFQiFSyiwl7VU/awKRHRNjkdLqku4AiEx6E0qhNqyjpHVbbgCodFoE8NPQKGKSoOA2kGncm+hnb5QZbgiUWNkZyOHVb2sKqr4QEIadOJl/R9/eIVAmWuIbgAAAABJRU5ErkJggg==",cr=()=>{const{payment_button_type:e,samsung_pay:t,payment_options:n,supported_networks:r,currency:o,decimalAmount:a,setFormSettings:i}=L(j),[s,u]=N(!1),[l,d]=N(!1),{makePayment:c}=ge({defaultError:{}}),{t:h}=q(),p=$(null);Z(()=>{let m=null;return s||(m=setInterval(()=>{window.SamsungPay&&u(!0)},100)),()=>{clearInterval(m)}},[s]);const _=ce(()=>{if(!(!s||!t))return new SamsungPay.PaymentClient({environment:t.environment})},[s]);if(Z(()=>X(this,null,function*(){if(!_||!t)return;const m=r==null?void 0:r.filter(v=>v!=="mada").map(v=>v.toLowerCase()),y={version:t.version.toString(),serviceId:t.service_id,protocol:"PROTOCOL_3DS",allowedBrands:m};p.current=()=>X(this,null,function*(){const{order_number:v,id:w,country:k,label:x}=t,P=x||(n==null?void 0:n.label),T=k||(n==null?void 0:n.country),D={orderNumber:v,merchant:{name:P,id:w,countryCode:T,url:window.location.hostname},amount:{option:"FORMAT_TOTAL_ESTIMATED_AMOUNT",currency:o,total:a}},B=()=>{_.notify({status:"CHARGED",provider:"Moyasar"})},A=C=>{var te;_.notify({status:"REJECTED",provider:"Moyasar"});let z="Payment failed.";C instanceof Payment&&C.isFailed()?z+=" Error: "+((te=C.source)==null?void 0:te.message):C instanceof Response?z+=" Error: "+C.statusText:typeof C=="string"&&(z+=" Error: "+C)};try{const C=yield _.loadPaymentSheet(y,D);c({initPayment:!0,data:{source:{type:"samsungpay",token:C["3DS"].data}},onFailed:A,onSuccess:B})}catch(C){try{_.notify({status:"ERRED",provider:"Moyasar"})}catch(z){}console.log("Samsung Pay error: ",C)}});try{(yield _.isReadyToPay(y)).result?d(!0):i(w=>R(S({},w),{apiError:"Cannot initialize Samsung Pay"}))}catch(v){try{_.notify({status:"ERRED",provider:"Moyasar"})}catch(w){}i(w=>R(S({},w),{apiError:"Cannot initialize Samsung Pay"})),console.error("Samsung Pay Error: ",v)}}),[_,t]),!s||!l)return null;const b=e==="pay"?"pay-with":e;return f("button",{class:"flex h-11 w-full items-center justify-center gap-1 rounded-md bg-black text-white",onClick:p.current,children:[f("span",{children:h(`button.${b}`)}),f("img",{src:lr,alt:"",class:"-mb-[3px] h-[22px]"}),f("div",{class:"mb-0.5 h-[9px] w-[9px] rotate-45 rounded-sm border-r-[3px] border-t-[3px] border-white"})]})},ur=()=>{const{language:e,payment_button_type:t,google_pay:n,payment_options:r,supported_networks:o,currency:a,decimalAmount:i,setFormSettings:s}=L(j),[u,l]=N(!1),{makePayment:d}=ge({defaultError:{}});Z(()=>{let h=null;return u||(h=setInterval(()=>{var p,_;(_=(p=window.google)==null?void 0:p.payments)!=null&&_.api&&l(!0)},100)),()=>{clearInterval(h)}},[u]);const c=ce(()=>{if(u)return new google.payments.api.PaymentsClient({environment:n.environment})},[u]);return Z(()=>X(this,null,function*(){const h=document.getElementById("googlePay-container");if(!c||!n||(h==null?void 0:h.children.length)>=1)return;n.merchant_id;const p=o==null?void 0:o.filter(P=>P!=="mada").map(P=>P.toUpperCase()),_=n.auth_methods,b={apiVersion:2,apiVersionMinor:0},m={type:"CARD",parameters:{allowedAuthMethods:_,allowedCardNetworks:p}},y=Object.assign({},b);y.allowedPaymentMethods=[m];const v=()=>X(this,null,function*(){const{country:P,label:T,merchant_id:D}=n,B=T||(r==null?void 0:r.label),A=P||(r==null?void 0:r.country),C=R(S({},b),{allowedPaymentMethods:[x],merchantInfo:{merchantId:D,merchantName:B},transactionInfo:{countryCode:A,currencyCode:a,totalPriceStatus:"FINAL",totalPrice:i}});try{const z=yield c.loadPaymentData(C);d({initPayment:!0,data:{source:{type:"googlepay",token:z.paymentMethodData.tokenizationData.token}}})}catch(z){console.error(z)}}),w=()=>{const P=c.createButton({onClick:v,buttonLocale:e,buttonColor:"black",buttonType:t,buttonRadius:6,buttonSizeMode:"fill"});h.appendChild(P)},k={type:"PAYMENT_GATEWAY",parameters:{gateway:"moyasar",gatewayMerchantId:n.gateway_merchant_id}},x=Object.assign({},m,{tokenizationSpecification:k});try{(yield c.isReadyToPay(y)).result?w():s(T=>R(S({},T),{apiError:"Cannot initialize Google Pay"}))}catch(P){s(T=>R(S({},T),{apiError:"Cannot initialize Google Pay"})),console.error("Google Pay Error: ",P)}}),[c,n]),u?f("div",{id:"googlePay-container",class:"flex h-11 items-center justify-center rounded-md bg-black empty:hidden"}):null},dr=()=>{const{t:e}=q(),{methods:t,apple_pay:n,samsung_pay:r,google_pay:o}=L(j),a=t.includes("stcpay"),i=t.includes("creditcard"),s=location.protocol==="https:"&&t.includes("applepay")&&typeof window.ApplePaySession!="undefined"&&ApplePaySession.canMakePayments()&&(n==null?void 0:n.version)&&ApplePaySession.supportsVersion(n==null?void 0:n.version),u=!!(r!=null&&r.service_id),l=!!(o!=null&&o.merchant_id);return!s&&!a&&!u&&!l?null:f("div",{class:"flex w-full flex-col gap-4",role:"main",children:[a&&f(ir,{}),s&&f(sr,{}),u&&f(cr,{}),l&&f(ur,{}),i&&f("p",{class:"flex items-center gap-4",children:[f("hr",{class:"grow bg-neutral-300"}),f("span",{class:"text-neutral-800/90",children:e("form.or_pay_with_card")}),f("hr",{class:"grow bg-neutral-300"})]})]})},rt=["mada","visa","amex","masterCard"],ot=["creditcard","applepay","stcpay","samsungpay"],at=["supports3DS","supportsCredit","supportsDebit","supportsEMV"],pr=["pay","buy","plain","book","check-out","subscribe","add-money","contribute","order","reload","rent","support","tip","top-up","continue"],en={ADP:0,AFN:0,ALL:0,AMD:0,BHD:3,BIF:0,BYN:2,BYR:0,CAD:2,CHF:2,CLF:4,CLP:0,COP:0,CRC:0,CZK:0,default:2,DJF:0,DKK:2,ESP:0,GNF:0,GYD:0,HUF:0,IDR:0,IQD:0,IRR:0,ISK:0,ITL:0,JOD:3,JPY:0,KMF:0,KPW:0,KRW:0,KWD:3,LAK:0,LBP:2,LUF:0,LYD:3,MGA:0,MGF:0,MMK:0,MNT:0,MRO:0,MUR:0,NOK:0,OMR:3,PKR:0,PYG:0,RSD:0,RWF:0,SEK:0,SLL:0,SOS:0,STD:0,SYP:0,TMM:0,TND:3,TRL:0,TWD:0,TZS:0,UGX:0,UYI:0,UYW:4,UZS:0,VEF:0,VND:0,VUV:0,XAF:0,XOF:0,XPF:0,YER:0,ZMK:0,ZWD:0},fr=["22337902","22337986","22402030","40177800","403024","40545400","406136","406996","40719700","40728100","40739500","407520","409201","410621","410685","410834","412565","417633","419593","420132","421141","42222200","422817","422818","422819","428331","428671","428672","428673","431361","432328","434107","439954","440533","440647","440795","442429","442463","445564","446393","446404","446672","45488707","45501701","455036","455708","457865","457997","458456","462220","468540","468541","468542","468543","474491","483010","483011","483012","484783","486094","486095","486096","489318","489319","49098000","49098001","492464","504300","513213","515079","516138","520058","521076","52166100","524130","524514","524940","529415","529741","530060","531196","535825","535989","536023","537767","53973776","543085","543357","549760","554180","555610","558563","588845","588848","588850","604906","636120","968201","968202","968203","968204","968205","968206","968207","968208","968209","968211","968212"],tn=e=>{const t=!e,n=/^[a-zA-Z\-\s]+$/.test(e),r=/^[a-zA-Z-]+\s+?([a-zA-Z-]+\s?)+$/.test(e);return{isEmpty:t,isEnglishOnly:n,isValidFormat:r,isValid:!t&&n&&r}},mr=({value:e,setValue:t,err:n,setErr:r})=>{const{t:o}=q(),[a,i]=N(!1),s=d=>{const c=d.target.value.trim(),{isEmpty:h,isEnglishOnly:p,isValidFormat:_}=tn(c);if(h){i(!c);return}if(!p){r(b=>R(S({},b),{name:"validation.should_be_english_letters_only"}));return}if(!_){r(b=>R(S({},b),{name:"validation.first_and_last_name_required"}));return}i(!1),r(b=>R(S({},b),{name:""}))},u=d=>{const c=d.target,{value:h}=c;t(h)},l=fe(s,1e3);return f("div",{class:"space-y-2",role:"complementary","aria-label":o("form.name_on_card"),children:[f("div",{class:"flex items-end justify-between text-xs font-medium",children:[f("label",{for:"mysr-cc-name",children:o("form.name_on_card")}),a&&f("span",{class:"uppercase text-error",children:o("form.required")})]}),f(pe,{name:"mysr-cc-name",placeholder:o("form.name_on_card"),onBlur:s,class:n.name?"shadow-input-error":"",autocomplete:"cc-name",dir:"ltr",value:e,onKeyUp:d=>{u(d),l(d)},onChange:u}),n.name&&f("p",{class:"text-xs font-medium text-error",children:o(n.name)})]})},nn=(e,t)=>{const n=t==="amex"?/^\d{4}$/.test(e):/^\d{3}$/.test(e);return{isValid:n,msg:n?"":"error.invalid_csc"}},Ne=Xe({}),hr=({setValue:e})=>{const{t}=q(),{handleBlur:n,err:r}=L(Ne),o="** / **",a=s=>{const u=s.target,{value:l}=u;e(l)},i=fe(n,1e3);return Z(()=>{new Ie('[name="mysr-cc-exp"]')},[]),f(pe,{"aria-label":t("form.date"),name:"mysr-cc-exp",onBlur:n,class:"rounded-none rounded-bl-lg",placeholder:"MM / YY",autocomplete:"cc-exp",inputMode:"numeric",maxLength:o.length,"data-maska":o,"data-maska-eager":!0,onKeyUp:s=>{a(s),i(s)},error:r.exp})},_r=({value:e,setValue:t})=>{const{t:n}=q(),{handleBlur:r,err:o,config:a}=L(Ne),i=u=>{const l=u.target,{value:d}=l;t(d)},s=fe(r,1e3);return f(pe,{"aria-label":n("form.csc"),name:"mysr-cc-csc",onBlur:r,class:"rounded-none rounded-br-lg",placeholder:"CVC",autocomplete:"cc-csc",inputMode:"numeric",maxLength:a.csc,value:e,onKeyUp:u=>{i(u),s(u)},error:o.csc})},yr=e=>/^4/.test(H(e)),vr=e=>/^(?:5[1-5][0-9]{2}|222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)/.test(H(e)),rn=e=>/^3[47]/.test(H(e)),on=e=>{const t=H(e),n=t.slice(0,6),r=t.slice(0,8);for(const o of fr)if(o==n||o==r)return!0;return!1},it=()=>{const{supported_networks:e}=L(j);function t(n){let r="";return yr(n)&&(r="visa"),vr(n)&&(r="masterCard"),rn(n)&&(r="amex"),on(n)&&(r="mada"),r===""||!e.includes(r)?"":r}return{getCardSchema:t}},gr=({value:e,setValue:t})=>{const{t:n}=q(),{handleBlur:r,err:o,setType:a}=L(Ne),{getCardSchema:i}=it(),s=l=>{const d=l.target,{value:c}=d;t(c),a(i(c))},u=fe(r,1e3);return Z(()=>{new Ie('[name="mysr-cc-number"]',{mask:l=>rn(l)?"#### ###### #####":"#### #### #### ####"})},[]),f(pe,{"aria-label":n("form.cc"),name:"mysr-cc-number",placeholder:"1234 5678 9101 1121",onBlur:r,class:"col-span-full rounded-b-none",autocomplete:"cc-number",inputMode:"numeric",value:e,onKeyUp:l=>{s(l),u(l)},onChange:s,error:o.cc})},br="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20width='100%25'%20height='100%25'%20viewBox='0%200%2096%2064'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20xml:space='preserve'%20xmlns:serif='http://www.serif.com/'%20style='fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;'%3e%3cpath%20d='M95,6.894c0,-3.253%20-2.641,-5.894%20-5.894,-5.894l-82.212,0c-3.253,0%20-5.894,2.641%20-5.894,5.894l0,50.212c0,3.253%202.641,5.894%205.894,5.894l82.212,0c3.253,0%205.894,-2.641%205.894,-5.894l0,-50.212Z'%20style='fill:%23fff;stroke:%237e7e7e;stroke-width:0.5px;'/%3e%3cclipPath%20id='_clip1'%3e%3crect%20x='7.179'%20y='18.832'%20width='81.642'%20height='26.336'/%3e%3c/clipPath%3e%3cg%20clip-path='url(%23_clip1)'%3e%3cg%3e%3cpath%20d='M47.418,19.387l-5.431,25.384l-6.567,0l5.432,-25.384l6.566,0Zm27.627,16.39l3.457,-9.532l1.989,9.532l-5.446,0Zm7.326,8.994l6.074,0l-5.3,-25.384l-5.607,0c-1.259,0%20-2.323,0.733%20-2.795,1.863l-9.852,23.521l6.895,0l1.37,-3.79l8.424,-0l0.791,3.79Zm-17.137,-8.287c0.028,-6.701%20-9.267,-7.069%20-9.201,-10.062c0.019,-0.912%200.887,-1.879%202.784,-2.127c0.943,-0.123%203.534,-0.218%206.476,1.136l1.152,-5.383c-1.58,-0.574%20-3.614,-1.125%20-6.143,-1.125c-6.49,-0%20-11.059,3.451%20-11.097,8.391c-0.041,3.655%203.261,5.693%205.75,6.908c2.557,1.245%203.417,2.041%203.406,3.154c-0.017,1.704%20-2.041,2.455%20-3.929,2.485c-3.302,0.052%20-5.218,-0.892%20-6.745,-1.603l-1.19,5.562c1.534,0.705%204.365,1.317%207.303,1.348c6.898,0%2011.411,-3.408%2011.434,-8.684Zm-27.2,-17.097l-10.639,25.384l-6.942,0l-5.235,-20.258c-0.318,-1.248%20-0.595,-1.705%20-1.562,-2.23c-1.576,-0.857%20-4.183,-1.66%20-6.477,-2.158l0.157,-0.738l11.173,0c1.423,0%202.705,0.948%203.028,2.588l2.765,14.69l6.833,-17.278l6.899,0Z'%20style='fill:%230d357f;fill-rule:nonzero;'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",wr="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20width='100%25'%20height='100%25'%20viewBox='0%200%2096%2064'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20xml:space='preserve'%20xmlns:serif='http://www.serif.com/'%20style='fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;'%3e%3cpath%20d='M95,7.094c0,-3.363%20-2.731,-6.094%20-6.094,-6.094l-81.812,0c-3.363,0%20-6.094,2.731%20-6.094,6.094l-0,49.812c-0,3.363%202.731,6.094%206.094,6.094l81.812,0c3.363,0%206.094,-2.731%206.094,-6.094l0,-49.812Z'%20style='fill:%23fff;stroke:%23b1b1b1;stroke-width:0.5px;'/%3e%3cpath%20d='M95,6.894c0,-3.253%20-2.641,-5.894%20-5.894,-5.894l-82.212,0c-3.253,0%20-5.894,2.641%20-5.894,5.894l0,50.212c0,3.253%202.641,5.894%205.894,5.894l82.212,0c3.253,0%205.894,-2.641%205.894,-5.894l0,-50.212Z'%20style='fill:%23fff;stroke:%237e7e7e;stroke-width:0.5px;'/%3e%3cg%20opacity='0'%3e%3crect%20x='14.04'%20y='9.539'%20width='67.919'%20height='44.921'%20style='fill:%23fff;'/%3e%3c/g%3e%3crect%20x='39.044'%20y='17.366'%20width='17.917'%20height='29.263'%20style='fill:%23ff5f00;'/%3e%3cpath%20d='M40.89,32c-0.005,-5.706%202.619,-11.106%207.107,-14.629c-3.278,-2.576%20-7.329,-3.978%20-11.498,-3.978c-10.209,0%20-18.61,8.401%20-18.61,18.61c0,10.208%208.401,18.609%2018.61,18.609c4.169,-0%208.22,-1.401%2011.498,-3.978c-4.489,-3.524%20-7.113,-8.927%20-7.107,-14.634Z'%20style='fill:%23eb001b;fill-rule:nonzero;'/%3e%3cpath%20d='M76.33,43.533l0,-0.6l0.259,0l-0,-0.124l-0.615,-0l-0,0.124l0.242,0l0,0.6l0.114,-0Zm1.194,-0l0,-0.724l-0.186,-0l-0.217,0.517l-0.217,-0.517l-0.186,-0l-0,0.724l0.134,-0l0,-0.548l0.202,0.47l0.139,0l0.202,-0.47l0,0.548l0.129,-0Z'%20style='fill:%23f79e1b;fill-rule:nonzero;'/%3e%3cpath%20d='M78.108,32c0,10.209%20-8.4,18.609%20-18.609,18.609c-4.171,-0%20-8.223,-1.402%20-11.502,-3.98c4.487,-3.526%207.111,-8.926%207.111,-14.632c-0,-5.705%20-2.624,-11.106%20-7.111,-14.631c3.279,-2.578%207.331,-3.98%2011.502,-3.98c10.209,-0%2018.609,8.4%2018.609,18.609l0,0.005Z'%20style='fill:%23f79e1b;fill-rule:nonzero;'/%3e%3c/svg%3e",kr="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20width='100%25'%20height='100%25'%20viewBox='0%200%2096%2064'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20xml:space='preserve'%20xmlns:serif='http://www.serif.com/'%20style='fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;'%3e%3cpath%20d='M95,7.053c0,-3.341%20-2.712,-6.053%20-6.053,-6.053l-81.894,-0c-3.341,-0%20-6.053,2.712%20-6.053,6.053l0,49.894c0,3.341%202.712,6.053%206.053,6.053l81.894,0c3.341,0%206.053,-2.712%206.053,-6.053l0,-49.894Z'%20style='fill:%23006fcf;stroke:%237e7e7e;stroke-width:0.5px;'/%3e%3cg%3e%3cpath%20d='M54.459,9.71l-10.404,23.609l8.342,0l0,21.172l26.31,0l4.061,-4.51l4.063,4.534l7.933,0l0,-2.672l-6.538,0l-5.395,-5.867l-5.44,5.88l-22.088,0l0,-18.444l22.202,0l5.408,5.938l5.476,-5.963l6.352,-0l0,-2.626l-4.935,-0l-0,-12.769l-4.686,12.699l-4.45,0l-4.823,-12.608l0,12.647l-10.546,0l-1.49,-3.637l-8.559,0l-1.457,3.589l-5.544,0l8.116,-18.39l6.498,-0l8.058,18.438l-0,-18.443l7.875,-0l4.161,11.351l4.127,-11.364l7.714,0.003l0,-2.656l-9.767,-0l-2.048,5.839l-2.2,-5.8l-12.552,-0l-0.077,7.83l-3.474,-7.76l-10.223,-0.02Z'%20style='fill:%23fff;'/%3e%3cpath%20d='M59.526,16.941l-2.53,5.961l5.011,0l-2.481,-5.961Z'%20style='fill:%23fff;'/%3e%3cpath%20d='M60.312,37.605l10.641,-0l0,-4.147l8.738,9.184l-8.621,9.204l-0.101,0l0,-4.221l-10.669,-0l-0,-2.905l10.397,0l-0,-4.077l-10.397,0l0.012,-3.038Z'%20style='fill:%23fff;'/%3e%3cpath%20d='M94.723,47.865l0,3.969l-8.581,-9.23l8.59,-9.225l-0,3.95l-4.946,5.265l4.937,5.271Z'%20style='fill:%23fff;'/%3e%3c/g%3e%3c/svg%3e",xr="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20width='100%25'%20height='100%25'%20viewBox='0%200%2096%2064'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20xml:space='preserve'%20xmlns:serif='http://www.serif.com/'%20style='fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;'%3e%3cpath%20d='M95,6.894c0,-3.253%20-2.641,-5.894%20-5.894,-5.894l-82.212,0c-3.253,0%20-5.894,2.641%20-5.894,5.894l0,50.212c0,3.253%202.641,5.894%205.894,5.894l82.212,0c3.253,0%205.894,-2.641%205.894,-5.894l0,-50.212Z'%20style='fill:%23fff;stroke:%237e7e7e;stroke-width:0.5px;'/%3e%3cg%3e%3crect%20x='5.311'%20y='34.182'%20width='36.116'%20height='12.031'%20style='fill:%2384b740;'/%3e%3crect%20x='5.311'%20y='17.765'%20width='36.116'%20height='12.042'%20style='fill:%23259bd6;'/%3e%3cpath%20d='M77.542,43.769l-0.161,0.032c-0.557,0.107%20-0.761,0.15%20-1.168,0.15c-0.944,-0%20-2.059,-0.483%20-2.059,-2.756c-0,-1.169%200.193,-2.724%201.951,-2.724l0.011,0c0.3,0.022%200.644,0.054%201.287,0.247l0.139,0.043l0,5.008Zm0.29,-11.335l-0.29,0.054l0,4.203l-0.257,-0.075l-0.075,-0.021c-0.29,-0.086%20-0.954,-0.279%20-1.598,-0.279c-3.517,0%20-4.257,2.659%20-4.257,4.89c0,3.056%201.716,4.815%204.708,4.815c1.265,-0%202.198,-0.129%203.141,-0.44c0.869,-0.279%201.18,-0.676%201.18,-1.523l-0,-12.063c-0.836,0.15%20-1.705,0.3%20-2.552,0.439'%20style='fill:%2327292d;fill-rule:nonzero;'/%3e%3cpath%20d='M87.997,43.844l-0.15,0.043l-0.536,0.139c-0.504,0.129%20-0.954,0.204%20-1.297,0.204c-0.826,-0%20-1.319,-0.408%20-1.319,-1.105c-0,-0.45%200.203,-1.211%201.555,-1.211l1.747,-0l0,1.93Zm-1.233,-7.582c-1.083,0%20-2.198,0.193%20-3.581,0.622l-0.901,0.268l0.3,2.038l0.88,-0.29c0.922,-0.3%202.069,-0.493%202.927,-0.493c0.386,0%201.566,0%201.566,1.276l-0,0.558l-1.641,-0c-2.992,-0%20-4.375,0.954%20-4.375,3.002c-0,1.748%201.276,2.799%203.421,2.799c0.664,-0%201.587,-0.129%202.38,-0.322l0.043,-0.01l0.043,0.01l0.268,0.043c0.836,0.15%201.705,0.3%202.552,0.461l0,-6.691c0,-2.166%20-1.308,-3.271%20-3.882,-3.271'%20style='fill:%2327292d;fill-rule:nonzero;'/%3e%3cpath%20d='M67.162,43.844l-0.15,0.043l-0.536,0.139c-0.504,0.129%20-0.944,0.204%20-1.297,0.204c-0.826,-0%20-1.319,-0.408%20-1.319,-1.105c-0,-0.45%200.203,-1.211%201.544,-1.211l1.748,-0l0.01,1.93Zm-1.222,-7.582c-1.094,0%20-2.198,0.193%20-3.582,0.622l-0.9,0.268l0.3,2.038l0.879,-0.29c0.922,-0.3%202.07,-0.493%202.928,-0.493c0.386,0%201.565,0%201.565,1.276l0,0.558l-1.641,-0c-2.991,-0%20-4.385,0.954%20-4.385,3.002c-0,1.748%201.276,2.799%203.431,2.799c0.665,-0%201.587,-0.129%202.381,-0.322l0.043,-0.01l0.042,0.01l0.258,0.043c0.847,0.15%201.705,0.3%202.552,0.472l-0,-6.691c0.011,-2.188%20-1.298,-3.282%20-3.871,-3.282'%20style='fill:%2327292d;fill-rule:nonzero;'/%3e%3cpath%20d='M55.871,36.284c-1.362,-0%20-2.488,0.45%20-2.906,0.643l-0.107,0.054l-0.097,-0.075c-0.579,-0.418%20-1.426,-0.633%20-2.606,-0.633c-1.04,0%20-2.016,0.15%20-3.077,0.461c-0.912,0.279%20-1.266,0.719%20-1.266,1.544l0,7.646l2.853,0l-0,-7.067l0.139,-0.042c0.579,-0.193%200.922,-0.226%201.255,-0.226c0.826,0%201.244,0.44%201.244,1.298l-0,6.048l2.809,-0l0,-6.166c0,-0.365%20-0.075,-0.579%20-0.086,-0.622l-0.096,-0.182l0.193,-0.086c0.429,-0.193%200.901,-0.29%201.394,-0.29c0.568,0%201.244,0.226%201.244,1.298l-0,6.048l2.799,-0l-0,-6.327c-0,-2.241%20-1.201,-3.324%20-3.689,-3.324'%20style='fill:%2327292d;fill-rule:nonzero;'/%3e%3cpath%20d='M85.896,25.614c-0.419,0%20-1.116,-0.043%20-1.662,-0.15l-0.161,-0.032l-0,-4.128c-0,-0.344%20-0.065,-0.558%20-0.075,-0.59l-0.086,-0.172l0.182,-0.075c0.043,-0.021%200.086,-0.032%200.14,-0.053l0.032,-0.022c0.064,-0.021%200.128,-0.043%200.193,-0.064c0.032,-0.011%200.053,-0.022%200.075,-0.022c0.633,-0.171%201.212,-0.15%201.469,-0.171l0.011,-0c1.748,-0%201.951,1.555%201.951,2.723c-0.01,2.274%20-1.136,2.756%20-2.069,2.756m-0.011,-7.849l-0.075,-0c-1.641,-0%20-3.324,0.45%20-3.925,1.33c-0.321,0.429%20-0.504,0.965%20-0.514,1.597l-0,4.258c-0,0.364%20-0.076,0.504%20-0.086,0.536l-0.097,0.182l-5.179,-0l-0,-2.96l-0.011,0c-0.064,-3.12%20-1.909,-4.836%20-4.579,-4.836l-2.605,0c-0.108,0.762%20-0.193,1.298%20-0.301,2.059l2.595,0c1.362,0%202.081,1.158%202.081,2.938l-0,2.981l-0.183,-0.096c-0.032,-0.011%20-0.257,-0.086%20-0.611,-0.086l-4.482,-0c-0.086,0.568%20-0.193,1.308%20-0.311,2.048l13.779,0c0.472,-0.096%201.019,-0.182%201.491,-0.257c0.697,0.343%201.994,0.525%202.884,0.525c2.992,0%204.933,-2.005%204.933,-5.093c-0.011,-3.056%20-1.887,-5.062%20-4.804,-5.126'%20style='fill:%2327292d;fill-rule:nonzero;'/%3e%3cpath%20d='M57.78,28.971l4.074,-0c2.992,-0%204.386,-0.987%204.386,-3.421c0,-1.748%20-1.276,-3.142%20-3.421,-3.142l-2.755,0c-0.826,0%20-1.319,-0.472%20-1.319,-1.265c-0,-0.536%200.203,-1.201%201.554,-1.201l6.027,-0c0.129,-0.783%200.193,-1.276%200.311,-2.059l-6.262,-0c-2.917,-0%20-4.386,1.222%20-4.386,3.26c-0,2.016%201.276,3.067%203.42,3.067l2.756,-0c0.826,-0%201.319,0.654%201.319,1.34c0,0.45%20-0.203,1.383%20-1.544,1.383l-0.461,0l-8.825,-0.021l-1.609,-0c-1.361,-0%20-2.316,-0.772%20-2.316,-2.563l0,-1.233c0,-1.866%200.74,-3.024%202.316,-3.024l2.617,-0c0.118,-0.794%200.193,-1.298%200.3,-2.048l-3.571,-0c-2.67,-0%20-4.514,1.791%20-4.579,4.911l0,1.394c0.065,3.12%201.909,4.611%204.579,4.611l2.606,-0l4.783,0.011Z'%20style='fill:%2327292d;fill-rule:nonzero;'/%3e%3c/g%3e%3c/svg%3e",Pr=({type:e})=>{const t="h-4 sm:h-5 w-auto object-contain object-center";return f("div",{class:"absolute right-2 top-1/4 z-[2] flex -translate-y-1/2 items-center gap-1",children:[{alt:"AMEX",src:kr},{alt:"MADA",src:xr},{alt:"Visa",src:br},{alt:"MasterCard",src:wr}].filter(r=>e!==""?e.toLowerCase()===r.alt.toLowerCase():!0).map(r=>f("img",{class:t,alt:r.alt,src:r.src,loading:"lazy"}))})},an=e=>{const t="#### #### #### ####",n={mask:t,validator:o=>/^(?:5[1-5][0-9]{2}|222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}$/.test(H(o)),csc:3},r={amex:{mask:"#### ###### #####",validator:o=>/^3[47][0-9]{13}$/.test(H(o)),csc:4},mada:{mask:t,validator:o=>on(o)&&/\d{16}/.test(H(o)),csc:3},visa:{mask:t,validator:o=>/^4[0-9]{12}(?:[0-9]{3})?$/.test(H(o)),csc:3},mastercard:n,masterCard:n};return e===""?r.visa:r[e]},sn=e=>{const[t,n]=e.split("/"),r=parseInt(t.trim()),o=r>=1&&r<=12,a=parseInt(n==null?void 0:n.trim()),i=Number.isNaN(a)||a<+new Date().getFullYear().toString().slice(-2)||a>99,s=/^\d{2} ?\/ ?\d{2}$/.test(e);return{isValidExpFormat:s,isValidYear:!i,inValidMonth:o,isValid:s&&!i&&o}},Er=e=>{const t=[0,2,4,6,8,1,3,5,7,9];if(typeof e!="string")throw new TypeError("Expected string input");if(!e)return!1;let n=e.length,r=!0,o=0;for(;n;){const a=e.charCodeAt(--n)-48;if(a<0||a>9)return!1;r=!r,o+=r?t[a]:a}return o%10===0},ln=()=>{const{getCardSchema:e}=it();function t(n,r){const o=r||e(n);if(!o&&n.length>3)return!1;const{validator:a}=an(o),i=a(n),s=Er(n);return i&&s}return{isValidCc:t}},Sr=({cc:e,setCc:t,cvc:n,setCvc:r,exp:o,setExp:a,err:i,setErr:s})=>{const{t:u}=q(),[l,d]=N(!1),[c,h]=N(""),{isValidCc:p}=ln(),_=Mt(()=>an(c),[c]),b=m=>{const{value:y,name:v}=m.target,w=H(y.trim());if(!w){d(!w);return}if(v==="mysr-cc-csc"){const{msg:k}=nn(w,c);s(x=>R(S({},x),{csc:k}))}if(v==="mysr-cc-exp"){const{isValidExpFormat:k,isValidYear:x,inValidMonth:P}=sn(w);s(T=>R(S({},T),{exp_month:P?"":"error.invalid_month",exp_year:x?"":"error.invalid_year",exp:k?"":"error.invalid_date"}))}v==="mysr-cc-number"&&s(k=>R(S({},k),{cc:c===""?"error.unsupported_cc_type":p(w)?"":"error.invalid_cc_number"}))};return Z(()=>{Object.values(i).filter(m=>m).length===0&&d(!1)},[i]),f(Ne.Provider,{value:{err:i,setErr:s,handleBlur:b,type:c,setType:h,config:_()},children:f("div",{class:"space-y-2",role:"complementary","aria-label":u("form.card_info"),children:[f("div",{class:"flex items-end justify-between text-xs font-medium",children:[f("legend",{children:u("form.card_info")}),l&&f("span",{class:"uppercase text-error",children:u("form.required")})]}),f("div",{class:"relative grid grid-cols-2 gap-y-[1px]",dir:"ltr",children:[f(gr,{value:e,setValue:t}),f(Pr,{type:c}),f(hr,{value:o,setValue:a}),f(_r,{value:n,setValue:r})]}),f("p",{class:"flex flex-col gap-2 text-xs font-medium text-error",children:Object.entries(i).filter(([m])=>m!=="name").map(([m,y])=>f("span",{class:"empty:hidden",children:u(y)},m))})]})})},Cr=()=>{const{t:e}=q(),{formattedAmount:t,isRtl:n,credit_card:r,statement_descriptor:o,callback_url:a,payment_button_type:i}=L(j),[s,u]=N(""),[l,d]=N(""),[c,h]=N(""),[p,_]=N(""),{getCardSchema:b}=it(),{isValidCc:m}=ln(),y={name:"",csc:"",cc:"",exp:"",exp_month:"",exp_year:""},{makePayment:v,busy:w,fail:k,success:x,loading:P,error:T,setError:D}=ge({defaultError:y});return f("form",{class:"space-y-6",onSubmit:C=>{C.preventDefault();const{isValid:z}=tn(s),te=H(l),Be=H(p),ze=H(c),we=b(te),me=m(te,we),{isValid:ke}=nn(ze,we),{isValid:je}=sn(Be);if(!z||!me||!ke||!je){const W=S({},y);z||(W.name=e("error.invalid_name")),me||(W.cc=e("error.invalid_cc_number")),ke||(W.csc=e("error.invalid_csc")),je||(W.exp=e("error.invalid_date")),D(W);return}const[dt,G]=Be.split("/"),O={type:"creditcard",name:s,number:te,month:dt,year:G,cvc:ze};r!=null&&r.manual&&(O.manual=!0),r!=null&&r.save_card&&(O.save_card=!0),o&&(O.statement_descriptor=o);function Y(W){const{transaction_url:io}=W.source;window.location.href=io}function ae(W){console.error(W)}v({data:{callback_url:a,source:O},initPayment:!0,onFailed:ae,onSuccess:Y}).catch(W=>{console.error(W)})},children:[f(mr,{value:s,setValue:u,err:T,setErr:D}),f(Sr,{cc:l,setCc:d,cvc:c,setCvc:h,exp:p,setExp:_,err:T,setErr:D}),f(et,{type:"submit",disabled:P,success:x,fail:k,busy:w,children:[(i!=="plain"||!n)&&e(`button.${i}`)," ",t]}),(r==null?void 0:r.save_card)&&f("p",{class:"flex items-center justify-center gap-2 text-xs text-primary-400",role:"complementary","aria-label":e("form.save_card_notice"),children:[f("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",class:"h-4 w-4 shrink-0",fill:"currentColor",children:f("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z","clip-rule":"evenodd"})}),e("form.save_card_notice")]})]})};var st=function(e,t){return st=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[o]=r[o])},st(e,t)};function Ar(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");st(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var ee=function(){return ee=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},ee.apply(this,arguments)};function Fe(e,t,n,r){function o(a){return a instanceof n?a:new n(function(i){i(a)})}return new(n||(n=Promise))(function(a,i){function s(d){try{l(r.next(d))}catch(c){i(c)}}function u(d){try{l(r.throw(d))}catch(c){i(c)}}function l(d){d.done?a(d.value):o(d.value).then(s,u)}l((r=r.apply(e,t||[])).next())})}function be(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,o,a,i;return i={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(l){return function(d){return u([l,d])}}function u(l){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(n=0)),n;)try{if(r=1,o&&(a=l[0]&2?o.return:l[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,l[1])).done)return a;switch(o=0,a&&(l=[l[0]&2,a.value]),l[0]){case 0:case 1:a=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,o=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){n.label=l[1];break}if(l[0]===6&&n.label<a[1]){n.label=a[1],a=l;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(l);break}a[2]&&n.ops.pop(),n.trys.pop();continue}l=t.call(e,n)}catch(d){l=[6,d],o=0}finally{r=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function Tr(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ue(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,a=[],i;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)a.push(o.value)}catch(s){i={error:s}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return a}function Le(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,a;r<o;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;function cn(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===0?function(n){return n}:e.length===1?e[0]:e.reduce(function(n,r){return function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];return n(r.apply(void 0,Le([],Ue(o),!1)))}})}function Dr(e){if(e)return Object.keys(e).forEach(function(t){typeof e[t]=="object"&&(e[t]=JSON.stringify(e[t])),e[t]=String(e[t])}),e}function un(e){if(e)return Object.keys(e).forEach(function(t){typeof e[t]=="string"||typeof e[t]=="boolean"||typeof e[t]=="number"||(e[t]=JSON.stringify(e[t]))}),e}function Mr(e){return typeof e=="object"&&typeof e.message!="undefined"}function Or(e){if(typeof e.stacktrace!="undefined"||typeof e["opera#sourceloc"]!="undefined"){var t=e.stacktrace,n=t===void 0?"":t;return n.split(`
8
+ (function(M,g){typeof exports=="object"&&typeof module!="undefined"?module.exports=g():typeof define=="function"&&define.amd?define(g):(M=typeof globalThis!="undefined"?globalThis:M||self,M.Moyasar=g())})(this,function(){"use strict";var so=Object.defineProperty,lo=Object.defineProperties;var co=Object.getOwnPropertyDescriptors;var He=Object.getOwnPropertySymbols;var mn=Object.prototype.hasOwnProperty,hn=Object.prototype.propertyIsEnumerable;var _n=Math.pow,fn=(M,g,F)=>g in M?so(M,g,{enumerable:!0,configurable:!0,writable:!0,value:F}):M[g]=F,S=(M,g)=>{for(var F in g||(g={}))mn.call(g,F)&&fn(M,F,g[F]);if(He)for(var F of He(g))hn.call(g,F)&&fn(M,F,g[F]);return M},R=(M,g)=>lo(M,co(g));var Ke=(M,g)=>{var F={};for(var V in M)mn.call(M,V)&&g.indexOf(V)<0&&(F[V]=M[V]);if(M!=null&&He)for(var V of He(M))g.indexOf(V)<0&&hn.call(M,V)&&(F[V]=M[V]);return F};var X=(M,g,F)=>new Promise((V,he)=>{var xe=J=>{try{ie(F.next(J))}catch(se){he(se)}},_e=J=>{try{ie(F.throw(J))}catch(se){he(se)}},ie=J=>J.done?V(J.value):Promise.resolve(J.value).then(xe,_e);ie((F=F.apply(M,g)).next())});var M,g,F,V,he,xe,_e,ie,J,se,pt,ye={},ft=[],yn=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Pe=Array.isArray;function ne(e,t){for(var n in t)e[n]=t[n];return e}function mt(e){var t=e.parentNode;t&&t.removeChild(e)}function Ze(e,t,n){var r,o,a,i={};for(a in t)a=="key"?r=t[a]:a=="ref"?o=t[a]:i[a]=t[a];if(arguments.length>2&&(i.children=arguments.length>3?M.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(a in e.defaultProps)i[a]===void 0&&(i[a]=e.defaultProps[a]);return Ee(e,i,r,o,null)}function Ee(e,t,n,r,o){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:o==null?++F:o,__i:-1,__u:0};return o==null&&g.vnode!=null&&g.vnode(a),a}function re(e){return e.children}function Q(e,t){this.props=e,this.context=t}function le(e,t){if(t==null)return e.__?le(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?le(e):null}function ht(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return ht(e)}}function qe(e){(!e.__d&&(e.__d=!0)&&V.push(e)&&!Se.__r++||he!==g.debounceRendering)&&((he=g.debounceRendering)||xe)(Se)}function Se(){var e,t,n,r,o,a,i,s;for(V.sort(_e);e=V.shift();)e.__d&&(t=V.length,r=void 0,a=(o=(n=e).__v).__e,i=[],s=[],n.__P&&((r=ne({},o)).__v=o.__v+1,g.vnode&&g.vnode(r),Ye(n.__P,r,o,n.__n,n.__P.namespaceURI,32&o.__u?[a]:null,i,a==null?le(o):a,!!(32&o.__u),s),r.__v=o.__v,r.__.__k[r.__i]=r,bt(i,r,s),r.__e!=a&&ht(r)),V.length>t&&V.sort(_e));Se.__r=0}function _t(e,t,n,r,o,a,i,s,u,l,d){var c,h,p,_,b,m=r&&r.__k||ft,y=t.length;for(n.__d=u,vn(n,t,m),u=n.__d,c=0;c<y;c++)(p=n.__k[c])!=null&&typeof p!="boolean"&&typeof p!="function"&&(h=p.__i===-1?ye:m[p.__i]||ye,p.__i=c,Ye(e,p,h,o,a,i,s,u,l,d),_=p.__e,p.ref&&h.ref!=p.ref&&(h.ref&&Je(h.ref,null,p),d.push(p.ref,p.__c||_,p)),b==null&&_!=null&&(b=_),65536&p.__u||h.__k===p.__k?(u&&typeof p.type=="string"&&!e.contains(u)&&(u=le(h)),u=yt(p,u,e)):typeof p.type=="function"&&p.__d!==void 0?u=p.__d:_&&(u=_.nextSibling),p.__d=void 0,p.__u&=-196609);n.__d=u,n.__e=b}function vn(e,t,n){var r,o,a,i,s,u=t.length,l=n.length,d=l,c=0;for(e.__k=[],r=0;r<u;r++)i=r+c,(o=e.__k[r]=(o=t[r])==null||typeof o=="boolean"||typeof o=="function"?null:typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?Ee(null,o,null,null,null):Pe(o)?Ee(re,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?Ee(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o)!=null?(o.__=e,o.__b=e.__b+1,s=gn(o,n,i,d),o.__i=s,a=null,s!==-1&&(d--,(a=n[s])&&(a.__u|=131072)),a==null||a.__v===null?(s==-1&&c--,typeof o.type!="function"&&(o.__u|=65536)):s!==i&&(s==i-1?c=s-i:s==i+1?c++:s>i?d>u-i?c+=s-i:c--:s<i&&c++,s!==r+c&&(o.__u|=65536))):(a=n[i])&&a.key==null&&a.__e&&!(131072&a.__u)&&(a.__e==e.__d&&(e.__d=le(a)),We(a,a,!1),n[i]=null,d--);if(d)for(r=0;r<l;r++)(a=n[r])!=null&&!(131072&a.__u)&&(a.__e==e.__d&&(e.__d=le(a)),We(a,a))}function yt(e,t,n){var r,o;if(typeof e.type=="function"){for(r=e.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=e,t=yt(r[o],t,n));return t}e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType===8);return t}function Ce(e,t){return t=t||[],e==null||typeof e=="boolean"||(Pe(e)?e.some(function(n){Ce(n,t)}):t.push(e)),t}function gn(e,t,n,r){var o=e.key,a=e.type,i=n-1,s=n+1,u=t[n];if(u===null||u&&o==u.key&&a===u.type&&!(131072&u.__u))return n;if(r>(u!=null&&!(131072&u.__u)?1:0))for(;i>=0||s<t.length;){if(i>=0){if((u=t[i])&&!(131072&u.__u)&&o==u.key&&a===u.type)return i;i--}if(s<t.length){if((u=t[s])&&!(131072&u.__u)&&o==u.key&&a===u.type)return s;s++}}return-1}function vt(e,t,n){t[0]==="-"?e.setProperty(t,n==null?"":n):e[t]=n==null?"":typeof n!="number"||yn.test(t)?n:n+"px"}function Ae(e,t,n,r,o){var a;e:if(t==="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||vt(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||vt(e.style,t,n[t])}else if(t[0]==="o"&&t[1]==="n")a=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,"$1")),t=t.toLowerCase()in e||t==="onFocusOut"||t==="onFocusIn"?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+a]=n,n?r?n.u=r.u:(n.u=ie,e.addEventListener(t,a?se:J,a)):e.removeEventListener(t,a?se:J,a);else{if(o=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=n==null?"":n;break e}catch(i){}typeof n=="function"||(n==null||n===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n))}}function gt(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t.t==null)t.t=ie++;else if(t.t<n.u)return;return n(g.event?g.event(t):t)}}}function Ye(e,t,n,r,o,a,i,s,u,l){var d,c,h,p,_,b,m,y,v,w,k,x,P,T,D,z,A=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(u=!!(32&n.__u),a=[s=t.__e=n.__e]),(d=g.__b)&&d(t);e:if(typeof A=="function")try{if(y=t.props,v="prototype"in A&&A.prototype.render,w=(d=A.contextType)&&r[d.__c],k=d?w?w.props.value:d.__:r,n.__c?m=(c=t.__c=n.__c).__=c.__E:(v?t.__c=c=new A(y,k):(t.__c=c=new Q(y,k),c.constructor=A,c.render=wn),w&&w.sub(c),c.props=y,c.state||(c.state={}),c.context=k,c.__n=r,h=c.__d=!0,c.__h=[],c._sb=[]),v&&c.__s==null&&(c.__s=c.state),v&&A.getDerivedStateFromProps!=null&&(c.__s==c.state&&(c.__s=ne({},c.__s)),ne(c.__s,A.getDerivedStateFromProps(y,c.__s))),p=c.props,_=c.state,c.__v=t,h)v&&A.getDerivedStateFromProps==null&&c.componentWillMount!=null&&c.componentWillMount(),v&&c.componentDidMount!=null&&c.__h.push(c.componentDidMount);else{if(v&&A.getDerivedStateFromProps==null&&y!==p&&c.componentWillReceiveProps!=null&&c.componentWillReceiveProps(y,k),!c.__e&&(c.shouldComponentUpdate!=null&&c.shouldComponentUpdate(y,c.__s,k)===!1||t.__v===n.__v)){for(t.__v!==n.__v&&(c.props=y,c.state=c.__s,c.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(C){C&&(C.__=t)}),x=0;x<c._sb.length;x++)c.__h.push(c._sb[x]);c._sb=[],c.__h.length&&i.push(c);break e}c.componentWillUpdate!=null&&c.componentWillUpdate(y,c.__s,k),v&&c.componentDidUpdate!=null&&c.__h.push(function(){c.componentDidUpdate(p,_,b)})}if(c.context=k,c.props=y,c.__P=e,c.__e=!1,P=g.__r,T=0,v){for(c.state=c.__s,c.__d=!1,P&&P(t),d=c.render(c.props,c.state,c.context),D=0;D<c._sb.length;D++)c.__h.push(c._sb[D]);c._sb=[]}else do c.__d=!1,P&&P(t),d=c.render(c.props,c.state,c.context),c.state=c.__s;while(c.__d&&++T<25);c.state=c.__s,c.getChildContext!=null&&(r=ne(ne({},r),c.getChildContext())),v&&!h&&c.getSnapshotBeforeUpdate!=null&&(b=c.getSnapshotBeforeUpdate(p,_)),_t(e,Pe(z=d!=null&&d.type===re&&d.key==null?d.props.children:d)?z:[z],t,n,r,o,a,i,s,u,l),c.base=t.__e,t.__u&=-161,c.__h.length&&i.push(c),m&&(c.__E=c.__=null)}catch(C){t.__v=null,u||a!=null?(t.__e=s,t.__u|=u?160:32,a[a.indexOf(s)]=null):(t.__e=n.__e,t.__k=n.__k),g.__e(C,t,n)}else a==null&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=bn(n.__e,t,n,r,o,a,i,u,l);(d=g.diffed)&&d(t)}function bt(e,t,n){t.__d=void 0;for(var r=0;r<n.length;r++)Je(n[r],n[++r],n[++r]);g.__c&&g.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(a){a.call(o)})}catch(a){g.__e(a,o.__v)}})}function bn(e,t,n,r,o,a,i,s,u){var l,d,c,h,p,_,b,m=n.props,y=t.props,v=t.type;if(v==="svg"?o="http://www.w3.org/2000/svg":v==="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),a!=null){for(l=0;l<a.length;l++)if((p=a[l])&&"setAttribute"in p==!!v&&(v?p.localName===v:p.nodeType===3)){e=p,a[l]=null;break}}if(e==null){if(v===null)return document.createTextNode(y);e=document.createElementNS(o,v,y.is&&y),a=null,s=!1}if(v===null)m===y||s&&e.data===y||(e.data=y);else{if(a=a&&M.call(e.childNodes),m=n.props||ye,!s&&a!=null)for(m={},l=0;l<e.attributes.length;l++)m[(p=e.attributes[l]).name]=p.value;for(l in m)if(p=m[l],l!="children"){if(l=="dangerouslySetInnerHTML")c=p;else if(l!=="key"&&!(l in y)){if(l=="value"&&"defaultValue"in y||l=="checked"&&"defaultChecked"in y)continue;Ae(e,l,null,p,o)}}for(l in y)p=y[l],l=="children"?h=p:l=="dangerouslySetInnerHTML"?d=p:l=="value"?_=p:l=="checked"?b=p:l==="key"||s&&typeof p!="function"||m[l]===p||Ae(e,l,p,m[l],o);if(d)s||c&&(d.__html===c.__html||d.__html===e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(c&&(e.innerHTML=""),_t(e,Pe(h)?h:[h],t,n,r,v==="foreignObject"?"http://www.w3.org/1999/xhtml":o,a,i,a?a[0]:n.__k&&le(n,0),s,u),a!=null)for(l=a.length;l--;)a[l]!=null&&mt(a[l]);s||(l="value",_!==void 0&&(_!==e[l]||v==="progress"&&!_||v==="option"&&_!==m[l])&&Ae(e,l,_,m[l],o),l="checked",b!==void 0&&b!==e[l]&&Ae(e,l,b,m[l],o))}return e}function Je(e,t,n){try{typeof e=="function"?e(t):e.current=t}catch(r){g.__e(r,n)}}function We(e,t,n){var r,o;if(g.unmount&&g.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||Je(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(a){g.__e(a,t)}r.base=r.__P=null}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&We(r[o],t,n||typeof e.type!="function");n||e.__e==null||mt(e.__e),e.__c=e.__=e.__e=e.__d=void 0}function wn(e,t,n){return this.constructor(e,n)}function wt(e,t,n){var r,o,a,i;g.__&&g.__(e,t),o=(r=typeof n=="function")?null:t.__k,a=[],i=[],Ye(t,e=(!r&&n||t).__k=Ze(re,null,[e]),o||ye,ye,t.namespaceURI,!r&&n?[n]:o?null:t.firstChild?M.call(t.childNodes):null,a,!r&&n?n:o?o.__e:t.firstChild,r,i),bt(a,e,i)}function Xe(e,t){var n={__c:t="__cC"+pt++,__:e,Consumer:function(r,o){return r.children(o)},Provider:function(r){var o,a;return this.getChildContext||(o=[],(a={})[t]=this,this.getChildContext=function(){return a},this.componentWillUnmount=function(){o=null},this.shouldComponentUpdate=function(i){this.props.value!==i.value&&o.some(function(s){s.__e=!0,qe(s)})},this.sub=function(i){o.push(i);var s=i.componentWillUnmount;i.componentWillUnmount=function(){o&&o.splice(o.indexOf(i),1),s&&s.call(i)}}),r.children}};return n.Provider.__=n.Consumer.contextType=n}M=ft.slice,g={__e:function(e,t,n,r){for(var o,a,i;t=t.__;)if((o=t.__c)&&!o.__)try{if((a=o.constructor)&&a.getDerivedStateFromError!=null&&(o.setState(a.getDerivedStateFromError(e)),i=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,r||{}),i=o.__d),i)return o.__E=o}catch(s){e=s}throw e}},F=0,Q.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=ne({},this.state),typeof e=="function"&&(e=e(ne({},n),this.props)),e&&ne(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),qe(this))},Q.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),qe(this))},Q.prototype.render=re,V=[],xe=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,_e=function(e,t){return e.__v.__b-t.__v.__b},Se.__r=0,ie=0,J=gt(!1),se=gt(!0),pt=0;var kn=0;function f(e,t,n,r,o,a){t||(t={});var i,s,u=t;if("ref"in u)for(s in u={},t)s=="ref"?i=t[s]:u[s]=t[s];var l={type:e,props:u,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--kn,__i:-1,__u:0,__source:o,__self:a};if(typeof e=="function"&&(i=e.defaultProps))for(s in i)u[s]===void 0&&(u[s]=i[s]);return g.vnode&&g.vnode(l),l}const kt="2.0.6",j=Xe({});var de,I,Qe,xt,ve=0,Pt=[],U=g,Et=U.__b,St=U.__r,Ct=U.diffed,At=U.__c,Tt=U.unmount,Dt=U.__;function Te(e,t){U.__h&&U.__h(I,e,ve||t),ve=0;var n=I.__H||(I.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function N(e){return ve=1,xn(It,e)}function xn(e,t,n){var r=Te(de++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):It(void 0,t),function(s){var u=r.__N?r.__N[0]:r.__[0],l=r.t(u,s);u!==l&&(r.__N=[l,r.__[1]],r.__c.setState({}))}],r.__c=I,!I.u)){var o=function(s,u,l){if(!r.__c.__H)return!0;var d=r.__c.__H.__.filter(function(h){return!!h.__c});if(d.every(function(h){return!h.__N}))return!a||a.call(this,s,u,l);var c=!1;return d.forEach(function(h){if(h.__N){var p=h.__[0];h.__=h.__N,h.__N=void 0,p!==h.__[0]&&(c=!0)}}),!(!c&&r.__c.props===s)&&(!a||a.call(this,s,u,l))};I.u=!0;var a=I.shouldComponentUpdate,i=I.componentWillUpdate;I.componentWillUpdate=function(s,u,l){if(this.__e){var d=a;a=void 0,o(s,u,l),a=d}i&&i.call(this,s,u,l)},I.shouldComponentUpdate=o}return r.__N||r.__}function Z(e,t){var n=Te(de++,3);!U.__s&&Rt(n.__H,t)&&(n.__=e,n.i=t,I.__H.__h.push(n))}function $(e){return ve=5,ce(function(){return{current:e}},[])}function ce(e,t){var n=Te(de++,7);return Rt(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Mt(e,t){return ve=8,ce(function(){return e},t)}function L(e){var t=I.context[e.__c],n=Te(de++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(I)),t.props.value):e.__}function Pn(){for(var e;e=Pt.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(De),e.__H.__h.forEach($e),e.__H.__h=[]}catch(t){e.__H.__h=[],U.__e(t,e.__v)}}U.__b=function(e){I=null,Et&&Et(e)},U.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Dt&&Dt(e,t)},U.__r=function(e){St&&St(e),de=0;var t=(I=e.__c).__H;t&&(Qe===I?(t.__h=[],I.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.i=n.__N=void 0})):(t.__h.forEach(De),t.__h.forEach($e),t.__h=[],de=0)),Qe=I},U.diffed=function(e){Ct&&Ct(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Pt.push(t)!==1&&xt===U.requestAnimationFrame||((xt=U.requestAnimationFrame)||En)(Pn)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.i=void 0})),Qe=I=null},U.__c=function(e,t){t.some(function(n){try{n.__h.forEach(De),n.__h=n.__h.filter(function(r){return!r.__||$e(r)})}catch(r){t.some(function(o){o.__h&&(o.__h=[])}),t=[],U.__e(r,n.__v)}}),At&&At(e,t)},U.unmount=function(e){Tt&&Tt(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{De(r)}catch(o){t=o}}),n.__H=void 0,t&&U.__e(t,n.__v))};var Ot=typeof requestAnimationFrame=="function";function En(e){var t,n=function(){clearTimeout(r),Ot&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);Ot&&(t=requestAnimationFrame(n))}function De(e){var t=I,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),I=t}function $e(e){var t=I;e.__c=e.__(),I=t}function Rt(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function It(e,t){return typeof t=="function"?t(e):t}function q(){const{language:e,translations:t}=L(j);function n(r){if(!t)return r;const o=t[e][r];return o||t.en[r]||r}return{t:n}}const Sn=()=>{const{t:e}=q(),{isTestMode:t}=L(j);return f("footer",{class:"flex flex-col items-center gap-4 text-xs",children:[f("a",{href:"https://moyasar.com/?ref=payment-form-v1.14.0",target:"_blank",class:"text-black/70",children:[e("form.powered_by")," ",f("strong",{children:e("common.moyasar")})]}),t&&f("span",{class:"text-red-600",children:e("common.test_mode_disclaimer")})]})},Cn={"error.authentication_error":"خطأ في المصادقة، الخدمة غير متوفرة حالياً","error.authorization_error":"خطأ في التفويض، الخدمة غير متوفرة حالياً","error.network":"خطأ في الشبكة","error.unknown":"حدث خطأ غير متوقع","error.invalid_mobile":"رقم الجوال غير صحيح","error.invalid_otp":"رمز التحقق غير صحيح","error.invalid_request_error":"طلب دفع غير صحيح","error.mobile_not_registered":"رقم الجوال غير مسجل","error.account_inactive_error":"حساب التاجر غير نشط","error.invalid_name":"يجب إدخال الاسم الأول والأخير","error.unsupported_cc_type":"نوع البطاقة الإئتمانية غير مدعوم","error.invalid_cc_number":"رقم البطاقة الإئتمانية غير صحيح","error.invalid_date":"تاريخ الإنتهاء غير صحيح","error.invalid_month":"شهر الإنتهاء غير صحيح","error.invalid_year":"سنة الإنتهاء غير صحيحة","error.invalid_csc":"رمز الأمان للبطاقة غير صحيح","error.cant_start_payment":"خطأ في بدء عملية الدفع، يرجى المحاولة لاحقاً","error.otp_time_out":"انتهت مدة رمز التحقق، يرجى المحاولة مرة أخرى","error.api_error":"حدث خطأ، يرجى تحديث الصفحة والمحاولة مرة أخرى","error.applePay":"تعذر الاتصال أو تفويض العملية","error.m070":"غير مسموح للتاجر بإجراء عمليات في نظام 3Ds","error.m071":"غير مسموح للتاجر بإجراء عمليات مباشرة بدون نظام 3Ds","error.m072":"لا يوجد للبائع حساب بنكي فعال","error.m074":"بلد البطاقة الائتمانية غير مسموح به","error.m075":"حساب التاجر غير مشترك في فواتير ميسر","error.m076":"حساب التاجر غير مسموح له باستخدام طريقة الدفع هذه","error.m077":"حساب التاجر لا يمكنه استخدام طريقة دفع STC Pay","form.cc":"بطاقة ائتمانية","form.code":"الرمز","form.mobile":"رقم الجوال","form.otp":"رمز التحقق","form.required":"مطلوب","form.name_on_card":"الاسم على البطاقة","form.last_name":"اسم العائلة","form.card_info":"معلومات البطاقة","form.date":"تاريخ الانتهاء","form.csc":"رمز التحقق CVC","form.or_pay_with_card":"أو ادفع بالبطاقة","form.powered_by":"مدعوم بواسطة","form.save_card_notice":"سيتم حفظ بيانات بطاقتك عند الإرسال","button.pay":"ادفع","button.pay-with":"ادفع باستخدام","button.buy":"اشتر باستخدام","button.donate":"تبرع باستخدام","button.book":"احجز باستخدام","button.check-out":"اتمام الشراء باستخدام","button.subscribe":"اشترك باستخدام","button.add-money":"أضف رصيد باستخدام","button.contribute":"ساهم باستخدام","button.order":"اطلب باستخدام","button.reload":"أعد الشحن باستخدام","button.rent":"استأجر باستخدام","button.support":"ادعم باستخدام","button.tip":"اترك إكرامية باستخدام","button.top-up":"اشحن باستخدام","button.continue":"المتابعة للدفع","button.verify":"تحقق","button.proceed":"متابعة","button.cancel":"إلغاء","validation.is_invalid":":attr غير صحيح","validation.can_t_be_blank":":attr مطلوب","validation.should_be_english_letters_only":"الاسم يجب أن يحتوي على أحرف إنجليزية ومسافات فقط","validation.first_and_last_name_required":"يجب إدخال الاسم الأول والأخير","common.moyasar":"ميسر","common.test_mode_disclaimer":"وضع الاختبار مفعل: يرجى عدم الاستخدام في بيئة غير تجريبية!"},An={"error.authentication_error":"Authentication error, service is unavailable now","error.authorization_error":"Authorization error, service is unavailable now","error.network":"Network Error","error.unknown":"Unexpected error occurred","error.invalid_mobile":"Invalid mobile number","error.invalid_otp":"Invalid verification code","error.invalid_request_error":"Invalid payment request","error.mobile_not_registered":"Mobile number is not registered","error.account_inactive_error":"Merchant account is not active","error.invalid_name":"First and last names are required","error.unsupported_cc_type":"Unsupported card type","error.invalid_cc_number":"Invalid credit card","error.invalid_date":"Invalid date","error.invalid_month":"Invalid month","error.invalid_year":"Invalid year","error.invalid_csc":"Invalid CVC number","error.cant_start_payment":"Error initiating payment, please try again later","error.otp_time_out":"OTP time has finished, please try again","error.api_error":"An error has occurred, please refresh the page and try again.","error.applePay":"Unable to connect or authorize transaction","error.m070":"Merchant is not allowed to transact in 3Ds","error.m071":"Merchant is not allowed to transact directly without 3Ds","error.m072":"Merchant does not have bank MID specified","error.m074":"Credit card country is not allowed","error.m075":"Merchant account is not subscribed to Moyasar invoices","error.m076":"Merchant account is not allowed to use this payment method","error.m077":"Merchant account cannot use stc pay method","form.cc":"Credit Card","form.code":"Code","form.mobile":"Mobile number","form.otp":"Verification code","form.required":"Required","form.name_on_card":"Name on card","form.last_name":"Last name","form.card_info":"Card information","form.date":"Expiry date","form.csc":"CVC","form.or_pay_with_card":"Or pay with card","form.powered_by":"Powered by","form.save_card_notice":"You card data will be saved upon submit.","button.pay":"Pay","button.pay-with":"Pay with","button.buy":"Buy with","button.donate":"Donate with","button.book":"Book with","button.check-out":"Check out with","button.subscribe":"Subscribe with","button.add-money":"Add money with","button.contribute":"Contribute with","button.order":"Order with","button.reload":"Reload with","button.rent":"Rent with","button.support":"Support with","button.tip":"Tip with","button.top-up":"Top Up with","button.continue":"Continue with payment","button.verify":"Verify","button.proceed":"Proceed","button.cancel":"Cancel","validation.is_invalid":"Invalid :attr","validation.can_t_be_blank":":attr is required","validation.should_be_english_letters_only":"Name may only have English alphabet and spaces","validation.first_and_last_name_required":"Both first and last name are required","common.moyasar":"Moyasar","common.test_mode_disclaimer":"Test Mode Enabled: Please do not use in production!"},Tn=e=>{const t={en:An,ar:Cn};return e&&Object.entries(e).forEach(([n,r])=>{t[n]||(t[n]={}),Object.entries(r).forEach(([o,a])=>{t[n][o]=a})}),t},Dn="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20width='100%25'%20height='100%25'%20viewBox='0%200%20450%20133'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20xml:space='preserve'%20xmlns:serif='http://www.serif.com/'%20style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;'%3e%3cg%3e%3cpath%20d='M291.862,97.715l0,-69.89l11.852,0l0,5.604c3.607,-4.509%208.954,-6.957%2015.588,-6.957c13.656,0%2023.447,10.886%2023.447,26.474c0,15.588%20-9.855,26.668%20-23.447,26.668c-6.699,0%20-11.981,-2.577%20-15.588,-7.086l0,25.186l-11.852,0l0,0.001Zm11.853,-51.209l-0,12.883c2.512,5.218%207.021,9.018%2013.527,9.018c7.859,0%2013.141,-5.862%2013.141,-15.524c-0,-9.533%20-5.282,-15.331%20-13.141,-15.331c-6.506,0.064%20-11.015,3.607%20-13.527,8.954'%20style='fill:%2302aa7c;fill-rule:nonzero;'/%3e%3cpath%20d='M350.415,63.769c0,-8.503%205.282,-14.429%2014.042,-15.524l20.162,-2.577l0,-2.512c0,-3.027%20-1.546,-4.638%20-4.38,-4.638l-25.315,0l0,-10.757l25.766,0c10.242,0%2015.846,5.024%2015.846,13.914l0,36.394l-11.981,0l0,-6.119c-3.478,4.896%20-9.211,7.665%20-16.619,7.665c-10.435,0%20-17.521,-6.377%20-17.521,-15.846m20.419,6.183c6.055,0%2011.659,-3.414%2013.72,-8.438l0,-6.313l-15.395,2.126c-4.251,0.58%20-6.635,2.834%20-6.635,6.506c0.001,3.929%203.028,6.119%208.31,6.119'%20style='fill:%2302aa7c;fill-rule:nonzero;'/%3e%3cpath%20d='M405.167,86.958l8.632,0c3.285,0%204.767,-1.353%205.862,-4.445l1.546,-4.445l-18.294,-50.308l12.368,0l11.401,35.042l0.258,0l10.886,-35.042l12.174,0l-20.033,57.78c-2.705,7.923%20-6.313,12.174%20-15.137,12.174l-9.662,0l-0.001,-10.756Z'%20style='fill:%2302aa7c;fill-rule:nonzero;'/%3e%3cpath%20d='M43.48,132.306c13.785,0%2025.122,-4.316%2032.594,-11.53c5.604,-5.54%208.889,-13.012%208.889,-21.643c0,-7.794%20-2.899,-14.815%20-8.245,-20.162c-5.346,-5.347%20-13.012,-9.276%20-22.674,-11.144l-15.846,-3.092c-6.57,-1.224%20-10.306,-4.509%20-10.306,-9.082c0,-5.991%205.797,-10.113%2015.073,-10.113c5.797,0%2010.757,1.868%2014.042,5.153c2.061,2.255%203.478,5.153%203.929,8.438l22.867,-5.153c-0.644,-6.57%20-3.736,-12.368%20-8.438,-17.134c-7.536,-7.408%20-19.067,-12.11%20-32.658,-12.11c-12.561,0%20-23.06,4.123%20-30.339,10.693c-6.184,5.797%20-9.662,13.591%20-9.662,22.287c0,7.601%202.448,14.042%207.408,18.938c4.96,4.96%2012.174,8.632%2021.643,10.95l15.653,3.736c7.859,1.868%2011.337,4.767%2011.337,9.92c0,6.377%20-5.797,10.113%20-15.266,10.113c-6.828,0%20-12.368,-2.255%20-15.846,-5.991c-2.448,-2.448%20-3.929,-5.797%20-4.123,-9.469l-23.512,5.154c0.644,7.021%203.929,13.205%208.889,18.165c7.794,8.18%2020.42,13.076%2034.591,13.076m174.048,0c15.266,0%2026.99,-5.54%2035.041,-13.398c6.377,-6.184%2010.306,-13.398%2012.368,-20.806l-24.091,-8.052c-1.031,3.736%20-3.092,7.665%20-6.377,10.693c-3.929,3.736%20-9.276,6.377%20-16.941,6.377c-7.021,0%20-13.591,-2.705%20-18.358,-7.408c-4.767,-4.96%20-7.665,-12.174%20-7.665,-21.257c-0,-9.276%202.899,-16.297%207.665,-21.257c4.702,-4.767%2011.144,-7.214%2018.165,-7.214c7.408,-0%2012.561,2.448%2016.297,6.184c3.092,3.092%204.96,7.021%206.184,10.95l24.542,-8.245c-1.868,-7.214%20-5.797,-14.429%20-11.53,-20.419c-8.245,-8.052%20-20.226,-13.785%20-36.072,-13.785c-14.622,-0%20-27.827,5.54%20-37.296,15.073c-9.469,9.662%20-15.266,23.125%20-15.266,38.778c0,15.653%205.991,29.051%2015.653,38.778c9.403,9.468%2022.801,15.008%2037.681,15.008m-83.288,0c10.693,0%2018.358,-3.285%2021.643,-6.184l0,-22.287c-2.512,1.868%20-7.408,4.123%20-13.849,4.123c-4.573,0%20-7.859,-1.031%20-10.306,-3.285c-2.061,-2.061%20-3.092,-5.604%20-3.092,-10.306l0,-94.367l-27.247,0l0,27.827l54.43,0l0,26.41l-54.43,0l0,46.829c0,9.469%202.899,17.134%208.052,22.481c5.797,5.667%2014.299,8.759%2024.799,8.759'%20style='fill:%23fff;fill-rule:nonzero;'/%3e%3c/g%3e%3c/svg%3e";function Nt(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Nt(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Mn(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Nt(e))&&(r&&(r+=" "),r+=t);return r}const oe=(...e)=>Mn(e),et=e=>{const p=e,{children:t,type:n="button",variant:r="primary",onClick:o,disabled:a,busy:i,fail:s,success:u}=p,l=Ke(p,["children","type","variant","onClick","disabled","busy","fail","success"]),{isProcessing:d}=L(j),c={primary:"bg-primary text-white",stc:"bg-stc text-white",error:"bg-error text-white pointer-events-none",success:"bg-success text-white"};function h(){return s?c.error:u?c.success:c[r]}return f("button",R(S({},l),{type:n,disabled:d||a,onClick:o,class:oe(["flex h-11 w-full cursor-pointer items-center justify-center gap-2 rounded-lg px-3 py-2 transition-colors disabled:cursor-default disabled:opacity-70",h(),e.class,d&&!s&&"pointer-events-none grayscale"]),children:[s?f("svg",{class:"h-5 w-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:[f("circle",{cx:"12",cy:"12",r:"10"}),f("path",{d:"m15 9-6 6"}),f("path",{d:"m9 9 6 6"})]}):t,i&&f("svg",{class:"h-4 w-4 animate-spin text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[f("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),f("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),u&&f("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"h-4 w-4",children:[f("path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5"}),f("path",{class:"animate-fade-in",d:"m9 11 3 3L22 4"})]})]}))},pe=e=>{const u=e,{name:t,placeholder:n,type:r="text",onBlur:o,disabled:a}=u,i=Ke(u,["name","placeholder","type","onBlur","disabled"]),{isProcessing:s}=L(j);return f("input",R(S({},i),{dir:"ltr",id:t,name:t,disabled:s||a,class:oe(["relative block w-full rounded-lg border-0 px-4 py-2 text-sm text-black shadow-input placeholder:text-black/70 focus:z-[2] focus:shadow-input-focus focus:outline-none",e.class,s&&"pointer-events-none grayscale",e.error&&"z-[1] shadow-input-error"]),type:r,placeholder:n,onBlur:l=>{const d=l.target;d.classList.add("shadow-input-error","z-[1]"),d.value.trim()&&d.classList.remove("shadow-input-error","z-[1]"),o&&typeof o=="function"&&o(l)}}))},tt=Xe({});function On(e,t){for(var n in t)e[n]=t[n];return e}function Ft(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return!0;for(var r in t)if(r!=="__source"&&e[r]!==t[r])return!0;return!1}function Ut(e,t){this.props=e,this.context=t}(Ut.prototype=new Q).isPureReactComponent=!0,Ut.prototype.shouldComponentUpdate=function(e,t){return Ft(this.props,e)||Ft(this.state,t)};var Lt=g.__b;g.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Lt&&Lt(e)};var Rn=g.__e;g.__e=function(e,t,n,r){if(e.then){for(var o,a=t;a=a.__;)if((o=a.__c)&&o.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k),o.__c(e,t)}Rn(e,t,n,r)};var Vt=g.unmount;function Gt(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),e.__c.__H=null),(e=On({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(r){return Gt(r,t,n)})),e}function Bt(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(r){return Bt(r,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function nt(){this.__u=0,this.t=null,this.__b=null}function zt(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function Me(){this.u=null,this.o=null}g.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Vt&&Vt(e)},(nt.prototype=new Q).__c=function(e,t){var n=t.__c,r=this;r.t==null&&(r.t=[]),r.t.push(n);var o=zt(r.__v),a=!1,i=function(){a||(a=!0,n.__R=null,o?o(s):s())};n.__R=i;var s=function(){if(!--r.__u){if(r.state.__a){var u=r.state.__a;r.__v.__k[0]=Bt(u,u.__c.__P,u.__c.__O)}var l;for(r.setState({__a:r.__b=null});l=r.t.pop();)l.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(i,i)},nt.prototype.componentWillUnmount=function(){this.t=[]},nt.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=Gt(this.__b,n,r.__O=r.__P)}this.__b=null}var o=t.__a&&Ze(re,null,e.fallback);return o&&(o.__u&=-33),[Ze(re,null,t.__a?null:e.children),o]};var jt=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.u=n=n[2]}};(Me.prototype=new Q).__a=function(e){var t=this,n=zt(t.__v),r=t.o.get(e);return r[0]++,function(o){var a=function(){t.props.revealOrder?(r.push(o),jt(t,e,r)):o()};n?n(a):a()}},Me.prototype.render=function(e){this.u=null,this.o=new Map;var t=Ce(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},Me.prototype.componentDidUpdate=Me.prototype.componentDidMount=function(){var e=this;this.o.forEach(function(t,n){jt(e,n,t)})};var In=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.element")||60103,Nn=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Fn=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Un=/[A-Z0-9]/g,Ln=typeof document!="undefined",Vn=function(e){return(typeof Symbol!="undefined"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};Q.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(Q.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var Ht=g.event;function Gn(){}function Bn(){return this.cancelBubble}function zn(){return this.defaultPrevented}g.event=function(e){return Ht&&(e=Ht(e)),e.persist=Gn,e.isPropagationStopped=Bn,e.isDefaultPrevented=zn,e.nativeEvent=e};var jn={enumerable:!1,configurable:!0,get:function(){return this.class}},Kt=g.vnode;g.vnode=function(e){typeof e.type=="string"&&function(t){var n=t.props,r=t.type,o={};for(var a in n){var i=n[a];if(!(a==="value"&&"defaultValue"in n&&i==null||Ln&&a==="children"&&r==="noscript"||a==="class"||a==="className")){var s=a.toLowerCase();a==="defaultValue"&&"value"in n&&n.value==null?a="value":a==="download"&&i===!0?i="":s==="translate"&&i==="no"?i=!1:s==="ondoubleclick"?a="ondblclick":s!=="onchange"||r!=="input"&&r!=="textarea"||Vn(n.type)?s==="onfocus"?a="onfocusin":s==="onblur"?a="onfocusout":Fn.test(a)?a=s:r.indexOf("-")===-1&&Nn.test(a)?a=a.replace(Un,"-$&").toLowerCase():i===null&&(i=void 0):s=a="oninput",s==="oninput"&&o[a=s]&&(a="oninputCapture"),o[a]=i}}r=="select"&&o.multiple&&Array.isArray(o.value)&&(o.value=Ce(n.children).forEach(function(u){u.props.selected=o.value.indexOf(u.props.value)!=-1})),r=="select"&&o.defaultValue!=null&&(o.value=Ce(n.children).forEach(function(u){u.props.selected=o.multiple?o.defaultValue.indexOf(u.props.value)!=-1:o.defaultValue==u.props.value})),n.class&&!n.className?(o.class=n.class,Object.defineProperty(o,"className",jn)):(n.className&&!n.class||n.class&&n.className)&&(o.class=o.className=n.className),t.props=o}(e),e.$$typeof=In,Kt&&Kt(e)};var Zt=g.__r;g.__r=function(e){Zt&&Zt(e),e.__c};var qt=g.diffed;g.diffed=function(e){qt&&qt(e);var t=e.props,n=e.__e;n!=null&&e.type==="textarea"&&"value"in t&&t.value!==n.value&&(n.value=t.value==null?"":t.value)};function fe(e,t,n){var r=this,o=$(null),a=$(0),i=$(null),s=$([]),u=$(),l=$(),d=$(e),c=$(!0);d.current=e;var h=typeof window!="undefined",p=!t&&t!==0&&h;if(typeof e!="function")throw new TypeError("Expected a function");t=+t||0;var _=!!(n=n||{}).leading,b=!("trailing"in n)||!!n.trailing,m="maxWait"in n,y="debounceOnServer"in n&&!!n.debounceOnServer,v=m?Math.max(+n.maxWait||0,t):null;Z(function(){return c.current=!0,function(){c.current=!1}},[]);var w=ce(function(){var k=function(A){var C=s.current,G=u.current;return s.current=u.current=null,a.current=A,l.current=d.current.apply(G,C)},x=function(A,C){p&&cancelAnimationFrame(i.current),i.current=p?requestAnimationFrame(A):setTimeout(A,C)},P=function(A){if(!c.current)return!1;var C=A-o.current;return!o.current||C>=t||C<0||m&&A-a.current>=v},T=function(A){return i.current=null,b&&s.current?k(A):(s.current=u.current=null,l.current)},D=function A(){var C=Date.now();if(P(C))return T(C);if(c.current){var G=t-(C-o.current),te=m?Math.min(G,v-(C-a.current)):G;x(A,te)}},z=function(){if(h||y){var A=Date.now(),C=P(A);if(s.current=[].slice.call(arguments),u.current=r,o.current=A,C){if(!i.current&&c.current)return a.current=o.current,x(D,t),_?k(o.current):l.current;if(m)return x(D,t),k(o.current)}return i.current||x(D,t),l.current}};return z.cancel=function(){i.current&&(p?cancelAnimationFrame(i.current):clearTimeout(i.current)),a.current=0,s.current=o.current=u.current=i.current=null},z.isPending=function(){return!!i.current},z.flush=function(){return i.current?T(Date.now()):l.current},z},[_,m,t,v,b,p,h,y]);return w}var Hn=Object.defineProperty,Kn=(e,t,n)=>t in e?Hn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Oe=(e,t,n)=>Kn(e,typeof t!="symbol"?t+"":t,n);const Yt={"#":{pattern:/[0-9]/},"@":{pattern:/[a-zA-Z]/},"*":{pattern:/[a-zA-Z0-9]/}},Jt=(e,t,n)=>e.replaceAll(t,"").replace(n,".").replace("..",".").replace(/[^.\d]/g,""),Wt=(e,t,n)=>{var o;var r;return new Intl.NumberFormat((o=(r=n.number)==null?void 0:r.locale)!=null?o:"en",{minimumFractionDigits:e,maximumFractionDigits:t,roundingMode:"trunc"})},Zn=(e,t=!0,n)=>{var m,y,v;var r,o,a,i;const s=((r=n.number)==null?void 0:r.unsigned)==null&&e.startsWith("-")?"-":"",u=(m=(o=n.number)==null?void 0:o.fraction)!=null?m:0;let l=Wt(0,u,n);const d=l.formatToParts(1000.12),c=(y=(a=d.find(w=>w.type==="group"))==null?void 0:a.value)!=null?y:" ",h=(v=(i=d.find(w=>w.type==="decimal"))==null?void 0:i.value)!=null?v:".",p=Jt(e,c,h);if(Number.isNaN(parseFloat(p)))return s;const _=p.split(".");if(_[1]!=null&&_[1].length>=1){const w=_[1].length<=u?_[1].length:u;l=Wt(w,u,n)}let b=l.format(parseFloat(p));return t?u>0&&p.endsWith(".")&&!p.slice(0,-1).includes(".")&&(b+=h):b=Jt(b,c,h),s+b};class qn{constructor(t={}){var r;Oe(this,"opts",{}),Oe(this,"memo",new Map);const n=S({},t);if(n.tokens!=null){n.tokens=n.tokensReplace?S({},n.tokens):S(S({},Yt),n.tokens);for(const o of Object.values(n.tokens))typeof o.pattern=="string"&&(o.pattern=new RegExp(o.pattern))}else n.tokens=Yt;Array.isArray(n.mask)&&(n.mask.length>1?n.mask=[...n.mask].sort((o,a)=>o.length-a.length):n.mask=(r=n.mask[0])!=null?r:""),n.mask===""&&(n.mask=null),this.opts=n}masked(t){return this.process(t,this.findMask(t))}unmasked(t){return this.process(t,this.findMask(t),!1)}isEager(){return this.opts.eager===!0}isReversed(){return this.opts.reversed===!0}completed(t){const n=this.findMask(t);if(this.opts.mask==null||n==null)return!1;const r=this.process(t,n).length;return typeof this.opts.mask=="string"?r>=this.opts.mask.length:r>=n.length}findMask(t){var o,a;const n=this.opts.mask;if(n==null)return null;if(typeof n=="string")return n;if(typeof n=="function")return n(t);const r=this.process(t,(o=n.slice(-1).pop())!=null?o:"",!1);return(a=n.find(i=>this.process(t,i,!1).length>=r.length))!=null?a:""}escapeMask(t){const n=[],r=[];return t.split("").forEach((o,a)=>{o==="!"&&t[a-1]!=="!"?r.push(a-r.length):n.push(o)}),{mask:n.join(""),escaped:r}}process(t,n,r=!0){if(this.opts.number!=null)return Zn(t,r,this.opts);if(n==null)return t;const o=`v=${t},mr=${n},m=${r?1:0}`;if(this.memo.has(o))return this.memo.get(o);const{mask:a,escaped:i}=this.escapeMask(n),s=[],u=this.opts.tokens!=null?this.opts.tokens:{},l=this.isReversed()?-1:1,d=this.isReversed()?"unshift":"push",c=this.isReversed()?0:a.length-1,h=this.isReversed()?()=>m>-1&&y>-1:()=>m<a.length&&y<t.length,p=w=>!this.isReversed()&&w<=c||this.isReversed()&&w>=c;let _,b=-1,m=this.isReversed()?a.length-1:0,y=this.isReversed()?t.length-1:0,v=!1;for(;h();){const w=a.charAt(m),k=u[w],x=(k==null?void 0:k.transform)!=null?k.transform(t.charAt(y)):t.charAt(y);if(!i.includes(m)&&k!=null?(x.match(k.pattern)!=null?(s[d](x),k.repeated?(b===-1?b=m:m===c&&m!==b&&(m=b-l),c===b&&(m-=l)):k.multiple&&(v=!0,m-=l),m+=l):k.multiple?v&&(m+=l,y-=l,v=!1):x===_?_=void 0:k.optional&&(m+=l,y-=l),y+=l):(r&&!this.isEager()&&s[d](w),x===w&&!this.isEager()?y+=l:_=w,this.isEager()||(m+=l)),this.isEager())for(;p(m)&&(u[a.charAt(m)]==null||i.includes(m));){if(r){if(s[d](a.charAt(m)),t.charAt(y)===a.charAt(m)){m+=l,y+=l;continue}}else a.charAt(m)===t.charAt(y)&&(y+=l);m+=l}}return this.memo.set(o,s.join("")),this.memo.get(o)}}const Xt=e=>JSON.parse(e.replaceAll("'",'"')),Yn=(e,t={})=>{const n=S({},t);e.dataset.maska!=null&&e.dataset.maska!==""&&(n.mask=Jn(e.dataset.maska)),e.dataset.maskaEager!=null&&(n.eager=Re(e.dataset.maskaEager)),e.dataset.maskaReversed!=null&&(n.reversed=Re(e.dataset.maskaReversed)),e.dataset.maskaTokensReplace!=null&&(n.tokensReplace=Re(e.dataset.maskaTokensReplace)),e.dataset.maskaTokens!=null&&(n.tokens=Wn(e.dataset.maskaTokens));const r={};return e.dataset.maskaNumberLocale!=null&&(r.locale=e.dataset.maskaNumberLocale),e.dataset.maskaNumberFraction!=null&&(r.fraction=parseInt(e.dataset.maskaNumberFraction)),e.dataset.maskaNumberUnsigned!=null&&(r.unsigned=Re(e.dataset.maskaNumberUnsigned)),(e.dataset.maskaNumber!=null||Object.values(r).length>0)&&(n.number=r),n},Re=e=>e!==""?!!JSON.parse(e):!0,Jn=e=>e.startsWith("[")&&e.endsWith("]")?Xt(e):e,Wn=e=>{if(e.startsWith("{")&&e.endsWith("}"))return Xt(e);const t={};return e.split("|").forEach(n=>{const r=n.split(":");t[r[0]]={pattern:new RegExp(r[1]),optional:r[2]==="optional",multiple:r[2]==="multiple",repeated:r[2]==="repeated"}}),t};class Ie{constructor(t,n={}){Oe(this,"items",new Map),Oe(this,"onInput",r=>{if(r instanceof CustomEvent&&r.type==="input"&&!r.isTrusted&&!r.bubbles)return;const o=r.target,a=this.items.get(o),i="inputType"in r&&r.inputType.startsWith("delete"),s=a.isEager(),u=i&&s&&a.unmasked(o.value)===""?"":o.value;this.fixCursor(o,i,()=>this.setValue(o,u))}),this.options=n,this.init(this.getInputs(t))}update(t={}){this.options=S({},t),this.init(Array.from(this.items.keys()))}updateValue(t){t.value!==""&&t.value!==this.processInput(t).masked&&this.setValue(t,t.value)}destroy(){for(const t of this.items.keys())t.removeEventListener("input",this.onInput);this.items.clear()}init(t){const n=this.getOptions(this.options);for(const r of t){this.items.has(r)||r.addEventListener("input",this.onInput,{capture:!0});const o=new qn(Yn(r,n));this.items.set(r,o),queueMicrotask(()=>this.updateValue(r)),r.selectionStart===null&&o.isEager()&&console.warn("Maska: input of `%s` type is not supported",r.type)}}getInputs(t){return typeof t=="string"?Array.from(document.querySelectorAll(t)):"length"in t?Array.from(t):[t]}getOptions(t){const i=t,{onMaska:n,preProcess:r,postProcess:o}=i;return Ke(i,["onMaska","preProcess","postProcess"])}fixCursor(t,n,r){const o=t.selectionStart,a=t.value;if(r(),o===null||o===a.length&&!n)return;const i=t.value,s=a.slice(0,o),u=i.slice(0,o),l=this.processInput(t,s).unmasked,d=this.processInput(t,u).unmasked;let c=o;s!==u&&(c+=n?i.length-a.length:l.length-d.length),t.setSelectionRange(c,c)}setValue(t,n){const r=this.processInput(t,n);t.value=r.masked,this.options.onMaska!=null&&(Array.isArray(this.options.onMaska)?this.options.onMaska.forEach(o=>o(r)):this.options.onMaska(r)),t.dispatchEvent(new CustomEvent("maska",{detail:r})),t.dispatchEvent(new CustomEvent("input",{detail:r.masked}))}processInput(t,n){const r=this.items.get(t);let o=n!=null?n:t.value;this.options.preProcess!=null&&(o=this.options.preProcess(o));let a=r.masked(o);return this.options.postProcess!=null&&(a=this.options.postProcess(a)),{masked:a,unmasked:r.unmasked(o),completed:r.completed(o)}}}const Xn=({showOtp:e,value:t,setValue:n})=>{const{t:r}=q(),{handleBlur:o,err:a}=L(tt),i="### ### ####",s=l=>{const d=l.target,{value:c}=d;n(c)},u=fe(o,1e3);return Z(()=>{new Ie('[name="mysr-stc-mobile"]')},[]),f(pe,{name:"mysr-stc-mobile",label:r("form.mobile"),type:"text",inputMode:"numeric",maxLength:i.length,autocomplete:"tel-national",placeholder:"05x xxx xxxx",class:oe(["animate-fade-in text-center",!e&&"hidden"]),onAnimationEnd:l=>{l.target&&l.target.focus()},value:t,onKeyUp:l=>{s(l),u(l)},onBlur:o,error:a.phone,"data-maska":i,"data-maska-eager":!0})},Qn=({showPhone:e,value:t,setValue:n})=>{const{t:r}=q(),{handleBlur:o,err:a}=L(tt),i=u=>{const l=u.target,{value:d}=l;n(d)},s=fe(o,1e3);return Z(()=>{new Ie('[name="mysr-stc-otp"]')},[]),f(pe,{name:"mysr-stc-otp",label:r("form.otp"),type:"text",inputMode:"numeric",autocomplete:"one-time-code",placeholder:r("form.code"),class:oe(["animate-fade-in text-center",e&&"hidden"]),onAnimationEnd:u=>{u.target&&u.target.focus()},value:t,onKeyUp:u=>{i(u),s(u)},onBlur:o,error:a.otp,"data-maska":"### ###","data-maska-eager":!0})},H=e=>e.split(" ").join(""),$n=({countTo:e,callback:t})=>{const n=$(null),r=Mt(()=>{const s=e?new Date(e).getTime()-new Date().getTime():0;return s<0?0:s},[e]),[o,a]=N(r());Z(()=>(n.current=setInterval(()=>{a(r())},500),()=>{n.current&&clearInterval(n.current)}),[r]),Z(()=>{o===0&&(n.current&&clearInterval(n.current),typeof t=="function"&&t(0))},[t,o]);const i=()=>{const s=Math.floor(o/1e3/60/60),u=Math.floor((o/1e3/60/60-s)*60),l=Math.floor(((o/1e3/60/60-s)*60-u)*60);return f("span",{children:[u,":",l<10?`0${l}`:l]})};return!e||!o?null:f("div",{class:oe("inline-flex gap-2 text-sm"),children:i()})},er="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20width='100%25'%20height='100%25'%20viewBox='0%200%20512%20174'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20xml:space='preserve'%20xmlns:serif='http://www.serif.com/'%20style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;'%3e%3cg%3e%3cpath%20d='M326.531,121.529l-0,-74.676l12.663,0l0,5.988c3.854,-4.818%209.567,-7.433%2016.655,-7.433c14.592,-0%2025.053,11.631%2025.053,28.286c-0,16.656%20-10.53,28.494%20-25.053,28.494c-7.157,0%20-12.801,-2.753%20-16.655,-7.571l0,26.911l-12.663,-0l-0,0.001Zm12.664,-54.716l0,13.765c2.684,5.576%207.502,9.636%2014.453,9.636c8.398,-0%2014.041,-6.264%2014.041,-16.587c0,-10.186%20-5.643,-16.381%20-14.041,-16.381c-6.951,0.069%20-11.769,3.854%20-14.453,9.567'%20style='fill:%2302aa7c;fill-rule:nonzero;'%20/%3e%3cpath%20d='M389.093,85.258c-0,-9.085%205.643,-15.417%2015.003,-16.587l21.543,-2.753l-0,-2.684c-0,-3.234%20-1.652,-4.956%20-4.68,-4.956l-27.048,0l-0,-11.493l27.53,-0c10.943,-0%2016.931,5.368%2016.931,14.867l-0,38.885l-12.802,0l0,-6.538c-3.716,5.232%20-9.841,8.19%20-17.757,8.19c-11.149,0%20-18.72,-6.813%20-18.72,-16.931m21.817,6.607c6.469,-0%2012.457,-3.648%2014.659,-9.016l0,-6.745l-16.449,2.271c-4.542,0.62%20-7.089,3.028%20-7.089,6.952c0.001,4.198%203.235,6.538%208.879,6.538'%20style='fill:%2302aa7c;fill-rule:nonzero;'%20/%3e%3cpath%20d='M447.594,110.035l9.223,0c3.51,0%205.093,-1.446%206.263,-4.749l1.652,-4.75l-19.547,-53.752l13.215,-0l12.182,37.441l0.275,0l11.632,-37.441l13.007,-0l-21.404,61.736c-2.891,8.465%20-6.746,13.008%20-16.174,13.008l-10.323,-0l-0.001,-11.493Z'%20style='fill:%2302aa7c;fill-rule:nonzero;'%20/%3e%3cpath%20d='M61.142,158.488c14.729,0%2026.842,-4.611%2034.826,-12.319c5.987,-5.92%209.497,-13.903%209.497,-23.125c0,-8.328%20-3.097,-15.83%20-8.809,-21.543c-5.712,-5.713%20-13.903,-9.911%20-24.227,-11.907l-16.931,-3.304c-7.02,-1.307%20-11.011,-4.817%20-11.011,-9.703c-0,-6.402%206.194,-10.806%2016.105,-10.806c6.194,0%2011.493,1.996%2015.003,5.506c2.202,2.409%203.716,5.506%204.198,9.016l24.433,-5.506c-0.688,-7.02%20-3.992,-13.215%20-9.016,-18.307c-8.052,-7.915%20-20.372,-12.939%20-34.894,-12.939c-13.421,-0%20-24.639,4.405%20-32.416,11.425c-6.608,6.194%20-10.324,14.521%20-10.324,23.813c0,8.121%202.616,15.003%207.915,20.234c5.3,5.3%2013.008,9.223%2023.125,11.7l16.725,3.992c8.397,1.996%2012.113,5.093%2012.113,10.599c0,6.814%20-6.194,10.806%20-16.311,10.806c-7.295,-0%20-13.215,-2.41%20-16.931,-6.402c-2.616,-2.615%20-4.198,-6.194%20-4.405,-10.117l-25.122,5.507c0.688,7.502%204.198,14.109%209.498,19.409c8.327,8.74%2021.818,13.971%2036.959,13.971m185.965,0c16.311,0%2028.838,-5.919%2037.44,-14.315c6.814,-6.608%2011.012,-14.316%2013.215,-22.231l-25.74,-8.603c-1.102,3.992%20-3.304,8.19%20-6.814,11.425c-4.198,3.992%20-9.911,6.814%20-18.101,6.814c-7.502,-0%20-14.522,-2.891%20-19.615,-7.916c-5.093,-5.299%20-8.19,-13.007%20-8.19,-22.712c0,-9.911%203.098,-17.413%208.19,-22.713c5.024,-5.093%2011.907,-7.708%2019.409,-7.708c7.915,0%2013.421,2.616%2017.413,6.608c3.303,3.304%205.299,7.502%206.607,11.7l26.222,-8.81c-1.995,-7.708%20-6.193,-15.417%20-12.319,-21.817c-8.81,-8.603%20-21.611,-14.729%20-38.542,-14.729c-15.623,0%20-29.732,5.919%20-39.849,16.105c-10.118,10.324%20-16.312,24.709%20-16.312,41.433c0,16.725%206.401,31.04%2016.725,41.433c10.047,10.117%2024.362,16.036%2040.261,16.036m-88.991,0c11.425,0%2019.615,-3.51%2023.125,-6.607l0,-23.813c-2.684,1.996%20-7.915,4.405%20-14.797,4.405c-4.886,-0%20-8.397,-1.102%20-11.012,-3.51c-2.202,-2.202%20-3.303,-5.988%20-3.303,-11.012l-0,-100.828l-29.113,0l0,29.732l58.157,0l-0,28.219l-58.157,-0l0,50.035c0,10.117%203.097,18.307%208.603,24.02c6.194,6.055%2015.278,9.359%2026.497,9.359'%20style='fill:%23502c84;fill-rule:nonzero;'%20/%3e%3c/g%3e%3c/svg%3e";function Qt(e){return e.errors!==void 0}const tr=()=>{const{t:e}=q(),[t,n]=N(!1),{amount:r,currency:o,description:a,publishable_api_key:i,metadata:s,invoice_id:u,version:l,base_url:d,on_failure:c,setFormSettings:h}=L(j),p=v=>{h&&(n(v),h(w=>R(S({},w),{isProcessing:v})))},_={amount:r,currency:o,description:a,publishable_api_key:i};s&&Object.keys(s).length>0&&(_.metadata=s),u&&(_.invoice_id=u.toLowerCase());const b=v=>{h&&h(w=>R(S({},w),{apiError:`${e("error."+v.type)}, ${v.message}`}))},m=()=>{h&&h(v=>R(S({},v),{apiError:""}))};return{processing:t,postData:k=>X(this,[k],function*({data:v,path:w}){p(!0),m();const x=w||`${d}/v1/payments`;try{const P=yield fetch(x,{method:"POST",headers:{"Content-Type":"application/json","X-Moyasar-Form-Version":l},body:JSON.stringify(S(S({},_),v))});if(!P.ok){if(typeof P=="object"){const T=yield P.json();if(console.log("fetch error:",T),!Qt(T)){b({type:"api_error",message:`Error code: ${P.status}`,errors:null});return}return b(T),T}return yield Promise.reject(P)}return P.json()}catch(P){if(c)try{yield c(P)}catch(T){console.error("An error happened when firing failure callback"),console.error(T)}console.error(P)}finally{p(!1)}})}},nr=()=>{const{apiError:e}=L(j),[t,n]=N(!1);return Z(()=>{n(!!e)},[e]),Z(()=>{let r=null;return t&&(r=setTimeout(()=>{n(!1)},3e3)),()=>{r&&clearTimeout(r)}},[t]),{fail:t}},rr=n=>X(this,[n],function*({on_initiating:e,setFormSettings:t}){const r=a=>{if(typeof a!="object"||!t)return;const i=["callback_url","description","metadata","amount"];for(const s in a)if(!i.includes(s))throw new Error(`Changing ${s} is not allowed!`);t(s=>S(S({},s),a))};if(!e)return Promise.resolve();if(typeof e!="function")throw new Error("Invalid on_initiating handler");const o=yield e();if(typeof o=="boolean")return o;if(typeof o=="object")return r(o),!0;throw new Error(`Invalid on_initiating handler result: ${o}`)}),or=(e,t,n)=>X(this,null,function*(){var o;const r=`${e}${e.indexOf("?")>-1?"&":"?"}id=${t.id}&status=${t.status}&message=${(o=t.source)==null?void 0:o.message}`;n&&typeof n=="function"?yield n(r):window.location.href=r}),ar=n=>X(this,[n],function*({payment:e,on_completed:t}){if(t!==null){if(typeof t!="function")throw new Error("Invalid on_completed handler");try{yield t(e)}catch(r){throw new Error("Unexpected error while handling on_completed callback")}}}),ge=({defaultError:e})=>{const{callback_url:t,on_initiating:n,on_redirect:r,on_completed:o,setFormSettings:a}=L(j),[i,s]=N(e),{processing:u,postData:l}=tr(),[d,c]=N(!1),[h,p]=N(!1),{fail:_}=nr();function b(T){return X(this,arguments,function*({data:v,path:w,onSuccess:k,onFailed:x,initPayment:P}){const D=yield l({data:v,path:w});Qt(D)||(D&&(k&&k(D),o&&!P&&(yield ar({payment:D,on_completed:o}).catch(z=>{console.error(z)})),D.status==="paid"&&(p(!0),setTimeout(()=>{or(t,D,r).catch(()=>{})},100)),D.status==="failed"&&x&&x(D)),c(!1))})}function m(v){return X(this,null,function*(){if(c(!0),v.initPayment){try{const w=yield rr({on_initiating:n,setFormSettings:a});if(typeof w=="boolean"&&!w){c(!1);return}yield b(v)}catch(w){console.error(w),c(!1)}return}yield b(v)})}const y=ce(()=>u||d,[u,d]);return{makePayment:m,busy:d,fail:_,success:h,processing:u,loading:y,error:i,setError:s}},$t=({inForm:e=!1})=>{const{apiError:t,showForm:n}=L(j);return n&&!e?null:f("p",{class:"flex flex-col gap-2 rounded-md border border-error bg-red-100 px-4 py-2 text-xs font-medium text-error empty:hidden",children:t})},ir=()=>{const{t:e}=q(),{formattedAmount:t,isRtl:n,fixed_width:r,setFormSettings:o,showForm:a}=L(j),[i,s]=N(null),[u,l]=N(!1),d={phone:"",otp:""},{makePayment:c,busy:h,fail:p,success:_,loading:b,error:m,setError:y}=ge({defaultError:d}),[v,w]=N(""),[k,x]=N(""),[P,T]=N(""),D=B=>{const O=/^05[503649187][0-9]{7}$/.test(H(B));return y(Y=>R(S({},Y),{phone:O?"":"error.invalid_mobile"})),O},z=B=>{const O=/^[0-9]{4,}$/.test(H(B));return y(Y=>R(S({},Y),{otp:O?"":"error.invalid_otp"})),O},A=B=>{const{value:O,name:Y}=B.target,ae=O.trim();if(l(!1),!ae){l(!ae);return}Y==="mysr-stc-mobile"&&D(ae),Y==="mysr-stc-otp"&&z(ae)},C=()=>{if(!D(v))return;function B(O){const{transaction_url:Y}=O.source;T(Y),s(new Date().getTime()+5*60*1e3)}c({data:{source:{type:"stcpay",mobile:H(v)}},onSuccess:B,initPayment:!0}).catch(O=>{console.error(O)})},G=()=>{if(!i||!z(k))return;function B(O){var Y;O.status==="failed"&&((Y=O.source)==null?void 0:Y.message)==="Invalid OTP"&&(y(ae=>R(S({},ae),{otp:"error.invalid_otp"})),x(""),s(null))}c({data:{otp_value:H(k)},path:P,onFailed:B}).catch(O=>{console.error(O)})},te=B=>{if(B.preventDefault(),y(d),!i){C();return}G()},Be=B=>{B>0||(y(O=>R(S({},O),{otp:"error.otp_time_out"})),x(""),s(null))},ze=ce(()=>m.phone||i&&m.otp&&m.otp!=="error.otp_time_out"?!0:u||b,[m,u,b]),we=B=>o(O=>R(S({},O),{showForm:B})),[me,ke]=N(!1),je=()=>{ke(!0)},dt=()=>{me&&(w(""),x(""),y(d),we(!1),ke(!1),l(!1))};return f(tt.Provider,{value:{err:m,setErr:y,handleBlur:A},children:f(re,{children:[f(et,{variant:"stc",onClick:()=>we(!0),children:f("img",{class:"pointer-events-none h-4 max-h-full",height:16,width:55,alt:"STC Pay",src:Dn})}),a&&f(re,{children:[f("div",{class:oe(["fixed inset-0 z-[9] bg-gray-500/75 transition-opacity",me?"animate-fade-out duration-300":"animate-fade-in duration-200"])}),f("div",{class:"fixed inset-0 z-10 flex flex-col justify-end md:justify-center",children:f("div",{class:oe(["flex w-full origin-bottom flex-col gap-4 rounded-t-lg border-neutral-300 bg-slate-100 p-4 shadow transition-all md:rounded-b-lg lg:p-10",r&&"md:mx-auto md:max-w-96 lg:max-w-screen-sm",me?"animate-dialog-out-mobile duration-200 md:animate-dialog-out":"animate-dialog-in-mobile duration-300 md:animate-dialog-in"]),onAnimationEnd:dt,children:[f($t,{inForm:!0}),f("div",{class:"flex items-center",children:[f("img",{alt:"",src:er,class:"h-5"}),f("button",{onClick:je,class:"ms-auto",children:"Cancel"})]}),f("form",{class:"flex flex-col gap-4",onSubmit:te,children:[f("div",{class:"space-y-2",children:[f("div",{class:"flex items-end justify-between text-xs font-medium",children:[i?f("label",{for:"mysr-stc-mobile",children:e("form.otp")}):f("label",{for:"mysr-stc-otp",children:e("form.mobile")}),u&&f("span",{class:"uppercase text-error",children:e("form.required")})]}),f(Xn,{value:v,setValue:w,showOtp:!i&&typeof i!="number"}),f(Qn,{value:k,setValue:x,showPhone:!i&&typeof i!="number"})]}),f(et,{success:_,fail:p,busy:h,variant:"stc",class:"flex gap-1",disabled:ze,type:"submit",children:[!n&&e("button.pay")," ",i?f($n,{countTo:i,callback:Be}):t]})]}),f("p",{class:"flex flex-col gap-2 text-xs font-medium text-error empty:hidden",children:Object.entries(m).map(([B,O])=>f("span",{class:"empty:hidden",children:e(O)},B))})]})})]})]})})},sr=()=>{const{t:e}=q(),{base_url:t,payment_button_type:n,publishable_api_key:r,apple_pay:o,payment_options:a,currency:i,supported_networks:s,decimalAmount:u,statement_descriptor:l,setFormSettings:d}=L(j),{makePayment:c}=ge({defaultError:{}});function h(){if(!ApplePaySession)return;const p=(o==null?void 0:o.label)||(a==null?void 0:a.label),b={countryCode:(o==null?void 0:o.country)||(a==null?void 0:a.country),currencyCode:i,supportedNetworks:s,merchantCapabilities:o.merchant_capabilities,total:{label:p,amount:u}},m=new ApplePaySession(o.version,b);m.onvalidatemerchant=y=>{const v={validation_url:y.validationURL,display_name:p,domain_name:window.location.hostname,publishable_api_key:r},w=o.validate_merchant_url||`${t}/v1/applepay/initiate`;fetch(w,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(v)}).then(k=>k.ok?k:Promise.reject(k)).then(k=>k.json()).then(k=>{m.completeMerchantValidation(k)}).catch(k=>{console.error("Apple Pay error:",k),d(x=>R(S({},x),{apiError:e("error.applePay")})),m.abort()})},m.onpaymentauthorized=y=>{const v={source:{type:"applepay",token:JSON.stringify(y.payment.token)}};l&&(v.statement_descriptor=l);function w(x){var T;console.error(x),m.completePayment({status:ApplePaySession.STATUS_FAILURE,errors:[]});let P="Payment failed.";x instanceof Response?P+=" Error: "+x.statusText:typeof x=="string"?P+=" Error: "+x:x.status==="failed"&&(P+=" Error: "+((T=x.source)==null?void 0:T.message)),d(D=>R(S({},D),{apiError:P}))}function k(x){console.error(x),m.completePayment({status:ApplePaySession.STATUS_SUCCESS})}c({data:v,onFailed:w,onSuccess:k}).catch(x=>{console.error(x)})},m.oncancel=()=>{try{m.abort()}catch(y){console.error(y)}},m.begin()}return f("button",{class:"apple-pay-button",style:{"-apple-pay-button-type":n},onClick:h})},lr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAeEAAABLCAMAAABwZM8AAAADAFBMVEUAAAD////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////9/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f3+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/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694v9AJX1ZAX0mLyg6ckX/tm6b0fL7x68ZaLqxqt9lQLQ8xPTGhYsvP3mWZ/6GHAmDxfAXjKYDIXOIRTEDVvJwaEl/VCLKxNXsTI0vk0eO0elYPtce87Fl8+aM+vyi4fUmulbQu0jwJC6vFu8hWaI7AvAGfz6s/q+tco+WifD5hKZkLanPWo7uZ5bZNaUyQSQhow/7Uzvd//cXCNo6FfG8UoBGHf3hj1v5nLtR7Y1zaoLqRlQfMTsay9LrRRhwsGsUCwJqVViVO85pDOXlFai82v6VfSTFOhmCKmK01UJ0YWnlH1Zv+4/YuSQXnbpiZKPUKGW3gg9RDnjkEpppXiSv7fgGx7L+67vz/9CotKWr7y1xuZCsEFMMrzeSixvg0YVHxiUd3Mp3y8Y0NF+qP6PncqDxo+tn7WyuoQrEKzBKspWqqg0RLdf+bSlSnAlIqoz8mle1UhXICTG20D7q3VVP6sC4ZRKLKsu4QqEQN+j5qgUjK1uwxUIbe8G9mlzleBKhLBqcZ++XDXSFQiFSyiwl7VU/awKRHRNjkdLqku4AiEx6E0qhNqyjpHVbbgCodFoE8NPQKGKSoOA2kGncm+hnb5QZbgiUWNkZyOHVb2sKqr4QEIadOJl/R9/eIVAmWuIbgAAAABJRU5ErkJggg==",cr=()=>{const{payment_button_type:e,samsung_pay:t,payment_options:n,supported_networks:r,currency:o,decimalAmount:a,setFormSettings:i}=L(j),[s,u]=N(!1),[l,d]=N(!1),{makePayment:c}=ge({defaultError:{}}),{t:h}=q(),p=$(null);Z(()=>{let m=null;return s||(m=setInterval(()=>{window.SamsungPay&&u(!0)},100)),()=>{clearInterval(m)}},[s]);const _=ce(()=>{if(!(!s||!t))return new SamsungPay.PaymentClient({environment:t.environment})},[s]);if(Z(()=>X(this,null,function*(){if(!_||!t)return;const m=r==null?void 0:r.map(v=>v.toLowerCase()),y={version:t.version.toString(),serviceId:t.service_id,protocol:"PROTOCOL_3DS",allowedBrands:m};p.current=()=>X(this,null,function*(){const{order_number:v,id:w,country:k,label:x}=t,P=x||(n==null?void 0:n.label),T=k||(n==null?void 0:n.country),D={orderNumber:v,merchant:{name:P,id:w,countryCode:T,url:window.location.hostname},amount:{option:"FORMAT_TOTAL_ESTIMATED_AMOUNT",currency:o,total:a}},z=()=>{_.notify({status:"CHARGED",provider:"Moyasar"})},A=C=>{var te;_.notify({status:"REJECTED",provider:"Moyasar"});let G="Payment failed.";C instanceof Payment&&C.isFailed()?G+=" Error: "+((te=C.source)==null?void 0:te.message):C instanceof Response?G+=" Error: "+C.statusText:typeof C=="string"&&(G+=" Error: "+C),console.log("Samsung Pay error: ",G)};try{const C=yield _.loadPaymentSheet(y,D);c({initPayment:!0,data:{source:{type:"samsungpay",token:C["3DS"].data}},onFailed:A,onSuccess:z})}catch(C){try{_.notify({status:"ERRED",provider:"Moyasar"})}catch(G){}console.log("Samsung Pay error: ",C)}});try{(yield _.isReadyToPay(y)).result?d(!0):i(w=>R(S({},w),{apiError:"Cannot initialize Samsung Pay"}))}catch(v){try{_.notify({status:"ERRED",provider:"Moyasar"})}catch(w){}i(w=>R(S({},w),{apiError:"Cannot initialize Samsung Pay"})),console.error("Samsung Pay Error: ",v)}}),[_,t]),!s||!l)return null;const b=e==="pay"?"pay-with":e;return f("button",{class:"flex h-11 w-full items-center justify-center gap-1 rounded-md bg-black text-white",onClick:p.current,children:[f("span",{children:h(`button.${b}`)}),f("img",{src:lr,alt:"",class:"-mb-[3px] h-[22px]"}),f("div",{class:"mb-0.5 h-[9px] w-[9px] rotate-45 rounded-sm border-r-[3px] border-t-[3px] border-white"})]})},ur=()=>{const{language:e,payment_button_type:t,google_pay:n,payment_options:r,supported_networks:o,currency:a,decimalAmount:i,setFormSettings:s}=L(j),[u,l]=N(!1),{makePayment:d}=ge({defaultError:{}});Z(()=>{let h=null;return u||(h=setInterval(()=>{var p,_;(_=(p=window.google)==null?void 0:p.payments)!=null&&_.api&&l(!0)},100)),()=>{clearInterval(h)}},[u]);const c=ce(()=>{if(u)return new google.payments.api.PaymentsClient({environment:n.environment})},[u]);return Z(()=>X(this,null,function*(){const h=document.getElementById("googlePay-container");if(!c||!n||(h==null?void 0:h.children.length)>=1)return;n.merchant_id;const p=o==null?void 0:o.filter(P=>P!=="mada").map(P=>P.toUpperCase()),_=n.auth_methods,b={apiVersion:2,apiVersionMinor:0},m={type:"CARD",parameters:{allowedAuthMethods:_,allowedCardNetworks:p}},y=Object.assign({},b);y.allowedPaymentMethods=[m];const v=()=>X(this,null,function*(){const{country:P,label:T,merchant_id:D}=n,z=T||(r==null?void 0:r.label),A=P||(r==null?void 0:r.country),C=R(S({},b),{allowedPaymentMethods:[x],merchantInfo:{merchantId:D,merchantName:z},transactionInfo:{countryCode:A,currencyCode:a,totalPriceStatus:"FINAL",totalPrice:i}});try{const G=yield c.loadPaymentData(C);d({initPayment:!0,data:{source:{type:"googlepay",token:G.paymentMethodData.tokenizationData.token}}})}catch(G){console.error(G)}}),w=()=>{const P=c.createButton({onClick:v,buttonLocale:e,buttonColor:"black",buttonType:t,buttonRadius:6,buttonSizeMode:"fill"});h.appendChild(P)},k={type:"PAYMENT_GATEWAY",parameters:{gateway:"moyasar",gatewayMerchantId:n.gateway_merchant_id}},x=Object.assign({},m,{tokenizationSpecification:k});try{(yield c.isReadyToPay(y)).result?w():s(T=>R(S({},T),{apiError:"Cannot initialize Google Pay"}))}catch(P){s(T=>R(S({},T),{apiError:"Cannot initialize Google Pay"})),console.error("Google Pay Error: ",P)}}),[c,n]),u?f("div",{id:"googlePay-container",class:"flex h-11 items-center justify-center rounded-md bg-black empty:hidden"}):null},dr=()=>{const{t:e}=q(),{methods:t,apple_pay:n,samsung_pay:r,google_pay:o}=L(j),a=t.includes("stcpay"),i=t.includes("creditcard"),s=location.protocol==="https:"&&t.includes("applepay")&&typeof window.ApplePaySession!="undefined"&&ApplePaySession.canMakePayments()&&(n==null?void 0:n.version)&&ApplePaySession.supportsVersion(n==null?void 0:n.version),u=!!(r!=null&&r.service_id),l=!!(o!=null&&o.merchant_id);return!s&&!a&&!u&&!l?null:f("div",{class:"flex w-full flex-col gap-4",role:"main",children:[a&&f(ir,{}),s&&f(sr,{}),u&&f(cr,{}),l&&f(ur,{}),i&&f("p",{class:"flex items-center gap-4",children:[f("hr",{class:"grow bg-neutral-300"}),f("span",{class:"text-neutral-800/90",children:e("form.or_pay_with_card")}),f("hr",{class:"grow bg-neutral-300"})]})]})},rt=["mada","visa","amex","masterCard"],ot=["creditcard","applepay","stcpay","samsungpay"],at=["supports3DS","supportsCredit","supportsDebit","supportsEMV"],pr=["pay","buy","plain","book","check-out","subscribe","add-money","contribute","order","reload","rent","support","tip","top-up","continue"],en={ADP:0,AFN:0,ALL:0,AMD:0,BHD:3,BIF:0,BYN:2,BYR:0,CAD:2,CHF:2,CLF:4,CLP:0,COP:0,CRC:0,CZK:0,default:2,DJF:0,DKK:2,ESP:0,GNF:0,GYD:0,HUF:0,IDR:0,IQD:0,IRR:0,ISK:0,ITL:0,JOD:3,JPY:0,KMF:0,KPW:0,KRW:0,KWD:3,LAK:0,LBP:2,LUF:0,LYD:3,MGA:0,MGF:0,MMK:0,MNT:0,MRO:0,MUR:0,NOK:0,OMR:3,PKR:0,PYG:0,RSD:0,RWF:0,SEK:0,SLL:0,SOS:0,STD:0,SYP:0,TMM:0,TND:3,TRL:0,TWD:0,TZS:0,UGX:0,UYI:0,UYW:4,UZS:0,VEF:0,VND:0,VUV:0,XAF:0,XOF:0,XPF:0,YER:0,ZMK:0,ZWD:0},fr=["22337902","22337986","22402030","40177800","403024","40545400","406136","406996","40719700","40728100","40739500","407520","409201","410621","410685","410834","412565","417633","419593","420132","421141","42222200","422817","422818","422819","428331","428671","428672","428673","431361","432328","434107","439954","440533","440647","440795","442429","442463","445564","446393","446404","446672","45488707","45501701","455036","455708","457865","457997","458456","462220","468540","468541","468542","468543","474491","483010","483011","483012","484783","486094","486095","486096","489318","489319","49098000","49098001","492464","504300","513213","515079","516138","520058","521076","52166100","524130","524514","524940","529415","529741","530060","531196","535825","535989","536023","537767","53973776","543085","543357","549760","554180","555610","558563","588845","588848","588850","604906","636120","968201","968202","968203","968204","968205","968206","968207","968208","968209","968211","968212"],tn=e=>{const t=!e,n=/^[a-zA-Z\-\s]+$/.test(e),r=/^[a-zA-Z-]+\s+?([a-zA-Z-]+\s?)+$/.test(e);return{isEmpty:t,isEnglishOnly:n,isValidFormat:r,isValid:!t&&n&&r}},mr=({value:e,setValue:t,err:n,setErr:r})=>{const{t:o}=q(),[a,i]=N(!1),s=d=>{const c=d.target.value.trim(),{isEmpty:h,isEnglishOnly:p,isValidFormat:_}=tn(c);if(h){i(!c);return}if(!p){r(b=>R(S({},b),{name:"validation.should_be_english_letters_only"}));return}if(!_){r(b=>R(S({},b),{name:"validation.first_and_last_name_required"}));return}i(!1),r(b=>R(S({},b),{name:""}))},u=d=>{const c=d.target,{value:h}=c;t(h)},l=fe(s,1e3);return f("div",{class:"space-y-2",role:"complementary","aria-label":o("form.name_on_card"),children:[f("div",{class:"flex items-end justify-between text-xs font-medium",children:[f("label",{for:"mysr-cc-name",children:o("form.name_on_card")}),a&&f("span",{class:"uppercase text-error",children:o("form.required")})]}),f(pe,{name:"mysr-cc-name",placeholder:o("form.name_on_card"),onBlur:s,class:n.name?"shadow-input-error":"",autocomplete:"cc-name",dir:"ltr",value:e,onKeyUp:d=>{u(d),l(d)},onChange:u}),n.name&&f("p",{class:"text-xs font-medium text-error",children:o(n.name)})]})},nn=(e,t)=>{const n=t==="amex"?/^\d{4}$/.test(e):/^\d{3}$/.test(e);return{isValid:n,msg:n?"":"error.invalid_csc"}},Ne=Xe({}),hr=({setValue:e})=>{const{t}=q(),{handleBlur:n,err:r}=L(Ne),o="** / **",a=s=>{const u=s.target,{value:l}=u;e(l)},i=fe(n,1e3);return Z(()=>{new Ie('[name="mysr-cc-exp"]')},[]),f(pe,{"aria-label":t("form.date"),name:"mysr-cc-exp",onBlur:n,class:"rounded-none rounded-bl-lg",placeholder:"MM / YY",autocomplete:"cc-exp",inputMode:"numeric",maxLength:o.length,"data-maska":o,"data-maska-eager":!0,onKeyUp:s=>{a(s),i(s)},error:r.exp})},_r=({value:e,setValue:t})=>{const{t:n}=q(),{handleBlur:r,err:o,config:a}=L(Ne),i=u=>{const l=u.target,{value:d}=l;t(d)},s=fe(r,1e3);return f(pe,{"aria-label":n("form.csc"),name:"mysr-cc-csc",onBlur:r,class:"rounded-none rounded-br-lg",placeholder:"CVC",autocomplete:"cc-csc",inputMode:"numeric",maxLength:a.csc,value:e,onKeyUp:u=>{i(u),s(u)},error:o.csc})},yr=e=>/^4/.test(H(e)),vr=e=>/^(?:5[1-5][0-9]{2}|222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)/.test(H(e)),rn=e=>/^3[47]/.test(H(e)),on=e=>{const t=H(e),n=t.slice(0,6),r=t.slice(0,8);for(const o of fr)if(o==n||o==r)return!0;return!1},it=()=>{const{supported_networks:e}=L(j);function t(n){let r="";return yr(n)&&(r="visa"),vr(n)&&(r="masterCard"),rn(n)&&(r="amex"),on(n)&&(r="mada"),r===""||!e.includes(r)?"":r}return{getCardSchema:t}},gr=({value:e,setValue:t})=>{const{t:n}=q(),{handleBlur:r,err:o,setType:a}=L(Ne),{getCardSchema:i}=it(),s=l=>{const d=l.target,{value:c}=d;t(c),a(i(c))},u=fe(r,1e3);return Z(()=>{new Ie('[name="mysr-cc-number"]',{mask:l=>rn(l)?"#### ###### #####":"#### #### #### ####"})},[]),f(pe,{"aria-label":n("form.cc"),name:"mysr-cc-number",placeholder:"1234 5678 9101 1121",onBlur:r,class:"col-span-full rounded-b-none",autocomplete:"cc-number",inputMode:"numeric",value:e,onKeyUp:l=>{s(l),u(l)},onChange:s,error:o.cc})},br="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20width='100%25'%20height='100%25'%20viewBox='0%200%2096%2064'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20xml:space='preserve'%20xmlns:serif='http://www.serif.com/'%20style='fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;'%3e%3cpath%20d='M95,6.894c0,-3.253%20-2.641,-5.894%20-5.894,-5.894l-82.212,0c-3.253,0%20-5.894,2.641%20-5.894,5.894l0,50.212c0,3.253%202.641,5.894%205.894,5.894l82.212,0c3.253,0%205.894,-2.641%205.894,-5.894l0,-50.212Z'%20style='fill:%23fff;stroke:%237e7e7e;stroke-width:0.5px;'/%3e%3cclipPath%20id='_clip1'%3e%3crect%20x='7.179'%20y='18.832'%20width='81.642'%20height='26.336'/%3e%3c/clipPath%3e%3cg%20clip-path='url(%23_clip1)'%3e%3cg%3e%3cpath%20d='M47.418,19.387l-5.431,25.384l-6.567,0l5.432,-25.384l6.566,0Zm27.627,16.39l3.457,-9.532l1.989,9.532l-5.446,0Zm7.326,8.994l6.074,0l-5.3,-25.384l-5.607,0c-1.259,0%20-2.323,0.733%20-2.795,1.863l-9.852,23.521l6.895,0l1.37,-3.79l8.424,-0l0.791,3.79Zm-17.137,-8.287c0.028,-6.701%20-9.267,-7.069%20-9.201,-10.062c0.019,-0.912%200.887,-1.879%202.784,-2.127c0.943,-0.123%203.534,-0.218%206.476,1.136l1.152,-5.383c-1.58,-0.574%20-3.614,-1.125%20-6.143,-1.125c-6.49,-0%20-11.059,3.451%20-11.097,8.391c-0.041,3.655%203.261,5.693%205.75,6.908c2.557,1.245%203.417,2.041%203.406,3.154c-0.017,1.704%20-2.041,2.455%20-3.929,2.485c-3.302,0.052%20-5.218,-0.892%20-6.745,-1.603l-1.19,5.562c1.534,0.705%204.365,1.317%207.303,1.348c6.898,0%2011.411,-3.408%2011.434,-8.684Zm-27.2,-17.097l-10.639,25.384l-6.942,0l-5.235,-20.258c-0.318,-1.248%20-0.595,-1.705%20-1.562,-2.23c-1.576,-0.857%20-4.183,-1.66%20-6.477,-2.158l0.157,-0.738l11.173,0c1.423,0%202.705,0.948%203.028,2.588l2.765,14.69l6.833,-17.278l6.899,0Z'%20style='fill:%230d357f;fill-rule:nonzero;'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",wr="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20width='100%25'%20height='100%25'%20viewBox='0%200%2096%2064'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20xml:space='preserve'%20xmlns:serif='http://www.serif.com/'%20style='fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;'%3e%3cpath%20d='M95,7.094c0,-3.363%20-2.731,-6.094%20-6.094,-6.094l-81.812,0c-3.363,0%20-6.094,2.731%20-6.094,6.094l-0,49.812c-0,3.363%202.731,6.094%206.094,6.094l81.812,0c3.363,0%206.094,-2.731%206.094,-6.094l0,-49.812Z'%20style='fill:%23fff;stroke:%23b1b1b1;stroke-width:0.5px;'/%3e%3cpath%20d='M95,6.894c0,-3.253%20-2.641,-5.894%20-5.894,-5.894l-82.212,0c-3.253,0%20-5.894,2.641%20-5.894,5.894l0,50.212c0,3.253%202.641,5.894%205.894,5.894l82.212,0c3.253,0%205.894,-2.641%205.894,-5.894l0,-50.212Z'%20style='fill:%23fff;stroke:%237e7e7e;stroke-width:0.5px;'/%3e%3cg%20opacity='0'%3e%3crect%20x='14.04'%20y='9.539'%20width='67.919'%20height='44.921'%20style='fill:%23fff;'/%3e%3c/g%3e%3crect%20x='39.044'%20y='17.366'%20width='17.917'%20height='29.263'%20style='fill:%23ff5f00;'/%3e%3cpath%20d='M40.89,32c-0.005,-5.706%202.619,-11.106%207.107,-14.629c-3.278,-2.576%20-7.329,-3.978%20-11.498,-3.978c-10.209,0%20-18.61,8.401%20-18.61,18.61c0,10.208%208.401,18.609%2018.61,18.609c4.169,-0%208.22,-1.401%2011.498,-3.978c-4.489,-3.524%20-7.113,-8.927%20-7.107,-14.634Z'%20style='fill:%23eb001b;fill-rule:nonzero;'/%3e%3cpath%20d='M76.33,43.533l0,-0.6l0.259,0l-0,-0.124l-0.615,-0l-0,0.124l0.242,0l0,0.6l0.114,-0Zm1.194,-0l0,-0.724l-0.186,-0l-0.217,0.517l-0.217,-0.517l-0.186,-0l-0,0.724l0.134,-0l0,-0.548l0.202,0.47l0.139,0l0.202,-0.47l0,0.548l0.129,-0Z'%20style='fill:%23f79e1b;fill-rule:nonzero;'/%3e%3cpath%20d='M78.108,32c0,10.209%20-8.4,18.609%20-18.609,18.609c-4.171,-0%20-8.223,-1.402%20-11.502,-3.98c4.487,-3.526%207.111,-8.926%207.111,-14.632c-0,-5.705%20-2.624,-11.106%20-7.111,-14.631c3.279,-2.578%207.331,-3.98%2011.502,-3.98c10.209,-0%2018.609,8.4%2018.609,18.609l0,0.005Z'%20style='fill:%23f79e1b;fill-rule:nonzero;'/%3e%3c/svg%3e",kr="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20width='100%25'%20height='100%25'%20viewBox='0%200%2096%2064'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20xml:space='preserve'%20xmlns:serif='http://www.serif.com/'%20style='fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;'%3e%3cpath%20d='M95,7.053c0,-3.341%20-2.712,-6.053%20-6.053,-6.053l-81.894,-0c-3.341,-0%20-6.053,2.712%20-6.053,6.053l0,49.894c0,3.341%202.712,6.053%206.053,6.053l81.894,0c3.341,0%206.053,-2.712%206.053,-6.053l0,-49.894Z'%20style='fill:%23006fcf;stroke:%237e7e7e;stroke-width:0.5px;'/%3e%3cg%3e%3cpath%20d='M54.459,9.71l-10.404,23.609l8.342,0l0,21.172l26.31,0l4.061,-4.51l4.063,4.534l7.933,0l0,-2.672l-6.538,0l-5.395,-5.867l-5.44,5.88l-22.088,0l0,-18.444l22.202,0l5.408,5.938l5.476,-5.963l6.352,-0l0,-2.626l-4.935,-0l-0,-12.769l-4.686,12.699l-4.45,0l-4.823,-12.608l0,12.647l-10.546,0l-1.49,-3.637l-8.559,0l-1.457,3.589l-5.544,0l8.116,-18.39l6.498,-0l8.058,18.438l-0,-18.443l7.875,-0l4.161,11.351l4.127,-11.364l7.714,0.003l0,-2.656l-9.767,-0l-2.048,5.839l-2.2,-5.8l-12.552,-0l-0.077,7.83l-3.474,-7.76l-10.223,-0.02Z'%20style='fill:%23fff;'/%3e%3cpath%20d='M59.526,16.941l-2.53,5.961l5.011,0l-2.481,-5.961Z'%20style='fill:%23fff;'/%3e%3cpath%20d='M60.312,37.605l10.641,-0l0,-4.147l8.738,9.184l-8.621,9.204l-0.101,0l0,-4.221l-10.669,-0l-0,-2.905l10.397,0l-0,-4.077l-10.397,0l0.012,-3.038Z'%20style='fill:%23fff;'/%3e%3cpath%20d='M94.723,47.865l0,3.969l-8.581,-9.23l8.59,-9.225l-0,3.95l-4.946,5.265l4.937,5.271Z'%20style='fill:%23fff;'/%3e%3c/g%3e%3c/svg%3e",xr="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20width='100%25'%20height='100%25'%20viewBox='0%200%2096%2064'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20xml:space='preserve'%20xmlns:serif='http://www.serif.com/'%20style='fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;'%3e%3cpath%20d='M95,6.894c0,-3.253%20-2.641,-5.894%20-5.894,-5.894l-82.212,0c-3.253,0%20-5.894,2.641%20-5.894,5.894l0,50.212c0,3.253%202.641,5.894%205.894,5.894l82.212,0c3.253,0%205.894,-2.641%205.894,-5.894l0,-50.212Z'%20style='fill:%23fff;stroke:%237e7e7e;stroke-width:0.5px;'/%3e%3cg%3e%3crect%20x='5.311'%20y='34.182'%20width='36.116'%20height='12.031'%20style='fill:%2384b740;'/%3e%3crect%20x='5.311'%20y='17.765'%20width='36.116'%20height='12.042'%20style='fill:%23259bd6;'/%3e%3cpath%20d='M77.542,43.769l-0.161,0.032c-0.557,0.107%20-0.761,0.15%20-1.168,0.15c-0.944,-0%20-2.059,-0.483%20-2.059,-2.756c-0,-1.169%200.193,-2.724%201.951,-2.724l0.011,0c0.3,0.022%200.644,0.054%201.287,0.247l0.139,0.043l0,5.008Zm0.29,-11.335l-0.29,0.054l0,4.203l-0.257,-0.075l-0.075,-0.021c-0.29,-0.086%20-0.954,-0.279%20-1.598,-0.279c-3.517,0%20-4.257,2.659%20-4.257,4.89c0,3.056%201.716,4.815%204.708,4.815c1.265,-0%202.198,-0.129%203.141,-0.44c0.869,-0.279%201.18,-0.676%201.18,-1.523l-0,-12.063c-0.836,0.15%20-1.705,0.3%20-2.552,0.439'%20style='fill:%2327292d;fill-rule:nonzero;'/%3e%3cpath%20d='M87.997,43.844l-0.15,0.043l-0.536,0.139c-0.504,0.129%20-0.954,0.204%20-1.297,0.204c-0.826,-0%20-1.319,-0.408%20-1.319,-1.105c-0,-0.45%200.203,-1.211%201.555,-1.211l1.747,-0l0,1.93Zm-1.233,-7.582c-1.083,0%20-2.198,0.193%20-3.581,0.622l-0.901,0.268l0.3,2.038l0.88,-0.29c0.922,-0.3%202.069,-0.493%202.927,-0.493c0.386,0%201.566,0%201.566,1.276l-0,0.558l-1.641,-0c-2.992,-0%20-4.375,0.954%20-4.375,3.002c-0,1.748%201.276,2.799%203.421,2.799c0.664,-0%201.587,-0.129%202.38,-0.322l0.043,-0.01l0.043,0.01l0.268,0.043c0.836,0.15%201.705,0.3%202.552,0.461l0,-6.691c0,-2.166%20-1.308,-3.271%20-3.882,-3.271'%20style='fill:%2327292d;fill-rule:nonzero;'/%3e%3cpath%20d='M67.162,43.844l-0.15,0.043l-0.536,0.139c-0.504,0.129%20-0.944,0.204%20-1.297,0.204c-0.826,-0%20-1.319,-0.408%20-1.319,-1.105c-0,-0.45%200.203,-1.211%201.544,-1.211l1.748,-0l0.01,1.93Zm-1.222,-7.582c-1.094,0%20-2.198,0.193%20-3.582,0.622l-0.9,0.268l0.3,2.038l0.879,-0.29c0.922,-0.3%202.07,-0.493%202.928,-0.493c0.386,0%201.565,0%201.565,1.276l0,0.558l-1.641,-0c-2.991,-0%20-4.385,0.954%20-4.385,3.002c-0,1.748%201.276,2.799%203.431,2.799c0.665,-0%201.587,-0.129%202.381,-0.322l0.043,-0.01l0.042,0.01l0.258,0.043c0.847,0.15%201.705,0.3%202.552,0.472l-0,-6.691c0.011,-2.188%20-1.298,-3.282%20-3.871,-3.282'%20style='fill:%2327292d;fill-rule:nonzero;'/%3e%3cpath%20d='M55.871,36.284c-1.362,-0%20-2.488,0.45%20-2.906,0.643l-0.107,0.054l-0.097,-0.075c-0.579,-0.418%20-1.426,-0.633%20-2.606,-0.633c-1.04,0%20-2.016,0.15%20-3.077,0.461c-0.912,0.279%20-1.266,0.719%20-1.266,1.544l0,7.646l2.853,0l-0,-7.067l0.139,-0.042c0.579,-0.193%200.922,-0.226%201.255,-0.226c0.826,0%201.244,0.44%201.244,1.298l-0,6.048l2.809,-0l0,-6.166c0,-0.365%20-0.075,-0.579%20-0.086,-0.622l-0.096,-0.182l0.193,-0.086c0.429,-0.193%200.901,-0.29%201.394,-0.29c0.568,0%201.244,0.226%201.244,1.298l-0,6.048l2.799,-0l-0,-6.327c-0,-2.241%20-1.201,-3.324%20-3.689,-3.324'%20style='fill:%2327292d;fill-rule:nonzero;'/%3e%3cpath%20d='M85.896,25.614c-0.419,0%20-1.116,-0.043%20-1.662,-0.15l-0.161,-0.032l-0,-4.128c-0,-0.344%20-0.065,-0.558%20-0.075,-0.59l-0.086,-0.172l0.182,-0.075c0.043,-0.021%200.086,-0.032%200.14,-0.053l0.032,-0.022c0.064,-0.021%200.128,-0.043%200.193,-0.064c0.032,-0.011%200.053,-0.022%200.075,-0.022c0.633,-0.171%201.212,-0.15%201.469,-0.171l0.011,-0c1.748,-0%201.951,1.555%201.951,2.723c-0.01,2.274%20-1.136,2.756%20-2.069,2.756m-0.011,-7.849l-0.075,-0c-1.641,-0%20-3.324,0.45%20-3.925,1.33c-0.321,0.429%20-0.504,0.965%20-0.514,1.597l-0,4.258c-0,0.364%20-0.076,0.504%20-0.086,0.536l-0.097,0.182l-5.179,-0l-0,-2.96l-0.011,0c-0.064,-3.12%20-1.909,-4.836%20-4.579,-4.836l-2.605,0c-0.108,0.762%20-0.193,1.298%20-0.301,2.059l2.595,0c1.362,0%202.081,1.158%202.081,2.938l-0,2.981l-0.183,-0.096c-0.032,-0.011%20-0.257,-0.086%20-0.611,-0.086l-4.482,-0c-0.086,0.568%20-0.193,1.308%20-0.311,2.048l13.779,0c0.472,-0.096%201.019,-0.182%201.491,-0.257c0.697,0.343%201.994,0.525%202.884,0.525c2.992,0%204.933,-2.005%204.933,-5.093c-0.011,-3.056%20-1.887,-5.062%20-4.804,-5.126'%20style='fill:%2327292d;fill-rule:nonzero;'/%3e%3cpath%20d='M57.78,28.971l4.074,-0c2.992,-0%204.386,-0.987%204.386,-3.421c0,-1.748%20-1.276,-3.142%20-3.421,-3.142l-2.755,0c-0.826,0%20-1.319,-0.472%20-1.319,-1.265c-0,-0.536%200.203,-1.201%201.554,-1.201l6.027,-0c0.129,-0.783%200.193,-1.276%200.311,-2.059l-6.262,-0c-2.917,-0%20-4.386,1.222%20-4.386,3.26c-0,2.016%201.276,3.067%203.42,3.067l2.756,-0c0.826,-0%201.319,0.654%201.319,1.34c0,0.45%20-0.203,1.383%20-1.544,1.383l-0.461,0l-8.825,-0.021l-1.609,-0c-1.361,-0%20-2.316,-0.772%20-2.316,-2.563l0,-1.233c0,-1.866%200.74,-3.024%202.316,-3.024l2.617,-0c0.118,-0.794%200.193,-1.298%200.3,-2.048l-3.571,-0c-2.67,-0%20-4.514,1.791%20-4.579,4.911l0,1.394c0.065,3.12%201.909,4.611%204.579,4.611l2.606,-0l4.783,0.011Z'%20style='fill:%2327292d;fill-rule:nonzero;'/%3e%3c/g%3e%3c/svg%3e",Pr=({type:e})=>{const t="h-4 sm:h-5 w-auto object-contain object-center";return f("div",{class:"absolute right-2 top-1/4 z-[2] flex -translate-y-1/2 items-center gap-1",children:[{alt:"AMEX",src:kr},{alt:"MADA",src:xr},{alt:"Visa",src:br},{alt:"MasterCard",src:wr}].filter(r=>e!==""?e.toLowerCase()===r.alt.toLowerCase():!0).map(r=>f("img",{class:t,alt:r.alt,src:r.src,loading:"lazy"}))})},an=e=>{const t="#### #### #### ####",n={mask:t,validator:o=>/^(?:5[1-5][0-9]{2}|222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}$/.test(H(o)),csc:3},r={amex:{mask:"#### ###### #####",validator:o=>/^3[47][0-9]{13}$/.test(H(o)),csc:4},mada:{mask:t,validator:o=>on(o)&&/\d{16}/.test(H(o)),csc:3},visa:{mask:t,validator:o=>/^4[0-9]{12}(?:[0-9]{3})?$/.test(H(o)),csc:3},mastercard:n,masterCard:n};return e===""?r.visa:r[e]},sn=e=>{const[t,n]=e.split("/"),r=parseInt(t.trim()),o=r>=1&&r<=12,a=parseInt(n==null?void 0:n.trim()),i=Number.isNaN(a)||a<+new Date().getFullYear().toString().slice(-2)||a>99,s=/^\d{2} ?\/ ?\d{2}$/.test(e);return{isValidExpFormat:s,isValidYear:!i,inValidMonth:o,isValid:s&&!i&&o}},Er=e=>{const t=[0,2,4,6,8,1,3,5,7,9];if(typeof e!="string")throw new TypeError("Expected string input");if(!e)return!1;let n=e.length,r=!0,o=0;for(;n;){const a=e.charCodeAt(--n)-48;if(a<0||a>9)return!1;r=!r,o+=r?t[a]:a}return o%10===0},ln=()=>{const{getCardSchema:e}=it();function t(n,r){const o=r||e(n);if(!o&&n.length>3)return!1;const{validator:a}=an(o),i=a(n),s=Er(n);return i&&s}return{isValidCc:t}},Sr=({cc:e,setCc:t,cvc:n,setCvc:r,exp:o,setExp:a,err:i,setErr:s})=>{const{t:u}=q(),[l,d]=N(!1),[c,h]=N(""),{isValidCc:p}=ln(),_=Mt(()=>an(c),[c]),b=m=>{const{value:y,name:v}=m.target,w=H(y.trim());if(!w){d(!w);return}if(v==="mysr-cc-csc"){const{msg:k}=nn(w,c);s(x=>R(S({},x),{csc:k}))}if(v==="mysr-cc-exp"){const{isValidExpFormat:k,isValidYear:x,inValidMonth:P}=sn(w);s(T=>R(S({},T),{exp_month:P?"":"error.invalid_month",exp_year:x?"":"error.invalid_year",exp:k?"":"error.invalid_date"}))}v==="mysr-cc-number"&&s(k=>R(S({},k),{cc:c===""?"error.unsupported_cc_type":p(w)?"":"error.invalid_cc_number"}))};return Z(()=>{Object.values(i).filter(m=>m).length===0&&d(!1)},[i]),f(Ne.Provider,{value:{err:i,setErr:s,handleBlur:b,type:c,setType:h,config:_()},children:f("div",{class:"space-y-2",role:"complementary","aria-label":u("form.card_info"),children:[f("div",{class:"flex items-end justify-between text-xs font-medium",children:[f("legend",{children:u("form.card_info")}),l&&f("span",{class:"uppercase text-error",children:u("form.required")})]}),f("div",{class:"relative grid grid-cols-2 gap-y-[1px]",dir:"ltr",children:[f(gr,{value:e,setValue:t}),f(Pr,{type:c}),f(hr,{value:o,setValue:a}),f(_r,{value:n,setValue:r})]}),f("p",{class:"flex flex-col gap-2 text-xs font-medium text-error",children:Object.entries(i).filter(([m])=>m!=="name").map(([m,y])=>f("span",{class:"empty:hidden",children:u(y)},m))})]})})},Cr=()=>{const{t:e}=q(),{formattedAmount:t,isRtl:n,credit_card:r,statement_descriptor:o,callback_url:a,payment_button_type:i}=L(j),[s,u]=N(""),[l,d]=N(""),[c,h]=N(""),[p,_]=N(""),{getCardSchema:b}=it(),{isValidCc:m}=ln(),y={name:"",csc:"",cc:"",exp:"",exp_month:"",exp_year:""},{makePayment:v,busy:w,fail:k,success:x,loading:P,error:T,setError:D}=ge({defaultError:y});return f("form",{class:"space-y-6",onSubmit:C=>{C.preventDefault();const{isValid:G}=tn(s),te=H(l),Be=H(p),ze=H(c),we=b(te),me=m(te,we),{isValid:ke}=nn(ze,we),{isValid:je}=sn(Be);if(!G||!me||!ke||!je){const W=S({},y);G||(W.name=e("error.invalid_name")),me||(W.cc=e("error.invalid_cc_number")),ke||(W.csc=e("error.invalid_csc")),je||(W.exp=e("error.invalid_date")),D(W);return}const[dt,B]=Be.split("/"),O={type:"creditcard",name:s,number:te,month:dt,year:B,cvc:ze};r!=null&&r.manual&&(O.manual=!0),r!=null&&r.save_card&&(O.save_card=!0),o&&(O.statement_descriptor=o);function Y(W){const{transaction_url:io}=W.source;window.location.href=io}function ae(W){console.error(W)}v({data:{callback_url:a,source:O},initPayment:!0,onFailed:ae,onSuccess:Y}).catch(W=>{console.error(W)})},children:[f(mr,{value:s,setValue:u,err:T,setErr:D}),f(Sr,{cc:l,setCc:d,cvc:c,setCvc:h,exp:p,setExp:_,err:T,setErr:D}),f(et,{type:"submit",disabled:P,success:x,fail:k,busy:w,children:[(i!=="plain"||!n)&&e(`button.${i}`)," ",t]}),(r==null?void 0:r.save_card)&&f("p",{class:"flex items-center justify-center gap-2 text-xs text-primary-400",role:"complementary","aria-label":e("form.save_card_notice"),children:[f("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",class:"h-4 w-4 shrink-0",fill:"currentColor",children:f("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z","clip-rule":"evenodd"})}),e("form.save_card_notice")]})]})};var st=function(e,t){return st=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[o]=r[o])},st(e,t)};function Ar(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");st(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var ee=function(){return ee=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},ee.apply(this,arguments)};function Fe(e,t,n,r){function o(a){return a instanceof n?a:new n(function(i){i(a)})}return new(n||(n=Promise))(function(a,i){function s(d){try{l(r.next(d))}catch(c){i(c)}}function u(d){try{l(r.throw(d))}catch(c){i(c)}}function l(d){d.done?a(d.value):o(d.value).then(s,u)}l((r=r.apply(e,t||[])).next())})}function be(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,o,a,i;return i={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(l){return function(d){return u([l,d])}}function u(l){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(n=0)),n;)try{if(r=1,o&&(a=l[0]&2?o.return:l[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,l[1])).done)return a;switch(o=0,a&&(l=[l[0]&2,a.value]),l[0]){case 0:case 1:a=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,o=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){n.label=l[1];break}if(l[0]===6&&n.label<a[1]){n.label=a[1],a=l;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(l);break}a[2]&&n.ops.pop(),n.trys.pop();continue}l=t.call(e,n)}catch(d){l=[6,d],o=0}finally{r=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function Tr(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ue(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,a=[],i;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)a.push(o.value)}catch(s){i={error:s}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return a}function Le(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,a;r<o;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;function cn(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===0?function(n){return n}:e.length===1?e[0]:e.reduce(function(n,r){return function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];return n(r.apply(void 0,Le([],Ue(o),!1)))}})}function Dr(e){if(e)return Object.keys(e).forEach(function(t){typeof e[t]=="object"&&(e[t]=JSON.stringify(e[t])),e[t]=String(e[t])}),e}function un(e){if(e)return Object.keys(e).forEach(function(t){typeof e[t]=="string"||typeof e[t]=="boolean"||typeof e[t]=="number"||(e[t]=JSON.stringify(e[t]))}),e}function Mr(e){return typeof e=="object"&&typeof e.message!="undefined"}function Or(e){if(typeof e.stacktrace!="undefined"||typeof e["opera#sourceloc"]!="undefined"){var t=e.stacktrace,n=t===void 0?"":t;return n.split(`
9
9
  `).filter(function(a){return a!==""})}else if(e.stack){var r=e.stack,o=r===void 0?"":r;return o.split(`
10
- `).filter(function(a){return a!==""})}else return["No stacktrace available"]}function Rr(e){return Object.keys(e).map(function(t){return"".concat(encodeURIComponent(t),"=").concat(encodeURIComponent(e[t]))}).join("&")}function dn(){return Object.prototype.toString.call(typeof process!="undefined"?process:0)==="[object process]"}function Ve(){return dn()?global:typeof window!="undefined"?window:typeof self!="undefined"?self:{}}var Ir=function(){function e(t){this._data=t}return e.prototype.toJSON=function(){return JSON.stringify(this._data)},e.prototype.serialize=function(){return this._data},e}(),Nr="1.3.31",lt=function(){function e(){}return e.serialize=function(){return{transport:this.transport(),origin:this.origin()}},e.origin=function(){var t=Ve();return t.location?t.location.origin||"".concat(t.location.protocol,"//").concat(t.location.hostname):""},e.transport=function(){var t=Ve();return dn()&&typeof jest=="undefined"?"NodeHTTP":t.XDomainRequest?"XDomainRequest":t.XMLHttpRequest&&!t.fetch?"XMLHttpRequest":"fetch"},e.supportsPromises=function(){var t=Ve();return"Promise"in t&&"resolve"in t.Promise&&"reject"in t.Promise&&"all"in t.Promise&&"race"in t.Promise&&function(){var n;return new t.Promise(function(r){n=r}),typeof n=="function"}()},e}(),Fr=function(){function e(t){this.url=t}return e.prototype.send=function(t){var n=this;return new Promise(function(r,o){var a,i=new XDomainRequest,s=new RegExp("^https?:");i.onload=function(){return r({})},i.open("POST",n.url.replace(s,(a=window==null?void 0:window.location)===null||a===void 0?void 0:a.protocol)),setTimeout(function(){try{i.send(t)}catch(u){o(u)}},0)})},e}(),Ur=function(){function e(t){this.url=t}return e.prototype.send=function(t){var n=this;return new Promise(function(r,o){try{var a=new XMLHttpRequest;a.onreadystatechange=function(){a.readyState===XMLHttpRequest.DONE&&r({})},a.open("POST",n.url),a.send(t)}catch(i){o(i)}})},e}(),Lr=function(){function e(t,n){this.url=t}return e.prototype.send=function(t){return Fe(this,void 0,void 0,function(){var n,r,o;return be(this,function(a){switch(a.label){case 0:return[4,fetch(this.url,{method:"POST",body:t})];case 1:return n=a.sent(),r=n.statusText,o=n.ok,[2,o?Promise.resolve({}):Promise.reject({statusText:r})]}})})},e}(),Vr=function(){function e(t){this.url=t,this.https=Promise.resolve().then(()=>ao)}return e.prototype.send=function(t){var n=this,r={method:"POST",headers:{"Content-Type":"application/json","Content-Length":t.length}};return new Promise(function(o,a){n.https.then(function(i){var s=i.request(n.url,r,function(){}).on("error",function(u){return a(u)});s.write(t),s.end(),o({})}).catch(function(i){console.warn("NodeTransport is being used, but the HTTPS module could not be imported. No data will be sent to AppSignal."),a(i)})})},e}(),Gr=function(){function e(t){this._uri=t.uri||"https://appsignal-endpoint.net/collect",this._apiKey=t.key,this._clientVersion=t.version,this._transport=this._createTransport(this._url())}return e.prototype.push=function(t){return Fe(this,void 0,void 0,function(){return be(this,function(n){switch(n.label){case 0:return[4,this._transport.send(t.toJSON())];case 1:return n.sent(),[2,t]}})})},e.prototype._createTransport=function(t){switch(lt.transport()){case"XDomainRequest":return new Fr(t);case"XMLHttpRequest":return new Ur(t);case"NodeHTTP":return new Vr(t);default:return new Lr(t)}},e.prototype._url=function(){var t=this._authorization();return"".concat(this._uri,"?").concat(Rr(t))},e.prototype._authorization=function(){return{api_key:this._apiKey,version:this._clientVersion}},e}(),Ge=function(e){Ar(t,e);function t(n){return e.call(this,ee({timestamp:Math.round(new Date().getTime()/1e3),namespace:"frontend",error:{name:"NullError",message:"No error has been set",backtrace:[]}},n))||this}return t.prototype.setAction=function(n){return!n||typeof n!="string"?this:(this._data.action=n,this)},t.prototype.setNamespace=function(n){return!n||typeof n!="string"?this:(this._data.namespace=n,this)},t.prototype.setError=function(n){return!n||!Mr(n)?this:(this._data.error={name:n.name||"[unknown]",message:n.message,backtrace:Or(n)},this)},t.prototype.setTags=function(n){return this._data.tags=ee(ee({},this._data.tags),Dr(n)),this},t.prototype.setParams=function(n){return this._data.params=ee(ee({},this._data.params),n),this},t.prototype.setBreadcrumbs=function(n){return this._data.breadcrumbs=n,this},t}(Ir),Br=function(){function e(t){this._data=t||[]}return e.prototype.clear=function(){this._data=[]},e.prototype.values=function(){return this._data},e.prototype.push=function(t){var n;return Array.isArray(t)?(n=this._data).push.apply(n,Le([],Ue(t),!1)):this._data.push(t)},e.prototype.drain=function(){return be(this,function(t){switch(t.label){case 0:return this._data.length>0?[4,this._data.shift()]:[3,2];case 1:return t.sent(),[3,0];case 2:return[2]}})},e}(),zr=function(){function e(t,n,r){this._retries=0,this._timerID=0,this._duration=0,this._api=n,this._queue=t,this.options=ee({limit:5,initialDuration:1e3},r),this.reset()}return e.prototype.schedule=function(t){var n=this;t===void 0&&(t=this._duration);var r=Ve(),o=1.3,a=function(){return Fe(n,void 0,void 0,function(){var i,s,u,l,d,c,h;return be(this,function(p){switch(p.label){case 0:p.trys.push([0,7,8,9]),i=Tr(this._queue.drain()),s=i.next(),p.label=1;case 1:if(s.done)return[3,6];if(u=s.value,!u)return[2];p.label=2;case 2:return p.trys.push([2,4,,5]),[4,this._api.push(u)];case 3:return p.sent(),[3,5];case 4:return p.sent(),l=Math.floor(Math.pow(t,o)),this._retries=this._retries-1,this._retries===0?this.reset():(this._queue.push(u),this._timerID=this.schedule(l)),[2];case 5:return s=i.next(),[3,1];case 6:return[3,9];case 7:return d=p.sent(),c={error:d},[3,9];case 8:try{s&&!s.done&&(h=i.return)&&h.call(i)}finally{if(c)throw c.error}return[7];case 9:return this.reset(),[2]}})})};return r.setTimeout(a,t)},e.prototype.reset=function(){var t=this.options,n=t.limit,r=t.initialDuration;this._retries=n,this._duration=r},e}(),jr=function(){function e(t){this.VERSION=Nr,this.ignored=[],this._breadcrumbs=[],this._hooks={decorators:Array(),overrides:Array()},this._env=lt.serialize(),this._queue=new Br([]);var n=t.key,r=n===void 0?"":n,o=t.uri,a=t.revision,i=t.ignoreErrors;a&&typeof a!="string"&&(t.revision=String(a)),r===""&&console.info("[APPSIGNAL]: Started in development mode."),this._api=new Gr({key:r,uri:o,version:this.VERSION}),i&&Array.isArray(i)&&(this.ignored=i),this._dispatcher=new zr(this._queue,this._api),this._options=t}return e.prototype.send=function(t,n,r){var o=this;if(!(t instanceof Error)&&!(t instanceof Ge)&&!(t&&t.error instanceof Error)){console.error("[APPSIGNAL]: Can't send error, given error is not a valid type");return}var a;if("error"in t?a=t.error:a=t,this.ignored.length!==0){if(a&&"message"in a&&this.ignored.some(function(d){return d.test(a.message)})){console.warn("[APPSIGNAL]: Ignored an error: ".concat(a.message));return}if(a instanceof Ge){var i=a.serialize().error;if(i.message&&this.ignored.some(function(d){return d.test(i.message)})){console.warn("[APPSIGNAL]: Ignored a span: ".concat(i.message));return}}}var s=a instanceof Ge?a:this._createSpanFromError(a);if(this._hooks.decorators.length>0&&cn.apply(void 0,Le([],Ue(this._hooks.decorators),!1))(s),n)if(typeof n=="function"){var u=n;u(s)}else{console.warn("[APPSIGNAL]: DEPRECATED: Calling the `send`/`sendError` function with a tags object is deprecated. Use the callback argument instead.");var l=un(n)||{};s.setTags(l)}if(r&&(console.warn("[APPSIGNAL]: DEPRECATED: Calling the `send`/`sendError` function with a namespace is deprecated. Use the callback argument instead."),s.setNamespace(r)),this._breadcrumbs.length>0&&s.setBreadcrumbs(this._breadcrumbs),this._hooks.overrides.length>0&&cn.apply(void 0,Le([],Ue(this._hooks.overrides),!1))(s),lt.supportsPromises())if(this._breadcrumbs=[],!this._options.key)console.warn("[APPSIGNAL]: Span not sent because we're in development mode:",s);else return this._api.push(s).catch(function(){o._queue.push(s),setTimeout(function(){return o._dispatcher.schedule()},0)});else{console.error("[APPSIGNAL]: Error not sent. A Promise polyfill is required.");return}},e.prototype.sendError=function(t,n,r){return this.send(t,n,r)},e.prototype.use=function(t){t.call(this)},e.prototype.createSpan=function(t){var n=this._options,r=n.revision,o=r===void 0?"":r,a=n.namespace,i=new Ge({environment:this._env,revision:o});return a&&i.setNamespace(a),t&&typeof t=="function"&&t(i),i},e.prototype.wrap=function(t,n,r){return Fe(this,void 0,void 0,function(){var o;return be(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,,5]),[4,t()];case 1:return[2,a.sent()];case 2:return o=a.sent(),o instanceof Error||o instanceof ErrorEvent?[4,this.sendError(o,n,r)]:[3,4];case 3:a.sent(),a.label=4;case 4:return[2,Promise.reject(o)];case 5:return[2]}})})},e.prototype.addDecorator=function(t){this._hooks.decorators.push(t)},e.prototype.addOverride=function(t){this._hooks.overrides.push(t)},e.prototype.demo=function(){var t=this._createSpanFromError(new Error("Hello world! This is an error used for demonstration purposes."));t.setAction("TestAction").setParams({path:"/hello",method:"GET"}).setTags({demo_sample:"true"}),this.send(t)},e.prototype.addBreadcrumb=function(t){var n=ee(ee({timestamp:Math.round(new Date().getTime()/1e3)},t),{metadata:un(t.metadata)});if(!n.category){console.warn("[APPSIGNAL]: Breadcrumb not added. `category` is missing.");return}if(!n.action){console.warn("[APPSIGNAL]: Breadcrumb not added. `action` is missing.");return}this._breadcrumbs.length===20&&this._breadcrumbs.pop(),this._breadcrumbs.unshift(n)},e.prototype._createSpanFromError=function(t){var n=this.createSpan();return n.setError(t),n},e}();const Hr=new jr({key:"95fc54a8-f3ef-454c-b93d-e7e765de19f0",revision:kt});var Kr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(r[a]=o[a])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ct=function(){return ct=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},ct.apply(this,arguments)},Zr=function(e){Kr(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.state={error:void 0},n}return t.prototype.componentDidCatch=function(n,r){var o=this.props,a=o.instance,i=o.action,s=o.tags,u=n.name,l=n.message,d=n.stack,c=a.createSpan();c.setError({name:u,message:l,stack:d}).setTags(ct({framework:"Preact"},s)),i&&i!==""&&c.setAction(i),a.send(c),this.setState({error:n})},t.prototype.render=function(){return this.state.error?this.props.fallback?this.props.fallback(this.state.error):null:this.props.children},t.defaultProps={action:""},t}(Q);const qr=()=>f("div",{class:"mx-auto w-fit rounded-lg border-red-800 bg-red-500/20 p-4 font-mono text-sm leading-6",children:f("h2",{class:"mb-4 text-center text-xl font-medium",children:"Something went wrong"})});function Yr({config:e}){const{amount:t,currency:n,language:r,translations:o,publishable_api_key:a}=e,i=document.documentElement.dir==="rtl"||r==="ar",s=en[n]||en.default,u=s===0?t:parseFloat((t/_n(10,s)).toFixed(s)),l=new Intl.NumberFormat("en",{style:"currency",currency:n,currencyDisplay:"symbol",minimumFractionDigits:s}).format(u),[d,c]=N(R(S({version:kt,base_url:"https://api.moyasar.com"},e),{translations:Tn(o),formattedAmount:l,decimalAmount:u.toFixed(s).toString(),isProcessing:!1,isRtl:i,showForm:!1,isTestMode:(a==null?void 0:a.startsWith("pk_test"))||location.protocol==="http:"}));return Z(()=>{var h,p;if(!window.SamsungPay&&e.samsung_pay){const _=document.createElement("script");_.src="https://img.mpay.samsung.com/gsmpi/sdk/samsungpay_web_sdk.js",document.body.append(_)}if(!((p=(h=window.google)==null?void 0:h.payments)!=null&&p.api)&&e.google_pay){const _=document.createElement("script");_.src="https://pay.google.com/gp/p/js/pay.js",document.body.append(_)}},[]),f(j.Provider,{value:R(S({},d),{setFormSettings:c}),children:f(Zr,{instance:Hr,tags:{tag:"moyasar-payment-form"},fallback:()=>f(qr,{}),children:f("div",{class:oe(["box-border flex w-full min-w-60 flex-col gap-4 text-base leading-4 text-black/90",e.fixed_width&&"md:mx-auto md:max-w-80"]),dir:r==="ar"?"rtl":"ltr",children:[f($t,{}),f(dr,{}),e.methods.includes("creditcard")&&f(Cr,{}),f(Sn,{})]})})})}const Jr=e=>{function t(n){if(typeof n!="function")return!1;const r=(n==null?void 0:n.constructor.prototype.constructor.name)==="AsyncFunction",o=n.toString().startsWith("async");return r||o}return e.on_initiating&&!t(e.on_initiating)&&E("On initiating must be a promise based callback, check documentation for implementation details"),e.on_completed&&!t(e.on_completed)&&E("On completed must be a promise based callback, check documentation for implementation details"),e.on_failure&&!t(e.on_failure)&&E("On failure must be a promise based callback, check documentation for implementation details"),e.on_redirect&&!t(e.on_redirect)&&E("On redirect must be a promise based callback, check documentation for implementation details"),!0},Wr=e=>{var t,n;return e.payment_button_type&&typeof e.payment_button_type!="string"&&ue("Payment button type"),e.payment_button_type&&!pr.includes(e.payment_button_type)&&E("Unsupported button type, check documentation for list of supported types"),e.language&&typeof e.language!="string"&&ue("Language"),e.translations&&typeof e.translations!="object"&&ue("Translations"),e.metadata&&typeof e.metadata!="object"&&E("Metadata must be and object"),e.metadata&&Object.entries(e.metadata).length>50&&E("Only 50 Key/Value pairs are allowed in metadata"),e.invoice_id&&typeof e.invoice_id!="string"&&E("Invoice ID must be a string"),e.invoice_id&&(/^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}$/.test((t=e.invoice_id)!=null?t:"")||E("Invalid invoice ID format")),e.statement_descriptor&&typeof e.statement_descriptor!="string"&&E("Statement descriptor must be a string"),e.statement_descriptor&&(/^[\w\s\d\-~]{1,64}$/.test((n=e.statement_descriptor)!=null?n:"")||E('Invalid format for the statement descriptor [length between 1 and 64 characters, allowed alphanumeric characters, white-spaces, "/", "-" and "~" symbols] ')),e.fixed_width&&typeof e.fixed_width!="boolean"&&E("Fixed width expects boolean value"),!0},ut=(e,t)=>e.every(n=>t.includes(n)),Xr=e=>{var t,n,r,o,a,i,s,u,l,d,c,h;if(e.methods&&!Array.isArray(e.methods)&&E("Methods must be an array"),e.methods.includes("creditcard")&&((t=e.credit_card)!=null&&t.manual&&typeof e.credit_card.manual!="boolean"&&E("Credit Card manual option must be a boolean"),(n=e.credit_card)!=null&&n.save_card&&typeof e.credit_card.save_card!="boolean"&&E("Credit Card save card option must be a boolean")),e.methods.includes("applepay")&&(e.apple_pay||K("Apple Pay configuration"),e.apple_pay)){const p=e.apple_pay.country||((r=e.payment_options)==null?void 0:r.country),_=e.apple_pay.label||((o=e.payment_options)==null?void 0:o.label);p||K("Apple Pay country or Payment Options country"),(p==null?void 0:p.trim().length)!==2&&E("Country must be two-letter ISO 3166 country code"),_||K("Apple Pay label or Payment Options label"),(_==null?void 0:_.trim().length)===0&&E("Apple Pay label or Payment Options label can't be empty"),e.apple_pay.validate_merchant_url&&!pn(e.apple_pay.validate_merchant_url)&&ue("Apple Pay Validate Merchant URL"),(a=e.apple_pay)!=null&&a.merchant_capabilities&&(ut(e.apple_pay.merchant_capabilities,at)||E(`Apple Pay merchant capabilities supports only ${at.join(", ")}`)),(i=e.apple_pay)!=null&&i.supported_countries&&!Array.isArray(e.apple_pay.supported_countries)&&E("Apple Pay Supported Countries must be an array of country codes")}if(e.samsung_pay){const p=e.samsung_pay.country||((s=e.payment_options)==null?void 0:s.country),_=e.samsung_pay.label||((u=e.payment_options)==null?void 0:u.label),b=e.samsung_pay.order_number,m=e.publishable_api_key.startsWith("pk_test")||location.protocol==="http:";!window.SamsungPay&&m&&console.warn("To speed up loading of Samsung Pay button you can include the Samsung Pay Web SDK JavaScript file in your website front-end directly. If there will be no Samsung Pay available on form initialization it will be loaded automatically"),e.samsung_pay.service_id||K("Samsung Pay service_id"),e.samsung_pay.service_id.trim().length===0&&E("Samsung Pay service_id can't be empty"),b||K("Samsung Pay order_number or Payment Options order_number"),(b==null?void 0:b.trim().length)===0&&E("Order number can't be empty"),p||K("Samsung Pay country or Payment Options country"),(p==null?void 0:p.trim().length)!==2&&E("Country must be two-letter ISO 3166 country code"),_||K("Samsung Pay label or Payment Options label"),(_==null?void 0:_.trim().length)===0&&E("Samsung Pay label or Payment Options label can't be empty")}if(e.google_pay){const p=e.google_pay.country||((l=e.payment_options)==null?void 0:l.country),_=e.google_pay.label||((d=e.payment_options)==null?void 0:d.label),b=e.publishable_api_key.startsWith("pk_test")||location.protocol==="http:",m=e.google_pay.environment;!((h=(c=window.google)==null?void 0:c.payments)!=null&&h.api)&&b&&console.warn("To speed up loading of Google Pay button you can include the Google Pay Web SDK JavaScript file in your website front-end directly. If there will be no Google Pay available on form initialization it will be loaded automatically"),e.google_pay.merchant_id||K("Google Pay service_id"),e.google_pay.merchant_id.trim().length===0&&E("Google Pay service_id can't be empty"),p||K("Google Pay country or Payment Options country"),(p==null?void 0:p.trim().length)!==2&&E("Country must be two-letter ISO 3166 country code"),_||K("Google Pay label or Payment Options label"),(_==null?void 0:_.trim().length)===0&&E("Google Pay label or Payment Options label can't be empty"),m&&!["PRODUCTION","TEST"].includes(m)&&E("Google Pay environment can be set to `TEST` or `PRODUCTION`");const{auth_methods:y}=e.google_pay;y&&!Array.isArray(y)&&E("Google Pay auth_methods must be an array"),y&&!y.every(v=>v==="PAN_ONLY"||v==="CRYPTOGRAM_3DS")&&E("Google Pay auth_methods must contain 'CRYPTOGRAM_3DS' and/or 'PAN_ONLY'")}return e.methods&&(ut(e.methods,ot)||E(`Moyasar form supports only ${ot.join(", ")} methods`)),e.supported_networks&&(ut(e.supported_networks,rt)||E(`Moyasar form supports only ${rt.join(", ")} networks`)),!0},Qr=e=>(e.element||K("element"),typeof e.element!="string"&&!(e.element instanceof Element)&&ue("Element"),typeof e.element=="string"&&!document.querySelector(e.element)&&E(`Selector ${e.element} does't exist id DOM`),e.publishable_api_key.trim()||K("publishable_api_key"),e.publishable_api_key&&(/^pk_(test|live)_.{40}$/.test(e.publishable_api_key)||ue("Publishable API Key"),location.protocol.toLowerCase()==="http:"&&e.publishable_api_key.startsWith("pk_live")&&E("Production key (pk_live) require secure connection, for development use key starting with pk_test")),e.amount||K("amount"),e.amount&&((typeof e.amount!="number"||e.amount<100)&&E("Amount must be a non-negative integer. Minimal supported value is 100."),Number.isInteger(e.amount)||E("Amount must be in minor unit of selected currency, e.g. for $19.99 set amount to 1999.")),e.currency||K("currency"),e.currency&&e.currency.trim().length!==3&&E("Currency must be in ISO 3166-1 alpha-3 country code format"),e.description||K("description"),e.description&&e.description.trim().length===0&&E("Description can't be empty"),e.callback_url||K("callback_url"),pn(e.callback_url)||ue("Callback URL"),!0),E=e=>{throw window.silentError&&console.error(e),new Error(e)},K=e=>E(`Missing entry: ${e} is required`),ue=e=>E(`${e} is invalid`),pn=e=>typeof e=="string"&&/^https?:\/\/.+/.test(e),$r=(e,t=!1)=>(t&&(window.silentError=t),Qr(e),Xr(e),Wr(e),Jr(e),!0),eo=e=>{const t=e.publishable_api_key.startsWith("pk_test")||location.protocol==="http:",n=e.element;let r;if(typeof n=="string"&&(r=document.querySelector(n)),n instanceof Element&&(r=n),!r){console.error("Moyasar Form [element] config must be a valid query selector or a valid Element instance.");return}try{$r(e,t)}catch(o){console.error(o),wt(f(()=>f("div",{class:"mx-auto w-fit rounded-lg border-red-800 bg-red-500/20 p-4 font-mono text-sm leading-6",children:[f("h2",{class:"mb-4 text-center text-xl font-medium",children:"Form configuration issue!"}),f("p",{children:"Please check configuration for missing properties or incorrect values."}),f("p",{children:"Check browser console for more information"})]}),{}),r);return}r.setAttribute("lang",e.language),wt(f(Yr,{config:e}),r)},to="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let no=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e));for(;e--;)t+=to[n[e]&63];return t};const ro=e=>{const t=S({},e);return e.payment_button_type||(t.payment_button_type="pay"),e.language||(t.language=document.documentElement.lang||"en"),e.methods||(t.methods=ot),e.supported_networks&&(t.supported_networks=e.supported_networks.map(n=>n==="mastercard"?"masterCard":n)),e.supported_networks||(t.supported_networks=rt.filter(n=>n!=="amex")),!e.fixed_width&&e.fixed_width!==!1&&(t.fixed_width=!0),e.apple_pay&&(e.apple_pay.version||(t.apple_pay.version=6),e.apple_pay.merchant_capabilities||(t.apple_pay.merchant_capabilities=at.filter(n=>n!=="supportsEMV")),e.apple_pay.supported_countries||(t.apple_pay.supported_countries=["SA"])),e.samsung_pay&&(e.samsung_pay.version||(t.samsung_pay.version=2),e.samsung_pay.environment||(t.samsung_pay.environment="PRODUCTION")),e.google_pay&&(e.google_pay.environment||(t.google_pay.environment="PRODUCTION"),e.google_pay.auth_methods||(t.google_pay.auth_methods=["PAN_ONLY","CRYPTOGRAM_3DS"]),e.google_pay.gateway_merchant_id||(t.google_pay.gateway_merchant_id=no(36))),t};class oo{static init(t){const n=ro(t);eo(n)}}const ao=Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"}));return oo});
10
+ `).filter(function(a){return a!==""})}else return["No stacktrace available"]}function Rr(e){return Object.keys(e).map(function(t){return"".concat(encodeURIComponent(t),"=").concat(encodeURIComponent(e[t]))}).join("&")}function dn(){return Object.prototype.toString.call(typeof process!="undefined"?process:0)==="[object process]"}function Ve(){return dn()?global:typeof window!="undefined"?window:typeof self!="undefined"?self:{}}var Ir=function(){function e(t){this._data=t}return e.prototype.toJSON=function(){return JSON.stringify(this._data)},e.prototype.serialize=function(){return this._data},e}(),Nr="1.3.31",lt=function(){function e(){}return e.serialize=function(){return{transport:this.transport(),origin:this.origin()}},e.origin=function(){var t=Ve();return t.location?t.location.origin||"".concat(t.location.protocol,"//").concat(t.location.hostname):""},e.transport=function(){var t=Ve();return dn()&&typeof jest=="undefined"?"NodeHTTP":t.XDomainRequest?"XDomainRequest":t.XMLHttpRequest&&!t.fetch?"XMLHttpRequest":"fetch"},e.supportsPromises=function(){var t=Ve();return"Promise"in t&&"resolve"in t.Promise&&"reject"in t.Promise&&"all"in t.Promise&&"race"in t.Promise&&function(){var n;return new t.Promise(function(r){n=r}),typeof n=="function"}()},e}(),Fr=function(){function e(t){this.url=t}return e.prototype.send=function(t){var n=this;return new Promise(function(r,o){var a,i=new XDomainRequest,s=new RegExp("^https?:");i.onload=function(){return r({})},i.open("POST",n.url.replace(s,(a=window==null?void 0:window.location)===null||a===void 0?void 0:a.protocol)),setTimeout(function(){try{i.send(t)}catch(u){o(u)}},0)})},e}(),Ur=function(){function e(t){this.url=t}return e.prototype.send=function(t){var n=this;return new Promise(function(r,o){try{var a=new XMLHttpRequest;a.onreadystatechange=function(){a.readyState===XMLHttpRequest.DONE&&r({})},a.open("POST",n.url),a.send(t)}catch(i){o(i)}})},e}(),Lr=function(){function e(t,n){this.url=t}return e.prototype.send=function(t){return Fe(this,void 0,void 0,function(){var n,r,o;return be(this,function(a){switch(a.label){case 0:return[4,fetch(this.url,{method:"POST",body:t})];case 1:return n=a.sent(),r=n.statusText,o=n.ok,[2,o?Promise.resolve({}):Promise.reject({statusText:r})]}})})},e}(),Vr=function(){function e(t){this.url=t,this.https=Promise.resolve().then(()=>ao)}return e.prototype.send=function(t){var n=this,r={method:"POST",headers:{"Content-Type":"application/json","Content-Length":t.length}};return new Promise(function(o,a){n.https.then(function(i){var s=i.request(n.url,r,function(){}).on("error",function(u){return a(u)});s.write(t),s.end(),o({})}).catch(function(i){console.warn("NodeTransport is being used, but the HTTPS module could not be imported. No data will be sent to AppSignal."),a(i)})})},e}(),Gr=function(){function e(t){this._uri=t.uri||"https://appsignal-endpoint.net/collect",this._apiKey=t.key,this._clientVersion=t.version,this._transport=this._createTransport(this._url())}return e.prototype.push=function(t){return Fe(this,void 0,void 0,function(){return be(this,function(n){switch(n.label){case 0:return[4,this._transport.send(t.toJSON())];case 1:return n.sent(),[2,t]}})})},e.prototype._createTransport=function(t){switch(lt.transport()){case"XDomainRequest":return new Fr(t);case"XMLHttpRequest":return new Ur(t);case"NodeHTTP":return new Vr(t);default:return new Lr(t)}},e.prototype._url=function(){var t=this._authorization();return"".concat(this._uri,"?").concat(Rr(t))},e.prototype._authorization=function(){return{api_key:this._apiKey,version:this._clientVersion}},e}(),Ge=function(e){Ar(t,e);function t(n){return e.call(this,ee({timestamp:Math.round(new Date().getTime()/1e3),namespace:"frontend",error:{name:"NullError",message:"No error has been set",backtrace:[]}},n))||this}return t.prototype.setAction=function(n){return!n||typeof n!="string"?this:(this._data.action=n,this)},t.prototype.setNamespace=function(n){return!n||typeof n!="string"?this:(this._data.namespace=n,this)},t.prototype.setError=function(n){return!n||!Mr(n)?this:(this._data.error={name:n.name||"[unknown]",message:n.message,backtrace:Or(n)},this)},t.prototype.setTags=function(n){return this._data.tags=ee(ee({},this._data.tags),Dr(n)),this},t.prototype.setParams=function(n){return this._data.params=ee(ee({},this._data.params),n),this},t.prototype.setBreadcrumbs=function(n){return this._data.breadcrumbs=n,this},t}(Ir),Br=function(){function e(t){this._data=t||[]}return e.prototype.clear=function(){this._data=[]},e.prototype.values=function(){return this._data},e.prototype.push=function(t){var n;return Array.isArray(t)?(n=this._data).push.apply(n,Le([],Ue(t),!1)):this._data.push(t)},e.prototype.drain=function(){return be(this,function(t){switch(t.label){case 0:return this._data.length>0?[4,this._data.shift()]:[3,2];case 1:return t.sent(),[3,0];case 2:return[2]}})},e}(),zr=function(){function e(t,n,r){this._retries=0,this._timerID=0,this._duration=0,this._api=n,this._queue=t,this.options=ee({limit:5,initialDuration:1e3},r),this.reset()}return e.prototype.schedule=function(t){var n=this;t===void 0&&(t=this._duration);var r=Ve(),o=1.3,a=function(){return Fe(n,void 0,void 0,function(){var i,s,u,l,d,c,h;return be(this,function(p){switch(p.label){case 0:p.trys.push([0,7,8,9]),i=Tr(this._queue.drain()),s=i.next(),p.label=1;case 1:if(s.done)return[3,6];if(u=s.value,!u)return[2];p.label=2;case 2:return p.trys.push([2,4,,5]),[4,this._api.push(u)];case 3:return p.sent(),[3,5];case 4:return p.sent(),l=Math.floor(Math.pow(t,o)),this._retries=this._retries-1,this._retries===0?this.reset():(this._queue.push(u),this._timerID=this.schedule(l)),[2];case 5:return s=i.next(),[3,1];case 6:return[3,9];case 7:return d=p.sent(),c={error:d},[3,9];case 8:try{s&&!s.done&&(h=i.return)&&h.call(i)}finally{if(c)throw c.error}return[7];case 9:return this.reset(),[2]}})})};return r.setTimeout(a,t)},e.prototype.reset=function(){var t=this.options,n=t.limit,r=t.initialDuration;this._retries=n,this._duration=r},e}(),jr=function(){function e(t){this.VERSION=Nr,this.ignored=[],this._breadcrumbs=[],this._hooks={decorators:Array(),overrides:Array()},this._env=lt.serialize(),this._queue=new Br([]);var n=t.key,r=n===void 0?"":n,o=t.uri,a=t.revision,i=t.ignoreErrors;a&&typeof a!="string"&&(t.revision=String(a)),r===""&&console.info("[APPSIGNAL]: Started in development mode."),this._api=new Gr({key:r,uri:o,version:this.VERSION}),i&&Array.isArray(i)&&(this.ignored=i),this._dispatcher=new zr(this._queue,this._api),this._options=t}return e.prototype.send=function(t,n,r){var o=this;if(!(t instanceof Error)&&!(t instanceof Ge)&&!(t&&t.error instanceof Error)){console.error("[APPSIGNAL]: Can't send error, given error is not a valid type");return}var a;if("error"in t?a=t.error:a=t,this.ignored.length!==0){if(a&&"message"in a&&this.ignored.some(function(d){return d.test(a.message)})){console.warn("[APPSIGNAL]: Ignored an error: ".concat(a.message));return}if(a instanceof Ge){var i=a.serialize().error;if(i.message&&this.ignored.some(function(d){return d.test(i.message)})){console.warn("[APPSIGNAL]: Ignored a span: ".concat(i.message));return}}}var s=a instanceof Ge?a:this._createSpanFromError(a);if(this._hooks.decorators.length>0&&cn.apply(void 0,Le([],Ue(this._hooks.decorators),!1))(s),n)if(typeof n=="function"){var u=n;u(s)}else{console.warn("[APPSIGNAL]: DEPRECATED: Calling the `send`/`sendError` function with a tags object is deprecated. Use the callback argument instead.");var l=un(n)||{};s.setTags(l)}if(r&&(console.warn("[APPSIGNAL]: DEPRECATED: Calling the `send`/`sendError` function with a namespace is deprecated. Use the callback argument instead."),s.setNamespace(r)),this._breadcrumbs.length>0&&s.setBreadcrumbs(this._breadcrumbs),this._hooks.overrides.length>0&&cn.apply(void 0,Le([],Ue(this._hooks.overrides),!1))(s),lt.supportsPromises())if(this._breadcrumbs=[],!this._options.key)console.warn("[APPSIGNAL]: Span not sent because we're in development mode:",s);else return this._api.push(s).catch(function(){o._queue.push(s),setTimeout(function(){return o._dispatcher.schedule()},0)});else{console.error("[APPSIGNAL]: Error not sent. A Promise polyfill is required.");return}},e.prototype.sendError=function(t,n,r){return this.send(t,n,r)},e.prototype.use=function(t){t.call(this)},e.prototype.createSpan=function(t){var n=this._options,r=n.revision,o=r===void 0?"":r,a=n.namespace,i=new Ge({environment:this._env,revision:o});return a&&i.setNamespace(a),t&&typeof t=="function"&&t(i),i},e.prototype.wrap=function(t,n,r){return Fe(this,void 0,void 0,function(){var o;return be(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,,5]),[4,t()];case 1:return[2,a.sent()];case 2:return o=a.sent(),o instanceof Error||o instanceof ErrorEvent?[4,this.sendError(o,n,r)]:[3,4];case 3:a.sent(),a.label=4;case 4:return[2,Promise.reject(o)];case 5:return[2]}})})},e.prototype.addDecorator=function(t){this._hooks.decorators.push(t)},e.prototype.addOverride=function(t){this._hooks.overrides.push(t)},e.prototype.demo=function(){var t=this._createSpanFromError(new Error("Hello world! This is an error used for demonstration purposes."));t.setAction("TestAction").setParams({path:"/hello",method:"GET"}).setTags({demo_sample:"true"}),this.send(t)},e.prototype.addBreadcrumb=function(t){var n=ee(ee({timestamp:Math.round(new Date().getTime()/1e3)},t),{metadata:un(t.metadata)});if(!n.category){console.warn("[APPSIGNAL]: Breadcrumb not added. `category` is missing.");return}if(!n.action){console.warn("[APPSIGNAL]: Breadcrumb not added. `action` is missing.");return}this._breadcrumbs.length===20&&this._breadcrumbs.pop(),this._breadcrumbs.unshift(n)},e.prototype._createSpanFromError=function(t){var n=this.createSpan();return n.setError(t),n},e}();const Hr=new jr({key:void 0,revision:kt});var Kr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(r[a]=o[a])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ct=function(){return ct=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},ct.apply(this,arguments)},Zr=function(e){Kr(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.state={error:void 0},n}return t.prototype.componentDidCatch=function(n,r){var o=this.props,a=o.instance,i=o.action,s=o.tags,u=n.name,l=n.message,d=n.stack,c=a.createSpan();c.setError({name:u,message:l,stack:d}).setTags(ct({framework:"Preact"},s)),i&&i!==""&&c.setAction(i),a.send(c),this.setState({error:n})},t.prototype.render=function(){return this.state.error?this.props.fallback?this.props.fallback(this.state.error):null:this.props.children},t.defaultProps={action:""},t}(Q);const qr=()=>f("div",{class:"mx-auto w-fit rounded-lg border-red-800 bg-red-500/20 p-4 font-mono text-sm leading-6",children:f("h2",{class:"mb-4 text-center text-xl font-medium",children:"Something went wrong"})});function Yr({config:e}){const{amount:t,currency:n,language:r,translations:o,publishable_api_key:a}=e,i=document.documentElement.dir==="rtl"||r==="ar",s=en[n]||en.default,u=s===0?t:parseFloat((t/_n(10,s)).toFixed(s)),l=new Intl.NumberFormat("en",{style:"currency",currency:n,currencyDisplay:"symbol",minimumFractionDigits:s}).format(u),[d,c]=N(R(S({version:kt,base_url:void 0},e),{translations:Tn(o),formattedAmount:l,decimalAmount:u.toFixed(s).toString(),isProcessing:!1,isRtl:i,showForm:!1,isTestMode:(a==null?void 0:a.startsWith("pk_test"))||location.protocol==="http:"}));return Z(()=>{var h,p;if(!window.SamsungPay&&e.samsung_pay){const _=document.createElement("script");_.src="https://img.mpay.samsung.com/gsmpi/sdk/samsungpay_web_sdk.js",document.body.append(_)}if(!((p=(h=window.google)==null?void 0:h.payments)!=null&&p.api)&&e.google_pay){const _=document.createElement("script");_.src="https://pay.google.com/gp/p/js/pay.js",document.body.append(_)}},[]),f(j.Provider,{value:R(S({},d),{setFormSettings:c}),children:f(Zr,{instance:Hr,tags:{tag:"moyasar-payment-form"},fallback:()=>f(qr,{}),children:f("div",{class:oe(["box-border flex w-full min-w-60 flex-col gap-4 text-base leading-4 text-black/90",e.fixed_width&&"md:mx-auto md:max-w-80"]),dir:r==="ar"?"rtl":"ltr",children:[f($t,{}),f(dr,{}),e.methods.includes("creditcard")&&f(Cr,{}),f(Sn,{})]})})})}const Jr=e=>{function t(n){if(typeof n!="function")return!1;const r=(n==null?void 0:n.constructor.prototype.constructor.name)==="AsyncFunction",o=n.toString().startsWith("async");return r||o}return e.on_initiating&&!t(e.on_initiating)&&E("On initiating must be a promise based callback, check documentation for implementation details"),e.on_completed&&!t(e.on_completed)&&E("On completed must be a promise based callback, check documentation for implementation details"),e.on_failure&&!t(e.on_failure)&&E("On failure must be a promise based callback, check documentation for implementation details"),e.on_redirect&&!t(e.on_redirect)&&E("On redirect must be a promise based callback, check documentation for implementation details"),!0},Wr=e=>{var t,n;return e.payment_button_type&&typeof e.payment_button_type!="string"&&ue("Payment button type"),e.payment_button_type&&!pr.includes(e.payment_button_type)&&E("Unsupported button type, check documentation for list of supported types"),e.language&&typeof e.language!="string"&&ue("Language"),e.translations&&typeof e.translations!="object"&&ue("Translations"),e.metadata&&typeof e.metadata!="object"&&E("Metadata must be and object"),e.metadata&&Object.entries(e.metadata).length>50&&E("Only 50 Key/Value pairs are allowed in metadata"),e.invoice_id&&typeof e.invoice_id!="string"&&E("Invoice ID must be a string"),e.invoice_id&&(/^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}$/.test((t=e.invoice_id)!=null?t:"")||E("Invalid invoice ID format")),e.statement_descriptor&&typeof e.statement_descriptor!="string"&&E("Statement descriptor must be a string"),e.statement_descriptor&&(/^[\w\s\d\-~]{1,64}$/.test((n=e.statement_descriptor)!=null?n:"")||E('Invalid format for the statement descriptor [length between 1 and 64 characters, allowed alphanumeric characters, white-spaces, "/", "-" and "~" symbols] ')),e.fixed_width&&typeof e.fixed_width!="boolean"&&E("Fixed width expects boolean value"),!0},ut=(e,t)=>e.every(n=>t.includes(n)),Xr=e=>{var t,n,r,o,a,i,s,u,l,d,c,h;if(e.methods&&!Array.isArray(e.methods)&&E("Methods must be an array"),e.methods.includes("creditcard")&&((t=e.credit_card)!=null&&t.manual&&typeof e.credit_card.manual!="boolean"&&E("Credit Card manual option must be a boolean"),(n=e.credit_card)!=null&&n.save_card&&typeof e.credit_card.save_card!="boolean"&&E("Credit Card save card option must be a boolean")),e.methods.includes("applepay")&&(e.apple_pay||K("Apple Pay configuration"),e.apple_pay)){const p=e.apple_pay.country||((r=e.payment_options)==null?void 0:r.country),_=e.apple_pay.label||((o=e.payment_options)==null?void 0:o.label);p||K("Apple Pay country or Payment Options country"),(p==null?void 0:p.trim().length)!==2&&E("Country must be two-letter ISO 3166 country code"),_||K("Apple Pay label or Payment Options label"),(_==null?void 0:_.trim().length)===0&&E("Apple Pay label or Payment Options label can't be empty"),e.apple_pay.validate_merchant_url&&!pn(e.apple_pay.validate_merchant_url)&&ue("Apple Pay Validate Merchant URL"),(a=e.apple_pay)!=null&&a.merchant_capabilities&&(ut(e.apple_pay.merchant_capabilities,at)||E(`Apple Pay merchant capabilities supports only ${at.join(", ")}`)),(i=e.apple_pay)!=null&&i.supported_countries&&!Array.isArray(e.apple_pay.supported_countries)&&E("Apple Pay Supported Countries must be an array of country codes")}if(e.samsung_pay){const p=e.samsung_pay.country||((s=e.payment_options)==null?void 0:s.country),_=e.samsung_pay.label||((u=e.payment_options)==null?void 0:u.label),b=e.samsung_pay.order_number,m=e.publishable_api_key.startsWith("pk_test")||location.protocol==="http:";!window.SamsungPay&&m&&console.warn("To speed up loading of Samsung Pay button you can include the Samsung Pay Web SDK JavaScript file in your website front-end directly. If there will be no Samsung Pay available on form initialization it will be loaded automatically"),e.samsung_pay.service_id||K("Samsung Pay service_id"),e.samsung_pay.service_id.trim().length===0&&E("Samsung Pay service_id can't be empty"),b||K("Samsung Pay order_number or Payment Options order_number"),(b==null?void 0:b.trim().length)===0&&E("Order number can't be empty"),p||K("Samsung Pay country or Payment Options country"),(p==null?void 0:p.trim().length)!==2&&E("Country must be two-letter ISO 3166 country code"),_||K("Samsung Pay label or Payment Options label"),(_==null?void 0:_.trim().length)===0&&E("Samsung Pay label or Payment Options label can't be empty")}if(e.google_pay){const p=e.google_pay.country||((l=e.payment_options)==null?void 0:l.country),_=e.google_pay.label||((d=e.payment_options)==null?void 0:d.label),b=e.publishable_api_key.startsWith("pk_test")||location.protocol==="http:",m=e.google_pay.environment;!((h=(c=window.google)==null?void 0:c.payments)!=null&&h.api)&&b&&console.warn("To speed up loading of Google Pay button you can include the Google Pay Web SDK JavaScript file in your website front-end directly. If there will be no Google Pay available on form initialization it will be loaded automatically"),e.google_pay.merchant_id||K("Google Pay service_id"),e.google_pay.merchant_id.trim().length===0&&E("Google Pay service_id can't be empty"),p||K("Google Pay country or Payment Options country"),(p==null?void 0:p.trim().length)!==2&&E("Country must be two-letter ISO 3166 country code"),_||K("Google Pay label or Payment Options label"),(_==null?void 0:_.trim().length)===0&&E("Google Pay label or Payment Options label can't be empty"),m&&!["PRODUCTION","TEST"].includes(m)&&E("Google Pay environment can be set to `TEST` or `PRODUCTION`");const{auth_methods:y}=e.google_pay;y&&!Array.isArray(y)&&E("Google Pay auth_methods must be an array"),y&&!y.every(v=>v==="PAN_ONLY"||v==="CRYPTOGRAM_3DS")&&E("Google Pay auth_methods must contain 'CRYPTOGRAM_3DS' and/or 'PAN_ONLY'")}return e.methods&&(ut(e.methods,ot)||E(`Moyasar form supports only ${ot.join(", ")} methods`)),e.supported_networks&&(ut(e.supported_networks,rt)||E(`Moyasar form supports only ${rt.join(", ")} networks`)),!0},Qr=e=>(e.element||K("element"),typeof e.element!="string"&&!(e.element instanceof Element)&&ue("Element"),typeof e.element=="string"&&!document.querySelector(e.element)&&E(`Selector ${e.element} does't exist id DOM`),e.publishable_api_key.trim()||K("publishable_api_key"),e.publishable_api_key&&(/^pk_(test|live)_.{40}$/.test(e.publishable_api_key)||ue("Publishable API Key"),location.protocol.toLowerCase()==="http:"&&e.publishable_api_key.startsWith("pk_live")&&E("Production key (pk_live) require secure connection, for development use key starting with pk_test")),e.amount||K("amount"),e.amount&&((typeof e.amount!="number"||e.amount<100)&&E("Amount must be a non-negative integer. Minimal supported value is 100."),Number.isInteger(e.amount)||E("Amount must be in minor unit of selected currency, e.g. for $19.99 set amount to 1999.")),e.currency||K("currency"),e.currency&&e.currency.trim().length!==3&&E("Currency must be in ISO 3166-1 alpha-3 country code format"),e.description||K("description"),e.description&&e.description.trim().length===0&&E("Description can't be empty"),e.callback_url||K("callback_url"),pn(e.callback_url)||ue("Callback URL"),!0),E=e=>{throw window.silentError&&console.error(e),new Error(e)},K=e=>E(`Missing entry: ${e} is required`),ue=e=>E(`${e} is invalid`),pn=e=>typeof e=="string"&&/^https?:\/\/.+/.test(e),$r=(e,t=!1)=>(t&&(window.silentError=t),Qr(e),Xr(e),Wr(e),Jr(e),!0),eo=e=>{const t=e.publishable_api_key.startsWith("pk_test")||location.protocol==="http:",n=e.element;let r;if(typeof n=="string"&&(r=document.querySelector(n)),n instanceof Element&&(r=n),!r){console.error("Moyasar Form [element] config must be a valid query selector or a valid Element instance.");return}try{$r(e,t)}catch(o){console.error(o),wt(f(()=>f("div",{class:"mx-auto w-fit rounded-lg border-red-800 bg-red-500/20 p-4 font-mono text-sm leading-6",children:[f("h2",{class:"mb-4 text-center text-xl font-medium",children:"Form configuration issue!"}),f("p",{children:"Please check configuration for missing properties or incorrect values."}),f("p",{children:"Check browser console for more information"})]}),{}),r);return}r.setAttribute("lang",e.language),wt(f(Yr,{config:e}),r)},to="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let no=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e));for(;e--;)t+=to[n[e]&63];return t};const ro=e=>{const t=S({},e);return e.payment_button_type||(t.payment_button_type="pay"),e.language||(t.language=document.documentElement.lang||"en"),e.methods||(t.methods=ot),e.supported_networks&&(t.supported_networks=e.supported_networks.map(n=>n==="mastercard"?"masterCard":n)),e.supported_networks||(t.supported_networks=rt.filter(n=>n!=="amex")),!e.fixed_width&&e.fixed_width!==!1&&(t.fixed_width=!0),e.apple_pay&&(e.apple_pay.version||(t.apple_pay.version=6),e.apple_pay.merchant_capabilities||(t.apple_pay.merchant_capabilities=at.filter(n=>n!=="supportsEMV")),e.apple_pay.supported_countries||(t.apple_pay.supported_countries=["SA"])),e.samsung_pay&&(e.samsung_pay.version||(t.samsung_pay.version=2),e.samsung_pay.environment||(t.samsung_pay.environment="PRODUCTION")),e.google_pay&&(e.google_pay.environment||(t.google_pay.environment="PRODUCTION"),e.google_pay.auth_methods||(t.google_pay.auth_methods=["PAN_ONLY","CRYPTOGRAM_3DS"]),e.google_pay.gateway_merchant_id||(t.google_pay.gateway_merchant_id=no(36))),t};class oo{static init(t){const n=ro(t);eo(n)}}const ao=Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"}));return oo});
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "contributors": [
7
7
  "Moyasar Developers"
8
8
  ],
9
- "version": "2.0.5",
9
+ "version": "2.0.6",
10
10
  "homepage": "https://docs.moyasar.com/credit-card",
11
11
  "files": [
12
12
  "dist"