@cascivo/react 0.3.4 → 0.3.7
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.
- package/README.md +12 -9
- package/dist/accordion/accordion.css +1 -0
- package/dist/accordion/accordion.js +95 -0
- package/dist/accordion/accordion.module.js +14 -0
- package/dist/action-sheet/action-sheet.css +1 -0
- package/dist/action-sheet/action-sheet.js +91 -0
- package/dist/action-sheet/action-sheet.module.js +15 -0
- package/dist/alert/alert.css +1 -0
- package/dist/alert/alert.js +55 -0
- package/dist/alert/alert.module.js +14 -0
- package/dist/alert-dialog/alert-dialog.css +1 -0
- package/dist/alert-dialog/alert-dialog.js +68 -0
- package/dist/alert-dialog/alert-dialog.module.js +14 -0
- package/dist/app-shell/app-shell.css +1 -0
- package/dist/app-shell/app-shell.js +80 -0
- package/dist/app-shell/app-shell.module.js +15 -0
- package/dist/aspect-ratio/aspect-ratio.css +1 -0
- package/dist/aspect-ratio/aspect-ratio.js +22 -0
- package/dist/aspect-ratio/aspect-ratio.module.js +9 -0
- package/dist/avatar/avatar.css +1 -0
- package/dist/avatar/avatar.js +45 -0
- package/dist/avatar/avatar.module.js +11 -0
- package/dist/avatar-group/avatar-group.css +1 -0
- package/dist/avatar-group/avatar-group.js +26 -0
- package/dist/avatar-group/avatar-group.module.js +9 -0
- package/dist/badge/badge.css +1 -0
- package/dist/badge/badge.js +17 -0
- package/dist/badge/badge.module.js +6 -0
- package/dist/blockquote/blockquote.css +1 -0
- package/dist/blockquote/blockquote.js +18 -0
- package/dist/blockquote/blockquote.module.js +9 -0
- package/dist/bottom-sheet/bottom-sheet.css +1 -0
- package/dist/bottom-sheet/bottom-sheet.js +111 -0
- package/dist/bottom-sheet/bottom-sheet.module.js +17 -0
- package/dist/breadcrumb/breadcrumb.css +1 -0
- package/dist/breadcrumb/breadcrumb.js +28 -0
- package/dist/breadcrumb/breadcrumb.module.js +6 -0
- package/dist/button/button.css +1 -0
- package/dist/button/button.js +31 -0
- package/dist/button/button.module.js +6 -0
- package/dist/button-group/button-group.css +1 -0
- package/dist/button-group/button-group.js +39 -0
- package/dist/button-group/button-group.module.js +6 -0
- package/dist/calendar/calendar.css +1 -0
- package/dist/calendar/calendar.js +195 -0
- package/dist/calendar/calendar.module.js +17 -0
- package/dist/card/card.css +1 -0
- package/dist/card/card.js +45 -0
- package/dist/card/card.module.js +12 -0
- package/dist/carousel/carousel.css +1 -0
- package/dist/carousel/carousel.js +138 -0
- package/dist/carousel/carousel.module.js +16 -0
- package/dist/chat-bubble/chat-bubble.css +1 -0
- package/dist/chat-bubble/chat-bubble.js +33 -0
- package/dist/chat-bubble/chat-bubble.module.js +14 -0
- package/dist/checkbox/checkbox.css +1 -0
- package/dist/checkbox/checkbox.js +38 -0
- package/dist/checkbox/checkbox.module.js +11 -0
- package/dist/checkbox-card/checkbox-card.css +1 -0
- package/dist/checkbox-card/checkbox-card.js +48 -0
- package/dist/checkbox-card/checkbox-card.module.js +14 -0
- package/dist/code/code.css +1 -0
- package/dist/code/code.js +16 -0
- package/dist/code/code.module.js +6 -0
- package/dist/code-snippet/code-snippet.css +1 -0
- package/dist/code-snippet/code-snippet.js +116 -0
- package/dist/code-snippet/code-snippet.module.js +20 -0
- package/dist/code-snippet/highlight.js +69 -0
- package/dist/collapsible/collapsible.css +1 -0
- package/dist/collapsible/collapsible.js +42 -0
- package/dist/collapsible/collapsible.module.js +11 -0
- package/dist/color-picker/color-picker.css +1 -0
- package/dist/color-picker/color-picker.js +268 -0
- package/dist/color-picker/color-picker.module.js +21 -0
- package/dist/combobox/combobox.css +1 -0
- package/dist/combobox/combobox.js +164 -0
- package/dist/combobox/combobox.module.js +22 -0
- package/dist/command-menu/command-menu.css +1 -0
- package/dist/command-menu/command-menu.js +263 -0
- package/dist/command-menu/command-menu.module.js +22 -0
- package/dist/comparison/comparison.css +1 -0
- package/dist/comparison/comparison.js +69 -0
- package/dist/comparison/comparison.module.js +12 -0
- package/dist/contained-list/contained-list.css +1 -0
- package/dist/contained-list/contained-list.js +41 -0
- package/dist/contained-list/contained-list.module.js +14 -0
- package/dist/context-menu/context-menu.css +1 -0
- package/dist/context-menu/context-menu.js +60 -0
- package/dist/context-menu/context-menu.module.js +10 -0
- package/dist/copy-button/copy-button.css +1 -0
- package/dist/copy-button/copy-button.js +58 -0
- package/dist/copy-button/copy-button.module.js +9 -0
- package/dist/data-list/data-list.css +1 -0
- package/dist/data-list/data-list.js +27 -0
- package/dist/data-list/data-list.module.js +11 -0
- package/dist/data-table/data-table.css +1 -0
- package/dist/data-table/data-table.js +368 -0
- package/dist/data-table/data-table.module.js +36 -0
- package/dist/date-picker/date-picker.css +1 -0
- package/dist/date-picker/date-picker.js +218 -0
- package/dist/date-picker/date-picker.module.js +26 -0
- package/dist/date-range-picker/date-range-picker.css +1 -0
- package/dist/date-range-picker/date-range-picker.js +195 -0
- package/dist/date-range-picker/date-range-picker.module.js +21 -0
- package/dist/dock/dock.css +1 -0
- package/dist/dock/dock.js +32 -0
- package/dist/dock/dock.module.js +11 -0
- package/dist/drawer/drawer.css +1 -0
- package/dist/drawer/drawer.js +95 -0
- package/dist/drawer/drawer.module.js +16 -0
- package/dist/dropdown/dropdown.css +1 -0
- package/dist/dropdown/dropdown.js +109 -0
- package/dist/dropdown/dropdown.module.js +12 -0
- package/dist/editable/editable.css +1 -0
- package/dist/editable/editable.js +67 -0
- package/dist/editable/editable.module.js +14 -0
- package/dist/empty-state/empty-state.css +1 -0
- package/dist/empty-state/empty-state.js +34 -0
- package/dist/empty-state/empty-state.module.js +12 -0
- package/dist/fab/fab.css +1 -0
- package/dist/fab/fab.js +93 -0
- package/dist/fab/fab.module.js +15 -0
- package/dist/field/field.css +1 -0
- package/dist/field/field.js +39 -0
- package/dist/field/field.module.js +10 -0
- package/dist/file-uploader/file-uploader.css +1 -0
- package/dist/file-uploader/file-uploader.js +122 -0
- package/dist/file-uploader/file-uploader.module.js +21 -0
- package/dist/filter/filter.css +1 -0
- package/dist/filter/filter.js +34 -0
- package/dist/filter/filter.module.js +9 -0
- package/dist/form/form.css +1 -0
- package/dist/form/form.js +88 -0
- package/dist/form/form.module.js +6 -0
- package/dist/header/header.css +1 -0
- package/dist/header/header.js +44 -0
- package/dist/header/header.module.js +14 -0
- package/dist/header-panel/header-panel.css +1 -0
- package/dist/header-panel/header-panel.js +74 -0
- package/dist/header-panel/header-panel.module.js +12 -0
- package/dist/heading/heading.css +1 -0
- package/dist/heading/heading.js +24 -0
- package/dist/heading/heading.module.js +6 -0
- package/dist/hover-card/hover-card.css +1 -0
- package/dist/hover-card/hover-card.js +84 -0
- package/dist/hover-card/hover-card.module.js +9 -0
- package/dist/icon-button/icon-button.css +1 -0
- package/dist/icon-button/icon-button.js +21 -0
- package/dist/icon-button/icon-button.module.js +6 -0
- package/dist/image/image.css +1 -0
- package/dist/image/image.js +64 -0
- package/dist/image/image.module.js +12 -0
- package/dist/indicator/indicator.css +1 -0
- package/dist/indicator/indicator.js +18 -0
- package/dist/indicator/indicator.module.js +9 -0
- package/dist/inline-loading/inline-loading.css +1 -0
- package/dist/inline-loading/inline-loading.js +76 -0
- package/dist/inline-loading/inline-loading.module.js +12 -0
- package/dist/input/input.css +1 -0
- package/dist/input/input.js +54 -0
- package/dist/input/input.module.js +12 -0
- package/dist/input-group/input-group.css +1 -0
- package/dist/input-group/input-group.js +41 -0
- package/dist/input-group/input-group.module.js +12 -0
- package/dist/item/item.css +1 -0
- package/dist/item/item.js +52 -0
- package/dist/item/item.module.js +13 -0
- package/dist/join/join.css +1 -0
- package/dist/join/join.js +14 -0
- package/dist/join/join.module.js +6 -0
- package/dist/kbd/kbd.css +1 -0
- package/dist/kbd/kbd.js +16 -0
- package/dist/kbd/kbd.module.js +6 -0
- package/dist/label/label.css +1 -0
- package/dist/label/label.js +25 -0
- package/dist/label/label.module.js +10 -0
- package/dist/link/link.css +1 -0
- package/dist/link/link.js +22 -0
- package/dist/link/link.module.js +6 -0
- package/dist/list/list.css +1 -0
- package/dist/list/list.js +23 -0
- package/dist/list/list.module.js +9 -0
- package/dist/menu/menu.css +1 -0
- package/dist/menu/menu.js +96 -0
- package/dist/menu/menu.module.js +11 -0
- package/dist/menu-button/menu-button.css +1 -0
- package/dist/menu-button/menu-button.js +92 -0
- package/dist/menu-button/menu-button.module.js +11 -0
- package/dist/menubar/menubar.css +1 -0
- package/dist/menubar/menubar.js +103 -0
- package/dist/menubar/menubar.module.js +11 -0
- package/dist/modal/modal.css +1 -0
- package/dist/modal/modal.js +73 -0
- package/dist/modal/modal.module.js +14 -0
- package/dist/multi-select/multi-select.css +1 -0
- package/dist/multi-select/multi-select.js +105 -0
- package/dist/multi-select/multi-select.module.js +18 -0
- package/dist/native-select/native-select.css +1 -0
- package/dist/native-select/native-select.js +37 -0
- package/dist/native-select/native-select.module.js +10 -0
- package/dist/navigation-menu/navigation-menu.css +1 -0
- package/dist/navigation-menu/navigation-menu.js +95 -0
- package/dist/navigation-menu/navigation-menu.module.js +13 -0
- package/dist/notification/notification.css +1 -0
- package/dist/notification/notification.js +134 -0
- package/dist/notification/notification.module.js +14 -0
- package/dist/number-input/number-input.css +1 -0
- package/dist/number-input/number-input.js +145 -0
- package/dist/number-input/number-input.module.js +15 -0
- package/dist/otp-input/otp-input.css +1 -0
- package/dist/otp-input/otp-input.js +70 -0
- package/dist/otp-input/otp-input.module.js +9 -0
- package/dist/overflow-menu/overflow-menu.css +1 -0
- package/dist/overflow-menu/overflow-menu.js +65 -0
- package/dist/overflow-menu/overflow-menu.module.js +10 -0
- package/dist/pagination/pagination.css +1 -0
- package/dist/pagination/pagination.js +92 -0
- package/dist/pagination/pagination.module.js +14 -0
- package/dist/password-input/password-input.css +1 -0
- package/dist/password-input/password-input.js +76 -0
- package/dist/password-input/password-input.module.js +14 -0
- package/dist/popover/popover.css +1 -0
- package/dist/popover/popover.js +49 -0
- package/dist/popover/popover.module.js +9 -0
- package/dist/popover/use-popover.js +57 -0
- package/dist/progress/progress.css +1 -0
- package/dist/progress/progress.js +17 -0
- package/dist/progress/progress.module.js +9 -0
- package/dist/progress-bar/progress-bar.css +1 -0
- package/dist/progress-bar/progress-bar.js +44 -0
- package/dist/progress-bar/progress-bar.module.js +14 -0
- package/dist/progress-circle/progress-circle.css +1 -0
- package/dist/progress-circle/progress-circle.js +48 -0
- package/dist/progress-circle/progress-circle.module.js +12 -0
- package/dist/progress-indicator/progress-indicator.css +1 -0
- package/dist/progress-indicator/progress-indicator.js +36 -0
- package/dist/progress-indicator/progress-indicator.module.js +13 -0
- package/dist/prose/prose.css +1 -0
- package/dist/prose/prose.js +15 -0
- package/dist/prose/prose.module.js +6 -0
- package/dist/pull-to-refresh/pull-to-refresh.css +1 -0
- package/dist/pull-to-refresh/pull-to-refresh.js +82 -0
- package/dist/pull-to-refresh/pull-to-refresh.module.js +12 -0
- package/dist/qr-code/encode.js +585 -0
- package/dist/qr-code/qr-code.css +1 -0
- package/dist/qr-code/qr-code.js +41 -0
- package/dist/qr-code/qr-code.module.js +9 -0
- package/dist/radial-progress/radial-progress.css +1 -0
- package/dist/radial-progress/radial-progress.js +25 -0
- package/dist/radial-progress/radial-progress.module.js +9 -0
- package/dist/radio/radio.css +1 -0
- package/dist/radio/radio.js +49 -0
- package/dist/radio/radio.module.js +12 -0
- package/dist/radio-card/radio-card.css +1 -0
- package/dist/radio-card/radio-card.js +63 -0
- package/dist/radio-card/radio-card.module.js +14 -0
- package/dist/rating-group/rating-group.css +1 -0
- package/dist/rating-group/rating-group.js +37 -0
- package/dist/rating-group/rating-group.module.js +9 -0
- package/dist/react/src/index.js +130 -0
- package/dist/relative-time/relative-time.css +1 -0
- package/dist/relative-time/relative-time.js +65 -0
- package/dist/relative-time/relative-time.module.js +6 -0
- package/dist/resizable/resizable.css +1 -0
- package/dist/resizable/resizable.js +80 -0
- package/dist/resizable/resizable.module.js +11 -0
- package/dist/scroll-area/scroll-area.css +1 -0
- package/dist/scroll-area/scroll-area.js +38 -0
- package/dist/scroll-area/scroll-area.module.js +6 -0
- package/dist/search/search.css +1 -0
- package/dist/search/search.js +94 -0
- package/dist/search/search.module.js +12 -0
- package/dist/segmented-control/segmented-control.css +1 -0
- package/dist/segmented-control/segmented-control.js +43 -0
- package/dist/segmented-control/segmented-control.module.js +9 -0
- package/dist/select/select.css +1 -0
- package/dist/select/select.js +71 -0
- package/dist/select/select.module.js +14 -0
- package/dist/separator/separator.css +1 -0
- package/dist/separator/separator.js +21 -0
- package/dist/separator/separator.module.js +6 -0
- package/dist/sheet/sheet.css +1 -0
- package/dist/sheet/sheet.js +50 -0
- package/dist/sheet/sheet.module.js +12 -0
- package/dist/shell-header/shell-header.css +1 -0
- package/dist/shell-header/shell-header.js +165 -0
- package/dist/shell-header/shell-header.module.js +26 -0
- package/dist/side-nav/side-nav.css +1 -0
- package/dist/side-nav/side-nav.js +326 -0
- package/dist/side-nav/side-nav.module.js +34 -0
- package/dist/skeleton/skeleton.css +1 -0
- package/dist/skeleton/skeleton.js +25 -0
- package/dist/skeleton/skeleton.module.js +10 -0
- package/dist/skip-nav/skip-nav.css +1 -0
- package/dist/skip-nav/skip-nav.js +27 -0
- package/dist/skip-nav/skip-nav.module.js +6 -0
- package/dist/slider/slider.css +1 -0
- package/dist/slider/slider.js +29 -0
- package/dist/slider/slider.module.js +10 -0
- package/dist/spinner/spinner.css +1 -0
- package/dist/spinner/spinner.js +18 -0
- package/dist/spinner/spinner.module.js +9 -0
- package/dist/stack/stack.css +1 -0
- package/dist/stack/stack.js +19 -0
- package/dist/stack/stack.module.js +9 -0
- package/dist/stat/stat.css +1 -0
- package/dist/stat/stat.js +37 -0
- package/dist/stat/stat.module.js +13 -0
- package/dist/status/status.css +1 -0
- package/dist/status/status.js +20 -0
- package/dist/status/status.module.js +10 -0
- package/dist/steps/steps.css +1 -0
- package/dist/steps/steps.js +32 -0
- package/dist/steps/steps.module.js +11 -0
- package/dist/structured-list/structured-list.css +1 -0
- package/dist/structured-list/structured-list.js +101 -0
- package/dist/structured-list/structured-list.module.js +15 -0
- package/dist/styles.css +248 -0
- package/dist/swap/swap.css +1 -0
- package/dist/swap/swap.js +36 -0
- package/dist/swap/swap.module.js +10 -0
- package/dist/swipe-item/swipe-item.css +1 -0
- package/dist/swipe-item/swipe-item.js +62 -0
- package/dist/swipe-item/swipe-item.module.js +15 -0
- package/dist/switcher/switcher.css +1 -0
- package/dist/switcher/switcher.js +29 -0
- package/dist/switcher/switcher.module.js +11 -0
- package/dist/tabs/tabs.css +1 -0
- package/dist/tabs/tabs.js +95 -0
- package/dist/tabs/tabs.module.js +11 -0
- package/dist/tag/tag.css +1 -0
- package/dist/tag/tag.js +26 -0
- package/dist/tag/tag.module.js +9 -0
- package/dist/tags-input/tags-input.css +1 -0
- package/dist/tags-input/tags-input.js +63 -0
- package/dist/tags-input/tags-input.module.js +11 -0
- package/dist/text/text.css +1 -0
- package/dist/text/text.js +18 -0
- package/dist/text/text.module.js +6 -0
- package/dist/textarea/textarea.css +1 -0
- package/dist/textarea/textarea.js +56 -0
- package/dist/textarea/textarea.module.js +12 -0
- package/dist/tile/tile.css +1 -0
- package/dist/tile/tile.js +39 -0
- package/dist/tile/tile.module.js +10 -0
- package/dist/time-picker/time-picker.css +1 -0
- package/dist/time-picker/time-picker.js +62 -0
- package/dist/time-picker/time-picker.module.js +12 -0
- package/dist/timeline/timeline.css +1 -0
- package/dist/timeline/timeline.js +41 -0
- package/dist/timeline/timeline.module.js +14 -0
- package/dist/toast/toast.css +1 -0
- package/dist/toast/toast.js +85 -0
- package/dist/toast/toast.module.js +14 -0
- package/dist/toc/toc.css +1 -0
- package/dist/toc/toc.js +42 -0
- package/dist/toc/toc.module.js +6 -0
- package/dist/toc/use-toc-from-region.js +17 -0
- package/dist/toggle/toggle.css +1 -0
- package/dist/toggle/toggle.js +39 -0
- package/dist/toggle/toggle.module.js +11 -0
- package/dist/toggle-group/toggle-group.css +1 -0
- package/dist/toggle-group/toggle-group.js +55 -0
- package/dist/toggle-group/toggle-group.module.js +9 -0
- package/dist/toggletip/toggletip.css +1 -0
- package/dist/toggletip/toggletip.js +49 -0
- package/dist/toggletip/toggletip.module.js +10 -0
- package/dist/tooltip/tooltip.css +1 -0
- package/dist/tooltip/tooltip.js +58 -0
- package/dist/tooltip/tooltip.module.js +9 -0
- package/dist/tree-view/tree-view.css +1 -0
- package/dist/tree-view/tree-view.js +201 -0
- package/dist/tree-view/tree-view.module.js +16 -0
- package/dist/user/user.css +1 -0
- package/dist/user/user.js +33 -0
- package/dist/user/user.module.js +12 -0
- package/dist/visually-hidden/visually-hidden.css +1 -0
- package/dist/visually-hidden/visually-hidden.js +15 -0
- package/dist/visually-hidden/visually-hidden.module.js +6 -0
- package/package.json +6 -6
- package/readme.body.md +12 -9
- package/dist/cascivo.css +0 -2
- package/dist/index.js +0 -9174
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { Spinner as e } from "../spinner/spinner.js";
|
|
4
|
+
import t from "./pull-to-refresh.module.js";
|
|
5
|
+
import { cn as n, useSignal as r, useSignalEffect as i, useSignals as a } from "@cascivo/core";
|
|
6
|
+
import { builtin as o, t as s } from "@cascivo/i18n";
|
|
7
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
8
|
+
import { useRef as u } from "react";
|
|
9
|
+
//#region ../components/src/pull-to-refresh/pull-to-refresh.tsx
|
|
10
|
+
var d = .5;
|
|
11
|
+
function f({ onRefresh: f, children: p, threshold: m = 64, disabled: h = !1, labels: g, className: _ }) {
|
|
12
|
+
a();
|
|
13
|
+
let v = u(null), y = r(0), b = r(!1), x = r(!1), S = u(f);
|
|
14
|
+
S.current = f;
|
|
15
|
+
let C = u(m);
|
|
16
|
+
C.current = m;
|
|
17
|
+
let w = u(h);
|
|
18
|
+
w.current = h, i(() => {
|
|
19
|
+
let e = v.current;
|
|
20
|
+
if (!e || typeof window > "u") return;
|
|
21
|
+
let t = 0, n = !1, r = (r) => {
|
|
22
|
+
w.current || b.value || e.scrollTop > 0 || (t = r.clientY, n = !0);
|
|
23
|
+
}, i = (r) => {
|
|
24
|
+
if (!n || b.value) return;
|
|
25
|
+
let i = r.clientY - t;
|
|
26
|
+
if (i <= 0 || e.scrollTop > 0) {
|
|
27
|
+
y.value = 0, x.value = !1;
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
r.preventDefault(), x.value = !0, y.value = Math.min(i * d, C.current * 1.5);
|
|
31
|
+
}, a = () => {
|
|
32
|
+
n && (n = !1, x.value = !1, !b.value && (y.value >= C.current ? (b.value = !0, y.value = C.current, Promise.resolve(S.current()).then(() => {
|
|
33
|
+
b.value = !1, y.value = 0;
|
|
34
|
+
}, () => {
|
|
35
|
+
b.value = !1, y.value = 0;
|
|
36
|
+
})) : y.value = 0));
|
|
37
|
+
};
|
|
38
|
+
return e.addEventListener("pointerdown", r), window.addEventListener("pointermove", i, { passive: !1 }), window.addEventListener("pointerup", a), window.addEventListener("pointercancel", a), () => {
|
|
39
|
+
e.removeEventListener("pointerdown", r), window.removeEventListener("pointermove", i), window.removeEventListener("pointerup", a), window.removeEventListener("pointercancel", a);
|
|
40
|
+
};
|
|
41
|
+
});
|
|
42
|
+
let T = b.value ? m : y.value, E = Math.min(T / m, 1), D = E >= 1, O = b.value ? g?.refreshing ?? s(o.pullToRefresh.refreshing) : D ? g?.release ?? s(o.pullToRefresh.release) : T > 0 ? g?.pull ?? s(o.pullToRefresh.pull) : "", k = { "--_pull": `${T}px` };
|
|
43
|
+
return /* @__PURE__ */ l("div", {
|
|
44
|
+
className: n(t.root, _),
|
|
45
|
+
style: k,
|
|
46
|
+
children: [
|
|
47
|
+
/* @__PURE__ */ c("div", {
|
|
48
|
+
className: t.indicator,
|
|
49
|
+
"data-dragging": x.value ? "" : void 0,
|
|
50
|
+
children: b.value ? /* @__PURE__ */ c(e, { size: "sm" }) : /* @__PURE__ */ c("svg", {
|
|
51
|
+
"aria-hidden": "true",
|
|
52
|
+
viewBox: "0 0 16 16",
|
|
53
|
+
className: t.arrow,
|
|
54
|
+
"data-ready": D ? "" : void 0,
|
|
55
|
+
style: { opacity: E },
|
|
56
|
+
children: /* @__PURE__ */ c("path", {
|
|
57
|
+
d: "M8 13V3M4 7l4-4 4 4",
|
|
58
|
+
fill: "none",
|
|
59
|
+
stroke: "currentColor",
|
|
60
|
+
strokeWidth: "1.5",
|
|
61
|
+
strokeLinecap: "round",
|
|
62
|
+
strokeLinejoin: "round"
|
|
63
|
+
})
|
|
64
|
+
})
|
|
65
|
+
}),
|
|
66
|
+
/* @__PURE__ */ c("span", {
|
|
67
|
+
role: "status",
|
|
68
|
+
"aria-live": "polite",
|
|
69
|
+
className: t.srOnly,
|
|
70
|
+
children: O
|
|
71
|
+
}),
|
|
72
|
+
/* @__PURE__ */ c("div", {
|
|
73
|
+
ref: v,
|
|
74
|
+
className: t.viewport,
|
|
75
|
+
"data-dragging": x.value ? "" : void 0,
|
|
76
|
+
children: p
|
|
77
|
+
})
|
|
78
|
+
]
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
//#endregion
|
|
82
|
+
export { f as PullToRefresh };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import './pull-to-refresh.css';
|
|
4
|
+
var e = {
|
|
5
|
+
root: "_root_1rhho_2",
|
|
6
|
+
indicator: "_indicator_1rhho_8",
|
|
7
|
+
arrow: "_arrow_1rhho_25",
|
|
8
|
+
viewport: "_viewport_1rhho_35",
|
|
9
|
+
srOnly: "_srOnly_1rhho_47"
|
|
10
|
+
};
|
|
11
|
+
//#endregion
|
|
12
|
+
export { e as default };
|
|
@@ -0,0 +1,585 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
//#region ../components/src/qr-code/encode.ts
|
|
4
|
+
var e = {
|
|
5
|
+
L: {
|
|
6
|
+
ordinal: 0,
|
|
7
|
+
formatBits: 1
|
|
8
|
+
},
|
|
9
|
+
M: {
|
|
10
|
+
ordinal: 1,
|
|
11
|
+
formatBits: 0
|
|
12
|
+
},
|
|
13
|
+
Q: {
|
|
14
|
+
ordinal: 2,
|
|
15
|
+
formatBits: 3
|
|
16
|
+
},
|
|
17
|
+
H: {
|
|
18
|
+
ordinal: 3,
|
|
19
|
+
formatBits: 2
|
|
20
|
+
}
|
|
21
|
+
}, t = 1, n = 40, r = [
|
|
22
|
+
[
|
|
23
|
+
-1,
|
|
24
|
+
7,
|
|
25
|
+
10,
|
|
26
|
+
15,
|
|
27
|
+
20,
|
|
28
|
+
26,
|
|
29
|
+
18,
|
|
30
|
+
20,
|
|
31
|
+
24,
|
|
32
|
+
30,
|
|
33
|
+
18,
|
|
34
|
+
20,
|
|
35
|
+
24,
|
|
36
|
+
26,
|
|
37
|
+
30,
|
|
38
|
+
22,
|
|
39
|
+
24,
|
|
40
|
+
28,
|
|
41
|
+
30,
|
|
42
|
+
28,
|
|
43
|
+
28,
|
|
44
|
+
28,
|
|
45
|
+
28,
|
|
46
|
+
30,
|
|
47
|
+
30,
|
|
48
|
+
26,
|
|
49
|
+
28,
|
|
50
|
+
30,
|
|
51
|
+
30,
|
|
52
|
+
30,
|
|
53
|
+
30,
|
|
54
|
+
30,
|
|
55
|
+
30,
|
|
56
|
+
30,
|
|
57
|
+
30,
|
|
58
|
+
30,
|
|
59
|
+
30,
|
|
60
|
+
30,
|
|
61
|
+
30,
|
|
62
|
+
30,
|
|
63
|
+
30
|
|
64
|
+
],
|
|
65
|
+
[
|
|
66
|
+
-1,
|
|
67
|
+
10,
|
|
68
|
+
16,
|
|
69
|
+
26,
|
|
70
|
+
18,
|
|
71
|
+
24,
|
|
72
|
+
16,
|
|
73
|
+
18,
|
|
74
|
+
22,
|
|
75
|
+
22,
|
|
76
|
+
26,
|
|
77
|
+
30,
|
|
78
|
+
22,
|
|
79
|
+
22,
|
|
80
|
+
24,
|
|
81
|
+
24,
|
|
82
|
+
28,
|
|
83
|
+
28,
|
|
84
|
+
26,
|
|
85
|
+
26,
|
|
86
|
+
26,
|
|
87
|
+
26,
|
|
88
|
+
28,
|
|
89
|
+
28,
|
|
90
|
+
28,
|
|
91
|
+
28,
|
|
92
|
+
28,
|
|
93
|
+
28,
|
|
94
|
+
28,
|
|
95
|
+
28,
|
|
96
|
+
28,
|
|
97
|
+
28,
|
|
98
|
+
28,
|
|
99
|
+
28,
|
|
100
|
+
28,
|
|
101
|
+
28,
|
|
102
|
+
28,
|
|
103
|
+
28,
|
|
104
|
+
28,
|
|
105
|
+
28,
|
|
106
|
+
28
|
|
107
|
+
],
|
|
108
|
+
[
|
|
109
|
+
-1,
|
|
110
|
+
13,
|
|
111
|
+
22,
|
|
112
|
+
18,
|
|
113
|
+
26,
|
|
114
|
+
18,
|
|
115
|
+
24,
|
|
116
|
+
18,
|
|
117
|
+
22,
|
|
118
|
+
20,
|
|
119
|
+
24,
|
|
120
|
+
28,
|
|
121
|
+
26,
|
|
122
|
+
24,
|
|
123
|
+
20,
|
|
124
|
+
30,
|
|
125
|
+
24,
|
|
126
|
+
28,
|
|
127
|
+
28,
|
|
128
|
+
26,
|
|
129
|
+
30,
|
|
130
|
+
28,
|
|
131
|
+
30,
|
|
132
|
+
30,
|
|
133
|
+
30,
|
|
134
|
+
30,
|
|
135
|
+
28,
|
|
136
|
+
30,
|
|
137
|
+
30,
|
|
138
|
+
30,
|
|
139
|
+
30,
|
|
140
|
+
30,
|
|
141
|
+
30,
|
|
142
|
+
30,
|
|
143
|
+
30,
|
|
144
|
+
30,
|
|
145
|
+
30,
|
|
146
|
+
30,
|
|
147
|
+
30,
|
|
148
|
+
30,
|
|
149
|
+
30
|
|
150
|
+
],
|
|
151
|
+
[
|
|
152
|
+
-1,
|
|
153
|
+
17,
|
|
154
|
+
28,
|
|
155
|
+
22,
|
|
156
|
+
16,
|
|
157
|
+
22,
|
|
158
|
+
28,
|
|
159
|
+
26,
|
|
160
|
+
26,
|
|
161
|
+
24,
|
|
162
|
+
28,
|
|
163
|
+
24,
|
|
164
|
+
28,
|
|
165
|
+
22,
|
|
166
|
+
24,
|
|
167
|
+
24,
|
|
168
|
+
30,
|
|
169
|
+
28,
|
|
170
|
+
28,
|
|
171
|
+
26,
|
|
172
|
+
28,
|
|
173
|
+
30,
|
|
174
|
+
24,
|
|
175
|
+
30,
|
|
176
|
+
30,
|
|
177
|
+
30,
|
|
178
|
+
30,
|
|
179
|
+
30,
|
|
180
|
+
30,
|
|
181
|
+
30,
|
|
182
|
+
30,
|
|
183
|
+
30,
|
|
184
|
+
30,
|
|
185
|
+
30,
|
|
186
|
+
30,
|
|
187
|
+
30,
|
|
188
|
+
30,
|
|
189
|
+
30,
|
|
190
|
+
30,
|
|
191
|
+
30,
|
|
192
|
+
30
|
|
193
|
+
]
|
|
194
|
+
], i = [
|
|
195
|
+
[
|
|
196
|
+
-1,
|
|
197
|
+
1,
|
|
198
|
+
1,
|
|
199
|
+
1,
|
|
200
|
+
1,
|
|
201
|
+
1,
|
|
202
|
+
2,
|
|
203
|
+
2,
|
|
204
|
+
2,
|
|
205
|
+
2,
|
|
206
|
+
4,
|
|
207
|
+
4,
|
|
208
|
+
4,
|
|
209
|
+
4,
|
|
210
|
+
4,
|
|
211
|
+
6,
|
|
212
|
+
6,
|
|
213
|
+
6,
|
|
214
|
+
6,
|
|
215
|
+
7,
|
|
216
|
+
8,
|
|
217
|
+
8,
|
|
218
|
+
9,
|
|
219
|
+
9,
|
|
220
|
+
10,
|
|
221
|
+
12,
|
|
222
|
+
12,
|
|
223
|
+
12,
|
|
224
|
+
13,
|
|
225
|
+
14,
|
|
226
|
+
15,
|
|
227
|
+
16,
|
|
228
|
+
17,
|
|
229
|
+
18,
|
|
230
|
+
19,
|
|
231
|
+
19,
|
|
232
|
+
20,
|
|
233
|
+
21,
|
|
234
|
+
22,
|
|
235
|
+
24,
|
|
236
|
+
25
|
|
237
|
+
],
|
|
238
|
+
[
|
|
239
|
+
-1,
|
|
240
|
+
1,
|
|
241
|
+
1,
|
|
242
|
+
1,
|
|
243
|
+
2,
|
|
244
|
+
2,
|
|
245
|
+
4,
|
|
246
|
+
4,
|
|
247
|
+
4,
|
|
248
|
+
5,
|
|
249
|
+
5,
|
|
250
|
+
5,
|
|
251
|
+
8,
|
|
252
|
+
9,
|
|
253
|
+
9,
|
|
254
|
+
10,
|
|
255
|
+
10,
|
|
256
|
+
11,
|
|
257
|
+
13,
|
|
258
|
+
14,
|
|
259
|
+
16,
|
|
260
|
+
17,
|
|
261
|
+
17,
|
|
262
|
+
18,
|
|
263
|
+
20,
|
|
264
|
+
21,
|
|
265
|
+
23,
|
|
266
|
+
25,
|
|
267
|
+
26,
|
|
268
|
+
28,
|
|
269
|
+
29,
|
|
270
|
+
31,
|
|
271
|
+
33,
|
|
272
|
+
35,
|
|
273
|
+
37,
|
|
274
|
+
38,
|
|
275
|
+
40,
|
|
276
|
+
43,
|
|
277
|
+
45,
|
|
278
|
+
47,
|
|
279
|
+
49
|
|
280
|
+
],
|
|
281
|
+
[
|
|
282
|
+
-1,
|
|
283
|
+
1,
|
|
284
|
+
1,
|
|
285
|
+
2,
|
|
286
|
+
2,
|
|
287
|
+
4,
|
|
288
|
+
4,
|
|
289
|
+
6,
|
|
290
|
+
6,
|
|
291
|
+
8,
|
|
292
|
+
8,
|
|
293
|
+
8,
|
|
294
|
+
10,
|
|
295
|
+
12,
|
|
296
|
+
16,
|
|
297
|
+
12,
|
|
298
|
+
17,
|
|
299
|
+
16,
|
|
300
|
+
18,
|
|
301
|
+
21,
|
|
302
|
+
20,
|
|
303
|
+
23,
|
|
304
|
+
23,
|
|
305
|
+
25,
|
|
306
|
+
27,
|
|
307
|
+
29,
|
|
308
|
+
34,
|
|
309
|
+
34,
|
|
310
|
+
35,
|
|
311
|
+
38,
|
|
312
|
+
40,
|
|
313
|
+
43,
|
|
314
|
+
45,
|
|
315
|
+
48,
|
|
316
|
+
51,
|
|
317
|
+
53,
|
|
318
|
+
56,
|
|
319
|
+
59,
|
|
320
|
+
62,
|
|
321
|
+
65,
|
|
322
|
+
68
|
|
323
|
+
],
|
|
324
|
+
[
|
|
325
|
+
-1,
|
|
326
|
+
1,
|
|
327
|
+
1,
|
|
328
|
+
2,
|
|
329
|
+
4,
|
|
330
|
+
4,
|
|
331
|
+
4,
|
|
332
|
+
5,
|
|
333
|
+
6,
|
|
334
|
+
8,
|
|
335
|
+
8,
|
|
336
|
+
11,
|
|
337
|
+
11,
|
|
338
|
+
16,
|
|
339
|
+
16,
|
|
340
|
+
18,
|
|
341
|
+
16,
|
|
342
|
+
19,
|
|
343
|
+
21,
|
|
344
|
+
25,
|
|
345
|
+
25,
|
|
346
|
+
25,
|
|
347
|
+
34,
|
|
348
|
+
30,
|
|
349
|
+
32,
|
|
350
|
+
35,
|
|
351
|
+
37,
|
|
352
|
+
40,
|
|
353
|
+
42,
|
|
354
|
+
45,
|
|
355
|
+
48,
|
|
356
|
+
51,
|
|
357
|
+
54,
|
|
358
|
+
57,
|
|
359
|
+
60,
|
|
360
|
+
63,
|
|
361
|
+
66,
|
|
362
|
+
70,
|
|
363
|
+
74,
|
|
364
|
+
77,
|
|
365
|
+
81
|
|
366
|
+
]
|
|
367
|
+
];
|
|
368
|
+
function a(e) {
|
|
369
|
+
let t = (16 * e + 128) * e + 64;
|
|
370
|
+
if (e >= 2) {
|
|
371
|
+
let n = Math.floor(e / 7) + 2;
|
|
372
|
+
t -= (25 * n - 10) * n - 55, e >= 7 && (t -= 36);
|
|
373
|
+
}
|
|
374
|
+
return t;
|
|
375
|
+
}
|
|
376
|
+
function o(t, n) {
|
|
377
|
+
let o = e[n].ordinal;
|
|
378
|
+
return Math.floor(a(t) / 8) - r[o][t] * i[o][t];
|
|
379
|
+
}
|
|
380
|
+
function s(e, t) {
|
|
381
|
+
let n = 0;
|
|
382
|
+
for (let r = 7; r >= 0; r--) n = n << 1 ^ (n >>> 7) * 285, n ^= (t >>> r & 1) * e;
|
|
383
|
+
return n & 255;
|
|
384
|
+
}
|
|
385
|
+
function c(e) {
|
|
386
|
+
let t = Array.from({ length: e }).fill(0);
|
|
387
|
+
t[e - 1] = 1;
|
|
388
|
+
let n = 1;
|
|
389
|
+
for (let r = 0; r < e; r++) {
|
|
390
|
+
for (let e = 0; e < t.length; e++) t[e] = s(t[e], n), e + 1 < t.length && (t[e] = t[e] ^ t[e + 1]);
|
|
391
|
+
n = s(n, 2);
|
|
392
|
+
}
|
|
393
|
+
return t;
|
|
394
|
+
}
|
|
395
|
+
function l(e, t) {
|
|
396
|
+
let n = Array.from({ length: t.length }).fill(0);
|
|
397
|
+
for (let r of e) {
|
|
398
|
+
let e = r ^ n.shift();
|
|
399
|
+
n.push(0);
|
|
400
|
+
for (let r = 0; r < n.length; r++) n[r] = n[r] ^ s(t[r], e);
|
|
401
|
+
}
|
|
402
|
+
return n;
|
|
403
|
+
}
|
|
404
|
+
function u(e, t, n) {
|
|
405
|
+
for (let r = t - 1; r >= 0; r--) n.push(e >>> r & 1);
|
|
406
|
+
}
|
|
407
|
+
function d(e, t) {
|
|
408
|
+
let n = [];
|
|
409
|
+
u(4, 4, n);
|
|
410
|
+
let r = t <= 9 ? 8 : 16;
|
|
411
|
+
u(e.length, r, n);
|
|
412
|
+
for (let t of e) u(t, 8, n);
|
|
413
|
+
return n;
|
|
414
|
+
}
|
|
415
|
+
function f(e, t, n) {
|
|
416
|
+
return 4 + (t <= 9 ? 8 : 16) + e * 8 <= o(t, n) * 8;
|
|
417
|
+
}
|
|
418
|
+
function p(t, n, o) {
|
|
419
|
+
let s = e[o].ordinal, u = i[s][n], d = r[s][n], f = Math.floor(a(n) / 8), p = u - f % u, m = Math.floor(f / u), h = [], g = c(d), _ = 0;
|
|
420
|
+
for (let e = 0; e < u; e++) {
|
|
421
|
+
let n = m - d + (e < p ? 0 : 1), r = t.slice(_, _ + n);
|
|
422
|
+
_ += n;
|
|
423
|
+
let i = l(r, g);
|
|
424
|
+
e < p && r.push(0), h.push(r.concat(i));
|
|
425
|
+
}
|
|
426
|
+
let v = [];
|
|
427
|
+
for (let e = 0; e < h[0].length; e++) for (let t = 0; t < h.length; t++) (e !== m - d || t >= p) && v.push(h[t][e]);
|
|
428
|
+
return v;
|
|
429
|
+
}
|
|
430
|
+
function m(e, t, n) {
|
|
431
|
+
let r = d(h(e), t), i = o(t, n) * 8;
|
|
432
|
+
u(0, Math.min(4, i - r.length), r), u(0, (8 - r.length % 8) % 8, r);
|
|
433
|
+
let a = [];
|
|
434
|
+
for (let e = 0; e < r.length; e += 8) {
|
|
435
|
+
let t = 0;
|
|
436
|
+
for (let n = 0; n < 8; n++) t = t << 1 | r[e + n];
|
|
437
|
+
a.push(t);
|
|
438
|
+
}
|
|
439
|
+
for (let e = 236; a.length < i / 8; e ^= 253) a.push(e);
|
|
440
|
+
return a;
|
|
441
|
+
}
|
|
442
|
+
function h(e) {
|
|
443
|
+
return typeof TextEncoder < "u" ? Array.from(new TextEncoder().encode(e)) : Array.from(unescape(encodeURIComponent(e)), (e) => e.charCodeAt(0));
|
|
444
|
+
}
|
|
445
|
+
var g = class {
|
|
446
|
+
size;
|
|
447
|
+
modules;
|
|
448
|
+
isFunction;
|
|
449
|
+
constructor(e) {
|
|
450
|
+
this.size = e * 4 + 17, this.modules = Array.from({ length: this.size }, () => Array.from({ length: this.size }).fill(!1)), this.isFunction = Array.from({ length: this.size }, () => Array.from({ length: this.size }).fill(!1));
|
|
451
|
+
}
|
|
452
|
+
set(e, t, n, r) {
|
|
453
|
+
this.modules[t][e] = n, this.isFunction[t][e] = r;
|
|
454
|
+
}
|
|
455
|
+
drawFinder(e, t) {
|
|
456
|
+
for (let n = -4; n <= 4; n++) for (let r = -4; r <= 4; r++) {
|
|
457
|
+
let i = e + r, a = t + n;
|
|
458
|
+
if (i < 0 || i >= this.size || a < 0 || a >= this.size) continue;
|
|
459
|
+
let o = Math.max(Math.abs(r), Math.abs(n));
|
|
460
|
+
this.set(i, a, o !== 2 && o !== 4, !0);
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
drawAlignment(e, t) {
|
|
464
|
+
for (let n = -2; n <= 2; n++) for (let r = -2; r <= 2; r++) this.set(e + r, t + n, Math.max(Math.abs(r), Math.abs(n)) !== 1, !0);
|
|
465
|
+
}
|
|
466
|
+
isFn(e, t) {
|
|
467
|
+
return this.isFunction[t][e];
|
|
468
|
+
}
|
|
469
|
+
};
|
|
470
|
+
function _(e) {
|
|
471
|
+
if (e === 1) return [];
|
|
472
|
+
let t = Math.floor(e / 7) + 2, n = Math.floor((e * 8 + t * 3 + 5) / (t * 4 - 4)) * 2, r = [6];
|
|
473
|
+
for (let i = e * 4 + 10; r.length < t; i -= n) r.splice(1, 0, i);
|
|
474
|
+
return r;
|
|
475
|
+
}
|
|
476
|
+
function v(e, t, n) {
|
|
477
|
+
let r = e.size;
|
|
478
|
+
for (let t = 0; t < r; t++) e.set(6, t, t % 2 == 0, !0), e.set(t, 6, t % 2 == 0, !0);
|
|
479
|
+
e.drawFinder(3, 3), e.drawFinder(r - 4, 3), e.drawFinder(3, r - 4);
|
|
480
|
+
let i = _(t);
|
|
481
|
+
for (let t = 0; t < i.length; t++) for (let n = 0; n < i.length; n++) t === 0 && n === 0 || t === 0 && n === i.length - 1 || t === i.length - 1 && n === 0 || e.drawAlignment(i[t], i[n]);
|
|
482
|
+
y(e, n, 0, !0), b(e, t);
|
|
483
|
+
}
|
|
484
|
+
function y(t, n, r, i) {
|
|
485
|
+
let a = t.size, o = e[n].formatBits << 3 | r, s = o;
|
|
486
|
+
for (let e = 0; e < 10; e++) s = s << 1 ^ (s >>> 9) * 1335;
|
|
487
|
+
let c = (o << 10 | s) ^ 21522, l = (e) => i ? !1 : (c >>> e & 1) != 0;
|
|
488
|
+
for (let e = 0; e <= 5; e++) t.set(8, e, l(e), !0);
|
|
489
|
+
t.set(8, 7, l(6), !0), t.set(8, 8, l(7), !0), t.set(7, 8, l(8), !0);
|
|
490
|
+
for (let e = 9; e < 15; e++) t.set(14 - e, 8, l(e), !0);
|
|
491
|
+
for (let e = 0; e < 8; e++) t.set(a - 1 - e, 8, l(e), !0);
|
|
492
|
+
for (let e = 8; e < 15; e++) t.set(8, a - 15 + e, l(e), !0);
|
|
493
|
+
t.set(8, a - 8, !0, !0);
|
|
494
|
+
}
|
|
495
|
+
function b(e, t) {
|
|
496
|
+
if (t < 7) return;
|
|
497
|
+
let n = t;
|
|
498
|
+
for (let e = 0; e < 12; e++) n = n << 1 ^ (n >>> 11) * 7973;
|
|
499
|
+
let r = t << 12 | n;
|
|
500
|
+
for (let t = 0; t < 18; t++) {
|
|
501
|
+
let n = (r >>> t & 1) != 0, i = e.size - 11 + t % 3, a = Math.floor(t / 3);
|
|
502
|
+
e.set(i, a, n, !0), e.set(a, i, n, !0);
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
function x(e, t) {
|
|
506
|
+
let n = e.size, r = 0;
|
|
507
|
+
for (let i = n - 1; i >= 1; i -= 2) {
|
|
508
|
+
let a = i === 6 ? 5 : i;
|
|
509
|
+
for (let i = 0; i < n; i++) for (let o = 0; o < 2; o++) {
|
|
510
|
+
let s = a - o, c = a + 1 & 2 ? i : n - 1 - i;
|
|
511
|
+
if (!e.isFn(s, c) && r < t.length * 8) {
|
|
512
|
+
let n = (t[r >>> 3] >>> 7 - (r & 7) & 1) != 0;
|
|
513
|
+
e.set(s, c, n, !1), r++;
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
function S(e, t) {
|
|
519
|
+
for (let n = 0; n < e.size; n++) for (let r = 0; r < e.size; r++) {
|
|
520
|
+
if (e.isFn(r, n)) continue;
|
|
521
|
+
let i = !1;
|
|
522
|
+
switch (t) {
|
|
523
|
+
case 0:
|
|
524
|
+
i = (r + n) % 2 == 0;
|
|
525
|
+
break;
|
|
526
|
+
case 1:
|
|
527
|
+
i = n % 2 == 0;
|
|
528
|
+
break;
|
|
529
|
+
case 2:
|
|
530
|
+
i = r % 3 == 0;
|
|
531
|
+
break;
|
|
532
|
+
case 3:
|
|
533
|
+
i = (r + n) % 3 == 0;
|
|
534
|
+
break;
|
|
535
|
+
case 4:
|
|
536
|
+
i = (Math.floor(r / 3) + Math.floor(n / 2)) % 2 == 0;
|
|
537
|
+
break;
|
|
538
|
+
case 5:
|
|
539
|
+
i = r * n % 2 + r * n % 3 == 0;
|
|
540
|
+
break;
|
|
541
|
+
case 6:
|
|
542
|
+
i = (r * n % 2 + r * n % 3) % 2 == 0;
|
|
543
|
+
break;
|
|
544
|
+
case 7:
|
|
545
|
+
i = ((r + n) % 2 + r * n % 3) % 2 == 0;
|
|
546
|
+
break;
|
|
547
|
+
}
|
|
548
|
+
i && (e.modules[n][r] = !e.modules[n][r]);
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
function C(e) {
|
|
552
|
+
let t = e.size, n = 0, r = e.modules;
|
|
553
|
+
for (let e = 0; e < t; e++) {
|
|
554
|
+
let i = !1, a = 0;
|
|
555
|
+
for (let o = 0; o < t; o++) r[e][o] === i ? (a++, a === 5 ? n += 3 : a > 5 && n++) : (i = r[e][o], a = 1);
|
|
556
|
+
}
|
|
557
|
+
for (let e = 0; e < t; e++) {
|
|
558
|
+
let i = !1, a = 0;
|
|
559
|
+
for (let o = 0; o < t; o++) r[o][e] === i ? (a++, a === 5 ? n += 3 : a > 5 && n++) : (i = r[o][e], a = 1);
|
|
560
|
+
}
|
|
561
|
+
for (let e = 0; e < t - 1; e++) for (let i = 0; i < t - 1; i++) {
|
|
562
|
+
let t = r[e][i];
|
|
563
|
+
t === r[e][i + 1] && t === r[e + 1][i] && t === r[e + 1][i + 1] && (n += 3);
|
|
564
|
+
}
|
|
565
|
+
let i = 0;
|
|
566
|
+
for (let e = 0; e < t; e++) for (let n = 0; n < t; n++) r[e][n] && i++;
|
|
567
|
+
let a = t * t, o = Math.ceil(Math.abs(i * 20 - a * 10) / a) - 1;
|
|
568
|
+
return n += o * 10, n;
|
|
569
|
+
}
|
|
570
|
+
function w(e, r = "M") {
|
|
571
|
+
let i = h(e).length, a = t;
|
|
572
|
+
for (; a <= n && !f(i, a, r);) a++;
|
|
573
|
+
if (a > n) throw Error("Data too long for a QR code");
|
|
574
|
+
let o = p(m(e, a, r), a, r), s = new g(a);
|
|
575
|
+
v(s, a, r), x(s, o);
|
|
576
|
+
let c = 0, l = Infinity;
|
|
577
|
+
for (let e = 0; e < 8; e++) {
|
|
578
|
+
S(s, e), y(s, r, e, !1);
|
|
579
|
+
let t = C(s);
|
|
580
|
+
t < l && (l = t, c = e), S(s, e);
|
|
581
|
+
}
|
|
582
|
+
return S(s, c), y(s, r, c, !1), s.modules;
|
|
583
|
+
}
|
|
584
|
+
//#endregion
|
|
585
|
+
export { w as encode };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer cascivo.component{._qrCode_1p9u3_2{color:var(--cascivo-color-text);display:inline-block;overflow:hidden}._svg_1p9u3_8{block-size:100%;inline-size:100%;display:block}}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { encode as e } from "./encode.js";
|
|
4
|
+
import t from "./qr-code.module.js";
|
|
5
|
+
import { cn as n, useSignals as r } from "@cascivo/core";
|
|
6
|
+
import { builtin as i, t as a } from "@cascivo/i18n";
|
|
7
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
8
|
+
//#region ../components/src/qr-code/qr-code.tsx
|
|
9
|
+
var c = 4;
|
|
10
|
+
function l({ value: l, size: u = 128, errorCorrection: d = "M", radius: f, fill: p = "currentColor", background: m = "transparent", label: h, className: g, style: _, ...v }) {
|
|
11
|
+
if (r(), !l) return null;
|
|
12
|
+
let y = e(l, d), b = y.length + c * 2, x = "";
|
|
13
|
+
for (let e = 0; e < y.length; e++) for (let t = 0; t < y.length; t++) y[e][t] && (x += `M${t + c},${e + c}h1v1h-1z`);
|
|
14
|
+
return /* @__PURE__ */ o("div", {
|
|
15
|
+
className: n(t.qrCode, g),
|
|
16
|
+
style: {
|
|
17
|
+
inlineSize: u,
|
|
18
|
+
blockSize: u,
|
|
19
|
+
borderRadius: f,
|
|
20
|
+
..._
|
|
21
|
+
},
|
|
22
|
+
...v,
|
|
23
|
+
children: /* @__PURE__ */ s("svg", {
|
|
24
|
+
className: t.svg,
|
|
25
|
+
role: "img",
|
|
26
|
+
"aria-label": h ?? a(i.qrCode.label),
|
|
27
|
+
viewBox: `0 0 ${b} ${b}`,
|
|
28
|
+
shapeRendering: "crispEdges",
|
|
29
|
+
children: [/* @__PURE__ */ o("rect", {
|
|
30
|
+
width: b,
|
|
31
|
+
height: b,
|
|
32
|
+
fill: m
|
|
33
|
+
}), /* @__PURE__ */ o("path", {
|
|
34
|
+
d: x,
|
|
35
|
+
fill: p
|
|
36
|
+
})]
|
|
37
|
+
})
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
//#endregion
|
|
41
|
+
export { l as QrCode };
|