add immoweb ui

This commit is contained in:
Viktor Barzin 2025-05-26 19:41:36 +00:00
parent 7e8c79d3d1
commit 151da16c27
No known key found for this signature in database
GPG key ID: 4056458DBDBF8863
266 changed files with 264879 additions and 0 deletions

26
immoweb/node_modules/quickselect/README.md generated vendored Normal file
View file

@ -0,0 +1,26 @@
## quickselect
A tiny and fast [selection algorithm](https://en.wikipedia.org/wiki/Selection_algorithm) in JavaScript
(specifically, [Floyd-Rivest selection](https://en.wikipedia.org/wiki/Floyd%E2%80%93Rivest_algorithm)).
```js
quickselect(array, k[, left, right, compareFn]);
```
Rearranges items so that all items in the `[left, k]` are the smallest.
The `k`-th element will have the `(k - left + 1)`-th smallest value in `[left, right]`.
- `array`: the array to partially sort (in place)
- `k`: middle index for partial sorting (as defined above)
- `left`: left index of the range to sort (`0` by default)
- `right`: right index (last index of the array by default)
- `compareFn`: compare function
Example:
```js
var arr = [65, 28, 59, 33, 21, 56, 22, 95, 50, 12, 90, 53, 28, 77, 39];
quickselect(arr, 8);
// [39, 28, 28, 33, 21, 12, 22, 50, 53, 56, 59, 65, 90, 77, 95]
// ^^ 8th item
```

60
immoweb/node_modules/quickselect/index.js generated vendored Normal file
View file

@ -0,0 +1,60 @@
'use strict';
module.exports = partialSort;
// Floyd-Rivest selection algorithm:
// Rearrange items so that all items in the [left, k] range are smaller than all items in (k, right];
// The k-th element will have the (k - left + 1)th smallest value in [left, right]
function partialSort(arr, k, left, right, compare) {
left = left || 0;
right = right || (arr.length - 1);
compare = compare || defaultCompare;
while (right > left) {
if (right - left > 600) {
var n = right - left + 1;
var m = k - left + 1;
var z = Math.log(n);
var s = 0.5 * Math.exp(2 * z / 3);
var sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1);
var newLeft = Math.max(left, Math.floor(k - m * s / n + sd));
var newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd));
partialSort(arr, k, newLeft, newRight, compare);
}
var t = arr[k];
var i = left;
var j = right;
swap(arr, left, k);
if (compare(arr[right], t) > 0) swap(arr, left, right);
while (i < j) {
swap(arr, i, j);
i++;
j--;
while (compare(arr[i], t) < 0) i++;
while (compare(arr[j], t) > 0) j--;
}
if (compare(arr[left], t) === 0) swap(arr, left, j);
else {
j++;
swap(arr, j, right);
}
if (j <= k) left = j + 1;
if (k <= j) right = j - 1;
}
}
function swap(arr, i, j) {
var tmp = arr[i];
arr[i] = arr[j];
arr[j] = tmp;
}
function defaultCompare(a, b) {
return a < b ? -1 : a > b ? 1 : 0;
}

54
immoweb/node_modules/quickselect/package.json generated vendored Normal file
View file

@ -0,0 +1,54 @@
{
"_from": "quickselect@^1.0.0",
"_id": "quickselect@1.0.0",
"_inBundle": false,
"_integrity": "sha1-AmMIGPmq5OyrJvAQP5jQYcF8WPM=",
"_location": "/quickselect",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "quickselect@^1.0.0",
"name": "quickselect",
"escapedName": "quickselect",
"rawSpec": "^1.0.0",
"saveSpec": null,
"fetchSpec": "^1.0.0"
},
"_requiredBy": [
"/rbush"
],
"_resolved": "https://registry.npmjs.org/quickselect/-/quickselect-1.0.0.tgz",
"_shasum": "02630818f9aae4ecab26f0103f98d061c17c58f3",
"_spec": "quickselect@^1.0.0",
"_where": "/home/kadir/workspace/webimmo/node_modules/rbush",
"author": {
"name": "Vladimir Agafonkin"
},
"bundleDependencies": false,
"dependencies": {},
"deprecated": false,
"description": "A tiny and fast selection algorithm in JavaScript.",
"devDependencies": {
"eslint": "^2.1.0",
"eslint-config-mourner": "^2.0.0",
"tape": "^4.4.0"
},
"keywords": [
"selection",
"algorithm",
"quickselect",
"sort",
"partial",
"floyd",
"rivest"
],
"license": "ISC",
"main": "index.js",
"name": "quickselect",
"scripts": {
"pretest": "eslint index.js test.js",
"test": "tape test.js"
},
"version": "1.0.0"
}

11
immoweb/node_modules/quickselect/test.js generated vendored Normal file
View file

@ -0,0 +1,11 @@
'use strict';
var test = require('tape').test;
var quickselect = require('./');
test('selection', function (t) {
var arr = [65, 28, 59, 33, 21, 56, 22, 95, 50, 12, 90, 53, 28, 77, 39];
quickselect(arr, 8);
t.deepEqual(arr, [39, 28, 28, 33, 21, 12, 22, 50, 53, 56, 59, 65, 90, 77, 95]);
t.end();
});