document.addEventListener("DOMContentLoaded",function(){var t=document.getElementById("range-search-data");if(t){let e=new DataTable(t,{dom:"<'d-md-flex justify-content-between align-items-center my-2'<'filter-range me-2'>f>rt<'d-md-flex justify-content-between align-items-center mt-2'ip>",language:{paginate:{first:'<svg  xmlns="http://www.w3.org/2000/svg"  width="24"  height="24"  viewBox="0 0 24 24"  fill="none"  stroke="currentColor"  stroke-width="2"  stroke-linecap="round"  stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M11 7l-5 5l5 5" /><path d="M17 7l-5 5l5 5" /></svg>',previous:'<svg  xmlns="http://www.w3.org/2000/svg"  width="24"  height="24"  viewBox="0 0 24 24"  fill="none"  stroke="currentColor"  stroke-width="2"  stroke-linecap="round"  stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M15 6l-6 6l6 6" /></svg>',next:'<svg  xmlns="http://www.w3.org/2000/svg"  width="24"  height="24"  viewBox="0 0 24 24"  fill="none"  stroke="currentColor"  stroke-width="2"  stroke-linecap="round"  stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M9 6l6 6l-6 6" /></svg>',last:'<svg  xmlns="http://www.w3.org/2000/svg"  width="24"  height="24"  viewBox="0 0 24 24"  fill="none"  stroke="currentColor"  stroke-width="2"  stroke-linecap="round"  stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M7 7l5 5l-5 5" /><path d="M13 7l5 5l-5 5" /></svg>'}}});t=document.querySelector(".filter-range");if(t){t.innerHTML=`
            <div class="d-flex align-items-center gap-2 my-2">
                <label class="fw-semibold">Price: </label>
                <input type="text" class="form-control form-control-sm" placeholder="Min" id="min">
                <input type="text" class="form-control form-control-sm" placeholder="Max" id="max">
            </div>`;let r=document.getElementById("min"),l=document.getElementById("max");r&&l?(e.search.fixed("range",function(e,t){var n=parseFloat(r.value)||NaN,o=parseFloat(l.value)||NaN,t=(t[2]||"").replace(/[^0-9.]/g,""),t=parseFloat(t)||0;return isNaN(n)&&isNaN(o)||isNaN(n)&&t<=o||n<=t&&isNaN(o)||n<=t&&t<=o}),r.addEventListener("input",()=>e.draw()),l.addEventListener("input",()=>e.draw())):console.error("Range filter elements not found.")}}});