scanbot-web-sdk 6.0.0-dev.2 → 6.0.0-dev.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.
Files changed (152) hide show
  1. package/@types/consume-type.d.ts +2 -1
  2. package/@types/core/bridge/common.d.ts +1 -1
  3. package/@types/core/bridge/compiled/BarcodeConfigs.d.ts +231 -231
  4. package/@types/core/bridge/compiled/BarcodeScannerTypes.d.ts +13 -11
  5. package/@types/core/bridge/compiled/CreditCardTypes.d.ts +82 -0
  6. package/@types/core/bridge/compiled/DocumentDetectorTypes.d.ts +52 -44
  7. package/@types/core/bridge/compiled/DocumentQualityAnalyzerTypes.d.ts +17 -17
  8. package/@types/core/bridge/compiled/FrameAccumulationTypes.d.ts +41 -0
  9. package/@types/core/bridge/compiled/GDRTypes.d.ts +38 -0
  10. package/@types/core/bridge/compiled/GenericDocument.d.ts +40 -12
  11. package/@types/core/bridge/compiled/GenericDocumentRecognizerConfigs.d.ts +182 -0
  12. package/@types/core/bridge/compiled/GenericDocumentRecognizerTypes.d.ts +7 -28
  13. package/@types/core/bridge/compiled/GenericDocumentTypes.d.ts +38 -0
  14. package/@types/core/bridge/compiled/ImageProcessorTypes.d.ts +5 -5
  15. package/@types/core/bridge/compiled/MedicalCertificateTypes.d.ts +2 -2
  16. package/@types/core/bridge/compiled/ParametricFilters.d.ts +9 -5
  17. package/@types/core/bridge/compiled/TiffTypes.d.ts +6 -5
  18. package/@types/core/bridge/worker-bridge.d.ts +604 -40
  19. package/@types/core/worker/ScanbotSDK.Core.d.ts +29 -18
  20. package/@types/core-types.d.ts +4 -1
  21. package/@types/cropping-view.d.ts +1 -1
  22. package/@types/document-scanner-view.d.ts +4 -2
  23. package/@types/index.d.ts +40 -4
  24. package/@types/model/barcode/barcode-result.d.ts +12 -2
  25. package/@types/model/barcode/barcode.d.ts +2 -1
  26. package/@types/model/camera-info.d.ts +3 -2
  27. package/@types/model/configuration/barcode-scanner-configuration.d.ts +7 -4
  28. package/@types/model/configuration/cropping-view-configuration.d.ts +5 -0
  29. package/@types/model/configuration/document-scanner-configuration.d.ts +4 -10
  30. package/@types/model/configuration/generic-document-recognizer-configuration.d.ts +1 -1
  31. package/@types/model/configuration/initialization-options.d.ts +8 -0
  32. package/@types/model/configuration/mrz-scanner-configuration.d.ts +1 -1
  33. package/@types/model/configuration/scanner-configuration.d.ts +7 -0
  34. package/@types/model/configuration/selection-overlay-configuration.d.ts +2 -2
  35. package/@types/model/configuration/view-finder-scanner-configuration.d.ts +1 -1
  36. package/@types/model/error/media-error.d.ts +1 -0
  37. package/@types/scanbot-sdk.d.ts +360 -54
  38. package/@types/service/document-quality-analyzer.d.ts +1 -1
  39. package/@types/service/generic-document-recognizer.d.ts +3 -1
  40. package/@types/service/simple-mrz-recognizer.d.ts +3 -1
  41. package/@types/service/text-data-recognizer.d.ts +3 -1
  42. package/@types/service/tiff-generator.d.ts +1 -1
  43. package/@types/ui2/common.d.ts +8 -0
  44. package/@types/ui2/configuration/ActionBarConfiguration.d.ts +30 -30
  45. package/@types/ui2/configuration/ArTrackingOverlayConfiguration.d.ts +220 -220
  46. package/@types/ui2/configuration/BarcodeInfoMapping.d.ts +51 -51
  47. package/@types/ui2/configuration/BarcodeItemMapper.d.ts +2 -2
  48. package/@types/ui2/configuration/BarcodeRecognizerConfiguration.d.ts +34 -34
  49. package/@types/ui2/configuration/BarcodeScannerConfiguration.d.ts +168 -168
  50. package/@types/ui2/configuration/BarcodeScannerTypes.d.ts +1 -6
  51. package/@types/ui2/configuration/BarcodeScannerUIResult.d.ts +29 -0
  52. package/@types/ui2/configuration/BarcodeTextLocalization.d.ts +124 -69
  53. package/@types/ui2/configuration/BarcodeTypes.d.ts +1 -1
  54. package/@types/ui2/configuration/BarcodeUseCase.d.ts +4 -3
  55. package/@types/ui2/configuration/CameraConfiguration.d.ts +32 -32
  56. package/@types/ui2/configuration/CameraPermission.d.ts +33 -33
  57. package/@types/ui2/configuration/Common.d.ts +190 -190
  58. package/@types/ui2/configuration/CommonFieldType.d.ts +1 -0
  59. package/@types/ui2/configuration/FindAndPickScanningModeUseCase.d.ts +364 -12
  60. package/@types/ui2/configuration/GenericDocument.d.ts +1 -0
  61. package/@types/ui2/configuration/MultipleScanningModeUseCase.d.ts +488 -488
  62. package/@types/ui2/configuration/ScanbotAlertDialog.d.ts +27 -27
  63. package/@types/ui2/configuration/SingleScanningModeUseCase.d.ts +169 -169
  64. package/@types/ui2/configuration/TopBarConfiguration.d.ts +36 -36
  65. package/@types/ui2/configuration/UserGuidanceConfiguration.d.ts +16 -16
  66. package/@types/ui2/configuration/ViewFinderConfiguration.d.ts +45 -45
  67. package/@types/ui2/configuration.d.ts +2 -1
  68. package/@types/ui2/controllers/barcode-scanner-controller.d.ts +2 -2
  69. package/@types/ui2/controllers/multiple-scanning-mode-controller.d.ts +4 -2
  70. package/@types/ui2/controllers/single-scanning-mode-controller.d.ts +4 -2
  71. package/@types/ui2/model/counted-barcodes.d.ts +17 -20
  72. package/@types/ui2/scanbot-sdk-ui.d.ts +2 -2
  73. package/@types/ui2/scanbot-ui-library.d.ts +3 -2
  74. package/@types/ui2/utils/barcode-mapper/expected-barcode-mapper.d.ts +13 -0
  75. package/@types/ui2/utils/barcode-mapper/i-barcode-mapper.d.ts +17 -0
  76. package/@types/ui2/utils/{barcode-mapper.d.ts → barcode-mapper/user-barcode-mapper.d.ts} +4 -16
  77. package/@types/ui2/utils/find-and-pick.ts/expected-barcode-counter.d.ts +7 -0
  78. package/@types/ui2/utils/styled-badge.d.ts +1 -1
  79. package/@types/ui2/views/ar/ar-badge.d.ts +18 -0
  80. package/@types/ui2/views/ar/ar-overlay-barcode-info.d.ts +5 -1
  81. package/@types/ui2/views/ar/vertical-positions.d.ts +12 -0
  82. package/@types/ui2/views/barcode-info/barcode-info.d.ts +3 -1
  83. package/@types/ui2/views/barcode-scanner.d.ts +5 -5
  84. package/@types/ui2/views/dialog/base/confirmation-dialog.d.ts +20 -0
  85. package/@types/ui2/views/dialog/count-edit-dialog.d.ts +3 -3
  86. package/@types/ui2/views/dialog/find-and-pick-submit-dialog.d.ts +10 -0
  87. package/@types/ui2/views/drawer/barcode-result-drawer.d.ts +1 -1
  88. package/@types/ui2/views/drawer/barcode-result-sidebar.d.ts +10 -0
  89. package/@types/ui2/views/drawer/counting-button.d.ts +1 -1
  90. package/@types/ui2/views/drawer/subviews/barcode-drawer-empty-state.d.ts +1 -1
  91. package/@types/ui2/views/drawer/subviews/barcode-list-item.d.ts +4 -4
  92. package/@types/ui2/views/drawer/subviews/barcode-list.d.ts +8 -1
  93. package/@types/ui2/views/drawer/subviews/drawer-header-content.d.ts +1 -1
  94. package/@types/utils/barcode-utils.d.ts +10 -0
  95. package/@types/utils/browser-cameras.d.ts +92 -0
  96. package/@types/utils/dto/Polygon.d.ts +2 -1
  97. package/@types/utils/stats.d.ts +4 -0
  98. package/@types/utils/video-stream.d.ts +3 -3
  99. package/@types/utils/video-to-image-data/two-d-video-to-image-data.d.ts +8 -0
  100. package/@types/utils/video-to-image-data/video-to-image-data.d.ts +5 -0
  101. package/@types/utils/video-to-image-data/webgl-video-to-image-data.d.ts +21 -0
  102. package/@types/view/barcode-polygon/animated-barcode-selection-overlay.d.ts +1 -0
  103. package/@types/view/scanbot-camera-view.d.ts +9 -3
  104. package/@types/worker/worker-bridge.d.ts +607 -44
  105. package/bundle/ScanbotSDK.min.js +5 -5
  106. package/bundle/ScanbotSDK.ui2.min.js +16 -16
  107. package/bundle/bin/barcode-scanner/ScanbotSDK.Asm-simd-threads.js +1 -1
  108. package/bundle/bin/barcode-scanner/ScanbotSDK.Asm-simd-threads.wasm +0 -0
  109. package/bundle/bin/barcode-scanner/ScanbotSDK.Asm-simd.wasm +0 -0
  110. package/bundle/bin/barcode-scanner/ScanbotSDK.Asm.wasm +0 -0
  111. package/bundle/bin/barcode-scanner/ScanbotSDK.Core-simd-threads.js +1 -1
  112. package/bundle/bin/barcode-scanner/ScanbotSDK.Core-simd.js +1 -1
  113. package/bundle/bin/barcode-scanner/ScanbotSDK.Core.js +1 -1
  114. package/bundle/bin/complete/ScanbotSDK.Asm-simd-threads.js +1 -1
  115. package/bundle/bin/complete/ScanbotSDK.Asm-simd-threads.wasm +0 -0
  116. package/bundle/bin/complete/ScanbotSDK.Asm-simd.wasm +0 -0
  117. package/bundle/bin/complete/ScanbotSDK.Asm.wasm +0 -0
  118. package/bundle/bin/complete/ScanbotSDK.Core-simd-threads.js +1 -1
  119. package/bundle/bin/complete/ScanbotSDK.Core-simd.js +1 -1
  120. package/bundle/bin/complete/ScanbotSDK.Core.js +1 -1
  121. package/bundle/bin/document-scanner/ScanbotSDK.Asm-simd-threads.js +1 -1
  122. package/bundle/bin/document-scanner/ScanbotSDK.Asm-simd-threads.wasm +0 -0
  123. package/bundle/bin/document-scanner/ScanbotSDK.Asm-simd.wasm +0 -0
  124. package/bundle/bin/document-scanner/ScanbotSDK.Asm.wasm +0 -0
  125. package/bundle/bin/document-scanner/ScanbotSDK.Core-simd-threads.js +1 -1
  126. package/bundle/bin/document-scanner/ScanbotSDK.Core-simd.js +1 -1
  127. package/bundle/bin/document-scanner/ScanbotSDK.Core.js +1 -1
  128. package/package.json +2 -2
  129. package/@types/core/bridge/compiled_schemas_v3/BarcodeConfigs.d.ts +0 -973
  130. package/@types/core/bridge/compiled_schemas_v3/BarcodeScannerTypes.d.ts +0 -183
  131. package/@types/core/bridge/compiled_schemas_v3/BarcodeTypes.d.ts +0 -183
  132. package/@types/core/bridge/compiled_schemas_v3/CheckRecognizerTypes.d.ts +0 -29
  133. package/@types/core/bridge/compiled_schemas_v3/CommonFieldType.d.ts +0 -59
  134. package/@types/core/bridge/compiled_schemas_v3/DocumentDetectorTypes.d.ts +0 -196
  135. package/@types/core/bridge/compiled_schemas_v3/DocumentQualityAnalyzerTypes.d.ts +0 -105
  136. package/@types/core/bridge/compiled_schemas_v3/EhicTypes.d.ts +0 -218
  137. package/@types/core/bridge/compiled_schemas_v3/FrameUtilities.d.ts +0 -18
  138. package/@types/core/bridge/compiled_schemas_v3/GenericDocument.d.ts +0 -198
  139. package/@types/core/bridge/compiled_schemas_v3/GenericDocumentRecognizerTypes.d.ts +0 -104
  140. package/@types/core/bridge/compiled_schemas_v3/GenericTextLineScannerTypes.d.ts +0 -165
  141. package/@types/core/bridge/compiled_schemas_v3/Geometry.d.ts +0 -49
  142. package/@types/core/bridge/compiled_schemas_v3/ImageProcessorTypes.d.ts +0 -13
  143. package/@types/core/bridge/compiled_schemas_v3/LicensePlateScannerTypes.d.ts +0 -67
  144. package/@types/core/bridge/compiled_schemas_v3/MRZTypes.d.ts +0 -52
  145. package/@types/core/bridge/compiled_schemas_v3/MedicalCertificateTypes.d.ts +0 -306
  146. package/@types/core/bridge/compiled_schemas_v3/OcrElements.d.ts +0 -129
  147. package/@types/core/bridge/compiled_schemas_v3/ParametricFilters.d.ts +0 -186
  148. package/@types/core/bridge/compiled_schemas_v3/PdfConfig.d.ts +0 -197
  149. package/@types/core/bridge/compiled_schemas_v3/TiffTypes.d.ts +0 -183
  150. package/@types/ui2/configuration/BarcodeItem.d.ts +0 -6
  151. package/@types/ui2/configuration/utils.d.ts +0 -6
  152. /package/@types/ui2/views/dialog/{styled-dialog.d.ts → base/styled-dialog.d.ts} +0 -0
@@ -1,5 +1,5 @@
1
1
  /*! For license information please see ScanbotSDK.min.js.LICENSE.txt */
2
- !function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var i in n)("object"==typeof exports?exports:t)[i]=n[i]}}(window,(function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(i,o,function(e){return t[e]}.bind(null,o));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=41)}([function(t,e,n){"use strict";n.r(e),n.d(e,"Component",(function(){return C})),n.d(e,"Fragment",(function(){return y})),n.d(e,"createContext",(function(){return G})),n.d(e,"createElement",(function(){return v})),n.d(e,"createRef",(function(){return b})),n.d(e,"useCallback",(function(){return ft})),n.d(e,"useContext",(function(){return mt})),n.d(e,"useDebugValue",(function(){return gt})),n.d(e,"useEffect",(function(){return ct})),n.d(e,"useErrorBoundary",(function(){return vt})),n.d(e,"useId",(function(){return At})),n.d(e,"useImperativeHandle",(function(){return ht})),n.d(e,"useLayoutEffect",(function(){return ut})),n.d(e,"useMemo",(function(){return pt})),n.d(e,"useReducer",(function(){return lt})),n.d(e,"useRef",(function(){return dt})),n.d(e,"useState",(function(){return st})),n.d(e,"Children",(function(){return It})),n.d(e,"PureComponent",(function(){return Ot})),n.d(e,"StrictMode",(function(){return ye})),n.d(e,"Suspense",(function(){return jt})),n.d(e,"SuspenseList",(function(){return Vt})),n.d(e,"__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED",(function(){return ue})),n.d(e,"cloneElement",(function(){return me})),n.d(e,"createFactory",(function(){return he})),n.d(e,"createPortal",(function(){return Qt})),n.d(e,"default",(function(){return Oe})),n.d(e,"findDOMNode",(function(){return ve})),n.d(e,"flushSync",(function(){return be})),n.d(e,"forwardRef",(function(){return Pt})),n.d(e,"hydrate",(function(){return te})),n.d(e,"isElement",(function(){return Ee})),n.d(e,"isFragment",(function(){return fe})),n.d(e,"isValidElement",(function(){return pe})),n.d(e,"lazy",(function(){return Nt})),n.d(e,"memo",(function(){return Tt})),n.d(e,"render",(function(){return Jt})),n.d(e,"startTransition",(function(){return Ce})),n.d(e,"unmountComponentAtNode",(function(){return ge})),n.d(e,"unstable_batchedUpdates",(function(){return Ae})),n.d(e,"useDeferredValue",(function(){return Se})),n.d(e,"useInsertionEffect",(function(){return xe})),n.d(e,"useSyncExternalStore",(function(){return Le})),n.d(e,"useTransition",(function(){return we})),n.d(e,"version",(function(){return de}));var i,o,r,a,s,l,c,u,d={},h=[],p=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,f=Array.isArray;function m(t,e){for(var n in e)t[n]=e[n];return t}function g(t){var e=t.parentNode;e&&e.removeChild(t)}function v(t,e,n){var o,r,a,s={};for(a in e)"key"==a?o=e[a]:"ref"==a?r=e[a]:s[a]=e[a];if(arguments.length>2&&(s.children=arguments.length>3?i.call(arguments,2):n),"function"==typeof t&&null!=t.defaultProps)for(a in t.defaultProps)void 0===s[a]&&(s[a]=t.defaultProps[a]);return A(t,s,o,r,null)}function A(t,e,n,i,a){var s={type:t,props:e,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==a?++r:a,__i:-1,__u:0};return null==a&&null!=o.vnode&&o.vnode(s),s}function b(){return{current:null}}function y(t){return t.children}function C(t,e){this.props=t,this.context=e}function S(t,e){if(null==e)return t.__?S(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e)return n.__e;return"function"==typeof t.type?S(t):null}function w(t,e,n){var i,r=t.__v,a=r.__e,s=t.__P;if(s)return(i=m({},r)).__v=r.__v+1,o.vnode&&o.vnode(i),B(s,i,r,t.__n,void 0!==s.ownerSVGElement,32&r.__u?[a]:null,e,null==a?S(r):a,!!(32&r.__u),n),i.__v=r.__v,i.__.__k[i.__i]=i,i.__d=void 0,i.__e!=a&&x(i),i}function x(t){var e,n;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e){t.__e=t.__c.base=n.__e;break}return x(t)}}function E(t){(!t.__d&&(t.__d=!0)&&a.push(t)&&!L.__r++||s!==o.debounceRendering)&&((s=o.debounceRendering)||l)(L)}function L(){var t,e,n,i=[],r=[];for(a.sort(c);t=a.shift();)t.__d&&(n=a.length,e=w(t,i,r)||e,0===n||a.length>n?(W(i,e,r),r.length=i.length=0,e=void 0,a.sort(c)):e&&o.__c&&o.__c(e,h));e&&W(i,e,r),L.__r=0}function _(t,e,n,i,o,r,a,s,l,c,u){var p,f,m,g,v,A=i&&i.__k||h,b=e.length;for(n.__d=l,O(n,e,A),l=n.__d,p=0;p<b;p++)null!=(m=n.__k[p])&&"boolean"!=typeof m&&"function"!=typeof m&&(f=-1===m.__i?d:A[m.__i]||d,m.__i=p,B(t,m,f,o,r,a,s,l,c,u),g=m.__e,m.ref&&f.ref!=m.ref&&(f.ref&&j(f.ref,null,m),u.push(m.ref,m.__c||g,m)),null==v&&null!=g&&(v=g),65536&m.__u||f.__k===m.__k?l=T(m,l,t):"function"==typeof m.type&&void 0!==m.__d?l=m.__d:g&&(l=g.nextSibling),m.__d=void 0,m.__u&=-196609);n.__d=l,n.__e=v}function O(t,e,n){var i,o,r,a,s,l=e.length,c=n.length,u=c,d=0;for(t.__k=[],i=0;i<l;i++)null!=(o=t.__k[i]=null==(o=e[i])||"boolean"==typeof o||"function"==typeof o?null:"string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?A(null,o,null,null,o):f(o)?A(y,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?A(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o)?(o.__=t,o.__b=t.__b+1,s=D(o,n,a=i+d,u),o.__i=s,r=null,-1!==s&&(u--,(r=n[s])&&(r.__u|=131072)),null==r||null===r.__v?(-1==s&&d--,"function"!=typeof o.type&&(o.__u|=65536)):s!==a&&(s===a+1?d++:s>a?u>l-a?d+=s-a:d--:d=s<a&&s==a-1?s-a:0,s!==i+d&&(o.__u|=65536))):(r=n[i])&&null==r.key&&r.__e&&0==(131072&r.__u)&&(r.__e==t.__d&&(t.__d=S(r)),z(r,r,!1),n[i]=null,u--);if(u)for(i=0;i<c;i++)null!=(r=n[i])&&0==(131072&r.__u)&&(r.__e==t.__d&&(t.__d=S(r)),z(r,r))}function T(t,e,n){var i,o;if("function"==typeof t.type){for(i=t.__k,o=0;i&&o<i.length;o++)i[o]&&(i[o].__=t,e=T(i[o],e,n));return e}t.__e!=e&&(n.insertBefore(t.__e,e||null),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8===e.nodeType);return e}function k(t,e){return e=e||[],null==t||"boolean"==typeof t||(f(t)?t.some((function(t){k(t,e)})):e.push(t)),e}function D(t,e,n,i){var o=t.key,r=t.type,a=n-1,s=n+1,l=e[n];if(null===l||l&&o==l.key&&r===l.type)return n;if(i>(null!=l&&0==(131072&l.__u)?1:0))for(;a>=0||s<e.length;){if(a>=0){if((l=e[a])&&0==(131072&l.__u)&&o==l.key&&r===l.type)return a;a--}if(s<e.length){if((l=e[s])&&0==(131072&l.__u)&&o==l.key&&r===l.type)return s;s++}}return-1}function P(t,e,n){"-"===e[0]?t.setProperty(e,null==n?"":n):t[e]=null==n?"":"number"!=typeof n||p.test(e)?n:n+"px"}function R(t,e,n,i,o){var r;t:if("style"===e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof i&&(t.style.cssText=i=""),i)for(e in i)n&&e in n||P(t.style,e,"");if(n)for(e in n)i&&n[e]===i[e]||P(t.style,e,n[e])}else if("o"===e[0]&&"n"===e[1])r=e!==(e=e.replace(/(PointerCapture)$|Capture$/i,"$1")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+r]=n,n?i?n.u=i.u:(n.u=Date.now(),t.addEventListener(e,r?F:I,r)):t.removeEventListener(e,r?F:I,r);else{if(o)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==e&&"height"!==e&&"href"!==e&&"list"!==e&&"form"!==e&&"tabIndex"!==e&&"download"!==e&&"rowSpan"!==e&&"colSpan"!==e&&"role"!==e&&e in t)try{t[e]=null==n?"":n;break t}catch(t){}"function"==typeof n||(null==n||!1===n&&"-"!==e[4]?t.removeAttribute(e):t.setAttribute(e,n))}}function I(t){if(this.l){var e=this.l[t.type+!1];if(t.t){if(t.t<=e.u)return}else t.t=Date.now();return e(o.event?o.event(t):t)}}function F(t){if(this.l)return this.l[t.type+!0](o.event?o.event(t):t)}function B(t,e,n,i,r,a,s,l,c,u){var d,h,p,g,v,A,b,S,w,x,E,L,O,T,k,D=e.type;if(void 0!==e.constructor)return null;128&n.__u&&(c=!!(32&n.__u),a=[l=e.__e=n.__e]),(d=o.__b)&&d(e);t:if("function"==typeof D)try{if(S=e.props,w=(d=D.contextType)&&i[d.__c],x=d?w?w.props.value:d.__:i,n.__c?b=(h=e.__c=n.__c).__=h.__E:("prototype"in D&&D.prototype.render?e.__c=h=new D(S,x):(e.__c=h=new C(S,x),h.constructor=D,h.render=N),w&&w.sub(h),h.props=S,h.state||(h.state={}),h.context=x,h.__n=i,p=h.__d=!0,h.__h=[],h._sb=[]),null==h.__s&&(h.__s=h.state),null!=D.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=m({},h.__s)),m(h.__s,D.getDerivedStateFromProps(S,h.__s))),g=h.props,v=h.state,h.__v=e,p)null==D.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(null==D.getDerivedStateFromProps&&S!==g&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(S,x),!h.__e&&(null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(S,h.__s,x)||e.__v===n.__v)){for(e.__v!==n.__v&&(h.props=S,h.state=h.__s,h.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.forEach((function(t){t&&(t.__=e)})),E=0;E<h._sb.length;E++)h.__h.push(h._sb[E]);h._sb=[],h.__h.length&&s.push(h);break t}null!=h.componentWillUpdate&&h.componentWillUpdate(S,h.__s,x),null!=h.componentDidUpdate&&h.__h.push((function(){h.componentDidUpdate(g,v,A)}))}if(h.context=x,h.props=S,h.__P=t,h.__e=!1,L=o.__r,O=0,"prototype"in D&&D.prototype.render){for(h.state=h.__s,h.__d=!1,L&&L(e),d=h.render(h.props,h.state,h.context),T=0;T<h._sb.length;T++)h.__h.push(h._sb[T]);h._sb=[]}else do{h.__d=!1,L&&L(e),d=h.render(h.props,h.state,h.context),h.state=h.__s}while(h.__d&&++O<25);h.state=h.__s,null!=h.getChildContext&&(i=m(m({},i),h.getChildContext())),p||null==h.getSnapshotBeforeUpdate||(A=h.getSnapshotBeforeUpdate(g,v)),_(t,f(k=null!=d&&d.type===y&&null==d.key?d.props.children:d)?k:[k],e,n,i,r,a,s,l,c,u),h.base=e.__e,e.__u&=-161,h.__h.length&&s.push(h),b&&(h.__E=h.__=null)}catch(t){e.__v=null,c||null!=a?(e.__e=l,e.__u|=c?160:32,a[a.indexOf(l)]=null):(e.__e=n.__e,e.__k=n.__k),o.__e(t,e,n)}else null==a&&e.__v===n.__v?(e.__k=n.__k,e.__e=n.__e):e.__e=M(n.__e,e,n,i,r,a,s,c,u);(d=o.diffed)&&d(e)}function W(t,e,n){for(var i=0;i<n.length;i++)j(n[i],n[++i],n[++i]);o.__c&&o.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){o.__e(t,e.__v)}}))}function M(t,e,n,o,r,a,s,l,c){var u,h,p,m,v,A,b,y=n.props,C=e.props,w=e.type;if("svg"===w&&(r=!0),null!=a)for(u=0;u<a.length;u++)if((v=a[u])&&"setAttribute"in v==!!w&&(w?v.localName===w:3===v.nodeType)){t=v,a[u]=null;break}if(null==t){if(null===w)return document.createTextNode(C);t=r?document.createElementNS("http://www.w3.org/2000/svg",w):document.createElement(w,C.is&&C),a=null,l=!1}if(null===w)y===C||l&&t.data===C||(t.data=C);else{if(a=a&&i.call(t.childNodes),y=n.props||d,!l&&null!=a)for(y={},u=0;u<t.attributes.length;u++)y[(v=t.attributes[u]).name]=v.value;for(u in y)v=y[u],"children"==u||("dangerouslySetInnerHTML"==u?p=v:"key"===u||u in C||R(t,u,null,v,r));for(u in C)v=C[u],"children"==u?m=v:"dangerouslySetInnerHTML"==u?h=v:"value"==u?A=v:"checked"==u?b=v:"key"===u||l&&"function"!=typeof v||y[u]===v||R(t,u,v,y[u],r);if(h)l||p&&(h.__html===p.__html||h.__html===t.innerHTML)||(t.innerHTML=h.__html),e.__k=[];else if(p&&(t.innerHTML=""),_(t,f(m)?m:[m],e,n,o,r&&"foreignObject"!==w,a,s,a?a[0]:n.__k&&S(n,0),l,c),null!=a)for(u=a.length;u--;)null!=a[u]&&g(a[u]);l||(u="value",void 0!==A&&(A!==t[u]||"progress"===w&&!A||"option"===w&&A!==y[u])&&R(t,u,A,y[u],!1),u="checked",void 0!==b&&b!==t[u]&&R(t,u,b,y[u],!1))}return t}function j(t,e,n){try{"function"==typeof t?t(e):t.current=e}catch(t){o.__e(t,n)}}function z(t,e,n){var i,r;if(o.unmount&&o.unmount(t),(i=t.ref)&&(i.current&&i.current!==t.__e||j(i,null,e)),null!=(i=t.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(t){o.__e(t,e)}i.base=i.__P=null,t.__c=void 0}if(i=t.__k)for(r=0;r<i.length;r++)i[r]&&z(i[r],e,n||"function"!=typeof t.type);n||null==t.__e||g(t.__e),t.__=t.__e=t.__d=void 0}function N(t,e,n){return this.constructor(t,n)}function V(t,e,n){var r,a,s,l;o.__&&o.__(t,e),a=(r="function"==typeof n)?null:n&&n.__k||e.__k,s=[],l=[],B(e,t=(!r&&n||e).__k=v(y,null,[t]),a||d,d,void 0!==e.ownerSVGElement,!r&&n?[n]:a?null:e.firstChild?i.call(e.childNodes):null,s,!r&&n?n:a?a.__e:e.firstChild,r,l),t.__d=void 0,W(s,t,l)}function U(t,e){V(t,e,U)}function H(t,e,n){var o,r,a,s,l=m({},t.props);for(a in t.type&&t.type.defaultProps&&(s=t.type.defaultProps),e)"key"==a?o=e[a]:"ref"==a?r=e[a]:l[a]=void 0===e[a]&&void 0!==s?s[a]:e[a];return arguments.length>2&&(l.children=arguments.length>3?i.call(arguments,2):n),A(t.type,l,o||t.key,r||t.ref,null)}function G(t,e){var n={__c:e="__cC"+u++,__:t,Consumer:function(t,e){return t.children(e)},Provider:function(t){var n,i;return this.getChildContext||(n=[],(i={})[e]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(t){this.props.value!==t.value&&n.some((function(t){t.__e=!0,E(t)}))},this.sub=function(t){n.push(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){n.splice(n.indexOf(t),1),e&&e.call(t)}}),t.children}};return n.Provider.__=n.Consumer.contextType=n}i=h.slice,o={__e:function(t,e,n,i){for(var o,r,a;e=e.__;)if((o=e.__c)&&!o.__)try{if((r=o.constructor)&&null!=r.getDerivedStateFromError&&(o.setState(r.getDerivedStateFromError(t)),a=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(t,i||{}),a=o.__d),a)return o.__E=o}catch(e){t=e}throw t}},r=0,C.prototype.setState=function(t,e){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=m({},this.state),"function"==typeof t&&(t=t(m({},n),this.props)),t&&m(n,t),null!=t&&this.__v&&(e&&this._sb.push(e),E(this))},C.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),E(this))},C.prototype.render=y,a=[],l="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,c=function(t,e){return t.__v.__b-e.__v.__b},L.__r=0,u=0;var Q,Z,Y,q,X=0,$=[],K=[],J=o,tt=J.__b,et=J.__r,nt=J.diffed,it=J.__c,ot=J.unmount,rt=J.__;function at(t,e){J.__h&&J.__h(Z,t,X||e),X=0;var n=Z.__H||(Z.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({__V:K}),n.__[t]}function st(t){return X=1,lt(Et,t)}function lt(t,e,n){var i=at(Q++,2);if(i.t=t,!i.__c&&(i.__=[n?n(e):Et(void 0,e),function(t){var e=i.__N?i.__N[0]:i.__[0],n=i.t(e,t);e!==n&&(i.__N=[n,i.__[1]],i.__c.setState({}))}],i.__c=Z,!Z.u)){var o=function(t,e,n){if(!i.__c.__H)return!0;var o=i.__c.__H.__.filter((function(t){return!!t.__c}));if(o.every((function(t){return!t.__N})))return!r||r.call(this,t,e,n);var a=!1;return o.forEach((function(t){if(t.__N){var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(a=!0)}})),!(!a&&i.__c.props===t)&&(!r||r.call(this,t,e,n))};Z.u=!0;var r=Z.shouldComponentUpdate,a=Z.componentWillUpdate;Z.componentWillUpdate=function(t,e,n){if(this.__e){var i=r;r=void 0,o(t,e,n),r=i}a&&a.call(this,t,e,n)},Z.shouldComponentUpdate=o}return i.__N||i.__}function ct(t,e){var n=at(Q++,3);!J.__s&&xt(n.__H,e)&&(n.__=t,n.i=e,Z.__H.__h.push(n))}function ut(t,e){var n=at(Q++,4);!J.__s&&xt(n.__H,e)&&(n.__=t,n.i=e,Z.__h.push(n))}function dt(t){return X=5,pt((function(){return{current:t}}),[])}function ht(t,e,n){X=6,ut((function(){return"function"==typeof t?(t(e()),function(){return t(null)}):t?(t.current=e(),function(){return t.current=null}):void 0}),null==n?n:n.concat(t))}function pt(t,e){var n=at(Q++,7);return xt(n.__H,e)?(n.__V=t(),n.i=e,n.__h=t,n.__V):n.__}function ft(t,e){return X=8,pt((function(){return t}),e)}function mt(t){var e=Z.context[t.__c],n=at(Q++,9);return n.c=t,e?(null==n.__&&(n.__=!0,e.sub(Z)),e.props.value):t.__}function gt(t,e){J.useDebugValue&&J.useDebugValue(e?e(t):t)}function vt(t){var e=at(Q++,10),n=st();return e.__=t,Z.componentDidCatch||(Z.componentDidCatch=function(t,i){e.__&&e.__(t,i),n[1](t)}),[n[0],function(){n[1](void 0)}]}function At(){var t=at(Q++,11);if(!t.__){for(var e=Z.__v;null!==e&&!e.__m&&null!==e.__;)e=e.__;var n=e.__m||(e.__m=[0,0]);t.__="P"+n[0]+"-"+n[1]++}return t.__}function bt(){for(var t;t=$.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(St),t.__H.__h.forEach(wt),t.__H.__h=[]}catch(e){t.__H.__h=[],J.__e(e,t.__v)}}J.__b=function(t){Z=null,tt&&tt(t)},J.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),rt&&rt(t,e)},J.__r=function(t){et&&et(t),Q=0;var e=(Z=t.__c).__H;e&&(Y===Z?(e.__h=[],Z.__h=[],e.__.forEach((function(t){t.__N&&(t.__=t.__N),t.__V=K,t.__N=t.i=void 0}))):(e.__h.forEach(St),e.__h.forEach(wt),e.__h=[],Q=0)),Y=Z},J.diffed=function(t){nt&&nt(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==$.push(e)&&q===J.requestAnimationFrame||((q=J.requestAnimationFrame)||Ct)(bt)),e.__H.__.forEach((function(t){t.i&&(t.__H=t.i),t.__V!==K&&(t.__=t.__V),t.i=void 0,t.__V=K}))),Y=Z=null},J.__c=function(t,e){e.some((function(t){try{t.__h.forEach(St),t.__h=t.__h.filter((function(t){return!t.__||wt(t)}))}catch(n){e.some((function(t){t.__h&&(t.__h=[])})),e=[],J.__e(n,t.__v)}})),it&&it(t,e)},J.unmount=function(t){ot&&ot(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach((function(t){try{St(t)}catch(t){e=t}})),n.__H=void 0,e&&J.__e(e,n.__v))};var yt="function"==typeof requestAnimationFrame;function Ct(t){var e,n=function(){clearTimeout(i),yt&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(n,100);yt&&(e=requestAnimationFrame(n))}function St(t){var e=Z,n=t.__c;"function"==typeof n&&(t.__c=void 0,n()),Z=e}function wt(t){var e=Z;t.__c=t.__(),Z=e}function xt(t,e){return!t||t.length!==e.length||e.some((function(e,n){return e!==t[n]}))}function Et(t,e){return"function"==typeof e?e(t):e}function Lt(t,e){for(var n in e)t[n]=e[n];return t}function _t(t,e){for(var n in t)if("__source"!==n&&!(n in e))return!0;for(var i in e)if("__source"!==i&&t[i]!==e[i])return!0;return!1}function Ot(t,e){this.props=t,this.context=e}function Tt(t,e){function n(t){var n=this.props.ref,i=n==t.ref;return!i&&n&&(n.call?n(null):n.current=null),e?!e(this.props,t)||!i:_t(this.props,t)}function i(e){return this.shouldComponentUpdate=n,v(t,e)}return i.displayName="Memo("+(t.displayName||t.name)+")",i.prototype.isReactComponent=!0,i.__f=!0,i}(Ot.prototype=new C).isPureReactComponent=!0,Ot.prototype.shouldComponentUpdate=function(t,e){return _t(this.props,t)||_t(this.state,e)};var kt=o.__b;o.__b=function(t){t.type&&t.type.__f&&t.ref&&(t.props.ref=t.ref,t.ref=null),kt&&kt(t)};var Dt="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function Pt(t){function e(e){var n=Lt({},e);return delete n.ref,t(n,e.ref||null)}return e.$$typeof=Dt,e.render=e,e.prototype.isReactComponent=e.__f=!0,e.displayName="ForwardRef("+(t.displayName||t.name)+")",e}var Rt=function(t,e){return null==t?null:k(k(t).map(e))},It={map:Rt,forEach:Rt,count:function(t){return t?k(t).length:0},only:function(t){var e=k(t);if(1!==e.length)throw"Children.only";return e[0]},toArray:k},Ft=o.__e;o.__e=function(t,e,n,i){if(t.then)for(var o,r=e;r=r.__;)if((o=r.__c)&&o.__c)return null==e.__e&&(e.__e=n.__e,e.__k=n.__k),o.__c(t,e);Ft(t,e,n,i)};var Bt=o.unmount;function Wt(t,e,n){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach((function(t){"function"==typeof t.__c&&t.__c()})),t.__c.__H=null),null!=(t=Lt({},t)).__c&&(t.__c.__P===n&&(t.__c.__P=e),t.__c=null),t.__k=t.__k&&t.__k.map((function(t){return Wt(t,e,n)}))),t}function Mt(t,e,n){return t&&n&&(t.__v=null,t.__k=t.__k&&t.__k.map((function(t){return Mt(t,e,n)})),t.__c&&t.__c.__P===e&&(t.__e&&n.appendChild(t.__e),t.__c.__e=!0,t.__c.__P=n)),t}function jt(){this.__u=0,this.t=null,this.__b=null}function zt(t){var e=t.__.__c;return e&&e.__a&&e.__a(t)}function Nt(t){var e,n,i;function o(o){if(e||(e=t()).then((function(t){n=t.default||t}),(function(t){i=t})),i)throw i;if(!n)throw e;return v(n,o)}return o.displayName="Lazy",o.__f=!0,o}function Vt(){this.u=null,this.o=null}o.unmount=function(t){var e=t.__c;e&&e.__R&&e.__R(),e&&32&t.__u&&(t.type=null),Bt&&Bt(t)},(jt.prototype=new C).__c=function(t,e){var n=e.__c,i=this;null==i.t&&(i.t=[]),i.t.push(n);var o=zt(i.__v),r=!1,a=function(){r||(r=!0,n.__R=null,o?o(s):s())};n.__R=a;var s=function(){if(!--i.__u){if(i.state.__a){var t=i.state.__a;i.__v.__k[0]=Mt(t,t.__c.__P,t.__c.__O)}var e;for(i.setState({__a:i.__b=null});e=i.t.pop();)e.forceUpdate()}};i.__u++||32&e.__u||i.setState({__a:i.__b=i.__v.__k[0]}),t.then(a,a)},jt.prototype.componentWillUnmount=function(){this.t=[]},jt.prototype.render=function(t,e){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),i=this.__v.__k[0].__c;this.__v.__k[0]=Wt(this.__b,n,i.__O=i.__P)}this.__b=null}var o=e.__a&&v(y,null,t.fallback);return o&&(o.__u&=-33),[v(y,null,e.__a?null:t.children),o]};var Ut=function(t,e,n){if(++n[1]===n[0]&&t.o.delete(e),t.props.revealOrder&&("t"!==t.props.revealOrder[0]||!t.o.size))for(n=t.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;t.u=n=n[2]}};function Ht(t){return this.getChildContext=function(){return t.context},t.children}function Gt(t){var e=this,n=t.i;e.componentWillUnmount=function(){V(null,e.l),e.l=null,e.i=null},e.i&&e.i!==n&&e.componentWillUnmount(),e.l||(e.i=n,e.l={nodeType:1,parentNode:n,childNodes:[],appendChild:function(t){this.childNodes.push(t),e.i.appendChild(t)},insertBefore:function(t,n){this.childNodes.push(t),e.i.appendChild(t)},removeChild:function(t){this.childNodes.splice(this.childNodes.indexOf(t)>>>1,1),e.i.removeChild(t)}}),V(v(Ht,{context:e.context},t.__v),e.l)}function Qt(t,e){var n=v(Gt,{__v:t,i:e});return n.containerInfo=e,n}(Vt.prototype=new C).__a=function(t){var e=this,n=zt(e.__v),i=e.o.get(t);return i[0]++,function(o){var r=function(){e.props.revealOrder?(i.push(o),Ut(e,t,i)):o()};n?n(r):r()}},Vt.prototype.render=function(t){this.u=null,this.o=new Map;var e=k(t.children);t.revealOrder&&"b"===t.revealOrder[0]&&e.reverse();for(var n=e.length;n--;)this.o.set(e[n],this.u=[1,0,this.u]);return t.children},Vt.prototype.componentDidUpdate=Vt.prototype.componentDidMount=function(){var t=this;this.o.forEach((function(e,n){Ut(t,n,e)}))};var Zt="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,Yt=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,qt=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Xt=/[A-Z0-9]/g,$t="undefined"!=typeof document,Kt=function(t){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(t)};function Jt(t,e,n){return null==e.__k&&(e.textContent=""),V(t,e),"function"==typeof n&&n(),t?t.__c:null}function te(t,e,n){return U(t,e),"function"==typeof n&&n(),t?t.__c:null}C.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(t){Object.defineProperty(C.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}));var ee=o.event;function ne(){}function ie(){return this.cancelBubble}function oe(){return this.defaultPrevented}o.event=function(t){return ee&&(t=ee(t)),t.persist=ne,t.isPropagationStopped=ie,t.isDefaultPrevented=oe,t.nativeEvent=t};var re,ae={enumerable:!1,configurable:!0,get:function(){return this.class}},se=o.vnode;o.vnode=function(t){"string"==typeof t.type&&function(t){var e=t.props,n=t.type,i={};for(var o in e){var r=e[o];if(!("value"===o&&"defaultValue"in e&&null==r||$t&&"children"===o&&"noscript"===n||"class"===o||"className"===o)){var a=o.toLowerCase();"defaultValue"===o&&"value"in e&&null==e.value?o="value":"download"===o&&!0===r?r="":"translate"===a&&"no"===r?r=!1:"ondoubleclick"===a?o="ondblclick":"onchange"!==a||"input"!==n&&"textarea"!==n||Kt(e.type)?"onfocus"===a?o="onfocusin":"onblur"===a?o="onfocusout":qt.test(o)?o=a:-1===n.indexOf("-")&&Yt.test(o)?o=o.replace(Xt,"-$&").toLowerCase():null===r&&(r=void 0):a=o="oninput","oninput"===a&&i[o=a]&&(o="oninputCapture"),i[o]=r}}"select"==n&&i.multiple&&Array.isArray(i.value)&&(i.value=k(e.children).forEach((function(t){t.props.selected=-1!=i.value.indexOf(t.props.value)}))),"select"==n&&null!=i.defaultValue&&(i.value=k(e.children).forEach((function(t){t.props.selected=i.multiple?-1!=i.defaultValue.indexOf(t.props.value):i.defaultValue==t.props.value}))),e.class&&!e.className?(i.class=e.class,Object.defineProperty(i,"className",ae)):(e.className&&!e.class||e.class&&e.className)&&(i.class=i.className=e.className),t.props=i}(t),t.$$typeof=Zt,se&&se(t)};var le=o.__r;o.__r=function(t){le&&le(t),re=t.__c};var ce=o.diffed;o.diffed=function(t){ce&&ce(t);var e=t.props,n=t.__e;null!=n&&"textarea"===t.type&&"value"in e&&e.value!==n.value&&(n.value=null==e.value?"":e.value),re=null};var ue={ReactCurrentDispatcher:{current:{readContext:function(t){return re.__n[t.__c].props.value}}}},de="17.0.2";function he(t){return v.bind(null,t)}function pe(t){return!!t&&t.$$typeof===Zt}function fe(t){return pe(t)&&t.type===y}function me(t){return pe(t)?H.apply(null,arguments):t}function ge(t){return!!t.__k&&(V(null,t),!0)}function ve(t){return t&&(t.base||1===t.nodeType&&t)||null}var Ae=function(t,e){return t(e)},be=function(t,e){return t(e)},ye=y;function Ce(t){t()}function Se(t){return t}function we(){return[!1,Ce]}var xe=ut,Ee=pe;function Le(t,e){var n=e(),i=st({h:{__:n,v:e}}),o=i[0].h,r=i[1];return ut((function(){o.__=n,o.v=e,_e(o)&&r({h:o})}),[t,n,e]),ct((function(){return _e(o)&&r({h:o}),t((function(){_e(o)&&r({h:o})}))}),[t]),n}function _e(t){var e,n,i=t.v,o=t.__;try{var r=i();return!((e=o)===(n=r)&&(0!==e||1/e==1/n)||e!=e&&n!=n)}catch(t){return!0}}var Oe={useState:st,useId:At,useReducer:lt,useEffect:ct,useLayoutEffect:ut,useInsertionEffect:ut,useTransition:we,useDeferredValue:Se,useSyncExternalStore:Le,startTransition:Ce,useRef:dt,useImperativeHandle:ht,useMemo:pt,useCallback:ft,useContext:mt,useDebugValue:gt,version:"17.0.2",Children:It,render:Jt,hydrate:te,unmountComponentAtNode:ge,createPortal:Qt,createElement:v,createContext:G,createFactory:he,cloneElement:me,createRef:b,Fragment:y,isValidElement:pe,isElement:pe,isFragment:fe,findDOMNode:ve,Component:C,PureComponent:Ot,memo:Tt,forwardRef:Pt,flushSync:be,unstable_batchedUpdates:Ae,StrictMode:y,Suspense:jt,SuspenseList:Vt,lazy:Nt,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:ue}},function(t,e,n){"use strict";n.d(e,"f",(function(){return o})),n.d(e,"j",(function(){return r})),n.d(e,"e",(function(){return a})),n.d(e,"g",(function(){return s})),n.d(e,"a",(function(){return l})),n.d(e,"d",(function(){return c})),n.d(e,"h",(function(){return u})),n.d(e,"b",(function(){return d})),n.d(e,"c",(function(){return h})),n.d(e,"i",(function(){return p})),n.d(e,"l",(function(){return f})),n.d(e,"k",(function(){return m}));var i=n(7);class o extends i.a{constructor(t={}){super(),this.sbColorPrimary="#C8193C",this.sbColorPrimaryDisabled="#F5F5F5",this.sbColorNegative="#FF3737",this.sbColorPositive="#4EFFB4",this.sbColorWarning="#FFCE5C",this.sbColorSecondary="#FFEDEE",this.sbColorSecondaryDisabled="#F5F5F5",this.sbColorOnPrimary="#FFFFFF",this.sbColorOnSecondary="#C8193C",this.sbColorSurface="#FFFFFF",this.sbColorOutline="#EFEFEF",this.sbColorOnSurfaceVariant="#707070",this.sbColorOnSurface="#000000",this.sbColorSurfaceLow="#00000026",this.sbColorSurfaceHigh="#0000007A",this.sbColorModalOverlay="#000000A3",void 0!==t.sbColorPrimary&&(this.sbColorPrimary=t.sbColorPrimary),void 0!==t.sbColorPrimaryDisabled&&(this.sbColorPrimaryDisabled=t.sbColorPrimaryDisabled),void 0!==t.sbColorNegative&&(this.sbColorNegative=t.sbColorNegative),void 0!==t.sbColorPositive&&(this.sbColorPositive=t.sbColorPositive),void 0!==t.sbColorWarning&&(this.sbColorWarning=t.sbColorWarning),void 0!==t.sbColorSecondary&&(this.sbColorSecondary=t.sbColorSecondary),void 0!==t.sbColorSecondaryDisabled&&(this.sbColorSecondaryDisabled=t.sbColorSecondaryDisabled),void 0!==t.sbColorOnPrimary&&(this.sbColorOnPrimary=t.sbColorOnPrimary),void 0!==t.sbColorOnSecondary&&(this.sbColorOnSecondary=t.sbColorOnSecondary),void 0!==t.sbColorSurface&&(this.sbColorSurface=t.sbColorSurface),void 0!==t.sbColorOutline&&(this.sbColorOutline=t.sbColorOutline),void 0!==t.sbColorOnSurfaceVariant&&(this.sbColorOnSurfaceVariant=t.sbColorOnSurfaceVariant),void 0!==t.sbColorOnSurface&&(this.sbColorOnSurface=t.sbColorOnSurface),void 0!==t.sbColorSurfaceLow&&(this.sbColorSurfaceLow=t.sbColorSurfaceLow),void 0!==t.sbColorSurfaceHigh&&(this.sbColorSurfaceHigh=t.sbColorSurfaceHigh),void 0!==t.sbColorModalOverlay&&(this.sbColorModalOverlay=t.sbColorModalOverlay)}}class r extends i.a{constructor(t={}){super(),this.visible=!0,this.text="",this.color="#FFFFFF",this.useShadow=!1,void 0!==t.visible&&(this.visible=t.visible),void 0!==t.text&&(this.text=t.text),void 0!==t.color&&(this.color=t.color),void 0!==t.useShadow&&(this.useShadow=t.useShadow)}}class a extends i.a{constructor(t={}){super(),this.visible=!0,this.color="#FFFFFF",void 0!==t.visible&&(this.visible=t.visible),void 0!==t.color&&(this.color=t.color)}}class s extends i.a{constructor(t={}){super(),this.strokeColor="#FFFFFFFF",this.fillColor="#30FFFFFF",this.strokeWidth=2,this.cornerRadius=0,void 0!==t.strokeColor&&(this.strokeColor=t.strokeColor),void 0!==t.fillColor&&(this.fillColor=t.fillColor),void 0!==t.strokeWidth&&(this.strokeWidth=t.strokeWidth),void 0!==t.cornerRadius&&(this.cornerRadius=t.cornerRadius)}}class l extends i.a{constructor(t={}){super(),this.strokeColor="#FFFFFFFF",this.fillColor="#FFFFFF30",this.strokeWidth=2,void 0!==t.strokeColor&&(this.strokeColor=t.strokeColor),void 0!==t.fillColor&&(this.fillColor=t.fillColor),void 0!==t.strokeWidth&&(this.strokeWidth=t.strokeWidth)}}class c extends i.a{constructor(t={}){super(),this.iconVisible=!0,this.color="#FFFFFF",this.useShadow=!1,void 0!==t.iconVisible&&(this.iconVisible=t.iconVisible),void 0!==t.color&&(this.color=t.color),void 0!==t.useShadow&&(this.useShadow=t.useShadow)}}class u extends i.a{constructor(t={}){super(),this.visible=!0,this.backgroundColor="#0000007A",this.foregroundColor="#FFFFFF",this.activeBackgroundColor="#FFCE5C",this.activeForegroundColor="#1C1B1F",void 0!==t.visible&&(this.visible=t.visible),void 0!==t.backgroundColor&&(this.backgroundColor=t.backgroundColor),void 0!==t.foregroundColor&&(this.foregroundColor=t.foregroundColor),void 0!==t.activeBackgroundColor&&(this.activeBackgroundColor=t.activeBackgroundColor),void 0!==t.activeForegroundColor&&(this.activeForegroundColor=t.activeForegroundColor)}}class d extends i.a{constructor(t={}){super(),this.badgeBackgroundColor="#FFFFFF",this.badgeForegroundColor="#C8193C",this.visible=!0,this.backgroundColor="#0000007A",this.foregroundColor="#FFFFFF",this.activeBackgroundColor="#FFCE5C",this.activeForegroundColor="#1C1B1F",void 0!==t.badgeBackgroundColor&&(this.badgeBackgroundColor=t.badgeBackgroundColor),void 0!==t.badgeForegroundColor&&(this.badgeForegroundColor=t.badgeForegroundColor),void 0!==t.visible&&(this.visible=t.visible),void 0!==t.backgroundColor&&(this.backgroundColor=t.backgroundColor),void 0!==t.foregroundColor&&(this.foregroundColor=t.foregroundColor),void 0!==t.activeBackgroundColor&&(this.activeBackgroundColor=t.activeBackgroundColor),void 0!==t.activeForegroundColor&&(this.activeForegroundColor=t.activeForegroundColor)}}class h extends i.a{constructor(t={}){super(),this.visible=!0,this.text="",this.background=new l({}),this.foreground=new c({}),void 0!==t.visible&&(this.visible=t.visible),void 0!==t.text&&(this.text=t.text),void 0!==t.background&&(this.background=new l(t.background)),void 0!==t.foreground&&(this.foreground=new c(t.foreground))}}class p extends i.a{constructor(t={}){super(),this.successBeepEnabled=!0,this.soundType="MODERN_BEEP",void 0!==t.successBeepEnabled&&(this.successBeepEnabled=t.successBeepEnabled),void 0!==t.soundType&&(this.soundType=t.soundType)}}class f extends i.a{constructor(t={}){super(),this.enabled=!1,void 0!==t.enabled&&(this.enabled=t.enabled)}}class m extends i.a{constructor(t={}){super(),this.autoCancelTimeout=0,this.initialScanDelay=0,void 0!==t.autoCancelTimeout&&(this.autoCancelTimeout=t.autoCancelTimeout),void 0!==t.initialScanDelay&&(this.initialScanDelay=t.initialScanDelay)}}},function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return r})),n.d(e,"d",(function(){return a})),n.d(e,"c",(function(){return s})),n.d(e,"e",(function(){return l}));var i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)};function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var r=function(){return r=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},r.apply(this,arguments)};function a(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(t);o<i.length;o++)e.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(t,i[o])&&(n[i[o]]=t[i[o]])}return n}Object.create;function s(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,o,r=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(t){o={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function l(t,e,n){if(n||2===arguments.length)for(var i,o=0,r=e.length;o<r;o++)!i&&o in e||(i||(i=Array.prototype.slice.call(e,0,o)),i[o]=e[o]);return t.concat(i||Array.prototype.slice.call(e))}Object.create},function(t,e){t.exports=window["@mui"]},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));class i{_marker(){}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a})),n.d(e,"c",(function(){return s})),n.d(e,"b",(function(){return l}));var i=n(0),o=n(16),r=n(14);const a=Object(i.createContext)(null);function s(t){return{getColorValue:e=>{if(e){if(e.startsWith("?")){const n=e.slice(1);if(n in t)return t[n];r.a.debugWarn(`Color ${n} not found in palette`)}return e}r.a.debugWarn("Color is missing")}}}class l{static setPalette(t){this.palette=t}static setBarcodeTextLocalization(t){this.barcodeTextLocalization=t}static getColorValue(t){return s(l.palette).getColorValue(t)}static getLocalizedBarcodeText(t){if(t.startsWith("?")){const e=t.slice(1);if(e in l.barcodeTextLocalization)return l.barcodeTextLocalization[e];r.a.debugWarn(`Barcode text localization key ${e} not found in localization`)}return t}}l.palette=(new o.BarcodeScannerConfiguration).palette,l.barcodeTextLocalization=(new o.BarcodeScannerConfiguration).localization},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var i=n(27);class o{constructor(t,e){this.x=t,this.y=e}static toPolygon(t,e){return[o.scaleDownTo(t[0],e),o.scaleDownTo(t[1],e),o.scaleDownTo(t[2],e),o.scaleDownTo(t[3],e)]}static scaleToPoint(t,e,n,i){return new o(i*(t.x-e),i*(t.y-n))}static scaleListToHtmlElement(t,e,n){return t.map((t=>o.scaleToHtmlElement(t,e,n)))}static scaleToHtmlElement(t,e,n){return new o(t.x*(n.clientWidth/e.width),t.y*(n.clientHeight/e.height))}static scaleUpTo(t,e){return new o(t.x*e.width,t.y*e.height)}static scaleDownTo(t,e){return new o(t.x/e.width,t.y/e.height)}static fromHtmlElement(t){return new o(t.offsetLeft,t.offsetTop)}static withScale(t,e,n){return new o(t/n,e/n)}static fromCoordinates(t,e,n,i){if(!t||!e)return new o(0,0);const r=new o(t,e);return i=null!=i?i:1,1===(n=n?n%4:0)?o.withScale(r.y,-r.x,i):2===n?o.withScale(-r.x,-r.y,i):3===n?o.withScale(-r.y,r.x,i):o.withScale(r.x,r.y,i)}static centerOf(t){const e=t.reduce(((t,e)=>t+e.x),0)/t.length,n=t.reduce(((t,e)=>t+e.y),0)/t.length;return new o(e,n)}static smallerSizeOfQuad(t){const e=Math.max(...t.map((t=>t.x)))-Math.min(...t.map((t=>t.x))),n=Math.max(...t.map((t=>t.y)))-Math.min(...t.map((t=>t.y)));return Math.min(e,n)}static empty(){return new o(0,0)}static centerX(t){if(t)return(o.highestX(t)+o.lowestX(t))/2}static highestX(t){if(t)return Math.max(...t.map((t=>t.x)))}static lowestX(t){if(t)return Math.min(...t.map((t=>t.x)))}static lowestY(t){if(t)return Math.min(...t.map((t=>t.y)))}static highestY(t){if(t)return Math.max(...t.map((t=>t.y)))}static width(t){if(t)return o.highestX(t)-o.lowestX(t)}static left(t){if(t)return t.reduce(((t,e)=>t.x<e.x?t:e))}static right(t){if(t)return t.reduce(((t,e)=>t.x>e.x?t:e))}static toSvgString(t){if(void 0!==t)return t.map((t=>`${t.x.toFixed(2)},${t.y.toFixed(2)}`)).join(" ")}static toSvgPathStringWithRoundedCorners(t,e=0){if(void 0===t)return;function n(t,e,n){const i=Math.atan2(t.y-e.y,t.x-e.x);return{x:t.x-n*Math.cos(i),y:t.y-n*Math.sin(i)}}let i="";const r=n(t[0],t[1],o.distance(t[0],t[1])/2);i+=`M ${r.x} ${r.y}`;for(let r=0;r<t.length;r++){const a=t[r],s=t[(r+1)%t.length],l=t[(r+2)%t.length],c=n(s,l,o.distance(s,l)/2),u=Math.abs(Math.atan2(s.y-a.y,s.x-a.x)-Math.atan2(s.y-l.y,s.x-l.x)),d=u>Math.PI?2*Math.PI-u:u,h=Math.min(Math.sqrt(Math.pow(s.x-a.x,2)+Math.pow(s.y-a.y,2)),Math.sqrt(Math.pow(s.x-l.x,2)+Math.pow(s.y-l.y,2))),p=Math.min(e,h*Math.tan(d/2)/2),f=Math.abs(p/Math.tan(d/2)),m=(s.x-a.x)*(s.y-l.y)-(s.x-l.x)*(s.y-a.y)<0?1:0,g=n(s,a,f),v=n(s,l,f);i+=` L${g.x} ${g.y}`,i+=` A${p} ${p} 0 0 ${m} ${v.x} ${v.y}`,i+=` L${c.x} ${c.y}`}return i+" Z"}static distance(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}static subtract(t,e){return new o(t.x-e.x,t.y-e.y)}static add(t,e){return new o(t.x+e.x,t.y+e.y)}static multiply(t,e){return new o(t.x*e,t.y*e)}static cross(t,e){return t.x*e.y-t.y*e.x}static clamp(t,e){return new o(Object(i.a)(t.x,0,e.width),Object(i.a)(t.y,0,e.height))}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));class i{}},function(t,e,n){"use strict";n.r(e),n.d(e,"BarcodeConfigs",(function(){return i})),n.d(e,"BarcodeScannerTypes",(function(){return r})),n.d(e,"BarcodeTypes",(function(){return a})),n.d(e,"CheckRecognizerTypes",(function(){return s})),n.d(e,"CommonFieldType",(function(){return l})),n.d(e,"DocumentDetectorTypes",(function(){return c})),n.d(e,"DocumentQualityAnalyzerTypes",(function(){return u})),n.d(e,"EhicTypes",(function(){return d})),n.d(e,"GenericDocument",(function(){return o})),n.d(e,"GenericDocumentRecognizerTypes",(function(){return h})),n.d(e,"GenericTextLineScannerTypes",(function(){return p})),n.d(e,"Geometry",(function(){return St})),n.d(e,"ImageProcessorTypes",(function(){return f})),n.d(e,"LicensePlateScannerTypes",(function(){return m})),n.d(e,"MedicalCertificateTypes",(function(){return g})),n.d(e,"MRZTypes",(function(){return A})),n.d(e,"OcrElements",(function(){return b})),n.d(e,"ParametricFilters",(function(){return y})),n.d(e,"PdfConfig",(function(){return C})),n.d(e,"TiffTypes",(function(){return S})),n.d(e,"FrameUtilities",(function(){return v}));var i={};n.r(i),n.d(i,"BarcodeConfig",(function(){return w})),n.d(i,"OneDBarcodeConfig",(function(){return x})),n.d(i,"CodabarConfig",(function(){return k})),n.d(i,"Code11Config",(function(){return D})),n.d(i,"Code39Config",(function(){return P})),n.d(i,"Code93Config",(function(){return R})),n.d(i,"Code128Config",(function(){return I})),n.d(i,"Code2Of5Config",(function(){return F})),n.d(i,"DataBarConfig",(function(){return B})),n.d(i,"DataBarExpandedConfig",(function(){return W})),n.d(i,"DataBarLimitedConfig",(function(){return M})),n.d(i,"ITFConfig",(function(){return j})),n.d(i,"MSIPlesseyConfig",(function(){return z})),n.d(i,"UpcEanConfig",(function(){return N})),n.d(i,"PharmaCodeConfig",(function(){return V})),n.d(i,"TwoDBarcodeConfig",(function(){return E})),n.d(i,"AztecConfig",(function(){return U})),n.d(i,"QRCodeConfig",(function(){return H})),n.d(i,"PDF417Config",(function(){return G})),n.d(i,"MicroPDF417Config",(function(){return Q})),n.d(i,"DataMatrixConfig",(function(){return Z})),n.d(i,"MaxiCodeConfig",(function(){return Y})),n.d(i,"FourStateBarcodeConfig",(function(){return L})),n.d(i,"AustraliaPostConfig",(function(){return q})),n.d(i,"JapanPostConfig",(function(){return X})),n.d(i,"RoyalMailConfig",(function(){return $})),n.d(i,"RoyalTNTPostConfig",(function(){return K})),n.d(i,"USPSIntelligentMailConfig",(function(){return J})),n.d(i,"PharmaCodeTwoTrackConfig",(function(){return tt})),n.d(i,"GS1CompositeConfig",(function(){return et})),n.d(i,"GroupOneDConfig",(function(){return nt})),n.d(i,"GroupTwoDConfig",(function(){return it})),n.d(i,"GroupFourStateConfig",(function(){return ot})),n.d(i,"GroupCommonConfig",(function(){return rt}));var o={};n.r(o),n.d(o,"OcrResult",(function(){return at})),n.d(o,"FieldType",(function(){return st})),n.d(o,"Field",(function(){return lt})),n.d(o,"GenericDocumentType",(function(){return ct})),n.d(o,"GenericDocument",(function(){return ut}));var r={};n.r(r),n.d(r,"BarcodeItem",(function(){return dt})),n.d(r,"BarcodeDocumentFormats",(function(){return ht})),n.d(r,"BarcodeRecognizerParameters",(function(){return pt})),n.d(r,"BarcodeScannerResult",(function(){return ft}));var a={};n.r(a),n.d(a,"BarcodeFormats",(function(){return mt}));var s={};n.r(s),n.d(s,"RecognitionResult",(function(){return gt}));var l={};n.r(l);var c={};n.r(c),n.d(c,"DetectionParameters",(function(){return wt})),n.d(c,"DetectorConfiguration",(function(){return xt})),n.d(c,"DetectionScores",(function(){return Et})),n.d(c,"DetectionResult",(function(){return Lt}));var u={};n.r(u),n.d(u,"QualityThreshold",(function(){return _t})),n.d(u,"Config",(function(){return Ot})),n.d(u,"AnalysisResult",(function(){return Tt}));var d={};n.r(d),n.d(d,"RecognitionResult",(function(){return kt})),n.d(d,"RecognizerParameters",(function(){return Dt}));var h={};n.r(h),n.d(h,"RecognitionResult",(function(){return Pt})),n.d(h,"RecognitionParameters",(function(){return Rt})),n.d(h,"ResultAccumulationConfig",(function(){return It})),n.d(h,"GenericDocumentRecognizerConfig",(function(){return Ft}));var p={};n.r(p),n.d(p,"WordBox",(function(){return Bt})),n.d(p,"SymbolBox",(function(){return Wt})),n.d(p,"ScannerResult",(function(){return Mt})),n.d(p,"ContentValidator",(function(){return vt})),n.d(p,"DefaultContentValidator",(function(){return jt})),n.d(p,"PresetContentValidator",(function(){return zt})),n.d(p,"PatternContentValidator",(function(){return Nt})),n.d(p,"ScannerConfiguration",(function(){return Vt}));var f={};n.r(f);var m={};n.r(m),n.d(m,"ScannerConfiguration",(function(){return Ut})),n.d(m,"ScannerResult",(function(){return Ht}));var g={};n.r(g),n.d(g,"RecognitionParameters",(function(){return Gt})),n.d(g,"CheckBox",(function(){return Qt})),n.d(g,"DateRecord",(function(){return Zt})),n.d(g,"PatientInfoField",(function(){return Yt})),n.d(g,"PatientInfoBox",(function(){return qt})),n.d(g,"RecognitionResult",(function(){return Xt}));var v={};n.r(v),n.d(v,"AccumulatedResultsVerifierConfig",(function(){return $t}));var A={};n.r(A),n.d(A,"RecognitionResult",(function(){return Kt})),n.d(A,"RecognizerConfiguration",(function(){return Jt}));var b={};n.r(b),n.d(b,"OcrElement",(function(){return At})),n.d(b,"Glyph",(function(){return te})),n.d(b,"Word",(function(){return ee})),n.d(b,"Line",(function(){return ne})),n.d(b,"Block",(function(){return ie})),n.d(b,"Page",(function(){return oe}));var y={};n.r(y),n.d(y,"ParametricFilter",(function(){return bt})),n.d(y,"ScanbotBinarizationFilter",(function(){return re})),n.d(y,"CustomBinarizationFilter",(function(){return ae})),n.d(y,"ColorDocumentFilter",(function(){return se})),n.d(y,"BrightnessFilter",(function(){return le})),n.d(y,"ContrastFilter",(function(){return ce})),n.d(y,"GrayscaleFilter",(function(){return ue})),n.d(y,"LegacyFilter",(function(){return de})),n.d(y,"WhiteBlackPointFilter",(function(){return he}));var C={};n.r(C),n.d(C,"PdfAttributes",(function(){return pe})),n.d(C,"PdfConfig",(function(){return fe}));var S={};n.r(S),n.d(S,"UserFieldValue",(function(){return yt})),n.d(S,"UserFieldDoubleValue",(function(){return me})),n.d(S,"UserFieldStringValue",(function(){return ge})),n.d(S,"UserFieldIntValue",(function(){return ve})),n.d(S,"UserField",(function(){return Ae})),n.d(S,"TIFFWriterParameters",(function(){return be}));var w,x,E,L,_,O,T=n(4);!function(t){t.From=function(t){const e=t._type;switch(e){case"CodabarConfig":return new k(t);case"Code11Config":return new D(t);case"Code39Config":return new P(t);case"Code93Config":return new R(t);case"Code128Config":return new I(t);case"Code2Of5Config":return new F(t);case"DataBarConfig":return new B(t);case"DataBarExpandedConfig":return new W(t);case"DataBarLimitedConfig":return new M(t);case"ITFConfig":return new j(t);case"MSIPlesseyConfig":return new z(t);case"UpcEanConfig":return new N(t);case"PharmaCodeConfig":return new V(t);case"AztecConfig":return new U(t);case"QRCodeConfig":return new H(t);case"PDF417Config":return new G(t);case"MicroPDF417Config":return new Q(t);case"DataMatrixConfig":return new Z(t);case"MaxiCodeConfig":return new Y(t);case"AustraliaPostConfig":return new q(t);case"JapanPostConfig":return new X(t);case"RoyalMailConfig":return new $(t);case"RoyalTNTPostConfig":return new K(t);case"USPSIntelligentMailConfig":return new J(t);case"PharmaCodeTwoTrackConfig":return new tt(t);case"GS1CompositeConfig":return new et(t);case"GroupOneDConfig":return new nt(t);case"GroupTwoDConfig":return new it(t);case"GroupFourStateConfig":return new ot(t);case"GroupCommonConfig":return new rt(t);default:throw`Unknown child class name: ${e}`}}}(w||(w={})),function(t){t.From=function(t){const e=t._type;switch(e){case"CodabarConfig":return new k(t);case"Code11Config":return new D(t);case"Code39Config":return new P(t);case"Code93Config":return new R(t);case"Code128Config":return new I(t);case"Code2Of5Config":return new F(t);case"DataBarConfig":return new B(t);case"DataBarExpandedConfig":return new W(t);case"DataBarLimitedConfig":return new M(t);case"ITFConfig":return new j(t);case"MSIPlesseyConfig":return new z(t);case"UpcEanConfig":return new N(t);case"PharmaCodeConfig":return new V(t);default:throw`Unknown child class name: ${e}`}}}(x||(x={}));class k extends T.a{constructor(t={}){super(),this._type="CodabarConfig",this.minimum1DQuietZoneSize=6,this.regexFilter="",this.minimumTextLength=0,this.maximumTextLength=0,this.returnStartEnd=!1,void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimumTextLength&&(this.minimumTextLength=t.minimumTextLength),void 0!==t.maximumTextLength&&(this.maximumTextLength=t.maximumTextLength),void 0!==t.returnStartEnd&&(this.returnStartEnd=t.returnStartEnd)}}class D extends T.a{constructor(t={}){super(),this._type="Code11Config",this.minimum1DQuietZoneSize=6,this.regexFilter="",this.stripCheckDigits=!1,this.minimumTextLength=0,this.maximumTextLength=0,this.checksum=!0,void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.stripCheckDigits&&(this.stripCheckDigits=t.stripCheckDigits),void 0!==t.minimumTextLength&&(this.minimumTextLength=t.minimumTextLength),void 0!==t.maximumTextLength&&(this.maximumTextLength=t.maximumTextLength),void 0!==t.checksum&&(this.checksum=t.checksum)}}class P extends T.a{constructor(t={}){super(),this._type="Code39Config",this.minimum1DQuietZoneSize=6,this.regexFilter="",this.stripCheckDigits=!1,this.minimumTextLength=0,this.maximumTextLength=0,this.code32=!1,this.code39=!0,this.pzn=!0,this.tryCode39ExtendedMode=!1,this.useCode39CheckDigit=!1,void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.stripCheckDigits&&(this.stripCheckDigits=t.stripCheckDigits),void 0!==t.minimumTextLength&&(this.minimumTextLength=t.minimumTextLength),void 0!==t.maximumTextLength&&(this.maximumTextLength=t.maximumTextLength),void 0!==t.code32&&(this.code32=t.code32),void 0!==t.code39&&(this.code39=t.code39),void 0!==t.pzn&&(this.pzn=t.pzn),void 0!==t.tryCode39ExtendedMode&&(this.tryCode39ExtendedMode=t.tryCode39ExtendedMode),void 0!==t.useCode39CheckDigit&&(this.useCode39CheckDigit=t.useCode39CheckDigit)}}class R extends T.a{constructor(t={}){super(),this._type="Code93Config",this.minimum1DQuietZoneSize=6,this.regexFilter="",this.minimumTextLength=0,this.maximumTextLength=0,void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimumTextLength&&(this.minimumTextLength=t.minimumTextLength),void 0!==t.maximumTextLength&&(this.maximumTextLength=t.maximumTextLength)}}class I extends T.a{constructor(t={}){super(),this._type="Code128Config",this.minimum1DQuietZoneSize=6,this.regexFilter="",this.gs1Handling="PARSE",this.minimumTextLength=0,this.maximumTextLength=0,void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling),void 0!==t.minimumTextLength&&(this.minimumTextLength=t.minimumTextLength),void 0!==t.maximumTextLength&&(this.maximumTextLength=t.maximumTextLength)}}class F extends T.a{constructor(t={}){super(),this._type="Code2Of5Config",this.minimum1DQuietZoneSize=6,this.regexFilter="",this.stripCheckDigits=!1,this.minimumTextLength=0,this.maximumTextLength=0,this.iata2of5=!0,this.code25=!1,this.industrial2of5=!0,this.useIATA2OF5Checksum=!0,void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.stripCheckDigits&&(this.stripCheckDigits=t.stripCheckDigits),void 0!==t.minimumTextLength&&(this.minimumTextLength=t.minimumTextLength),void 0!==t.maximumTextLength&&(this.maximumTextLength=t.maximumTextLength),void 0!==t.iata2of5&&(this.iata2of5=t.iata2of5),void 0!==t.code25&&(this.code25=t.code25),void 0!==t.industrial2of5&&(this.industrial2of5=t.industrial2of5),void 0!==t.useIATA2OF5Checksum&&(this.useIATA2OF5Checksum=t.useIATA2OF5Checksum)}}class B extends T.a{constructor(t={}){super(),this._type="DataBarConfig",this.minimum1DQuietZoneSize=6,this.regexFilter="",this.gs1Handling="PARSE",void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling)}}class W extends T.a{constructor(t={}){super(),this._type="DataBarExpandedConfig",this.minimum1DQuietZoneSize=6,this.regexFilter="",this.gs1Handling="PARSE",void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling)}}class M extends T.a{constructor(t={}){super(),this._type="DataBarLimitedConfig",this.minimum1DQuietZoneSize=6,this.regexFilter="",this.gs1Handling="PARSE",void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling)}}class j extends T.a{constructor(t={}){super(),this._type="ITFConfig",this.minimum1DQuietZoneSize=6,this.regexFilter="",this.minimumTextLength=0,this.maximumTextLength=0,void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimumTextLength&&(this.minimumTextLength=t.minimumTextLength),void 0!==t.maximumTextLength&&(this.maximumTextLength=t.maximumTextLength)}}class z extends T.a{constructor(t={}){super(),this._type="MSIPlesseyConfig",this.minimum1DQuietZoneSize=6,this.regexFilter="",this.stripCheckDigits=!1,this.minimumTextLength=0,this.maximumTextLength=0,this.checksumAlgorithms=["MOD_10"],void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.stripCheckDigits&&(this.stripCheckDigits=t.stripCheckDigits),void 0!==t.minimumTextLength&&(this.minimumTextLength=t.minimumTextLength),void 0!==t.maximumTextLength&&(this.maximumTextLength=t.maximumTextLength),void 0!==t.checksumAlgorithms&&(this.checksumAlgorithms=t.checksumAlgorithms.map((t=>t)))}}class N extends T.a{constructor(t={}){super(),this._type="UpcEanConfig",this.minimum1DQuietZoneSize=6,this.regexFilter="",this.stripCheckDigits=!1,this.ean8=!0,this.ean13=!0,this.upca=!0,this.upce=!0,this.extensions="AllowAny",void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.stripCheckDigits&&(this.stripCheckDigits=t.stripCheckDigits),void 0!==t.ean8&&(this.ean8=t.ean8),void 0!==t.ean13&&(this.ean13=t.ean13),void 0!==t.upca&&(this.upca=t.upca),void 0!==t.upce&&(this.upce=t.upce),void 0!==t.extensions&&(this.extensions=t.extensions)}}class V extends T.a{constructor(t={}){super(),this._type="PharmaCodeConfig",this.minimum1DQuietZoneSize=6,this.regexFilter="",this.minimumValue=16,this.allowNarrowBarsOnly=!1,this.allowWideBarsOnly=!1,void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimumValue&&(this.minimumValue=t.minimumValue),void 0!==t.allowNarrowBarsOnly&&(this.allowNarrowBarsOnly=t.allowNarrowBarsOnly),void 0!==t.allowWideBarsOnly&&(this.allowWideBarsOnly=t.allowWideBarsOnly)}}!function(t){t.From=function(t){const e=t._type;switch(e){case"AztecConfig":return new U(t);case"QRCodeConfig":return new H(t);case"PDF417Config":return new G(t);case"MicroPDF417Config":return new Q(t);case"DataMatrixConfig":return new Z(t);case"MaxiCodeConfig":return new Y(t);default:throw`Unknown child class name: ${e}`}}}(E||(E={}));class U extends T.a{constructor(t={}){super(),this._type="AztecConfig",this.regexFilter="",this.gs1Handling="PARSE",void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling)}}class H extends T.a{constructor(t={}){super(),this._type="QRCodeConfig",this.regexFilter="",this.gs1Handling="PARSE",this.strictMode=!0,this.qr=!0,this.microQr=!1,this.rmqr=!1,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling),void 0!==t.strictMode&&(this.strictMode=t.strictMode),void 0!==t.qr&&(this.qr=t.qr),void 0!==t.microQr&&(this.microQr=t.microQr),void 0!==t.rmqr&&(this.rmqr=t.rmqr)}}class G extends T.a{constructor(t={}){super(),this._type="PDF417Config",this.regexFilter="",this.gs1Handling="PARSE",this.strictMode=!0,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling),void 0!==t.strictMode&&(this.strictMode=t.strictMode)}}class Q extends T.a{constructor(t={}){super(),this._type="MicroPDF417Config",this.regexFilter="",this.gs1Handling="PARSE",this.strictMode=!0,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling),void 0!==t.strictMode&&(this.strictMode=t.strictMode)}}class Z extends T.a{constructor(t={}){super(),this._type="DataMatrixConfig",this.regexFilter="",this.gs1Handling="PARSE",void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling)}}class Y extends T.a{constructor(t={}){super(),this._type="MaxiCodeConfig",this.regexFilter="",void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter)}}!function(t){t.From=function(t){const e=t._type;switch(e){case"AustraliaPostConfig":return new q(t);case"JapanPostConfig":return new X(t);case"RoyalMailConfig":return new $(t);case"RoyalTNTPostConfig":return new K(t);case"USPSIntelligentMailConfig":return new J(t);case"PharmaCodeTwoTrackConfig":return new tt(t);default:throw`Unknown child class name: ${e}`}}}(L||(L={}));class q extends T.a{constructor(t={}){super(),this._type="AustraliaPostConfig",this.regexFilter="",this.australiaPostCustomerFormat="ALPHA_NUMERIC",void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.australiaPostCustomerFormat&&(this.australiaPostCustomerFormat=t.australiaPostCustomerFormat)}}class X extends T.a{constructor(t={}){super(),this._type="JapanPostConfig",this.regexFilter="",void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter)}}class $ extends T.a{constructor(t={}){super(),this._type="RoyalMailConfig",this.regexFilter="",this.stripCheckDigits=!1,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.stripCheckDigits&&(this.stripCheckDigits=t.stripCheckDigits)}}class K extends T.a{constructor(t={}){super(),this._type="RoyalTNTPostConfig",this.regexFilter="",void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter)}}class J extends T.a{constructor(t={}){super(),this._type="USPSIntelligentMailConfig",this.regexFilter="",void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter)}}class tt extends T.a{constructor(t={}){super(),this._type="PharmaCodeTwoTrackConfig",this.regexFilter="",this.minimumValue=364,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimumValue&&(this.minimumValue=t.minimumValue)}}class et extends T.a{constructor(t={}){super(),this._type="GS1CompositeConfig",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.gs1Handling="PARSE",this.strictMode=!0,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling),void 0!==t.strictMode&&(this.strictMode=t.strictMode)}}class nt extends T.a{constructor(t={}){super(),this._type="GroupOneDConfig",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.minimumTextLength=0,this.maximumTextLength=0,this.gs1Handling="PARSE",this.strictMode=!0,this.formats=["CODABAR","CODE_11","CODE_25","CODE_32","CODE_39","CODE_93","CODE_128","DATABAR","DATABAR_EXPANDED","DATABAR_LIMITED","EAN_8","EAN_13","IATA_2_OF_5","INDUSTRIAL_2_OF_5","ITF","MSI_PLESSEY","PHARMA_CODE","PZN","UPC_A","UPC_E"],void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.stripCheckDigits&&(this.stripCheckDigits=t.stripCheckDigits),void 0!==t.minimumTextLength&&(this.minimumTextLength=t.minimumTextLength),void 0!==t.maximumTextLength&&(this.maximumTextLength=t.maximumTextLength),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling),void 0!==t.strictMode&&(this.strictMode=t.strictMode),void 0!==t.formats&&(this.formats=t.formats.map((t=>t)))}}class it extends T.a{constructor(t={}){super(),this._type="GroupTwoDConfig",this.regexFilter="",this.gs1Handling="PARSE",this.strictMode=!0,this.formats=["AZTEC","DATA_MATRIX","MAXICODE","MICRO_QR_CODE","MICRO_PDF_417","PDF_417","QR_CODE","RMQR_CODE"],void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling),void 0!==t.strictMode&&(this.strictMode=t.strictMode),void 0!==t.formats&&(this.formats=t.formats.map((t=>t)))}}class ot extends T.a{constructor(t={}){super(),this._type="GroupFourStateConfig",this.regexFilter="",this.formats=["AUSTRALIA_POST","JAPAN_POST","ROYAL_MAIL","ROYAL_TNT_POST","USPS_INTELLIGENT_MAIL"],void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.formats&&(this.formats=t.formats.map((t=>t)))}}class rt extends T.a{constructor(t={}){super(),this._type="GroupCommonConfig",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.minimumTextLength=0,this.maximumTextLength=0,this.gs1Handling="PARSE",this.strictMode=!0,this.formats=["AZTEC","CODABAR","CODE_39","CODE_93","CODE_128","DATA_MATRIX","DATABAR","DATABAR_EXPANDED","DATABAR_LIMITED","EAN_13","EAN_8","ITF","MICRO_QR_CODE","PDF_417","QR_CODE","UPC_A","UPC_E"],void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.stripCheckDigits&&(this.stripCheckDigits=t.stripCheckDigits),void 0!==t.minimumTextLength&&(this.minimumTextLength=t.minimumTextLength),void 0!==t.maximumTextLength&&(this.maximumTextLength=t.maximumTextLength),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling),void 0!==t.strictMode&&(this.strictMode=t.strictMode),void 0!==t.formats&&(this.formats=t.formats.map((t=>t)))}}class at extends T.a{constructor(t={}){if(super(),void 0===t.text)throw new Error("text must be present in constructor argument");if(this.text=t.text,void 0===t.confidence)throw new Error("confidence must be present in constructor argument");this.confidence=t.confidence}}class st extends T.a{constructor(t={}){if(super(),this.listIndex=null,void 0===t.name)throw new Error("name must be present in constructor argument");if(this.name=t.name,void 0===t.fullName)throw new Error("fullName must be present in constructor argument");if(this.fullName=t.fullName,void 0===t.normalizedName)throw new Error("normalizedName must be present in constructor argument");if(this.normalizedName=t.normalizedName,void 0===t.commonType)throw new Error("commonType must be present in constructor argument");this.commonType=null!=t.commonType?t.commonType:null,void 0!==t.listIndex&&(this.listIndex=null!=t.listIndex?t.listIndex:null)}}class lt extends T.a{constructor(t={}){if(super(),this.confidenceWeight=1,this.image=null,this.validationStatus="NONE",void 0===t.type)throw new Error("type must be present in constructor argument");if(this.type=new st(t.type),void 0===t.value)throw new Error("value must be present in constructor argument");if(this.value=null!=t.value?new at(t.value):null,void 0!==t.confidenceWeight&&(this.confidenceWeight=t.confidenceWeight),void 0!==t.image&&(this.image=null!=t.image?t.image:null),void 0===t.polygonInRoot)throw new Error("polygonInRoot must be present in constructor argument");this.polygonInRoot=t.polygonInRoot.map((t=>({x:t.x,y:t.y}))),void 0!==t.validationStatus&&(this.validationStatus=t.validationStatus)}}class ct extends T.a{constructor(t={}){if(super(),this.listIndex=null,void 0===t.name)throw new Error("name must be present in constructor argument");if(this.name=t.name,void 0===t.fullName)throw new Error("fullName must be present in constructor argument");if(this.fullName=t.fullName,void 0===t.normalizedName)throw new Error("normalizedName must be present in constructor argument");this.normalizedName=t.normalizedName,void 0!==t.listIndex&&(this.listIndex=null!=t.listIndex?t.listIndex:null)}}class ut extends T.a{constructor(t={}){if(super(),this.crop=null,this.confidence=0,this.confidenceWeight=0,void 0===t.type)throw new Error("type must be present in constructor argument");if(this.type=new ct(t.type),void 0===t.fields)throw new Error("fields must be present in constructor argument");if(this.fields=t.fields.map((t=>new lt(t))),void 0===t.children)throw new Error("children must be present in constructor argument");if(this.children=t.children.map((t=>new ut(t))),void 0===t.quad)throw new Error("quad must be present in constructor argument");if(this.quad=null!=t.quad?t.quad.map((t=>({x:t.x,y:t.y}))):null,void 0===t.quadInRoot)throw new Error("quadInRoot must be present in constructor argument");this.quadInRoot=null!=t.quadInRoot?t.quadInRoot.map((t=>({x:t.x,y:t.y}))):null,void 0!==t.crop&&(this.crop=null!=t.crop?t.crop:null),void 0!==t.confidence&&(this.confidence=t.confidence),void 0!==t.confidenceWeight&&(this.confidenceWeight=t.confidenceWeight)}}class dt extends T.a{constructor(t={}){if(super(),this.format="NONE",this.isUpsideDown=!1,this.sourceImage=null,this.isGS1Message=!1,this.isGS1CompositePart=!1,this.dataBarStackSize=1,void 0===t.text)throw new Error("text must be present in constructor argument");if(this.text=t.text,void 0!==t.format&&(this.format=t.format),void 0===t.quad)throw new Error("quad must be present in constructor argument");if(this.quad=t.quad.map((t=>({x:t.x,y:t.y}))),void 0!==t.isUpsideDown&&(this.isUpsideDown=t.isUpsideDown),void 0!==t.sourceImage&&(this.sourceImage=null!=t.sourceImage?t.sourceImage:null),void 0===t.rawBytes)throw new Error("rawBytes must be present in constructor argument");if(this.rawBytes=t.rawBytes,void 0===t.upcEanExtension)throw new Error("upcEanExtension must be present in constructor argument");if(this.upcEanExtension=t.upcEanExtension,void 0!==t.isGS1Message&&(this.isGS1Message=t.isGS1Message),void 0!==t.isGS1CompositePart&&(this.isGS1CompositePart=t.isGS1CompositePart),void 0!==t.dataBarStackSize&&(this.dataBarStackSize=t.dataBarStackSize),void 0===t.parsedDocument)throw new Error("parsedDocument must be present in constructor argument");this.parsedDocument=null!=t.parsedDocument?new ut(t.parsedDocument):null}}class ht extends T.a{constructor(t={}){super()}}(_=ht||(ht={})).all=["AAMVA","BOARDING_PASS","DE_MEDICAL_PLAN","MEDICAL_CERTIFICATE","ID_CARD_PDF_417","SEPA","SWISS_QR","VCARD","GS1","HIBC"],_.documentBarcodeFormats={AAMVA:["PDF_417"],ID_CARD_PDF_417:["PDF_417"],SEPA:["QR_CODE"],MEDICAL_CERTIFICATE:["PDF_417"],DE_MEDICAL_PLAN:["DATA_MATRIX"],BOARDING_PASS:["PDF_417","AZTEC"],VCARD:["QR_CODE"],SWISS_QR:["QR_CODE"],GS1:["CODE_128","AZTEC","DATA_MATRIX","DATABAR","DATABAR_EXPANDED","DATABAR_LIMITED","EAN_13","EAN_8","GS1_COMPOSITE","ITF","MICRO_PDF_417","PDF_417","QR_CODE","UPC_A","UPC_E"],HIBC:["CODE_39","CODE_128","AZTEC","DATA_MATRIX","MICRO_PDF_417","PDF_417","QR_CODE"]};class pt extends T.a{constructor(t={}){super(),this.configurators=[new rt({})],this.engineMode="NEXT_GEN",this.live=!0,this.acceptedDocumentFormats=["AAMVA","BOARDING_PASS","DE_MEDICAL_PLAN","MEDICAL_CERTIFICATE","ID_CARD_PDF_417","SEPA","SWISS_QR","VCARD","GS1","HIBC"],this.returnBarcodeImage=!0,void 0!==t.configurators&&(this.configurators=t.configurators.map((t=>w.From(t)))),void 0!==t.engineMode&&(this.engineMode=t.engineMode),void 0!==t.live&&(this.live=t.live),void 0!==t.acceptedDocumentFormats&&(this.acceptedDocumentFormats=t.acceptedDocumentFormats.map((t=>t))),void 0!==t.returnBarcodeImage&&(this.returnBarcodeImage=t.returnBarcodeImage)}}class ft extends T.a{constructor(t={}){if(super(),void 0===t.barcodes)throw new Error("barcodes must be present in constructor argument");if(this.barcodes=t.barcodes.map((t=>new dt(t))),void 0===t.success)throw new Error("success must be present in constructor argument");this.success=t.success}}class mt extends T.a{constructor(t={}){super()}}(O=mt||(mt={})).oned=["CODABAR","CODE_11","CODE_25","CODE_32","CODE_39","CODE_93","CODE_128","DATABAR","DATABAR_EXPANDED","DATABAR_LIMITED","EAN_8","EAN_13","IATA_2_OF_5","INDUSTRIAL_2_OF_5","ITF","MSI_PLESSEY","PHARMA_CODE","PZN","UPC_A","UPC_E"],O.twod=["AZTEC","DATA_MATRIX","MAXICODE","MICRO_QR_CODE","MICRO_PDF_417","PDF_417","QR_CODE","RMQR_CODE"],O.postal=["AUSTRALIA_POST","JAPAN_POST","ROYAL_MAIL","ROYAL_TNT_POST","USPS_INTELLIGENT_MAIL"],O.pharma=["CODE_32","PHARMA_CODE","PHARMA_CODE_TWO_TRACK","PZN"],O.common=["AZTEC","CODABAR","CODE_39","CODE_93","CODE_128","DATA_MATRIX","DATABAR","DATABAR_EXPANDED","DATABAR_LIMITED","EAN_13","EAN_8","ITF","MICRO_QR_CODE","PDF_417","QR_CODE","UPC_A","UPC_E"],O.all=["AUSTRALIA_POST","AZTEC","CODABAR","CODE_11","CODE_25","CODE_32","CODE_39","CODE_93","CODE_128","DATA_MATRIX","DATABAR","DATABAR_EXPANDED","DATABAR_LIMITED","EAN_13","EAN_8","GS1_COMPOSITE","IATA_2_OF_5","INDUSTRIAL_2_OF_5","ITF","JAPAN_POST","MAXICODE","MICRO_PDF_417","MICRO_QR_CODE","MSI_PLESSEY","PDF_417","PHARMA_CODE","PHARMA_CODE_TWO_TRACK","PZN","QR_CODE","RMQR_CODE","ROYAL_MAIL","ROYAL_TNT_POST","UPC_A","UPC_E","USPS_INTELLIGENT_MAIL"];class gt extends T.a{constructor(t={}){if(super(),this.status="FAIL",void 0!==t.status&&(this.status=t.status),void 0===t.check)throw new Error("check must be present in constructor argument");this.check=null!=t.check?new ut(t.check):null}}var vt,At,bt,yt,Ct,St=n(18);class wt extends T.a{constructor(t={}){super(),this.acceptedAngleScore=75,this.acceptedSizeScore=80,this.acceptedBrightnessThreshold=0,this.requiredAspectRatios=[],this.rectangleOfInterest={x:0,y:0,width:0,height:0},void 0!==t.acceptedAngleScore&&(this.acceptedAngleScore=t.acceptedAngleScore),void 0!==t.acceptedSizeScore&&(this.acceptedSizeScore=t.acceptedSizeScore),void 0!==t.acceptedBrightnessThreshold&&(this.acceptedBrightnessThreshold=t.acceptedBrightnessThreshold),void 0!==t.requiredAspectRatios&&(this.requiredAspectRatios=t.requiredAspectRatios.map((t=>new St.AspectRatio(t)))),void 0!==t.rectangleOfInterest&&(this.rectangleOfInterest={x:t.rectangleOfInterest.x,y:t.rectangleOfInterest.y,width:t.rectangleOfInterest.width,height:t.rectangleOfInterest.height})}}class xt extends T.a{constructor(t={}){super(),this.engineMode="ML",this.parameters=new wt({}),void 0!==t.engineMode&&(this.engineMode=t.engineMode),void 0!==t.parameters&&(this.parameters=new wt(t.parameters))}}class Et extends T.a{constructor(t={}){if(super(),void 0===t.totalScore)throw new Error("totalScore must be present in constructor argument");if(this.totalScore=t.totalScore,void 0===t.distanceScore)throw new Error("distanceScore must be present in constructor argument");if(this.distanceScore=t.distanceScore,void 0===t.angleScore)throw new Error("angleScore must be present in constructor argument");if(this.angleScore=t.angleScore,void 0===t.sizeScore)throw new Error("sizeScore must be present in constructor argument");if(this.sizeScore=t.sizeScore,void 0===t.aspectRatioScore)throw new Error("aspectRatioScore must be present in constructor argument");if(this.aspectRatioScore=t.aspectRatioScore,void 0===t.lineCoverageScore)throw new Error("lineCoverageScore must be present in constructor argument");if(this.lineCoverageScore=t.lineCoverageScore,void 0===t.widthScore)throw new Error("widthScore must be present in constructor argument");if(this.widthScore=t.widthScore,void 0===t.heightScore)throw new Error("heightScore must be present in constructor argument");this.heightScore=t.heightScore}}class Lt extends T.a{constructor(t={}){if(super(),this.status="NOT_ACQUIRED",this.averageBrightness=0,void 0!==t.status&&(this.status=t.status),void 0===t.detectionScores)throw new Error("detectionScores must be present in constructor argument");if(this.detectionScores=new Et(t.detectionScores),void 0===t.points)throw new Error("points must be present in constructor argument");if(this.points=t.points.map((t=>({x:t.x,y:t.y}))),void 0===t.horizontalLines)throw new Error("horizontalLines must be present in constructor argument");if(this.horizontalLines=t.horizontalLines.map((t=>new St.LineSegmentInt(t))),void 0===t.verticalLines)throw new Error("verticalLines must be present in constructor argument");if(this.verticalLines=t.verticalLines.map((t=>new St.LineSegmentInt(t))),void 0===t.pointsNormalized)throw new Error("pointsNormalized must be present in constructor argument");if(this.pointsNormalized=t.pointsNormalized.map((t=>({x:t.x,y:t.y}))),void 0===t.horizontalLinesNormalized)throw new Error("horizontalLinesNormalized must be present in constructor argument");if(this.horizontalLinesNormalized=t.horizontalLinesNormalized.map((t=>new St.LineSegmentFloat(t))),void 0===t.verticalLinesNormalized)throw new Error("verticalLinesNormalized must be present in constructor argument");if(this.verticalLinesNormalized=t.verticalLinesNormalized.map((t=>new St.LineSegmentFloat(t))),void 0===t.aspectRatio)throw new Error("aspectRatio must be present in constructor argument");this.aspectRatio=t.aspectRatio,void 0!==t.averageBrightness&&(this.averageBrightness=t.averageBrightness)}}class _t extends T.a{constructor(t={}){if(super(),void 0===t.symbolQuality)throw new Error("symbolQuality must be present in constructor argument");if(this.symbolQuality=t.symbolQuality,void 0===t.symbolRatio)throw new Error("symbolRatio must be present in constructor argument");this.symbolRatio=t.symbolRatio}}class Ot extends T.a{constructor(t={}){super(),this.qualityThresholds=[new _t({symbolQuality:.5,symbolRatio:.5}),new _t({symbolQuality:.7,symbolRatio:.3}),new _t({symbolQuality:.85,symbolRatio:.3}),new _t({symbolQuality:.9,symbolRatio:.1})],this.qualityIndices=["VERY_POOR","POOR","REASONABLE","GOOD","EXCELLENT"],this.maxImageSize=2e3,this.minEstimatedNumberOfSymbolsForDocument=20,this.minProcessedFraction=0,this.maxProcessedFraction=.5,this.earlyStopIfNSymbolsFound=100,this.tileSize=300,void 0!==t.qualityThresholds&&(this.qualityThresholds=t.qualityThresholds.map((t=>new _t(t)))),void 0!==t.qualityIndices&&(this.qualityIndices=t.qualityIndices.map((t=>t))),void 0!==t.maxImageSize&&(this.maxImageSize=t.maxImageSize),void 0!==t.minEstimatedNumberOfSymbolsForDocument&&(this.minEstimatedNumberOfSymbolsForDocument=t.minEstimatedNumberOfSymbolsForDocument),void 0!==t.minProcessedFraction&&(this.minProcessedFraction=t.minProcessedFraction),void 0!==t.maxProcessedFraction&&(this.maxProcessedFraction=t.maxProcessedFraction),void 0!==t.earlyStopIfNSymbolsFound&&(this.earlyStopIfNSymbolsFound=t.earlyStopIfNSymbolsFound),void 0!==t.tileSize&&(this.tileSize=t.tileSize)}}class Tt extends T.a{constructor(t={}){if(super(),void 0===t.documentFound)throw new Error("documentFound must be present in constructor argument");if(this.documentFound=t.documentFound,void 0===t.quality)throw new Error("quality must be present in constructor argument");this.quality=null!=t.quality?t.quality:null}}class kt extends T.a{constructor(t={}){if(super(),this.status="FAILED_DETECTION",void 0===t.fields)throw new Error("fields must be present in constructor argument");this.fields=t.fields.map((t=>new kt.Field(t))),void 0!==t.status&&(this.status=t.status)}}!function(t){class e extends T.a{constructor(t={}){if(super(),this.validationStatus="NOT_VALIDATED",void 0===t.type)throw new Error("type must be present in constructor argument");if(this.type=t.type,void 0===t.value)throw new Error("value must be present in constructor argument");if(this.value=t.value,void 0===t.confidence)throw new Error("confidence must be present in constructor argument");this.confidence=t.confidence,void 0!==t.validationStatus&&(this.validationStatus=t.validationStatus)}}t.Field=e}(kt||(kt={}));class Dt extends T.a{constructor(t={}){super(),this.allowedCountries=[],this.minBirthYear=0,this.maxBirthYear=2999,this.minExpirationYear=0,this.maxExpirationYear=2999,this.maxCountryDetectionAttempts=5,this.minEqualFrameCount=4,this.maxAccumulatedFrameCount=10,void 0!==t.allowedCountries&&(this.allowedCountries=t.allowedCountries.map((t=>t))),void 0!==t.minBirthYear&&(this.minBirthYear=t.minBirthYear),void 0!==t.maxBirthYear&&(this.maxBirthYear=t.maxBirthYear),void 0!==t.minExpirationYear&&(this.minExpirationYear=t.minExpirationYear),void 0!==t.maxExpirationYear&&(this.maxExpirationYear=t.maxExpirationYear),void 0!==t.maxCountryDetectionAttempts&&(this.maxCountryDetectionAttempts=t.maxCountryDetectionAttempts),void 0!==t.minEqualFrameCount&&(this.minEqualFrameCount=t.minEqualFrameCount),void 0!==t.maxAccumulatedFrameCount&&(this.maxAccumulatedFrameCount=t.maxAccumulatedFrameCount)}}class Pt extends T.a{constructor(t={}){if(super(),void 0===t.status)throw new Error("status must be present in constructor argument");if(this.status=t.status,void 0===t.document)throw new Error("document must be present in constructor argument");if(this.document=null!=t.document?new ut(t.document):null,void 0===t.quad)throw new Error("quad must be present in constructor argument");this.quad=null!=t.quad?t.quad.map((t=>({x:t.x,y:t.y}))):null}}class Rt extends T.a{constructor(t={}){super(),this.mode="LIVE",void 0!==t.mode&&(this.mode=t.mode)}}class It extends T.a{constructor(t={}){super(),this.minConfirmations=3,this.minConfidenceForStableField=.8,this.autoClearThreshold=4,void 0!==t.minConfirmations&&(this.minConfirmations=t.minConfirmations),void 0!==t.minConfidenceForStableField&&(this.minConfidenceForStableField=t.minConfidenceForStableField),void 0!==t.autoClearThreshold&&(this.autoClearThreshold=t.autoClearThreshold)}}class Ft extends T.a{constructor(t={}){super(),this.resultAccumulationConfig=new It({}),this.fieldExcludeList=[],this.acceptedDocumentTypes=[],void 0!==t.resultAccumulationConfig&&(this.resultAccumulationConfig=new It(t.resultAccumulationConfig)),void 0!==t.fieldExcludeList&&(this.fieldExcludeList=t.fieldExcludeList.map((t=>t))),void 0!==t.acceptedDocumentTypes&&(this.acceptedDocumentTypes=t.acceptedDocumentTypes.map((t=>t)))}}class Bt extends T.a{constructor(t={}){if(super(),this.recognitionConfidence=0,void 0===t.text)throw new Error("text must be present in constructor argument");if(this.text=t.text,void 0===t.boundingRect)throw new Error("boundingRect must be present in constructor argument");this.boundingRect={x:t.boundingRect.x,y:t.boundingRect.y,width:t.boundingRect.width,height:t.boundingRect.height},void 0!==t.recognitionConfidence&&(this.recognitionConfidence=t.recognitionConfidence)}}class Wt extends T.a{constructor(t={}){if(super(),void 0===t.symbol)throw new Error("symbol must be present in constructor argument");if(this.symbol=t.symbol,void 0===t.boundingRect)throw new Error("boundingRect must be present in constructor argument");if(this.boundingRect={x:t.boundingRect.x,y:t.boundingRect.y,width:t.boundingRect.width,height:t.boundingRect.height},void 0===t.recognitionConfidence)throw new Error("recognitionConfidence must be present in constructor argument");this.recognitionConfidence=t.recognitionConfidence}}class Mt extends T.a{constructor(t={}){if(super(),this.confidence=0,this.validationSuccessful=!1,void 0===t.rawText)throw new Error("rawText must be present in constructor argument");if(this.rawText=t.rawText,void 0===t.wordBoxes)throw new Error("wordBoxes must be present in constructor argument");if(this.wordBoxes=t.wordBoxes.map((t=>new Bt(t))),void 0===t.symbolBoxes)throw new Error("symbolBoxes must be present in constructor argument");this.symbolBoxes=t.symbolBoxes.map((t=>new Wt(t))),void 0!==t.confidence&&(this.confidence=t.confidence),void 0!==t.validationSuccessful&&(this.validationSuccessful=t.validationSuccessful)}}!function(t){t.From=function(t){const e=t._type;switch(e){case"DefaultContentValidator":return new jt(t);case"PresetContentValidator":return new zt(t);case"PatternContentValidator":return new Nt(t);default:throw`Unknown child class name: ${e}`}}}(vt||(vt={}));class jt extends T.a{constructor(t={}){super(),this._type="DefaultContentValidator",this.allowedCharacters="",void 0!==t.allowedCharacters&&(this.allowedCharacters=t.allowedCharacters)}}class zt extends T.a{constructor(t={}){if(super(),this._type="PresetContentValidator",void 0===t.preset)throw new Error("preset must be present in constructor argument");this.preset=t.preset}}class Nt extends T.a{constructor(t={}){if(super(),this._type="PatternContentValidator",this.allowedCharacters="",this.matchSubstring=!1,void 0!==t.allowedCharacters&&(this.allowedCharacters=t.allowedCharacters),void 0===t.pattern)throw new Error("pattern must be present in constructor argument");this.pattern=t.pattern,void 0!==t.matchSubstring&&(this.matchSubstring=t.matchSubstring)}}class Vt extends T.a{constructor(t={}){super(),this.ocrResolutionLimit=0,this.maximumNumberOfAccumulatedFrames=3,this.minimumNumberOfRequiredFramesWithEqualRecognitionResult=2,this.validator=new jt({}),void 0!==t.ocrResolutionLimit&&(this.ocrResolutionLimit=t.ocrResolutionLimit),void 0!==t.maximumNumberOfAccumulatedFrames&&(this.maximumNumberOfAccumulatedFrames=t.maximumNumberOfAccumulatedFrames),void 0!==t.minimumNumberOfRequiredFramesWithEqualRecognitionResult&&(this.minimumNumberOfRequiredFramesWithEqualRecognitionResult=t.minimumNumberOfRequiredFramesWithEqualRecognitionResult),void 0!==t.validator&&(this.validator=vt.From(t.validator))}}class Ut extends T.a{constructor(t={}){super(),this.maximumNumberOfAccumulatedFrames=3,this.minimumNumberOfRequiredFramesWithEqualScanningResult=2,this.scannerStrategy="ML",void 0!==t.maximumNumberOfAccumulatedFrames&&(this.maximumNumberOfAccumulatedFrames=t.maximumNumberOfAccumulatedFrames),void 0!==t.minimumNumberOfRequiredFramesWithEqualScanningResult&&(this.minimumNumberOfRequiredFramesWithEqualScanningResult=t.minimumNumberOfRequiredFramesWithEqualScanningResult),void 0!==t.scannerStrategy&&(this.scannerStrategy=t.scannerStrategy)}}class Ht extends T.a{constructor(t={}){if(super(),this.confidence=0,this.validationSuccessful=!1,this.croppedImage=null,void 0===t.countryCode)throw new Error("countryCode must be present in constructor argument");if(this.countryCode=t.countryCode,void 0===t.licensePlate)throw new Error("licensePlate must be present in constructor argument");if(this.licensePlate=t.licensePlate,void 0===t.rawText)throw new Error("rawText must be present in constructor argument");this.rawText=t.rawText,void 0!==t.confidence&&(this.confidence=t.confidence),void 0!==t.validationSuccessful&&(this.validationSuccessful=t.validationSuccessful),void 0!==t.croppedImage&&(this.croppedImage=null!=t.croppedImage?t.croppedImage:null)}}class Gt extends T.a{constructor(t={}){super(),this.shouldCropDocument=!0,this.recognizePatientInfoBox=!0,this.recognizeBarcode=!0,this.extractCroppedImage=!1,this.preprocessInput=!1,void 0!==t.shouldCropDocument&&(this.shouldCropDocument=t.shouldCropDocument),void 0!==t.recognizePatientInfoBox&&(this.recognizePatientInfoBox=t.recognizePatientInfoBox),void 0!==t.recognizeBarcode&&(this.recognizeBarcode=t.recognizeBarcode),void 0!==t.extractCroppedImage&&(this.extractCroppedImage=t.extractCroppedImage),void 0!==t.preprocessInput&&(this.preprocessInput=t.preprocessInput)}}class Qt extends T.a{constructor(t={}){if(super(),this.type="UNKNOWN",this.checked=!1,this.checkedConfidence=0,void 0!==t.type&&(this.type=t.type),void 0!==t.checked&&(this.checked=t.checked),void 0!==t.checkedConfidence&&(this.checkedConfidence=t.checkedConfidence),void 0===t.quad)throw new Error("quad must be present in constructor argument");this.quad=t.quad.map((t=>({x:t.x,y:t.y})))}}class Zt extends T.a{constructor(t={}){if(super(),this.value="",this.rawString="",this.type="UNDEFINED",this.recognitionConfidence=0,void 0===t.quad)throw new Error("quad must be present in constructor argument");this.quad=t.quad.map((t=>({x:t.x,y:t.y}))),void 0!==t.value&&(this.value=t.value),void 0!==t.rawString&&(this.rawString=t.rawString),void 0!==t.type&&(this.type=t.type),void 0!==t.recognitionConfidence&&(this.recognitionConfidence=t.recognitionConfidence)}}class Yt extends T.a{constructor(t={}){if(super(),void 0===t.type)throw new Error("type must be present in constructor argument");if(this.type=t.type,void 0===t.value)throw new Error("value must be present in constructor argument");if(this.value=t.value,void 0===t.recognitionConfidence)throw new Error("recognitionConfidence must be present in constructor argument");this.recognitionConfidence=t.recognitionConfidence}}class qt extends T.a{constructor(t={}){if(super(),this.hasContents=!1,void 0===t.quad)throw new Error("quad must be present in constructor argument");if(this.quad=t.quad.map((t=>({x:t.x,y:t.y}))),void 0===t.fields)throw new Error("fields must be present in constructor argument");this.fields=t.fields.map((t=>new Yt(t))),void 0!==t.hasContents&&(this.hasContents=t.hasContents)}}class Xt extends T.a{constructor(t={}){if(super(),this.recognitionSuccessful=!1,this.formType="UNKNOWN",this.clockwiseRotations=0,this.croppedImage=null,this.scaleX=1,this.scaleY=1,void 0!==t.recognitionSuccessful&&(this.recognitionSuccessful=t.recognitionSuccessful),void 0===t.patientInfoBox)throw new Error("patientInfoBox must be present in constructor argument");if(this.patientInfoBox=new qt(t.patientInfoBox),void 0===t.checkBoxes)throw new Error("checkBoxes must be present in constructor argument");if(this.checkBoxes=t.checkBoxes.map((t=>new Qt(t))),void 0===t.dates)throw new Error("dates must be present in constructor argument");if(this.dates=t.dates.map((t=>new Zt(t))),void 0!==t.formType&&(this.formType=t.formType),void 0!==t.clockwiseRotations&&(this.clockwiseRotations=t.clockwiseRotations),void 0!==t.croppedImage&&(this.croppedImage=null!=t.croppedImage?t.croppedImage:null),void 0!==t.scaleX&&(this.scaleX=t.scaleX),void 0!==t.scaleY&&(this.scaleY=t.scaleY),void 0===t.documentRoi)throw new Error("documentRoi must be present in constructor argument");this.documentRoi=new Lt(t.documentRoi)}}class $t extends T.a{constructor(t={}){super(),this.maximumNumberOfAccumulatedFrames=3,this.minimumNumberOfRequiredFramesWithEqualRecognitionResult=2,void 0!==t.maximumNumberOfAccumulatedFrames&&(this.maximumNumberOfAccumulatedFrames=t.maximumNumberOfAccumulatedFrames),void 0!==t.minimumNumberOfRequiredFramesWithEqualRecognitionResult&&(this.minimumNumberOfRequiredFramesWithEqualRecognitionResult=t.minimumNumberOfRequiredFramesWithEqualRecognitionResult)}}class Kt extends T.a{constructor(t={}){if(super(),this.recognitionSuccessful=!1,void 0!==t.recognitionSuccessful&&(this.recognitionSuccessful=t.recognitionSuccessful),void 0===t.rawMRZ)throw new Error("rawMRZ must be present in constructor argument");if(this.rawMRZ=t.rawMRZ,void 0===t.document)throw new Error("document must be present in constructor argument");this.document=null!=t.document?new ut(t.document):null}}class Jt extends T.a{constructor(t={}){super(),this.accumulatedResultsVerifierConfig=new $t({}),void 0!==t.accumulatedResultsVerifierConfig&&(this.accumulatedResultsVerifierConfig=new $t(t.accumulatedResultsVerifierConfig))}}!function(t){t.From=function(t){const e=t._type;switch(e){case"Glyph":return new te(t);case"Word":return new ee(t);case"Line":return new ne(t);case"Block":return new ie(t);case"Page":return new oe(t);default:throw`Unknown child class name: ${e}`}}}(At||(At={}));class te extends T.a{constructor(t={}){if(super(),this._type="Glyph",void 0===t.text)throw new Error("text must be present in constructor argument");if(this.text=t.text,void 0===t.confidence)throw new Error("confidence must be present in constructor argument");if(this.confidence=t.confidence,void 0===t.roi)throw new Error("roi must be present in constructor argument");this.roi=t.roi.map((t=>({x:t.x,y:t.y})))}}class ee extends T.a{constructor(t={}){if(super(),this._type="Word",void 0===t.text)throw new Error("text must be present in constructor argument");if(this.text=t.text,void 0===t.confidence)throw new Error("confidence must be present in constructor argument");if(this.confidence=t.confidence,void 0===t.roi)throw new Error("roi must be present in constructor argument");if(this.roi=t.roi.map((t=>({x:t.x,y:t.y}))),void 0===t.glyphs)throw new Error("glyphs must be present in constructor argument");this.glyphs=t.glyphs.map((t=>new te(t)))}}class ne extends T.a{constructor(t={}){if(super(),this._type="Line",void 0===t.text)throw new Error("text must be present in constructor argument");if(this.text=t.text,void 0===t.confidence)throw new Error("confidence must be present in constructor argument");if(this.confidence=t.confidence,void 0===t.roi)throw new Error("roi must be present in constructor argument");if(this.roi=t.roi.map((t=>({x:t.x,y:t.y}))),void 0===t.words)throw new Error("words must be present in constructor argument");this.words=t.words.map((t=>new ee(t)))}}class ie extends T.a{constructor(t={}){if(super(),this._type="Block",void 0===t.text)throw new Error("text must be present in constructor argument");if(this.text=t.text,void 0===t.confidence)throw new Error("confidence must be present in constructor argument");if(this.confidence=t.confidence,void 0===t.roi)throw new Error("roi must be present in constructor argument");if(this.roi=t.roi.map((t=>({x:t.x,y:t.y}))),void 0===t.lines)throw new Error("lines must be present in constructor argument");this.lines=t.lines.map((t=>new ne(t)))}}class oe extends T.a{constructor(t={}){if(super(),this._type="Page",void 0===t.text)throw new Error("text must be present in constructor argument");if(this.text=t.text,void 0===t.confidence)throw new Error("confidence must be present in constructor argument");if(this.confidence=t.confidence,void 0===t.roi)throw new Error("roi must be present in constructor argument");if(this.roi=t.roi.map((t=>({x:t.x,y:t.y}))),void 0===t.blocks)throw new Error("blocks must be present in constructor argument");this.blocks=t.blocks.map((t=>new ie(t)))}}!function(t){t.From=function(t){const e=t._type;switch(e){case"ScanbotBinarizationFilter":return new re(t);case"CustomBinarizationFilter":return new ae(t);case"ColorDocumentFilter":return new se(t);case"BrightnessFilter":return new le(t);case"ContrastFilter":return new ce(t);case"GrayscaleFilter":return new ue(t);case"LegacyFilter":return new de(t);case"WhiteBlackPointFilter":return new he(t);default:throw`Unknown child class name: ${e}`}}}(bt||(bt={}));class re extends T.a{constructor(t={}){super(),this._type="ScanbotBinarizationFilter",this.outputMode="BINARY",void 0!==t.outputMode&&(this.outputMode=t.outputMode)}}class ae extends T.a{constructor(t={}){super(),this._type="CustomBinarizationFilter",this.outputMode="BINARY",this.denoise=.5,this.radius=32,this.preset="PRESET_4",void 0!==t.outputMode&&(this.outputMode=t.outputMode),void 0!==t.denoise&&(this.denoise=t.denoise),void 0!==t.radius&&(this.radius=t.radius),void 0!==t.preset&&(this.preset=t.preset)}}class se extends T.a{constructor(t={}){super(),this._type="ColorDocumentFilter"}}class le extends T.a{constructor(t={}){super(),this._type="BrightnessFilter",this.brightness=0,void 0!==t.brightness&&(this.brightness=t.brightness)}}class ce extends T.a{constructor(t={}){super(),this._type="ContrastFilter",this.contrast=0,void 0!==t.contrast&&(this.contrast=t.contrast)}}class ue extends T.a{constructor(t={}){super(),this._type="GrayscaleFilter",this.borderWidthFraction=.06,this.blackOutliersFraction=0,this.whiteOutliersFraction=.02,void 0!==t.borderWidthFraction&&(this.borderWidthFraction=t.borderWidthFraction),void 0!==t.blackOutliersFraction&&(this.blackOutliersFraction=t.blackOutliersFraction),void 0!==t.whiteOutliersFraction&&(this.whiteOutliersFraction=t.whiteOutliersFraction)}}class de extends T.a{constructor(t={}){super(),this._type="LegacyFilter",this.filterType=0,void 0!==t.filterType&&(this.filterType=t.filterType)}}class he extends T.a{constructor(t={}){super(),this._type="WhiteBlackPointFilter",this.blackPoint=0,this.whitePoint=1,void 0!==t.blackPoint&&(this.blackPoint=t.blackPoint),void 0!==t.whitePoint&&(this.whitePoint=t.whitePoint)}}class pe extends T.a{constructor(t={}){super(),this.author="Created with ❤️ with Scanbot SDK",this.creator="",this.title="",this.subject="",this.keywords="",void 0!==t.author&&(this.author=t.author),void 0!==t.creator&&(this.creator=t.creator),void 0!==t.title&&(this.title=t.title),void 0!==t.subject&&(this.subject=t.subject),void 0!==t.keywords&&(this.keywords=t.keywords)}}class fe extends T.a{constructor(t={}){super(),this.attributes=new pe({}),this.pageSize="A4",this.pageDirection="PORTRAIT",this.pageFit="FIT_IN",this.dpi=72,this.jpegQuality=80,this.resamplingMethod="NONE",void 0!==t.attributes&&(this.attributes=new pe(t.attributes)),void 0!==t.pageSize&&(this.pageSize=t.pageSize),void 0!==t.pageDirection&&(this.pageDirection=t.pageDirection),void 0!==t.pageFit&&(this.pageFit=t.pageFit),void 0!==t.dpi&&(this.dpi=t.dpi),void 0!==t.jpegQuality&&(this.jpegQuality=t.jpegQuality),void 0!==t.resamplingMethod&&(this.resamplingMethod=t.resamplingMethod)}}!function(t){t.From=function(t){const e=t._type;switch(e){case"UserFieldDoubleValue":return new me(t);case"UserFieldStringValue":return new ge(t);case"UserFieldIntValue":return new ve(t);default:throw`Unknown child class name: ${e}`}}}(yt||(yt={}));class me extends T.a{constructor(t={}){if(super(),this._type="UserFieldDoubleValue",void 0===t.value)throw new Error("value must be present in constructor argument");this.value=t.value}}class ge extends T.a{constructor(t={}){if(super(),this._type="UserFieldStringValue",void 0===t.value)throw new Error("value must be present in constructor argument");this.value=t.value}}class ve extends T.a{constructor(t={}){if(super(),this._type="UserFieldIntValue",void 0===t.value)throw new Error("value must be present in constructor argument");this.value=t.value}}class Ae extends T.a{constructor(t={}){if(super(),void 0===t.tag)throw new Error("tag must be present in constructor argument");if(this.tag=t.tag,void 0===t.name)throw new Error("name must be present in constructor argument");if(this.name=t.name,void 0===t.value)throw new Error("value must be present in constructor argument");this.value=yt.From(t.value)}}class be extends T.a{constructor(t={}){super(),this.compression="LZW",this.jpegQuality=80,this.zipCompressionLevel=6,this.dpi=72,this.userFields=[],this.binarizationFilter=null,void 0!==t.compression&&(this.compression=t.compression),void 0!==t.jpegQuality&&(this.jpegQuality=t.jpegQuality),void 0!==t.zipCompressionLevel&&(this.zipCompressionLevel=t.zipCompressionLevel),void 0!==t.dpi&&(this.dpi=t.dpi),void 0!==t.userFields&&(this.userFields=t.userFields.map((t=>new Ae(t)))),void 0!==t.binarizationFilter&&(this.binarizationFilter=null!=t.binarizationFilter?bt.From(t.binarizationFilter):null)}}(Ct=be||(be={})).defaultCompression="LZW",Ct.binaryDocumentOptimizedCompression="CCITTFAX4"},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var i=n(6);class o{constructor(t,e){this.width=t,this.height=e}isPortrait(){return this.height>this.width}ratio(t){return t?this.height/this.width:this.width/this.height}ratioDiff(t,e){return this.ratio(e)/t.ratio(e)}static isEmpty(t){return!t||(0===t.width||0===t.height)}static toPolygon(t){return[new i.a(0,0),new i.a(t.width,0),new i.a(t.width,t.height),new i.a(0,t.height)]}static fromHtmlElement(t){return t?new o(t.clientWidth,t.clientHeight):new o(0,0)}static fromJson(t){return new o(t.width,t.height)}static subtractFrom(t,e){return new o(t.width-e,t.height-e)}static empty(){return new o(0,0)}}},function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return a}));var i=n(0),o=n(5);function r(t){return{color:o.b.getColorValue(t.color),textShadow:t.useShadow?"1px 1px 2px":""}}function a(t){return t.config.visible?i.default.createElement("span",{ref:t.innerRef,style:Object.assign(Object.assign({},t.style),r(t.config))},o.b.getLocalizedBarcodeText(t.config.text)):null}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c})),n.d(e,"b",(function(){return u})),n.d(e,"c",(function(){return d}));var i=n(0),o=n(33),r=n(15);const a=n(22).a.svg`
2
+ !function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var o in n)("object"==typeof exports?exports:t)[o]=n[o]}}(window,(function(){return function(t){var e={};function n(o){if(e[o])return e[o].exports;var i=e[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(o,i,function(e){return t[e]}.bind(null,i));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=47)}([function(t,e,n){"use strict";n.r(e),n.d(e,"Component",(function(){return C})),n.d(e,"Fragment",(function(){return y})),n.d(e,"createContext",(function(){return G})),n.d(e,"createElement",(function(){return v})),n.d(e,"createRef",(function(){return b})),n.d(e,"useCallback",(function(){return pt})),n.d(e,"useContext",(function(){return mt})),n.d(e,"useDebugValue",(function(){return gt})),n.d(e,"useEffect",(function(){return ct})),n.d(e,"useErrorBoundary",(function(){return vt})),n.d(e,"useId",(function(){return At})),n.d(e,"useImperativeHandle",(function(){return ht})),n.d(e,"useLayoutEffect",(function(){return ut})),n.d(e,"useMemo",(function(){return ft})),n.d(e,"useReducer",(function(){return lt})),n.d(e,"useRef",(function(){return dt})),n.d(e,"useState",(function(){return st})),n.d(e,"Children",(function(){return Ft})),n.d(e,"PureComponent",(function(){return Ot})),n.d(e,"StrictMode",(function(){return ye})),n.d(e,"Suspense",(function(){return jt})),n.d(e,"SuspenseList",(function(){return Vt})),n.d(e,"__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED",(function(){return ue})),n.d(e,"cloneElement",(function(){return me})),n.d(e,"createFactory",(function(){return he})),n.d(e,"createPortal",(function(){return Qt})),n.d(e,"default",(function(){return Oe})),n.d(e,"findDOMNode",(function(){return ve})),n.d(e,"flushSync",(function(){return be})),n.d(e,"forwardRef",(function(){return Pt})),n.d(e,"hydrate",(function(){return te})),n.d(e,"isElement",(function(){return Ee})),n.d(e,"isFragment",(function(){return pe})),n.d(e,"isValidElement",(function(){return fe})),n.d(e,"lazy",(function(){return Nt})),n.d(e,"memo",(function(){return Tt})),n.d(e,"render",(function(){return Jt})),n.d(e,"startTransition",(function(){return Ce})),n.d(e,"unmountComponentAtNode",(function(){return ge})),n.d(e,"unstable_batchedUpdates",(function(){return Ae})),n.d(e,"useDeferredValue",(function(){return Se})),n.d(e,"useInsertionEffect",(function(){return xe})),n.d(e,"useSyncExternalStore",(function(){return Le})),n.d(e,"useTransition",(function(){return we})),n.d(e,"version",(function(){return de}));var o,i,r,a,s,l,c,u,d={},h=[],f=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,p=Array.isArray;function m(t,e){for(var n in e)t[n]=e[n];return t}function g(t){var e=t.parentNode;e&&e.removeChild(t)}function v(t,e,n){var i,r,a,s={};for(a in e)"key"==a?i=e[a]:"ref"==a?r=e[a]:s[a]=e[a];if(arguments.length>2&&(s.children=arguments.length>3?o.call(arguments,2):n),"function"==typeof t&&null!=t.defaultProps)for(a in t.defaultProps)void 0===s[a]&&(s[a]=t.defaultProps[a]);return A(t,s,i,r,null)}function A(t,e,n,o,a){var s={type:t,props:e,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==a?++r:a,__i:-1,__u:0};return null==a&&null!=i.vnode&&i.vnode(s),s}function b(){return{current:null}}function y(t){return t.children}function C(t,e){this.props=t,this.context=e}function S(t,e){if(null==e)return t.__?S(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e)return n.__e;return"function"==typeof t.type?S(t):null}function w(t,e,n){var o,r=t.__v,a=r.__e,s=t.__P;if(s)return(o=m({},r)).__v=r.__v+1,i.vnode&&i.vnode(o),I(s,o,r,t.__n,void 0!==s.ownerSVGElement,32&r.__u?[a]:null,e,null==a?S(r):a,!!(32&r.__u),n),o.__v=r.__v,o.__.__k[o.__i]=o,o.__d=void 0,o.__e!=a&&x(o),o}function x(t){var e,n;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e){t.__e=t.__c.base=n.__e;break}return x(t)}}function E(t){(!t.__d&&(t.__d=!0)&&a.push(t)&&!L.__r++||s!==i.debounceRendering)&&((s=i.debounceRendering)||l)(L)}function L(){var t,e,n,o=[],r=[];for(a.sort(c);t=a.shift();)t.__d&&(n=a.length,e=w(t,o,r)||e,0===n||a.length>n?(W(o,e,r),r.length=o.length=0,e=void 0,a.sort(c)):e&&i.__c&&i.__c(e,h));e&&W(o,e,r),L.__r=0}function _(t,e,n,o,i,r,a,s,l,c,u){var f,p,m,g,v,A=o&&o.__k||h,b=e.length;for(n.__d=l,O(n,e,A),l=n.__d,f=0;f<b;f++)null!=(m=n.__k[f])&&"boolean"!=typeof m&&"function"!=typeof m&&(p=-1===m.__i?d:A[m.__i]||d,m.__i=f,I(t,m,p,i,r,a,s,l,c,u),g=m.__e,m.ref&&p.ref!=m.ref&&(p.ref&&j(p.ref,null,m),u.push(m.ref,m.__c||g,m)),null==v&&null!=g&&(v=g),65536&m.__u||p.__k===m.__k?l=T(m,l,t):"function"==typeof m.type&&void 0!==m.__d?l=m.__d:g&&(l=g.nextSibling),m.__d=void 0,m.__u&=-196609);n.__d=l,n.__e=v}function O(t,e,n){var o,i,r,a,s,l=e.length,c=n.length,u=c,d=0;for(t.__k=[],o=0;o<l;o++)null!=(i=t.__k[o]=null==(i=e[o])||"boolean"==typeof i||"function"==typeof i?null:"string"==typeof i||"number"==typeof i||"bigint"==typeof i||i.constructor==String?A(null,i,null,null,i):p(i)?A(y,{children:i},null,null,null):void 0===i.constructor&&i.__b>0?A(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)?(i.__=t,i.__b=t.__b+1,s=D(i,n,a=o+d,u),i.__i=s,r=null,-1!==s&&(u--,(r=n[s])&&(r.__u|=131072)),null==r||null===r.__v?(-1==s&&d--,"function"!=typeof i.type&&(i.__u|=65536)):s!==a&&(s===a+1?d++:s>a?u>l-a?d+=s-a:d--:d=s<a&&s==a-1?s-a:0,s!==o+d&&(i.__u|=65536))):(r=n[o])&&null==r.key&&r.__e&&0==(131072&r.__u)&&(r.__e==t.__d&&(t.__d=S(r)),z(r,r,!1),n[o]=null,u--);if(u)for(o=0;o<c;o++)null!=(r=n[o])&&0==(131072&r.__u)&&(r.__e==t.__d&&(t.__d=S(r)),z(r,r))}function T(t,e,n){var o,i;if("function"==typeof t.type){for(o=t.__k,i=0;o&&i<o.length;i++)o[i]&&(o[i].__=t,e=T(o[i],e,n));return e}t.__e!=e&&(n.insertBefore(t.__e,e||null),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8===e.nodeType);return e}function k(t,e){return e=e||[],null==t||"boolean"==typeof t||(p(t)?t.some((function(t){k(t,e)})):e.push(t)),e}function D(t,e,n,o){var i=t.key,r=t.type,a=n-1,s=n+1,l=e[n];if(null===l||l&&i==l.key&&r===l.type)return n;if(o>(null!=l&&0==(131072&l.__u)?1:0))for(;a>=0||s<e.length;){if(a>=0){if((l=e[a])&&0==(131072&l.__u)&&i==l.key&&r===l.type)return a;a--}if(s<e.length){if((l=e[s])&&0==(131072&l.__u)&&i==l.key&&r===l.type)return s;s++}}return-1}function P(t,e,n){"-"===e[0]?t.setProperty(e,null==n?"":n):t[e]=null==n?"":"number"!=typeof n||f.test(e)?n:n+"px"}function B(t,e,n,o,i){var r;t:if("style"===e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof o&&(t.style.cssText=o=""),o)for(e in o)n&&e in n||P(t.style,e,"");if(n)for(e in n)o&&n[e]===o[e]||P(t.style,e,n[e])}else if("o"===e[0]&&"n"===e[1])r=e!==(e=e.replace(/(PointerCapture)$|Capture$/i,"$1")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+r]=n,n?o?n.u=o.u:(n.u=Date.now(),t.addEventListener(e,r?R:F,r)):t.removeEventListener(e,r?R:F,r);else{if(i)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==e&&"height"!==e&&"href"!==e&&"list"!==e&&"form"!==e&&"tabIndex"!==e&&"download"!==e&&"rowSpan"!==e&&"colSpan"!==e&&"role"!==e&&e in t)try{t[e]=null==n?"":n;break t}catch(t){}"function"==typeof n||(null==n||!1===n&&"-"!==e[4]?t.removeAttribute(e):t.setAttribute(e,n))}}function F(t){if(this.l){var e=this.l[t.type+!1];if(t.t){if(t.t<=e.u)return}else t.t=Date.now();return e(i.event?i.event(t):t)}}function R(t){if(this.l)return this.l[t.type+!0](i.event?i.event(t):t)}function I(t,e,n,o,r,a,s,l,c,u){var d,h,f,g,v,A,b,S,w,x,E,L,O,T,k,D=e.type;if(void 0!==e.constructor)return null;128&n.__u&&(c=!!(32&n.__u),a=[l=e.__e=n.__e]),(d=i.__b)&&d(e);t:if("function"==typeof D)try{if(S=e.props,w=(d=D.contextType)&&o[d.__c],x=d?w?w.props.value:d.__:o,n.__c?b=(h=e.__c=n.__c).__=h.__E:("prototype"in D&&D.prototype.render?e.__c=h=new D(S,x):(e.__c=h=new C(S,x),h.constructor=D,h.render=N),w&&w.sub(h),h.props=S,h.state||(h.state={}),h.context=x,h.__n=o,f=h.__d=!0,h.__h=[],h._sb=[]),null==h.__s&&(h.__s=h.state),null!=D.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=m({},h.__s)),m(h.__s,D.getDerivedStateFromProps(S,h.__s))),g=h.props,v=h.state,h.__v=e,f)null==D.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(null==D.getDerivedStateFromProps&&S!==g&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(S,x),!h.__e&&(null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(S,h.__s,x)||e.__v===n.__v)){for(e.__v!==n.__v&&(h.props=S,h.state=h.__s,h.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.forEach((function(t){t&&(t.__=e)})),E=0;E<h._sb.length;E++)h.__h.push(h._sb[E]);h._sb=[],h.__h.length&&s.push(h);break t}null!=h.componentWillUpdate&&h.componentWillUpdate(S,h.__s,x),null!=h.componentDidUpdate&&h.__h.push((function(){h.componentDidUpdate(g,v,A)}))}if(h.context=x,h.props=S,h.__P=t,h.__e=!1,L=i.__r,O=0,"prototype"in D&&D.prototype.render){for(h.state=h.__s,h.__d=!1,L&&L(e),d=h.render(h.props,h.state,h.context),T=0;T<h._sb.length;T++)h.__h.push(h._sb[T]);h._sb=[]}else do{h.__d=!1,L&&L(e),d=h.render(h.props,h.state,h.context),h.state=h.__s}while(h.__d&&++O<25);h.state=h.__s,null!=h.getChildContext&&(o=m(m({},o),h.getChildContext())),f||null==h.getSnapshotBeforeUpdate||(A=h.getSnapshotBeforeUpdate(g,v)),_(t,p(k=null!=d&&d.type===y&&null==d.key?d.props.children:d)?k:[k],e,n,o,r,a,s,l,c,u),h.base=e.__e,e.__u&=-161,h.__h.length&&s.push(h),b&&(h.__E=h.__=null)}catch(t){e.__v=null,c||null!=a?(e.__e=l,e.__u|=c?160:32,a[a.indexOf(l)]=null):(e.__e=n.__e,e.__k=n.__k),i.__e(t,e,n)}else null==a&&e.__v===n.__v?(e.__k=n.__k,e.__e=n.__e):e.__e=M(n.__e,e,n,o,r,a,s,c,u);(d=i.diffed)&&d(e)}function W(t,e,n){for(var o=0;o<n.length;o++)j(n[o],n[++o],n[++o]);i.__c&&i.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){i.__e(t,e.__v)}}))}function M(t,e,n,i,r,a,s,l,c){var u,h,f,m,v,A,b,y=n.props,C=e.props,w=e.type;if("svg"===w&&(r=!0),null!=a)for(u=0;u<a.length;u++)if((v=a[u])&&"setAttribute"in v==!!w&&(w?v.localName===w:3===v.nodeType)){t=v,a[u]=null;break}if(null==t){if(null===w)return document.createTextNode(C);t=r?document.createElementNS("http://www.w3.org/2000/svg",w):document.createElement(w,C.is&&C),a=null,l=!1}if(null===w)y===C||l&&t.data===C||(t.data=C);else{if(a=a&&o.call(t.childNodes),y=n.props||d,!l&&null!=a)for(y={},u=0;u<t.attributes.length;u++)y[(v=t.attributes[u]).name]=v.value;for(u in y)v=y[u],"children"==u||("dangerouslySetInnerHTML"==u?f=v:"key"===u||u in C||B(t,u,null,v,r));for(u in C)v=C[u],"children"==u?m=v:"dangerouslySetInnerHTML"==u?h=v:"value"==u?A=v:"checked"==u?b=v:"key"===u||l&&"function"!=typeof v||y[u]===v||B(t,u,v,y[u],r);if(h)l||f&&(h.__html===f.__html||h.__html===t.innerHTML)||(t.innerHTML=h.__html),e.__k=[];else if(f&&(t.innerHTML=""),_(t,p(m)?m:[m],e,n,i,r&&"foreignObject"!==w,a,s,a?a[0]:n.__k&&S(n,0),l,c),null!=a)for(u=a.length;u--;)null!=a[u]&&g(a[u]);l||(u="value",void 0!==A&&(A!==t[u]||"progress"===w&&!A||"option"===w&&A!==y[u])&&B(t,u,A,y[u],!1),u="checked",void 0!==b&&b!==t[u]&&B(t,u,b,y[u],!1))}return t}function j(t,e,n){try{"function"==typeof t?t(e):t.current=e}catch(t){i.__e(t,n)}}function z(t,e,n){var o,r;if(i.unmount&&i.unmount(t),(o=t.ref)&&(o.current&&o.current!==t.__e||j(o,null,e)),null!=(o=t.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(t){i.__e(t,e)}o.base=o.__P=null,t.__c=void 0}if(o=t.__k)for(r=0;r<o.length;r++)o[r]&&z(o[r],e,n||"function"!=typeof t.type);n||null==t.__e||g(t.__e),t.__=t.__e=t.__d=void 0}function N(t,e,n){return this.constructor(t,n)}function V(t,e,n){var r,a,s,l;i.__&&i.__(t,e),a=(r="function"==typeof n)?null:n&&n.__k||e.__k,s=[],l=[],I(e,t=(!r&&n||e).__k=v(y,null,[t]),a||d,d,void 0!==e.ownerSVGElement,!r&&n?[n]:a?null:e.firstChild?o.call(e.childNodes):null,s,!r&&n?n:a?a.__e:e.firstChild,r,l),t.__d=void 0,W(s,t,l)}function U(t,e){V(t,e,U)}function H(t,e,n){var i,r,a,s,l=m({},t.props);for(a in t.type&&t.type.defaultProps&&(s=t.type.defaultProps),e)"key"==a?i=e[a]:"ref"==a?r=e[a]:l[a]=void 0===e[a]&&void 0!==s?s[a]:e[a];return arguments.length>2&&(l.children=arguments.length>3?o.call(arguments,2):n),A(t.type,l,i||t.key,r||t.ref,null)}function G(t,e){var n={__c:e="__cC"+u++,__:t,Consumer:function(t,e){return t.children(e)},Provider:function(t){var n,o;return this.getChildContext||(n=[],(o={})[e]=this,this.getChildContext=function(){return o},this.shouldComponentUpdate=function(t){this.props.value!==t.value&&n.some((function(t){t.__e=!0,E(t)}))},this.sub=function(t){n.push(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){n.splice(n.indexOf(t),1),e&&e.call(t)}}),t.children}};return n.Provider.__=n.Consumer.contextType=n}o=h.slice,i={__e:function(t,e,n,o){for(var i,r,a;e=e.__;)if((i=e.__c)&&!i.__)try{if((r=i.constructor)&&null!=r.getDerivedStateFromError&&(i.setState(r.getDerivedStateFromError(t)),a=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(t,o||{}),a=i.__d),a)return i.__E=i}catch(e){t=e}throw t}},r=0,C.prototype.setState=function(t,e){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=m({},this.state),"function"==typeof t&&(t=t(m({},n),this.props)),t&&m(n,t),null!=t&&this.__v&&(e&&this._sb.push(e),E(this))},C.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),E(this))},C.prototype.render=y,a=[],l="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,c=function(t,e){return t.__v.__b-e.__v.__b},L.__r=0,u=0;var Q,Y,Z,q,X=0,$=[],K=[],J=i,tt=J.__b,et=J.__r,nt=J.diffed,ot=J.__c,it=J.unmount,rt=J.__;function at(t,e){J.__h&&J.__h(Y,t,X||e),X=0;var n=Y.__H||(Y.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({__V:K}),n.__[t]}function st(t){return X=1,lt(Et,t)}function lt(t,e,n){var o=at(Q++,2);if(o.t=t,!o.__c&&(o.__=[n?n(e):Et(void 0,e),function(t){var e=o.__N?o.__N[0]:o.__[0],n=o.t(e,t);e!==n&&(o.__N=[n,o.__[1]],o.__c.setState({}))}],o.__c=Y,!Y.u)){var i=function(t,e,n){if(!o.__c.__H)return!0;var i=o.__c.__H.__.filter((function(t){return!!t.__c}));if(i.every((function(t){return!t.__N})))return!r||r.call(this,t,e,n);var a=!1;return i.forEach((function(t){if(t.__N){var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(a=!0)}})),!(!a&&o.__c.props===t)&&(!r||r.call(this,t,e,n))};Y.u=!0;var r=Y.shouldComponentUpdate,a=Y.componentWillUpdate;Y.componentWillUpdate=function(t,e,n){if(this.__e){var o=r;r=void 0,i(t,e,n),r=o}a&&a.call(this,t,e,n)},Y.shouldComponentUpdate=i}return o.__N||o.__}function ct(t,e){var n=at(Q++,3);!J.__s&&xt(n.__H,e)&&(n.__=t,n.i=e,Y.__H.__h.push(n))}function ut(t,e){var n=at(Q++,4);!J.__s&&xt(n.__H,e)&&(n.__=t,n.i=e,Y.__h.push(n))}function dt(t){return X=5,ft((function(){return{current:t}}),[])}function ht(t,e,n){X=6,ut((function(){return"function"==typeof t?(t(e()),function(){return t(null)}):t?(t.current=e(),function(){return t.current=null}):void 0}),null==n?n:n.concat(t))}function ft(t,e){var n=at(Q++,7);return xt(n.__H,e)?(n.__V=t(),n.i=e,n.__h=t,n.__V):n.__}function pt(t,e){return X=8,ft((function(){return t}),e)}function mt(t){var e=Y.context[t.__c],n=at(Q++,9);return n.c=t,e?(null==n.__&&(n.__=!0,e.sub(Y)),e.props.value):t.__}function gt(t,e){J.useDebugValue&&J.useDebugValue(e?e(t):t)}function vt(t){var e=at(Q++,10),n=st();return e.__=t,Y.componentDidCatch||(Y.componentDidCatch=function(t,o){e.__&&e.__(t,o),n[1](t)}),[n[0],function(){n[1](void 0)}]}function At(){var t=at(Q++,11);if(!t.__){for(var e=Y.__v;null!==e&&!e.__m&&null!==e.__;)e=e.__;var n=e.__m||(e.__m=[0,0]);t.__="P"+n[0]+"-"+n[1]++}return t.__}function bt(){for(var t;t=$.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(St),t.__H.__h.forEach(wt),t.__H.__h=[]}catch(e){t.__H.__h=[],J.__e(e,t.__v)}}J.__b=function(t){Y=null,tt&&tt(t)},J.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),rt&&rt(t,e)},J.__r=function(t){et&&et(t),Q=0;var e=(Y=t.__c).__H;e&&(Z===Y?(e.__h=[],Y.__h=[],e.__.forEach((function(t){t.__N&&(t.__=t.__N),t.__V=K,t.__N=t.i=void 0}))):(e.__h.forEach(St),e.__h.forEach(wt),e.__h=[],Q=0)),Z=Y},J.diffed=function(t){nt&&nt(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==$.push(e)&&q===J.requestAnimationFrame||((q=J.requestAnimationFrame)||Ct)(bt)),e.__H.__.forEach((function(t){t.i&&(t.__H=t.i),t.__V!==K&&(t.__=t.__V),t.i=void 0,t.__V=K}))),Z=Y=null},J.__c=function(t,e){e.some((function(t){try{t.__h.forEach(St),t.__h=t.__h.filter((function(t){return!t.__||wt(t)}))}catch(n){e.some((function(t){t.__h&&(t.__h=[])})),e=[],J.__e(n,t.__v)}})),ot&&ot(t,e)},J.unmount=function(t){it&&it(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach((function(t){try{St(t)}catch(t){e=t}})),n.__H=void 0,e&&J.__e(e,n.__v))};var yt="function"==typeof requestAnimationFrame;function Ct(t){var e,n=function(){clearTimeout(o),yt&&cancelAnimationFrame(e),setTimeout(t)},o=setTimeout(n,100);yt&&(e=requestAnimationFrame(n))}function St(t){var e=Y,n=t.__c;"function"==typeof n&&(t.__c=void 0,n()),Y=e}function wt(t){var e=Y;t.__c=t.__(),Y=e}function xt(t,e){return!t||t.length!==e.length||e.some((function(e,n){return e!==t[n]}))}function Et(t,e){return"function"==typeof e?e(t):e}function Lt(t,e){for(var n in e)t[n]=e[n];return t}function _t(t,e){for(var n in t)if("__source"!==n&&!(n in e))return!0;for(var o in e)if("__source"!==o&&t[o]!==e[o])return!0;return!1}function Ot(t,e){this.props=t,this.context=e}function Tt(t,e){function n(t){var n=this.props.ref,o=n==t.ref;return!o&&n&&(n.call?n(null):n.current=null),e?!e(this.props,t)||!o:_t(this.props,t)}function o(e){return this.shouldComponentUpdate=n,v(t,e)}return o.displayName="Memo("+(t.displayName||t.name)+")",o.prototype.isReactComponent=!0,o.__f=!0,o}(Ot.prototype=new C).isPureReactComponent=!0,Ot.prototype.shouldComponentUpdate=function(t,e){return _t(this.props,t)||_t(this.state,e)};var kt=i.__b;i.__b=function(t){t.type&&t.type.__f&&t.ref&&(t.props.ref=t.ref,t.ref=null),kt&&kt(t)};var Dt="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function Pt(t){function e(e){var n=Lt({},e);return delete n.ref,t(n,e.ref||null)}return e.$$typeof=Dt,e.render=e,e.prototype.isReactComponent=e.__f=!0,e.displayName="ForwardRef("+(t.displayName||t.name)+")",e}var Bt=function(t,e){return null==t?null:k(k(t).map(e))},Ft={map:Bt,forEach:Bt,count:function(t){return t?k(t).length:0},only:function(t){var e=k(t);if(1!==e.length)throw"Children.only";return e[0]},toArray:k},Rt=i.__e;i.__e=function(t,e,n,o){if(t.then)for(var i,r=e;r=r.__;)if((i=r.__c)&&i.__c)return null==e.__e&&(e.__e=n.__e,e.__k=n.__k),i.__c(t,e);Rt(t,e,n,o)};var It=i.unmount;function Wt(t,e,n){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach((function(t){"function"==typeof t.__c&&t.__c()})),t.__c.__H=null),null!=(t=Lt({},t)).__c&&(t.__c.__P===n&&(t.__c.__P=e),t.__c=null),t.__k=t.__k&&t.__k.map((function(t){return Wt(t,e,n)}))),t}function Mt(t,e,n){return t&&n&&(t.__v=null,t.__k=t.__k&&t.__k.map((function(t){return Mt(t,e,n)})),t.__c&&t.__c.__P===e&&(t.__e&&n.appendChild(t.__e),t.__c.__e=!0,t.__c.__P=n)),t}function jt(){this.__u=0,this.t=null,this.__b=null}function zt(t){var e=t.__.__c;return e&&e.__a&&e.__a(t)}function Nt(t){var e,n,o;function i(i){if(e||(e=t()).then((function(t){n=t.default||t}),(function(t){o=t})),o)throw o;if(!n)throw e;return v(n,i)}return i.displayName="Lazy",i.__f=!0,i}function Vt(){this.u=null,this.o=null}i.unmount=function(t){var e=t.__c;e&&e.__R&&e.__R(),e&&32&t.__u&&(t.type=null),It&&It(t)},(jt.prototype=new C).__c=function(t,e){var n=e.__c,o=this;null==o.t&&(o.t=[]),o.t.push(n);var i=zt(o.__v),r=!1,a=function(){r||(r=!0,n.__R=null,i?i(s):s())};n.__R=a;var s=function(){if(!--o.__u){if(o.state.__a){var t=o.state.__a;o.__v.__k[0]=Mt(t,t.__c.__P,t.__c.__O)}var e;for(o.setState({__a:o.__b=null});e=o.t.pop();)e.forceUpdate()}};o.__u++||32&e.__u||o.setState({__a:o.__b=o.__v.__k[0]}),t.then(a,a)},jt.prototype.componentWillUnmount=function(){this.t=[]},jt.prototype.render=function(t,e){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=Wt(this.__b,n,o.__O=o.__P)}this.__b=null}var i=e.__a&&v(y,null,t.fallback);return i&&(i.__u&=-33),[v(y,null,e.__a?null:t.children),i]};var Ut=function(t,e,n){if(++n[1]===n[0]&&t.o.delete(e),t.props.revealOrder&&("t"!==t.props.revealOrder[0]||!t.o.size))for(n=t.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;t.u=n=n[2]}};function Ht(t){return this.getChildContext=function(){return t.context},t.children}function Gt(t){var e=this,n=t.i;e.componentWillUnmount=function(){V(null,e.l),e.l=null,e.i=null},e.i&&e.i!==n&&e.componentWillUnmount(),e.l||(e.i=n,e.l={nodeType:1,parentNode:n,childNodes:[],appendChild:function(t){this.childNodes.push(t),e.i.appendChild(t)},insertBefore:function(t,n){this.childNodes.push(t),e.i.appendChild(t)},removeChild:function(t){this.childNodes.splice(this.childNodes.indexOf(t)>>>1,1),e.i.removeChild(t)}}),V(v(Ht,{context:e.context},t.__v),e.l)}function Qt(t,e){var n=v(Gt,{__v:t,i:e});return n.containerInfo=e,n}(Vt.prototype=new C).__a=function(t){var e=this,n=zt(e.__v),o=e.o.get(t);return o[0]++,function(i){var r=function(){e.props.revealOrder?(o.push(i),Ut(e,t,o)):i()};n?n(r):r()}},Vt.prototype.render=function(t){this.u=null,this.o=new Map;var e=k(t.children);t.revealOrder&&"b"===t.revealOrder[0]&&e.reverse();for(var n=e.length;n--;)this.o.set(e[n],this.u=[1,0,this.u]);return t.children},Vt.prototype.componentDidUpdate=Vt.prototype.componentDidMount=function(){var t=this;this.o.forEach((function(e,n){Ut(t,n,e)}))};var Yt="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,Zt=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,qt=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Xt=/[A-Z0-9]/g,$t="undefined"!=typeof document,Kt=function(t){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(t)};function Jt(t,e,n){return null==e.__k&&(e.textContent=""),V(t,e),"function"==typeof n&&n(),t?t.__c:null}function te(t,e,n){return U(t,e),"function"==typeof n&&n(),t?t.__c:null}C.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(t){Object.defineProperty(C.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}));var ee=i.event;function ne(){}function oe(){return this.cancelBubble}function ie(){return this.defaultPrevented}i.event=function(t){return ee&&(t=ee(t)),t.persist=ne,t.isPropagationStopped=oe,t.isDefaultPrevented=ie,t.nativeEvent=t};var re,ae={enumerable:!1,configurable:!0,get:function(){return this.class}},se=i.vnode;i.vnode=function(t){"string"==typeof t.type&&function(t){var e=t.props,n=t.type,o={};for(var i in e){var r=e[i];if(!("value"===i&&"defaultValue"in e&&null==r||$t&&"children"===i&&"noscript"===n||"class"===i||"className"===i)){var a=i.toLowerCase();"defaultValue"===i&&"value"in e&&null==e.value?i="value":"download"===i&&!0===r?r="":"translate"===a&&"no"===r?r=!1:"ondoubleclick"===a?i="ondblclick":"onchange"!==a||"input"!==n&&"textarea"!==n||Kt(e.type)?"onfocus"===a?i="onfocusin":"onblur"===a?i="onfocusout":qt.test(i)?i=a:-1===n.indexOf("-")&&Zt.test(i)?i=i.replace(Xt,"-$&").toLowerCase():null===r&&(r=void 0):a=i="oninput","oninput"===a&&o[i=a]&&(i="oninputCapture"),o[i]=r}}"select"==n&&o.multiple&&Array.isArray(o.value)&&(o.value=k(e.children).forEach((function(t){t.props.selected=-1!=o.value.indexOf(t.props.value)}))),"select"==n&&null!=o.defaultValue&&(o.value=k(e.children).forEach((function(t){t.props.selected=o.multiple?-1!=o.defaultValue.indexOf(t.props.value):o.defaultValue==t.props.value}))),e.class&&!e.className?(o.class=e.class,Object.defineProperty(o,"className",ae)):(e.className&&!e.class||e.class&&e.className)&&(o.class=o.className=e.className),t.props=o}(t),t.$$typeof=Yt,se&&se(t)};var le=i.__r;i.__r=function(t){le&&le(t),re=t.__c};var ce=i.diffed;i.diffed=function(t){ce&&ce(t);var e=t.props,n=t.__e;null!=n&&"textarea"===t.type&&"value"in e&&e.value!==n.value&&(n.value=null==e.value?"":e.value),re=null};var ue={ReactCurrentDispatcher:{current:{readContext:function(t){return re.__n[t.__c].props.value}}}},de="17.0.2";function he(t){return v.bind(null,t)}function fe(t){return!!t&&t.$$typeof===Yt}function pe(t){return fe(t)&&t.type===y}function me(t){return fe(t)?H.apply(null,arguments):t}function ge(t){return!!t.__k&&(V(null,t),!0)}function ve(t){return t&&(t.base||1===t.nodeType&&t)||null}var Ae=function(t,e){return t(e)},be=function(t,e){return t(e)},ye=y;function Ce(t){t()}function Se(t){return t}function we(){return[!1,Ce]}var xe=ut,Ee=fe;function Le(t,e){var n=e(),o=st({h:{__:n,v:e}}),i=o[0].h,r=o[1];return ut((function(){i.__=n,i.v=e,_e(i)&&r({h:i})}),[t,n,e]),ct((function(){return _e(i)&&r({h:i}),t((function(){_e(i)&&r({h:i})}))}),[t]),n}function _e(t){var e,n,o=t.v,i=t.__;try{var r=o();return!((e=i)===(n=r)&&(0!==e||1/e==1/n)||e!=e&&n!=n)}catch(t){return!0}}var Oe={useState:st,useId:At,useReducer:lt,useEffect:ct,useLayoutEffect:ut,useInsertionEffect:ut,useTransition:we,useDeferredValue:Se,useSyncExternalStore:Le,startTransition:Ce,useRef:dt,useImperativeHandle:ht,useMemo:ft,useCallback:pt,useContext:mt,useDebugValue:gt,version:"17.0.2",Children:Ft,render:Jt,hydrate:te,unmountComponentAtNode:ge,createPortal:Qt,createElement:v,createContext:G,createFactory:he,cloneElement:me,createRef:b,Fragment:y,isValidElement:fe,isElement:fe,isFragment:pe,findDOMNode:ve,Component:C,PureComponent:Ot,memo:Tt,forwardRef:Pt,flushSync:be,unstable_batchedUpdates:Ae,StrictMode:y,Suspense:jt,SuspenseList:Vt,lazy:Nt,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:ue}},function(t,e,n){"use strict";n.d(e,"f",(function(){return i})),n.d(e,"j",(function(){return r})),n.d(e,"e",(function(){return a})),n.d(e,"g",(function(){return s})),n.d(e,"a",(function(){return l})),n.d(e,"d",(function(){return c})),n.d(e,"h",(function(){return u})),n.d(e,"b",(function(){return d})),n.d(e,"c",(function(){return h})),n.d(e,"i",(function(){return f})),n.d(e,"l",(function(){return p})),n.d(e,"k",(function(){return m}));var o=n(7);class i extends o.a{constructor(t={}){super(),this.sbColorPrimary="#C8193C",this.sbColorPrimaryDisabled="#F5F5F5",this.sbColorNegative="#FF3737",this.sbColorPositive="#4EFFB4",this.sbColorWarning="#FFCE5C",this.sbColorSecondary="#FFEDEE",this.sbColorSecondaryDisabled="#F5F5F5",this.sbColorOnPrimary="#FFFFFF",this.sbColorOnSecondary="#C8193C",this.sbColorSurface="#FFFFFF",this.sbColorOutline="#EFEFEF",this.sbColorOnSurfaceVariant="#707070",this.sbColorOnSurface="#000000",this.sbColorSurfaceLow="#00000026",this.sbColorSurfaceHigh="#0000007A",this.sbColorModalOverlay="#000000A3",void 0!==t.sbColorPrimary&&(this.sbColorPrimary=t.sbColorPrimary),void 0!==t.sbColorPrimaryDisabled&&(this.sbColorPrimaryDisabled=t.sbColorPrimaryDisabled),void 0!==t.sbColorNegative&&(this.sbColorNegative=t.sbColorNegative),void 0!==t.sbColorPositive&&(this.sbColorPositive=t.sbColorPositive),void 0!==t.sbColorWarning&&(this.sbColorWarning=t.sbColorWarning),void 0!==t.sbColorSecondary&&(this.sbColorSecondary=t.sbColorSecondary),void 0!==t.sbColorSecondaryDisabled&&(this.sbColorSecondaryDisabled=t.sbColorSecondaryDisabled),void 0!==t.sbColorOnPrimary&&(this.sbColorOnPrimary=t.sbColorOnPrimary),void 0!==t.sbColorOnSecondary&&(this.sbColorOnSecondary=t.sbColorOnSecondary),void 0!==t.sbColorSurface&&(this.sbColorSurface=t.sbColorSurface),void 0!==t.sbColorOutline&&(this.sbColorOutline=t.sbColorOutline),void 0!==t.sbColorOnSurfaceVariant&&(this.sbColorOnSurfaceVariant=t.sbColorOnSurfaceVariant),void 0!==t.sbColorOnSurface&&(this.sbColorOnSurface=t.sbColorOnSurface),void 0!==t.sbColorSurfaceLow&&(this.sbColorSurfaceLow=t.sbColorSurfaceLow),void 0!==t.sbColorSurfaceHigh&&(this.sbColorSurfaceHigh=t.sbColorSurfaceHigh),void 0!==t.sbColorModalOverlay&&(this.sbColorModalOverlay=t.sbColorModalOverlay)}}class r extends o.a{constructor(t={}){super(),this.visible=!0,this.text="",this.color="#FFFFFF",this.useShadow=!1,void 0!==t.visible&&(this.visible=t.visible),void 0!==t.text&&(this.text=t.text),void 0!==t.color&&(this.color=t.color),void 0!==t.useShadow&&(this.useShadow=t.useShadow)}}class a extends o.a{constructor(t={}){super(),this.visible=!0,this.color="#FFFFFF",void 0!==t.visible&&(this.visible=t.visible),void 0!==t.color&&(this.color=t.color)}}class s extends o.a{constructor(t={}){super(),this.strokeColor="#FFFFFFFF",this.fillColor="#FFFFFF30",this.strokeWidth=2,this.cornerRadius=0,void 0!==t.strokeColor&&(this.strokeColor=t.strokeColor),void 0!==t.fillColor&&(this.fillColor=t.fillColor),void 0!==t.strokeWidth&&(this.strokeWidth=t.strokeWidth),void 0!==t.cornerRadius&&(this.cornerRadius=t.cornerRadius)}}class l extends o.a{constructor(t={}){super(),this.strokeColor="#FFFFFFFF",this.fillColor="#FFFFFF30",this.strokeWidth=2,void 0!==t.strokeColor&&(this.strokeColor=t.strokeColor),void 0!==t.fillColor&&(this.fillColor=t.fillColor),void 0!==t.strokeWidth&&(this.strokeWidth=t.strokeWidth)}}class c extends o.a{constructor(t={}){super(),this.iconVisible=!0,this.color="#FFFFFF",this.useShadow=!1,void 0!==t.iconVisible&&(this.iconVisible=t.iconVisible),void 0!==t.color&&(this.color=t.color),void 0!==t.useShadow&&(this.useShadow=t.useShadow)}}class u extends o.a{constructor(t={}){super(),this.visible=!0,this.backgroundColor="#0000007A",this.foregroundColor="#FFFFFF",this.activeBackgroundColor="#FFCE5C",this.activeForegroundColor="#1C1B1F",void 0!==t.visible&&(this.visible=t.visible),void 0!==t.backgroundColor&&(this.backgroundColor=t.backgroundColor),void 0!==t.foregroundColor&&(this.foregroundColor=t.foregroundColor),void 0!==t.activeBackgroundColor&&(this.activeBackgroundColor=t.activeBackgroundColor),void 0!==t.activeForegroundColor&&(this.activeForegroundColor=t.activeForegroundColor)}}class d extends o.a{constructor(t={}){super(),this.badgeBackgroundColor="#FFFFFF",this.badgeForegroundColor="#C8193C",this.visible=!0,this.backgroundColor="#0000007A",this.foregroundColor="#FFFFFF",this.activeBackgroundColor="#FFCE5C",this.activeForegroundColor="#1C1B1F",void 0!==t.badgeBackgroundColor&&(this.badgeBackgroundColor=t.badgeBackgroundColor),void 0!==t.badgeForegroundColor&&(this.badgeForegroundColor=t.badgeForegroundColor),void 0!==t.visible&&(this.visible=t.visible),void 0!==t.backgroundColor&&(this.backgroundColor=t.backgroundColor),void 0!==t.foregroundColor&&(this.foregroundColor=t.foregroundColor),void 0!==t.activeBackgroundColor&&(this.activeBackgroundColor=t.activeBackgroundColor),void 0!==t.activeForegroundColor&&(this.activeForegroundColor=t.activeForegroundColor)}}class h extends o.a{constructor(t={}){super(),this.visible=!0,this.text="",this.background=new l({}),this.foreground=new c({}),void 0!==t.visible&&(this.visible=t.visible),void 0!==t.text&&(this.text=t.text),void 0!==t.background&&(this.background=new l(t.background)),void 0!==t.foreground&&(this.foreground=new c(t.foreground))}}class f extends o.a{constructor(t={}){super(),this.successBeepEnabled=!0,this.soundType="MODERN_BEEP",void 0!==t.successBeepEnabled&&(this.successBeepEnabled=t.successBeepEnabled),void 0!==t.soundType&&(this.soundType=t.soundType)}}class p extends o.a{constructor(t={}){super(),this.enabled=!1,void 0!==t.enabled&&(this.enabled=t.enabled)}}class m extends o.a{constructor(t={}){super(),this.autoCancelTimeout=0,this.initialScanDelay=0,void 0!==t.autoCancelTimeout&&(this.autoCancelTimeout=t.autoCancelTimeout),void 0!==t.initialScanDelay&&(this.initialScanDelay=t.initialScanDelay)}}},function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"a",(function(){return r})),n.d(e,"d",(function(){return a})),n.d(e,"c",(function(){return s})),n.d(e,"e",(function(){return l}));var o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)};function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var r=function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},r.apply(this,arguments)};function a(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(n[o[i]]=t[o[i]])}return n}Object.create;function s(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,i,r=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=r.next()).done;)a.push(o.value)}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return a}function l(t,e,n){if(n||2===arguments.length)for(var o,i=0,r=e.length;i<r;i++)!o&&i in e||(o||(o=Array.prototype.slice.call(e,0,i)),o[i]=e[i]);return t.concat(o||Array.prototype.slice.call(e))}Object.create},function(t,e){t.exports=window["@mui"]},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));class o{_marker(){}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a})),n.d(e,"c",(function(){return s})),n.d(e,"b",(function(){return l}));var o=n(0),i=n(13),r=n(16);const a=Object(o.createContext)(null);function s(t){return{getColorValue:e=>{if(e){if(e.startsWith("?")){const n=e.slice(1);if(n in t)return t[n];r.a.debugWarn(`Color ${n} not found in palette`)}return e}r.a.debugWarn("Color is missing")}}}class l{static setPalette(t){this.palette=t}static setBarcodeTextLocalization(t){this.barcodeTextLocalization=t}static getColorValue(t){return s(l.palette).getColorValue(t)}static getPolygonColorValues(t,e){return new i.PolygonStyle({fillColor:e?l.getColorValue(t.fillColor):"transparent",strokeColor:e?l.getColorValue(t.strokeColor):"transparent",strokeWidth:t.strokeWidth,cornerRadius:t.cornerRadius})}static getLocalizedBarcodeText(t,e=[]){if(t.startsWith("?")){const e=t.slice(1);e in l.barcodeTextLocalization?t=l.barcodeTextLocalization[e]:r.a.debugWarn(`Barcode text localization key ${e} not found in localization`)}for(let n of e)t=t.replace("%d",n);return t}}l.palette=(new i.BarcodeScannerConfiguration).palette,l.barcodeTextLocalization=(new i.BarcodeScannerConfiguration).localization},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var o=n(31);class i{constructor(t,e){this.x=t,this.y=e}static toPolygon(t,e){return[i.scaleDownTo(t[0],e),i.scaleDownTo(t[1],e),i.scaleDownTo(t[2],e),i.scaleDownTo(t[3],e)]}static scaleToPoint(t,e,n,o){return new i(o*(t.x-e),o*(t.y-n))}static scaleListToHtmlElement(t,e,n){return t.map((t=>i.scaleToHtmlElement(t,e,n)))}static scaleToHtmlElement(t,e,n){return new i(t.x*(n.clientWidth/e.width),t.y*(n.clientHeight/e.height))}static scaleUpTo(t,e){return new i(t.x*e.width,t.y*e.height)}static scaleDownTo(t,e){return new i(t.x/e.width,t.y/e.height)}static fromHtmlElement(t){return new i(t.offsetLeft,t.offsetTop)}static withScale(t,e,n){return new i(t/n,e/n)}static fromCoordinates(t,e,n,o){if(!t||!e)return new i(0,0);const r=new i(t,e);return o=null!=o?o:1,1===(n=n?n%4:0)?i.withScale(r.y,-r.x,o):2===n?i.withScale(-r.x,-r.y,o):3===n?i.withScale(-r.y,r.x,o):i.withScale(r.x,r.y,o)}static centerOf(t){const e=t.reduce(((t,e)=>t+e.x),0)/t.length,n=t.reduce(((t,e)=>t+e.y),0)/t.length;return new i(e,n)}static smallerSizeOfQuad(t){const e=Math.max(...t.map((t=>t.x)))-Math.min(...t.map((t=>t.x))),n=Math.max(...t.map((t=>t.y)))-Math.min(...t.map((t=>t.y)));return Math.min(e,n)}static empty(){return new i(0,0)}static centerX(t){if(t)return(i.highestX(t)+i.lowestX(t))/2}static highestX(t){if(t)return Math.max(...t.map((t=>t.x)))}static lowestX(t){if(t)return Math.min(...t.map((t=>t.x)))}static lowestY(t){if(t)return Math.min(...t.map((t=>t.y)))}static highestY(t){if(t)return Math.max(...t.map((t=>t.y)))}static width(t){if(t)return i.highestX(t)-i.lowestX(t)}static left(t){if(t)return t.reduce(((t,e)=>t.x<e.x?t:e))}static right(t){if(t)return t.reduce(((t,e)=>t.x>e.x?t:e))}static toSvgString(t){if(void 0!==t)return t.map((t=>`${t.x.toFixed(2)},${t.y.toFixed(2)}`)).join(" ")}static toSvgPathStringWithRoundedCorners(t,e=0){if(void 0===t)return;function n(t,e,n){const o=Math.atan2(t.y-e.y,t.x-e.x);return{x:t.x-n*Math.cos(o),y:t.y-n*Math.sin(o)}}let o="";const r=n(t[0],t[1],i.distance(t[0],t[1])/2);o+=`M ${r.x} ${r.y}`;for(let r=0;r<t.length;r++){const a=t[r],s=t[(r+1)%t.length],l=t[(r+2)%t.length],c=n(s,l,i.distance(s,l)/2),u=Math.abs(Math.atan2(s.y-a.y,s.x-a.x)-Math.atan2(s.y-l.y,s.x-l.x)),d=u>Math.PI?2*Math.PI-u:u,h=Math.min(Math.sqrt(Math.pow(s.x-a.x,2)+Math.pow(s.y-a.y,2)),Math.sqrt(Math.pow(s.x-l.x,2)+Math.pow(s.y-l.y,2))),f=Math.min(e,h*Math.tan(d/2)/2),p=Math.abs(f/Math.tan(d/2)),m=(s.x-a.x)*(s.y-l.y)-(s.x-l.x)*(s.y-a.y)<0?1:0,g=n(s,a,p),v=n(s,l,p);o+=` L${g.x} ${g.y}`,o+=` A${f} ${f} 0 0 ${m} ${v.x} ${v.y}`,o+=` L${c.x} ${c.y}`}return o+" Z"}static distance(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}static subtract(t,e){return new i(t.x-e.x,t.y-e.y)}static add(t,e){return new i(t.x+e.x,t.y+e.y)}static multiply(t,e){return new i(t.x*e,t.y*e)}static cross(t,e){return t.x*e.y-t.y*e.x}static clamp(t,e){return new i(Object(o.a)(t.x,0,e.width),Object(o.a)(t.y,0,e.height))}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));class o{}},function(t,e,n){"use strict";n.d(e,"c",(function(){return r})),n.d(e,"e",(function(){return a})),n.d(e,"d",(function(){return s})),n.d(e,"b",(function(){return l})),n.d(e,"f",(function(){return c})),n.d(e,"g",(function(){return u})),n.d(e,"a",(function(){return d}));var o=n(1),i=n(7);class r extends i.a{constructor(t={}){super(),this.visible=!0,this.deselected=new o.g({strokeColor:"?sbColorSurface",fillColor:"#00000000",strokeWidth:2,cornerRadius:2}),this.selected=new o.g({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:2,cornerRadius:2}),void 0!==t.visible&&(this.visible=t.visible),void 0!==t.deselected&&(this.deselected=new o.g(t.deselected)),void 0!==t.selected&&(this.selected=new o.g(t.selected))}}class a extends i.a{constructor(t={}){super(),this.imageVisible=!0,this.titleSelected=new o.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),this.subtitleSelected=new o.j({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),this.titleDeselected=new o.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),this.subtitleDeselected=new o.j({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),this.backgroundSelected=new o.g({strokeColor:"?sbColorPositive",fillColor:"?sbColorPositive",strokeWidth:0,cornerRadius:10}),this.backgroundDeselected=new o.g({strokeColor:"?sbColorSurface",fillColor:"?sbColorSurface",strokeWidth:0,cornerRadius:10}),void 0!==t.imageVisible&&(this.imageVisible=t.imageVisible),void 0!==t.titleSelected&&(this.titleSelected=new o.j(t.titleSelected)),void 0!==t.subtitleSelected&&(this.subtitleSelected=new o.j(t.subtitleSelected)),void 0!==t.titleDeselected&&(this.titleDeselected=new o.j(t.titleDeselected)),void 0!==t.subtitleDeselected&&(this.subtitleDeselected=new o.j(t.subtitleDeselected)),void 0!==t.backgroundSelected&&(this.backgroundSelected=new o.g(t.backgroundSelected)),void 0!==t.backgroundDeselected&&(this.backgroundDeselected=new o.g(t.backgroundDeselected))}}class s extends i.a{constructor(t={}){if(super(),this.visible=!0,this.foregroundColor="?sbColorOnSurface",void 0!==t.visible&&(this.visible=t.visible),void 0===t.background)throw new Error("background must be present in constructor argument");this.background=new o.a(t.background),void 0!==t.foregroundColor&&(this.foregroundColor=t.foregroundColor)}}class l extends i.a{constructor(t={}){super(),this.visible=!1,this.counterBadge=new s({background:new o.a({}),foregroundColor:"?sbColorOnSurface"}),this.automaticSelectionEnabled=!1,this.barcodeItemInfoPosition="BELOW",this.polygon=new r({visible:!0,deselected:new o.g({}),selected:new o.g({})}),this.barcodeItemConfiguration=new a({imageVisible:!0,titleSelected:new o.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),subtitleSelected:new o.j({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),titleDeselected:new o.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),subtitleDeselected:new o.j({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),backgroundSelected:new o.g({strokeColor:"?sbColorPositive",fillColor:"?sbColorPositive",strokeWidth:1,cornerRadius:5}),backgroundDeselected:new o.g({strokeColor:"?sbColorSurface",fillColor:"?sbColorSurface",strokeWidth:1,cornerRadius:5})}),void 0!==t.visible&&(this.visible=t.visible),void 0!==t.counterBadge&&(this.counterBadge=new s(t.counterBadge)),void 0!==t.automaticSelectionEnabled&&(this.automaticSelectionEnabled=t.automaticSelectionEnabled),void 0!==t.barcodeItemInfoPosition&&(this.barcodeItemInfoPosition=t.barcodeItemInfoPosition),void 0!==t.polygon&&(this.polygon=new r(t.polygon)),void 0!==t.barcodeItemConfiguration&&(this.barcodeItemConfiguration=new a(t.barcodeItemConfiguration))}}class c extends i.a{constructor(t={}){super(),this.visible=!0,this.partiallyScanned=new o.g({strokeColor:"?sbColorWarning",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),this.rejected=new o.g({strokeColor:"?sbColorSurface",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),this.completed=new o.g({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),void 0!==t.visible&&(this.visible=t.visible),void 0!==t.partiallyScanned&&(this.partiallyScanned=new o.g(t.partiallyScanned)),void 0!==t.rejected&&(this.rejected=new o.g(t.rejected)),void 0!==t.completed&&(this.completed=new o.g(t.completed))}}class u extends i.a{constructor(t={}){super(),this.partiallyScanned=new s({visible:!0,background:new o.a({strokeColor:"#FFFFFF30",fillColor:"?sbColorWarning",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),this.rejected=new s({visible:!0,background:new o.a({strokeColor:"#FFFFFF30",fillColor:"?sbColorNegative",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),this.completed=new s({visible:!0,background:new o.a({strokeColor:"#FFFFFF30",fillColor:"?sbColorPositive",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),void 0!==t.partiallyScanned&&(this.partiallyScanned=new s(t.partiallyScanned)),void 0!==t.rejected&&(this.rejected=new s(t.rejected)),void 0!==t.completed&&(this.completed=new s(t.completed))}}class d extends i.a{constructor(t={}){super(),this.visible=!1,this.automaticSelectionEnabled=!0,this.polygon=new c({}),this.badge=new u({}),void 0!==t.visible&&(this.visible=t.visible),void 0!==t.automaticSelectionEnabled&&(this.automaticSelectionEnabled=t.automaticSelectionEnabled),void 0!==t.polygon&&(this.polygon=new c(t.polygon)),void 0!==t.badge&&(this.badge=new u(t.badge))}}},function(t,e,n){"use strict";n.r(e),n.d(e,"BarcodeConfigs",(function(){return x})),n.d(e,"BarcodeScannerTypes",(function(){return E})),n.d(e,"BarcodeTypes",(function(){return o})),n.d(e,"CheckRecognizerTypes",(function(){return i})),n.d(e,"CommonFieldType",(function(){return r})),n.d(e,"DocumentDetectorTypes",(function(){return a})),n.d(e,"DocumentQualityAnalyzerTypes",(function(){return s})),n.d(e,"EhicTypes",(function(){return l})),n.d(e,"GenericDocument",(function(){return O})),n.d(e,"GenericDocumentRecognizerConfigs",(function(){return c})),n.d(e,"GenericDocumentRecognizerTypes",(function(){return d})),n.d(e,"GenericDocumentTypes",(function(){return h})),n.d(e,"GenericTextLineScannerTypes",(function(){return f})),n.d(e,"Geometry",(function(){return I})),n.d(e,"ImageProcessorTypes",(function(){return p})),n.d(e,"LicensePlateScannerTypes",(function(){return m})),n.d(e,"MedicalCertificateTypes",(function(){return g})),n.d(e,"MRZTypes",(function(){return A})),n.d(e,"OcrElements",(function(){return b})),n.d(e,"ParametricFilters",(function(){return y})),n.d(e,"PdfConfig",(function(){return C})),n.d(e,"TiffTypes",(function(){return S})),n.d(e,"FrameUtilities",(function(){return v})),n.d(e,"FrameAccumulationTypes",(function(){return u})),n.d(e,"PartiallyConstructible",(function(){return L.a}));var o={};n.r(o),n.d(o,"BarcodeFormats",(function(){return _}));var i={};n.r(i),n.d(i,"RecognitionResult",(function(){return T}));var r={};n.r(r);var a={};n.r(a),n.d(a,"DocumentDetectorParameters",(function(){return W})),n.d(a,"DocumentDetectorConfiguration",(function(){return M})),n.d(a,"DocumentDetectionScores",(function(){return j})),n.d(a,"DocumentDetectionResult",(function(){return z}));var s={};n.r(s),n.d(s,"DocumentQualityThreshold",(function(){return N})),n.d(s,"DocumentQualityAnalyzerConfiguration",(function(){return V})),n.d(s,"DocumentQualityAnalyzerResult",(function(){return U}));var l={};n.r(l),n.d(l,"RecognitionResult",(function(){return H})),n.d(l,"RecognizerParameters",(function(){return G}));var c={};n.r(c),n.d(c,"GDRConfig",(function(){return k})),n.d(c,"DateValidationConfig",(function(){return Q})),n.d(c,"EuropeanHealthInsuranceCardConfig",(function(){return Y})),n.d(c,"MRZFallbackConfig",(function(){return Z})),n.d(c,"GDRGroupConfig",(function(){return q}));var u={};n.r(u),n.d(u,"ResultAccumulationConfig",(function(){return X}));var d={};n.r(d),n.d(d,"RecognitionResult",(function(){return $})),n.d(d,"RecognitionParameters",(function(){return K})),n.d(d,"GenericDocumentRecognizerParameters",(function(){return J}));var h={};n.r(h),n.d(h,"DocumentTypes",(function(){return tt}));var f={};n.r(f),n.d(f,"WordBox",(function(){return et})),n.d(f,"SymbolBox",(function(){return nt})),n.d(f,"ScannerResult",(function(){return ot})),n.d(f,"ContentValidator",(function(){return D})),n.d(f,"DefaultContentValidator",(function(){return it})),n.d(f,"PresetContentValidator",(function(){return rt})),n.d(f,"PatternContentValidator",(function(){return at})),n.d(f,"ScannerConfiguration",(function(){return st}));var p={};n.r(p);var m={};n.r(m),n.d(m,"ScannerConfiguration",(function(){return lt})),n.d(m,"ScannerResult",(function(){return ct}));var g={};n.r(g),n.d(g,"RecognitionParameters",(function(){return ut})),n.d(g,"CheckBox",(function(){return dt})),n.d(g,"DateRecord",(function(){return ht})),n.d(g,"PatientInfoField",(function(){return ft})),n.d(g,"PatientInfoBox",(function(){return pt})),n.d(g,"RecognitionResult",(function(){return mt}));var v={};n.r(v),n.d(v,"AccumulatedResultsVerifierConfig",(function(){return gt}));var A={};n.r(A),n.d(A,"RecognitionResult",(function(){return vt})),n.d(A,"RecognizerConfiguration",(function(){return At}));var b={};n.r(b),n.d(b,"OcrElement",(function(){return P})),n.d(b,"Glyph",(function(){return bt})),n.d(b,"Word",(function(){return yt})),n.d(b,"Line",(function(){return Ct})),n.d(b,"Block",(function(){return St})),n.d(b,"Page",(function(){return wt}));var y={};n.r(y),n.d(y,"ParametricFilter",(function(){return B})),n.d(y,"ScanbotBinarizationFilter",(function(){return xt})),n.d(y,"CustomBinarizationFilter",(function(){return Et})),n.d(y,"ColorDocumentFilter",(function(){return Lt})),n.d(y,"BrightnessFilter",(function(){return _t})),n.d(y,"ContrastFilter",(function(){return Ot})),n.d(y,"GrayscaleFilter",(function(){return Tt})),n.d(y,"LegacyFilter",(function(){return kt})),n.d(y,"WhiteBlackPointFilter",(function(){return Dt}));var C={};n.r(C),n.d(C,"PdfAttributes",(function(){return Pt})),n.d(C,"PdfConfig",(function(){return Bt}));var S={};n.r(S),n.d(S,"UserFieldValue",(function(){return F})),n.d(S,"UserFieldDoubleValue",(function(){return Ft})),n.d(S,"UserFieldStringValue",(function(){return Rt})),n.d(S,"UserFieldIntValue",(function(){return It})),n.d(S,"UserField",(function(){return Wt})),n.d(S,"TIFFWriterParameters",(function(){return Mt}));var w,x=n(32),E=n(34),L=n(4);class _ extends L.a{constructor(t={}){super()}}(w=_||(_={})).oned=["CODABAR","CODE_11","CODE_25","CODE_32","CODE_39","CODE_93","CODE_128","DATABAR","DATABAR_EXPANDED","DATABAR_LIMITED","EAN_8","EAN_13","IATA_2_OF_5","INDUSTRIAL_2_OF_5","ITF","MSI_PLESSEY","PHARMA_CODE","PZN","UPC_A","UPC_E"],w.twod=["AZTEC","DATA_MATRIX","MAXICODE","MICRO_QR_CODE","MICRO_PDF_417","PDF_417","QR_CODE","RMQR_CODE"],w.postal=["AUSTRALIA_POST","JAPAN_POST","ROYAL_MAIL","ROYAL_TNT_POST","USPS_INTELLIGENT_MAIL"],w.pharma=["CODE_32","PHARMA_CODE","PHARMA_CODE_TWO_TRACK","PZN"],w.common=["AZTEC","CODABAR","CODE_39","CODE_93","CODE_128","DATA_MATRIX","DATABAR","DATABAR_EXPANDED","DATABAR_LIMITED","EAN_13","EAN_8","ITF","MICRO_QR_CODE","PDF_417","QR_CODE","UPC_A","UPC_E"],w.all=["AUSTRALIA_POST","AZTEC","CODABAR","CODE_11","CODE_25","CODE_32","CODE_39","CODE_93","CODE_128","DATA_MATRIX","DATABAR","DATABAR_EXPANDED","DATABAR_LIMITED","EAN_13","EAN_8","GS1_COMPOSITE","IATA_2_OF_5","INDUSTRIAL_2_OF_5","ITF","JAPAN_POST","MAXICODE","MICRO_PDF_417","MICRO_QR_CODE","MSI_PLESSEY","PDF_417","PHARMA_CODE","PHARMA_CODE_TWO_TRACK","PZN","QR_CODE","RMQR_CODE","ROYAL_MAIL","ROYAL_TNT_POST","UPC_A","UPC_E","USPS_INTELLIGENT_MAIL"];var O=n(19);class T extends L.a{constructor(t={}){if(super(),this.status="FAIL",void 0!==t.status&&(this.status=t.status),void 0===t.check)throw new Error("check must be present in constructor argument");this.check=null!=t.check?new O.GenericDocument(t.check):null}}var k,D,P,B,F,R,I=n(20);class W extends L.a{constructor(t={}){super(),this.isLive=!1,this.acceptedAngleScore=75,this.acceptedSizeScore=80,this.acceptedBrightnessThreshold=0,this.acceptedAspectRatioScore=85,this.aspectRatios=[],void 0!==t.isLive&&(this.isLive=t.isLive),void 0!==t.acceptedAngleScore&&(this.acceptedAngleScore=t.acceptedAngleScore),void 0!==t.acceptedSizeScore&&(this.acceptedSizeScore=t.acceptedSizeScore),void 0!==t.acceptedBrightnessThreshold&&(this.acceptedBrightnessThreshold=t.acceptedBrightnessThreshold),void 0!==t.acceptedAspectRatioScore&&(this.acceptedAspectRatioScore=t.acceptedAspectRatioScore),void 0!==t.aspectRatios&&(this.aspectRatios=t.aspectRatios.map((t=>new I.AspectRatio(t))))}}class M extends L.a{constructor(t={}){super(),this.engineMode="ML",this.parameters=new W({}),void 0!==t.engineMode&&(this.engineMode=t.engineMode),void 0!==t.parameters&&(this.parameters=new W(t.parameters))}}class j extends L.a{constructor(t={}){if(super(),void 0===t.totalScore)throw new Error("totalScore must be present in constructor argument");if(this.totalScore=t.totalScore,void 0===t.distanceScore)throw new Error("distanceScore must be present in constructor argument");if(this.distanceScore=t.distanceScore,void 0===t.angleScore)throw new Error("angleScore must be present in constructor argument");if(this.angleScore=t.angleScore,void 0===t.sizeScore)throw new Error("sizeScore must be present in constructor argument");if(this.sizeScore=t.sizeScore,void 0===t.aspectRatioScore)throw new Error("aspectRatioScore must be present in constructor argument");if(this.aspectRatioScore=t.aspectRatioScore,void 0===t.lineCoverageScore)throw new Error("lineCoverageScore must be present in constructor argument");if(this.lineCoverageScore=t.lineCoverageScore,void 0===t.widthScore)throw new Error("widthScore must be present in constructor argument");if(this.widthScore=t.widthScore,void 0===t.heightScore)throw new Error("heightScore must be present in constructor argument");this.heightScore=t.heightScore}}class z extends L.a{constructor(t={}){if(super(),this.status="NOT_ACQUIRED",this.averageBrightness=0,void 0!==t.status&&(this.status=t.status),void 0===t.detectionScores)throw new Error("detectionScores must be present in constructor argument");if(this.detectionScores=new j(t.detectionScores),void 0===t.points)throw new Error("points must be present in constructor argument");if(this.points=t.points.map((t=>({x:t.x,y:t.y}))),void 0===t.horizontalLines)throw new Error("horizontalLines must be present in constructor argument");if(this.horizontalLines=t.horizontalLines.map((t=>new I.LineSegmentInt(t))),void 0===t.verticalLines)throw new Error("verticalLines must be present in constructor argument");if(this.verticalLines=t.verticalLines.map((t=>new I.LineSegmentInt(t))),void 0===t.pointsNormalized)throw new Error("pointsNormalized must be present in constructor argument");if(this.pointsNormalized=t.pointsNormalized.map((t=>({x:t.x,y:t.y}))),void 0===t.horizontalLinesNormalized)throw new Error("horizontalLinesNormalized must be present in constructor argument");if(this.horizontalLinesNormalized=t.horizontalLinesNormalized.map((t=>new I.LineSegmentFloat(t))),void 0===t.verticalLinesNormalized)throw new Error("verticalLinesNormalized must be present in constructor argument");if(this.verticalLinesNormalized=t.verticalLinesNormalized.map((t=>new I.LineSegmentFloat(t))),void 0===t.aspectRatio)throw new Error("aspectRatio must be present in constructor argument");this.aspectRatio=t.aspectRatio,void 0!==t.averageBrightness&&(this.averageBrightness=t.averageBrightness)}}class N extends L.a{constructor(t={}){if(super(),void 0===t.symbolQuality)throw new Error("symbolQuality must be present in constructor argument");if(this.symbolQuality=t.symbolQuality,void 0===t.symbolRatio)throw new Error("symbolRatio must be present in constructor argument");this.symbolRatio=t.symbolRatio}}class V extends L.a{constructor(t={}){super(),this.qualityThresholds=[new N({symbolQuality:.5,symbolRatio:.5}),new N({symbolQuality:.7,symbolRatio:.3}),new N({symbolQuality:.85,symbolRatio:.3}),new N({symbolQuality:.9,symbolRatio:.1})],this.qualityIndices=["VERY_POOR","POOR","REASONABLE","GOOD","EXCELLENT"],this.maxImageSize=2e3,this.minEstimatedNumberOfSymbolsForDocument=20,this.minProcessedFraction=0,this.maxProcessedFraction=.5,this.earlyStopIfNSymbolsFound=100,this.tileSize=300,void 0!==t.qualityThresholds&&(this.qualityThresholds=t.qualityThresholds.map((t=>new N(t)))),void 0!==t.qualityIndices&&(this.qualityIndices=t.qualityIndices.map((t=>t))),void 0!==t.maxImageSize&&(this.maxImageSize=t.maxImageSize),void 0!==t.minEstimatedNumberOfSymbolsForDocument&&(this.minEstimatedNumberOfSymbolsForDocument=t.minEstimatedNumberOfSymbolsForDocument),void 0!==t.minProcessedFraction&&(this.minProcessedFraction=t.minProcessedFraction),void 0!==t.maxProcessedFraction&&(this.maxProcessedFraction=t.maxProcessedFraction),void 0!==t.earlyStopIfNSymbolsFound&&(this.earlyStopIfNSymbolsFound=t.earlyStopIfNSymbolsFound),void 0!==t.tileSize&&(this.tileSize=t.tileSize)}}class U extends L.a{constructor(t={}){if(super(),void 0===t.documentFound)throw new Error("documentFound must be present in constructor argument");if(this.documentFound=t.documentFound,void 0===t.quality)throw new Error("quality must be present in constructor argument");this.quality=null!=t.quality?t.quality:null}}class H extends L.a{constructor(t={}){if(super(),this.status="FAILED_DETECTION",void 0===t.fields)throw new Error("fields must be present in constructor argument");this.fields=t.fields.map((t=>new H.Field(t))),void 0!==t.status&&(this.status=t.status)}}!function(t){class e extends L.a{constructor(t={}){if(super(),this.validationStatus="NOT_VALIDATED",void 0===t.type)throw new Error("type must be present in constructor argument");if(this.type=t.type,void 0===t.value)throw new Error("value must be present in constructor argument");if(this.value=t.value,void 0===t.confidence)throw new Error("confidence must be present in constructor argument");this.confidence=t.confidence,void 0!==t.validationStatus&&(this.validationStatus=t.validationStatus)}}t.Field=e}(H||(H={}));class G extends L.a{constructor(t={}){super(),this.allowedCountries=[],this.minBirthYear=0,this.maxBirthYear=2999,this.minExpirationYear=0,this.maxExpirationYear=2999,this.maxCountryDetectionAttempts=5,this.minEqualFrameCount=4,this.maxAccumulatedFrameCount=10,void 0!==t.allowedCountries&&(this.allowedCountries=t.allowedCountries.map((t=>t))),void 0!==t.minBirthYear&&(this.minBirthYear=t.minBirthYear),void 0!==t.maxBirthYear&&(this.maxBirthYear=t.maxBirthYear),void 0!==t.minExpirationYear&&(this.minExpirationYear=t.minExpirationYear),void 0!==t.maxExpirationYear&&(this.maxExpirationYear=t.maxExpirationYear),void 0!==t.maxCountryDetectionAttempts&&(this.maxCountryDetectionAttempts=t.maxCountryDetectionAttempts),void 0!==t.minEqualFrameCount&&(this.minEqualFrameCount=t.minEqualFrameCount),void 0!==t.maxAccumulatedFrameCount&&(this.maxAccumulatedFrameCount=t.maxAccumulatedFrameCount)}}!function(t){t.From=function(t){const e=t._type;switch(e){case"DateValidationConfig":return new Q(t);case"EuropeanHealthInsuranceCardConfig":return new Y(t);case"MRZFallbackConfig":return new Z(t);case"GDRGroupConfig":return new q(t);default:throw`Unknown child class name: ${e}`}}}(k||(k={}));class Q extends L.a{constructor(t={}){super(),this._type="DateValidationConfig",this.minBirthYear=0,this.maxBirthYear=2999,this.minExpirationYear=0,this.maxExpirationYear=2999,this.documentTypes=[],void 0!==t.minBirthYear&&(this.minBirthYear=t.minBirthYear),void 0!==t.maxBirthYear&&(this.maxBirthYear=t.maxBirthYear),void 0!==t.minExpirationYear&&(this.minExpirationYear=t.minExpirationYear),void 0!==t.maxExpirationYear&&(this.maxExpirationYear=t.maxExpirationYear),void 0!==t.documentTypes&&(this.documentTypes=t.documentTypes.map((t=>t)))}}class Y extends L.a{constructor(t={}){super(),this._type="EuropeanHealthInsuranceCardConfig",this.minBirthYear=0,this.maxBirthYear=2999,this.minExpirationYear=0,this.maxExpirationYear=2999,this.expectedCountry=null,void 0!==t.minBirthYear&&(this.minBirthYear=t.minBirthYear),void 0!==t.maxBirthYear&&(this.maxBirthYear=t.maxBirthYear),void 0!==t.minExpirationYear&&(this.minExpirationYear=t.minExpirationYear),void 0!==t.maxExpirationYear&&(this.maxExpirationYear=t.maxExpirationYear),void 0!==t.expectedCountry&&(this.expectedCountry=null!=t.expectedCountry?t.expectedCountry:null)}}class Z extends L.a{constructor(t={}){super(),this._type="MRZFallbackConfig",this.acceptedCountries=[],this.acceptedMRZTypes=[],void 0!==t.acceptedCountries&&(this.acceptedCountries=t.acceptedCountries.map((t=>t))),void 0!==t.acceptedMRZTypes&&(this.acceptedMRZTypes=t.acceptedMRZTypes.map((t=>t)))}}class q extends L.a{constructor(t={}){if(super(),this._type="GDRGroupConfig",void 0===t.acceptedDocumentTypes)throw new Error("acceptedDocumentTypes must be present in constructor argument");this.acceptedDocumentTypes=t.acceptedDocumentTypes.map((t=>t))}}class X extends L.a{constructor(t={}){super(),this.confirmationMethod="EXACT",this.minConfirmations=3,this.minConfidenceForStableField=.8,this.autoClearThreshold=4,void 0!==t.confirmationMethod&&(this.confirmationMethod=t.confirmationMethod),void 0!==t.minConfirmations&&(this.minConfirmations=t.minConfirmations),void 0!==t.minConfidenceForStableField&&(this.minConfidenceForStableField=t.minConfidenceForStableField),void 0!==t.autoClearThreshold&&(this.autoClearThreshold=t.autoClearThreshold)}}class $ extends L.a{constructor(t={}){if(super(),void 0===t.status)throw new Error("status must be present in constructor argument");if(this.status=t.status,void 0===t.document)throw new Error("document must be present in constructor argument");if(this.document=null!=t.document?new O.GenericDocument(t.document):null,void 0===t.quad)throw new Error("quad must be present in constructor argument");this.quad=null!=t.quad?t.quad.map((t=>({x:t.x,y:t.y}))):null}}class K extends L.a{constructor(t={}){super(),this.mode="LIVE",void 0!==t.mode&&(this.mode=t.mode)}}class J extends L.a{constructor(t={}){if(super(),this.resultAccumulationConfig=new X({}),this.fieldExcludeList=[],void 0!==t.resultAccumulationConfig&&(this.resultAccumulationConfig=new X(t.resultAccumulationConfig)),void 0!==t.fieldExcludeList&&(this.fieldExcludeList=t.fieldExcludeList.map((t=>t))),void 0===t.configurations)throw new Error("configurations must be present in constructor argument");this.configurations=t.configurations.map((t=>k.From(t)))}}class tt extends L.a{constructor(t={}){super()}}(tt||(tt={})).all=["DeIdCardFront","DeIdCardBack","DePassport","DeDriverLicenseFront","DeDriverLicenseBack","DeResidencePermitFront","DeResidencePermitBack","EuropeanHealthInsuranceCard","DeHealthInsuranceCardFront"];class et extends L.a{constructor(t={}){if(super(),this.recognitionConfidence=0,void 0===t.text)throw new Error("text must be present in constructor argument");if(this.text=t.text,void 0===t.boundingRect)throw new Error("boundingRect must be present in constructor argument");this.boundingRect={x:t.boundingRect.x,y:t.boundingRect.y,width:t.boundingRect.width,height:t.boundingRect.height},void 0!==t.recognitionConfidence&&(this.recognitionConfidence=t.recognitionConfidence)}}class nt extends L.a{constructor(t={}){if(super(),void 0===t.symbol)throw new Error("symbol must be present in constructor argument");if(this.symbol=t.symbol,void 0===t.boundingRect)throw new Error("boundingRect must be present in constructor argument");if(this.boundingRect={x:t.boundingRect.x,y:t.boundingRect.y,width:t.boundingRect.width,height:t.boundingRect.height},void 0===t.recognitionConfidence)throw new Error("recognitionConfidence must be present in constructor argument");this.recognitionConfidence=t.recognitionConfidence}}class ot extends L.a{constructor(t={}){if(super(),this.confidence=0,this.validationSuccessful=!1,void 0===t.rawText)throw new Error("rawText must be present in constructor argument");if(this.rawText=t.rawText,void 0===t.wordBoxes)throw new Error("wordBoxes must be present in constructor argument");if(this.wordBoxes=t.wordBoxes.map((t=>new et(t))),void 0===t.symbolBoxes)throw new Error("symbolBoxes must be present in constructor argument");this.symbolBoxes=t.symbolBoxes.map((t=>new nt(t))),void 0!==t.confidence&&(this.confidence=t.confidence),void 0!==t.validationSuccessful&&(this.validationSuccessful=t.validationSuccessful)}}!function(t){t.From=function(t){const e=t._type;switch(e){case"DefaultContentValidator":return new it(t);case"PresetContentValidator":return new rt(t);case"PatternContentValidator":return new at(t);default:throw`Unknown child class name: ${e}`}}}(D||(D={}));class it extends L.a{constructor(t={}){super(),this._type="DefaultContentValidator",this.allowedCharacters="",void 0!==t.allowedCharacters&&(this.allowedCharacters=t.allowedCharacters)}}class rt extends L.a{constructor(t={}){if(super(),this._type="PresetContentValidator",void 0===t.preset)throw new Error("preset must be present in constructor argument");this.preset=t.preset}}class at extends L.a{constructor(t={}){if(super(),this._type="PatternContentValidator",this.allowedCharacters="",this.matchSubstring=!1,void 0!==t.allowedCharacters&&(this.allowedCharacters=t.allowedCharacters),void 0===t.pattern)throw new Error("pattern must be present in constructor argument");this.pattern=t.pattern,void 0!==t.matchSubstring&&(this.matchSubstring=t.matchSubstring)}}class st extends L.a{constructor(t={}){super(),this.ocrResolutionLimit=0,this.maximumNumberOfAccumulatedFrames=3,this.minimumNumberOfRequiredFramesWithEqualRecognitionResult=2,this.validator=new it({}),void 0!==t.ocrResolutionLimit&&(this.ocrResolutionLimit=t.ocrResolutionLimit),void 0!==t.maximumNumberOfAccumulatedFrames&&(this.maximumNumberOfAccumulatedFrames=t.maximumNumberOfAccumulatedFrames),void 0!==t.minimumNumberOfRequiredFramesWithEqualRecognitionResult&&(this.minimumNumberOfRequiredFramesWithEqualRecognitionResult=t.minimumNumberOfRequiredFramesWithEqualRecognitionResult),void 0!==t.validator&&(this.validator=D.From(t.validator))}}class lt extends L.a{constructor(t={}){super(),this.maximumNumberOfAccumulatedFrames=3,this.minimumNumberOfRequiredFramesWithEqualScanningResult=2,this.scannerStrategy="ML",void 0!==t.maximumNumberOfAccumulatedFrames&&(this.maximumNumberOfAccumulatedFrames=t.maximumNumberOfAccumulatedFrames),void 0!==t.minimumNumberOfRequiredFramesWithEqualScanningResult&&(this.minimumNumberOfRequiredFramesWithEqualScanningResult=t.minimumNumberOfRequiredFramesWithEqualScanningResult),void 0!==t.scannerStrategy&&(this.scannerStrategy=t.scannerStrategy)}}class ct extends L.a{constructor(t={}){if(super(),this.confidence=0,this.validationSuccessful=!1,this.croppedImage=null,void 0===t.countryCode)throw new Error("countryCode must be present in constructor argument");if(this.countryCode=t.countryCode,void 0===t.licensePlate)throw new Error("licensePlate must be present in constructor argument");if(this.licensePlate=t.licensePlate,void 0===t.rawText)throw new Error("rawText must be present in constructor argument");this.rawText=t.rawText,void 0!==t.confidence&&(this.confidence=t.confidence),void 0!==t.validationSuccessful&&(this.validationSuccessful=t.validationSuccessful),void 0!==t.croppedImage&&(this.croppedImage=null!=t.croppedImage?t.croppedImage:null)}}class ut extends L.a{constructor(t={}){super(),this.shouldCropDocument=!0,this.recognizePatientInfoBox=!0,this.recognizeBarcode=!0,this.extractCroppedImage=!1,this.preprocessInput=!1,void 0!==t.shouldCropDocument&&(this.shouldCropDocument=t.shouldCropDocument),void 0!==t.recognizePatientInfoBox&&(this.recognizePatientInfoBox=t.recognizePatientInfoBox),void 0!==t.recognizeBarcode&&(this.recognizeBarcode=t.recognizeBarcode),void 0!==t.extractCroppedImage&&(this.extractCroppedImage=t.extractCroppedImage),void 0!==t.preprocessInput&&(this.preprocessInput=t.preprocessInput)}}class dt extends L.a{constructor(t={}){if(super(),this.type="UNKNOWN",this.checked=!1,this.checkedConfidence=0,void 0!==t.type&&(this.type=t.type),void 0!==t.checked&&(this.checked=t.checked),void 0!==t.checkedConfidence&&(this.checkedConfidence=t.checkedConfidence),void 0===t.quad)throw new Error("quad must be present in constructor argument");this.quad=t.quad.map((t=>({x:t.x,y:t.y})))}}class ht extends L.a{constructor(t={}){if(super(),this.value="",this.rawString="",this.type="UNDEFINED",this.recognitionConfidence=0,void 0===t.quad)throw new Error("quad must be present in constructor argument");this.quad=t.quad.map((t=>({x:t.x,y:t.y}))),void 0!==t.value&&(this.value=t.value),void 0!==t.rawString&&(this.rawString=t.rawString),void 0!==t.type&&(this.type=t.type),void 0!==t.recognitionConfidence&&(this.recognitionConfidence=t.recognitionConfidence)}}class ft extends L.a{constructor(t={}){if(super(),void 0===t.type)throw new Error("type must be present in constructor argument");if(this.type=t.type,void 0===t.value)throw new Error("value must be present in constructor argument");if(this.value=t.value,void 0===t.recognitionConfidence)throw new Error("recognitionConfidence must be present in constructor argument");this.recognitionConfidence=t.recognitionConfidence}}class pt extends L.a{constructor(t={}){if(super(),this.hasContents=!1,void 0===t.quad)throw new Error("quad must be present in constructor argument");if(this.quad=t.quad.map((t=>({x:t.x,y:t.y}))),void 0===t.fields)throw new Error("fields must be present in constructor argument");this.fields=t.fields.map((t=>new ft(t))),void 0!==t.hasContents&&(this.hasContents=t.hasContents)}}class mt extends L.a{constructor(t={}){if(super(),this.recognitionSuccessful=!1,this.formType="UNKNOWN",this.clockwiseRotations=0,this.croppedImage=null,this.scaleX=1,this.scaleY=1,void 0!==t.recognitionSuccessful&&(this.recognitionSuccessful=t.recognitionSuccessful),void 0===t.patientInfoBox)throw new Error("patientInfoBox must be present in constructor argument");if(this.patientInfoBox=new pt(t.patientInfoBox),void 0===t.checkBoxes)throw new Error("checkBoxes must be present in constructor argument");if(this.checkBoxes=t.checkBoxes.map((t=>new dt(t))),void 0===t.dates)throw new Error("dates must be present in constructor argument");if(this.dates=t.dates.map((t=>new ht(t))),void 0!==t.formType&&(this.formType=t.formType),void 0!==t.clockwiseRotations&&(this.clockwiseRotations=t.clockwiseRotations),void 0!==t.croppedImage&&(this.croppedImage=null!=t.croppedImage?t.croppedImage:null),void 0!==t.scaleX&&(this.scaleX=t.scaleX),void 0!==t.scaleY&&(this.scaleY=t.scaleY),void 0===t.documentRoi)throw new Error("documentRoi must be present in constructor argument");this.documentRoi=new z(t.documentRoi)}}class gt extends L.a{constructor(t={}){super(),this.maximumNumberOfAccumulatedFrames=3,this.minimumNumberOfRequiredFramesWithEqualRecognitionResult=2,void 0!==t.maximumNumberOfAccumulatedFrames&&(this.maximumNumberOfAccumulatedFrames=t.maximumNumberOfAccumulatedFrames),void 0!==t.minimumNumberOfRequiredFramesWithEqualRecognitionResult&&(this.minimumNumberOfRequiredFramesWithEqualRecognitionResult=t.minimumNumberOfRequiredFramesWithEqualRecognitionResult)}}class vt extends L.a{constructor(t={}){if(super(),this.recognitionSuccessful=!1,void 0!==t.recognitionSuccessful&&(this.recognitionSuccessful=t.recognitionSuccessful),void 0===t.rawMRZ)throw new Error("rawMRZ must be present in constructor argument");if(this.rawMRZ=t.rawMRZ,void 0===t.document)throw new Error("document must be present in constructor argument");this.document=null!=t.document?new O.GenericDocument(t.document):null}}class At extends L.a{constructor(t={}){super(),this.accumulatedResultsVerifierConfig=new gt({}),void 0!==t.accumulatedResultsVerifierConfig&&(this.accumulatedResultsVerifierConfig=new gt(t.accumulatedResultsVerifierConfig))}}!function(t){t.From=function(t){const e=t._type;switch(e){case"Glyph":return new bt(t);case"Word":return new yt(t);case"Line":return new Ct(t);case"Block":return new St(t);case"Page":return new wt(t);default:throw`Unknown child class name: ${e}`}}}(P||(P={}));class bt extends L.a{constructor(t={}){if(super(),this._type="Glyph",void 0===t.text)throw new Error("text must be present in constructor argument");if(this.text=t.text,void 0===t.confidence)throw new Error("confidence must be present in constructor argument");if(this.confidence=t.confidence,void 0===t.roi)throw new Error("roi must be present in constructor argument");this.roi=t.roi.map((t=>({x:t.x,y:t.y})))}}class yt extends L.a{constructor(t={}){if(super(),this._type="Word",void 0===t.text)throw new Error("text must be present in constructor argument");if(this.text=t.text,void 0===t.confidence)throw new Error("confidence must be present in constructor argument");if(this.confidence=t.confidence,void 0===t.roi)throw new Error("roi must be present in constructor argument");if(this.roi=t.roi.map((t=>({x:t.x,y:t.y}))),void 0===t.glyphs)throw new Error("glyphs must be present in constructor argument");this.glyphs=t.glyphs.map((t=>new bt(t)))}}class Ct extends L.a{constructor(t={}){if(super(),this._type="Line",void 0===t.text)throw new Error("text must be present in constructor argument");if(this.text=t.text,void 0===t.confidence)throw new Error("confidence must be present in constructor argument");if(this.confidence=t.confidence,void 0===t.roi)throw new Error("roi must be present in constructor argument");if(this.roi=t.roi.map((t=>({x:t.x,y:t.y}))),void 0===t.words)throw new Error("words must be present in constructor argument");this.words=t.words.map((t=>new yt(t)))}}class St extends L.a{constructor(t={}){if(super(),this._type="Block",void 0===t.text)throw new Error("text must be present in constructor argument");if(this.text=t.text,void 0===t.confidence)throw new Error("confidence must be present in constructor argument");if(this.confidence=t.confidence,void 0===t.roi)throw new Error("roi must be present in constructor argument");if(this.roi=t.roi.map((t=>({x:t.x,y:t.y}))),void 0===t.lines)throw new Error("lines must be present in constructor argument");this.lines=t.lines.map((t=>new Ct(t)))}}class wt extends L.a{constructor(t={}){if(super(),this._type="Page",void 0===t.text)throw new Error("text must be present in constructor argument");if(this.text=t.text,void 0===t.confidence)throw new Error("confidence must be present in constructor argument");if(this.confidence=t.confidence,void 0===t.roi)throw new Error("roi must be present in constructor argument");if(this.roi=t.roi.map((t=>({x:t.x,y:t.y}))),void 0===t.blocks)throw new Error("blocks must be present in constructor argument");this.blocks=t.blocks.map((t=>new St(t)))}}!function(t){t.From=function(t){const e=t._type;switch(e){case"ScanbotBinarizationFilter":return new xt(t);case"CustomBinarizationFilter":return new Et(t);case"ColorDocumentFilter":return new Lt(t);case"BrightnessFilter":return new _t(t);case"ContrastFilter":return new Ot(t);case"GrayscaleFilter":return new Tt(t);case"LegacyFilter":return new kt(t);case"WhiteBlackPointFilter":return new Dt(t);default:throw`Unknown child class name: ${e}`}}}(B||(B={}));class xt extends L.a{constructor(t={}){super(),this._type="ScanbotBinarizationFilter",this.outputMode="BINARY",void 0!==t.outputMode&&(this.outputMode=t.outputMode)}}class Et extends L.a{constructor(t={}){super(),this._type="CustomBinarizationFilter",this.outputMode="BINARY",this.denoise=.5,this.radius=32,this.preset="PRESET_4",void 0!==t.outputMode&&(this.outputMode=t.outputMode),void 0!==t.denoise&&(this.denoise=t.denoise),void 0!==t.radius&&(this.radius=t.radius),void 0!==t.preset&&(this.preset=t.preset)}}class Lt extends L.a{constructor(t={}){super(),this._type="ColorDocumentFilter"}}class _t extends L.a{constructor(t={}){super(),this._type="BrightnessFilter",this.brightness=0,void 0!==t.brightness&&(this.brightness=t.brightness)}}class Ot extends L.a{constructor(t={}){super(),this._type="ContrastFilter",this.contrast=0,void 0!==t.contrast&&(this.contrast=t.contrast)}}class Tt extends L.a{constructor(t={}){super(),this._type="GrayscaleFilter",this.borderWidthFraction=.06,this.blackOutliersFraction=0,this.whiteOutliersFraction=.02,void 0!==t.borderWidthFraction&&(this.borderWidthFraction=t.borderWidthFraction),void 0!==t.blackOutliersFraction&&(this.blackOutliersFraction=t.blackOutliersFraction),void 0!==t.whiteOutliersFraction&&(this.whiteOutliersFraction=t.whiteOutliersFraction)}}class kt extends L.a{constructor(t={}){super(),this._type="LegacyFilter",this.filterType=0,void 0!==t.filterType&&(this.filterType=t.filterType)}}class Dt extends L.a{constructor(t={}){super(),this._type="WhiteBlackPointFilter",this.blackPoint=0,this.whitePoint=1,void 0!==t.blackPoint&&(this.blackPoint=t.blackPoint),void 0!==t.whitePoint&&(this.whitePoint=t.whitePoint)}}class Pt extends L.a{constructor(t={}){super(),this.author="Created with ❤️ with Scanbot SDK",this.creator="",this.title="",this.subject="",this.keywords="",void 0!==t.author&&(this.author=t.author),void 0!==t.creator&&(this.creator=t.creator),void 0!==t.title&&(this.title=t.title),void 0!==t.subject&&(this.subject=t.subject),void 0!==t.keywords&&(this.keywords=t.keywords)}}class Bt extends L.a{constructor(t={}){super(),this.attributes=new Pt({}),this.pageSize="A4",this.pageDirection="PORTRAIT",this.pageFit="FIT_IN",this.dpi=72,this.jpegQuality=80,this.resamplingMethod="NONE",void 0!==t.attributes&&(this.attributes=new Pt(t.attributes)),void 0!==t.pageSize&&(this.pageSize=t.pageSize),void 0!==t.pageDirection&&(this.pageDirection=t.pageDirection),void 0!==t.pageFit&&(this.pageFit=t.pageFit),void 0!==t.dpi&&(this.dpi=t.dpi),void 0!==t.jpegQuality&&(this.jpegQuality=t.jpegQuality),void 0!==t.resamplingMethod&&(this.resamplingMethod=t.resamplingMethod)}}!function(t){t.From=function(t){const e=t._type;switch(e){case"UserFieldDoubleValue":return new Ft(t);case"UserFieldStringValue":return new Rt(t);case"UserFieldIntValue":return new It(t);default:throw`Unknown child class name: ${e}`}}}(F||(F={}));class Ft extends L.a{constructor(t={}){if(super(),this._type="UserFieldDoubleValue",void 0===t.value)throw new Error("value must be present in constructor argument");this.value=t.value}}class Rt extends L.a{constructor(t={}){if(super(),this._type="UserFieldStringValue",void 0===t.value)throw new Error("value must be present in constructor argument");this.value=t.value}}class It extends L.a{constructor(t={}){if(super(),this._type="UserFieldIntValue",void 0===t.value)throw new Error("value must be present in constructor argument");this.value=t.value}}class Wt extends L.a{constructor(t={}){if(super(),void 0===t.tag)throw new Error("tag must be present in constructor argument");if(this.tag=t.tag,void 0===t.name)throw new Error("name must be present in constructor argument");if(this.name=t.name,void 0===t.value)throw new Error("value must be present in constructor argument");this.value=F.From(t.value)}}class Mt extends L.a{constructor(t={}){super(),this.compression="LZW",this.jpegQuality=80,this.zipCompressionLevel=6,this.dpi=72,this.userFields=[],this.binarizationFilter=null,void 0!==t.compression&&(this.compression=t.compression),void 0!==t.jpegQuality&&(this.jpegQuality=t.jpegQuality),void 0!==t.zipCompressionLevel&&(this.zipCompressionLevel=t.zipCompressionLevel),void 0!==t.dpi&&(this.dpi=t.dpi),void 0!==t.userFields&&(this.userFields=t.userFields.map((t=>new Wt(t)))),void 0!==t.binarizationFilter&&(this.binarizationFilter=null!=t.binarizationFilter?B.From(t.binarizationFilter):null)}}(R=Mt||(Mt={})).defaultCompression="LZW",R.binaryDocumentOptimizedCompression="CCITTFAX4"},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var o=n(6);class i{constructor(t,e){this.width=t,this.height=e}isPortrait(){return this.height>this.width}ratio(t){return t?this.height/this.width:this.width/this.height}ratioDiff(t,e){return this.ratio(e)/t.ratio(e)}static isEmpty(t){return!t||(0===t.width||0===t.height)}static toPolygon(t){return[new o.a(0,0),new o.a(t.width,0),new o.a(t.width,t.height),new o.a(0,t.height)]}static fromHtmlElement(t){return t?new i(t.clientWidth,t.clientHeight):new i(0,0)}static fromJson(t){return new i(t.width,t.height)}static subtractFrom(t,e){return new i(t.width-e,t.height-e)}static empty(){return new i(0,0)}}},function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return a}));var o=n(0),i=n(5);function r(t){return{color:i.b.getColorValue(t.color),textShadow:t.useShadow?"1px 1px 2px":""}}function a(t){return t.config.visible?o.default.createElement("span",{ref:t.innerRef,style:Object.assign(Object.assign({},t.style),r(t.config))},i.b.getLocalizedBarcodeText(t.config.text)):null}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c})),n.d(e,"b",(function(){return u})),n.d(e,"c",(function(){return d}));var o=n(0),i=n(39);const r=n(24).a.svg`
3
3
  animation: rotate 2s linear infinite;
4
4
  width: 50px;
5
5
  height: 50px;
@@ -28,10 +28,10 @@
28
28
  stroke-dashoffset: -120;
29
29
  }
30
30
  }
31
- `;var s=t=>i.default.createElement(a,{viewBox:"0 0 50 50"},i.default.createElement("circle",{className:"path",cx:"25",cy:"25",r:"20",fill:"none",strokeWidth:"3",stroke:t.color||"black"})),l=function(t,e,n,i){return new(n||(n=Promise))((function(o,r){function a(t){try{l(i.next(t))}catch(t){r(t)}}function s(t){try{l(i.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((i=i.apply(t,e||[])).next())}))};class c{}class u{constructor(){this.videoReady=!1,this.sdkReady=!1}}class d extends i.default.Component{constructor(t){super(t),this.onVideoReady=()=>{this.setState({videoReady:!0},(()=>{const{onSuccess:t}=this.props;t&&t(this)}))},this.onVideoError=t=>{if(!0===this.state.videoReady){const{onError:e}=this.props.configuration;e?e(t):console.error(t)}else{const{onFailure:e}=this.props;e&&e(t),this.dispose()}},this.state=new u,this.bridge.awaitInitialized().then((()=>{this.setState({sdkReady:!0})}))}get bridge(){return o.a.instance.bridge}dispose(){const{container:t}=this.props;t&&Object(i.render)(null,t)}componentDidMount(){this.disposed=!1}componentWillUnmount(){this.disposed=!0}isSupported(){return"localhost"===location.hostname||"https:"===location.protocol}swapCameraFacing(t){this.camera.swapCameraFacing(t)}switchCamera(t,e){return l(this,void 0,void 0,(function*(){this.camera.switchCamera(t,e)}))}getActiveCameraInfo(){return this.camera.getActiveCameraInfo()}fetchAvailableCameras(){return l(this,void 0,void 0,(function*(){return new Promise(((t,e)=>{var n;if(null===(n=navigator.mediaDevices)||void 0===n?void 0:n.enumerateDevices){let n=[];navigator.mediaDevices.enumerateDevices().then((e=>{e.forEach((t=>{"videoinput"===t.kind&&t.deviceId&&n.push({deviceId:t.deviceId,label:t.label})})),t(n)})).catch((t=>{e(r.a.mediaDeviceNotFound())}))}else e(r.a.enumerateDevicesFailed())}))}))}renderSpinner(t){return this.state.videoReady&&this.state.sdkReady?null:i.default.createElement("div",{"data-sb-spinner":"1",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:500}},i.default.createElement(s,{color:t}))}setTorchState(t){return this.camera.setTorchState(t)}}d.DEFAULT_DETECTION_RESOLUTION=600,d.DETECTION_RESULTION_4K=3840},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var i=n(30);class o extends i.a{constructor(t){super(),this.mirrored=!1,this.spinnerColor="black",this.backgroundColor="black",this.videoConstraints={width:{ideal:t.width},height:{ideal:t.height},facingMode:"environment",resizeMode:"none",experimental:{focusMode:"continous",focusDistance:0}}}static mapVideoConstraints(t,e){t.videoConstraints&&this.mapValues(t.videoConstraints,e.videoConstraints)}}o.DEFAULT_VIDEO_RESOLUTION_4K={width:3840,height:2160},o.DEFAULT_VIDEO_RESOLUTION_HD={width:1920,height:1080},o.DEFAULT_ACCEPTED_BRIGHTNESS_SCORE=0,o.DEFAULT_ACCEPTED_ANGLE_SCORE=75,o.DEFAULT_ACCEPTED_SIZE_SCORE=75},,function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));class i{static initialize(t=!1){this.verbose=t}static debug(t){this.verbose&&console.log("ScanbotSDK:",t)}static debugWarn(t){this.verbose&&console.warn("ScanbotSDK:",t)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var i=function(t,e,n,i){return new(n||(n=Promise))((function(o,r){function a(t){try{l(i.next(t))}catch(t){r(t)}}function s(t){try{l(i.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((i=i.apply(t,e||[])).next())}))};class o extends Error{constructor(t,e,n){super(e),this.name="",this.name=t,this.message=e,this.webApiError=n}static mediaDevicesUndefined(){return new o(this.MESSAGE.DEVICES_UNDEFINED,"Does your device even have a camera? If so, please use a secure context (HTTPS) or use 'localhost' explicitly.")}static enumerateDevicesFailed(){return new o(this.MESSAGE.DEVICES_UNDEFINED,"Does your device even have a camera? Because we're unable to query query navigator.mediaDevices?.enumerateDevices")}static mediaDeviceNotFound(t){return new o(this.MESSAGE.ENUMERATE_FAILED,"Does your device even have a camera? Because we were unable to query navigator.mediaDevices?.getUserMedia().",t)}static permissionDenied(t){return new o(this.MESSAGE.PERMISSION_DENIED,"Camera permission has not been granted. Please prompt your users again to grant permission.",t)}static unknown(t){return new o(this.MESSAGE.UNKNOWN,"\n Unfortunately we were unable to query navigator.mediaDevicess.getUserMedia, \n and unable to determine the reason why. This may be caused by the user to denied the permission prompt. \n Or you may be using an in-app browser that itself has not been granted permission to use the camera.\n Or your users may be using a niche browser that does not support the media API at all!\n ",t)}static tryCheckPermission(){return i(this,void 0,void 0,(function*(){if(!this.permissionState)try{const t=yield navigator.permissions.query({name:"camera"});this.permissionState=t.state}catch(t){this.permissionState=this.PERMISSION_STATE.UNKNOWN}}))}static hasDeniedPermission(){return this.permissionState===this.PERMISSION_STATE.DENIED}static hasCheckedPermission(){return!!this.permissionState}}o.PERMISSION_STATE={GRANTED:"granted",DENIED:"denied",PROMPT:"prompt",UNKNOWN:"unknown"},o.MESSAGE={DEVICES_UNDEFINED:"MediaError_DevicesUndefined",DEVICE_NOT_FOUND:"MediaError_DeviceNotFound",ENUMERATE_FAILED:"MediaError_EnumerateFailed",PERMISSION_DENIED:"MediaError_PermissionDenied",UNKNOWN:"MediaError_Unknown"}},function(t,e,n){"use strict";n.r(e),n.d(e,"SingleScanningMode",(function(){return m})),n.d(e,"Resolution",(function(){return g})),n.d(e,"CameraConfiguration",(function(){return v})),n.d(e,"TopBarConfiguration",(function(){return b.a})),n.d(e,"ActionBarConfiguration",(function(){return y})),n.d(e,"BarcodeUseCase",(function(){return A})),n.d(e,"Palette",(function(){return i.f})),n.d(e,"StyledText",(function(){return i.j})),n.d(e,"IconStyle",(function(){return i.e})),n.d(e,"PolygonStyle",(function(){return i.g})),n.d(e,"BackgroundStyle",(function(){return i.a})),n.d(e,"ForegroundStyle",(function(){return i.d})),n.d(e,"RoundButton",(function(){return i.h})),n.d(e,"BadgedButton",(function(){return i.b})),n.d(e,"ButtonConfiguration",(function(){return i.c})),n.d(e,"Sound",(function(){return i.i})),n.d(e,"Vibration",(function(){return i.l})),n.d(e,"Timeouts",(function(){return i.k})),n.d(e,"ViewFinderConfiguration",(function(){return O})),n.d(e,"FinderStyle",(function(){return L})),n.d(e,"FinderCorneredStyle",(function(){return T})),n.d(e,"FinderStrokedStyle",(function(){return k})),n.d(e,"UserGuidanceConfiguration",(function(){return D})),n.d(e,"BarcodeItemErrorState",(function(){return h})),n.d(e,"BarcodeMappedData",(function(){return p})),n.d(e,"BarcodeInfoMapping",(function(){return f})),n.d(e,"ExpectedBarcode",(function(){return P})),n.d(e,"BarcodeTextLocalization",(function(){return R})),n.d(e,"BarcodeRecognizerConfiguration",(function(){return I})),n.d(e,"ArOverlayPolygonConfiguration",(function(){return r})),n.d(e,"BarcodeItemConfiguration",(function(){return a})),n.d(e,"BadgeStyle",(function(){return s})),n.d(e,"ArOverlayGeneralConfiguration",(function(){return l})),n.d(e,"FindAndPickArOverlayPolygonConfiguration",(function(){return c})),n.d(e,"FindAndPickBadgeConfiguration",(function(){return u})),n.d(e,"ArOverlayFindAndPickConfiguration",(function(){return d})),n.d(e,"BarcodeScannerConfiguration",(function(){return B})),n.d(e,"BarcodeItem",(function(){return M})),n.d(e,"Sheet",(function(){return C})),n.d(e,"SwipeToDelete",(function(){return S})),n.d(e,"ManualCountEditDialog",(function(){return w})),n.d(e,"SheetContent",(function(){return x})),n.d(e,"MultipleScanningMode",(function(){return E})),n.d(e,"ScanbotAlertDialog",(function(){return j})),n.d(e,"CameraPermissionScreen",(function(){return F})),n.d(e,"BarcodeScannerResult",(function(){return z}));var i=n(1),o=n(7);class r extends o.a{constructor(t={}){super(),this.visible=!0,this.deselected=new i.g({strokeColor:"?sbColorSurface",fillColor:"#00000000",strokeWidth:2,cornerRadius:2}),this.selected=new i.g({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:2,cornerRadius:2}),void 0!==t.visible&&(this.visible=t.visible),void 0!==t.deselected&&(this.deselected=new i.g(t.deselected)),void 0!==t.selected&&(this.selected=new i.g(t.selected))}}class a extends o.a{constructor(t={}){super(),this.imageVisible=!0,this.titleSelected=new i.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),this.subtitleSelected=new i.j({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),this.titleDeselected=new i.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),this.subtitleDeselected=new i.j({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),this.backgroundSelected=new i.g({strokeColor:"?sbColorPositive",fillColor:"?sbColorPositive",strokeWidth:0,cornerRadius:10}),this.backgroundDeselected=new i.g({strokeColor:"?sbColorSurface",fillColor:"?sbColorSurface",strokeWidth:0,cornerRadius:10}),void 0!==t.imageVisible&&(this.imageVisible=t.imageVisible),void 0!==t.titleSelected&&(this.titleSelected=new i.j(t.titleSelected)),void 0!==t.subtitleSelected&&(this.subtitleSelected=new i.j(t.subtitleSelected)),void 0!==t.titleDeselected&&(this.titleDeselected=new i.j(t.titleDeselected)),void 0!==t.subtitleDeselected&&(this.subtitleDeselected=new i.j(t.subtitleDeselected)),void 0!==t.backgroundSelected&&(this.backgroundSelected=new i.g(t.backgroundSelected)),void 0!==t.backgroundDeselected&&(this.backgroundDeselected=new i.g(t.backgroundDeselected))}}class s extends o.a{constructor(t={}){if(super(),this.visible=!0,this.foregroundColor="?sbColorOnSurface",void 0!==t.visible&&(this.visible=t.visible),void 0===t.background)throw new Error("background must be present in constructor argument");this.background=new i.a(t.background),void 0!==t.foregroundColor&&(this.foregroundColor=t.foregroundColor)}}class l extends o.a{constructor(t={}){super(),this.visible=!1,this.counterBadge=new s({background:new i.a({}),foregroundColor:"?sbColorOnSurface"}),this.automaticSelectionEnabled=!1,this.barcodeItemInfoPosition="BELOW",this.polygon=new r({visible:!0,deselected:new i.g({}),selected:new i.g({})}),this.barcodeItemConfiguration=new a({imageVisible:!0,titleSelected:new i.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),subtitleSelected:new i.j({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),titleDeselected:new i.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),subtitleDeselected:new i.j({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),backgroundSelected:new i.g({strokeColor:"?sbColorPositive",fillColor:"?sbColorPositive",strokeWidth:1,cornerRadius:5}),backgroundDeselected:new i.g({strokeColor:"?sbColorSurface",fillColor:"?sbColorSurface",strokeWidth:1,cornerRadius:5})}),void 0!==t.visible&&(this.visible=t.visible),void 0!==t.counterBadge&&(this.counterBadge=new s(t.counterBadge)),void 0!==t.automaticSelectionEnabled&&(this.automaticSelectionEnabled=t.automaticSelectionEnabled),void 0!==t.barcodeItemInfoPosition&&(this.barcodeItemInfoPosition=t.barcodeItemInfoPosition),void 0!==t.polygon&&(this.polygon=new r(t.polygon)),void 0!==t.barcodeItemConfiguration&&(this.barcodeItemConfiguration=new a(t.barcodeItemConfiguration))}}class c extends o.a{constructor(t={}){super(),this.visible=!0,this.partiallyScanned=new i.g({strokeColor:"?sbColorWarning",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),this.rejected=new i.g({strokeColor:"?sbColorSurface",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),this.completed=new i.g({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),void 0!==t.visible&&(this.visible=t.visible),void 0!==t.partiallyScanned&&(this.partiallyScanned=new i.g(t.partiallyScanned)),void 0!==t.rejected&&(this.rejected=new i.g(t.rejected)),void 0!==t.completed&&(this.completed=new i.g(t.completed))}}class u extends o.a{constructor(t={}){super(),this.partiallyScanned=new s({visible:!0,background:new i.a({strokeColor:"#FFFFFF30",fillColor:"?sbColorWarning",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),this.rejected=new s({visible:!0,background:new i.a({strokeColor:"#FFFFFF30",fillColor:"?sbColorNegative",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),this.completed=new s({visible:!0,background:new i.a({strokeColor:"#FFFFFF30",fillColor:"?sbColorPositive",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),void 0!==t.partiallyScanned&&(this.partiallyScanned=new s(t.partiallyScanned)),void 0!==t.rejected&&(this.rejected=new s(t.rejected)),void 0!==t.completed&&(this.completed=new s(t.completed))}}class d extends o.a{constructor(t={}){super(),this.visible=!1,this.automaticSelectionEnabled=!0,this.polygon=new c({}),this.badge=new u({}),void 0!==t.visible&&(this.visible=t.visible),void 0!==t.automaticSelectionEnabled&&(this.automaticSelectionEnabled=t.automaticSelectionEnabled),void 0!==t.polygon&&(this.polygon=new c(t.polygon)),void 0!==t.badge&&(this.badge=new u(t.badge))}}class h extends o.a{constructor(t={}){super(),this.title=new i.j({text:"Connection Error!",color:"?sbColorOnSurface"}),this.subtitle=new i.j({text:"There was an issue and the data requested was not fetched. You could try again or discard this result to start a new scan.",color:"?sbColorOnSurfaceVariant"}),this.retryButton=new i.c({}),this.cancelButton=new i.c({}),void 0!==t.title&&(this.title=new i.j(t.title)),void 0!==t.subtitle&&(this.subtitle=new i.j(t.subtitle)),void 0!==t.retryButton&&(this.retryButton=new i.c(t.retryButton)),void 0!==t.cancelButton&&(this.cancelButton=new i.c(t.cancelButton))}}class p extends o.a{constructor(t={}){if(super(),void 0===t.title)throw new Error("title must be present in constructor argument");if(this.title=t.title,void 0===t.subtitle)throw new Error("subtitle must be present in constructor argument");if(this.subtitle=t.subtitle,void 0===t.barcodeImage)throw new Error("barcodeImage must be present in constructor argument");this.barcodeImage=t.barcodeImage}}class f extends o.a{constructor(t={}){super(),this.barcodeItemMapper=null,this.sheetColor="?sbColorSurface",this.dividerColor="?sbColorOutline",this.modalOverlayColor="?sbColorModalOverlay",this.loadingMessage=new i.j({text:"Loading message for barcode info mapping.",color:"?sbColorPrimary"}),this.errorState=new h({}),void 0!==t.barcodeItemMapper&&(this.barcodeItemMapper=null!=t.barcodeItemMapper?t.barcodeItemMapper:null),void 0!==t.sheetColor&&(this.sheetColor=t.sheetColor),void 0!==t.dividerColor&&(this.dividerColor=t.dividerColor),void 0!==t.modalOverlayColor&&(this.modalOverlayColor=t.modalOverlayColor),void 0!==t.loadingMessage&&(this.loadingMessage=new i.j(t.loadingMessage)),void 0!==t.errorState&&(this.errorState=new h(t.errorState))}}class m extends o.a{constructor(t={}){super(),this._type="SingleScanningMode",this.confirmationSheetEnabled=!1,this.barcodeImageVisible=!0,this.sheetColor="?sbColorSurface",this.dividerColor="?sbColorOutline",this.modalOverlayColor="?sbColorModalOverlay",this.barcodeTitle=new i.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),this.barcodeSubtitle=new i.j({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),this.submitButton=new i.c({visible:!0,text:"?sheetSubmitButton",background:new i.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new i.d({iconVisible:!0,color:"?sbColorOnPrimary"})}),this.cancelButton=new i.c({visible:!0,text:"?singleModeConfirmationCancelButton",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorPrimary"})}),this.barcodeInfoMapping=new f({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",modalOverlayColor:"?sbColorModalOverlay",loadingMessage:new i.j({text:"?barcodeInfoMappingLoadingMessage",color:"?sbColorPrimary"}),errorState:new h({title:new i.j({text:"?barcodeInfoMappingErrorStateTitle",color:"?sbColorOnSurface"}),subtitle:new i.j({text:"?barcodeInfoMappingErrorStateSubtitle",color:"?sbColorOnSurfaceVariant"}),retryButton:new i.c({visible:!0,text:"?barcodeInfoMappingErrorStateRetryButton",background:new i.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new i.d({iconVisible:!0,color:"?sbColorOnPrimary"})}),cancelButton:new i.c({text:"?barcodeInfoMappingErrorStateCancelButton",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorPrimary"})})})}),this.arOverlay=new l({visible:!1,counterBadge:new s({visible:!0,background:new i.a({strokeColor:"#000000FF",fillColor:"?sbColorPositive",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),automaticSelectionEnabled:!1,barcodeItemInfoPosition:"BELOW",polygon:new r({visible:!0,deselected:new i.g({strokeColor:"?sbColorSurface",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),selected:new i.g({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:3,cornerRadius:5})}),barcodeItemConfiguration:new a({imageVisible:!0,titleSelected:new i.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),subtitleSelected:new i.j({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),titleDeselected:new i.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),subtitleDeselected:new i.j({visible:!0,text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant",useShadow:!1}),backgroundSelected:new i.g({strokeColor:"?sbColorPositive",fillColor:"?sbColorPositive",strokeWidth:1,cornerRadius:5}),backgroundDeselected:new i.g({strokeColor:"?sbColorSurface",fillColor:"?sbColorSurface",strokeWidth:1,cornerRadius:5})})}),void 0!==t.confirmationSheetEnabled&&(this.confirmationSheetEnabled=t.confirmationSheetEnabled),void 0!==t.barcodeImageVisible&&(this.barcodeImageVisible=t.barcodeImageVisible),void 0!==t.sheetColor&&(this.sheetColor=t.sheetColor),void 0!==t.dividerColor&&(this.dividerColor=t.dividerColor),void 0!==t.modalOverlayColor&&(this.modalOverlayColor=t.modalOverlayColor),void 0!==t.barcodeTitle&&(this.barcodeTitle=new i.j(t.barcodeTitle)),void 0!==t.barcodeSubtitle&&(this.barcodeSubtitle=new i.j(t.barcodeSubtitle)),void 0!==t.submitButton&&(this.submitButton=new i.c(t.submitButton)),void 0!==t.cancelButton&&(this.cancelButton=new i.c(t.cancelButton)),void 0!==t.barcodeInfoMapping&&(this.barcodeInfoMapping=new f(t.barcodeInfoMapping)),void 0!==t.arOverlay&&(this.arOverlay=new l(t.arOverlay))}}class g extends o.a{constructor(t={}){if(super(),void 0===t.width)throw new Error("width must be present in constructor argument");if(this.width=t.width,void 0===t.height)throw new Error("height must be present in constructor argument");this.height=t.height}}class v extends o.a{constructor(t={}){super(),this.cameraModule="BACK",this.zoomSteps=[1,2,5],this.defaultZoomFactor=1,this.flashEnabled=!1,this.idealPreviewResolution=new g({width:1920,height:1080}),void 0!==t.cameraModule&&(this.cameraModule=t.cameraModule),void 0!==t.zoomSteps&&(this.zoomSteps=t.zoomSteps.map((t=>t))),void 0!==t.defaultZoomFactor&&(this.defaultZoomFactor=t.defaultZoomFactor),void 0!==t.flashEnabled&&(this.flashEnabled=t.flashEnabled),void 0!==t.idealPreviewResolution&&(this.idealPreviewResolution=new g(t.idealPreviewResolution))}}var A,b=n(26);class y extends o.a{constructor(t={}){super(),this.flashButton=new i.h({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorWarning",activeForegroundColor:"#1C1B1F"}),this.zoomButton=new i.h({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"}),this.flipCameraButton=new i.h({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"}),void 0!==t.flashButton&&(this.flashButton=new i.h(t.flashButton)),void 0!==t.zoomButton&&(this.zoomButton=new i.h(t.zoomButton)),void 0!==t.flipCameraButton&&(this.flipCameraButton=new i.h(t.flipCameraButton))}}class C extends o.a{constructor(t={}){super(),this.mode="COLLAPSED_SHEET",this.collapsedVisibleHeight="SMALL",this.listButton=new i.b({}),void 0!==t.mode&&(this.mode=t.mode),void 0!==t.collapsedVisibleHeight&&(this.collapsedVisibleHeight=t.collapsedVisibleHeight),void 0!==t.listButton&&(this.listButton=new i.b(t.listButton))}}class S extends o.a{constructor(t={}){super(),this.enabled=!0,this.backgroundColor="?sbColorNegative",this.iconColor="?sbColorOnPrimary",void 0!==t.enabled&&(this.enabled=t.enabled),void 0!==t.backgroundColor&&(this.backgroundColor=t.backgroundColor),void 0!==t.iconColor&&(this.iconColor=t.iconColor)}}class w extends o.a{constructor(t={}){super(),this.sheetColor="?sbColorSurface",this.dividerColor="?sbColorOutline",this.modalOverlayColor="?sbColorModalOverlay",this.title=new i.j({text:"Update count",color:"?sbColorOnSurface"}),this.info=new i.j({text:"Adjust the number of items you scanned.",color:"?sbColorOnSurfaceVariant"}),this.updateButton=new i.c({visible:!0,text:"Update",background:new i.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),this.cancelButton=new i.c({visible:!0,text:"Cancel",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})}),this.clearTextButton=new i.e({visible:!0,color:"?sbColorOnSurfaceVariant"}),void 0!==t.sheetColor&&(this.sheetColor=t.sheetColor),void 0!==t.dividerColor&&(this.dividerColor=t.dividerColor),void 0!==t.modalOverlayColor&&(this.modalOverlayColor=t.modalOverlayColor),void 0!==t.title&&(this.title=new i.j(t.title)),void 0!==t.info&&(this.info=new i.j(t.info)),void 0!==t.updateButton&&(this.updateButton=new i.c(t.updateButton)),void 0!==t.cancelButton&&(this.cancelButton=new i.c(t.cancelButton)),void 0!==t.clearTextButton&&(this.clearTextButton=new i.e(t.clearTextButton))}}class x extends o.a{constructor(t={}){super(),this.sheetColor="?sbColorSurface",this.dividerColor="?sbColorOutline",this.manualCountChangeEnabled=!0,this.manualCountOutlineColor="?sbColorOutline",this.manualCountChangeColor="?sbColorPrimary",this.title=new i.j({text:"%d items",color:"?sbColorOnSurface"}),this.clearAllButton=new i.c({visible:!0,text:"Clear all",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),this.barcodeItemTitle=new i.j({visible:!0,text:"BARCODE_TITLE",color:"?sbColorOnSurface",useShadow:!1}),this.barcodeItemSubtitle=new i.j({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),this.barcodeItemImageVisible=!0,this.submitButton=new i.c({visible:!0,text:"Submit",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),this.startScanningButton=new i.c({visible:!0,text:"Start scanning",background:new i.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new i.d({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),this.placeholderTitle=new i.j({text:"No barcodes here!",color:"?sbColorOnSurface"}),this.placeholderSubtitle=new i.j({text:"The barcode list is currently empty. Close this sheet and scan your items to add them.",color:"?sbColorOnSurfaceVariant"}),this.placeholderIconBackground="?sbColorOutline",this.placeholderIcon=new i.e({visible:!0,color:"?sbColorOnSurface"}),this.swipeToDelete=new S({enabled:!0,backgroundColor:"?sbColorNegative",iconColor:"?sbColorOnPrimary"}),void 0!==t.sheetColor&&(this.sheetColor=t.sheetColor),void 0!==t.dividerColor&&(this.dividerColor=t.dividerColor),void 0!==t.manualCountChangeEnabled&&(this.manualCountChangeEnabled=t.manualCountChangeEnabled),void 0!==t.manualCountOutlineColor&&(this.manualCountOutlineColor=t.manualCountOutlineColor),void 0!==t.manualCountChangeColor&&(this.manualCountChangeColor=t.manualCountChangeColor),void 0!==t.title&&(this.title=new i.j(t.title)),void 0!==t.clearAllButton&&(this.clearAllButton=new i.c(t.clearAllButton)),void 0!==t.barcodeItemTitle&&(this.barcodeItemTitle=new i.j(t.barcodeItemTitle)),void 0!==t.barcodeItemSubtitle&&(this.barcodeItemSubtitle=new i.j(t.barcodeItemSubtitle)),void 0!==t.barcodeItemImageVisible&&(this.barcodeItemImageVisible=t.barcodeItemImageVisible),void 0!==t.submitButton&&(this.submitButton=new i.c(t.submitButton)),void 0!==t.startScanningButton&&(this.startScanningButton=new i.c(t.startScanningButton)),void 0!==t.placeholderTitle&&(this.placeholderTitle=new i.j(t.placeholderTitle)),void 0!==t.placeholderSubtitle&&(this.placeholderSubtitle=new i.j(t.placeholderSubtitle)),void 0!==t.placeholderIconBackground&&(this.placeholderIconBackground=t.placeholderIconBackground),void 0!==t.placeholderIcon&&(this.placeholderIcon=new i.e(t.placeholderIcon)),void 0!==t.swipeToDelete&&(this.swipeToDelete=new S(t.swipeToDelete))}}class E extends o.a{constructor(t={}){super(),this._type="MultipleScanningMode",this.countingRepeatDelay=1e3,this.mode="COUNTING",this.sheet=new C({mode:"COLLAPSED_SHEET",collapsedVisibleHeight:"SMALL",listButton:new i.b({badgeBackgroundColor:"?sbColorSurface",badgeForegroundColor:"?sbColorPrimary",visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"})}),this.sheetContent=new x({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",manualCountChangeEnabled:!0,manualCountOutlineColor:"?sbColorOutline",manualCountChangeColor:"?sbColorPrimary",title:new i.j({text:"?multipleModeSheetTitle",color:"?sbColorOnSurface"}),clearAllButton:new i.c({visible:!0,text:"?sheetClearAllButton",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),barcodeItemTitle:new i.j({visible:!0,text:"BARCODE_TITLE",color:"?sbColorOnSurface",useShadow:!1}),barcodeItemSubtitle:new i.j({visible:!0,text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant",useShadow:!1}),barcodeItemImageVisible:!0,submitButton:new i.c({visible:!0,text:"?sheetSubmitButton",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),startScanningButton:new i.c({visible:!0,text:"?sheetStartScanningButton",background:new i.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),placeholderTitle:new i.j({visible:!0,text:"?sheetPlaceholderTitle",color:"?sbColorOnSurface",useShadow:!1}),placeholderSubtitle:new i.j({visible:!0,text:"?sheetPlaceholderSubtitle",color:"?sbColorOnSurfaceVariant",useShadow:!1}),placeholderIconBackground:"?sbColorOutline",placeholderIcon:new i.e({visible:!0,color:"?sbColorOnSurface"}),swipeToDelete:new S({enabled:!0,backgroundColor:"?sbColorNegative",iconColor:"?sbColorOnPrimary"})}),this.manualCountEditDialog=new w({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",modalOverlayColor:"?sbColorModalOverlay",title:new i.j({text:"?manualCountEditDialogTitle",color:"?sbColorOnSurface"}),info:new i.j({text:"?manualCountEditDialogInfo",color:"?sbColorOnSurfaceVariant"}),updateButton:new i.c({visible:!0,text:"?manualCountEditDialogUpdateButton",background:new i.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),cancelButton:new i.c({visible:!0,text:"?manualCountEditDialogCancelButton",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})}),clearTextButton:new i.e({visible:!0,color:"?sbColorOnSurfaceVariant"})}),this.barcodeInfoMapping=new f({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",modalOverlayColor:"?sbColorModalOverlay",loadingMessage:new i.j({text:"?barcodeInfoMappingLoadingMessage",color:"?sbColorPrimary"}),errorState:new h({title:new i.j({text:"?barcodeInfoMappingErrorStateTitle",color:"?sbColorOnSurface"}),subtitle:new i.j({text:"?barcodeInfoMappingErrorStateSubtitle",color:"?sbColorOnSurfaceVariant"}),retryButton:new i.c({visible:!0,text:"?barcodeInfoMappingErrorStateRetryButton",background:new i.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new i.d({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),cancelButton:new i.c({visible:!0,text:"?barcodeInfoMappingErrorStateCancelButton",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})})})}),this.arOverlay=new l({visible:!1,counterBadge:new s({visible:!0,background:new i.a({strokeColor:"#FF000000",fillColor:"?sbColorPositive",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),automaticSelectionEnabled:!1,barcodeItemInfoPosition:"BELOW",polygon:new r({visible:!0,deselected:new i.g({strokeColor:"?sbColorSurface",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),selected:new i.g({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:3,cornerRadius:5})}),barcodeItemConfiguration:new a({imageVisible:!0,titleSelected:new i.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),subtitleSelected:new i.j({visible:!0,text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant",useShadow:!1}),titleDeselected:new i.j({visible:!0,text:"BARCODE_TITLE",color:"?sbColorOnSurface",useShadow:!1}),subtitleDeselected:new i.j({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),backgroundSelected:new i.g({strokeColor:"?sbColorPositive",fillColor:"?sbColorPositive",strokeWidth:1,cornerRadius:5}),backgroundDeselected:new i.g({strokeColor:"?sbColorSurface",fillColor:"?sbColorSurface",strokeWidth:1,cornerRadius:5})})}),void 0!==t.countingRepeatDelay&&(this.countingRepeatDelay=t.countingRepeatDelay),void 0!==t.mode&&(this.mode=t.mode),void 0!==t.sheet&&(this.sheet=new C(t.sheet)),void 0!==t.sheetContent&&(this.sheetContent=new x(t.sheetContent)),void 0!==t.manualCountEditDialog&&(this.manualCountEditDialog=new w(t.manualCountEditDialog)),void 0!==t.barcodeInfoMapping&&(this.barcodeInfoMapping=new f(t.barcodeInfoMapping)),void 0!==t.arOverlay&&(this.arOverlay=new l(t.arOverlay))}}(A||(A={})).From=function(t){const e=t._type;switch(e){case"SingleScanningMode":return new m(t);case"MultipleScanningMode":return new E(t);default:throw`Unknown child class name: ${e}`}};var L,_=n(18);class O extends o.a{constructor(t={}){super(),this.visible=!0,this.style=new T({strokeColor:"?sbColorSurface",strokeWidth:2,cornerRadius:10}),this.overlayColor="?sbColorSurfaceLow",this.aspectRatio=new _.AspectRatio({width:1,height:1}),void 0!==t.visible&&(this.visible=t.visible),void 0!==t.style&&(this.style=L.From(t.style)),void 0!==t.overlayColor&&(this.overlayColor=t.overlayColor),void 0!==t.aspectRatio&&(this.aspectRatio=new _.AspectRatio(t.aspectRatio))}}!function(t){t.From=function(t){const e=t._type;switch(e){case"FinderCorneredStyle":return new T(t);case"FinderStrokedStyle":return new k(t);default:throw`Unknown child class name: ${e}`}}}(L||(L={}));class T extends o.a{constructor(t={}){super(),this._type="FinderCorneredStyle",this.strokeColor="#FFFFFFFF",this.strokeWidth=3,this.cornerRadius=10,void 0!==t.strokeColor&&(this.strokeColor=t.strokeColor),void 0!==t.strokeWidth&&(this.strokeWidth=t.strokeWidth),void 0!==t.cornerRadius&&(this.cornerRadius=t.cornerRadius)}}class k extends o.a{constructor(t={}){super(),this._type="FinderStrokedStyle",this.strokeColor="#FFFFFFFF",this.strokeWidth=3,this.cornerRadius=10,void 0!==t.strokeColor&&(this.strokeColor=t.strokeColor),void 0!==t.strokeWidth&&(this.strokeWidth=t.strokeWidth),void 0!==t.cornerRadius&&(this.cornerRadius=t.cornerRadius)}}class D extends o.a{constructor(t={}){super(),this.visible=!0,this.title=new i.j({color:"?sbColorOnPrimary"}),this.background=new i.a({strokeColor:"#00000000",fillColor:"?sbColorSurfaceLow"}),void 0!==t.visible&&(this.visible=t.visible),void 0!==t.title&&(this.title=new i.j(t.title)),void 0!==t.background&&(this.background=new i.a(t.background))}}class P extends o.a{constructor(t={}){if(super(),this.count=1,void 0===t.barcodeValue)throw new Error("barcodeValue must be present in constructor argument");if(this.barcodeValue=t.barcodeValue,void 0===t.title)throw new Error("title must be present in constructor argument");if(this.title=null!=t.title?t.title:null,void 0===t.image)throw new Error("image must be present in constructor argument");this.image=null!=t.image?t.image:null,void 0!==t.count&&(this.count=t.count)}}class R extends o.a{constructor(t={}){super(),this.cameraPermissionEnableCameraTitle="Camera permission denied!",this.cameraPermissionEnableCameraExplanation="Please allow the usage of the camera to start the scanning process.",this.cameraPermissionCloseButton="Close",this.topBarCancelButton="Cancel",this.topBarTitle="Scan Item",this.userGuidance="Move the finder over a barcode",this.barcodeInfoMappingLoadingMessage="Loading details...",this.barcodeInfoMappingErrorStateTitle="Connection Error!",this.barcodeInfoMappingErrorStateSubtitle="There was an issue and the data requested was not fetched. You could try again or discard this result to start a new scan.",this.barcodeInfoMappingErrorStateRetryButton="Retry",this.barcodeInfoMappingErrorStateCancelButton="Cancel",this.manualCountEditDialogTitle="Update count",this.manualCountEditDialogInfo="Adjust the number of items you scanned.",this.manualCountEditDialogUpdateButton="Update",this.manualCountEditDialogCancelButton="Cancel",this.sheetClearAllButton="Clear all",this.sheetSubmitButton="Submit",this.sheetStartScanningButton="Start scanning",this.sheetPlaceholderTitle="No barcodes here!",this.sheetPlaceholderSubtitle="The barcode list is currently empty. Close this sheet and scan your items to add them.",this.singleModeConfirmationCancelButton="Close",this.multipleModeSheetTitle="%d items",void 0!==t.cameraPermissionEnableCameraTitle&&(this.cameraPermissionEnableCameraTitle=t.cameraPermissionEnableCameraTitle),void 0!==t.cameraPermissionEnableCameraExplanation&&(this.cameraPermissionEnableCameraExplanation=t.cameraPermissionEnableCameraExplanation),void 0!==t.cameraPermissionCloseButton&&(this.cameraPermissionCloseButton=t.cameraPermissionCloseButton),void 0!==t.topBarCancelButton&&(this.topBarCancelButton=t.topBarCancelButton),void 0!==t.topBarTitle&&(this.topBarTitle=t.topBarTitle),void 0!==t.userGuidance&&(this.userGuidance=t.userGuidance),void 0!==t.barcodeInfoMappingLoadingMessage&&(this.barcodeInfoMappingLoadingMessage=t.barcodeInfoMappingLoadingMessage),void 0!==t.barcodeInfoMappingErrorStateTitle&&(this.barcodeInfoMappingErrorStateTitle=t.barcodeInfoMappingErrorStateTitle),void 0!==t.barcodeInfoMappingErrorStateSubtitle&&(this.barcodeInfoMappingErrorStateSubtitle=t.barcodeInfoMappingErrorStateSubtitle),void 0!==t.barcodeInfoMappingErrorStateRetryButton&&(this.barcodeInfoMappingErrorStateRetryButton=t.barcodeInfoMappingErrorStateRetryButton),void 0!==t.barcodeInfoMappingErrorStateCancelButton&&(this.barcodeInfoMappingErrorStateCancelButton=t.barcodeInfoMappingErrorStateCancelButton),void 0!==t.manualCountEditDialogTitle&&(this.manualCountEditDialogTitle=t.manualCountEditDialogTitle),void 0!==t.manualCountEditDialogInfo&&(this.manualCountEditDialogInfo=t.manualCountEditDialogInfo),void 0!==t.manualCountEditDialogUpdateButton&&(this.manualCountEditDialogUpdateButton=t.manualCountEditDialogUpdateButton),void 0!==t.manualCountEditDialogCancelButton&&(this.manualCountEditDialogCancelButton=t.manualCountEditDialogCancelButton),void 0!==t.sheetClearAllButton&&(this.sheetClearAllButton=t.sheetClearAllButton),void 0!==t.sheetSubmitButton&&(this.sheetSubmitButton=t.sheetSubmitButton),void 0!==t.sheetStartScanningButton&&(this.sheetStartScanningButton=t.sheetStartScanningButton),void 0!==t.sheetPlaceholderTitle&&(this.sheetPlaceholderTitle=t.sheetPlaceholderTitle),void 0!==t.sheetPlaceholderSubtitle&&(this.sheetPlaceholderSubtitle=t.sheetPlaceholderSubtitle),void 0!==t.singleModeConfirmationCancelButton&&(this.singleModeConfirmationCancelButton=t.singleModeConfirmationCancelButton),void 0!==t.multipleModeSheetTitle&&(this.multipleModeSheetTitle=t.multipleModeSheetTitle)}}class I extends o.a{constructor(t={}){super(),this.barcodesRegexFilter="",this.barcodeFormats=[],this.gs1Handling="PARSE",this.engineMode="NEXT_GEN_LOW_POWER",this.maximumRecognizerResolution=600,void 0!==t.barcodesRegexFilter&&(this.barcodesRegexFilter=t.barcodesRegexFilter),void 0!==t.barcodeFormats&&(this.barcodeFormats=t.barcodeFormats.map((t=>t))),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling),void 0!==t.engineMode&&(this.engineMode=t.engineMode),void 0!==t.maximumRecognizerResolution&&(this.maximumRecognizerResolution=t.maximumRecognizerResolution)}}class F extends o.a{constructor(t={}){super(),this.background="?sbColorSurface",this.iconBackground="?sbColorOutline",this.icon=new i.e({visible:!0,color:"?sbColorOnSurface"}),this.closeButton=new i.c({text:"Close",background:new i.a({}),foreground:new i.d({})}),this.enableCameraTitle=new i.j({text:"Camera permission denied!",color:"?colorOnSurface"}),this.enableCameraExplanation=new i.j({text:"Please allow the usage of the camera to start the scanning process.",color:"?sbColorOnSurfaceVariant"}),void 0!==t.background&&(this.background=t.background),void 0!==t.iconBackground&&(this.iconBackground=t.iconBackground),void 0!==t.icon&&(this.icon=new i.e(t.icon)),void 0!==t.closeButton&&(this.closeButton=new i.c(t.closeButton)),void 0!==t.enableCameraTitle&&(this.enableCameraTitle=new i.j(t.enableCameraTitle)),void 0!==t.enableCameraExplanation&&(this.enableCameraExplanation=new i.j(t.enableCameraExplanation))}}class B extends o.a{constructor(t={}){super(),this.version="1.0",this.screen="BarcodeScanner",this.palette=new i.f({sbColorPrimary:"#C8193C",sbColorPrimaryDisabled:"#F5F5F5",sbColorNegative:"#FF3737",sbColorPositive:"#4EFFB4",sbColorWarning:"#FFCE5C",sbColorSecondary:"#FFEDEE",sbColorSecondaryDisabled:"#F5F5F5",sbColorOnPrimary:"#FFFFFF",sbColorOnSecondary:"#C8193C",sbColorSurface:"#FFFFFF",sbColorOutline:"#EFEFEF",sbColorOnSurfaceVariant:"#707070",sbColorOnSurface:"#000000",sbColorSurfaceLow:"#00000026",sbColorSurfaceHigh:"#0000007A",sbColorModalOverlay:"#000000A3"}),this.localization=new R({}),this.backgroundColor="?sbColorSurfaceLow",this.topBar=new b.a({title:new i.j({text:"?topBarTitle",color:"?sbColorOnPrimary"}),mode:"SOLID",backgroundColor:"?sbColorPrimary",cancelButton:new i.c({visible:!0,text:"?topBarCancelButton",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new i.d({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})})}),this.actionBar=new y({flashButton:new i.h({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorWarning",activeForegroundColor:"#1C1B1F"}),zoomButton:new i.h({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"}),flipCameraButton:new i.h({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"})}),this.viewFinder=new O({visible:!0,style:new T({strokeColor:"?sbColorSurface",strokeWidth:2,cornerRadius:10}),overlayColor:"?sbColorSurfaceLow",aspectRatio:new _.AspectRatio({width:1,height:1})}),this.userGuidance=new D({visible:!0,title:new i.j({text:"?userGuidance",color:"?sbColorOnPrimary"}),background:new i.a({strokeColor:"#00000000",fillColor:"?sbColorSurfaceLow",strokeWidth:0})}),this.cameraPermission=new F({background:"?sbColorSurface",iconBackground:"?sbColorOutline",icon:new i.e({visible:!0,color:"?sbColorOnSurface"}),closeButton:new i.c({visible:!0,text:"?cameraPermissionCloseButton",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new i.d({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})}),enableCameraTitle:new i.j({text:"?cameraPermissionEnableCameraTitle",color:"?sbColorOnSurface"}),enableCameraExplanation:new i.j({text:"?cameraPermissionEnableCameraExplanation",color:"?sbColorOnSurfaceVariant"})}),this.cameraConfiguration=new v({}),this.recognizerConfiguration=new I({}),this.useCase=new m({}),this.sound=new i.i({successBeepEnabled:!0,soundType:"MODERN_BEEP"}),this.vibration=new i.l({enabled:!0}),this.timeouts=new i.k({autoCancelTimeout:0,initialScanDelay:0}),void 0!==t.version&&(this.version=t.version),void 0!==t.screen&&(this.screen=t.screen),void 0!==t.palette&&(this.palette=new i.f(t.palette)),void 0!==t.localization&&(this.localization=new R(t.localization)),void 0!==t.backgroundColor&&(this.backgroundColor=t.backgroundColor),void 0!==t.topBar&&(this.topBar=new b.a(t.topBar)),void 0!==t.actionBar&&(this.actionBar=new y(t.actionBar)),void 0!==t.viewFinder&&(this.viewFinder=new O(t.viewFinder)),void 0!==t.userGuidance&&(this.userGuidance=new D(t.userGuidance)),void 0!==t.cameraPermission&&(this.cameraPermission=new F(t.cameraPermission)),void 0!==t.cameraConfiguration&&(this.cameraConfiguration=new v(t.cameraConfiguration)),void 0!==t.recognizerConfiguration&&(this.recognizerConfiguration=new I(t.recognizerConfiguration)),void 0!==t.useCase&&(this.useCase=A.From(t.useCase)),void 0!==t.sound&&(this.sound=new i.i(t.sound)),void 0!==t.vibration&&(this.vibration=new i.l(t.vibration)),void 0!==t.timeouts&&(this.timeouts=new i.k(t.timeouts))}}var W=n(8);class M extends W.BarcodeScannerTypes.BarcodeItem{constructor(t,e){super(e),this.count=t}}class j extends o.a{constructor(t={}){if(super(),this.title=new i.j({text:"Title",color:"?sbColorOnSurface"}),this.subtitle=new i.j({text:"Standard explanation message text.",color:"?sbColorOnSurfaceVariant"}),this.sheetColor="?sbColorSurface",this.modalOverlayColor="?sbColorModalOverlay",this.dividerColor="?sbColorOutline",void 0!==t.title&&(this.title=new i.j(t.title)),void 0!==t.subtitle&&(this.subtitle=new i.j(t.subtitle)),void 0!==t.sheetColor&&(this.sheetColor=t.sheetColor),void 0!==t.modalOverlayColor&&(this.modalOverlayColor=t.modalOverlayColor),void 0!==t.dividerColor&&(this.dividerColor=t.dividerColor),void 0===t.okButton)throw new Error("okButton must be present in constructor argument");if(this.okButton=new i.c(t.okButton),void 0===t.cancelButton)throw new Error("cancelButton must be present in constructor argument");this.cancelButton=new i.c(t.cancelButton)}}class z{constructor(t){this.items=t}}},,function(t,e,n){"use strict";n.r(e),n.d(e,"LineSegmentInt",(function(){return o})),n.d(e,"LineSegmentFloat",(function(){return r})),n.d(e,"AspectRatio",(function(){return a}));var i=n(4);class o extends i.a{constructor(t={}){if(super(),void 0===t.start)throw new Error("start must be present in constructor argument");if(this.start={x:t.start.x,y:t.start.y},void 0===t.end)throw new Error("end must be present in constructor argument");this.end={x:t.end.x,y:t.end.y}}}class r extends i.a{constructor(t={}){if(super(),void 0===t.start)throw new Error("start must be present in constructor argument");if(this.start={x:t.start.x,y:t.start.y},void 0===t.end)throw new Error("end must be present in constructor argument");this.end={x:t.end.x,y:t.end.y}}}class a extends i.a{constructor(t={}){super(),this.width=1,this.height=1,void 0!==t.width&&(this.width=t.width),void 0!==t.height&&(this.height=t.height)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));class i{constructor(t,e,n,i){this.x=t,this.y=e,this.width=n,this.height=i}scaleDown(t){return new i(this.x/t,this.y/t,this.width/t,this.height/t)}bottom(){return this.y+this.height}static withSize(t,e){return new i(0,0,t,e)}static empty(){return new i(0,0,0,0)}static fromRect(t){return t?new i(t.x,t.y,t.width,t.height):i.empty()}static fromPoint(t,e){return new i(t.x-e/2,t.y-e/2,e,e)}static fromDOMRect(t){return new i(t.x,t.y,t.width,t.height)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n(12),o=n(16);class r extends i.a{constructor(t){super(t);const e=new o.BarcodeScannerConfiguration;this.finder=e.viewFinder,this.userGuidance=e.userGuidance}static mapFinderConfiguration(t,e){var n,o;i.a.mapValuesDeep(null!==(n=e.finder)&&void 0!==n?n:{},t.finder),i.a.mapValuesDeep(null!==(o=e.userGuidance)&&void 0!==o?o:{},t.userGuidance)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var i=n(0),o=n(15),r=function(t,e,n,i){return new(n||(n=Promise))((function(o,r){function a(t){try{l(i.next(t))}catch(t){r(t)}}function s(t){try{l(i.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((i=i.apply(t,e||[])).next())}))};class a extends i.default.Component{constructor(t){super(t),this.orientationchangeCallback=this.orientationChanged.bind(this),this.state={orientation:window.orientation,stream:void 0}}orientationChanged(t){this.setState({orientation:window.orientation})}setDeviceIdInConstraints(t){return r(this,void 0,void 0,(function*(){const e=this.props.preferredCamera;if(e)try{const n=(yield navigator.mediaDevices.enumerateDevices()).find((t=>t.deviceId===e||t.label===e));if(n)return Object.assign(Object.assign({},t),{deviceId:n.deviceId})}catch(t){throw o.a.enumerateDevicesFailed()}return t}))}componentDidMount(){return r(this,void 0,void 0,(function*(){window.addEventListener("orientationchange",this.orientationchangeCallback),yield this.refreshStream()}))}refreshStream(){var t,e,n,i,a,s,l,c;return r(this,void 0,void 0,(function*(){if(o.a.hasCheckedPermission()||(yield o.a.tryCheckPermission()),o.a.hasDeniedPermission())return void(null===(e=(t=this.props).onError)||void 0===e||e.call(t,o.a.permissionDenied()));const r={video:yield this.setDeviceIdInConstraints(this.props.videoConstraints)};try{if(!navigator.mediaDevices){const t=o.a.unknown();return null===(i=(n=this.props).onError)||void 0===i||i.call(n,t),void console.log(t)}this.stopCurrentStreams();try{const t=yield navigator.mediaDevices.getUserMedia(r);this.setState({stream:t},(()=>{var e,n,i,o;null===(n=(e=this.props).onStreamChanged)||void 0===n||n.call(e,t),null===(o=(i=this.props).onReady)||void 0===o||o.call(i)}))}catch(t){const e=o.a.mediaDeviceNotFound();return null===(s=(a=this.props).onError)||void 0===s||s.call(a,e),void console.error(e)}}catch(t){let e=o.a.unknown(t.message);return t instanceof DOMException&&("NotAllowedError"===t.name?e=o.a.permissionDenied("Specifically, the native 'NotAllowedError' was thrown."):"NotFoundError"===t.name&&(e=o.a.mediaDeviceNotFound("Specifically, the native 'NotFoundError' was thrown."))),null===(c=(l=this.props).onError)||void 0===c||c.call(l,e),void console.error(e)}}))}stopCurrentStreams(){return r(this,void 0,void 0,(function*(){const t=this.state.stream,e=null==t?void 0:t.getTracks();e&&e.forEach((t=>{t.stop()}))}))}componentWillUnmount(){window.removeEventListener("orientationchange",this.orientationchangeCallback),this.state.stream&&(this.state.stream.getVideoTracks&&this.state.stream.getAudioTracks&&(this.state.stream.getVideoTracks().forEach((t=>t.stop())),this.state.stream.getAudioTracks().forEach((t=>t.stop()))),this.setState({stream:void 0}))}render(){return this.props.children}updateTorch(t){return r(this,void 0,void 0,(function*(){const e=[{torch:t}];yield this.state.stream.getVideoTracks()[0].applyConstraints({advanced:e})}))}getCapabilities(){if(this.state.stream.getVideoTracks){const t=this.getVideoTrack();return a.getMediaTrackCapabilities(t)}}static getMediaTrackCapabilities(t){if(t&&t.getCapabilities)return t.getCapabilities()}getVideoTrack(){const t=this.state.stream.getVideoTracks();if(t.length>0)return t[0]}}var s=n(9),l=n(19),c=n(14),u=function(t,e,n,i){return new(n||(n=Promise))((function(o,r){function a(t){try{l(i.next(t))}catch(t){r(t)}}function s(t){try{l(i.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((i=i.apply(t,e||[])).next())}))};class d extends i.default.Component{constructor(t){super(t),this.videoLoaded=!1,this.reloadCanvas=!0,this.swapCameraEnabled=!0,this.activeCamera=void 0,this.save=!1,this.onStreamChanged=t=>{this.video.srcObject=t,this.updateCameraInfo(t),this.video.addEventListener("resize",(t=>{this.reloadCanvas=!0}),!1),this.video.addEventListener("loadeddata",(t=>{this.videoLoaded=!0,this.didLoadVideo&&this.didLoadVideo()}),!1)},this.state={facingModeBack:"environment"===this.props.videoConstraints.facingMode,mirrored:this.props.mirrored,deviceId:void 0}}videoSize(){const{clientVideoWidth:t,clientVideoHeight:e}=this.calculateClientVideoConstraints();return new s.a(t,e)}saveExtractedData(){this.save=!0}zoom(){var t;return null!==(t=this.props.zoom)&&void 0!==t?t:1}imageCapture(){if(this.capture)return this.capture;const t=this.videoStream.getVideoTrack();return this.capture=new ImageCapture(t),this.capture}createImageData(t=0,e){return u(this,void 0,void 0,(function*(){if(!this.video||!this.videoLoaded)return;const n=this.getCanvasRenderingContext();if(!n)return;if(e){const t=yield this.imageCapture().takePhoto(),e=yield createImageBitmap(t);c.a.debug("Bitmap size: "+e.width*e.height),n.canvas.width=e.width,n.canvas.height=e.height,n.drawImage(e,0,0,e.width,e.height);const i=this.windowSize(),o=e.height/(i.height+i.y),r=i.width*o,a=i.height*o,s=e.width/2-r/2,u=i.y*o,d=new l.a(s,u,r,a);c.a.debug("Frame size: "+d.x+"-"+d.y+"-"+d.width+"-"+d.height);return n.getImageData(d.x,d.y,d.width,d.height)}let{videoWidth:i,videoHeight:o}=this.video,{clientVideoWidth:r,clientVideoHeight:a,coef:s}=this.calculateClientVideoConstraints();if(0===s)return;const u=this.finderFrame||new l.a(0,0,r,a),d=this.zoom(),h=(i-r/d)/2,p=(o-a/d)/2,f=u.x/s+h,m=u.y/s+p,g=this.finderFrame?s:d,v=u.width/g,A=u.height/g,b=this.calculateFrameSize(t,v,A);n.canvas.width=Math.round(b.width),n.canvas.height=Math.round(b.height),n.drawImage(this.video,f,m,v,A,0,0,n.canvas.width,n.canvas.height);const y=n.getImageData(0,0,this.canvas.width,this.canvas.height);return n.clearRect(0,0,this.canvas.width,this.canvas.height),y}))}drawVideoOnCanvasAndExtractFrameFromIt(t){return u(this,void 0,void 0,(function*(){this.getCanvasRenderingContext(),this.video}))}windowSize(){var t;const e=this.props.configuration,n=null!==(t=e.container)&&void 0!==t?t:document.getElementById(e.containerId);if(!n)throw new Error("Container DOM element is required to calculate window size and snap image.");return l.a.fromDOMRect(n.getBoundingClientRect())}calculateClientVideoConstraints(){let{videoWidth:t,videoHeight:e}=this.video,n=this.video.getBoundingClientRect(),i=t,o=e,r=1;return n.width/n.height<=t/e?(r=n.height/e,r>0&&(i=n.width/r)):(r=n.width/t,r>0&&(o=n.height/r)),{clientVideoWidth:i,clientVideoHeight:o,coef:r}}calculateFrameSize(t,e,n){let i=e,o=n;if(t>0&&0!=e&&0!=n){const r=e/n;e>n?(i=e>t?t:e,o=i/r):(o=n>t?t:n,i=o*r)}return new s.a(i,o)}getCanvasRenderingContext(){if(!this.video)return null;if(0===this.video.videoWidth)return null;this.canvas&&!this.reloadCanvas||(this.canvas&&this.canvas.remove(),this.canvas=document.createElement("canvas"),this.canvas.className="scanbot-sdk-canvas-element",this.canvas.width=this.videoSize().width,this.canvas.height=this.videoSize().height,this.reloadCanvas=!1);const t=this.canvas.getContext("2d",{willReadFrequently:!0});return t.imageSmoothingEnabled=!1,t}releaseCanvas(){if(this.canvas){this.canvas.width=1,this.canvas.height=1;const t=this.canvas.getContext("2d");t&&t.clearRect(0,0,1,1),this.canvas=null}}componentWillUnmount(){this.releaseCanvas(),this.video=null,this.videoStream=null}style(){var t;const e={display:"block",width:100*this.zoom()+"%",height:100*this.zoom()+"%",left:`${this.zoomMargin()}%`,top:`${this.zoomMargin()}%`,position:"relative",objectFit:"cover",backgroundColor:null===(t=this.props.configuration)||void 0===t?void 0:t.backgroundColor};return this.state.mirrored&&(e.transform="scaleX(-1)"),e}zoomMargin(){const t=this.zoom();return 1===t?0:(1-t)/2*100}render(){const{videoConstraints:t,onReady:e,onError:n}=this.props;return i.default.createElement(a,{videoConstraints:t,preferredCamera:this.state.deviceId||this.props.preferredCamera,onReady:e,onStreamChanged:this.onStreamChanged,onError:n,ref:t=>{this.videoStream=t}},i.default.createElement("video",{autoPlay:!0,muted:!0,playsInline:!0,className:"scanbot-camera-view",ref:t=>{this.video=t},style:this.style()}))}setDirection(t){this.props.videoConstraints.facingMode={ideal:t},this.setState({facingModeBack:"environment"===t,mirrored:"user"===t},(()=>u(this,void 0,void 0,(function*(){yield this.videoStream.refreshStream(),this.swapCameraEnabled=!0}))))}swapCameraFacing(t){if(this.swapCameraEnabled){this.swapCameraEnabled=!1;const e=!this.state.facingModeBack,n=e?"environment":"user";this.props.videoConstraints.facingMode=!0===t?{exact:n}:{ideal:n},this.setState({facingModeBack:e,mirrored:!e},(()=>u(this,void 0,void 0,(function*(){yield this.videoStream.refreshStream(),this.swapCameraEnabled=!0}))))}}switchCamera(t,e){return u(this,void 0,void 0,(function*(){this.swapCameraEnabled&&(this.swapCameraEnabled=!1,this.props.videoConstraints.facingMode=void 0,this.setState({facingModeBack:void 0,mirrored:null!=e?e:this.state.mirrored,deviceId:t},(()=>u(this,void 0,void 0,(function*(){yield this.videoStream.refreshStream(),this.swapCameraEnabled=!0})))))}))}updateCameraInfo(t){const e=t.getTracks().filter((t=>"video"===t.kind));if(e){const t=e.map((t=>{var e;const n=t.label,i=t.getSettings().deviceId,o=t.getSettings().facingMode;let r="unknown";"user"===o?r="front":"environment"===o&&(r="back");return{deviceId:i,label:n,facingMode:r,supportsTorchControl:(null===(e=a.getMediaTrackCapabilities(t))||void 0===e?void 0:e.torch)||!1}}));this.activeCamera=t[0]}}getActiveCameraInfo(){return this.activeCamera}setTorchState(t){if(this.activeCamera&&this.activeCamera.supportsTorchControl){return this.videoStream.getVideoTrack().applyConstraints({advanced:[{torch:t}]})}return Promise.reject("Torch is not supported for current camera.")}}},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return Qt})),n.d(e,"b",(function(){return Zt}));var i=n(2),o=(n(40),n(0)),r=n(38),a=n.n(r),s=n(25),l=n(39),c="undefined"!=typeof t&&void 0!==t.env&&(t.env.REACT_APP_SC_ATTR||t.env.SC_ATTR)||"data-styled",u="active",d="data-styled-version",h="6.1.8",p="/*!sc*/\n",f="undefined"!=typeof window&&"HTMLElement"in window,m=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof t&&void 0!==t.env&&void 0!==t.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==t.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==t.env.REACT_APP_SC_DISABLE_SPEEDY&&t.env.REACT_APP_SC_DISABLE_SPEEDY:"undefined"!=typeof t&&void 0!==t.env&&void 0!==t.env.SC_DISABLE_SPEEDY&&""!==t.env.SC_DISABLE_SPEEDY&&("false"!==t.env.SC_DISABLE_SPEEDY&&t.env.SC_DISABLE_SPEEDY)),g=(new Set,Object.freeze([])),v=Object.freeze({});function A(t,e,n){return void 0===n&&(n=v),t.theme!==n.theme&&t.theme||e||n.theme}var b=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),y=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,C=/(^-|-$)/g;function S(t){return t.replace(y,"-").replace(C,"")}var w=/(a)(d)/gi,x=function(t){return String.fromCharCode(t+(t>25?39:97))};function E(t){var e,n="";for(e=Math.abs(t);e>52;e=e/52|0)n=x(e%52)+n;return(x(e%52)+n).replace(w,"$1-$2")}var L,_=function(t,e){for(var n=e.length;n;)t=33*t^e.charCodeAt(--n);return t},O=function(t){return _(5381,t)};function T(t){return E(O(t)>>>0)}function k(t){return t.displayName||t.name||"Component"}function D(t){return"string"==typeof t&&!0}var P="function"==typeof Symbol&&Symbol.for,R=P?Symbol.for("react.memo"):60115,I=P?Symbol.for("react.forward_ref"):60112,F={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},B={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},W={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},M=((L={})[I]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},L[R]=W,L);function j(t){return("type"in(e=t)&&e.type.$$typeof)===R?W:"$$typeof"in t?M[t.$$typeof]:F;var e}var z=Object.defineProperty,N=Object.getOwnPropertyNames,V=Object.getOwnPropertySymbols,U=Object.getOwnPropertyDescriptor,H=Object.getPrototypeOf,G=Object.prototype;function Q(t,e,n){if("string"!=typeof e){if(G){var i=H(e);i&&i!==G&&Q(t,i,n)}var o=N(e);V&&(o=o.concat(V(e)));for(var r=j(t),a=j(e),s=0;s<o.length;++s){var l=o[s];if(!(l in B||n&&n[l]||a&&l in a||r&&l in r)){var c=U(e,l);try{z(t,l,c)}catch(t){}}}}return t}function Z(t){return"function"==typeof t}function Y(t){return"object"==typeof t&&"styledComponentId"in t}function q(t,e){return t&&e?"".concat(t," ").concat(e):t||e||""}function X(t,e){if(0===t.length)return"";for(var n=t[0],i=1;i<t.length;i++)n+=e?e+t[i]:t[i];return n}function $(t){return null!==t&&"object"==typeof t&&t.constructor.name===Object.name&&!("props"in t&&t.$$typeof)}function K(t,e,n){if(void 0===n&&(n=!1),!n&&!$(t)&&!Array.isArray(t))return e;if(Array.isArray(e))for(var i=0;i<e.length;i++)t[i]=K(t[i],e[i]);else if($(e))for(var i in e)t[i]=K(t[i],e[i]);return t}function J(t,e){Object.defineProperty(t,"toString",{value:e})}function tt(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(t," for more information.").concat(e.length>0?" Args: ".concat(e.join(", ")):""))}var et=function(){function t(t){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=t}return t.prototype.indexOfGroup=function(t){for(var e=0,n=0;n<t;n++)e+=this.groupSizes[n];return e},t.prototype.insertRules=function(t,e){if(t>=this.groupSizes.length){for(var n=this.groupSizes,i=n.length,o=i;t>=o;)if((o<<=1)<0)throw tt(16,"".concat(t));this.groupSizes=new Uint32Array(o),this.groupSizes.set(n),this.length=o;for(var r=i;r<o;r++)this.groupSizes[r]=0}for(var a=this.indexOfGroup(t+1),s=(r=0,e.length);r<s;r++)this.tag.insertRule(a,e[r])&&(this.groupSizes[t]++,a++)},t.prototype.clearGroup=function(t){if(t<this.length){var e=this.groupSizes[t],n=this.indexOfGroup(t),i=n+e;this.groupSizes[t]=0;for(var o=n;o<i;o++)this.tag.deleteRule(n)}},t.prototype.getGroup=function(t){var e="";if(t>=this.length||0===this.groupSizes[t])return e;for(var n=this.groupSizes[t],i=this.indexOfGroup(t),o=i+n,r=i;r<o;r++)e+="".concat(this.tag.getRule(r)).concat(p);return e},t}(),nt=new Map,it=new Map,ot=1,rt=function(t){if(nt.has(t))return nt.get(t);for(;it.has(ot);)ot++;var e=ot++;return nt.set(t,e),it.set(e,t),e},at=function(t,e){ot=e+1,nt.set(t,e),it.set(e,t)},st="style[".concat(c,"][").concat(d,'="').concat(h,'"]'),lt=new RegExp("^".concat(c,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),ct=function(t,e,n){for(var i,o=n.split(","),r=0,a=o.length;r<a;r++)(i=o[r])&&t.registerName(e,i)},ut=function(t,e){for(var n,i=(null!==(n=e.textContent)&&void 0!==n?n:"").split(p),o=[],r=0,a=i.length;r<a;r++){var s=i[r].trim();if(s){var l=s.match(lt);if(l){var c=0|parseInt(l[1],10),u=l[2];0!==c&&(at(u,c),ct(t,u,l[3]),t.getTag().insertRules(c,o)),o.length=0}else o.push(s)}}};function dt(){return n.nc}var ht=function(t){var e=document.head,n=t||e,i=document.createElement("style"),o=function(t){var e=Array.from(t.querySelectorAll("style[".concat(c,"]")));return e[e.length-1]}(n),r=void 0!==o?o.nextSibling:null;i.setAttribute(c,u),i.setAttribute(d,h);var a=dt();return a&&i.setAttribute("nonce",a),n.insertBefore(i,r),i},pt=function(){function t(t){this.element=ht(t),this.element.appendChild(document.createTextNode("")),this.sheet=function(t){if(t.sheet)return t.sheet;for(var e=document.styleSheets,n=0,i=e.length;n<i;n++){var o=e[n];if(o.ownerNode===t)return o}throw tt(17)}(this.element),this.length=0}return t.prototype.insertRule=function(t,e){try{return this.sheet.insertRule(e,t),this.length++,!0}catch(t){return!1}},t.prototype.deleteRule=function(t){this.sheet.deleteRule(t),this.length--},t.prototype.getRule=function(t){var e=this.sheet.cssRules[t];return e&&e.cssText?e.cssText:""},t}(),ft=function(){function t(t){this.element=ht(t),this.nodes=this.element.childNodes,this.length=0}return t.prototype.insertRule=function(t,e){if(t<=this.length&&t>=0){var n=document.createTextNode(e);return this.element.insertBefore(n,this.nodes[t]||null),this.length++,!0}return!1},t.prototype.deleteRule=function(t){this.element.removeChild(this.nodes[t]),this.length--},t.prototype.getRule=function(t){return t<this.length?this.nodes[t].textContent:""},t}(),mt=function(){function t(t){this.rules=[],this.length=0}return t.prototype.insertRule=function(t,e){return t<=this.length&&(this.rules.splice(t,0,e),this.length++,!0)},t.prototype.deleteRule=function(t){this.rules.splice(t,1),this.length--},t.prototype.getRule=function(t){return t<this.length?this.rules[t]:""},t}(),gt=f,vt={isServer:!f,useCSSOMInjection:!m},At=function(){function t(t,e,n){void 0===t&&(t=v),void 0===e&&(e={});var o=this;this.options=Object(i.a)(Object(i.a)({},vt),t),this.gs=e,this.names=new Map(n),this.server=!!t.isServer,!this.server&&f&&gt&&(gt=!1,function(t){for(var e=document.querySelectorAll(st),n=0,i=e.length;n<i;n++){var o=e[n];o&&o.getAttribute(c)!==u&&(ut(t,o),o.parentNode&&o.parentNode.removeChild(o))}}(this)),J(this,(function(){return function(t){for(var e=t.getTag(),n=e.length,i="",o=function(n){var o=function(t){return it.get(t)}(n);if(void 0===o)return"continue";var r=t.names.get(o),a=e.getGroup(n);if(void 0===r||0===a.length)return"continue";var s="".concat(c,".g").concat(n,'[id="').concat(o,'"]'),l="";void 0!==r&&r.forEach((function(t){t.length>0&&(l+="".concat(t,","))})),i+="".concat(a).concat(s,'{content:"').concat(l,'"}').concat(p)},r=0;r<n;r++)o(r);return i}(o)}))}return t.registerId=function(t){return rt(t)},t.prototype.reconstructWithOptions=function(e,n){return void 0===n&&(n=!0),new t(Object(i.a)(Object(i.a)({},this.options),e),this.gs,n&&this.names||void 0)},t.prototype.allocateGSInstance=function(t){return this.gs[t]=(this.gs[t]||0)+1},t.prototype.getTag=function(){return this.tag||(this.tag=(t=function(t){var e=t.useCSSOMInjection,n=t.target;return t.isServer?new mt(n):e?new pt(n):new ft(n)}(this.options),new et(t)));var t},t.prototype.hasNameForId=function(t,e){return this.names.has(t)&&this.names.get(t).has(e)},t.prototype.registerName=function(t,e){if(rt(t),this.names.has(t))this.names.get(t).add(e);else{var n=new Set;n.add(e),this.names.set(t,n)}},t.prototype.insertRules=function(t,e,n){this.registerName(t,e),this.getTag().insertRules(rt(t),n)},t.prototype.clearNames=function(t){this.names.has(t)&&this.names.get(t).clear()},t.prototype.clearRules=function(t){this.getTag().clearGroup(rt(t)),this.clearNames(t)},t.prototype.clearTag=function(){this.tag=void 0},t}(),bt=/&/g,yt=/^\s*\/\/.*$/gm;function Ct(t,e){return t.map((function(t){return"rule"===t.type&&(t.value="".concat(e," ").concat(t.value),t.value=t.value.replaceAll(",",",".concat(e," ")),t.props=t.props.map((function(t){return"".concat(e," ").concat(t)}))),Array.isArray(t.children)&&"@keyframes"!==t.type&&(t.children=Ct(t.children,e)),t}))}function St(t){var e,n,i,o=void 0===t?v:t,r=o.options,a=void 0===r?v:r,l=o.plugins,c=void 0===l?g:l,u=function(t,i,o){return o.startsWith(n)&&o.endsWith(n)&&o.replaceAll(n,"").length>0?".".concat(e):t},d=c.slice();d.push((function(t){t.type===s.a&&t.value.includes("&")&&(t.props[0]=t.props[0].replace(bt,n).replace(i,u))})),a.prefix&&d.push(s.d),d.push(s.g);var h=function(t,o,r,l){void 0===o&&(o=""),void 0===r&&(r=""),void 0===l&&(l="&"),e=l,n=o,i=new RegExp("\\".concat(n,"\\b"),"g");var c=t.replace(yt,""),u=s.b(r||o?"".concat(r," ").concat(o," { ").concat(c," }"):c);a.namespace&&(u=Ct(u,a.namespace));var h=[];return s.f(u,s.c(d.concat(s.e((function(t){return h.push(t)}))))),h};return h.hash=c.length?c.reduce((function(t,e){return e.name||tt(15),_(t,e.name)}),5381).toString():"",h}var wt=new At,xt=St(),Et=o.default.createContext({shouldForwardProp:void 0,styleSheet:wt,stylis:xt}),Lt=(Et.Consumer,o.default.createContext(void 0));function _t(){return Object(o.useContext)(Et)}function Ot(t){var e=Object(o.useState)(t.stylisPlugins),n=e[0],i=e[1],r=_t().styleSheet,s=Object(o.useMemo)((function(){var e=r;return t.sheet?e=t.sheet:t.target&&(e=e.reconstructWithOptions({target:t.target},!1)),t.disableCSSOMInjection&&(e=e.reconstructWithOptions({useCSSOMInjection:!1})),e}),[t.disableCSSOMInjection,t.sheet,t.target,r]),l=Object(o.useMemo)((function(){return St({options:{namespace:t.namespace,prefix:t.enableVendorPrefixes},plugins:n})}),[t.enableVendorPrefixes,t.namespace,n]);Object(o.useEffect)((function(){a()(n,t.stylisPlugins)||i(t.stylisPlugins)}),[t.stylisPlugins]);var c=Object(o.useMemo)((function(){return{shouldForwardProp:t.shouldForwardProp,styleSheet:s,stylis:l}}),[t.shouldForwardProp,s,l]);return o.default.createElement(Et.Provider,{value:c},o.default.createElement(Lt.Provider,{value:l},t.children))}var Tt=function(){function t(t,e){var n=this;this.inject=function(t,e){void 0===e&&(e=xt);var i=n.name+e.hash;t.hasNameForId(n.id,i)||t.insertRules(n.id,i,e(n.rules,i,"@keyframes"))},this.name=t,this.id="sc-keyframes-".concat(t),this.rules=e,J(this,(function(){throw tt(12,String(n.name))}))}return t.prototype.getName=function(t){return void 0===t&&(t=xt),this.name+t.hash},t}(),kt=function(t){return t>="A"&&t<="Z"};function Dt(t){for(var e="",n=0;n<t.length;n++){var i=t[n];if(1===n&&"-"===i&&"-"===t[0])return t;kt(i)?e+="-"+i.toLowerCase():e+=i}return e.startsWith("ms-")?"-"+e:e}var Pt=function(t){return null==t||!1===t||""===t},Rt=function(t){var e,n,o=[];for(var r in t){var a=t[r];t.hasOwnProperty(r)&&!Pt(a)&&(Array.isArray(a)&&a.isCss||Z(a)?o.push("".concat(Dt(r),":"),a,";"):$(a)?o.push.apply(o,Object(i.e)(Object(i.e)(["".concat(r," {")],Rt(a),!1),["}"],!1)):o.push("".concat(Dt(r),": ").concat((e=r,null==(n=a)||"boolean"==typeof n||""===n?"":"number"!=typeof n||0===n||e in l.a||e.startsWith("--")?String(n).trim():"".concat(n,"px")),";")))}return o};function It(t,e,n,i){return Pt(t)?[]:Y(t)?[".".concat(t.styledComponentId)]:Z(t)?!Z(o=t)||o.prototype&&o.prototype.isReactComponent||!e?[t]:It(t(e),e,n,i):t instanceof Tt?n?(t.inject(n,i),[t.getName(i)]):[t]:$(t)?Rt(t):Array.isArray(t)?Array.prototype.concat.apply(g,t.map((function(t){return It(t,e,n,i)}))):[t.toString()];var o}function Ft(t){for(var e=0;e<t.length;e+=1){var n=t[e];if(Z(n)&&!Y(n))return!1}return!0}var Bt=O(h),Wt=function(){function t(t,e,n){this.rules=t,this.staticRulesId="",this.isStatic=(void 0===n||n.isStatic)&&Ft(t),this.componentId=e,this.baseHash=_(Bt,e),this.baseStyle=n,At.registerId(e)}return t.prototype.generateAndInjectStyles=function(t,e,n){var i=this.baseStyle?this.baseStyle.generateAndInjectStyles(t,e,n):"";if(this.isStatic&&!n.hash)if(this.staticRulesId&&e.hasNameForId(this.componentId,this.staticRulesId))i=q(i,this.staticRulesId);else{var o=X(It(this.rules,t,e,n)),r=E(_(this.baseHash,o)>>>0);if(!e.hasNameForId(this.componentId,r)){var a=n(o,".".concat(r),void 0,this.componentId);e.insertRules(this.componentId,r,a)}i=q(i,r),this.staticRulesId=r}else{for(var s=_(this.baseHash,n.hash),l="",c=0;c<this.rules.length;c++){var u=this.rules[c];if("string"==typeof u)l+=u;else if(u){var d=X(It(u,t,e,n));s=_(s,d+c),l+=d}}if(l){var h=E(s>>>0);e.hasNameForId(this.componentId,h)||e.insertRules(this.componentId,h,n(l,".".concat(h),void 0,this.componentId)),i=q(i,h)}}return i},t}(),Mt=o.default.createContext(void 0);Mt.Consumer;var jt={};new Set;function zt(t,e,n){var r=Y(t),a=t,s=!D(t),l=e.attrs,c=void 0===l?g:l,u=e.componentId,d=void 0===u?function(t,e){var n="string"!=typeof t?"sc":S(t);jt[n]=(jt[n]||0)+1;var i="".concat(n,"-").concat(T(h+n+jt[n]));return e?"".concat(e,"-").concat(i):i}(e.displayName,e.parentComponentId):u,p=e.displayName,f=void 0===p?function(t){return D(t)?"styled.".concat(t):"Styled(".concat(k(t),")")}(t):p,m=e.displayName&&e.componentId?"".concat(S(e.displayName),"-").concat(e.componentId):e.componentId||d,y=r&&a.attrs?a.attrs.concat(c).filter(Boolean):c,C=e.shouldForwardProp;if(r&&a.shouldForwardProp){var w=a.shouldForwardProp;if(e.shouldForwardProp){var x=e.shouldForwardProp;C=function(t,e){return w(t,e)&&x(t,e)}}else C=w}var E=new Wt(n,m,r?a.componentStyle:void 0);function L(t,e){return function(t,e,n){var r=t.attrs,a=t.componentStyle,s=t.defaultProps,l=t.foldedComponentIds,c=t.styledComponentId,u=t.target,d=o.default.useContext(Mt),h=_t(),p=t.shouldForwardProp||h.shouldForwardProp,f=A(e,d,s)||v,m=function(t,e,n){for(var o,r=Object(i.a)(Object(i.a)({},e),{className:void 0,theme:n}),a=0;a<t.length;a+=1){var s=Z(o=t[a])?o(r):o;for(var l in s)r[l]="className"===l?q(r[l],s[l]):"style"===l?Object(i.a)(Object(i.a)({},r[l]),s[l]):s[l]}return e.className&&(r.className=q(r.className,e.className)),r}(r,e,f),g=m.as||u,y={};for(var C in m)void 0===m[C]||"$"===C[0]||"as"===C||"theme"===C&&m.theme===f||("forwardedAs"===C?y.as=m.forwardedAs:p&&!p(C,g)||(y[C]=m[C]));var S=function(t,e){var n=_t();return t.generateAndInjectStyles(e,n.styleSheet,n.stylis)}(a,m),w=q(l,c);return S&&(w+=" "+S),m.className&&(w+=" "+m.className),y[D(g)&&!b.has(g)?"class":"className"]=w,y.ref=n,Object(o.createElement)(g,y)}(_,t,e)}L.displayName=f;var _=o.default.forwardRef(L);return _.attrs=y,_.componentStyle=E,_.displayName=f,_.shouldForwardProp=C,_.foldedComponentIds=r?q(a.foldedComponentIds,a.styledComponentId):"",_.styledComponentId=m,_.target=r?a.target:t,Object.defineProperty(_,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(t){this._foldedDefaultProps=r?function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var i=0,o=e;i<o.length;i++)K(t,o[i],!0);return t}({},a.defaultProps,t):t}}),J(_,(function(){return".".concat(_.styledComponentId)})),s&&Q(_,t,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),_}function Nt(t,e){for(var n=[t[0]],i=0,o=e.length;i<o;i+=1)n.push(e[i],t[i+1]);return n}var Vt=function(t){return Object.assign(t,{isCss:!0})};function Ut(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(Z(t)||$(t))return Vt(It(Nt(g,Object(i.e)([t],e,!0))));var o=t;return 0===e.length&&1===o.length&&"string"==typeof o[0]?It(o):Vt(It(Nt(o,e)))}function Ht(t,e,n){if(void 0===n&&(n=v),!e)throw tt(1,e);var o=function(o){for(var r=[],a=1;a<arguments.length;a++)r[a-1]=arguments[a];return t(e,n,Ut.apply(void 0,Object(i.e)([o],r,!1)))};return o.attrs=function(o){return Ht(t,e,Object(i.a)(Object(i.a)({},n),{attrs:Array.prototype.concat(n.attrs,o).filter(Boolean)}))},o.withConfig=function(o){return Ht(t,e,Object(i.a)(Object(i.a)({},n),o))},o}var Gt=function(t){return Ht(zt,t)},Qt=Gt;b.forEach((function(t){Qt[t]=Gt(t)}));!function(){function t(t,e){this.rules=t,this.componentId=e,this.isStatic=Ft(t),At.registerId(this.componentId+1)}t.prototype.createStyles=function(t,e,n,i){var o=i(X(It(this.rules,e,n,i)),""),r=this.componentId+t;n.insertRules(r,r,o)},t.prototype.removeStyles=function(t,e){e.clearRules(this.componentId+t)},t.prototype.renderStyles=function(t,e,n,i){t>2&&At.registerId(this.componentId+t),this.removeStyles(t,n),this.createStyles(t,e,n,i)}}();function Zt(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var o=X(Ut.apply(void 0,Object(i.e)([t],e,!1))),r=T(o);return new Tt(r,o)}(function(){function t(){var t=this;this._emitSheetCSS=function(){var e=t.instance.toString(),n=dt(),i=X([n&&'nonce="'.concat(n,'"'),"".concat(c,'="true"'),"".concat(d,'="').concat(h,'"')].filter(Boolean)," ");return"<style ".concat(i,">").concat(e,"</style>")},this.getStyleTags=function(){if(t.sealed)throw tt(2);return t._emitSheetCSS()},this.getStyleElement=function(){var e;if(t.sealed)throw tt(2);var n=((e={})[c]="",e[d]=h,e.dangerouslySetInnerHTML={__html:t.instance.toString()},e),r=dt();return r&&(n.nonce=r),[o.default.createElement("style",Object(i.a)({},n,{key:"sc-0-0"}))]},this.seal=function(){t.sealed=!0},this.instance=new At({isServer:!0}),this.sealed=!1}t.prototype.collectStyles=function(t){if(this.sealed)throw tt(2);return o.default.createElement(Ot,{sheet:this.instance},t)},t.prototype.interleaveWithNodeStream=function(t){throw tt(3)}})(),"__sc-".concat(c,"__")}).call(this,n(36))},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n(0),o=n(19),r=n(5),a=n(10);class s extends i.default.Component{get style(){return this.props.configuration.style}get holeRect(){return this.holePosition}constructor(t){super(t),this.holePosition=o.a.empty(),this.resizeObserver=new ResizeObserver((()=>{this.updateWindowSize()})),this.componentDidUpdate=t=>{var e,n,i,o;(null===(e=this.props.padding)||void 0===e?void 0:e.minTopPadding)===(null===(n=t.padding)||void 0===n?void 0:n.minTopPadding)&&(null===(i=this.props.padding)||void 0===i?void 0:i.minBottomPadding)===(null===(o=t.padding)||void 0===o?void 0:o.minBottomPadding)&&this.props.configuration===t.configuration&&this.props.guidanceConfiguration===t.guidanceConfiguration||this.setState({shouldUpdateCanvas:!0}),this.updateCanvas()},this.updateWindowSize=()=>{this.setState({shouldUpdateCanvas:!0})},this.getVideoSize=()=>{var t;return null!==(t=this.holeCanvas.getBoundingClientRect())&&void 0!==t?t:new DOMRect},this.scaleForRetinaDisplay=t=>{if(window.devicePixelRatio>1){var e=t.width,n=t.height;t.width=e*window.devicePixelRatio,t.height=n*window.devicePixelRatio,t.style.width=e+"px",t.style.height=n+"px",t.getContext("2d").scale(window.devicePixelRatio,window.devicePixelRatio)}},this.updateCanvas=()=>{var t,e,n,i,o;if(!this.state.shouldUpdateCanvas)return;this.setState({shouldUpdateCanvas:!1});const r=this.getVideoSize().width,a=this.getVideoSize().height;this.holeCanvas.width=r,this.holeCanvas.height=a,this.crosshairCanvas.width=r,this.crosshairCanvas.height=a,this.scaleForRetinaDisplay(this.crosshairCanvas);const s=r-2*this.props.configuration.style.strokeWidth,l=Math.max(20,(r-s)/2),c=Math.min(s,r-2*l),u=this.props.configuration.aspectRatio.width/this.props.configuration.aspectRatio.height;this.holePosition.width=c,this.holePosition.height=this.holePosition.width/u,this.holePosition.x=r/2-c/2;const d=(null===(t=this.guidanceText)||void 0===t?void 0:t.clientHeight)+this.guidanceTextTopPadding||0,h=Math.max(10,null!==(n=null===(e=this.props.padding)||void 0===e?void 0:e.minTopPadding)&&void 0!==n?n:0),p=a-h-Math.max(10,null!==(o=null===(i=this.props.padding)||void 0===i?void 0:i.minBottomPadding)&&void 0!==o?o:0)-d;this.holePosition.height>p?(this.holePosition.height=p,this.holePosition.width=this.holePosition.height*u,this.holePosition.x=r/2-this.holePosition.width/2,this.holePosition.y=h):this.holePosition.y=h+(p-this.holePosition.height)/1.9;const f=this.holeCanvas.getContext("2d");f.save(),this.drawBackground(f),f.globalCompositeOperation="destination-out",this.drawHole();const m=this.crosshairCanvas.getContext("2d");m.globalCompositeOperation="source-over","FinderStrokedStyle"===this.props.configuration.style._type?this.drawHoleOutline():"FinderCorneredStyle"===this.props.configuration.style._type&&this.drawHoleCorners(),f.restore(),m.restore()},this.drawBackground=t=>{const{width:e,height:n}=this.getVideoSize();t.clearRect(0,0,e,n),t.beginPath(),t.rect(0,0,e,n),t.fillStyle=r.b.getColorValue(this.props.configuration.overlayColor),t.fill()},this.drawHole=()=>{const t=this.holeCanvas.getContext("2d"),e=this.cornerRadius(),n=this.holePosition.x,i=this.holePosition.y,o=this.holePosition.width,r=this.holePosition.height;t.beginPath(),t.fillStyle="black",t.moveTo(n+e,i),t.arcTo(n+o,i,n+o,i+r,e),t.arcTo(n+o,i+r,n,i+r,e),t.arcTo(n,i+r,n,i,e),t.arcTo(n,i,n+o,i,e),t.closePath(),t.fill()},this.drawCrosshair=()=>{const t=this.crosshairCanvas.getContext("2d"),e=this.holePosition.x+this.holePosition.width/2,n=this.holePosition.y+this.holePosition.height/2;t.beginPath(),t.moveTo(e-10,n),t.lineTo(e+10,n),t.moveTo(e,n-10),t.lineTo(e,n+10),t.strokeStyle="white",t.fillStyle="white",t.lineWidth=1,t.stroke()},this.drawHoleCorners=()=>{const t=this.crosshairCanvas.getContext("2d"),e=this.holePosition.x,n=this.holePosition.y,i=this.holePosition.width,o=this.holePosition.height,a=15,s=this.style.strokeWidth,l=this.cornerRadius();t.beginPath(),t.moveTo(e,n+a),t.arcTo(e,n,e+i,n,l),t.lineTo(e+a,n),t.moveTo(e+i-a,n),t.arcTo(e+i,n,e+i,n+o,l),t.lineTo(e+i,n+a),t.moveTo(e+i,n+o-a),t.arcTo(e+i,n+o,e,n+o,l),t.lineTo(e+i-a,n+o),t.moveTo(e,n+o-a),t.arcTo(e,n+o,e+i,n+o,l),t.lineTo(e+a,n+o),t.strokeStyle=r.b.getColorValue(this.style.strokeColor),t.lineWidth=s,t.stroke()},this.drawHoleOutline=()=>{const t=this.crosshairCanvas.getContext("2d"),e=this.holePosition.x,n=this.holePosition.y,i=this.holePosition.width,o=this.holePosition.height,a=this.cornerRadius(),s=this.style.strokeWidth;t.beginPath(),t.moveTo(e+a,n),t.arcTo(e+i,n,e+i,n+o,a),t.moveTo(e+i,n+a),t.arcTo(e+i,n+o,e,n+o,a),t.moveTo(e+i-a,n+o),t.arcTo(e,n+o,e,n,a),t.moveTo(e,n+o-a),t.arcTo(e,n,e+i,n,a),t.strokeStyle=r.b.getColorValue(this.style.strokeColor),t.lineWidth=s,t.stroke()},this.guidanceTextTopPadding=20,this.render=()=>i.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%",textAlign:"left"},onClick:t=>{const e=this.holePosition;t.clientX>this.holePosition.x&&t.clientX<e.x+e.width&&t.clientY>e.y&&t.clientY<e.y+e.height&&console.log("Clicked inside hole, possibly click events need to be diverted")}},i.default.createElement("canvas",{ref:t=>{this.holeCanvas=t},style:{position:"absolute",width:"100%",height:"100%"}}),i.default.createElement("canvas",{ref:t=>{this.crosshairCanvas=t},style:{position:"absolute",width:"100%",height:"100%"}}),this.guidance.visible&&i.default.createElement("div",{ref:t=>{this.guidanceText=t},style:{position:"absolute",display:"block",top:this.holePosition.y+this.holePosition.height+this.guidanceTextTopPadding,left:0,width:"100%",textAlign:"center"}},i.default.createElement(a.a,{style:{display:"inline-block",backgroundColor:r.b.getColorValue(this.guidance.background.fillColor),borderStyle:"solid",borderColor:r.b.getColorValue(this.guidance.background.strokeColor),borderWidth:this.style.strokeWidth,borderRadius:4,padding:"4px 8px",flex:1},config:this.guidance.title}))),this.state={shouldUpdateCanvas:!0}}componentDidMount(){this.updateWindowSize(),this.resizeObserver.observe(this.holeCanvas)}componentWillUnmount(){this.resizeObserver.disconnect()}bottomOfGuidanceText(){var t,e;return this.holeRect.bottom()+(null!==(e=null===(t=this.guidanceText)||void 0===t?void 0:t.clientHeight)&&void 0!==e?e:0)+this.guidanceTextTopPadding}get guidance(){return this.props.guidanceConfiguration}cornerRadius(){return Math.max(0,Math.min(this.style.cornerRadius,this.holePosition.width/2,this.holePosition.height/2))}}},function(t,e,n){var i;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var t=[],e=0;e<arguments.length;e++){var i=arguments[e];if(i){var r=typeof i;if("string"===r||"number"===r)t.push(i);else if(Array.isArray(i)){if(i.length){var a=o.apply(null,i);a&&t.push(a)}}else if("object"===r)if(i.toString===Object.prototype.toString)for(var s in i)n.call(i,s)&&i[s]&&t.push(s);else t.push(i.toString())}}return t.join(" ")}t.exports?(o.default=o,t.exports=o):void 0===(i=function(){return o}.apply(e,[]))||(t.exports=i)}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return s})),n.d(e,"b",(function(){return Q})),n.d(e,"c",(function(){return tt})),n.d(e,"d",(function(){return nt})),n.d(e,"e",(function(){return et})),n.d(e,"f",(function(){return K})),n.d(e,"g",(function(){return J}));var i="-ms-",o="-moz-",r="-webkit-",a="comm",s="rule",l="decl",c="@keyframes",u=Math.abs,d=String.fromCharCode,h=Object.assign;function p(t){return t.trim()}function f(t,e){return(t=e.exec(t))?t[0]:t}function m(t,e,n){return t.replace(e,n)}function g(t,e,n){return t.indexOf(e,n)}function v(t,e){return 0|t.charCodeAt(e)}function A(t,e,n){return t.slice(e,n)}function b(t){return t.length}function y(t){return t.length}function C(t,e){return e.push(t),t}function S(t,e){return t.map(e).join("")}function w(t,e){return t.filter((function(t){return!f(t,e)}))}var x=1,E=1,L=0,_=0,O=0,T="";function k(t,e,n,i,o,r,a,s){return{value:t,root:e,parent:n,type:i,props:o,children:r,line:x,column:E,length:a,return:"",siblings:s}}function D(t,e){return h(k("",null,null,"",null,null,0,t.siblings),t,{length:-t.length},e)}function P(t){for(;t.root;)t=D(t.root,{children:[t]});C(t,t.siblings)}function R(){return O=_<L?v(T,_++):0,E++,10===O&&(E=1,x++),O}function I(){return v(T,_)}function F(){return _}function B(t,e){return A(T,t,e)}function W(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function M(t){return x=E=1,L=b(T=t),_=0,[]}function j(t){return T="",t}function z(t){return p(B(_-1,U(91===t?t+2:40===t?t+1:t)))}function N(t){for(;(O=I())&&O<33;)R();return W(t)>2||W(O)>3?"":" "}function V(t,e){for(;--e&&R()&&!(O<48||O>102||O>57&&O<65||O>70&&O<97););return B(t,F()+(e<6&&32==I()&&32==R()))}function U(t){for(;R();)switch(O){case t:return _;case 34:case 39:34!==t&&39!==t&&U(O);break;case 40:41===t&&U(t);break;case 92:R()}return _}function H(t,e){for(;R()&&t+O!==57&&(t+O!==84||47!==I()););return"/*"+B(e,_-1)+"*"+d(47===t?t:R())}function G(t){for(;!W(I());)R();return B(t,_)}function Q(t){return j(Z("",null,null,null,[""],t=M(t),0,[0],t))}function Z(t,e,n,i,o,r,a,s,l){for(var c=0,h=0,p=a,f=0,A=0,y=0,S=1,w=1,L=1,k=0,D="",P=o,B=r,W=i,M=D;w;)switch(y=k,k=R()){case 40:if(108!=y&&58==v(M,p-1)){-1!=g(M+=m(z(k),"&","&\f"),"&\f",u(c?s[c-1]:0))&&(L=-1);break}case 34:case 39:case 91:M+=z(k);break;case 9:case 10:case 13:case 32:M+=N(y);break;case 92:M+=V(F()-1,7);continue;case 47:switch(I()){case 42:case 47:C(q(H(R(),F()),e,n,l),l);break;default:M+="/"}break;case 123*S:s[c++]=b(M)*L;case 125*S:case 59:case 0:switch(k){case 0:case 125:w=0;case 59+h:-1==L&&(M=m(M,/\f/g,"")),A>0&&b(M)-p&&C(A>32?X(M+";",i,n,p-1,l):X(m(M," ","")+";",i,n,p-2,l),l);break;case 59:M+=";";default:if(C(W=Y(M,e,n,c,h,o,s,D,P=[],B=[],p,r),r),123===k)if(0===h)Z(M,e,W,W,P,r,p,s,B);else switch(99===f&&110===v(M,3)?100:f){case 100:case 108:case 109:case 115:Z(t,W,W,i&&C(Y(t,W,W,0,0,o,s,D,o,P=[],p,B),B),o,B,p,s,i?P:B);break;default:Z(M,W,W,W,[""],B,0,s,B)}}c=h=A=0,S=L=1,D=M="",p=a;break;case 58:p=1+b(M),A=y;default:if(S<1)if(123==k)--S;else if(125==k&&0==S++&&125==(O=_>0?v(T,--_):0,E--,10===O&&(E=1,x--),O))continue;switch(M+=d(k),k*S){case 38:L=h>0?1:(M+="\f",-1);break;case 44:s[c++]=(b(M)-1)*L,L=1;break;case 64:45===I()&&(M+=z(R())),f=I(),h=p=b(D=M+=G(F())),k++;break;case 45:45===y&&2==b(M)&&(S=0)}}return r}function Y(t,e,n,i,o,r,a,l,c,d,h,f){for(var g=o-1,v=0===o?r:[""],b=y(v),C=0,S=0,w=0;C<i;++C)for(var x=0,E=A(t,g+1,g=u(S=a[C])),L=t;x<b;++x)(L=p(S>0?v[x]+" "+E:m(E,/&\f/g,v[x])))&&(c[w++]=L);return k(t,e,n,0===o?s:l,c,d,h,f)}function q(t,e,n,i){return k(t,e,n,a,d(O),A(t,2,-2),0,i)}function X(t,e,n,i,o){return k(t,e,n,l,A(t,0,i),A(t,i+1,-1),i,o)}function $(t,e,n){switch(function(t,e){return 45^v(t,0)?(((e<<2^v(t,0))<<2^v(t,1))<<2^v(t,2))<<2^v(t,3):0}(t,e)){case 5103:return r+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return r+t+t;case 4789:return o+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return r+t+o+t+i+t+t;case 5936:switch(v(t,e+11)){case 114:return r+t+i+m(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return r+t+i+m(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return r+t+i+m(t,/[svh]\w+-[tblr]{2}/,"lr")+t}case 6828:case 4268:case 2903:return r+t+i+t+t;case 6165:return r+t+i+"flex-"+t+t;case 5187:return r+t+m(t,/(\w+).+(:[^]+)/,r+"box-$1$2"+i+"flex-$1$2")+t;case 5443:return r+t+i+"flex-item-"+m(t,/flex-|-self/g,"")+(f(t,/flex-|baseline/)?"":i+"grid-row-"+m(t,/flex-|-self/g,""))+t;case 4675:return r+t+i+"flex-line-pack"+m(t,/align-content|flex-|-self/g,"")+t;case 5548:return r+t+i+m(t,"shrink","negative")+t;case 5292:return r+t+i+m(t,"basis","preferred-size")+t;case 6060:return r+"box-"+m(t,"-grow","")+r+t+i+m(t,"grow","positive")+t;case 4554:return r+m(t,/([^-])(transform)/g,"$1"+r+"$2")+t;case 6187:return m(m(m(t,/(zoom-|grab)/,r+"$1"),/(image-set)/,r+"$1"),t,"")+t;case 5495:case 3959:return m(t,/(image-set\([^]*)/,r+"$1$`$1");case 4968:return m(m(t,/(.+:)(flex-)?(.*)/,r+"box-pack:$3"+i+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+r+t+t;case 4200:if(!f(t,/flex-|baseline/))return i+"grid-column-align"+A(t,e)+t;break;case 2592:case 3360:return i+m(t,"template-","")+t;case 4384:case 3616:return n&&n.some((function(t,n){return e=n,f(t.props,/grid-\w+-end/)}))?~g(t+(n=n[e].value),"span",0)?t:i+m(t,"-start","")+t+i+"grid-row-span:"+(~g(n,"span",0)?f(n,/\d+/):+f(n,/\d+/)-+f(t,/\d+/))+";":i+m(t,"-start","")+t;case 4896:case 4128:return n&&n.some((function(t){return f(t.props,/grid-\w+-start/)}))?t:i+m(m(t,"-end","-span"),"span ","")+t;case 4095:case 3583:case 4068:case 2532:return m(t,/(.+)-inline(.+)/,r+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(b(t)-1-e>6)switch(v(t,e+1)){case 109:if(45!==v(t,e+4))break;case 102:return m(t,/(.+:)(.+)-([^]+)/,"$1"+r+"$2-$3$1"+o+(108==v(t,e+3)?"$3":"$2-$3"))+t;case 115:return~g(t,"stretch",0)?$(m(t,"stretch","fill-available"),e,n)+t:t}break;case 5152:case 5920:return m(t,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,(function(e,n,o,r,a,s,l){return i+n+":"+o+l+(r?i+n+"-span:"+(a?s:+s-+o)+l:"")+t}));case 4949:if(121===v(t,e+6))return m(t,":",":"+r)+t;break;case 6444:switch(v(t,45===v(t,14)?18:11)){case 120:return m(t,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+r+(45===v(t,14)?"inline-":"")+"box$3$1"+r+"$2$3$1"+i+"$2box$3")+t;case 100:return m(t,":",":"+i)+t}break;case 5719:case 2647:case 2135:case 3927:case 2391:return m(t,"scroll-","scroll-snap-")+t}return t}function K(t,e){for(var n="",i=0;i<t.length;i++)n+=e(t[i],i,t,e)||"";return n}function J(t,e,n,i){switch(t.type){case"@layer":if(t.children.length)break;case"@import":case l:return t.return=t.return||t.value;case a:return"";case c:return t.return=t.value+"{"+K(t.children,i)+"}";case s:if(!b(t.value=t.props.join(",")))return""}return b(n=K(t.children,i))?t.return=t.value+"{"+n+"}":""}function tt(t){var e=y(t);return function(n,i,o,r){for(var a="",s=0;s<e;s++)a+=t[s](n,i,o,r)||"";return a}}function et(t){return function(e){e.root||(e=e.return)&&t(e)}}function nt(t,e,n,o){if(t.length>-1&&!t.return)switch(t.type){case l:return void(t.return=$(t.value,t.length,n));case c:return K([D(t,{value:m(t.value,"@","@"+r)})],o);case s:if(t.length)return S(n=t.props,(function(e){switch(f(e,o=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":P(D(t,{props:[m(e,/:(read-\w+)/,":-moz-$1")]})),P(D(t,{props:[e]})),h(t,{props:w(n,o)});break;case"::placeholder":P(D(t,{props:[m(e,/:(plac\w+)/,":"+r+"input-$1")]})),P(D(t,{props:[m(e,/:(plac\w+)/,":-moz-$1")]})),P(D(t,{props:[m(e,/:(plac\w+)/,i+"input-$1")]})),P(D(t,{props:[e]})),h(t,{props:w(n,o)})}return""}))}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n(1),o=n(7);class r extends o.a{constructor(t={}){super(),this.title=new i.j({visible:!1,text:"Scan Item",color:"?sbColorOnPrimary"}),this.mode="SOLID",this.backgroundColor="?sbColorPrimary",this.cancelButton=new i.c({text:"Cancel",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new i.d({color:"?sbColorOnPrimary"})}),void 0!==t.title&&(this.title=new i.j(t.title)),void 0!==t.mode&&(this.mode=t.mode),void 0!==t.backgroundColor&&(this.backgroundColor=t.backgroundColor),void 0!==t.cancelButton&&(this.cancelButton=new i.c(t.cancelButton))}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return r}));var i=n(6);function o(t,e,n){return Math.min(Math.max(t,e),n)}function r(t,e,n){return new i.a(o(t.x,-e/2,n.width-e/2),o(t.y,-e/2,n.height-e/2))}},,function(t,e,n){"use strict";(function(t){function i(t,e=!1){const n=[];return function t(i){if(i){if(i.constructor===ImageData){const t={data:i.data.slice(),width:i.width,height:i.height};return n.push(t.data.buffer),t}if(i.constructor===ArrayBuffer){const t=e?i.slice(0):i;if(n.push(t),e)return i}else if(ArrayBuffer.isView(i)){let t;if(e){t=new(0,i.constructor)(i.buffer.slice(0))}else t=i;if(n.push(t.buffer),e)return i}else if(Array.isArray(i))for(let e=0;e<i.length;++e){const n=t(i[e]);n&&(i[e]=n)}else if(i.constructor===Object)for(const e in i)if(i.hasOwnProperty(e)){const n=t(i[e]);n&&(i[e]=n)}}}(t),n}function o(t){return t.startsWith("http:")||t.startsWith("https:")}function r(){if("undefined"!=typeof t&&"undefined"!=typeof t.versions&&"undefined"!=typeof t.versions.node)return!1;if(/(iPad|iPhone|iPod)/g.test(navigator.userAgent))return!1;try{return(new MessageChannel).port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11]))}catch(t){return!1}}function a(t){const{allowSimd:e=!0,allowThreads:n=!0}=t||{};let i="";if(e&&function(){try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11]))}catch(t){return!1}}()){i+="-simd";n&&r()&&(i+="-threads")}return i}n.d(e,"b",(function(){return i})),n.d(e,"d",(function(){return o})),n.d(e,"a",(function(){return r})),n.d(e,"c",(function(){return a}))}).call(this,n(36))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));class i{constructor(){this.container=void 0,this.containerId=void 0}static mapValues(t,e,n){Object.keys(t).forEach((i=>{(null==n?void 0:n.includes(i))||(e[i]=t[i])}))}static mapValuesDeep(t,e){const n=t=>t&&"object"==typeof t&&!Array.isArray(t);Object.keys(t).forEach((o=>{o in e&&n(t[o])&&n(e[o])?i.mapValuesDeep(t[o],e[o]):e[o]=t[o]}))}static _fromJson(t,e){return this.mapValuesDeep(e,t),t}}},function(t,e,n){"use strict";var i,o=function(){return"undefined"==typeof i&&(i=Boolean(window&&document&&document.all&&!window.atob)),i},r=function(){var t={};return function(e){if("undefined"==typeof t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}t[e]=n}return t[e]}}(),a=[];function s(t){for(var e=-1,n=0;n<a.length;n++)if(a[n].identifier===t){e=n;break}return e}function l(t,e){for(var n={},i=[],o=0;o<t.length;o++){var r=t[o],l=e.base?r[0]+e.base:r[0],c=n[l]||0,u="".concat(l," ").concat(c);n[l]=c+1;var d=s(u),h={css:r[1],media:r[2],sourceMap:r[3]};-1!==d?(a[d].references++,a[d].updater(h)):a.push({identifier:u,updater:g(h,e),references:1}),i.push(u)}return i}function c(t){var e=document.createElement("style"),i=t.attributes||{};if("undefined"==typeof i.nonce){var o=n.nc;o&&(i.nonce=o)}if(Object.keys(i).forEach((function(t){e.setAttribute(t,i[t])})),"function"==typeof t.insert)t.insert(e);else{var a=r(t.insert||"head");if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(e)}return e}var u,d=(u=[],function(t,e){return u[t]=e,u.filter(Boolean).join("\n")});function h(t,e,n,i){var o=n?"":i.media?"@media ".concat(i.media," {").concat(i.css,"}"):i.css;if(t.styleSheet)t.styleSheet.cssText=d(e,o);else{var r=document.createTextNode(o),a=t.childNodes;a[e]&&t.removeChild(a[e]),a.length?t.insertBefore(r,a[e]):t.appendChild(r)}}function p(t,e,n){var i=n.css,o=n.media,r=n.sourceMap;if(o?t.setAttribute("media",o):t.removeAttribute("media"),r&&"undefined"!=typeof btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(r))))," */")),t.styleSheet)t.styleSheet.cssText=i;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(i))}}var f=null,m=0;function g(t,e){var n,i,o;if(e.singleton){var r=m++;n=f||(f=c(e)),i=h.bind(null,n,r,!1),o=h.bind(null,n,r,!0)}else n=c(e),i=p.bind(null,n,e),o=function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(n)};return i(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;i(t=e)}else o()}}t.exports=function(t,e){(e=e||{}).singleton||"boolean"==typeof e.singleton||(e.singleton=o());var n=l(t=t||[],e);return function(t){if(t=t||[],"[object Array]"===Object.prototype.toString.call(t)){for(var i=0;i<n.length;i++){var o=s(n[i]);a[o].references--}for(var r=l(t,e),c=0;c<n.length;c++){var u=s(n[c]);0===a[u].references&&(a[u].updater(),a.splice(u,1))}n=r}}}},function(t,e,n){"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=t(e);return e[2]?"@media ".concat(e[2]," {").concat(n,"}"):n})).join("")},e.i=function(t,n,i){"string"==typeof t&&(t=[[null,t,""]]);var o={};if(i)for(var r=0;r<this.length;r++){var a=this[r][0];null!=a&&(o[a]=!0)}for(var s=0;s<t.length;s++){var l=[].concat(t[s]);i&&o[l[0]]||(n&&(l[2]?l[2]="".concat(n," and ").concat(l[2]):l[2]=n),e.push(l))}},e}},function(t,e,n){"use strict";var i="6.0.0-dev.2";class o{}o.VERSION=i,o.CDN_PATH="https://cdn.jsdelivr.net/npm/scanbot-web-sdk@6.0.0-dev.2/bundle/",o.DEFAULT_WASM_FOLDER="bin/complete/",o.BUILD_WITH_UI=!1;var r=n(29);class a{constructor(t,e){this.createProxy=t=>new Proxy({},{get:(e,n,i)=>(...e)=>this.post(n,e,t)}),this.copyArgs=this.createProxy("copy"),this.transferArgs=this.createProxy("transfer");const{requestSuffix:n=""}=e||{},i=Object(r.c)(e),o=`${t}${t.endsWith("/")?"":"/"}ScanbotSDK.Core${i}.js${n}`;if(Object(r.d)(o)){const t=new Blob([`importScripts("${o}")`]);this.instance=new Worker(URL.createObjectURL(t))}else this.instance=new Worker(o);this.continuations={},this.nextTicketId=1,this.instance.onmessage=t=>{const{log:e,logError:n}=t.data;if(e)return void console.log(...e);if(n)return void console.error(...n);const{ticket:i,result:o,error:r}=t.data,{resolve:a,reject:s}=this.continuations[i];delete this.continuations[i],r?s(r):a(o)}}post(t,e,n){return new Promise(((i,o)=>{const a=Object(r.b)(e,"copy"==n),s=this.nextTicketId++;this.continuations[s]={resolve:i,reject:o},this.instance.postMessage({command:t,args:e,ticket:s},a)}))}destroy(){this.instance.terminate()}}var s=function(t,e,n,i){return new(n||(n=Promise))((function(o,r){function a(t){try{l(i.next(t))}catch(t){r(t)}}function s(t){try{l(i.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((i=i.apply(t,e||[])).next())}))};class l{constructor(t,e,n){this.copyArgs=this.createProxy("copy"),this.transferArgs=this.createProxy("transfer"),t||(t=o.CDN_PATH+o.DEFAULT_WASM_FOLDER),this.core=new a(t,e),this.coreInitializationSuccessful=this.core.copyArgs.initialize(...n)}awaitInitialized(){return s(this,void 0,void 0,(function*(){yield this.getCoreForCommand()}))}createProxy(t){return new Proxy({},{get:(e,n,i)=>(...e)=>s(this,void 0,void 0,(function*(){const i=yield this.getCoreForCommand(n),o="copy"===t?i.copyArgs:i.transferArgs;return yield o[n](...e)}))})}getCoreForCommand(t=""){return s(this,void 0,void 0,(function*(){const e=yield this.coreInitializationSuccessful;if("getLicenseInfo"===t||e)return this.core;throw new Error("WASM not initialized successfully. This can be due to an invalid license or problems loading the WASM file. Please check the console for more information.")}))}}class c{isValid(){return"Okay"===this.status||"Trial"===this.status}static fromJson(t){const e=new c;return e.status=t.licenseStatus,e.description=t.description,e}}var u=function(t,e,n,i){return new(n||(n=Promise))((function(o,r){function a(t){try{l(i.next(t))}catch(t){r(t)}}function s(t){try{l(i.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((i=i.apply(t,e||[])).next())}))};class d{constructor(t,e){this._sdk=t,this._pdfOperation=e}addPage(t,e="COPY_IMAGE"){return u(this,void 0,void 0,(function*(){const n=this._sdk.getBridge(e);yield n.addPageToPdf(this._pdfOperation,t)}))}complete(){return u(this,void 0,void 0,(function*(){return yield this._sdk.bridge.copyArgs.completePdf(this._pdfOperation)}))}}var h=function(t,e,n,i){return new(n||(n=Promise))((function(o,r){function a(t){try{l(i.next(t))}catch(t){r(t)}}function s(t){try{l(i.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((i=i.apply(t,e||[])).next())}))};class p{constructor(t,e){this._sdk=t,this._tiffOperation=e}addPage(t,e={}){return h(this,void 0,void 0,(function*(){const{binarize:n="IF_BINARIZATION_FILTER_SET",consumeImage:i="COPY_IMAGE"}=e,o=this._sdk.getBridge(i);yield o.addPageToTiff(this._tiffOperation,t,n)}))}complete(){return h(this,void 0,void 0,(function*(){return yield this._sdk.bridge.copyArgs.completeTiff(this._tiffOperation)}))}}var f=n(19);class m{static toPixelSize(t){return t+"px"}static containsString(t,e){return!!t&&-1!==t.indexOf(e)}static copy(t){return JSON.parse(JSON.stringify(t))}static getProperty(t,e){if(t&&t.hasOwnProperty(e))return t[e]}static uuid(){let t="";const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=e.length;for(let i=0;i<5;i++)t+=e.charAt(Math.floor(Math.random()*n));return t}}var g=function(t,e,n,i){return new(n||(n=Promise))((function(o,r){function a(t){try{l(i.next(t))}catch(t){r(t)}}function s(t){try{l(i.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((i=i.apply(t,e||[])).next())}))};class v{static toDataUrl(t){return new Promise(((e,n)=>{const i=new Blob([t],{type:"image/jpeg"}),o=new FileReader;o.onload=()=>e(o.result),o.onerror=()=>n(o.error),o.readAsDataURL(i)}))}static getObjectFitSize(t,e,n=!0){const i=e.width/e.height,o=t.width/t.height;let r=0,a=0;(n?i>o:i<o)?(r=t.width,a=r/i):(a=t.height,r=a*i);const s=(t.width-r)/2,l=(t.height-a)/2;return new f.a(s,l,r,a)}static loadFromUrl(t){return new Promise(((e,n)=>{const i=document.createElement("img");i.src=t,i.onload=()=>g(this,void 0,void 0,(function*(){const t=document.createElement("canvas");t.width=i.width,t.height=i.height;const n=t.getContext("2d");n.drawImage(i,0,0);const o=n.getImageData(0,0,i.width,i.height);e(o)})),i.onerror=n}))}static saveImageData(t){const e=this.createImageDataCanvas(t),n=" ("+t.width+"x"+t.height+")";e.toBlob((t=>this.saveBlob(t,m.uuid()+n+".png")))}static createImageDataCanvas(t){const e=document.createElement("canvas");return e.className="scanbot-sdk-canvas-element",e.width=t.width,e.height=t.height,e.getContext("2d").putImageData(t,0,0),e}static saveBlob(t,e){let n=document.createElement("a");n.setAttribute("download",e);let i=URL.createObjectURL(t);n.setAttribute("href",i),n.click()}static convertImageDataWrapperToImageData(t){if(t)return new ImageData(t.data,t.width,t.height)}static wrapperToBase64(t){return v.createImageDataCanvas(v.convertImageDataWrapperToImageData(t)).toDataURL("image/png")}static toBase64(t){return g(this,void 0,void 0,(function*(){const e=yield new Promise((e=>{const n=new FileReader;n.onload=()=>e(n.result),n.readAsDataURL(new Blob([t]))}));return e.slice(e.indexOf(",")+1)}))}}class A{saveImageAsJpeg(t,e){if(!t||0===t.length)return void console.log("Data cannot be null or empty");e||(e=m.uuid()+".jpeg");let n=new Blob([t],{type:"image/jpeg"});v.saveBlob(n,e)}isCameraSupported(){return!!navigator.mediaDevices}flash(){let t=this.findFlashElement();t.style.display="block",this.animateFlashOpacity("0.5",(()=>{this.animateFlashOpacity("0.0",(()=>{t.style.opacity="1.0",t.style.display="none"}))}))}findFlashElement(){return this.getOrCreateElement("flash",{position:"fixed",top:"0",left:"0",width:"100%",height:"100%","background-color":"#fff",display:"none","z-index":"5000"})}animateFlashOpacity(t,e){const n=this.getElementByClassName("flash");setTimeout((()=>{n.style.opacity=t,e()}),150)}getOrCreateElement(t,e){let n=this.getElementByClassName(t);return n||(this.createElement(t,e),n=this.getElementByClassName(t)),n}createElement(t,e){let n=document.createElement("div");n.className=t,n.style.cssText=this.cssToString(e),document.body.append(n)}cssToString(t){let e="";return Object.keys(t).forEach((n=>{e+=n+":"+t[n]+";"})),e}getElementByClassName(t){const e=document.getElementsByClassName(t);if(0!==e.length)return e[0]}}class b{constructor(t,e){this.barcodes=t,this.originalImageSize=e}isEmpty(){return 0===this.barcodes.length}}var y=function(t,e,n,i){return new(n||(n=Promise))((function(o,r){function a(t){try{l(i.next(t))}catch(t){r(t)}}function s(t){try{l(i.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((i=i.apply(t,e||[])).next())}))};class C{constructor(t,e){this._sdk=t,this._mrzRecognizerToken=e}recognize(t,e="COPY_IMAGE"){return y(this,void 0,void 0,(function*(){try{const n=this._sdk.getBridge(e);return yield n.recognizeMRZ(yield this._mrzRecognizerToken,t)}catch(t){return void console.warn(t)}}))}recognizeURL(t){return y(this,void 0,void 0,(function*(){return new Promise((e=>{const n=document.createElement("canvas"),i=document.createElement("img");i.src=t,i.onload=()=>y(this,void 0,void 0,(function*(){n.width=i.width,n.height=i.height;const t=n.getContext("2d");t.drawImage(i,0,0);const o=t.getImageData(0,0,i.width,i.height),r=yield this.recognize(o);e(r||void 0)}))}))}))}release(){return y(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.releaseObject(yield this._mrzRecognizerToken)}))}}var S=function(t,e,n,i){return new(n||(n=Promise))((function(o,r){function a(t){try{l(i.next(t))}catch(t){r(t)}}function s(t){try{l(i.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((i=i.apply(t,e||[])).next())}))};class w{constructor(t,e){this._sdk=t,this._OcrEngineToken=e}performOcr(t,e="COPY_IMAGE"){return S(this,void 0,void 0,(function*(){const n=this._sdk.getBridge(e);return yield n.performOcr(this._OcrEngineToken,t)}))}recognizeURL(t){return S(this,void 0,void 0,(function*(){return new Promise((e=>{const n=document.createElement("canvas"),i=document.createElement("img");i.src=t,i.onload=()=>S(this,void 0,void 0,(function*(){n.width=i.width,n.height=i.height;const t=n.getContext("2d");t.drawImage(i,0,0);const o=t.getImageData(0,0,i.width,i.height),r=yield this.performOcr(o);e(r)}))}))}))}release(){return S(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.releaseObject(this._OcrEngineToken)}))}}var x=function(t,e,n,i){return new(n||(n=Promise))((function(o,r){function a(t){try{l(i.next(t))}catch(t){r(t)}}function s(t){try{l(i.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((i=i.apply(t,e||[])).next())}))};class E{constructor(t,e){this._sdk=t,this._textDataScannerToken=e}recognize(t,e="COPY_IMAGE"){return x(this,void 0,void 0,(function*(){try{const n=this._sdk.getBridge(e);return yield n.recognizeTextLine(yield this._textDataScannerToken,t)}catch(t){return void console.warn(t)}}))}cleanRecognitionQueue(){return x(this,void 0,void 0,(function*(){try{yield this._sdk.bridge.copyArgs.cleanTextLineRecognitionQueue(yield this._textDataScannerToken)}catch(t){return void console.warn(t)}}))}recognizeURL(t){return x(this,void 0,void 0,(function*(){return new Promise((e=>{const n=document.createElement("canvas"),i=document.createElement("img");i.src=t,i.onload=()=>x(this,void 0,void 0,(function*(){n.width=i.width,n.height=i.height;const t=n.getContext("2d");t.drawImage(i,0,0);const o=t.getImageData(0,0,i.width,i.height),r=yield this.recognize(o,"CONSUME_IMAGE");r&&e(r)}))}))}))}release(){return x(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.releaseObject(yield this._textDataScannerToken)}))}}var L=n(12),_=n(20),O=n(8);class T extends _.a{constructor(){super(L.a.DEFAULT_VIDEO_RESOLUTION_HD),this.ocrConfiguration=new O.GenericTextLineScannerTypes.ScannerConfiguration,this.onTextDetected=function(t){},this.finder.aspectRatio=new O.Geometry.AspectRatio({width:6,height:1}),this.userGuidance.title.text="Please hold the device over the text to start scanning"}static fromJson(t){const e=new T;return this.mapFinderConfiguration(e,t),this._fromJson(e,t)}}class k extends _.a{constructor(){super(L.a.DEFAULT_VIDEO_RESOLUTION_HD),this.ocrConfiguration=new O.GenericTextLineScannerTypes.ScannerConfiguration,this.onTextDetected=function(t){},this.finder.aspectRatio=new O.Geometry.AspectRatio({width:6,height:1}),this.userGuidance.title.text="Please hold the device over the vehicle identification number to start scanning"}static fromJson(t){const e=new k;return this.mapFinderConfiguration(e,t),this._fromJson(e,t)}}class D extends Error{constructor(t){super(t.description),this.name="LicenseError"}}class P{static throwIfMissingBuffer(t){P.throwIfMissing(t,"ImageBuffer may not be null")}static throwIfMissing(t,e){if(!t)throw new Error(e)}}var R=function(t,e,n,i){return new(n||(n=Promise))((function(o,r){function a(t){try{l(i.next(t))}catch(t){r(t)}}function s(t){try{l(i.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((i=i.apply(t,e||[])).next())}))};class I{constructor(t,e){this._sdk=t,this._token=e}analyze(t,e="COPY_IMAGE"){return R(this,void 0,void 0,(function*(){P.throwIfMissingBuffer(t);const n=this._sdk.getBridge(e);return yield n.documentQualityAnalyzerAnalyze(this._token,t)}))}release(){return R(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.releaseObject(this._token)}))}}var F=n(14),B=n(0),W=n(37),M=n(16),j=n(3),z=n.n(j),N=n(5);const V="var(--1-sb-dvh, 1vh)";function U(){const t=Object(B.useMemo)((()=>{var t,e;return null===(e=null===(t=null===window||void 0===window?void 0:window.CSS)||void 0===t?void 0:t.supports)||void 0===e?void 0:e.call(t,"height: 100dvh")}),[]),e=()=>{var e=t?"1dvh":window.innerHeight/100+"px";document.documentElement.style.setProperty("--1-sb-dvh",e)};return Object(B.useEffect)((()=>{if(e(),!t)return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}})),null}var H=n(26),G=n(10),Q=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(t);o<i.length;o++)e.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(t,i[o])&&(n[i[o]]=t[i[o]])}return n};function Z(t){const e=Object(B.useContext)(N.a).getColorValue,{styleConfig:n}=t,i=Q(t,["styleConfig"]),o=Object.assign(Object.assign({},t.style),{backgroundColor:e(n.fillColor),borderColor:e(n.strokeColor),borderWidth:n.strokeWidth,borderRadius:n.cornerRadius,borderStyle:"solid"});return B.default.createElement(j.Box,Object.assign({},i,{style:o}))}function Y(t){var e;return t.visible?B.default.createElement(j.Button,{variant:"text",onClick:t.onClick,sx:Object.assign(Object.assign({flex:1},Object(G.b)(t.foreground)),{textTransform:"none",fontSize:18,"&:hover, &:focus, &:active, &":{outline:"none",backgroundColor:"transparent"},px:0}),disableRipple:!0},B.default.createElement(Z,{styleConfig:Object.assign(Object.assign({},t.background),{cornerRadius:4}),sx:{borderStyle:"solid",px:"8px"}},null!==(e=t.icon)&&void 0!==e?e:null,N.b.getLocalizedBarcodeText(t.text))):B.default.createElement("div",{style:{display:"flex",flex:1}})}H.a;const q=B.default.createContext(null);function X(t){const e=t.mode,n="HIDDEN"===e?0:48;Object(B.useEffect)((()=>{if("HIDDEN"===e)return;const n=document.createElement("meta");return n.name="theme-color",n.content=N.b.getColorValue(t.backgroundColor),document.head.appendChild(n),()=>{document.head.removeChild(n)}}),[e]);const i="SOLID"===e?0:n,o={height:n,remainingVisibleBodyHeight:"SOLID"===e?`calc(100 * ${V} - ${n}px)`:`calc(100 * ${V})`,minTopPaddingForContent:i,minTopPaddingForViewFinder:10+i},r="SOLID"===e?{backgroundColor:N.b.getColorValue(t.backgroundColor)}:{backgroundImage:`linear-gradient(to bottom, ${N.b.getColorValue(t.backgroundColor)}, #00000000)`,position:"absolute",backgroundColor:"transparent"};return B.default.createElement(B.default.Fragment,null,"HIDDEN"!==e&&B.default.createElement(j.AppBar,{position:"static",elevation:0,sx:Object.assign({zIndex:1e5,height:n,minHeight:n},r)},B.default.createElement(j.Toolbar,{variant:"dense",sx:{height:n,minHeight:n}},B.default.createElement(j.Box,{sx:{flex:1}},t.cancelButton.visible&&B.default.createElement(B.default.Fragment,null,B.default.createElement(Y,Object.assign({onClick:t.onBackPress,icon:t.cancelButton.foreground.iconVisible&&B.default.createElement(z.a,{sx:{fontSize:12,mr:"5px"}})},t.cancelButton)))),B.default.createElement(j.Box,null,B.default.createElement(j.Typography,{variant:"h6",noWrap:!0,component:"div",fontSize:18,fontWeight:600},B.default.createElement(G.a,{config:t.title}))),B.default.createElement(j.Box,{sx:{flex:1}}))),B.default.createElement(q.Provider,{value:o},t.children))}function $(t){return{textOverflow:"ellipsis","-webkit-box-orient":"vertical","-webkit-line-clamp":`${t}`,overflow:"hidden",whiteSpace:t>1?"normal":"nowrap",display:t>1?"-webkit-box":"block"}}function K(t){var e,n;const i=(null===(e=t.barcodeMappedData)||void 0===e?void 0:e.state)||"LOADING",o=(null===(n=t.barcodeMappedData)||void 0===n?void 0:n.value)||{title:"",subtitle:"",barcodeImage:""},r=!t||"LOADED"!==i,a=t.imageSize,s=t.barcodeTitle.visible||t.barcodeSubtitle.visible||t.counterForm,l=t.counterForm&&{"&:hover, &:focus, &:active, &":{borderColor:N.b.getColorValue(t.counterForm.manualCountOutlineColor),backgroundColor:"transparent"}};return B.default.createElement(j.Box,{sx:{display:"flex"},"data-sb-barcode-info":"1"},t.barcodeImageVisible&&B.default.createElement(j.Box,{sx:{pr:s?"16px":0,display:"flex",alignItems:"center",justifyContent:"center"}},r?B.default.createElement(j.Skeleton,{variant:"rounded",width:a,height:a,style:{borderRadius:8}}):B.default.createElement("img",{src:o.barcodeImage,alt:o.title,style:{width:a,height:a,borderRadius:8}})),s&&B.default.createElement(j.Box,{sx:{flex:1,display:"flex",flexDirection:"column",verticalAlign:"middle",justifyContent:"center",m:0,p:0,minWidth:0}},t.barcodeTitle.visible&&B.default.createElement(j.Box,{display:r?"block":"flex",sx:{alignItems:"center"}},B.default.createElement(j.Typography,{fontSize:16,fontWeight:"bold",sx:Object.assign(Object.assign({},$(t.maxNumberOfTitleLines)),Object(G.b)(t.barcodeTitle))},r?B.default.createElement(j.Skeleton,{variant:"text"}):o.title),t.displayRightArrow&&!r&&B.default.createElement(z.a,{sx:{fontSize:16,fontWeight:"bold",color:N.b.getColorValue(t.barcodeTitle.color)}})),t.barcodeSubtitle.visible&&B.default.createElement(j.Typography,{fontSize:14,fontWeight:400,sx:Object.assign(Object.assign({},$(t.maxNumberOfSubtitleLines)),Object(G.b)(t.barcodeSubtitle))},r?B.default.createElement(j.Skeleton,{variant:"text"}):o.subtitle),t.counterForm&&B.default.createElement(j.ButtonGroup,{variant:"outlined"},B.default.createElement(j.Button,{sx:l,onClick:()=>t.counterForm.setCounter(t.counterForm.counter-1),disableRipple:!0},B.default.createElement(z.a,{sx:{color:N.b.getColorValue(t.counterForm.manualCountChangeColor)}})),B.default.createElement(j.Button,{sx:Object.assign(Object.assign({},l),{color:N.b.getColorValue(t.counterForm.manualCountChangeColor),fontWeight:"bold",fontSize:16}),onClick:t.counterForm.onNumberClick,disableRipple:!0},t.counterForm.counter),B.default.createElement(j.Button,{sx:l,onClick:()=>t.counterForm.setCounter(t.counterForm.counter+1),disableRipple:!0},B.default.createElement(z.a,{sx:{color:N.b.getColorValue(t.counterForm.manualCountChangeColor)}})))))}M.ButtonConfiguration;function J(t){const e=Object(B.useContext)(N.a).getColorValue;return t.visible?B.default.createElement(j.Button,{onClick:t.onClick,type:t.type,sx:Object.assign(Object.assign({},t.style),{"&:hover, &:focus, &:active, &":{borderStyle:"solid",borderColor:e(t.background.strokeColor),borderWidth:t.background.strokeWidth,backgroundColor:e(t.background.fillColor),textTransform:"none",outline:"none"}}),disableRipple:!0},t.foreground.iconVisible&&t.icon&&B.default.createElement(t.icon,{sx:{color:e(t.foreground.color),pr:2}}),B.default.createElement(G.a,{config:{visible:!0,text:t.text,color:t.foreground.color,useShadow:t.foreground.useShadow}})):null}var tt=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(t);o<i.length;o++)e.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(t,i[o])&&(n[i[o]]=t[i[o]])}return n};function et(t){var e,{modalOverlayColor:n}=t,i=tt(t,["modalOverlayColor"]);const o={backdrop:{style:{backgroundColor:N.b.getColorValue(n)}}},r=Object.assign(Object.assign({},i.PaperProps),{sx:Object.assign(Object.assign({},null===(e=i.PaperProps)||void 0===e?void 0:e.sx),{maxWidth:400})});return B.default.createElement(j.Dialog,Object.assign({},i,{componentsProps:o,PaperProps:r}))}function nt(t){const e=Object(B.useContext)(N.a).getColorValue,n=!t.barcodeMappedData||"LOADED"!==t.barcodeMappedData.state,i={backgroundColor:e(n?t.sheetColorLoading:t.sheetColorLoaded)},[o,r]=B.default.useState(),a=Object(B.useRef)((()=>{}));Object(B.useEffect)((()=>{t.open&&r(!1)}),[t.open]);const s=()=>{a.current=t.handleCancel,r(!0)};return B.default.createElement(et,{modalOverlayColor:t.modalOverlayColor,open:t.open&&!o,fullWidth:!0,TransitionProps:{onExited:()=>{o&&a.current()}},onClose:()=>{n||s()}},B.default.createElement(j.DialogContent,{style:i},B.default.createElement(K,Object.assign({},t,{maxNumberOfTitleLines:2,maxNumberOfSubtitleLines:1,imageSize:68}))),B.default.createElement(j.DialogActions,{style:i},B.default.createElement(z.a,{container:!0,spacing:2,sx:{overflow:"hidden"}},B.default.createElement(z.a,{item:!0,xs:12},B.default.createElement(z.a,{color:e(t.dividerColor)})),n?B.default.createElement(z.a,{item:!0,xs:12,sx:{textAlign:"center"}},B.default.createElement(j.Box,null,B.default.createElement(j.CircularProgress,{sx:{color:e(t.loadingMessage.color),verticalAlign:"middle",mr:2}}),B.default.createElement(G.a,{config:t.loadingMessage}))):B.default.createElement(B.default.Fragment,null,B.default.createElement(z.a,{item:!0,xs:6},B.default.createElement(J,Object.assign({style:{width:"100%"},onClick:s},t.cancelButton))),B.default.createElement(z.a,{item:!0,xs:6},B.default.createElement(J,Object.assign({style:{width:"100%"},onClick:()=>{a.current=t.handleSubmit,r(!0)}},t.submitButton)))))))}function it(t,e){return t.format===e.format&&t.text===e.text}function ot(t){return t.text+t.format}function rt(t){const e=Object(B.useRef)(!0);Object(B.useEffect)((()=>(e.current=!0,()=>{e.current=!1})));const[,n]=Object(B.useReducer)((t=>t+1),0),i=Object(B.useRef)();return Object(B.useMemo)((()=>{i.current={loading:!0,value:void 0,error:null}}),[t]),function(t,e){Object(B.useMemo)((()=>{t&&t.then((t=>{e({loading:!1,error:null,value:t})})).catch((t=>{e({loading:!1,error:{reason:t},value:void 0})}))}),[t])}(t,(t=>{i.current=t,e.current&&n()})),t?i.current:null}var at=function(t,e,n,i){return new(n||(n=Promise))((function(o,r){function a(t){try{l(i.next(t))}catch(t){r(t)}}function s(t){try{l(i.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((i=i.apply(t,e||[])).next())}))};const st=Object(B.createContext)(null);class lt{constructor(t,e){this.barcodeItemMapper=t,this.onError=e,this.cache=new Map,this.cacheEntryPendingRetries=[],this.hash=t=>ot(t),this.onEvictionListeners=new Set}mapBarcodeToBarcodeItem(t,e){return at(this,void 0,void 0,(function*(){return new M.BarcodeItem(e,t)}))}getBarcodeMappedData(t){const e=this.hash(t);if(!this.cache.has(e)){const n=(()=>at(this,void 0,void 0,(function*(){if(this.barcodeItemMapper){const e=yield this.mapBarcodeToBarcodeItem(t,1);return this.barcodeItemMapper(e)}{const e=yield v.toDataUrl(yield eu.instance.imageToJpeg(t.sourceImage));return{title:t.text,subtitle:t.format,barcodeImage:e}}})))();this.cache.set(e,n)}return this.cache.get(e)}useBarcodeMappedData(t){const e=Object(B.useRef)(!1),n=rt(t&&this.getBarcodeMappedData(t));if(Object(B.useEffect)((()=>{n&&n.error&&(e.current=!1,this.cacheEntryPendingRetries.push({barcode:t,retry:()=>{this.cache.delete(this.hash(t)),e.current=!0}}),this.onError((()=>{for(const t of this.cacheEntryPendingRetries)t.retry();this.cacheEntryPendingRetries.length=0}),(()=>{e.current=!0;for(const t of this.cacheEntryPendingRetries)for(const e of this.onEvictionListeners)this.hash(e.barcode)==this.hash(t.barcode)&&e.callback();this.cacheEntryPendingRetries.length=0})))}),[n&&n.error]),!n)return null;let i;return i=n.value?"LOADED":n.error&&!e.current?"RETRY_DIALOG_OPEN":n.error?"FAILED":"LOADING",{value:n.value,state:i}}addOnEvictionListener(t){this.onEvictionListeners.add(t)}removeOnEvictionListener(t){this.onEvictionListeners.delete(t)}}var ct=n(1);ct.h;function ut(t){if(!1===t.visible)return null;const e={backgroundColor:t.active?N.b.getColorValue(t.activeBackgroundColor):N.b.getColorValue(t.backgroundColor),color:t.active?N.b.getColorValue(t.activeForegroundColor):N.b.getColorValue(t.foregroundColor)};return B.default.createElement(j.IconButton,{sx:Object.assign(Object.assign({},e),{"&:hover, &:focus":Object.assign({outline:"none"},e),width:48,height:48}),onClick:t.onClick},t.text&&B.default.createElement("span",{style:{fontSize:15}},N.b.getLocalizedBarcodeText(t.text)),t.icon&&B.default.createElement(t.icon,{style:{padding:7}}))}var dt=function(t,e,n,i){return new(n||(n=Promise))((function(o,r){function a(t){try{l(i.next(t))}catch(t){r(t)}}function s(t){try{l(i.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((i=i.apply(t,e||[])).next())}))};class ht{constructor(){this.audioFile=new Audio}initialize(t){return dt(this,void 0,void 0,(function*(){t.successBeepEnabled&&(this.audioFile.src="data:audio/mp4;base64,AAAAHGZ0eXBNNEEgAAACAE00QSBpc29taXNvMgAAAAhmcmVlAAASCG1kYXQBQCKAo3/4hS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS7/8QpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpd+aIUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLwBQCKAo3/4hS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS7/8QpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpd+aIUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLwA6jQEQfEIQGIQaqctMIv9EpiYforpaDbT80WfPFRSswKfd8cy6kN/+IUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0u//EKWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaXfViFLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLwA6jQQpRY6EYNCcKDAqAAEUgC2wFy0kF7JTgecsqIp6pxd/lHO7kUuSCLFK6n2mPOKfj5aKhQPOaRtBEKFS85eIYbr71AGaAPJTSIHeIhXTcpA5i155UICz3nXk0Cz0A8QhxIhoqQIJ2Be9MIEiJ6GpuMa1fPXcJmIoxDUKpZuJozBa6iFmjy7O/genSlwPKL6xaiiL8Y1XtgBDY7ke/CAOoawOqmZm6suSVQPbxzaxZJpWFcWva4RqTil72HqDpc2N4eG3KA0JkU8G58RNabxVq9gSLwysPKIzL1fZVF1FQwllEs4YUKpPtoMw2VtepdbZHqGriAsZ5Lu154uiewW41szI4RHfpWOWSH7s1LAzlv/xClpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWl36AhS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0vAA6jQEYVEIDEQDEKCAYhAIXMdbaI5q82OvhmYS1FO11cD3Yt4EwZI+aTsqoctJJaN0FKvNqorQmK3SUWpNOtf+uKNIxX3xeTEq8LKb/8QpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpd/+IUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0u+GEKWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpeABMDQD6WqsfRABwAUSib4c3/4hS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS7/8QpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpd+EIUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS8AAAO4bW9vdgAAAGxtdmhkAAAAAAAAAAAAAAAAAAAD6AAAAfgAAQAAAQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAiJ0cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAABAAAAAAAAAfgAAAAAAAAAAAAAAAEBAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAAH4AAAIAAABAAAAAAGabWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAAAfQAAAF8BVxAAAAAAALWhkbHIAAAAAAAAAAHNvdW4AAAAAAAAAAAAAAABTb3VuZEhhbmRsZXIAAAABRW1pbmYAAAAQc21oZAAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAABCXN0YmwAAABnc3RzZAAAAAAAAAABAAAAV21wNGEAAAAAAAAAAQAAAAAAAAAAAAEAEAAAAAAfQAAAAAAAM2VzZHMAAAAAA4CAgCIAAQAEgICAFEAVAAAAAAH0AAAAvXkFgICAAhWIBoCAgAECAAAAIHN0dHMAAAAAAAAAAgAAAAUAAAQAAAAAAQAAA8AAAAAcc3RzYwAAAAAAAAABAAAAAQAAAAYAAAABAAAAFHN0c3oAAAAAAAADAAAAAAYAAAAUc3RjbwAAAAAAAAABAAAALAAAABpzZ3BkAQAAAHJvbGwAAAACAAAAAf//AAAAHHNiZ3AAAAAAcm9sbAAAAAEAAAAGAAAAAQAAASJ1ZHRhAAABGm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAA7Wlsc3QAAAAzqW5hbQAAACtkYXRhAAAAAQAAAAAyNTAgTWlsbGlzZWNvbmRzIG9mIFNpbGVuY2UAAAApqUFSVAAAACFkYXRhAAAAAQAAAABBbmFyIFNvZnR3YXJlIExMQwAAAClhQVJUAAAAIWRhdGEAAAABAAAAAEFuYXIgU29mdHdhcmUgTExDAAAAI6lhbGIAAAAbZGF0YQAAAAEAAAAAQmxhbmsgQXVkaW8AAAAkqXRvbwAAABxkYXRhAAAAAQAAAABMYXZmNjAuMy4xMDAAAAAZY3BpbAAAABFkYXRhAAAAFQAAAAAA",yield this.play(),"MODERN_BEEP"===t.soundType&&(this.audioFile.src="data:audio/mp4;base64,AAAAHGZ0eXBNNEEgAAACAE00QSBpc29taXNvMgAAAAhmcmVlAAAEcm1kYXQBQCKAo30ghS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLwDmVAjh8QBrRiUH/88pKh3gJPmPt9t8oIUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLwDsl6UY83aVqFeq3aVmmYyFp70/kJT+A9hdePd7Z7aRSFKZBhCUP6E1rS/9+DhfmhvTknCnQzE+QHVPD6rhSIRpGIAFmBioF1XkxwAQjxKkQMc+qECgXnCAU1IcgpFDnWo02EdihsnrUx/1bJAUo+x6//p8VmoS0iuleHvPnKj9mjjHOoaDGI/s2DHcYI66Grp+5pezZuKJExJOzoyJRdmv6ltO6ibTdTDZ1YqLauKTebYOtpTWnh3/K3kBQmN3NsieqxzHeZKNiFphWuYSWMhaHIZRnRt6O/WzTXYFGrG0wBT54NCQ3wtSpqr5dHbQN2yY0jcckhLUieNtOSjS3u1NuMqWbOx1zHwlHfJKgI349OU9iZEzeN3rCVbBVdrdcAEW9Cm2Ji2FjQNkiFBViV6ofFsNVeVqpKgpsf3/iWtBG6cpMqFHjy2QhyBEnPtwTbWbm9b1u7frF3bnaVykqieEvTKfqnCYL2u4g1CLiQ4Zb8hkkTL9tnGmdMOeqIkUcHZ0zsspzvHOUXJTlssZTRjqcIsp514HJO9YhVRXALKaCRKQkbMEty3CstONNYzuhq57bbccc+/Pq22226ueWXLLbTTw4bFIoQoGWepZBRJWQFh4yui2+evKOqLp+rLKJ4LKcAtQ7XA0aLCyMRVDDOmuoYcnFEmIrpzmRQNQIJ5HWvOesgzjrK071chBhESdztJ0sMqhdAAyjegdEYPNyA4BCDQtLGRRKQQBQIhXYqGZ65Pu1S7XMxxVXEOWtJGMAARETyDKiMN4tsmFfcvmo+sHuHZrY196169rbT/sHFGNK1cnJrBK2vDu7b0AsBd9VaKrsNHL/KxFHm3Yma/+S365yvTF+abktGk7JSrS++mXLBw76AiuijMPpwzPoP4jNzZjI+R/p7zboMSKiFvZkMx8CDIPGB+K2Ee7XaOqAu8z6cWgazCp76DdzIwsmGw2TiczmQMAafEX0U6lQOAA6jQJAfCsBrSxVH+Hw8fPKIpB7JuhzAB/BwAAAw9tb292AAAAbG12aGQAAAAAAAAAAAAAAAAAAAPoAAAATwABAAABAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAACOnRyYWsAAABcdGtoZAAAAAMAAAAAAAAAAAAAAAEAAAAAAAAATwAAAAAAAAAAAAAAAQEAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAACRlZHRzAAAAHGVsc3QAAAAAAAAAAQAAAE4AAAgAAAEAAAAAAbJtZGlhAAAAIG1kaGQAAAAAAAAAAAAAAAAAAKxEAAAVgFXEAAAAAAAtaGRscgAAAAAAAAAAc291bgAAAAAAAAAAAAAAAFNvdW5kSGFuZGxlcgAAAAFdbWluZgAAABBzbWhkAAAAAAAAAAAAAAAkZGluZgAAABxkcmVmAAAAAAAAAAEAAAAMdXJsIAAAAAEAAAEhc3RibAAAAGdzdHNkAAAAAAAAAAEAAABXbXA0YQAAAAAAAAABAAAAAAAAAAAAAQAQAAAAAKxEAAAAAAAzZXNkcwAAAAADgICAIgABAASAgIAUQBUAAAAAARrvAAEa7wWAgIACEggGgICAAQIAAAAgc3R0cwAAAAAAAAACAAAABQAABAAAAAABAAABgAAAABxzdHNjAAAAAAAAAAEAAAABAAAABgAAAAEAAAAsc3RzegAAAAAAAAAAAAAABgAAALkAAAC6AAABIAAAAQAAAAC9AAAAGgAAABRzdGNvAAAAAAAAAAEAAAAsAAAAGnNncGQBAAAAcm9sbAAAAAIAAAAB//8AAAAcc2JncAAAAAByb2xsAAAAAQAAAAYAAAABAAAAYXVkdGEAAABZbWV0YQAAAAAAAAAhaGRscgAAAAAAAAAAbWRpcmFwcGwAAAAAAAAAAAAAAAAsaWxzdAAAACSpdG9vAAAAHGRhdGEAAAABAAAAAExhdmY2MC4zLjEwMA=="),"CLASSIC_BEEP"===t.soundType&&(this.audioFile.src="data:audio/mp4;base64,AAAAHGZ0eXBNNEEgAAAAAE00QSBtcDQyaXNvbQAAAAFtZGF0AAAAAAAACHchIANAaBv6AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOCFO4v////////gyh+L1JkJB36Cv0yBUdzB8/8/b8vveozPf+/6eH18deTh9kOp11urWAB5ZsMnhMwSjUCF2MQub4hybjxDhHACGof0XiT9tAHVOwt4NPtPOMFr/ndlTpTNXy79GYIfXP7VkPs99ySHNOFkpNrBS1pClU3rRGHp6Dy9FBIlk4KbBNBLGMJRcWQxuVsVJCSMnGw1FuIUrBN2UJLoEMhurMxpIiyGAweBvyfNJy4FbxqDm3WDjCtzP+3yVmOjxhIBDANLYyeG05LNyCZONEOk/c4hCj3Y2XQkgTI7y/39g0a+MuEoAdbRz4gSgRJnjEGB0TnOB0LtiL0XB9kwz2SwCBB0MvIByUSWTPTsRdCA4PvEmwnNdTnJT5/kPGk4swkTgOOuWJBI0EkxFs5mmNIR6wSFql36Hn03/Lf/uHp+6aTmBY0HJ6P6X1atw/Y8vK72LCWpsq0beo5KkrrrMe1eabaDyfZRPYfgPwH4Dv4CHU663VrAA8wchbBRlqQNnYNlYNhYNigNhoTBsTCcTCgLBEQCX+XfNd+3y+piKntTerXdXpDWRpLzsKmJ4iRM4ig+I6R65pDawx8Ry4cxfeifbsbzK/TxNhafR9y2zFVicy8nCVkU6CkmLckGtqbuYvhruBP0TriLNTU1TNhW6tUCdUSyneDUWAox5RTMlF2W1san5MQRlj7Btm2bZhoqoUUAJlpaat54WVuTyOxqwzNVhPenFR9KBpuA3qrUrT+3ShOUdXAkGXmCrMBxH3XmROdVSkS8cccRMOKTN+7OOEIQrMYIcna5hipAqPHk6VSgy0gGXljIk7GR/O606SyhhgglQIZLyxxOa/ZANmzZkyZMlRoqIt/T6xZHaFLcZ6n8jSgTVoOGsK5MvOlIBBkR+AtM5hvkTG2UzEhEAcsA7bZfCZmmZmZjQnqfn/yRwXzQtlZljFYd93mGppQSDDV/oz8HKkKjElN9Pu/inFmh3IHFyXlrJ/dodwM2EUkLZff1jWCO84wYUa3JB52yTMCETuUgA0BWB+I4hDBR1xoligVhgVhgNhYdBcLCcakAb1XLO/eZ9cUtvv6cNzrRYdMWgFvJySSSSscWFxCQElKcwc2dFkyos8dHfXPYFSt0klO2wUeIUxNKf5LiWYGm57bV0dipv7Qpw9uRRu23CuNIbT7++AuwEnyFWIQP0OpdUhc7u2k2fKW3mTZZxCSb+gVCjOzNf7LzxdBpbZxYwuNkcRlqAMdRMhq+tXmbLkMGGph20w4JvwvBm+x4Wtomh4lz0GGBVGQ96+JUXhvqQQAQPRTHtn+e7SwaCKMXnEEWXevaFVrPVEX7wxIBbbcpAHXj2DQz/vO9M0FHzyQFtegQjjn+fM99jgBE2fLJs/PLcErzrmCGJdVHZ19uxTErdmR6viG6cetew2MYQFm5AIDdPmjeXifvbFcjkYQWUsqKoBQJAKMp50hLtJRCKLCTSw2f7e0wzzhr6eGhjlyOQ8blgBiR0fxcjQYM5rBBM/wzuDe972u2f/mN7u8zVqGu7QADPHgAK4PxW8nJJJJLgISwUZaaRYmFRWRBEIwQKfmepncccZoqHnVy0WnFag51Yt48agPiK7D59zNlI+6YR9SHvnKoiJCcRzsskEGDgIrLQoLEgDguNTzeNvuxVpc8wntXmUlTQMa9WLn/geS8F7ku6Vt+I9yiumFP6I5hbEGeXac1BCB3YA3gNA0rLFPwrWq//VvtF6JGKIOVA12lCnpZl8NJojK1yqVsVKp+ZqbDpq0S1duspmvSvCbwmftOnwnfuNqBCnzZfzZF9fkqxTCqlq8GmR3bGK+1uvEcF55cGGx8BNANhkk1438/rWbXeTtPGfukvhUxZBp0M5447+2SFiQW674ySiGSRHgyqcqU0x39tbz3afnWt5BKNHDYj1lzq6sg8dcJlJnSQDUEba4npgEoAqVUkksoqM0UUO3VXDo3Mablwd2GLAoXjgK071swbuWhQJ2AjGYsBx5dtOMYCyPVh+K3jxqA+IuAhTrc+3KVqmDuVmIO5TZmQbDr4vUV+0338fXQ3665PiYnII1REb2klWhUcwjqi/pMe4yYZaDbo9T1ougUKE5h1jUim2NZxM71zBZVa/tWam6wXlmFVVHGuvL76pT3PUGufbO9YwevQzCvXhsabRuJyJjz8A1Haftmewy4gZ0FWlMIO5BoXB49j0TeIiikaxP9ZHcD9oI6x2H4DajNt5WgRXj6/H72V+gj2bgMDVkIZ36j1Tl+wdO6fvFsz56a5V6t9lS+gyWSOvuQP9bqtYgqWlsthXSFkrTfNqni6jSQ5vN9Fp1iYJODbUg8Sg0lYLbNEM7oqvrggxzq13IfO9hGQ0MQVpMIAR0aSGMFWOZzpJmXG1IcjppdZkINTYN2UvrHmGUrVBHvRuueFPuy2GzQoSnMCvkT3WvaR/LoVYw7Voy47wdJee2Va623AFXWNINOpByyoc9SQU4vPQ6X0PMBLQs6GdMlx+RlC3VoMDOryeFFolCTD8B+A/A4AAANKbW9vdgAAAGxtdmhkAAAAANcxfvfXMX73AACsRAAADbEAAQAAAQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAdx0cmFrAAAAXHRraGQAAAAB1zF+99cxfvcAAAABAAAAAAAADbEAAAAAAAAAAAAAAAABAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAF4bWRpYQAAACBtZGhkAAAAANcxfvfXMX73AACsRAAAGABVxAAAAAAAMWhkbHIAAAAAAAAAAHNvdW4AAAAAAAAAAAAAAABDb3JlIE1lZGlhIEF1ZGlvAAAAAR9taW5mAAAAEHNtaGQAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAAONzdGJsAAAAZ3N0c2QAAAAAAAAAAQAAAFdtcDRhAAAAAAAAAAEAAAAAAAAAAAACABAAAAAArEQAAAAAADNlc2RzAAAAAAOAgIAiAAAABICAgBRAFQAYAAAB9AAAAfQABYCAgAISEAaAgIABAgAAABhzdHRzAAAAAAAAAAEAAAAGAAAEAAAAABxzdHNjAAAAAAAAAAEAAAABAAAABgAAAAEAAAAsc3RzegAAAAAAAAAAAAAABgAAAP4AAAF+AAABjwAAAYQAAAFeAAABegAAABRzdGNvAAAAAAAAAAEAAAAsAAAA+nVkdGEAAADybWV0YQAAAAAAAAAiaGRscgAAAAAAAAAAbWRpcgAAAAAAAAAAAAAAAAAAAAAAxGlsc3QAAAC8LS0tLQAAABxtZWFuAAAAAGNvbS5hcHBsZS5pVHVuZXMAAAAUbmFtZQAAAABpVHVuU01QQgAAAIRkYXRhAAAAAQAAAAAgMDAwMDAwMDAgMDAwMDA4NDAgMDAwMDAyMEYgMDAwMDAwMDAwMDAwMERCMSAwMDAwMDAwMCAwMDAwMDAwMCAwMDAwMDAwMCAwMDAwMDAwMCAwMDAwMDAwMCAwMDAwMDAwMCAwMDAwMDAwMCAwMDAwMDAwMA=="))}))}beep(t){t.successBeepEnabled&&this.play()}play(){return dt(this,void 0,void 0,(function*(){try{yield this.audioFile.play()}catch(t){}}))}}ht.INSTANCE=new ht;var pt=ht;class ft{constructor(){this.DURATION=200}vibrate(t){t.enabled&&navigator.vibrate&&navigator.vibrate(this.DURATION)}}ft.INSTANCE=new ft;var mt=ft,gt=n(11),vt=n(21),At=n(23),bt=n(22);class yt extends B.default.Component{constructor(t){super(t),this.state={base64Image:void 0}}render(){const t="x"+this.props.barcode.count;return B.default.createElement("div",{style:{display:"flex",flexDirection:"row",backgroundColor:"white",paddingBottom:5,paddingTop:5,borderBottom:"0.5px solid gray"}},B.default.createElement("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",width:"100%"}},B.default.createElement("div",{style:{display:"flex",fontSize:15,fontWeight:400,width:"100%"}},B.default.createElement("div",{style:{flex:1}},this.props.barcode.text),B.default.createElement("div",{style:{flex:1,justifyContent:"end",display:"flex"}},t)),B.default.createElement("div",{style:{color:"gray",fontSize:13,fontWeight:300}},this.props.barcode.format)))}}class Ct extends B.default.Component{constructor(t){super(t),this.state={barcodes:this.toUniqueListWithDuplicateCounter(t.barcodes)}}toUniqueListWithDuplicateCounter(t){const e=[];return t.forEach((t=>{const n=e.findIndex((e=>it(e,t)));-1===n?(t.count=1,e.push(t)):e[n].count++})),e}update(t){this.setState({barcodes:this.toUniqueListWithDuplicateCounter(t)})}render(){return B.default.createElement("div",{style:{display:"flex",flexDirection:"column",backgroundColor:"white",padding:15}},this.state.barcodes.map(((t,e)=>B.default.createElement(yt,{key:e,barcode:t,onClick:this.props.onClick}))))}}class St{}St.ScanbotPrimary="#c8193c",St.LightGray="#F5F5F5",St.Gray="#808080",St.DarkGray="#333333",St.Orange="#FF5533",St.White="#FFFFFF",St.TransparentGreen="rgba(0, 255, 0, 0.5)",St.TransparentGray="rgba(50, 50, 50, 0.5)",St.TransparentBlack="rgba(0, 0, 0, 0.3)",St.SBNegative="#FF3737";var wt,xt=St;!function(t){t[t.None=0]="None",t[t.PushRight=1]="PushRight",t[t.PushBottom=2]="PushBottom",t[t.Pop=3]="Pop"}(wt||(wt={}));class Et extends B.default.Component{constructor(t){super(t),this._isVisible=!1,this.state={animation:{type:wt.None},elements:[]}}containerStyle(t){return{height:"100%",width:"100%",position:"absolute",top:"0",left:"0",zIndex:101,transform:t,overflow:"scroll"}}render(){var t,e,n;if(this.state.animation.type===wt.None)return null;const i=this.animation(this.state.animation.type),o=this.to(this.state.animation.type);this.previousDestination=o;const r=this.props.style;return B.default.createElement(i,{style:this.containerStyle(`${o}`),onAnimationStart:this.onAnimationStart.bind(this),onAnimationEnd:this.onAnimationEnd.bind(this),onClick:t=>{this.reset()}},B.default.createElement("div",{style:{backgroundColor:"white",height:r.sheetHeight,width:"100%",marginTop:r.sheetTopMargin,borderTopLeftRadius:20,borderTopRightRadius:20},onClick:t=>{t.stopPropagation()}},B.default.createElement("div",{style:{borderTopLeftRadius:20,borderTopRightRadius:20,backgroundColor:xt.ScanbotPrimary}},B.default.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"end",height:10}},B.default.createElement("div",{style:{backgroundColor:xt.White,height:3,width:33,borderRadius:5}})),B.default.createElement("div",{style:{display:"flex",height:50}},B.default.createElement("div",{style:{display:"flex",fontSize:12,flex:1,color:xt.White,alignItems:"center",justifyContent:"left",paddingLeft:10,fontWeight:300},onClick:this.props.onDeleteClick},"CLEAR ALL"),B.default.createElement("div",{style:{display:"flex",fontSize:15,flex:1,color:xt.White,justifyContent:"center",alignItems:"center",fontWeight:500}},(null!==(e=null===(t=this.barcodes)||void 0===t?void 0:t.length)&&void 0!==e?e:0)+" Codes"),B.default.createElement("div",{style:{display:"flex",fontSize:13,flex:1,color:xt.White,justifyContent:"right",alignItems:"center",paddingRight:10}},B.default.createElement("div",{style:{fontSize:30,fontWeight:100},onClick:t=>{t.stopPropagation(),this.reset()}},"×")))),B.default.createElement(Ct,{ref:t=>{null!==t&&(this.list=t)},barcodes:null!==(n=this.barcodes)&&void 0!==n?n:[]})))}reset(){this.pop()}isVisible(){return this._isVisible}push(t,e){this._isVisible=!0,this.barcodes=e,this.updateAnimationType(t)}update(t){this.barcodes=t,this.forceUpdate()}pop(){this._isVisible=!1,this.updateAnimationType(wt.Pop)}onAnimationStart(){}onAnimationEnd(){this.state.animation.type===wt.Pop&&this.updateAnimationType(wt.None)}updateAnimationType(t,e){this.setState({animation:{type:t}},e)}animation(t){let e=this.from(t),n=this.to(t);this.previousDestination===n&&(e=this.previousDestination,n=this.previousDestination);const i=bt.b`from {transform: ${e};} to {transform: ${n};}`;return bt.a.div`animation: ${i} 0.5s;`}from(t){if(t===wt.PushRight)return this.translate("X",100);if(t===wt.PushBottom)return this.translate("Y",100);if(t===wt.Pop){const t=this.pushType===wt.PushRight?"X":"Y";return this.translate(t,0)}}to(t){if(t===wt.PushRight)return this.translate("X",0);if(t===wt.PushBottom)return this.translate("Y",0);if(t===wt.Pop){const t=this.pushType===wt.PushRight?"X":"Y";return this.translate(t,100)}}translate(t,e){return"translate"+t+"("+e+"%)"}componentWillUnmount(){this._isVisible=!1}}var Lt=n(2),_t=function(t){return{isEnabled:function(e){return t.some((function(t){return!!e[t]}))}}},Ot={measureLayout:_t(["layout","layoutId","drag","_layoutResetTransform"]),animation:_t(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag"]),exit:_t(["exit"]),drag:_t(["drag","dragControls"]),focus:_t(["whileFocus"]),hover:_t(["whileHover","onHoverStart","onHoverEnd"]),tap:_t(["whileTap","onTap","onTapStart","onTapCancel"]),pan:_t(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),layoutAnimation:_t(["layout","layoutId"])};var Tt=Object(B.createContext)({strict:!1}),kt=Object.keys(Ot),Dt=kt.length;var Pt=Object(B.createContext)({transformPagePoint:function(t){return t},isStatic:!1}),Rt=Object(B.createContext)({});var It=Object(B.createContext)(null);function Ft(t){var e=Object(B.useRef)(null);return null===e.current&&(e.current=t()),e.current}function Bt(){var t=Object(B.useContext)(It);if(null===t)return[!0,null];var e=t.isPresent,n=t.onExitComplete,i=t.register,o=zt();Object(B.useEffect)((function(){return i(o)}),[]);return!e&&n?[!1,function(){return null==n?void 0:n(o)}]:[!0]}function Wt(t){return null===t||t.isPresent}var Mt=0,jt=function(){return Mt++},zt=function(){return Ft(jt)},Nt=Object(B.createContext)(null),Vt="undefined"!=typeof window,Ut=Vt?B.useLayoutEffect:B.useEffect;function Ht(t,e,n,i){var o=Object(B.useContext)(Pt),r=Object(B.useContext)(Tt),a=Object(B.useContext)(Rt).visualElement,s=Object(B.useContext)(It),l=function(t){var e=t.layoutId,n=Object(B.useContext)(Nt);return n&&void 0!==e?n+"-"+e:e}(n),c=Object(B.useRef)(void 0);i||(i=r.renderer),!c.current&&i&&(c.current=i(t,{visualState:e,parent:a,props:Object(Lt.a)(Object(Lt.a)({},n),{layoutId:l}),presenceId:null==s?void 0:s.id,blockInitialAnimation:!1===(null==s?void 0:s.initial)}));var u=c.current;return Ut((function(){u&&(u.setProps(Object(Lt.a)(Object(Lt.a)(Object(Lt.a)({},o),n),{layoutId:l})),u.isPresent=Wt(s),u.isPresenceRoot=!a||a.presenceId!==(null==s?void 0:s.id),u.syncRender())})),Object(B.useEffect)((function(){var t;u&&(null===(t=u.animationState)||void 0===t||t.animateChanges())})),Ut((function(){return function(){return null==u?void 0:u.notifyUnmount()}}),[]),u}function Gt(t){return"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function Qt(t){return Array.isArray(t)}function Zt(t){return"string"==typeof t||Qt(t)}function Yt(t,e,n,i,o){var r;return void 0===i&&(i={}),void 0===o&&(o={}),"string"==typeof e&&(e=null===(r=t.variants)||void 0===r?void 0:r[e]),"function"==typeof e?e(null!=n?n:t.custom,i,o):e}function qt(t,e,n){var i=t.getProps();return Yt(i,e,null!=n?n:i.custom,function(t){var e={};return t.forEachValue((function(t,n){return e[n]=t.get()})),e}(t),function(t){var e={};return t.forEachValue((function(t,n){return e[n]=t.getVelocity()})),e}(t))}function Xt(t){var e;return"function"==typeof(null===(e=t.animate)||void 0===e?void 0:e.start)||Zt(t.initial)||Zt(t.animate)||Zt(t.whileHover)||Zt(t.whileDrag)||Zt(t.whileTap)||Zt(t.whileFocus)||Zt(t.exit)}function $t(t){return Boolean(Xt(t)||t.variants)}function Kt(t,e){var n=function(t,e){if(Xt(t)){var n=t.initial,i=t.animate;return{initial:!1===n||Zt(n)?n:void 0,animate:Zt(i)?i:void 0}}return!1!==t.inherit?e:{}}(t,Object(B.useContext)(Rt)),i=n.initial,o=n.animate;return Object(B.useMemo)((function(){return{initial:i,animate:o}}),e?[Jt(i),Jt(o)]:[])}function Jt(t){return Array.isArray(t)?t.join(" "):t}function te(t){var e=t.preloadedFeatures,n=t.createVisualElement,i=t.useRender,o=t.useVisualState,r=t.Component;return e&&function(t){for(var e in t){var n=t[e];null!==n&&(Ot[e].Component=n)}}(e),Object(B.forwardRef)((function(t,e){var a=Object(B.useContext)(Pt).isStatic,s=null,l=Kt(t,a),c=o(t,a);return!a&&Vt&&(l.visualElement=Ht(r,c,t,n),s=function(t,e,n){var i=[];if(Object(B.useContext)(Tt),!e)return null;for(var o=0;o<Dt;o++){var r=kt[o],a=Ot[r],s=a.isEnabled,l=a.Component;s(t)&&l&&i.push(B.createElement(l,Object(Lt.a)({key:r},t,{visualElement:e})))}return i}(t,l.visualElement)),B.createElement(B.Fragment,null,B.createElement(Rt.Provider,{value:l},i(r,t,function(t,e,n){return Object(B.useCallback)((function(i){var o;i&&(null===(o=t.mount)||void 0===o||o.call(t,i)),e&&(i?e.mount(i):e.unmount()),n&&("function"==typeof n?n(i):Gt(n)&&(n.current=i))}),[e])}(c,l.visualElement,e),c,a)),s)}))}function ee(t){function e(e,n){return void 0===n&&(n={}),te(t(e,n))}var n=new Map;return new Proxy(e,{get:function(t,i){return n.has(i)||n.set(i,e(i)),n.get(i)}})}var ne=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","svg","switch","symbol","text","tspan","use","view"];function ie(t){return"string"==typeof t&&!t.includes("-")&&!!(ne.indexOf(t)>-1||/[A-Z]/.test(t))}var oe={};var re=["","X","Y","Z"],ae=["transformPerspective","x","y","z"];function se(t,e){return ae.indexOf(t)-ae.indexOf(e)}["translate","scale","rotate","skew"].forEach((function(t){return re.forEach((function(e){return ae.push(t+e)}))}));var le=new Set(ae);function ce(t){return le.has(t)}var ue=new Set(["originX","originY","originZ"]);function de(t){return ue.has(t)}function he(t,e){var n=e.layout,i=e.layoutId;return ce(t)||de(t)||(n||void 0!==i)&&(!!oe[t]||"opacity"===t)}var pe=function(t){return null!==t&&"object"==typeof t&&t.getVelocity},fe={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};function me(t){return t.startsWith("--")}var ge=function(t,e){return e&&"number"==typeof t?e.transform(t):t},ve=function(t,e){return function(n){return Math.max(Math.min(n,e),t)}},Ae=function(t){return t%1?Number(t.toFixed(5)):t},be=/(-)?([\d]*\.?[\d])+/g,ye=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))/gi,Ce=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))$/i;function Se(t){return"string"==typeof t}var we=function(t){return{test:function(e){return Se(e)&&e.endsWith(t)&&1===e.split(" ").length},parse:parseFloat,transform:function(e){return""+e+t}}},xe=we("deg"),Ee=we("%"),Le=we("px"),_e=we("vh"),Oe=we("vw"),Te=Object(Lt.a)(Object(Lt.a)({},Ee),{parse:function(t){return Ee.parse(t)/100},transform:function(t){return Ee.transform(100*t)}}),ke={test:function(t){return"number"==typeof t},parse:parseFloat,transform:function(t){return t}},De=Object(Lt.a)(Object(Lt.a)({},ke),{transform:ve(0,1)}),Pe=Object(Lt.a)(Object(Lt.a)({},ke),{default:1}),Re=Object(Lt.a)(Object(Lt.a)({},ke),{transform:Math.round}),Ie={borderWidth:Le,borderTopWidth:Le,borderRightWidth:Le,borderBottomWidth:Le,borderLeftWidth:Le,borderRadius:Le,radius:Le,borderTopLeftRadius:Le,borderTopRightRadius:Le,borderBottomRightRadius:Le,borderBottomLeftRadius:Le,width:Le,maxWidth:Le,height:Le,maxHeight:Le,size:Le,top:Le,right:Le,bottom:Le,left:Le,padding:Le,paddingTop:Le,paddingRight:Le,paddingBottom:Le,paddingLeft:Le,margin:Le,marginTop:Le,marginRight:Le,marginBottom:Le,marginLeft:Le,rotate:xe,rotateX:xe,rotateY:xe,rotateZ:xe,scale:Pe,scaleX:Pe,scaleY:Pe,scaleZ:Pe,skew:xe,skewX:xe,skewY:xe,distance:Le,translateX:Le,translateY:Le,translateZ:Le,x:Le,y:Le,z:Le,perspective:Le,transformPerspective:Le,opacity:De,originX:Te,originY:Te,originZ:Le,zIndex:Re,fillOpacity:De,strokeOpacity:De,numOctaves:Re};function Fe(t,e,n,i,o,r,a,s){var l,c=t.style,u=t.vars,d=t.transform,h=t.transformKeys,p=t.transformOrigin;h.length=0;var f=!1,m=!1,g=!0;for(var v in e){var A=e[v];if(me(v))u[v]=A;else{var b=Ie[v],y=ge(A,b);if(ce(v)){if(f=!0,d[v]=y,h.push(v),!g)continue;A!==(null!==(l=b.default)&&void 0!==l?l:0)&&(g=!1)}else if(de(v))p[v]=y,m=!0;else if((null==n?void 0:n.isHydrated)&&(null==i?void 0:i.isHydrated)&&oe[v]){var C=oe[v].process(A,i,n),S=oe[v].applyTo;if(S)for(var w=S.length,x=0;x<w;x++)c[S[x]]=C;else c[v]=C}else c[v]=y}}i&&n&&a&&s?(c.transform=a(i.deltaFinal,i.treeScale,f?d:void 0),r&&(c.transform=r(d,c.transform)),c.transformOrigin=s(i)):(f&&(c.transform=function(t,e,n,i){var o=t.transform,r=t.transformKeys,a=e.enableHardwareAcceleration,s=void 0===a||a,l=e.allowTransformNone,c=void 0===l||l,u="";r.sort(se);for(var d=!1,h=r.length,p=0;p<h;p++){var f=r[p];u+=(fe[f]||f)+"("+o[f]+") ","z"===f&&(d=!0)}return!d&&s?u+="translateZ(0)":u=u.trim(),i?u=i(o,n?"":u):c&&n&&(u="none"),u}(t,o,g,r)),m&&(c.transformOrigin=function(t){var e=t.originX,n=void 0===e?"50%":e,i=t.originY,o=void 0===i?"50%":i,r=t.originZ;return n+" "+o+" "+(void 0===r?0:r)}(p)))}var Be=function(){return{style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}}};function We(t,e,n){for(var i in e)pe(e[i])||he(i,n)||(t[i]=e[i])}function Me(t,e,n){var i={};return We(i,t.style||{},t),Object.assign(i,function(t,e,n){var i=t.transformTemplate;return Object(B.useMemo)((function(){var t={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}};Fe(t,e,void 0,void 0,{enableHardwareAcceleration:!n},i);var o=t.vars,r=t.style;return Object(Lt.a)(Object(Lt.a)({},o),r)}),[e])}(t,e,n)),t.transformValues&&(i=t.transformValues(i)),i}function je(t,e,n){var i={},o=Me(t,e,n);return Boolean(t.drag)&&(i.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),i.style=o,i}var ze=new Set(["initial","animate","exit","style","variants","transition","transformTemplate","transformValues","custom","inherit","layout","layoutId","_layoutResetTransform","onLayoutAnimationComplete","onViewportBoxUpdate","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","drag","dragControls","dragListener","dragConstraints","dragDirectionLock","_dragX","_dragY","dragElastic","dragMomentum","dragPropagation","dragTransition","whileDrag","onPan","onPanStart","onPanEnd","onPanSessionStart","onTap","onTapStart","onTapCancel","onHoverStart","onHoverEnd","whileFocus","whileTap","whileHover"]);function Ne(t){return ze.has(t)}var Ve=function(t){return!Ne(t)};try{var Ue=n(43).default;Ve=function(t){return t.startsWith("on")?!Ne(t):Ue(t)}}catch(t){}function He(t,e,n){return"string"==typeof t?t:Le.transform(e+n*t)}var Ge=function(t,e){return Le.transform(t*e)},Qe={offset:"stroke-dashoffset",array:"stroke-dasharray"},Ze={offset:"strokeDashoffset",array:"strokeDasharray"};function Ye(t,e,n,i,o,r,a,s){var l=e.attrX,c=e.attrY,u=e.originX,d=e.originY,h=e.pathLength,p=e.pathSpacing,f=void 0===p?1:p,m=e.pathOffset,g=void 0===m?0:m;Fe(t,Object(Lt.d)(e,["attrX","attrY","originX","originY","pathLength","pathSpacing","pathOffset"]),n,i,o,r,a,s),t.attrs=t.style,t.style={};var v=t.attrs,A=t.style,b=t.dimensions,y=t.totalPathLength;v.transform&&(b&&(A.transform=v.transform),delete v.transform),b&&(void 0!==u||void 0!==d||A.transform)&&(A.transformOrigin=function(t,e,n){return He(e,t.x,t.width)+" "+He(n,t.y,t.height)}(b,void 0!==u?u:.5,void 0!==d?d:.5)),void 0!==l&&(v.x=l),void 0!==c&&(v.y=c),void 0!==y&&void 0!==h&&function(t,e,n,i,o,r){void 0===i&&(i=1),void 0===o&&(o=0),void 0===r&&(r=!0);var a=r?Qe:Ze;t[a.offset]=Ge(-o,e);var s=Ge(n,e),l=Ge(i,e);t[a.array]=s+" "+l}(v,y,h,f,g,!1)}var qe=function(){return Object(Lt.a)(Object(Lt.a)({},{style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}}),{attrs:{}})};function Xe(t,e){var n=Object(B.useMemo)((function(){var n=qe();return Ye(n,e,void 0,void 0,{enableHardwareAcceleration:!1},t.transformTemplate),Object(Lt.a)(Object(Lt.a)({},n.attrs),{style:Object(Lt.a)({},n.style)})}),[e]);if(t.style){var i={};We(i,t.style,t),n.style=Object(Lt.a)(Object(Lt.a)({},i),n.style)}return n}function $e(t){void 0===t&&(t=!1);return function(e,n,i,o,r){var a=o.latestValues,s=(ie(e)?Xe:je)(n,a,r),l=function(t,e,n){var i={};for(var o in t)(Ve(o)||!0===n&&Ne(o)||!e&&!Ne(o))&&(i[o]=t[o]);return i}(n,"string"==typeof e,t),c=Object(Lt.a)(Object(Lt.a)(Object(Lt.a)({},l),s),{ref:i});return Object(B.createElement)(e,c)}}var Ke=/([a-z])([A-Z])/g,Je=function(t){return t.replace(Ke,"$1-$2").toLowerCase()};function tn(t,e){var n=e.style,i=e.vars;for(var o in Object.assign(t.style,n),i)t.style.setProperty(o,i[o])}var en=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform"]);function nn(t,e){for(var n in tn(t,e),e.attrs)t.setAttribute(en.has(n)?n:Je(n),e.attrs[n])}function on(t){var e=t.style,n={};for(var i in e)(pe(e[i])||he(i,t))&&(n[i]=e[i]);return n}function rn(t){var e=on(t);for(var n in t){if(pe(t[n]))e["x"===n||"y"===n?"attr"+n.toUpperCase():n]=t[n]}return e}function an(t){return"object"==typeof t&&"function"==typeof t.start}var sn=function(t){return Array.isArray(t)};function ln(t){var e,n=pe(t)?t.get():t;return e=n,Boolean(e&&"object"==typeof e&&e.mix&&e.toValue)?n.toValue():n}function cn(t,e,n,i){var o=t.scrapeMotionValuesFromProps,r=t.createRenderState,a=t.onMount,s={latestValues:dn(e,n,i,o),renderState:r()};return a&&(s.mount=function(t){return a(e,t,s)}),s}var un=function(t){return function(e,n){var i=Object(B.useContext)(Rt),o=Object(B.useContext)(It);return n?cn(t,e,i,o):Ft((function(){return cn(t,e,i,o)}))}};function dn(t,e,n,i){var o={},r=!1===(null==n?void 0:n.initial),a=i(t);for(var s in a)o[s]=ln(a[s]);var l=t.initial,c=t.animate,u=Xt(t),d=$t(t);e&&d&&!u&&!1!==t.inherit&&(null!=l||(l=e.initial),null!=c||(c=e.animate));var h=r||!1===l?c:l;h&&"boolean"!=typeof h&&!an(h)&&(Array.isArray(h)?h:[h]).forEach((function(e){var n=Yt(t,e);if(n){var i=n.transitionEnd;n.transition;var r=Object(Lt.d)(n,["transitionEnd","transition"]);for(var a in r)o[a]=r[a];for(var a in i)o[a]=i[a]}}));return o}var hn={useVisualState:un({scrapeMotionValuesFromProps:rn,createRenderState:qe,onMount:function(t,e,n){var i=n.renderState,o=n.latestValues;try{i.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch(t){i.dimensions={x:0,y:0,width:0,height:0}}"path"===e.tagName&&(i.totalPathLength=e.getTotalLength()),Ye(i,o,void 0,void 0,{enableHardwareAcceleration:!1},t.transformTemplate),nn(e,i)}})};var pn,fn={useVisualState:un({scrapeMotionValuesFromProps:on,createRenderState:Be})};function mn(t,e,n,i){var o=e.forwardMotionProps,r=void 0!==o&&o,a=ie(t)?hn:fn;return Object(Lt.a)(Object(Lt.a)({},a),{preloadedFeatures:n,useRender:$e(r),createVisualElement:i,Component:t})}function gn(t,e,n,i){return t.addEventListener(e,n,i),function(){return t.removeEventListener(e,n,i)}}function vn(t,e,n,i){Object(B.useEffect)((function(){var o=t.current;if(n&&o)return gn(o,e,n,i)}),[t,e,n,i])}function An(t){return"undefined"!=typeof PointerEvent&&t instanceof PointerEvent?!("mouse"!==t.pointerType):t instanceof MouseEvent}function bn(t){return!!t.touches}!function(t){t.Animate="animate",t.Hover="whileHover",t.Tap="whileTap",t.Drag="whileDrag",t.Focus="whileFocus",t.Exit="exit"}(pn||(pn={}));var yn={pageX:0,pageY:0};function Cn(t,e){void 0===e&&(e="page");var n=t.touches[0]||t.changedTouches[0]||yn;return{x:n[e+"X"],y:n[e+"Y"]}}function Sn(t,e){return void 0===e&&(e="page"),{x:t[e+"X"],y:t[e+"Y"]}}function wn(t,e){return void 0===e&&(e="page"),{point:bn(t)?Cn(t,e):Sn(t,e)}}var xn=function(t,e){void 0===e&&(e=!1);var n,i=function(e){return t(e,wn(e))};return e?(n=i,function(t){var e=t instanceof MouseEvent;(!e||e&&0===t.button)&&n(t)}):i},En={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},Ln={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function _n(t){return Vt&&null===window.onpointerdown?t:Vt&&null===window.ontouchstart?Ln[t]:Vt&&null===window.onmousedown?En[t]:t}function On(t,e,n,i){return gn(t,_n(e),xn(n,"pointerdown"===e),i)}function Tn(t,e,n,i){return vn(t,_n(e),n&&xn(n,"pointerdown"===e),i)}function kn(t){var e=null;return function(){return null===e&&(e=t,function(){e=null})}}var Dn=kn("dragHorizontal"),Pn=kn("dragVertical");function Rn(t){var e=!1;if("y"===t)e=Pn();else if("x"===t)e=Dn();else{var n=Dn(),i=Pn();n&&i?e=function(){n(),i()}:(n&&n(),i&&i())}return e}function In(){var t=Rn(!0);return!t||(t(),!1)}function Fn(t,e,n){return function(i,o){var r;An(i)&&!In()&&(null==n||n(i,o),null===(r=t.animationState)||void 0===r||r.setActive(pn.Hover,e))}}var Bn=function(t,e){return!!e&&(t===e||Bn(t,e.parentElement))};function Wn(t){return Object(B.useEffect)((function(){return function(){return t()}}),[])}var Mn=function(t,e){return function(n){return e(t(n))}},jn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.reduce(Mn)};var zn=function(t){return function(e){return t(e),null}},Nn={tap:zn((function(t){var e=t.onTap,n=t.onTapStart,i=t.onTapCancel,o=t.whileTap,r=t.visualElement,a=e||n||i||o,s=Object(B.useRef)(!1),l=Object(B.useRef)(null);function c(){var t;null===(t=l.current)||void 0===t||t.call(l),l.current=null}function u(){var t;return c(),s.current=!1,null===(t=r.animationState)||void 0===t||t.setActive(pn.Tap,!1),!In()}function d(t,n){u()&&(Bn(r.getInstance(),t.target)?null==e||e(t,n):null==i||i(t,n))}function h(t,e){u()&&(null==i||i(t,e))}Tn(r,"pointerdown",a?function(t,e){var i;c(),s.current||(s.current=!0,l.current=jn(On(window,"pointerup",d),On(window,"pointercancel",h)),null==n||n(t,e),null===(i=r.animationState)||void 0===i||i.setActive(pn.Tap,!0))}:void 0),Wn(c)})),focus:zn((function(t){var e=t.whileFocus,n=t.visualElement;vn(n,"focus",e?function(){var t;null===(t=n.animationState)||void 0===t||t.setActive(pn.Focus,!0)}:void 0),vn(n,"blur",e?function(){var t;null===(t=n.animationState)||void 0===t||t.setActive(pn.Focus,!1)}:void 0)})),hover:zn((function(t){var e=t.onHoverStart,n=t.onHoverEnd,i=t.whileHover,o=t.visualElement;Tn(o,"pointerenter",e||i?Fn(o,!0,e):void 0),Tn(o,"pointerleave",n||i?Fn(o,!1,n):void 0)}))};function Vn(t,e){if(!Array.isArray(e))return!1;var n=e.length;if(n!==t.length)return!1;for(var i=0;i<n;i++)if(e[i]!==t[i])return!1;return!0}var Un=function(t,e,n){return Math.min(Math.max(n,t),e)},Hn=.001;function Gn(t){var e,n,i=t.duration,o=void 0===i?800:i,r=t.bounce,a=void 0===r?.25:r,s=t.velocity,l=void 0===s?0:s,c=t.mass,u=void 0===c?1:c,d=1-a;d=Un(.05,1,d),o=Un(.01,10,o/1e3),d<1?(e=function(t){var e=t*d,n=e*o,i=e-l,r=Qn(t,d),a=Math.exp(-n);return Hn-i/r*a},n=function(t){var n=t*d*o,i=n*l+l,r=Math.pow(d,2)*Math.pow(t,2)*o,a=Math.exp(-n),s=Qn(Math.pow(t,2),d);return(-e(t)+Hn>0?-1:1)*((i-r)*a)/s}):(e=function(t){return Math.exp(-t*o)*((t-l)*o+1)-.001},n=function(t){return Math.exp(-t*o)*(o*o*(l-t))});var h=function(t,e,n){for(var i=n,o=1;o<12;o++)i-=t(i)/e(i);return i}(e,n,5/o);if(o*=1e3,isNaN(h))return{stiffness:100,damping:10,duration:o};var p=Math.pow(h,2)*u;return{stiffness:p,damping:2*d*Math.sqrt(u*p),duration:o}}function Qn(t,e){return t*Math.sqrt(1-e*e)}var Zn=["duration","bounce"],Yn=["stiffness","damping","mass"];function qn(t,e){return e.some((function(e){return void 0!==t[e]}))}function Xn(t){var e=t.from,n=void 0===e?0:e,i=t.to,o=void 0===i?1:i,r=t.restSpeed,a=void 0===r?2:r,s=t.restDelta,l=Object(Lt.d)(t,["from","to","restSpeed","restDelta"]),c={done:!1,value:n},u=function(t){var e=Object(Lt.a)({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},t);if(!qn(t,Yn)&&qn(t,Zn)){var n=Gn(t);(e=Object(Lt.a)(Object(Lt.a)(Object(Lt.a)({},e),n),{velocity:0,mass:1})).isResolvedFromDuration=!0}return e}(l),d=u.stiffness,h=u.damping,p=u.mass,f=u.velocity,m=u.duration,g=u.isResolvedFromDuration,v=$n,A=$n;function b(){var t=f?-f/1e3:0,e=o-n,i=h/(2*Math.sqrt(d*p)),r=Math.sqrt(d/p)/1e3;if(null!=s||(s=Math.abs(o-n)<=1?.01:.4),i<1){var a=Qn(r,i);v=function(n){var s=Math.exp(-i*r*n);return o-s*((t+i*r*e)/a*Math.sin(a*n)+e*Math.cos(a*n))},A=function(n){var o=Math.exp(-i*r*n);return i*r*o*(Math.sin(a*n)*(t+i*r*e)/a+e*Math.cos(a*n))-o*(Math.cos(a*n)*(t+i*r*e)-a*e*Math.sin(a*n))}}else if(1===i)v=function(n){return o-Math.exp(-r*n)*(e+(t+r*e)*n)};else{var l=r*Math.sqrt(i*i-1);v=function(n){var a=Math.exp(-i*r*n),s=Math.min(l*n,300);return o-a*((t+i*r*e)*Math.sinh(s)+l*e*Math.cosh(s))/l}}}return b(),{next:function(t){var e=v(t);if(g)c.done=t>=m;else{var n=1e3*A(t),i=Math.abs(n)<=a,r=Math.abs(o-e)<=s;c.done=i&&r}return c.value=c.done?o:e,c},flipTarget:function(){var t;f=-f,n=(t=[o,n])[0],o=t[1],b()}}}Xn.needsInterpolation=function(t,e){return"string"==typeof t||"string"==typeof e};var $n=function(t){return 0},Kn=function(t,e,n){var i=e-t;return 0===i?1:(n-t)/i},Jn=function(t,e,n){return-n*t+n*e+t},ti=function(t,e){return function(n){return Boolean(Se(n)&&Ce.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e))}},ei=function(t,e,n){return function(i){var o;if(!Se(i))return i;var r=i.match(be),a=r[0],s=r[1],l=r[2],c=r[3];return(o={})[t]=parseFloat(a),o[e]=parseFloat(s),o[n]=parseFloat(l),o.alpha=void 0!==c?parseFloat(c):1,o}},ni=ve(0,255),ii=Object(Lt.a)(Object(Lt.a)({},ke),{transform:function(t){return Math.round(ni(t))}}),oi={test:ti("rgb","red"),parse:ei("red","green","blue"),transform:function(t){var e=t.red,n=t.green,i=t.blue,o=t.alpha,r=void 0===o?1:o;return"rgba("+ii.transform(e)+", "+ii.transform(n)+", "+ii.transform(i)+", "+Ae(De.transform(r))+")"}};var ri={test:ti("#"),parse:function(t){var e="",n="",i="",o="";return t.length>5?(e=t.substr(1,2),n=t.substr(3,2),i=t.substr(5,2),o=t.substr(7,2)):(e=t.substr(1,1),n=t.substr(2,1),i=t.substr(3,1),o=t.substr(4,1),e+=e,n+=n,i+=i,o+=o),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:o?parseInt(o,16)/255:1}},transform:oi.transform},ai={test:ti("hsl","hue"),parse:ei("hue","saturation","lightness"),transform:function(t){var e=t.hue,n=t.saturation,i=t.lightness,o=t.alpha,r=void 0===o?1:o;return"hsla("+Math.round(e)+", "+Ee.transform(Ae(n))+", "+Ee.transform(Ae(i))+", "+Ae(De.transform(r))+")"}},si=function(t,e,n){var i=t*t,o=e*e;return Math.sqrt(Math.max(0,n*(o-i)+i))},li=[ri,oi,ai],ci=function(t){return li.find((function(e){return e.test(t)}))},ui=function(t){return"'"+t+"' is not an animatable color. Use the equivalent color code instead."},di=function(t,e){var n=ci(t),i=ci(e);ui(t),ui(e),n.transform,i.transform;var o=n.parse(t),r=i.parse(e),a=Object(Lt.a)({},o),s=n===ai?Jn:si;return function(t){for(var e in a)"alpha"!==e&&(a[e]=s(o[e],r[e],t));return a.alpha=Jn(o.alpha,r.alpha,t),n.transform(a)}},hi={test:function(t){return oi.test(t)||ri.test(t)||ai.test(t)},parse:function(t){return oi.test(t)?oi.parse(t):ai.test(t)?ai.parse(t):ri.parse(t)},transform:function(t){return Se(t)?t:t.hasOwnProperty("red")?oi.transform(t):ai.transform(t)}},pi="${c}",fi="${n}";function mi(t){var e=[],n=0,i=t.match(ye);i&&(n=i.length,t=t.replace(ye,pi),e.push.apply(e,i.map(hi.parse)));var o=t.match(be);return o&&(t=t.replace(be,fi),e.push.apply(e,o.map(ke.parse))),{values:e,numColors:n,tokenised:t}}function gi(t){return mi(t).values}function vi(t){var e=mi(t),n=e.values,i=e.numColors,o=e.tokenised,r=n.length;return function(t){for(var e=o,n=0;n<r;n++)e=e.replace(n<i?pi:fi,n<i?hi.transform(t[n]):Ae(t[n]));return e}}var Ai=function(t){return"number"==typeof t?0:t};var bi={test:function(t){var e,n,i,o;return isNaN(t)&&Se(t)&&(null!==(n=null===(e=t.match(be))||void 0===e?void 0:e.length)&&void 0!==n?n:0)+(null!==(o=null===(i=t.match(ye))||void 0===i?void 0:i.length)&&void 0!==o?o:0)>0},parse:gi,createTransformer:vi,getAnimatableNone:function(t){var e=gi(t);return vi(t)(e.map(Ai))}},yi=function(t){return"number"==typeof t};function Ci(t,e){return yi(t)?function(n){return Jn(t,e,n)}:hi.test(t)?di(t,e):Ei(t,e)}var Si=function(t,e){var n=Object(Lt.e)([],t),i=n.length,o=t.map((function(t,n){return Ci(t,e[n])}));return function(t){for(var e=0;e<i;e++)n[e]=o[e](t);return n}},wi=function(t,e){var n=Object(Lt.a)(Object(Lt.a)({},t),e),i={};for(var o in n)void 0!==t[o]&&void 0!==e[o]&&(i[o]=Ci(t[o],e[o]));return function(t){for(var e in i)n[e]=i[e](t);return n}};function xi(t){for(var e=bi.parse(t),n=e.length,i=0,o=0,r=0,a=0;a<n;a++)i||"number"==typeof e[a]?i++:void 0!==e[a].hue?r++:o++;return{parsed:e,numNumbers:i,numRGB:o,numHSL:r}}var Ei=function(t,e){var n=bi.createTransformer(e),i=xi(t),o=xi(e);return i.numHSL===o.numHSL&&i.numRGB===o.numRGB&&(i.numNumbers,o.numNumbers),jn(Si(i.parsed,o.parsed),n)},Li=function(t,e){return function(n){return Jn(t,e,n)}};function _i(t,e,n){for(var i,o=[],r=n||("number"==typeof(i=t[0])?Li:"string"==typeof i?hi.test(i)?di:Ei:Array.isArray(i)?Si:"object"==typeof i?wi:void 0),a=t.length-1,s=0;s<a;s++){var l=r(t[s],t[s+1]);if(e){var c=Array.isArray(e)?e[s]:e;l=jn(c,l)}o.push(l)}return o}function Oi(t,e,n){var i=void 0===n?{}:n,o=i.clamp,r=void 0===o||o,a=i.ease,s=i.mixer,l=t.length;e.length,!a||!Array.isArray(a)||a.length,t[0]>t[l-1]&&(t=[].concat(t),e=[].concat(e),t.reverse(),e.reverse());var c=_i(e,a,s),u=2===l?function(t,e){var n=t[0],i=t[1],o=e[0];return function(t){return o(Kn(n,i,t))}}(t,c):function(t,e){var n=t.length,i=n-1;return function(o){var r=0,a=!1;if(o<=t[0]?a=!0:o>=t[i]&&(r=i-1,a=!0),!a){for(var s=1;s<n&&!(t[s]>o||s===i);s++);r=s-1}var l=Kn(t[r],t[r+1],o);return e[r](l)}}(t,c);return r?function(e){return u(Un(t[0],t[l-1],e))}:u}var Ti,ki=function(t){return function(e){return 1-t(1-e)}},Di=function(t){return function(e){return e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2}},Pi=function(t){return function(e){return e*e*((t+1)*e-t)}},Ri=function(t){return t},Ii=(Ti=2,function(t){return Math.pow(t,Ti)}),Fi=ki(Ii),Bi=Di(Ii),Wi=function(t){return 1-Math.sin(Math.acos(t))},Mi=ki(Wi),ji=Di(Mi),zi=Pi(1.525),Ni=ki(zi),Vi=Di(zi),Ui=function(t){var e=Pi(t);return function(t){return(t*=2)<1?.5*e(t):.5*(2-Math.pow(2,-10*(t-1)))}}(1.525),Hi=function(t){if(1===t||0===t)return t;var e=t*t;return t<.36363636363636365?7.5625*e:t<.7272727272727273?9.075*e-9.9*t+3.4:t<.9?12.066481994459833*e-19.63545706371191*t+8.898060941828255:10.8*t*t-20.52*t+10.72},Gi=ki(Hi);function Qi(t,e){return t.map((function(){return e||Bi})).splice(0,t.length-1)}function Zi(t){var e=t.from,n=void 0===e?0:e,i=t.to,o=void 0===i?1:i,r=t.ease,a=t.offset,s=t.duration,l=void 0===s?300:s,c={done:!1,value:n},u=Array.isArray(o)?o:[n,o],d=function(t,e){return t.map((function(t){return t*e}))}(a&&a.length===u.length?a:function(t){var e=t.length;return t.map((function(t,n){return 0!==n?n/(e-1):0}))}(u),l);function h(){return Oi(d,u,{ease:Array.isArray(r)?r:Qi(u,r)})}var p=h();return{next:function(t){return c.value=p(t),c.done=t>=l,c},flipTarget:function(){u.reverse(),p=h()}}}var Yi={keyframes:Zi,spring:Xn,decay:function(t){var e=t.velocity,n=void 0===e?0:e,i=t.from,o=void 0===i?0:i,r=t.power,a=void 0===r?.8:r,s=t.timeConstant,l=void 0===s?350:s,c=t.restDelta,u=void 0===c?.5:c,d=t.modifyTarget,h={done:!1,value:o},p=a*n,f=o+p,m=void 0===d?f:d(f);return m!==f&&(p=m-o),{next:function(t){var e=-p*Math.exp(-t/l);return h.done=!(e>u||e<-u),h.value=h.done?m:m+e,h},flipTarget:function(){}}}};var qi=1/60*1e3,Xi="undefined"!=typeof performance?function(){return performance.now()}:function(){return Date.now()},$i="undefined"!=typeof window?function(t){return window.requestAnimationFrame(t)}:function(t){return setTimeout((function(){return t(Xi())}),qi)};var Ki=!0,Ji=!1,to=!1,eo={delta:0,timestamp:0},no=["read","update","preRender","render","postRender"],io=no.reduce((function(t,e){return t[e]=function(t){var e=[],n=[],i=0,o=!1,r=new WeakSet,a={schedule:function(t,a,s){void 0===a&&(a=!1),void 0===s&&(s=!1);var l=s&&o,c=l?e:n;return a&&r.add(t),-1===c.indexOf(t)&&(c.push(t),l&&o&&(i=e.length)),t},cancel:function(t){var e=n.indexOf(t);-1!==e&&n.splice(e,1),r.delete(t)},process:function(s){var l;if(o=!0,e=(l=[n,e])[0],(n=l[1]).length=0,i=e.length)for(var c=0;c<i;c++){var u=e[c];u(s),r.has(u)&&(a.schedule(u),t())}o=!1}};return a}((function(){return Ji=!0})),t}),{}),oo=no.reduce((function(t,e){var n=io[e];return t[e]=function(t,e,i){return void 0===e&&(e=!1),void 0===i&&(i=!1),Ji||co(),n.schedule(t,e,i)},t}),{}),ro=no.reduce((function(t,e){return t[e]=io[e].cancel,t}),{}),ao=no.reduce((function(t,e){return t[e]=function(){return io[e].process(eo)},t}),{}),so=function(t){return io[t].process(eo)},lo=function(t){Ji=!1,eo.delta=Ki?qi:Math.max(Math.min(t-eo.timestamp,40),1),eo.timestamp=t,to=!0,no.forEach(so),to=!1,Ji&&(Ki=!1,$i(lo))},co=function(){Ji=!0,Ki=!0,to||$i(lo)},uo=function(){return eo},ho=oo;function po(t,e,n){return void 0===n&&(n=0),t-e-n}var fo=function(t){var e=function(e){var n=e.delta;return t(n)};return{start:function(){return ho.update(e,!0)},stop:function(){return ro.update(e)}}};function mo(t){var e,n,i,o,r,a=t.from,s=t.autoplay,l=void 0===s||s,c=t.driver,u=void 0===c?fo:c,d=t.elapsed,h=void 0===d?0:d,p=t.repeat,f=void 0===p?0:p,m=t.repeatType,g=void 0===m?"loop":m,v=t.repeatDelay,A=void 0===v?0:v,b=t.onPlay,y=t.onStop,C=t.onComplete,S=t.onRepeat,w=t.onUpdate,x=Object(Lt.d)(t,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]),E=x.to,L=0,_=x.duration,O=!1,T=!0,k=function(t){if(Array.isArray(t.to))return Zi;if(Yi[t.type])return Yi[t.type];var e=new Set(Object.keys(t));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?Zi:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?Xn:Zi}(x);(null===(n=(e=k).needsInterpolation)||void 0===n?void 0:n.call(e,a,E))&&(r=Oi([0,100],[a,E],{clamp:!1}),a=0,E=100);var D=k(Object(Lt.a)(Object(Lt.a)({},x),{from:a,to:E}));function P(){L++,"reverse"===g?h=function(t,e,n,i){return void 0===n&&(n=0),void 0===i&&(i=!0),i?po(e+-t,e,n):e-(t-e)+n}(h,_,A,T=L%2==0):(h=po(h,_,A),"mirror"===g&&D.flipTarget()),O=!1,S&&S()}function R(t){if(T||(t=-t),h+=t,!O){var e=D.next(Math.max(0,h));o=e.value,r&&(o=r(o)),O=T?e.done:h<=0}null==w||w(o),O&&(0===L&&(null!=_||(_=h)),L<f?function(t,e,n,i){return i?t>=e+n:t<=-n}(h,_,A,T)&&P():(i.stop(),C&&C()))}return l&&(null==b||b(),(i=u(R)).start()),{stop:function(){null==y||y(),i.stop()}}}function go(t,e){return e?t*(1e3/e):0}var vo=function(t){return 1e3*t},Ao=function(t,e){return 1-3*e+3*t},bo=function(t,e){return 3*e-6*t},yo=function(t){return 3*t},Co=function(t,e,n){return((Ao(e,n)*t+bo(e,n))*t+yo(e))*t},So=function(t,e,n){return 3*Ao(e,n)*t*t+2*bo(e,n)*t+yo(e)};var wo=.1;function xo(t,e,n,i){if(t===e&&n===i)return Ri;for(var o=new Float32Array(11),r=0;r<11;++r)o[r]=Co(r*wo,t,n);function a(e){for(var i=0,r=1;10!==r&&o[r]<=e;++r)i+=wo;--r;var a=i+(e-o[r])/(o[r+1]-o[r])*wo,s=So(a,t,n);return s>=.001?function(t,e,n,i){for(var o=0;o<8;++o){var r=So(e,n,i);if(0===r)return e;e-=(Co(e,n,i)-t)/r}return e}(e,a,t,n):0===s?a:function(t,e,n,i,o){var r,a,s=0;do{(r=Co(a=e+(n-e)/2,i,o)-t)>0?n=a:e=a}while(Math.abs(r)>1e-7&&++s<10);return a}(e,i,i+wo,t,n)}return function(t){return 0===t||1===t?t:Co(a(t),e,i)}}var Eo={linear:Ri,easeIn:Ii,easeInOut:Bi,easeOut:Fi,circIn:Wi,circInOut:ji,circOut:Mi,backIn:zi,backInOut:Vi,backOut:Ni,anticipate:Ui,bounceIn:Gi,bounceInOut:function(t){return t<.5?.5*(1-Hi(1-2*t)):.5*Hi(2*t-1)+.5},bounceOut:Hi},Lo=function(t){if(Array.isArray(t)){t.length;var e=Object(Lt.c)(t,4);return xo(e[0],e[1],e[2],e[3])}return"string"==typeof t?Eo[t]:t},_o=function(t,e){return"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!bi.test(e)||e.startsWith("url(")))},Oo=function(){return{type:"spring",stiffness:500,damping:25,restDelta:.5,restSpeed:10}},To=function(t){return{type:"spring",stiffness:550,damping:0===t?2*Math.sqrt(550):30,restDelta:.01,restSpeed:10}},ko=function(){return{type:"keyframes",ease:"linear",duration:.3}},Do=function(t){return{type:"keyframes",duration:.8,values:t}},Po={x:Oo,y:Oo,z:Oo,rotate:Oo,rotateX:Oo,rotateY:Oo,rotateZ:Oo,scaleX:To,scaleY:To,scale:To,opacity:ko,backgroundColor:ko,color:ko,default:To},Ro=new Set(["brightness","contrast","saturate","opacity"]);function Io(t){var e=t.slice(0,-1).split("("),n=e[0],i=e[1];if("drop-shadow"===n)return t;var o=(i.match(be)||[])[0];if(!o)return t;var r=i.replace(o,""),a=Ro.has(n)?1:0;return o!==i&&(a*=100),n+"("+a+r+")"}var Fo=/([a-z-]*)\(.*?\)/g,Bo=Object(Lt.a)(Object(Lt.a)({},bi),{getAnimatableNone:function(t){var e=t.match(Fo);return e?e.map(Io).join(" "):t}}),Wo=Object(Lt.a)(Object(Lt.a)({},Ie),{color:hi,backgroundColor:hi,outlineColor:hi,fill:hi,stroke:hi,borderColor:hi,borderTopColor:hi,borderRightColor:hi,borderBottomColor:hi,borderLeftColor:hi,filter:Bo,WebkitFilter:Bo}),Mo=function(t){return Wo[t]};function jo(t,e){var n,i=Mo(t);return i!==Bo&&(i=bi),null===(n=i.getAnimatableNone)||void 0===n?void 0:n.call(i,e)}function zo(t){var e=t.ease,n=t.times,i=t.yoyo,o=t.flip,r=t.loop,a=Object(Lt.d)(t,["ease","times","yoyo","flip","loop"]),s=Object(Lt.a)({},a);return n&&(s.offset=n),a.duration&&(s.duration=vo(a.duration)),a.repeatDelay&&(s.repeatDelay=vo(a.repeatDelay)),e&&(s.ease=function(t){return Array.isArray(t)&&"number"!=typeof t[0]}(e)?e.map(Lo):Lo(e)),"tween"===a.type&&(s.type="keyframes"),(i||r||o)&&(!0,i?s.repeatType="reverse":r?s.repeatType="loop":o&&(s.repeatType="mirror"),s.repeat=r||i||o||a.repeat),"spring"!==a.type&&(s.type="keyframes"),s}function No(t,e,n){var i,o,r,a;return Array.isArray(e.to)&&(null!==(i=t.duration)&&void 0!==i||(t.duration=.8)),function(t){Array.isArray(t.to)&&null===t.to[0]&&(t.to=Object(Lt.e)([],Object(Lt.c)(t.to)),t.to[0]=t.from)}(e),function(t){t.when,t.delay,t.delayChildren,t.staggerChildren,t.staggerDirection,t.repeat,t.repeatType,t.repeatDelay,t.from;var e=Object(Lt.d)(t,["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from"]);return!!Object.keys(e).length}(t)||(t=Object(Lt.a)(Object(Lt.a)({},t),(o=n,r=e.to,a=sn(r)?Do:Po[o]||Po.default,Object(Lt.a)({to:r},a(r))))),Object(Lt.a)(Object(Lt.a)({},e),zo(t))}function Vo(t,e,n,i,o){var r,a=Go(i,t),s=null!==(r=a.from)&&void 0!==r?r:e.get(),l=_o(t,n);"none"===s&&l&&"string"==typeof n?s=jo(t,n):Uo(s)&&"string"==typeof n?s=Ho(n):!Array.isArray(n)&&Uo(n)&&"string"==typeof s&&(n=Ho(s));var c=_o(t,s);return c&&l&&!1!==a.type?function(){var i={from:s,to:n,velocity:e.getVelocity(),onComplete:o,onUpdate:function(t){return e.set(t)}};return"inertia"===a.type||"decay"===a.type?function(t){var e,n=t.from,i=void 0===n?0:n,o=t.velocity,r=void 0===o?0:o,a=t.min,s=t.max,l=t.power,c=void 0===l?.8:l,u=t.timeConstant,d=void 0===u?750:u,h=t.bounceStiffness,p=void 0===h?500:h,f=t.bounceDamping,m=void 0===f?10:f,g=t.restDelta,v=void 0===g?1:g,A=t.modifyTarget,b=t.driver,y=t.onUpdate,C=t.onComplete;function S(t){return void 0!==a&&t<a||void 0!==s&&t>s}function w(t){return void 0===a?s:void 0===s||Math.abs(a-t)<Math.abs(s-t)?a:s}function x(t){null==e||e.stop(),e=mo(Object(Lt.a)(Object(Lt.a)({},t),{driver:b,onUpdate:function(e){var n;null==y||y(e),null===(n=t.onUpdate)||void 0===n||n.call(t,e)},onComplete:C}))}function E(t){x(Object(Lt.a)({type:"spring",stiffness:p,damping:m,restDelta:v},t))}if(S(i))E({from:i,velocity:r,to:w(i)});else{var L=c*r+i;"undefined"!=typeof A&&(L=A(L));var _,O,T=w(L),k=T===a?-1:1;x({type:"decay",from:i,velocity:r,timeConstant:d,power:c,restDelta:v,modifyTarget:A,onUpdate:S(L)?function(t){_=O,O=t,r=go(t-_,uo().delta),(1===k&&t>T||-1===k&&t<T)&&E({from:t,to:T,velocity:r})}:void 0})}return{stop:function(){return null==e?void 0:e.stop()}}}(Object(Lt.a)(Object(Lt.a)({},i),a)):mo(Object(Lt.a)(Object(Lt.a)({},No(a,i,t)),{onUpdate:function(t){var e;i.onUpdate(t),null===(e=a.onUpdate)||void 0===e||e.call(a,t)},onComplete:function(){var t;i.onComplete(),null===(t=a.onComplete)||void 0===t||t.call(a)}}))}:function(){var t;return e.set(n),o(),null===(t=null==a?void 0:a.onComplete)||void 0===t||t.call(a),{stop:function(){}}}}function Uo(t){return 0===t||"string"==typeof t&&0===parseFloat(t)&&-1===t.indexOf(" ")}function Ho(t){return"number"==typeof t?0:jo("",t)}function Go(t,e){return t[e]||t.default||t}function Qo(t,e,n,i){return void 0===i&&(i={}),e.start((function(o){var r,a,s=Vo(t,e,n,i,o),l=function(t,e){var n;return null!==(n=(Go(t,e)||{}).delay)&&void 0!==n?n:0}(i,t),c=function(){return a=s()};return l?r=setTimeout(c,vo(l)):c(),function(){clearTimeout(r),null==a||a.stop()}}))}function Zo(t,e){-1===t.indexOf(e)&&t.push(e)}function Yo(t,e){var n=t.indexOf(e);n>-1&&t.splice(n,1)}var qo=function(){function t(){this.subscriptions=[]}return t.prototype.add=function(t){var e=this;return Zo(this.subscriptions,t),function(){return Yo(e.subscriptions,t)}},t.prototype.notify=function(t,e,n){var i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](t,e,n);else for(var o=0;o<i;o++){var r=this.subscriptions[o];r&&r(t,e,n)}},t.prototype.getSize=function(){return this.subscriptions.length},t.prototype.clear=function(){this.subscriptions.length=0},t}(),Xo=function(){function t(t){var e,n=this;this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new qo,this.velocityUpdateSubscribers=new qo,this.renderSubscribers=new qo,this.canTrackVelocity=!1,this.updateAndNotify=function(t,e){void 0===e&&(e=!0),n.prev=n.current,n.current=t;var i=uo(),o=i.delta,r=i.timestamp;n.lastUpdated!==r&&(n.timeDelta=o,n.lastUpdated=r,ho.postRender(n.scheduleVelocityCheck)),n.prev!==n.current&&n.updateSubscribers.notify(n.current),n.velocityUpdateSubscribers.getSize()&&n.velocityUpdateSubscribers.notify(n.getVelocity()),e&&n.renderSubscribers.notify(n.current)},this.scheduleVelocityCheck=function(){return ho.postRender(n.velocityCheck)},this.velocityCheck=function(t){t.timestamp!==n.lastUpdated&&(n.prev=n.current,n.velocityUpdateSubscribers.notify(n.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e)))}return t.prototype.onChange=function(t){return this.updateSubscribers.add(t)},t.prototype.clearListeners=function(){this.updateSubscribers.clear()},t.prototype.onRenderRequest=function(t){return t(this.get()),this.renderSubscribers.add(t)},t.prototype.attach=function(t){this.passiveEffect=t},t.prototype.set=function(t,e){void 0===e&&(e=!0),e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)},t.prototype.get=function(){return this.current},t.prototype.getPrevious=function(){return this.prev},t.prototype.getVelocity=function(){return this.canTrackVelocity?go(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0},t.prototype.start=function(t){var e=this;return this.stop(),new Promise((function(n){e.hasAnimated=!0,e.stopAnimation=t(n)})).then((function(){return e.clearAnimation()}))},t.prototype.stop=function(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()},t.prototype.isAnimating=function(){return!!this.stopAnimation},t.prototype.clearAnimation=function(){this.stopAnimation=null},t.prototype.destroy=function(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()},t}();function $o(t){return new Xo(t)}var Ko=function(t){return function(e){return e.test(t)}},Jo=[ke,Le,Ee,xe,Oe,_e,{test:function(t){return"auto"===t},parse:function(t){return t}}],tr=function(t){return Jo.find(Ko(t))},er=Object(Lt.e)(Object(Lt.e)([],Object(Lt.c)(Jo)),[hi,bi]),nr=function(t){return er.find(Ko(t))};function ir(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,$o(n))}function or(t,e){var n=qt(t,e),i=n?t.makeTargetAnimatable(n,!1):{},o=i.transitionEnd,r=void 0===o?{}:o;i.transition;var a,s=Object(Lt.d)(i,["transitionEnd","transition"]);for(var l in s=Object(Lt.a)(Object(Lt.a)({},s),r)){ir(t,l,(a=s[l],sn(a)?a[a.length-1]||0:a))}}function rr(t,e){if(e)return(e[t]||e.default||e).from}function ar(t,e,n){var i;void 0===n&&(n={});var o=qt(t,e,n.custom),r=(o||{}).transition,a=void 0===r?t.getDefaultTransition()||{}:r;n.transitionOverride&&(a=n.transitionOverride);var s=o?function(){return sr(t,o,n)}:function(){return Promise.resolve()},l=(null===(i=t.variantChildren)||void 0===i?void 0:i.size)?function(i){void 0===i&&(i=0);var o=a.delayChildren,r=void 0===o?0:o,s=a.staggerChildren,l=a.staggerDirection;return function(t,e,n,i,o,r){void 0===n&&(n=0);void 0===i&&(i=0);void 0===o&&(o=1);var a=[],s=(t.variantChildren.size-1)*i,l=1===o?function(t){return void 0===t&&(t=0),t*i}:function(t){return void 0===t&&(t=0),s-t*i};return Array.from(t.variantChildren).sort(lr).forEach((function(t,i){a.push(ar(t,e,Object(Lt.a)(Object(Lt.a)({},r),{delay:n+l(i)})).then((function(){return t.notifyAnimationComplete(e)})))})),Promise.all(a)}(t,e,r+i,s,l,n)}:function(){return Promise.resolve()},c=a.when;if(c){var u=Object(Lt.c)("beforeChildren"===c?[s,l]:[l,s],2),d=u[0],h=u[1];return d().then(h)}return Promise.all([s(),l(n.delay)])}function sr(t,e,n){var i,o=void 0===n?{}:n,r=o.delay,a=void 0===r?0:r,s=o.transitionOverride,l=o.type,c=t.makeTargetAnimatable(e),u=c.transition,d=void 0===u?t.getDefaultTransition():u,h=c.transitionEnd,p=Object(Lt.d)(c,["transition","transitionEnd"]);s&&(d=s);var f=[],m=l&&(null===(i=t.animationState)||void 0===i?void 0:i.getState()[l]);for(var g in p){var v=t.getValue(g),A=p[g];if(!(!v||void 0===A||m&&cr(m,g))){var b=Qo(g,v,A,Object(Lt.a)({delay:a},d));f.push(b)}}return Promise.all(f).then((function(){h&&or(t,h)}))}function lr(t,e){return t.sortNodePosition(e)}function cr(t,e){var n=t.protectedKeys,i=t.needsAnimating,o=n.hasOwnProperty(e)&&!0!==i[e];return i[e]=!1,o}var ur=[pn.Animate,pn.Hover,pn.Tap,pn.Drag,pn.Focus,pn.Exit],dr=Object(Lt.e)([],Object(Lt.c)(ur)).reverse(),hr=ur.length;function pr(t){return function(e){return Promise.all(e.map((function(e){var n=e.animation,i=e.options;return function(t,e,n){var i;if(void 0===n&&(n={}),t.notifyAnimationStart(),Array.isArray(e)){var o=e.map((function(e){return ar(t,e,n)}));i=Promise.all(o)}else if("string"==typeof e)i=ar(t,e,n);else{var r="function"==typeof e?qt(t,e,n.custom):e;i=sr(t,r,n)}return i.then((function(){return t.notifyAnimationComplete(e)}))}(t,n,i)})))}}function fr(t){var e,n=pr(t),i=((e={})[pn.Animate]=mr(!0),e[pn.Hover]=mr(),e[pn.Tap]=mr(),e[pn.Drag]=mr(),e[pn.Focus]=mr(),e[pn.Exit]=mr(),e),o={},r=!0,a=function(e,n){var i=qt(t,n);if(i){i.transition;var o=i.transitionEnd,r=Object(Lt.d)(i,["transition","transitionEnd"]);e=Object(Lt.a)(Object(Lt.a)(Object(Lt.a)({},e),r),o)}return e};function s(e,s){for(var l,c=t.getProps(),u=t.getVariantContext(!0)||{},d=[],h=new Set,p={},f=1/0,m=function(n){var o=dr[n],m=i[o],g=null!==(l=c[o])&&void 0!==l?l:u[o],v=Zt(g),A=o===s?m.isActive:null;!1===A&&(f=n);var b=g===u[o]&&g!==c[o]&&v;if(b&&r&&t.manuallyAnimateOnMount&&(b=!1),m.protectedKeys=Object(Lt.a)({},p),!m.isActive&&null===A||!g&&!m.prevProp||an(g)||"boolean"==typeof g)return"continue";var y=function(t,e){if("string"==typeof e)return e!==t;if(Qt(e))return!Vn(e,t);return!1}(m.prevProp,g)||o===s&&m.isActive&&!b&&v||n>f&&v,C=Array.isArray(g)?g:[g],S=C.reduce(a,{});!1===A&&(S={});var w=m.prevResolvedValues,x=void 0===w?{}:w,E=Object(Lt.a)(Object(Lt.a)({},x),S),L=function(t){y=!0,h.delete(t),m.needsAnimating[t]=!0};for(var _ in E){var O=S[_],T=x[_];p.hasOwnProperty(_)||(O!==T?sn(O)&&sn(T)?Vn(O,T)?m.protectedKeys[_]=!0:L(_):void 0!==O?L(_):h.add(_):void 0!==O&&h.has(_)?L(_):m.protectedKeys[_]=!0)}m.prevProp=g,m.prevResolvedValues=S,m.isActive&&(p=Object(Lt.a)(Object(Lt.a)({},p),S)),r&&t.blockInitialAnimation&&(y=!1),y&&!b&&d.push.apply(d,Object(Lt.e)([],Object(Lt.c)(C.map((function(t){return{animation:t,options:Object(Lt.a)({type:o},e)}})))))},g=0;g<hr;g++)m(g);if(o=Object(Lt.a)({},p),h.size){var v={};h.forEach((function(e){var n=t.getBaseTarget(e);void 0!==n&&(v[e]=n)})),d.push({animation:v})}var A=Boolean(d.length);return r&&!1===c.initial&&!t.manuallyAnimateOnMount&&(A=!1),r=!1,A?n(d):Promise.resolve()}return{isAnimated:function(t){return void 0!==o[t]},animateChanges:s,setActive:function(e,n,o){var r;return i[e].isActive===n?Promise.resolve():(null===(r=t.variantChildren)||void 0===r||r.forEach((function(t){var i;return null===(i=t.animationState)||void 0===i?void 0:i.setActive(e,n)})),i[e].isActive=n,s(o,e))},setAnimateFunction:function(e){n=e(t)},getState:function(){return i}}}function mr(t){return void 0===t&&(t=!1),{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}var gr={animation:zn((function(t){var e=t.visualElement,n=t.animate;e.animationState||(e.animationState=fr(e)),an(n)&&Object(B.useEffect)((function(){return n.subscribe(e)}),[n])})),exit:zn((function(t){var e=t.custom,n=t.visualElement,i=Object(Lt.c)(Bt(),2),o=i[0],r=i[1],a=Object(B.useContext)(It);Object(B.useEffect)((function(){var t,i,s=null===(t=n.animationState)||void 0===t?void 0:t.setActive(pn.Exit,!o,{custom:null!==(i=null==a?void 0:a.custom)&&void 0!==i?i:e});!o&&(null==s||s.then(r))}),[o])}))},vr=function(t){return t.hasOwnProperty("x")&&t.hasOwnProperty("y")},Ar=function(t){return vr(t)&&t.hasOwnProperty("z")},br=function(t,e){return Math.abs(t-e)};function yr(t,e){if(yi(t)&&yi(e))return br(t,e);if(vr(t)&&vr(e)){var n=br(t.x,e.x),i=br(t.y,e.y),o=Ar(t)&&Ar(e)?br(t.z,e.z):0;return Math.sqrt(Math.pow(n,2)+Math.pow(i,2)+Math.pow(o,2))}}var Cr=function(){function t(t,e,n){var i=this,o=(void 0===n?{}:n).transformPagePoint;if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=function(){if(i.lastMoveEvent&&i.lastMoveEventInfo){var t=xr(i.lastMoveEventInfo,i.history),e=null!==i.startEvent,n=yr(t.offset,{x:0,y:0})>=3;if(e||n){var o=t.point,r=uo().timestamp;i.history.push(Object(Lt.a)(Object(Lt.a)({},o),{timestamp:r}));var a=i.handlers,s=a.onStart,l=a.onMove;e||(s&&s(i.lastMoveEvent,t),i.startEvent=i.lastMoveEvent),l&&l(i.lastMoveEvent,t)}}},this.handlePointerMove=function(t,e){i.lastMoveEvent=t,i.lastMoveEventInfo=Sr(e,i.transformPagePoint),An(t)&&0===t.buttons?i.handlePointerUp(t,e):ho.update(i.updatePoint,!0)},this.handlePointerUp=function(t,e){i.end();var n=i.handlers,o=n.onEnd,r=n.onSessionEnd,a=xr(Sr(e,i.transformPagePoint),i.history);i.startEvent&&o&&o(t,a),r&&r(t,a)},!(bn(t)&&t.touches.length>1)){this.handlers=e,this.transformPagePoint=o;var r=Sr(wn(t),this.transformPagePoint),a=r.point,s=uo().timestamp;this.history=[Object(Lt.a)(Object(Lt.a)({},a),{timestamp:s})];var l=e.onSessionStart;l&&l(t,xr(r,this.history)),this.removeListeners=jn(On(window,"pointermove",this.handlePointerMove),On(window,"pointerup",this.handlePointerUp),On(window,"pointercancel",this.handlePointerUp))}}return t.prototype.updateHandlers=function(t){this.handlers=t},t.prototype.end=function(){this.removeListeners&&this.removeListeners(),ro.update(this.updatePoint)},t}();function Sr(t,e){return e?{point:e(t.point)}:t}function wr(t,e){return{x:t.x-e.x,y:t.y-e.y}}function xr(t,e){var n=t.point;return{point:n,delta:wr(n,Lr(e)),offset:wr(n,Er(e)),velocity:_r(e,.1)}}function Er(t){return t[0]}function Lr(t){return t[t.length-1]}function _r(t,e){if(t.length<2)return{x:0,y:0};for(var n=t.length-1,i=null,o=Lr(t);n>=0&&(i=t[n],!(o.timestamp-i.timestamp>vo(e)));)n--;if(!i)return{x:0,y:0};var r=(o.timestamp-i.timestamp)/1e3;if(0===r)return{x:0,y:0};var a={x:(o.x-i.x)/r,y:(o.y-i.y)/r};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function Or(t){return t}function Tr(t){var e=t.top;return{x:{min:t.left,max:t.right},y:{min:e,max:t.bottom}}}var kr={translate:0,scale:1,origin:0,originPoint:0};function Dr(){return{x:Object(Lt.a)({},kr),y:Object(Lt.a)({},kr)}}function Pr(t){return[t("x"),t("y")]}function Rr(t,e,n){var i=e.min,o=e.max;return void 0!==i&&t<i?t=n?Jn(i,t,n.min):Math.max(t,i):void 0!==o&&t>o&&(t=n?Jn(o,t,n.max):Math.min(t,o)),t}function Ir(t,e,n){return{min:void 0!==e?t.min+e:void 0,max:void 0!==n?t.max+n-(t.max-t.min):void 0}}function Fr(t,e){var n,i=e.min-t.min,o=e.max-t.max;return e.max-e.min<t.max-t.min&&(i=(n=Object(Lt.c)([o,i],2))[0],o=n[1]),{min:t.min+i,max:t.min+o}}function Br(t,e,n){return{min:Wr(t,e),max:Wr(t,n)}}function Wr(t,e){var n;return"number"==typeof t?t:null!==(n=t[e])&&void 0!==n?n:0}function Mr(t,e){return Tr(function(t,e){var n=t.top,i=t.left,o=t.bottom,r=t.right;void 0===e&&(e=Or);var a=e({x:i,y:n}),s=e({x:r,y:o});return{top:a.y,left:a.x,bottom:s.y,right:s.x}}(t.getBoundingClientRect(),e))}function jr(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=.01),yr(t,e)<n}function zr(t){return t.max-t.min}function Nr(t,e){var n=.5,i=zr(t),o=zr(e);return o>i?n=Kn(e.min,e.max-i,t.min):i>o&&(n=Kn(t.min,t.max-o,e.min)),Un(0,1,n)}function Vr(t,e,n,i){void 0===i&&(i=.5),t.origin=i,t.originPoint=Jn(e.min,e.max,t.origin),t.scale=zr(n)/zr(e),jr(t.scale,1,1e-4)&&(t.scale=1),t.translate=Jn(n.min,n.max,t.origin)-t.originPoint,jr(t.translate)&&(t.translate=0)}function Ur(t,e,n,i){Vr(t.x,e.x,n.x,Hr(i.originX)),Vr(t.y,e.y,n.y,Hr(i.originY))}function Hr(t){return"number"==typeof t?t:.5}function Gr(t,e,n){t.min=n.min+e.min,t.max=t.min+zr(e)}var Qr=function(t,e){return t.depth-e.depth};function Zr(t){return t.projection.isEnabled||t.shouldResetTransform()}function Yr(t,e){void 0===e&&(e=[]);var n=t.parent;return n&&Yr(n,e),Zr(t)&&e.push(t),e}function qr(t){if(!t.shouldResetTransform()){var e,n=t.getLayoutState();t.notifyBeforeLayoutMeasure(n.layout),n.isHydrated=!0,n.layout=t.measureViewportBox(),n.layoutCorrected=(e=n.layout,{x:Object(Lt.a)({},e.x),y:Object(Lt.a)({},e.y)}),t.notifyLayoutMeasure(n.layout,t.prevViewportBox||n.layout),ho.update((function(){return t.rebaseProjectionTarget()}))}}function Xr(t,e){return{min:e.min-t.min,max:e.max-t.min}}function $r(t,e){return{x:Xr(t.x,e.x),y:Xr(t.y,e.y)}}function Kr(t,e){var n=t.getLayoutId(),i=e.getLayoutId();return n!==i||void 0===i&&t!==e}function Jr(t){var e=t.getProps(),n=e.drag,i=e._dragX;return n&&!i}function ta(t,e){t.min=e.min,t.max=e.max}function ea(t,e,n){return n+e*(t-n)}function na(t,e,n,i,o){return void 0!==o&&(t=ea(t,o,i)),ea(t,n,i)+e}function ia(t,e,n,i,o){void 0===e&&(e=0),void 0===n&&(n=1),t.min=na(t.min,e,n,i,o),t.max=na(t.max,e,n,i,o)}function oa(t,e){var n=e.x,i=e.y;ia(t.x,n.translate,n.scale,n.originPoint),ia(t.y,i.translate,i.scale,i.originPoint)}function ra(t,e,n,i){var o=Object(Lt.c)(i,3),r=o[0],a=o[1],s=o[2];t.min=e.min,t.max=e.max;var l=void 0!==n[s]?n[s]:.5,c=Jn(e.min,e.max,l);ia(t,n[r],n[a],c,n.scale)}var aa=["x","scaleX","originX"],sa=["y","scaleY","originY"];function la(t,e,n){ra(t.x,e.x,n,aa),ra(t.y,e.y,n,sa)}function ca(t,e,n,i,o){return t=ea(t-=e,1/n,i),void 0!==o&&(t=ea(t,1/o,i)),t}function ua(t,e,n){var i=Object(Lt.c)(n,3),o=i[0],r=i[1],a=i[2];!function(t,e,n,i,o){void 0===e&&(e=0),void 0===n&&(n=1),void 0===i&&(i=.5);var r=Jn(t.min,t.max,i)-e;t.min=ca(t.min,e,n,r,o),t.max=ca(t.max,e,n,r,o)}(t,e[o],e[r],e[a],e.scale)}function da(t,e){ua(t.x,e,aa),ua(t.y,e,sa)}var ha=new Set;function pa(t,e,n){t[n]||(t[n]=[]),t[n].push(e)}function fa(t){return ha.add(t),function(){return ha.delete(t)}}function ma(){if(ha.size){var t=0,e=[[]],n=[],i=function(n){return pa(e,n,t)},o=function(e){pa(n,e,t),t++};ha.forEach((function(e){e(i,o),t=0})),ha.clear();for(var r=n.length,a=0;a<=r;a++)e[a]&&e[a].forEach(va),n[a]&&n[a].forEach(va)}}var ga,va=function(t){return t()},Aa=new WeakMap,ba=function(){function t(t){var e=t.visualElement;this.isDragging=!1,this.currentDirection=null,this.constraints=!1,this.elastic={x:{min:0,max:1},y:{min:0,max:1}},this.props={},this.hasMutatedConstraints=!1,this.cursorProgress={x:.5,y:.5},this.originPoint={},this.openGlobalLock=null,this.panSession=null,this.visualElement=e,this.visualElement.enableLayoutProjection(),Aa.set(e,this)}return t.prototype.start=function(t,e){var n=this,i=void 0===e?{}:e,o=i.snapToCursor,r=void 0!==o&&o,a=i.cursorProgress,s=this.props.transformPagePoint;this.panSession=new Cr(t,{onSessionStart:function(t){var e;n.stopMotion();var i=function(t){return wn(t,"client")}(t).point;null===(e=n.cancelLayout)||void 0===e||e.call(n),n.cancelLayout=fa((function(t,e){var o=Yr(n.visualElement),s=function(t){var e=[],n=function(t){Zr(t)&&e.push(t),t.children.forEach(n)};return t.children.forEach(n),e.sort(Qr)}(n.visualElement),l=Object(Lt.e)(Object(Lt.e)([],Object(Lt.c)(o)),Object(Lt.c)(s)),c=!1;n.isLayoutDrag()&&n.visualElement.lockProjectionTarget(),e((function(){l.forEach((function(t){return t.resetTransform()}))})),t((function(){qr(n.visualElement),s.forEach(qr)})),e((function(){l.forEach((function(t){return t.restoreTransform()})),r&&(c=n.snapToCursor(i))})),t((function(){Boolean(n.getAxisMotionValue("x")&&!n.isExternalDrag())||n.visualElement.rebaseProjectionTarget(!0,n.visualElement.measureViewportBox(!1)),n.visualElement.scheduleUpdateLayoutProjection();var t=n.visualElement.projection;Pr((function(e){if(!c){var o=t.target[e],r=o.min,s=o.max;n.cursorProgress[e]=a?a[e]:Kn(r,s,i[e])}var l=n.getAxisMotionValue(e);l&&(n.originPoint[e]=l.get())}))})),e((function(){ao.update(),ao.preRender(),ao.render(),ao.postRender()})),t((function(){return n.resolveDragConstraints()}))}))},onStart:function(t,e){var i,o,r,a=n.props,s=a.drag,l=a.dragPropagation;(!s||l||(n.openGlobalLock&&n.openGlobalLock(),n.openGlobalLock=Rn(s),n.openGlobalLock))&&(ma(),n.isDragging=!0,n.currentDirection=null,null===(o=(i=n.props).onDragStart)||void 0===o||o.call(i,t,e),null===(r=n.visualElement.animationState)||void 0===r||r.setActive(pn.Drag,!0))},onMove:function(t,e){var i,o,r,a,s=n.props,l=s.dragPropagation,c=s.dragDirectionLock;if(l||n.openGlobalLock){var u=e.offset;if(c&&null===n.currentDirection)return n.currentDirection=function(t,e){void 0===e&&(e=10);var n=null;Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x");return n}(u),void(null!==n.currentDirection&&(null===(o=(i=n.props).onDirectionLock)||void 0===o||o.call(i,n.currentDirection)));n.updateAxis("x",e.point,u),n.updateAxis("y",e.point,u),null===(a=(r=n.props).onDrag)||void 0===a||a.call(r,t,e),ga=t}},onSessionEnd:function(t,e){return n.stop(t,e)}},{transformPagePoint:s})},t.prototype.resolveDragConstraints=function(){var t=this,e=this.props,n=e.dragConstraints,i=e.dragElastic,o=this.visualElement.getLayoutState().layoutCorrected;this.constraints=!!n&&(Gt(n)?this.resolveRefConstraints(o,n):function(t,e){var n=e.top,i=e.left,o=e.bottom,r=e.right;return{x:Ir(t.x,i,r),y:Ir(t.y,n,o)}}(o,n)),this.elastic=function(t){return!1===t?t=0:!0===t&&(t=.35),{x:Br(t,"left","right"),y:Br(t,"top","bottom")}}(i),this.constraints&&!this.hasMutatedConstraints&&Pr((function(e){t.getAxisMotionValue(e)&&(t.constraints[e]=function(t,e){var n={};return void 0!==e.min&&(n.min=e.min-t.min),void 0!==e.max&&(n.max=e.max-t.min),n}(o[e],t.constraints[e]))}))},t.prototype.resolveRefConstraints=function(t,e){var n=this.props,i=n.onMeasureDragConstraints,o=n.transformPagePoint,r=e.current;this.constraintsBox=Mr(r,o);var a=function(t,e){return{x:Fr(t.x,e.x),y:Fr(t.y,e.y)}}(t,this.constraintsBox);if(i){var s=i(function(t){var e=t.x,n=t.y;return{top:n.min,bottom:n.max,left:e.min,right:e.max}}(a));this.hasMutatedConstraints=!!s,s&&(a=Tr(s))}return a},t.prototype.cancelDrag=function(){var t,e;this.visualElement.unlockProjectionTarget(),null===(t=this.cancelLayout)||void 0===t||t.call(this),this.isDragging=!1,this.panSession&&this.panSession.end(),this.panSession=null,!this.props.dragPropagation&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),null===(e=this.visualElement.animationState)||void 0===e||e.setActive(pn.Drag,!1)},t.prototype.stop=function(t,e){var n,i,o;null===(n=this.panSession)||void 0===n||n.end(),this.panSession=null;var r=this.isDragging;if(this.cancelDrag(),r){var a=e.velocity;this.animateDragEnd(a),null===(o=(i=this.props).onDragEnd)||void 0===o||o.call(i,t,e)}},t.prototype.snapToCursor=function(t){var e=this;return Pr((function(n){if(ya(n,e.props.drag,e.currentDirection)){var i=e.getAxisMotionValue(n);if(!i)return e.cursorProgress[n]=.5,!0;var o=e.visualElement.getLayoutState().layout,r=o[n].max-o[n].min,a=o[n].min+r/2,s=t[n]-a;e.originPoint[n]=t[n],i.set(s)}})).includes(!0)},t.prototype.updateAxis=function(t,e,n){if(ya(t,this.props.drag,this.currentDirection))return this.getAxisMotionValue(t)?this.updateAxisMotionValue(t,n):this.updateVisualElementAxis(t,e)},t.prototype.updateAxisMotionValue=function(t,e){var n=this.getAxisMotionValue(t);if(e&&n){var i=this.originPoint[t]+e[t],o=this.constraints?Rr(i,this.constraints[t],this.elastic[t]):i;n.set(o)}},t.prototype.updateVisualElementAxis=function(t,e){var n,i=this.visualElement.getLayoutState().layout[t],o=i.max-i.min,r=this.cursorProgress[t],a=function(t,e,n,i,o){var r=t-e*n;return i?Rr(r,i,o):r}(e[t],o,r,null===(n=this.constraints)||void 0===n?void 0:n[t],this.elastic[t]);this.visualElement.setProjectionTargetAxis(t,a,a+o)},t.prototype.setProps=function(t){var e=t.drag,n=void 0!==e&&e,i=t.dragDirectionLock,o=void 0!==i&&i,r=t.dragPropagation,a=void 0!==r&&r,s=t.dragConstraints,l=void 0!==s&&s,c=t.dragElastic,u=void 0===c?.35:c,d=t.dragMomentum,h=void 0===d||d,p=Object(Lt.d)(t,["drag","dragDirectionLock","dragPropagation","dragConstraints","dragElastic","dragMomentum"]);this.props=Object(Lt.a)({drag:n,dragDirectionLock:o,dragPropagation:a,dragConstraints:l,dragElastic:u,dragMomentum:h},p)},t.prototype.getAxisMotionValue=function(t){var e=this.props,n=e.layout,i=e.layoutId,o="_drag"+t.toUpperCase();return this.props[o]?this.props[o]:n||void 0!==i?void 0:this.visualElement.getValue(t,0)},t.prototype.isLayoutDrag=function(){return!this.getAxisMotionValue("x")},t.prototype.isExternalDrag=function(){var t=this.props,e=t._dragX,n=t._dragY;return e||n},t.prototype.animateDragEnd=function(t){var e=this,n=this.props,i=n.drag,o=n.dragMomentum,r=n.dragElastic,a=n.dragTransition,s=function(t,e){void 0===e&&(e=!0);var n,i=t.getProjectionParent();return!!i&&(e?da(n=$r(i.projection.target,t.projection.target),i.getLatestValues()):n=$r(i.getLayoutState().layout,t.getLayoutState().layout),Pr((function(e){return t.setProjectionTargetAxis(e,n[e].min,n[e].max,!0)})),!0)}(this.visualElement,this.isLayoutDrag()&&!this.isExternalDrag()),l=this.constraints||{};if(s&&Object.keys(l).length&&this.isLayoutDrag()){var c=this.visualElement.getProjectionParent();if(c){var u=$r(c.projection.targetFinal,l);Pr((function(t){var e=u[t],n=e.min,i=e.max;l[t]={min:isNaN(n)?void 0:n,max:isNaN(i)?void 0:i}}))}}var d=Pr((function(n){var c;if(ya(n,i,e.currentDirection)){var u=null!==(c=null==l?void 0:l[n])&&void 0!==c?c:{},d=r?200:1e6,h=r?40:1e7,p=Object(Lt.a)(Object(Lt.a)({type:"inertia",velocity:o?t[n]:0,bounceStiffness:d,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10},a),u);return e.getAxisMotionValue(n)?e.startAxisValueAnimation(n,p):e.visualElement.startLayoutAnimation(n,p,s)}}));return Promise.all(d).then((function(){var t,n;null===(n=(t=e.props).onDragTransitionEnd)||void 0===n||n.call(t)}))},t.prototype.stopMotion=function(){var t=this;Pr((function(e){var n=t.getAxisMotionValue(e);n?n.stop():t.visualElement.stopLayoutAnimation()}))},t.prototype.startAxisValueAnimation=function(t,e){var n=this.getAxisMotionValue(t);if(n){var i=n.get();return n.set(i),n.set(i),Qo(t,n,0,e)}},t.prototype.scalePoint=function(){var t=this,e=this.props,n=e.drag;if(Gt(e.dragConstraints)&&this.constraintsBox){this.stopMotion();var i={x:0,y:0};Pr((function(e){i[e]=Nr(t.visualElement.projection.target[e],t.constraintsBox[e])})),this.updateConstraints((function(){Pr((function(e){if(ya(e,n,null)){var o=function(t,e,n){var i=t.max-t.min,o=Jn(e.min,e.max-i,n);return{min:o,max:o+i}}(t.visualElement.projection.target[e],t.constraintsBox[e],i[e]),r=o.min,a=o.max;t.visualElement.setProjectionTargetAxis(e,r,a)}}))})),setTimeout(ma,1)}},t.prototype.updateConstraints=function(t){var e=this;this.cancelLayout=fa((function(n,i){var o=Yr(e.visualElement);i((function(){return o.forEach((function(t){return t.resetTransform()}))})),n((function(){return qr(e.visualElement)})),i((function(){return o.forEach((function(t){return t.restoreTransform()}))})),n((function(){e.resolveDragConstraints()})),t&&i(t)}))},t.prototype.mount=function(t){var e=this,n=On(t.getInstance(),"pointerdown",(function(t){var n=e.props,i=n.drag,o=n.dragListener;i&&(void 0===o||o)&&e.start(t)})),i=gn(window,"resize",(function(){e.scalePoint()})),o=t.onLayoutUpdate((function(){e.isDragging&&e.resolveDragConstraints()})),r=t.prevDragCursor;return r&&this.start(ga,{cursorProgress:r}),function(){null==n||n(),null==i||i(),null==o||o(),e.cancelDrag()}},t}();function ya(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}var Ca,Sa,wa={pan:zn((function(t){var e=t.onPan,n=t.onPanStart,i=t.onPanEnd,o=t.onPanSessionStart,r=t.visualElement,a=e||n||i||o,s=Object(B.useRef)(null),l=Object(B.useContext)(Pt).transformPagePoint,c={onSessionStart:o,onStart:n,onMove:e,onEnd:function(t,e){s.current=null,i&&i(t,e)}};Object(B.useEffect)((function(){null!==s.current&&s.current.updateHandlers(c)})),Tn(r,"pointerdown",a&&function(t){s.current=new Cr(t,c,{transformPagePoint:l})}),Wn((function(){return s.current&&s.current.end()}))})),drag:zn((function(t){var e=t.dragControls,n=t.visualElement,i=Object(B.useContext)(Pt).transformPagePoint,o=Ft((function(){return new ba({visualElement:n})}));o.setProps(Object(Lt.a)(Object(Lt.a)({},t),{transformPagePoint:i})),Object(B.useEffect)((function(){return e&&e.subscribe(o)}),[o]),Object(B.useEffect)((function(){return o.mount(n)}),[])}))};function xa(t){return"string"==typeof t&&t.startsWith("var(--")}!function(t){t[t.Entering=0]="Entering",t[t.Present=1]="Present",t[t.Exiting=2]="Exiting"}(Ca||(Ca={})),function(t){t[t.Hide=0]="Hide",t[t.Show=1]="Show"}(Sa||(Sa={}));var Ea=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function La(t,e,n){void 0===n&&(n=1);var i=Object(Lt.c)(function(t){var e=Ea.exec(t);if(!e)return[,];var n=Object(Lt.c)(e,3);return[n[1],n[2]]}(t),2),o=i[0],r=i[1];if(o){var a=window.getComputedStyle(e).getPropertyValue(o);return a?a.trim():xa(r)?La(r,e,n+1):r}}function _a(t,e){return t/(e.max-e.min)*100}var Oa="_$css";var Ta={process:function(t,e,n){var i=n.target;if("string"==typeof t){if(!Le.test(t))return t;t=parseFloat(t)}return _a(t,i.x)+"% "+_a(t,i.y)+"%"}},ka={borderRadius:Object(Lt.a)(Object(Lt.a)({},Ta),{applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]}),borderTopLeftRadius:Ta,borderTopRightRadius:Ta,borderBottomLeftRadius:Ta,borderBottomRightRadius:Ta,boxShadow:{process:function(t,e){var n=e.delta,i=e.treeScale,o=t,r=t.includes("var("),a=[];r&&(t=t.replace(Ea,(function(t){return a.push(t),Oa})));var s=bi.parse(t);if(s.length>5)return o;var l=bi.createTransformer(t),c="number"!=typeof s[0]?1:0,u=n.x.scale*i.x,d=n.y.scale*i.y;s[0+c]/=u,s[1+c]/=d;var h=Jn(u,d,.5);"number"==typeof s[2+c]&&(s[2+c]/=h),"number"==typeof s[3+c]&&(s[3+c]/=h);var p=l(s);if(r){var f=0;p=p.replace(Oa,(function(){var t=a[f];return f++,t}))}return p}}},Da=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.frameTarget={x:{min:0,max:1},y:{min:0,max:1}},e.currentAnimationTarget={x:{min:0,max:1},y:{min:0,max:1}},e.isAnimating={x:!1,y:!1},e.stopAxisAnimation={x:void 0,y:void 0},e.isAnimatingTree=!1,e.animate=function(t,n,i){void 0===i&&(i={});var o=i.originBox,r=i.targetBox,a=i.visibilityAction,s=i.shouldStackAnimate,l=i.onComplete,c=i.prevParent,u=Object(Lt.d)(i,["originBox","targetBox","visibilityAction","shouldStackAnimate","onComplete","prevParent"]),d=e.props,h=d.visualElement,p=d.layout;if(!1===s)return e.isAnimatingTree=!1,e.safeToRemove();if(!e.isAnimatingTree||!0===s){s&&(e.isAnimatingTree=!0),n=o||n,t=r||t;var f=!1,m=h.getProjectionParent();if(m){var g=m.prevViewportBox,v=m.getLayoutState().layout;c&&(r&&(v=c.getLayoutState().layout),o&&!Kr(c,m)&&c.prevViewportBox&&(g=c.prevViewportBox)),g&&Wa(c,o,r)&&(f=!0,n=$r(g,n),t=$r(v,t))}var A=Pa(n,t),b=Pr((function(i){var o,r;if("position"===p){var s=t[i].max-t[i].min;n[i].max=n[i].min+s}if(!h.projection.isTargetLocked)return void 0===a?A?e.animateAxis(i,t[i],n[i],Object(Lt.a)(Object(Lt.a)({},u),{isRelative:f})):(null===(r=(o=e.stopAxisAnimation)[i])||void 0===r||r.call(o),h.setProjectionTargetAxis(i,t[i].min,t[i].max,f)):void h.setVisibility(a===Sa.Show)}));return h.syncRender(),Promise.all(b).then((function(){e.isAnimatingTree=!1,l&&l(),h.notifyLayoutAnimationComplete()}))}},e}return Object(Lt.b)(e,t),e.prototype.componentDidMount=function(){var t=this,e=this.props.visualElement;e.animateMotionValue=Qo,e.enableLayoutProjection(),this.unsubLayoutReady=e.onLayoutUpdate(this.animate),e.layoutSafeToRemove=function(){return t.safeToRemove()},function(t){for(var e in t)oe[e]=t[e]}(ka)},e.prototype.componentWillUnmount=function(){var t=this;this.unsubLayoutReady(),Pr((function(e){var n,i;return null===(i=(n=t.stopAxisAnimation)[e])||void 0===i?void 0:i.call(n)}))},e.prototype.animateAxis=function(t,e,n,i){var o,r,a=this,s=void 0===i?{}:i,l=s.transition,c=s.isRelative;if(!this.isAnimating[t]||!Fa(e,this.currentAnimationTarget[t])){null===(r=(o=this.stopAxisAnimation)[t])||void 0===r||r.call(o),this.isAnimating[t]=!0;var u=this.props.visualElement,d=this.frameTarget[t],h=u.getProjectionAnimationProgress()[t];h.clearListeners(),h.set(0),h.set(0);var p=function(){var i=h.get()/1e3;!function(t,e,n,i){t.min=Jn(e.min,n.min,i),t.max=Jn(e.max,n.max,i)}(d,n,e,i),u.setProjectionTargetAxis(t,d.min,d.max,c)};p();var f=h.onChange(p);this.stopAxisAnimation[t]=function(){a.isAnimating[t]=!1,h.stop(),f()},this.currentAnimationTarget[t]=e;var m=l||u.getDefaultTransition()||Ba;return Qo("x"===t?"layoutX":"layoutY",h,1e3,m&&Go(m,"layout")).then(this.stopAxisAnimation[t])}},e.prototype.safeToRemove=function(){var t,e;null===(e=(t=this.props).safeToRemove)||void 0===e||e.call(t)},e.prototype.render=function(){return null},e}(B.Component);function Pa(t,e){return!(Ia(t)||Ia(e)||Fa(t.x,e.x)&&Fa(t.y,e.y))}var Ra={min:0,max:0};function Ia(t){return Fa(t.x,Ra)&&Fa(t.y,Ra)}function Fa(t,e){return t.min===e.min&&t.max===e.max}var Ba={duration:.45,ease:[.4,0,.1,1]};function Wa(t,e,n){return t||!t&&!(e||n)}var Ma={layoutReady:function(t){return t.notifyLayoutReady()}};function ja(){var t=new Set;return{add:function(e){return t.add(e)},flush:function(e){var n=void 0===e?Ma:e,i=n.layoutReady,o=n.parent;fa((function(e,n){var r=Array.from(t).sort(Qr),a=o?Yr(o):[];n((function(){Object(Lt.e)(Object(Lt.e)([],Object(Lt.c)(a)),Object(Lt.c)(r)).forEach((function(t){return t.resetTransform()}))})),e((function(){r.forEach(qr)})),n((function(){a.forEach((function(t){return t.restoreTransform()})),r.forEach(i)})),e((function(){r.forEach((function(t){t.isPresent&&(t.presence=Ca.Present)}))})),n((function(){ao.preRender(),ao.render()})),e((function(){ho.postRender((function(){return r.forEach(za)})),t.clear()}))})),ma()}}}function za(t){t.prevViewportBox=t.projection.target}var Na=Object(B.createContext)(ja()),Va=Object(B.createContext)(ja());function Ua(t){return!!t.forceUpdate}var Ha=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(Lt.b)(e,t),e.prototype.componentDidMount=function(){var t=this.props,e=t.syncLayout,n=t.framerSyncLayout,i=t.visualElement;Ua(e)&&e.register(i),Ua(n)&&n.register(i),i.onUnmount((function(){Ua(e)&&e.remove(i),Ua(n)&&n.remove(i)}))},e.prototype.getSnapshotBeforeUpdate=function(){var t=this.props,e=t.syncLayout,n=t.visualElement;return Ua(e)?e.syncUpdate():(!function(t){t.shouldResetTransform()||(t.prevViewportBox=t.measureViewportBox(!1),t.rebaseProjectionTarget(!1,t.prevViewportBox))}(n),e.add(n)),null},e.prototype.componentDidUpdate=function(){var t=this.props.syncLayout;Ua(t)||t.flush()},e.prototype.render=function(){return null},e}(B.default.Component);var Ga={measureLayout:function(t){var e=Object(B.useContext)(Na),n=Object(B.useContext)(Va);return B.default.createElement(Ha,Object(Lt.a)({},t,{syncLayout:e,framerSyncLayout:n}))},layoutAnimation:function(t){var e=Object(Lt.c)(Bt(),2)[1];return B.createElement(Da,Object(Lt.a)({},t,{safeToRemove:e}))}};function Qa(){return{isHydrated:!1,layout:{x:{min:0,max:1},y:{min:0,max:1}},layoutCorrected:{x:{min:0,max:1},y:{min:0,max:1}},treeScale:{x:1,y:1},delta:Dr(),deltaFinal:Dr(),deltaTransform:""}}var Za=Qa();function Ya(t,e,n){var i=t.x,o=t.y,r="translate3d("+i.translate/e.x+"px, "+o.translate/e.y+"px, 0) ";if(n){var a=n.rotate,s=n.rotateX,l=n.rotateY;a&&(r+="rotate("+a+") "),s&&(r+="rotateX("+s+") "),l&&(r+="rotateY("+l+") ")}return r+="scale("+i.scale+", "+o.scale+")",n||r!==Xa?r:""}function qa(t){var e=t.deltaFinal;return 100*e.x.origin+"% "+100*e.y.origin+"% 0"}var Xa=Ya(Za.delta,Za.treeScale,{x:1,y:1}),$a=["LayoutMeasure","BeforeLayoutMeasure","LayoutUpdate","ViewportBoxUpdate","Update","Render","AnimationComplete","LayoutAnimationComplete","AnimationStart","SetAxisTarget","Unmount"];function Ka(t,e,n,i){var o,r,a=t.delta,s=t.layout,l=t.layoutCorrected,c=t.treeScale,u=e.target;r=s,ta((o=l).x,r.x),ta(o.y,r.y),function(t,e,n){var i=n.length;if(i){var o,r;e.x=e.y=1;for(var a=0;a<i;a++)r=(o=n[a]).getLayoutState().delta,e.x*=r.x.scale,e.y*=r.y.scale,oa(t,r),Jr(o)&&la(t,t,o.getLatestValues())}}(l,c,n),Ur(a,l,u,i)}var Ja=function(){function t(){this.children=[],this.isDirty=!1}return t.prototype.add=function(t){Zo(this.children,t),this.isDirty=!0},t.prototype.remove=function(t){Yo(this.children,t),this.isDirty=!0},t.prototype.forEach=function(t){this.isDirty&&this.children.sort(Qr),this.isDirty=!1,this.children.forEach(t)},t}();var ts=function(t){var e=t.treeType,n=void 0===e?"":e,i=t.build,o=t.getBaseTarget,r=t.makeTargetAnimatable,a=t.measureViewportBox,s=t.render,l=t.readValueFromInstance,c=t.resetTransform,u=t.restoreTransform,d=t.removeValueFromRenderState,h=t.sortNodePosition,p=t.scrapeMotionValuesFromProps;return function(t,e){var f=t.parent,m=t.props,g=t.presenceId,v=t.blockInitialAnimation,A=t.visualState;void 0===e&&(e={});var b,y,C,S,w,x,E=A.latestValues,L=A.renderState,_=function(){var t=$a.map((function(){return new qo})),e={},n={clearAllListeners:function(){return t.forEach((function(t){return t.clear()}))},updatePropListeners:function(t){return $a.forEach((function(i){var o;null===(o=e[i])||void 0===o||o.call(e);var r="on"+i,a=t[r];a&&(e[i]=n[r](a))}))}};return t.forEach((function(t,e){n["on"+$a[e]]=function(e){return t.add(e)},n["notify"+$a[e]]=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.notify.apply(t,Object(Lt.e)([],Object(Lt.c)(e)))}})),n}(),O={isEnabled:!1,isHydrated:!1,isTargetLocked:!1,target:{x:{min:0,max:1},y:{min:0,max:1}},targetFinal:{x:{min:0,max:1},y:{min:0,max:1}}},T=O,k=E,D=Qa(),P=!1,R=new Map,I=new Map,F={},B=Object(Lt.a)({},E);function W(){b&&(Q.isProjectionReady()&&(la(T.targetFinal,T.target,k),Ur(D.deltaFinal,D.layoutCorrected,T.targetFinal,E)),M(),s(b,L))}function M(){var t=E;if(S&&S.isActive()){var n=S.getCrossfadeState(Q);n&&(t=n)}i(Q,L,t,T,D,e,m)}function j(){_.notifyUpdate(E)}function z(){Q.layoutTree.forEach(ns)}var N=p(m);for(var V in N){var U=N[V];void 0!==E[V]&&pe(U)&&U.set(E[V],!1)}var H=Xt(m),G=$t(m),Q=Object(Lt.a)(Object(Lt.a)({treeType:n,current:null,depth:f?f.depth+1:0,parent:f,children:new Set,path:f?Object(Lt.e)(Object(Lt.e)([],Object(Lt.c)(f.path)),[f]):[],layoutTree:f?f.layoutTree:new Ja,presenceId:g,projection:O,variantChildren:G?new Set:void 0,isVisible:void 0,manuallyAnimateOnMount:Boolean(null==f?void 0:f.isMounted()),blockInitialAnimation:v,isMounted:function(){return Boolean(b)},mount:function(t){b=Q.current=t,Q.pointTo(Q),G&&f&&!H&&(x=null==f?void 0:f.addVariantChild(Q)),null==f||f.children.add(Q)},unmount:function(){ro.update(j),ro.render(W),ro.preRender(Q.updateLayoutProjection),I.forEach((function(t){return t()})),Q.stopLayoutAnimation(),Q.layoutTree.remove(Q),null==x||x(),null==f||f.children.delete(Q),null==C||C(),_.clearAllListeners()},addVariantChild:function(t){var e,n=Q.getClosestVariantNode();if(n)return null===(e=n.variantChildren)||void 0===e||e.add(t),function(){return n.variantChildren.delete(t)}},sortNodePosition:function(t){return h&&n===t.treeType?h(Q.getInstance(),t.getInstance()):0},getClosestVariantNode:function(){return G?Q:null==f?void 0:f.getClosestVariantNode()},scheduleUpdateLayoutProjection:f?f.scheduleUpdateLayoutProjection:function(){return ho.preRender(Q.updateTreeLayoutProjection,!1,!0)},getLayoutId:function(){return m.layoutId},getInstance:function(){return b},getStaticValue:function(t){return E[t]},setStaticValue:function(t,e){return E[t]=e},getLatestValues:function(){return E},setVisibility:function(t){Q.isVisible!==t&&(Q.isVisible=t,Q.scheduleRender())},makeTargetAnimatable:function(t,e){return void 0===e&&(e=!0),r(Q,t,m,e)},addValue:function(t,e){Q.hasValue(t)&&Q.removeValue(t),R.set(t,e),E[t]=e.get(),function(t,e){var n=e.onChange((function(e){E[t]=e,m.onUpdate&&ho.update(j,!1,!0)})),i=e.onRenderRequest(Q.scheduleRender);I.set(t,(function(){n(),i()}))}(t,e)},removeValue:function(t){var e;R.delete(t),null===(e=I.get(t))||void 0===e||e(),I.delete(t),delete E[t],d(t,L)},hasValue:function(t){return R.has(t)},getValue:function(t,e){var n=R.get(t);return void 0===n&&void 0!==e&&(n=$o(e),Q.addValue(t,n)),n},forEachValue:function(t){return R.forEach(t)},readValue:function(t){var n;return null!==(n=E[t])&&void 0!==n?n:l(b,t,e)},setBaseTarget:function(t,e){B[t]=e},getBaseTarget:function(t){if(o){var e=o(m,t);if(void 0!==e&&!pe(e))return e}return B[t]}},_),{build:function(){return M(),L},scheduleRender:function(){ho.render(W,!1,!0)},syncRender:W,setProps:function(t){m=t,_.updatePropListeners(t),F=function(t,e,n){var i;for(var o in e){var r=e[o],a=n[o];if(pe(r))t.addValue(o,r);else if(pe(a))t.addValue(o,$o(r));else if(a!==r)if(t.hasValue(o)){var s=t.getValue(o);!s.hasAnimated&&s.set(r)}else t.addValue(o,$o(null!==(i=t.getStaticValue(o))&&void 0!==i?i:r))}for(var o in n)void 0===e[o]&&t.removeValue(o);return e}(Q,p(m),F)},getProps:function(){return m},getVariant:function(t){var e;return null===(e=m.variants)||void 0===e?void 0:e[t]},getDefaultTransition:function(){return m.transition},getVariantContext:function(t){if(void 0===t&&(t=!1),t)return null==f?void 0:f.getVariantContext();if(!H){var e=(null==f?void 0:f.getVariantContext())||{};return void 0!==m.initial&&(e.initial=m.initial),e}for(var n={},i=0;i<rs;i++){var o=os[i],r=m[o];(Zt(r)||!1===r)&&(n[o]=r)}return n},enableLayoutProjection:function(){O.isEnabled=!0,Q.layoutTree.add(Q)},lockProjectionTarget:function(){O.isTargetLocked=!0},unlockProjectionTarget:function(){Q.stopLayoutAnimation(),O.isTargetLocked=!1},getLayoutState:function(){return D},setCrossfader:function(t){S=t},isProjectionReady:function(){return O.isEnabled&&O.isHydrated&&D.isHydrated},startLayoutAnimation:function(t,e,n){void 0===n&&(n=!1);var i=Q.getProjectionAnimationProgress()[t],o=n?O.relativeTarget[t]:O.target[t],r=o.min,a=o.max-r;return i.clearListeners(),i.set(r),i.set(r),i.onChange((function(e){Q.setProjectionTargetAxis(t,e,e+a,n)})),Q.animateMotionValue(t,i,0,e)},stopLayoutAnimation:function(){Pr((function(t){return Q.getProjectionAnimationProgress()[t].stop()}))},measureViewportBox:function(t){void 0===t&&(t=!0);var n=a(b,e);return t||da(n,E),n},getProjectionAnimationProgress:function(){return w||(w={x:$o(0),y:$o(0)}),w},setProjectionTargetAxis:function(t,e,n,i){var o;void 0===i&&(i=!1),i?(O.relativeTarget||(O.relativeTarget={x:{min:0,max:1},y:{min:0,max:1}}),o=O.relativeTarget[t]):(O.relativeTarget=void 0,o=O.target[t]),O.isHydrated=!0,o.min=e,o.max=n,P=!0,_.notifySetAxisTarget()},rebaseProjectionTarget:function(t,e){void 0===e&&(e=D.layout);var n=Q.getProjectionAnimationProgress(),i=n.x,o=n.y,r=!(O.relativeTarget||O.isTargetLocked||i.isAnimating()||o.isAnimating());(t||r)&&Pr((function(t){var n=e[t],i=n.min,o=n.max;Q.setProjectionTargetAxis(t,i,o)}))},notifyLayoutReady:function(t){!function(t){var e=t.getProjectionParent();if(e){var n=$r(e.getLayoutState().layout,t.getLayoutState().layout);Pr((function(e){t.setProjectionTargetAxis(e,n[e].min,n[e].max,!0)}))}else t.rebaseProjectionTarget()}(Q),Q.notifyLayoutUpdate(D.layout,Q.prevViewportBox||D.layout,t)},resetTransform:function(){return c(Q,b,m)},restoreTransform:function(){return u(b,L)},updateLayoutProjection:function(){if(Q.isProjectionReady()){var t=D.delta,e=D.treeScale,n=e.x,i=e.y,o=D.deltaTransform;Ka(D,T,Q.path,E),P&&Q.notifyViewportBoxUpdate(T.target,t),P=!1;var r=Ya(t,e);r===o&&n===e.x&&i===e.y||Q.scheduleRender(),D.deltaTransform=r}},updateTreeLayoutProjection:function(){Q.layoutTree.forEach(es),ho.preRender(z,!1,!0)},getProjectionParent:function(){if(void 0===y){for(var t=!1,e=Q.path.length-1;e>=0;e--){var n=Q.path[e];if(n.projection.isEnabled){t=n;break}}y=t}return y},resolveRelativeTargetBox:function(){var t=Q.getProjectionParent();if(O.relativeTarget&&t&&(function(t,e){Gr(t.target.x,t.relativeTarget.x,e.target.x),Gr(t.target.y,t.relativeTarget.y,e.target.y)}(O,t.projection),Jr(t))){var e=O.target;la(e,e,t.getLatestValues())}},shouldResetTransform:function(){return Boolean(m._layoutResetTransform)},pointTo:function(t){T=t.projection,k=t.getLatestValues(),null==C||C(),C=jn(t.onSetAxisTarget(Q.scheduleUpdateLayoutProjection),t.onLayoutAnimationComplete((function(){var t;Q.isPresent?Q.presence=Ca.Present:null===(t=Q.layoutSafeToRemove)||void 0===t||t.call(Q)})))},isPresent:!0,presence:Ca.Entering});return Q}};function es(t){t.resolveRelativeTargetBox()}function ns(t){t.updateLayoutProjection()}var is,os=Object(Lt.e)(["initial"],Object(Lt.c)(ur)),rs=os.length,as=new Set(["width","height","top","left","right","bottom","x","y"]),ss=function(t){return as.has(t)},ls=function(t,e){t.set(e,!1),t.set(e)},cs=function(t){return t===ke||t===Le};!function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"}(is||(is={}));var us=function(t,e){return parseFloat(t.split(", ")[e])},ds=function(t,e){return function(n,i){var o=i.transform;if("none"===o||!o)return 0;var r=o.match(/^matrix3d\((.+)\)$/);if(r)return us(r[1],e);var a=o.match(/^matrix\((.+)\)$/);return a?us(a[1],t):0}},hs=new Set(["x","y","z"]),ps=ae.filter((function(t){return!hs.has(t)}));var fs={width:function(t){var e=t.x;return e.max-e.min},height:function(t){var e=t.y;return e.max-e.min},top:function(t,e){var n=e.top;return parseFloat(n)},left:function(t,e){var n=e.left;return parseFloat(n)},bottom:function(t,e){var n=t.y,i=e.top;return parseFloat(i)+(n.max-n.min)},right:function(t,e){var n=t.x,i=e.left;return parseFloat(i)+(n.max-n.min)},x:ds(4,13),y:ds(5,14)},ms=function(t,e,n,i){void 0===n&&(n={}),void 0===i&&(i={}),e=Object(Lt.a)({},e),i=Object(Lt.a)({},i);var o=Object.keys(e).filter(ss),r=[],a=!1,s=[];if(o.forEach((function(o){var l=t.getValue(o);if(t.hasValue(o)){var c,u=n[o],d=e[o],h=tr(u);if(sn(d))for(var p=d.length,f=null===d[0]?1:0;f<p;f++)c?tr(d[f]):(c=tr(d[f]))===h||cs(h)&&cs(c);else c=tr(d);if(h!==c)if(cs(h)&&cs(c)){var m=l.get();"string"==typeof m&&l.set(parseFloat(m)),"string"==typeof d?e[o]=parseFloat(d):Array.isArray(d)&&c===Le&&(e[o]=d.map(parseFloat))}else(null==h?void 0:h.transform)&&(null==c?void 0:c.transform)&&(0===u||0===d)?0===u?l.set(c.transform(u)):e[o]=h.transform(d):(a||(r=function(t){var e=[];return ps.forEach((function(n){var i=t.getValue(n);void 0!==i&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))})),e.length&&t.syncRender(),e}(t),a=!0),s.push(o),i[o]=void 0!==i[o]?i[o]:e[o],ls(l,d))}})),s.length){var l=function(t,e,n){var i=e.measureViewportBox(),o=e.getInstance(),r=getComputedStyle(o),a=r.display,s={top:r.top,left:r.left,bottom:r.bottom,right:r.right,transform:r.transform};"none"===a&&e.setStaticValue("display",t.display||"block"),e.syncRender();var l=e.measureViewportBox();return n.forEach((function(n){var o=e.getValue(n);ls(o,fs[n](i,s)),t[n]=fs[n](l,r)})),t}(e,t,s);return r.length&&r.forEach((function(e){var n=Object(Lt.c)(e,2),i=n[0],o=n[1];t.getValue(i).set(o)})),t.syncRender(),{target:l,transitionEnd:i}}return{target:e,transitionEnd:i}};function gs(t,e,n,i){return function(t){return Object.keys(t).some(ss)}(e)?ms(t,e,n,i):{target:e,transitionEnd:i}}var vs=function(t,e,n,i){var o=function(t,e,n){var i,o=Object(Lt.d)(e,[]),r=t.getInstance();if(!(r instanceof HTMLElement))return{target:o,transitionEnd:n};for(var a in n&&(n=Object(Lt.a)({},n)),t.forEachValue((function(t){var e=t.get();if(xa(e)){var n=La(e,r);n&&t.set(n)}})),o){var s=o[a];if(xa(s)){var l=La(s,r);l&&(o[a]=l,n&&(null!==(i=n[a])&&void 0!==i||(n[a]=s)))}}return{target:o,transitionEnd:n}}(t,e,i);return gs(t,e=o.target,n,i=o.transitionEnd)};var As={treeType:"dom",readValueFromInstance:function(t,e){if(ce(e)){var n=Mo(e);return n&&n.default||0}var i,o=(i=t,window.getComputedStyle(i));return(me(e)?o.getPropertyValue(e):o[e])||0},sortNodePosition:function(t,e){return 2&t.compareDocumentPosition(e)?1:-1},getBaseTarget:function(t,e){var n;return null===(n=t.style)||void 0===n?void 0:n[e]},measureViewportBox:function(t,e){return Mr(t,e.transformPagePoint)},resetTransform:function(t,e,n){var i=n.transformTemplate;e.style.transform=i?i({},""):"none",t.scheduleRender()},restoreTransform:function(t,e){t.style.transform=e.style.transform},removeValueFromRenderState:function(t,e){var n=e.vars,i=e.style;delete n[t],delete i[t]},makeTargetAnimatable:function(t,e,n,i){var o=n.transformValues;void 0===i&&(i=!0);var r=e.transition,a=e.transitionEnd,s=Object(Lt.d)(e,["transition","transitionEnd"]),l=function(t,e,n){var i,o,r={};for(var a in t)r[a]=null!==(i=rr(a,e))&&void 0!==i?i:null===(o=n.getValue(a))||void 0===o?void 0:o.get();return r}(s,r||{},t);if(o&&(a&&(a=o(a)),s&&(s=o(s)),l&&(l=o(l))),i){!function(t,e,n){var i,o,r,a,s=Object.keys(e).filter((function(e){return!t.hasValue(e)})),l=s.length;if(l)for(var c=0;c<l;c++){var u=s[c],d=e[u],h=null;Array.isArray(d)&&(h=d[0]),null===h&&(h=null!==(o=null!==(i=n[u])&&void 0!==i?i:t.readValue(u))&&void 0!==o?o:e[u]),null!=h&&("string"==typeof h&&/^\-?\d*\.?\d+$/.test(h)?h=parseFloat(h):!nr(h)&&bi.test(d)&&(h=jo(u,d)),t.addValue(u,$o(h)),null!==(r=(a=n)[u])&&void 0!==r||(a[u]=h),t.setBaseTarget(u,h))}}(t,s,l);var c=vs(t,s,l,a);a=c.transitionEnd,s=c.target}return Object(Lt.a)({transition:r,transitionEnd:a},s)},scrapeMotionValuesFromProps:on,build:function(t,e,n,i,o,r,a){void 0!==t.isVisible&&(e.style.visibility=t.isVisible?"visible":"hidden");var s=i.isEnabled&&o.isHydrated;Fe(e,n,i,o,r,a.transformTemplate,s?Ya:void 0,s?qa:void 0)},render:tn},bs=ts(As),ys=ts(Object(Lt.a)(Object(Lt.a)({},As),{getBaseTarget:function(t,e){return t[e]},readValueFromInstance:function(t,e){var n;return ce(e)?(null===(n=Mo(e))||void 0===n?void 0:n.default)||0:(e=en.has(e)?e:Je(e),t.getAttribute(e))},scrapeMotionValuesFromProps:rn,build:function(t,e,n,i,o,r,a){var s=i.isEnabled&&o.isHydrated;Ye(e,n,i,o,r,a.transformTemplate,s?Ya:void 0,s?qa:void 0)},render:nn})),Cs=function(t,e){return ie(t)?ys(e,{enableHardwareAcceleration:!1}):bs(e,{enableHardwareAcceleration:!0})},Ss=Object(Lt.a)(Object(Lt.a)(Object(Lt.a)(Object(Lt.a)({},gr),Nn),wa),Ga),ws=ee((function(t,e){return mn(t,e,Ss,Cs)}));class xs{constructor(t){this.highlighted=!1,this.code=t,this.points=[]}}var Es=n(6);class Ls{static now(){return Date.now()}}function _s(t){var e=Ft((function(){return $o(t)}));if(Object(B.useContext)(Pt).isStatic){var n=Object(Lt.c)(Object(B.useState)(t),2)[1];Object(B.useEffect)((function(){return e.onChange(n)}),[])}return e}var Os=function(t){return function(t){return"object"==typeof t&&t.mix}(t)?t.mix:void 0};function Ts(t,e){var n=_s(e()),i=function(){return n.set(e())};return i(),function(t,e){Object(B.useEffect)((function(){var n=t.map((function(t){return t.onChange(e)}));return function(){return n.forEach((function(t){return t()}))}}))}(t,(function(){return ho.update(i,!1,!0)})),n}function ks(t,e,n,i){var o="function"==typeof e?e:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=!Array.isArray(t[0]),i=n?0:-1,o=t[0+i],r=t[1+i],a=t[2+i],s=t[3+i],l=Oi(r,a,Object(Lt.a)({mixer:Os(a[0])},s));return n?l(o):l}(e,n,i);return Array.isArray(t)?Ds(t,o):Ds([t],(function(t){var e=Object(Lt.c)(t,1)[0];return o(e)}))}function Ds(t,e){var n=Ft((function(){return[]}));return Ts(t,(function(){n.length=0;for(var i=t.length,o=0;o<i;o++)n[o]=t[o].get();return e(n)}))}function Ps(t,e,n){void 0===n&&(n={});var i=pe(t)?t:$o(t);return Qo("",i,e,n),{stop:function(){return i.stop()}}}var Rs=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(t);o<i.length;o++)e.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(t,i[o])&&(n[i[o]]=t[i[o]])}return n};class Is extends B.default.Component{constructor(t){super(t),this.state={element:t.element}}update(t){this.setState({element:t})}style(t){this.customStyle=t,this.forceUpdate()}render(){var t,e,n,i,o,r,a,s,l;const c=this.state.element,u=this.props.configuration.style;!c.highlighted&&this.props.configuration.automaticSelectionEnabled&&this.props.onClick(c);const d=null!==(e=null===(t=this.customStyle)||void 0===t?void 0:t.fill)&&void 0!==e?e:c.highlighted?u.highlightedPolygonFillColor:u.polygonFillColor,h=null!==(i=null===(n=this.customStyle)||void 0===n?void 0:n.stroke)&&void 0!==i?i:c.highlighted?u.highlightedPolygonStrokeColor:u.polygonStrokeColor,p=null!==(r=null===(o=this.customStyle)||void 0===o?void 0:o.strokeWidth)&&void 0!==r?r:c.highlighted?u.highlightedPolygonStrokeWidth:u.polygonStrokeWidth,f=null!==(s=null===(a=this.customStyle)||void 0===a?void 0:a.cornerRadius)&&void 0!==s?s:c.highlighted?u.highlightedPolygonCornerRadius:u.polygonCornerRadius,m=null!==(l=this.props.animateToPoints)&&void 0!==l?l:c.points;return B.default.createElement(Fs,{points:m,onClick:()=>{this.props.onClick&&this.props.onClick(c)},fill:d,stroke:h,strokeWidth:p,cornerRadius:f})}}function Fs(t){var{points:e,cornerRadius:n}=t,i=Rs(t,["points","cornerRadius"]);const o=[e[0].x,e[0].y,e[1].x,e[1].y,e[2].x,e[2].y,e[3].x,e[3].y],r=o.map(_s),a=ks(r,(([t,e,i,o,r,a,s,l])=>{const c=[{x:t,y:e},{x:i,y:o},{x:r,y:a},{x:s,y:l}];return Es.a.toSvgPathStringWithRoundedCorners(c,n)}));return Object(B.useEffect)((()=>{const t=[];for(let e=0;e<o.length;e++)t.push(Ps(r[e],o[e]));return()=>{t.forEach((t=>t.stop()))}}),[e]),B.default.createElement(ws.path,Object.assign({d:a},i))}class Bs extends B.default.Component{constructor(t){super(t),this.state={polygonElements:[]}}update(t,e,n,i){const o=[];i.forEach((i=>{const r=new xs(i);r.points=void 0===t?Es.a.scaleListToHtmlElement(i.quad,n,e.video):i.quad.map((e=>{const i=new Es.a(e.x,e.y);return i.x*=t.width/n.width,i.y*=t.height/n.height,i.y+=t.y,i.x+=t.x,i})),o.push(r)}));const r=[];this.state.polygonElements.forEach((t=>{const e=o.find((e=>it(e.code,t.element.code)));let n=!1;void 0===e?t.updatedAt+1e3<Ls.now()&&(n=!0):(t.element=e,t.polygon=B.default.createElement(Is,{key:ot(t.element.code),ref:e=>t.polygonRef=e,configuration:this.props.configuration,element:t.element,animateToPoints:e.points,onClick:this.onPolygonClick.bind(this)}),t.label=B.default.createElement(this.props.LabelComponent,Object.assign({},this.props.labelComponentConfig,{key:ot(t.element.code),ref:e=>t.labelRef=e,configuration:this.props.configuration,element:t.element,animateToPoints:e.points,onClick:this.onPolygonClick.bind(this)})),t.updatedAt=Ls.now()),n||r.push(t)})),o.forEach((t=>{if(void 0===this.state.polygonElements.find((e=>it(e.element.code,t.code)))){let e,n;const i=B.default.createElement(Is,{key:ot(t.code),ref:i=>{e=i,void 0!==n&&this.props.onBarcodeFound(t.code,e,n)},configuration:this.props.configuration,element:t,onClick:this.onPolygonClick.bind(this)}),o=B.default.createElement(this.props.LabelComponent,Object.assign({},this.props.labelComponentConfig,{key:ot(t.code),ref:i=>{n=i,void 0!==e&&this.props.onBarcodeFound(t.code,e,n)},configuration:this.props.configuration,element:t,onClick:this.onPolygonClick.bind(this)})),a={element:t,polygon:i,label:o,polygonRef:e,labelRef:n,updatedAt:Ls.now()};r.push(a)}})),this.setState({polygonElements:r})}onPolygonClick(t){var e,n,i,o;t.highlighted=!t.highlighted,this.forceUpdate(),this.state.polygonElements.forEach((e=>{var n;const i=e.labelRef,o=e.label.props.element;i&&it(o.code,t.code)&&(i.update(t),null===(n=e.polygonRef)||void 0===n||n.update(t))})),t.highlighted&&(null===(n=(e=this.props).onPolygonSelected)||void 0===n||n.call(e,t.code)),null===(o=(i=this.props).onPolygonClick)||void 0===o||o.call(i,t.code)}render(){var t,e;return B.default.createElement("div",{style:Object.assign({width:"100%",height:"100%",position:"absolute"},this.props.style)},B.default.createElement(ws.svg,{style:{position:"absolute",maxWidth:"100%",width:"100%",height:"100%"}},null===(t=this.state.polygonElements)||void 0===t?void 0:t.map((t=>t.polygon))),null===(e=this.state.polygonElements)||void 0===e?void 0:e.map((t=>t.label)))}}var Ws=n(31),Ms=n.n(Ws),js=n(34),zs={insert:"head",singleton:!1},Ns=(Ms()(js.a,zs),js.a.locals,n(24)),Vs=n.n(Ns);class Us{constructor(t){this.lastTime=0,this.lastDuration=0,this.t=0,this.element=null,this.animationClass="",this.animationClass=t}setDuration(t){const e=Date.now()/1e3,n=e-this.lastTime;this.lastDuration&&(this.t+=n%this.lastDuration/this.lastDuration,this.t-=0|this.t);const i=-t*this.t;this.element&&(this.element.style.animationDuration=`${t}s`,this.element.style.animationDelay=`${i}s`,this.element.classList.remove(this.animationClass),this.element.offsetHeight,this.element.classList.add(this.animationClass)),this.lastTime=e,this.lastDuration=t}}class Hs extends B.default.Component{constructor(){super(...arguments),this.inner1=new Us("scanbot-shutter-rotate"),this.inner2=new Us("scanbot-shutter-rotate")}render(){return B.default.createElement("div",{className:"scanbot-shutter-button",style:this.props.style,onClick:this.props.onClick},this.captureBackground(),this.captureInnerCircle(),this.captureSearchingInner1(),this.captureSearchingInner2())}updateAnimationSpeed(t){"searching"==t?(this.inner1.setDuration(3),this.inner2.setDuration(2)):(this.inner1.setDuration(1.5),this.inner2.setDuration(.75))}componentDidMount(){this.updateAnimationSpeed(this.props.action)}componentDidUpdate(){this.updateAnimationSpeed(this.props.action)}captureBackground(){return this.svgBase(null,B.default.createElement("g",{fill:"none",fillRule:"evenodd",stroke:"none",strokeWidth:"1"},this.path("M32 0c17.673 0 32 14.327 32 32 0 17.673-14.327 32-32 32C14.327 64 0 49.673 0 32 0 14.327 14.327 0 32 0zm0 3C15.984 3 3 15.984 3 32s12.984 29 29 29 29-12.984 29-29S48.016 3 32 3z")))}captureInnerCircle(){const{action:t}=this.props;return this.svgBase({"scanbot-shutter-button-part":!0,"scanbot-shutter-fade-in":"processing"==t||"manual"==t,"scanbot-shutter-fade-out":"searching"==t||"capturing"==t,"scanbot-shutter-pulse-fast":"processing"==t},B.default.createElement("g",{fill:"none",fillRule:"evenodd",stroke:"none",strokeWidth:"1"},B.default.createElement("circle",{cx:"32",cy:"32",r:"24",fill:this.props.color,fillRule:"nonzero"})))}captureSearchingInner1(){const{action:t}=this.props;return this.svgBase({"scanbot-shutter-button-part":!0,"scanbot-shutter-fade-in":"searching"==t||"capturing"==t,"scanbot-shutter-fade-out":"processing"==t||"manual"==t},B.default.createElement("g",{fill:"none",fillOpacity:"0.7",fillRule:"evenodd",stroke:"none",strokeWidth:"1"},this.path("M44.24 51.476a1 1 0 01-1.066-1.692A20.981 20.981 0 0053 32c0-11.598-9.402-21-21-21a1 1 0 010-2c12.703 0 23 10.297 23 23a22.98 22.98 0 01-10.76 19.476z")),(t=>{this.inner1.element=t}))}captureSearchingInner2(){const{action:t}=this.props;return this.svgBase({"scanbot-shutter-button-part":!0,"scanbot-shutter-fade-in":"searching"==t||"capturing"==t,"scanbot-shutter-fade-out":"processing"==t||"manual"==t},B.default.createElement("g",{fill:"none",fillOpacity:"0.4",fillRule:"evenodd",stroke:"none",strokeWidth:"1"},this.path("M46.624 35.35a1 1 0 01-1.95-.445C44.89 33.96 45 32.988 45 32c0-7.18-5.82-13-13-13a1 1 0 010-2c8.284 0 15 6.716 15 15 0 1.138-.127 2.26-.376 3.35z")),(t=>{this.inner2.element=t}))}path(t){return B.default.createElement("path",{fill:this.props.color,fillRule:"nonzero",d:t})}svgBase(t,e,n){return B.default.createElement("div",{className:Vs()(t),ref:n},B.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"64",height:"64",viewBox:"0 0 64 64"},e))}}class Gs extends B.default.Component{render(){return B.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},B.default.createElement("mask",{id:"mask0_919_23088",style:"mask-type:alpha",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},B.default.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),B.default.createElement("g",{mask:"url(#mask0_919_23088)"},B.default.createElement("path",{d:"M9 19V17H21V19H9ZM9 13V11H21V13H9ZM9 7V5H21V7H9ZM5 20C4.45 20 3.97917 19.8042 3.5875 19.4125C3.19583 19.0208 3 18.55 3 18C3 17.45 3.19583 16.9792 3.5875 16.5875C3.97917 16.1958 4.45 16 5 16C5.55 16 6.02083 16.1958 6.4125 16.5875C6.80417 16.9792 7 17.45 7 18C7 18.55 6.80417 19.0208 6.4125 19.4125C6.02083 19.8042 5.55 20 5 20ZM5 14C4.45 14 3.97917 13.8042 3.5875 13.4125C3.19583 13.0208 3 12.55 3 12C3 11.45 3.19583 10.9792 3.5875 10.5875C3.97917 10.1958 4.45 10 5 10C5.55 10 6.02083 10.1958 6.4125 10.5875C6.80417 10.9792 7 11.45 7 12C7 12.55 6.80417 13.0208 6.4125 13.4125C6.02083 13.8042 5.55 14 5 14ZM5 8C4.45 8 3.97917 7.80417 3.5875 7.4125C3.19583 7.02083 3 6.55 3 6C3 5.45 3.19583 4.97917 3.5875 4.5875C3.97917 4.19583 4.45 4 5 4C5.55 4 6.02083 4.19583 6.4125 4.5875C6.80417 4.97917 7 5.45 7 6C7 6.55 6.80417 7.02083 6.4125 7.4125C6.02083 7.80417 5.55 8 5 8Z",fill:"white"})))}}class Qs extends B.default.Component{render(){return B.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},B.default.createElement("mask",{id:"mask0_919_23102",style:"mask-type:alpha",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},B.default.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),B.default.createElement("g",{mask:"url(#mask0_919_23102)"},B.default.createElement("path",{d:"M12 22C10.75 22 9.57917 21.7625 8.4875 21.2875C7.39583 20.8125 6.44583 20.1708 5.6375 19.3625C4.82917 18.5542 4.1875 17.6042 3.7125 16.5125C3.2375 15.4208 3 14.25 3 13H5C5 14.95 5.67917 16.6042 7.0375 17.9625C8.39583 19.3208 10.05 20 12 20C13.95 20 15.6042 19.3208 16.9625 17.9625C18.3208 16.6042 19 14.95 19 13C19 11.05 18.3208 9.39583 16.9625 8.0375C15.6042 6.67917 13.95 6 12 6H11.85L13.4 7.55L12 9L8 5L12 1L13.4 2.45L11.85 4H12C13.25 4 14.4208 4.2375 15.5125 4.7125C16.6042 5.1875 17.5542 5.82917 18.3625 6.6375C19.1708 7.44583 19.8125 8.39583 20.2875 9.4875C20.7625 10.5792 21 11.75 21 13C21 14.25 20.7625 15.4208 20.2875 16.5125C19.8125 17.6042 19.1708 18.5542 18.3625 19.3625C17.5542 20.1708 16.6042 20.8125 15.5125 21.2875C14.4208 21.7625 13.25 22 12 22Z",fill:"white"})))}}class Zs extends B.default.Component{constructor(t){super(t),this.state={barcodes:void 0}}update(t){this.setState({barcodes:t})}didScan(){return void 0!==this.state.barcodes}render(){var t,e;return B.default.createElement("div",{style:{position:"absolute",bottom:0,width:"100%",height:76,display:"flex",alignItems:"center",backgroundColor:xt.ScanbotPrimary}},B.default.createElement("div",{style:{display:"flex",flex:1,justifyContent:"center",alignItems:"center",opacity:this.didScan()?1:.5},onClick:this.didScan()&&this.props.onBurgerClick},B.default.createElement(Gs,null),B.default.createElement("div",{style:{backgroundColor:xt.Orange,color:xt.White,width:24,height:24,borderRadius:12,marginLeft:10,fontSize:13,lineHeight:"24px",textAlign:"center"}},null!==(e=null===(t=this.state.barcodes)||void 0===t?void 0:t.length)&&void 0!==e?e:0)),B.default.createElement("div",{style:{display:"flex",flex:1,justifyContent:"center",opacity:this.props.isShowingImage?.5:1}},B.default.createElement(Hs,{style:{left:0,bottom:0,transform:"none"},color:"#FFF",action:this.props.action,onClick:!this.props.isShowingImage&&this.props.onShutterButtonClick})),B.default.createElement("div",{style:{display:"flex",flex:1,justifyContent:"center",alignItems:"center",opacity:this.didScan()?1:.5},onClick:this.didScan()&&this.props.onScanMoreClick},B.default.createElement("div",{style:{fontSize:13,color:xt.White,marginRight:10}},"Scan More"),B.default.createElement(Qs,null)))}}class Ys extends B.default.Component{render(){const t=Es.a.centerOf(this.props.points),e=Es.a.smallerSizeOfQuad(this.props.points)/40;return B.default.createElement("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{position:"absolute",left:t.x-20,top:t.y-20,transform:`scale(${e})`}},B.default.createElement("mask",{id:"mask0_910_20901",style:"mask-type:alpha",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"40",height:"40"},B.default.createElement("rect",{width:"40",height:"40",fill:"#D9D9D9"})),B.default.createElement("g",{mask:"url(#mask0_910_20901)"},B.default.createElement("rect",{x:"7",y:"13",width:"26",height:"16",fill:"white"}),B.default.createElement("path",{d:"M17.5833 27.6111L29.3611 15.8333L27.3055 13.8055L17.5833 23.5278L12.6666 18.6111L10.6389 20.6389L17.5833 27.6111ZM20 36.6666C17.713 36.6666 15.5555 36.2291 13.5278 35.3541C11.5 34.4791 9.73147 33.287 8.22219 31.7778C6.71294 30.2685 5.52081 28.5 4.64581 26.4722C3.77081 24.4444 3.33331 22.287 3.33331 20C3.33331 17.6944 3.77081 15.5278 4.64581 13.5C5.52081 11.4722 6.71294 9.70831 8.22219 8.20831C9.73147 6.70831 11.5 5.52081 13.5278 4.64581C15.5555 3.77081 17.713 3.33331 20 3.33331C22.3055 3.33331 24.4722 3.77081 26.5 4.64581C28.5278 5.52081 30.2916 6.70831 31.7916 8.20831C33.2916 9.70831 34.4791 11.4722 35.3541 13.5C36.2291 15.5278 36.6666 17.6944 36.6666 20C36.6666 22.287 36.2291 24.4444 35.3541 26.4722C34.4791 28.5 33.2916 30.2685 31.7916 31.7778C30.2916 33.287 28.5278 34.4791 26.5 35.3541C24.4722 36.2291 22.3055 36.6666 20 36.6666Z",fill:"#55BB77"})))}}var qs=n(9);class Xs extends B.default.Component{constructor(t){super(t),this.state={elements:[],imageSize:qs.a.empty()}}update(t){const e=[];t.barcodes.forEach((n=>{const i=new xs(n);i.points=Es.a.scaleListToHtmlElement(n.quad,t.originalImageSize,this.image),e.push(i)})),this.setState({imageSize:qs.a.fromHtmlElement(this.image),elements:e})}reset(){this.setState({elements:[]})}render(){return void 0===this.props.image||null===this.props.image?null:B.default.createElement("div",{className:"scanned-image-with-overlay",style:{position:"absolute",display:"flex",justifyContent:"center",alignItems:this.state.image?"normal":"center",minHeight:"300px",height:"100%",width:"100%",top:0,left:0}},B.default.createElement("img",{style:{maxWidth:"100%"},ref:t=>this.image=t,src:`${this.props.image}`}),B.default.createElement("div",{style:{position:"absolute",maxWidth:"100%",width:this.state.imageSize.width,height:this.state.imageSize.height}},this.state.elements.map(((t,e)=>B.default.createElement(Ys,{key:e,points:t.points})))))}}class $s extends B.default.Component{render(){if(!this.props.visible)return null;const t=bt.a.svg`
31
+ `;var a=t=>o.default.createElement(r,{viewBox:"0 0 50 50"},o.default.createElement("circle",{className:"path",cx:"25",cy:"25",r:"20",fill:"none",strokeWidth:"3",stroke:t.color||"black"})),s=n(25),l=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class c{}class u{constructor(){this.videoReady=!1,this.sdkReady=!1}}class d extends o.default.Component{constructor(t){super(t),this.onVideoReady=()=>{this.setState({videoReady:!0},(()=>{const{onSuccess:t}=this.props;t&&t(this)}))},this.onVideoError=t=>{if(!0===this.state.videoReady){const{onError:e}=this.props.configuration;e?e(t):console.error(t)}else{const{onFailure:e}=this.props;e&&e(t),this.dispose()}},this.state=new u,this.bridge.awaitInitialized().then((()=>{this.setState({sdkReady:!0})}))}get bridge(){return i.a.instance.bridge}dispose(){const{container:t}=this.props;t&&Object(o.render)(null,t)}componentDidMount(){this.disposed=!1}componentWillUnmount(){this.disposed=!0}isSupported(){return"localhost"===location.hostname||"https:"===location.protocol}swapCameraFacing(t){this.camera.swapCameraFacing(t)}switchCamera(t,e){return l(this,void 0,void 0,(function*(){this.camera.switchCamera(t,e)}))}getActiveCameraInfo(){return this.camera.getActiveCameraInfo()}fetchAvailableCameras(){return s.a.INSTANCE.load()}renderSpinner(t){return this.state.videoReady&&this.state.sdkReady?null:o.default.createElement("div",{"data-sb-spinner":"1",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:500}},o.default.createElement(a,{color:t}))}setTorchState(t){return this.camera.setTorchState(t)}}d.DEFAULT_DETECTION_RESOLUTION=600,d.DETECTION_RESULTION_4K=3840},function(t,e,n){"use strict";n.r(e),n.d(e,"SingleScanningMode",(function(){return c})),n.d(e,"Resolution",(function(){return u})),n.d(e,"CameraConfiguration",(function(){return d})),n.d(e,"TopBarConfiguration",(function(){return f.a})),n.d(e,"ActionBarConfiguration",(function(){return p})),n.d(e,"BarcodeUseCase",(function(){return h})),n.d(e,"Palette",(function(){return i.f})),n.d(e,"StyledText",(function(){return i.j})),n.d(e,"IconStyle",(function(){return i.e})),n.d(e,"PolygonStyle",(function(){return i.g})),n.d(e,"BackgroundStyle",(function(){return i.a})),n.d(e,"ForegroundStyle",(function(){return i.d})),n.d(e,"RoundButton",(function(){return i.h})),n.d(e,"BadgedButton",(function(){return i.b})),n.d(e,"ButtonConfiguration",(function(){return i.c})),n.d(e,"Sound",(function(){return i.i})),n.d(e,"Vibration",(function(){return i.l})),n.d(e,"Timeouts",(function(){return i.k})),n.d(e,"ViewFinderConfiguration",(function(){return E})),n.d(e,"FinderStyle",(function(){return w})),n.d(e,"FinderCorneredStyle",(function(){return L})),n.d(e,"FinderStrokedStyle",(function(){return _})),n.d(e,"UserGuidanceConfiguration",(function(){return O})),n.d(e,"BarcodeItemErrorState",(function(){return a})),n.d(e,"BarcodeMappedData",(function(){return s})),n.d(e,"BarcodeInfoMapping",(function(){return l})),n.d(e,"ExpectedBarcode",(function(){return C})),n.d(e,"FindAndPickScanningMode",(function(){return S})),n.d(e,"BarcodeTextLocalization",(function(){return T})),n.d(e,"BarcodeRecognizerConfiguration",(function(){return k})),n.d(e,"ArOverlayPolygonConfiguration",(function(){return o.c})),n.d(e,"BarcodeItemConfiguration",(function(){return o.e})),n.d(e,"BadgeStyle",(function(){return o.d})),n.d(e,"ArOverlayGeneralConfiguration",(function(){return o.b})),n.d(e,"FindAndPickArOverlayPolygonConfiguration",(function(){return o.f})),n.d(e,"FindAndPickBadgeConfiguration",(function(){return o.g})),n.d(e,"ArOverlayFindAndPickConfiguration",(function(){return o.a})),n.d(e,"BarcodeScannerConfiguration",(function(){return P})),n.d(e,"BarcodeScannerUIItem",(function(){return F})),n.d(e,"BarcodeScannerUIResult",(function(){return R})),n.d(e,"OcrResult",(function(){return I.OcrResult})),n.d(e,"FieldParsedData",(function(){return I.FieldParsedData})),n.d(e,"FieldType",(function(){return I.FieldType})),n.d(e,"Field",(function(){return I.Field})),n.d(e,"GenericDocumentType",(function(){return I.GenericDocumentType})),n.d(e,"GenericDocument",(function(){return I.GenericDocument})),n.d(e,"Sheet",(function(){return m})),n.d(e,"SwipeToDelete",(function(){return g})),n.d(e,"ManualCountEditDialog",(function(){return v})),n.d(e,"SheetContent",(function(){return A})),n.d(e,"MultipleScanningMode",(function(){return b})),n.d(e,"ScanbotAlertDialog",(function(){return y})),n.d(e,"CameraPermissionScreen",(function(){return D})),n.d(e,"BarcodeItem",(function(){return B.BarcodeItem})),n.d(e,"BarcodeDocumentFormats",(function(){return B.BarcodeDocumentFormats}));var o=n(8),i=n(1),r=n(7);class a extends r.a{constructor(t={}){super(),this.title=new i.j({text:"Connection Error!",color:"?sbColorOnSurface"}),this.subtitle=new i.j({text:"There was an issue and the data requested was not fetched. You could try again or discard this result to start a new scan.",color:"?sbColorOnSurfaceVariant"}),this.retryButton=new i.c({}),this.cancelButton=new i.c({}),void 0!==t.title&&(this.title=new i.j(t.title)),void 0!==t.subtitle&&(this.subtitle=new i.j(t.subtitle)),void 0!==t.retryButton&&(this.retryButton=new i.c(t.retryButton)),void 0!==t.cancelButton&&(this.cancelButton=new i.c(t.cancelButton))}}class s extends r.a{constructor(t={}){if(super(),void 0===t.title)throw new Error("title must be present in constructor argument");if(this.title=t.title,void 0===t.subtitle)throw new Error("subtitle must be present in constructor argument");if(this.subtitle=t.subtitle,void 0===t.barcodeImage)throw new Error("barcodeImage must be present in constructor argument");this.barcodeImage=t.barcodeImage}}class l extends r.a{constructor(t={}){super(),this.barcodeItemMapper=null,this.sheetColor="?sbColorSurface",this.dividerColor="?sbColorOutline",this.modalOverlayColor="?sbColorModalOverlay",this.loadingMessage=new i.j({text:"Loading message for barcode info mapping.",color:"?sbColorPrimary"}),this.errorState=new a({}),void 0!==t.barcodeItemMapper&&(this.barcodeItemMapper=null!=t.barcodeItemMapper?t.barcodeItemMapper:null),void 0!==t.sheetColor&&(this.sheetColor=t.sheetColor),void 0!==t.dividerColor&&(this.dividerColor=t.dividerColor),void 0!==t.modalOverlayColor&&(this.modalOverlayColor=t.modalOverlayColor),void 0!==t.loadingMessage&&(this.loadingMessage=new i.j(t.loadingMessage)),void 0!==t.errorState&&(this.errorState=new a(t.errorState))}}class c extends r.a{constructor(t={}){super(),this._type="SingleScanningMode",this.confirmationSheetEnabled=!1,this.barcodeImageVisible=!0,this.sheetColor="?sbColorSurface",this.dividerColor="?sbColorOutline",this.modalOverlayColor="?sbColorModalOverlay",this.barcodeTitle=new i.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),this.barcodeSubtitle=new i.j({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),this.submitButton=new i.c({visible:!0,text:"?sheetSubmitButton",background:new i.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new i.d({iconVisible:!0,color:"?sbColorOnPrimary"})}),this.cancelButton=new i.c({visible:!0,text:"?singleModeConfirmationCancelButton",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorPrimary"})}),this.barcodeInfoMapping=new l({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",modalOverlayColor:"?sbColorModalOverlay",loadingMessage:new i.j({text:"?barcodeInfoMappingLoadingMessage",color:"?sbColorPrimary"}),errorState:new a({title:new i.j({text:"?barcodeInfoMappingErrorStateTitle",color:"?sbColorOnSurface"}),subtitle:new i.j({text:"?barcodeInfoMappingErrorStateSubtitle",color:"?sbColorOnSurfaceVariant"}),retryButton:new i.c({visible:!0,text:"?barcodeInfoMappingErrorStateRetryButton",background:new i.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new i.d({iconVisible:!0,color:"?sbColorOnPrimary"})}),cancelButton:new i.c({text:"?barcodeInfoMappingErrorStateCancelButton",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorPrimary"})})})}),this.arOverlay=new o.b({visible:!1,counterBadge:new o.d({visible:!0,background:new i.a({strokeColor:"#000000FF",fillColor:"?sbColorPositive",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),automaticSelectionEnabled:!1,barcodeItemInfoPosition:"BELOW",polygon:new o.c({visible:!0,deselected:new i.g({strokeColor:"?sbColorSurface",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),selected:new i.g({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:3,cornerRadius:5})}),barcodeItemConfiguration:new o.e({imageVisible:!0,titleSelected:new i.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),subtitleSelected:new i.j({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),titleDeselected:new i.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),subtitleDeselected:new i.j({visible:!0,text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant",useShadow:!1}),backgroundSelected:new i.g({strokeColor:"?sbColorPositive",fillColor:"?sbColorPositive",strokeWidth:1,cornerRadius:5}),backgroundDeselected:new i.g({strokeColor:"?sbColorSurface",fillColor:"?sbColorSurface",strokeWidth:1,cornerRadius:5})})}),void 0!==t.confirmationSheetEnabled&&(this.confirmationSheetEnabled=t.confirmationSheetEnabled),void 0!==t.barcodeImageVisible&&(this.barcodeImageVisible=t.barcodeImageVisible),void 0!==t.sheetColor&&(this.sheetColor=t.sheetColor),void 0!==t.dividerColor&&(this.dividerColor=t.dividerColor),void 0!==t.modalOverlayColor&&(this.modalOverlayColor=t.modalOverlayColor),void 0!==t.barcodeTitle&&(this.barcodeTitle=new i.j(t.barcodeTitle)),void 0!==t.barcodeSubtitle&&(this.barcodeSubtitle=new i.j(t.barcodeSubtitle)),void 0!==t.submitButton&&(this.submitButton=new i.c(t.submitButton)),void 0!==t.cancelButton&&(this.cancelButton=new i.c(t.cancelButton)),void 0!==t.barcodeInfoMapping&&(this.barcodeInfoMapping=new l(t.barcodeInfoMapping)),void 0!==t.arOverlay&&(this.arOverlay=new o.b(t.arOverlay))}}class u extends r.a{constructor(t={}){if(super(),void 0===t.width)throw new Error("width must be present in constructor argument");if(this.width=t.width,void 0===t.height)throw new Error("height must be present in constructor argument");this.height=t.height}}class d extends r.a{constructor(t={}){super(),this.cameraModule="BACK",this.zoomSteps=[1,2,5],this.defaultZoomFactor=1,this.flashEnabled=!1,this.idealPreviewResolution=new u({width:1920,height:1080}),void 0!==t.cameraModule&&(this.cameraModule=t.cameraModule),void 0!==t.zoomSteps&&(this.zoomSteps=t.zoomSteps.map((t=>t))),void 0!==t.defaultZoomFactor&&(this.defaultZoomFactor=t.defaultZoomFactor),void 0!==t.flashEnabled&&(this.flashEnabled=t.flashEnabled),void 0!==t.idealPreviewResolution&&(this.idealPreviewResolution=new u(t.idealPreviewResolution))}}var h,f=n(30);class p extends r.a{constructor(t={}){super(),this.flashButton=new i.h({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorWarning",activeForegroundColor:"#1C1B1F"}),this.zoomButton=new i.h({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"}),this.flipCameraButton=new i.h({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"}),void 0!==t.flashButton&&(this.flashButton=new i.h(t.flashButton)),void 0!==t.zoomButton&&(this.zoomButton=new i.h(t.zoomButton)),void 0!==t.flipCameraButton&&(this.flipCameraButton=new i.h(t.flipCameraButton))}}class m extends r.a{constructor(t={}){super(),this.mode="COLLAPSED_SHEET",this.collapsedVisibleHeight="SMALL",this.listButton=new i.b({}),void 0!==t.mode&&(this.mode=t.mode),void 0!==t.collapsedVisibleHeight&&(this.collapsedVisibleHeight=t.collapsedVisibleHeight),void 0!==t.listButton&&(this.listButton=new i.b(t.listButton))}}class g extends r.a{constructor(t={}){super(),this.enabled=!0,this.backgroundColor="?sbColorNegative",this.iconColor="?sbColorOnPrimary",void 0!==t.enabled&&(this.enabled=t.enabled),void 0!==t.backgroundColor&&(this.backgroundColor=t.backgroundColor),void 0!==t.iconColor&&(this.iconColor=t.iconColor)}}class v extends r.a{constructor(t={}){super(),this.sheetColor="?sbColorSurface",this.dividerColor="?sbColorOutline",this.modalOverlayColor="?sbColorModalOverlay",this.title=new i.j({text:"Update count",color:"?sbColorOnSurface"}),this.info=new i.j({text:"Adjust the number of items you scanned.",color:"?sbColorOnSurfaceVariant"}),this.updateButton=new i.c({visible:!0,text:"Update",background:new i.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),this.cancelButton=new i.c({visible:!0,text:"Cancel",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})}),this.clearTextButton=new i.e({visible:!0,color:"?sbColorOnSurfaceVariant"}),void 0!==t.sheetColor&&(this.sheetColor=t.sheetColor),void 0!==t.dividerColor&&(this.dividerColor=t.dividerColor),void 0!==t.modalOverlayColor&&(this.modalOverlayColor=t.modalOverlayColor),void 0!==t.title&&(this.title=new i.j(t.title)),void 0!==t.info&&(this.info=new i.j(t.info)),void 0!==t.updateButton&&(this.updateButton=new i.c(t.updateButton)),void 0!==t.cancelButton&&(this.cancelButton=new i.c(t.cancelButton)),void 0!==t.clearTextButton&&(this.clearTextButton=new i.e(t.clearTextButton))}}class A extends r.a{constructor(t={}){super(),this.sheetColor="?sbColorSurface",this.dividerColor="?sbColorOutline",this.manualCountChangeEnabled=!0,this.manualCountOutlineColor="?sbColorOutline",this.manualCountChangeColor="?sbColorPrimary",this.title=new i.j({text:"%d items",color:"?sbColorOnSurface"}),this.clearAllButton=new i.c({visible:!0,text:"Clear all",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),this.barcodeItemTitle=new i.j({visible:!0,text:"BARCODE_TITLE",color:"?sbColorOnSurface",useShadow:!1}),this.barcodeItemSubtitle=new i.j({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),this.barcodeItemImageVisible=!0,this.submitButton=new i.c({visible:!0,text:"Submit",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),this.startScanningButton=new i.c({visible:!0,text:"Start scanning",background:new i.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new i.d({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),this.placeholderTitle=new i.j({text:"No barcodes here!",color:"?sbColorOnSurface"}),this.placeholderSubtitle=new i.j({text:"The barcode list is currently empty. Close this sheet and scan your items to add them.",color:"?sbColorOnSurfaceVariant"}),this.placeholderIconBackground="?sbColorOutline",this.placeholderIcon=new i.e({visible:!0,color:"?sbColorOnSurface"}),this.swipeToDelete=new g({enabled:!0,backgroundColor:"?sbColorNegative",iconColor:"?sbColorOnPrimary"}),void 0!==t.sheetColor&&(this.sheetColor=t.sheetColor),void 0!==t.dividerColor&&(this.dividerColor=t.dividerColor),void 0!==t.manualCountChangeEnabled&&(this.manualCountChangeEnabled=t.manualCountChangeEnabled),void 0!==t.manualCountOutlineColor&&(this.manualCountOutlineColor=t.manualCountOutlineColor),void 0!==t.manualCountChangeColor&&(this.manualCountChangeColor=t.manualCountChangeColor),void 0!==t.title&&(this.title=new i.j(t.title)),void 0!==t.clearAllButton&&(this.clearAllButton=new i.c(t.clearAllButton)),void 0!==t.barcodeItemTitle&&(this.barcodeItemTitle=new i.j(t.barcodeItemTitle)),void 0!==t.barcodeItemSubtitle&&(this.barcodeItemSubtitle=new i.j(t.barcodeItemSubtitle)),void 0!==t.barcodeItemImageVisible&&(this.barcodeItemImageVisible=t.barcodeItemImageVisible),void 0!==t.submitButton&&(this.submitButton=new i.c(t.submitButton)),void 0!==t.startScanningButton&&(this.startScanningButton=new i.c(t.startScanningButton)),void 0!==t.placeholderTitle&&(this.placeholderTitle=new i.j(t.placeholderTitle)),void 0!==t.placeholderSubtitle&&(this.placeholderSubtitle=new i.j(t.placeholderSubtitle)),void 0!==t.placeholderIconBackground&&(this.placeholderIconBackground=t.placeholderIconBackground),void 0!==t.placeholderIcon&&(this.placeholderIcon=new i.e(t.placeholderIcon)),void 0!==t.swipeToDelete&&(this.swipeToDelete=new g(t.swipeToDelete))}}class b extends r.a{constructor(t={}){super(),this._type="MultipleScanningMode",this.countingRepeatDelay=1e3,this.mode="COUNTING",this.sheet=new m({mode:"COLLAPSED_SHEET",collapsedVisibleHeight:"SMALL",listButton:new i.b({badgeBackgroundColor:"?sbColorSurface",badgeForegroundColor:"?sbColorPrimary",visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"})}),this.sheetContent=new A({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",manualCountChangeEnabled:!0,manualCountOutlineColor:"?sbColorOutline",manualCountChangeColor:"?sbColorPrimary",title:new i.j({text:"?multipleModeSheetTitle",color:"?sbColorOnSurface"}),clearAllButton:new i.c({visible:!0,text:"?sheetClearAllButton",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),barcodeItemTitle:new i.j({visible:!0,text:"BARCODE_TITLE",color:"?sbColorOnSurface",useShadow:!1}),barcodeItemSubtitle:new i.j({visible:!0,text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant",useShadow:!1}),barcodeItemImageVisible:!0,submitButton:new i.c({visible:!0,text:"?sheetSubmitButton",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),startScanningButton:new i.c({visible:!0,text:"?sheetStartScanningButton",background:new i.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),placeholderTitle:new i.j({visible:!0,text:"?sheetPlaceholderTitle",color:"?sbColorOnSurface",useShadow:!1}),placeholderSubtitle:new i.j({visible:!0,text:"?sheetPlaceholderSubtitle",color:"?sbColorOnSurfaceVariant",useShadow:!1}),placeholderIconBackground:"?sbColorOutline",placeholderIcon:new i.e({visible:!0,color:"?sbColorOnSurface"}),swipeToDelete:new g({enabled:!0,backgroundColor:"?sbColorNegative",iconColor:"?sbColorOnPrimary"})}),this.manualCountEditDialog=new v({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",modalOverlayColor:"?sbColorModalOverlay",title:new i.j({text:"?manualCountEditDialogTitle",color:"?sbColorOnSurface"}),info:new i.j({text:"?manualCountEditDialogInfo",color:"?sbColorOnSurfaceVariant"}),updateButton:new i.c({visible:!0,text:"?manualCountEditDialogUpdateButton",background:new i.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),cancelButton:new i.c({visible:!0,text:"?manualCountEditDialogCancelButton",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})}),clearTextButton:new i.e({visible:!0,color:"?sbColorOnSurfaceVariant"})}),this.barcodeInfoMapping=new l({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",modalOverlayColor:"?sbColorModalOverlay",loadingMessage:new i.j({text:"?barcodeInfoMappingLoadingMessage",color:"?sbColorPrimary"}),errorState:new a({title:new i.j({text:"?barcodeInfoMappingErrorStateTitle",color:"?sbColorOnSurface"}),subtitle:new i.j({text:"?barcodeInfoMappingErrorStateSubtitle",color:"?sbColorOnSurfaceVariant"}),retryButton:new i.c({visible:!0,text:"?barcodeInfoMappingErrorStateRetryButton",background:new i.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new i.d({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),cancelButton:new i.c({visible:!0,text:"?barcodeInfoMappingErrorStateCancelButton",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})})})}),this.arOverlay=new o.b({visible:!1,counterBadge:new o.d({visible:!0,background:new i.a({strokeColor:"#FF000000",fillColor:"?sbColorPositive",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),automaticSelectionEnabled:!1,barcodeItemInfoPosition:"BELOW",polygon:new o.c({visible:!0,deselected:new i.g({strokeColor:"?sbColorSurface",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),selected:new i.g({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:3,cornerRadius:5})}),barcodeItemConfiguration:new o.e({imageVisible:!0,titleSelected:new i.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),subtitleSelected:new i.j({visible:!0,text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant",useShadow:!1}),titleDeselected:new i.j({visible:!0,text:"BARCODE_TITLE",color:"?sbColorOnSurface",useShadow:!1}),subtitleDeselected:new i.j({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),backgroundSelected:new i.g({strokeColor:"?sbColorPositive",fillColor:"?sbColorPositive",strokeWidth:1,cornerRadius:5}),backgroundDeselected:new i.g({strokeColor:"?sbColorSurface",fillColor:"?sbColorSurface",strokeWidth:1,cornerRadius:5})})}),void 0!==t.countingRepeatDelay&&(this.countingRepeatDelay=t.countingRepeatDelay),void 0!==t.mode&&(this.mode=t.mode),void 0!==t.sheet&&(this.sheet=new m(t.sheet)),void 0!==t.sheetContent&&(this.sheetContent=new A(t.sheetContent)),void 0!==t.manualCountEditDialog&&(this.manualCountEditDialog=new v(t.manualCountEditDialog)),void 0!==t.barcodeInfoMapping&&(this.barcodeInfoMapping=new l(t.barcodeInfoMapping)),void 0!==t.arOverlay&&(this.arOverlay=new o.b(t.arOverlay))}}class y extends r.a{constructor(t={}){if(super(),this.title=new i.j({text:"Title",color:"?sbColorOnSurface"}),this.subtitle=new i.j({text:"Standard explanation message text.",color:"?sbColorOnSurfaceVariant"}),this.sheetColor="?sbColorSurface",this.modalOverlayColor="?sbColorModalOverlay",this.dividerColor="?sbColorOutline",void 0!==t.title&&(this.title=new i.j(t.title)),void 0!==t.subtitle&&(this.subtitle=new i.j(t.subtitle)),void 0!==t.sheetColor&&(this.sheetColor=t.sheetColor),void 0!==t.modalOverlayColor&&(this.modalOverlayColor=t.modalOverlayColor),void 0!==t.dividerColor&&(this.dividerColor=t.dividerColor),void 0===t.okButton)throw new Error("okButton must be present in constructor argument");if(this.okButton=new i.c(t.okButton),void 0===t.cancelButton)throw new Error("cancelButton must be present in constructor argument");this.cancelButton=new i.c(t.cancelButton)}}class C extends r.a{constructor(t={}){if(super(),this.count=1,void 0===t.barcodeValue)throw new Error("barcodeValue must be present in constructor argument");this.barcodeValue=t.barcodeValue,void 0!==t.title&&(this.title=null!=t.title?t.title:null),void 0!==t.image&&(this.image=null!=t.image?t.image:null),void 0!==t.count&&(this.count=t.count)}}class S extends r.a{constructor(t={}){super(),this._type="FindAndPickScanningMode",this.scanningCompletedColor="?sbColorPositive",this.scanningPartiallyColor="?sbColorWarning",this.scanningNotScannedColor="?sbColorOutline",this.allowPartialScan=!1,this.expectedBarcodes=[],this.countingRepeatDelay=1e3,this.sheet=new m({mode:"COLLAPSED_SHEET",collapsedVisibleHeight:"SMALL",listButton:new i.b({badgeBackgroundColor:"?sbColorSurface",badgeForegroundColor:"?sbColorPrimary",visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"})}),this.sheetContent=new A({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",manualCountChangeEnabled:!0,manualCountOutlineColor:"?sbColorOutline",manualCountChangeColor:"?sbColorPrimary",title:new i.j({visible:!0,text:"?findAndPickSheetTitle",color:"?sbColorOnSurface",useShadow:!1}),clearAllButton:new i.c({visible:!0,text:"?sheetResetButton",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),barcodeItemTitle:new i.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),barcodeItemSubtitle:new i.j({text:"?findAndPickSheetBarcodeItemSubtitle",color:"?sbColorOnSurfaceVariant"}),barcodeItemImageVisible:!0,submitButton:new i.c({visible:!0,text:"?sheetSubmitButton",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),startScanningButton:new i.c({visible:!0,text:"?sheetStartScanningButton",background:new i.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),placeholderTitle:new i.j({text:"?sheetPlaceholderTitle",color:"?sbColorOnSurface"}),placeholderSubtitle:new i.j({text:"?sheetPlaceholderSubtitle",color:"?sbColorOnSurfaceVariant"}),placeholderIconBackground:"?sbColorOutline",placeholderIcon:new i.e({visible:!0,color:"?sbColorOnSurface"}),swipeToDelete:new g({enabled:!1,backgroundColor:"?sbColorNegative",iconColor:"?sbColorOnPrimary"})}),this.manualCountEditDialog=new v({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",modalOverlayColor:"?sbColorModalOverlay",title:new i.j({text:"?manualCountEditDialogTitle",color:"?sbColorOnSurface"}),info:new i.j({text:"?manualCountEditDialogInfo",color:"?sbColorOnSurfaceVariant"}),updateButton:new i.c({visible:!0,text:"?manualCountEditDialogUpdateButton",background:new i.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),cancelButton:new i.c({visible:!0,text:"?manualCountEditDialogCancelButton",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})}),clearTextButton:new i.e({visible:!0,color:"?sbColorOnSurfaceVariant"})}),this.arOverlay=new o.a({visible:!1,automaticSelectionEnabled:!0,polygon:new o.f({partiallyScanned:new i.g({strokeColor:"?sbColorWarning",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),rejected:new i.g({strokeColor:"?sbColorSurface",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),completed:new i.g({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:3,cornerRadius:5})}),badge:new o.g({partiallyScanned:new o.d({visible:!0,background:new i.a({strokeColor:"#000000FF",fillColor:"?sbColorWarning",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),rejected:new o.d({visible:!0,background:new i.a({strokeColor:"#000000FF",fillColor:"?sbColorSurface",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),completed:new o.d({visible:!0,background:new i.a({strokeColor:"#000000FF",fillColor:"?sbColorPositive",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"})})}),this.partialScannedAlertDialogEnabled=!0,this.partialScannedAlertDialog=new y({title:new i.j({text:"?findAndPickPartialAlertTitle",color:"?sbColorOnSurface"}),subtitle:new i.j({text:"?findAndPickPartialAlertSubtitle",color:"?sbColorOnSurfaceVariant"}),sheetColor:"?sbColorSurface",modalOverlayColor:"?sbColorModalOverlay",dividerColor:"?sbColorOutline",okButton:new i.c({visible:!0,text:"?findAndPickPartialAlertSubmitButton",background:new i.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new i.d({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),cancelButton:new i.c({visible:!0,text:"?findAndPickPartialAlertCancelButton",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})})}),this.confirmationAlertDialogEnabled=!1,this.confirmationAlertDialog=new y({title:new i.j({text:"?findAndPickCompleteAlertTitle",color:"?sbColorOnSurface"}),subtitle:new i.j({text:"?findAndPickCompleteAlertSubtitle",color:"?sbColorOnSurfaceVariant"}),sheetColor:"?sbColorSurface",modalOverlayColor:"?sbColorModalOverlay",dividerColor:"?sbColorOutline",okButton:new i.c({visible:!0,text:"?findAndPickCompleteAlertSubmitButton",background:new i.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new i.d({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),cancelButton:new i.c({visible:!0,text:"?findAndPickCompleteAlertCancelButton",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})})}),void 0!==t.scanningCompletedColor&&(this.scanningCompletedColor=t.scanningCompletedColor),void 0!==t.scanningPartiallyColor&&(this.scanningPartiallyColor=t.scanningPartiallyColor),void 0!==t.scanningNotScannedColor&&(this.scanningNotScannedColor=t.scanningNotScannedColor),void 0!==t.allowPartialScan&&(this.allowPartialScan=t.allowPartialScan),void 0!==t.expectedBarcodes&&(this.expectedBarcodes=t.expectedBarcodes.map((t=>new C(t)))),void 0!==t.countingRepeatDelay&&(this.countingRepeatDelay=t.countingRepeatDelay),void 0!==t.sheet&&(this.sheet=new m(t.sheet)),void 0!==t.sheetContent&&(this.sheetContent=new A(t.sheetContent)),void 0!==t.manualCountEditDialog&&(this.manualCountEditDialog=new v(t.manualCountEditDialog)),void 0!==t.arOverlay&&(this.arOverlay=new o.a(t.arOverlay)),void 0!==t.partialScannedAlertDialogEnabled&&(this.partialScannedAlertDialogEnabled=t.partialScannedAlertDialogEnabled),void 0!==t.partialScannedAlertDialog&&(this.partialScannedAlertDialog=new y(t.partialScannedAlertDialog)),void 0!==t.confirmationAlertDialogEnabled&&(this.confirmationAlertDialogEnabled=t.confirmationAlertDialogEnabled),void 0!==t.confirmationAlertDialog&&(this.confirmationAlertDialog=new y(t.confirmationAlertDialog))}}(h||(h={})).From=function(t){const e=t._type;switch(e){case"SingleScanningMode":return new c(t);case"MultipleScanningMode":return new b(t);case"FindAndPickScanningMode":return new S(t);default:throw`Unknown child class name: ${e}`}};var w,x=n(20);class E extends r.a{constructor(t={}){super(),this.visible=!0,this.style=new L({strokeColor:"?sbColorSurface",strokeWidth:2,cornerRadius:10}),this.overlayColor="?sbColorSurfaceLow",this.aspectRatio=new x.AspectRatio({width:1,height:1}),void 0!==t.visible&&(this.visible=t.visible),void 0!==t.style&&(this.style=w.From(t.style)),void 0!==t.overlayColor&&(this.overlayColor=t.overlayColor),void 0!==t.aspectRatio&&(this.aspectRatio=new x.AspectRatio(t.aspectRatio))}}!function(t){t.From=function(t){const e=t._type;switch(e){case"FinderCorneredStyle":return new L(t);case"FinderStrokedStyle":return new _(t);default:throw`Unknown child class name: ${e}`}}}(w||(w={}));class L extends r.a{constructor(t={}){super(),this._type="FinderCorneredStyle",this.strokeColor="#FFFFFFFF",this.strokeWidth=3,this.cornerRadius=10,void 0!==t.strokeColor&&(this.strokeColor=t.strokeColor),void 0!==t.strokeWidth&&(this.strokeWidth=t.strokeWidth),void 0!==t.cornerRadius&&(this.cornerRadius=t.cornerRadius)}}class _ extends r.a{constructor(t={}){super(),this._type="FinderStrokedStyle",this.strokeColor="#FFFFFFFF",this.strokeWidth=3,this.cornerRadius=10,void 0!==t.strokeColor&&(this.strokeColor=t.strokeColor),void 0!==t.strokeWidth&&(this.strokeWidth=t.strokeWidth),void 0!==t.cornerRadius&&(this.cornerRadius=t.cornerRadius)}}class O extends r.a{constructor(t={}){super(),this.visible=!0,this.title=new i.j({color:"?sbColorOnPrimary"}),this.background=new i.a({strokeColor:"#00000000",fillColor:"?sbColorSurfaceLow"}),void 0!==t.visible&&(this.visible=t.visible),void 0!==t.title&&(this.title=new i.j(t.title)),void 0!==t.background&&(this.background=new i.a(t.background))}}class T extends r.a{constructor(t={}){super(),this.cameraPermissionEnableCameraTitle="Camera permission denied!",this.cameraPermissionEnableCameraExplanation="Please allow the usage of the camera to start the scanning process.",this.cameraPermissionCloseButton="Close",this.topBarCancelButton="Cancel",this.topBarTitle="Scan Item",this.userGuidance="Move the finder over a barcode",this.barcodeInfoMappingLoadingMessage="Loading details...",this.barcodeInfoMappingErrorStateTitle="Connection Error!",this.barcodeInfoMappingErrorStateSubtitle="There was an issue and the data requested was not fetched. You could try again or discard this result to start a new scan.",this.barcodeInfoMappingErrorStateRetryButton="Retry",this.barcodeInfoMappingErrorStateCancelButton="Cancel",this.manualCountEditDialogTitle="Update count",this.manualCountEditDialogInfo="Adjust the number of items you scanned.",this.manualCountEditDialogUpdateButton="Update",this.manualCountEditDialogCancelButton="Cancel",this.sheetResetButton="Reset",this.sheetClearAllButton="Clear all",this.sheetSubmitButton="Submit",this.sheetStartScanningButton="Start scanning",this.sheetPlaceholderTitle="No barcodes here!",this.sheetPlaceholderSubtitle="The barcode list is currently empty. Close this sheet and scan your items to add them.",this.singleModeConfirmationCancelButton="Close",this.multipleModeSheetTitle="%d items",this.findAndPickSheetTitle="%d/%d scanned",this.findAndPickSheetBarcodeItemSubtitle="%d/%d added",this.findAndPickPartialAlertTitle="Incomplete scan!",this.findAndPickPartialAlertSubtitle="Some codes are yet to be scanned. Proceed with submission anyway?",this.findAndPickPartialAlertCancelButton="Cancel",this.findAndPickPartialAlertSubmitButton="Yes, Submit",this.findAndPickCompleteAlertTitle="All codes found!",this.findAndPickCompleteAlertSubtitle="You have successfully scanned all codes. Proceed with submission?",this.findAndPickCompleteAlertCancelButton="Dismiss",this.findAndPickCompleteAlertSubmitButton="Submit",void 0!==t.cameraPermissionEnableCameraTitle&&(this.cameraPermissionEnableCameraTitle=t.cameraPermissionEnableCameraTitle),void 0!==t.cameraPermissionEnableCameraExplanation&&(this.cameraPermissionEnableCameraExplanation=t.cameraPermissionEnableCameraExplanation),void 0!==t.cameraPermissionCloseButton&&(this.cameraPermissionCloseButton=t.cameraPermissionCloseButton),void 0!==t.topBarCancelButton&&(this.topBarCancelButton=t.topBarCancelButton),void 0!==t.topBarTitle&&(this.topBarTitle=t.topBarTitle),void 0!==t.userGuidance&&(this.userGuidance=t.userGuidance),void 0!==t.barcodeInfoMappingLoadingMessage&&(this.barcodeInfoMappingLoadingMessage=t.barcodeInfoMappingLoadingMessage),void 0!==t.barcodeInfoMappingErrorStateTitle&&(this.barcodeInfoMappingErrorStateTitle=t.barcodeInfoMappingErrorStateTitle),void 0!==t.barcodeInfoMappingErrorStateSubtitle&&(this.barcodeInfoMappingErrorStateSubtitle=t.barcodeInfoMappingErrorStateSubtitle),void 0!==t.barcodeInfoMappingErrorStateRetryButton&&(this.barcodeInfoMappingErrorStateRetryButton=t.barcodeInfoMappingErrorStateRetryButton),void 0!==t.barcodeInfoMappingErrorStateCancelButton&&(this.barcodeInfoMappingErrorStateCancelButton=t.barcodeInfoMappingErrorStateCancelButton),void 0!==t.manualCountEditDialogTitle&&(this.manualCountEditDialogTitle=t.manualCountEditDialogTitle),void 0!==t.manualCountEditDialogInfo&&(this.manualCountEditDialogInfo=t.manualCountEditDialogInfo),void 0!==t.manualCountEditDialogUpdateButton&&(this.manualCountEditDialogUpdateButton=t.manualCountEditDialogUpdateButton),void 0!==t.manualCountEditDialogCancelButton&&(this.manualCountEditDialogCancelButton=t.manualCountEditDialogCancelButton),void 0!==t.sheetResetButton&&(this.sheetResetButton=t.sheetResetButton),void 0!==t.sheetClearAllButton&&(this.sheetClearAllButton=t.sheetClearAllButton),void 0!==t.sheetSubmitButton&&(this.sheetSubmitButton=t.sheetSubmitButton),void 0!==t.sheetStartScanningButton&&(this.sheetStartScanningButton=t.sheetStartScanningButton),void 0!==t.sheetPlaceholderTitle&&(this.sheetPlaceholderTitle=t.sheetPlaceholderTitle),void 0!==t.sheetPlaceholderSubtitle&&(this.sheetPlaceholderSubtitle=t.sheetPlaceholderSubtitle),void 0!==t.singleModeConfirmationCancelButton&&(this.singleModeConfirmationCancelButton=t.singleModeConfirmationCancelButton),void 0!==t.multipleModeSheetTitle&&(this.multipleModeSheetTitle=t.multipleModeSheetTitle),void 0!==t.findAndPickSheetTitle&&(this.findAndPickSheetTitle=t.findAndPickSheetTitle),void 0!==t.findAndPickSheetBarcodeItemSubtitle&&(this.findAndPickSheetBarcodeItemSubtitle=t.findAndPickSheetBarcodeItemSubtitle),void 0!==t.findAndPickPartialAlertTitle&&(this.findAndPickPartialAlertTitle=t.findAndPickPartialAlertTitle),void 0!==t.findAndPickPartialAlertSubtitle&&(this.findAndPickPartialAlertSubtitle=t.findAndPickPartialAlertSubtitle),void 0!==t.findAndPickPartialAlertCancelButton&&(this.findAndPickPartialAlertCancelButton=t.findAndPickPartialAlertCancelButton),void 0!==t.findAndPickPartialAlertSubmitButton&&(this.findAndPickPartialAlertSubmitButton=t.findAndPickPartialAlertSubmitButton),void 0!==t.findAndPickCompleteAlertTitle&&(this.findAndPickCompleteAlertTitle=t.findAndPickCompleteAlertTitle),void 0!==t.findAndPickCompleteAlertSubtitle&&(this.findAndPickCompleteAlertSubtitle=t.findAndPickCompleteAlertSubtitle),void 0!==t.findAndPickCompleteAlertCancelButton&&(this.findAndPickCompleteAlertCancelButton=t.findAndPickCompleteAlertCancelButton),void 0!==t.findAndPickCompleteAlertSubmitButton&&(this.findAndPickCompleteAlertSubmitButton=t.findAndPickCompleteAlertSubmitButton)}}class k extends r.a{constructor(t={}){super(),this.barcodesRegexFilter="",this.barcodeFormats=[],this.gs1Handling="PARSE",this.engineMode="NEXT_GEN_LOW_POWER",this.maximumRecognizerResolution=600,void 0!==t.barcodesRegexFilter&&(this.barcodesRegexFilter=t.barcodesRegexFilter),void 0!==t.barcodeFormats&&(this.barcodeFormats=t.barcodeFormats.map((t=>t))),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling),void 0!==t.engineMode&&(this.engineMode=t.engineMode),void 0!==t.maximumRecognizerResolution&&(this.maximumRecognizerResolution=t.maximumRecognizerResolution)}}class D extends r.a{constructor(t={}){super(),this.background="?sbColorSurface",this.iconBackground="?sbColorOutline",this.icon=new i.e({visible:!0,color:"?sbColorOnSurface"}),this.closeButton=new i.c({text:"Close",background:new i.a({}),foreground:new i.d({})}),this.enableCameraTitle=new i.j({text:"Camera permission denied!",color:"?colorOnSurface"}),this.enableCameraExplanation=new i.j({text:"Please allow the usage of the camera to start the scanning process.",color:"?sbColorOnSurfaceVariant"}),void 0!==t.background&&(this.background=t.background),void 0!==t.iconBackground&&(this.iconBackground=t.iconBackground),void 0!==t.icon&&(this.icon=new i.e(t.icon)),void 0!==t.closeButton&&(this.closeButton=new i.c(t.closeButton)),void 0!==t.enableCameraTitle&&(this.enableCameraTitle=new i.j(t.enableCameraTitle)),void 0!==t.enableCameraExplanation&&(this.enableCameraExplanation=new i.j(t.enableCameraExplanation))}}class P extends r.a{constructor(t={}){super(),this.version="1.0",this.screen="BarcodeScanner",this.palette=new i.f({sbColorPrimary:"#C8193C",sbColorPrimaryDisabled:"#F5F5F5",sbColorNegative:"#FF3737",sbColorPositive:"#4EFFB4",sbColorWarning:"#FFCE5C",sbColorSecondary:"#FFEDEE",sbColorSecondaryDisabled:"#F5F5F5",sbColorOnPrimary:"#FFFFFF",sbColorOnSecondary:"#C8193C",sbColorSurface:"#FFFFFF",sbColorOutline:"#EFEFEF",sbColorOnSurfaceVariant:"#707070",sbColorOnSurface:"#000000",sbColorSurfaceLow:"#00000026",sbColorSurfaceHigh:"#0000007A",sbColorModalOverlay:"#000000A3"}),this.localization=new T({}),this.backgroundColor="?sbColorSurfaceLow",this.topBar=new f.a({title:new i.j({text:"?topBarTitle",color:"?sbColorOnPrimary"}),mode:"SOLID",backgroundColor:"?sbColorPrimary",cancelButton:new i.c({visible:!0,text:"?topBarCancelButton",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new i.d({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})})}),this.actionBar=new p({flashButton:new i.h({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorWarning",activeForegroundColor:"#1C1B1F"}),zoomButton:new i.h({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"}),flipCameraButton:new i.h({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"})}),this.viewFinder=new E({visible:!0,style:new L({strokeColor:"?sbColorSurface",strokeWidth:2,cornerRadius:10}),overlayColor:"?sbColorSurfaceLow",aspectRatio:new x.AspectRatio({width:1,height:1})}),this.userGuidance=new O({visible:!0,title:new i.j({text:"?userGuidance",color:"?sbColorOnPrimary"}),background:new i.a({strokeColor:"#00000000",fillColor:"?sbColorSurfaceLow",strokeWidth:0})}),this.cameraPermission=new D({background:"?sbColorSurface",iconBackground:"?sbColorOutline",icon:new i.e({visible:!0,color:"?sbColorOnSurface"}),closeButton:new i.c({visible:!0,text:"?cameraPermissionCloseButton",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new i.d({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})}),enableCameraTitle:new i.j({text:"?cameraPermissionEnableCameraTitle",color:"?sbColorOnSurface"}),enableCameraExplanation:new i.j({text:"?cameraPermissionEnableCameraExplanation",color:"?sbColorOnSurfaceVariant"})}),this.cameraConfiguration=new d({}),this.recognizerConfiguration=new k({}),this.useCase=new c({}),this.sound=new i.i({successBeepEnabled:!0,soundType:"MODERN_BEEP"}),this.vibration=new i.l({enabled:!0}),this.timeouts=new i.k({autoCancelTimeout:0,initialScanDelay:0}),void 0!==t.version&&(this.version=t.version),void 0!==t.screen&&(this.screen=t.screen),void 0!==t.palette&&(this.palette=new i.f(t.palette)),void 0!==t.localization&&(this.localization=new T(t.localization)),void 0!==t.backgroundColor&&(this.backgroundColor=t.backgroundColor),void 0!==t.topBar&&(this.topBar=new f.a(t.topBar)),void 0!==t.actionBar&&(this.actionBar=new p(t.actionBar)),void 0!==t.viewFinder&&(this.viewFinder=new E(t.viewFinder)),void 0!==t.userGuidance&&(this.userGuidance=new O(t.userGuidance)),void 0!==t.cameraPermission&&(this.cameraPermission=new D(t.cameraPermission)),void 0!==t.cameraConfiguration&&(this.cameraConfiguration=new d(t.cameraConfiguration)),void 0!==t.recognizerConfiguration&&(this.recognizerConfiguration=new k(t.recognizerConfiguration)),void 0!==t.useCase&&(this.useCase=h.From(t.useCase)),void 0!==t.sound&&(this.sound=new i.i(t.sound)),void 0!==t.vibration&&(this.vibration=new i.l(t.vibration)),void 0!==t.timeouts&&(this.timeouts=new i.k(t.timeouts))}}var B=n(34);class F extends r.a{constructor(t={}){if(super(),void 0===t.barcode)throw new Error("barcode must be present in constructor argument");if(this.barcode=new B.BarcodeItem(t.barcode),void 0===t.count)throw new Error("count must be present in constructor argument");this.count=t.count}}class R extends r.a{constructor(t={}){super(),this.items=[],void 0!==t.items&&(this.items=t.items.map((t=>new F(t))))}}var I=n(19)},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var o=n(36);class i extends o.a{constructor(t){super(),this.mirrored=!1,this.spinnerColor="black",this.backgroundColor="black",this.videoConstraints={width:{ideal:t.width},height:{ideal:t.height},facingMode:"environment",resizeMode:"none",experimental:{focusMode:"continous",focusDistance:0}}}static mapVideoConstraints(t,e){t.videoConstraints&&this.mapValues(t.videoConstraints,e.videoConstraints)}}i.DEFAULT_VIDEO_RESOLUTION_4K={width:3840,height:2160},i.DEFAULT_VIDEO_RESOLUTION_HD={width:1920,height:1080},i.DEFAULT_ACCEPTED_BRIGHTNESS_SCORE=0,i.DEFAULT_ACCEPTED_ANGLE_SCORE=75,i.DEFAULT_ACCEPTED_SIZE_SCORE=75},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var o=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class i extends Error{constructor(t,e,n){super(e),this.name="",this.name=t,this.message=e,this.webApiError=n}static mediaDevicesUndefined(){return new i(this.MESSAGE.DEVICES_UNDEFINED,"Does your device even have a camera? If so, please use a secure context (HTTPS) or use 'localhost' explicitly.")}static enumerateDevicesFailed(){return new i(this.MESSAGE.DEVICES_UNDEFINED,"Does your device even have a camera? Because we're unable to query query navigator.mediaDevices?.enumerateDevices")}static mediaDeviceNotFound(t){return new i(this.MESSAGE.ENUMERATE_FAILED,"Does your device even have a camera? Because we were unable to query navigator.mediaDevices?.getUserMedia().",t)}static permissionDenied(t){return new i(this.MESSAGE.PERMISSION_DENIED,"Camera permission has not been granted. Please prompt your users again to grant permission.",t)}static unknown(t){return new i(this.MESSAGE.UNKNOWN,"\n Unfortunately we were unable to query navigator.mediaDevicess.getUserMedia, \n and unable to determine the reason why. This may be caused by the user to denied the permission prompt. \n Or you may be using an in-app browser that itself has not been granted permission to use the camera.\n Or your users may be using a niche browser that does not support the media API at all!\n ",t)}static tryCheckPermission(){return o(this,void 0,void 0,(function*(){if(!this.permissionState)try{const t=yield navigator.permissions.query({name:"camera"});this.permissionState=t.state}catch(t){this.permissionState=this.PERMISSION_STATE.UNKNOWN}}))}static hasDeniedPermission(){return this.permissionState===this.PERMISSION_STATE.DENIED}static hasCheckedPermission(){return!!this.permissionState}static createFromDOMException(t){return t instanceof DOMException?"NotAllowedError"===t.name?i.permissionDenied("Specifically, the native 'NotAllowedError' was thrown."):"NotFoundError"===t.name?i.mediaDeviceNotFound("Specifically, the native 'NotFoundError' was thrown."):void 0:i.unknown(null==t?void 0:t.message)}}i.PERMISSION_STATE={GRANTED:"granted",DENIED:"denied",PROMPT:"prompt",UNKNOWN:"unknown"},i.MESSAGE={DEVICES_UNDEFINED:"MediaError_DevicesUndefined",DEVICE_NOT_FOUND:"MediaError_DeviceNotFound",ENUMERATE_FAILED:"MediaError_EnumerateFailed",PERMISSION_DENIED:"MediaError_PermissionDenied",UNKNOWN:"MediaError_Unknown"}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));class o{static initialize(t=!1){this.verbose=t}static debug(t){this.verbose&&console.log("ScanbotSDK:",t)}static debugWarn(t){this.verbose&&console.warn("ScanbotSDK:",t)}}},,,function(t,e,n){"use strict";n.r(e),n.d(e,"OcrResult",(function(){return i})),n.d(e,"FieldParsedData",(function(){return r})),n.d(e,"FieldType",(function(){return a})),n.d(e,"Field",(function(){return s})),n.d(e,"GenericDocumentType",(function(){return l})),n.d(e,"GenericDocument",(function(){return c}));var o=n(4);class i extends o.a{constructor(t={}){if(super(),void 0===t.text)throw new Error("text must be present in constructor argument");if(this.text=t.text,void 0===t.confidence)throw new Error("confidence must be present in constructor argument");this.confidence=t.confidence}}class r extends o.a{constructor(t={}){if(super(),void 0===t.type)throw new Error("type must be present in constructor argument");if(this.type=t.type,void 0===t.value)throw new Error("value must be present in constructor argument");this.value=t.value}}class a extends o.a{constructor(t={}){if(super(),void 0===t.name)throw new Error("name must be present in constructor argument");if(this.name=t.name,void 0===t.fullName)throw new Error("fullName must be present in constructor argument");if(this.fullName=t.fullName,void 0===t.normalizedName)throw new Error("normalizedName must be present in constructor argument");if(this.normalizedName=t.normalizedName,void 0===t.commonType)throw new Error("commonType must be present in constructor argument");this.commonType=null!=t.commonType?t.commonType:null}}class s extends o.a{constructor(t={}){if(super(),this.confidenceWeight=1,this.image=null,this.validationStatus="NONE",this.parsedData=[],void 0===t.type)throw new Error("type must be present in constructor argument");if(this.type=new a(t.type),void 0===t.value)throw new Error("value must be present in constructor argument");if(this.value=null!=t.value?new i(t.value):null,void 0!==t.confidenceWeight&&(this.confidenceWeight=t.confidenceWeight),void 0!==t.image&&(this.image=null!=t.image?t.image:null),void 0===t.polygonInRoot)throw new Error("polygonInRoot must be present in constructor argument");this.polygonInRoot=t.polygonInRoot.map((t=>({x:t.x,y:t.y}))),void 0!==t.validationStatus&&(this.validationStatus=t.validationStatus),void 0!==t.parsedData&&(this.parsedData=t.parsedData.map((t=>new r(t))))}}class l extends o.a{constructor(t={}){if(super(),void 0===t.name)throw new Error("name must be present in constructor argument");if(this.name=t.name,void 0===t.fullName)throw new Error("fullName must be present in constructor argument");if(this.fullName=t.fullName,void 0===t.normalizedName)throw new Error("normalizedName must be present in constructor argument");this.normalizedName=t.normalizedName}}class c extends o.a{constructor(t={}){if(super(),this.crop=null,this.confidence=0,this.confidenceWeight=0,void 0===t.type)throw new Error("type must be present in constructor argument");if(this.type=new l(t.type),void 0===t.fields)throw new Error("fields must be present in constructor argument");if(this.fields=t.fields.map((t=>new s(t))),void 0===t.children)throw new Error("children must be present in constructor argument");if(this.children=t.children.map((t=>new c(t))),void 0===t.quad)throw new Error("quad must be present in constructor argument");if(this.quad=null!=t.quad?t.quad.map((t=>({x:t.x,y:t.y}))):null,void 0===t.quadInRoot)throw new Error("quadInRoot must be present in constructor argument");this.quadInRoot=null!=t.quadInRoot?t.quadInRoot.map((t=>({x:t.x,y:t.y}))):null,void 0!==t.crop&&(this.crop=null!=t.crop?t.crop:null),void 0!==t.confidence&&(this.confidence=t.confidence),void 0!==t.confidenceWeight&&(this.confidenceWeight=t.confidenceWeight)}}},function(t,e,n){"use strict";n.r(e),n.d(e,"LineSegmentInt",(function(){return i})),n.d(e,"LineSegmentFloat",(function(){return r})),n.d(e,"AspectRatio",(function(){return a}));var o=n(4);class i extends o.a{constructor(t={}){if(super(),void 0===t.start)throw new Error("start must be present in constructor argument");if(this.start={x:t.start.x,y:t.start.y},void 0===t.end)throw new Error("end must be present in constructor argument");this.end={x:t.end.x,y:t.end.y}}}class r extends o.a{constructor(t={}){if(super(),void 0===t.start)throw new Error("start must be present in constructor argument");if(this.start={x:t.start.x,y:t.start.y},void 0===t.end)throw new Error("end must be present in constructor argument");this.end={x:t.end.x,y:t.end.y}}}class a extends o.a{constructor(t={}){super(),this.width=1,this.height=1,void 0!==t.width&&(this.width=t.width),void 0!==t.height&&(this.height=t.height)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));class o{constructor(t,e,n,o){this.x=t,this.y=e,this.width=n,this.height=o}scaleDown(t){return new o(this.x/t,this.y/t,this.width/t,this.height/t)}bottom(){return this.y+this.height}static withSize(t,e){return new o(0,0,t,e)}static empty(){return new o(0,0,0,0)}static fromRect(t){return t?new o(t.x,t.y,t.width,t.height):o.empty()}static fromPoint(t,e){return new o(t.x-e/2,t.y-e/2,e,e)}static fromDOMRect(t){return new o(t.x,t.y,t.width,t.height)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var o=n(14),i=n(13);class r extends o.a{constructor(t){super(t);const e=new i.BarcodeScannerConfiguration;this.finder=e.viewFinder,this.userGuidance=e.userGuidance}static mapFinderConfiguration(t,e){var n,i;o.a.mapValuesDeep(null!==(n=e.finder)&&void 0!==n?n:{},t.finder),o.a.mapValuesDeep(null!==(i=e.userGuidance)&&void 0!==i?i:{},t.userGuidance)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return m}));var o=n(0),i=n(15),r=n(25),a=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class s extends o.default.Component{constructor(t){super(t),this.orientationchangeCallback=this.orientationChanged.bind(this),this.state={orientation:window.orientation,stream:void 0}}orientationChanged(t){this.setState({orientation:window.orientation})}setDeviceIdInConstraints(t){var e,n;return a(this,void 0,void 0,(function*(){const o=this.props.preferredCamera;if(o)try{const e=(yield navigator.mediaDevices.enumerateDevices()).find((t=>t.deviceId===o||t.label===o));if(e)return Object.assign(Object.assign({},t),{deviceId:e.deviceId})}catch(t){throw i.a.enumerateDevicesFailed()}else{const o={user:"front",environment:"back"},i=(null===(e=null==t?void 0:t.facingMode)||void 0===e?void 0:e.ideal)||(null===(n=null==t?void 0:t.facingMode)||void 0===n?void 0:n.exact)||(null==t?void 0:t.facingMode);if("string"==typeof i&&i in o){yield r.a.INSTANCE.load();const e=r.a.INSTANCE.getMainCamera(o[i]);if(e)return Object.assign(Object.assign({},t),{deviceId:e.deviceId})}}return t}))}componentDidMount(){return a(this,void 0,void 0,(function*(){window.addEventListener("orientationchange",this.orientationchangeCallback),yield this.refreshStream()}))}refreshStream(){var t,e,n,o,r,s,l,c;return a(this,void 0,void 0,(function*(){if(console.log("refreshStream",this),i.a.hasCheckedPermission()||(yield i.a.tryCheckPermission()),i.a.hasDeniedPermission())return void(null===(e=(t=this.props).onError)||void 0===e||e.call(t,i.a.permissionDenied()));const a={video:yield this.setDeviceIdInConstraints(this.props.videoConstraints)};try{if(!navigator.mediaDevices){const t=i.a.unknown();return null===(o=(n=this.props).onError)||void 0===o||o.call(n,t),void console.log(t)}this.stopCurrentStreams();try{const t=yield navigator.mediaDevices.getUserMedia(a);this.setState({stream:t},(()=>{var e,n,o,i;null===(n=(e=this.props).onStreamChanged)||void 0===n||n.call(e,t),null===(i=(o=this.props).onReady)||void 0===i||i.call(o)}))}catch(t){const e=i.a.mediaDeviceNotFound();return null===(s=(r=this.props).onError)||void 0===s||s.call(r,e),void console.error(e)}}catch(t){const e=i.a.createFromDOMException(t);return null===(c=(l=this.props).onError)||void 0===c||c.call(l,e),void console.error(e)}}))}stopCurrentStreams(){const t=this.state.stream,e=null==t?void 0:t.getTracks();e&&e.forEach((t=>{t.stop()}))}componentWillUnmount(){window.removeEventListener("orientationchange",this.orientationchangeCallback),this.state.stream&&(this.state.stream.getVideoTracks&&this.state.stream.getAudioTracks&&(this.state.stream.getVideoTracks().forEach((t=>t.stop())),this.state.stream.getAudioTracks().forEach((t=>t.stop()))),this.setState({stream:void 0}))}render(){return this.props.children}updateTorch(t){return a(this,void 0,void 0,(function*(){const e=[{torch:t}];yield this.state.stream.getVideoTracks()[0].applyConstraints({advanced:e})}))}getCapabilities(){if(this.state.stream.getVideoTracks){const t=this.getVideoTrack();return s.getMediaTrackCapabilities(t)}}static getMediaTrackCapabilities(t){if(t&&t.getCapabilities)return t.getCapabilities()}getVideoTrack(){const t=this.state.stream.getVideoTracks();if(t.length>0)return t[0]}}var l=n(10),c=n(21),u=n(16),d=n(35);class h{static isSupported(){return!!document.createElement("canvas").getContext("webgl")}constructor(){this._type="WebGL",this.canvas=document.createElement("canvas");const t=this.gl=this.canvas.getContext("webgl",{willReadFrequently:!0}),e=t.createTexture();t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR);const n=t.createShader(t.VERTEX_SHADER);t.shaderSource(n,"attribute vec2 p;void main(){ gl_Position = vec4(p,0,1);}"),t.compileShader(n);const o=t.createShader(t.FRAGMENT_SHADER);t.shaderSource(o,"precision mediump float;uniform sampler2D texture; uniform vec2 scale; uniform vec2 offset; void main() { gl_FragColor=texture2D( texture, gl_FragCoord.xy * scale + offset );}"),t.compileShader(o);const i=this.program=t.createProgram();t.attachShader(i,n),t.attachShader(i,o),t.linkProgram(i),t.useProgram(i),t.uniform1i(t.getUniformLocation(i,"texture"),0),t.bindBuffer(t.ARRAY_BUFFER,t.createBuffer()),t.bufferData(t.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]),t.STATIC_DRAW),t.enableVertexAttribArray(0),t.vertexAttribPointer(0,2,t.FLOAT,!1,0,0)}getImageData(t,e,n,o,i,r,a,s){let l,c;if(r=Math.floor(r),a=Math.floor(a),e=Math.floor(e),n=Math.floor(n),o=Math.floor(o),i=Math.floor(i),t instanceof HTMLVideoElement)[c,l]=[t.videoWidth,t.videoHeight];else{if(!(t instanceof HTMLCanvasElement))throw new Error("Unsupported source type");[c,l]=[t.width,t.height]}(c<e+o||l<n+i)&&u.a.debug("Crop region exceeds source video dimensions. This can happen when the screen is resized or rotated and the video has not yet changed its size. Most likely, the frame we analyzed now contains some garbage data. This is not a problem, unless it happens very frequently.");const h=this.gl;this.canvas.width=r,this.canvas.height=a,h.viewport(0,0,r,a);const f=[o/(r*c),i/(a*l)],p=[e/c,n/l];return h.uniform2fv(h.getUniformLocation(this.program,"scale"),f),h.uniform2fv(h.getUniformLocation(this.program,"offset"),p),h.texImage2D(h.TEXTURE_2D,0,h.RGB,h.RGB,h.UNSIGNED_BYTE,t),h.drawArrays(h.TRIANGLES,0,6),(null==s?void 0:s.byteLength)!==r*a*4&&(s=new Uint8ClampedArray(r*a*4),d.a.INSTANCE.values.set("WebGLNumBufferAllocations",(d.a.INSTANCE.values.get("WebGLNumBufferAllocations")||0)+1)),h.readPixels(0,0,r,a,h.RGBA,h.UNSIGNED_BYTE,s),new ImageData(s,r,a)}}class f{constructor(){this._type="TwoD",this.canvas=document.createElement("canvas"),this.ctx=this.canvas.getContext("2d",{willReadFrequently:!0,alpha:!1}),this.ctx.imageSmoothingEnabled=!1}getImageData(t,e,n,o,i,r,a,s){return this.canvas.width=r,this.canvas.height=a,this.ctx.drawImage(t,e,n,o,i,0,0,r,a),this.ctx.getImageData(0,0,r,a)}}var p=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class m extends o.default.Component{constructor(t){super(t),this.videoLoaded=!1,this.reloadCanvas=!0,this.swapCameraEnabled=!0,this.activeCamera=void 0,this.save=!1,this._reusableImageBuffer=null,this.onStreamChanged=t=>{this.video.srcObject=t,this.updateCameraInfo(t),this.video.addEventListener("resize",(t=>{this.reloadCanvas=!0}),!1),this.video.addEventListener("loadeddata",(t=>{this.videoLoaded=!0,this.didLoadVideo&&this.didLoadVideo()}),!1)},this.state={facingModeBack:"environment"===this.props.videoConstraints.facingMode,mirrored:this.props.mirrored,deviceId:void 0}}videoSize(){const{clientVideoWidth:t,clientVideoHeight:e}=this.calculateClientVideoConstraints();return new l.a(t,e)}saveExtractedData(){this.save=!0}zoom(){var t;return null!==(t=this.props.zoom)&&void 0!==t?t:1}imageCapture(){if(this.capture)return this.capture;const t=this.videoStream.getVideoTrack();return this.capture=new ImageCapture(t),this.capture}set reusableImageBuffer(t){this._reusableImageBuffer=t}createImageData(t=0,e){return p(this,void 0,void 0,(function*(){if(!this.video||!this.videoLoaded)return;const n=this.getCanvasRenderingContext();if(!n)return;if(e){const t=yield this.imageCapture().takePhoto(),e=yield createImageBitmap(t);u.a.debug("Bitmap size: "+e.width*e.height);const o=this.windowSize(),i=e.height/(o.height+o.y),r=o.width*i,a=o.height*i,s=e.width/2-r/2,l=o.y*i,d=new c.a(s,l,r,a);return u.a.debug("Frame size: "+d.x+"-"+d.y+"-"+d.width+"-"+d.height),n.getImageData(this.video,d.x,d.y,e.width,e.height,d.width,d.height,this._reusableImageBuffer)}let{videoWidth:o,videoHeight:i}=this.video,{clientVideoWidth:r,clientVideoHeight:a,coef:s}=this.calculateClientVideoConstraints();if(0===s)return;const l=this.finderFrame||new c.a(0,0,r,a),d=this.zoom(),h=(o-r/d)/2,f=(i-a/d)/2,p=l.x/s+h,m=l.y/s+f,g=this.finderFrame?s:d,v=l.width/g,A=l.height/g,b=this.calculateFrameSize(t,v,A);return n.getImageData(this.video,p,m,v,A,b.width,b.height,this._reusableImageBuffer)}))}windowSize(){var t;const e=this.props.configuration,n=null!==(t=e.container)&&void 0!==t?t:document.getElementById(e.containerId);if(!n)throw new Error("Container DOM element is required to calculate window size and snap image.");return c.a.fromDOMRect(n.getBoundingClientRect())}calculateClientVideoConstraints(){let{videoWidth:t,videoHeight:e}=this.video,n=this.video.getBoundingClientRect(),o=t,i=e,r=1;return n.width/n.height<=t/e?(r=n.height/e,r>0&&(o=n.width/r)):(r=n.width/t,r>0&&(i=n.height/r)),{clientVideoWidth:o,clientVideoHeight:i,coef:r}}calculateFrameSize(t,e,n){let o=e,i=n;if(t>0&&0!=e&&0!=n){const r=e/n;e>n?(o=e>t?t:e,i=o/r):(i=n>t?t:n,o=i*r)}return new l.a(o,i)}getCanvasRenderingContext(){return this.video?0===this.video.videoWidth?null:(this.canvas&&!this.reloadCanvas||(this.canvas&&this.releaseCanvas(),this.canvas=h.isSupported()?new h:new f,this.reloadCanvas=!1),this.canvas):null}releaseCanvas(){this.canvas&&(this.canvas=null)}componentWillUnmount(){this.releaseCanvas(),this.video=null,this.videoStream=null}style(){var t;const e={display:"block",width:100*this.zoom()+"%",height:100*this.zoom()+"%",left:`${this.zoomMargin()}%`,top:`${this.zoomMargin()}%`,position:"relative",objectFit:"cover",backgroundColor:null===(t=this.props.configuration)||void 0===t?void 0:t.backgroundColor};return this.state.mirrored&&(e.transform="scaleX(-1)"),e}zoomMargin(){const t=this.zoom();return 1===t?0:(1-t)/2*100}render(){const{videoConstraints:t,onReady:e,onError:n}=this.props;return o.default.createElement(s,{videoConstraints:t,preferredCamera:this.state.deviceId||this.props.preferredCamera,onReady:e,onStreamChanged:this.onStreamChanged,onError:n,ref:t=>{this.videoStream=t}},o.default.createElement("video",{autoPlay:!0,muted:!0,playsInline:!0,className:"scanbot-camera-view",ref:t=>{this.video=t},style:this.style()}))}setDirection(t){this.props.videoConstraints.facingMode={ideal:t},this.setState({facingModeBack:"environment"===t,mirrored:"user"===t},(()=>p(this,void 0,void 0,(function*(){yield this.videoStream.refreshStream(),this.swapCameraEnabled=!0}))))}swapCameraFacing(t){if(this.swapCameraEnabled){this.swapCameraEnabled=!1;const e=!this.state.facingModeBack,n=e?"environment":"user";this.props.videoConstraints.facingMode=!0===t?{exact:n}:{ideal:n},this.setState({facingModeBack:e,mirrored:!e},(()=>p(this,void 0,void 0,(function*(){yield this.videoStream.refreshStream(),this.swapCameraEnabled=!0}))))}}switchCamera(t,e){return p(this,void 0,void 0,(function*(){this.swapCameraEnabled&&(this.swapCameraEnabled=!1,this.props.videoConstraints.facingMode=void 0,this.setState({facingModeBack:void 0,mirrored:null!=e?e:this.state.mirrored,deviceId:t},(()=>p(this,void 0,void 0,(function*(){yield this.videoStream.refreshStream(),this.swapCameraEnabled=!0})))))}))}updateCameraInfo(t){this.activeCamera=r.a.getCameraInfoFromStream(t)}getActiveCameraInfo(){return this.activeCamera}setTorchState(t){if(this.activeCamera&&this.activeCamera.supportsTorchControl){return this.videoStream.getVideoTrack().applyConstraints({advanced:[{torch:t}]})}return Promise.reject("Torch is not supported for current camera.")}}},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return Qt})),n.d(e,"b",(function(){return Yt}));var o=n(2),i=(n(46),n(0)),r=n(44),a=n.n(r),s=n(28),l=n(45),c="undefined"!=typeof t&&void 0!==t.env&&(t.env.REACT_APP_SC_ATTR||t.env.SC_ATTR)||"data-styled",u="active",d="data-styled-version",h="6.1.8",f="/*!sc*/\n",p="undefined"!=typeof window&&"HTMLElement"in window,m=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof t&&void 0!==t.env&&void 0!==t.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==t.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==t.env.REACT_APP_SC_DISABLE_SPEEDY&&t.env.REACT_APP_SC_DISABLE_SPEEDY:"undefined"!=typeof t&&void 0!==t.env&&void 0!==t.env.SC_DISABLE_SPEEDY&&""!==t.env.SC_DISABLE_SPEEDY&&("false"!==t.env.SC_DISABLE_SPEEDY&&t.env.SC_DISABLE_SPEEDY)),g=(new Set,Object.freeze([])),v=Object.freeze({});function A(t,e,n){return void 0===n&&(n=v),t.theme!==n.theme&&t.theme||e||n.theme}var b=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),y=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,C=/(^-|-$)/g;function S(t){return t.replace(y,"-").replace(C,"")}var w=/(a)(d)/gi,x=function(t){return String.fromCharCode(t+(t>25?39:97))};function E(t){var e,n="";for(e=Math.abs(t);e>52;e=e/52|0)n=x(e%52)+n;return(x(e%52)+n).replace(w,"$1-$2")}var L,_=function(t,e){for(var n=e.length;n;)t=33*t^e.charCodeAt(--n);return t},O=function(t){return _(5381,t)};function T(t){return E(O(t)>>>0)}function k(t){return t.displayName||t.name||"Component"}function D(t){return"string"==typeof t&&!0}var P="function"==typeof Symbol&&Symbol.for,B=P?Symbol.for("react.memo"):60115,F=P?Symbol.for("react.forward_ref"):60112,R={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},I={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},W={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},M=((L={})[F]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},L[B]=W,L);function j(t){return("type"in(e=t)&&e.type.$$typeof)===B?W:"$$typeof"in t?M[t.$$typeof]:R;var e}var z=Object.defineProperty,N=Object.getOwnPropertyNames,V=Object.getOwnPropertySymbols,U=Object.getOwnPropertyDescriptor,H=Object.getPrototypeOf,G=Object.prototype;function Q(t,e,n){if("string"!=typeof e){if(G){var o=H(e);o&&o!==G&&Q(t,o,n)}var i=N(e);V&&(i=i.concat(V(e)));for(var r=j(t),a=j(e),s=0;s<i.length;++s){var l=i[s];if(!(l in I||n&&n[l]||a&&l in a||r&&l in r)){var c=U(e,l);try{z(t,l,c)}catch(t){}}}}return t}function Y(t){return"function"==typeof t}function Z(t){return"object"==typeof t&&"styledComponentId"in t}function q(t,e){return t&&e?"".concat(t," ").concat(e):t||e||""}function X(t,e){if(0===t.length)return"";for(var n=t[0],o=1;o<t.length;o++)n+=e?e+t[o]:t[o];return n}function $(t){return null!==t&&"object"==typeof t&&t.constructor.name===Object.name&&!("props"in t&&t.$$typeof)}function K(t,e,n){if(void 0===n&&(n=!1),!n&&!$(t)&&!Array.isArray(t))return e;if(Array.isArray(e))for(var o=0;o<e.length;o++)t[o]=K(t[o],e[o]);else if($(e))for(var o in e)t[o]=K(t[o],e[o]);return t}function J(t,e){Object.defineProperty(t,"toString",{value:e})}function tt(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(t," for more information.").concat(e.length>0?" Args: ".concat(e.join(", ")):""))}var et=function(){function t(t){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=t}return t.prototype.indexOfGroup=function(t){for(var e=0,n=0;n<t;n++)e+=this.groupSizes[n];return e},t.prototype.insertRules=function(t,e){if(t>=this.groupSizes.length){for(var n=this.groupSizes,o=n.length,i=o;t>=i;)if((i<<=1)<0)throw tt(16,"".concat(t));this.groupSizes=new Uint32Array(i),this.groupSizes.set(n),this.length=i;for(var r=o;r<i;r++)this.groupSizes[r]=0}for(var a=this.indexOfGroup(t+1),s=(r=0,e.length);r<s;r++)this.tag.insertRule(a,e[r])&&(this.groupSizes[t]++,a++)},t.prototype.clearGroup=function(t){if(t<this.length){var e=this.groupSizes[t],n=this.indexOfGroup(t),o=n+e;this.groupSizes[t]=0;for(var i=n;i<o;i++)this.tag.deleteRule(n)}},t.prototype.getGroup=function(t){var e="";if(t>=this.length||0===this.groupSizes[t])return e;for(var n=this.groupSizes[t],o=this.indexOfGroup(t),i=o+n,r=o;r<i;r++)e+="".concat(this.tag.getRule(r)).concat(f);return e},t}(),nt=new Map,ot=new Map,it=1,rt=function(t){if(nt.has(t))return nt.get(t);for(;ot.has(it);)it++;var e=it++;return nt.set(t,e),ot.set(e,t),e},at=function(t,e){it=e+1,nt.set(t,e),ot.set(e,t)},st="style[".concat(c,"][").concat(d,'="').concat(h,'"]'),lt=new RegExp("^".concat(c,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),ct=function(t,e,n){for(var o,i=n.split(","),r=0,a=i.length;r<a;r++)(o=i[r])&&t.registerName(e,o)},ut=function(t,e){for(var n,o=(null!==(n=e.textContent)&&void 0!==n?n:"").split(f),i=[],r=0,a=o.length;r<a;r++){var s=o[r].trim();if(s){var l=s.match(lt);if(l){var c=0|parseInt(l[1],10),u=l[2];0!==c&&(at(u,c),ct(t,u,l[3]),t.getTag().insertRules(c,i)),i.length=0}else i.push(s)}}};function dt(){return n.nc}var ht=function(t){var e=document.head,n=t||e,o=document.createElement("style"),i=function(t){var e=Array.from(t.querySelectorAll("style[".concat(c,"]")));return e[e.length-1]}(n),r=void 0!==i?i.nextSibling:null;o.setAttribute(c,u),o.setAttribute(d,h);var a=dt();return a&&o.setAttribute("nonce",a),n.insertBefore(o,r),o},ft=function(){function t(t){this.element=ht(t),this.element.appendChild(document.createTextNode("")),this.sheet=function(t){if(t.sheet)return t.sheet;for(var e=document.styleSheets,n=0,o=e.length;n<o;n++){var i=e[n];if(i.ownerNode===t)return i}throw tt(17)}(this.element),this.length=0}return t.prototype.insertRule=function(t,e){try{return this.sheet.insertRule(e,t),this.length++,!0}catch(t){return!1}},t.prototype.deleteRule=function(t){this.sheet.deleteRule(t),this.length--},t.prototype.getRule=function(t){var e=this.sheet.cssRules[t];return e&&e.cssText?e.cssText:""},t}(),pt=function(){function t(t){this.element=ht(t),this.nodes=this.element.childNodes,this.length=0}return t.prototype.insertRule=function(t,e){if(t<=this.length&&t>=0){var n=document.createTextNode(e);return this.element.insertBefore(n,this.nodes[t]||null),this.length++,!0}return!1},t.prototype.deleteRule=function(t){this.element.removeChild(this.nodes[t]),this.length--},t.prototype.getRule=function(t){return t<this.length?this.nodes[t].textContent:""},t}(),mt=function(){function t(t){this.rules=[],this.length=0}return t.prototype.insertRule=function(t,e){return t<=this.length&&(this.rules.splice(t,0,e),this.length++,!0)},t.prototype.deleteRule=function(t){this.rules.splice(t,1),this.length--},t.prototype.getRule=function(t){return t<this.length?this.rules[t]:""},t}(),gt=p,vt={isServer:!p,useCSSOMInjection:!m},At=function(){function t(t,e,n){void 0===t&&(t=v),void 0===e&&(e={});var i=this;this.options=Object(o.a)(Object(o.a)({},vt),t),this.gs=e,this.names=new Map(n),this.server=!!t.isServer,!this.server&&p&&gt&&(gt=!1,function(t){for(var e=document.querySelectorAll(st),n=0,o=e.length;n<o;n++){var i=e[n];i&&i.getAttribute(c)!==u&&(ut(t,i),i.parentNode&&i.parentNode.removeChild(i))}}(this)),J(this,(function(){return function(t){for(var e=t.getTag(),n=e.length,o="",i=function(n){var i=function(t){return ot.get(t)}(n);if(void 0===i)return"continue";var r=t.names.get(i),a=e.getGroup(n);if(void 0===r||0===a.length)return"continue";var s="".concat(c,".g").concat(n,'[id="').concat(i,'"]'),l="";void 0!==r&&r.forEach((function(t){t.length>0&&(l+="".concat(t,","))})),o+="".concat(a).concat(s,'{content:"').concat(l,'"}').concat(f)},r=0;r<n;r++)i(r);return o}(i)}))}return t.registerId=function(t){return rt(t)},t.prototype.reconstructWithOptions=function(e,n){return void 0===n&&(n=!0),new t(Object(o.a)(Object(o.a)({},this.options),e),this.gs,n&&this.names||void 0)},t.prototype.allocateGSInstance=function(t){return this.gs[t]=(this.gs[t]||0)+1},t.prototype.getTag=function(){return this.tag||(this.tag=(t=function(t){var e=t.useCSSOMInjection,n=t.target;return t.isServer?new mt(n):e?new ft(n):new pt(n)}(this.options),new et(t)));var t},t.prototype.hasNameForId=function(t,e){return this.names.has(t)&&this.names.get(t).has(e)},t.prototype.registerName=function(t,e){if(rt(t),this.names.has(t))this.names.get(t).add(e);else{var n=new Set;n.add(e),this.names.set(t,n)}},t.prototype.insertRules=function(t,e,n){this.registerName(t,e),this.getTag().insertRules(rt(t),n)},t.prototype.clearNames=function(t){this.names.has(t)&&this.names.get(t).clear()},t.prototype.clearRules=function(t){this.getTag().clearGroup(rt(t)),this.clearNames(t)},t.prototype.clearTag=function(){this.tag=void 0},t}(),bt=/&/g,yt=/^\s*\/\/.*$/gm;function Ct(t,e){return t.map((function(t){return"rule"===t.type&&(t.value="".concat(e," ").concat(t.value),t.value=t.value.replaceAll(",",",".concat(e," ")),t.props=t.props.map((function(t){return"".concat(e," ").concat(t)}))),Array.isArray(t.children)&&"@keyframes"!==t.type&&(t.children=Ct(t.children,e)),t}))}function St(t){var e,n,o,i=void 0===t?v:t,r=i.options,a=void 0===r?v:r,l=i.plugins,c=void 0===l?g:l,u=function(t,o,i){return i.startsWith(n)&&i.endsWith(n)&&i.replaceAll(n,"").length>0?".".concat(e):t},d=c.slice();d.push((function(t){t.type===s.a&&t.value.includes("&")&&(t.props[0]=t.props[0].replace(bt,n).replace(o,u))})),a.prefix&&d.push(s.d),d.push(s.g);var h=function(t,i,r,l){void 0===i&&(i=""),void 0===r&&(r=""),void 0===l&&(l="&"),e=l,n=i,o=new RegExp("\\".concat(n,"\\b"),"g");var c=t.replace(yt,""),u=s.b(r||i?"".concat(r," ").concat(i," { ").concat(c," }"):c);a.namespace&&(u=Ct(u,a.namespace));var h=[];return s.f(u,s.c(d.concat(s.e((function(t){return h.push(t)}))))),h};return h.hash=c.length?c.reduce((function(t,e){return e.name||tt(15),_(t,e.name)}),5381).toString():"",h}var wt=new At,xt=St(),Et=i.default.createContext({shouldForwardProp:void 0,styleSheet:wt,stylis:xt}),Lt=(Et.Consumer,i.default.createContext(void 0));function _t(){return Object(i.useContext)(Et)}function Ot(t){var e=Object(i.useState)(t.stylisPlugins),n=e[0],o=e[1],r=_t().styleSheet,s=Object(i.useMemo)((function(){var e=r;return t.sheet?e=t.sheet:t.target&&(e=e.reconstructWithOptions({target:t.target},!1)),t.disableCSSOMInjection&&(e=e.reconstructWithOptions({useCSSOMInjection:!1})),e}),[t.disableCSSOMInjection,t.sheet,t.target,r]),l=Object(i.useMemo)((function(){return St({options:{namespace:t.namespace,prefix:t.enableVendorPrefixes},plugins:n})}),[t.enableVendorPrefixes,t.namespace,n]);Object(i.useEffect)((function(){a()(n,t.stylisPlugins)||o(t.stylisPlugins)}),[t.stylisPlugins]);var c=Object(i.useMemo)((function(){return{shouldForwardProp:t.shouldForwardProp,styleSheet:s,stylis:l}}),[t.shouldForwardProp,s,l]);return i.default.createElement(Et.Provider,{value:c},i.default.createElement(Lt.Provider,{value:l},t.children))}var Tt=function(){function t(t,e){var n=this;this.inject=function(t,e){void 0===e&&(e=xt);var o=n.name+e.hash;t.hasNameForId(n.id,o)||t.insertRules(n.id,o,e(n.rules,o,"@keyframes"))},this.name=t,this.id="sc-keyframes-".concat(t),this.rules=e,J(this,(function(){throw tt(12,String(n.name))}))}return t.prototype.getName=function(t){return void 0===t&&(t=xt),this.name+t.hash},t}(),kt=function(t){return t>="A"&&t<="Z"};function Dt(t){for(var e="",n=0;n<t.length;n++){var o=t[n];if(1===n&&"-"===o&&"-"===t[0])return t;kt(o)?e+="-"+o.toLowerCase():e+=o}return e.startsWith("ms-")?"-"+e:e}var Pt=function(t){return null==t||!1===t||""===t},Bt=function(t){var e,n,i=[];for(var r in t){var a=t[r];t.hasOwnProperty(r)&&!Pt(a)&&(Array.isArray(a)&&a.isCss||Y(a)?i.push("".concat(Dt(r),":"),a,";"):$(a)?i.push.apply(i,Object(o.e)(Object(o.e)(["".concat(r," {")],Bt(a),!1),["}"],!1)):i.push("".concat(Dt(r),": ").concat((e=r,null==(n=a)||"boolean"==typeof n||""===n?"":"number"!=typeof n||0===n||e in l.a||e.startsWith("--")?String(n).trim():"".concat(n,"px")),";")))}return i};function Ft(t,e,n,o){return Pt(t)?[]:Z(t)?[".".concat(t.styledComponentId)]:Y(t)?!Y(i=t)||i.prototype&&i.prototype.isReactComponent||!e?[t]:Ft(t(e),e,n,o):t instanceof Tt?n?(t.inject(n,o),[t.getName(o)]):[t]:$(t)?Bt(t):Array.isArray(t)?Array.prototype.concat.apply(g,t.map((function(t){return Ft(t,e,n,o)}))):[t.toString()];var i}function Rt(t){for(var e=0;e<t.length;e+=1){var n=t[e];if(Y(n)&&!Z(n))return!1}return!0}var It=O(h),Wt=function(){function t(t,e,n){this.rules=t,this.staticRulesId="",this.isStatic=(void 0===n||n.isStatic)&&Rt(t),this.componentId=e,this.baseHash=_(It,e),this.baseStyle=n,At.registerId(e)}return t.prototype.generateAndInjectStyles=function(t,e,n){var o=this.baseStyle?this.baseStyle.generateAndInjectStyles(t,e,n):"";if(this.isStatic&&!n.hash)if(this.staticRulesId&&e.hasNameForId(this.componentId,this.staticRulesId))o=q(o,this.staticRulesId);else{var i=X(Ft(this.rules,t,e,n)),r=E(_(this.baseHash,i)>>>0);if(!e.hasNameForId(this.componentId,r)){var a=n(i,".".concat(r),void 0,this.componentId);e.insertRules(this.componentId,r,a)}o=q(o,r),this.staticRulesId=r}else{for(var s=_(this.baseHash,n.hash),l="",c=0;c<this.rules.length;c++){var u=this.rules[c];if("string"==typeof u)l+=u;else if(u){var d=X(Ft(u,t,e,n));s=_(s,d+c),l+=d}}if(l){var h=E(s>>>0);e.hasNameForId(this.componentId,h)||e.insertRules(this.componentId,h,n(l,".".concat(h),void 0,this.componentId)),o=q(o,h)}}return o},t}(),Mt=i.default.createContext(void 0);Mt.Consumer;var jt={};new Set;function zt(t,e,n){var r=Z(t),a=t,s=!D(t),l=e.attrs,c=void 0===l?g:l,u=e.componentId,d=void 0===u?function(t,e){var n="string"!=typeof t?"sc":S(t);jt[n]=(jt[n]||0)+1;var o="".concat(n,"-").concat(T(h+n+jt[n]));return e?"".concat(e,"-").concat(o):o}(e.displayName,e.parentComponentId):u,f=e.displayName,p=void 0===f?function(t){return D(t)?"styled.".concat(t):"Styled(".concat(k(t),")")}(t):f,m=e.displayName&&e.componentId?"".concat(S(e.displayName),"-").concat(e.componentId):e.componentId||d,y=r&&a.attrs?a.attrs.concat(c).filter(Boolean):c,C=e.shouldForwardProp;if(r&&a.shouldForwardProp){var w=a.shouldForwardProp;if(e.shouldForwardProp){var x=e.shouldForwardProp;C=function(t,e){return w(t,e)&&x(t,e)}}else C=w}var E=new Wt(n,m,r?a.componentStyle:void 0);function L(t,e){return function(t,e,n){var r=t.attrs,a=t.componentStyle,s=t.defaultProps,l=t.foldedComponentIds,c=t.styledComponentId,u=t.target,d=i.default.useContext(Mt),h=_t(),f=t.shouldForwardProp||h.shouldForwardProp,p=A(e,d,s)||v,m=function(t,e,n){for(var i,r=Object(o.a)(Object(o.a)({},e),{className:void 0,theme:n}),a=0;a<t.length;a+=1){var s=Y(i=t[a])?i(r):i;for(var l in s)r[l]="className"===l?q(r[l],s[l]):"style"===l?Object(o.a)(Object(o.a)({},r[l]),s[l]):s[l]}return e.className&&(r.className=q(r.className,e.className)),r}(r,e,p),g=m.as||u,y={};for(var C in m)void 0===m[C]||"$"===C[0]||"as"===C||"theme"===C&&m.theme===p||("forwardedAs"===C?y.as=m.forwardedAs:f&&!f(C,g)||(y[C]=m[C]));var S=function(t,e){var n=_t();return t.generateAndInjectStyles(e,n.styleSheet,n.stylis)}(a,m),w=q(l,c);return S&&(w+=" "+S),m.className&&(w+=" "+m.className),y[D(g)&&!b.has(g)?"class":"className"]=w,y.ref=n,Object(i.createElement)(g,y)}(_,t,e)}L.displayName=p;var _=i.default.forwardRef(L);return _.attrs=y,_.componentStyle=E,_.displayName=p,_.shouldForwardProp=C,_.foldedComponentIds=r?q(a.foldedComponentIds,a.styledComponentId):"",_.styledComponentId=m,_.target=r?a.target:t,Object.defineProperty(_,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(t){this._foldedDefaultProps=r?function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var o=0,i=e;o<i.length;o++)K(t,i[o],!0);return t}({},a.defaultProps,t):t}}),J(_,(function(){return".".concat(_.styledComponentId)})),s&&Q(_,t,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),_}function Nt(t,e){for(var n=[t[0]],o=0,i=e.length;o<i;o+=1)n.push(e[o],t[o+1]);return n}var Vt=function(t){return Object.assign(t,{isCss:!0})};function Ut(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(Y(t)||$(t))return Vt(Ft(Nt(g,Object(o.e)([t],e,!0))));var i=t;return 0===e.length&&1===i.length&&"string"==typeof i[0]?Ft(i):Vt(Ft(Nt(i,e)))}function Ht(t,e,n){if(void 0===n&&(n=v),!e)throw tt(1,e);var i=function(i){for(var r=[],a=1;a<arguments.length;a++)r[a-1]=arguments[a];return t(e,n,Ut.apply(void 0,Object(o.e)([i],r,!1)))};return i.attrs=function(i){return Ht(t,e,Object(o.a)(Object(o.a)({},n),{attrs:Array.prototype.concat(n.attrs,i).filter(Boolean)}))},i.withConfig=function(i){return Ht(t,e,Object(o.a)(Object(o.a)({},n),i))},i}var Gt=function(t){return Ht(zt,t)},Qt=Gt;b.forEach((function(t){Qt[t]=Gt(t)}));!function(){function t(t,e){this.rules=t,this.componentId=e,this.isStatic=Rt(t),At.registerId(this.componentId+1)}t.prototype.createStyles=function(t,e,n,o){var i=o(X(Ft(this.rules,e,n,o)),""),r=this.componentId+t;n.insertRules(r,r,i)},t.prototype.removeStyles=function(t,e){e.clearRules(this.componentId+t)},t.prototype.renderStyles=function(t,e,n,o){t>2&&At.registerId(this.componentId+t),this.removeStyles(t,n),this.createStyles(t,e,n,o)}}();function Yt(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var i=X(Ut.apply(void 0,Object(o.e)([t],e,!1))),r=T(i);return new Tt(r,i)}(function(){function t(){var t=this;this._emitSheetCSS=function(){var e=t.instance.toString(),n=dt(),o=X([n&&'nonce="'.concat(n,'"'),"".concat(c,'="true"'),"".concat(d,'="').concat(h,'"')].filter(Boolean)," ");return"<style ".concat(o,">").concat(e,"</style>")},this.getStyleTags=function(){if(t.sealed)throw tt(2);return t._emitSheetCSS()},this.getStyleElement=function(){var e;if(t.sealed)throw tt(2);var n=((e={})[c]="",e[d]=h,e.dangerouslySetInnerHTML={__html:t.instance.toString()},e),r=dt();return r&&(n.nonce=r),[i.default.createElement("style",Object(o.a)({},n,{key:"sc-0-0"}))]},this.seal=function(){t.sealed=!0},this.instance=new At({isServer:!0}),this.sealed=!1}t.prototype.collectStyles=function(t){if(this.sealed)throw tt(2);return i.default.createElement(Ot,{sheet:this.instance},t)},t.prototype.interleaveWithNodeStream=function(t){throw tt(3)}})(),"__sc-".concat(c,"__")}).call(this,n(42))},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var o=n(15),i=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class r{static get INSTANCE(){return r._INSTANCE||(r._INSTANCE=new r),r._INSTANCE}constructor(){this.listOfCameras=[],this.strategy="FAST_DEFERRED"}initialize(t){if(t&&(this.strategy=t),"SLOW"===t||"FAST"===t){const e=t;this.load(e)}}load(t){return i(this,void 0,void 0,(function*(){if(!t)if("SLOW_DEFERRED"===this.strategy||"SLOW"===this.strategy)t="SLOW";else if("FAST_DEFERRED"===this.strategy||"FAST"===this.strategy)t="FAST";else if("NONE"===this.strategy)return this.listOfCameras;let e;if("SLOW"===t)e=this.loadSlow();else{if("FAST"!==t)throw new Error(`Unknown mode ${t}`);e=this.loadFast()}try{return this.listOfCameras=yield e,this.listOfCameras}catch(t){throw this.loadSlowResult=void 0,o.a.createFromDOMException(t)}}))}loadSlow(){return this.loadSlowResult=this.loadSlowResult||(()=>i(this,void 0,void 0,(function*(){yield this.assertPermissionsAreOk();const t=[];for(const e of yield this.getVideoDevices()){let n;try{n=yield this.getUserMedia({video:{deviceId:e.deviceId}}),t.push(r.getCameraInfoFromStream(n))}finally{this.stopStream(n),yield new Promise((t=>setTimeout(t,0)))}}return t})))(),this.loadSlowResult}loadFast(){return this.loadFastResult=this.loadFastResult||(()=>i(this,void 0,void 0,(function*(){yield this.assertPermissionsAreOk();const t=[];for(const e of yield this.getVideoDevices()){const n=r.guessparseCameraLabelFacingMode(e.label),o=r.guessparseCameraLabelMaxNumPixels(e.label);t.push({maxNumPixels:o,facingMode:n,supportsTorchControl:void 0,deviceId:e.deviceId,label:e.label})}return t})))(),this.loadFastResult}getMainCamera(t){var e,n,o,i,r,a;return null!==(a=null===(r=null===(i=null===(o=null===(n=null===(e=this.listOfCameras)||void 0===e?void 0:e.filter((e=>e.facingMode===t)))||void 0===n?void 0:n.map(((t,e)=>({camera:t,index:e}))))||void 0===o?void 0:o.sort(((t,e)=>{var n;return-(+t.camera.supportsTorchControl||0)-(+e.camera.supportsTorchControl||0)||-((t.camera.maxNumPixels||0)-(e.camera.maxNumPixels||0))||(null===(n=t.camera.label)||void 0===n?void 0:n.localeCompare(e.camera.label))||t.index-e.index})))||void 0===i?void 0:i[0])||void 0===r?void 0:r.camera)&&void 0!==a?a:null}getVideoDevices(){return i(this,void 0,void 0,(function*(){let t=yield navigator.mediaDevices.enumerateDevices();if(t=t.filter((t=>"videoinput"===t.kind)),t.some((t=>""===t.label))){let e;try{e=yield this.getUserMedia({video:{facingMode:{ideal:"environment"}},audio:!1}),t=yield navigator.mediaDevices.enumerateDevices(),t=t.filter((t=>"videoinput"===t.kind))}finally{this.stopStream(e)}}return t}))}stopStream(t){null==t||t.getTracks().forEach((t=>t.stop()))}static guessparseCameraLabelFacingMode(t){return function(t){const e=["rear","back","rück","arrière","trasera","trás","traseira","posteriore","后面","後面","背面","后置","後置","背置","задней","الخلفية","후","arka","achterzijde","หลัง","baksidan","bagside","sau","bak","tylny","takakamera","belakang","אחורית","πίσω","spate","hátsó","zadní","darrere","zadná","задня","stražnja","belakang","बैक"];for(const n of e)if(t.toLowerCase().includes(n.toLowerCase()))return!0;return!1}(t)?"back":"front"}static guessparseCameraLabelMaxNumPixels(t){const e=RegExp(/\b([0-9]+)mp?\b/).exec(t.toLowerCase()),n=e?1e6*parseInt(e[1],10):NaN;return Number.isNaN(n)?void 0:n}assertPermissionsAreOk(){return i(this,void 0,void 0,(function*(){if(o.a.hasCheckedPermission()||(yield o.a.tryCheckPermission()),o.a.hasDeniedPermission())throw o.a.permissionDenied();if(!navigator.mediaDevices)throw o.a.unknown()}))}static getCameraInfoFromStream(t){var e;return null===(e=t.getVideoTracks().map((t=>{var e,n,o,i,r,a;const s=null===(e=t.getCapabilities)||void 0===e?void 0:e.call(t),l=null===(n=t.getSettings)||void 0===n?void 0:n.call(t),c=t.label;let u=function(t){if("user"===(null==t?void 0:t.toLowerCase()))return"front";if("environment"===(null==t?void 0:t.toLowerCase()))return"back";return"unknown"}(null!==(i=null===(o=null==s?void 0:s.facingMode)||void 0===o?void 0:o[0])&&void 0!==i?i:l.facingMode);"unknown"===u&&(u=this.guessparseCameraLabelFacingMode(c));let d=function(t){var e,n;let o=(null===(e=null==t?void 0:t.width)||void 0===e?void 0:e.max)*(null===(n=null==t?void 0:t.height)||void 0===n?void 0:n.max);if(!o||Number.isNaN(o))return;return o}(s);Number.isNaN(d)&&(d=this.guessparseCameraLabelMaxNumPixels(c));return{facingMode:u,maxNumPixels:d,supportsTorchControl:null!==(a=null!==(r=null==s?void 0:s.torch)&&void 0!==r?r:"torch"in l)&&void 0!==a&&a,label:c,deviceId:l.deviceId}})).sort(((t,e)=>e.maxNumPixels-t.maxNumPixels)))||void 0===e?void 0:e[0]}getUserMedia(t){return i(this,void 0,void 0,(function*(){try{return yield navigator.mediaDevices.getUserMedia(t)}catch(t){throw o.a.mediaDeviceNotFound()}}))}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var o=n(0),i=n(21),r=n(5),a=n(11);class s extends o.default.Component{get style(){return this.props.configuration.style}get holeRect(){return this.holePosition}constructor(t){super(t),this.holePosition=i.a.empty(),this.resizeObserver=new ResizeObserver((()=>{this.updateWindowSize()})),this.componentDidUpdate=t=>{var e,n,o,i;(null===(e=this.props.padding)||void 0===e?void 0:e.minTopPadding)===(null===(n=t.padding)||void 0===n?void 0:n.minTopPadding)&&(null===(o=this.props.padding)||void 0===o?void 0:o.minBottomPadding)===(null===(i=t.padding)||void 0===i?void 0:i.minBottomPadding)&&this.props.configuration===t.configuration&&this.props.guidanceConfiguration===t.guidanceConfiguration||this.setState({shouldUpdateCanvas:!0}),this.updateCanvas()},this.updateWindowSize=()=>{this.setState({shouldUpdateCanvas:!0})},this.getVideoSize=()=>{var t;return null!==(t=this.holeCanvas.getBoundingClientRect())&&void 0!==t?t:new DOMRect},this.scaleForRetinaDisplay=t=>{if(window.devicePixelRatio>1){var e=t.width,n=t.height;t.width=e*window.devicePixelRatio,t.height=n*window.devicePixelRatio,t.style.width=e+"px",t.style.height=n+"px",t.getContext("2d").scale(window.devicePixelRatio,window.devicePixelRatio)}},this.updateCanvas=()=>{var t,e,n,o,i;if(!this.state.shouldUpdateCanvas)return;this.setState({shouldUpdateCanvas:!1});const r=this.getVideoSize().width,a=this.getVideoSize().height;this.holeCanvas.width=r,this.holeCanvas.height=a,this.crosshairCanvas.width=r,this.crosshairCanvas.height=a,this.scaleForRetinaDisplay(this.crosshairCanvas);const s=r-2*this.props.configuration.style.strokeWidth,l=Math.max(20,(r-s)/2),c=Math.min(s,r-2*l),u=this.props.configuration.aspectRatio.width/this.props.configuration.aspectRatio.height;this.holePosition.width=c,this.holePosition.height=this.holePosition.width/u,this.holePosition.x=r/2-c/2;const d=(null===(t=this.guidanceText)||void 0===t?void 0:t.clientHeight)+this.guidanceTextTopPadding||0,h=Math.max(10,null!==(n=null===(e=this.props.padding)||void 0===e?void 0:e.minTopPadding)&&void 0!==n?n:0),f=a-h-Math.max(10,null!==(i=null===(o=this.props.padding)||void 0===o?void 0:o.minBottomPadding)&&void 0!==i?i:0)-d;this.holePosition.height>f?(this.holePosition.height=f,this.holePosition.width=this.holePosition.height*u,this.holePosition.x=r/2-this.holePosition.width/2,this.holePosition.y=h):this.holePosition.y=h+(f-this.holePosition.height)/1.9;const p=this.holeCanvas.getContext("2d");p.save(),this.drawBackground(p),p.globalCompositeOperation="destination-out",this.drawHole();const m=this.crosshairCanvas.getContext("2d");m.globalCompositeOperation="source-over","FinderStrokedStyle"===this.props.configuration.style._type?this.drawHoleOutline():"FinderCorneredStyle"===this.props.configuration.style._type&&this.drawHoleCorners(),p.restore(),m.restore()},this.drawBackground=t=>{const{width:e,height:n}=this.getVideoSize();t.clearRect(0,0,e,n),t.beginPath(),t.rect(0,0,e,n),t.fillStyle=r.b.getColorValue(this.props.configuration.overlayColor),t.fill()},this.drawHole=()=>{const t=this.holeCanvas.getContext("2d"),e=this.cornerRadius(),n=this.holePosition.x,o=this.holePosition.y,i=this.holePosition.width,r=this.holePosition.height;t.beginPath(),t.fillStyle="black",t.moveTo(n+e,o),t.arcTo(n+i,o,n+i,o+r,e),t.arcTo(n+i,o+r,n,o+r,e),t.arcTo(n,o+r,n,o,e),t.arcTo(n,o,n+i,o,e),t.closePath(),t.fill()},this.drawCrosshair=()=>{const t=this.crosshairCanvas.getContext("2d"),e=this.holePosition.x+this.holePosition.width/2,n=this.holePosition.y+this.holePosition.height/2;t.beginPath(),t.moveTo(e-10,n),t.lineTo(e+10,n),t.moveTo(e,n-10),t.lineTo(e,n+10),t.strokeStyle="white",t.fillStyle="white",t.lineWidth=1,t.stroke()},this.drawHoleCorners=()=>{const t=this.crosshairCanvas.getContext("2d"),e=this.holePosition.x,n=this.holePosition.y,o=this.holePosition.width,i=this.holePosition.height,a=15,s=this.style.strokeWidth,l=this.cornerRadius();t.beginPath(),t.moveTo(e,n+a),t.arcTo(e,n,e+o,n,l),t.lineTo(e+a,n),t.moveTo(e+o-a,n),t.arcTo(e+o,n,e+o,n+i,l),t.lineTo(e+o,n+a),t.moveTo(e+o,n+i-a),t.arcTo(e+o,n+i,e,n+i,l),t.lineTo(e+o-a,n+i),t.moveTo(e,n+i-a),t.arcTo(e,n+i,e+o,n+i,l),t.lineTo(e+a,n+i),t.strokeStyle=r.b.getColorValue(this.style.strokeColor),t.lineWidth=s,t.stroke()},this.drawHoleOutline=()=>{const t=this.crosshairCanvas.getContext("2d"),e=this.holePosition.x,n=this.holePosition.y,o=this.holePosition.width,i=this.holePosition.height,a=this.cornerRadius(),s=this.style.strokeWidth;t.beginPath(),t.moveTo(e+a,n),t.arcTo(e+o,n,e+o,n+i,a),t.moveTo(e+o,n+a),t.arcTo(e+o,n+i,e,n+i,a),t.moveTo(e+o-a,n+i),t.arcTo(e,n+i,e,n,a),t.moveTo(e,n+i-a),t.arcTo(e,n,e+o,n,a),t.strokeStyle=r.b.getColorValue(this.style.strokeColor),t.lineWidth=s,t.stroke()},this.guidanceTextTopPadding=20,this.render=()=>o.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%",textAlign:"left"},onClick:t=>{const e=this.holePosition;t.clientX>this.holePosition.x&&t.clientX<e.x+e.width&&t.clientY>e.y&&t.clientY<e.y+e.height&&console.log("Clicked inside hole, possibly click events need to be diverted")}},o.default.createElement("canvas",{ref:t=>{this.holeCanvas=t},style:{position:"absolute",width:"100%",height:"100%"}}),o.default.createElement("canvas",{ref:t=>{this.crosshairCanvas=t},style:{position:"absolute",width:"100%",height:"100%"}}),this.guidance.visible&&o.default.createElement("div",{ref:t=>{this.guidanceText=t},style:{position:"absolute",display:"block",top:this.holePosition.y+this.holePosition.height+this.guidanceTextTopPadding,left:0,width:"100%",textAlign:"center"}},o.default.createElement(a.a,{style:{display:"inline-block",backgroundColor:r.b.getColorValue(this.guidance.background.fillColor),borderStyle:"solid",borderColor:r.b.getColorValue(this.guidance.background.strokeColor),borderWidth:this.style.strokeWidth,borderRadius:4,padding:"4px 8px",flex:1},config:this.guidance.title}))),this.state={shouldUpdateCanvas:!0}}componentDidMount(){this.updateWindowSize(),this.resizeObserver.observe(this.holeCanvas)}componentWillUnmount(){this.resizeObserver.disconnect()}bottomOfGuidanceText(){var t,e;return this.holeRect.bottom()+(null!==(e=null===(t=this.guidanceText)||void 0===t?void 0:t.clientHeight)&&void 0!==e?e:0)+this.guidanceTextTopPadding}get guidance(){return this.props.guidanceConfiguration}cornerRadius(){return Math.max(0,Math.min(this.style.cornerRadius,this.holePosition.width/2,this.holePosition.height/2))}}},function(t,e,n){var o;!function(){"use strict";var n={}.hasOwnProperty;function i(){for(var t=[],e=0;e<arguments.length;e++){var o=arguments[e];if(o){var r=typeof o;if("string"===r||"number"===r)t.push(o);else if(Array.isArray(o)){if(o.length){var a=i.apply(null,o);a&&t.push(a)}}else if("object"===r)if(o.toString===Object.prototype.toString)for(var s in o)n.call(o,s)&&o[s]&&t.push(s);else t.push(o.toString())}}return t.join(" ")}t.exports?(i.default=i,t.exports=i):void 0===(o=function(){return i}.apply(e,[]))||(t.exports=o)}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return s})),n.d(e,"b",(function(){return Q})),n.d(e,"c",(function(){return tt})),n.d(e,"d",(function(){return nt})),n.d(e,"e",(function(){return et})),n.d(e,"f",(function(){return K})),n.d(e,"g",(function(){return J}));var o="-ms-",i="-moz-",r="-webkit-",a="comm",s="rule",l="decl",c="@keyframes",u=Math.abs,d=String.fromCharCode,h=Object.assign;function f(t){return t.trim()}function p(t,e){return(t=e.exec(t))?t[0]:t}function m(t,e,n){return t.replace(e,n)}function g(t,e,n){return t.indexOf(e,n)}function v(t,e){return 0|t.charCodeAt(e)}function A(t,e,n){return t.slice(e,n)}function b(t){return t.length}function y(t){return t.length}function C(t,e){return e.push(t),t}function S(t,e){return t.map(e).join("")}function w(t,e){return t.filter((function(t){return!p(t,e)}))}var x=1,E=1,L=0,_=0,O=0,T="";function k(t,e,n,o,i,r,a,s){return{value:t,root:e,parent:n,type:o,props:i,children:r,line:x,column:E,length:a,return:"",siblings:s}}function D(t,e){return h(k("",null,null,"",null,null,0,t.siblings),t,{length:-t.length},e)}function P(t){for(;t.root;)t=D(t.root,{children:[t]});C(t,t.siblings)}function B(){return O=_<L?v(T,_++):0,E++,10===O&&(E=1,x++),O}function F(){return v(T,_)}function R(){return _}function I(t,e){return A(T,t,e)}function W(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function M(t){return x=E=1,L=b(T=t),_=0,[]}function j(t){return T="",t}function z(t){return f(I(_-1,U(91===t?t+2:40===t?t+1:t)))}function N(t){for(;(O=F())&&O<33;)B();return W(t)>2||W(O)>3?"":" "}function V(t,e){for(;--e&&B()&&!(O<48||O>102||O>57&&O<65||O>70&&O<97););return I(t,R()+(e<6&&32==F()&&32==B()))}function U(t){for(;B();)switch(O){case t:return _;case 34:case 39:34!==t&&39!==t&&U(O);break;case 40:41===t&&U(t);break;case 92:B()}return _}function H(t,e){for(;B()&&t+O!==57&&(t+O!==84||47!==F()););return"/*"+I(e,_-1)+"*"+d(47===t?t:B())}function G(t){for(;!W(F());)B();return I(t,_)}function Q(t){return j(Y("",null,null,null,[""],t=M(t),0,[0],t))}function Y(t,e,n,o,i,r,a,s,l){for(var c=0,h=0,f=a,p=0,A=0,y=0,S=1,w=1,L=1,k=0,D="",P=i,I=r,W=o,M=D;w;)switch(y=k,k=B()){case 40:if(108!=y&&58==v(M,f-1)){-1!=g(M+=m(z(k),"&","&\f"),"&\f",u(c?s[c-1]:0))&&(L=-1);break}case 34:case 39:case 91:M+=z(k);break;case 9:case 10:case 13:case 32:M+=N(y);break;case 92:M+=V(R()-1,7);continue;case 47:switch(F()){case 42:case 47:C(q(H(B(),R()),e,n,l),l);break;default:M+="/"}break;case 123*S:s[c++]=b(M)*L;case 125*S:case 59:case 0:switch(k){case 0:case 125:w=0;case 59+h:-1==L&&(M=m(M,/\f/g,"")),A>0&&b(M)-f&&C(A>32?X(M+";",o,n,f-1,l):X(m(M," ","")+";",o,n,f-2,l),l);break;case 59:M+=";";default:if(C(W=Z(M,e,n,c,h,i,s,D,P=[],I=[],f,r),r),123===k)if(0===h)Y(M,e,W,W,P,r,f,s,I);else switch(99===p&&110===v(M,3)?100:p){case 100:case 108:case 109:case 115:Y(t,W,W,o&&C(Z(t,W,W,0,0,i,s,D,i,P=[],f,I),I),i,I,f,s,o?P:I);break;default:Y(M,W,W,W,[""],I,0,s,I)}}c=h=A=0,S=L=1,D=M="",f=a;break;case 58:f=1+b(M),A=y;default:if(S<1)if(123==k)--S;else if(125==k&&0==S++&&125==(O=_>0?v(T,--_):0,E--,10===O&&(E=1,x--),O))continue;switch(M+=d(k),k*S){case 38:L=h>0?1:(M+="\f",-1);break;case 44:s[c++]=(b(M)-1)*L,L=1;break;case 64:45===F()&&(M+=z(B())),p=F(),h=f=b(D=M+=G(R())),k++;break;case 45:45===y&&2==b(M)&&(S=0)}}return r}function Z(t,e,n,o,i,r,a,l,c,d,h,p){for(var g=i-1,v=0===i?r:[""],b=y(v),C=0,S=0,w=0;C<o;++C)for(var x=0,E=A(t,g+1,g=u(S=a[C])),L=t;x<b;++x)(L=f(S>0?v[x]+" "+E:m(E,/&\f/g,v[x])))&&(c[w++]=L);return k(t,e,n,0===i?s:l,c,d,h,p)}function q(t,e,n,o){return k(t,e,n,a,d(O),A(t,2,-2),0,o)}function X(t,e,n,o,i){return k(t,e,n,l,A(t,0,o),A(t,o+1,-1),o,i)}function $(t,e,n){switch(function(t,e){return 45^v(t,0)?(((e<<2^v(t,0))<<2^v(t,1))<<2^v(t,2))<<2^v(t,3):0}(t,e)){case 5103:return r+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return r+t+t;case 4789:return i+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return r+t+i+t+o+t+t;case 5936:switch(v(t,e+11)){case 114:return r+t+o+m(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return r+t+o+m(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return r+t+o+m(t,/[svh]\w+-[tblr]{2}/,"lr")+t}case 6828:case 4268:case 2903:return r+t+o+t+t;case 6165:return r+t+o+"flex-"+t+t;case 5187:return r+t+m(t,/(\w+).+(:[^]+)/,r+"box-$1$2"+o+"flex-$1$2")+t;case 5443:return r+t+o+"flex-item-"+m(t,/flex-|-self/g,"")+(p(t,/flex-|baseline/)?"":o+"grid-row-"+m(t,/flex-|-self/g,""))+t;case 4675:return r+t+o+"flex-line-pack"+m(t,/align-content|flex-|-self/g,"")+t;case 5548:return r+t+o+m(t,"shrink","negative")+t;case 5292:return r+t+o+m(t,"basis","preferred-size")+t;case 6060:return r+"box-"+m(t,"-grow","")+r+t+o+m(t,"grow","positive")+t;case 4554:return r+m(t,/([^-])(transform)/g,"$1"+r+"$2")+t;case 6187:return m(m(m(t,/(zoom-|grab)/,r+"$1"),/(image-set)/,r+"$1"),t,"")+t;case 5495:case 3959:return m(t,/(image-set\([^]*)/,r+"$1$`$1");case 4968:return m(m(t,/(.+:)(flex-)?(.*)/,r+"box-pack:$3"+o+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+r+t+t;case 4200:if(!p(t,/flex-|baseline/))return o+"grid-column-align"+A(t,e)+t;break;case 2592:case 3360:return o+m(t,"template-","")+t;case 4384:case 3616:return n&&n.some((function(t,n){return e=n,p(t.props,/grid-\w+-end/)}))?~g(t+(n=n[e].value),"span",0)?t:o+m(t,"-start","")+t+o+"grid-row-span:"+(~g(n,"span",0)?p(n,/\d+/):+p(n,/\d+/)-+p(t,/\d+/))+";":o+m(t,"-start","")+t;case 4896:case 4128:return n&&n.some((function(t){return p(t.props,/grid-\w+-start/)}))?t:o+m(m(t,"-end","-span"),"span ","")+t;case 4095:case 3583:case 4068:case 2532:return m(t,/(.+)-inline(.+)/,r+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(b(t)-1-e>6)switch(v(t,e+1)){case 109:if(45!==v(t,e+4))break;case 102:return m(t,/(.+:)(.+)-([^]+)/,"$1"+r+"$2-$3$1"+i+(108==v(t,e+3)?"$3":"$2-$3"))+t;case 115:return~g(t,"stretch",0)?$(m(t,"stretch","fill-available"),e,n)+t:t}break;case 5152:case 5920:return m(t,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,(function(e,n,i,r,a,s,l){return o+n+":"+i+l+(r?o+n+"-span:"+(a?s:+s-+i)+l:"")+t}));case 4949:if(121===v(t,e+6))return m(t,":",":"+r)+t;break;case 6444:switch(v(t,45===v(t,14)?18:11)){case 120:return m(t,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+r+(45===v(t,14)?"inline-":"")+"box$3$1"+r+"$2$3$1"+o+"$2box$3")+t;case 100:return m(t,":",":"+o)+t}break;case 5719:case 2647:case 2135:case 3927:case 2391:return m(t,"scroll-","scroll-snap-")+t}return t}function K(t,e){for(var n="",o=0;o<t.length;o++)n+=e(t[o],o,t,e)||"";return n}function J(t,e,n,o){switch(t.type){case"@layer":if(t.children.length)break;case"@import":case l:return t.return=t.return||t.value;case a:return"";case c:return t.return=t.value+"{"+K(t.children,o)+"}";case s:if(!b(t.value=t.props.join(",")))return""}return b(n=K(t.children,o))?t.return=t.value+"{"+n+"}":""}function tt(t){var e=y(t);return function(n,o,i,r){for(var a="",s=0;s<e;s++)a+=t[s](n,o,i,r)||"";return a}}function et(t){return function(e){e.root||(e=e.return)&&t(e)}}function nt(t,e,n,i){if(t.length>-1&&!t.return)switch(t.type){case l:return void(t.return=$(t.value,t.length,n));case c:return K([D(t,{value:m(t.value,"@","@"+r)})],i);case s:if(t.length)return S(n=t.props,(function(e){switch(p(e,i=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":P(D(t,{props:[m(e,/:(read-\w+)/,":-moz-$1")]})),P(D(t,{props:[e]})),h(t,{props:w(n,i)});break;case"::placeholder":P(D(t,{props:[m(e,/:(plac\w+)/,":"+r+"input-$1")]})),P(D(t,{props:[m(e,/:(plac\w+)/,":-moz-$1")]})),P(D(t,{props:[m(e,/:(plac\w+)/,o+"input-$1")]})),P(D(t,{props:[e]})),h(t,{props:w(n,i)})}return""}))}}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var o=n(1),i=n(7);class r extends i.a{constructor(t={}){super(),this.title=new o.j({visible:!1,text:"Scan Item",color:"?sbColorOnPrimary"}),this.mode="SOLID",this.backgroundColor="?sbColorPrimary",this.cancelButton=new o.c({text:"Cancel",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new o.d({color:"?sbColorOnPrimary"})}),void 0!==t.title&&(this.title=new o.j(t.title)),void 0!==t.mode&&(this.mode=t.mode),void 0!==t.backgroundColor&&(this.backgroundColor=t.backgroundColor),void 0!==t.cancelButton&&(this.cancelButton=new o.c(t.cancelButton))}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return r}));var o=n(6);function i(t,e,n){return Math.min(Math.max(t,e),n)}function r(t,e,n){return new o.a(i(t.x,-e/2,n.width-e/2),i(t.y,-e/2,n.height-e/2))}},function(t,e,n){"use strict";n.r(e),n.d(e,"BarcodeFormatConfigurationBase",(function(){return o})),n.d(e,"BarcodeFormatOneDConfigurationBase",(function(){return i})),n.d(e,"BarcodeFormatCodabarConfiguration",(function(){return l})),n.d(e,"BarcodeFormatCode11Configuration",(function(){return c})),n.d(e,"BarcodeFormatCode39Configuration",(function(){return u})),n.d(e,"BarcodeFormatCode93Configuration",(function(){return d})),n.d(e,"BarcodeFormatCode128Configuration",(function(){return h})),n.d(e,"BarcodeFormatCode2Of5Configuration",(function(){return f})),n.d(e,"BarcodeFormatDataBarConfiguration",(function(){return p})),n.d(e,"BarcodeFormatDataBarExpandedConfiguration",(function(){return m})),n.d(e,"BarcodeFormatDataBarLimitedConfiguration",(function(){return g})),n.d(e,"BarcodeFormatITFConfiguration",(function(){return v})),n.d(e,"BarcodeFormatMSIPlesseyConfiguration",(function(){return A})),n.d(e,"BarcodeFormatUpcEanConfiguration",(function(){return b})),n.d(e,"BarcodeFormatPharmaCodeConfiguration",(function(){return y})),n.d(e,"BarcodeFormatTwoDConfigurationBase",(function(){return r})),n.d(e,"BarcodeFormatAztecConfiguration",(function(){return C})),n.d(e,"BarcodeFormatQRCodeConfiguration",(function(){return S})),n.d(e,"BarcodeFormatPDF417Configuration",(function(){return w})),n.d(e,"BarcodeFormatMicroPDF417Configuration",(function(){return x})),n.d(e,"BarcodeFormatDataMatrixConfiguration",(function(){return E})),n.d(e,"BarcodeFormatMaxiCodeConfiguration",(function(){return L})),n.d(e,"BarcodeFormatFourStateConfigurationBase",(function(){return a})),n.d(e,"BarcodeFormatAustraliaPostConfiguration",(function(){return _})),n.d(e,"BarcodeFormatJapanPostConfiguration",(function(){return O})),n.d(e,"BarcodeFormatRoyalMailConfiguration",(function(){return T})),n.d(e,"BarcodeFormatRoyalTNTPostConfiguration",(function(){return k})),n.d(e,"BarcodeFormatUSPSIntelligentMailConfiguration",(function(){return D})),n.d(e,"BarcodeFormatPharmaCodeTwoTrackConfiguration",(function(){return P})),n.d(e,"BarcodeFormatGS1CompositeConfiguration",(function(){return B})),n.d(e,"BarcodeFormatCommonOneDConfiguration",(function(){return F})),n.d(e,"BarcodeFormatCommonTwoDConfiguration",(function(){return R})),n.d(e,"BarcodeFormatCommonFourStateConfiguration",(function(){return I})),n.d(e,"BarcodeFormatCommonConfiguration",(function(){return W}));var o,i,r,a,s=n(4);!function(t){t.From=function(t){const e=t._type;switch(e){case"BarcodeFormatCodabarConfiguration":return new l(t);case"BarcodeFormatCode11Configuration":return new c(t);case"BarcodeFormatCode39Configuration":return new u(t);case"BarcodeFormatCode93Configuration":return new d(t);case"BarcodeFormatCode128Configuration":return new h(t);case"BarcodeFormatCode2Of5Configuration":return new f(t);case"BarcodeFormatDataBarConfiguration":return new p(t);case"BarcodeFormatDataBarExpandedConfiguration":return new m(t);case"BarcodeFormatDataBarLimitedConfiguration":return new g(t);case"BarcodeFormatITFConfiguration":return new v(t);case"BarcodeFormatMSIPlesseyConfiguration":return new A(t);case"BarcodeFormatUpcEanConfiguration":return new b(t);case"BarcodeFormatPharmaCodeConfiguration":return new y(t);case"BarcodeFormatAztecConfiguration":return new C(t);case"BarcodeFormatQRCodeConfiguration":return new S(t);case"BarcodeFormatPDF417Configuration":return new w(t);case"BarcodeFormatMicroPDF417Configuration":return new x(t);case"BarcodeFormatDataMatrixConfiguration":return new E(t);case"BarcodeFormatMaxiCodeConfiguration":return new L(t);case"BarcodeFormatAustraliaPostConfiguration":return new _(t);case"BarcodeFormatJapanPostConfiguration":return new O(t);case"BarcodeFormatRoyalMailConfiguration":return new T(t);case"BarcodeFormatRoyalTNTPostConfiguration":return new k(t);case"BarcodeFormatUSPSIntelligentMailConfiguration":return new D(t);case"BarcodeFormatPharmaCodeTwoTrackConfiguration":return new P(t);case"BarcodeFormatGS1CompositeConfiguration":return new B(t);case"BarcodeFormatCommonOneDConfiguration":return new F(t);case"BarcodeFormatCommonTwoDConfiguration":return new R(t);case"BarcodeFormatCommonFourStateConfiguration":return new I(t);case"BarcodeFormatCommonConfiguration":return new W(t);default:throw`Unknown child class name: ${e}`}}}(o||(o={})),function(t){t.From=function(t){const e=t._type;switch(e){case"BarcodeFormatCodabarConfiguration":return new l(t);case"BarcodeFormatCode11Configuration":return new c(t);case"BarcodeFormatCode39Configuration":return new u(t);case"BarcodeFormatCode93Configuration":return new d(t);case"BarcodeFormatCode128Configuration":return new h(t);case"BarcodeFormatCode2Of5Configuration":return new f(t);case"BarcodeFormatDataBarConfiguration":return new p(t);case"BarcodeFormatDataBarExpandedConfiguration":return new m(t);case"BarcodeFormatDataBarLimitedConfiguration":return new g(t);case"BarcodeFormatITFConfiguration":return new v(t);case"BarcodeFormatMSIPlesseyConfiguration":return new A(t);case"BarcodeFormatUpcEanConfiguration":return new b(t);case"BarcodeFormatPharmaCodeConfiguration":return new y(t);default:throw`Unknown child class name: ${e}`}}}(i||(i={}));class l extends s.a{constructor(t={}){super(),this._type="BarcodeFormatCodabarConfiguration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.minimumTextLength=0,this.maximumTextLength=0,this.returnStartEnd=!1,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.minimumTextLength&&(this.minimumTextLength=t.minimumTextLength),void 0!==t.maximumTextLength&&(this.maximumTextLength=t.maximumTextLength),void 0!==t.returnStartEnd&&(this.returnStartEnd=t.returnStartEnd)}}class c extends s.a{constructor(t={}){super(),this._type="BarcodeFormatCode11Configuration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.minimumTextLength=0,this.maximumTextLength=0,this.checksum=!0,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.stripCheckDigits&&(this.stripCheckDigits=t.stripCheckDigits),void 0!==t.minimumTextLength&&(this.minimumTextLength=t.minimumTextLength),void 0!==t.maximumTextLength&&(this.maximumTextLength=t.maximumTextLength),void 0!==t.checksum&&(this.checksum=t.checksum)}}class u extends s.a{constructor(t={}){super(),this._type="BarcodeFormatCode39Configuration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.minimumTextLength=0,this.maximumTextLength=0,this.code32=!1,this.code39=!0,this.pzn=!0,this.tryCode39ExtendedMode=!1,this.useCode39CheckDigit=!1,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.stripCheckDigits&&(this.stripCheckDigits=t.stripCheckDigits),void 0!==t.minimumTextLength&&(this.minimumTextLength=t.minimumTextLength),void 0!==t.maximumTextLength&&(this.maximumTextLength=t.maximumTextLength),void 0!==t.code32&&(this.code32=t.code32),void 0!==t.code39&&(this.code39=t.code39),void 0!==t.pzn&&(this.pzn=t.pzn),void 0!==t.tryCode39ExtendedMode&&(this.tryCode39ExtendedMode=t.tryCode39ExtendedMode),void 0!==t.useCode39CheckDigit&&(this.useCode39CheckDigit=t.useCode39CheckDigit)}}class d extends s.a{constructor(t={}){super(),this._type="BarcodeFormatCode93Configuration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.minimumTextLength=0,this.maximumTextLength=0,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.minimumTextLength&&(this.minimumTextLength=t.minimumTextLength),void 0!==t.maximumTextLength&&(this.maximumTextLength=t.maximumTextLength)}}class h extends s.a{constructor(t={}){super(),this._type="BarcodeFormatCode128Configuration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.gs1Handling="PARSE",this.minimumTextLength=0,this.maximumTextLength=0,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling),void 0!==t.minimumTextLength&&(this.minimumTextLength=t.minimumTextLength),void 0!==t.maximumTextLength&&(this.maximumTextLength=t.maximumTextLength)}}class f extends s.a{constructor(t={}){super(),this._type="BarcodeFormatCode2Of5Configuration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.minimumTextLength=0,this.maximumTextLength=0,this.iata2of5=!0,this.code25=!1,this.industrial2of5=!0,this.useIATA2OF5Checksum=!0,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.stripCheckDigits&&(this.stripCheckDigits=t.stripCheckDigits),void 0!==t.minimumTextLength&&(this.minimumTextLength=t.minimumTextLength),void 0!==t.maximumTextLength&&(this.maximumTextLength=t.maximumTextLength),void 0!==t.iata2of5&&(this.iata2of5=t.iata2of5),void 0!==t.code25&&(this.code25=t.code25),void 0!==t.industrial2of5&&(this.industrial2of5=t.industrial2of5),void 0!==t.useIATA2OF5Checksum&&(this.useIATA2OF5Checksum=t.useIATA2OF5Checksum)}}class p extends s.a{constructor(t={}){super(),this._type="BarcodeFormatDataBarConfiguration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.gs1Handling="PARSE",void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling)}}class m extends s.a{constructor(t={}){super(),this._type="BarcodeFormatDataBarExpandedConfiguration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.gs1Handling="PARSE",void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling)}}class g extends s.a{constructor(t={}){super(),this._type="BarcodeFormatDataBarLimitedConfiguration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.gs1Handling="PARSE",void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling)}}class v extends s.a{constructor(t={}){super(),this._type="BarcodeFormatITFConfiguration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.minimumTextLength=0,this.maximumTextLength=0,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.minimumTextLength&&(this.minimumTextLength=t.minimumTextLength),void 0!==t.maximumTextLength&&(this.maximumTextLength=t.maximumTextLength)}}class A extends s.a{constructor(t={}){super(),this._type="BarcodeFormatMSIPlesseyConfiguration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.minimumTextLength=0,this.maximumTextLength=0,this.checksumAlgorithms=["MOD_10"],void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.stripCheckDigits&&(this.stripCheckDigits=t.stripCheckDigits),void 0!==t.minimumTextLength&&(this.minimumTextLength=t.minimumTextLength),void 0!==t.maximumTextLength&&(this.maximumTextLength=t.maximumTextLength),void 0!==t.checksumAlgorithms&&(this.checksumAlgorithms=t.checksumAlgorithms.map((t=>t)))}}class b extends s.a{constructor(t={}){super(),this._type="BarcodeFormatUpcEanConfiguration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.ean8=!0,this.ean13=!0,this.upca=!0,this.upce=!0,this.extensions="AllowAny",void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.stripCheckDigits&&(this.stripCheckDigits=t.stripCheckDigits),void 0!==t.ean8&&(this.ean8=t.ean8),void 0!==t.ean13&&(this.ean13=t.ean13),void 0!==t.upca&&(this.upca=t.upca),void 0!==t.upce&&(this.upce=t.upce),void 0!==t.extensions&&(this.extensions=t.extensions)}}class y extends s.a{constructor(t={}){super(),this._type="BarcodeFormatPharmaCodeConfiguration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.minimumValue=16,this.allowNarrowBarsOnly=!1,this.allowWideBarsOnly=!1,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.minimumValue&&(this.minimumValue=t.minimumValue),void 0!==t.allowNarrowBarsOnly&&(this.allowNarrowBarsOnly=t.allowNarrowBarsOnly),void 0!==t.allowWideBarsOnly&&(this.allowWideBarsOnly=t.allowWideBarsOnly)}}!function(t){t.From=function(t){const e=t._type;switch(e){case"BarcodeFormatAztecConfiguration":return new C(t);case"BarcodeFormatQRCodeConfiguration":return new S(t);case"BarcodeFormatPDF417Configuration":return new w(t);case"BarcodeFormatMicroPDF417Configuration":return new x(t);case"BarcodeFormatDataMatrixConfiguration":return new E(t);case"BarcodeFormatMaxiCodeConfiguration":return new L(t);default:throw`Unknown child class name: ${e}`}}}(r||(r={}));class C extends s.a{constructor(t={}){super(),this._type="BarcodeFormatAztecConfiguration",this.regexFilter="",this.gs1Handling="PARSE",void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling)}}class S extends s.a{constructor(t={}){super(),this._type="BarcodeFormatQRCodeConfiguration",this.regexFilter="",this.gs1Handling="PARSE",this.strictMode=!0,this.qr=!0,this.microQr=!1,this.rmqr=!1,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling),void 0!==t.strictMode&&(this.strictMode=t.strictMode),void 0!==t.qr&&(this.qr=t.qr),void 0!==t.microQr&&(this.microQr=t.microQr),void 0!==t.rmqr&&(this.rmqr=t.rmqr)}}class w extends s.a{constructor(t={}){super(),this._type="BarcodeFormatPDF417Configuration",this.regexFilter="",this.gs1Handling="PARSE",this.strictMode=!0,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling),void 0!==t.strictMode&&(this.strictMode=t.strictMode)}}class x extends s.a{constructor(t={}){super(),this._type="BarcodeFormatMicroPDF417Configuration",this.regexFilter="",this.gs1Handling="PARSE",this.strictMode=!0,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling),void 0!==t.strictMode&&(this.strictMode=t.strictMode)}}class E extends s.a{constructor(t={}){super(),this._type="BarcodeFormatDataMatrixConfiguration",this.regexFilter="",this.gs1Handling="PARSE",void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling)}}class L extends s.a{constructor(t={}){super(),this._type="BarcodeFormatMaxiCodeConfiguration",this.regexFilter="",void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter)}}!function(t){t.From=function(t){const e=t._type;switch(e){case"BarcodeFormatAustraliaPostConfiguration":return new _(t);case"BarcodeFormatJapanPostConfiguration":return new O(t);case"BarcodeFormatRoyalMailConfiguration":return new T(t);case"BarcodeFormatRoyalTNTPostConfiguration":return new k(t);case"BarcodeFormatUSPSIntelligentMailConfiguration":return new D(t);case"BarcodeFormatPharmaCodeTwoTrackConfiguration":return new P(t);default:throw`Unknown child class name: ${e}`}}}(a||(a={}));class _ extends s.a{constructor(t={}){super(),this._type="BarcodeFormatAustraliaPostConfiguration",this.regexFilter="",this.australiaPostCustomerFormat="ALPHA_NUMERIC",void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.australiaPostCustomerFormat&&(this.australiaPostCustomerFormat=t.australiaPostCustomerFormat)}}class O extends s.a{constructor(t={}){super(),this._type="BarcodeFormatJapanPostConfiguration",this.regexFilter="",void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter)}}class T extends s.a{constructor(t={}){super(),this._type="BarcodeFormatRoyalMailConfiguration",this.regexFilter="",this.stripCheckDigits=!1,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.stripCheckDigits&&(this.stripCheckDigits=t.stripCheckDigits)}}class k extends s.a{constructor(t={}){super(),this._type="BarcodeFormatRoyalTNTPostConfiguration",this.regexFilter="",void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter)}}class D extends s.a{constructor(t={}){super(),this._type="BarcodeFormatUSPSIntelligentMailConfiguration",this.regexFilter="",void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter)}}class P extends s.a{constructor(t={}){super(),this._type="BarcodeFormatPharmaCodeTwoTrackConfiguration",this.regexFilter="",this.minimumValue=364,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimumValue&&(this.minimumValue=t.minimumValue)}}class B extends s.a{constructor(t={}){super(),this._type="BarcodeFormatGS1CompositeConfiguration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.gs1Handling="PARSE",this.strictMode=!0,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling),void 0!==t.strictMode&&(this.strictMode=t.strictMode)}}class F extends s.a{constructor(t={}){super(),this._type="BarcodeFormatCommonOneDConfiguration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.minimumTextLength=0,this.maximumTextLength=0,this.gs1Handling="PARSE",this.strictMode=!0,this.formats=["CODABAR","CODE_11","CODE_25","CODE_32","CODE_39","CODE_93","CODE_128","DATABAR","DATABAR_EXPANDED","DATABAR_LIMITED","EAN_8","EAN_13","IATA_2_OF_5","INDUSTRIAL_2_OF_5","ITF","MSI_PLESSEY","PHARMA_CODE","PZN","UPC_A","UPC_E"],void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.stripCheckDigits&&(this.stripCheckDigits=t.stripCheckDigits),void 0!==t.minimumTextLength&&(this.minimumTextLength=t.minimumTextLength),void 0!==t.maximumTextLength&&(this.maximumTextLength=t.maximumTextLength),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling),void 0!==t.strictMode&&(this.strictMode=t.strictMode),void 0!==t.formats&&(this.formats=t.formats.map((t=>t)))}}class R extends s.a{constructor(t={}){super(),this._type="BarcodeFormatCommonTwoDConfiguration",this.regexFilter="",this.gs1Handling="PARSE",this.strictMode=!0,this.formats=["AZTEC","DATA_MATRIX","MAXICODE","MICRO_QR_CODE","MICRO_PDF_417","PDF_417","QR_CODE","RMQR_CODE"],void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling),void 0!==t.strictMode&&(this.strictMode=t.strictMode),void 0!==t.formats&&(this.formats=t.formats.map((t=>t)))}}class I extends s.a{constructor(t={}){super(),this._type="BarcodeFormatCommonFourStateConfiguration",this.regexFilter="",this.formats=["AUSTRALIA_POST","JAPAN_POST","ROYAL_MAIL","ROYAL_TNT_POST","USPS_INTELLIGENT_MAIL"],void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.formats&&(this.formats=t.formats.map((t=>t)))}}class W extends s.a{constructor(t={}){super(),this._type="BarcodeFormatCommonConfiguration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.minimumTextLength=0,this.maximumTextLength=0,this.gs1Handling="PARSE",this.strictMode=!0,this.formats=["AZTEC","CODABAR","CODE_39","CODE_93","CODE_128","DATA_MATRIX","DATABAR","DATABAR_EXPANDED","DATABAR_LIMITED","EAN_13","EAN_8","ITF","MICRO_QR_CODE","PDF_417","QR_CODE","UPC_A","UPC_E"],void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.stripCheckDigits&&(this.stripCheckDigits=t.stripCheckDigits),void 0!==t.minimumTextLength&&(this.minimumTextLength=t.minimumTextLength),void 0!==t.maximumTextLength&&(this.maximumTextLength=t.maximumTextLength),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling),void 0!==t.strictMode&&(this.strictMode=t.strictMode),void 0!==t.formats&&(this.formats=t.formats.map((t=>t)))}}},function(t,e,n){"use strict";(function(t){function o(t,e=!1){const n=[];if(e)return n;return function t(e){if(e)if(e.constructor===ImageData)n.push(e.data.buffer);else if(e.constructor===ArrayBuffer)n.push(e);else if(ArrayBuffer.isView(e))n.push(e.buffer);else if(Array.isArray(e))for(let n=0;n<e.length;++n)t(e[n]);else if(e.constructor===Object)for(const n in e)e.hasOwnProperty(n)&&t(e[n])}(t),n}function i(t){return t.startsWith("http:")||t.startsWith("https:")}function r(){if("undefined"!=typeof t&&"undefined"!=typeof t.versions&&"undefined"!=typeof t.versions.node)return!1;if(/(iPad|iPhone|iPod)/g.test(navigator.userAgent))return!1;try{return(new MessageChannel).port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11]))}catch(t){return!1}}function a(t){const{allowSimd:e=!0,allowThreads:n=!0}=t||{};let o="";if(e&&function(){try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11]))}catch(t){return!1}}()){o+="-simd";n&&r()&&(o+="-threads")}return o}n.d(e,"b",(function(){return o})),n.d(e,"d",(function(){return i})),n.d(e,"a",(function(){return r})),n.d(e,"c",(function(){return a}))}).call(this,n(42))},function(t,e,n){"use strict";n.r(e),n.d(e,"BarcodeItem",(function(){return a})),n.d(e,"BarcodeDocumentFormats",(function(){return s})),n.d(e,"BarcodeScannerConfiguration",(function(){return l})),n.d(e,"BarcodeScannerResult",(function(){return c}));var o=n(32),i=n(4),r=n(19);class a extends i.a{constructor(t={}){if(super(),this.format="NONE",this.isUpsideDown=!1,this.sourceImage=null,this.isGS1Message=!1,this.isGS1CompositePart=!1,this.dataBarStackSize=1,void 0===t.text)throw new Error("text must be present in constructor argument");if(this.text=t.text,void 0!==t.format&&(this.format=t.format),void 0===t.quad)throw new Error("quad must be present in constructor argument");if(this.quad=t.quad.map((t=>({x:t.x,y:t.y}))),void 0!==t.isUpsideDown&&(this.isUpsideDown=t.isUpsideDown),void 0!==t.sourceImage&&(this.sourceImage=null!=t.sourceImage?t.sourceImage:null),void 0===t.rawBytes)throw new Error("rawBytes must be present in constructor argument");if(this.rawBytes=t.rawBytes,void 0===t.upcEanExtension)throw new Error("upcEanExtension must be present in constructor argument");if(this.upcEanExtension=t.upcEanExtension,void 0!==t.isGS1Message&&(this.isGS1Message=t.isGS1Message),void 0!==t.isGS1CompositePart&&(this.isGS1CompositePart=t.isGS1CompositePart),void 0!==t.dataBarStackSize&&(this.dataBarStackSize=t.dataBarStackSize),void 0===t.parsedDocument)throw new Error("parsedDocument must be present in constructor argument");this.parsedDocument=null!=t.parsedDocument?new r.GenericDocument(t.parsedDocument):null}}class s extends i.a{constructor(t={}){super()}}!function(t){t.all=["AAMVA","BOARDING_PASS","DE_MEDICAL_PLAN","MEDICAL_CERTIFICATE","ID_CARD_PDF_417","SEPA","SWISS_QR","VCARD","GS1","HIBC"],t.documentBarcodeFormats={AAMVA:["PDF_417"],ID_CARD_PDF_417:["PDF_417"],SEPA:["QR_CODE"],MEDICAL_CERTIFICATE:["PDF_417"],DE_MEDICAL_PLAN:["DATA_MATRIX"],BOARDING_PASS:["PDF_417","AZTEC"],VCARD:["QR_CODE"],SWISS_QR:["QR_CODE"],GS1:["CODE_128","AZTEC","DATA_MATRIX","DATABAR","DATABAR_EXPANDED","DATABAR_LIMITED","EAN_13","EAN_8","GS1_COMPOSITE","ITF","MICRO_PDF_417","PDF_417","QR_CODE","UPC_A","UPC_E"],HIBC:["CODE_39","CODE_128","AZTEC","DATA_MATRIX","MICRO_PDF_417","PDF_417","QR_CODE"]}}(s||(s={}));class l extends i.a{constructor(t={}){super(),this.barcodeFormatConfigurations=[new o.BarcodeFormatCommonConfiguration({})],this.engineMode="NEXT_GEN_LOW_POWER",this.live=!0,this.acceptedDocumentFormats=["AAMVA","BOARDING_PASS","DE_MEDICAL_PLAN","MEDICAL_CERTIFICATE","ID_CARD_PDF_417","SEPA","SWISS_QR","VCARD","GS1","HIBC"],this.returnBarcodeImage=!0,void 0!==t.barcodeFormatConfigurations&&(this.barcodeFormatConfigurations=t.barcodeFormatConfigurations.map((t=>o.BarcodeFormatConfigurationBase.From(t)))),void 0!==t.engineMode&&(this.engineMode=t.engineMode),void 0!==t.live&&(this.live=t.live),void 0!==t.acceptedDocumentFormats&&(this.acceptedDocumentFormats=t.acceptedDocumentFormats.map((t=>t))),void 0!==t.returnBarcodeImage&&(this.returnBarcodeImage=t.returnBarcodeImage)}}class c extends i.a{constructor(t={}){if(super(),void 0===t.barcodes)throw new Error("barcodes must be present in constructor argument");if(this.barcodes=t.barcodes.map((t=>new a(t))),void 0===t.success)throw new Error("success must be present in constructor argument");this.success=t.success}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));class o{constructor(){this.values=new Map}}o.INSTANCE=new o},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));class o{constructor(){this.container=void 0,this.containerId=void 0}static mapValues(t,e,n){Object.keys(t).forEach((o=>{(null==n?void 0:n.includes(o))||(e[o]=t[o])}))}static mapValuesDeep(t,e){const n=t=>t&&"object"==typeof t&&!Array.isArray(t);Object.keys(t).forEach((i=>{i in e&&n(t[i])&&n(e[i])?o.mapValuesDeep(t[i],e[i]):e[i]=t[i]}))}static _fromJson(t,e){return this.mapValuesDeep(e,t),t}}},function(t,e,n){"use strict";var o,i=function(){return"undefined"==typeof o&&(o=Boolean(window&&document&&document.all&&!window.atob)),o},r=function(){var t={};return function(e){if("undefined"==typeof t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}t[e]=n}return t[e]}}(),a=[];function s(t){for(var e=-1,n=0;n<a.length;n++)if(a[n].identifier===t){e=n;break}return e}function l(t,e){for(var n={},o=[],i=0;i<t.length;i++){var r=t[i],l=e.base?r[0]+e.base:r[0],c=n[l]||0,u="".concat(l," ").concat(c);n[l]=c+1;var d=s(u),h={css:r[1],media:r[2],sourceMap:r[3]};-1!==d?(a[d].references++,a[d].updater(h)):a.push({identifier:u,updater:g(h,e),references:1}),o.push(u)}return o}function c(t){var e=document.createElement("style"),o=t.attributes||{};if("undefined"==typeof o.nonce){var i=n.nc;i&&(o.nonce=i)}if(Object.keys(o).forEach((function(t){e.setAttribute(t,o[t])})),"function"==typeof t.insert)t.insert(e);else{var a=r(t.insert||"head");if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(e)}return e}var u,d=(u=[],function(t,e){return u[t]=e,u.filter(Boolean).join("\n")});function h(t,e,n,o){var i=n?"":o.media?"@media ".concat(o.media," {").concat(o.css,"}"):o.css;if(t.styleSheet)t.styleSheet.cssText=d(e,i);else{var r=document.createTextNode(i),a=t.childNodes;a[e]&&t.removeChild(a[e]),a.length?t.insertBefore(r,a[e]):t.appendChild(r)}}function f(t,e,n){var o=n.css,i=n.media,r=n.sourceMap;if(i?t.setAttribute("media",i):t.removeAttribute("media"),r&&"undefined"!=typeof btoa&&(o+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(r))))," */")),t.styleSheet)t.styleSheet.cssText=o;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(o))}}var p=null,m=0;function g(t,e){var n,o,i;if(e.singleton){var r=m++;n=p||(p=c(e)),o=h.bind(null,n,r,!1),i=h.bind(null,n,r,!0)}else n=c(e),o=f.bind(null,n,e),i=function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(n)};return o(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;o(t=e)}else i()}}t.exports=function(t,e){(e=e||{}).singleton||"boolean"==typeof e.singleton||(e.singleton=i());var n=l(t=t||[],e);return function(t){if(t=t||[],"[object Array]"===Object.prototype.toString.call(t)){for(var o=0;o<n.length;o++){var i=s(n[o]);a[i].references--}for(var r=l(t,e),c=0;c<n.length;c++){var u=s(n[c]);0===a[u].references&&(a[u].updater(),a.splice(u,1))}n=r}}}},function(t,e,n){"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=t(e);return e[2]?"@media ".concat(e[2]," {").concat(n,"}"):n})).join("")},e.i=function(t,n,o){"string"==typeof t&&(t=[[null,t,""]]);var i={};if(o)for(var r=0;r<this.length;r++){var a=this[r][0];null!=a&&(i[a]=!0)}for(var s=0;s<t.length;s++){var l=[].concat(t[s]);o&&i[l[0]]||(n&&(l[2]?l[2]="".concat(n," and ").concat(l[2]):l[2]=n),e.push(l))}},e}},function(t,e,n){"use strict";var o="6.0.0-dev.4";class i{}i.VERSION=o,i.CDN_PATH="https://cdn.jsdelivr.net/npm/scanbot-web-sdk@6.0.0-dev.4/bundle/",i.DEFAULT_WASM_FOLDER="bin/complete/",i.BUILD_WITH_UI=!1;var r=n(33);class a{constructor(t,e){this.errorInWorker=null,this.createProxy=t=>new Proxy({},{get:(e,n,o)=>(...e)=>this.post(n,e,t)}),this.handleUnrecoverableError=t=>{this.errorInWorker=t;for(const e in this.continuations)this.continuations[e].reject(t),delete this.continuations[e]},this.copyArgs=this.createProxy("copy"),this.transferArgs=this.createProxy("transfer");const{requestSuffix:n=""}=e||{},o=Object(r.c)(e),i=`${t}${t.endsWith("/")?"":"/"}ScanbotSDK.Core${o}.js${n}`;if(Object(r.d)(i)){const t=new Blob([`importScripts("${i}")`]);this.instance=new Worker(URL.createObjectURL(t))}else this.instance=new Worker(i);this.continuations={},this.nextTicketId=1,this.instance.onmessage=t=>{const{log:e,logError:n}=t.data;if(e)return void console.log(...e);if(n)return void console.error(...n);const{ticket:o,result:i,recoverableError:r,unrecoverableError:a}=t.data,s=this.continuations[o];if(!s)return;const{resolve:l,reject:c}=s;delete this.continuations[o],a?(c(a),this.handleUnrecoverableError(a)):r?c(r):l(i)},this.instance.onerror=t=>{this.handleUnrecoverableError(t.error)}}post(t,e,n){return this.errorInWorker?Promise.reject(this.errorInWorker):new Promise(((o,i)=>{const a=Object(r.b)(e,"copy"==n),s=this.nextTicketId++;this.continuations[s]={resolve:o,reject:i},this.instance.postMessage({command:t,args:e,ticket:s},a)}))}destroy(){this.instance.terminate()}}var s=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class l extends Error{}class c extends Error{}class u{constructor(t,e,n){this.copyArgs=this.createProxy("copy"),this.transferArgs=this.createProxy("transfer"),t||(t=i.CDN_PATH+i.DEFAULT_WASM_FOLDER),this.core=new a(t,e),this.coreInitializationSuccessful=(()=>s(this,void 0,void 0,(function*(){if(yield this.core.copyArgs.initialize(...n)){let e;try{e=yield this.core.copyArgs.version()}catch(t){e="Error"}const n=i.VERSION;return e!==n?new c(`Version mismatch! \nVersion of ScanbotSDK.(ui2.)min.js is "${n}" \nbut the version of the loaded ScanbotSDK.Core*.js file is "${e}". \nThe ScanbotSDK.Core*.js file was loaded from ${t}.`):"OK"}return new l("WASM not initialized successfully. This can be due to an invalid license or problems loading the WASM file. Please check the console for more information.")})))()}awaitInitialized(){return s(this,void 0,void 0,(function*(){yield this.getCoreForCommand()}))}createProxy(t){return new Proxy({},{get:(e,n,o)=>(...e)=>s(this,void 0,void 0,(function*(){const o=yield this.getCoreForCommand(n),i="copy"===t?o.copyArgs:o.transferArgs;return yield i[n](...e)}))})}getCoreForCommand(t=""){return s(this,void 0,void 0,(function*(){const e=yield this.coreInitializationSuccessful;if("OK"===e||"getLicenseInfo"===t&&e instanceof l)return this.core;throw e}))}destroy(){this.core.destroy(),this.core=void 0}}class d{isValid(){return"Okay"===this.status||"Trial"===this.status}static fromJson(t){const e=new d;return e.status=t.licenseStatus,e.description=t.description,e}}var h=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class f{constructor(t,e){this._sdk=t,this._pdfOperation=e}addPage(t,e="COPY_IMAGE"){return h(this,void 0,void 0,(function*(){const n=this._sdk.getBridge(e);yield n.addPageToPdf(this._pdfOperation,t)}))}complete(){return h(this,void 0,void 0,(function*(){return yield this._sdk.bridge.copyArgs.completePdf(this._pdfOperation)}))}}var p=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class m{constructor(t,e){this._sdk=t,this._tiffOperation=e}addPage(t,e={}){return p(this,void 0,void 0,(function*(){const{binarize:n="ENABLED_IF_BINARIZATION_FILTER_SET",consumeImage:o="COPY_IMAGE"}=e,i=this._sdk.getBridge(o);yield i.addPageToTiff(this._tiffOperation,t,n)}))}complete(){return p(this,void 0,void 0,(function*(){return yield this._sdk.bridge.copyArgs.completeTiff(this._tiffOperation)}))}}var g=n(21);class v{static toPixelSize(t){return t+"px"}static containsString(t,e){return!!t&&-1!==t.indexOf(e)}static copy(t){return JSON.parse(JSON.stringify(t))}static getProperty(t,e){if(t&&t.hasOwnProperty(e))return t[e]}static uuid(){let t="";const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=e.length;for(let o=0;o<5;o++)t+=e.charAt(Math.floor(Math.random()*n));return t}}var A=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class b{static toDataUrl(t){return new Promise(((e,n)=>{const o=new Blob([t],{type:"image/jpeg"}),i=new FileReader;i.onload=()=>e(i.result),i.onerror=()=>n(i.error),i.readAsDataURL(o)}))}static getObjectFitSize(t,e,n=!0){const o=e.width/e.height,i=t.width/t.height;let r=0,a=0;(n?o>i:o<i)?(r=t.width,a=r/o):(a=t.height,r=a*o);const s=(t.width-r)/2,l=(t.height-a)/2;return new g.a(s,l,r,a)}static loadFromUrl(t){return new Promise(((e,n)=>{const o=document.createElement("img");o.src=t,o.onload=()=>A(this,void 0,void 0,(function*(){const t=document.createElement("canvas");t.width=o.width,t.height=o.height;const n=t.getContext("2d");n.drawImage(o,0,0);const i=n.getImageData(0,0,o.width,o.height);e(i)})),o.onerror=n}))}static saveImageData(t){const e=this.createImageDataCanvas(t),n=" ("+t.width+"x"+t.height+")";e.toBlob((t=>this.saveBlob(t,v.uuid()+n+".png")))}static createImageDataCanvas(t){const e=document.createElement("canvas");return e.className="scanbot-sdk-canvas-element",e.width=t.width,e.height=t.height,e.getContext("2d").putImageData(t,0,0),e}static saveBlob(t,e){let n=document.createElement("a");n.setAttribute("download",e);let o=URL.createObjectURL(t);n.setAttribute("href",o),n.click()}static convertImageDataWrapperToImageData(t){if(t)return new ImageData(t.data,t.width,t.height)}static wrapperToBase64(t){return b.createImageDataCanvas(b.convertImageDataWrapperToImageData(t)).toDataURL("image/png")}static toBase64(t){return A(this,void 0,void 0,(function*(){const e=yield new Promise((e=>{const n=new FileReader;n.onload=()=>e(n.result),n.readAsDataURL(new Blob([t]))}));return e.slice(e.indexOf(",")+1)}))}}class y{saveImageAsJpeg(t,e){if(!t||0===t.length)return void console.log("Data cannot be null or empty");e||(e=v.uuid()+".jpeg");let n=new Blob([t],{type:"image/jpeg"});b.saveBlob(n,e)}isCameraSupported(){return!!navigator.mediaDevices}flash(){let t=this.findFlashElement();t.style.display="block",this.animateFlashOpacity("0.5",(()=>{this.animateFlashOpacity("0.0",(()=>{t.style.opacity="1.0",t.style.display="none"}))}))}findFlashElement(){return this.getOrCreateElement("flash",{position:"fixed",top:"0",left:"0",width:"100%",height:"100%","background-color":"#fff",display:"none","z-index":"5000"})}animateFlashOpacity(t,e){const n=this.getElementByClassName("flash");setTimeout((()=>{n.style.opacity=t,e()}),150)}getOrCreateElement(t,e){let n=this.getElementByClassName(t);return n||(this.createElement(t,e),n=this.getElementByClassName(t)),n}createElement(t,e){let n=document.createElement("div");n.className=t,n.style.cssText=this.cssToString(e),document.body.append(n)}cssToString(t){let e="";return Object.keys(t).forEach((n=>{e+=n+":"+t[n]+";"})),e}getElementByClassName(t){const e=document.getElementsByClassName(t);if(0!==e.length)return e[0]}}var C=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class S{constructor(t,e){this._sdk=t,this._mrzRecognizerToken=e}recognize(t,e="COPY_IMAGE"){return C(this,void 0,void 0,(function*(){const n=this._sdk.getBridge(e);return yield n.recognizeMRZ(yield this._mrzRecognizerToken,t)}))}recognizeURL(t){return C(this,void 0,void 0,(function*(){return new Promise((e=>{const n=document.createElement("canvas"),o=document.createElement("img");o.src=t,o.onload=()=>C(this,void 0,void 0,(function*(){n.width=o.width,n.height=o.height;const t=n.getContext("2d");t.drawImage(o,0,0);const i=t.getImageData(0,0,o.width,o.height),r=yield this.recognize(i);e(r||void 0)}))}))}))}release(){return C(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.releaseObject(yield this._mrzRecognizerToken)}))}}var w=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class x{constructor(t,e){this._sdk=t,this._OcrEngineToken=e}performOcr(t,e="COPY_IMAGE"){return w(this,void 0,void 0,(function*(){const n=this._sdk.getBridge(e);return yield n.performOcr(this._OcrEngineToken,t)}))}recognizeURL(t){return w(this,void 0,void 0,(function*(){return new Promise((e=>{const n=document.createElement("canvas"),o=document.createElement("img");o.src=t,o.onload=()=>w(this,void 0,void 0,(function*(){n.width=o.width,n.height=o.height;const t=n.getContext("2d");t.drawImage(o,0,0);const i=t.getImageData(0,0,o.width,o.height),r=yield this.performOcr(i);e(r)}))}))}))}release(){return w(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.releaseObject(this._OcrEngineToken)}))}}var E=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class L{constructor(t,e){this._sdk=t,this._textDataScannerToken=e}recognize(t,e="COPY_IMAGE"){return E(this,void 0,void 0,(function*(){const n=this._sdk.getBridge(e);return yield n.recognizeTextLine(yield this._textDataScannerToken,t)}))}cleanRecognitionQueue(){return E(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.cleanTextLineRecognitionQueue(yield this._textDataScannerToken)}))}recognizeURL(t){return E(this,void 0,void 0,(function*(){return new Promise((e=>{const n=document.createElement("canvas"),o=document.createElement("img");o.src=t,o.onload=()=>E(this,void 0,void 0,(function*(){n.width=o.width,n.height=o.height;const t=n.getContext("2d");t.drawImage(o,0,0);const i=t.getImageData(0,0,o.width,o.height),r=yield this.recognize(i,"CONSUME_IMAGE");r&&e(r)}))}))}))}release(){return E(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.releaseObject(yield this._textDataScannerToken)}))}}var _=n(14),O=n(22),T=n(9);class k extends O.a{constructor(){super(_.a.DEFAULT_VIDEO_RESOLUTION_HD),this.ocrConfiguration=new T.GenericTextLineScannerTypes.ScannerConfiguration,this.onTextDetected=function(t){},this.finder.aspectRatio=new T.Geometry.AspectRatio({width:6,height:1}),this.userGuidance.title.text="Please hold the device over the text to start scanning"}static fromJson(t){const e=new k;return this.mapFinderConfiguration(e,t),this._fromJson(e,t)}}class D extends O.a{constructor(){super(_.a.DEFAULT_VIDEO_RESOLUTION_HD),this.ocrConfiguration=new T.GenericTextLineScannerTypes.ScannerConfiguration,this.onTextDetected=function(t){},this.finder.aspectRatio=new T.Geometry.AspectRatio({width:6,height:1}),this.userGuidance.title.text="Please hold the device over the vehicle identification number to start scanning"}static fromJson(t){const e=new D;return this.mapFinderConfiguration(e,t),this._fromJson(e,t)}}class P extends Error{constructor(t){super(t.description),this.name="LicenseError"}}class B{static throwIfMissingBuffer(t){B.throwIfMissing(t,"ImageBuffer may not be null")}static throwIfMissing(t,e){if(!t)throw new Error(e)}}var F=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class R{constructor(t,e){this._sdk=t,this._token=e}analyze(t,e="COPY_IMAGE"){return F(this,void 0,void 0,(function*(){B.throwIfMissingBuffer(t);const n=this._sdk.getBridge(e);return yield n.documentQualityAnalyzerAnalyze(this._token,t)}))}release(){return F(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.releaseObject(this._token)}))}}var I=n(16),W=n(0),M=n(43),j=n(13),z=n(3),N=n.n(z),V=n(5);const U="var(--1-sb-dvh, 1vh)";function H(){const t=Object(W.useMemo)((()=>{var t,e;return null===(e=null===(t=null===window||void 0===window?void 0:window.CSS)||void 0===t?void 0:t.supports)||void 0===e?void 0:e.call(t,"height: 100dvh")}),[]),e=()=>{var e=t?"1dvh":window.innerHeight/100+"px";document.documentElement.style.setProperty("--1-sb-dvh",e)};return Object(W.useEffect)((()=>{if(e(),!t)return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}})),null}var G=n(30),Q=n(11),Y=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(n[o[i]]=t[o[i]])}return n};function Z(t){const e=Object(W.useContext)(V.a).getColorValue,{styleConfig:n}=t,o=Y(t,["styleConfig"]),i=Object.assign(Object.assign({},t.style),{backgroundColor:e(n.fillColor),borderColor:e(n.strokeColor),borderWidth:n.strokeWidth,borderRadius:n.cornerRadius,borderStyle:"solid"});return W.default.createElement(z.Box,Object.assign({},o,{style:i}))}function q(t){var e;return t.visible?W.default.createElement(z.Button,{variant:"text",onClick:t.onClick,sx:Object.assign(Object.assign({flex:1},Object(Q.b)(t.foreground)),{textTransform:"none",fontSize:18,"&:hover, &:focus, &:active, &":{outline:"none",backgroundColor:"transparent"},px:0}),disableRipple:!0},W.default.createElement(Z,{styleConfig:Object.assign(Object.assign({},t.background),{cornerRadius:4}),sx:{borderStyle:"solid",px:"8px"}},null!==(e=t.icon)&&void 0!==e?e:null,V.b.getLocalizedBarcodeText(t.text))):W.default.createElement("div",{style:{display:"flex",flex:1}})}G.a;const X=W.default.createContext(null);function $(t){const e=t.mode,n="HIDDEN"===e?0:48;Object(W.useEffect)((()=>{if("HIDDEN"===e)return;const n=document.createElement("meta");return n.name="theme-color",n.content=V.b.getColorValue(t.backgroundColor),document.head.appendChild(n),()=>{document.head.removeChild(n)}}),[e]);const o="SOLID"===e?0:n,i={height:n,remainingVisibleBodyHeight:"SOLID"===e?`calc(100 * ${U} - ${n}px)`:`calc(100 * ${U})`,minTopPaddingForContent:o,minTopPaddingForViewFinder:10+o},r="SOLID"===e?{backgroundColor:V.b.getColorValue(t.backgroundColor)}:{backgroundImage:`linear-gradient(to bottom, ${V.b.getColorValue(t.backgroundColor)}, #00000000)`,position:"absolute",backgroundColor:"transparent"};return W.default.createElement(W.default.Fragment,null,"HIDDEN"!==e&&W.default.createElement(z.AppBar,{position:"static",elevation:0,sx:Object.assign({zIndex:1e5,height:n,minHeight:n},r)},W.default.createElement(z.Toolbar,{variant:"dense",sx:{height:n,minHeight:n}},W.default.createElement(z.Box,{sx:{flex:1}},t.cancelButton.visible&&W.default.createElement(W.default.Fragment,null,W.default.createElement(q,Object.assign({onClick:t.onBackPress,icon:t.cancelButton.foreground.iconVisible&&W.default.createElement(N.a,{sx:{fontSize:12,mr:"5px"}})},t.cancelButton)))),W.default.createElement(z.Box,null,W.default.createElement(z.Typography,{variant:"h6",noWrap:!0,component:"div",fontSize:18,fontWeight:600},W.default.createElement(Q.a,{config:t.title}))),W.default.createElement(z.Box,{sx:{flex:1}}))),W.default.createElement(X.Provider,{value:i},t.children))}function K(t){return{textOverflow:"ellipsis","-webkit-box-orient":"vertical","-webkit-line-clamp":`${t}`,overflow:"hidden",whiteSpace:t>1?"normal":"nowrap",display:t>1?"-webkit-box":"block"}}function J(t){if(t.loading)return W.default.createElement(z.Skeleton,{variant:"rounded",width:t.imageSize,height:t.imageSize,style:{borderRadius:8}});if(null===t.data.barcodeImage){const e={width:t.imageSize,height:t.imageSize,backgroundColor:"#E0E0E0",borderRadius:3};return W.default.createElement(z.Box,{sx:e})}const e={width:t.imageSize,height:t.imageSize,borderRadius:8};return W.default.createElement("img",{src:t.data.barcodeImage,alt:t.data.title,style:e})}function tt(t){var e,n;const o=(null===(e=t.barcodeMappedData)||void 0===e?void 0:e.state)||"LOADING",i=(null===(n=t.barcodeMappedData)||void 0===n?void 0:n.value)||{title:"",subtitle:"",barcodeImage:""},r=!t||"LOADED"!==o,a=t.imageSize,s=t.barcodeTitle.visible||t.barcodeSubtitle.visible||t.counterForm,l=t.counterForm&&{"&:hover, &:focus, &:active, &":{borderColor:V.b.getColorValue(t.counterForm.manualCountOutlineColor),backgroundColor:"transparent"}};return W.default.createElement(z.Box,{sx:{display:"flex"},"data-sb-barcode-info":"1"},t.barcodeImageVisible&&W.default.createElement(z.Box,{sx:{pr:s?"16px":0,display:"flex",alignItems:"center",justifyContent:"center"}},W.default.createElement(J,{data:i,imageSize:a,loading:r})),s&&W.default.createElement(z.Box,{sx:{flex:1,display:"flex",flexDirection:"column",verticalAlign:"middle",justifyContent:"center",m:0,p:0,minWidth:0}},t.barcodeTitle.visible&&W.default.createElement(z.Box,{display:r?"block":"flex",sx:{alignItems:"center"}},W.default.createElement(z.Typography,{fontSize:16,fontWeight:"bold",sx:Object.assign(Object.assign({},K(t.maxNumberOfTitleLines)),Object(Q.b)(t.barcodeTitle))},r?W.default.createElement(z.Skeleton,{variant:"text"}):i.title),t.displayRightArrow&&!r&&W.default.createElement(N.a,{sx:{fontSize:16,fontWeight:"bold",color:V.b.getColorValue(t.barcodeTitle.color)}})),t.barcodeSubtitle.visible&&W.default.createElement(z.Typography,{fontSize:14,fontWeight:400,sx:Object.assign(Object.assign({},K(t.maxNumberOfSubtitleLines)),Object(Q.b)(t.barcodeSubtitle))},r?W.default.createElement(z.Skeleton,{variant:"text"}):i.subtitle),t.counterForm&&W.default.createElement(z.ButtonGroup,{variant:"outlined"},W.default.createElement(z.Button,{disabled:!t.counterForm.removeButtonEnabled,sx:l,style:{opacity:t.counterForm.removeButtonEnabled?1:.3},onClick:()=>t.counterForm.setCounter(t.counterForm.counter-1),disableRipple:!0},W.default.createElement(N.a,{sx:{color:V.b.getColorValue(t.counterForm.manualCountChangeColor)}})),W.default.createElement(z.Button,{sx:Object.assign(Object.assign({},l),{color:V.b.getColorValue(t.counterForm.manualCountChangeColor),fontWeight:"bold",fontSize:16}),onClick:t.counterForm.onNumberClick,disableRipple:!0},t.counterForm.counter),W.default.createElement(z.Button,{disabled:!t.counterForm.addButtonEnabled,sx:l,style:{opacity:t.counterForm.addButtonEnabled?1:.3},onClick:()=>t.counterForm.setCounter(t.counterForm.counter+1),disableRipple:!0},W.default.createElement(N.a,{sx:{color:V.b.getColorValue(t.counterForm.manualCountChangeColor)}})))))}j.ButtonConfiguration;function et(t){const e=Object(W.useContext)(V.a).getColorValue;return t.visible?W.default.createElement(z.Button,{onClick:t.onClick,type:t.type,sx:Object.assign(Object.assign({},t.style),{"&:hover, &:focus, &:active, &":{borderStyle:"solid",borderColor:e(t.background.strokeColor),borderWidth:t.background.strokeWidth,backgroundColor:e(t.background.fillColor),textTransform:"none",outline:"none"}}),disableRipple:!0},t.foreground.iconVisible&&t.icon&&W.default.createElement(t.icon,{sx:{color:e(t.foreground.color),pr:2}}),W.default.createElement(Q.a,{config:{visible:!0,text:t.text,color:t.foreground.color,useShadow:t.foreground.useShadow}})):null}var nt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(n[o[i]]=t[o[i]])}return n};function ot(t){var e,{modalOverlayColor:n}=t,o=nt(t,["modalOverlayColor"]);const i={backdrop:{style:{backgroundColor:V.b.getColorValue(n)}}},r=Object.assign(Object.assign({},o.PaperProps),{sx:Object.assign(Object.assign({},null===(e=o.PaperProps)||void 0===e?void 0:e.sx),{maxWidth:400})});return W.default.createElement(z.Dialog,Object.assign({},o,{componentsProps:i,PaperProps:r}))}function it(t){const e=Object(W.useContext)(V.a).getColorValue,n=!t.barcodeMappedData||"LOADED"!==t.barcodeMappedData.state,o={backgroundColor:e(n?t.sheetColorLoading:t.sheetColorLoaded)},[i,r]=W.default.useState(),a=Object(W.useRef)((()=>{}));Object(W.useEffect)((()=>{t.open&&r(!1)}),[t.open]);const s=()=>{a.current=t.handleCancel,r(!0)};return W.default.createElement(ot,{modalOverlayColor:t.modalOverlayColor,open:t.open&&!i,fullWidth:!0,TransitionProps:{onExited:()=>{i&&a.current()}},onClose:()=>{n||s()}},W.default.createElement(z.DialogContent,{style:o},W.default.createElement(tt,Object.assign({},t,{maxNumberOfTitleLines:2,maxNumberOfSubtitleLines:1,imageSize:68}))),W.default.createElement(z.DialogActions,{style:o},W.default.createElement(N.a,{container:!0,spacing:2,sx:{overflow:"hidden"}},W.default.createElement(N.a,{item:!0,xs:12},W.default.createElement(N.a,{color:e(t.dividerColor)})),n?W.default.createElement(N.a,{item:!0,xs:12,sx:{textAlign:"center"}},W.default.createElement(z.Box,null,W.default.createElement(z.CircularProgress,{sx:{color:e(t.loadingMessage.color),verticalAlign:"middle",mr:2}}),W.default.createElement(Q.a,{config:t.loadingMessage}))):W.default.createElement(W.default.Fragment,null,W.default.createElement(N.a,{item:!0,xs:6},W.default.createElement(et,Object.assign({style:{width:"100%"},onClick:s},t.cancelButton))),W.default.createElement(N.a,{item:!0,xs:6},W.default.createElement(et,Object.assign({style:{width:"100%"},onClick:()=>{a.current=t.handleSubmit,r(!0)}},t.submitButton)))))))}var rt=n(1);rt.h;function at(t){if(!1===t.visible)return null;const e={backgroundColor:t.active?V.b.getColorValue(t.activeBackgroundColor):V.b.getColorValue(t.backgroundColor),color:t.active?V.b.getColorValue(t.activeForegroundColor):V.b.getColorValue(t.foregroundColor)};return W.default.createElement(z.IconButton,{sx:Object.assign(Object.assign({},e),{"&:hover, &:focus":Object.assign({outline:"none"},e),width:48,height:48}),onClick:t.onClick},t.text&&W.default.createElement("span",{style:{fontSize:15}},V.b.getLocalizedBarcodeText(t.text)),t.icon&&W.default.createElement(t.icon,{style:{padding:7}}))}var st=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class lt{constructor(){this.audioFile=new Audio}initialize(t){return st(this,void 0,void 0,(function*(){t.successBeepEnabled&&(this.audioFile.src="data:audio/mp4;base64,AAAAHGZ0eXBNNEEgAAACAE00QSBpc29taXNvMgAAAAhmcmVlAAASCG1kYXQBQCKAo3/4hS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS7/8QpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpd+aIUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLwBQCKAo3/4hS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS7/8QpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpd+aIUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLwA6jQEQfEIQGIQaqctMIv9EpiYforpaDbT80WfPFRSswKfd8cy6kN/+IUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0u//EKWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaXfViFLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLwA6jQQpRY6EYNCcKDAqAAEUgC2wFy0kF7JTgecsqIp6pxd/lHO7kUuSCLFK6n2mPOKfj5aKhQPOaRtBEKFS85eIYbr71AGaAPJTSIHeIhXTcpA5i155UICz3nXk0Cz0A8QhxIhoqQIJ2Be9MIEiJ6GpuMa1fPXcJmIoxDUKpZuJozBa6iFmjy7O/genSlwPKL6xaiiL8Y1XtgBDY7ke/CAOoawOqmZm6suSVQPbxzaxZJpWFcWva4RqTil72HqDpc2N4eG3KA0JkU8G58RNabxVq9gSLwysPKIzL1fZVF1FQwllEs4YUKpPtoMw2VtepdbZHqGriAsZ5Lu154uiewW41szI4RHfpWOWSH7s1LAzlv/xClpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWl36AhS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0vAA6jQEYVEIDEQDEKCAYhAIXMdbaI5q82OvhmYS1FO11cD3Yt4EwZI+aTsqoctJJaN0FKvNqorQmK3SUWpNOtf+uKNIxX3xeTEq8LKb/8QpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpd/+IUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0u+GEKWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpeABMDQD6WqsfRABwAUSib4c3/4hS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS7/8QpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpd+EIUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS8AAAO4bW9vdgAAAGxtdmhkAAAAAAAAAAAAAAAAAAAD6AAAAfgAAQAAAQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAiJ0cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAABAAAAAAAAAfgAAAAAAAAAAAAAAAEBAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAAH4AAAIAAABAAAAAAGabWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAAAfQAAAF8BVxAAAAAAALWhkbHIAAAAAAAAAAHNvdW4AAAAAAAAAAAAAAABTb3VuZEhhbmRsZXIAAAABRW1pbmYAAAAQc21oZAAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAABCXN0YmwAAABnc3RzZAAAAAAAAAABAAAAV21wNGEAAAAAAAAAAQAAAAAAAAAAAAEAEAAAAAAfQAAAAAAAM2VzZHMAAAAAA4CAgCIAAQAEgICAFEAVAAAAAAH0AAAAvXkFgICAAhWIBoCAgAECAAAAIHN0dHMAAAAAAAAAAgAAAAUAAAQAAAAAAQAAA8AAAAAcc3RzYwAAAAAAAAABAAAAAQAAAAYAAAABAAAAFHN0c3oAAAAAAAADAAAAAAYAAAAUc3RjbwAAAAAAAAABAAAALAAAABpzZ3BkAQAAAHJvbGwAAAACAAAAAf//AAAAHHNiZ3AAAAAAcm9sbAAAAAEAAAAGAAAAAQAAASJ1ZHRhAAABGm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAA7Wlsc3QAAAAzqW5hbQAAACtkYXRhAAAAAQAAAAAyNTAgTWlsbGlzZWNvbmRzIG9mIFNpbGVuY2UAAAApqUFSVAAAACFkYXRhAAAAAQAAAABBbmFyIFNvZnR3YXJlIExMQwAAAClhQVJUAAAAIWRhdGEAAAABAAAAAEFuYXIgU29mdHdhcmUgTExDAAAAI6lhbGIAAAAbZGF0YQAAAAEAAAAAQmxhbmsgQXVkaW8AAAAkqXRvbwAAABxkYXRhAAAAAQAAAABMYXZmNjAuMy4xMDAAAAAZY3BpbAAAABFkYXRhAAAAFQAAAAAA",yield this.play(),"MODERN_BEEP"===t.soundType&&(this.audioFile.src="data:audio/mp4;base64,AAAAHGZ0eXBNNEEgAAACAE00QSBpc29taXNvMgAAAAhmcmVlAAAEcm1kYXQBQCKAo30ghS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLwDmVAjh8QBrRiUH/88pKh3gJPmPt9t8oIUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLwDsl6UY83aVqFeq3aVmmYyFp70/kJT+A9hdePd7Z7aRSFKZBhCUP6E1rS/9+DhfmhvTknCnQzE+QHVPD6rhSIRpGIAFmBioF1XkxwAQjxKkQMc+qECgXnCAU1IcgpFDnWo02EdihsnrUx/1bJAUo+x6//p8VmoS0iuleHvPnKj9mjjHOoaDGI/s2DHcYI66Grp+5pezZuKJExJOzoyJRdmv6ltO6ibTdTDZ1YqLauKTebYOtpTWnh3/K3kBQmN3NsieqxzHeZKNiFphWuYSWMhaHIZRnRt6O/WzTXYFGrG0wBT54NCQ3wtSpqr5dHbQN2yY0jcckhLUieNtOSjS3u1NuMqWbOx1zHwlHfJKgI349OU9iZEzeN3rCVbBVdrdcAEW9Cm2Ji2FjQNkiFBViV6ofFsNVeVqpKgpsf3/iWtBG6cpMqFHjy2QhyBEnPtwTbWbm9b1u7frF3bnaVykqieEvTKfqnCYL2u4g1CLiQ4Zb8hkkTL9tnGmdMOeqIkUcHZ0zsspzvHOUXJTlssZTRjqcIsp514HJO9YhVRXALKaCRKQkbMEty3CstONNYzuhq57bbccc+/Pq22226ueWXLLbTTw4bFIoQoGWepZBRJWQFh4yui2+evKOqLp+rLKJ4LKcAtQ7XA0aLCyMRVDDOmuoYcnFEmIrpzmRQNQIJ5HWvOesgzjrK071chBhESdztJ0sMqhdAAyjegdEYPNyA4BCDQtLGRRKQQBQIhXYqGZ65Pu1S7XMxxVXEOWtJGMAARETyDKiMN4tsmFfcvmo+sHuHZrY196169rbT/sHFGNK1cnJrBK2vDu7b0AsBd9VaKrsNHL/KxFHm3Yma/+S365yvTF+abktGk7JSrS++mXLBw76AiuijMPpwzPoP4jNzZjI+R/p7zboMSKiFvZkMx8CDIPGB+K2Ee7XaOqAu8z6cWgazCp76DdzIwsmGw2TiczmQMAafEX0U6lQOAA6jQJAfCsBrSxVH+Hw8fPKIpB7JuhzAB/BwAAAw9tb292AAAAbG12aGQAAAAAAAAAAAAAAAAAAAPoAAAATwABAAABAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAACOnRyYWsAAABcdGtoZAAAAAMAAAAAAAAAAAAAAAEAAAAAAAAATwAAAAAAAAAAAAAAAQEAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAACRlZHRzAAAAHGVsc3QAAAAAAAAAAQAAAE4AAAgAAAEAAAAAAbJtZGlhAAAAIG1kaGQAAAAAAAAAAAAAAAAAAKxEAAAVgFXEAAAAAAAtaGRscgAAAAAAAAAAc291bgAAAAAAAAAAAAAAAFNvdW5kSGFuZGxlcgAAAAFdbWluZgAAABBzbWhkAAAAAAAAAAAAAAAkZGluZgAAABxkcmVmAAAAAAAAAAEAAAAMdXJsIAAAAAEAAAEhc3RibAAAAGdzdHNkAAAAAAAAAAEAAABXbXA0YQAAAAAAAAABAAAAAAAAAAAAAQAQAAAAAKxEAAAAAAAzZXNkcwAAAAADgICAIgABAASAgIAUQBUAAAAAARrvAAEa7wWAgIACEggGgICAAQIAAAAgc3R0cwAAAAAAAAACAAAABQAABAAAAAABAAABgAAAABxzdHNjAAAAAAAAAAEAAAABAAAABgAAAAEAAAAsc3RzegAAAAAAAAAAAAAABgAAALkAAAC6AAABIAAAAQAAAAC9AAAAGgAAABRzdGNvAAAAAAAAAAEAAAAsAAAAGnNncGQBAAAAcm9sbAAAAAIAAAAB//8AAAAcc2JncAAAAAByb2xsAAAAAQAAAAYAAAABAAAAYXVkdGEAAABZbWV0YQAAAAAAAAAhaGRscgAAAAAAAAAAbWRpcmFwcGwAAAAAAAAAAAAAAAAsaWxzdAAAACSpdG9vAAAAHGRhdGEAAAABAAAAAExhdmY2MC4zLjEwMA=="),"CLASSIC_BEEP"===t.soundType&&(this.audioFile.src="data:audio/mp4;base64,AAAAHGZ0eXBNNEEgAAAAAE00QSBtcDQyaXNvbQAAAAFtZGF0AAAAAAAACHchIANAaBv6AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOCFO4v////////gyh+L1JkJB36Cv0yBUdzB8/8/b8vveozPf+/6eH18deTh9kOp11urWAB5ZsMnhMwSjUCF2MQub4hybjxDhHACGof0XiT9tAHVOwt4NPtPOMFr/ndlTpTNXy79GYIfXP7VkPs99ySHNOFkpNrBS1pClU3rRGHp6Dy9FBIlk4KbBNBLGMJRcWQxuVsVJCSMnGw1FuIUrBN2UJLoEMhurMxpIiyGAweBvyfNJy4FbxqDm3WDjCtzP+3yVmOjxhIBDANLYyeG05LNyCZONEOk/c4hCj3Y2XQkgTI7y/39g0a+MuEoAdbRz4gSgRJnjEGB0TnOB0LtiL0XB9kwz2SwCBB0MvIByUSWTPTsRdCA4PvEmwnNdTnJT5/kPGk4swkTgOOuWJBI0EkxFs5mmNIR6wSFql36Hn03/Lf/uHp+6aTmBY0HJ6P6X1atw/Y8vK72LCWpsq0beo5KkrrrMe1eabaDyfZRPYfgPwH4Dv4CHU663VrAA8wchbBRlqQNnYNlYNhYNigNhoTBsTCcTCgLBEQCX+XfNd+3y+piKntTerXdXpDWRpLzsKmJ4iRM4ig+I6R65pDawx8Ry4cxfeifbsbzK/TxNhafR9y2zFVicy8nCVkU6CkmLckGtqbuYvhruBP0TriLNTU1TNhW6tUCdUSyneDUWAox5RTMlF2W1san5MQRlj7Btm2bZhoqoUUAJlpaat54WVuTyOxqwzNVhPenFR9KBpuA3qrUrT+3ShOUdXAkGXmCrMBxH3XmROdVSkS8cccRMOKTN+7OOEIQrMYIcna5hipAqPHk6VSgy0gGXljIk7GR/O606SyhhgglQIZLyxxOa/ZANmzZkyZMlRoqIt/T6xZHaFLcZ6n8jSgTVoOGsK5MvOlIBBkR+AtM5hvkTG2UzEhEAcsA7bZfCZmmZmZjQnqfn/yRwXzQtlZljFYd93mGppQSDDV/oz8HKkKjElN9Pu/inFmh3IHFyXlrJ/dodwM2EUkLZff1jWCO84wYUa3JB52yTMCETuUgA0BWB+I4hDBR1xoligVhgVhgNhYdBcLCcakAb1XLO/eZ9cUtvv6cNzrRYdMWgFvJySSSSscWFxCQElKcwc2dFkyos8dHfXPYFSt0klO2wUeIUxNKf5LiWYGm57bV0dipv7Qpw9uRRu23CuNIbT7++AuwEnyFWIQP0OpdUhc7u2k2fKW3mTZZxCSb+gVCjOzNf7LzxdBpbZxYwuNkcRlqAMdRMhq+tXmbLkMGGph20w4JvwvBm+x4Wtomh4lz0GGBVGQ96+JUXhvqQQAQPRTHtn+e7SwaCKMXnEEWXevaFVrPVEX7wxIBbbcpAHXj2DQz/vO9M0FHzyQFtegQjjn+fM99jgBE2fLJs/PLcErzrmCGJdVHZ19uxTErdmR6viG6cetew2MYQFm5AIDdPmjeXifvbFcjkYQWUsqKoBQJAKMp50hLtJRCKLCTSw2f7e0wzzhr6eGhjlyOQ8blgBiR0fxcjQYM5rBBM/wzuDe972u2f/mN7u8zVqGu7QADPHgAK4PxW8nJJJJLgISwUZaaRYmFRWRBEIwQKfmepncccZoqHnVy0WnFag51Yt48agPiK7D59zNlI+6YR9SHvnKoiJCcRzsskEGDgIrLQoLEgDguNTzeNvuxVpc8wntXmUlTQMa9WLn/geS8F7ku6Vt+I9yiumFP6I5hbEGeXac1BCB3YA3gNA0rLFPwrWq//VvtF6JGKIOVA12lCnpZl8NJojK1yqVsVKp+ZqbDpq0S1duspmvSvCbwmftOnwnfuNqBCnzZfzZF9fkqxTCqlq8GmR3bGK+1uvEcF55cGGx8BNANhkk1438/rWbXeTtPGfukvhUxZBp0M5447+2SFiQW674ySiGSRHgyqcqU0x39tbz3afnWt5BKNHDYj1lzq6sg8dcJlJnSQDUEba4npgEoAqVUkksoqM0UUO3VXDo3Mablwd2GLAoXjgK071swbuWhQJ2AjGYsBx5dtOMYCyPVh+K3jxqA+IuAhTrc+3KVqmDuVmIO5TZmQbDr4vUV+0338fXQ3665PiYnII1REb2klWhUcwjqi/pMe4yYZaDbo9T1ougUKE5h1jUim2NZxM71zBZVa/tWam6wXlmFVVHGuvL76pT3PUGufbO9YwevQzCvXhsabRuJyJjz8A1Haftmewy4gZ0FWlMIO5BoXB49j0TeIiikaxP9ZHcD9oI6x2H4DajNt5WgRXj6/H72V+gj2bgMDVkIZ36j1Tl+wdO6fvFsz56a5V6t9lS+gyWSOvuQP9bqtYgqWlsthXSFkrTfNqni6jSQ5vN9Fp1iYJODbUg8Sg0lYLbNEM7oqvrggxzq13IfO9hGQ0MQVpMIAR0aSGMFWOZzpJmXG1IcjppdZkINTYN2UvrHmGUrVBHvRuueFPuy2GzQoSnMCvkT3WvaR/LoVYw7Voy47wdJee2Va623AFXWNINOpByyoc9SQU4vPQ6X0PMBLQs6GdMlx+RlC3VoMDOryeFFolCTD8B+A/A4AAANKbW9vdgAAAGxtdmhkAAAAANcxfvfXMX73AACsRAAADbEAAQAAAQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAdx0cmFrAAAAXHRraGQAAAAB1zF+99cxfvcAAAABAAAAAAAADbEAAAAAAAAAAAAAAAABAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAF4bWRpYQAAACBtZGhkAAAAANcxfvfXMX73AACsRAAAGABVxAAAAAAAMWhkbHIAAAAAAAAAAHNvdW4AAAAAAAAAAAAAAABDb3JlIE1lZGlhIEF1ZGlvAAAAAR9taW5mAAAAEHNtaGQAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAAONzdGJsAAAAZ3N0c2QAAAAAAAAAAQAAAFdtcDRhAAAAAAAAAAEAAAAAAAAAAAACABAAAAAArEQAAAAAADNlc2RzAAAAAAOAgIAiAAAABICAgBRAFQAYAAAB9AAAAfQABYCAgAISEAaAgIABAgAAABhzdHRzAAAAAAAAAAEAAAAGAAAEAAAAABxzdHNjAAAAAAAAAAEAAAABAAAABgAAAAEAAAAsc3RzegAAAAAAAAAAAAAABgAAAP4AAAF+AAABjwAAAYQAAAFeAAABegAAABRzdGNvAAAAAAAAAAEAAAAsAAAA+nVkdGEAAADybWV0YQAAAAAAAAAiaGRscgAAAAAAAAAAbWRpcgAAAAAAAAAAAAAAAAAAAAAAxGlsc3QAAAC8LS0tLQAAABxtZWFuAAAAAGNvbS5hcHBsZS5pVHVuZXMAAAAUbmFtZQAAAABpVHVuU01QQgAAAIRkYXRhAAAAAQAAAAAgMDAwMDAwMDAgMDAwMDA4NDAgMDAwMDAyMEYgMDAwMDAwMDAwMDAwMERCMSAwMDAwMDAwMCAwMDAwMDAwMCAwMDAwMDAwMCAwMDAwMDAwMCAwMDAwMDAwMCAwMDAwMDAwMCAwMDAwMDAwMCAwMDAwMDAwMA=="))}))}beep(t){t.successBeepEnabled&&this.play()}play(){return st(this,void 0,void 0,(function*(){try{yield this.audioFile.play()}catch(t){}}))}}lt.INSTANCE=new lt;var ct=lt;class ut{constructor(){this.DURATION=200}vibrate(t){t.enabled&&navigator.vibrate&&navigator.vibrate(this.DURATION)}}ut.INSTANCE=new ut;var dt=ut,ht=n(12),ft=n(23),pt=n(26),mt=n(24);class gt extends W.default.Component{constructor(t){super(t),this.state={base64Image:void 0}}render(){const t="x"+this.props.barcode.count;return W.default.createElement("div",{style:{display:"flex",flexDirection:"row",backgroundColor:"white",paddingBottom:5,paddingTop:5,borderBottom:"0.5px solid gray"}},W.default.createElement("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",width:"100%"}},W.default.createElement("div",{style:{display:"flex",fontSize:15,fontWeight:400,width:"100%"}},W.default.createElement("div",{style:{flex:1}},this.props.barcode.text),W.default.createElement("div",{style:{flex:1,justifyContent:"end",display:"flex"}},t)),W.default.createElement("div",{style:{color:"gray",fontSize:13,fontWeight:300}},this.props.barcode.format)))}}function vt(t,e){return t.format===e.format&&t.text===e.text}function At(t){return t.text+t.format}class bt extends W.default.Component{constructor(t){super(t),this.state={barcodes:this.toUniqueListWithDuplicateCounter(t.barcodes)}}toUniqueListWithDuplicateCounter(t){const e=[];return t.forEach((t=>{const n=e.findIndex((e=>vt(e,t)));-1===n?(t.count=1,e.push(t)):e[n].count++})),e}update(t){this.setState({barcodes:this.toUniqueListWithDuplicateCounter(t)})}render(){return W.default.createElement("div",{style:{display:"flex",flexDirection:"column",backgroundColor:"white",padding:15}},this.state.barcodes.map(((t,e)=>W.default.createElement(gt,{key:e,barcode:t,onClick:this.props.onClick}))))}}class yt{}yt.ScanbotPrimary="#c8193c",yt.LightGray="#F5F5F5",yt.Gray="#808080",yt.DarkGray="#333333",yt.Orange="#FF5533",yt.White="#FFFFFF",yt.TransparentGreen="rgba(0, 255, 0, 0.5)",yt.TransparentGray="rgba(50, 50, 50, 0.5)",yt.TransparentBlack="rgba(0, 0, 0, 0.3)",yt.SBNegative="#FF3737";var Ct,St=yt;!function(t){t[t.None=0]="None",t[t.PushRight=1]="PushRight",t[t.PushBottom=2]="PushBottom",t[t.Pop=3]="Pop"}(Ct||(Ct={}));class wt extends W.default.Component{constructor(t){super(t),this._isVisible=!1,this.state={animation:{type:Ct.None},elements:[]}}containerStyle(t){return{height:"100%",width:"100%",position:"absolute",top:"0",left:"0",zIndex:101,transform:t,overflow:"scroll"}}render(){var t,e,n;if(this.state.animation.type===Ct.None)return null;const o=this.animation(this.state.animation.type),i=this.to(this.state.animation.type);this.previousDestination=i;const r=this.props.style;return W.default.createElement(o,{style:this.containerStyle(`${i}`),onAnimationStart:this.onAnimationStart.bind(this),onAnimationEnd:this.onAnimationEnd.bind(this),onClick:t=>{this.reset()}},W.default.createElement("div",{style:{backgroundColor:"white",height:r.sheetHeight,width:"100%",marginTop:r.sheetTopMargin,borderTopLeftRadius:20,borderTopRightRadius:20},onClick:t=>{t.stopPropagation()}},W.default.createElement("div",{style:{borderTopLeftRadius:20,borderTopRightRadius:20,backgroundColor:St.ScanbotPrimary}},W.default.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"end",height:10}},W.default.createElement("div",{style:{backgroundColor:St.White,height:3,width:33,borderRadius:5}})),W.default.createElement("div",{style:{display:"flex",height:50}},W.default.createElement("div",{style:{display:"flex",fontSize:12,flex:1,color:St.White,alignItems:"center",justifyContent:"left",paddingLeft:10,fontWeight:300},onClick:this.props.onDeleteClick},"CLEAR ALL"),W.default.createElement("div",{style:{display:"flex",fontSize:15,flex:1,color:St.White,justifyContent:"center",alignItems:"center",fontWeight:500}},(null!==(e=null===(t=this.barcodes)||void 0===t?void 0:t.length)&&void 0!==e?e:0)+" Codes"),W.default.createElement("div",{style:{display:"flex",fontSize:13,flex:1,color:St.White,justifyContent:"right",alignItems:"center",paddingRight:10}},W.default.createElement("div",{style:{fontSize:30,fontWeight:100},onClick:t=>{t.stopPropagation(),this.reset()}},"×")))),W.default.createElement(bt,{ref:t=>{null!==t&&(this.list=t)},barcodes:null!==(n=this.barcodes)&&void 0!==n?n:[]})))}reset(){this.pop()}isVisible(){return this._isVisible}push(t,e){this._isVisible=!0,this.barcodes=e,this.updateAnimationType(t)}update(t){this.barcodes=t,this.forceUpdate()}pop(){this._isVisible=!1,this.updateAnimationType(Ct.Pop)}onAnimationStart(){}onAnimationEnd(){this.state.animation.type===Ct.Pop&&this.updateAnimationType(Ct.None)}updateAnimationType(t,e){this.setState({animation:{type:t}},e)}animation(t){let e=this.from(t),n=this.to(t);this.previousDestination===n&&(e=this.previousDestination,n=this.previousDestination);const o=mt.b`from {transform: ${e};} to {transform: ${n};}`;return mt.a.div`animation: ${o} 0.5s;`}from(t){if(t===Ct.PushRight)return this.translate("X",100);if(t===Ct.PushBottom)return this.translate("Y",100);if(t===Ct.Pop){const t=this.pushType===Ct.PushRight?"X":"Y";return this.translate(t,0)}}to(t){if(t===Ct.PushRight)return this.translate("X",0);if(t===Ct.PushBottom)return this.translate("Y",0);if(t===Ct.Pop){const t=this.pushType===Ct.PushRight?"X":"Y";return this.translate(t,100)}}translate(t,e){return"translate"+t+"("+e+"%)"}componentWillUnmount(){this._isVisible=!1}}var xt=n(2),Et=function(t){return{isEnabled:function(e){return t.some((function(t){return!!e[t]}))}}},Lt={measureLayout:Et(["layout","layoutId","drag","_layoutResetTransform"]),animation:Et(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag"]),exit:Et(["exit"]),drag:Et(["drag","dragControls"]),focus:Et(["whileFocus"]),hover:Et(["whileHover","onHoverStart","onHoverEnd"]),tap:Et(["whileTap","onTap","onTapStart","onTapCancel"]),pan:Et(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),layoutAnimation:Et(["layout","layoutId"])};var _t=Object(W.createContext)({strict:!1}),Ot=Object.keys(Lt),Tt=Ot.length;var kt=Object(W.createContext)({transformPagePoint:function(t){return t},isStatic:!1}),Dt=Object(W.createContext)({});var Pt=Object(W.createContext)(null);function Bt(t){var e=Object(W.useRef)(null);return null===e.current&&(e.current=t()),e.current}function Ft(){var t=Object(W.useContext)(Pt);if(null===t)return[!0,null];var e=t.isPresent,n=t.onExitComplete,o=t.register,i=Mt();Object(W.useEffect)((function(){return o(i)}),[]);return!e&&n?[!1,function(){return null==n?void 0:n(i)}]:[!0]}function Rt(t){return null===t||t.isPresent}var It=0,Wt=function(){return It++},Mt=function(){return Bt(Wt)},jt=Object(W.createContext)(null),zt="undefined"!=typeof window,Nt=zt?W.useLayoutEffect:W.useEffect;function Vt(t,e,n,o){var i=Object(W.useContext)(kt),r=Object(W.useContext)(_t),a=Object(W.useContext)(Dt).visualElement,s=Object(W.useContext)(Pt),l=function(t){var e=t.layoutId,n=Object(W.useContext)(jt);return n&&void 0!==e?n+"-"+e:e}(n),c=Object(W.useRef)(void 0);o||(o=r.renderer),!c.current&&o&&(c.current=o(t,{visualState:e,parent:a,props:Object(xt.a)(Object(xt.a)({},n),{layoutId:l}),presenceId:null==s?void 0:s.id,blockInitialAnimation:!1===(null==s?void 0:s.initial)}));var u=c.current;return Nt((function(){u&&(u.setProps(Object(xt.a)(Object(xt.a)(Object(xt.a)({},i),n),{layoutId:l})),u.isPresent=Rt(s),u.isPresenceRoot=!a||a.presenceId!==(null==s?void 0:s.id),u.syncRender())})),Object(W.useEffect)((function(){var t;u&&(null===(t=u.animationState)||void 0===t||t.animateChanges())})),Nt((function(){return function(){return null==u?void 0:u.notifyUnmount()}}),[]),u}function Ut(t){return"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function Ht(t){return Array.isArray(t)}function Gt(t){return"string"==typeof t||Ht(t)}function Qt(t,e,n,o,i){var r;return void 0===o&&(o={}),void 0===i&&(i={}),"string"==typeof e&&(e=null===(r=t.variants)||void 0===r?void 0:r[e]),"function"==typeof e?e(null!=n?n:t.custom,o,i):e}function Yt(t,e,n){var o=t.getProps();return Qt(o,e,null!=n?n:o.custom,function(t){var e={};return t.forEachValue((function(t,n){return e[n]=t.get()})),e}(t),function(t){var e={};return t.forEachValue((function(t,n){return e[n]=t.getVelocity()})),e}(t))}function Zt(t){var e;return"function"==typeof(null===(e=t.animate)||void 0===e?void 0:e.start)||Gt(t.initial)||Gt(t.animate)||Gt(t.whileHover)||Gt(t.whileDrag)||Gt(t.whileTap)||Gt(t.whileFocus)||Gt(t.exit)}function qt(t){return Boolean(Zt(t)||t.variants)}function Xt(t,e){var n=function(t,e){if(Zt(t)){var n=t.initial,o=t.animate;return{initial:!1===n||Gt(n)?n:void 0,animate:Gt(o)?o:void 0}}return!1!==t.inherit?e:{}}(t,Object(W.useContext)(Dt)),o=n.initial,i=n.animate;return Object(W.useMemo)((function(){return{initial:o,animate:i}}),e?[$t(o),$t(i)]:[])}function $t(t){return Array.isArray(t)?t.join(" "):t}function Kt(t){var e=t.preloadedFeatures,n=t.createVisualElement,o=t.useRender,i=t.useVisualState,r=t.Component;return e&&function(t){for(var e in t){var n=t[e];null!==n&&(Lt[e].Component=n)}}(e),Object(W.forwardRef)((function(t,e){var a=Object(W.useContext)(kt).isStatic,s=null,l=Xt(t,a),c=i(t,a);return!a&&zt&&(l.visualElement=Vt(r,c,t,n),s=function(t,e,n){var o=[];if(Object(W.useContext)(_t),!e)return null;for(var i=0;i<Tt;i++){var r=Ot[i],a=Lt[r],s=a.isEnabled,l=a.Component;s(t)&&l&&o.push(W.createElement(l,Object(xt.a)({key:r},t,{visualElement:e})))}return o}(t,l.visualElement)),W.createElement(W.Fragment,null,W.createElement(Dt.Provider,{value:l},o(r,t,function(t,e,n){return Object(W.useCallback)((function(o){var i;o&&(null===(i=t.mount)||void 0===i||i.call(t,o)),e&&(o?e.mount(o):e.unmount()),n&&("function"==typeof n?n(o):Ut(n)&&(n.current=o))}),[e])}(c,l.visualElement,e),c,a)),s)}))}function Jt(t){function e(e,n){return void 0===n&&(n={}),Kt(t(e,n))}var n=new Map;return new Proxy(e,{get:function(t,o){return n.has(o)||n.set(o,e(o)),n.get(o)}})}var te=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","svg","switch","symbol","text","tspan","use","view"];function ee(t){return"string"==typeof t&&!t.includes("-")&&!!(te.indexOf(t)>-1||/[A-Z]/.test(t))}var ne={};var oe=["","X","Y","Z"],ie=["transformPerspective","x","y","z"];function re(t,e){return ie.indexOf(t)-ie.indexOf(e)}["translate","scale","rotate","skew"].forEach((function(t){return oe.forEach((function(e){return ie.push(t+e)}))}));var ae=new Set(ie);function se(t){return ae.has(t)}var le=new Set(["originX","originY","originZ"]);function ce(t){return le.has(t)}function ue(t,e){var n=e.layout,o=e.layoutId;return se(t)||ce(t)||(n||void 0!==o)&&(!!ne[t]||"opacity"===t)}var de=function(t){return null!==t&&"object"==typeof t&&t.getVelocity},he={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};function fe(t){return t.startsWith("--")}var pe=function(t,e){return e&&"number"==typeof t?e.transform(t):t},me=function(t,e){return function(n){return Math.max(Math.min(n,e),t)}},ge=function(t){return t%1?Number(t.toFixed(5)):t},ve=/(-)?([\d]*\.?[\d])+/g,Ae=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))/gi,be=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))$/i;function ye(t){return"string"==typeof t}var Ce=function(t){return{test:function(e){return ye(e)&&e.endsWith(t)&&1===e.split(" ").length},parse:parseFloat,transform:function(e){return""+e+t}}},Se=Ce("deg"),we=Ce("%"),xe=Ce("px"),Ee=Ce("vh"),Le=Ce("vw"),_e=Object(xt.a)(Object(xt.a)({},we),{parse:function(t){return we.parse(t)/100},transform:function(t){return we.transform(100*t)}}),Oe={test:function(t){return"number"==typeof t},parse:parseFloat,transform:function(t){return t}},Te=Object(xt.a)(Object(xt.a)({},Oe),{transform:me(0,1)}),ke=Object(xt.a)(Object(xt.a)({},Oe),{default:1}),De=Object(xt.a)(Object(xt.a)({},Oe),{transform:Math.round}),Pe={borderWidth:xe,borderTopWidth:xe,borderRightWidth:xe,borderBottomWidth:xe,borderLeftWidth:xe,borderRadius:xe,radius:xe,borderTopLeftRadius:xe,borderTopRightRadius:xe,borderBottomRightRadius:xe,borderBottomLeftRadius:xe,width:xe,maxWidth:xe,height:xe,maxHeight:xe,size:xe,top:xe,right:xe,bottom:xe,left:xe,padding:xe,paddingTop:xe,paddingRight:xe,paddingBottom:xe,paddingLeft:xe,margin:xe,marginTop:xe,marginRight:xe,marginBottom:xe,marginLeft:xe,rotate:Se,rotateX:Se,rotateY:Se,rotateZ:Se,scale:ke,scaleX:ke,scaleY:ke,scaleZ:ke,skew:Se,skewX:Se,skewY:Se,distance:xe,translateX:xe,translateY:xe,translateZ:xe,x:xe,y:xe,z:xe,perspective:xe,transformPerspective:xe,opacity:Te,originX:_e,originY:_e,originZ:xe,zIndex:De,fillOpacity:Te,strokeOpacity:Te,numOctaves:De};function Be(t,e,n,o,i,r,a,s){var l,c=t.style,u=t.vars,d=t.transform,h=t.transformKeys,f=t.transformOrigin;h.length=0;var p=!1,m=!1,g=!0;for(var v in e){var A=e[v];if(fe(v))u[v]=A;else{var b=Pe[v],y=pe(A,b);if(se(v)){if(p=!0,d[v]=y,h.push(v),!g)continue;A!==(null!==(l=b.default)&&void 0!==l?l:0)&&(g=!1)}else if(ce(v))f[v]=y,m=!0;else if((null==n?void 0:n.isHydrated)&&(null==o?void 0:o.isHydrated)&&ne[v]){var C=ne[v].process(A,o,n),S=ne[v].applyTo;if(S)for(var w=S.length,x=0;x<w;x++)c[S[x]]=C;else c[v]=C}else c[v]=y}}o&&n&&a&&s?(c.transform=a(o.deltaFinal,o.treeScale,p?d:void 0),r&&(c.transform=r(d,c.transform)),c.transformOrigin=s(o)):(p&&(c.transform=function(t,e,n,o){var i=t.transform,r=t.transformKeys,a=e.enableHardwareAcceleration,s=void 0===a||a,l=e.allowTransformNone,c=void 0===l||l,u="";r.sort(re);for(var d=!1,h=r.length,f=0;f<h;f++){var p=r[f];u+=(he[p]||p)+"("+i[p]+") ","z"===p&&(d=!0)}return!d&&s?u+="translateZ(0)":u=u.trim(),o?u=o(i,n?"":u):c&&n&&(u="none"),u}(t,i,g,r)),m&&(c.transformOrigin=function(t){var e=t.originX,n=void 0===e?"50%":e,o=t.originY,i=void 0===o?"50%":o,r=t.originZ;return n+" "+i+" "+(void 0===r?0:r)}(f)))}var Fe=function(){return{style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}}};function Re(t,e,n){for(var o in e)de(e[o])||ue(o,n)||(t[o]=e[o])}function Ie(t,e,n){var o={};return Re(o,t.style||{},t),Object.assign(o,function(t,e,n){var o=t.transformTemplate;return Object(W.useMemo)((function(){var t={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}};Be(t,e,void 0,void 0,{enableHardwareAcceleration:!n},o);var i=t.vars,r=t.style;return Object(xt.a)(Object(xt.a)({},i),r)}),[e])}(t,e,n)),t.transformValues&&(o=t.transformValues(o)),o}function We(t,e,n){var o={},i=Ie(t,e,n);return Boolean(t.drag)&&(o.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),o.style=i,o}var Me=new Set(["initial","animate","exit","style","variants","transition","transformTemplate","transformValues","custom","inherit","layout","layoutId","_layoutResetTransform","onLayoutAnimationComplete","onViewportBoxUpdate","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","drag","dragControls","dragListener","dragConstraints","dragDirectionLock","_dragX","_dragY","dragElastic","dragMomentum","dragPropagation","dragTransition","whileDrag","onPan","onPanStart","onPanEnd","onPanSessionStart","onTap","onTapStart","onTapCancel","onHoverStart","onHoverEnd","whileFocus","whileTap","whileHover"]);function je(t){return Me.has(t)}var ze=function(t){return!je(t)};try{var Ne=n(49).default;ze=function(t){return t.startsWith("on")?!je(t):Ne(t)}}catch(t){}function Ve(t,e,n){return"string"==typeof t?t:xe.transform(e+n*t)}var Ue=function(t,e){return xe.transform(t*e)},He={offset:"stroke-dashoffset",array:"stroke-dasharray"},Ge={offset:"strokeDashoffset",array:"strokeDasharray"};function Qe(t,e,n,o,i,r,a,s){var l=e.attrX,c=e.attrY,u=e.originX,d=e.originY,h=e.pathLength,f=e.pathSpacing,p=void 0===f?1:f,m=e.pathOffset,g=void 0===m?0:m;Be(t,Object(xt.d)(e,["attrX","attrY","originX","originY","pathLength","pathSpacing","pathOffset"]),n,o,i,r,a,s),t.attrs=t.style,t.style={};var v=t.attrs,A=t.style,b=t.dimensions,y=t.totalPathLength;v.transform&&(b&&(A.transform=v.transform),delete v.transform),b&&(void 0!==u||void 0!==d||A.transform)&&(A.transformOrigin=function(t,e,n){return Ve(e,t.x,t.width)+" "+Ve(n,t.y,t.height)}(b,void 0!==u?u:.5,void 0!==d?d:.5)),void 0!==l&&(v.x=l),void 0!==c&&(v.y=c),void 0!==y&&void 0!==h&&function(t,e,n,o,i,r){void 0===o&&(o=1),void 0===i&&(i=0),void 0===r&&(r=!0);var a=r?He:Ge;t[a.offset]=Ue(-i,e);var s=Ue(n,e),l=Ue(o,e);t[a.array]=s+" "+l}(v,y,h,p,g,!1)}var Ye=function(){return Object(xt.a)(Object(xt.a)({},{style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}}),{attrs:{}})};function Ze(t,e){var n=Object(W.useMemo)((function(){var n=Ye();return Qe(n,e,void 0,void 0,{enableHardwareAcceleration:!1},t.transformTemplate),Object(xt.a)(Object(xt.a)({},n.attrs),{style:Object(xt.a)({},n.style)})}),[e]);if(t.style){var o={};Re(o,t.style,t),n.style=Object(xt.a)(Object(xt.a)({},o),n.style)}return n}function qe(t){void 0===t&&(t=!1);return function(e,n,o,i,r){var a=i.latestValues,s=(ee(e)?Ze:We)(n,a,r),l=function(t,e,n){var o={};for(var i in t)(ze(i)||!0===n&&je(i)||!e&&!je(i))&&(o[i]=t[i]);return o}(n,"string"==typeof e,t),c=Object(xt.a)(Object(xt.a)(Object(xt.a)({},l),s),{ref:o});return Object(W.createElement)(e,c)}}var Xe=/([a-z])([A-Z])/g,$e=function(t){return t.replace(Xe,"$1-$2").toLowerCase()};function Ke(t,e){var n=e.style,o=e.vars;for(var i in Object.assign(t.style,n),o)t.style.setProperty(i,o[i])}var Je=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform"]);function tn(t,e){for(var n in Ke(t,e),e.attrs)t.setAttribute(Je.has(n)?n:$e(n),e.attrs[n])}function en(t){var e=t.style,n={};for(var o in e)(de(e[o])||ue(o,t))&&(n[o]=e[o]);return n}function nn(t){var e=en(t);for(var n in t){if(de(t[n]))e["x"===n||"y"===n?"attr"+n.toUpperCase():n]=t[n]}return e}function on(t){return"object"==typeof t&&"function"==typeof t.start}var rn=function(t){return Array.isArray(t)};function an(t){var e,n=de(t)?t.get():t;return e=n,Boolean(e&&"object"==typeof e&&e.mix&&e.toValue)?n.toValue():n}function sn(t,e,n,o){var i=t.scrapeMotionValuesFromProps,r=t.createRenderState,a=t.onMount,s={latestValues:cn(e,n,o,i),renderState:r()};return a&&(s.mount=function(t){return a(e,t,s)}),s}var ln=function(t){return function(e,n){var o=Object(W.useContext)(Dt),i=Object(W.useContext)(Pt);return n?sn(t,e,o,i):Bt((function(){return sn(t,e,o,i)}))}};function cn(t,e,n,o){var i={},r=!1===(null==n?void 0:n.initial),a=o(t);for(var s in a)i[s]=an(a[s]);var l=t.initial,c=t.animate,u=Zt(t),d=qt(t);e&&d&&!u&&!1!==t.inherit&&(null!=l||(l=e.initial),null!=c||(c=e.animate));var h=r||!1===l?c:l;h&&"boolean"!=typeof h&&!on(h)&&(Array.isArray(h)?h:[h]).forEach((function(e){var n=Qt(t,e);if(n){var o=n.transitionEnd;n.transition;var r=Object(xt.d)(n,["transitionEnd","transition"]);for(var a in r)i[a]=r[a];for(var a in o)i[a]=o[a]}}));return i}var un={useVisualState:ln({scrapeMotionValuesFromProps:nn,createRenderState:Ye,onMount:function(t,e,n){var o=n.renderState,i=n.latestValues;try{o.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch(t){o.dimensions={x:0,y:0,width:0,height:0}}"path"===e.tagName&&(o.totalPathLength=e.getTotalLength()),Qe(o,i,void 0,void 0,{enableHardwareAcceleration:!1},t.transformTemplate),tn(e,o)}})};var dn,hn={useVisualState:ln({scrapeMotionValuesFromProps:en,createRenderState:Fe})};function fn(t,e,n,o){var i=e.forwardMotionProps,r=void 0!==i&&i,a=ee(t)?un:hn;return Object(xt.a)(Object(xt.a)({},a),{preloadedFeatures:n,useRender:qe(r),createVisualElement:o,Component:t})}function pn(t,e,n,o){return t.addEventListener(e,n,o),function(){return t.removeEventListener(e,n,o)}}function mn(t,e,n,o){Object(W.useEffect)((function(){var i=t.current;if(n&&i)return pn(i,e,n,o)}),[t,e,n,o])}function gn(t){return"undefined"!=typeof PointerEvent&&t instanceof PointerEvent?!("mouse"!==t.pointerType):t instanceof MouseEvent}function vn(t){return!!t.touches}!function(t){t.Animate="animate",t.Hover="whileHover",t.Tap="whileTap",t.Drag="whileDrag",t.Focus="whileFocus",t.Exit="exit"}(dn||(dn={}));var An={pageX:0,pageY:0};function bn(t,e){void 0===e&&(e="page");var n=t.touches[0]||t.changedTouches[0]||An;return{x:n[e+"X"],y:n[e+"Y"]}}function yn(t,e){return void 0===e&&(e="page"),{x:t[e+"X"],y:t[e+"Y"]}}function Cn(t,e){return void 0===e&&(e="page"),{point:vn(t)?bn(t,e):yn(t,e)}}var Sn=function(t,e){void 0===e&&(e=!1);var n,o=function(e){return t(e,Cn(e))};return e?(n=o,function(t){var e=t instanceof MouseEvent;(!e||e&&0===t.button)&&n(t)}):o},wn={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},xn={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function En(t){return zt&&null===window.onpointerdown?t:zt&&null===window.ontouchstart?xn[t]:zt&&null===window.onmousedown?wn[t]:t}function Ln(t,e,n,o){return pn(t,En(e),Sn(n,"pointerdown"===e),o)}function _n(t,e,n,o){return mn(t,En(e),n&&Sn(n,"pointerdown"===e),o)}function On(t){var e=null;return function(){return null===e&&(e=t,function(){e=null})}}var Tn=On("dragHorizontal"),kn=On("dragVertical");function Dn(t){var e=!1;if("y"===t)e=kn();else if("x"===t)e=Tn();else{var n=Tn(),o=kn();n&&o?e=function(){n(),o()}:(n&&n(),o&&o())}return e}function Pn(){var t=Dn(!0);return!t||(t(),!1)}function Bn(t,e,n){return function(o,i){var r;gn(o)&&!Pn()&&(null==n||n(o,i),null===(r=t.animationState)||void 0===r||r.setActive(dn.Hover,e))}}var Fn=function(t,e){return!!e&&(t===e||Fn(t,e.parentElement))};function Rn(t){return Object(W.useEffect)((function(){return function(){return t()}}),[])}var In=function(t,e){return function(n){return e(t(n))}},Wn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.reduce(In)};var Mn=function(t){return function(e){return t(e),null}},jn={tap:Mn((function(t){var e=t.onTap,n=t.onTapStart,o=t.onTapCancel,i=t.whileTap,r=t.visualElement,a=e||n||o||i,s=Object(W.useRef)(!1),l=Object(W.useRef)(null);function c(){var t;null===(t=l.current)||void 0===t||t.call(l),l.current=null}function u(){var t;return c(),s.current=!1,null===(t=r.animationState)||void 0===t||t.setActive(dn.Tap,!1),!Pn()}function d(t,n){u()&&(Fn(r.getInstance(),t.target)?null==e||e(t,n):null==o||o(t,n))}function h(t,e){u()&&(null==o||o(t,e))}_n(r,"pointerdown",a?function(t,e){var o;c(),s.current||(s.current=!0,l.current=Wn(Ln(window,"pointerup",d),Ln(window,"pointercancel",h)),null==n||n(t,e),null===(o=r.animationState)||void 0===o||o.setActive(dn.Tap,!0))}:void 0),Rn(c)})),focus:Mn((function(t){var e=t.whileFocus,n=t.visualElement;mn(n,"focus",e?function(){var t;null===(t=n.animationState)||void 0===t||t.setActive(dn.Focus,!0)}:void 0),mn(n,"blur",e?function(){var t;null===(t=n.animationState)||void 0===t||t.setActive(dn.Focus,!1)}:void 0)})),hover:Mn((function(t){var e=t.onHoverStart,n=t.onHoverEnd,o=t.whileHover,i=t.visualElement;_n(i,"pointerenter",e||o?Bn(i,!0,e):void 0),_n(i,"pointerleave",n||o?Bn(i,!1,n):void 0)}))};function zn(t,e){if(!Array.isArray(e))return!1;var n=e.length;if(n!==t.length)return!1;for(var o=0;o<n;o++)if(e[o]!==t[o])return!1;return!0}var Nn=function(t,e,n){return Math.min(Math.max(n,t),e)},Vn=.001;function Un(t){var e,n,o=t.duration,i=void 0===o?800:o,r=t.bounce,a=void 0===r?.25:r,s=t.velocity,l=void 0===s?0:s,c=t.mass,u=void 0===c?1:c,d=1-a;d=Nn(.05,1,d),i=Nn(.01,10,i/1e3),d<1?(e=function(t){var e=t*d,n=e*i,o=e-l,r=Hn(t,d),a=Math.exp(-n);return Vn-o/r*a},n=function(t){var n=t*d*i,o=n*l+l,r=Math.pow(d,2)*Math.pow(t,2)*i,a=Math.exp(-n),s=Hn(Math.pow(t,2),d);return(-e(t)+Vn>0?-1:1)*((o-r)*a)/s}):(e=function(t){return Math.exp(-t*i)*((t-l)*i+1)-.001},n=function(t){return Math.exp(-t*i)*(i*i*(l-t))});var h=function(t,e,n){for(var o=n,i=1;i<12;i++)o-=t(o)/e(o);return o}(e,n,5/i);if(i*=1e3,isNaN(h))return{stiffness:100,damping:10,duration:i};var f=Math.pow(h,2)*u;return{stiffness:f,damping:2*d*Math.sqrt(u*f),duration:i}}function Hn(t,e){return t*Math.sqrt(1-e*e)}var Gn=["duration","bounce"],Qn=["stiffness","damping","mass"];function Yn(t,e){return e.some((function(e){return void 0!==t[e]}))}function Zn(t){var e=t.from,n=void 0===e?0:e,o=t.to,i=void 0===o?1:o,r=t.restSpeed,a=void 0===r?2:r,s=t.restDelta,l=Object(xt.d)(t,["from","to","restSpeed","restDelta"]),c={done:!1,value:n},u=function(t){var e=Object(xt.a)({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},t);if(!Yn(t,Qn)&&Yn(t,Gn)){var n=Un(t);(e=Object(xt.a)(Object(xt.a)(Object(xt.a)({},e),n),{velocity:0,mass:1})).isResolvedFromDuration=!0}return e}(l),d=u.stiffness,h=u.damping,f=u.mass,p=u.velocity,m=u.duration,g=u.isResolvedFromDuration,v=qn,A=qn;function b(){var t=p?-p/1e3:0,e=i-n,o=h/(2*Math.sqrt(d*f)),r=Math.sqrt(d/f)/1e3;if(null!=s||(s=Math.abs(i-n)<=1?.01:.4),o<1){var a=Hn(r,o);v=function(n){var s=Math.exp(-o*r*n);return i-s*((t+o*r*e)/a*Math.sin(a*n)+e*Math.cos(a*n))},A=function(n){var i=Math.exp(-o*r*n);return o*r*i*(Math.sin(a*n)*(t+o*r*e)/a+e*Math.cos(a*n))-i*(Math.cos(a*n)*(t+o*r*e)-a*e*Math.sin(a*n))}}else if(1===o)v=function(n){return i-Math.exp(-r*n)*(e+(t+r*e)*n)};else{var l=r*Math.sqrt(o*o-1);v=function(n){var a=Math.exp(-o*r*n),s=Math.min(l*n,300);return i-a*((t+o*r*e)*Math.sinh(s)+l*e*Math.cosh(s))/l}}}return b(),{next:function(t){var e=v(t);if(g)c.done=t>=m;else{var n=1e3*A(t),o=Math.abs(n)<=a,r=Math.abs(i-e)<=s;c.done=o&&r}return c.value=c.done?i:e,c},flipTarget:function(){var t;p=-p,n=(t=[i,n])[0],i=t[1],b()}}}Zn.needsInterpolation=function(t,e){return"string"==typeof t||"string"==typeof e};var qn=function(t){return 0},Xn=function(t,e,n){var o=e-t;return 0===o?1:(n-t)/o},$n=function(t,e,n){return-n*t+n*e+t},Kn=function(t,e){return function(n){return Boolean(ye(n)&&be.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e))}},Jn=function(t,e,n){return function(o){var i;if(!ye(o))return o;var r=o.match(ve),a=r[0],s=r[1],l=r[2],c=r[3];return(i={})[t]=parseFloat(a),i[e]=parseFloat(s),i[n]=parseFloat(l),i.alpha=void 0!==c?parseFloat(c):1,i}},to=me(0,255),eo=Object(xt.a)(Object(xt.a)({},Oe),{transform:function(t){return Math.round(to(t))}}),no={test:Kn("rgb","red"),parse:Jn("red","green","blue"),transform:function(t){var e=t.red,n=t.green,o=t.blue,i=t.alpha,r=void 0===i?1:i;return"rgba("+eo.transform(e)+", "+eo.transform(n)+", "+eo.transform(o)+", "+ge(Te.transform(r))+")"}};var oo={test:Kn("#"),parse:function(t){var e="",n="",o="",i="";return t.length>5?(e=t.substr(1,2),n=t.substr(3,2),o=t.substr(5,2),i=t.substr(7,2)):(e=t.substr(1,1),n=t.substr(2,1),o=t.substr(3,1),i=t.substr(4,1),e+=e,n+=n,o+=o,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(o,16),alpha:i?parseInt(i,16)/255:1}},transform:no.transform},io={test:Kn("hsl","hue"),parse:Jn("hue","saturation","lightness"),transform:function(t){var e=t.hue,n=t.saturation,o=t.lightness,i=t.alpha,r=void 0===i?1:i;return"hsla("+Math.round(e)+", "+we.transform(ge(n))+", "+we.transform(ge(o))+", "+ge(Te.transform(r))+")"}},ro=function(t,e,n){var o=t*t,i=e*e;return Math.sqrt(Math.max(0,n*(i-o)+o))},ao=[oo,no,io],so=function(t){return ao.find((function(e){return e.test(t)}))},lo=function(t){return"'"+t+"' is not an animatable color. Use the equivalent color code instead."},co=function(t,e){var n=so(t),o=so(e);lo(t),lo(e),n.transform,o.transform;var i=n.parse(t),r=o.parse(e),a=Object(xt.a)({},i),s=n===io?$n:ro;return function(t){for(var e in a)"alpha"!==e&&(a[e]=s(i[e],r[e],t));return a.alpha=$n(i.alpha,r.alpha,t),n.transform(a)}},uo={test:function(t){return no.test(t)||oo.test(t)||io.test(t)},parse:function(t){return no.test(t)?no.parse(t):io.test(t)?io.parse(t):oo.parse(t)},transform:function(t){return ye(t)?t:t.hasOwnProperty("red")?no.transform(t):io.transform(t)}},ho="${c}",fo="${n}";function po(t){var e=[],n=0,o=t.match(Ae);o&&(n=o.length,t=t.replace(Ae,ho),e.push.apply(e,o.map(uo.parse)));var i=t.match(ve);return i&&(t=t.replace(ve,fo),e.push.apply(e,i.map(Oe.parse))),{values:e,numColors:n,tokenised:t}}function mo(t){return po(t).values}function go(t){var e=po(t),n=e.values,o=e.numColors,i=e.tokenised,r=n.length;return function(t){for(var e=i,n=0;n<r;n++)e=e.replace(n<o?ho:fo,n<o?uo.transform(t[n]):ge(t[n]));return e}}var vo=function(t){return"number"==typeof t?0:t};var Ao={test:function(t){var e,n,o,i;return isNaN(t)&&ye(t)&&(null!==(n=null===(e=t.match(ve))||void 0===e?void 0:e.length)&&void 0!==n?n:0)+(null!==(i=null===(o=t.match(Ae))||void 0===o?void 0:o.length)&&void 0!==i?i:0)>0},parse:mo,createTransformer:go,getAnimatableNone:function(t){var e=mo(t);return go(t)(e.map(vo))}},bo=function(t){return"number"==typeof t};function yo(t,e){return bo(t)?function(n){return $n(t,e,n)}:uo.test(t)?co(t,e):xo(t,e)}var Co=function(t,e){var n=Object(xt.e)([],t),o=n.length,i=t.map((function(t,n){return yo(t,e[n])}));return function(t){for(var e=0;e<o;e++)n[e]=i[e](t);return n}},So=function(t,e){var n=Object(xt.a)(Object(xt.a)({},t),e),o={};for(var i in n)void 0!==t[i]&&void 0!==e[i]&&(o[i]=yo(t[i],e[i]));return function(t){for(var e in o)n[e]=o[e](t);return n}};function wo(t){for(var e=Ao.parse(t),n=e.length,o=0,i=0,r=0,a=0;a<n;a++)o||"number"==typeof e[a]?o++:void 0!==e[a].hue?r++:i++;return{parsed:e,numNumbers:o,numRGB:i,numHSL:r}}var xo=function(t,e){var n=Ao.createTransformer(e),o=wo(t),i=wo(e);return o.numHSL===i.numHSL&&o.numRGB===i.numRGB&&(o.numNumbers,i.numNumbers),Wn(Co(o.parsed,i.parsed),n)},Eo=function(t,e){return function(n){return $n(t,e,n)}};function Lo(t,e,n){for(var o,i=[],r=n||("number"==typeof(o=t[0])?Eo:"string"==typeof o?uo.test(o)?co:xo:Array.isArray(o)?Co:"object"==typeof o?So:void 0),a=t.length-1,s=0;s<a;s++){var l=r(t[s],t[s+1]);if(e){var c=Array.isArray(e)?e[s]:e;l=Wn(c,l)}i.push(l)}return i}function _o(t,e,n){var o=void 0===n?{}:n,i=o.clamp,r=void 0===i||i,a=o.ease,s=o.mixer,l=t.length;e.length,!a||!Array.isArray(a)||a.length,t[0]>t[l-1]&&(t=[].concat(t),e=[].concat(e),t.reverse(),e.reverse());var c=Lo(e,a,s),u=2===l?function(t,e){var n=t[0],o=t[1],i=e[0];return function(t){return i(Xn(n,o,t))}}(t,c):function(t,e){var n=t.length,o=n-1;return function(i){var r=0,a=!1;if(i<=t[0]?a=!0:i>=t[o]&&(r=o-1,a=!0),!a){for(var s=1;s<n&&!(t[s]>i||s===o);s++);r=s-1}var l=Xn(t[r],t[r+1],i);return e[r](l)}}(t,c);return r?function(e){return u(Nn(t[0],t[l-1],e))}:u}var Oo,To=function(t){return function(e){return 1-t(1-e)}},ko=function(t){return function(e){return e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2}},Do=function(t){return function(e){return e*e*((t+1)*e-t)}},Po=function(t){return t},Bo=(Oo=2,function(t){return Math.pow(t,Oo)}),Fo=To(Bo),Ro=ko(Bo),Io=function(t){return 1-Math.sin(Math.acos(t))},Wo=To(Io),Mo=ko(Wo),jo=Do(1.525),zo=To(jo),No=ko(jo),Vo=function(t){var e=Do(t);return function(t){return(t*=2)<1?.5*e(t):.5*(2-Math.pow(2,-10*(t-1)))}}(1.525),Uo=function(t){if(1===t||0===t)return t;var e=t*t;return t<.36363636363636365?7.5625*e:t<.7272727272727273?9.075*e-9.9*t+3.4:t<.9?12.066481994459833*e-19.63545706371191*t+8.898060941828255:10.8*t*t-20.52*t+10.72},Ho=To(Uo);function Go(t,e){return t.map((function(){return e||Ro})).splice(0,t.length-1)}function Qo(t){var e=t.from,n=void 0===e?0:e,o=t.to,i=void 0===o?1:o,r=t.ease,a=t.offset,s=t.duration,l=void 0===s?300:s,c={done:!1,value:n},u=Array.isArray(i)?i:[n,i],d=function(t,e){return t.map((function(t){return t*e}))}(a&&a.length===u.length?a:function(t){var e=t.length;return t.map((function(t,n){return 0!==n?n/(e-1):0}))}(u),l);function h(){return _o(d,u,{ease:Array.isArray(r)?r:Go(u,r)})}var f=h();return{next:function(t){return c.value=f(t),c.done=t>=l,c},flipTarget:function(){u.reverse(),f=h()}}}var Yo={keyframes:Qo,spring:Zn,decay:function(t){var e=t.velocity,n=void 0===e?0:e,o=t.from,i=void 0===o?0:o,r=t.power,a=void 0===r?.8:r,s=t.timeConstant,l=void 0===s?350:s,c=t.restDelta,u=void 0===c?.5:c,d=t.modifyTarget,h={done:!1,value:i},f=a*n,p=i+f,m=void 0===d?p:d(p);return m!==p&&(f=m-i),{next:function(t){var e=-f*Math.exp(-t/l);return h.done=!(e>u||e<-u),h.value=h.done?m:m+e,h},flipTarget:function(){}}}};var Zo=1/60*1e3,qo="undefined"!=typeof performance?function(){return performance.now()}:function(){return Date.now()},Xo="undefined"!=typeof window?function(t){return window.requestAnimationFrame(t)}:function(t){return setTimeout((function(){return t(qo())}),Zo)};var $o=!0,Ko=!1,Jo=!1,ti={delta:0,timestamp:0},ei=["read","update","preRender","render","postRender"],ni=ei.reduce((function(t,e){return t[e]=function(t){var e=[],n=[],o=0,i=!1,r=new WeakSet,a={schedule:function(t,a,s){void 0===a&&(a=!1),void 0===s&&(s=!1);var l=s&&i,c=l?e:n;return a&&r.add(t),-1===c.indexOf(t)&&(c.push(t),l&&i&&(o=e.length)),t},cancel:function(t){var e=n.indexOf(t);-1!==e&&n.splice(e,1),r.delete(t)},process:function(s){var l;if(i=!0,e=(l=[n,e])[0],(n=l[1]).length=0,o=e.length)for(var c=0;c<o;c++){var u=e[c];u(s),r.has(u)&&(a.schedule(u),t())}i=!1}};return a}((function(){return Ko=!0})),t}),{}),oi=ei.reduce((function(t,e){var n=ni[e];return t[e]=function(t,e,o){return void 0===e&&(e=!1),void 0===o&&(o=!1),Ko||li(),n.schedule(t,e,o)},t}),{}),ii=ei.reduce((function(t,e){return t[e]=ni[e].cancel,t}),{}),ri=ei.reduce((function(t,e){return t[e]=function(){return ni[e].process(ti)},t}),{}),ai=function(t){return ni[t].process(ti)},si=function(t){Ko=!1,ti.delta=$o?Zo:Math.max(Math.min(t-ti.timestamp,40),1),ti.timestamp=t,Jo=!0,ei.forEach(ai),Jo=!1,Ko&&($o=!1,Xo(si))},li=function(){Ko=!0,$o=!0,Jo||Xo(si)},ci=function(){return ti},ui=oi;function di(t,e,n){return void 0===n&&(n=0),t-e-n}var hi=function(t){var e=function(e){var n=e.delta;return t(n)};return{start:function(){return ui.update(e,!0)},stop:function(){return ii.update(e)}}};function fi(t){var e,n,o,i,r,a=t.from,s=t.autoplay,l=void 0===s||s,c=t.driver,u=void 0===c?hi:c,d=t.elapsed,h=void 0===d?0:d,f=t.repeat,p=void 0===f?0:f,m=t.repeatType,g=void 0===m?"loop":m,v=t.repeatDelay,A=void 0===v?0:v,b=t.onPlay,y=t.onStop,C=t.onComplete,S=t.onRepeat,w=t.onUpdate,x=Object(xt.d)(t,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]),E=x.to,L=0,_=x.duration,O=!1,T=!0,k=function(t){if(Array.isArray(t.to))return Qo;if(Yo[t.type])return Yo[t.type];var e=new Set(Object.keys(t));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?Qo:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?Zn:Qo}(x);(null===(n=(e=k).needsInterpolation)||void 0===n?void 0:n.call(e,a,E))&&(r=_o([0,100],[a,E],{clamp:!1}),a=0,E=100);var D=k(Object(xt.a)(Object(xt.a)({},x),{from:a,to:E}));function P(){L++,"reverse"===g?h=function(t,e,n,o){return void 0===n&&(n=0),void 0===o&&(o=!0),o?di(e+-t,e,n):e-(t-e)+n}(h,_,A,T=L%2==0):(h=di(h,_,A),"mirror"===g&&D.flipTarget()),O=!1,S&&S()}function B(t){if(T||(t=-t),h+=t,!O){var e=D.next(Math.max(0,h));i=e.value,r&&(i=r(i)),O=T?e.done:h<=0}null==w||w(i),O&&(0===L&&(null!=_||(_=h)),L<p?function(t,e,n,o){return o?t>=e+n:t<=-n}(h,_,A,T)&&P():(o.stop(),C&&C()))}return l&&(null==b||b(),(o=u(B)).start()),{stop:function(){null==y||y(),o.stop()}}}function pi(t,e){return e?t*(1e3/e):0}var mi=function(t){return 1e3*t},gi=function(t,e){return 1-3*e+3*t},vi=function(t,e){return 3*e-6*t},Ai=function(t){return 3*t},bi=function(t,e,n){return((gi(e,n)*t+vi(e,n))*t+Ai(e))*t},yi=function(t,e,n){return 3*gi(e,n)*t*t+2*vi(e,n)*t+Ai(e)};var Ci=.1;function Si(t,e,n,o){if(t===e&&n===o)return Po;for(var i=new Float32Array(11),r=0;r<11;++r)i[r]=bi(r*Ci,t,n);function a(e){for(var o=0,r=1;10!==r&&i[r]<=e;++r)o+=Ci;--r;var a=o+(e-i[r])/(i[r+1]-i[r])*Ci,s=yi(a,t,n);return s>=.001?function(t,e,n,o){for(var i=0;i<8;++i){var r=yi(e,n,o);if(0===r)return e;e-=(bi(e,n,o)-t)/r}return e}(e,a,t,n):0===s?a:function(t,e,n,o,i){var r,a,s=0;do{(r=bi(a=e+(n-e)/2,o,i)-t)>0?n=a:e=a}while(Math.abs(r)>1e-7&&++s<10);return a}(e,o,o+Ci,t,n)}return function(t){return 0===t||1===t?t:bi(a(t),e,o)}}var wi={linear:Po,easeIn:Bo,easeInOut:Ro,easeOut:Fo,circIn:Io,circInOut:Mo,circOut:Wo,backIn:jo,backInOut:No,backOut:zo,anticipate:Vo,bounceIn:Ho,bounceInOut:function(t){return t<.5?.5*(1-Uo(1-2*t)):.5*Uo(2*t-1)+.5},bounceOut:Uo},xi=function(t){if(Array.isArray(t)){t.length;var e=Object(xt.c)(t,4);return Si(e[0],e[1],e[2],e[3])}return"string"==typeof t?wi[t]:t},Ei=function(t,e){return"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!Ao.test(e)||e.startsWith("url(")))},Li=function(){return{type:"spring",stiffness:500,damping:25,restDelta:.5,restSpeed:10}},_i=function(t){return{type:"spring",stiffness:550,damping:0===t?2*Math.sqrt(550):30,restDelta:.01,restSpeed:10}},Oi=function(){return{type:"keyframes",ease:"linear",duration:.3}},Ti=function(t){return{type:"keyframes",duration:.8,values:t}},ki={x:Li,y:Li,z:Li,rotate:Li,rotateX:Li,rotateY:Li,rotateZ:Li,scaleX:_i,scaleY:_i,scale:_i,opacity:Oi,backgroundColor:Oi,color:Oi,default:_i},Di=new Set(["brightness","contrast","saturate","opacity"]);function Pi(t){var e=t.slice(0,-1).split("("),n=e[0],o=e[1];if("drop-shadow"===n)return t;var i=(o.match(ve)||[])[0];if(!i)return t;var r=o.replace(i,""),a=Di.has(n)?1:0;return i!==o&&(a*=100),n+"("+a+r+")"}var Bi=/([a-z-]*)\(.*?\)/g,Fi=Object(xt.a)(Object(xt.a)({},Ao),{getAnimatableNone:function(t){var e=t.match(Bi);return e?e.map(Pi).join(" "):t}}),Ri=Object(xt.a)(Object(xt.a)({},Pe),{color:uo,backgroundColor:uo,outlineColor:uo,fill:uo,stroke:uo,borderColor:uo,borderTopColor:uo,borderRightColor:uo,borderBottomColor:uo,borderLeftColor:uo,filter:Fi,WebkitFilter:Fi}),Ii=function(t){return Ri[t]};function Wi(t,e){var n,o=Ii(t);return o!==Fi&&(o=Ao),null===(n=o.getAnimatableNone)||void 0===n?void 0:n.call(o,e)}function Mi(t){var e=t.ease,n=t.times,o=t.yoyo,i=t.flip,r=t.loop,a=Object(xt.d)(t,["ease","times","yoyo","flip","loop"]),s=Object(xt.a)({},a);return n&&(s.offset=n),a.duration&&(s.duration=mi(a.duration)),a.repeatDelay&&(s.repeatDelay=mi(a.repeatDelay)),e&&(s.ease=function(t){return Array.isArray(t)&&"number"!=typeof t[0]}(e)?e.map(xi):xi(e)),"tween"===a.type&&(s.type="keyframes"),(o||r||i)&&(!0,o?s.repeatType="reverse":r?s.repeatType="loop":i&&(s.repeatType="mirror"),s.repeat=r||o||i||a.repeat),"spring"!==a.type&&(s.type="keyframes"),s}function ji(t,e,n){var o,i,r,a;return Array.isArray(e.to)&&(null!==(o=t.duration)&&void 0!==o||(t.duration=.8)),function(t){Array.isArray(t.to)&&null===t.to[0]&&(t.to=Object(xt.e)([],Object(xt.c)(t.to)),t.to[0]=t.from)}(e),function(t){t.when,t.delay,t.delayChildren,t.staggerChildren,t.staggerDirection,t.repeat,t.repeatType,t.repeatDelay,t.from;var e=Object(xt.d)(t,["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from"]);return!!Object.keys(e).length}(t)||(t=Object(xt.a)(Object(xt.a)({},t),(i=n,r=e.to,a=rn(r)?Ti:ki[i]||ki.default,Object(xt.a)({to:r},a(r))))),Object(xt.a)(Object(xt.a)({},e),Mi(t))}function zi(t,e,n,o,i){var r,a=Ui(o,t),s=null!==(r=a.from)&&void 0!==r?r:e.get(),l=Ei(t,n);"none"===s&&l&&"string"==typeof n?s=Wi(t,n):Ni(s)&&"string"==typeof n?s=Vi(n):!Array.isArray(n)&&Ni(n)&&"string"==typeof s&&(n=Vi(s));var c=Ei(t,s);return c&&l&&!1!==a.type?function(){var o={from:s,to:n,velocity:e.getVelocity(),onComplete:i,onUpdate:function(t){return e.set(t)}};return"inertia"===a.type||"decay"===a.type?function(t){var e,n=t.from,o=void 0===n?0:n,i=t.velocity,r=void 0===i?0:i,a=t.min,s=t.max,l=t.power,c=void 0===l?.8:l,u=t.timeConstant,d=void 0===u?750:u,h=t.bounceStiffness,f=void 0===h?500:h,p=t.bounceDamping,m=void 0===p?10:p,g=t.restDelta,v=void 0===g?1:g,A=t.modifyTarget,b=t.driver,y=t.onUpdate,C=t.onComplete;function S(t){return void 0!==a&&t<a||void 0!==s&&t>s}function w(t){return void 0===a?s:void 0===s||Math.abs(a-t)<Math.abs(s-t)?a:s}function x(t){null==e||e.stop(),e=fi(Object(xt.a)(Object(xt.a)({},t),{driver:b,onUpdate:function(e){var n;null==y||y(e),null===(n=t.onUpdate)||void 0===n||n.call(t,e)},onComplete:C}))}function E(t){x(Object(xt.a)({type:"spring",stiffness:f,damping:m,restDelta:v},t))}if(S(o))E({from:o,velocity:r,to:w(o)});else{var L=c*r+o;"undefined"!=typeof A&&(L=A(L));var _,O,T=w(L),k=T===a?-1:1;x({type:"decay",from:o,velocity:r,timeConstant:d,power:c,restDelta:v,modifyTarget:A,onUpdate:S(L)?function(t){_=O,O=t,r=pi(t-_,ci().delta),(1===k&&t>T||-1===k&&t<T)&&E({from:t,to:T,velocity:r})}:void 0})}return{stop:function(){return null==e?void 0:e.stop()}}}(Object(xt.a)(Object(xt.a)({},o),a)):fi(Object(xt.a)(Object(xt.a)({},ji(a,o,t)),{onUpdate:function(t){var e;o.onUpdate(t),null===(e=a.onUpdate)||void 0===e||e.call(a,t)},onComplete:function(){var t;o.onComplete(),null===(t=a.onComplete)||void 0===t||t.call(a)}}))}:function(){var t;return e.set(n),i(),null===(t=null==a?void 0:a.onComplete)||void 0===t||t.call(a),{stop:function(){}}}}function Ni(t){return 0===t||"string"==typeof t&&0===parseFloat(t)&&-1===t.indexOf(" ")}function Vi(t){return"number"==typeof t?0:Wi("",t)}function Ui(t,e){return t[e]||t.default||t}function Hi(t,e,n,o){return void 0===o&&(o={}),e.start((function(i){var r,a,s=zi(t,e,n,o,i),l=function(t,e){var n;return null!==(n=(Ui(t,e)||{}).delay)&&void 0!==n?n:0}(o,t),c=function(){return a=s()};return l?r=setTimeout(c,mi(l)):c(),function(){clearTimeout(r),null==a||a.stop()}}))}function Gi(t,e){-1===t.indexOf(e)&&t.push(e)}function Qi(t,e){var n=t.indexOf(e);n>-1&&t.splice(n,1)}var Yi=function(){function t(){this.subscriptions=[]}return t.prototype.add=function(t){var e=this;return Gi(this.subscriptions,t),function(){return Qi(e.subscriptions,t)}},t.prototype.notify=function(t,e,n){var o=this.subscriptions.length;if(o)if(1===o)this.subscriptions[0](t,e,n);else for(var i=0;i<o;i++){var r=this.subscriptions[i];r&&r(t,e,n)}},t.prototype.getSize=function(){return this.subscriptions.length},t.prototype.clear=function(){this.subscriptions.length=0},t}(),Zi=function(){function t(t){var e,n=this;this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new Yi,this.velocityUpdateSubscribers=new Yi,this.renderSubscribers=new Yi,this.canTrackVelocity=!1,this.updateAndNotify=function(t,e){void 0===e&&(e=!0),n.prev=n.current,n.current=t;var o=ci(),i=o.delta,r=o.timestamp;n.lastUpdated!==r&&(n.timeDelta=i,n.lastUpdated=r,ui.postRender(n.scheduleVelocityCheck)),n.prev!==n.current&&n.updateSubscribers.notify(n.current),n.velocityUpdateSubscribers.getSize()&&n.velocityUpdateSubscribers.notify(n.getVelocity()),e&&n.renderSubscribers.notify(n.current)},this.scheduleVelocityCheck=function(){return ui.postRender(n.velocityCheck)},this.velocityCheck=function(t){t.timestamp!==n.lastUpdated&&(n.prev=n.current,n.velocityUpdateSubscribers.notify(n.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e)))}return t.prototype.onChange=function(t){return this.updateSubscribers.add(t)},t.prototype.clearListeners=function(){this.updateSubscribers.clear()},t.prototype.onRenderRequest=function(t){return t(this.get()),this.renderSubscribers.add(t)},t.prototype.attach=function(t){this.passiveEffect=t},t.prototype.set=function(t,e){void 0===e&&(e=!0),e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)},t.prototype.get=function(){return this.current},t.prototype.getPrevious=function(){return this.prev},t.prototype.getVelocity=function(){return this.canTrackVelocity?pi(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0},t.prototype.start=function(t){var e=this;return this.stop(),new Promise((function(n){e.hasAnimated=!0,e.stopAnimation=t(n)})).then((function(){return e.clearAnimation()}))},t.prototype.stop=function(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()},t.prototype.isAnimating=function(){return!!this.stopAnimation},t.prototype.clearAnimation=function(){this.stopAnimation=null},t.prototype.destroy=function(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()},t}();function qi(t){return new Zi(t)}var Xi=function(t){return function(e){return e.test(t)}},$i=[Oe,xe,we,Se,Le,Ee,{test:function(t){return"auto"===t},parse:function(t){return t}}],Ki=function(t){return $i.find(Xi(t))},Ji=Object(xt.e)(Object(xt.e)([],Object(xt.c)($i)),[uo,Ao]),tr=function(t){return Ji.find(Xi(t))};function er(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,qi(n))}function nr(t,e){var n=Yt(t,e),o=n?t.makeTargetAnimatable(n,!1):{},i=o.transitionEnd,r=void 0===i?{}:i;o.transition;var a,s=Object(xt.d)(o,["transitionEnd","transition"]);for(var l in s=Object(xt.a)(Object(xt.a)({},s),r)){er(t,l,(a=s[l],rn(a)?a[a.length-1]||0:a))}}function or(t,e){if(e)return(e[t]||e.default||e).from}function ir(t,e,n){var o;void 0===n&&(n={});var i=Yt(t,e,n.custom),r=(i||{}).transition,a=void 0===r?t.getDefaultTransition()||{}:r;n.transitionOverride&&(a=n.transitionOverride);var s=i?function(){return rr(t,i,n)}:function(){return Promise.resolve()},l=(null===(o=t.variantChildren)||void 0===o?void 0:o.size)?function(o){void 0===o&&(o=0);var i=a.delayChildren,r=void 0===i?0:i,s=a.staggerChildren,l=a.staggerDirection;return function(t,e,n,o,i,r){void 0===n&&(n=0);void 0===o&&(o=0);void 0===i&&(i=1);var a=[],s=(t.variantChildren.size-1)*o,l=1===i?function(t){return void 0===t&&(t=0),t*o}:function(t){return void 0===t&&(t=0),s-t*o};return Array.from(t.variantChildren).sort(ar).forEach((function(t,o){a.push(ir(t,e,Object(xt.a)(Object(xt.a)({},r),{delay:n+l(o)})).then((function(){return t.notifyAnimationComplete(e)})))})),Promise.all(a)}(t,e,r+o,s,l,n)}:function(){return Promise.resolve()},c=a.when;if(c){var u=Object(xt.c)("beforeChildren"===c?[s,l]:[l,s],2),d=u[0],h=u[1];return d().then(h)}return Promise.all([s(),l(n.delay)])}function rr(t,e,n){var o,i=void 0===n?{}:n,r=i.delay,a=void 0===r?0:r,s=i.transitionOverride,l=i.type,c=t.makeTargetAnimatable(e),u=c.transition,d=void 0===u?t.getDefaultTransition():u,h=c.transitionEnd,f=Object(xt.d)(c,["transition","transitionEnd"]);s&&(d=s);var p=[],m=l&&(null===(o=t.animationState)||void 0===o?void 0:o.getState()[l]);for(var g in f){var v=t.getValue(g),A=f[g];if(!(!v||void 0===A||m&&sr(m,g))){var b=Hi(g,v,A,Object(xt.a)({delay:a},d));p.push(b)}}return Promise.all(p).then((function(){h&&nr(t,h)}))}function ar(t,e){return t.sortNodePosition(e)}function sr(t,e){var n=t.protectedKeys,o=t.needsAnimating,i=n.hasOwnProperty(e)&&!0!==o[e];return o[e]=!1,i}var lr=[dn.Animate,dn.Hover,dn.Tap,dn.Drag,dn.Focus,dn.Exit],cr=Object(xt.e)([],Object(xt.c)(lr)).reverse(),ur=lr.length;function dr(t){return function(e){return Promise.all(e.map((function(e){var n=e.animation,o=e.options;return function(t,e,n){var o;if(void 0===n&&(n={}),t.notifyAnimationStart(),Array.isArray(e)){var i=e.map((function(e){return ir(t,e,n)}));o=Promise.all(i)}else if("string"==typeof e)o=ir(t,e,n);else{var r="function"==typeof e?Yt(t,e,n.custom):e;o=rr(t,r,n)}return o.then((function(){return t.notifyAnimationComplete(e)}))}(t,n,o)})))}}function hr(t){var e,n=dr(t),o=((e={})[dn.Animate]=fr(!0),e[dn.Hover]=fr(),e[dn.Tap]=fr(),e[dn.Drag]=fr(),e[dn.Focus]=fr(),e[dn.Exit]=fr(),e),i={},r=!0,a=function(e,n){var o=Yt(t,n);if(o){o.transition;var i=o.transitionEnd,r=Object(xt.d)(o,["transition","transitionEnd"]);e=Object(xt.a)(Object(xt.a)(Object(xt.a)({},e),r),i)}return e};function s(e,s){for(var l,c=t.getProps(),u=t.getVariantContext(!0)||{},d=[],h=new Set,f={},p=1/0,m=function(n){var i=cr[n],m=o[i],g=null!==(l=c[i])&&void 0!==l?l:u[i],v=Gt(g),A=i===s?m.isActive:null;!1===A&&(p=n);var b=g===u[i]&&g!==c[i]&&v;if(b&&r&&t.manuallyAnimateOnMount&&(b=!1),m.protectedKeys=Object(xt.a)({},f),!m.isActive&&null===A||!g&&!m.prevProp||on(g)||"boolean"==typeof g)return"continue";var y=function(t,e){if("string"==typeof e)return e!==t;if(Ht(e))return!zn(e,t);return!1}(m.prevProp,g)||i===s&&m.isActive&&!b&&v||n>p&&v,C=Array.isArray(g)?g:[g],S=C.reduce(a,{});!1===A&&(S={});var w=m.prevResolvedValues,x=void 0===w?{}:w,E=Object(xt.a)(Object(xt.a)({},x),S),L=function(t){y=!0,h.delete(t),m.needsAnimating[t]=!0};for(var _ in E){var O=S[_],T=x[_];f.hasOwnProperty(_)||(O!==T?rn(O)&&rn(T)?zn(O,T)?m.protectedKeys[_]=!0:L(_):void 0!==O?L(_):h.add(_):void 0!==O&&h.has(_)?L(_):m.protectedKeys[_]=!0)}m.prevProp=g,m.prevResolvedValues=S,m.isActive&&(f=Object(xt.a)(Object(xt.a)({},f),S)),r&&t.blockInitialAnimation&&(y=!1),y&&!b&&d.push.apply(d,Object(xt.e)([],Object(xt.c)(C.map((function(t){return{animation:t,options:Object(xt.a)({type:i},e)}})))))},g=0;g<ur;g++)m(g);if(i=Object(xt.a)({},f),h.size){var v={};h.forEach((function(e){var n=t.getBaseTarget(e);void 0!==n&&(v[e]=n)})),d.push({animation:v})}var A=Boolean(d.length);return r&&!1===c.initial&&!t.manuallyAnimateOnMount&&(A=!1),r=!1,A?n(d):Promise.resolve()}return{isAnimated:function(t){return void 0!==i[t]},animateChanges:s,setActive:function(e,n,i){var r;return o[e].isActive===n?Promise.resolve():(null===(r=t.variantChildren)||void 0===r||r.forEach((function(t){var o;return null===(o=t.animationState)||void 0===o?void 0:o.setActive(e,n)})),o[e].isActive=n,s(i,e))},setAnimateFunction:function(e){n=e(t)},getState:function(){return o}}}function fr(t){return void 0===t&&(t=!1),{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}var pr={animation:Mn((function(t){var e=t.visualElement,n=t.animate;e.animationState||(e.animationState=hr(e)),on(n)&&Object(W.useEffect)((function(){return n.subscribe(e)}),[n])})),exit:Mn((function(t){var e=t.custom,n=t.visualElement,o=Object(xt.c)(Ft(),2),i=o[0],r=o[1],a=Object(W.useContext)(Pt);Object(W.useEffect)((function(){var t,o,s=null===(t=n.animationState)||void 0===t?void 0:t.setActive(dn.Exit,!i,{custom:null!==(o=null==a?void 0:a.custom)&&void 0!==o?o:e});!i&&(null==s||s.then(r))}),[i])}))},mr=function(t){return t.hasOwnProperty("x")&&t.hasOwnProperty("y")},gr=function(t){return mr(t)&&t.hasOwnProperty("z")},vr=function(t,e){return Math.abs(t-e)};function Ar(t,e){if(bo(t)&&bo(e))return vr(t,e);if(mr(t)&&mr(e)){var n=vr(t.x,e.x),o=vr(t.y,e.y),i=gr(t)&&gr(e)?vr(t.z,e.z):0;return Math.sqrt(Math.pow(n,2)+Math.pow(o,2)+Math.pow(i,2))}}var br=function(){function t(t,e,n){var o=this,i=(void 0===n?{}:n).transformPagePoint;if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=function(){if(o.lastMoveEvent&&o.lastMoveEventInfo){var t=Sr(o.lastMoveEventInfo,o.history),e=null!==o.startEvent,n=Ar(t.offset,{x:0,y:0})>=3;if(e||n){var i=t.point,r=ci().timestamp;o.history.push(Object(xt.a)(Object(xt.a)({},i),{timestamp:r}));var a=o.handlers,s=a.onStart,l=a.onMove;e||(s&&s(o.lastMoveEvent,t),o.startEvent=o.lastMoveEvent),l&&l(o.lastMoveEvent,t)}}},this.handlePointerMove=function(t,e){o.lastMoveEvent=t,o.lastMoveEventInfo=yr(e,o.transformPagePoint),gn(t)&&0===t.buttons?o.handlePointerUp(t,e):ui.update(o.updatePoint,!0)},this.handlePointerUp=function(t,e){o.end();var n=o.handlers,i=n.onEnd,r=n.onSessionEnd,a=Sr(yr(e,o.transformPagePoint),o.history);o.startEvent&&i&&i(t,a),r&&r(t,a)},!(vn(t)&&t.touches.length>1)){this.handlers=e,this.transformPagePoint=i;var r=yr(Cn(t),this.transformPagePoint),a=r.point,s=ci().timestamp;this.history=[Object(xt.a)(Object(xt.a)({},a),{timestamp:s})];var l=e.onSessionStart;l&&l(t,Sr(r,this.history)),this.removeListeners=Wn(Ln(window,"pointermove",this.handlePointerMove),Ln(window,"pointerup",this.handlePointerUp),Ln(window,"pointercancel",this.handlePointerUp))}}return t.prototype.updateHandlers=function(t){this.handlers=t},t.prototype.end=function(){this.removeListeners&&this.removeListeners(),ii.update(this.updatePoint)},t}();function yr(t,e){return e?{point:e(t.point)}:t}function Cr(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Sr(t,e){var n=t.point;return{point:n,delta:Cr(n,xr(e)),offset:Cr(n,wr(e)),velocity:Er(e,.1)}}function wr(t){return t[0]}function xr(t){return t[t.length-1]}function Er(t,e){if(t.length<2)return{x:0,y:0};for(var n=t.length-1,o=null,i=xr(t);n>=0&&(o=t[n],!(i.timestamp-o.timestamp>mi(e)));)n--;if(!o)return{x:0,y:0};var r=(i.timestamp-o.timestamp)/1e3;if(0===r)return{x:0,y:0};var a={x:(i.x-o.x)/r,y:(i.y-o.y)/r};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function Lr(t){return t}function _r(t){var e=t.top;return{x:{min:t.left,max:t.right},y:{min:e,max:t.bottom}}}var Or={translate:0,scale:1,origin:0,originPoint:0};function Tr(){return{x:Object(xt.a)({},Or),y:Object(xt.a)({},Or)}}function kr(t){return[t("x"),t("y")]}function Dr(t,e,n){var o=e.min,i=e.max;return void 0!==o&&t<o?t=n?$n(o,t,n.min):Math.max(t,o):void 0!==i&&t>i&&(t=n?$n(i,t,n.max):Math.min(t,i)),t}function Pr(t,e,n){return{min:void 0!==e?t.min+e:void 0,max:void 0!==n?t.max+n-(t.max-t.min):void 0}}function Br(t,e){var n,o=e.min-t.min,i=e.max-t.max;return e.max-e.min<t.max-t.min&&(o=(n=Object(xt.c)([i,o],2))[0],i=n[1]),{min:t.min+o,max:t.min+i}}function Fr(t,e,n){return{min:Rr(t,e),max:Rr(t,n)}}function Rr(t,e){var n;return"number"==typeof t?t:null!==(n=t[e])&&void 0!==n?n:0}function Ir(t,e){return _r(function(t,e){var n=t.top,o=t.left,i=t.bottom,r=t.right;void 0===e&&(e=Lr);var a=e({x:o,y:n}),s=e({x:r,y:i});return{top:a.y,left:a.x,bottom:s.y,right:s.x}}(t.getBoundingClientRect(),e))}function Wr(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=.01),Ar(t,e)<n}function Mr(t){return t.max-t.min}function jr(t,e){var n=.5,o=Mr(t),i=Mr(e);return i>o?n=Xn(e.min,e.max-o,t.min):o>i&&(n=Xn(t.min,t.max-i,e.min)),Nn(0,1,n)}function zr(t,e,n,o){void 0===o&&(o=.5),t.origin=o,t.originPoint=$n(e.min,e.max,t.origin),t.scale=Mr(n)/Mr(e),Wr(t.scale,1,1e-4)&&(t.scale=1),t.translate=$n(n.min,n.max,t.origin)-t.originPoint,Wr(t.translate)&&(t.translate=0)}function Nr(t,e,n,o){zr(t.x,e.x,n.x,Vr(o.originX)),zr(t.y,e.y,n.y,Vr(o.originY))}function Vr(t){return"number"==typeof t?t:.5}function Ur(t,e,n){t.min=n.min+e.min,t.max=t.min+Mr(e)}var Hr=function(t,e){return t.depth-e.depth};function Gr(t){return t.projection.isEnabled||t.shouldResetTransform()}function Qr(t,e){void 0===e&&(e=[]);var n=t.parent;return n&&Qr(n,e),Gr(t)&&e.push(t),e}function Yr(t){if(!t.shouldResetTransform()){var e,n=t.getLayoutState();t.notifyBeforeLayoutMeasure(n.layout),n.isHydrated=!0,n.layout=t.measureViewportBox(),n.layoutCorrected=(e=n.layout,{x:Object(xt.a)({},e.x),y:Object(xt.a)({},e.y)}),t.notifyLayoutMeasure(n.layout,t.prevViewportBox||n.layout),ui.update((function(){return t.rebaseProjectionTarget()}))}}function Zr(t,e){return{min:e.min-t.min,max:e.max-t.min}}function qr(t,e){return{x:Zr(t.x,e.x),y:Zr(t.y,e.y)}}function Xr(t,e){var n=t.getLayoutId(),o=e.getLayoutId();return n!==o||void 0===o&&t!==e}function $r(t){var e=t.getProps(),n=e.drag,o=e._dragX;return n&&!o}function Kr(t,e){t.min=e.min,t.max=e.max}function Jr(t,e,n){return n+e*(t-n)}function ta(t,e,n,o,i){return void 0!==i&&(t=Jr(t,i,o)),Jr(t,n,o)+e}function ea(t,e,n,o,i){void 0===e&&(e=0),void 0===n&&(n=1),t.min=ta(t.min,e,n,o,i),t.max=ta(t.max,e,n,o,i)}function na(t,e){var n=e.x,o=e.y;ea(t.x,n.translate,n.scale,n.originPoint),ea(t.y,o.translate,o.scale,o.originPoint)}function oa(t,e,n,o){var i=Object(xt.c)(o,3),r=i[0],a=i[1],s=i[2];t.min=e.min,t.max=e.max;var l=void 0!==n[s]?n[s]:.5,c=$n(e.min,e.max,l);ea(t,n[r],n[a],c,n.scale)}var ia=["x","scaleX","originX"],ra=["y","scaleY","originY"];function aa(t,e,n){oa(t.x,e.x,n,ia),oa(t.y,e.y,n,ra)}function sa(t,e,n,o,i){return t=Jr(t-=e,1/n,o),void 0!==i&&(t=Jr(t,1/i,o)),t}function la(t,e,n){var o=Object(xt.c)(n,3),i=o[0],r=o[1],a=o[2];!function(t,e,n,o,i){void 0===e&&(e=0),void 0===n&&(n=1),void 0===o&&(o=.5);var r=$n(t.min,t.max,o)-e;t.min=sa(t.min,e,n,r,i),t.max=sa(t.max,e,n,r,i)}(t,e[i],e[r],e[a],e.scale)}function ca(t,e){la(t.x,e,ia),la(t.y,e,ra)}var ua=new Set;function da(t,e,n){t[n]||(t[n]=[]),t[n].push(e)}function ha(t){return ua.add(t),function(){return ua.delete(t)}}function fa(){if(ua.size){var t=0,e=[[]],n=[],o=function(n){return da(e,n,t)},i=function(e){da(n,e,t),t++};ua.forEach((function(e){e(o,i),t=0})),ua.clear();for(var r=n.length,a=0;a<=r;a++)e[a]&&e[a].forEach(ma),n[a]&&n[a].forEach(ma)}}var pa,ma=function(t){return t()},ga=new WeakMap,va=function(){function t(t){var e=t.visualElement;this.isDragging=!1,this.currentDirection=null,this.constraints=!1,this.elastic={x:{min:0,max:1},y:{min:0,max:1}},this.props={},this.hasMutatedConstraints=!1,this.cursorProgress={x:.5,y:.5},this.originPoint={},this.openGlobalLock=null,this.panSession=null,this.visualElement=e,this.visualElement.enableLayoutProjection(),ga.set(e,this)}return t.prototype.start=function(t,e){var n=this,o=void 0===e?{}:e,i=o.snapToCursor,r=void 0!==i&&i,a=o.cursorProgress,s=this.props.transformPagePoint;this.panSession=new br(t,{onSessionStart:function(t){var e;n.stopMotion();var o=function(t){return Cn(t,"client")}(t).point;null===(e=n.cancelLayout)||void 0===e||e.call(n),n.cancelLayout=ha((function(t,e){var i=Qr(n.visualElement),s=function(t){var e=[],n=function(t){Gr(t)&&e.push(t),t.children.forEach(n)};return t.children.forEach(n),e.sort(Hr)}(n.visualElement),l=Object(xt.e)(Object(xt.e)([],Object(xt.c)(i)),Object(xt.c)(s)),c=!1;n.isLayoutDrag()&&n.visualElement.lockProjectionTarget(),e((function(){l.forEach((function(t){return t.resetTransform()}))})),t((function(){Yr(n.visualElement),s.forEach(Yr)})),e((function(){l.forEach((function(t){return t.restoreTransform()})),r&&(c=n.snapToCursor(o))})),t((function(){Boolean(n.getAxisMotionValue("x")&&!n.isExternalDrag())||n.visualElement.rebaseProjectionTarget(!0,n.visualElement.measureViewportBox(!1)),n.visualElement.scheduleUpdateLayoutProjection();var t=n.visualElement.projection;kr((function(e){if(!c){var i=t.target[e],r=i.min,s=i.max;n.cursorProgress[e]=a?a[e]:Xn(r,s,o[e])}var l=n.getAxisMotionValue(e);l&&(n.originPoint[e]=l.get())}))})),e((function(){ri.update(),ri.preRender(),ri.render(),ri.postRender()})),t((function(){return n.resolveDragConstraints()}))}))},onStart:function(t,e){var o,i,r,a=n.props,s=a.drag,l=a.dragPropagation;(!s||l||(n.openGlobalLock&&n.openGlobalLock(),n.openGlobalLock=Dn(s),n.openGlobalLock))&&(fa(),n.isDragging=!0,n.currentDirection=null,null===(i=(o=n.props).onDragStart)||void 0===i||i.call(o,t,e),null===(r=n.visualElement.animationState)||void 0===r||r.setActive(dn.Drag,!0))},onMove:function(t,e){var o,i,r,a,s=n.props,l=s.dragPropagation,c=s.dragDirectionLock;if(l||n.openGlobalLock){var u=e.offset;if(c&&null===n.currentDirection)return n.currentDirection=function(t,e){void 0===e&&(e=10);var n=null;Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x");return n}(u),void(null!==n.currentDirection&&(null===(i=(o=n.props).onDirectionLock)||void 0===i||i.call(o,n.currentDirection)));n.updateAxis("x",e.point,u),n.updateAxis("y",e.point,u),null===(a=(r=n.props).onDrag)||void 0===a||a.call(r,t,e),pa=t}},onSessionEnd:function(t,e){return n.stop(t,e)}},{transformPagePoint:s})},t.prototype.resolveDragConstraints=function(){var t=this,e=this.props,n=e.dragConstraints,o=e.dragElastic,i=this.visualElement.getLayoutState().layoutCorrected;this.constraints=!!n&&(Ut(n)?this.resolveRefConstraints(i,n):function(t,e){var n=e.top,o=e.left,i=e.bottom,r=e.right;return{x:Pr(t.x,o,r),y:Pr(t.y,n,i)}}(i,n)),this.elastic=function(t){return!1===t?t=0:!0===t&&(t=.35),{x:Fr(t,"left","right"),y:Fr(t,"top","bottom")}}(o),this.constraints&&!this.hasMutatedConstraints&&kr((function(e){t.getAxisMotionValue(e)&&(t.constraints[e]=function(t,e){var n={};return void 0!==e.min&&(n.min=e.min-t.min),void 0!==e.max&&(n.max=e.max-t.min),n}(i[e],t.constraints[e]))}))},t.prototype.resolveRefConstraints=function(t,e){var n=this.props,o=n.onMeasureDragConstraints,i=n.transformPagePoint,r=e.current;this.constraintsBox=Ir(r,i);var a=function(t,e){return{x:Br(t.x,e.x),y:Br(t.y,e.y)}}(t,this.constraintsBox);if(o){var s=o(function(t){var e=t.x,n=t.y;return{top:n.min,bottom:n.max,left:e.min,right:e.max}}(a));this.hasMutatedConstraints=!!s,s&&(a=_r(s))}return a},t.prototype.cancelDrag=function(){var t,e;this.visualElement.unlockProjectionTarget(),null===(t=this.cancelLayout)||void 0===t||t.call(this),this.isDragging=!1,this.panSession&&this.panSession.end(),this.panSession=null,!this.props.dragPropagation&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),null===(e=this.visualElement.animationState)||void 0===e||e.setActive(dn.Drag,!1)},t.prototype.stop=function(t,e){var n,o,i;null===(n=this.panSession)||void 0===n||n.end(),this.panSession=null;var r=this.isDragging;if(this.cancelDrag(),r){var a=e.velocity;this.animateDragEnd(a),null===(i=(o=this.props).onDragEnd)||void 0===i||i.call(o,t,e)}},t.prototype.snapToCursor=function(t){var e=this;return kr((function(n){if(Aa(n,e.props.drag,e.currentDirection)){var o=e.getAxisMotionValue(n);if(!o)return e.cursorProgress[n]=.5,!0;var i=e.visualElement.getLayoutState().layout,r=i[n].max-i[n].min,a=i[n].min+r/2,s=t[n]-a;e.originPoint[n]=t[n],o.set(s)}})).includes(!0)},t.prototype.updateAxis=function(t,e,n){if(Aa(t,this.props.drag,this.currentDirection))return this.getAxisMotionValue(t)?this.updateAxisMotionValue(t,n):this.updateVisualElementAxis(t,e)},t.prototype.updateAxisMotionValue=function(t,e){var n=this.getAxisMotionValue(t);if(e&&n){var o=this.originPoint[t]+e[t],i=this.constraints?Dr(o,this.constraints[t],this.elastic[t]):o;n.set(i)}},t.prototype.updateVisualElementAxis=function(t,e){var n,o=this.visualElement.getLayoutState().layout[t],i=o.max-o.min,r=this.cursorProgress[t],a=function(t,e,n,o,i){var r=t-e*n;return o?Dr(r,o,i):r}(e[t],i,r,null===(n=this.constraints)||void 0===n?void 0:n[t],this.elastic[t]);this.visualElement.setProjectionTargetAxis(t,a,a+i)},t.prototype.setProps=function(t){var e=t.drag,n=void 0!==e&&e,o=t.dragDirectionLock,i=void 0!==o&&o,r=t.dragPropagation,a=void 0!==r&&r,s=t.dragConstraints,l=void 0!==s&&s,c=t.dragElastic,u=void 0===c?.35:c,d=t.dragMomentum,h=void 0===d||d,f=Object(xt.d)(t,["drag","dragDirectionLock","dragPropagation","dragConstraints","dragElastic","dragMomentum"]);this.props=Object(xt.a)({drag:n,dragDirectionLock:i,dragPropagation:a,dragConstraints:l,dragElastic:u,dragMomentum:h},f)},t.prototype.getAxisMotionValue=function(t){var e=this.props,n=e.layout,o=e.layoutId,i="_drag"+t.toUpperCase();return this.props[i]?this.props[i]:n||void 0!==o?void 0:this.visualElement.getValue(t,0)},t.prototype.isLayoutDrag=function(){return!this.getAxisMotionValue("x")},t.prototype.isExternalDrag=function(){var t=this.props,e=t._dragX,n=t._dragY;return e||n},t.prototype.animateDragEnd=function(t){var e=this,n=this.props,o=n.drag,i=n.dragMomentum,r=n.dragElastic,a=n.dragTransition,s=function(t,e){void 0===e&&(e=!0);var n,o=t.getProjectionParent();return!!o&&(e?ca(n=qr(o.projection.target,t.projection.target),o.getLatestValues()):n=qr(o.getLayoutState().layout,t.getLayoutState().layout),kr((function(e){return t.setProjectionTargetAxis(e,n[e].min,n[e].max,!0)})),!0)}(this.visualElement,this.isLayoutDrag()&&!this.isExternalDrag()),l=this.constraints||{};if(s&&Object.keys(l).length&&this.isLayoutDrag()){var c=this.visualElement.getProjectionParent();if(c){var u=qr(c.projection.targetFinal,l);kr((function(t){var e=u[t],n=e.min,o=e.max;l[t]={min:isNaN(n)?void 0:n,max:isNaN(o)?void 0:o}}))}}var d=kr((function(n){var c;if(Aa(n,o,e.currentDirection)){var u=null!==(c=null==l?void 0:l[n])&&void 0!==c?c:{},d=r?200:1e6,h=r?40:1e7,f=Object(xt.a)(Object(xt.a)({type:"inertia",velocity:i?t[n]:0,bounceStiffness:d,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10},a),u);return e.getAxisMotionValue(n)?e.startAxisValueAnimation(n,f):e.visualElement.startLayoutAnimation(n,f,s)}}));return Promise.all(d).then((function(){var t,n;null===(n=(t=e.props).onDragTransitionEnd)||void 0===n||n.call(t)}))},t.prototype.stopMotion=function(){var t=this;kr((function(e){var n=t.getAxisMotionValue(e);n?n.stop():t.visualElement.stopLayoutAnimation()}))},t.prototype.startAxisValueAnimation=function(t,e){var n=this.getAxisMotionValue(t);if(n){var o=n.get();return n.set(o),n.set(o),Hi(t,n,0,e)}},t.prototype.scalePoint=function(){var t=this,e=this.props,n=e.drag;if(Ut(e.dragConstraints)&&this.constraintsBox){this.stopMotion();var o={x:0,y:0};kr((function(e){o[e]=jr(t.visualElement.projection.target[e],t.constraintsBox[e])})),this.updateConstraints((function(){kr((function(e){if(Aa(e,n,null)){var i=function(t,e,n){var o=t.max-t.min,i=$n(e.min,e.max-o,n);return{min:i,max:i+o}}(t.visualElement.projection.target[e],t.constraintsBox[e],o[e]),r=i.min,a=i.max;t.visualElement.setProjectionTargetAxis(e,r,a)}}))})),setTimeout(fa,1)}},t.prototype.updateConstraints=function(t){var e=this;this.cancelLayout=ha((function(n,o){var i=Qr(e.visualElement);o((function(){return i.forEach((function(t){return t.resetTransform()}))})),n((function(){return Yr(e.visualElement)})),o((function(){return i.forEach((function(t){return t.restoreTransform()}))})),n((function(){e.resolveDragConstraints()})),t&&o(t)}))},t.prototype.mount=function(t){var e=this,n=Ln(t.getInstance(),"pointerdown",(function(t){var n=e.props,o=n.drag,i=n.dragListener;o&&(void 0===i||i)&&e.start(t)})),o=pn(window,"resize",(function(){e.scalePoint()})),i=t.onLayoutUpdate((function(){e.isDragging&&e.resolveDragConstraints()})),r=t.prevDragCursor;return r&&this.start(pa,{cursorProgress:r}),function(){null==n||n(),null==o||o(),null==i||i(),e.cancelDrag()}},t}();function Aa(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}var ba,ya,Ca={pan:Mn((function(t){var e=t.onPan,n=t.onPanStart,o=t.onPanEnd,i=t.onPanSessionStart,r=t.visualElement,a=e||n||o||i,s=Object(W.useRef)(null),l=Object(W.useContext)(kt).transformPagePoint,c={onSessionStart:i,onStart:n,onMove:e,onEnd:function(t,e){s.current=null,o&&o(t,e)}};Object(W.useEffect)((function(){null!==s.current&&s.current.updateHandlers(c)})),_n(r,"pointerdown",a&&function(t){s.current=new br(t,c,{transformPagePoint:l})}),Rn((function(){return s.current&&s.current.end()}))})),drag:Mn((function(t){var e=t.dragControls,n=t.visualElement,o=Object(W.useContext)(kt).transformPagePoint,i=Bt((function(){return new va({visualElement:n})}));i.setProps(Object(xt.a)(Object(xt.a)({},t),{transformPagePoint:o})),Object(W.useEffect)((function(){return e&&e.subscribe(i)}),[i]),Object(W.useEffect)((function(){return i.mount(n)}),[])}))};function Sa(t){return"string"==typeof t&&t.startsWith("var(--")}!function(t){t[t.Entering=0]="Entering",t[t.Present=1]="Present",t[t.Exiting=2]="Exiting"}(ba||(ba={})),function(t){t[t.Hide=0]="Hide",t[t.Show=1]="Show"}(ya||(ya={}));var wa=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function xa(t,e,n){void 0===n&&(n=1);var o=Object(xt.c)(function(t){var e=wa.exec(t);if(!e)return[,];var n=Object(xt.c)(e,3);return[n[1],n[2]]}(t),2),i=o[0],r=o[1];if(i){var a=window.getComputedStyle(e).getPropertyValue(i);return a?a.trim():Sa(r)?xa(r,e,n+1):r}}function Ea(t,e){return t/(e.max-e.min)*100}var La="_$css";var _a={process:function(t,e,n){var o=n.target;if("string"==typeof t){if(!xe.test(t))return t;t=parseFloat(t)}return Ea(t,o.x)+"% "+Ea(t,o.y)+"%"}},Oa={borderRadius:Object(xt.a)(Object(xt.a)({},_a),{applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]}),borderTopLeftRadius:_a,borderTopRightRadius:_a,borderBottomLeftRadius:_a,borderBottomRightRadius:_a,boxShadow:{process:function(t,e){var n=e.delta,o=e.treeScale,i=t,r=t.includes("var("),a=[];r&&(t=t.replace(wa,(function(t){return a.push(t),La})));var s=Ao.parse(t);if(s.length>5)return i;var l=Ao.createTransformer(t),c="number"!=typeof s[0]?1:0,u=n.x.scale*o.x,d=n.y.scale*o.y;s[0+c]/=u,s[1+c]/=d;var h=$n(u,d,.5);"number"==typeof s[2+c]&&(s[2+c]/=h),"number"==typeof s[3+c]&&(s[3+c]/=h);var f=l(s);if(r){var p=0;f=f.replace(La,(function(){var t=a[p];return p++,t}))}return f}}},Ta=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.frameTarget={x:{min:0,max:1},y:{min:0,max:1}},e.currentAnimationTarget={x:{min:0,max:1},y:{min:0,max:1}},e.isAnimating={x:!1,y:!1},e.stopAxisAnimation={x:void 0,y:void 0},e.isAnimatingTree=!1,e.animate=function(t,n,o){void 0===o&&(o={});var i=o.originBox,r=o.targetBox,a=o.visibilityAction,s=o.shouldStackAnimate,l=o.onComplete,c=o.prevParent,u=Object(xt.d)(o,["originBox","targetBox","visibilityAction","shouldStackAnimate","onComplete","prevParent"]),d=e.props,h=d.visualElement,f=d.layout;if(!1===s)return e.isAnimatingTree=!1,e.safeToRemove();if(!e.isAnimatingTree||!0===s){s&&(e.isAnimatingTree=!0),n=i||n,t=r||t;var p=!1,m=h.getProjectionParent();if(m){var g=m.prevViewportBox,v=m.getLayoutState().layout;c&&(r&&(v=c.getLayoutState().layout),i&&!Xr(c,m)&&c.prevViewportBox&&(g=c.prevViewportBox)),g&&Ra(c,i,r)&&(p=!0,n=qr(g,n),t=qr(v,t))}var A=ka(n,t),b=kr((function(o){var i,r;if("position"===f){var s=t[o].max-t[o].min;n[o].max=n[o].min+s}if(!h.projection.isTargetLocked)return void 0===a?A?e.animateAxis(o,t[o],n[o],Object(xt.a)(Object(xt.a)({},u),{isRelative:p})):(null===(r=(i=e.stopAxisAnimation)[o])||void 0===r||r.call(i),h.setProjectionTargetAxis(o,t[o].min,t[o].max,p)):void h.setVisibility(a===ya.Show)}));return h.syncRender(),Promise.all(b).then((function(){e.isAnimatingTree=!1,l&&l(),h.notifyLayoutAnimationComplete()}))}},e}return Object(xt.b)(e,t),e.prototype.componentDidMount=function(){var t=this,e=this.props.visualElement;e.animateMotionValue=Hi,e.enableLayoutProjection(),this.unsubLayoutReady=e.onLayoutUpdate(this.animate),e.layoutSafeToRemove=function(){return t.safeToRemove()},function(t){for(var e in t)ne[e]=t[e]}(Oa)},e.prototype.componentWillUnmount=function(){var t=this;this.unsubLayoutReady(),kr((function(e){var n,o;return null===(o=(n=t.stopAxisAnimation)[e])||void 0===o?void 0:o.call(n)}))},e.prototype.animateAxis=function(t,e,n,o){var i,r,a=this,s=void 0===o?{}:o,l=s.transition,c=s.isRelative;if(!this.isAnimating[t]||!Ba(e,this.currentAnimationTarget[t])){null===(r=(i=this.stopAxisAnimation)[t])||void 0===r||r.call(i),this.isAnimating[t]=!0;var u=this.props.visualElement,d=this.frameTarget[t],h=u.getProjectionAnimationProgress()[t];h.clearListeners(),h.set(0),h.set(0);var f=function(){var o=h.get()/1e3;!function(t,e,n,o){t.min=$n(e.min,n.min,o),t.max=$n(e.max,n.max,o)}(d,n,e,o),u.setProjectionTargetAxis(t,d.min,d.max,c)};f();var p=h.onChange(f);this.stopAxisAnimation[t]=function(){a.isAnimating[t]=!1,h.stop(),p()},this.currentAnimationTarget[t]=e;var m=l||u.getDefaultTransition()||Fa;return Hi("x"===t?"layoutX":"layoutY",h,1e3,m&&Ui(m,"layout")).then(this.stopAxisAnimation[t])}},e.prototype.safeToRemove=function(){var t,e;null===(e=(t=this.props).safeToRemove)||void 0===e||e.call(t)},e.prototype.render=function(){return null},e}(W.Component);function ka(t,e){return!(Pa(t)||Pa(e)||Ba(t.x,e.x)&&Ba(t.y,e.y))}var Da={min:0,max:0};function Pa(t){return Ba(t.x,Da)&&Ba(t.y,Da)}function Ba(t,e){return t.min===e.min&&t.max===e.max}var Fa={duration:.45,ease:[.4,0,.1,1]};function Ra(t,e,n){return t||!t&&!(e||n)}var Ia={layoutReady:function(t){return t.notifyLayoutReady()}};function Wa(){var t=new Set;return{add:function(e){return t.add(e)},flush:function(e){var n=void 0===e?Ia:e,o=n.layoutReady,i=n.parent;ha((function(e,n){var r=Array.from(t).sort(Hr),a=i?Qr(i):[];n((function(){Object(xt.e)(Object(xt.e)([],Object(xt.c)(a)),Object(xt.c)(r)).forEach((function(t){return t.resetTransform()}))})),e((function(){r.forEach(Yr)})),n((function(){a.forEach((function(t){return t.restoreTransform()})),r.forEach(o)})),e((function(){r.forEach((function(t){t.isPresent&&(t.presence=ba.Present)}))})),n((function(){ri.preRender(),ri.render()})),e((function(){ui.postRender((function(){return r.forEach(Ma)})),t.clear()}))})),fa()}}}function Ma(t){t.prevViewportBox=t.projection.target}var ja=Object(W.createContext)(Wa()),za=Object(W.createContext)(Wa());function Na(t){return!!t.forceUpdate}var Va=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(xt.b)(e,t),e.prototype.componentDidMount=function(){var t=this.props,e=t.syncLayout,n=t.framerSyncLayout,o=t.visualElement;Na(e)&&e.register(o),Na(n)&&n.register(o),o.onUnmount((function(){Na(e)&&e.remove(o),Na(n)&&n.remove(o)}))},e.prototype.getSnapshotBeforeUpdate=function(){var t=this.props,e=t.syncLayout,n=t.visualElement;return Na(e)?e.syncUpdate():(!function(t){t.shouldResetTransform()||(t.prevViewportBox=t.measureViewportBox(!1),t.rebaseProjectionTarget(!1,t.prevViewportBox))}(n),e.add(n)),null},e.prototype.componentDidUpdate=function(){var t=this.props.syncLayout;Na(t)||t.flush()},e.prototype.render=function(){return null},e}(W.default.Component);var Ua={measureLayout:function(t){var e=Object(W.useContext)(ja),n=Object(W.useContext)(za);return W.default.createElement(Va,Object(xt.a)({},t,{syncLayout:e,framerSyncLayout:n}))},layoutAnimation:function(t){var e=Object(xt.c)(Ft(),2)[1];return W.createElement(Ta,Object(xt.a)({},t,{safeToRemove:e}))}};function Ha(){return{isHydrated:!1,layout:{x:{min:0,max:1},y:{min:0,max:1}},layoutCorrected:{x:{min:0,max:1},y:{min:0,max:1}},treeScale:{x:1,y:1},delta:Tr(),deltaFinal:Tr(),deltaTransform:""}}var Ga=Ha();function Qa(t,e,n){var o=t.x,i=t.y,r="translate3d("+o.translate/e.x+"px, "+i.translate/e.y+"px, 0) ";if(n){var a=n.rotate,s=n.rotateX,l=n.rotateY;a&&(r+="rotate("+a+") "),s&&(r+="rotateX("+s+") "),l&&(r+="rotateY("+l+") ")}return r+="scale("+o.scale+", "+i.scale+")",n||r!==Za?r:""}function Ya(t){var e=t.deltaFinal;return 100*e.x.origin+"% "+100*e.y.origin+"% 0"}var Za=Qa(Ga.delta,Ga.treeScale,{x:1,y:1}),qa=["LayoutMeasure","BeforeLayoutMeasure","LayoutUpdate","ViewportBoxUpdate","Update","Render","AnimationComplete","LayoutAnimationComplete","AnimationStart","SetAxisTarget","Unmount"];function Xa(t,e,n,o){var i,r,a=t.delta,s=t.layout,l=t.layoutCorrected,c=t.treeScale,u=e.target;r=s,Kr((i=l).x,r.x),Kr(i.y,r.y),function(t,e,n){var o=n.length;if(o){var i,r;e.x=e.y=1;for(var a=0;a<o;a++)r=(i=n[a]).getLayoutState().delta,e.x*=r.x.scale,e.y*=r.y.scale,na(t,r),$r(i)&&aa(t,t,i.getLatestValues())}}(l,c,n),Nr(a,l,u,o)}var $a=function(){function t(){this.children=[],this.isDirty=!1}return t.prototype.add=function(t){Gi(this.children,t),this.isDirty=!0},t.prototype.remove=function(t){Qi(this.children,t),this.isDirty=!0},t.prototype.forEach=function(t){this.isDirty&&this.children.sort(Hr),this.isDirty=!1,this.children.forEach(t)},t}();var Ka=function(t){var e=t.treeType,n=void 0===e?"":e,o=t.build,i=t.getBaseTarget,r=t.makeTargetAnimatable,a=t.measureViewportBox,s=t.render,l=t.readValueFromInstance,c=t.resetTransform,u=t.restoreTransform,d=t.removeValueFromRenderState,h=t.sortNodePosition,f=t.scrapeMotionValuesFromProps;return function(t,e){var p=t.parent,m=t.props,g=t.presenceId,v=t.blockInitialAnimation,A=t.visualState;void 0===e&&(e={});var b,y,C,S,w,x,E=A.latestValues,L=A.renderState,_=function(){var t=qa.map((function(){return new Yi})),e={},n={clearAllListeners:function(){return t.forEach((function(t){return t.clear()}))},updatePropListeners:function(t){return qa.forEach((function(o){var i;null===(i=e[o])||void 0===i||i.call(e);var r="on"+o,a=t[r];a&&(e[o]=n[r](a))}))}};return t.forEach((function(t,e){n["on"+qa[e]]=function(e){return t.add(e)},n["notify"+qa[e]]=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.notify.apply(t,Object(xt.e)([],Object(xt.c)(e)))}})),n}(),O={isEnabled:!1,isHydrated:!1,isTargetLocked:!1,target:{x:{min:0,max:1},y:{min:0,max:1}},targetFinal:{x:{min:0,max:1},y:{min:0,max:1}}},T=O,k=E,D=Ha(),P=!1,B=new Map,F=new Map,R={},I=Object(xt.a)({},E);function W(){b&&(Q.isProjectionReady()&&(aa(T.targetFinal,T.target,k),Nr(D.deltaFinal,D.layoutCorrected,T.targetFinal,E)),M(),s(b,L))}function M(){var t=E;if(S&&S.isActive()){var n=S.getCrossfadeState(Q);n&&(t=n)}o(Q,L,t,T,D,e,m)}function j(){_.notifyUpdate(E)}function z(){Q.layoutTree.forEach(ts)}var N=f(m);for(var V in N){var U=N[V];void 0!==E[V]&&de(U)&&U.set(E[V],!1)}var H=Zt(m),G=qt(m),Q=Object(xt.a)(Object(xt.a)({treeType:n,current:null,depth:p?p.depth+1:0,parent:p,children:new Set,path:p?Object(xt.e)(Object(xt.e)([],Object(xt.c)(p.path)),[p]):[],layoutTree:p?p.layoutTree:new $a,presenceId:g,projection:O,variantChildren:G?new Set:void 0,isVisible:void 0,manuallyAnimateOnMount:Boolean(null==p?void 0:p.isMounted()),blockInitialAnimation:v,isMounted:function(){return Boolean(b)},mount:function(t){b=Q.current=t,Q.pointTo(Q),G&&p&&!H&&(x=null==p?void 0:p.addVariantChild(Q)),null==p||p.children.add(Q)},unmount:function(){ii.update(j),ii.render(W),ii.preRender(Q.updateLayoutProjection),F.forEach((function(t){return t()})),Q.stopLayoutAnimation(),Q.layoutTree.remove(Q),null==x||x(),null==p||p.children.delete(Q),null==C||C(),_.clearAllListeners()},addVariantChild:function(t){var e,n=Q.getClosestVariantNode();if(n)return null===(e=n.variantChildren)||void 0===e||e.add(t),function(){return n.variantChildren.delete(t)}},sortNodePosition:function(t){return h&&n===t.treeType?h(Q.getInstance(),t.getInstance()):0},getClosestVariantNode:function(){return G?Q:null==p?void 0:p.getClosestVariantNode()},scheduleUpdateLayoutProjection:p?p.scheduleUpdateLayoutProjection:function(){return ui.preRender(Q.updateTreeLayoutProjection,!1,!0)},getLayoutId:function(){return m.layoutId},getInstance:function(){return b},getStaticValue:function(t){return E[t]},setStaticValue:function(t,e){return E[t]=e},getLatestValues:function(){return E},setVisibility:function(t){Q.isVisible!==t&&(Q.isVisible=t,Q.scheduleRender())},makeTargetAnimatable:function(t,e){return void 0===e&&(e=!0),r(Q,t,m,e)},addValue:function(t,e){Q.hasValue(t)&&Q.removeValue(t),B.set(t,e),E[t]=e.get(),function(t,e){var n=e.onChange((function(e){E[t]=e,m.onUpdate&&ui.update(j,!1,!0)})),o=e.onRenderRequest(Q.scheduleRender);F.set(t,(function(){n(),o()}))}(t,e)},removeValue:function(t){var e;B.delete(t),null===(e=F.get(t))||void 0===e||e(),F.delete(t),delete E[t],d(t,L)},hasValue:function(t){return B.has(t)},getValue:function(t,e){var n=B.get(t);return void 0===n&&void 0!==e&&(n=qi(e),Q.addValue(t,n)),n},forEachValue:function(t){return B.forEach(t)},readValue:function(t){var n;return null!==(n=E[t])&&void 0!==n?n:l(b,t,e)},setBaseTarget:function(t,e){I[t]=e},getBaseTarget:function(t){if(i){var e=i(m,t);if(void 0!==e&&!de(e))return e}return I[t]}},_),{build:function(){return M(),L},scheduleRender:function(){ui.render(W,!1,!0)},syncRender:W,setProps:function(t){m=t,_.updatePropListeners(t),R=function(t,e,n){var o;for(var i in e){var r=e[i],a=n[i];if(de(r))t.addValue(i,r);else if(de(a))t.addValue(i,qi(r));else if(a!==r)if(t.hasValue(i)){var s=t.getValue(i);!s.hasAnimated&&s.set(r)}else t.addValue(i,qi(null!==(o=t.getStaticValue(i))&&void 0!==o?o:r))}for(var i in n)void 0===e[i]&&t.removeValue(i);return e}(Q,f(m),R)},getProps:function(){return m},getVariant:function(t){var e;return null===(e=m.variants)||void 0===e?void 0:e[t]},getDefaultTransition:function(){return m.transition},getVariantContext:function(t){if(void 0===t&&(t=!1),t)return null==p?void 0:p.getVariantContext();if(!H){var e=(null==p?void 0:p.getVariantContext())||{};return void 0!==m.initial&&(e.initial=m.initial),e}for(var n={},o=0;o<os;o++){var i=ns[o],r=m[i];(Gt(r)||!1===r)&&(n[i]=r)}return n},enableLayoutProjection:function(){O.isEnabled=!0,Q.layoutTree.add(Q)},lockProjectionTarget:function(){O.isTargetLocked=!0},unlockProjectionTarget:function(){Q.stopLayoutAnimation(),O.isTargetLocked=!1},getLayoutState:function(){return D},setCrossfader:function(t){S=t},isProjectionReady:function(){return O.isEnabled&&O.isHydrated&&D.isHydrated},startLayoutAnimation:function(t,e,n){void 0===n&&(n=!1);var o=Q.getProjectionAnimationProgress()[t],i=n?O.relativeTarget[t]:O.target[t],r=i.min,a=i.max-r;return o.clearListeners(),o.set(r),o.set(r),o.onChange((function(e){Q.setProjectionTargetAxis(t,e,e+a,n)})),Q.animateMotionValue(t,o,0,e)},stopLayoutAnimation:function(){kr((function(t){return Q.getProjectionAnimationProgress()[t].stop()}))},measureViewportBox:function(t){void 0===t&&(t=!0);var n=a(b,e);return t||ca(n,E),n},getProjectionAnimationProgress:function(){return w||(w={x:qi(0),y:qi(0)}),w},setProjectionTargetAxis:function(t,e,n,o){var i;void 0===o&&(o=!1),o?(O.relativeTarget||(O.relativeTarget={x:{min:0,max:1},y:{min:0,max:1}}),i=O.relativeTarget[t]):(O.relativeTarget=void 0,i=O.target[t]),O.isHydrated=!0,i.min=e,i.max=n,P=!0,_.notifySetAxisTarget()},rebaseProjectionTarget:function(t,e){void 0===e&&(e=D.layout);var n=Q.getProjectionAnimationProgress(),o=n.x,i=n.y,r=!(O.relativeTarget||O.isTargetLocked||o.isAnimating()||i.isAnimating());(t||r)&&kr((function(t){var n=e[t],o=n.min,i=n.max;Q.setProjectionTargetAxis(t,o,i)}))},notifyLayoutReady:function(t){!function(t){var e=t.getProjectionParent();if(e){var n=qr(e.getLayoutState().layout,t.getLayoutState().layout);kr((function(e){t.setProjectionTargetAxis(e,n[e].min,n[e].max,!0)}))}else t.rebaseProjectionTarget()}(Q),Q.notifyLayoutUpdate(D.layout,Q.prevViewportBox||D.layout,t)},resetTransform:function(){return c(Q,b,m)},restoreTransform:function(){return u(b,L)},updateLayoutProjection:function(){if(Q.isProjectionReady()){var t=D.delta,e=D.treeScale,n=e.x,o=e.y,i=D.deltaTransform;Xa(D,T,Q.path,E),P&&Q.notifyViewportBoxUpdate(T.target,t),P=!1;var r=Qa(t,e);r===i&&n===e.x&&o===e.y||Q.scheduleRender(),D.deltaTransform=r}},updateTreeLayoutProjection:function(){Q.layoutTree.forEach(Ja),ui.preRender(z,!1,!0)},getProjectionParent:function(){if(void 0===y){for(var t=!1,e=Q.path.length-1;e>=0;e--){var n=Q.path[e];if(n.projection.isEnabled){t=n;break}}y=t}return y},resolveRelativeTargetBox:function(){var t=Q.getProjectionParent();if(O.relativeTarget&&t&&(function(t,e){Ur(t.target.x,t.relativeTarget.x,e.target.x),Ur(t.target.y,t.relativeTarget.y,e.target.y)}(O,t.projection),$r(t))){var e=O.target;aa(e,e,t.getLatestValues())}},shouldResetTransform:function(){return Boolean(m._layoutResetTransform)},pointTo:function(t){T=t.projection,k=t.getLatestValues(),null==C||C(),C=Wn(t.onSetAxisTarget(Q.scheduleUpdateLayoutProjection),t.onLayoutAnimationComplete((function(){var t;Q.isPresent?Q.presence=ba.Present:null===(t=Q.layoutSafeToRemove)||void 0===t||t.call(Q)})))},isPresent:!0,presence:ba.Entering});return Q}};function Ja(t){t.resolveRelativeTargetBox()}function ts(t){t.updateLayoutProjection()}var es,ns=Object(xt.e)(["initial"],Object(xt.c)(lr)),os=ns.length,is=new Set(["width","height","top","left","right","bottom","x","y"]),rs=function(t){return is.has(t)},as=function(t,e){t.set(e,!1),t.set(e)},ss=function(t){return t===Oe||t===xe};!function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"}(es||(es={}));var ls=function(t,e){return parseFloat(t.split(", ")[e])},cs=function(t,e){return function(n,o){var i=o.transform;if("none"===i||!i)return 0;var r=i.match(/^matrix3d\((.+)\)$/);if(r)return ls(r[1],e);var a=i.match(/^matrix\((.+)\)$/);return a?ls(a[1],t):0}},us=new Set(["x","y","z"]),ds=ie.filter((function(t){return!us.has(t)}));var hs={width:function(t){var e=t.x;return e.max-e.min},height:function(t){var e=t.y;return e.max-e.min},top:function(t,e){var n=e.top;return parseFloat(n)},left:function(t,e){var n=e.left;return parseFloat(n)},bottom:function(t,e){var n=t.y,o=e.top;return parseFloat(o)+(n.max-n.min)},right:function(t,e){var n=t.x,o=e.left;return parseFloat(o)+(n.max-n.min)},x:cs(4,13),y:cs(5,14)},fs=function(t,e,n,o){void 0===n&&(n={}),void 0===o&&(o={}),e=Object(xt.a)({},e),o=Object(xt.a)({},o);var i=Object.keys(e).filter(rs),r=[],a=!1,s=[];if(i.forEach((function(i){var l=t.getValue(i);if(t.hasValue(i)){var c,u=n[i],d=e[i],h=Ki(u);if(rn(d))for(var f=d.length,p=null===d[0]?1:0;p<f;p++)c?Ki(d[p]):(c=Ki(d[p]))===h||ss(h)&&ss(c);else c=Ki(d);if(h!==c)if(ss(h)&&ss(c)){var m=l.get();"string"==typeof m&&l.set(parseFloat(m)),"string"==typeof d?e[i]=parseFloat(d):Array.isArray(d)&&c===xe&&(e[i]=d.map(parseFloat))}else(null==h?void 0:h.transform)&&(null==c?void 0:c.transform)&&(0===u||0===d)?0===u?l.set(c.transform(u)):e[i]=h.transform(d):(a||(r=function(t){var e=[];return ds.forEach((function(n){var o=t.getValue(n);void 0!==o&&(e.push([n,o.get()]),o.set(n.startsWith("scale")?1:0))})),e.length&&t.syncRender(),e}(t),a=!0),s.push(i),o[i]=void 0!==o[i]?o[i]:e[i],as(l,d))}})),s.length){var l=function(t,e,n){var o=e.measureViewportBox(),i=e.getInstance(),r=getComputedStyle(i),a=r.display,s={top:r.top,left:r.left,bottom:r.bottom,right:r.right,transform:r.transform};"none"===a&&e.setStaticValue("display",t.display||"block"),e.syncRender();var l=e.measureViewportBox();return n.forEach((function(n){var i=e.getValue(n);as(i,hs[n](o,s)),t[n]=hs[n](l,r)})),t}(e,t,s);return r.length&&r.forEach((function(e){var n=Object(xt.c)(e,2),o=n[0],i=n[1];t.getValue(o).set(i)})),t.syncRender(),{target:l,transitionEnd:o}}return{target:e,transitionEnd:o}};function ps(t,e,n,o){return function(t){return Object.keys(t).some(rs)}(e)?fs(t,e,n,o):{target:e,transitionEnd:o}}var ms=function(t,e,n,o){var i=function(t,e,n){var o,i=Object(xt.d)(e,[]),r=t.getInstance();if(!(r instanceof HTMLElement))return{target:i,transitionEnd:n};for(var a in n&&(n=Object(xt.a)({},n)),t.forEachValue((function(t){var e=t.get();if(Sa(e)){var n=xa(e,r);n&&t.set(n)}})),i){var s=i[a];if(Sa(s)){var l=xa(s,r);l&&(i[a]=l,n&&(null!==(o=n[a])&&void 0!==o||(n[a]=s)))}}return{target:i,transitionEnd:n}}(t,e,o);return ps(t,e=i.target,n,o=i.transitionEnd)};var gs={treeType:"dom",readValueFromInstance:function(t,e){if(se(e)){var n=Ii(e);return n&&n.default||0}var o,i=(o=t,window.getComputedStyle(o));return(fe(e)?i.getPropertyValue(e):i[e])||0},sortNodePosition:function(t,e){return 2&t.compareDocumentPosition(e)?1:-1},getBaseTarget:function(t,e){var n;return null===(n=t.style)||void 0===n?void 0:n[e]},measureViewportBox:function(t,e){return Ir(t,e.transformPagePoint)},resetTransform:function(t,e,n){var o=n.transformTemplate;e.style.transform=o?o({},""):"none",t.scheduleRender()},restoreTransform:function(t,e){t.style.transform=e.style.transform},removeValueFromRenderState:function(t,e){var n=e.vars,o=e.style;delete n[t],delete o[t]},makeTargetAnimatable:function(t,e,n,o){var i=n.transformValues;void 0===o&&(o=!0);var r=e.transition,a=e.transitionEnd,s=Object(xt.d)(e,["transition","transitionEnd"]),l=function(t,e,n){var o,i,r={};for(var a in t)r[a]=null!==(o=or(a,e))&&void 0!==o?o:null===(i=n.getValue(a))||void 0===i?void 0:i.get();return r}(s,r||{},t);if(i&&(a&&(a=i(a)),s&&(s=i(s)),l&&(l=i(l))),o){!function(t,e,n){var o,i,r,a,s=Object.keys(e).filter((function(e){return!t.hasValue(e)})),l=s.length;if(l)for(var c=0;c<l;c++){var u=s[c],d=e[u],h=null;Array.isArray(d)&&(h=d[0]),null===h&&(h=null!==(i=null!==(o=n[u])&&void 0!==o?o:t.readValue(u))&&void 0!==i?i:e[u]),null!=h&&("string"==typeof h&&/^\-?\d*\.?\d+$/.test(h)?h=parseFloat(h):!tr(h)&&Ao.test(d)&&(h=Wi(u,d)),t.addValue(u,qi(h)),null!==(r=(a=n)[u])&&void 0!==r||(a[u]=h),t.setBaseTarget(u,h))}}(t,s,l);var c=ms(t,s,l,a);a=c.transitionEnd,s=c.target}return Object(xt.a)({transition:r,transitionEnd:a},s)},scrapeMotionValuesFromProps:en,build:function(t,e,n,o,i,r,a){void 0!==t.isVisible&&(e.style.visibility=t.isVisible?"visible":"hidden");var s=o.isEnabled&&i.isHydrated;Be(e,n,o,i,r,a.transformTemplate,s?Qa:void 0,s?Ya:void 0)},render:Ke},vs=Ka(gs),As=Ka(Object(xt.a)(Object(xt.a)({},gs),{getBaseTarget:function(t,e){return t[e]},readValueFromInstance:function(t,e){var n;return se(e)?(null===(n=Ii(e))||void 0===n?void 0:n.default)||0:(e=Je.has(e)?e:$e(e),t.getAttribute(e))},scrapeMotionValuesFromProps:nn,build:function(t,e,n,o,i,r,a){var s=o.isEnabled&&i.isHydrated;Qe(e,n,o,i,r,a.transformTemplate,s?Qa:void 0,s?Ya:void 0)},render:tn})),bs=function(t,e){return ee(t)?As(e,{enableHardwareAcceleration:!1}):vs(e,{enableHardwareAcceleration:!0})},ys=Object(xt.a)(Object(xt.a)(Object(xt.a)(Object(xt.a)({},pr),jn),Ca),Ua),Cs=Jt((function(t,e){return fn(t,e,ys,bs)}));class Ss{constructor(t){this.highlighted=!1,this.code=t,this.points=[]}}var ws=n(6);class xs{static now(){return Date.now()}}function Es(t){var e=Bt((function(){return qi(t)}));if(Object(W.useContext)(kt).isStatic){var n=Object(xt.c)(Object(W.useState)(t),2)[1];Object(W.useEffect)((function(){return e.onChange(n)}),[])}return e}var Ls=function(t){return function(t){return"object"==typeof t&&t.mix}(t)?t.mix:void 0};function _s(t,e){var n=Es(e()),o=function(){return n.set(e())};return o(),function(t,e){Object(W.useEffect)((function(){var n=t.map((function(t){return t.onChange(e)}));return function(){return n.forEach((function(t){return t()}))}}))}(t,(function(){return ui.update(o,!1,!0)})),n}function Os(t,e,n,o){var i="function"==typeof e?e:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=!Array.isArray(t[0]),o=n?0:-1,i=t[0+o],r=t[1+o],a=t[2+o],s=t[3+o],l=_o(r,a,Object(xt.a)({mixer:Ls(a[0])},s));return n?l(i):l}(e,n,o);return Array.isArray(t)?Ts(t,i):Ts([t],(function(t){var e=Object(xt.c)(t,1)[0];return i(e)}))}function Ts(t,e){var n=Bt((function(){return[]}));return _s(t,(function(){n.length=0;for(var o=t.length,i=0;i<o;i++)n[i]=t[i].get();return e(n)}))}function ks(t,e,n){void 0===n&&(n={});var o=de(t)?t:qi(t);return Hi("",o,e,n),{stop:function(){return o.stop()}}}var Ds=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(n[o[i]]=t[o[i]])}return n};class Ps extends W.default.Component{constructor(t){super(t),this.state={element:t.element}}update(t){this.setState({element:t})}style(t){this.customStyle=t,this.forceUpdate()}render(){var t,e,n,o,i,r,a,s,l;const c=this.state.element,u=this.props.configuration.style;!c.highlighted&&this.props.configuration.automaticSelectionEnabled&&this.props.onClick(c);const d=null!==(e=null===(t=this.customStyle)||void 0===t?void 0:t.fillColor)&&void 0!==e?e:c.highlighted?u.highlightedPolygonFillColor:u.polygonFillColor,h=null!==(o=null===(n=this.customStyle)||void 0===n?void 0:n.strokeColor)&&void 0!==o?o:c.highlighted?u.highlightedPolygonStrokeColor:u.polygonStrokeColor,f=null!==(r=null===(i=this.customStyle)||void 0===i?void 0:i.strokeWidth)&&void 0!==r?r:c.highlighted?u.highlightedPolygonStrokeWidth:u.polygonStrokeWidth,p=null!==(s=null===(a=this.customStyle)||void 0===a?void 0:a.cornerRadius)&&void 0!==s?s:c.highlighted?u.highlightedPolygonCornerRadius:u.polygonCornerRadius,m=null!==(l=this.props.animateToPoints)&&void 0!==l?l:c.points;return W.default.createElement(Bs,{points:m,onClick:()=>{this.props.onClick&&this.props.onClick(c)},fill:d,stroke:h,strokeWidth:f,cornerRadius:p})}}function Bs(t){var{points:e,cornerRadius:n}=t,o=Ds(t,["points","cornerRadius"]);const i=[e[0].x,e[0].y,e[1].x,e[1].y,e[2].x,e[2].y,e[3].x,e[3].y],r=i.map(Es),a=Os(r,(([t,e,o,i,r,a,s,l])=>{const c=[{x:t,y:e},{x:o,y:i},{x:r,y:a},{x:s,y:l}];return ws.a.toSvgPathStringWithRoundedCorners(c,n)}));return Object(W.useEffect)((()=>{const t=[];for(let e=0;e<i.length;e++)t.push(ks(r[e],i[e]));return()=>{t.forEach((t=>t.stop()))}}),[e]),W.default.createElement(Cs.path,Object.assign({d:a},o))}class Fs extends W.default.Component{constructor(t){super(t),this.state={polygonElements:[]}}update(t,e,n,o){const i=[];(class{static keepOnlyCenterMostDuplicate(t,e){const n=new Map;t.forEach((t=>{const e=At(t),o=n.get(e);o?o.push(t):n.set(e,[t])})),n.forEach(((e,o)=>{e.length<2?n.delete(o):e.forEach(((e,n)=>{t.splice(t.indexOf(e),1)}))})),n.forEach(((n,o)=>{const i=t=>{let e={x:0,y:0};return t.forEach((t=>{e.x+=t.x,e.y+=t.y})),e.x/=t.length,e.y/=t.length,e},r=e.width/2,a=n.reduce(((t,e)=>{const n=i(t.quad),o=i(e.quad);return Math.abs(r-n.x)<Math.abs(r-o.x)?t:e}));t.push(a)}))}}).keepOnlyCenterMostDuplicate(o,n),o.forEach((o=>{const r=new Ss(o);r.points=void 0===t?ws.a.scaleListToHtmlElement(o.quad,n,e.video):o.quad.map((e=>{const o=new ws.a(e.x,e.y);return o.x*=t.width/n.width,o.y*=t.height/n.height,o.y+=t.y,o.x+=t.x,o})),r.points.forEach((t=>{e.state.mirrored&&this.container&&(t.x=this.container.clientWidth-t.x)})),i.push(r)}));const r=[];this.state.polygonElements.forEach((t=>{const e=i.find((e=>vt(e.code,t.element.code)));let n=!1;void 0===e?t.updatedAt+1e3<xs.now()&&(n=!0):(t.element=e,t.polygon=W.default.createElement(Ps,{key:At(t.element.code),ref:e=>t.polygonRef=e,configuration:this.props.configuration,element:t.element,animateToPoints:e.points,onClick:this.onPolygonClick.bind(this)}),t.label=W.default.createElement(this.props.LabelComponent,Object.assign({},this.props.labelComponentConfig,{key:At(t.element.code),ref:e=>t.labelRef=e,configuration:this.props.configuration,element:t.element,animateToPoints:e.points,onClick:this.onPolygonClick.bind(this)})),t.updatedAt=xs.now()),n||r.push(t)})),i.forEach((t=>{if(void 0===this.state.polygonElements.find((e=>vt(e.element.code,t.code)))){let e,n;const o=W.default.createElement(Ps,{key:At(t.code),ref:o=>{e=o,void 0!==n&&this.props.onBarcodeFound(t.code,e,n)},configuration:this.props.configuration,element:t,onClick:this.onPolygonClick.bind(this)}),i=W.default.createElement(this.props.LabelComponent,Object.assign({},this.props.labelComponentConfig,{key:At(t.code),ref:o=>{n=o,void 0!==e&&this.props.onBarcodeFound(t.code,e,n)},configuration:this.props.configuration,element:t,onClick:this.onPolygonClick.bind(this)})),a={element:t,polygon:o,label:i,polygonRef:e,labelRef:n,updatedAt:xs.now()};r.push(a)}})),this.setState({polygonElements:r})}onPolygonClick(t){var e,n,o,i;t.highlighted=!t.highlighted,this.forceUpdate(),this.state.polygonElements.forEach((e=>{var n;const o=e.labelRef,i=e.label.props.element;o&&vt(i.code,t.code)&&(o.update(t),null===(n=e.polygonRef)||void 0===n||n.update(t))})),t.highlighted&&(null===(n=(e=this.props).onPolygonSelected)||void 0===n||n.call(e,t.code)),null===(i=(o=this.props).onPolygonClick)||void 0===i||i.call(o,t.code)}render(){var t,e;return W.default.createElement("div",{style:Object.assign({width:"100%",height:"100%",position:"absolute"},this.props.style),ref:t=>this.container=t},W.default.createElement(Cs.svg,{style:{position:"absolute",maxWidth:"100%",width:"100%",height:"100%"}},null===(t=this.state.polygonElements)||void 0===t?void 0:t.map((t=>t.polygon))),null===(e=this.state.polygonElements)||void 0===e?void 0:e.map((t=>t.label)))}}var Rs=n(37),Is=n.n(Rs),Ws=n(40),Ms={insert:"head",singleton:!1},js=(Is()(Ws.a,Ms),Ws.a.locals,n(27)),zs=n.n(js);class Ns{constructor(t){this.lastTime=0,this.lastDuration=0,this.t=0,this.element=null,this.animationClass="",this.animationClass=t}setDuration(t){const e=Date.now()/1e3,n=e-this.lastTime;this.lastDuration&&(this.t+=n%this.lastDuration/this.lastDuration,this.t-=0|this.t);const o=-t*this.t;this.element&&(this.element.style.animationDuration=`${t}s`,this.element.style.animationDelay=`${o}s`,this.element.classList.remove(this.animationClass),this.element.offsetHeight,this.element.classList.add(this.animationClass)),this.lastTime=e,this.lastDuration=t}}class Vs extends W.default.Component{constructor(){super(...arguments),this.inner1=new Ns("scanbot-shutter-rotate"),this.inner2=new Ns("scanbot-shutter-rotate")}render(){return W.default.createElement("div",{className:"scanbot-shutter-button",style:this.props.style,onClick:this.props.onClick},this.captureBackground(),this.captureInnerCircle(),this.captureSearchingInner1(),this.captureSearchingInner2())}updateAnimationSpeed(t){"searching"==t?(this.inner1.setDuration(3),this.inner2.setDuration(2)):(this.inner1.setDuration(1.5),this.inner2.setDuration(.75))}componentDidMount(){this.updateAnimationSpeed(this.props.action)}componentDidUpdate(){this.updateAnimationSpeed(this.props.action)}captureBackground(){return this.svgBase(null,W.default.createElement("g",{fill:"none",fillRule:"evenodd",stroke:"none",strokeWidth:"1"},this.path("M32 0c17.673 0 32 14.327 32 32 0 17.673-14.327 32-32 32C14.327 64 0 49.673 0 32 0 14.327 14.327 0 32 0zm0 3C15.984 3 3 15.984 3 32s12.984 29 29 29 29-12.984 29-29S48.016 3 32 3z")))}captureInnerCircle(){const{action:t}=this.props;return this.svgBase({"scanbot-shutter-button-part":!0,"scanbot-shutter-fade-in":"processing"==t||"manual"==t,"scanbot-shutter-fade-out":"searching"==t||"capturing"==t,"scanbot-shutter-pulse-fast":"processing"==t},W.default.createElement("g",{fill:"none",fillRule:"evenodd",stroke:"none",strokeWidth:"1"},W.default.createElement("circle",{cx:"32",cy:"32",r:"24",fill:this.props.color,fillRule:"nonzero"})))}captureSearchingInner1(){const{action:t}=this.props;return this.svgBase({"scanbot-shutter-button-part":!0,"scanbot-shutter-fade-in":"searching"==t||"capturing"==t,"scanbot-shutter-fade-out":"processing"==t||"manual"==t},W.default.createElement("g",{fill:"none",fillOpacity:"0.7",fillRule:"evenodd",stroke:"none",strokeWidth:"1"},this.path("M44.24 51.476a1 1 0 01-1.066-1.692A20.981 20.981 0 0053 32c0-11.598-9.402-21-21-21a1 1 0 010-2c12.703 0 23 10.297 23 23a22.98 22.98 0 01-10.76 19.476z")),(t=>{this.inner1.element=t}))}captureSearchingInner2(){const{action:t}=this.props;return this.svgBase({"scanbot-shutter-button-part":!0,"scanbot-shutter-fade-in":"searching"==t||"capturing"==t,"scanbot-shutter-fade-out":"processing"==t||"manual"==t},W.default.createElement("g",{fill:"none",fillOpacity:"0.4",fillRule:"evenodd",stroke:"none",strokeWidth:"1"},this.path("M46.624 35.35a1 1 0 01-1.95-.445C44.89 33.96 45 32.988 45 32c0-7.18-5.82-13-13-13a1 1 0 010-2c8.284 0 15 6.716 15 15 0 1.138-.127 2.26-.376 3.35z")),(t=>{this.inner2.element=t}))}path(t){return W.default.createElement("path",{fill:this.props.color,fillRule:"nonzero",d:t})}svgBase(t,e,n){return W.default.createElement("div",{className:zs()(t),ref:n},W.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"64",height:"64",viewBox:"0 0 64 64"},e))}}class Us extends W.default.Component{render(){return W.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},W.default.createElement("mask",{id:"mask0_919_23088",style:"mask-type:alpha",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},W.default.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),W.default.createElement("g",{mask:"url(#mask0_919_23088)"},W.default.createElement("path",{d:"M9 19V17H21V19H9ZM9 13V11H21V13H9ZM9 7V5H21V7H9ZM5 20C4.45 20 3.97917 19.8042 3.5875 19.4125C3.19583 19.0208 3 18.55 3 18C3 17.45 3.19583 16.9792 3.5875 16.5875C3.97917 16.1958 4.45 16 5 16C5.55 16 6.02083 16.1958 6.4125 16.5875C6.80417 16.9792 7 17.45 7 18C7 18.55 6.80417 19.0208 6.4125 19.4125C6.02083 19.8042 5.55 20 5 20ZM5 14C4.45 14 3.97917 13.8042 3.5875 13.4125C3.19583 13.0208 3 12.55 3 12C3 11.45 3.19583 10.9792 3.5875 10.5875C3.97917 10.1958 4.45 10 5 10C5.55 10 6.02083 10.1958 6.4125 10.5875C6.80417 10.9792 7 11.45 7 12C7 12.55 6.80417 13.0208 6.4125 13.4125C6.02083 13.8042 5.55 14 5 14ZM5 8C4.45 8 3.97917 7.80417 3.5875 7.4125C3.19583 7.02083 3 6.55 3 6C3 5.45 3.19583 4.97917 3.5875 4.5875C3.97917 4.19583 4.45 4 5 4C5.55 4 6.02083 4.19583 6.4125 4.5875C6.80417 4.97917 7 5.45 7 6C7 6.55 6.80417 7.02083 6.4125 7.4125C6.02083 7.80417 5.55 8 5 8Z",fill:"white"})))}}class Hs extends W.default.Component{render(){return W.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},W.default.createElement("mask",{id:"mask0_919_23102",style:"mask-type:alpha",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},W.default.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),W.default.createElement("g",{mask:"url(#mask0_919_23102)"},W.default.createElement("path",{d:"M12 22C10.75 22 9.57917 21.7625 8.4875 21.2875C7.39583 20.8125 6.44583 20.1708 5.6375 19.3625C4.82917 18.5542 4.1875 17.6042 3.7125 16.5125C3.2375 15.4208 3 14.25 3 13H5C5 14.95 5.67917 16.6042 7.0375 17.9625C8.39583 19.3208 10.05 20 12 20C13.95 20 15.6042 19.3208 16.9625 17.9625C18.3208 16.6042 19 14.95 19 13C19 11.05 18.3208 9.39583 16.9625 8.0375C15.6042 6.67917 13.95 6 12 6H11.85L13.4 7.55L12 9L8 5L12 1L13.4 2.45L11.85 4H12C13.25 4 14.4208 4.2375 15.5125 4.7125C16.6042 5.1875 17.5542 5.82917 18.3625 6.6375C19.1708 7.44583 19.8125 8.39583 20.2875 9.4875C20.7625 10.5792 21 11.75 21 13C21 14.25 20.7625 15.4208 20.2875 16.5125C19.8125 17.6042 19.1708 18.5542 18.3625 19.3625C17.5542 20.1708 16.6042 20.8125 15.5125 21.2875C14.4208 21.7625 13.25 22 12 22Z",fill:"white"})))}}class Gs extends W.default.Component{constructor(t){super(t),this.state={barcodes:void 0}}update(t){this.setState({barcodes:t})}didScan(){return void 0!==this.state.barcodes}render(){var t,e;return W.default.createElement("div",{style:{position:"absolute",bottom:0,width:"100%",height:76,display:"flex",alignItems:"center",backgroundColor:St.ScanbotPrimary}},W.default.createElement("div",{style:{display:"flex",flex:1,justifyContent:"center",alignItems:"center",opacity:this.didScan()?1:.5},onClick:this.didScan()&&this.props.onBurgerClick},W.default.createElement(Us,null),W.default.createElement("div",{style:{backgroundColor:St.Orange,color:St.White,width:24,height:24,borderRadius:12,marginLeft:10,fontSize:13,lineHeight:"24px",textAlign:"center"}},null!==(e=null===(t=this.state.barcodes)||void 0===t?void 0:t.length)&&void 0!==e?e:0)),W.default.createElement("div",{style:{display:"flex",flex:1,justifyContent:"center",opacity:this.props.isShowingImage?.5:1}},W.default.createElement(Vs,{style:{left:0,bottom:0,transform:"none"},color:"#FFF",action:this.props.action,onClick:!this.props.isShowingImage&&this.props.onShutterButtonClick})),W.default.createElement("div",{style:{display:"flex",flex:1,justifyContent:"center",alignItems:"center",opacity:this.didScan()?1:.5},onClick:this.didScan()&&this.props.onScanMoreClick},W.default.createElement("div",{style:{fontSize:13,color:St.White,marginRight:10}},"Scan More"),W.default.createElement(Hs,null)))}}class Qs extends W.default.Component{render(){const t=ws.a.centerOf(this.props.points),e=ws.a.smallerSizeOfQuad(this.props.points)/40;return W.default.createElement("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{position:"absolute",left:t.x-20,top:t.y-20,transform:`scale(${e})`}},W.default.createElement("mask",{id:"mask0_910_20901",style:"mask-type:alpha",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"40",height:"40"},W.default.createElement("rect",{width:"40",height:"40",fill:"#D9D9D9"})),W.default.createElement("g",{mask:"url(#mask0_910_20901)"},W.default.createElement("rect",{x:"7",y:"13",width:"26",height:"16",fill:"white"}),W.default.createElement("path",{d:"M17.5833 27.6111L29.3611 15.8333L27.3055 13.8055L17.5833 23.5278L12.6666 18.6111L10.6389 20.6389L17.5833 27.6111ZM20 36.6666C17.713 36.6666 15.5555 36.2291 13.5278 35.3541C11.5 34.4791 9.73147 33.287 8.22219 31.7778C6.71294 30.2685 5.52081 28.5 4.64581 26.4722C3.77081 24.4444 3.33331 22.287 3.33331 20C3.33331 17.6944 3.77081 15.5278 4.64581 13.5C5.52081 11.4722 6.71294 9.70831 8.22219 8.20831C9.73147 6.70831 11.5 5.52081 13.5278 4.64581C15.5555 3.77081 17.713 3.33331 20 3.33331C22.3055 3.33331 24.4722 3.77081 26.5 4.64581C28.5278 5.52081 30.2916 6.70831 31.7916 8.20831C33.2916 9.70831 34.4791 11.4722 35.3541 13.5C36.2291 15.5278 36.6666 17.6944 36.6666 20C36.6666 22.287 36.2291 24.4444 35.3541 26.4722C34.4791 28.5 33.2916 30.2685 31.7916 31.7778C30.2916 33.287 28.5278 34.4791 26.5 35.3541C24.4722 36.2291 22.3055 36.6666 20 36.6666Z",fill:"#55BB77"})))}}var Ys=n(10);class Zs extends W.default.Component{constructor(t){super(t),this.state={elements:[],imageSize:Ys.a.empty()}}update(t){const e=[];t.barcodes.forEach((n=>{const o=new Ss(n);o.points=ws.a.scaleListToHtmlElement(n.quad,t.originalImageSize,this.image),e.push(o)})),this.setState({imageSize:Ys.a.fromHtmlElement(this.image),elements:e})}reset(){this.setState({elements:[]})}render(){return void 0===this.props.image||null===this.props.image?null:W.default.createElement("div",{className:"scanned-image-with-overlay",style:{position:"absolute",display:"flex",justifyContent:"center",alignItems:this.state.image?"normal":"center",minHeight:"300px",height:"100%",width:"100%",top:0,left:0}},W.default.createElement("img",{style:{maxWidth:"100%"},ref:t=>this.image=t,src:`${this.props.image}`}),W.default.createElement("div",{style:{position:"absolute",maxWidth:"100%",width:this.state.imageSize.width,height:this.state.imageSize.height}},this.state.elements.map(((t,e)=>W.default.createElement(Qs,{key:e,points:t.points})))))}}class qs extends W.default.Component{render(){if(!this.props.visible)return null;const t=mt.a.svg`
32
32
  animation: rotate 2s linear infinite;
33
33
  @keyframes rotate { 100% { transform: rotate(360deg); } }
34
- `;return B.default.createElement("div",{style:{top:0,left:0,width:"100%",height:"100%",position:"absolute",display:"flex",justifyContent:"center",alignItems:"center",zIndex:100}},B.default.createElement(t,{width:"101",height:"100",viewBox:"0 0 101 100",fill:"none",xmlns:"http://www.w3.org/2000/svg"},B.default.createElement("circle",{cx:"50.5",cy:"50",r:"50",fill:"#3E3E3E","fill-opacity":"0.35"}),B.default.createElement("path",{d:"M90.5153 49.6094C91.715 49.6094 92.6933 50.5827 92.6321 51.7808C92.1218 61.7815 88.0988 71.3096 81.2342 78.6635C73.8743 86.548 63.7963 91.3454 53.036 92.0868C42.2757 92.8282 31.6351 89.4582 23.2634 82.6576C15.455 76.3147 10.1633 67.4283 8.28624 57.5922C8.06135 56.4138 8.89694 55.3155 10.0853 55.1509C11.2737 54.9864 12.3642 55.8183 12.5959 56.9954C14.3176 65.7412 19.0487 73.6367 26.0026 79.2856C33.5201 85.3922 43.0751 88.4183 52.7374 87.7526C62.3998 87.0869 71.4494 82.7789 78.0584 75.699C84.1719 69.1497 87.7754 60.68 88.2814 51.7807C88.3495 50.5829 89.3156 49.6094 90.5153 49.6094Z",fill:"white"}),B.default.createElement("path",{d:"M40.7013 23.4514C40.2751 22.2667 40.8885 20.9518 42.1022 20.6166C45.5928 19.6526 49.2351 19.3251 52.8537 19.6567C57.2305 20.0577 61.4662 21.4131 65.2628 23.6273C69.0594 25.8416 72.3246 28.861 74.8286 32.4731C77.3326 36.0851 79.0146 40.2021 79.7562 44.5341C80.4978 48.8662 80.281 53.3082 79.121 57.5475C77.9611 61.7868 75.8862 65.7204 73.0423 69.0714C70.1985 72.4225 66.6548 75.1095 62.6606 76.9436C59.3583 78.4599 55.8145 79.3627 52.202 79.6146C50.9459 79.7022 49.9301 78.6662 49.9379 77.4072C49.9457 76.1481 50.9746 75.1443 52.2293 75.0398C55.1749 74.7942 58.0613 74.0382 60.758 72.8C64.1467 71.244 67.1532 68.9642 69.5659 66.1212C71.9787 63.2781 73.7391 59.9408 74.7232 56.3442C75.7073 52.7475 75.8912 48.9789 75.262 45.3035C74.6328 41.6281 73.2058 38.1353 71.0814 35.0708C68.957 32.0062 66.1867 29.4445 62.9657 27.5659C59.7446 25.6873 56.151 24.5374 52.4377 24.1972C49.4828 23.9265 46.5092 24.1737 43.6497 24.9219C42.4316 25.2406 41.1274 24.6362 40.7013 23.4514Z",fill:"white"}),B.default.createElement("path",{d:"M39.9232 61.6554C39.1643 62.5529 37.8105 62.673 37.0094 61.813C35.7171 60.4259 34.6502 58.8388 33.8523 57.1092C32.7564 54.7336 32.1944 52.1468 32.206 49.5307C32.2175 46.9146 32.8022 44.3328 33.9189 41.967C35.0356 39.6011 36.6573 37.5088 38.6697 35.8372C40.6822 34.1656 43.0365 32.9554 45.567 32.2916C48.0975 31.6279 50.7428 31.5268 53.3166 31.9954C55.8904 32.464 58.3303 33.4911 60.4644 35.0042C62.0183 36.1059 63.3827 37.4458 64.5093 38.9707C65.2077 39.916 64.8412 41.2247 63.8197 41.8061C62.7982 42.3875 61.5108 42.0174 60.7778 41.0986C59.9824 40.1015 59.0489 39.2181 58.0027 38.4763C56.3759 37.3229 54.5161 36.5401 52.5541 36.1828C50.5922 35.8256 48.5758 35.9027 46.6469 36.4086C44.7179 36.9146 42.9233 37.8371 41.3893 39.1113C39.8553 40.3855 38.6192 41.9804 37.7679 43.7838C36.9167 45.5872 36.471 47.5552 36.4622 49.5494C36.4534 51.5436 36.8818 53.5154 37.7172 55.3262C38.2544 56.4908 38.9515 57.5705 39.7858 58.5353C40.5545 59.4244 40.6821 60.7579 39.9232 61.6554Z",fill:"white"})))}}class Ks extends B.default.Component{render(){return this.props.text?B.default.createElement("div",{style:{position:"absolute",top:this.props.top,bottom:this.props.bottom,display:"flex",width:"100%",justifyContent:"center"}},B.default.createElement("div",{style:{padding:"5px 10px",borderRadius:5,backgroundColor:xt.TransparentGray,color:xt.White,fontWeight:500,fontSize:13}},this.props.text)):null}}class Js extends B.default.Component{constructor(t){super(t),this.state={element:t.element}}style(t){this.customStyle=t,this.forceUpdate()}update(t){this.setState({element:t})}formatText(t,e){if("None"!==e)return"Text"===e?t.text:t.format+" ("+t.text+")"}render(){var t,e,n,i,o;const r=this.state.element,a=this.props.configuration.style,s=this.formatText(r.code,this.props.configuration.textFormat),l=Es.a.width(null!==(t=this.props.animateToPoints)&&void 0!==t?t:r.points);if(!s)return null;if(!r.points)return null;const c=null!==(n=null===(e=this.customStyle)||void 0===e?void 0:e.backgroundColor)&&void 0!==n?n:r.highlighted?a.highlightedTextBackgroundColor:a.textBackgroundColor,u=null!==(o=null===(i=this.customStyle)||void 0===i?void 0:i.textColor)&&void 0!==o?o:r.highlighted?a.highlightedTextColor:a.textColor;return B.default.createElement(ws.div,{ref:t=>this.label=t,onClick:()=>{this.props.onClick&&this.props.onClick(r)},style:{x:Es.a.lowestX(r.points),y:Es.a.highestY(r.points)+3,backgroundColor:c,fontSize:12,width:l,overflow:"hidden",color:u,borderRadius:5,position:"absolute",padding:"3px 7px",textAlign:"center",maxHeight:50,lineBreak:"anywhere",lineHeight:"22px",WebkitLineClamp:2,display:"-webkit-box",WebkitBoxOrient:"vertical"},animate:this.props.animateToPoints?{x:Es.a.lowestX(this.props.animateToPoints),y:Es.a.highestY(this.props.animateToPoints)+30}:{}},s)}}class tl{constructor(){this.defaultFillColor="rgba(255, 0, 0, 0.3)",this.defaultHighlightedFillColor="rgba(0, 255, 0, 0.3)",this.polygonStrokeColor="rgba(255, 0, 0, 1)",this.polygonFillColor=this.defaultFillColor,this.polygonStrokeWidth=1,this.polygonCornerRadius=0,this.highlightedPolygonStrokeColor="rgba(0, 255, 0, 1)",this.highlightedPolygonFillColor=this.defaultHighlightedFillColor,this.highlightedPolygonStrokeWidth=2,this.highlightedPolygonCornerRadius=0,this.textColor="white",this.textBackgroundColor="rgba(255, 0, 0, 0.9)",this.highlightedTextColor="white",this.highlightedTextBackgroundColor="rgba(0, 255, 0, 0.9)"}}class el{constructor(){this.visible=!1,this.textFormat="Text",this.automaticSelectionEnabled=!1,this.style=new tl}}class nl{constructor(){this.topLabelTop=20,this.sheetHeight="95%",this.sheetTopMargin="10%"}}class il{constructor(){this.enabled=!1,this.style=new nl}}class ol extends _.a{constructor(){super(L.a.DEFAULT_VIDEO_RESOLUTION_HD),this.captureDelay=1e3,this.overlay=new el,this.detectionParameters=new O.BarcodeScannerTypes.BarcodeRecognizerParameters,this.scanAndCount=new il,this.onBarcodesDetected=function(t){}}static fromJson(t){const e=new ol;return this.mapValues(t,e,["style","videoConstraints","overlay","scanAndCount","finder","userGuidance"]),this.mapFinderConfiguration(e,t),t.overlay&&(this.mapValues(t.overlay,e.overlay,["style"]),t.overlay.style&&this.mapValues(t.overlay.style,e.overlay.style)),t.scanAndCount&&(this.mapValues(t.scanAndCount,e.scanAndCount,["style"]),t.scanAndCount.style&&this.mapValues(t.scanAndCount.style,e.scanAndCount.style)),this.mapVideoConstraints(t,e),e}}class rl{static warn(t){console.warn("[ScanbotSDK]",t)}}class al{static convertLinesToViewportLines(t,e){if(e&&t)return e.map((e=>({start:new Es.a(e.start.x*t.width,e.start.y*t.height),end:new Es.a(e.end.x*t.width,e.end.y*t.height)})))}static convertToViewportPointsFromParentSize(t,e){return e?qs.a.isEmpty(t)?void 0:e.map((e=>Es.a.scaleUpTo(e,t))):qs.a.toPolygon(t)}static calculateScale(t){let e,n=0,i=0;return 1>t.width/t.height?(e=t.height/1,n=(1-t.width/e)/2):(e=t.width/1,i=(1-t.height/e)/2),{x:n,y:i,containerScale:e}}static findScale(t,e){let n,i=0,o=0;return e.ratio(!0)>t.ratio(!0)?(n=t.width/e.width,o=(e.height-t.height/n)/2):(n=t.height/e.height,i=(e.width-t.width/n)/2),{x:i,y:o,scale:n}}static preventDefaultCallback(t){t.preventDefault()}static disableScreenMovement(){document.addEventListener("touchmove",al.preventDefaultCallback,{passive:!1}),document.body.scrollTop=document.documentElement.scrollTop=0,document.documentElement.style.overflow="hidden"}static enableScreenMovement(){document.removeEventListener("touchmove",al.preventDefaultCallback),document.documentElement.style.overflow="auto"}static findContainerOrThrow(t){var e;const n=null!==(e=t.container)&&void 0!==e?e:document.getElementById(t.containerId);if(!n)throw Error("Unable to initialize scanner: Cannot find container element either from 'container' property or with the containerId property provided.");return n}}var sl=function(t,e,n,i){return new(n||(n=Promise))((function(o,r){function a(t){try{l(i.next(t))}catch(t){r(t)}}function s(t){try{l(i.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((i=i.apply(t,e||[])).next())}))};gt.a;gt.b;class ll extends gt.c{constructor(t){var e;super(t),this.shouldComputeSize=!0,this.paused=!1,this.barcodeRecognizerHandle=null,this.barcodes=[],this.detectionRunning=!1,this.updateDimensionsCallback=this.updateDimensions.bind(this),this.backendurl=void 0,this.desiredRecognitionResolution=void 0,this.desiredRecognitionResolution=this.configuration.desiredRecognitionResolution,Object.assign(this.state,{isFinderVisible:null===(e=this.configuration.finder.visible)||void 0===e||e,zoom:void 0,action:"manual",image:void 0,bottomHintText:void 0})}get configuration(){return this._configuration||(this._configuration=ol.fromJson(this.props.configuration)),this._configuration}get enabled(){return!this.disposed}static create(t){return sl(this,void 0,void 0,(function*(){const e=al.findContainerOrThrow(t);return new Promise(((n,i)=>{Object(B.render)(B.default.createElement(ll,{container:e,configuration:t,onSuccess:n,onFailure:i}),e)}))}))}isDetectionPaused(){return this.paused}resumeDetection(){return sl(this,void 0,void 0,(function*(){rl.warn("Barcode detection resumed"),yield this.resume()}))}pauseDetection(){rl.warn("Barcode detection paused"),this.pause()}componentDidMount(){const t=Object.create(null,{componentDidMount:{get:()=>super.componentDidMount}});return sl(this,void 0,void 0,(function*(){t.componentDidMount.call(this),window.addEventListener("resize",this.updateDimensionsCallback),yield this.resume()}))}componentWillUnmount(){super.componentWillUnmount(),this.pause(),window.removeEventListener("resize",this.updateDimensionsCallback),this.barcodeRecognizerHandle&&this.bridge.copyArgs.releaseObject(this.barcodeRecognizerHandle)}updateDimensions(){return sl(this,void 0,void 0,(function*(){this.shouldComputeSize=!0,this.forceUpdate()}))}resume(){return sl(this,void 0,void 0,(function*(){this.paused=!1,yield this.detect()}))}pause(){this.paused=!0}detect(){var t,e,n,i,o;return sl(this,void 0,void 0,(function*(){if(!this.enabled)return;if(this.paused)return;if(null===(t=this.configuration.scanAndCount)||void 0===t?void 0:t.enabled)return;if(this.detectionRunning)return;let r=!1;try{this.detectionRunning=!0;const t=yield this.recognizeBarcodes(!0,this.shouldComputeSize);if(this.shouldComputeSize=!1,!t)return;const a=t;a.isEmpty()?this.configuration._onDetectionFailed&&(null===(e=this.configuration)||void 0===e||e._onDetectionFailed(null==a?void 0:a.originalImageSize)):(r=!0,this.configuration.overlay.visible||this.configuration.onBarcodesDetected(a)),null===(n=this.overlay)||void 0===n||n.update(null===(i=this.finder)||void 0===i?void 0:i.holeRect,this.camera,t.originalImageSize,t.barcodes)}catch(t){console.log(t)}finally{this.detectionRunning=!1;const t=()=>requestAnimationFrame(this.detect.bind(this)),e=(null===(o=this.configuration.overlay)||void 0===o?void 0:o.visible)?0:this.configuration.captureDelay;r&&0!=e?setTimeout(t,e):t()}}))}setUseBackendService(t){console.log("Now using backend service for recognition: ",t),this.backendurl=t}recognizeBarcodes(t,e){var n,i,o,r,a,s;return sl(this,void 0,void 0,(function*(){window&&window.__SB_DEBUG_BARCODESCANNER_FORCE_DETERMINISTIC_MODE&&(t=!1);const l=t?gt.c.DEFAULT_DETECTION_RESOLUTION:gt.c.DETECTION_RESULTION_4K,c=null!==(n=this.desiredRecognitionResolution)&&void 0!==n?n:l;this.camera.finderFrame=null===(i=this.finder)||void 0===i?void 0:i.holeRect;const u=yield null===(o=this.camera)||void 0===o?void 0:o.createImageData(c);if(!u)return;e&&this.forceUpdate(),(null===(r=this.configuration.scanAndCount)||void 0===r?void 0:r.enabled)&&(this.setState({image:v.wrapperToBase64(u)}),void 0!==this.desiredRecognitionResolution?console.log("Recognizing barcodes with custom resolution:",this.desiredRecognitionResolution):console.log("Recognizing barcodes with max resolution:",gt.c.DETECTION_RESULTION_4K,"(the actual resolution depends on your device and may be lower)"));const d=new qs.a(u.width,u.height);this.barcodeRecognizerHandle||(this.barcodeRecognizerHandle=yield this.bridge.copyArgs.createBarcodeRecognizer(new O.BarcodeScannerTypes.BarcodeRecognizerParameters(Object.assign(Object.assign({},this.configuration.detectionParameters),{live:t}))));const h=yield this.bridge.copyArgs.recognizeBarcodes(this.barcodeRecognizerHandle,u);if(this.enabled){if(null!==h)return new b(h.barcodes,d);null===(s=(a=this.props).onLicenseError)||void 0===s||s.call(a)}}))}setRecognitionResolution(t){this.desiredRecognitionResolution=t}getResolution(){return sl(this,void 0,void 0,(function*(){return new Promise(((t,e)=>{const n=this.camera.videoSize();n.width>0&&n.height>0?t(qs.a.fromJson(n)):this.camera.didLoadVideo=()=>{const e=this.camera.videoSize();t(qs.a.fromJson(e))}}))}))}saveExtractedImageData(){this.camera.saveExtractedData()}setFinderVisible(t){this.setState({isFinderVisible:t})}setZoom(t){this.setState({zoom:t})}setCameraDirection(t){this.camera.setDirection(t)}updateTorch(t){this.camera.videoStream.updateTorch(t)}getCapabilities(){return this.camera.videoStream.getCapabilities()}render(){var t,e,n,i,o,r,a;const s=(null===(t=this.configuration.scanAndCount)||void 0===t?void 0:t.enabled)?"Tap the shutter button to scan":void 0;return B.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",backgroundColor:"black",minHeight:"100px"}},this.renderSpinner(null===(e=this.configuration)||void 0===e?void 0:e.spinnerColor),B.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%"}},B.default.createElement(vt.a,{configuration:this.configuration,videoConstraints:this.configuration.videoConstraints,mirrored:this.configuration.mirrored,preferredCamera:this.configuration.preferredCamera,zoom:null!==(n=this.state.zoom)&&void 0!==n?n:this.configuration.zoom,onReady:this.onVideoReady,onError:this.onVideoError,ref:t=>{this.camera=t}})),B.default.createElement(Ks,{top:null===(i=this.configuration.scanAndCount)||void 0===i?void 0:i.style.topLabelTop,text:s}),B.default.createElement(Xs,{ref:t=>this.scannedImage=t,image:this.state.image}),this.state.isFinderVisible&&B.default.createElement(At.a,{ref:t=>{this.finder=t},padding:this.props.viewFinderPadding,guidanceConfiguration:this.configuration.userGuidance,configuration:this.configuration.finder}),B.default.createElement(Ks,{bottom:100,text:this.state.bottomHintText}),B.default.createElement($s,{visible:"processing"===this.state.action}),(null===(o=this.configuration.overlay)||void 0===o?void 0:o.visible)&&B.default.createElement(Bs,{ref:t=>{t&&(this.overlay=t)},configuration:this.configuration.overlay,onPolygonSelected:t=>{const e=new b([t],void 0);this.configuration.onBarcodesDetected(e)},onBarcodeFound:(t,e,n)=>{var i;(null===(i=this.configuration.overlay)||void 0===i?void 0:i.onBarcodeFound)&&this.configuration.overlay.onBarcodeFound(t,e,n)},LabelComponent:Js,labelComponentConfig:{}}),(null===(r=this.configuration.scanAndCount)||void 0===r?void 0:r.enabled)&&B.default.createElement(Zs,{ref:t=>this.bottomActionBar=t,action:this.state.action,isShowingImage:void 0!==this.state.image,onBurgerClick:()=>{this.popup.push(wt.PushBottom,this.barcodes)},onShutterButtonClick:()=>sl(this,void 0,void 0,(function*(){(new A).flash(),this.setState({action:"processing"});const t=(new Date).getTime(),e=yield this.recognizeBarcodes(!1,!1);console.log("Recognition took:",((new Date).getTime()-t)/1e3);const n=this.countLabelText(e.barcodes);this.setState({action:"manual",bottomHintText:n}),this.scannedImage.update(e),this.barcodes.push(...e.barcodes),this.bottomActionBar.update(this.barcodes),e.barcodes.length>0&&this.configuration.onBarcodesDetected(e)})),onScanMoreClick:()=>{this.resetCountImage()}}),B.default.createElement(Et,{ref:t=>this.popup=t,style:null===(a=this.configuration.scanAndCount)||void 0===a?void 0:a.style,onDeleteClick:()=>{if(confirm("Are you sure you want to delete all scanned barcodes?")){for(;this.barcodes.length>0;)this.barcodes.pop();console.log("Cleared barcodes",this.barcodes.length),this.popup.update(this.barcodes),this.bottomActionBar.update(void 0),this.resetCountImage(),this.popup.reset()}}}))}resetCountImage(){this.scannedImage.reset(),this.setState({image:void 0,bottomHintText:void 0})}countLabelText(t){return 0==t.length?"No codes scanned. Try again?":1==t.length?"1 Code Scanned":`${t.length} Codes Scanned`}}function cl(t,e){return t&&(t.hasFacingOptions&&e.flipCameraButton.visible||t.isTorchAvailable&&e.flashButton.visible)||e.zoomButton.visible}function ul(t){const e=t.zoomSteps.findIndex((e=>e==t.defaultZoomFactor)),[n,i]=Object(B.useState)(t.torchEnabledInitially),[o,r]=Object(B.useState)(e),a=t.zoomSteps[o],[s,l]=Object(B.useState)("BACK"==t.initialCameraModule?"environment":"user"),c=function(t){var e,n;const i=null===(n=null===(e=null==t?void 0:t.camera)||void 0===e?void 0:e.video)||void 0===n?void 0:n.parentElement,o=()=>i?i.getBoundingClientRect():null,[r,a]=Object(B.useState)(o());return Object(B.useEffect)((()=>{if(i){const t=()=>a(o());t();const e=new ResizeObserver(t);return e.observe(i),()=>{e.disconnect()}}}),[i]),r}(t.scanner),u=!!c;if(Object(B.useEffect)((()=>{var e;(null===(e=t.capabilities)||void 0===e?void 0:e.isTorchAvailable)&&u&&t.scanner.setTorchState(n)}),[t.capabilities,u,n]),Object(B.useEffect)((()=>{var e;u&&(null===(e=t.scanner)||void 0===e||e.setZoom(a))}),[u,a]),!t.capabilities||!c)return null;if(!cl(t.capabilities,t.config))return null;const d=c.height-t.bottomPadding-48;return B.default.createElement(j.Box,{style:{position:"absolute",marginTop:d,marginLeft:c.width/2,transform:"translateX(-50%)",display:"flex",justifyContent:"center",zIndex:1e3}},B.default.createElement(ut,Object.assign({},t.config.flashButton,{visible:t.capabilities.isTorchAvailable&&t.config.flashButton.visible,icon:n?j.FlashlightOn:j.FlashlightOff,active:n,onClick:()=>i(!n)})),B.default.createElement("div",{style:{width:20}}),B.default.createElement(ut,Object.assign({},t.config.zoomButton,{text:`${a.toFixed(1)}x`,active:o!==e,onClick:()=>r((o+1)%t.zoomSteps.length)})),B.default.createElement("div",{style:{width:20}}),B.default.createElement(ut,Object.assign({},t.config.flipCameraButton,{visible:t.capabilities.hasFacingOptions&&t.config.flipCameraButton.visible,active:"user"===s,icon:j.FlipCameraIos,onClick:()=>{var e;const n="environment"===s?"user":"environment";l(n),null===(e=t.scanner)||void 0===e||e.setCameraDirection(n)}})))}var dl=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(t);o<i.length;o++)e.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(t,i[o])&&(n[i[o]]=t[i[o]])}return n};class hl extends Js{constructor(){super(...arguments),this.count=0,this.setCount=t=>{this.count=t,this.forceUpdate()}}render(){var t;const{barcodeItemConfiguration:e,barcodeItemInfoPosition:n,counterBadge:i}=this.props,o=this.state.element,r=null!==(t=this.props.animateToPoints)&&void 0!==t?t:o.points,a=o.code,s=o.highlighted,l=10,c=(Es.a.lowestY(r)+Es.a.highestY(r))/2,u=(Es.a.lowestX(r)+Es.a.highestX(r))/2,d=(()=>{const t={badgeY:c,badgeStyle:{transform:"translateX(-50%) translateY(-50%)"}};return"BELOW"===n?Object.assign(Object.assign({},t),{labelY:Math.max(Es.a.highestY(r)+l,i?c-24-l:-1/0),labelStyle:{transform:"translateX(-50%)"}}):"ABOVE"===n?Object.assign(Object.assign({},t),{labelY:Math.min(Es.a.lowestY(r)-l,i.visible?c+24+l:1/0),labelStyle:{transform:"translateX(-50%) translateY(-100%)"}}):"STACKED"===n?{badgeY:c,badgeStyle:{transform:"translateX(-50%) translateY(calc(-100% - 5px))"},labelY:c,labelStyle:{transform:i.visible?"translateX(-50%) translateY(5px)":"translateX(-50%) translateY(-50%)"}}:"DISABLED"===n?Object.assign(Object.assign({},t),{labelY:0,labelStyle:{display:"none"}}):void 0})(),h=!1===e.titleDeselected.visible&&!1===e.subtitleDeselected.visible,p={x:u,y:Math.round(d.labelY)},f={x:u,y:Math.round(d.badgeY)},m={duration:.25,easing:"linear"};return B.default.createElement(B.default.Fragment,null,B.default.createElement(ws.div,{ref:t=>this.label=t,style:Object.assign(Object.assign({},p),{position:"absolute",width:"100%",zIndex:100}),animate:this.props.animateToPoints?p:{},transition:m},B.default.createElement(Z,{sx:Object.assign({p:1,maxWidth:232,cursor:"pointer",display:h?"inline-block":"block",zIndex:1500},d.labelStyle),styleConfig:s?e.backgroundSelected:e.backgroundDeselected,"data-sb-ar-barcode-info":"1",onClick:()=>{var t;return null===(t=this.props)||void 0===t?void 0:t.onClick(o)}},B.default.createElement(pl,{barcode:a,barcodeImageVisible:e.imageVisible,maxNumberOfTitleLines:1,maxNumberOfSubtitleLines:1,imageSize:42,displayRightArrow:!0,barcodeTitle:s?e.titleSelected:e.titleDeselected,barcodeSubtitle:s?e.subtitleSelected:e.subtitleDeselected}))),i.visible&&this.count>0&&B.default.createElement(ws.div,{style:Object.assign({position:"absolute",display:"flex",justifyContent:"center",alignItems:"center",zIndex:100},f),animate:this.props.animateToPoints?f:{},transition:m},B.default.createElement(Z,{styleConfig:Object.assign(Object.assign({},i.background),{cornerRadius:24+i.background.strokeWidth}),style:Object.assign(Object.assign({},d.badgeStyle),{width:48,height:48,color:N.b.getColorValue(i.foregroundColor),display:"flex",justifyContent:"center",alignItems:"center",zIndex:1500,cursor:"pointer"}),onClick:()=>{var t;return null===(t=this.props)||void 0===t?void 0:t.onClick(o)}},B.default.createElement(j.Typography,{fontSize:16,fontWeight:"500"},"x",this.count))))}}function pl(t){var{barcode:e}=t,n=dl(t,["barcode"]);const i=Object(B.useContext)(st).useBarcodeMappedData(e);return B.default.createElement(K,Object.assign({barcodeMappedData:i},n))}function fl(t){const e=Object(B.useRef)(),n=Object(B.useRef)(null),[i,o]=(Object(B.useContext)(q),Object(B.useState)(void 0)),[r,a]=Object(B.useState)(!1);Object(B.useEffect)((()=>{var n,i;t.scanningPaused?null===(n=e.current)||void 0===n||n.pause():null===(i=e.current)||void 0===i||i.resume()}),[t.scanningPaused]);const s=function(t){const e=new el;return e.visible=t.visible,t.polygon.visible?(e.style.highlightedPolygonFillColor=N.b.getColorValue(t.polygon.selected.fillColor),e.style.highlightedPolygonStrokeColor=N.b.getColorValue(t.polygon.selected.strokeColor),e.style.highlightedPolygonStrokeWidth=t.polygon.selected.strokeWidth,e.style.highlightedPolygonCornerRadius=t.polygon.selected.cornerRadius,e.style.polygonFillColor=N.b.getColorValue(t.polygon.deselected.fillColor),e.style.polygonStrokeColor=N.b.getColorValue(t.polygon.deselected.strokeColor),e.style.polygonStrokeWidth=t.polygon.deselected.strokeWidth,e.style.polygonCornerRadius=t.polygon.deselected.cornerRadius):(e.style.highlightedPolygonFillColor="transparent",e.style.highlightedPolygonStrokeColor="transparent",e.style.polygonFillColor="transparent",e.style.polygonStrokeColor="transparent"),e.automaticSelectionEnabled=!1,e}(t.arOverlay),l=Object.assign(Object.assign({},t.barcodeScannerViewConfig),{onBarcodesDetected:i=>{var o,r,a,s,l,c;null===(o=n.current)||void 0===o||o.update(null===(a=null===(r=e.current)||void 0===r?void 0:r.finder)||void 0===a?void 0:a.holeRect,null===(s=e.current)||void 0===s?void 0:s.camera,i.originalImageSize,i.barcodes),null===(c=(l=t.barcodeScannerViewConfig).onBarcodesDetected)||void 0===c||c.call(l,i)},_onDetectionFailed:i=>{var o,r,a,s,l,c;null===(o=n.current)||void 0===o||o.update(null===(a=null===(r=e.current)||void 0===r?void 0:r.finder)||void 0===a?void 0:a.holeRect,null===(s=e.current)||void 0===s?void 0:s.camera,new qs.a(i.width,i.height),[]),null===(c=(l=t.barcodeScannerViewConfig)._onDetectionFailed)||void 0===c||c.call(l,i)}});return Object(B.useEffect)((()=>{const e=cl(i,t.actionBarConfig);t.setActionButtonsVisible(e),a(e)}),[i,t.actionBarConfig]),B.default.createElement(B.default.Fragment,null,t.arOverlay.visible&&B.default.createElement(Bs,{style:{zIndex:1e3,position:"absolute"},ref:n,LabelComponent:hl,labelComponentConfig:t.arOverlay,onBarcodeFound:t.arOnBarcodeEnter,onPolygonClick:t.arOnBarcodeClick,configuration:s}),B.default.createElement(ul,{config:t.actionBarConfig,scanner:e.current,capabilities:i,bottomPadding:t.actionBarBottomPadding,torchEnabledInitially:t.cameraConfiguration.flashEnabled,zoomSteps:t.cameraConfiguration.zoomSteps,defaultZoomFactor:t.cameraConfiguration.defaultZoomFactor,initialCameraModule:t.cameraConfiguration.cameraModule}),B.default.createElement(ll,{ref:e,viewFinderPadding:t.viewFinderPadding,configuration:l,onSuccess:()=>class{static setFromScanner(t,e){var n;if(!t.current)return;const i=t.current.getCapabilities();e({hasFacingOptions:i.facingMode&&i.facingMode.length>0,isTorchAvailable:null!==(n=t.current.getActiveCameraInfo().supportsTorchControl)&&void 0!==n&&n})}}.setFromScanner(e,o),onFailure:t.onCameraPermissionDenied,onLicenseError:t.onLicenseError}))}function ml(t){return Object(B.useMemo)((()=>{const e=(new ol).videoConstraints;return e.width.ideal=t.cameraConfiguration.idealPreviewResolution.width,e.height.ideal=t.cameraConfiguration.idealPreviewResolution.height,e.facingMode="FRONT"===t.cameraConfiguration.cameraModule?"user":"environment",{videoConstraints:e,backgroundColor:N.b.getColorValue(t.backgroundColor),userGuidance:t.userGuidance,finder:t.viewFinder,detectionParameters:new O.BarcodeScannerTypes.BarcodeRecognizerParameters({live:!0,engineMode:t.recognizerConfiguration.engineMode,configurators:[new O.BarcodeConfigs.GroupCommonConfig({formats:t.recognizerConfiguration.barcodeFormats.length>0?t.recognizerConfiguration.barcodeFormats:void 0,regexFilter:t.recognizerConfiguration.barcodesRegexFilter,gs1Handling:t.recognizerConfiguration.gs1Handling})]}),desiredRecognitionResolution:t.recognizerConfiguration.maximumRecognizerResolution}}),[t])}var gl=function(t,e,n,i){return new(n||(n=Promise))((function(o,r){function a(t){try{l(i.next(t))}catch(t){r(t)}}function s(t){try{l(i.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((i=i.apply(t,e||[])).next())}))};function vl(t){const[e,n]=Object(B.useState)(null),[i,o]=Object(B.useState)(!0),r=Object(B.useMemo)((()=>"__sb_"+Math.random()),[]),a=Object(B.useContext)(st),s=t.configuration.useCase,l=Object.assign(Object.assign({},ml(t.configuration)),{onBarcodesDetected:e=>{e.barcodes.length>0&&!s.arOverlay.visible&&t.scanningEnabled.current&&n(e.barcodes[0])},onError:t.onError,containerId:r,captureDelay:0}),c=n=>gl(this,void 0,void 0,(function*(){let i;i=null===e?[]:[yield a.mapBarcodeToBarcodeItem(n,1)];const o={items:i};t.onSubmit(o)}));Object(B.useEffect)((()=>{e&&(pt.INSTANCE.beep(t.configuration.sound),mt.INSTANCE.vibrate(t.configuration.vibration))}),[e]),Object(B.useEffect)((()=>{null===e||s.confirmationSheetEnabled||c(e)}),[e,s.confirmationSheetEnabled]);const u=a.useBarcodeMappedData(e);Object(B.useEffect)((()=>{"FAILED"===(null==u?void 0:u.state)&&n(null)}),[null==u?void 0:u.state]);const d=Object(B.useContext)(q);return B.default.createElement(B.default.Fragment,null,B.default.createElement(nt,Object.assign({open:!!u&&["LOADED","LOADING"].includes(u.state)&&s.confirmationSheetEnabled,handleCancel:()=>{n(null)},handleSubmit:()=>{c(e)},barcodeMappedData:u},{sheetColorLoaded:(h=s).sheetColor,sheetColorLoading:h.barcodeInfoMapping.sheetColor,barcodeImageVisible:h.barcodeImageVisible,barcodeTitle:h.barcodeTitle,barcodeSubtitle:h.barcodeSubtitle,cancelButton:h.cancelButton,submitButton:h.submitButton,dividerColor:h.dividerColor,loadingMessage:h.barcodeInfoMapping.loadingMessage},{displayRightArrow:!1,modalOverlayColor:s.modalOverlayColor})),B.default.createElement(j.Box,{id:r,sx:{width:"100%",height:d.remainingVisibleBodyHeight}},B.default.createElement(fl,{cameraConfiguration:t.configuration.cameraConfiguration,scanningPaused:null!==e,setActionButtonsVisible:o,viewFinderPadding:{minTopPadding:d.minTopPaddingForViewFinder,minBottomPadding:i?80:0},barcodeScannerViewConfig:l,arOnBarcodeClick:t=>n(t),arOnBarcodeEnter:e=>{s.arOverlay.automaticSelectionEnabled&&t.scanningEnabled.current&&n(e)},arOverlay:Object.assign(Object.assign({},s.arOverlay),{counterBadge:Object.assign(Object.assign({},s.arOverlay.counterBadge),{visible:!1})}),containerId:r,actionBarConfig:t.configuration.actionBar,actionBarBottomPadding:16,onCameraPermissionDenied:t.onCameraPermissionDenied,onLicenseError:t.onError})));var h}function Al(t){const e=Object.assign(Object.assign({},t.title),{text:N.b.getLocalizedBarcodeText(t.title.text).replace("%d",t.numBarcodes.toString())});return B.default.createElement(B.default.Fragment,null,B.default.createElement(Y,Object.assign({},t.leftButton)),B.default.createElement(j.Typography,{sx:{flex:2,textAlign:"center",fontWeight:600,fontSize:18}},B.default.createElement(G.a,{config:e})),B.default.createElement(Y,Object.assign({},t.rightButton)))}function bl(){return B.default.createElement("div",{style:{width:30,height:6,backgroundColor:j.grey[300],borderRadius:3,position:"absolute",top:8,left:"calc(50% - 15px)"},"data-sb-drawer-puller":"1"})}function yl(t){return B.default.createElement(j.Box,Object.assign({sx:{display:"flex",width:"100%",alignItems:"center",justifyContent:"center",paddingTop:2,paddingBottom:1,touchAction:"none"},ref:t.innerRef},t.dragProps),B.default.createElement(bl,null),B.default.createElement(Al,Object.assign({},t.drawerHeaderContentProps)))}function Cl(t){return B.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"41",height:"38",viewBox:"0 0 41 38",fill:"none"},B.default.createElement("path",{d:"M4.09514 37.0902V10.6304L0.019043 1.87823L3.18969 0.348877L7.76144 10.6304H32.6886L37.2484 0.348877L40.419 1.87823L36.3549 10.6304V37.0902H4.09514ZM15.994 22.013H24.494C24.9461 22.013 25.3211 21.8632 25.619 21.5637C25.9169 21.2641 26.0658 20.8871 26.0658 20.4325C26.0658 19.9779 25.9169 19.6038 25.619 19.3101C25.3211 19.0164 24.9461 18.8695 24.494 18.8695H15.994C15.5419 18.8695 15.167 19.0193 14.8691 19.3189C14.5712 19.6184 14.4223 19.9955 14.4223 20.45C14.4223 20.9046 14.5712 21.2788 14.8691 21.5725C15.167 21.8662 15.5419 22.013 15.994 22.013ZM7.50164 33.6837H32.9364V14.0489H7.50164V33.6837Z",fill:t.color}))}function Sl(t){return 0!==t.numBarcodes?null:B.default.createElement("div",{style:{display:"flex",alignItems:"center",flexDirection:"column",marginTop:"auto",marginBottom:"auto",overflowY:"scroll"}},t.style.placeholderIcon.visible&&B.default.createElement(j.Avatar,{style:{backgroundColor:N.b.getColorValue(t.style.placeholderIconBackground),width:100,height:100}},B.default.createElement(Cl,{color:N.b.getColorValue(t.style.placeholderIcon.color)})),B.default.createElement(j.Typography,{style:{marginTop:20},variant:"h6"},B.default.createElement(G.a,{config:t.style.placeholderTitle})),B.default.createElement(j.Typography,{style:{marginTop:20,paddingLeft:"10%",paddingRight:"10%",maxWidth:400,textAlign:"center"},variant:"body2"},B.default.createElement(G.a,{config:t.style.placeholderSubtitle})),t.onStartClick&&t.style.startScanningButton.visible&&B.default.createElement(J,Object.assign({style:{width:"60%",marginTop:20}},t.style.startScanningButton,{visible:!0,onClick:t.onStartClick})))}function wl(t,e,n){const i=Object(B.useRef)(),o=Object(B.useRef)(null),[r,a]=Object(B.useState)(),[s,l]=Object(B.useState)(!1),c=Object(B.useRef)([]),u=t=>{let n="none";if(c.current.length>0){const e=200,i=((t,e)=>{let n=t[0],i=Math.abs(n.time-e);for(let o=1;o<t.length;o++){const r=Math.abs(t[o].time-e);r<i&&(n=t[o],i=r)}return n})(c.current,t.timeStamp-e),o=i.y-t.clientY,r=100;o>r?n="up":o<-r&&(n="down")}c.current.splice(0,c.current.length),e(new Es.a(t.clientX,t.clientY),n)},d={onPointerDown:t=>{t.target.setPointerCapture(t.pointerId),l(!0),o.current=new Es.a(t.clientX,t.clientY),a(Es.a.empty()),t.stopPropagation()},onPointerMove:e=>{if(!s)return;const n=new Es.a(e.clientX,e.clientY);i.current=e,a(n),t(n),c.current.push({x:e.clientX,y:e.clientY,time:e.timeStamp})},onPointerUp:t=>{t.target.releasePointerCapture(t.pointerId),l(!1),u(t)},onPointerCancel:t=>{t.target.releasePointerCapture(t.pointerId),l(!1),n()}};return{startPoint:o,currentPoint:r,props:d,stop:()=>{i.current.stopPropagation()},dragOngoing:s}}var xl=n(27);function El(t){const[e,n]=Object(B.useState)(0),[i,o]=Object(B.useState)(!1),r=Object(B.useRef)(null),a=Object(B.useContext)(q).height,s=t=>{n(t),o(!0),setTimeout((()=>{o(!1)}),500)},l=e=>{const n=e-c.startPoint.current.y;return Object(xl.a)((t.isOpen?100:0)-100*n/(window.innerHeight-a-t.closedSheetVisibleHeight),0,100)},c=wl((t=>{n(l(t.y))}),((e,n)=>{if(e.y===c.startPoint.current.y)return;let i;i=l(e.y)<50?"swipe-to-close":"swipe-to-open","up"===n&&(i="swipe-to-open"),"down"===n&&(i="swipe-to-close"),t.onSwipe(i)}),(()=>{}));return Object(B.useEffect)((()=>{i||c.dragOngoing||!r||(t.isOpen||0===e?t.isOpen&&100!==e&&s(100):s(0))}),[t.isOpen,e,c.dragOngoing]),B.createElement("div",null,B.createElement(z.a,{variant:"persistent",anchor:"bottom",open:!0,onClose:()=>{},onOpen:()=>{},swipeAreaWidth:56,disableSwipeToOpen:!1,ModalProps:{keepMounted:!0},PaperProps:{style:{height:`calc((100 * ${V} - ${a}px - ${t.closedSheetVisibleHeight}px) * ${e} / 100 + ${t.closedSheetVisibleHeight}px)`,overflow:"hidden",borderRadius:10,borderBottomLeftRadius:0,borderBottomRightRadius:0,transition:i?"height 500ms":void 0,backgroundColor:N.b.getColorValue(t.contentStyle.sheetColor)},elevation:24}},B.createElement(yl,{innerRef:t=>{r.current=t},drawerHeaderContentProps:t.drawerHeaderContentProps,dragProps:c.props}),t.children,B.createElement(Sl,{numBarcodes:t.numBarcodes,style:t.contentStyle,onStartClick:()=>t.onSwipe("swipe-to-close")})))}var Ll=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(t);o<i.length;o++)e.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(t,i[o])&&(n[i[o]]=t[i[o]])}return n};function _l(t){var{inputRef:e}=t,n=Ll(t,["inputRef"]);const i=Object.assign(Object.assign({},n),{style:Object.assign(Object.assign({},n.style||{}),{border:"none",display:"block",outlineWidth:0,width:"100%"})});return B.default.createElement("input",Object.assign({},i,{ref:e}))}function Ol(t){const e=!!t.barcode,[n,i]=B.default.useState(""),o=B.default.useRef(null),r={backgroundColor:N.b.getColorValue(t.dialogStyling.sheetColor)};return Object(B.useEffect)((()=>{e&&i(String(t.barcode.count))}),[e]),B.default.createElement(B.default.Fragment,null,B.default.createElement(et,{open:e,modalOverlayColor:t.dialogStyling.modalOverlayColor,TransitionProps:{onEnter:()=>{var t;return null===(t=o.current)||void 0===t?void 0:t.focus()}},onClose:t.onCancel,PaperProps:{component:"form",onSubmit:e=>{e.preventDefault(),t.setCounter({type:"setCount",barcodes:[t.barcode.barcode],computeNewCount:()=>parseInt(n)||0})}}},B.default.createElement(j.DialogContent,{style:r},B.default.createElement(j.Typography,{fontSize:16,fontWeight:500,textAlign:"center"},B.default.createElement(G.a,{config:t.dialogStyling.title})),B.default.createElement(j.Typography,{fontSize:14,textAlign:"center"},B.default.createElement(G.a,{config:t.dialogStyling.info})),B.default.createElement(j.Box,{sx:{display:"flex",border:"2px solid",borderColor:N.b.getColorValue(t.dialogStyling.dividerColor),mh:2,mb:0,p:1,borderRadius:1}},B.default.createElement(_l,{inputRef:o,value:n,onChange:t=>{const e=parseInt(t.target.value.replaceAll(/[^0-9]/g,""));i(e>=0?e.toString():"")},type:"text",pattern:"[0-9]*"}),t.dialogStyling.clearTextButton.visible&&B.default.createElement(z.a,{sx:{marginLeft:"auto",paddingLeft:1},onClick:()=>i(""),htmlColor:N.b.getColorValue(t.dialogStyling.clearTextButton.color)}))),B.default.createElement(j.DialogActions,{sx:Object.assign(Object.assign({},r),{pt:0})},B.default.createElement(z.a,{container:!0,spacing:2},B.default.createElement(z.a,{item:!0,xs:12},B.default.createElement(z.a,{color:N.b.getColorValue(t.dialogStyling.dividerColor)})),B.default.createElement(z.a,{item:!0,xs:6},B.default.createElement(J,Object.assign({style:{width:"100%"},onClick:t.onCancel},t.dialogStyling.cancelButton))),B.default.createElement(z.a,{item:!0,xs:6},B.default.createElement(J,Object.assign({icon:j.Replay,style:{width:"100%"},onClick:()=>{},type:"submit"},t.dialogStyling.updateButton)))))))}function Tl(t){return B.default.createElement("div",{style:{top:0,width:"100%",marginTop:"1px",marginLeft:"1px",height:"calc(100% - 2px)",position:"absolute",backgroundColor:N.b.getColorValue(t.config.backgroundColor),display:"flex",alignItems:"right",justifyContent:"right"}},B.default.createElement(z.a,{style:{height:"100%",color:N.b.getColorValue(t.config.iconColor),paddingRight:t.visibleOffset/2,cursor:"pointer"}}))}const kl=0,Dl=800,Pl=1200;function Rl(t){switch(t){case"mobile":return Object(j.useMediaQuery)("(min-width:"+kl+"px) and (max-width:"+(Dl-1)+"px)");case"tablet":return Object(j.useMediaQuery)("(min-width:"+Dl+"px) and (max-width:"+(Pl-1)+"px)");case"desktop":return Object(j.useMediaQuery)("(min-width:"+Pl+"px)")}}const Il=150;function Fl(t){const[e,n]=Object(B.useState)(0),[i,o]=Object(B.useState)(!1);let r;const a=wl((t=>{let e=a.startPoint.current.x-t.x;e<0?a.stop():n(-e)}),(t=>{if(t.x===a.startPoint.current.x)return;const e=a.startPoint.current.x-t.x;c(e>75?Il:0)}),(()=>{c(0)})),s=Object(B.useContext)(st),l=s.useBarcodeMappedData(t.barcode);Object(B.useEffect)((()=>{const e={barcode:t.barcode,callback:()=>t.onDelete(t.barcode)};return s.addOnEvictionListener(e),()=>{s.removeOnEvictionListener(e)}}),[]);const c=e=>{const i=e>=Il,a=-r.getBoundingClientRect().width;n(i?a:0),o(!0),setTimeout((()=>{o(!1),i&&t.onDelete(t.barcode)}),200)},u=Rl("desktop")&&t.swipeToDeleteConfig.enabled,d=!u&&t.swipeToDeleteConfig.enabled;return Object(B.useEffect)((()=>{d||c(0)}),[d]),B.default.createElement(j.Box,{sx:{px:2},style:{width:"100%",paddingRight:0},ref:t=>r=t},B.default.createElement(Tl,{config:t.swipeToDeleteConfig,visibleOffset:Il}),B.default.createElement(j.Box,Object.assign({sx:{width:"100%",backgroundColor:N.b.getColorValue(t.sheetColor),transform:`translateX(${e}px)`,transition:i?"transform 200ms ease-in-out":void 0,touchAction:"pan-y",display:"flex",alignItems:"center",paddingTop:"16px",paddingBottom:"16px",columnGap:"16px"}},d?a.props:{}),B.default.createElement(K,Object.assign({barcodeMappedData:l},t)),null!==t.readonlyCount&&B.default.createElement(j.Box,{sx:{fontSize:18,marginTop:"auto",flex:1,textAlign:"right",color:N.b.getColorValue("?sbColorOnSurfaceVariant")}},"x",t.readonlyCount),u&&B.default.createElement(z.a,{sx:{height:"100%",marginLeft:"auto",cursor:"pointer",color:N.b.getColorValue("?sbColorOnSurface")},onClick:()=>t.onDelete(t.barcode)}),B.default.createElement(j.Box,{sx:{width:"0px"}})))}function Bl(t){const e=N.b.getColorValue(t.sheetContent.dividerColor),n=t.sheetContent.manualCountChangeEnabled&&"COUNTING"===t.mode;return B.default.createElement(B.default.Fragment,null,B.default.createElement(j.Divider,{style:{borderColor:e}}),t.barcodes.length>0&&B.default.createElement(z.a,{sx:{width:"auto",flex:1,overflowY:"auto",overflowX:"hidden"},role:"presentation"},B.default.createElement(z.a,{sx:{p:0}},t.barcodes.map((({barcode:i,count:o})=>B.default.createElement(z.a,{key:i.format+i.text,sx:{padding:0,borderBottom:`1px solid ${e}`}},B.default.createElement(Fl,{barcode:i,onDelete:()=>t.onBarcodeChange({type:"remove",barcode:i}),counterForm:n&&{counter:o,manualCountChangeColor:t.sheetContent.manualCountChangeColor,manualCountOutlineColor:t.sheetContent.manualCountOutlineColor,setCounter:e=>{t.onBarcodeChange({type:"setCount",barcodes:[i],computeNewCount:()=>e})},onNumberClick:()=>t.onNumberClick({barcode:i,count:o})},readonlyCount:"COUNTING"!==t.mode||t.sheetContent.manualCountChangeEnabled?null:o,maxNumberOfTitleLines:1,maxNumberOfSubtitleLines:1,displayRightArrow:!1,imageSize:n?84:40,barcodeImageVisible:t.sheetContent.barcodeItemImageVisible,barcodeTitle:t.sheetContent.barcodeItemTitle,barcodeSubtitle:t.sheetContent.barcodeItemSubtitle,swipeToDeleteConfig:t.sheetContent.swipeToDelete,sheetColor:t.sheetContent.sheetColor})))))))}function Wl(t){return B.default.createElement(j.Badge,{anchorOrigin:{vertical:"top",horizontal:"left"},badgeContent:t.count,showZero:!0,color:"primary",overlap:"circular",slotProps:{badge:{style:{backgroundColor:t.backgroundColor,color:t.foregroundColor,fontWeight:"bold"}}}},t.children)}function Ml(t){if(!t.buttonStyling.visible)return null;return B.default.createElement(j.Box,{style:t.style},B.default.createElement(Wl,{count:t.count,backgroundColor:N.b.getColorValue(t.buttonStyling.badgeBackgroundColor),foregroundColor:N.b.getColorValue(t.buttonStyling.badgeForegroundColor)},B.default.createElement(j.IconButton,{sx:{backgroundColor:N.b.getColorValue(t.buttonStyling.backgroundColor),width:60,height:60,"&:hover, &:focus":{backgroundColor:N.b.getColorValue(t.buttonStyling.activeBackgroundColor),outline:"none"}},onClick:t.onClick,disableRipple:!0,disableFocusRipple:!0},B.default.createElement(z.a,{sx:{color:N.b.getColorValue(t.buttonStyling.foregroundColor),fontSize:"24pt","&:hover, &:focus":{color:N.b.getColorValue(t.buttonStyling.activeForegroundColor)}}}))))}const jl=(t,e)=>t.format===e.format&&t.text===e.text;function zl(t,e){switch(e.type){case"setCount":{let n=[...t];for(const t of e.barcodes){const i=n.findIndex((e=>jl(e.barcode,t)));if(-1===i)n.push({barcode:t,count:e.computeNewCount(0)});else{const t=n[i];n[i]=Object.assign(Object.assign({},t),{count:e.computeNewCount(t.count)})}}return n}case"remove":return t.map((t=>Object.assign(Object.assign({},t),{count:jl(t.barcode,e.barcode)?0:t.count})));case"clear":return t.map((t=>Object.assign(Object.assign({},t),{count:0})));case"setHtmlElements":let n=!1;const i=t.map((t=>jl(t.barcode,e.barcode)?(n=!0,Object.assign(Object.assign({},t),{polygonElement:e.polygonElement,labelElement:e.labelElement})):t));return n||i.push({barcode:e.barcode,count:0,labelElement:e.labelElement,polygonElement:e.polygonElement}),i}}var Nl=function(t,e,n,i){return new(n||(n=Promise))((function(o,r){function a(t){try{l(i.next(t))}catch(t){r(t)}}function s(t){try{l(i.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((i=i.apply(t,e||[])).next())}))};function Vl(t){const e=Object(B.useRef)(),[n,i]=Object(B.useReducer)(zl,[]),[o,r]=Object(B.useState)(),a=Object(B.useRef)(new Date("2001-01-01")),[s,l]=B.default.useState(null),[c,u]=Object(B.useState)(!1),d=Object(B.useMemo)((()=>"__sb_"+Math.random()),[]),[h,p]=Object(B.useState)(!0),f=Object(B.useContext)(st),m=t.configuration.useCase,g=Object(B.useRef)(Object.assign(Object.assign({},ml(t.configuration)),{onBarcodesDetected:e=>{if(!((new Date).getTime()-a.current.getTime()<m.countingRepeatDelay)&&t.scanningEnabled.current)if(!m.arOverlay.visible||m.arOverlay.automaticSelectionEnabled){let n=!1;i({type:"setCount",barcodes:e.barcodes,computeNewCount:e=>{let i="COUNTING"===m.mode?e+1:1;return i===e||n||(a.current=new Date,pt.INSTANCE.beep(t.configuration.sound),mt.INSTANCE.vibrate(t.configuration.vibration)),i}})}else i({type:"setCount",barcodes:e.barcodes,computeNewCount:t=>t})},_onDetectionFailed(t){},onError:t.onError,captureDelay:1e3/60}));Object(B.useEffect)((()=>{g.current.container=e.current}),[e]),Object(B.useEffect)((()=>{for(const t of n){if(t.polygonElement){const e=t.count>0?m.arOverlay.polygon.selected:m.arOverlay.polygon.deselected;t.polygonElement.style({fill:m.arOverlay.polygon.visible?N.b.getColorValue(e.fillColor):"transparent",stroke:m.arOverlay.polygon.visible?N.b.getColorValue(e.strokeColor):"transparent",strokeWidth:e.strokeWidth,cornerRadius:e.cornerRadius})}t.labelElement&&(t.labelElement.update(Object.assign(Object.assign({},t.labelElement.state.element),{highlighted:t.count>0})),t.labelElement.setCount(t.count))}}),[n]);const v=n.reduce(((t,e)=>t+e.count),0),A=B.default.createElement(Bl,{barcodes:n.filter((t=>t.count>0)),onBarcodeChange:i,sheetContent:m.sheetContent,onNumberClick:t=>l(t),mode:m.mode}),b={numBarcodes:v,leftButton:Object.assign(Object.assign({},m.sheetContent.clearAllButton),{onClick:()=>i({type:"clear"})}),rightButton:Object.assign(Object.assign({},m.sheetContent.submitButton),{onClick:()=>Nl(this,void 0,void 0,(function*(){const e=n.filter((t=>t.count>0)).map((t=>f.mapBarcodeToBarcodeItem(t.barcode,"COUNTING"===m.mode?t.count:1)));t.onSubmit({items:yield Promise.all(e)})}))}),title:m.sheetContent.title},y=Rl("mobile"),C="BUTTON"!==m.sheet.mode&&y?"SMALL"===m.sheet.collapsedVisibleHeight?69:128:0,S=y&&"BUTTON"===m.sheet.mode,w=S?76:0,x=(h?80:0)+w,E=Object(B.useContext)(q);return B.default.createElement(B.default.Fragment,null,B.default.createElement(z.a,{container:!0,sx:{display:"flex",flexDirection:y?"column":"row",height:`calc(${E.remainingVisibleBodyHeight} - ${C}px)`},alignItems:"stretch"},B.default.createElement(z.a,{id:d,item:!0,ref:e,component:"div",xs:y?12:7,zIndex:100},S&&B.default.createElement(Ml,{style:{position:"absolute",marginTop:`calc(${E.remainingVisibleBodyHeight} - 60px - 8px)`,width:"100%",display:"flex",justifyContent:"center",zIndex:1100},count:v,onClick:()=>u(!c),buttonStyling:m.sheet.listButton}),B.default.createElement(fl,{viewFinderPadding:{minTopPadding:E.minTopPaddingForContent,minBottomPadding:x},arOverlay:Object.assign(Object.assign({},m.arOverlay),{counterBadge:Object.assign(Object.assign({},m.arOverlay.counterBadge),{visible:m.arOverlay.counterBadge.visible&&"COUNTING"===m.mode})}),containerId:d,barcodeScannerViewConfig:g.current,onCameraPermissionDenied:t.onCameraPermissionDenied,actionBarConfig:t.configuration.actionBar,actionBarBottomPadding:16+w,setActionButtonsVisible:p,arOnBarcodeClick:e=>{i({type:"setCount",barcodes:[e],computeNewCount:e=>{const n="UNIQUE"===m.mode?1-e:e+1;return n>0&&(pt.INSTANCE.beep(t.configuration.sound),mt.INSTANCE.vibrate(t.configuration.vibration)),n}})},arOnBarcodeEnter:(t,e,n)=>{n&&e&&i({type:"setHtmlElements",barcode:t,labelElement:n,polygonElement:e})},scanningPaused:c&&y,cameraConfiguration:t.configuration.cameraConfiguration,onLicenseError:t.onError}),y&&B.default.createElement(El,{closedSheetVisibleHeight:C,sheetStyle:m.sheet,contentStyle:m.sheetContent,manualCountEditDialog:m.manualCountEditDialog,numBarcodes:v,onBarcodeChange:t=>i(t),drawerHeaderContentProps:b,isOpen:c,onSwipe:t=>{u("swipe-to-open"===t)}},A)),function(t){switch(t){case"mobile":return Object(j.useMediaQuery)("(min-width:"+kl+"px)");case"tablet":return Object(j.useMediaQuery)("(min-width:"+Dl+"px)");case"desktop":return Object(j.useMediaQuery)("(min-width:"+Pl+"px)")}}("tablet")&&B.default.createElement(z.a,{item:!0,xs:y?12:5,component:"div",style:{paddingTop:E.minTopPaddingForContent,height:"100%",flexDirection:"column",display:"flex",backgroundColor:N.b.getColorValue(m.sheetContent.sheetColor)},zIndex:1050},B.default.createElement(z.a,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},zIndex:50},B.default.createElement(Al,Object.assign({},b))),A,B.default.createElement(Sl,{numBarcodes:v,style:m.sheetContent}))),B.default.createElement(Ol,{barcode:s,dialogStyling:m.manualCountEditDialog,onCancel:()=>l(null),setCounter:t=>{i(t),l(null)}}))}const Ul=Object(B.createContext)(null),Hl={didCatch:!1,error:null};class Gl extends B.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Hl}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(null!==t){for(var e,n,i=arguments.length,o=new Array(i),r=0;r<i;r++)o[r]=arguments[r];null===(e=(n=this.props).onReset)||void 0===e||e.call(n,{args:o,reason:"imperative-api"}),this.setState(Hl)}}componentDidCatch(t,e){var n,i;null===(n=(i=this.props).onError)||void 0===n||n.call(i,t,e)}componentDidUpdate(t,e){const{didCatch:n}=this.state,{resetKeys:i}=this.props;var o,r;n&&null!==e.error&&function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t.length!==e.length||t.some(((t,n)=>!Object.is(t,e[n])))}(t.resetKeys,i)&&(null===(o=(r=this.props).onReset)||void 0===o||o.call(r,{next:i,prev:t.resetKeys,reason:"keys"}),this.setState(Hl))}render(){const{children:t,fallbackRender:e,FallbackComponent:n,fallback:i}=this.props,{didCatch:o,error:r}=this.state;let a=t;if(o){const t={error:r,resetErrorBoundary:this.resetErrorBoundary};if("function"==typeof e)a=e(t);else if(n)a=Object(B.createElement)(n,t);else{if(null!==i&&!Object(B.isValidElement)(i))throw r;a=i}}return Object(B.createElement)(Ul.Provider,{value:{didCatch:o,error:r,resetErrorBoundary:this.resetErrorBoundary}},a)}}M.BarcodeItemErrorState;function Ql(t){const e=Object(B.useContext)(N.a).getColorValue,n={backgroundColor:e(t.sheetColor)};return B.default.createElement(et,{modalOverlayColor:t.modalOverlayColor,open:t.open},B.default.createElement(j.DialogContent,{sx:Object.assign(Object.assign({},n),{p:2,pb:1,textAlign:"center"})},B.default.createElement(j.Typography,{sx:{fontSize:"16pt",fontWeight:"bold"}},B.default.createElement(G.a,{config:t.title})),B.default.createElement(j.Typography,{sx:{fontSize:"14pt",lineHeight:"16pt"}},B.default.createElement(G.a,{config:t.subtitle}))),B.default.createElement(j.DialogActions,{sx:Object.assign(Object.assign({},n),{pt:1})},B.default.createElement(z.a,{container:!0,spacing:2},B.default.createElement(z.a,{item:!0,xs:12},B.default.createElement(z.a,{color:e(t.dividerColor)})),B.default.createElement(z.a,{item:!0,xs:6},B.default.createElement(J,Object.assign({style:{width:"100%"},onClick:t.handleCancel},t.cancelButton))),B.default.createElement(z.a,{item:!0,xs:6},B.default.createElement(J,Object.assign({icon:j.Replay,style:{width:"100%"},onClick:t.handleRetry},t.retryButton))))))}function Zl(t){const e=Object(B.useContext)(q);return B.default.createElement(j.Box,{sx:{paddingTop:e.minTopPaddingForContent+"px",overflowY:"scroll",backgroundColor:N.b.getColorValue(t.config.background)}},B.default.createElement(j.Box,{sx:{height:e.remainingVisibleBodyHeight,marginLeft:"auto",marginRight:"auto",maxWidth:280,display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column"}},t.config.icon.visible&&B.default.createElement(j.Box,null,B.default.createElement(j.Avatar,{sx:{width:100,height:100,backgroundColor:N.b.getColorValue(t.config.iconBackground),margin:"24px"}},B.default.createElement(z.a,{sx:{fontSize:50,color:N.b.getColorValue(t.config.icon.color)}}))),B.default.createElement(j.Typography,{sx:{fontSize:20,textAlign:"center"}},B.default.createElement(G.a,{config:t.config.enableCameraTitle})),B.default.createElement(j.Typography,{sx:{fontSize:16,textAlign:"center",paddingTop:"12px"}},B.default.createElement(G.a,{config:t.config.enableCameraExplanation})),B.default.createElement(j.Box,{sx:{paddingTop:"16px"}},B.default.createElement(Y,Object.assign({},t.config.closeButton,{onClick:t.onAppClose})))))}function Yl(t){const e=Object(B.useRef)(Object(j.createTheme)({palette:{primary:{main:xt.ScanbotPrimary},secondary:{main:xt.DarkGray}}})),[n,i]=Object(B.useState)(!1),[o,r]=Object(B.useState)(!1),[a,s]=Object(B.useState)(t.configuration.timeouts.initialScanDelay<=0),l=Object(B.useRef)(!1),c=Object(B.useRef)(),u=Object(B.useRef)(),d=Object(B.useMemo)((()=>new lt(t.configuration.useCase.barcodeInfoMapping.barcodeItemMapper,((t,e)=>{i(!0),c.current=()=>{i(!1),t()},u.current=()=>{i(!1),e()}}))),[]);let h;if(Object(B.useMemo)((()=>{N.b.setPalette(t.configuration.palette),N.b.setBarcodeTextLocalization(t.configuration.localization)}),[t.configuration]),Object(B.useEffect)((()=>{if(t.configuration.timeouts.autoCancelTimeout>0){const e=setTimeout((()=>{t.onClose()}),t.configuration.timeouts.autoCancelTimeout);return()=>{clearTimeout(e)}}}),[]),Object(B.useEffect)((()=>{if(t.configuration.timeouts.initialScanDelay>0){const e=setTimeout((()=>{s(!0)}),t.configuration.timeouts.initialScanDelay);return()=>{clearTimeout(e)}}}),[]),Object(B.useEffect)((()=>{l.current=!n&&a}),[n,a]),"SingleScanningMode"===t.configuration.useCase._type)h=B.default.createElement(vl,{configuration:t.configuration,onClose:t.onClose,onSubmit:t.onSubmit,onError:t.onError,onCameraPermissionDenied:()=>r(!0),scanningEnabled:l});else{if("MultipleScanningMode"!==t.configuration.useCase._type)throw new Error("Unsupported use case type");h=B.default.createElement(Vl,{configuration:t.configuration,onSubmit:t.onSubmit,onError:t.onError,onCameraPermissionDenied:()=>r(!0),scanningEnabled:l})}return B.default.createElement(B.default.Fragment,null,B.default.createElement(U,null),B.default.createElement(Gl,{onError:t.onError,fallback:B.default.createElement("div",null,"Error")},B.default.createElement(N.a.Provider,{value:Object(N.c)(t.configuration.palette)},B.default.createElement(st.Provider,{value:d},B.default.createElement(j.ThemeProvider,{theme:e.current},B.default.createElement(Ql,Object.assign({open:n,handleCancel:u.current,handleRetry:c.current,modalOverlayColor:t.configuration.useCase.barcodeInfoMapping.modalOverlayColor,dividerColor:t.configuration.useCase.barcodeInfoMapping.dividerColor,sheetColor:t.configuration.useCase.barcodeInfoMapping.sheetColor},t.configuration.useCase.barcodeInfoMapping.errorState)),B.default.createElement(z.a,{sx:{height:`100 * ${V}`,width:"100vw",backgroundColor:N.b.getColorValue(t.configuration.backgroundColor)}},B.default.createElement(X,Object.assign({onBackPress:t.onClose},t.configuration.topBar),!o&&h,o&&B.default.createElement(Zl,{onAppClose:t.onClose,config:t.configuration.cameraPermission}))))))))}var ql=function(t,e,n,i){return new(n||(n=Promise))((function(o,r){function a(t){try{l(i.next(t))}catch(t){r(t)}}function s(t){try{l(i.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((i=i.apply(t,e||[])).next())}))};class Xl{static createBarcodeScanner(t){return new Promise(((e,n)=>{pt.INSTANCE.initialize(t.sound);const i=Xl.createContainer("barcode-scanner-controller"),o=Object(W.createRoot)(i),r=()=>ql(this,void 0,void 0,(function*(){return new Promise((t=>{window.setTimeout((()=>{o.unmount(),document.body.removeChild(i),t()}),0)}))})),a=t=>ql(this,void 0,void 0,(function*(){yield r(),n(t)}));o.render(B.default.createElement(Yl,{configuration:t,onClose:()=>ql(this,void 0,void 0,(function*(){yield r(),e(null)})),onSubmit:t=>ql(this,void 0,void 0,(function*(){yield r(),e(t)})),onError:a})),(()=>{ql(this,void 0,void 0,(function*(){try{const t=yield eu.instance.getLicenseInfo();t.isValid()||(yield a(new D(t)))}catch(t){yield a(t)}}))})()}))}static createContainer(t){const e=document.createElement("div");return e.id=t,e.style.position="fixed",e.style.width="100%",e.style.height="100%",e.style.zIndex="1000",e.style.top="0",e.style.backgroundColor="rgba(0, 0, 0, 0.5)",document.body.appendChild(e),e}}Xl.Config=M;var $l=Xl,Kl=function(t,e,n,i){return new(n||(n=Promise))((function(o,r){function a(t){try{l(i.next(t))}catch(t){r(t)}}function s(t){try{l(i.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((i=i.apply(t,e||[])).next())}))};class Jl{constructor(t,e){this._sdk=t,this._recognizer=e}recognize(t,e,n="COPY_IMAGE"){return Kl(this,void 0,void 0,(function*(){const i=this._sdk.getBridge(n);return yield i.genericDocumentRecognizerRecognize(this._recognizer,t,new O.GenericDocumentRecognizerTypes.RecognitionParameters(e))}))}release(){return Kl(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.releaseObject(this._recognizer)}))}}const tc={OK:"Capturing your document... Please do not move the camera.",OK_SMALL_SIZE:"The document is too small. Try moving closer.",OK_BAD_ANGLES:"This is a bad camera angle. Hold the device straight over the document.",OK_BAD_ASPECT_RATIO:"Rotate the device sideways, so that the document fits better into the screen.",OK_OFF_CENTER:"Try holding the device at the center of the document.",ERROR_NOTHING_DETECTED:"Please hold the device over a document to start scanning.",ERROR_TOO_DARK:"It is too dark. Try turning on a light.",ERROR_NOISE:"Please move the document to a clear surface.",NOT_ACQUIRED:"Scanning failed."};class ec{constructor(t){this.hint=t}}class nc{constructor(){this.outline=new ic,this.captureButton=new sc}}class ic{constructor(){this.polygon=new oc,this.path=new rc,this.label=new ac}}class oc{constructor(){this.strokeCapturing="green",this.strokeSearching="yellow",this.fillCapturing="transparent",this.fillSearching="transparent"}}class rc{constructor(){this.stroke="green",this.strokeWidth=4}}class ac{}class sc{constructor(){this.color="#FFF"}}class lc extends L.a{constructor(){super(L.a.DEFAULT_VIDEO_RESOLUTION_4K),this.detectionParameters=new O.DocumentDetectorTypes.DetectionParameters,this.autoCaptureEnabled=!0,this.autoCaptureSensitivity=.66,this.autoCaptureDelay=1e3,this.ignoreBadAspectRatio=!0,this.useImageCaptureAPI=!1,this.text=new ec(tc),this.style=new nc,this.onDocumentDetected=function(t){}}static fromJson(t){var e;const n=new lc;if(this.mapValues(t,n,["text","style","videoConstraints","detectionParameters"]),n.detectionParameters=new O.DocumentDetectorTypes.DetectionParameters(null!==(e=t.detectionParameters)&&void 0!==e?e:{}),t.text&&t.text.hint&&this.mapValues(t.text.hint,n.text.hint),t.style){this.mapValues(t.style,n.style,["outline","captureButton"]);const e=t.style.outline;if(e){this.mapValues(e,n.style.outline,["polygon","path","label"]);const t=e.polygon;t&&this.mapValues(t,n.style.outline.polygon);const i=e.path;i&&this.mapValues(i,n.style.outline.path);const o=e.label;o&&this.mapValues(o,n.style.outline.label)}const i=t.style.captureButton;i&&this.mapValues(i,n.style.captureButton)}return this.mapVideoConstraints(t,n),n}}var cc=n(35),uc={insert:"head",singleton:!1};Ms()(cc.a,uc),cc.a.locals;class dc extends B.default.Component{constructor(){super(...arguments),this.LINE_COUNT=4}render(){return B.default.createElement("svg",{style:{width:"100%",height:"100%",position:"absolute",overflow:"visible",fill:this.props.polygonStyle.fill}},this.fill())}fill(){if(!this.props.points||0===this.props.points.length)return null;const t=[];for(let e=0;e<this.LINE_COUNT;e++){const n=this.props.points[e],i=this.props.points[(e+1)%this.LINE_COUNT];t.push(B.default.createElement("line",{key:e,style:this.props.polygonStyle,className:this.props.polygonClasses,x1:n.x,y1:n.y,x2:i.x,y2:i.y}))}return t}setFrame(){window.requestAnimationFrame((()=>this.forceUpdate()))}}dc.CLASSNAME="scanbot-document-outline";class hc extends B.default.Component{constructor(t){super(t),this.state={points:[],animatedPoints:[],isOk:!1,isVisible:!1}}update(t,e,n,i){const o={points:t,animatedPoints:e,isOk:n,isVisible:i};this.setState(o)}pointStringOrLatestValidPoints(t){return t&&t.length>0?Es.a.toSvgString(t):Es.a.toSvgString(this.latestValidPoints)}render(){var t;this.state.points&&(this.latestValidPoints=this.state.points);const e=null!==(t=this.props.style)&&void 0!==t?t:{},n=Vs()(dc.CLASSNAME,{[`${dc.CLASSNAME}-ok`]:this.state.isOk},{[`${dc.CLASSNAME}-visible`]:this.state.isVisible},{[`${dc.CLASSNAME}-hidden`]:!this.state.isVisible});return B.default.createElement(ws.polygon,{ref:t=>this.polygon=t,style:{strokeWidth:e.strokeWidth||2},animate:{points:this.pointStringOrLatestValidPoints(this.state.animatedPoints),opacity:this.state.isVisible?1:0,stroke:this.state.isOk?e.strokeCapturing:e.strokeSearching,fill:this.state.isOk?e.fillCapturing:e.fillSearching},onClick:()=>{},fill:"transparent",className:n})}}var pc=hc;class fc extends B.default.Component{constructor(t){super(t),this.state={path:void 0}}render(){var t,e;return this.state.path?B.default.createElement(ws.path,{pathLength:"1",strokeDasharray:"1 1",initial:{strokeDashoffset:1},animate:{strokeDashoffset:0},transition:{duration:this.props.duration/1e3,ease:"easeInOut",repeat:0,repeatType:"loop",repeatDelay:1},stroke:(null===(t=this.props.style)||void 0===t?void 0:t.stroke)||"white",strokeWidth:(null===(e=this.props.style)||void 0===e?void 0:e.strokeWidth)||2,fill:"none",d:this.state.path,className:`${dc.CLASSNAME}-path`}):null}animate(t){const e="M"+Es.a.toSvgString(t)+"z";this.setState({path:e})}clear(){this.setState({path:void 0})}}class mc extends B.default.Component{render(){return B.default.createElement(ws.svg,{style:{width:"100%",height:"100%",position:"absolute",overflow:"visible"}},B.default.createElement(pc,{ref:t=>this.polygon=t,style:this.props.polygonStyle}),B.default.createElement(fc,{ref:t=>this.path=t,style:this.props.pathStyle,duration:this.props.autoCaptureSensitivity}))}update(t,e,n){var i;const o="processing"!==n&&!!t,r=null!==(i=this.previous)&&void 0!==i?i:t,a=this.previous?t:void 0;this.polygon.update(r,a,e,o),this.previous=t,this.previous&&"capturing"===n?this.animateCapturing():this.clearAnimation()}animateCapturing(){this.path.animate(this.previous)}clearAnimation(){this.path.clear()}}class gc extends B.default.Component{constructor(){super(...arguments),this.hintLabelClassName="scanbot-document-hint-text",this.state={text:"Initializing...",ok:!1,validPoints:!1}}render(){const{ok:t,text:e,validPoints:n}=this.state,i="searching"===this.props.action||"capturing"===this.props.action,o="processing"!==this.props.action&&n,r=Vs()({[this.hintLabelClassName]:!0,[`${this.hintLabelClassName}-visible`]:o,[`${this.hintLabelClassName}-hidden`]:!o});return B.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute",left:0,top:0}},B.default.createElement(mc,{ref:t=>{this.polygon=t},action:this.props.action,style:{width:"100%",height:"100%"},polygonStyle:this.props.style.polygon,pathStyle:this.props.style.path,isOk:t,isVisible:o,autoCaptureSensitivity:this.props.autoCaptureSensitivity}),i&&B.default.createElement("label",{ref:t=>this.label=t,style:this.props.style.label,className:r,dangerouslySetInnerHTML:{__html:e}}))}update(t,e,n){this.polygon.update(e,t,this.props.action),this.label&&(this.label.innerHTML=n)}}class vc{static isConvex(t){if(t.length<4)return!0;let e=!1,n=t.length;for(let i=0;i<n;i++){const o=t[(i+2)%n].x-t[(i+1)%n].x,r=t[(i+2)%n].y-t[(i+1)%n].y,a=t[i].x-t[(i+1)%n].x,s=o*(t[i].y-t[(i+1)%n].y)-r*a;if(0==i)e=s>0;else if(e!=s>0)return!1}return!0}static distanceBetweenPoints(t,e){return Math.pow(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2),.5)}static intersection(t,e){const n=t[0],i=Es.a.subtract(t[1],n),o=e[0],r=Es.a.subtract(e[1],o);if(0===Es.a.cross(i,r))return;const a=Es.a.cross(Es.a.subtract(o,n),i)/Es.a.cross(i,r);return Es.a.add(o,Es.a.multiply(r,a))}}class Ac{constructor(t,e=Ac.DEFAULT_SENSITIVITY){this.maxDistance=this.calculateMaxDistance(t),this.sensitivity=e}check(t){let e=!1;if(this.lastPolygon){for(var n=0;n<4;n++)if(this.isPointMoved(t[n],this.lastPolygon[n])){e=!0;break}}else e=!0;return e}reset(){this.lastPolygon=void 0}update(t){this.lastPolygon=t}isPointMoved(t,e){return vc.distanceBetweenPoints(t,e)/this.maxDistance>this.sensitivity}calculateMaxDistance(t){let e=new Es.a(0,0),n=new Es.a(t.width,t.height);return vc.distanceBetweenPoints(e,n)}}Ac.DEFAULT_SENSITIVITY=.5;var bc=function(t,e,n,i){return new(n||(n=Promise))((function(o,r){function a(t){try{l(i.next(t))}catch(t){r(t)}}function s(t){try{l(i.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((i=i.apply(t,e||[])).next())}))};gt.b;gt.a;class yc extends gt.c{constructor(t){if(super(t),this.preventAutoCapture=!1,this.defaultCaptureButtonClick=()=>bc(this,void 0,void 0,(function*(){const t=yield this.detectAndCrop();this.configuration.onDocumentDetected(t)})),Object.assign(this.state,{action:this.defaultAction}),!this.isSupported()){throw Error("Camera can only be accessed if the content is served via HTTPS, or on localhost. Check DocumentScannerView.isSupported() before creating the scanner.")}if(!eu.instance)throw Error("Initialize the SDK by calling ScanbotSDK.initialize() before using the document scanner.")}get defaultAction(){return this.isAutoCaptureEnabled()?"searching":"manual"}get enabled(){return("searching"==this.state.action||"capturing"==this.state.action||"manual"==this.state.action)&&!this.disposed}get configuration(){return this._configuration||(this._configuration=lc.fromJson(this.props.configuration)),this._configuration}get autoCaptureSensitivity(){return 3e3*(1-this.configuration.autoCaptureSensitivity)}static create(t){return bc(this,void 0,void 0,(function*(){const e=document.getElementById(t.containerId);if(!e)throw Error("Unable to initialize ScanbotSDK: Cannot find container element with the id provided.");return new Promise(((n,i)=>{Object(B.render)(B.default.createElement(yc,{container:e,configuration:t,onSuccess:n,onFailure:i}),e)}))}))}detectAndCrop(){var t;return bc(this,void 0,void 0,(function*(){try{if(this.enabled){this.setState({action:"processing"});const e=yield null===(t=this.camera)||void 0===t?void 0:t.createImageData(yc.DETECT_AND_CROP_RESOLUTION,this.configuration.useImageCaptureAPI);if(!e)return;return F.a.debug("Detect & Crop document of size: "+e.height*e.width),yield this.bridge.transferArgs.detectAndCropDocument(e)}}finally{this.setState({action:this.defaultAction})}}))}enableAutoCapture(){this.updateAutoCapture(!0)}disableAutoCapture(){this.updateAutoCapture(!1)}updateAutoCapture(t){this._configuration?this._configuration.autoCaptureEnabled=t:this.props.configuration.autoCaptureEnabled=t,this.setState({action:this.defaultAction})}isAutoCaptureEnabled(){return this._configuration?this._configuration.autoCaptureEnabled:this.props.configuration.autoCaptureEnabled}componentDidMount(){const t=Object.create(null,{componentDidMount:{get:()=>super.componentDidMount}});return bc(this,void 0,void 0,(function*(){t.componentDidMount.call(this),this.detect(),this.recognizer=this.bridge.copyArgs.createDocumentDetector(new O.DocumentDetectorTypes.DetectionParameters(this.configuration.detectionParameters))}))}componentWillUnmount(){const t=Object.create(null,{componentWillUnmount:{get:()=>super.componentWillUnmount}});return bc(this,void 0,void 0,(function*(){t.componentWillUnmount.call(this),this.handleAutoCapture(!1),yield eu.instance.release(yield this.recognizer,"Document Scanner")}))}detect(){var t,e;return bc(this,void 0,void 0,(function*(){try{if(!this.enabled)return;const t=yield this.detectInWebWorker();if(!t||!this.enabled)return;if(!this.outline)return;const e=this.getStatusString(t),n="OK"===e,i=e.startsWith("OK")?this.scalePolygonPointsToPixels(t.pointsNormalized):void 0;this.outline.update(n,i,m.getProperty(this.configuration.text.hint,e)),yield this.handleAutoCapture(n,i)}catch(n){null===(e=(t=this.configuration).onError)||void 0===e||e.call(t,n)}finally{requestAnimationFrame(this.detect.bind(this))}}))}getStatusString(t){return this.configuration.ignoreBadAspectRatio&&"OK_BAD_ASPECT_RATIO"===t.status?"OK":t.status}detectInWebWorker(){var t;return bc(this,void 0,void 0,(function*(){const e=yield null===(t=this.camera)||void 0===t?void 0:t.createImageData(gt.c.DEFAULT_DETECTION_RESOLUTION);if(e&&this.enabled)return yield this.bridge.copyArgs.documentDetectorDetect(yield this.recognizer,e)}))}handleAutoCapture(t,e){return bc(this,void 0,void 0,(function*(){if(this.configuration.autoCaptureEnabled&&!this.preventAutoCapture)if(t&&!this.autoCaptureToken&&e){if(this.updateButton("capturing"),!this.polygonMovementPredicate){const t=this.getCameraFrameSize();this.polygonMovementPredicate=new Ac(t)}if(this.runMovementPredicate(e))return this.updateButton("searching"),clearTimeout(this.autoCaptureToken),void(this.autoCaptureToken=void 0);this.autoCaptureToken=setTimeout((()=>bc(this,void 0,void 0,(function*(){if(this.autoCaptureToken=void 0,!this.enabled)return;if(!this.configuration.autoCaptureEnabled)return;const t=yield this.detectAndCrop();if(t.pointsNormalized){const e=this.scalePolygonPointsToPixels(t.pointsNormalized);if(this.runMovementPredicate(e))return}t.status.startsWith("OK")&&this.configuration.onDocumentDetected&&(this.configuration.onDocumentDetected(t),this.preventAutoCapture=!0,setTimeout((()=>{this.preventAutoCapture=!1}),this.configuration.autoCaptureDelay))}))),this.autoCaptureSensitivity)}else!t&&this.autoCaptureToken&&(this.updateButton("searching"),clearTimeout(this.autoCaptureToken),this.autoCaptureToken=void 0)}))}updateButton(t){this.setState({action:t})}render(){var t,e,n;const{action:i}=this.state,{configuration:o}=this,r=null===(t=o.style)||void 0===t?void 0:t.captureButton;return B.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},this.renderSpinner(null===(e=this.configuration)||void 0===e?void 0:e.spinnerColor),B.default.createElement(vt.a,{configuration:this.configuration,videoConstraints:o.videoConstraints,mirrored:o.mirrored,preferredCamera:this.configuration.preferredCamera,onReady:this.onVideoReady,onError:this.onVideoError,ref:t=>{this.camera=t}}),B.default.createElement(gc,{ref:t=>{this.outline=t},style:null===(n=o.style)||void 0===n?void 0:n.outline,action:i,autoCaptureSensitivity:this.autoCaptureSensitivity}),B.default.createElement(Hs,{color:(null==r?void 0:r.color)?r.color:"FFF",action:i,onClick:this.enabled?o.onCaptureButtonClick||this.defaultCaptureButtonClick:()=>{}}))}scalePolygonPointsToPixels(t){if(t){const e=this.getCameraFrameSize(),n=qs.a.fromHtmlElement(this.camera.video),i=al.findScale(n,e);t=(t=al.convertToViewportPointsFromParentSize(e,t)).map((t=>Es.a.scaleToPoint(t,i.x,i.y,i.scale)))}return t}runMovementPredicate(t){const e=this.polygonMovementPredicate.check(t);return this.polygonMovementPredicate.update(t),e}getCameraFrameSize(){return this.camera.calculateFrameSize(gt.c.DEFAULT_DETECTION_RESOLUTION,this.camera.videoSize().width,this.camera.videoSize().height)}}yc.DETECT_AND_CROP_RESOLUTION=0;var Cc=yc;class Sc extends _.a{constructor(){super(L.a.DEFAULT_VIDEO_RESOLUTION_HD),this.recognizerConfiguration=new O.MRZTypes.RecognizerConfiguration,this.onMrzDetected=function(t){},this.finder.aspectRatio=new O.Geometry.AspectRatio({width:4,height:1}),this.userGuidance.title.text="Please hold the device over the MRZ code to start scanning"}static fromJson(t){const e=new Sc;return this.mapValues(t,e,["style","videoConstraints","finder","userGuidance"]),this.mapFinderConfiguration(e,t),this.mapVideoConstraints(t,e),e}}var wc=function(t,e,n,i){return new(n||(n=Promise))((function(o,r){function a(t){try{l(i.next(t))}catch(t){r(t)}}function s(t){try{l(i.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((i=i.apply(t,e||[])).next())}))};gt.a;gt.b;class xc extends gt.c{constructor(t){super(t),this.shouldComputeSize=!0,this.paused=!1,this.updateDimensionsCallback=this.updateDimensions.bind(this),Object.assign(this.state,{isFinderVisible:!0})}get configuration(){return this._configuration||(this._configuration=Sc.fromJson(this.props.configuration)),this._configuration}get enabled(){return!this.disposed}static create(t,e){return wc(this,void 0,void 0,(function*(){const n=document.getElementById(t.containerId);if(!n)throw Error("Unable to initialize ScanbotSDK: Cannot find container element with the id provided.");return new Promise(((i,o)=>{Object(B.render)(B.default.createElement(xc,{container:n,configuration:t,onSuccess:i,onFailure:o,mrzRecognizer:e}),n)}))}))}isDetectionPaused(){return this.paused}resumeDetection(){return wc(this,void 0,void 0,(function*(){rl.warn("Mrz detection resumed"),yield this.resume()}))}pauseDetection(){rl.warn("Mrz detection paused"),this.pause()}componentDidMount(){const t=Object.create(null,{componentDidMount:{get:()=>super.componentDidMount}});return wc(this,void 0,void 0,(function*(){t.componentDidMount.call(this),window.addEventListener("resize",this.updateDimensionsCallback),yield this.resume()}))}componentWillUnmount(){super.componentWillUnmount(),this.pause(),this.props.mrzRecognizer.release(),window.removeEventListener("resize",this.updateDimensionsCallback)}updateDimensions(){return wc(this,void 0,void 0,(function*(){this.shouldComputeSize=!0,this.forceUpdate()}))}resume(){return wc(this,void 0,void 0,(function*(){this.paused=!1,yield this.detect()}))}pause(){this.paused=!0}detect(){var t,e,n;return wc(this,void 0,void 0,(function*(){const i=this.shouldComputeSize;if(!this.enabled)return;if(this.paused)return;let o=!1;try{this.camera.finderFrame=null===(t=this.finder)||void 0===t?void 0:t.holeRect;const r=yield null===(e=this.camera)||void 0===e?void 0:e.createImageData(xc.FRAME_RESOLUTION);if(!r)return;i&&this.forceUpdate();const a=yield this.props.mrzRecognizer.recognize(r);if(!this.enabled)return;if(null===a)return;a?(o=!0,this.configuration.onMrzDetected(a)):this.configuration._onDetectionFailed&&(null===(n=this.configuration)||void 0===n||n._onDetectionFailed(r))}catch(t){console.log(t)}finally{o?setTimeout((()=>{requestAnimationFrame(this.detect.bind(this))}),200):requestAnimationFrame(this.detect.bind(this))}}))}saveExtractedImageData(){this.camera.saveExtractedData()}setFinderVisible(t){this.setState({isFinderVisible:t})}render(){var t;return B.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},this.renderSpinner(null===(t=this.configuration)||void 0===t?void 0:t.spinnerColor),B.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%"}},B.default.createElement(vt.a,{configuration:this.configuration,videoConstraints:this.configuration.videoConstraints,mirrored:this.configuration.mirrored,preferredCamera:this.configuration.preferredCamera,onReady:this.onVideoReady,onError:this.onVideoError,ref:t=>{this.camera=t}})),this.state.isFinderVisible&&B.default.createElement(At.a,{ref:t=>{this.finder=t},guidanceConfiguration:this.configuration.userGuidance,configuration:this.configuration.finder}))}}xc.FRAME_RESOLUTION=1200;var Ec=xc,Lc=n(30);class _c{constructor(){this.disabled=!1,this.color="transparent"}}class Oc{constructor(){this.color="white",this.border="1px solid lightgray",this.size=20}}class Tc{constructor(){this.color="#1ec31e",this.width=4}}class kc{constructor(){this.padding=10}}class Dc{constructor(){this.margin=15,this.size=100,this.zoom=1.5}}class Pc{constructor(){this.width=2,this.color="white"}}class Rc{constructor(){this.size=20,this.color="white"}}class Ic extends Lc.a{constructor(){super(),this.disableScroll=!0,this.rotations=0,this.style=new kc,this.style.magneticLines=new _c,this.style.polygon=new Tc,this.style.polygon.handles=new Oc,this.style.magnifier=new Dc,this.style.magnifier.border=new Pc,this.style.magnifier.crosshair=new Rc}static fromJson(t){const e=new Ic;return this.mapValues(t,e,["style"]),t.style&&(this.mapValues(t.style,e.style,["polygon","magneticLines","magnifier"]),t.style.polygon&&(this.mapValues(t.style.polygon,e.style.polygon,["handles"]),t.style.polygon.handles&&this.mapValues(t.style.polygon.handles,e.style.polygon.handles)),t.style.magneticLines&&this.mapValues(t.style.magneticLines,e.style.magneticLines,[]),t.style.magnifier&&(this.mapValues(t.style.magnifier,e.style.magnifier,["border","crosshair"]),t.style.magnifier.border&&this.mapValues(t.style.magnifier.border,e.style.magnifier.border,[]),t.style.magnifier.crosshair&&this.mapValues(t.style.magnifier.crosshair,e.style.magnifier.crosshair,[]))),e}}class Fc extends B.default.Component{constructor(){super(...arguments),this.BUFFER=4}fromPoint(t){return B.default.createElement("svg",{style:{width:"100%",height:"100%",position:"absolute"}},B.default.createElement("line",{x1:t.start.x.toString(),y1:t.start.y.toString(),x2:t.end.x.toString(),y2:t.end.y.toString(),style:{stroke:this.props.style.color,strokeWidth:2}}))}componentDidUpdate(t,e,n){this.props.style.disabled||this.snapToClosestIfAnyAreClose()}render(){var t,e,n,i,o,r;return B.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute"}},null===(n=null===(e=null===(t=this.props.lines)||void 0===t?void 0:t.horizontal)||void 0===e?void 0:e.scaled)||void 0===n?void 0:n.map((t=>this.fromPoint(t))),null===(r=null===(o=null===(i=this.props.lines)||void 0===i?void 0:i.vertical)||void 0===o?void 0:o.scaled)||void 0===r?void 0:r.map((t=>this.fromPoint(t))))}snapToClosestIfAnyAreClose(){var t,e,n,i;const o=this.props.movingLine;let r=null===(e=null===(t=this.props.lines)||void 0===t?void 0:t.vertical)||void 0===e?void 0:e.scaled;if(o.isHorizontal&&(r=null===(i=null===(n=this.props.lines)||void 0===n?void 0:n.horizontal)||void 0===i?void 0:i.scaled),!r)return;const a=this.midPoint(o.points[0].coordinates,o.points[1].coordinates),s=r.map((t=>({distance:this.distanceToLine(t,a),mLine:t})));s.sort(((t,e)=>t.distance-e.distance)),s[0].distance<this.BUFFER&&this.props.snapTo({magneticLine:s[0].mLine,polygonLine:o})}distanceToLine(t,e){const n=e.x-t.start.x,i=e.y-t.start.y,o=t.end.x-t.start.x,r=t.end.y-t.start.y,a=o*o+r*r;if(0===a)return 1/0;const s=(n*o+i*r)/a;let l;return l=s<=0?t.start:s>=1?t.end:new Es.a(t.start.x+s*o,t.start.y+s*r),Es.a.distance(e,l)}midPoint(t,e){return new Es.a((t.x+e.x)/2,(t.y+e.y)/2)}}class Bc extends B.default.Component{constructor(){super(...arguments),this.POINT_COUNT=4,this.items=[],this.DRAG_BUFFER=5}get pointSize(){var t,e;return(null===(t=this.props.style)||void 0===t?void 0:t.size)?(null===(e=this.props)||void 0===e?void 0:e.scale)?this.props.style.size/this.props.scale:this.props.style.size:0}get pointStyle(){var t,e;return{width:this.pointSize+"px",height:this.pointSize+"px",border:null===(t=this.props.style)||void 0===t?void 0:t.border,borderRadius:this.pointSize/2+"px",backgroundColor:null===(e=this.props.style)||void 0===e?void 0:e.color,position:"absolute",cursor:"pointer",zIndex:500}}nextIndex(t){return(t+1)%this.POINT_COUNT}previousIndex(t){return(t-1+this.POINT_COUNT)%this.POINT_COUNT}isHorizontal(t){return t%2==0}isOutOfBounds(t,e){return t<-this.DRAG_BUFFER||t>e+this.DRAG_BUFFER}get invisibleHandleStyle(){return{width:"50px",height:"50px",opacity:0,position:"relative",top:this.pointSize/2-25+"px",left:this.pointSize/2-25+"px",borderRadius:"25px"}}}class Wc extends Bc{create(){if(!this.props.points||4!==this.props.points.length)return null;const t=[];for(let e=0;e<this.POINT_COUNT;e++){const n=this.props.points[e],i=B.default.createElement("div",{style:Object.assign(Object.assign({},this.pointStyle),{left:n.x-this.pointSize/2+"px",top:n.y-this.pointSize/2+"px"}),key:e.toString(),ref:t=>this.items[e]=t,onPointerDown:t=>this.cornerTouchStart(t,e),onPointerUp:t=>this.cornerTouchEnd(t),onPointerMove:t=>this.cornerTouchMove(t,e),"data-sb-cropping-corner":e},B.default.createElement("div",{style:Object.assign({},this.invisibleHandleStyle)}));t.push(i)}return t}cornerTouchStart(t,e){t.target.setPointerCapture(t.pointerId);const n=Es.a.fromCoordinates(t.clientX,t.clientY,this.props.rotations,this.props.scale),i=this.items[e],o=Es.a.fromHtmlElement(i);this.parentOffset=new Es.a(n.x-o.x,n.y-o.y),this.props.cornerMoveStart({index:e,point:this.props.points[e]})}cornerTouchMove(t,e){if(!this.parentOffset)return;const n=Es.a.fromCoordinates(t.clientX,t.clientY,this.props.rotations,this.props.scale),{x:i,y:o}=Object(xl.b)({x:n.x-this.parentOffset.x,y:n.y-this.parentOffset.y},this.pointSize,this.props.containerSize),r=this.pointSize/2,a=this.props.points[e];this.props.points[e]=new Es.a(i+r,o+r),vc.isConvex(this.props.points)?this.props.cornerMoved({index:e,point:this.props.points[e]}):this.props.points[e]=a}cornerTouchEnd(t){t.target.releasePointerCapture(t.pointerId),this.parentOffset=null,this.props.cornerMoveEnd()}render(){return B.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute",cursor:"pointer",zIndex:500,userSelect:"none",msUserSelect:"none",MozUserSelect:"none",WebkitUserSelect:"none"}},this.create())}}class Mc extends Bc{create(){if(!this.props.points||4!==this.props.points.length)return null;const t=[];for(let e=0;e<this.POINT_COUNT;e++){const n=this.props.points[e];let i=this.props.points[this.nextIndex(e)];const o=B.default.createElement("div",{style:Object.assign(Object.assign({},this.pointStyle),{left:n.x+(i.x-n.x)/2-this.pointSize/2+"px",top:n.y+(i.y-n.y)/2-this.pointSize/2+"px"}),key:e.toString(),ref:t=>this.items[e]=t,onPointerDown:t=>this.lineTouchStart(t,e),onPointerMove:t=>this.lineTouchMove(t,e),onPointerUp:t=>this.lineTouchEnd(t),"data-sb-cropping-side":e},B.default.createElement("div",{style:this.invisibleHandleStyle}));t.push(o)}return t}lineTouchStart(t,e){t.target.setPointerCapture(t.pointerId);const n=Es.a.fromCoordinates(t.clientX,t.clientY,this.props.rotations,this.props.scale),i=this.items[e],o=Es.a.fromHtmlElement(i),r=this.props.points[e],a=this.props.points[this.nextIndex(e)];this.point0Start=m.copy(this.props.points[this.previousIndex(e)]),this.point1Start=m.copy(r),this.point2Start=m.copy(a),this.point3Start=m.copy(this.props.points[this.nextIndex(this.nextIndex(e))]),this.point1Offset=new Es.a(r.x-o.x,r.y-o.y),this.point2Offset=new Es.a(a.x-o.x,a.y-o.y),this.parentOffset=new Es.a(n.x-o.x,n.y-o.y)}lineTouchMove(t,e){if(!this.parentOffset)return;const n=Es.a.fromCoordinates(t.clientX,t.clientY,this.props.rotations,this.props.scale),i=this.props.points[this.previousIndex(e)];let o=new Es.a(null,null),r=new Es.a(null,null);const a=this.props.points[this.nextIndex(e+1)],s=n.x-this.parentOffset.x,l=n.y-this.parentOffset.y;if(this.isHorizontal(e)){const t=l+this.point1Offset.y,e=l+this.point2Offset.y,n=t-this.point1Start.y;o.x=this.point1Start.x+(this.point1Start.x-this.point0Start.x)*(n/(this.point1Start.y-this.point0Start.y)),r.x=this.point2Start.x+(this.point2Start.x-this.point3Start.x)*(n/(this.point2Start.y-this.point3Start.y)),o.y=t,r.y=e}else{const t=s+this.point1Offset.x,e=s+this.point2Offset.x,n=t-this.point1Start.x;o.y=this.point1Start.y+(this.point1Start.y-this.point0Start.y)*(n/(this.point1Start.x-this.point0Start.x)),r.y=this.point2Start.y+(this.point2Start.y-this.point3Start.y)*(n/(this.point2Start.x-this.point3Start.x)),o.x=t,r.x=e}o=Es.a.clamp(o,this.props.containerSize),r=Es.a.clamp(r,this.props.containerSize),this.isNearOpposingPoint(this.point1Start,o,i,this.isHorizontal(e)?"y":"x")||this.isNearOpposingPoint(this.point1Start,r,a,this.isHorizontal(e)?"y":"x")||this.areEdgesCrossing(i,o,r,a)||vc.isConvex([i,o,r,a])&&(this.props.points[e].x=o.x,this.props.points[e].y=o.y,this.props.points[this.nextIndex(e)].x=r.x,this.props.points[this.nextIndex(e)].y=r.y,this.props.lineMoved({points:[{index:e,coordinates:o},{index:this.nextIndex(e),coordinates:r}],previousPoint:i,nextPoint:a,isHorizontal:this.isHorizontal(e)}))}lineTouchEnd(t){t.target.releasePointerCapture(t.pointerId),this.parentOffset=null}isNearOpposingPoint(t,e,n,i){if(t[i]>n[i]){if(e[i]-10<n[i])return!0}else if(e[i]>n[i]-10)return!0;return!1}areEdgesCrossing(t,e,n,i){const o=t.x,r=t.y,a=e.x,s=e.y,l=n.x,c=n.y,u=i.x,d=i.y;return((o-l)*(s-c)-(r-c)*(a-l))*((o-u)*(s-d)-(r-d)*(a-u))<0&&((l-o)*(d-r)-(c-r)*(u-o))*((l-a)*(d-s)-(c-s)*(u-a))<0}render(){return B.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute"}},this.create())}}class jc extends B.default.Component{render(){return B.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute"}},B.default.createElement(Wc,{ref:t=>this.corners=t,style:this.props.style,containerSize:this.props.containerSize,scale:this.props.scale,rotations:this.props.rotations,points:this.props.coordinatePoints,cornerMoveStart:this.props.cornerMoveStart,cornerMoved:this.props.cornerMoved,cornerMoveEnd:this.props.cornerMoveEnd}),B.default.createElement(Mc,{ref:t=>this.lines=t,style:this.props.style,containerSize:this.props.containerSize,scale:this.props.scale,rotations:this.props.rotations,points:this.props.coordinatePoints,lineMoved:this.props.lineMoved}))}setFrame(){for(let t=0;t<this.corners.POINT_COUNT;t++){const e=this.props.coordinatePoints[t];this.corners.items[t]&&(this.corners.items[t].style.left=e.x-this.corners.pointSize/2+"px",this.corners.items[t].style.top=e.y-this.corners.pointSize/2+"px");let n=this.props.coordinatePoints[this.corners.nextIndex(t)];this.lines.items[t]&&(this.lines.items[t].style.left=e.x+(n.x-e.x)/2-this.corners.pointSize/2+"px",this.lines.items[t].style.top=e.y+(n.y-e.y)/2-this.corners.pointSize/2+"px")}}snapTo(t){const e=[t.polygonLine.previousPoint,t.polygonLine.points[0].coordinates],n=[t.polygonLine.points[1].coordinates,t.polygonLine.nextPoint],i=[t.magneticLine.start,t.magneticLine.end];this.props.coordinatePoints[t.polygonLine.points[0].index]=vc.intersection(e,i),this.props.coordinatePoints[t.polygonLine.points[1].index]=vc.intersection(n,i),this.props.cornerMoveEnd(),this.setFrame()}}class zc extends B.default.Component{constructor(t){super(t),this.state={movingLine:void 0}}render(){return B.default.createElement("div",null,B.default.createElement(jc,{ref:t=>this.handles=t,containerSize:this.props.size,coordinatePoints:this.props.points,rotations:this.props.rotations,scale:this.props.scale,style:this.props.handleStyle,cornerMoveStart:this.props.cornerMoveStart,cornerMoved:t=>{this.setFrame(),this.props.cornerMoved(t)},cornerMoveEnd:this.props.cornerMoveEnd,lineMoved:t=>{this.setFrame(),this.setState({movingLine:t})}}),B.default.createElement(Fc,{style:this.props.magneticLineStyle,lines:this.props.magneticLines,movingLine:this.state.movingLine,snapTo:t=>{var e,n;null===(e=this.handles)||void 0===e||e.snapTo(t),null===(n=this.polygon)||void 0===n||n.setFrame()}}),B.default.createElement(dc,{size:this.props.size,points:this.props.points,polygonStyle:this.props.polygonStyle,polygonClasses:this.props.polygonClasses,ref:t=>this.polygon=t}))}setFrame(){var t,e;null===(t=this.polygon)||void 0===t||t.setFrame(),null===(e=this.handles)||void 0===e||e.setFrame()}}class Nc extends B.default.Component{render(){return B.default.createElement("img",{ref:t=>this.image=t,style:{width:"100%",height:"100%",objectFit:"cover",position:"absolute"},src:this.props.src,alt:".",onLoad:t=>{t.target&&this.props.onImageLoaded(t.target)}})}}class Vc extends B.default.Component{constructor(){super(...arguments),this.animating=!1}width(){return this.container.offsetWidth-2*this.container.offsetLeft}height(){return this.container.offsetHeight-2*this.container.offsetTop}isAnimating(){return this.animating}render(){const{size:t,imageMargin:e,rotations:n,scale:i,duration:o}=this.props,r=90*(n-1),a=90*n;this.previousScale||(this.previousScale=1);const s=bt.b`
34
+ `;return W.default.createElement("div",{style:{top:0,left:0,width:"100%",height:"100%",position:"absolute",display:"flex",justifyContent:"center",alignItems:"center",zIndex:100}},W.default.createElement(t,{width:"101",height:"100",viewBox:"0 0 101 100",fill:"none",xmlns:"http://www.w3.org/2000/svg"},W.default.createElement("circle",{cx:"50.5",cy:"50",r:"50",fill:"#3E3E3E","fill-opacity":"0.35"}),W.default.createElement("path",{d:"M90.5153 49.6094C91.715 49.6094 92.6933 50.5827 92.6321 51.7808C92.1218 61.7815 88.0988 71.3096 81.2342 78.6635C73.8743 86.548 63.7963 91.3454 53.036 92.0868C42.2757 92.8282 31.6351 89.4582 23.2634 82.6576C15.455 76.3147 10.1633 67.4283 8.28624 57.5922C8.06135 56.4138 8.89694 55.3155 10.0853 55.1509C11.2737 54.9864 12.3642 55.8183 12.5959 56.9954C14.3176 65.7412 19.0487 73.6367 26.0026 79.2856C33.5201 85.3922 43.0751 88.4183 52.7374 87.7526C62.3998 87.0869 71.4494 82.7789 78.0584 75.699C84.1719 69.1497 87.7754 60.68 88.2814 51.7807C88.3495 50.5829 89.3156 49.6094 90.5153 49.6094Z",fill:"white"}),W.default.createElement("path",{d:"M40.7013 23.4514C40.2751 22.2667 40.8885 20.9518 42.1022 20.6166C45.5928 19.6526 49.2351 19.3251 52.8537 19.6567C57.2305 20.0577 61.4662 21.4131 65.2628 23.6273C69.0594 25.8416 72.3246 28.861 74.8286 32.4731C77.3326 36.0851 79.0146 40.2021 79.7562 44.5341C80.4978 48.8662 80.281 53.3082 79.121 57.5475C77.9611 61.7868 75.8862 65.7204 73.0423 69.0714C70.1985 72.4225 66.6548 75.1095 62.6606 76.9436C59.3583 78.4599 55.8145 79.3627 52.202 79.6146C50.9459 79.7022 49.9301 78.6662 49.9379 77.4072C49.9457 76.1481 50.9746 75.1443 52.2293 75.0398C55.1749 74.7942 58.0613 74.0382 60.758 72.8C64.1467 71.244 67.1532 68.9642 69.5659 66.1212C71.9787 63.2781 73.7391 59.9408 74.7232 56.3442C75.7073 52.7475 75.8912 48.9789 75.262 45.3035C74.6328 41.6281 73.2058 38.1353 71.0814 35.0708C68.957 32.0062 66.1867 29.4445 62.9657 27.5659C59.7446 25.6873 56.151 24.5374 52.4377 24.1972C49.4828 23.9265 46.5092 24.1737 43.6497 24.9219C42.4316 25.2406 41.1274 24.6362 40.7013 23.4514Z",fill:"white"}),W.default.createElement("path",{d:"M39.9232 61.6554C39.1643 62.5529 37.8105 62.673 37.0094 61.813C35.7171 60.4259 34.6502 58.8388 33.8523 57.1092C32.7564 54.7336 32.1944 52.1468 32.206 49.5307C32.2175 46.9146 32.8022 44.3328 33.9189 41.967C35.0356 39.6011 36.6573 37.5088 38.6697 35.8372C40.6822 34.1656 43.0365 32.9554 45.567 32.2916C48.0975 31.6279 50.7428 31.5268 53.3166 31.9954C55.8904 32.464 58.3303 33.4911 60.4644 35.0042C62.0183 36.1059 63.3827 37.4458 64.5093 38.9707C65.2077 39.916 64.8412 41.2247 63.8197 41.8061C62.7982 42.3875 61.5108 42.0174 60.7778 41.0986C59.9824 40.1015 59.0489 39.2181 58.0027 38.4763C56.3759 37.3229 54.5161 36.5401 52.5541 36.1828C50.5922 35.8256 48.5758 35.9027 46.6469 36.4086C44.7179 36.9146 42.9233 37.8371 41.3893 39.1113C39.8553 40.3855 38.6192 41.9804 37.7679 43.7838C36.9167 45.5872 36.471 47.5552 36.4622 49.5494C36.4534 51.5436 36.8818 53.5154 37.7172 55.3262C38.2544 56.4908 38.9515 57.5705 39.7858 58.5353C40.5545 59.4244 40.6821 60.7579 39.9232 61.6554Z",fill:"white"})))}}class Xs extends W.default.Component{render(){return this.props.text?W.default.createElement("div",{style:{position:"absolute",top:this.props.top,bottom:this.props.bottom,display:"flex",width:"100%",justifyContent:"center"}},W.default.createElement("div",{style:{padding:"5px 10px",borderRadius:5,backgroundColor:St.TransparentGray,color:St.White,fontWeight:500,fontSize:13}},this.props.text)):null}}class $s extends W.default.Component{constructor(t){super(t),this.state={element:t.element}}style(t){this.customStyle=t,this.forceUpdate()}update(t){this.setState({element:t})}formatText(t,e){if("None"!==e)return"Text"===e?t.text:t.format+" ("+t.text+")"}render(){var t,e,n,o,i;const r=this.state.element,a=this.props.configuration.style,s=this.formatText(r.code,this.props.configuration.textFormat),l=ws.a.width(null!==(t=this.props.animateToPoints)&&void 0!==t?t:r.points);if(!s)return null;if(!r.points)return null;const c=null!==(n=null===(e=this.customStyle)||void 0===e?void 0:e.backgroundColor)&&void 0!==n?n:r.highlighted?a.highlightedTextBackgroundColor:a.textBackgroundColor,u=null!==(i=null===(o=this.customStyle)||void 0===o?void 0:o.textColor)&&void 0!==i?i:r.highlighted?a.highlightedTextColor:a.textColor;return W.default.createElement(Cs.div,{ref:t=>this.label=t,onClick:()=>{this.props.onClick&&this.props.onClick(r)},style:{x:ws.a.lowestX(r.points),y:ws.a.highestY(r.points)+3,backgroundColor:c,fontSize:12,width:l,overflow:"hidden",color:u,borderRadius:5,position:"absolute",padding:"3px 7px",textAlign:"center",maxHeight:50,lineBreak:"anywhere",lineHeight:"22px",WebkitLineClamp:2,display:"-webkit-box",WebkitBoxOrient:"vertical"},animate:this.props.animateToPoints?{x:ws.a.lowestX(this.props.animateToPoints),y:ws.a.highestY(this.props.animateToPoints)+30}:{}},s)}}class Ks{constructor(){this.defaultFillColor="rgba(255, 0, 0, 0.3)",this.defaultHighlightedFillColor="rgba(0, 255, 0, 0.3)",this.polygonStrokeColor="rgba(255, 0, 0, 1)",this.polygonFillColor=this.defaultFillColor,this.polygonStrokeWidth=1,this.polygonCornerRadius=0,this.highlightedPolygonStrokeColor="rgba(0, 255, 0, 1)",this.highlightedPolygonFillColor=this.defaultHighlightedFillColor,this.highlightedPolygonStrokeWidth=2,this.highlightedPolygonCornerRadius=0,this.textColor="white",this.textBackgroundColor="rgba(255, 0, 0, 0.9)",this.highlightedTextColor="white",this.highlightedTextBackgroundColor="rgba(0, 255, 0, 0.9)"}}class Js{constructor(){this.visible=!1,this.textFormat="Text",this.automaticSelectionEnabled=!1,this.style=new Ks}}class tl{constructor(){this.topLabelTop=20,this.sheetHeight="95%",this.sheetTopMargin="10%"}}class el{constructor(){this.enabled=!1,this.style=new tl}}class nl extends O.a{constructor(){super(_.a.DEFAULT_VIDEO_RESOLUTION_HD),this.captureDelay=1e3,this.overlay=new Js,this.detectionParameters=new T.BarcodeScannerTypes.BarcodeScannerConfiguration,this.scanAndCount=new el,this.onBarcodesDetected=function(t){}}static fromJson(t){const e=new nl;return this.mapValues(t,e,["style","videoConstraints","overlay","scanAndCount","finder","userGuidance"]),this.mapFinderConfiguration(e,t),t.overlay&&(this.mapValues(t.overlay,e.overlay,["style"]),t.overlay.style&&this.mapValues(t.overlay.style,e.overlay.style)),t.scanAndCount&&(this.mapValues(t.scanAndCount,e.scanAndCount,["style"]),t.scanAndCount.style&&this.mapValues(t.scanAndCount.style,e.scanAndCount.style)),this.mapVideoConstraints(t,e),e}}class ol{constructor(t){this.coreResult=t,this.barcodes=[],this.originalImageSize=null,this.barcodes=t.barcodes,t.originalImage&&(this.originalImageSize=new Ys.a(t.originalImage.width,t.originalImage.height))}isEmpty(){return 0===this.barcodes.length}}class il{static warn(t){console.warn("[ScanbotSDK]",t)}}class rl{static convertLinesToViewportLines(t,e){if(e&&t)return e.map((e=>({start:new ws.a(e.start.x*t.width,e.start.y*t.height),end:new ws.a(e.end.x*t.width,e.end.y*t.height)})))}static convertToViewportPointsFromParentSize(t,e){return e?Ys.a.isEmpty(t)?void 0:e.map((e=>ws.a.scaleUpTo(e,t))):Ys.a.toPolygon(t)}static calculateScale(t){let e,n=0,o=0;return 1>t.width/t.height?(e=t.height/1,n=(1-t.width/e)/2):(e=t.width/1,o=(1-t.height/e)/2),{x:n,y:o,containerScale:e}}static findScale(t,e){let n,o=0,i=0;return e.ratio(!0)>t.ratio(!0)?(n=t.width/e.width,i=(e.height-t.height/n)/2):(n=t.height/e.height,o=(e.width-t.width/n)/2),{x:o,y:i,scale:n}}static preventDefaultCallback(t){t.preventDefault()}static disableScreenMovement(){document.addEventListener("touchmove",rl.preventDefaultCallback,{passive:!1}),document.body.scrollTop=document.documentElement.scrollTop=0,document.documentElement.style.overflow="hidden"}static enableScreenMovement(){document.removeEventListener("touchmove",rl.preventDefaultCallback),document.documentElement.style.overflow="auto"}static findContainerOrThrow(t){var e;const n=null!==(e=t.container)&&void 0!==e?e:document.getElementById(t.containerId);if(!n)throw Error("Unable to initialize scanner: Cannot find container element either from 'container' property or with the containerId property provided.");return n}}var al=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};ht.a;ht.b;class sl extends ht.c{constructor(t){var e;super(t),this.shouldComputeSize=!0,this.paused=!1,this.barcodeRecognizerHandle=null,this.barcodes=[],this.detectionRunning=!1,this.updateDimensionsCallback=this.updateDimensions.bind(this),this.backendurl=void 0,this.desiredRecognitionResolution=void 0,this.desiredRecognitionResolution=this.configuration.desiredRecognitionResolution,Object.assign(this.state,{isFinderVisible:null===(e=this.configuration.finder.visible)||void 0===e||e,zoom:void 0,action:"manual",image:void 0,bottomHintText:void 0})}get configuration(){return this._configuration||(this._configuration=nl.fromJson(this.props.configuration)),this._configuration}get enabled(){return!this.disposed}static create(t){return al(this,void 0,void 0,(function*(){const e=rl.findContainerOrThrow(t);return new Promise(((n,o)=>{Object(W.render)(W.default.createElement(sl,{container:e,configuration:t,onSuccess:n,onFailure:o}),e)}))}))}isDetectionPaused(){return this.paused}resumeDetection(){return al(this,void 0,void 0,(function*(){il.warn("Barcode detection resumed"),yield this.resume()}))}pauseDetection(){il.warn("Barcode detection paused"),this.pause()}componentDidMount(){const t=Object.create(null,{componentDidMount:{get:()=>super.componentDidMount}});return al(this,void 0,void 0,(function*(){t.componentDidMount.call(this),window.addEventListener("resize",this.updateDimensionsCallback),yield this.resume()}))}componentWillUnmount(){super.componentWillUnmount(),this.pause(),window.removeEventListener("resize",this.updateDimensionsCallback),this.barcodeRecognizerHandle&&this.bridge.copyArgs.releaseObject(this.barcodeRecognizerHandle).catch((t=>{var e,n;return null===(n=(e=this.props.configuration).onError)||void 0===n?void 0:n.call(e,t)}))}updateDimensions(){return al(this,void 0,void 0,(function*(){this.shouldComputeSize=!0,this.forceUpdate()}))}resume(){return al(this,void 0,void 0,(function*(){this.paused=!1,yield this.detect()}))}pause(){this.paused=!0}detect(){var t,e,n,o,i;return al(this,void 0,void 0,(function*(){if(!this.enabled)return;if(this.paused)return;if(null===(t=this.configuration.scanAndCount)||void 0===t?void 0:t.enabled)return;if(this.detectionRunning)return;let r=!1;try{this.detectionRunning=!0;const t=yield this.recognizeBarcodes(!0,this.shouldComputeSize);if(this.shouldComputeSize=!1,!t)return;const a=new ol(t);a.isEmpty()?this.configuration._onDetectionFailed&&(null===(e=this.configuration)||void 0===e||e._onDetectionFailed(t.originalImage)):(r=!0,this.configuration.overlay.visible||this.configuration.onBarcodesDetected(a)),null===(n=this.overlay)||void 0===n||n.update(null===(o=this.finder)||void 0===o?void 0:o.holeRect,this.camera,a.originalImageSize,a.barcodes)}catch(t){console.log(t)}finally{this.detectionRunning=!1;const t=()=>requestAnimationFrame((()=>this.detect())),e=(null===(i=this.configuration.overlay)||void 0===i?void 0:i.visible)?0:this.configuration.captureDelay;r&&0!=e?setTimeout(t,e):t()}}))}setUseBackendService(t){console.log("Now using backend service for recognition: ",t),this.backendurl=t}recognizeBarcodes(t,e){var n,o,i,r,a,s,l,c;return al(this,void 0,void 0,(function*(){try{window&&window.__SB_DEBUG_BARCODESCANNER_FORCE_DETERMINISTIC_MODE&&(t=!1);const l=t?ht.c.DEFAULT_DETECTION_RESOLUTION:ht.c.DETECTION_RESULTION_4K,c=null!==(n=this.desiredRecognitionResolution)&&void 0!==n?n:l;this.camera.finderFrame=null===(o=this.finder)||void 0===o?void 0:o.holeRect;const u=yield null===(i=this.camera)||void 0===i?void 0:i.createImageData(c,!1);if(!u)return;e&&this.forceUpdate(),(null===(r=this.configuration.scanAndCount)||void 0===r?void 0:r.enabled)&&(this.setState({image:b.wrapperToBase64(u)}),void 0!==this.desiredRecognitionResolution?console.log("Recognizing barcodes with custom resolution:",this.desiredRecognitionResolution):console.log("Recognizing barcodes with max resolution:",ht.c.DETECTION_RESULTION_4K,"(the actual resolution depends on your device and may be lower)"));new Ys.a(u.width,u.height);this.barcodeRecognizerHandle||(this.barcodeRecognizerHandle=yield this.bridge.copyArgs.createBarcodeRecognizer(new T.BarcodeScannerTypes.BarcodeScannerConfiguration(Object.assign(Object.assign({},this.configuration.detectionParameters),{live:t}))));const d=yield this.bridge.transferArgs.recognizeBarcodes(this.barcodeRecognizerHandle,u);if(!this.enabled)return;return null===d?void(null===(s=(a=this.props).onLicenseError)||void 0===s||s.call(a)):(this.camera.reusableImageBuffer=d.originalImage.data,d)}catch(t){return void(null===(c=(l=this.props.configuration).onError)||void 0===c||c.call(l,t))}}))}setRecognitionResolution(t){this.desiredRecognitionResolution=t}getResolution(){return al(this,void 0,void 0,(function*(){return new Promise(((t,e)=>{const n=this.camera.videoSize();n.width>0&&n.height>0?t(Ys.a.fromJson(n)):this.camera.didLoadVideo=()=>{const e=this.camera.videoSize();t(Ys.a.fromJson(e))}}))}))}saveExtractedImageData(){this.camera.saveExtractedData()}setFinderVisible(t){this.setState({isFinderVisible:t})}setZoom(t){this.setState({zoom:t})}setCameraDirection(t){this.camera.setDirection(t)}updateTorch(t){this.camera.videoStream.updateTorch(t)}getCapabilities(){return this.camera.videoStream.getCapabilities()}render(){var t,e,n,o,i,r,a;const s=(null===(t=this.configuration.scanAndCount)||void 0===t?void 0:t.enabled)?"Tap the shutter button to scan":void 0;return W.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",backgroundColor:"black",minHeight:"100px"}},this.renderSpinner(null===(e=this.configuration)||void 0===e?void 0:e.spinnerColor),W.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%"}},W.default.createElement(ft.a,{configuration:this.configuration,videoConstraints:this.configuration.videoConstraints,mirrored:this.configuration.mirrored,preferredCamera:this.configuration.preferredCamera,zoom:null!==(n=this.state.zoom)&&void 0!==n?n:this.configuration.zoom,onReady:this.onVideoReady,onError:this.onVideoError,ref:t=>{this.camera=t}})),W.default.createElement(Xs,{top:null===(o=this.configuration.scanAndCount)||void 0===o?void 0:o.style.topLabelTop,text:s}),W.default.createElement(Zs,{ref:t=>this.scannedImage=t,image:this.state.image}),this.state.isFinderVisible&&W.default.createElement(pt.a,{ref:t=>{this.finder=t},padding:this.props.viewFinderPadding,guidanceConfiguration:this.configuration.userGuidance,configuration:this.configuration.finder}),W.default.createElement(Xs,{bottom:100,text:this.state.bottomHintText}),W.default.createElement(qs,{visible:"processing"===this.state.action}),(null===(i=this.configuration.overlay)||void 0===i?void 0:i.visible)&&W.default.createElement(Fs,{ref:t=>{t&&(this.overlay=t)},configuration:this.configuration.overlay,onPolygonSelected:t=>{const e=new ol({barcodes:[t]});this.configuration.onBarcodesDetected(e)},onBarcodeFound:(t,e,n)=>{var o;(null===(o=this.configuration.overlay)||void 0===o?void 0:o.onBarcodeFound)&&this.configuration.overlay.onBarcodeFound(t,e,n)},LabelComponent:$s,labelComponentConfig:{}}),(null===(r=this.configuration.scanAndCount)||void 0===r?void 0:r.enabled)&&W.default.createElement(Gs,{ref:t=>this.bottomActionBar=t,action:this.state.action,isShowingImage:void 0!==this.state.image,onBurgerClick:()=>{this.popup.push(Ct.PushBottom,this.barcodes)},onShutterButtonClick:()=>al(this,void 0,void 0,(function*(){(new y).flash(),this.setState({action:"processing"});const t=(new Date).getTime();let e=yield this.recognizeBarcodes(!1,!1);const n=new ol(null!=e?e:{barcodes:[]});console.log("Recognition took:",((new Date).getTime()-t)/1e3);const o=this.countLabelText(n.barcodes);this.setState({action:"manual",bottomHintText:o}),this.scannedImage.update(n),this.barcodes.push(...n.barcodes),this.bottomActionBar.update(this.barcodes),n.barcodes.length>0&&this.configuration.onBarcodesDetected(n)})),onScanMoreClick:()=>{this.resetCountImage()}}),W.default.createElement(wt,{ref:t=>this.popup=t,style:null===(a=this.configuration.scanAndCount)||void 0===a?void 0:a.style,onDeleteClick:()=>{if(confirm("Are you sure you want to delete all scanned barcodes?")){for(;this.barcodes.length>0;)this.barcodes.pop();console.log("Cleared barcodes",this.barcodes.length),this.popup.update(this.barcodes),this.bottomActionBar.update(void 0),this.resetCountImage(),this.popup.reset()}}}))}resetCountImage(){this.scannedImage.reset(),this.setState({image:void 0,bottomHintText:void 0})}countLabelText(t){return 0==t.length?"No codes scanned. Try again?":1==t.length?"1 Code Scanned":`${t.length} Codes Scanned`}}function ll(t,e){return t&&(t.hasFacingOptions&&e.flipCameraButton.visible||t.isTorchAvailable&&e.flashButton.visible)||e.zoomButton.visible}function cl(t){const e=t.zoomSteps.findIndex((e=>e==t.defaultZoomFactor)),[n,o]=Object(W.useState)(t.torchEnabledInitially),[i,r]=Object(W.useState)(e),a=t.zoomSteps[i],[s,l]=Object(W.useState)("BACK"==t.initialCameraModule?"environment":"user"),c=function(t){var e,n;const o=null===(n=null===(e=null==t?void 0:t.camera)||void 0===e?void 0:e.video)||void 0===n?void 0:n.parentElement,i=()=>o?o.getBoundingClientRect():null,[r,a]=Object(W.useState)(i());return Object(W.useEffect)((()=>{if(o){const t=()=>a(i());t();const e=new ResizeObserver(t);return e.observe(o),()=>{e.disconnect()}}}),[o]),r}(t.scanner),u=!!c;if(Object(W.useEffect)((()=>{var e;(null===(e=t.capabilities)||void 0===e?void 0:e.isTorchAvailable)&&u&&t.scanner.setTorchState(n)}),[t.capabilities,u,n]),Object(W.useEffect)((()=>{var e;u&&(null===(e=t.scanner)||void 0===e||e.setZoom(a))}),[u,a]),!t.capabilities||!c)return null;if(!ll(t.capabilities,t.config))return null;const d=c.height-t.bottomPadding-48;return W.default.createElement(z.Box,{style:{position:"absolute",marginTop:d,marginLeft:c.width/2,transform:"translateX(-50%)",display:"flex",justifyContent:"center",zIndex:1e3}},W.default.createElement(at,Object.assign({},t.config.flashButton,{visible:t.capabilities.isTorchAvailable&&t.config.flashButton.visible,icon:n?z.FlashlightOn:z.FlashlightOff,active:n,onClick:()=>o(!n)})),W.default.createElement("div",{style:{width:20}}),W.default.createElement(at,Object.assign({},t.config.zoomButton,{text:`${a.toFixed(1)}x`,active:i!==e,onClick:()=>r((i+1)%t.zoomSteps.length)})),W.default.createElement("div",{style:{width:20}}),W.default.createElement(at,Object.assign({},t.config.flipCameraButton,{visible:t.capabilities.hasFacingOptions&&t.config.flipCameraButton.visible,active:"user"===s,icon:z.FlipCameraIos,onClick:()=>{var e;const n="environment"===s?"user":"environment";l(n),null===(e=t.scanner)||void 0===e||e.setCameraDirection(n)}})))}const ul=Object(W.createContext)(null);class dl{static compute(t,e,n){const o=(ws.a.lowestY(t)+ws.a.highestY(t))/2,i={badgeY:o,badgeStyle:{transform:"translateX(-50%) translateY(-50%)"}};return"BELOW"===n?Object.assign(Object.assign({},i),{labelY:Math.max(ws.a.highestY(t)+dl.LABEL_AND_BADGE_PADDING,e?o-dl.AR_BADGE_SIZE/2-dl.LABEL_AND_BADGE_PADDING:-1/0),labelStyle:{transform:"translateX(-50%)"}}):"ABOVE"===n?Object.assign(Object.assign({},i),{labelY:Math.min(ws.a.lowestY(t)-dl.LABEL_AND_BADGE_PADDING,e.visible?o+dl.AR_BADGE_SIZE/2+dl.LABEL_AND_BADGE_PADDING:1/0),labelStyle:{transform:"translateX(-50%) translateY(-100%)"}}):"STACKED"===n?{badgeY:o,badgeStyle:{transform:`translateX(-50%) translateY(calc(-100% - ${dl.LABEL_AND_BADGE_PADDING/2}px))`},labelY:o,labelStyle:{transform:e.visible?`translateX(-50%) translateY(${dl.LABEL_AND_BADGE_PADDING/2}px)`:"translateX(-50%) translateY(-50%)"}}:"DISABLED"===n?Object.assign(Object.assign({},i),{labelY:0,labelStyle:{display:"none"}}):void 0}}dl.AR_BADGE_SIZE=48,dl.LABEL_AND_BADGE_PADDING=10;var hl=dl;function fl(t){return t.style.visible?""==t.content?null:W.default.createElement(Cs.div,{style:Object.assign({position:"absolute",display:"flex",justifyContent:"center",alignItems:"center",zIndex:100},t.positionBadge),animate:t.animateToPoints?t.positionBadge:{},transition:t.transition},W.default.createElement(Z,{styleConfig:Object.assign(Object.assign({},t.style.background),{cornerRadius:hl.AR_BADGE_SIZE/2}),style:Object.assign(Object.assign({},t.verticalPositions.badgeStyle),{width:hl.AR_BADGE_SIZE,height:hl.AR_BADGE_SIZE,color:V.b.getColorValue(t.style.foregroundColor),display:"flex",justifyContent:"center",alignItems:"center",zIndex:1500,cursor:"pointer"}),onClick:()=>null==t?void 0:t.onClick()},W.default.createElement(z.Typography,{fontSize:16,fontWeight:"500",style:{display:"flex",justifyContent:"center",alignItems:"center"}},t.content))):null}var pl=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(n[o[i]]=t[o[i]])}return n};class ml extends $s{constructor(){super(...arguments),this.count=0,this.setCount=t=>{this.count=t,this.forceUpdate()}}styleBadge(t,e){this.customBadgeStyle=t,this.customBadgeContent=e,this.forceUpdate()}badgeContent(){return this.customBadgeContent?this.customBadgeContent:0===this.count?"":"x"+this.count}render(){var t,e;let{barcodeItemConfiguration:n,barcodeItemInfoPosition:o,counterBadge:i}=this.props;const r=n,a=this.state.element,s=null!==(t=this.props.animateToPoints)&&void 0!==t?t:a.points,l=a.code,c=a.highlighted,u=(ws.a.lowestX(s)+ws.a.highestX(s))/2;void 0===o&&(o="BELOW");const d=hl.compute(s,i,o),h=void 0===r||!1===r.titleDeselected.visible&&!1===r.subtitleDeselected.visible,f={x:u,y:Math.round(d.labelY)},p={x:u,y:Math.round(d.badgeY)},m={duration:.25,easing:"linear"};return W.default.createElement(W.default.Fragment,null,r&&W.default.createElement(Cs.div,{ref:t=>this.label=t,style:Object.assign(Object.assign({},f),{position:"absolute",width:"100%",zIndex:100}),animate:this.props.animateToPoints?f:{},transition:m},W.default.createElement(Z,{sx:Object.assign({p:1,maxWidth:232,cursor:"pointer",display:h?"inline-block":"block",zIndex:1500},d.labelStyle),styleConfig:c?r.backgroundSelected:r.backgroundDeselected,"data-sb-ar-barcode-info":"1",onClick:()=>{var t;return null===(t=this.props)||void 0===t?void 0:t.onClick(a)}},W.default.createElement(gl,{barcode:l,barcodeImageVisible:r.imageVisible,maxNumberOfTitleLines:1,maxNumberOfSubtitleLines:1,imageSize:42,displayRightArrow:!0,barcodeTitle:c?r.titleSelected:r.titleDeselected,barcodeSubtitle:c?r.subtitleSelected:r.subtitleDeselected}))),W.default.createElement(fl,{onClick:()=>{var t;return null===(t=this.props)||void 0===t?void 0:t.onClick(a)},style:null!==(e=this.customBadgeStyle)&&void 0!==e?e:i,positionBadge:p,content:this.badgeContent(),verticalPositions:d,transition:m,animateToPoints:this.props.animateToPoints}))}}function gl(t){var{barcode:e}=t,n=pl(t,["barcode"]);const o=Object(W.useContext)(ul).useBarcodeMappedData(e);return W.default.createElement(tt,Object.assign({barcodeMappedData:o},n))}var vl=n(8);function Al(t){const e=Object(W.useRef)(),n=Object(W.useRef)(null),[o,i]=(Object(W.useContext)(X),Object(W.useState)(void 0)),[r,a]=Object(W.useState)(!1);Object(W.useEffect)((()=>{var n,o;t.scanningPaused?null===(n=e.current)||void 0===n||n.pause():null===(o=e.current)||void 0===o||o.resume()}),[t.scanningPaused]);const s=function(t){const e=new Js;e.visible=t.visible;const n=t.polygon instanceof vl.c,o=t.polygon,i=t,r=n?o.selected:i.polygon.partiallyScanned,a=n?o.deselected:i.polygon.partiallyScanned;return t.polygon.visible?(e.style.highlightedPolygonFillColor=V.b.getColorValue(r.fillColor),e.style.highlightedPolygonStrokeColor=V.b.getColorValue(r.strokeColor),e.style.highlightedPolygonStrokeWidth=r.strokeWidth,e.style.highlightedPolygonCornerRadius=r.cornerRadius,e.style.polygonFillColor=V.b.getColorValue(a.fillColor),e.style.polygonStrokeColor=V.b.getColorValue(a.strokeColor),e.style.polygonStrokeWidth=a.strokeWidth,e.style.polygonCornerRadius=a.cornerRadius):(e.style.highlightedPolygonFillColor="transparent",e.style.highlightedPolygonStrokeColor="transparent",e.style.polygonFillColor="transparent",e.style.polygonStrokeColor="transparent"),e.automaticSelectionEnabled=!1,e}(t.arOverlay),l=Object.assign(Object.assign({},t.barcodeScannerViewConfig),{onBarcodesDetected:o=>{var i,r,a,s,l,c;null===(i=n.current)||void 0===i||i.update(null===(a=null===(r=e.current)||void 0===r?void 0:r.finder)||void 0===a?void 0:a.holeRect,null===(s=e.current)||void 0===s?void 0:s.camera,o.originalImageSize,o.barcodes),null===(c=(l=t.barcodeScannerViewConfig).onBarcodesDetected)||void 0===c||c.call(l,o)},_onDetectionFailed:o=>{var i,r,a,s,l,c;null===(i=n.current)||void 0===i||i.update(null===(a=null===(r=e.current)||void 0===r?void 0:r.finder)||void 0===a?void 0:a.holeRect,null===(s=e.current)||void 0===s?void 0:s.camera,new Ys.a(o.width,o.height),[]),null===(c=(l=t.barcodeScannerViewConfig)._onDetectionFailed)||void 0===c||c.call(l,o)}});return Object(W.useEffect)((()=>{const e=ll(o,t.actionBarConfig);t.setActionButtonsVisible(e),a(e)}),[o,t.actionBarConfig]),W.default.createElement(W.default.Fragment,null,t.arOverlay.visible&&W.default.createElement(Fs,{style:{zIndex:1e3,position:"absolute"},ref:n,LabelComponent:ml,labelComponentConfig:t.arOverlay,onBarcodeFound:t.arOnBarcodeEnter,onPolygonClick:t.arOnBarcodeClick,configuration:s}),W.default.createElement(cl,{config:t.actionBarConfig,scanner:e.current,capabilities:o,bottomPadding:t.actionBarBottomPadding,torchEnabledInitially:t.cameraConfiguration.flashEnabled,zoomSteps:t.cameraConfiguration.zoomSteps,defaultZoomFactor:t.cameraConfiguration.defaultZoomFactor,initialCameraModule:t.cameraConfiguration.cameraModule}),W.default.createElement(sl,{ref:e,viewFinderPadding:t.viewFinderPadding,configuration:l,onSuccess:()=>class{static setFromScanner(t,e){var n;if(!t.current)return;const o=t.current.getCapabilities();e({hasFacingOptions:(null==o?void 0:o.facingMode)&&o.facingMode.length>0,isTorchAvailable:null!==(n=t.current.getActiveCameraInfo().supportsTorchControl)&&void 0!==n&&n})}}.setFromScanner(e,i),onFailure:t.onCameraPermissionDenied,onLicenseError:t.onLicenseError}))}function bl(t){return Object(W.useMemo)((()=>{const e=(new nl).videoConstraints;return e.width.ideal=t.cameraConfiguration.idealPreviewResolution.width,e.height.ideal=t.cameraConfiguration.idealPreviewResolution.height,e.facingMode="FRONT"===t.cameraConfiguration.cameraModule?"user":"environment",{videoConstraints:e,backgroundColor:V.b.getColorValue(t.backgroundColor),userGuidance:t.userGuidance,finder:t.viewFinder,detectionParameters:new T.BarcodeScannerTypes.BarcodeScannerConfiguration({live:!0,engineMode:t.recognizerConfiguration.engineMode,barcodeFormatConfigurations:[new T.BarcodeConfigs.BarcodeFormatCommonConfiguration({formats:t.recognizerConfiguration.barcodeFormats.length>0?t.recognizerConfiguration.barcodeFormats:void 0,regexFilter:t.recognizerConfiguration.barcodesRegexFilter,gs1Handling:t.recognizerConfiguration.gs1Handling})]}),desiredRecognitionResolution:t.recognizerConfiguration.maximumRecognizerResolution}}),[t])}var yl=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};function Cl(t){const[e,n]=Object(W.useState)(null),[o,i]=Object(W.useState)(!0),r=Object(W.useMemo)((()=>"__sb_"+Math.random()),[]),a=t.barcodeMapper,s=t.configuration.useCase,l=Object.assign(Object.assign({},bl(t.configuration)),{onBarcodesDetected:e=>{e.barcodes.length>0&&!s.arOverlay.visible&&t.scanningEnabled.current&&n(e.barcodes[0])},onError:t.onError,containerId:r,captureDelay:0}),c=n=>yl(this,void 0,void 0,(function*(){let o;o=null===e?[]:[new j.BarcodeScannerUIItem({count:1,barcode:n})];const i={items:o};t.onSubmit(i)}));Object(W.useEffect)((()=>{e&&(ct.INSTANCE.beep(t.configuration.sound),dt.INSTANCE.vibrate(t.configuration.vibration))}),[e]),Object(W.useEffect)((()=>{null===e||s.confirmationSheetEnabled||c(e)}),[e,s.confirmationSheetEnabled]);const u=a.useBarcodeMappedData(e);Object(W.useEffect)((()=>{"FAILED"===(null==u?void 0:u.state)&&n(null)}),[null==u?void 0:u.state]);const d=Object(W.useContext)(X);return W.default.createElement(W.default.Fragment,null,W.default.createElement(ul.Provider,{value:t.barcodeMapper},W.default.createElement(it,Object.assign({open:!!u&&["LOADED","LOADING"].includes(u.state)&&s.confirmationSheetEnabled,handleCancel:()=>{n(null)},handleSubmit:()=>{c(e)},barcodeMappedData:u},{sheetColorLoaded:(h=s).sheetColor,sheetColorLoading:h.barcodeInfoMapping.sheetColor,barcodeImageVisible:h.barcodeImageVisible,barcodeTitle:h.barcodeTitle,barcodeSubtitle:h.barcodeSubtitle,cancelButton:h.cancelButton,submitButton:h.submitButton,dividerColor:h.dividerColor,loadingMessage:h.barcodeInfoMapping.loadingMessage},{displayRightArrow:!1,modalOverlayColor:s.modalOverlayColor})),W.default.createElement(z.Box,{id:r,sx:{width:"100%",height:d.remainingVisibleBodyHeight}},W.default.createElement(Al,{cameraConfiguration:t.configuration.cameraConfiguration,scanningPaused:null!==e,setActionButtonsVisible:i,viewFinderPadding:{minTopPadding:d.minTopPaddingForViewFinder,minBottomPadding:o?80:0},barcodeScannerViewConfig:l,arOnBarcodeClick:t=>n(t),arOnBarcodeEnter:e=>{s.arOverlay.automaticSelectionEnabled&&t.scanningEnabled.current&&n(e)},arOverlay:Object.assign(Object.assign({},s.arOverlay),{counterBadge:Object.assign(Object.assign({},s.arOverlay.counterBadge),{visible:!1})}),containerId:r,actionBarConfig:t.configuration.actionBar,actionBarBottomPadding:16,onCameraPermissionDenied:t.onCameraPermissionDenied,onLicenseError:t.onError}))));var h}function Sl(t){const e=Object.assign(Object.assign({},t.title),{text:V.b.getLocalizedBarcodeText(t.title.text,t.textReplacementArgs)});return W.default.createElement(W.default.Fragment,null,W.default.createElement(q,Object.assign({},t.leftButton)),W.default.createElement(z.Typography,{sx:{flex:2,textAlign:"center",fontWeight:600,fontSize:18}},W.default.createElement(Q.a,{config:e})),W.default.createElement(q,Object.assign({},t.rightButton)))}function wl(){return W.default.createElement("div",{style:{width:30,height:6,backgroundColor:z.grey[300],borderRadius:3,position:"absolute",top:8,left:"calc(50% - 15px)"},"data-sb-drawer-puller":"1"})}function xl(t){return W.default.createElement(z.Box,Object.assign({sx:{display:"flex",width:"100%",alignItems:"center",justifyContent:"center",paddingTop:2,paddingBottom:1,touchAction:"none"},ref:t.innerRef},t.dragProps),W.default.createElement(wl,null),W.default.createElement(Sl,Object.assign({},t.drawerHeaderContentProps)))}function El(t){return W.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"41",height:"38",viewBox:"0 0 41 38",fill:"none"},W.default.createElement("path",{d:"M4.09514 37.0902V10.6304L0.019043 1.87823L3.18969 0.348877L7.76144 10.6304H32.6886L37.2484 0.348877L40.419 1.87823L36.3549 10.6304V37.0902H4.09514ZM15.994 22.013H24.494C24.9461 22.013 25.3211 21.8632 25.619 21.5637C25.9169 21.2641 26.0658 20.8871 26.0658 20.4325C26.0658 19.9779 25.9169 19.6038 25.619 19.3101C25.3211 19.0164 24.9461 18.8695 24.494 18.8695H15.994C15.5419 18.8695 15.167 19.0193 14.8691 19.3189C14.5712 19.6184 14.4223 19.9955 14.4223 20.45C14.4223 20.9046 14.5712 21.2788 14.8691 21.5725C15.167 21.8662 15.5419 22.013 15.994 22.013ZM7.50164 33.6837H32.9364V14.0489H7.50164V33.6837Z",fill:t.color}))}function Ll(t){return t.isVisible?W.default.createElement("div",{style:{display:"flex",alignItems:"center",flexDirection:"column",marginTop:"auto",marginBottom:"auto",overflowY:"scroll"}},t.style.placeholderIcon.visible&&W.default.createElement(z.Avatar,{style:{backgroundColor:V.b.getColorValue(t.style.placeholderIconBackground),width:100,height:100}},W.default.createElement(El,{color:V.b.getColorValue(t.style.placeholderIcon.color)})),W.default.createElement(z.Typography,{style:{marginTop:20},variant:"h6"},W.default.createElement(Q.a,{config:t.style.placeholderTitle})),W.default.createElement(z.Typography,{style:{marginTop:20,paddingLeft:"10%",paddingRight:"10%",maxWidth:400,textAlign:"center"},variant:"body2"},W.default.createElement(Q.a,{config:t.style.placeholderSubtitle})),t.onStartClick&&t.style.startScanningButton.visible&&W.default.createElement(et,Object.assign({style:{width:"60%",marginTop:20}},t.style.startScanningButton,{visible:!0,onClick:t.onStartClick}))):null}function _l(t,e,n){const o=Object(W.useRef)(),i=Object(W.useRef)(null),[r,a]=Object(W.useState)(),[s,l]=Object(W.useState)(!1),c=Object(W.useRef)([]),u=t=>{let n="none";if(c.current.length>0){const e=200,o=((t,e)=>{let n=t[0],o=Math.abs(n.time-e);for(let i=1;i<t.length;i++){const r=Math.abs(t[i].time-e);r<o&&(n=t[i],o=r)}return n})(c.current,t.timeStamp-e),i=o.y-t.clientY,r=100;i>r?n="up":i<-r&&(n="down")}c.current.splice(0,c.current.length),e(new ws.a(t.clientX,t.clientY),n)},d={onPointerDown:t=>{t.target.setPointerCapture(t.pointerId),l(!0),i.current=new ws.a(t.clientX,t.clientY),a(ws.a.empty()),t.stopPropagation()},onPointerMove:e=>{if(!s)return;const n=new ws.a(e.clientX,e.clientY);o.current=e,a(n),t(n),c.current.push({x:e.clientX,y:e.clientY,time:e.timeStamp})},onPointerUp:t=>{t.target.releasePointerCapture(t.pointerId),l(!1),u(t)},onPointerCancel:t=>{t.target.releasePointerCapture(t.pointerId),l(!1),n()}};return{startPoint:i,currentPoint:r,props:d,stop:()=>{o.current.stopPropagation()},dragOngoing:s}}var Ol=n(31);function Tl(t){const[e,n]=Object(W.useState)(0),[o,i]=Object(W.useState)(!1),r=Object(W.useRef)(null),a=Object(W.useContext)(X).height,s=t=>{n(t),i(!0),setTimeout((()=>{i(!1)}),500)},l=e=>{const n=e-c.startPoint.current.y;return Object(Ol.a)((t.isOpen?100:0)-100*n/(window.innerHeight-a-t.closedSheetVisibleHeight),0,100)},c=_l((t=>{n(l(t.y))}),((e,n)=>{if(e.y===c.startPoint.current.y)return;let o;o=l(e.y)<50?"swipe-to-close":"swipe-to-open","up"===n&&(o="swipe-to-open"),"down"===n&&(o="swipe-to-close"),t.onSwipe(o)}),(()=>{}));return Object(W.useEffect)((()=>{o||c.dragOngoing||!r||(t.isOpen||0===e?t.isOpen&&100!==e&&s(100):s(0))}),[t.isOpen,e,c.dragOngoing]),W.createElement("div",null,W.createElement(N.a,{variant:"persistent",anchor:"bottom",open:!0,onClose:()=>{},onOpen:()=>{},swipeAreaWidth:56,disableSwipeToOpen:!1,ModalProps:{keepMounted:!0},PaperProps:{style:{height:`calc((100 * ${U} - ${a}px - ${t.closedSheetVisibleHeight}px) * ${e} / 100 + ${t.closedSheetVisibleHeight}px)`,overflow:"hidden",borderRadius:10,borderBottomLeftRadius:0,borderBottomRightRadius:0,transition:o?"height 500ms":void 0,backgroundColor:V.b.getColorValue(t.contentStyle.sheetColor)},elevation:24}},W.createElement(xl,{innerRef:t=>{r.current=t},drawerHeaderContentProps:t.drawerHeaderContentProps,dragProps:c.props}),t.children,W.createElement(Ll,{isVisible:t.isPlaceholderVisible,style:t.contentStyle,onStartClick:()=>t.onSwipe("swipe-to-close")})))}var kl=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(n[o[i]]=t[o[i]])}return n};function Dl(t){var{inputRef:e}=t,n=kl(t,["inputRef"]);const o=Object.assign(Object.assign({},n),{style:Object.assign(Object.assign({},n.style||{}),{border:"none",display:"block",outlineWidth:0,width:"100%"})});return W.default.createElement("input",Object.assign({},o,{ref:e}))}function Pl(t){const e=!!t.barcode,[n,o]=W.default.useState(""),i=W.default.useRef(null),r={backgroundColor:V.b.getColorValue(t.dialogStyling.sheetColor)};return Object(W.useEffect)((()=>{e&&o(String(t.barcode.count))}),[e]),W.default.createElement(W.default.Fragment,null,W.default.createElement(ot,{open:e,modalOverlayColor:t.dialogStyling.modalOverlayColor,TransitionProps:{onEnter:()=>{var t;return null===(t=i.current)||void 0===t?void 0:t.focus()}},onClose:t.onCancel,PaperProps:{component:"form",onSubmit:e=>{e.preventDefault(),t.setCounter(t.barcode.barcode,parseInt(n)||0)}}},W.default.createElement(z.DialogContent,{style:r},W.default.createElement(z.Typography,{fontSize:16,fontWeight:500,textAlign:"center"},W.default.createElement(Q.a,{config:t.dialogStyling.title})),W.default.createElement(z.Typography,{fontSize:14,textAlign:"center"},W.default.createElement(Q.a,{config:t.dialogStyling.info})),W.default.createElement(z.Box,{sx:{display:"flex",border:"2px solid",borderColor:V.b.getColorValue(t.dialogStyling.dividerColor),mh:2,mb:0,p:1,borderRadius:1}},W.default.createElement(Dl,{inputRef:i,value:n,onChange:t=>{const e=parseInt(t.target.value.replaceAll(/[^0-9]/g,""));o(e>=0?e.toString():"")},type:"text",pattern:"[0-9]*"}),t.dialogStyling.clearTextButton.visible&&W.default.createElement(N.a,{sx:{marginLeft:"auto",paddingLeft:1},onClick:()=>o(""),htmlColor:V.b.getColorValue(t.dialogStyling.clearTextButton.color)}))),W.default.createElement(z.DialogActions,{sx:Object.assign(Object.assign({},r),{pt:0})},W.default.createElement(N.a,{container:!0,spacing:2},W.default.createElement(N.a,{item:!0,xs:12},W.default.createElement(N.a,{color:V.b.getColorValue(t.dialogStyling.dividerColor)})),W.default.createElement(N.a,{item:!0,xs:6},W.default.createElement(et,Object.assign({style:{width:"100%"},onClick:t.onCancel},t.dialogStyling.cancelButton))),W.default.createElement(N.a,{item:!0,xs:6},W.default.createElement(et,Object.assign({icon:z.Replay,style:{width:"100%"},onClick:()=>{},type:"submit"},t.dialogStyling.updateButton)))))))}function Bl(t){return W.default.createElement("div",{style:{top:0,width:"100%",marginTop:"1px",marginLeft:"1px",height:"calc(100% - 2px)",position:"absolute",backgroundColor:V.b.getColorValue(t.config.backgroundColor),display:"flex",alignItems:"right",justifyContent:"right"}},W.default.createElement(N.a,{style:{height:"100%",color:V.b.getColorValue(t.config.iconColor),paddingRight:t.visibleOffset/2,cursor:"pointer"}}))}const Fl=0,Rl=800,Il=1200;function Wl(t){switch(t){case"mobile":return Object(z.useMediaQuery)("(min-width:"+Fl+"px) and (max-width:"+(Rl-1)+"px)");case"tablet":return Object(z.useMediaQuery)("(min-width:"+Rl+"px) and (max-width:"+(Il-1)+"px)");case"desktop":return Object(z.useMediaQuery)("(min-width:"+Il+"px)")}}const Ml=150;function jl(t){const[e,n]=Object(W.useState)(0),[o,i]=Object(W.useState)(!1);let r;const a=_l((t=>{let e=a.startPoint.current.x-t.x;e<0?a.stop():n(-e)}),(e=>{if(e.x===a.startPoint.current.x)return;if(a.startPoint.current.x-e.x>75){const e=t.animateBackAfterDelete?()=>{c(0)}:void 0;c(Ml,e)}else c(0)}),(()=>{c(0)})),s=Object(W.useContext)(ul),l=s.useBarcodeMappedData(t.barcode);Object(W.useEffect)((()=>{const e={barcode:t.barcode,callback:()=>t.onDelete(t.barcode)};return s.addOnEvictionListener(e),()=>{s.removeOnEvictionListener(e)}}),[]);const c=(e,o)=>{const a=e>=Ml,s=-r.getBoundingClientRect().width;n(a?s:0),i(!0),setTimeout((()=>{i(!1),a&&t.onDelete(t.barcode),o&&o()}),200)},u=Wl("desktop")&&t.swipeToDeleteConfig.enabled,d=!u&&t.swipeToDeleteConfig.enabled;return Object(W.useEffect)((()=>{d||c(0)}),[d]),W.default.createElement(z.Box,{sx:{px:2},style:{width:"100%",paddingRight:0},ref:t=>{t&&(r=t)}},W.default.createElement(Bl,{config:t.swipeToDeleteConfig,visibleOffset:Ml}),W.default.createElement(z.Box,Object.assign({sx:{width:"100%",backgroundColor:V.b.getColorValue(t.sheetColor),transform:`translateX(${e}px)`,transition:o?"transform 200ms ease-in-out":void 0,touchAction:"pan-y",display:"flex",alignItems:"center",paddingTop:"16px",paddingBottom:"16px",columnGap:"16px"}},d?a.props:{}),W.default.createElement(tt,Object.assign({barcodeMappedData:l},t)),null!==t.readonlyCount&&W.default.createElement(z.Box,{sx:{fontSize:18,marginTop:"auto",flex:1,textAlign:"right",color:V.b.getColorValue("?sbColorOnSurfaceVariant")}},"x",t.readonlyCount),u&&W.default.createElement(N.a,{sx:{height:"100%",marginLeft:"auto",cursor:"pointer",color:V.b.getColorValue("?sbColorOnSurface")},onClick:()=>t.onDelete(t.barcode)}),W.default.createElement(z.Box,{sx:{width:"0px"}})))}function zl(t){const e=V.b.getColorValue(t.sheetContent.dividerColor),n=t.sheetContent.manualCountChangeEnabled&&"COUNTING"===t.mode,o=(e,n)=>{let o=t.indicatorColor.partial;return n===e.count?o=t.indicatorColor.complete:0===n&&(o=t.indicatorColor.notScanned),V.b.getColorValue(o)};return W.default.createElement(W.default.Fragment,null,W.default.createElement(z.Divider,{style:{borderColor:e}}),t.barcodes.length>0&&W.default.createElement(N.a,{sx:{width:"auto",flex:1,overflowY:"auto",overflowX:"hidden"},role:"presentation"},W.default.createElement(N.a,{sx:{p:0}},t.barcodes.map((({barcode:i,count:r},a)=>{const s=t.expectedBarcodes.find((t=>t.barcodeValue===i.text));return W.default.createElement(N.a,{key:a,sx:{padding:0,borderBottom:`1px solid ${e}`}},t.indicatorColor&&W.default.createElement("div",{style:{display:"flex",width:4,height:"100%",backgroundColor:o(s,r),position:"absolute"}}),W.default.createElement(jl,{barcode:i,animateBackAfterDelete:t.animateBackAfterDelete,onDelete:()=>t.onBarcodeChange({type:"remove",barcode:i}),counterForm:n&&{counter:r,manualCountChangeColor:t.sheetContent.manualCountChangeColor,manualCountOutlineColor:t.sheetContent.manualCountOutlineColor,addButtonEnabled:void 0===s||s.count>r,removeButtonEnabled:void 0===s||r>0,setCounter:e=>{t.onBarcodeChange({type:"setCount",barcodes:[i],computeNewCount:()=>e})},onNumberClick:()=>t.onNumberClick({barcode:i,count:r})},readonlyCount:"COUNTING"!==t.mode||t.sheetContent.manualCountChangeEnabled?null:r,maxNumberOfTitleLines:1,maxNumberOfSubtitleLines:1,displayRightArrow:!1,imageSize:n?84:40,barcodeImageVisible:t.sheetContent.barcodeItemImageVisible,barcodeTitle:t.sheetContent.barcodeItemTitle,barcodeSubtitle:t.sheetContent.barcodeItemSubtitle,swipeToDeleteConfig:t.sheetContent.swipeToDelete,sheetColor:t.sheetContent.sheetColor}))})))))}function Nl(t){return W.default.createElement(z.Badge,{anchorOrigin:{vertical:"top",horizontal:"left"},badgeContent:t.text,showZero:!0,color:"primary",overlap:"circular",slotProps:{badge:{style:{backgroundColor:t.backgroundColor,color:t.foregroundColor,fontWeight:"bold"}}}},t.children)}function Vl(t){if(!t.buttonStyling.visible)return null;return W.default.createElement(z.Box,{style:t.style},W.default.createElement(Nl,{text:t.text,backgroundColor:V.b.getColorValue(t.buttonStyling.badgeBackgroundColor),foregroundColor:V.b.getColorValue(t.buttonStyling.badgeForegroundColor)},W.default.createElement(z.IconButton,{sx:{backgroundColor:V.b.getColorValue(t.buttonStyling.backgroundColor),width:60,height:60,"&:hover, &:focus":{backgroundColor:V.b.getColorValue(t.buttonStyling.activeBackgroundColor),outline:"none"}},onClick:t.onClick,disableRipple:!0,disableFocusRipple:!0},W.default.createElement(N.a,{sx:{color:V.b.getColorValue(t.buttonStyling.foregroundColor),fontSize:"24pt","&:hover, &:focus":{color:V.b.getColorValue(t.buttonStyling.activeForegroundColor)}}}))))}const Ul=(t,e)=>(null===t.format||null===e.format||t.format===e.format)&&t.text===e.text,Hl=(t,e)=>t.find((t=>((t,e)=>t.barcodeValue===e.text)(t,e)));class Gl{constructor(t,e){this.expectedCount=t,this.foundCount=e}isFulFilled(){return void 0!==this.expectedCount&&void 0!==this.foundCount&&this.expectedCount===this.foundCount}toString(){return`${this.foundCount}/${this.expectedCount}`}}function Ql(t){const e=Object(W.useContext)(V.a).getColorValue,n={backgroundColor:e(t.sheetColor)};return W.default.createElement(ot,{modalOverlayColor:t.modalOverlayColor,open:t.open},W.default.createElement(z.DialogContent,{sx:Object.assign(Object.assign({},n),{p:2,pb:1,textAlign:"center"})},W.default.createElement(z.Typography,{sx:{fontSize:"16pt",fontWeight:"bold"}},W.default.createElement(Q.a,{config:t.title})),W.default.createElement(z.Typography,{sx:{fontSize:"14pt",lineHeight:"16pt"}},W.default.createElement(Q.a,{config:t.subtitle}))),W.default.createElement(z.DialogActions,{sx:Object.assign(Object.assign({},n),{pt:1})},W.default.createElement(N.a,{container:!0,spacing:2},W.default.createElement(N.a,{item:!0,xs:12},W.default.createElement(N.a,{color:e(t.dividerColor)})),W.default.createElement(N.a,{item:!0,xs:6},W.default.createElement(et,Object.assign({style:{width:"100%"},icon:t.cancelButton.icon,onClick:t.cancelButton.onClick},t.cancelButton.style))),W.default.createElement(N.a,{item:!0,xs:6},W.default.createElement(et,Object.assign({style:{width:"100%"},icon:t.okButton.icon,onClick:t.okButton.onClick},t.okButton.style))))))}function Yl(t){return t.open?W.default.createElement(Ql,{open:t.open,dividerColor:t.style.dividerColor,modalOverlayColor:t.style.modalOverlayColor,sheetColor:t.style.sheetColor,title:t.style.title,subtitle:t.style.subtitle,cancelButton:{style:t.style.cancelButton,onClick:t.onDismiss},okButton:{style:t.style.okButton,onClick:t.onSubmit}}):null}class Zl{constructor(t,e,n){this.barcodeItemSubtitleText=t,this.foundBarcodes=e,this.expectedBarcodes=n}useBarcodeMappedData(t){var e,n,o;const i=null!==(n=null===(e=this.foundBarcodes.find((e=>Ul(e.barcode,t))))||void 0===e?void 0:e.count.toString())&&void 0!==n?n:"0",r=Hl(this.expectedBarcodes,t);return{state:"LOADED",value:{title:`${null!==(o=r.title)&&void 0!==o?o:t.text}`,subtitle:V.b.getLocalizedBarcodeText(this.barcodeItemSubtitleText,[i,null==r?void 0:r.count.toString()]),barcodeImage:r.image}}}addOnEvictionListener(){}removeOnEvictionListener(){}}function ql(t){const e=Object(W.useContext)(X);return W.default.createElement(N.a,{item:!0,xs:5,component:"div",zIndex:1050,style:{paddingTop:e.minTopPaddingForContent,height:"100%",flexDirection:"column",display:"flex",backgroundColor:V.b.getColorValue(t.sheetContent.sheetColor)}},W.default.createElement(N.a,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},zIndex:50},W.default.createElement(Sl,Object.assign({},t.headerProps))),t.barcodeList,W.default.createElement(Ll,{isVisible:t.isEmptyStateVisible,style:t.sheetContent}))}var Xl=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};function $l(t){const e=Object(W.useRef)(),n=Object(W.useRef)(new Date("2001-01-01")),[o,i]=Object(W.useReducer)(function(t,e,n,o){return(i,r)=>{const a=t.useCase,s="FindAndPickScanningMode"===a._type,l=s?"COUNTING":a.mode,c=s?a.expectedBarcodes:[],u=t=>{let e=[...i];const n=r.barcodes||[r.barcode];for(const o of n){const n=e.findIndex((t=>Ul(t.barcode,o)));if(-1===n)e.push({barcode:o,count:t(0)});else{const o=e[n];e[n]=Object.assign(Object.assign({},o),{count:t(o.count,o)})}}return e},d=(t,n)=>{var i;if(e.current=new Date,!n)return t;const r=null===(i=Hl(c,n.barcode))||void 0===i?void 0:i.count;return void 0===r||r===t?t:(o(),t+1)};switch(r.type){case"onBarcodesDetected":{if((new Date).getTime()-e.current.getTime()<a.countingRepeatDelay||!n.current)return[...i];if(s)return a.arOverlay.automaticSelectionEnabled?u(d):[...i];const t=a.arOverlay;if(!t.visible||t.automaticSelectionEnabled){let t=!1;return u((n=>{let i="COUNTING"===l?n+1:1;return i===n||t||(e.current=new Date,o()),i}))}return u((t=>t))}case"onARCodeClick":return u(((t,e)=>{if(s)return d(t,e);const n="UNIQUE"===l?1-t:t+1;return n>0&&o(),n}));case"onCountEditDialogChange":{let t=()=>r.count||0;if(s){const e=Hl(c,r.barcode);r.count>e.count&&(t=()=>e.count)}return u(t)}case"setCount":return u(r.computeNewCount);case"remove":return i.map((t=>Object.assign(Object.assign({},t),{count:Ul(t.barcode,r.barcode)?0:t.count})));case"clear":return i.map((t=>Object.assign(Object.assign({},t),{count:0})));case"setHtmlElements":let t=!1;const h=i.map((e=>Ul(e.barcode,r.barcode)?(t=!0,Object.assign(Object.assign({},e),{polygonElement:r.polygonElement,labelElement:r.labelElement})):e));return t||h.push({barcode:r.barcode,count:0,labelElement:r.labelElement,polygonElement:r.polygonElement}),h}}}(t.configuration,n,t.scanningEnabled,(()=>{ct.INSTANCE.beep(t.configuration.sound),dt.INSTANCE.vibrate(t.configuration.vibration)})),[]),[r,a]=W.default.useState(null),[s,l]=Object(W.useState)(!1),c=Object(W.useMemo)((()=>"__sb_"+Math.random()),[]),[u,d]=Object(W.useState)(!0),h=t.barcodeMapper,[f,p]=Object(W.useState)(null),m="FindAndPickScanningMode"===t.configuration.useCase._type,g=t.configuration.useCase,v=m?"COUNTING":g.mode,A=Object(W.useRef)(Object.assign(Object.assign({},bl(t.configuration)),{onBarcodesDetected:t=>{i({type:"onBarcodesDetected",barcodes:t.barcodes})},_onDetectionFailed(t){},onError:t.onError,captureDelay:1e3/60}));Object(W.useEffect)((()=>{if(m){const e=C();for(const n of e){const e=[(t=n.barcodeValue,new T.BarcodeScannerTypes.BarcodeItem({text:t,format:null,quad:[],sourceImage:null,rawBytes:null,upcEanExtension:null,parsedDocument:null}))];i({type:"setCount",barcodes:e,computeNewCount:()=>0})}}var t}),[]),Object(W.useEffect)((()=>{A.current.container=e.current}),[e]),Object(W.useEffect)((()=>{if(m)for(const t of o){const e=g.arOverlay,n=t.polygonElement,o=t.labelElement;if(w(t.barcode)){const i=R(t.barcode);let r=t.count+"/"+i.expectedCount;g.arOverlay.automaticSelectionEnabled||0!==t.count||(r=W.default.createElement(z.TouchApp,null)),i.isFulFilled()?(null==n||n.style(V.b.getPolygonColorValues(e.polygon.completed,e.polygon.visible)),null==o||o.styleBadge(e.badge.completed,W.default.createElement(z.Check,null))):(null==n||n.style(V.b.getPolygonColorValues(e.polygon.partiallyScanned,e.polygon.visible)),null==o||o.styleBadge(e.badge.partiallyScanned,r))}else null==n||n.style(V.b.getPolygonColorValues(e.polygon.rejected,e.polygon.visible)),null==o||o.styleBadge(e.badge.rejected,W.default.createElement(z.Close,null))}else for(const t of o){if(t.polygonElement){const e=g.arOverlay.polygon,n=t.count>0?e.selected:e.deselected;t.polygonElement.style(V.b.getPolygonColorValues(n,e.visible))}t.labelElement&&(t.labelElement.update(Object.assign(Object.assign({},t.labelElement.state.element),{highlighted:t.count>0})),t.labelElement.setCount(t.count))}}),[o]);const b=o.reduce(((t,e)=>t+e.count),0),y=()=>C().every((t=>o.some((e=>e.barcode.text===t.barcodeValue&&e.count===t.count)))),C=()=>m?g.expectedBarcodes:[],S=t=>Hl(C(),t),w=t=>!!S(t),x=()=>m?o.filter((t=>w(t.barcode))):o.filter((t=>t.count>0)),E=()=>Xl(this,void 0,void 0,(function*(){const e=x().map((t=>new j.BarcodeScannerUIItem({count:"COUNTING"===v?t.count:1,barcode:t.barcode})));t.onSubmit({items:e})})),L=W.default.createElement(zl,{expectedBarcodes:C(),barcodes:x(),animateBackAfterDelete:m,onBarcodeChange:i,sheetContent:g.sheetContent,onNumberClick:t=>a(t),mode:v,indicatorColor:m&&{partial:g.scanningPartiallyColor,complete:g.scanningCompletedColor,notScanned:g.scanningNotScannedColor}}),_={textReplacementArgs:[b.toString()],leftButton:Object.assign(Object.assign({},g.sheetContent.clearAllButton),{onClick:()=>i({type:"clear"})}),rightButton:Object.assign(Object.assign({},g.sheetContent.submitButton),{onClick:()=>Xl(this,void 0,void 0,(function*(){if(m){const t=g;let e=null;t.partialScannedAlertDialogEnabled&&!y()&&(e=t.partialScannedAlertDialog),t.confirmationAlertDialogEnabled&&y()&&(e=t.confirmationAlertDialog),e?p(e):yield E()}else yield E()}))}),title:g.sheetContent.title},O=Wl("mobile"),k="BUTTON"!==g.sheet.mode&&O?"SMALL"===g.sheet.collapsedVisibleHeight?69:128:0,D=O&&"BUTTON"===g.sheet.mode,P=D?76:0,B=(u?80:0)+P,F=Object(W.useContext)(X),R=t=>{const e=o.find((e=>e.barcode.text===t.text)),n=S(t);return new Gl(null==n?void 0:n.count,null==e?void 0:e.count)},I=C().reduce(((t,e)=>t+e.count),0);m&&_.textReplacementArgs.push(I.toString());const M=m?new Zl(g.sheetContent.barcodeItemSubtitle.text,o,C()):h,U=!m&&0===b;return W.default.createElement(W.default.Fragment,null,W.default.createElement(ul.Provider,{value:M},W.default.createElement(N.a,{container:!0,sx:{display:"flex",flexDirection:O?"column":"row",height:`calc(${F.remainingVisibleBodyHeight} - ${k}px)`},alignItems:"stretch"},W.default.createElement(N.a,{id:c,item:!0,ref:e,component:"div",xs:O?12:7,zIndex:100},D&&W.default.createElement(Vl,{style:{position:"absolute",marginTop:`calc(${F.remainingVisibleBodyHeight} - 60px - 8px)`,width:"100%",display:"flex",justifyContent:"center",zIndex:1100},text:m?`${b}/${I}`:b.toString(),onClick:()=>l(!s),buttonStyling:g.sheet.listButton}),W.default.createElement(Al,{viewFinderPadding:{minTopPadding:F.minTopPaddingForContent,minBottomPadding:B},arOverlay:(()=>{if(m){const t=g.arOverlay;return Object.assign(Object.assign({},t),{counterBadge:Object.assign({},t.badge.partiallyScanned)})}const t=g.arOverlay,e=t.counterBadge;return Object.assign(Object.assign({},t),{counterBadge:Object.assign(Object.assign({},e),{visible:e.visible&&"COUNTING"===v})})})(),containerId:c,barcodeScannerViewConfig:A.current,onCameraPermissionDenied:t.onCameraPermissionDenied,actionBarConfig:t.configuration.actionBar,actionBarBottomPadding:16+P,setActionButtonsVisible:d,arOnBarcodeClick:t=>{i({type:"onARCodeClick",barcode:t})},arOnBarcodeEnter:(t,e,n)=>{if(!n||!e)return;i({type:"setHtmlElements",barcode:t,labelElement:n,polygonElement:e})},scanningPaused:s&&O,cameraConfiguration:t.configuration.cameraConfiguration,onLicenseError:t.onError}),O&&W.default.createElement(Tl,{closedSheetVisibleHeight:k,sheetStyle:g.sheet,contentStyle:g.sheetContent,manualCountEditDialog:g.manualCountEditDialog,isPlaceholderVisible:U,onBarcodeChange:t=>i(t),drawerHeaderContentProps:_,isOpen:s,onSwipe:t=>{l("swipe-to-open"===t)}},L)),function(t){switch(t){case"mobile":return Object(z.useMediaQuery)("(min-width:"+Fl+"px)");case"tablet":return Object(z.useMediaQuery)("(min-width:"+Rl+"px)");case"desktop":return Object(z.useMediaQuery)("(min-width:"+Il+"px)")}}("tablet")&&W.default.createElement(ql,{headerProps:_,sheetContent:g.sheetContent,isEmptyStateVisible:U,barcodeList:L})),W.default.createElement(Pl,{barcode:r,dialogStyling:g.manualCountEditDialog,onCancel:()=>a(null),setCounter:(t,e)=>{i({type:"onCountEditDialogChange",barcode:t,count:e}),a(null)}}),W.default.createElement(Yl,{open:null!==f,style:f,onDismiss:()=>p(null),onSubmit:E})))}const Kl=Object(W.createContext)(null),Jl={didCatch:!1,error:null};class tc extends W.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Jl}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(null!==t){for(var e,n,o=arguments.length,i=new Array(o),r=0;r<o;r++)i[r]=arguments[r];null===(e=(n=this.props).onReset)||void 0===e||e.call(n,{args:i,reason:"imperative-api"}),this.setState(Jl)}}componentDidCatch(t,e){var n,o;null===(n=(o=this.props).onError)||void 0===n||n.call(o,t,e)}componentDidUpdate(t,e){const{didCatch:n}=this.state,{resetKeys:o}=this.props;var i,r;n&&null!==e.error&&function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t.length!==e.length||t.some(((t,n)=>!Object.is(t,e[n])))}(t.resetKeys,o)&&(null===(i=(r=this.props).onReset)||void 0===i||i.call(r,{next:o,prev:t.resetKeys,reason:"keys"}),this.setState(Jl))}render(){const{children:t,fallbackRender:e,FallbackComponent:n,fallback:o}=this.props,{didCatch:i,error:r}=this.state;let a=t;if(i){const t={error:r,resetErrorBoundary:this.resetErrorBoundary};if("function"==typeof e)a=e(t);else if(n)a=Object(W.createElement)(n,t);else{if(null!==o&&!Object(W.isValidElement)(o))throw r;a=o}}return Object(W.createElement)(Kl.Provider,{value:{didCatch:i,error:r,resetErrorBoundary:this.resetErrorBoundary}},a)}}function ec(t){const e=Object(W.useRef)(!0);Object(W.useEffect)((()=>(e.current=!0,()=>{e.current=!1})));const[,n]=Object(W.useReducer)((t=>t+1),0),o=Object(W.useRef)();return Object(W.useMemo)((()=>{o.current={loading:!0,value:void 0,error:null}}),[t]),function(t,e){Object(W.useMemo)((()=>{t&&t.then((t=>{e({loading:!1,error:null,value:t})})).catch((t=>{e({loading:!1,error:{reason:t},value:void 0})}))}),[t])}(t,(t=>{o.current=t,e.current&&n()})),t?o.current:null}var nc=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class oc{constructor(t,e){this.barcodeItemMapper=t,this.onError=e,this.cache=new Map,this.cacheEntryPendingRetries=[],this.hash=t=>At(t),this.onEvictionListeners=new Set}getBarcodeMappedData(t){const e=this.hash(t);if(!this.cache.has(e)){const n=(()=>nc(this,void 0,void 0,(function*(){if(this.barcodeItemMapper){const e=new j.BarcodeScannerUIItem({count:1,barcode:t});return this.barcodeItemMapper(e)}{const e=yield b.toDataUrl(yield mu.instance.imageToJpeg(t.sourceImage));return{title:t.text,subtitle:t.format,barcodeImage:e}}})))();this.cache.set(e,n)}return this.cache.get(e)}useBarcodeMappedData(t){const e=Object(W.useRef)(!1),n=ec(t&&this.getBarcodeMappedData(t));if(Object(W.useEffect)((()=>{n&&n.error&&(e.current=!1,this.cacheEntryPendingRetries.push({barcode:t,retry:()=>{this.cache.delete(this.hash(t)),e.current=!0}}),this.onError((()=>{for(const t of this.cacheEntryPendingRetries)t.retry();this.cacheEntryPendingRetries.length=0}),(()=>{e.current=!0;for(const t of this.cacheEntryPendingRetries)for(const e of this.onEvictionListeners)this.hash(e.barcode)==this.hash(t.barcode)&&e.callback();this.cacheEntryPendingRetries.length=0})))}),[n&&n.error]),!n)return null;let o;return o=n.value?"LOADED":n.error&&!e.current?"RETRY_DIALOG_OPEN":n.error?"FAILED":"LOADING",{value:n.value,state:o}}addOnEvictionListener(t){this.onEvictionListeners.add(t)}removeOnEvictionListener(t){this.onEvictionListeners.delete(t)}}j.BarcodeItemErrorState;function ic(t){return W.default.createElement(Ql,{open:t.open,dividerColor:t.dividerColor,modalOverlayColor:t.modalOverlayColor,sheetColor:t.sheetColor,title:t.title,subtitle:t.subtitle,cancelButton:{style:t.cancelButton,onClick:t.handleCancel},okButton:{style:t.retryButton,icon:z.Replay,onClick:t.handleRetry}})}function rc(t){const e=Object(W.useContext)(X);return W.default.createElement(z.Box,{sx:{paddingTop:e.minTopPaddingForContent+"px",overflowY:"scroll",backgroundColor:V.b.getColorValue(t.config.background)}},W.default.createElement(z.Box,{sx:{height:e.remainingVisibleBodyHeight,marginLeft:"auto",marginRight:"auto",maxWidth:280,display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column"}},t.config.icon.visible&&W.default.createElement(z.Box,null,W.default.createElement(z.Avatar,{sx:{width:100,height:100,backgroundColor:V.b.getColorValue(t.config.iconBackground),margin:"24px"}},W.default.createElement(N.a,{sx:{fontSize:50,color:V.b.getColorValue(t.config.icon.color)}}))),W.default.createElement(z.Typography,{sx:{fontSize:20,textAlign:"center"}},W.default.createElement(Q.a,{config:t.config.enableCameraTitle})),W.default.createElement(z.Typography,{sx:{fontSize:16,textAlign:"center",paddingTop:"12px"}},W.default.createElement(Q.a,{config:t.config.enableCameraExplanation})),W.default.createElement(z.Box,{sx:{paddingTop:"16px"}},W.default.createElement(q,Object.assign({},t.config.closeButton,{onClick:t.onAppClose})))))}function ac(t){const e=Object(W.useRef)(Object(z.createTheme)({palette:{primary:{main:St.ScanbotPrimary},secondary:{main:St.DarkGray}}})),[n,o]=Object(W.useState)(!1),[i,r]=Object(W.useState)(!1),[a,s]=Object(W.useState)(t.configuration.timeouts.initialScanDelay<=0),l=Object(W.useRef)(!1),c=Object(W.useRef)(),u=Object(W.useRef)(),d=t.configuration.useCase,h="FindAndPickScanningMode"===d._type?null:d.barcodeInfoMapping,f=Object(W.useMemo)((()=>new oc(null==h?void 0:h.barcodeItemMapper,((t,e)=>{o(!0),c.current=()=>{o(!1),t()},u.current=()=>{o(!1),e()}}))),[]);let p;if(Object(W.useMemo)((()=>{V.b.setPalette(t.configuration.palette),V.b.setBarcodeTextLocalization(t.configuration.localization)}),[t.configuration]),Object(W.useEffect)((()=>{if(t.configuration.timeouts.autoCancelTimeout>0){const e=setTimeout((()=>{t.onClose()}),t.configuration.timeouts.autoCancelTimeout);return()=>{clearTimeout(e)}}}),[]),Object(W.useEffect)((()=>{if(t.configuration.timeouts.initialScanDelay>0){const e=setTimeout((()=>{s(!0)}),t.configuration.timeouts.initialScanDelay);return()=>{clearTimeout(e)}}}),[]),Object(W.useEffect)((()=>{l.current=!n&&a}),[n,a]),"SingleScanningMode"===d._type)p=W.default.createElement(Cl,{configuration:t.configuration,barcodeMapper:f,onClose:t.onClose,onSubmit:t.onSubmit,onError:t.onError,onCameraPermissionDenied:()=>r(!0),scanningEnabled:l});else{if("MultipleScanningMode"!==d._type&&"FindAndPickScanningMode"!==d._type)throw new Error("Unsupported use case type");p=W.default.createElement($l,{configuration:t.configuration,barcodeMapper:f,onSubmit:t.onSubmit,onError:t.onError,onCameraPermissionDenied:()=>r(!0),scanningEnabled:l})}return W.default.createElement(W.default.Fragment,null,W.default.createElement(H,null),W.default.createElement(tc,{onError:t.onError,fallback:W.default.createElement("div",null,"Error")},W.default.createElement(V.a.Provider,{value:Object(V.c)(t.configuration.palette)},W.default.createElement(z.ThemeProvider,{theme:e.current},h&&W.default.createElement(ic,Object.assign({open:n,handleCancel:u.current,handleRetry:c.current,modalOverlayColor:h.modalOverlayColor,dividerColor:h.dividerColor,sheetColor:h.sheetColor},h.errorState)),W.default.createElement(N.a,{sx:{height:`100 * ${U}`,width:"100vw",backgroundColor:V.b.getColorValue(t.configuration.backgroundColor)}},W.default.createElement($,Object.assign({onBackPress:t.onClose},t.configuration.topBar),!i&&p,i&&W.default.createElement(rc,{onAppClose:t.onClose,config:t.configuration.cameraPermission})))))))}var sc=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class lc{static createBarcodeScanner(t){return new Promise(((e,n)=>{ct.INSTANCE.initialize(t.sound);const o=lc.createContainer("barcode-scanner-controller"),i=Object(M.createRoot)(o),r=()=>sc(this,void 0,void 0,(function*(){return new Promise((t=>{window.setTimeout((()=>{i.unmount(),document.body.removeChild(o),t()}),0)}))})),a=t=>sc(this,void 0,void 0,(function*(){yield r(),n(t)}));i.render(W.default.createElement(ac,{configuration:t,onClose:()=>sc(this,void 0,void 0,(function*(){yield r(),e(null)})),onSubmit:t=>sc(this,void 0,void 0,(function*(){yield r(),e(t)})),onError:a})),(()=>{sc(this,void 0,void 0,(function*(){try{const t=yield mu.instance.getLicenseInfo();t.isValid()||(yield a(new P(t)))}catch(t){yield a(t)}}))})()}))}static createContainer(t){const e=document.createElement("div");return e.id=t,e.style.position="fixed",e.style.width="100%",e.style.height="100%",e.style.zIndex="1000",e.style.top="0",e.style.backgroundColor="rgba(0, 0, 0, 0.5)",document.body.appendChild(e),e}}lc.Config=j;var cc=lc,uc=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class dc{constructor(t,e){this._sdk=t,this._recognizer=e}recognize(t,e,n="COPY_IMAGE"){return uc(this,void 0,void 0,(function*(){const o=this._sdk.getBridge(n);return yield o.genericDocumentRecognizerRecognize(this._recognizer,t,new T.GenericDocumentRecognizerTypes.RecognitionParameters(e))}))}release(){return uc(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.releaseObject(this._recognizer)}))}}const hc={OK:"Capturing your document... Please do not move the camera.",OK_SMALL_SIZE:"The document is too small. Try moving closer.",OK_BAD_ANGLES:"This is a bad camera angle. Hold the device straight over the document.",OK_BAD_ASPECT_RATIO:"Rotate the device sideways, so that the document fits better into the screen.",OK_OFF_CENTER:"Try holding the device at the center of the document.",OK_TOO_DARK:"A document was detected, but it is too dark. Try turning on a light.",ERROR_NOTHING_DETECTED:"Please hold the device over a document to start scanning.",ERROR_TOO_DARK:"It is too dark. Try turning on a light.",ERROR_NOISE:"Please move the document to a clear surface.",NOT_ACQUIRED:"Scanning failed."};class fc{constructor(t){this.hint=t}}class pc{constructor(){this.outline=new mc,this.captureButton=new bc}}class mc{constructor(){this.polygon=new gc,this.path=new vc,this.label=new Ac}}class gc{constructor(){this.strokeCapturing="green",this.strokeSearching="yellow",this.fillCapturing="transparent",this.fillSearching="transparent"}}class vc{constructor(){this.stroke="green",this.strokeWidth=4}}class Ac{}class bc{constructor(){this.color="#FFF"}}class yc extends _.a{constructor(){super(_.a.DEFAULT_VIDEO_RESOLUTION_4K),this.detectionParameters=new T.DocumentDetectorTypes.DocumentDetectorParameters,this.autoCaptureEnabled=!0,this.autoCaptureSensitivity=.66,this.autoCaptureDelay=1e3,this.ignoreBadAspectRatio=!0,this.useImageCaptureAPI=!1,this.text=new fc(hc),this.style=new pc,this.onDocumentDetected=function(t){}}static fromJson(t){var e;const n=new yc;if(this.mapValues(t,n,["text","style","videoConstraints","detectionParameters"]),n.detectionParameters=new T.DocumentDetectorTypes.DocumentDetectorParameters(null!==(e=t.detectionParameters)&&void 0!==e?e:{}),t.text&&t.text.hint&&this.mapValues(t.text.hint,n.text.hint),t.style){this.mapValues(t.style,n.style,["outline","captureButton"]);const e=t.style.outline;if(e){this.mapValues(e,n.style.outline,["polygon","path","label"]);const t=e.polygon;t&&this.mapValues(t,n.style.outline.polygon);const o=e.path;o&&this.mapValues(o,n.style.outline.path);const i=e.label;i&&this.mapValues(i,n.style.outline.label)}const o=t.style.captureButton;o&&this.mapValues(o,n.style.captureButton)}return this.mapVideoConstraints(t,n),n}}var Cc=n(41),Sc={insert:"head",singleton:!1};Is()(Cc.a,Sc),Cc.a.locals;class wc extends W.default.Component{constructor(){super(...arguments),this.LINE_COUNT=4}render(){return W.default.createElement("svg",{style:{width:"100%",height:"100%",position:"absolute",overflow:"visible",fill:this.props.polygonStyle.fill}},this.fill())}fill(){if(!this.props.points||0===this.props.points.length)return null;const t=[];for(let e=0;e<this.LINE_COUNT;e++){const n=this.props.points[e],o=this.props.points[(e+1)%this.LINE_COUNT];t.push(W.default.createElement("line",{key:e,style:this.props.polygonStyle,className:this.props.polygonClasses,x1:n.x,y1:n.y,x2:o.x,y2:o.y}))}return t}setFrame(){window.requestAnimationFrame((()=>this.forceUpdate()))}}wc.CLASSNAME="scanbot-document-outline";class xc extends W.default.Component{constructor(t){super(t),this.state={points:[],animatedPoints:[],isOk:!1,isVisible:!1}}update(t,e,n,o){const i={points:t,animatedPoints:e,isOk:n,isVisible:o};this.setState(i)}pointStringOrLatestValidPoints(t){return t&&t.length>0?ws.a.toSvgString(t):ws.a.toSvgString(this.latestValidPoints)}render(){var t;this.state.points&&(this.latestValidPoints=this.state.points);const e=null!==(t=this.props.style)&&void 0!==t?t:{},n=zs()(wc.CLASSNAME,{[`${wc.CLASSNAME}-ok`]:this.state.isOk},{[`${wc.CLASSNAME}-visible`]:this.state.isVisible},{[`${wc.CLASSNAME}-hidden`]:!this.state.isVisible});return W.default.createElement(Cs.polygon,{ref:t=>this.polygon=t,style:{strokeWidth:e.strokeWidth||2},animate:{points:this.pointStringOrLatestValidPoints(this.state.animatedPoints),opacity:this.state.isVisible?1:0,stroke:this.state.isOk?e.strokeCapturing:e.strokeSearching,fill:this.state.isOk?e.fillCapturing:e.fillSearching},onClick:()=>{},fill:"transparent",className:n})}}var Ec=xc;class Lc extends W.default.Component{constructor(t){super(t),this.state={path:void 0}}render(){var t,e;return this.state.path?W.default.createElement(Cs.path,{pathLength:"1",strokeDasharray:"1 1",initial:{strokeDashoffset:1},animate:{strokeDashoffset:0},transition:{duration:this.props.duration/1e3,ease:"easeInOut",repeat:0,repeatType:"loop",repeatDelay:1},stroke:(null===(t=this.props.style)||void 0===t?void 0:t.stroke)||"white",strokeWidth:(null===(e=this.props.style)||void 0===e?void 0:e.strokeWidth)||2,fill:"none",d:this.state.path,className:`${wc.CLASSNAME}-path`}):null}animate(t){const e="M"+ws.a.toSvgString(t)+"z";this.setState({path:e})}clear(){this.setState({path:void 0})}}class _c extends W.default.Component{render(){return W.default.createElement(Cs.svg,{style:{width:"100%",height:"100%",position:"absolute",overflow:"visible"}},W.default.createElement(Ec,{ref:t=>this.polygon=t,style:this.props.polygonStyle}),W.default.createElement(Lc,{ref:t=>this.path=t,style:this.props.pathStyle,duration:this.props.autoCaptureSensitivity}))}update(t,e,n){var o;const i="processing"!==n&&!!t,r=null!==(o=this.previous)&&void 0!==o?o:t,a=this.previous?t:void 0;this.polygon.update(r,a,e,i),this.previous=t,this.previous&&"capturing"===n?this.animateCapturing():this.clearAnimation()}animateCapturing(){this.path.animate(this.previous)}clearAnimation(){this.path.clear()}}class Oc extends W.default.Component{constructor(){super(...arguments),this.hintLabelClassName="scanbot-document-hint-text",this.state={text:"Initializing...",ok:!1,validPoints:!1}}render(){const{ok:t,text:e,validPoints:n}=this.state,o="searching"===this.props.action||"capturing"===this.props.action,i="processing"!==this.props.action&&n,r=zs()({[this.hintLabelClassName]:!0,[`${this.hintLabelClassName}-visible`]:i,[`${this.hintLabelClassName}-hidden`]:!i});return W.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute",left:0,top:0}},W.default.createElement(_c,{ref:t=>{this.polygon=t},action:this.props.action,style:{width:"100%",height:"100%"},polygonStyle:this.props.style.polygon,pathStyle:this.props.style.path,isOk:t,isVisible:i,autoCaptureSensitivity:this.props.autoCaptureSensitivity}),o&&W.default.createElement("label",{ref:t=>this.label=t,style:this.props.style.label,className:r,dangerouslySetInnerHTML:{__html:e}}))}update(t,e,n){this.polygon.update(e,t,this.props.action),this.label&&(this.label.innerHTML=n)}}class Tc{static isConvex(t){if(t.length<4)return!0;let e=!1,n=t.length;for(let o=0;o<n;o++){const i=t[(o+2)%n].x-t[(o+1)%n].x,r=t[(o+2)%n].y-t[(o+1)%n].y,a=t[o].x-t[(o+1)%n].x,s=i*(t[o].y-t[(o+1)%n].y)-r*a;if(0==o)e=s>0;else if(e!=s>0)return!1}return!0}static distanceBetweenPoints(t,e){return Math.pow(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2),.5)}static intersection(t,e){const n=t[0],o=ws.a.subtract(t[1],n),i=e[0],r=ws.a.subtract(e[1],i);if(0===ws.a.cross(o,r))return;const a=ws.a.cross(ws.a.subtract(i,n),o)/ws.a.cross(o,r);return ws.a.add(i,ws.a.multiply(r,a))}}class kc{constructor(t,e=kc.DEFAULT_SENSITIVITY){this.maxDistance=this.calculateMaxDistance(t),this.sensitivity=e}check(t){let e=!1;if(this.lastPolygon){for(var n=0;n<4;n++)if(this.isPointMoved(t[n],this.lastPolygon[n])){e=!0;break}}else e=!0;return e}reset(){this.lastPolygon=void 0}update(t){this.lastPolygon=t}isPointMoved(t,e){return Tc.distanceBetweenPoints(t,e)/this.maxDistance>this.sensitivity}calculateMaxDistance(t){let e=new ws.a(0,0),n=new ws.a(t.width,t.height);return Tc.distanceBetweenPoints(e,n)}}kc.DEFAULT_SENSITIVITY=.5;var Dc=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};ht.b;ht.a;class Pc extends ht.c{constructor(t){if(super(t),this.preventAutoCapture=!1,this.defaultCaptureButtonClick=()=>Dc(this,void 0,void 0,(function*(){const t=yield this.detectAndCrop();this.configuration.onDocumentDetected(t)})),Object.assign(this.state,{action:this.defaultAction}),!this.isSupported()){throw Error("Camera can only be accessed if the content is served via HTTPS, or on localhost. Check DocumentScannerView.isSupported() before creating the scanner.")}if(!mu.instance)throw Error("Initialize the SDK by calling ScanbotSDK.initialize() before using the document scanner.")}get defaultAction(){return this.isAutoCaptureEnabled()?"searching":"manual"}get enabled(){return("searching"==this.state.action||"capturing"==this.state.action||"manual"==this.state.action)&&!this.disposed}get configuration(){return this._configuration||(this._configuration=yc.fromJson(this.props.configuration)),this._configuration}get autoCaptureSensitivity(){return 3e3*(1-this.configuration.autoCaptureSensitivity)}static create(t){return Dc(this,void 0,void 0,(function*(){const e=document.getElementById(t.containerId);if(!e)throw Error("Unable to initialize ScanbotSDK: Cannot find container element with the id provided.");return new Promise(((n,o)=>{Object(W.render)(W.default.createElement(Pc,{container:e,configuration:t,onSuccess:n,onFailure:o}),e)}))}))}detectAndCrop(){var t,e,n;return Dc(this,void 0,void 0,(function*(){try{if(this.enabled){this.setState({action:"processing"});const e=yield null===(t=this.camera)||void 0===t?void 0:t.createImageData(Pc.DETECT_AND_CROP_RESOLUTION,this.configuration.useImageCaptureAPI);if(!e)return;return I.a.debug("Detect & Crop document of size: "+e.height*e.width),yield this.bridge.transferArgs.detectAndCropDocument(e)}}catch(t){null===(n=(e=this.configuration).onError)||void 0===n||n.call(e,t)}finally{this.setState({action:this.defaultAction})}}))}enableAutoCapture(){this.updateAutoCapture(!0)}disableAutoCapture(){this.updateAutoCapture(!1)}updateAutoCapture(t){this._configuration?this._configuration.autoCaptureEnabled=t:this.props.configuration.autoCaptureEnabled=t,this.setState({action:this.defaultAction})}isAutoCaptureEnabled(){return this._configuration?this._configuration.autoCaptureEnabled:this.props.configuration.autoCaptureEnabled}componentDidMount(){const t=Object.create(null,{componentDidMount:{get:()=>super.componentDidMount}});return Dc(this,void 0,void 0,(function*(){t.componentDidMount.call(this),this.detect(),this.recognizer=this.bridge.copyArgs.createDocumentDetector(new T.DocumentDetectorTypes.DocumentDetectorParameters(this.configuration.detectionParameters)),this.recognizer.catch((t=>{var e,n;return null===(n=(e=this.configuration).onError)||void 0===n?void 0:n.call(e,t)}))}))}componentWillUnmount(){const t=Object.create(null,{componentWillUnmount:{get:()=>super.componentWillUnmount}});return Dc(this,void 0,void 0,(function*(){t.componentWillUnmount.call(this),this.handleAutoCapture(!1),yield mu.instance.release(yield this.recognizer,"Document Scanner")}))}detect(){var t,e;return Dc(this,void 0,void 0,(function*(){try{if(!this.enabled)return;const t=yield this.detectInWebWorker();if(!t||!this.enabled)return;if(!this.outline)return;this.camera.reusableImageBuffer=t.originalImage.data;const e=this.getStatusString(t),n="OK"===e,o=e.startsWith("OK")?this.scalePolygonPointsToPixels(t.pointsNormalized):void 0;this.outline.update(n,o,v.getProperty(this.configuration.text.hint,e)),yield this.handleAutoCapture(n,o)}catch(n){null===(e=(t=this.configuration).onError)||void 0===e||e.call(t,n)}finally{requestAnimationFrame(this.detect.bind(this))}}))}getStatusString(t){return this.configuration.ignoreBadAspectRatio&&"OK_BAD_ASPECT_RATIO"===t.status?"OK":t.status}detectInWebWorker(){var t,e,n;return Dc(this,void 0,void 0,(function*(){try{const e=yield null===(t=this.camera)||void 0===t?void 0:t.createImageData(ht.c.DEFAULT_DETECTION_RESOLUTION,!1);return e&&this.enabled?yield this.bridge.transferArgs.documentDetectorDetect(yield this.recognizer,e):null}catch(t){return null===(n=(e=this.configuration).onError)||void 0===n||n.call(e,t),null}}))}handleAutoCapture(t,e){return Dc(this,void 0,void 0,(function*(){if(this.configuration.autoCaptureEnabled&&!this.preventAutoCapture)if(t&&!this.autoCaptureToken&&e){if(this.updateButton("capturing"),!this.polygonMovementPredicate){const t=this.getCameraFrameSize();this.polygonMovementPredicate=new kc(t)}if(this.runMovementPredicate(e))return this.updateButton("searching"),clearTimeout(this.autoCaptureToken),void(this.autoCaptureToken=void 0);this.autoCaptureToken=setTimeout((()=>Dc(this,void 0,void 0,(function*(){if(this.autoCaptureToken=void 0,!this.enabled)return;if(!this.configuration.autoCaptureEnabled)return;const t=yield this.detectAndCrop();if(null==t?void 0:t.pointsNormalized){const e=this.scalePolygonPointsToPixels(t.pointsNormalized);if(this.runMovementPredicate(e))return}(null==t?void 0:t.status.startsWith("OK"))&&this.configuration.onDocumentDetected&&(this.configuration.onDocumentDetected(t),this.preventAutoCapture=!0,setTimeout((()=>{this.preventAutoCapture=!1}),this.configuration.autoCaptureDelay))}))),this.autoCaptureSensitivity)}else!t&&this.autoCaptureToken&&(this.updateButton("searching"),clearTimeout(this.autoCaptureToken),this.autoCaptureToken=void 0)}))}updateButton(t){this.setState({action:t})}render(){var t,e,n;const{action:o}=this.state,{configuration:i}=this,r=null===(t=i.style)||void 0===t?void 0:t.captureButton;return W.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},this.renderSpinner(null===(e=this.configuration)||void 0===e?void 0:e.spinnerColor),W.default.createElement(ft.a,{configuration:this.configuration,videoConstraints:i.videoConstraints,mirrored:i.mirrored,preferredCamera:this.configuration.preferredCamera,onReady:this.onVideoReady,onError:this.onVideoError,ref:t=>{this.camera=t}}),W.default.createElement(Oc,{ref:t=>{this.outline=t},style:null===(n=i.style)||void 0===n?void 0:n.outline,action:o,autoCaptureSensitivity:this.autoCaptureSensitivity}),W.default.createElement(Vs,{color:(null==r?void 0:r.color)?r.color:"FFF",action:o,onClick:this.enabled?i.onCaptureButtonClick||this.defaultCaptureButtonClick:()=>{}}))}scalePolygonPointsToPixels(t){if(t){const e=this.getCameraFrameSize(),n=Ys.a.fromHtmlElement(this.camera.video),o=rl.findScale(n,e);t=(t=rl.convertToViewportPointsFromParentSize(e,t)).map((t=>ws.a.scaleToPoint(t,o.x,o.y,o.scale)))}return t}runMovementPredicate(t){const e=this.polygonMovementPredicate.check(t);return this.polygonMovementPredicate.update(t),e}getCameraFrameSize(){return this.camera.calculateFrameSize(ht.c.DEFAULT_DETECTION_RESOLUTION,this.camera.videoSize().width,this.camera.videoSize().height)}}Pc.DETECT_AND_CROP_RESOLUTION=0;var Bc=Pc;class Fc extends O.a{constructor(){super(_.a.DEFAULT_VIDEO_RESOLUTION_HD),this.recognizerConfiguration=new T.MRZTypes.RecognizerConfiguration,this.onMrzDetected=function(t){},this.finder.aspectRatio=new T.Geometry.AspectRatio({width:4,height:1}),this.userGuidance.title.text="Please hold the device over the MRZ code to start scanning"}static fromJson(t){const e=new Fc;return this.mapValues(t,e,["style","videoConstraints","finder","userGuidance"]),this.mapFinderConfiguration(e,t),this.mapVideoConstraints(t,e),e}}var Rc=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};ht.a;ht.b;class Ic extends ht.c{constructor(t){super(t),this.shouldComputeSize=!0,this.paused=!1,this.updateDimensionsCallback=this.updateDimensions.bind(this),Object.assign(this.state,{isFinderVisible:!0})}get configuration(){return this._configuration||(this._configuration=Fc.fromJson(this.props.configuration)),this._configuration}get enabled(){return!this.disposed}static create(t,e){return Rc(this,void 0,void 0,(function*(){const n=document.getElementById(t.containerId);if(!n)throw Error("Unable to initialize ScanbotSDK: Cannot find container element with the id provided.");return new Promise(((o,i)=>{Object(W.render)(W.default.createElement(Ic,{container:n,configuration:t,onSuccess:o,onFailure:i,mrzRecognizer:e}),n)}))}))}isDetectionPaused(){return this.paused}resumeDetection(){return Rc(this,void 0,void 0,(function*(){il.warn("Mrz detection resumed"),yield this.resume()}))}pauseDetection(){il.warn("Mrz detection paused"),this.pause()}componentDidMount(){const t=Object.create(null,{componentDidMount:{get:()=>super.componentDidMount}});return Rc(this,void 0,void 0,(function*(){t.componentDidMount.call(this),window.addEventListener("resize",this.updateDimensionsCallback),yield this.resume()}))}componentWillUnmount(){super.componentWillUnmount(),this.pause(),this.props.mrzRecognizer.release(),window.removeEventListener("resize",this.updateDimensionsCallback)}updateDimensions(){return Rc(this,void 0,void 0,(function*(){this.shouldComputeSize=!0,this.forceUpdate()}))}resume(){return Rc(this,void 0,void 0,(function*(){this.paused=!1,yield this.detect()}))}pause(){this.paused=!0}detect(){var t,e,n,o,i;return Rc(this,void 0,void 0,(function*(){const r=this.shouldComputeSize;if(!this.enabled)return;if(this.paused)return;let a=!1;try{this.camera.finderFrame=null===(t=this.finder)||void 0===t?void 0:t.holeRect;const o=yield null===(e=this.camera)||void 0===e?void 0:e.createImageData(Ic.FRAME_RESOLUTION);if(!o)return;r&&this.forceUpdate();const i=yield this.props.mrzRecognizer.recognize(o,"CONSUME_IMAGE");if(!this.enabled)return;if(null===i)return;this.camera.reusableImageBuffer=null==i?void 0:i.originalImage.data,i.recognitionSuccessful?(delete i.originalImage,a=!0,this.configuration.onMrzDetected(i)):this.configuration._onDetectionFailed&&(null===(n=this.configuration)||void 0===n||n._onDetectionFailed(i.originalImage))}catch(t){null===(i=(o=this.configuration).onError)||void 0===i||i.call(o,t)}finally{a?setTimeout((()=>{requestAnimationFrame(this.detect.bind(this))}),200):requestAnimationFrame(this.detect.bind(this))}}))}saveExtractedImageData(){this.camera.saveExtractedData()}setFinderVisible(t){this.setState({isFinderVisible:t})}render(){var t;return W.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},this.renderSpinner(null===(t=this.configuration)||void 0===t?void 0:t.spinnerColor),W.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%"}},W.default.createElement(ft.a,{configuration:this.configuration,videoConstraints:this.configuration.videoConstraints,mirrored:this.configuration.mirrored,preferredCamera:this.configuration.preferredCamera,onReady:this.onVideoReady,onError:this.onVideoError,ref:t=>{this.camera=t}})),this.state.isFinderVisible&&W.default.createElement(pt.a,{ref:t=>{this.finder=t},guidanceConfiguration:this.configuration.userGuidance,configuration:this.configuration.finder}))}}Ic.FRAME_RESOLUTION=1200;var Wc=Ic,Mc=n(36);class jc{constructor(){this.disabled=!1,this.color="transparent"}}class zc{constructor(){this.color="white",this.border="1px solid lightgray",this.size=20}}class Nc{constructor(){this.color="#1ec31e",this.width=4}}class Vc{constructor(){this.padding=10}}class Uc{constructor(){this.margin=15,this.size=100,this.zoom=1.5}}class Hc{constructor(){this.width=2,this.color="white"}}class Gc{constructor(){this.size=20,this.color="white"}}class Qc extends Mc.a{constructor(){super(),this.disableScroll=!0,this.rotations=0,this.style=new Vc,this.style.magneticLines=new jc,this.style.polygon=new Nc,this.style.polygon.handles=new zc,this.style.magnifier=new Uc,this.style.magnifier.border=new Hc,this.style.magnifier.crosshair=new Gc}static fromJson(t){const e=new Qc;return this.mapValues(t,e,["style"]),t.style&&(this.mapValues(t.style,e.style,["polygon","magneticLines","magnifier"]),t.style.polygon&&(this.mapValues(t.style.polygon,e.style.polygon,["handles"]),t.style.polygon.handles&&this.mapValues(t.style.polygon.handles,e.style.polygon.handles)),t.style.magneticLines&&this.mapValues(t.style.magneticLines,e.style.magneticLines,[]),t.style.magnifier&&(this.mapValues(t.style.magnifier,e.style.magnifier,["border","crosshair"]),t.style.magnifier.border&&this.mapValues(t.style.magnifier.border,e.style.magnifier.border,[]),t.style.magnifier.crosshair&&this.mapValues(t.style.magnifier.crosshair,e.style.magnifier.crosshair,[]))),e}}class Yc extends W.default.Component{constructor(){super(...arguments),this.BUFFER=4}fromPoint(t){return W.default.createElement("svg",{style:{width:"100%",height:"100%",position:"absolute"}},W.default.createElement("line",{x1:t.start.x.toString(),y1:t.start.y.toString(),x2:t.end.x.toString(),y2:t.end.y.toString(),style:{stroke:this.props.style.color,strokeWidth:2}}))}componentDidUpdate(t,e,n){this.props.style.disabled||this.snapToClosestIfAnyAreClose()}render(){var t,e,n,o,i,r;return W.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute"}},null===(n=null===(e=null===(t=this.props.lines)||void 0===t?void 0:t.horizontal)||void 0===e?void 0:e.scaled)||void 0===n?void 0:n.map((t=>this.fromPoint(t))),null===(r=null===(i=null===(o=this.props.lines)||void 0===o?void 0:o.vertical)||void 0===i?void 0:i.scaled)||void 0===r?void 0:r.map((t=>this.fromPoint(t))))}snapToClosestIfAnyAreClose(){var t,e,n,o;const i=this.props.movingLine;let r=null===(e=null===(t=this.props.lines)||void 0===t?void 0:t.vertical)||void 0===e?void 0:e.scaled;if(i.isHorizontal&&(r=null===(o=null===(n=this.props.lines)||void 0===n?void 0:n.horizontal)||void 0===o?void 0:o.scaled),!r)return;const a=this.midPoint(i.points[0].coordinates,i.points[1].coordinates),s=r.map((t=>({distance:this.distanceToLine(t,a),mLine:t})));s.sort(((t,e)=>t.distance-e.distance)),s[0].distance<this.BUFFER&&this.props.snapTo({magneticLine:s[0].mLine,polygonLine:i})}distanceToLine(t,e){const n=e.x-t.start.x,o=e.y-t.start.y,i=t.end.x-t.start.x,r=t.end.y-t.start.y,a=i*i+r*r;if(0===a)return 1/0;const s=(n*i+o*r)/a;let l;return l=s<=0?t.start:s>=1?t.end:new ws.a(t.start.x+s*i,t.start.y+s*r),ws.a.distance(e,l)}midPoint(t,e){return new ws.a((t.x+e.x)/2,(t.y+e.y)/2)}}class Zc extends W.default.Component{constructor(){super(...arguments),this.POINT_COUNT=4,this.items=[],this.DRAG_BUFFER=5}get pointSize(){var t,e;return(null===(t=this.props.style)||void 0===t?void 0:t.size)?(null===(e=this.props)||void 0===e?void 0:e.scale)?this.props.style.size/this.props.scale:this.props.style.size:0}get pointStyle(){var t,e;return{width:this.pointSize+"px",height:this.pointSize+"px",border:null===(t=this.props.style)||void 0===t?void 0:t.border,borderRadius:this.pointSize/2+"px",backgroundColor:null===(e=this.props.style)||void 0===e?void 0:e.color,position:"absolute",cursor:"pointer",zIndex:500}}nextIndex(t){return(t+1)%this.POINT_COUNT}previousIndex(t){return(t-1+this.POINT_COUNT)%this.POINT_COUNT}isHorizontal(t){return t%2==0}isOutOfBounds(t,e){return t<-this.DRAG_BUFFER||t>e+this.DRAG_BUFFER}get invisibleHandleStyle(){return{width:"50px",height:"50px",opacity:0,position:"relative",top:this.pointSize/2-25+"px",left:this.pointSize/2-25+"px",borderRadius:"25px"}}}class qc extends Zc{create(){if(!this.props.points||4!==this.props.points.length)return null;const t=[];for(let e=0;e<this.POINT_COUNT;e++){const n=this.props.points[e],o=W.default.createElement("div",{style:Object.assign(Object.assign({},this.pointStyle),{left:n.x-this.pointSize/2+"px",top:n.y-this.pointSize/2+"px"}),key:e.toString(),ref:t=>this.items[e]=t,onPointerDown:t=>this.cornerTouchStart(t,e),onPointerUp:t=>this.cornerTouchEnd(t),onPointerMove:t=>this.cornerTouchMove(t,e),"data-sb-cropping-corner":e},W.default.createElement("div",{style:Object.assign({},this.invisibleHandleStyle)}));t.push(o)}return t}cornerTouchStart(t,e){t.target.setPointerCapture(t.pointerId);const n=ws.a.fromCoordinates(t.clientX,t.clientY,this.props.rotations,this.props.scale),o=this.items[e],i=ws.a.fromHtmlElement(o);this.parentOffset=new ws.a(n.x-i.x,n.y-i.y),this.props.cornerMoveStart({index:e,point:this.props.points[e]})}cornerTouchMove(t,e){if(!this.parentOffset)return;const n=ws.a.fromCoordinates(t.clientX,t.clientY,this.props.rotations,this.props.scale),{x:o,y:i}=Object(Ol.b)({x:n.x-this.parentOffset.x,y:n.y-this.parentOffset.y},this.pointSize,this.props.containerSize),r=this.pointSize/2,a=this.props.points[e];this.props.points[e]=new ws.a(o+r,i+r),Tc.isConvex(this.props.points)?this.props.cornerMoved({index:e,point:this.props.points[e]}):this.props.points[e]=a}cornerTouchEnd(t){t.target.releasePointerCapture(t.pointerId),this.parentOffset=null,this.props.cornerMoveEnd()}render(){return W.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute",cursor:"pointer",zIndex:500,userSelect:"none",msUserSelect:"none",MozUserSelect:"none",WebkitUserSelect:"none"}},this.create())}}class Xc extends Zc{create(){if(!this.props.points||4!==this.props.points.length)return null;const t=[];for(let e=0;e<this.POINT_COUNT;e++){const n=this.props.points[e];let o=this.props.points[this.nextIndex(e)];const i=W.default.createElement("div",{style:Object.assign(Object.assign({},this.pointStyle),{left:n.x+(o.x-n.x)/2-this.pointSize/2+"px",top:n.y+(o.y-n.y)/2-this.pointSize/2+"px"}),key:e.toString(),ref:t=>this.items[e]=t,onPointerDown:t=>this.lineTouchStart(t,e),onPointerMove:t=>this.lineTouchMove(t,e),onPointerUp:t=>this.lineTouchEnd(t),"data-sb-cropping-side":e},W.default.createElement("div",{style:this.invisibleHandleStyle}));t.push(i)}return t}lineTouchStart(t,e){t.target.setPointerCapture(t.pointerId);const n=ws.a.fromCoordinates(t.clientX,t.clientY,this.props.rotations,this.props.scale),o=this.items[e],i=ws.a.fromHtmlElement(o),r=this.props.points[e],a=this.props.points[this.nextIndex(e)];this.point0Start=v.copy(this.props.points[this.previousIndex(e)]),this.point1Start=v.copy(r),this.point2Start=v.copy(a),this.point3Start=v.copy(this.props.points[this.nextIndex(this.nextIndex(e))]),this.point1Offset=new ws.a(r.x-i.x,r.y-i.y),this.point2Offset=new ws.a(a.x-i.x,a.y-i.y),this.parentOffset=new ws.a(n.x-i.x,n.y-i.y)}lineTouchMove(t,e){if(!this.parentOffset)return;const n=ws.a.fromCoordinates(t.clientX,t.clientY,this.props.rotations,this.props.scale),o=this.props.points[this.previousIndex(e)];let i=new ws.a(null,null),r=new ws.a(null,null);const a=this.props.points[this.nextIndex(e+1)],s=n.x-this.parentOffset.x,l=n.y-this.parentOffset.y;if(this.isHorizontal(e)){const t=l+this.point1Offset.y,e=l+this.point2Offset.y,n=t-this.point1Start.y;i.x=this.point1Start.x+(this.point1Start.x-this.point0Start.x)*(n/(this.point1Start.y-this.point0Start.y)),r.x=this.point2Start.x+(this.point2Start.x-this.point3Start.x)*(n/(this.point2Start.y-this.point3Start.y)),i.y=t,r.y=e}else{const t=s+this.point1Offset.x,e=s+this.point2Offset.x,n=t-this.point1Start.x;i.y=this.point1Start.y+(this.point1Start.y-this.point0Start.y)*(n/(this.point1Start.x-this.point0Start.x)),r.y=this.point2Start.y+(this.point2Start.y-this.point3Start.y)*(n/(this.point2Start.x-this.point3Start.x)),i.x=t,r.x=e}i=ws.a.clamp(i,this.props.containerSize),r=ws.a.clamp(r,this.props.containerSize),this.isNearOpposingPoint(this.point1Start,i,o,this.isHorizontal(e)?"y":"x")||this.isNearOpposingPoint(this.point1Start,r,a,this.isHorizontal(e)?"y":"x")||this.areEdgesCrossing(o,i,r,a)||Tc.isConvex([o,i,r,a])&&(this.props.points[e].x=i.x,this.props.points[e].y=i.y,this.props.points[this.nextIndex(e)].x=r.x,this.props.points[this.nextIndex(e)].y=r.y,this.props.lineMoved({points:[{index:e,coordinates:i},{index:this.nextIndex(e),coordinates:r}],previousPoint:o,nextPoint:a,isHorizontal:this.isHorizontal(e)}))}lineTouchEnd(t){t.target.releasePointerCapture(t.pointerId),this.parentOffset=null}isNearOpposingPoint(t,e,n,o){if(t[o]>n[o]){if(e[o]-10<n[o])return!0}else if(e[o]>n[o]-10)return!0;return!1}areEdgesCrossing(t,e,n,o){const i=t.x,r=t.y,a=e.x,s=e.y,l=n.x,c=n.y,u=o.x,d=o.y;return((i-l)*(s-c)-(r-c)*(a-l))*((i-u)*(s-d)-(r-d)*(a-u))<0&&((l-i)*(d-r)-(c-r)*(u-i))*((l-a)*(d-s)-(c-s)*(u-a))<0}render(){return W.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute"}},this.create())}}class $c extends W.default.Component{render(){return W.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute"}},W.default.createElement(qc,{ref:t=>this.corners=t,style:this.props.style,containerSize:this.props.containerSize,scale:this.props.scale,rotations:this.props.rotations,points:this.props.coordinatePoints,cornerMoveStart:this.props.cornerMoveStart,cornerMoved:this.props.cornerMoved,cornerMoveEnd:this.props.cornerMoveEnd}),W.default.createElement(Xc,{ref:t=>this.lines=t,style:this.props.style,containerSize:this.props.containerSize,scale:this.props.scale,rotations:this.props.rotations,points:this.props.coordinatePoints,lineMoved:this.props.lineMoved}))}setFrame(){for(let t=0;t<this.corners.POINT_COUNT;t++){const e=this.props.coordinatePoints[t];this.corners.items[t]&&(this.corners.items[t].style.left=e.x-this.corners.pointSize/2+"px",this.corners.items[t].style.top=e.y-this.corners.pointSize/2+"px");let n=this.props.coordinatePoints[this.corners.nextIndex(t)];this.lines.items[t]&&(this.lines.items[t].style.left=e.x+(n.x-e.x)/2-this.corners.pointSize/2+"px",this.lines.items[t].style.top=e.y+(n.y-e.y)/2-this.corners.pointSize/2+"px")}}snapTo(t){const e=[t.polygonLine.previousPoint,t.polygonLine.points[0].coordinates],n=[t.polygonLine.points[1].coordinates,t.polygonLine.nextPoint],o=[t.magneticLine.start,t.magneticLine.end];this.props.coordinatePoints[t.polygonLine.points[0].index]=Tc.intersection(e,o),this.props.coordinatePoints[t.polygonLine.points[1].index]=Tc.intersection(n,o),this.props.cornerMoveEnd(),this.setFrame()}}class Kc extends W.default.Component{constructor(t){super(t),this.state={movingLine:void 0}}render(){return W.default.createElement("div",null,W.default.createElement($c,{ref:t=>this.handles=t,containerSize:this.props.size,coordinatePoints:this.props.points,rotations:this.props.rotations,scale:this.props.scale,style:this.props.handleStyle,cornerMoveStart:this.props.cornerMoveStart,cornerMoved:t=>{this.setFrame(),this.props.cornerMoved(t)},cornerMoveEnd:this.props.cornerMoveEnd,lineMoved:t=>{this.setFrame(),this.setState({movingLine:t})}}),W.default.createElement(Yc,{style:this.props.magneticLineStyle,lines:this.props.magneticLines,movingLine:this.state.movingLine,snapTo:t=>{var e,n;null===(e=this.handles)||void 0===e||e.snapTo(t),null===(n=this.polygon)||void 0===n||n.setFrame()}}),W.default.createElement(wc,{size:this.props.size,points:this.props.points,polygonStyle:this.props.polygonStyle,polygonClasses:this.props.polygonClasses,ref:t=>this.polygon=t}))}setFrame(){var t,e;null===(t=this.polygon)||void 0===t||t.setFrame(),null===(e=this.handles)||void 0===e||e.setFrame()}}class Jc extends W.default.Component{render(){return W.default.createElement("img",{ref:t=>this.image=t,style:{width:"100%",height:"100%",objectFit:"cover",position:"absolute"},src:this.props.src,alt:".",onLoad:t=>{t.target&&this.props.onImageLoaded(t.target)}})}}class tu extends W.default.Component{constructor(){super(...arguments),this.animating=!1}width(){return this.container.offsetWidth-2*this.container.offsetLeft}height(){return this.container.offsetHeight-2*this.container.offsetTop}isAnimating(){return this.animating}render(){const{size:t,imageMargin:e,rotations:n,scale:o,duration:i}=this.props,r=90*(n-1),a=90*n;this.previousScale||(this.previousScale=1);const s=mt.b`
35
35
  from {transform: rotate(${r}deg) scale(${this.previousScale}); }
36
- to {transform: rotate(${a}deg) scale(${i});
37
- }`,l=bt.a.div`position: absolute; animation: ${s} ${o}s;`;return this.previousScale=i,B.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute"},ref:t=>this.container=t},B.default.createElement(l,{style:{width:this.calculate(t,"width"),height:this.calculate(t,"height"),transform:`rotate(${a}deg) scale(${i})`,marginTop:this.marginWithAspect(e,"y",t),marginLeft:this.marginWithAspect(e,"x",t)},onAnimationStart:()=>{this.animating=!0},onAnimationEnd:()=>{this.animating=!1}},this.props.children))}marginWithAspect(t,e,n){if(!t||!n)return 0;n.width,n.height;return t[e]}calculate(t,e){return t?t[e]:"100%"}}class Uc extends B.default.Component{componentDidMount(){al.disableScreenMovement()}componentWillUnmount(){al.enableScreenMovement()}render(){return B.default.createElement("div",null)}}class Hc{constructor(t,e){this.element=t,this.size=e}}class Gc{}class Qc extends B.default.Component{render(){return B.default.createElement("div",{style:this.props.style},B.default.createElement("svg",null,this.vertical(),this.horizontal()))}half(){return this.props.size/2}vertical(){const t=this.half();return B.default.createElement("line",{x1:t,y1:0,x2:t,y2:this.props.size,stroke:this.props.color,strokeWidth:"2"})}horizontal(){const t=this.half();return B.default.createElement("line",{x1:0,y1:t,x2:this.props.size,y2:t,stroke:this.props.color,strokeWidth:"2"})}}class Zc extends B.default.Component{get crosshairSize(){var t,e;return null===(e=null===(t=this.props.style)||void 0===t?void 0:t.crosshair)||void 0===e?void 0:e.size}constructor(t){super(t),this.MAX_ROTATIONS=4,this.state={frame:f.a.empty(),cropImageFitSize:qs.a.empty(),rotation:{count:0,scale:1},margin:{left:this.props.style.margin,top:this.props.style.margin},container:{width:0},scale:{width:1,height:1}}}style(){return{container:{marginLeft:this.state.margin.left,marginTop:this.state.margin.top,width:this.state.frame.width,height:this.state.frame.height,borderRadius:this.props.style.size/2,border:this.props.style.border.width+"px solid "+this.props.style.border.color,position:"absolute",overflow:"hidden",zIndex:50,transform:"rotate("+90*this.state.rotation.count+"deg)"},image:{width:this.state.cropImageFitSize.width*this.props.style.zoom,height:this.state.cropImageFitSize.height*this.props.style.zoom,marginLeft:-this.state.frame.x,marginTop:-this.state.frame.y,objectFit:"cover"},crosshair:{margin:"auto",position:"absolute",width:this.crosshairSize,height:this.crosshairSize,top:this.state.frame.height/2-this.crosshairSize/2,left:this.state.frame.width/2-this.crosshairSize/2}}}render(){return this.state.visible?B.default.createElement("div",{style:this.style().container},B.default.createElement("img",{style:this.style().image,ref:t=>this.destination=t,src:this.props.src,alt:"."}),B.default.createElement(Qc,{style:this.style().crosshair,size:this.crosshairSize,color:this.props.style.crosshair.color})):null}update(t){if(!this.state.visible)return;this.destination.src=t.source.element.src;const e=f.a.fromPoint(Es.a.scaleUpTo(t.origin,new qs.a(this.props.style.zoom,this.props.style.zoom)),this.props.style.size),n=t.container.width-(this.props.style.margin+this.props.style.size),i=this.isPointTopLeft(t.origin,t.source.size,t.rotations);this.setState({frame:e,cropImageFitSize:t.source.size,rotation:{count:t.rotations,scale:t.scale},margin:{left:i?n:this.props.style.margin},container:{width:t.container.width},scale:{width:t.source.size.width/t.container.width,height:t.source.size.height/t.container.height}})}isPointTopLeft(t,e,n){const i=t.x,o=t.y,r=this.normalizeRotations(n),a=this.state.container.width/4;return 0===r?i<a&&o<a:1===r?i<a&&o>e.height-a:2===r?i>e.width-a&&o>e.height-a:i>e.width-a&&o<a}setIsVisible(t,e){this.setState({visible:t},e)}normalizeRotations(t){return t%this.MAX_ROTATIONS}}var Yc=function(t,e,n,i){return new(n||(n=Promise))((function(o,r){function a(t){try{l(i.next(t))}catch(t){r(t)}}function s(t){try{l(i.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((i=i.apply(t,e||[])).next())}))};class qc extends B.default.Component{constructor(t){super(t),this.onResizeCallback=()=>{},this.MAX_ROTATIONS=4,this.BASE_SCALE=1,this.state={image:void 0,documentDetectionResult:void 0,polygon:void 0,calculatedSize:qs.a.empty(),animation:{rotations:0,scale:1,duration:0},points:[],magneticLines:{horizontal:{original:[],scaled:[]},vertical:{original:[],scaled:[]}},imageMargin:Es.a.empty()},this.onResizeCallback=this.onResize.bind(this)}static create(t){return Yc(this,void 0,void 0,(function*(){const e=document.getElementById(t.containerId);if(!e)throw Error("Unable to initialize cropping component: Cannot find container element with the id provided.");return new Promise(((n,i)=>{Object(B.render)(B.default.createElement(qc,{onReady:n,onError:i,container:e,configuration:Ic.fromJson(t)}),e)}))}))}componentDidMount(){var t,e,n;return Yc(this,void 0,void 0,(function*(){const i=null===(t=this.configuration)||void 0===t?void 0:t.image,o=yield eu.instance.detectAndCropDocument(i),r=yield v.toDataUrl(yield eu.instance.imageToJpeg(i));this.setState({documentDetectionResult:o,image:r,polygon:null!==(n=null===(e=this.configuration)||void 0===e?void 0:e.polygon)&&void 0!==n?n:o.pointsNormalized,magneticLines:{vertical:{original:o.verticalLinesNormalized},horizontal:{original:o.horizontalLinesNormalized}}}),this.props.onReady&&this.props.onReady(this),addEventListener("resize",this.onResizeCallback),addEventListener("orientationchange",this.onResizeCallback)}))}componentWillUnmount(){return Yc(this,void 0,void 0,(function*(){removeEventListener("resize",this.onResizeCallback),removeEventListener("orientationchange",this.onResizeCallback)}))}onImageLoaded(t){return Yc(this,void 0,void 0,(function*(){qs.a.isEmpty(this.state.calculatedSize)&&(this.htmlImage=t,this.initializeSizes())}))}onResize(){const t=this.state.points.map((t=>new Es.a(t.x/this.state.calculatedSize.width,t.y/this.state.calculatedSize.height)));this.initializeSizes(t)}initializeSizes(t,e,n){const i=new qs.a(this.htmlImage.naturalWidth,this.htmlImage.naturalHeight),o=new qs.a(this.container.width(),this.container.height()),r=v.getObjectFitSize(o,i),a=new qs.a(r.width,r.height),s=null!=t?t:this.state.polygon,l=al.convertToViewportPointsFromParentSize(a,s),c=null!=e?e:this.state.magneticLines.horizontal.original,u=null!=n?n:this.state.magneticLines.vertical.original,d=al.convertLinesToViewportLines(a,c),h=al.convertLinesToViewportLines(a,u);this.setState({calculatedSize:a,points:l,magneticLines:{horizontal:{original:c,scaled:d},vertical:{original:u,scaled:h}},animation:{duration:0,rotations:this.rotations,scale:this.calculateScale(0,this.rotations,a)},imageMargin:this.calculateMargin(a)})}render(){var t,e,n,i,o,r;const a=dc.CLASSNAME,s=Vs()({[a]:!0,[`${a}-visible`]:!0}),l=this.configuration.style.polygon.width,c=(null===(t=this.state.animation)||void 0===t?void 0:t.scale)?l/this.state.animation.scale:l,u=this.configuration.style.padding||0,d=`calc(100% - 2*${u}px)`;return B.default.createElement("div",{style:{position:"relative",width:d,height:d,padding:u}},B.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},this.configuration.disableScroll&&B.default.createElement(Uc,null),B.default.createElement(Zc,{ref:t=>this.magnifier=t,style:this.configuration.style.magnifier}),B.default.createElement(Vc,{ref:t=>this.container=t,size:this.state.calculatedSize,rotations:null===(e=this.state.animation)||void 0===e?void 0:e.rotations,scale:null===(n=this.state.animation)||void 0===n?void 0:n.scale,duration:null===(i=this.state.animation)||void 0===i?void 0:i.duration,imageMargin:this.state.imageMargin},B.default.createElement(Nc,{src:this.state.image,onImageLoaded:t=>this.onImageLoaded(t)}),B.default.createElement(zc,{style:{width:"100%",height:"100%",zIndex:500},size:this.state.calculatedSize,polygonStyle:{cursor:"pointer",stroke:this.configuration.style.polygon.color,strokeWidth:`${c}px`},handleStyle:this.configuration.style.polygon.handles,magneticLineStyle:this.configuration.style.magneticLines,polygonClasses:s,points:this.state.points,rotations:null===(o=this.state.animation)||void 0===o?void 0:o.rotations,scale:null===(r=this.state.animation)||void 0===r?void 0:r.scale,magneticLines:this.state.magneticLines,cornerMoveStart:this.showMagnifier.bind(this),cornerMoved:this.updateMagnifier.bind(this),cornerMoveEnd:this.hideMagnifier.bind(this)}))))}showMagnifier(t){var e;null===(e=this.magnifier)||void 0===e||e.setIsVisible(!0,(()=>{var e;null===(e=this.magnifier)||void 0===e||e.update(this.magnifierOptions(t))}))}updateMagnifier(t){var e;null===(e=this.magnifier)||void 0===e||e.update(this.magnifierOptions(t))}magnifierOptions(t){const e=new Gc;return e.source=new Hc(this.htmlImage,this.state.calculatedSize),e.container=new qs.a(this.container.width(),this.container.height()),e.origin=t.point,e.rotations=this.state.animation.rotations,e.scale=this.state.animation.scale,e}hideMagnifier(){var t;null===(t=this.magnifier)||void 0===t||t.setIsVisible(!1)}apply(){var t;return Yc(this,void 0,void 0,(function*(){const e=Es.a.toPolygon(this.state.points,this.state.calculatedSize),n=this.toCoreRotations(this.rotations),i=yield eu.instance.imageCrop(null===(t=this.configuration)||void 0===t?void 0:t.image,e);return{image:yield eu.instance.imageRotate(i,n,"CONSUME_IMAGE"),polygon:e,rotations:this.rotations}}))}toCoreRotations(t){switch(t%this.MAX_ROTATIONS){case 0:return"ROTATION_NONE";case 1:return"ROTATION_90_CLOCKWISE";case 2:return"ROTATION_180";case 3:return"ROTATION_90_COUNTERCLOCKWISE"}}rotate(t){return Yc(this,void 0,void 0,(function*(){if(this.container.isAnimating())return void console.warn("Unable to rotate: previous rotation animation in progress");const e=this.calculateScale(this.rotations,t,this.state.calculatedSize);this.setState({animation:{rotations:this.rotations+t,scale:e,duration:1}})}))}detect(){return Yc(this,void 0,void 0,(function*(){const t=this.state.documentDetectionResult;this.initializeSizes(t.pointsNormalized,t.horizontalLinesNormalized,t.verticalLinesNormalized)}))}dispose(){const{container:t}=this.props;if(!t)throw Error("Component wasn't created with openCroppingView. Remove component from render tree to dispose.");Object(B.render)(null,t)}get rotations(){var t,e;const n=null===(t=this.state.animation)||void 0===t?void 0:t.rotations;return n&&0!==n?n:null!==(e=this.configuration.rotations)&&void 0!==e?e:0}get configuration(){return this._configuration||(this._configuration=Ic.fromJson(this.props.configuration)),this._configuration}calculateScale(t,e,n){return e?(t+e)%2==0?this.BASE_SCALE:this.calculateRatio(n):this.BASE_SCALE}calculateRatio(t){return Math.min(this.container.width()/t.height,this.container.height()/t.width)}calculateMargin(t){return t.width>t.height?{x:0,y:this.container.height()/2-t.height/2}:{x:this.container.width()/2-t.width/2,y:0}}}var Xc=function(t,e,n,i){return new(n||(n=Promise))((function(o,r){function a(t){try{l(i.next(t))}catch(t){r(t)}}function s(t){try{l(i.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((i=i.apply(t,e||[])).next())}))};gt.a;gt.b;class $c extends gt.c{constructor(t){super(t),this.shouldComputeSize=!0,this.paused=!1,this.updateDimensionsCallback=this.updateDimensions.bind(this),Object.assign(this.state,{isFinderVisible:!0})}get configuration(){return this.props.configuration}get enabled(){return!this.disposed}static create(t,e,n){return Xc(this,void 0,void 0,(function*(){const i=document.getElementById(t.containerId);if(!i)throw Error("Unable to initialize ScanbotSDK: Cannot find container element with the id provided.");return new Promise(((o,r)=>{Object(B.render)(B.default.createElement($c,{container:i,configuration:t,onTextDetected:e,onSuccess:o,onFailure:r,textDataScanner:n}),i)}))}))}isDetectionPaused(){return this.paused}resumeDetection(){return Xc(this,void 0,void 0,(function*(){rl.warn("TextData detection resumed"),yield this.resume()}))}pauseDetection(){rl.warn("TextData detection paused"),this.pause()}componentDidMount(){const t=Object.create(null,{componentDidMount:{get:()=>super.componentDidMount}});return Xc(this,void 0,void 0,(function*(){t.componentDidMount.call(this),window.addEventListener("resize",this.updateDimensionsCallback),yield this.resume()}))}componentWillUnmount(){super.componentWillUnmount(),this.pause(),this.props.textDataScanner.release(),window.removeEventListener("resize",this.updateDimensionsCallback)}updateDimensions(){return Xc(this,void 0,void 0,(function*(){this.shouldComputeSize=!0,this.forceUpdate()}))}resume(){return Xc(this,void 0,void 0,(function*(){this.paused=!1,yield this.detect()}))}pause(){this.props.textDataScanner.cleanRecognitionQueue(),this.paused=!0}detect(){var t,e;return Xc(this,void 0,void 0,(function*(){const n=this.shouldComputeSize;if(!this.enabled)return;if(this.paused)return;let i=!1;try{this.camera.finderFrame=null===(t=this.finder)||void 0===t?void 0:t.holeRect;const o=yield null===(e=this.camera)||void 0===e?void 0:e.createImageData($c.FRAME_RESOLUTION);if(!o)return;n&&this.forceUpdate();const r=yield this.props.textDataScanner.recognize(o);if(!this.enabled)return;if(null===r)return;r&&(i=!0,this.props.onTextDetected(r))}catch(t){console.log(t)}finally{i?setTimeout((()=>{requestAnimationFrame(this.detect.bind(this))}),200):requestAnimationFrame(this.detect.bind(this))}}))}saveExtractedImageData(){this.camera.saveExtractedData()}render(){var t;return B.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},this.renderSpinner(null===(t=this.configuration)||void 0===t?void 0:t.spinnerColor),B.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%"}},B.default.createElement(vt.a,{configuration:this.configuration,videoConstraints:this.configuration.videoConstraints,mirrored:this.configuration.mirrored,preferredCamera:this.configuration.preferredCamera,onReady:this.onVideoReady,onError:this.onVideoError,ref:t=>{this.camera=t}})),this.state.isFinderVisible&&B.default.createElement(At.a,{ref:t=>{this.finder=t},guidanceConfiguration:this.configuration.userGuidance,configuration:this.configuration.finder}))}}$c.FRAME_RESOLUTION=1200;var Kc=$c,Jc=function(t,e,n,i){return new(n||(n=Promise))((function(o,r){function a(t){try{l(i.next(t))}catch(t){r(t)}}function s(t){try{l(i.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((i=i.apply(t,e||[])).next())}))};class tu{static get UI(){if(!o.BUILD_WITH_UI)throw new Error("UI components are not included in Scanbot.min.js. Please use ScanbotSDK.ui2.min.js instead.");return tu._ui2}static initialize(t){var e;return Jc(this,void 0,void 0,(function*(){const n=new tu,i=t.engine||tu.defaultEnginePath,a=!!t.allowThreads,s=null!==(e=t.requestSuffix)&&void 0!==e?e:`?${n.version}`,c=[t.licenseKey,i,window.location.hostname,o.CDN_PATH+o.DEFAULT_WASM_FOLDER,{captureConsole:!1,allowThreads:a,requestSuffix:s}];return n.bridge=new l(i,{allowSimd:!0,allowThreads:a,requestSuffix:s},c),tu.instance=n,window.scanbotSdk=n,F.a.initialize(t.verboseLogging),t.allowThreads&&!Object(r.a)()&&(F.a.debugWarn("Threads are not available in this environment. The SDK will run in single-threaded mode."),window.hasOwnProperty("crossOriginIsolated")&&!window.crossOriginIsolated&&F.a.debugWarn("The site is not cross-origin isolated. This prevents multithreading in the ScanbotSDK. To enable multithreading, you need to set the 'Cross-Origin-Opener-Policy' and 'Cross-Origin-Embedder-Policy' http headers. See our documentation for details.")),n}))}createDocumentScanner(t){return Jc(this,void 0,void 0,(function*(){let e;try{return e=yield Cc.create(t),yield this.licenseCheck(),e}catch(t){throw e&&e.dispose(),t}}))}createMrzScanner(t){return Jc(this,void 0,void 0,(function*(){let e;try{const n=new C(this,this.bridge.copyArgs.createMRZRecognizer(t.recognizerConfiguration));return e=yield Ec.create(t,n),yield this.licenseCheck(),e}catch(t){throw e&&e.dispose(),t}}))}createBarcodeScanner(t){return Jc(this,void 0,void 0,(function*(){let e;try{return e=yield ll.create(t),yield this.licenseCheck(),e}catch(t){throw e&&e.dispose(),t}}))}openCroppingView(t){return Jc(this,void 0,void 0,(function*(){return yield this.licenseCheck(),yield qc.create(t)}))}createTextDataScanner(t){return Jc(this,void 0,void 0,(function*(){try{t=T.fromJson(t);const e=yield this.createGenericTextLineScanner(t,t.onTextDetected,t.ocrConfiguration);return yield this.licenseCheck(),e}catch(t){throw t}}))}createVINScanner(t){return Jc(this,void 0,void 0,(function*(){let e;try{t=k.fromJson(t);const n=e=>{""!==e.rawText&&t.onTextDetected(e)},i=new O.GenericTextLineScannerTypes.ScannerConfiguration(Object.assign(Object.assign({},t.ocrConfiguration),{validator:new O.GenericTextLineScannerTypes.PresetContentValidator({preset:"VEHICLE_IDENTIFICATION_NUMBER"})}));return e=yield this.createGenericTextLineScanner(t,n,i),yield this.licenseCheck(),e}catch(t){throw e&&e.dispose(),t}}))}createGenericDocumentRecognizerScanner(t){return Jc(this,void 0,void 0,(function*(){let e;try{const i=n(42).default;return e=yield i.create(this,t),yield this.licenseCheck(),e}catch(t){throw e&&e.dispose(),t}}))}toDataUrl(t){return Jc(this,void 0,void 0,(function*(){return P.throwIfMissingBuffer(t),yield v.toDataUrl(t)}))}detectDocument(t,e={},n="COPY_IMAGE"){return Jc(this,void 0,void 0,(function*(){yield this.licenseCheck(),P.throwIfMissingBuffer(t);const i=yield this.bridge.copyArgs.createDocumentDetector(e),o=this.getBridge(n),r=yield o.documentDetectorDetect(i,t);return yield this.release(i,"documentDetector"),r}))}detectAndCropDocument(t,e="COPY_IMAGE"){return Jc(this,void 0,void 0,(function*(){yield this.licenseCheck(),P.throwIfMissingBuffer(t);const n=this.getBridge(e);return yield n.detectAndCropDocument(t)}))}detectBarcodes(t,e){return Jc(this,void 0,void 0,(function*(){return yield this.licenseCheck(),P.throwIfMissingBuffer(t),new Promise((n=>{const i=document.createElement("canvas"),o=document.createElement("img");o.src=t,o.onload=()=>Jc(this,void 0,void 0,(function*(){i.width=o.width,i.height=o.height;const t=i.getContext("2d");t.drawImage(o,0,0);const r=t.getImageData(0,0,o.width,o.height),a=yield this.bridge.copyArgs.createBarcodeRecognizer(Object.assign(Object.assign({},e),{live:!1})),{barcodes:s,success:l}=yield this.bridge.transferArgs.recognizeBarcodes(a,r);yield this.release(a,"barcodeRecognizer"),n(new b(s,new qs.a(o.width,o.height)))}))}))}))}parseBarcodeDocument(t,e){return Jc(this,void 0,void 0,(function*(){return yield this.licenseCheck(),yield this.bridge.copyArgs.parseBarcodeDocument(t,e)}))}createSimpleMRZRecognizer(){return Jc(this,void 0,void 0,(function*(){const t=new O.MRZTypes.RecognizerConfiguration({accumulatedResultsVerifierConfig:{maximumNumberOfAccumulatedFrames:0}});return new C(this,this.bridge.copyArgs.createMRZRecognizer(t))}))}createOcrEngine(){return Jc(this,void 0,void 0,(function*(){return new w(this,yield this.bridge.copyArgs.createOcrEngine())}))}createDocumentQualityAnalyzer(t={}){return Jc(this,void 0,void 0,(function*(){const e=yield this.bridge.copyArgs.createDocumentQualityAnalyzer(t);return new I(this,e)}))}imageRotate(t,e,n="COPY_IMAGE"){return Jc(this,void 0,void 0,(function*(){P.throwIfMissingBuffer(t);const i=this.getBridge(n);return yield i.imageRotate(t,e)}))}imageFilter(t,e,n="COPY_IMAGE"){return Jc(this,void 0,void 0,(function*(){P.throwIfMissingBuffer(t);const i=this.getBridge(n);return yield i.imageApplyFilter(t,e)}))}imageCrop(t,e,n="COPY_IMAGE"){return Jc(this,void 0,void 0,(function*(){P.throwIfMissingBuffer(t);const i=this.getBridge(n);return yield i.imageCrop(t,e)}))}imageResize(t,e,n="COPY_IMAGE"){return Jc(this,void 0,void 0,(function*(){P.throwIfMissingBuffer(t);const i=this.getBridge(n);return yield i.imageResize(t,e)}))}getLicenseInfo(){return Jc(this,void 0,void 0,(function*(){const t=yield this.bridge.copyArgs.getLicenseInfo();return c.fromJson(t)}))}beginPdf(t){return Jc(this,void 0,void 0,(function*(){return yield this.licenseCheck(),new d(this,yield this.bridge.copyArgs.beginPdf(t))}))}beginTiff(t={}){return Jc(this,void 0,void 0,(function*(){return yield this.licenseCheck(),new p(this,yield this.bridge.copyArgs.beginTiff(t))}))}createGenericDocumentRecognizer(t){return Jc(this,void 0,void 0,(function*(){return yield this.licenseCheck(),new Jl(this,yield this.bridge.copyArgs.genericDocumentRecognizerCreate(t))}))}imageToJpeg(t,e="COPY_IMAGE"){return Jc(this,void 0,void 0,(function*(){yield this.licenseCheck();return this.getBridge(e).encodeJpeg(t)}))}get version(){return o.VERSION}get utils(){return this._utils||(this._utils=new A),this._utils}release(t,e){return Jc(this,void 0,void 0,(function*(){t&&(F.a.debug(`Releasing object ${null!=e?e:"unknown"}`),yield this.bridge.copyArgs.releaseObject(t))}))}getBridge(t){return"CONSUME_IMAGE"===t?this.bridge.transferArgs:this.bridge.copyArgs}licenseCheck(){return Jc(this,void 0,void 0,(function*(){const t=yield this.getLicenseInfo();if(!t.isValid())throw console.error(`LicenseError: ${t.status}`),new D(t)}))}createGenericTextLineScanner(t,e,n){return Jc(this,void 0,void 0,(function*(){const i=this.bridge.copyArgs.createGenericTextLineScanner(n),o=new E(this,i);return yield Kc.create(t,e,o)}))}}tu.defaultEnginePath="",tu._ui2=o.BUILD_WITH_UI?$l:void 0,tu.Config=O;var eu=e.a=tu},function(t,e,n){"use strict";var i=n(32),o=n.n(i)()((function(t){return t[1]}));o.push([t.i,"\n.scanbot-shutter-fade-in {\n opacity: 1;\n}\n\n.scanbot-shutter-fade-out {\n opacity: 0;\n}\n\n.scanbot-shutter-rotate {\n animation: scanbot-shutter-rotating linear infinite;\n}\n\n.scanbot-shutter-pulse-fast {\n animation: scanbot-shutter-pulsing 1s ease-in-out infinite;\n}\n\n.scanbot-shutter-button {\n position: relative;\n width: 64px;\n height: 64px;\n left: 50%;\n bottom: 12px;\n transform: translate(-50%, -100%);\n}\n\n.scanbot-shutter-button-part {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n transition: opacity 0.5s ease-in-out;\n}\n\n@keyframes scanbot-shutter-rotating {\n to {\n transform: rotate(360deg);\n }\n}\n\n@keyframes scanbot-shutter-pulsing {\n 0% {\n opacity: 0.25;\n }\n 50% {\n opacity: 0.8;\n }\n 100% {\n opacity: 0.25;\n }\n}\n",""]),e.a=o},function(t,e,n){"use strict";var i=n(32),o=n.n(i)()((function(t){return t[1]}));o.push([t.i,".scanbot-document-hint-text {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n text-align: center;\n background-color: rgba(0, 0, 0, 0.4);\n color: white;\n border-radius: 0.25em;\n padding: 0.05em 0.3em 0.05em 0.3em;\n font-family: sans-serif;\n font-size: 0.9em;\n font-weight: 300;\n}\n",""]),e.a=o},function(t,e){var n,i,o=t.exports={};function r(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(n===setTimeout)return setTimeout(t,0);if((n===r||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:r}catch(t){n=r}try{i="function"==typeof clearTimeout?clearTimeout:a}catch(t){i=a}}();var l,c=[],u=!1,d=-1;function h(){u&&l&&(u=!1,l.length?c=l.concat(c):d=-1,c.length&&p())}function p(){if(!u){var t=s(h);u=!0;for(var e=c.length;e;){for(l=c,c=[];++d<e;)l&&l[d].run();d=-1,e=c.length}l=null,u=!1,function(t){if(i===clearTimeout)return clearTimeout(t);if((i===a||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(t);try{i(t)}catch(e){try{return i.call(null,t)}catch(e){return i.call(this,t)}}}(t)}}function f(t,e){this.fun=t,this.array=e}function m(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];c.push(new f(t,e)),1!==c.length||u||s(p)},f.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=m,o.addListener=m,o.once=m,o.off=m,o.removeListener=m,o.removeAllListeners=m,o.emit=m,o.prependListener=m,o.prependOnceListener=m,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(t,e,n){const{render:i,hydrate:o,unmountComponentAtNode:r}=n(0);function a(t){return{render(e){i(e,t)},unmount(){r(t)}}}e.createRoot=a,e.hydrateRoot=function(t,e){return o(e,t),a(t)}},function(t,e){t.exports=function(t,e,n,i){var o=n?n.call(i,t,e):void 0;if(void 0!==o)return!!o;if(t===e)return!0;if("object"!=typeof t||!t||"object"!=typeof e||!e)return!1;var r=Object.keys(t),a=Object.keys(e);if(r.length!==a.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(e),l=0;l<r.length;l++){var c=r[l];if(!s(c))return!1;var u=t[c],d=e[c];if(!1===(o=n?n.call(i,u,d,c):void 0)||void 0===o&&u!==d)return!1}return!0}},function(t,e,n){"use strict";e.a={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1}},function(t,e,n){"use strict";function i(t){var e=Object.create(null);return function(n){return void 0===e[n]&&(e[n]=t(n)),e[n]}}n.d(e,"a",(function(){return r}));var o=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,r=i((function(t){return o.test(t)||111===t.charCodeAt(0)&&110===t.charCodeAt(1)&&t.charCodeAt(2)<91}))},function(t,e,n){"use strict";n.r(e),n.d(e,"ScanbotSDK",(function(){return i}));const i=n(33).a},function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return h}));var i=n(0),o=n(11),r=n(12),a=n(20);class s extends a.a{constructor(){super(r.a.DEFAULT_VIDEO_RESOLUTION_HD),this.finder.aspectRatio={width:2,height:1},this.userGuidance.title.visible=!1}static fromJson(t){const e=new s;return this.mapValues(t,e,[]),e}}var l=n(8),c=n(21),u=n(23),d=function(t,e,n,i){return new(n||(n=Promise))((function(o,r){function a(t){try{l(i.next(t))}catch(t){r(t)}}function s(t){try{l(i.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((i=i.apply(t,e||[])).next())}))};o.a;class h extends o.c{constructor(t){super(t),this.enabled=!0,this.configuration=t.configuration}static create(t,e){var n;return d(this,void 0,void 0,(function*(){const o=null!==(n=e.container)&&void 0!==n?n:document.getElementById(e.containerId);if(e=s.fromJson(e),!o)throw Error("Unable to initialize ScanbotSDK: Cannot find container element with the id provided.");return new Promise(((n,r)=>{Object(i.render)(i.default.createElement(h,{container:o,configuration:e,onSuccess:n,onFailure:r,sdk:t}),o)}))}))}componentDidMount(){super.componentDidMount(),this.genericDocumentRecognizer=this.props.sdk.createGenericDocumentRecognizer(this.configuration.detectorParameters),this.detect()}componentWillUnmount(){const t=Object.create(null,{componentWillUnmount:{get:()=>super.componentWillUnmount}});return d(this,void 0,void 0,(function*(){t.componentWillUnmount.call(this),this.enabled=!1,yield(yield this.genericDocumentRecognizer).release()}))}detect(){var t,e,n,i;return d(this,void 0,void 0,(function*(){try{if(!this.enabled)return;this.camera.finderFrame=null===(t=this.finder)||void 0===t?void 0:t.holeRect;const r=yield null===(e=this.camera)||void 0===e?void 0:e.createImageData(o.c.DEFAULT_DETECTION_RESOLUTION);if(!r)return;const a=yield(yield this.genericDocumentRecognizer).recognize(r,new l.GenericDocumentRecognizerTypes.RecognitionParameters({mode:"LIVE"}));null===(i=(n=this.configuration).onDocumentDetected)||void 0===i||i.call(n,a)}finally{requestAnimationFrame((()=>this.detect()))}}))}render(){var t;const e=this.configuration;return i.default.createElement(i.default.Fragment,null,i.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},this.renderSpinner(null===(t=this.configuration)||void 0===t?void 0:t.spinnerColor),i.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%"}},i.default.createElement(c.a,{key:"camera",configuration:this.configuration,videoConstraints:e.videoConstraints,mirrored:e.mirrored,preferredCamera:this.configuration.preferredCamera,onReady:this.onVideoReady,onError:this.onVideoError,ref:t=>{this.camera=t}})),i.default.createElement(u.a,{ref:t=>{this.finder=t},guidanceConfiguration:this.configuration.userGuidance,configuration:this.configuration.finder})))}}},function(t,e,n){"use strict";n.r(e);var i=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,o=function(t){var e={};return function(n){return void 0===e[n]&&(e[n]=t(n)),e[n]}}((function(t){return i.test(t)||111===t.charCodeAt(0)&&110===t.charCodeAt(1)&&t.charCodeAt(2)<91}));e.default=o}])}));
36
+ to {transform: rotate(${a}deg) scale(${o});
37
+ }`,l=mt.a.div`position: absolute; animation: ${s} ${i}s;`;return this.previousScale=o,W.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute"},ref:t=>this.container=t},W.default.createElement(l,{style:{width:this.calculate(t,"width"),height:this.calculate(t,"height"),transform:`rotate(${a}deg) scale(${o})`,marginTop:this.marginWithAspect(e,"y",t),marginLeft:this.marginWithAspect(e,"x",t)},onAnimationStart:()=>{this.animating=!0},onAnimationEnd:()=>{this.animating=!1}},this.props.children))}marginWithAspect(t,e,n){if(!t||!n)return 0;n.width,n.height;return t[e]}calculate(t,e){return t?t[e]:"100%"}}class eu extends W.default.Component{componentDidMount(){rl.disableScreenMovement()}componentWillUnmount(){rl.enableScreenMovement()}render(){return W.default.createElement("div",null)}}class nu{constructor(t,e){this.element=t,this.size=e}}class ou{}class iu extends W.default.Component{render(){return W.default.createElement("div",{style:this.props.style},W.default.createElement("svg",null,this.vertical(),this.horizontal()))}half(){return this.props.size/2}vertical(){const t=this.half();return W.default.createElement("line",{x1:t,y1:0,x2:t,y2:this.props.size,stroke:this.props.color,strokeWidth:"2"})}horizontal(){const t=this.half();return W.default.createElement("line",{x1:0,y1:t,x2:this.props.size,y2:t,stroke:this.props.color,strokeWidth:"2"})}}class ru extends W.default.Component{get crosshairSize(){var t,e;return null===(e=null===(t=this.props.style)||void 0===t?void 0:t.crosshair)||void 0===e?void 0:e.size}constructor(t){super(t),this.MAX_ROTATIONS=4,this.state={frame:g.a.empty(),cropImageFitSize:Ys.a.empty(),rotation:{count:0,scale:1},margin:{left:this.props.style.margin,top:this.props.style.margin},container:{width:0},scale:{width:1,height:1}}}style(){return{container:{marginLeft:this.state.margin.left,marginTop:this.state.margin.top,width:this.state.frame.width,height:this.state.frame.height,borderRadius:this.props.style.size/2,border:this.props.style.border.width+"px solid "+this.props.style.border.color,position:"absolute",overflow:"hidden",zIndex:50,transform:"rotate("+90*this.state.rotation.count+"deg)"},image:{width:this.state.cropImageFitSize.width*this.props.style.zoom,height:this.state.cropImageFitSize.height*this.props.style.zoom,marginLeft:-this.state.frame.x,marginTop:-this.state.frame.y,objectFit:"cover"},crosshair:{margin:"auto",position:"absolute",width:this.crosshairSize,height:this.crosshairSize,top:this.state.frame.height/2-this.crosshairSize/2,left:this.state.frame.width/2-this.crosshairSize/2}}}render(){return this.state.visible?W.default.createElement("div",{style:this.style().container},W.default.createElement("img",{style:this.style().image,ref:t=>this.destination=t,src:this.props.src,alt:"."}),W.default.createElement(iu,{style:this.style().crosshair,size:this.crosshairSize,color:this.props.style.crosshair.color})):null}update(t){if(!this.state.visible)return;this.destination.src=t.source.element.src;const e=g.a.fromPoint(ws.a.scaleUpTo(t.origin,new Ys.a(this.props.style.zoom,this.props.style.zoom)),this.props.style.size),n=t.container.width-(this.props.style.margin+this.props.style.size),o=this.isPointTopLeft(t.origin,t.source.size,t.rotations);this.setState({frame:e,cropImageFitSize:t.source.size,rotation:{count:t.rotations,scale:t.scale},margin:{left:o?n:this.props.style.margin},container:{width:t.container.width},scale:{width:t.source.size.width/t.container.width,height:t.source.size.height/t.container.height}})}isPointTopLeft(t,e,n){const o=t.x,i=t.y,r=this.normalizeRotations(n),a=this.state.container.width/4;return 0===r?o<a&&i<a:1===r?o<a&&i>e.height-a:2===r?o>e.width-a&&i>e.height-a:o>e.width-a&&i<a}setIsVisible(t,e){this.setState({visible:t},e)}normalizeRotations(t){return t%this.MAX_ROTATIONS}}var au=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class su extends W.default.Component{constructor(t){super(t),this.onResizeCallback=()=>{},this.MAX_ROTATIONS=4,this.BASE_SCALE=1,this.state={image:void 0,documentDetectionResult:void 0,polygon:void 0,calculatedSize:Ys.a.empty(),animation:{rotations:0,scale:1,duration:0},points:[],magneticLines:{horizontal:{original:[],scaled:[]},vertical:{original:[],scaled:[]}},imageMargin:ws.a.empty()},this.onResizeCallback=this.onResize.bind(this)}static create(t){return au(this,void 0,void 0,(function*(){const e=document.getElementById(t.containerId);if(!e)throw Error("Unable to initialize cropping component: Cannot find container element with the id provided.");return new Promise(((n,o)=>{Object(W.render)(W.default.createElement(su,{onReady:n,onError:o,container:e,configuration:Qc.fromJson(t)}),e)}))}))}componentDidMount(){var t,e,n;return au(this,void 0,void 0,(function*(){const o=null===(t=this.configuration)||void 0===t?void 0:t.image,i=yield mu.instance.detectAndCropDocument(o),r=yield b.toDataUrl(yield mu.instance.imageToJpeg(o));this.setState({documentDetectionResult:i,image:r,polygon:null!==(n=null===(e=this.configuration)||void 0===e?void 0:e.polygon)&&void 0!==n?n:i.pointsNormalized,magneticLines:{vertical:{original:i.verticalLinesNormalized},horizontal:{original:i.horizontalLinesNormalized}}}),this.props.onReady&&this.props.onReady(this),addEventListener("resize",this.onResizeCallback),addEventListener("orientationchange",this.onResizeCallback)}))}componentWillUnmount(){return au(this,void 0,void 0,(function*(){removeEventListener("resize",this.onResizeCallback),removeEventListener("orientationchange",this.onResizeCallback)}))}onImageLoaded(t){return au(this,void 0,void 0,(function*(){Ys.a.isEmpty(this.state.calculatedSize)&&(this.htmlImage=t,this.initializeSizes())}))}onResize(){const t=this.state.points.map((t=>new ws.a(t.x/this.state.calculatedSize.width,t.y/this.state.calculatedSize.height)));this.initializeSizes(t)}initializeSizes(t,e,n){const o=new Ys.a(this.htmlImage.naturalWidth,this.htmlImage.naturalHeight),i=new Ys.a(this.container.width(),this.container.height()),r=b.getObjectFitSize(i,o),a=new Ys.a(r.width,r.height),s=null!=t?t:this.state.polygon,l=rl.convertToViewportPointsFromParentSize(a,s),c=null!=e?e:this.state.magneticLines.horizontal.original,u=null!=n?n:this.state.magneticLines.vertical.original,d=rl.convertLinesToViewportLines(a,c),h=rl.convertLinesToViewportLines(a,u);this.setState({calculatedSize:a,points:l,magneticLines:{horizontal:{original:c,scaled:d},vertical:{original:u,scaled:h}},animation:{duration:0,rotations:this.rotations,scale:this.calculateScale(0,this.rotations,a)},imageMargin:this.calculateMargin(a)})}render(){var t,e,n,o,i,r;const a=wc.CLASSNAME,s=zs()({[a]:!0,[`${a}-visible`]:!0}),l=this.configuration.style.polygon.width,c=(null===(t=this.state.animation)||void 0===t?void 0:t.scale)?l/this.state.animation.scale:l,u=this.configuration.style.padding||0,d=`calc(100% - 2*${u}px)`;return W.default.createElement("div",{style:{position:"relative",width:d,height:d,padding:u}},W.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},this.configuration.disableScroll&&W.default.createElement(eu,null),W.default.createElement(ru,{ref:t=>this.magnifier=t,style:this.configuration.style.magnifier}),W.default.createElement(tu,{ref:t=>this.container=t,size:this.state.calculatedSize,rotations:null===(e=this.state.animation)||void 0===e?void 0:e.rotations,scale:null===(n=this.state.animation)||void 0===n?void 0:n.scale,duration:null===(o=this.state.animation)||void 0===o?void 0:o.duration,imageMargin:this.state.imageMargin},W.default.createElement(Jc,{src:this.state.image,onImageLoaded:t=>this.onImageLoaded(t)}),W.default.createElement(Kc,{style:{width:"100%",height:"100%",zIndex:500},size:this.state.calculatedSize,polygonStyle:{cursor:"pointer",stroke:this.configuration.style.polygon.color,strokeWidth:`${c}px`},handleStyle:this.configuration.style.polygon.handles,magneticLineStyle:this.configuration.style.magneticLines,polygonClasses:s,points:this.state.points,rotations:null===(i=this.state.animation)||void 0===i?void 0:i.rotations,scale:null===(r=this.state.animation)||void 0===r?void 0:r.scale,magneticLines:this.state.magneticLines,cornerMoveStart:this.showMagnifier.bind(this),cornerMoved:this.updateMagnifier.bind(this),cornerMoveEnd:this.hideMagnifier.bind(this)}))))}showMagnifier(t){var e;null===(e=this.magnifier)||void 0===e||e.setIsVisible(!0,(()=>{var e;null===(e=this.magnifier)||void 0===e||e.update(this.magnifierOptions(t))}))}updateMagnifier(t){var e;null===(e=this.magnifier)||void 0===e||e.update(this.magnifierOptions(t))}magnifierOptions(t){const e=new ou;return e.source=new nu(this.htmlImage,this.state.calculatedSize),e.container=new Ys.a(this.container.width(),this.container.height()),e.origin=t.point,e.rotations=this.state.animation.rotations,e.scale=this.state.animation.scale,e}hideMagnifier(){var t;null===(t=this.magnifier)||void 0===t||t.setIsVisible(!1)}apply(){var t;return au(this,void 0,void 0,(function*(){const e=ws.a.toPolygon(this.state.points,this.state.calculatedSize),n=this.toCoreRotations(this.rotations),o=yield mu.instance.imageCrop(null===(t=this.configuration)||void 0===t?void 0:t.image,e);return{image:yield mu.instance.imageRotate(o,n,"CONSUME_IMAGE"),polygon:e,rotations:this.rotations}}))}toCoreRotations(t){switch(t%this.MAX_ROTATIONS){case 0:return"NONE";case 1:return"CLOCKWISE_90";case 2:return"CLOCKWISE_180";case 3:return"COUNTERCLOCKWISE_90"}}rotate(t){return au(this,void 0,void 0,(function*(){if(this.container.isAnimating())return void console.warn("Unable to rotate: previous rotation animation in progress");const e=this.calculateScale(this.rotations,t,this.state.calculatedSize);this.setState({animation:{rotations:this.rotations+t,scale:e,duration:1}})}))}detect(){return au(this,void 0,void 0,(function*(){const t=this.state.documentDetectionResult;this.initializeSizes(t.pointsNormalized,t.horizontalLinesNormalized,t.verticalLinesNormalized)}))}dispose(){const{container:t}=this.props;if(!t)throw Error("Component wasn't created with openCroppingView. Remove component from render tree to dispose.");Object(W.render)(null,t)}get rotations(){var t,e;const n=null===(t=this.state.animation)||void 0===t?void 0:t.rotations;return n&&0!==n?n:null!==(e=this.configuration.rotations)&&void 0!==e?e:0}get configuration(){return this._configuration||(this._configuration=Qc.fromJson(this.props.configuration)),this._configuration}calculateScale(t,e,n){return e?(t+e)%2==0?this.BASE_SCALE:this.calculateRatio(n):this.BASE_SCALE}calculateRatio(t){return Math.min(this.container.width()/t.height,this.container.height()/t.width)}calculateMargin(t){return t.width>t.height?{x:0,y:this.container.height()/2-t.height/2}:{x:this.container.width()/2-t.width/2,y:0}}}var lu=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};ht.a;ht.b;class cu extends ht.c{constructor(t){super(t),this.shouldComputeSize=!0,this.paused=!1,this.updateDimensionsCallback=this.updateDimensions.bind(this),Object.assign(this.state,{isFinderVisible:!0})}get configuration(){return this.props.configuration}get enabled(){return!this.disposed}static create(t,e,n){return lu(this,void 0,void 0,(function*(){const o=document.getElementById(t.containerId);if(!o)throw Error("Unable to initialize ScanbotSDK: Cannot find container element with the id provided.");return new Promise(((i,r)=>{Object(W.render)(W.default.createElement(cu,{container:o,configuration:t,onTextDetected:e,onSuccess:i,onFailure:r,textDataScanner:n}),o)}))}))}isDetectionPaused(){return this.paused}resumeDetection(){return lu(this,void 0,void 0,(function*(){il.warn("TextData detection resumed"),yield this.resume()}))}pauseDetection(){il.warn("TextData detection paused"),this.pause()}componentDidMount(){const t=Object.create(null,{componentDidMount:{get:()=>super.componentDidMount}});return lu(this,void 0,void 0,(function*(){t.componentDidMount.call(this),window.addEventListener("resize",this.updateDimensionsCallback),yield this.resume()}))}componentWillUnmount(){super.componentWillUnmount(),this.pause(),this.props.textDataScanner.release(),window.removeEventListener("resize",this.updateDimensionsCallback)}updateDimensions(){return lu(this,void 0,void 0,(function*(){this.shouldComputeSize=!0,this.forceUpdate()}))}resume(){return lu(this,void 0,void 0,(function*(){this.paused=!1,yield this.detect()}))}pause(){this.props.textDataScanner.cleanRecognitionQueue(),this.paused=!0}detect(){var t,e,n,o;return lu(this,void 0,void 0,(function*(){const i=this.shouldComputeSize;if(!this.enabled)return;if(this.paused)return;let r=!1;try{this.camera.finderFrame=null===(t=this.finder)||void 0===t?void 0:t.holeRect;const n=yield null===(e=this.camera)||void 0===e?void 0:e.createImageData(cu.FRAME_RESOLUTION);if(!n)return;i&&this.forceUpdate();const o=yield this.props.textDataScanner.recognize(n);if(!this.enabled)return;if(null===o)return;o&&(r=!0,this.props.onTextDetected(o),this.camera.reusableImageBuffer=o.originalImage.data)}catch(t){null===(o=(n=this.configuration).onError)||void 0===o||o.call(n,t)}finally{r?setTimeout((()=>{requestAnimationFrame(this.detect.bind(this))}),200):requestAnimationFrame(this.detect.bind(this))}}))}saveExtractedImageData(){this.camera.saveExtractedData()}render(){var t;return W.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},this.renderSpinner(null===(t=this.configuration)||void 0===t?void 0:t.spinnerColor),W.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%"}},W.default.createElement(ft.a,{configuration:this.configuration,videoConstraints:this.configuration.videoConstraints,mirrored:this.configuration.mirrored,preferredCamera:this.configuration.preferredCamera,onReady:this.onVideoReady,onError:this.onVideoError,ref:t=>{this.camera=t}})),this.state.isFinderVisible&&W.default.createElement(pt.a,{ref:t=>{this.finder=t},guidanceConfiguration:this.configuration.userGuidance,configuration:this.configuration.finder}))}}cu.FRAME_RESOLUTION=1200;var uu=cu,du=n(35),hu=n(25),fu=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class pu{static get UI(){if(!i.BUILD_WITH_UI)throw new Error("UI components are not included in Scanbot.min.js. Please use ScanbotSDK.ui2.min.js instead.");return pu._ui2}static initialize(t){var e;return fu(this,void 0,void 0,(function*(){const n=new pu,o=t.engine||pu.defaultEnginePath,a=!!t.allowThreads,s=null!==(e=t.requestSuffix)&&void 0!==e?e:`?${n.version}`,l=[t.licenseKey,o,window.location.hostname,i.CDN_PATH+i.DEFAULT_WASM_FOLDER,{captureConsole:!1,allowThreads:a,requestSuffix:s}];return n.bridge=new u(o,{allowSimd:!0,allowThreads:a,requestSuffix:s},l),pu.instance=n,window.scanbotSdk=n,I.a.initialize(t.verboseLogging),t.allowThreads&&!Object(r.a)()&&(I.a.debugWarn("Threads are not available in this environment. The SDK will run in single-threaded mode."),window.hasOwnProperty("crossOriginIsolated")&&!window.crossOriginIsolated&&I.a.debugWarn("The site is not cross-origin isolated. This prevents multithreading in the ScanbotSDK. To enable multithreading, you need to set the 'Cross-Origin-Opener-Policy' and 'Cross-Origin-Embedder-Policy' http headers. See our documentation for details.")),this.cameras.initialize(null==t?void 0:t.bestCameraDetectionStrategy),n}))}createDocumentScanner(t){return fu(this,void 0,void 0,(function*(){let e;try{return e=yield Bc.create(t),yield this.licenseCheck(),e}catch(t){throw e&&e.dispose(),t}}))}createMrzScanner(t){return fu(this,void 0,void 0,(function*(){let e;try{const n=new S(this,this.bridge.copyArgs.createMRZRecognizer(t.recognizerConfiguration));return e=yield Wc.create(t,n),yield this.licenseCheck(),e}catch(t){throw e&&e.dispose(),t}}))}createBarcodeScanner(t){return fu(this,void 0,void 0,(function*(){let e;try{return e=yield sl.create(t),yield this.licenseCheck(),e}catch(t){throw e&&e.dispose(),t}}))}openCroppingView(t){return fu(this,void 0,void 0,(function*(){return yield this.licenseCheck(),yield su.create(t)}))}createTextDataScanner(t){return fu(this,void 0,void 0,(function*(){try{t=k.fromJson(t);const e=yield this.createGenericTextLineScanner(t,t.onTextDetected,t.ocrConfiguration);return yield this.licenseCheck(),e}catch(t){throw t}}))}createVINScanner(t){return fu(this,void 0,void 0,(function*(){let e;try{t=D.fromJson(t);const n=e=>{""!==e.rawText&&t.onTextDetected(e)},o=new T.GenericTextLineScannerTypes.ScannerConfiguration(Object.assign(Object.assign({},t.ocrConfiguration),{validator:new T.GenericTextLineScannerTypes.PresetContentValidator({preset:"VEHICLE_IDENTIFICATION_NUMBER"})}));return e=yield this.createGenericTextLineScanner(t,n,o),yield this.licenseCheck(),e}catch(t){throw e&&e.dispose(),t}}))}createGenericDocumentRecognizerScanner(t){return fu(this,void 0,void 0,(function*(){let e;try{const o=n(48).default;return e=yield o.create(this,t),yield this.licenseCheck(),e}catch(t){throw e&&e.dispose(),t}}))}toDataUrl(t){return fu(this,void 0,void 0,(function*(){return B.throwIfMissingBuffer(t),yield b.toDataUrl(t)}))}detectDocument(t,e={},n="COPY_IMAGE"){return fu(this,void 0,void 0,(function*(){yield this.licenseCheck(),B.throwIfMissingBuffer(t);const o=yield this.bridge.copyArgs.createDocumentDetector(e),i=this.getBridge(n),r=yield i.documentDetectorDetect(o,t);return yield this.release(o,"documentDetector"),r}))}detectAndCropDocument(t,e="COPY_IMAGE"){return fu(this,void 0,void 0,(function*(){yield this.licenseCheck(),B.throwIfMissingBuffer(t);const n=this.getBridge(e);return yield n.detectAndCropDocument(t)}))}detectBarcodes(t,e={},n="COPY_IMAGE"){return fu(this,void 0,void 0,(function*(){yield this.licenseCheck(),B.throwIfMissingBuffer(t),"string"==typeof t&&(t=yield b.loadFromUrl(t));const o=Object.assign({},e);o.live=!1;const i=yield this.bridge.copyArgs.createBarcodeRecognizer(o),r=yield this.getBridge(n).recognizeBarcodes(i,t);return yield this.release(i,"barcodeRecognizer"),r}))}parseBarcodeDocument(t,e){return fu(this,void 0,void 0,(function*(){return yield this.licenseCheck(),yield this.bridge.copyArgs.parseBarcodeDocument(t,e)}))}createSimpleMRZRecognizer(){return fu(this,void 0,void 0,(function*(){const t=new T.MRZTypes.RecognizerConfiguration({accumulatedResultsVerifierConfig:{maximumNumberOfAccumulatedFrames:0}});return new S(this,this.bridge.copyArgs.createMRZRecognizer(t))}))}createOcrEngine(){return fu(this,void 0,void 0,(function*(){return new x(this,yield this.bridge.copyArgs.createOcrEngine())}))}createDocumentQualityAnalyzer(t={}){return fu(this,void 0,void 0,(function*(){const e=yield this.bridge.copyArgs.createDocumentQualityAnalyzer(t);return new R(this,e)}))}imageRotate(t,e,n="COPY_IMAGE"){return fu(this,void 0,void 0,(function*(){B.throwIfMissingBuffer(t);const o=this.getBridge(n);return yield o.imageRotate(t,e)}))}imageFilter(t,e,n="COPY_IMAGE"){return fu(this,void 0,void 0,(function*(){B.throwIfMissingBuffer(t);const o=this.getBridge(n);return yield o.imageApplyFilter(t,e)}))}imageCrop(t,e,n="COPY_IMAGE"){return fu(this,void 0,void 0,(function*(){B.throwIfMissingBuffer(t);const o=this.getBridge(n);return yield o.imageCrop(t,e)}))}imageResize(t,e,n="COPY_IMAGE"){return fu(this,void 0,void 0,(function*(){B.throwIfMissingBuffer(t);const o=this.getBridge(n);return yield o.imageResize(t,e)}))}getLicenseInfo(){return fu(this,void 0,void 0,(function*(){const t=yield this.bridge.copyArgs.getLicenseInfo();return d.fromJson(t)}))}beginPdf(t){return fu(this,void 0,void 0,(function*(){return yield this.licenseCheck(),new f(this,yield this.bridge.copyArgs.beginPdf(t))}))}beginTiff(t={}){return fu(this,void 0,void 0,(function*(){return yield this.licenseCheck(),new m(this,yield this.bridge.copyArgs.beginTiff(t))}))}createGenericDocumentRecognizer(t){return fu(this,void 0,void 0,(function*(){return yield this.licenseCheck(),new dc(this,yield this.bridge.copyArgs.genericDocumentRecognizerCreate(t))}))}imageToJpeg(t,e="COPY_IMAGE"){return fu(this,void 0,void 0,(function*(){yield this.licenseCheck();return this.getBridge(e).encodeJpeg(t)}))}get version(){return i.VERSION}get utils(){return this._utils||(this._utils=new y),this._utils}release(t,e){return fu(this,void 0,void 0,(function*(){t&&(I.a.debug(`Releasing object ${null!=e?e:"unknown"}`),yield this.bridge.copyArgs.releaseObject(t))}))}getBridge(t){return"CONSUME_IMAGE"===t?this.bridge.transferArgs:this.bridge.copyArgs}licenseCheck(){return fu(this,void 0,void 0,(function*(){const t=yield this.getLicenseInfo();if(!t.isValid())throw console.error(`LicenseError: ${t.status}`),new P(t)}))}createGenericTextLineScanner(t,e,n){return fu(this,void 0,void 0,(function*(){const o=this.bridge.copyArgs.createGenericTextLineScanner(n),i=new L(this,o);return yield uu.create(t,e,i)}))}destroy(){this.bridge.destroy(),pu.instance=void 0}}pu.defaultEnginePath="",pu._ui2=i.BUILD_WITH_UI?cc:void 0,pu.cameras=hu.a.INSTANCE,pu.Config=T,pu._stats=du.a.INSTANCE;var mu=e.a=pu},function(t,e,n){"use strict";var o=n(38),i=n.n(o)()((function(t){return t[1]}));i.push([t.i,"\n.scanbot-shutter-fade-in {\n opacity: 1;\n}\n\n.scanbot-shutter-fade-out {\n opacity: 0;\n}\n\n.scanbot-shutter-rotate {\n animation: scanbot-shutter-rotating linear infinite;\n}\n\n.scanbot-shutter-pulse-fast {\n animation: scanbot-shutter-pulsing 1s ease-in-out infinite;\n}\n\n.scanbot-shutter-button {\n position: relative;\n width: 64px;\n height: 64px;\n left: 50%;\n bottom: 12px;\n transform: translate(-50%, -100%);\n}\n\n.scanbot-shutter-button-part {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n transition: opacity 0.5s ease-in-out;\n}\n\n@keyframes scanbot-shutter-rotating {\n to {\n transform: rotate(360deg);\n }\n}\n\n@keyframes scanbot-shutter-pulsing {\n 0% {\n opacity: 0.25;\n }\n 50% {\n opacity: 0.8;\n }\n 100% {\n opacity: 0.25;\n }\n}\n",""]),e.a=i},function(t,e,n){"use strict";var o=n(38),i=n.n(o)()((function(t){return t[1]}));i.push([t.i,".scanbot-document-hint-text {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n text-align: center;\n background-color: rgba(0, 0, 0, 0.4);\n color: white;\n border-radius: 0.25em;\n padding: 0.05em 0.3em 0.05em 0.3em;\n font-family: sans-serif;\n font-size: 0.9em;\n font-weight: 300;\n}\n",""]),e.a=i},function(t,e){var n,o,i=t.exports={};function r(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(n===setTimeout)return setTimeout(t,0);if((n===r||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:r}catch(t){n=r}try{o="function"==typeof clearTimeout?clearTimeout:a}catch(t){o=a}}();var l,c=[],u=!1,d=-1;function h(){u&&l&&(u=!1,l.length?c=l.concat(c):d=-1,c.length&&f())}function f(){if(!u){var t=s(h);u=!0;for(var e=c.length;e;){for(l=c,c=[];++d<e;)l&&l[d].run();d=-1,e=c.length}l=null,u=!1,function(t){if(o===clearTimeout)return clearTimeout(t);if((o===a||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(t);try{o(t)}catch(e){try{return o.call(null,t)}catch(e){return o.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function m(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];c.push(new p(t,e)),1!==c.length||u||s(f)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=m,i.addListener=m,i.once=m,i.off=m,i.removeListener=m,i.removeAllListeners=m,i.emit=m,i.prependListener=m,i.prependOnceListener=m,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e,n){const{render:o,hydrate:i,unmountComponentAtNode:r}=n(0);function a(t){return{render(e){o(e,t)},unmount(){r(t)}}}e.createRoot=a,e.hydrateRoot=function(t,e){return i(e,t),a(t)}},function(t,e){t.exports=function(t,e,n,o){var i=n?n.call(o,t,e):void 0;if(void 0!==i)return!!i;if(t===e)return!0;if("object"!=typeof t||!t||"object"!=typeof e||!e)return!1;var r=Object.keys(t),a=Object.keys(e);if(r.length!==a.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(e),l=0;l<r.length;l++){var c=r[l];if(!s(c))return!1;var u=t[c],d=e[c];if(!1===(i=n?n.call(o,u,d,c):void 0)||void 0===i&&u!==d)return!1}return!0}},function(t,e,n){"use strict";e.a={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1}},function(t,e,n){"use strict";function o(t){var e=Object.create(null);return function(n){return void 0===e[n]&&(e[n]=t(n)),e[n]}}n.d(e,"a",(function(){return r}));var i=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,r=o((function(t){return i.test(t)||111===t.charCodeAt(0)&&110===t.charCodeAt(1)&&t.charCodeAt(2)<91}))},function(t,e,n){"use strict";n.r(e),n.d(e,"ScanbotSDK",(function(){return o}));const o=n(39).a},function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return h}));var o=n(0),i=n(12),r=n(14),a=n(22);class s extends a.a{constructor(){super(r.a.DEFAULT_VIDEO_RESOLUTION_HD),this.finder.aspectRatio={width:2,height:1},this.userGuidance.title.visible=!1}static fromJson(t){const e=new s;return this.mapValues(t,e,["videoConstraints","finder","userGuidance"]),this.mapFinderConfiguration(e,t),this.mapVideoConstraints(t,e),e}}var l=n(9),c=n(23),u=n(26),d=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};i.a;class h extends i.c{constructor(t){super(t),this.enabled=!0,this.configuration=t.configuration}static create(t,e){var n;return d(this,void 0,void 0,(function*(){const i=null!==(n=e.container)&&void 0!==n?n:document.getElementById(e.containerId);if(e=s.fromJson(e),!i)throw Error("Unable to initialize ScanbotSDK: Cannot find container element with the id provided.");return new Promise(((n,r)=>{Object(o.render)(o.default.createElement(h,{container:i,configuration:e,onSuccess:n,onFailure:r,sdk:t}),i)}))}))}componentDidMount(){var t,e;super.componentDidMount();try{this.genericDocumentRecognizer=this.props.sdk.createGenericDocumentRecognizer(this.configuration.detectorParameters)}catch(n){null===(e=(t=this.configuration).onError)||void 0===e||e.call(t,n)}this.detect()}componentWillUnmount(){const t=Object.create(null,{componentWillUnmount:{get:()=>super.componentWillUnmount}});return d(this,void 0,void 0,(function*(){t.componentWillUnmount.call(this),this.enabled=!1,yield(yield this.genericDocumentRecognizer).release()}))}detect(){var t,e,n,o,r,a;return d(this,void 0,void 0,(function*(){try{if(!this.enabled)return;this.camera.finderFrame=null===(t=this.finder)||void 0===t?void 0:t.holeRect;const r=yield null===(e=this.camera)||void 0===e?void 0:e.createImageData(i.c.DEFAULT_DETECTION_RESOLUTION);if(!r)return;const a=yield(yield this.genericDocumentRecognizer).recognize(r,new l.GenericDocumentRecognizerTypes.RecognitionParameters({mode:"LIVE"}),"CONSUME_IMAGE");if(!this.enabled)return;this.camera.reusableImageBuffer=a.originalImage.data,null===(o=(n=this.configuration).onDocumentDetected)||void 0===o||o.call(n,a)}catch(t){null===(a=(r=this.configuration).onError)||void 0===a||a.call(r,t)}finally{requestAnimationFrame((()=>this.detect()))}}))}render(){var t;const e=this.configuration;return o.default.createElement(o.default.Fragment,null,o.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},this.renderSpinner(null===(t=this.configuration)||void 0===t?void 0:t.spinnerColor),o.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%"}},o.default.createElement(c.a,{key:"camera",configuration:this.configuration,videoConstraints:e.videoConstraints,mirrored:e.mirrored,preferredCamera:this.configuration.preferredCamera,onReady:this.onVideoReady,onError:this.onVideoError,ref:t=>{this.camera=t}})),this.configuration.finder.visible&&o.default.createElement(u.a,{ref:t=>{this.finder=t},guidanceConfiguration:this.configuration.userGuidance,configuration:this.configuration.finder})))}}},function(t,e,n){"use strict";n.r(e);var o=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,i=function(t){var e={};return function(n){return void 0===e[n]&&(e[n]=t(n)),e[n]}}((function(t){return o.test(t)||111===t.charCodeAt(0)&&110===t.charCodeAt(1)&&t.charCodeAt(2)<91}));e.default=i}])}));