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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>BPS Price List Search</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        .fade-in {
            animation: fadeIn 0.5s ease-in-out;
        }
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }
        .search-highlight {
            background-color: #fef2f2;
            padding: 0 2px;
            border-radius: 2px;
        }
        .price-cell {
            min-width: 80px;
        }
        .password-container {
            position: relative;
        }
        .password-box {
            background: white;
            padding: 2.5rem;
            border-radius: 1rem;
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
            width: 100%;
            max-width: 400px;
            text-align: center;
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            z-index: 10;
        }
        .shake {
            animation: shake 0.5s;
        }
        @keyframes shake {
            0%, 100% { transform: translateX(0); }
            20%, 60% { transform: translateX(-5px); }
            40%, 80% { transform: translateX(5px); }
        }
        .locked-content {
            filter: blur(5px);
            pointer-events: none;
            user-select: none;
        }
        .password-overlay {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(255, 255, 255, 0.9);
            z-index: 5;
        }
    </style>
    <!-- Main Content Area -->
    <main class="container mx-auto px-4 py-8">
        <!-- Password Protected Section -->
        <div class="password-container bg-white rounded-xl shadow-lg p-6 mb-8 relative min-h-[500px]">
            <!-- Password Overlay (only covers this section) -->
            <div id="passwordOverlay" class="password-overlay"></div>
            
            <!-- Password Box (centered within this section) -->
            <div id="passwordBox" class="password-box">
                <div class="flex justify-center mb-6">
                    <div class="bg-red-100 p-4 rounded-full">
                        <i class="fas fa-lock text-red-600 text-3xl"></i>
                    </div>
                </div>
                <h2 class="text-2xl font-bold text-gray-800 mb-2">BPS Price List</h2>
                <p class="text-gray-600 mb-6">Enter password to access the pricing system</p>
                
                <div class="mb-4">
                    <div class="relative">
                        <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
                            <i class="fas fa-key text-gray-400"></i>
                        </div>
                        <input 
                            type="password" 
                            id="passwordInput" 
                            class="block w-full pl-10 pr-3 py-3 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-red-500 focus:border-red-500" 
                            placeholder="Enter password..."
                            autocomplete="off"
                        >
                    </div>
                    <p id="passwordError" class="text-red-500 text-sm mt-1 hidden">Incorrect password. Please try again.</p>
                </div>
                
                <button 
                    id="passwordSubmit" 
                    class="w-full px-6 py-3 bg-red-600 text-white font-medium rounded-lg hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 transition-colors"
                >
                    Unlock
                </button>
            </div>

            <!-- Main Content (blurred and locked until password is entered) -->
            <div id="mainContent" class="locked-content">
                <div class="text-center mb-10">
                    <h1 class="text-4xl font-bold text-red-700 mb-2">BPS Price List</h1>
                    <p class="text-gray-600">Search for products to view pricing and information</p>
                </div>

                <div class="bg-white rounded-xl shadow-lg p-6 mb-8">
                    <div class="flex items-center mb-6">
                        <div class="flex-1 relative">
                            <label for="search" class="block text-sm font-medium text-gray-700 mb-1">Search by Best # or Description</label>
                            <div class="relative">
                                <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
                                    <i class="fas fa-search text-gray-400"></i>
                                </div>
                                <input 
                                    type="text" 
                                    id="search" 
                                    class="block w-full pl-10 pr-3 py-3 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-red-500 focus:border-red-500" 
                                    placeholder="Enter Best # or description..."
                                    autocomplete="off"
                                >
                                <div id="clear-search" class="absolute inset-y-0 right-0 pr-3 flex items-center cursor-pointer hidden">
                                    <i class="fas fa-times text-gray-400 hover:text-gray-600"></i>
                                </div>
                            </div>
                            <div id="suggestions" class="hidden absolute z-10 mt-1 w-full bg-white shadow-lg rounded-lg border border-gray-200 max-h-60 overflow-auto"></div>
                        </div>
                        <button id="search-btn" class="ml-4 px-6 py-3 bg-red-600 text-white font-medium rounded-lg hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 transition-colors mt-6">
                            Search
                        </button>
                    </div>
                </div>

                <div id="results" class="hidden bg-white rounded-xl shadow-lg overflow-hidden fade-in">
                    <div class="p-6 border-b border-gray-200 bg-red-50">
                        <h2 class="text-xl font-semibold text-red-800">Item Details</h2>
                    </div>
                    
                    <div class="divide-y divide-gray-200">
                        <div id="result-content" class="p-6">
                            <!-- Results will be displayed here -->
                        </div>
                    </div>
                </div>

                <div id="loading" class="hidden text-center py-8">
                    <div class="inline-block animate-spin rounded-full h-8 w-8 border-t-2 border-b-2 border-red-600 mb-2"></div>
                    <p class="text-gray-600">Loading data...</p>
                </div>

                <div id="no-results" class="hidden text-center py-8">
                    <i class="fas fa-exclamation-circle text-3xl text-gray-400 mb-3"></i>
                    <h3 class="text-lg font-medium text-gray-700">No results found</h3>
                    <p class="text-gray-500">Try a different search term</p>
                </div>
            </div>
        </div>

          </main>

   
    <script>
        // Password Protection
        const passwordOverlay = document.getElementById('passwordOverlay');
        const passwordInput = document.getElementById('passwordInput');
        const passwordSubmit = document.getElementById('passwordSubmit');
        const passwordError = document.getElementById('passwordError');
        const passwordBox = document.getElementById('passwordBox');
        const mainContent = document.getElementById('mainContent');
        
        // Set your password here (in a real application, this would be server-side)
        const CORRECT_PASSWORD = "BestPrice20256"; // Change this to your desired password
        
        // Focus password input on page load
        window.addEventListener('DOMContentLoaded', () => {
            passwordInput.focus();
        });
        
        passwordSubmit.addEventListener('click', checkPassword);
        passwordInput.addEventListener('keypress', function(e) {
            if (e.key === 'Enter') {
                checkPassword();
            }
        });
        
        function checkPassword() {
            if (passwordInput.value === CORRECT_PASSWORD) {
                // Correct password
                passwordOverlay.style.display = 'none';
                passwordBox.style.display = 'none';
                mainContent.classList.remove('locked-content');
            } else {
                // Incorrect password
                passwordError.classList.remove('hidden');
                passwordBox.classList.add('shake');
                setTimeout(() => {
                    passwordBox.classList.remove('shake');
                }, 500);
                passwordInput.focus();
            }
        }

        // BPS Price List data
        const sheetData = [
            { id: "00001", name: "O-RING", trade: "0.77", GSA: "0.77", minPlus: "0.67", list: "0.96", commission: "19", generic: "", newCat: ",9-42", oldCat: ",13-53"},
            { id: "4", name: "O-RING 7/16 ID X 11/16 OD X 1/8", trade: "0.49", GSA: "0.49", minPlus: "0.33", list: "0.61", commission: "36", generic: "", newCat: ",1-3,1-21,2-7,2-51,2-52,4-23", oldCat: ",1-13"},
            { id: "6", name: "O-RING 1-1/16 ID X 1-3/16 OD X 1/16", trade: "0.92", GSA: "0.92", minPlus: "0.56", list: "1.15", commission: "38", generic: "", newCat: ",2-5", oldCat: ",1-11"},
            { id: "8", name: "O-RING 9/16 ID X 11/16 OD X 1/16", trade: "0.54", GSA: "0.54", minPlus: "0.33", list: "0.68", commission: "38", generic: "", newCat: ",2-5,2-50,2-64,4-33,5-13,5-32,9-7,9-54,16-9", oldCat: ",1-11"},
            { id: "14", name: "O-RING 15/16 ID X 1-1/8 OD X 3/32", trade: "0.89", GSA: "0.89", minPlus: "0.55", list: "1.11", commission: "38", generic: "", newCat: ",2-6,11-50,12-3", oldCat: ",1-12"},
            { id: "16", name: "O-RING 1-9/16 ID X 1-3/4 OD X 3/32", trade: "0.67", GSA: "0.67", minPlus: "0.48", list: "0.84", commission: "19", generic: "", newCat: ",9-7", oldCat: ",12-29"},
        ];

        // DOM elements
        const searchInput = document.getElementById('search');
        const searchBtn = document.getElementById('search-btn');
        const clearSearch = document.getElementById('clear-search');
        const suggestions = document.getElementById('suggestions');
        const results = document.getElementById('results');
        const resultContent = document.getElementById('result-content');
        const loading = document.getElementById('loading');
        const noResults = document.getElementById('no-results');

        // Event listeners
        searchInput.addEventListener('input', handleInput);
        searchBtn.addEventListener('click', handleSearch);
        clearSearch.addEventListener('click', clearSearchInput);
        document.addEventListener('click', closeSuggestions);

        // Handle input for autocomplete
        function handleInput() {
            const searchTerm = searchInput.value.trim().toLowerCase();
            
            if (searchTerm.length === 0) {
                suggestions.classList.add('hidden');
                clearSearch.classList.add('hidden');
                return;
            }
            
            clearSearch.classList.remove('hidden');
            
            const filteredItems = sheetData.filter(item => 
                item.name.toLowerCase().includes(searchTerm) || 
                item.id.toLowerCase().includes(searchTerm)
            );
            
            showSuggestions(filteredItems, searchTerm);
        }

        // Show autocomplete suggestions
        function showSuggestions(items, searchTerm) {
            if (items.length === 0) {
                suggestions.classList.add('hidden');
                return;
            }
            
            suggestions.innerHTML = '';
            items.slice(0, 5).forEach(item => {
                const suggestionItem = document.createElement('div');
                suggestionItem.className = 'px-4 py-2 hover:bg-red-50 cursor-pointer flex items-center';
                
                // Highlight matching text
                const name = highlightMatch(item.name, searchTerm);
                const id = highlightMatch(item.id, searchTerm);
                
                suggestionItem.innerHTML = `
                    <span class="bg-red-100 text-red-800 text-xs font-medium px-2.5 py-0.5 rounded mr-3">${id}</span>
                    <span class="truncate">${name}</span>
                `;
                
                suggestionItem.addEventListener('click', () => {
                    searchInput.value = item.name;
                    suggestions.classList.add('hidden');
                    handleSearch();
                });
                
                suggestions.appendChild(suggestionItem);
            });
            
            suggestions.classList.remove('hidden');
        }

        // Highlight matching text in suggestions
        function highlightMatch(text, searchTerm) {
            if (!searchTerm) return text;
            
            const regex = new RegExp(searchTerm, 'gi');
            return text.replace(regex, match => `<span class="search-highlight">${match}</span>`);
        }

        // Close suggestions when clicking outside
        function closeSuggestions(e) {
            if (!suggestions.contains(e.target) && e.target !== searchInput) {
                suggestions.classList.add('hidden');
            }
        }

        // Clear search input
        function clearSearchInput() {
            searchInput.value = '';
            suggestions.classList.add('hidden');
            clearSearch.classList.add('hidden');
            results.classList.add('hidden');
            noResults.classList.add('hidden');
            searchInput.focus();
        }

        // Handle search
        function handleSearch() {
            const searchTerm = searchInput.value.trim().toLowerCase();
            
            if (searchTerm.length === 0) {
                return;
            }
            
            // Show loading
            results.classList.add('hidden');
            noResults.classList.add('hidden');
            loading.classList.remove('hidden');
            
            // Simulate API delay
            setTimeout(() => {
                loading.classList.add('hidden');
                
                const foundItem = sheetData.find(item => 
                    item.name.toLowerCase().includes(searchTerm) || 
                    item.id.toLowerCase().includes(searchTerm)
                );
                
                if (foundItem) {
                    displayResult(foundItem, searchTerm);
                } else {
                    noResults.classList.remove('hidden');
                }
            }, 800);
        }

        // Display search result
        function displayResult(item, searchTerm) {
            // Highlight search term in the name
            const highlightedName = highlightMatch(item.name, searchTerm);
            
            resultContent.innerHTML = `
                <div class="grid grid-cols-1 gap-6">
                    <div class="space-y-4">
                        <div>
                            <h3 class="text-2xl font-bold text-red-700">${highlightedName}</h3>
                            <p class="text-lg text-gray-600">Best #: <span class="font-medium">${item.id}</span></p>
                        </div>
                        
                        <div class="bg-gray-50 p-4 rounded-lg">
                            <h4 class="text-lg font-semibold text-gray-800 mb-3">Pricing Information</h4>
                            
                            <div class="overflow-x-auto">
                                <table class="min-w-full divide-y divide-gray-200">
                                    <thead class="bg-gray-100">
                                        <tr>
                                            <th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Price Type</th>
                                            <th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Price</th>
                                        </tr>
                                    </thead>
                                    <tbody class="bg-white divide-y divide-gray-200">
                                        <tr>
                                            <td class="px-4 py-2 whitespace-nowrap text-sm font-medium text-gray-900">Trade Price</td>
                                            <td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">$${item.trade}</td>
                                        </tr>
                                        <tr>
                                            <td class="px-4 py-2 whitespace-nowrap text-sm font-medium text-gray-900">GSA Price</td>
                                            <td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">$${item.GSA}</td>
                                        </tr>
                                        <tr>
                                            <td class="px-4 py-2 whitespace-nowrap text-sm font-medium text-gray-900">Min Plus Price</td>
                                            <td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">$${item.minPlus}</td>
                                        </tr>
                                        <tr>
                                            <td class="px-4 py-2 whitespace-nowrap text-sm font-medium text-gray-900">List Price</td>
                                            <td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">$${item.list}</td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                        
                        <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                            <div class="bg-gray-50 p-4 rounded-lg">
                                <h4 class="text-lg font-semibold text-gray-800 mb-3">Additional Information</h4>
                                <div class="space-y-2">
                                    <p class="text-sm"><span class="font-medium text-gray-700">Commission:</span> ${item.commission}%</p>
                                    <p class="text-sm"><span class="font-medium text-gray-700">Generic:</span> ${item.generic || 'N/A'}</p>
                                </div>
                            </div>
                            
                            <div class="bg-gray-50 p-4 rounded-lg">
                                <h4 class="text-lg font-semibold text-gray-800 mb-3">Categories</h4>
                                <div class="space-y-2">
                                    <p class="text-sm"><span class="font-medium text-gray-700">New Categories:</span> ${item.newCat.replace(/,/g, ', ').substring(1)}</p>
                                    <p class="text-sm"><span class="font-medium text-gray-700">Old Categories:</span> ${item.oldCat.replace(/,/g, ', ').substring(1)}</p>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            `;
            
            results.classList.remove('hidden');
        }
    </script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=BPSCODE/dfg" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>