@microblink/camera-manager 7.2.2 → 7.2.4
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/dist/camera-manager.js +1408 -2148
- package/package.json +1 -1
- package/types/core/CameraManager.d.ts +19 -3
- package/types/core/CameraManager.d.ts.map +1 -1
- package/types/core/CameraManager.test.d.ts +5 -0
- package/types/core/CameraManager.test.d.ts.map +1 -0
- package/types/core/cameraError.d.ts +22 -0
- package/types/core/cameraError.d.ts.map +1 -0
- package/types/core/cameraManagerStore.d.ts +1 -1
- package/types/core/cameraUtils.d.ts +0 -18
- package/types/core/cameraUtils.d.ts.map +1 -1
- package/types/index.d.ts +2 -1
- package/types/index.d.ts.map +1 -1
- package/types/ui/CameraUiStoreContext.d.ts +3 -0
- package/types/ui/CameraUiStoreContext.d.ts.map +1 -1
- package/types/ui/CaptureScreen.d.ts.map +1 -1
- package/types/ui/createCameraManagerUi.d.ts +7 -1
- package/types/ui/createCameraManagerUi.d.ts.map +1 -1
- package/dist/camera-manager.js.map +0 -1
- package/types/index.rollup.d.ts +0 -686
package/dist/camera-manager.js
CHANGED
|
@@ -1,76 +1,36 @@
|
|
|
1
|
-
(function() {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
})("._dialogPositioner_worsp_1 {\n 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);\n}@supports (height:100dvh){._dialogPositioner_worsp_1{height:100dvh;}}\n\n._dialogBackdrop_worsp_5 {\n 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)) /* rgb(var(--color-black-rgb-value) / <alpha-value>) */;--un-bg-opacity:0.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);\n}\n\n._dialogContent_worsp_9 {\n position:relative;max-height:calc(100dvh - 4rem);max-width:28rem;display:flex;flex-direction:column;place-self:center;border-radius:0.5rem;--un-bg-opacity:1;background-color:rgb(var(--color-white-rgb-value) / var(--un-bg-opacity)) /* rgb(var(--color-white-rgb-value) / <alpha-value>) */;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)) /* #0f0f0f */;--un-shadow:var(--un-shadow-inset) 0 10px 15px -3px var(--un-shadow-color, rgb(0 0 0 / 0.1)),var(--un-shadow-inset) 0 4px 6px -4px var(--un-shadow-color, rgb(0 0 0 / 0.1));box-shadow:var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow);\n}\n._dialogContent_worsp_9._large_worsp_13 {\n padding-left:min(8%,4rem);padding-right:min(8%,4rem);padding-top:min(8%,3rem);padding-bottom:min(8%,3rem);\n}\n._dialogContent_worsp_9._compact_worsp_16 {\n padding:min(8%,1.5rem);\n}\n@media (min-width: 640px){\n ._dialogContent_worsp_9 {\n max-width:36rem;\n }\n}\n@media (min-width: 1024px){\n ._dialogContent_worsp_9 {\n max-width:28rem;\n }\n}\n\n._dialogTitle_worsp_30 {\n text-align:center;font-size:calc(var(--mb-size)*1.5rem);line-height:calc(var(--mb-size)*2rem);font-weight:700;\n}\n\n._contentOut_worsp_34 {\n overflow-y:auto;\n}\n\n._closeButton_worsp_38 {\n position:absolute;top:0.625rem;right:0.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 /* transparent */;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;transition-duration:100ms;\n}._closeButton_worsp_38:hover{--un-bg-opacity:1;background-color:rgb(var(--color-gray-100-rgb-value) / var(--un-bg-opacity)) /* rgb(var(--color-gray-100-rgb-value) / <alpha-value>) */;}._closeButton_worsp_38:active{--un-bg-opacity:1;background-color:rgb(var(--color-gray-200-rgb-value) / var(--un-bg-opacity)) /* rgb(var(--color-gray-200-rgb-value) / <alpha-value>) */;}\n\n._closeButtonInner_worsp_44 {\n display:flex;--un-translate-y:-2px;transform:translateX(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)) rotateZ(var(--un-rotate-z)) skewX(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)) /* rgb(var(--color-black-rgb-value) / <alpha-value>) */;font-weight:200;line-height:1;\n}\n\n._primaryActionButton_worsp_49 {\n 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)) /* rgb(var(--color-primary) / <alpha-value>) */;padding-left:calc(var(--mb-size)*1.25rem);padding-right:calc(var(--mb-size)*1.25rem);padding-top:calc(var(--mb-size)*0.25rem);padding-bottom:calc(var(--mb-size)*0.25rem);text-wrap:nowrap;font-size:calc(var(--mb-size)*0.875rem);line-height:calc(var(--mb-size)*1.25rem);--un-text-opacity:1;color:rgb(var(--color-white-rgb-value) / var(--un-text-opacity)) /* rgb(var(--color-white-rgb-value) / <alpha-value>) */;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;transition-duration:100ms;\n}._primaryActionButton_worsp_49[disabled]{cursor:not-allowed;--un-bg-opacity:1;background-color:rgb(var(--color-gray-200-rgb-value) / var(--un-bg-opacity)) /* rgb(var(--color-gray-200-rgb-value) / <alpha-value>) */;--un-text-opacity:1;color:rgb(var(--color-gray-500-rgb-value) / var(--un-text-opacity)) /* rgb(var(--color-gray-500-rgb-value) / <alpha-value>) */;--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)) /* rgb(var(--color-gray-200-rgb-value) / <alpha-value>) */;--un-text-opacity:1;color:rgb(var(--color-gray-500-rgb-value) / var(--un-text-opacity)) /* rgb(var(--color-gray-500-rgb-value) / <alpha-value>) */;}._primaryActionButton_worsp_49:hover{--un-bg-opacity:1;background-color:rgb(var(--color-accent-700-rgb-value) / var(--un-bg-opacity)) /* rgb(var(--color-accent-700-rgb-value) / <alpha-value>) */;}._primaryActionButton_worsp_49:active{--un-bg-opacity:1;background-color:rgb(var(--color-accent-800-rgb-value) / var(--un-bg-opacity)) /* rgb(var(--color-accent-800-rgb-value) / <alpha-value>) */;}._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)) /* rgb(var(--color-accent-400-rgb-value) / <alpha-value>) */;outline-offset:4px;outline-style:solid;}\n\n._secondaryActionButton_worsp_53 {\n height:2.5rem;-webkit-appearance:none;appearance:none;border-radius:calc(var(--mb-size)*2.5rem);border-style:none;background-color:transparent /* transparent */;padding-left:calc(var(--mb-size)*1.25rem);padding-right:calc(var(--mb-size)*1.25rem);padding-top:calc(var(--mb-size)*0.25rem);padding-bottom:calc(var(--mb-size)*0.25rem);text-wrap:nowrap;font-size:calc(var(--mb-size)*0.875rem);line-height:calc(var(--mb-size)*1.25rem);--un-text-opacity:1;color:rgb(var(--color-primary) / var(--un-text-opacity)) /* rgb(var(--color-primary) / <alpha-value>) */;--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)) /* rgb(var(--color-primary) / <alpha-value>) */;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;transition-duration:100ms;\n}._secondaryActionButton_worsp_53[disabled]{cursor:not-allowed;--un-bg-opacity:1;background-color:rgb(var(--color-gray-200-rgb-value) / var(--un-bg-opacity)) /* rgb(var(--color-gray-200-rgb-value) / <alpha-value>) */;--un-text-opacity:1;color:rgb(var(--color-gray-500-rgb-value) / var(--un-text-opacity)) /* rgb(var(--color-gray-500-rgb-value) / <alpha-value>) */;--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)) /* rgb(var(--color-gray-200-rgb-value) / <alpha-value>) */;--un-text-opacity:1;color:rgb(var(--color-gray-500-rgb-value) / var(--un-text-opacity)) /* rgb(var(--color-gray-500-rgb-value) / <alpha-value>) */;}._secondaryActionButton_worsp_53:hover{--un-bg-opacity:1;background-color:rgb(var(--color-accent-25-rgb-value) / var(--un-bg-opacity)) /* rgb(var(--color-accent-25-rgb-value) / <alpha-value>) */;--un-text-opacity:1;color:rgb(var(--color-accent-700-rgb-value) / var(--un-text-opacity)) /* rgb(var(--color-accent-700-rgb-value) / <alpha-value>) */;--un-ring-opacity:1;--un-ring-color:rgb(var(--color-accent-700-rgb-value) / var(--un-ring-opacity)) /* rgb(var(--color-accent-700-rgb-value) / <alpha-value>) */;}._secondaryActionButton_worsp_53:active{--un-bg-opacity:1;background-color:rgb(var(--color-accent-50-rgb-value) / var(--un-bg-opacity)) /* rgb(var(--color-accent-50-rgb-value) / <alpha-value>) */;--un-text-opacity:1;color:rgb(var(--color-accent-800-rgb-value) / var(--un-text-opacity)) /* rgb(var(--color-accent-800-rgb-value) / <alpha-value>) */;--un-ring-opacity:1;--un-ring-color:rgb(var(--color-accent-800-rgb-value) / var(--un-ring-opacity)) /* rgb(var(--color-accent-800-rgb-value) / <alpha-value>) */;}._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)) /* rgb(var(--color-accent-400-rgb-value) / <alpha-value>) */;outline-offset:4px;outline-style:solid;}\n\n._actions_worsp_57 {\n display:flex;gap:calc(var(--mb-size)*1rem);\n}\n._actions_worsp_57 ._primaryActionButton_worsp_49, ._actions_worsp_57 ._secondaryActionButton_worsp_53 {\n width:50%;\n}\n\n._alertTitle_worsp_64 {\n 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)) /* rgb(var(--color-gray-700-rgb-value) / <alpha-value>) */;font-weight:400;\n}\n\n._alertText_worsp_68 {\n margin-top:calc(var(--mb-size)*1rem);margin-bottom:calc(var(--mb-size)*2rem);padding-left:calc(var(--mb-size)*0.5rem);padding-right:calc(var(--mb-size)*0.5rem);text-align:center;text-wrap:pretty;--un-text-opacity:1;color:rgb(var(--color-gray-500-rgb-value) / var(--un-text-opacity)) /* rgb(var(--color-gray-500-rgb-value) / <alpha-value>) */;font-weight:300;line-height:1.5;\n} *,::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 / 0.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 / 0.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);}.z-1{z-index:1;}.has-\\[\\[data-scope\\]\\]\\:z-2:has([data-scope]),.z-2{z-index:2;}.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:translateX(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)) rotateZ(var(--un-rotate-z)) skewX(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:translateX(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)) rotateZ(var(--un-rotate-z)) skewX(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)*0.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:0.375rem;}.border-none{border-style:none;}.bg-dark-100\\/50{background-color:rgb(60 60 60 / 0.5) /* #3c3c3c */;}.bg-dark-500{--un-bg-opacity:1;background-color:rgb(31 31 31 / var(--un-bg-opacity)) /* #1f1f1f */;}.data-\\[highlighted\\]\\:bg-gray-500\\/50[data-highlighted]{background-color:rgb(var(--color-gray-500-rgb-value) / 0.5) /* rgb(var(--color-gray-500-rgb-value) / <alpha-value>) */;}.bg-white{--un-bg-opacity:1;background-color:rgb(var(--color-white-rgb-value) / var(--un-bg-opacity)) /* rgb(var(--color-white-rgb-value) / <alpha-value>) */;}.bg-opacity-50{--un-bg-opacity:0.5;}.p-2{padding:calc(var(--mb-size)*0.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)*0.5rem);padding-bottom:calc(var(--mb-size)*0.5rem);}.py-3{padding-top:calc(var(--mb-size)*0.75rem);padding-bottom:calc(var(--mb-size)*0.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)*0.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)) /* rgb(var(--color-white-rgb-value) / <alpha-value>) */;}.font-500{font-weight:500;}.disabled\\:opacity-50:disabled{opacity:0.5;}.shadow{--un-shadow:var(--un-shadow-inset) 0 1px 3px 0 var(--un-shadow-color, rgb(0 0 0 / 0.1)),var(--un-shadow-inset) 0 1px 2px -1px var(--un-shadow-color, rgb(0 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 / 0.07))) drop-shadow(0 2px 2px var(--un-drop-shadow-color, rgb(0 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(0.4, 0, 0.2, 1);transition-duration:150ms;}.duration-300{transition-duration:300ms;}.ease-in-out{transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);}@keyframes __un_qm{0%{box-shadow:inset 4px 4px #ff1e90, inset -4px -4px #ff1e90}100%{box-shadow:inset 8px 8px #3399ff, inset -8px -8px #3399ff}} .\\?{animation:__un_qm 0.5s ease-in-out alternate infinite;}.lerp\\:px-3\\@xs\\,8\\@lg{padding-inline:clamp(calc(var(--mb-size)*0.75rem), calc(var(--mb-size)*0.75rem) + (100vw - 380px) * 0.031055900621118012, calc(var(--mb-size)*2rem));}@supports (height:100dvh){.supports-\\[\\(height\\:100dvh\\)\\]\\:h-dvh{height:100dvh;}}");
|
|
6
|
-
}
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const timediff = now - old;
|
|
29
|
-
callback(now, {
|
|
30
|
-
presentationTime: now + processingDuration * 1e3,
|
|
31
|
-
expectedDisplayTime: now + timediff,
|
|
32
|
-
width: this.videoWidth,
|
|
33
|
-
height: this.videoHeight,
|
|
34
|
-
mediaTime: Math.max(0, this.currentTime || 0) + timediff / 1e3,
|
|
35
|
-
presentedFrames,
|
|
36
|
-
processingDuration
|
|
37
|
-
});
|
|
38
|
-
delete this._rvfcpolyfillmap[handle];
|
|
39
|
-
} else {
|
|
40
|
-
this._rvfcpolyfillmap[handle] = requestAnimationFrame((newer) => check(now, newer));
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
this._rvfcpolyfillmap[handle] = requestAnimationFrame((newer) => check(handle, newer));
|
|
44
|
-
return handle;
|
|
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 ge } from "zustand/middleware";
|
|
3
|
+
import { createStore as be } from "zustand/vanilla";
|
|
4
|
+
import { createComponent as s, use as B, template as S, spread as F, mergeProps as Y, insert as y, memo as pe, isServer as Ue, delegateEvents as qe, effect as H, className as V, Portal as ve, Dynamic as je, render as He } from "solid-js/web";
|
|
5
|
+
import { createContext as we, onCleanup as ce, useContext as ye, onMount as J, createSignal as z, Show as E, Index as We, createRoot as Ge, getOwner as Se, splitProps as Xe, createEffect as Qe } from "solid-js";
|
|
6
|
+
import { createWithSignal as Ce } from "solid-zustand";
|
|
7
|
+
import { createStore as Ke } from "solid-js/store";
|
|
8
|
+
import { EnvironmentProvider as Ye } from "@ark-ui/solid/environment";
|
|
9
|
+
import { Dialog as $ } from "@ark-ui/solid/dialog";
|
|
10
|
+
import { Select as A, createListCollection as Je } from "@ark-ui/solid/select";
|
|
11
|
+
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(t) {
|
|
13
|
+
const e = performance.now(), r = this.getVideoPlaybackQuality(), a = this.mozPresentedFrames || this.mozPaintedFrames || r.totalVideoFrames - r.droppedVideoFrames, n = (o, i) => {
|
|
14
|
+
const l = this.getVideoPlaybackQuality(), c = this.mozPresentedFrames || this.mozPaintedFrames || l.totalVideoFrames - l.droppedVideoFrames;
|
|
15
|
+
if (c > a) {
|
|
16
|
+
const d = this.mozFrameDelay || l.totalFrameDelay - r.totalFrameDelay || 0, h = i - o;
|
|
17
|
+
t(i, {
|
|
18
|
+
presentationTime: i + d * 1e3,
|
|
19
|
+
expectedDisplayTime: i + h,
|
|
20
|
+
width: this.videoWidth,
|
|
21
|
+
height: this.videoHeight,
|
|
22
|
+
mediaTime: Math.max(0, this.currentTime || 0) + h / 1e3,
|
|
23
|
+
presentedFrames: c,
|
|
24
|
+
processingDuration: d
|
|
25
|
+
}), delete this._rvfcpolyfillmap[e];
|
|
26
|
+
} else
|
|
27
|
+
this._rvfcpolyfillmap[e] = requestAnimationFrame((d) => n(i, d));
|
|
45
28
|
};
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
const initialState$1 = {
|
|
52
|
-
cameras: [],
|
|
53
|
-
facingFilter: void 0,
|
|
54
|
-
videoElement: void 0,
|
|
55
|
-
playbackState: "idle",
|
|
56
|
-
selectedCamera: void 0,
|
|
57
|
-
isSwappingCamera: false,
|
|
58
|
-
isQueryingCameras: false,
|
|
59
|
-
mirrorX: false,
|
|
60
|
-
errorState: void 0
|
|
61
|
-
};
|
|
62
|
-
const cameraManagerStore = createStore()(
|
|
63
|
-
// this is important! Otherwise solid-zustand will start mutating the initial state
|
|
64
|
-
subscribeWithSelector(() => structuredClone(initialState$1))
|
|
65
|
-
);
|
|
66
|
-
const resetCameraManagerStore = () => {
|
|
67
|
-
console.debug("Stopping all cameras and resetting the `cameraManagerStore`.");
|
|
68
|
-
cameraManagerStore.getState().cameras.forEach((camera) => {
|
|
69
|
-
camera.stopStream();
|
|
70
|
-
});
|
|
71
|
-
cameraManagerStore.setState(structuredClone(initialState$1));
|
|
72
|
-
};
|
|
73
|
-
const backCameraKeywords = [
|
|
29
|
+
return this._rvfcpolyfillmap[e] = requestAnimationFrame((o) => n(e, o)), e;
|
|
30
|
+
}, HTMLVideoElement.prototype.cancelVideoFrameCallback = function(t) {
|
|
31
|
+
cancelAnimationFrame(this._rvfcpolyfillmap[t]), delete this._rvfcpolyfillmap[t];
|
|
32
|
+
});
|
|
33
|
+
const Ze = [
|
|
74
34
|
// English
|
|
75
35
|
"back",
|
|
76
36
|
"rear",
|
|
@@ -141,8 +101,7 @@ const backCameraKeywords = [
|
|
|
141
101
|
"बैक",
|
|
142
102
|
// Latin American Spanish
|
|
143
103
|
"posterior"
|
|
144
|
-
]
|
|
145
|
-
const frontCameraKeywords = [
|
|
104
|
+
], et = [
|
|
146
105
|
// English
|
|
147
106
|
"front",
|
|
148
107
|
// German
|
|
@@ -209,66 +168,38 @@ const frontCameraKeywords = [
|
|
|
209
168
|
"फ्रंट",
|
|
210
169
|
// Latin American Spanish
|
|
211
170
|
"frontal"
|
|
212
|
-
];
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
var _createClass = /* @__PURE__ */ function() {
|
|
219
|
-
function defineProperties(target, props) {
|
|
220
|
-
for (var i = 0; i < props.length; i++) {
|
|
221
|
-
var descriptor = props[i];
|
|
222
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
223
|
-
descriptor.configurable = true;
|
|
224
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
225
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
171
|
+
], ke = (t, e) => e.some((r) => t.toLowerCase().includes(r)), Ee = (t) => ke(t, Ze), _e = (t) => ke(t, et);
|
|
172
|
+
var tt = /* @__PURE__ */ function() {
|
|
173
|
+
function t(e, r) {
|
|
174
|
+
for (var a = 0; a < r.length; a++) {
|
|
175
|
+
var n = r[a];
|
|
176
|
+
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, n.key, n);
|
|
226
177
|
}
|
|
227
178
|
}
|
|
228
|
-
return function(
|
|
229
|
-
|
|
230
|
-
if (staticProps) defineProperties(Constructor, staticProps);
|
|
231
|
-
return Constructor;
|
|
179
|
+
return function(e, r, a) {
|
|
180
|
+
return r && t(e.prototype, r), a && t(e, a), e;
|
|
232
181
|
};
|
|
233
|
-
}();
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } }));
|
|
182
|
+
}(), rt = at(["", ""], ["", ""]);
|
|
183
|
+
function at(t, e) {
|
|
184
|
+
return Object.freeze(Object.defineProperties(t, { raw: { value: Object.freeze(e) } }));
|
|
237
185
|
}
|
|
238
|
-
function
|
|
239
|
-
if (!(
|
|
186
|
+
function nt(t, e) {
|
|
187
|
+
if (!(t instanceof e))
|
|
240
188
|
throw new TypeError("Cannot call a class as a function");
|
|
241
|
-
}
|
|
242
189
|
}
|
|
243
|
-
var
|
|
244
|
-
function
|
|
245
|
-
var
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
}
|
|
257
|
-
if (typeof strings === "string") {
|
|
258
|
-
return _this.transformEndResult(strings);
|
|
259
|
-
}
|
|
260
|
-
strings = strings.map(_this.transformString.bind(_this));
|
|
261
|
-
return _this.transformEndResult(strings.reduce(_this.processSubstitutions.bind(_this, expressions)));
|
|
262
|
-
};
|
|
263
|
-
if (transformers.length > 0 && Array.isArray(transformers[0])) {
|
|
264
|
-
transformers = transformers[0];
|
|
265
|
-
}
|
|
266
|
-
this.transformers = transformers.map(function(transformer) {
|
|
267
|
-
return typeof transformer === "function" ? transformer() : transformer;
|
|
268
|
-
});
|
|
269
|
-
return this.tag;
|
|
270
|
-
}
|
|
271
|
-
_createClass(TemplateTag2, [{
|
|
190
|
+
var T = function() {
|
|
191
|
+
function t() {
|
|
192
|
+
for (var e = this, r = arguments.length, a = Array(r), n = 0; n < r; n++)
|
|
193
|
+
a[n] = arguments[n];
|
|
194
|
+
return nt(this, t), this.tag = function(o) {
|
|
195
|
+
for (var i = arguments.length, l = Array(i > 1 ? i - 1 : 0), c = 1; c < i; c++)
|
|
196
|
+
l[c - 1] = arguments[c];
|
|
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, l))));
|
|
198
|
+
}, a.length > 0 && Array.isArray(a[0]) && (a = a[0]), this.transformers = a.map(function(o) {
|
|
199
|
+
return typeof o == "function" ? o() : o;
|
|
200
|
+
}), this.tag;
|
|
201
|
+
}
|
|
202
|
+
return tt(t, [{
|
|
272
203
|
key: "interimTag",
|
|
273
204
|
/**
|
|
274
205
|
* An intermediary template tag that receives a template tag and passes the result of calling the template with the received
|
|
@@ -278,11 +209,10 @@ var TemplateTag = function() {
|
|
|
278
209
|
* @param {...*} ...substitutions - `substitutions` is an array of all substitutions in the template
|
|
279
210
|
* @return {*} - the final processed value
|
|
280
211
|
*/
|
|
281
|
-
value: function
|
|
282
|
-
for (var
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
return this.tag(_templateObject, previousTag.apply(void 0, [template2].concat(substitutions)));
|
|
212
|
+
value: function(r, a) {
|
|
213
|
+
for (var n = arguments.length, o = Array(n > 2 ? n - 2 : 0), i = 2; i < n; i++)
|
|
214
|
+
o[i - 2] = arguments[i];
|
|
215
|
+
return this.tag(rt, r.apply(void 0, [a].concat(o)));
|
|
286
216
|
}
|
|
287
217
|
/**
|
|
288
218
|
* Performs bulk processing on the tagged template, transforming each substitution and then
|
|
@@ -294,9 +224,9 @@ var TemplateTag = function() {
|
|
|
294
224
|
*/
|
|
295
225
|
}, {
|
|
296
226
|
key: "processSubstitutions",
|
|
297
|
-
value: function
|
|
298
|
-
var
|
|
299
|
-
return "".concat(
|
|
227
|
+
value: function(r, a, n) {
|
|
228
|
+
var o = this.transformSubstitution(r.shift(), a);
|
|
229
|
+
return "".concat(a, o, n);
|
|
300
230
|
}
|
|
301
231
|
/**
|
|
302
232
|
* Iterate through each transformer, applying the transformer's `onString` method to the template
|
|
@@ -306,11 +236,11 @@ var TemplateTag = function() {
|
|
|
306
236
|
*/
|
|
307
237
|
}, {
|
|
308
238
|
key: "transformString",
|
|
309
|
-
value: function
|
|
310
|
-
var
|
|
311
|
-
return
|
|
239
|
+
value: function(r) {
|
|
240
|
+
var a = function(o, i) {
|
|
241
|
+
return i.onString ? i.onString(o) : o;
|
|
312
242
|
};
|
|
313
|
-
return this.transformers.reduce(
|
|
243
|
+
return this.transformers.reduce(a, r);
|
|
314
244
|
}
|
|
315
245
|
/**
|
|
316
246
|
* When a substitution is encountered, iterates through each transformer and applies the transformer's
|
|
@@ -321,11 +251,11 @@ var TemplateTag = function() {
|
|
|
321
251
|
*/
|
|
322
252
|
}, {
|
|
323
253
|
key: "transformSubstitution",
|
|
324
|
-
value: function
|
|
325
|
-
var
|
|
326
|
-
return
|
|
254
|
+
value: function(r, a) {
|
|
255
|
+
var n = function(i, l) {
|
|
256
|
+
return l.onSubstitution ? l.onSubstitution(i, a) : i;
|
|
327
257
|
};
|
|
328
|
-
return this.transformers.reduce(
|
|
258
|
+
return this.transformers.reduce(n, r);
|
|
329
259
|
}
|
|
330
260
|
/**
|
|
331
261
|
* Iterates through each transformer, applying the transformer's `onEndResult` method to the
|
|
@@ -335,161 +265,120 @@ var TemplateTag = function() {
|
|
|
335
265
|
*/
|
|
336
266
|
}, {
|
|
337
267
|
key: "transformEndResult",
|
|
338
|
-
value: function
|
|
339
|
-
var
|
|
340
|
-
return
|
|
268
|
+
value: function(r) {
|
|
269
|
+
var a = function(o, i) {
|
|
270
|
+
return i.onEndResult ? i.onEndResult(o) : o;
|
|
341
271
|
};
|
|
342
|
-
return this.transformers.reduce(
|
|
272
|
+
return this.transformers.reduce(a, r);
|
|
343
273
|
}
|
|
344
|
-
}]);
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
var trimResultTransformer = function trimResultTransformer2() {
|
|
348
|
-
var side = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
|
|
274
|
+
}]), t;
|
|
275
|
+
}(), M = function() {
|
|
276
|
+
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
|
|
349
277
|
return {
|
|
350
|
-
onEndResult: function
|
|
351
|
-
if (
|
|
352
|
-
return
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
if (
|
|
356
|
-
return
|
|
357
|
-
|
|
358
|
-
if (side === "end" || side === "right") {
|
|
359
|
-
return endResult.replace(/\s*$/, "");
|
|
360
|
-
}
|
|
361
|
-
throw new Error("Side not supported: " + side);
|
|
278
|
+
onEndResult: function(a) {
|
|
279
|
+
if (e === "")
|
|
280
|
+
return a.trim();
|
|
281
|
+
if (e = e.toLowerCase(), e === "start" || e === "left")
|
|
282
|
+
return a.replace(/^\s*/, "");
|
|
283
|
+
if (e === "end" || e === "right")
|
|
284
|
+
return a.replace(/\s*$/, "");
|
|
285
|
+
throw new Error("Side not supported: " + e);
|
|
362
286
|
}
|
|
363
287
|
};
|
|
364
288
|
};
|
|
365
|
-
function
|
|
366
|
-
if (Array.isArray(
|
|
367
|
-
for (var
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
return Array.from(arr);
|
|
373
|
-
}
|
|
289
|
+
function ot(t) {
|
|
290
|
+
if (Array.isArray(t)) {
|
|
291
|
+
for (var e = 0, r = Array(t.length); e < t.length; e++)
|
|
292
|
+
r[e] = t[e];
|
|
293
|
+
return r;
|
|
294
|
+
} else
|
|
295
|
+
return Array.from(t);
|
|
374
296
|
}
|
|
375
|
-
var
|
|
376
|
-
var
|
|
297
|
+
var L = function() {
|
|
298
|
+
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "initial";
|
|
377
299
|
return {
|
|
378
|
-
onEndResult: function
|
|
379
|
-
if (
|
|
380
|
-
var
|
|
381
|
-
|
|
382
|
-
return el.length;
|
|
300
|
+
onEndResult: function(a) {
|
|
301
|
+
if (e === "initial") {
|
|
302
|
+
var n = a.match(/^[^\S\n]*(?=\S)/gm), o = n && Math.min.apply(Math, ot(n.map(function(l) {
|
|
303
|
+
return l.length;
|
|
383
304
|
})));
|
|
384
|
-
if (
|
|
385
|
-
var
|
|
386
|
-
return
|
|
305
|
+
if (o) {
|
|
306
|
+
var i = new RegExp("^.{" + o + "}", "gm");
|
|
307
|
+
return a.replace(i, "");
|
|
387
308
|
}
|
|
388
|
-
return
|
|
389
|
-
}
|
|
390
|
-
if (type === "all") {
|
|
391
|
-
return endResult.replace(/^[^\S\n]+/gm, "");
|
|
309
|
+
return a;
|
|
392
310
|
}
|
|
393
|
-
|
|
311
|
+
if (e === "all")
|
|
312
|
+
return a.replace(/^[^\S\n]+/gm, "");
|
|
313
|
+
throw new Error("Unknown type: " + e);
|
|
394
314
|
}
|
|
395
315
|
};
|
|
396
|
-
}
|
|
397
|
-
var replaceResultTransformer = function replaceResultTransformer2(replaceWhat, replaceWith) {
|
|
316
|
+
}, q = function(e, r) {
|
|
398
317
|
return {
|
|
399
|
-
onEndResult: function
|
|
400
|
-
if (
|
|
318
|
+
onEndResult: function(n) {
|
|
319
|
+
if (e == null || r == null)
|
|
401
320
|
throw new Error("replaceResultTransformer requires at least 2 arguments.");
|
|
402
|
-
|
|
403
|
-
return endResult.replace(replaceWhat, replaceWith);
|
|
321
|
+
return n.replace(e, r);
|
|
404
322
|
}
|
|
405
323
|
};
|
|
406
|
-
}
|
|
407
|
-
var replaceSubstitutionTransformer = function replaceSubstitutionTransformer2(replaceWhat, replaceWith) {
|
|
324
|
+
}, P = function(e, r) {
|
|
408
325
|
return {
|
|
409
|
-
onSubstitution: function
|
|
410
|
-
if (
|
|
326
|
+
onSubstitution: function(n, o) {
|
|
327
|
+
if (e == null || r == null)
|
|
411
328
|
throw new Error("replaceSubstitutionTransformer requires at least 2 arguments.");
|
|
412
|
-
|
|
413
|
-
if (substitution == null) {
|
|
414
|
-
return substitution;
|
|
415
|
-
} else {
|
|
416
|
-
return substitution.toString().replace(replaceWhat, replaceWith);
|
|
417
|
-
}
|
|
329
|
+
return n == null ? n : n.toString().replace(e, r);
|
|
418
330
|
}
|
|
419
331
|
};
|
|
420
|
-
}
|
|
421
|
-
var defaults = {
|
|
332
|
+
}, it = {
|
|
422
333
|
separator: "",
|
|
423
334
|
conjunction: "",
|
|
424
|
-
serial:
|
|
425
|
-
}
|
|
426
|
-
var
|
|
427
|
-
var opts = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : defaults;
|
|
335
|
+
serial: !1
|
|
336
|
+
}, D = function() {
|
|
337
|
+
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : it;
|
|
428
338
|
return {
|
|
429
|
-
onSubstitution: function
|
|
430
|
-
if (Array.isArray(
|
|
431
|
-
var
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
var indent = resultSoFar.match(/(\n?[^\S\n]+)$/);
|
|
436
|
-
if (indent) {
|
|
437
|
-
substitution = substitution.join(separator + indent[1]);
|
|
438
|
-
} else {
|
|
439
|
-
substitution = substitution.join(separator + " ");
|
|
440
|
-
}
|
|
441
|
-
if (conjunction && arrayLength > 1) {
|
|
442
|
-
var separatorIndex = substitution.lastIndexOf(separator);
|
|
443
|
-
substitution = substitution.slice(0, separatorIndex) + (serial ? separator : "") + " " + conjunction + substitution.slice(separatorIndex + 1);
|
|
339
|
+
onSubstitution: function(a, n) {
|
|
340
|
+
if (Array.isArray(a)) {
|
|
341
|
+
var o = a.length, i = e.separator, l = e.conjunction, c = e.serial, d = n.match(/(\n?[^\S\n]+)$/);
|
|
342
|
+
if (d ? a = a.join(i + d[1]) : a = a.join(i + " "), l && o > 1) {
|
|
343
|
+
var h = a.lastIndexOf(i);
|
|
344
|
+
a = a.slice(0, h) + (c ? i : "") + " " + l + a.slice(h + 1);
|
|
444
345
|
}
|
|
445
346
|
}
|
|
446
|
-
return
|
|
347
|
+
return a;
|
|
447
348
|
}
|
|
448
349
|
};
|
|
449
|
-
}
|
|
450
|
-
var splitStringTransformer = function splitStringTransformer2(splitBy) {
|
|
350
|
+
}, Te = function(e) {
|
|
451
351
|
return {
|
|
452
|
-
onSubstitution: function
|
|
453
|
-
|
|
454
|
-
if (typeof substitution === "string" && substitution.includes(splitBy)) {
|
|
455
|
-
substitution = substitution.split(splitBy);
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
return substitution;
|
|
352
|
+
onSubstitution: function(a, n) {
|
|
353
|
+
return typeof a == "string" && a.includes(e) && (a = a.split(e)), a;
|
|
459
354
|
}
|
|
460
355
|
};
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
};
|
|
465
|
-
var removeNonPrintingValuesTransformer = function removeNonPrintingValuesTransformer2() {
|
|
356
|
+
}, de = function(e) {
|
|
357
|
+
return e != null && !Number.isNaN(e) && typeof e != "boolean";
|
|
358
|
+
}, st = function() {
|
|
466
359
|
return {
|
|
467
|
-
onSubstitution: function
|
|
468
|
-
|
|
469
|
-
return substitution.filter(isValidValue);
|
|
470
|
-
}
|
|
471
|
-
if (isValidValue(substitution)) {
|
|
472
|
-
return substitution;
|
|
473
|
-
}
|
|
474
|
-
return "";
|
|
360
|
+
onSubstitution: function(r) {
|
|
361
|
+
return Array.isArray(r) ? r.filter(de) : de(r) ? r : "";
|
|
475
362
|
}
|
|
476
363
|
};
|
|
477
364
|
};
|
|
478
|
-
new
|
|
479
|
-
new
|
|
480
|
-
new
|
|
481
|
-
new
|
|
482
|
-
|
|
483
|
-
new
|
|
484
|
-
|
|
485
|
-
new
|
|
486
|
-
new
|
|
487
|
-
new
|
|
488
|
-
new
|
|
489
|
-
new
|
|
490
|
-
new
|
|
491
|
-
|
|
492
|
-
|
|
365
|
+
new T(D({ separator: "," }), L, M);
|
|
366
|
+
new T(D({ separator: ",", conjunction: "and" }), L, M);
|
|
367
|
+
new T(D({ separator: ",", conjunction: "or" }), L, M);
|
|
368
|
+
new T(Te(`
|
|
369
|
+
`), st, D, L, M);
|
|
370
|
+
new T(Te(`
|
|
371
|
+
`), D, L, M, P(/&/g, "&"), P(/</g, "<"), P(/>/g, ">"), P(/"/g, """), P(/'/g, "'"), P(/`/g, "`"));
|
|
372
|
+
new T(q(/(?:\n(?:\s*))+/g, " "), M);
|
|
373
|
+
new T(q(/(?:\n\s*)/g, ""), M);
|
|
374
|
+
new T(D({ separator: "," }), q(/(?:\s+)/g, " "), M);
|
|
375
|
+
new T(D({ separator: ",", conjunction: "or" }), q(/(?:\s+)/g, " "), M);
|
|
376
|
+
new T(D({ separator: ",", conjunction: "and" }), q(/(?:\s+)/g, " "), M);
|
|
377
|
+
new T(D, L, M);
|
|
378
|
+
new T(D, q(/(?:\s+)/g, " "), M);
|
|
379
|
+
new T(L, M);
|
|
380
|
+
var Me = new T(L("all"), M);
|
|
381
|
+
const lt = [
|
|
493
382
|
"Cameră dublă cu obiectiv superangular spate",
|
|
494
383
|
"מצלמה כפולה רחבה אחורית",
|
|
495
384
|
"Артқы қос кең бұрышты камера",
|
|
@@ -527,16 +416,15 @@ const backDualWideCameraLocalizations = [
|
|
|
527
416
|
"Cámara trasera dual con gran angular",
|
|
528
417
|
"背面デュアル広角カメラ",
|
|
529
418
|
"Stražnja dvostruka široka kamera"
|
|
530
|
-
]
|
|
531
|
-
|
|
532
|
-
if (thrown instanceof Error) return thrown;
|
|
419
|
+
], K = (t) => {
|
|
420
|
+
if (t instanceof Error) return t;
|
|
533
421
|
try {
|
|
534
|
-
return new Error(JSON.stringify(
|
|
422
|
+
return new Error(JSON.stringify(t));
|
|
535
423
|
} catch {
|
|
536
|
-
return new Error(String(
|
|
424
|
+
return new Error(String(t));
|
|
537
425
|
}
|
|
538
426
|
};
|
|
539
|
-
class
|
|
427
|
+
class xe extends Error {
|
|
540
428
|
code;
|
|
541
429
|
/**
|
|
542
430
|
* Creates a new camera error.
|
|
@@ -545,209 +433,139 @@ class CameraError extends Error {
|
|
|
545
433
|
* @param code - The error code.
|
|
546
434
|
* @param cause - The cause of the error.
|
|
547
435
|
*/
|
|
548
|
-
constructor(
|
|
549
|
-
super(
|
|
550
|
-
this.code = code;
|
|
551
|
-
this.cause = cause;
|
|
436
|
+
constructor(e, r, a) {
|
|
437
|
+
super(e), this.code = r, this.cause = a;
|
|
552
438
|
}
|
|
553
439
|
}
|
|
554
|
-
const
|
|
440
|
+
const ct = async () => {
|
|
555
441
|
try {
|
|
556
|
-
const
|
|
557
|
-
video:
|
|
442
|
+
const t = await navigator.mediaDevices.getUserMedia({
|
|
443
|
+
video: !0
|
|
558
444
|
});
|
|
559
|
-
|
|
560
|
-
} catch (
|
|
561
|
-
console.log(
|
|
562
|
-
const newError = new CameraError(
|
|
445
|
+
Re(t);
|
|
446
|
+
} catch (t) {
|
|
447
|
+
throw console.log(t), new xe(
|
|
563
448
|
"Camera permission not given",
|
|
564
449
|
"PERMISSION_DENIED",
|
|
565
|
-
|
|
450
|
+
K(t)
|
|
566
451
|
);
|
|
567
|
-
throw newError;
|
|
568
452
|
}
|
|
569
|
-
}
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
throw new Error(stripIndents`
|
|
453
|
+
}, ut = async () => {
|
|
454
|
+
if (!isSecureContext)
|
|
455
|
+
throw new Error(Me`
|
|
573
456
|
Cameras can only be used in a secure context:
|
|
574
457
|
https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts
|
|
575
458
|
`);
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
const
|
|
579
|
-
const
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
}
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
track.stop();
|
|
588
|
-
}
|
|
589
|
-
};
|
|
590
|
-
const createConstraints = (resolution, facing, id) => {
|
|
591
|
-
const constraints = {
|
|
592
|
-
video: {
|
|
593
|
-
deviceId: id ? { exact: id } : void 0,
|
|
594
|
-
frameRate: 30,
|
|
595
|
-
aspectRatio: {
|
|
596
|
-
exact: videoResolutions[resolution].width / videoResolutions[resolution].height
|
|
597
|
-
},
|
|
598
|
-
width: {
|
|
599
|
-
ideal: videoResolutions[resolution].width
|
|
600
|
-
},
|
|
601
|
-
height: {
|
|
602
|
-
ideal: videoResolutions[resolution].height
|
|
603
|
-
},
|
|
604
|
-
facingMode: facing
|
|
459
|
+
return await ct(), (await navigator.mediaDevices.enumerateDevices()).filter((r) => r.kind === "videoinput");
|
|
460
|
+
}, Re = (t) => {
|
|
461
|
+
const e = t.getTracks();
|
|
462
|
+
for (const r of e)
|
|
463
|
+
r.stop();
|
|
464
|
+
}, dt = (t, e, r) => ({
|
|
465
|
+
video: {
|
|
466
|
+
deviceId: r ? { exact: r } : void 0,
|
|
467
|
+
frameRate: 30,
|
|
468
|
+
aspectRatio: {
|
|
469
|
+
exact: O[t].width / O[t].height
|
|
605
470
|
},
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
471
|
+
width: {
|
|
472
|
+
ideal: O[t].width
|
|
473
|
+
},
|
|
474
|
+
height: {
|
|
475
|
+
ideal: O[t].height
|
|
476
|
+
},
|
|
477
|
+
facingMode: e
|
|
478
|
+
},
|
|
479
|
+
audio: !1
|
|
480
|
+
});
|
|
481
|
+
function ht(t) {
|
|
482
|
+
let e = 0;
|
|
483
|
+
return t.torchSupported && (e += 1), t.singleShotSupported && (e += 1), e;
|
|
615
484
|
}
|
|
616
|
-
function
|
|
617
|
-
return
|
|
618
|
-
if (requestedFacing === "back" || requestedFacing === void 0) {
|
|
619
|
-
return isBackCameraName(camera.name);
|
|
620
|
-
} else {
|
|
621
|
-
return isFrontCameraName(camera.name);
|
|
622
|
-
}
|
|
623
|
-
});
|
|
485
|
+
function mt(t, e) {
|
|
486
|
+
return t.filter((r) => e === "back" || e === void 0 ? Ee(r.name) : _e(r.name));
|
|
624
487
|
}
|
|
625
|
-
const
|
|
626
|
-
if (
|
|
488
|
+
const ft = async (t, e = "4k", r = "back") => {
|
|
489
|
+
if (t.length === 0)
|
|
627
490
|
throw new Error("No cameras found");
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
return cameraPool[0];
|
|
637
|
-
}
|
|
638
|
-
if (cameraPool.length === 0) {
|
|
639
|
-
console.debug("No camera found with requested facing, using all cameras");
|
|
640
|
-
cameraPool = cameras;
|
|
641
|
-
}
|
|
642
|
-
if (requestedFacing === "back") {
|
|
643
|
-
const dualWideCamera = cameraPool.find(
|
|
644
|
-
(camera) => backDualWideCameraLocalizations.includes(camera.name)
|
|
491
|
+
if (t.length === 1)
|
|
492
|
+
return await t[0].startStream(e), t[0];
|
|
493
|
+
let a = mt(t, r);
|
|
494
|
+
if (a.length === 1)
|
|
495
|
+
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 = t), r === "back") {
|
|
497
|
+
const c = a.find(
|
|
498
|
+
(d) => lt.includes(d.name)
|
|
645
499
|
);
|
|
646
|
-
if (
|
|
647
|
-
await
|
|
648
|
-
return dualWideCamera;
|
|
649
|
-
}
|
|
500
|
+
if (c)
|
|
501
|
+
return await c.startStream(e), c;
|
|
650
502
|
}
|
|
651
|
-
if (
|
|
652
|
-
const
|
|
653
|
-
await
|
|
654
|
-
return lastCamera;
|
|
503
|
+
if (r === "front") {
|
|
504
|
+
const c = a[a.length - 1];
|
|
505
|
+
return await c.startStream(e), c;
|
|
655
506
|
}
|
|
656
|
-
const
|
|
657
|
-
let
|
|
658
|
-
let
|
|
659
|
-
|
|
660
|
-
const camera = cameraPool[i];
|
|
507
|
+
const n = /* @__PURE__ */ new Map();
|
|
508
|
+
let o, i = -1 / 0;
|
|
509
|
+
for (let c = a.length - 1; c >= 0; c--) {
|
|
510
|
+
const d = a[c];
|
|
661
511
|
try {
|
|
662
|
-
await
|
|
663
|
-
const
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
if (score === 2) {
|
|
675
|
-
console.debug("Found camera with all capabilities, returning early");
|
|
676
|
-
return camera;
|
|
677
|
-
}
|
|
678
|
-
} catch (error) {
|
|
679
|
-
console.warn(`Failed to test camera ${camera.name}:`, error);
|
|
680
|
-
camera.stopStream();
|
|
681
|
-
}
|
|
682
|
-
}
|
|
683
|
-
if (bestCamera) {
|
|
684
|
-
return bestCamera;
|
|
685
|
-
}
|
|
686
|
-
const firstCamera = cameraPool[0];
|
|
687
|
-
await firstCamera.startStream(resolution);
|
|
688
|
-
return firstCamera;
|
|
512
|
+
await d.startStream(e);
|
|
513
|
+
const h = ht(d);
|
|
514
|
+
if (n.set(d, h), h > i ? (o && o !== d && o.stopStream(), i = h, o = d) : d.stopStream(), h === 2)
|
|
515
|
+
return console.debug("Found camera with all capabilities, returning early"), d;
|
|
516
|
+
} catch (h) {
|
|
517
|
+
console.warn(`Failed to test camera ${d.name}:`, h), d.stopStream();
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
if (o)
|
|
521
|
+
return o;
|
|
522
|
+
const l = a[0];
|
|
523
|
+
return await l.startStream(e), l;
|
|
689
524
|
};
|
|
690
|
-
function
|
|
691
|
-
const
|
|
692
|
-
for (const
|
|
693
|
-
const
|
|
694
|
-
|
|
695
|
-
camerasWithStream.push(camera);
|
|
696
|
-
}
|
|
525
|
+
function gt(t) {
|
|
526
|
+
const e = [];
|
|
527
|
+
for (const r of t) {
|
|
528
|
+
const a = new Ae(r);
|
|
529
|
+
a !== null && e.push(a);
|
|
697
530
|
}
|
|
698
|
-
return
|
|
531
|
+
return e;
|
|
699
532
|
}
|
|
700
|
-
const
|
|
533
|
+
const O = {
|
|
701
534
|
"720p": { width: 1280, height: 720 },
|
|
702
535
|
"1080p": { width: 1920, height: 1080 },
|
|
703
536
|
"4k": { width: 3840, height: 2160 }
|
|
704
537
|
};
|
|
705
|
-
function
|
|
706
|
-
return Math.max(
|
|
538
|
+
function bt(t) {
|
|
539
|
+
return Math.max(t.width, t.height);
|
|
707
540
|
}
|
|
708
|
-
function
|
|
709
|
-
const
|
|
710
|
-
width: Math.max(
|
|
711
|
-
height: Math.min(
|
|
541
|
+
function pt(t) {
|
|
542
|
+
const e = {
|
|
543
|
+
width: Math.max(t.width, t.height),
|
|
544
|
+
height: Math.min(t.width, t.height)
|
|
712
545
|
};
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
)} is not 16:9, may cause issues with some video players.`
|
|
719
|
-
);
|
|
720
|
-
}
|
|
721
|
-
return normalized;
|
|
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;
|
|
722
551
|
}
|
|
723
|
-
function
|
|
724
|
-
const
|
|
725
|
-
|
|
726
|
-
return "4k";
|
|
727
|
-
} else if (actualWidth > 1280) {
|
|
728
|
-
return "1080p";
|
|
729
|
-
} else {
|
|
730
|
-
return "720p";
|
|
731
|
-
}
|
|
552
|
+
function vt(t) {
|
|
553
|
+
const e = bt(t);
|
|
554
|
+
return e > 1920 ? "4k" : e > 1280 ? "1080p" : "720p";
|
|
732
555
|
}
|
|
733
|
-
function
|
|
734
|
-
const
|
|
735
|
-
|
|
736
|
-
([key, value]) => {
|
|
737
|
-
return value.width === normalizedResolution.width && value.height === normalizedResolution.height;
|
|
738
|
-
}
|
|
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
|
|
739
559
|
);
|
|
740
|
-
if (!
|
|
741
|
-
const
|
|
742
|
-
console.warn(
|
|
743
|
-
`No exact resolution match found for ${JSON.stringify(
|
|
744
|
-
);
|
|
745
|
-
return closestMatch;
|
|
560
|
+
if (!r) {
|
|
561
|
+
const n = vt(t);
|
|
562
|
+
return console.warn(
|
|
563
|
+
`No exact resolution match found for ${JSON.stringify(t)}, categorizing as ${n}`
|
|
564
|
+
), n;
|
|
746
565
|
}
|
|
747
|
-
|
|
748
|
-
return resolutionKey;
|
|
566
|
+
return r[0];
|
|
749
567
|
}
|
|
750
|
-
class
|
|
568
|
+
class Ae {
|
|
751
569
|
/**
|
|
752
570
|
* The device info.
|
|
753
571
|
*/
|
|
@@ -764,9 +582,9 @@ class Camera {
|
|
|
764
582
|
activeStream;
|
|
765
583
|
name;
|
|
766
584
|
facingMode;
|
|
767
|
-
torchSupported =
|
|
768
|
-
torchEnabled =
|
|
769
|
-
singleShotSupported =
|
|
585
|
+
torchSupported = !1;
|
|
586
|
+
torchEnabled = !1;
|
|
587
|
+
singleShotSupported = !1;
|
|
770
588
|
maxSupportedResolution;
|
|
771
589
|
/**
|
|
772
590
|
* Reference to the original instance before it was proxied.
|
|
@@ -783,41 +601,29 @@ class Camera {
|
|
|
783
601
|
*
|
|
784
602
|
* @deprecated Not used. Reconsider using once Firefox and Chrome align on this.
|
|
785
603
|
*/
|
|
786
|
-
#
|
|
604
|
+
#e;
|
|
787
605
|
/**
|
|
788
606
|
* Creates a new Camera instance.
|
|
789
607
|
*
|
|
790
608
|
* @param deviceInfo - The device info.
|
|
791
609
|
*/
|
|
792
|
-
constructor(
|
|
793
|
-
if (
|
|
610
|
+
constructor(e) {
|
|
611
|
+
if (e.kind !== "videoinput")
|
|
794
612
|
throw new Error("Device is not a video input device");
|
|
795
|
-
|
|
796
|
-
this
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
this.facingMode = "back";
|
|
803
|
-
}
|
|
804
|
-
const originalRef = this;
|
|
805
|
-
const proxy = new Proxy(this, {
|
|
806
|
-
set(target, property, value, receiver) {
|
|
807
|
-
const oldValue = Reflect.get(target, property, receiver);
|
|
808
|
-
const change = {
|
|
809
|
-
property,
|
|
810
|
-
oldValue,
|
|
811
|
-
value
|
|
613
|
+
this.deviceInfo = e, this.name = e.label, _e(e.label) && (this.facingMode = "front"), Ee(e.label) && (this.facingMode = "back");
|
|
614
|
+
const r = this, a = new Proxy(this, {
|
|
615
|
+
set(n, o, i, l) {
|
|
616
|
+
const c = Reflect.get(n, o, l), d = {
|
|
617
|
+
property: o,
|
|
618
|
+
oldValue: c,
|
|
619
|
+
value: i
|
|
812
620
|
};
|
|
813
|
-
|
|
814
|
-
return Reflect.set(target, property, value, receiver);
|
|
621
|
+
return r.notify(d), Reflect.set(n, o, i, l);
|
|
815
622
|
}
|
|
816
623
|
});
|
|
817
|
-
this.notify = (
|
|
818
|
-
this.notifyStateChange?.(
|
|
819
|
-
};
|
|
820
|
-
return proxy;
|
|
624
|
+
return this.notify = (n) => {
|
|
625
|
+
this.notifyStateChange?.(a, n);
|
|
626
|
+
}, a;
|
|
821
627
|
}
|
|
822
628
|
/**
|
|
823
629
|
* Starts a stream with the specified resolution.
|
|
@@ -825,25 +631,19 @@ class Camera {
|
|
|
825
631
|
* @param resolution - The resolution to start the stream with.
|
|
826
632
|
* @returns The stream.
|
|
827
633
|
*/
|
|
828
|
-
async startStream(
|
|
829
|
-
if (this.activeStream)
|
|
634
|
+
async startStream(e) {
|
|
635
|
+
if (this.activeStream)
|
|
830
636
|
return this.activeStream;
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
const videoTrack = stream.getVideoTracks()[0];
|
|
839
|
-
videoTrack.onended = (e) => {
|
|
840
|
-
this.stopStream();
|
|
841
|
-
this.notify({
|
|
842
|
-
event: e,
|
|
637
|
+
this.maxSupportedResolution && (e = this.maxSupportedResolution);
|
|
638
|
+
const r = await this.acquireStreamWithFallback(e);
|
|
639
|
+
this.populateCapabilities(r), this.activeStream = r;
|
|
640
|
+
const a = r.getVideoTracks()[0];
|
|
641
|
+
return a.onended = (n) => {
|
|
642
|
+
this.stopStream(), this.notify({
|
|
643
|
+
event: n,
|
|
843
644
|
payload: "TRACK_END"
|
|
844
645
|
});
|
|
845
|
-
};
|
|
846
|
-
return stream;
|
|
646
|
+
}, r;
|
|
847
647
|
}
|
|
848
648
|
/**
|
|
849
649
|
* Acquires a camera stream with the specified resolution.
|
|
@@ -852,25 +652,24 @@ class Camera {
|
|
|
852
652
|
* @param resolution - The resolution to acquire the stream with.
|
|
853
653
|
* @returns The stream.
|
|
854
654
|
*/
|
|
855
|
-
async acquireStreamWithFallback(
|
|
655
|
+
async acquireStreamWithFallback(e) {
|
|
856
656
|
try {
|
|
857
|
-
const
|
|
858
|
-
|
|
657
|
+
const r = dt(
|
|
658
|
+
e,
|
|
859
659
|
this.facingMode,
|
|
860
660
|
this.deviceInfo.deviceId
|
|
861
661
|
);
|
|
862
|
-
return await navigator.mediaDevices.getUserMedia(
|
|
863
|
-
} catch (
|
|
662
|
+
return await navigator.mediaDevices.getUserMedia(r);
|
|
663
|
+
} catch (r) {
|
|
864
664
|
console.warn(
|
|
865
|
-
`Can't get camera stream for ${this.name} at ${
|
|
866
|
-
|
|
665
|
+
`Can't get camera stream for ${this.name} at ${e}`,
|
|
666
|
+
r
|
|
867
667
|
);
|
|
868
|
-
let
|
|
869
|
-
if (
|
|
668
|
+
let a = Object.keys(O).indexOf(e);
|
|
669
|
+
if (a === 0)
|
|
870
670
|
throw new Error("Failed to get camera stream");
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
return await this.acquireStreamWithFallback(fallbackResolution);
|
|
671
|
+
const n = Object.keys(O)[a - 1];
|
|
672
|
+
return await this.acquireStreamWithFallback(n);
|
|
874
673
|
}
|
|
875
674
|
}
|
|
876
675
|
/**
|
|
@@ -878,45 +677,18 @@ class Camera {
|
|
|
878
677
|
*
|
|
879
678
|
* @param stream - The stream to populate the capabilities from.
|
|
880
679
|
*/
|
|
881
|
-
populateCapabilities(
|
|
882
|
-
this.streamCapabilities =
|
|
883
|
-
const
|
|
884
|
-
|
|
885
|
-
if (!trackSettings.width || !trackSettings.height) {
|
|
680
|
+
populateCapabilities(e) {
|
|
681
|
+
this.streamCapabilities = e.getVideoTracks()[0].getCapabilities();
|
|
682
|
+
const a = e.getVideoTracks()[0].getSettings();
|
|
683
|
+
if (!a.width || !a.height)
|
|
886
684
|
throw new Error(
|
|
887
685
|
"Video track resolution not available. Should not happen."
|
|
888
686
|
);
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
const resolutionKey = findResolutionKey(videoTrackResolution);
|
|
895
|
-
if (!this.maxSupportedResolution && resolutionKey) {
|
|
896
|
-
this.maxSupportedResolution = resolutionKey;
|
|
897
|
-
}
|
|
898
|
-
if ("torch" in this.streamCapabilities) {
|
|
899
|
-
this.torchSupported = true;
|
|
900
|
-
}
|
|
901
|
-
if ("focusMode" in this.streamCapabilities && this.streamCapabilities.focusMode?.includes("single-shot")) {
|
|
902
|
-
this.singleShotSupported = true;
|
|
903
|
-
}
|
|
904
|
-
if (this.facingMode === "front" && this.streamCapabilities.facingMode?.includes("environment")) {
|
|
905
|
-
this.facingMode = "back";
|
|
906
|
-
console.warn("Front camera selected, but facingMode is environment");
|
|
907
|
-
}
|
|
908
|
-
if (this.facingMode === "back" && this.streamCapabilities.facingMode?.includes("user")) {
|
|
909
|
-
this.facingMode = "front";
|
|
910
|
-
console.warn("Back camera selected, but facingMode is user");
|
|
911
|
-
}
|
|
912
|
-
if (!this.facingMode) {
|
|
913
|
-
if (this.streamCapabilities.facingMode?.includes("environment")) {
|
|
914
|
-
this.facingMode = "back";
|
|
915
|
-
}
|
|
916
|
-
if (this.streamCapabilities.facingMode?.includes("user")) {
|
|
917
|
-
this.facingMode = "front";
|
|
918
|
-
}
|
|
919
|
-
}
|
|
687
|
+
const n = {
|
|
688
|
+
width: a.width,
|
|
689
|
+
height: a.height
|
|
690
|
+
}, o = wt(n);
|
|
691
|
+
!this.maxSupportedResolution && o && (this.maxSupportedResolution = o), "torch" in this.streamCapabilities && (this.torchSupported = !0), "focusMode" in this.streamCapabilities && this.streamCapabilities.focusMode?.includes("single-shot") && (this.singleShotSupported = !0), this.facingMode === "front" && this.streamCapabilities.facingMode?.includes("environment") && (this.facingMode = "back", console.warn("Front camera selected, but facingMode is environment")), this.facingMode === "back" && this.streamCapabilities.facingMode?.includes("user") && (this.facingMode = "front", console.warn("Back camera selected, but facingMode is user")), this.facingMode || (this.streamCapabilities.facingMode?.includes("environment") && (this.facingMode = "back"), this.streamCapabilities.facingMode?.includes("user") && (this.facingMode = "front"));
|
|
920
692
|
}
|
|
921
693
|
/**
|
|
922
694
|
* Toggles the torch on the camera.
|
|
@@ -924,27 +696,21 @@ class Camera {
|
|
|
924
696
|
* @returns The torch status.
|
|
925
697
|
*/
|
|
926
698
|
async toggleTorch() {
|
|
927
|
-
const
|
|
928
|
-
if (!
|
|
699
|
+
const e = this.getVideoTrack();
|
|
700
|
+
if (!e)
|
|
929
701
|
throw new Error("No active stream on Camera instance.");
|
|
930
|
-
|
|
931
|
-
if (!this.torchSupported) {
|
|
702
|
+
if (!this.torchSupported)
|
|
932
703
|
throw new Error("Torch not supported on this device.");
|
|
933
|
-
}
|
|
934
704
|
try {
|
|
935
|
-
await
|
|
705
|
+
await e.applyConstraints({
|
|
936
706
|
advanced: [
|
|
937
707
|
{
|
|
938
708
|
torch: !this.torchEnabled
|
|
939
709
|
}
|
|
940
710
|
]
|
|
941
|
-
});
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
console.error("Failed to toggle torch", error);
|
|
945
|
-
this.torchEnabled = false;
|
|
946
|
-
this.torchSupported = false;
|
|
947
|
-
throw new Error("Failed to toggle torch", { cause: error });
|
|
711
|
+
}), this.torchEnabled = !this.torchEnabled;
|
|
712
|
+
} catch (r) {
|
|
713
|
+
throw console.error("Failed to toggle torch", r), this.torchEnabled = !1, this.torchSupported = !1, new Error("Failed to toggle torch", { cause: r });
|
|
948
714
|
}
|
|
949
715
|
return this.torchEnabled;
|
|
950
716
|
}
|
|
@@ -952,13 +718,7 @@ class Camera {
|
|
|
952
718
|
* Stops the stream on the camera.
|
|
953
719
|
*/
|
|
954
720
|
stopStream() {
|
|
955
|
-
|
|
956
|
-
console.debug(`Stopping active stream on ${this.name}`);
|
|
957
|
-
closeStreamTracks(this.activeStream);
|
|
958
|
-
this.activeStream = void 0;
|
|
959
|
-
this.streamCapabilities = void 0;
|
|
960
|
-
this.torchEnabled = false;
|
|
961
|
-
}
|
|
721
|
+
this.activeStream && (console.debug(`Stopping active stream on ${this.name}`), Re(this.activeStream), this.activeStream = void 0, this.streamCapabilities = void 0, this.torchEnabled = !1);
|
|
962
722
|
}
|
|
963
723
|
/**
|
|
964
724
|
* Gets the video track on the camera.
|
|
@@ -973,241 +733,166 @@ class Camera {
|
|
|
973
733
|
return this.activeStream.getVideoTracks()[0];
|
|
974
734
|
}
|
|
975
735
|
}
|
|
976
|
-
const
|
|
977
|
-
|
|
978
|
-
|
|
736
|
+
const $e = {
|
|
737
|
+
cameras: [],
|
|
738
|
+
facingFilter: void 0,
|
|
739
|
+
videoElement: void 0,
|
|
740
|
+
playbackState: "idle",
|
|
741
|
+
selectedCamera: void 0,
|
|
742
|
+
isSwappingCamera: !1,
|
|
743
|
+
isQueryingCameras: !1,
|
|
744
|
+
mirrorX: !1,
|
|
745
|
+
errorState: void 0
|
|
746
|
+
}, m = be()(
|
|
747
|
+
// this is important! Otherwise solid-zustand will start mutating the initial state
|
|
748
|
+
ge(() => structuredClone($e))
|
|
749
|
+
), yt = () => {
|
|
750
|
+
console.debug("Stopping all cameras and resetting the `cameraManagerStore`."), m.getState().cameras.forEach((t) => {
|
|
751
|
+
t.stopStream();
|
|
752
|
+
}), m.setState(structuredClone($e));
|
|
753
|
+
}, he = Element.prototype.attachShadow;
|
|
754
|
+
function ue() {
|
|
755
|
+
return typeof window.ShadyDOM < "u" && typeof ShadowRoot < "u";
|
|
979
756
|
}
|
|
980
|
-
function
|
|
981
|
-
return typeof ShadowRoot
|
|
757
|
+
function St() {
|
|
758
|
+
return typeof ShadowRoot < "u";
|
|
982
759
|
}
|
|
983
|
-
function
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
callback(shadowRoot);
|
|
989
|
-
return shadowRoot;
|
|
990
|
-
};
|
|
760
|
+
function Ct(t) {
|
|
761
|
+
he == null || ue() || (Element.prototype.attachShadow = function(e) {
|
|
762
|
+
const r = he.call(this, e);
|
|
763
|
+
return t(r), r;
|
|
764
|
+
});
|
|
991
765
|
}
|
|
992
|
-
function
|
|
993
|
-
const
|
|
994
|
-
let
|
|
995
|
-
const
|
|
996
|
-
for (const
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
queue.clear();
|
|
766
|
+
function kt(t, ...e) {
|
|
767
|
+
const r = new Set(e);
|
|
768
|
+
let a = !1;
|
|
769
|
+
const n = () => {
|
|
770
|
+
for (const o of r)
|
|
771
|
+
t(o);
|
|
772
|
+
r.clear();
|
|
1000
773
|
};
|
|
1001
774
|
return {
|
|
1002
775
|
isRunning() {
|
|
1003
|
-
return
|
|
776
|
+
return a;
|
|
1004
777
|
},
|
|
1005
|
-
schedule(
|
|
1006
|
-
|
|
1007
|
-
if (running) {
|
|
1008
|
-
flush();
|
|
1009
|
-
}
|
|
778
|
+
schedule(o) {
|
|
779
|
+
r.add(o), a && n();
|
|
1010
780
|
},
|
|
1011
781
|
stop() {
|
|
1012
|
-
|
|
782
|
+
a = !1;
|
|
1013
783
|
},
|
|
1014
784
|
run() {
|
|
1015
|
-
|
|
1016
|
-
return;
|
|
1017
|
-
running = true;
|
|
1018
|
-
flush();
|
|
785
|
+
a || (a = !0, n());
|
|
1019
786
|
}
|
|
1020
787
|
};
|
|
1021
788
|
}
|
|
1022
|
-
const
|
|
1023
|
-
childList:
|
|
1024
|
-
subtree:
|
|
789
|
+
const Et = {
|
|
790
|
+
childList: !0,
|
|
791
|
+
subtree: !0
|
|
792
|
+
}, _t = (t) => {
|
|
793
|
+
typeof queueMicrotask < "u" ? queueMicrotask(t) : typeof Promise < "u" ? Promise.resolve().then(() => t()) : setTimeout(() => t(), 0);
|
|
1025
794
|
};
|
|
1026
|
-
|
|
1027
|
-
if (typeof
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
function nodeListToArray(nodeList) {
|
|
1035
|
-
if (typeof Symbol !== "undefined" && nodeList[Symbol.iterator] != null) {
|
|
1036
|
-
return [...nodeList];
|
|
1037
|
-
} else {
|
|
1038
|
-
const arr = [];
|
|
1039
|
-
for (let i = 0; i < nodeList.length; i++) {
|
|
1040
|
-
arr[i] = nodeList[i];
|
|
1041
|
-
}
|
|
1042
|
-
return arr;
|
|
795
|
+
function me(t) {
|
|
796
|
+
if (typeof Symbol < "u" && t[Symbol.iterator] != null)
|
|
797
|
+
return [...t];
|
|
798
|
+
{
|
|
799
|
+
const e = [];
|
|
800
|
+
for (let r = 0; r < t.length; r++)
|
|
801
|
+
e[r] = t[r];
|
|
802
|
+
return e;
|
|
1043
803
|
}
|
|
1044
804
|
}
|
|
1045
|
-
function
|
|
1046
|
-
|
|
1047
|
-
return new Set(nodeListToArray(window.ShadyDOM.nativeMethods.querySelectorAll.call(document.documentElement, query)));
|
|
1048
|
-
}
|
|
1049
|
-
return new Set(!("querySelectorAll" in root) ? [] : nodeListToArray(root.querySelectorAll(query)));
|
|
805
|
+
function Tt(t, e) {
|
|
806
|
+
return ue() ? new Set(me(window.ShadyDOM.nativeMethods.querySelectorAll.call(document.documentElement, e))) : new Set("querySelectorAll" in t ? me(t.querySelectorAll(e)) : []);
|
|
1050
807
|
}
|
|
1051
|
-
function
|
|
1052
|
-
return /* @__PURE__ */ new Set([...
|
|
808
|
+
function Mt(t, e) {
|
|
809
|
+
return /* @__PURE__ */ new Set([...t ?? [], ...e ?? []]);
|
|
1053
810
|
}
|
|
1054
|
-
function
|
|
1055
|
-
return "activeElement" in
|
|
811
|
+
function xt(t) {
|
|
812
|
+
return "activeElement" in t;
|
|
1056
813
|
}
|
|
1057
|
-
function
|
|
1058
|
-
if (
|
|
1059
|
-
observeRoot(root);
|
|
1060
|
-
}
|
|
1061
|
-
if (isShady() && root instanceof ShadowRoot)
|
|
814
|
+
function Fe(t = document.documentElement) {
|
|
815
|
+
if (xt(t) && De(t), ue() && t instanceof ShadowRoot || !St())
|
|
1062
816
|
return;
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
const shadowRoot = "shadowRoot" in root && root.shadowRoot != null ? [root.shadowRoot] : [];
|
|
1067
|
-
for (const node of [...childNodes, ...shadowRoot]) {
|
|
1068
|
-
observeMissingRoots(node);
|
|
1069
|
-
}
|
|
817
|
+
const e = t.childNodes, r = "shadowRoot" in t && t.shadowRoot != null ? [t.shadowRoot] : [];
|
|
818
|
+
for (const a of [...e, ...r])
|
|
819
|
+
Fe(a);
|
|
1070
820
|
}
|
|
1071
|
-
function
|
|
1072
|
-
|
|
1073
|
-
return node.isConnected;
|
|
1074
|
-
return node.ownerDocument == null || !(node.ownerDocument.compareDocumentPosition(node) & node.DOCUMENT_POSITION_DISCONNECTED);
|
|
821
|
+
function Rt(t) {
|
|
822
|
+
return "isConnected" in Node.prototype ? t.isConnected : t.ownerDocument == null || !(t.ownerDocument.compareDocumentPosition(t) & t.DOCUMENT_POSITION_DISCONNECTED);
|
|
1075
823
|
}
|
|
1076
|
-
const
|
|
1077
|
-
function
|
|
1078
|
-
const
|
|
1079
|
-
|
|
1080
|
-
const
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
scheduleFlush();
|
|
1105
|
-
}
|
|
1106
|
-
};
|
|
1107
|
-
const clearQueue = () => {
|
|
1108
|
-
const items = [...queue];
|
|
1109
|
-
queue.clear();
|
|
1110
|
-
return items;
|
|
1111
|
-
};
|
|
1112
|
-
const clearObservedTargets = () => {
|
|
1113
|
-
observedTargets.clear();
|
|
1114
|
-
};
|
|
1115
|
-
const queryRootAndHandleMutationChanges = (root, query) => {
|
|
1116
|
-
let oldQuerySelectorMap = rootToQuerySelectorToMatchedNodesMap.get(root);
|
|
1117
|
-
const currentNodes = queryRoot(root, query);
|
|
1118
|
-
const oldNodes = oldQuerySelectorMap == null ? void 0 : oldQuerySelectorMap.get(query);
|
|
1119
|
-
const mergedNodes = mergeNodes(currentNodes, oldNodes);
|
|
1120
|
-
handleMutationChange(mergedNodes);
|
|
1121
|
-
if (oldQuerySelectorMap == null) {
|
|
1122
|
-
oldQuerySelectorMap = /* @__PURE__ */ new Map();
|
|
1123
|
-
rootToQuerySelectorToMatchedNodesMap.set(root, oldQuerySelectorMap);
|
|
1124
|
-
}
|
|
1125
|
-
oldQuerySelectorMap.set(query, currentNodes);
|
|
1126
|
-
};
|
|
1127
|
-
const handleMutationChange = (targetNodes) => {
|
|
1128
|
-
for (const targetNode of targetNodes) {
|
|
1129
|
-
const lastValue = nodeToLastConnectionValueMap.get(targetNode);
|
|
1130
|
-
const isTargetNodeConnected = isConnected(targetNode);
|
|
1131
|
-
if (lastValue !== isTargetNodeConnected) {
|
|
1132
|
-
nodeToLastConnectionValueMap.set(targetNode, isTargetNodeConnected);
|
|
1133
|
-
addToQueue({
|
|
1134
|
-
connected: isTargetNodeConnected,
|
|
1135
|
-
target: targetNode
|
|
1136
|
-
});
|
|
1137
|
-
}
|
|
1138
|
-
}
|
|
1139
|
-
};
|
|
1140
|
-
const addObservedTarget = (target) => {
|
|
1141
|
-
rootObserverQueue.run();
|
|
1142
|
-
if (!hasFoundMissingRoots) {
|
|
1143
|
-
hasFoundMissingRoots = true;
|
|
1144
|
-
observeMissingRoots();
|
|
1145
|
-
}
|
|
1146
|
-
observedTargets.add(target);
|
|
1147
|
-
if (typeof target !== "string") {
|
|
1148
|
-
handleMutationChange([target]);
|
|
1149
|
-
} else {
|
|
1150
|
-
for (const root of OBSERVED_ROOTS) {
|
|
1151
|
-
queryRootAndHandleMutationChanges(root, target);
|
|
1152
|
-
}
|
|
824
|
+
const W = /* @__PURE__ */ new Map();
|
|
825
|
+
function At(t, e) {
|
|
826
|
+
const r = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new WeakMap();
|
|
827
|
+
let i = !1, l = !1, c = !1;
|
|
828
|
+
const d = () => {
|
|
829
|
+
l = !0;
|
|
830
|
+
const p = [...r];
|
|
831
|
+
p.length > 0 && e(p, t), r.clear(), i = !1, l = !1;
|
|
832
|
+
}, h = () => {
|
|
833
|
+
i || (i = !0, _t(d));
|
|
834
|
+
}, C = (p) => {
|
|
835
|
+
r.add(p), l || h();
|
|
836
|
+
}, w = () => {
|
|
837
|
+
const p = [...r];
|
|
838
|
+
return r.clear(), p;
|
|
839
|
+
}, u = () => {
|
|
840
|
+
a.clear();
|
|
841
|
+
}, v = (p, k) => {
|
|
842
|
+
let x = n.get(p);
|
|
843
|
+
const I = Tt(p, k), G = x?.get(k), X = Mt(I, G);
|
|
844
|
+
b(X), x == null && (x = /* @__PURE__ */ new Map(), n.set(p, x)), x.set(k, I);
|
|
845
|
+
}, b = (p) => {
|
|
846
|
+
for (const k of p) {
|
|
847
|
+
const x = o.get(k), I = Rt(k);
|
|
848
|
+
x !== I && (o.set(k, I), C({
|
|
849
|
+
connected: I,
|
|
850
|
+
target: k
|
|
851
|
+
}));
|
|
1153
852
|
}
|
|
853
|
+
}, g = {
|
|
854
|
+
observedTargets: a,
|
|
855
|
+
queryRootAndHandleMutationChanges: v,
|
|
856
|
+
handleMutationChange: b,
|
|
857
|
+
addObservedTarget: (p) => {
|
|
858
|
+
if (ie.run(), c || (c = !0, Fe()), a.add(p), typeof p != "string")
|
|
859
|
+
b([p]);
|
|
860
|
+
else
|
|
861
|
+
for (const k of oe)
|
|
862
|
+
v(k, p);
|
|
863
|
+
},
|
|
864
|
+
clearObservedTargets: u,
|
|
865
|
+
clearQueue: w
|
|
1154
866
|
};
|
|
1155
|
-
|
|
1156
|
-
observedTargets,
|
|
1157
|
-
queryRootAndHandleMutationChanges,
|
|
1158
|
-
handleMutationChange,
|
|
1159
|
-
addObservedTarget,
|
|
1160
|
-
clearObservedTargets,
|
|
1161
|
-
clearQueue
|
|
1162
|
-
};
|
|
1163
|
-
CONNECTION_OBSERVER_INTERNALS_MAP.set(observer, internals);
|
|
867
|
+
W.set(t, g);
|
|
1164
868
|
}
|
|
1165
|
-
const
|
|
1166
|
-
for (const
|
|
1167
|
-
if (
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
}
|
|
1176
|
-
}
|
|
1177
|
-
}
|
|
1178
|
-
}
|
|
1179
|
-
};
|
|
1180
|
-
const OBSERVED_ROOTS = /* @__PURE__ */ new Set();
|
|
1181
|
-
const observeRoot = /* @__PURE__ */ (() => {
|
|
1182
|
-
let instance;
|
|
1183
|
-
return function(root) {
|
|
1184
|
-
if (OBSERVED_ROOTS.has(root))
|
|
1185
|
-
return;
|
|
1186
|
-
OBSERVED_ROOTS.add(root);
|
|
1187
|
-
if (instance == null) {
|
|
1188
|
-
instance = new MutationObserver(mutationCallback);
|
|
1189
|
-
}
|
|
1190
|
-
instance.observe(root, MUTATION_OBSERVER_INIT);
|
|
869
|
+
const $t = (t) => {
|
|
870
|
+
for (const e of t)
|
|
871
|
+
if (e.type === "childList")
|
|
872
|
+
for (const r of W.values())
|
|
873
|
+
for (const a of r.observedTargets)
|
|
874
|
+
typeof a == "string" ? r.queryRootAndHandleMutationChanges(e.target, a) : r.handleMutationChange([a]);
|
|
875
|
+
}, oe = /* @__PURE__ */ new Set(), De = /* @__PURE__ */ (() => {
|
|
876
|
+
let t;
|
|
877
|
+
return function(e) {
|
|
878
|
+
oe.has(e) || (oe.add(e), t == null && (t = new MutationObserver($t)), t.observe(e, Et));
|
|
1191
879
|
};
|
|
1192
|
-
})();
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
if (
|
|
1200
|
-
throw new
|
|
1201
|
-
|
|
1202
|
-
throw new TypeError(`Failed to construct '${ConnectionObserver.name}': The callback provided as parameter 1 is not a function.`);
|
|
1203
|
-
}
|
|
1204
|
-
initializeConnectionObserver(this, callback);
|
|
880
|
+
})(), ie = kt(De, document.documentElement);
|
|
881
|
+
class N {
|
|
882
|
+
constructor(e) {
|
|
883
|
+
if (new.target === void 0)
|
|
884
|
+
throw new TypeError(`Constructor ${N.name} requires 'new'`);
|
|
885
|
+
if (e === void 0)
|
|
886
|
+
throw new ReferenceError(`Failed to construct '${N.name}': 1 argument required, but only 0 present.`);
|
|
887
|
+
if (typeof e != "function")
|
|
888
|
+
throw new TypeError(`Failed to construct '${N.name}': The callback provided as parameter 1 is not a function.`);
|
|
889
|
+
At(this, e);
|
|
1205
890
|
}
|
|
1206
891
|
/**
|
|
1207
892
|
* The Symbol.@@toStringTag value
|
|
1208
893
|
*/
|
|
1209
894
|
get [Symbol.toStringTag]() {
|
|
1210
|
-
return
|
|
895
|
+
return "ConnectionObserver";
|
|
1211
896
|
}
|
|
1212
897
|
/**
|
|
1213
898
|
* Observe the given node or query selector for connections/disconnections.
|
|
@@ -1215,153 +900,126 @@ class ConnectionObserver {
|
|
|
1215
900
|
* as for example "img[data-some-attr]", for each new MutationRecord, the query selector
|
|
1216
901
|
* will be executed and the matched nodes will be observed for connections/disconnections
|
|
1217
902
|
*/
|
|
1218
|
-
observe(
|
|
1219
|
-
if (
|
|
1220
|
-
throw new ReferenceError(`Failed to execute '${this.observe.name}' on '${
|
|
1221
|
-
|
|
1222
|
-
throw new TypeError(`Failed to execute '${this.observe.name}' on '${
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
if (internals == null)
|
|
1226
|
-
return;
|
|
1227
|
-
internals.addObservedTarget(target);
|
|
903
|
+
observe(e) {
|
|
904
|
+
if (e === void 0)
|
|
905
|
+
throw new ReferenceError(`Failed to execute '${this.observe.name}' on '${N.name}': 1 argument required, but only 0 present.`);
|
|
906
|
+
if (typeof e != "string" && !(e instanceof Node))
|
|
907
|
+
throw new TypeError(`Failed to execute '${this.observe.name}' on '${N.name}': parameter 1 is not of type 'Node' or a DOMString.`);
|
|
908
|
+
const r = W.get(this);
|
|
909
|
+
r?.addObservedTarget(e);
|
|
1228
910
|
}
|
|
1229
911
|
/**
|
|
1230
912
|
* Takes the records immediately (instead of waiting for the next flush)
|
|
1231
913
|
*/
|
|
1232
914
|
takeRecords() {
|
|
1233
|
-
const
|
|
1234
|
-
|
|
1235
|
-
return [];
|
|
1236
|
-
return internals.clearQueue();
|
|
915
|
+
const e = W.get(this);
|
|
916
|
+
return e == null ? [] : e.clearQueue();
|
|
1237
917
|
}
|
|
1238
918
|
/**
|
|
1239
919
|
* Disconnects the ConnectionObserver such that none of its callbacks will be invoked any longer
|
|
1240
920
|
*/
|
|
1241
921
|
disconnect() {
|
|
1242
|
-
const
|
|
1243
|
-
|
|
1244
|
-
return;
|
|
1245
|
-
internals.clearObservedTargets();
|
|
922
|
+
const e = W.get(this);
|
|
923
|
+
e?.clearObservedTargets();
|
|
1246
924
|
}
|
|
1247
925
|
}
|
|
1248
|
-
|
|
1249
|
-
function
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
element.removeEventListener(...args);
|
|
926
|
+
Ct(ie.schedule.bind(ie));
|
|
927
|
+
function Ft(t, ...e) {
|
|
928
|
+
return t.addEventListener(...e), () => {
|
|
929
|
+
t.removeEventListener(...e);
|
|
1253
930
|
};
|
|
1254
931
|
}
|
|
1255
|
-
function
|
|
1256
|
-
let
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
});
|
|
1261
|
-
if (!cleanup) {
|
|
932
|
+
function Dt(t, e) {
|
|
933
|
+
let r;
|
|
934
|
+
if (e((a, n) => {
|
|
935
|
+
t.addEventListener(a, n), r = () => t.removeEventListener(a, n);
|
|
936
|
+
}), !r)
|
|
1262
937
|
throw new Error("you forgot to add event listener");
|
|
1263
|
-
|
|
1264
|
-
return cleanup;
|
|
938
|
+
return r;
|
|
1265
939
|
}
|
|
1266
|
-
function
|
|
1267
|
-
const
|
|
1268
|
-
if ("detached" in
|
|
1269
|
-
|
|
1270
|
-
return detached;
|
|
1271
|
-
}
|
|
940
|
+
function se(t) {
|
|
941
|
+
const e = Ie(t);
|
|
942
|
+
if ("detached" in e)
|
|
943
|
+
return e.detached;
|
|
1272
944
|
try {
|
|
1273
|
-
new Uint8Array(
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
return true;
|
|
945
|
+
return new Uint8Array(e), !1;
|
|
946
|
+
} catch {
|
|
947
|
+
return !0;
|
|
1277
948
|
}
|
|
1278
949
|
}
|
|
1279
|
-
class
|
|
1280
|
-
#
|
|
1281
|
-
#
|
|
1282
|
-
#
|
|
1283
|
-
#
|
|
1284
|
-
#
|
|
1285
|
-
#
|
|
1286
|
-
#
|
|
1287
|
-
#
|
|
1288
|
-
#
|
|
1289
|
-
#
|
|
950
|
+
class It {
|
|
951
|
+
#e;
|
|
952
|
+
#o = null;
|
|
953
|
+
#a = null;
|
|
954
|
+
#r = null;
|
|
955
|
+
#n = null;
|
|
956
|
+
#t = null;
|
|
957
|
+
#s = 0;
|
|
958
|
+
#l = 0;
|
|
959
|
+
#i;
|
|
960
|
+
#u = 4;
|
|
1290
961
|
/**
|
|
1291
962
|
* Creates a new VideoFrameProcessor.
|
|
1292
963
|
*
|
|
1293
964
|
* @param options - The options for the VideoFrameProcessor.
|
|
1294
965
|
*/
|
|
1295
|
-
constructor(
|
|
1296
|
-
const { canvasRenderingMode = "webgl2", fallbackWebGlTo2d =
|
|
1297
|
-
this.#
|
|
1298
|
-
|
|
1299
|
-
if (
|
|
1300
|
-
this.#initialize2dContext();
|
|
1301
|
-
} else if (canvasRenderingMode === "webgl2") {
|
|
966
|
+
constructor(e = {}) {
|
|
967
|
+
const { canvasRenderingMode: r = "webgl2", fallbackWebGlTo2d: a = !0 } = e;
|
|
968
|
+
if (this.#i = r, this.#e = document.createElement("canvas"), r === "2d")
|
|
969
|
+
this.#d();
|
|
970
|
+
else if (r === "webgl2")
|
|
1302
971
|
try {
|
|
1303
|
-
this.#
|
|
1304
|
-
} catch (
|
|
1305
|
-
if (
|
|
972
|
+
this.#h();
|
|
973
|
+
} catch (n) {
|
|
974
|
+
if (a)
|
|
1306
975
|
console.warn(
|
|
1307
976
|
"Failed to create WebGL2 context, falling back to 2D canvas"
|
|
1308
|
-
);
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
} else {
|
|
1312
|
-
throw error;
|
|
1313
|
-
}
|
|
977
|
+
), this.#i = "2d", this.#d();
|
|
978
|
+
else
|
|
979
|
+
throw n;
|
|
1314
980
|
}
|
|
1315
|
-
|
|
981
|
+
else
|
|
1316
982
|
throw new Error(
|
|
1317
|
-
`Unsupported rendering context: ${
|
|
983
|
+
`Unsupported rendering context: ${r}`
|
|
1318
984
|
);
|
|
1319
|
-
}
|
|
1320
985
|
}
|
|
1321
986
|
/**
|
|
1322
987
|
* Initializes the 2D canvas context.
|
|
1323
988
|
*/
|
|
1324
|
-
#
|
|
1325
|
-
const
|
|
1326
|
-
alpha:
|
|
1327
|
-
willReadFrequently:
|
|
989
|
+
#d() {
|
|
990
|
+
const e = this.#e.getContext("2d", {
|
|
991
|
+
alpha: !1,
|
|
992
|
+
willReadFrequently: !0
|
|
1328
993
|
});
|
|
1329
|
-
if (!
|
|
1330
|
-
this.#
|
|
994
|
+
if (!e) throw new Error("CanvasRenderingContext2D is missing!");
|
|
995
|
+
this.#o = e;
|
|
1331
996
|
}
|
|
1332
997
|
/**
|
|
1333
998
|
* Initializes the WebGL2 context and resources.
|
|
1334
999
|
*/
|
|
1335
|
-
#
|
|
1336
|
-
const
|
|
1337
|
-
alpha:
|
|
1338
|
-
depth:
|
|
1339
|
-
stencil:
|
|
1340
|
-
antialias:
|
|
1341
|
-
premultipliedAlpha:
|
|
1342
|
-
preserveDrawingBuffer:
|
|
1343
|
-
desynchronized:
|
|
1000
|
+
#h() {
|
|
1001
|
+
const e = this.#e.getContext("webgl2", {
|
|
1002
|
+
alpha: !1,
|
|
1003
|
+
depth: !1,
|
|
1004
|
+
stencil: !1,
|
|
1005
|
+
antialias: !1,
|
|
1006
|
+
premultipliedAlpha: !1,
|
|
1007
|
+
preserveDrawingBuffer: !1,
|
|
1008
|
+
desynchronized: !1,
|
|
1344
1009
|
powerPreference: "high-performance"
|
|
1345
1010
|
});
|
|
1346
|
-
if (!
|
|
1347
|
-
this.#
|
|
1348
|
-
const
|
|
1349
|
-
if (!
|
|
1350
|
-
this.#
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
this.#webGl2Framebuffer = framebuffer;
|
|
1359
|
-
ctx.bindFramebuffer(ctx.FRAMEBUFFER, framebuffer);
|
|
1360
|
-
ctx.framebufferTexture2D(
|
|
1361
|
-
ctx.FRAMEBUFFER,
|
|
1362
|
-
ctx.COLOR_ATTACHMENT0,
|
|
1363
|
-
ctx.TEXTURE_2D,
|
|
1364
|
-
texture,
|
|
1011
|
+
if (!e) throw new Error("WebGL2RenderingContext is missing!");
|
|
1012
|
+
this.#a = e;
|
|
1013
|
+
const r = e.createTexture();
|
|
1014
|
+
if (!r) throw new Error("Failed to create WebGL texture");
|
|
1015
|
+
this.#r = r, e.bindTexture(e.TEXTURE_2D, r), 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
|
+
const a = e.createFramebuffer();
|
|
1017
|
+
if (!a) throw new Error("Failed to create framebuffer");
|
|
1018
|
+
this.#n = a, e.bindFramebuffer(e.FRAMEBUFFER, a), e.framebufferTexture2D(
|
|
1019
|
+
e.FRAMEBUFFER,
|
|
1020
|
+
e.COLOR_ATTACHMENT0,
|
|
1021
|
+
e.TEXTURE_2D,
|
|
1022
|
+
r,
|
|
1365
1023
|
0
|
|
1366
1024
|
);
|
|
1367
1025
|
}
|
|
@@ -1373,19 +1031,17 @@ class VideoFrameProcessor {
|
|
|
1373
1031
|
*
|
|
1374
1032
|
* @param arrayBuffer - The array buffer to reattach.
|
|
1375
1033
|
*/
|
|
1376
|
-
reattachArrayBuffer(
|
|
1377
|
-
const
|
|
1378
|
-
if (
|
|
1034
|
+
reattachArrayBuffer(e) {
|
|
1035
|
+
const r = Ie(e);
|
|
1036
|
+
if (se(r))
|
|
1379
1037
|
throw new Error("Can't use a detached array buffer!");
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
} else {
|
|
1038
|
+
const a = this.#s * this.#l * 4;
|
|
1039
|
+
if (r.byteLength === a)
|
|
1040
|
+
this.#t = new Uint8ClampedArray(r);
|
|
1041
|
+
else
|
|
1385
1042
|
throw new Error(
|
|
1386
|
-
`ArrayBuffer size mismatch: expected ${
|
|
1043
|
+
`ArrayBuffer size mismatch: expected ${a}, got ${r.byteLength}`
|
|
1387
1044
|
);
|
|
1388
|
-
}
|
|
1389
1045
|
}
|
|
1390
1046
|
/**
|
|
1391
1047
|
* Used to check if the processor owns the buffer.
|
|
@@ -1393,10 +1049,9 @@ class VideoFrameProcessor {
|
|
|
1393
1049
|
* @returns true if the processor owns the buffer, false otherwise.
|
|
1394
1050
|
*/
|
|
1395
1051
|
isBufferDetached() {
|
|
1396
|
-
if (!this.#
|
|
1052
|
+
if (!this.#t)
|
|
1397
1053
|
throw new Error("Buffer is missing!");
|
|
1398
|
-
|
|
1399
|
-
return isBufferDetached(this.#buffer.buffer);
|
|
1054
|
+
return se(this.#t.buffer);
|
|
1400
1055
|
}
|
|
1401
1056
|
/**
|
|
1402
1057
|
* Extracts image data from a source element.
|
|
@@ -1405,8 +1060,8 @@ class VideoFrameProcessor {
|
|
|
1405
1060
|
* @param area - The extraction area.
|
|
1406
1061
|
* @returns The image data.
|
|
1407
1062
|
*/
|
|
1408
|
-
getImageData(
|
|
1409
|
-
return this.#
|
|
1063
|
+
getImageData(e, r) {
|
|
1064
|
+
return this.#i === "2d" ? this.#m(e, r) : this.#f(e, r);
|
|
1410
1065
|
}
|
|
1411
1066
|
/**
|
|
1412
1067
|
* Used to get the current ImageData object with the current buffer. Useful
|
|
@@ -1416,10 +1071,9 @@ class VideoFrameProcessor {
|
|
|
1416
1071
|
* @returns ImageData object with the current buffer
|
|
1417
1072
|
*/
|
|
1418
1073
|
getCurrentImageData() {
|
|
1419
|
-
if (!this.#
|
|
1074
|
+
if (!this.#t)
|
|
1420
1075
|
throw new Error("Buffer is missing!");
|
|
1421
|
-
|
|
1422
|
-
return new ImageData(this.#buffer, this.#cachedWidth, this.#cachedHeight);
|
|
1076
|
+
return new ImageData(this.#t, this.#s, this.#l);
|
|
1423
1077
|
}
|
|
1424
1078
|
/**
|
|
1425
1079
|
* Extract image data using 2D canvas.
|
|
@@ -1428,18 +1082,11 @@ class VideoFrameProcessor {
|
|
|
1428
1082
|
* @param area - The extraction area.
|
|
1429
1083
|
* @returns The image data.
|
|
1430
1084
|
*/
|
|
1431
|
-
#
|
|
1432
|
-
if (!this.#
|
|
1085
|
+
#m(e, r) {
|
|
1086
|
+
if (!this.#o)
|
|
1433
1087
|
throw new Error("CanvasRenderingContext2D is missing!");
|
|
1434
|
-
const
|
|
1435
|
-
|
|
1436
|
-
const x = area?.x ?? 0;
|
|
1437
|
-
const y = area?.y ?? 0;
|
|
1438
|
-
const w = area?.width ?? fullWidth;
|
|
1439
|
-
const h = area?.height ?? fullHeight;
|
|
1440
|
-
this.#updateCanvasSize(w, h);
|
|
1441
|
-
this.#context2d.drawImage(source, x, y, w, h);
|
|
1442
|
-
return this.#context2d.getImageData(0, 0, w, h);
|
|
1088
|
+
const a = "videoWidth" in e ? e.videoWidth : e.width, n = "videoHeight" in e ? e.videoHeight : e.height, o = r?.x ?? 0, i = r?.y ?? 0, l = r?.width ?? a, c = r?.height ?? n;
|
|
1089
|
+
return this.#c(l, c), this.#o.drawImage(e, o, i, l, c), this.#o.getImageData(0, 0, l, c);
|
|
1443
1090
|
}
|
|
1444
1091
|
/**
|
|
1445
1092
|
* Extract image data using WebGL2.
|
|
@@ -1448,43 +1095,26 @@ class VideoFrameProcessor {
|
|
|
1448
1095
|
* @param area - The extraction area.
|
|
1449
1096
|
* @returns The image data.
|
|
1450
1097
|
*/
|
|
1451
|
-
#
|
|
1452
|
-
if (!this.#
|
|
1098
|
+
#f(e, r) {
|
|
1099
|
+
if (!this.#a || !this.#r || !this.#n)
|
|
1453
1100
|
throw new Error("WebGL2 context or resources are missing!");
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
const fullHeight = "videoHeight" in source ? source.videoHeight : source.height;
|
|
1457
|
-
const x = area?.x ?? 0;
|
|
1458
|
-
const y = area?.y ?? 0;
|
|
1459
|
-
const w = area?.width ?? fullWidth;
|
|
1460
|
-
const h = area?.height ?? fullHeight;
|
|
1461
|
-
const requiredSize = w * h * 4;
|
|
1462
|
-
this.#updateCanvasSize(w, h);
|
|
1463
|
-
if (this.isBufferDetached()) {
|
|
1101
|
+
const a = "videoWidth" in e ? e.videoWidth : e.width, n = "videoHeight" in e ? e.videoHeight : e.height, o = r?.x ?? 0, i = r?.y ?? 0, l = r?.width ?? a, c = r?.height ?? n, d = l * c * 4;
|
|
1102
|
+
if (this.#c(l, c), this.isBufferDetached())
|
|
1464
1103
|
throw new Error("Buffer is detached!");
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
}
|
|
1469
|
-
const gl = this.#contextWebGl2;
|
|
1470
|
-
gl.bindTexture(gl.TEXTURE_2D, this.#webGl2Texture);
|
|
1471
|
-
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, source);
|
|
1472
|
-
gl.bindFramebuffer(gl.FRAMEBUFFER, this.#webGl2Framebuffer);
|
|
1104
|
+
(!this.#t || this.#t.length !== d) && (this.#t = new Uint8ClampedArray(d));
|
|
1105
|
+
const h = this.#a;
|
|
1106
|
+
h.bindTexture(h.TEXTURE_2D, this.#r), h.texImage2D(h.TEXTURE_2D, 0, h.RGBA, h.RGBA, h.UNSIGNED_BYTE, e), h.bindFramebuffer(h.FRAMEBUFFER, this.#n);
|
|
1473
1107
|
try {
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
const newBuffer = new Uint8ClampedArray(requiredSize);
|
|
1481
|
-
gl.readPixels(0, 0, w, h, gl.RGBA, gl.UNSIGNED_BYTE, newBuffer);
|
|
1482
|
-
this.#buffer = newBuffer;
|
|
1483
|
-
return new ImageData(newBuffer, w, h);
|
|
1108
|
+
h.pixelStorei(h.PACK_ALIGNMENT, this.#u), h.readPixels(o, i, l, c, h.RGBA, h.UNSIGNED_BYTE, this.#t);
|
|
1109
|
+
} catch (C) {
|
|
1110
|
+
if (this.#u !== 1) {
|
|
1111
|
+
this.#u = 1, h.pixelStorei(h.PACK_ALIGNMENT, 1);
|
|
1112
|
+
const w = new Uint8ClampedArray(d);
|
|
1113
|
+
return h.readPixels(0, 0, l, c, h.RGBA, h.UNSIGNED_BYTE, w), this.#t = w, new ImageData(w, l, c);
|
|
1484
1114
|
}
|
|
1485
|
-
throw
|
|
1115
|
+
throw C;
|
|
1486
1116
|
}
|
|
1487
|
-
return new ImageData(this.#
|
|
1117
|
+
return new ImageData(this.#t, l, c);
|
|
1488
1118
|
}
|
|
1489
1119
|
/**
|
|
1490
1120
|
* Update canvas dimensions if needed.
|
|
@@ -1494,116 +1124,104 @@ class VideoFrameProcessor {
|
|
|
1494
1124
|
* @param width - The width of the canvas.
|
|
1495
1125
|
* @param height - The height of the canvas.
|
|
1496
1126
|
*/
|
|
1497
|
-
#
|
|
1498
|
-
if (this.#
|
|
1499
|
-
this.#
|
|
1500
|
-
|
|
1501
|
-
this.#
|
|
1502
|
-
this.#cachedHeight = height;
|
|
1503
|
-
const requiredSize = width * height * 4;
|
|
1504
|
-
this.#buffer = new Uint8ClampedArray(requiredSize);
|
|
1127
|
+
#c(e, r) {
|
|
1128
|
+
if (this.#s !== e || this.#l !== r) {
|
|
1129
|
+
this.#e.width = e, this.#e.height = r, this.#s = e, this.#l = r;
|
|
1130
|
+
const a = e * r * 4;
|
|
1131
|
+
this.#t = new Uint8ClampedArray(a);
|
|
1505
1132
|
}
|
|
1506
1133
|
}
|
|
1507
1134
|
/**
|
|
1508
1135
|
* Clean up resources.
|
|
1509
1136
|
*/
|
|
1510
1137
|
dispose() {
|
|
1511
|
-
|
|
1512
|
-
if (this.#webGl2Texture) {
|
|
1513
|
-
this.#contextWebGl2.deleteTexture(this.#webGl2Texture);
|
|
1514
|
-
this.#webGl2Texture = null;
|
|
1515
|
-
}
|
|
1516
|
-
if (this.#webGl2Framebuffer) {
|
|
1517
|
-
this.#contextWebGl2.deleteFramebuffer(this.#webGl2Framebuffer);
|
|
1518
|
-
this.#webGl2Framebuffer = null;
|
|
1519
|
-
}
|
|
1520
|
-
}
|
|
1521
|
-
this.#context2d = null;
|
|
1522
|
-
this.#contextWebGl2 = null;
|
|
1523
|
-
this.#buffer = null;
|
|
1138
|
+
this.#a && (this.#r && (this.#a.deleteTexture(this.#r), this.#r = null), this.#n && (this.#a.deleteFramebuffer(this.#n), this.#n = null)), this.#o = null, this.#a = null, this.#t = null;
|
|
1524
1139
|
}
|
|
1525
1140
|
}
|
|
1526
|
-
const
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
} else {
|
|
1530
|
-
return buffer;
|
|
1531
|
-
}
|
|
1532
|
-
};
|
|
1533
|
-
const defaultCameraManagerOptions = {
|
|
1534
|
-
mirrorFrontCameras: true
|
|
1141
|
+
const Ie = (t) => ArrayBuffer.isView(t) ? t.buffer : t, zt = {
|
|
1142
|
+
mirrorFrontCameras: !0,
|
|
1143
|
+
preferredResolution: "1080p"
|
|
1535
1144
|
};
|
|
1536
|
-
class
|
|
1537
|
-
#
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1145
|
+
class ta {
|
|
1146
|
+
#e;
|
|
1147
|
+
/**
|
|
1148
|
+
* The desired video resolution for camera streams. This is used as the ideal resolution
|
|
1149
|
+
* when starting camera streams. If a camera doesn't support the specified resolution,
|
|
1150
|
+
* the camera will automatically fall back to the next lower supported resolution in this order:
|
|
1151
|
+
* 4k → 1080p → 720p. The actual resolution used may differ from this setting based on
|
|
1152
|
+
* camera capabilities and system constraints.
|
|
1153
|
+
*/
|
|
1154
|
+
#o;
|
|
1155
|
+
#a;
|
|
1156
|
+
#r;
|
|
1157
|
+
#n;
|
|
1158
|
+
#t;
|
|
1159
|
+
#s;
|
|
1544
1160
|
/**
|
|
1545
1161
|
* If true, the user has initiated an abort. This will prevent the
|
|
1546
1162
|
* CameraManager from throwing errors when the user interrupts the process.
|
|
1547
1163
|
*/
|
|
1548
|
-
#
|
|
1164
|
+
#l = !1;
|
|
1549
1165
|
/**
|
|
1550
1166
|
* If true, the user has initiated an abort. This will prevent the
|
|
1551
1167
|
* CameraManager from throwing errors when the user interrupts the process.
|
|
1552
1168
|
*/
|
|
1553
1169
|
get userInitiatedAbort() {
|
|
1554
|
-
return this.#
|
|
1170
|
+
return this.#l;
|
|
1555
1171
|
}
|
|
1556
|
-
set userInitiatedAbort(
|
|
1557
|
-
this.#
|
|
1172
|
+
set userInitiatedAbort(e) {
|
|
1173
|
+
this.#l = e;
|
|
1558
1174
|
}
|
|
1559
1175
|
/**
|
|
1560
1176
|
* Sets the area of the video frame that will be extracted.
|
|
1561
1177
|
*
|
|
1562
1178
|
* @param extractionArea The area of the video frame that will be extracted.
|
|
1563
1179
|
*/
|
|
1564
|
-
setExtractionArea(
|
|
1565
|
-
this.#
|
|
1180
|
+
setExtractionArea(e) {
|
|
1181
|
+
this.#a = e;
|
|
1566
1182
|
}
|
|
1567
1183
|
/**
|
|
1568
1184
|
* Callbacks that will be triggered on each frame when the playback state is
|
|
1569
1185
|
* "capturing".
|
|
1570
1186
|
*/
|
|
1571
|
-
#
|
|
1187
|
+
#i = /* @__PURE__ */ new Set();
|
|
1572
1188
|
/**
|
|
1573
1189
|
* Creates a new CameraManager instance.
|
|
1574
1190
|
*
|
|
1575
1191
|
* @param options - The options for the CameraManager.
|
|
1576
1192
|
* @param videoFrameProcessorOptions - The options for the VideoFrameProcessor.
|
|
1577
1193
|
*/
|
|
1578
|
-
constructor(
|
|
1579
|
-
const { mirrorFrontCameras } = {
|
|
1580
|
-
...
|
|
1581
|
-
...
|
|
1194
|
+
constructor(e = {}, r) {
|
|
1195
|
+
const { mirrorFrontCameras: a, preferredResolution: n } = {
|
|
1196
|
+
...zt,
|
|
1197
|
+
...e
|
|
1582
1198
|
};
|
|
1583
|
-
this.#
|
|
1584
|
-
|
|
1585
|
-
);
|
|
1586
|
-
this.#mirrorFrontCameras = mirrorFrontCameras;
|
|
1199
|
+
this.#o = n, this.#n = new It(
|
|
1200
|
+
r
|
|
1201
|
+
), this.#t = a;
|
|
1587
1202
|
}
|
|
1588
1203
|
/**
|
|
1589
|
-
* Sets the resolution
|
|
1204
|
+
* Sets the desired video resolution for camera streams. This is used as the ideal resolution
|
|
1205
|
+
* when starting camera streams. If a camera doesn't support the specified resolution,
|
|
1206
|
+
* the camera will automatically fall back to the next lower supported resolution in this order:
|
|
1207
|
+
* 4k → 1080p → 720p. If there's an active stream, it will be restarted with the new resolution.
|
|
1590
1208
|
*
|
|
1591
|
-
* @param resolution - The resolution to set.
|
|
1209
|
+
* @param resolution - The ideal resolution to set for camera streams.
|
|
1592
1210
|
*/
|
|
1593
|
-
setResolution = async (
|
|
1594
|
-
this.#
|
|
1595
|
-
const
|
|
1596
|
-
|
|
1597
|
-
this.#resumeRequest = playbackState;
|
|
1598
|
-
this.stopStream();
|
|
1599
|
-
await this.startCameraStream();
|
|
1600
|
-
}
|
|
1211
|
+
setResolution = async (e) => {
|
|
1212
|
+
this.#o = e;
|
|
1213
|
+
const r = this.getState().playbackState;
|
|
1214
|
+
r !== "idle" && (this.#e = r, this.stopStream(), await this.startCameraStream());
|
|
1601
1215
|
};
|
|
1602
1216
|
/**
|
|
1603
|
-
* The resolution
|
|
1217
|
+
* The desired video resolution for camera streams. This is used as the ideal resolution
|
|
1218
|
+
* when starting camera streams. If a camera doesn't support the specified resolution,
|
|
1219
|
+
* the camera will automatically fall back to the next lower supported resolution in this order:
|
|
1220
|
+
* 4k → 1080p → 720p. The actual resolution used may differ from this setting based on
|
|
1221
|
+
* camera capabilities and system constraints.
|
|
1604
1222
|
*/
|
|
1605
1223
|
get resolution() {
|
|
1606
|
-
return this.#
|
|
1224
|
+
return this.#o;
|
|
1607
1225
|
}
|
|
1608
1226
|
/**
|
|
1609
1227
|
* True if there is a video playing or capturing
|
|
@@ -1611,16 +1229,16 @@ class CameraManager {
|
|
|
1611
1229
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/MediaSession/playbackState for more details.
|
|
1612
1230
|
*/
|
|
1613
1231
|
get isActive() {
|
|
1614
|
-
return
|
|
1232
|
+
return m.getState().playbackState !== "idle";
|
|
1615
1233
|
}
|
|
1616
1234
|
/**
|
|
1617
1235
|
* Sets the facing filter.
|
|
1618
1236
|
*
|
|
1619
1237
|
* @param facingFilter - The facing filter.
|
|
1620
1238
|
*/
|
|
1621
|
-
setFacingFilter(
|
|
1622
|
-
|
|
1623
|
-
facingFilter
|
|
1239
|
+
setFacingFilter(e) {
|
|
1240
|
+
m.setState({
|
|
1241
|
+
facingFilter: e
|
|
1624
1242
|
});
|
|
1625
1243
|
}
|
|
1626
1244
|
/**
|
|
@@ -1630,39 +1248,30 @@ class CameraManager {
|
|
|
1630
1248
|
* @returns The cameras that are available to the user, filtered by the facing mode.
|
|
1631
1249
|
*/
|
|
1632
1250
|
async getCameraDevices() {
|
|
1633
|
-
let
|
|
1634
|
-
const
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
allCameras = cameraManagerStore.getState().cameras;
|
|
1639
|
-
if (!facingFilter) {
|
|
1640
|
-
return allCameras;
|
|
1641
|
-
}
|
|
1642
|
-
const filteredCameras = allCameras.filter(
|
|
1643
|
-
(camera) => facingFilter.includes(camera.facingMode)
|
|
1644
|
-
);
|
|
1645
|
-
return filteredCameras;
|
|
1251
|
+
let e = m.getState().cameras;
|
|
1252
|
+
const r = m.getState().facingFilter;
|
|
1253
|
+
return e.length || await this.refreshCameraDevices(), e = m.getState().cameras, r ? e.filter(
|
|
1254
|
+
(n) => r.includes(n.facingMode)
|
|
1255
|
+
) : e;
|
|
1646
1256
|
}
|
|
1647
1257
|
/**
|
|
1648
1258
|
* Single-time setup for a video element.
|
|
1649
1259
|
*
|
|
1650
1260
|
* @param videoElement - The video element to initialize.
|
|
1651
1261
|
*/
|
|
1652
|
-
#
|
|
1653
|
-
if (!(
|
|
1262
|
+
#u(e) {
|
|
1263
|
+
if (!(e instanceof HTMLVideoElement))
|
|
1654
1264
|
throw new Error(
|
|
1655
|
-
`Expected an HTMLVideoElement, got ${typeof
|
|
1265
|
+
`Expected an HTMLVideoElement, got ${typeof e}`,
|
|
1656
1266
|
{
|
|
1657
|
-
cause:
|
|
1267
|
+
cause: e
|
|
1658
1268
|
}
|
|
1659
1269
|
);
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
videoElement
|
|
1270
|
+
m.setState({
|
|
1271
|
+
videoElement: e
|
|
1663
1272
|
});
|
|
1664
|
-
const
|
|
1665
|
-
|
|
1273
|
+
const r = Dt(e, (i) => {
|
|
1274
|
+
[
|
|
1666
1275
|
"abort"
|
|
1667
1276
|
// "error",
|
|
1668
1277
|
// "canplay",
|
|
@@ -1681,48 +1290,36 @@ class CameraManager {
|
|
|
1681
1290
|
// "timeupdate",
|
|
1682
1291
|
// "ratechange",
|
|
1683
1292
|
// "durationchange",
|
|
1684
|
-
]
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
console.debug(`Video event: ${event}`);
|
|
1293
|
+
].forEach((c) => {
|
|
1294
|
+
i(c, () => {
|
|
1295
|
+
console.debug(`Video event: ${c}`);
|
|
1688
1296
|
});
|
|
1689
1297
|
});
|
|
1690
1298
|
});
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
connectionObserver.observe(videoElement);
|
|
1697
|
-
videoElement.setAttribute("playsInline", "");
|
|
1698
|
-
videoElement.setAttribute("muted", "");
|
|
1699
|
-
videoElement.controls = false;
|
|
1700
|
-
let previousPlaybackState = "idle";
|
|
1701
|
-
const cleanupVisibilityListener = radEventListener(
|
|
1299
|
+
new N((i) => {
|
|
1300
|
+
i[0].connected || this.releaseVideoElement();
|
|
1301
|
+
}).observe(e), e.setAttribute("playsInline", ""), e.setAttribute("muted", ""), e.controls = !1;
|
|
1302
|
+
let n = "idle";
|
|
1303
|
+
const o = Ft(
|
|
1702
1304
|
document,
|
|
1703
1305
|
"visibilitychange",
|
|
1704
1306
|
async () => {
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
previousPlaybackState = cameraManagerStore.getState().playbackState;
|
|
1708
|
-
this.stopStream();
|
|
1307
|
+
if (document.hidden) {
|
|
1308
|
+
n = m.getState().playbackState, this.stopStream();
|
|
1709
1309
|
return;
|
|
1710
1310
|
}
|
|
1711
|
-
switch (
|
|
1311
|
+
switch (n) {
|
|
1712
1312
|
case "playback":
|
|
1713
|
-
await this.startCameraStream();
|
|
1714
|
-
await this.startPlayback();
|
|
1313
|
+
await this.startCameraStream(), await this.startPlayback();
|
|
1715
1314
|
break;
|
|
1716
1315
|
case "capturing":
|
|
1717
|
-
await this.startCameraStream();
|
|
1718
|
-
await this.startFrameCapture();
|
|
1316
|
+
await this.startCameraStream(), await this.startFrameCapture();
|
|
1719
1317
|
break;
|
|
1720
1318
|
}
|
|
1721
1319
|
}
|
|
1722
1320
|
);
|
|
1723
|
-
this.#
|
|
1724
|
-
|
|
1725
|
-
videoEventCleanup();
|
|
1321
|
+
this.#s = () => {
|
|
1322
|
+
o(), r();
|
|
1726
1323
|
};
|
|
1727
1324
|
}
|
|
1728
1325
|
/**
|
|
@@ -1730,15 +1327,14 @@ class CameraManager {
|
|
|
1730
1327
|
*
|
|
1731
1328
|
* @param videoElement - The video element to initialize.
|
|
1732
1329
|
*/
|
|
1733
|
-
initVideoElement(
|
|
1330
|
+
initVideoElement(e) {
|
|
1734
1331
|
try {
|
|
1735
|
-
this.#
|
|
1736
|
-
} catch (
|
|
1737
|
-
if (this.userInitiatedAbort)
|
|
1332
|
+
this.#u(e);
|
|
1333
|
+
} catch (r) {
|
|
1334
|
+
if (this.userInitiatedAbort)
|
|
1738
1335
|
this.reset();
|
|
1739
|
-
|
|
1740
|
-
throw
|
|
1741
|
-
}
|
|
1336
|
+
else
|
|
1337
|
+
throw r;
|
|
1742
1338
|
}
|
|
1743
1339
|
}
|
|
1744
1340
|
/**
|
|
@@ -1748,19 +1344,16 @@ class CameraManager {
|
|
|
1748
1344
|
* @param frameCaptureCallback - The callback to add.
|
|
1749
1345
|
* @returns a cleanup function to remove the callback
|
|
1750
1346
|
*/
|
|
1751
|
-
addFrameCaptureCallback(
|
|
1752
|
-
this.#
|
|
1753
|
-
return () => this.#frameCaptureCallbacks.delete(frameCaptureCallback);
|
|
1347
|
+
addFrameCaptureCallback(e) {
|
|
1348
|
+
return this.#i.add(e), () => this.#i.delete(e);
|
|
1754
1349
|
}
|
|
1755
1350
|
/**
|
|
1756
1351
|
* Cleans up the video element, and stops the stream.
|
|
1757
1352
|
*/
|
|
1758
1353
|
releaseVideoElement() {
|
|
1759
|
-
this.#
|
|
1760
|
-
cameraManagerStore.setState({
|
|
1354
|
+
this.#s?.(), m.setState({
|
|
1761
1355
|
videoElement: void 0
|
|
1762
|
-
});
|
|
1763
|
-
this.stopStream();
|
|
1356
|
+
}), this.stopStream();
|
|
1764
1357
|
}
|
|
1765
1358
|
// TODO: might become a private method in the future as an implementation detail of `startStream`
|
|
1766
1359
|
/**
|
|
@@ -1768,43 +1361,24 @@ class CameraManager {
|
|
|
1768
1361
|
*
|
|
1769
1362
|
* @param camera - The camera to select.
|
|
1770
1363
|
*/
|
|
1771
|
-
async selectCamera(
|
|
1772
|
-
const
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
const state = cameraManagerStore.getState();
|
|
1777
|
-
if (state.selectedCamera === camera) {
|
|
1364
|
+
async selectCamera(e) {
|
|
1365
|
+
const r = m.getState().playbackState;
|
|
1366
|
+
r !== "idle" && (this.#e = r);
|
|
1367
|
+
const a = m.getState();
|
|
1368
|
+
if (a.selectedCamera === e) {
|
|
1778
1369
|
console.debug("Already selected");
|
|
1779
1370
|
return;
|
|
1780
1371
|
}
|
|
1781
|
-
if (
|
|
1372
|
+
if (a.isSwappingCamera) {
|
|
1782
1373
|
console.debug("Already swapping");
|
|
1783
1374
|
return;
|
|
1784
1375
|
}
|
|
1785
|
-
|
|
1786
|
-
isSwappingCamera:
|
|
1787
|
-
})
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
}
|
|
1792
|
-
if (state.videoElement) {
|
|
1793
|
-
state.videoElement.srcObject = null;
|
|
1794
|
-
}
|
|
1795
|
-
cameraManagerStore.setState({
|
|
1796
|
-
selectedCamera: camera,
|
|
1797
|
-
isSwappingCamera: false
|
|
1798
|
-
});
|
|
1799
|
-
if (this.#resumeRequest === "playback") {
|
|
1800
|
-
console.debug("Starting new stream");
|
|
1801
|
-
await this.startPlayback();
|
|
1802
|
-
}
|
|
1803
|
-
if (this.#resumeRequest === "capturing") {
|
|
1804
|
-
console.debug("Resuming frame capture");
|
|
1805
|
-
await this.startFrameCapture();
|
|
1806
|
-
}
|
|
1807
|
-
this.#resumeRequest = void 0;
|
|
1376
|
+
m.setState({
|
|
1377
|
+
isSwappingCamera: !0
|
|
1378
|
+
}), a.selectedCamera?.activeStream && (console.debug("Stopping previous stream"), a.selectedCamera.stopStream()), a.videoElement && (a.videoElement.srcObject = null), m.setState({
|
|
1379
|
+
selectedCamera: e,
|
|
1380
|
+
isSwappingCamera: !1
|
|
1381
|
+
}), 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;
|
|
1808
1382
|
}
|
|
1809
1383
|
/**
|
|
1810
1384
|
* Refreshes available devices on the system and updates the state.
|
|
@@ -1812,50 +1386,38 @@ class CameraManager {
|
|
|
1812
1386
|
* @returns resolves when the camera devices are refreshed
|
|
1813
1387
|
*/
|
|
1814
1388
|
async refreshCameraDevices() {
|
|
1815
|
-
if (
|
|
1389
|
+
if (m.getState().isQueryingCameras || m.getState().isSwappingCamera) {
|
|
1816
1390
|
console.debug("Already querying cameras");
|
|
1817
1391
|
return;
|
|
1818
1392
|
}
|
|
1819
|
-
|
|
1820
|
-
isQueryingCameras:
|
|
1393
|
+
m.setState({
|
|
1394
|
+
isQueryingCameras: !0
|
|
1821
1395
|
});
|
|
1822
|
-
const
|
|
1823
|
-
|
|
1824
|
-
errorState:
|
|
1825
|
-
isQueryingCameras:
|
|
1826
|
-
});
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
cameras.forEach((camera) => {
|
|
1831
|
-
if (camera.notifyStateChange) {
|
|
1832
|
-
return;
|
|
1833
|
-
}
|
|
1834
|
-
camera.notifyStateChange = (camInstance, reason) => {
|
|
1396
|
+
const e = await ut().catch((a) => {
|
|
1397
|
+
throw m.setState({
|
|
1398
|
+
errorState: K(a),
|
|
1399
|
+
isQueryingCameras: !1
|
|
1400
|
+
}), a;
|
|
1401
|
+
}), r = gt(e);
|
|
1402
|
+
r.forEach((a) => {
|
|
1403
|
+
a.notifyStateChange || (a.notifyStateChange = (n, o) => {
|
|
1835
1404
|
window.queueMicrotask(() => {
|
|
1836
|
-
|
|
1837
|
-
cameras: [...
|
|
1405
|
+
m.setState({
|
|
1406
|
+
cameras: [...m.getState().cameras]
|
|
1838
1407
|
});
|
|
1839
|
-
const
|
|
1840
|
-
if (!
|
|
1408
|
+
const i = m.getState().selectedCamera;
|
|
1409
|
+
if (!i)
|
|
1841
1410
|
return;
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
}
|
|
1847
|
-
if (camInstance === selectedCamera) {
|
|
1848
|
-
cameraManagerStore.setState({
|
|
1849
|
-
selectedCamera,
|
|
1850
|
-
errorState: streamError
|
|
1851
|
-
});
|
|
1852
|
-
}
|
|
1411
|
+
let l;
|
|
1412
|
+
typeof o == "object" && o !== null && "payload" in o && o.payload === "TRACK_END" && (l = new Error("Camera stream ended unexpectedly")), n === i && m.setState({
|
|
1413
|
+
selectedCamera: i,
|
|
1414
|
+
errorState: l
|
|
1415
|
+
});
|
|
1853
1416
|
});
|
|
1854
|
-
};
|
|
1855
|
-
})
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
isQueryingCameras: false
|
|
1417
|
+
});
|
|
1418
|
+
}), m.setState({
|
|
1419
|
+
cameras: r,
|
|
1420
|
+
isQueryingCameras: !1
|
|
1859
1421
|
});
|
|
1860
1422
|
}
|
|
1861
1423
|
/**
|
|
@@ -1864,34 +1426,29 @@ class CameraManager {
|
|
|
1864
1426
|
* @returns resolves when playback starts
|
|
1865
1427
|
*/
|
|
1866
1428
|
async startPlayback() {
|
|
1867
|
-
const
|
|
1868
|
-
if (this.isActive && !this.#
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
console.error("Failed to start playback", error);
|
|
1891
|
-
cameraManagerStore.setState({
|
|
1892
|
-
errorState: asError(error)
|
|
1893
|
-
});
|
|
1894
|
-
throw error;
|
|
1429
|
+
const e = m.getState();
|
|
1430
|
+
if (!(this.isActive && !this.#e)) {
|
|
1431
|
+
if (!e.videoElement) {
|
|
1432
|
+
console.warn("Starting playback - no video element present.");
|
|
1433
|
+
return;
|
|
1434
|
+
}
|
|
1435
|
+
if (!e.selectedCamera) {
|
|
1436
|
+
console.warn("Select a camera first.");
|
|
1437
|
+
return;
|
|
1438
|
+
}
|
|
1439
|
+
if (!e.selectedCamera.activeStream) {
|
|
1440
|
+
const r = await e.selectedCamera.startStream(this.resolution);
|
|
1441
|
+
e.videoElement.srcObject = r;
|
|
1442
|
+
}
|
|
1443
|
+
try {
|
|
1444
|
+
this.#g(), await e.videoElement.play(), m.setState({
|
|
1445
|
+
playbackState: "playback"
|
|
1446
|
+
});
|
|
1447
|
+
} catch (r) {
|
|
1448
|
+
throw console.error("Failed to start playback", r), m.setState({
|
|
1449
|
+
errorState: K(r)
|
|
1450
|
+
}), r;
|
|
1451
|
+
}
|
|
1895
1452
|
}
|
|
1896
1453
|
}
|
|
1897
1454
|
/**
|
|
@@ -1899,32 +1456,25 @@ class CameraManager {
|
|
|
1899
1456
|
*
|
|
1900
1457
|
* @returns resolves when frame capture starts
|
|
1901
1458
|
*/
|
|
1902
|
-
async #
|
|
1903
|
-
const
|
|
1904
|
-
if (this.userInitiatedAbort) {
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
);
|
|
1920
|
-
return;
|
|
1459
|
+
async #d() {
|
|
1460
|
+
const e = m.getState();
|
|
1461
|
+
if (!this.userInitiatedAbort && !(e.playbackState === "capturing" && this.#e !== "capturing")) {
|
|
1462
|
+
if (!e.videoElement) {
|
|
1463
|
+
console.warn(
|
|
1464
|
+
"Missing video element. Setup a video element first using `initVideoElement`"
|
|
1465
|
+
);
|
|
1466
|
+
return;
|
|
1467
|
+
}
|
|
1468
|
+
if (!e.selectedCamera) {
|
|
1469
|
+
console.warn(
|
|
1470
|
+
"No active camera! Select a camera first, or use `startCameraStream`"
|
|
1471
|
+
);
|
|
1472
|
+
return;
|
|
1473
|
+
}
|
|
1474
|
+
await this.startPlayback(), m.setState({
|
|
1475
|
+
playbackState: "capturing"
|
|
1476
|
+
}), this.#c(), this.#e = void 0;
|
|
1921
1477
|
}
|
|
1922
|
-
await this.startPlayback();
|
|
1923
|
-
cameraManagerStore.setState({
|
|
1924
|
-
playbackState: "capturing"
|
|
1925
|
-
});
|
|
1926
|
-
this.#queueFrame();
|
|
1927
|
-
this.#resumeRequest = void 0;
|
|
1928
1478
|
}
|
|
1929
1479
|
/**
|
|
1930
1480
|
* Starts capturing frames from the video element.
|
|
@@ -1933,13 +1483,12 @@ class CameraManager {
|
|
|
1933
1483
|
*/
|
|
1934
1484
|
startFrameCapture = async () => {
|
|
1935
1485
|
try {
|
|
1936
|
-
await this.#
|
|
1937
|
-
} catch (
|
|
1938
|
-
if (this.userInitiatedAbort)
|
|
1486
|
+
await this.#d();
|
|
1487
|
+
} catch (e) {
|
|
1488
|
+
if (this.userInitiatedAbort)
|
|
1939
1489
|
this.reset();
|
|
1940
|
-
|
|
1941
|
-
throw
|
|
1942
|
-
}
|
|
1490
|
+
else
|
|
1491
|
+
throw e;
|
|
1943
1492
|
}
|
|
1944
1493
|
};
|
|
1945
1494
|
/**
|
|
@@ -1948,82 +1497,55 @@ class CameraManager {
|
|
|
1948
1497
|
* @param params - The parameters for the camera stream.
|
|
1949
1498
|
* @returns resolves when the camera stream starts
|
|
1950
1499
|
*/
|
|
1951
|
-
async #
|
|
1952
|
-
autoplay =
|
|
1953
|
-
preferredCamera,
|
|
1954
|
-
preferredFacing
|
|
1500
|
+
async #h({
|
|
1501
|
+
autoplay: e = !0,
|
|
1502
|
+
preferredCamera: r,
|
|
1503
|
+
preferredFacing: a
|
|
1955
1504
|
} = {}) {
|
|
1956
|
-
const
|
|
1957
|
-
if (!
|
|
1505
|
+
const n = m.getState().videoElement;
|
|
1506
|
+
if (!n) {
|
|
1958
1507
|
console.warn("Can't start stream without a video element");
|
|
1959
1508
|
return;
|
|
1960
1509
|
}
|
|
1961
|
-
if (this.isActive && !this.#
|
|
1510
|
+
if (this.isActive && !this.#e) {
|
|
1962
1511
|
console.warn("Already streaming");
|
|
1963
1512
|
return;
|
|
1964
1513
|
}
|
|
1965
|
-
if (
|
|
1966
|
-
await this.selectCamera(preferredCamera);
|
|
1967
|
-
}
|
|
1968
|
-
if (!cameraManagerStore.getState().selectedCamera) {
|
|
1514
|
+
if (r instanceof Ae && await this.selectCamera(r), !m.getState().selectedCamera)
|
|
1969
1515
|
try {
|
|
1970
|
-
const
|
|
1971
|
-
let
|
|
1972
|
-
if (!
|
|
1973
|
-
console.log("Camera list is empty")
|
|
1974
|
-
|
|
1975
|
-
`No cameras found matching the filter ${preferredFacing}`
|
|
1976
|
-
);
|
|
1977
|
-
}
|
|
1978
|
-
if (typeof preferredCamera === "function") {
|
|
1979
|
-
selectedCamera2 = preferredCamera(cameras);
|
|
1980
|
-
if (!selectedCamera2) {
|
|
1981
|
-
console.warn(
|
|
1982
|
-
`No camera found matching the preferred camera function, falling back to facing mode`
|
|
1983
|
-
);
|
|
1984
|
-
}
|
|
1985
|
-
}
|
|
1986
|
-
if (!selectedCamera2) {
|
|
1987
|
-
selectedCamera2 = await findIdealCamera(
|
|
1988
|
-
cameras,
|
|
1989
|
-
this.resolution,
|
|
1990
|
-
preferredFacing
|
|
1516
|
+
const l = await this.getCameraDevices();
|
|
1517
|
+
let c;
|
|
1518
|
+
if (!l.length)
|
|
1519
|
+
throw console.log("Camera list is empty"), new Error(
|
|
1520
|
+
`No cameras found matching the filter ${a}`
|
|
1991
1521
|
);
|
|
1992
|
-
|
|
1993
|
-
|
|
1522
|
+
if (typeof r == "function" && (c = r(l), c || console.warn(
|
|
1523
|
+
"No camera found matching the preferred camera function, falling back to facing mode"
|
|
1524
|
+
)), c || (c = await ft(
|
|
1525
|
+
l,
|
|
1526
|
+
this.resolution,
|
|
1527
|
+
a
|
|
1528
|
+
)), !c)
|
|
1994
1529
|
throw new Error(
|
|
1995
|
-
`No cameras found matching the filter ${
|
|
1530
|
+
`No cameras found matching the filter ${a}`
|
|
1996
1531
|
);
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
if (this.#hasPermissionError()) {
|
|
2000
|
-
cameraManagerStore.setState({
|
|
2001
|
-
errorState: void 0
|
|
2002
|
-
});
|
|
2003
|
-
}
|
|
2004
|
-
} catch (error) {
|
|
2005
|
-
cameraManagerStore.setState({
|
|
2006
|
-
errorState: asError(error)
|
|
1532
|
+
await this.selectCamera(c), this.#m() && m.setState({
|
|
1533
|
+
errorState: void 0
|
|
2007
1534
|
});
|
|
2008
|
-
|
|
1535
|
+
} catch (l) {
|
|
1536
|
+
throw m.setState({
|
|
1537
|
+
errorState: K(l)
|
|
1538
|
+
}), l;
|
|
2009
1539
|
}
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
}
|
|
2016
|
-
const stream = await selectedCamera.startStream(this.#resolution);
|
|
2017
|
-
if (!videoElement.isConnected) {
|
|
1540
|
+
const o = m.getState().selectedCamera;
|
|
1541
|
+
if (!o)
|
|
1542
|
+
throw console.warn("No selected camera!"), new Error("No selected camera");
|
|
1543
|
+
const i = await o.startStream(this.#o);
|
|
1544
|
+
if (!n.isConnected)
|
|
2018
1545
|
throw new Error("Video element needs to be in the document!");
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
videoElement
|
|
2023
|
-
});
|
|
2024
|
-
if (autoplay) {
|
|
2025
|
-
await this.startPlayback();
|
|
2026
|
-
}
|
|
1546
|
+
n.srcObject = i, m.setState({
|
|
1547
|
+
videoElement: n
|
|
1548
|
+
}), e && await this.startPlayback();
|
|
2027
1549
|
}
|
|
2028
1550
|
/**
|
|
2029
1551
|
* Starts a best-effort camera stream. Will pick a camera automatically if
|
|
@@ -2032,15 +1554,14 @@ class CameraManager {
|
|
|
2032
1554
|
* @param params - The parameters for the camera stream.
|
|
2033
1555
|
* @returns resolves when the camera stream starts
|
|
2034
1556
|
*/
|
|
2035
|
-
async startCameraStream(
|
|
1557
|
+
async startCameraStream(e = {}) {
|
|
2036
1558
|
try {
|
|
2037
|
-
await this.#
|
|
2038
|
-
} catch (
|
|
2039
|
-
if (this.userInitiatedAbort)
|
|
1559
|
+
await this.#h(e);
|
|
1560
|
+
} catch (r) {
|
|
1561
|
+
if (this.userInitiatedAbort)
|
|
2040
1562
|
this.reset();
|
|
2041
|
-
|
|
2042
|
-
throw
|
|
2043
|
-
}
|
|
1563
|
+
else
|
|
1564
|
+
throw r;
|
|
2044
1565
|
}
|
|
2045
1566
|
}
|
|
2046
1567
|
/**
|
|
@@ -2048,15 +1569,15 @@ class CameraManager {
|
|
|
2048
1569
|
*
|
|
2049
1570
|
* @returns true if the error state is a permission error
|
|
2050
1571
|
*/
|
|
2051
|
-
#
|
|
2052
|
-
const
|
|
2053
|
-
return
|
|
1572
|
+
#m = () => {
|
|
1573
|
+
const e = m.getState().errorState;
|
|
1574
|
+
return e instanceof xe && e.code === "PERMISSION_DENIED";
|
|
2054
1575
|
};
|
|
2055
1576
|
/**
|
|
2056
1577
|
* Pauses capturing frames, without stopping playback.
|
|
2057
1578
|
*/
|
|
2058
1579
|
stopFrameCapture() {
|
|
2059
|
-
|
|
1580
|
+
m.setState({
|
|
2060
1581
|
playbackState: "playback"
|
|
2061
1582
|
});
|
|
2062
1583
|
}
|
|
@@ -2065,130 +1586,94 @@ class CameraManager {
|
|
|
2065
1586
|
*/
|
|
2066
1587
|
stopStream() {
|
|
2067
1588
|
console.debug("stopStream called");
|
|
2068
|
-
const
|
|
2069
|
-
this.pausePlayback();
|
|
2070
|
-
state.selectedCamera?.stopStream();
|
|
2071
|
-
if (state.videoElement) {
|
|
2072
|
-
state.videoElement.srcObject = null;
|
|
2073
|
-
}
|
|
1589
|
+
const e = m.getState();
|
|
1590
|
+
this.pausePlayback(), e.selectedCamera?.stopStream(), e.videoElement && (e.videoElement.srcObject = null);
|
|
2074
1591
|
}
|
|
2075
1592
|
/**
|
|
2076
1593
|
* Pauses the video playback. This will also stop the capturing process.
|
|
2077
1594
|
*/
|
|
2078
1595
|
pausePlayback() {
|
|
2079
1596
|
console.debug("pausePlayback called");
|
|
2080
|
-
const
|
|
2081
|
-
|
|
1597
|
+
const e = m.getState().videoElement;
|
|
1598
|
+
m.setState({
|
|
2082
1599
|
playbackState: "idle"
|
|
2083
|
-
});
|
|
2084
|
-
if (!video) {
|
|
2085
|
-
return;
|
|
2086
|
-
}
|
|
2087
|
-
if (this.#videoFrameRequestId) {
|
|
2088
|
-
video.cancelVideoFrameCallback(this.#videoFrameRequestId);
|
|
2089
|
-
}
|
|
2090
|
-
video.pause();
|
|
1600
|
+
}), e && (this.#r && e.cancelVideoFrameCallback(this.#r), e.pause());
|
|
2091
1601
|
}
|
|
2092
1602
|
/**
|
|
2093
1603
|
* The main recognition loop. Do not call this method directly, use `#queueFrame` instead.
|
|
2094
1604
|
*/
|
|
2095
|
-
async #
|
|
2096
|
-
const
|
|
2097
|
-
if (this.#
|
|
1605
|
+
async #f() {
|
|
1606
|
+
const e = m.getState();
|
|
1607
|
+
if (this.#r === void 0) {
|
|
2098
1608
|
console.error("Missing request ID");
|
|
2099
1609
|
return;
|
|
2100
1610
|
}
|
|
2101
|
-
if (!
|
|
1611
|
+
if (!e.videoElement) {
|
|
2102
1612
|
console.warn("Missing video element, should not happen");
|
|
2103
1613
|
return;
|
|
2104
1614
|
}
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
state.videoElement,
|
|
2112
|
-
this.#extractionArea
|
|
1615
|
+
if (!(e.videoElement.videoHeight >= e.videoElement.videoWidth == this.#a.height >= this.#a.width))
|
|
1616
|
+
return this.#c();
|
|
1617
|
+
if (this.#i.size !== 0) {
|
|
1618
|
+
const a = this.#n.getImageData(
|
|
1619
|
+
e.videoElement,
|
|
1620
|
+
this.#a
|
|
2113
1621
|
);
|
|
2114
|
-
for (const
|
|
2115
|
-
const
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
if (!(returnedBuffer instanceof ArrayBuffer)) {
|
|
2121
|
-
throw new Error(
|
|
2122
|
-
stripIndents`
|
|
1622
|
+
for (const n of this.#i) {
|
|
1623
|
+
const o = se(a.data) ? this.#n.getCurrentImageData() : a, i = await n(o);
|
|
1624
|
+
if (i) {
|
|
1625
|
+
if (!(i instanceof ArrayBuffer))
|
|
1626
|
+
throw new Error(
|
|
1627
|
+
Me`
|
|
2123
1628
|
Frame capture callback did not return an ArrayBuffer.
|
|
2124
1629
|
Make sure to return the underlying buffer, not the view.
|
|
2125
1630
|
`
|
|
2126
|
-
|
|
1631
|
+
);
|
|
1632
|
+
this.#n.reattachArrayBuffer(i);
|
|
2127
1633
|
}
|
|
2128
|
-
this.#videoFrameProcessor.reattachArrayBuffer(returnedBuffer);
|
|
2129
1634
|
}
|
|
2130
1635
|
}
|
|
2131
|
-
this.#
|
|
1636
|
+
this.#c();
|
|
2132
1637
|
}
|
|
2133
1638
|
/**
|
|
2134
1639
|
* Queues the next frame to be processed.
|
|
2135
1640
|
*/
|
|
2136
|
-
#
|
|
2137
|
-
const
|
|
2138
|
-
if (
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
state.videoElement.cancelVideoFrameCallback(this.#videoFrameRequestId);
|
|
1641
|
+
#c() {
|
|
1642
|
+
const e = m.getState();
|
|
1643
|
+
if (e.playbackState === "capturing") {
|
|
1644
|
+
if (!e.videoElement) {
|
|
1645
|
+
console.warn("Missing video element, should not happen");
|
|
1646
|
+
return;
|
|
1647
|
+
}
|
|
1648
|
+
this.#r && e.videoElement.cancelVideoFrameCallback(this.#r), this.#r = e.videoElement.requestVideoFrameCallback(
|
|
1649
|
+
() => void this.#f()
|
|
1650
|
+
);
|
|
2147
1651
|
}
|
|
2148
|
-
this.#videoFrameRequestId = state.videoElement.requestVideoFrameCallback(
|
|
2149
|
-
() => void this.#loop()
|
|
2150
|
-
);
|
|
2151
1652
|
}
|
|
2152
1653
|
/**
|
|
2153
1654
|
* Applies a mirror effect to the video if the camera is front-facing.
|
|
2154
1655
|
* Assumes that desktop devices don't return a facing mode and that they are front-facing.
|
|
2155
1656
|
*/
|
|
2156
|
-
#
|
|
2157
|
-
const
|
|
2158
|
-
if (!
|
|
1657
|
+
#g() {
|
|
1658
|
+
const e = m.getState().selectedCamera;
|
|
1659
|
+
if (!e) {
|
|
2159
1660
|
console.warn("No camera selected");
|
|
2160
1661
|
return;
|
|
2161
1662
|
}
|
|
2162
|
-
|
|
2163
|
-
return;
|
|
2164
|
-
}
|
|
2165
|
-
if (camera.facingMode !== "back") {
|
|
2166
|
-
this.setCameraMirrorX(true);
|
|
2167
|
-
} else {
|
|
2168
|
-
this.setCameraMirrorX(false);
|
|
2169
|
-
}
|
|
1663
|
+
this.#t && (e.facingMode !== "back" ? this.setCameraMirrorX(!0) : this.setCameraMirrorX(!1));
|
|
2170
1664
|
}
|
|
2171
1665
|
/**
|
|
2172
1666
|
* If true, the video and captured frames will be mirrored horizontally.
|
|
2173
1667
|
*
|
|
2174
1668
|
* @param mirrorX - If true, the video and captured frames will be mirrored horizontally.
|
|
2175
1669
|
*/
|
|
2176
|
-
setCameraMirrorX(
|
|
2177
|
-
const
|
|
2178
|
-
|
|
2179
|
-
if (!videoElement) {
|
|
1670
|
+
setCameraMirrorX(e) {
|
|
1671
|
+
const r = m.getState(), a = r.videoElement;
|
|
1672
|
+
if (!a) {
|
|
2180
1673
|
console.warn("Mirror video - no video element present.");
|
|
2181
1674
|
return;
|
|
2182
1675
|
}
|
|
2183
|
-
|
|
2184
|
-
return;
|
|
2185
|
-
}
|
|
2186
|
-
if (mirrorX) {
|
|
2187
|
-
videoElement.style.scale = "-1 1";
|
|
2188
|
-
} else {
|
|
2189
|
-
videoElement.style.removeProperty("scale");
|
|
2190
|
-
}
|
|
2191
|
-
cameraManagerStore.setState({ mirrorX });
|
|
1676
|
+
r.mirrorX !== e && (e ? a.style.scale = "-1 1" : a.style.removeProperty("scale"), m.setState({ mirrorX: e }));
|
|
2192
1677
|
}
|
|
2193
1678
|
// The "typeof" is necessary to avoid a circular dependency when resolving types
|
|
2194
1679
|
/**
|
|
@@ -2198,66 +1683,62 @@ class CameraManager {
|
|
|
2198
1683
|
*
|
|
2199
1684
|
* @returns a cleanup function to remove the subscription
|
|
2200
1685
|
*/
|
|
2201
|
-
subscribe =
|
|
1686
|
+
subscribe = m.subscribe;
|
|
2202
1687
|
/**
|
|
2203
1688
|
* Gets the current internal state of the CameraManager.
|
|
2204
1689
|
*
|
|
2205
1690
|
* @returns the current state of the CameraManager
|
|
2206
1691
|
*/
|
|
2207
|
-
getState =
|
|
1692
|
+
getState = m.getState;
|
|
2208
1693
|
/**
|
|
2209
1694
|
* Resets the CameraManager and stops all streams.
|
|
2210
1695
|
*/
|
|
2211
1696
|
reset() {
|
|
2212
|
-
console.debug("Resetting camera manager");
|
|
2213
|
-
this.#frameCaptureCallbacks.clear();
|
|
2214
|
-
this.stopStream();
|
|
2215
|
-
resetCameraManagerStore();
|
|
1697
|
+
console.debug("Resetting camera manager"), this.#i.clear(), this.stopStream(), yt();
|
|
2216
1698
|
}
|
|
2217
1699
|
}
|
|
2218
|
-
const
|
|
2219
|
-
function
|
|
2220
|
-
return
|
|
1700
|
+
const ze = we();
|
|
1701
|
+
function Lt() {
|
|
1702
|
+
return Ce(m);
|
|
2221
1703
|
}
|
|
2222
|
-
const
|
|
2223
|
-
const
|
|
2224
|
-
cameraManagerSolidStore:
|
|
1704
|
+
const Nt = (t) => {
|
|
1705
|
+
const e = {
|
|
1706
|
+
cameraManagerSolidStore: Lt(),
|
|
2225
1707
|
// eslint-disable-next-line solid/reactivity
|
|
2226
|
-
cameraManager:
|
|
1708
|
+
cameraManager: t.cameraManager,
|
|
2227
1709
|
// eslint-disable-next-line solid/reactivity
|
|
2228
1710
|
dismountCameraUi: () => {
|
|
2229
|
-
|
|
2230
|
-
props.dismountCameraUi();
|
|
1711
|
+
t.cameraManager.userInitiatedAbort = !0, t.dismountCameraUi();
|
|
2231
1712
|
},
|
|
2232
1713
|
// eslint-disable-next-line solid/reactivity
|
|
2233
|
-
addOnDismountCallback:
|
|
1714
|
+
addOnDismountCallback: t.addOnDismountCallback,
|
|
1715
|
+
// eslint-disable-next-line solid/reactivity
|
|
1716
|
+
mountTarget: t.mountTarget,
|
|
2234
1717
|
// eslint-disable-next-line solid/reactivity
|
|
2235
|
-
|
|
1718
|
+
showMirrorCameraButton: t.showMirrorCameraButton,
|
|
2236
1719
|
// eslint-disable-next-line solid/reactivity
|
|
2237
|
-
|
|
1720
|
+
showTorchButton: t.showTorchButton,
|
|
2238
1721
|
// eslint-disable-next-line solid/reactivity
|
|
2239
|
-
|
|
1722
|
+
showCloseButton: t.showCloseButton,
|
|
2240
1723
|
// eslint-disable-next-line solid/reactivity
|
|
2241
|
-
|
|
1724
|
+
showCameraErrorModal: t.showCameraErrorModal
|
|
2242
1725
|
};
|
|
2243
|
-
|
|
1726
|
+
return ce(() => {
|
|
2244
1727
|
console.debug("CameraUiStoreProvider cleanup");
|
|
2245
|
-
})
|
|
2246
|
-
|
|
2247
|
-
value: contextValue,
|
|
1728
|
+
}), s(ze.Provider, {
|
|
1729
|
+
value: e,
|
|
2248
1730
|
get children() {
|
|
2249
|
-
return
|
|
1731
|
+
return t.children;
|
|
2250
1732
|
}
|
|
2251
1733
|
});
|
|
2252
1734
|
};
|
|
2253
|
-
function
|
|
2254
|
-
const
|
|
2255
|
-
if (!
|
|
1735
|
+
function j() {
|
|
1736
|
+
const t = ye(ze);
|
|
1737
|
+
if (!t)
|
|
2256
1738
|
throw new Error("StoreContext.Provider not in scope");
|
|
2257
|
-
|
|
2258
|
-
return ctx;
|
|
1739
|
+
return t;
|
|
2259
1740
|
}
|
|
2260
|
-
const
|
|
1741
|
+
const Bt = {
|
|
2261
1742
|
selected_camera: "Selected camera",
|
|
2262
1743
|
loading_cameras: "Loading cameras...",
|
|
2263
1744
|
select_a_camera: "Select a camera",
|
|
@@ -2270,277 +1751,230 @@ const enLocaleStrings = {
|
|
|
2270
1751
|
camera_error_details: "Please allow camera access in your browser and try again.",
|
|
2271
1752
|
camera_error_cancel_btn: "Cancel",
|
|
2272
1753
|
camera_error_primary_btn: "Retry"
|
|
2273
|
-
}
|
|
2274
|
-
const
|
|
2275
|
-
const LocalizationProvider = (props) => {
|
|
2276
|
-
const [localizationStore, updateLocalizationStore] = createStore$1(
|
|
1754
|
+
}, Le = we(), Ot = (t) => {
|
|
1755
|
+
const [e, r] = Ke(
|
|
2277
1756
|
// we structure clone to avoid proxying to the original object
|
|
2278
1757
|
structuredClone({
|
|
2279
|
-
...
|
|
1758
|
+
...Bt,
|
|
2280
1759
|
// we don't care on init
|
|
2281
1760
|
// eslint-disable-next-line solid/reactivity
|
|
2282
|
-
...
|
|
1761
|
+
...t.userStrings
|
|
2283
1762
|
})
|
|
2284
1763
|
);
|
|
2285
|
-
|
|
2286
|
-
|
|
1764
|
+
J(() => {
|
|
1765
|
+
t.setLocalizationRef(r);
|
|
2287
1766
|
});
|
|
2288
|
-
const
|
|
2289
|
-
t:
|
|
2290
|
-
updateLocalization:
|
|
1767
|
+
const a = {
|
|
1768
|
+
t: e,
|
|
1769
|
+
updateLocalization: r
|
|
2291
1770
|
};
|
|
2292
|
-
return
|
|
2293
|
-
value:
|
|
1771
|
+
return s(Le.Provider, {
|
|
1772
|
+
value: a,
|
|
2294
1773
|
get children() {
|
|
2295
|
-
return
|
|
1774
|
+
return t.children;
|
|
2296
1775
|
}
|
|
2297
1776
|
});
|
|
2298
1777
|
};
|
|
2299
|
-
function
|
|
2300
|
-
const
|
|
2301
|
-
if (!
|
|
1778
|
+
function Z() {
|
|
1779
|
+
const t = ye(Le);
|
|
1780
|
+
if (!t)
|
|
2302
1781
|
throw new Error("LocalizationContext.Provider not in scope.");
|
|
2303
|
-
|
|
2304
|
-
return ctx;
|
|
1782
|
+
return t;
|
|
2305
1783
|
}
|
|
2306
|
-
var
|
|
2307
|
-
const
|
|
2308
|
-
const [
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
return;
|
|
2314
|
-
}
|
|
2315
|
-
setRootNode(spanRef.getRootNode());
|
|
2316
|
-
});
|
|
2317
|
-
return createComponent(Show, {
|
|
1784
|
+
var Pt = /* @__PURE__ */ S("<span>");
|
|
1785
|
+
const ee = (t) => {
|
|
1786
|
+
const [e, r] = z(), [a, n] = z();
|
|
1787
|
+
return J(() => {
|
|
1788
|
+
const o = a();
|
|
1789
|
+
o && r(o.getRootNode());
|
|
1790
|
+
}), s(E, {
|
|
2318
1791
|
get when() {
|
|
2319
|
-
return
|
|
1792
|
+
return e();
|
|
2320
1793
|
},
|
|
2321
1794
|
get fallback() {
|
|
2322
1795
|
return (() => {
|
|
2323
|
-
var
|
|
2324
|
-
|
|
2325
|
-
return _el$;
|
|
1796
|
+
var o = Pt();
|
|
1797
|
+
return B(n, o), o;
|
|
2326
1798
|
})();
|
|
2327
1799
|
},
|
|
2328
|
-
children: (
|
|
2329
|
-
value: () =>
|
|
1800
|
+
children: (o) => s(Ye, {
|
|
1801
|
+
value: () => o(),
|
|
2330
1802
|
get children() {
|
|
2331
|
-
return
|
|
1803
|
+
return t.children(o());
|
|
2332
1804
|
}
|
|
2333
1805
|
})
|
|
2334
1806
|
});
|
|
2335
1807
|
};
|
|
2336
|
-
var
|
|
2337
|
-
const
|
|
2338
|
-
var
|
|
2339
|
-
|
|
2340
|
-
return _el$;
|
|
1808
|
+
var Vt = /* @__PURE__ */ S('<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">');
|
|
1809
|
+
const Ut = (t = {}) => (() => {
|
|
1810
|
+
var e = Vt();
|
|
1811
|
+
return F(e, t, !0, !0), e;
|
|
2341
1812
|
})();
|
|
2342
|
-
var
|
|
2343
|
-
const
|
|
2344
|
-
var
|
|
2345
|
-
|
|
2346
|
-
return _el$;
|
|
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 = {}) => (() => {
|
|
1815
|
+
var e = qt();
|
|
1816
|
+
return F(e, t, !0, !0), e;
|
|
2347
1817
|
})();
|
|
2348
|
-
var
|
|
2349
|
-
const
|
|
2350
|
-
var
|
|
2351
|
-
|
|
2352
|
-
return _el$;
|
|
1818
|
+
var Ht = /* @__PURE__ */ S('<svg viewBox="0 0 24 24"width=1.2em height=1.2em><path fill=currentColor d="M10 22v-8H7V2h10l-2 7h4z">');
|
|
1819
|
+
const Wt = (t = {}) => (() => {
|
|
1820
|
+
var e = Ht();
|
|
1821
|
+
return F(e, t, !0, !0), e;
|
|
2353
1822
|
})();
|
|
2354
|
-
var
|
|
2355
|
-
const
|
|
2356
|
-
var
|
|
2357
|
-
|
|
2358
|
-
return _el$;
|
|
1823
|
+
var Gt = /* @__PURE__ */ S('<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">');
|
|
1824
|
+
const Xt = (t = {}) => (() => {
|
|
1825
|
+
var e = Gt();
|
|
1826
|
+
return F(e, t, !0, !0), e;
|
|
2359
1827
|
})();
|
|
2360
|
-
function
|
|
2361
|
-
const
|
|
2362
|
-
Object.entries(
|
|
2363
|
-
const
|
|
2364
|
-
let
|
|
2365
|
-
if (
|
|
2366
|
-
|
|
2367
|
-
const
|
|
2368
|
-
|
|
2369
|
-
} else
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
});
|
|
2373
|
-
return newObj;
|
|
1828
|
+
function Ne(t) {
|
|
1829
|
+
const e = {};
|
|
1830
|
+
return Object.entries(t).forEach(([r, a]) => {
|
|
1831
|
+
const n = r.toLowerCase();
|
|
1832
|
+
let o = n;
|
|
1833
|
+
if (n.startsWith("on")) {
|
|
1834
|
+
o = n.slice(2);
|
|
1835
|
+
const i = `on:${o}`;
|
|
1836
|
+
e[i] = a;
|
|
1837
|
+
} else
|
|
1838
|
+
e[o] = a;
|
|
1839
|
+
}), e;
|
|
2374
1840
|
}
|
|
2375
|
-
var
|
|
2376
|
-
const
|
|
2377
|
-
var
|
|
2378
|
-
|
|
2379
|
-
return _el$;
|
|
1841
|
+
var Qt = /* @__PURE__ */ S('<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">');
|
|
1842
|
+
const Kt = (t = {}) => (() => {
|
|
1843
|
+
var e = Qt();
|
|
1844
|
+
return F(e, t, !0, !0), e;
|
|
2380
1845
|
})();
|
|
2381
|
-
var
|
|
2382
|
-
const
|
|
2383
|
-
var
|
|
2384
|
-
|
|
2385
|
-
return _el$;
|
|
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 = {}) => (() => {
|
|
1848
|
+
var e = Yt();
|
|
1849
|
+
return F(e, t, !0, !0), e;
|
|
2386
1850
|
})();
|
|
2387
|
-
var
|
|
2388
|
-
const
|
|
2389
|
-
var
|
|
2390
|
-
|
|
2391
|
-
return _el$;
|
|
1851
|
+
var Zt = /* @__PURE__ */ S('<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>');
|
|
1852
|
+
const er = (t = {}) => (() => {
|
|
1853
|
+
var e = Zt();
|
|
1854
|
+
return F(e, t, !0, !0), e;
|
|
2392
1855
|
})();
|
|
2393
|
-
var
|
|
2394
|
-
const
|
|
1856
|
+
var tr = /* @__PURE__ */ S("<button>"), rr = /* @__PURE__ */ S('<div class="h-[1px] absolute left-0 right-0 top-[-1px] bg-white pointer-events-none">');
|
|
1857
|
+
const ar = () => {
|
|
2395
1858
|
const {
|
|
2396
|
-
cameraManagerSolidStore,
|
|
2397
|
-
cameraManager
|
|
2398
|
-
} =
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
const
|
|
2410
|
-
if (
|
|
2411
|
-
return cameras();
|
|
2412
|
-
}
|
|
2413
|
-
return cameras().filter((camera) => $facingFilter.includes(camera.facingMode));
|
|
2414
|
-
};
|
|
2415
|
-
const createCameraOptions = () => [...camerasWithFacingFilter().map((camera) => ({
|
|
2416
|
-
value: camera.deviceInfo.deviceId,
|
|
2417
|
-
label: camera.name
|
|
2418
|
-
}))];
|
|
2419
|
-
const cameraCollection = () => createListCollection({
|
|
2420
|
-
items: [...createCameraOptions()]
|
|
2421
|
-
});
|
|
2422
|
-
const selectedCameraInCollection = () => {
|
|
2423
|
-
const $selectedCamera = selectedCamera();
|
|
2424
|
-
if (!$selectedCamera) {
|
|
2425
|
-
return;
|
|
2426
|
-
}
|
|
2427
|
-
const foundCamera = cameraCollection().find($selectedCamera.deviceInfo.deviceId);
|
|
2428
|
-
if (!foundCamera) {
|
|
1859
|
+
cameraManagerSolidStore: t,
|
|
1860
|
+
cameraManager: e
|
|
1861
|
+
} = j(), {
|
|
1862
|
+
t: r
|
|
1863
|
+
} = Z(), a = t((f) => f.cameras), n = t((f) => f.selectedCamera), o = t((f) => f.isQueryingCameras), i = t((f) => f.facingFilter), [l, c] = z(!1), d = () => o() || l(), h = () => {
|
|
1864
|
+
const f = i();
|
|
1865
|
+
return f ? a().filter((g) => f.includes(g.facingMode)) : a();
|
|
1866
|
+
}, C = () => [...h().map((f) => ({
|
|
1867
|
+
value: f.deviceInfo.deviceId,
|
|
1868
|
+
label: f.name
|
|
1869
|
+
}))], w = () => Je({
|
|
1870
|
+
items: [...C()]
|
|
1871
|
+
}), u = () => {
|
|
1872
|
+
const f = n();
|
|
1873
|
+
if (!f)
|
|
2429
1874
|
return;
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
setIsSwapping(true);
|
|
2438
|
-
const camera = cameras().find((camera2) => camera2.deviceInfo.deviceId === id);
|
|
2439
|
-
if (!camera) {
|
|
1875
|
+
const g = w().find(f.deviceInfo.deviceId);
|
|
1876
|
+
if (g)
|
|
1877
|
+
return [g.value];
|
|
1878
|
+
}, v = (f) => nr.some((g) => g.value === f), b = async (f) => {
|
|
1879
|
+
c(!0);
|
|
1880
|
+
const g = a().find((p) => p.deviceInfo.deviceId === f);
|
|
1881
|
+
if (!g) {
|
|
2440
1882
|
console.warn("No camera");
|
|
2441
1883
|
return;
|
|
2442
1884
|
}
|
|
2443
|
-
await
|
|
2444
|
-
setIsSwapping(false);
|
|
1885
|
+
await e.selectCamera(g), c(!1);
|
|
2445
1886
|
};
|
|
2446
|
-
return
|
|
2447
|
-
children: () =>
|
|
1887
|
+
return s(ee, {
|
|
1888
|
+
children: () => s(A.Root, {
|
|
2448
1889
|
part: "camera-select-part",
|
|
2449
1890
|
get collection() {
|
|
2450
|
-
return
|
|
1891
|
+
return w();
|
|
2451
1892
|
},
|
|
2452
1893
|
get value() {
|
|
2453
|
-
return
|
|
1894
|
+
return u();
|
|
2454
1895
|
},
|
|
2455
1896
|
positioning: {
|
|
2456
1897
|
placement: "top"
|
|
2457
1898
|
},
|
|
2458
|
-
lazyMount:
|
|
1899
|
+
lazyMount: !0,
|
|
2459
1900
|
get disabled() {
|
|
2460
|
-
return
|
|
1901
|
+
return d();
|
|
2461
1902
|
},
|
|
2462
|
-
onValueChange: (
|
|
2463
|
-
if (
|
|
1903
|
+
onValueChange: (f) => {
|
|
1904
|
+
if (v(f.value[0])) {
|
|
2464
1905
|
console.warn("Fake camera, skipping");
|
|
2465
1906
|
return;
|
|
2466
1907
|
}
|
|
2467
|
-
|
|
1908
|
+
b(f.value[0]);
|
|
2468
1909
|
},
|
|
2469
1910
|
get children() {
|
|
2470
|
-
return [
|
|
2471
|
-
|
|
1911
|
+
return [s(A.Label, {
|
|
1912
|
+
class: "sr-only",
|
|
2472
1913
|
get children() {
|
|
2473
|
-
return
|
|
1914
|
+
return r.selected_camera;
|
|
2474
1915
|
}
|
|
2475
|
-
}),
|
|
2476
|
-
asChild: (
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
"class": `flex px-4 py-2 items-center gap-2 rounded-full bg-dark-100/50 backdrop-blur-xl
|
|
1916
|
+
}), s(A.Trigger, {
|
|
1917
|
+
asChild: (f) => (() => {
|
|
1918
|
+
var g = tr();
|
|
1919
|
+
return F(g, Y(() => Ne(f()), {
|
|
1920
|
+
class: `flex px-4 py-2 items-center gap-2 rounded-full bg-dark-100/50 backdrop-blur-xl
|
|
2481
1921
|
whitespace-nowrap text-base color-white font-500 cursor-pointer appearance-none
|
|
2482
1922
|
border-none disabled:opacity-50 disabled:cursor-not-allowed max-w-[100%]`
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
}), null);
|
|
2502
|
-
return _el$;
|
|
2503
|
-
})();
|
|
2504
|
-
}
|
|
2505
|
-
}), createComponent(Select.Positioner, {
|
|
1923
|
+
}), !1, !0), y(g, s(Kt, {
|
|
1924
|
+
class: "size-6 shrink-0",
|
|
1925
|
+
"aria-hidden": !0
|
|
1926
|
+
}), null), y(g, s(A.ValueText, {
|
|
1927
|
+
class: "truncate",
|
|
1928
|
+
get placeholder() {
|
|
1929
|
+
return o() ? r.loading_cameras : r.select_a_camera;
|
|
1930
|
+
}
|
|
1931
|
+
}), null), y(g, s(A.Indicator, {
|
|
1932
|
+
class: "shrink-0 data-[state=open]:scale-y-[-1]",
|
|
1933
|
+
get children() {
|
|
1934
|
+
return s(er, {
|
|
1935
|
+
class: "size-6 shrink-0"
|
|
1936
|
+
});
|
|
1937
|
+
}
|
|
1938
|
+
}), null), g;
|
|
1939
|
+
})()
|
|
1940
|
+
}), s(A.Positioner, {
|
|
2506
1941
|
get children() {
|
|
2507
|
-
return
|
|
1942
|
+
return s(A.Content, {
|
|
2508
1943
|
get children() {
|
|
2509
|
-
return
|
|
2510
|
-
|
|
1944
|
+
return s(A.ItemGroup, {
|
|
1945
|
+
class: "rounded-4 overflow-hidden text-base color-white",
|
|
2511
1946
|
get children() {
|
|
2512
|
-
return
|
|
1947
|
+
return s(We, {
|
|
2513
1948
|
get each() {
|
|
2514
|
-
return
|
|
1949
|
+
return w().items;
|
|
2515
1950
|
},
|
|
2516
|
-
children: (
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
}
|
|
1951
|
+
children: (f, g) => s(A.Item, {
|
|
1952
|
+
get item() {
|
|
1953
|
+
return f();
|
|
1954
|
+
},
|
|
1955
|
+
class: `flex py-3 pl-4 pr-12 cursor-pointer select-none relative gap-[1px]
|
|
1956
|
+
bg-dark-100/50 backdrop-blur-xl data-[highlighted]:bg-gray-500/50`,
|
|
1957
|
+
get children() {
|
|
1958
|
+
return [s(A.ItemText, {
|
|
1959
|
+
class: "truncate",
|
|
1960
|
+
get children() {
|
|
1961
|
+
return f().label;
|
|
1962
|
+
}
|
|
1963
|
+
}), s(A.ItemIndicator, {
|
|
1964
|
+
class: "absolute right-4",
|
|
1965
|
+
get children() {
|
|
1966
|
+
return s(Jt, {
|
|
1967
|
+
class: "size-6 shrink-0"
|
|
1968
|
+
});
|
|
1969
|
+
}
|
|
1970
|
+
}), s(E, {
|
|
1971
|
+
when: g !== 0,
|
|
1972
|
+
get children() {
|
|
1973
|
+
return rr();
|
|
1974
|
+
}
|
|
1975
|
+
})];
|
|
1976
|
+
}
|
|
1977
|
+
})
|
|
2544
1978
|
});
|
|
2545
1979
|
}
|
|
2546
1980
|
});
|
|
@@ -2551,8 +1985,7 @@ const CameraSelector = () => {
|
|
|
2551
1985
|
}
|
|
2552
1986
|
})
|
|
2553
1987
|
});
|
|
2554
|
-
}
|
|
2555
|
-
const fakeCameras = [{
|
|
1988
|
+
}, nr = [{
|
|
2556
1989
|
value: "5",
|
|
2557
1990
|
label: "Back Camera 2"
|
|
2558
1991
|
}, {
|
|
@@ -2568,389 +2001,318 @@ const fakeCameras = [{
|
|
|
2568
2001
|
value: "4",
|
|
2569
2002
|
label: "Some random desktop camera"
|
|
2570
2003
|
}];
|
|
2571
|
-
var
|
|
2572
|
-
const
|
|
2573
|
-
const {
|
|
2574
|
-
dismountCameraUi,
|
|
2575
|
-
cameraManagerSolidStore,
|
|
2576
|
-
cameraManager,
|
|
2577
|
-
showMirrorCameraButton,
|
|
2578
|
-
showTorchButton,
|
|
2579
|
-
showCloseButton
|
|
2580
|
-
} = useCameraUiStore();
|
|
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>");
|
|
2005
|
+
const lr = () => {
|
|
2581
2006
|
const {
|
|
2582
|
-
t
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
const
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
void camera.toggleTorch();
|
|
2007
|
+
dismountCameraUi: t,
|
|
2008
|
+
cameraManagerSolidStore: e,
|
|
2009
|
+
cameraManager: r,
|
|
2010
|
+
showMirrorCameraButton: a,
|
|
2011
|
+
showTorchButton: n,
|
|
2012
|
+
showCloseButton: o
|
|
2013
|
+
} = j(), {
|
|
2014
|
+
t: i
|
|
2015
|
+
} = Z(), l = e((b) => b.mirrorX), c = e((b) => b.selectedCamera), d = e((b) => b.cameras), h = e((b) => b.playbackState !== "idle"), C = e((b) => b.selectedCamera?.torchEnabled), w = () => c()?.torchSupported, u = () => {
|
|
2016
|
+
const b = c();
|
|
2017
|
+
b && b.toggleTorch();
|
|
2018
|
+
}, v = () => {
|
|
2019
|
+
r.setCameraMirrorX(!e.getState().mirrorX);
|
|
2596
2020
|
};
|
|
2597
|
-
|
|
2598
|
-
cameraManager.setCameraMirrorX(!cameraManagerSolidStore.getState().mirrorX);
|
|
2599
|
-
};
|
|
2600
|
-
return createComponent(SmartEnvironmentProvider, {
|
|
2021
|
+
return s(ee, {
|
|
2601
2022
|
children: () => (() => {
|
|
2602
|
-
var
|
|
2603
|
-
|
|
2023
|
+
var b = ir(), f = b.firstChild, g = f.nextSibling;
|
|
2024
|
+
return y(f, s(E, {
|
|
2604
2025
|
get when() {
|
|
2605
|
-
return
|
|
2026
|
+
return a && h();
|
|
2606
2027
|
},
|
|
2607
2028
|
get children() {
|
|
2608
|
-
return
|
|
2029
|
+
return s(ae, {
|
|
2609
2030
|
part: "mirror-camera-button-part",
|
|
2610
2031
|
get tooltipLabel() {
|
|
2611
|
-
return
|
|
2032
|
+
return i.mirror_camera;
|
|
2612
2033
|
},
|
|
2613
|
-
onClick: () =>
|
|
2034
|
+
onClick: () => v(),
|
|
2614
2035
|
get children() {
|
|
2615
2036
|
return [(() => {
|
|
2616
|
-
var
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
"class": "size-6 shrink-0 transition-transform duration-300 ease-in-out",
|
|
2037
|
+
var p = re();
|
|
2038
|
+
return y(p, () => i.mirror_camera), p;
|
|
2039
|
+
})(), s(Xt, {
|
|
2040
|
+
class: "size-6 shrink-0 transition-transform duration-300 ease-in-out",
|
|
2621
2041
|
get style() {
|
|
2622
2042
|
return {
|
|
2623
|
-
transform:
|
|
2043
|
+
transform: l() ? "scaleX(-1)" : "scaleX(1)"
|
|
2624
2044
|
};
|
|
2625
2045
|
}
|
|
2626
2046
|
})];
|
|
2627
2047
|
}
|
|
2628
2048
|
});
|
|
2629
2049
|
}
|
|
2630
|
-
}), null)
|
|
2631
|
-
insert(_el$2, createComponent(Show, {
|
|
2050
|
+
}), null), y(f, s(E, {
|
|
2632
2051
|
get when() {
|
|
2633
|
-
return
|
|
2052
|
+
return pe(() => !!(n && w()))() && h();
|
|
2634
2053
|
},
|
|
2635
2054
|
get children() {
|
|
2636
|
-
return
|
|
2055
|
+
return s(ae, {
|
|
2637
2056
|
part: "torch-button-part",
|
|
2638
|
-
onClick: () =>
|
|
2057
|
+
onClick: () => u(),
|
|
2639
2058
|
get tooltipLabel() {
|
|
2640
|
-
return
|
|
2059
|
+
return i.torch;
|
|
2641
2060
|
},
|
|
2642
2061
|
get children() {
|
|
2643
|
-
return [
|
|
2062
|
+
return [s(E, {
|
|
2644
2063
|
get when() {
|
|
2645
|
-
return !
|
|
2064
|
+
return !C();
|
|
2646
2065
|
},
|
|
2647
2066
|
get children() {
|
|
2648
2067
|
return [(() => {
|
|
2649
|
-
var
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
"class": "size-6 shrink-0"
|
|
2068
|
+
var p = re();
|
|
2069
|
+
return y(p, () => i.torch), p;
|
|
2070
|
+
})(), s(Wt, {
|
|
2071
|
+
class: "size-6 shrink-0"
|
|
2654
2072
|
})];
|
|
2655
2073
|
}
|
|
2656
|
-
}),
|
|
2074
|
+
}), s(E, {
|
|
2657
2075
|
get when() {
|
|
2658
|
-
return
|
|
2076
|
+
return C();
|
|
2659
2077
|
},
|
|
2660
2078
|
get children() {
|
|
2661
|
-
return
|
|
2662
|
-
|
|
2079
|
+
return s(jt, {
|
|
2080
|
+
class: "size-6 shrink-0"
|
|
2663
2081
|
});
|
|
2664
2082
|
}
|
|
2665
2083
|
})];
|
|
2666
2084
|
}
|
|
2667
2085
|
});
|
|
2668
2086
|
}
|
|
2669
|
-
}), null)
|
|
2670
|
-
insert(_el$5, createComponent(Show, {
|
|
2087
|
+
}), null), y(g, s(E, {
|
|
2671
2088
|
get when() {
|
|
2672
|
-
return
|
|
2089
|
+
return d().length > 1;
|
|
2673
2090
|
},
|
|
2674
2091
|
get children() {
|
|
2675
|
-
return
|
|
2092
|
+
return s(ar, {});
|
|
2676
2093
|
}
|
|
2677
|
-
}))
|
|
2678
|
-
|
|
2679
|
-
when: showCloseButton,
|
|
2094
|
+
})), y(b, s(E, {
|
|
2095
|
+
when: o,
|
|
2680
2096
|
get children() {
|
|
2681
|
-
var
|
|
2682
|
-
|
|
2097
|
+
var p = or();
|
|
2098
|
+
return y(p, s(ae, {
|
|
2683
2099
|
part: "close-button-part",
|
|
2684
|
-
onClick: () =>
|
|
2100
|
+
onClick: () => t(),
|
|
2685
2101
|
get tooltipLabel() {
|
|
2686
|
-
return
|
|
2102
|
+
return i.close;
|
|
2687
2103
|
},
|
|
2688
2104
|
get children() {
|
|
2689
2105
|
return [(() => {
|
|
2690
|
-
var
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
"class": "size-6 shrink-0"
|
|
2106
|
+
var k = re();
|
|
2107
|
+
return y(k, () => i.close), k;
|
|
2108
|
+
})(), s(Ut, {
|
|
2109
|
+
class: "size-6 shrink-0"
|
|
2695
2110
|
})];
|
|
2696
2111
|
}
|
|
2697
|
-
}));
|
|
2698
|
-
return _el$6;
|
|
2112
|
+
})), p;
|
|
2699
2113
|
}
|
|
2700
|
-
}), null);
|
|
2701
|
-
return _el$;
|
|
2114
|
+
}), null), b;
|
|
2702
2115
|
})()
|
|
2703
2116
|
});
|
|
2704
|
-
}
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
var _el$8 = _tmpl$4$1();
|
|
2712
|
-
spread(_el$8, mergeProps(() => eventFixer(tooltipProps()), {
|
|
2713
|
-
"class": `rounded-full bg-dark-500 bg-opacity-50 backdrop-blur grid place-items-center
|
|
2117
|
+
}, ae = (t) => s(Q.Root, {
|
|
2118
|
+
get children() {
|
|
2119
|
+
return [s(Q.Trigger, Y(t, {
|
|
2120
|
+
asChild: (e) => (() => {
|
|
2121
|
+
var r = sr();
|
|
2122
|
+
return F(r, Y(() => Ne(e()), {
|
|
2123
|
+
class: `rounded-full bg-dark-500 bg-opacity-50 backdrop-blur grid place-items-center
|
|
2714
2124
|
size-12 appearance-none border-none cursor-pointer`
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
get children() {
|
|
2722
|
-
return createComponent(Tooltip.Content, {
|
|
2723
|
-
"class": `bg-dark-500 bg-opacity-50 backdrop-blur color-white text-align-center p-2
|
|
2125
|
+
}), !1, !0), y(r, () => t.children), r;
|
|
2126
|
+
})()
|
|
2127
|
+
})), s(Q.Positioner, {
|
|
2128
|
+
get children() {
|
|
2129
|
+
return s(Q.Content, {
|
|
2130
|
+
class: `bg-dark-500 bg-opacity-50 backdrop-blur color-white text-align-center p-2
|
|
2724
2131
|
rounded-md text-sm drop-shadow-md`,
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
dispose();
|
|
2739
|
-
element.textContent = "";
|
|
2740
|
-
};
|
|
2741
|
-
}, owner);
|
|
2742
|
-
};
|
|
2743
|
-
var _tmpl$$2 = /* @__PURE__ */ template(`<div>`);
|
|
2744
|
-
const SolidShadowRoot = (props) => {
|
|
2745
|
-
const owner = getOwner();
|
|
2746
|
-
const [local, others] = splitProps(props, ["children", "disableShadowRoot", "getRef"]);
|
|
2132
|
+
get children() {
|
|
2133
|
+
return t.tooltipLabel;
|
|
2134
|
+
}
|
|
2135
|
+
});
|
|
2136
|
+
}
|
|
2137
|
+
})];
|
|
2138
|
+
}
|
|
2139
|
+
}), cr = (t, e, r) => Ge((a) => (y(e, t(), e.firstChild ? null : void 0), () => {
|
|
2140
|
+
a(), e.textContent = "";
|
|
2141
|
+
}), r);
|
|
2142
|
+
var ur = /* @__PURE__ */ S("<div>");
|
|
2143
|
+
const dr = (t) => {
|
|
2144
|
+
const e = Se(), [r, a] = Xe(t, ["children", "disableShadowRoot", "getRef"]);
|
|
2747
2145
|
return (() => {
|
|
2748
|
-
var
|
|
2749
|
-
|
|
2750
|
-
if (
|
|
2146
|
+
var n = ur();
|
|
2147
|
+
return B((o) => {
|
|
2148
|
+
if (r.disableShadowRoot)
|
|
2751
2149
|
return;
|
|
2752
|
-
|
|
2753
|
-
const shadowRoot = ref.attachShadow({
|
|
2150
|
+
const i = o.attachShadow({
|
|
2754
2151
|
mode: "open"
|
|
2755
2152
|
});
|
|
2756
|
-
|
|
2757
|
-
},
|
|
2758
|
-
spread(_el$, others, false, true);
|
|
2759
|
-
insert(_el$, createComponent(Show, {
|
|
2153
|
+
cr(() => pe(() => r.children), i, e);
|
|
2154
|
+
}, n), F(n, a, !1, !0), y(n, s(E, {
|
|
2760
2155
|
get when() {
|
|
2761
|
-
return
|
|
2156
|
+
return r.disableShadowRoot;
|
|
2762
2157
|
},
|
|
2763
2158
|
get children() {
|
|
2764
|
-
return
|
|
2159
|
+
return r.children;
|
|
2765
2160
|
}
|
|
2766
|
-
}));
|
|
2767
|
-
return _el$;
|
|
2161
|
+
})), n;
|
|
2768
2162
|
})();
|
|
2769
|
-
};
|
|
2770
|
-
const normalize = '/* Document\n * ========================================================================== */\n\n/**\n * 1. Correct the line height in all browsers.\n * 2. Prevent adjustments of font size after orientation changes in iOS.\n */\n\n:where(html) {\n line-height: 1.15; /* 1 */\n -webkit-text-size-adjust: 100%; /* 2 */\n text-size-adjust: 100%; /* 2 */\n}\n\n/* Sections\n * ========================================================================== */\n\n/**\n * Correct the font size and margin on `h1` elements within `section` and\n * `article` contexts in Chrome, Edge, Firefox, and Safari.\n */\n\n:where(h1) {\n font-size: 2em;\n margin-block-end: 0.67em;\n margin-block-start: 0.67em;\n}\n\n/* Grouping content\n * ========================================================================== */\n\n/**\n * Remove the margin on nested lists in Chrome, Edge, and Safari.\n */\n\n:where(dl, ol, ul) :where(dl, ol, ul) {\n margin-block-end: 0;\n margin-block-start: 0;\n}\n\n/**\n * 1. Add the correct box sizing in Firefox.\n * 2. Correct the inheritance of border color in Firefox.\n */\n\n:where(hr) {\n box-sizing: content-box; /* 1 */\n color: inherit; /* 2 */\n height: 0; /* 1 */\n}\n\n/* Text-level semantics\n * ========================================================================== */\n\n/**\n * Add the correct text decoration in Safari.\n */\n\n:where(abbr[title]) {\n text-decoration: underline;\n text-decoration: underline dotted;\n}\n\n/**\n * Add the correct font weight in Chrome, Edge, and Safari.\n */\n\n:where(b, strong) {\n font-weight: bolder;\n}\n\n/**\n * 1. Correct the inheritance and scaling of font size in all browsers.\n * 2. Correct the odd `em` font sizing in all browsers.\n */\n\n:where(code, kbd, pre, samp) {\n font-family: monospace, monospace; /* 1 */\n font-size: 1em; /* 2 */\n}\n\n/**\n * Add the correct font size in all browsers.\n */\n\n:where(small) {\n font-size: 80%;\n}\n\n/* Tabular data\n * ========================================================================== */\n\n/**\n * 1. Correct table border color in Chrome, Edge, and Safari.\n * 2. Remove text indentation from table contents in Chrome, Edge, and Safari.\n */\n\n:where(table) {\n border-color: currentColor; /* 1 */\n text-indent: 0; /* 2 */\n}\n\n/* Forms\n * ========================================================================== */\n\n/**\n * Remove the margin on controls in Safari.\n */\n\n:where(button, input, select) {\n margin: 0;\n}\n\n/**\n * Remove the inheritance of text transform in Firefox.\n */\n\n:where(button) {\n text-transform: none;\n}\n\n/**\n * Correct the inability to style buttons in iOS and Safari.\n */\n\n:where(button, input:is([type="button" i], [type="reset" i], [type="submit" i])) {\n -webkit-appearance: button;\n}\n\n/**\n * Add the correct vertical alignment in Chrome, Edge, and Firefox.\n */\n\n:where(progress) {\n vertical-align: baseline;\n}\n\n/**\n * Remove the inheritance of text transform in Firefox.\n */\n\n:where(select) {\n text-transform: none;\n}\n\n/**\n * Remove the margin in Firefox and Safari.\n */\n\n:where(textarea) {\n margin: 0;\n}\n\n/**\n * 1. Correct the odd appearance in Chrome, Edge, and Safari.\n * 2. Correct the outline style in Safari.\n */\n\n:where(input[type="search" i]) {\n -webkit-appearance: textfield; /* 1 */\n outline-offset: -2px; /* 2 */\n}\n\n/**\n * Correct the cursor style of increment and decrement buttons in Safari.\n */\n\n::-webkit-inner-spin-button,\n::-webkit-outer-spin-button {\n height: auto;\n}\n\n/**\n * Correct the text style of placeholders in Chrome, Edge, and Safari.\n */\n\n::-webkit-input-placeholder {\n color: inherit;\n opacity: 0.54;\n}\n\n/**\n * Remove the inner padding in Chrome, Edge, and Safari on macOS.\n */\n\n::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n/**\n * 1. Correct the inability to style upload buttons in iOS and Safari.\n * 2. Change font properties to `inherit` in Safari.\n */\n\n::-webkit-file-upload-button {\n -webkit-appearance: button; /* 1 */\n font: inherit; /* 2 */\n}\n\n/**\n * Remove the inner border and padding of focus outlines in Firefox.\n */\n\n:where(button, input:is([type="button" i], [type="color" i], [type="reset" i], [type="submit" i]))::-moz-focus-inner {\n border-style: none;\n padding: 0;\n}\n\n/**\n * Restore the focus outline styles unset by the previous rule in Firefox.\n */\n\n:where(button, input:is([type="button" i], [type="color" i], [type="reset" i], [type="submit" i]))::-moz-focusring {\n outline: 1px dotted ButtonText;\n}\n\n/**\n * Remove the additional :invalid styles in Firefox.\n */\n\n:where(:-moz-ui-invalid) {\n box-shadow: none;\n}\n\n/* Interactive\n * ========================================================================== */\n\n/*\n * Add the correct styles in Safari.\n */\n\n:where(dialog) {\n background-color: white;\n border: solid;\n color: black;\n height: -moz-fit-content;\n height: fit-content;\n left: 0;\n margin: auto;\n padding: 1em;\n position: absolute;\n right: 0;\n width: -moz-fit-content;\n width: fit-content;\n}\n\n:where(dialog:not([open])) {\n display: none;\n}\n\n/*\n * Add the correct display in all browsers.\n */\n\n:where(summary) {\n display: list-item;\n}\n';
|
|
2771
|
-
const rootStyles = ":host {\n font-family: var(--mb-ui-font);\n line-height: 1.15;\n isolation: isolate;\n box-sizing: border-box;\n}\n\n*,\n*::before,\n*::after {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n}\n\np,\nh1,\nh2,\nh3,\nh4,\nh5,\nh6 {\n overflow-wrap: break-word;\n}\n\ncode {\n font-family: var(--mb-monospace-font-stack);\n}\n\npre {\n font-family: var(--mb-monospace-font-stack);\n}\n\nsvg path {\n pointer-events: none;\n}\n\nimg,\npicture,\nvideo,\ncanvas,\nsvg {\n display: block;\n max-width: 100%;\n}\n\nimg {\n pointer-events: none;\n user-select: none;\n}\n\n:where(input, button, textarea, select) {\n font: inherit;\n}\n\n:where(button, select) {\n cursor: pointer;\n color: inherit;\n font: inherit;\n}\n\n:where(p, h1, h2, h3, h4, h5, h6) {\n overflow-wrap: break-word;\n}";
|
|
2772
|
-
const variables = ':host {\n --mb-system-font-stack:\n -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu",\n "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;\n --mb-monospace-font-stack:\n Menlo, Consolas, "Ubuntu Mono", "Roboto Mono", "DejaVu Sans Mono", monospace;\n --mb-ui-font: var(--mb-system-font-stack);\n --mb-size: 1;\n /***************************************/\n /* MB COLORS */\n /***************************************/\n --color-accent-25-rgb-value: 242 247 255; /* #F2F7FF */\n --color-accent-50-rgb-value: 231 240 255; /* #E7F0FF */\n --color-accent-100-rgb-value: 220 234 255; /* #DCEAFF */\n --color-accent-200-rgb-value: 198 221 255; /* #C6DDFF */\n --color-accent-300-rgb-value: 158 197 255; /* #9EC5FF */\n --color-accent-400-rgb-value: 111 169 255; /* #6FA9FF */\n --color-accent-500-rgb-value: 58 137 253; /* #3A89FD */\n --color-accent-600-rgb-value: 0 98 242; /* #0062F2 */\n --color-accent-700-rgb-value: 0 80 197; /* #0050C5 */\n --color-accent-800-rgb-value: 0 64 157; /* #00409D */\n --color-accent-900-rgb-value: 0 54 133; /* #003685 */\n --color-error-25-rgb-value: 255 248 249; /* #FFF8F9 */\n --color-error-50-rgb-value: 255 241 242; /* #FFF1F2 */\n --color-error-100-rgb-value: 255 228 230; /* #FFE4E6 */\n --color-error-200-rgb-value: 254 205 211; /* #FECDD3 */\n --color-error-300-rgb-value: 253 164 175; /* #FDA4AF */\n --color-error-400-rgb-value: 251 113 133; /* #FB7185 */\n --color-error-500-rgb-value: 244 63 94; /* #F43F5E */\n --color-error-600-rgb-value: 225 29 72; /* #E11D48 */\n --color-error-700-rgb-value: 190 18 60; /* #BE123C */\n --color-error-800-rgb-value: 136 19 39; /* #881337 */\n --color-error-900-rgb-value: 89 13 40; /* #590D28 */\n --color-success-25-rgb-value: 245 254 250; /* #F5FEFA */\n --color-success-50-rgb-value: 236 253 245; /* #ECFDF5 */\n --color-success-100-rgb-value: 209 250 229; /* #D1FAE5 */\n --color-success-200-rgb-value: 167 243 208; /* #A7F3D0 */\n --color-success-300-rgb-value: 110 231 183; /* #6EE7B7 */\n --color-success-400-rgb-value: 52 211 153; /* #34D399 */\n --color-success-500-rgb-value: 16 185 144; /* #10B990 */\n --color-success-600-rgb-value: 22 163 138; /* #16A38A */\n --color-success-700-rgb-value: 39 121 106; /* #27796A */\n --color-success-800-rgb-value: 23 92 79; /* #175C4F */\n --color-success-900-rgb-value: 12 59 50; /* #0C3B32 */\n --color-warning-25-rgb-value: 255 253 243; /* #FFFDF3 */\n --color-warning-50-rgb-value: 254 252 232; /* #FEFCE8 */\n --color-warning-100-rgb-value: 254 249 195; /* #FEF9C3 */\n --color-warning-200-rgb-value: 254 240 138; /* #FEF08A */\n --color-warning-300-rgb-value: 253 229 99; /* #FDE563 */\n --color-warning-400-rgb-value: 252 218 59; /* #FCDA3B */\n --color-warning-500-rgb-value: 250 204 21; /* #FACC15 */\n --color-warning-600-rgb-value: 234 179 8; /* #EAB308 */\n --color-warning-700-rgb-value: 190 142 48; /* #BE8E30 */\n --color-warning-800-rgb-value: 132 83 28; /* #84531C */\n --color-warning-900-rgb-value: 80 29 10; /* #501D0A */\n --color-deep-blue-25-rgb-value: 249 252 255; /* #F9FCFF */\n --color-deep-blue-50-rgb-value: 243 249 254; /* #F3F9FE */\n --color-deep-blue-100-rgb-value: 231 242 251; /* #E7F2FB */\n --color-deep-blue-200-rgb-value: 201 218 241; /* #C9DAF1 */\n --color-deep-blue-300-rgb-value: 162 185 216; /* #A2B9D8 */\n --color-deep-blue-400-rgb-value: 93 128 182; /* #5D80B6 */\n --color-deep-blue-500-rgb-value: 60 100 161; /* #3C64A1 */\n --color-deep-blue-600-rgb-value: 28 68 129; /* #1C4481 */\n --color-deep-blue-700-rgb-value: 24 53 97; /* #183561 */\n --color-deep-blue-800-rgb-value: 20 38 65; /* #142641 */\n --color-deep-blue-900-rgb-value: 6 23 49; /* #061731 */\n --color-light-blue-25-rgb-value: 248 251 253; /* #F8FBFD */\n --color-light-blue-50-rgb-value: 240 247 251; /* #F0F7FB */\n --color-light-blue-100-rgb-value: 228 238 244; /* #E4EEF4 */\n --color-light-blue-200-rgb-value: 215 229 238; /* #D7E5EE */\n --color-light-blue-300-rgb-value: 190 218 237; /* #BEDAED */\n --color-light-blue-400-rgb-value: 159 202 232; /* #9FCAE8 */\n --color-light-blue-500-rgb-value: 135 180 211; /* #87B4D3 */\n --color-light-blue-600-rgb-value: 104 157 193; /* #689DC1 */\n --color-light-blue-700-rgb-value: 78 129 164; /* #4E81A4 */\n --color-light-blue-800-rgb-value: 67 109 138; /* #436D8A */\n --color-light-blue-900-rgb-value: 55 84 104; /* #375468 */\n --color-gray-50-rgb-value: 249 250 251; /* #FAFAFA */\n --color-gray-100-rgb-value: 243 244 246; /* #F5F5F5 */\n --color-gray-200-rgb-value: 229 231 235; /* #F0F0F0 */\n --color-gray-300-rgb-value: 209 213 219; /* #D9D9D9 */\n --color-gray-400-rgb-value: 156 163 175; /* #BFBFBF */\n --color-gray-500-rgb-value: 107 114 128; /* #8C8C8C */\n --color-gray-600-rgb-value: 75 85 99; /* #595959 */\n --color-gray-700-rgb-value: 55 65 81; /* #434343 */\n --color-gray-800-rgb-value: 31 41 55; /* #262626 */\n --color-blue-gray-50-rgb-value: 74 74 74; /* #F9FAFB */\n --color-blue-gray-100-rgb-value: 60 60 60; /* #F3F4F6 */\n --color-blue-gray-200-rgb-value: 50 50 50; /* #E5E7EB */\n --color-blue-gray-300-rgb-value: 45 45 45; /* #D1D5DB */\n --color-blue-gray-400-rgb-value: 34 34 34; /* #9CA3AF */\n --color-blue-gray-500-rgb-value: 31 31 31; /* #6B7280 */\n --color-blue-gray-600-rgb-value: 28 28 30; /* #4B5563 */\n --color-blue-gray-700-rgb-value: 27 27 27; /* #374151 */\n --color-blue-gray-800-rgb-value: 24 24 24; /* #1F2937 */\n --color-blue-gray-900-rgb-value: 15 15 15; /* #111827 */\n --color-black-rgb-value: 0 0 0; /* #000000 */\n --color-white-rgb-value: 255 255 255; /* #FFFFFF */\n --color-primary: var(--color-accent-600-rgb-value);\n --color-error: var(--color-error-500-rgb-value);\n --color-success: var(--color-success-500-rgb-value);\n --color-warning: var(--color-warning-500-rgb-value);\n --color-deep-blue: var(--color-deep-blue-800-rgb-value);\n --color-light-blue: var(--color-light-blue-200-rgb-value);\n accent-color: var(--color-primary);\n caret-color: red;\n}';
|
|
2773
|
-
const initialState = {
|
|
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}", fr = ':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-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}', gr = {
|
|
2774
2164
|
feedbackLayer: null,
|
|
2775
2165
|
overlayLayer: null,
|
|
2776
2166
|
owner: null
|
|
2777
|
-
}
|
|
2778
|
-
const cameraUiRefStore = createStore()(
|
|
2167
|
+
}, U = be()(
|
|
2779
2168
|
// this is important! Otherwise, solid-zustand will start mutating the initial state
|
|
2780
|
-
|
|
2781
|
-
)
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
return {
|
|
2791
|
-
observe: (ref) => observer.observe(ref, options),
|
|
2792
|
-
unobserve: observer.unobserve.bind(observer)
|
|
2169
|
+
ge(() => structuredClone(gr))
|
|
2170
|
+
), le = Ce(U), fe = () => {
|
|
2171
|
+
};
|
|
2172
|
+
function br(t, e) {
|
|
2173
|
+
if (Ue)
|
|
2174
|
+
return { observe: fe, unobserve: fe };
|
|
2175
|
+
const r = new ResizeObserver(t);
|
|
2176
|
+
return ce(r.disconnect.bind(r)), {
|
|
2177
|
+
observe: (a) => r.observe(a, e),
|
|
2178
|
+
unobserve: r.unobserve.bind(r)
|
|
2793
2179
|
};
|
|
2794
2180
|
}
|
|
2795
|
-
const
|
|
2796
|
-
const
|
|
2797
|
-
let
|
|
2798
|
-
if (
|
|
2799
|
-
const
|
|
2800
|
-
|
|
2181
|
+
const pr = (t, e, r, a) => {
|
|
2182
|
+
const n = Math.max(t / r, e / a);
|
|
2183
|
+
let o = 0;
|
|
2184
|
+
if (t / r > e / a) {
|
|
2185
|
+
const i = n * a;
|
|
2186
|
+
o = 1 - e / i;
|
|
2801
2187
|
} else {
|
|
2802
|
-
const
|
|
2803
|
-
|
|
2804
|
-
}
|
|
2805
|
-
if (croppedFraction < 0.1) {
|
|
2806
|
-
return "cover";
|
|
2807
|
-
} else {
|
|
2808
|
-
return "contain";
|
|
2188
|
+
const i = n * r;
|
|
2189
|
+
o = 1 - t / i;
|
|
2809
2190
|
}
|
|
2191
|
+
return o < 0.1 ? "cover" : "contain";
|
|
2810
2192
|
};
|
|
2811
|
-
function
|
|
2812
|
-
const
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
const visibleNaturalHeight = Math.round(containerHeight / s);
|
|
2817
|
-
const y = Math.round((videoHeight - visibleNaturalHeight) / 2);
|
|
2818
|
-
return { x: 0, y, width: videoWidth, height: visibleNaturalHeight };
|
|
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 };
|
|
2819
2198
|
} else {
|
|
2820
|
-
const
|
|
2821
|
-
|
|
2822
|
-
return { x, y: 0, width: visibleNaturalWidth, height: videoHeight };
|
|
2199
|
+
const l = Math.round(t / i);
|
|
2200
|
+
return { x: Math.round((r - l) / 2), y: 0, width: l, height: a };
|
|
2823
2201
|
}
|
|
2824
2202
|
}
|
|
2825
|
-
const
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
dialogPositioner,
|
|
2841
|
-
dialogBackdrop,
|
|
2842
|
-
dialogContent,
|
|
2843
|
-
large,
|
|
2844
|
-
compact,
|
|
2845
|
-
dialogTitle,
|
|
2846
|
-
contentOut,
|
|
2847
|
-
closeButton,
|
|
2848
|
-
closeButtonInner,
|
|
2849
|
-
primaryActionButton,
|
|
2850
|
-
secondaryActionButton,
|
|
2851
|
-
actions,
|
|
2852
|
-
alertTitle,
|
|
2853
|
-
alertText
|
|
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", _ = {
|
|
2204
|
+
dialogPositioner: wr,
|
|
2205
|
+
dialogBackdrop: yr,
|
|
2206
|
+
dialogContent: Sr,
|
|
2207
|
+
large: Cr,
|
|
2208
|
+
compact: kr,
|
|
2209
|
+
dialogTitle: Er,
|
|
2210
|
+
contentOut: _r,
|
|
2211
|
+
closeButton: Tr,
|
|
2212
|
+
closeButtonInner: Mr,
|
|
2213
|
+
primaryActionButton: xr,
|
|
2214
|
+
secondaryActionButton: Rr,
|
|
2215
|
+
actions: Ar,
|
|
2216
|
+
alertTitle: $r,
|
|
2217
|
+
alertText: Fr
|
|
2854
2218
|
};
|
|
2855
|
-
var
|
|
2856
|
-
const
|
|
2857
|
-
const
|
|
2858
|
-
switch (
|
|
2219
|
+
var Dr = /* @__PURE__ */ S("<span>×"), Ir = /* @__PURE__ */ S("<div>"), zr = /* @__PURE__ */ S("<p>"), Lr = /* @__PURE__ */ S("<span>"), Nr = /* @__PURE__ */ S("<div><button></button><button>");
|
|
2220
|
+
const Br = (t) => {
|
|
2221
|
+
const e = () => {
|
|
2222
|
+
switch (t.modalStyle) {
|
|
2859
2223
|
case "compact":
|
|
2860
|
-
return
|
|
2224
|
+
return _.compact;
|
|
2861
2225
|
case "large":
|
|
2862
|
-
return
|
|
2226
|
+
return _.compact;
|
|
2863
2227
|
case "default":
|
|
2864
2228
|
default:
|
|
2865
|
-
return
|
|
2229
|
+
return;
|
|
2866
2230
|
}
|
|
2867
2231
|
};
|
|
2868
|
-
return
|
|
2869
|
-
children: () =>
|
|
2870
|
-
onFocusOutside: (
|
|
2871
|
-
onInteractOutside: (
|
|
2872
|
-
restoreFocus:
|
|
2873
|
-
unmountOnExit:
|
|
2874
|
-
lazyMount:
|
|
2875
|
-
},
|
|
2232
|
+
return s(ee, {
|
|
2233
|
+
children: () => s($.Root, Y({
|
|
2234
|
+
onFocusOutside: (r) => r.preventDefault(),
|
|
2235
|
+
onInteractOutside: (r) => r.preventDefault(),
|
|
2236
|
+
restoreFocus: !0,
|
|
2237
|
+
unmountOnExit: !0,
|
|
2238
|
+
lazyMount: !0
|
|
2239
|
+
}, t, {
|
|
2876
2240
|
get children() {
|
|
2877
|
-
return
|
|
2241
|
+
return s(E, {
|
|
2878
2242
|
get when() {
|
|
2879
|
-
return
|
|
2243
|
+
return t.open;
|
|
2880
2244
|
},
|
|
2881
2245
|
get children() {
|
|
2882
|
-
return
|
|
2246
|
+
return s(ve, {
|
|
2883
2247
|
get mount() {
|
|
2884
|
-
return
|
|
2248
|
+
return t.mountTarget;
|
|
2885
2249
|
},
|
|
2886
2250
|
get children() {
|
|
2887
|
-
return
|
|
2888
|
-
get
|
|
2889
|
-
return
|
|
2251
|
+
return s($.Positioner, {
|
|
2252
|
+
get class() {
|
|
2253
|
+
return _.dialogPositioner;
|
|
2890
2254
|
},
|
|
2891
2255
|
get children() {
|
|
2892
|
-
return [
|
|
2893
|
-
get
|
|
2894
|
-
return
|
|
2256
|
+
return [s($.Backdrop, {
|
|
2257
|
+
get class() {
|
|
2258
|
+
return _.dialogBackdrop;
|
|
2895
2259
|
}
|
|
2896
|
-
}),
|
|
2897
|
-
get
|
|
2898
|
-
return `${
|
|
2260
|
+
}), s($.Content, {
|
|
2261
|
+
get class() {
|
|
2262
|
+
return `${_.dialogContent} ${e()}`;
|
|
2899
2263
|
},
|
|
2900
2264
|
get children() {
|
|
2901
|
-
return [
|
|
2265
|
+
return [s(E, {
|
|
2902
2266
|
get when() {
|
|
2903
|
-
return
|
|
2267
|
+
return t.showCloseButton;
|
|
2904
2268
|
},
|
|
2905
2269
|
get children() {
|
|
2906
|
-
return
|
|
2907
|
-
get
|
|
2908
|
-
return
|
|
2270
|
+
return s($.CloseTrigger, {
|
|
2271
|
+
get class() {
|
|
2272
|
+
return _.closeButton;
|
|
2909
2273
|
},
|
|
2910
2274
|
get onClick() {
|
|
2911
|
-
return
|
|
2275
|
+
return t.onCloseClicked;
|
|
2912
2276
|
},
|
|
2913
2277
|
get children() {
|
|
2914
|
-
var
|
|
2915
|
-
|
|
2916
|
-
return _el$;
|
|
2278
|
+
var r = Dr();
|
|
2279
|
+
return H(() => V(r, _.closeButtonInner)), r;
|
|
2917
2280
|
}
|
|
2918
2281
|
});
|
|
2919
2282
|
}
|
|
2920
|
-
}),
|
|
2283
|
+
}), s(E, {
|
|
2921
2284
|
get when() {
|
|
2922
|
-
return
|
|
2285
|
+
return t.headerImage;
|
|
2923
2286
|
},
|
|
2924
2287
|
get children() {
|
|
2925
|
-
return
|
|
2288
|
+
return t.headerImage;
|
|
2926
2289
|
}
|
|
2927
|
-
}),
|
|
2290
|
+
}), s(E, {
|
|
2928
2291
|
get when() {
|
|
2929
|
-
return
|
|
2292
|
+
return t.header;
|
|
2930
2293
|
},
|
|
2931
|
-
children: (
|
|
2932
|
-
get
|
|
2933
|
-
return
|
|
2294
|
+
children: (r) => s($.Title, {
|
|
2295
|
+
get class() {
|
|
2296
|
+
return _.dialogTitle;
|
|
2934
2297
|
},
|
|
2935
2298
|
get children() {
|
|
2936
|
-
return
|
|
2299
|
+
return r();
|
|
2937
2300
|
}
|
|
2938
2301
|
})
|
|
2939
|
-
}),
|
|
2940
|
-
get
|
|
2941
|
-
return
|
|
2302
|
+
}), s($.Description, {
|
|
2303
|
+
get class() {
|
|
2304
|
+
return _.contentOut;
|
|
2942
2305
|
},
|
|
2943
2306
|
get children() {
|
|
2944
|
-
return
|
|
2307
|
+
return t.children;
|
|
2945
2308
|
}
|
|
2946
|
-
}),
|
|
2309
|
+
}), s(E, {
|
|
2947
2310
|
get when() {
|
|
2948
|
-
return
|
|
2311
|
+
return t.actions;
|
|
2949
2312
|
},
|
|
2950
2313
|
get children() {
|
|
2951
|
-
var
|
|
2952
|
-
|
|
2953
|
-
return _el$2;
|
|
2314
|
+
var r = Ir();
|
|
2315
|
+
return y(r, () => t.actions), r;
|
|
2954
2316
|
}
|
|
2955
2317
|
})];
|
|
2956
2318
|
}
|
|
@@ -2964,89 +2326,73 @@ const Modal = (props) => {
|
|
|
2964
2326
|
}
|
|
2965
2327
|
}))
|
|
2966
2328
|
});
|
|
2967
|
-
}
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
secondaryButtonText = "Cancel"
|
|
2329
|
+
}, Or = ({
|
|
2330
|
+
mountTarget: t,
|
|
2331
|
+
header: e,
|
|
2332
|
+
text: r,
|
|
2333
|
+
open: a,
|
|
2334
|
+
onPrimaryClick: n,
|
|
2335
|
+
onSecondaryClick: o,
|
|
2336
|
+
primaryButtonText: i = "Retry",
|
|
2337
|
+
secondaryButtonText: l = "Cancel"
|
|
2977
2338
|
}) => {
|
|
2978
|
-
let
|
|
2979
|
-
return
|
|
2980
|
-
mountTarget,
|
|
2339
|
+
let c;
|
|
2340
|
+
return s(Br, {
|
|
2341
|
+
mountTarget: t,
|
|
2981
2342
|
get header() {
|
|
2982
2343
|
return (() => {
|
|
2983
|
-
var
|
|
2984
|
-
|
|
2985
|
-
effect(() => className(_el$4, styles.alertTitle));
|
|
2986
|
-
return _el$4;
|
|
2344
|
+
var d = Lr();
|
|
2345
|
+
return y(d, e), H(() => V(d, _.alertTitle)), d;
|
|
2987
2346
|
})();
|
|
2988
2347
|
},
|
|
2989
|
-
initialFocusEl: () =>
|
|
2990
|
-
open,
|
|
2348
|
+
initialFocusEl: () => c,
|
|
2349
|
+
open: a,
|
|
2991
2350
|
get actions() {
|
|
2992
2351
|
return (() => {
|
|
2993
|
-
var
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
insert(_el$7, primaryButtonText);
|
|
3000
|
-
effect((_p$) => {
|
|
3001
|
-
var _v$ = styles.actions, _v$2 = styles.secondaryActionButton, _v$3 = styles.primaryActionButton;
|
|
3002
|
-
_v$ !== _p$.e && className(_el$5, _p$.e = _v$);
|
|
3003
|
-
_v$2 !== _p$.t && className(_el$6, _p$.t = _v$2);
|
|
3004
|
-
_v$3 !== _p$.a && className(_el$7, _p$.a = _v$3);
|
|
3005
|
-
return _p$;
|
|
2352
|
+
var d = Nr(), h = d.firstChild, C = h.nextSibling;
|
|
2353
|
+
h.$$click = () => o(), y(h, l), C.$$click = () => n();
|
|
2354
|
+
var w = c;
|
|
2355
|
+
return typeof w == "function" ? B(w, C) : c = C, y(C, i), H((u) => {
|
|
2356
|
+
var v = _.actions, b = _.secondaryActionButton, f = _.primaryActionButton;
|
|
2357
|
+
return v !== u.e && V(d, u.e = v), b !== u.t && V(h, u.t = b), f !== u.a && V(C, u.a = f), u;
|
|
3006
2358
|
}, {
|
|
3007
2359
|
e: void 0,
|
|
3008
2360
|
t: void 0,
|
|
3009
2361
|
a: void 0
|
|
3010
|
-
});
|
|
3011
|
-
return _el$5;
|
|
2362
|
+
}), d;
|
|
3012
2363
|
})();
|
|
3013
2364
|
},
|
|
3014
2365
|
modalStyle: "compact",
|
|
3015
2366
|
get children() {
|
|
3016
|
-
var
|
|
3017
|
-
|
|
3018
|
-
effect(() => className(_el$3, styles.alertText));
|
|
3019
|
-
return _el$3;
|
|
2367
|
+
var d = zr();
|
|
2368
|
+
return y(d, r), H(() => V(d, _.alertText)), d;
|
|
3020
2369
|
}
|
|
3021
2370
|
});
|
|
3022
2371
|
};
|
|
3023
|
-
|
|
3024
|
-
const
|
|
2372
|
+
qe(["click"]);
|
|
2373
|
+
const Pr = () => {
|
|
3025
2374
|
const {
|
|
3026
2375
|
t
|
|
3027
|
-
} =
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
const errorState = cameraManagerSolidStore((x) => x.errorState);
|
|
3034
|
-
const overlayLayer = cameraUiRefSignalStore((x) => x.overlayLayer);
|
|
3035
|
-
return createComponent(Show, {
|
|
2376
|
+
} = Z(), {
|
|
2377
|
+
cameraManagerSolidStore: e,
|
|
2378
|
+
cameraManager: r,
|
|
2379
|
+
dismountCameraUi: a
|
|
2380
|
+
} = j(), n = e((i) => i.errorState), o = le((i) => i.overlayLayer);
|
|
2381
|
+
return s(E, {
|
|
3036
2382
|
get when() {
|
|
3037
|
-
return
|
|
2383
|
+
return n();
|
|
3038
2384
|
},
|
|
3039
2385
|
get children() {
|
|
3040
|
-
return
|
|
2386
|
+
return s(Or, {
|
|
3041
2387
|
get mountTarget() {
|
|
3042
|
-
return
|
|
2388
|
+
return o();
|
|
3043
2389
|
},
|
|
3044
2390
|
get header() {
|
|
3045
2391
|
return t.camera_error_title;
|
|
3046
2392
|
},
|
|
3047
|
-
open:
|
|
3048
|
-
onPrimaryClick: () => void
|
|
3049
|
-
onSecondaryClick: () =>
|
|
2393
|
+
open: !0,
|
|
2394
|
+
onPrimaryClick: () => void r.startCameraStream(),
|
|
2395
|
+
onSecondaryClick: () => a(),
|
|
3050
2396
|
get primaryButtonText() {
|
|
3051
2397
|
return t.camera_error_primary_btn;
|
|
3052
2398
|
},
|
|
@@ -3060,179 +2406,134 @@ const CameraErrorModal = () => {
|
|
|
3060
2406
|
}
|
|
3061
2407
|
});
|
|
3062
2408
|
};
|
|
3063
|
-
var
|
|
3064
|
-
const
|
|
3065
|
-
const CaptureScreen = () => {
|
|
2409
|
+
var ne = /* @__PURE__ */ S("<style>"), Vr = /* @__PURE__ */ S("<style id=camera-manager-style>"), Ur = /* @__PURE__ */ S('<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>');
|
|
2410
|
+
const Be = "capture-screen-host", Oe = () => {
|
|
3066
2411
|
const {
|
|
3067
|
-
cameraManager,
|
|
3068
|
-
mountTarget
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
const [fitMode, setFitMode] = createSignal("contain");
|
|
3075
|
-
function adjustVideoFit() {
|
|
3076
|
-
const video = videoRef();
|
|
3077
|
-
if (!video) {
|
|
2412
|
+
cameraManager: t,
|
|
2413
|
+
mountTarget: e,
|
|
2414
|
+
showCameraErrorModal: r
|
|
2415
|
+
} = j(), [a, n] = z(), [o, i] = z(), [l, c] = z(), d = () => e.parentNode === document.body, [h, C] = z("contain");
|
|
2416
|
+
function w() {
|
|
2417
|
+
const u = a();
|
|
2418
|
+
if (!u)
|
|
3078
2419
|
return;
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
const
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
cameraManager.setExtractionArea(visibleArea);
|
|
3089
|
-
} else {
|
|
3090
|
-
cameraManager.setExtractionArea({
|
|
2420
|
+
const v = u.clientWidth, b = u.clientHeight, f = u.videoWidth, g = u.videoHeight;
|
|
2421
|
+
if (f === 0 || g === 0)
|
|
2422
|
+
return;
|
|
2423
|
+
const p = pr(v, b, f, g);
|
|
2424
|
+
if (C(p), p === "cover") {
|
|
2425
|
+
const k = vr(v, b, f, g);
|
|
2426
|
+
t.setExtractionArea(k);
|
|
2427
|
+
} else
|
|
2428
|
+
t.setExtractionArea({
|
|
3091
2429
|
x: 0,
|
|
3092
2430
|
y: 0,
|
|
3093
|
-
width:
|
|
3094
|
-
height:
|
|
2431
|
+
width: f,
|
|
2432
|
+
height: g
|
|
3095
2433
|
});
|
|
3096
|
-
}
|
|
3097
2434
|
}
|
|
3098
|
-
|
|
3099
|
-
const
|
|
3100
|
-
if (!
|
|
2435
|
+
return J(() => {
|
|
2436
|
+
const u = a();
|
|
2437
|
+
if (!u)
|
|
3101
2438
|
return;
|
|
3102
|
-
}
|
|
3103
2439
|
const {
|
|
3104
|
-
observe,
|
|
3105
|
-
unobserve
|
|
3106
|
-
} =
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
onCleanup(() => {
|
|
3110
|
-
unobserve(video);
|
|
3111
|
-
video.removeEventListener("loadedmetadata", adjustVideoFit);
|
|
2440
|
+
observe: v,
|
|
2441
|
+
unobserve: b
|
|
2442
|
+
} = br(w);
|
|
2443
|
+
v(u), u.addEventListener("resize", w), u.addEventListener("loadedmetadata", w), ce(() => {
|
|
2444
|
+
b(u), u.removeEventListener("resize", w), u.removeEventListener("loadedmetadata", w);
|
|
3112
2445
|
});
|
|
3113
|
-
})
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
return;
|
|
3118
|
-
}
|
|
3119
|
-
cameraUiRefSignalStore.setState({
|
|
3120
|
-
owner
|
|
3121
|
-
});
|
|
3122
|
-
});
|
|
3123
|
-
createEffect(() => {
|
|
3124
|
-
const $videoRef = videoRef();
|
|
3125
|
-
const $feedbackRef = feedbackRef();
|
|
3126
|
-
const $overlayLayerRef = overlayLayerRef();
|
|
3127
|
-
if (!$videoRef || !$feedbackRef || !$overlayLayerRef) {
|
|
3128
|
-
return;
|
|
3129
|
-
}
|
|
3130
|
-
cameraUiRefSignalStore.setState({
|
|
3131
|
-
feedbackLayer: $feedbackRef,
|
|
3132
|
-
overlayLayer: $overlayLayerRef
|
|
2446
|
+
}), J(() => {
|
|
2447
|
+
const u = Se();
|
|
2448
|
+
u && le.setState({
|
|
2449
|
+
owner: u
|
|
3133
2450
|
});
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
2451
|
+
}), Qe(() => {
|
|
2452
|
+
const u = a(), v = o(), b = l();
|
|
2453
|
+
!u || !v || !b || (le.setState({
|
|
2454
|
+
feedbackLayer: v,
|
|
2455
|
+
overlayLayer: b
|
|
2456
|
+
}), t.initVideoElement(u));
|
|
2457
|
+
}), s(dr, {
|
|
3137
2458
|
get id() {
|
|
3138
|
-
return
|
|
2459
|
+
return d() ? void 0 : Be;
|
|
3139
2460
|
},
|
|
3140
2461
|
get disableShadowRoot() {
|
|
3141
|
-
return
|
|
2462
|
+
return d();
|
|
3142
2463
|
},
|
|
3143
2464
|
get style() {
|
|
3144
|
-
return
|
|
2465
|
+
return d() ? {
|
|
3145
2466
|
height: "100%"
|
|
3146
2467
|
} : void 0;
|
|
3147
2468
|
},
|
|
3148
2469
|
get children() {
|
|
3149
2470
|
return [(() => {
|
|
3150
|
-
var
|
|
3151
|
-
|
|
3152
|
-
return _el$;
|
|
2471
|
+
var u = ne();
|
|
2472
|
+
return y(u, fr), u;
|
|
3153
2473
|
})(), (() => {
|
|
3154
|
-
var
|
|
3155
|
-
|
|
3156
|
-
return _el$2;
|
|
2474
|
+
var u = ne();
|
|
2475
|
+
return y(u, hr), u;
|
|
3157
2476
|
})(), (() => {
|
|
3158
|
-
var
|
|
3159
|
-
|
|
3160
|
-
return _el$3;
|
|
2477
|
+
var u = ne();
|
|
2478
|
+
return y(u, mr), u;
|
|
3161
2479
|
})(), (() => {
|
|
3162
|
-
var
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
}
|
|
3167
|
-
}, _el$4);
|
|
3168
|
-
return _el$4;
|
|
2480
|
+
var u = Vr();
|
|
2481
|
+
return B((v) => {
|
|
2482
|
+
window.__mbCameraManagerCssCode && (v.innerHTML = window.__mbCameraManagerCssCode);
|
|
2483
|
+
}, u), u;
|
|
3169
2484
|
})(), (() => {
|
|
3170
|
-
var
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
return _el$5;
|
|
2485
|
+
var u = Ur(), v = u.firstChild, b = v.nextSibling, f = b.nextSibling;
|
|
2486
|
+
return y(u, s(lr, {}), v), B(n, v), B(i, b), B(c, f), y(u, s(E, {
|
|
2487
|
+
when: r,
|
|
2488
|
+
get children() {
|
|
2489
|
+
return s(Pr, {});
|
|
2490
|
+
}
|
|
2491
|
+
}), null), H((g) => (g = h()) != null ? v.style.setProperty("object-fit", g) : v.style.removeProperty("object-fit")), u;
|
|
3178
2492
|
})()];
|
|
3179
2493
|
}
|
|
3180
2494
|
});
|
|
3181
|
-
}
|
|
3182
|
-
const CaptureScreenPortalled = () => {
|
|
2495
|
+
}, qr = () => {
|
|
3183
2496
|
const {
|
|
3184
2497
|
t
|
|
3185
|
-
} =
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
});
|
|
3193
|
-
return createComponent(Portal, {
|
|
3194
|
-
useShadow: true,
|
|
2498
|
+
} = Z(), [e, r] = z(!0), {
|
|
2499
|
+
addOnDismountCallback: a
|
|
2500
|
+
} = j();
|
|
2501
|
+
return a(() => {
|
|
2502
|
+
r(!1);
|
|
2503
|
+
}), s(ve, {
|
|
2504
|
+
useShadow: !0,
|
|
3195
2505
|
get mount() {
|
|
3196
|
-
return document.getElementById(
|
|
3197
|
-
},
|
|
3198
|
-
ref: (ref) => {
|
|
3199
|
-
ref.id = CAPTURE_SCREEN_SHADOW_ROOT_HOST_ID;
|
|
3200
|
-
ref.style.zIndex = "1000";
|
|
3201
|
-
ref.style.position = "fixed";
|
|
3202
|
-
ref.id = "mb-camera-host";
|
|
3203
|
-
return ref;
|
|
2506
|
+
return document.getElementById(Pe);
|
|
3204
2507
|
},
|
|
2508
|
+
ref: (n) => (n.id = Be, n.style.zIndex = "1000", n.style.position = "fixed", n.id = "mb-camera-host", n),
|
|
3205
2509
|
get children() {
|
|
3206
|
-
return
|
|
3207
|
-
children: (
|
|
2510
|
+
return s(ee, {
|
|
2511
|
+
children: (n) => s($.Root, {
|
|
3208
2512
|
get open() {
|
|
3209
|
-
return
|
|
2513
|
+
return e();
|
|
3210
2514
|
},
|
|
3211
|
-
lazyMount:
|
|
3212
|
-
unmountOnExit:
|
|
2515
|
+
lazyMount: !0,
|
|
2516
|
+
unmountOnExit: !0,
|
|
3213
2517
|
initialFocusEl: () => {
|
|
3214
|
-
const
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
dummyNode.remove();
|
|
3219
|
-
}, 0);
|
|
3220
|
-
return dummyNode;
|
|
2518
|
+
const o = document.createElement("div");
|
|
2519
|
+
return o.tabIndex = -1, n.appendChild(o), setTimeout(() => {
|
|
2520
|
+
o.remove();
|
|
2521
|
+
}, 0), o;
|
|
3221
2522
|
},
|
|
3222
2523
|
get children() {
|
|
3223
|
-
return
|
|
2524
|
+
return s($.Positioner, {
|
|
3224
2525
|
get children() {
|
|
3225
|
-
return
|
|
2526
|
+
return s($.Content, {
|
|
3226
2527
|
"aria-labelledby": "dialog-title",
|
|
3227
|
-
|
|
2528
|
+
class: "h-vh supports-[(height:100dvh)]:h-dvh top-0 left-0 w-full fixed",
|
|
3228
2529
|
get children() {
|
|
3229
|
-
return [
|
|
3230
|
-
|
|
2530
|
+
return [s($.Title, {
|
|
2531
|
+
class: "sr-only",
|
|
3231
2532
|
id: "dialog-title",
|
|
3232
2533
|
get children() {
|
|
3233
2534
|
return t.scan_document;
|
|
3234
2535
|
}
|
|
3235
|
-
}),
|
|
2536
|
+
}), s(Oe, {})];
|
|
3236
2537
|
}
|
|
3237
2538
|
});
|
|
3238
2539
|
}
|
|
@@ -3242,89 +2543,71 @@ const CaptureScreenPortalled = () => {
|
|
|
3242
2543
|
});
|
|
3243
2544
|
}
|
|
3244
2545
|
});
|
|
3245
|
-
}
|
|
3246
|
-
const RootComponent = () => {
|
|
2546
|
+
}, jr = () => {
|
|
3247
2547
|
const {
|
|
3248
|
-
mountTarget
|
|
3249
|
-
} =
|
|
3250
|
-
return
|
|
2548
|
+
mountTarget: t
|
|
2549
|
+
} = j();
|
|
2550
|
+
return s(je, {
|
|
3251
2551
|
get component() {
|
|
3252
|
-
return
|
|
2552
|
+
return t.parentNode === document.body ? qr : Oe;
|
|
3253
2553
|
}
|
|
3254
2554
|
});
|
|
3255
|
-
};
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
2555
|
+
}, Pe = "camera-manager-mount-point";
|
|
2556
|
+
function ra(t, e, {
|
|
2557
|
+
localizationStrings: r,
|
|
2558
|
+
showMirrorCameraButton: a = !1,
|
|
2559
|
+
showTorchButton: n = !0,
|
|
2560
|
+
showCloseButton: o = !0,
|
|
2561
|
+
showCameraErrorModal: i = !0
|
|
3262
2562
|
} = {}) {
|
|
3263
|
-
let
|
|
3264
|
-
const
|
|
3265
|
-
let
|
|
3266
|
-
const
|
|
3267
|
-
|
|
2563
|
+
let l;
|
|
2564
|
+
const c = /* @__PURE__ */ new Set();
|
|
2565
|
+
let d;
|
|
2566
|
+
const h = (g) => {
|
|
2567
|
+
d = g;
|
|
2568
|
+
}, C = () => {
|
|
2569
|
+
t.reset();
|
|
3268
2570
|
};
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
};
|
|
3272
|
-
let dismountRef;
|
|
3273
|
-
const dismountCameraManagerUi = () => {
|
|
2571
|
+
let w;
|
|
2572
|
+
const u = () => {
|
|
3274
2573
|
try {
|
|
3275
2574
|
console.debug("🧱 Dismounting camera manager UI");
|
|
3276
|
-
for (const
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
dismountCallbacks.clear();
|
|
3280
|
-
cleanupCameraManager();
|
|
3281
|
-
requestAnimationFrame(() => {
|
|
2575
|
+
for (const g of c)
|
|
2576
|
+
g();
|
|
2577
|
+
c.clear(), C(), requestAnimationFrame(() => {
|
|
3282
2578
|
requestAnimationFrame(() => {
|
|
3283
|
-
|
|
3284
|
-
dismountRef();
|
|
3285
|
-
}
|
|
3286
|
-
mountTarget.remove();
|
|
3287
|
-
cleanupCameraManager();
|
|
2579
|
+
w && w(), l.remove(), C();
|
|
3288
2580
|
});
|
|
3289
2581
|
});
|
|
3290
|
-
} catch (
|
|
3291
|
-
console.warn("Error while dismounting camera manager UI",
|
|
2582
|
+
} catch (g) {
|
|
2583
|
+
console.warn("Error while dismounting camera manager UI", g);
|
|
3292
2584
|
}
|
|
3293
|
-
};
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
}
|
|
3302
|
-
const addOnDismountCallback = (fn) => {
|
|
3303
|
-
dismountCallbacks.add(fn);
|
|
3304
|
-
return () => {
|
|
3305
|
-
dismountCallbacks.delete(fn);
|
|
3306
|
-
};
|
|
3307
|
-
};
|
|
3308
|
-
dismountRef = render(() => createComponent(LocalizationProvider, {
|
|
3309
|
-
userStrings: localizationStrings,
|
|
3310
|
-
setLocalizationRef,
|
|
2585
|
+
}, v = document.createElement("div");
|
|
2586
|
+
v.id = Pe, l = v, e ? e.appendChild(v) : document.body.appendChild(v);
|
|
2587
|
+
const b = (g) => (c.add(g), () => {
|
|
2588
|
+
c.delete(g);
|
|
2589
|
+
});
|
|
2590
|
+
w = He(() => s(Ot, {
|
|
2591
|
+
userStrings: r,
|
|
2592
|
+
setLocalizationRef: h,
|
|
3311
2593
|
get children() {
|
|
3312
|
-
return
|
|
3313
|
-
addOnDismountCallback,
|
|
3314
|
-
dismountCameraUi:
|
|
3315
|
-
cameraManager,
|
|
3316
|
-
showMirrorCameraButton,
|
|
3317
|
-
showTorchButton,
|
|
3318
|
-
showCloseButton,
|
|
3319
|
-
|
|
2594
|
+
return s(Nt, {
|
|
2595
|
+
addOnDismountCallback: b,
|
|
2596
|
+
dismountCameraUi: u,
|
|
2597
|
+
cameraManager: t,
|
|
2598
|
+
showMirrorCameraButton: a,
|
|
2599
|
+
showTorchButton: n,
|
|
2600
|
+
showCloseButton: o,
|
|
2601
|
+
showCameraErrorModal: i,
|
|
2602
|
+
mountTarget: l,
|
|
3320
2603
|
get children() {
|
|
3321
|
-
return
|
|
2604
|
+
return s(jr, {});
|
|
3322
2605
|
}
|
|
3323
2606
|
});
|
|
3324
2607
|
}
|
|
3325
|
-
}),
|
|
3326
|
-
const
|
|
3327
|
-
updateLocalization:
|
|
2608
|
+
}), l);
|
|
2609
|
+
const f = {
|
|
2610
|
+
updateLocalization: d,
|
|
3328
2611
|
/**
|
|
3329
2612
|
* Adds a callback to be called when the component is unmounted.
|
|
3330
2613
|
* Returns a cleanup function that removes the callback when called.
|
|
@@ -3332,88 +2615,65 @@ function createCameraManagerUi(cameraManager, target, {
|
|
|
3332
2615
|
* @param fn - The callback function to be called when the component is unmounted
|
|
3333
2616
|
* @returns A cleanup function that removes the callback when called
|
|
3334
2617
|
*/
|
|
3335
|
-
addOnDismountCallback,
|
|
3336
|
-
cameraManager,
|
|
2618
|
+
addOnDismountCallback: b,
|
|
2619
|
+
cameraManager: t,
|
|
3337
2620
|
// we know these are defined because `createCameraManagerUi` resolves when they are defined
|
|
3338
2621
|
// TODO: maybe don't use getters but make sure they are defined
|
|
3339
2622
|
get feedbackLayerNode() {
|
|
3340
|
-
return
|
|
2623
|
+
return U.getState().feedbackLayer;
|
|
3341
2624
|
},
|
|
3342
2625
|
get overlayLayerNode() {
|
|
3343
|
-
return
|
|
2626
|
+
return U.getState().overlayLayer;
|
|
3344
2627
|
},
|
|
3345
2628
|
get owner() {
|
|
3346
|
-
return
|
|
2629
|
+
return U.getState().owner;
|
|
3347
2630
|
},
|
|
3348
|
-
dismount:
|
|
2631
|
+
dismount: u
|
|
3349
2632
|
};
|
|
3350
|
-
return new Promise((
|
|
3351
|
-
let
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
let unsubscribeFeedbackLayer = () => {
|
|
3355
|
-
};
|
|
3356
|
-
let unsubscribeOverlayLayer = () => {
|
|
3357
|
-
};
|
|
3358
|
-
let unsubscribeVideo = () => {
|
|
2633
|
+
return new Promise((g) => {
|
|
2634
|
+
let p = !1, k = !1, x = !1, I = () => {
|
|
2635
|
+
}, G = () => {
|
|
2636
|
+
}, X = () => {
|
|
3359
2637
|
};
|
|
3360
|
-
const
|
|
3361
|
-
|
|
3362
|
-
unsubscribeFeedbackLayer();
|
|
3363
|
-
unsubscribeOverlayLayer();
|
|
3364
|
-
unsubscribeVideo();
|
|
3365
|
-
resolve(exposedComponentApi);
|
|
3366
|
-
}
|
|
2638
|
+
const te = () => {
|
|
2639
|
+
p && k && x && (I(), G(), X(), g(f));
|
|
3367
2640
|
};
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
feedbackExists = true;
|
|
3371
|
-
}
|
|
3372
|
-
checkReady();
|
|
2641
|
+
I = U.subscribe((R) => R.feedbackLayer, (R) => {
|
|
2642
|
+
R && (k = !0), te();
|
|
3373
2643
|
}, {
|
|
3374
|
-
fireImmediately:
|
|
3375
|
-
})
|
|
3376
|
-
|
|
3377
|
-
if (overlayLayer) {
|
|
3378
|
-
overlayExists = true;
|
|
3379
|
-
}
|
|
3380
|
-
checkReady();
|
|
2644
|
+
fireImmediately: !0
|
|
2645
|
+
}), G = U.subscribe((R) => R.overlayLayer, (R) => {
|
|
2646
|
+
R && (x = !0), te();
|
|
3381
2647
|
}, {
|
|
3382
|
-
fireImmediately:
|
|
3383
|
-
})
|
|
3384
|
-
|
|
3385
|
-
if (videoElement) {
|
|
3386
|
-
videoExists = true;
|
|
3387
|
-
checkReady();
|
|
3388
|
-
}
|
|
2648
|
+
fireImmediately: !0
|
|
2649
|
+
}), X = t.subscribe((R) => R.videoElement, (R) => {
|
|
2650
|
+
R && (p = !0, te());
|
|
3389
2651
|
}, {
|
|
3390
|
-
fireImmediately:
|
|
2652
|
+
fireImmediately: !0
|
|
3391
2653
|
});
|
|
3392
2654
|
});
|
|
3393
2655
|
}
|
|
3394
|
-
const
|
|
3395
|
-
globalThis.__CAMERA_MANAGER__ ||=
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
);
|
|
3400
|
-
}
|
|
2656
|
+
const Ve = Symbol();
|
|
2657
|
+
globalThis.__CAMERA_MANAGER__ ||= Ve;
|
|
2658
|
+
globalThis.__CAMERA_MANAGER__ !== Ve && console.warn(
|
|
2659
|
+
"Detected multiple instances of @microblink/camera-manager. This can lead to unexpected behavior."
|
|
2660
|
+
);
|
|
3401
2661
|
export {
|
|
3402
|
-
Camera,
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
|
|
2662
|
+
Ae as Camera,
|
|
2663
|
+
xe as CameraError,
|
|
2664
|
+
ta as CameraManager,
|
|
2665
|
+
Pe as MOUNT_POINT_ID,
|
|
2666
|
+
It as VideoFrameProcessor,
|
|
2667
|
+
m as cameraManagerStore,
|
|
2668
|
+
U as cameraUiRefStore,
|
|
2669
|
+
ra as createCameraManagerUi,
|
|
2670
|
+
zt as defaultCameraManagerOptions,
|
|
2671
|
+
wt as findResolutionKey,
|
|
2672
|
+
Ie as getBuffer,
|
|
2673
|
+
pt as getNormalizedResolution,
|
|
2674
|
+
se as isBufferDetached,
|
|
2675
|
+
vt as matchClosestResolution,
|
|
2676
|
+
yt as resetCameraManagerStore,
|
|
2677
|
+
bt as returnLongerSide,
|
|
2678
|
+
O as videoResolutions
|
|
3418
2679
|
};
|
|
3419
|
-
//# sourceMappingURL=camera-manager.js.map
|