paymob-pixel-alpha 1.1.40 → 1.1.41

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.
Files changed (3) hide show
  1. package/main.css +1 -1
  2. package/main.js +239 -143
  3. package/package.json +1 -1
package/main.css CHANGED
@@ -406,7 +406,7 @@
406
406
  .filter-input-field_filter-field-box__HETzG{padding:.75rem 1rem;display:flex;flex-direction:column;gap:.75rem}.filter-input-field_filter-field-box__HETzG>div[class*=PhoneInput_container__],.filter-input-field_filter-field-box__HETzG>div[class*=input_container__]{gap:.25rem}.filter-input-field_filter-field-box__HETzG button:not([data-phone-input-btn-toggle]){width:100%}
407
407
  .PhoneInput_container__K8pBo{display:flex;align-items:unset;justify-content:flex-start;flex-direction:column;width:100%;position:relative;color:#344054;gap:.5rem}html[dir=ltr] .PhoneInput_container__K8pBo,html[lang=en] .PhoneInput_container__K8pBo{font-family:"Inter",sans-serif;font-size:.875rem;font-style:normal;line-height:1rem;font-weight:400}html[dir=rtl] .PhoneInput_container__K8pBo,html[lang=ar] .PhoneInput_container__K8pBo{font-family:"Cairo",sans-serif;font-size:.875rem;font-style:normal;line-height:1rem;font-weight:400}.PhoneInput_container__controller__vOrNH{outline:none;display:flex;align-items:center;justify-content:flex-start;height:2.5rem;padding:.625rem .75rem;gap:.5rem;border-radius:.5rem;border:.0625rem solid #d0d5dd;background:#fff}html[dir=rtl] .PhoneInput_container__controller__vOrNH,html[lang=ar] .PhoneInput_container__controller__vOrNH{flex-direction:row-reverse}.PhoneInput_container__controller__vOrNH:hover,.PhoneInput_container__controller__vOrNH:focus{border:.0625rem solid #7294ff}.PhoneInput_container__controller__vOrNH:focus,.PhoneInput_container__controller__vOrNH:focus-within{box-shadow:0rem 0rem 0rem .25rem #b9caff,0rem .0625rem .125rem 0rem rgba(16,24,40,.05)}.PhoneInput_container__controller__vOrNH[data-phone-input-invalid=true]{border:.0625rem solid #ff7397}.PhoneInput_container__controller__vOrNH[data-phone-input-invalid=true]:focus,.PhoneInput_container__controller__vOrNH[data-phone-input-invalid=true]:focus-within{box-shadow:0rem 0rem 0rem .25rem #ffb9cb,0rem .0625rem .125rem 0rem rgba(16,24,40,.05)}.PhoneInput_container__controller__vOrNH[data-phone-input-disabled=true]{border:.0625rem solid #d0d5dd;background:#f9fafb;cursor:not-allowed}.PhoneInput_container__controller__vOrNH[data-phone-input-disabled=true] .PhoneInput_container__controller__button__LaNe\+{background:#f9fafb}.PhoneInput_container__controller__vOrNH[data-phone-input-disabled=true]:hover,.PhoneInput_container__controller__vOrNH[data-phone-input-disabled=true]:focus,.PhoneInput_container__controller__vOrNH[data-phone-input-disabled=true]:active{box-shadow:unset}.PhoneInput_container__controller__button__LaNe\+{border:none;outline:none;padding:0;background-color:#fff;display:flex;align-items:center;justify-content:flex-start;gap:.5rem;cursor:pointer}html[dir=rtl] .PhoneInput_container__controller__button__LaNe\+,html[lang=ar] .PhoneInput_container__controller__button__LaNe\+{flex-direction:row-reverse}.PhoneInput_container__controller__button__country-icon__kgZ6s{display:flex;align-items:center;justify-content:flex-start}.PhoneInput_container__controller__button__country-icon__kgZ6s svg{width:1.25rem;height:1.25rem}.PhoneInput_container__controller__button__chevron-icon__FuSoM{display:flex;align-items:center;justify-content:flex-start;transition:all .2s}.PhoneInput_container__controller__button__chevron-icon__FuSoM svg{width:.75rem;height:.75rem}:has([data-phone-input-btn-toggle=true]) .PhoneInput_container__controller__button__chevron-icon__FuSoM{transform:rotate(180deg)}.PhoneInput_container__controller__button__LaNe\+ label{cursor:pointer;direction:ltr;color:#344054;font-family:"Inter",sans-serif;font-size:.875rem;font-style:normal;line-height:1rem;font-weight:400}.PhoneInput_container__controller__button__LaNe\+:disabled{cursor:not-allowed}.PhoneInput_container__controller__button__LaNe\+:disabled label{cursor:not-allowed;color:#98a2b3}.PhoneInput_container__controller__input__5Ubvb{width:100%;border:none;outline:none;text-align:left;flex:1}html[dir=ltr] .PhoneInput_container__controller__input__5Ubvb,html[lang=en] .PhoneInput_container__controller__input__5Ubvb{font-family:"Inter",sans-serif;font-size:.875rem;font-style:normal;line-height:1rem;font-weight:400}html[dir=rtl] .PhoneInput_container__controller__input__5Ubvb,html[lang=ar] .PhoneInput_container__controller__input__5Ubvb{font-family:"Cairo",sans-serif;font-size:.875rem;font-style:normal;line-height:1rem;font-weight:400}.PhoneInput_container__controller__input__5Ubvb::placeholder{color:#667085}.PhoneInput_container__dropdown__mvQBN{position:absolute;background-color:#fff;border:.0625rem solid #eaecf0;border-radius:.5rem;left:0;right:0;top:120%;z-index:3;overflow:hidden}.PhoneInput_container__dropdown__country__acdpZ{display:flex;align-items:center;justify-content:space-between;padding:1rem;padding:.625rem .75rem;cursor:pointer;color:#101828}.PhoneInput_container__dropdown__country__acdpZ:hover{background-color:#f9fafb}.PhoneInput_container__dropdown__country__details__04lU6{width:100%;display:flex;align-items:center;justify-content:flex-start;gap:.5rem}.PhoneInput_container__dropdown__country__details__icon__q0Gud{width:1.25rem;height:1.25rem}.PhoneInput_container__dropdown__country__details__icon__q0Gud svg{width:inherit;height:inherit}.PhoneInput_container__dropdown__country__details__info__vxcke{display:flex;align-items:center;justify-content:flex-start;gap:.25rem;white-space:wrap}.PhoneInput_container__dropdown__country__trailing-icon__jl2gF{width:1.25rem;height:1.25rem}.PhoneInput_container__dropdown__country__trailing-icon__jl2gF svg{width:inherit;height:inherit}.PhoneInput_container__dropdown__country__acdpZ[data-phone-input-country-active=true]{background-color:#f9fafb}.PhoneInput_container__error__xBpan{color:#cc1142}html[dir=ltr] .PhoneInput_container__error__xBpan,html[lang=en] .PhoneInput_container__error__xBpan{font-family:"Inter",sans-serif;font-size:.875rem;font-style:normal;line-height:1.125rem;letter-spacing:.01rem;font-weight:400}html[dir=rtl] .PhoneInput_container__error__xBpan,html[lang=ar] .PhoneInput_container__error__xBpan{font-family:"Cairo",sans-serif;font-size:.875rem;font-style:normal;line-height:1.125rem;letter-spacing:.01rem;font-weight:400}
408
408
  .checkboxes_apply-btn-wrapper__Wamth{width:100%;position:sticky;inset-block-end:0;inset-inline-start:0;padding:.25rem .5rem .5rem;background-color:#fff;border-end-start-radius:.5rem;border-end-end-radius:.5rem}.checkboxes_apply-btn-wrapper__Wamth button{width:100%}
409
- .dropdown-menu_dropdown-menu__s1o68{position:fixed;padding:.25rem 0;border-radius:.5rem;border:.0625rem solid #eaecf0;box-shadow:0rem .25rem .375rem -0.125rem rgba(16,24,40,.03),0rem .75rem 1rem -0.25rem rgba(16,24,40,.08);background-color:#fff;z-index:2;opacity:0;transition:opacity 200ms ease;will-change:opacity}.dropdown-menu_dropdown-menu__s1o68:has(div[class*=apply-btn-wrapper]){padding-bottom:0}.dropdown-menu_dropdown-menu__search-bar__EKpzR{padding-inline:.75rem;padding-top:.5rem}.dropdown-menu_dropdown-menu__search-bar__EKpzR:only-child{padding-bottom:.5rem}@media(min-width: 901px){.dropdown-menu_dropdown-menu__s1o68::-webkit-scrollbar{width:.4rem;height:.6rem}.dropdown-menu_dropdown-menu__s1o68::-webkit-scrollbar-track{background:rgba(0,0,0,0);border-radius:.5rem}.dropdown-menu_dropdown-menu__s1o68::-webkit-scrollbar-thumb{background:#eaecf0;border-radius:.5rem}.dropdown-menu_dropdown-menu__s1o68::-webkit-scrollbar-thumb:hover{background:#d0d5dd}}.dropdown-menu_dropdown-menu__s1o68[data-dropdown-menu-width=full]{width:100%}.dropdown-menu_dropdown-menu__s1o68[data-dropdown-menu-width=fit-content]{width:fit-content;white-space:nowrap}.dropdown-menu_dropdown-menu--open__my4uu{opacity:1}
409
+ .dropdown-menu_dropdown-menu__s1o68{position:fixed;padding:.25rem 0;border-radius:.5rem;border:.0625rem solid #eaecf0;box-shadow:0rem .25rem .375rem -0.125rem rgba(16,24,40,.03),0rem .75rem 1rem -0.25rem rgba(16,24,40,.08);background-color:#fff;z-index:6;opacity:0;transition:opacity 200ms ease;will-change:opacity}.dropdown-menu_dropdown-menu__s1o68:has(div[class*=apply-btn-wrapper]){padding-bottom:0}.dropdown-menu_dropdown-menu__search-bar__EKpzR{padding-inline:.75rem;padding-top:.5rem}.dropdown-menu_dropdown-menu__search-bar__EKpzR:only-child{padding-bottom:.5rem}@media(min-width: 901px){.dropdown-menu_dropdown-menu__s1o68::-webkit-scrollbar{width:.4rem;height:.6rem}.dropdown-menu_dropdown-menu__s1o68::-webkit-scrollbar-track{background:rgba(0,0,0,0);border-radius:.5rem}.dropdown-menu_dropdown-menu__s1o68::-webkit-scrollbar-thumb{background:#eaecf0;border-radius:.5rem}.dropdown-menu_dropdown-menu__s1o68::-webkit-scrollbar-thumb:hover{background:#d0d5dd}}.dropdown-menu_dropdown-menu__s1o68[data-dropdown-menu-width=full]{width:100%}.dropdown-menu_dropdown-menu__s1o68[data-dropdown-menu-width=fit-content]{width:fit-content;white-space:nowrap}.dropdown-menu_dropdown-menu--open__my4uu{opacity:1}
410
410
  .dropdown_dropdown__050yb{position:relative;display:flex;flex-direction:column;gap:.5rem}.dropdown_dropdown__children-wrapper__nqzNx{display:flex;flex-direction:column;width:100%}.dropdown_dropdown__hint-text__oFZ2v{font-family:"Inter",sans-serif;font-size:.875rem;font-style:normal;line-height:1.125rem;letter-spacing:.01rem;font-weight:400}html[dir=rtl] .dropdown_dropdown__hint-text__oFZ2v,html[lang=ar] .dropdown_dropdown__hint-text__oFZ2v{font-family:"Cairo",sans-serif;font-size:.875rem;font-style:normal;line-height:1.125rem;letter-spacing:.01rem;font-weight:400}.dropdown_dropdown__hint-text__oFZ2v:is([data-dropdown-status=default]){color:#475467}.dropdown_dropdown__hint-text__oFZ2v:is([data-dropdown-status=success]){color:#038f6e}.dropdown_dropdown__hint-text__oFZ2v:is([data-dropdown-status=warning]){color:#b54708}.dropdown_dropdown__hint-text__oFZ2v:is([data-dropdown-status=error]){color:#cc1142}.dropdown_dropdown__050yb:has([class*=dropdown-menu__]) [class*=dropdown-chevron_] svg{transform:rotate(180deg)}.dropdown_dropdown__050yb[data-dropdown-focused=true]:has([class*=dropdown-menu__]){background-color:#f9fafb}.dropdown_dropdown__050yb[data-dropdown-width=full]{width:100%}.dropdown_dropdown__050yb[data-dropdown-width=full]:has([class*=dropdown-btn__dropdown-chevron]:only-child) button[class*=dropdown-button_]{padding:.5rem .75rem}.dropdown_dropdown__050yb[data-dropdown-width=fit-content]{width:fit-content}
411
411
  .radioButton_control__Yh5dG{display:block;position:relative;cursor:pointer;padding:1rem}.radioButton_control__Yh5dG:has([data-radio-size=md]){padding:1.1rem}.radioButton_control__Yh5dG input{position:absolute;z-index:-1;opacity:0}.radioButton_control__Yh5dG[data-radio-variant=outlined]{border-radius:.5rem;border:1px solid #eaecf0;background:#fff}.radioButton_control__Yh5dG[data-radio-variant=outlined]:has(input:disabled){border:1px solid #eaecf0;background:#f9fafb}.radioButton_control__Yh5dG[data-radio-variant=outlined]:not(:has(input:disabled)):has(input:checked){border:1px solid #144dff;background:#e8edff}.radioButton_control__Yh5dG[data-radio-variant=outlined]:not(:has(input:disabled)):has(input:checked) .radioButton_control__text__Xtvha,.radioButton_control__Yh5dG[data-radio-variant=outlined]:not(:has(input:disabled)):has(input:checked) .radioButton_control__hint__jOlEd{color:#103ecc}.radioButton_control__Yh5dG[data-radio-variant=outlined]:not(:has(input:disabled)):hover,.radioButton_control__Yh5dG[data-radio-variant=outlined]:not(:has(input:disabled)):focus{border:1px solid #7294ff}.radioButton_control__Yh5dG[data-radio-variant=outlined]:not(:has(input:disabled)):active{box-shadow:0rem 0rem 0rem .25rem #b9caff,0rem .0625rem .125rem 0rem rgba(16,24,40,.05)}.radioButton_control__text__wrapper__9s8VY{display:flex;align-items:flex-start;justify-content:center;flex-direction:column;gap:.5rem;min-height:1.25rem}.radioButton_control__text__Xtvha{display:flex;align-items:flex-start;justify-content:center;height:1rem;flex-direction:column}html[dir=ltr] .radioButton_control__text__Xtvha,html[lang=en] .radioButton_control__text__Xtvha{font-family:"Inter",sans-serif;font-size:.875rem;font-style:normal;line-height:1.5rem;letter-spacing:.01rem;font-weight:500}html[dir=rtl] .radioButton_control__text__Xtvha,html[lang=ar] .radioButton_control__text__Xtvha{font-family:"Cairo",sans-serif;font-size:.875rem;font-style:normal;line-height:1.5rem;letter-spacing:.01rem;font-weight:600}html[dir=ltr] .radioButton_control__hint__jOlEd,html[lang=en] .radioButton_control__hint__jOlEd{font-family:"Inter",sans-serif;font-size:.875rem;font-style:normal;line-height:1.125rem;letter-spacing:.01rem;font-weight:400}html[dir=rtl] .radioButton_control__hint__jOlEd,html[lang=ar] .radioButton_control__hint__jOlEd{font-family:"Cairo",sans-serif;font-size:.875rem;font-style:normal;line-height:1.125rem;letter-spacing:.01rem;font-weight:400}.radioButton_control__text__Xtvha,.radioButton_control__hint__jOlEd{color:#475467;margin-inline-start:2rem}.radioButton_control__indicator__osGaw{position:absolute;top:1rem;inset-inline-start:1rem;border:1px solid #d0d5dd;background:#fff}.radioButton_control__indicator__osGaw[data-radio-size=sm]{height:1rem;width:1rem;padding:.125rem}.radioButton_control__indicator__osGaw[data-radio-size=md]{width:1.25rem;height:1.25rem;padding:.125rem}.radioButton_control__radio__gtkyL .radioButton_control__indicator__osGaw{border-radius:50%}.radioButton_control__Yh5dG:hover input~.radioButton_control__indicator__osGaw,.radioButton_control__Yh5dG input:focus~.radioButton_control__indicator__osGaw{border:1px solid #144dff;background:#e8edff}.radioButton_control__Yh5dG input:checked~.radioButton_control__indicator__osGaw{background:#144dff;border:none}.radioButton_control__Yh5dG:hover input:not([disabled]):checked~.radioButton_control__indicator__osGaw,.radioButton_control__Yh5dG input:checked:focus~.radioButton_control__indicator__osGaw{background:#144dff}.radioButton_control__Yh5dG input:disabled~.radioButton_control__indicator__osGaw{border:1px solid #d0d5dd;background:#f2f4f7;opacity:.6;pointer-events:none}.radioButton_control__indicator__osGaw:after{content:"";position:absolute;display:none}.radioButton_control__Yh5dG input:checked~.radioButton_control__indicator__osGaw:after{display:block}.radioButton_control__radio__gtkyL .radioButton_control__indicator__osGaw:after{border-radius:50%;background:#fff}.radioButton_control__radio__gtkyL input:disabled~.radioButton_control__indicator__osGaw:after{background:#98a2b3}.radioButton_control__indicator__osGaw[data-radio-size=sm]:after{inset-inline-start:5px;top:5px;height:6px;width:6px}.radioButton_control__radio__gtkyL input:disabled~.radioButton_control__indicator__osGaw[data-radio-size=sm]:after{inset-inline-start:4px;top:4px}.radioButton_control__indicator__osGaw[data-radio-size=md]:after{inset-inline-start:6px;top:6px;height:8px;width:8px}.radioButton_control__radio__gtkyL input:disabled~.radioButton_control__indicator__osGaw[data-radio-size=md]:after{inset-inline-start:5px;top:5px}
412
412
  .toggle_toggle__bi00k{position:relative;display:inline-block;border-radius:2.125rem;margin:0}.toggle_toggle__bi00k>input{opacity:0;width:0;height:0;margin:0}.toggle_toggle__bi00k>input:checked+.toggle_toggle__slider__Y7jmz:before{border-radius:50%}.toggle_toggle__slider__Y7jmz{border-radius:2.125rem;position:absolute;cursor:pointer;inset:0;transition:.4s}.toggle_toggle__slider__Y7jmz:before{position:absolute;content:"";background-color:#fff;transition:.4s;border-radius:50%;top:50%;filter:drop-shadow(0rem 0.0625rem 0.125rem rgba(16, 24, 40, 0.06)) drop-shadow(0rem 0.0625rem 0.1875rem rgba(16, 24, 40, 0.1));transform:translateY(-50%)}.toggle_toggle__bi00k:is([data-toggle-size=sm]){width:2.25rem;height:1.25rem}.toggle_toggle__bi00k:is([data-toggle-size=sm]) .toggle_toggle__slider__Y7jmz:before{width:1rem;height:1rem;inset-inline-start:calc(0% + .125rem)}.toggle_toggle__bi00k:is([data-toggle-size=sm])>input:checked+.toggle_toggle__slider__Y7jmz:before{inset-inline-start:calc(100% - 1rem - .125rem)}.toggle_toggle__bi00k:is([data-toggle-size=md]){width:2.75rem;height:1.5rem}.toggle_toggle__bi00k:is([data-toggle-size=md]) .toggle_toggle__slider__Y7jmz:before{width:1.25rem;height:1.25rem;inset-inline-start:calc(0% + .125rem)}.toggle_toggle__bi00k:is([data-toggle-size=md])>input:checked+.toggle_toggle__slider__Y7jmz:before{inset-inline-start:calc(100% - 1.25rem - .125rem)}.toggle_toggle__bi00k[data-toggle-color=default]>input:checked+.toggle_toggle__slider__Y7jmz{background-color:#04b389}.toggle_toggle__bi00k[data-toggle-color=warning]>input:checked+.toggle_toggle__slider__Y7jmz{background-color:#dc6803}.toggle_toggle__bi00k .toggle_toggle__slider__Y7jmz{background-color:#f2f4f7}.toggle_toggle__bi00k:is([data-toggle-is-hovered=true])[data-toggle-color=default]>input:checked+.toggle_toggle__slider__Y7jmz{background-color:#038f6e}.toggle_toggle__bi00k:is([data-toggle-is-hovered=true])[data-toggle-color=warning]>input:checked+.toggle_toggle__slider__Y7jmz{background-color:#b54708}.toggle_toggle__bi00k:is([data-toggle-is-hovered=true]) .toggle_toggle__slider__Y7jmz{background-color:#eaecf0}.toggle_toggle__bi00k:is([data-toggle-is-focused=true]):has(>input:not(:checked)){box-shadow:0rem 0rem 0rem .25rem #b9caff,0rem .0625rem .125rem 0rem rgba(16,24,40,.05)}.toggle_toggle__bi00k:is([data-toggle-is-focused=true])[data-toggle-color=default]:has(>input:checked){box-shadow:0rem 0rem 0rem .25rem #b4e8dc,0rem .0625rem .125rem 0rem rgba(16,24,40,.05)}.toggle_toggle__bi00k:is([data-toggle-is-focused=true])[data-toggle-color=default]>input:checked+.toggle_toggle__slider__Y7jmz{background-color:#04b389}.toggle_toggle__bi00k:is([data-toggle-is-focused=true])[data-toggle-color=warning]:has(>input:checked){box-shadow:0rem 0rem 0rem .25rem #fedf89,0rem .0625rem .125rem 0rem rgba(16,24,40,.05)}.toggle_toggle__bi00k:is([data-toggle-is-focused=true])[data-toggle-color=warning]>input:checked+.toggle_toggle__slider__Y7jmz{background-color:#dc6803}.toggle_toggle__bi00k:is([data-toggle-is-focused=true]) .toggle_toggle__slider__Y7jmz{background-color:#f9fafb}.toggle_toggle__bi00k:is([data-toggle-is-disabled=true]){pointer-events:none}.toggle_toggle__bi00k:is([data-toggle-is-disabled=true])[data-toggle-color=default]>input:checked+.toggle_toggle__slider__Y7jmz{background-color:#b4e8dc}.toggle_toggle__bi00k:is([data-toggle-is-disabled=true])[data-toggle-color=warning]>input:checked+.toggle_toggle__slider__Y7jmz{background-color:#fedf89}.toggle_toggle__bi00k:is([data-toggle-is-disabled=true]) .toggle_toggle__slider__Y7jmz{background-color:#f2f4f7}
package/main.js CHANGED
@@ -35771,6 +35771,7 @@ const Checkboxes_Checkboxes = props => {
35771
35771
 
35772
35772
 
35773
35773
 
35774
+
35774
35775
  const DropdownMenu_DropdownMenu = props => {
35775
35776
  const {
35776
35777
  closeDropdown,
@@ -35792,6 +35793,12 @@ const DropdownMenu_DropdownMenu = props => {
35792
35793
  onToggleHandler
35793
35794
  } = props;
35794
35795
  const menuRef = useRef(null);
35796
+ // Optional callback provided by parent to register the actual menu DOM node
35797
+ // (useful when the menu is portaled to document.body so parent can include
35798
+ // the menu in click-outside detection).
35799
+ const {
35800
+ registerMenuRef
35801
+ } = props;
35795
35802
  const [fixedPosition, setFixedPosition] = useState(null);
35796
35803
  const [isPositioned, setIsPositioned] = useState(false);
35797
35804
  const calculateVerticalPosition = useCallback((rect, menuRect, effectiveVertical, isInlineHorizontal) => {
@@ -35888,9 +35895,13 @@ const DropdownMenu_DropdownMenu = props => {
35888
35895
  setTimeout(() => setIsPositioned(true), 20);
35889
35896
  });
35890
35897
  const cleanup = setupEventListeners(computePosition);
35898
+ // Inform parent about the mounted menu element so clicks inside the
35899
+ // portaled menu aren't treated as outside clicks.
35900
+ registerMenuRef == null || registerMenuRef(menuRef.current || null);
35891
35901
  return () => {
35892
35902
  cancelAnimationFrame(raf);
35893
35903
  cleanup();
35904
+ registerMenuRef == null || registerMenuRef(null);
35894
35905
  };
35895
35906
  } else {
35896
35907
  setIsPositioned(false);
@@ -35938,7 +35949,15 @@ const DropdownMenu_DropdownMenu = props => {
35938
35949
  useEffect(() => {
35939
35950
  onToggleHandler == null || onToggleHandler(open != null ? open : isOpen);
35940
35951
  }, [open, isOpen]);
35941
- return (open != null ? open : isOpen) ? /*#__PURE__*/_jsxs("div", {
35952
+
35953
+ // Render the positioned menu into document.body to avoid clipping and stacking
35954
+ // context issues on iOS browsers. Use a portal so `position: fixed` is truly
35955
+ // relative to the viewport and not accidentally bounded by transformed/stacked
35956
+ // ancestors.
35957
+ if (!(open != null ? open : isOpen)) return /*#__PURE__*/_jsx(_Fragment, {
35958
+ children: " "
35959
+ });
35960
+ const menu = /*#__PURE__*/_jsxs("div", {
35942
35961
  ref: menuRef,
35943
35962
  className: `${styles['dropdown-menu']} ${isPositioned ? styles['dropdown-menu--open'] : ''}`,
35944
35963
  "data-dropdown-menu-horizontal": horizontal_placement,
@@ -35946,7 +35965,7 @@ const DropdownMenu_DropdownMenu = props => {
35946
35965
  "data-dropdown-menu-width": width,
35947
35966
  style: Object.assign({
35948
35967
  maxHeight: maxHeight,
35949
- overflowY: maxHeight === 'fit-content' ? "visible" : "auto",
35968
+ overflowY: maxHeight === 'fit-content' ? 'visible' : 'auto',
35950
35969
  width: widthStyle,
35951
35970
  visibility: isPositioned ? 'visible' : 'hidden',
35952
35971
  pointerEvents: isPositioned ? 'auto' : 'none'
@@ -35963,9 +35982,21 @@ const DropdownMenu_DropdownMenu = props => {
35963
35982
  });
35964
35983
  return childDropdownMenuItem ? childDropdownMenuItem : child;
35965
35984
  }), additionalContent]
35966
- }) : /*#__PURE__*/_jsx(_Fragment, {
35967
- children: " "
35968
35985
  });
35986
+
35987
+ // Choose a portal container:
35988
+ // - If the dropdown trigger lives inside a <dialog>, portal into that dialog
35989
+ // so the menu renders above the dialog backdrop.
35990
+ // - Otherwise portal into document.body as before.
35991
+ if (typeof document === 'undefined') return menu;
35992
+ let portalContainer = null;
35993
+ try {
35994
+ const triggerEl = dropdownRef == null ? void 0 : dropdownRef.current;
35995
+ portalContainer = (triggerEl == null ? void 0 : triggerEl.closest) && triggerEl.closest('dialog') || document.body;
35996
+ } catch (e) {
35997
+ portalContainer = document.body;
35998
+ }
35999
+ return /*#__PURE__*/createPortal(menu, portalContainer);
35969
36000
  };
35970
36001
  ;// ../../libs/design-system/src/components/Dropdown/dropdown.module.scss
35971
36002
  // extracted by mini-css-extract-plugin
@@ -35992,6 +36023,7 @@ const Dropdown_Dropdown = /*#__PURE__*/(/* unused pure expression or super */ nu
35992
36023
  onToggleHandler
35993
36024
  }, ref) => {
35994
36025
  const dropdownRef = useRef();
36026
+ const menuElementRef = useRef(null);
35995
36027
  const [isOpen, setIsOpen] = useState(false);
35996
36028
  const toggleDropdown = () => {
35997
36029
  setIsOpen(!isOpen);
@@ -36001,7 +36033,9 @@ const Dropdown_Dropdown = /*#__PURE__*/(/* unused pure expression or super */ nu
36001
36033
  setIsOpen(false);
36002
36034
  onToggleHandler == null || onToggleHandler(false);
36003
36035
  };
36004
- _closeOnClickOutside && useClickOutside(dropdownRef, closeDropdown, isOpen);
36036
+
36037
+ // Listen for clicks outside both the trigger wrapper and the portaled menu element
36038
+ _closeOnClickOutside && useClickOutside([dropdownRef, menuElementRef], closeDropdown, isOpen);
36005
36039
  return /*#__PURE__*/_jsxs("div", Object.assign({
36006
36040
  id: id,
36007
36041
  className: styles['dropdown']
@@ -36023,7 +36057,12 @@ const Dropdown_Dropdown = /*#__PURE__*/(/* unused pure expression or super */ nu
36023
36057
  const childDropdownMenu = cloneNestedComponent(child, DropdownMenu, {
36024
36058
  isOpen: isOpen,
36025
36059
  closeDropdown: closeDropdown,
36026
- dropdownRef: ref || dropdownRef
36060
+ dropdownRef: ref || dropdownRef,
36061
+ // Provide a way for the menu to register its actual DOM node so
36062
+ // click-outside detection can account for portaled menus.
36063
+ registerMenuRef: el => {
36064
+ menuElementRef.current = el;
36065
+ }
36027
36066
  });
36028
36067
  const childDropdownButton = cloneNestedComponent(child, DropdownButton, {
36029
36068
  toggleDropdown: toggleDropdown,
@@ -69079,6 +69118,7 @@ const FiltersBar_FiltersBar = ({
69079
69118
  const [key, setKey] = useState(0);
69080
69119
  const [sortedFieldsFilter, setSortedFieldsFilter] = useState([]);
69081
69120
  const [fieldsErrors, setFieldsErrors] = useState({});
69121
+ const [tempSearchValues, setTempSearchValues] = useState({});
69082
69122
  const [multipleSelection, setMultipleSelection] = useState(defaultMultipleSelection);
69083
69123
  useEffect(() => {
69084
69124
  filtersList.length && Object.keys(defaultMultipleSelection).length && !Object.keys(multipleSelection).length && setMultipleSelection(defaultMultipleSelection);
@@ -69090,6 +69130,15 @@ const FiltersBar_FiltersBar = ({
69090
69130
  }) : item;
69091
69131
  });
69092
69132
  });
69133
+
69134
+ // keep local search input values in sync with parent `filtersList`
69135
+ const nextSearchVals = {};
69136
+ filtersList.filter(filter => (filter == null ? void 0 : filter.type) === 'search').forEach(f => {
69137
+ if (typeof f.value !== 'undefined' && f.value !== null) {
69138
+ nextSearchVals[f.id] = String(f.value);
69139
+ }
69140
+ });
69141
+ setTempSearchValues(nextSearchVals);
69093
69142
  }, [filtersList]);
69094
69143
  const handleFieldsFilter = (filter, value, action) => {
69095
69144
  if (action === 'add') {
@@ -69142,6 +69191,7 @@ const FiltersBar_FiltersBar = ({
69142
69191
  resetFilters == null || resetFilters();
69143
69192
  setSortedFieldsFilter([]);
69144
69193
  setFieldsErrors({});
69194
+ setTempSearchValues({});
69145
69195
  };
69146
69196
  const handleClear = filter => {
69147
69197
  const {
@@ -69172,18 +69222,25 @@ const FiltersBar_FiltersBar = ({
69172
69222
  children: isLoading != null && isLoading.filters ? /*#__PURE__*/_jsx(SkeletonBase, {
69173
69223
  height: "2.5rem"
69174
69224
  }) : filtersList.length ? /*#__PURE__*/_jsxs(_Fragment, {
69175
- children: [searchFilters.map((filter, index) => /*#__PURE__*/_jsx(Input, {
69176
- id: filter.id,
69177
- name: `${filter.type}-filter-${index}`,
69178
- placeholder: filter.placeholder,
69179
- leadingIcon: MagnifyingGlass,
69180
- disabled: isLoading == null ? void 0 : isLoading.table,
69181
- onChange: e => {
69182
- const value = e.target.value;
69183
- debouncedFiltersChangeHandler(filter, value);
69184
- }
69185
- }, `${filter.id}-filter-${index}`)), selectFilters.map((filter, index) => {
69186
- var _ref, _multipleSelection$id, _multipleSelection$id2, _multipleSelection$id3;
69225
+ children: [searchFilters.map((filter, index) => {
69226
+ var _ref, _tempSearchValues$fil;
69227
+ return /*#__PURE__*/_jsx(Input, {
69228
+ id: filter.id,
69229
+ name: `${filter.type}-filter-${index}`,
69230
+ placeholder: filter.placeholder,
69231
+ leadingIcon: MagnifyingGlass,
69232
+ value: (_ref = (_tempSearchValues$fil = tempSearchValues[filter.id]) != null ? _tempSearchValues$fil : filter.value) != null ? _ref : "",
69233
+ disabled: isLoading == null ? void 0 : isLoading.table,
69234
+ onChange: e => {
69235
+ const value = e.target.value;
69236
+ setTempSearchValues(prev => Object.assign({}, prev, {
69237
+ [filter.id]: value
69238
+ }));
69239
+ debouncedFiltersChangeHandler(filter, value);
69240
+ }
69241
+ }, `${filter.id}-filter-${index}`);
69242
+ }), selectFilters.map((filter, index) => {
69243
+ var _ref2, _multipleSelection$id, _multipleSelection$id2, _multipleSelection$id3;
69187
69244
  const {
69188
69245
  id,
69189
69246
  type,
@@ -69196,7 +69253,7 @@ const FiltersBar_FiltersBar = ({
69196
69253
  maxHeight,
69197
69254
  countList
69198
69255
  } = filter;
69199
- const multipleSelectionSummaryCount = (_ref = countList || []) == null ? void 0 : _ref.reduce((acc, n) => typeof n === 'number' ? acc + n : acc, 0);
69256
+ const multipleSelectionSummaryCount = (_ref2 = countList || []) == null ? void 0 : _ref2.reduce((acc, n) => typeof n === 'number' ? acc + n : acc, 0);
69200
69257
  let dropdownBtnText;
69201
69258
  if (Array.isArray(selectedOptions)) {
69202
69259
  if (selectedOptions.length === (options == null ? void 0 : options.length)) {
@@ -80979,11 +81036,13 @@ const assets_icons_knet_namespaceObject = "data:image/png;base64,iVBORw0KGgoAAAA
80979
81036
 
80980
81037
 
80981
81038
 
81039
+
80982
81040
  function Knet(props) {
80983
81041
  var _customStyle$paymentM, _customStyle$paymentM2, _customStyle$knetText, _customStyle$knetText2, _customStyle$knetText3, _customStyle$knetText4, _customStyle$knetText5, _customStyle$knetText6, _customStyle$knetText7, _customStyle$knetText8, _customStyle$knetText9, _customStyle$knetText0;
80984
81042
  const {
80985
81043
  t
80986
81044
  } = useTranslation_useTranslation('knet');
81045
+ const [errorMessage, setErrorMessage] = (0,react.useState)(null);
80987
81046
  const {
80988
81047
  onPaySubmit,
80989
81048
  loading,
@@ -80992,8 +81051,26 @@ function Knet(props) {
80992
81051
  customStyle,
80993
81052
  EquivalentAmount,
80994
81053
  KnetCurrency,
80995
- paymentMethodsCount
81054
+ paymentMethodsCount,
81055
+ minAmount
80996
81056
  } = props;
81057
+ (0,react.useEffect)(() => {
81058
+ if (minAmount == null) return;
81059
+ if (EquivalentAmount !== undefined) {
81060
+ if (minAmount > Number(EquivalentAmount)) {
81061
+ var _customStyle$KnetErro;
81062
+ setErrorMessage((_customStyle$KnetErro = customStyle == null ? void 0 : customStyle.KnetErrorMsg) != null ? _customStyle$KnetErro : `Minimum amount is ${minAmount}`);
81063
+ return;
81064
+ }
81065
+ } else {
81066
+ if (minAmount > Number(amount)) {
81067
+ var _customStyle$KnetErro2;
81068
+ setErrorMessage((_customStyle$KnetErro2 = customStyle == null ? void 0 : customStyle.KnetErrorMsg) != null ? _customStyle$KnetErro2 : `Minimum amount is ${minAmount}`);
81069
+ return;
81070
+ }
81071
+ }
81072
+ setErrorMessage(null);
81073
+ }, [minAmount, EquivalentAmount, amount]);
80997
81074
  function formatNumber(val) {
80998
81075
  return val.toLocaleString(undefined, {
80999
81076
  minimumFractionDigits: 2,
@@ -81046,7 +81123,12 @@ function Knet(props) {
81046
81123
  color: 'primary',
81047
81124
  customStyle: customStyle == null ? void 0 : customStyle.button,
81048
81125
  onClick: onPaySubmit,
81049
- disabled: loading
81126
+ disabled: loading || errorMessage !== null
81127
+ }), errorMessage && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
81128
+ className: "mb-4 [&>div]:mb-0",
81129
+ children: /*#__PURE__*/(0,jsx_runtime.jsx)(ErrorMessageViewTwo_ErrorMessage, {
81130
+ errorMessage: errorMessage
81131
+ })
81050
81132
  }), /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
81051
81133
  className: "h-4 text-[#344054] font-inter text-sm font-medium mt-6",
81052
81134
  children: (_customStyle$knetText9 = customStyle == null || (_customStyle$knetText0 = customStyle.knetText) == null ? void 0 : _customStyle$knetText0.KNET_REDIRECT) != null ? _customStyle$knetText9 : t('REDIRECT_KNET_PAGE')
@@ -81064,7 +81146,8 @@ const payWithKnet = (token, amount) => {
81064
81146
  amount_cents: amount,
81065
81147
  subtype: 'KNET'
81066
81148
  },
81067
- payment_token: token
81149
+ payment_token: token,
81150
+ api_source: " Pixel"
81068
81151
  }).then(res => res).catch(err => err == null ? void 0 : err.response);
81069
81152
  };
81070
81153
  ;// ./src/components/Payments/Knet/index.tsx
@@ -81083,7 +81166,8 @@ function KnetElement({
81083
81166
  amount,
81084
81167
  currency,
81085
81168
  KnetEquivalentAmountCents,
81086
- KnetCurrency
81169
+ KnetCurrency,
81170
+ minTransactionAmount
81087
81171
  } = payment;
81088
81172
  let KnetEquivalentAmount = null;
81089
81173
  if (KnetEquivalentAmountCents) {
@@ -81106,6 +81190,7 @@ function KnetElement({
81106
81190
  }
81107
81191
  };
81108
81192
  return /*#__PURE__*/(0,jsx_runtime.jsx)(Knet, {
81193
+ minAmount: minTransactionAmount,
81109
81194
  onPaySubmit: handlePay,
81110
81195
  loading: loading,
81111
81196
  paymentMethodsCount: paymentMethodsCount,
@@ -81158,11 +81243,30 @@ function KnetApplePay(props) {
81158
81243
  paymentName,
81159
81244
  country,
81160
81245
  EquivalentAmount,
81161
- KnetCurrency
81246
+ KnetCurrency,
81247
+ minAmount
81162
81248
  } = props;
81163
81249
  const {
81164
81250
  t
81165
81251
  } = useTranslation_useTranslation('knetApplePay');
81252
+ const [errorMessage, setErrorMessage] = (0,react.useState)(null);
81253
+ (0,react.useEffect)(() => {
81254
+ if (minAmount == null) return;
81255
+ if (EquivalentAmount !== undefined) {
81256
+ if (minAmount > Number(EquivalentAmount)) {
81257
+ var _customStyle$KnetErro;
81258
+ setErrorMessage((_customStyle$KnetErro = customStyle == null ? void 0 : customStyle.KnetErrorMsg) != null ? _customStyle$KnetErro : `Minimum amount is ${minAmount}`);
81259
+ return;
81260
+ }
81261
+ } else {
81262
+ if (minAmount > Number(amount)) {
81263
+ var _customStyle$KnetErro2;
81264
+ setErrorMessage((_customStyle$KnetErro2 = customStyle == null ? void 0 : customStyle.KnetErrorMsg) != null ? _customStyle$KnetErro2 : `Minimum amount is ${minAmount}`);
81265
+ return;
81266
+ }
81267
+ }
81268
+ setErrorMessage(null);
81269
+ }, [minAmount, EquivalentAmount, amount]);
81166
81270
  const [loading, setLoading] = (0,react.useState)(false);
81167
81271
  function formatNumber(amount) {
81168
81272
  return amount.toLocaleString(undefined, {
@@ -81176,128 +81280,109 @@ function KnetApplePay(props) {
81176
81280
  const displayAmount = formattedEquivalentAmount || formattedAmount;
81177
81281
  const handleSubmit = async () => {
81178
81282
  setLoading(true);
81179
- try {
81180
- const payload = {
81181
- countryCode: countryCode,
81182
- currencyCode: currency,
81183
- supportedNetworks: ['visa', 'masterCard', 'amex', 'discover', 'mada', 'maestro', 'electron', 'chinaUnionPay', 'jcb'],
81184
- requiredShippingContactFields: [],
81185
- merchantCapabilities: ['supports3DS'],
81186
- total: {
81187
- label: merchantName,
81188
- amount: amount
81189
- }
81190
- };
81191
- if (country === 'EGYPT') {
81192
- payload.supportedNetworks.push('meeza');
81193
- }
81194
- if (clientInfo === null) {
81195
- payload.requiredShippingContactFields = ['email', 'phone', 'name'];
81283
+ const payload = {
81284
+ countryCode: countryCode,
81285
+ currencyCode: currency,
81286
+ supportedNetworks: ['visa', 'masterCard', 'amex', 'discover', 'mada', 'maestro', 'electron', 'chinaUnionPay', 'jcb'],
81287
+ requiredShippingContactFields: [],
81288
+ merchantCapabilities: ['supports3DS'],
81289
+ total: {
81290
+ label: merchantName,
81291
+ amount: amount
81196
81292
  }
81197
- const session = new window.ApplePaySession(3, payload);
81198
- if (onBeforePaymentComplete) {
81199
- const result = await onBeforePaymentComplete(paymentName);
81200
- if (!result) {
81201
- setLoading(false);
81202
- return;
81203
- }
81293
+ };
81294
+ if (country === 'EGYPT') {
81295
+ payload.supportedNetworks.push('meeza');
81296
+ }
81297
+ if (clientInfo === null) {
81298
+ payload.requiredShippingContactFields = ['email', 'phone', 'name'];
81299
+ }
81300
+ const session = new window.ApplePaySession(3, payload);
81301
+ if (onBeforePaymentComplete) {
81302
+ const result = await onBeforePaymentComplete(paymentName);
81303
+ if (!result) {
81304
+ setLoading(false);
81305
+ return;
81204
81306
  }
81205
- session.onvalidatemerchant = async event => {
81307
+ }
81308
+ session.onvalidatemerchant = async event => {
81309
+ const merchantSession = await validatemerchant(event.validationURL, integrationId);
81310
+ session.completeMerchantValidation(merchantSession);
81311
+ };
81312
+ session.onpaymentauthorized = async event => {
81313
+ var _payRes$data, _payRes$data2, _payRes$data3;
81314
+ let clientData = null;
81315
+ if (!clientInfo) {
81206
81316
  try {
81207
- const merchantSession = await validatemerchant(event.validationURL, integrationId);
81208
- session.completeMerchantValidation(merchantSession);
81209
- } catch (error) {
81210
- console.error('Merchant validation error:', error);
81211
- session.abort();
81212
- setLoading(false);
81317
+ clientData = {
81318
+ name: event.payment.shippingContact.givenName || event.payment.shippingContact.familyName ? event.payment.shippingContact.givenName + ' ' + event.payment.shippingContact.familyName : 'NA NA',
81319
+ email: event.payment.shippingContact.emailAddress,
81320
+ phone: event.payment.shippingContact.phoneNumber
81321
+ };
81322
+ } catch (e) {
81323
+ clientData = {
81324
+ name: 'NA NA',
81325
+ email: 'NA',
81326
+ phone: 'NA'
81327
+ };
81213
81328
  }
81214
- };
81215
- session.onpaymentauthorized = async event => {
81216
81329
  try {
81217
- var _payRes$data, _payRes$data2, _payRes$data3;
81218
- let clientData = null;
81219
- if (!clientInfo) {
81220
- try {
81221
- clientData = {
81222
- name: event.payment.shippingContact.givenName || event.payment.shippingContact.familyName ? event.payment.shippingContact.givenName + ' ' + event.payment.shippingContact.familyName : 'NA NA',
81223
- email: event.payment.shippingContact.emailAddress,
81224
- phone: event.payment.shippingContact.phoneNumber
81225
- };
81226
- } catch (e) {
81227
- clientData = {
81228
- name: 'NA NA',
81229
- email: 'NA',
81230
- phone: 'NA'
81231
- };
81232
- }
81233
- try {
81234
- const contactResponse = await contactFormSubmit(clientData);
81235
- } catch (e) {
81236
- console.log(e);
81237
- }
81238
- }
81239
- const payRes = await knetApplePayPayment(paymentToken, JSON.stringify(event.payment.token.paymentData), clientData);
81240
- let status;
81241
- let resStatus = '';
81242
- if (payRes.status === 200 && String(payRes == null || (_payRes$data = payRes.data) == null ? void 0 : _payRes$data.success) === 'true') {
81243
- status = window.ApplePaySession.STATUS_SUCCESS;
81244
- resStatus = 'success';
81245
- } else if (payRes.status === 200 && String(payRes == null || (_payRes$data2 = payRes.data) == null ? void 0 : _payRes$data2.success) === 'false' && String(payRes == null || (_payRes$data3 = payRes.data) == null ? void 0 : _payRes$data3.pending) === 'false') {
81246
- status = window.ApplePaySession.STATUS_FAILURE;
81247
- resStatus = 'declined';
81248
- } else if (payRes.status === 400) {
81249
- var _payRes$data4, _payRes$data5;
81250
- let errorMessage = 'Payment is declined';
81251
- if ((_payRes$data4 = payRes.data) != null && _payRes$data4.message) {
81252
- errorMessage = payRes.data.message;
81253
- } else if ((_payRes$data5 = payRes.data) != null && _payRes$data5.msg) {
81254
- errorMessage = payRes.data.msg;
81255
- } else if (payRes.data instanceof Array && payRes.data[0]) {
81256
- errorMessage = payRes.data[0];
81257
- }
81258
- status = window.ApplePaySession.STATUS_FAILURE;
81259
- if (errorMessage === 'Retry limit reached.') {
81260
- resStatus = 'exceeded';
81261
- } else if (errorMessage === 'Order has already been paid.') {
81262
- resStatus = 'already_processed';
81263
- } else if (errorMessage === 'Order already being processed for payment.') {
81264
- resStatus = 'already_processed';
81265
- } else {
81266
- resStatus = 'declined';
81267
- }
81268
- } else {
81269
- status = window.ApplePaySession.STATUS_FAILURE;
81270
- resStatus = 'invalid';
81271
- }
81272
- if (onAfterPaymentComplete) {
81273
- session.completePayment({
81274
- status
81275
- });
81276
- onAfterPaymentComplete(payRes);
81277
- } else {
81278
- onSubmit(resStatus, payRes.data);
81279
- session.completePayment({
81280
- status
81281
- });
81282
- }
81283
- } catch (error) {
81284
- console.error('Payment authorization error:', error);
81285
- session.completePayment({
81286
- status: window.ApplePaySession.STATUS_FAILURE
81287
- });
81288
- } finally {
81289
- setLoading(false);
81330
+ const contactResponse = await contactFormSubmit(clientData);
81331
+ } catch (e) {
81332
+ console.log(e);
81290
81333
  }
81291
- };
81292
- session.oncancel = () => {
81293
- setLoading(false);
81294
- onPaymentCancel == null || onPaymentCancel();
81295
- };
81296
- session.begin();
81297
- } catch (error) {
81298
- console.error('Apple Pay session error:', error);
81334
+ }
81335
+ const payRes = await knetApplePayPayment(JSON.stringify(event.payment.token.paymentData), paymentToken, clientData);
81299
81336
  setLoading(false);
81300
- }
81337
+ let status;
81338
+ let resStatus = '';
81339
+ if (payRes.status === 200 && String(payRes == null || (_payRes$data = payRes.data) == null ? void 0 : _payRes$data.success) === 'true') {
81340
+ status = window.ApplePaySession.STATUS_SUCCESS;
81341
+ resStatus = 'success';
81342
+ } else if (payRes.status === 200 && String(payRes == null || (_payRes$data2 = payRes.data) == null ? void 0 : _payRes$data2.success) === 'false' && String(payRes == null || (_payRes$data3 = payRes.data) == null ? void 0 : _payRes$data3.pending) === 'false') {
81343
+ status = window.ApplePaySession.STATUS_FAILURE;
81344
+ resStatus = 'declined';
81345
+ } else if (payRes.status === 400) {
81346
+ var _payRes$data4, _payRes$data5;
81347
+ let errorMessage = 'Payment is declined';
81348
+ if ((_payRes$data4 = payRes.data) != null && _payRes$data4.message) {
81349
+ errorMessage = payRes.data.message;
81350
+ } else if ((_payRes$data5 = payRes.data) != null && _payRes$data5.msg) {
81351
+ errorMessage = payRes.data.msg;
81352
+ } else if (payRes.data instanceof Array && payRes.data[0]) {
81353
+ errorMessage = payRes.data[0];
81354
+ }
81355
+ status = window.ApplePaySession.STATUS_FAILURE;
81356
+ if (errorMessage === 'Retry limit reached.') {
81357
+ resStatus = 'exceeded';
81358
+ } else if (errorMessage === 'Order has already been paid.') {
81359
+ resStatus = 'already_processed';
81360
+ } else if (errorMessage === 'Order already being processed for payment.') {
81361
+ resStatus = 'already_processed';
81362
+ } else {
81363
+ resStatus = 'declined';
81364
+ }
81365
+ } else {
81366
+ status = window.ApplePaySession.STATUS_FAILURE;
81367
+ resStatus = 'invalid';
81368
+ }
81369
+ if (onAfterPaymentComplete) {
81370
+ session.completePayment({
81371
+ status
81372
+ });
81373
+ onAfterPaymentComplete(payRes);
81374
+ } else {
81375
+ onSubmit(resStatus, payRes.data);
81376
+ session.completePayment({
81377
+ status
81378
+ });
81379
+ }
81380
+ };
81381
+ session.oncancel = () => {
81382
+ setLoading(false);
81383
+ onPaymentCancel == null || onPaymentCancel();
81384
+ };
81385
+ session.begin();
81301
81386
  };
81302
81387
  return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
81303
81388
  children: [paymentMethodsCount === 1 && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
@@ -81338,8 +81423,13 @@ function KnetApplePay(props) {
81338
81423
  icon: apple_pay_namespaceObject,
81339
81424
  className: "h-[44px] px-4 py-[10px] flex justify-center items-center gap-3 rounded-lg bg-black w-full",
81340
81425
  onClick: handleSubmit,
81341
- disabled: loading || isLoading,
81426
+ disabled: loading || isLoading || errorMessage !== null,
81342
81427
  loading: loading || isLoading
81428
+ }), errorMessage && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
81429
+ className: "mt-4 [&>div]:mb-0",
81430
+ children: /*#__PURE__*/(0,jsx_runtime.jsx)(ErrorMessageViewTwo_ErrorMessage, {
81431
+ errorMessage: errorMessage
81432
+ })
81343
81433
  })]
81344
81434
  });
81345
81435
  }
@@ -81358,6 +81448,7 @@ const knetApplePayPayment = async (paymentToken, applePaytoken, clientData) => {
81358
81448
  var _clientData$name$trim, _clientData$name$trim2, _clientData$name$trim3, _clientData$name$trim4;
81359
81449
  return lib_axios.post(`/api/acceptance/payments/pay`, Object.assign({
81360
81450
  payment_token: paymentToken,
81451
+ api_source: "Pixel",
81361
81452
  source: {
81362
81453
  identifier: applePaytoken,
81363
81454
  subtype: 'KNET_APPLE_PAY'
@@ -81405,7 +81496,8 @@ function KnetApplePayElement(_ref) {
81405
81496
  currency,
81406
81497
  KnetEquivalentAmountCents,
81407
81498
  KnetCurrency,
81408
- merchantName
81499
+ merchantName,
81500
+ minTransactionAmount
81409
81501
  } = payment;
81410
81502
  const applePay = payment;
81411
81503
  let KnetEquivalentAmount = null;
@@ -81434,7 +81526,8 @@ function KnetApplePayElement(_ref) {
81434
81526
  isLoading: isLoading,
81435
81527
  paymentName: payment.name,
81436
81528
  EquivalentAmount: KnetEquivalentAmount !== null ? String(KnetEquivalentAmount) : undefined,
81437
- KnetCurrency: KnetCurrency
81529
+ KnetCurrency: KnetCurrency,
81530
+ minAmount: minTransactionAmount
81438
81531
  });
81439
81532
  }
81440
81533
  /* harmony default export */ const Payments_KnetApplePay = (KnetApplePayElement);
@@ -82066,6 +82159,7 @@ async function fetchPayments(publicKey, clientSecret, paymentMethods, baseUrl) {
82066
82159
  currency: item.currency,
82067
82160
  KnetCurrency: item.target_currency,
82068
82161
  KnetEquivalentAmountCents: item.converted_amount_cents,
82162
+ KnetMinTransactionAmount: item.minimum_transaction_amount,
82069
82163
  paymentMethodType,
82070
82164
  useCvv,
82071
82165
  subType
@@ -82710,6 +82804,7 @@ function getStyles_getStyles(customStyle) {
82710
82804
  KNET_REDIRECT: customStyle == null || (_customStyle$Knet_Tex4 = customStyle.Knet_Text) == null ? void 0 : _customStyle$Knet_Tex4.KNET_REDIRECT,
82711
82805
  PAY_KNET_BUTTON: customStyle == null || (_customStyle$Knet_Tex5 = customStyle.Knet_Text) == null ? void 0 : _customStyle$Knet_Tex5.PAY_KNET_BUTTON
82712
82806
  };
82807
+ const KnetErrorMsg = customStyle == null ? void 0 : customStyle.Knet_Error_Msg;
82713
82808
  const knetApplePayText = {
82714
82809
  AMOUNT_ORDER: customStyle == null || (_customStyle$Knet_App = customStyle.Knet_Apple_Pay_Text) == null ? void 0 : _customStyle$Knet_App.AMOUNT_ORDER,
82715
82810
  EQWIVALENT_AMOUNT: customStyle == null || (_customStyle$Knet_App2 = customStyle.Knet_Apple_Pay_Text) == null ? void 0 : _customStyle$Knet_App2.EQWIVALENT_AMOUNT,
@@ -82743,7 +82838,8 @@ function getStyles_getStyles(customStyle) {
82743
82838
  hideCardLabel: customStyle == null ? void 0 : customStyle.HideCardLabel,
82744
82839
  paymentMethodsText,
82745
82840
  knetText,
82746
- knetApplePayText
82841
+ knetApplePayText,
82842
+ KnetErrorMsg
82747
82843
  };
82748
82844
  }
82749
82845
  ;// ./src/components/Payments/index.tsx
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "paymob-pixel-alpha",
3
- "version": "1.1.40",
3
+ "version": "1.1.41",
4
4
  "keywords": ["paymob","pixel","paymob-pixel"],
5
5
  "main": "./main.js",
6
6
  "license": "MIT",