index of
/
home
/
thefkyzp
/
hulmvisaadvisor.com
/
wp-content
/
plugins
/
surecart
/
dist
/
components
/
esm
/
File: /home/thefkyzp/hulmvisaadvisor.com/wp-content/plugins/surecart/dist/components/esm/util-50af2a83.js
const isValidURL=n=>{let o;try{o=new URL(n)}catch(n){return!1}return"http:"===o.protocol||"https:"===o.protocol},getValueFromUrl=n=>{const o=window.location.search;return new URLSearchParams(o).get(n)},sortByArray=(n,o,t)=>(n||[]).sort(((n,a)=>-1===t.indexOf(null==n?void 0:n[o])?1:-1===t.indexOf(null==a?void 0:a[o])?-1:t.indexOf(null==n?void 0:n[o])-t.indexOf(null==a?void 0:a[o]))),getVariantFromValues=({variants:n,values:o})=>{const t=Object.keys(o);for(const a of n){const n=["option_1","option_2","option_3"].map((n=>a[n])).filter((n=>null!=n));if((null==n?void 0:n.length)===(null==t?void 0:t.length)&&t.every((t=>n.includes(o[t]))))return a}return null},isInRange=(n,o)=>{const t=parseInt(n);return!(o&&((null==o?void 0:o.ad_hoc_max_amount)||(null==o?void 0:o.ad_hoc_min_amount))&&((null==o?void 0:o.ad_hoc_max_amount)&&t>(null==o?void 0:o.ad_hoc_max_amount)||(null==o?void 0:o.ad_hoc_min_amount)&&t<(null==o?void 0:o.ad_hoc_min_amount)))};export{getValueFromUrl as a,isValidURL as b,getVariantFromValues as g,isInRange as i,sortByArray as s};