@microblink/camera-manager 7.2.5 → 7.2.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 +92 -0
- package/dist/camera-manager.js +1217 -1122
- package/package.json +3 -3
- package/types/core/Camera.d.ts +119 -77
- package/types/core/Camera.d.ts.map +1 -1
- package/types/core/CameraManager.d.ts +72 -65
- package/types/core/CameraManager.d.ts.map +1 -1
- package/types/core/cameraError.d.ts +1 -1
- package/types/core/cameraError.d.ts.map +1 -1
- package/types/core/cameraManagerStore.d.ts +15 -1
- package/types/core/cameraManagerStore.d.ts.map +1 -1
- package/types/core/cameraUtils.d.ts +1 -1
- package/types/core/cameraUtils.d.ts.map +1 -1
- package/types/core/utils.d.ts +1 -0
- package/types/core/utils.d.ts.map +1 -1
- package/types/index.rollup.d.ts +86 -27
- package/types/media-mock/createInputDeviceInfo.d.ts +1 -1
- package/types/media-mock/createInputDeviceInfo.d.ts.map +1 -1
- package/types/media-mock/fake-devices.d.ts +7 -3
- package/types/media-mock/fake-devices.d.ts.map +1 -1
- package/types/media-mock/fakeDevices/iPhoneX.d.ts +6 -0
- package/types/media-mock/fakeDevices/iPhoneX.d.ts.map +1 -0
- package/types/ui/CameraErrorModal.d.ts.map +1 -1
- package/types/ui/CameraSelector.d.ts.map +1 -1
- package/types/ui/CaptureScreen.d.ts +0 -4
- package/types/ui/CaptureScreen.d.ts.map +1 -1
- package/types/ui/Header.d.ts.map +1 -1
- package/types/ui/debounce.d.ts +14 -0
- package/types/ui/debounce.d.ts.map +1 -0
- package/types/ui/determineFitMode.d.ts +4 -1
- package/types/ui/determineFitMode.d.ts.map +1 -1
- package/types/ui/locales/ak.d.ts +19 -0
- package/types/ui/locales/ak.d.ts.map +1 -0
- package/types/ui/locales/am.d.ts +19 -0
- package/types/ui/locales/am.d.ts.map +1 -0
- package/types/ui/locales/ar.d.ts +19 -0
- package/types/ui/locales/ar.d.ts.map +1 -0
- package/types/ui/locales/bn.d.ts +19 -0
- package/types/ui/locales/bn.d.ts.map +1 -0
- package/types/ui/locales/cs.d.ts +19 -0
- package/types/ui/locales/cs.d.ts.map +1 -0
- package/types/ui/locales/da.d.ts +19 -0
- package/types/ui/locales/da.d.ts.map +1 -0
- package/types/ui/locales/de.d.ts +19 -0
- package/types/ui/locales/de.d.ts.map +1 -0
- package/types/ui/locales/el.d.ts +19 -0
- package/types/ui/locales/el.d.ts.map +1 -0
- package/types/ui/locales/en.d.ts +8 -8
- package/types/ui/locales/en_GB.d.ts +19 -0
- package/types/ui/locales/en_GB.d.ts.map +1 -0
- package/types/ui/locales/es.d.ts +19 -0
- package/types/ui/locales/es.d.ts.map +1 -0
- package/types/ui/locales/es_MX.d.ts +19 -0
- package/types/ui/locales/es_MX.d.ts.map +1 -0
- package/types/ui/locales/fa-latn.d.ts +19 -0
- package/types/ui/locales/fa-latn.d.ts.map +1 -0
- package/types/ui/locales/fi.d.ts +19 -0
- package/types/ui/locales/fi.d.ts.map +1 -0
- package/types/ui/locales/fil.d.ts +19 -0
- package/types/ui/locales/fil.d.ts.map +1 -0
- package/types/ui/locales/fr.d.ts +19 -0
- package/types/ui/locales/fr.d.ts.map +1 -0
- package/types/ui/locales/fr_CA.d.ts +19 -0
- package/types/ui/locales/fr_CA.d.ts.map +1 -0
- package/types/ui/locales/ha.d.ts +19 -0
- package/types/ui/locales/ha.d.ts.map +1 -0
- package/types/ui/locales/he.d.ts +19 -0
- package/types/ui/locales/he.d.ts.map +1 -0
- package/types/ui/locales/hi.d.ts +19 -0
- package/types/ui/locales/hi.d.ts.map +1 -0
- package/types/ui/locales/hr.d.ts +19 -0
- package/types/ui/locales/hr.d.ts.map +1 -0
- package/types/ui/locales/hu.d.ts +19 -0
- package/types/ui/locales/hu.d.ts.map +1 -0
- package/types/ui/locales/id.d.ts +19 -0
- package/types/ui/locales/id.d.ts.map +1 -0
- package/types/ui/locales/index.d.ts +60 -0
- package/types/ui/locales/index.d.ts.map +1 -0
- package/types/ui/locales/is.d.ts +19 -0
- package/types/ui/locales/is.d.ts.map +1 -0
- package/types/ui/locales/it.d.ts +19 -0
- package/types/ui/locales/it.d.ts.map +1 -0
- package/types/ui/locales/ja.d.ts +19 -0
- package/types/ui/locales/ja.d.ts.map +1 -0
- package/types/ui/locales/ka_GE.d.ts +19 -0
- package/types/ui/locales/ka_GE.d.ts.map +1 -0
- package/types/ui/locales/kk.d.ts +19 -0
- package/types/ui/locales/kk.d.ts.map +1 -0
- package/types/ui/locales/km_KH.d.ts +19 -0
- package/types/ui/locales/km_KH.d.ts.map +1 -0
- package/types/ui/locales/ko.d.ts +19 -0
- package/types/ui/locales/ko.d.ts.map +1 -0
- package/types/ui/locales/lv.d.ts +19 -0
- package/types/ui/locales/lv.d.ts.map +1 -0
- package/types/ui/locales/ms.d.ts +19 -0
- package/types/ui/locales/ms.d.ts.map +1 -0
- package/types/ui/locales/ne.d.ts +19 -0
- package/types/ui/locales/ne.d.ts.map +1 -0
- package/types/ui/locales/nl.d.ts +19 -0
- package/types/ui/locales/nl.d.ts.map +1 -0
- package/types/ui/locales/no.d.ts +19 -0
- package/types/ui/locales/no.d.ts.map +1 -0
- package/types/ui/locales/pl.d.ts +19 -0
- package/types/ui/locales/pl.d.ts.map +1 -0
- package/types/ui/locales/ps_AF.d.ts +19 -0
- package/types/ui/locales/ps_AF.d.ts.map +1 -0
- package/types/ui/locales/pt.d.ts +19 -0
- package/types/ui/locales/pt.d.ts.map +1 -0
- package/types/ui/locales/pt_BR.d.ts +19 -0
- package/types/ui/locales/pt_BR.d.ts.map +1 -0
- package/types/ui/locales/ro.d.ts +19 -0
- package/types/ui/locales/ro.d.ts.map +1 -0
- package/types/ui/locales/ru.d.ts +19 -0
- package/types/ui/locales/ru.d.ts.map +1 -0
- package/types/ui/locales/si.d.ts +19 -0
- package/types/ui/locales/si.d.ts.map +1 -0
- package/types/ui/locales/sk.d.ts +19 -0
- package/types/ui/locales/sk.d.ts.map +1 -0
- package/types/ui/locales/sl.d.ts +19 -0
- package/types/ui/locales/sl.d.ts.map +1 -0
- package/types/ui/locales/sr.d.ts +19 -0
- package/types/ui/locales/sr.d.ts.map +1 -0
- package/types/ui/locales/sv.d.ts +19 -0
- package/types/ui/locales/sv.d.ts.map +1 -0
- package/types/ui/locales/sw.d.ts +19 -0
- package/types/ui/locales/sw.d.ts.map +1 -0
- package/types/ui/locales/th.d.ts +19 -0
- package/types/ui/locales/th.d.ts.map +1 -0
- package/types/ui/locales/tr.d.ts +19 -0
- package/types/ui/locales/tr.d.ts.map +1 -0
- package/types/ui/locales/uk.d.ts +19 -0
- package/types/ui/locales/uk.d.ts.map +1 -0
- package/types/ui/locales/ur.d.ts +19 -0
- package/types/ui/locales/ur.d.ts.map +1 -0
- package/types/ui/locales/uz.d.ts +19 -0
- package/types/ui/locales/uz.d.ts.map +1 -0
- package/types/ui/locales/vi.d.ts +19 -0
- package/types/ui/locales/vi.d.ts.map +1 -0
- package/types/ui/locales/yo.d.ts +19 -0
- package/types/ui/locales/yo.d.ts.map +1 -0
- package/types/ui/locales/zh_CN.d.ts +19 -0
- package/types/ui/locales/zh_CN.d.ts.map +1 -0
- package/types/ui/locales/zh_TW.d.ts +19 -0
- package/types/ui/locales/zh_TW.d.ts.map +1 -0
package/dist/camera-manager.js
CHANGED
|
@@ -1,36 +1,50 @@
|
|
|
1
|
-
(function(){"use strict";(r=>{window.__mbCameraManagerCssCode=r})("._dialogPositioner_worsp_1{position:fixed;top:calc(var(--mb-size)*0rem);left:calc(var(--mb-size)*0rem);display:grid;height:100vh;width:100%;padding:calc(var(--mb-size)*2rem)}@supports (height:100dvh){._dialogPositioner_worsp_1{height:100dvh}}._dialogBackdrop_worsp_5{position:absolute;top:calc(var(--mb-size)*0rem);left:calc(var(--mb-size)*0rem);width:100%;height:100%;--un-bg-opacity:1;background-color:rgb(var(--color-black-rgb-value) / var(--un-bg-opacity));--un-bg-opacity:.5;--un-backdrop-blur:blur(4px);-webkit-backdrop-filter:var(--un-backdrop-blur) var(--un-backdrop-brightness) var(--un-backdrop-contrast) var(--un-backdrop-grayscale) var(--un-backdrop-hue-rotate) var(--un-backdrop-invert) var(--un-backdrop-opacity) var(--un-backdrop-saturate) var(--un-backdrop-sepia);backdrop-filter:var(--un-backdrop-blur) var(--un-backdrop-brightness) var(--un-backdrop-contrast) var(--un-backdrop-grayscale) var(--un-backdrop-hue-rotate) var(--un-backdrop-invert) var(--un-backdrop-opacity) var(--un-backdrop-saturate) var(--un-backdrop-sepia)}._dialogContent_worsp_9{position:relative;max-height:calc(100dvh - 4rem);max-width:28rem;display:flex;flex-direction:column;place-self:center;border-radius:.5rem;--un-bg-opacity:1;background-color:rgb(var(--color-white-rgb-value) / var(--un-bg-opacity));padding-left:min(8%,3rem);padding-right:min(8%,3rem);padding-top:min(8%,1.5rem);padding-bottom:min(8%,1.5rem);--un-text-opacity:1;color:rgb(15 15 15 / var(--un-text-opacity));--un-shadow:var(--un-shadow-inset) 0 10px 15px -3px var(--un-shadow-color, rgb(0 0 0 / .1)),var(--un-shadow-inset) 0 4px 6px -4px var(--un-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}._dialogContent_worsp_9._large_worsp_13{padding-left:min(8%,4rem);padding-right:min(8%,4rem);padding-top:min(8%,3rem);padding-bottom:min(8%,3rem)}._dialogContent_worsp_9._compact_worsp_16{padding:min(8%,1.5rem)}@media (min-width: 640px){._dialogContent_worsp_9{max-width:36rem}}@media (min-width: 1024px){._dialogContent_worsp_9{max-width:28rem}}._dialogTitle_worsp_30{text-align:center;font-size:calc(var(--mb-size)*1.5rem);line-height:calc(var(--mb-size)*2rem);font-weight:700}._contentOut_worsp_34{overflow-y:auto}._closeButton_worsp_38{position:absolute;top:.625rem;right:.625rem;width:calc(var(--mb-size)*2rem);height:calc(var(--mb-size)*2rem);display:flex;align-items:center;justify-content:center;border-radius:9999px;border-style:none;background-color:transparent;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s;transition-duration:.1s}._closeButton_worsp_38:hover{--un-bg-opacity:1;background-color:rgb(var(--color-gray-100-rgb-value) / var(--un-bg-opacity))}._closeButton_worsp_38:active{--un-bg-opacity:1;background-color:rgb(var(--color-gray-200-rgb-value) / var(--un-bg-opacity))}._closeButtonInner_worsp_44{display:flex;--un-translate-y:-2px;transform:translate(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotate(var(--un-rotate-z)) skew(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z));align-items:center;justify-content:center;font-size:calc(var(--mb-size)*1.875rem);line-height:calc(var(--mb-size)*2.25rem);--un-text-opacity:1;color:rgb(var(--color-black-rgb-value) / var(--un-text-opacity));font-weight:200;line-height:1}._primaryActionButton_worsp_49{height:2.5rem;-webkit-appearance:none;appearance:none;border-radius:calc(var(--mb-size)*2.5rem);border-style:none;--un-bg-opacity:1;background-color:rgb(var(--color-primary) / var(--un-bg-opacity));padding-left:calc(var(--mb-size)*1.25rem);padding-right:calc(var(--mb-size)*1.25rem);padding-top:calc(var(--mb-size)*.25rem);padding-bottom:calc(var(--mb-size)*.25rem);text-wrap:nowrap;font-size:calc(var(--mb-size)*.875rem);line-height:calc(var(--mb-size)*1.25rem);--un-text-opacity:1;color:rgb(var(--color-white-rgb-value) / var(--un-text-opacity));transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s;transition-duration:.1s}._primaryActionButton_worsp_49[disabled]{cursor:not-allowed;--un-bg-opacity:1;background-color:rgb(var(--color-gray-200-rgb-value) / var(--un-bg-opacity));--un-text-opacity:1;color:rgb(var(--color-gray-500-rgb-value) / var(--un-text-opacity));--un-ring-width:0px;--un-ring-offset-shadow:var(--un-ring-inset) 0 0 0 var(--un-ring-offset-width) var(--un-ring-offset-color);--un-ring-shadow:var(--un-ring-inset) 0 0 0 calc(var(--un-ring-width) + var(--un-ring-offset-width)) var(--un-ring-color);box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}._primaryActionButton_worsp_49[disabled]:hover{--un-bg-opacity:1;background-color:rgb(var(--color-gray-200-rgb-value) / var(--un-bg-opacity));--un-text-opacity:1;color:rgb(var(--color-gray-500-rgb-value) / var(--un-text-opacity))}._primaryActionButton_worsp_49:hover{--un-bg-opacity:1;background-color:rgb(var(--color-accent-700-rgb-value) / var(--un-bg-opacity))}._primaryActionButton_worsp_49:active{--un-bg-opacity:1;background-color:rgb(var(--color-accent-800-rgb-value) / var(--un-bg-opacity))}._primaryActionButton_worsp_49:focus{outline-width:2px;--un-outline-color-opacity:1;outline-color:rgb(var(--color-accent-400-rgb-value) / var(--un-outline-color-opacity));outline-offset:4px;outline-style:solid}._secondaryActionButton_worsp_53{height:2.5rem;-webkit-appearance:none;appearance:none;border-radius:calc(var(--mb-size)*2.5rem);border-style:none;background-color:transparent;padding-left:calc(var(--mb-size)*1.25rem);padding-right:calc(var(--mb-size)*1.25rem);padding-top:calc(var(--mb-size)*.25rem);padding-bottom:calc(var(--mb-size)*.25rem);text-wrap:nowrap;font-size:calc(var(--mb-size)*.875rem);line-height:calc(var(--mb-size)*1.25rem);--un-text-opacity:1;color:rgb(var(--color-primary) / var(--un-text-opacity));--un-ring-width:1px;--un-ring-offset-shadow:var(--un-ring-inset) 0 0 0 var(--un-ring-offset-width) var(--un-ring-offset-color);--un-ring-shadow:var(--un-ring-inset) 0 0 0 calc(var(--un-ring-width) + var(--un-ring-offset-width)) var(--un-ring-color);box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow);--un-ring-opacity:1;--un-ring-color:rgb(var(--color-primary) / var(--un-ring-opacity)) ;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s;transition-duration:.1s}._secondaryActionButton_worsp_53[disabled]{cursor:not-allowed;--un-bg-opacity:1;background-color:rgb(var(--color-gray-200-rgb-value) / var(--un-bg-opacity));--un-text-opacity:1;color:rgb(var(--color-gray-500-rgb-value) / var(--un-text-opacity));--un-ring-width:0px;--un-ring-offset-shadow:var(--un-ring-inset) 0 0 0 var(--un-ring-offset-width) var(--un-ring-offset-color);--un-ring-shadow:var(--un-ring-inset) 0 0 0 calc(var(--un-ring-width) + var(--un-ring-offset-width)) var(--un-ring-color);box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}._secondaryActionButton_worsp_53[disabled]:hover{--un-bg-opacity:1;background-color:rgb(var(--color-gray-200-rgb-value) / var(--un-bg-opacity));--un-text-opacity:1;color:rgb(var(--color-gray-500-rgb-value) / var(--un-text-opacity))}._secondaryActionButton_worsp_53:hover{--un-bg-opacity:1;background-color:rgb(var(--color-accent-25-rgb-value) / var(--un-bg-opacity));--un-text-opacity:1;color:rgb(var(--color-accent-700-rgb-value) / var(--un-text-opacity));--un-ring-opacity:1;--un-ring-color:rgb(var(--color-accent-700-rgb-value) / var(--un-ring-opacity)) }._secondaryActionButton_worsp_53:active{--un-bg-opacity:1;background-color:rgb(var(--color-accent-50-rgb-value) / var(--un-bg-opacity));--un-text-opacity:1;color:rgb(var(--color-accent-800-rgb-value) / var(--un-text-opacity));--un-ring-opacity:1;--un-ring-color:rgb(var(--color-accent-800-rgb-value) / var(--un-ring-opacity)) }._secondaryActionButton_worsp_53:focus{outline-width:2px;--un-outline-color-opacity:1;outline-color:rgb(var(--color-accent-400-rgb-value) / var(--un-outline-color-opacity));outline-offset:4px;outline-style:solid}._actions_worsp_57{display:flex;gap:calc(var(--mb-size)*1rem)}._actions_worsp_57 ._primaryActionButton_worsp_49,._actions_worsp_57 ._secondaryActionButton_worsp_53{width:50%}._alertTitle_worsp_64{font-size:calc(var(--mb-size)*1.125rem);line-height:calc(var(--mb-size)*1.75rem);--un-text-opacity:1;color:rgb(var(--color-gray-700-rgb-value) / var(--un-text-opacity));font-weight:400}._alertText_worsp_68{margin-top:calc(var(--mb-size)*1rem);margin-bottom:calc(var(--mb-size)*2rem);padding-left:calc(var(--mb-size)*.5rem);padding-right:calc(var(--mb-size)*.5rem);text-align:center;text-wrap:pretty;--un-text-opacity:1;color:rgb(var(--color-gray-500-rgb-value) / var(--un-text-opacity));font-weight:300;line-height:1.5}*,:before,:after{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }::backdrop{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.left-0{left:calc(var(--mb-size)*0rem)}.right-0{right:calc(var(--mb-size)*0rem)}.right-4{right:calc(var(--mb-size)*1rem)}.top-\\[-1px\\]{top:-1px}.top-0{top:calc(var(--mb-size)*0rem)}.has-\\[\\[data-scope\\]\\]\\:z-2:has([data-scope]),.z-2{z-index:2}.z-1{z-index:1}.grid{display:grid}.auto-cols-auto{grid-auto-columns:auto}.grid-cols-\\[1fr_auto_1fr\\]{grid-template-columns:1fr auto 1fr}.block{display:block}.size-12{width:calc(var(--mb-size)*3rem);height:calc(var(--mb-size)*3rem)}.size-6{width:calc(var(--mb-size)*1.5rem);height:calc(var(--mb-size)*1.5rem)}.size-full{width:100%;height:100%}.h-\\[1px\\]{height:1px}.h-full{height:100%}.h-vh{height:100vh}.max-w-\\[100\\%\\]{max-width:100%}.min-h-\\[300px\\]{min-height:300px}.min-w-0{min-width:calc(var(--mb-size)*0rem)}.w-full{width:100%}.flex{display:flex}.shrink-0{flex-shrink:0}.flex-nowrap{flex-wrap:nowrap}.data-\\[state\\=open\\]\\:scale-y-\\[-1\\][data-state=open]{--un-scale-y:-1;transform:translate(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotate(var(--un-rotate-z)) skew(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z))}.transform{transform:translate(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotate(var(--un-rotate-z)) skew(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z))}.cursor-pointer{cursor:pointer}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.select-none{-webkit-user-select:none;user-select:none}.resize{resize:both}.appearance-none{-webkit-appearance:none;appearance:none}.place-items-center{place-items:center}.items-center{align-items:center}.justify-between{justify-content:space-between}.justify-self-start{justify-self:start}.justify-self-end{justify-self:end}.justify-self-center{justify-self:center}.gap-\\[1px\\]{gap:1px}.gap-2{gap:calc(var(--mb-size)*.5rem)}.gap-4{gap:calc(var(--mb-size)*1rem)}.overflow-hidden{overflow:hidden}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.rounded-4{border-radius:calc(var(--mb-size)*1rem)}.rounded-full{border-radius:9999px}.rounded-md{border-radius:.375rem}.border-none{border-style:none}.bg-dark-100\\/50{background-color:#3c3c3c80}.bg-dark-500{--un-bg-opacity:1;background-color:rgb(31 31 31 / var(--un-bg-opacity))}.bg-white{--un-bg-opacity:1;background-color:rgb(var(--color-white-rgb-value) / var(--un-bg-opacity))}.data-\\[highlighted\\]\\:bg-gray-500\\/50[data-highlighted]{background-color:rgb(var(--color-gray-500-rgb-value) / .5)}.bg-opacity-50{--un-bg-opacity:.5}.p-2{padding:calc(var(--mb-size)*.5rem)}.px-4{padding-left:calc(var(--mb-size)*1rem);padding-right:calc(var(--mb-size)*1rem)}.py-2{padding-top:calc(var(--mb-size)*.5rem);padding-bottom:calc(var(--mb-size)*.5rem)}.py-3{padding-top:calc(var(--mb-size)*.75rem);padding-bottom:calc(var(--mb-size)*.75rem)}.py-4{padding-top:calc(var(--mb-size)*1rem);padding-bottom:calc(var(--mb-size)*1rem)}.pl-4{padding-left:calc(var(--mb-size)*1rem)}.pr-12{padding-right:calc(var(--mb-size)*3rem)}.text-align-center{text-align:center}.text-base{font-size:calc(var(--mb-size)*1rem);line-height:calc(var(--mb-size)*1.5rem)}.text-sm{font-size:calc(var(--mb-size)*.875rem);line-height:calc(var(--mb-size)*1.25rem)}.color-white{--un-text-opacity:1;color:rgb(var(--color-white-rgb-value) / var(--un-text-opacity))}.font-500{font-weight:500}.disabled\\:opacity-50:disabled{opacity:.5}.shadow{--un-shadow:var(--un-shadow-inset) 0 1px 3px 0 var(--un-shadow-color, rgb(0 0 0 / .1)),var(--un-shadow-inset) 0 1px 2px -1px var(--un-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.backdrop-blur{--un-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--un-backdrop-blur) var(--un-backdrop-brightness) var(--un-backdrop-contrast) var(--un-backdrop-grayscale) var(--un-backdrop-hue-rotate) var(--un-backdrop-invert) var(--un-backdrop-opacity) var(--un-backdrop-saturate) var(--un-backdrop-sepia);backdrop-filter:var(--un-backdrop-blur) var(--un-backdrop-brightness) var(--un-backdrop-contrast) var(--un-backdrop-grayscale) var(--un-backdrop-hue-rotate) var(--un-backdrop-invert) var(--un-backdrop-opacity) var(--un-backdrop-saturate) var(--un-backdrop-sepia)}.backdrop-blur-xl{--un-backdrop-blur:blur(24px);-webkit-backdrop-filter:var(--un-backdrop-blur) var(--un-backdrop-brightness) var(--un-backdrop-contrast) var(--un-backdrop-grayscale) var(--un-backdrop-hue-rotate) var(--un-backdrop-invert) var(--un-backdrop-opacity) var(--un-backdrop-saturate) var(--un-backdrop-sepia);backdrop-filter:var(--un-backdrop-blur) var(--un-backdrop-brightness) var(--un-backdrop-contrast) var(--un-backdrop-grayscale) var(--un-backdrop-hue-rotate) var(--un-backdrop-invert) var(--un-backdrop-opacity) var(--un-backdrop-saturate) var(--un-backdrop-sepia)}.drop-shadow-md{--un-drop-shadow:drop-shadow(0 4px 3px var(--un-drop-shadow-color, rgb(0 0 0 / .07))) drop-shadow(0 2px 2px var(--un-drop-shadow-color, rgb(0 0 0 / .06)));filter:var(--un-blur) var(--un-brightness) var(--un-contrast) var(--un-drop-shadow) var(--un-grayscale) var(--un-hue-rotate) var(--un-invert) var(--un-saturate) var(--un-sepia)}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.lerp\\:px-3\\@xs\\,8\\@lg{padding-inline:clamp(calc(var(--mb-size)*.75rem),calc(var(--mb-size)*.75rem) + (100vw - 380px) * .031055900621118012,calc(var(--mb-size)*2rem))}@supports (height:100dvh){.supports-\\[\\(height\\:100dvh\\)\\]\\:h-dvh{height:100dvh}}")})();
|
|
2
|
-
import { subscribeWithSelector as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
1
|
+
(function(){"use strict";(r=>{window.__mbCameraManagerCssCode=r})("._dialogPositioner_15i6c_1{position:fixed;top:calc(var(--mb-size)*0rem);left:calc(var(--mb-size)*0rem);display:grid;height:100vh;width:100%;padding:calc(var(--mb-size)*2rem)}@supports (height:100dvh){._dialogPositioner_15i6c_1{height:100dvh}}@media (max-width: 379.9px){._dialogPositioner_15i6c_1{padding:calc(var(--mb-size)*1rem)}}._dialogBackdrop_15i6c_10{position:absolute;top:calc(var(--mb-size)*0rem);left:calc(var(--mb-size)*0rem);width:100%;height:100%;--un-bg-opacity:1;background-color:rgb(var(--color-black-rgb-value) / var(--un-bg-opacity));--un-bg-opacity:.5;--un-backdrop-blur:blur(4px);-webkit-backdrop-filter:var(--un-backdrop-blur) var(--un-backdrop-brightness) var(--un-backdrop-contrast) var(--un-backdrop-grayscale) var(--un-backdrop-hue-rotate) var(--un-backdrop-invert) var(--un-backdrop-opacity) var(--un-backdrop-saturate) var(--un-backdrop-sepia);backdrop-filter:var(--un-backdrop-blur) var(--un-backdrop-brightness) var(--un-backdrop-contrast) var(--un-backdrop-grayscale) var(--un-backdrop-hue-rotate) var(--un-backdrop-invert) var(--un-backdrop-opacity) var(--un-backdrop-saturate) var(--un-backdrop-sepia)}._dialogContent_15i6c_14{position:relative;max-height:calc(100dvh - 4rem);max-width:28rem;display:flex;flex-direction:column;place-self:center;border-radius:.5rem;--un-bg-opacity:1;background-color:rgb(var(--color-white-rgb-value) / var(--un-bg-opacity));padding-left:min(8%,3rem);padding-right:min(8%,3rem);padding-top:min(8%,1.5rem);padding-bottom:min(8%,1.5rem);--un-text-opacity:1;color:rgb(15 15 15 / var(--un-text-opacity));--un-shadow:var(--un-shadow-inset) 0 10px 15px -3px var(--un-shadow-color, rgb(0 0 0 / .1)),var(--un-shadow-inset) 0 4px 6px -4px var(--un-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}._dialogContent_15i6c_14._large_15i6c_18{padding-left:min(8%,4rem);padding-right:min(8%,4rem);padding-top:min(8%,3rem);padding-bottom:min(8%,3rem)}._dialogContent_15i6c_14._compact_15i6c_21{padding:min(8%,1.5rem)}@media screen and (max-height: 500px){._dialogContent_15i6c_14._compact_15i6c_21{height:auto}}@media screen and (max-height: 500px){._dialogContent_15i6c_14{height:100%;max-height:calc(100dvh - 2rem);overflow:hidden;padding-left:min(8%,1.5rem);padding-right:min(8%,1.5rem);padding-top:min(8%,.5rem);padding-bottom:min(8%,.5rem)}}@media (min-width: 640px){._dialogContent_15i6c_14{max-width:36rem}}@media (min-width: 1024px){._dialogContent_15i6c_14{max-width:28rem}}._dialogTitle_15i6c_45{text-align:center;font-size:calc(var(--mb-size)*1.5rem);line-height:calc(var(--mb-size)*2rem);font-weight:700}._contentOut_15i6c_49{height:100%}._closeButton_15i6c_53{position:absolute;top:.625rem;right:.625rem;width:calc(var(--mb-size)*2rem);height:calc(var(--mb-size)*2rem);display:flex;align-items:center;justify-content:center;border-style:none;background-color:transparent;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s;transition-duration:.1s}._closeButton_15i6c_53:hover{--un-bg-opacity:1;background-color:rgb(var(--color-gray-100-rgb-value) / var(--un-bg-opacity))}._closeButton_15i6c_53:active{--un-bg-opacity:1;background-color:rgb(var(--color-gray-200-rgb-value) / var(--un-bg-opacity))}._closeButtonInner_15i6c_59{width:.875rem;height:.875rem}._primaryActionButton_15i6c_63{height:2.5rem;-webkit-appearance:none;appearance:none;border-radius:calc(var(--mb-size)*2.5rem);border-style:none;--un-bg-opacity:1;background-color:rgb(var(--color-primary) / var(--un-bg-opacity));padding-left:calc(var(--mb-size)*1.25rem);padding-right:calc(var(--mb-size)*1.25rem);padding-top:calc(var(--mb-size)*.25rem);padding-bottom:calc(var(--mb-size)*.25rem);text-wrap:nowrap;font-size:calc(var(--mb-size)*.875rem);line-height:calc(var(--mb-size)*1.25rem);--un-text-opacity:1;color:rgb(var(--color-white-rgb-value) / var(--un-text-opacity));transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s;transition-duration:.1s}._primaryActionButton_15i6c_63[disabled]{cursor:not-allowed;--un-bg-opacity:1;background-color:rgb(var(--color-gray-200-rgb-value) / var(--un-bg-opacity));--un-text-opacity:1;color:rgb(var(--color-gray-500-rgb-value) / var(--un-text-opacity));--un-ring-width:0px;--un-ring-offset-shadow:var(--un-ring-inset) 0 0 0 var(--un-ring-offset-width) var(--un-ring-offset-color);--un-ring-shadow:var(--un-ring-inset) 0 0 0 calc(var(--un-ring-width) + var(--un-ring-offset-width)) var(--un-ring-color);box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}._primaryActionButton_15i6c_63[disabled]:hover{--un-bg-opacity:1;background-color:rgb(var(--color-gray-200-rgb-value) / var(--un-bg-opacity));--un-text-opacity:1;color:rgb(var(--color-gray-500-rgb-value) / var(--un-text-opacity))}._primaryActionButton_15i6c_63:hover{--un-bg-opacity:1;background-color:rgb(var(--color-accent-700-rgb-value) / var(--un-bg-opacity))}._primaryActionButton_15i6c_63:active{--un-bg-opacity:1;background-color:rgb(var(--color-accent-800-rgb-value) / var(--un-bg-opacity))}._primaryActionButton_15i6c_63:focus-visible{outline-width:2px;--un-outline-color-opacity:1;outline-color:rgb(var(--color-primary) / var(--un-outline-color-opacity));outline-offset:4px;outline-style:solid}._secondaryActionButton_15i6c_67{height:2.5rem;-webkit-appearance:none;appearance:none;border-radius:calc(var(--mb-size)*2.5rem);border-style:none;background-color:transparent;padding-left:calc(var(--mb-size)*1.25rem);padding-right:calc(var(--mb-size)*1.25rem);padding-top:calc(var(--mb-size)*.25rem);padding-bottom:calc(var(--mb-size)*.25rem);text-wrap:nowrap;font-size:calc(var(--mb-size)*.875rem);line-height:calc(var(--mb-size)*1.25rem);--un-text-opacity:1;color:rgb(var(--color-primary) / var(--un-text-opacity));--un-ring-width:1px;--un-ring-offset-shadow:var(--un-ring-inset) 0 0 0 var(--un-ring-offset-width) var(--un-ring-offset-color);--un-ring-shadow:var(--un-ring-inset) 0 0 0 calc(var(--un-ring-width) + var(--un-ring-offset-width)) var(--un-ring-color);box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow);--un-ring-opacity:1;--un-ring-color:rgb(var(--color-primary) / var(--un-ring-opacity)) ;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s;transition-duration:.1s}._secondaryActionButton_15i6c_67[disabled]{cursor:not-allowed;--un-bg-opacity:1;background-color:rgb(var(--color-gray-200-rgb-value) / var(--un-bg-opacity));--un-text-opacity:1;color:rgb(var(--color-gray-500-rgb-value) / var(--un-text-opacity));--un-ring-width:0px;--un-ring-offset-shadow:var(--un-ring-inset) 0 0 0 var(--un-ring-offset-width) var(--un-ring-offset-color);--un-ring-shadow:var(--un-ring-inset) 0 0 0 calc(var(--un-ring-width) + var(--un-ring-offset-width)) var(--un-ring-color);box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}._secondaryActionButton_15i6c_67[disabled]:hover{--un-bg-opacity:1;background-color:rgb(var(--color-gray-200-rgb-value) / var(--un-bg-opacity));--un-text-opacity:1;color:rgb(var(--color-gray-500-rgb-value) / var(--un-text-opacity))}._secondaryActionButton_15i6c_67:hover{--un-bg-opacity:1;background-color:rgb(var(--color-accent-25-rgb-value) / var(--un-bg-opacity));--un-text-opacity:1;color:rgb(var(--color-accent-700-rgb-value) / var(--un-text-opacity));--un-ring-opacity:1;--un-ring-color:rgb(var(--color-accent-700-rgb-value) / var(--un-ring-opacity)) }._secondaryActionButton_15i6c_67:active{--un-bg-opacity:1;background-color:rgb(var(--color-accent-50-rgb-value) / var(--un-bg-opacity));--un-text-opacity:1;color:rgb(var(--color-accent-800-rgb-value) / var(--un-text-opacity));--un-ring-opacity:1;--un-ring-color:rgb(var(--color-accent-800-rgb-value) / var(--un-ring-opacity)) }._secondaryActionButton_15i6c_67:focus-visible{outline-width:2px;--un-outline-color-opacity:1;outline-color:rgb(var(--color-primary) / var(--un-outline-color-opacity));outline-offset:4px;outline-style:solid}._actions_15i6c_71{display:flex;gap:calc(var(--mb-size)*1rem)}._actions_15i6c_71 ._primaryActionButton_15i6c_63,._actions_15i6c_71 ._secondaryActionButton_15i6c_67{width:50%}._alertTitle_15i6c_79{font-size:calc(var(--mb-size)*1.125rem);line-height:calc(var(--mb-size)*1.75rem);--un-text-opacity:1;color:rgb(var(--color-gray-700-rgb-value) / var(--un-text-opacity));font-weight:400}._alertText_15i6c_83{margin-top:calc(var(--mb-size)*1rem);margin-bottom:calc(var(--mb-size)*2rem);padding-left:calc(var(--mb-size)*.5rem);padding-right:calc(var(--mb-size)*.5rem);text-align:center;text-wrap:pretty;--un-text-opacity:1;color:rgb(var(--color-gray-500-rgb-value) / var(--un-text-opacity));font-weight:300;line-height:1.5}*,:before,:after{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }::backdrop{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }.btn-focus:focus-visible{outline-width:2px;--un-outline-color-opacity:1;outline-color:rgb(var(--color-primary) / var(--un-outline-color-opacity));outline-offset:4px;outline-style:solid}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.left-0{left:calc(var(--mb-size)*0rem)}.right-4{right:calc(var(--mb-size)*1rem)}.top-0{top:calc(var(--mb-size)*0rem)}.has-\\[\\[data-scope\\]\\]\\:z-2:has([data-scope]),.z-2{z-index:2}.z-1{z-index:1}.grid{display:grid}.auto-cols-auto{grid-auto-columns:auto}.grid-cols-\\[1fr_auto_1fr\\]{grid-template-columns:1fr auto 1fr}.block{display:block}.size-12{width:calc(var(--mb-size)*3rem);height:calc(var(--mb-size)*3rem)}.size-6{width:calc(var(--mb-size)*1.5rem);height:calc(var(--mb-size)*1.5rem)}.size-full{width:100%;height:100%}.h-full{height:100%}.h-vh{height:100vh}.max-w-\\[100\\%\\]{max-width:100%}.min-h-\\[300px\\]{min-height:300px}.min-w-0{min-width:calc(var(--mb-size)*0rem)}.w-full{width:100%}.flex{display:flex}.shrink-0{flex-shrink:0}.flex-col{flex-direction:column}.flex-nowrap{flex-wrap:nowrap}.data-\\[state\\=open\\]\\:scale-y-\\[-1\\][data-state=open]{--un-scale-y:-1;transform:translate(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotate(var(--un-rotate-z)) skew(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z))}.transform{transform:translate(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotate(var(--un-rotate-z)) skew(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z))}.cursor-pointer{cursor:pointer}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.select-none{-webkit-user-select:none;user-select:none}.resize{resize:both}.appearance-none{-webkit-appearance:none;appearance:none}.place-items-center{place-items:center}.items-center{align-items:center}.justify-between{justify-content:space-between}.justify-self-start{justify-self:start}.justify-self-end{justify-self:end}.justify-self-center{justify-self:center}.gap-\\[1px\\]{gap:1px}.gap-2{gap:calc(var(--mb-size)*.5rem)}.gap-4{gap:calc(var(--mb-size)*1rem)}.overflow-hidden{overflow:hidden}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.border-2{border-width:2px}.border-transparent{border-color:transparent}.data-\\[highlighted\\]\\:border-primary[data-highlighted]{--un-border-opacity:1;border-color:rgb(var(--color-primary) / var(--un-border-opacity))}.rounded-4{border-radius:calc(var(--mb-size)*1rem)}.rounded-full{border-radius:9999px}.rounded-md{border-radius:.375rem}.rounded-b-6{border-bottom-left-radius:calc(var(--mb-size)*1.5rem);border-bottom-right-radius:calc(var(--mb-size)*1.5rem)}.rounded-t-6{border-top-left-radius:calc(var(--mb-size)*1.5rem);border-top-right-radius:calc(var(--mb-size)*1.5rem)}.border-none{border-style:none}.border-solid{border-style:solid}.bg-dark-500{--un-bg-opacity:1;background-color:rgb(31 31 31 / var(--un-bg-opacity))}.bg-gray-550\\/50{background-color:rgb(var(--color-gray-550-rgb-value) / .5)}.bg-gray-550\\/70{background-color:rgb(var(--color-gray-550-rgb-value) / .7)}.bg-gray-550\\/90{background-color:rgb(var(--color-gray-550-rgb-value) / .9)}.p-2{padding:calc(var(--mb-size)*.5rem)}.px-4{padding-left:calc(var(--mb-size)*1rem);padding-right:calc(var(--mb-size)*1rem)}.py-2{padding-top:calc(var(--mb-size)*.5rem);padding-bottom:calc(var(--mb-size)*.5rem)}.py-3{padding-top:calc(var(--mb-size)*.75rem);padding-bottom:calc(var(--mb-size)*.75rem)}.py-4{padding-top:calc(var(--mb-size)*1rem);padding-bottom:calc(var(--mb-size)*1rem)}.pl-4{padding-left:calc(var(--mb-size)*1rem)}.pr-12{padding-right:calc(var(--mb-size)*3rem)}.text-align-center{text-align:center}.text-base{font-size:calc(var(--mb-size)*1rem);line-height:calc(var(--mb-size)*1.5rem)}.text-sm{font-size:calc(var(--mb-size)*.875rem);line-height:calc(var(--mb-size)*1.25rem)}.color-white{--un-text-opacity:1;color:rgb(var(--color-white-rgb-value) / var(--un-text-opacity))}.font-500{font-weight:500}.disabled\\:opacity-50:disabled{opacity:.5}.shadow{--un-shadow:var(--un-shadow-inset) 0 1px 3px 0 var(--un-shadow-color, rgb(0 0 0 / .1)),var(--un-shadow-inset) 0 1px 2px -1px var(--un-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.backdrop-blur{--un-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--un-backdrop-blur) var(--un-backdrop-brightness) var(--un-backdrop-contrast) var(--un-backdrop-grayscale) var(--un-backdrop-hue-rotate) var(--un-backdrop-invert) var(--un-backdrop-opacity) var(--un-backdrop-saturate) var(--un-backdrop-sepia);backdrop-filter:var(--un-backdrop-blur) var(--un-backdrop-brightness) var(--un-backdrop-contrast) var(--un-backdrop-grayscale) var(--un-backdrop-hue-rotate) var(--un-backdrop-invert) var(--un-backdrop-opacity) var(--un-backdrop-saturate) var(--un-backdrop-sepia)}.backdrop-blur-xl{--un-backdrop-blur:blur(24px);-webkit-backdrop-filter:var(--un-backdrop-blur) var(--un-backdrop-brightness) var(--un-backdrop-contrast) var(--un-backdrop-grayscale) var(--un-backdrop-hue-rotate) var(--un-backdrop-invert) var(--un-backdrop-opacity) var(--un-backdrop-saturate) var(--un-backdrop-sepia);backdrop-filter:var(--un-backdrop-blur) var(--un-backdrop-brightness) var(--un-backdrop-contrast) var(--un-backdrop-grayscale) var(--un-backdrop-hue-rotate) var(--un-backdrop-invert) var(--un-backdrop-opacity) var(--un-backdrop-saturate) var(--un-backdrop-sepia)}.drop-shadow-md{--un-drop-shadow:drop-shadow(0 4px 3px var(--un-drop-shadow-color, rgb(0 0 0 / .07))) drop-shadow(0 2px 2px var(--un-drop-shadow-color, rgb(0 0 0 / .06)));filter:var(--un-blur) var(--un-brightness) var(--un-contrast) var(--un-drop-shadow) var(--un-grayscale) var(--un-hue-rotate) var(--un-invert) var(--un-saturate) var(--un-sepia)}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.lerp\\:px-3\\@xs\\,8\\@lg{padding-inline:clamp(calc(var(--mb-size)*.75rem),calc(var(--mb-size)*.75rem) + (100vw - 380px) * .031055900621118012,calc(var(--mb-size)*2rem))}@supports (height:100dvh){.supports-\\[\\(height\\:100dvh\\)\\]\\:h-dvh{height:100dvh}}")})();
|
|
2
|
+
import { subscribeWithSelector as ue } from "zustand/middleware";
|
|
3
|
+
import { shallow as ge } from "zustand/shallow";
|
|
4
|
+
import { createStore as de } from "zustand/vanilla";
|
|
5
|
+
import { createComponent as c, use as V, template as y, spread as $, mergeProps as J, insert as w, memo as Se, isServer as He, delegateEvents as We, effect as K, className as H, Portal as ye, Dynamic as Ge, render as Xe } from "solid-js/web";
|
|
6
|
+
import { createContext as Ce, onCleanup as he, useContext as Ee, onMount as Z, createSignal as N, Show as k, Index as Qe, createRoot as Ke, getOwner as ke, splitProps as Ye, createEffect as Je } from "solid-js";
|
|
7
|
+
import { createWithSignal as Te } from "solid-zustand";
|
|
8
|
+
import { createStore as Ze } from "solid-js/store";
|
|
9
|
+
import { EnvironmentProvider as et } from "@ark-ui/solid/environment";
|
|
10
|
+
import { Dialog as I } from "@ark-ui/solid/dialog";
|
|
11
|
+
import { Select as A, createListCollection as tt } from "@ark-ui/solid/select";
|
|
11
12
|
import { Tooltip as Q } from "@ark-ui/solid/tooltip";
|
|
12
|
-
typeof HTMLVideoElement < "u" && !("requestVideoFrameCallback" in HTMLVideoElement.prototype) && "getVideoPlaybackQuality" in HTMLVideoElement.prototype && (HTMLVideoElement.prototype._rvfcpolyfillmap = {}, HTMLVideoElement.prototype.requestVideoFrameCallback = function(
|
|
13
|
-
const e = performance.now(),
|
|
14
|
-
const
|
|
15
|
-
if (
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
presentationTime: i +
|
|
19
|
-
expectedDisplayTime: i +
|
|
13
|
+
typeof HTMLVideoElement < "u" && !("requestVideoFrameCallback" in HTMLVideoElement.prototype) && "getVideoPlaybackQuality" in HTMLVideoElement.prototype && (HTMLVideoElement.prototype._rvfcpolyfillmap = {}, HTMLVideoElement.prototype.requestVideoFrameCallback = function(r) {
|
|
14
|
+
const e = performance.now(), t = this.getVideoPlaybackQuality(), a = this.mozPresentedFrames || this.mozPaintedFrames || t.totalVideoFrames - t.droppedVideoFrames, n = (o, i) => {
|
|
15
|
+
const s = this.getVideoPlaybackQuality(), l = this.mozPresentedFrames || this.mozPaintedFrames || s.totalVideoFrames - s.droppedVideoFrames;
|
|
16
|
+
if (l > a) {
|
|
17
|
+
const f = this.mozFrameDelay || s.totalFrameDelay - t.totalFrameDelay || 0, g = i - o;
|
|
18
|
+
r(i, {
|
|
19
|
+
presentationTime: i + f * 1e3,
|
|
20
|
+
expectedDisplayTime: i + g,
|
|
20
21
|
width: this.videoWidth,
|
|
21
22
|
height: this.videoHeight,
|
|
22
|
-
mediaTime: Math.max(0, this.currentTime || 0) +
|
|
23
|
-
presentedFrames:
|
|
24
|
-
processingDuration:
|
|
23
|
+
mediaTime: Math.max(0, this.currentTime || 0) + g / 1e3,
|
|
24
|
+
presentedFrames: l,
|
|
25
|
+
processingDuration: f
|
|
25
26
|
}), delete this._rvfcpolyfillmap[e];
|
|
26
27
|
} else
|
|
27
|
-
this._rvfcpolyfillmap[e] = requestAnimationFrame((
|
|
28
|
+
this._rvfcpolyfillmap[e] = requestAnimationFrame((f) => n(i, f));
|
|
28
29
|
};
|
|
29
30
|
return this._rvfcpolyfillmap[e] = requestAnimationFrame((o) => n(e, o)), e;
|
|
30
|
-
}, HTMLVideoElement.prototype.cancelVideoFrameCallback = function(
|
|
31
|
-
cancelAnimationFrame(this._rvfcpolyfillmap[
|
|
31
|
+
}, HTMLVideoElement.prototype.cancelVideoFrameCallback = function(r) {
|
|
32
|
+
cancelAnimationFrame(this._rvfcpolyfillmap[r]), delete this._rvfcpolyfillmap[r];
|
|
32
33
|
});
|
|
33
|
-
|
|
34
|
+
class U extends Error {
|
|
35
|
+
code;
|
|
36
|
+
/**
|
|
37
|
+
* Creates a new camera error.
|
|
38
|
+
*
|
|
39
|
+
* @param message - The error message.
|
|
40
|
+
* @param code - The error code.
|
|
41
|
+
* @param cause - The cause of the error.
|
|
42
|
+
*/
|
|
43
|
+
constructor(e, t, a) {
|
|
44
|
+
super(e), this.code = t, this.cause = a;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
const rt = [
|
|
34
48
|
// English
|
|
35
49
|
"back",
|
|
36
50
|
"rear",
|
|
@@ -101,7 +115,7 @@ const Ze = [
|
|
|
101
115
|
"बैक",
|
|
102
116
|
// Latin American Spanish
|
|
103
117
|
"posterior"
|
|
104
|
-
],
|
|
118
|
+
], at = [
|
|
105
119
|
// English
|
|
106
120
|
"front",
|
|
107
121
|
// German
|
|
@@ -168,38 +182,38 @@ const Ze = [
|
|
|
168
182
|
"फ्रंट",
|
|
169
183
|
// Latin American Spanish
|
|
170
184
|
"frontal"
|
|
171
|
-
],
|
|
172
|
-
var
|
|
173
|
-
function
|
|
174
|
-
for (var a = 0; a <
|
|
175
|
-
var n =
|
|
185
|
+
], _e = (r, e) => e.some((t) => r.toLowerCase().includes(t)), Me = (r) => _e(r, rt), xe = (r) => _e(r, at);
|
|
186
|
+
var nt = /* @__PURE__ */ function() {
|
|
187
|
+
function r(e, t) {
|
|
188
|
+
for (var a = 0; a < t.length; a++) {
|
|
189
|
+
var n = t[a];
|
|
176
190
|
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, n.key, n);
|
|
177
191
|
}
|
|
178
192
|
}
|
|
179
|
-
return function(e,
|
|
180
|
-
return
|
|
193
|
+
return function(e, t, a) {
|
|
194
|
+
return t && r(e.prototype, t), a && r(e, a), e;
|
|
181
195
|
};
|
|
182
|
-
}(),
|
|
183
|
-
function
|
|
184
|
-
return Object.freeze(Object.defineProperties(
|
|
196
|
+
}(), ot = it(["", ""], ["", ""]);
|
|
197
|
+
function it(r, e) {
|
|
198
|
+
return Object.freeze(Object.defineProperties(r, { raw: { value: Object.freeze(e) } }));
|
|
185
199
|
}
|
|
186
|
-
function
|
|
187
|
-
if (!(
|
|
200
|
+
function st(r, e) {
|
|
201
|
+
if (!(r instanceof e))
|
|
188
202
|
throw new TypeError("Cannot call a class as a function");
|
|
189
203
|
}
|
|
190
|
-
var
|
|
191
|
-
function
|
|
192
|
-
for (var e = this,
|
|
204
|
+
var _ = function() {
|
|
205
|
+
function r() {
|
|
206
|
+
for (var e = this, t = arguments.length, a = Array(t), n = 0; n < t; n++)
|
|
193
207
|
a[n] = arguments[n];
|
|
194
|
-
return
|
|
195
|
-
for (var i = arguments.length,
|
|
196
|
-
l
|
|
197
|
-
return typeof o == "function" ? e.interimTag.bind(e, o) : typeof o == "string" ? e.transformEndResult(o) : (o = o.map(e.transformString.bind(e)), e.transformEndResult(o.reduce(e.processSubstitutions.bind(e,
|
|
208
|
+
return st(this, r), this.tag = function(o) {
|
|
209
|
+
for (var i = arguments.length, s = Array(i > 1 ? i - 1 : 0), l = 1; l < i; l++)
|
|
210
|
+
s[l - 1] = arguments[l];
|
|
211
|
+
return typeof o == "function" ? e.interimTag.bind(e, o) : typeof o == "string" ? e.transformEndResult(o) : (o = o.map(e.transformString.bind(e)), e.transformEndResult(o.reduce(e.processSubstitutions.bind(e, s))));
|
|
198
212
|
}, a.length > 0 && Array.isArray(a[0]) && (a = a[0]), this.transformers = a.map(function(o) {
|
|
199
213
|
return typeof o == "function" ? o() : o;
|
|
200
214
|
}), this.tag;
|
|
201
215
|
}
|
|
202
|
-
return
|
|
216
|
+
return nt(r, [{
|
|
203
217
|
key: "interimTag",
|
|
204
218
|
/**
|
|
205
219
|
* An intermediary template tag that receives a template tag and passes the result of calling the template with the received
|
|
@@ -209,10 +223,10 @@ var T = function() {
|
|
|
209
223
|
* @param {...*} ...substitutions - `substitutions` is an array of all substitutions in the template
|
|
210
224
|
* @return {*} - the final processed value
|
|
211
225
|
*/
|
|
212
|
-
value: function(
|
|
226
|
+
value: function(t, a) {
|
|
213
227
|
for (var n = arguments.length, o = Array(n > 2 ? n - 2 : 0), i = 2; i < n; i++)
|
|
214
228
|
o[i - 2] = arguments[i];
|
|
215
|
-
return this.tag(
|
|
229
|
+
return this.tag(ot, t.apply(void 0, [a].concat(o)));
|
|
216
230
|
}
|
|
217
231
|
/**
|
|
218
232
|
* Performs bulk processing on the tagged template, transforming each substitution and then
|
|
@@ -224,8 +238,8 @@ var T = function() {
|
|
|
224
238
|
*/
|
|
225
239
|
}, {
|
|
226
240
|
key: "processSubstitutions",
|
|
227
|
-
value: function(
|
|
228
|
-
var o = this.transformSubstitution(
|
|
241
|
+
value: function(t, a, n) {
|
|
242
|
+
var o = this.transformSubstitution(t.shift(), a);
|
|
229
243
|
return "".concat(a, o, n);
|
|
230
244
|
}
|
|
231
245
|
/**
|
|
@@ -236,11 +250,11 @@ var T = function() {
|
|
|
236
250
|
*/
|
|
237
251
|
}, {
|
|
238
252
|
key: "transformString",
|
|
239
|
-
value: function(
|
|
253
|
+
value: function(t) {
|
|
240
254
|
var a = function(o, i) {
|
|
241
255
|
return i.onString ? i.onString(o) : o;
|
|
242
256
|
};
|
|
243
|
-
return this.transformers.reduce(a,
|
|
257
|
+
return this.transformers.reduce(a, t);
|
|
244
258
|
}
|
|
245
259
|
/**
|
|
246
260
|
* When a substitution is encountered, iterates through each transformer and applies the transformer's
|
|
@@ -251,11 +265,11 @@ var T = function() {
|
|
|
251
265
|
*/
|
|
252
266
|
}, {
|
|
253
267
|
key: "transformSubstitution",
|
|
254
|
-
value: function(
|
|
255
|
-
var n = function(i,
|
|
256
|
-
return
|
|
268
|
+
value: function(t, a) {
|
|
269
|
+
var n = function(i, s) {
|
|
270
|
+
return s.onSubstitution ? s.onSubstitution(i, a) : i;
|
|
257
271
|
};
|
|
258
|
-
return this.transformers.reduce(n,
|
|
272
|
+
return this.transformers.reduce(n, t);
|
|
259
273
|
}
|
|
260
274
|
/**
|
|
261
275
|
* Iterates through each transformer, applying the transformer's `onEndResult` method to the
|
|
@@ -265,13 +279,13 @@ var T = function() {
|
|
|
265
279
|
*/
|
|
266
280
|
}, {
|
|
267
281
|
key: "transformEndResult",
|
|
268
|
-
value: function(
|
|
282
|
+
value: function(t) {
|
|
269
283
|
var a = function(o, i) {
|
|
270
284
|
return i.onEndResult ? i.onEndResult(o) : o;
|
|
271
285
|
};
|
|
272
|
-
return this.transformers.reduce(a,
|
|
286
|
+
return this.transformers.reduce(a, t);
|
|
273
287
|
}
|
|
274
|
-
}]),
|
|
288
|
+
}]), r;
|
|
275
289
|
}(), M = function() {
|
|
276
290
|
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
|
|
277
291
|
return {
|
|
@@ -286,21 +300,21 @@ var T = function() {
|
|
|
286
300
|
}
|
|
287
301
|
};
|
|
288
302
|
};
|
|
289
|
-
function
|
|
290
|
-
if (Array.isArray(
|
|
291
|
-
for (var e = 0,
|
|
292
|
-
|
|
293
|
-
return
|
|
303
|
+
function lt(r) {
|
|
304
|
+
if (Array.isArray(r)) {
|
|
305
|
+
for (var e = 0, t = Array(r.length); e < r.length; e++)
|
|
306
|
+
t[e] = r[e];
|
|
307
|
+
return t;
|
|
294
308
|
} else
|
|
295
|
-
return Array.from(
|
|
309
|
+
return Array.from(r);
|
|
296
310
|
}
|
|
297
311
|
var L = function() {
|
|
298
312
|
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "initial";
|
|
299
313
|
return {
|
|
300
314
|
onEndResult: function(a) {
|
|
301
315
|
if (e === "initial") {
|
|
302
|
-
var n = a.match(/^[^\S\n]*(?=\S)/gm), o = n && Math.min.apply(Math,
|
|
303
|
-
return
|
|
316
|
+
var n = a.match(/^[^\S\n]*(?=\S)/gm), o = n && Math.min.apply(Math, lt(n.map(function(s) {
|
|
317
|
+
return s.length;
|
|
304
318
|
})));
|
|
305
319
|
if (o) {
|
|
306
320
|
var i = new RegExp("^.{" + o + "}", "gm");
|
|
@@ -313,72 +327,72 @@ var L = function() {
|
|
|
313
327
|
throw new Error("Unknown type: " + e);
|
|
314
328
|
}
|
|
315
329
|
};
|
|
316
|
-
}, q = function(e,
|
|
330
|
+
}, q = function(e, t) {
|
|
317
331
|
return {
|
|
318
332
|
onEndResult: function(n) {
|
|
319
|
-
if (e == null ||
|
|
333
|
+
if (e == null || t == null)
|
|
320
334
|
throw new Error("replaceResultTransformer requires at least 2 arguments.");
|
|
321
|
-
return n.replace(e,
|
|
335
|
+
return n.replace(e, t);
|
|
322
336
|
}
|
|
323
337
|
};
|
|
324
|
-
},
|
|
338
|
+
}, O = function(e, t) {
|
|
325
339
|
return {
|
|
326
340
|
onSubstitution: function(n, o) {
|
|
327
|
-
if (e == null ||
|
|
341
|
+
if (e == null || t == null)
|
|
328
342
|
throw new Error("replaceSubstitutionTransformer requires at least 2 arguments.");
|
|
329
|
-
return n == null ? n : n.toString().replace(e,
|
|
343
|
+
return n == null ? n : n.toString().replace(e, t);
|
|
330
344
|
}
|
|
331
345
|
};
|
|
332
|
-
},
|
|
346
|
+
}, ct = {
|
|
333
347
|
separator: "",
|
|
334
348
|
conjunction: "",
|
|
335
349
|
serial: !1
|
|
336
350
|
}, D = function() {
|
|
337
|
-
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] :
|
|
351
|
+
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : ct;
|
|
338
352
|
return {
|
|
339
353
|
onSubstitution: function(a, n) {
|
|
340
354
|
if (Array.isArray(a)) {
|
|
341
|
-
var o = a.length, i = e.separator,
|
|
342
|
-
if (
|
|
343
|
-
var
|
|
344
|
-
a = a.slice(0,
|
|
355
|
+
var o = a.length, i = e.separator, s = e.conjunction, l = e.serial, f = n.match(/(\n?[^\S\n]+)$/);
|
|
356
|
+
if (f ? a = a.join(i + f[1]) : a = a.join(i + " "), s && o > 1) {
|
|
357
|
+
var g = a.lastIndexOf(i);
|
|
358
|
+
a = a.slice(0, g) + (l ? i : "") + " " + s + a.slice(g + 1);
|
|
345
359
|
}
|
|
346
360
|
}
|
|
347
361
|
return a;
|
|
348
362
|
}
|
|
349
363
|
};
|
|
350
|
-
},
|
|
364
|
+
}, Re = function(e) {
|
|
351
365
|
return {
|
|
352
366
|
onSubstitution: function(a, n) {
|
|
353
367
|
return typeof a == "string" && a.includes(e) && (a = a.split(e)), a;
|
|
354
368
|
}
|
|
355
369
|
};
|
|
356
|
-
},
|
|
370
|
+
}, fe = function(e) {
|
|
357
371
|
return e != null && !Number.isNaN(e) && typeof e != "boolean";
|
|
358
|
-
},
|
|
372
|
+
}, ut = function() {
|
|
359
373
|
return {
|
|
360
|
-
onSubstitution: function(
|
|
361
|
-
return Array.isArray(
|
|
374
|
+
onSubstitution: function(t) {
|
|
375
|
+
return Array.isArray(t) ? t.filter(fe) : fe(t) ? t : "";
|
|
362
376
|
}
|
|
363
377
|
};
|
|
364
378
|
};
|
|
365
|
-
new
|
|
366
|
-
new
|
|
367
|
-
new
|
|
368
|
-
new
|
|
369
|
-
`),
|
|
370
|
-
new
|
|
371
|
-
`), D, L, M,
|
|
372
|
-
new
|
|
373
|
-
new
|
|
374
|
-
new
|
|
375
|
-
new
|
|
376
|
-
new
|
|
377
|
-
new
|
|
378
|
-
new
|
|
379
|
-
new
|
|
380
|
-
var
|
|
381
|
-
const
|
|
379
|
+
new _(D({ separator: "," }), L, M);
|
|
380
|
+
new _(D({ separator: ",", conjunction: "and" }), L, M);
|
|
381
|
+
new _(D({ separator: ",", conjunction: "or" }), L, M);
|
|
382
|
+
new _(Re(`
|
|
383
|
+
`), ut, D, L, M);
|
|
384
|
+
new _(Re(`
|
|
385
|
+
`), D, L, M, O(/&/g, "&"), O(/</g, "<"), O(/>/g, ">"), O(/"/g, """), O(/'/g, "'"), O(/`/g, "`"));
|
|
386
|
+
new _(q(/(?:\n(?:\s*))+/g, " "), M);
|
|
387
|
+
new _(q(/(?:\n\s*)/g, ""), M);
|
|
388
|
+
new _(D({ separator: "," }), q(/(?:\s+)/g, " "), M);
|
|
389
|
+
new _(D({ separator: ",", conjunction: "or" }), q(/(?:\s+)/g, " "), M);
|
|
390
|
+
new _(D({ separator: ",", conjunction: "and" }), q(/(?:\s+)/g, " "), M);
|
|
391
|
+
new _(D, L, M);
|
|
392
|
+
new _(D, q(/(?:\s+)/g, " "), M);
|
|
393
|
+
new _(L, M);
|
|
394
|
+
var Ae = new _(L("all"), M);
|
|
395
|
+
const dt = [
|
|
382
396
|
"Cameră dublă cu obiectiv superangular spate",
|
|
383
397
|
"מצלמה כפולה רחבה אחורית",
|
|
384
398
|
"Артқы қос кең бұрышты камера",
|
|
@@ -416,160 +430,143 @@ const lt = [
|
|
|
416
430
|
"Cámara trasera dual con gran angular",
|
|
417
431
|
"背面デュアル広角カメラ",
|
|
418
432
|
"Stražnja dvostruka široka kamera"
|
|
419
|
-
],
|
|
420
|
-
if (
|
|
433
|
+
], Y = (r) => {
|
|
434
|
+
if (r instanceof Error) return r;
|
|
421
435
|
try {
|
|
422
|
-
return new Error(JSON.stringify(
|
|
436
|
+
return new Error(JSON.stringify(r));
|
|
423
437
|
} catch {
|
|
424
|
-
return new Error(String(
|
|
438
|
+
return new Error(String(r));
|
|
425
439
|
}
|
|
426
440
|
};
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
* Creates a new camera error.
|
|
431
|
-
*
|
|
432
|
-
* @param message - The error message.
|
|
433
|
-
* @param code - The error code.
|
|
434
|
-
* @param cause - The cause of the error.
|
|
435
|
-
*/
|
|
436
|
-
constructor(e, r, a) {
|
|
437
|
-
super(e), this.code = r, this.cause = a;
|
|
438
|
-
}
|
|
441
|
+
function ht() {
|
|
442
|
+
const r = self.navigator.userAgent.toLowerCase();
|
|
443
|
+
return /iphone|ipad|ipod/.test(r);
|
|
439
444
|
}
|
|
440
|
-
const
|
|
445
|
+
const Ie = async () => {
|
|
441
446
|
try {
|
|
442
|
-
const
|
|
447
|
+
const r = await navigator.mediaDevices.getUserMedia({
|
|
443
448
|
video: !0
|
|
444
449
|
});
|
|
445
|
-
|
|
446
|
-
} catch (
|
|
447
|
-
throw
|
|
450
|
+
$e(r);
|
|
451
|
+
} catch (r) {
|
|
452
|
+
throw new U(
|
|
448
453
|
"Camera permission not given",
|
|
449
454
|
"PERMISSION_DENIED",
|
|
450
|
-
|
|
455
|
+
Y(r)
|
|
451
456
|
);
|
|
452
457
|
}
|
|
453
|
-
},
|
|
458
|
+
}, mt = async () => {
|
|
454
459
|
if (!isSecureContext)
|
|
455
|
-
throw new Error(
|
|
460
|
+
throw new Error(Ae`
|
|
456
461
|
Cameras can only be used in a secure context:
|
|
457
462
|
https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts
|
|
458
463
|
`);
|
|
459
|
-
return await
|
|
460
|
-
},
|
|
461
|
-
const e =
|
|
462
|
-
for (const
|
|
463
|
-
|
|
464
|
-
},
|
|
464
|
+
return await Ie(), (await navigator.mediaDevices.enumerateDevices()).filter((t) => t.kind === "videoinput");
|
|
465
|
+
}, $e = (r) => {
|
|
466
|
+
const e = r.getTracks();
|
|
467
|
+
for (const t of e)
|
|
468
|
+
t.stop();
|
|
469
|
+
}, gt = (r, e, t) => ({
|
|
465
470
|
video: {
|
|
466
|
-
deviceId:
|
|
471
|
+
deviceId: t ? { exact: t } : void 0,
|
|
467
472
|
frameRate: 30,
|
|
468
473
|
aspectRatio: {
|
|
469
|
-
exact:
|
|
474
|
+
exact: P[r].width / P[r].height
|
|
470
475
|
},
|
|
471
476
|
width: {
|
|
472
|
-
ideal:
|
|
477
|
+
ideal: P[r].width
|
|
473
478
|
},
|
|
474
479
|
height: {
|
|
475
|
-
ideal:
|
|
480
|
+
ideal: P[r].height
|
|
476
481
|
},
|
|
477
482
|
facingMode: e
|
|
478
483
|
},
|
|
479
484
|
audio: !1
|
|
480
485
|
});
|
|
481
|
-
function
|
|
486
|
+
function ft(r) {
|
|
482
487
|
let e = 0;
|
|
483
|
-
return
|
|
488
|
+
return r.torchSupported && (e += 1), r.singleShotSupported && (e += 1), e;
|
|
484
489
|
}
|
|
485
|
-
function
|
|
486
|
-
return
|
|
490
|
+
function bt(r, e) {
|
|
491
|
+
return r.filter((t) => e === "back" ? Me(t.name) : e === "front" ? xe(t.name) : !0);
|
|
487
492
|
}
|
|
488
|
-
const
|
|
489
|
-
if (
|
|
490
|
-
throw new Error("No cameras found");
|
|
491
|
-
if (
|
|
492
|
-
return await
|
|
493
|
-
let a =
|
|
493
|
+
const pt = async (r, e, t) => {
|
|
494
|
+
if (r.length === 0)
|
|
495
|
+
throw new Error("No cameras found on device");
|
|
496
|
+
if (r.length === 1)
|
|
497
|
+
return await r[0].startStream(e), r[0];
|
|
498
|
+
let a = bt(r, t);
|
|
494
499
|
if (a.length === 1)
|
|
495
500
|
return await a[0].startStream(e), a[0];
|
|
496
|
-
if (a.length === 0 && (console.debug("No camera found with requested facing, using all cameras"), a =
|
|
497
|
-
const
|
|
498
|
-
(
|
|
501
|
+
if (a.length === 0 && (console.debug("No camera found with requested facing, using all cameras"), a = r), t === "back") {
|
|
502
|
+
const s = a.find(
|
|
503
|
+
(l) => dt.includes(l.name)
|
|
499
504
|
);
|
|
500
|
-
if (
|
|
501
|
-
return await
|
|
505
|
+
if (s)
|
|
506
|
+
return await s.startStream(e), s;
|
|
502
507
|
}
|
|
503
|
-
if (
|
|
504
|
-
const
|
|
505
|
-
return await
|
|
508
|
+
if (t === "front") {
|
|
509
|
+
const s = a[a.length - 1];
|
|
510
|
+
return await s.startStream(e), s;
|
|
506
511
|
}
|
|
507
512
|
const n = /* @__PURE__ */ new Map();
|
|
508
513
|
let o, i = -1 / 0;
|
|
509
|
-
|
|
510
|
-
|
|
514
|
+
ht() || a.reverse();
|
|
515
|
+
for (const s of a)
|
|
511
516
|
try {
|
|
512
|
-
await
|
|
513
|
-
const
|
|
514
|
-
if (n.set(
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
517
|
+
await s.startStream(e);
|
|
518
|
+
const l = ft(s);
|
|
519
|
+
if (n.set(s, l), l > i)
|
|
520
|
+
i = l, o = s;
|
|
521
|
+
else {
|
|
522
|
+
s.stopStream();
|
|
523
|
+
continue;
|
|
524
|
+
}
|
|
525
|
+
if (l === 2)
|
|
526
|
+
return s;
|
|
527
|
+
s.stopStream();
|
|
528
|
+
} catch (l) {
|
|
529
|
+
console.warn(`Failed to test camera ${s.name}:`, l), s.stopStream();
|
|
518
530
|
}
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
const l = a[0];
|
|
523
|
-
return await l.startStream(e), l;
|
|
531
|
+
if (!o)
|
|
532
|
+
throw new Error("No suitable camera found, should not happen!");
|
|
533
|
+
return o;
|
|
524
534
|
};
|
|
525
|
-
function
|
|
535
|
+
function vt(r) {
|
|
526
536
|
const e = [];
|
|
527
|
-
for (const
|
|
528
|
-
const a = new
|
|
537
|
+
for (const t of r) {
|
|
538
|
+
const a = new De(t);
|
|
529
539
|
a !== null && e.push(a);
|
|
530
540
|
}
|
|
531
541
|
return e;
|
|
532
542
|
}
|
|
533
|
-
const
|
|
534
|
-
|
|
535
|
-
"
|
|
536
|
-
|
|
543
|
+
const wt = {
|
|
544
|
+
deviceInfo: {},
|
|
545
|
+
name: "",
|
|
546
|
+
facingMode: void 0,
|
|
547
|
+
activeStream: void 0,
|
|
548
|
+
torchSupported: !1,
|
|
549
|
+
torchEnabled: !1,
|
|
550
|
+
singleShotSupported: !1,
|
|
551
|
+
maxSupportedResolution: void 0,
|
|
552
|
+
streamCapabilities: void 0,
|
|
553
|
+
deviceCapabilities: void 0,
|
|
554
|
+
error: void 0
|
|
537
555
|
};
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
height: Math.min(t.width, t.height)
|
|
545
|
-
};
|
|
546
|
-
return Math.abs(e.width / e.height - 16 / 9) > 1e-4 && console.warn(
|
|
547
|
-
`Resolution ${JSON.stringify(
|
|
548
|
-
t
|
|
549
|
-
)} is not 16:9, may cause issues with some video players.`
|
|
550
|
-
), e;
|
|
551
|
-
}
|
|
552
|
-
function vt(t) {
|
|
553
|
-
const e = bt(t);
|
|
554
|
-
return e > 1920 ? "4k" : e > 1280 ? "1080p" : "720p";
|
|
555
|
-
}
|
|
556
|
-
function wt(t) {
|
|
557
|
-
const e = pt(t), r = Object.entries(O).find(
|
|
558
|
-
([n, o]) => o.width === e.width && o.height === e.height
|
|
556
|
+
class De {
|
|
557
|
+
/**
|
|
558
|
+
* The internal state of the camera, implemented as a Zustand store.
|
|
559
|
+
*/
|
|
560
|
+
store = de()(
|
|
561
|
+
ue(() => wt)
|
|
559
562
|
);
|
|
560
|
-
|
|
561
|
-
const n = vt(t);
|
|
562
|
-
return console.warn(
|
|
563
|
-
`No exact resolution match found for ${JSON.stringify(t)}, categorizing as ${n}`
|
|
564
|
-
), n;
|
|
565
|
-
}
|
|
566
|
-
return r[0];
|
|
567
|
-
}
|
|
568
|
-
class Ae {
|
|
563
|
+
#e = /* @__PURE__ */ new Set();
|
|
569
564
|
/**
|
|
570
565
|
* The device info.
|
|
571
566
|
*/
|
|
572
|
-
deviceInfo
|
|
567
|
+
get deviceInfo() {
|
|
568
|
+
return this.store.getState().deviceInfo;
|
|
569
|
+
}
|
|
573
570
|
/**
|
|
574
571
|
* Stream capabilities as reported by the stream.
|
|
575
572
|
*
|
|
@@ -578,30 +575,34 @@ class Ae {
|
|
|
578
575
|
* camera.
|
|
579
576
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack/getCapabilities
|
|
580
577
|
*/
|
|
581
|
-
streamCapabilities
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
578
|
+
get streamCapabilities() {
|
|
579
|
+
return this.store.getState().streamCapabilities;
|
|
580
|
+
}
|
|
581
|
+
get activeStream() {
|
|
582
|
+
return this.store.getState().activeStream?.active === !1 && (console.warn(
|
|
583
|
+
"Detected inactive stream on camera:",
|
|
584
|
+
this.name,
|
|
585
|
+
this.store.getState().activeStream
|
|
586
|
+
), this.store.setState({ activeStream: void 0 })), this.store.getState().activeStream;
|
|
587
|
+
}
|
|
588
|
+
get name() {
|
|
589
|
+
return this.store.getState().name;
|
|
590
|
+
}
|
|
591
|
+
get facingMode() {
|
|
592
|
+
return this.store.getState().facingMode;
|
|
593
|
+
}
|
|
594
|
+
get torchSupported() {
|
|
595
|
+
return this.store.getState().torchSupported;
|
|
596
|
+
}
|
|
597
|
+
get torchEnabled() {
|
|
598
|
+
return this.store.getState().torchEnabled;
|
|
599
|
+
}
|
|
600
|
+
get singleShotSupported() {
|
|
601
|
+
return this.store.getState().singleShotSupported;
|
|
602
|
+
}
|
|
603
|
+
get maxSupportedResolution() {
|
|
604
|
+
return this.store.getState().maxSupportedResolution;
|
|
605
|
+
}
|
|
605
606
|
/**
|
|
606
607
|
* Creates a new Camera instance.
|
|
607
608
|
*
|
|
@@ -610,20 +611,25 @@ class Ae {
|
|
|
610
611
|
constructor(e) {
|
|
611
612
|
if (e.kind !== "videoinput")
|
|
612
613
|
throw new Error("Device is not a video input device");
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
oldValue: c,
|
|
619
|
-
value: i
|
|
620
|
-
};
|
|
621
|
-
return r.notify(d), Reflect.set(n, o, i, l);
|
|
622
|
-
}
|
|
614
|
+
let t;
|
|
615
|
+
xe(e.label) && (t = "front"), Me(e.label) && (t = "back"), this.store.setState({
|
|
616
|
+
deviceInfo: e,
|
|
617
|
+
name: e.label || "Unknown Camera",
|
|
618
|
+
facingMode: t
|
|
623
619
|
});
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
620
|
+
}
|
|
621
|
+
subscribe(e, t, a) {
|
|
622
|
+
let n;
|
|
623
|
+
return t ? n = this.store.subscribe(
|
|
624
|
+
e,
|
|
625
|
+
t,
|
|
626
|
+
a
|
|
627
|
+
) : n = this.store.subscribe(
|
|
628
|
+
e
|
|
629
|
+
), this.#e.add(n), () => (console.debug(`Removing subscription for camera: ${this.name}`), this.#e.delete(n), n());
|
|
630
|
+
}
|
|
631
|
+
unsubscribeAll() {
|
|
632
|
+
this.#e.forEach((e) => e()), this.#e.clear();
|
|
627
633
|
}
|
|
628
634
|
/**
|
|
629
635
|
* Starts a stream with the specified resolution.
|
|
@@ -635,15 +641,18 @@ class Ae {
|
|
|
635
641
|
if (this.activeStream)
|
|
636
642
|
return this.activeStream;
|
|
637
643
|
this.maxSupportedResolution && (e = this.maxSupportedResolution);
|
|
638
|
-
const
|
|
639
|
-
this.populateCapabilities(
|
|
640
|
-
const a =
|
|
641
|
-
return a.onended = (
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
644
|
+
const t = await this.acquireStreamWithFallback(e);
|
|
645
|
+
this.populateCapabilities(t), this.store.setState({ activeStream: t });
|
|
646
|
+
const a = t.getVideoTracks()[0];
|
|
647
|
+
return a.onended = () => {
|
|
648
|
+
const n = new U(
|
|
649
|
+
"Camera stream ended unexpectedly",
|
|
650
|
+
"STREAM_ENDED_UNEXPECTEDLY"
|
|
651
|
+
);
|
|
652
|
+
throw this.store.setState({
|
|
653
|
+
error: n
|
|
654
|
+
}), this.stopStream(), n;
|
|
655
|
+
}, t;
|
|
647
656
|
}
|
|
648
657
|
/**
|
|
649
658
|
* Acquires a camera stream with the specified resolution.
|
|
@@ -654,22 +663,22 @@ class Ae {
|
|
|
654
663
|
*/
|
|
655
664
|
async acquireStreamWithFallback(e) {
|
|
656
665
|
try {
|
|
657
|
-
const
|
|
666
|
+
const t = gt(
|
|
658
667
|
e,
|
|
659
668
|
this.facingMode,
|
|
660
669
|
this.deviceInfo.deviceId
|
|
661
670
|
);
|
|
662
|
-
return await navigator.mediaDevices.getUserMedia(
|
|
663
|
-
} catch (
|
|
671
|
+
return await navigator.mediaDevices.getUserMedia(t);
|
|
672
|
+
} catch (t) {
|
|
664
673
|
console.warn(
|
|
665
674
|
`Can't get camera stream for ${this.name} at ${e}`,
|
|
666
|
-
|
|
675
|
+
t
|
|
667
676
|
);
|
|
668
|
-
|
|
677
|
+
const a = Object.keys(P).indexOf(e);
|
|
669
678
|
if (a === 0)
|
|
670
679
|
throw new Error("Failed to get camera stream");
|
|
671
|
-
const n = Object.keys(
|
|
672
|
-
return
|
|
680
|
+
const n = Object.keys(P)[a - 1];
|
|
681
|
+
return this.acquireStreamWithFallback(n);
|
|
673
682
|
}
|
|
674
683
|
}
|
|
675
684
|
/**
|
|
@@ -678,17 +687,22 @@ class Ae {
|
|
|
678
687
|
* @param stream - The stream to populate the capabilities from.
|
|
679
688
|
*/
|
|
680
689
|
populateCapabilities(e) {
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
690
|
+
const t = e.getVideoTracks()[0].getCapabilities();
|
|
691
|
+
if ("getCapabilities" in this.deviceInfo) {
|
|
692
|
+
const g = this.deviceInfo.getCapabilities();
|
|
693
|
+
this.store.setState({ deviceCapabilities: g });
|
|
694
|
+
}
|
|
695
|
+
ge(t, this.streamCapabilities) || this.store.setState({ streamCapabilities: t });
|
|
696
|
+
const o = e.getVideoTracks()[0].getSettings();
|
|
697
|
+
if (!o.width || !o.height)
|
|
684
698
|
throw new Error(
|
|
685
699
|
"Video track resolution not available. Should not happen."
|
|
686
700
|
);
|
|
687
|
-
const
|
|
688
|
-
width:
|
|
689
|
-
height:
|
|
690
|
-
},
|
|
691
|
-
!this.maxSupportedResolution &&
|
|
701
|
+
const i = {
|
|
702
|
+
width: o.width,
|
|
703
|
+
height: o.height
|
|
704
|
+
}, s = Et(i), l = {};
|
|
705
|
+
!this.maxSupportedResolution && s && (l.maxSupportedResolution = s), "torch" in t && (l.torchSupported = !0), "focusMode" in t && t.focusMode?.includes("single-shot") && (l.singleShotSupported = !0), this.facingMode === "front" && t.facingMode?.includes("environment") && (l.facingMode = "back", console.warn("Front camera selected, but facingMode is environment")), this.facingMode === "back" && t.facingMode?.includes("user") && (l.facingMode = "front", console.warn("Back camera selected, but facingMode is user")), this.facingMode || (t.facingMode?.includes("environment") && (l.facingMode = "back"), t.facingMode?.includes("user") && (l.facingMode = "front")), ge(l, this.store.getState()) || this.store.setState(l);
|
|
692
706
|
}
|
|
693
707
|
/**
|
|
694
708
|
* Toggles the torch on the camera.
|
|
@@ -708,9 +722,9 @@ class Ae {
|
|
|
708
722
|
torch: !this.torchEnabled
|
|
709
723
|
}
|
|
710
724
|
]
|
|
711
|
-
}), this.torchEnabled
|
|
712
|
-
} catch (
|
|
713
|
-
throw console.error("Failed to toggle torch",
|
|
725
|
+
}), this.store.setState({ torchEnabled: !this.torchEnabled });
|
|
726
|
+
} catch (t) {
|
|
727
|
+
throw console.error("Failed to toggle torch", t), this.store.setState({ torchEnabled: !1, torchSupported: !1 }), new Error("Failed to toggle torch", { cause: t });
|
|
714
728
|
}
|
|
715
729
|
return this.torchEnabled;
|
|
716
730
|
}
|
|
@@ -718,7 +732,11 @@ class Ae {
|
|
|
718
732
|
* Stops the stream on the camera.
|
|
719
733
|
*/
|
|
720
734
|
stopStream() {
|
|
721
|
-
this.activeStream && (console.debug(`Stopping active stream on ${this.name}`),
|
|
735
|
+
this.activeStream && (console.debug(`Stopping active stream on ${this.name}`), $e(this.activeStream), this.store.setState({
|
|
736
|
+
activeStream: void 0,
|
|
737
|
+
streamCapabilities: void 0,
|
|
738
|
+
torchEnabled: !1
|
|
739
|
+
}));
|
|
722
740
|
}
|
|
723
741
|
/**
|
|
724
742
|
* Gets the video track on the camera.
|
|
@@ -733,50 +751,88 @@ class Ae {
|
|
|
733
751
|
return this.activeStream.getVideoTracks()[0];
|
|
734
752
|
}
|
|
735
753
|
}
|
|
736
|
-
const
|
|
754
|
+
const P = {
|
|
755
|
+
"720p": { width: 1280, height: 720 },
|
|
756
|
+
"1080p": { width: 1920, height: 1080 },
|
|
757
|
+
"4k": { width: 3840, height: 2160 }
|
|
758
|
+
};
|
|
759
|
+
function St(r) {
|
|
760
|
+
return Math.max(r.width, r.height);
|
|
761
|
+
}
|
|
762
|
+
function yt(r) {
|
|
763
|
+
const e = {
|
|
764
|
+
width: Math.max(r.width, r.height),
|
|
765
|
+
height: Math.min(r.width, r.height)
|
|
766
|
+
};
|
|
767
|
+
return Math.abs(e.width / e.height - 16 / 9) > 1e-4 && console.warn(
|
|
768
|
+
`Resolution ${JSON.stringify(
|
|
769
|
+
r
|
|
770
|
+
)} is not 16:9, may cause issues with some video players.`
|
|
771
|
+
), e;
|
|
772
|
+
}
|
|
773
|
+
function Ct(r) {
|
|
774
|
+
const e = St(r);
|
|
775
|
+
return e > 1920 ? "4k" : e > 1280 ? "1080p" : "720p";
|
|
776
|
+
}
|
|
777
|
+
function Et(r) {
|
|
778
|
+
const e = yt(r), t = Object.entries(P).find(
|
|
779
|
+
([n, o]) => o.width === e.width && o.height === e.height
|
|
780
|
+
);
|
|
781
|
+
if (!t) {
|
|
782
|
+
const n = Ct(r);
|
|
783
|
+
return console.warn(
|
|
784
|
+
`No exact resolution match found for ${JSON.stringify(r)}, categorizing as ${n}`
|
|
785
|
+
), n;
|
|
786
|
+
}
|
|
787
|
+
return t[0];
|
|
788
|
+
}
|
|
789
|
+
const Fe = {
|
|
737
790
|
cameras: [],
|
|
738
791
|
facingFilter: void 0,
|
|
739
792
|
videoElement: void 0,
|
|
793
|
+
videoResolution: void 0,
|
|
740
794
|
playbackState: "idle",
|
|
795
|
+
extractionArea: void 0,
|
|
741
796
|
selectedCamera: void 0,
|
|
742
797
|
isSwappingCamera: !1,
|
|
743
798
|
isQueryingCameras: !1,
|
|
799
|
+
cameraPermission: void 0,
|
|
744
800
|
mirrorX: !1,
|
|
745
801
|
errorState: void 0
|
|
746
|
-
},
|
|
802
|
+
}, u = de()(
|
|
747
803
|
// this is important! Otherwise solid-zustand will start mutating the initial state
|
|
748
|
-
|
|
749
|
-
),
|
|
750
|
-
console.debug("Stopping all cameras and resetting the `cameraManagerStore`."),
|
|
751
|
-
|
|
752
|
-
}),
|
|
753
|
-
},
|
|
754
|
-
function
|
|
804
|
+
ue(() => structuredClone(Fe))
|
|
805
|
+
), kt = () => {
|
|
806
|
+
console.debug("Stopping all cameras and resetting the `cameraManagerStore`."), u.getState().cameras.forEach((r) => {
|
|
807
|
+
r.stopStream();
|
|
808
|
+
}), u.setState(structuredClone(Fe));
|
|
809
|
+
}, be = Element.prototype.attachShadow;
|
|
810
|
+
function me() {
|
|
755
811
|
return typeof window.ShadyDOM < "u" && typeof ShadowRoot < "u";
|
|
756
812
|
}
|
|
757
|
-
function
|
|
813
|
+
function Tt() {
|
|
758
814
|
return typeof ShadowRoot < "u";
|
|
759
815
|
}
|
|
760
|
-
function
|
|
761
|
-
|
|
762
|
-
const
|
|
763
|
-
return t
|
|
816
|
+
function _t(r) {
|
|
817
|
+
be == null || me() || (Element.prototype.attachShadow = function(e) {
|
|
818
|
+
const t = be.call(this, e);
|
|
819
|
+
return r(t), t;
|
|
764
820
|
});
|
|
765
821
|
}
|
|
766
|
-
function
|
|
767
|
-
const
|
|
822
|
+
function Mt(r, ...e) {
|
|
823
|
+
const t = new Set(e);
|
|
768
824
|
let a = !1;
|
|
769
825
|
const n = () => {
|
|
770
|
-
for (const o of
|
|
771
|
-
|
|
772
|
-
|
|
826
|
+
for (const o of t)
|
|
827
|
+
r(o);
|
|
828
|
+
t.clear();
|
|
773
829
|
};
|
|
774
830
|
return {
|
|
775
831
|
isRunning() {
|
|
776
832
|
return a;
|
|
777
833
|
},
|
|
778
834
|
schedule(o) {
|
|
779
|
-
|
|
835
|
+
t.add(o), a && n();
|
|
780
836
|
},
|
|
781
837
|
stop() {
|
|
782
838
|
a = !1;
|
|
@@ -786,107 +842,107 @@ function kt(t, ...e) {
|
|
|
786
842
|
}
|
|
787
843
|
};
|
|
788
844
|
}
|
|
789
|
-
const
|
|
845
|
+
const xt = {
|
|
790
846
|
childList: !0,
|
|
791
847
|
subtree: !0
|
|
792
|
-
},
|
|
793
|
-
typeof queueMicrotask < "u" ? queueMicrotask(
|
|
848
|
+
}, Rt = (r) => {
|
|
849
|
+
typeof queueMicrotask < "u" ? queueMicrotask(r) : typeof Promise < "u" ? Promise.resolve().then(() => r()) : setTimeout(() => r(), 0);
|
|
794
850
|
};
|
|
795
|
-
function
|
|
796
|
-
if (typeof Symbol < "u" &&
|
|
797
|
-
return [...
|
|
851
|
+
function pe(r) {
|
|
852
|
+
if (typeof Symbol < "u" && r[Symbol.iterator] != null)
|
|
853
|
+
return [...r];
|
|
798
854
|
{
|
|
799
855
|
const e = [];
|
|
800
|
-
for (let
|
|
801
|
-
e[
|
|
856
|
+
for (let t = 0; t < r.length; t++)
|
|
857
|
+
e[t] = r[t];
|
|
802
858
|
return e;
|
|
803
859
|
}
|
|
804
860
|
}
|
|
805
|
-
function
|
|
806
|
-
return
|
|
861
|
+
function At(r, e) {
|
|
862
|
+
return me() ? new Set(pe(window.ShadyDOM.nativeMethods.querySelectorAll.call(document.documentElement, e))) : new Set("querySelectorAll" in r ? pe(r.querySelectorAll(e)) : []);
|
|
807
863
|
}
|
|
808
|
-
function
|
|
809
|
-
return /* @__PURE__ */ new Set([...
|
|
864
|
+
function It(r, e) {
|
|
865
|
+
return /* @__PURE__ */ new Set([...r ?? [], ...e ?? []]);
|
|
810
866
|
}
|
|
811
|
-
function
|
|
812
|
-
return "activeElement" in
|
|
867
|
+
function $t(r) {
|
|
868
|
+
return "activeElement" in r;
|
|
813
869
|
}
|
|
814
|
-
function
|
|
815
|
-
if (
|
|
870
|
+
function Le(r = document.documentElement) {
|
|
871
|
+
if ($t(r) && ze(r), me() && r instanceof ShadowRoot || !Tt())
|
|
816
872
|
return;
|
|
817
|
-
const e =
|
|
818
|
-
for (const a of [...e, ...
|
|
819
|
-
|
|
873
|
+
const e = r.childNodes, t = "shadowRoot" in r && r.shadowRoot != null ? [r.shadowRoot] : [];
|
|
874
|
+
for (const a of [...e, ...t])
|
|
875
|
+
Le(a);
|
|
820
876
|
}
|
|
821
|
-
function
|
|
822
|
-
return "isConnected" in Node.prototype ?
|
|
877
|
+
function Dt(r) {
|
|
878
|
+
return "isConnected" in Node.prototype ? r.isConnected : r.ownerDocument == null || !(r.ownerDocument.compareDocumentPosition(r) & r.DOCUMENT_POSITION_DISCONNECTED);
|
|
823
879
|
}
|
|
824
880
|
const W = /* @__PURE__ */ new Map();
|
|
825
|
-
function
|
|
826
|
-
const
|
|
827
|
-
let i = !1,
|
|
828
|
-
const
|
|
829
|
-
|
|
830
|
-
const
|
|
831
|
-
|
|
832
|
-
},
|
|
833
|
-
i || (i = !0,
|
|
834
|
-
},
|
|
835
|
-
|
|
836
|
-
},
|
|
837
|
-
const
|
|
838
|
-
return
|
|
839
|
-
},
|
|
881
|
+
function Ft(r, e) {
|
|
882
|
+
const t = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new WeakMap();
|
|
883
|
+
let i = !1, s = !1, l = !1;
|
|
884
|
+
const f = () => {
|
|
885
|
+
s = !0;
|
|
886
|
+
const b = [...t];
|
|
887
|
+
b.length > 0 && e(b, r), t.clear(), i = !1, s = !1;
|
|
888
|
+
}, g = () => {
|
|
889
|
+
i || (i = !0, Rt(f));
|
|
890
|
+
}, p = (b) => {
|
|
891
|
+
t.add(b), s || g();
|
|
892
|
+
}, S = () => {
|
|
893
|
+
const b = [...t];
|
|
894
|
+
return t.clear(), b;
|
|
895
|
+
}, m = () => {
|
|
840
896
|
a.clear();
|
|
841
|
-
},
|
|
842
|
-
let x = n.get(
|
|
843
|
-
const
|
|
844
|
-
|
|
845
|
-
},
|
|
846
|
-
for (const
|
|
847
|
-
const x = o.get(
|
|
848
|
-
x !==
|
|
849
|
-
connected:
|
|
850
|
-
target:
|
|
897
|
+
}, d = (b, E) => {
|
|
898
|
+
let x = n.get(b);
|
|
899
|
+
const F = At(b, E), G = x?.get(E), X = It(F, G);
|
|
900
|
+
h(X), x == null && (x = /* @__PURE__ */ new Map(), n.set(b, x)), x.set(E, F);
|
|
901
|
+
}, h = (b) => {
|
|
902
|
+
for (const E of b) {
|
|
903
|
+
const x = o.get(E), F = Dt(E);
|
|
904
|
+
x !== F && (o.set(E, F), p({
|
|
905
|
+
connected: F,
|
|
906
|
+
target: E
|
|
851
907
|
}));
|
|
852
908
|
}
|
|
853
|
-
},
|
|
909
|
+
}, v = {
|
|
854
910
|
observedTargets: a,
|
|
855
|
-
queryRootAndHandleMutationChanges:
|
|
856
|
-
handleMutationChange:
|
|
857
|
-
addObservedTarget: (
|
|
858
|
-
if (
|
|
859
|
-
|
|
911
|
+
queryRootAndHandleMutationChanges: d,
|
|
912
|
+
handleMutationChange: h,
|
|
913
|
+
addObservedTarget: (b) => {
|
|
914
|
+
if (se.run(), l || (l = !0, Le()), a.add(b), typeof b != "string")
|
|
915
|
+
h([b]);
|
|
860
916
|
else
|
|
861
|
-
for (const
|
|
862
|
-
|
|
917
|
+
for (const E of ie)
|
|
918
|
+
d(E, b);
|
|
863
919
|
},
|
|
864
|
-
clearObservedTargets:
|
|
865
|
-
clearQueue:
|
|
920
|
+
clearObservedTargets: m,
|
|
921
|
+
clearQueue: S
|
|
866
922
|
};
|
|
867
|
-
W.set(
|
|
923
|
+
W.set(r, v);
|
|
868
924
|
}
|
|
869
|
-
const
|
|
870
|
-
for (const e of
|
|
925
|
+
const Lt = (r) => {
|
|
926
|
+
for (const e of r)
|
|
871
927
|
if (e.type === "childList")
|
|
872
|
-
for (const
|
|
873
|
-
for (const a of
|
|
874
|
-
typeof a == "string" ?
|
|
875
|
-
},
|
|
876
|
-
let
|
|
928
|
+
for (const t of W.values())
|
|
929
|
+
for (const a of t.observedTargets)
|
|
930
|
+
typeof a == "string" ? t.queryRootAndHandleMutationChanges(e.target, a) : t.handleMutationChange([a]);
|
|
931
|
+
}, ie = /* @__PURE__ */ new Set(), ze = /* @__PURE__ */ (() => {
|
|
932
|
+
let r;
|
|
877
933
|
return function(e) {
|
|
878
|
-
|
|
934
|
+
ie.has(e) || (ie.add(e), r == null && (r = new MutationObserver(Lt)), r.observe(e, xt));
|
|
879
935
|
};
|
|
880
|
-
})(),
|
|
881
|
-
class
|
|
936
|
+
})(), se = Mt(ze, document.documentElement);
|
|
937
|
+
class z {
|
|
882
938
|
constructor(e) {
|
|
883
939
|
if (new.target === void 0)
|
|
884
|
-
throw new TypeError(`Constructor ${
|
|
940
|
+
throw new TypeError(`Constructor ${z.name} requires 'new'`);
|
|
885
941
|
if (e === void 0)
|
|
886
|
-
throw new ReferenceError(`Failed to construct '${
|
|
942
|
+
throw new ReferenceError(`Failed to construct '${z.name}': 1 argument required, but only 0 present.`);
|
|
887
943
|
if (typeof e != "function")
|
|
888
|
-
throw new TypeError(`Failed to construct '${
|
|
889
|
-
|
|
944
|
+
throw new TypeError(`Failed to construct '${z.name}': The callback provided as parameter 1 is not a function.`);
|
|
945
|
+
Ft(this, e);
|
|
890
946
|
}
|
|
891
947
|
/**
|
|
892
948
|
* The Symbol.@@toStringTag value
|
|
@@ -902,11 +958,11 @@ class N {
|
|
|
902
958
|
*/
|
|
903
959
|
observe(e) {
|
|
904
960
|
if (e === void 0)
|
|
905
|
-
throw new ReferenceError(`Failed to execute '${this.observe.name}' on '${
|
|
961
|
+
throw new ReferenceError(`Failed to execute '${this.observe.name}' on '${z.name}': 1 argument required, but only 0 present.`);
|
|
906
962
|
if (typeof e != "string" && !(e instanceof Node))
|
|
907
|
-
throw new TypeError(`Failed to execute '${this.observe.name}' on '${
|
|
908
|
-
const
|
|
909
|
-
|
|
963
|
+
throw new TypeError(`Failed to execute '${this.observe.name}' on '${z.name}': parameter 1 is not of type 'Node' or a DOMString.`);
|
|
964
|
+
const t = W.get(this);
|
|
965
|
+
t?.addObservedTarget(e);
|
|
910
966
|
}
|
|
911
967
|
/**
|
|
912
968
|
* Takes the records immediately (instead of waiting for the next flush)
|
|
@@ -923,22 +979,14 @@ class N {
|
|
|
923
979
|
e?.clearObservedTargets();
|
|
924
980
|
}
|
|
925
981
|
}
|
|
926
|
-
|
|
927
|
-
function
|
|
928
|
-
return
|
|
929
|
-
|
|
982
|
+
_t(se.schedule.bind(se));
|
|
983
|
+
function ve(r, ...e) {
|
|
984
|
+
return r.addEventListener(...e), () => {
|
|
985
|
+
r.removeEventListener(...e);
|
|
930
986
|
};
|
|
931
987
|
}
|
|
932
|
-
function
|
|
933
|
-
|
|
934
|
-
if (e((a, n) => {
|
|
935
|
-
t.addEventListener(a, n), r = () => t.removeEventListener(a, n);
|
|
936
|
-
}), !r)
|
|
937
|
-
throw new Error("you forgot to add event listener");
|
|
938
|
-
return r;
|
|
939
|
-
}
|
|
940
|
-
function se(t) {
|
|
941
|
-
const e = Ie(t);
|
|
988
|
+
function le(r) {
|
|
989
|
+
const e = Ne(r);
|
|
942
990
|
if ("detached" in e)
|
|
943
991
|
return e.detached;
|
|
944
992
|
try {
|
|
@@ -947,40 +995,40 @@ function se(t) {
|
|
|
947
995
|
return !0;
|
|
948
996
|
}
|
|
949
997
|
}
|
|
950
|
-
class
|
|
998
|
+
class zt {
|
|
951
999
|
#e;
|
|
952
|
-
#o = null;
|
|
953
|
-
#a = null;
|
|
954
|
-
#r = null;
|
|
955
1000
|
#n = null;
|
|
1001
|
+
#r = null;
|
|
1002
|
+
#a = null;
|
|
1003
|
+
#i = null;
|
|
956
1004
|
#t = null;
|
|
957
1005
|
#s = 0;
|
|
958
|
-
#
|
|
959
|
-
#
|
|
960
|
-
#
|
|
1006
|
+
#o = 0;
|
|
1007
|
+
#l;
|
|
1008
|
+
#c = 4;
|
|
961
1009
|
/**
|
|
962
1010
|
* Creates a new VideoFrameProcessor.
|
|
963
1011
|
*
|
|
964
1012
|
* @param options - The options for the VideoFrameProcessor.
|
|
965
1013
|
*/
|
|
966
1014
|
constructor(e = {}) {
|
|
967
|
-
const { canvasRenderingMode:
|
|
968
|
-
if (this.#
|
|
1015
|
+
const { canvasRenderingMode: t = "webgl2", fallbackWebGlTo2d: a = !0 } = e;
|
|
1016
|
+
if (this.#l = t, this.#e = document.createElement("canvas"), t === "2d")
|
|
969
1017
|
this.#d();
|
|
970
|
-
else if (
|
|
1018
|
+
else if (t === "webgl2")
|
|
971
1019
|
try {
|
|
972
|
-
this.#
|
|
1020
|
+
this.#m();
|
|
973
1021
|
} catch (n) {
|
|
974
1022
|
if (a)
|
|
975
1023
|
console.warn(
|
|
976
1024
|
"Failed to create WebGL2 context, falling back to 2D canvas"
|
|
977
|
-
), this.#
|
|
1025
|
+
), this.#l = "2d", this.#d();
|
|
978
1026
|
else
|
|
979
1027
|
throw n;
|
|
980
1028
|
}
|
|
981
1029
|
else
|
|
982
1030
|
throw new Error(
|
|
983
|
-
`Unsupported rendering context: ${
|
|
1031
|
+
`Unsupported rendering context: ${t}`
|
|
984
1032
|
);
|
|
985
1033
|
}
|
|
986
1034
|
/**
|
|
@@ -992,12 +1040,12 @@ class It {
|
|
|
992
1040
|
willReadFrequently: !0
|
|
993
1041
|
});
|
|
994
1042
|
if (!e) throw new Error("CanvasRenderingContext2D is missing!");
|
|
995
|
-
this.#
|
|
1043
|
+
this.#n = e;
|
|
996
1044
|
}
|
|
997
1045
|
/**
|
|
998
1046
|
* Initializes the WebGL2 context and resources.
|
|
999
1047
|
*/
|
|
1000
|
-
#
|
|
1048
|
+
#m() {
|
|
1001
1049
|
const e = this.#e.getContext("webgl2", {
|
|
1002
1050
|
alpha: !1,
|
|
1003
1051
|
depth: !1,
|
|
@@ -1009,17 +1057,17 @@ class It {
|
|
|
1009
1057
|
powerPreference: "high-performance"
|
|
1010
1058
|
});
|
|
1011
1059
|
if (!e) throw new Error("WebGL2RenderingContext is missing!");
|
|
1012
|
-
this.#
|
|
1013
|
-
const
|
|
1014
|
-
if (!
|
|
1015
|
-
this.#
|
|
1060
|
+
this.#r = e;
|
|
1061
|
+
const t = e.createTexture();
|
|
1062
|
+
if (!t) throw new Error("Failed to create WebGL texture");
|
|
1063
|
+
this.#a = t, e.bindTexture(e.TEXTURE_2D, t), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_S, e.CLAMP_TO_EDGE), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_T, e.CLAMP_TO_EDGE), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, e.NEAREST), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MAG_FILTER, e.NEAREST);
|
|
1016
1064
|
const a = e.createFramebuffer();
|
|
1017
1065
|
if (!a) throw new Error("Failed to create framebuffer");
|
|
1018
|
-
this.#
|
|
1066
|
+
this.#i = a, e.bindFramebuffer(e.FRAMEBUFFER, a), e.framebufferTexture2D(
|
|
1019
1067
|
e.FRAMEBUFFER,
|
|
1020
1068
|
e.COLOR_ATTACHMENT0,
|
|
1021
1069
|
e.TEXTURE_2D,
|
|
1022
|
-
|
|
1070
|
+
t,
|
|
1023
1071
|
0
|
|
1024
1072
|
);
|
|
1025
1073
|
}
|
|
@@ -1032,15 +1080,15 @@ class It {
|
|
|
1032
1080
|
* @param arrayBuffer - The array buffer to reattach.
|
|
1033
1081
|
*/
|
|
1034
1082
|
reattachArrayBuffer(e) {
|
|
1035
|
-
const
|
|
1036
|
-
if (
|
|
1083
|
+
const t = Ne(e);
|
|
1084
|
+
if (le(t))
|
|
1037
1085
|
throw new Error("Can't use a detached array buffer!");
|
|
1038
|
-
const a = this.#s * this.#
|
|
1039
|
-
if (
|
|
1040
|
-
this.#t = new Uint8ClampedArray(
|
|
1086
|
+
const a = this.#s * this.#o * 4;
|
|
1087
|
+
if (t.byteLength === a)
|
|
1088
|
+
this.#t = new Uint8ClampedArray(t);
|
|
1041
1089
|
else
|
|
1042
1090
|
throw new Error(
|
|
1043
|
-
`ArrayBuffer size mismatch: expected ${a}, got ${
|
|
1091
|
+
`ArrayBuffer size mismatch: expected ${a}, got ${t.byteLength}`
|
|
1044
1092
|
);
|
|
1045
1093
|
}
|
|
1046
1094
|
/**
|
|
@@ -1051,7 +1099,7 @@ class It {
|
|
|
1051
1099
|
isBufferDetached() {
|
|
1052
1100
|
if (!this.#t)
|
|
1053
1101
|
throw new Error("Buffer is missing!");
|
|
1054
|
-
return
|
|
1102
|
+
return le(this.#t.buffer);
|
|
1055
1103
|
}
|
|
1056
1104
|
/**
|
|
1057
1105
|
* Extracts image data from a source element.
|
|
@@ -1060,8 +1108,8 @@ class It {
|
|
|
1060
1108
|
* @param area - The extraction area.
|
|
1061
1109
|
* @returns The image data.
|
|
1062
1110
|
*/
|
|
1063
|
-
getImageData(e,
|
|
1064
|
-
return this.#
|
|
1111
|
+
getImageData(e, t) {
|
|
1112
|
+
return this.#l === "2d" ? this.#g(e, t) : this.#u(e, t);
|
|
1065
1113
|
}
|
|
1066
1114
|
/**
|
|
1067
1115
|
* Used to get the current ImageData object with the current buffer. Useful
|
|
@@ -1073,7 +1121,7 @@ class It {
|
|
|
1073
1121
|
getCurrentImageData() {
|
|
1074
1122
|
if (!this.#t)
|
|
1075
1123
|
throw new Error("Buffer is missing!");
|
|
1076
|
-
return new ImageData(this.#t, this.#s, this.#
|
|
1124
|
+
return new ImageData(this.#t, this.#s, this.#o);
|
|
1077
1125
|
}
|
|
1078
1126
|
/**
|
|
1079
1127
|
* Extract image data using 2D canvas.
|
|
@@ -1082,11 +1130,11 @@ class It {
|
|
|
1082
1130
|
* @param area - The extraction area.
|
|
1083
1131
|
* @returns The image data.
|
|
1084
1132
|
*/
|
|
1085
|
-
#
|
|
1086
|
-
if (!this.#
|
|
1133
|
+
#g(e, t) {
|
|
1134
|
+
if (!this.#n)
|
|
1087
1135
|
throw new Error("CanvasRenderingContext2D is missing!");
|
|
1088
|
-
const a = "videoWidth" in e ? e.videoWidth : e.width, n = "videoHeight" in e ? e.videoHeight : e.height, o =
|
|
1089
|
-
return this.#
|
|
1136
|
+
const a = "videoWidth" in e ? e.videoWidth : e.width, n = "videoHeight" in e ? e.videoHeight : e.height, o = t?.x ?? 0, i = t?.y ?? 0, s = t?.width ?? a, l = t?.height ?? n;
|
|
1137
|
+
return this.#h(s, l), this.#n.drawImage(e, o, i, s, l), this.#n.getImageData(0, 0, s, l);
|
|
1090
1138
|
}
|
|
1091
1139
|
/**
|
|
1092
1140
|
* Extract image data using WebGL2.
|
|
@@ -1095,26 +1143,26 @@ class It {
|
|
|
1095
1143
|
* @param area - The extraction area.
|
|
1096
1144
|
* @returns The image data.
|
|
1097
1145
|
*/
|
|
1098
|
-
#
|
|
1099
|
-
if (!this.#
|
|
1146
|
+
#u(e, t) {
|
|
1147
|
+
if (!this.#r || !this.#a || !this.#i)
|
|
1100
1148
|
throw new Error("WebGL2 context or resources are missing!");
|
|
1101
|
-
const a = "videoWidth" in e ? e.videoWidth : e.width, n = "videoHeight" in e ? e.videoHeight : e.height, o =
|
|
1102
|
-
if (this.#
|
|
1149
|
+
const a = "videoWidth" in e ? e.videoWidth : e.width, n = "videoHeight" in e ? e.videoHeight : e.height, o = t?.x ?? 0, i = t?.y ?? 0, s = t?.width ?? a, l = t?.height ?? n, f = s * l * 4;
|
|
1150
|
+
if (this.#h(s, l), this.isBufferDetached())
|
|
1103
1151
|
throw new Error("Buffer is detached!");
|
|
1104
|
-
(!this.#t || this.#t.length !==
|
|
1105
|
-
const
|
|
1106
|
-
|
|
1152
|
+
(!this.#t || this.#t.length !== f) && (this.#t = new Uint8ClampedArray(f));
|
|
1153
|
+
const g = this.#r;
|
|
1154
|
+
g.bindTexture(g.TEXTURE_2D, this.#a), g.texImage2D(g.TEXTURE_2D, 0, g.RGBA, g.RGBA, g.UNSIGNED_BYTE, e), g.bindFramebuffer(g.FRAMEBUFFER, this.#i);
|
|
1107
1155
|
try {
|
|
1108
|
-
|
|
1109
|
-
} catch (
|
|
1110
|
-
if (this.#
|
|
1111
|
-
this.#
|
|
1112
|
-
const
|
|
1113
|
-
return
|
|
1156
|
+
g.pixelStorei(g.PACK_ALIGNMENT, this.#c), g.readPixels(o, i, s, l, g.RGBA, g.UNSIGNED_BYTE, this.#t);
|
|
1157
|
+
} catch (p) {
|
|
1158
|
+
if (this.#c !== 1) {
|
|
1159
|
+
this.#c = 1, g.pixelStorei(g.PACK_ALIGNMENT, 1);
|
|
1160
|
+
const S = new Uint8ClampedArray(f);
|
|
1161
|
+
return g.readPixels(0, 0, s, l, g.RGBA, g.UNSIGNED_BYTE, S), this.#t = S, new ImageData(S, s, l);
|
|
1114
1162
|
}
|
|
1115
|
-
throw
|
|
1163
|
+
throw p;
|
|
1116
1164
|
}
|
|
1117
|
-
return new ImageData(this.#t,
|
|
1165
|
+
return new ImageData(this.#t, s, l);
|
|
1118
1166
|
}
|
|
1119
1167
|
/**
|
|
1120
1168
|
* Update canvas dimensions if needed.
|
|
@@ -1124,10 +1172,10 @@ class It {
|
|
|
1124
1172
|
* @param width - The width of the canvas.
|
|
1125
1173
|
* @param height - The height of the canvas.
|
|
1126
1174
|
*/
|
|
1127
|
-
#
|
|
1128
|
-
if (this.#s !== e || this.#
|
|
1129
|
-
this.#e.width = e, this.#e.height =
|
|
1130
|
-
const a = e *
|
|
1175
|
+
#h(e, t) {
|
|
1176
|
+
if (this.#s !== e || this.#o !== t) {
|
|
1177
|
+
this.#e.width = e, this.#e.height = t, this.#s = e, this.#o = t;
|
|
1178
|
+
const a = e * t * 4;
|
|
1131
1179
|
this.#t = new Uint8ClampedArray(a);
|
|
1132
1180
|
}
|
|
1133
1181
|
}
|
|
@@ -1135,14 +1183,11 @@ class It {
|
|
|
1135
1183
|
* Clean up resources.
|
|
1136
1184
|
*/
|
|
1137
1185
|
dispose() {
|
|
1138
|
-
this.#
|
|
1186
|
+
this.#r && (this.#a && (this.#r.deleteTexture(this.#a), this.#a = null), this.#i && (this.#r.deleteFramebuffer(this.#i), this.#i = null)), this.#n = null, this.#r = null, this.#t = null;
|
|
1139
1187
|
}
|
|
1140
1188
|
}
|
|
1141
|
-
const
|
|
1142
|
-
|
|
1143
|
-
preferredResolution: "1080p"
|
|
1144
|
-
};
|
|
1145
|
-
class ta {
|
|
1189
|
+
const Ne = (r) => ArrayBuffer.isView(r) ? r.buffer : r;
|
|
1190
|
+
class na {
|
|
1146
1191
|
#e;
|
|
1147
1192
|
/**
|
|
1148
1193
|
* The desired video resolution for camera streams. This is used as the ideal resolution
|
|
@@ -1151,26 +1196,25 @@ class ta {
|
|
|
1151
1196
|
* 4k → 1080p → 720p. The actual resolution used may differ from this setting based on
|
|
1152
1197
|
* camera capabilities and system constraints.
|
|
1153
1198
|
*/
|
|
1154
|
-
#o;
|
|
1155
|
-
#a;
|
|
1156
|
-
#r;
|
|
1157
1199
|
#n;
|
|
1200
|
+
#r;
|
|
1201
|
+
#a;
|
|
1202
|
+
#i;
|
|
1158
1203
|
#t;
|
|
1159
|
-
#s;
|
|
1160
1204
|
/**
|
|
1161
1205
|
* If true, the user has initiated an abort. This will prevent the
|
|
1162
1206
|
* CameraManager from throwing errors when the user interrupts the process.
|
|
1163
1207
|
*/
|
|
1164
|
-
#
|
|
1208
|
+
#s = !1;
|
|
1165
1209
|
/**
|
|
1166
1210
|
* If true, the user has initiated an abort. This will prevent the
|
|
1167
1211
|
* CameraManager from throwing errors when the user interrupts the process.
|
|
1168
1212
|
*/
|
|
1169
1213
|
get userInitiatedAbort() {
|
|
1170
|
-
return this.#
|
|
1214
|
+
return this.#s;
|
|
1171
1215
|
}
|
|
1172
1216
|
set userInitiatedAbort(e) {
|
|
1173
|
-
this.#
|
|
1217
|
+
this.#s = e;
|
|
1174
1218
|
}
|
|
1175
1219
|
/**
|
|
1176
1220
|
* Sets the area of the video frame that will be extracted.
|
|
@@ -1178,27 +1222,38 @@ class ta {
|
|
|
1178
1222
|
* @param extractionArea The area of the video frame that will be extracted.
|
|
1179
1223
|
*/
|
|
1180
1224
|
setExtractionArea(e) {
|
|
1181
|
-
|
|
1225
|
+
const t = u.getState().extractionArea;
|
|
1226
|
+
t && t.x === e.x && t.y === e.y && t.width === e.width && t.height === e.height || u.setState({
|
|
1227
|
+
extractionArea: e
|
|
1228
|
+
});
|
|
1229
|
+
}
|
|
1230
|
+
/**
|
|
1231
|
+
* Gets the area of the video frame that will be extracted.
|
|
1232
|
+
*
|
|
1233
|
+
* @returns The area of the video frame that will be extracted.
|
|
1234
|
+
*/
|
|
1235
|
+
get extractionArea() {
|
|
1236
|
+
return u.getState().extractionArea;
|
|
1182
1237
|
}
|
|
1183
1238
|
/**
|
|
1184
1239
|
* Callbacks that will be triggered on each frame when the playback state is
|
|
1185
1240
|
* "capturing".
|
|
1186
1241
|
*/
|
|
1187
|
-
#
|
|
1242
|
+
#o = /* @__PURE__ */ new Set();
|
|
1188
1243
|
/**
|
|
1189
1244
|
* Creates a new CameraManager instance.
|
|
1190
1245
|
*
|
|
1191
1246
|
* @param options - The options for the CameraManager.
|
|
1192
1247
|
* @param videoFrameProcessorOptions - The options for the VideoFrameProcessor.
|
|
1193
1248
|
*/
|
|
1194
|
-
constructor(e = {},
|
|
1249
|
+
constructor(e = {}, t) {
|
|
1195
1250
|
const { mirrorFrontCameras: a, preferredResolution: n } = {
|
|
1196
|
-
...
|
|
1251
|
+
...Nt,
|
|
1197
1252
|
...e
|
|
1198
1253
|
};
|
|
1199
|
-
this.#
|
|
1200
|
-
|
|
1201
|
-
), this.#
|
|
1254
|
+
this.#n = n, this.#a = new zt(
|
|
1255
|
+
t
|
|
1256
|
+
), this.#i = a;
|
|
1202
1257
|
}
|
|
1203
1258
|
/**
|
|
1204
1259
|
* Sets the desired video resolution for camera streams. This is used as the ideal resolution
|
|
@@ -1209,9 +1264,9 @@ class ta {
|
|
|
1209
1264
|
* @param resolution - The ideal resolution to set for camera streams.
|
|
1210
1265
|
*/
|
|
1211
1266
|
setResolution = async (e) => {
|
|
1212
|
-
this.#
|
|
1213
|
-
const
|
|
1214
|
-
|
|
1267
|
+
this.#n = e;
|
|
1268
|
+
const t = this.getState().playbackState;
|
|
1269
|
+
t !== "idle" && (this.#e = t, this.stopStream(), await this.startCameraStream());
|
|
1215
1270
|
};
|
|
1216
1271
|
/**
|
|
1217
1272
|
* The desired video resolution for camera streams. This is used as the ideal resolution
|
|
@@ -1221,7 +1276,7 @@ class ta {
|
|
|
1221
1276
|
* camera capabilities and system constraints.
|
|
1222
1277
|
*/
|
|
1223
1278
|
get resolution() {
|
|
1224
|
-
return this.#
|
|
1279
|
+
return this.#n;
|
|
1225
1280
|
}
|
|
1226
1281
|
/**
|
|
1227
1282
|
* True if there is a video playing or capturing
|
|
@@ -1229,7 +1284,7 @@ class ta {
|
|
|
1229
1284
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/MediaSession/playbackState for more details.
|
|
1230
1285
|
*/
|
|
1231
1286
|
get isActive() {
|
|
1232
|
-
return
|
|
1287
|
+
return u.getState().playbackState !== "idle";
|
|
1233
1288
|
}
|
|
1234
1289
|
/**
|
|
1235
1290
|
* Sets the facing filter.
|
|
@@ -1237,7 +1292,7 @@ class ta {
|
|
|
1237
1292
|
* @param facingFilter - The facing filter.
|
|
1238
1293
|
*/
|
|
1239
1294
|
setFacingFilter(e) {
|
|
1240
|
-
|
|
1295
|
+
u.setState({
|
|
1241
1296
|
facingFilter: e
|
|
1242
1297
|
});
|
|
1243
1298
|
}
|
|
@@ -1248,18 +1303,21 @@ class ta {
|
|
|
1248
1303
|
* @returns The cameras that are available to the user, filtered by the facing mode.
|
|
1249
1304
|
*/
|
|
1250
1305
|
async getCameraDevices() {
|
|
1251
|
-
let e =
|
|
1252
|
-
const
|
|
1253
|
-
return e.length || await this.refreshCameraDevices(), e =
|
|
1254
|
-
(n) =>
|
|
1306
|
+
let e = u.getState().cameras;
|
|
1307
|
+
const t = u.getState().facingFilter;
|
|
1308
|
+
return e.length || await this.refreshCameraDevices(), e = u.getState().cameras, t ? e.filter(
|
|
1309
|
+
(n) => t.includes(n.facingMode)
|
|
1255
1310
|
) : e;
|
|
1256
1311
|
}
|
|
1312
|
+
get selectedCamera() {
|
|
1313
|
+
return u.getState().selectedCamera;
|
|
1314
|
+
}
|
|
1257
1315
|
/**
|
|
1258
1316
|
* Single-time setup for a video element.
|
|
1259
1317
|
*
|
|
1260
1318
|
* @param videoElement - The video element to initialize.
|
|
1261
1319
|
*/
|
|
1262
|
-
#
|
|
1320
|
+
#l(e) {
|
|
1263
1321
|
if (!(e instanceof HTMLVideoElement))
|
|
1264
1322
|
throw new Error(
|
|
1265
1323
|
`Expected an HTMLVideoElement, got ${typeof e}`,
|
|
@@ -1267,45 +1325,32 @@ class ta {
|
|
|
1267
1325
|
cause: e
|
|
1268
1326
|
}
|
|
1269
1327
|
);
|
|
1270
|
-
|
|
1328
|
+
u.setState({
|
|
1271
1329
|
videoElement: e
|
|
1272
1330
|
});
|
|
1273
|
-
const
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
// "pause",
|
|
1284
|
-
// "waiting",
|
|
1285
|
-
// "seeking",
|
|
1286
|
-
// "seeked",
|
|
1287
|
-
// "ended",
|
|
1288
|
-
// "stalled",
|
|
1289
|
-
// "suspend",
|
|
1290
|
-
// "timeupdate",
|
|
1291
|
-
// "ratechange",
|
|
1292
|
-
// "durationchange",
|
|
1293
|
-
].forEach((c) => {
|
|
1294
|
-
i(c, () => {
|
|
1295
|
-
console.debug(`Video event: ${c}`);
|
|
1331
|
+
const t = ve(
|
|
1332
|
+
e,
|
|
1333
|
+
"resize",
|
|
1334
|
+
() => {
|
|
1335
|
+
const i = u.getState().videoResolution;
|
|
1336
|
+
i?.width === e.videoWidth && i?.height === e.videoHeight || u.setState({
|
|
1337
|
+
videoResolution: {
|
|
1338
|
+
width: e.videoWidth,
|
|
1339
|
+
height: e.videoHeight
|
|
1340
|
+
}
|
|
1296
1341
|
});
|
|
1297
|
-
}
|
|
1298
|
-
|
|
1299
|
-
new N((i) => {
|
|
1342
|
+
}
|
|
1343
|
+
), a = new z((i) => {
|
|
1300
1344
|
i[0].connected || this.releaseVideoElement();
|
|
1301
|
-
})
|
|
1345
|
+
});
|
|
1346
|
+
a.observe(e), e.setAttribute("playsInline", ""), e.setAttribute("muted", ""), e.controls = !1;
|
|
1302
1347
|
let n = "idle";
|
|
1303
|
-
const o =
|
|
1348
|
+
const o = ve(
|
|
1304
1349
|
document,
|
|
1305
1350
|
"visibilitychange",
|
|
1306
1351
|
async () => {
|
|
1307
1352
|
if (document.hidden) {
|
|
1308
|
-
n =
|
|
1353
|
+
n = u.getState().playbackState, this.stopStream();
|
|
1309
1354
|
return;
|
|
1310
1355
|
}
|
|
1311
1356
|
switch (n) {
|
|
@@ -1318,8 +1363,8 @@ class ta {
|
|
|
1318
1363
|
}
|
|
1319
1364
|
}
|
|
1320
1365
|
);
|
|
1321
|
-
this.#
|
|
1322
|
-
o(),
|
|
1366
|
+
this.#t = () => {
|
|
1367
|
+
o(), t(), a.disconnect();
|
|
1323
1368
|
};
|
|
1324
1369
|
}
|
|
1325
1370
|
/**
|
|
@@ -1329,12 +1374,12 @@ class ta {
|
|
|
1329
1374
|
*/
|
|
1330
1375
|
initVideoElement(e) {
|
|
1331
1376
|
try {
|
|
1332
|
-
this.#
|
|
1333
|
-
} catch (
|
|
1377
|
+
this.#l(e);
|
|
1378
|
+
} catch (t) {
|
|
1334
1379
|
if (this.userInitiatedAbort)
|
|
1335
1380
|
this.reset();
|
|
1336
1381
|
else
|
|
1337
|
-
throw
|
|
1382
|
+
throw t;
|
|
1338
1383
|
}
|
|
1339
1384
|
}
|
|
1340
1385
|
/**
|
|
@@ -1345,13 +1390,13 @@ class ta {
|
|
|
1345
1390
|
* @returns a cleanup function to remove the callback
|
|
1346
1391
|
*/
|
|
1347
1392
|
addFrameCaptureCallback(e) {
|
|
1348
|
-
return this.#
|
|
1393
|
+
return this.#o.add(e), () => this.#o.delete(e);
|
|
1349
1394
|
}
|
|
1350
1395
|
/**
|
|
1351
1396
|
* Cleans up the video element, and stops the stream.
|
|
1352
1397
|
*/
|
|
1353
1398
|
releaseVideoElement() {
|
|
1354
|
-
this.#
|
|
1399
|
+
this.#t?.(), u.setState({
|
|
1355
1400
|
videoElement: void 0
|
|
1356
1401
|
}), this.stopStream();
|
|
1357
1402
|
}
|
|
@@ -1362,9 +1407,9 @@ class ta {
|
|
|
1362
1407
|
* @param camera - The camera to select.
|
|
1363
1408
|
*/
|
|
1364
1409
|
async selectCamera(e) {
|
|
1365
|
-
const
|
|
1366
|
-
|
|
1367
|
-
const a =
|
|
1410
|
+
const t = u.getState().playbackState;
|
|
1411
|
+
t !== "idle" && (this.#e = t);
|
|
1412
|
+
const a = u.getState();
|
|
1368
1413
|
if (a.selectedCamera === e) {
|
|
1369
1414
|
console.debug("Already selected");
|
|
1370
1415
|
return;
|
|
@@ -1373,9 +1418,9 @@ class ta {
|
|
|
1373
1418
|
console.debug("Already swapping");
|
|
1374
1419
|
return;
|
|
1375
1420
|
}
|
|
1376
|
-
|
|
1421
|
+
u.setState({
|
|
1377
1422
|
isSwappingCamera: !0
|
|
1378
|
-
}), a.selectedCamera?.activeStream && (console.debug("Stopping previous stream"), a.selectedCamera.stopStream()), a.videoElement && (a.videoElement.srcObject = null),
|
|
1423
|
+
}), a.selectedCamera?.activeStream && (console.debug("Stopping previous stream"), a.selectedCamera.stopStream()), a.videoElement && (a.videoElement.srcObject = null), u.setState({
|
|
1379
1424
|
selectedCamera: e,
|
|
1380
1425
|
isSwappingCamera: !1
|
|
1381
1426
|
}), this.#e === "playback" && (console.debug("Starting new stream"), await this.startPlayback()), this.#e === "capturing" && (console.debug("Resuming frame capture"), await this.startFrameCapture()), this.#e = void 0;
|
|
@@ -1386,37 +1431,77 @@ class ta {
|
|
|
1386
1431
|
* @returns resolves when the camera devices are refreshed
|
|
1387
1432
|
*/
|
|
1388
1433
|
async refreshCameraDevices() {
|
|
1389
|
-
if (
|
|
1434
|
+
if (u.getState().isQueryingCameras || u.getState().isSwappingCamera) {
|
|
1390
1435
|
console.debug("Already querying cameras");
|
|
1391
1436
|
return;
|
|
1392
1437
|
}
|
|
1393
|
-
|
|
1438
|
+
if (u.getState().cameraPermission === "prompt") {
|
|
1439
|
+
console.debug("Still waiting for user to respond");
|
|
1440
|
+
return;
|
|
1441
|
+
}
|
|
1442
|
+
u.setState({
|
|
1394
1443
|
isQueryingCameras: !0
|
|
1395
|
-
})
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1444
|
+
}), window.setTimeout(() => {
|
|
1445
|
+
const a = u.getState();
|
|
1446
|
+
a.isQueryingCameras && u.setState({
|
|
1447
|
+
cameraPermission: "prompt"
|
|
1448
|
+
}), !a.isQueryingCameras && a.cameraPermission === "denied" && u.setState({
|
|
1449
|
+
cameraPermission: "blocked"
|
|
1450
|
+
});
|
|
1451
|
+
}, 100);
|
|
1452
|
+
const e = await mt().catch((a) => {
|
|
1453
|
+
throw a instanceof U && a.code === "PERMISSION_DENIED" && u.setState({
|
|
1454
|
+
errorState: Y(a),
|
|
1455
|
+
cameraPermission: "denied",
|
|
1399
1456
|
isQueryingCameras: !1
|
|
1400
1457
|
}), a;
|
|
1401
|
-
})
|
|
1402
|
-
|
|
1403
|
-
|
|
1458
|
+
});
|
|
1459
|
+
u.setState({
|
|
1460
|
+
cameraPermission: "granted"
|
|
1461
|
+
});
|
|
1462
|
+
const t = vt(e);
|
|
1463
|
+
t.forEach((a) => {
|
|
1464
|
+
a.unsubscribeAll(), a.subscribe((n) => {
|
|
1404
1465
|
window.queueMicrotask(() => {
|
|
1405
|
-
|
|
1406
|
-
|
|
1466
|
+
const i = u.getState().selectedCamera;
|
|
1467
|
+
a === i && u.setState({
|
|
1468
|
+
selectedCamera: a
|
|
1407
1469
|
});
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1470
|
+
let s = !1, l;
|
|
1471
|
+
n.error?.code === "STREAM_ENDED_UNEXPECTEDLY" && Ie().catch((f) => {
|
|
1472
|
+
f instanceof U && f.code === "PERMISSION_DENIED" && (s = !0, l = f);
|
|
1473
|
+
}).finally(() => {
|
|
1474
|
+
u.setState({
|
|
1475
|
+
errorState: l,
|
|
1476
|
+
playbackState: "idle",
|
|
1477
|
+
cameraPermission: s ? "denied" : "granted"
|
|
1478
|
+
});
|
|
1415
1479
|
});
|
|
1416
1480
|
});
|
|
1417
|
-
})
|
|
1418
|
-
|
|
1419
|
-
|
|
1481
|
+
}), a.subscribe(
|
|
1482
|
+
// need a custom selector to be able to use a custom `equalityFn` with zustand middleware
|
|
1483
|
+
(n) => n,
|
|
1484
|
+
() => {
|
|
1485
|
+
window.queueMicrotask(() => {
|
|
1486
|
+
u.setState({
|
|
1487
|
+
cameras: [...u.getState().cameras]
|
|
1488
|
+
});
|
|
1489
|
+
});
|
|
1490
|
+
},
|
|
1491
|
+
// Use a custom equality function to prevent updating all cameras list for
|
|
1492
|
+
// every minor change in camera state
|
|
1493
|
+
{
|
|
1494
|
+
equalityFn: (n, o) => [
|
|
1495
|
+
"torchSupported",
|
|
1496
|
+
"singleShotSupported",
|
|
1497
|
+
"facingMode",
|
|
1498
|
+
"maxSupportedResolution",
|
|
1499
|
+
"name"
|
|
1500
|
+
].every((s) => n[s] === o[s])
|
|
1501
|
+
}
|
|
1502
|
+
);
|
|
1503
|
+
}), u.setState({
|
|
1504
|
+
cameras: t,
|
|
1420
1505
|
isQueryingCameras: !1
|
|
1421
1506
|
});
|
|
1422
1507
|
}
|
|
@@ -1426,7 +1511,7 @@ class ta {
|
|
|
1426
1511
|
* @returns resolves when playback starts
|
|
1427
1512
|
*/
|
|
1428
1513
|
async startPlayback() {
|
|
1429
|
-
const e =
|
|
1514
|
+
const e = u.getState();
|
|
1430
1515
|
if (!(this.isActive && !this.#e)) {
|
|
1431
1516
|
if (!e.videoElement) {
|
|
1432
1517
|
console.warn("Starting playback - no video element present.");
|
|
@@ -1437,17 +1522,17 @@ class ta {
|
|
|
1437
1522
|
return;
|
|
1438
1523
|
}
|
|
1439
1524
|
if (!e.selectedCamera.activeStream) {
|
|
1440
|
-
const
|
|
1441
|
-
e.videoElement.srcObject =
|
|
1525
|
+
const t = await e.selectedCamera.startStream(this.resolution);
|
|
1526
|
+
e.videoElement.srcObject = t;
|
|
1442
1527
|
}
|
|
1443
1528
|
try {
|
|
1444
|
-
this.#
|
|
1529
|
+
this.#h(), await e.videoElement.play(), u.setState({
|
|
1445
1530
|
playbackState: "playback"
|
|
1446
1531
|
});
|
|
1447
|
-
} catch (
|
|
1448
|
-
throw console.error("Failed to start playback",
|
|
1449
|
-
errorState:
|
|
1450
|
-
}),
|
|
1532
|
+
} catch (t) {
|
|
1533
|
+
throw console.error("Failed to start playback", t), u.setState({
|
|
1534
|
+
errorState: Y(t)
|
|
1535
|
+
}), t;
|
|
1451
1536
|
}
|
|
1452
1537
|
}
|
|
1453
1538
|
}
|
|
@@ -1456,8 +1541,8 @@ class ta {
|
|
|
1456
1541
|
*
|
|
1457
1542
|
* @returns resolves when frame capture starts
|
|
1458
1543
|
*/
|
|
1459
|
-
async #
|
|
1460
|
-
const e =
|
|
1544
|
+
async #c() {
|
|
1545
|
+
const e = u.getState();
|
|
1461
1546
|
if (!this.userInitiatedAbort && !(e.playbackState === "capturing" && this.#e !== "capturing")) {
|
|
1462
1547
|
if (!e.videoElement) {
|
|
1463
1548
|
console.warn(
|
|
@@ -1471,9 +1556,9 @@ class ta {
|
|
|
1471
1556
|
);
|
|
1472
1557
|
return;
|
|
1473
1558
|
}
|
|
1474
|
-
await this.startPlayback(),
|
|
1559
|
+
await this.startPlayback(), u.setState({
|
|
1475
1560
|
playbackState: "capturing"
|
|
1476
|
-
}), this.#
|
|
1561
|
+
}), this.#u(), this.#e = void 0;
|
|
1477
1562
|
}
|
|
1478
1563
|
}
|
|
1479
1564
|
/**
|
|
@@ -1483,7 +1568,7 @@ class ta {
|
|
|
1483
1568
|
*/
|
|
1484
1569
|
startFrameCapture = async () => {
|
|
1485
1570
|
try {
|
|
1486
|
-
await this.#
|
|
1571
|
+
await this.#c();
|
|
1487
1572
|
} catch (e) {
|
|
1488
1573
|
if (this.userInitiatedAbort)
|
|
1489
1574
|
this.reset();
|
|
@@ -1497,12 +1582,12 @@ class ta {
|
|
|
1497
1582
|
* @param params - The parameters for the camera stream.
|
|
1498
1583
|
* @returns resolves when the camera stream starts
|
|
1499
1584
|
*/
|
|
1500
|
-
async #
|
|
1585
|
+
async #d({
|
|
1501
1586
|
autoplay: e = !0,
|
|
1502
|
-
preferredCamera:
|
|
1503
|
-
preferredFacing: a
|
|
1587
|
+
preferredCamera: t,
|
|
1588
|
+
preferredFacing: a = "back"
|
|
1504
1589
|
} = {}) {
|
|
1505
|
-
const n =
|
|
1590
|
+
const n = u.getState().videoElement;
|
|
1506
1591
|
if (!n) {
|
|
1507
1592
|
console.warn("Can't start stream without a video element");
|
|
1508
1593
|
return;
|
|
@@ -1511,41 +1596,41 @@ class ta {
|
|
|
1511
1596
|
console.warn("Already streaming");
|
|
1512
1597
|
return;
|
|
1513
1598
|
}
|
|
1514
|
-
if (
|
|
1599
|
+
if (t instanceof De && await this.selectCamera(t), !u.getState().selectedCamera)
|
|
1515
1600
|
try {
|
|
1516
|
-
const
|
|
1517
|
-
let
|
|
1518
|
-
if (!
|
|
1519
|
-
throw console.
|
|
1601
|
+
const s = await this.getCameraDevices();
|
|
1602
|
+
let l;
|
|
1603
|
+
if (!s.length)
|
|
1604
|
+
throw console.warn("Camera list is empty"), new Error(
|
|
1520
1605
|
`No cameras found matching the filter ${a}`
|
|
1521
1606
|
);
|
|
1522
|
-
if (typeof
|
|
1607
|
+
if (typeof t == "function" && (l = t(s), l || console.warn(
|
|
1523
1608
|
"No camera found matching the preferred camera function, falling back to facing mode"
|
|
1524
|
-
)),
|
|
1525
|
-
|
|
1609
|
+
)), l || (l = await pt(
|
|
1610
|
+
s,
|
|
1526
1611
|
this.resolution,
|
|
1527
1612
|
a
|
|
1528
|
-
)), !
|
|
1613
|
+
)), !l)
|
|
1529
1614
|
throw new Error(
|
|
1530
1615
|
`No cameras found matching the filter ${a}`
|
|
1531
1616
|
);
|
|
1532
|
-
await this.selectCamera(
|
|
1617
|
+
await this.selectCamera(l), this.#m() && u.setState({
|
|
1533
1618
|
errorState: void 0
|
|
1534
1619
|
});
|
|
1535
|
-
} catch (
|
|
1536
|
-
throw
|
|
1537
|
-
errorState:
|
|
1538
|
-
}),
|
|
1620
|
+
} catch (s) {
|
|
1621
|
+
throw u.setState({
|
|
1622
|
+
errorState: Y(s)
|
|
1623
|
+
}), s;
|
|
1539
1624
|
}
|
|
1540
|
-
const o =
|
|
1625
|
+
const o = u.getState().selectedCamera;
|
|
1541
1626
|
if (!o)
|
|
1542
1627
|
throw console.warn("No selected camera!"), new Error("No selected camera");
|
|
1543
|
-
const i = await o.startStream(this.#
|
|
1628
|
+
const i = await o.startStream(this.#n);
|
|
1544
1629
|
if (!n.isConnected)
|
|
1545
1630
|
throw new Error("Video element needs to be in the document!");
|
|
1546
|
-
n.srcObject = i,
|
|
1631
|
+
n.srcObject = i, u.setState({
|
|
1547
1632
|
videoElement: n
|
|
1548
|
-
}), e && await this.startPlayback();
|
|
1633
|
+
}), e && await this.startPlayback(), this.#e === "capturing" && (console.debug("Resuming frame capture"), await this.startFrameCapture()), this.#e === "playback" && (console.debug("Resuming playback"), await this.startPlayback());
|
|
1549
1634
|
}
|
|
1550
1635
|
/**
|
|
1551
1636
|
* Starts a best-effort camera stream. Will pick a camera automatically if
|
|
@@ -1556,12 +1641,12 @@ class ta {
|
|
|
1556
1641
|
*/
|
|
1557
1642
|
async startCameraStream(e = {}) {
|
|
1558
1643
|
try {
|
|
1559
|
-
await this.#
|
|
1560
|
-
} catch (
|
|
1644
|
+
await this.#d(e);
|
|
1645
|
+
} catch (t) {
|
|
1561
1646
|
if (this.userInitiatedAbort)
|
|
1562
1647
|
this.reset();
|
|
1563
1648
|
else
|
|
1564
|
-
throw
|
|
1649
|
+
throw t;
|
|
1565
1650
|
}
|
|
1566
1651
|
}
|
|
1567
1652
|
/**
|
|
@@ -1570,14 +1655,14 @@ class ta {
|
|
|
1570
1655
|
* @returns true if the error state is a permission error
|
|
1571
1656
|
*/
|
|
1572
1657
|
#m = () => {
|
|
1573
|
-
const e =
|
|
1574
|
-
return e instanceof
|
|
1658
|
+
const e = u.getState().errorState;
|
|
1659
|
+
return e instanceof U && e.code === "PERMISSION_DENIED";
|
|
1575
1660
|
};
|
|
1576
1661
|
/**
|
|
1577
1662
|
* Pauses capturing frames, without stopping playback.
|
|
1578
1663
|
*/
|
|
1579
1664
|
stopFrameCapture() {
|
|
1580
|
-
|
|
1665
|
+
u.setState({
|
|
1581
1666
|
playbackState: "playback"
|
|
1582
1667
|
});
|
|
1583
1668
|
}
|
|
@@ -1586,7 +1671,7 @@ class ta {
|
|
|
1586
1671
|
*/
|
|
1587
1672
|
stopStream() {
|
|
1588
1673
|
console.debug("stopStream called");
|
|
1589
|
-
const e =
|
|
1674
|
+
const e = u.getState();
|
|
1590
1675
|
this.pausePlayback(), e.selectedCamera?.stopStream(), e.videoElement && (e.videoElement.srcObject = null);
|
|
1591
1676
|
}
|
|
1592
1677
|
/**
|
|
@@ -1594,16 +1679,16 @@ class ta {
|
|
|
1594
1679
|
*/
|
|
1595
1680
|
pausePlayback() {
|
|
1596
1681
|
console.debug("pausePlayback called");
|
|
1597
|
-
const e =
|
|
1598
|
-
|
|
1682
|
+
const e = u.getState().videoElement;
|
|
1683
|
+
u.setState({
|
|
1599
1684
|
playbackState: "idle"
|
|
1600
1685
|
}), e && (this.#r && e.cancelVideoFrameCallback(this.#r), e.pause());
|
|
1601
1686
|
}
|
|
1602
1687
|
/**
|
|
1603
1688
|
* The main recognition loop. Do not call this method directly, use `#queueFrame` instead.
|
|
1604
1689
|
*/
|
|
1605
|
-
async #
|
|
1606
|
-
const e =
|
|
1690
|
+
async #g() {
|
|
1691
|
+
const e = u.getState();
|
|
1607
1692
|
if (this.#r === void 0) {
|
|
1608
1693
|
console.error("Missing request ID");
|
|
1609
1694
|
return;
|
|
@@ -1612,41 +1697,47 @@ class ta {
|
|
|
1612
1697
|
console.warn("Missing video element, should not happen");
|
|
1613
1698
|
return;
|
|
1614
1699
|
}
|
|
1615
|
-
if (!
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1700
|
+
if (!e.extractionArea) {
|
|
1701
|
+
console.warn(
|
|
1702
|
+
"Stream started before extraction area was set, skipping frame."
|
|
1703
|
+
);
|
|
1704
|
+
return;
|
|
1705
|
+
}
|
|
1706
|
+
if (!(e.videoElement.videoHeight >= e.videoElement.videoWidth == e.extractionArea.height >= e.extractionArea.width))
|
|
1707
|
+
return this.#u();
|
|
1708
|
+
if (this.#o.size !== 0) {
|
|
1709
|
+
const a = this.#a.getImageData(
|
|
1619
1710
|
e.videoElement,
|
|
1620
|
-
|
|
1711
|
+
e.extractionArea
|
|
1621
1712
|
);
|
|
1622
|
-
for (const n of this.#
|
|
1623
|
-
const o =
|
|
1713
|
+
for (const n of this.#o) {
|
|
1714
|
+
const o = le(a.data.buffer) ? this.#a.getCurrentImageData() : a, i = await n(o);
|
|
1624
1715
|
if (i) {
|
|
1625
1716
|
if (!(i instanceof ArrayBuffer))
|
|
1626
1717
|
throw new Error(
|
|
1627
|
-
|
|
1718
|
+
Ae`
|
|
1628
1719
|
Frame capture callback did not return an ArrayBuffer.
|
|
1629
1720
|
Make sure to return the underlying buffer, not the view.
|
|
1630
1721
|
`
|
|
1631
1722
|
);
|
|
1632
|
-
this.#
|
|
1723
|
+
this.#a.reattachArrayBuffer(i);
|
|
1633
1724
|
}
|
|
1634
1725
|
}
|
|
1635
1726
|
}
|
|
1636
|
-
this.#
|
|
1727
|
+
this.#u();
|
|
1637
1728
|
}
|
|
1638
1729
|
/**
|
|
1639
1730
|
* Queues the next frame to be processed.
|
|
1640
1731
|
*/
|
|
1641
|
-
#
|
|
1642
|
-
const e =
|
|
1732
|
+
#u() {
|
|
1733
|
+
const e = u.getState();
|
|
1643
1734
|
if (e.playbackState === "capturing") {
|
|
1644
1735
|
if (!e.videoElement) {
|
|
1645
1736
|
console.warn("Missing video element, should not happen");
|
|
1646
1737
|
return;
|
|
1647
1738
|
}
|
|
1648
1739
|
this.#r && e.videoElement.cancelVideoFrameCallback(this.#r), this.#r = e.videoElement.requestVideoFrameCallback(
|
|
1649
|
-
() => void this.#
|
|
1740
|
+
() => void this.#g()
|
|
1650
1741
|
);
|
|
1651
1742
|
}
|
|
1652
1743
|
}
|
|
@@ -1654,13 +1745,13 @@ class ta {
|
|
|
1654
1745
|
* Applies a mirror effect to the video if the camera is front-facing.
|
|
1655
1746
|
* Assumes that desktop devices don't return a facing mode and that they are front-facing.
|
|
1656
1747
|
*/
|
|
1657
|
-
#
|
|
1658
|
-
const e =
|
|
1748
|
+
#h() {
|
|
1749
|
+
const e = u.getState().selectedCamera;
|
|
1659
1750
|
if (!e) {
|
|
1660
1751
|
console.warn("No camera selected");
|
|
1661
1752
|
return;
|
|
1662
1753
|
}
|
|
1663
|
-
this.#
|
|
1754
|
+
this.#i && (e.facingMode !== "back" ? this.setCameraMirrorX(!0) : this.setCameraMirrorX(!1));
|
|
1664
1755
|
}
|
|
1665
1756
|
/**
|
|
1666
1757
|
* If true, the video and captured frames will be mirrored horizontally.
|
|
@@ -1668,12 +1759,12 @@ class ta {
|
|
|
1668
1759
|
* @param mirrorX - If true, the video and captured frames will be mirrored horizontally.
|
|
1669
1760
|
*/
|
|
1670
1761
|
setCameraMirrorX(e) {
|
|
1671
|
-
const
|
|
1762
|
+
const t = u.getState(), a = t.videoElement;
|
|
1672
1763
|
if (!a) {
|
|
1673
1764
|
console.warn("Mirror video - no video element present.");
|
|
1674
1765
|
return;
|
|
1675
1766
|
}
|
|
1676
|
-
|
|
1767
|
+
t.mirrorX !== e && (e ? a.style.scale = "-1 1" : a.style.removeProperty("scale"), u.setState({ mirrorX: e }));
|
|
1677
1768
|
}
|
|
1678
1769
|
// The "typeof" is necessary to avoid a circular dependency when resolving types
|
|
1679
1770
|
/**
|
|
@@ -1683,152 +1774,155 @@ class ta {
|
|
|
1683
1774
|
*
|
|
1684
1775
|
* @returns a cleanup function to remove the subscription
|
|
1685
1776
|
*/
|
|
1686
|
-
subscribe =
|
|
1777
|
+
subscribe = u.subscribe;
|
|
1687
1778
|
/**
|
|
1688
1779
|
* Gets the current internal state of the CameraManager.
|
|
1689
1780
|
*
|
|
1690
1781
|
* @returns the current state of the CameraManager
|
|
1691
1782
|
*/
|
|
1692
|
-
getState =
|
|
1783
|
+
getState = u.getState;
|
|
1693
1784
|
/**
|
|
1694
1785
|
* Resets the CameraManager and stops all streams.
|
|
1695
1786
|
*/
|
|
1696
1787
|
reset() {
|
|
1697
|
-
console.debug("Resetting camera manager"), this.#
|
|
1788
|
+
console.debug("Resetting camera manager"), this.#o.clear(), this.userInitiatedAbort = !1, this.stopStream(), kt();
|
|
1698
1789
|
}
|
|
1699
1790
|
}
|
|
1700
|
-
const
|
|
1701
|
-
|
|
1702
|
-
|
|
1791
|
+
const Nt = {
|
|
1792
|
+
mirrorFrontCameras: !0,
|
|
1793
|
+
preferredResolution: "1080p"
|
|
1794
|
+
}, Pe = Ce();
|
|
1795
|
+
function Pt() {
|
|
1796
|
+
return Te(u);
|
|
1703
1797
|
}
|
|
1704
|
-
const
|
|
1798
|
+
const Ot = (r) => {
|
|
1705
1799
|
const e = {
|
|
1706
|
-
cameraManagerSolidStore:
|
|
1800
|
+
cameraManagerSolidStore: Pt(),
|
|
1707
1801
|
// eslint-disable-next-line solid/reactivity
|
|
1708
|
-
cameraManager:
|
|
1802
|
+
cameraManager: r.cameraManager,
|
|
1709
1803
|
// eslint-disable-next-line solid/reactivity
|
|
1710
1804
|
dismountCameraUi: () => {
|
|
1711
|
-
|
|
1805
|
+
r.cameraManager.userInitiatedAbort = !0, r.dismountCameraUi();
|
|
1712
1806
|
},
|
|
1713
1807
|
// eslint-disable-next-line solid/reactivity
|
|
1714
|
-
addOnDismountCallback:
|
|
1808
|
+
addOnDismountCallback: r.addOnDismountCallback,
|
|
1715
1809
|
// eslint-disable-next-line solid/reactivity
|
|
1716
|
-
mountTarget:
|
|
1810
|
+
mountTarget: r.mountTarget,
|
|
1717
1811
|
// eslint-disable-next-line solid/reactivity
|
|
1718
|
-
showMirrorCameraButton:
|
|
1812
|
+
showMirrorCameraButton: r.showMirrorCameraButton,
|
|
1719
1813
|
// eslint-disable-next-line solid/reactivity
|
|
1720
|
-
showTorchButton:
|
|
1814
|
+
showTorchButton: r.showTorchButton,
|
|
1721
1815
|
// eslint-disable-next-line solid/reactivity
|
|
1722
|
-
showCloseButton:
|
|
1816
|
+
showCloseButton: r.showCloseButton,
|
|
1723
1817
|
// eslint-disable-next-line solid/reactivity
|
|
1724
|
-
showCameraErrorModal:
|
|
1818
|
+
showCameraErrorModal: r.showCameraErrorModal
|
|
1725
1819
|
};
|
|
1726
|
-
return
|
|
1820
|
+
return he(() => {
|
|
1727
1821
|
console.debug("CameraUiStoreProvider cleanup");
|
|
1728
|
-
}),
|
|
1822
|
+
}), c(Pe.Provider, {
|
|
1729
1823
|
value: e,
|
|
1730
1824
|
get children() {
|
|
1731
|
-
return
|
|
1825
|
+
return r.children;
|
|
1732
1826
|
}
|
|
1733
1827
|
});
|
|
1734
1828
|
};
|
|
1735
1829
|
function j() {
|
|
1736
|
-
const
|
|
1737
|
-
if (!
|
|
1830
|
+
const r = Ee(Pe);
|
|
1831
|
+
if (!r)
|
|
1738
1832
|
throw new Error("StoreContext.Provider not in scope");
|
|
1739
|
-
return
|
|
1833
|
+
return r;
|
|
1740
1834
|
}
|
|
1741
1835
|
const Bt = {
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1836
|
+
camera_error_cancel_btn: "Cancel",
|
|
1837
|
+
camera_error_details: "Please allow camera access in your browser and try again.",
|
|
1838
|
+
camera_error_primary_btn: "Retry",
|
|
1839
|
+
camera_error_title: "Camera permission required",
|
|
1746
1840
|
close: "Close",
|
|
1747
|
-
|
|
1841
|
+
loading_cameras: "Loading cameras...",
|
|
1748
1842
|
mirror_camera: "Mirror camera",
|
|
1749
1843
|
scan_document: "Scan a document",
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
},
|
|
1755
|
-
const [e,
|
|
1844
|
+
select_a_camera: "Select a camera",
|
|
1845
|
+
select_camera: "Select camera",
|
|
1846
|
+
selected_camera: "Selected camera",
|
|
1847
|
+
torch: "Torch"
|
|
1848
|
+
}, Oe = Ce(), Vt = (r) => {
|
|
1849
|
+
const [e, t] = Ze(
|
|
1756
1850
|
// we structure clone to avoid proxying to the original object
|
|
1757
1851
|
structuredClone({
|
|
1758
1852
|
...Bt,
|
|
1759
1853
|
// we don't care on init
|
|
1760
1854
|
// eslint-disable-next-line solid/reactivity
|
|
1761
|
-
...
|
|
1855
|
+
...r.userStrings
|
|
1762
1856
|
})
|
|
1763
1857
|
);
|
|
1764
|
-
|
|
1765
|
-
|
|
1858
|
+
Z(() => {
|
|
1859
|
+
r.setLocalizationRef(t);
|
|
1766
1860
|
});
|
|
1767
1861
|
const a = {
|
|
1768
1862
|
t: e,
|
|
1769
|
-
updateLocalization:
|
|
1863
|
+
updateLocalization: t
|
|
1770
1864
|
};
|
|
1771
|
-
return
|
|
1865
|
+
return c(Oe.Provider, {
|
|
1772
1866
|
value: a,
|
|
1773
1867
|
get children() {
|
|
1774
|
-
return
|
|
1868
|
+
return r.children;
|
|
1775
1869
|
}
|
|
1776
1870
|
});
|
|
1777
1871
|
};
|
|
1778
|
-
function
|
|
1779
|
-
const
|
|
1780
|
-
if (!
|
|
1872
|
+
function ee() {
|
|
1873
|
+
const r = Ee(Oe);
|
|
1874
|
+
if (!r)
|
|
1781
1875
|
throw new Error("LocalizationContext.Provider not in scope.");
|
|
1782
|
-
return
|
|
1876
|
+
return r;
|
|
1783
1877
|
}
|
|
1784
|
-
var
|
|
1785
|
-
const
|
|
1786
|
-
const [e,
|
|
1787
|
-
return
|
|
1878
|
+
var Ut = /* @__PURE__ */ y("<span>");
|
|
1879
|
+
const te = (r) => {
|
|
1880
|
+
const [e, t] = N(), [a, n] = N();
|
|
1881
|
+
return Z(() => {
|
|
1788
1882
|
const o = a();
|
|
1789
|
-
o &&
|
|
1790
|
-
}),
|
|
1883
|
+
o && t(o.getRootNode());
|
|
1884
|
+
}), c(k, {
|
|
1791
1885
|
get when() {
|
|
1792
1886
|
return e();
|
|
1793
1887
|
},
|
|
1794
1888
|
get fallback() {
|
|
1795
1889
|
return (() => {
|
|
1796
|
-
var o =
|
|
1797
|
-
return
|
|
1890
|
+
var o = Ut();
|
|
1891
|
+
return V(n, o), o;
|
|
1798
1892
|
})();
|
|
1799
1893
|
},
|
|
1800
|
-
children: (o) =>
|
|
1894
|
+
children: (o) => c(et, {
|
|
1801
1895
|
value: () => o(),
|
|
1802
1896
|
get children() {
|
|
1803
|
-
return
|
|
1897
|
+
return r.children(o());
|
|
1804
1898
|
}
|
|
1805
1899
|
})
|
|
1806
1900
|
});
|
|
1807
1901
|
};
|
|
1808
|
-
var
|
|
1809
|
-
const
|
|
1810
|
-
var e = Vt();
|
|
1811
|
-
return F(e, t, !0, !0), e;
|
|
1812
|
-
})();
|
|
1813
|
-
var qt = /* @__PURE__ */ S('<svg viewBox="0 0 24 24"width=1.2em height=1.2em><path fill=currentColor d="M7 2h10l-2 7h4l-2.925 4.225L7 4.15zm3 20v-8H7V9.85L1.375 4.225L2.8 2.8l18.4 18.4l-1.425 1.425L13.75 16.6z">');
|
|
1814
|
-
const jt = (t = {}) => (() => {
|
|
1902
|
+
var qt = /* @__PURE__ */ y('<svg viewBox="0 0 24 24"width=1.2em height=1.2em><path fill=currentColor d="M6.4 19L5 17.6l5.6-5.6L5 6.4L6.4 5l5.6 5.6L17.6 5L19 6.4L13.4 12l5.6 5.6l-1.4 1.4l-5.6-5.6z">');
|
|
1903
|
+
const jt = (r = {}) => (() => {
|
|
1815
1904
|
var e = qt();
|
|
1816
|
-
return
|
|
1905
|
+
return $(e, r, !0, !0), e;
|
|
1817
1906
|
})();
|
|
1818
|
-
var Ht = /* @__PURE__ */
|
|
1819
|
-
const Wt = (
|
|
1907
|
+
var Ht = /* @__PURE__ */ y('<svg viewBox="0 0 24 24"width=1.2em height=1.2em><path fill=currentColor d="M7 2h10l-2 7h4l-2.925 4.225L7 4.15zm3 20v-8H7V9.85L1.375 4.225L2.8 2.8l18.4 18.4l-1.425 1.425L13.75 16.6z">');
|
|
1908
|
+
const Wt = (r = {}) => (() => {
|
|
1820
1909
|
var e = Ht();
|
|
1821
|
-
return
|
|
1910
|
+
return $(e, r, !0, !0), e;
|
|
1822
1911
|
})();
|
|
1823
|
-
var Gt = /* @__PURE__ */
|
|
1824
|
-
const Xt = (
|
|
1912
|
+
var Gt = /* @__PURE__ */ y('<svg viewBox="0 0 24 24"width=1.2em height=1.2em><path fill=currentColor d="M10 22v-8H7V2h10l-2 7h4z">');
|
|
1913
|
+
const Xt = (r = {}) => (() => {
|
|
1825
1914
|
var e = Gt();
|
|
1826
|
-
return
|
|
1915
|
+
return $(e, r, !0, !0), e;
|
|
1916
|
+
})();
|
|
1917
|
+
var Qt = /* @__PURE__ */ y('<svg viewBox="0 0 24 24"width=1.2em height=1.2em><path fill=currentColor d="M9 21H5q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h4v2H5v14h4zm2 2V1h2v22zm4-2v-2h2v2zm0-16V3h2v2zm4 16v-2h2q0 .825-.587 1.413T19 21m0-4v-2h2v2zm0-4v-2h2v2zm0-4V7h2v2zm0-4V3q.825 0 1.413.588T21 5z">');
|
|
1918
|
+
const Kt = (r = {}) => (() => {
|
|
1919
|
+
var e = Qt();
|
|
1920
|
+
return $(e, r, !0, !0), e;
|
|
1827
1921
|
})();
|
|
1828
|
-
function
|
|
1922
|
+
function Be(r) {
|
|
1829
1923
|
const e = {};
|
|
1830
|
-
return Object.entries(
|
|
1831
|
-
const n =
|
|
1924
|
+
return Object.entries(r).forEach(([t, a]) => {
|
|
1925
|
+
const n = t.toLowerCase();
|
|
1832
1926
|
let o = n;
|
|
1833
1927
|
if (n.startsWith("on")) {
|
|
1834
1928
|
o = n.slice(2);
|
|
@@ -1838,143 +1932,146 @@ function Ne(t) {
|
|
|
1838
1932
|
e[o] = a;
|
|
1839
1933
|
}), e;
|
|
1840
1934
|
}
|
|
1841
|
-
var
|
|
1842
|
-
const
|
|
1843
|
-
var e = Qt();
|
|
1844
|
-
return F(e, t, !0, !0), e;
|
|
1845
|
-
})();
|
|
1846
|
-
var Yt = /* @__PURE__ */ S('<svg xmlns=http://www.w3.org/2000/svg fill=none viewBox="0 0 20 20"><path stroke=#fff stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M4.167 10.833 7.5 14.167l8.333-8.334">');
|
|
1847
|
-
const Jt = (t = {}) => (() => {
|
|
1935
|
+
var Yt = /* @__PURE__ */ y('<svg xmlns=http://www.w3.org/2000/svg fill=none viewBox="0 0 20 20"><g fill=#fff fill-rule=evenodd clip-rule=evenodd><path d="M6.322 2.988A1.67 1.67 0 0 1 7.5 2.5h5a1.667 1.667 0 0 1 1.667 1.667A.833.833 0 0 0 15 5h.833a2.5 2.5 0 0 1 2.5 2.5V15a2.5 2.5 0 0 1-2.5 2.5H4.167a2.5 2.5 0 0 1-2.5-2.5V7.5a2.5 2.5 0 0 1 2.5-2.5H5a.833.833 0 0 0 .833-.833c0-.442.176-.866.489-1.179M4.167 6.667a.833.833 0 0 0-.834.833V15a.833.833 0 0 0 .834.833h11.666a.834.834 0 0 0 .834-.833V7.5a.833.833 0 0 0-.834-.833H15a2.5 2.5 0 0 1-2.5-2.5h-5a2.5 2.5 0 0 1-2.5 2.5z"></path><path d="M10 9.167a1.667 1.667 0 1 0 0 3.333 1.667 1.667 0 0 0 0-3.333m-3.333 1.666a3.333 3.333 0 1 1 6.666 0 3.333 3.333 0 0 1-6.666 0">');
|
|
1936
|
+
const Jt = (r = {}) => (() => {
|
|
1848
1937
|
var e = Yt();
|
|
1849
|
-
return
|
|
1938
|
+
return $(e, r, !0, !0), e;
|
|
1850
1939
|
})();
|
|
1851
|
-
var Zt = /* @__PURE__ */
|
|
1852
|
-
const er = (
|
|
1940
|
+
var Zt = /* @__PURE__ */ y('<svg xmlns=http://www.w3.org/2000/svg fill=none viewBox="0 0 20 20"><path stroke=#fff stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M4.167 10.833 7.5 14.167l8.333-8.334">');
|
|
1941
|
+
const er = (r = {}) => (() => {
|
|
1853
1942
|
var e = Zt();
|
|
1854
|
-
return
|
|
1943
|
+
return $(e, r, !0, !0), e;
|
|
1944
|
+
})();
|
|
1945
|
+
var tr = /* @__PURE__ */ y('<svg xmlns=http://www.w3.org/2000/svg fill=none viewBox="0 0 20 20"><path fill=#fff fill-rule=evenodd d="M4.41 6.91a.833.833 0 0 1 1.18 0L10 11.323l4.41-4.411a.833.833 0 1 1 1.18 1.178l-5 5a.833.833 0 0 1-1.18 0l-5-5a.833.833 0 0 1 0-1.178"clip-rule=evenodd>');
|
|
1946
|
+
const rr = (r = {}) => (() => {
|
|
1947
|
+
var e = tr();
|
|
1948
|
+
return $(e, r, !0, !0), e;
|
|
1855
1949
|
})();
|
|
1856
|
-
var
|
|
1857
|
-
const
|
|
1950
|
+
var ar = /* @__PURE__ */ y("<button>");
|
|
1951
|
+
const nr = () => {
|
|
1858
1952
|
const {
|
|
1859
|
-
cameraManagerSolidStore:
|
|
1953
|
+
cameraManagerSolidStore: r,
|
|
1860
1954
|
cameraManager: e
|
|
1861
1955
|
} = j(), {
|
|
1862
|
-
t
|
|
1863
|
-
} =
|
|
1864
|
-
const
|
|
1865
|
-
return
|
|
1866
|
-
},
|
|
1867
|
-
value:
|
|
1868
|
-
label:
|
|
1869
|
-
}))],
|
|
1870
|
-
items: [...
|
|
1871
|
-
}),
|
|
1872
|
-
const
|
|
1873
|
-
if (!
|
|
1956
|
+
t
|
|
1957
|
+
} = ee(), a = r((d) => d.cameras), n = r((d) => d.selectedCamera), o = r((d) => d.facingFilter), i = r((d) => d.isQueryingCameras), s = r((d) => d.isSwappingCamera), l = () => i() || s(), f = () => {
|
|
1958
|
+
const d = o();
|
|
1959
|
+
return d ? a().filter((h) => d.includes(h.facingMode)) : a();
|
|
1960
|
+
}, g = () => [...f().map((d) => ({
|
|
1961
|
+
value: d.deviceInfo.deviceId,
|
|
1962
|
+
label: d.name
|
|
1963
|
+
}))], p = () => tt({
|
|
1964
|
+
items: [...g()]
|
|
1965
|
+
}), S = () => {
|
|
1966
|
+
const d = n();
|
|
1967
|
+
if (!d)
|
|
1874
1968
|
return;
|
|
1875
|
-
const
|
|
1876
|
-
if (
|
|
1877
|
-
return [
|
|
1878
|
-
},
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
if (!g) {
|
|
1969
|
+
const h = p().find(d.deviceInfo.deviceId);
|
|
1970
|
+
if (h)
|
|
1971
|
+
return [h.value];
|
|
1972
|
+
}, m = async (d) => {
|
|
1973
|
+
const h = a().find((C) => C.deviceInfo.deviceId === d);
|
|
1974
|
+
if (!h) {
|
|
1882
1975
|
console.warn("No camera");
|
|
1883
1976
|
return;
|
|
1884
1977
|
}
|
|
1885
|
-
await e.selectCamera(
|
|
1978
|
+
await e.selectCamera(h);
|
|
1886
1979
|
};
|
|
1887
|
-
return
|
|
1888
|
-
children: () =>
|
|
1980
|
+
return c(te, {
|
|
1981
|
+
children: () => c(A.Root, {
|
|
1889
1982
|
part: "camera-select-part",
|
|
1890
1983
|
get collection() {
|
|
1891
|
-
return
|
|
1984
|
+
return p();
|
|
1892
1985
|
},
|
|
1893
1986
|
get value() {
|
|
1894
|
-
return
|
|
1987
|
+
return S();
|
|
1895
1988
|
},
|
|
1896
1989
|
positioning: {
|
|
1897
1990
|
placement: "top"
|
|
1898
1991
|
},
|
|
1899
1992
|
lazyMount: !0,
|
|
1900
1993
|
get disabled() {
|
|
1901
|
-
return
|
|
1994
|
+
return l();
|
|
1902
1995
|
},
|
|
1903
|
-
onValueChange: (
|
|
1904
|
-
|
|
1905
|
-
console.warn("Fake camera, skipping");
|
|
1906
|
-
return;
|
|
1907
|
-
}
|
|
1908
|
-
b(f.value[0]);
|
|
1996
|
+
onValueChange: (d) => {
|
|
1997
|
+
m(d.value[0]);
|
|
1909
1998
|
},
|
|
1910
1999
|
get children() {
|
|
1911
|
-
return [
|
|
2000
|
+
return [c(A.Label, {
|
|
1912
2001
|
class: "sr-only",
|
|
1913
2002
|
get children() {
|
|
1914
|
-
return
|
|
2003
|
+
return t.selected_camera;
|
|
1915
2004
|
}
|
|
1916
|
-
}),
|
|
1917
|
-
asChild: (
|
|
1918
|
-
var
|
|
1919
|
-
return
|
|
1920
|
-
class: `flex px-4 py-2 items-center gap-2 rounded-full
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
2005
|
+
}), c(A.Trigger, {
|
|
2006
|
+
asChild: (d) => (() => {
|
|
2007
|
+
var h = ar();
|
|
2008
|
+
return $(h, J(() => Be(d()), {
|
|
2009
|
+
class: `flex px-4 py-2 items-center gap-2 rounded-full
|
|
2010
|
+
bg-gray-550/90 backdrop-blur-xl whitespace-nowrap text-base
|
|
2011
|
+
color-white font-500 cursor-pointer appearance-none
|
|
2012
|
+
border-none disabled:opacity-50 disabled:cursor-not-allowed
|
|
2013
|
+
max-w-[100%] btn-focus`
|
|
2014
|
+
}), !1, !0), w(h, c(Jt, {
|
|
1924
2015
|
class: "size-6 shrink-0",
|
|
1925
2016
|
"aria-hidden": !0
|
|
1926
|
-
}), null),
|
|
2017
|
+
}), null), w(h, c(A.ValueText, {
|
|
1927
2018
|
class: "truncate",
|
|
1928
2019
|
get placeholder() {
|
|
1929
|
-
return
|
|
2020
|
+
return i() ? t.loading_cameras : t.select_a_camera;
|
|
1930
2021
|
}
|
|
1931
|
-
}), null),
|
|
2022
|
+
}), null), w(h, c(A.Indicator, {
|
|
1932
2023
|
class: "shrink-0 data-[state=open]:scale-y-[-1]",
|
|
1933
2024
|
get children() {
|
|
1934
|
-
return
|
|
2025
|
+
return c(rr, {
|
|
1935
2026
|
class: "size-6 shrink-0"
|
|
1936
2027
|
});
|
|
1937
2028
|
}
|
|
1938
|
-
}), null),
|
|
2029
|
+
}), null), h;
|
|
1939
2030
|
})()
|
|
1940
|
-
}),
|
|
2031
|
+
}), c(A.Positioner, {
|
|
2032
|
+
class: "focus-visible:outline-none",
|
|
1941
2033
|
get children() {
|
|
1942
|
-
return
|
|
2034
|
+
return c(A.Content, {
|
|
2035
|
+
class: "focus-visible:outline-none outline-none",
|
|
1943
2036
|
get children() {
|
|
1944
|
-
return
|
|
1945
|
-
class:
|
|
2037
|
+
return c(A.ItemGroup, {
|
|
2038
|
+
class: `rounded-4 overflow-hidden text-base color-white
|
|
2039
|
+
focus-visible:outline-none flex flex-col gap-[1px]`,
|
|
1946
2040
|
get children() {
|
|
1947
|
-
return
|
|
2041
|
+
return c(Qe, {
|
|
1948
2042
|
get each() {
|
|
1949
|
-
return
|
|
2043
|
+
return p().items;
|
|
1950
2044
|
},
|
|
1951
|
-
children: (
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
2045
|
+
children: (d, h) => {
|
|
2046
|
+
const C = h === 0, v = h === p().items.length - 1;
|
|
2047
|
+
return c(A.Item, {
|
|
2048
|
+
get item() {
|
|
2049
|
+
return d();
|
|
2050
|
+
},
|
|
2051
|
+
class: `flex py-3 pl-4 pr-12 cursor-pointer
|
|
2052
|
+
select-none bg-gray-550/50 backdrop-blur-xl
|
|
2053
|
+
focus-visible:outline-none outline-none border-2
|
|
2054
|
+
border-solid border-transparent
|
|
2055
|
+
data-[highlighted]:border-primary relative
|
|
2056
|
+
${C ? "rounded-t-6" : ""}
|
|
2057
|
+
${v ? "rounded-b-6" : ""}`,
|
|
2058
|
+
get children() {
|
|
2059
|
+
return [c(A.ItemText, {
|
|
2060
|
+
class: "truncate",
|
|
2061
|
+
get children() {
|
|
2062
|
+
return d().label;
|
|
2063
|
+
}
|
|
2064
|
+
}), c(A.ItemIndicator, {
|
|
2065
|
+
class: "absolute right-4",
|
|
2066
|
+
get children() {
|
|
2067
|
+
return c(er, {
|
|
2068
|
+
class: "size-6 shrink-0"
|
|
2069
|
+
});
|
|
2070
|
+
}
|
|
2071
|
+
})];
|
|
2072
|
+
}
|
|
2073
|
+
});
|
|
2074
|
+
}
|
|
1978
2075
|
});
|
|
1979
2076
|
}
|
|
1980
2077
|
});
|
|
@@ -1985,98 +2082,84 @@ const ar = () => {
|
|
|
1985
2082
|
}
|
|
1986
2083
|
})
|
|
1987
2084
|
});
|
|
1988
|
-
}
|
|
1989
|
-
|
|
1990
|
-
label: "Back Camera 2"
|
|
1991
|
-
}, {
|
|
1992
|
-
value: "2",
|
|
1993
|
-
label: "Back Triple Camera"
|
|
1994
|
-
}, {
|
|
1995
|
-
value: "1",
|
|
1996
|
-
label: "Back Dual Wide Camera"
|
|
1997
|
-
}, {
|
|
1998
|
-
value: "3",
|
|
1999
|
-
label: "Front Camera 5"
|
|
2000
|
-
}, {
|
|
2001
|
-
value: "4",
|
|
2002
|
-
label: "Some random desktop camera"
|
|
2003
|
-
}];
|
|
2004
|
-
var re = /* @__PURE__ */ S("<span class=sr-only>"), or = /* @__PURE__ */ S("<div class=justify-self-end>"), ir = /* @__PURE__ */ S('<div class="z-2 relative gap-2 grid justify-between items-center grid-cols-[1fr_auto_1fr] py-4 color-white lerp:px-3@xs,8@lg"><div class="justify-self-start flex flex-nowrap gap-4 auto-cols-auto"></div><div class="justify-self-center min-w-0 w-full">'), sr = /* @__PURE__ */ S("<button>");
|
|
2085
|
+
};
|
|
2086
|
+
var ae = /* @__PURE__ */ y("<span class=sr-only>"), or = /* @__PURE__ */ y("<div class=justify-self-end>"), ir = /* @__PURE__ */ y('<div class="z-2 relative gap-2 grid justify-between items-center grid-cols-[1fr_auto_1fr] py-4 color-white lerp:px-3@xs,8@lg"><div class="justify-self-start flex flex-nowrap gap-4 auto-cols-auto"></div><div class="justify-self-center min-w-0 w-full">'), sr = /* @__PURE__ */ y("<button>");
|
|
2005
2087
|
const lr = () => {
|
|
2006
2088
|
const {
|
|
2007
|
-
dismountCameraUi:
|
|
2089
|
+
dismountCameraUi: r,
|
|
2008
2090
|
cameraManagerSolidStore: e,
|
|
2009
|
-
cameraManager:
|
|
2091
|
+
cameraManager: t,
|
|
2010
2092
|
showMirrorCameraButton: a,
|
|
2011
2093
|
showTorchButton: n,
|
|
2012
2094
|
showCloseButton: o
|
|
2013
2095
|
} = j(), {
|
|
2014
2096
|
t: i
|
|
2015
|
-
} =
|
|
2016
|
-
const
|
|
2017
|
-
|
|
2018
|
-
},
|
|
2019
|
-
|
|
2097
|
+
} = ee(), s = e((h) => h.mirrorX), l = e((h) => h.selectedCamera), f = e((h) => h.cameras), g = e((h) => h.playbackState !== "idle"), p = e((h) => h.selectedCamera?.torchEnabled), S = () => l()?.torchSupported, m = () => {
|
|
2098
|
+
const h = l();
|
|
2099
|
+
h && h.toggleTorch();
|
|
2100
|
+
}, d = () => {
|
|
2101
|
+
t.setCameraMirrorX(!e.getState().mirrorX);
|
|
2020
2102
|
};
|
|
2021
|
-
return
|
|
2103
|
+
return c(te, {
|
|
2022
2104
|
children: () => (() => {
|
|
2023
|
-
var
|
|
2024
|
-
return
|
|
2105
|
+
var h = ir(), C = h.firstChild, v = C.nextSibling;
|
|
2106
|
+
return w(C, c(k, {
|
|
2025
2107
|
get when() {
|
|
2026
|
-
return a &&
|
|
2108
|
+
return a && g();
|
|
2027
2109
|
},
|
|
2028
2110
|
get children() {
|
|
2029
|
-
return
|
|
2111
|
+
return c(ne, {
|
|
2030
2112
|
part: "mirror-camera-button-part",
|
|
2031
2113
|
get tooltipLabel() {
|
|
2032
2114
|
return i.mirror_camera;
|
|
2033
2115
|
},
|
|
2034
|
-
onClick: () =>
|
|
2116
|
+
onClick: () => d(),
|
|
2035
2117
|
get children() {
|
|
2036
2118
|
return [(() => {
|
|
2037
|
-
var
|
|
2038
|
-
return
|
|
2039
|
-
})(),
|
|
2040
|
-
class:
|
|
2119
|
+
var b = ae();
|
|
2120
|
+
return w(b, () => i.mirror_camera), b;
|
|
2121
|
+
})(), c(Kt, {
|
|
2122
|
+
class: `size-6 shrink-0 transition-transform duration-300
|
|
2123
|
+
ease-in-out`,
|
|
2041
2124
|
get style() {
|
|
2042
2125
|
return {
|
|
2043
|
-
transform:
|
|
2126
|
+
transform: s() ? "scaleX(-1)" : "scaleX(1)"
|
|
2044
2127
|
};
|
|
2045
2128
|
}
|
|
2046
2129
|
})];
|
|
2047
2130
|
}
|
|
2048
2131
|
});
|
|
2049
2132
|
}
|
|
2050
|
-
}), null),
|
|
2133
|
+
}), null), w(C, c(k, {
|
|
2051
2134
|
get when() {
|
|
2052
|
-
return
|
|
2135
|
+
return Se(() => !!(n && S()))() && g();
|
|
2053
2136
|
},
|
|
2054
2137
|
get children() {
|
|
2055
|
-
return
|
|
2138
|
+
return c(ne, {
|
|
2056
2139
|
part: "torch-button-part",
|
|
2057
|
-
onClick: () =>
|
|
2140
|
+
onClick: () => m(),
|
|
2058
2141
|
get tooltipLabel() {
|
|
2059
2142
|
return i.torch;
|
|
2060
2143
|
},
|
|
2061
2144
|
get children() {
|
|
2062
|
-
return [
|
|
2145
|
+
return [c(k, {
|
|
2063
2146
|
get when() {
|
|
2064
|
-
return !
|
|
2147
|
+
return !p();
|
|
2065
2148
|
},
|
|
2066
2149
|
get children() {
|
|
2067
2150
|
return [(() => {
|
|
2068
|
-
var
|
|
2069
|
-
return
|
|
2070
|
-
})(),
|
|
2151
|
+
var b = ae();
|
|
2152
|
+
return w(b, () => i.torch), b;
|
|
2153
|
+
})(), c(Xt, {
|
|
2071
2154
|
class: "size-6 shrink-0"
|
|
2072
2155
|
})];
|
|
2073
2156
|
}
|
|
2074
|
-
}),
|
|
2157
|
+
}), c(k, {
|
|
2075
2158
|
get when() {
|
|
2076
|
-
return
|
|
2159
|
+
return p();
|
|
2077
2160
|
},
|
|
2078
2161
|
get children() {
|
|
2079
|
-
return
|
|
2162
|
+
return c(Wt, {
|
|
2080
2163
|
class: "size-6 shrink-0"
|
|
2081
2164
|
});
|
|
2082
2165
|
}
|
|
@@ -2084,235 +2167,223 @@ const lr = () => {
|
|
|
2084
2167
|
}
|
|
2085
2168
|
});
|
|
2086
2169
|
}
|
|
2087
|
-
}), null),
|
|
2170
|
+
}), null), w(v, c(k, {
|
|
2088
2171
|
get when() {
|
|
2089
|
-
return
|
|
2172
|
+
return f().length > 1;
|
|
2090
2173
|
},
|
|
2091
2174
|
get children() {
|
|
2092
|
-
return
|
|
2175
|
+
return c(nr, {});
|
|
2093
2176
|
}
|
|
2094
|
-
})),
|
|
2177
|
+
})), w(h, c(k, {
|
|
2095
2178
|
when: o,
|
|
2096
2179
|
get children() {
|
|
2097
|
-
var
|
|
2098
|
-
return
|
|
2180
|
+
var b = or();
|
|
2181
|
+
return w(b, c(ne, {
|
|
2099
2182
|
part: "close-button-part",
|
|
2100
|
-
onClick: () =>
|
|
2183
|
+
onClick: () => r(),
|
|
2101
2184
|
get tooltipLabel() {
|
|
2102
2185
|
return i.close;
|
|
2103
2186
|
},
|
|
2104
2187
|
get children() {
|
|
2105
2188
|
return [(() => {
|
|
2106
|
-
var
|
|
2107
|
-
return
|
|
2108
|
-
})(),
|
|
2189
|
+
var E = ae();
|
|
2190
|
+
return w(E, () => i.close), E;
|
|
2191
|
+
})(), c(jt, {
|
|
2109
2192
|
class: "size-6 shrink-0"
|
|
2110
2193
|
})];
|
|
2111
2194
|
}
|
|
2112
|
-
})),
|
|
2195
|
+
})), b;
|
|
2113
2196
|
}
|
|
2114
|
-
}), null),
|
|
2197
|
+
}), null), h;
|
|
2115
2198
|
})()
|
|
2116
2199
|
});
|
|
2117
|
-
},
|
|
2200
|
+
}, ne = (r) => c(Q.Root, {
|
|
2118
2201
|
get children() {
|
|
2119
|
-
return [
|
|
2202
|
+
return [c(Q.Trigger, J(r, {
|
|
2120
2203
|
asChild: (e) => (() => {
|
|
2121
|
-
var
|
|
2122
|
-
return
|
|
2123
|
-
class: `rounded-full bg-
|
|
2124
|
-
size-12 appearance-none border-none
|
|
2125
|
-
|
|
2204
|
+
var t = sr();
|
|
2205
|
+
return $(t, J(() => Be(e()), {
|
|
2206
|
+
class: `btn-focus rounded-full bg-gray-550/70 backdrop-blur grid
|
|
2207
|
+
place-items-center size-12 appearance-none border-none
|
|
2208
|
+
cursor-pointer`
|
|
2209
|
+
}), !1, !0), w(t, () => r.children), t;
|
|
2126
2210
|
})()
|
|
2127
|
-
})),
|
|
2211
|
+
})), c(Q.Positioner, {
|
|
2128
2212
|
get children() {
|
|
2129
|
-
return
|
|
2130
|
-
class: `bg-
|
|
2213
|
+
return c(Q.Content, {
|
|
2214
|
+
class: `bg-gray-550/70 backdrop-blur color-white text-align-center p-2
|
|
2131
2215
|
rounded-md text-sm drop-shadow-md`,
|
|
2132
2216
|
get children() {
|
|
2133
|
-
return
|
|
2217
|
+
return r.tooltipLabel;
|
|
2134
2218
|
}
|
|
2135
2219
|
});
|
|
2136
2220
|
}
|
|
2137
2221
|
})];
|
|
2138
2222
|
}
|
|
2139
|
-
}), cr = (
|
|
2223
|
+
}), cr = (r, e, t) => Ke((a) => (w(e, r(), e.firstChild ? null : void 0), () => {
|
|
2140
2224
|
a(), e.textContent = "";
|
|
2141
|
-
}),
|
|
2142
|
-
var ur = /* @__PURE__ */
|
|
2143
|
-
const dr = (
|
|
2144
|
-
const e =
|
|
2225
|
+
}), t);
|
|
2226
|
+
var ur = /* @__PURE__ */ y("<div>");
|
|
2227
|
+
const dr = (r) => {
|
|
2228
|
+
const e = ke(), [t, a] = Ye(r, ["children", "disableShadowRoot", "getRef"]);
|
|
2145
2229
|
return (() => {
|
|
2146
2230
|
var n = ur();
|
|
2147
|
-
return
|
|
2148
|
-
if (
|
|
2231
|
+
return V((o) => {
|
|
2232
|
+
if (t.disableShadowRoot)
|
|
2149
2233
|
return;
|
|
2150
2234
|
const i = o.attachShadow({
|
|
2151
2235
|
mode: "open"
|
|
2152
2236
|
});
|
|
2153
|
-
cr(() =>
|
|
2154
|
-
}, n),
|
|
2237
|
+
cr(() => Se(() => t.children), i, e);
|
|
2238
|
+
}, n), $(n, a, !1, !0), w(n, c(k, {
|
|
2155
2239
|
get when() {
|
|
2156
|
-
return
|
|
2240
|
+
return t.disableShadowRoot;
|
|
2157
2241
|
},
|
|
2158
2242
|
get children() {
|
|
2159
|
-
return
|
|
2243
|
+
return t.children;
|
|
2160
2244
|
}
|
|
2161
2245
|
})), n;
|
|
2162
2246
|
})();
|
|
2163
|
-
}, hr = ":where(html){line-height:1.15;-webkit-text-size-adjust:100%;text-size-adjust:100%}:where(h1){font-size:2em;margin-block-end:.67em;margin-block-start:.67em}:where(dl,ol,ul) :where(dl,ol,ul){margin-block-end:0;margin-block-start:0}:where(hr){box-sizing:content-box;color:inherit;height:0}:where(abbr[title]){text-decoration:underline;text-decoration:underline dotted}:where(b,strong){font-weight:bolder}:where(code,kbd,pre,samp){font-family:monospace,monospace;font-size:1em}:where(small){font-size:80%}:where(table){border-color:currentColor;text-indent:0}:where(button,input,select){margin:0}:where(button){text-transform:none}:where(button,input:is([type=button i],[type=reset i],[type=submit i])){-webkit-appearance:button}:where(progress){vertical-align:baseline}:where(select){text-transform:none}:where(textarea){margin:0}:where(input[type=search i]){-webkit-appearance:textfield;outline-offset:-2px}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}::-webkit-input-placeholder{color:inherit;opacity:.54}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}:where(button,input:is([type=button i],[type=color i],[type=reset i],[type=submit i]))::-moz-focus-inner{border-style:none;padding:0}:where(button,input:is([type=button i],[type=color i],[type=reset i],[type=submit i]))::-moz-focusring{outline:1px dotted ButtonText}:where(:-moz-ui-invalid){box-shadow:none}:where(dialog){background-color:#fff;border:solid;color:#000;height:-moz-fit-content;height:fit-content;left:0;margin:auto;padding:1em;position:absolute;right:0;width:-moz-fit-content;width:fit-content}:where(dialog:not([open])){display:none}:where(summary){display:list-item}", mr = ":host{font-family:var(--mb-ui-font);line-height:1.15;isolation:isolate;box-sizing:border-box}*,*:before,*:after{box-sizing:border-box;margin:0;padding:0}p,h1,h2,h3,h4,h5,h6{overflow-wrap:break-word}code,pre{font-family:var(--mb-monospace-font-stack)}svg path{pointer-events:none}img,picture,video,canvas,svg{display:block;max-width:100%}img{pointer-events:none;user-select:none}:where(input,button,textarea,select){font:inherit}:where(button,select){cursor:pointer;color:inherit;font:inherit}:where(p,h1,h2,h3,h4,h5,h6){overflow-wrap:break-word}",
|
|
2247
|
+
}, hr = ":where(html){line-height:1.15;-webkit-text-size-adjust:100%;text-size-adjust:100%}:where(h1){font-size:2em;margin-block-end:.67em;margin-block-start:.67em}:where(dl,ol,ul) :where(dl,ol,ul){margin-block-end:0;margin-block-start:0}:where(hr){box-sizing:content-box;color:inherit;height:0}:where(abbr[title]){text-decoration:underline;text-decoration:underline dotted}:where(b,strong){font-weight:bolder}:where(code,kbd,pre,samp){font-family:monospace,monospace;font-size:1em}:where(small){font-size:80%}:where(table){border-color:currentColor;text-indent:0}:where(button,input,select){margin:0}:where(button){text-transform:none}:where(button,input:is([type=button i],[type=reset i],[type=submit i])){-webkit-appearance:button}:where(progress){vertical-align:baseline}:where(select){text-transform:none}:where(textarea){margin:0}:where(input[type=search i]){-webkit-appearance:textfield;outline-offset:-2px}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}::-webkit-input-placeholder{color:inherit;opacity:.54}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}:where(button,input:is([type=button i],[type=color i],[type=reset i],[type=submit i]))::-moz-focus-inner{border-style:none;padding:0}:where(button,input:is([type=button i],[type=color i],[type=reset i],[type=submit i]))::-moz-focusring{outline:1px dotted ButtonText}:where(:-moz-ui-invalid){box-shadow:none}:where(dialog){background-color:#fff;border:solid;color:#000;height:-moz-fit-content;height:fit-content;left:0;margin:auto;padding:1em;position:absolute;right:0;width:-moz-fit-content;width:fit-content}:where(dialog:not([open])){display:none}:where(summary){display:list-item}", mr = ":host{font-family:var(--mb-ui-font);line-height:1.15;isolation:isolate;box-sizing:border-box}*,*:before,*:after{box-sizing:border-box;margin:0;padding:0}p,h1,h2,h3,h4,h5,h6{overflow-wrap:break-word}code,pre{font-family:var(--mb-monospace-font-stack)}svg path{pointer-events:none}img,picture,video,canvas,svg{display:block;max-width:100%}img{pointer-events:none;user-select:none}:where(input,button,textarea,select){font:inherit}:where(button,select){cursor:pointer;color:inherit;font:inherit}:where(p,h1,h2,h3,h4,h5,h6){overflow-wrap:break-word}", gr = ':host{--mb-system-font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;--mb-monospace-font-stack: Menlo, Consolas, "Ubuntu Mono", "Roboto Mono", "DejaVu Sans Mono", monospace;--mb-ui-font: var(--mb-system-font-stack);--mb-size: 1;--color-accent-25-rgb-value: 242 247 255;--color-accent-50-rgb-value: 231 240 255;--color-accent-100-rgb-value: 220 234 255;--color-accent-200-rgb-value: 198 221 255;--color-accent-300-rgb-value: 158 197 255;--color-accent-400-rgb-value: 111 169 255;--color-accent-500-rgb-value: 58 137 253;--color-accent-600-rgb-value: 0 98 242;--color-accent-700-rgb-value: 0 80 197;--color-accent-800-rgb-value: 0 64 157;--color-accent-900-rgb-value: 0 54 133;--color-error-25-rgb-value: 255 248 249;--color-error-50-rgb-value: 255 241 242;--color-error-100-rgb-value: 255 228 230;--color-error-200-rgb-value: 254 205 211;--color-error-300-rgb-value: 253 164 175;--color-error-400-rgb-value: 251 113 133;--color-error-500-rgb-value: 244 63 94;--color-error-600-rgb-value: 225 29 72;--color-error-700-rgb-value: 190 18 60;--color-error-800-rgb-value: 136 19 39;--color-error-900-rgb-value: 89 13 40;--color-success-25-rgb-value: 245 254 250;--color-success-50-rgb-value: 236 253 245;--color-success-100-rgb-value: 209 250 229;--color-success-200-rgb-value: 167 243 208;--color-success-300-rgb-value: 110 231 183;--color-success-400-rgb-value: 52 211 153;--color-success-500-rgb-value: 16 185 144;--color-success-600-rgb-value: 22 163 138;--color-success-700-rgb-value: 39 121 106;--color-success-800-rgb-value: 23 92 79;--color-success-900-rgb-value: 12 59 50;--color-warning-25-rgb-value: 255 253 243;--color-warning-50-rgb-value: 254 252 232;--color-warning-100-rgb-value: 254 249 195;--color-warning-200-rgb-value: 254 240 138;--color-warning-300-rgb-value: 253 229 99;--color-warning-400-rgb-value: 252 218 59;--color-warning-500-rgb-value: 250 204 21;--color-warning-600-rgb-value: 234 179 8;--color-warning-700-rgb-value: 190 142 48;--color-warning-800-rgb-value: 132 83 28;--color-warning-900-rgb-value: 80 29 10;--color-deep-blue-25-rgb-value: 249 252 255;--color-deep-blue-50-rgb-value: 243 249 254;--color-deep-blue-100-rgb-value: 231 242 251;--color-deep-blue-200-rgb-value: 201 218 241;--color-deep-blue-300-rgb-value: 162 185 216;--color-deep-blue-400-rgb-value: 93 128 182;--color-deep-blue-500-rgb-value: 60 100 161;--color-deep-blue-600-rgb-value: 28 68 129;--color-deep-blue-700-rgb-value: 24 53 97;--color-deep-blue-800-rgb-value: 20 38 65;--color-deep-blue-900-rgb-value: 6 23 49;--color-light-blue-25-rgb-value: 248 251 253;--color-light-blue-50-rgb-value: 240 247 251;--color-light-blue-100-rgb-value: 228 238 244;--color-light-blue-200-rgb-value: 215 229 238;--color-light-blue-300-rgb-value: 190 218 237;--color-light-blue-400-rgb-value: 159 202 232;--color-light-blue-500-rgb-value: 135 180 211;--color-light-blue-600-rgb-value: 104 157 193;--color-light-blue-700-rgb-value: 78 129 164;--color-light-blue-800-rgb-value: 67 109 138;--color-light-blue-900-rgb-value: 55 84 104;--color-gray-50-rgb-value: 249 250 251;--color-gray-100-rgb-value: 243 244 246;--color-gray-200-rgb-value: 229 231 235;--color-gray-300-rgb-value: 209 213 219;--color-gray-400-rgb-value: 156 163 175;--color-gray-500-rgb-value: 107 114 128;--color-gray-550-rgb-value: 102 102 102;--color-gray-600-rgb-value: 75 85 99;--color-gray-700-rgb-value: 55 65 81;--color-gray-800-rgb-value: 31 41 55;--color-blue-gray-50-rgb-value: 74 74 74;--color-blue-gray-100-rgb-value: 60 60 60;--color-blue-gray-200-rgb-value: 50 50 50;--color-blue-gray-300-rgb-value: 45 45 45;--color-blue-gray-400-rgb-value: 34 34 34;--color-blue-gray-500-rgb-value: 31 31 31;--color-blue-gray-600-rgb-value: 28 28 30;--color-blue-gray-700-rgb-value: 27 27 27;--color-blue-gray-800-rgb-value: 24 24 24;--color-blue-gray-900-rgb-value: 15 15 15;--color-black-rgb-value: 0 0 0;--color-white-rgb-value: 255 255 255;--color-primary: var(--color-accent-600-rgb-value);--color-error: var(--color-error-500-rgb-value);--color-success: var(--color-success-500-rgb-value);--color-warning: var(--color-warning-500-rgb-value);--color-deep-blue: var(--color-deep-blue-800-rgb-value);--color-light-blue: var(--color-light-blue-200-rgb-value);accent-color:var(--color-primary);caret-color:red}', fr = {
|
|
2164
2248
|
feedbackLayer: null,
|
|
2165
2249
|
overlayLayer: null,
|
|
2166
2250
|
owner: null
|
|
2167
|
-
},
|
|
2251
|
+
}, B = de()(
|
|
2168
2252
|
// this is important! Otherwise, solid-zustand will start mutating the initial state
|
|
2169
|
-
|
|
2170
|
-
),
|
|
2253
|
+
ue(() => structuredClone(fr))
|
|
2254
|
+
), ce = Te(B), we = () => {
|
|
2171
2255
|
};
|
|
2172
|
-
function br(
|
|
2173
|
-
if (
|
|
2174
|
-
return { observe:
|
|
2175
|
-
const
|
|
2176
|
-
return
|
|
2177
|
-
observe: (a) =>
|
|
2178
|
-
unobserve:
|
|
2256
|
+
function br(r, e) {
|
|
2257
|
+
if (He)
|
|
2258
|
+
return { observe: we, unobserve: we };
|
|
2259
|
+
const t = new ResizeObserver(r);
|
|
2260
|
+
return he(t.disconnect.bind(t)), {
|
|
2261
|
+
observe: (a) => t.observe(a, e),
|
|
2262
|
+
unobserve: t.unobserve.bind(t)
|
|
2179
2263
|
};
|
|
2180
2264
|
}
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
o = 1 - e / i;
|
|
2187
|
-
} else {
|
|
2188
|
-
const i = n * r;
|
|
2189
|
-
o = 1 - t / i;
|
|
2190
|
-
}
|
|
2191
|
-
return o < 0.1 ? "cover" : "contain";
|
|
2192
|
-
};
|
|
2193
|
-
function vr(t, e, r, a) {
|
|
2194
|
-
const n = t / r, o = e / a, i = Math.max(n, o);
|
|
2195
|
-
if (n >= o) {
|
|
2196
|
-
const l = Math.round(e / i);
|
|
2197
|
-
return { x: 0, y: Math.round((a - l) / 2), width: r, height: l };
|
|
2198
|
-
} else {
|
|
2199
|
-
const l = Math.round(t / i);
|
|
2200
|
-
return { x: Math.round((r - l) / 2), y: 0, width: l, height: a };
|
|
2201
|
-
}
|
|
2202
|
-
}
|
|
2203
|
-
const wr = "_dialogPositioner_worsp_1", yr = "_dialogBackdrop_worsp_5", Sr = "_dialogContent_worsp_9", Cr = "_large_worsp_13", kr = "_compact_worsp_16", Er = "_dialogTitle_worsp_30", _r = "_contentOut_worsp_34", Tr = "_closeButton_worsp_38", Mr = "_closeButtonInner_worsp_44", xr = "_primaryActionButton_worsp_49", Rr = "_secondaryActionButton_worsp_53", Ar = "_actions_worsp_57", $r = "_alertTitle_worsp_64", Fr = "_alertText_worsp_68", _ = {
|
|
2265
|
+
var pr = /* @__PURE__ */ y('<svg xmlns=http://www.w3.org/2000/svg fill=none viewBox="0 0 14 14"><path fill=#000 fill-rule=evenodd d="M13.707 1.707A1 1 0 0 0 12.293.293L7 5.586 1.707.293A1 1 0 0 0 .293 1.707L5.586 7 .293 12.293a1 1 0 1 0 1.414 1.414L7 8.414l5.293 5.293a1 1 0 0 0 1.414-1.414L8.414 7z"clip-rule=evenodd>');
|
|
2266
|
+
const vr = (r = {}) => (() => {
|
|
2267
|
+
var e = pr();
|
|
2268
|
+
return $(e, r, !0, !0), e;
|
|
2269
|
+
})(), wr = "_dialogPositioner_15i6c_1", Sr = "_dialogBackdrop_15i6c_10", yr = "_dialogContent_15i6c_14", Cr = "_large_15i6c_18", Er = "_compact_15i6c_21", kr = "_dialogTitle_15i6c_45", Tr = "_contentOut_15i6c_49", _r = "_closeButton_15i6c_53", Mr = "_closeButtonInner_15i6c_59", xr = "_primaryActionButton_15i6c_63", Rr = "_secondaryActionButton_15i6c_67", Ar = "_actions_15i6c_71", Ir = "_alertTitle_15i6c_79", $r = "_alertText_15i6c_83", T = {
|
|
2204
2270
|
dialogPositioner: wr,
|
|
2205
|
-
dialogBackdrop:
|
|
2206
|
-
dialogContent:
|
|
2271
|
+
dialogBackdrop: Sr,
|
|
2272
|
+
dialogContent: yr,
|
|
2207
2273
|
large: Cr,
|
|
2208
|
-
compact:
|
|
2209
|
-
dialogTitle:
|
|
2210
|
-
contentOut:
|
|
2211
|
-
closeButton:
|
|
2274
|
+
compact: Er,
|
|
2275
|
+
dialogTitle: kr,
|
|
2276
|
+
contentOut: Tr,
|
|
2277
|
+
closeButton: _r,
|
|
2212
2278
|
closeButtonInner: Mr,
|
|
2213
2279
|
primaryActionButton: xr,
|
|
2214
2280
|
secondaryActionButton: Rr,
|
|
2215
2281
|
actions: Ar,
|
|
2216
|
-
alertTitle:
|
|
2217
|
-
alertText:
|
|
2282
|
+
alertTitle: Ir,
|
|
2283
|
+
alertText: $r
|
|
2218
2284
|
};
|
|
2219
|
-
var Dr = /* @__PURE__ */
|
|
2220
|
-
const
|
|
2285
|
+
var Dr = /* @__PURE__ */ y("<div>"), Fr = /* @__PURE__ */ y("<p>"), Lr = /* @__PURE__ */ y("<span>"), zr = /* @__PURE__ */ y("<div><button></button><button>");
|
|
2286
|
+
const Nr = (r) => {
|
|
2221
2287
|
const e = () => {
|
|
2222
|
-
switch (
|
|
2288
|
+
switch (r.modalStyle) {
|
|
2223
2289
|
case "compact":
|
|
2224
|
-
return
|
|
2290
|
+
return T.compact;
|
|
2225
2291
|
case "large":
|
|
2226
|
-
return
|
|
2292
|
+
return T.compact;
|
|
2227
2293
|
case "default":
|
|
2228
2294
|
default:
|
|
2229
2295
|
return;
|
|
2230
2296
|
}
|
|
2231
2297
|
};
|
|
2232
|
-
return
|
|
2233
|
-
children: () =>
|
|
2234
|
-
onFocusOutside: (
|
|
2235
|
-
onInteractOutside: (
|
|
2298
|
+
return c(te, {
|
|
2299
|
+
children: (t) => c(I.Root, J({
|
|
2300
|
+
onFocusOutside: (a) => a.preventDefault(),
|
|
2301
|
+
onInteractOutside: (a) => a.preventDefault(),
|
|
2302
|
+
initialFocusEl: () => t.querySelector('[role="dialog"]'),
|
|
2236
2303
|
restoreFocus: !0,
|
|
2237
2304
|
unmountOnExit: !0,
|
|
2238
2305
|
lazyMount: !0
|
|
2239
|
-
},
|
|
2306
|
+
}, r, {
|
|
2240
2307
|
get children() {
|
|
2241
|
-
return
|
|
2308
|
+
return c(k, {
|
|
2242
2309
|
get when() {
|
|
2243
|
-
return
|
|
2310
|
+
return r.open;
|
|
2244
2311
|
},
|
|
2245
2312
|
get children() {
|
|
2246
|
-
return
|
|
2313
|
+
return c(ye, {
|
|
2247
2314
|
get mount() {
|
|
2248
|
-
return
|
|
2315
|
+
return r.mountTarget;
|
|
2249
2316
|
},
|
|
2250
2317
|
get children() {
|
|
2251
|
-
return
|
|
2318
|
+
return c(I.Positioner, {
|
|
2252
2319
|
get class() {
|
|
2253
|
-
return
|
|
2320
|
+
return T.dialogPositioner;
|
|
2254
2321
|
},
|
|
2255
2322
|
get children() {
|
|
2256
|
-
return [
|
|
2323
|
+
return [c(I.Backdrop, {
|
|
2257
2324
|
get class() {
|
|
2258
|
-
return
|
|
2325
|
+
return T.dialogBackdrop;
|
|
2259
2326
|
}
|
|
2260
|
-
}),
|
|
2327
|
+
}), c(I.Content, {
|
|
2261
2328
|
get class() {
|
|
2262
|
-
return `${
|
|
2329
|
+
return `${T.dialogContent} ${e()}`;
|
|
2263
2330
|
},
|
|
2264
2331
|
get children() {
|
|
2265
|
-
return [
|
|
2332
|
+
return [c(k, {
|
|
2266
2333
|
get when() {
|
|
2267
|
-
return
|
|
2334
|
+
return r.showCloseButton;
|
|
2268
2335
|
},
|
|
2269
2336
|
get children() {
|
|
2270
|
-
return
|
|
2337
|
+
return c(I.CloseTrigger, {
|
|
2338
|
+
"aria-label": "Close",
|
|
2271
2339
|
get class() {
|
|
2272
|
-
return
|
|
2340
|
+
return T.closeButton;
|
|
2273
2341
|
},
|
|
2274
2342
|
get onClick() {
|
|
2275
|
-
return
|
|
2343
|
+
return r.onCloseClicked;
|
|
2276
2344
|
},
|
|
2277
2345
|
get children() {
|
|
2278
|
-
|
|
2279
|
-
|
|
2346
|
+
return c(vr, {
|
|
2347
|
+
get class() {
|
|
2348
|
+
return T.closeButtonInner;
|
|
2349
|
+
}
|
|
2350
|
+
});
|
|
2280
2351
|
}
|
|
2281
2352
|
});
|
|
2282
2353
|
}
|
|
2283
|
-
}),
|
|
2354
|
+
}), c(k, {
|
|
2284
2355
|
get when() {
|
|
2285
|
-
return
|
|
2356
|
+
return r.headerImage;
|
|
2286
2357
|
},
|
|
2287
2358
|
get children() {
|
|
2288
|
-
return
|
|
2359
|
+
return r.headerImage;
|
|
2289
2360
|
}
|
|
2290
|
-
}),
|
|
2361
|
+
}), c(k, {
|
|
2291
2362
|
get when() {
|
|
2292
|
-
return
|
|
2363
|
+
return r.header;
|
|
2293
2364
|
},
|
|
2294
|
-
children: (
|
|
2365
|
+
children: (a) => c(I.Title, {
|
|
2295
2366
|
get class() {
|
|
2296
|
-
return
|
|
2367
|
+
return T.dialogTitle;
|
|
2297
2368
|
},
|
|
2298
2369
|
get children() {
|
|
2299
|
-
return
|
|
2370
|
+
return a();
|
|
2300
2371
|
}
|
|
2301
2372
|
})
|
|
2302
|
-
}),
|
|
2373
|
+
}), c(I.Description, {
|
|
2303
2374
|
get class() {
|
|
2304
|
-
return
|
|
2375
|
+
return T.contentOut;
|
|
2305
2376
|
},
|
|
2306
2377
|
get children() {
|
|
2307
|
-
return
|
|
2378
|
+
return r.children;
|
|
2308
2379
|
}
|
|
2309
|
-
}),
|
|
2380
|
+
}), c(k, {
|
|
2310
2381
|
get when() {
|
|
2311
|
-
return
|
|
2382
|
+
return r.actions;
|
|
2312
2383
|
},
|
|
2313
2384
|
get children() {
|
|
2314
|
-
var
|
|
2315
|
-
return
|
|
2385
|
+
var a = Dr();
|
|
2386
|
+
return w(a, () => r.actions), a;
|
|
2316
2387
|
}
|
|
2317
2388
|
})];
|
|
2318
2389
|
}
|
|
@@ -2326,214 +2397,238 @@ const Br = (t) => {
|
|
|
2326
2397
|
}
|
|
2327
2398
|
}))
|
|
2328
2399
|
});
|
|
2329
|
-
},
|
|
2330
|
-
mountTarget:
|
|
2400
|
+
}, Pr = ({
|
|
2401
|
+
mountTarget: r,
|
|
2331
2402
|
header: e,
|
|
2332
|
-
text:
|
|
2403
|
+
text: t,
|
|
2333
2404
|
open: a,
|
|
2334
2405
|
onPrimaryClick: n,
|
|
2335
2406
|
onSecondaryClick: o,
|
|
2336
2407
|
primaryButtonText: i = "Retry",
|
|
2337
|
-
secondaryButtonText:
|
|
2338
|
-
}) => {
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
return (() =>
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
return y(d, r), H(() => V(d, _.alertText)), d;
|
|
2369
|
-
}
|
|
2370
|
-
});
|
|
2371
|
-
};
|
|
2372
|
-
qe(["click"]);
|
|
2373
|
-
const Pr = () => {
|
|
2408
|
+
secondaryButtonText: s = "Cancel"
|
|
2409
|
+
}) => c(Nr, {
|
|
2410
|
+
mountTarget: r,
|
|
2411
|
+
get header() {
|
|
2412
|
+
return (() => {
|
|
2413
|
+
var l = Lr();
|
|
2414
|
+
return w(l, e), K(() => H(l, T.alertTitle)), l;
|
|
2415
|
+
})();
|
|
2416
|
+
},
|
|
2417
|
+
open: a,
|
|
2418
|
+
get actions() {
|
|
2419
|
+
return (() => {
|
|
2420
|
+
var l = zr(), f = l.firstChild, g = f.nextSibling;
|
|
2421
|
+
return f.$$click = () => o(), w(f, s), g.$$click = () => n(), w(g, i), K((p) => {
|
|
2422
|
+
var S = T.actions, m = T.secondaryActionButton, d = T.primaryActionButton;
|
|
2423
|
+
return S !== p.e && H(l, p.e = S), m !== p.t && H(f, p.t = m), d !== p.a && H(g, p.a = d), p;
|
|
2424
|
+
}, {
|
|
2425
|
+
e: void 0,
|
|
2426
|
+
t: void 0,
|
|
2427
|
+
a: void 0
|
|
2428
|
+
}), l;
|
|
2429
|
+
})();
|
|
2430
|
+
},
|
|
2431
|
+
modalStyle: "compact",
|
|
2432
|
+
get children() {
|
|
2433
|
+
var l = Fr();
|
|
2434
|
+
return w(l, t), K(() => H(l, T.alertText)), l;
|
|
2435
|
+
}
|
|
2436
|
+
});
|
|
2437
|
+
We(["click"]);
|
|
2438
|
+
const Or = () => {
|
|
2374
2439
|
const {
|
|
2375
|
-
t
|
|
2376
|
-
} =
|
|
2440
|
+
t: r
|
|
2441
|
+
} = ee(), {
|
|
2377
2442
|
cameraManagerSolidStore: e,
|
|
2378
|
-
cameraManager:
|
|
2443
|
+
cameraManager: t,
|
|
2379
2444
|
dismountCameraUi: a
|
|
2380
|
-
} = j(), n = e((
|
|
2381
|
-
|
|
2445
|
+
} = j(), n = e((f) => f.errorState), o = ce((f) => f.overlayLayer), i = () => {
|
|
2446
|
+
const f = n();
|
|
2447
|
+
return f instanceof U && f.code === "PERMISSION_DENIED";
|
|
2448
|
+
}, s = () => i() ? r.camera_error_title : n() ? n().name : "", l = () => i() ? r.camera_error_details : n() ? n().name : "";
|
|
2449
|
+
return c(k, {
|
|
2382
2450
|
get when() {
|
|
2383
|
-
return
|
|
2451
|
+
return i();
|
|
2384
2452
|
},
|
|
2385
2453
|
get children() {
|
|
2386
|
-
return
|
|
2454
|
+
return c(Pr, {
|
|
2387
2455
|
get mountTarget() {
|
|
2388
2456
|
return o();
|
|
2389
2457
|
},
|
|
2390
2458
|
get header() {
|
|
2391
|
-
return
|
|
2459
|
+
return s();
|
|
2460
|
+
},
|
|
2461
|
+
get text() {
|
|
2462
|
+
return l();
|
|
2392
2463
|
},
|
|
2393
2464
|
open: !0,
|
|
2394
|
-
onPrimaryClick: () => void
|
|
2465
|
+
onPrimaryClick: () => void t.startCameraStream(),
|
|
2395
2466
|
onSecondaryClick: () => a(),
|
|
2396
2467
|
get primaryButtonText() {
|
|
2397
|
-
return
|
|
2468
|
+
return r.camera_error_primary_btn;
|
|
2398
2469
|
},
|
|
2399
2470
|
get secondaryButtonText() {
|
|
2400
|
-
return
|
|
2401
|
-
},
|
|
2402
|
-
get text() {
|
|
2403
|
-
return t.camera_error_details;
|
|
2471
|
+
return r.camera_error_cancel_btn;
|
|
2404
2472
|
}
|
|
2405
2473
|
});
|
|
2406
2474
|
}
|
|
2407
2475
|
});
|
|
2408
2476
|
};
|
|
2409
|
-
|
|
2410
|
-
|
|
2477
|
+
function Br(r, e) {
|
|
2478
|
+
let t;
|
|
2479
|
+
return function(...a) {
|
|
2480
|
+
const n = this;
|
|
2481
|
+
clearTimeout(t), t = setTimeout(() => {
|
|
2482
|
+
t = void 0, r.apply(n, a);
|
|
2483
|
+
}, e);
|
|
2484
|
+
};
|
|
2485
|
+
}
|
|
2486
|
+
const Vr = (r, e, t, a) => {
|
|
2487
|
+
const n = Math.max(r / t, e / a);
|
|
2488
|
+
let o = 0;
|
|
2489
|
+
if (r / t > e / a) {
|
|
2490
|
+
const i = n * a;
|
|
2491
|
+
o = 1 - e / i;
|
|
2492
|
+
} else {
|
|
2493
|
+
const i = n * t;
|
|
2494
|
+
o = 1 - r / i;
|
|
2495
|
+
}
|
|
2496
|
+
return o < 0.1 ? "cover" : "contain";
|
|
2497
|
+
};
|
|
2498
|
+
function Ur(r, e, t, a) {
|
|
2499
|
+
const n = r / t, o = e / a, i = Math.max(n, o);
|
|
2500
|
+
if (n >= o) {
|
|
2501
|
+
const s = Math.round(e / i);
|
|
2502
|
+
return { x: 0, y: Math.round((a - s) / 2), width: t, height: s };
|
|
2503
|
+
} else {
|
|
2504
|
+
const s = Math.round(r / i);
|
|
2505
|
+
return { x: Math.round((t - s) / 2), y: 0, width: s, height: a };
|
|
2506
|
+
}
|
|
2507
|
+
}
|
|
2508
|
+
var oe = /* @__PURE__ */ y("<style>"), qr = /* @__PURE__ */ y("<style id=camera-manager-style>"), jr = /* @__PURE__ */ y('<div class="bg-dark-500 color-white size-full relative min-h-[300px]"part=capture-screen-part><video part=video-element-part class="block absolute top-0 left-0 size-full"></video><div class="absolute top-0 left-0 w-full h-full z-1"id=feedback-layer></div><div class="absolute top-0 left-0 w-full h-full has-[[data-scope]]:z-2"id=overlay-layer>');
|
|
2509
|
+
const Ve = "capture-screen-host", Ue = () => {
|
|
2411
2510
|
const {
|
|
2412
|
-
cameraManager:
|
|
2511
|
+
cameraManager: r,
|
|
2413
2512
|
mountTarget: e,
|
|
2414
|
-
showCameraErrorModal:
|
|
2415
|
-
} = j(), [a, n] =
|
|
2416
|
-
function
|
|
2417
|
-
const
|
|
2418
|
-
if (!
|
|
2513
|
+
showCameraErrorModal: t
|
|
2514
|
+
} = j(), [a, n] = N(), [o, i] = N(), [s, l] = N(), f = () => e.parentNode === document.body, [g, p] = N("contain");
|
|
2515
|
+
function S() {
|
|
2516
|
+
const m = a();
|
|
2517
|
+
if (!m)
|
|
2419
2518
|
return;
|
|
2420
|
-
const
|
|
2421
|
-
if (
|
|
2519
|
+
const d = m.clientWidth, h = m.clientHeight, C = m.videoWidth, v = m.videoHeight;
|
|
2520
|
+
if (C === 0 || v === 0)
|
|
2422
2521
|
return;
|
|
2423
|
-
const
|
|
2424
|
-
if (
|
|
2425
|
-
const
|
|
2426
|
-
|
|
2522
|
+
const b = Vr(d, h, C, v);
|
|
2523
|
+
if (p(b), b === "cover") {
|
|
2524
|
+
const E = Ur(d, h, C, v);
|
|
2525
|
+
r.setExtractionArea(E);
|
|
2427
2526
|
} else
|
|
2428
|
-
|
|
2527
|
+
r.setExtractionArea({
|
|
2429
2528
|
x: 0,
|
|
2430
2529
|
y: 0,
|
|
2431
|
-
width:
|
|
2432
|
-
height:
|
|
2530
|
+
width: C,
|
|
2531
|
+
height: v
|
|
2433
2532
|
});
|
|
2434
2533
|
}
|
|
2435
|
-
return
|
|
2436
|
-
const
|
|
2437
|
-
if (!
|
|
2534
|
+
return Z(() => {
|
|
2535
|
+
const m = a();
|
|
2536
|
+
if (!m)
|
|
2438
2537
|
return;
|
|
2439
|
-
const {
|
|
2440
|
-
observe:
|
|
2441
|
-
unobserve:
|
|
2442
|
-
} = br(
|
|
2443
|
-
|
|
2444
|
-
|
|
2538
|
+
const d = Br(S, 100), {
|
|
2539
|
+
observe: h,
|
|
2540
|
+
unobserve: C
|
|
2541
|
+
} = br(d);
|
|
2542
|
+
h(m), m.addEventListener("resize", S), m.addEventListener("loadedmetadata", S), he(() => {
|
|
2543
|
+
C(m), m.removeEventListener("resize", S), m.removeEventListener("loadedmetadata", S);
|
|
2445
2544
|
});
|
|
2446
|
-
}),
|
|
2447
|
-
const
|
|
2448
|
-
|
|
2449
|
-
owner:
|
|
2545
|
+
}), Z(() => {
|
|
2546
|
+
const m = ke();
|
|
2547
|
+
m && ce.setState({
|
|
2548
|
+
owner: m
|
|
2450
2549
|
});
|
|
2451
|
-
}),
|
|
2452
|
-
const
|
|
2453
|
-
!
|
|
2454
|
-
feedbackLayer:
|
|
2455
|
-
overlayLayer:
|
|
2456
|
-
}),
|
|
2457
|
-
}),
|
|
2550
|
+
}), Je(() => {
|
|
2551
|
+
const m = a(), d = o(), h = s();
|
|
2552
|
+
!m || !d || !h || (ce.setState({
|
|
2553
|
+
feedbackLayer: d,
|
|
2554
|
+
overlayLayer: h
|
|
2555
|
+
}), r.initVideoElement(m));
|
|
2556
|
+
}), c(dr, {
|
|
2458
2557
|
get id() {
|
|
2459
|
-
return
|
|
2558
|
+
return f() ? void 0 : Ve;
|
|
2460
2559
|
},
|
|
2461
2560
|
get disableShadowRoot() {
|
|
2462
|
-
return
|
|
2561
|
+
return f();
|
|
2463
2562
|
},
|
|
2464
2563
|
get style() {
|
|
2465
|
-
return
|
|
2564
|
+
return f() ? {
|
|
2466
2565
|
height: "100%"
|
|
2467
2566
|
} : void 0;
|
|
2468
2567
|
},
|
|
2469
2568
|
get children() {
|
|
2470
2569
|
return [(() => {
|
|
2471
|
-
var
|
|
2472
|
-
return
|
|
2570
|
+
var m = oe();
|
|
2571
|
+
return w(m, gr), m;
|
|
2473
2572
|
})(), (() => {
|
|
2474
|
-
var
|
|
2475
|
-
return
|
|
2573
|
+
var m = oe();
|
|
2574
|
+
return w(m, hr), m;
|
|
2476
2575
|
})(), (() => {
|
|
2477
|
-
var
|
|
2478
|
-
return
|
|
2576
|
+
var m = oe();
|
|
2577
|
+
return w(m, mr), m;
|
|
2479
2578
|
})(), (() => {
|
|
2480
|
-
var
|
|
2481
|
-
return
|
|
2482
|
-
window.__mbCameraManagerCssCode && (
|
|
2483
|
-
},
|
|
2579
|
+
var m = qr();
|
|
2580
|
+
return V((d) => {
|
|
2581
|
+
window.__mbCameraManagerCssCode && (d.innerHTML = window.__mbCameraManagerCssCode);
|
|
2582
|
+
}, m), m;
|
|
2484
2583
|
})(), (() => {
|
|
2485
|
-
var
|
|
2486
|
-
return
|
|
2487
|
-
when:
|
|
2584
|
+
var m = jr(), d = m.firstChild, h = d.nextSibling, C = h.nextSibling;
|
|
2585
|
+
return w(m, c(lr, {}), d), V(n, d), V(i, h), V(l, C), w(m, c(k, {
|
|
2586
|
+
when: t,
|
|
2488
2587
|
get children() {
|
|
2489
|
-
return
|
|
2588
|
+
return c(Or, {});
|
|
2490
2589
|
}
|
|
2491
|
-
}), null),
|
|
2590
|
+
}), null), K((v) => (v = g()) != null ? d.style.setProperty("object-fit", v) : d.style.removeProperty("object-fit")), m;
|
|
2492
2591
|
})()];
|
|
2493
2592
|
}
|
|
2494
2593
|
});
|
|
2495
|
-
},
|
|
2594
|
+
}, Hr = () => {
|
|
2496
2595
|
const {
|
|
2497
|
-
t
|
|
2498
|
-
} =
|
|
2596
|
+
t: r
|
|
2597
|
+
} = ee(), [e, t] = N(!0), {
|
|
2499
2598
|
addOnDismountCallback: a
|
|
2500
2599
|
} = j();
|
|
2501
2600
|
return a(() => {
|
|
2502
|
-
|
|
2503
|
-
}),
|
|
2601
|
+
t(!1);
|
|
2602
|
+
}), c(ye, {
|
|
2504
2603
|
useShadow: !0,
|
|
2505
2604
|
get mount() {
|
|
2506
|
-
return document.getElementById(
|
|
2605
|
+
return document.getElementById(qe);
|
|
2507
2606
|
},
|
|
2508
|
-
ref: (n) => (n.id =
|
|
2607
|
+
ref: (n) => (n.id = Ve, n.style.zIndex = "1000", n.style.position = "fixed", n.id = "mb-camera-host", n),
|
|
2509
2608
|
get children() {
|
|
2510
|
-
return
|
|
2511
|
-
children: (n) =>
|
|
2609
|
+
return c(te, {
|
|
2610
|
+
children: (n) => c(I.Root, {
|
|
2512
2611
|
get open() {
|
|
2513
2612
|
return e();
|
|
2514
2613
|
},
|
|
2515
2614
|
lazyMount: !0,
|
|
2516
2615
|
unmountOnExit: !0,
|
|
2517
|
-
initialFocusEl: () =>
|
|
2518
|
-
const o = document.createElement("div");
|
|
2519
|
-
return o.tabIndex = -1, n.appendChild(o), setTimeout(() => {
|
|
2520
|
-
o.remove();
|
|
2521
|
-
}, 0), o;
|
|
2522
|
-
},
|
|
2616
|
+
initialFocusEl: () => n.querySelector('[role="dialog"]'),
|
|
2523
2617
|
get children() {
|
|
2524
|
-
return
|
|
2618
|
+
return c(I.Positioner, {
|
|
2525
2619
|
get children() {
|
|
2526
|
-
return
|
|
2620
|
+
return c(I.Content, {
|
|
2527
2621
|
"aria-labelledby": "dialog-title",
|
|
2528
|
-
class:
|
|
2622
|
+
class: `h-vh supports-[(height:100dvh)]:h-dvh top-0 left-0 w-full
|
|
2623
|
+
fixed`,
|
|
2529
2624
|
get children() {
|
|
2530
|
-
return [
|
|
2625
|
+
return [c(I.Title, {
|
|
2531
2626
|
class: "sr-only",
|
|
2532
2627
|
id: "dialog-title",
|
|
2533
2628
|
get children() {
|
|
2534
|
-
return
|
|
2629
|
+
return r.scan_document;
|
|
2535
2630
|
}
|
|
2536
|
-
}),
|
|
2631
|
+
}), c(Ue, {})];
|
|
2537
2632
|
}
|
|
2538
2633
|
});
|
|
2539
2634
|
}
|
|
@@ -2543,71 +2638,71 @@ const Be = "capture-screen-host", Oe = () => {
|
|
|
2543
2638
|
});
|
|
2544
2639
|
}
|
|
2545
2640
|
});
|
|
2546
|
-
},
|
|
2641
|
+
}, Wr = () => {
|
|
2547
2642
|
const {
|
|
2548
|
-
mountTarget:
|
|
2643
|
+
mountTarget: r
|
|
2549
2644
|
} = j();
|
|
2550
|
-
return
|
|
2645
|
+
return c(Ge, {
|
|
2551
2646
|
get component() {
|
|
2552
|
-
return
|
|
2647
|
+
return r.parentNode === document.body ? Hr : Ue;
|
|
2553
2648
|
}
|
|
2554
2649
|
});
|
|
2555
|
-
},
|
|
2556
|
-
function
|
|
2557
|
-
localizationStrings:
|
|
2650
|
+
}, qe = "camera-manager-mount-point";
|
|
2651
|
+
function oa(r, e, {
|
|
2652
|
+
localizationStrings: t,
|
|
2558
2653
|
showMirrorCameraButton: a = !1,
|
|
2559
2654
|
showTorchButton: n = !0,
|
|
2560
2655
|
showCloseButton: o = !0,
|
|
2561
2656
|
showCameraErrorModal: i = !0
|
|
2562
2657
|
} = {}) {
|
|
2563
|
-
let
|
|
2564
|
-
const
|
|
2565
|
-
let
|
|
2566
|
-
const
|
|
2567
|
-
|
|
2568
|
-
},
|
|
2569
|
-
|
|
2658
|
+
let s;
|
|
2659
|
+
const l = /* @__PURE__ */ new Set();
|
|
2660
|
+
let f;
|
|
2661
|
+
const g = (v) => {
|
|
2662
|
+
f = v;
|
|
2663
|
+
}, p = () => {
|
|
2664
|
+
r.reset();
|
|
2570
2665
|
};
|
|
2571
|
-
let
|
|
2572
|
-
const
|
|
2666
|
+
let S;
|
|
2667
|
+
const m = () => {
|
|
2573
2668
|
try {
|
|
2574
2669
|
console.debug("🧱 Dismounting camera manager UI");
|
|
2575
|
-
for (const
|
|
2576
|
-
|
|
2577
|
-
|
|
2670
|
+
for (const v of l)
|
|
2671
|
+
v();
|
|
2672
|
+
l.clear(), p(), requestAnimationFrame(() => {
|
|
2578
2673
|
requestAnimationFrame(() => {
|
|
2579
|
-
|
|
2674
|
+
S && S(), s.remove(), p();
|
|
2580
2675
|
});
|
|
2581
2676
|
});
|
|
2582
|
-
} catch (
|
|
2583
|
-
console.warn("Error while dismounting camera manager UI",
|
|
2677
|
+
} catch (v) {
|
|
2678
|
+
console.warn("Error while dismounting camera manager UI", v);
|
|
2584
2679
|
}
|
|
2585
|
-
},
|
|
2586
|
-
|
|
2587
|
-
const
|
|
2588
|
-
|
|
2680
|
+
}, d = document.createElement("div");
|
|
2681
|
+
d.id = qe, s = d, e ? e.appendChild(d) : document.body.appendChild(d);
|
|
2682
|
+
const h = (v) => (l.add(v), () => {
|
|
2683
|
+
l.delete(v);
|
|
2589
2684
|
});
|
|
2590
|
-
|
|
2591
|
-
userStrings:
|
|
2592
|
-
setLocalizationRef:
|
|
2685
|
+
S = Xe(() => c(Vt, {
|
|
2686
|
+
userStrings: t,
|
|
2687
|
+
setLocalizationRef: g,
|
|
2593
2688
|
get children() {
|
|
2594
|
-
return
|
|
2595
|
-
addOnDismountCallback:
|
|
2596
|
-
dismountCameraUi:
|
|
2597
|
-
cameraManager:
|
|
2689
|
+
return c(Ot, {
|
|
2690
|
+
addOnDismountCallback: h,
|
|
2691
|
+
dismountCameraUi: m,
|
|
2692
|
+
cameraManager: r,
|
|
2598
2693
|
showMirrorCameraButton: a,
|
|
2599
2694
|
showTorchButton: n,
|
|
2600
2695
|
showCloseButton: o,
|
|
2601
2696
|
showCameraErrorModal: i,
|
|
2602
|
-
mountTarget:
|
|
2697
|
+
mountTarget: s,
|
|
2603
2698
|
get children() {
|
|
2604
|
-
return
|
|
2699
|
+
return c(Wr, {});
|
|
2605
2700
|
}
|
|
2606
2701
|
});
|
|
2607
2702
|
}
|
|
2608
|
-
}),
|
|
2609
|
-
const
|
|
2610
|
-
updateLocalization:
|
|
2703
|
+
}), s);
|
|
2704
|
+
const C = {
|
|
2705
|
+
updateLocalization: f,
|
|
2611
2706
|
/**
|
|
2612
2707
|
* Adds a callback to be called when the component is unmounted.
|
|
2613
2708
|
* Returns a cleanup function that removes the callback when called.
|
|
@@ -2615,65 +2710,65 @@ function ra(t, e, {
|
|
|
2615
2710
|
* @param fn - The callback function to be called when the component is unmounted
|
|
2616
2711
|
* @returns A cleanup function that removes the callback when called
|
|
2617
2712
|
*/
|
|
2618
|
-
addOnDismountCallback:
|
|
2619
|
-
cameraManager:
|
|
2713
|
+
addOnDismountCallback: h,
|
|
2714
|
+
cameraManager: r,
|
|
2620
2715
|
// we know these are defined because `createCameraManagerUi` resolves when they are defined
|
|
2621
2716
|
// TODO: maybe don't use getters but make sure they are defined
|
|
2622
2717
|
get feedbackLayerNode() {
|
|
2623
|
-
return
|
|
2718
|
+
return B.getState().feedbackLayer;
|
|
2624
2719
|
},
|
|
2625
2720
|
get overlayLayerNode() {
|
|
2626
|
-
return
|
|
2721
|
+
return B.getState().overlayLayer;
|
|
2627
2722
|
},
|
|
2628
2723
|
get owner() {
|
|
2629
|
-
return
|
|
2724
|
+
return B.getState().owner;
|
|
2630
2725
|
},
|
|
2631
|
-
dismount:
|
|
2726
|
+
dismount: m
|
|
2632
2727
|
};
|
|
2633
|
-
return new Promise((
|
|
2634
|
-
let
|
|
2728
|
+
return new Promise((v) => {
|
|
2729
|
+
let b = !1, E = !1, x = !1, F = () => {
|
|
2635
2730
|
}, G = () => {
|
|
2636
2731
|
}, X = () => {
|
|
2637
2732
|
};
|
|
2638
|
-
const
|
|
2639
|
-
|
|
2733
|
+
const re = () => {
|
|
2734
|
+
b && E && x && (F(), G(), X(), v(C));
|
|
2640
2735
|
};
|
|
2641
|
-
|
|
2642
|
-
R && (
|
|
2736
|
+
F = B.subscribe((R) => R.feedbackLayer, (R) => {
|
|
2737
|
+
R && (E = !0), re();
|
|
2643
2738
|
}, {
|
|
2644
2739
|
fireImmediately: !0
|
|
2645
|
-
}), G =
|
|
2646
|
-
R && (x = !0),
|
|
2740
|
+
}), G = B.subscribe((R) => R.overlayLayer, (R) => {
|
|
2741
|
+
R && (x = !0), re();
|
|
2647
2742
|
}, {
|
|
2648
2743
|
fireImmediately: !0
|
|
2649
|
-
}), X =
|
|
2650
|
-
R && (
|
|
2744
|
+
}), X = r.subscribe((R) => R.videoElement, (R) => {
|
|
2745
|
+
R && (b = !0, re());
|
|
2651
2746
|
}, {
|
|
2652
2747
|
fireImmediately: !0
|
|
2653
2748
|
});
|
|
2654
2749
|
});
|
|
2655
2750
|
}
|
|
2656
|
-
const
|
|
2657
|
-
globalThis.__CAMERA_MANAGER__ ||=
|
|
2658
|
-
globalThis.__CAMERA_MANAGER__ !==
|
|
2751
|
+
const je = Symbol();
|
|
2752
|
+
globalThis.__CAMERA_MANAGER__ ||= je;
|
|
2753
|
+
globalThis.__CAMERA_MANAGER__ !== je && console.warn(
|
|
2659
2754
|
"Detected multiple instances of @microblink/camera-manager. This can lead to unexpected behavior."
|
|
2660
2755
|
);
|
|
2661
2756
|
export {
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2757
|
+
De as Camera,
|
|
2758
|
+
U as CameraError,
|
|
2759
|
+
na as CameraManager,
|
|
2760
|
+
qe as MOUNT_POINT_ID,
|
|
2761
|
+
zt as VideoFrameProcessor,
|
|
2762
|
+
u as cameraManagerStore,
|
|
2763
|
+
B as cameraUiRefStore,
|
|
2764
|
+
oa as createCameraManagerUi,
|
|
2765
|
+
Nt as defaultCameraManagerOptions,
|
|
2766
|
+
Et as findResolutionKey,
|
|
2767
|
+
Ne as getBuffer,
|
|
2768
|
+
yt as getNormalizedResolution,
|
|
2769
|
+
le as isBufferDetached,
|
|
2770
|
+
Ct as matchClosestResolution,
|
|
2771
|
+
kt as resetCameraManagerStore,
|
|
2772
|
+
St as returnLongerSide,
|
|
2773
|
+
P as videoResolutions
|
|
2679
2774
|
};
|