jclib-ui 1.0.262 → 1.0.264
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/jclib-ui.css +1 -1
- package/dist/jclib-ui.es.js +17490 -17494
- package/dist/jclib-ui.es.js.map +1 -1
- package/dist/jclib-ui.umd.js +31 -30
- package/dist/jclib-ui.umd.js.map +1 -1
- package/dist/src/lib/panelDashboard/PanelDashboard.d.ts +2 -1
- package/package.json +1 -1
package/dist/jclib-ui.umd.js
CHANGED
|
@@ -253,7 +253,7 @@
|
|
|
253
253
|
cursor: ${t=>t.onClick?"pointer":"default"};
|
|
254
254
|
`;const Ce=({...t})=>Qt.jsx("i",{className:"fas fa-sign-out-alt",...t}),Ae=()=>Qt.jsx("i",{className:"fa-solid fa-plus"}),Ee=()=>Qt.jsx("i",{className:"fas fa-pencil-alt"}),Ie=()=>Qt.jsx("i",{className:"fas fa-trash-alt"}),Se=()=>Qt.jsx("i",{className:"fas fa-search"}),xe=()=>Qt.jsx("i",{className:"fa-solid fa-xmark"}),Oe=()=>Qt.jsx("i",{className:"fa-solid fa-circle-question"}),Te=({...t})=>Qt.jsx("i",{className:"fa-solid fa-arrow-up-right-from-square",...t}),Ne=({...t})=>Qt.jsx("i",{className:"fa-solid fa-qrcode",...t});function ke({label:t,...e}){return Qt.jsxs("div",{className:"inp-color--container",children:[Qt.jsx("input",{type:"color",...e}),Qt.jsx("div",{children:t})]})}const Re=o.div`
|
|
255
255
|
margin: ${({noMargin:t})=>t?"0":"5px 0 8px"};
|
|
256
|
-
border: 1px solid var(--
|
|
256
|
+
border: 1px solid var(--pn-color-border);
|
|
257
257
|
border-radius: ${t=>t.open?"0 0 var(--pn-border-radius) var(--pn-border-radius)":"0"};
|
|
258
258
|
background-color: var(--bs-body-bg);
|
|
259
259
|
//overflow: hidden;
|
|
@@ -263,10 +263,10 @@
|
|
|
263
263
|
outline: 0;
|
|
264
264
|
border: none;
|
|
265
265
|
border-bottom: ${({open:t})=>t?"1":"0"}px solid
|
|
266
|
-
var(--
|
|
267
|
-
border-left:
|
|
266
|
+
var(--pn-color-border);
|
|
267
|
+
border-left: 6px solid var(--bi-color-detail);
|
|
268
268
|
background-color: var(--bi-color-button);
|
|
269
|
-
color: var(--bi-color-
|
|
269
|
+
color: var(--bi-color-font);
|
|
270
270
|
font-size: 1.2rem;
|
|
271
271
|
font-weight: bold;
|
|
272
272
|
padding: 6px 12px;
|
|
@@ -279,7 +279,7 @@
|
|
|
279
279
|
|
|
280
280
|
i.setas-bi {
|
|
281
281
|
font-size: 1.4rem;
|
|
282
|
-
color:
|
|
282
|
+
color: var(--bi-color-font);
|
|
283
283
|
transition: all ease 0.3s;
|
|
284
284
|
transform: rotate(${t=>t.open?"-180":"0"}deg);
|
|
285
285
|
}
|
|
@@ -411,6 +411,7 @@
|
|
|
411
411
|
color: var(--pn-color-font);
|
|
412
412
|
font-size: 1.2rem;
|
|
413
413
|
background-color: var(--pn-color);
|
|
414
|
+
background: var(--pn-degrade);
|
|
414
415
|
border-radius: var(--pn-internal-radius) var(--pn-internal-radius) 0 0;
|
|
415
416
|
|
|
416
417
|
padding: var(--pn-padding);
|
|
@@ -433,13 +434,7 @@
|
|
|
433
434
|
display: none;
|
|
434
435
|
}
|
|
435
436
|
}
|
|
436
|
-
`;function ze({value:t,isCount:e,...r}){let n;return n="number"==typeof t?e?Math.min(t,9999):t<=0?"Inclusão":`#${t}`:t,Qt.jsx("div",{className:"badge bg-info text-dark",style:{borderRadius:"var(--pn-border-radius)"},...r,children:n})}let We="/home";function Ge({title:t,count:e,codigo:r,goBack:n,goHome:o,onClose:i,children:s,maxWidth:u,className:l="",helpLink:c="",...h}){const f=a.useHistory(),d=e&&"number"==typeof e?e:0,p=d>9999?"9999+":d,g=Intl.NumberFormat("pt-br",{}).format(d),m=()=>{if(i)return i();n?f.goBack():f.push(We)},v=h.style||{};return u&&(v.maxWidth=u,h.style=v),Qt.jsxs("div",{className:"panel--container "+l,...h,children:[Qt.jsxs(He,{children:[Qt.jsx("div",{className:"d-none d-sm-block",children:(n||o||i)&&Qt.jsx(Be,{title:"Fechar",onClick:m})}),Qt.jsxs("div",{className:"pn-title",children:[t,0!==d&&Qt.jsx(ze,{title:`Total de registros: ${g}`,value:p,isCount:!0}),Qt.jsx(ze,{value:r})]}),c&&Qt.jsx(Me,{title:"Ir para ajuda",onClick:()=>window.open(c,"_blank")}),(n||o||i)&&Qt.jsx(Pe,{title:"Fechar",onClick:m})]}),Qt.jsx("div",{className:"pn-body",children:s})]})}function Xe({fileTo:t,previewUrl:n,visible:o,setVisible:i}){const{addModal:a,removeModal:s}=ee(),[u]=e.useState("preview-"+r.random());return e.useEffect(()=>(o||s(u),()=>s(u)),[o]),e.useEffect(()=>{a(u,i)},[u]),Qt.jsxs("div",{className:"pr-box",children:[Qt.jsxs("div",{className:"pr-box--header",children:[Qt.jsxs("div",{className:"pr-box--title",children:[Qt.jsxs("div",{className:"pr-box--name",children:[Qt.jsx("div",{children:"Visualizar relatório:"}),Qt.jsx("div",{className:"fw-bold",children:t})]}),Qt.jsx("div",{children:Qt.jsxs("a",{href:n,download:t,children:[Qt.jsx("i",{className:"fa-solid fa-download me-2"}),"Salvar relatório"]})})]}),Qt.jsx("button",{className:"ms-4 btn btn-danger rounded-pill",onClick:i,children:Qt.jsx(xe,{})})]}),Qt.jsx("iframe",{className:"pr-box--preview",src:n})]})}function $e(t){
|
|
437
|
-
/*!
|
|
438
|
-
localForage -- Offline Storage, Improved
|
|
439
|
-
Version 1.10.0
|
|
440
|
-
https://localforage.github.io/localForage
|
|
441
|
-
(c) 2013-2017 Mozilla, Apache License 2.0
|
|
442
|
-
*/!function(t){t.exports=function t(e,r,n){function o(a,s){if(!r[a]){if(!e[a]){if(!s&&$e)return $e(a);if(i)return i(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var l=r[a]={exports:{}};e[a][0].call(l.exports,function(t){var r=e[a][1][t];return o(r||t)},l,l.exports,t,e,r,n)}return r[a].exports}for(var i=$e,a=0;a<n.length;a++)o(n[a]);return o}({1:[function(t,e,r){(function(t){var r,n,o=t.MutationObserver||t.WebKitMutationObserver;if(o){var i=0,a=new o(c),s=t.document.createTextNode("");a.observe(s,{characterData:!0}),r=function(){s.data=i=++i%2}}else if(t.setImmediate||void 0===t.MessageChannel)r="document"in t&&"onreadystatechange"in t.document.createElement("script")?function(){var e=t.document.createElement("script");e.onreadystatechange=function(){c(),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},t.document.documentElement.appendChild(e)}:function(){setTimeout(c,0)};else{var u=new t.MessageChannel;u.port1.onmessage=c,r=function(){u.port2.postMessage(0)}}var l=[];function c(){var t,e;n=!0;for(var r=l.length;r;){for(e=l,l=[],t=-1;++t<r;)e[t]();r=l.length}n=!1}function h(t){1!==l.push(t)||n||r()}e.exports=h}).call(this,void 0!==f?f:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(t,e,r){var n=t(1);function o(){}var i={},a=["REJECTED"],s=["FULFILLED"],u=["PENDING"];function l(t){if("function"!=typeof t)throw new TypeError("resolver must be a function");this.state=u,this.queue=[],this.outcome=void 0,t!==o&&d(this,t)}function c(t,e,r){this.promise=t,"function"==typeof e&&(this.onFulfilled=e,this.callFulfilled=this.otherCallFulfilled),"function"==typeof r&&(this.onRejected=r,this.callRejected=this.otherCallRejected)}function h(t,e,r){n(function(){var n;try{n=e(r)}catch(o){return i.reject(t,o)}n===t?i.reject(t,new TypeError("Cannot resolve promise with itself")):i.resolve(t,n)})}function f(t){var e=t&&t.then;if(t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof e)return function(){e.apply(t,arguments)}}function d(t,e){var r=!1;function n(e){r||(r=!0,i.reject(t,e))}function o(e){r||(r=!0,i.resolve(t,e))}function a(){e(o,n)}var s=p(a);"error"===s.status&&n(s.value)}function p(t,e){var r={};try{r.value=t(e),r.status="success"}catch(n){r.status="error",r.value=n}return r}function g(t){return t instanceof this?t:i.resolve(new this(o),t)}function m(t){var e=new this(o);return i.reject(e,t)}function v(t){var e=this;if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var r=t.length,n=!1;if(!r)return this.resolve([]);for(var a=new Array(r),s=0,u=-1,l=new this(o);++u<r;)c(t[u],u);return l;function c(t,o){function u(t){a[o]=t,++s!==r||n||(n=!0,i.resolve(l,a))}e.resolve(t).then(u,function(t){n||(n=!0,i.reject(l,t))})}}function y(t){var e=this;if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var r=t.length,n=!1;if(!r)return this.resolve([]);for(var a=-1,s=new this(o);++a<r;)u(t[a]);return s;function u(t){e.resolve(t).then(function(t){n||(n=!0,i.resolve(s,t))},function(t){n||(n=!0,i.reject(s,t))})}}e.exports=l,l.prototype.catch=function(t){return this.then(null,t)},l.prototype.then=function(t,e){if("function"!=typeof t&&this.state===s||"function"!=typeof e&&this.state===a)return this;var r=new this.constructor(o);return this.state!==u?h(r,this.state===s?t:e,this.outcome):this.queue.push(new c(r,t,e)),r},c.prototype.callFulfilled=function(t){i.resolve(this.promise,t)},c.prototype.otherCallFulfilled=function(t){h(this.promise,this.onFulfilled,t)},c.prototype.callRejected=function(t){i.reject(this.promise,t)},c.prototype.otherCallRejected=function(t){h(this.promise,this.onRejected,t)},i.resolve=function(t,e){var r=p(f,e);if("error"===r.status)return i.reject(t,r.value);var n=r.value;if(n)d(t,n);else{t.state=s,t.outcome=e;for(var o=-1,a=t.queue.length;++o<a;)t.queue[o].callFulfilled(e)}return t},i.reject=function(t,e){t.state=a,t.outcome=e;for(var r=-1,n=t.queue.length;++r<n;)t.queue[r].callRejected(e);return t},l.resolve=g,l.reject=m,l.all=v,l.race=y},{1:1}],3:[function(t,e,r){(function(e){"function"!=typeof e.Promise&&(e.Promise=t(2))}).call(this,void 0!==f?f:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{2:2}],4:[function(t,e,r){var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(){try{if("undefined"!=typeof indexedDB)return indexedDB;if("undefined"!=typeof webkitIndexedDB)return webkitIndexedDB;if("undefined"!=typeof mozIndexedDB)return mozIndexedDB;if("undefined"!=typeof OIndexedDB)return OIndexedDB;if("undefined"!=typeof msIndexedDB)return msIndexedDB}catch(t){return}}var a=i();function s(){try{if(!a||!a.open)return!1;var t="undefined"!=typeof openDatabase&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),e="function"==typeof fetch&&-1!==fetch.toString().indexOf("[native code");return(!t||e)&&"undefined"!=typeof indexedDB&&"undefined"!=typeof IDBKeyRange}catch(r){return!1}}function u(t,e){t=t||[],e=e||{};try{return new Blob(t,e)}catch(o){if("TypeError"!==o.name)throw o;for(var r=new("undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder),n=0;n<t.length;n+=1)r.append(t[n]);return r.getBlob(e.type)}}"undefined"==typeof Promise&&t(3);var l=Promise;function c(t,e){e&&t.then(function(t){e(null,t)},function(t){e(t)})}function h(t,e,r){"function"==typeof e&&t.then(e),"function"==typeof r&&t.catch(r)}function f(t){return"string"!=typeof t&&(console.warn(t+" used as a key, but it is not a string."),t=String(t)),t}function d(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}var p="local-forage-detect-blob-support",g=void 0,m={},v=Object.prototype.toString,y="readonly",_="readwrite";function w(t){for(var e=t.length,r=new ArrayBuffer(e),n=new Uint8Array(r),o=0;o<e;o++)n[o]=t.charCodeAt(o);return r}function b(t){return new l(function(e){var r=t.transaction(p,_),n=u([""]);r.objectStore(p).put(n,"key"),r.onabort=function(t){t.preventDefault(),t.stopPropagation(),e(!1)},r.oncomplete=function(){var t=navigator.userAgent.match(/Chrome\/(\d+)/),r=navigator.userAgent.match(/Edge\//);e(r||!t||parseInt(t[1],10)>=43)}}).catch(function(){return!1})}function C(t){return"boolean"==typeof g?l.resolve(g):b(t).then(function(t){return g=t})}function A(t){var e=m[t.name],r={};r.promise=new l(function(t,e){r.resolve=t,r.reject=e}),e.deferredOperations.push(r),e.dbReady?e.dbReady=e.dbReady.then(function(){return r.promise}):e.dbReady=r.promise}function E(t){var e=m[t.name].deferredOperations.pop();if(e)return e.resolve(),e.promise}function I(t,e){var r=m[t.name].deferredOperations.pop();if(r)return r.reject(e),r.promise}function S(t,e){return new l(function(r,n){if(m[t.name]=m[t.name]||B(),t.db){if(!e)return r(t.db);A(t),t.db.close()}var o=[t.name];e&&o.push(t.version);var i=a.open.apply(a,o);e&&(i.onupgradeneeded=function(e){var r=i.result;try{r.createObjectStore(t.storeName),e.oldVersion<=1&&r.createObjectStore(p)}catch(n){if("ConstraintError"!==n.name)throw n;console.warn('The database "'+t.name+'" has been upgraded from version '+e.oldVersion+" to version "+e.newVersion+', but the storage "'+t.storeName+'" already exists.')}}),i.onerror=function(t){t.preventDefault(),n(i.error)},i.onsuccess=function(){var e=i.result;e.onversionchange=function(t){t.target.close()},r(e),E(t)}})}function x(t){return S(t,!1)}function O(t){return S(t,!0)}function T(t,e){if(!t.db)return!0;var r=!t.db.objectStoreNames.contains(t.storeName),n=t.version<t.db.version,o=t.version>t.db.version;if(n&&(t.version!==e&&console.warn('The database "'+t.name+"\" can't be downgraded from version "+t.db.version+" to version "+t.version+"."),t.version=t.db.version),o||r){if(r){var i=t.db.version+1;i>t.version&&(t.version=i)}return!0}return!1}function N(t){return new l(function(e,r){var n=new FileReader;n.onerror=r,n.onloadend=function(r){var n=btoa(r.target.result||"");e({__local_forage_encoded_blob:!0,data:n,type:t.type})},n.readAsBinaryString(t)})}function k(t){return u([w(atob(t.data))],{type:t.type})}function R(t){return t&&t.__local_forage_encoded_blob}function D(t){var e=this,r=e._initReady().then(function(){var t=m[e._dbInfo.name];if(t&&t.dbReady)return t.dbReady});return h(r,t,t),r}function P(t){A(t);for(var e=m[t.name],r=e.forages,n=0;n<r.length;n++){var o=r[n];o._dbInfo.db&&(o._dbInfo.db.close(),o._dbInfo.db=null)}return t.db=null,x(t).then(function(e){return t.db=e,T(t)?O(t):e}).then(function(n){t.db=e.db=n;for(var o=0;o<r.length;o++)r[o]._dbInfo.db=n}).catch(function(e){throw I(t,e),e})}function M(t,e,r,n){void 0===n&&(n=1);try{var o=t.db.transaction(t.storeName,e);r(null,o)}catch(i){if(n>0&&(!t.db||"InvalidStateError"===i.name||"NotFoundError"===i.name))return l.resolve().then(function(){if(!t.db||"NotFoundError"===i.name&&!t.db.objectStoreNames.contains(t.storeName)&&t.version<=t.db.version)return t.db&&(t.version=t.db.version+1),O(t)}).then(function(){return P(t).then(function(){M(t,e,r,n-1)})}).catch(r);r(i)}}function B(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function L(t){var e=this,r={db:null};if(t)for(var n in t)r[n]=t[n];var o=m[r.name];o||(o=B(),m[r.name]=o),o.forages.push(e),e._initReady||(e._initReady=e.ready,e.ready=D);var i=[];function a(){return l.resolve()}for(var s=0;s<o.forages.length;s++){var u=o.forages[s];u!==e&&i.push(u._initReady().catch(a))}var c=o.forages.slice(0);return l.all(i).then(function(){return r.db=o.db,x(r)}).then(function(t){return r.db=t,T(r,e._defaultConfig.version)?O(r):t}).then(function(t){r.db=o.db=t,e._dbInfo=r;for(var n=0;n<c.length;n++){var i=c[n];i!==e&&(i._dbInfo.db=r.db,i._dbInfo.version=r.version)}})}function F(t,e){var r=this;t=f(t);var n=new l(function(e,n){r.ready().then(function(){M(r._dbInfo,y,function(o,i){if(o)return n(o);try{var a=i.objectStore(r._dbInfo.storeName).get(t);a.onsuccess=function(){var t=a.result;void 0===t&&(t=null),R(t)&&(t=k(t)),e(t)},a.onerror=function(){n(a.error)}}catch(s){n(s)}})}).catch(n)});return c(n,e),n}function j(t,e){var r=this,n=new l(function(e,n){r.ready().then(function(){M(r._dbInfo,y,function(o,i){if(o)return n(o);try{var a=i.objectStore(r._dbInfo.storeName).openCursor(),s=1;a.onsuccess=function(){var r=a.result;if(r){var n=r.value;R(n)&&(n=k(n));var o=t(n,r.key,s++);void 0!==o?e(o):r.continue()}else e()},a.onerror=function(){n(a.error)}}catch(u){n(u)}})}).catch(n)});return c(n,e),n}function V(t,e,r){var n=this;t=f(t);var o=new l(function(r,o){var i;n.ready().then(function(){return i=n._dbInfo,"[object Blob]"===v.call(e)?C(i.db).then(function(t){return t?e:N(e)}):e}).then(function(e){M(n._dbInfo,_,function(i,a){if(i)return o(i);try{var s=a.objectStore(n._dbInfo.storeName);null===e&&(e=void 0);var u=s.put(e,t);a.oncomplete=function(){void 0===e&&(e=null),r(e)},a.onabort=a.onerror=function(){var t=u.error?u.error:u.transaction.error;o(t)}}catch(l){o(l)}})}).catch(o)});return c(o,r),o}function U(t,e){var r=this;t=f(t);var n=new l(function(e,n){r.ready().then(function(){M(r._dbInfo,_,function(o,i){if(o)return n(o);try{var a=i.objectStore(r._dbInfo.storeName).delete(t);i.oncomplete=function(){e()},i.onerror=function(){n(a.error)},i.onabort=function(){var t=a.error?a.error:a.transaction.error;n(t)}}catch(s){n(s)}})}).catch(n)});return c(n,e),n}function H(t){var e=this,r=new l(function(t,r){e.ready().then(function(){M(e._dbInfo,_,function(n,o){if(n)return r(n);try{var i=o.objectStore(e._dbInfo.storeName).clear();o.oncomplete=function(){t()},o.onabort=o.onerror=function(){var t=i.error?i.error:i.transaction.error;r(t)}}catch(a){r(a)}})}).catch(r)});return c(r,t),r}function z(t){var e=this,r=new l(function(t,r){e.ready().then(function(){M(e._dbInfo,y,function(n,o){if(n)return r(n);try{var i=o.objectStore(e._dbInfo.storeName).count();i.onsuccess=function(){t(i.result)},i.onerror=function(){r(i.error)}}catch(a){r(a)}})}).catch(r)});return c(r,t),r}function W(t,e){var r=this,n=new l(function(e,n){t<0?e(null):r.ready().then(function(){M(r._dbInfo,y,function(o,i){if(o)return n(o);try{var a=i.objectStore(r._dbInfo.storeName),s=!1,u=a.openKeyCursor();u.onsuccess=function(){var r=u.result;r?0===t||s?e(r.key):(s=!0,r.advance(t)):e(null)},u.onerror=function(){n(u.error)}}catch(l){n(l)}})}).catch(n)});return c(n,e),n}function G(t){var e=this,r=new l(function(t,r){e.ready().then(function(){M(e._dbInfo,y,function(n,o){if(n)return r(n);try{var i=o.objectStore(e._dbInfo.storeName).openKeyCursor(),a=[];i.onsuccess=function(){var e=i.result;e?(a.push(e.key),e.continue()):t(a)},i.onerror=function(){r(i.error)}}catch(s){r(s)}})}).catch(r)});return c(r,t),r}function X(t,e){e=d.apply(this,arguments);var r=this.config();(t="function"!=typeof t&&t||{}).name||(t.name=t.name||r.name,t.storeName=t.storeName||r.storeName);var n,o=this;if(t.name){var i=t.name===r.name&&o._dbInfo.db?l.resolve(o._dbInfo.db):x(t).then(function(e){var r=m[t.name],n=r.forages;r.db=e;for(var o=0;o<n.length;o++)n[o]._dbInfo.db=e;return e});n=t.storeName?i.then(function(e){if(e.objectStoreNames.contains(t.storeName)){var r=e.version+1;A(t);var n=m[t.name],o=n.forages;e.close();for(var i=0;i<o.length;i++){var s=o[i];s._dbInfo.db=null,s._dbInfo.version=r}return new l(function(e,n){var o=a.open(t.name,r);o.onerror=function(t){o.result.close(),n(t)},o.onupgradeneeded=function(){o.result.deleteObjectStore(t.storeName)},o.onsuccess=function(){var t=o.result;t.close(),e(t)}}).then(function(t){n.db=t;for(var e=0;e<o.length;e++){var r=o[e];r._dbInfo.db=t,E(r._dbInfo)}}).catch(function(e){throw(I(t,e)||l.resolve()).catch(function(){}),e})}}):i.then(function(e){A(t);var r=m[t.name],n=r.forages;e.close();for(var o=0;o<n.length;o++)n[o]._dbInfo.db=null;return new l(function(e,r){var n=a.deleteDatabase(t.name);n.onerror=function(){var t=n.result;t&&t.close(),r(n.error)},n.onblocked=function(){console.warn('dropInstance blocked for database "'+t.name+'" until all open connections are closed')},n.onsuccess=function(){var t=n.result;t&&t.close(),e(t)}}).then(function(t){r.db=t;for(var e=0;e<n.length;e++)E(n[e]._dbInfo)}).catch(function(e){throw(I(t,e)||l.resolve()).catch(function(){}),e})})}else n=l.reject("Invalid arguments");return c(n,e),n}var $={_driver:"asyncStorage",_initStorage:L,_support:s(),iterate:j,getItem:F,setItem:V,removeItem:U,clear:H,length:z,key:W,keys:G,dropInstance:X};function Y(){return"function"==typeof openDatabase}var q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",K="~~local_forage_type~",Z=/^~~local_forage_type~([^~]+)~/,Q="__lfsc__:",J=Q.length,tt="arbf",et="blob",rt="si08",nt="ui08",ot="uic8",it="si16",at="si32",st="ur16",ut="ui32",lt="fl32",ct="fl64",ht=J+tt.length,ft=Object.prototype.toString;function dt(t){var e,r,n,o,i,a=.75*t.length,s=t.length,u=0;"="===t[t.length-1]&&(a--,"="===t[t.length-2]&&a--);var l=new ArrayBuffer(a),c=new Uint8Array(l);for(e=0;e<s;e+=4)r=q.indexOf(t[e]),n=q.indexOf(t[e+1]),o=q.indexOf(t[e+2]),i=q.indexOf(t[e+3]),c[u++]=r<<2|n>>4,c[u++]=(15&n)<<4|o>>2,c[u++]=(3&o)<<6|63&i;return l}function pt(t){var e,r=new Uint8Array(t),n="";for(e=0;e<r.length;e+=3)n+=q[r[e]>>2],n+=q[(3&r[e])<<4|r[e+1]>>4],n+=q[(15&r[e+1])<<2|r[e+2]>>6],n+=q[63&r[e+2]];return r.length%3==2?n=n.substring(0,n.length-1)+"=":r.length%3==1&&(n=n.substring(0,n.length-2)+"=="),n}function gt(t,e){var r="";if(t&&(r=ft.call(t)),t&&("[object ArrayBuffer]"===r||t.buffer&&"[object ArrayBuffer]"===ft.call(t.buffer))){var n,o=Q;t instanceof ArrayBuffer?(n=t,o+=tt):(n=t.buffer,"[object Int8Array]"===r?o+=rt:"[object Uint8Array]"===r?o+=nt:"[object Uint8ClampedArray]"===r?o+=ot:"[object Int16Array]"===r?o+=it:"[object Uint16Array]"===r?o+=st:"[object Int32Array]"===r?o+=at:"[object Uint32Array]"===r?o+=ut:"[object Float32Array]"===r?o+=lt:"[object Float64Array]"===r?o+=ct:e(new Error("Failed to get type for BinaryArray"))),e(o+pt(n))}else if("[object Blob]"===r){var i=new FileReader;i.onload=function(){var r=K+t.type+"~"+pt(this.result);e(Q+et+r)},i.readAsArrayBuffer(t)}else try{e(JSON.stringify(t))}catch(a){console.error("Couldn't convert value into a JSON string: ",t),e(null,a)}}function mt(t){if(t.substring(0,J)!==Q)return JSON.parse(t);var e,r=t.substring(ht),n=t.substring(J,ht);if(n===et&&Z.test(r)){var o=r.match(Z);e=o[1],r=r.substring(o[0].length)}var i=dt(r);switch(n){case tt:return i;case et:return u([i],{type:e});case rt:return new Int8Array(i);case nt:return new Uint8Array(i);case ot:return new Uint8ClampedArray(i);case it:return new Int16Array(i);case st:return new Uint16Array(i);case at:return new Int32Array(i);case ut:return new Uint32Array(i);case lt:return new Float32Array(i);case ct:return new Float64Array(i);default:throw new Error("Unkown type: "+n)}}var vt={serialize:gt,deserialize:mt,stringToBuffer:dt,bufferToString:pt};function yt(t,e,r,n){t.executeSql("CREATE TABLE IF NOT EXISTS "+e.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],r,n)}function _t(t){var e=this,r={db:null};if(t)for(var n in t)r[n]="string"!=typeof t[n]?t[n].toString():t[n];var o=new l(function(t,n){try{r.db=openDatabase(r.name,String(r.version),r.description,r.size)}catch(o){return n(o)}r.db.transaction(function(o){yt(o,r,function(){e._dbInfo=r,t()},function(t,e){n(e)})},n)});return r.serializer=vt,o}function wt(t,e,r,n,o,i){t.executeSql(r,n,o,function(t,a){a.code===a.SYNTAX_ERR?t.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[e.storeName],function(t,s){s.rows.length?i(t,a):yt(t,e,function(){t.executeSql(r,n,o,i)},i)},i):i(t,a)},i)}function bt(t,e){var r=this;t=f(t);var n=new l(function(e,n){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(r){wt(r,o,"SELECT * FROM "+o.storeName+" WHERE key = ? LIMIT 1",[t],function(t,r){var n=r.rows.length?r.rows.item(0).value:null;n&&(n=o.serializer.deserialize(n)),e(n)},function(t,e){n(e)})})}).catch(n)});return c(n,e),n}function Ct(t,e){var r=this,n=new l(function(e,n){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(r){wt(r,o,"SELECT * FROM "+o.storeName,[],function(r,n){for(var i=n.rows,a=i.length,s=0;s<a;s++){var u=i.item(s),l=u.value;if(l&&(l=o.serializer.deserialize(l)),void 0!==(l=t(l,u.key,s+1)))return void e(l)}e()},function(t,e){n(e)})})}).catch(n)});return c(n,e),n}function At(t,e,r,n){var o=this;t=f(t);var i=new l(function(i,a){o.ready().then(function(){void 0===e&&(e=null);var s=e,u=o._dbInfo;u.serializer.serialize(e,function(e,l){l?a(l):u.db.transaction(function(r){wt(r,u,"INSERT OR REPLACE INTO "+u.storeName+" (key, value) VALUES (?, ?)",[t,e],function(){i(s)},function(t,e){a(e)})},function(e){if(e.code===e.QUOTA_ERR){if(n>0)return void i(At.apply(o,[t,s,r,n-1]));a(e)}})})}).catch(a)});return c(i,r),i}function Et(t,e,r){return At.apply(this,[t,e,r,1])}function It(t,e){var r=this;t=f(t);var n=new l(function(e,n){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(r){wt(r,o,"DELETE FROM "+o.storeName+" WHERE key = ?",[t],function(){e()},function(t,e){n(e)})})}).catch(n)});return c(n,e),n}function St(t){var e=this,r=new l(function(t,r){e.ready().then(function(){var n=e._dbInfo;n.db.transaction(function(e){wt(e,n,"DELETE FROM "+n.storeName,[],function(){t()},function(t,e){r(e)})})}).catch(r)});return c(r,t),r}function xt(t){var e=this,r=new l(function(t,r){e.ready().then(function(){var n=e._dbInfo;n.db.transaction(function(e){wt(e,n,"SELECT COUNT(key) as c FROM "+n.storeName,[],function(e,r){var n=r.rows.item(0).c;t(n)},function(t,e){r(e)})})}).catch(r)});return c(r,t),r}function Ot(t,e){var r=this,n=new l(function(e,n){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(r){wt(r,o,"SELECT key FROM "+o.storeName+" WHERE id = ? LIMIT 1",[t+1],function(t,r){var n=r.rows.length?r.rows.item(0).key:null;e(n)},function(t,e){n(e)})})}).catch(n)});return c(n,e),n}function Tt(t){var e=this,r=new l(function(t,r){e.ready().then(function(){var n=e._dbInfo;n.db.transaction(function(e){wt(e,n,"SELECT key FROM "+n.storeName,[],function(e,r){for(var n=[],o=0;o<r.rows.length;o++)n.push(r.rows.item(o).key);t(n)},function(t,e){r(e)})})}).catch(r)});return c(r,t),r}function Nt(t){return new l(function(e,r){t.transaction(function(n){n.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(r,n){for(var o=[],i=0;i<n.rows.length;i++)o.push(n.rows.item(i).name);e({db:t,storeNames:o})},function(t,e){r(e)})},function(t){r(t)})})}function kt(t,e){e=d.apply(this,arguments);var r=this.config();(t="function"!=typeof t&&t||{}).name||(t.name=t.name||r.name,t.storeName=t.storeName||r.storeName);var n,o=this;return c(n=t.name?new l(function(e){var n;n=t.name===r.name?o._dbInfo.db:openDatabase(t.name,"","",0),t.storeName?e({db:n,storeNames:[t.storeName]}):e(Nt(n))}).then(function(t){return new l(function(e,r){t.db.transaction(function(n){function o(t){return new l(function(e,r){n.executeSql("DROP TABLE IF EXISTS "+t,[],function(){e()},function(t,e){r(e)})})}for(var i=[],a=0,s=t.storeNames.length;a<s;a++)i.push(o(t.storeNames[a]));l.all(i).then(function(){e()}).catch(function(t){r(t)})},function(t){r(t)})})}):l.reject("Invalid arguments"),e),n}var Rt={_driver:"webSQLStorage",_initStorage:_t,_support:Y(),iterate:Ct,getItem:bt,setItem:Et,removeItem:It,clear:St,length:xt,key:Ot,keys:Tt,dropInstance:kt};function Dt(){try{return"undefined"!=typeof localStorage&&"setItem"in localStorage&&!!localStorage.setItem}catch(t){return!1}}function Pt(t,e){var r=t.name+"/";return t.storeName!==e.storeName&&(r+=t.storeName+"/"),r}function Mt(){var t="_localforage_support_test";try{return localStorage.setItem(t,!0),localStorage.removeItem(t),!1}catch(e){return!0}}function Bt(){return!Mt()||localStorage.length>0}function Lt(t){var e=this,r={};if(t)for(var n in t)r[n]=t[n];return r.keyPrefix=Pt(t,e._defaultConfig),Bt()?(e._dbInfo=r,r.serializer=vt,l.resolve()):l.reject()}function Ft(t){var e=this,r=e.ready().then(function(){for(var t=e._dbInfo.keyPrefix,r=localStorage.length-1;r>=0;r--){var n=localStorage.key(r);0===n.indexOf(t)&&localStorage.removeItem(n)}});return c(r,t),r}function jt(t,e){var r=this;t=f(t);var n=r.ready().then(function(){var e=r._dbInfo,n=localStorage.getItem(e.keyPrefix+t);return n&&(n=e.serializer.deserialize(n)),n});return c(n,e),n}function Vt(t,e){var r=this,n=r.ready().then(function(){for(var e=r._dbInfo,n=e.keyPrefix,o=n.length,i=localStorage.length,a=1,s=0;s<i;s++){var u=localStorage.key(s);if(0===u.indexOf(n)){var l=localStorage.getItem(u);if(l&&(l=e.serializer.deserialize(l)),void 0!==(l=t(l,u.substring(o),a++)))return l}}});return c(n,e),n}function Ut(t,e){var r=this,n=r.ready().then(function(){var e,n=r._dbInfo;try{e=localStorage.key(t)}catch(o){e=null}return e&&(e=e.substring(n.keyPrefix.length)),e});return c(n,e),n}function Ht(t){var e=this,r=e.ready().then(function(){for(var t=e._dbInfo,r=localStorage.length,n=[],o=0;o<r;o++){var i=localStorage.key(o);0===i.indexOf(t.keyPrefix)&&n.push(i.substring(t.keyPrefix.length))}return n});return c(r,t),r}function zt(t){var e=this.keys().then(function(t){return t.length});return c(e,t),e}function Wt(t,e){var r=this;t=f(t);var n=r.ready().then(function(){var e=r._dbInfo;localStorage.removeItem(e.keyPrefix+t)});return c(n,e),n}function Gt(t,e,r){var n=this;t=f(t);var o=n.ready().then(function(){void 0===e&&(e=null);var r=e;return new l(function(o,i){var a=n._dbInfo;a.serializer.serialize(e,function(e,n){if(n)i(n);else try{localStorage.setItem(a.keyPrefix+t,e),o(r)}catch(s){"QuotaExceededError"!==s.name&&"NS_ERROR_DOM_QUOTA_REACHED"!==s.name||i(s),i(s)}})})});return c(o,r),o}function Xt(t,e){if(e=d.apply(this,arguments),!(t="function"!=typeof t&&t||{}).name){var r=this.config();t.name=t.name||r.name,t.storeName=t.storeName||r.storeName}var n,o=this;return c(n=t.name?new l(function(e){t.storeName?e(Pt(t,o._defaultConfig)):e(t.name+"/")}).then(function(t){for(var e=localStorage.length-1;e>=0;e--){var r=localStorage.key(e);0===r.indexOf(t)&&localStorage.removeItem(r)}}):l.reject("Invalid arguments"),e),n}var $t={_driver:"localStorageWrapper",_initStorage:Lt,_support:Dt(),iterate:Vt,getItem:jt,setItem:Gt,removeItem:Wt,clear:Ft,length:zt,key:Ut,keys:Ht,dropInstance:Xt},Yt=function(t,e){return t===e||"number"==typeof t&&"number"==typeof e&&isNaN(t)&&isNaN(e)},qt=function(t,e){for(var r=t.length,n=0;n<r;){if(Yt(t[n],e))return!0;n++}return!1},Kt=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},Zt={},Qt={},Jt={INDEXEDDB:$,WEBSQL:Rt,LOCALSTORAGE:$t},te=[Jt.INDEXEDDB._driver,Jt.WEBSQL._driver,Jt.LOCALSTORAGE._driver],ee=["dropInstance"],re=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(ee),ne={description:"",driver:te.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function oe(t,e){t[e]=function(){var r=arguments;return t.ready().then(function(){return t[e].apply(t,r)})}}function ie(){for(var t=1;t<arguments.length;t++){var e=arguments[t];if(e)for(var r in e)e.hasOwnProperty(r)&&(Kt(e[r])?arguments[0][r]=e[r].slice():arguments[0][r]=e[r])}return arguments[0]}var ae=function(){function t(e){for(var r in o(this,t),Jt)if(Jt.hasOwnProperty(r)){var n=Jt[r],i=n._driver;this[r]=i,Zt[i]||this.defineDriver(n)}this._defaultConfig=ie({},ne),this._config=ie({},this._defaultConfig,e),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return t.prototype.config=function(t){if("object"===(void 0===t?"undefined":n(t))){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var e in t){if("storeName"===e&&(t[e]=t[e].replace(/\W/g,"_")),"version"===e&&"number"!=typeof t[e])return new Error("Database version must be a number.");this._config[e]=t[e]}return!("driver"in t)||!t.driver||this.setDriver(this._config.driver)}return"string"==typeof t?this._config[t]:this._config},t.prototype.defineDriver=function(t,e,r){var n=new l(function(e,r){try{var n=t._driver,o=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!t._driver)return void r(o);for(var i=re.concat("_initStorage"),a=0,s=i.length;a<s;a++){var u=i[a];if((!qt(ee,u)||t[u])&&"function"!=typeof t[u])return void r(o)}var h=function(){for(var e=function(t){return function(){var e=new Error("Method "+t+" is not implemented by the current driver"),r=l.reject(e);return c(r,arguments[arguments.length-1]),r}},r=0,n=ee.length;r<n;r++){var o=ee[r];t[o]||(t[o]=e(o))}};h();var f=function(r){Zt[n]&&console.info("Redefining LocalForage driver: "+n),Zt[n]=t,Qt[n]=r,e()};"_support"in t?t._support&&"function"==typeof t._support?t._support().then(f,r):f(!!t._support):f(!0)}catch(d){r(d)}});return h(n,e,r),n},t.prototype.driver=function(){return this._driver||null},t.prototype.getDriver=function(t,e,r){var n=Zt[t]?l.resolve(Zt[t]):l.reject(new Error("Driver not found."));return h(n,e,r),n},t.prototype.getSerializer=function(t){var e=l.resolve(vt);return h(e,t),e},t.prototype.ready=function(t){var e=this,r=e._driverSet.then(function(){return null===e._ready&&(e._ready=e._initDriver()),e._ready});return h(r,t,t),r},t.prototype.setDriver=function(t,e,r){var n=this;Kt(t)||(t=[t]);var o=this._getSupportedDrivers(t);function i(){n._config.driver=n.driver()}function a(t){return n._extend(t),i(),n._ready=n._initStorage(n._config),n._ready}function s(t){return function(){var e=0;function r(){for(;e<t.length;){var o=t[e];return e++,n._dbInfo=null,n._ready=null,n.getDriver(o).then(a).catch(r)}i();var s=new Error("No available storage method found.");return n._driverSet=l.reject(s),n._driverSet}return r()}}var u=null!==this._driverSet?this._driverSet.catch(function(){return l.resolve()}):l.resolve();return this._driverSet=u.then(function(){var t=o[0];return n._dbInfo=null,n._ready=null,n.getDriver(t).then(function(t){n._driver=t._driver,i(),n._wrapLibraryMethodsWithReady(),n._initDriver=s(o)})}).catch(function(){i();var t=new Error("No available storage method found.");return n._driverSet=l.reject(t),n._driverSet}),h(this._driverSet,e,r),this._driverSet},t.prototype.supports=function(t){return!!Qt[t]},t.prototype._extend=function(t){ie(this,t)},t.prototype._getSupportedDrivers=function(t){for(var e=[],r=0,n=t.length;r<n;r++){var o=t[r];this.supports(o)&&e.push(o)}return e},t.prototype._wrapLibraryMethodsWithReady=function(){for(var t=0,e=re.length;t<e;t++)oe(this,re[t])},t.prototype.createInstance=function(e){return new t(e)},t}(),se=new ae;e.exports=se},{3:3}]},{},[4])(4)}(Ye);const qe=d(Ye.exports);function Ke(t){let e=t.url;if(t.params){e=e+"?"+new URLSearchParams(t.params).toString()}return e}qe.config({driver:qe.INDEXEDDB,name:"cache",version:1,storeName:"requests",description:"local cache"});const Ze={init:async t=>{let e=await qe.getItem(Ke(t));e&&(t.headers["x-tag"]=e.xtag,t.data=e.data)},save:async(t,e)=>{if(304==t.status)t.data=e.data;else if(t.status<400)try{let r={xtag:t.headers["x-tag"],data:t.data,create_at:new Date};await qe.setItem(Ke(e),r)}catch(r){console.info("Cache: ",r)}},clear:async(t=3)=>{const e=864e5*t,r=await qe.keys(),n=new Date;for(const o of r){const t=await qe.getItem(o);if(t&&t.create_at){n-new Date(t.create_at)>=e&&await qe.removeItem(o)}}},clearAll:()=>{qe.clear()}};function Qe({title:t,href:e,text:r="",children:n,...o}){let i;return i=e?e.replace(/\D/g,""):null==n?void 0:n.replace(/\D/g,""),Qt.jsx("a",{href:`https://wa.me/${i}?text=${encodeURI(r)}`,target:"_blank",rel:"noreferrer",title:t||"Enviar mensagem para este número usando o WhatsApp",...o,children:n||e})}function Je({href:t,title:e,children:r,...n}){return Qt.jsx("a",{href:`mailto:${t||r}`,title:e||"Enviar um e-mail para este endereço",...n,children:r||t})}function tr({to:t,children:e,...r}){return Qt.jsx("a",{href:t||e,target:"_blank",rel:"noreferrer",...r,children:e||t})}const er=o.div`
|
|
437
|
+
`;function ze({value:t,isCount:e,...r}){let n;return n="number"==typeof t?e?Math.min(t,9999):t<=0?"Inclusão":`#${t}`:t,Qt.jsx("div",{className:"badge bg-info text-dark",style:{borderRadius:"var(--pn-border-radius)"},...r,children:n})}let We="/home";function Ge({title:t,count:e,codigo:r,goBack:n,goHome:o,onClose:i,children:s,maxWidth:u,className:l="",helpLink:c="",...h}){const f=a.useHistory(),d=e&&"number"==typeof e?e:0,p=d>9999?"9999+":d,g=Intl.NumberFormat("pt-br",{}).format(d),m=()=>{if(i)return i();n?f.goBack():f.push(We)},v=h.style||{};return u&&(v.maxWidth=u,h.style=v),Qt.jsxs("div",{className:"panel--container "+l,...h,children:[Qt.jsxs(He,{children:[Qt.jsx("div",{className:"d-none d-sm-block",children:(n||o||i)&&Qt.jsx(Be,{title:"Fechar",onClick:m})}),Qt.jsxs("div",{className:"pn-title",children:[t,0!==d&&Qt.jsx(ze,{title:`Total de registros: ${g}`,value:p,isCount:!0}),Qt.jsx(ze,{value:r})]}),c&&Qt.jsx(Me,{title:"Ir para ajuda",onClick:()=>window.open(c,"_blank")}),(n||o||i)&&Qt.jsx(Pe,{title:"Fechar",onClick:m})]}),Qt.jsx("div",{className:"pn-body",children:s})]})}function Xe({fileTo:t,previewUrl:n,visible:o,setVisible:i}){const{addModal:a,removeModal:s}=ee(),[u]=e.useState("preview-"+r.random());return e.useEffect(()=>(o||s(u),()=>s(u)),[o]),e.useEffect(()=>{a(u,i)},[u]),Qt.jsxs("div",{className:"pr-box",children:[Qt.jsxs("div",{className:"pr-box--header",children:[Qt.jsxs("div",{className:"pr-box--title",children:[Qt.jsxs("div",{className:"pr-box--name",children:[Qt.jsx("div",{children:"Visualizar relatório:"}),Qt.jsx("div",{className:"fw-bold",children:t})]}),Qt.jsx("div",{children:Qt.jsxs("a",{href:n,download:t,children:[Qt.jsx("i",{className:"fa-solid fa-download me-2"}),"Salvar relatório"]})})]}),Qt.jsx("button",{className:"ms-4 btn btn-danger rounded-pill",onClick:i,children:Qt.jsx(xe,{})})]}),Qt.jsx("iframe",{className:"pr-box--preview",src:n})]})}function $e({title:t,href:e,text:r="",children:n,...o}){let i;return i=e?e.replace(/\D/g,""):null==n?void 0:n.replace(/\D/g,""),Qt.jsx("a",{href:`https://wa.me/${i}?text=${encodeURI(r)}`,target:"_blank",rel:"noreferrer",title:t||"Enviar mensagem para este número usando o WhatsApp",...o,children:n||e})}function Ye({href:t,title:e,children:r,...n}){return Qt.jsx("a",{href:`mailto:${t||r}`,title:e||"Enviar um e-mail para este endereço",...n,children:r||t})}function qe({to:t,children:e,...r}){return Qt.jsx("a",{href:t||e,target:"_blank",rel:"noreferrer",...r,children:e||t})}const Ke=o.div`
|
|
443
438
|
.alert {
|
|
444
439
|
font-weight: bold;
|
|
445
440
|
margin-bottom: 0;
|
|
@@ -463,7 +458,7 @@
|
|
|
463
458
|
padding-top: 8px;
|
|
464
459
|
}
|
|
465
460
|
}
|
|
466
|
-
`;function
|
|
461
|
+
`;function Ze(){return Qt.jsxs(Ke,{children:[Qt.jsx("div",{className:"alert alert-danger",children:"Falha na conexão!"}),Qt.jsxs("div",{children:["Possíveis causas:",Qt.jsx("ul",{children:navigator.onLine?Qt.jsxs(Qt.Fragment,{children:[Qt.jsx("li",{children:"Você está sem conexão com a internet;"}),Qt.jsx("li",{children:"O servidor pode estar passando por uma atualização. Por favor, tente novamente em alguns instantes."}),Qt.jsx("li",{children:"O servidor pode estar temporariamente indisponível."})]}):Qt.jsx("li",{children:"Você está sem conexão com a internet;"})}),Qt.jsxs("div",{children:["Se o erro persistir, por favor, entre em contato com nosso suporte técnico:",Qt.jsxs("ul",{children:[Qt.jsxs("li",{children:["Fone e WhatsApp:"," ",Qt.jsx($e,{className:"numeros",children:"(27) 9 9774-2904"})]}),Qt.jsxs("li",{children:["E-mail:"," ",Qt.jsx(Ye,{href:"suporte@jcinfoes.com.br?subject="+encodeURI("SIPAR - Sem conexão com o servidor!"),children:"suporte@jcinfoes.com.br"})]})]})]})]})]})}const Qe={isError:!1,message:null,loading:!1,headers:null,data:null,error:null,code:0,status:503,report:!1,onBefore:null};function Je(t={}){const r=a.useHistory(),n=new AbortController,{globalApiConfig:o}=ee(),[i,s]=e.useState(Qe);return"string"==typeof t&&(t={url:t}),[async function(e){var i,a,l,c,h;let f,d={username:null==(i=o.auth)?void 0:i.username,password:null==(a=o.auth)?void 0:a.password};if(t.headers={...t.headers,...null==e?void 0:e.headers},o.getToken){let e=o.getToken();e&&(o.auth.prefix&&(e=`${o.auth.prefix} ${e}`),t.headers[o.auth.header]=e)}o.version&&(t.headers["x-ver"]=encodeURIComponent(o.version)),o.ident&&(t.headers["x-identify"]=encodeURIComponent(o.ident));let p={baseURL:o.baseURL,timeout:o.timeout,auth:d,validateStatus:t=>t>=200&&t<400,...t,...e,headers:t.headers};p.report&&(p={...p,responseType:"blob",timeout:0}),s({...Qe,loading:!0}),p.onBefore&&p.onBefore(p);try{const t=await u({...p,signal:n.signal});o.afterRequest&&o.afterRequest(t),f={...Qe,data:t.data,message:t.statusText,status:t.status,headers:t.headers}}catch(m){const{ERR_NETWORK:t,ECONNABORTED:e,ETIMEDOUT:n}=u.AxiosError;if([t,e,n].includes(null==m?void 0:m.code))f={...Qe,isError:!0,status:400,message:Qt.jsx(Ze,{})};else if(m.response)switch(f={...Qe,isError:!0,status:m.response.status,message:(null==(l=m.response.data)?void 0:l.error)||m.response.data,code:null==(c=m.response.data)?void 0:c.code},m.response.status){case 400:case 500:if("blob"==(null==p?void 0:p.responseType)){let t=await m.response.data.text();t=JSON.parse(t),f.message=t.error||"Ocorreu um erro ao consultar o servidor!"}break;case 401:f.message="Servidor requer autenticação!",o.setToken&&o.setToken(""),r.push(o.loginRoute);break;case 404:f.message="Servidor não possui este recurso!";break;case 405:f.message=`Método [${(null==(h=p.method)?void 0:h.toUpperCase())||"GET"}] indisponível!`}else f={...Qe,isError:!0,message:m.message}}const g=`timeout of ${o.timeout}ms exceeded`;return f.message!=g&&"Network Error"!=f.message||(f.message="Sem conexão com o servidor!"),f.isError?f.error=f.message:f.error=null,f={...f,loading:!1},s(f),(null==t?void 0:t.onTerminated)&&t.onTerminated(f),f},i,function(){n&&n.abort("Cancelado pelo usuário!")}]}let tr=null;function er({url:t,file:n,fileTo:o,setLoading:i}){const[a,u]=e.useState(""),[l,c]=e.useState(!1),[h,f]=e.useState(0),[d,p]=e.useState(n),[g,m]=e.useState(""),[v,,y]=Je({url:t,method:"post",data:{file:d},report:!0,onDownloadProgress:t=>{c(t.loaded>0),f(t.loaded/t.total*100)},onTerminated:t=>{if(204===t.status)return w(3);if(t.error)u(t.error),_();else{const[,n]=o.split(".");r.isDesktop()&&"pdf"==n.toLowerCase()?(e=t.data,m(URL.createObjectURL(e))):(s(t.data,function(){let t=o.split("."),e=`-${r.getDateTimeStr().replace(/\D/g,"")}-${r.getHash(o)}`;return t[0]+=e,t=t.join("."),t}()),p(""))}var e}});function _(){tr&&clearTimeout(tr)}function w(t){_(),tr=setTimeout(()=>v(),1e3*t)}return e.useEffect(()=>()=>_(),[]),e.useEffect(()=>()=>g&&URL.revokeObjectURL(g),[g]),e.useEffect(()=>{d?(i(!0),w(2)):i(!1)},[d]),Qt.jsxs(Qt.Fragment,{children:[Qt.jsxs("div",{className:"loading-report--area",children:[Qt.jsxs("div",{className:"loading-box",style:{display:g?"none":"block"},children:[Qt.jsx("button",{className:"btn-loading-close",title:"Cancelar",onClick:function(){l?y():u(""),i(!1)},children:Qt.jsx("i",{className:"fas fa-times"})}),Qt.jsxs("div",{className:"line",children:[l?Qt.jsx("i",{className:"fa-solid fa-file-arrow-down pulse"}):Qt.jsx("div",{className:"spinner"}),Qt.jsx("span",{children:l?"Baixando relatório...":"Gerando relatório..."})]}),Qt.jsx("div",{className:"pbar",children:Qt.jsx("div",{style:{width:`${h}%`}})})]}),g&&Qt.jsx(Xe,{fileTo:o,previewUrl:g,setVisible:()=>p(""),visible:!0})]}),a&&Qt.jsx(se,{onConfirm:()=>i(!1),children:a})]})}function rr({search:t,setSearch:n,fnSearch:o,fnFilter:a,fnValidateFilter:s,placeHolder:u,...l}){const c=e.useRef();return Qt.jsxs("div",{className:"inp-pesq--input-area",children:[Qt.jsxs(i.InputGroup,{children:[Qt.jsx(i.Input,{innerRef:c,value:t,onChange:t=>n(t.target.value),placeholder:u,...l}),Qt.jsx(i.Button,{color:"outline-secondary",type:"button",onClick:()=>{n(""),r.isDesktop()&&(null==c?void 0:c.current)&&c.current.focus()},title:"Limpar campo de pesquisa",children:Qt.jsx(xe,{})}),Qt.jsx(i.Button,{color:"info",title:"Pesquisar",onClick:o,type:o?"button":"submit",children:Qt.jsx(Se,{})})]}),a&&Qt.jsxs(i.Button,{type:"button",color:"outline-filter",className:"position-relative ip--btn-filter",title:"Filtros avançados",onClick:a,children:[Qt.jsx("i",{className:"fas fa-filter"}),Qt.jsx("span",{className:"ip--btn-caption",children:" Filtros"}),s&&s()&&Qt.jsx("span",{className:"position-absolute top-0 start-100 translate-middle \r\n p-2 bg-danger border border-light rounded-circle",children:Qt.jsx("span",{className:"visually-hidden",children:"Filtro ativo"})})]})]})}const nr=o.div`
|
|
467
462
|
position: fixed;
|
|
468
463
|
inset: 0 0 0;
|
|
469
464
|
background-color: var(--jc-overlay-bg);
|
|
@@ -531,7 +526,7 @@
|
|
|
531
526
|
${t=>t.alignTop?"max-height: calc(100vh - 110px);":""}
|
|
532
527
|
}
|
|
533
528
|
}
|
|
534
|
-
`,lr="modal-hide-sb";function cr({maxWidth:t,visible:n,setVisible:o,children:i,hideScrollBar:a=!0,id:s,alignTop:u}){const{addModal:l,removeModal:c}=ee(),[h]=e.useState(s||"modal-"+r.random());return e.useEffect(()=>(n?a&&document.body.classList.add(lr):(c(h),a&&document.body.classList.remove(lr)),()=>{c(h),a&&document.body.classList.remove(lr)}),[n,a]),e.useEffect(()=>{l(h,o)},[h]),n?Qt.jsx(ur,{alignTop:u,maxWidth:t,children:Qt.jsx("div",{className:"mod-panel",children:i})}):null}function hr({className:t="",...e}){return Qt.jsx("div",{className:`modal--body ${t}`,...e})}function fr({className:t="",...e}){return Qt.jsx("div",{className:`modal--content ${t}`,...e})}function dr({className:t="",setVisible:e,children:r,helpLink:n,...o}){return Qt.jsxs(He,{className:`modal--header ${t}`,...o,children:[Qt.jsx("span",{className:"pn-title",children:r}),n&&Qt.jsx(Me,{title:"Ir para a ajuda",onClick:()=>window.open(n,"_blank")}),Qt.jsx(Pe,{type:"button",onClick:()=>e(!1)})]})}var pr,gr,mr,vr=(pr=function(t,e){return(pr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}pr(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),yr=function(t){function e(e){var r,n,o,i=this.constructor,a=t.call(this,e)||this;return Object.defineProperty(a,"name",{value:i.name,enumerable:!1,configurable:!0}),r=a,n=i.prototype,(o=Object.setPrototypeOf)?o(r,n):r.__proto__=n,function(t,e){void 0===e&&(e=t.constructor);var r=Error.captureStackTrace;r&&r(t,e)}(a),a}return vr(e,t),e}(Error),_r=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),wr=function(t){function e(e){void 0===e&&(e=void 0);var r=t.call(this,e)||this;return r.message=e,r}return _r(e,t),e.prototype.getKind=function(){return this.constructor.kind},e.kind="Exception",e}(yr),br=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Cr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return br(e,t),e.kind="ArgumentException",e}(wr),Ar=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Er=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ar(e,t),e.kind="IllegalArgumentException",e}(wr),Ir=function(){function t(t){if(this.binarizer=t,null===t)throw new Er("Binarizer must be non-null.")}return t.prototype.getWidth=function(){return this.binarizer.getWidth()},t.prototype.getHeight=function(){return this.binarizer.getHeight()},t.prototype.getBlackRow=function(t,e){return this.binarizer.getBlackRow(t,e)},t.prototype.getBlackMatrix=function(){return null!==this.matrix&&void 0!==this.matrix||(this.matrix=this.binarizer.getBlackMatrix()),this.matrix},t.prototype.isCropSupported=function(){return this.binarizer.getLuminanceSource().isCropSupported()},t.prototype.crop=function(e,r,n,o){var i=this.binarizer.getLuminanceSource().crop(e,r,n,o);return new t(this.binarizer.createBinarizer(i))},t.prototype.isRotateSupported=function(){return this.binarizer.getLuminanceSource().isRotateSupported()},t.prototype.rotateCounterClockwise=function(){var e=this.binarizer.getLuminanceSource().rotateCounterClockwise();return new t(this.binarizer.createBinarizer(e))},t.prototype.rotateCounterClockwise45=function(){var e=this.binarizer.getLuminanceSource().rotateCounterClockwise45();return new t(this.binarizer.createBinarizer(e))},t.prototype.toString=function(){try{return this.getBlackMatrix().toString()}catch(t){return""}},t}(),Sr=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),xr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Sr(e,t),e.getChecksumInstance=function(){return new e},e.kind="ChecksumException",e}(wr),Or=function(){function t(t){this.source=t}return t.prototype.getLuminanceSource=function(){return this.source},t.prototype.getWidth=function(){return this.source.getWidth()},t.prototype.getHeight=function(){return this.source.getHeight()},t}(),Tr=function(){function t(){}return t.arraycopy=function(t,e,r,n,o){for(;o--;)r[n++]=t[e++]},t.currentTimeMillis=function(){return Date.now()},t}(),Nr=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),kr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Nr(e,t),e.kind="IndexOutOfBoundsException",e}(wr),Rr=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Dr=function(t){function e(e,r){void 0===e&&(e=void 0),void 0===r&&(r=void 0);var n=t.call(this,r)||this;return n.index=e,n.message=r,n}return Rr(e,t),e.kind="ArrayIndexOutOfBoundsException",e}(kr),Pr=function(){function t(){}return t.fill=function(t,e){for(var r=0,n=t.length;r<n;r++)t[r]=e},t.fillWithin=function(e,r,n,o){t.rangeCheck(e.length,r,n);for(var i=r;i<n;i++)e[i]=o},t.rangeCheck=function(t,e,r){if(e>r)throw new Er("fromIndex("+e+") > toIndex("+r+")");if(e<0)throw new Dr(e);if(r>t)throw new Dr(r)},t.asList=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t},t.create=function(t,e,r){return Array.from({length:t}).map(function(t){return Array.from({length:e}).fill(r)})},t.createInt32Array=function(t,e,r){return Array.from({length:t}).map(function(t){return Int32Array.from({length:e}).fill(r)})},t.equals=function(t,e){if(!t)return!1;if(!e)return!1;if(!t.length)return!1;if(!e.length)return!1;if(t.length!==e.length)return!1;for(var r=0,n=t.length;r<n;r++)if(t[r]!==e[r])return!1;return!0},t.hashCode=function(t){var e,r;if(null===t)return 0;var n=1;try{for(var o=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(t),i=o.next();!i.done;i=o.next())n=31*n+i.value}catch(a){e={error:a}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return n},t.fillUint8Array=function(t,e){for(var r=0;r!==t.length;r++)t[r]=e},t.copyOf=function(t,e){return t.slice(0,e)},t.copyOfUint8Array=function(t,e){if(t.length<=e){var r=new Uint8Array(e);return r.set(t),r}return t.slice(0,e)},t.copyOfRange=function(t,e,r){var n=r-e,o=new Int32Array(n);return Tr.arraycopy(t,e,o,0,n),o},t.binarySearch=function(e,r,n){void 0===n&&(n=t.numberComparator);for(var o=0,i=e.length-1;o<=i;){var a=i+o>>1,s=n(r,e[a]);if(s>0)o=a+1;else{if(!(s<0))return a;i=a-1}}return-o-1},t.numberComparator=function(t,e){return t-e},t}(),Mr=function(){function t(){}return t.numberOfTrailingZeros=function(t){var e;if(0===t)return 32;var r=31;return 0!=(e=t<<16)&&(r-=16,t=e),0!=(e=t<<8)&&(r-=8,t=e),0!=(e=t<<4)&&(r-=4,t=e),0!=(e=t<<2)&&(r-=2,t=e),r-(t<<1>>>31)},t.numberOfLeadingZeros=function(t){if(0===t)return 32;var e=1;return t>>>16==0&&(e+=16,t<<=16),t>>>24==0&&(e+=8,t<<=8),t>>>28==0&&(e+=4,t<<=4),t>>>30==0&&(e+=2,t<<=2),e-(t>>>31)},t.toHexString=function(t){return t.toString(16)},t.toBinaryString=function(t){return String(parseInt(String(t),2))},t.bitCount=function(t){return t=(t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135,63&(t+=t>>>8)+(t>>>16)},t.truncDivision=function(t,e){return Math.trunc(t/e)},t.parseInt=function(t,e){return void 0===e&&(e=void 0),parseInt(t,e)},t.MIN_VALUE_32_BITS=-2147483648,t.MAX_VALUE=Number.MAX_SAFE_INTEGER,t}(),Br=function(){function t(e,r){void 0===e?(this.size=0,this.bits=new Int32Array(1)):(this.size=e,this.bits=null==r?t.makeArray(e):r)}return t.prototype.getSize=function(){return this.size},t.prototype.getSizeInBytes=function(){return Math.floor((this.size+7)/8)},t.prototype.ensureCapacity=function(e){if(e>32*this.bits.length){var r=t.makeArray(e);Tr.arraycopy(this.bits,0,r,0,this.bits.length),this.bits=r}},t.prototype.get=function(t){return!!(this.bits[Math.floor(t/32)]&1<<(31&t))},t.prototype.set=function(t){this.bits[Math.floor(t/32)]|=1<<(31&t)},t.prototype.flip=function(t){this.bits[Math.floor(t/32)]^=1<<(31&t)},t.prototype.getNextSet=function(t){var e=this.size;if(t>=e)return e;var r=this.bits,n=Math.floor(t/32),o=r[n];o&=~((1<<(31&t))-1);for(var i=r.length;0===o;){if(++n===i)return e;o=r[n]}var a=32*n+Mr.numberOfTrailingZeros(o);return a>e?e:a},t.prototype.getNextUnset=function(t){var e=this.size;if(t>=e)return e;var r=this.bits,n=Math.floor(t/32),o=~r[n];o&=~((1<<(31&t))-1);for(var i=r.length;0===o;){if(++n===i)return e;o=~r[n]}var a=32*n+Mr.numberOfTrailingZeros(o);return a>e?e:a},t.prototype.setBulk=function(t,e){this.bits[Math.floor(t/32)]=e},t.prototype.setRange=function(t,e){if(e<t||t<0||e>this.size)throw new Er;if(e!==t){e--;for(var r=Math.floor(t/32),n=Math.floor(e/32),o=this.bits,i=r;i<=n;i++){var a=(2<<(i<n?31:31&e))-(1<<(i>r?0:31&t));o[i]|=a}}},t.prototype.clear=function(){for(var t=this.bits.length,e=this.bits,r=0;r<t;r++)e[r]=0},t.prototype.isRange=function(t,e,r){if(e<t||t<0||e>this.size)throw new Er;if(e===t)return!0;e--;for(var n=Math.floor(t/32),o=Math.floor(e/32),i=this.bits,a=n;a<=o;a++){var s=(2<<(a<o?31:31&e))-(1<<(a>n?0:31&t))&4294967295;if((i[a]&s)!==(r?s:0))return!1}return!0},t.prototype.appendBit=function(t){this.ensureCapacity(this.size+1),t&&(this.bits[Math.floor(this.size/32)]|=1<<(31&this.size)),this.size++},t.prototype.appendBits=function(t,e){if(e<0||e>32)throw new Er("Num bits must be between 0 and 32");this.ensureCapacity(this.size+e);for(var r=e;r>0;r--)this.appendBit(1==(t>>r-1&1))},t.prototype.appendBitArray=function(t){var e=t.size;this.ensureCapacity(this.size+e);for(var r=0;r<e;r++)this.appendBit(t.get(r))},t.prototype.xor=function(t){if(this.size!==t.size)throw new Er("Sizes don't match");for(var e=this.bits,r=0,n=e.length;r<n;r++)e[r]^=t.bits[r]},t.prototype.toBytes=function(t,e,r,n){for(var o=0;o<n;o++){for(var i=0,a=0;a<8;a++)this.get(t)&&(i|=1<<7-a),t++;e[r+o]=i}},t.prototype.getBitArray=function(){return this.bits},t.prototype.reverse=function(){for(var t=new Int32Array(this.bits.length),e=Math.floor((this.size-1)/32),r=e+1,n=this.bits,o=0;o<r;o++){var i=n[o];i=(i=(i=(i=(i=i>>1&1431655765|(1431655765&i)<<1)>>2&858993459|(858993459&i)<<2)>>4&252645135|(252645135&i)<<4)>>8&16711935|(16711935&i)<<8)>>16&65535|(65535&i)<<16,t[e-o]=i}if(this.size!==32*r){var a=32*r-this.size,s=t[0]>>>a;for(o=1;o<r;o++){var u=t[o];s|=u<<32-a,t[o-1]=s,s=u>>>a}t[r-1]=s}this.bits=t},t.makeArray=function(t){return new Int32Array(Math.floor((t+31)/32))},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var r=e;return this.size===r.size&&Pr.equals(this.bits,r.bits)},t.prototype.hashCode=function(){return 31*this.size+Pr.hashCode(this.bits)},t.prototype.toString=function(){for(var t="",e=0,r=this.size;e<r;e++)!(7&e)&&(t+=" "),t+=this.get(e)?"X":".";return t},t.prototype.clone=function(){return new t(this.size,this.bits.slice())},t}();(mr=gr||(gr={}))[mr.OTHER=0]="OTHER",mr[mr.PURE_BARCODE=1]="PURE_BARCODE",mr[mr.POSSIBLE_FORMATS=2]="POSSIBLE_FORMATS",mr[mr.TRY_HARDER=3]="TRY_HARDER",mr[mr.CHARACTER_SET=4]="CHARACTER_SET",mr[mr.ALLOWED_LENGTHS=5]="ALLOWED_LENGTHS",mr[mr.ASSUME_CODE_39_CHECK_DIGIT=6]="ASSUME_CODE_39_CHECK_DIGIT",mr[mr.ASSUME_GS1=7]="ASSUME_GS1",mr[mr.RETURN_CODABAR_START_END=8]="RETURN_CODABAR_START_END",mr[mr.NEED_RESULT_POINT_CALLBACK=9]="NEED_RESULT_POINT_CALLBACK",mr[mr.ALLOWED_EAN_EXTENSIONS=10]="ALLOWED_EAN_EXTENSIONS";var Lr,Fr=gr,jr=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Vr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return jr(e,t),e.getFormatInstance=function(){return new e},e.kind="FormatException",e}(wr);!function(t){t[t.Cp437=0]="Cp437",t[t.ISO8859_1=1]="ISO8859_1",t[t.ISO8859_2=2]="ISO8859_2",t[t.ISO8859_3=3]="ISO8859_3",t[t.ISO8859_4=4]="ISO8859_4",t[t.ISO8859_5=5]="ISO8859_5",t[t.ISO8859_6=6]="ISO8859_6",t[t.ISO8859_7=7]="ISO8859_7",t[t.ISO8859_8=8]="ISO8859_8",t[t.ISO8859_9=9]="ISO8859_9",t[t.ISO8859_10=10]="ISO8859_10",t[t.ISO8859_11=11]="ISO8859_11",t[t.ISO8859_13=12]="ISO8859_13",t[t.ISO8859_14=13]="ISO8859_14",t[t.ISO8859_15=14]="ISO8859_15",t[t.ISO8859_16=15]="ISO8859_16",t[t.SJIS=16]="SJIS",t[t.Cp1250=17]="Cp1250",t[t.Cp1251=18]="Cp1251",t[t.Cp1252=19]="Cp1252",t[t.Cp1256=20]="Cp1256",t[t.UnicodeBigUnmarked=21]="UnicodeBigUnmarked",t[t.UTF8=22]="UTF8",t[t.ASCII=23]="ASCII",t[t.Big5=24]="Big5",t[t.GB18030=25]="GB18030",t[t.EUC_KR=26]="EUC_KR"}(Lr||(Lr={}));var Ur,Hr=function(){function t(e,r,n){for(var o,i,a=[],s=3;s<arguments.length;s++)a[s-3]=arguments[s];this.valueIdentifier=e,this.name=n,this.values="number"==typeof r?Int32Array.from([r]):r,this.otherEncodingNames=a,t.VALUE_IDENTIFIER_TO_ECI.set(e,this),t.NAME_TO_ECI.set(n,this);for(var u=this.values,l=0,c=u.length;l!==c;l++){var h=u[l];t.VALUES_TO_ECI.set(h,this)}try{for(var f=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(a),d=f.next();!d.done;d=f.next()){var p=d.value;t.NAME_TO_ECI.set(p,this)}}catch(g){o={error:g}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}}return t.prototype.getValueIdentifier=function(){return this.valueIdentifier},t.prototype.getName=function(){return this.name},t.prototype.getValue=function(){return this.values[0]},t.getCharacterSetECIByValue=function(e){if(e<0||e>=900)throw new Vr("incorect value");var r=t.VALUES_TO_ECI.get(e);if(void 0===r)throw new Vr("incorect value");return r},t.getCharacterSetECIByName=function(e){var r=t.NAME_TO_ECI.get(e);if(void 0===r)throw new Vr("incorect value");return r},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var r=e;return this.getName()===r.getName()},t.VALUE_IDENTIFIER_TO_ECI=new Map,t.VALUES_TO_ECI=new Map,t.NAME_TO_ECI=new Map,t.Cp437=new t(Lr.Cp437,Int32Array.from([0,2]),"Cp437"),t.ISO8859_1=new t(Lr.ISO8859_1,Int32Array.from([1,3]),"ISO-8859-1","ISO88591","ISO8859_1"),t.ISO8859_2=new t(Lr.ISO8859_2,4,"ISO-8859-2","ISO88592","ISO8859_2"),t.ISO8859_3=new t(Lr.ISO8859_3,5,"ISO-8859-3","ISO88593","ISO8859_3"),t.ISO8859_4=new t(Lr.ISO8859_4,6,"ISO-8859-4","ISO88594","ISO8859_4"),t.ISO8859_5=new t(Lr.ISO8859_5,7,"ISO-8859-5","ISO88595","ISO8859_5"),t.ISO8859_6=new t(Lr.ISO8859_6,8,"ISO-8859-6","ISO88596","ISO8859_6"),t.ISO8859_7=new t(Lr.ISO8859_7,9,"ISO-8859-7","ISO88597","ISO8859_7"),t.ISO8859_8=new t(Lr.ISO8859_8,10,"ISO-8859-8","ISO88598","ISO8859_8"),t.ISO8859_9=new t(Lr.ISO8859_9,11,"ISO-8859-9","ISO88599","ISO8859_9"),t.ISO8859_10=new t(Lr.ISO8859_10,12,"ISO-8859-10","ISO885910","ISO8859_10"),t.ISO8859_11=new t(Lr.ISO8859_11,13,"ISO-8859-11","ISO885911","ISO8859_11"),t.ISO8859_13=new t(Lr.ISO8859_13,15,"ISO-8859-13","ISO885913","ISO8859_13"),t.ISO8859_14=new t(Lr.ISO8859_14,16,"ISO-8859-14","ISO885914","ISO8859_14"),t.ISO8859_15=new t(Lr.ISO8859_15,17,"ISO-8859-15","ISO885915","ISO8859_15"),t.ISO8859_16=new t(Lr.ISO8859_16,18,"ISO-8859-16","ISO885916","ISO8859_16"),t.SJIS=new t(Lr.SJIS,20,"SJIS","Shift_JIS"),t.Cp1250=new t(Lr.Cp1250,21,"Cp1250","windows-1250"),t.Cp1251=new t(Lr.Cp1251,22,"Cp1251","windows-1251"),t.Cp1252=new t(Lr.Cp1252,23,"Cp1252","windows-1252"),t.Cp1256=new t(Lr.Cp1256,24,"Cp1256","windows-1256"),t.UnicodeBigUnmarked=new t(Lr.UnicodeBigUnmarked,25,"UnicodeBigUnmarked","UTF-16BE","UnicodeBig"),t.UTF8=new t(Lr.UTF8,26,"UTF8","UTF-8"),t.ASCII=new t(Lr.ASCII,Int32Array.from([27,170]),"ASCII","US-ASCII"),t.Big5=new t(Lr.Big5,28,"Big5"),t.GB18030=new t(Lr.GB18030,29,"GB18030","GB2312","EUC_CN","GBK"),t.EUC_KR=new t(Lr.EUC_KR,30,"EUC_KR","EUC-KR"),t}(),zr=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Wr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return zr(e,t),e.kind="UnsupportedOperationException",e}(wr),Gr=function(){function t(){}return t.decode=function(t,e){var r=this.encodingName(e);return this.customDecoder?this.customDecoder(t,r):"undefined"==typeof TextDecoder||this.shouldDecodeOnFallback(r)?this.decodeFallback(t,r):new TextDecoder(r).decode(t)},t.shouldDecodeOnFallback=function(e){return!t.isBrowser()&&"ISO-8859-1"===e},t.encode=function(t,e){var r=this.encodingName(e);return this.customEncoder?this.customEncoder(t,r):"undefined"==typeof TextEncoder?this.encodeFallback(t):(new TextEncoder).encode(t)},t.isBrowser=function(){return"undefined"!=typeof window&&"[object Window]"==={}.toString.call(window)},t.encodingName=function(t){return"string"==typeof t?t:t.getName()},t.encodingCharacterSet=function(t){return t instanceof Hr?t:Hr.getCharacterSetECIByName(t)},t.decodeFallback=function(e,r){var n=this.encodingCharacterSet(r);if(t.isDecodeFallbackSupported(n)){for(var o="",i=0,a=e.length;i<a;i++){var s=e[i].toString(16);s.length<2&&(s="0"+s),o+="%"+s}return decodeURIComponent(o)}if(n.equals(Hr.UnicodeBigUnmarked))return String.fromCharCode.apply(null,new Uint16Array(e.buffer));throw new Wr("Encoding "+this.encodingName(r)+" not supported by fallback.")},t.isDecodeFallbackSupported=function(t){return t.equals(Hr.UTF8)||t.equals(Hr.ISO8859_1)||t.equals(Hr.ASCII)},t.encodeFallback=function(t){for(var e=btoa(unescape(encodeURIComponent(t))).split(""),r=[],n=0;n<e.length;n++)r.push(e[n].charCodeAt(0));return new Uint8Array(r)},t}(),Xr=function(){function t(){}return t.castAsNonUtf8Char=function(t,e){void 0===e&&(e=null);var r=e?e.getName():this.ISO88591;return Gr.decode(new Uint8Array([t]),r)},t.guessEncoding=function(e,r){if(null!=r&&void 0!==r.get(Fr.CHARACTER_SET))return r.get(Fr.CHARACTER_SET).toString();for(var n=e.length,o=!0,i=!0,a=!0,s=0,u=0,l=0,c=0,h=0,f=0,d=0,p=0,g=0,m=0,v=0,y=e.length>3&&239===e[0]&&187===e[1]&&191===e[2],_=0;_<n&&(o||i||a);_++){var w=255&e[_];a&&(s>0?128&w?s--:a=!1:!!(128&w)&&(64&w?(s++,32&w?(s++,16&w?(s++,8&w?a=!1:c++):l++):u++):a=!1)),o&&(w>127&&w<160?o=!1:w>159&&(w<192||215===w||247===w)&&v++),i&&(h>0?w<64||127===w||w>252?i=!1:h--:128===w||160===w||w>239?i=!1:w>160&&w<224?(f++,p=0,++d>g&&(g=d)):w>127?(h++,d=0,++p>m&&(m=p)):(d=0,p=0))}return a&&s>0&&(a=!1),i&&h>0&&(i=!1),a&&(y||u+l+c>0)?t.UTF8:i&&(t.ASSUME_SHIFT_JIS||g>=3||m>=3)?t.SHIFT_JIS:o&&i?2===g&&2===f||10*v>=n?t.SHIFT_JIS:t.ISO88591:o?t.ISO88591:i?t.SHIFT_JIS:a?t.UTF8:t.PLATFORM_DEFAULT_ENCODING},t.format=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var n=-1;return t.replace(/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g,function(t,r,o,i,a,s){if("%%"===t)return"%";if(void 0!==e[++n]){t=i?parseInt(i.substr(1)):void 0;var u,l=a?parseInt(a.substr(1)):void 0;switch(s){case"s":u=e[n];break;case"c":u=e[n][0];break;case"f":u=parseFloat(e[n]).toFixed(t);break;case"p":u=parseFloat(e[n]).toPrecision(t);break;case"e":u=parseFloat(e[n]).toExponential(t);break;case"x":u=parseInt(e[n]).toString(l||16);break;case"d":u=parseFloat(parseInt(e[n],l||10).toPrecision(t)).toFixed(0)}u="object"==typeof u?JSON.stringify(u):(+u).toString(l);for(var c=parseInt(o),h=o&&o[0]+""=="0"?"0":" ";u.length<c;)u=void 0!==r?u+h:h+u;return u}})},t.getBytes=function(t,e){return Gr.encode(t,e)},t.getCharCode=function(t,e){return void 0===e&&(e=0),t.charCodeAt(e)},t.getCharAt=function(t){return String.fromCharCode(t)},t.SHIFT_JIS=Hr.SJIS.getName(),t.GB2312="GB2312",t.ISO88591=Hr.ISO8859_1.getName(),t.EUC_JP="EUC_JP",t.UTF8=Hr.UTF8.getName(),t.PLATFORM_DEFAULT_ENCODING=t.UTF8,t.ASSUME_SHIFT_JIS=!1,t}(),$r=function(){function t(t){void 0===t&&(t=""),this.value=t}return t.prototype.enableDecoding=function(t){return this.encoding=t,this},t.prototype.append=function(t){return"string"==typeof t?this.value+=t.toString():this.encoding?this.value+=Xr.castAsNonUtf8Char(t,this.encoding):this.value+=String.fromCharCode(t),this},t.prototype.appendChars=function(t,e,r){for(var n=e;e<e+r;n++)this.append(t[n]);return this},t.prototype.length=function(){return this.value.length},t.prototype.charAt=function(t){return this.value.charAt(t)},t.prototype.deleteCharAt=function(t){this.value=this.value.substr(0,t)+this.value.substring(t+1)},t.prototype.setCharAt=function(t,e){this.value=this.value.substr(0,t)+e+this.value.substr(t+1)},t.prototype.substring=function(t,e){return this.value.substring(t,e)},t.prototype.setLengthToZero=function(){this.value=""},t.prototype.toString=function(){return this.value},t.prototype.insert=function(t,e){this.value=this.value.substr(0,t)+e+this.value.substr(t+e.length)},t}(),Yr=function(){function t(t,e,r,n){if(this.width=t,this.height=e,this.rowSize=r,this.bits=n,null==e&&(e=t),this.height=e,t<1||e<1)throw new Er("Both dimensions must be greater than 0");null==r&&(r=Math.floor((t+31)/32)),this.rowSize=r,null==n&&(this.bits=new Int32Array(this.rowSize*this.height))}return t.parseFromBooleanArray=function(e){for(var r=e.length,n=e[0].length,o=new t(n,r),i=0;i<r;i++)for(var a=e[i],s=0;s<n;s++)a[s]&&o.set(s,i);return o},t.parseFromString=function(e,r,n){if(null===e)throw new Er("stringRepresentation cannot be null");for(var o=new Array(e.length),i=0,a=0,s=-1,u=0,l=0;l<e.length;)if("\n"===e.charAt(l)||"\r"===e.charAt(l)){if(i>a){if(-1===s)s=i-a;else if(i-a!==s)throw new Er("row lengths do not match");a=i,u++}l++}else if(e.substring(l,l+r.length)===r)l+=r.length,o[i]=!0,i++;else{if(e.substring(l,l+n.length)!==n)throw new Er("illegal character encountered: "+e.substring(l));l+=n.length,o[i]=!1,i++}if(i>a){if(-1===s)s=i-a;else if(i-a!==s)throw new Er("row lengths do not match");u++}for(var c=new t(s,u),h=0;h<i;h++)o[h]&&c.set(Math.floor(h%s),Math.floor(h/s));return c},t.prototype.get=function(t,e){var r=e*this.rowSize+Math.floor(t/32);return!!(this.bits[r]>>>(31&t)&1)},t.prototype.set=function(t,e){var r=e*this.rowSize+Math.floor(t/32);this.bits[r]|=1<<(31&t)&4294967295},t.prototype.unset=function(t,e){var r=e*this.rowSize+Math.floor(t/32);this.bits[r]&=~(1<<(31&t)&4294967295)},t.prototype.flip=function(t,e){var r=e*this.rowSize+Math.floor(t/32);this.bits[r]^=1<<(31&t)&4294967295},t.prototype.xor=function(t){if(this.width!==t.getWidth()||this.height!==t.getHeight()||this.rowSize!==t.getRowSize())throw new Er("input matrix dimensions do not match");for(var e=new Br(Math.floor(this.width/32)+1),r=this.rowSize,n=this.bits,o=0,i=this.height;o<i;o++)for(var a=o*r,s=t.getRow(o,e).getBitArray(),u=0;u<r;u++)n[a+u]^=s[u]},t.prototype.clear=function(){for(var t=this.bits,e=t.length,r=0;r<e;r++)t[r]=0},t.prototype.setRegion=function(t,e,r,n){if(e<0||t<0)throw new Er("Left and top must be nonnegative");if(n<1||r<1)throw new Er("Height and width must be at least 1");var o=t+r,i=e+n;if(i>this.height||o>this.width)throw new Er("The region must fit inside the matrix");for(var a=this.rowSize,s=this.bits,u=e;u<i;u++)for(var l=u*a,c=t;c<o;c++)s[l+Math.floor(c/32)]|=1<<(31&c)&4294967295},t.prototype.getRow=function(t,e){null==e||e.getSize()<this.width?e=new Br(this.width):e.clear();for(var r=this.rowSize,n=this.bits,o=t*r,i=0;i<r;i++)e.setBulk(32*i,n[o+i]);return e},t.prototype.setRow=function(t,e){Tr.arraycopy(e.getBitArray(),0,this.bits,t*this.rowSize,this.rowSize)},t.prototype.rotate180=function(){for(var t=this.getWidth(),e=this.getHeight(),r=new Br(t),n=new Br(t),o=0,i=Math.floor((e+1)/2);o<i;o++)r=this.getRow(o,r),n=this.getRow(e-1-o,n),r.reverse(),n.reverse(),this.setRow(o,n),this.setRow(e-1-o,r)},t.prototype.getEnclosingRectangle=function(){for(var t=this.width,e=this.height,r=this.rowSize,n=this.bits,o=t,i=e,a=-1,s=-1,u=0;u<e;u++)for(var l=0;l<r;l++){var c=n[u*r+l];if(0!==c){if(u<i&&(i=u),u>s&&(s=u),32*l<o){for(var h=0;!(c<<31-h&4294967295);)h++;32*l+h<o&&(o=32*l+h)}if(32*l+31>a){for(h=31;c>>>h==0;)h--;32*l+h>a&&(a=32*l+h)}}}return a<o||s<i?null:Int32Array.from([o,i,a-o+1,s-i+1])},t.prototype.getTopLeftOnBit=function(){for(var t=this.rowSize,e=this.bits,r=0;r<e.length&&0===e[r];)r++;if(r===e.length)return null;for(var n=r/t,o=r%t*32,i=e[r],a=0;!(i<<31-a&4294967295);)a++;return o+=a,Int32Array.from([o,n])},t.prototype.getBottomRightOnBit=function(){for(var t=this.rowSize,e=this.bits,r=e.length-1;r>=0&&0===e[r];)r--;if(r<0)return null;for(var n=Math.floor(r/t),o=32*Math.floor(r%t),i=e[r],a=31;i>>>a==0;)a--;return o+=a,Int32Array.from([o,n])},t.prototype.getWidth=function(){return this.width},t.prototype.getHeight=function(){return this.height},t.prototype.getRowSize=function(){return this.rowSize},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var r=e;return this.width===r.width&&this.height===r.height&&this.rowSize===r.rowSize&&Pr.equals(this.bits,r.bits)},t.prototype.hashCode=function(){var t=this.width;return 31*(t=31*(t=31*(t=31*t+this.width)+this.height)+this.rowSize)+Pr.hashCode(this.bits)},t.prototype.toString=function(t,e,r){return void 0===t&&(t="X "),void 0===e&&(e=" "),void 0===r&&(r="\n"),this.buildToString(t,e,r)},t.prototype.buildToString=function(t,e,r){for(var n=new $r,o=0,i=this.height;o<i;o++){for(var a=0,s=this.width;a<s;a++)n.append(this.get(a,o)?t:e);n.append(r)}return n.toString()},t.prototype.clone=function(){return new t(this.width,this.height,this.rowSize,this.bits.slice())},t}(),qr=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Kr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return qr(e,t),e.getNotFoundInstance=function(){return new e},e.kind="NotFoundException",e}(wr),Zr=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Qr=function(t){function e(r){var n=t.call(this,r)||this;return n.luminances=e.EMPTY,n.buckets=new Int32Array(e.LUMINANCE_BUCKETS),n}return Zr(e,t),e.prototype.getBlackRow=function(t,r){var n=this.getLuminanceSource(),o=n.getWidth();null==r||r.getSize()<o?r=new Br(o):r.clear(),this.initArrays(o);for(var i=n.getRow(t,this.luminances),a=this.buckets,s=0;s<o;s++)a[(255&i[s])>>e.LUMINANCE_SHIFT]++;var u=e.estimateBlackPoint(a);if(o<3)for(s=0;s<o;s++)(255&i[s])<u&&r.set(s);else{var l=255&i[0],c=255&i[1];for(s=1;s<o-1;s++){var h=255&i[s+1];(4*c-l-h)/2<u&&r.set(s),l=c,c=h}}return r},e.prototype.getBlackMatrix=function(){var t=this.getLuminanceSource(),r=t.getWidth(),n=t.getHeight(),o=new Yr(r,n);this.initArrays(r);for(var i=this.buckets,a=1;a<5;a++)for(var s=Math.floor(n*a/5),u=t.getRow(s,this.luminances),l=Math.floor(4*r/5),c=Math.floor(r/5);c<l;c++)i[(255&u[c])>>e.LUMINANCE_SHIFT]++;var h=e.estimateBlackPoint(i),f=t.getMatrix();for(a=0;a<n;a++){var d=a*r;for(c=0;c<r;c++)(255&f[d+c])<h&&o.set(c,a)}return o},e.prototype.createBinarizer=function(t){return new e(t)},e.prototype.initArrays=function(t){this.luminances.length<t&&(this.luminances=new Uint8ClampedArray(t));for(var r=this.buckets,n=0;n<e.LUMINANCE_BUCKETS;n++)r[n]=0},e.estimateBlackPoint=function(t){for(var r=t.length,n=0,o=0,i=0,a=0;a<r;a++)t[a]>i&&(o=a,i=t[a]),t[a]>n&&(n=t[a]);var s=0,u=0;for(a=0;a<r;a++){var l=a-o;(d=t[a]*l*l)>u&&(s=a,u=d)}if(o>s){var c=o;o=s,s=c}if(s-o<=r/16)throw new Kr;var h=s-1,f=-1;for(a=s-1;a>o;a--){var d,p=a-o;(d=p*p*(s-a)*(n-t[a]))>f&&(h=a,f=d)}return h<<e.LUMINANCE_SHIFT},e.LUMINANCE_BITS=5,e.LUMINANCE_SHIFT=8-e.LUMINANCE_BITS,e.LUMINANCE_BUCKETS=1<<e.LUMINANCE_BITS,e.EMPTY=Uint8ClampedArray.from([0]),e}(Or),Jr=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),tn=function(t){function e(e){var r=t.call(this,e)||this;return r.matrix=null,r}return Jr(e,t),e.prototype.getBlackMatrix=function(){if(null!==this.matrix)return this.matrix;var r=this.getLuminanceSource(),n=r.getWidth(),o=r.getHeight();if(n>=e.MINIMUM_DIMENSION&&o>=e.MINIMUM_DIMENSION){var i=r.getMatrix(),a=n>>e.BLOCK_SIZE_POWER;0!=(n&e.BLOCK_SIZE_MASK)&&a++;var s=o>>e.BLOCK_SIZE_POWER;0!=(o&e.BLOCK_SIZE_MASK)&&s++;var u=e.calculateBlackPoints(i,a,s,n,o),l=new Yr(n,o);e.calculateThresholdForBlock(i,a,s,n,o,u,l),this.matrix=l}else this.matrix=t.prototype.getBlackMatrix.call(this);return this.matrix},e.prototype.createBinarizer=function(t){return new e(t)},e.calculateThresholdForBlock=function(t,r,n,o,i,a,s){for(var u=i-e.BLOCK_SIZE,l=o-e.BLOCK_SIZE,c=0;c<n;c++){var h=c<<e.BLOCK_SIZE_POWER;h>u&&(h=u);for(var f=e.cap(c,2,n-3),d=0;d<r;d++){var p=d<<e.BLOCK_SIZE_POWER;p>l&&(p=l);for(var g=e.cap(d,2,r-3),m=0,v=-2;v<=2;v++){var y=a[f+v];m+=y[g-2]+y[g-1]+y[g]+y[g+1]+y[g+2]}var _=m/25;e.thresholdBlock(t,p,h,_,o,s)}}},e.cap=function(t,e,r){return t<e?e:t>r?r:t},e.thresholdBlock=function(t,r,n,o,i,a){for(var s=0,u=n*i+r;s<e.BLOCK_SIZE;s++,u+=i)for(var l=0;l<e.BLOCK_SIZE;l++)(255&t[u+l])<=o&&a.set(r+l,n+s)},e.calculateBlackPoints=function(t,r,n,o,i){for(var a=i-e.BLOCK_SIZE,s=o-e.BLOCK_SIZE,u=new Array(n),l=0;l<n;l++){u[l]=new Int32Array(r);var c=l<<e.BLOCK_SIZE_POWER;c>a&&(c=a);for(var h=0;h<r;h++){var f=h<<e.BLOCK_SIZE_POWER;f>s&&(f=s);for(var d=0,p=255,g=0,m=0,v=c*o+f;m<e.BLOCK_SIZE;m++,v+=o){for(var y=0;y<e.BLOCK_SIZE;y++){var _=255&t[v+y];d+=_,_<p&&(p=_),_>g&&(g=_)}if(g-p>e.MIN_DYNAMIC_RANGE)for(m++,v+=o;m<e.BLOCK_SIZE;m++,v+=o)for(y=0;y<e.BLOCK_SIZE;y++)d+=255&t[v+y]}var w=d>>2*e.BLOCK_SIZE_POWER;if(g-p<=e.MIN_DYNAMIC_RANGE&&(w=p/2,l>0&&h>0)){var b=(u[l-1][h]+2*u[l][h-1]+u[l-1][h-1])/4;p<b&&(w=b)}u[l][h]=w}}return u},e.BLOCK_SIZE_POWER=3,e.BLOCK_SIZE=1<<e.BLOCK_SIZE_POWER,e.BLOCK_SIZE_MASK=e.BLOCK_SIZE-1,e.MINIMUM_DIMENSION=5*e.BLOCK_SIZE,e.MIN_DYNAMIC_RANGE=24,e}(Qr),en=function(){function t(t,e){this.width=t,this.height=e}return t.prototype.getWidth=function(){return this.width},t.prototype.getHeight=function(){return this.height},t.prototype.isCropSupported=function(){return!1},t.prototype.crop=function(t,e,r,n){throw new Wr("This luminance source does not support cropping.")},t.prototype.isRotateSupported=function(){return!1},t.prototype.rotateCounterClockwise=function(){throw new Wr("This luminance source does not support rotation by 90 degrees.")},t.prototype.rotateCounterClockwise45=function(){throw new Wr("This luminance source does not support rotation by 45 degrees.")},t.prototype.toString=function(){for(var t=new Uint8ClampedArray(this.width),e=new $r,r=0;r<this.height;r++){for(var n=this.getRow(r,t),o=0;o<this.width;o++){var i,a=255&n[o];i=a<64?"#":a<128?"+":a<192?".":" ",e.append(i)}e.append("\n")}return e.toString()},t}(),rn=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),nn=function(t){function e(e){var r=t.call(this,e.getWidth(),e.getHeight())||this;return r.delegate=e,r}return rn(e,t),e.prototype.getRow=function(t,e){for(var r=this.delegate.getRow(t,e),n=this.getWidth(),o=0;o<n;o++)r[o]=255-(255&r[o]);return r},e.prototype.getMatrix=function(){for(var t=this.delegate.getMatrix(),e=this.getWidth()*this.getHeight(),r=new Uint8ClampedArray(e),n=0;n<e;n++)r[n]=255-(255&t[n]);return r},e.prototype.isCropSupported=function(){return this.delegate.isCropSupported()},e.prototype.crop=function(t,r,n,o){return new e(this.delegate.crop(t,r,n,o))},e.prototype.isRotateSupported=function(){return this.delegate.isRotateSupported()},e.prototype.invert=function(){return this.delegate},e.prototype.rotateCounterClockwise=function(){return new e(this.delegate.rotateCounterClockwise())},e.prototype.rotateCounterClockwise45=function(){return new e(this.delegate.rotateCounterClockwise45())},e}(en),on=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),an=function(t){function e(r){var n=t.call(this,r.width,r.height)||this;return n.canvas=r,n.tempCanvasElement=null,n.buffer=e.makeBufferFromCanvasImageData(r),n}return on(e,t),e.makeBufferFromCanvasImageData=function(t){var r=t.getContext("2d").getImageData(0,0,t.width,t.height);return e.toGrayscaleBuffer(r.data,t.width,t.height)},e.toGrayscaleBuffer=function(t,e,r){for(var n=new Uint8ClampedArray(e*r),o=0,i=0,a=t.length;o<a;o+=4,i++){var s=void 0;s=0===t[o+3]?255:306*t[o]+601*t[o+1]+117*t[o+2]+512>>10,n[i]=s}return n},e.prototype.getRow=function(t,e){if(t<0||t>=this.getHeight())throw new Er("Requested row is outside the image: "+t);var r=this.getWidth(),n=t*r;return null===e?e=this.buffer.slice(n,n+r):(e.length<r&&(e=new Uint8ClampedArray(r)),e.set(this.buffer.slice(n,n+r))),e},e.prototype.getMatrix=function(){return this.buffer},e.prototype.isCropSupported=function(){return!0},e.prototype.crop=function(e,r,n,o){return t.prototype.crop.call(this,e,r,n,o),this},e.prototype.isRotateSupported=function(){return!0},e.prototype.rotateCounterClockwise=function(){return this.rotate(-90),this},e.prototype.rotateCounterClockwise45=function(){return this.rotate(-45),this},e.prototype.getTempCanvasElement=function(){if(null===this.tempCanvasElement){var t=this.canvas.ownerDocument.createElement("canvas");t.width=this.canvas.width,t.height=this.canvas.height,this.tempCanvasElement=t}return this.tempCanvasElement},e.prototype.rotate=function(t){var r=this.getTempCanvasElement(),n=r.getContext("2d"),o=t*e.DEGREE_TO_RADIANS,i=this.canvas.width,a=this.canvas.height,s=Math.ceil(Math.abs(Math.cos(o))*i+Math.abs(Math.sin(o))*a),u=Math.ceil(Math.abs(Math.sin(o))*i+Math.abs(Math.cos(o))*a);return r.width=s,r.height=u,n.translate(s/2,u/2),n.rotate(o),n.drawImage(this.canvas,i/-2,a/-2),this.buffer=e.makeBufferFromCanvasImageData(r),this},e.prototype.invert=function(){return new nn(this)},e.DEGREE_TO_RADIANS=Math.PI/180,e}(en),sn=function(){function t(t,e,r){this.deviceId=t,this.label=e,this.kind="videoinput",this.groupId=r||void 0}return t.prototype.toJSON=function(){return{kind:this.kind,groupId:this.groupId,deviceId:this.deviceId,label:this.label}},t}(),un=function(t,e,r,n){return new(r||(r=Promise))(function(e,o){function i(t){try{s(n.next(t))}catch(e){o(e)}}function a(t){try{s(n.throw(t))}catch(e){o(e)}}function s(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r(function(t){t(n)})).then(i,a)}s((n=n.apply(t,[])).next())})},ln=function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(s){i=[6,s],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},cn=function(){function t(t,e,r){void 0===e&&(e=500),this.reader=t,this.timeBetweenScansMillis=e,this._hints=r,this._stopContinuousDecode=!1,this._stopAsyncDecode=!1,this._timeBetweenDecodingAttempts=0}return Object.defineProperty(t.prototype,"hasNavigator",{get:function(){return"undefined"!=typeof navigator},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isMediaDevicesSuported",{get:function(){return this.hasNavigator&&!!navigator.mediaDevices},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canEnumerateDevices",{get:function(){return!(!this.isMediaDevicesSuported||!navigator.mediaDevices.enumerateDevices)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"timeBetweenDecodingAttempts",{get:function(){return this._timeBetweenDecodingAttempts},set:function(t){this._timeBetweenDecodingAttempts=t<0?0:t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hints",{get:function(){return this._hints},set:function(t){this._hints=t||null},enumerable:!1,configurable:!0}),t.prototype.listVideoInputDevices=function(){return un(this,0,void 0,function(){var t,e,r,n,o,i,a,s,u,l,c,h;return ln(this,function(f){switch(f.label){case 0:if(!this.hasNavigator)throw new Error("Can't enumerate devices, navigator is not present.");if(!this.canEnumerateDevices)throw new Error("Can't enumerate devices, method not supported.");return[4,navigator.mediaDevices.enumerateDevices()];case 1:t=f.sent(),e=[];try{for(r=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(t),n=r.next();!n.done;n=r.next())o=n.value,"videoinput"===(i="video"===o.kind?"videoinput":o.kind)&&(a=o.deviceId||o.id,s=o.label||"Video device "+(e.length+1),u=o.groupId,l={deviceId:a,label:s,kind:i,groupId:u},e.push(l))}catch(d){c={error:d}}finally{try{n&&!n.done&&(h=r.return)&&h.call(r)}finally{if(c)throw c.error}}return[2,e]}})})},t.prototype.getVideoInputDevices=function(){return un(this,0,void 0,function(){return ln(this,function(t){switch(t.label){case 0:return[4,this.listVideoInputDevices()];case 1:return[2,t.sent().map(function(t){return new sn(t.deviceId,t.label)})]}})})},t.prototype.findDeviceById=function(t){return un(this,0,void 0,function(){var e;return ln(this,function(r){switch(r.label){case 0:return[4,this.listVideoInputDevices()];case 1:return(e=r.sent())?[2,e.find(function(e){return e.deviceId===t})]:[2,null]}})})},t.prototype.decodeFromInputVideoDevice=function(t,e){return un(this,0,void 0,function(){return ln(this,function(r){switch(r.label){case 0:return[4,this.decodeOnceFromVideoDevice(t,e)];case 1:return[2,r.sent()]}})})},t.prototype.decodeOnceFromVideoDevice=function(t,e){return un(this,0,void 0,function(){var r;return ln(this,function(n){switch(n.label){case 0:return this.reset(),r={video:t?{deviceId:{exact:t}}:{facingMode:"environment"}},[4,this.decodeOnceFromConstraints(r,e)];case 1:return[2,n.sent()]}})})},t.prototype.decodeOnceFromConstraints=function(t,e){return un(this,0,void 0,function(){var r;return ln(this,function(n){switch(n.label){case 0:return[4,navigator.mediaDevices.getUserMedia(t)];case 1:return r=n.sent(),[4,this.decodeOnceFromStream(r,e)];case 2:return[2,n.sent()]}})})},t.prototype.decodeOnceFromStream=function(t,e){return un(this,0,void 0,function(){var r;return ln(this,function(n){switch(n.label){case 0:return this.reset(),[4,this.attachStreamToVideo(t,e)];case 1:return r=n.sent(),[4,this.decodeOnce(r)];case 2:return[2,n.sent()]}})})},t.prototype.decodeFromInputVideoDeviceContinuously=function(t,e,r){return un(this,0,void 0,function(){return ln(this,function(n){switch(n.label){case 0:return[4,this.decodeFromVideoDevice(t,e,r)];case 1:return[2,n.sent()]}})})},t.prototype.decodeFromVideoDevice=function(t,e,r){return un(this,0,void 0,function(){var n;return ln(this,function(o){switch(o.label){case 0:return n={video:t?{deviceId:{exact:t}}:{facingMode:"environment"}},[4,this.decodeFromConstraints(n,e,r)];case 1:return[2,o.sent()]}})})},t.prototype.decodeFromConstraints=function(t,e,r){return un(this,0,void 0,function(){var n;return ln(this,function(o){switch(o.label){case 0:return[4,navigator.mediaDevices.getUserMedia(t)];case 1:return n=o.sent(),[4,this.decodeFromStream(n,e,r)];case 2:return[2,o.sent()]}})})},t.prototype.decodeFromStream=function(t,e,r){return un(this,0,void 0,function(){var n;return ln(this,function(o){switch(o.label){case 0:return this.reset(),[4,this.attachStreamToVideo(t,e)];case 1:return n=o.sent(),[4,this.decodeContinuously(n,r)];case 2:return[2,o.sent()]}})})},t.prototype.stopAsyncDecode=function(){this._stopAsyncDecode=!0},t.prototype.stopContinuousDecode=function(){this._stopContinuousDecode=!0},t.prototype.attachStreamToVideo=function(t,e){return un(this,0,void 0,function(){var r;return ln(this,function(n){switch(n.label){case 0:return r=this.prepareVideoElement(e),this.addVideoSource(r,t),this.videoElement=r,this.stream=t,[4,this.playVideoOnLoadAsync(r)];case 1:return n.sent(),[2,r]}})})},t.prototype.playVideoOnLoadAsync=function(t){var e=this;return new Promise(function(r,n){return e.playVideoOnLoad(t,function(){return r()})})},t.prototype.playVideoOnLoad=function(t,e){var r=this;this.videoEndedListener=function(){return r.stopStreams()},this.videoCanPlayListener=function(){return r.tryPlayVideo(t)},t.addEventListener("ended",this.videoEndedListener),t.addEventListener("canplay",this.videoCanPlayListener),t.addEventListener("playing",e),this.tryPlayVideo(t)},t.prototype.isVideoPlaying=function(t){return t.currentTime>0&&!t.paused&&!t.ended&&t.readyState>2},t.prototype.tryPlayVideo=function(t){return un(this,0,void 0,function(){return ln(this,function(e){switch(e.label){case 0:if(this.isVideoPlaying(t))return console.warn("Trying to play video that is already playing."),[2];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,t.play()];case 2:return e.sent(),[3,4];case 3:return e.sent(),console.warn("It was not possible to play the video."),[3,4];case 4:return[2]}})})},t.prototype.getMediaElement=function(t,e){var r=document.getElementById(t);if(!r)throw new Cr("element with id '"+t+"' not found");if(r.nodeName.toLowerCase()!==e.toLowerCase())throw new Cr("element with id '"+t+"' must be an "+e+" element");return r},t.prototype.decodeFromImage=function(t,e){if(!t&&!e)throw new Cr("either imageElement with a src set or an url must be provided");return e&&!t?this.decodeFromImageUrl(e):this.decodeFromImageElement(t)},t.prototype.decodeFromVideo=function(t,e){if(!t&&!e)throw new Cr("Either an element with a src set or an URL must be provided");return e&&!t?this.decodeFromVideoUrl(e):this.decodeFromVideoElement(t)},t.prototype.decodeFromVideoContinuously=function(t,e,r){if(void 0===t&&void 0===e)throw new Cr("Either an element with a src set or an URL must be provided");return e&&!t?this.decodeFromVideoUrlContinuously(e,r):this.decodeFromVideoElementContinuously(t,r)},t.prototype.decodeFromImageElement=function(t){if(!t)throw new Cr("An image element must be provided.");this.reset();var e=this.prepareImageElement(t);return this.imageElement=e,this.isImageLoaded(e)?this.decodeOnce(e,!1,!0):this._decodeOnLoadImage(e)},t.prototype.decodeFromVideoElement=function(t){var e=this._decodeFromVideoElementSetup(t);return this._decodeOnLoadVideo(e)},t.prototype.decodeFromVideoElementContinuously=function(t,e){var r=this._decodeFromVideoElementSetup(t);return this._decodeOnLoadVideoContinuously(r,e)},t.prototype._decodeFromVideoElementSetup=function(t){if(!t)throw new Cr("A video element must be provided.");this.reset();var e=this.prepareVideoElement(t);return this.videoElement=e,e},t.prototype.decodeFromImageUrl=function(t){if(!t)throw new Cr("An URL must be provided.");this.reset();var e=this.prepareImageElement();this.imageElement=e;var r=this._decodeOnLoadImage(e);return e.src=t,r},t.prototype.decodeFromVideoUrl=function(t){if(!t)throw new Cr("An URL must be provided.");this.reset();var e=this.prepareVideoElement(),r=this.decodeFromVideoElement(e);return e.src=t,r},t.prototype.decodeFromVideoUrlContinuously=function(t,e){if(!t)throw new Cr("An URL must be provided.");this.reset();var r=this.prepareVideoElement(),n=this.decodeFromVideoElementContinuously(r,e);return r.src=t,n},t.prototype._decodeOnLoadImage=function(t){var e=this;return new Promise(function(r,n){e.imageLoadedListener=function(){return e.decodeOnce(t,!1,!0).then(r,n)},t.addEventListener("load",e.imageLoadedListener)})},t.prototype._decodeOnLoadVideo=function(t){return un(this,0,void 0,function(){return ln(this,function(e){switch(e.label){case 0:return[4,this.playVideoOnLoadAsync(t)];case 1:return e.sent(),[4,this.decodeOnce(t)];case 2:return[2,e.sent()]}})})},t.prototype._decodeOnLoadVideoContinuously=function(t,e){return un(this,0,void 0,function(){return ln(this,function(r){switch(r.label){case 0:return[4,this.playVideoOnLoadAsync(t)];case 1:return r.sent(),this.decodeContinuously(t,e),[2]}})})},t.prototype.isImageLoaded=function(t){return!!t.complete&&0!==t.naturalWidth},t.prototype.prepareImageElement=function(t){var e;return void 0===t&&((e=document.createElement("img")).width=200,e.height=200),"string"==typeof t&&(e=this.getMediaElement(t,"img")),t instanceof HTMLImageElement&&(e=t),e},t.prototype.prepareVideoElement=function(t){var e;return t||"undefined"==typeof document||((e=document.createElement("video")).width=200,e.height=200),"string"==typeof t&&(e=this.getMediaElement(t,"video")),t instanceof HTMLVideoElement&&(e=t),e.setAttribute("autoplay","true"),e.setAttribute("muted","true"),e.setAttribute("playsinline","true"),e},t.prototype.decodeOnce=function(t,e,r){var n=this;void 0===e&&(e=!0),void 0===r&&(r=!0),this._stopAsyncDecode=!1;var o=function(i,a){if(n._stopAsyncDecode)return a(new Kr("Video stream has ended before any code could be detected.")),void(n._stopAsyncDecode=void 0);try{i(n.decode(t))}catch(s){if(e&&s instanceof Kr||(s instanceof xr||s instanceof Vr)&&r)return setTimeout(o,n._timeBetweenDecodingAttempts,i,a);a(s)}};return new Promise(function(t,e){return o(t,e)})},t.prototype.decodeContinuously=function(t,e){var r=this;this._stopContinuousDecode=!1;var n=function(){if(r._stopContinuousDecode)r._stopContinuousDecode=void 0;else try{var o=r.decode(t);e(o,null),setTimeout(n,r.timeBetweenScansMillis)}catch(i){e(null,i),(i instanceof xr||i instanceof Vr||i instanceof Kr)&&setTimeout(n,r._timeBetweenDecodingAttempts)}};n()},t.prototype.decode=function(t){var e=this.createBinaryBitmap(t);return this.decodeBitmap(e)},t.prototype.createBinaryBitmap=function(t){var e=this.getCaptureCanvasContext(t);this.drawImageOnCanvas(e,t);var r=this.getCaptureCanvas(t),n=new an(r),o=new tn(n);return new Ir(o)},t.prototype.getCaptureCanvasContext=function(t){if(!this.captureCanvasContext){var e=this.getCaptureCanvas(t).getContext("2d");this.captureCanvasContext=e}return this.captureCanvasContext},t.prototype.getCaptureCanvas=function(t){if(!this.captureCanvas){var e=this.createCaptureCanvas(t);this.captureCanvas=e}return this.captureCanvas},t.prototype.drawImageOnCanvas=function(t,e){t.drawImage(e,0,0)},t.prototype.decodeBitmap=function(t){return this.reader.decode(t,this._hints)},t.prototype.createCaptureCanvas=function(t){if("undefined"==typeof document)return this._destroyCaptureCanvas(),null;var e,r,n=document.createElement("canvas");return void 0!==t&&(t instanceof HTMLVideoElement?(e=t.videoWidth,r=t.videoHeight):t instanceof HTMLImageElement&&(e=t.naturalWidth||t.width,r=t.naturalHeight||t.height)),n.style.width=e+"px",n.style.height=r+"px",n.width=e,n.height=r,n},t.prototype.stopStreams=function(){this.stream&&(this.stream.getVideoTracks().forEach(function(t){return t.stop()}),this.stream=void 0),!1===this._stopAsyncDecode&&this.stopAsyncDecode(),!1===this._stopContinuousDecode&&this.stopContinuousDecode()},t.prototype.reset=function(){this.stopStreams(),this._destroyVideoElement(),this._destroyImageElement(),this._destroyCaptureCanvas()},t.prototype._destroyVideoElement=function(){this.videoElement&&(void 0!==this.videoEndedListener&&this.videoElement.removeEventListener("ended",this.videoEndedListener),void 0!==this.videoPlayingEventListener&&this.videoElement.removeEventListener("playing",this.videoPlayingEventListener),void 0!==this.videoCanPlayListener&&this.videoElement.removeEventListener("loadedmetadata",this.videoCanPlayListener),this.cleanVideoSource(this.videoElement),this.videoElement=void 0)},t.prototype._destroyImageElement=function(){this.imageElement&&(void 0!==this.imageLoadedListener&&this.imageElement.removeEventListener("load",this.imageLoadedListener),this.imageElement.src=void 0,this.imageElement.removeAttribute("src"),this.imageElement=void 0)},t.prototype._destroyCaptureCanvas=function(){this.captureCanvasContext=void 0,this.captureCanvas=void 0},t.prototype.addVideoSource=function(t,e){try{t.srcObject=e}catch(r){t.src=URL.createObjectURL(e)}},t.prototype.cleanVideoSource=function(t){try{t.srcObject=null}catch(e){t.src=""}this.videoElement.removeAttribute("src")},t}(),hn=function(){function t(t,e,r,n,o,i){void 0===r&&(r=null==e?0:8*e.length),void 0===i&&(i=Tr.currentTimeMillis()),this.text=t,this.rawBytes=e,this.numBits=r,this.resultPoints=n,this.format=o,this.timestamp=i,this.text=t,this.rawBytes=e,this.numBits=null==r?null==e?0:8*e.length:r,this.resultPoints=n,this.format=o,this.resultMetadata=null,this.timestamp=null==i?Tr.currentTimeMillis():i}return t.prototype.getText=function(){return this.text},t.prototype.getRawBytes=function(){return this.rawBytes},t.prototype.getNumBits=function(){return this.numBits},t.prototype.getResultPoints=function(){return this.resultPoints},t.prototype.getBarcodeFormat=function(){return this.format},t.prototype.getResultMetadata=function(){return this.resultMetadata},t.prototype.putMetadata=function(t,e){null===this.resultMetadata&&(this.resultMetadata=new Map),this.resultMetadata.set(t,e)},t.prototype.putAllMetadata=function(t){null!==t&&(null===this.resultMetadata?this.resultMetadata=t:this.resultMetadata=new Map(t))},t.prototype.addResultPoints=function(t){var e=this.resultPoints;if(null===e)this.resultPoints=t;else if(null!==t&&t.length>0){var r=new Array(e.length+t.length);Tr.arraycopy(e,0,r,0,e.length),Tr.arraycopy(t,0,r,e.length,t.length),this.resultPoints=r}},t.prototype.getTimestamp=function(){return this.timestamp},t.prototype.toString=function(){return this.text},t}();!function(t){t[t.AZTEC=0]="AZTEC",t[t.CODABAR=1]="CODABAR",t[t.CODE_39=2]="CODE_39",t[t.CODE_93=3]="CODE_93",t[t.CODE_128=4]="CODE_128",t[t.DATA_MATRIX=5]="DATA_MATRIX",t[t.EAN_8=6]="EAN_8",t[t.EAN_13=7]="EAN_13",t[t.ITF=8]="ITF",t[t.MAXICODE=9]="MAXICODE",t[t.PDF_417=10]="PDF_417",t[t.QR_CODE=11]="QR_CODE",t[t.RSS_14=12]="RSS_14",t[t.RSS_EXPANDED=13]="RSS_EXPANDED",t[t.UPC_A=14]="UPC_A",t[t.UPC_E=15]="UPC_E",t[t.UPC_EAN_EXTENSION=16]="UPC_EAN_EXTENSION"}(Ur||(Ur={}));var fn,dn=Ur;!function(t){t[t.OTHER=0]="OTHER",t[t.ORIENTATION=1]="ORIENTATION",t[t.BYTE_SEGMENTS=2]="BYTE_SEGMENTS",t[t.ERROR_CORRECTION_LEVEL=3]="ERROR_CORRECTION_LEVEL",t[t.ISSUE_NUMBER=4]="ISSUE_NUMBER",t[t.SUGGESTED_PRICE=5]="SUGGESTED_PRICE",t[t.POSSIBLE_COUNTRY=6]="POSSIBLE_COUNTRY",t[t.UPC_EAN_EXTENSION=7]="UPC_EAN_EXTENSION",t[t.PDF417_EXTRA_METADATA=8]="PDF417_EXTRA_METADATA",t[t.STRUCTURED_APPEND_SEQUENCE=9]="STRUCTURED_APPEND_SEQUENCE",t[t.STRUCTURED_APPEND_PARITY=10]="STRUCTURED_APPEND_PARITY"}(fn||(fn={}));var pn,gn=fn,mn=function(){function t(t,e,r,n,o,i){void 0===o&&(o=-1),void 0===i&&(i=-1),this.rawBytes=t,this.text=e,this.byteSegments=r,this.ecLevel=n,this.structuredAppendSequenceNumber=o,this.structuredAppendParity=i,this.numBits=null==t?0:8*t.length}return t.prototype.getRawBytes=function(){return this.rawBytes},t.prototype.getNumBits=function(){return this.numBits},t.prototype.setNumBits=function(t){this.numBits=t},t.prototype.getText=function(){return this.text},t.prototype.getByteSegments=function(){return this.byteSegments},t.prototype.getECLevel=function(){return this.ecLevel},t.prototype.getErrorsCorrected=function(){return this.errorsCorrected},t.prototype.setErrorsCorrected=function(t){this.errorsCorrected=t},t.prototype.getErasures=function(){return this.erasures},t.prototype.setErasures=function(t){this.erasures=t},t.prototype.getOther=function(){return this.other},t.prototype.setOther=function(t){this.other=t},t.prototype.hasStructuredAppend=function(){return this.structuredAppendParity>=0&&this.structuredAppendSequenceNumber>=0},t.prototype.getStructuredAppendParity=function(){return this.structuredAppendParity},t.prototype.getStructuredAppendSequenceNumber=function(){return this.structuredAppendSequenceNumber},t}(),vn=function(){function t(){}return t.prototype.exp=function(t){return this.expTable[t]},t.prototype.log=function(t){if(0===t)throw new Er;return this.logTable[t]},t.addOrSubtract=function(t,e){return t^e},t}(),yn=function(){function t(t,e){if(0===e.length)throw new Er;this.field=t;var r=e.length;if(r>1&&0===e[0]){for(var n=1;n<r&&0===e[n];)n++;n===r?this.coefficients=Int32Array.from([0]):(this.coefficients=new Int32Array(r-n),Tr.arraycopy(e,n,this.coefficients,0,this.coefficients.length))}else this.coefficients=e}return t.prototype.getCoefficients=function(){return this.coefficients},t.prototype.getDegree=function(){return this.coefficients.length-1},t.prototype.isZero=function(){return 0===this.coefficients[0]},t.prototype.getCoefficient=function(t){return this.coefficients[this.coefficients.length-1-t]},t.prototype.evaluateAt=function(t){if(0===t)return this.getCoefficient(0);var e,r=this.coefficients;if(1===t){e=0;for(var n=0,o=r.length;n!==o;n++){var i=r[n];e=vn.addOrSubtract(e,i)}return e}e=r[0];var a=r.length,s=this.field;for(n=1;n<a;n++)e=vn.addOrSubtract(s.multiply(t,e),r[n]);return e},t.prototype.addOrSubtract=function(e){if(!this.field.equals(e.field))throw new Er("GenericGFPolys do not have same GenericGF field");if(this.isZero())return e;if(e.isZero())return this;var r=this.coefficients,n=e.coefficients;if(r.length>n.length){var o=r;r=n,n=o}var i=new Int32Array(n.length),a=n.length-r.length;Tr.arraycopy(n,0,i,0,a);for(var s=a;s<n.length;s++)i[s]=vn.addOrSubtract(r[s-a],n[s]);return new t(this.field,i)},t.prototype.multiply=function(e){if(!this.field.equals(e.field))throw new Er("GenericGFPolys do not have same GenericGF field");if(this.isZero()||e.isZero())return this.field.getZero();for(var r=this.coefficients,n=r.length,o=e.coefficients,i=o.length,a=new Int32Array(n+i-1),s=this.field,u=0;u<n;u++)for(var l=r[u],c=0;c<i;c++)a[u+c]=vn.addOrSubtract(a[u+c],s.multiply(l,o[c]));return new t(s,a)},t.prototype.multiplyScalar=function(e){if(0===e)return this.field.getZero();if(1===e)return this;for(var r=this.coefficients.length,n=this.field,o=new Int32Array(r),i=this.coefficients,a=0;a<r;a++)o[a]=n.multiply(i[a],e);return new t(n,o)},t.prototype.multiplyByMonomial=function(e,r){if(e<0)throw new Er;if(0===r)return this.field.getZero();for(var n=this.coefficients,o=n.length,i=new Int32Array(o+e),a=this.field,s=0;s<o;s++)i[s]=a.multiply(n[s],r);return new t(a,i)},t.prototype.divide=function(t){if(!this.field.equals(t.field))throw new Er("GenericGFPolys do not have same GenericGF field");if(t.isZero())throw new Er("Divide by 0");for(var e=this.field,r=e.getZero(),n=this,o=t.getCoefficient(t.getDegree()),i=e.inverse(o);n.getDegree()>=t.getDegree()&&!n.isZero();){var a=n.getDegree()-t.getDegree(),s=e.multiply(n.getCoefficient(n.getDegree()),i),u=t.multiplyByMonomial(a,s),l=e.buildMonomial(a,s);r=r.addOrSubtract(l),n=n.addOrSubtract(u)}return[r,n]},t.prototype.toString=function(){for(var t="",e=this.getDegree();e>=0;e--){var r=this.getCoefficient(e);if(0!==r){if(r<0?(t+=" - ",r=-r):t.length>0&&(t+=" + "),0===e||1!==r){var n=this.field.log(r);0===n?t+="1":1===n?t+="a":(t+="a^",t+=n)}0!==e&&(1===e?t+="x":(t+="x^",t+=e))}}return t},t}(),_n=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),wn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return _n(e,t),e.kind="ArithmeticException",e}(wr),bn=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Cn=function(t){function e(e,r,n){var o=t.call(this)||this;o.primitive=e,o.size=r,o.generatorBase=n;for(var i=new Int32Array(r),a=1,s=0;s<r;s++)i[s]=a,(a*=2)>=r&&(a^=e,a&=r-1);o.expTable=i;var u=new Int32Array(r);for(s=0;s<r-1;s++)u[i[s]]=s;return o.logTable=u,o.zero=new yn(o,Int32Array.from([0])),o.one=new yn(o,Int32Array.from([1])),o}return bn(e,t),e.prototype.getZero=function(){return this.zero},e.prototype.getOne=function(){return this.one},e.prototype.buildMonomial=function(t,e){if(t<0)throw new Er;if(0===e)return this.zero;var r=new Int32Array(t+1);return r[0]=e,new yn(this,r)},e.prototype.inverse=function(t){if(0===t)throw new wn;return this.expTable[this.size-this.logTable[t]-1]},e.prototype.multiply=function(t,e){return 0===t||0===e?0:this.expTable[(this.logTable[t]+this.logTable[e])%(this.size-1)]},e.prototype.getSize=function(){return this.size},e.prototype.getGeneratorBase=function(){return this.generatorBase},e.prototype.toString=function(){return"GF(0x"+Mr.toHexString(this.primitive)+","+this.size+")"},e.prototype.equals=function(t){return t===this},e.AZTEC_DATA_12=new e(4201,4096,1),e.AZTEC_DATA_10=new e(1033,1024,1),e.AZTEC_DATA_6=new e(67,64,1),e.AZTEC_PARAM=new e(19,16,1),e.QR_CODE_FIELD_256=new e(285,256,0),e.DATA_MATRIX_FIELD_256=new e(301,256,1),e.AZTEC_DATA_8=e.DATA_MATRIX_FIELD_256,e.MAXICODE_FIELD_64=e.AZTEC_DATA_6,e}(vn),An=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),En=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return An(e,t),e.kind="ReedSolomonException",e}(wr),In=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Sn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return In(e,t),e.kind="IllegalStateException",e}(wr),xn=function(){function t(t){this.field=t}return t.prototype.decode=function(t,e){for(var r=this.field,n=new yn(r,t),o=new Int32Array(e),i=!0,a=0;a<e;a++){var s=n.evaluateAt(r.exp(a+r.getGeneratorBase()));o[o.length-1-a]=s,0!==s&&(i=!1)}if(!i){var u=new yn(r,o),l=this.runEuclideanAlgorithm(r.buildMonomial(e,1),u,e),c=l[0],h=l[1],f=this.findErrorLocations(c),d=this.findErrorMagnitudes(h,f);for(a=0;a<f.length;a++){var p=t.length-1-r.log(f[a]);if(p<0)throw new En("Bad error location");t[p]=Cn.addOrSubtract(t[p],d[a])}}},t.prototype.runEuclideanAlgorithm=function(t,e,r){if(t.getDegree()<e.getDegree()){var n=t;t=e,e=n}for(var o=this.field,i=t,a=e,s=o.getZero(),u=o.getOne();a.getDegree()>=(r/2|0);){var l=i,c=s;if(s=u,(i=a).isZero())throw new En("r_{i-1} was zero");a=l;for(var h=o.getZero(),f=i.getCoefficient(i.getDegree()),d=o.inverse(f);a.getDegree()>=i.getDegree()&&!a.isZero();){var p=a.getDegree()-i.getDegree(),g=o.multiply(a.getCoefficient(a.getDegree()),d);h=h.addOrSubtract(o.buildMonomial(p,g)),a=a.addOrSubtract(i.multiplyByMonomial(p,g))}if(u=h.multiply(s).addOrSubtract(c),a.getDegree()>=i.getDegree())throw new Sn("Division algorithm failed to reduce polynomial?")}var m=u.getCoefficient(0);if(0===m)throw new En("sigmaTilde(0) was zero");var v=o.inverse(m);return[u.multiplyScalar(v),a.multiplyScalar(v)]},t.prototype.findErrorLocations=function(t){var e=t.getDegree();if(1===e)return Int32Array.from([t.getCoefficient(1)]);for(var r=new Int32Array(e),n=0,o=this.field,i=1;i<o.getSize()&&n<e;i++)0===t.evaluateAt(i)&&(r[n]=o.inverse(i),n++);if(n!==e)throw new En("Error locator degree does not match number of roots");return r},t.prototype.findErrorMagnitudes=function(t,e){for(var r=e.length,n=new Int32Array(r),o=this.field,i=0;i<r;i++){for(var a=o.inverse(e[i]),s=1,u=0;u<r;u++)if(i!==u){var l=o.multiply(e[u],a),c=1&l?-2&l:1|l;s=o.multiply(s,c)}n[i]=o.multiply(t.evaluateAt(a),o.inverse(s)),0!==o.getGeneratorBase()&&(n[i]=o.multiply(n[i],a))}return n},t}();!function(t){t[t.UPPER=0]="UPPER",t[t.LOWER=1]="LOWER",t[t.MIXED=2]="MIXED",t[t.DIGIT=3]="DIGIT",t[t.PUNCT=4]="PUNCT",t[t.BINARY=5]="BINARY"}(pn||(pn={}));var On=function(){function t(){}return t.prototype.decode=function(e){this.ddata=e;var r=e.getBits(),n=this.extractBits(r),o=this.correctBits(n),i=t.convertBoolArrayToByteArray(o),a=t.getEncodedData(o),s=new mn(i,a,null,null);return s.setNumBits(o.length),s},t.highLevelDecode=function(t){return this.getEncodedData(t)},t.getEncodedData=function(e){for(var r=e.length,n=pn.UPPER,o=pn.UPPER,i="",a=0;a<r;)if(o===pn.BINARY){if(r-a<5)break;var s=t.readCode(e,a,5);if(a+=5,0===s){if(r-a<11)break;s=t.readCode(e,a,11)+31,a+=11}for(var u=0;u<s;u++){if(r-a<8){a=r;break}var l=t.readCode(e,a,8);i+=Xr.castAsNonUtf8Char(l),a+=8}o=n}else{var c=o===pn.DIGIT?4:5;if(r-a<c)break;l=t.readCode(e,a,c),a+=c;var h=t.getCharacter(o,l);h.startsWith("CTRL_")?(n=o,o=t.getTable(h.charAt(5)),"L"===h.charAt(6)&&(n=o)):(i+=h,o=n)}return i},t.getTable=function(t){switch(t){case"L":return pn.LOWER;case"P":return pn.PUNCT;case"M":return pn.MIXED;case"D":return pn.DIGIT;case"B":return pn.BINARY;default:return pn.UPPER}},t.getCharacter=function(e,r){switch(e){case pn.UPPER:return t.UPPER_TABLE[r];case pn.LOWER:return t.LOWER_TABLE[r];case pn.MIXED:return t.MIXED_TABLE[r];case pn.PUNCT:return t.PUNCT_TABLE[r];case pn.DIGIT:return t.DIGIT_TABLE[r];default:throw new Sn("Bad table")}},t.prototype.correctBits=function(e){var r,n;this.ddata.getNbLayers()<=2?(n=6,r=Cn.AZTEC_DATA_6):this.ddata.getNbLayers()<=8?(n=8,r=Cn.AZTEC_DATA_8):this.ddata.getNbLayers()<=22?(n=10,r=Cn.AZTEC_DATA_10):(n=12,r=Cn.AZTEC_DATA_12);var o=this.ddata.getNbDatablocks(),i=e.length/n;if(i<o)throw new Vr;for(var a=e.length%n,s=new Int32Array(i),u=0;u<i;u++,a+=n)s[u]=t.readCode(e,a,n);try{new xn(r).decode(s,i-o)}catch(g){throw new Vr(g)}var l=(1<<n)-1,c=0;for(u=0;u<o;u++){if(0===(d=s[u])||d===l)throw new Vr;1!==d&&d!==l-1||c++}var h=new Array(o*n-c),f=0;for(u=0;u<o;u++){var d;if(1===(d=s[u])||d===l-1)h.fill(d>1,f,f+n-1),f+=n-1;else for(var p=n-1;p>=0;--p)h[f++]=!!(d&1<<p)}return h},t.prototype.extractBits=function(t){var e=this.ddata.isCompact(),r=this.ddata.getNbLayers(),n=(e?11:14)+4*r,o=new Int32Array(n),i=new Array(this.totalBitsInLayer(r,e));if(e)for(var a=0;a<o.length;a++)o[a]=a;else{var s=n+1+2*Mr.truncDivision(Mr.truncDivision(n,2)-1,15),u=n/2,l=Mr.truncDivision(s,2);for(a=0;a<u;a++){var c=a+Mr.truncDivision(a,15);o[u-a-1]=l-c-1,o[u+a]=l+c+1}}a=0;for(var h=0;a<r;a++){for(var f=4*(r-a)+(e?9:12),d=2*a,p=n-1-d,g=0;g<f;g++)for(var m=2*g,v=0;v<2;v++)i[h+m+v]=t.get(o[d+v],o[d+g]),i[h+2*f+m+v]=t.get(o[d+g],o[p-v]),i[h+4*f+m+v]=t.get(o[p-v],o[p-g]),i[h+6*f+m+v]=t.get(o[p-g],o[d+v]);h+=8*f}return i},t.readCode=function(t,e,r){for(var n=0,o=e;o<e+r;o++)n<<=1,t[o]&&(n|=1);return n},t.readByte=function(e,r){var n=e.length-r;return n>=8?t.readCode(e,r,8):t.readCode(e,r,n)<<8-n},t.convertBoolArrayToByteArray=function(e){for(var r=new Uint8Array((e.length+7)/8),n=0;n<r.length;n++)r[n]=t.readByte(e,8*n);return r},t.prototype.totalBitsInLayer=function(t,e){return((e?88:112)+16*t)*t},t.UPPER_TABLE=["CTRL_PS"," ","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","CTRL_LL","CTRL_ML","CTRL_DL","CTRL_BS"],t.LOWER_TABLE=["CTRL_PS"," ","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","CTRL_US","CTRL_ML","CTRL_DL","CTRL_BS"],t.MIXED_TABLE=["CTRL_PS"," ","\\1","\\2","\\3","\\4","\\5","\\6","\\7","\b","\t","\n","\\13","\f","\r","\\33","\\34","\\35","\\36","\\37","@","\\","^","_","`","|","~","\\177","CTRL_LL","CTRL_UL","CTRL_PL","CTRL_BS"],t.PUNCT_TABLE=["","\r","\r\n",". ",", ",": ","!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}","CTRL_UL"],t.DIGIT_TABLE=["CTRL_PS"," ","0","1","2","3","4","5","6","7","8","9",",",".","CTRL_UL","CTRL_US"],t}(),Tn=function(){function t(){}return t.round=function(t){return NaN===t?0:t<=Number.MIN_SAFE_INTEGER?Number.MIN_SAFE_INTEGER:t>=Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:t+(t<0?-.5:.5)|0},t.distance=function(t,e,r,n){var o=t-r,i=e-n;return Math.sqrt(o*o+i*i)},t.sum=function(t){for(var e=0,r=0,n=t.length;r!==n;r++)e+=t[r];return e},t}(),Nn=function(){function t(){}return t.floatToIntBits=function(t){return t},t.MAX_VALUE=Number.MAX_SAFE_INTEGER,t}(),kn=function(){function t(t,e){this.x=t,this.y=e}return t.prototype.getX=function(){return this.x},t.prototype.getY=function(){return this.y},t.prototype.equals=function(e){if(e instanceof t){var r=e;return this.x===r.x&&this.y===r.y}return!1},t.prototype.hashCode=function(){return 31*Nn.floatToIntBits(this.x)+Nn.floatToIntBits(this.y)},t.prototype.toString=function(){return"("+this.x+","+this.y+")"},t.orderBestPatterns=function(t){var e,r,n,o=this.distance(t[0],t[1]),i=this.distance(t[1],t[2]),a=this.distance(t[0],t[2]);if(i>=o&&i>=a?(r=t[0],e=t[1],n=t[2]):a>=i&&a>=o?(r=t[1],e=t[0],n=t[2]):(r=t[2],e=t[0],n=t[1]),this.crossProductZ(e,r,n)<0){var s=e;e=n,n=s}t[0]=e,t[1]=r,t[2]=n},t.distance=function(t,e){return Tn.distance(t.x,t.y,e.x,e.y)},t.crossProductZ=function(t,e,r){var n=e.x,o=e.y;return(r.x-n)*(t.y-o)-(r.y-o)*(t.x-n)},t}(),Rn=function(){function t(t,e){this.bits=t,this.points=e}return t.prototype.getBits=function(){return this.bits},t.prototype.getPoints=function(){return this.points},t}(),Dn=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Pn=function(t){function e(e,r,n,o,i){var a=t.call(this,e,r)||this;return a.compact=n,a.nbDatablocks=o,a.nbLayers=i,a}return Dn(e,t),e.prototype.getNbLayers=function(){return this.nbLayers},e.prototype.getNbDatablocks=function(){return this.nbDatablocks},e.prototype.isCompact=function(){return this.compact},e}(Rn),Mn=function(){function t(e,r,n,o){this.image=e,this.height=e.getHeight(),this.width=e.getWidth(),null==r&&(r=t.INIT_SIZE),null==n&&(n=e.getWidth()/2|0),null==o&&(o=e.getHeight()/2|0);var i=r/2|0;if(this.leftInit=n-i,this.rightInit=n+i,this.upInit=o-i,this.downInit=o+i,this.upInit<0||this.leftInit<0||this.downInit>=this.height||this.rightInit>=this.width)throw new Kr}return t.prototype.detect=function(){for(var t=this.leftInit,e=this.rightInit,r=this.upInit,n=this.downInit,o=!1,i=!0,a=!1,s=!1,u=!1,l=!1,c=!1,h=this.width,f=this.height;i;){i=!1;for(var d=!0;(d||!s)&&e<h;)(d=this.containsBlackPoint(r,n,e,!1))?(e++,i=!0,s=!0):s||e++;if(e>=h){o=!0;break}for(var p=!0;(p||!u)&&n<f;)(p=this.containsBlackPoint(t,e,n,!0))?(n++,i=!0,u=!0):u||n++;if(n>=f){o=!0;break}for(var g=!0;(g||!l)&&t>=0;)(g=this.containsBlackPoint(r,n,t,!1))?(t--,i=!0,l=!0):l||t--;if(t<0){o=!0;break}for(var m=!0;(m||!c)&&r>=0;)(m=this.containsBlackPoint(t,e,r,!0))?(r--,i=!0,c=!0):c||r--;if(r<0){o=!0;break}i&&(a=!0)}if(!o&&a){for(var v=e-t,y=null,_=1;null===y&&_<v;_++)y=this.getBlackPointOnSegment(t,n-_,t+_,n);if(null==y)throw new Kr;var w=null;for(_=1;null===w&&_<v;_++)w=this.getBlackPointOnSegment(t,r+_,t+_,r);if(null==w)throw new Kr;var b=null;for(_=1;null===b&&_<v;_++)b=this.getBlackPointOnSegment(e,r+_,e-_,r);if(null==b)throw new Kr;var C=null;for(_=1;null===C&&_<v;_++)C=this.getBlackPointOnSegment(e,n-_,e-_,n);if(null==C)throw new Kr;return this.centerEdges(C,y,b,w)}throw new Kr},t.prototype.getBlackPointOnSegment=function(t,e,r,n){for(var o=Tn.round(Tn.distance(t,e,r,n)),i=(r-t)/o,a=(n-e)/o,s=this.image,u=0;u<o;u++){var l=Tn.round(t+u*i),c=Tn.round(e+u*a);if(s.get(l,c))return new kn(l,c)}return null},t.prototype.centerEdges=function(e,r,n,o){var i=e.getX(),a=e.getY(),s=r.getX(),u=r.getY(),l=n.getX(),c=n.getY(),h=o.getX(),f=o.getY(),d=t.CORR;return i<this.width/2?[new kn(h-d,f+d),new kn(s+d,u+d),new kn(l-d,c-d),new kn(i+d,a-d)]:[new kn(h+d,f+d),new kn(s+d,u-d),new kn(l-d,c+d),new kn(i-d,a-d)]},t.prototype.containsBlackPoint=function(t,e,r,n){var o=this.image;if(n){for(var i=t;i<=e;i++)if(o.get(i,r))return!0}else for(var a=t;a<=e;a++)if(o.get(r,a))return!0;return!1},t.INIT_SIZE=10,t.CORR=1,t}(),Bn=function(){function t(){}return t.checkAndNudgePoints=function(t,e){for(var r=t.getWidth(),n=t.getHeight(),o=!0,i=0;i<e.length&&o;i+=2){var a=Math.floor(e[i]),s=Math.floor(e[i+1]);if(a<-1||a>r||s<-1||s>n)throw new Kr;o=!1,-1===a?(e[i]=0,o=!0):a===r&&(e[i]=r-1,o=!0),-1===s?(e[i+1]=0,o=!0):s===n&&(e[i+1]=n-1,o=!0)}for(o=!0,i=e.length-2;i>=0&&o;i-=2){if(a=Math.floor(e[i]),s=Math.floor(e[i+1]),a<-1||a>r||s<-1||s>n)throw new Kr;o=!1,-1===a?(e[i]=0,o=!0):a===r&&(e[i]=r-1,o=!0),-1===s?(e[i+1]=0,o=!0):s===n&&(e[i+1]=n-1,o=!0)}},t}(),Ln=function(){function t(t,e,r,n,o,i,a,s,u){this.a11=t,this.a21=e,this.a31=r,this.a12=n,this.a22=o,this.a32=i,this.a13=a,this.a23=s,this.a33=u}return t.quadrilateralToQuadrilateral=function(e,r,n,o,i,a,s,u,l,c,h,f,d,p,g,m){var v=t.quadrilateralToSquare(e,r,n,o,i,a,s,u);return t.squareToQuadrilateral(l,c,h,f,d,p,g,m).times(v)},t.prototype.transformPoints=function(t){for(var e=t.length,r=this.a11,n=this.a12,o=this.a13,i=this.a21,a=this.a22,s=this.a23,u=this.a31,l=this.a32,c=this.a33,h=0;h<e;h+=2){var f=t[h],d=t[h+1],p=o*f+s*d+c;t[h]=(r*f+i*d+u)/p,t[h+1]=(n*f+a*d+l)/p}},t.prototype.transformPointsWithValues=function(t,e){for(var r=this.a11,n=this.a12,o=this.a13,i=this.a21,a=this.a22,s=this.a23,u=this.a31,l=this.a32,c=this.a33,h=t.length,f=0;f<h;f++){var d=t[f],p=e[f],g=o*d+s*p+c;t[f]=(r*d+i*p+u)/g,e[f]=(n*d+a*p+l)/g}},t.squareToQuadrilateral=function(e,r,n,o,i,a,s,u){var l=e-n+i-s,c=r-o+a-u;if(0===l&&0===c)return new t(n-e,i-n,e,o-r,a-o,r,0,0,1);var h=n-i,f=s-i,d=o-a,p=u-a,g=h*p-f*d,m=(l*p-f*c)/g,v=(h*c-l*d)/g;return new t(n-e+m*n,s-e+v*s,e,o-r+m*o,u-r+v*u,r,m,v,1)},t.quadrilateralToSquare=function(e,r,n,o,i,a,s,u){return t.squareToQuadrilateral(e,r,n,o,i,a,s,u).buildAdjoint()},t.prototype.buildAdjoint=function(){return new t(this.a22*this.a33-this.a23*this.a32,this.a23*this.a31-this.a21*this.a33,this.a21*this.a32-this.a22*this.a31,this.a13*this.a32-this.a12*this.a33,this.a11*this.a33-this.a13*this.a31,this.a12*this.a31-this.a11*this.a32,this.a12*this.a23-this.a13*this.a22,this.a13*this.a21-this.a11*this.a23,this.a11*this.a22-this.a12*this.a21)},t.prototype.times=function(e){return new t(this.a11*e.a11+this.a21*e.a12+this.a31*e.a13,this.a11*e.a21+this.a21*e.a22+this.a31*e.a23,this.a11*e.a31+this.a21*e.a32+this.a31*e.a33,this.a12*e.a11+this.a22*e.a12+this.a32*e.a13,this.a12*e.a21+this.a22*e.a22+this.a32*e.a23,this.a12*e.a31+this.a22*e.a32+this.a32*e.a33,this.a13*e.a11+this.a23*e.a12+this.a33*e.a13,this.a13*e.a21+this.a23*e.a22+this.a33*e.a23,this.a13*e.a31+this.a23*e.a32+this.a33*e.a33)},t}(),Fn=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),jn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Fn(e,t),e.prototype.sampleGrid=function(t,e,r,n,o,i,a,s,u,l,c,h,f,d,p,g,m,v,y){var _=Ln.quadrilateralToQuadrilateral(n,o,i,a,s,u,l,c,h,f,d,p,g,m,v,y);return this.sampleGridWithTransform(t,e,r,_)},e.prototype.sampleGridWithTransform=function(t,e,r,n){if(e<=0||r<=0)throw new Kr;for(var o=new Yr(e,r),i=new Float32Array(2*e),a=0;a<r;a++){for(var s=i.length,u=a+.5,l=0;l<s;l+=2)i[l]=l/2+.5,i[l+1]=u;n.transformPoints(i),Bn.checkAndNudgePoints(t,i);try{for(l=0;l<s;l+=2)t.get(Math.floor(i[l]),Math.floor(i[l+1]))&&o.set(l/2,a)}catch(c){throw new Kr}}return o},e}(Bn),Vn=function(){function t(){}return t.setGridSampler=function(e){t.gridSampler=e},t.getInstance=function(){return t.gridSampler},t.gridSampler=new jn,t}(),Un=function(){function t(t,e){this.x=t,this.y=e}return t.prototype.toResultPoint=function(){return new kn(this.getX(),this.getY())},t.prototype.getX=function(){return this.x},t.prototype.getY=function(){return this.y},t}(),Hn=function(){function t(t){this.EXPECTED_CORNER_BITS=new Int32Array([3808,476,2107,1799]),this.image=t}return t.prototype.detect=function(){return this.detectMirror(!1)},t.prototype.detectMirror=function(t){var e=this.getMatrixCenter(),r=this.getBullsEyeCorners(e);if(t){var n=r[0];r[0]=r[2],r[2]=n}this.extractParameters(r);var o=this.sampleGrid(this.image,r[this.shift%4],r[(this.shift+1)%4],r[(this.shift+2)%4],r[(this.shift+3)%4]),i=this.getMatrixCornerPoints(r);return new Pn(o,i,this.compact,this.nbDataBlocks,this.nbLayers)},t.prototype.extractParameters=function(t){if(!(this.isValidPoint(t[0])&&this.isValidPoint(t[1])&&this.isValidPoint(t[2])&&this.isValidPoint(t[3])))throw new Kr;var e=2*this.nbCenterLayers,r=new Int32Array([this.sampleLine(t[0],t[1],e),this.sampleLine(t[1],t[2],e),this.sampleLine(t[2],t[3],e),this.sampleLine(t[3],t[0],e)]);this.shift=this.getRotation(r,e);for(var n=0,o=0;o<4;o++){var i=r[(this.shift+o)%4];this.compact?(n<<=7,n+=i>>1&127):(n<<=10,n+=(i>>2&992)+(i>>1&31))}var a=this.getCorrectedParameterData(n,this.compact);this.compact?(this.nbLayers=1+(a>>6),this.nbDataBlocks=1+(63&a)):(this.nbLayers=1+(a>>11),this.nbDataBlocks=1+(2047&a))},t.prototype.getRotation=function(t,e){var r=0;t.forEach(function(t,n,o){r=(t>>e-2<<1)+(1&t)+(r<<3)}),r=((1&r)<<11)+(r>>1);for(var n=0;n<4;n++)if(Mr.bitCount(r^this.EXPECTED_CORNER_BITS[n])<=2)return n;throw new Kr},t.prototype.getCorrectedParameterData=function(t,e){var r,n;e?(r=7,n=2):(r=10,n=4);for(var o=r-n,i=new Int32Array(r),a=r-1;a>=0;--a)i[a]=15&t,t>>=4;try{new xn(Cn.AZTEC_PARAM).decode(i,o)}catch(u){throw new Kr}var s=0;for(a=0;a<n;a++)s=(s<<4)+i[a];return s},t.prototype.getBullsEyeCorners=function(t){var e=t,r=t,n=t,o=t,i=!0;for(this.nbCenterLayers=1;this.nbCenterLayers<9;this.nbCenterLayers++){var a=this.getFirstDifferent(e,i,1,-1),s=this.getFirstDifferent(r,i,1,1),u=this.getFirstDifferent(n,i,-1,1),l=this.getFirstDifferent(o,i,-1,-1);if(this.nbCenterLayers>2){var c=this.distancePoint(l,a)*this.nbCenterLayers/(this.distancePoint(o,e)*(this.nbCenterLayers+2));if(c<.75||c>1.25||!this.isWhiteOrBlackRectangle(a,s,u,l))break}e=a,r=s,n=u,o=l,i=!i}if(5!==this.nbCenterLayers&&7!==this.nbCenterLayers)throw new Kr;this.compact=5===this.nbCenterLayers;var h=new kn(e.getX()+.5,e.getY()-.5),f=new kn(r.getX()+.5,r.getY()+.5),d=new kn(n.getX()-.5,n.getY()+.5),p=new kn(o.getX()-.5,o.getY()-.5);return this.expandSquare([h,f,d,p],2*this.nbCenterLayers-3,2*this.nbCenterLayers)},t.prototype.getMatrixCenter=function(){var t,e,r,n;try{t=(u=new Mn(this.image).detect())[0],e=u[1],r=u[2],n=u[3]}catch(l){var o=this.image.getWidth()/2,i=this.image.getHeight()/2;t=this.getFirstDifferent(new Un(o+7,i-7),!1,1,-1).toResultPoint(),e=this.getFirstDifferent(new Un(o+7,i+7),!1,1,1).toResultPoint(),r=this.getFirstDifferent(new Un(o-7,i+7),!1,-1,1).toResultPoint(),n=this.getFirstDifferent(new Un(o-7,i-7),!1,-1,-1).toResultPoint()}var a=Tn.round((t.getX()+n.getX()+e.getX()+r.getX())/4),s=Tn.round((t.getY()+n.getY()+e.getY()+r.getY())/4);try{var u;t=(u=new Mn(this.image,15,a,s).detect())[0],e=u[1],r=u[2],n=u[3]}catch(c){t=this.getFirstDifferent(new Un(a+7,s-7),!1,1,-1).toResultPoint(),e=this.getFirstDifferent(new Un(a+7,s+7),!1,1,1).toResultPoint(),r=this.getFirstDifferent(new Un(a-7,s+7),!1,-1,1).toResultPoint(),n=this.getFirstDifferent(new Un(a-7,s-7),!1,-1,-1).toResultPoint()}return a=Tn.round((t.getX()+n.getX()+e.getX()+r.getX())/4),s=Tn.round((t.getY()+n.getY()+e.getY()+r.getY())/4),new Un(a,s)},t.prototype.getMatrixCornerPoints=function(t){return this.expandSquare(t,2*this.nbCenterLayers,this.getDimension())},t.prototype.sampleGrid=function(t,e,r,n,o){var i=Vn.getInstance(),a=this.getDimension(),s=a/2-this.nbCenterLayers,u=a/2+this.nbCenterLayers;return i.sampleGrid(t,a,a,s,s,u,s,u,u,s,u,e.getX(),e.getY(),r.getX(),r.getY(),n.getX(),n.getY(),o.getX(),o.getY())},t.prototype.sampleLine=function(t,e,r){for(var n=0,o=this.distanceResultPoint(t,e),i=o/r,a=t.getX(),s=t.getY(),u=i*(e.getX()-t.getX())/o,l=i*(e.getY()-t.getY())/o,c=0;c<r;c++)this.image.get(Tn.round(a+c*u),Tn.round(s+c*l))&&(n|=1<<r-c-1);return n},t.prototype.isWhiteOrBlackRectangle=function(t,e,r,n){t=new Un(t.getX()-3,t.getY()+3),e=new Un(e.getX()-3,e.getY()-3),r=new Un(r.getX()+3,r.getY()-3),n=new Un(n.getX()+3,n.getY()+3);var o=this.getColor(n,t);if(0===o)return!1;var i=this.getColor(t,e);return i===o&&(i=this.getColor(e,r))===o&&(i=this.getColor(r,n))===o},t.prototype.getColor=function(t,e){for(var r=this.distancePoint(t,e),n=(e.getX()-t.getX())/r,o=(e.getY()-t.getY())/r,i=0,a=t.getX(),s=t.getY(),u=this.image.get(t.getX(),t.getY()),l=Math.ceil(r),c=0;c<l;c++)a+=n,s+=o,this.image.get(Tn.round(a),Tn.round(s))!==u&&i++;var h=i/r;return h>.1&&h<.9?0:h<=.1===u?1:-1},t.prototype.getFirstDifferent=function(t,e,r,n){for(var o=t.getX()+r,i=t.getY()+n;this.isValid(o,i)&&this.image.get(o,i)===e;)o+=r,i+=n;for(o-=r,i-=n;this.isValid(o,i)&&this.image.get(o,i)===e;)o+=r;for(o-=r;this.isValid(o,i)&&this.image.get(o,i)===e;)i+=n;return new Un(o,i-=n)},t.prototype.expandSquare=function(t,e,r){var n=r/(2*e),o=t[0].getX()-t[2].getX(),i=t[0].getY()-t[2].getY(),a=(t[0].getX()+t[2].getX())/2,s=(t[0].getY()+t[2].getY())/2,u=new kn(a+n*o,s+n*i),l=new kn(a-n*o,s-n*i);return o=t[1].getX()-t[3].getX(),i=t[1].getY()-t[3].getY(),a=(t[1].getX()+t[3].getX())/2,s=(t[1].getY()+t[3].getY())/2,[u,new kn(a+n*o,s+n*i),l,new kn(a-n*o,s-n*i)]},t.prototype.isValid=function(t,e){return t>=0&&t<this.image.getWidth()&&e>0&&e<this.image.getHeight()},t.prototype.isValidPoint=function(t){var e=Tn.round(t.getX()),r=Tn.round(t.getY());return this.isValid(e,r)},t.prototype.distancePoint=function(t,e){return Tn.distance(t.getX(),t.getY(),e.getX(),e.getY())},t.prototype.distanceResultPoint=function(t,e){return Tn.distance(t.getX(),t.getY(),e.getX(),e.getY())},t.prototype.getDimension=function(){return this.compact?4*this.nbLayers+11:this.nbLayers<=4?4*this.nbLayers+15:4*this.nbLayers+2*(Mr.truncDivision(this.nbLayers-4,8)+1)+15},t}(),zn=function(){function t(){}return t.prototype.decode=function(t,e){void 0===e&&(e=null);var r=null,n=new Hn(t.getBlackMatrix()),o=null,i=null;try{o=(a=n.detectMirror(!1)).getPoints(),this.reportFoundResultPoints(e,o),i=(new On).decode(a)}catch(c){r=c}if(null==i)try{var a;o=(a=n.detectMirror(!0)).getPoints(),this.reportFoundResultPoints(e,o),i=(new On).decode(a)}catch(c){if(null!=r)throw r;throw c}var s=new hn(i.getText(),i.getRawBytes(),i.getNumBits(),o,dn.AZTEC,Tr.currentTimeMillis()),u=i.getByteSegments();null!=u&&s.putMetadata(gn.BYTE_SEGMENTS,u);var l=i.getECLevel();return null!=l&&s.putMetadata(gn.ERROR_CORRECTION_LEVEL,l),s},t.prototype.reportFoundResultPoints=function(t,e){if(null!=t){var r=t.get(Fr.NEED_RESULT_POINT_CALLBACK);null!=r&&e.forEach(function(t,e,n){r.foundPossibleResultPoint(t)})}},t.prototype.reset=function(){},t}(),Wn=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){Wn(function(e){return void 0===e&&(e=500),t.call(this,new zn,e)||this},t)}(cn);var Gn=function(){function t(){}return t.prototype.decode=function(t,e){try{return this.doDecode(t,e)}catch(l){if(e&&!0===e.get(Fr.TRY_HARDER)&&t.isRotateSupported()){var r=t.rotateCounterClockwise(),n=this.doDecode(r,e),o=n.getResultMetadata(),i=270;null!==o&&!0===o.get(gn.ORIENTATION)&&(i+=o.get(gn.ORIENTATION)%360),n.putMetadata(gn.ORIENTATION,i);var a=n.getResultPoints();if(null!==a)for(var s=r.getHeight(),u=0;u<a.length;u++)a[u]=new kn(s-a[u].getY()-1,a[u].getX());return n}throw new Kr}},t.prototype.reset=function(){},t.prototype.doDecode=function(t,e){var r,n=t.getWidth(),o=t.getHeight(),i=new Br(n),a=e&&!0===e.get(Fr.TRY_HARDER),s=Math.max(1,o>>(a?8:5));r=a?o:15;for(var u=Math.trunc(o/2),l=0;l<r;l++){var c=Math.trunc((l+1)/2),h=u+s*(1&l?-c:c);if(h<0||h>=o)break;try{i=t.getBlackRow(h,i)}catch(m){continue}for(var f=function(t){if(1===t&&(i.reverse(),e&&!0===e.get(Fr.NEED_RESULT_POINT_CALLBACK))){var r=new Map;e.forEach(function(t,e){return r.set(e,t)}),r.delete(Fr.NEED_RESULT_POINT_CALLBACK),e=r}try{var o=d.decodeRow(h,i,e);if(1===t){o.putMetadata(gn.ORIENTATION,180);var a=o.getResultPoints();null!==a&&(a[0]=new kn(n-a[0].getX()-1,a[0].getY()),a[1]=new kn(n-a[1].getX()-1,a[1].getY()))}return{value:o}}catch(s){}},d=this,p=0;p<2;p++){var g=f(p);if("object"==typeof g)return g.value}}throw new Kr},t.recordPattern=function(t,e,r){for(var n=r.length,o=0;o<n;o++)r[o]=0;var i=t.getSize();if(e>=i)throw new Kr;for(var a=!t.get(e),s=0,u=e;u<i;){if(t.get(u)!==a)r[s]++;else{if(++s===n)break;r[s]=1,a=!a}u++}if(s!==n&&(s!==n-1||u!==i))throw new Kr},t.recordPatternInReverse=function(e,r,n){for(var o=n.length,i=e.get(r);r>0&&o>=0;)e.get(--r)!==i&&(o--,i=!i);if(o>=0)throw new Kr;t.recordPattern(e,r+1,n)},t.patternMatchVariance=function(t,e,r){for(var n=t.length,o=0,i=0,a=0;a<n;a++)o+=t[a],i+=e[a];if(o<i)return Number.POSITIVE_INFINITY;var s=o/i;r*=s;for(var u=0,l=0;l<n;l++){var c=t[l],h=e[l]*s,f=c>h?c-h:h-c;if(f>r)return Number.POSITIVE_INFINITY;u+=f}return u/o},t}(),Xn=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),$n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Xn(e,t),e.findStartPattern=function(t){for(var r=t.getSize(),n=t.getNextSet(0),o=0,i=Int32Array.from([0,0,0,0,0,0]),a=n,s=!1,u=n;u<r;u++)if(t.get(u)!==s)i[o]++;else{if(5===o){for(var l=e.MAX_AVG_VARIANCE,c=-1,h=e.CODE_START_A;h<=e.CODE_START_C;h++){var f=Gn.patternMatchVariance(i,e.CODE_PATTERNS[h],e.MAX_INDIVIDUAL_VARIANCE);f<l&&(l=f,c=h)}if(c>=0&&t.isRange(Math.max(0,a-(u-a)/2),a,!1))return Int32Array.from([a,u,c]);a+=i[0]+i[1],(i=i.slice(2,i.length-1))[o-1]=0,i[o]=0,o--}else o++;i[o]=1,s=!s}throw new Kr},e.decodeCode=function(t,r,n){Gn.recordPattern(t,n,r);for(var o=e.MAX_AVG_VARIANCE,i=-1,a=0;a<e.CODE_PATTERNS.length;a++){var s=e.CODE_PATTERNS[a],u=this.patternMatchVariance(r,s,e.MAX_INDIVIDUAL_VARIANCE);u<o&&(o=u,i=a)}if(i>=0)return i;throw new Kr},e.prototype.decodeRow=function(t,r,n){var o,i=n&&!0===n.get(Fr.ASSUME_GS1),a=e.findStartPattern(r),s=a[2],u=0,l=new Uint8Array(20);switch(l[u++]=s,s){case e.CODE_START_A:o=e.CODE_CODE_A;break;case e.CODE_START_B:o=e.CODE_CODE_B;break;case e.CODE_START_C:o=e.CODE_CODE_C;break;default:throw new Vr}for(var c=!1,h=!1,f="",d=a[0],p=a[1],g=Int32Array.from([0,0,0,0,0,0]),m=0,v=0,y=s,_=0,w=!0,b=!1,C=!1;!c;){var A=h;switch(h=!1,m=v,v=e.decodeCode(r,g,p),l[u++]=v,v!==e.CODE_STOP&&(w=!0),v!==e.CODE_STOP&&(y+=++_*v),d=p,p+=g.reduce(function(t,e){return t+e},0),v){case e.CODE_START_A:case e.CODE_START_B:case e.CODE_START_C:throw new Vr}switch(o){case e.CODE_CODE_A:if(v<64)f+=C===b?String.fromCharCode(" ".charCodeAt(0)+v):String.fromCharCode(" ".charCodeAt(0)+v+128),C=!1;else if(v<96)f+=C===b?String.fromCharCode(v-64):String.fromCharCode(v+64),C=!1;else switch(v!==e.CODE_STOP&&(w=!1),v){case e.CODE_FNC_1:i&&(0===f.length?f+="]C1":f+=String.fromCharCode(29));break;case e.CODE_FNC_2:case e.CODE_FNC_3:break;case e.CODE_FNC_4_A:!b&&C?(b=!0,C=!1):b&&C?(b=!1,C=!1):C=!0;break;case e.CODE_SHIFT:h=!0,o=e.CODE_CODE_B;break;case e.CODE_CODE_B:o=e.CODE_CODE_B;break;case e.CODE_CODE_C:o=e.CODE_CODE_C;break;case e.CODE_STOP:c=!0}break;case e.CODE_CODE_B:if(v<96)f+=C===b?String.fromCharCode(" ".charCodeAt(0)+v):String.fromCharCode(" ".charCodeAt(0)+v+128),C=!1;else switch(v!==e.CODE_STOP&&(w=!1),v){case e.CODE_FNC_1:i&&(0===f.length?f+="]C1":f+=String.fromCharCode(29));break;case e.CODE_FNC_2:case e.CODE_FNC_3:break;case e.CODE_FNC_4_B:!b&&C?(b=!0,C=!1):b&&C?(b=!1,C=!1):C=!0;break;case e.CODE_SHIFT:h=!0,o=e.CODE_CODE_A;break;case e.CODE_CODE_A:o=e.CODE_CODE_A;break;case e.CODE_CODE_C:o=e.CODE_CODE_C;break;case e.CODE_STOP:c=!0}break;case e.CODE_CODE_C:if(v<100)v<10&&(f+="0"),f+=v;else switch(v!==e.CODE_STOP&&(w=!1),v){case e.CODE_FNC_1:i&&(0===f.length?f+="]C1":f+=String.fromCharCode(29));break;case e.CODE_CODE_A:o=e.CODE_CODE_A;break;case e.CODE_CODE_B:o=e.CODE_CODE_B;break;case e.CODE_STOP:c=!0}}A&&(o=o===e.CODE_CODE_A?e.CODE_CODE_B:e.CODE_CODE_A)}var E=p-d;if(p=r.getNextUnset(p),!r.isRange(p,Math.min(r.getSize(),p+(p-d)/2),!1))throw new Kr;if((y-=_*m)%103!==m)throw new xr;var I=f.length;if(0===I)throw new Kr;I>0&&w&&(f=o===e.CODE_CODE_C?f.substring(0,I-2):f.substring(0,I-1));for(var S=(a[1]+a[0])/2,x=d+E/2,O=l.length,T=new Uint8Array(O),N=0;N<O;N++)T[N]=l[N];var k=[new kn(S,t),new kn(x,t)];return new hn(f,T,0,k,dn.CODE_128,(new Date).getTime())},e.CODE_PATTERNS=[Int32Array.from([2,1,2,2,2,2]),Int32Array.from([2,2,2,1,2,2]),Int32Array.from([2,2,2,2,2,1]),Int32Array.from([1,2,1,2,2,3]),Int32Array.from([1,2,1,3,2,2]),Int32Array.from([1,3,1,2,2,2]),Int32Array.from([1,2,2,2,1,3]),Int32Array.from([1,2,2,3,1,2]),Int32Array.from([1,3,2,2,1,2]),Int32Array.from([2,2,1,2,1,3]),Int32Array.from([2,2,1,3,1,2]),Int32Array.from([2,3,1,2,1,2]),Int32Array.from([1,1,2,2,3,2]),Int32Array.from([1,2,2,1,3,2]),Int32Array.from([1,2,2,2,3,1]),Int32Array.from([1,1,3,2,2,2]),Int32Array.from([1,2,3,1,2,2]),Int32Array.from([1,2,3,2,2,1]),Int32Array.from([2,2,3,2,1,1]),Int32Array.from([2,2,1,1,3,2]),Int32Array.from([2,2,1,2,3,1]),Int32Array.from([2,1,3,2,1,2]),Int32Array.from([2,2,3,1,1,2]),Int32Array.from([3,1,2,1,3,1]),Int32Array.from([3,1,1,2,2,2]),Int32Array.from([3,2,1,1,2,2]),Int32Array.from([3,2,1,2,2,1]),Int32Array.from([3,1,2,2,1,2]),Int32Array.from([3,2,2,1,1,2]),Int32Array.from([3,2,2,2,1,1]),Int32Array.from([2,1,2,1,2,3]),Int32Array.from([2,1,2,3,2,1]),Int32Array.from([2,3,2,1,2,1]),Int32Array.from([1,1,1,3,2,3]),Int32Array.from([1,3,1,1,2,3]),Int32Array.from([1,3,1,3,2,1]),Int32Array.from([1,1,2,3,1,3]),Int32Array.from([1,3,2,1,1,3]),Int32Array.from([1,3,2,3,1,1]),Int32Array.from([2,1,1,3,1,3]),Int32Array.from([2,3,1,1,1,3]),Int32Array.from([2,3,1,3,1,1]),Int32Array.from([1,1,2,1,3,3]),Int32Array.from([1,1,2,3,3,1]),Int32Array.from([1,3,2,1,3,1]),Int32Array.from([1,1,3,1,2,3]),Int32Array.from([1,1,3,3,2,1]),Int32Array.from([1,3,3,1,2,1]),Int32Array.from([3,1,3,1,2,1]),Int32Array.from([2,1,1,3,3,1]),Int32Array.from([2,3,1,1,3,1]),Int32Array.from([2,1,3,1,1,3]),Int32Array.from([2,1,3,3,1,1]),Int32Array.from([2,1,3,1,3,1]),Int32Array.from([3,1,1,1,2,3]),Int32Array.from([3,1,1,3,2,1]),Int32Array.from([3,3,1,1,2,1]),Int32Array.from([3,1,2,1,1,3]),Int32Array.from([3,1,2,3,1,1]),Int32Array.from([3,3,2,1,1,1]),Int32Array.from([3,1,4,1,1,1]),Int32Array.from([2,2,1,4,1,1]),Int32Array.from([4,3,1,1,1,1]),Int32Array.from([1,1,1,2,2,4]),Int32Array.from([1,1,1,4,2,2]),Int32Array.from([1,2,1,1,2,4]),Int32Array.from([1,2,1,4,2,1]),Int32Array.from([1,4,1,1,2,2]),Int32Array.from([1,4,1,2,2,1]),Int32Array.from([1,1,2,2,1,4]),Int32Array.from([1,1,2,4,1,2]),Int32Array.from([1,2,2,1,1,4]),Int32Array.from([1,2,2,4,1,1]),Int32Array.from([1,4,2,1,1,2]),Int32Array.from([1,4,2,2,1,1]),Int32Array.from([2,4,1,2,1,1]),Int32Array.from([2,2,1,1,1,4]),Int32Array.from([4,1,3,1,1,1]),Int32Array.from([2,4,1,1,1,2]),Int32Array.from([1,3,4,1,1,1]),Int32Array.from([1,1,1,2,4,2]),Int32Array.from([1,2,1,1,4,2]),Int32Array.from([1,2,1,2,4,1]),Int32Array.from([1,1,4,2,1,2]),Int32Array.from([1,2,4,1,1,2]),Int32Array.from([1,2,4,2,1,1]),Int32Array.from([4,1,1,2,1,2]),Int32Array.from([4,2,1,1,1,2]),Int32Array.from([4,2,1,2,1,1]),Int32Array.from([2,1,2,1,4,1]),Int32Array.from([2,1,4,1,2,1]),Int32Array.from([4,1,2,1,2,1]),Int32Array.from([1,1,1,1,4,3]),Int32Array.from([1,1,1,3,4,1]),Int32Array.from([1,3,1,1,4,1]),Int32Array.from([1,1,4,1,1,3]),Int32Array.from([1,1,4,3,1,1]),Int32Array.from([4,1,1,1,1,3]),Int32Array.from([4,1,1,3,1,1]),Int32Array.from([1,1,3,1,4,1]),Int32Array.from([1,1,4,1,3,1]),Int32Array.from([3,1,1,1,4,1]),Int32Array.from([4,1,1,1,3,1]),Int32Array.from([2,1,1,4,1,2]),Int32Array.from([2,1,1,2,1,4]),Int32Array.from([2,1,1,2,3,2]),Int32Array.from([2,3,3,1,1,1,2])],e.MAX_AVG_VARIANCE=.25,e.MAX_INDIVIDUAL_VARIANCE=.7,e.CODE_SHIFT=98,e.CODE_CODE_C=99,e.CODE_CODE_B=100,e.CODE_CODE_A=101,e.CODE_FNC_1=102,e.CODE_FNC_2=97,e.CODE_FNC_3=96,e.CODE_FNC_4_A=101,e.CODE_FNC_4_B=100,e.CODE_START_A=103,e.CODE_START_B=104,e.CODE_START_C=105,e.CODE_STOP=106,e}(Gn),Yn=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),qn=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Kn=function(t){function e(e,r){void 0===e&&(e=!1),void 0===r&&(r=!1);var n=t.call(this)||this;return n.usingCheckDigit=e,n.extendedMode=r,n.decodeRowResult="",n.counters=new Int32Array(9),n}return Yn(e,t),e.prototype.decodeRow=function(t,r,n){var o,i,a,s,u=this.counters;u.fill(0),this.decodeRowResult="";var l,c,h=e.findAsteriskPattern(r,u),f=r.getNextSet(h[1]),d=r.getSize();do{e.recordPattern(r,f,u);var p=e.toNarrowWidePattern(u);if(p<0)throw new Kr;l=e.patternToChar(p),this.decodeRowResult+=l,c=f;try{for(var g=(o=void 0,qn(u)),m=g.next();!m.done;m=g.next())f+=m.value}catch(S){o={error:S}}finally{try{m&&!m.done&&(i=g.return)&&i.call(g)}finally{if(o)throw o.error}}f=r.getNextSet(f)}while("*"!==l);this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);var v,y=0;try{for(var _=qn(u),w=_.next();!w.done;w=_.next())y+=w.value}catch(S){a={error:S}}finally{try{w&&!w.done&&(s=_.return)&&s.call(_)}finally{if(a)throw a.error}}if(f!==d&&2*(f-c-y)<y)throw new Kr;if(this.usingCheckDigit){for(var b=this.decodeRowResult.length-1,C=0,A=0;A<b;A++)C+=e.ALPHABET_STRING.indexOf(this.decodeRowResult.charAt(A));if(this.decodeRowResult.charAt(b)!==e.ALPHABET_STRING.charAt(C%43))throw new xr;this.decodeRowResult=this.decodeRowResult.substring(0,b)}if(0===this.decodeRowResult.length)throw new Kr;v=this.extendedMode?e.decodeExtended(this.decodeRowResult):this.decodeRowResult;var E=(h[1]+h[0])/2,I=c+y/2;return new hn(v,null,0,[new kn(E,t),new kn(I,t)],dn.CODE_39,(new Date).getTime())},e.findAsteriskPattern=function(t,r){for(var n=t.getSize(),o=t.getNextSet(0),i=0,a=o,s=!1,u=r.length,l=o;l<n;l++)if(t.get(l)!==s)r[i]++;else{if(i===u-1){if(this.toNarrowWidePattern(r)===e.ASTERISK_ENCODING&&t.isRange(Math.max(0,a-Math.floor((l-a)/2)),a,!1))return[a,l];a+=r[0]+r[1],r.copyWithin(0,2,2+i-1),r[i-1]=0,r[i]=0,i--}else i++;r[i]=1,s=!s}throw new Kr},e.toNarrowWidePattern=function(t){var e,r,n,o=t.length,i=0;do{var a=2147483647;try{for(var s=(e=void 0,qn(t)),u=s.next();!u.done;u=s.next())(f=u.value)<a&&f>i&&(a=f)}catch(d){e={error:d}}finally{try{u&&!u.done&&(r=s.return)&&r.call(s)}finally{if(e)throw e.error}}i=a,n=0;for(var l=0,c=0,h=0;h<o;h++)(f=t[h])>i&&(c|=1<<o-1-h,n++,l+=f);if(3===n){for(h=0;h<o&&n>0;h++){var f;if((f=t[h])>i&&(n--,2*f>=l))return-1}return c}}while(n>3);return-1},e.patternToChar=function(t){for(var r=0;r<e.CHARACTER_ENCODINGS.length;r++)if(e.CHARACTER_ENCODINGS[r]===t)return e.ALPHABET_STRING.charAt(r);if(t===e.ASTERISK_ENCODING)return"*";throw new Kr},e.decodeExtended=function(t){for(var e=t.length,r="",n=0;n<e;n++){var o=t.charAt(n);if("+"===o||"$"===o||"%"===o||"/"===o){var i=t.charAt(n+1),a="\0";switch(o){case"+":if(!(i>="A"&&i<="Z"))throw new Vr;a=String.fromCharCode(i.charCodeAt(0)+32);break;case"$":if(!(i>="A"&&i<="Z"))throw new Vr;a=String.fromCharCode(i.charCodeAt(0)-64);break;case"%":if(i>="A"&&i<="E")a=String.fromCharCode(i.charCodeAt(0)-38);else if(i>="F"&&i<="J")a=String.fromCharCode(i.charCodeAt(0)-11);else if(i>="K"&&i<="O")a=String.fromCharCode(i.charCodeAt(0)+16);else if(i>="P"&&i<="T")a=String.fromCharCode(i.charCodeAt(0)+43);else if("U"===i)a="\0";else if("V"===i)a="@";else if("W"===i)a="`";else{if("X"!==i&&"Y"!==i&&"Z"!==i)throw new Vr;a=""}break;case"/":if(i>="A"&&i<="O")a=String.fromCharCode(i.charCodeAt(0)-32);else{if("Z"!==i)throw new Vr;a=":"}}r+=a,n++}else r+=o}return r},e.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%",e.CHARACTER_ENCODINGS=[52,289,97,352,49,304,112,37,292,100,265,73,328,25,280,88,13,268,76,28,259,67,322,19,274,82,7,262,70,22,385,193,448,145,400,208,133,388,196,168,162,138,42],e.ASTERISK_ENCODING=148,e}(Gn),Zn=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Qn=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.narrowLineWidth=-1,e}return Zn(e,t),e.prototype.decodeRow=function(t,r,n){var o,i,a=this.decodeStart(r),s=this.decodeEnd(r),u=new $r;e.decodeMiddle(r,a[1],s[0],u);var l=u.toString(),c=null;null!=n&&(c=n.get(Fr.ALLOWED_LENGTHS)),null==c&&(c=e.DEFAULT_ALLOWED_LENGTHS);var h=l.length,f=!1,d=0;try{for(var p=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(c),g=p.next();!g.done;g=p.next()){var m=g.value;if(h===m){f=!0;break}m>d&&(d=m)}}catch(y){o={error:y}}finally{try{g&&!g.done&&(i=p.return)&&i.call(p)}finally{if(o)throw o.error}}if(!f&&h>d&&(f=!0),!f)throw new Vr;var v=[new kn(a[1],t),new kn(s[0],t)];return new hn(l,null,0,v,dn.ITF,(new Date).getTime())},e.decodeMiddle=function(t,r,n,o){var i=new Int32Array(10),a=new Int32Array(5),s=new Int32Array(5);for(i.fill(0),a.fill(0),s.fill(0);r<n;){Gn.recordPattern(t,r,i);for(var u=0;u<5;u++){var l=2*u;a[u]=i[l],s[u]=i[l+1]}var c=e.decodeDigit(a);o.append(c.toString()),c=this.decodeDigit(s),o.append(c.toString()),i.forEach(function(t){r+=t})}},e.prototype.decodeStart=function(t){var r=e.skipWhiteSpace(t),n=e.findGuardPattern(t,r,e.START_PATTERN);return this.narrowLineWidth=(n[1]-n[0])/4,this.validateQuietZone(t,n[0]),n},e.prototype.validateQuietZone=function(t,e){var r=10*this.narrowLineWidth;r=r<e?r:e;for(var n=e-1;r>0&&n>=0&&!t.get(n);n--)r--;if(0!==r)throw new Kr},e.skipWhiteSpace=function(t){var e=t.getSize(),r=t.getNextSet(0);if(r===e)throw new Kr;return r},e.prototype.decodeEnd=function(t){t.reverse();try{var r=e.skipWhiteSpace(t),n=void 0;try{n=e.findGuardPattern(t,r,e.END_PATTERN_REVERSED[0])}catch(i){i instanceof Kr&&(n=e.findGuardPattern(t,r,e.END_PATTERN_REVERSED[1]))}this.validateQuietZone(t,n[0]);var o=n[0];return n[0]=t.getSize()-n[1],n[1]=t.getSize()-o,n}finally{t.reverse()}},e.findGuardPattern=function(t,r,n){var o=n.length,i=new Int32Array(o),a=t.getSize(),s=!1,u=0,l=r;i.fill(0);for(var c=r;c<a;c++)if(t.get(c)!==s)i[u]++;else{if(u===o-1){if(Gn.patternMatchVariance(i,n,e.MAX_INDIVIDUAL_VARIANCE)<e.MAX_AVG_VARIANCE)return[l,c];l+=i[0]+i[1],Tr.arraycopy(i,2,i,0,u-1),i[u-1]=0,i[u]=0,u--}else u++;i[u]=1,s=!s}throw new Kr},e.decodeDigit=function(t){for(var r=e.MAX_AVG_VARIANCE,n=-1,o=e.PATTERNS.length,i=0;i<o;i++){var a=e.PATTERNS[i],s=Gn.patternMatchVariance(t,a,e.MAX_INDIVIDUAL_VARIANCE);s<r?(r=s,n=i):s===r&&(n=-1)}if(n>=0)return n%10;throw new Kr},e.PATTERNS=[Int32Array.from([1,1,2,2,1]),Int32Array.from([2,1,1,1,2]),Int32Array.from([1,2,1,1,2]),Int32Array.from([2,2,1,1,1]),Int32Array.from([1,1,2,1,2]),Int32Array.from([2,1,2,1,1]),Int32Array.from([1,2,2,1,1]),Int32Array.from([1,1,1,2,2]),Int32Array.from([2,1,1,2,1]),Int32Array.from([1,2,1,2,1]),Int32Array.from([1,1,3,3,1]),Int32Array.from([3,1,1,1,3]),Int32Array.from([1,3,1,1,3]),Int32Array.from([3,3,1,1,1]),Int32Array.from([1,1,3,1,3]),Int32Array.from([3,1,3,1,1]),Int32Array.from([1,3,3,1,1]),Int32Array.from([1,1,1,3,3]),Int32Array.from([3,1,1,3,1]),Int32Array.from([1,3,1,3,1])],e.MAX_AVG_VARIANCE=.38,e.MAX_INDIVIDUAL_VARIANCE=.5,e.DEFAULT_ALLOWED_LENGTHS=[6,8,10,12,14],e.START_PATTERN=Int32Array.from([1,1,1,1]),e.END_PATTERN_REVERSED=[Int32Array.from([1,1,2]),Int32Array.from([1,1,3])],e}(Gn),Jn=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),to=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.decodeRowStringBuffer="",e}return Jn(e,t),e.findStartGuardPattern=function(t){for(var r,n=!1,o=0,i=Int32Array.from([0,0,0]);!n;){i=Int32Array.from([0,0,0]);var a=(r=e.findGuardPattern(t,o,!1,this.START_END_PATTERN,i))[0],s=a-((o=r[1])-a);s>=0&&(n=t.isRange(s,a,!1))}return r},e.checkChecksum=function(t){return e.checkStandardUPCEANChecksum(t)},e.checkStandardUPCEANChecksum=function(t){var r=t.length;if(0===r)return!1;var n=parseInt(t.charAt(r-1),10);return e.getStandardUPCEANChecksum(t.substring(0,r-1))===n},e.getStandardUPCEANChecksum=function(t){for(var e=t.length,r=0,n=e-1;n>=0;n-=2){if((o=t.charAt(n).charCodeAt(0)-"0".charCodeAt(0))<0||o>9)throw new Vr;r+=o}for(r*=3,n=e-2;n>=0;n-=2){var o;if((o=t.charAt(n).charCodeAt(0)-"0".charCodeAt(0))<0||o>9)throw new Vr;r+=o}return(1e3-r)%10},e.decodeEnd=function(t,r){return e.findGuardPattern(t,r,!1,e.START_END_PATTERN,new Int32Array(e.START_END_PATTERN.length).fill(0))},e.findGuardPatternWithoutCounters=function(t,e,r,n){return this.findGuardPattern(t,e,r,n,new Int32Array(n.length))},e.findGuardPattern=function(t,r,n,o,i){for(var a=t.getSize(),s=0,u=r=n?t.getNextUnset(r):t.getNextSet(r),l=o.length,c=n,h=r;h<a;h++)if(t.get(h)!==c)i[s]++;else{if(s===l-1){if(Gn.patternMatchVariance(i,o,e.MAX_INDIVIDUAL_VARIANCE)<e.MAX_AVG_VARIANCE)return Int32Array.from([u,h]);u+=i[0]+i[1];for(var f=i.slice(2,i.length-1),d=0;d<s-1;d++)i[d]=f[d];i[s-1]=0,i[s]=0,s--}else s++;i[s]=1,c=!c}throw new Kr},e.decodeDigit=function(t,r,n,o){this.recordPattern(t,n,r);for(var i=this.MAX_AVG_VARIANCE,a=-1,s=o.length,u=0;u<s;u++){var l=o[u],c=Gn.patternMatchVariance(r,l,e.MAX_INDIVIDUAL_VARIANCE);c<i&&(i=c,a=u)}if(a>=0)return a;throw new Kr},e.MAX_AVG_VARIANCE=.48,e.MAX_INDIVIDUAL_VARIANCE=.7,e.START_END_PATTERN=Int32Array.from([1,1,1]),e.MIDDLE_PATTERN=Int32Array.from([1,1,1,1,1]),e.END_PATTERN=Int32Array.from([1,1,1,1,1,1]),e.L_PATTERNS=[Int32Array.from([3,2,1,1]),Int32Array.from([2,2,2,1]),Int32Array.from([2,1,2,2]),Int32Array.from([1,4,1,1]),Int32Array.from([1,1,3,2]),Int32Array.from([1,2,3,1]),Int32Array.from([1,1,1,4]),Int32Array.from([1,3,1,2]),Int32Array.from([1,2,1,3]),Int32Array.from([3,1,1,2])],e}(Gn),eo=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},ro=function(){function t(){this.CHECK_DIGIT_ENCODINGS=[24,20,18,17,12,6,3,10,9,5],this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}return t.prototype.decodeRow=function(e,r,n){var o=this.decodeRowStringBuffer,i=this.decodeMiddle(r,n,o),a=o.toString(),s=t.parseExtensionString(a),u=[new kn((n[0]+n[1])/2,e),new kn(i,e)],l=new hn(a,null,0,u,dn.UPC_EAN_EXTENSION,(new Date).getTime());return null!=s&&l.putAllMetadata(s),l},t.prototype.decodeMiddle=function(e,r,n){var o,i,a=this.decodeMiddleCounters;a[0]=0,a[1]=0,a[2]=0,a[3]=0;for(var s=e.getSize(),u=r[1],l=0,c=0;c<5&&u<s;c++){var h=to.decodeDigit(e,a,u,to.L_AND_G_PATTERNS);n+=String.fromCharCode("0".charCodeAt(0)+h%10);try{for(var f=(o=void 0,eo(a)),d=f.next();!d.done;d=f.next())u+=d.value}catch(g){o={error:g}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}h>=10&&(l|=1<<4-c),4!==c&&(u=e.getNextSet(u),u=e.getNextUnset(u))}if(5!==n.length)throw new Kr;var p=this.determineCheckDigit(l);if(t.extensionChecksum(n.toString())!==p)throw new Kr;return u},t.extensionChecksum=function(t){for(var e=t.length,r=0,n=e-2;n>=0;n-=2)r+=t.charAt(n).charCodeAt(0)-"0".charCodeAt(0);for(r*=3,n=e-1;n>=0;n-=2)r+=t.charAt(n).charCodeAt(0)-"0".charCodeAt(0);return(r*=3)%10},t.prototype.determineCheckDigit=function(t){for(var e=0;e<10;e++)if(t===this.CHECK_DIGIT_ENCODINGS[e])return e;throw new Kr},t.parseExtensionString=function(e){if(5!==e.length)return null;var r=t.parseExtension5String(e);return null==r?null:new Map([[gn.SUGGESTED_PRICE,r]])},t.parseExtension5String=function(t){var e;switch(t.charAt(0)){case"0":e="£";break;case"5":e="$";break;case"9":switch(t){case"90000":return null;case"99991":return"0.00";case"99990":return"Used"}e="";break;default:e=""}var r=parseInt(t.substring(1)),n=r%100;return e+(r/100).toString()+"."+(n<10?"0"+n:n.toString())},t}(),no=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},oo=function(){function t(){this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}return t.prototype.decodeRow=function(e,r,n){var o=this.decodeRowStringBuffer,i=this.decodeMiddle(r,n,o),a=o.toString(),s=t.parseExtensionString(a),u=[new kn((n[0]+n[1])/2,e),new kn(i,e)],l=new hn(a,null,0,u,dn.UPC_EAN_EXTENSION,(new Date).getTime());return null!=s&&l.putAllMetadata(s),l},t.prototype.decodeMiddle=function(t,e,r){var n,o,i=this.decodeMiddleCounters;i[0]=0,i[1]=0,i[2]=0,i[3]=0;for(var a=t.getSize(),s=e[1],u=0,l=0;l<2&&s<a;l++){var c=to.decodeDigit(t,i,s,to.L_AND_G_PATTERNS);r+=String.fromCharCode("0".charCodeAt(0)+c%10);try{for(var h=(n=void 0,no(i)),f=h.next();!f.done;f=h.next())s+=f.value}catch(d){n={error:d}}finally{try{f&&!f.done&&(o=h.return)&&o.call(h)}finally{if(n)throw n.error}}c>=10&&(u|=1<<1-l),1!==l&&(s=t.getNextSet(s),s=t.getNextUnset(s))}if(2!==r.length)throw new Kr;if(parseInt(r.toString())%4!==u)throw new Kr;return s},t.parseExtensionString=function(t){return 2!==t.length?null:new Map([[gn.ISSUE_NUMBER,parseInt(t)]])},t}(),io=function(){function t(){}return t.decodeRow=function(t,e,r){var n=to.findGuardPattern(e,r,!1,this.EXTENSION_START_PATTERN,new Int32Array(this.EXTENSION_START_PATTERN.length).fill(0));try{return(new ro).decodeRow(t,e,n)}catch(o){return(new oo).decodeRow(t,e,n)}},t.EXTENSION_START_PATTERN=Int32Array.from([1,1,2]),t}(),ao=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),so=function(t){function e(){var r=t.call(this)||this;r.decodeRowStringBuffer="",e.L_AND_G_PATTERNS=e.L_PATTERNS.map(function(t){return Int32Array.from(t)});for(var n=10;n<20;n++){for(var o=e.L_PATTERNS[n-10],i=new Int32Array(o.length),a=0;a<o.length;a++)i[a]=o[o.length-a-1];e.L_AND_G_PATTERNS[n]=i}return r}return ao(e,t),e.prototype.decodeRow=function(t,r,n){var o=e.findStartGuardPattern(r),i=null==n?null:n.get(Fr.NEED_RESULT_POINT_CALLBACK);if(null!=i){var a=new kn((o[0]+o[1])/2,t);i.foundPossibleResultPoint(a)}var s=this.decodeMiddle(r,o,this.decodeRowStringBuffer),u=s.rowOffset,l=s.resultString;if(null!=i){var c=new kn(u,t);i.foundPossibleResultPoint(c)}var h=e.decodeEnd(r,u);if(null!=i){var f=new kn((h[0]+h[1])/2,t);i.foundPossibleResultPoint(f)}var d=h[1],p=d+(d-h[0]);if(p>=r.getSize()||!r.isRange(d,p,!1))throw new Kr;var g=l.toString();if(g.length<8)throw new Vr;if(!e.checkChecksum(g))throw new xr;var m=(o[1]+o[0])/2,v=(h[1]+h[0])/2,y=this.getBarcodeFormat(),_=[new kn(m,t),new kn(v,t)],w=new hn(g,null,0,_,y,(new Date).getTime()),b=0;try{var C=io.decodeRow(t,r,h[1]);w.putMetadata(gn.UPC_EAN_EXTENSION,C.getText()),w.putAllMetadata(C.getResultMetadata()),w.addResultPoints(C.getResultPoints()),b=C.getText().length}catch(S){}var A=null==n?null:n.get(Fr.ALLOWED_EAN_EXTENSIONS);if(null!=A){var E=!1;for(var I in A)if(b.toString()===I){E=!0;break}if(!E)throw new Kr}return y===dn.EAN_13||dn.UPC_A,w},e.checkChecksum=function(t){return e.checkStandardUPCEANChecksum(t)},e.checkStandardUPCEANChecksum=function(t){var r=t.length;if(0===r)return!1;var n=parseInt(t.charAt(r-1),10);return e.getStandardUPCEANChecksum(t.substring(0,r-1))===n},e.getStandardUPCEANChecksum=function(t){for(var e=t.length,r=0,n=e-1;n>=0;n-=2){if((o=t.charAt(n).charCodeAt(0)-"0".charCodeAt(0))<0||o>9)throw new Vr;r+=o}for(r*=3,n=e-2;n>=0;n-=2){var o;if((o=t.charAt(n).charCodeAt(0)-"0".charCodeAt(0))<0||o>9)throw new Vr;r+=o}return(1e3-r)%10},e.decodeEnd=function(t,r){return e.findGuardPattern(t,r,!1,e.START_END_PATTERN,new Int32Array(e.START_END_PATTERN.length).fill(0))},e}(to),uo=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),lo=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},co=function(t){function e(){var e=t.call(this)||this;return e.decodeMiddleCounters=Int32Array.from([0,0,0,0]),e}return uo(e,t),e.prototype.decodeMiddle=function(t,r,n){var o,i,a,s,u=this.decodeMiddleCounters;u[0]=0,u[1]=0,u[2]=0,u[3]=0;for(var l=t.getSize(),c=r[1],h=0,f=0;f<6&&c<l;f++){var d=so.decodeDigit(t,u,c,so.L_AND_G_PATTERNS);n+=String.fromCharCode("0".charCodeAt(0)+d%10);try{for(var p=(o=void 0,lo(u)),g=p.next();!g.done;g=p.next())c+=g.value}catch(y){o={error:y}}finally{try{g&&!g.done&&(i=p.return)&&i.call(p)}finally{if(o)throw o.error}}d>=10&&(h|=1<<5-f)}for(n=e.determineFirstDigit(n,h),c=so.findGuardPattern(t,c,!0,so.MIDDLE_PATTERN,new Int32Array(so.MIDDLE_PATTERN.length).fill(0))[1],f=0;f<6&&c<l;f++){d=so.decodeDigit(t,u,c,so.L_PATTERNS),n+=String.fromCharCode("0".charCodeAt(0)+d);try{for(var m=(a=void 0,lo(u)),v=m.next();!v.done;v=m.next())c+=v.value}catch(y){a={error:y}}finally{try{v&&!v.done&&(s=m.return)&&s.call(m)}finally{if(a)throw a.error}}}return{rowOffset:c,resultString:n}},e.prototype.getBarcodeFormat=function(){return dn.EAN_13},e.determineFirstDigit=function(t,e){for(var r=0;r<10;r++)if(e===this.FIRST_DIGIT_ENCODINGS[r])return String.fromCharCode("0".charCodeAt(0)+r)+t;throw new Kr},e.FIRST_DIGIT_ENCODINGS=[0,11,13,14,19,25,28,21,22,26],e}(so),ho=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),fo=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},po=function(t){function e(){var e=t.call(this)||this;return e.decodeMiddleCounters=Int32Array.from([0,0,0,0]),e}return ho(e,t),e.prototype.decodeMiddle=function(t,e,r){var n,o,i,a,s=this.decodeMiddleCounters;s[0]=0,s[1]=0,s[2]=0,s[3]=0;for(var u=t.getSize(),l=e[1],c=0;c<4&&l<u;c++){var h=so.decodeDigit(t,s,l,so.L_PATTERNS);r+=String.fromCharCode("0".charCodeAt(0)+h);try{for(var f=(n=void 0,fo(s)),d=f.next();!d.done;d=f.next())l+=d.value}catch(m){n={error:m}}finally{try{d&&!d.done&&(o=f.return)&&o.call(f)}finally{if(n)throw n.error}}}for(l=so.findGuardPattern(t,l,!0,so.MIDDLE_PATTERN,new Int32Array(so.MIDDLE_PATTERN.length).fill(0))[1],c=0;c<4&&l<u;c++){h=so.decodeDigit(t,s,l,so.L_PATTERNS),r+=String.fromCharCode("0".charCodeAt(0)+h);try{for(var p=(i=void 0,fo(s)),g=p.next();!g.done;g=p.next())l+=g.value}catch(m){i={error:m}}finally{try{g&&!g.done&&(a=p.return)&&a.call(p)}finally{if(i)throw i.error}}}return{rowOffset:l,resultString:r}},e.prototype.getBarcodeFormat=function(){return dn.EAN_8},e}(so),go=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),mo=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.ean13Reader=new co,e}return go(e,t),e.prototype.getBarcodeFormat=function(){return dn.UPC_A},e.prototype.decode=function(t,e){return this.maybeReturnResult(this.ean13Reader.decode(t))},e.prototype.decodeRow=function(t,e,r){return this.maybeReturnResult(this.ean13Reader.decodeRow(t,e,r))},e.prototype.decodeMiddle=function(t,e,r){return this.ean13Reader.decodeMiddle(t,e,r)},e.prototype.maybeReturnResult=function(t){var e=t.getText();if("0"===e.charAt(0)){var r=new hn(e.substring(1),null,null,t.getResultPoints(),dn.UPC_A);return null!=t.getResultMetadata()&&r.putAllMetadata(t.getResultMetadata()),r}throw new Kr},e.prototype.reset=function(){this.ean13Reader.reset()},e}(so),vo=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),yo=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},_o=function(t){function e(){var e=t.call(this)||this;return e.decodeMiddleCounters=new Int32Array(4),e}return vo(e,t),e.prototype.decodeMiddle=function(t,r,n){var o,i,a=this.decodeMiddleCounters.map(function(t){return t});a[0]=0,a[1]=0,a[2]=0,a[3]=0;for(var s=t.getSize(),u=r[1],l=0,c=0;c<6&&u<s;c++){var h=e.decodeDigit(t,a,u,e.L_AND_G_PATTERNS);n+=String.fromCharCode("0".charCodeAt(0)+h%10);try{for(var f=(o=void 0,yo(a)),d=f.next();!d.done;d=f.next())u+=d.value}catch(p){o={error:p}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}h>=10&&(l|=1<<5-c)}return e.determineNumSysAndCheckDigit(new $r(n),l),u},e.prototype.decodeEnd=function(t,r){return e.findGuardPatternWithoutCounters(t,r,!0,e.MIDDLE_END_PATTERN)},e.prototype.checkChecksum=function(t){return so.checkChecksum(e.convertUPCEtoUPCA(t))},e.determineNumSysAndCheckDigit=function(t,e){for(var r=0;r<=1;r++)for(var n=0;n<10;n++)if(e===this.NUMSYS_AND_CHECK_DIGIT_PATTERNS[r][n])return t.insert(0,"0"+r),void t.append("0"+n);throw Kr.getNotFoundInstance()},e.prototype.getBarcodeFormat=function(){return dn.UPC_E},e.convertUPCEtoUPCA=function(t){var e=t.slice(1,7).split("").map(function(t){return t.charCodeAt(0)}),r=new $r;r.append(t.charAt(0));var n=e[5];switch(n){case 0:case 1:case 2:r.appendChars(e,0,2),r.append(n),r.append("0000"),r.appendChars(e,2,3);break;case 3:r.appendChars(e,0,3),r.append("00000"),r.appendChars(e,3,2);break;case 4:r.appendChars(e,0,4),r.append("00000"),r.append(e[4]);break;default:r.appendChars(e,0,5),r.append("0000"),r.append(n)}return t.length>=8&&r.append(t.charAt(7)),r.toString()},e.MIDDLE_END_PATTERN=Int32Array.from([1,1,1,1,1,1]),e.NUMSYS_AND_CHECK_DIGIT_PATTERNS=[Int32Array.from([56,52,50,49,44,38,35,42,41,37]),Int32Array.from([7,11,13,14,19,25,28,21,22,1])],e}(so),wo=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),bo=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Co=function(t){function e(e){var r=t.call(this)||this,n=null==e?null:e.get(Fr.POSSIBLE_FORMATS),o=[];return null!=n&&(n.indexOf(dn.EAN_13)>-1?o.push(new co):n.indexOf(dn.UPC_A)>-1&&o.push(new mo),n.indexOf(dn.EAN_8)>-1&&o.push(new po),n.indexOf(dn.UPC_E)>-1&&o.push(new _o)),0===o.length&&(o.push(new co),o.push(new po),o.push(new _o)),r.readers=o,r}return wo(e,t),e.prototype.decodeRow=function(t,e,r){var n,o;try{for(var i=bo(this.readers),a=i.next();!a.done;a=i.next()){var s=a.value;try{var u=s.decodeRow(t,e,r),l=u.getBarcodeFormat()===dn.EAN_13&&"0"===u.getText().charAt(0),c=null==r?null:r.get(Fr.POSSIBLE_FORMATS),h=null==c||c.includes(dn.UPC_A);if(l&&h){var f=u.getRawBytes(),d=new hn(u.getText().substring(1),f,f.length,u.getResultPoints(),dn.UPC_A);return d.putAllMetadata(u.getResultMetadata()),d}return u}catch(p){}}}catch(p){n={error:p}}finally{try{a&&!a.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}throw new Kr},e.prototype.reset=function(){var t,e;try{for(var r=bo(this.readers),n=r.next();!n.done;n=r.next())n.value.reset()}catch(o){t={error:o}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}},e}(Gn),Ao=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Eo=function(t){function e(){var e=t.call(this)||this;return e.decodeFinderCounters=new Int32Array(4),e.dataCharacterCounters=new Int32Array(8),e.oddRoundingErrors=new Array(4),e.evenRoundingErrors=new Array(4),e.oddCounts=new Array(e.dataCharacterCounters.length/2),e.evenCounts=new Array(e.dataCharacterCounters.length/2),e}return Ao(e,t),e.prototype.getDecodeFinderCounters=function(){return this.decodeFinderCounters},e.prototype.getDataCharacterCounters=function(){return this.dataCharacterCounters},e.prototype.getOddRoundingErrors=function(){return this.oddRoundingErrors},e.prototype.getEvenRoundingErrors=function(){return this.evenRoundingErrors},e.prototype.getOddCounts=function(){return this.oddCounts},e.prototype.getEvenCounts=function(){return this.evenCounts},e.prototype.parseFinderValue=function(t,r){for(var n=0;n<r.length;n++)if(Gn.patternMatchVariance(t,r[n],e.MAX_INDIVIDUAL_VARIANCE)<e.MAX_AVG_VARIANCE)return n;throw new Kr},e.count=function(t){return Tn.sum(new Int32Array(t))},e.increment=function(t,e){for(var r=0,n=e[0],o=1;o<t.length;o++)e[o]>n&&(n=e[o],r=o);t[r]++},e.decrement=function(t,e){for(var r=0,n=e[0],o=1;o<t.length;o++)e[o]<n&&(n=e[o],r=o);t[r]--},e.isFinderPattern=function(t){var r,n,o=t[0]+t[1],i=o/(o+t[2]+t[3]);if(i>=e.MIN_FINDER_PATTERN_RATIO&&i<=e.MAX_FINDER_PATTERN_RATIO){var a=Number.MAX_SAFE_INTEGER,s=Number.MIN_SAFE_INTEGER;try{for(var u=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(t),l=u.next();!l.done;l=u.next()){var c=l.value;c>s&&(s=c),c<a&&(a=c)}}catch(h){r={error:h}}finally{try{l&&!l.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}return s<10*a}return!1},e.MAX_AVG_VARIANCE=.2,e.MAX_INDIVIDUAL_VARIANCE=.45,e.MIN_FINDER_PATTERN_RATIO=9.5/12,e.MAX_FINDER_PATTERN_RATIO=12.5/14,e}(Gn),Io=function(){function t(t,e){this.value=t,this.checksumPortion=e}return t.prototype.getValue=function(){return this.value},t.prototype.getChecksumPortion=function(){return this.checksumPortion},t.prototype.toString=function(){return this.value+"("+this.checksumPortion+")"},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var r=e;return this.value===r.value&&this.checksumPortion===r.checksumPortion},t.prototype.hashCode=function(){return this.value^this.checksumPortion},t}(),So=function(){function t(t,e,r,n,o){this.value=t,this.startEnd=e,this.value=t,this.startEnd=e,this.resultPoints=new Array,this.resultPoints.push(new kn(r,o)),this.resultPoints.push(new kn(n,o))}return t.prototype.getValue=function(){return this.value},t.prototype.getStartEnd=function(){return this.startEnd},t.prototype.getResultPoints=function(){return this.resultPoints},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var r=e;return this.value===r.value},t.prototype.hashCode=function(){return this.value},t}(),xo=function(){function t(){}return t.getRSSvalue=function(e,r,n){var o,i,a=0;try{for(var s=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(e),u=s.next();!u.done;u=s.next())a+=u.value}catch(v){o={error:v}}finally{try{u&&!u.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}for(var l=0,c=0,h=e.length,f=0;f<h-1;f++){var d=void 0;for(d=1,c|=1<<f;d<e[f];d++,c&=~(1<<f)){var p=t.combins(a-d-1,h-f-2);if(n&&0===c&&a-d-(h-f-1)>=h-f-1&&(p-=t.combins(a-d-(h-f),h-f-2)),h-f-1>1){for(var g=0,m=a-d-(h-f-2);m>r;m--)g+=t.combins(a-d-m-1,h-f-3);p-=g*(h-1-f)}else a-d>r&&p--;l+=p}a-=d}return l},t.combins=function(t,e){var r,n;t-e>e?(n=e,r=t-e):(n=t-e,r=e);for(var o=1,i=1,a=t;a>r;a--)o*=a,i<=n&&(o/=i,i++);for(;i<=n;)o/=i,i++;return o},t}(),Oo=function(){function t(){}return t.buildBitArray=function(t){var e=2*t.length-1;null==t[t.length-1].getRightChar()&&(e-=1);for(var r=new Br(12*e),n=0,o=t[0].getRightChar().getValue(),i=11;i>=0;--i)!!(o&1<<i)&&r.set(n),n++;for(i=1;i<t.length;++i){for(var a=t[i],s=a.getLeftChar().getValue(),u=11;u>=0;--u)!!(s&1<<u)&&r.set(n),n++;if(null!=a.getRightChar()){var l=a.getRightChar().getValue();for(u=11;u>=0;--u)!!(l&1<<u)&&r.set(n),n++}}return r},t}(),To=function(){function t(t,e){e?this.decodedInformation=null:(this.finished=t,this.decodedInformation=e)}return t.prototype.getDecodedInformation=function(){return this.decodedInformation},t.prototype.isFinished=function(){return this.finished},t}(),No=function(){function t(t){this.newPosition=t}return t.prototype.getNewPosition=function(){return this.newPosition},t}(),ko=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ro=function(t){function e(e,r){var n=t.call(this,e)||this;return n.value=r,n}return ko(e,t),e.prototype.getValue=function(){return this.value},e.prototype.isFNC1=function(){return this.value===e.FNC1},e.FNC1="$",e}(No),Do=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Po=function(t){function e(e,r,n){var o=t.call(this,e)||this;return n?(o.remaining=!0,o.remainingValue=o.remainingValue):(o.remaining=!1,o.remainingValue=0),o.newString=r,o}return Do(e,t),e.prototype.getNewString=function(){return this.newString},e.prototype.isRemaining=function(){return this.remaining},e.prototype.getRemainingValue=function(){return this.remainingValue},e}(No),Mo=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Bo=function(t){function e(e,r,n){var o=t.call(this,e)||this;if(r<0||r>10||n<0||n>10)throw new Vr;return o.firstDigit=r,o.secondDigit=n,o}return Mo(e,t),e.prototype.getFirstDigit=function(){return this.firstDigit},e.prototype.getSecondDigit=function(){return this.secondDigit},e.prototype.getValue=function(){return 10*this.firstDigit+this.secondDigit},e.prototype.isFirstDigitFNC1=function(){return this.firstDigit===e.FNC1},e.prototype.isSecondDigitFNC1=function(){return this.secondDigit===e.FNC1},e.prototype.isAnyFNC1=function(){return this.firstDigit===e.FNC1||this.secondDigit===e.FNC1},e.FNC1=10,e}(No),Lo=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Fo=function(){function t(){}return t.parseFieldsInGeneralPurpose=function(e){var r,n,o,i,a,s,u,l;if(!e)return null;if(e.length<2)throw new Kr;var c=e.substring(0,2);try{for(var h=Lo(t.TWO_DIGIT_DATA_LENGTH),f=h.next();!f.done;f=h.next())if((b=f.value)[0]===c)return b[1]===t.VARIABLE_LENGTH?t.processVariableAI(2,b[2],e):t.processFixedAI(2,b[1],e)}catch(C){r={error:C}}finally{try{f&&!f.done&&(n=h.return)&&n.call(h)}finally{if(r)throw r.error}}if(e.length<3)throw new Kr;var d=e.substring(0,3);try{for(var p=Lo(t.THREE_DIGIT_DATA_LENGTH),g=p.next();!g.done;g=p.next())if((b=g.value)[0]===d)return b[1]===t.VARIABLE_LENGTH?t.processVariableAI(3,b[2],e):t.processFixedAI(3,b[1],e)}catch(C){o={error:C}}finally{try{g&&!g.done&&(i=p.return)&&i.call(p)}finally{if(o)throw o.error}}try{for(var m=Lo(t.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH),v=m.next();!v.done;v=m.next())if((b=v.value)[0]===d)return b[1]===t.VARIABLE_LENGTH?t.processVariableAI(4,b[2],e):t.processFixedAI(4,b[1],e)}catch(C){a={error:C}}finally{try{v&&!v.done&&(s=m.return)&&s.call(m)}finally{if(a)throw a.error}}if(e.length<4)throw new Kr;var y=e.substring(0,4);try{for(var _=Lo(t.FOUR_DIGIT_DATA_LENGTH),w=_.next();!w.done;w=_.next()){var b;if((b=w.value)[0]===y)return b[1]===t.VARIABLE_LENGTH?t.processVariableAI(4,b[2],e):t.processFixedAI(4,b[1],e)}}catch(C){u={error:C}}finally{try{w&&!w.done&&(l=_.return)&&l.call(_)}finally{if(u)throw u.error}}throw new Kr},t.processFixedAI=function(e,r,n){if(n.length<e)throw new Kr;var o=n.substring(0,e);if(n.length<e+r)throw new Kr;var i=n.substring(e,e+r),a=n.substring(e+r),s="("+o+")"+i,u=t.parseFieldsInGeneralPurpose(a);return null==u?s:s+u},t.processVariableAI=function(e,r,n){var o,i=n.substring(0,e);o=n.length<e+r?n.length:e+r;var a=n.substring(e,o),s=n.substring(o),u="("+i+")"+a,l=t.parseFieldsInGeneralPurpose(s);return null==l?u:u+l},t.VARIABLE_LENGTH=[],t.TWO_DIGIT_DATA_LENGTH=[["00",18],["01",14],["02",14],["10",t.VARIABLE_LENGTH,20],["11",6],["12",6],["13",6],["15",6],["17",6],["20",2],["21",t.VARIABLE_LENGTH,20],["22",t.VARIABLE_LENGTH,29],["30",t.VARIABLE_LENGTH,8],["37",t.VARIABLE_LENGTH,8],["90",t.VARIABLE_LENGTH,30],["91",t.VARIABLE_LENGTH,30],["92",t.VARIABLE_LENGTH,30],["93",t.VARIABLE_LENGTH,30],["94",t.VARIABLE_LENGTH,30],["95",t.VARIABLE_LENGTH,30],["96",t.VARIABLE_LENGTH,30],["97",t.VARIABLE_LENGTH,3],["98",t.VARIABLE_LENGTH,30],["99",t.VARIABLE_LENGTH,30]],t.THREE_DIGIT_DATA_LENGTH=[["240",t.VARIABLE_LENGTH,30],["241",t.VARIABLE_LENGTH,30],["242",t.VARIABLE_LENGTH,6],["250",t.VARIABLE_LENGTH,30],["251",t.VARIABLE_LENGTH,30],["253",t.VARIABLE_LENGTH,17],["254",t.VARIABLE_LENGTH,20],["400",t.VARIABLE_LENGTH,30],["401",t.VARIABLE_LENGTH,30],["402",17],["403",t.VARIABLE_LENGTH,30],["410",13],["411",13],["412",13],["413",13],["414",13],["420",t.VARIABLE_LENGTH,20],["421",t.VARIABLE_LENGTH,15],["422",3],["423",t.VARIABLE_LENGTH,15],["424",3],["425",3],["426",3]],t.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH=[["310",6],["311",6],["312",6],["313",6],["314",6],["315",6],["316",6],["320",6],["321",6],["322",6],["323",6],["324",6],["325",6],["326",6],["327",6],["328",6],["329",6],["330",6],["331",6],["332",6],["333",6],["334",6],["335",6],["336",6],["340",6],["341",6],["342",6],["343",6],["344",6],["345",6],["346",6],["347",6],["348",6],["349",6],["350",6],["351",6],["352",6],["353",6],["354",6],["355",6],["356",6],["357",6],["360",6],["361",6],["362",6],["363",6],["364",6],["365",6],["366",6],["367",6],["368",6],["369",6],["390",t.VARIABLE_LENGTH,15],["391",t.VARIABLE_LENGTH,18],["392",t.VARIABLE_LENGTH,15],["393",t.VARIABLE_LENGTH,18],["703",t.VARIABLE_LENGTH,30]],t.FOUR_DIGIT_DATA_LENGTH=[["7001",13],["7002",t.VARIABLE_LENGTH,30],["7003",10],["8001",14],["8002",t.VARIABLE_LENGTH,20],["8003",t.VARIABLE_LENGTH,30],["8004",t.VARIABLE_LENGTH,30],["8005",6],["8006",18],["8007",t.VARIABLE_LENGTH,30],["8008",t.VARIABLE_LENGTH,12],["8018",18],["8020",t.VARIABLE_LENGTH,25],["8100",6],["8101",10],["8102",2],["8110",t.VARIABLE_LENGTH,70],["8200",t.VARIABLE_LENGTH,70]],t}(),jo=function(){function t(t){this.buffer=new $r,this.information=t}return t.prototype.decodeAllCodes=function(t,e){for(var r=e,n=null;;){var o=this.decodeGeneralPurposeField(r,n),i=Fo.parseFieldsInGeneralPurpose(o.getNewString());if(null!=i&&t.append(i),n=o.isRemaining()?""+o.getRemainingValue():null,r===o.getNewPosition())break;r=o.getNewPosition()}return t.toString()},t.prototype.isStillNumeric=function(t){if(t+7>this.information.getSize())return t+4<=this.information.getSize();for(var e=t;e<t+3;++e)if(this.information.get(e))return!0;return this.information.get(t+3)},t.prototype.decodeNumeric=function(t){if(t+7>this.information.getSize()){var e=this.extractNumericValueFromBitArray(t,4);return new Bo(this.information.getSize(),0===e?Bo.FNC1:e-1,Bo.FNC1)}var r=this.extractNumericValueFromBitArray(t,7);return new Bo(t+7,(r-8)/11,(r-8)%11)},t.prototype.extractNumericValueFromBitArray=function(e,r){return t.extractNumericValueFromBitArray(this.information,e,r)},t.extractNumericValueFromBitArray=function(t,e,r){for(var n=0,o=0;o<r;++o)t.get(e+o)&&(n|=1<<r-o-1);return n},t.prototype.decodeGeneralPurposeField=function(t,e){this.buffer.setLengthToZero(),null!=e&&this.buffer.append(e),this.current.setPosition(t);var r=this.parseBlocks();return null!=r&&r.isRemaining()?new Po(this.current.getPosition(),this.buffer.toString(),r.getRemainingValue()):new Po(this.current.getPosition(),this.buffer.toString())},t.prototype.parseBlocks=function(){var t,e;do{var r=this.current.getPosition();if(t=this.current.isAlpha()?(e=this.parseAlphaBlock()).isFinished():this.current.isIsoIec646()?(e=this.parseIsoIec646Block()).isFinished():(e=this.parseNumericBlock()).isFinished(),r===this.current.getPosition()&&!t)break}while(!t);return e.getDecodedInformation()},t.prototype.parseNumericBlock=function(){for(;this.isStillNumeric(this.current.getPosition());){var t=this.decodeNumeric(this.current.getPosition());if(this.current.setPosition(t.getNewPosition()),t.isFirstDigitFNC1()){var e=void 0;return e=t.isSecondDigitFNC1()?new Po(this.current.getPosition(),this.buffer.toString()):new Po(this.current.getPosition(),this.buffer.toString(),t.getSecondDigit()),new To(!0,e)}if(this.buffer.append(t.getFirstDigit()),t.isSecondDigitFNC1())return e=new Po(this.current.getPosition(),this.buffer.toString()),new To(!0,e);this.buffer.append(t.getSecondDigit())}return this.isNumericToAlphaNumericLatch(this.current.getPosition())&&(this.current.setAlpha(),this.current.incrementPosition(4)),new To(!1)},t.prototype.parseIsoIec646Block=function(){for(;this.isStillIsoIec646(this.current.getPosition());){var t=this.decodeIsoIec646(this.current.getPosition());if(this.current.setPosition(t.getNewPosition()),t.isFNC1()){var e=new Po(this.current.getPosition(),this.buffer.toString());return new To(!0,e)}this.buffer.append(t.getValue())}return this.isAlphaOr646ToNumericLatch(this.current.getPosition())?(this.current.incrementPosition(3),this.current.setNumeric()):this.isAlphaTo646ToAlphaLatch(this.current.getPosition())&&(this.current.getPosition()+5<this.information.getSize()?this.current.incrementPosition(5):this.current.setPosition(this.information.getSize()),this.current.setAlpha()),new To(!1)},t.prototype.parseAlphaBlock=function(){for(;this.isStillAlpha(this.current.getPosition());){var t=this.decodeAlphanumeric(this.current.getPosition());if(this.current.setPosition(t.getNewPosition()),t.isFNC1()){var e=new Po(this.current.getPosition(),this.buffer.toString());return new To(!0,e)}this.buffer.append(t.getValue())}return this.isAlphaOr646ToNumericLatch(this.current.getPosition())?(this.current.incrementPosition(3),this.current.setNumeric()):this.isAlphaTo646ToAlphaLatch(this.current.getPosition())&&(this.current.getPosition()+5<this.information.getSize()?this.current.incrementPosition(5):this.current.setPosition(this.information.getSize()),this.current.setIsoIec646()),new To(!1)},t.prototype.isStillIsoIec646=function(t){if(t+5>this.information.getSize())return!1;var e=this.extractNumericValueFromBitArray(t,5);if(e>=5&&e<16)return!0;if(t+7>this.information.getSize())return!1;var r=this.extractNumericValueFromBitArray(t,7);if(r>=64&&r<116)return!0;if(t+8>this.information.getSize())return!1;var n=this.extractNumericValueFromBitArray(t,8);return n>=232&&n<253},t.prototype.decodeIsoIec646=function(t){var e=this.extractNumericValueFromBitArray(t,5);if(15===e)return new Ro(t+5,Ro.FNC1);if(e>=5&&e<15)return new Ro(t+5,"0"+(e-5));var r,n=this.extractNumericValueFromBitArray(t,7);if(n>=64&&n<90)return new Ro(t+7,""+(n+1));if(n>=90&&n<116)return new Ro(t+7,""+(n+7));switch(this.extractNumericValueFromBitArray(t,8)){case 232:r="!";break;case 233:r='"';break;case 234:r="%";break;case 235:r="&";break;case 236:r="'";break;case 237:r="(";break;case 238:r=")";break;case 239:r="*";break;case 240:r="+";break;case 241:r=",";break;case 242:r="-";break;case 243:r=".";break;case 244:r="/";break;case 245:r=":";break;case 246:r=";";break;case 247:r="<";break;case 248:r="=";break;case 249:r=">";break;case 250:r="?";break;case 251:r="_";break;case 252:r=" ";break;default:throw new Vr}return new Ro(t+8,r)},t.prototype.isStillAlpha=function(t){if(t+5>this.information.getSize())return!1;var e=this.extractNumericValueFromBitArray(t,5);if(e>=5&&e<16)return!0;if(t+6>this.information.getSize())return!1;var r=this.extractNumericValueFromBitArray(t,6);return r>=16&&r<63},t.prototype.decodeAlphanumeric=function(t){var e=this.extractNumericValueFromBitArray(t,5);if(15===e)return new Ro(t+5,Ro.FNC1);if(e>=5&&e<15)return new Ro(t+5,"0"+(e-5));var r,n=this.extractNumericValueFromBitArray(t,6);if(n>=32&&n<58)return new Ro(t+6,""+(n+33));switch(n){case 58:r="*";break;case 59:r=",";break;case 60:r="-";break;case 61:r=".";break;case 62:r="/";break;default:throw new Sn("Decoding invalid alphanumeric value: "+n)}return new Ro(t+6,r)},t.prototype.isAlphaTo646ToAlphaLatch=function(t){if(t+1>this.information.getSize())return!1;for(var e=0;e<5&&e+t<this.information.getSize();++e)if(2===e){if(!this.information.get(t+2))return!1}else if(this.information.get(t+e))return!1;return!0},t.prototype.isAlphaOr646ToNumericLatch=function(t){if(t+3>this.information.getSize())return!1;for(var e=t;e<t+3;++e)if(this.information.get(e))return!1;return!0},t.prototype.isNumericToAlphaNumericLatch=function(t){if(t+1>this.information.getSize())return!1;for(var e=0;e<4&&e+t<this.information.getSize();++e)if(this.information.get(t+e))return!1;return!0},t}(),Vo=function(){function t(t){this.information=t,this.generalDecoder=new jo(t)}return t.prototype.getInformation=function(){return this.information},t.prototype.getGeneralDecoder=function(){return this.generalDecoder},t}(),Uo=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ho=function(t){function e(e){return t.call(this,e)||this}return Uo(e,t),e.prototype.encodeCompressedGtin=function(t,e){t.append("(01)");var r=t.length();t.append("9"),this.encodeCompressedGtinWithoutAI(t,e,r)},e.prototype.encodeCompressedGtinWithoutAI=function(t,r,n){for(var o=0;o<4;++o){var i=this.getGeneralDecoder().extractNumericValueFromBitArray(r+10*o,10);i/100==0&&t.append("0"),i/10==0&&t.append("0"),t.append(i)}e.appendCheckDigit(t,n)},e.appendCheckDigit=function(t,e){for(var r=0,n=0;n<13;n++){var o=t.charAt(n+e).charCodeAt(0)-"0".charCodeAt(0);r+=1&n?o:3*o}10==(r=10-r%10)&&(r=0),t.append(r)},e.GTIN_SIZE=40,e}(Vo),zo=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Wo=function(t){function e(e){return t.call(this,e)||this}return zo(e,t),e.prototype.parseInformation=function(){var t=new $r;t.append("(01)");var r=t.length(),n=this.getGeneralDecoder().extractNumericValueFromBitArray(e.HEADER_SIZE,4);return t.append(n),this.encodeCompressedGtinWithoutAI(t,e.HEADER_SIZE+4,r),this.getGeneralDecoder().decodeAllCodes(t,e.HEADER_SIZE+44)},e.HEADER_SIZE=4,e}(Ho),Go=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Xo=function(t){function e(e){return t.call(this,e)||this}return Go(e,t),e.prototype.parseInformation=function(){var t=new $r;return this.getGeneralDecoder().decodeAllCodes(t,e.HEADER_SIZE)},e.HEADER_SIZE=5,e}(Vo),$o=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Yo=function(t){function e(e){return t.call(this,e)||this}return $o(e,t),e.prototype.encodeCompressedWeight=function(t,e,r){var n=this.getGeneralDecoder().extractNumericValueFromBitArray(e,r);this.addWeightCode(t,n);for(var o=this.checkWeight(n),i=1e5,a=0;a<5;++a)o/i==0&&t.append("0"),i/=10;t.append(o)},e}(Ho),qo=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ko=function(t){function e(e){return t.call(this,e)||this}return qo(e,t),e.prototype.parseInformation=function(){if(this.getInformation().getSize()!=e.HEADER_SIZE+Yo.GTIN_SIZE+e.WEIGHT_SIZE)throw new Kr;var t=new $r;return this.encodeCompressedGtin(t,e.HEADER_SIZE),this.encodeCompressedWeight(t,e.HEADER_SIZE+Yo.GTIN_SIZE,e.WEIGHT_SIZE),t.toString()},e.HEADER_SIZE=5,e.WEIGHT_SIZE=15,e}(Yo),Zo=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Qo=function(t){function e(e){return t.call(this,e)||this}return Zo(e,t),e.prototype.addWeightCode=function(t,e){t.append("(3103)")},e.prototype.checkWeight=function(t){return t},e}(Ko),Jo=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ti=function(t){function e(e){return t.call(this,e)||this}return Jo(e,t),e.prototype.addWeightCode=function(t,e){e<1e4?t.append("(3202)"):t.append("(3203)")},e.prototype.checkWeight=function(t){return t<1e4?t:t-1e4},e}(Ko),ei=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ri=function(t){function e(e){return t.call(this,e)||this}return ei(e,t),e.prototype.parseInformation=function(){if(this.getInformation().getSize()<e.HEADER_SIZE+Ho.GTIN_SIZE)throw new Kr;var t=new $r;this.encodeCompressedGtin(t,e.HEADER_SIZE);var r=this.getGeneralDecoder().extractNumericValueFromBitArray(e.HEADER_SIZE+Ho.GTIN_SIZE,e.LAST_DIGIT_SIZE);t.append("(392"),t.append(r),t.append(")");var n=this.getGeneralDecoder().decodeGeneralPurposeField(e.HEADER_SIZE+Ho.GTIN_SIZE+e.LAST_DIGIT_SIZE,null);return t.append(n.getNewString()),t.toString()},e.HEADER_SIZE=8,e.LAST_DIGIT_SIZE=2,e}(Ho),ni=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),oi=function(t){function e(e){return t.call(this,e)||this}return ni(e,t),e.prototype.parseInformation=function(){if(this.getInformation().getSize()<e.HEADER_SIZE+Ho.GTIN_SIZE)throw new Kr;var t=new $r;this.encodeCompressedGtin(t,e.HEADER_SIZE);var r=this.getGeneralDecoder().extractNumericValueFromBitArray(e.HEADER_SIZE+Ho.GTIN_SIZE,e.LAST_DIGIT_SIZE);t.append("(393"),t.append(r),t.append(")");var n=this.getGeneralDecoder().extractNumericValueFromBitArray(e.HEADER_SIZE+Ho.GTIN_SIZE+e.LAST_DIGIT_SIZE,e.FIRST_THREE_DIGITS_SIZE);n/100==0&&t.append("0"),n/10==0&&t.append("0"),t.append(n);var o=this.getGeneralDecoder().decodeGeneralPurposeField(e.HEADER_SIZE+Ho.GTIN_SIZE+e.LAST_DIGIT_SIZE+e.FIRST_THREE_DIGITS_SIZE,null);return t.append(o.getNewString()),t.toString()},e.HEADER_SIZE=8,e.LAST_DIGIT_SIZE=2,e.FIRST_THREE_DIGITS_SIZE=10,e}(Ho),ii=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ai=function(t){function e(e,r,n){var o=t.call(this,e)||this;return o.dateCode=n,o.firstAIdigits=r,o}return ii(e,t),e.prototype.parseInformation=function(){if(this.getInformation().getSize()!=e.HEADER_SIZE+e.GTIN_SIZE+e.WEIGHT_SIZE+e.DATE_SIZE)throw new Kr;var t=new $r;return this.encodeCompressedGtin(t,e.HEADER_SIZE),this.encodeCompressedWeight(t,e.HEADER_SIZE+e.GTIN_SIZE,e.WEIGHT_SIZE),this.encodeCompressedDate(t,e.HEADER_SIZE+e.GTIN_SIZE+e.WEIGHT_SIZE),t.toString()},e.prototype.encodeCompressedDate=function(t,r){var n=this.getGeneralDecoder().extractNumericValueFromBitArray(r,e.DATE_SIZE);if(38400!=n){t.append("("),t.append(this.dateCode),t.append(")");var o=n%32,i=(n/=32)%12+1,a=n/=12;a/10==0&&t.append("0"),t.append(a),i/10==0&&t.append("0"),t.append(i),o/10==0&&t.append("0"),t.append(o)}},e.prototype.addWeightCode=function(t,e){t.append("("),t.append(this.firstAIdigits),t.append(e/1e5),t.append(")")},e.prototype.checkWeight=function(t){return t%1e5},e.HEADER_SIZE=8,e.WEIGHT_SIZE=20,e.DATE_SIZE=16,e}(Yo),si=function(){function t(t,e,r,n){this.leftchar=t,this.rightchar=e,this.finderpattern=r,this.maybeLast=n}return t.prototype.mayBeLast=function(){return this.maybeLast},t.prototype.getLeftChar=function(){return this.leftchar},t.prototype.getRightChar=function(){return this.rightchar},t.prototype.getFinderPattern=function(){return this.finderpattern},t.prototype.mustBeLast=function(){return null==this.rightchar},t.prototype.toString=function(){return"[ "+this.leftchar+", "+this.rightchar+" : "+(null==this.finderpattern?"null":this.finderpattern.getValue())+" ]"},t.equals=function(e,r){return e instanceof t&&t.equalsOrNull(e.leftchar,r.leftchar)&&t.equalsOrNull(e.rightchar,r.rightchar)&&t.equalsOrNull(e.finderpattern,r.finderpattern)},t.equalsOrNull=function(e,r){return null===e?null===r:t.equals(e,r)},t.prototype.hashCode=function(){return this.leftchar.getValue()^this.rightchar.getValue()^this.finderpattern.getValue()},t}(),ui=function(){function t(t,e,r){this.pairs=t,this.rowNumber=e,this.wasReversed=r}return t.prototype.getPairs=function(){return this.pairs},t.prototype.getRowNumber=function(){return this.rowNumber},t.prototype.isReversed=function(){return this.wasReversed},t.prototype.isEquivalent=function(t){return this.checkEqualitity(this,t)},t.prototype.toString=function(){return"{ "+this.pairs+" }"},t.prototype.equals=function(e,r){return e instanceof t&&this.checkEqualitity(e,r)&&e.wasReversed===r.wasReversed},t.prototype.checkEqualitity=function(t,e){var r;if(t&&e)return t.forEach(function(t,n){e.forEach(function(e){t.getLeftChar().getValue()===e.getLeftChar().getValue()&&t.getRightChar().getValue()===e.getRightChar().getValue()&&t.getFinderPatter().getValue()===e.getFinderPatter().getValue()&&(r=!0)})}),r},t}(),li=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ci=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},hi=function(t){function e(){var r=null!==t&&t.apply(this,arguments)||this;return r.pairs=new Array(e.MAX_PAIRS),r.rows=new Array,r.startEnd=[2],r}return li(e,t),e.prototype.decodeRow=function(t,r,n){this.pairs.length=0,this.startFromEven=!1;try{return e.constructResult(this.decodeRow2pairs(t,r))}catch(o){}return this.pairs.length=0,this.startFromEven=!0,e.constructResult(this.decodeRow2pairs(t,r))},e.prototype.reset=function(){this.pairs.length=0,this.rows.length=0},e.prototype.decodeRow2pairs=function(t,e){for(var r,n=!1;!n;)try{this.pairs.push(this.retrieveNextPair(e,this.pairs,t))}catch(i){if(i instanceof Kr){if(!this.pairs.length)throw new Kr;n=!0}}if(this.checkChecksum())return this.pairs;if(r=!!this.rows.length,this.storeRow(t,!1),r){var o=this.checkRowsBoolean(!1);if(null!=o)return o;if(null!=(o=this.checkRowsBoolean(!0)))return o}throw new Kr},e.prototype.checkRowsBoolean=function(t){if(this.rows.length>25)return this.rows.length=0,null;this.pairs.length=0,t&&(this.rows=this.rows.reverse());var e=null;try{e=this.checkRows(new Array,0)}catch(r){console.log(r)}return t&&(this.rows=this.rows.reverse()),e},e.prototype.checkRows=function(t,r){for(var n,o,i=r;i<this.rows.length;i++){var a=this.rows[i];this.pairs.length=0;try{for(var s=(n=void 0,ci(t)),u=s.next();!u.done;u=s.next()){var l=u.value;this.pairs.push(l.getPairs())}}catch(h){n={error:h}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(n)throw n.error}}if(this.pairs.push(a.getPairs()),e.isValidSequence(this.pairs)){if(this.checkChecksum())return this.pairs;var c=new Array(t);c.push(a);try{return this.checkRows(c,i+1)}catch(h){console.log(h)}}}throw new Kr},e.isValidSequence=function(t){var r,n;try{for(var o=ci(e.FINDER_PATTERN_SEQUENCES),i=o.next();!i.done;i=o.next()){var a=i.value;if(!(t.length>a.length)){for(var s=!0,u=0;u<t.length;u++)if(t[u].getFinderPattern().getValue()!=a[u]){s=!1;break}if(s)return!0}}}catch(l){r={error:l}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return!1},e.prototype.storeRow=function(t,r){for(var n=0,o=!1,i=!1;n<this.rows.length;){var a=this.rows[n];if(a.getRowNumber()>t){i=a.isEquivalent(this.pairs);break}o=a.isEquivalent(this.pairs),n++}i||o||e.isPartialRow(this.pairs,this.rows)||(this.rows.push(n,new ui(this.pairs,t,r)),this.removePartialRows(this.pairs,this.rows))},e.prototype.removePartialRows=function(t,e){var r,n,o,i,a,s;try{for(var u=ci(e),l=u.next();!l.done;l=u.next()){var c=l.value;if(c.getPairs().length!==t.length)try{for(var h=(o=void 0,ci(c.getPairs())),f=h.next();!f.done;f=h.next()){var d=f.value;try{for(var p=(a=void 0,ci(t)),g=p.next();!g.done;g=p.next()){var m=g.value;if(si.equals(d,m)){0;break}}}catch(v){a={error:v}}finally{try{g&&!g.done&&(s=p.return)&&s.call(p)}finally{if(a)throw a.error}}}}catch(v){o={error:v}}finally{try{f&&!f.done&&(i=h.return)&&i.call(h)}finally{if(o)throw o.error}}}}catch(v){r={error:v}}finally{try{l&&!l.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}},e.isPartialRow=function(t,e){var r,n,o,i,a,s;try{for(var u=ci(e),l=u.next();!l.done;l=u.next()){var c=l.value,h=!0;try{for(var f=(o=void 0,ci(t)),d=f.next();!d.done;d=f.next()){var p=d.value,g=!1;try{for(var m=(a=void 0,ci(c.getPairs())),v=m.next();!v.done;v=m.next()){var y=v.value;if(p.equals(y)){g=!0;break}}}catch(_){a={error:_}}finally{try{v&&!v.done&&(s=m.return)&&s.call(m)}finally{if(a)throw a.error}}if(!g){h=!1;break}}}catch(_){o={error:_}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}if(h)return!0}}catch(_){r={error:_}}finally{try{l&&!l.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}return!1},e.prototype.getRows=function(){return this.rows},e.constructResult=function(t){var e=function(t){try{if(t.get(1))return new Wo(t);if(!t.get(2))return new Xo(t);switch(jo.extractNumericValueFromBitArray(t,1,4)){case 4:return new Qo(t);case 5:return new ti(t)}switch(jo.extractNumericValueFromBitArray(t,1,5)){case 12:return new ri(t);case 13:return new oi(t)}switch(jo.extractNumericValueFromBitArray(t,1,7)){case 56:return new ai(t,"310","11");case 57:return new ai(t,"320","11");case 58:return new ai(t,"310","13");case 59:return new ai(t,"320","13");case 60:return new ai(t,"310","15");case 61:return new ai(t,"320","15");case 62:return new ai(t,"310","17");case 63:return new ai(t,"320","17")}}catch(e){throw console.log(e),new Sn("unknown decoder: "+t)}}(Oo.buildBitArray(t)).parseInformation(),r=t[0].getFinderPattern().getResultPoints(),n=t[t.length-1].getFinderPattern().getResultPoints(),o=[r[0],r[1],n[0],n[1]];return new hn(e,null,null,o,dn.RSS_EXPANDED,null)},e.prototype.checkChecksum=function(){var t=this.pairs.get(0),e=t.getLeftChar(),r=t.getRightChar();if(null==r)return!1;for(var n=r.getChecksumPortion(),o=2,i=1;i<this.pairs.size();++i){var a=this.pairs.get(i);n+=a.getLeftChar().getChecksumPortion(),o++;var s=a.getRightChar();null!=s&&(n+=s.getChecksumPortion(),o++)}return 211*(o-4)+(n%=211)==e.getValue()},e.getNextSecondBar=function(t,e){var r;return t.get(e)?(r=t.getNextUnset(e),r=t.getNextSet(r)):(r=t.getNextSet(e),r=t.getNextUnset(r)),r},e.prototype.retrieveNextPair=function(t,r,n){var o,i=r.length%2==0;this.startFromEven&&(i=!i);var a=!0,s=-1;do{this.findNextPair(t,r,s),null==(o=this.parseFoundFinderPattern(t,n,i))?s=e.getNextSecondBar(t,this.startEnd[0]):a=!1}while(a);var u,l=this.decodeDataCharacter(t,o,i,!0);if(!this.isEmptyPair(r)&&r[r.length-1].mustBeLast())throw new Kr;try{u=this.decodeDataCharacter(t,o,i,!1)}catch(c){u=null,console.log(c)}return new si(l,u,o,!0)},e.prototype.isEmptyPair=function(t){return 0===t.length},e.prototype.findNextPair=function(t,r,n){var o=this.getDecodeFinderCounters();o[0]=0,o[1]=0,o[2]=0,o[3]=0;var i,a=t.getSize();i=n>=0?n:this.isEmptyPair(r)?0:r[r.length-1].getFinderPattern().getStartEnd()[1];var s=r.length%2!=0;this.startFromEven&&(s=!s);for(var u=!1;i<a&&(u=!t.get(i));)i++;for(var l=0,c=i,h=i;h<a;h++)if(t.get(h)!=u)o[l]++;else{if(3==l){if(s&&e.reverseCounters(o),e.isFinderPattern(o))return this.startEnd[0]=c,void(this.startEnd[1]=h);s&&e.reverseCounters(o),c+=o[0]+o[1],o[0]=o[2],o[1]=o[3],o[2]=0,o[3]=0,l--}else l++;o[l]=1,u=!u}throw new Kr},e.reverseCounters=function(t){for(var e=t.length,r=0;r<e/2;++r){var n=t[r];t[r]=t[e-r-1],t[e-r-1]=n}},e.prototype.parseFoundFinderPattern=function(t,r,n){var o,i,a;if(n){for(var s=this.startEnd[0]-1;s>=0&&!t.get(s);)s--;s++,o=this.startEnd[0]-s,i=s,a=this.startEnd[1]}else i=this.startEnd[0],o=(a=t.getNextUnset(this.startEnd[1]+1))-this.startEnd[1];var u,l=this.getDecodeFinderCounters();Tr.arraycopy(l,0,l,1,l.length-1),l[0]=o;try{u=this.parseFinderValue(l,e.FINDER_PATTERNS)}catch(c){return null}return new So(u,[i,a],i,a,r)},e.prototype.decodeDataCharacter=function(t,r,n,o){for(var i=this.getDataCharacterCounters(),a=0;a<i.length;a++)i[a]=0;if(o)e.recordPatternInReverse(t,r.getStartEnd()[0],i);else{e.recordPattern(t,r.getStartEnd()[1],i);for(var s=0,u=i.length-1;s<u;s++,u--){var l=i[s];i[s]=i[u],i[u]=l}}var c=Tn.sum(new Int32Array(i))/17,h=(r.getStartEnd()[1]-r.getStartEnd()[0])/15;if(Math.abs(c-h)/h>.3)throw new Kr;var f=this.getOddCounts(),d=this.getEvenCounts(),p=this.getOddRoundingErrors(),g=this.getEvenRoundingErrors();for(s=0;s<i.length;s++){var m=1*i[s]/c,v=m+.5;if(v<1){if(m<.3)throw new Kr;v=1}else if(v>8){if(m>8.7)throw new Kr;v=8}var y=s/2;1&s?(d[y]=v,g[y]=m-v):(f[y]=v,p[y]=m-v)}this.adjustOddEvenCounts(17);var _=4*r.getValue()+(n?0:2)+(o?0:1)-1,w=0,b=0;for(s=f.length-1;s>=0;s--){if(e.isNotA1left(r,n,o)){var C=e.WEIGHTS[_][2*s];b+=f[s]*C}w+=f[s]}var A=0;for(s=d.length-1;s>=0;s--)e.isNotA1left(r,n,o)&&(C=e.WEIGHTS[_][2*s+1],A+=d[s]*C);var E=b+A;if(1&w||w>13||w<4)throw new Kr;var I=(13-w)/2,S=e.SYMBOL_WIDEST[I],x=9-S,O=xo.getRSSvalue(f,S,!0),T=xo.getRSSvalue(d,x,!1),N=e.EVEN_TOTAL_SUBSET[I],k=e.GSUM[I];return new Io(O*N+T+k,E)},e.isNotA1left=function(t,e,r){return!(0==t.getValue()&&e&&r)},e.prototype.adjustOddEvenCounts=function(t){var r=Tn.sum(new Int32Array(this.getOddCounts())),n=Tn.sum(new Int32Array(this.getEvenCounts())),o=!1,i=!1;r>13?i=!0:r<4&&(o=!0);var a=!1,s=!1;n>13?s=!0:n<4&&(a=!0);var u=r+n-t,l=!(1&~r),c=!(1&n);if(1==u)if(l){if(c)throw new Kr;i=!0}else{if(!c)throw new Kr;s=!0}else if(-1==u)if(l){if(c)throw new Kr;o=!0}else{if(!c)throw new Kr;a=!0}else{if(0!=u)throw new Kr;if(l){if(!c)throw new Kr;r<n?(o=!0,s=!0):(i=!0,a=!0)}else if(c)throw new Kr}if(o){if(i)throw new Kr;e.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(i&&e.decrement(this.getOddCounts(),this.getOddRoundingErrors()),a){if(s)throw new Kr;e.increment(this.getEvenCounts(),this.getOddRoundingErrors())}s&&e.decrement(this.getEvenCounts(),this.getEvenRoundingErrors())},e.SYMBOL_WIDEST=[7,5,4,3,1],e.EVEN_TOTAL_SUBSET=[4,20,52,104,204],e.GSUM=[0,348,1388,2948,3988],e.FINDER_PATTERNS=[Int32Array.from([1,8,4,1]),Int32Array.from([3,6,4,1]),Int32Array.from([3,4,6,1]),Int32Array.from([3,2,8,1]),Int32Array.from([2,6,5,1]),Int32Array.from([2,2,9,1])],e.WEIGHTS=[[1,3,9,27,81,32,96,77],[20,60,180,118,143,7,21,63],[189,145,13,39,117,140,209,205],[193,157,49,147,19,57,171,91],[62,186,136,197,169,85,44,132],[185,133,188,142,4,12,36,108],[113,128,173,97,80,29,87,50],[150,28,84,41,123,158,52,156],[46,138,203,187,139,206,196,166],[76,17,51,153,37,111,122,155],[43,129,176,106,107,110,119,146],[16,48,144,10,30,90,59,177],[109,116,137,200,178,112,125,164],[70,210,208,202,184,130,179,115],[134,191,151,31,93,68,204,190],[148,22,66,198,172,94,71,2],[6,18,54,162,64,192,154,40],[120,149,25,75,14,42,126,167],[79,26,78,23,69,207,199,175],[103,98,83,38,114,131,182,124],[161,61,183,127,170,88,53,159],[55,165,73,8,24,72,5,15],[45,135,194,160,58,174,100,89]],e.FINDER_PAT_A=0,e.FINDER_PAT_B=1,e.FINDER_PAT_C=2,e.FINDER_PAT_D=3,e.FINDER_PAT_E=4,e.FINDER_PAT_F=5,e.FINDER_PATTERN_SEQUENCES=[[e.FINDER_PAT_A,e.FINDER_PAT_A],[e.FINDER_PAT_A,e.FINDER_PAT_B,e.FINDER_PAT_B],[e.FINDER_PAT_A,e.FINDER_PAT_C,e.FINDER_PAT_B,e.FINDER_PAT_D],[e.FINDER_PAT_A,e.FINDER_PAT_E,e.FINDER_PAT_B,e.FINDER_PAT_D,e.FINDER_PAT_C],[e.FINDER_PAT_A,e.FINDER_PAT_E,e.FINDER_PAT_B,e.FINDER_PAT_D,e.FINDER_PAT_D,e.FINDER_PAT_F],[e.FINDER_PAT_A,e.FINDER_PAT_E,e.FINDER_PAT_B,e.FINDER_PAT_D,e.FINDER_PAT_E,e.FINDER_PAT_F,e.FINDER_PAT_F],[e.FINDER_PAT_A,e.FINDER_PAT_A,e.FINDER_PAT_B,e.FINDER_PAT_B,e.FINDER_PAT_C,e.FINDER_PAT_C,e.FINDER_PAT_D,e.FINDER_PAT_D],[e.FINDER_PAT_A,e.FINDER_PAT_A,e.FINDER_PAT_B,e.FINDER_PAT_B,e.FINDER_PAT_C,e.FINDER_PAT_C,e.FINDER_PAT_D,e.FINDER_PAT_E,e.FINDER_PAT_E],[e.FINDER_PAT_A,e.FINDER_PAT_A,e.FINDER_PAT_B,e.FINDER_PAT_B,e.FINDER_PAT_C,e.FINDER_PAT_C,e.FINDER_PAT_D,e.FINDER_PAT_E,e.FINDER_PAT_F,e.FINDER_PAT_F],[e.FINDER_PAT_A,e.FINDER_PAT_A,e.FINDER_PAT_B,e.FINDER_PAT_B,e.FINDER_PAT_C,e.FINDER_PAT_D,e.FINDER_PAT_D,e.FINDER_PAT_E,e.FINDER_PAT_E,e.FINDER_PAT_F,e.FINDER_PAT_F]],e.MAX_PAIRS=11,e}(Eo),fi=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),di=function(t){function e(e,r,n){var o=t.call(this,e,r)||this;return o.count=0,o.finderPattern=n,o}return fi(e,t),e.prototype.getFinderPattern=function(){return this.finderPattern},e.prototype.getCount=function(){return this.count},e.prototype.incrementCount=function(){this.count++},e}(Io),pi=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),gi=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},mi=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.possibleLeftPairs=[],e.possibleRightPairs=[],e}return pi(e,t),e.prototype.decodeRow=function(t,r,n){var o,i,a,s,u=this.decodePair(r,!1,t,n);e.addOrTally(this.possibleLeftPairs,u),r.reverse();var l=this.decodePair(r,!0,t,n);e.addOrTally(this.possibleRightPairs,l),r.reverse();try{for(var c=gi(this.possibleLeftPairs),h=c.next();!h.done;h=c.next()){var f=h.value;if(f.getCount()>1)try{for(var d=(a=void 0,gi(this.possibleRightPairs)),p=d.next();!p.done;p=d.next()){var g=p.value;if(g.getCount()>1&&e.checkChecksum(f,g))return e.constructResult(f,g)}}catch(m){a={error:m}}finally{try{p&&!p.done&&(s=d.return)&&s.call(d)}finally{if(a)throw a.error}}}}catch(m){o={error:m}}finally{try{h&&!h.done&&(i=c.return)&&i.call(c)}finally{if(o)throw o.error}}throw new Kr},e.addOrTally=function(t,e){var r,n;if(null!=e){var o=!1;try{for(var i=gi(t),a=i.next();!a.done;a=i.next()){var s=a.value;if(s.getValue()===e.getValue()){s.incrementCount(),o=!0;break}}}catch(u){r={error:u}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}o||t.push(e)}},e.prototype.reset=function(){this.possibleLeftPairs.length=0,this.possibleRightPairs.length=0},e.constructResult=function(t,e){for(var r=4537077*t.getValue()+e.getValue(),n=new String(r).toString(),o=new $r,i=13-n.length;i>0;i--)o.append("0");o.append(n);var a=0;for(i=0;i<13;i++){var s=o.charAt(i).charCodeAt(0)-"0".charCodeAt(0);a+=1&i?s:3*s}10==(a=10-a%10)&&(a=0),o.append(a.toString());var u=t.getFinderPattern().getResultPoints(),l=e.getFinderPattern().getResultPoints();return new hn(o.toString(),null,0,[u[0],u[1],l[0],l[1]],dn.RSS_14,(new Date).getTime())},e.checkChecksum=function(t,e){var r=(t.getChecksumPortion()+16*e.getChecksumPortion())%79,n=9*t.getFinderPattern().getValue()+e.getFinderPattern().getValue();return n>72&&n--,n>8&&n--,r===n},e.prototype.decodePair=function(t,e,r,n){try{var o=this.findFinderPattern(t,e),i=this.parseFoundFinderPattern(t,r,e,o),a=null==n?null:n.get(Fr.NEED_RESULT_POINT_CALLBACK);if(null!=a){var s=(o[0]+o[1])/2;e&&(s=t.getSize()-1-s),a.foundPossibleResultPoint(new kn(s,r))}var u=this.decodeDataCharacter(t,i,!0),l=this.decodeDataCharacter(t,i,!1);return new di(1597*u.getValue()+l.getValue(),u.getChecksumPortion()+4*l.getChecksumPortion(),i)}catch(c){return null}},e.prototype.decodeDataCharacter=function(t,r,n){for(var o=this.getDataCharacterCounters(),i=0;i<o.length;i++)o[i]=0;if(n)Gn.recordPatternInReverse(t,r.getStartEnd()[0],o);else{Gn.recordPattern(t,r.getStartEnd()[1]+1,o);for(var a=0,s=o.length-1;a<s;a++,s--){var u=o[a];o[a]=o[s],o[s]=u}}var l=n?16:15,c=Tn.sum(new Int32Array(o))/l,h=this.getOddCounts(),f=this.getEvenCounts(),d=this.getOddRoundingErrors(),p=this.getEvenRoundingErrors();for(a=0;a<o.length;a++){var g=o[a]/c,m=Math.floor(g+.5);m<1?m=1:m>8&&(m=8);var v=Math.floor(a/2);1&a?(f[v]=m,p[v]=g-m):(h[v]=m,d[v]=g-m)}this.adjustOddEvenCounts(n,l);var y=0,_=0;for(a=h.length-1;a>=0;a--)_*=9,_+=h[a],y+=h[a];var w=0,b=0;for(a=f.length-1;a>=0;a--)w*=9,w+=f[a],b+=f[a];var C=_+3*w;if(n){if(1&y||y>12||y<4)throw new Kr;var A=(12-y)/2,E=9-(T=e.OUTSIDE_ODD_WIDEST[A]),I=xo.getRSSvalue(h,T,!1),S=xo.getRSSvalue(f,E,!0),x=e.OUTSIDE_EVEN_TOTAL_SUBSET[A],O=e.OUTSIDE_GSUM[A];return new Io(I*x+S+O,C)}if(1&b||b>10||b<4)throw new Kr;A=(10-b)/2,E=9-(T=e.INSIDE_ODD_WIDEST[A]),I=xo.getRSSvalue(h,T,!0),S=xo.getRSSvalue(f,E,!1);var T,N=e.INSIDE_ODD_TOTAL_SUBSET[A];return O=e.INSIDE_GSUM[A],new Io(S*N+I+O,C)},e.prototype.findFinderPattern=function(t,e){var r=this.getDecodeFinderCounters();r[0]=0,r[1]=0,r[2]=0,r[3]=0;for(var n=t.getSize(),o=!1,i=0;i<n&&e!==(o=!t.get(i));)i++;for(var a=0,s=i,u=i;u<n;u++)if(t.get(u)!==o)r[a]++;else{if(3===a){if(Eo.isFinderPattern(r))return[s,u];s+=r[0]+r[1],r[0]=r[2],r[1]=r[3],r[2]=0,r[3]=0,a--}else a++;r[a]=1,o=!o}throw new Kr},e.prototype.parseFoundFinderPattern=function(t,r,n,o){for(var i=t.get(o[0]),a=o[0]-1;a>=0&&i!==t.get(a);)a--;a++;var s=o[0]-a,u=this.getDecodeFinderCounters(),l=new Int32Array(u.length);Tr.arraycopy(u,0,l,1,u.length-1),l[0]=s;var c=this.parseFinderValue(l,e.FINDER_PATTERNS),h=a,f=o[1];return n&&(h=t.getSize()-1-h,f=t.getSize()-1-f),new So(c,[a,o[1]],h,f,r)},e.prototype.adjustOddEvenCounts=function(t,e){var r=Tn.sum(new Int32Array(this.getOddCounts())),n=Tn.sum(new Int32Array(this.getEvenCounts())),o=!1,i=!1,a=!1,s=!1;t?(r>12?i=!0:r<4&&(o=!0),n>12?s=!0:n<4&&(a=!0)):(r>11?i=!0:r<5&&(o=!0),n>10?s=!0:n<4&&(a=!0));var u=r+n-e,l=(1&r)==(t?1:0),c=!(1&~n);if(1===u)if(l){if(c)throw new Kr;i=!0}else{if(!c)throw new Kr;s=!0}else if(-1===u)if(l){if(c)throw new Kr;o=!0}else{if(!c)throw new Kr;a=!0}else{if(0!==u)throw new Kr;if(l){if(!c)throw new Kr;r<n?(o=!0,s=!0):(i=!0,a=!0)}else if(c)throw new Kr}if(o){if(i)throw new Kr;Eo.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(i&&Eo.decrement(this.getOddCounts(),this.getOddRoundingErrors()),a){if(s)throw new Kr;Eo.increment(this.getEvenCounts(),this.getOddRoundingErrors())}s&&Eo.decrement(this.getEvenCounts(),this.getEvenRoundingErrors())},e.OUTSIDE_EVEN_TOTAL_SUBSET=[1,10,34,70,126],e.INSIDE_ODD_TOTAL_SUBSET=[4,20,48,81],e.OUTSIDE_GSUM=[0,161,961,2015,2715],e.INSIDE_GSUM=[0,336,1036,1516],e.OUTSIDE_ODD_WIDEST=[8,6,4,3,1],e.INSIDE_ODD_WIDEST=[2,4,6,8],e.FINDER_PATTERNS=[Int32Array.from([3,8,2,1]),Int32Array.from([3,5,5,1]),Int32Array.from([3,3,7,1]),Int32Array.from([3,1,9,1]),Int32Array.from([2,7,4,1]),Int32Array.from([2,5,6,1]),Int32Array.from([2,3,8,1]),Int32Array.from([1,5,7,1]),Int32Array.from([1,3,9,1])],e}(Eo),vi=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),yi=function(t){function e(e){var r=t.call(this)||this;r.readers=[];var n=e?e.get(Fr.POSSIBLE_FORMATS):null,o=e&&void 0!==e.get(Fr.ASSUME_CODE_39_CHECK_DIGIT);return n&&((n.includes(dn.EAN_13)||n.includes(dn.UPC_A)||n.includes(dn.EAN_8)||n.includes(dn.UPC_E))&&r.readers.push(new Co(e)),n.includes(dn.CODE_39)&&r.readers.push(new Kn(o)),n.includes(dn.CODE_128)&&r.readers.push(new $n),n.includes(dn.ITF)&&r.readers.push(new Qn),n.includes(dn.RSS_14)&&r.readers.push(new mi),n.includes(dn.RSS_EXPANDED)&&(console.warn("RSS Expanded reader IS NOT ready for production yet! use at your own risk."),r.readers.push(new hi))),0===r.readers.length&&(r.readers.push(new Co(e)),r.readers.push(new Kn),r.readers.push(new Co(e)),r.readers.push(new $n),r.readers.push(new Qn),r.readers.push(new mi)),r}return vi(e,t),e.prototype.decodeRow=function(t,e,r){for(var n=0;n<this.readers.length;n++)try{return this.readers[n].decodeRow(t,e,r)}catch(o){}throw new Kr},e.prototype.reset=function(){this.readers.forEach(function(t){return t.reset()})},e}(Gn),_i=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){_i(function(e,r){return void 0===e&&(e=500),t.call(this,new yi(r),e,r)||this},t)}(cn);var wi,bi=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Ci=function(){function t(t,e,r){this.ecCodewords=t,this.ecBlocks=[e],r&&this.ecBlocks.push(r)}return t.prototype.getECCodewords=function(){return this.ecCodewords},t.prototype.getECBlocks=function(){return this.ecBlocks},t}(),Ai=function(){function t(t,e){this.count=t,this.dataCodewords=e}return t.prototype.getCount=function(){return this.count},t.prototype.getDataCodewords=function(){return this.dataCodewords},t}(),Ei=function(){function t(t,e,r,n,o,i){var a,s;this.versionNumber=t,this.symbolSizeRows=e,this.symbolSizeColumns=r,this.dataRegionSizeRows=n,this.dataRegionSizeColumns=o,this.ecBlocks=i;var u=0,l=i.getECCodewords(),c=i.getECBlocks();try{for(var h=bi(c),f=h.next();!f.done;f=h.next()){var d=f.value;u+=d.getCount()*(d.getDataCodewords()+l)}}catch(p){a={error:p}}finally{try{f&&!f.done&&(s=h.return)&&s.call(h)}finally{if(a)throw a.error}}this.totalCodewords=u}return t.prototype.getVersionNumber=function(){return this.versionNumber},t.prototype.getSymbolSizeRows=function(){return this.symbolSizeRows},t.prototype.getSymbolSizeColumns=function(){return this.symbolSizeColumns},t.prototype.getDataRegionSizeRows=function(){return this.dataRegionSizeRows},t.prototype.getDataRegionSizeColumns=function(){return this.dataRegionSizeColumns},t.prototype.getTotalCodewords=function(){return this.totalCodewords},t.prototype.getECBlocks=function(){return this.ecBlocks},t.getVersionForDimensions=function(e,r){var n,o;if(1&e||1&r)throw new Vr;try{for(var i=bi(t.VERSIONS),a=i.next();!a.done;a=i.next()){var s=a.value;if(s.symbolSizeRows===e&&s.symbolSizeColumns===r)return s}}catch(u){n={error:u}}finally{try{a&&!a.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}throw new Vr},t.prototype.toString=function(){return""+this.versionNumber},t.buildVersions=function(){return[new t(1,10,10,8,8,new Ci(5,new Ai(1,3))),new t(2,12,12,10,10,new Ci(7,new Ai(1,5))),new t(3,14,14,12,12,new Ci(10,new Ai(1,8))),new t(4,16,16,14,14,new Ci(12,new Ai(1,12))),new t(5,18,18,16,16,new Ci(14,new Ai(1,18))),new t(6,20,20,18,18,new Ci(18,new Ai(1,22))),new t(7,22,22,20,20,new Ci(20,new Ai(1,30))),new t(8,24,24,22,22,new Ci(24,new Ai(1,36))),new t(9,26,26,24,24,new Ci(28,new Ai(1,44))),new t(10,32,32,14,14,new Ci(36,new Ai(1,62))),new t(11,36,36,16,16,new Ci(42,new Ai(1,86))),new t(12,40,40,18,18,new Ci(48,new Ai(1,114))),new t(13,44,44,20,20,new Ci(56,new Ai(1,144))),new t(14,48,48,22,22,new Ci(68,new Ai(1,174))),new t(15,52,52,24,24,new Ci(42,new Ai(2,102))),new t(16,64,64,14,14,new Ci(56,new Ai(2,140))),new t(17,72,72,16,16,new Ci(36,new Ai(4,92))),new t(18,80,80,18,18,new Ci(48,new Ai(4,114))),new t(19,88,88,20,20,new Ci(56,new Ai(4,144))),new t(20,96,96,22,22,new Ci(68,new Ai(4,174))),new t(21,104,104,24,24,new Ci(56,new Ai(6,136))),new t(22,120,120,18,18,new Ci(68,new Ai(6,175))),new t(23,132,132,20,20,new Ci(62,new Ai(8,163))),new t(24,144,144,22,22,new Ci(62,new Ai(8,156),new Ai(2,155))),new t(25,8,18,6,16,new Ci(7,new Ai(1,5))),new t(26,8,32,6,14,new Ci(11,new Ai(1,10))),new t(27,12,26,10,24,new Ci(14,new Ai(1,16))),new t(28,12,36,10,16,new Ci(18,new Ai(1,22))),new t(29,16,36,14,16,new Ci(24,new Ai(1,32))),new t(30,16,48,14,22,new Ci(28,new Ai(1,49)))]},t.VERSIONS=t.buildVersions(),t}(),Ii=function(){function t(e){var r=e.getHeight();if(r<8||r>144||1&r)throw new Vr;this.version=t.readVersion(e),this.mappingBitMatrix=this.extractDataRegion(e),this.readMappingMatrix=new Yr(this.mappingBitMatrix.getWidth(),this.mappingBitMatrix.getHeight())}return t.prototype.getVersion=function(){return this.version},t.readVersion=function(t){var e=t.getHeight(),r=t.getWidth();return Ei.getVersionForDimensions(e,r)},t.prototype.readCodewords=function(){var t=new Int8Array(this.version.getTotalCodewords()),e=0,r=4,n=0,o=this.mappingBitMatrix.getHeight(),i=this.mappingBitMatrix.getWidth(),a=!1,s=!1,u=!1,l=!1;do{if(r!==o||0!==n||a)if(r===o-2&&0===n&&3&i&&!s)t[e++]=255&this.readCorner2(o,i),r-=2,n+=2,s=!0;else if(r!==o+4||2!==n||7&i||u)if(r!==o-2||0!==n||4!=(7&i)||l){do{r<o&&n>=0&&!this.readMappingMatrix.get(n,r)&&(t[e++]=255&this.readUtah(r,n,o,i)),r-=2,n+=2}while(r>=0&&n<i);r+=1,n+=3;do{r>=0&&n<i&&!this.readMappingMatrix.get(n,r)&&(t[e++]=255&this.readUtah(r,n,o,i)),r+=2,n-=2}while(r<o&&n>=0);r+=3,n+=1}else t[e++]=255&this.readCorner4(o,i),r-=2,n+=2,l=!0;else t[e++]=255&this.readCorner3(o,i),r-=2,n+=2,u=!0;else t[e++]=255&this.readCorner1(o,i),r-=2,n+=2,a=!0}while(r<o||n<i);if(e!==this.version.getTotalCodewords())throw new Vr;return t},t.prototype.readModule=function(t,e,r,n){return t<0&&(t+=r,e+=4-(r+4&7)),e<0&&(e+=n,t+=4-(n+4&7)),this.readMappingMatrix.set(e,t),this.mappingBitMatrix.get(e,t)},t.prototype.readUtah=function(t,e,r,n){var o=0;return this.readModule(t-2,e-2,r,n)&&(o|=1),o<<=1,this.readModule(t-2,e-1,r,n)&&(o|=1),o<<=1,this.readModule(t-1,e-2,r,n)&&(o|=1),o<<=1,this.readModule(t-1,e-1,r,n)&&(o|=1),o<<=1,this.readModule(t-1,e,r,n)&&(o|=1),o<<=1,this.readModule(t,e-2,r,n)&&(o|=1),o<<=1,this.readModule(t,e-1,r,n)&&(o|=1),o<<=1,this.readModule(t,e,r,n)&&(o|=1),o},t.prototype.readCorner1=function(t,e){var r=0;return this.readModule(t-1,0,t,e)&&(r|=1),r<<=1,this.readModule(t-1,1,t,e)&&(r|=1),r<<=1,this.readModule(t-1,2,t,e)&&(r|=1),r<<=1,this.readModule(0,e-2,t,e)&&(r|=1),r<<=1,this.readModule(0,e-1,t,e)&&(r|=1),r<<=1,this.readModule(1,e-1,t,e)&&(r|=1),r<<=1,this.readModule(2,e-1,t,e)&&(r|=1),r<<=1,this.readModule(3,e-1,t,e)&&(r|=1),r},t.prototype.readCorner2=function(t,e){var r=0;return this.readModule(t-3,0,t,e)&&(r|=1),r<<=1,this.readModule(t-2,0,t,e)&&(r|=1),r<<=1,this.readModule(t-1,0,t,e)&&(r|=1),r<<=1,this.readModule(0,e-4,t,e)&&(r|=1),r<<=1,this.readModule(0,e-3,t,e)&&(r|=1),r<<=1,this.readModule(0,e-2,t,e)&&(r|=1),r<<=1,this.readModule(0,e-1,t,e)&&(r|=1),r<<=1,this.readModule(1,e-1,t,e)&&(r|=1),r},t.prototype.readCorner3=function(t,e){var r=0;return this.readModule(t-1,0,t,e)&&(r|=1),r<<=1,this.readModule(t-1,e-1,t,e)&&(r|=1),r<<=1,this.readModule(0,e-3,t,e)&&(r|=1),r<<=1,this.readModule(0,e-2,t,e)&&(r|=1),r<<=1,this.readModule(0,e-1,t,e)&&(r|=1),r<<=1,this.readModule(1,e-3,t,e)&&(r|=1),r<<=1,this.readModule(1,e-2,t,e)&&(r|=1),r<<=1,this.readModule(1,e-1,t,e)&&(r|=1),r},t.prototype.readCorner4=function(t,e){var r=0;return this.readModule(t-3,0,t,e)&&(r|=1),r<<=1,this.readModule(t-2,0,t,e)&&(r|=1),r<<=1,this.readModule(t-1,0,t,e)&&(r|=1),r<<=1,this.readModule(0,e-2,t,e)&&(r|=1),r<<=1,this.readModule(0,e-1,t,e)&&(r|=1),r<<=1,this.readModule(1,e-1,t,e)&&(r|=1),r<<=1,this.readModule(2,e-1,t,e)&&(r|=1),r<<=1,this.readModule(3,e-1,t,e)&&(r|=1),r},t.prototype.extractDataRegion=function(t){var e=this.version.getSymbolSizeRows(),r=this.version.getSymbolSizeColumns();if(t.getHeight()!==e)throw new Er("Dimension of bitMatrix must match the version size");for(var n=this.version.getDataRegionSizeRows(),o=this.version.getDataRegionSizeColumns(),i=e/n|0,a=r/o|0,s=new Yr(a*o,i*n),u=0;u<i;++u)for(var l=u*n,c=0;c<a;++c)for(var h=c*o,f=0;f<n;++f)for(var d=u*(n+2)+1+f,p=l+f,g=0;g<o;++g){var m=c*(o+2)+1+g;if(t.get(m,d)){var v=h+g;s.set(v,p)}}return s},t}(),Si=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},xi=function(){function t(t,e){this.numDataCodewords=t,this.codewords=e}return t.getDataBlocks=function(e,r){var n,o,i,a,s=r.getECBlocks(),u=0,l=s.getECBlocks();try{for(var c=Si(l),h=c.next();!h.done;h=c.next())u+=(m=h.value).getCount()}catch(T){n={error:T}}finally{try{h&&!h.done&&(o=c.return)&&o.call(c)}finally{if(n)throw n.error}}var f=new Array(u),d=0;try{for(var p=Si(l),g=p.next();!g.done;g=p.next())for(var m=g.value,v=0;v<m.getCount();v++){var y=m.getDataCodewords(),_=s.getECCodewords()+y;f[d++]=new t(y,new Uint8Array(_))}}catch(T){i={error:T}}finally{try{g&&!g.done&&(a=p.return)&&a.call(p)}finally{if(i)throw i.error}}var w=f[0].codewords.length-s.getECCodewords(),b=w-1,C=0;for(v=0;v<b;v++)for(var A=0;A<d;A++)f[A].codewords[v]=e[C++];var E=24===r.getVersionNumber(),I=E?8:d;for(A=0;A<I;A++)f[A].codewords[w-1]=e[C++];var S=f[0].codewords.length;for(v=w;v<S;v++)for(A=0;A<d;A++){var x=E?(A+8)%d:A,O=E&&x>7?v-1:v;f[x].codewords[O]=e[C++]}if(C!==e.length)throw new Er;return f},t.prototype.getNumDataCodewords=function(){return this.numDataCodewords},t.prototype.getCodewords=function(){return this.codewords},t}(),Oi=function(){function t(t){this.bytes=t,this.byteOffset=0,this.bitOffset=0}return t.prototype.getBitOffset=function(){return this.bitOffset},t.prototype.getByteOffset=function(){return this.byteOffset},t.prototype.readBits=function(t){if(t<1||t>32||t>this.available())throw new Er(""+t);var e=0,r=this.bitOffset,n=this.byteOffset,o=this.bytes;if(r>0){var i=8-r,a=t<i?t:i,s=255>>8-a<<(u=i-a);e=(o[n]&s)>>u,t-=a,8===(r+=a)&&(r=0,n++)}if(t>0){for(;t>=8;)e=e<<8|255&o[n],n++,t-=8;var u;if(t>0)s=255>>(u=8-t)<<u,e=e<<t|(o[n]&s)>>u,r+=t}return this.bitOffset=r,this.byteOffset=n,e},t.prototype.available=function(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset},t}();!function(t){t[t.PAD_ENCODE=0]="PAD_ENCODE",t[t.ASCII_ENCODE=1]="ASCII_ENCODE",t[t.C40_ENCODE=2]="C40_ENCODE",t[t.TEXT_ENCODE=3]="TEXT_ENCODE",t[t.ANSIX12_ENCODE=4]="ANSIX12_ENCODE",t[t.EDIFACT_ENCODE=5]="EDIFACT_ENCODE",t[t.BASE256_ENCODE=6]="BASE256_ENCODE"}(wi||(wi={}));var Ti,Ni=function(){function t(){}return t.decode=function(t){var e=new Oi(t),r=new $r,n=new $r,o=new Array,i=wi.ASCII_ENCODE;do{if(i===wi.ASCII_ENCODE)i=this.decodeAsciiSegment(e,r,n);else{switch(i){case wi.C40_ENCODE:this.decodeC40Segment(e,r);break;case wi.TEXT_ENCODE:this.decodeTextSegment(e,r);break;case wi.ANSIX12_ENCODE:this.decodeAnsiX12Segment(e,r);break;case wi.EDIFACT_ENCODE:this.decodeEdifactSegment(e,r);break;case wi.BASE256_ENCODE:this.decodeBase256Segment(e,r,o);break;default:throw new Vr}i=wi.ASCII_ENCODE}}while(i!==wi.PAD_ENCODE&&e.available()>0);return n.length()>0&&r.append(n.toString()),new mn(t,r.toString(),0===o.length?null:o,null)},t.decodeAsciiSegment=function(t,e,r){var n=!1;do{var o=t.readBits(8);if(0===o)throw new Vr;if(o<=128)return n&&(o+=128),e.append(String.fromCharCode(o-1)),wi.ASCII_ENCODE;if(129===o)return wi.PAD_ENCODE;if(o<=229){var i=o-130;i<10&&e.append("0"),e.append(""+i)}else switch(o){case 230:return wi.C40_ENCODE;case 231:return wi.BASE256_ENCODE;case 232:e.append(String.fromCharCode(29));break;case 233:case 234:case 241:break;case 235:n=!0;break;case 236:e.append("[)>05"),r.insert(0,"");break;case 237:e.append("[)>06"),r.insert(0,"");break;case 238:return wi.ANSIX12_ENCODE;case 239:return wi.TEXT_ENCODE;case 240:return wi.EDIFACT_ENCODE;default:if(254!==o||0!==t.available())throw new Vr}}while(t.available()>0);return wi.ASCII_ENCODE},t.decodeC40Segment=function(t,e){var r=!1,n=[],o=0;do{if(8===t.available())return;var i=t.readBits(8);if(254===i)return;this.parseTwoBytes(i,t.readBits(8),n);for(var a=0;a<3;a++){var s=n[a];switch(o){case 0:if(s<3)o=s+1;else{if(!(s<this.C40_BASIC_SET_CHARS.length))throw new Vr;var u=this.C40_BASIC_SET_CHARS[s];r?(e.append(String.fromCharCode(u.charCodeAt(0)+128)),r=!1):e.append(u)}break;case 1:r?(e.append(String.fromCharCode(s+128)),r=!1):e.append(String.fromCharCode(s)),o=0;break;case 2:if(s<this.C40_SHIFT2_SET_CHARS.length)u=this.C40_SHIFT2_SET_CHARS[s],r?(e.append(String.fromCharCode(u.charCodeAt(0)+128)),r=!1):e.append(u);else switch(s){case 27:e.append(String.fromCharCode(29));break;case 30:r=!0;break;default:throw new Vr}o=0;break;case 3:r?(e.append(String.fromCharCode(s+224)),r=!1):e.append(String.fromCharCode(s+96)),o=0;break;default:throw new Vr}}}while(t.available()>0)},t.decodeTextSegment=function(t,e){var r=!1,n=[],o=0;do{if(8===t.available())return;var i=t.readBits(8);if(254===i)return;this.parseTwoBytes(i,t.readBits(8),n);for(var a=0;a<3;a++){var s=n[a];switch(o){case 0:if(s<3)o=s+1;else{if(!(s<this.TEXT_BASIC_SET_CHARS.length))throw new Vr;var u=this.TEXT_BASIC_SET_CHARS[s];r?(e.append(String.fromCharCode(u.charCodeAt(0)+128)),r=!1):e.append(u)}break;case 1:r?(e.append(String.fromCharCode(s+128)),r=!1):e.append(String.fromCharCode(s)),o=0;break;case 2:if(s<this.TEXT_SHIFT2_SET_CHARS.length)u=this.TEXT_SHIFT2_SET_CHARS[s],r?(e.append(String.fromCharCode(u.charCodeAt(0)+128)),r=!1):e.append(u);else switch(s){case 27:e.append(String.fromCharCode(29));break;case 30:r=!0;break;default:throw new Vr}o=0;break;case 3:if(!(s<this.TEXT_SHIFT3_SET_CHARS.length))throw new Vr;u=this.TEXT_SHIFT3_SET_CHARS[s],r?(e.append(String.fromCharCode(u.charCodeAt(0)+128)),r=!1):e.append(u),o=0;break;default:throw new Vr}}}while(t.available()>0)},t.decodeAnsiX12Segment=function(t,e){var r=[];do{if(8===t.available())return;var n=t.readBits(8);if(254===n)return;this.parseTwoBytes(n,t.readBits(8),r);for(var o=0;o<3;o++){var i=r[o];switch(i){case 0:e.append("\r");break;case 1:e.append("*");break;case 2:e.append(">");break;case 3:e.append(" ");break;default:if(i<14)e.append(String.fromCharCode(i+44));else{if(!(i<40))throw new Vr;e.append(String.fromCharCode(i+51))}}}}while(t.available()>0)},t.parseTwoBytes=function(t,e,r){var n=(t<<8)+e-1,o=Math.floor(n/1600);r[0]=o,n-=1600*o,o=Math.floor(n/40),r[1]=o,r[2]=n-40*o},t.decodeEdifactSegment=function(t,e){do{if(t.available()<=16)return;for(var r=0;r<4;r++){var n=t.readBits(6);if(31===n){var o=8-t.getBitOffset();return void(8!==o&&t.readBits(o))}!(32&n)&&(n|=64),e.append(String.fromCharCode(n))}}while(t.available()>0)},t.decodeBase256Segment=function(t,e,r){var n,o=1+t.getByteOffset(),i=this.unrandomize255State(t.readBits(8),o++);if((n=0===i?t.available()/8|0:i<250?i:250*(i-249)+this.unrandomize255State(t.readBits(8),o++))<0)throw new Vr;for(var a=new Uint8Array(n),s=0;s<n;s++){if(t.available()<8)throw new Vr;a[s]=this.unrandomize255State(t.readBits(8),o++)}r.push(a);try{e.append(Gr.decode(a,Xr.ISO88591))}catch(u){throw new Sn("Platform does not support required encoding: "+u.message)}},t.unrandomize255State=function(t,e){var r=t-(149*e%255+1);return r>=0?r:r+256},t.C40_BASIC_SET_CHARS=["*","*","*"," ","0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],t.C40_SHIFT2_SET_CHARS=["!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","@","[","\\","]","^","_"],t.TEXT_BASIC_SET_CHARS=["*","*","*"," ","0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],t.TEXT_SHIFT2_SET_CHARS=t.C40_SHIFT2_SET_CHARS,t.TEXT_SHIFT3_SET_CHARS=["`","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","{","|","}","~",String.fromCharCode(127)],t}(),ki=function(){function t(){this.rsDecoder=new xn(Cn.DATA_MATRIX_FIELD_256)}return t.prototype.decode=function(t){var e,r,n=new Ii(t),o=n.getVersion(),i=n.readCodewords(),a=xi.getDataBlocks(i,o),s=0;try{for(var u=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(a),l=u.next();!l.done;l=u.next())s+=l.value.getNumDataCodewords()}catch(v){e={error:v}}finally{try{l&&!l.done&&(r=u.return)&&r.call(u)}finally{if(e)throw e.error}}for(var c=new Uint8Array(s),h=a.length,f=0;f<h;f++){var d=a[f],p=d.getCodewords(),g=d.getNumDataCodewords();this.correctErrors(p,g);for(var m=0;m<g;m++)c[m*h+f]=p[m]}return Ni.decode(c)},t.prototype.correctErrors=function(t,e){var r=new Int32Array(t);try{this.rsDecoder.decode(r,t.length-e)}catch(o){throw new xr}for(var n=0;n<e;n++)t[n]=r[n]},t}(),Ri=function(){function t(t){this.image=t,this.rectangleDetector=new Mn(this.image)}return t.prototype.detect=function(){var e=this.rectangleDetector.detect(),r=this.detectSolid1(e);if((r=this.detectSolid2(r))[3]=this.correctTopRight(r),!r[3])throw new Kr;var n=(r=this.shiftToModuleCenter(r))[0],o=r[1],i=r[2],a=r[3],s=this.transitionsBetween(n,a)+1,u=this.transitionsBetween(i,a)+1;!(1&~s)&&(s+=1),!(1&~u)&&(u+=1),4*s<7*u&&4*u<7*s&&(s=u=Math.max(s,u));var l=t.sampleGrid(this.image,n,o,i,a,s,u);return new Rn(l,[n,o,i,a])},t.shiftPoint=function(t,e,r){var n=(e.getX()-t.getX())/(r+1),o=(e.getY()-t.getY())/(r+1);return new kn(t.getX()+n,t.getY()+o)},t.moveAway=function(t,e,r){var n=t.getX(),o=t.getY();return n<e?n-=1:n+=1,o<r?o-=1:o+=1,new kn(n,o)},t.prototype.detectSolid1=function(t){var e=t[0],r=t[1],n=t[3],o=t[2],i=this.transitionsBetween(e,r),a=this.transitionsBetween(r,n),s=this.transitionsBetween(n,o),u=this.transitionsBetween(o,e),l=i,c=[o,e,r,n];return l>a&&(l=a,c[0]=e,c[1]=r,c[2]=n,c[3]=o),l>s&&(l=s,c[0]=r,c[1]=n,c[2]=o,c[3]=e),l>u&&(c[0]=n,c[1]=o,c[2]=e,c[3]=r),c},t.prototype.detectSolid2=function(e){var r=e[0],n=e[1],o=e[2],i=e[3],a=this.transitionsBetween(r,i),s=t.shiftPoint(n,o,4*(a+1)),u=t.shiftPoint(o,n,4*(a+1));return this.transitionsBetween(s,r)<this.transitionsBetween(u,i)?(e[0]=r,e[1]=n,e[2]=o,e[3]=i):(e[0]=n,e[1]=o,e[2]=i,e[3]=r),e},t.prototype.correctTopRight=function(e){var r=e[0],n=e[1],o=e[2],i=e[3],a=this.transitionsBetween(r,i),s=this.transitionsBetween(n,i),u=t.shiftPoint(r,n,4*(s+1)),l=t.shiftPoint(o,n,4*(a+1));a=this.transitionsBetween(u,i),s=this.transitionsBetween(l,i);var c=new kn(i.getX()+(o.getX()-n.getX())/(a+1),i.getY()+(o.getY()-n.getY())/(a+1)),h=new kn(i.getX()+(r.getX()-n.getX())/(s+1),i.getY()+(r.getY()-n.getY())/(s+1));return this.isValid(c)?this.isValid(h)?this.transitionsBetween(u,c)+this.transitionsBetween(l,c)>this.transitionsBetween(u,h)+this.transitionsBetween(l,h)?c:h:c:this.isValid(h)?h:null},t.prototype.shiftToModuleCenter=function(e){var r=e[0],n=e[1],o=e[2],i=e[3],a=this.transitionsBetween(r,i)+1,s=this.transitionsBetween(o,i)+1,u=t.shiftPoint(r,n,4*s),l=t.shiftPoint(o,n,4*a);!(1&~(a=this.transitionsBetween(u,i)+1))&&(a+=1),!(1&~(s=this.transitionsBetween(l,i)+1))&&(s+=1);var c,h,f=(r.getX()+n.getX()+o.getX()+i.getX())/4,d=(r.getY()+n.getY()+o.getY()+i.getY())/4;return r=t.moveAway(r,f,d),n=t.moveAway(n,f,d),o=t.moveAway(o,f,d),i=t.moveAway(i,f,d),u=t.shiftPoint(r,n,4*s),u=t.shiftPoint(u,i,4*a),c=t.shiftPoint(n,r,4*s),c=t.shiftPoint(c,o,4*a),l=t.shiftPoint(o,i,4*s),l=t.shiftPoint(l,n,4*a),h=t.shiftPoint(i,o,4*s),[u,c,l,h=t.shiftPoint(h,r,4*a)]},t.prototype.isValid=function(t){return t.getX()>=0&&t.getX()<this.image.getWidth()&&t.getY()>0&&t.getY()<this.image.getHeight()},t.sampleGrid=function(t,e,r,n,o,i,a){return Vn.getInstance().sampleGrid(t,i,a,.5,.5,i-.5,.5,i-.5,a-.5,.5,a-.5,e.getX(),e.getY(),o.getX(),o.getY(),n.getX(),n.getY(),r.getX(),r.getY())},t.prototype.transitionsBetween=function(t,e){var r=Math.trunc(t.getX()),n=Math.trunc(t.getY()),o=Math.trunc(e.getX()),i=Math.trunc(e.getY()),a=Math.abs(i-n)>Math.abs(o-r);if(a){var s=r;r=n,n=s,s=o,o=i,i=s}for(var u=Math.abs(o-r),l=Math.abs(i-n),c=-u/2,h=n<i?1:-1,f=r<o?1:-1,d=0,p=this.image.get(a?n:r,a?r:n),g=r,m=n;g!==o;g+=f){var v=this.image.get(a?m:g,a?g:m);if(v!==p&&(d++,p=v),(c+=l)>0){if(m===i)break;m+=h,c-=u}}return d},t}(),Di=function(){function t(){this.decoder=new ki}return t.prototype.decode=function(e,r){var n,o;if(void 0===r&&(r=null),null!=r&&r.has(Fr.PURE_BARCODE)){var i=t.extractPureBits(e.getBlackMatrix());n=this.decoder.decode(i),o=t.NO_POINTS}else{var a=new Ri(e.getBlackMatrix()).detect();n=this.decoder.decode(a.getBits()),o=a.getPoints()}var s=n.getRawBytes(),u=new hn(n.getText(),s,8*s.length,o,dn.DATA_MATRIX,Tr.currentTimeMillis()),l=n.getByteSegments();null!=l&&u.putMetadata(gn.BYTE_SEGMENTS,l);var c=n.getECLevel();return null!=c&&u.putMetadata(gn.ERROR_CORRECTION_LEVEL,c),u},t.prototype.reset=function(){},t.extractPureBits=function(t){var e=t.getTopLeftOnBit(),r=t.getBottomRightOnBit();if(null==e||null==r)throw new Kr;var n=this.moduleSize(e,t),o=e[1],i=r[1],a=e[0],s=(r[0]-a+1)/n,u=(i-o+1)/n;if(s<=0||u<=0)throw new Kr;var l=n/2;o+=l,a+=l;for(var c=new Yr(s,u),h=0;h<u;h++)for(var f=o+h*n,d=0;d<s;d++)t.get(a+d*n,f)&&c.set(d,h);return c},t.moduleSize=function(t,e){for(var r=e.getWidth(),n=t[0],o=t[1];n<r&&e.get(n,o);)n++;if(n===r)throw new Kr;var i=n-t[0];if(0===i)throw new Kr;return i},t.NO_POINTS=[],t}(),Pi=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){Pi(function(e){return void 0===e&&(e=500),t.call(this,new Di,e)||this},t)}(cn),function(t){t[t.L=0]="L",t[t.M=1]="M",t[t.Q=2]="Q",t[t.H=3]="H"}(Ti||(Ti={}));var Mi,Bi=function(){function t(e,r,n){this.value=e,this.stringValue=r,this.bits=n,t.FOR_BITS.set(n,this),t.FOR_VALUE.set(e,this)}return t.prototype.getValue=function(){return this.value},t.prototype.getBits=function(){return this.bits},t.fromString=function(e){switch(e){case"L":return t.L;case"M":return t.M;case"Q":return t.Q;case"H":return t.H;default:throw new Cr(e+"not available")}},t.prototype.toString=function(){return this.stringValue},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var r=e;return this.value===r.value},t.forBits=function(e){if(e<0||e>=t.FOR_BITS.size)throw new Er;return t.FOR_BITS.get(e)},t.FOR_BITS=new Map,t.FOR_VALUE=new Map,t.L=new t(Ti.L,"L",1),t.M=new t(Ti.M,"M",0),t.Q=new t(Ti.Q,"Q",3),t.H=new t(Ti.H,"H",2),t}(),Li=function(){function t(t){this.errorCorrectionLevel=Bi.forBits(t>>3&3),this.dataMask=7&t}return t.numBitsDiffering=function(t,e){return Mr.bitCount(t^e)},t.decodeFormatInformation=function(e,r){var n=t.doDecodeFormatInformation(e,r);return null!==n?n:t.doDecodeFormatInformation(e^t.FORMAT_INFO_MASK_QR,r^t.FORMAT_INFO_MASK_QR)},t.doDecodeFormatInformation=function(e,r){var n,o,i=Number.MAX_SAFE_INTEGER,a=0;try{for(var s=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(t.FORMAT_INFO_DECODE_LOOKUP),u=s.next();!u.done;u=s.next()){var l=u.value,c=l[0];if(c===e||c===r)return new t(l[1]);var h=t.numBitsDiffering(e,c);h<i&&(a=l[1],i=h),e!==r&&(h=t.numBitsDiffering(r,c))<i&&(a=l[1],i=h)}}catch(f){n={error:f}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(n)throw n.error}}return i<=3?new t(a):null},t.prototype.getErrorCorrectionLevel=function(){return this.errorCorrectionLevel},t.prototype.getDataMask=function(){return this.dataMask},t.prototype.hashCode=function(){return this.errorCorrectionLevel.getBits()<<3|this.dataMask},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var r=e;return this.errorCorrectionLevel===r.errorCorrectionLevel&&this.dataMask===r.dataMask},t.FORMAT_INFO_MASK_QR=21522,t.FORMAT_INFO_DECODE_LOOKUP=[Int32Array.from([21522,0]),Int32Array.from([20773,1]),Int32Array.from([24188,2]),Int32Array.from([23371,3]),Int32Array.from([17913,4]),Int32Array.from([16590,5]),Int32Array.from([20375,6]),Int32Array.from([19104,7]),Int32Array.from([30660,8]),Int32Array.from([29427,9]),Int32Array.from([32170,10]),Int32Array.from([30877,11]),Int32Array.from([26159,12]),Int32Array.from([25368,13]),Int32Array.from([27713,14]),Int32Array.from([26998,15]),Int32Array.from([5769,16]),Int32Array.from([5054,17]),Int32Array.from([7399,18]),Int32Array.from([6608,19]),Int32Array.from([1890,20]),Int32Array.from([597,21]),Int32Array.from([3340,22]),Int32Array.from([2107,23]),Int32Array.from([13663,24]),Int32Array.from([12392,25]),Int32Array.from([16177,26]),Int32Array.from([14854,27]),Int32Array.from([9396,28]),Int32Array.from([8579,29]),Int32Array.from([11994,30]),Int32Array.from([11245,31])],t}(),Fi=function(){function t(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];this.ecCodewordsPerBlock=t,this.ecBlocks=e}return t.prototype.getECCodewordsPerBlock=function(){return this.ecCodewordsPerBlock},t.prototype.getNumBlocks=function(){var t,e,r=0,n=this.ecBlocks;try{for(var o=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(n),i=o.next();!i.done;i=o.next())r+=i.value.getCount()}catch(a){t={error:a}}finally{try{i&&!i.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}return r},t.prototype.getTotalECCodewords=function(){return this.ecCodewordsPerBlock*this.getNumBlocks()},t.prototype.getECBlocks=function(){return this.ecBlocks},t}(),ji=function(){function t(t,e){this.count=t,this.dataCodewords=e}return t.prototype.getCount=function(){return this.count},t.prototype.getDataCodewords=function(){return this.dataCodewords},t}(),Vi=function(){function t(t,e){for(var r,n,o=[],i=2;i<arguments.length;i++)o[i-2]=arguments[i];this.versionNumber=t,this.alignmentPatternCenters=e,this.ecBlocks=o;var a=0,s=o[0].getECCodewordsPerBlock(),u=o[0].getECBlocks();try{for(var l=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(u),c=l.next();!c.done;c=l.next()){var h=c.value;a+=h.getCount()*(h.getDataCodewords()+s)}}catch(f){r={error:f}}finally{try{c&&!c.done&&(n=l.return)&&n.call(l)}finally{if(r)throw r.error}}this.totalCodewords=a}return t.prototype.getVersionNumber=function(){return this.versionNumber},t.prototype.getAlignmentPatternCenters=function(){return this.alignmentPatternCenters},t.prototype.getTotalCodewords=function(){return this.totalCodewords},t.prototype.getDimensionForVersion=function(){return 17+4*this.versionNumber},t.prototype.getECBlocksForLevel=function(t){return this.ecBlocks[t.getValue()]},t.getProvisionalVersionForDimension=function(t){if(t%4!=1)throw new Vr;try{return this.getVersionForNumber((t-17)/4)}catch(e){throw new Vr}},t.getVersionForNumber=function(e){if(e<1||e>40)throw new Er;return t.VERSIONS[e-1]},t.decodeVersionInformation=function(e){for(var r=Number.MAX_SAFE_INTEGER,n=0,o=0;o<t.VERSION_DECODE_INFO.length;o++){var i=t.VERSION_DECODE_INFO[o];if(i===e)return t.getVersionForNumber(o+7);var a=Li.numBitsDiffering(e,i);a<r&&(n=o+7,r=a)}return r<=3?t.getVersionForNumber(n):null},t.prototype.buildFunctionPattern=function(){var t=this.getDimensionForVersion(),e=new Yr(t);e.setRegion(0,0,9,9),e.setRegion(t-8,0,8,9),e.setRegion(0,t-8,9,8);for(var r=this.alignmentPatternCenters.length,n=0;n<r;n++)for(var o=this.alignmentPatternCenters[n]-2,i=0;i<r;i++)0===n&&(0===i||i===r-1)||n===r-1&&0===i||e.setRegion(this.alignmentPatternCenters[i]-2,o,5,5);return e.setRegion(6,9,1,t-17),e.setRegion(9,6,t-17,1),this.versionNumber>6&&(e.setRegion(t-11,0,3,6),e.setRegion(0,t-11,6,3)),e},t.prototype.toString=function(){return""+this.versionNumber},t.VERSION_DECODE_INFO=Int32Array.from([31892,34236,39577,42195,48118,51042,55367,58893,63784,68472,70749,76311,79154,84390,87683,92361,96236,102084,102881,110507,110734,117786,119615,126325,127568,133589,136944,141498,145311,150283,152622,158308,161089,167017]),t.VERSIONS=[new t(1,new Int32Array(0),new Fi(7,new ji(1,19)),new Fi(10,new ji(1,16)),new Fi(13,new ji(1,13)),new Fi(17,new ji(1,9))),new t(2,Int32Array.from([6,18]),new Fi(10,new ji(1,34)),new Fi(16,new ji(1,28)),new Fi(22,new ji(1,22)),new Fi(28,new ji(1,16))),new t(3,Int32Array.from([6,22]),new Fi(15,new ji(1,55)),new Fi(26,new ji(1,44)),new Fi(18,new ji(2,17)),new Fi(22,new ji(2,13))),new t(4,Int32Array.from([6,26]),new Fi(20,new ji(1,80)),new Fi(18,new ji(2,32)),new Fi(26,new ji(2,24)),new Fi(16,new ji(4,9))),new t(5,Int32Array.from([6,30]),new Fi(26,new ji(1,108)),new Fi(24,new ji(2,43)),new Fi(18,new ji(2,15),new ji(2,16)),new Fi(22,new ji(2,11),new ji(2,12))),new t(6,Int32Array.from([6,34]),new Fi(18,new ji(2,68)),new Fi(16,new ji(4,27)),new Fi(24,new ji(4,19)),new Fi(28,new ji(4,15))),new t(7,Int32Array.from([6,22,38]),new Fi(20,new ji(2,78)),new Fi(18,new ji(4,31)),new Fi(18,new ji(2,14),new ji(4,15)),new Fi(26,new ji(4,13),new ji(1,14))),new t(8,Int32Array.from([6,24,42]),new Fi(24,new ji(2,97)),new Fi(22,new ji(2,38),new ji(2,39)),new Fi(22,new ji(4,18),new ji(2,19)),new Fi(26,new ji(4,14),new ji(2,15))),new t(9,Int32Array.from([6,26,46]),new Fi(30,new ji(2,116)),new Fi(22,new ji(3,36),new ji(2,37)),new Fi(20,new ji(4,16),new ji(4,17)),new Fi(24,new ji(4,12),new ji(4,13))),new t(10,Int32Array.from([6,28,50]),new Fi(18,new ji(2,68),new ji(2,69)),new Fi(26,new ji(4,43),new ji(1,44)),new Fi(24,new ji(6,19),new ji(2,20)),new Fi(28,new ji(6,15),new ji(2,16))),new t(11,Int32Array.from([6,30,54]),new Fi(20,new ji(4,81)),new Fi(30,new ji(1,50),new ji(4,51)),new Fi(28,new ji(4,22),new ji(4,23)),new Fi(24,new ji(3,12),new ji(8,13))),new t(12,Int32Array.from([6,32,58]),new Fi(24,new ji(2,92),new ji(2,93)),new Fi(22,new ji(6,36),new ji(2,37)),new Fi(26,new ji(4,20),new ji(6,21)),new Fi(28,new ji(7,14),new ji(4,15))),new t(13,Int32Array.from([6,34,62]),new Fi(26,new ji(4,107)),new Fi(22,new ji(8,37),new ji(1,38)),new Fi(24,new ji(8,20),new ji(4,21)),new Fi(22,new ji(12,11),new ji(4,12))),new t(14,Int32Array.from([6,26,46,66]),new Fi(30,new ji(3,115),new ji(1,116)),new Fi(24,new ji(4,40),new ji(5,41)),new Fi(20,new ji(11,16),new ji(5,17)),new Fi(24,new ji(11,12),new ji(5,13))),new t(15,Int32Array.from([6,26,48,70]),new Fi(22,new ji(5,87),new ji(1,88)),new Fi(24,new ji(5,41),new ji(5,42)),new Fi(30,new ji(5,24),new ji(7,25)),new Fi(24,new ji(11,12),new ji(7,13))),new t(16,Int32Array.from([6,26,50,74]),new Fi(24,new ji(5,98),new ji(1,99)),new Fi(28,new ji(7,45),new ji(3,46)),new Fi(24,new ji(15,19),new ji(2,20)),new Fi(30,new ji(3,15),new ji(13,16))),new t(17,Int32Array.from([6,30,54,78]),new Fi(28,new ji(1,107),new ji(5,108)),new Fi(28,new ji(10,46),new ji(1,47)),new Fi(28,new ji(1,22),new ji(15,23)),new Fi(28,new ji(2,14),new ji(17,15))),new t(18,Int32Array.from([6,30,56,82]),new Fi(30,new ji(5,120),new ji(1,121)),new Fi(26,new ji(9,43),new ji(4,44)),new Fi(28,new ji(17,22),new ji(1,23)),new Fi(28,new ji(2,14),new ji(19,15))),new t(19,Int32Array.from([6,30,58,86]),new Fi(28,new ji(3,113),new ji(4,114)),new Fi(26,new ji(3,44),new ji(11,45)),new Fi(26,new ji(17,21),new ji(4,22)),new Fi(26,new ji(9,13),new ji(16,14))),new t(20,Int32Array.from([6,34,62,90]),new Fi(28,new ji(3,107),new ji(5,108)),new Fi(26,new ji(3,41),new ji(13,42)),new Fi(30,new ji(15,24),new ji(5,25)),new Fi(28,new ji(15,15),new ji(10,16))),new t(21,Int32Array.from([6,28,50,72,94]),new Fi(28,new ji(4,116),new ji(4,117)),new Fi(26,new ji(17,42)),new Fi(28,new ji(17,22),new ji(6,23)),new Fi(30,new ji(19,16),new ji(6,17))),new t(22,Int32Array.from([6,26,50,74,98]),new Fi(28,new ji(2,111),new ji(7,112)),new Fi(28,new ji(17,46)),new Fi(30,new ji(7,24),new ji(16,25)),new Fi(24,new ji(34,13))),new t(23,Int32Array.from([6,30,54,78,102]),new Fi(30,new ji(4,121),new ji(5,122)),new Fi(28,new ji(4,47),new ji(14,48)),new Fi(30,new ji(11,24),new ji(14,25)),new Fi(30,new ji(16,15),new ji(14,16))),new t(24,Int32Array.from([6,28,54,80,106]),new Fi(30,new ji(6,117),new ji(4,118)),new Fi(28,new ji(6,45),new ji(14,46)),new Fi(30,new ji(11,24),new ji(16,25)),new Fi(30,new ji(30,16),new ji(2,17))),new t(25,Int32Array.from([6,32,58,84,110]),new Fi(26,new ji(8,106),new ji(4,107)),new Fi(28,new ji(8,47),new ji(13,48)),new Fi(30,new ji(7,24),new ji(22,25)),new Fi(30,new ji(22,15),new ji(13,16))),new t(26,Int32Array.from([6,30,58,86,114]),new Fi(28,new ji(10,114),new ji(2,115)),new Fi(28,new ji(19,46),new ji(4,47)),new Fi(28,new ji(28,22),new ji(6,23)),new Fi(30,new ji(33,16),new ji(4,17))),new t(27,Int32Array.from([6,34,62,90,118]),new Fi(30,new ji(8,122),new ji(4,123)),new Fi(28,new ji(22,45),new ji(3,46)),new Fi(30,new ji(8,23),new ji(26,24)),new Fi(30,new ji(12,15),new ji(28,16))),new t(28,Int32Array.from([6,26,50,74,98,122]),new Fi(30,new ji(3,117),new ji(10,118)),new Fi(28,new ji(3,45),new ji(23,46)),new Fi(30,new ji(4,24),new ji(31,25)),new Fi(30,new ji(11,15),new ji(31,16))),new t(29,Int32Array.from([6,30,54,78,102,126]),new Fi(30,new ji(7,116),new ji(7,117)),new Fi(28,new ji(21,45),new ji(7,46)),new Fi(30,new ji(1,23),new ji(37,24)),new Fi(30,new ji(19,15),new ji(26,16))),new t(30,Int32Array.from([6,26,52,78,104,130]),new Fi(30,new ji(5,115),new ji(10,116)),new Fi(28,new ji(19,47),new ji(10,48)),new Fi(30,new ji(15,24),new ji(25,25)),new Fi(30,new ji(23,15),new ji(25,16))),new t(31,Int32Array.from([6,30,56,82,108,134]),new Fi(30,new ji(13,115),new ji(3,116)),new Fi(28,new ji(2,46),new ji(29,47)),new Fi(30,new ji(42,24),new ji(1,25)),new Fi(30,new ji(23,15),new ji(28,16))),new t(32,Int32Array.from([6,34,60,86,112,138]),new Fi(30,new ji(17,115)),new Fi(28,new ji(10,46),new ji(23,47)),new Fi(30,new ji(10,24),new ji(35,25)),new Fi(30,new ji(19,15),new ji(35,16))),new t(33,Int32Array.from([6,30,58,86,114,142]),new Fi(30,new ji(17,115),new ji(1,116)),new Fi(28,new ji(14,46),new ji(21,47)),new Fi(30,new ji(29,24),new ji(19,25)),new Fi(30,new ji(11,15),new ji(46,16))),new t(34,Int32Array.from([6,34,62,90,118,146]),new Fi(30,new ji(13,115),new ji(6,116)),new Fi(28,new ji(14,46),new ji(23,47)),new Fi(30,new ji(44,24),new ji(7,25)),new Fi(30,new ji(59,16),new ji(1,17))),new t(35,Int32Array.from([6,30,54,78,102,126,150]),new Fi(30,new ji(12,121),new ji(7,122)),new Fi(28,new ji(12,47),new ji(26,48)),new Fi(30,new ji(39,24),new ji(14,25)),new Fi(30,new ji(22,15),new ji(41,16))),new t(36,Int32Array.from([6,24,50,76,102,128,154]),new Fi(30,new ji(6,121),new ji(14,122)),new Fi(28,new ji(6,47),new ji(34,48)),new Fi(30,new ji(46,24),new ji(10,25)),new Fi(30,new ji(2,15),new ji(64,16))),new t(37,Int32Array.from([6,28,54,80,106,132,158]),new Fi(30,new ji(17,122),new ji(4,123)),new Fi(28,new ji(29,46),new ji(14,47)),new Fi(30,new ji(49,24),new ji(10,25)),new Fi(30,new ji(24,15),new ji(46,16))),new t(38,Int32Array.from([6,32,58,84,110,136,162]),new Fi(30,new ji(4,122),new ji(18,123)),new Fi(28,new ji(13,46),new ji(32,47)),new Fi(30,new ji(48,24),new ji(14,25)),new Fi(30,new ji(42,15),new ji(32,16))),new t(39,Int32Array.from([6,26,54,82,110,138,166]),new Fi(30,new ji(20,117),new ji(4,118)),new Fi(28,new ji(40,47),new ji(7,48)),new Fi(30,new ji(43,24),new ji(22,25)),new Fi(30,new ji(10,15),new ji(67,16))),new t(40,Int32Array.from([6,30,58,86,114,142,170]),new Fi(30,new ji(19,118),new ji(6,119)),new Fi(28,new ji(18,47),new ji(31,48)),new Fi(30,new ji(34,24),new ji(34,25)),new Fi(30,new ji(20,15),new ji(61,16)))],t}();!function(t){t[t.DATA_MASK_000=0]="DATA_MASK_000",t[t.DATA_MASK_001=1]="DATA_MASK_001",t[t.DATA_MASK_010=2]="DATA_MASK_010",t[t.DATA_MASK_011=3]="DATA_MASK_011",t[t.DATA_MASK_100=4]="DATA_MASK_100",t[t.DATA_MASK_101=5]="DATA_MASK_101",t[t.DATA_MASK_110=6]="DATA_MASK_110",t[t.DATA_MASK_111=7]="DATA_MASK_111"}(Mi||(Mi={}));var Ui,Hi=function(){function t(t,e){this.value=t,this.isMasked=e}return t.prototype.unmaskBitMatrix=function(t,e){for(var r=0;r<e;r++)for(var n=0;n<e;n++)this.isMasked(r,n)&&t.flip(n,r)},t.values=new Map([[Mi.DATA_MASK_000,new t(Mi.DATA_MASK_000,function(t,e){return!(t+e&1)})],[Mi.DATA_MASK_001,new t(Mi.DATA_MASK_001,function(t,e){return!(1&t)})],[Mi.DATA_MASK_010,new t(Mi.DATA_MASK_010,function(t,e){return e%3==0})],[Mi.DATA_MASK_011,new t(Mi.DATA_MASK_011,function(t,e){return(t+e)%3==0})],[Mi.DATA_MASK_100,new t(Mi.DATA_MASK_100,function(t,e){return!(Math.floor(t/2)+Math.floor(e/3)&1)})],[Mi.DATA_MASK_101,new t(Mi.DATA_MASK_101,function(t,e){return t*e%6==0})],[Mi.DATA_MASK_110,new t(Mi.DATA_MASK_110,function(t,e){return t*e%6<3})],[Mi.DATA_MASK_111,new t(Mi.DATA_MASK_111,function(t,e){return!(t+e+t*e%3&1)})]]),t}(),zi=function(){function t(t){var e=t.getHeight();if(e<21||1!=(3&e))throw new Vr;this.bitMatrix=t}return t.prototype.readFormatInformation=function(){if(null!==this.parsedFormatInfo&&void 0!==this.parsedFormatInfo)return this.parsedFormatInfo;for(var t=0,e=0;e<6;e++)t=this.copyBit(e,8,t);t=this.copyBit(7,8,t),t=this.copyBit(8,8,t),t=this.copyBit(8,7,t);for(var r=5;r>=0;r--)t=this.copyBit(8,r,t);var n=this.bitMatrix.getHeight(),o=0,i=n-7;for(r=n-1;r>=i;r--)o=this.copyBit(8,r,o);for(e=n-8;e<n;e++)o=this.copyBit(e,8,o);if(this.parsedFormatInfo=Li.decodeFormatInformation(t,o),null!==this.parsedFormatInfo)return this.parsedFormatInfo;throw new Vr},t.prototype.readVersion=function(){if(null!==this.parsedVersion&&void 0!==this.parsedVersion)return this.parsedVersion;var t=this.bitMatrix.getHeight(),e=Math.floor((t-17)/4);if(e<=6)return Vi.getVersionForNumber(e);for(var r=0,n=t-11,o=5;o>=0;o--)for(var i=t-9;i>=n;i--)r=this.copyBit(i,o,r);var a=Vi.decodeVersionInformation(r);if(null!==a&&a.getDimensionForVersion()===t)return this.parsedVersion=a,a;for(r=0,i=5;i>=0;i--)for(o=t-9;o>=n;o--)r=this.copyBit(i,o,r);if(null!==(a=Vi.decodeVersionInformation(r))&&a.getDimensionForVersion()===t)return this.parsedVersion=a,a;throw new Vr},t.prototype.copyBit=function(t,e,r){return(this.isMirror?this.bitMatrix.get(e,t):this.bitMatrix.get(t,e))?r<<1|1:r<<1},t.prototype.readCodewords=function(){var t=this.readFormatInformation(),e=this.readVersion(),r=Hi.values.get(t.getDataMask()),n=this.bitMatrix.getHeight();r.unmaskBitMatrix(this.bitMatrix,n);for(var o=e.buildFunctionPattern(),i=!0,a=new Uint8Array(e.getTotalCodewords()),s=0,u=0,l=0,c=n-1;c>0;c-=2){6===c&&c--;for(var h=0;h<n;h++)for(var f=i?n-1-h:h,d=0;d<2;d++)o.get(c-d,f)||(l++,u<<=1,this.bitMatrix.get(c-d,f)&&(u|=1),8===l&&(a[s++]=u,l=0,u=0));i=!i}if(s!==e.getTotalCodewords())throw new Vr;return a},t.prototype.remask=function(){if(null!==this.parsedFormatInfo){var t=Hi.values[this.parsedFormatInfo.getDataMask()],e=this.bitMatrix.getHeight();t.unmaskBitMatrix(this.bitMatrix,e)}},t.prototype.setMirror=function(t){this.parsedVersion=null,this.parsedFormatInfo=null,this.isMirror=t},t.prototype.mirror=function(){for(var t=this.bitMatrix,e=0,r=t.getWidth();e<r;e++)for(var n=e+1,o=t.getHeight();n<o;n++)t.get(e,n)!==t.get(n,e)&&(t.flip(n,e),t.flip(e,n))},t}(),Wi=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Gi=function(){function t(t,e){this.numDataCodewords=t,this.codewords=e}return t.getDataBlocks=function(e,r,n){var o,i,a,s;if(e.length!==r.getTotalCodewords())throw new Er;var u=r.getECBlocksForLevel(n),l=0,c=u.getECBlocks();try{for(var h=Wi(c),f=h.next();!f.done;f=h.next())l+=(v=f.value).getCount()}catch(O){o={error:O}}finally{try{f&&!f.done&&(i=h.return)&&i.call(h)}finally{if(o)throw o.error}}var d=new Array(l),p=0;try{for(var g=Wi(c),m=g.next();!m.done;m=g.next())for(var v=m.value,y=0;y<v.getCount();y++){var _=v.getDataCodewords(),w=u.getECCodewordsPerBlock()+_;d[p++]=new t(_,new Uint8Array(w))}}catch(O){a={error:O}}finally{try{m&&!m.done&&(s=g.return)&&s.call(g)}finally{if(a)throw a.error}}for(var b=d[0].codewords.length,C=d.length-1;C>=0&&d[C].codewords.length!==b;)C--;C++;var A=b-u.getECCodewordsPerBlock(),E=0;for(y=0;y<A;y++)for(var I=0;I<p;I++)d[I].codewords[y]=e[E++];for(I=C;I<p;I++)d[I].codewords[A]=e[E++];var S=d[0].codewords.length;for(y=A;y<S;y++)for(I=0;I<p;I++){var x=I<C?y:y+1;d[I].codewords[x]=e[E++]}return d},t.prototype.getNumDataCodewords=function(){return this.numDataCodewords},t.prototype.getCodewords=function(){return this.codewords},t}();!function(t){t[t.TERMINATOR=0]="TERMINATOR",t[t.NUMERIC=1]="NUMERIC",t[t.ALPHANUMERIC=2]="ALPHANUMERIC",t[t.STRUCTURED_APPEND=3]="STRUCTURED_APPEND",t[t.BYTE=4]="BYTE",t[t.ECI=5]="ECI",t[t.KANJI=6]="KANJI",t[t.FNC1_FIRST_POSITION=7]="FNC1_FIRST_POSITION",t[t.FNC1_SECOND_POSITION=8]="FNC1_SECOND_POSITION",t[t.HANZI=9]="HANZI"}(Ui||(Ui={}));var Xi,$i,Yi=function(){function t(e,r,n,o){this.value=e,this.stringValue=r,this.characterCountBitsForVersions=n,this.bits=o,t.FOR_BITS.set(o,this),t.FOR_VALUE.set(e,this)}return t.forBits=function(e){var r=t.FOR_BITS.get(e);if(void 0===r)throw new Er;return r},t.prototype.getCharacterCountBits=function(t){var e,r=t.getVersionNumber();return e=r<=9?0:r<=26?1:2,this.characterCountBitsForVersions[e]},t.prototype.getValue=function(){return this.value},t.prototype.getBits=function(){return this.bits},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var r=e;return this.value===r.value},t.prototype.toString=function(){return this.stringValue},t.FOR_BITS=new Map,t.FOR_VALUE=new Map,t.TERMINATOR=new t(Ui.TERMINATOR,"TERMINATOR",Int32Array.from([0,0,0]),0),t.NUMERIC=new t(Ui.NUMERIC,"NUMERIC",Int32Array.from([10,12,14]),1),t.ALPHANUMERIC=new t(Ui.ALPHANUMERIC,"ALPHANUMERIC",Int32Array.from([9,11,13]),2),t.STRUCTURED_APPEND=new t(Ui.STRUCTURED_APPEND,"STRUCTURED_APPEND",Int32Array.from([0,0,0]),3),t.BYTE=new t(Ui.BYTE,"BYTE",Int32Array.from([8,16,16]),4),t.ECI=new t(Ui.ECI,"ECI",Int32Array.from([0,0,0]),7),t.KANJI=new t(Ui.KANJI,"KANJI",Int32Array.from([8,10,12]),8),t.FNC1_FIRST_POSITION=new t(Ui.FNC1_FIRST_POSITION,"FNC1_FIRST_POSITION",Int32Array.from([0,0,0]),5),t.FNC1_SECOND_POSITION=new t(Ui.FNC1_SECOND_POSITION,"FNC1_SECOND_POSITION",Int32Array.from([0,0,0]),9),t.HANZI=new t(Ui.HANZI,"HANZI",Int32Array.from([8,10,12]),13),t}(),qi=function(){function t(){}return t.decode=function(e,r,n,o){var i=new Oi(e),a=new $r,s=new Array,u=-1,l=-1;try{var c=null,h=!1,f=void 0;do{if(i.available()<4)f=Yi.TERMINATOR;else{var d=i.readBits(4);f=Yi.forBits(d)}switch(f){case Yi.TERMINATOR:break;case Yi.FNC1_FIRST_POSITION:case Yi.FNC1_SECOND_POSITION:h=!0;break;case Yi.STRUCTURED_APPEND:if(i.available()<16)throw new Vr;u=i.readBits(8),l=i.readBits(8);break;case Yi.ECI:var p=t.parseECIValue(i);if(null===(c=Hr.getCharacterSetECIByValue(p)))throw new Vr;break;case Yi.HANZI:var g=i.readBits(4),m=i.readBits(f.getCharacterCountBits(r));g===t.GB2312_SUBSET&&t.decodeHanziSegment(i,a,m);break;default:var v=i.readBits(f.getCharacterCountBits(r));switch(f){case Yi.NUMERIC:t.decodeNumericSegment(i,a,v);break;case Yi.ALPHANUMERIC:t.decodeAlphanumericSegment(i,a,v,h);break;case Yi.BYTE:t.decodeByteSegment(i,a,v,c,s,o);break;case Yi.KANJI:t.decodeKanjiSegment(i,a,v);break;default:throw new Vr}}}while(f!==Yi.TERMINATOR)}catch(y){throw new Vr}return new mn(e,a.toString(),0===s.length?null:s,null===n?null:n.toString(),u,l)},t.decodeHanziSegment=function(t,e,r){if(13*r>t.available())throw new Vr;for(var n=new Uint8Array(2*r),o=0;r>0;){var i=t.readBits(13),a=i/96<<8&4294967295|i%96;a+=a<959?41377:42657,n[o]=a>>8&255,n[o+1]=255&a,o+=2,r--}try{e.append(Gr.decode(n,Xr.GB2312))}catch(s){throw new Vr(s)}},t.decodeKanjiSegment=function(t,e,r){if(13*r>t.available())throw new Vr;for(var n=new Uint8Array(2*r),o=0;r>0;){var i=t.readBits(13),a=i/192<<8&4294967295|i%192;a+=a<7936?33088:49472,n[o]=a>>8,n[o+1]=a,o+=2,r--}try{e.append(Gr.decode(n,Xr.SHIFT_JIS))}catch(s){throw new Vr(s)}},t.decodeByteSegment=function(t,e,r,n,o,i){if(8*r>t.available())throw new Vr;for(var a,s=new Uint8Array(r),u=0;u<r;u++)s[u]=t.readBits(8);a=null===n?Xr.guessEncoding(s,i):n.getName();try{e.append(Gr.decode(s,a))}catch(l){throw new Vr(l)}o.push(s)},t.toAlphaNumericChar=function(e){if(e>=t.ALPHANUMERIC_CHARS.length)throw new Vr;return t.ALPHANUMERIC_CHARS[e]},t.decodeAlphanumericSegment=function(e,r,n,o){for(var i=r.length();n>1;){if(e.available()<11)throw new Vr;var a=e.readBits(11);r.append(t.toAlphaNumericChar(Math.floor(a/45))),r.append(t.toAlphaNumericChar(a%45)),n-=2}if(1===n){if(e.available()<6)throw new Vr;r.append(t.toAlphaNumericChar(e.readBits(6)))}if(o)for(var s=i;s<r.length();s++)"%"===r.charAt(s)&&(s<r.length()-1&&"%"===r.charAt(s+1)?r.deleteCharAt(s+1):r.setCharAt(s,String.fromCharCode(29)))},t.decodeNumericSegment=function(e,r,n){for(;n>=3;){if(e.available()<10)throw new Vr;var o=e.readBits(10);if(o>=1e3)throw new Vr;r.append(t.toAlphaNumericChar(Math.floor(o/100))),r.append(t.toAlphaNumericChar(Math.floor(o/10)%10)),r.append(t.toAlphaNumericChar(o%10)),n-=3}if(2===n){if(e.available()<7)throw new Vr;var i=e.readBits(7);if(i>=100)throw new Vr;r.append(t.toAlphaNumericChar(Math.floor(i/10))),r.append(t.toAlphaNumericChar(i%10))}else if(1===n){if(e.available()<4)throw new Vr;var a=e.readBits(4);if(a>=10)throw new Vr;r.append(t.toAlphaNumericChar(a))}},t.parseECIValue=function(t){var e=t.readBits(8);if(!(128&e))return 127&e;if(128==(192&e))return(63&e)<<8&4294967295|t.readBits(8);if(192==(224&e))return(31&e)<<16&4294967295|t.readBits(16);throw new Vr},t.ALPHANUMERIC_CHARS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",t.GB2312_SUBSET=1,t}(),Ki=function(){function t(t){this.mirrored=t}return t.prototype.isMirrored=function(){return this.mirrored},t.prototype.applyMirroredCorrection=function(t){if(this.mirrored&&null!==t&&!(t.length<3)){var e=t[0];t[0]=t[2],t[2]=e}},t}(),Zi=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Qi=function(){function t(){this.rsDecoder=new xn(Cn.QR_CODE_FIELD_256)}return t.prototype.decodeBooleanArray=function(t,e){return this.decodeBitMatrix(Yr.parseFromBooleanArray(t),e)},t.prototype.decodeBitMatrix=function(t,e){var r=new zi(t),n=null;try{return this.decodeBitMatrixParser(r,e)}catch(i){n=i}try{r.remask(),r.setMirror(!0),r.readVersion(),r.readFormatInformation(),r.mirror();var o=this.decodeBitMatrixParser(r,e);return o.setOther(new Ki(!0)),o}catch(i){if(null!==n)throw n;throw i}},t.prototype.decodeBitMatrixParser=function(t,e){var r,n,o,i,a=t.readVersion(),s=t.readFormatInformation().getErrorCorrectionLevel(),u=t.readCodewords(),l=Gi.getDataBlocks(u,a,s),c=0;try{for(var h=Zi(l),f=h.next();!f.done;f=h.next())c+=(v=f.value).getNumDataCodewords()}catch(b){r={error:b}}finally{try{f&&!f.done&&(n=h.return)&&n.call(h)}finally{if(r)throw r.error}}var d=new Uint8Array(c),p=0;try{for(var g=Zi(l),m=g.next();!m.done;m=g.next()){var v,y=(v=m.value).getCodewords(),_=v.getNumDataCodewords();this.correctErrors(y,_);for(var w=0;w<_;w++)d[p++]=y[w]}}catch(b){o={error:b}}finally{try{m&&!m.done&&(i=g.return)&&i.call(g)}finally{if(o)throw o.error}}return qi.decode(d,a,s,e)},t.prototype.correctErrors=function(t,e){var r=new Int32Array(t);try{this.rsDecoder.decode(r,t.length-e)}catch(o){throw new xr}for(var n=0;n<e;n++)t[n]=r[n]},t}(),Ji=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ta=function(t){function e(e,r,n){var o=t.call(this,e,r)||this;return o.estimatedModuleSize=n,o}return Ji(e,t),e.prototype.aboutEquals=function(t,e,r){if(Math.abs(e-this.getY())<=t&&Math.abs(r-this.getX())<=t){var n=Math.abs(t-this.estimatedModuleSize);return n<=1||n<=this.estimatedModuleSize}return!1},e.prototype.combineEstimate=function(t,r,n){return new e((this.getX()+r)/2,(this.getY()+t)/2,(this.estimatedModuleSize+n)/2)},e}(kn),ea=function(){function t(t,e,r,n,o,i,a){this.image=t,this.startX=e,this.startY=r,this.width=n,this.height=o,this.moduleSize=i,this.resultPointCallback=a,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(3)}return t.prototype.find=function(){for(var t=this.startX,e=this.height,r=t+this.width,n=this.startY+e/2,o=new Int32Array(3),i=this.image,a=0;a<e;a++){var s=n+(1&a?-Math.floor((a+1)/2):Math.floor((a+1)/2));o[0]=0,o[1]=0,o[2]=0;for(var u=t;u<r&&!i.get(u,s);)u++;for(var l=0;u<r;){if(i.get(u,s))if(1===l)o[1]++;else if(2===l){var c;if(this.foundPatternCross(o)&&null!==(c=this.handlePossibleCenter(o,s,u)))return c;o[0]=o[2],o[1]=1,o[2]=0,l=1}else o[++l]++;else 1===l&&l++,o[l]++;u++}if(this.foundPatternCross(o)&&null!==(c=this.handlePossibleCenter(o,s,r)))return c}if(0!==this.possibleCenters.length)return this.possibleCenters[0];throw new Kr},t.centerFromEnd=function(t,e){return e-t[2]-t[1]/2},t.prototype.foundPatternCross=function(t){for(var e=this.moduleSize,r=e/2,n=0;n<3;n++)if(Math.abs(e-t[n])>=r)return!1;return!0},t.prototype.crossCheckVertical=function(e,r,n,o){var i=this.image,a=i.getHeight(),s=this.crossCheckStateCount;s[0]=0,s[1]=0,s[2]=0;for(var u=e;u>=0&&i.get(r,u)&&s[1]<=n;)s[1]++,u--;if(u<0||s[1]>n)return NaN;for(;u>=0&&!i.get(r,u)&&s[0]<=n;)s[0]++,u--;if(s[0]>n)return NaN;for(u=e+1;u<a&&i.get(r,u)&&s[1]<=n;)s[1]++,u++;if(u===a||s[1]>n)return NaN;for(;u<a&&!i.get(r,u)&&s[2]<=n;)s[2]++,u++;if(s[2]>n)return NaN;var l=s[0]+s[1]+s[2];return 5*Math.abs(l-o)>=2*o?NaN:this.foundPatternCross(s)?t.centerFromEnd(s,u):NaN},t.prototype.handlePossibleCenter=function(e,r,n){var o,i,a=e[0]+e[1]+e[2],s=t.centerFromEnd(e,n),u=this.crossCheckVertical(r,s,2*e[1],a);if(!isNaN(u)){var l=(e[0]+e[1]+e[2])/3;try{for(var c=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(this.possibleCenters),h=c.next();!h.done;h=c.next()){var f=h.value;if(f.aboutEquals(l,u,s))return f.combineEstimate(u,s,l)}}catch(p){o={error:p}}finally{try{h&&!h.done&&(i=c.return)&&i.call(c)}finally{if(o)throw o.error}}var d=new ta(s,u,l);this.possibleCenters.push(d),null!==this.resultPointCallback&&void 0!==this.resultPointCallback&&this.resultPointCallback.foundPossibleResultPoint(d)}return null},t}(),ra=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),na=function(t){function e(e,r,n,o){var i=t.call(this,e,r)||this;return i.estimatedModuleSize=n,i.count=o,void 0===o&&(i.count=1),i}return ra(e,t),e.prototype.getEstimatedModuleSize=function(){return this.estimatedModuleSize},e.prototype.getCount=function(){return this.count},e.prototype.aboutEquals=function(t,e,r){if(Math.abs(e-this.getY())<=t&&Math.abs(r-this.getX())<=t){var n=Math.abs(t-this.estimatedModuleSize);return n<=1||n<=this.estimatedModuleSize}return!1},e.prototype.combineEstimate=function(t,r,n){var o=this.count+1;return new e((this.count*this.getX()+r)/o,(this.count*this.getY()+t)/o,(this.count*this.estimatedModuleSize+n)/o,o)},e}(kn),oa=function(){function t(t){this.bottomLeft=t[0],this.topLeft=t[1],this.topRight=t[2]}return t.prototype.getBottomLeft=function(){return this.bottomLeft},t.prototype.getTopLeft=function(){return this.topLeft},t.prototype.getTopRight=function(){return this.topRight},t}(),ia=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},aa=function(){function t(t,e){this.image=t,this.resultPointCallback=e,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(5),this.resultPointCallback=e}return t.prototype.getImage=function(){return this.image},t.prototype.getPossibleCenters=function(){return this.possibleCenters},t.prototype.find=function(e){var r=null!=e&&void 0!==e.get(Fr.TRY_HARDER),n=null!=e&&void 0!==e.get(Fr.PURE_BARCODE),o=this.image,i=o.getHeight(),a=o.getWidth(),s=Math.floor(3*i/(4*t.MAX_MODULES));(s<t.MIN_SKIP||r)&&(s=t.MIN_SKIP);for(var u=!1,l=new Int32Array(5),c=s-1;c<i&&!u;c+=s){l[0]=0,l[1]=0,l[2]=0,l[3]=0,l[4]=0;for(var h=0,f=0;f<a;f++)if(o.get(f,c))!(1&~h)&&h++,l[h]++;else if(1&h)l[h]++;else if(4===h)if(t.foundPatternCross(l)){if(!0!==this.handlePossibleCenter(l,c,f,n)){l[0]=l[2],l[1]=l[3],l[2]=l[4],l[3]=1,l[4]=0,h=3;continue}if(s=2,!0===this.hasSkipped)u=this.haveMultiplyConfirmedCenters();else{var d=this.findRowSkip();d>l[2]&&(c+=d-l[2]-s,f=a-1)}h=0,l[0]=0,l[1]=0,l[2]=0,l[3]=0,l[4]=0}else l[0]=l[2],l[1]=l[3],l[2]=l[4],l[3]=1,l[4]=0,h=3;else l[++h]++;t.foundPatternCross(l)&&!0===this.handlePossibleCenter(l,c,a,n)&&(s=l[0],this.hasSkipped&&(u=this.haveMultiplyConfirmedCenters()))}var p=this.selectBestPatterns();return kn.orderBestPatterns(p),new oa(p)},t.centerFromEnd=function(t,e){return e-t[4]-t[3]-t[2]/2},t.foundPatternCross=function(t){for(var e=0,r=0;r<5;r++){var n=t[r];if(0===n)return!1;e+=n}if(e<7)return!1;var o=e/7,i=o/2;return Math.abs(o-t[0])<i&&Math.abs(o-t[1])<i&&Math.abs(3*o-t[2])<3*i&&Math.abs(o-t[3])<i&&Math.abs(o-t[4])<i},t.prototype.getCrossCheckStateCount=function(){var t=this.crossCheckStateCount;return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t},t.prototype.crossCheckDiagonal=function(e,r,n,o){for(var i=this.getCrossCheckStateCount(),a=0,s=this.image;e>=a&&r>=a&&s.get(r-a,e-a);)i[2]++,a++;if(e<a||r<a)return!1;for(;e>=a&&r>=a&&!s.get(r-a,e-a)&&i[1]<=n;)i[1]++,a++;if(e<a||r<a||i[1]>n)return!1;for(;e>=a&&r>=a&&s.get(r-a,e-a)&&i[0]<=n;)i[0]++,a++;if(i[0]>n)return!1;var u=s.getHeight(),l=s.getWidth();for(a=1;e+a<u&&r+a<l&&s.get(r+a,e+a);)i[2]++,a++;if(e+a>=u||r+a>=l)return!1;for(;e+a<u&&r+a<l&&!s.get(r+a,e+a)&&i[3]<n;)i[3]++,a++;if(e+a>=u||r+a>=l||i[3]>=n)return!1;for(;e+a<u&&r+a<l&&s.get(r+a,e+a)&&i[4]<n;)i[4]++,a++;if(i[4]>=n)return!1;var c=i[0]+i[1]+i[2]+i[3]+i[4];return Math.abs(c-o)<2*o&&t.foundPatternCross(i)},t.prototype.crossCheckVertical=function(e,r,n,o){for(var i=this.image,a=i.getHeight(),s=this.getCrossCheckStateCount(),u=e;u>=0&&i.get(r,u);)s[2]++,u--;if(u<0)return NaN;for(;u>=0&&!i.get(r,u)&&s[1]<=n;)s[1]++,u--;if(u<0||s[1]>n)return NaN;for(;u>=0&&i.get(r,u)&&s[0]<=n;)s[0]++,u--;if(s[0]>n)return NaN;for(u=e+1;u<a&&i.get(r,u);)s[2]++,u++;if(u===a)return NaN;for(;u<a&&!i.get(r,u)&&s[3]<n;)s[3]++,u++;if(u===a||s[3]>=n)return NaN;for(;u<a&&i.get(r,u)&&s[4]<n;)s[4]++,u++;if(s[4]>=n)return NaN;var l=s[0]+s[1]+s[2]+s[3]+s[4];return 5*Math.abs(l-o)>=2*o?NaN:t.foundPatternCross(s)?t.centerFromEnd(s,u):NaN},t.prototype.crossCheckHorizontal=function(e,r,n,o){for(var i=this.image,a=i.getWidth(),s=this.getCrossCheckStateCount(),u=e;u>=0&&i.get(u,r);)s[2]++,u--;if(u<0)return NaN;for(;u>=0&&!i.get(u,r)&&s[1]<=n;)s[1]++,u--;if(u<0||s[1]>n)return NaN;for(;u>=0&&i.get(u,r)&&s[0]<=n;)s[0]++,u--;if(s[0]>n)return NaN;for(u=e+1;u<a&&i.get(u,r);)s[2]++,u++;if(u===a)return NaN;for(;u<a&&!i.get(u,r)&&s[3]<n;)s[3]++,u++;if(u===a||s[3]>=n)return NaN;for(;u<a&&i.get(u,r)&&s[4]<n;)s[4]++,u++;if(s[4]>=n)return NaN;var l=s[0]+s[1]+s[2]+s[3]+s[4];return 5*Math.abs(l-o)>=o?NaN:t.foundPatternCross(s)?t.centerFromEnd(s,u):NaN},t.prototype.handlePossibleCenter=function(e,r,n,o){var i=e[0]+e[1]+e[2]+e[3]+e[4],a=t.centerFromEnd(e,n),s=this.crossCheckVertical(r,Math.floor(a),e[2],i);if(!isNaN(s)&&(a=this.crossCheckHorizontal(Math.floor(a),Math.floor(s),e[2],i),!isNaN(a)&&(!o||this.crossCheckDiagonal(Math.floor(s),Math.floor(a),e[2],i)))){for(var u=i/7,l=!1,c=this.possibleCenters,h=0,f=c.length;h<f;h++){var d=c[h];if(d.aboutEquals(u,s,a)){c[h]=d.combineEstimate(s,a,u),l=!0;break}}if(!l){var p=new na(a,s,u);c.push(p),null!==this.resultPointCallback&&void 0!==this.resultPointCallback&&this.resultPointCallback.foundPossibleResultPoint(p)}return!0}return!1},t.prototype.findRowSkip=function(){var e,r;if(this.possibleCenters.length<=1)return 0;var n=null;try{for(var o=ia(this.possibleCenters),i=o.next();!i.done;i=o.next()){var a=i.value;if(a.getCount()>=t.CENTER_QUORUM){if(null!=n)return this.hasSkipped=!0,Math.floor((Math.abs(n.getX()-a.getX())-Math.abs(n.getY()-a.getY()))/2);n=a}}}catch(s){e={error:s}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return 0},t.prototype.haveMultiplyConfirmedCenters=function(){var e,r,n,o,i=0,a=0,s=this.possibleCenters.length;try{for(var u=ia(this.possibleCenters),l=u.next();!l.done;l=u.next())(p=l.value).getCount()>=t.CENTER_QUORUM&&(i++,a+=p.getEstimatedModuleSize())}catch(g){e={error:g}}finally{try{l&&!l.done&&(r=u.return)&&r.call(u)}finally{if(e)throw e.error}}if(i<3)return!1;var c=a/s,h=0;try{for(var f=ia(this.possibleCenters),d=f.next();!d.done;d=f.next()){var p=d.value;h+=Math.abs(p.getEstimatedModuleSize()-c)}}catch(g){n={error:g}}finally{try{d&&!d.done&&(o=f.return)&&o.call(f)}finally{if(n)throw n.error}}return h<=.05*a},t.prototype.selectBestPatterns=function(){var t,e,r,n,o=this.possibleCenters.length;if(o<3)throw new Kr;var i,a=this.possibleCenters;if(o>3){var s=0,u=0;try{for(var l=ia(this.possibleCenters),c=l.next();!c.done;c=l.next()){var h=c.value.getEstimatedModuleSize();s+=h,u+=h*h}}catch(y){t={error:y}}finally{try{c&&!c.done&&(e=l.return)&&e.call(l)}finally{if(t)throw t.error}}i=s/o;var f=Math.sqrt(u/o-i*i);a.sort(function(t,e){var r=Math.abs(e.getEstimatedModuleSize()-i),n=Math.abs(t.getEstimatedModuleSize()-i);return r<n?-1:r>n?1:0});for(var d=Math.max(.2*i,f),p=0;p<a.length&&a.length>3;p++){var g=a[p];Math.abs(g.getEstimatedModuleSize()-i)>d&&(a.splice(p,1),p--)}}if(a.length>3){s=0;try{for(var m=ia(a),v=m.next();!v.done;v=m.next())s+=v.value.getEstimatedModuleSize()}catch(_){r={error:_}}finally{try{v&&!v.done&&(n=m.return)&&n.call(m)}finally{if(r)throw r.error}}i=s/a.length,a.sort(function(t,e){if(e.getCount()===t.getCount()){var r=Math.abs(e.getEstimatedModuleSize()-i),n=Math.abs(t.getEstimatedModuleSize()-i);return r<n?1:r>n?-1:0}return e.getCount()-t.getCount()}),a.splice(3)}return[a[0],a[1],a[2]]},t.CENTER_QUORUM=2,t.MIN_SKIP=3,t.MAX_MODULES=57,t}(),sa=function(){function t(t){this.image=t}return t.prototype.getImage=function(){return this.image},t.prototype.getResultPointCallback=function(){return this.resultPointCallback},t.prototype.detect=function(t){this.resultPointCallback=null==t?null:t.get(Fr.NEED_RESULT_POINT_CALLBACK);var e=new aa(this.image,this.resultPointCallback).find(t);return this.processFinderPatternInfo(e)},t.prototype.processFinderPatternInfo=function(e){var r=e.getTopLeft(),n=e.getTopRight(),o=e.getBottomLeft(),i=this.calculateModuleSize(r,n,o);if(i<1)throw new Kr("No pattern found in proccess finder.");var a=t.computeDimension(r,n,o,i),s=Vi.getProvisionalVersionForDimension(a),u=s.getDimensionForVersion()-7,l=null;if(s.getAlignmentPatternCenters().length>0)for(var c=n.getX()-r.getX()+o.getX(),h=n.getY()-r.getY()+o.getY(),f=1-3/u,d=Math.floor(r.getX()+f*(c-r.getX())),p=Math.floor(r.getY()+f*(h-r.getY())),g=4;g<=16;g<<=1)try{l=this.findAlignmentInRegion(i,d,p,g);break}catch(y){if(!(y instanceof Kr))throw y}var m=t.createTransform(r,n,o,l,a),v=t.sampleGrid(this.image,m,a);return new Rn(v,null===l?[o,r,n]:[o,r,n,l])},t.createTransform=function(t,e,r,n,o){var i,a,s,u,l=o-3.5;return null!==n?(i=n.getX(),a=n.getY(),u=s=l-3):(i=e.getX()-t.getX()+r.getX(),a=e.getY()-t.getY()+r.getY(),s=l,u=l),Ln.quadrilateralToQuadrilateral(3.5,3.5,l,3.5,s,u,3.5,l,t.getX(),t.getY(),e.getX(),e.getY(),i,a,r.getX(),r.getY())},t.sampleGrid=function(t,e,r){return Vn.getInstance().sampleGridWithTransform(t,r,r,e)},t.computeDimension=function(t,e,r,n){var o=Tn.round(kn.distance(t,e)/n),i=Tn.round(kn.distance(t,r)/n),a=Math.floor((o+i)/2)+7;switch(3&a){case 0:a++;break;case 2:a--;break;case 3:throw new Kr("Dimensions could be not found.")}return a},t.prototype.calculateModuleSize=function(t,e,r){return(this.calculateModuleSizeOneWay(t,e)+this.calculateModuleSizeOneWay(t,r))/2},t.prototype.calculateModuleSizeOneWay=function(t,e){var r=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(t.getX()),Math.floor(t.getY()),Math.floor(e.getX()),Math.floor(e.getY())),n=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(e.getX()),Math.floor(e.getY()),Math.floor(t.getX()),Math.floor(t.getY()));return isNaN(r)?n/7:isNaN(n)?r/7:(r+n)/14},t.prototype.sizeOfBlackWhiteBlackRunBothWays=function(t,e,r,n){var o=this.sizeOfBlackWhiteBlackRun(t,e,r,n),i=1,a=t-(r-t);a<0?(i=t/(t-a),a=0):a>=this.image.getWidth()&&(i=(this.image.getWidth()-1-t)/(a-t),a=this.image.getWidth()-1);var s=Math.floor(e-(n-e)*i);return i=1,s<0?(i=e/(e-s),s=0):s>=this.image.getHeight()&&(i=(this.image.getHeight()-1-e)/(s-e),s=this.image.getHeight()-1),a=Math.floor(t+(a-t)*i),(o+=this.sizeOfBlackWhiteBlackRun(t,e,a,s))-1},t.prototype.sizeOfBlackWhiteBlackRun=function(t,e,r,n){var o=Math.abs(n-e)>Math.abs(r-t);if(o){var i=t;t=e,e=i,i=r,r=n,n=i}for(var a=Math.abs(r-t),s=Math.abs(n-e),u=-a/2,l=t<r?1:-1,c=e<n?1:-1,h=0,f=r+l,d=t,p=e;d!==f;d+=l){var g=o?p:d,m=o?d:p;if(1===h===this.image.get(g,m)){if(2===h)return Tn.distance(d,p,t,e);h++}if((u+=s)>0){if(p===n)break;p+=c,u-=a}}return 2===h?Tn.distance(r+l,n,t,e):NaN},t.prototype.findAlignmentInRegion=function(t,e,r,n){var o=Math.floor(n*t),i=Math.max(0,e-o),a=Math.min(this.image.getWidth()-1,e+o);if(a-i<3*t)throw new Kr("Alignment top exceeds estimated module size.");var s=Math.max(0,r-o),u=Math.min(this.image.getHeight()-1,r+o);if(u-s<3*t)throw new Kr("Alignment bottom exceeds estimated module size.");return new ea(this.image,i,s,a-i,u-s,t,this.resultPointCallback).find()},t}(),ua=function(){function t(){this.decoder=new Qi}return t.prototype.getDecoder=function(){return this.decoder},t.prototype.decode=function(e,r){var n,o;if(null!=r&&void 0!==r.get(Fr.PURE_BARCODE)){var i=t.extractPureBits(e.getBlackMatrix());n=this.decoder.decodeBitMatrix(i,r),o=t.NO_POINTS}else{var a=new sa(e.getBlackMatrix()).detect(r);n=this.decoder.decodeBitMatrix(a.getBits(),r),o=a.getPoints()}n.getOther()instanceof Ki&&n.getOther().applyMirroredCorrection(o);var s=new hn(n.getText(),n.getRawBytes(),void 0,o,dn.QR_CODE,void 0),u=n.getByteSegments();null!==u&&s.putMetadata(gn.BYTE_SEGMENTS,u);var l=n.getECLevel();return null!==l&&s.putMetadata(gn.ERROR_CORRECTION_LEVEL,l),n.hasStructuredAppend()&&(s.putMetadata(gn.STRUCTURED_APPEND_SEQUENCE,n.getStructuredAppendSequenceNumber()),s.putMetadata(gn.STRUCTURED_APPEND_PARITY,n.getStructuredAppendParity())),s},t.prototype.reset=function(){},t.extractPureBits=function(t){var e=t.getTopLeftOnBit(),r=t.getBottomRightOnBit();if(null===e||null===r)throw new Kr;var n=this.moduleSize(e,t),o=e[1],i=r[1],a=e[0],s=r[0];if(a>=s||o>=i)throw new Kr;if(i-o!=s-a&&(s=a+(i-o))>=t.getWidth())throw new Kr;var u=Math.round((s-a+1)/n),l=Math.round((i-o+1)/n);if(u<=0||l<=0)throw new Kr;if(l!==u)throw new Kr;var c=Math.floor(n/2);o+=c;var h=(a+=c)+Math.floor((u-1)*n)-s;if(h>0){if(h>c)throw new Kr;a-=h}var f=o+Math.floor((l-1)*n)-i;if(f>0){if(f>c)throw new Kr;o-=f}for(var d=new Yr(u,l),p=0;p<l;p++)for(var g=o+Math.floor(p*n),m=0;m<u;m++)t.get(a+Math.floor(m*n),g)&&d.set(m,p);return d},t.moduleSize=function(t,e){for(var r=e.getHeight(),n=e.getWidth(),o=t[0],i=t[1],a=!0,s=0;o<n&&i<r;){if(a!==e.get(o,i)){if(5==++s)break;a=!a}o++,i++}if(o===n||i===r)throw new Kr;return(o-t[0])/7},t.NO_POINTS=new Array,t}(),la=function(){function t(){}return t.prototype.PDF417Common=function(){},t.getBitCountSum=function(t){return Tn.sum(t)},t.toIntArray=function(e){var r,n;if(null==e||!e.length)return t.EMPTY_INT_ARRAY;var o=new Int32Array(e.length),i=0;try{for(var a=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(e),s=a.next();!s.done;s=a.next()){var u=s.value;o[i++]=u}}catch(l){r={error:l}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return o},t.getCodeword=function(e){var r=Pr.binarySearch(t.SYMBOL_TABLE,262143&e);return r<0?-1:(t.CODEWORD_TABLE[r]-1)%t.NUMBER_OF_CODEWORDS},t.NUMBER_OF_CODEWORDS=929,t.MAX_CODEWORDS_IN_BARCODE=t.NUMBER_OF_CODEWORDS-1,t.MIN_ROWS_IN_BARCODE=3,t.MAX_ROWS_IN_BARCODE=90,t.MODULES_IN_CODEWORD=17,t.MODULES_IN_STOP_PATTERN=18,t.BARS_IN_MODULE=8,t.EMPTY_INT_ARRAY=new Int32Array([]),t.SYMBOL_TABLE=Int32Array.from([66142,66170,66206,66236,66290,66292,66350,66382,66396,66454,66470,66476,66594,66600,66614,66626,66628,66632,66640,66654,66662,66668,66682,66690,66718,66720,66748,66758,66776,66798,66802,66804,66820,66824,66832,66846,66848,66876,66880,66936,66950,66956,66968,66992,67006,67022,67036,67042,67044,67048,67062,67118,67150,67164,67214,67228,67256,67294,67322,67350,67366,67372,67398,67404,67416,67438,67474,67476,67490,67492,67496,67510,67618,67624,67650,67656,67664,67678,67686,67692,67706,67714,67716,67728,67742,67744,67772,67782,67788,67800,67822,67826,67828,67842,67848,67870,67872,67900,67904,67960,67974,67992,68016,68030,68046,68060,68066,68068,68072,68086,68104,68112,68126,68128,68156,68160,68216,68336,68358,68364,68376,68400,68414,68448,68476,68494,68508,68536,68546,68548,68552,68560,68574,68582,68588,68654,68686,68700,68706,68708,68712,68726,68750,68764,68792,68802,68804,68808,68816,68830,68838,68844,68858,68878,68892,68920,68976,68990,68994,68996,69e3,69008,69022,69024,69052,69062,69068,69080,69102,69106,69108,69142,69158,69164,69190,69208,69230,69254,69260,69272,69296,69310,69326,69340,69386,69394,69396,69410,69416,69430,69442,69444,69448,69456,69470,69478,69484,69554,69556,69666,69672,69698,69704,69712,69726,69754,69762,69764,69776,69790,69792,69820,69830,69836,69848,69870,69874,69876,69890,69918,69920,69948,69952,70008,70022,70040,70064,70078,70094,70108,70114,70116,70120,70134,70152,70174,70176,70264,70384,70412,70448,70462,70496,70524,70542,70556,70584,70594,70600,70608,70622,70630,70636,70664,70672,70686,70688,70716,70720,70776,70896,71136,71180,71192,71216,71230,71264,71292,71360,71416,71452,71480,71536,71550,71554,71556,71560,71568,71582,71584,71612,71622,71628,71640,71662,71726,71732,71758,71772,71778,71780,71784,71798,71822,71836,71864,71874,71880,71888,71902,71910,71916,71930,71950,71964,71992,72048,72062,72066,72068,72080,72094,72096,72124,72134,72140,72152,72174,72178,72180,72206,72220,72248,72304,72318,72416,72444,72456,72464,72478,72480,72508,72512,72568,72588,72600,72624,72638,72654,72668,72674,72676,72680,72694,72726,72742,72748,72774,72780,72792,72814,72838,72856,72880,72894,72910,72924,72930,72932,72936,72950,72966,72972,72984,73008,73022,73056,73084,73102,73116,73144,73156,73160,73168,73182,73190,73196,73210,73226,73234,73236,73250,73252,73256,73270,73282,73284,73296,73310,73318,73324,73346,73348,73352,73360,73374,73376,73404,73414,73420,73432,73454,73498,73518,73522,73524,73550,73564,73570,73572,73576,73590,73800,73822,73858,73860,73872,73886,73888,73916,73944,73970,73972,73992,74014,74016,74044,74048,74104,74118,74136,74160,74174,74210,74212,74216,74230,74244,74256,74270,74272,74360,74480,74502,74508,74544,74558,74592,74620,74638,74652,74680,74690,74696,74704,74726,74732,74782,74784,74812,74992,75232,75288,75326,75360,75388,75456,75512,75576,75632,75646,75650,75652,75664,75678,75680,75708,75718,75724,75736,75758,75808,75836,75840,75896,76016,76256,76736,76824,76848,76862,76896,76924,76992,77048,77296,77340,77368,77424,77438,77536,77564,77572,77576,77584,77600,77628,77632,77688,77702,77708,77720,77744,77758,77774,77788,77870,77902,77916,77922,77928,77966,77980,78008,78018,78024,78032,78046,78060,78074,78094,78136,78192,78206,78210,78212,78224,78238,78240,78268,78278,78284,78296,78322,78324,78350,78364,78448,78462,78560,78588,78600,78622,78624,78652,78656,78712,78726,78744,78768,78782,78798,78812,78818,78820,78824,78838,78862,78876,78904,78960,78974,79072,79100,79296,79352,79368,79376,79390,79392,79420,79424,79480,79600,79628,79640,79664,79678,79712,79740,79772,79800,79810,79812,79816,79824,79838,79846,79852,79894,79910,79916,79942,79948,79960,79982,79988,80006,80024,80048,80062,80078,80092,80098,80100,80104,80134,80140,80176,80190,80224,80252,80270,80284,80312,80328,80336,80350,80358,80364,80378,80390,80396,80408,80432,80446,80480,80508,80576,80632,80654,80668,80696,80752,80766,80776,80784,80798,80800,80828,80844,80856,80878,80882,80884,80914,80916,80930,80932,80936,80950,80962,80968,80976,80990,80998,81004,81026,81028,81040,81054,81056,81084,81094,81100,81112,81134,81154,81156,81160,81168,81182,81184,81212,81216,81272,81286,81292,81304,81328,81342,81358,81372,81380,81384,81398,81434,81454,81458,81460,81486,81500,81506,81508,81512,81526,81550,81564,81592,81602,81604,81608,81616,81630,81638,81644,81702,81708,81722,81734,81740,81752,81774,81778,81780,82050,82078,82080,82108,82180,82184,82192,82206,82208,82236,82240,82296,82316,82328,82352,82366,82402,82404,82408,82440,82448,82462,82464,82492,82496,82552,82672,82694,82700,82712,82736,82750,82784,82812,82830,82882,82884,82888,82896,82918,82924,82952,82960,82974,82976,83004,83008,83064,83184,83424,83468,83480,83504,83518,83552,83580,83648,83704,83740,83768,83824,83838,83842,83844,83848,83856,83872,83900,83910,83916,83928,83950,83984,84e3,84028,84032,84088,84208,84448,84928,85040,85054,85088,85116,85184,85240,85488,85560,85616,85630,85728,85756,85764,85768,85776,85790,85792,85820,85824,85880,85894,85900,85912,85936,85966,85980,86048,86080,86136,86256,86496,86976,88160,88188,88256,88312,88560,89056,89200,89214,89312,89340,89536,89592,89608,89616,89632,89664,89720,89840,89868,89880,89904,89952,89980,89998,90012,90040,90190,90204,90254,90268,90296,90306,90308,90312,90334,90382,90396,90424,90480,90494,90500,90504,90512,90526,90528,90556,90566,90572,90584,90610,90612,90638,90652,90680,90736,90750,90848,90876,90884,90888,90896,90910,90912,90940,90944,91e3,91014,91020,91032,91056,91070,91086,91100,91106,91108,91112,91126,91150,91164,91192,91248,91262,91360,91388,91584,91640,91664,91678,91680,91708,91712,91768,91888,91928,91952,91966,92e3,92028,92046,92060,92088,92098,92100,92104,92112,92126,92134,92140,92188,92216,92272,92384,92412,92608,92664,93168,93200,93214,93216,93244,93248,93304,93424,93664,93720,93744,93758,93792,93820,93888,93944,93980,94008,94064,94078,94084,94088,94096,94110,94112,94140,94150,94156,94168,94246,94252,94278,94284,94296,94318,94342,94348,94360,94384,94398,94414,94428,94440,94470,94476,94488,94512,94526,94560,94588,94606,94620,94648,94658,94660,94664,94672,94686,94694,94700,94714,94726,94732,94744,94768,94782,94816,94844,94912,94968,94990,95004,95032,95088,95102,95112,95120,95134,95136,95164,95180,95192,95214,95218,95220,95244,95256,95280,95294,95328,95356,95424,95480,95728,95758,95772,95800,95856,95870,95968,95996,96008,96016,96030,96032,96060,96064,96120,96152,96176,96190,96220,96226,96228,96232,96290,96292,96296,96310,96322,96324,96328,96336,96350,96358,96364,96386,96388,96392,96400,96414,96416,96444,96454,96460,96472,96494,96498,96500,96514,96516,96520,96528,96542,96544,96572,96576,96632,96646,96652,96664,96688,96702,96718,96732,96738,96740,96744,96758,96772,96776,96784,96798,96800,96828,96832,96888,97008,97030,97036,97048,97072,97086,97120,97148,97166,97180,97208,97220,97224,97232,97246,97254,97260,97326,97330,97332,97358,97372,97378,97380,97384,97398,97422,97436,97464,97474,97476,97480,97488,97502,97510,97516,97550,97564,97592,97648,97666,97668,97672,97680,97694,97696,97724,97734,97740,97752,97774,97830,97836,97850,97862,97868,97880,97902,97906,97908,97926,97932,97944,97968,97998,98012,98018,98020,98024,98038,98618,98674,98676,98838,98854,98874,98892,98904,98926,98930,98932,98968,99006,99042,99044,99048,99062,99166,99194,99246,99286,99350,99366,99372,99386,99398,99416,99438,99442,99444,99462,99504,99518,99534,99548,99554,99556,99560,99574,99590,99596,99608,99632,99646,99680,99708,99726,99740,99768,99778,99780,99784,99792,99806,99814,99820,99834,99858,99860,99874,99880,99894,99906,99920,99934,99962,99970,99972,99976,99984,99998,1e5,100028,100038,100044,100056,100078,100082,100084,100142,100174,100188,100246,100262,100268,100306,100308,100390,100396,100410,100422,100428,100440,100462,100466,100468,100486,100504,100528,100542,100558,100572,100578,100580,100584,100598,100620,100656,100670,100704,100732,100750,100792,100802,100808,100816,100830,100838,100844,100858,100888,100912,100926,100960,100988,101056,101112,101148,101176,101232,101246,101250,101252,101256,101264,101278,101280,101308,101318,101324,101336,101358,101362,101364,101410,101412,101416,101430,101442,101448,101456,101470,101478,101498,101506,101508,101520,101534,101536,101564,101580,101618,101620,101636,101640,101648,101662,101664,101692,101696,101752,101766,101784,101838,101858,101860,101864,101934,101938,101940,101966,101980,101986,101988,101992,102030,102044,102072,102082,102084,102088,102096,102138,102166,102182,102188,102214,102220,102232,102254,102282,102290,102292,102306,102308,102312,102326,102444,102458,102470,102476,102488,102514,102516,102534,102552,102576,102590,102606,102620,102626,102632,102646,102662,102668,102704,102718,102752,102780,102798,102812,102840,102850,102856,102864,102878,102886,102892,102906,102936,102974,103008,103036,103104,103160,103224,103280,103294,103298,103300,103312,103326,103328,103356,103366,103372,103384,103406,103410,103412,103472,103486,103520,103548,103616,103672,103920,103992,104048,104062,104160,104188,104194,104196,104200,104208,104224,104252,104256,104312,104326,104332,104344,104368,104382,104398,104412,104418,104420,104424,104482,104484,104514,104520,104528,104542,104550,104570,104578,104580,104592,104606,104608,104636,104652,104690,104692,104706,104712,104734,104736,104764,104768,104824,104838,104856,104910,104930,104932,104936,104968,104976,104990,104992,105020,105024,105080,105200,105240,105278,105312,105372,105410,105412,105416,105424,105446,105518,105524,105550,105564,105570,105572,105576,105614,105628,105656,105666,105672,105680,105702,105722,105742,105756,105784,105840,105854,105858,105860,105864,105872,105888,105932,105970,105972,106006,106022,106028,106054,106060,106072,106100,106118,106124,106136,106160,106174,106190,106210,106212,106216,106250,106258,106260,106274,106276,106280,106306,106308,106312,106320,106334,106348,106394,106414,106418,106420,106566,106572,106610,106612,106630,106636,106648,106672,106686,106722,106724,106728,106742,106758,106764,106776,106800,106814,106848,106876,106894,106908,106936,106946,106948,106952,106960,106974,106982,106988,107032,107056,107070,107104,107132,107200,107256,107292,107320,107376,107390,107394,107396,107400,107408,107422,107424,107452,107462,107468,107480,107502,107506,107508,107544,107568,107582,107616,107644,107712,107768,108016,108060,108088,108144,108158,108256,108284,108290,108292,108296,108304,108318,108320,108348,108352,108408,108422,108428,108440,108464,108478,108494,108508,108514,108516,108520,108592,108640,108668,108736,108792,109040,109536,109680,109694,109792,109820,110016,110072,110084,110088,110096,110112,110140,110144,110200,110320,110342,110348,110360,110384,110398,110432,110460,110478,110492,110520,110532,110536,110544,110558,110658,110686,110714,110722,110724,110728,110736,110750,110752,110780,110796,110834,110836,110850,110852,110856,110864,110878,110880,110908,110912,110968,110982,111e3,111054,111074,111076,111080,111108,111112,111120,111134,111136,111164,111168,111224,111344,111372,111422,111456,111516,111554,111556,111560,111568,111590,111632,111646,111648,111676,111680,111736,111856,112096,112152,112224,112252,112320,112440,112514,112516,112520,112528,112542,112544,112588,112686,112718,112732,112782,112796,112824,112834,112836,112840,112848,112870,112890,112910,112924,112952,113008,113022,113026,113028,113032,113040,113054,113056,113100,113138,113140,113166,113180,113208,113264,113278,113376,113404,113416,113424,113440,113468,113472,113560,113614,113634,113636,113640,113686,113702,113708,113734,113740,113752,113778,113780,113798,113804,113816,113840,113854,113870,113890,113892,113896,113926,113932,113944,113968,113982,114016,114044,114076,114114,114116,114120,114128,114150,114170,114194,114196,114210,114212,114216,114242,114244,114248,114256,114270,114278,114306,114308,114312,114320,114334,114336,114364,114380,114420,114458,114478,114482,114484,114510,114524,114530,114532,114536,114842,114866,114868,114970,114994,114996,115042,115044,115048,115062,115130,115226,115250,115252,115278,115292,115298,115300,115304,115318,115342,115394,115396,115400,115408,115422,115430,115436,115450,115478,115494,115514,115526,115532,115570,115572,115738,115758,115762,115764,115790,115804,115810,115812,115816,115830,115854,115868,115896,115906,115912,115920,115934,115942,115948,115962,115996,116024,116080,116094,116098,116100,116104,116112,116126,116128,116156,116166,116172,116184,116206,116210,116212,116246,116262,116268,116282,116294,116300,116312,116334,116338,116340,116358,116364,116376,116400,116414,116430,116444,116450,116452,116456,116498,116500,116514,116520,116534,116546,116548,116552,116560,116574,116582,116588,116602,116654,116694,116714,116762,116782,116786,116788,116814,116828,116834,116836,116840,116854,116878,116892,116920,116930,116936,116944,116958,116966,116972,116986,117006,117048,117104,117118,117122,117124,117136,117150,117152,117180,117190,117196,117208,117230,117234,117236,117304,117360,117374,117472,117500,117506,117508,117512,117520,117536,117564,117568,117624,117638,117644,117656,117680,117694,117710,117724,117730,117732,117736,117750,117782,117798,117804,117818,117830,117848,117874,117876,117894,117936,117950,117966,117986,117988,117992,118022,118028,118040,118064,118078,118112,118140,118172,118210,118212,118216,118224,118238,118246,118266,118306,118312,118338,118352,118366,118374,118394,118402,118404,118408,118416,118430,118432,118460,118476,118514,118516,118574,118578,118580,118606,118620,118626,118628,118632,118678,118694,118700,118730,118738,118740,118830,118834,118836,118862,118876,118882,118884,118888,118902,118926,118940,118968,118978,118980,118984,118992,119006,119014,119020,119034,119068,119096,119152,119166,119170,119172,119176,119184,119198,119200,119228,119238,119244,119256,119278,119282,119284,119324,119352,119408,119422,119520,119548,119554,119556,119560,119568,119582,119584,119612,119616,119672,119686,119692,119704,119728,119742,119758,119772,119778,119780,119784,119798,119920,119934,120032,120060,120256,120312,120324,120328,120336,120352,120384,120440,120560,120582,120588,120600,120624,120638,120672,120700,120718,120732,120760,120770,120772,120776,120784,120798,120806,120812,120870,120876,120890,120902,120908,120920,120946,120948,120966,120972,120984,121008,121022,121038,121058,121060,121064,121078,121100,121112,121136,121150,121184,121212,121244,121282,121284,121288,121296,121318,121338,121356,121368,121392,121406,121440,121468,121536,121592,121656,121730,121732,121736,121744,121758,121760,121804,121842,121844,121890,121922,121924,121928,121936,121950,121958,121978,121986,121988,121992,122e3,122014,122016,122044,122060,122098,122100,122116,122120,122128,122142,122144,122172,122176,122232,122246,122264,122318,122338,122340,122344,122414,122418,122420,122446,122460,122466,122468,122472,122510,122524,122552,122562,122564,122568,122576,122598,122618,122646,122662,122668,122694,122700,122712,122738,122740,122762,122770,122772,122786,122788,122792,123018,123026,123028,123042,123044,123048,123062,123098,123146,123154,123156,123170,123172,123176,123190,123202,123204,123208,123216,123238,123244,123258,123290,123314,123316,123402,123410,123412,123426,123428,123432,123446,123458,123464,123472,123486,123494,123500,123514,123522,123524,123528,123536,123552,123580,123590,123596,123608,123630,123634,123636,123674,123698,123700,123740,123746,123748,123752,123834,123914,123922,123924,123938,123944,123958,123970,123976,123984,123998,124006,124012,124026,124034,124036,124048,124062,124064,124092,124102,124108,124120,124142,124146,124148,124162,124164,124168,124176,124190,124192,124220,124224,124280,124294,124300,124312,124336,124350,124366,124380,124386,124388,124392,124406,124442,124462,124466,124468,124494,124508,124514,124520,124558,124572,124600,124610,124612,124616,124624,124646,124666,124694,124710,124716,124730,124742,124748,124760,124786,124788,124818,124820,124834,124836,124840,124854,124946,124948,124962,124964,124968,124982,124994,124996,125e3,125008,125022,125030,125036,125050,125058,125060,125064,125072,125086,125088,125116,125126,125132,125144,125166,125170,125172,125186,125188,125192,125200,125216,125244,125248,125304,125318,125324,125336,125360,125374,125390,125404,125410,125412,125416,125430,125444,125448,125456,125472,125504,125560,125680,125702,125708,125720,125744,125758,125792,125820,125838,125852,125880,125890,125892,125896,125904,125918,125926,125932,125978,125998,126002,126004,126030,126044,126050,126052,126056,126094,126108,126136,126146,126148,126152,126160,126182,126202,126222,126236,126264,126320,126334,126338,126340,126344,126352,126366,126368,126412,126450,126452,126486,126502,126508,126522,126534,126540,126552,126574,126578,126580,126598,126604,126616,126640,126654,126670,126684,126690,126692,126696,126738,126754,126756,126760,126774,126786,126788,126792,126800,126814,126822,126828,126842,126894,126898,126900,126934,127126,127142,127148,127162,127178,127186,127188,127254,127270,127276,127290,127302,127308,127320,127342,127346,127348,127370,127378,127380,127394,127396,127400,127450,127510,127526,127532,127546,127558,127576,127598,127602,127604,127622,127628,127640,127664,127678,127694,127708,127714,127716,127720,127734,127754,127762,127764,127778,127784,127810,127812,127816,127824,127838,127846,127866,127898,127918,127922,127924,128022,128038,128044,128058,128070,128076,128088,128110,128114,128116,128134,128140,128152,128176,128190,128206,128220,128226,128228,128232,128246,128262,128268,128280,128304,128318,128352,128380,128398,128412,128440,128450,128452,128456,128464,128478,128486,128492,128506,128522,128530,128532,128546,128548,128552,128566,128578,128580,128584,128592,128606,128614,128634,128642,128644,128648,128656,128670,128672,128700,128716,128754,128756,128794,128814,128818,128820,128846,128860,128866,128868,128872,128886,128918,128934,128940,128954,128978,128980,129178,129198,129202,129204,129238,129258,129306,129326,129330,129332,129358,129372,129378,129380,129384,129398,129430,129446,129452,129466,129482,129490,129492,129562,129582,129586,129588,129614,129628,129634,129636,129640,129654,129678,129692,129720,129730,129732,129736,129744,129758,129766,129772,129814,129830,129836,129850,129862,129868,129880,129902,129906,129908,129930,129938,129940,129954,129956,129960,129974,130010]),t.CODEWORD_TABLE=Int32Array.from([2627,1819,2622,2621,1813,1812,2729,2724,2723,2779,2774,2773,902,896,908,868,865,861,859,2511,873,871,1780,835,2493,825,2491,842,837,844,1764,1762,811,810,809,2483,807,2482,806,2480,815,814,813,812,2484,817,816,1745,1744,1742,1746,2655,2637,2635,2626,2625,2623,2628,1820,2752,2739,2737,2728,2727,2725,2730,2785,2783,2778,2777,2775,2780,787,781,747,739,736,2413,754,752,1719,692,689,681,2371,678,2369,700,697,694,703,1688,1686,642,638,2343,631,2341,627,2338,651,646,643,2345,654,652,1652,1650,1647,1654,601,599,2322,596,2321,594,2319,2317,611,610,608,606,2324,603,2323,615,614,612,1617,1616,1614,1612,616,1619,1618,2575,2538,2536,905,901,898,909,2509,2507,2504,870,867,864,860,2512,875,872,1781,2490,2489,2487,2485,1748,836,834,832,830,2494,827,2492,843,841,839,845,1765,1763,2701,2676,2674,2653,2648,2656,2634,2633,2631,2629,1821,2638,2636,2770,2763,2761,2750,2745,2753,2736,2735,2733,2731,1848,2740,2738,2786,2784,591,588,576,569,566,2296,1590,537,534,526,2276,522,2274,545,542,539,548,1572,1570,481,2245,466,2242,462,2239,492,485,482,2249,496,494,1534,1531,1528,1538,413,2196,406,2191,2188,425,419,2202,415,2199,432,430,427,1472,1467,1464,433,1476,1474,368,367,2160,365,2159,362,2157,2155,2152,378,377,375,2166,372,2165,369,2162,383,381,379,2168,1419,1418,1416,1414,385,1411,384,1423,1422,1420,1424,2461,802,2441,2439,790,786,783,794,2409,2406,2403,750,742,738,2414,756,753,1720,2367,2365,2362,2359,1663,693,691,684,2373,680,2370,702,699,696,704,1690,1687,2337,2336,2334,2332,1624,2329,1622,640,637,2344,634,2342,630,2340,650,648,645,2346,655,653,1653,1651,1649,1655,2612,2597,2595,2571,2568,2565,2576,2534,2529,2526,1787,2540,2537,907,904,900,910,2503,2502,2500,2498,1768,2495,1767,2510,2508,2506,869,866,863,2513,876,874,1782,2720,2713,2711,2697,2694,2691,2702,2672,2670,2664,1828,2678,2675,2647,2646,2644,2642,1823,2639,1822,2654,2652,2650,2657,2771,1855,2765,2762,1850,1849,2751,2749,2747,2754,353,2148,344,342,336,2142,332,2140,345,1375,1373,306,2130,299,2128,295,2125,319,314,311,2132,1354,1352,1349,1356,262,257,2101,253,2096,2093,274,273,267,2107,263,2104,280,278,275,1316,1311,1308,1320,1318,2052,202,2050,2044,2040,219,2063,212,2060,208,2055,224,221,2066,1260,1258,1252,231,1248,229,1266,1264,1261,1268,155,1998,153,1996,1994,1991,1988,165,164,2007,162,2006,159,2003,2e3,172,171,169,2012,166,2010,1186,1184,1182,1179,175,1176,173,1192,1191,1189,1187,176,1194,1193,2313,2307,2305,592,589,2294,2292,2289,578,572,568,2297,580,1591,2272,2267,2264,1547,538,536,529,2278,525,2275,547,544,541,1574,1571,2237,2235,2229,1493,2225,1489,478,2247,470,2244,465,2241,493,488,484,2250,498,495,1536,1533,1530,1539,2187,2186,2184,2182,1432,2179,1430,2176,1427,414,412,2197,409,2195,405,2193,2190,426,424,421,2203,418,2201,431,429,1473,1471,1469,1466,434,1477,1475,2478,2472,2470,2459,2457,2454,2462,803,2437,2432,2429,1726,2443,2440,792,789,785,2401,2399,2393,1702,2389,1699,2411,2408,2405,745,741,2415,758,755,1721,2358,2357,2355,2353,1661,2350,1660,2347,1657,2368,2366,2364,2361,1666,690,687,2374,683,2372,701,698,705,1691,1689,2619,2617,2610,2608,2605,2613,2593,2588,2585,1803,2599,2596,2563,2561,2555,1797,2551,1795,2573,2570,2567,2577,2525,2524,2522,2520,1786,2517,1785,2514,1783,2535,2533,2531,2528,1788,2541,2539,906,903,911,2721,1844,2715,2712,1838,1836,2699,2696,2693,2703,1827,1826,1824,2673,2671,2669,2666,1829,2679,2677,1858,1857,2772,1854,1853,1851,1856,2766,2764,143,1987,139,1986,135,133,131,1984,128,1983,125,1981,138,137,136,1985,1133,1132,1130,112,110,1974,107,1973,104,1971,1969,122,121,119,117,1977,114,1976,124,1115,1114,1112,1110,1117,1116,84,83,1953,81,1952,78,1950,1948,1945,94,93,91,1959,88,1958,85,1955,99,97,95,1961,1086,1085,1083,1081,1078,100,1090,1089,1087,1091,49,47,1917,44,1915,1913,1910,1907,59,1926,56,1925,53,1922,1919,66,64,1931,61,1929,1042,1040,1038,71,1035,70,1032,68,1048,1047,1045,1043,1050,1049,12,10,1869,1867,1864,1861,21,1880,19,1877,1874,1871,28,1888,25,1886,22,1883,982,980,977,974,32,30,991,989,987,984,34,995,994,992,2151,2150,2147,2146,2144,356,355,354,2149,2139,2138,2136,2134,1359,343,341,338,2143,335,2141,348,347,346,1376,1374,2124,2123,2121,2119,1326,2116,1324,310,308,305,2131,302,2129,298,2127,320,318,316,313,2133,322,321,1355,1353,1351,1357,2092,2091,2089,2087,1276,2084,1274,2081,1271,259,2102,256,2100,252,2098,2095,272,269,2108,266,2106,281,279,277,1317,1315,1313,1310,282,1321,1319,2039,2037,2035,2032,1203,2029,1200,1197,207,2053,205,2051,201,2049,2046,2043,220,218,2064,215,2062,211,2059,228,226,223,2069,1259,1257,1254,232,1251,230,1267,1265,1263,2316,2315,2312,2311,2309,2314,2304,2303,2301,2299,1593,2308,2306,590,2288,2287,2285,2283,1578,2280,1577,2295,2293,2291,579,577,574,571,2298,582,581,1592,2263,2262,2260,2258,1545,2255,1544,2252,1541,2273,2271,2269,2266,1550,535,532,2279,528,2277,546,543,549,1575,1573,2224,2222,2220,1486,2217,1485,2214,1482,1479,2238,2236,2234,2231,1496,2228,1492,480,477,2248,473,2246,469,2243,490,487,2251,497,1537,1535,1532,2477,2476,2474,2479,2469,2468,2466,2464,1730,2473,2471,2453,2452,2450,2448,1729,2445,1728,2460,2458,2456,2463,805,804,2428,2427,2425,2423,1725,2420,1724,2417,1722,2438,2436,2434,2431,1727,2444,2442,793,791,788,795,2388,2386,2384,1697,2381,1696,2378,1694,1692,2402,2400,2398,2395,1703,2392,1701,2412,2410,2407,751,748,744,2416,759,757,1807,2620,2618,1806,1805,2611,2609,2607,2614,1802,1801,1799,2594,2592,2590,2587,1804,2600,2598,1794,1793,1791,1789,2564,2562,2560,2557,1798,2554,1796,2574,2572,2569,2578,1847,1846,2722,1843,1842,1840,1845,2716,2714,1835,1834,1832,1830,1839,1837,2700,2698,2695,2704,1817,1811,1810,897,862,1777,829,826,838,1760,1758,808,2481,1741,1740,1738,1743,2624,1818,2726,2776,782,740,737,1715,686,679,695,1682,1680,639,628,2339,647,644,1645,1643,1640,1648,602,600,597,595,2320,593,2318,609,607,604,1611,1610,1608,1606,613,1615,1613,2328,926,924,892,886,899,857,850,2505,1778,824,823,821,819,2488,818,2486,833,831,828,840,1761,1759,2649,2632,2630,2746,2734,2732,2782,2781,570,567,1587,531,527,523,540,1566,1564,476,467,463,2240,486,483,1524,1521,1518,1529,411,403,2192,399,2189,423,416,1462,1457,1454,428,1468,1465,2210,366,363,2158,360,2156,357,2153,376,373,370,2163,1410,1409,1407,1405,382,1402,380,1417,1415,1412,1421,2175,2174,777,774,771,784,732,725,722,2404,743,1716,676,674,668,2363,665,2360,685,1684,1681,626,624,622,2335,620,2333,617,2330,641,635,649,1646,1644,1642,2566,928,925,2530,2527,894,891,888,2501,2499,2496,858,856,854,851,1779,2692,2668,2665,2645,2643,2640,2651,2768,2759,2757,2744,2743,2741,2748,352,1382,340,337,333,1371,1369,307,300,296,2126,315,312,1347,1342,1350,261,258,250,2097,246,2094,271,268,264,1306,1301,1298,276,1312,1309,2115,203,2048,195,2045,191,2041,213,209,2056,1246,1244,1238,225,1234,222,1256,1253,1249,1262,2080,2079,154,1997,150,1995,147,1992,1989,163,160,2004,156,2001,1175,1174,1172,1170,1167,170,1164,167,1185,1183,1180,1177,174,1190,1188,2025,2024,2022,587,586,564,559,556,2290,573,1588,520,518,512,2268,508,2265,530,1568,1565,461,457,2233,450,2230,446,2226,479,471,489,1526,1523,1520,397,395,2185,392,2183,389,2180,2177,410,2194,402,422,1463,1461,1459,1456,1470,2455,799,2433,2430,779,776,773,2397,2394,2390,734,728,724,746,1717,2356,2354,2351,2348,1658,677,675,673,670,667,688,1685,1683,2606,2589,2586,2559,2556,2552,927,2523,2521,2518,2515,1784,2532,895,893,890,2718,2709,2707,2689,2687,2684,2663,2662,2660,2658,1825,2667,2769,1852,2760,2758,142,141,1139,1138,134,132,129,126,1982,1129,1128,1126,1131,113,111,108,105,1972,101,1970,120,118,115,1109,1108,1106,1104,123,1113,1111,82,79,1951,75,1949,72,1946,92,89,86,1956,1077,1076,1074,1072,98,1069,96,1084,1082,1079,1088,1968,1967,48,45,1916,42,1914,39,1911,1908,60,57,54,1923,50,1920,1031,1030,1028,1026,67,1023,65,1020,62,1041,1039,1036,1033,69,1046,1044,1944,1943,1941,11,9,1868,7,1865,1862,1859,20,1878,16,1875,13,1872,970,968,966,963,29,960,26,23,983,981,978,975,33,971,31,990,988,985,1906,1904,1902,993,351,2145,1383,331,330,328,326,2137,323,2135,339,1372,1370,294,293,291,289,2122,286,2120,283,2117,309,303,317,1348,1346,1344,245,244,242,2090,239,2088,236,2085,2082,260,2099,249,270,1307,1305,1303,1300,1314,189,2038,186,2036,183,2033,2030,2026,206,198,2047,194,216,1247,1245,1243,1240,227,1237,1255,2310,2302,2300,2286,2284,2281,565,563,561,558,575,1589,2261,2259,2256,2253,1542,521,519,517,514,2270,511,533,1569,1567,2223,2221,2218,2215,1483,2211,1480,459,456,453,2232,449,474,491,1527,1525,1522,2475,2467,2465,2451,2449,2446,801,800,2426,2424,2421,2418,1723,2435,780,778,775,2387,2385,2382,2379,1695,2375,1693,2396,735,733,730,727,749,1718,2616,2615,2604,2603,2601,2584,2583,2581,2579,1800,2591,2550,2549,2547,2545,1792,2542,1790,2558,929,2719,1841,2710,2708,1833,1831,2690,2688,2686,1815,1809,1808,1774,1756,1754,1737,1736,1734,1739,1816,1711,1676,1674,633,629,1638,1636,1633,1641,598,1605,1604,1602,1600,605,1609,1607,2327,887,853,1775,822,820,1757,1755,1584,524,1560,1558,468,464,1514,1511,1508,1519,408,404,400,1452,1447,1444,417,1458,1455,2208,364,361,358,2154,1401,1400,1398,1396,374,1393,371,1408,1406,1403,1413,2173,2172,772,726,723,1712,672,669,666,682,1678,1675,625,623,621,618,2331,636,632,1639,1637,1635,920,918,884,880,889,849,848,847,846,2497,855,852,1776,2641,2742,2787,1380,334,1367,1365,301,297,1340,1338,1335,1343,255,251,247,1296,1291,1288,265,1302,1299,2113,204,196,192,2042,1232,1230,1224,214,1220,210,1242,1239,1235,1250,2077,2075,151,148,1993,144,1990,1163,1162,1160,1158,1155,161,1152,157,1173,1171,1168,1165,168,1181,1178,2021,2020,2018,2023,585,560,557,1585,516,509,1562,1559,458,447,2227,472,1516,1513,1510,398,396,393,390,2181,386,2178,407,1453,1451,1449,1446,420,1460,2209,769,764,720,712,2391,729,1713,664,663,661,659,2352,656,2349,671,1679,1677,2553,922,919,2519,2516,885,883,881,2685,2661,2659,2767,2756,2755,140,1137,1136,130,127,1125,1124,1122,1127,109,106,102,1103,1102,1100,1098,116,1107,1105,1980,80,76,73,1947,1068,1067,1065,1063,90,1060,87,1075,1073,1070,1080,1966,1965,46,43,40,1912,36,1909,1019,1018,1016,1014,58,1011,55,1008,51,1029,1027,1024,1021,63,1037,1034,1940,1939,1937,1942,8,1866,4,1863,1,1860,956,954,952,949,946,17,14,969,967,964,961,27,957,24,979,976,972,1901,1900,1898,1896,986,1905,1903,350,349,1381,329,327,324,1368,1366,292,290,287,284,2118,304,1341,1339,1337,1345,243,240,237,2086,233,2083,254,1297,1295,1293,1290,1304,2114,190,187,184,2034,180,2031,177,2027,199,1233,1231,1229,1226,217,1223,1241,2078,2076,584,555,554,552,550,2282,562,1586,507,506,504,502,2257,499,2254,515,1563,1561,445,443,441,2219,438,2216,435,2212,460,454,475,1517,1515,1512,2447,798,797,2422,2419,770,768,766,2383,2380,2376,721,719,717,714,731,1714,2602,2582,2580,2548,2546,2543,923,921,2717,2706,2705,2683,2682,2680,1771,1752,1750,1733,1732,1731,1735,1814,1707,1670,1668,1631,1629,1626,1634,1599,1598,1596,1594,1603,1601,2326,1772,1753,1751,1581,1554,1552,1504,1501,1498,1509,1442,1437,1434,401,1448,1445,2206,1392,1391,1389,1387,1384,359,1399,1397,1394,1404,2171,2170,1708,1672,1669,619,1632,1630,1628,1773,1378,1363,1361,1333,1328,1336,1286,1281,1278,248,1292,1289,2111,1218,1216,1210,197,1206,193,1228,1225,1221,1236,2073,2071,1151,1150,1148,1146,152,1143,149,1140,145,1161,1159,1156,1153,158,1169,1166,2017,2016,2014,2019,1582,510,1556,1553,452,448,1506,1500,394,391,387,1443,1441,1439,1436,1450,2207,765,716,713,1709,662,660,657,1673,1671,916,914,879,878,877,882,1135,1134,1121,1120,1118,1123,1097,1096,1094,1092,103,1101,1099,1979,1059,1058,1056,1054,77,1051,74,1066,1064,1061,1071,1964,1963,1007,1006,1004,1002,999,41,996,37,1017,1015,1012,1009,52,1025,1022,1936,1935,1933,1938,942,940,938,935,932,5,2,955,953,950,947,18,943,15,965,962,958,1895,1894,1892,1890,973,1899,1897,1379,325,1364,1362,288,285,1334,1332,1330,241,238,234,1287,1285,1283,1280,1294,2112,188,185,181,178,2028,1219,1217,1215,1212,200,1209,1227,2074,2072,583,553,551,1583,505,503,500,513,1557,1555,444,442,439,436,2213,455,451,1507,1505,1502,796,763,762,760,767,711,710,708,706,2377,718,715,1710,2544,917,915,2681,1627,1597,1595,2325,1769,1749,1747,1499,1438,1435,2204,1390,1388,1385,1395,2169,2167,1704,1665,1662,1625,1623,1620,1770,1329,1282,1279,2109,1214,1207,1222,2068,2065,1149,1147,1144,1141,146,1157,1154,2013,2011,2008,2015,1579,1549,1546,1495,1487,1433,1431,1428,1425,388,1440,2205,1705,658,1667,1664,1119,1095,1093,1978,1057,1055,1052,1062,1962,1960,1005,1003,1e3,997,38,1013,1010,1932,1930,1927,1934,941,939,936,933,6,930,3,951,948,944,1889,1887,1884,1881,959,1893,1891,35,1377,1360,1358,1327,1325,1322,1331,1277,1275,1272,1269,235,1284,2110,1205,1204,1201,1198,182,1195,179,1213,2070,2067,1580,501,1551,1548,440,437,1497,1494,1490,1503,761,709,707,1706,913,912,2198,1386,2164,2161,1621,1766,2103,1208,2058,2054,1145,1142,2005,2002,1999,2009,1488,1429,1426,2200,1698,1659,1656,1975,1053,1957,1954,1001,998,1924,1921,1918,1928,937,934,931,1879,1876,1873,1870,945,1885,1882,1323,1273,1270,2105,1202,1199,1196,1211,2061,2057,1576,1543,1540,1484,1481,1478,1491,1700]),t}(),ca=function(){function t(t,e){this.bits=t,this.points=e}return t.prototype.getBits=function(){return this.bits},t.prototype.getPoints=function(){return this.points},t}(),ha=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},fa=function(){function t(){}return t.detectMultiple=function(e,r,n){var o=e.getBlackMatrix(),i=t.detect(n,o);return i.length||((o=o.clone()).rotate180(),i=t.detect(n,o)),new ca(o,i)},t.detect=function(e,r){for(var n,o,i=new Array,a=0,s=0,u=!1;a<r.getHeight();){var l=t.findVertices(r,a,s);if(null!=l[0]||null!=l[3]){if(u=!0,i.push(l),!e)break;null!=l[2]?(s=Math.trunc(l[2].getX()),a=Math.trunc(l[2].getY())):(s=Math.trunc(l[4].getX()),a=Math.trunc(l[4].getY()))}else{if(!u)break;u=!1,s=0;try{for(var c=(n=void 0,ha(i)),h=c.next();!h.done;h=c.next()){var f=h.value;null!=f[1]&&(a=Math.trunc(Math.max(a,f[1].getY()))),null!=f[3]&&(a=Math.max(a,Math.trunc(f[3].getY())))}}catch(d){n={error:d}}finally{try{h&&!h.done&&(o=c.return)&&o.call(c)}finally{if(n)throw n.error}}a+=t.ROW_STEP}}return i},t.findVertices=function(e,r,n){var o=e.getHeight(),i=e.getWidth(),a=new Array(8);return t.copyToResult(a,t.findRowsWithPattern(e,o,i,r,n,t.START_PATTERN),t.INDEXES_START_PATTERN),null!=a[4]&&(n=Math.trunc(a[4].getX()),r=Math.trunc(a[4].getY())),t.copyToResult(a,t.findRowsWithPattern(e,o,i,r,n,t.STOP_PATTERN),t.INDEXES_STOP_PATTERN),a},t.copyToResult=function(t,e,r){for(var n=0;n<r.length;n++)t[r[n]]=e[n]},t.findRowsWithPattern=function(e,r,n,o,i,a){for(var s=new Array(4),u=!1,l=new Int32Array(a.length);o<r;o+=t.ROW_STEP)if(null!=(d=t.findGuardPattern(e,i,o,n,!1,a,l))){for(;o>0;){if(null==(f=t.findGuardPattern(e,i,--o,n,!1,a,l))){o++;break}d=f}s[0]=new kn(d[0],o),s[1]=new kn(d[1],o),u=!0;break}var c=o+1;if(u){for(var h=0,f=Int32Array.from([Math.trunc(s[0].getX()),Math.trunc(s[1].getX())]);c<r;c++){var d;if(null!=(d=t.findGuardPattern(e,f[0],c,n,!1,a,l))&&Math.abs(f[0]-d[0])<t.MAX_PATTERN_DRIFT&&Math.abs(f[1]-d[1])<t.MAX_PATTERN_DRIFT)f=d,h=0;else{if(h>t.SKIPPED_ROW_COUNT_MAX)break;h++}}c-=h+1,s[2]=new kn(f[0],c),s[3]=new kn(f[1],c)}return c-o<t.BARCODE_MIN_HEIGHT&&Pr.fill(s,null),s},t.findGuardPattern=function(e,r,n,o,i,a,s){Pr.fillWithin(s,0,s.length,0);for(var u=r,l=0;e.get(u,n)&&u>0&&l++<t.MAX_PIXEL_DRIFT;)u--;for(var c=u,h=0,f=a.length,d=i;c<o;c++)if(e.get(c,n)!==d)s[h]++;else{if(h===f-1){if(t.patternMatchVariance(s,a,t.MAX_INDIVIDUAL_VARIANCE)<t.MAX_AVG_VARIANCE)return new Int32Array([u,c]);u+=s[0]+s[1],Tr.arraycopy(s,2,s,0,h-1),s[h-1]=0,s[h]=0,h--}else h++;s[h]=1,d=!d}return h===f-1&&t.patternMatchVariance(s,a,t.MAX_INDIVIDUAL_VARIANCE)<t.MAX_AVG_VARIANCE?new Int32Array([u,c-1]):null},t.patternMatchVariance=function(t,e,r){for(var n=t.length,o=0,i=0,a=0;a<n;a++)o+=t[a],i+=e[a];if(o<i)return 1/0;var s=o/i;r*=s;for(var u=0,l=0;l<n;l++){var c=t[l],h=e[l]*s,f=c>h?c-h:h-c;if(f>r)return 1/0;u+=f}return u/o},t.INDEXES_START_PATTERN=Int32Array.from([0,4,1,5]),t.INDEXES_STOP_PATTERN=Int32Array.from([6,2,7,3]),t.MAX_AVG_VARIANCE=.42,t.MAX_INDIVIDUAL_VARIANCE=.8,t.START_PATTERN=Int32Array.from([8,1,1,1,1,1,1,3]),t.STOP_PATTERN=Int32Array.from([7,1,1,3,1,1,1,2,1]),t.MAX_PIXEL_DRIFT=3,t.MAX_PATTERN_DRIFT=5,t.SKIPPED_ROW_COUNT_MAX=25,t.ROW_STEP=5,t.BARCODE_MIN_HEIGHT=10,t}(),da=function(){function t(t,e){if(0===e.length)throw new Er;this.field=t;var r=e.length;if(r>1&&0===e[0]){for(var n=1;n<r&&0===e[n];)n++;n===r?this.coefficients=new Int32Array([0]):(this.coefficients=new Int32Array(r-n),Tr.arraycopy(e,n,this.coefficients,0,this.coefficients.length))}else this.coefficients=e}return t.prototype.getCoefficients=function(){return this.coefficients},t.prototype.getDegree=function(){return this.coefficients.length-1},t.prototype.isZero=function(){return 0===this.coefficients[0]},t.prototype.getCoefficient=function(t){return this.coefficients[this.coefficients.length-1-t]},t.prototype.evaluateAt=function(t){var e,r;if(0===t)return this.getCoefficient(0);if(1===t){var n=0;try{for(var o=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(this.coefficients),i=o.next();!i.done;i=o.next()){var a=i.value;n=this.field.add(n,a)}}catch(c){e={error:c}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return n}for(var s=this.coefficients[0],u=this.coefficients.length,l=1;l<u;l++)s=this.field.add(this.field.multiply(t,s),this.coefficients[l]);return s},t.prototype.add=function(e){if(!this.field.equals(e.field))throw new Er("ModulusPolys do not have same ModulusGF field");if(this.isZero())return e;if(e.isZero())return this;var r=this.coefficients,n=e.coefficients;if(r.length>n.length){var o=r;r=n,n=o}var i=new Int32Array(n.length),a=n.length-r.length;Tr.arraycopy(n,0,i,0,a);for(var s=a;s<n.length;s++)i[s]=this.field.add(r[s-a],n[s]);return new t(this.field,i)},t.prototype.subtract=function(t){if(!this.field.equals(t.field))throw new Er("ModulusPolys do not have same ModulusGF field");return t.isZero()?this:this.add(t.negative())},t.prototype.multiply=function(e){return e instanceof t?this.multiplyOther(e):this.multiplyScalar(e)},t.prototype.multiplyOther=function(e){if(!this.field.equals(e.field))throw new Er("ModulusPolys do not have same ModulusGF field");if(this.isZero()||e.isZero())return new t(this.field,new Int32Array([0]));for(var r=this.coefficients,n=r.length,o=e.coefficients,i=o.length,a=new Int32Array(n+i-1),s=0;s<n;s++)for(var u=r[s],l=0;l<i;l++)a[s+l]=this.field.add(a[s+l],this.field.multiply(u,o[l]));return new t(this.field,a)},t.prototype.negative=function(){for(var e=this.coefficients.length,r=new Int32Array(e),n=0;n<e;n++)r[n]=this.field.subtract(0,this.coefficients[n]);return new t(this.field,r)},t.prototype.multiplyScalar=function(e){if(0===e)return new t(this.field,new Int32Array([0]));if(1===e)return this;for(var r=this.coefficients.length,n=new Int32Array(r),o=0;o<r;o++)n[o]=this.field.multiply(this.coefficients[o],e);return new t(this.field,n)},t.prototype.multiplyByMonomial=function(e,r){if(e<0)throw new Er;if(0===r)return new t(this.field,new Int32Array([0]));for(var n=this.coefficients.length,o=new Int32Array(n+e),i=0;i<n;i++)o[i]=this.field.multiply(this.coefficients[i],r);return new t(this.field,o)},t.prototype.toString=function(){for(var t=new $r,e=this.getDegree();e>=0;e--){var r=this.getCoefficient(e);0!==r&&(r<0?(t.append(" - "),r=-r):t.length()>0&&t.append(" + "),0!==e&&1===r||t.append(r),0!==e&&(1===e?t.append("x"):(t.append("x^"),t.append(e))))}return t.toString()},t}(),pa=function(){function t(){}return t.prototype.add=function(t,e){return(t+e)%this.modulus},t.prototype.subtract=function(t,e){return(this.modulus+t-e)%this.modulus},t.prototype.exp=function(t){return this.expTable[t]},t.prototype.log=function(t){if(0===t)throw new Er;return this.logTable[t]},t.prototype.inverse=function(t){if(0===t)throw new wn;return this.expTable[this.modulus-this.logTable[t]-1]},t.prototype.multiply=function(t,e){return 0===t||0===e?0:this.expTable[(this.logTable[t]+this.logTable[e])%(this.modulus-1)]},t.prototype.getSize=function(){return this.modulus},t.prototype.equals=function(t){return t===this},t}(),ga=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ma=function(t){function e(e,r){var n=t.call(this)||this;n.modulus=e,n.expTable=new Int32Array(e),n.logTable=new Int32Array(e);for(var o=1,i=0;i<e;i++)n.expTable[i]=o,o=o*r%e;for(i=0;i<e-1;i++)n.logTable[n.expTable[i]]=i;return n.zero=new da(n,new Int32Array([0])),n.one=new da(n,new Int32Array([1])),n}return ga(e,t),e.prototype.getZero=function(){return this.zero},e.prototype.getOne=function(){return this.one},e.prototype.buildMonomial=function(t,e){if(t<0)throw new Er;if(0===e)return this.zero;var r=new Int32Array(t+1);return r[0]=e,new da(this,r)},e.PDF417_GF=new e(la.NUMBER_OF_CODEWORDS,3),e}(pa),va=function(){function t(){this.field=ma.PDF417_GF}return t.prototype.decode=function(t,e,r){for(var n,o,i=new da(this.field,t),a=new Int32Array(e),s=!1,u=e;u>0;u--){var l=i.evaluateAt(this.field.exp(u));a[e-u]=l,0!==l&&(s=!0)}if(!s)return 0;var c=this.field.getOne();if(null!=r)try{for(var h=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(r),f=h.next();!f.done;f=h.next()){var d=f.value,p=this.field.exp(t.length-1-d),g=new da(this.field,new Int32Array([this.field.subtract(0,p),1]));c=c.multiply(g)}}catch(A){n={error:A}}finally{try{f&&!f.done&&(o=h.return)&&o.call(h)}finally{if(n)throw n.error}}var m=new da(this.field,a),v=this.runEuclideanAlgorithm(this.field.buildMonomial(e,1),m,e),y=v[0],_=v[1],w=this.findErrorLocations(y),b=this.findErrorMagnitudes(_,y,w);for(u=0;u<w.length;u++){var C=t.length-1-this.field.log(w[u]);if(C<0)throw xr.getChecksumInstance();t[C]=this.field.subtract(t[C],b[u])}return w.length},t.prototype.runEuclideanAlgorithm=function(t,e,r){if(t.getDegree()<e.getDegree()){var n=t;t=e,e=n}for(var o=t,i=e,a=this.field.getZero(),s=this.field.getOne();i.getDegree()>=Math.round(r/2);){var u=o,l=a;if(a=s,(o=i).isZero())throw xr.getChecksumInstance();i=u;for(var c=this.field.getZero(),h=o.getCoefficient(o.getDegree()),f=this.field.inverse(h);i.getDegree()>=o.getDegree()&&!i.isZero();){var d=i.getDegree()-o.getDegree(),p=this.field.multiply(i.getCoefficient(i.getDegree()),f);c=c.add(this.field.buildMonomial(d,p)),i=i.subtract(o.multiplyByMonomial(d,p))}s=c.multiply(a).subtract(l).negative()}var g=s.getCoefficient(0);if(0===g)throw xr.getChecksumInstance();var m=this.field.inverse(g);return[s.multiply(m),i.multiply(m)]},t.prototype.findErrorLocations=function(t){for(var e=t.getDegree(),r=new Int32Array(e),n=0,o=1;o<this.field.getSize()&&n<e;o++)0===t.evaluateAt(o)&&(r[n]=this.field.inverse(o),n++);if(n!==e)throw xr.getChecksumInstance();return r},t.prototype.findErrorMagnitudes=function(t,e,r){for(var n=e.getDegree(),o=new Int32Array(n),i=1;i<=n;i++)o[n-i]=this.field.multiply(i,e.getCoefficient(i));var a=new da(this.field,o),s=r.length,u=new Int32Array(s);for(i=0;i<s;i++){var l=this.field.inverse(r[i]),c=this.field.subtract(0,t.evaluateAt(l)),h=this.field.inverse(a.evaluateAt(l));u[i]=this.field.multiply(c,h)}return u},t}(),ya=function(){function t(e,r,n,o,i){e instanceof t?this.constructor_2(e):this.constructor_1(e,r,n,o,i)}return t.prototype.constructor_1=function(t,e,r,n,o){var i=null==e||null==r,a=null==n||null==o;if(i&&a)throw new Kr;i?(e=new kn(0,n.getY()),r=new kn(0,o.getY())):a&&(n=new kn(t.getWidth()-1,e.getY()),o=new kn(t.getWidth()-1,r.getY())),this.image=t,this.topLeft=e,this.bottomLeft=r,this.topRight=n,this.bottomRight=o,this.minX=Math.trunc(Math.min(e.getX(),r.getX())),this.maxX=Math.trunc(Math.max(n.getX(),o.getX())),this.minY=Math.trunc(Math.min(e.getY(),n.getY())),this.maxY=Math.trunc(Math.max(r.getY(),o.getY()))},t.prototype.constructor_2=function(t){this.image=t.image,this.topLeft=t.getTopLeft(),this.bottomLeft=t.getBottomLeft(),this.topRight=t.getTopRight(),this.bottomRight=t.getBottomRight(),this.minX=t.getMinX(),this.maxX=t.getMaxX(),this.minY=t.getMinY(),this.maxY=t.getMaxY()},t.merge=function(e,r){return null==e?r:null==r?e:new t(e.image,e.topLeft,e.bottomLeft,r.topRight,r.bottomRight)},t.prototype.addMissingRows=function(e,r,n){var o=this.topLeft,i=this.bottomLeft,a=this.topRight,s=this.bottomRight;if(e>0){var u=n?this.topLeft:this.topRight,l=Math.trunc(u.getY()-e);l<0&&(l=0);var c=new kn(u.getX(),l);n?o=c:a=c}if(r>0){var h=n?this.bottomLeft:this.bottomRight,f=Math.trunc(h.getY()+r);f>=this.image.getHeight()&&(f=this.image.getHeight()-1);var d=new kn(h.getX(),f);n?i=d:s=d}return new t(this.image,o,i,a,s)},t.prototype.getMinX=function(){return this.minX},t.prototype.getMaxX=function(){return this.maxX},t.prototype.getMinY=function(){return this.minY},t.prototype.getMaxY=function(){return this.maxY},t.prototype.getTopLeft=function(){return this.topLeft},t.prototype.getTopRight=function(){return this.topRight},t.prototype.getBottomLeft=function(){return this.bottomLeft},t.prototype.getBottomRight=function(){return this.bottomRight},t}(),_a=function(){function t(t,e,r,n){this.columnCount=t,this.errorCorrectionLevel=n,this.rowCountUpperPart=e,this.rowCountLowerPart=r,this.rowCount=e+r}return t.prototype.getColumnCount=function(){return this.columnCount},t.prototype.getErrorCorrectionLevel=function(){return this.errorCorrectionLevel},t.prototype.getRowCount=function(){return this.rowCount},t.prototype.getRowCountUpperPart=function(){return this.rowCountUpperPart},t.prototype.getRowCountLowerPart=function(){return this.rowCountLowerPart},t}(),wa=function(){function t(){this.buffer=""}return t.form=function(t,e){var r=-1;return t.replace(/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g,function(t,n,o,i,a,s){if("%%"===t)return"%";if(void 0!==e[++r]){t=i?parseInt(i.substr(1)):void 0;var u,l=a?parseInt(a.substr(1)):void 0;switch(s){case"s":u=e[r];break;case"c":u=e[r][0];break;case"f":u=parseFloat(e[r]).toFixed(t);break;case"p":u=parseFloat(e[r]).toPrecision(t);break;case"e":u=parseFloat(e[r]).toExponential(t);break;case"x":u=parseInt(e[r]).toString(l||16);break;case"d":u=parseFloat(parseInt(e[r],l||10).toPrecision(t)).toFixed(0)}u="object"==typeof u?JSON.stringify(u):(+u).toString(l);for(var c=parseInt(o),h=o&&o[0]+""=="0"?"0":" ";u.length<c;)u=void 0!==n?u+h:h+u;return u}})},t.prototype.format=function(e){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this.buffer+=t.form(e,r)},t.prototype.toString=function(){return this.buffer},t}(),ba=function(){function t(t){this.boundingBox=new ya(t),this.codewords=new Array(t.getMaxY()-t.getMinY()+1)}return t.prototype.getCodewordNearby=function(e){var r=this.getCodeword(e);if(null!=r)return r;for(var n=1;n<t.MAX_NEARBY_DISTANCE;n++){var o=this.imageRowToCodewordIndex(e)-n;if(o>=0&&null!=(r=this.codewords[o]))return r;if((o=this.imageRowToCodewordIndex(e)+n)<this.codewords.length&&null!=(r=this.codewords[o]))return r}return null},t.prototype.imageRowToCodewordIndex=function(t){return t-this.boundingBox.getMinY()},t.prototype.setCodeword=function(t,e){this.codewords[this.imageRowToCodewordIndex(t)]=e},t.prototype.getCodeword=function(t){return this.codewords[this.imageRowToCodewordIndex(t)]},t.prototype.getBoundingBox=function(){return this.boundingBox},t.prototype.getCodewords=function(){return this.codewords},t.prototype.toString=function(){var t,e,r=new wa,n=0;try{for(var o=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(this.codewords),i=o.next();!i.done;i=o.next()){var a=i.value;null!=a?r.format("%3d: %3d|%3d%n",n++,a.getRowNumber(),a.getValue()):r.format("%3d: | %n",n++)}}catch(s){t={error:s}}finally{try{i&&!i.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}return r.toString()},t.MAX_NEARBY_DISTANCE=5,t}(),Ca=function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(s){o={error:s}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},Aa=function(){function t(){this.values=new Map}return t.prototype.setValue=function(t){t=Math.trunc(t);var e=this.values.get(t);null==e&&(e=0),e++,this.values.set(t,e)},t.prototype.getValue=function(){var t,e,r=-1,n=new Array,o=function(t,e){var o=function(){return t},i=function(){return e};i()>r?(r=i(),(n=[]).push(o())):i()===r&&n.push(o())};try{for(var i=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(this.values.entries()),a=i.next();!a.done;a=i.next()){var s=Ca(a.value,2);o(s[0],s[1])}}catch(u){t={error:u}}finally{try{a&&!a.done&&(e=i.return)&&e.call(i)}finally{if(t)throw t.error}}return la.toIntArray(n)},t.prototype.getConfidence=function(t){return this.values.get(t)},t}(),Ea=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ia=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Sa=function(t){function e(e,r){var n=t.call(this,e)||this;return n._isLeft=r,n}return Ea(e,t),e.prototype.setRowNumbers=function(){var t,e;try{for(var r=Ia(this.getCodewords()),n=r.next();!n.done;n=r.next()){var o=n.value;null!=o&&o.setRowNumberAsRowIndicatorColumn()}}catch(i){t={error:i}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}},e.prototype.adjustCompleteIndicatorColumnRowNumbers=function(t){var e=this.getCodewords();this.setRowNumbers(),this.removeIncorrectCodewords(e,t);for(var r=this.getBoundingBox(),n=this._isLeft?r.getTopLeft():r.getTopRight(),o=this._isLeft?r.getBottomLeft():r.getBottomRight(),i=this.imageRowToCodewordIndex(Math.trunc(n.getY())),a=this.imageRowToCodewordIndex(Math.trunc(o.getY())),s=-1,u=1,l=0,c=i;c<a;c++)if(null!=e[c]){var h=e[c],f=h.getRowNumber()-s;if(0===f)l++;else if(1===f)u=Math.max(u,l),l=1,s=h.getRowNumber();else if(f<0||h.getRowNumber()>=t.getRowCount()||f>c)e[c]=null;else{for(var d,p=(d=u>2?(u-2)*f:f)>=c,g=1;g<=d&&!p;g++)p=null!=e[c-g];p?e[c]=null:(s=h.getRowNumber(),l=1)}}},e.prototype.getRowHeights=function(){var t,e,r=this.getBarcodeMetadata();if(null==r)return null;this.adjustIncompleteIndicatorColumnRowNumbers(r);var n=new Int32Array(r.getRowCount());try{for(var o=Ia(this.getCodewords()),i=o.next();!i.done;i=o.next()){var a=i.value;if(null!=a){var s=a.getRowNumber();if(s>=n.length)continue;n[s]++}}}catch(u){t={error:u}}finally{try{i&&!i.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}return n},e.prototype.adjustIncompleteIndicatorColumnRowNumbers=function(t){for(var e=this.getBoundingBox(),r=this._isLeft?e.getTopLeft():e.getTopRight(),n=this._isLeft?e.getBottomLeft():e.getBottomRight(),o=this.imageRowToCodewordIndex(Math.trunc(r.getY())),i=this.imageRowToCodewordIndex(Math.trunc(n.getY())),a=this.getCodewords(),s=-1,u=o;u<i;u++)if(null!=a[u]){var l=a[u];l.setRowNumberAsRowIndicatorColumn();var c=l.getRowNumber()-s;0===c||(1===c?s=l.getRowNumber():l.getRowNumber()>=t.getRowCount()?a[u]=null:s=l.getRowNumber())}},e.prototype.getBarcodeMetadata=function(){var t,e,r=this.getCodewords(),n=new Aa,o=new Aa,i=new Aa,a=new Aa;try{for(var s=Ia(r),u=s.next();!u.done;u=s.next()){var l=u.value;if(null!=l){l.setRowNumberAsRowIndicatorColumn();var c=l.getValue()%30,h=l.getRowNumber();switch(this._isLeft||(h+=2),h%3){case 0:o.setValue(3*c+1);break;case 1:a.setValue(c/3),i.setValue(c%3);break;case 2:n.setValue(c+1)}}}}catch(d){t={error:d}}finally{try{u&&!u.done&&(e=s.return)&&e.call(s)}finally{if(t)throw t.error}}if(0===n.getValue().length||0===o.getValue().length||0===i.getValue().length||0===a.getValue().length||n.getValue()[0]<1||o.getValue()[0]+i.getValue()[0]<la.MIN_ROWS_IN_BARCODE||o.getValue()[0]+i.getValue()[0]>la.MAX_ROWS_IN_BARCODE)return null;var f=new _a(n.getValue()[0],o.getValue()[0],i.getValue()[0],a.getValue()[0]);return this.removeIncorrectCodewords(r,f),f},e.prototype.removeIncorrectCodewords=function(t,e){for(var r=0;r<t.length;r++){var n=t[r];if(null!=t[r]){var o=n.getValue()%30,i=n.getRowNumber();if(i>e.getRowCount())t[r]=null;else switch(this._isLeft||(i+=2),i%3){case 0:3*o+1!==e.getRowCountUpperPart()&&(t[r]=null);break;case 1:Math.trunc(o/3)===e.getErrorCorrectionLevel()&&o%3===e.getRowCountLowerPart()||(t[r]=null);break;case 2:o+1!==e.getColumnCount()&&(t[r]=null)}}}},e.prototype.isLeft=function(){return this._isLeft},e.prototype.toString=function(){return"IsLeft: "+this._isLeft+"\n"+t.prototype.toString.call(this)},e}(ba),xa=function(){function t(t,e){this.ADJUST_ROW_NUMBER_SKIP=2,this.barcodeMetadata=t,this.barcodeColumnCount=t.getColumnCount(),this.boundingBox=e,this.detectionResultColumns=new Array(this.barcodeColumnCount+2)}return t.prototype.getDetectionResultColumns=function(){this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[0]),this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[this.barcodeColumnCount+1]);var t,e=la.MAX_CODEWORDS_IN_BARCODE;do{t=e,e=this.adjustRowNumbersAndGetCount()}while(e>0&&e<t);return this.detectionResultColumns},t.prototype.adjustIndicatorColumnRowNumbers=function(t){null!=t&&t.adjustCompleteIndicatorColumnRowNumbers(this.barcodeMetadata)},t.prototype.adjustRowNumbersAndGetCount=function(){var t=this.adjustRowNumbersByRow();if(0===t)return 0;for(var e=1;e<this.barcodeColumnCount+1;e++)for(var r=this.detectionResultColumns[e].getCodewords(),n=0;n<r.length;n++)null!=r[n]&&(r[n].hasValidRowNumber()||this.adjustRowNumbers(e,n,r));return t},t.prototype.adjustRowNumbersByRow=function(){return this.adjustRowNumbersFromBothRI(),this.adjustRowNumbersFromLRI()+this.adjustRowNumbersFromRRI()},t.prototype.adjustRowNumbersFromBothRI=function(){if(null!=this.detectionResultColumns[0]&&null!=this.detectionResultColumns[this.barcodeColumnCount+1])for(var t=this.detectionResultColumns[0].getCodewords(),e=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords(),r=0;r<t.length;r++)if(null!=t[r]&&null!=e[r]&&t[r].getRowNumber()===e[r].getRowNumber())for(var n=1;n<=this.barcodeColumnCount;n++){var o=this.detectionResultColumns[n].getCodewords()[r];null!=o&&(o.setRowNumber(t[r].getRowNumber()),o.hasValidRowNumber()||(this.detectionResultColumns[n].getCodewords()[r]=null))}},t.prototype.adjustRowNumbersFromRRI=function(){if(null==this.detectionResultColumns[this.barcodeColumnCount+1])return 0;for(var e=0,r=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords(),n=0;n<r.length;n++)if(null!=r[n])for(var o=r[n].getRowNumber(),i=0,a=this.barcodeColumnCount+1;a>0&&i<this.ADJUST_ROW_NUMBER_SKIP;a--){var s=this.detectionResultColumns[a].getCodewords()[n];null!=s&&(i=t.adjustRowNumberIfValid(o,i,s),s.hasValidRowNumber()||e++)}return e},t.prototype.adjustRowNumbersFromLRI=function(){if(null==this.detectionResultColumns[0])return 0;for(var e=0,r=this.detectionResultColumns[0].getCodewords(),n=0;n<r.length;n++)if(null!=r[n])for(var o=r[n].getRowNumber(),i=0,a=1;a<this.barcodeColumnCount+1&&i<this.ADJUST_ROW_NUMBER_SKIP;a++){var s=this.detectionResultColumns[a].getCodewords()[n];null!=s&&(i=t.adjustRowNumberIfValid(o,i,s),s.hasValidRowNumber()||e++)}return e},t.adjustRowNumberIfValid=function(t,e,r){return null==r||r.hasValidRowNumber()||(r.isValidRowNumber(t)?(r.setRowNumber(t),e=0):++e),e},t.prototype.adjustRowNumbers=function(e,r,n){var o,i,a=n[r],s=this.detectionResultColumns[e-1].getCodewords(),u=s;null!=this.detectionResultColumns[e+1]&&(u=this.detectionResultColumns[e+1].getCodewords());var l=new Array(14);l[2]=s[r],l[3]=u[r],r>0&&(l[0]=n[r-1],l[4]=s[r-1],l[5]=u[r-1]),r>1&&(l[8]=n[r-2],l[10]=s[r-2],l[11]=u[r-2]),r<n.length-1&&(l[1]=n[r+1],l[6]=s[r+1],l[7]=u[r+1]),r<n.length-2&&(l[9]=n[r+2],l[12]=s[r+2],l[13]=u[r+2]);try{for(var c=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(l),h=c.next();!h.done;h=c.next()){var f=h.value;if(t.adjustRowNumber(a,f))return}}catch(d){o={error:d}}finally{try{h&&!h.done&&(i=c.return)&&i.call(c)}finally{if(o)throw o.error}}},t.adjustRowNumber=function(t,e){return!(null==e||!e.hasValidRowNumber()||e.getBucket()!==t.getBucket()||(t.setRowNumber(e.getRowNumber()),0))},t.prototype.getBarcodeColumnCount=function(){return this.barcodeColumnCount},t.prototype.getBarcodeRowCount=function(){return this.barcodeMetadata.getRowCount()},t.prototype.getBarcodeECLevel=function(){return this.barcodeMetadata.getErrorCorrectionLevel()},t.prototype.setBoundingBox=function(t){this.boundingBox=t},t.prototype.getBoundingBox=function(){return this.boundingBox},t.prototype.setDetectionResultColumn=function(t,e){this.detectionResultColumns[t]=e},t.prototype.getDetectionResultColumn=function(t){return this.detectionResultColumns[t]},t.prototype.toString=function(){var t=this.detectionResultColumns[0];null==t&&(t=this.detectionResultColumns[this.barcodeColumnCount+1]);for(var e=new wa,r=0;r<t.getCodewords().length;r++){e.format("CW %3d:",r);for(var n=0;n<this.barcodeColumnCount+2;n++)if(null!=this.detectionResultColumns[n]){var o=this.detectionResultColumns[n].getCodewords()[r];null!=o?e.format(" %3d|%3d",o.getRowNumber(),o.getValue()):e.format(" | ")}else e.format(" | ");e.format("%n")}return e.toString()},t}(),Oa=function(){function t(e,r,n,o){this.rowNumber=t.BARCODE_ROW_UNKNOWN,this.startX=Math.trunc(e),this.endX=Math.trunc(r),this.bucket=Math.trunc(n),this.value=Math.trunc(o)}return t.prototype.hasValidRowNumber=function(){return this.isValidRowNumber(this.rowNumber)},t.prototype.isValidRowNumber=function(e){return e!==t.BARCODE_ROW_UNKNOWN&&this.bucket===e%3*3},t.prototype.setRowNumberAsRowIndicatorColumn=function(){this.rowNumber=Math.trunc(3*Math.trunc(this.value/30)+Math.trunc(this.bucket/3))},t.prototype.getWidth=function(){return this.endX-this.startX},t.prototype.getStartX=function(){return this.startX},t.prototype.getEndX=function(){return this.endX},t.prototype.getBucket=function(){return this.bucket},t.prototype.getValue=function(){return this.value},t.prototype.getRowNumber=function(){return this.rowNumber},t.prototype.setRowNumber=function(t){this.rowNumber=t},t.prototype.toString=function(){return this.rowNumber+"|"+this.value},t.BARCODE_ROW_UNKNOWN=-1,t}(),Ta=function(){function t(){}return t.initialize=function(){for(var e=0;e<la.SYMBOL_TABLE.length;e++)for(var r=la.SYMBOL_TABLE[e],n=1&r,o=0;o<la.BARS_IN_MODULE;o++){for(var i=0;(1&r)===n;)i+=1,r>>=1;n=1&r,t.RATIOS_TABLE[e]||(t.RATIOS_TABLE[e]=new Array(la.BARS_IN_MODULE)),t.RATIOS_TABLE[e][la.BARS_IN_MODULE-o-1]=Math.fround(i/la.MODULES_IN_CODEWORD)}this.bSymbolTableReady=!0},t.getDecodedValue=function(e){var r=t.getDecodedCodewordValue(t.sampleBitCounts(e));return-1!==r?r:t.getClosestDecodedValue(e)},t.sampleBitCounts=function(t){for(var e=Tn.sum(t),r=new Int32Array(la.BARS_IN_MODULE),n=0,o=0,i=0;i<la.MODULES_IN_CODEWORD;i++){var a=e/(2*la.MODULES_IN_CODEWORD)+i*e/la.MODULES_IN_CODEWORD;o+t[n]<=a&&(o+=t[n],n++),r[n]++}return r},t.getDecodedCodewordValue=function(e){var r=t.getBitValue(e);return-1===la.getCodeword(r)?-1:r},t.getBitValue=function(t){for(var e=0,r=0;r<t.length;r++)for(var n=0;n<t[r];n++)e=e<<1|(r%2==0?1:0);return Math.trunc(e)},t.getClosestDecodedValue=function(e){var r=Tn.sum(e),n=new Array(la.BARS_IN_MODULE);if(r>1)for(var o=0;o<n.length;o++)n[o]=Math.fround(e[o]/r);var i=Nn.MAX_VALUE,a=-1;this.bSymbolTableReady||t.initialize();for(var s=0;s<t.RATIOS_TABLE.length;s++){for(var u=0,l=t.RATIOS_TABLE[s],c=0;c<la.BARS_IN_MODULE;c++){var h=Math.fround(l[c]-n[c]);if((u+=Math.fround(h*h))>=i)break}u<i&&(i=u,a=la.SYMBOL_TABLE[s])}return a},t.bSymbolTableReady=!1,t.RATIOS_TABLE=new Array(la.SYMBOL_TABLE.length).map(function(t){return new Array(la.BARS_IN_MODULE)}),t}(),Na=function(){function t(){this.segmentCount=-1,this.fileSize=-1,this.timestamp=-1,this.checksum=-1}return t.prototype.getSegmentIndex=function(){return this.segmentIndex},t.prototype.setSegmentIndex=function(t){this.segmentIndex=t},t.prototype.getFileId=function(){return this.fileId},t.prototype.setFileId=function(t){this.fileId=t},t.prototype.getOptionalData=function(){return this.optionalData},t.prototype.setOptionalData=function(t){this.optionalData=t},t.prototype.isLastSegment=function(){return this.lastSegment},t.prototype.setLastSegment=function(t){this.lastSegment=t},t.prototype.getSegmentCount=function(){return this.segmentCount},t.prototype.setSegmentCount=function(t){this.segmentCount=t},t.prototype.getSender=function(){return this.sender||null},t.prototype.setSender=function(t){this.sender=t},t.prototype.getAddressee=function(){return this.addressee||null},t.prototype.setAddressee=function(t){this.addressee=t},t.prototype.getFileName=function(){return this.fileName},t.prototype.setFileName=function(t){this.fileName=t},t.prototype.getFileSize=function(){return this.fileSize},t.prototype.setFileSize=function(t){this.fileSize=t},t.prototype.getChecksum=function(){return this.checksum},t.prototype.setChecksum=function(t){this.checksum=t},t.prototype.getTimestamp=function(){return this.timestamp},t.prototype.setTimestamp=function(t){this.timestamp=t},t}(),ka=function(){function t(){}return t.parseLong=function(t,e){return void 0===e&&(e=void 0),parseInt(t,e)},t}(),Ra=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Da=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ra(e,t),e.kind="NullPointerException",e}(wr),Pa=function(){function t(){}return t.prototype.writeBytes=function(t){this.writeBytesOffset(t,0,t.length)},t.prototype.writeBytesOffset=function(t,e,r){if(null==t)throw new Da;if(e<0||e>t.length||r<0||e+r>t.length||e+r<0)throw new kr;if(0!==r)for(var n=0;n<r;n++)this.write(t[e+n])},t.prototype.flush=function(){},t.prototype.close=function(){},t}(),Ma=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ba=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ma(e,t),e}(wr),La=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Fa=function(t){function e(e){void 0===e&&(e=32);var r=t.call(this)||this;if(r.count=0,e<0)throw new Er("Negative initial size: "+e);return r.buf=new Uint8Array(e),r}return La(e,t),e.prototype.ensureCapacity=function(t){t-this.buf.length>0&&this.grow(t)},e.prototype.grow=function(t){var e=this.buf.length<<1;if(e-t<0&&(e=t),e<0){if(t<0)throw new Ba;e=Mr.MAX_VALUE}this.buf=Pr.copyOfUint8Array(this.buf,e)},e.prototype.write=function(t){this.ensureCapacity(this.count+1),this.buf[this.count]=t,this.count+=1},e.prototype.writeBytesOffset=function(t,e,r){if(e<0||e>t.length||r<0||e+r-t.length>0)throw new kr;this.ensureCapacity(this.count+r),Tr.arraycopy(t,e,this.buf,this.count,r),this.count+=r},e.prototype.writeTo=function(t){t.writeBytesOffset(this.buf,0,this.count)},e.prototype.reset=function(){this.count=0},e.prototype.toByteArray=function(){return Pr.copyOfUint8Array(this.buf,this.count)},e.prototype.size=function(){return this.count},e.prototype.toString=function(t){return t?"string"==typeof t?this.toString_string(t):this.toString_number(t):this.toString_void()},e.prototype.toString_void=function(){return new String(this.buf).toString()},e.prototype.toString_string=function(t){return new String(this.buf).toString()},e.prototype.toString_number=function(t){return new String(this.buf).toString()},e.prototype.close=function(){},e}(Pa);function ja(){if("undefined"!=typeof window)return window.BigInt||null;if("undefined"!=typeof global)return global.BigInt||null;if("undefined"!=typeof self)return self.BigInt||null;throw new Error("Can't search globals for BigInt!")}function Va(t){if(void 0===$i&&($i=ja()),null===$i)throw new Error("BigInt is not supported!");return $i(t)}!function(t){t[t.ALPHA=0]="ALPHA",t[t.LOWER=1]="LOWER",t[t.MIXED=2]="MIXED",t[t.PUNCT=3]="PUNCT",t[t.ALPHA_SHIFT=4]="ALPHA_SHIFT",t[t.PUNCT_SHIFT=5]="PUNCT_SHIFT"}(Xi||(Xi={}));var Ua=function(){function t(){}return t.decode=function(e,r){var n=new $r(""),o=Hr.ISO8859_1;n.enableDecoding(o);for(var i=1,a=e[i++],s=new Na;i<e[0];){switch(a){case t.TEXT_COMPACTION_MODE_LATCH:i=t.textCompaction(e,i,n);break;case t.BYTE_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH_6:i=t.byteCompaction(a,e,o,i,n);break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:n.append(e[i++]);break;case t.NUMERIC_COMPACTION_MODE_LATCH:i=t.numericCompaction(e,i,n);break;case t.ECI_CHARSET:Hr.getCharacterSetECIByValue(e[i++]);break;case t.ECI_GENERAL_PURPOSE:i+=2;break;case t.ECI_USER_DEFINED:i++;break;case t.BEGIN_MACRO_PDF417_CONTROL_BLOCK:i=t.decodeMacroBlock(e,i,s);break;case t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case t.MACRO_PDF417_TERMINATOR:throw new Vr;default:i--,i=t.textCompaction(e,i,n)}if(!(i<e.length))throw Vr.getFormatInstance();a=e[i++]}if(0===n.length())throw Vr.getFormatInstance();var u=new mn(null,n.toString(),null,r);return u.setOther(s),u},t.decodeMacroBlock=function(e,r,n){if(r+t.NUMBER_OF_SEQUENCE_CODEWORDS>e[0])throw Vr.getFormatInstance();for(var o=new Int32Array(t.NUMBER_OF_SEQUENCE_CODEWORDS),i=0;i<t.NUMBER_OF_SEQUENCE_CODEWORDS;i++,r++)o[i]=e[r];n.setSegmentIndex(Mr.parseInt(t.decodeBase900toBase10(o,t.NUMBER_OF_SEQUENCE_CODEWORDS)));var a=new $r;r=t.textCompaction(e,r,a),n.setFileId(a.toString());var s=-1;for(e[r]===t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD&&(s=r+1);r<e[0];)switch(e[r]){case t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:switch(e[++r]){case t.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME:var u=new $r;r=t.textCompaction(e,r+1,u),n.setFileName(u.toString());break;case t.MACRO_PDF417_OPTIONAL_FIELD_SENDER:var l=new $r;r=t.textCompaction(e,r+1,l),n.setSender(l.toString());break;case t.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE:var c=new $r;r=t.textCompaction(e,r+1,c),n.setAddressee(c.toString());break;case t.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT:var h=new $r;r=t.numericCompaction(e,r+1,h),n.setSegmentCount(Mr.parseInt(h.toString()));break;case t.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP:var f=new $r;r=t.numericCompaction(e,r+1,f),n.setTimestamp(ka.parseLong(f.toString()));break;case t.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM:var d=new $r;r=t.numericCompaction(e,r+1,d),n.setChecksum(Mr.parseInt(d.toString()));break;case t.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE:var p=new $r;r=t.numericCompaction(e,r+1,p),n.setFileSize(ka.parseLong(p.toString()));break;default:throw Vr.getFormatInstance()}break;case t.MACRO_PDF417_TERMINATOR:r++,n.setLastSegment(!0);break;default:throw Vr.getFormatInstance()}if(-1!==s){var g=r-s;n.isLastSegment()&&g--,n.setOptionalData(Pr.copyOfRange(e,s,s+g))}return r},t.textCompaction=function(e,r,n){for(var o=new Int32Array(2*(e[0]-r)),i=new Int32Array(2*(e[0]-r)),a=0,s=!1;r<e[0]&&!s;){var u=e[r++];if(u<t.TEXT_COMPACTION_MODE_LATCH)o[a]=u/30,o[a+1]=u%30,a+=2;else switch(u){case t.TEXT_COMPACTION_MODE_LATCH:o[a++]=t.TEXT_COMPACTION_MODE_LATCH;break;case t.BYTE_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH_6:case t.NUMERIC_COMPACTION_MODE_LATCH:case t.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case t.MACRO_PDF417_TERMINATOR:r--,s=!0;break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:o[a]=t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE,u=e[r++],i[a]=u,a++}}return t.decodeTextCompaction(o,i,a,n),r},t.decodeTextCompaction=function(e,r,n,o){for(var i=Xi.ALPHA,a=Xi.ALPHA,s=0;s<n;){var u=e[s],l="";switch(i){case Xi.ALPHA:if(u<26)l=String.fromCharCode(65+u);else switch(u){case 26:l=" ";break;case t.LL:i=Xi.LOWER;break;case t.ML:i=Xi.MIXED;break;case t.PS:a=i,i=Xi.PUNCT_SHIFT;break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:o.append(r[s]);break;case t.TEXT_COMPACTION_MODE_LATCH:i=Xi.ALPHA}break;case Xi.LOWER:if(u<26)l=String.fromCharCode(97+u);else switch(u){case 26:l=" ";break;case t.AS:a=i,i=Xi.ALPHA_SHIFT;break;case t.ML:i=Xi.MIXED;break;case t.PS:a=i,i=Xi.PUNCT_SHIFT;break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:o.append(r[s]);break;case t.TEXT_COMPACTION_MODE_LATCH:i=Xi.ALPHA}break;case Xi.MIXED:if(u<t.PL)l=t.MIXED_CHARS[u];else switch(u){case t.PL:i=Xi.PUNCT;break;case 26:l=" ";break;case t.LL:i=Xi.LOWER;break;case t.AL:i=Xi.ALPHA;break;case t.PS:a=i,i=Xi.PUNCT_SHIFT;break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:o.append(r[s]);break;case t.TEXT_COMPACTION_MODE_LATCH:i=Xi.ALPHA}break;case Xi.PUNCT:if(u<t.PAL)l=t.PUNCT_CHARS[u];else switch(u){case t.PAL:i=Xi.ALPHA;break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:o.append(r[s]);break;case t.TEXT_COMPACTION_MODE_LATCH:i=Xi.ALPHA}break;case Xi.ALPHA_SHIFT:if(i=a,u<26)l=String.fromCharCode(65+u);else switch(u){case 26:l=" ";break;case t.TEXT_COMPACTION_MODE_LATCH:i=Xi.ALPHA}break;case Xi.PUNCT_SHIFT:if(i=a,u<t.PAL)l=t.PUNCT_CHARS[u];else switch(u){case t.PAL:i=Xi.ALPHA;break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:o.append(r[s]);break;case t.TEXT_COMPACTION_MODE_LATCH:i=Xi.ALPHA}}""!==l&&o.append(l),s++}},t.byteCompaction=function(e,r,n,o,i){var a=new Fa,s=0,u=0,l=!1;switch(e){case t.BYTE_COMPACTION_MODE_LATCH:for(var c=new Int32Array(6),h=r[o++];o<r[0]&&!l;)switch(c[s++]=h,u=900*u+h,h=r[o++]){case t.TEXT_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH:case t.NUMERIC_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH_6:case t.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case t.MACRO_PDF417_TERMINATOR:o--,l=!0;break;default:if(s%5==0&&s>0){for(var f=0;f<6;++f)a.write(Number(Va(u)>>Va(8*(5-f))));u=0,s=0}}o===r[0]&&h<t.TEXT_COMPACTION_MODE_LATCH&&(c[s++]=h);for(var d=0;d<s;d++)a.write(c[d]);break;case t.BYTE_COMPACTION_MODE_LATCH_6:for(;o<r[0]&&!l;){var p=r[o++];if(p<t.TEXT_COMPACTION_MODE_LATCH)s++,u=900*u+p;else switch(p){case t.TEXT_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH:case t.NUMERIC_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH_6:case t.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case t.MACRO_PDF417_TERMINATOR:o--,l=!0}if(s%5==0&&s>0){for(f=0;f<6;++f)a.write(Number(Va(u)>>Va(8*(5-f))));u=0,s=0}}}return i.append(Gr.decode(a.toByteArray(),n)),o},t.numericCompaction=function(e,r,n){for(var o=0,i=!1,a=new Int32Array(t.MAX_NUMERIC_CODEWORDS);r<e[0]&&!i;){var s=e[r++];if(r===e[0]&&(i=!0),s<t.TEXT_COMPACTION_MODE_LATCH)a[o]=s,o++;else switch(s){case t.TEXT_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH_6:case t.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case t.MACRO_PDF417_TERMINATOR:r--,i=!0}(o%t.MAX_NUMERIC_CODEWORDS==0||s===t.NUMERIC_COMPACTION_MODE_LATCH||i)&&o>0&&(n.append(t.decodeBase900toBase10(a,o)),o=0)}return r},t.decodeBase900toBase10=function(e,r){for(var n=Va(0),o=0;o<r;o++)n+=t.EXP900[r-o-1]*Va(e[o]);var i=n.toString();if("1"!==i.charAt(0))throw new Vr;return i.substring(1)},t.TEXT_COMPACTION_MODE_LATCH=900,t.BYTE_COMPACTION_MODE_LATCH=901,t.NUMERIC_COMPACTION_MODE_LATCH=902,t.BYTE_COMPACTION_MODE_LATCH_6=924,t.ECI_USER_DEFINED=925,t.ECI_GENERAL_PURPOSE=926,t.ECI_CHARSET=927,t.BEGIN_MACRO_PDF417_CONTROL_BLOCK=928,t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD=923,t.MACRO_PDF417_TERMINATOR=922,t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE=913,t.MAX_NUMERIC_CODEWORDS=15,t.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME=0,t.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT=1,t.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP=2,t.MACRO_PDF417_OPTIONAL_FIELD_SENDER=3,t.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE=4,t.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE=5,t.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM=6,t.PL=25,t.LL=27,t.AS=27,t.ML=28,t.AL=28,t.PS=29,t.PAL=29,t.PUNCT_CHARS=";<>@[\\]_`~!\r\t,:\n-.$/\"|*()?{}'",t.MIXED_CHARS="0123456789&\r\t,:#-.$/+%*=^",t.EXP900=ja()?function(){var t=[];t[0]=Va(1);var e=Va(900);t[1]=e;for(var r=2;r<16;r++)t[r]=t[r-1]*e;return t}():[],t.NUMBER_OF_SEQUENCE_CODEWORDS=2,t}(),Ha=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},za=function(){function t(){}return t.decode=function(e,r,n,o,i,a,s){for(var u,l=new ya(e,r,n,o,i),c=null,h=null,f=!0;;f=!1){if(null!=r&&(c=t.getRowIndicatorColumn(e,l,r,!0,a,s)),null!=o&&(h=t.getRowIndicatorColumn(e,l,o,!1,a,s)),null==(u=t.merge(c,h)))throw Kr.getNotFoundInstance();var d=u.getBoundingBox();if(!f||null==d||!(d.getMinY()<l.getMinY()||d.getMaxY()>l.getMaxY()))break;l=d}u.setBoundingBox(l);var p=u.getBarcodeColumnCount()+1;u.setDetectionResultColumn(0,c),u.setDetectionResultColumn(p,h);for(var g=null!=c,m=1;m<=p;m++){var v=g?m:p-m;if(void 0===u.getDetectionResultColumn(v)){var y=void 0;y=0===v||v===p?new Sa(l,0===v):new ba(l),u.setDetectionResultColumn(v,y);for(var _=-1,w=_,b=l.getMinY();b<=l.getMaxY();b++){if((_=t.getStartColumn(u,v,b,g))<0||_>l.getMaxX()){if(-1===w)continue;_=w}var C=t.detectCodeword(e,l.getMinX(),l.getMaxX(),g,_,b,a,s);null!=C&&(y.setCodeword(b,C),w=_,a=Math.min(a,C.getWidth()),s=Math.max(s,C.getWidth()))}}}return t.createDecoderResult(u)},t.merge=function(e,r){if(null==e&&null==r)return null;var n=t.getBarcodeMetadata(e,r);if(null==n)return null;var o=ya.merge(t.adjustBoundingBox(e),t.adjustBoundingBox(r));return new xa(n,o)},t.adjustBoundingBox=function(e){var r,n;if(null==e)return null;var o=e.getRowHeights();if(null==o)return null;var i=t.getMax(o),a=0;try{for(var s=Ha(o),u=s.next();!u.done;u=s.next()){var l=u.value;if(a+=i-l,l>0)break}}catch(d){r={error:d}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}for(var c=e.getCodewords(),h=0;a>0&&null==c[h];h++)a--;var f=0;for(h=o.length-1;h>=0&&(f+=i-o[h],!(o[h]>0));h--);for(h=c.length-1;f>0&&null==c[h];h--)f--;return e.getBoundingBox().addMissingRows(a,f,e.isLeft())},t.getMax=function(t){var e,r,n=-1;try{for(var o=Ha(t),i=o.next();!i.done;i=o.next()){var a=i.value;n=Math.max(n,a)}}catch(s){e={error:s}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return n},t.getBarcodeMetadata=function(t,e){var r,n;return null==t||null==(r=t.getBarcodeMetadata())?null==e?null:e.getBarcodeMetadata():null==e||null==(n=e.getBarcodeMetadata())?r:r.getColumnCount()!==n.getColumnCount()&&r.getErrorCorrectionLevel()!==n.getErrorCorrectionLevel()&&r.getRowCount()!==n.getRowCount()?null:r},t.getRowIndicatorColumn=function(e,r,n,o,i,a){for(var s=new Sa(r,o),u=0;u<2;u++)for(var l=0===u?1:-1,c=Math.trunc(Math.trunc(n.getX())),h=Math.trunc(Math.trunc(n.getY()));h<=r.getMaxY()&&h>=r.getMinY();h+=l){var f=t.detectCodeword(e,0,e.getWidth(),o,c,h,i,a);null!=f&&(s.setCodeword(h,f),c=o?f.getStartX():f.getEndX())}return s},t.adjustCodewordCount=function(e,r){var n=r[0][1],o=n.getValue(),i=e.getBarcodeColumnCount()*e.getBarcodeRowCount()-t.getNumberOfECCodeWords(e.getBarcodeECLevel());if(0===o.length){if(i<1||i>la.MAX_CODEWORDS_IN_BARCODE)throw Kr.getNotFoundInstance();n.setValue(i)}else o[0]!==i&&n.setValue(i)},t.createDecoderResult=function(e){var r=t.createBarcodeMatrix(e);t.adjustCodewordCount(e,r);for(var n=new Array,o=new Int32Array(e.getBarcodeRowCount()*e.getBarcodeColumnCount()),i=[],a=new Array,s=0;s<e.getBarcodeRowCount();s++)for(var u=0;u<e.getBarcodeColumnCount();u++){var l=r[s][u+1].getValue(),c=s*e.getBarcodeColumnCount()+u;0===l.length?n.push(c):1===l.length?o[c]=l[0]:(a.push(c),i.push(l))}for(var h=new Array(i.length),f=0;f<h.length;f++)h[f]=i[f];return t.createDecoderResultFromAmbiguousValues(e.getBarcodeECLevel(),o,la.toIntArray(n),la.toIntArray(a),h)},t.createDecoderResultFromAmbiguousValues=function(e,r,n,o,i){for(var a=new Int32Array(o.length),s=100;s-- >0;){for(var u=0;u<a.length;u++)r[o[u]]=i[u][a[u]];try{return t.decodeCodewords(r,e,n)}catch(l){if(!(l instanceof xr))throw l}if(0===a.length)throw xr.getChecksumInstance();for(u=0;u<a.length;u++){if(a[u]<i[u].length-1){a[u]++;break}if(a[u]=0,u===a.length-1)throw xr.getChecksumInstance()}}throw xr.getChecksumInstance()},t.createBarcodeMatrix=function(t){for(var e,r,n,o,i=Array.from({length:t.getBarcodeRowCount()},function(){return new Array(t.getBarcodeColumnCount()+2)}),a=0;a<i.length;a++)for(var s=0;s<i[a].length;s++)i[a][s]=new Aa;var u=0;try{for(var l=Ha(t.getDetectionResultColumns()),c=l.next();!c.done;c=l.next()){var h=c.value;if(null!=h)try{for(var f=(n=void 0,Ha(h.getCodewords())),d=f.next();!d.done;d=f.next()){var p=d.value;if(null!=p){var g=p.getRowNumber();if(g>=0){if(g>=i.length)continue;i[g][u].setValue(p.getValue())}}}}catch(m){n={error:m}}finally{try{d&&!d.done&&(o=f.return)&&o.call(f)}finally{if(n)throw n.error}}u++}}catch(m){e={error:m}}finally{try{c&&!c.done&&(r=l.return)&&r.call(l)}finally{if(e)throw e.error}}return i},t.isValidBarcodeColumn=function(t,e){return e>=0&&e<=t.getBarcodeColumnCount()+1},t.getStartColumn=function(e,r,n,o){var i,a,s=o?1:-1,u=null;if(t.isValidBarcodeColumn(e,r-s)&&(u=e.getDetectionResultColumn(r-s).getCodeword(n)),null!=u)return o?u.getEndX():u.getStartX();if(null!=(u=e.getDetectionResultColumn(r).getCodewordNearby(n)))return o?u.getStartX():u.getEndX();if(t.isValidBarcodeColumn(e,r-s)&&(u=e.getDetectionResultColumn(r-s).getCodewordNearby(n)),null!=u)return o?u.getEndX():u.getStartX();for(var l=0;t.isValidBarcodeColumn(e,r-s);){r-=s;try{for(var c=(i=void 0,Ha(e.getDetectionResultColumn(r).getCodewords())),h=c.next();!h.done;h=c.next()){var f=h.value;if(null!=f)return(o?f.getEndX():f.getStartX())+s*l*(f.getEndX()-f.getStartX())}}catch(d){i={error:d}}finally{try{h&&!h.done&&(a=c.return)&&a.call(c)}finally{if(i)throw i.error}}l++}return o?e.getBoundingBox().getMinX():e.getBoundingBox().getMaxX()},t.detectCodeword=function(e,r,n,o,i,a,s,u){i=t.adjustCodewordStartColumn(e,r,n,o,i,a);var l,c=t.getModuleBitCount(e,r,n,o,i,a);if(null==c)return null;var h=Tn.sum(c);if(o)l=i+h;else{for(var f=0;f<c.length/2;f++){var d=c[f];c[f]=c[c.length-1-f],c[c.length-1-f]=d}i=(l=i)-h}if(!t.checkCodewordSkew(h,s,u))return null;var p=Ta.getDecodedValue(c),g=la.getCodeword(p);return-1===g?null:new Oa(i,l,t.getCodewordBucketNumber(p),g)},t.getModuleBitCount=function(t,e,r,n,o,i){for(var a=o,s=new Int32Array(8),u=0,l=n?1:-1,c=n;(n?a<r:a>=e)&&u<s.length;)t.get(a,i)===c?(s[u]++,a+=l):(u++,c=!c);return u===s.length||a===(n?r:e)&&u===s.length-1?s:null},t.getNumberOfECCodeWords=function(t){return 2<<t},t.adjustCodewordStartColumn=function(e,r,n,o,i,a){for(var s=i,u=o?-1:1,l=0;l<2;l++){for(;(o?s>=r:s<n)&&o===e.get(s,a);){if(Math.abs(i-s)>t.CODEWORD_SKEW_SIZE)return i;s+=u}u=-u,o=!o}return s},t.checkCodewordSkew=function(e,r,n){return r-t.CODEWORD_SKEW_SIZE<=e&&e<=n+t.CODEWORD_SKEW_SIZE},t.decodeCodewords=function(e,r,n){if(0===e.length)throw Vr.getFormatInstance();var o=1<<r+1,i=t.correctErrors(e,n,o);t.verifyCodewordCount(e,o);var a=Ua.decode(e,""+r);return a.setErrorsCorrected(i),a.setErasures(n.length),a},t.correctErrors=function(e,r,n){if(null!=r&&r.length>n/2+t.MAX_ERRORS||n<0||n>t.MAX_EC_CODEWORDS)throw xr.getChecksumInstance();return t.errorCorrection.decode(e,n,r)},t.verifyCodewordCount=function(t,e){if(t.length<4)throw Vr.getFormatInstance();var r=t[0];if(r>t.length)throw Vr.getFormatInstance();if(0===r){if(!(e<t.length))throw Vr.getFormatInstance();t[0]=t.length-e}},t.getBitCountForCodeword=function(t){for(var e=new Int32Array(8),r=0,n=e.length-1;!((1&t)!==r&&(r=1&t,--n<0));)e[n]++,t>>=1;return e},t.getCodewordBucketNumber=function(t){return t instanceof Int32Array?this.getCodewordBucketNumber_Int32Array(t):this.getCodewordBucketNumber_number(t)},t.getCodewordBucketNumber_number=function(e){return t.getCodewordBucketNumber(t.getBitCountForCodeword(e))},t.getCodewordBucketNumber_Int32Array=function(t){return(t[0]-t[2]+t[4]-t[6]+9)%9},t.toString=function(t){for(var e=new wa,r=0;r<t.length;r++){e.format("Row %2d: ",r);for(var n=0;n<t[r].length;n++){var o=t[r][n];0===o.getValue().length?e.format(" ",null):e.format("%4d(%2d)",o.getValue()[0],o.getConfidence(o.getValue()[0]))}e.format("%n")}return e.toString()},t.CODEWORD_SKEW_SIZE=2,t.MAX_ERRORS=3,t.MAX_EC_CODEWORDS=512,t.errorCorrection=new va,t}(),Wa=function(){function t(){}return t.prototype.decode=function(e,r){void 0===r&&(r=null);var n=t.decode(e,r,!1);if(null==n||0===n.length||null==n[0])throw Kr.getNotFoundInstance();return n[0]},t.prototype.decodeMultiple=function(e,r){void 0===r&&(r=null);try{return t.decode(e,r,!0)}catch(n){if(n instanceof Vr||n instanceof xr)throw Kr.getNotFoundInstance();throw n}},t.decode=function(e,r,n){var o,i,a=new Array,s=fa.detectMultiple(e,r,n);try{for(var u=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(s.getPoints()),l=u.next();!l.done;l=u.next()){var c=l.value,h=za.decode(s.getBits(),c[4],c[5],c[6],c[7],t.getMinCodewordWidth(c),t.getMaxCodewordWidth(c)),f=new hn(h.getText(),h.getRawBytes(),void 0,c,dn.PDF_417);f.putMetadata(gn.ERROR_CORRECTION_LEVEL,h.getECLevel());var d=h.getOther();null!=d&&f.putMetadata(gn.PDF417_EXTRA_METADATA,d),a.push(f)}}catch(p){o={error:p}}finally{try{l&&!l.done&&(i=u.return)&&i.call(u)}finally{if(o)throw o.error}}return a.map(function(t){return t})},t.getMaxWidth=function(t,e){return null==t||null==e?0:Math.trunc(Math.abs(t.getX()-e.getX()))},t.getMinWidth=function(t,e){return null==t||null==e?Mr.MAX_VALUE:Math.trunc(Math.abs(t.getX()-e.getX()))},t.getMaxCodewordWidth=function(e){return Math.floor(Math.max(Math.max(t.getMaxWidth(e[0],e[4]),t.getMaxWidth(e[6],e[2])*la.MODULES_IN_CODEWORD/la.MODULES_IN_STOP_PATTERN),Math.max(t.getMaxWidth(e[1],e[5]),t.getMaxWidth(e[7],e[3])*la.MODULES_IN_CODEWORD/la.MODULES_IN_STOP_PATTERN)))},t.getMinCodewordWidth=function(e){return Math.floor(Math.min(Math.min(t.getMinWidth(e[0],e[4]),t.getMinWidth(e[6],e[2])*la.MODULES_IN_CODEWORD/la.MODULES_IN_STOP_PATTERN),Math.min(t.getMinWidth(e[1],e[5]),t.getMinWidth(e[7],e[3])*la.MODULES_IN_CODEWORD/la.MODULES_IN_STOP_PATTERN)))},t.prototype.reset=function(){},t}(),Ga=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Xa=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ga(e,t),e.kind="ReaderException",e}(wr),$a=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Ya=function(){function t(){}return t.prototype.decode=function(t,e){return this.setHints(e),this.decodeInternal(t)},t.prototype.decodeWithState=function(t){return null!==this.readers&&void 0!==this.readers||this.setHints(null),this.decodeInternal(t)},t.prototype.setHints=function(t){this.hints=t;var e=null!=t&&void 0!==t.get(Fr.TRY_HARDER),r=null==t?null:t.get(Fr.POSSIBLE_FORMATS),n=new Array;if(null!=r){var o=r.some(function(t){return t===dn.UPC_A||t===dn.UPC_E||t===dn.EAN_13||t===dn.EAN_8||t===dn.CODABAR||t===dn.CODE_39||t===dn.CODE_93||t===dn.CODE_128||t===dn.ITF||t===dn.RSS_14||t===dn.RSS_EXPANDED});o&&!e&&n.push(new yi(t)),r.includes(dn.QR_CODE)&&n.push(new ua),r.includes(dn.DATA_MATRIX)&&n.push(new Di),r.includes(dn.AZTEC)&&n.push(new zn),r.includes(dn.PDF_417)&&n.push(new Wa),o&&e&&n.push(new yi(t))}0===n.length&&(e||n.push(new yi(t)),n.push(new ua),n.push(new Di),n.push(new zn),n.push(new Wa),e&&n.push(new yi(t))),this.readers=n},t.prototype.reset=function(){var t,e;if(null!==this.readers)try{for(var r=$a(this.readers),n=r.next();!n.done;n=r.next())n.value.reset()}catch(o){t={error:o}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}},t.prototype.decodeInternal=function(t){var e,r;if(null===this.readers)throw new Xa("No readers where selected, nothing can be read.");try{for(var n=$a(this.readers),o=n.next();!o.done;o=n.next()){var i=o.value;try{return i.decode(t,this.hints)}catch(a){if(a instanceof Xa)continue}}}catch(a){e={error:a}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(e)throw e.error}}throw new Kr("No MultiFormat Readers were able to detect the code.")},t}(),qa=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){function e(e,r){void 0===e&&(e=null),void 0===r&&(r=500);var n=new Ya;return n.setHints(e),t.call(this,n,r)||this}qa(e,t),e.prototype.decodeBitmap=function(t){return this.reader.decodeWithState(t)}}(cn);var Ka=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){Ka(function(e){return void 0===e&&(e=500),t.call(this,new Wa,e)||this},t)}(cn);var Za,Qa=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){Qa(function(e){return void 0===e&&(e=500),t.call(this,new ua,e)||this},t)}(cn),function(t){t[t.ERROR_CORRECTION=0]="ERROR_CORRECTION",t[t.CHARACTER_SET=1]="CHARACTER_SET",t[t.DATA_MATRIX_SHAPE=2]="DATA_MATRIX_SHAPE",t[t.MIN_SIZE=3]="MIN_SIZE",t[t.MAX_SIZE=4]="MAX_SIZE",t[t.MARGIN=5]="MARGIN",t[t.PDF417_COMPACT=6]="PDF417_COMPACT",t[t.PDF417_COMPACTION=7]="PDF417_COMPACTION",t[t.PDF417_DIMENSIONS=8]="PDF417_DIMENSIONS",t[t.AZTEC_LAYERS=9]="AZTEC_LAYERS",t[t.QR_VERSION=10]="QR_VERSION"}(Za||(Za={}));var Ja=function(){function t(){}return t.applyMaskPenaltyRule1=function(e){return t.applyMaskPenaltyRule1Internal(e,!0)+t.applyMaskPenaltyRule1Internal(e,!1)},t.applyMaskPenaltyRule2=function(e){for(var r=0,n=e.getArray(),o=e.getWidth(),i=e.getHeight(),a=0;a<i-1;a++)for(var s=n[a],u=0;u<o-1;u++){var l=s[u];l===s[u+1]&&l===n[a+1][u]&&l===n[a+1][u+1]&&r++}return t.N2*r},t.applyMaskPenaltyRule3=function(e){for(var r=0,n=e.getArray(),o=e.getWidth(),i=e.getHeight(),a=0;a<i;a++)for(var s=0;s<o;s++){var u=n[a];s+6<o&&1===u[s]&&0===u[s+1]&&1===u[s+2]&&1===u[s+3]&&1===u[s+4]&&0===u[s+5]&&1===u[s+6]&&(t.isWhiteHorizontal(u,s-4,s)||t.isWhiteHorizontal(u,s+7,s+11))&&r++,a+6<i&&1===n[a][s]&&0===n[a+1][s]&&1===n[a+2][s]&&1===n[a+3][s]&&1===n[a+4][s]&&0===n[a+5][s]&&1===n[a+6][s]&&(t.isWhiteVertical(n,s,a-4,a)||t.isWhiteVertical(n,s,a+7,a+11))&&r++}return r*t.N3},t.isWhiteHorizontal=function(t,e,r){e=Math.max(e,0),r=Math.min(r,t.length);for(var n=e;n<r;n++)if(1===t[n])return!1;return!0},t.isWhiteVertical=function(t,e,r,n){r=Math.max(r,0),n=Math.min(n,t.length);for(var o=r;o<n;o++)if(1===t[o][e])return!1;return!0},t.applyMaskPenaltyRule4=function(e){for(var r=0,n=e.getArray(),o=e.getWidth(),i=e.getHeight(),a=0;a<i;a++)for(var s=n[a],u=0;u<o;u++)1===s[u]&&r++;var l=e.getHeight()*e.getWidth();return Math.floor(10*Math.abs(2*r-l)/l)*t.N4},t.getDataMaskBit=function(t,e,r){var n,o;switch(t){case 0:n=r+e&1;break;case 1:n=1&r;break;case 2:n=e%3;break;case 3:n=(r+e)%3;break;case 4:n=Math.floor(r/2)+Math.floor(e/3)&1;break;case 5:n=(1&(o=r*e))+o%3;break;case 6:n=(1&(o=r*e))+o%3&1;break;case 7:n=(o=r*e)%3+(r+e&1)&1;break;default:throw new Er("Invalid mask pattern: "+t)}return 0===n},t.applyMaskPenaltyRule1Internal=function(e,r){for(var n=0,o=r?e.getHeight():e.getWidth(),i=r?e.getWidth():e.getHeight(),a=e.getArray(),s=0;s<o;s++){for(var u=0,l=-1,c=0;c<i;c++){var h=r?a[s][c]:a[c][s];h===l?u++:(u>=5&&(n+=t.N1+(u-5)),u=1,l=h)}u>=5&&(n+=t.N1+(u-5))}return n},t.N1=3,t.N2=3,t.N3=40,t.N4=10,t}(),ts=function(){function t(){this.maskPattern=-1}return t.prototype.getMode=function(){return this.mode},t.prototype.getECLevel=function(){return this.ecLevel},t.prototype.getVersion=function(){return this.version},t.prototype.getMaskPattern=function(){return this.maskPattern},t.prototype.getMatrix=function(){return this.matrix},t.prototype.toString=function(){var t=new $r;return t.append("<<\n"),t.append(" mode: "),t.append(this.mode?this.mode.toString():"null"),t.append("\n ecLevel: "),t.append(this.ecLevel?this.ecLevel.toString():"null"),t.append("\n version: "),t.append(this.version?this.version.toString():"null"),t.append("\n maskPattern: "),t.append(this.maskPattern.toString()),this.matrix?(t.append("\n matrix:\n"),t.append(this.matrix.toString())):t.append("\n matrix: null\n"),t.append(">>\n"),t.toString()},t.prototype.setMode=function(t){this.mode=t},t.prototype.setECLevel=function(t){this.ecLevel=t},t.prototype.setVersion=function(t){this.version=t},t.prototype.setMaskPattern=function(t){this.maskPattern=t},t.prototype.setMatrix=function(t){this.matrix=t},t.isValidMaskPattern=function(e){return e>=0&&e<t.NUM_MASK_PATTERNS},t.NUM_MASK_PATTERNS=8,t}(),es=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),rs=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return es(e,t),e.kind="WriterException",e}(wr);!function(){function t(){}t.clearMatrix=function(t){t.clear(255)},t.buildMatrix=function(e,r,n,o,i){t.clearMatrix(i),t.embedBasicPatterns(n,i),t.embedTypeInfo(r,o,i),t.maybeEmbedVersionInfo(n,i),t.embedDataBits(e,o,i)},t.embedBasicPatterns=function(e,r){t.embedPositionDetectionPatternsAndSeparators(r),t.embedDarkDotAtLeftBottomCorner(r),t.maybeEmbedPositionAdjustmentPatterns(e,r),t.embedTimingPatterns(r)},t.embedTypeInfo=function(e,r,n){var o=new Br;t.makeTypeInfoBits(e,r,o);for(var i=0,a=o.getSize();i<a;++i){var s=o.get(o.getSize()-1-i),u=t.TYPE_INFO_COORDINATES[i],l=u[0],c=u[1];if(n.setBoolean(l,c,s),i<8){var h=n.getWidth()-i-1,f=8;n.setBoolean(h,f,s)}else h=8,f=n.getHeight()-7+(i-8),n.setBoolean(h,f,s)}},t.maybeEmbedVersionInfo=function(e,r){if(!(e.getVersionNumber()<7)){var n=new Br;t.makeVersionInfoBits(e,n);for(var o=17,i=0;i<6;++i)for(var a=0;a<3;++a){var s=n.get(o);o--,r.setBoolean(i,r.getHeight()-11+a,s),r.setBoolean(r.getHeight()-11+a,i,s)}}},t.embedDataBits=function(e,r,n){for(var o=0,i=-1,a=n.getWidth()-1,s=n.getHeight()-1;a>0;){for(6===a&&(a-=1);s>=0&&s<n.getHeight();){for(var u=0;u<2;++u){var l=a-u;if(t.isEmpty(n.get(l,s))){var c=void 0;o<e.getSize()?(c=e.get(o),++o):c=!1,255!==r&&Ja.getDataMaskBit(r,l,s)&&(c=!c),n.setBoolean(l,s,c)}}s+=i}s+=i=-i,a-=2}if(o!==e.getSize())throw new rs("Not all bits consumed: "+o+"/"+e.getSize())},t.findMSBSet=function(t){return 32-Mr.numberOfLeadingZeros(t)},t.calculateBCHCode=function(e,r){if(0===r)throw new Er("0 polynomial");var n=t.findMSBSet(r);for(e<<=n-1;t.findMSBSet(e)>=n;)e^=r<<t.findMSBSet(e)-n;return e},t.makeTypeInfoBits=function(e,r,n){if(!ts.isValidMaskPattern(r))throw new rs("Invalid mask pattern");var o=e.getBits()<<3|r;n.appendBits(o,5);var i=t.calculateBCHCode(o,t.TYPE_INFO_POLY);n.appendBits(i,10);var a=new Br;if(a.appendBits(t.TYPE_INFO_MASK_PATTERN,15),n.xor(a),15!==n.getSize())throw new rs("should not happen but we got: "+n.getSize())},t.makeVersionInfoBits=function(e,r){r.appendBits(e.getVersionNumber(),6);var n=t.calculateBCHCode(e.getVersionNumber(),t.VERSION_INFO_POLY);if(r.appendBits(n,12),18!==r.getSize())throw new rs("should not happen but we got: "+r.getSize())},t.isEmpty=function(t){return 255===t},t.embedTimingPatterns=function(e){for(var r=8;r<e.getWidth()-8;++r){var n=(r+1)%2;t.isEmpty(e.get(r,6))&&e.setNumber(r,6,n),t.isEmpty(e.get(6,r))&&e.setNumber(6,r,n)}},t.embedDarkDotAtLeftBottomCorner=function(t){if(0===t.get(8,t.getHeight()-8))throw new rs;t.setNumber(8,t.getHeight()-8,1)},t.embedHorizontalSeparationPattern=function(e,r,n){for(var o=0;o<8;++o){if(!t.isEmpty(n.get(e+o,r)))throw new rs;n.setNumber(e+o,r,0)}},t.embedVerticalSeparationPattern=function(e,r,n){for(var o=0;o<7;++o){if(!t.isEmpty(n.get(e,r+o)))throw new rs;n.setNumber(e,r+o,0)}},t.embedPositionAdjustmentPattern=function(e,r,n){for(var o=0;o<5;++o)for(var i=t.POSITION_ADJUSTMENT_PATTERN[o],a=0;a<5;++a)n.setNumber(e+a,r+o,i[a])},t.embedPositionDetectionPattern=function(e,r,n){for(var o=0;o<7;++o)for(var i=t.POSITION_DETECTION_PATTERN[o],a=0;a<7;++a)n.setNumber(e+a,r+o,i[a])},t.embedPositionDetectionPatternsAndSeparators=function(e){var r=t.POSITION_DETECTION_PATTERN[0].length;t.embedPositionDetectionPattern(0,0,e),t.embedPositionDetectionPattern(e.getWidth()-r,0,e),t.embedPositionDetectionPattern(0,e.getWidth()-r,e),t.embedHorizontalSeparationPattern(0,7,e),t.embedHorizontalSeparationPattern(e.getWidth()-8,7,e),t.embedHorizontalSeparationPattern(0,e.getWidth()-8,e),t.embedVerticalSeparationPattern(7,0,e),t.embedVerticalSeparationPattern(e.getHeight()-7-1,0,e),t.embedVerticalSeparationPattern(7,e.getHeight()-7,e)},t.maybeEmbedPositionAdjustmentPatterns=function(e,r){if(!(e.getVersionNumber()<2))for(var n=e.getVersionNumber()-1,o=t.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE[n],i=0,a=o.length;i!==a;i++){var s=o[i];if(s>=0)for(var u=0;u!==a;u++){var l=o[u];l>=0&&t.isEmpty(r.get(l,s))&&t.embedPositionAdjustmentPattern(l-2,s-2,r)}}},t.POSITION_DETECTION_PATTERN=Array.from([Int32Array.from([1,1,1,1,1,1,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,1,1,1,1,1,1])]),t.POSITION_ADJUSTMENT_PATTERN=Array.from([Int32Array.from([1,1,1,1,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,0,1,0,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,1,1,1,1])]),t.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE=Array.from([Int32Array.from([-1,-1,-1,-1,-1,-1,-1]),Int32Array.from([6,18,-1,-1,-1,-1,-1]),Int32Array.from([6,22,-1,-1,-1,-1,-1]),Int32Array.from([6,26,-1,-1,-1,-1,-1]),Int32Array.from([6,30,-1,-1,-1,-1,-1]),Int32Array.from([6,34,-1,-1,-1,-1,-1]),Int32Array.from([6,22,38,-1,-1,-1,-1]),Int32Array.from([6,24,42,-1,-1,-1,-1]),Int32Array.from([6,26,46,-1,-1,-1,-1]),Int32Array.from([6,28,50,-1,-1,-1,-1]),Int32Array.from([6,30,54,-1,-1,-1,-1]),Int32Array.from([6,32,58,-1,-1,-1,-1]),Int32Array.from([6,34,62,-1,-1,-1,-1]),Int32Array.from([6,26,46,66,-1,-1,-1]),Int32Array.from([6,26,48,70,-1,-1,-1]),Int32Array.from([6,26,50,74,-1,-1,-1]),Int32Array.from([6,30,54,78,-1,-1,-1]),Int32Array.from([6,30,56,82,-1,-1,-1]),Int32Array.from([6,30,58,86,-1,-1,-1]),Int32Array.from([6,34,62,90,-1,-1,-1]),Int32Array.from([6,28,50,72,94,-1,-1]),Int32Array.from([6,26,50,74,98,-1,-1]),Int32Array.from([6,30,54,78,102,-1,-1]),Int32Array.from([6,28,54,80,106,-1,-1]),Int32Array.from([6,32,58,84,110,-1,-1]),Int32Array.from([6,30,58,86,114,-1,-1]),Int32Array.from([6,34,62,90,118,-1,-1]),Int32Array.from([6,26,50,74,98,122,-1]),Int32Array.from([6,30,54,78,102,126,-1]),Int32Array.from([6,26,52,78,104,130,-1]),Int32Array.from([6,30,56,82,108,134,-1]),Int32Array.from([6,34,60,86,112,138,-1]),Int32Array.from([6,30,58,86,114,142,-1]),Int32Array.from([6,34,62,90,118,146,-1]),Int32Array.from([6,30,54,78,102,126,150]),Int32Array.from([6,24,50,76,102,128,154]),Int32Array.from([6,28,54,80,106,132,158]),Int32Array.from([6,32,58,84,110,136,162]),Int32Array.from([6,26,54,82,110,138,166]),Int32Array.from([6,30,58,86,114,142,170])]),t.TYPE_INFO_COORDINATES=Array.from([Int32Array.from([8,0]),Int32Array.from([8,1]),Int32Array.from([8,2]),Int32Array.from([8,3]),Int32Array.from([8,4]),Int32Array.from([8,5]),Int32Array.from([8,7]),Int32Array.from([8,8]),Int32Array.from([7,8]),Int32Array.from([5,8]),Int32Array.from([4,8]),Int32Array.from([3,8]),Int32Array.from([2,8]),Int32Array.from([1,8]),Int32Array.from([0,8])]),t.VERSION_INFO_POLY=7973,t.TYPE_INFO_POLY=1335,t.TYPE_INFO_MASK_PATTERN=21522}(),Int32Array.from([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,36,-1,-1,-1,37,38,-1,-1,-1,-1,39,40,-1,41,42,43,0,1,2,3,4,5,6,7,8,9,44,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,-1,-1,-1,-1,-1]),Hr.UTF8.getName();var ns=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){function e(e,r,n,o,i,a,s,u){var l=t.call(this,a,s)||this;if(l.yuvData=e,l.dataWidth=r,l.dataHeight=n,l.left=o,l.top=i,o+a>r||i+s>n)throw new Er("Crop rectangle does not fit within image data.");return u&&l.reverseHorizontal(a,s),l}ns(e,t),e.prototype.getRow=function(t,e){if(t<0||t>=this.getHeight())throw new Er("Requested row is outside the image: "+t);var r=this.getWidth();(null==e||e.length<r)&&(e=new Uint8ClampedArray(r));var n=(t+this.top)*this.dataWidth+this.left;return Tr.arraycopy(this.yuvData,n,e,0,r),e},e.prototype.getMatrix=function(){var t=this.getWidth(),e=this.getHeight();if(t===this.dataWidth&&e===this.dataHeight)return this.yuvData;var r=t*e,n=new Uint8ClampedArray(r),o=this.top*this.dataWidth+this.left;if(t===this.dataWidth)return Tr.arraycopy(this.yuvData,o,n,0,r),n;for(var i=0;i<e;i++){var a=i*t;Tr.arraycopy(this.yuvData,o,n,a,t),o+=this.dataWidth}return n},e.prototype.isCropSupported=function(){return!0},e.prototype.crop=function(t,r,n,o){return new e(this.yuvData,this.dataWidth,this.dataHeight,this.left+t,this.top+r,n,o,!1)},e.prototype.renderThumbnail=function(){for(var t=this.getWidth()/e.THUMBNAIL_SCALE_FACTOR,r=this.getHeight()/e.THUMBNAIL_SCALE_FACTOR,n=new Int32Array(t*r),o=this.yuvData,i=this.top*this.dataWidth+this.left,a=0;a<r;a++){for(var s=a*t,u=0;u<t;u++){var l=255&o[i+u*e.THUMBNAIL_SCALE_FACTOR];n[s+u]=4278190080|65793*l}i+=this.dataWidth*e.THUMBNAIL_SCALE_FACTOR}return n},e.prototype.getThumbnailWidth=function(){return this.getWidth()/e.THUMBNAIL_SCALE_FACTOR},e.prototype.getThumbnailHeight=function(){return this.getHeight()/e.THUMBNAIL_SCALE_FACTOR},e.prototype.reverseHorizontal=function(t,e){for(var r=this.yuvData,n=0,o=this.top*this.dataWidth+this.left;n<e;n++,o+=this.dataWidth)for(var i=o+t/2,a=o,s=o+t-1;a<i;a++,s--){var u=r[a];r[a]=r[s],r[s]=u}},e.prototype.invert=function(){return new nn(this)},e.THUMBNAIL_SCALE_FACTOR=2}(en);var os=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){function e(e,r,n,o,i,a,s){var u=t.call(this,r,n)||this;if(u.dataWidth=o,u.dataHeight=i,u.left=a,u.top=s,4===e.BYTES_PER_ELEMENT){for(var l=r*n,c=new Uint8ClampedArray(l),h=0;h<l;h++){var f=e[h],d=f>>16&255,p=f>>7&510,g=255&f;c[h]=(d+p+g)/4&255}u.luminances=c}else u.luminances=e;if(void 0===o&&(u.dataWidth=r),void 0===i&&(u.dataHeight=n),void 0===a&&(u.left=0),void 0===s&&(u.top=0),u.left+r>u.dataWidth||u.top+n>u.dataHeight)throw new Er("Crop rectangle does not fit within image data.");return u}os(e,t),e.prototype.getRow=function(t,e){if(t<0||t>=this.getHeight())throw new Er("Requested row is outside the image: "+t);var r=this.getWidth();(null==e||e.length<r)&&(e=new Uint8ClampedArray(r));var n=(t+this.top)*this.dataWidth+this.left;return Tr.arraycopy(this.luminances,n,e,0,r),e},e.prototype.getMatrix=function(){var t=this.getWidth(),e=this.getHeight();if(t===this.dataWidth&&e===this.dataHeight)return this.luminances;var r=t*e,n=new Uint8ClampedArray(r),o=this.top*this.dataWidth+this.left;if(t===this.dataWidth)return Tr.arraycopy(this.luminances,o,n,0,r),n;for(var i=0;i<e;i++){var a=i*t;Tr.arraycopy(this.luminances,o,n,a,t),o+=this.dataWidth}return n},e.prototype.isCropSupported=function(){return!0},e.prototype.crop=function(t,r,n,o){return new e(this.luminances,n,o,this.dataWidth,this.dataHeight,this.left+t,this.top+r)},e.prototype.invert=function(){return new nn(this)}}(en);var is=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){function e(){return null!==t&&t.apply(this,arguments)||this}is(e,t),e.forName=function(t){return this.getCharacterSetECIByName(t)}}(Hr);var as=function(){function t(t){this.previous=t}return t.prototype.getPrevious=function(){return this.previous},t}(),ss=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),us=function(t){function e(e,r,n){var o=t.call(this,e)||this;return o.value=r,o.bitCount=n,o}return ss(e,t),e.prototype.appendTo=function(t,e){t.appendBits(this.value,this.bitCount)},e.prototype.add=function(t,r){return new e(this,t,r)},e.prototype.addBinaryShift=function(t,r){return console.warn("addBinaryShift on SimpleToken, this simply returns a copy of this token"),new e(this,t,r)},e.prototype.toString=function(){var t=this.value&(1<<this.bitCount)-1;return t|=1<<this.bitCount,"<"+Mr.toBinaryString(t|1<<this.bitCount).substring(1)+">"},e}(as),ls=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){function e(e,r,n){var o=t.call(this,e,0,0)||this;return o.binaryShiftStart=r,o.binaryShiftByteCount=n,o}ls(e,t),e.prototype.appendTo=function(t,e){for(var r=0;r<this.binaryShiftByteCount;r++)(0===r||31===r&&this.binaryShiftByteCount<=62)&&(t.appendBits(31,5),this.binaryShiftByteCount>62?t.appendBits(this.binaryShiftByteCount-31,16):0===r?t.appendBits(Math.min(this.binaryShiftByteCount,31),5):t.appendBits(this.binaryShiftByteCount-31,5)),t.appendBits(e[this.binaryShiftStart+r],8)},e.prototype.addBinaryShift=function(t,r){return new e(this,t,r)},e.prototype.toString=function(){return"<"+this.binaryShiftStart+"::"+(this.binaryShiftStart+this.binaryShiftByteCount-1)+">"}}(us),new us(null,0,0);!function(t){var e,r;try{for(var n=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(t),o=n.next();!o.done;o=n.next()){var i=o.value;Pr.fill(i,-1)}}catch(a){e={error:a}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(e)throw e.error}}t[0][4]=0,t[1][4]=0,t[1][0]=28,t[3][4]=0,t[2][4]=0,t[2][0]=15}(Pr.createInt32Array(6,6)),function(t){var e=Xr.getCharCode(" "),r=Xr.getCharCode("."),n=Xr.getCharCode(",");t[0][e]=1;for(var o=Xr.getCharCode("Z"),i=Xr.getCharCode("A"),a=i;a<=o;a++)t[0][a]=a-i+2;t[1][e]=1;var s=Xr.getCharCode("z"),u=Xr.getCharCode("a");for(a=u;a<=s;a++)t[1][a]=a-u+2;t[2][e]=1;var l=Xr.getCharCode("9"),c=Xr.getCharCode("0");for(a=c;a<=l;a++)t[2][a]=a-c+2;t[2][n]=12,t[2][r]=13;for(var h=["\0"," ","","","","","","","","\b","\t","\n","\v","\f","\r","","","","","","@","\\","^","_","`","|","~",""],f=0;f<h.length;f++)t[3][Xr.getCharCode(h[f])]=f;var d=["\0","\r","\0","\0","\0","\0","!","'","#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}"];for(f=0;f<d.length;f++)Xr.getCharCode(d[f])>0&&(t[4][Xr.getCharCode(d[f])]=f)}(Pr.createInt32Array(5,256));var cs=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),hs=function(t){function e(r){var n=t.call(this,r.width,r.height)||this;return n.canvas=r,n.buffer=e.makeBufferFromCanvasImageData(r),n}return cs(e,t),e.makeBufferFromCanvasImageData=function(t){var r=t.getContext("2d");if(!r)throw new Error("Couldn't get canvas context.");var n=r.getImageData(0,0,t.width,t.height);return e.toGrayscaleBuffer(n.data,t.width,t.height)},e.toGrayscaleBuffer=function(t,e,r){for(var n=new Uint8ClampedArray(e*r),o=0,i=0,a=t.length;o<a;o+=4,i++){var s=void 0;s=0===t[o+3]?255:306*t[o]+601*t[o+1]+117*t[o+2]+512>>10,n[i]=s}return n},e.prototype.getRow=function(t,e){if(t<0||t>=this.getHeight())throw new Er("Requested row is outside the image: "+t);var r=this.getWidth(),n=t*r;return null===e?e=this.buffer.slice(n,n+r):(e.length<r&&(e=new Uint8ClampedArray(r)),e.set(this.buffer.slice(n,n+r))),e},e.prototype.getMatrix=function(){return this.buffer},e.prototype.isCropSupported=function(){return!0},e.prototype.crop=function(e,r,n,o){return t.prototype.crop.call(this,e,r,n,o),this},e.prototype.isRotateSupported=function(){return!0},e.prototype.rotateCounterClockwise=function(){return this.rotate(-90),this},e.prototype.rotateCounterClockwise45=function(){return this.rotate(-45),this},e.prototype.invert=function(){return new nn(this)},e.prototype.getTempCanvasElement=function(){if(null===this.tempCanvasElement){var t=this.canvas.ownerDocument.createElement("canvas");t.width=this.canvas.width,t.height=this.canvas.height,this.tempCanvasElement=t}return this.tempCanvasElement},e.prototype.rotate=function(t){var r=this.getTempCanvasElement();if(!r)throw new Error("Could not create a Canvas element.");var n=t*e.DEGREE_TO_RADIANS,o=this.canvas.width,i=this.canvas.height,a=Math.ceil(Math.abs(Math.cos(n))*o+Math.abs(Math.sin(n))*i),s=Math.ceil(Math.abs(Math.sin(n))*o+Math.abs(Math.cos(n))*i);r.width=a,r.height=s;var u=r.getContext("2d");if(!u)throw new Error("Could not create a Convas Context element.");return u.translate(a/2,s/2),u.rotate(n),u.drawImage(this.canvas,o/-2,i/-2),this.buffer=e.makeBufferFromCanvasImageData(r),this},e.DEGREE_TO_RADIANS=Math.PI/180,e}(en);function fs(){return"undefined"!=typeof navigator}var ds=function(){return ds=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},ds.apply(this,arguments)},ps=function(t,e,r,n){return new(r||(r=Promise))(function(e,o){function i(t){try{s(n.next(t))}catch(e){o(e)}}function a(t){try{s(n.throw(t))}catch(e){o(e)}}function s(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r(function(t){t(n)})).then(i,a)}s((n=n.apply(t,[])).next())})},gs=function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(s){i=[6,s],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},ms=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},vs={delayBetweenScanAttempts:500,delayBetweenScanSuccess:500,tryPlayVideoTimeout:5e3},ys=function(){function t(t,e,r){void 0===e&&(e=new Map),void 0===r&&(r={}),this.reader=t,this.hints=e,this.options=ds(ds({},vs),r)}return Object.defineProperty(t.prototype,"possibleFormats",{set:function(t){this.hints.set(Fr.POSSIBLE_FORMATS,t)},enumerable:!1,configurable:!0}),t.addVideoSource=function(t,e){try{t.srcObject=e}catch(r){t.src=URL.createObjectURL(e)}},t.mediaStreamSetTorch=function(t,e){return ps(this,0,void 0,function(){return gs(this,function(r){switch(r.label){case 0:return[4,t.applyConstraints({advanced:[{fillLightMode:e?"flash":"off",torch:!!e}]})];case 1:return r.sent(),[2]}})})},t.mediaStreamIsTorchCompatible=function(e){var r,n,o=e.getVideoTracks();try{for(var i=ms(o),a=i.next();!a.done;a=i.next()){var s=a.value;if(t.mediaStreamIsTorchCompatibleTrack(s))return!0}}catch(u){r={error:u}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return!1},t.mediaStreamIsTorchCompatibleTrack=function(t){try{return"torch"in t.getCapabilities()}catch(e){return console.error(e),console.warn("Your browser may be not fully compatible with WebRTC and/or ImageCapture specs. Torch will not be available."),!1}},t.isVideoPlaying=function(t){return t.currentTime>0&&!t.paused&&t.readyState>2},t.getMediaElement=function(t,e){var r=document.getElementById(t);if(!r)throw new Cr("element with id '"+t+"' not found");if(r.nodeName.toLowerCase()!==e.toLowerCase())throw new Cr("element with id '"+t+"' must be an "+e+" element");return r},t.createVideoElement=function(e){if(e instanceof HTMLVideoElement)return e;if("string"==typeof e)return t.getMediaElement(e,"video");if(!e&&"undefined"!=typeof document){var r=document.createElement("video");return r.width=200,r.height=200,r}throw new Error("Couldn't get videoElement from videoSource!")},t.prepareImageElement=function(e){if(e instanceof HTMLImageElement)return e;if("string"==typeof e)return t.getMediaElement(e,"img");if(void 0===e){var r=document.createElement("img");return r.width=200,r.height=200,r}throw new Error("Couldn't get imageElement from imageSource!")},t.prepareVideoElement=function(e){var r=t.createVideoElement(e);return r.setAttribute("autoplay","true"),r.setAttribute("muted","true"),r.setAttribute("playsinline","true"),r},t.isImageLoaded=function(t){return!!t.complete&&0!==t.naturalWidth},t.createBinaryBitmapFromCanvas=function(t){var e=new hs(t),r=new tn(e);return new Ir(r)},t.drawImageOnCanvas=function(t,e){t.drawImage(e,0,0)},t.getMediaElementDimensions=function(t){if(t instanceof HTMLVideoElement)return{height:t.videoHeight,width:t.videoWidth};if(t instanceof HTMLImageElement)return{height:t.naturalHeight||t.height,width:t.naturalWidth||t.width};throw new Error("Couldn't find the Source's dimentions!")},t.createCaptureCanvas=function(e){if(!e)throw new Cr("Cannot create a capture canvas without a media element.");if("undefined"==typeof document)throw new Error('The page "Document" is undefined, make sure you\'re running in a browser.');var r=document.createElement("canvas"),n=t.getMediaElementDimensions(e),o=n.width,i=n.height;return r.style.width=o+"px",r.style.height=i+"px",r.width=o,r.height=i,r},t.tryPlayVideo=function(e){return ps(this,0,void 0,function(){var r;return gs(this,function(n){switch(n.label){case 0:if(null==e?void 0:e.ended)return console.error("Trying to play video that has ended."),[2,!1];if(t.isVideoPlaying(e))return console.warn("Trying to play video that is already playing."),[2,!0];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,e.play()];case 2:return n.sent(),[2,!0];case 3:return r=n.sent(),console.warn("It was not possible to play the video.",r),[2,!1];case 4:return[2]}})})},t.createCanvasFromMediaElement=function(e){var r=t.createCaptureCanvas(e),n=r.getContext("2d");if(!n)throw new Error("Couldn't find Canvas 2D Context.");return t.drawImageOnCanvas(n,e),r},t.createBinaryBitmapFromMediaElem=function(e){var r=t.createCanvasFromMediaElement(e);return t.createBinaryBitmapFromCanvas(r)},t.destroyImageElement=function(t){t.src="",t.removeAttribute("src"),t=void 0},t.listVideoInputDevices=function(){return ps(this,0,void 0,function(){var t,e,r,n,o,i,a,s,u,l,c,h;return gs(this,function(f){switch(f.label){case 0:if(!fs())throw new Error("Can't enumerate devices, navigator is not present.");if(!(fs()&&navigator.mediaDevices&&navigator.mediaDevices.enumerateDevices))throw new Error("Can't enumerate devices, method not supported.");return[4,navigator.mediaDevices.enumerateDevices()];case 1:t=f.sent(),e=[];try{for(r=ms(t),n=r.next();!n.done;n=r.next())o=n.value,"videoinput"===(i="video"===o.kind?"videoinput":o.kind)&&(a=o.deviceId||o.id,s=o.label||"Video device "+(e.length+1),u=o.groupId,l={deviceId:a,label:s,kind:i,groupId:u},e.push(l))}catch(d){c={error:d}}finally{try{n&&!n.done&&(h=r.return)&&h.call(r)}finally{if(c)throw c.error}}return[2,e]}})})},t.findDeviceById=function(e){return ps(this,0,void 0,function(){var r;return gs(this,function(n){switch(n.label){case 0:return[4,t.listVideoInputDevices()];case 1:return(r=n.sent())?[2,r.find(function(t){return t.deviceId===e})]:[2]}})})},t.cleanVideoSource=function(t){if(t){try{t.srcObject=null}catch(e){t.src=""}t&&t.removeAttribute("src")}},t.playVideoOnLoadAsync=function(e,r){return ps(this,0,void 0,function(){return gs(this,function(n){switch(n.label){case 0:return[4,t.tryPlayVideo(e)];case 1:return n.sent()?[2,!0]:[2,new Promise(function(n,o){var i=setTimeout(function(){t.isVideoPlaying(e)||(o(!1),e.removeEventListener("canplay",a))},r),a=function(){t.tryPlayVideo(e).then(function(t){clearTimeout(i),e.removeEventListener("canplay",a),n(t)})};e.addEventListener("canplay",a)})]}})})},t.attachStreamToVideo=function(e,r,n){return void 0===n&&(n=5e3),ps(this,0,void 0,function(){var o;return gs(this,function(i){switch(i.label){case 0:return o=t.prepareVideoElement(r),t.addVideoSource(o,e),[4,t.playVideoOnLoadAsync(o,n)];case 1:return i.sent(),[2,o]}})})},t._waitImageLoad=function(e){return new Promise(function(r,n){var o=setTimeout(function(){t.isImageLoaded(e)||(e.removeEventListener("load",i),n())},1e4),i=function(){clearTimeout(o),e.removeEventListener("load",i),r()};e.addEventListener("load",i)})},t.checkCallbackFnOrThrow=function(t){if(!t)throw new Cr("`callbackFn` is a required parameter, you cannot capture results without it.")},t.disposeMediaStream=function(t){t.getVideoTracks().forEach(function(t){return t.stop()}),t=void 0},t.prototype.decode=function(e){var r=t.createCanvasFromMediaElement(e);return this.decodeFromCanvas(r)},t.prototype.decodeBitmap=function(t){return this.reader.decode(t,this.hints)},t.prototype.decodeFromCanvas=function(e){var r=t.createBinaryBitmapFromCanvas(e);return this.decodeBitmap(r)},t.prototype.decodeFromImageElement=function(e){return ps(this,0,void 0,function(){var r;return gs(this,function(n){switch(n.label){case 0:if(!e)throw new Cr("An image element must be provided.");return r=t.prepareImageElement(e),[4,this._decodeOnLoadImage(r)];case 1:return[2,n.sent()]}})})},t.prototype.decodeFromImageUrl=function(e){return ps(this,0,void 0,function(){var r;return gs(this,function(n){switch(n.label){case 0:if(!e)throw new Cr("An URL must be provided.");(r=t.prepareImageElement()).src=e,n.label=1;case 1:return n.trys.push([1,,3,4]),[4,this.decodeFromImageElement(r)];case 2:return[2,n.sent()];case 3:return t.destroyImageElement(r),[7];case 4:return[2]}})})},t.prototype.decodeFromConstraints=function(e,r,n){return ps(this,0,void 0,function(){var o,i;return gs(this,function(a){switch(a.label){case 0:return t.checkCallbackFnOrThrow(n),[4,navigator.mediaDevices.getUserMedia(e)];case 1:o=a.sent(),a.label=2;case 2:return a.trys.push([2,4,,5]),[4,this.decodeFromStream(o,r,n)];case 3:return[2,a.sent()];case 4:throw i=a.sent(),t.disposeMediaStream(o),i;case 5:return[2]}})})},t.prototype.decodeFromStream=function(e,r,n){return ps(this,0,void 0,function(){var o,i,a,s,u,l,c,h,f,d,p=this;return gs(this,function(g){switch(g.label){case 0:return t.checkCallbackFnOrThrow(n),o=this.options.tryPlayVideoTimeout,[4,t.attachStreamToVideo(e,r,o)];case 1:return i=g.sent(),a=function(){var t,r;try{for(var n=ms(e.getVideoTracks()),o=n.next();!o.done;o=n.next())o.value.stop()}catch(i){t={error:i}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}e=void 0},s=function(){a(),t.cleanVideoSource(i)},u=this.scan(i,n,s),l=e.getVideoTracks(),c=ds(ds({},u),{stop:function(){u.stop()},streamVideoConstraintsApply:function(t,e){return ps(this,0,void 0,function(){var r,n,o,i,a,s;return gs(this,function(u){switch(u.label){case 0:r=e?l.filter(e):l,u.label=1;case 1:u.trys.push([1,6,7,8]),n=ms(r),o=n.next(),u.label=2;case 2:return o.done?[3,5]:[4,o.value.applyConstraints(t)];case 3:u.sent(),u.label=4;case 4:return o=n.next(),[3,2];case 5:return[3,8];case 6:return i=u.sent(),a={error:i},[3,8];case 7:try{o&&!o.done&&(s=n.return)&&s.call(n)}finally{if(a)throw a.error}return[7];case 8:return[2]}})})},streamVideoConstraintsGet:function(t){return l.find(t).getConstraints()},streamVideoSettingsGet:function(t){return l.find(t).getSettings()},streamVideoCapabilitiesGet:function(t){return l.find(t).getCapabilities()}}),t.mediaStreamIsTorchCompatible(e)&&(h=null==l?void 0:l.find(function(e){return t.mediaStreamIsTorchCompatibleTrack(e)}),f=function(e){return ps(p,0,void 0,function(){return gs(this,function(r){switch(r.label){case 0:return[4,t.mediaStreamSetTorch(h,e)];case 1:return r.sent(),[2]}})})},c.switchTorch=f,d=function(){u.stop(),f(!1)},c.stop=d),[2,c]}})})},t.prototype.decodeFromVideoDevice=function(e,r,n){return ps(this,0,void 0,function(){var o;return gs(this,function(i){switch(i.label){case 0:return t.checkCallbackFnOrThrow(n),o={video:e?{deviceId:{exact:e}}:{facingMode:"environment"}},[4,this.decodeFromConstraints(o,r,n)];case 1:return[2,i.sent()]}})})},t.prototype.decodeFromVideoElement=function(e,r){return ps(this,0,void 0,function(){var n,o;return gs(this,function(i){switch(i.label){case 0:if(t.checkCallbackFnOrThrow(r),!e)throw new Cr("A video element must be provided.");return n=t.prepareVideoElement(e),o=this.options.tryPlayVideoTimeout,[4,t.playVideoOnLoadAsync(n,o)];case 1:return i.sent(),[2,this.scan(n,r)]}})})},t.prototype.decodeFromVideoUrl=function(e,r){return ps(this,0,void 0,function(){var n,o,i;return gs(this,function(a){switch(a.label){case 0:if(t.checkCallbackFnOrThrow(r),!e)throw new Cr("An URL must be provided.");return(n=t.prepareVideoElement()).src=e,o=function(){t.cleanVideoSource(n)},i=this.options.tryPlayVideoTimeout,[4,t.playVideoOnLoadAsync(n,i)];case 1:return a.sent(),[2,this.scan(n,r,o)]}})})},t.prototype.decodeOnceFromConstraints=function(t,e){return ps(this,0,void 0,function(){var r;return gs(this,function(n){switch(n.label){case 0:return[4,navigator.mediaDevices.getUserMedia(t)];case 1:return r=n.sent(),[4,this.decodeOnceFromStream(r,e)];case 2:return[2,n.sent()]}})})},t.prototype.decodeOnceFromStream=function(e,r){return ps(this,0,void 0,function(){var n,o;return gs(this,function(i){switch(i.label){case 0:return n=Boolean(r),[4,t.attachStreamToVideo(e,r)];case 1:o=i.sent(),i.label=2;case 2:return i.trys.push([2,,4,5]),[4,this.scanOneResult(o)];case 3:return[2,i.sent()];case 4:return n||t.cleanVideoSource(o),[7];case 5:return[2]}})})},t.prototype.decodeOnceFromVideoDevice=function(t,e){return ps(this,0,void 0,function(){var r;return gs(this,function(n){switch(n.label){case 0:return r={video:t?{deviceId:{exact:t}}:{facingMode:"environment"}},[4,this.decodeOnceFromConstraints(r,e)];case 1:return[2,n.sent()]}})})},t.prototype.decodeOnceFromVideoElement=function(e){return ps(this,0,void 0,function(){var r,n;return gs(this,function(o){switch(o.label){case 0:if(!e)throw new Cr("A video element must be provided.");return r=t.prepareVideoElement(e),n=this.options.tryPlayVideoTimeout,[4,t.playVideoOnLoadAsync(r,n)];case 1:return o.sent(),[4,this.scanOneResult(r)];case 2:return[2,o.sent()]}})})},t.prototype.decodeOnceFromVideoUrl=function(e){return ps(this,0,void 0,function(){var r,n;return gs(this,function(o){switch(o.label){case 0:if(!e)throw new Cr("An URL must be provided.");(r=t.prepareVideoElement()).src=e,n=this.decodeOnceFromVideoElement(r),o.label=1;case 1:return o.trys.push([1,,3,4]),[4,n];case 2:return[2,o.sent()];case 3:return t.cleanVideoSource(r),[7];case 4:return[2]}})})},t.prototype.scanOneResult=function(t,e,r,n){var o=this;return void 0===e&&(e=!0),void 0===r&&(r=!0),void 0===n&&(n=!0),new Promise(function(i,a){o.scan(t,function(t,o,s){if(t)return i(t),void s.stop();if(o){if(o instanceof Kr&&e)return;if(o instanceof xr&&r)return;if(o instanceof Vr&&n)return;s.stop(),a(o)}})})},t.prototype.scan=function(e,r,n){var o=this;t.checkCallbackFnOrThrow(r);var i=t.createCaptureCanvas(e),a=i.getContext("2d");if(!a)throw new Error("Couldn't create canvas for visual element scan.");var s,u=function(){a=void 0,i=void 0},l=!1,c={stop:function(){l=!0,clearTimeout(s),u(),n&&n()}},h=function(){if(!l)try{t.drawImageOnCanvas(a,e);var f=o.decodeFromCanvas(i);r(f,void 0,c),s=setTimeout(h,o.options.delayBetweenScanSuccess)}catch(d){if(r(void 0,d,c),d instanceof xr||d instanceof Vr||d instanceof Kr)return void(s=setTimeout(h,o.options.delayBetweenScanAttempts));u(),n&&n(d)}};return h(),c},t.prototype._decodeOnLoadImage=function(e){return ps(this,0,void 0,function(){return gs(this,function(r){switch(r.label){case 0:return t.isImageLoaded(e)?[3,2]:[4,t._waitImageLoad(e)];case 1:r.sent(),r.label=2;case 2:return[2,this.decode(e)]}})})},t}(),_s=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){_s(function(e,r){return t.call(this,new zn,e,r)||this},t)}(ys);var ws=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){ws(function(e,r){return t.call(this,new yi(e),e,r)||this},t)}(ys);var bs=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){bs(function(e,r){return t.call(this,new Di,e,r)||this},t)}(ys);var Cs=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){function e(e,r){var n=this,o=new Ya;return o.setHints(e),(n=t.call(this,o,e,r)||this).reader=o,n}Cs(e,t),Object.defineProperty(e.prototype,"possibleFormats",{set:function(t){this.hints.set(Fr.POSSIBLE_FORMATS,t),this.reader.setHints(this.hints)},enumerable:!1,configurable:!0}),e.prototype.decodeBitmap=function(t){return this.reader.decodeWithState(t)},e.prototype.setHints=function(t){this.hints=t,this.reader.setHints(this.hints)}}(ys);var As=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){As(function(e,r){return t.call(this,new Wa,e,r)||this},t)}(ys);var Es=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Is=function(t){function e(e,r){return t.call(this,new ua,e,r)||this}return Es(e,t),e}(ys),Ss=function(t,e,r){var n=typeof t===r;return n||console.warn('[ReactQrReader]: Expected "'.concat(e,'" to be a of type "').concat(r,'".')),n},xs=function(){return xs=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},xs.apply(this,arguments)},Os={width:"100%",paddingTop:"100%",overflow:"hidden",position:"relative"},Ts={top:0,left:0,width:"100%",height:"100%",display:"block",overflow:"hidden",position:"absolute",transform:void 0},Ns=function(t){var r=t.videoContainerStyle,n=t.containerStyle,o=t.videoStyle,i=t.constraints,a=t.ViewFinder,s=t.scanDelay,u=t.className,l=t.onResult,c=t.videoId;return function(t){var r=t.scanDelay,n=t.constraints,o=t.onResult,i=t.videoId,a=e.useRef(null);e.useEffect(function(){var t,e=new Is(null,{delayBetweenScanAttempts:r});return(t="undefined"!=typeof navigator&&!!navigator.mediaDevices)||console.warn('[ReactQrReader]: MediaDevices API has no support for your browser. You can fix this by running "npm i webrtc-adapter"'),!t&&Ss(o,"onResult","function")&&o(null,new Error('MediaDevices API has no support for your browser. You can fix this by running "npm i webrtc-adapter"'),e),Ss(n,"constraints","object")&&e.decodeFromConstraints({video:n},i,function(t,r){Ss(o,"onResult","function")&&o(t,r,e)}).then(function(t){return a.current=t}).catch(function(t){Ss(o,"onResult","function")&&o(null,t,e)}),function(){var t;null===(t=a.current)||void 0===t||t.stop()}},[])}({constraints:i,scanDelay:s,onResult:l,videoId:c}),h.createElement("section",{className:u,style:n},h.createElement("div",{style:xs(xs({},Os),r)},!!a&&h.createElement(a,null),h.createElement("video",{muted:!0,id:c,style:xs(xs(xs({},Ts),o),{transform:"user"===(null==i?void 0:i.facingMode)&&"scaleX(-1)"})})))};function ks({onResult:t,setVisible:r,title:n,helpLink:o}){const[i,a]=e.useState(""),[s,u]=e.useState(!1);return Qt.jsxs(Qt.Fragment,{children:[Qt.jsxs(cr,{visible:!0,setVisible:r,hideScrollBar:!1,maxWidth:500,children:[Qt.jsx(dr,{helpLink:o,setVisible:r,children:n}),Qt.jsx(fr,{children:Qt.jsx(hr,{children:Qt.jsxs("div",{className:"position-relative my-2",children:[Qt.jsx(Ns,{onResult:function(e,n){(null==n?void 0:n.message)&&(a(`Ocorreu um erro ao fazer a leitura: ${n.message}`),"Requested device not found"===n.message&&u(!0)),e&&t&&(t(e),r(!1))},constraints:{facingMode:"environment"}}),Qt.jsxs("svg",{width:"50px",viewBox:"0 0 100 100",style:{top:"0px",left:"0px",zIndex:1,boxSizing:"border-box",border:"50px solid rgba(0, 0, 0, 0.25)",borderRadius:"15px",position:"absolute",width:"100%",height:"100%"},children:[Qt.jsx("path",{fill:"none",d:"M13,0 L0,0 L0,13",stroke:"rgba(255, 0, 0, 0.5)",strokeWidth:"5"}),Qt.jsx("path",{fill:"none",d:"M0,87 L0,100 L13,100",stroke:"rgba(255, 0, 0, 0.5)",strokeWidth:"5"}),Qt.jsx("path",{fill:"none",d:"M87,100 L100,100 L100,87",stroke:"rgba(255, 0, 0, 0.5)",strokeWidth:"5"}),Qt.jsx("path",{fill:"none",d:"M100,13 L100,0 87,0",stroke:"rgba(255, 0, 0, 0.5)",strokeWidth:"5"})]})]})})})]}),i&&Qt.jsx(se,{onConfirm:function(){a(),s&&r(!1)},children:i})]})}Ns.displayName="QrReader",Ns.defaultProps={constraints:{facingMode:"user"},videoId:"video",scanDelay:500};const Rs=o.div`
|
|
529
|
+
`,or="modal-hide-sb";function ir({maxWidth:t,visible:n,setVisible:o,children:i,hideScrollBar:a=!0,id:s,alignTop:u}){const{addModal:l,removeModal:c}=ee(),[h]=e.useState(s||"modal-"+r.random());return e.useEffect(()=>(n?a&&document.body.classList.add(or):(c(h),a&&document.body.classList.remove(or)),()=>{c(h),a&&document.body.classList.remove(or)}),[n,a]),e.useEffect(()=>{l(h,o)},[h]),n?Qt.jsx(nr,{alignTop:u,maxWidth:t,children:Qt.jsx("div",{className:"mod-panel",children:i})}):null}function ar({className:t="",...e}){return Qt.jsx("div",{className:`modal--body ${t}`,...e})}function sr({className:t="",...e}){return Qt.jsx("div",{className:`modal--content ${t}`,...e})}function ur({className:t="",setVisible:e,children:r,helpLink:n,...o}){return Qt.jsxs(He,{className:`modal--header ${t}`,...o,children:[Qt.jsx("span",{className:"pn-title",children:r}),n&&Qt.jsx(Me,{title:"Ir para a ajuda",onClick:()=>window.open(n,"_blank")}),Qt.jsx(Pe,{type:"button",onClick:()=>e(!1)})]})}var lr,cr,hr,fr=(lr=function(t,e){return(lr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}lr(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),dr=function(t){function e(e){var r,n,o,i=this.constructor,a=t.call(this,e)||this;return Object.defineProperty(a,"name",{value:i.name,enumerable:!1,configurable:!0}),r=a,n=i.prototype,(o=Object.setPrototypeOf)?o(r,n):r.__proto__=n,function(t,e){void 0===e&&(e=t.constructor);var r=Error.captureStackTrace;r&&r(t,e)}(a),a}return fr(e,t),e}(Error),pr=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),gr=function(t){function e(e){void 0===e&&(e=void 0);var r=t.call(this,e)||this;return r.message=e,r}return pr(e,t),e.prototype.getKind=function(){return this.constructor.kind},e.kind="Exception",e}(dr),mr=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),vr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return mr(e,t),e.kind="ArgumentException",e}(gr),yr=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),_r=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return yr(e,t),e.kind="IllegalArgumentException",e}(gr),wr=function(){function t(t){if(this.binarizer=t,null===t)throw new _r("Binarizer must be non-null.")}return t.prototype.getWidth=function(){return this.binarizer.getWidth()},t.prototype.getHeight=function(){return this.binarizer.getHeight()},t.prototype.getBlackRow=function(t,e){return this.binarizer.getBlackRow(t,e)},t.prototype.getBlackMatrix=function(){return null!==this.matrix&&void 0!==this.matrix||(this.matrix=this.binarizer.getBlackMatrix()),this.matrix},t.prototype.isCropSupported=function(){return this.binarizer.getLuminanceSource().isCropSupported()},t.prototype.crop=function(e,r,n,o){var i=this.binarizer.getLuminanceSource().crop(e,r,n,o);return new t(this.binarizer.createBinarizer(i))},t.prototype.isRotateSupported=function(){return this.binarizer.getLuminanceSource().isRotateSupported()},t.prototype.rotateCounterClockwise=function(){var e=this.binarizer.getLuminanceSource().rotateCounterClockwise();return new t(this.binarizer.createBinarizer(e))},t.prototype.rotateCounterClockwise45=function(){var e=this.binarizer.getLuminanceSource().rotateCounterClockwise45();return new t(this.binarizer.createBinarizer(e))},t.prototype.toString=function(){try{return this.getBlackMatrix().toString()}catch(t){return""}},t}(),br=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Cr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return br(e,t),e.getChecksumInstance=function(){return new e},e.kind="ChecksumException",e}(gr),Ar=function(){function t(t){this.source=t}return t.prototype.getLuminanceSource=function(){return this.source},t.prototype.getWidth=function(){return this.source.getWidth()},t.prototype.getHeight=function(){return this.source.getHeight()},t}(),Er=function(){function t(){}return t.arraycopy=function(t,e,r,n,o){for(;o--;)r[n++]=t[e++]},t.currentTimeMillis=function(){return Date.now()},t}(),Ir=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Sr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ir(e,t),e.kind="IndexOutOfBoundsException",e}(gr),xr=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Or=function(t){function e(e,r){void 0===e&&(e=void 0),void 0===r&&(r=void 0);var n=t.call(this,r)||this;return n.index=e,n.message=r,n}return xr(e,t),e.kind="ArrayIndexOutOfBoundsException",e}(Sr),Tr=function(){function t(){}return t.fill=function(t,e){for(var r=0,n=t.length;r<n;r++)t[r]=e},t.fillWithin=function(e,r,n,o){t.rangeCheck(e.length,r,n);for(var i=r;i<n;i++)e[i]=o},t.rangeCheck=function(t,e,r){if(e>r)throw new _r("fromIndex("+e+") > toIndex("+r+")");if(e<0)throw new Or(e);if(r>t)throw new Or(r)},t.asList=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t},t.create=function(t,e,r){return Array.from({length:t}).map(function(t){return Array.from({length:e}).fill(r)})},t.createInt32Array=function(t,e,r){return Array.from({length:t}).map(function(t){return Int32Array.from({length:e}).fill(r)})},t.equals=function(t,e){if(!t)return!1;if(!e)return!1;if(!t.length)return!1;if(!e.length)return!1;if(t.length!==e.length)return!1;for(var r=0,n=t.length;r<n;r++)if(t[r]!==e[r])return!1;return!0},t.hashCode=function(t){var e,r;if(null===t)return 0;var n=1;try{for(var o=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(t),i=o.next();!i.done;i=o.next())n=31*n+i.value}catch(a){e={error:a}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return n},t.fillUint8Array=function(t,e){for(var r=0;r!==t.length;r++)t[r]=e},t.copyOf=function(t,e){return t.slice(0,e)},t.copyOfUint8Array=function(t,e){if(t.length<=e){var r=new Uint8Array(e);return r.set(t),r}return t.slice(0,e)},t.copyOfRange=function(t,e,r){var n=r-e,o=new Int32Array(n);return Er.arraycopy(t,e,o,0,n),o},t.binarySearch=function(e,r,n){void 0===n&&(n=t.numberComparator);for(var o=0,i=e.length-1;o<=i;){var a=i+o>>1,s=n(r,e[a]);if(s>0)o=a+1;else{if(!(s<0))return a;i=a-1}}return-o-1},t.numberComparator=function(t,e){return t-e},t}(),Nr=function(){function t(){}return t.numberOfTrailingZeros=function(t){var e;if(0===t)return 32;var r=31;return 0!=(e=t<<16)&&(r-=16,t=e),0!=(e=t<<8)&&(r-=8,t=e),0!=(e=t<<4)&&(r-=4,t=e),0!=(e=t<<2)&&(r-=2,t=e),r-(t<<1>>>31)},t.numberOfLeadingZeros=function(t){if(0===t)return 32;var e=1;return t>>>16==0&&(e+=16,t<<=16),t>>>24==0&&(e+=8,t<<=8),t>>>28==0&&(e+=4,t<<=4),t>>>30==0&&(e+=2,t<<=2),e-(t>>>31)},t.toHexString=function(t){return t.toString(16)},t.toBinaryString=function(t){return String(parseInt(String(t),2))},t.bitCount=function(t){return t=(t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135,63&(t+=t>>>8)+(t>>>16)},t.truncDivision=function(t,e){return Math.trunc(t/e)},t.parseInt=function(t,e){return void 0===e&&(e=void 0),parseInt(t,e)},t.MIN_VALUE_32_BITS=-2147483648,t.MAX_VALUE=Number.MAX_SAFE_INTEGER,t}(),kr=function(){function t(e,r){void 0===e?(this.size=0,this.bits=new Int32Array(1)):(this.size=e,this.bits=null==r?t.makeArray(e):r)}return t.prototype.getSize=function(){return this.size},t.prototype.getSizeInBytes=function(){return Math.floor((this.size+7)/8)},t.prototype.ensureCapacity=function(e){if(e>32*this.bits.length){var r=t.makeArray(e);Er.arraycopy(this.bits,0,r,0,this.bits.length),this.bits=r}},t.prototype.get=function(t){return!!(this.bits[Math.floor(t/32)]&1<<(31&t))},t.prototype.set=function(t){this.bits[Math.floor(t/32)]|=1<<(31&t)},t.prototype.flip=function(t){this.bits[Math.floor(t/32)]^=1<<(31&t)},t.prototype.getNextSet=function(t){var e=this.size;if(t>=e)return e;var r=this.bits,n=Math.floor(t/32),o=r[n];o&=~((1<<(31&t))-1);for(var i=r.length;0===o;){if(++n===i)return e;o=r[n]}var a=32*n+Nr.numberOfTrailingZeros(o);return a>e?e:a},t.prototype.getNextUnset=function(t){var e=this.size;if(t>=e)return e;var r=this.bits,n=Math.floor(t/32),o=~r[n];o&=~((1<<(31&t))-1);for(var i=r.length;0===o;){if(++n===i)return e;o=~r[n]}var a=32*n+Nr.numberOfTrailingZeros(o);return a>e?e:a},t.prototype.setBulk=function(t,e){this.bits[Math.floor(t/32)]=e},t.prototype.setRange=function(t,e){if(e<t||t<0||e>this.size)throw new _r;if(e!==t){e--;for(var r=Math.floor(t/32),n=Math.floor(e/32),o=this.bits,i=r;i<=n;i++){var a=(2<<(i<n?31:31&e))-(1<<(i>r?0:31&t));o[i]|=a}}},t.prototype.clear=function(){for(var t=this.bits.length,e=this.bits,r=0;r<t;r++)e[r]=0},t.prototype.isRange=function(t,e,r){if(e<t||t<0||e>this.size)throw new _r;if(e===t)return!0;e--;for(var n=Math.floor(t/32),o=Math.floor(e/32),i=this.bits,a=n;a<=o;a++){var s=(2<<(a<o?31:31&e))-(1<<(a>n?0:31&t))&4294967295;if((i[a]&s)!==(r?s:0))return!1}return!0},t.prototype.appendBit=function(t){this.ensureCapacity(this.size+1),t&&(this.bits[Math.floor(this.size/32)]|=1<<(31&this.size)),this.size++},t.prototype.appendBits=function(t,e){if(e<0||e>32)throw new _r("Num bits must be between 0 and 32");this.ensureCapacity(this.size+e);for(var r=e;r>0;r--)this.appendBit(1==(t>>r-1&1))},t.prototype.appendBitArray=function(t){var e=t.size;this.ensureCapacity(this.size+e);for(var r=0;r<e;r++)this.appendBit(t.get(r))},t.prototype.xor=function(t){if(this.size!==t.size)throw new _r("Sizes don't match");for(var e=this.bits,r=0,n=e.length;r<n;r++)e[r]^=t.bits[r]},t.prototype.toBytes=function(t,e,r,n){for(var o=0;o<n;o++){for(var i=0,a=0;a<8;a++)this.get(t)&&(i|=1<<7-a),t++;e[r+o]=i}},t.prototype.getBitArray=function(){return this.bits},t.prototype.reverse=function(){for(var t=new Int32Array(this.bits.length),e=Math.floor((this.size-1)/32),r=e+1,n=this.bits,o=0;o<r;o++){var i=n[o];i=(i=(i=(i=(i=i>>1&1431655765|(1431655765&i)<<1)>>2&858993459|(858993459&i)<<2)>>4&252645135|(252645135&i)<<4)>>8&16711935|(16711935&i)<<8)>>16&65535|(65535&i)<<16,t[e-o]=i}if(this.size!==32*r){var a=32*r-this.size,s=t[0]>>>a;for(o=1;o<r;o++){var u=t[o];s|=u<<32-a,t[o-1]=s,s=u>>>a}t[r-1]=s}this.bits=t},t.makeArray=function(t){return new Int32Array(Math.floor((t+31)/32))},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var r=e;return this.size===r.size&&Tr.equals(this.bits,r.bits)},t.prototype.hashCode=function(){return 31*this.size+Tr.hashCode(this.bits)},t.prototype.toString=function(){for(var t="",e=0,r=this.size;e<r;e++)!(7&e)&&(t+=" "),t+=this.get(e)?"X":".";return t},t.prototype.clone=function(){return new t(this.size,this.bits.slice())},t}();(hr=cr||(cr={}))[hr.OTHER=0]="OTHER",hr[hr.PURE_BARCODE=1]="PURE_BARCODE",hr[hr.POSSIBLE_FORMATS=2]="POSSIBLE_FORMATS",hr[hr.TRY_HARDER=3]="TRY_HARDER",hr[hr.CHARACTER_SET=4]="CHARACTER_SET",hr[hr.ALLOWED_LENGTHS=5]="ALLOWED_LENGTHS",hr[hr.ASSUME_CODE_39_CHECK_DIGIT=6]="ASSUME_CODE_39_CHECK_DIGIT",hr[hr.ASSUME_GS1=7]="ASSUME_GS1",hr[hr.RETURN_CODABAR_START_END=8]="RETURN_CODABAR_START_END",hr[hr.NEED_RESULT_POINT_CALLBACK=9]="NEED_RESULT_POINT_CALLBACK",hr[hr.ALLOWED_EAN_EXTENSIONS=10]="ALLOWED_EAN_EXTENSIONS";var Rr,Dr=cr,Pr=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Mr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Pr(e,t),e.getFormatInstance=function(){return new e},e.kind="FormatException",e}(gr);!function(t){t[t.Cp437=0]="Cp437",t[t.ISO8859_1=1]="ISO8859_1",t[t.ISO8859_2=2]="ISO8859_2",t[t.ISO8859_3=3]="ISO8859_3",t[t.ISO8859_4=4]="ISO8859_4",t[t.ISO8859_5=5]="ISO8859_5",t[t.ISO8859_6=6]="ISO8859_6",t[t.ISO8859_7=7]="ISO8859_7",t[t.ISO8859_8=8]="ISO8859_8",t[t.ISO8859_9=9]="ISO8859_9",t[t.ISO8859_10=10]="ISO8859_10",t[t.ISO8859_11=11]="ISO8859_11",t[t.ISO8859_13=12]="ISO8859_13",t[t.ISO8859_14=13]="ISO8859_14",t[t.ISO8859_15=14]="ISO8859_15",t[t.ISO8859_16=15]="ISO8859_16",t[t.SJIS=16]="SJIS",t[t.Cp1250=17]="Cp1250",t[t.Cp1251=18]="Cp1251",t[t.Cp1252=19]="Cp1252",t[t.Cp1256=20]="Cp1256",t[t.UnicodeBigUnmarked=21]="UnicodeBigUnmarked",t[t.UTF8=22]="UTF8",t[t.ASCII=23]="ASCII",t[t.Big5=24]="Big5",t[t.GB18030=25]="GB18030",t[t.EUC_KR=26]="EUC_KR"}(Rr||(Rr={}));var Br,Lr=function(){function t(e,r,n){for(var o,i,a=[],s=3;s<arguments.length;s++)a[s-3]=arguments[s];this.valueIdentifier=e,this.name=n,this.values="number"==typeof r?Int32Array.from([r]):r,this.otherEncodingNames=a,t.VALUE_IDENTIFIER_TO_ECI.set(e,this),t.NAME_TO_ECI.set(n,this);for(var u=this.values,l=0,c=u.length;l!==c;l++){var h=u[l];t.VALUES_TO_ECI.set(h,this)}try{for(var f=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(a),d=f.next();!d.done;d=f.next()){var p=d.value;t.NAME_TO_ECI.set(p,this)}}catch(g){o={error:g}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}}return t.prototype.getValueIdentifier=function(){return this.valueIdentifier},t.prototype.getName=function(){return this.name},t.prototype.getValue=function(){return this.values[0]},t.getCharacterSetECIByValue=function(e){if(e<0||e>=900)throw new Mr("incorect value");var r=t.VALUES_TO_ECI.get(e);if(void 0===r)throw new Mr("incorect value");return r},t.getCharacterSetECIByName=function(e){var r=t.NAME_TO_ECI.get(e);if(void 0===r)throw new Mr("incorect value");return r},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var r=e;return this.getName()===r.getName()},t.VALUE_IDENTIFIER_TO_ECI=new Map,t.VALUES_TO_ECI=new Map,t.NAME_TO_ECI=new Map,t.Cp437=new t(Rr.Cp437,Int32Array.from([0,2]),"Cp437"),t.ISO8859_1=new t(Rr.ISO8859_1,Int32Array.from([1,3]),"ISO-8859-1","ISO88591","ISO8859_1"),t.ISO8859_2=new t(Rr.ISO8859_2,4,"ISO-8859-2","ISO88592","ISO8859_2"),t.ISO8859_3=new t(Rr.ISO8859_3,5,"ISO-8859-3","ISO88593","ISO8859_3"),t.ISO8859_4=new t(Rr.ISO8859_4,6,"ISO-8859-4","ISO88594","ISO8859_4"),t.ISO8859_5=new t(Rr.ISO8859_5,7,"ISO-8859-5","ISO88595","ISO8859_5"),t.ISO8859_6=new t(Rr.ISO8859_6,8,"ISO-8859-6","ISO88596","ISO8859_6"),t.ISO8859_7=new t(Rr.ISO8859_7,9,"ISO-8859-7","ISO88597","ISO8859_7"),t.ISO8859_8=new t(Rr.ISO8859_8,10,"ISO-8859-8","ISO88598","ISO8859_8"),t.ISO8859_9=new t(Rr.ISO8859_9,11,"ISO-8859-9","ISO88599","ISO8859_9"),t.ISO8859_10=new t(Rr.ISO8859_10,12,"ISO-8859-10","ISO885910","ISO8859_10"),t.ISO8859_11=new t(Rr.ISO8859_11,13,"ISO-8859-11","ISO885911","ISO8859_11"),t.ISO8859_13=new t(Rr.ISO8859_13,15,"ISO-8859-13","ISO885913","ISO8859_13"),t.ISO8859_14=new t(Rr.ISO8859_14,16,"ISO-8859-14","ISO885914","ISO8859_14"),t.ISO8859_15=new t(Rr.ISO8859_15,17,"ISO-8859-15","ISO885915","ISO8859_15"),t.ISO8859_16=new t(Rr.ISO8859_16,18,"ISO-8859-16","ISO885916","ISO8859_16"),t.SJIS=new t(Rr.SJIS,20,"SJIS","Shift_JIS"),t.Cp1250=new t(Rr.Cp1250,21,"Cp1250","windows-1250"),t.Cp1251=new t(Rr.Cp1251,22,"Cp1251","windows-1251"),t.Cp1252=new t(Rr.Cp1252,23,"Cp1252","windows-1252"),t.Cp1256=new t(Rr.Cp1256,24,"Cp1256","windows-1256"),t.UnicodeBigUnmarked=new t(Rr.UnicodeBigUnmarked,25,"UnicodeBigUnmarked","UTF-16BE","UnicodeBig"),t.UTF8=new t(Rr.UTF8,26,"UTF8","UTF-8"),t.ASCII=new t(Rr.ASCII,Int32Array.from([27,170]),"ASCII","US-ASCII"),t.Big5=new t(Rr.Big5,28,"Big5"),t.GB18030=new t(Rr.GB18030,29,"GB18030","GB2312","EUC_CN","GBK"),t.EUC_KR=new t(Rr.EUC_KR,30,"EUC_KR","EUC-KR"),t}(),Fr=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),jr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Fr(e,t),e.kind="UnsupportedOperationException",e}(gr),Vr=function(){function t(){}return t.decode=function(t,e){var r=this.encodingName(e);return this.customDecoder?this.customDecoder(t,r):"undefined"==typeof TextDecoder||this.shouldDecodeOnFallback(r)?this.decodeFallback(t,r):new TextDecoder(r).decode(t)},t.shouldDecodeOnFallback=function(e){return!t.isBrowser()&&"ISO-8859-1"===e},t.encode=function(t,e){var r=this.encodingName(e);return this.customEncoder?this.customEncoder(t,r):"undefined"==typeof TextEncoder?this.encodeFallback(t):(new TextEncoder).encode(t)},t.isBrowser=function(){return"undefined"!=typeof window&&"[object Window]"==={}.toString.call(window)},t.encodingName=function(t){return"string"==typeof t?t:t.getName()},t.encodingCharacterSet=function(t){return t instanceof Lr?t:Lr.getCharacterSetECIByName(t)},t.decodeFallback=function(e,r){var n=this.encodingCharacterSet(r);if(t.isDecodeFallbackSupported(n)){for(var o="",i=0,a=e.length;i<a;i++){var s=e[i].toString(16);s.length<2&&(s="0"+s),o+="%"+s}return decodeURIComponent(o)}if(n.equals(Lr.UnicodeBigUnmarked))return String.fromCharCode.apply(null,new Uint16Array(e.buffer));throw new jr("Encoding "+this.encodingName(r)+" not supported by fallback.")},t.isDecodeFallbackSupported=function(t){return t.equals(Lr.UTF8)||t.equals(Lr.ISO8859_1)||t.equals(Lr.ASCII)},t.encodeFallback=function(t){for(var e=btoa(unescape(encodeURIComponent(t))).split(""),r=[],n=0;n<e.length;n++)r.push(e[n].charCodeAt(0));return new Uint8Array(r)},t}(),Ur=function(){function t(){}return t.castAsNonUtf8Char=function(t,e){void 0===e&&(e=null);var r=e?e.getName():this.ISO88591;return Vr.decode(new Uint8Array([t]),r)},t.guessEncoding=function(e,r){if(null!=r&&void 0!==r.get(Dr.CHARACTER_SET))return r.get(Dr.CHARACTER_SET).toString();for(var n=e.length,o=!0,i=!0,a=!0,s=0,u=0,l=0,c=0,h=0,f=0,d=0,p=0,g=0,m=0,v=0,y=e.length>3&&239===e[0]&&187===e[1]&&191===e[2],_=0;_<n&&(o||i||a);_++){var w=255&e[_];a&&(s>0?128&w?s--:a=!1:!!(128&w)&&(64&w?(s++,32&w?(s++,16&w?(s++,8&w?a=!1:c++):l++):u++):a=!1)),o&&(w>127&&w<160?o=!1:w>159&&(w<192||215===w||247===w)&&v++),i&&(h>0?w<64||127===w||w>252?i=!1:h--:128===w||160===w||w>239?i=!1:w>160&&w<224?(f++,p=0,++d>g&&(g=d)):w>127?(h++,d=0,++p>m&&(m=p)):(d=0,p=0))}return a&&s>0&&(a=!1),i&&h>0&&(i=!1),a&&(y||u+l+c>0)?t.UTF8:i&&(t.ASSUME_SHIFT_JIS||g>=3||m>=3)?t.SHIFT_JIS:o&&i?2===g&&2===f||10*v>=n?t.SHIFT_JIS:t.ISO88591:o?t.ISO88591:i?t.SHIFT_JIS:a?t.UTF8:t.PLATFORM_DEFAULT_ENCODING},t.format=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var n=-1;return t.replace(/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g,function(t,r,o,i,a,s){if("%%"===t)return"%";if(void 0!==e[++n]){t=i?parseInt(i.substr(1)):void 0;var u,l=a?parseInt(a.substr(1)):void 0;switch(s){case"s":u=e[n];break;case"c":u=e[n][0];break;case"f":u=parseFloat(e[n]).toFixed(t);break;case"p":u=parseFloat(e[n]).toPrecision(t);break;case"e":u=parseFloat(e[n]).toExponential(t);break;case"x":u=parseInt(e[n]).toString(l||16);break;case"d":u=parseFloat(parseInt(e[n],l||10).toPrecision(t)).toFixed(0)}u="object"==typeof u?JSON.stringify(u):(+u).toString(l);for(var c=parseInt(o),h=o&&o[0]+""=="0"?"0":" ";u.length<c;)u=void 0!==r?u+h:h+u;return u}})},t.getBytes=function(t,e){return Vr.encode(t,e)},t.getCharCode=function(t,e){return void 0===e&&(e=0),t.charCodeAt(e)},t.getCharAt=function(t){return String.fromCharCode(t)},t.SHIFT_JIS=Lr.SJIS.getName(),t.GB2312="GB2312",t.ISO88591=Lr.ISO8859_1.getName(),t.EUC_JP="EUC_JP",t.UTF8=Lr.UTF8.getName(),t.PLATFORM_DEFAULT_ENCODING=t.UTF8,t.ASSUME_SHIFT_JIS=!1,t}(),Hr=function(){function t(t){void 0===t&&(t=""),this.value=t}return t.prototype.enableDecoding=function(t){return this.encoding=t,this},t.prototype.append=function(t){return"string"==typeof t?this.value+=t.toString():this.encoding?this.value+=Ur.castAsNonUtf8Char(t,this.encoding):this.value+=String.fromCharCode(t),this},t.prototype.appendChars=function(t,e,r){for(var n=e;e<e+r;n++)this.append(t[n]);return this},t.prototype.length=function(){return this.value.length},t.prototype.charAt=function(t){return this.value.charAt(t)},t.prototype.deleteCharAt=function(t){this.value=this.value.substr(0,t)+this.value.substring(t+1)},t.prototype.setCharAt=function(t,e){this.value=this.value.substr(0,t)+e+this.value.substr(t+1)},t.prototype.substring=function(t,e){return this.value.substring(t,e)},t.prototype.setLengthToZero=function(){this.value=""},t.prototype.toString=function(){return this.value},t.prototype.insert=function(t,e){this.value=this.value.substr(0,t)+e+this.value.substr(t+e.length)},t}(),zr=function(){function t(t,e,r,n){if(this.width=t,this.height=e,this.rowSize=r,this.bits=n,null==e&&(e=t),this.height=e,t<1||e<1)throw new _r("Both dimensions must be greater than 0");null==r&&(r=Math.floor((t+31)/32)),this.rowSize=r,null==n&&(this.bits=new Int32Array(this.rowSize*this.height))}return t.parseFromBooleanArray=function(e){for(var r=e.length,n=e[0].length,o=new t(n,r),i=0;i<r;i++)for(var a=e[i],s=0;s<n;s++)a[s]&&o.set(s,i);return o},t.parseFromString=function(e,r,n){if(null===e)throw new _r("stringRepresentation cannot be null");for(var o=new Array(e.length),i=0,a=0,s=-1,u=0,l=0;l<e.length;)if("\n"===e.charAt(l)||"\r"===e.charAt(l)){if(i>a){if(-1===s)s=i-a;else if(i-a!==s)throw new _r("row lengths do not match");a=i,u++}l++}else if(e.substring(l,l+r.length)===r)l+=r.length,o[i]=!0,i++;else{if(e.substring(l,l+n.length)!==n)throw new _r("illegal character encountered: "+e.substring(l));l+=n.length,o[i]=!1,i++}if(i>a){if(-1===s)s=i-a;else if(i-a!==s)throw new _r("row lengths do not match");u++}for(var c=new t(s,u),h=0;h<i;h++)o[h]&&c.set(Math.floor(h%s),Math.floor(h/s));return c},t.prototype.get=function(t,e){var r=e*this.rowSize+Math.floor(t/32);return!!(this.bits[r]>>>(31&t)&1)},t.prototype.set=function(t,e){var r=e*this.rowSize+Math.floor(t/32);this.bits[r]|=1<<(31&t)&4294967295},t.prototype.unset=function(t,e){var r=e*this.rowSize+Math.floor(t/32);this.bits[r]&=~(1<<(31&t)&4294967295)},t.prototype.flip=function(t,e){var r=e*this.rowSize+Math.floor(t/32);this.bits[r]^=1<<(31&t)&4294967295},t.prototype.xor=function(t){if(this.width!==t.getWidth()||this.height!==t.getHeight()||this.rowSize!==t.getRowSize())throw new _r("input matrix dimensions do not match");for(var e=new kr(Math.floor(this.width/32)+1),r=this.rowSize,n=this.bits,o=0,i=this.height;o<i;o++)for(var a=o*r,s=t.getRow(o,e).getBitArray(),u=0;u<r;u++)n[a+u]^=s[u]},t.prototype.clear=function(){for(var t=this.bits,e=t.length,r=0;r<e;r++)t[r]=0},t.prototype.setRegion=function(t,e,r,n){if(e<0||t<0)throw new _r("Left and top must be nonnegative");if(n<1||r<1)throw new _r("Height and width must be at least 1");var o=t+r,i=e+n;if(i>this.height||o>this.width)throw new _r("The region must fit inside the matrix");for(var a=this.rowSize,s=this.bits,u=e;u<i;u++)for(var l=u*a,c=t;c<o;c++)s[l+Math.floor(c/32)]|=1<<(31&c)&4294967295},t.prototype.getRow=function(t,e){null==e||e.getSize()<this.width?e=new kr(this.width):e.clear();for(var r=this.rowSize,n=this.bits,o=t*r,i=0;i<r;i++)e.setBulk(32*i,n[o+i]);return e},t.prototype.setRow=function(t,e){Er.arraycopy(e.getBitArray(),0,this.bits,t*this.rowSize,this.rowSize)},t.prototype.rotate180=function(){for(var t=this.getWidth(),e=this.getHeight(),r=new kr(t),n=new kr(t),o=0,i=Math.floor((e+1)/2);o<i;o++)r=this.getRow(o,r),n=this.getRow(e-1-o,n),r.reverse(),n.reverse(),this.setRow(o,n),this.setRow(e-1-o,r)},t.prototype.getEnclosingRectangle=function(){for(var t=this.width,e=this.height,r=this.rowSize,n=this.bits,o=t,i=e,a=-1,s=-1,u=0;u<e;u++)for(var l=0;l<r;l++){var c=n[u*r+l];if(0!==c){if(u<i&&(i=u),u>s&&(s=u),32*l<o){for(var h=0;!(c<<31-h&4294967295);)h++;32*l+h<o&&(o=32*l+h)}if(32*l+31>a){for(h=31;c>>>h==0;)h--;32*l+h>a&&(a=32*l+h)}}}return a<o||s<i?null:Int32Array.from([o,i,a-o+1,s-i+1])},t.prototype.getTopLeftOnBit=function(){for(var t=this.rowSize,e=this.bits,r=0;r<e.length&&0===e[r];)r++;if(r===e.length)return null;for(var n=r/t,o=r%t*32,i=e[r],a=0;!(i<<31-a&4294967295);)a++;return o+=a,Int32Array.from([o,n])},t.prototype.getBottomRightOnBit=function(){for(var t=this.rowSize,e=this.bits,r=e.length-1;r>=0&&0===e[r];)r--;if(r<0)return null;for(var n=Math.floor(r/t),o=32*Math.floor(r%t),i=e[r],a=31;i>>>a==0;)a--;return o+=a,Int32Array.from([o,n])},t.prototype.getWidth=function(){return this.width},t.prototype.getHeight=function(){return this.height},t.prototype.getRowSize=function(){return this.rowSize},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var r=e;return this.width===r.width&&this.height===r.height&&this.rowSize===r.rowSize&&Tr.equals(this.bits,r.bits)},t.prototype.hashCode=function(){var t=this.width;return 31*(t=31*(t=31*(t=31*t+this.width)+this.height)+this.rowSize)+Tr.hashCode(this.bits)},t.prototype.toString=function(t,e,r){return void 0===t&&(t="X "),void 0===e&&(e=" "),void 0===r&&(r="\n"),this.buildToString(t,e,r)},t.prototype.buildToString=function(t,e,r){for(var n=new Hr,o=0,i=this.height;o<i;o++){for(var a=0,s=this.width;a<s;a++)n.append(this.get(a,o)?t:e);n.append(r)}return n.toString()},t.prototype.clone=function(){return new t(this.width,this.height,this.rowSize,this.bits.slice())},t}(),Wr=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Gr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Wr(e,t),e.getNotFoundInstance=function(){return new e},e.kind="NotFoundException",e}(gr),Xr=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),$r=function(t){function e(r){var n=t.call(this,r)||this;return n.luminances=e.EMPTY,n.buckets=new Int32Array(e.LUMINANCE_BUCKETS),n}return Xr(e,t),e.prototype.getBlackRow=function(t,r){var n=this.getLuminanceSource(),o=n.getWidth();null==r||r.getSize()<o?r=new kr(o):r.clear(),this.initArrays(o);for(var i=n.getRow(t,this.luminances),a=this.buckets,s=0;s<o;s++)a[(255&i[s])>>e.LUMINANCE_SHIFT]++;var u=e.estimateBlackPoint(a);if(o<3)for(s=0;s<o;s++)(255&i[s])<u&&r.set(s);else{var l=255&i[0],c=255&i[1];for(s=1;s<o-1;s++){var h=255&i[s+1];(4*c-l-h)/2<u&&r.set(s),l=c,c=h}}return r},e.prototype.getBlackMatrix=function(){var t=this.getLuminanceSource(),r=t.getWidth(),n=t.getHeight(),o=new zr(r,n);this.initArrays(r);for(var i=this.buckets,a=1;a<5;a++)for(var s=Math.floor(n*a/5),u=t.getRow(s,this.luminances),l=Math.floor(4*r/5),c=Math.floor(r/5);c<l;c++)i[(255&u[c])>>e.LUMINANCE_SHIFT]++;var h=e.estimateBlackPoint(i),f=t.getMatrix();for(a=0;a<n;a++){var d=a*r;for(c=0;c<r;c++)(255&f[d+c])<h&&o.set(c,a)}return o},e.prototype.createBinarizer=function(t){return new e(t)},e.prototype.initArrays=function(t){this.luminances.length<t&&(this.luminances=new Uint8ClampedArray(t));for(var r=this.buckets,n=0;n<e.LUMINANCE_BUCKETS;n++)r[n]=0},e.estimateBlackPoint=function(t){for(var r=t.length,n=0,o=0,i=0,a=0;a<r;a++)t[a]>i&&(o=a,i=t[a]),t[a]>n&&(n=t[a]);var s=0,u=0;for(a=0;a<r;a++){var l=a-o;(d=t[a]*l*l)>u&&(s=a,u=d)}if(o>s){var c=o;o=s,s=c}if(s-o<=r/16)throw new Gr;var h=s-1,f=-1;for(a=s-1;a>o;a--){var d,p=a-o;(d=p*p*(s-a)*(n-t[a]))>f&&(h=a,f=d)}return h<<e.LUMINANCE_SHIFT},e.LUMINANCE_BITS=5,e.LUMINANCE_SHIFT=8-e.LUMINANCE_BITS,e.LUMINANCE_BUCKETS=1<<e.LUMINANCE_BITS,e.EMPTY=Uint8ClampedArray.from([0]),e}(Ar),Yr=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),qr=function(t){function e(e){var r=t.call(this,e)||this;return r.matrix=null,r}return Yr(e,t),e.prototype.getBlackMatrix=function(){if(null!==this.matrix)return this.matrix;var r=this.getLuminanceSource(),n=r.getWidth(),o=r.getHeight();if(n>=e.MINIMUM_DIMENSION&&o>=e.MINIMUM_DIMENSION){var i=r.getMatrix(),a=n>>e.BLOCK_SIZE_POWER;0!=(n&e.BLOCK_SIZE_MASK)&&a++;var s=o>>e.BLOCK_SIZE_POWER;0!=(o&e.BLOCK_SIZE_MASK)&&s++;var u=e.calculateBlackPoints(i,a,s,n,o),l=new zr(n,o);e.calculateThresholdForBlock(i,a,s,n,o,u,l),this.matrix=l}else this.matrix=t.prototype.getBlackMatrix.call(this);return this.matrix},e.prototype.createBinarizer=function(t){return new e(t)},e.calculateThresholdForBlock=function(t,r,n,o,i,a,s){for(var u=i-e.BLOCK_SIZE,l=o-e.BLOCK_SIZE,c=0;c<n;c++){var h=c<<e.BLOCK_SIZE_POWER;h>u&&(h=u);for(var f=e.cap(c,2,n-3),d=0;d<r;d++){var p=d<<e.BLOCK_SIZE_POWER;p>l&&(p=l);for(var g=e.cap(d,2,r-3),m=0,v=-2;v<=2;v++){var y=a[f+v];m+=y[g-2]+y[g-1]+y[g]+y[g+1]+y[g+2]}var _=m/25;e.thresholdBlock(t,p,h,_,o,s)}}},e.cap=function(t,e,r){return t<e?e:t>r?r:t},e.thresholdBlock=function(t,r,n,o,i,a){for(var s=0,u=n*i+r;s<e.BLOCK_SIZE;s++,u+=i)for(var l=0;l<e.BLOCK_SIZE;l++)(255&t[u+l])<=o&&a.set(r+l,n+s)},e.calculateBlackPoints=function(t,r,n,o,i){for(var a=i-e.BLOCK_SIZE,s=o-e.BLOCK_SIZE,u=new Array(n),l=0;l<n;l++){u[l]=new Int32Array(r);var c=l<<e.BLOCK_SIZE_POWER;c>a&&(c=a);for(var h=0;h<r;h++){var f=h<<e.BLOCK_SIZE_POWER;f>s&&(f=s);for(var d=0,p=255,g=0,m=0,v=c*o+f;m<e.BLOCK_SIZE;m++,v+=o){for(var y=0;y<e.BLOCK_SIZE;y++){var _=255&t[v+y];d+=_,_<p&&(p=_),_>g&&(g=_)}if(g-p>e.MIN_DYNAMIC_RANGE)for(m++,v+=o;m<e.BLOCK_SIZE;m++,v+=o)for(y=0;y<e.BLOCK_SIZE;y++)d+=255&t[v+y]}var w=d>>2*e.BLOCK_SIZE_POWER;if(g-p<=e.MIN_DYNAMIC_RANGE&&(w=p/2,l>0&&h>0)){var b=(u[l-1][h]+2*u[l][h-1]+u[l-1][h-1])/4;p<b&&(w=b)}u[l][h]=w}}return u},e.BLOCK_SIZE_POWER=3,e.BLOCK_SIZE=1<<e.BLOCK_SIZE_POWER,e.BLOCK_SIZE_MASK=e.BLOCK_SIZE-1,e.MINIMUM_DIMENSION=5*e.BLOCK_SIZE,e.MIN_DYNAMIC_RANGE=24,e}($r),Kr=function(){function t(t,e){this.width=t,this.height=e}return t.prototype.getWidth=function(){return this.width},t.prototype.getHeight=function(){return this.height},t.prototype.isCropSupported=function(){return!1},t.prototype.crop=function(t,e,r,n){throw new jr("This luminance source does not support cropping.")},t.prototype.isRotateSupported=function(){return!1},t.prototype.rotateCounterClockwise=function(){throw new jr("This luminance source does not support rotation by 90 degrees.")},t.prototype.rotateCounterClockwise45=function(){throw new jr("This luminance source does not support rotation by 45 degrees.")},t.prototype.toString=function(){for(var t=new Uint8ClampedArray(this.width),e=new Hr,r=0;r<this.height;r++){for(var n=this.getRow(r,t),o=0;o<this.width;o++){var i,a=255&n[o];i=a<64?"#":a<128?"+":a<192?".":" ",e.append(i)}e.append("\n")}return e.toString()},t}(),Zr=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Qr=function(t){function e(e){var r=t.call(this,e.getWidth(),e.getHeight())||this;return r.delegate=e,r}return Zr(e,t),e.prototype.getRow=function(t,e){for(var r=this.delegate.getRow(t,e),n=this.getWidth(),o=0;o<n;o++)r[o]=255-(255&r[o]);return r},e.prototype.getMatrix=function(){for(var t=this.delegate.getMatrix(),e=this.getWidth()*this.getHeight(),r=new Uint8ClampedArray(e),n=0;n<e;n++)r[n]=255-(255&t[n]);return r},e.prototype.isCropSupported=function(){return this.delegate.isCropSupported()},e.prototype.crop=function(t,r,n,o){return new e(this.delegate.crop(t,r,n,o))},e.prototype.isRotateSupported=function(){return this.delegate.isRotateSupported()},e.prototype.invert=function(){return this.delegate},e.prototype.rotateCounterClockwise=function(){return new e(this.delegate.rotateCounterClockwise())},e.prototype.rotateCounterClockwise45=function(){return new e(this.delegate.rotateCounterClockwise45())},e}(Kr),Jr=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),tn=function(t){function e(r){var n=t.call(this,r.width,r.height)||this;return n.canvas=r,n.tempCanvasElement=null,n.buffer=e.makeBufferFromCanvasImageData(r),n}return Jr(e,t),e.makeBufferFromCanvasImageData=function(t){var r=t.getContext("2d").getImageData(0,0,t.width,t.height);return e.toGrayscaleBuffer(r.data,t.width,t.height)},e.toGrayscaleBuffer=function(t,e,r){for(var n=new Uint8ClampedArray(e*r),o=0,i=0,a=t.length;o<a;o+=4,i++){var s=void 0;s=0===t[o+3]?255:306*t[o]+601*t[o+1]+117*t[o+2]+512>>10,n[i]=s}return n},e.prototype.getRow=function(t,e){if(t<0||t>=this.getHeight())throw new _r("Requested row is outside the image: "+t);var r=this.getWidth(),n=t*r;return null===e?e=this.buffer.slice(n,n+r):(e.length<r&&(e=new Uint8ClampedArray(r)),e.set(this.buffer.slice(n,n+r))),e},e.prototype.getMatrix=function(){return this.buffer},e.prototype.isCropSupported=function(){return!0},e.prototype.crop=function(e,r,n,o){return t.prototype.crop.call(this,e,r,n,o),this},e.prototype.isRotateSupported=function(){return!0},e.prototype.rotateCounterClockwise=function(){return this.rotate(-90),this},e.prototype.rotateCounterClockwise45=function(){return this.rotate(-45),this},e.prototype.getTempCanvasElement=function(){if(null===this.tempCanvasElement){var t=this.canvas.ownerDocument.createElement("canvas");t.width=this.canvas.width,t.height=this.canvas.height,this.tempCanvasElement=t}return this.tempCanvasElement},e.prototype.rotate=function(t){var r=this.getTempCanvasElement(),n=r.getContext("2d"),o=t*e.DEGREE_TO_RADIANS,i=this.canvas.width,a=this.canvas.height,s=Math.ceil(Math.abs(Math.cos(o))*i+Math.abs(Math.sin(o))*a),u=Math.ceil(Math.abs(Math.sin(o))*i+Math.abs(Math.cos(o))*a);return r.width=s,r.height=u,n.translate(s/2,u/2),n.rotate(o),n.drawImage(this.canvas,i/-2,a/-2),this.buffer=e.makeBufferFromCanvasImageData(r),this},e.prototype.invert=function(){return new Qr(this)},e.DEGREE_TO_RADIANS=Math.PI/180,e}(Kr),en=function(){function t(t,e,r){this.deviceId=t,this.label=e,this.kind="videoinput",this.groupId=r||void 0}return t.prototype.toJSON=function(){return{kind:this.kind,groupId:this.groupId,deviceId:this.deviceId,label:this.label}},t}(),rn=function(t,e,r,n){return new(r||(r=Promise))(function(e,o){function i(t){try{s(n.next(t))}catch(e){o(e)}}function a(t){try{s(n.throw(t))}catch(e){o(e)}}function s(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r(function(t){t(n)})).then(i,a)}s((n=n.apply(t,[])).next())})},nn=function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(s){i=[6,s],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},on=function(){function t(t,e,r){void 0===e&&(e=500),this.reader=t,this.timeBetweenScansMillis=e,this._hints=r,this._stopContinuousDecode=!1,this._stopAsyncDecode=!1,this._timeBetweenDecodingAttempts=0}return Object.defineProperty(t.prototype,"hasNavigator",{get:function(){return"undefined"!=typeof navigator},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isMediaDevicesSuported",{get:function(){return this.hasNavigator&&!!navigator.mediaDevices},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canEnumerateDevices",{get:function(){return!(!this.isMediaDevicesSuported||!navigator.mediaDevices.enumerateDevices)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"timeBetweenDecodingAttempts",{get:function(){return this._timeBetweenDecodingAttempts},set:function(t){this._timeBetweenDecodingAttempts=t<0?0:t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hints",{get:function(){return this._hints},set:function(t){this._hints=t||null},enumerable:!1,configurable:!0}),t.prototype.listVideoInputDevices=function(){return rn(this,0,void 0,function(){var t,e,r,n,o,i,a,s,u,l,c,h;return nn(this,function(f){switch(f.label){case 0:if(!this.hasNavigator)throw new Error("Can't enumerate devices, navigator is not present.");if(!this.canEnumerateDevices)throw new Error("Can't enumerate devices, method not supported.");return[4,navigator.mediaDevices.enumerateDevices()];case 1:t=f.sent(),e=[];try{for(r=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(t),n=r.next();!n.done;n=r.next())o=n.value,"videoinput"===(i="video"===o.kind?"videoinput":o.kind)&&(a=o.deviceId||o.id,s=o.label||"Video device "+(e.length+1),u=o.groupId,l={deviceId:a,label:s,kind:i,groupId:u},e.push(l))}catch(d){c={error:d}}finally{try{n&&!n.done&&(h=r.return)&&h.call(r)}finally{if(c)throw c.error}}return[2,e]}})})},t.prototype.getVideoInputDevices=function(){return rn(this,0,void 0,function(){return nn(this,function(t){switch(t.label){case 0:return[4,this.listVideoInputDevices()];case 1:return[2,t.sent().map(function(t){return new en(t.deviceId,t.label)})]}})})},t.prototype.findDeviceById=function(t){return rn(this,0,void 0,function(){var e;return nn(this,function(r){switch(r.label){case 0:return[4,this.listVideoInputDevices()];case 1:return(e=r.sent())?[2,e.find(function(e){return e.deviceId===t})]:[2,null]}})})},t.prototype.decodeFromInputVideoDevice=function(t,e){return rn(this,0,void 0,function(){return nn(this,function(r){switch(r.label){case 0:return[4,this.decodeOnceFromVideoDevice(t,e)];case 1:return[2,r.sent()]}})})},t.prototype.decodeOnceFromVideoDevice=function(t,e){return rn(this,0,void 0,function(){var r;return nn(this,function(n){switch(n.label){case 0:return this.reset(),r={video:t?{deviceId:{exact:t}}:{facingMode:"environment"}},[4,this.decodeOnceFromConstraints(r,e)];case 1:return[2,n.sent()]}})})},t.prototype.decodeOnceFromConstraints=function(t,e){return rn(this,0,void 0,function(){var r;return nn(this,function(n){switch(n.label){case 0:return[4,navigator.mediaDevices.getUserMedia(t)];case 1:return r=n.sent(),[4,this.decodeOnceFromStream(r,e)];case 2:return[2,n.sent()]}})})},t.prototype.decodeOnceFromStream=function(t,e){return rn(this,0,void 0,function(){var r;return nn(this,function(n){switch(n.label){case 0:return this.reset(),[4,this.attachStreamToVideo(t,e)];case 1:return r=n.sent(),[4,this.decodeOnce(r)];case 2:return[2,n.sent()]}})})},t.prototype.decodeFromInputVideoDeviceContinuously=function(t,e,r){return rn(this,0,void 0,function(){return nn(this,function(n){switch(n.label){case 0:return[4,this.decodeFromVideoDevice(t,e,r)];case 1:return[2,n.sent()]}})})},t.prototype.decodeFromVideoDevice=function(t,e,r){return rn(this,0,void 0,function(){var n;return nn(this,function(o){switch(o.label){case 0:return n={video:t?{deviceId:{exact:t}}:{facingMode:"environment"}},[4,this.decodeFromConstraints(n,e,r)];case 1:return[2,o.sent()]}})})},t.prototype.decodeFromConstraints=function(t,e,r){return rn(this,0,void 0,function(){var n;return nn(this,function(o){switch(o.label){case 0:return[4,navigator.mediaDevices.getUserMedia(t)];case 1:return n=o.sent(),[4,this.decodeFromStream(n,e,r)];case 2:return[2,o.sent()]}})})},t.prototype.decodeFromStream=function(t,e,r){return rn(this,0,void 0,function(){var n;return nn(this,function(o){switch(o.label){case 0:return this.reset(),[4,this.attachStreamToVideo(t,e)];case 1:return n=o.sent(),[4,this.decodeContinuously(n,r)];case 2:return[2,o.sent()]}})})},t.prototype.stopAsyncDecode=function(){this._stopAsyncDecode=!0},t.prototype.stopContinuousDecode=function(){this._stopContinuousDecode=!0},t.prototype.attachStreamToVideo=function(t,e){return rn(this,0,void 0,function(){var r;return nn(this,function(n){switch(n.label){case 0:return r=this.prepareVideoElement(e),this.addVideoSource(r,t),this.videoElement=r,this.stream=t,[4,this.playVideoOnLoadAsync(r)];case 1:return n.sent(),[2,r]}})})},t.prototype.playVideoOnLoadAsync=function(t){var e=this;return new Promise(function(r,n){return e.playVideoOnLoad(t,function(){return r()})})},t.prototype.playVideoOnLoad=function(t,e){var r=this;this.videoEndedListener=function(){return r.stopStreams()},this.videoCanPlayListener=function(){return r.tryPlayVideo(t)},t.addEventListener("ended",this.videoEndedListener),t.addEventListener("canplay",this.videoCanPlayListener),t.addEventListener("playing",e),this.tryPlayVideo(t)},t.prototype.isVideoPlaying=function(t){return t.currentTime>0&&!t.paused&&!t.ended&&t.readyState>2},t.prototype.tryPlayVideo=function(t){return rn(this,0,void 0,function(){return nn(this,function(e){switch(e.label){case 0:if(this.isVideoPlaying(t))return console.warn("Trying to play video that is already playing."),[2];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,t.play()];case 2:return e.sent(),[3,4];case 3:return e.sent(),console.warn("It was not possible to play the video."),[3,4];case 4:return[2]}})})},t.prototype.getMediaElement=function(t,e){var r=document.getElementById(t);if(!r)throw new vr("element with id '"+t+"' not found");if(r.nodeName.toLowerCase()!==e.toLowerCase())throw new vr("element with id '"+t+"' must be an "+e+" element");return r},t.prototype.decodeFromImage=function(t,e){if(!t&&!e)throw new vr("either imageElement with a src set or an url must be provided");return e&&!t?this.decodeFromImageUrl(e):this.decodeFromImageElement(t)},t.prototype.decodeFromVideo=function(t,e){if(!t&&!e)throw new vr("Either an element with a src set or an URL must be provided");return e&&!t?this.decodeFromVideoUrl(e):this.decodeFromVideoElement(t)},t.prototype.decodeFromVideoContinuously=function(t,e,r){if(void 0===t&&void 0===e)throw new vr("Either an element with a src set or an URL must be provided");return e&&!t?this.decodeFromVideoUrlContinuously(e,r):this.decodeFromVideoElementContinuously(t,r)},t.prototype.decodeFromImageElement=function(t){if(!t)throw new vr("An image element must be provided.");this.reset();var e=this.prepareImageElement(t);return this.imageElement=e,this.isImageLoaded(e)?this.decodeOnce(e,!1,!0):this._decodeOnLoadImage(e)},t.prototype.decodeFromVideoElement=function(t){var e=this._decodeFromVideoElementSetup(t);return this._decodeOnLoadVideo(e)},t.prototype.decodeFromVideoElementContinuously=function(t,e){var r=this._decodeFromVideoElementSetup(t);return this._decodeOnLoadVideoContinuously(r,e)},t.prototype._decodeFromVideoElementSetup=function(t){if(!t)throw new vr("A video element must be provided.");this.reset();var e=this.prepareVideoElement(t);return this.videoElement=e,e},t.prototype.decodeFromImageUrl=function(t){if(!t)throw new vr("An URL must be provided.");this.reset();var e=this.prepareImageElement();this.imageElement=e;var r=this._decodeOnLoadImage(e);return e.src=t,r},t.prototype.decodeFromVideoUrl=function(t){if(!t)throw new vr("An URL must be provided.");this.reset();var e=this.prepareVideoElement(),r=this.decodeFromVideoElement(e);return e.src=t,r},t.prototype.decodeFromVideoUrlContinuously=function(t,e){if(!t)throw new vr("An URL must be provided.");this.reset();var r=this.prepareVideoElement(),n=this.decodeFromVideoElementContinuously(r,e);return r.src=t,n},t.prototype._decodeOnLoadImage=function(t){var e=this;return new Promise(function(r,n){e.imageLoadedListener=function(){return e.decodeOnce(t,!1,!0).then(r,n)},t.addEventListener("load",e.imageLoadedListener)})},t.prototype._decodeOnLoadVideo=function(t){return rn(this,0,void 0,function(){return nn(this,function(e){switch(e.label){case 0:return[4,this.playVideoOnLoadAsync(t)];case 1:return e.sent(),[4,this.decodeOnce(t)];case 2:return[2,e.sent()]}})})},t.prototype._decodeOnLoadVideoContinuously=function(t,e){return rn(this,0,void 0,function(){return nn(this,function(r){switch(r.label){case 0:return[4,this.playVideoOnLoadAsync(t)];case 1:return r.sent(),this.decodeContinuously(t,e),[2]}})})},t.prototype.isImageLoaded=function(t){return!!t.complete&&0!==t.naturalWidth},t.prototype.prepareImageElement=function(t){var e;return void 0===t&&((e=document.createElement("img")).width=200,e.height=200),"string"==typeof t&&(e=this.getMediaElement(t,"img")),t instanceof HTMLImageElement&&(e=t),e},t.prototype.prepareVideoElement=function(t){var e;return t||"undefined"==typeof document||((e=document.createElement("video")).width=200,e.height=200),"string"==typeof t&&(e=this.getMediaElement(t,"video")),t instanceof HTMLVideoElement&&(e=t),e.setAttribute("autoplay","true"),e.setAttribute("muted","true"),e.setAttribute("playsinline","true"),e},t.prototype.decodeOnce=function(t,e,r){var n=this;void 0===e&&(e=!0),void 0===r&&(r=!0),this._stopAsyncDecode=!1;var o=function(i,a){if(n._stopAsyncDecode)return a(new Gr("Video stream has ended before any code could be detected.")),void(n._stopAsyncDecode=void 0);try{i(n.decode(t))}catch(s){if(e&&s instanceof Gr||(s instanceof Cr||s instanceof Mr)&&r)return setTimeout(o,n._timeBetweenDecodingAttempts,i,a);a(s)}};return new Promise(function(t,e){return o(t,e)})},t.prototype.decodeContinuously=function(t,e){var r=this;this._stopContinuousDecode=!1;var n=function(){if(r._stopContinuousDecode)r._stopContinuousDecode=void 0;else try{var o=r.decode(t);e(o,null),setTimeout(n,r.timeBetweenScansMillis)}catch(i){e(null,i),(i instanceof Cr||i instanceof Mr||i instanceof Gr)&&setTimeout(n,r._timeBetweenDecodingAttempts)}};n()},t.prototype.decode=function(t){var e=this.createBinaryBitmap(t);return this.decodeBitmap(e)},t.prototype.createBinaryBitmap=function(t){var e=this.getCaptureCanvasContext(t);this.drawImageOnCanvas(e,t);var r=this.getCaptureCanvas(t),n=new tn(r),o=new qr(n);return new wr(o)},t.prototype.getCaptureCanvasContext=function(t){if(!this.captureCanvasContext){var e=this.getCaptureCanvas(t).getContext("2d");this.captureCanvasContext=e}return this.captureCanvasContext},t.prototype.getCaptureCanvas=function(t){if(!this.captureCanvas){var e=this.createCaptureCanvas(t);this.captureCanvas=e}return this.captureCanvas},t.prototype.drawImageOnCanvas=function(t,e){t.drawImage(e,0,0)},t.prototype.decodeBitmap=function(t){return this.reader.decode(t,this._hints)},t.prototype.createCaptureCanvas=function(t){if("undefined"==typeof document)return this._destroyCaptureCanvas(),null;var e,r,n=document.createElement("canvas");return void 0!==t&&(t instanceof HTMLVideoElement?(e=t.videoWidth,r=t.videoHeight):t instanceof HTMLImageElement&&(e=t.naturalWidth||t.width,r=t.naturalHeight||t.height)),n.style.width=e+"px",n.style.height=r+"px",n.width=e,n.height=r,n},t.prototype.stopStreams=function(){this.stream&&(this.stream.getVideoTracks().forEach(function(t){return t.stop()}),this.stream=void 0),!1===this._stopAsyncDecode&&this.stopAsyncDecode(),!1===this._stopContinuousDecode&&this.stopContinuousDecode()},t.prototype.reset=function(){this.stopStreams(),this._destroyVideoElement(),this._destroyImageElement(),this._destroyCaptureCanvas()},t.prototype._destroyVideoElement=function(){this.videoElement&&(void 0!==this.videoEndedListener&&this.videoElement.removeEventListener("ended",this.videoEndedListener),void 0!==this.videoPlayingEventListener&&this.videoElement.removeEventListener("playing",this.videoPlayingEventListener),void 0!==this.videoCanPlayListener&&this.videoElement.removeEventListener("loadedmetadata",this.videoCanPlayListener),this.cleanVideoSource(this.videoElement),this.videoElement=void 0)},t.prototype._destroyImageElement=function(){this.imageElement&&(void 0!==this.imageLoadedListener&&this.imageElement.removeEventListener("load",this.imageLoadedListener),this.imageElement.src=void 0,this.imageElement.removeAttribute("src"),this.imageElement=void 0)},t.prototype._destroyCaptureCanvas=function(){this.captureCanvasContext=void 0,this.captureCanvas=void 0},t.prototype.addVideoSource=function(t,e){try{t.srcObject=e}catch(r){t.src=URL.createObjectURL(e)}},t.prototype.cleanVideoSource=function(t){try{t.srcObject=null}catch(e){t.src=""}this.videoElement.removeAttribute("src")},t}(),an=function(){function t(t,e,r,n,o,i){void 0===r&&(r=null==e?0:8*e.length),void 0===i&&(i=Er.currentTimeMillis()),this.text=t,this.rawBytes=e,this.numBits=r,this.resultPoints=n,this.format=o,this.timestamp=i,this.text=t,this.rawBytes=e,this.numBits=null==r?null==e?0:8*e.length:r,this.resultPoints=n,this.format=o,this.resultMetadata=null,this.timestamp=null==i?Er.currentTimeMillis():i}return t.prototype.getText=function(){return this.text},t.prototype.getRawBytes=function(){return this.rawBytes},t.prototype.getNumBits=function(){return this.numBits},t.prototype.getResultPoints=function(){return this.resultPoints},t.prototype.getBarcodeFormat=function(){return this.format},t.prototype.getResultMetadata=function(){return this.resultMetadata},t.prototype.putMetadata=function(t,e){null===this.resultMetadata&&(this.resultMetadata=new Map),this.resultMetadata.set(t,e)},t.prototype.putAllMetadata=function(t){null!==t&&(null===this.resultMetadata?this.resultMetadata=t:this.resultMetadata=new Map(t))},t.prototype.addResultPoints=function(t){var e=this.resultPoints;if(null===e)this.resultPoints=t;else if(null!==t&&t.length>0){var r=new Array(e.length+t.length);Er.arraycopy(e,0,r,0,e.length),Er.arraycopy(t,0,r,e.length,t.length),this.resultPoints=r}},t.prototype.getTimestamp=function(){return this.timestamp},t.prototype.toString=function(){return this.text},t}();!function(t){t[t.AZTEC=0]="AZTEC",t[t.CODABAR=1]="CODABAR",t[t.CODE_39=2]="CODE_39",t[t.CODE_93=3]="CODE_93",t[t.CODE_128=4]="CODE_128",t[t.DATA_MATRIX=5]="DATA_MATRIX",t[t.EAN_8=6]="EAN_8",t[t.EAN_13=7]="EAN_13",t[t.ITF=8]="ITF",t[t.MAXICODE=9]="MAXICODE",t[t.PDF_417=10]="PDF_417",t[t.QR_CODE=11]="QR_CODE",t[t.RSS_14=12]="RSS_14",t[t.RSS_EXPANDED=13]="RSS_EXPANDED",t[t.UPC_A=14]="UPC_A",t[t.UPC_E=15]="UPC_E",t[t.UPC_EAN_EXTENSION=16]="UPC_EAN_EXTENSION"}(Br||(Br={}));var sn,un=Br;!function(t){t[t.OTHER=0]="OTHER",t[t.ORIENTATION=1]="ORIENTATION",t[t.BYTE_SEGMENTS=2]="BYTE_SEGMENTS",t[t.ERROR_CORRECTION_LEVEL=3]="ERROR_CORRECTION_LEVEL",t[t.ISSUE_NUMBER=4]="ISSUE_NUMBER",t[t.SUGGESTED_PRICE=5]="SUGGESTED_PRICE",t[t.POSSIBLE_COUNTRY=6]="POSSIBLE_COUNTRY",t[t.UPC_EAN_EXTENSION=7]="UPC_EAN_EXTENSION",t[t.PDF417_EXTRA_METADATA=8]="PDF417_EXTRA_METADATA",t[t.STRUCTURED_APPEND_SEQUENCE=9]="STRUCTURED_APPEND_SEQUENCE",t[t.STRUCTURED_APPEND_PARITY=10]="STRUCTURED_APPEND_PARITY"}(sn||(sn={}));var ln,cn=sn,hn=function(){function t(t,e,r,n,o,i){void 0===o&&(o=-1),void 0===i&&(i=-1),this.rawBytes=t,this.text=e,this.byteSegments=r,this.ecLevel=n,this.structuredAppendSequenceNumber=o,this.structuredAppendParity=i,this.numBits=null==t?0:8*t.length}return t.prototype.getRawBytes=function(){return this.rawBytes},t.prototype.getNumBits=function(){return this.numBits},t.prototype.setNumBits=function(t){this.numBits=t},t.prototype.getText=function(){return this.text},t.prototype.getByteSegments=function(){return this.byteSegments},t.prototype.getECLevel=function(){return this.ecLevel},t.prototype.getErrorsCorrected=function(){return this.errorsCorrected},t.prototype.setErrorsCorrected=function(t){this.errorsCorrected=t},t.prototype.getErasures=function(){return this.erasures},t.prototype.setErasures=function(t){this.erasures=t},t.prototype.getOther=function(){return this.other},t.prototype.setOther=function(t){this.other=t},t.prototype.hasStructuredAppend=function(){return this.structuredAppendParity>=0&&this.structuredAppendSequenceNumber>=0},t.prototype.getStructuredAppendParity=function(){return this.structuredAppendParity},t.prototype.getStructuredAppendSequenceNumber=function(){return this.structuredAppendSequenceNumber},t}(),fn=function(){function t(){}return t.prototype.exp=function(t){return this.expTable[t]},t.prototype.log=function(t){if(0===t)throw new _r;return this.logTable[t]},t.addOrSubtract=function(t,e){return t^e},t}(),dn=function(){function t(t,e){if(0===e.length)throw new _r;this.field=t;var r=e.length;if(r>1&&0===e[0]){for(var n=1;n<r&&0===e[n];)n++;n===r?this.coefficients=Int32Array.from([0]):(this.coefficients=new Int32Array(r-n),Er.arraycopy(e,n,this.coefficients,0,this.coefficients.length))}else this.coefficients=e}return t.prototype.getCoefficients=function(){return this.coefficients},t.prototype.getDegree=function(){return this.coefficients.length-1},t.prototype.isZero=function(){return 0===this.coefficients[0]},t.prototype.getCoefficient=function(t){return this.coefficients[this.coefficients.length-1-t]},t.prototype.evaluateAt=function(t){if(0===t)return this.getCoefficient(0);var e,r=this.coefficients;if(1===t){e=0;for(var n=0,o=r.length;n!==o;n++){var i=r[n];e=fn.addOrSubtract(e,i)}return e}e=r[0];var a=r.length,s=this.field;for(n=1;n<a;n++)e=fn.addOrSubtract(s.multiply(t,e),r[n]);return e},t.prototype.addOrSubtract=function(e){if(!this.field.equals(e.field))throw new _r("GenericGFPolys do not have same GenericGF field");if(this.isZero())return e;if(e.isZero())return this;var r=this.coefficients,n=e.coefficients;if(r.length>n.length){var o=r;r=n,n=o}var i=new Int32Array(n.length),a=n.length-r.length;Er.arraycopy(n,0,i,0,a);for(var s=a;s<n.length;s++)i[s]=fn.addOrSubtract(r[s-a],n[s]);return new t(this.field,i)},t.prototype.multiply=function(e){if(!this.field.equals(e.field))throw new _r("GenericGFPolys do not have same GenericGF field");if(this.isZero()||e.isZero())return this.field.getZero();for(var r=this.coefficients,n=r.length,o=e.coefficients,i=o.length,a=new Int32Array(n+i-1),s=this.field,u=0;u<n;u++)for(var l=r[u],c=0;c<i;c++)a[u+c]=fn.addOrSubtract(a[u+c],s.multiply(l,o[c]));return new t(s,a)},t.prototype.multiplyScalar=function(e){if(0===e)return this.field.getZero();if(1===e)return this;for(var r=this.coefficients.length,n=this.field,o=new Int32Array(r),i=this.coefficients,a=0;a<r;a++)o[a]=n.multiply(i[a],e);return new t(n,o)},t.prototype.multiplyByMonomial=function(e,r){if(e<0)throw new _r;if(0===r)return this.field.getZero();for(var n=this.coefficients,o=n.length,i=new Int32Array(o+e),a=this.field,s=0;s<o;s++)i[s]=a.multiply(n[s],r);return new t(a,i)},t.prototype.divide=function(t){if(!this.field.equals(t.field))throw new _r("GenericGFPolys do not have same GenericGF field");if(t.isZero())throw new _r("Divide by 0");for(var e=this.field,r=e.getZero(),n=this,o=t.getCoefficient(t.getDegree()),i=e.inverse(o);n.getDegree()>=t.getDegree()&&!n.isZero();){var a=n.getDegree()-t.getDegree(),s=e.multiply(n.getCoefficient(n.getDegree()),i),u=t.multiplyByMonomial(a,s),l=e.buildMonomial(a,s);r=r.addOrSubtract(l),n=n.addOrSubtract(u)}return[r,n]},t.prototype.toString=function(){for(var t="",e=this.getDegree();e>=0;e--){var r=this.getCoefficient(e);if(0!==r){if(r<0?(t+=" - ",r=-r):t.length>0&&(t+=" + "),0===e||1!==r){var n=this.field.log(r);0===n?t+="1":1===n?t+="a":(t+="a^",t+=n)}0!==e&&(1===e?t+="x":(t+="x^",t+=e))}}return t},t}(),pn=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),gn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return pn(e,t),e.kind="ArithmeticException",e}(gr),mn=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),vn=function(t){function e(e,r,n){var o=t.call(this)||this;o.primitive=e,o.size=r,o.generatorBase=n;for(var i=new Int32Array(r),a=1,s=0;s<r;s++)i[s]=a,(a*=2)>=r&&(a^=e,a&=r-1);o.expTable=i;var u=new Int32Array(r);for(s=0;s<r-1;s++)u[i[s]]=s;return o.logTable=u,o.zero=new dn(o,Int32Array.from([0])),o.one=new dn(o,Int32Array.from([1])),o}return mn(e,t),e.prototype.getZero=function(){return this.zero},e.prototype.getOne=function(){return this.one},e.prototype.buildMonomial=function(t,e){if(t<0)throw new _r;if(0===e)return this.zero;var r=new Int32Array(t+1);return r[0]=e,new dn(this,r)},e.prototype.inverse=function(t){if(0===t)throw new gn;return this.expTable[this.size-this.logTable[t]-1]},e.prototype.multiply=function(t,e){return 0===t||0===e?0:this.expTable[(this.logTable[t]+this.logTable[e])%(this.size-1)]},e.prototype.getSize=function(){return this.size},e.prototype.getGeneratorBase=function(){return this.generatorBase},e.prototype.toString=function(){return"GF(0x"+Nr.toHexString(this.primitive)+","+this.size+")"},e.prototype.equals=function(t){return t===this},e.AZTEC_DATA_12=new e(4201,4096,1),e.AZTEC_DATA_10=new e(1033,1024,1),e.AZTEC_DATA_6=new e(67,64,1),e.AZTEC_PARAM=new e(19,16,1),e.QR_CODE_FIELD_256=new e(285,256,0),e.DATA_MATRIX_FIELD_256=new e(301,256,1),e.AZTEC_DATA_8=e.DATA_MATRIX_FIELD_256,e.MAXICODE_FIELD_64=e.AZTEC_DATA_6,e}(fn),yn=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),_n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return yn(e,t),e.kind="ReedSolomonException",e}(gr),wn=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),bn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return wn(e,t),e.kind="IllegalStateException",e}(gr),Cn=function(){function t(t){this.field=t}return t.prototype.decode=function(t,e){for(var r=this.field,n=new dn(r,t),o=new Int32Array(e),i=!0,a=0;a<e;a++){var s=n.evaluateAt(r.exp(a+r.getGeneratorBase()));o[o.length-1-a]=s,0!==s&&(i=!1)}if(!i){var u=new dn(r,o),l=this.runEuclideanAlgorithm(r.buildMonomial(e,1),u,e),c=l[0],h=l[1],f=this.findErrorLocations(c),d=this.findErrorMagnitudes(h,f);for(a=0;a<f.length;a++){var p=t.length-1-r.log(f[a]);if(p<0)throw new _n("Bad error location");t[p]=vn.addOrSubtract(t[p],d[a])}}},t.prototype.runEuclideanAlgorithm=function(t,e,r){if(t.getDegree()<e.getDegree()){var n=t;t=e,e=n}for(var o=this.field,i=t,a=e,s=o.getZero(),u=o.getOne();a.getDegree()>=(r/2|0);){var l=i,c=s;if(s=u,(i=a).isZero())throw new _n("r_{i-1} was zero");a=l;for(var h=o.getZero(),f=i.getCoefficient(i.getDegree()),d=o.inverse(f);a.getDegree()>=i.getDegree()&&!a.isZero();){var p=a.getDegree()-i.getDegree(),g=o.multiply(a.getCoefficient(a.getDegree()),d);h=h.addOrSubtract(o.buildMonomial(p,g)),a=a.addOrSubtract(i.multiplyByMonomial(p,g))}if(u=h.multiply(s).addOrSubtract(c),a.getDegree()>=i.getDegree())throw new bn("Division algorithm failed to reduce polynomial?")}var m=u.getCoefficient(0);if(0===m)throw new _n("sigmaTilde(0) was zero");var v=o.inverse(m);return[u.multiplyScalar(v),a.multiplyScalar(v)]},t.prototype.findErrorLocations=function(t){var e=t.getDegree();if(1===e)return Int32Array.from([t.getCoefficient(1)]);for(var r=new Int32Array(e),n=0,o=this.field,i=1;i<o.getSize()&&n<e;i++)0===t.evaluateAt(i)&&(r[n]=o.inverse(i),n++);if(n!==e)throw new _n("Error locator degree does not match number of roots");return r},t.prototype.findErrorMagnitudes=function(t,e){for(var r=e.length,n=new Int32Array(r),o=this.field,i=0;i<r;i++){for(var a=o.inverse(e[i]),s=1,u=0;u<r;u++)if(i!==u){var l=o.multiply(e[u],a),c=1&l?-2&l:1|l;s=o.multiply(s,c)}n[i]=o.multiply(t.evaluateAt(a),o.inverse(s)),0!==o.getGeneratorBase()&&(n[i]=o.multiply(n[i],a))}return n},t}();!function(t){t[t.UPPER=0]="UPPER",t[t.LOWER=1]="LOWER",t[t.MIXED=2]="MIXED",t[t.DIGIT=3]="DIGIT",t[t.PUNCT=4]="PUNCT",t[t.BINARY=5]="BINARY"}(ln||(ln={}));var An=function(){function t(){}return t.prototype.decode=function(e){this.ddata=e;var r=e.getBits(),n=this.extractBits(r),o=this.correctBits(n),i=t.convertBoolArrayToByteArray(o),a=t.getEncodedData(o),s=new hn(i,a,null,null);return s.setNumBits(o.length),s},t.highLevelDecode=function(t){return this.getEncodedData(t)},t.getEncodedData=function(e){for(var r=e.length,n=ln.UPPER,o=ln.UPPER,i="",a=0;a<r;)if(o===ln.BINARY){if(r-a<5)break;var s=t.readCode(e,a,5);if(a+=5,0===s){if(r-a<11)break;s=t.readCode(e,a,11)+31,a+=11}for(var u=0;u<s;u++){if(r-a<8){a=r;break}var l=t.readCode(e,a,8);i+=Ur.castAsNonUtf8Char(l),a+=8}o=n}else{var c=o===ln.DIGIT?4:5;if(r-a<c)break;l=t.readCode(e,a,c),a+=c;var h=t.getCharacter(o,l);h.startsWith("CTRL_")?(n=o,o=t.getTable(h.charAt(5)),"L"===h.charAt(6)&&(n=o)):(i+=h,o=n)}return i},t.getTable=function(t){switch(t){case"L":return ln.LOWER;case"P":return ln.PUNCT;case"M":return ln.MIXED;case"D":return ln.DIGIT;case"B":return ln.BINARY;default:return ln.UPPER}},t.getCharacter=function(e,r){switch(e){case ln.UPPER:return t.UPPER_TABLE[r];case ln.LOWER:return t.LOWER_TABLE[r];case ln.MIXED:return t.MIXED_TABLE[r];case ln.PUNCT:return t.PUNCT_TABLE[r];case ln.DIGIT:return t.DIGIT_TABLE[r];default:throw new bn("Bad table")}},t.prototype.correctBits=function(e){var r,n;this.ddata.getNbLayers()<=2?(n=6,r=vn.AZTEC_DATA_6):this.ddata.getNbLayers()<=8?(n=8,r=vn.AZTEC_DATA_8):this.ddata.getNbLayers()<=22?(n=10,r=vn.AZTEC_DATA_10):(n=12,r=vn.AZTEC_DATA_12);var o=this.ddata.getNbDatablocks(),i=e.length/n;if(i<o)throw new Mr;for(var a=e.length%n,s=new Int32Array(i),u=0;u<i;u++,a+=n)s[u]=t.readCode(e,a,n);try{new Cn(r).decode(s,i-o)}catch(g){throw new Mr(g)}var l=(1<<n)-1,c=0;for(u=0;u<o;u++){if(0===(d=s[u])||d===l)throw new Mr;1!==d&&d!==l-1||c++}var h=new Array(o*n-c),f=0;for(u=0;u<o;u++){var d;if(1===(d=s[u])||d===l-1)h.fill(d>1,f,f+n-1),f+=n-1;else for(var p=n-1;p>=0;--p)h[f++]=!!(d&1<<p)}return h},t.prototype.extractBits=function(t){var e=this.ddata.isCompact(),r=this.ddata.getNbLayers(),n=(e?11:14)+4*r,o=new Int32Array(n),i=new Array(this.totalBitsInLayer(r,e));if(e)for(var a=0;a<o.length;a++)o[a]=a;else{var s=n+1+2*Nr.truncDivision(Nr.truncDivision(n,2)-1,15),u=n/2,l=Nr.truncDivision(s,2);for(a=0;a<u;a++){var c=a+Nr.truncDivision(a,15);o[u-a-1]=l-c-1,o[u+a]=l+c+1}}a=0;for(var h=0;a<r;a++){for(var f=4*(r-a)+(e?9:12),d=2*a,p=n-1-d,g=0;g<f;g++)for(var m=2*g,v=0;v<2;v++)i[h+m+v]=t.get(o[d+v],o[d+g]),i[h+2*f+m+v]=t.get(o[d+g],o[p-v]),i[h+4*f+m+v]=t.get(o[p-v],o[p-g]),i[h+6*f+m+v]=t.get(o[p-g],o[d+v]);h+=8*f}return i},t.readCode=function(t,e,r){for(var n=0,o=e;o<e+r;o++)n<<=1,t[o]&&(n|=1);return n},t.readByte=function(e,r){var n=e.length-r;return n>=8?t.readCode(e,r,8):t.readCode(e,r,n)<<8-n},t.convertBoolArrayToByteArray=function(e){for(var r=new Uint8Array((e.length+7)/8),n=0;n<r.length;n++)r[n]=t.readByte(e,8*n);return r},t.prototype.totalBitsInLayer=function(t,e){return((e?88:112)+16*t)*t},t.UPPER_TABLE=["CTRL_PS"," ","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","CTRL_LL","CTRL_ML","CTRL_DL","CTRL_BS"],t.LOWER_TABLE=["CTRL_PS"," ","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","CTRL_US","CTRL_ML","CTRL_DL","CTRL_BS"],t.MIXED_TABLE=["CTRL_PS"," ","\\1","\\2","\\3","\\4","\\5","\\6","\\7","\b","\t","\n","\\13","\f","\r","\\33","\\34","\\35","\\36","\\37","@","\\","^","_","`","|","~","\\177","CTRL_LL","CTRL_UL","CTRL_PL","CTRL_BS"],t.PUNCT_TABLE=["","\r","\r\n",". ",", ",": ","!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}","CTRL_UL"],t.DIGIT_TABLE=["CTRL_PS"," ","0","1","2","3","4","5","6","7","8","9",",",".","CTRL_UL","CTRL_US"],t}(),En=function(){function t(){}return t.round=function(t){return NaN===t?0:t<=Number.MIN_SAFE_INTEGER?Number.MIN_SAFE_INTEGER:t>=Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:t+(t<0?-.5:.5)|0},t.distance=function(t,e,r,n){var o=t-r,i=e-n;return Math.sqrt(o*o+i*i)},t.sum=function(t){for(var e=0,r=0,n=t.length;r!==n;r++)e+=t[r];return e},t}(),In=function(){function t(){}return t.floatToIntBits=function(t){return t},t.MAX_VALUE=Number.MAX_SAFE_INTEGER,t}(),Sn=function(){function t(t,e){this.x=t,this.y=e}return t.prototype.getX=function(){return this.x},t.prototype.getY=function(){return this.y},t.prototype.equals=function(e){if(e instanceof t){var r=e;return this.x===r.x&&this.y===r.y}return!1},t.prototype.hashCode=function(){return 31*In.floatToIntBits(this.x)+In.floatToIntBits(this.y)},t.prototype.toString=function(){return"("+this.x+","+this.y+")"},t.orderBestPatterns=function(t){var e,r,n,o=this.distance(t[0],t[1]),i=this.distance(t[1],t[2]),a=this.distance(t[0],t[2]);if(i>=o&&i>=a?(r=t[0],e=t[1],n=t[2]):a>=i&&a>=o?(r=t[1],e=t[0],n=t[2]):(r=t[2],e=t[0],n=t[1]),this.crossProductZ(e,r,n)<0){var s=e;e=n,n=s}t[0]=e,t[1]=r,t[2]=n},t.distance=function(t,e){return En.distance(t.x,t.y,e.x,e.y)},t.crossProductZ=function(t,e,r){var n=e.x,o=e.y;return(r.x-n)*(t.y-o)-(r.y-o)*(t.x-n)},t}(),xn=function(){function t(t,e){this.bits=t,this.points=e}return t.prototype.getBits=function(){return this.bits},t.prototype.getPoints=function(){return this.points},t}(),On=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Tn=function(t){function e(e,r,n,o,i){var a=t.call(this,e,r)||this;return a.compact=n,a.nbDatablocks=o,a.nbLayers=i,a}return On(e,t),e.prototype.getNbLayers=function(){return this.nbLayers},e.prototype.getNbDatablocks=function(){return this.nbDatablocks},e.prototype.isCompact=function(){return this.compact},e}(xn),Nn=function(){function t(e,r,n,o){this.image=e,this.height=e.getHeight(),this.width=e.getWidth(),null==r&&(r=t.INIT_SIZE),null==n&&(n=e.getWidth()/2|0),null==o&&(o=e.getHeight()/2|0);var i=r/2|0;if(this.leftInit=n-i,this.rightInit=n+i,this.upInit=o-i,this.downInit=o+i,this.upInit<0||this.leftInit<0||this.downInit>=this.height||this.rightInit>=this.width)throw new Gr}return t.prototype.detect=function(){for(var t=this.leftInit,e=this.rightInit,r=this.upInit,n=this.downInit,o=!1,i=!0,a=!1,s=!1,u=!1,l=!1,c=!1,h=this.width,f=this.height;i;){i=!1;for(var d=!0;(d||!s)&&e<h;)(d=this.containsBlackPoint(r,n,e,!1))?(e++,i=!0,s=!0):s||e++;if(e>=h){o=!0;break}for(var p=!0;(p||!u)&&n<f;)(p=this.containsBlackPoint(t,e,n,!0))?(n++,i=!0,u=!0):u||n++;if(n>=f){o=!0;break}for(var g=!0;(g||!l)&&t>=0;)(g=this.containsBlackPoint(r,n,t,!1))?(t--,i=!0,l=!0):l||t--;if(t<0){o=!0;break}for(var m=!0;(m||!c)&&r>=0;)(m=this.containsBlackPoint(t,e,r,!0))?(r--,i=!0,c=!0):c||r--;if(r<0){o=!0;break}i&&(a=!0)}if(!o&&a){for(var v=e-t,y=null,_=1;null===y&&_<v;_++)y=this.getBlackPointOnSegment(t,n-_,t+_,n);if(null==y)throw new Gr;var w=null;for(_=1;null===w&&_<v;_++)w=this.getBlackPointOnSegment(t,r+_,t+_,r);if(null==w)throw new Gr;var b=null;for(_=1;null===b&&_<v;_++)b=this.getBlackPointOnSegment(e,r+_,e-_,r);if(null==b)throw new Gr;var C=null;for(_=1;null===C&&_<v;_++)C=this.getBlackPointOnSegment(e,n-_,e-_,n);if(null==C)throw new Gr;return this.centerEdges(C,y,b,w)}throw new Gr},t.prototype.getBlackPointOnSegment=function(t,e,r,n){for(var o=En.round(En.distance(t,e,r,n)),i=(r-t)/o,a=(n-e)/o,s=this.image,u=0;u<o;u++){var l=En.round(t+u*i),c=En.round(e+u*a);if(s.get(l,c))return new Sn(l,c)}return null},t.prototype.centerEdges=function(e,r,n,o){var i=e.getX(),a=e.getY(),s=r.getX(),u=r.getY(),l=n.getX(),c=n.getY(),h=o.getX(),f=o.getY(),d=t.CORR;return i<this.width/2?[new Sn(h-d,f+d),new Sn(s+d,u+d),new Sn(l-d,c-d),new Sn(i+d,a-d)]:[new Sn(h+d,f+d),new Sn(s+d,u-d),new Sn(l-d,c+d),new Sn(i-d,a-d)]},t.prototype.containsBlackPoint=function(t,e,r,n){var o=this.image;if(n){for(var i=t;i<=e;i++)if(o.get(i,r))return!0}else for(var a=t;a<=e;a++)if(o.get(r,a))return!0;return!1},t.INIT_SIZE=10,t.CORR=1,t}(),kn=function(){function t(){}return t.checkAndNudgePoints=function(t,e){for(var r=t.getWidth(),n=t.getHeight(),o=!0,i=0;i<e.length&&o;i+=2){var a=Math.floor(e[i]),s=Math.floor(e[i+1]);if(a<-1||a>r||s<-1||s>n)throw new Gr;o=!1,-1===a?(e[i]=0,o=!0):a===r&&(e[i]=r-1,o=!0),-1===s?(e[i+1]=0,o=!0):s===n&&(e[i+1]=n-1,o=!0)}for(o=!0,i=e.length-2;i>=0&&o;i-=2){if(a=Math.floor(e[i]),s=Math.floor(e[i+1]),a<-1||a>r||s<-1||s>n)throw new Gr;o=!1,-1===a?(e[i]=0,o=!0):a===r&&(e[i]=r-1,o=!0),-1===s?(e[i+1]=0,o=!0):s===n&&(e[i+1]=n-1,o=!0)}},t}(),Rn=function(){function t(t,e,r,n,o,i,a,s,u){this.a11=t,this.a21=e,this.a31=r,this.a12=n,this.a22=o,this.a32=i,this.a13=a,this.a23=s,this.a33=u}return t.quadrilateralToQuadrilateral=function(e,r,n,o,i,a,s,u,l,c,h,f,d,p,g,m){var v=t.quadrilateralToSquare(e,r,n,o,i,a,s,u);return t.squareToQuadrilateral(l,c,h,f,d,p,g,m).times(v)},t.prototype.transformPoints=function(t){for(var e=t.length,r=this.a11,n=this.a12,o=this.a13,i=this.a21,a=this.a22,s=this.a23,u=this.a31,l=this.a32,c=this.a33,h=0;h<e;h+=2){var f=t[h],d=t[h+1],p=o*f+s*d+c;t[h]=(r*f+i*d+u)/p,t[h+1]=(n*f+a*d+l)/p}},t.prototype.transformPointsWithValues=function(t,e){for(var r=this.a11,n=this.a12,o=this.a13,i=this.a21,a=this.a22,s=this.a23,u=this.a31,l=this.a32,c=this.a33,h=t.length,f=0;f<h;f++){var d=t[f],p=e[f],g=o*d+s*p+c;t[f]=(r*d+i*p+u)/g,e[f]=(n*d+a*p+l)/g}},t.squareToQuadrilateral=function(e,r,n,o,i,a,s,u){var l=e-n+i-s,c=r-o+a-u;if(0===l&&0===c)return new t(n-e,i-n,e,o-r,a-o,r,0,0,1);var h=n-i,f=s-i,d=o-a,p=u-a,g=h*p-f*d,m=(l*p-f*c)/g,v=(h*c-l*d)/g;return new t(n-e+m*n,s-e+v*s,e,o-r+m*o,u-r+v*u,r,m,v,1)},t.quadrilateralToSquare=function(e,r,n,o,i,a,s,u){return t.squareToQuadrilateral(e,r,n,o,i,a,s,u).buildAdjoint()},t.prototype.buildAdjoint=function(){return new t(this.a22*this.a33-this.a23*this.a32,this.a23*this.a31-this.a21*this.a33,this.a21*this.a32-this.a22*this.a31,this.a13*this.a32-this.a12*this.a33,this.a11*this.a33-this.a13*this.a31,this.a12*this.a31-this.a11*this.a32,this.a12*this.a23-this.a13*this.a22,this.a13*this.a21-this.a11*this.a23,this.a11*this.a22-this.a12*this.a21)},t.prototype.times=function(e){return new t(this.a11*e.a11+this.a21*e.a12+this.a31*e.a13,this.a11*e.a21+this.a21*e.a22+this.a31*e.a23,this.a11*e.a31+this.a21*e.a32+this.a31*e.a33,this.a12*e.a11+this.a22*e.a12+this.a32*e.a13,this.a12*e.a21+this.a22*e.a22+this.a32*e.a23,this.a12*e.a31+this.a22*e.a32+this.a32*e.a33,this.a13*e.a11+this.a23*e.a12+this.a33*e.a13,this.a13*e.a21+this.a23*e.a22+this.a33*e.a23,this.a13*e.a31+this.a23*e.a32+this.a33*e.a33)},t}(),Dn=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Pn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Dn(e,t),e.prototype.sampleGrid=function(t,e,r,n,o,i,a,s,u,l,c,h,f,d,p,g,m,v,y){var _=Rn.quadrilateralToQuadrilateral(n,o,i,a,s,u,l,c,h,f,d,p,g,m,v,y);return this.sampleGridWithTransform(t,e,r,_)},e.prototype.sampleGridWithTransform=function(t,e,r,n){if(e<=0||r<=0)throw new Gr;for(var o=new zr(e,r),i=new Float32Array(2*e),a=0;a<r;a++){for(var s=i.length,u=a+.5,l=0;l<s;l+=2)i[l]=l/2+.5,i[l+1]=u;n.transformPoints(i),kn.checkAndNudgePoints(t,i);try{for(l=0;l<s;l+=2)t.get(Math.floor(i[l]),Math.floor(i[l+1]))&&o.set(l/2,a)}catch(c){throw new Gr}}return o},e}(kn),Mn=function(){function t(){}return t.setGridSampler=function(e){t.gridSampler=e},t.getInstance=function(){return t.gridSampler},t.gridSampler=new Pn,t}(),Bn=function(){function t(t,e){this.x=t,this.y=e}return t.prototype.toResultPoint=function(){return new Sn(this.getX(),this.getY())},t.prototype.getX=function(){return this.x},t.prototype.getY=function(){return this.y},t}(),Ln=function(){function t(t){this.EXPECTED_CORNER_BITS=new Int32Array([3808,476,2107,1799]),this.image=t}return t.prototype.detect=function(){return this.detectMirror(!1)},t.prototype.detectMirror=function(t){var e=this.getMatrixCenter(),r=this.getBullsEyeCorners(e);if(t){var n=r[0];r[0]=r[2],r[2]=n}this.extractParameters(r);var o=this.sampleGrid(this.image,r[this.shift%4],r[(this.shift+1)%4],r[(this.shift+2)%4],r[(this.shift+3)%4]),i=this.getMatrixCornerPoints(r);return new Tn(o,i,this.compact,this.nbDataBlocks,this.nbLayers)},t.prototype.extractParameters=function(t){if(!(this.isValidPoint(t[0])&&this.isValidPoint(t[1])&&this.isValidPoint(t[2])&&this.isValidPoint(t[3])))throw new Gr;var e=2*this.nbCenterLayers,r=new Int32Array([this.sampleLine(t[0],t[1],e),this.sampleLine(t[1],t[2],e),this.sampleLine(t[2],t[3],e),this.sampleLine(t[3],t[0],e)]);this.shift=this.getRotation(r,e);for(var n=0,o=0;o<4;o++){var i=r[(this.shift+o)%4];this.compact?(n<<=7,n+=i>>1&127):(n<<=10,n+=(i>>2&992)+(i>>1&31))}var a=this.getCorrectedParameterData(n,this.compact);this.compact?(this.nbLayers=1+(a>>6),this.nbDataBlocks=1+(63&a)):(this.nbLayers=1+(a>>11),this.nbDataBlocks=1+(2047&a))},t.prototype.getRotation=function(t,e){var r=0;t.forEach(function(t,n,o){r=(t>>e-2<<1)+(1&t)+(r<<3)}),r=((1&r)<<11)+(r>>1);for(var n=0;n<4;n++)if(Nr.bitCount(r^this.EXPECTED_CORNER_BITS[n])<=2)return n;throw new Gr},t.prototype.getCorrectedParameterData=function(t,e){var r,n;e?(r=7,n=2):(r=10,n=4);for(var o=r-n,i=new Int32Array(r),a=r-1;a>=0;--a)i[a]=15&t,t>>=4;try{new Cn(vn.AZTEC_PARAM).decode(i,o)}catch(u){throw new Gr}var s=0;for(a=0;a<n;a++)s=(s<<4)+i[a];return s},t.prototype.getBullsEyeCorners=function(t){var e=t,r=t,n=t,o=t,i=!0;for(this.nbCenterLayers=1;this.nbCenterLayers<9;this.nbCenterLayers++){var a=this.getFirstDifferent(e,i,1,-1),s=this.getFirstDifferent(r,i,1,1),u=this.getFirstDifferent(n,i,-1,1),l=this.getFirstDifferent(o,i,-1,-1);if(this.nbCenterLayers>2){var c=this.distancePoint(l,a)*this.nbCenterLayers/(this.distancePoint(o,e)*(this.nbCenterLayers+2));if(c<.75||c>1.25||!this.isWhiteOrBlackRectangle(a,s,u,l))break}e=a,r=s,n=u,o=l,i=!i}if(5!==this.nbCenterLayers&&7!==this.nbCenterLayers)throw new Gr;this.compact=5===this.nbCenterLayers;var h=new Sn(e.getX()+.5,e.getY()-.5),f=new Sn(r.getX()+.5,r.getY()+.5),d=new Sn(n.getX()-.5,n.getY()+.5),p=new Sn(o.getX()-.5,o.getY()-.5);return this.expandSquare([h,f,d,p],2*this.nbCenterLayers-3,2*this.nbCenterLayers)},t.prototype.getMatrixCenter=function(){var t,e,r,n;try{t=(u=new Nn(this.image).detect())[0],e=u[1],r=u[2],n=u[3]}catch(l){var o=this.image.getWidth()/2,i=this.image.getHeight()/2;t=this.getFirstDifferent(new Bn(o+7,i-7),!1,1,-1).toResultPoint(),e=this.getFirstDifferent(new Bn(o+7,i+7),!1,1,1).toResultPoint(),r=this.getFirstDifferent(new Bn(o-7,i+7),!1,-1,1).toResultPoint(),n=this.getFirstDifferent(new Bn(o-7,i-7),!1,-1,-1).toResultPoint()}var a=En.round((t.getX()+n.getX()+e.getX()+r.getX())/4),s=En.round((t.getY()+n.getY()+e.getY()+r.getY())/4);try{var u;t=(u=new Nn(this.image,15,a,s).detect())[0],e=u[1],r=u[2],n=u[3]}catch(c){t=this.getFirstDifferent(new Bn(a+7,s-7),!1,1,-1).toResultPoint(),e=this.getFirstDifferent(new Bn(a+7,s+7),!1,1,1).toResultPoint(),r=this.getFirstDifferent(new Bn(a-7,s+7),!1,-1,1).toResultPoint(),n=this.getFirstDifferent(new Bn(a-7,s-7),!1,-1,-1).toResultPoint()}return a=En.round((t.getX()+n.getX()+e.getX()+r.getX())/4),s=En.round((t.getY()+n.getY()+e.getY()+r.getY())/4),new Bn(a,s)},t.prototype.getMatrixCornerPoints=function(t){return this.expandSquare(t,2*this.nbCenterLayers,this.getDimension())},t.prototype.sampleGrid=function(t,e,r,n,o){var i=Mn.getInstance(),a=this.getDimension(),s=a/2-this.nbCenterLayers,u=a/2+this.nbCenterLayers;return i.sampleGrid(t,a,a,s,s,u,s,u,u,s,u,e.getX(),e.getY(),r.getX(),r.getY(),n.getX(),n.getY(),o.getX(),o.getY())},t.prototype.sampleLine=function(t,e,r){for(var n=0,o=this.distanceResultPoint(t,e),i=o/r,a=t.getX(),s=t.getY(),u=i*(e.getX()-t.getX())/o,l=i*(e.getY()-t.getY())/o,c=0;c<r;c++)this.image.get(En.round(a+c*u),En.round(s+c*l))&&(n|=1<<r-c-1);return n},t.prototype.isWhiteOrBlackRectangle=function(t,e,r,n){t=new Bn(t.getX()-3,t.getY()+3),e=new Bn(e.getX()-3,e.getY()-3),r=new Bn(r.getX()+3,r.getY()-3),n=new Bn(n.getX()+3,n.getY()+3);var o=this.getColor(n,t);if(0===o)return!1;var i=this.getColor(t,e);return i===o&&(i=this.getColor(e,r))===o&&(i=this.getColor(r,n))===o},t.prototype.getColor=function(t,e){for(var r=this.distancePoint(t,e),n=(e.getX()-t.getX())/r,o=(e.getY()-t.getY())/r,i=0,a=t.getX(),s=t.getY(),u=this.image.get(t.getX(),t.getY()),l=Math.ceil(r),c=0;c<l;c++)a+=n,s+=o,this.image.get(En.round(a),En.round(s))!==u&&i++;var h=i/r;return h>.1&&h<.9?0:h<=.1===u?1:-1},t.prototype.getFirstDifferent=function(t,e,r,n){for(var o=t.getX()+r,i=t.getY()+n;this.isValid(o,i)&&this.image.get(o,i)===e;)o+=r,i+=n;for(o-=r,i-=n;this.isValid(o,i)&&this.image.get(o,i)===e;)o+=r;for(o-=r;this.isValid(o,i)&&this.image.get(o,i)===e;)i+=n;return new Bn(o,i-=n)},t.prototype.expandSquare=function(t,e,r){var n=r/(2*e),o=t[0].getX()-t[2].getX(),i=t[0].getY()-t[2].getY(),a=(t[0].getX()+t[2].getX())/2,s=(t[0].getY()+t[2].getY())/2,u=new Sn(a+n*o,s+n*i),l=new Sn(a-n*o,s-n*i);return o=t[1].getX()-t[3].getX(),i=t[1].getY()-t[3].getY(),a=(t[1].getX()+t[3].getX())/2,s=(t[1].getY()+t[3].getY())/2,[u,new Sn(a+n*o,s+n*i),l,new Sn(a-n*o,s-n*i)]},t.prototype.isValid=function(t,e){return t>=0&&t<this.image.getWidth()&&e>0&&e<this.image.getHeight()},t.prototype.isValidPoint=function(t){var e=En.round(t.getX()),r=En.round(t.getY());return this.isValid(e,r)},t.prototype.distancePoint=function(t,e){return En.distance(t.getX(),t.getY(),e.getX(),e.getY())},t.prototype.distanceResultPoint=function(t,e){return En.distance(t.getX(),t.getY(),e.getX(),e.getY())},t.prototype.getDimension=function(){return this.compact?4*this.nbLayers+11:this.nbLayers<=4?4*this.nbLayers+15:4*this.nbLayers+2*(Nr.truncDivision(this.nbLayers-4,8)+1)+15},t}(),Fn=function(){function t(){}return t.prototype.decode=function(t,e){void 0===e&&(e=null);var r=null,n=new Ln(t.getBlackMatrix()),o=null,i=null;try{o=(a=n.detectMirror(!1)).getPoints(),this.reportFoundResultPoints(e,o),i=(new An).decode(a)}catch(c){r=c}if(null==i)try{var a;o=(a=n.detectMirror(!0)).getPoints(),this.reportFoundResultPoints(e,o),i=(new An).decode(a)}catch(c){if(null!=r)throw r;throw c}var s=new an(i.getText(),i.getRawBytes(),i.getNumBits(),o,un.AZTEC,Er.currentTimeMillis()),u=i.getByteSegments();null!=u&&s.putMetadata(cn.BYTE_SEGMENTS,u);var l=i.getECLevel();return null!=l&&s.putMetadata(cn.ERROR_CORRECTION_LEVEL,l),s},t.prototype.reportFoundResultPoints=function(t,e){if(null!=t){var r=t.get(Dr.NEED_RESULT_POINT_CALLBACK);null!=r&&e.forEach(function(t,e,n){r.foundPossibleResultPoint(t)})}},t.prototype.reset=function(){},t}(),jn=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){jn(function(e){return void 0===e&&(e=500),t.call(this,new Fn,e)||this},t)}(on);var Vn=function(){function t(){}return t.prototype.decode=function(t,e){try{return this.doDecode(t,e)}catch(l){if(e&&!0===e.get(Dr.TRY_HARDER)&&t.isRotateSupported()){var r=t.rotateCounterClockwise(),n=this.doDecode(r,e),o=n.getResultMetadata(),i=270;null!==o&&!0===o.get(cn.ORIENTATION)&&(i+=o.get(cn.ORIENTATION)%360),n.putMetadata(cn.ORIENTATION,i);var a=n.getResultPoints();if(null!==a)for(var s=r.getHeight(),u=0;u<a.length;u++)a[u]=new Sn(s-a[u].getY()-1,a[u].getX());return n}throw new Gr}},t.prototype.reset=function(){},t.prototype.doDecode=function(t,e){var r,n=t.getWidth(),o=t.getHeight(),i=new kr(n),a=e&&!0===e.get(Dr.TRY_HARDER),s=Math.max(1,o>>(a?8:5));r=a?o:15;for(var u=Math.trunc(o/2),l=0;l<r;l++){var c=Math.trunc((l+1)/2),h=u+s*(1&l?-c:c);if(h<0||h>=o)break;try{i=t.getBlackRow(h,i)}catch(m){continue}for(var f=function(t){if(1===t&&(i.reverse(),e&&!0===e.get(Dr.NEED_RESULT_POINT_CALLBACK))){var r=new Map;e.forEach(function(t,e){return r.set(e,t)}),r.delete(Dr.NEED_RESULT_POINT_CALLBACK),e=r}try{var o=d.decodeRow(h,i,e);if(1===t){o.putMetadata(cn.ORIENTATION,180);var a=o.getResultPoints();null!==a&&(a[0]=new Sn(n-a[0].getX()-1,a[0].getY()),a[1]=new Sn(n-a[1].getX()-1,a[1].getY()))}return{value:o}}catch(s){}},d=this,p=0;p<2;p++){var g=f(p);if("object"==typeof g)return g.value}}throw new Gr},t.recordPattern=function(t,e,r){for(var n=r.length,o=0;o<n;o++)r[o]=0;var i=t.getSize();if(e>=i)throw new Gr;for(var a=!t.get(e),s=0,u=e;u<i;){if(t.get(u)!==a)r[s]++;else{if(++s===n)break;r[s]=1,a=!a}u++}if(s!==n&&(s!==n-1||u!==i))throw new Gr},t.recordPatternInReverse=function(e,r,n){for(var o=n.length,i=e.get(r);r>0&&o>=0;)e.get(--r)!==i&&(o--,i=!i);if(o>=0)throw new Gr;t.recordPattern(e,r+1,n)},t.patternMatchVariance=function(t,e,r){for(var n=t.length,o=0,i=0,a=0;a<n;a++)o+=t[a],i+=e[a];if(o<i)return Number.POSITIVE_INFINITY;var s=o/i;r*=s;for(var u=0,l=0;l<n;l++){var c=t[l],h=e[l]*s,f=c>h?c-h:h-c;if(f>r)return Number.POSITIVE_INFINITY;u+=f}return u/o},t}(),Un=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Hn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Un(e,t),e.findStartPattern=function(t){for(var r=t.getSize(),n=t.getNextSet(0),o=0,i=Int32Array.from([0,0,0,0,0,0]),a=n,s=!1,u=n;u<r;u++)if(t.get(u)!==s)i[o]++;else{if(5===o){for(var l=e.MAX_AVG_VARIANCE,c=-1,h=e.CODE_START_A;h<=e.CODE_START_C;h++){var f=Vn.patternMatchVariance(i,e.CODE_PATTERNS[h],e.MAX_INDIVIDUAL_VARIANCE);f<l&&(l=f,c=h)}if(c>=0&&t.isRange(Math.max(0,a-(u-a)/2),a,!1))return Int32Array.from([a,u,c]);a+=i[0]+i[1],(i=i.slice(2,i.length-1))[o-1]=0,i[o]=0,o--}else o++;i[o]=1,s=!s}throw new Gr},e.decodeCode=function(t,r,n){Vn.recordPattern(t,n,r);for(var o=e.MAX_AVG_VARIANCE,i=-1,a=0;a<e.CODE_PATTERNS.length;a++){var s=e.CODE_PATTERNS[a],u=this.patternMatchVariance(r,s,e.MAX_INDIVIDUAL_VARIANCE);u<o&&(o=u,i=a)}if(i>=0)return i;throw new Gr},e.prototype.decodeRow=function(t,r,n){var o,i=n&&!0===n.get(Dr.ASSUME_GS1),a=e.findStartPattern(r),s=a[2],u=0,l=new Uint8Array(20);switch(l[u++]=s,s){case e.CODE_START_A:o=e.CODE_CODE_A;break;case e.CODE_START_B:o=e.CODE_CODE_B;break;case e.CODE_START_C:o=e.CODE_CODE_C;break;default:throw new Mr}for(var c=!1,h=!1,f="",d=a[0],p=a[1],g=Int32Array.from([0,0,0,0,0,0]),m=0,v=0,y=s,_=0,w=!0,b=!1,C=!1;!c;){var A=h;switch(h=!1,m=v,v=e.decodeCode(r,g,p),l[u++]=v,v!==e.CODE_STOP&&(w=!0),v!==e.CODE_STOP&&(y+=++_*v),d=p,p+=g.reduce(function(t,e){return t+e},0),v){case e.CODE_START_A:case e.CODE_START_B:case e.CODE_START_C:throw new Mr}switch(o){case e.CODE_CODE_A:if(v<64)f+=C===b?String.fromCharCode(" ".charCodeAt(0)+v):String.fromCharCode(" ".charCodeAt(0)+v+128),C=!1;else if(v<96)f+=C===b?String.fromCharCode(v-64):String.fromCharCode(v+64),C=!1;else switch(v!==e.CODE_STOP&&(w=!1),v){case e.CODE_FNC_1:i&&(0===f.length?f+="]C1":f+=String.fromCharCode(29));break;case e.CODE_FNC_2:case e.CODE_FNC_3:break;case e.CODE_FNC_4_A:!b&&C?(b=!0,C=!1):b&&C?(b=!1,C=!1):C=!0;break;case e.CODE_SHIFT:h=!0,o=e.CODE_CODE_B;break;case e.CODE_CODE_B:o=e.CODE_CODE_B;break;case e.CODE_CODE_C:o=e.CODE_CODE_C;break;case e.CODE_STOP:c=!0}break;case e.CODE_CODE_B:if(v<96)f+=C===b?String.fromCharCode(" ".charCodeAt(0)+v):String.fromCharCode(" ".charCodeAt(0)+v+128),C=!1;else switch(v!==e.CODE_STOP&&(w=!1),v){case e.CODE_FNC_1:i&&(0===f.length?f+="]C1":f+=String.fromCharCode(29));break;case e.CODE_FNC_2:case e.CODE_FNC_3:break;case e.CODE_FNC_4_B:!b&&C?(b=!0,C=!1):b&&C?(b=!1,C=!1):C=!0;break;case e.CODE_SHIFT:h=!0,o=e.CODE_CODE_A;break;case e.CODE_CODE_A:o=e.CODE_CODE_A;break;case e.CODE_CODE_C:o=e.CODE_CODE_C;break;case e.CODE_STOP:c=!0}break;case e.CODE_CODE_C:if(v<100)v<10&&(f+="0"),f+=v;else switch(v!==e.CODE_STOP&&(w=!1),v){case e.CODE_FNC_1:i&&(0===f.length?f+="]C1":f+=String.fromCharCode(29));break;case e.CODE_CODE_A:o=e.CODE_CODE_A;break;case e.CODE_CODE_B:o=e.CODE_CODE_B;break;case e.CODE_STOP:c=!0}}A&&(o=o===e.CODE_CODE_A?e.CODE_CODE_B:e.CODE_CODE_A)}var E=p-d;if(p=r.getNextUnset(p),!r.isRange(p,Math.min(r.getSize(),p+(p-d)/2),!1))throw new Gr;if((y-=_*m)%103!==m)throw new Cr;var I=f.length;if(0===I)throw new Gr;I>0&&w&&(f=o===e.CODE_CODE_C?f.substring(0,I-2):f.substring(0,I-1));for(var S=(a[1]+a[0])/2,x=d+E/2,O=l.length,T=new Uint8Array(O),N=0;N<O;N++)T[N]=l[N];var k=[new Sn(S,t),new Sn(x,t)];return new an(f,T,0,k,un.CODE_128,(new Date).getTime())},e.CODE_PATTERNS=[Int32Array.from([2,1,2,2,2,2]),Int32Array.from([2,2,2,1,2,2]),Int32Array.from([2,2,2,2,2,1]),Int32Array.from([1,2,1,2,2,3]),Int32Array.from([1,2,1,3,2,2]),Int32Array.from([1,3,1,2,2,2]),Int32Array.from([1,2,2,2,1,3]),Int32Array.from([1,2,2,3,1,2]),Int32Array.from([1,3,2,2,1,2]),Int32Array.from([2,2,1,2,1,3]),Int32Array.from([2,2,1,3,1,2]),Int32Array.from([2,3,1,2,1,2]),Int32Array.from([1,1,2,2,3,2]),Int32Array.from([1,2,2,1,3,2]),Int32Array.from([1,2,2,2,3,1]),Int32Array.from([1,1,3,2,2,2]),Int32Array.from([1,2,3,1,2,2]),Int32Array.from([1,2,3,2,2,1]),Int32Array.from([2,2,3,2,1,1]),Int32Array.from([2,2,1,1,3,2]),Int32Array.from([2,2,1,2,3,1]),Int32Array.from([2,1,3,2,1,2]),Int32Array.from([2,2,3,1,1,2]),Int32Array.from([3,1,2,1,3,1]),Int32Array.from([3,1,1,2,2,2]),Int32Array.from([3,2,1,1,2,2]),Int32Array.from([3,2,1,2,2,1]),Int32Array.from([3,1,2,2,1,2]),Int32Array.from([3,2,2,1,1,2]),Int32Array.from([3,2,2,2,1,1]),Int32Array.from([2,1,2,1,2,3]),Int32Array.from([2,1,2,3,2,1]),Int32Array.from([2,3,2,1,2,1]),Int32Array.from([1,1,1,3,2,3]),Int32Array.from([1,3,1,1,2,3]),Int32Array.from([1,3,1,3,2,1]),Int32Array.from([1,1,2,3,1,3]),Int32Array.from([1,3,2,1,1,3]),Int32Array.from([1,3,2,3,1,1]),Int32Array.from([2,1,1,3,1,3]),Int32Array.from([2,3,1,1,1,3]),Int32Array.from([2,3,1,3,1,1]),Int32Array.from([1,1,2,1,3,3]),Int32Array.from([1,1,2,3,3,1]),Int32Array.from([1,3,2,1,3,1]),Int32Array.from([1,1,3,1,2,3]),Int32Array.from([1,1,3,3,2,1]),Int32Array.from([1,3,3,1,2,1]),Int32Array.from([3,1,3,1,2,1]),Int32Array.from([2,1,1,3,3,1]),Int32Array.from([2,3,1,1,3,1]),Int32Array.from([2,1,3,1,1,3]),Int32Array.from([2,1,3,3,1,1]),Int32Array.from([2,1,3,1,3,1]),Int32Array.from([3,1,1,1,2,3]),Int32Array.from([3,1,1,3,2,1]),Int32Array.from([3,3,1,1,2,1]),Int32Array.from([3,1,2,1,1,3]),Int32Array.from([3,1,2,3,1,1]),Int32Array.from([3,3,2,1,1,1]),Int32Array.from([3,1,4,1,1,1]),Int32Array.from([2,2,1,4,1,1]),Int32Array.from([4,3,1,1,1,1]),Int32Array.from([1,1,1,2,2,4]),Int32Array.from([1,1,1,4,2,2]),Int32Array.from([1,2,1,1,2,4]),Int32Array.from([1,2,1,4,2,1]),Int32Array.from([1,4,1,1,2,2]),Int32Array.from([1,4,1,2,2,1]),Int32Array.from([1,1,2,2,1,4]),Int32Array.from([1,1,2,4,1,2]),Int32Array.from([1,2,2,1,1,4]),Int32Array.from([1,2,2,4,1,1]),Int32Array.from([1,4,2,1,1,2]),Int32Array.from([1,4,2,2,1,1]),Int32Array.from([2,4,1,2,1,1]),Int32Array.from([2,2,1,1,1,4]),Int32Array.from([4,1,3,1,1,1]),Int32Array.from([2,4,1,1,1,2]),Int32Array.from([1,3,4,1,1,1]),Int32Array.from([1,1,1,2,4,2]),Int32Array.from([1,2,1,1,4,2]),Int32Array.from([1,2,1,2,4,1]),Int32Array.from([1,1,4,2,1,2]),Int32Array.from([1,2,4,1,1,2]),Int32Array.from([1,2,4,2,1,1]),Int32Array.from([4,1,1,2,1,2]),Int32Array.from([4,2,1,1,1,2]),Int32Array.from([4,2,1,2,1,1]),Int32Array.from([2,1,2,1,4,1]),Int32Array.from([2,1,4,1,2,1]),Int32Array.from([4,1,2,1,2,1]),Int32Array.from([1,1,1,1,4,3]),Int32Array.from([1,1,1,3,4,1]),Int32Array.from([1,3,1,1,4,1]),Int32Array.from([1,1,4,1,1,3]),Int32Array.from([1,1,4,3,1,1]),Int32Array.from([4,1,1,1,1,3]),Int32Array.from([4,1,1,3,1,1]),Int32Array.from([1,1,3,1,4,1]),Int32Array.from([1,1,4,1,3,1]),Int32Array.from([3,1,1,1,4,1]),Int32Array.from([4,1,1,1,3,1]),Int32Array.from([2,1,1,4,1,2]),Int32Array.from([2,1,1,2,1,4]),Int32Array.from([2,1,1,2,3,2]),Int32Array.from([2,3,3,1,1,1,2])],e.MAX_AVG_VARIANCE=.25,e.MAX_INDIVIDUAL_VARIANCE=.7,e.CODE_SHIFT=98,e.CODE_CODE_C=99,e.CODE_CODE_B=100,e.CODE_CODE_A=101,e.CODE_FNC_1=102,e.CODE_FNC_2=97,e.CODE_FNC_3=96,e.CODE_FNC_4_A=101,e.CODE_FNC_4_B=100,e.CODE_START_A=103,e.CODE_START_B=104,e.CODE_START_C=105,e.CODE_STOP=106,e}(Vn),zn=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Wn=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Gn=function(t){function e(e,r){void 0===e&&(e=!1),void 0===r&&(r=!1);var n=t.call(this)||this;return n.usingCheckDigit=e,n.extendedMode=r,n.decodeRowResult="",n.counters=new Int32Array(9),n}return zn(e,t),e.prototype.decodeRow=function(t,r,n){var o,i,a,s,u=this.counters;u.fill(0),this.decodeRowResult="";var l,c,h=e.findAsteriskPattern(r,u),f=r.getNextSet(h[1]),d=r.getSize();do{e.recordPattern(r,f,u);var p=e.toNarrowWidePattern(u);if(p<0)throw new Gr;l=e.patternToChar(p),this.decodeRowResult+=l,c=f;try{for(var g=(o=void 0,Wn(u)),m=g.next();!m.done;m=g.next())f+=m.value}catch(S){o={error:S}}finally{try{m&&!m.done&&(i=g.return)&&i.call(g)}finally{if(o)throw o.error}}f=r.getNextSet(f)}while("*"!==l);this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);var v,y=0;try{for(var _=Wn(u),w=_.next();!w.done;w=_.next())y+=w.value}catch(S){a={error:S}}finally{try{w&&!w.done&&(s=_.return)&&s.call(_)}finally{if(a)throw a.error}}if(f!==d&&2*(f-c-y)<y)throw new Gr;if(this.usingCheckDigit){for(var b=this.decodeRowResult.length-1,C=0,A=0;A<b;A++)C+=e.ALPHABET_STRING.indexOf(this.decodeRowResult.charAt(A));if(this.decodeRowResult.charAt(b)!==e.ALPHABET_STRING.charAt(C%43))throw new Cr;this.decodeRowResult=this.decodeRowResult.substring(0,b)}if(0===this.decodeRowResult.length)throw new Gr;v=this.extendedMode?e.decodeExtended(this.decodeRowResult):this.decodeRowResult;var E=(h[1]+h[0])/2,I=c+y/2;return new an(v,null,0,[new Sn(E,t),new Sn(I,t)],un.CODE_39,(new Date).getTime())},e.findAsteriskPattern=function(t,r){for(var n=t.getSize(),o=t.getNextSet(0),i=0,a=o,s=!1,u=r.length,l=o;l<n;l++)if(t.get(l)!==s)r[i]++;else{if(i===u-1){if(this.toNarrowWidePattern(r)===e.ASTERISK_ENCODING&&t.isRange(Math.max(0,a-Math.floor((l-a)/2)),a,!1))return[a,l];a+=r[0]+r[1],r.copyWithin(0,2,2+i-1),r[i-1]=0,r[i]=0,i--}else i++;r[i]=1,s=!s}throw new Gr},e.toNarrowWidePattern=function(t){var e,r,n,o=t.length,i=0;do{var a=2147483647;try{for(var s=(e=void 0,Wn(t)),u=s.next();!u.done;u=s.next())(f=u.value)<a&&f>i&&(a=f)}catch(d){e={error:d}}finally{try{u&&!u.done&&(r=s.return)&&r.call(s)}finally{if(e)throw e.error}}i=a,n=0;for(var l=0,c=0,h=0;h<o;h++)(f=t[h])>i&&(c|=1<<o-1-h,n++,l+=f);if(3===n){for(h=0;h<o&&n>0;h++){var f;if((f=t[h])>i&&(n--,2*f>=l))return-1}return c}}while(n>3);return-1},e.patternToChar=function(t){for(var r=0;r<e.CHARACTER_ENCODINGS.length;r++)if(e.CHARACTER_ENCODINGS[r]===t)return e.ALPHABET_STRING.charAt(r);if(t===e.ASTERISK_ENCODING)return"*";throw new Gr},e.decodeExtended=function(t){for(var e=t.length,r="",n=0;n<e;n++){var o=t.charAt(n);if("+"===o||"$"===o||"%"===o||"/"===o){var i=t.charAt(n+1),a="\0";switch(o){case"+":if(!(i>="A"&&i<="Z"))throw new Mr;a=String.fromCharCode(i.charCodeAt(0)+32);break;case"$":if(!(i>="A"&&i<="Z"))throw new Mr;a=String.fromCharCode(i.charCodeAt(0)-64);break;case"%":if(i>="A"&&i<="E")a=String.fromCharCode(i.charCodeAt(0)-38);else if(i>="F"&&i<="J")a=String.fromCharCode(i.charCodeAt(0)-11);else if(i>="K"&&i<="O")a=String.fromCharCode(i.charCodeAt(0)+16);else if(i>="P"&&i<="T")a=String.fromCharCode(i.charCodeAt(0)+43);else if("U"===i)a="\0";else if("V"===i)a="@";else if("W"===i)a="`";else{if("X"!==i&&"Y"!==i&&"Z"!==i)throw new Mr;a=""}break;case"/":if(i>="A"&&i<="O")a=String.fromCharCode(i.charCodeAt(0)-32);else{if("Z"!==i)throw new Mr;a=":"}}r+=a,n++}else r+=o}return r},e.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%",e.CHARACTER_ENCODINGS=[52,289,97,352,49,304,112,37,292,100,265,73,328,25,280,88,13,268,76,28,259,67,322,19,274,82,7,262,70,22,385,193,448,145,400,208,133,388,196,168,162,138,42],e.ASTERISK_ENCODING=148,e}(Vn),Xn=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),$n=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.narrowLineWidth=-1,e}return Xn(e,t),e.prototype.decodeRow=function(t,r,n){var o,i,a=this.decodeStart(r),s=this.decodeEnd(r),u=new Hr;e.decodeMiddle(r,a[1],s[0],u);var l=u.toString(),c=null;null!=n&&(c=n.get(Dr.ALLOWED_LENGTHS)),null==c&&(c=e.DEFAULT_ALLOWED_LENGTHS);var h=l.length,f=!1,d=0;try{for(var p=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(c),g=p.next();!g.done;g=p.next()){var m=g.value;if(h===m){f=!0;break}m>d&&(d=m)}}catch(y){o={error:y}}finally{try{g&&!g.done&&(i=p.return)&&i.call(p)}finally{if(o)throw o.error}}if(!f&&h>d&&(f=!0),!f)throw new Mr;var v=[new Sn(a[1],t),new Sn(s[0],t)];return new an(l,null,0,v,un.ITF,(new Date).getTime())},e.decodeMiddle=function(t,r,n,o){var i=new Int32Array(10),a=new Int32Array(5),s=new Int32Array(5);for(i.fill(0),a.fill(0),s.fill(0);r<n;){Vn.recordPattern(t,r,i);for(var u=0;u<5;u++){var l=2*u;a[u]=i[l],s[u]=i[l+1]}var c=e.decodeDigit(a);o.append(c.toString()),c=this.decodeDigit(s),o.append(c.toString()),i.forEach(function(t){r+=t})}},e.prototype.decodeStart=function(t){var r=e.skipWhiteSpace(t),n=e.findGuardPattern(t,r,e.START_PATTERN);return this.narrowLineWidth=(n[1]-n[0])/4,this.validateQuietZone(t,n[0]),n},e.prototype.validateQuietZone=function(t,e){var r=10*this.narrowLineWidth;r=r<e?r:e;for(var n=e-1;r>0&&n>=0&&!t.get(n);n--)r--;if(0!==r)throw new Gr},e.skipWhiteSpace=function(t){var e=t.getSize(),r=t.getNextSet(0);if(r===e)throw new Gr;return r},e.prototype.decodeEnd=function(t){t.reverse();try{var r=e.skipWhiteSpace(t),n=void 0;try{n=e.findGuardPattern(t,r,e.END_PATTERN_REVERSED[0])}catch(i){i instanceof Gr&&(n=e.findGuardPattern(t,r,e.END_PATTERN_REVERSED[1]))}this.validateQuietZone(t,n[0]);var o=n[0];return n[0]=t.getSize()-n[1],n[1]=t.getSize()-o,n}finally{t.reverse()}},e.findGuardPattern=function(t,r,n){var o=n.length,i=new Int32Array(o),a=t.getSize(),s=!1,u=0,l=r;i.fill(0);for(var c=r;c<a;c++)if(t.get(c)!==s)i[u]++;else{if(u===o-1){if(Vn.patternMatchVariance(i,n,e.MAX_INDIVIDUAL_VARIANCE)<e.MAX_AVG_VARIANCE)return[l,c];l+=i[0]+i[1],Er.arraycopy(i,2,i,0,u-1),i[u-1]=0,i[u]=0,u--}else u++;i[u]=1,s=!s}throw new Gr},e.decodeDigit=function(t){for(var r=e.MAX_AVG_VARIANCE,n=-1,o=e.PATTERNS.length,i=0;i<o;i++){var a=e.PATTERNS[i],s=Vn.patternMatchVariance(t,a,e.MAX_INDIVIDUAL_VARIANCE);s<r?(r=s,n=i):s===r&&(n=-1)}if(n>=0)return n%10;throw new Gr},e.PATTERNS=[Int32Array.from([1,1,2,2,1]),Int32Array.from([2,1,1,1,2]),Int32Array.from([1,2,1,1,2]),Int32Array.from([2,2,1,1,1]),Int32Array.from([1,1,2,1,2]),Int32Array.from([2,1,2,1,1]),Int32Array.from([1,2,2,1,1]),Int32Array.from([1,1,1,2,2]),Int32Array.from([2,1,1,2,1]),Int32Array.from([1,2,1,2,1]),Int32Array.from([1,1,3,3,1]),Int32Array.from([3,1,1,1,3]),Int32Array.from([1,3,1,1,3]),Int32Array.from([3,3,1,1,1]),Int32Array.from([1,1,3,1,3]),Int32Array.from([3,1,3,1,1]),Int32Array.from([1,3,3,1,1]),Int32Array.from([1,1,1,3,3]),Int32Array.from([3,1,1,3,1]),Int32Array.from([1,3,1,3,1])],e.MAX_AVG_VARIANCE=.38,e.MAX_INDIVIDUAL_VARIANCE=.5,e.DEFAULT_ALLOWED_LENGTHS=[6,8,10,12,14],e.START_PATTERN=Int32Array.from([1,1,1,1]),e.END_PATTERN_REVERSED=[Int32Array.from([1,1,2]),Int32Array.from([1,1,3])],e}(Vn),Yn=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),qn=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.decodeRowStringBuffer="",e}return Yn(e,t),e.findStartGuardPattern=function(t){for(var r,n=!1,o=0,i=Int32Array.from([0,0,0]);!n;){i=Int32Array.from([0,0,0]);var a=(r=e.findGuardPattern(t,o,!1,this.START_END_PATTERN,i))[0],s=a-((o=r[1])-a);s>=0&&(n=t.isRange(s,a,!1))}return r},e.checkChecksum=function(t){return e.checkStandardUPCEANChecksum(t)},e.checkStandardUPCEANChecksum=function(t){var r=t.length;if(0===r)return!1;var n=parseInt(t.charAt(r-1),10);return e.getStandardUPCEANChecksum(t.substring(0,r-1))===n},e.getStandardUPCEANChecksum=function(t){for(var e=t.length,r=0,n=e-1;n>=0;n-=2){if((o=t.charAt(n).charCodeAt(0)-"0".charCodeAt(0))<0||o>9)throw new Mr;r+=o}for(r*=3,n=e-2;n>=0;n-=2){var o;if((o=t.charAt(n).charCodeAt(0)-"0".charCodeAt(0))<0||o>9)throw new Mr;r+=o}return(1e3-r)%10},e.decodeEnd=function(t,r){return e.findGuardPattern(t,r,!1,e.START_END_PATTERN,new Int32Array(e.START_END_PATTERN.length).fill(0))},e.findGuardPatternWithoutCounters=function(t,e,r,n){return this.findGuardPattern(t,e,r,n,new Int32Array(n.length))},e.findGuardPattern=function(t,r,n,o,i){for(var a=t.getSize(),s=0,u=r=n?t.getNextUnset(r):t.getNextSet(r),l=o.length,c=n,h=r;h<a;h++)if(t.get(h)!==c)i[s]++;else{if(s===l-1){if(Vn.patternMatchVariance(i,o,e.MAX_INDIVIDUAL_VARIANCE)<e.MAX_AVG_VARIANCE)return Int32Array.from([u,h]);u+=i[0]+i[1];for(var f=i.slice(2,i.length-1),d=0;d<s-1;d++)i[d]=f[d];i[s-1]=0,i[s]=0,s--}else s++;i[s]=1,c=!c}throw new Gr},e.decodeDigit=function(t,r,n,o){this.recordPattern(t,n,r);for(var i=this.MAX_AVG_VARIANCE,a=-1,s=o.length,u=0;u<s;u++){var l=o[u],c=Vn.patternMatchVariance(r,l,e.MAX_INDIVIDUAL_VARIANCE);c<i&&(i=c,a=u)}if(a>=0)return a;throw new Gr},e.MAX_AVG_VARIANCE=.48,e.MAX_INDIVIDUAL_VARIANCE=.7,e.START_END_PATTERN=Int32Array.from([1,1,1]),e.MIDDLE_PATTERN=Int32Array.from([1,1,1,1,1]),e.END_PATTERN=Int32Array.from([1,1,1,1,1,1]),e.L_PATTERNS=[Int32Array.from([3,2,1,1]),Int32Array.from([2,2,2,1]),Int32Array.from([2,1,2,2]),Int32Array.from([1,4,1,1]),Int32Array.from([1,1,3,2]),Int32Array.from([1,2,3,1]),Int32Array.from([1,1,1,4]),Int32Array.from([1,3,1,2]),Int32Array.from([1,2,1,3]),Int32Array.from([3,1,1,2])],e}(Vn),Kn=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Zn=function(){function t(){this.CHECK_DIGIT_ENCODINGS=[24,20,18,17,12,6,3,10,9,5],this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}return t.prototype.decodeRow=function(e,r,n){var o=this.decodeRowStringBuffer,i=this.decodeMiddle(r,n,o),a=o.toString(),s=t.parseExtensionString(a),u=[new Sn((n[0]+n[1])/2,e),new Sn(i,e)],l=new an(a,null,0,u,un.UPC_EAN_EXTENSION,(new Date).getTime());return null!=s&&l.putAllMetadata(s),l},t.prototype.decodeMiddle=function(e,r,n){var o,i,a=this.decodeMiddleCounters;a[0]=0,a[1]=0,a[2]=0,a[3]=0;for(var s=e.getSize(),u=r[1],l=0,c=0;c<5&&u<s;c++){var h=qn.decodeDigit(e,a,u,qn.L_AND_G_PATTERNS);n+=String.fromCharCode("0".charCodeAt(0)+h%10);try{for(var f=(o=void 0,Kn(a)),d=f.next();!d.done;d=f.next())u+=d.value}catch(g){o={error:g}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}h>=10&&(l|=1<<4-c),4!==c&&(u=e.getNextSet(u),u=e.getNextUnset(u))}if(5!==n.length)throw new Gr;var p=this.determineCheckDigit(l);if(t.extensionChecksum(n.toString())!==p)throw new Gr;return u},t.extensionChecksum=function(t){for(var e=t.length,r=0,n=e-2;n>=0;n-=2)r+=t.charAt(n).charCodeAt(0)-"0".charCodeAt(0);for(r*=3,n=e-1;n>=0;n-=2)r+=t.charAt(n).charCodeAt(0)-"0".charCodeAt(0);return(r*=3)%10},t.prototype.determineCheckDigit=function(t){for(var e=0;e<10;e++)if(t===this.CHECK_DIGIT_ENCODINGS[e])return e;throw new Gr},t.parseExtensionString=function(e){if(5!==e.length)return null;var r=t.parseExtension5String(e);return null==r?null:new Map([[cn.SUGGESTED_PRICE,r]])},t.parseExtension5String=function(t){var e;switch(t.charAt(0)){case"0":e="£";break;case"5":e="$";break;case"9":switch(t){case"90000":return null;case"99991":return"0.00";case"99990":return"Used"}e="";break;default:e=""}var r=parseInt(t.substring(1)),n=r%100;return e+(r/100).toString()+"."+(n<10?"0"+n:n.toString())},t}(),Qn=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Jn=function(){function t(){this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}return t.prototype.decodeRow=function(e,r,n){var o=this.decodeRowStringBuffer,i=this.decodeMiddle(r,n,o),a=o.toString(),s=t.parseExtensionString(a),u=[new Sn((n[0]+n[1])/2,e),new Sn(i,e)],l=new an(a,null,0,u,un.UPC_EAN_EXTENSION,(new Date).getTime());return null!=s&&l.putAllMetadata(s),l},t.prototype.decodeMiddle=function(t,e,r){var n,o,i=this.decodeMiddleCounters;i[0]=0,i[1]=0,i[2]=0,i[3]=0;for(var a=t.getSize(),s=e[1],u=0,l=0;l<2&&s<a;l++){var c=qn.decodeDigit(t,i,s,qn.L_AND_G_PATTERNS);r+=String.fromCharCode("0".charCodeAt(0)+c%10);try{for(var h=(n=void 0,Qn(i)),f=h.next();!f.done;f=h.next())s+=f.value}catch(d){n={error:d}}finally{try{f&&!f.done&&(o=h.return)&&o.call(h)}finally{if(n)throw n.error}}c>=10&&(u|=1<<1-l),1!==l&&(s=t.getNextSet(s),s=t.getNextUnset(s))}if(2!==r.length)throw new Gr;if(parseInt(r.toString())%4!==u)throw new Gr;return s},t.parseExtensionString=function(t){return 2!==t.length?null:new Map([[cn.ISSUE_NUMBER,parseInt(t)]])},t}(),to=function(){function t(){}return t.decodeRow=function(t,e,r){var n=qn.findGuardPattern(e,r,!1,this.EXTENSION_START_PATTERN,new Int32Array(this.EXTENSION_START_PATTERN.length).fill(0));try{return(new Zn).decodeRow(t,e,n)}catch(o){return(new Jn).decodeRow(t,e,n)}},t.EXTENSION_START_PATTERN=Int32Array.from([1,1,2]),t}(),eo=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ro=function(t){function e(){var r=t.call(this)||this;r.decodeRowStringBuffer="",e.L_AND_G_PATTERNS=e.L_PATTERNS.map(function(t){return Int32Array.from(t)});for(var n=10;n<20;n++){for(var o=e.L_PATTERNS[n-10],i=new Int32Array(o.length),a=0;a<o.length;a++)i[a]=o[o.length-a-1];e.L_AND_G_PATTERNS[n]=i}return r}return eo(e,t),e.prototype.decodeRow=function(t,r,n){var o=e.findStartGuardPattern(r),i=null==n?null:n.get(Dr.NEED_RESULT_POINT_CALLBACK);if(null!=i){var a=new Sn((o[0]+o[1])/2,t);i.foundPossibleResultPoint(a)}var s=this.decodeMiddle(r,o,this.decodeRowStringBuffer),u=s.rowOffset,l=s.resultString;if(null!=i){var c=new Sn(u,t);i.foundPossibleResultPoint(c)}var h=e.decodeEnd(r,u);if(null!=i){var f=new Sn((h[0]+h[1])/2,t);i.foundPossibleResultPoint(f)}var d=h[1],p=d+(d-h[0]);if(p>=r.getSize()||!r.isRange(d,p,!1))throw new Gr;var g=l.toString();if(g.length<8)throw new Mr;if(!e.checkChecksum(g))throw new Cr;var m=(o[1]+o[0])/2,v=(h[1]+h[0])/2,y=this.getBarcodeFormat(),_=[new Sn(m,t),new Sn(v,t)],w=new an(g,null,0,_,y,(new Date).getTime()),b=0;try{var C=to.decodeRow(t,r,h[1]);w.putMetadata(cn.UPC_EAN_EXTENSION,C.getText()),w.putAllMetadata(C.getResultMetadata()),w.addResultPoints(C.getResultPoints()),b=C.getText().length}catch(S){}var A=null==n?null:n.get(Dr.ALLOWED_EAN_EXTENSIONS);if(null!=A){var E=!1;for(var I in A)if(b.toString()===I){E=!0;break}if(!E)throw new Gr}return y===un.EAN_13||un.UPC_A,w},e.checkChecksum=function(t){return e.checkStandardUPCEANChecksum(t)},e.checkStandardUPCEANChecksum=function(t){var r=t.length;if(0===r)return!1;var n=parseInt(t.charAt(r-1),10);return e.getStandardUPCEANChecksum(t.substring(0,r-1))===n},e.getStandardUPCEANChecksum=function(t){for(var e=t.length,r=0,n=e-1;n>=0;n-=2){if((o=t.charAt(n).charCodeAt(0)-"0".charCodeAt(0))<0||o>9)throw new Mr;r+=o}for(r*=3,n=e-2;n>=0;n-=2){var o;if((o=t.charAt(n).charCodeAt(0)-"0".charCodeAt(0))<0||o>9)throw new Mr;r+=o}return(1e3-r)%10},e.decodeEnd=function(t,r){return e.findGuardPattern(t,r,!1,e.START_END_PATTERN,new Int32Array(e.START_END_PATTERN.length).fill(0))},e}(qn),no=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),oo=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},io=function(t){function e(){var e=t.call(this)||this;return e.decodeMiddleCounters=Int32Array.from([0,0,0,0]),e}return no(e,t),e.prototype.decodeMiddle=function(t,r,n){var o,i,a,s,u=this.decodeMiddleCounters;u[0]=0,u[1]=0,u[2]=0,u[3]=0;for(var l=t.getSize(),c=r[1],h=0,f=0;f<6&&c<l;f++){var d=ro.decodeDigit(t,u,c,ro.L_AND_G_PATTERNS);n+=String.fromCharCode("0".charCodeAt(0)+d%10);try{for(var p=(o=void 0,oo(u)),g=p.next();!g.done;g=p.next())c+=g.value}catch(y){o={error:y}}finally{try{g&&!g.done&&(i=p.return)&&i.call(p)}finally{if(o)throw o.error}}d>=10&&(h|=1<<5-f)}for(n=e.determineFirstDigit(n,h),c=ro.findGuardPattern(t,c,!0,ro.MIDDLE_PATTERN,new Int32Array(ro.MIDDLE_PATTERN.length).fill(0))[1],f=0;f<6&&c<l;f++){d=ro.decodeDigit(t,u,c,ro.L_PATTERNS),n+=String.fromCharCode("0".charCodeAt(0)+d);try{for(var m=(a=void 0,oo(u)),v=m.next();!v.done;v=m.next())c+=v.value}catch(y){a={error:y}}finally{try{v&&!v.done&&(s=m.return)&&s.call(m)}finally{if(a)throw a.error}}}return{rowOffset:c,resultString:n}},e.prototype.getBarcodeFormat=function(){return un.EAN_13},e.determineFirstDigit=function(t,e){for(var r=0;r<10;r++)if(e===this.FIRST_DIGIT_ENCODINGS[r])return String.fromCharCode("0".charCodeAt(0)+r)+t;throw new Gr},e.FIRST_DIGIT_ENCODINGS=[0,11,13,14,19,25,28,21,22,26],e}(ro),ao=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),so=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},uo=function(t){function e(){var e=t.call(this)||this;return e.decodeMiddleCounters=Int32Array.from([0,0,0,0]),e}return ao(e,t),e.prototype.decodeMiddle=function(t,e,r){var n,o,i,a,s=this.decodeMiddleCounters;s[0]=0,s[1]=0,s[2]=0,s[3]=0;for(var u=t.getSize(),l=e[1],c=0;c<4&&l<u;c++){var h=ro.decodeDigit(t,s,l,ro.L_PATTERNS);r+=String.fromCharCode("0".charCodeAt(0)+h);try{for(var f=(n=void 0,so(s)),d=f.next();!d.done;d=f.next())l+=d.value}catch(m){n={error:m}}finally{try{d&&!d.done&&(o=f.return)&&o.call(f)}finally{if(n)throw n.error}}}for(l=ro.findGuardPattern(t,l,!0,ro.MIDDLE_PATTERN,new Int32Array(ro.MIDDLE_PATTERN.length).fill(0))[1],c=0;c<4&&l<u;c++){h=ro.decodeDigit(t,s,l,ro.L_PATTERNS),r+=String.fromCharCode("0".charCodeAt(0)+h);try{for(var p=(i=void 0,so(s)),g=p.next();!g.done;g=p.next())l+=g.value}catch(m){i={error:m}}finally{try{g&&!g.done&&(a=p.return)&&a.call(p)}finally{if(i)throw i.error}}}return{rowOffset:l,resultString:r}},e.prototype.getBarcodeFormat=function(){return un.EAN_8},e}(ro),lo=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),co=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.ean13Reader=new io,e}return lo(e,t),e.prototype.getBarcodeFormat=function(){return un.UPC_A},e.prototype.decode=function(t,e){return this.maybeReturnResult(this.ean13Reader.decode(t))},e.prototype.decodeRow=function(t,e,r){return this.maybeReturnResult(this.ean13Reader.decodeRow(t,e,r))},e.prototype.decodeMiddle=function(t,e,r){return this.ean13Reader.decodeMiddle(t,e,r)},e.prototype.maybeReturnResult=function(t){var e=t.getText();if("0"===e.charAt(0)){var r=new an(e.substring(1),null,null,t.getResultPoints(),un.UPC_A);return null!=t.getResultMetadata()&&r.putAllMetadata(t.getResultMetadata()),r}throw new Gr},e.prototype.reset=function(){this.ean13Reader.reset()},e}(ro),ho=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),fo=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},po=function(t){function e(){var e=t.call(this)||this;return e.decodeMiddleCounters=new Int32Array(4),e}return ho(e,t),e.prototype.decodeMiddle=function(t,r,n){var o,i,a=this.decodeMiddleCounters.map(function(t){return t});a[0]=0,a[1]=0,a[2]=0,a[3]=0;for(var s=t.getSize(),u=r[1],l=0,c=0;c<6&&u<s;c++){var h=e.decodeDigit(t,a,u,e.L_AND_G_PATTERNS);n+=String.fromCharCode("0".charCodeAt(0)+h%10);try{for(var f=(o=void 0,fo(a)),d=f.next();!d.done;d=f.next())u+=d.value}catch(p){o={error:p}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}h>=10&&(l|=1<<5-c)}return e.determineNumSysAndCheckDigit(new Hr(n),l),u},e.prototype.decodeEnd=function(t,r){return e.findGuardPatternWithoutCounters(t,r,!0,e.MIDDLE_END_PATTERN)},e.prototype.checkChecksum=function(t){return ro.checkChecksum(e.convertUPCEtoUPCA(t))},e.determineNumSysAndCheckDigit=function(t,e){for(var r=0;r<=1;r++)for(var n=0;n<10;n++)if(e===this.NUMSYS_AND_CHECK_DIGIT_PATTERNS[r][n])return t.insert(0,"0"+r),void t.append("0"+n);throw Gr.getNotFoundInstance()},e.prototype.getBarcodeFormat=function(){return un.UPC_E},e.convertUPCEtoUPCA=function(t){var e=t.slice(1,7).split("").map(function(t){return t.charCodeAt(0)}),r=new Hr;r.append(t.charAt(0));var n=e[5];switch(n){case 0:case 1:case 2:r.appendChars(e,0,2),r.append(n),r.append("0000"),r.appendChars(e,2,3);break;case 3:r.appendChars(e,0,3),r.append("00000"),r.appendChars(e,3,2);break;case 4:r.appendChars(e,0,4),r.append("00000"),r.append(e[4]);break;default:r.appendChars(e,0,5),r.append("0000"),r.append(n)}return t.length>=8&&r.append(t.charAt(7)),r.toString()},e.MIDDLE_END_PATTERN=Int32Array.from([1,1,1,1,1,1]),e.NUMSYS_AND_CHECK_DIGIT_PATTERNS=[Int32Array.from([56,52,50,49,44,38,35,42,41,37]),Int32Array.from([7,11,13,14,19,25,28,21,22,1])],e}(ro),go=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),mo=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},vo=function(t){function e(e){var r=t.call(this)||this,n=null==e?null:e.get(Dr.POSSIBLE_FORMATS),o=[];return null!=n&&(n.indexOf(un.EAN_13)>-1?o.push(new io):n.indexOf(un.UPC_A)>-1&&o.push(new co),n.indexOf(un.EAN_8)>-1&&o.push(new uo),n.indexOf(un.UPC_E)>-1&&o.push(new po)),0===o.length&&(o.push(new io),o.push(new uo),o.push(new po)),r.readers=o,r}return go(e,t),e.prototype.decodeRow=function(t,e,r){var n,o;try{for(var i=mo(this.readers),a=i.next();!a.done;a=i.next()){var s=a.value;try{var u=s.decodeRow(t,e,r),l=u.getBarcodeFormat()===un.EAN_13&&"0"===u.getText().charAt(0),c=null==r?null:r.get(Dr.POSSIBLE_FORMATS),h=null==c||c.includes(un.UPC_A);if(l&&h){var f=u.getRawBytes(),d=new an(u.getText().substring(1),f,f.length,u.getResultPoints(),un.UPC_A);return d.putAllMetadata(u.getResultMetadata()),d}return u}catch(p){}}}catch(p){n={error:p}}finally{try{a&&!a.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}throw new Gr},e.prototype.reset=function(){var t,e;try{for(var r=mo(this.readers),n=r.next();!n.done;n=r.next())n.value.reset()}catch(o){t={error:o}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}},e}(Vn),yo=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),_o=function(t){function e(){var e=t.call(this)||this;return e.decodeFinderCounters=new Int32Array(4),e.dataCharacterCounters=new Int32Array(8),e.oddRoundingErrors=new Array(4),e.evenRoundingErrors=new Array(4),e.oddCounts=new Array(e.dataCharacterCounters.length/2),e.evenCounts=new Array(e.dataCharacterCounters.length/2),e}return yo(e,t),e.prototype.getDecodeFinderCounters=function(){return this.decodeFinderCounters},e.prototype.getDataCharacterCounters=function(){return this.dataCharacterCounters},e.prototype.getOddRoundingErrors=function(){return this.oddRoundingErrors},e.prototype.getEvenRoundingErrors=function(){return this.evenRoundingErrors},e.prototype.getOddCounts=function(){return this.oddCounts},e.prototype.getEvenCounts=function(){return this.evenCounts},e.prototype.parseFinderValue=function(t,r){for(var n=0;n<r.length;n++)if(Vn.patternMatchVariance(t,r[n],e.MAX_INDIVIDUAL_VARIANCE)<e.MAX_AVG_VARIANCE)return n;throw new Gr},e.count=function(t){return En.sum(new Int32Array(t))},e.increment=function(t,e){for(var r=0,n=e[0],o=1;o<t.length;o++)e[o]>n&&(n=e[o],r=o);t[r]++},e.decrement=function(t,e){for(var r=0,n=e[0],o=1;o<t.length;o++)e[o]<n&&(n=e[o],r=o);t[r]--},e.isFinderPattern=function(t){var r,n,o=t[0]+t[1],i=o/(o+t[2]+t[3]);if(i>=e.MIN_FINDER_PATTERN_RATIO&&i<=e.MAX_FINDER_PATTERN_RATIO){var a=Number.MAX_SAFE_INTEGER,s=Number.MIN_SAFE_INTEGER;try{for(var u=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(t),l=u.next();!l.done;l=u.next()){var c=l.value;c>s&&(s=c),c<a&&(a=c)}}catch(h){r={error:h}}finally{try{l&&!l.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}return s<10*a}return!1},e.MAX_AVG_VARIANCE=.2,e.MAX_INDIVIDUAL_VARIANCE=.45,e.MIN_FINDER_PATTERN_RATIO=9.5/12,e.MAX_FINDER_PATTERN_RATIO=12.5/14,e}(Vn),wo=function(){function t(t,e){this.value=t,this.checksumPortion=e}return t.prototype.getValue=function(){return this.value},t.prototype.getChecksumPortion=function(){return this.checksumPortion},t.prototype.toString=function(){return this.value+"("+this.checksumPortion+")"},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var r=e;return this.value===r.value&&this.checksumPortion===r.checksumPortion},t.prototype.hashCode=function(){return this.value^this.checksumPortion},t}(),bo=function(){function t(t,e,r,n,o){this.value=t,this.startEnd=e,this.value=t,this.startEnd=e,this.resultPoints=new Array,this.resultPoints.push(new Sn(r,o)),this.resultPoints.push(new Sn(n,o))}return t.prototype.getValue=function(){return this.value},t.prototype.getStartEnd=function(){return this.startEnd},t.prototype.getResultPoints=function(){return this.resultPoints},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var r=e;return this.value===r.value},t.prototype.hashCode=function(){return this.value},t}(),Co=function(){function t(){}return t.getRSSvalue=function(e,r,n){var o,i,a=0;try{for(var s=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(e),u=s.next();!u.done;u=s.next())a+=u.value}catch(v){o={error:v}}finally{try{u&&!u.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}for(var l=0,c=0,h=e.length,f=0;f<h-1;f++){var d=void 0;for(d=1,c|=1<<f;d<e[f];d++,c&=~(1<<f)){var p=t.combins(a-d-1,h-f-2);if(n&&0===c&&a-d-(h-f-1)>=h-f-1&&(p-=t.combins(a-d-(h-f),h-f-2)),h-f-1>1){for(var g=0,m=a-d-(h-f-2);m>r;m--)g+=t.combins(a-d-m-1,h-f-3);p-=g*(h-1-f)}else a-d>r&&p--;l+=p}a-=d}return l},t.combins=function(t,e){var r,n;t-e>e?(n=e,r=t-e):(n=t-e,r=e);for(var o=1,i=1,a=t;a>r;a--)o*=a,i<=n&&(o/=i,i++);for(;i<=n;)o/=i,i++;return o},t}(),Ao=function(){function t(){}return t.buildBitArray=function(t){var e=2*t.length-1;null==t[t.length-1].getRightChar()&&(e-=1);for(var r=new kr(12*e),n=0,o=t[0].getRightChar().getValue(),i=11;i>=0;--i)!!(o&1<<i)&&r.set(n),n++;for(i=1;i<t.length;++i){for(var a=t[i],s=a.getLeftChar().getValue(),u=11;u>=0;--u)!!(s&1<<u)&&r.set(n),n++;if(null!=a.getRightChar()){var l=a.getRightChar().getValue();for(u=11;u>=0;--u)!!(l&1<<u)&&r.set(n),n++}}return r},t}(),Eo=function(){function t(t,e){e?this.decodedInformation=null:(this.finished=t,this.decodedInformation=e)}return t.prototype.getDecodedInformation=function(){return this.decodedInformation},t.prototype.isFinished=function(){return this.finished},t}(),Io=function(){function t(t){this.newPosition=t}return t.prototype.getNewPosition=function(){return this.newPosition},t}(),So=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),xo=function(t){function e(e,r){var n=t.call(this,e)||this;return n.value=r,n}return So(e,t),e.prototype.getValue=function(){return this.value},e.prototype.isFNC1=function(){return this.value===e.FNC1},e.FNC1="$",e}(Io),Oo=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),To=function(t){function e(e,r,n){var o=t.call(this,e)||this;return n?(o.remaining=!0,o.remainingValue=o.remainingValue):(o.remaining=!1,o.remainingValue=0),o.newString=r,o}return Oo(e,t),e.prototype.getNewString=function(){return this.newString},e.prototype.isRemaining=function(){return this.remaining},e.prototype.getRemainingValue=function(){return this.remainingValue},e}(Io),No=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ko=function(t){function e(e,r,n){var o=t.call(this,e)||this;if(r<0||r>10||n<0||n>10)throw new Mr;return o.firstDigit=r,o.secondDigit=n,o}return No(e,t),e.prototype.getFirstDigit=function(){return this.firstDigit},e.prototype.getSecondDigit=function(){return this.secondDigit},e.prototype.getValue=function(){return 10*this.firstDigit+this.secondDigit},e.prototype.isFirstDigitFNC1=function(){return this.firstDigit===e.FNC1},e.prototype.isSecondDigitFNC1=function(){return this.secondDigit===e.FNC1},e.prototype.isAnyFNC1=function(){return this.firstDigit===e.FNC1||this.secondDigit===e.FNC1},e.FNC1=10,e}(Io),Ro=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Do=function(){function t(){}return t.parseFieldsInGeneralPurpose=function(e){var r,n,o,i,a,s,u,l;if(!e)return null;if(e.length<2)throw new Gr;var c=e.substring(0,2);try{for(var h=Ro(t.TWO_DIGIT_DATA_LENGTH),f=h.next();!f.done;f=h.next())if((b=f.value)[0]===c)return b[1]===t.VARIABLE_LENGTH?t.processVariableAI(2,b[2],e):t.processFixedAI(2,b[1],e)}catch(C){r={error:C}}finally{try{f&&!f.done&&(n=h.return)&&n.call(h)}finally{if(r)throw r.error}}if(e.length<3)throw new Gr;var d=e.substring(0,3);try{for(var p=Ro(t.THREE_DIGIT_DATA_LENGTH),g=p.next();!g.done;g=p.next())if((b=g.value)[0]===d)return b[1]===t.VARIABLE_LENGTH?t.processVariableAI(3,b[2],e):t.processFixedAI(3,b[1],e)}catch(C){o={error:C}}finally{try{g&&!g.done&&(i=p.return)&&i.call(p)}finally{if(o)throw o.error}}try{for(var m=Ro(t.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH),v=m.next();!v.done;v=m.next())if((b=v.value)[0]===d)return b[1]===t.VARIABLE_LENGTH?t.processVariableAI(4,b[2],e):t.processFixedAI(4,b[1],e)}catch(C){a={error:C}}finally{try{v&&!v.done&&(s=m.return)&&s.call(m)}finally{if(a)throw a.error}}if(e.length<4)throw new Gr;var y=e.substring(0,4);try{for(var _=Ro(t.FOUR_DIGIT_DATA_LENGTH),w=_.next();!w.done;w=_.next()){var b;if((b=w.value)[0]===y)return b[1]===t.VARIABLE_LENGTH?t.processVariableAI(4,b[2],e):t.processFixedAI(4,b[1],e)}}catch(C){u={error:C}}finally{try{w&&!w.done&&(l=_.return)&&l.call(_)}finally{if(u)throw u.error}}throw new Gr},t.processFixedAI=function(e,r,n){if(n.length<e)throw new Gr;var o=n.substring(0,e);if(n.length<e+r)throw new Gr;var i=n.substring(e,e+r),a=n.substring(e+r),s="("+o+")"+i,u=t.parseFieldsInGeneralPurpose(a);return null==u?s:s+u},t.processVariableAI=function(e,r,n){var o,i=n.substring(0,e);o=n.length<e+r?n.length:e+r;var a=n.substring(e,o),s=n.substring(o),u="("+i+")"+a,l=t.parseFieldsInGeneralPurpose(s);return null==l?u:u+l},t.VARIABLE_LENGTH=[],t.TWO_DIGIT_DATA_LENGTH=[["00",18],["01",14],["02",14],["10",t.VARIABLE_LENGTH,20],["11",6],["12",6],["13",6],["15",6],["17",6],["20",2],["21",t.VARIABLE_LENGTH,20],["22",t.VARIABLE_LENGTH,29],["30",t.VARIABLE_LENGTH,8],["37",t.VARIABLE_LENGTH,8],["90",t.VARIABLE_LENGTH,30],["91",t.VARIABLE_LENGTH,30],["92",t.VARIABLE_LENGTH,30],["93",t.VARIABLE_LENGTH,30],["94",t.VARIABLE_LENGTH,30],["95",t.VARIABLE_LENGTH,30],["96",t.VARIABLE_LENGTH,30],["97",t.VARIABLE_LENGTH,3],["98",t.VARIABLE_LENGTH,30],["99",t.VARIABLE_LENGTH,30]],t.THREE_DIGIT_DATA_LENGTH=[["240",t.VARIABLE_LENGTH,30],["241",t.VARIABLE_LENGTH,30],["242",t.VARIABLE_LENGTH,6],["250",t.VARIABLE_LENGTH,30],["251",t.VARIABLE_LENGTH,30],["253",t.VARIABLE_LENGTH,17],["254",t.VARIABLE_LENGTH,20],["400",t.VARIABLE_LENGTH,30],["401",t.VARIABLE_LENGTH,30],["402",17],["403",t.VARIABLE_LENGTH,30],["410",13],["411",13],["412",13],["413",13],["414",13],["420",t.VARIABLE_LENGTH,20],["421",t.VARIABLE_LENGTH,15],["422",3],["423",t.VARIABLE_LENGTH,15],["424",3],["425",3],["426",3]],t.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH=[["310",6],["311",6],["312",6],["313",6],["314",6],["315",6],["316",6],["320",6],["321",6],["322",6],["323",6],["324",6],["325",6],["326",6],["327",6],["328",6],["329",6],["330",6],["331",6],["332",6],["333",6],["334",6],["335",6],["336",6],["340",6],["341",6],["342",6],["343",6],["344",6],["345",6],["346",6],["347",6],["348",6],["349",6],["350",6],["351",6],["352",6],["353",6],["354",6],["355",6],["356",6],["357",6],["360",6],["361",6],["362",6],["363",6],["364",6],["365",6],["366",6],["367",6],["368",6],["369",6],["390",t.VARIABLE_LENGTH,15],["391",t.VARIABLE_LENGTH,18],["392",t.VARIABLE_LENGTH,15],["393",t.VARIABLE_LENGTH,18],["703",t.VARIABLE_LENGTH,30]],t.FOUR_DIGIT_DATA_LENGTH=[["7001",13],["7002",t.VARIABLE_LENGTH,30],["7003",10],["8001",14],["8002",t.VARIABLE_LENGTH,20],["8003",t.VARIABLE_LENGTH,30],["8004",t.VARIABLE_LENGTH,30],["8005",6],["8006",18],["8007",t.VARIABLE_LENGTH,30],["8008",t.VARIABLE_LENGTH,12],["8018",18],["8020",t.VARIABLE_LENGTH,25],["8100",6],["8101",10],["8102",2],["8110",t.VARIABLE_LENGTH,70],["8200",t.VARIABLE_LENGTH,70]],t}(),Po=function(){function t(t){this.buffer=new Hr,this.information=t}return t.prototype.decodeAllCodes=function(t,e){for(var r=e,n=null;;){var o=this.decodeGeneralPurposeField(r,n),i=Do.parseFieldsInGeneralPurpose(o.getNewString());if(null!=i&&t.append(i),n=o.isRemaining()?""+o.getRemainingValue():null,r===o.getNewPosition())break;r=o.getNewPosition()}return t.toString()},t.prototype.isStillNumeric=function(t){if(t+7>this.information.getSize())return t+4<=this.information.getSize();for(var e=t;e<t+3;++e)if(this.information.get(e))return!0;return this.information.get(t+3)},t.prototype.decodeNumeric=function(t){if(t+7>this.information.getSize()){var e=this.extractNumericValueFromBitArray(t,4);return new ko(this.information.getSize(),0===e?ko.FNC1:e-1,ko.FNC1)}var r=this.extractNumericValueFromBitArray(t,7);return new ko(t+7,(r-8)/11,(r-8)%11)},t.prototype.extractNumericValueFromBitArray=function(e,r){return t.extractNumericValueFromBitArray(this.information,e,r)},t.extractNumericValueFromBitArray=function(t,e,r){for(var n=0,o=0;o<r;++o)t.get(e+o)&&(n|=1<<r-o-1);return n},t.prototype.decodeGeneralPurposeField=function(t,e){this.buffer.setLengthToZero(),null!=e&&this.buffer.append(e),this.current.setPosition(t);var r=this.parseBlocks();return null!=r&&r.isRemaining()?new To(this.current.getPosition(),this.buffer.toString(),r.getRemainingValue()):new To(this.current.getPosition(),this.buffer.toString())},t.prototype.parseBlocks=function(){var t,e;do{var r=this.current.getPosition();if(t=this.current.isAlpha()?(e=this.parseAlphaBlock()).isFinished():this.current.isIsoIec646()?(e=this.parseIsoIec646Block()).isFinished():(e=this.parseNumericBlock()).isFinished(),r===this.current.getPosition()&&!t)break}while(!t);return e.getDecodedInformation()},t.prototype.parseNumericBlock=function(){for(;this.isStillNumeric(this.current.getPosition());){var t=this.decodeNumeric(this.current.getPosition());if(this.current.setPosition(t.getNewPosition()),t.isFirstDigitFNC1()){var e=void 0;return e=t.isSecondDigitFNC1()?new To(this.current.getPosition(),this.buffer.toString()):new To(this.current.getPosition(),this.buffer.toString(),t.getSecondDigit()),new Eo(!0,e)}if(this.buffer.append(t.getFirstDigit()),t.isSecondDigitFNC1())return e=new To(this.current.getPosition(),this.buffer.toString()),new Eo(!0,e);this.buffer.append(t.getSecondDigit())}return this.isNumericToAlphaNumericLatch(this.current.getPosition())&&(this.current.setAlpha(),this.current.incrementPosition(4)),new Eo(!1)},t.prototype.parseIsoIec646Block=function(){for(;this.isStillIsoIec646(this.current.getPosition());){var t=this.decodeIsoIec646(this.current.getPosition());if(this.current.setPosition(t.getNewPosition()),t.isFNC1()){var e=new To(this.current.getPosition(),this.buffer.toString());return new Eo(!0,e)}this.buffer.append(t.getValue())}return this.isAlphaOr646ToNumericLatch(this.current.getPosition())?(this.current.incrementPosition(3),this.current.setNumeric()):this.isAlphaTo646ToAlphaLatch(this.current.getPosition())&&(this.current.getPosition()+5<this.information.getSize()?this.current.incrementPosition(5):this.current.setPosition(this.information.getSize()),this.current.setAlpha()),new Eo(!1)},t.prototype.parseAlphaBlock=function(){for(;this.isStillAlpha(this.current.getPosition());){var t=this.decodeAlphanumeric(this.current.getPosition());if(this.current.setPosition(t.getNewPosition()),t.isFNC1()){var e=new To(this.current.getPosition(),this.buffer.toString());return new Eo(!0,e)}this.buffer.append(t.getValue())}return this.isAlphaOr646ToNumericLatch(this.current.getPosition())?(this.current.incrementPosition(3),this.current.setNumeric()):this.isAlphaTo646ToAlphaLatch(this.current.getPosition())&&(this.current.getPosition()+5<this.information.getSize()?this.current.incrementPosition(5):this.current.setPosition(this.information.getSize()),this.current.setIsoIec646()),new Eo(!1)},t.prototype.isStillIsoIec646=function(t){if(t+5>this.information.getSize())return!1;var e=this.extractNumericValueFromBitArray(t,5);if(e>=5&&e<16)return!0;if(t+7>this.information.getSize())return!1;var r=this.extractNumericValueFromBitArray(t,7);if(r>=64&&r<116)return!0;if(t+8>this.information.getSize())return!1;var n=this.extractNumericValueFromBitArray(t,8);return n>=232&&n<253},t.prototype.decodeIsoIec646=function(t){var e=this.extractNumericValueFromBitArray(t,5);if(15===e)return new xo(t+5,xo.FNC1);if(e>=5&&e<15)return new xo(t+5,"0"+(e-5));var r,n=this.extractNumericValueFromBitArray(t,7);if(n>=64&&n<90)return new xo(t+7,""+(n+1));if(n>=90&&n<116)return new xo(t+7,""+(n+7));switch(this.extractNumericValueFromBitArray(t,8)){case 232:r="!";break;case 233:r='"';break;case 234:r="%";break;case 235:r="&";break;case 236:r="'";break;case 237:r="(";break;case 238:r=")";break;case 239:r="*";break;case 240:r="+";break;case 241:r=",";break;case 242:r="-";break;case 243:r=".";break;case 244:r="/";break;case 245:r=":";break;case 246:r=";";break;case 247:r="<";break;case 248:r="=";break;case 249:r=">";break;case 250:r="?";break;case 251:r="_";break;case 252:r=" ";break;default:throw new Mr}return new xo(t+8,r)},t.prototype.isStillAlpha=function(t){if(t+5>this.information.getSize())return!1;var e=this.extractNumericValueFromBitArray(t,5);if(e>=5&&e<16)return!0;if(t+6>this.information.getSize())return!1;var r=this.extractNumericValueFromBitArray(t,6);return r>=16&&r<63},t.prototype.decodeAlphanumeric=function(t){var e=this.extractNumericValueFromBitArray(t,5);if(15===e)return new xo(t+5,xo.FNC1);if(e>=5&&e<15)return new xo(t+5,"0"+(e-5));var r,n=this.extractNumericValueFromBitArray(t,6);if(n>=32&&n<58)return new xo(t+6,""+(n+33));switch(n){case 58:r="*";break;case 59:r=",";break;case 60:r="-";break;case 61:r=".";break;case 62:r="/";break;default:throw new bn("Decoding invalid alphanumeric value: "+n)}return new xo(t+6,r)},t.prototype.isAlphaTo646ToAlphaLatch=function(t){if(t+1>this.information.getSize())return!1;for(var e=0;e<5&&e+t<this.information.getSize();++e)if(2===e){if(!this.information.get(t+2))return!1}else if(this.information.get(t+e))return!1;return!0},t.prototype.isAlphaOr646ToNumericLatch=function(t){if(t+3>this.information.getSize())return!1;for(var e=t;e<t+3;++e)if(this.information.get(e))return!1;return!0},t.prototype.isNumericToAlphaNumericLatch=function(t){if(t+1>this.information.getSize())return!1;for(var e=0;e<4&&e+t<this.information.getSize();++e)if(this.information.get(t+e))return!1;return!0},t}(),Mo=function(){function t(t){this.information=t,this.generalDecoder=new Po(t)}return t.prototype.getInformation=function(){return this.information},t.prototype.getGeneralDecoder=function(){return this.generalDecoder},t}(),Bo=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Lo=function(t){function e(e){return t.call(this,e)||this}return Bo(e,t),e.prototype.encodeCompressedGtin=function(t,e){t.append("(01)");var r=t.length();t.append("9"),this.encodeCompressedGtinWithoutAI(t,e,r)},e.prototype.encodeCompressedGtinWithoutAI=function(t,r,n){for(var o=0;o<4;++o){var i=this.getGeneralDecoder().extractNumericValueFromBitArray(r+10*o,10);i/100==0&&t.append("0"),i/10==0&&t.append("0"),t.append(i)}e.appendCheckDigit(t,n)},e.appendCheckDigit=function(t,e){for(var r=0,n=0;n<13;n++){var o=t.charAt(n+e).charCodeAt(0)-"0".charCodeAt(0);r+=1&n?o:3*o}10==(r=10-r%10)&&(r=0),t.append(r)},e.GTIN_SIZE=40,e}(Mo),Fo=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),jo=function(t){function e(e){return t.call(this,e)||this}return Fo(e,t),e.prototype.parseInformation=function(){var t=new Hr;t.append("(01)");var r=t.length(),n=this.getGeneralDecoder().extractNumericValueFromBitArray(e.HEADER_SIZE,4);return t.append(n),this.encodeCompressedGtinWithoutAI(t,e.HEADER_SIZE+4,r),this.getGeneralDecoder().decodeAllCodes(t,e.HEADER_SIZE+44)},e.HEADER_SIZE=4,e}(Lo),Vo=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Uo=function(t){function e(e){return t.call(this,e)||this}return Vo(e,t),e.prototype.parseInformation=function(){var t=new Hr;return this.getGeneralDecoder().decodeAllCodes(t,e.HEADER_SIZE)},e.HEADER_SIZE=5,e}(Mo),Ho=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),zo=function(t){function e(e){return t.call(this,e)||this}return Ho(e,t),e.prototype.encodeCompressedWeight=function(t,e,r){var n=this.getGeneralDecoder().extractNumericValueFromBitArray(e,r);this.addWeightCode(t,n);for(var o=this.checkWeight(n),i=1e5,a=0;a<5;++a)o/i==0&&t.append("0"),i/=10;t.append(o)},e}(Lo),Wo=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Go=function(t){function e(e){return t.call(this,e)||this}return Wo(e,t),e.prototype.parseInformation=function(){if(this.getInformation().getSize()!=e.HEADER_SIZE+zo.GTIN_SIZE+e.WEIGHT_SIZE)throw new Gr;var t=new Hr;return this.encodeCompressedGtin(t,e.HEADER_SIZE),this.encodeCompressedWeight(t,e.HEADER_SIZE+zo.GTIN_SIZE,e.WEIGHT_SIZE),t.toString()},e.HEADER_SIZE=5,e.WEIGHT_SIZE=15,e}(zo),Xo=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),$o=function(t){function e(e){return t.call(this,e)||this}return Xo(e,t),e.prototype.addWeightCode=function(t,e){t.append("(3103)")},e.prototype.checkWeight=function(t){return t},e}(Go),Yo=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),qo=function(t){function e(e){return t.call(this,e)||this}return Yo(e,t),e.prototype.addWeightCode=function(t,e){e<1e4?t.append("(3202)"):t.append("(3203)")},e.prototype.checkWeight=function(t){return t<1e4?t:t-1e4},e}(Go),Ko=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Zo=function(t){function e(e){return t.call(this,e)||this}return Ko(e,t),e.prototype.parseInformation=function(){if(this.getInformation().getSize()<e.HEADER_SIZE+Lo.GTIN_SIZE)throw new Gr;var t=new Hr;this.encodeCompressedGtin(t,e.HEADER_SIZE);var r=this.getGeneralDecoder().extractNumericValueFromBitArray(e.HEADER_SIZE+Lo.GTIN_SIZE,e.LAST_DIGIT_SIZE);t.append("(392"),t.append(r),t.append(")");var n=this.getGeneralDecoder().decodeGeneralPurposeField(e.HEADER_SIZE+Lo.GTIN_SIZE+e.LAST_DIGIT_SIZE,null);return t.append(n.getNewString()),t.toString()},e.HEADER_SIZE=8,e.LAST_DIGIT_SIZE=2,e}(Lo),Qo=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Jo=function(t){function e(e){return t.call(this,e)||this}return Qo(e,t),e.prototype.parseInformation=function(){if(this.getInformation().getSize()<e.HEADER_SIZE+Lo.GTIN_SIZE)throw new Gr;var t=new Hr;this.encodeCompressedGtin(t,e.HEADER_SIZE);var r=this.getGeneralDecoder().extractNumericValueFromBitArray(e.HEADER_SIZE+Lo.GTIN_SIZE,e.LAST_DIGIT_SIZE);t.append("(393"),t.append(r),t.append(")");var n=this.getGeneralDecoder().extractNumericValueFromBitArray(e.HEADER_SIZE+Lo.GTIN_SIZE+e.LAST_DIGIT_SIZE,e.FIRST_THREE_DIGITS_SIZE);n/100==0&&t.append("0"),n/10==0&&t.append("0"),t.append(n);var o=this.getGeneralDecoder().decodeGeneralPurposeField(e.HEADER_SIZE+Lo.GTIN_SIZE+e.LAST_DIGIT_SIZE+e.FIRST_THREE_DIGITS_SIZE,null);return t.append(o.getNewString()),t.toString()},e.HEADER_SIZE=8,e.LAST_DIGIT_SIZE=2,e.FIRST_THREE_DIGITS_SIZE=10,e}(Lo),ti=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ei=function(t){function e(e,r,n){var o=t.call(this,e)||this;return o.dateCode=n,o.firstAIdigits=r,o}return ti(e,t),e.prototype.parseInformation=function(){if(this.getInformation().getSize()!=e.HEADER_SIZE+e.GTIN_SIZE+e.WEIGHT_SIZE+e.DATE_SIZE)throw new Gr;var t=new Hr;return this.encodeCompressedGtin(t,e.HEADER_SIZE),this.encodeCompressedWeight(t,e.HEADER_SIZE+e.GTIN_SIZE,e.WEIGHT_SIZE),this.encodeCompressedDate(t,e.HEADER_SIZE+e.GTIN_SIZE+e.WEIGHT_SIZE),t.toString()},e.prototype.encodeCompressedDate=function(t,r){var n=this.getGeneralDecoder().extractNumericValueFromBitArray(r,e.DATE_SIZE);if(38400!=n){t.append("("),t.append(this.dateCode),t.append(")");var o=n%32,i=(n/=32)%12+1,a=n/=12;a/10==0&&t.append("0"),t.append(a),i/10==0&&t.append("0"),t.append(i),o/10==0&&t.append("0"),t.append(o)}},e.prototype.addWeightCode=function(t,e){t.append("("),t.append(this.firstAIdigits),t.append(e/1e5),t.append(")")},e.prototype.checkWeight=function(t){return t%1e5},e.HEADER_SIZE=8,e.WEIGHT_SIZE=20,e.DATE_SIZE=16,e}(zo),ri=function(){function t(t,e,r,n){this.leftchar=t,this.rightchar=e,this.finderpattern=r,this.maybeLast=n}return t.prototype.mayBeLast=function(){return this.maybeLast},t.prototype.getLeftChar=function(){return this.leftchar},t.prototype.getRightChar=function(){return this.rightchar},t.prototype.getFinderPattern=function(){return this.finderpattern},t.prototype.mustBeLast=function(){return null==this.rightchar},t.prototype.toString=function(){return"[ "+this.leftchar+", "+this.rightchar+" : "+(null==this.finderpattern?"null":this.finderpattern.getValue())+" ]"},t.equals=function(e,r){return e instanceof t&&t.equalsOrNull(e.leftchar,r.leftchar)&&t.equalsOrNull(e.rightchar,r.rightchar)&&t.equalsOrNull(e.finderpattern,r.finderpattern)},t.equalsOrNull=function(e,r){return null===e?null===r:t.equals(e,r)},t.prototype.hashCode=function(){return this.leftchar.getValue()^this.rightchar.getValue()^this.finderpattern.getValue()},t}(),ni=function(){function t(t,e,r){this.pairs=t,this.rowNumber=e,this.wasReversed=r}return t.prototype.getPairs=function(){return this.pairs},t.prototype.getRowNumber=function(){return this.rowNumber},t.prototype.isReversed=function(){return this.wasReversed},t.prototype.isEquivalent=function(t){return this.checkEqualitity(this,t)},t.prototype.toString=function(){return"{ "+this.pairs+" }"},t.prototype.equals=function(e,r){return e instanceof t&&this.checkEqualitity(e,r)&&e.wasReversed===r.wasReversed},t.prototype.checkEqualitity=function(t,e){var r;if(t&&e)return t.forEach(function(t,n){e.forEach(function(e){t.getLeftChar().getValue()===e.getLeftChar().getValue()&&t.getRightChar().getValue()===e.getRightChar().getValue()&&t.getFinderPatter().getValue()===e.getFinderPatter().getValue()&&(r=!0)})}),r},t}(),oi=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ii=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},ai=function(t){function e(){var r=null!==t&&t.apply(this,arguments)||this;return r.pairs=new Array(e.MAX_PAIRS),r.rows=new Array,r.startEnd=[2],r}return oi(e,t),e.prototype.decodeRow=function(t,r,n){this.pairs.length=0,this.startFromEven=!1;try{return e.constructResult(this.decodeRow2pairs(t,r))}catch(o){}return this.pairs.length=0,this.startFromEven=!0,e.constructResult(this.decodeRow2pairs(t,r))},e.prototype.reset=function(){this.pairs.length=0,this.rows.length=0},e.prototype.decodeRow2pairs=function(t,e){for(var r,n=!1;!n;)try{this.pairs.push(this.retrieveNextPair(e,this.pairs,t))}catch(i){if(i instanceof Gr){if(!this.pairs.length)throw new Gr;n=!0}}if(this.checkChecksum())return this.pairs;if(r=!!this.rows.length,this.storeRow(t,!1),r){var o=this.checkRowsBoolean(!1);if(null!=o)return o;if(null!=(o=this.checkRowsBoolean(!0)))return o}throw new Gr},e.prototype.checkRowsBoolean=function(t){if(this.rows.length>25)return this.rows.length=0,null;this.pairs.length=0,t&&(this.rows=this.rows.reverse());var e=null;try{e=this.checkRows(new Array,0)}catch(r){console.log(r)}return t&&(this.rows=this.rows.reverse()),e},e.prototype.checkRows=function(t,r){for(var n,o,i=r;i<this.rows.length;i++){var a=this.rows[i];this.pairs.length=0;try{for(var s=(n=void 0,ii(t)),u=s.next();!u.done;u=s.next()){var l=u.value;this.pairs.push(l.getPairs())}}catch(h){n={error:h}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(n)throw n.error}}if(this.pairs.push(a.getPairs()),e.isValidSequence(this.pairs)){if(this.checkChecksum())return this.pairs;var c=new Array(t);c.push(a);try{return this.checkRows(c,i+1)}catch(h){console.log(h)}}}throw new Gr},e.isValidSequence=function(t){var r,n;try{for(var o=ii(e.FINDER_PATTERN_SEQUENCES),i=o.next();!i.done;i=o.next()){var a=i.value;if(!(t.length>a.length)){for(var s=!0,u=0;u<t.length;u++)if(t[u].getFinderPattern().getValue()!=a[u]){s=!1;break}if(s)return!0}}}catch(l){r={error:l}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return!1},e.prototype.storeRow=function(t,r){for(var n=0,o=!1,i=!1;n<this.rows.length;){var a=this.rows[n];if(a.getRowNumber()>t){i=a.isEquivalent(this.pairs);break}o=a.isEquivalent(this.pairs),n++}i||o||e.isPartialRow(this.pairs,this.rows)||(this.rows.push(n,new ni(this.pairs,t,r)),this.removePartialRows(this.pairs,this.rows))},e.prototype.removePartialRows=function(t,e){var r,n,o,i,a,s;try{for(var u=ii(e),l=u.next();!l.done;l=u.next()){var c=l.value;if(c.getPairs().length!==t.length)try{for(var h=(o=void 0,ii(c.getPairs())),f=h.next();!f.done;f=h.next()){var d=f.value;try{for(var p=(a=void 0,ii(t)),g=p.next();!g.done;g=p.next()){var m=g.value;if(ri.equals(d,m)){0;break}}}catch(v){a={error:v}}finally{try{g&&!g.done&&(s=p.return)&&s.call(p)}finally{if(a)throw a.error}}}}catch(v){o={error:v}}finally{try{f&&!f.done&&(i=h.return)&&i.call(h)}finally{if(o)throw o.error}}}}catch(v){r={error:v}}finally{try{l&&!l.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}},e.isPartialRow=function(t,e){var r,n,o,i,a,s;try{for(var u=ii(e),l=u.next();!l.done;l=u.next()){var c=l.value,h=!0;try{for(var f=(o=void 0,ii(t)),d=f.next();!d.done;d=f.next()){var p=d.value,g=!1;try{for(var m=(a=void 0,ii(c.getPairs())),v=m.next();!v.done;v=m.next()){var y=v.value;if(p.equals(y)){g=!0;break}}}catch(_){a={error:_}}finally{try{v&&!v.done&&(s=m.return)&&s.call(m)}finally{if(a)throw a.error}}if(!g){h=!1;break}}}catch(_){o={error:_}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}if(h)return!0}}catch(_){r={error:_}}finally{try{l&&!l.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}return!1},e.prototype.getRows=function(){return this.rows},e.constructResult=function(t){var e=function(t){try{if(t.get(1))return new jo(t);if(!t.get(2))return new Uo(t);switch(Po.extractNumericValueFromBitArray(t,1,4)){case 4:return new $o(t);case 5:return new qo(t)}switch(Po.extractNumericValueFromBitArray(t,1,5)){case 12:return new Zo(t);case 13:return new Jo(t)}switch(Po.extractNumericValueFromBitArray(t,1,7)){case 56:return new ei(t,"310","11");case 57:return new ei(t,"320","11");case 58:return new ei(t,"310","13");case 59:return new ei(t,"320","13");case 60:return new ei(t,"310","15");case 61:return new ei(t,"320","15");case 62:return new ei(t,"310","17");case 63:return new ei(t,"320","17")}}catch(e){throw console.log(e),new bn("unknown decoder: "+t)}}(Ao.buildBitArray(t)).parseInformation(),r=t[0].getFinderPattern().getResultPoints(),n=t[t.length-1].getFinderPattern().getResultPoints(),o=[r[0],r[1],n[0],n[1]];return new an(e,null,null,o,un.RSS_EXPANDED,null)},e.prototype.checkChecksum=function(){var t=this.pairs.get(0),e=t.getLeftChar(),r=t.getRightChar();if(null==r)return!1;for(var n=r.getChecksumPortion(),o=2,i=1;i<this.pairs.size();++i){var a=this.pairs.get(i);n+=a.getLeftChar().getChecksumPortion(),o++;var s=a.getRightChar();null!=s&&(n+=s.getChecksumPortion(),o++)}return 211*(o-4)+(n%=211)==e.getValue()},e.getNextSecondBar=function(t,e){var r;return t.get(e)?(r=t.getNextUnset(e),r=t.getNextSet(r)):(r=t.getNextSet(e),r=t.getNextUnset(r)),r},e.prototype.retrieveNextPair=function(t,r,n){var o,i=r.length%2==0;this.startFromEven&&(i=!i);var a=!0,s=-1;do{this.findNextPair(t,r,s),null==(o=this.parseFoundFinderPattern(t,n,i))?s=e.getNextSecondBar(t,this.startEnd[0]):a=!1}while(a);var u,l=this.decodeDataCharacter(t,o,i,!0);if(!this.isEmptyPair(r)&&r[r.length-1].mustBeLast())throw new Gr;try{u=this.decodeDataCharacter(t,o,i,!1)}catch(c){u=null,console.log(c)}return new ri(l,u,o,!0)},e.prototype.isEmptyPair=function(t){return 0===t.length},e.prototype.findNextPair=function(t,r,n){var o=this.getDecodeFinderCounters();o[0]=0,o[1]=0,o[2]=0,o[3]=0;var i,a=t.getSize();i=n>=0?n:this.isEmptyPair(r)?0:r[r.length-1].getFinderPattern().getStartEnd()[1];var s=r.length%2!=0;this.startFromEven&&(s=!s);for(var u=!1;i<a&&(u=!t.get(i));)i++;for(var l=0,c=i,h=i;h<a;h++)if(t.get(h)!=u)o[l]++;else{if(3==l){if(s&&e.reverseCounters(o),e.isFinderPattern(o))return this.startEnd[0]=c,void(this.startEnd[1]=h);s&&e.reverseCounters(o),c+=o[0]+o[1],o[0]=o[2],o[1]=o[3],o[2]=0,o[3]=0,l--}else l++;o[l]=1,u=!u}throw new Gr},e.reverseCounters=function(t){for(var e=t.length,r=0;r<e/2;++r){var n=t[r];t[r]=t[e-r-1],t[e-r-1]=n}},e.prototype.parseFoundFinderPattern=function(t,r,n){var o,i,a;if(n){for(var s=this.startEnd[0]-1;s>=0&&!t.get(s);)s--;s++,o=this.startEnd[0]-s,i=s,a=this.startEnd[1]}else i=this.startEnd[0],o=(a=t.getNextUnset(this.startEnd[1]+1))-this.startEnd[1];var u,l=this.getDecodeFinderCounters();Er.arraycopy(l,0,l,1,l.length-1),l[0]=o;try{u=this.parseFinderValue(l,e.FINDER_PATTERNS)}catch(c){return null}return new bo(u,[i,a],i,a,r)},e.prototype.decodeDataCharacter=function(t,r,n,o){for(var i=this.getDataCharacterCounters(),a=0;a<i.length;a++)i[a]=0;if(o)e.recordPatternInReverse(t,r.getStartEnd()[0],i);else{e.recordPattern(t,r.getStartEnd()[1],i);for(var s=0,u=i.length-1;s<u;s++,u--){var l=i[s];i[s]=i[u],i[u]=l}}var c=En.sum(new Int32Array(i))/17,h=(r.getStartEnd()[1]-r.getStartEnd()[0])/15;if(Math.abs(c-h)/h>.3)throw new Gr;var f=this.getOddCounts(),d=this.getEvenCounts(),p=this.getOddRoundingErrors(),g=this.getEvenRoundingErrors();for(s=0;s<i.length;s++){var m=1*i[s]/c,v=m+.5;if(v<1){if(m<.3)throw new Gr;v=1}else if(v>8){if(m>8.7)throw new Gr;v=8}var y=s/2;1&s?(d[y]=v,g[y]=m-v):(f[y]=v,p[y]=m-v)}this.adjustOddEvenCounts(17);var _=4*r.getValue()+(n?0:2)+(o?0:1)-1,w=0,b=0;for(s=f.length-1;s>=0;s--){if(e.isNotA1left(r,n,o)){var C=e.WEIGHTS[_][2*s];b+=f[s]*C}w+=f[s]}var A=0;for(s=d.length-1;s>=0;s--)e.isNotA1left(r,n,o)&&(C=e.WEIGHTS[_][2*s+1],A+=d[s]*C);var E=b+A;if(1&w||w>13||w<4)throw new Gr;var I=(13-w)/2,S=e.SYMBOL_WIDEST[I],x=9-S,O=Co.getRSSvalue(f,S,!0),T=Co.getRSSvalue(d,x,!1),N=e.EVEN_TOTAL_SUBSET[I],k=e.GSUM[I];return new wo(O*N+T+k,E)},e.isNotA1left=function(t,e,r){return!(0==t.getValue()&&e&&r)},e.prototype.adjustOddEvenCounts=function(t){var r=En.sum(new Int32Array(this.getOddCounts())),n=En.sum(new Int32Array(this.getEvenCounts())),o=!1,i=!1;r>13?i=!0:r<4&&(o=!0);var a=!1,s=!1;n>13?s=!0:n<4&&(a=!0);var u=r+n-t,l=!(1&~r),c=!(1&n);if(1==u)if(l){if(c)throw new Gr;i=!0}else{if(!c)throw new Gr;s=!0}else if(-1==u)if(l){if(c)throw new Gr;o=!0}else{if(!c)throw new Gr;a=!0}else{if(0!=u)throw new Gr;if(l){if(!c)throw new Gr;r<n?(o=!0,s=!0):(i=!0,a=!0)}else if(c)throw new Gr}if(o){if(i)throw new Gr;e.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(i&&e.decrement(this.getOddCounts(),this.getOddRoundingErrors()),a){if(s)throw new Gr;e.increment(this.getEvenCounts(),this.getOddRoundingErrors())}s&&e.decrement(this.getEvenCounts(),this.getEvenRoundingErrors())},e.SYMBOL_WIDEST=[7,5,4,3,1],e.EVEN_TOTAL_SUBSET=[4,20,52,104,204],e.GSUM=[0,348,1388,2948,3988],e.FINDER_PATTERNS=[Int32Array.from([1,8,4,1]),Int32Array.from([3,6,4,1]),Int32Array.from([3,4,6,1]),Int32Array.from([3,2,8,1]),Int32Array.from([2,6,5,1]),Int32Array.from([2,2,9,1])],e.WEIGHTS=[[1,3,9,27,81,32,96,77],[20,60,180,118,143,7,21,63],[189,145,13,39,117,140,209,205],[193,157,49,147,19,57,171,91],[62,186,136,197,169,85,44,132],[185,133,188,142,4,12,36,108],[113,128,173,97,80,29,87,50],[150,28,84,41,123,158,52,156],[46,138,203,187,139,206,196,166],[76,17,51,153,37,111,122,155],[43,129,176,106,107,110,119,146],[16,48,144,10,30,90,59,177],[109,116,137,200,178,112,125,164],[70,210,208,202,184,130,179,115],[134,191,151,31,93,68,204,190],[148,22,66,198,172,94,71,2],[6,18,54,162,64,192,154,40],[120,149,25,75,14,42,126,167],[79,26,78,23,69,207,199,175],[103,98,83,38,114,131,182,124],[161,61,183,127,170,88,53,159],[55,165,73,8,24,72,5,15],[45,135,194,160,58,174,100,89]],e.FINDER_PAT_A=0,e.FINDER_PAT_B=1,e.FINDER_PAT_C=2,e.FINDER_PAT_D=3,e.FINDER_PAT_E=4,e.FINDER_PAT_F=5,e.FINDER_PATTERN_SEQUENCES=[[e.FINDER_PAT_A,e.FINDER_PAT_A],[e.FINDER_PAT_A,e.FINDER_PAT_B,e.FINDER_PAT_B],[e.FINDER_PAT_A,e.FINDER_PAT_C,e.FINDER_PAT_B,e.FINDER_PAT_D],[e.FINDER_PAT_A,e.FINDER_PAT_E,e.FINDER_PAT_B,e.FINDER_PAT_D,e.FINDER_PAT_C],[e.FINDER_PAT_A,e.FINDER_PAT_E,e.FINDER_PAT_B,e.FINDER_PAT_D,e.FINDER_PAT_D,e.FINDER_PAT_F],[e.FINDER_PAT_A,e.FINDER_PAT_E,e.FINDER_PAT_B,e.FINDER_PAT_D,e.FINDER_PAT_E,e.FINDER_PAT_F,e.FINDER_PAT_F],[e.FINDER_PAT_A,e.FINDER_PAT_A,e.FINDER_PAT_B,e.FINDER_PAT_B,e.FINDER_PAT_C,e.FINDER_PAT_C,e.FINDER_PAT_D,e.FINDER_PAT_D],[e.FINDER_PAT_A,e.FINDER_PAT_A,e.FINDER_PAT_B,e.FINDER_PAT_B,e.FINDER_PAT_C,e.FINDER_PAT_C,e.FINDER_PAT_D,e.FINDER_PAT_E,e.FINDER_PAT_E],[e.FINDER_PAT_A,e.FINDER_PAT_A,e.FINDER_PAT_B,e.FINDER_PAT_B,e.FINDER_PAT_C,e.FINDER_PAT_C,e.FINDER_PAT_D,e.FINDER_PAT_E,e.FINDER_PAT_F,e.FINDER_PAT_F],[e.FINDER_PAT_A,e.FINDER_PAT_A,e.FINDER_PAT_B,e.FINDER_PAT_B,e.FINDER_PAT_C,e.FINDER_PAT_D,e.FINDER_PAT_D,e.FINDER_PAT_E,e.FINDER_PAT_E,e.FINDER_PAT_F,e.FINDER_PAT_F]],e.MAX_PAIRS=11,e}(_o),si=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ui=function(t){function e(e,r,n){var o=t.call(this,e,r)||this;return o.count=0,o.finderPattern=n,o}return si(e,t),e.prototype.getFinderPattern=function(){return this.finderPattern},e.prototype.getCount=function(){return this.count},e.prototype.incrementCount=function(){this.count++},e}(wo),li=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ci=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},hi=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.possibleLeftPairs=[],e.possibleRightPairs=[],e}return li(e,t),e.prototype.decodeRow=function(t,r,n){var o,i,a,s,u=this.decodePair(r,!1,t,n);e.addOrTally(this.possibleLeftPairs,u),r.reverse();var l=this.decodePair(r,!0,t,n);e.addOrTally(this.possibleRightPairs,l),r.reverse();try{for(var c=ci(this.possibleLeftPairs),h=c.next();!h.done;h=c.next()){var f=h.value;if(f.getCount()>1)try{for(var d=(a=void 0,ci(this.possibleRightPairs)),p=d.next();!p.done;p=d.next()){var g=p.value;if(g.getCount()>1&&e.checkChecksum(f,g))return e.constructResult(f,g)}}catch(m){a={error:m}}finally{try{p&&!p.done&&(s=d.return)&&s.call(d)}finally{if(a)throw a.error}}}}catch(m){o={error:m}}finally{try{h&&!h.done&&(i=c.return)&&i.call(c)}finally{if(o)throw o.error}}throw new Gr},e.addOrTally=function(t,e){var r,n;if(null!=e){var o=!1;try{for(var i=ci(t),a=i.next();!a.done;a=i.next()){var s=a.value;if(s.getValue()===e.getValue()){s.incrementCount(),o=!0;break}}}catch(u){r={error:u}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}o||t.push(e)}},e.prototype.reset=function(){this.possibleLeftPairs.length=0,this.possibleRightPairs.length=0},e.constructResult=function(t,e){for(var r=4537077*t.getValue()+e.getValue(),n=new String(r).toString(),o=new Hr,i=13-n.length;i>0;i--)o.append("0");o.append(n);var a=0;for(i=0;i<13;i++){var s=o.charAt(i).charCodeAt(0)-"0".charCodeAt(0);a+=1&i?s:3*s}10==(a=10-a%10)&&(a=0),o.append(a.toString());var u=t.getFinderPattern().getResultPoints(),l=e.getFinderPattern().getResultPoints();return new an(o.toString(),null,0,[u[0],u[1],l[0],l[1]],un.RSS_14,(new Date).getTime())},e.checkChecksum=function(t,e){var r=(t.getChecksumPortion()+16*e.getChecksumPortion())%79,n=9*t.getFinderPattern().getValue()+e.getFinderPattern().getValue();return n>72&&n--,n>8&&n--,r===n},e.prototype.decodePair=function(t,e,r,n){try{var o=this.findFinderPattern(t,e),i=this.parseFoundFinderPattern(t,r,e,o),a=null==n?null:n.get(Dr.NEED_RESULT_POINT_CALLBACK);if(null!=a){var s=(o[0]+o[1])/2;e&&(s=t.getSize()-1-s),a.foundPossibleResultPoint(new Sn(s,r))}var u=this.decodeDataCharacter(t,i,!0),l=this.decodeDataCharacter(t,i,!1);return new ui(1597*u.getValue()+l.getValue(),u.getChecksumPortion()+4*l.getChecksumPortion(),i)}catch(c){return null}},e.prototype.decodeDataCharacter=function(t,r,n){for(var o=this.getDataCharacterCounters(),i=0;i<o.length;i++)o[i]=0;if(n)Vn.recordPatternInReverse(t,r.getStartEnd()[0],o);else{Vn.recordPattern(t,r.getStartEnd()[1]+1,o);for(var a=0,s=o.length-1;a<s;a++,s--){var u=o[a];o[a]=o[s],o[s]=u}}var l=n?16:15,c=En.sum(new Int32Array(o))/l,h=this.getOddCounts(),f=this.getEvenCounts(),d=this.getOddRoundingErrors(),p=this.getEvenRoundingErrors();for(a=0;a<o.length;a++){var g=o[a]/c,m=Math.floor(g+.5);m<1?m=1:m>8&&(m=8);var v=Math.floor(a/2);1&a?(f[v]=m,p[v]=g-m):(h[v]=m,d[v]=g-m)}this.adjustOddEvenCounts(n,l);var y=0,_=0;for(a=h.length-1;a>=0;a--)_*=9,_+=h[a],y+=h[a];var w=0,b=0;for(a=f.length-1;a>=0;a--)w*=9,w+=f[a],b+=f[a];var C=_+3*w;if(n){if(1&y||y>12||y<4)throw new Gr;var A=(12-y)/2,E=9-(T=e.OUTSIDE_ODD_WIDEST[A]),I=Co.getRSSvalue(h,T,!1),S=Co.getRSSvalue(f,E,!0),x=e.OUTSIDE_EVEN_TOTAL_SUBSET[A],O=e.OUTSIDE_GSUM[A];return new wo(I*x+S+O,C)}if(1&b||b>10||b<4)throw new Gr;A=(10-b)/2,E=9-(T=e.INSIDE_ODD_WIDEST[A]),I=Co.getRSSvalue(h,T,!0),S=Co.getRSSvalue(f,E,!1);var T,N=e.INSIDE_ODD_TOTAL_SUBSET[A];return O=e.INSIDE_GSUM[A],new wo(S*N+I+O,C)},e.prototype.findFinderPattern=function(t,e){var r=this.getDecodeFinderCounters();r[0]=0,r[1]=0,r[2]=0,r[3]=0;for(var n=t.getSize(),o=!1,i=0;i<n&&e!==(o=!t.get(i));)i++;for(var a=0,s=i,u=i;u<n;u++)if(t.get(u)!==o)r[a]++;else{if(3===a){if(_o.isFinderPattern(r))return[s,u];s+=r[0]+r[1],r[0]=r[2],r[1]=r[3],r[2]=0,r[3]=0,a--}else a++;r[a]=1,o=!o}throw new Gr},e.prototype.parseFoundFinderPattern=function(t,r,n,o){for(var i=t.get(o[0]),a=o[0]-1;a>=0&&i!==t.get(a);)a--;a++;var s=o[0]-a,u=this.getDecodeFinderCounters(),l=new Int32Array(u.length);Er.arraycopy(u,0,l,1,u.length-1),l[0]=s;var c=this.parseFinderValue(l,e.FINDER_PATTERNS),h=a,f=o[1];return n&&(h=t.getSize()-1-h,f=t.getSize()-1-f),new bo(c,[a,o[1]],h,f,r)},e.prototype.adjustOddEvenCounts=function(t,e){var r=En.sum(new Int32Array(this.getOddCounts())),n=En.sum(new Int32Array(this.getEvenCounts())),o=!1,i=!1,a=!1,s=!1;t?(r>12?i=!0:r<4&&(o=!0),n>12?s=!0:n<4&&(a=!0)):(r>11?i=!0:r<5&&(o=!0),n>10?s=!0:n<4&&(a=!0));var u=r+n-e,l=(1&r)==(t?1:0),c=!(1&~n);if(1===u)if(l){if(c)throw new Gr;i=!0}else{if(!c)throw new Gr;s=!0}else if(-1===u)if(l){if(c)throw new Gr;o=!0}else{if(!c)throw new Gr;a=!0}else{if(0!==u)throw new Gr;if(l){if(!c)throw new Gr;r<n?(o=!0,s=!0):(i=!0,a=!0)}else if(c)throw new Gr}if(o){if(i)throw new Gr;_o.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(i&&_o.decrement(this.getOddCounts(),this.getOddRoundingErrors()),a){if(s)throw new Gr;_o.increment(this.getEvenCounts(),this.getOddRoundingErrors())}s&&_o.decrement(this.getEvenCounts(),this.getEvenRoundingErrors())},e.OUTSIDE_EVEN_TOTAL_SUBSET=[1,10,34,70,126],e.INSIDE_ODD_TOTAL_SUBSET=[4,20,48,81],e.OUTSIDE_GSUM=[0,161,961,2015,2715],e.INSIDE_GSUM=[0,336,1036,1516],e.OUTSIDE_ODD_WIDEST=[8,6,4,3,1],e.INSIDE_ODD_WIDEST=[2,4,6,8],e.FINDER_PATTERNS=[Int32Array.from([3,8,2,1]),Int32Array.from([3,5,5,1]),Int32Array.from([3,3,7,1]),Int32Array.from([3,1,9,1]),Int32Array.from([2,7,4,1]),Int32Array.from([2,5,6,1]),Int32Array.from([2,3,8,1]),Int32Array.from([1,5,7,1]),Int32Array.from([1,3,9,1])],e}(_o),fi=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),di=function(t){function e(e){var r=t.call(this)||this;r.readers=[];var n=e?e.get(Dr.POSSIBLE_FORMATS):null,o=e&&void 0!==e.get(Dr.ASSUME_CODE_39_CHECK_DIGIT);return n&&((n.includes(un.EAN_13)||n.includes(un.UPC_A)||n.includes(un.EAN_8)||n.includes(un.UPC_E))&&r.readers.push(new vo(e)),n.includes(un.CODE_39)&&r.readers.push(new Gn(o)),n.includes(un.CODE_128)&&r.readers.push(new Hn),n.includes(un.ITF)&&r.readers.push(new $n),n.includes(un.RSS_14)&&r.readers.push(new hi),n.includes(un.RSS_EXPANDED)&&(console.warn("RSS Expanded reader IS NOT ready for production yet! use at your own risk."),r.readers.push(new ai))),0===r.readers.length&&(r.readers.push(new vo(e)),r.readers.push(new Gn),r.readers.push(new vo(e)),r.readers.push(new Hn),r.readers.push(new $n),r.readers.push(new hi)),r}return fi(e,t),e.prototype.decodeRow=function(t,e,r){for(var n=0;n<this.readers.length;n++)try{return this.readers[n].decodeRow(t,e,r)}catch(o){}throw new Gr},e.prototype.reset=function(){this.readers.forEach(function(t){return t.reset()})},e}(Vn),pi=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){pi(function(e,r){return void 0===e&&(e=500),t.call(this,new di(r),e,r)||this},t)}(on);var gi,mi=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},vi=function(){function t(t,e,r){this.ecCodewords=t,this.ecBlocks=[e],r&&this.ecBlocks.push(r)}return t.prototype.getECCodewords=function(){return this.ecCodewords},t.prototype.getECBlocks=function(){return this.ecBlocks},t}(),yi=function(){function t(t,e){this.count=t,this.dataCodewords=e}return t.prototype.getCount=function(){return this.count},t.prototype.getDataCodewords=function(){return this.dataCodewords},t}(),_i=function(){function t(t,e,r,n,o,i){var a,s;this.versionNumber=t,this.symbolSizeRows=e,this.symbolSizeColumns=r,this.dataRegionSizeRows=n,this.dataRegionSizeColumns=o,this.ecBlocks=i;var u=0,l=i.getECCodewords(),c=i.getECBlocks();try{for(var h=mi(c),f=h.next();!f.done;f=h.next()){var d=f.value;u+=d.getCount()*(d.getDataCodewords()+l)}}catch(p){a={error:p}}finally{try{f&&!f.done&&(s=h.return)&&s.call(h)}finally{if(a)throw a.error}}this.totalCodewords=u}return t.prototype.getVersionNumber=function(){return this.versionNumber},t.prototype.getSymbolSizeRows=function(){return this.symbolSizeRows},t.prototype.getSymbolSizeColumns=function(){return this.symbolSizeColumns},t.prototype.getDataRegionSizeRows=function(){return this.dataRegionSizeRows},t.prototype.getDataRegionSizeColumns=function(){return this.dataRegionSizeColumns},t.prototype.getTotalCodewords=function(){return this.totalCodewords},t.prototype.getECBlocks=function(){return this.ecBlocks},t.getVersionForDimensions=function(e,r){var n,o;if(1&e||1&r)throw new Mr;try{for(var i=mi(t.VERSIONS),a=i.next();!a.done;a=i.next()){var s=a.value;if(s.symbolSizeRows===e&&s.symbolSizeColumns===r)return s}}catch(u){n={error:u}}finally{try{a&&!a.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}throw new Mr},t.prototype.toString=function(){return""+this.versionNumber},t.buildVersions=function(){return[new t(1,10,10,8,8,new vi(5,new yi(1,3))),new t(2,12,12,10,10,new vi(7,new yi(1,5))),new t(3,14,14,12,12,new vi(10,new yi(1,8))),new t(4,16,16,14,14,new vi(12,new yi(1,12))),new t(5,18,18,16,16,new vi(14,new yi(1,18))),new t(6,20,20,18,18,new vi(18,new yi(1,22))),new t(7,22,22,20,20,new vi(20,new yi(1,30))),new t(8,24,24,22,22,new vi(24,new yi(1,36))),new t(9,26,26,24,24,new vi(28,new yi(1,44))),new t(10,32,32,14,14,new vi(36,new yi(1,62))),new t(11,36,36,16,16,new vi(42,new yi(1,86))),new t(12,40,40,18,18,new vi(48,new yi(1,114))),new t(13,44,44,20,20,new vi(56,new yi(1,144))),new t(14,48,48,22,22,new vi(68,new yi(1,174))),new t(15,52,52,24,24,new vi(42,new yi(2,102))),new t(16,64,64,14,14,new vi(56,new yi(2,140))),new t(17,72,72,16,16,new vi(36,new yi(4,92))),new t(18,80,80,18,18,new vi(48,new yi(4,114))),new t(19,88,88,20,20,new vi(56,new yi(4,144))),new t(20,96,96,22,22,new vi(68,new yi(4,174))),new t(21,104,104,24,24,new vi(56,new yi(6,136))),new t(22,120,120,18,18,new vi(68,new yi(6,175))),new t(23,132,132,20,20,new vi(62,new yi(8,163))),new t(24,144,144,22,22,new vi(62,new yi(8,156),new yi(2,155))),new t(25,8,18,6,16,new vi(7,new yi(1,5))),new t(26,8,32,6,14,new vi(11,new yi(1,10))),new t(27,12,26,10,24,new vi(14,new yi(1,16))),new t(28,12,36,10,16,new vi(18,new yi(1,22))),new t(29,16,36,14,16,new vi(24,new yi(1,32))),new t(30,16,48,14,22,new vi(28,new yi(1,49)))]},t.VERSIONS=t.buildVersions(),t}(),wi=function(){function t(e){var r=e.getHeight();if(r<8||r>144||1&r)throw new Mr;this.version=t.readVersion(e),this.mappingBitMatrix=this.extractDataRegion(e),this.readMappingMatrix=new zr(this.mappingBitMatrix.getWidth(),this.mappingBitMatrix.getHeight())}return t.prototype.getVersion=function(){return this.version},t.readVersion=function(t){var e=t.getHeight(),r=t.getWidth();return _i.getVersionForDimensions(e,r)},t.prototype.readCodewords=function(){var t=new Int8Array(this.version.getTotalCodewords()),e=0,r=4,n=0,o=this.mappingBitMatrix.getHeight(),i=this.mappingBitMatrix.getWidth(),a=!1,s=!1,u=!1,l=!1;do{if(r!==o||0!==n||a)if(r===o-2&&0===n&&3&i&&!s)t[e++]=255&this.readCorner2(o,i),r-=2,n+=2,s=!0;else if(r!==o+4||2!==n||7&i||u)if(r!==o-2||0!==n||4!=(7&i)||l){do{r<o&&n>=0&&!this.readMappingMatrix.get(n,r)&&(t[e++]=255&this.readUtah(r,n,o,i)),r-=2,n+=2}while(r>=0&&n<i);r+=1,n+=3;do{r>=0&&n<i&&!this.readMappingMatrix.get(n,r)&&(t[e++]=255&this.readUtah(r,n,o,i)),r+=2,n-=2}while(r<o&&n>=0);r+=3,n+=1}else t[e++]=255&this.readCorner4(o,i),r-=2,n+=2,l=!0;else t[e++]=255&this.readCorner3(o,i),r-=2,n+=2,u=!0;else t[e++]=255&this.readCorner1(o,i),r-=2,n+=2,a=!0}while(r<o||n<i);if(e!==this.version.getTotalCodewords())throw new Mr;return t},t.prototype.readModule=function(t,e,r,n){return t<0&&(t+=r,e+=4-(r+4&7)),e<0&&(e+=n,t+=4-(n+4&7)),this.readMappingMatrix.set(e,t),this.mappingBitMatrix.get(e,t)},t.prototype.readUtah=function(t,e,r,n){var o=0;return this.readModule(t-2,e-2,r,n)&&(o|=1),o<<=1,this.readModule(t-2,e-1,r,n)&&(o|=1),o<<=1,this.readModule(t-1,e-2,r,n)&&(o|=1),o<<=1,this.readModule(t-1,e-1,r,n)&&(o|=1),o<<=1,this.readModule(t-1,e,r,n)&&(o|=1),o<<=1,this.readModule(t,e-2,r,n)&&(o|=1),o<<=1,this.readModule(t,e-1,r,n)&&(o|=1),o<<=1,this.readModule(t,e,r,n)&&(o|=1),o},t.prototype.readCorner1=function(t,e){var r=0;return this.readModule(t-1,0,t,e)&&(r|=1),r<<=1,this.readModule(t-1,1,t,e)&&(r|=1),r<<=1,this.readModule(t-1,2,t,e)&&(r|=1),r<<=1,this.readModule(0,e-2,t,e)&&(r|=1),r<<=1,this.readModule(0,e-1,t,e)&&(r|=1),r<<=1,this.readModule(1,e-1,t,e)&&(r|=1),r<<=1,this.readModule(2,e-1,t,e)&&(r|=1),r<<=1,this.readModule(3,e-1,t,e)&&(r|=1),r},t.prototype.readCorner2=function(t,e){var r=0;return this.readModule(t-3,0,t,e)&&(r|=1),r<<=1,this.readModule(t-2,0,t,e)&&(r|=1),r<<=1,this.readModule(t-1,0,t,e)&&(r|=1),r<<=1,this.readModule(0,e-4,t,e)&&(r|=1),r<<=1,this.readModule(0,e-3,t,e)&&(r|=1),r<<=1,this.readModule(0,e-2,t,e)&&(r|=1),r<<=1,this.readModule(0,e-1,t,e)&&(r|=1),r<<=1,this.readModule(1,e-1,t,e)&&(r|=1),r},t.prototype.readCorner3=function(t,e){var r=0;return this.readModule(t-1,0,t,e)&&(r|=1),r<<=1,this.readModule(t-1,e-1,t,e)&&(r|=1),r<<=1,this.readModule(0,e-3,t,e)&&(r|=1),r<<=1,this.readModule(0,e-2,t,e)&&(r|=1),r<<=1,this.readModule(0,e-1,t,e)&&(r|=1),r<<=1,this.readModule(1,e-3,t,e)&&(r|=1),r<<=1,this.readModule(1,e-2,t,e)&&(r|=1),r<<=1,this.readModule(1,e-1,t,e)&&(r|=1),r},t.prototype.readCorner4=function(t,e){var r=0;return this.readModule(t-3,0,t,e)&&(r|=1),r<<=1,this.readModule(t-2,0,t,e)&&(r|=1),r<<=1,this.readModule(t-1,0,t,e)&&(r|=1),r<<=1,this.readModule(0,e-2,t,e)&&(r|=1),r<<=1,this.readModule(0,e-1,t,e)&&(r|=1),r<<=1,this.readModule(1,e-1,t,e)&&(r|=1),r<<=1,this.readModule(2,e-1,t,e)&&(r|=1),r<<=1,this.readModule(3,e-1,t,e)&&(r|=1),r},t.prototype.extractDataRegion=function(t){var e=this.version.getSymbolSizeRows(),r=this.version.getSymbolSizeColumns();if(t.getHeight()!==e)throw new _r("Dimension of bitMatrix must match the version size");for(var n=this.version.getDataRegionSizeRows(),o=this.version.getDataRegionSizeColumns(),i=e/n|0,a=r/o|0,s=new zr(a*o,i*n),u=0;u<i;++u)for(var l=u*n,c=0;c<a;++c)for(var h=c*o,f=0;f<n;++f)for(var d=u*(n+2)+1+f,p=l+f,g=0;g<o;++g){var m=c*(o+2)+1+g;if(t.get(m,d)){var v=h+g;s.set(v,p)}}return s},t}(),bi=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Ci=function(){function t(t,e){this.numDataCodewords=t,this.codewords=e}return t.getDataBlocks=function(e,r){var n,o,i,a,s=r.getECBlocks(),u=0,l=s.getECBlocks();try{for(var c=bi(l),h=c.next();!h.done;h=c.next())u+=(m=h.value).getCount()}catch(T){n={error:T}}finally{try{h&&!h.done&&(o=c.return)&&o.call(c)}finally{if(n)throw n.error}}var f=new Array(u),d=0;try{for(var p=bi(l),g=p.next();!g.done;g=p.next())for(var m=g.value,v=0;v<m.getCount();v++){var y=m.getDataCodewords(),_=s.getECCodewords()+y;f[d++]=new t(y,new Uint8Array(_))}}catch(T){i={error:T}}finally{try{g&&!g.done&&(a=p.return)&&a.call(p)}finally{if(i)throw i.error}}var w=f[0].codewords.length-s.getECCodewords(),b=w-1,C=0;for(v=0;v<b;v++)for(var A=0;A<d;A++)f[A].codewords[v]=e[C++];var E=24===r.getVersionNumber(),I=E?8:d;for(A=0;A<I;A++)f[A].codewords[w-1]=e[C++];var S=f[0].codewords.length;for(v=w;v<S;v++)for(A=0;A<d;A++){var x=E?(A+8)%d:A,O=E&&x>7?v-1:v;f[x].codewords[O]=e[C++]}if(C!==e.length)throw new _r;return f},t.prototype.getNumDataCodewords=function(){return this.numDataCodewords},t.prototype.getCodewords=function(){return this.codewords},t}(),Ai=function(){function t(t){this.bytes=t,this.byteOffset=0,this.bitOffset=0}return t.prototype.getBitOffset=function(){return this.bitOffset},t.prototype.getByteOffset=function(){return this.byteOffset},t.prototype.readBits=function(t){if(t<1||t>32||t>this.available())throw new _r(""+t);var e=0,r=this.bitOffset,n=this.byteOffset,o=this.bytes;if(r>0){var i=8-r,a=t<i?t:i,s=255>>8-a<<(u=i-a);e=(o[n]&s)>>u,t-=a,8===(r+=a)&&(r=0,n++)}if(t>0){for(;t>=8;)e=e<<8|255&o[n],n++,t-=8;var u;if(t>0)s=255>>(u=8-t)<<u,e=e<<t|(o[n]&s)>>u,r+=t}return this.bitOffset=r,this.byteOffset=n,e},t.prototype.available=function(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset},t}();!function(t){t[t.PAD_ENCODE=0]="PAD_ENCODE",t[t.ASCII_ENCODE=1]="ASCII_ENCODE",t[t.C40_ENCODE=2]="C40_ENCODE",t[t.TEXT_ENCODE=3]="TEXT_ENCODE",t[t.ANSIX12_ENCODE=4]="ANSIX12_ENCODE",t[t.EDIFACT_ENCODE=5]="EDIFACT_ENCODE",t[t.BASE256_ENCODE=6]="BASE256_ENCODE"}(gi||(gi={}));var Ei,Ii=function(){function t(){}return t.decode=function(t){var e=new Ai(t),r=new Hr,n=new Hr,o=new Array,i=gi.ASCII_ENCODE;do{if(i===gi.ASCII_ENCODE)i=this.decodeAsciiSegment(e,r,n);else{switch(i){case gi.C40_ENCODE:this.decodeC40Segment(e,r);break;case gi.TEXT_ENCODE:this.decodeTextSegment(e,r);break;case gi.ANSIX12_ENCODE:this.decodeAnsiX12Segment(e,r);break;case gi.EDIFACT_ENCODE:this.decodeEdifactSegment(e,r);break;case gi.BASE256_ENCODE:this.decodeBase256Segment(e,r,o);break;default:throw new Mr}i=gi.ASCII_ENCODE}}while(i!==gi.PAD_ENCODE&&e.available()>0);return n.length()>0&&r.append(n.toString()),new hn(t,r.toString(),0===o.length?null:o,null)},t.decodeAsciiSegment=function(t,e,r){var n=!1;do{var o=t.readBits(8);if(0===o)throw new Mr;if(o<=128)return n&&(o+=128),e.append(String.fromCharCode(o-1)),gi.ASCII_ENCODE;if(129===o)return gi.PAD_ENCODE;if(o<=229){var i=o-130;i<10&&e.append("0"),e.append(""+i)}else switch(o){case 230:return gi.C40_ENCODE;case 231:return gi.BASE256_ENCODE;case 232:e.append(String.fromCharCode(29));break;case 233:case 234:case 241:break;case 235:n=!0;break;case 236:e.append("[)>05"),r.insert(0,"");break;case 237:e.append("[)>06"),r.insert(0,"");break;case 238:return gi.ANSIX12_ENCODE;case 239:return gi.TEXT_ENCODE;case 240:return gi.EDIFACT_ENCODE;default:if(254!==o||0!==t.available())throw new Mr}}while(t.available()>0);return gi.ASCII_ENCODE},t.decodeC40Segment=function(t,e){var r=!1,n=[],o=0;do{if(8===t.available())return;var i=t.readBits(8);if(254===i)return;this.parseTwoBytes(i,t.readBits(8),n);for(var a=0;a<3;a++){var s=n[a];switch(o){case 0:if(s<3)o=s+1;else{if(!(s<this.C40_BASIC_SET_CHARS.length))throw new Mr;var u=this.C40_BASIC_SET_CHARS[s];r?(e.append(String.fromCharCode(u.charCodeAt(0)+128)),r=!1):e.append(u)}break;case 1:r?(e.append(String.fromCharCode(s+128)),r=!1):e.append(String.fromCharCode(s)),o=0;break;case 2:if(s<this.C40_SHIFT2_SET_CHARS.length)u=this.C40_SHIFT2_SET_CHARS[s],r?(e.append(String.fromCharCode(u.charCodeAt(0)+128)),r=!1):e.append(u);else switch(s){case 27:e.append(String.fromCharCode(29));break;case 30:r=!0;break;default:throw new Mr}o=0;break;case 3:r?(e.append(String.fromCharCode(s+224)),r=!1):e.append(String.fromCharCode(s+96)),o=0;break;default:throw new Mr}}}while(t.available()>0)},t.decodeTextSegment=function(t,e){var r=!1,n=[],o=0;do{if(8===t.available())return;var i=t.readBits(8);if(254===i)return;this.parseTwoBytes(i,t.readBits(8),n);for(var a=0;a<3;a++){var s=n[a];switch(o){case 0:if(s<3)o=s+1;else{if(!(s<this.TEXT_BASIC_SET_CHARS.length))throw new Mr;var u=this.TEXT_BASIC_SET_CHARS[s];r?(e.append(String.fromCharCode(u.charCodeAt(0)+128)),r=!1):e.append(u)}break;case 1:r?(e.append(String.fromCharCode(s+128)),r=!1):e.append(String.fromCharCode(s)),o=0;break;case 2:if(s<this.TEXT_SHIFT2_SET_CHARS.length)u=this.TEXT_SHIFT2_SET_CHARS[s],r?(e.append(String.fromCharCode(u.charCodeAt(0)+128)),r=!1):e.append(u);else switch(s){case 27:e.append(String.fromCharCode(29));break;case 30:r=!0;break;default:throw new Mr}o=0;break;case 3:if(!(s<this.TEXT_SHIFT3_SET_CHARS.length))throw new Mr;u=this.TEXT_SHIFT3_SET_CHARS[s],r?(e.append(String.fromCharCode(u.charCodeAt(0)+128)),r=!1):e.append(u),o=0;break;default:throw new Mr}}}while(t.available()>0)},t.decodeAnsiX12Segment=function(t,e){var r=[];do{if(8===t.available())return;var n=t.readBits(8);if(254===n)return;this.parseTwoBytes(n,t.readBits(8),r);for(var o=0;o<3;o++){var i=r[o];switch(i){case 0:e.append("\r");break;case 1:e.append("*");break;case 2:e.append(">");break;case 3:e.append(" ");break;default:if(i<14)e.append(String.fromCharCode(i+44));else{if(!(i<40))throw new Mr;e.append(String.fromCharCode(i+51))}}}}while(t.available()>0)},t.parseTwoBytes=function(t,e,r){var n=(t<<8)+e-1,o=Math.floor(n/1600);r[0]=o,n-=1600*o,o=Math.floor(n/40),r[1]=o,r[2]=n-40*o},t.decodeEdifactSegment=function(t,e){do{if(t.available()<=16)return;for(var r=0;r<4;r++){var n=t.readBits(6);if(31===n){var o=8-t.getBitOffset();return void(8!==o&&t.readBits(o))}!(32&n)&&(n|=64),e.append(String.fromCharCode(n))}}while(t.available()>0)},t.decodeBase256Segment=function(t,e,r){var n,o=1+t.getByteOffset(),i=this.unrandomize255State(t.readBits(8),o++);if((n=0===i?t.available()/8|0:i<250?i:250*(i-249)+this.unrandomize255State(t.readBits(8),o++))<0)throw new Mr;for(var a=new Uint8Array(n),s=0;s<n;s++){if(t.available()<8)throw new Mr;a[s]=this.unrandomize255State(t.readBits(8),o++)}r.push(a);try{e.append(Vr.decode(a,Ur.ISO88591))}catch(u){throw new bn("Platform does not support required encoding: "+u.message)}},t.unrandomize255State=function(t,e){var r=t-(149*e%255+1);return r>=0?r:r+256},t.C40_BASIC_SET_CHARS=["*","*","*"," ","0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],t.C40_SHIFT2_SET_CHARS=["!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","@","[","\\","]","^","_"],t.TEXT_BASIC_SET_CHARS=["*","*","*"," ","0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],t.TEXT_SHIFT2_SET_CHARS=t.C40_SHIFT2_SET_CHARS,t.TEXT_SHIFT3_SET_CHARS=["`","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","{","|","}","~",String.fromCharCode(127)],t}(),Si=function(){function t(){this.rsDecoder=new Cn(vn.DATA_MATRIX_FIELD_256)}return t.prototype.decode=function(t){var e,r,n=new wi(t),o=n.getVersion(),i=n.readCodewords(),a=Ci.getDataBlocks(i,o),s=0;try{for(var u=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(a),l=u.next();!l.done;l=u.next())s+=l.value.getNumDataCodewords()}catch(v){e={error:v}}finally{try{l&&!l.done&&(r=u.return)&&r.call(u)}finally{if(e)throw e.error}}for(var c=new Uint8Array(s),h=a.length,f=0;f<h;f++){var d=a[f],p=d.getCodewords(),g=d.getNumDataCodewords();this.correctErrors(p,g);for(var m=0;m<g;m++)c[m*h+f]=p[m]}return Ii.decode(c)},t.prototype.correctErrors=function(t,e){var r=new Int32Array(t);try{this.rsDecoder.decode(r,t.length-e)}catch(o){throw new Cr}for(var n=0;n<e;n++)t[n]=r[n]},t}(),xi=function(){function t(t){this.image=t,this.rectangleDetector=new Nn(this.image)}return t.prototype.detect=function(){var e=this.rectangleDetector.detect(),r=this.detectSolid1(e);if((r=this.detectSolid2(r))[3]=this.correctTopRight(r),!r[3])throw new Gr;var n=(r=this.shiftToModuleCenter(r))[0],o=r[1],i=r[2],a=r[3],s=this.transitionsBetween(n,a)+1,u=this.transitionsBetween(i,a)+1;!(1&~s)&&(s+=1),!(1&~u)&&(u+=1),4*s<7*u&&4*u<7*s&&(s=u=Math.max(s,u));var l=t.sampleGrid(this.image,n,o,i,a,s,u);return new xn(l,[n,o,i,a])},t.shiftPoint=function(t,e,r){var n=(e.getX()-t.getX())/(r+1),o=(e.getY()-t.getY())/(r+1);return new Sn(t.getX()+n,t.getY()+o)},t.moveAway=function(t,e,r){var n=t.getX(),o=t.getY();return n<e?n-=1:n+=1,o<r?o-=1:o+=1,new Sn(n,o)},t.prototype.detectSolid1=function(t){var e=t[0],r=t[1],n=t[3],o=t[2],i=this.transitionsBetween(e,r),a=this.transitionsBetween(r,n),s=this.transitionsBetween(n,o),u=this.transitionsBetween(o,e),l=i,c=[o,e,r,n];return l>a&&(l=a,c[0]=e,c[1]=r,c[2]=n,c[3]=o),l>s&&(l=s,c[0]=r,c[1]=n,c[2]=o,c[3]=e),l>u&&(c[0]=n,c[1]=o,c[2]=e,c[3]=r),c},t.prototype.detectSolid2=function(e){var r=e[0],n=e[1],o=e[2],i=e[3],a=this.transitionsBetween(r,i),s=t.shiftPoint(n,o,4*(a+1)),u=t.shiftPoint(o,n,4*(a+1));return this.transitionsBetween(s,r)<this.transitionsBetween(u,i)?(e[0]=r,e[1]=n,e[2]=o,e[3]=i):(e[0]=n,e[1]=o,e[2]=i,e[3]=r),e},t.prototype.correctTopRight=function(e){var r=e[0],n=e[1],o=e[2],i=e[3],a=this.transitionsBetween(r,i),s=this.transitionsBetween(n,i),u=t.shiftPoint(r,n,4*(s+1)),l=t.shiftPoint(o,n,4*(a+1));a=this.transitionsBetween(u,i),s=this.transitionsBetween(l,i);var c=new Sn(i.getX()+(o.getX()-n.getX())/(a+1),i.getY()+(o.getY()-n.getY())/(a+1)),h=new Sn(i.getX()+(r.getX()-n.getX())/(s+1),i.getY()+(r.getY()-n.getY())/(s+1));return this.isValid(c)?this.isValid(h)?this.transitionsBetween(u,c)+this.transitionsBetween(l,c)>this.transitionsBetween(u,h)+this.transitionsBetween(l,h)?c:h:c:this.isValid(h)?h:null},t.prototype.shiftToModuleCenter=function(e){var r=e[0],n=e[1],o=e[2],i=e[3],a=this.transitionsBetween(r,i)+1,s=this.transitionsBetween(o,i)+1,u=t.shiftPoint(r,n,4*s),l=t.shiftPoint(o,n,4*a);!(1&~(a=this.transitionsBetween(u,i)+1))&&(a+=1),!(1&~(s=this.transitionsBetween(l,i)+1))&&(s+=1);var c,h,f=(r.getX()+n.getX()+o.getX()+i.getX())/4,d=(r.getY()+n.getY()+o.getY()+i.getY())/4;return r=t.moveAway(r,f,d),n=t.moveAway(n,f,d),o=t.moveAway(o,f,d),i=t.moveAway(i,f,d),u=t.shiftPoint(r,n,4*s),u=t.shiftPoint(u,i,4*a),c=t.shiftPoint(n,r,4*s),c=t.shiftPoint(c,o,4*a),l=t.shiftPoint(o,i,4*s),l=t.shiftPoint(l,n,4*a),h=t.shiftPoint(i,o,4*s),[u,c,l,h=t.shiftPoint(h,r,4*a)]},t.prototype.isValid=function(t){return t.getX()>=0&&t.getX()<this.image.getWidth()&&t.getY()>0&&t.getY()<this.image.getHeight()},t.sampleGrid=function(t,e,r,n,o,i,a){return Mn.getInstance().sampleGrid(t,i,a,.5,.5,i-.5,.5,i-.5,a-.5,.5,a-.5,e.getX(),e.getY(),o.getX(),o.getY(),n.getX(),n.getY(),r.getX(),r.getY())},t.prototype.transitionsBetween=function(t,e){var r=Math.trunc(t.getX()),n=Math.trunc(t.getY()),o=Math.trunc(e.getX()),i=Math.trunc(e.getY()),a=Math.abs(i-n)>Math.abs(o-r);if(a){var s=r;r=n,n=s,s=o,o=i,i=s}for(var u=Math.abs(o-r),l=Math.abs(i-n),c=-u/2,h=n<i?1:-1,f=r<o?1:-1,d=0,p=this.image.get(a?n:r,a?r:n),g=r,m=n;g!==o;g+=f){var v=this.image.get(a?m:g,a?g:m);if(v!==p&&(d++,p=v),(c+=l)>0){if(m===i)break;m+=h,c-=u}}return d},t}(),Oi=function(){function t(){this.decoder=new Si}return t.prototype.decode=function(e,r){var n,o;if(void 0===r&&(r=null),null!=r&&r.has(Dr.PURE_BARCODE)){var i=t.extractPureBits(e.getBlackMatrix());n=this.decoder.decode(i),o=t.NO_POINTS}else{var a=new xi(e.getBlackMatrix()).detect();n=this.decoder.decode(a.getBits()),o=a.getPoints()}var s=n.getRawBytes(),u=new an(n.getText(),s,8*s.length,o,un.DATA_MATRIX,Er.currentTimeMillis()),l=n.getByteSegments();null!=l&&u.putMetadata(cn.BYTE_SEGMENTS,l);var c=n.getECLevel();return null!=c&&u.putMetadata(cn.ERROR_CORRECTION_LEVEL,c),u},t.prototype.reset=function(){},t.extractPureBits=function(t){var e=t.getTopLeftOnBit(),r=t.getBottomRightOnBit();if(null==e||null==r)throw new Gr;var n=this.moduleSize(e,t),o=e[1],i=r[1],a=e[0],s=(r[0]-a+1)/n,u=(i-o+1)/n;if(s<=0||u<=0)throw new Gr;var l=n/2;o+=l,a+=l;for(var c=new zr(s,u),h=0;h<u;h++)for(var f=o+h*n,d=0;d<s;d++)t.get(a+d*n,f)&&c.set(d,h);return c},t.moduleSize=function(t,e){for(var r=e.getWidth(),n=t[0],o=t[1];n<r&&e.get(n,o);)n++;if(n===r)throw new Gr;var i=n-t[0];if(0===i)throw new Gr;return i},t.NO_POINTS=[],t}(),Ti=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){Ti(function(e){return void 0===e&&(e=500),t.call(this,new Oi,e)||this},t)}(on),function(t){t[t.L=0]="L",t[t.M=1]="M",t[t.Q=2]="Q",t[t.H=3]="H"}(Ei||(Ei={}));var Ni,ki=function(){function t(e,r,n){this.value=e,this.stringValue=r,this.bits=n,t.FOR_BITS.set(n,this),t.FOR_VALUE.set(e,this)}return t.prototype.getValue=function(){return this.value},t.prototype.getBits=function(){return this.bits},t.fromString=function(e){switch(e){case"L":return t.L;case"M":return t.M;case"Q":return t.Q;case"H":return t.H;default:throw new vr(e+"not available")}},t.prototype.toString=function(){return this.stringValue},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var r=e;return this.value===r.value},t.forBits=function(e){if(e<0||e>=t.FOR_BITS.size)throw new _r;return t.FOR_BITS.get(e)},t.FOR_BITS=new Map,t.FOR_VALUE=new Map,t.L=new t(Ei.L,"L",1),t.M=new t(Ei.M,"M",0),t.Q=new t(Ei.Q,"Q",3),t.H=new t(Ei.H,"H",2),t}(),Ri=function(){function t(t){this.errorCorrectionLevel=ki.forBits(t>>3&3),this.dataMask=7&t}return t.numBitsDiffering=function(t,e){return Nr.bitCount(t^e)},t.decodeFormatInformation=function(e,r){var n=t.doDecodeFormatInformation(e,r);return null!==n?n:t.doDecodeFormatInformation(e^t.FORMAT_INFO_MASK_QR,r^t.FORMAT_INFO_MASK_QR)},t.doDecodeFormatInformation=function(e,r){var n,o,i=Number.MAX_SAFE_INTEGER,a=0;try{for(var s=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(t.FORMAT_INFO_DECODE_LOOKUP),u=s.next();!u.done;u=s.next()){var l=u.value,c=l[0];if(c===e||c===r)return new t(l[1]);var h=t.numBitsDiffering(e,c);h<i&&(a=l[1],i=h),e!==r&&(h=t.numBitsDiffering(r,c))<i&&(a=l[1],i=h)}}catch(f){n={error:f}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(n)throw n.error}}return i<=3?new t(a):null},t.prototype.getErrorCorrectionLevel=function(){return this.errorCorrectionLevel},t.prototype.getDataMask=function(){return this.dataMask},t.prototype.hashCode=function(){return this.errorCorrectionLevel.getBits()<<3|this.dataMask},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var r=e;return this.errorCorrectionLevel===r.errorCorrectionLevel&&this.dataMask===r.dataMask},t.FORMAT_INFO_MASK_QR=21522,t.FORMAT_INFO_DECODE_LOOKUP=[Int32Array.from([21522,0]),Int32Array.from([20773,1]),Int32Array.from([24188,2]),Int32Array.from([23371,3]),Int32Array.from([17913,4]),Int32Array.from([16590,5]),Int32Array.from([20375,6]),Int32Array.from([19104,7]),Int32Array.from([30660,8]),Int32Array.from([29427,9]),Int32Array.from([32170,10]),Int32Array.from([30877,11]),Int32Array.from([26159,12]),Int32Array.from([25368,13]),Int32Array.from([27713,14]),Int32Array.from([26998,15]),Int32Array.from([5769,16]),Int32Array.from([5054,17]),Int32Array.from([7399,18]),Int32Array.from([6608,19]),Int32Array.from([1890,20]),Int32Array.from([597,21]),Int32Array.from([3340,22]),Int32Array.from([2107,23]),Int32Array.from([13663,24]),Int32Array.from([12392,25]),Int32Array.from([16177,26]),Int32Array.from([14854,27]),Int32Array.from([9396,28]),Int32Array.from([8579,29]),Int32Array.from([11994,30]),Int32Array.from([11245,31])],t}(),Di=function(){function t(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];this.ecCodewordsPerBlock=t,this.ecBlocks=e}return t.prototype.getECCodewordsPerBlock=function(){return this.ecCodewordsPerBlock},t.prototype.getNumBlocks=function(){var t,e,r=0,n=this.ecBlocks;try{for(var o=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(n),i=o.next();!i.done;i=o.next())r+=i.value.getCount()}catch(a){t={error:a}}finally{try{i&&!i.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}return r},t.prototype.getTotalECCodewords=function(){return this.ecCodewordsPerBlock*this.getNumBlocks()},t.prototype.getECBlocks=function(){return this.ecBlocks},t}(),Pi=function(){function t(t,e){this.count=t,this.dataCodewords=e}return t.prototype.getCount=function(){return this.count},t.prototype.getDataCodewords=function(){return this.dataCodewords},t}(),Mi=function(){function t(t,e){for(var r,n,o=[],i=2;i<arguments.length;i++)o[i-2]=arguments[i];this.versionNumber=t,this.alignmentPatternCenters=e,this.ecBlocks=o;var a=0,s=o[0].getECCodewordsPerBlock(),u=o[0].getECBlocks();try{for(var l=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(u),c=l.next();!c.done;c=l.next()){var h=c.value;a+=h.getCount()*(h.getDataCodewords()+s)}}catch(f){r={error:f}}finally{try{c&&!c.done&&(n=l.return)&&n.call(l)}finally{if(r)throw r.error}}this.totalCodewords=a}return t.prototype.getVersionNumber=function(){return this.versionNumber},t.prototype.getAlignmentPatternCenters=function(){return this.alignmentPatternCenters},t.prototype.getTotalCodewords=function(){return this.totalCodewords},t.prototype.getDimensionForVersion=function(){return 17+4*this.versionNumber},t.prototype.getECBlocksForLevel=function(t){return this.ecBlocks[t.getValue()]},t.getProvisionalVersionForDimension=function(t){if(t%4!=1)throw new Mr;try{return this.getVersionForNumber((t-17)/4)}catch(e){throw new Mr}},t.getVersionForNumber=function(e){if(e<1||e>40)throw new _r;return t.VERSIONS[e-1]},t.decodeVersionInformation=function(e){for(var r=Number.MAX_SAFE_INTEGER,n=0,o=0;o<t.VERSION_DECODE_INFO.length;o++){var i=t.VERSION_DECODE_INFO[o];if(i===e)return t.getVersionForNumber(o+7);var a=Ri.numBitsDiffering(e,i);a<r&&(n=o+7,r=a)}return r<=3?t.getVersionForNumber(n):null},t.prototype.buildFunctionPattern=function(){var t=this.getDimensionForVersion(),e=new zr(t);e.setRegion(0,0,9,9),e.setRegion(t-8,0,8,9),e.setRegion(0,t-8,9,8);for(var r=this.alignmentPatternCenters.length,n=0;n<r;n++)for(var o=this.alignmentPatternCenters[n]-2,i=0;i<r;i++)0===n&&(0===i||i===r-1)||n===r-1&&0===i||e.setRegion(this.alignmentPatternCenters[i]-2,o,5,5);return e.setRegion(6,9,1,t-17),e.setRegion(9,6,t-17,1),this.versionNumber>6&&(e.setRegion(t-11,0,3,6),e.setRegion(0,t-11,6,3)),e},t.prototype.toString=function(){return""+this.versionNumber},t.VERSION_DECODE_INFO=Int32Array.from([31892,34236,39577,42195,48118,51042,55367,58893,63784,68472,70749,76311,79154,84390,87683,92361,96236,102084,102881,110507,110734,117786,119615,126325,127568,133589,136944,141498,145311,150283,152622,158308,161089,167017]),t.VERSIONS=[new t(1,new Int32Array(0),new Di(7,new Pi(1,19)),new Di(10,new Pi(1,16)),new Di(13,new Pi(1,13)),new Di(17,new Pi(1,9))),new t(2,Int32Array.from([6,18]),new Di(10,new Pi(1,34)),new Di(16,new Pi(1,28)),new Di(22,new Pi(1,22)),new Di(28,new Pi(1,16))),new t(3,Int32Array.from([6,22]),new Di(15,new Pi(1,55)),new Di(26,new Pi(1,44)),new Di(18,new Pi(2,17)),new Di(22,new Pi(2,13))),new t(4,Int32Array.from([6,26]),new Di(20,new Pi(1,80)),new Di(18,new Pi(2,32)),new Di(26,new Pi(2,24)),new Di(16,new Pi(4,9))),new t(5,Int32Array.from([6,30]),new Di(26,new Pi(1,108)),new Di(24,new Pi(2,43)),new Di(18,new Pi(2,15),new Pi(2,16)),new Di(22,new Pi(2,11),new Pi(2,12))),new t(6,Int32Array.from([6,34]),new Di(18,new Pi(2,68)),new Di(16,new Pi(4,27)),new Di(24,new Pi(4,19)),new Di(28,new Pi(4,15))),new t(7,Int32Array.from([6,22,38]),new Di(20,new Pi(2,78)),new Di(18,new Pi(4,31)),new Di(18,new Pi(2,14),new Pi(4,15)),new Di(26,new Pi(4,13),new Pi(1,14))),new t(8,Int32Array.from([6,24,42]),new Di(24,new Pi(2,97)),new Di(22,new Pi(2,38),new Pi(2,39)),new Di(22,new Pi(4,18),new Pi(2,19)),new Di(26,new Pi(4,14),new Pi(2,15))),new t(9,Int32Array.from([6,26,46]),new Di(30,new Pi(2,116)),new Di(22,new Pi(3,36),new Pi(2,37)),new Di(20,new Pi(4,16),new Pi(4,17)),new Di(24,new Pi(4,12),new Pi(4,13))),new t(10,Int32Array.from([6,28,50]),new Di(18,new Pi(2,68),new Pi(2,69)),new Di(26,new Pi(4,43),new Pi(1,44)),new Di(24,new Pi(6,19),new Pi(2,20)),new Di(28,new Pi(6,15),new Pi(2,16))),new t(11,Int32Array.from([6,30,54]),new Di(20,new Pi(4,81)),new Di(30,new Pi(1,50),new Pi(4,51)),new Di(28,new Pi(4,22),new Pi(4,23)),new Di(24,new Pi(3,12),new Pi(8,13))),new t(12,Int32Array.from([6,32,58]),new Di(24,new Pi(2,92),new Pi(2,93)),new Di(22,new Pi(6,36),new Pi(2,37)),new Di(26,new Pi(4,20),new Pi(6,21)),new Di(28,new Pi(7,14),new Pi(4,15))),new t(13,Int32Array.from([6,34,62]),new Di(26,new Pi(4,107)),new Di(22,new Pi(8,37),new Pi(1,38)),new Di(24,new Pi(8,20),new Pi(4,21)),new Di(22,new Pi(12,11),new Pi(4,12))),new t(14,Int32Array.from([6,26,46,66]),new Di(30,new Pi(3,115),new Pi(1,116)),new Di(24,new Pi(4,40),new Pi(5,41)),new Di(20,new Pi(11,16),new Pi(5,17)),new Di(24,new Pi(11,12),new Pi(5,13))),new t(15,Int32Array.from([6,26,48,70]),new Di(22,new Pi(5,87),new Pi(1,88)),new Di(24,new Pi(5,41),new Pi(5,42)),new Di(30,new Pi(5,24),new Pi(7,25)),new Di(24,new Pi(11,12),new Pi(7,13))),new t(16,Int32Array.from([6,26,50,74]),new Di(24,new Pi(5,98),new Pi(1,99)),new Di(28,new Pi(7,45),new Pi(3,46)),new Di(24,new Pi(15,19),new Pi(2,20)),new Di(30,new Pi(3,15),new Pi(13,16))),new t(17,Int32Array.from([6,30,54,78]),new Di(28,new Pi(1,107),new Pi(5,108)),new Di(28,new Pi(10,46),new Pi(1,47)),new Di(28,new Pi(1,22),new Pi(15,23)),new Di(28,new Pi(2,14),new Pi(17,15))),new t(18,Int32Array.from([6,30,56,82]),new Di(30,new Pi(5,120),new Pi(1,121)),new Di(26,new Pi(9,43),new Pi(4,44)),new Di(28,new Pi(17,22),new Pi(1,23)),new Di(28,new Pi(2,14),new Pi(19,15))),new t(19,Int32Array.from([6,30,58,86]),new Di(28,new Pi(3,113),new Pi(4,114)),new Di(26,new Pi(3,44),new Pi(11,45)),new Di(26,new Pi(17,21),new Pi(4,22)),new Di(26,new Pi(9,13),new Pi(16,14))),new t(20,Int32Array.from([6,34,62,90]),new Di(28,new Pi(3,107),new Pi(5,108)),new Di(26,new Pi(3,41),new Pi(13,42)),new Di(30,new Pi(15,24),new Pi(5,25)),new Di(28,new Pi(15,15),new Pi(10,16))),new t(21,Int32Array.from([6,28,50,72,94]),new Di(28,new Pi(4,116),new Pi(4,117)),new Di(26,new Pi(17,42)),new Di(28,new Pi(17,22),new Pi(6,23)),new Di(30,new Pi(19,16),new Pi(6,17))),new t(22,Int32Array.from([6,26,50,74,98]),new Di(28,new Pi(2,111),new Pi(7,112)),new Di(28,new Pi(17,46)),new Di(30,new Pi(7,24),new Pi(16,25)),new Di(24,new Pi(34,13))),new t(23,Int32Array.from([6,30,54,78,102]),new Di(30,new Pi(4,121),new Pi(5,122)),new Di(28,new Pi(4,47),new Pi(14,48)),new Di(30,new Pi(11,24),new Pi(14,25)),new Di(30,new Pi(16,15),new Pi(14,16))),new t(24,Int32Array.from([6,28,54,80,106]),new Di(30,new Pi(6,117),new Pi(4,118)),new Di(28,new Pi(6,45),new Pi(14,46)),new Di(30,new Pi(11,24),new Pi(16,25)),new Di(30,new Pi(30,16),new Pi(2,17))),new t(25,Int32Array.from([6,32,58,84,110]),new Di(26,new Pi(8,106),new Pi(4,107)),new Di(28,new Pi(8,47),new Pi(13,48)),new Di(30,new Pi(7,24),new Pi(22,25)),new Di(30,new Pi(22,15),new Pi(13,16))),new t(26,Int32Array.from([6,30,58,86,114]),new Di(28,new Pi(10,114),new Pi(2,115)),new Di(28,new Pi(19,46),new Pi(4,47)),new Di(28,new Pi(28,22),new Pi(6,23)),new Di(30,new Pi(33,16),new Pi(4,17))),new t(27,Int32Array.from([6,34,62,90,118]),new Di(30,new Pi(8,122),new Pi(4,123)),new Di(28,new Pi(22,45),new Pi(3,46)),new Di(30,new Pi(8,23),new Pi(26,24)),new Di(30,new Pi(12,15),new Pi(28,16))),new t(28,Int32Array.from([6,26,50,74,98,122]),new Di(30,new Pi(3,117),new Pi(10,118)),new Di(28,new Pi(3,45),new Pi(23,46)),new Di(30,new Pi(4,24),new Pi(31,25)),new Di(30,new Pi(11,15),new Pi(31,16))),new t(29,Int32Array.from([6,30,54,78,102,126]),new Di(30,new Pi(7,116),new Pi(7,117)),new Di(28,new Pi(21,45),new Pi(7,46)),new Di(30,new Pi(1,23),new Pi(37,24)),new Di(30,new Pi(19,15),new Pi(26,16))),new t(30,Int32Array.from([6,26,52,78,104,130]),new Di(30,new Pi(5,115),new Pi(10,116)),new Di(28,new Pi(19,47),new Pi(10,48)),new Di(30,new Pi(15,24),new Pi(25,25)),new Di(30,new Pi(23,15),new Pi(25,16))),new t(31,Int32Array.from([6,30,56,82,108,134]),new Di(30,new Pi(13,115),new Pi(3,116)),new Di(28,new Pi(2,46),new Pi(29,47)),new Di(30,new Pi(42,24),new Pi(1,25)),new Di(30,new Pi(23,15),new Pi(28,16))),new t(32,Int32Array.from([6,34,60,86,112,138]),new Di(30,new Pi(17,115)),new Di(28,new Pi(10,46),new Pi(23,47)),new Di(30,new Pi(10,24),new Pi(35,25)),new Di(30,new Pi(19,15),new Pi(35,16))),new t(33,Int32Array.from([6,30,58,86,114,142]),new Di(30,new Pi(17,115),new Pi(1,116)),new Di(28,new Pi(14,46),new Pi(21,47)),new Di(30,new Pi(29,24),new Pi(19,25)),new Di(30,new Pi(11,15),new Pi(46,16))),new t(34,Int32Array.from([6,34,62,90,118,146]),new Di(30,new Pi(13,115),new Pi(6,116)),new Di(28,new Pi(14,46),new Pi(23,47)),new Di(30,new Pi(44,24),new Pi(7,25)),new Di(30,new Pi(59,16),new Pi(1,17))),new t(35,Int32Array.from([6,30,54,78,102,126,150]),new Di(30,new Pi(12,121),new Pi(7,122)),new Di(28,new Pi(12,47),new Pi(26,48)),new Di(30,new Pi(39,24),new Pi(14,25)),new Di(30,new Pi(22,15),new Pi(41,16))),new t(36,Int32Array.from([6,24,50,76,102,128,154]),new Di(30,new Pi(6,121),new Pi(14,122)),new Di(28,new Pi(6,47),new Pi(34,48)),new Di(30,new Pi(46,24),new Pi(10,25)),new Di(30,new Pi(2,15),new Pi(64,16))),new t(37,Int32Array.from([6,28,54,80,106,132,158]),new Di(30,new Pi(17,122),new Pi(4,123)),new Di(28,new Pi(29,46),new Pi(14,47)),new Di(30,new Pi(49,24),new Pi(10,25)),new Di(30,new Pi(24,15),new Pi(46,16))),new t(38,Int32Array.from([6,32,58,84,110,136,162]),new Di(30,new Pi(4,122),new Pi(18,123)),new Di(28,new Pi(13,46),new Pi(32,47)),new Di(30,new Pi(48,24),new Pi(14,25)),new Di(30,new Pi(42,15),new Pi(32,16))),new t(39,Int32Array.from([6,26,54,82,110,138,166]),new Di(30,new Pi(20,117),new Pi(4,118)),new Di(28,new Pi(40,47),new Pi(7,48)),new Di(30,new Pi(43,24),new Pi(22,25)),new Di(30,new Pi(10,15),new Pi(67,16))),new t(40,Int32Array.from([6,30,58,86,114,142,170]),new Di(30,new Pi(19,118),new Pi(6,119)),new Di(28,new Pi(18,47),new Pi(31,48)),new Di(30,new Pi(34,24),new Pi(34,25)),new Di(30,new Pi(20,15),new Pi(61,16)))],t}();!function(t){t[t.DATA_MASK_000=0]="DATA_MASK_000",t[t.DATA_MASK_001=1]="DATA_MASK_001",t[t.DATA_MASK_010=2]="DATA_MASK_010",t[t.DATA_MASK_011=3]="DATA_MASK_011",t[t.DATA_MASK_100=4]="DATA_MASK_100",t[t.DATA_MASK_101=5]="DATA_MASK_101",t[t.DATA_MASK_110=6]="DATA_MASK_110",t[t.DATA_MASK_111=7]="DATA_MASK_111"}(Ni||(Ni={}));var Bi,Li=function(){function t(t,e){this.value=t,this.isMasked=e}return t.prototype.unmaskBitMatrix=function(t,e){for(var r=0;r<e;r++)for(var n=0;n<e;n++)this.isMasked(r,n)&&t.flip(n,r)},t.values=new Map([[Ni.DATA_MASK_000,new t(Ni.DATA_MASK_000,function(t,e){return!(t+e&1)})],[Ni.DATA_MASK_001,new t(Ni.DATA_MASK_001,function(t,e){return!(1&t)})],[Ni.DATA_MASK_010,new t(Ni.DATA_MASK_010,function(t,e){return e%3==0})],[Ni.DATA_MASK_011,new t(Ni.DATA_MASK_011,function(t,e){return(t+e)%3==0})],[Ni.DATA_MASK_100,new t(Ni.DATA_MASK_100,function(t,e){return!(Math.floor(t/2)+Math.floor(e/3)&1)})],[Ni.DATA_MASK_101,new t(Ni.DATA_MASK_101,function(t,e){return t*e%6==0})],[Ni.DATA_MASK_110,new t(Ni.DATA_MASK_110,function(t,e){return t*e%6<3})],[Ni.DATA_MASK_111,new t(Ni.DATA_MASK_111,function(t,e){return!(t+e+t*e%3&1)})]]),t}(),Fi=function(){function t(t){var e=t.getHeight();if(e<21||1!=(3&e))throw new Mr;this.bitMatrix=t}return t.prototype.readFormatInformation=function(){if(null!==this.parsedFormatInfo&&void 0!==this.parsedFormatInfo)return this.parsedFormatInfo;for(var t=0,e=0;e<6;e++)t=this.copyBit(e,8,t);t=this.copyBit(7,8,t),t=this.copyBit(8,8,t),t=this.copyBit(8,7,t);for(var r=5;r>=0;r--)t=this.copyBit(8,r,t);var n=this.bitMatrix.getHeight(),o=0,i=n-7;for(r=n-1;r>=i;r--)o=this.copyBit(8,r,o);for(e=n-8;e<n;e++)o=this.copyBit(e,8,o);if(this.parsedFormatInfo=Ri.decodeFormatInformation(t,o),null!==this.parsedFormatInfo)return this.parsedFormatInfo;throw new Mr},t.prototype.readVersion=function(){if(null!==this.parsedVersion&&void 0!==this.parsedVersion)return this.parsedVersion;var t=this.bitMatrix.getHeight(),e=Math.floor((t-17)/4);if(e<=6)return Mi.getVersionForNumber(e);for(var r=0,n=t-11,o=5;o>=0;o--)for(var i=t-9;i>=n;i--)r=this.copyBit(i,o,r);var a=Mi.decodeVersionInformation(r);if(null!==a&&a.getDimensionForVersion()===t)return this.parsedVersion=a,a;for(r=0,i=5;i>=0;i--)for(o=t-9;o>=n;o--)r=this.copyBit(i,o,r);if(null!==(a=Mi.decodeVersionInformation(r))&&a.getDimensionForVersion()===t)return this.parsedVersion=a,a;throw new Mr},t.prototype.copyBit=function(t,e,r){return(this.isMirror?this.bitMatrix.get(e,t):this.bitMatrix.get(t,e))?r<<1|1:r<<1},t.prototype.readCodewords=function(){var t=this.readFormatInformation(),e=this.readVersion(),r=Li.values.get(t.getDataMask()),n=this.bitMatrix.getHeight();r.unmaskBitMatrix(this.bitMatrix,n);for(var o=e.buildFunctionPattern(),i=!0,a=new Uint8Array(e.getTotalCodewords()),s=0,u=0,l=0,c=n-1;c>0;c-=2){6===c&&c--;for(var h=0;h<n;h++)for(var f=i?n-1-h:h,d=0;d<2;d++)o.get(c-d,f)||(l++,u<<=1,this.bitMatrix.get(c-d,f)&&(u|=1),8===l&&(a[s++]=u,l=0,u=0));i=!i}if(s!==e.getTotalCodewords())throw new Mr;return a},t.prototype.remask=function(){if(null!==this.parsedFormatInfo){var t=Li.values[this.parsedFormatInfo.getDataMask()],e=this.bitMatrix.getHeight();t.unmaskBitMatrix(this.bitMatrix,e)}},t.prototype.setMirror=function(t){this.parsedVersion=null,this.parsedFormatInfo=null,this.isMirror=t},t.prototype.mirror=function(){for(var t=this.bitMatrix,e=0,r=t.getWidth();e<r;e++)for(var n=e+1,o=t.getHeight();n<o;n++)t.get(e,n)!==t.get(n,e)&&(t.flip(n,e),t.flip(e,n))},t}(),ji=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Vi=function(){function t(t,e){this.numDataCodewords=t,this.codewords=e}return t.getDataBlocks=function(e,r,n){var o,i,a,s;if(e.length!==r.getTotalCodewords())throw new _r;var u=r.getECBlocksForLevel(n),l=0,c=u.getECBlocks();try{for(var h=ji(c),f=h.next();!f.done;f=h.next())l+=(v=f.value).getCount()}catch(O){o={error:O}}finally{try{f&&!f.done&&(i=h.return)&&i.call(h)}finally{if(o)throw o.error}}var d=new Array(l),p=0;try{for(var g=ji(c),m=g.next();!m.done;m=g.next())for(var v=m.value,y=0;y<v.getCount();y++){var _=v.getDataCodewords(),w=u.getECCodewordsPerBlock()+_;d[p++]=new t(_,new Uint8Array(w))}}catch(O){a={error:O}}finally{try{m&&!m.done&&(s=g.return)&&s.call(g)}finally{if(a)throw a.error}}for(var b=d[0].codewords.length,C=d.length-1;C>=0&&d[C].codewords.length!==b;)C--;C++;var A=b-u.getECCodewordsPerBlock(),E=0;for(y=0;y<A;y++)for(var I=0;I<p;I++)d[I].codewords[y]=e[E++];for(I=C;I<p;I++)d[I].codewords[A]=e[E++];var S=d[0].codewords.length;for(y=A;y<S;y++)for(I=0;I<p;I++){var x=I<C?y:y+1;d[I].codewords[x]=e[E++]}return d},t.prototype.getNumDataCodewords=function(){return this.numDataCodewords},t.prototype.getCodewords=function(){return this.codewords},t}();!function(t){t[t.TERMINATOR=0]="TERMINATOR",t[t.NUMERIC=1]="NUMERIC",t[t.ALPHANUMERIC=2]="ALPHANUMERIC",t[t.STRUCTURED_APPEND=3]="STRUCTURED_APPEND",t[t.BYTE=4]="BYTE",t[t.ECI=5]="ECI",t[t.KANJI=6]="KANJI",t[t.FNC1_FIRST_POSITION=7]="FNC1_FIRST_POSITION",t[t.FNC1_SECOND_POSITION=8]="FNC1_SECOND_POSITION",t[t.HANZI=9]="HANZI"}(Bi||(Bi={}));var Ui,Hi,zi=function(){function t(e,r,n,o){this.value=e,this.stringValue=r,this.characterCountBitsForVersions=n,this.bits=o,t.FOR_BITS.set(o,this),t.FOR_VALUE.set(e,this)}return t.forBits=function(e){var r=t.FOR_BITS.get(e);if(void 0===r)throw new _r;return r},t.prototype.getCharacterCountBits=function(t){var e,r=t.getVersionNumber();return e=r<=9?0:r<=26?1:2,this.characterCountBitsForVersions[e]},t.prototype.getValue=function(){return this.value},t.prototype.getBits=function(){return this.bits},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var r=e;return this.value===r.value},t.prototype.toString=function(){return this.stringValue},t.FOR_BITS=new Map,t.FOR_VALUE=new Map,t.TERMINATOR=new t(Bi.TERMINATOR,"TERMINATOR",Int32Array.from([0,0,0]),0),t.NUMERIC=new t(Bi.NUMERIC,"NUMERIC",Int32Array.from([10,12,14]),1),t.ALPHANUMERIC=new t(Bi.ALPHANUMERIC,"ALPHANUMERIC",Int32Array.from([9,11,13]),2),t.STRUCTURED_APPEND=new t(Bi.STRUCTURED_APPEND,"STRUCTURED_APPEND",Int32Array.from([0,0,0]),3),t.BYTE=new t(Bi.BYTE,"BYTE",Int32Array.from([8,16,16]),4),t.ECI=new t(Bi.ECI,"ECI",Int32Array.from([0,0,0]),7),t.KANJI=new t(Bi.KANJI,"KANJI",Int32Array.from([8,10,12]),8),t.FNC1_FIRST_POSITION=new t(Bi.FNC1_FIRST_POSITION,"FNC1_FIRST_POSITION",Int32Array.from([0,0,0]),5),t.FNC1_SECOND_POSITION=new t(Bi.FNC1_SECOND_POSITION,"FNC1_SECOND_POSITION",Int32Array.from([0,0,0]),9),t.HANZI=new t(Bi.HANZI,"HANZI",Int32Array.from([8,10,12]),13),t}(),Wi=function(){function t(){}return t.decode=function(e,r,n,o){var i=new Ai(e),a=new Hr,s=new Array,u=-1,l=-1;try{var c=null,h=!1,f=void 0;do{if(i.available()<4)f=zi.TERMINATOR;else{var d=i.readBits(4);f=zi.forBits(d)}switch(f){case zi.TERMINATOR:break;case zi.FNC1_FIRST_POSITION:case zi.FNC1_SECOND_POSITION:h=!0;break;case zi.STRUCTURED_APPEND:if(i.available()<16)throw new Mr;u=i.readBits(8),l=i.readBits(8);break;case zi.ECI:var p=t.parseECIValue(i);if(null===(c=Lr.getCharacterSetECIByValue(p)))throw new Mr;break;case zi.HANZI:var g=i.readBits(4),m=i.readBits(f.getCharacterCountBits(r));g===t.GB2312_SUBSET&&t.decodeHanziSegment(i,a,m);break;default:var v=i.readBits(f.getCharacterCountBits(r));switch(f){case zi.NUMERIC:t.decodeNumericSegment(i,a,v);break;case zi.ALPHANUMERIC:t.decodeAlphanumericSegment(i,a,v,h);break;case zi.BYTE:t.decodeByteSegment(i,a,v,c,s,o);break;case zi.KANJI:t.decodeKanjiSegment(i,a,v);break;default:throw new Mr}}}while(f!==zi.TERMINATOR)}catch(y){throw new Mr}return new hn(e,a.toString(),0===s.length?null:s,null===n?null:n.toString(),u,l)},t.decodeHanziSegment=function(t,e,r){if(13*r>t.available())throw new Mr;for(var n=new Uint8Array(2*r),o=0;r>0;){var i=t.readBits(13),a=i/96<<8&4294967295|i%96;a+=a<959?41377:42657,n[o]=a>>8&255,n[o+1]=255&a,o+=2,r--}try{e.append(Vr.decode(n,Ur.GB2312))}catch(s){throw new Mr(s)}},t.decodeKanjiSegment=function(t,e,r){if(13*r>t.available())throw new Mr;for(var n=new Uint8Array(2*r),o=0;r>0;){var i=t.readBits(13),a=i/192<<8&4294967295|i%192;a+=a<7936?33088:49472,n[o]=a>>8,n[o+1]=a,o+=2,r--}try{e.append(Vr.decode(n,Ur.SHIFT_JIS))}catch(s){throw new Mr(s)}},t.decodeByteSegment=function(t,e,r,n,o,i){if(8*r>t.available())throw new Mr;for(var a,s=new Uint8Array(r),u=0;u<r;u++)s[u]=t.readBits(8);a=null===n?Ur.guessEncoding(s,i):n.getName();try{e.append(Vr.decode(s,a))}catch(l){throw new Mr(l)}o.push(s)},t.toAlphaNumericChar=function(e){if(e>=t.ALPHANUMERIC_CHARS.length)throw new Mr;return t.ALPHANUMERIC_CHARS[e]},t.decodeAlphanumericSegment=function(e,r,n,o){for(var i=r.length();n>1;){if(e.available()<11)throw new Mr;var a=e.readBits(11);r.append(t.toAlphaNumericChar(Math.floor(a/45))),r.append(t.toAlphaNumericChar(a%45)),n-=2}if(1===n){if(e.available()<6)throw new Mr;r.append(t.toAlphaNumericChar(e.readBits(6)))}if(o)for(var s=i;s<r.length();s++)"%"===r.charAt(s)&&(s<r.length()-1&&"%"===r.charAt(s+1)?r.deleteCharAt(s+1):r.setCharAt(s,String.fromCharCode(29)))},t.decodeNumericSegment=function(e,r,n){for(;n>=3;){if(e.available()<10)throw new Mr;var o=e.readBits(10);if(o>=1e3)throw new Mr;r.append(t.toAlphaNumericChar(Math.floor(o/100))),r.append(t.toAlphaNumericChar(Math.floor(o/10)%10)),r.append(t.toAlphaNumericChar(o%10)),n-=3}if(2===n){if(e.available()<7)throw new Mr;var i=e.readBits(7);if(i>=100)throw new Mr;r.append(t.toAlphaNumericChar(Math.floor(i/10))),r.append(t.toAlphaNumericChar(i%10))}else if(1===n){if(e.available()<4)throw new Mr;var a=e.readBits(4);if(a>=10)throw new Mr;r.append(t.toAlphaNumericChar(a))}},t.parseECIValue=function(t){var e=t.readBits(8);if(!(128&e))return 127&e;if(128==(192&e))return(63&e)<<8&4294967295|t.readBits(8);if(192==(224&e))return(31&e)<<16&4294967295|t.readBits(16);throw new Mr},t.ALPHANUMERIC_CHARS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",t.GB2312_SUBSET=1,t}(),Gi=function(){function t(t){this.mirrored=t}return t.prototype.isMirrored=function(){return this.mirrored},t.prototype.applyMirroredCorrection=function(t){if(this.mirrored&&null!==t&&!(t.length<3)){var e=t[0];t[0]=t[2],t[2]=e}},t}(),Xi=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},$i=function(){function t(){this.rsDecoder=new Cn(vn.QR_CODE_FIELD_256)}return t.prototype.decodeBooleanArray=function(t,e){return this.decodeBitMatrix(zr.parseFromBooleanArray(t),e)},t.prototype.decodeBitMatrix=function(t,e){var r=new Fi(t),n=null;try{return this.decodeBitMatrixParser(r,e)}catch(i){n=i}try{r.remask(),r.setMirror(!0),r.readVersion(),r.readFormatInformation(),r.mirror();var o=this.decodeBitMatrixParser(r,e);return o.setOther(new Gi(!0)),o}catch(i){if(null!==n)throw n;throw i}},t.prototype.decodeBitMatrixParser=function(t,e){var r,n,o,i,a=t.readVersion(),s=t.readFormatInformation().getErrorCorrectionLevel(),u=t.readCodewords(),l=Vi.getDataBlocks(u,a,s),c=0;try{for(var h=Xi(l),f=h.next();!f.done;f=h.next())c+=(v=f.value).getNumDataCodewords()}catch(b){r={error:b}}finally{try{f&&!f.done&&(n=h.return)&&n.call(h)}finally{if(r)throw r.error}}var d=new Uint8Array(c),p=0;try{for(var g=Xi(l),m=g.next();!m.done;m=g.next()){var v,y=(v=m.value).getCodewords(),_=v.getNumDataCodewords();this.correctErrors(y,_);for(var w=0;w<_;w++)d[p++]=y[w]}}catch(b){o={error:b}}finally{try{m&&!m.done&&(i=g.return)&&i.call(g)}finally{if(o)throw o.error}}return Wi.decode(d,a,s,e)},t.prototype.correctErrors=function(t,e){var r=new Int32Array(t);try{this.rsDecoder.decode(r,t.length-e)}catch(o){throw new Cr}for(var n=0;n<e;n++)t[n]=r[n]},t}(),Yi=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),qi=function(t){function e(e,r,n){var o=t.call(this,e,r)||this;return o.estimatedModuleSize=n,o}return Yi(e,t),e.prototype.aboutEquals=function(t,e,r){if(Math.abs(e-this.getY())<=t&&Math.abs(r-this.getX())<=t){var n=Math.abs(t-this.estimatedModuleSize);return n<=1||n<=this.estimatedModuleSize}return!1},e.prototype.combineEstimate=function(t,r,n){return new e((this.getX()+r)/2,(this.getY()+t)/2,(this.estimatedModuleSize+n)/2)},e}(Sn),Ki=function(){function t(t,e,r,n,o,i,a){this.image=t,this.startX=e,this.startY=r,this.width=n,this.height=o,this.moduleSize=i,this.resultPointCallback=a,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(3)}return t.prototype.find=function(){for(var t=this.startX,e=this.height,r=t+this.width,n=this.startY+e/2,o=new Int32Array(3),i=this.image,a=0;a<e;a++){var s=n+(1&a?-Math.floor((a+1)/2):Math.floor((a+1)/2));o[0]=0,o[1]=0,o[2]=0;for(var u=t;u<r&&!i.get(u,s);)u++;for(var l=0;u<r;){if(i.get(u,s))if(1===l)o[1]++;else if(2===l){var c;if(this.foundPatternCross(o)&&null!==(c=this.handlePossibleCenter(o,s,u)))return c;o[0]=o[2],o[1]=1,o[2]=0,l=1}else o[++l]++;else 1===l&&l++,o[l]++;u++}if(this.foundPatternCross(o)&&null!==(c=this.handlePossibleCenter(o,s,r)))return c}if(0!==this.possibleCenters.length)return this.possibleCenters[0];throw new Gr},t.centerFromEnd=function(t,e){return e-t[2]-t[1]/2},t.prototype.foundPatternCross=function(t){for(var e=this.moduleSize,r=e/2,n=0;n<3;n++)if(Math.abs(e-t[n])>=r)return!1;return!0},t.prototype.crossCheckVertical=function(e,r,n,o){var i=this.image,a=i.getHeight(),s=this.crossCheckStateCount;s[0]=0,s[1]=0,s[2]=0;for(var u=e;u>=0&&i.get(r,u)&&s[1]<=n;)s[1]++,u--;if(u<0||s[1]>n)return NaN;for(;u>=0&&!i.get(r,u)&&s[0]<=n;)s[0]++,u--;if(s[0]>n)return NaN;for(u=e+1;u<a&&i.get(r,u)&&s[1]<=n;)s[1]++,u++;if(u===a||s[1]>n)return NaN;for(;u<a&&!i.get(r,u)&&s[2]<=n;)s[2]++,u++;if(s[2]>n)return NaN;var l=s[0]+s[1]+s[2];return 5*Math.abs(l-o)>=2*o?NaN:this.foundPatternCross(s)?t.centerFromEnd(s,u):NaN},t.prototype.handlePossibleCenter=function(e,r,n){var o,i,a=e[0]+e[1]+e[2],s=t.centerFromEnd(e,n),u=this.crossCheckVertical(r,s,2*e[1],a);if(!isNaN(u)){var l=(e[0]+e[1]+e[2])/3;try{for(var c=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(this.possibleCenters),h=c.next();!h.done;h=c.next()){var f=h.value;if(f.aboutEquals(l,u,s))return f.combineEstimate(u,s,l)}}catch(p){o={error:p}}finally{try{h&&!h.done&&(i=c.return)&&i.call(c)}finally{if(o)throw o.error}}var d=new qi(s,u,l);this.possibleCenters.push(d),null!==this.resultPointCallback&&void 0!==this.resultPointCallback&&this.resultPointCallback.foundPossibleResultPoint(d)}return null},t}(),Zi=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Qi=function(t){function e(e,r,n,o){var i=t.call(this,e,r)||this;return i.estimatedModuleSize=n,i.count=o,void 0===o&&(i.count=1),i}return Zi(e,t),e.prototype.getEstimatedModuleSize=function(){return this.estimatedModuleSize},e.prototype.getCount=function(){return this.count},e.prototype.aboutEquals=function(t,e,r){if(Math.abs(e-this.getY())<=t&&Math.abs(r-this.getX())<=t){var n=Math.abs(t-this.estimatedModuleSize);return n<=1||n<=this.estimatedModuleSize}return!1},e.prototype.combineEstimate=function(t,r,n){var o=this.count+1;return new e((this.count*this.getX()+r)/o,(this.count*this.getY()+t)/o,(this.count*this.estimatedModuleSize+n)/o,o)},e}(Sn),Ji=function(){function t(t){this.bottomLeft=t[0],this.topLeft=t[1],this.topRight=t[2]}return t.prototype.getBottomLeft=function(){return this.bottomLeft},t.prototype.getTopLeft=function(){return this.topLeft},t.prototype.getTopRight=function(){return this.topRight},t}(),ta=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},ea=function(){function t(t,e){this.image=t,this.resultPointCallback=e,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(5),this.resultPointCallback=e}return t.prototype.getImage=function(){return this.image},t.prototype.getPossibleCenters=function(){return this.possibleCenters},t.prototype.find=function(e){var r=null!=e&&void 0!==e.get(Dr.TRY_HARDER),n=null!=e&&void 0!==e.get(Dr.PURE_BARCODE),o=this.image,i=o.getHeight(),a=o.getWidth(),s=Math.floor(3*i/(4*t.MAX_MODULES));(s<t.MIN_SKIP||r)&&(s=t.MIN_SKIP);for(var u=!1,l=new Int32Array(5),c=s-1;c<i&&!u;c+=s){l[0]=0,l[1]=0,l[2]=0,l[3]=0,l[4]=0;for(var h=0,f=0;f<a;f++)if(o.get(f,c))!(1&~h)&&h++,l[h]++;else if(1&h)l[h]++;else if(4===h)if(t.foundPatternCross(l)){if(!0!==this.handlePossibleCenter(l,c,f,n)){l[0]=l[2],l[1]=l[3],l[2]=l[4],l[3]=1,l[4]=0,h=3;continue}if(s=2,!0===this.hasSkipped)u=this.haveMultiplyConfirmedCenters();else{var d=this.findRowSkip();d>l[2]&&(c+=d-l[2]-s,f=a-1)}h=0,l[0]=0,l[1]=0,l[2]=0,l[3]=0,l[4]=0}else l[0]=l[2],l[1]=l[3],l[2]=l[4],l[3]=1,l[4]=0,h=3;else l[++h]++;t.foundPatternCross(l)&&!0===this.handlePossibleCenter(l,c,a,n)&&(s=l[0],this.hasSkipped&&(u=this.haveMultiplyConfirmedCenters()))}var p=this.selectBestPatterns();return Sn.orderBestPatterns(p),new Ji(p)},t.centerFromEnd=function(t,e){return e-t[4]-t[3]-t[2]/2},t.foundPatternCross=function(t){for(var e=0,r=0;r<5;r++){var n=t[r];if(0===n)return!1;e+=n}if(e<7)return!1;var o=e/7,i=o/2;return Math.abs(o-t[0])<i&&Math.abs(o-t[1])<i&&Math.abs(3*o-t[2])<3*i&&Math.abs(o-t[3])<i&&Math.abs(o-t[4])<i},t.prototype.getCrossCheckStateCount=function(){var t=this.crossCheckStateCount;return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t},t.prototype.crossCheckDiagonal=function(e,r,n,o){for(var i=this.getCrossCheckStateCount(),a=0,s=this.image;e>=a&&r>=a&&s.get(r-a,e-a);)i[2]++,a++;if(e<a||r<a)return!1;for(;e>=a&&r>=a&&!s.get(r-a,e-a)&&i[1]<=n;)i[1]++,a++;if(e<a||r<a||i[1]>n)return!1;for(;e>=a&&r>=a&&s.get(r-a,e-a)&&i[0]<=n;)i[0]++,a++;if(i[0]>n)return!1;var u=s.getHeight(),l=s.getWidth();for(a=1;e+a<u&&r+a<l&&s.get(r+a,e+a);)i[2]++,a++;if(e+a>=u||r+a>=l)return!1;for(;e+a<u&&r+a<l&&!s.get(r+a,e+a)&&i[3]<n;)i[3]++,a++;if(e+a>=u||r+a>=l||i[3]>=n)return!1;for(;e+a<u&&r+a<l&&s.get(r+a,e+a)&&i[4]<n;)i[4]++,a++;if(i[4]>=n)return!1;var c=i[0]+i[1]+i[2]+i[3]+i[4];return Math.abs(c-o)<2*o&&t.foundPatternCross(i)},t.prototype.crossCheckVertical=function(e,r,n,o){for(var i=this.image,a=i.getHeight(),s=this.getCrossCheckStateCount(),u=e;u>=0&&i.get(r,u);)s[2]++,u--;if(u<0)return NaN;for(;u>=0&&!i.get(r,u)&&s[1]<=n;)s[1]++,u--;if(u<0||s[1]>n)return NaN;for(;u>=0&&i.get(r,u)&&s[0]<=n;)s[0]++,u--;if(s[0]>n)return NaN;for(u=e+1;u<a&&i.get(r,u);)s[2]++,u++;if(u===a)return NaN;for(;u<a&&!i.get(r,u)&&s[3]<n;)s[3]++,u++;if(u===a||s[3]>=n)return NaN;for(;u<a&&i.get(r,u)&&s[4]<n;)s[4]++,u++;if(s[4]>=n)return NaN;var l=s[0]+s[1]+s[2]+s[3]+s[4];return 5*Math.abs(l-o)>=2*o?NaN:t.foundPatternCross(s)?t.centerFromEnd(s,u):NaN},t.prototype.crossCheckHorizontal=function(e,r,n,o){for(var i=this.image,a=i.getWidth(),s=this.getCrossCheckStateCount(),u=e;u>=0&&i.get(u,r);)s[2]++,u--;if(u<0)return NaN;for(;u>=0&&!i.get(u,r)&&s[1]<=n;)s[1]++,u--;if(u<0||s[1]>n)return NaN;for(;u>=0&&i.get(u,r)&&s[0]<=n;)s[0]++,u--;if(s[0]>n)return NaN;for(u=e+1;u<a&&i.get(u,r);)s[2]++,u++;if(u===a)return NaN;for(;u<a&&!i.get(u,r)&&s[3]<n;)s[3]++,u++;if(u===a||s[3]>=n)return NaN;for(;u<a&&i.get(u,r)&&s[4]<n;)s[4]++,u++;if(s[4]>=n)return NaN;var l=s[0]+s[1]+s[2]+s[3]+s[4];return 5*Math.abs(l-o)>=o?NaN:t.foundPatternCross(s)?t.centerFromEnd(s,u):NaN},t.prototype.handlePossibleCenter=function(e,r,n,o){var i=e[0]+e[1]+e[2]+e[3]+e[4],a=t.centerFromEnd(e,n),s=this.crossCheckVertical(r,Math.floor(a),e[2],i);if(!isNaN(s)&&(a=this.crossCheckHorizontal(Math.floor(a),Math.floor(s),e[2],i),!isNaN(a)&&(!o||this.crossCheckDiagonal(Math.floor(s),Math.floor(a),e[2],i)))){for(var u=i/7,l=!1,c=this.possibleCenters,h=0,f=c.length;h<f;h++){var d=c[h];if(d.aboutEquals(u,s,a)){c[h]=d.combineEstimate(s,a,u),l=!0;break}}if(!l){var p=new Qi(a,s,u);c.push(p),null!==this.resultPointCallback&&void 0!==this.resultPointCallback&&this.resultPointCallback.foundPossibleResultPoint(p)}return!0}return!1},t.prototype.findRowSkip=function(){var e,r;if(this.possibleCenters.length<=1)return 0;var n=null;try{for(var o=ta(this.possibleCenters),i=o.next();!i.done;i=o.next()){var a=i.value;if(a.getCount()>=t.CENTER_QUORUM){if(null!=n)return this.hasSkipped=!0,Math.floor((Math.abs(n.getX()-a.getX())-Math.abs(n.getY()-a.getY()))/2);n=a}}}catch(s){e={error:s}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return 0},t.prototype.haveMultiplyConfirmedCenters=function(){var e,r,n,o,i=0,a=0,s=this.possibleCenters.length;try{for(var u=ta(this.possibleCenters),l=u.next();!l.done;l=u.next())(p=l.value).getCount()>=t.CENTER_QUORUM&&(i++,a+=p.getEstimatedModuleSize())}catch(g){e={error:g}}finally{try{l&&!l.done&&(r=u.return)&&r.call(u)}finally{if(e)throw e.error}}if(i<3)return!1;var c=a/s,h=0;try{for(var f=ta(this.possibleCenters),d=f.next();!d.done;d=f.next()){var p=d.value;h+=Math.abs(p.getEstimatedModuleSize()-c)}}catch(g){n={error:g}}finally{try{d&&!d.done&&(o=f.return)&&o.call(f)}finally{if(n)throw n.error}}return h<=.05*a},t.prototype.selectBestPatterns=function(){var t,e,r,n,o=this.possibleCenters.length;if(o<3)throw new Gr;var i,a=this.possibleCenters;if(o>3){var s=0,u=0;try{for(var l=ta(this.possibleCenters),c=l.next();!c.done;c=l.next()){var h=c.value.getEstimatedModuleSize();s+=h,u+=h*h}}catch(y){t={error:y}}finally{try{c&&!c.done&&(e=l.return)&&e.call(l)}finally{if(t)throw t.error}}i=s/o;var f=Math.sqrt(u/o-i*i);a.sort(function(t,e){var r=Math.abs(e.getEstimatedModuleSize()-i),n=Math.abs(t.getEstimatedModuleSize()-i);return r<n?-1:r>n?1:0});for(var d=Math.max(.2*i,f),p=0;p<a.length&&a.length>3;p++){var g=a[p];Math.abs(g.getEstimatedModuleSize()-i)>d&&(a.splice(p,1),p--)}}if(a.length>3){s=0;try{for(var m=ta(a),v=m.next();!v.done;v=m.next())s+=v.value.getEstimatedModuleSize()}catch(_){r={error:_}}finally{try{v&&!v.done&&(n=m.return)&&n.call(m)}finally{if(r)throw r.error}}i=s/a.length,a.sort(function(t,e){if(e.getCount()===t.getCount()){var r=Math.abs(e.getEstimatedModuleSize()-i),n=Math.abs(t.getEstimatedModuleSize()-i);return r<n?1:r>n?-1:0}return e.getCount()-t.getCount()}),a.splice(3)}return[a[0],a[1],a[2]]},t.CENTER_QUORUM=2,t.MIN_SKIP=3,t.MAX_MODULES=57,t}(),ra=function(){function t(t){this.image=t}return t.prototype.getImage=function(){return this.image},t.prototype.getResultPointCallback=function(){return this.resultPointCallback},t.prototype.detect=function(t){this.resultPointCallback=null==t?null:t.get(Dr.NEED_RESULT_POINT_CALLBACK);var e=new ea(this.image,this.resultPointCallback).find(t);return this.processFinderPatternInfo(e)},t.prototype.processFinderPatternInfo=function(e){var r=e.getTopLeft(),n=e.getTopRight(),o=e.getBottomLeft(),i=this.calculateModuleSize(r,n,o);if(i<1)throw new Gr("No pattern found in proccess finder.");var a=t.computeDimension(r,n,o,i),s=Mi.getProvisionalVersionForDimension(a),u=s.getDimensionForVersion()-7,l=null;if(s.getAlignmentPatternCenters().length>0)for(var c=n.getX()-r.getX()+o.getX(),h=n.getY()-r.getY()+o.getY(),f=1-3/u,d=Math.floor(r.getX()+f*(c-r.getX())),p=Math.floor(r.getY()+f*(h-r.getY())),g=4;g<=16;g<<=1)try{l=this.findAlignmentInRegion(i,d,p,g);break}catch(y){if(!(y instanceof Gr))throw y}var m=t.createTransform(r,n,o,l,a),v=t.sampleGrid(this.image,m,a);return new xn(v,null===l?[o,r,n]:[o,r,n,l])},t.createTransform=function(t,e,r,n,o){var i,a,s,u,l=o-3.5;return null!==n?(i=n.getX(),a=n.getY(),u=s=l-3):(i=e.getX()-t.getX()+r.getX(),a=e.getY()-t.getY()+r.getY(),s=l,u=l),Rn.quadrilateralToQuadrilateral(3.5,3.5,l,3.5,s,u,3.5,l,t.getX(),t.getY(),e.getX(),e.getY(),i,a,r.getX(),r.getY())},t.sampleGrid=function(t,e,r){return Mn.getInstance().sampleGridWithTransform(t,r,r,e)},t.computeDimension=function(t,e,r,n){var o=En.round(Sn.distance(t,e)/n),i=En.round(Sn.distance(t,r)/n),a=Math.floor((o+i)/2)+7;switch(3&a){case 0:a++;break;case 2:a--;break;case 3:throw new Gr("Dimensions could be not found.")}return a},t.prototype.calculateModuleSize=function(t,e,r){return(this.calculateModuleSizeOneWay(t,e)+this.calculateModuleSizeOneWay(t,r))/2},t.prototype.calculateModuleSizeOneWay=function(t,e){var r=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(t.getX()),Math.floor(t.getY()),Math.floor(e.getX()),Math.floor(e.getY())),n=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(e.getX()),Math.floor(e.getY()),Math.floor(t.getX()),Math.floor(t.getY()));return isNaN(r)?n/7:isNaN(n)?r/7:(r+n)/14},t.prototype.sizeOfBlackWhiteBlackRunBothWays=function(t,e,r,n){var o=this.sizeOfBlackWhiteBlackRun(t,e,r,n),i=1,a=t-(r-t);a<0?(i=t/(t-a),a=0):a>=this.image.getWidth()&&(i=(this.image.getWidth()-1-t)/(a-t),a=this.image.getWidth()-1);var s=Math.floor(e-(n-e)*i);return i=1,s<0?(i=e/(e-s),s=0):s>=this.image.getHeight()&&(i=(this.image.getHeight()-1-e)/(s-e),s=this.image.getHeight()-1),a=Math.floor(t+(a-t)*i),(o+=this.sizeOfBlackWhiteBlackRun(t,e,a,s))-1},t.prototype.sizeOfBlackWhiteBlackRun=function(t,e,r,n){var o=Math.abs(n-e)>Math.abs(r-t);if(o){var i=t;t=e,e=i,i=r,r=n,n=i}for(var a=Math.abs(r-t),s=Math.abs(n-e),u=-a/2,l=t<r?1:-1,c=e<n?1:-1,h=0,f=r+l,d=t,p=e;d!==f;d+=l){var g=o?p:d,m=o?d:p;if(1===h===this.image.get(g,m)){if(2===h)return En.distance(d,p,t,e);h++}if((u+=s)>0){if(p===n)break;p+=c,u-=a}}return 2===h?En.distance(r+l,n,t,e):NaN},t.prototype.findAlignmentInRegion=function(t,e,r,n){var o=Math.floor(n*t),i=Math.max(0,e-o),a=Math.min(this.image.getWidth()-1,e+o);if(a-i<3*t)throw new Gr("Alignment top exceeds estimated module size.");var s=Math.max(0,r-o),u=Math.min(this.image.getHeight()-1,r+o);if(u-s<3*t)throw new Gr("Alignment bottom exceeds estimated module size.");return new Ki(this.image,i,s,a-i,u-s,t,this.resultPointCallback).find()},t}(),na=function(){function t(){this.decoder=new $i}return t.prototype.getDecoder=function(){return this.decoder},t.prototype.decode=function(e,r){var n,o;if(null!=r&&void 0!==r.get(Dr.PURE_BARCODE)){var i=t.extractPureBits(e.getBlackMatrix());n=this.decoder.decodeBitMatrix(i,r),o=t.NO_POINTS}else{var a=new ra(e.getBlackMatrix()).detect(r);n=this.decoder.decodeBitMatrix(a.getBits(),r),o=a.getPoints()}n.getOther()instanceof Gi&&n.getOther().applyMirroredCorrection(o);var s=new an(n.getText(),n.getRawBytes(),void 0,o,un.QR_CODE,void 0),u=n.getByteSegments();null!==u&&s.putMetadata(cn.BYTE_SEGMENTS,u);var l=n.getECLevel();return null!==l&&s.putMetadata(cn.ERROR_CORRECTION_LEVEL,l),n.hasStructuredAppend()&&(s.putMetadata(cn.STRUCTURED_APPEND_SEQUENCE,n.getStructuredAppendSequenceNumber()),s.putMetadata(cn.STRUCTURED_APPEND_PARITY,n.getStructuredAppendParity())),s},t.prototype.reset=function(){},t.extractPureBits=function(t){var e=t.getTopLeftOnBit(),r=t.getBottomRightOnBit();if(null===e||null===r)throw new Gr;var n=this.moduleSize(e,t),o=e[1],i=r[1],a=e[0],s=r[0];if(a>=s||o>=i)throw new Gr;if(i-o!=s-a&&(s=a+(i-o))>=t.getWidth())throw new Gr;var u=Math.round((s-a+1)/n),l=Math.round((i-o+1)/n);if(u<=0||l<=0)throw new Gr;if(l!==u)throw new Gr;var c=Math.floor(n/2);o+=c;var h=(a+=c)+Math.floor((u-1)*n)-s;if(h>0){if(h>c)throw new Gr;a-=h}var f=o+Math.floor((l-1)*n)-i;if(f>0){if(f>c)throw new Gr;o-=f}for(var d=new zr(u,l),p=0;p<l;p++)for(var g=o+Math.floor(p*n),m=0;m<u;m++)t.get(a+Math.floor(m*n),g)&&d.set(m,p);return d},t.moduleSize=function(t,e){for(var r=e.getHeight(),n=e.getWidth(),o=t[0],i=t[1],a=!0,s=0;o<n&&i<r;){if(a!==e.get(o,i)){if(5==++s)break;a=!a}o++,i++}if(o===n||i===r)throw new Gr;return(o-t[0])/7},t.NO_POINTS=new Array,t}(),oa=function(){function t(){}return t.prototype.PDF417Common=function(){},t.getBitCountSum=function(t){return En.sum(t)},t.toIntArray=function(e){var r,n;if(null==e||!e.length)return t.EMPTY_INT_ARRAY;var o=new Int32Array(e.length),i=0;try{for(var a=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(e),s=a.next();!s.done;s=a.next()){var u=s.value;o[i++]=u}}catch(l){r={error:l}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return o},t.getCodeword=function(e){var r=Tr.binarySearch(t.SYMBOL_TABLE,262143&e);return r<0?-1:(t.CODEWORD_TABLE[r]-1)%t.NUMBER_OF_CODEWORDS},t.NUMBER_OF_CODEWORDS=929,t.MAX_CODEWORDS_IN_BARCODE=t.NUMBER_OF_CODEWORDS-1,t.MIN_ROWS_IN_BARCODE=3,t.MAX_ROWS_IN_BARCODE=90,t.MODULES_IN_CODEWORD=17,t.MODULES_IN_STOP_PATTERN=18,t.BARS_IN_MODULE=8,t.EMPTY_INT_ARRAY=new Int32Array([]),t.SYMBOL_TABLE=Int32Array.from([66142,66170,66206,66236,66290,66292,66350,66382,66396,66454,66470,66476,66594,66600,66614,66626,66628,66632,66640,66654,66662,66668,66682,66690,66718,66720,66748,66758,66776,66798,66802,66804,66820,66824,66832,66846,66848,66876,66880,66936,66950,66956,66968,66992,67006,67022,67036,67042,67044,67048,67062,67118,67150,67164,67214,67228,67256,67294,67322,67350,67366,67372,67398,67404,67416,67438,67474,67476,67490,67492,67496,67510,67618,67624,67650,67656,67664,67678,67686,67692,67706,67714,67716,67728,67742,67744,67772,67782,67788,67800,67822,67826,67828,67842,67848,67870,67872,67900,67904,67960,67974,67992,68016,68030,68046,68060,68066,68068,68072,68086,68104,68112,68126,68128,68156,68160,68216,68336,68358,68364,68376,68400,68414,68448,68476,68494,68508,68536,68546,68548,68552,68560,68574,68582,68588,68654,68686,68700,68706,68708,68712,68726,68750,68764,68792,68802,68804,68808,68816,68830,68838,68844,68858,68878,68892,68920,68976,68990,68994,68996,69e3,69008,69022,69024,69052,69062,69068,69080,69102,69106,69108,69142,69158,69164,69190,69208,69230,69254,69260,69272,69296,69310,69326,69340,69386,69394,69396,69410,69416,69430,69442,69444,69448,69456,69470,69478,69484,69554,69556,69666,69672,69698,69704,69712,69726,69754,69762,69764,69776,69790,69792,69820,69830,69836,69848,69870,69874,69876,69890,69918,69920,69948,69952,70008,70022,70040,70064,70078,70094,70108,70114,70116,70120,70134,70152,70174,70176,70264,70384,70412,70448,70462,70496,70524,70542,70556,70584,70594,70600,70608,70622,70630,70636,70664,70672,70686,70688,70716,70720,70776,70896,71136,71180,71192,71216,71230,71264,71292,71360,71416,71452,71480,71536,71550,71554,71556,71560,71568,71582,71584,71612,71622,71628,71640,71662,71726,71732,71758,71772,71778,71780,71784,71798,71822,71836,71864,71874,71880,71888,71902,71910,71916,71930,71950,71964,71992,72048,72062,72066,72068,72080,72094,72096,72124,72134,72140,72152,72174,72178,72180,72206,72220,72248,72304,72318,72416,72444,72456,72464,72478,72480,72508,72512,72568,72588,72600,72624,72638,72654,72668,72674,72676,72680,72694,72726,72742,72748,72774,72780,72792,72814,72838,72856,72880,72894,72910,72924,72930,72932,72936,72950,72966,72972,72984,73008,73022,73056,73084,73102,73116,73144,73156,73160,73168,73182,73190,73196,73210,73226,73234,73236,73250,73252,73256,73270,73282,73284,73296,73310,73318,73324,73346,73348,73352,73360,73374,73376,73404,73414,73420,73432,73454,73498,73518,73522,73524,73550,73564,73570,73572,73576,73590,73800,73822,73858,73860,73872,73886,73888,73916,73944,73970,73972,73992,74014,74016,74044,74048,74104,74118,74136,74160,74174,74210,74212,74216,74230,74244,74256,74270,74272,74360,74480,74502,74508,74544,74558,74592,74620,74638,74652,74680,74690,74696,74704,74726,74732,74782,74784,74812,74992,75232,75288,75326,75360,75388,75456,75512,75576,75632,75646,75650,75652,75664,75678,75680,75708,75718,75724,75736,75758,75808,75836,75840,75896,76016,76256,76736,76824,76848,76862,76896,76924,76992,77048,77296,77340,77368,77424,77438,77536,77564,77572,77576,77584,77600,77628,77632,77688,77702,77708,77720,77744,77758,77774,77788,77870,77902,77916,77922,77928,77966,77980,78008,78018,78024,78032,78046,78060,78074,78094,78136,78192,78206,78210,78212,78224,78238,78240,78268,78278,78284,78296,78322,78324,78350,78364,78448,78462,78560,78588,78600,78622,78624,78652,78656,78712,78726,78744,78768,78782,78798,78812,78818,78820,78824,78838,78862,78876,78904,78960,78974,79072,79100,79296,79352,79368,79376,79390,79392,79420,79424,79480,79600,79628,79640,79664,79678,79712,79740,79772,79800,79810,79812,79816,79824,79838,79846,79852,79894,79910,79916,79942,79948,79960,79982,79988,80006,80024,80048,80062,80078,80092,80098,80100,80104,80134,80140,80176,80190,80224,80252,80270,80284,80312,80328,80336,80350,80358,80364,80378,80390,80396,80408,80432,80446,80480,80508,80576,80632,80654,80668,80696,80752,80766,80776,80784,80798,80800,80828,80844,80856,80878,80882,80884,80914,80916,80930,80932,80936,80950,80962,80968,80976,80990,80998,81004,81026,81028,81040,81054,81056,81084,81094,81100,81112,81134,81154,81156,81160,81168,81182,81184,81212,81216,81272,81286,81292,81304,81328,81342,81358,81372,81380,81384,81398,81434,81454,81458,81460,81486,81500,81506,81508,81512,81526,81550,81564,81592,81602,81604,81608,81616,81630,81638,81644,81702,81708,81722,81734,81740,81752,81774,81778,81780,82050,82078,82080,82108,82180,82184,82192,82206,82208,82236,82240,82296,82316,82328,82352,82366,82402,82404,82408,82440,82448,82462,82464,82492,82496,82552,82672,82694,82700,82712,82736,82750,82784,82812,82830,82882,82884,82888,82896,82918,82924,82952,82960,82974,82976,83004,83008,83064,83184,83424,83468,83480,83504,83518,83552,83580,83648,83704,83740,83768,83824,83838,83842,83844,83848,83856,83872,83900,83910,83916,83928,83950,83984,84e3,84028,84032,84088,84208,84448,84928,85040,85054,85088,85116,85184,85240,85488,85560,85616,85630,85728,85756,85764,85768,85776,85790,85792,85820,85824,85880,85894,85900,85912,85936,85966,85980,86048,86080,86136,86256,86496,86976,88160,88188,88256,88312,88560,89056,89200,89214,89312,89340,89536,89592,89608,89616,89632,89664,89720,89840,89868,89880,89904,89952,89980,89998,90012,90040,90190,90204,90254,90268,90296,90306,90308,90312,90334,90382,90396,90424,90480,90494,90500,90504,90512,90526,90528,90556,90566,90572,90584,90610,90612,90638,90652,90680,90736,90750,90848,90876,90884,90888,90896,90910,90912,90940,90944,91e3,91014,91020,91032,91056,91070,91086,91100,91106,91108,91112,91126,91150,91164,91192,91248,91262,91360,91388,91584,91640,91664,91678,91680,91708,91712,91768,91888,91928,91952,91966,92e3,92028,92046,92060,92088,92098,92100,92104,92112,92126,92134,92140,92188,92216,92272,92384,92412,92608,92664,93168,93200,93214,93216,93244,93248,93304,93424,93664,93720,93744,93758,93792,93820,93888,93944,93980,94008,94064,94078,94084,94088,94096,94110,94112,94140,94150,94156,94168,94246,94252,94278,94284,94296,94318,94342,94348,94360,94384,94398,94414,94428,94440,94470,94476,94488,94512,94526,94560,94588,94606,94620,94648,94658,94660,94664,94672,94686,94694,94700,94714,94726,94732,94744,94768,94782,94816,94844,94912,94968,94990,95004,95032,95088,95102,95112,95120,95134,95136,95164,95180,95192,95214,95218,95220,95244,95256,95280,95294,95328,95356,95424,95480,95728,95758,95772,95800,95856,95870,95968,95996,96008,96016,96030,96032,96060,96064,96120,96152,96176,96190,96220,96226,96228,96232,96290,96292,96296,96310,96322,96324,96328,96336,96350,96358,96364,96386,96388,96392,96400,96414,96416,96444,96454,96460,96472,96494,96498,96500,96514,96516,96520,96528,96542,96544,96572,96576,96632,96646,96652,96664,96688,96702,96718,96732,96738,96740,96744,96758,96772,96776,96784,96798,96800,96828,96832,96888,97008,97030,97036,97048,97072,97086,97120,97148,97166,97180,97208,97220,97224,97232,97246,97254,97260,97326,97330,97332,97358,97372,97378,97380,97384,97398,97422,97436,97464,97474,97476,97480,97488,97502,97510,97516,97550,97564,97592,97648,97666,97668,97672,97680,97694,97696,97724,97734,97740,97752,97774,97830,97836,97850,97862,97868,97880,97902,97906,97908,97926,97932,97944,97968,97998,98012,98018,98020,98024,98038,98618,98674,98676,98838,98854,98874,98892,98904,98926,98930,98932,98968,99006,99042,99044,99048,99062,99166,99194,99246,99286,99350,99366,99372,99386,99398,99416,99438,99442,99444,99462,99504,99518,99534,99548,99554,99556,99560,99574,99590,99596,99608,99632,99646,99680,99708,99726,99740,99768,99778,99780,99784,99792,99806,99814,99820,99834,99858,99860,99874,99880,99894,99906,99920,99934,99962,99970,99972,99976,99984,99998,1e5,100028,100038,100044,100056,100078,100082,100084,100142,100174,100188,100246,100262,100268,100306,100308,100390,100396,100410,100422,100428,100440,100462,100466,100468,100486,100504,100528,100542,100558,100572,100578,100580,100584,100598,100620,100656,100670,100704,100732,100750,100792,100802,100808,100816,100830,100838,100844,100858,100888,100912,100926,100960,100988,101056,101112,101148,101176,101232,101246,101250,101252,101256,101264,101278,101280,101308,101318,101324,101336,101358,101362,101364,101410,101412,101416,101430,101442,101448,101456,101470,101478,101498,101506,101508,101520,101534,101536,101564,101580,101618,101620,101636,101640,101648,101662,101664,101692,101696,101752,101766,101784,101838,101858,101860,101864,101934,101938,101940,101966,101980,101986,101988,101992,102030,102044,102072,102082,102084,102088,102096,102138,102166,102182,102188,102214,102220,102232,102254,102282,102290,102292,102306,102308,102312,102326,102444,102458,102470,102476,102488,102514,102516,102534,102552,102576,102590,102606,102620,102626,102632,102646,102662,102668,102704,102718,102752,102780,102798,102812,102840,102850,102856,102864,102878,102886,102892,102906,102936,102974,103008,103036,103104,103160,103224,103280,103294,103298,103300,103312,103326,103328,103356,103366,103372,103384,103406,103410,103412,103472,103486,103520,103548,103616,103672,103920,103992,104048,104062,104160,104188,104194,104196,104200,104208,104224,104252,104256,104312,104326,104332,104344,104368,104382,104398,104412,104418,104420,104424,104482,104484,104514,104520,104528,104542,104550,104570,104578,104580,104592,104606,104608,104636,104652,104690,104692,104706,104712,104734,104736,104764,104768,104824,104838,104856,104910,104930,104932,104936,104968,104976,104990,104992,105020,105024,105080,105200,105240,105278,105312,105372,105410,105412,105416,105424,105446,105518,105524,105550,105564,105570,105572,105576,105614,105628,105656,105666,105672,105680,105702,105722,105742,105756,105784,105840,105854,105858,105860,105864,105872,105888,105932,105970,105972,106006,106022,106028,106054,106060,106072,106100,106118,106124,106136,106160,106174,106190,106210,106212,106216,106250,106258,106260,106274,106276,106280,106306,106308,106312,106320,106334,106348,106394,106414,106418,106420,106566,106572,106610,106612,106630,106636,106648,106672,106686,106722,106724,106728,106742,106758,106764,106776,106800,106814,106848,106876,106894,106908,106936,106946,106948,106952,106960,106974,106982,106988,107032,107056,107070,107104,107132,107200,107256,107292,107320,107376,107390,107394,107396,107400,107408,107422,107424,107452,107462,107468,107480,107502,107506,107508,107544,107568,107582,107616,107644,107712,107768,108016,108060,108088,108144,108158,108256,108284,108290,108292,108296,108304,108318,108320,108348,108352,108408,108422,108428,108440,108464,108478,108494,108508,108514,108516,108520,108592,108640,108668,108736,108792,109040,109536,109680,109694,109792,109820,110016,110072,110084,110088,110096,110112,110140,110144,110200,110320,110342,110348,110360,110384,110398,110432,110460,110478,110492,110520,110532,110536,110544,110558,110658,110686,110714,110722,110724,110728,110736,110750,110752,110780,110796,110834,110836,110850,110852,110856,110864,110878,110880,110908,110912,110968,110982,111e3,111054,111074,111076,111080,111108,111112,111120,111134,111136,111164,111168,111224,111344,111372,111422,111456,111516,111554,111556,111560,111568,111590,111632,111646,111648,111676,111680,111736,111856,112096,112152,112224,112252,112320,112440,112514,112516,112520,112528,112542,112544,112588,112686,112718,112732,112782,112796,112824,112834,112836,112840,112848,112870,112890,112910,112924,112952,113008,113022,113026,113028,113032,113040,113054,113056,113100,113138,113140,113166,113180,113208,113264,113278,113376,113404,113416,113424,113440,113468,113472,113560,113614,113634,113636,113640,113686,113702,113708,113734,113740,113752,113778,113780,113798,113804,113816,113840,113854,113870,113890,113892,113896,113926,113932,113944,113968,113982,114016,114044,114076,114114,114116,114120,114128,114150,114170,114194,114196,114210,114212,114216,114242,114244,114248,114256,114270,114278,114306,114308,114312,114320,114334,114336,114364,114380,114420,114458,114478,114482,114484,114510,114524,114530,114532,114536,114842,114866,114868,114970,114994,114996,115042,115044,115048,115062,115130,115226,115250,115252,115278,115292,115298,115300,115304,115318,115342,115394,115396,115400,115408,115422,115430,115436,115450,115478,115494,115514,115526,115532,115570,115572,115738,115758,115762,115764,115790,115804,115810,115812,115816,115830,115854,115868,115896,115906,115912,115920,115934,115942,115948,115962,115996,116024,116080,116094,116098,116100,116104,116112,116126,116128,116156,116166,116172,116184,116206,116210,116212,116246,116262,116268,116282,116294,116300,116312,116334,116338,116340,116358,116364,116376,116400,116414,116430,116444,116450,116452,116456,116498,116500,116514,116520,116534,116546,116548,116552,116560,116574,116582,116588,116602,116654,116694,116714,116762,116782,116786,116788,116814,116828,116834,116836,116840,116854,116878,116892,116920,116930,116936,116944,116958,116966,116972,116986,117006,117048,117104,117118,117122,117124,117136,117150,117152,117180,117190,117196,117208,117230,117234,117236,117304,117360,117374,117472,117500,117506,117508,117512,117520,117536,117564,117568,117624,117638,117644,117656,117680,117694,117710,117724,117730,117732,117736,117750,117782,117798,117804,117818,117830,117848,117874,117876,117894,117936,117950,117966,117986,117988,117992,118022,118028,118040,118064,118078,118112,118140,118172,118210,118212,118216,118224,118238,118246,118266,118306,118312,118338,118352,118366,118374,118394,118402,118404,118408,118416,118430,118432,118460,118476,118514,118516,118574,118578,118580,118606,118620,118626,118628,118632,118678,118694,118700,118730,118738,118740,118830,118834,118836,118862,118876,118882,118884,118888,118902,118926,118940,118968,118978,118980,118984,118992,119006,119014,119020,119034,119068,119096,119152,119166,119170,119172,119176,119184,119198,119200,119228,119238,119244,119256,119278,119282,119284,119324,119352,119408,119422,119520,119548,119554,119556,119560,119568,119582,119584,119612,119616,119672,119686,119692,119704,119728,119742,119758,119772,119778,119780,119784,119798,119920,119934,120032,120060,120256,120312,120324,120328,120336,120352,120384,120440,120560,120582,120588,120600,120624,120638,120672,120700,120718,120732,120760,120770,120772,120776,120784,120798,120806,120812,120870,120876,120890,120902,120908,120920,120946,120948,120966,120972,120984,121008,121022,121038,121058,121060,121064,121078,121100,121112,121136,121150,121184,121212,121244,121282,121284,121288,121296,121318,121338,121356,121368,121392,121406,121440,121468,121536,121592,121656,121730,121732,121736,121744,121758,121760,121804,121842,121844,121890,121922,121924,121928,121936,121950,121958,121978,121986,121988,121992,122e3,122014,122016,122044,122060,122098,122100,122116,122120,122128,122142,122144,122172,122176,122232,122246,122264,122318,122338,122340,122344,122414,122418,122420,122446,122460,122466,122468,122472,122510,122524,122552,122562,122564,122568,122576,122598,122618,122646,122662,122668,122694,122700,122712,122738,122740,122762,122770,122772,122786,122788,122792,123018,123026,123028,123042,123044,123048,123062,123098,123146,123154,123156,123170,123172,123176,123190,123202,123204,123208,123216,123238,123244,123258,123290,123314,123316,123402,123410,123412,123426,123428,123432,123446,123458,123464,123472,123486,123494,123500,123514,123522,123524,123528,123536,123552,123580,123590,123596,123608,123630,123634,123636,123674,123698,123700,123740,123746,123748,123752,123834,123914,123922,123924,123938,123944,123958,123970,123976,123984,123998,124006,124012,124026,124034,124036,124048,124062,124064,124092,124102,124108,124120,124142,124146,124148,124162,124164,124168,124176,124190,124192,124220,124224,124280,124294,124300,124312,124336,124350,124366,124380,124386,124388,124392,124406,124442,124462,124466,124468,124494,124508,124514,124520,124558,124572,124600,124610,124612,124616,124624,124646,124666,124694,124710,124716,124730,124742,124748,124760,124786,124788,124818,124820,124834,124836,124840,124854,124946,124948,124962,124964,124968,124982,124994,124996,125e3,125008,125022,125030,125036,125050,125058,125060,125064,125072,125086,125088,125116,125126,125132,125144,125166,125170,125172,125186,125188,125192,125200,125216,125244,125248,125304,125318,125324,125336,125360,125374,125390,125404,125410,125412,125416,125430,125444,125448,125456,125472,125504,125560,125680,125702,125708,125720,125744,125758,125792,125820,125838,125852,125880,125890,125892,125896,125904,125918,125926,125932,125978,125998,126002,126004,126030,126044,126050,126052,126056,126094,126108,126136,126146,126148,126152,126160,126182,126202,126222,126236,126264,126320,126334,126338,126340,126344,126352,126366,126368,126412,126450,126452,126486,126502,126508,126522,126534,126540,126552,126574,126578,126580,126598,126604,126616,126640,126654,126670,126684,126690,126692,126696,126738,126754,126756,126760,126774,126786,126788,126792,126800,126814,126822,126828,126842,126894,126898,126900,126934,127126,127142,127148,127162,127178,127186,127188,127254,127270,127276,127290,127302,127308,127320,127342,127346,127348,127370,127378,127380,127394,127396,127400,127450,127510,127526,127532,127546,127558,127576,127598,127602,127604,127622,127628,127640,127664,127678,127694,127708,127714,127716,127720,127734,127754,127762,127764,127778,127784,127810,127812,127816,127824,127838,127846,127866,127898,127918,127922,127924,128022,128038,128044,128058,128070,128076,128088,128110,128114,128116,128134,128140,128152,128176,128190,128206,128220,128226,128228,128232,128246,128262,128268,128280,128304,128318,128352,128380,128398,128412,128440,128450,128452,128456,128464,128478,128486,128492,128506,128522,128530,128532,128546,128548,128552,128566,128578,128580,128584,128592,128606,128614,128634,128642,128644,128648,128656,128670,128672,128700,128716,128754,128756,128794,128814,128818,128820,128846,128860,128866,128868,128872,128886,128918,128934,128940,128954,128978,128980,129178,129198,129202,129204,129238,129258,129306,129326,129330,129332,129358,129372,129378,129380,129384,129398,129430,129446,129452,129466,129482,129490,129492,129562,129582,129586,129588,129614,129628,129634,129636,129640,129654,129678,129692,129720,129730,129732,129736,129744,129758,129766,129772,129814,129830,129836,129850,129862,129868,129880,129902,129906,129908,129930,129938,129940,129954,129956,129960,129974,130010]),t.CODEWORD_TABLE=Int32Array.from([2627,1819,2622,2621,1813,1812,2729,2724,2723,2779,2774,2773,902,896,908,868,865,861,859,2511,873,871,1780,835,2493,825,2491,842,837,844,1764,1762,811,810,809,2483,807,2482,806,2480,815,814,813,812,2484,817,816,1745,1744,1742,1746,2655,2637,2635,2626,2625,2623,2628,1820,2752,2739,2737,2728,2727,2725,2730,2785,2783,2778,2777,2775,2780,787,781,747,739,736,2413,754,752,1719,692,689,681,2371,678,2369,700,697,694,703,1688,1686,642,638,2343,631,2341,627,2338,651,646,643,2345,654,652,1652,1650,1647,1654,601,599,2322,596,2321,594,2319,2317,611,610,608,606,2324,603,2323,615,614,612,1617,1616,1614,1612,616,1619,1618,2575,2538,2536,905,901,898,909,2509,2507,2504,870,867,864,860,2512,875,872,1781,2490,2489,2487,2485,1748,836,834,832,830,2494,827,2492,843,841,839,845,1765,1763,2701,2676,2674,2653,2648,2656,2634,2633,2631,2629,1821,2638,2636,2770,2763,2761,2750,2745,2753,2736,2735,2733,2731,1848,2740,2738,2786,2784,591,588,576,569,566,2296,1590,537,534,526,2276,522,2274,545,542,539,548,1572,1570,481,2245,466,2242,462,2239,492,485,482,2249,496,494,1534,1531,1528,1538,413,2196,406,2191,2188,425,419,2202,415,2199,432,430,427,1472,1467,1464,433,1476,1474,368,367,2160,365,2159,362,2157,2155,2152,378,377,375,2166,372,2165,369,2162,383,381,379,2168,1419,1418,1416,1414,385,1411,384,1423,1422,1420,1424,2461,802,2441,2439,790,786,783,794,2409,2406,2403,750,742,738,2414,756,753,1720,2367,2365,2362,2359,1663,693,691,684,2373,680,2370,702,699,696,704,1690,1687,2337,2336,2334,2332,1624,2329,1622,640,637,2344,634,2342,630,2340,650,648,645,2346,655,653,1653,1651,1649,1655,2612,2597,2595,2571,2568,2565,2576,2534,2529,2526,1787,2540,2537,907,904,900,910,2503,2502,2500,2498,1768,2495,1767,2510,2508,2506,869,866,863,2513,876,874,1782,2720,2713,2711,2697,2694,2691,2702,2672,2670,2664,1828,2678,2675,2647,2646,2644,2642,1823,2639,1822,2654,2652,2650,2657,2771,1855,2765,2762,1850,1849,2751,2749,2747,2754,353,2148,344,342,336,2142,332,2140,345,1375,1373,306,2130,299,2128,295,2125,319,314,311,2132,1354,1352,1349,1356,262,257,2101,253,2096,2093,274,273,267,2107,263,2104,280,278,275,1316,1311,1308,1320,1318,2052,202,2050,2044,2040,219,2063,212,2060,208,2055,224,221,2066,1260,1258,1252,231,1248,229,1266,1264,1261,1268,155,1998,153,1996,1994,1991,1988,165,164,2007,162,2006,159,2003,2e3,172,171,169,2012,166,2010,1186,1184,1182,1179,175,1176,173,1192,1191,1189,1187,176,1194,1193,2313,2307,2305,592,589,2294,2292,2289,578,572,568,2297,580,1591,2272,2267,2264,1547,538,536,529,2278,525,2275,547,544,541,1574,1571,2237,2235,2229,1493,2225,1489,478,2247,470,2244,465,2241,493,488,484,2250,498,495,1536,1533,1530,1539,2187,2186,2184,2182,1432,2179,1430,2176,1427,414,412,2197,409,2195,405,2193,2190,426,424,421,2203,418,2201,431,429,1473,1471,1469,1466,434,1477,1475,2478,2472,2470,2459,2457,2454,2462,803,2437,2432,2429,1726,2443,2440,792,789,785,2401,2399,2393,1702,2389,1699,2411,2408,2405,745,741,2415,758,755,1721,2358,2357,2355,2353,1661,2350,1660,2347,1657,2368,2366,2364,2361,1666,690,687,2374,683,2372,701,698,705,1691,1689,2619,2617,2610,2608,2605,2613,2593,2588,2585,1803,2599,2596,2563,2561,2555,1797,2551,1795,2573,2570,2567,2577,2525,2524,2522,2520,1786,2517,1785,2514,1783,2535,2533,2531,2528,1788,2541,2539,906,903,911,2721,1844,2715,2712,1838,1836,2699,2696,2693,2703,1827,1826,1824,2673,2671,2669,2666,1829,2679,2677,1858,1857,2772,1854,1853,1851,1856,2766,2764,143,1987,139,1986,135,133,131,1984,128,1983,125,1981,138,137,136,1985,1133,1132,1130,112,110,1974,107,1973,104,1971,1969,122,121,119,117,1977,114,1976,124,1115,1114,1112,1110,1117,1116,84,83,1953,81,1952,78,1950,1948,1945,94,93,91,1959,88,1958,85,1955,99,97,95,1961,1086,1085,1083,1081,1078,100,1090,1089,1087,1091,49,47,1917,44,1915,1913,1910,1907,59,1926,56,1925,53,1922,1919,66,64,1931,61,1929,1042,1040,1038,71,1035,70,1032,68,1048,1047,1045,1043,1050,1049,12,10,1869,1867,1864,1861,21,1880,19,1877,1874,1871,28,1888,25,1886,22,1883,982,980,977,974,32,30,991,989,987,984,34,995,994,992,2151,2150,2147,2146,2144,356,355,354,2149,2139,2138,2136,2134,1359,343,341,338,2143,335,2141,348,347,346,1376,1374,2124,2123,2121,2119,1326,2116,1324,310,308,305,2131,302,2129,298,2127,320,318,316,313,2133,322,321,1355,1353,1351,1357,2092,2091,2089,2087,1276,2084,1274,2081,1271,259,2102,256,2100,252,2098,2095,272,269,2108,266,2106,281,279,277,1317,1315,1313,1310,282,1321,1319,2039,2037,2035,2032,1203,2029,1200,1197,207,2053,205,2051,201,2049,2046,2043,220,218,2064,215,2062,211,2059,228,226,223,2069,1259,1257,1254,232,1251,230,1267,1265,1263,2316,2315,2312,2311,2309,2314,2304,2303,2301,2299,1593,2308,2306,590,2288,2287,2285,2283,1578,2280,1577,2295,2293,2291,579,577,574,571,2298,582,581,1592,2263,2262,2260,2258,1545,2255,1544,2252,1541,2273,2271,2269,2266,1550,535,532,2279,528,2277,546,543,549,1575,1573,2224,2222,2220,1486,2217,1485,2214,1482,1479,2238,2236,2234,2231,1496,2228,1492,480,477,2248,473,2246,469,2243,490,487,2251,497,1537,1535,1532,2477,2476,2474,2479,2469,2468,2466,2464,1730,2473,2471,2453,2452,2450,2448,1729,2445,1728,2460,2458,2456,2463,805,804,2428,2427,2425,2423,1725,2420,1724,2417,1722,2438,2436,2434,2431,1727,2444,2442,793,791,788,795,2388,2386,2384,1697,2381,1696,2378,1694,1692,2402,2400,2398,2395,1703,2392,1701,2412,2410,2407,751,748,744,2416,759,757,1807,2620,2618,1806,1805,2611,2609,2607,2614,1802,1801,1799,2594,2592,2590,2587,1804,2600,2598,1794,1793,1791,1789,2564,2562,2560,2557,1798,2554,1796,2574,2572,2569,2578,1847,1846,2722,1843,1842,1840,1845,2716,2714,1835,1834,1832,1830,1839,1837,2700,2698,2695,2704,1817,1811,1810,897,862,1777,829,826,838,1760,1758,808,2481,1741,1740,1738,1743,2624,1818,2726,2776,782,740,737,1715,686,679,695,1682,1680,639,628,2339,647,644,1645,1643,1640,1648,602,600,597,595,2320,593,2318,609,607,604,1611,1610,1608,1606,613,1615,1613,2328,926,924,892,886,899,857,850,2505,1778,824,823,821,819,2488,818,2486,833,831,828,840,1761,1759,2649,2632,2630,2746,2734,2732,2782,2781,570,567,1587,531,527,523,540,1566,1564,476,467,463,2240,486,483,1524,1521,1518,1529,411,403,2192,399,2189,423,416,1462,1457,1454,428,1468,1465,2210,366,363,2158,360,2156,357,2153,376,373,370,2163,1410,1409,1407,1405,382,1402,380,1417,1415,1412,1421,2175,2174,777,774,771,784,732,725,722,2404,743,1716,676,674,668,2363,665,2360,685,1684,1681,626,624,622,2335,620,2333,617,2330,641,635,649,1646,1644,1642,2566,928,925,2530,2527,894,891,888,2501,2499,2496,858,856,854,851,1779,2692,2668,2665,2645,2643,2640,2651,2768,2759,2757,2744,2743,2741,2748,352,1382,340,337,333,1371,1369,307,300,296,2126,315,312,1347,1342,1350,261,258,250,2097,246,2094,271,268,264,1306,1301,1298,276,1312,1309,2115,203,2048,195,2045,191,2041,213,209,2056,1246,1244,1238,225,1234,222,1256,1253,1249,1262,2080,2079,154,1997,150,1995,147,1992,1989,163,160,2004,156,2001,1175,1174,1172,1170,1167,170,1164,167,1185,1183,1180,1177,174,1190,1188,2025,2024,2022,587,586,564,559,556,2290,573,1588,520,518,512,2268,508,2265,530,1568,1565,461,457,2233,450,2230,446,2226,479,471,489,1526,1523,1520,397,395,2185,392,2183,389,2180,2177,410,2194,402,422,1463,1461,1459,1456,1470,2455,799,2433,2430,779,776,773,2397,2394,2390,734,728,724,746,1717,2356,2354,2351,2348,1658,677,675,673,670,667,688,1685,1683,2606,2589,2586,2559,2556,2552,927,2523,2521,2518,2515,1784,2532,895,893,890,2718,2709,2707,2689,2687,2684,2663,2662,2660,2658,1825,2667,2769,1852,2760,2758,142,141,1139,1138,134,132,129,126,1982,1129,1128,1126,1131,113,111,108,105,1972,101,1970,120,118,115,1109,1108,1106,1104,123,1113,1111,82,79,1951,75,1949,72,1946,92,89,86,1956,1077,1076,1074,1072,98,1069,96,1084,1082,1079,1088,1968,1967,48,45,1916,42,1914,39,1911,1908,60,57,54,1923,50,1920,1031,1030,1028,1026,67,1023,65,1020,62,1041,1039,1036,1033,69,1046,1044,1944,1943,1941,11,9,1868,7,1865,1862,1859,20,1878,16,1875,13,1872,970,968,966,963,29,960,26,23,983,981,978,975,33,971,31,990,988,985,1906,1904,1902,993,351,2145,1383,331,330,328,326,2137,323,2135,339,1372,1370,294,293,291,289,2122,286,2120,283,2117,309,303,317,1348,1346,1344,245,244,242,2090,239,2088,236,2085,2082,260,2099,249,270,1307,1305,1303,1300,1314,189,2038,186,2036,183,2033,2030,2026,206,198,2047,194,216,1247,1245,1243,1240,227,1237,1255,2310,2302,2300,2286,2284,2281,565,563,561,558,575,1589,2261,2259,2256,2253,1542,521,519,517,514,2270,511,533,1569,1567,2223,2221,2218,2215,1483,2211,1480,459,456,453,2232,449,474,491,1527,1525,1522,2475,2467,2465,2451,2449,2446,801,800,2426,2424,2421,2418,1723,2435,780,778,775,2387,2385,2382,2379,1695,2375,1693,2396,735,733,730,727,749,1718,2616,2615,2604,2603,2601,2584,2583,2581,2579,1800,2591,2550,2549,2547,2545,1792,2542,1790,2558,929,2719,1841,2710,2708,1833,1831,2690,2688,2686,1815,1809,1808,1774,1756,1754,1737,1736,1734,1739,1816,1711,1676,1674,633,629,1638,1636,1633,1641,598,1605,1604,1602,1600,605,1609,1607,2327,887,853,1775,822,820,1757,1755,1584,524,1560,1558,468,464,1514,1511,1508,1519,408,404,400,1452,1447,1444,417,1458,1455,2208,364,361,358,2154,1401,1400,1398,1396,374,1393,371,1408,1406,1403,1413,2173,2172,772,726,723,1712,672,669,666,682,1678,1675,625,623,621,618,2331,636,632,1639,1637,1635,920,918,884,880,889,849,848,847,846,2497,855,852,1776,2641,2742,2787,1380,334,1367,1365,301,297,1340,1338,1335,1343,255,251,247,1296,1291,1288,265,1302,1299,2113,204,196,192,2042,1232,1230,1224,214,1220,210,1242,1239,1235,1250,2077,2075,151,148,1993,144,1990,1163,1162,1160,1158,1155,161,1152,157,1173,1171,1168,1165,168,1181,1178,2021,2020,2018,2023,585,560,557,1585,516,509,1562,1559,458,447,2227,472,1516,1513,1510,398,396,393,390,2181,386,2178,407,1453,1451,1449,1446,420,1460,2209,769,764,720,712,2391,729,1713,664,663,661,659,2352,656,2349,671,1679,1677,2553,922,919,2519,2516,885,883,881,2685,2661,2659,2767,2756,2755,140,1137,1136,130,127,1125,1124,1122,1127,109,106,102,1103,1102,1100,1098,116,1107,1105,1980,80,76,73,1947,1068,1067,1065,1063,90,1060,87,1075,1073,1070,1080,1966,1965,46,43,40,1912,36,1909,1019,1018,1016,1014,58,1011,55,1008,51,1029,1027,1024,1021,63,1037,1034,1940,1939,1937,1942,8,1866,4,1863,1,1860,956,954,952,949,946,17,14,969,967,964,961,27,957,24,979,976,972,1901,1900,1898,1896,986,1905,1903,350,349,1381,329,327,324,1368,1366,292,290,287,284,2118,304,1341,1339,1337,1345,243,240,237,2086,233,2083,254,1297,1295,1293,1290,1304,2114,190,187,184,2034,180,2031,177,2027,199,1233,1231,1229,1226,217,1223,1241,2078,2076,584,555,554,552,550,2282,562,1586,507,506,504,502,2257,499,2254,515,1563,1561,445,443,441,2219,438,2216,435,2212,460,454,475,1517,1515,1512,2447,798,797,2422,2419,770,768,766,2383,2380,2376,721,719,717,714,731,1714,2602,2582,2580,2548,2546,2543,923,921,2717,2706,2705,2683,2682,2680,1771,1752,1750,1733,1732,1731,1735,1814,1707,1670,1668,1631,1629,1626,1634,1599,1598,1596,1594,1603,1601,2326,1772,1753,1751,1581,1554,1552,1504,1501,1498,1509,1442,1437,1434,401,1448,1445,2206,1392,1391,1389,1387,1384,359,1399,1397,1394,1404,2171,2170,1708,1672,1669,619,1632,1630,1628,1773,1378,1363,1361,1333,1328,1336,1286,1281,1278,248,1292,1289,2111,1218,1216,1210,197,1206,193,1228,1225,1221,1236,2073,2071,1151,1150,1148,1146,152,1143,149,1140,145,1161,1159,1156,1153,158,1169,1166,2017,2016,2014,2019,1582,510,1556,1553,452,448,1506,1500,394,391,387,1443,1441,1439,1436,1450,2207,765,716,713,1709,662,660,657,1673,1671,916,914,879,878,877,882,1135,1134,1121,1120,1118,1123,1097,1096,1094,1092,103,1101,1099,1979,1059,1058,1056,1054,77,1051,74,1066,1064,1061,1071,1964,1963,1007,1006,1004,1002,999,41,996,37,1017,1015,1012,1009,52,1025,1022,1936,1935,1933,1938,942,940,938,935,932,5,2,955,953,950,947,18,943,15,965,962,958,1895,1894,1892,1890,973,1899,1897,1379,325,1364,1362,288,285,1334,1332,1330,241,238,234,1287,1285,1283,1280,1294,2112,188,185,181,178,2028,1219,1217,1215,1212,200,1209,1227,2074,2072,583,553,551,1583,505,503,500,513,1557,1555,444,442,439,436,2213,455,451,1507,1505,1502,796,763,762,760,767,711,710,708,706,2377,718,715,1710,2544,917,915,2681,1627,1597,1595,2325,1769,1749,1747,1499,1438,1435,2204,1390,1388,1385,1395,2169,2167,1704,1665,1662,1625,1623,1620,1770,1329,1282,1279,2109,1214,1207,1222,2068,2065,1149,1147,1144,1141,146,1157,1154,2013,2011,2008,2015,1579,1549,1546,1495,1487,1433,1431,1428,1425,388,1440,2205,1705,658,1667,1664,1119,1095,1093,1978,1057,1055,1052,1062,1962,1960,1005,1003,1e3,997,38,1013,1010,1932,1930,1927,1934,941,939,936,933,6,930,3,951,948,944,1889,1887,1884,1881,959,1893,1891,35,1377,1360,1358,1327,1325,1322,1331,1277,1275,1272,1269,235,1284,2110,1205,1204,1201,1198,182,1195,179,1213,2070,2067,1580,501,1551,1548,440,437,1497,1494,1490,1503,761,709,707,1706,913,912,2198,1386,2164,2161,1621,1766,2103,1208,2058,2054,1145,1142,2005,2002,1999,2009,1488,1429,1426,2200,1698,1659,1656,1975,1053,1957,1954,1001,998,1924,1921,1918,1928,937,934,931,1879,1876,1873,1870,945,1885,1882,1323,1273,1270,2105,1202,1199,1196,1211,2061,2057,1576,1543,1540,1484,1481,1478,1491,1700]),t}(),ia=function(){function t(t,e){this.bits=t,this.points=e}return t.prototype.getBits=function(){return this.bits},t.prototype.getPoints=function(){return this.points},t}(),aa=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},sa=function(){function t(){}return t.detectMultiple=function(e,r,n){var o=e.getBlackMatrix(),i=t.detect(n,o);return i.length||((o=o.clone()).rotate180(),i=t.detect(n,o)),new ia(o,i)},t.detect=function(e,r){for(var n,o,i=new Array,a=0,s=0,u=!1;a<r.getHeight();){var l=t.findVertices(r,a,s);if(null!=l[0]||null!=l[3]){if(u=!0,i.push(l),!e)break;null!=l[2]?(s=Math.trunc(l[2].getX()),a=Math.trunc(l[2].getY())):(s=Math.trunc(l[4].getX()),a=Math.trunc(l[4].getY()))}else{if(!u)break;u=!1,s=0;try{for(var c=(n=void 0,aa(i)),h=c.next();!h.done;h=c.next()){var f=h.value;null!=f[1]&&(a=Math.trunc(Math.max(a,f[1].getY()))),null!=f[3]&&(a=Math.max(a,Math.trunc(f[3].getY())))}}catch(d){n={error:d}}finally{try{h&&!h.done&&(o=c.return)&&o.call(c)}finally{if(n)throw n.error}}a+=t.ROW_STEP}}return i},t.findVertices=function(e,r,n){var o=e.getHeight(),i=e.getWidth(),a=new Array(8);return t.copyToResult(a,t.findRowsWithPattern(e,o,i,r,n,t.START_PATTERN),t.INDEXES_START_PATTERN),null!=a[4]&&(n=Math.trunc(a[4].getX()),r=Math.trunc(a[4].getY())),t.copyToResult(a,t.findRowsWithPattern(e,o,i,r,n,t.STOP_PATTERN),t.INDEXES_STOP_PATTERN),a},t.copyToResult=function(t,e,r){for(var n=0;n<r.length;n++)t[r[n]]=e[n]},t.findRowsWithPattern=function(e,r,n,o,i,a){for(var s=new Array(4),u=!1,l=new Int32Array(a.length);o<r;o+=t.ROW_STEP)if(null!=(d=t.findGuardPattern(e,i,o,n,!1,a,l))){for(;o>0;){if(null==(f=t.findGuardPattern(e,i,--o,n,!1,a,l))){o++;break}d=f}s[0]=new Sn(d[0],o),s[1]=new Sn(d[1],o),u=!0;break}var c=o+1;if(u){for(var h=0,f=Int32Array.from([Math.trunc(s[0].getX()),Math.trunc(s[1].getX())]);c<r;c++){var d;if(null!=(d=t.findGuardPattern(e,f[0],c,n,!1,a,l))&&Math.abs(f[0]-d[0])<t.MAX_PATTERN_DRIFT&&Math.abs(f[1]-d[1])<t.MAX_PATTERN_DRIFT)f=d,h=0;else{if(h>t.SKIPPED_ROW_COUNT_MAX)break;h++}}c-=h+1,s[2]=new Sn(f[0],c),s[3]=new Sn(f[1],c)}return c-o<t.BARCODE_MIN_HEIGHT&&Tr.fill(s,null),s},t.findGuardPattern=function(e,r,n,o,i,a,s){Tr.fillWithin(s,0,s.length,0);for(var u=r,l=0;e.get(u,n)&&u>0&&l++<t.MAX_PIXEL_DRIFT;)u--;for(var c=u,h=0,f=a.length,d=i;c<o;c++)if(e.get(c,n)!==d)s[h]++;else{if(h===f-1){if(t.patternMatchVariance(s,a,t.MAX_INDIVIDUAL_VARIANCE)<t.MAX_AVG_VARIANCE)return new Int32Array([u,c]);u+=s[0]+s[1],Er.arraycopy(s,2,s,0,h-1),s[h-1]=0,s[h]=0,h--}else h++;s[h]=1,d=!d}return h===f-1&&t.patternMatchVariance(s,a,t.MAX_INDIVIDUAL_VARIANCE)<t.MAX_AVG_VARIANCE?new Int32Array([u,c-1]):null},t.patternMatchVariance=function(t,e,r){for(var n=t.length,o=0,i=0,a=0;a<n;a++)o+=t[a],i+=e[a];if(o<i)return 1/0;var s=o/i;r*=s;for(var u=0,l=0;l<n;l++){var c=t[l],h=e[l]*s,f=c>h?c-h:h-c;if(f>r)return 1/0;u+=f}return u/o},t.INDEXES_START_PATTERN=Int32Array.from([0,4,1,5]),t.INDEXES_STOP_PATTERN=Int32Array.from([6,2,7,3]),t.MAX_AVG_VARIANCE=.42,t.MAX_INDIVIDUAL_VARIANCE=.8,t.START_PATTERN=Int32Array.from([8,1,1,1,1,1,1,3]),t.STOP_PATTERN=Int32Array.from([7,1,1,3,1,1,1,2,1]),t.MAX_PIXEL_DRIFT=3,t.MAX_PATTERN_DRIFT=5,t.SKIPPED_ROW_COUNT_MAX=25,t.ROW_STEP=5,t.BARCODE_MIN_HEIGHT=10,t}(),ua=function(){function t(t,e){if(0===e.length)throw new _r;this.field=t;var r=e.length;if(r>1&&0===e[0]){for(var n=1;n<r&&0===e[n];)n++;n===r?this.coefficients=new Int32Array([0]):(this.coefficients=new Int32Array(r-n),Er.arraycopy(e,n,this.coefficients,0,this.coefficients.length))}else this.coefficients=e}return t.prototype.getCoefficients=function(){return this.coefficients},t.prototype.getDegree=function(){return this.coefficients.length-1},t.prototype.isZero=function(){return 0===this.coefficients[0]},t.prototype.getCoefficient=function(t){return this.coefficients[this.coefficients.length-1-t]},t.prototype.evaluateAt=function(t){var e,r;if(0===t)return this.getCoefficient(0);if(1===t){var n=0;try{for(var o=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(this.coefficients),i=o.next();!i.done;i=o.next()){var a=i.value;n=this.field.add(n,a)}}catch(c){e={error:c}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return n}for(var s=this.coefficients[0],u=this.coefficients.length,l=1;l<u;l++)s=this.field.add(this.field.multiply(t,s),this.coefficients[l]);return s},t.prototype.add=function(e){if(!this.field.equals(e.field))throw new _r("ModulusPolys do not have same ModulusGF field");if(this.isZero())return e;if(e.isZero())return this;var r=this.coefficients,n=e.coefficients;if(r.length>n.length){var o=r;r=n,n=o}var i=new Int32Array(n.length),a=n.length-r.length;Er.arraycopy(n,0,i,0,a);for(var s=a;s<n.length;s++)i[s]=this.field.add(r[s-a],n[s]);return new t(this.field,i)},t.prototype.subtract=function(t){if(!this.field.equals(t.field))throw new _r("ModulusPolys do not have same ModulusGF field");return t.isZero()?this:this.add(t.negative())},t.prototype.multiply=function(e){return e instanceof t?this.multiplyOther(e):this.multiplyScalar(e)},t.prototype.multiplyOther=function(e){if(!this.field.equals(e.field))throw new _r("ModulusPolys do not have same ModulusGF field");if(this.isZero()||e.isZero())return new t(this.field,new Int32Array([0]));for(var r=this.coefficients,n=r.length,o=e.coefficients,i=o.length,a=new Int32Array(n+i-1),s=0;s<n;s++)for(var u=r[s],l=0;l<i;l++)a[s+l]=this.field.add(a[s+l],this.field.multiply(u,o[l]));return new t(this.field,a)},t.prototype.negative=function(){for(var e=this.coefficients.length,r=new Int32Array(e),n=0;n<e;n++)r[n]=this.field.subtract(0,this.coefficients[n]);return new t(this.field,r)},t.prototype.multiplyScalar=function(e){if(0===e)return new t(this.field,new Int32Array([0]));if(1===e)return this;for(var r=this.coefficients.length,n=new Int32Array(r),o=0;o<r;o++)n[o]=this.field.multiply(this.coefficients[o],e);return new t(this.field,n)},t.prototype.multiplyByMonomial=function(e,r){if(e<0)throw new _r;if(0===r)return new t(this.field,new Int32Array([0]));for(var n=this.coefficients.length,o=new Int32Array(n+e),i=0;i<n;i++)o[i]=this.field.multiply(this.coefficients[i],r);return new t(this.field,o)},t.prototype.toString=function(){for(var t=new Hr,e=this.getDegree();e>=0;e--){var r=this.getCoefficient(e);0!==r&&(r<0?(t.append(" - "),r=-r):t.length()>0&&t.append(" + "),0!==e&&1===r||t.append(r),0!==e&&(1===e?t.append("x"):(t.append("x^"),t.append(e))))}return t.toString()},t}(),la=function(){function t(){}return t.prototype.add=function(t,e){return(t+e)%this.modulus},t.prototype.subtract=function(t,e){return(this.modulus+t-e)%this.modulus},t.prototype.exp=function(t){return this.expTable[t]},t.prototype.log=function(t){if(0===t)throw new _r;return this.logTable[t]},t.prototype.inverse=function(t){if(0===t)throw new gn;return this.expTable[this.modulus-this.logTable[t]-1]},t.prototype.multiply=function(t,e){return 0===t||0===e?0:this.expTable[(this.logTable[t]+this.logTable[e])%(this.modulus-1)]},t.prototype.getSize=function(){return this.modulus},t.prototype.equals=function(t){return t===this},t}(),ca=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ha=function(t){function e(e,r){var n=t.call(this)||this;n.modulus=e,n.expTable=new Int32Array(e),n.logTable=new Int32Array(e);for(var o=1,i=0;i<e;i++)n.expTable[i]=o,o=o*r%e;for(i=0;i<e-1;i++)n.logTable[n.expTable[i]]=i;return n.zero=new ua(n,new Int32Array([0])),n.one=new ua(n,new Int32Array([1])),n}return ca(e,t),e.prototype.getZero=function(){return this.zero},e.prototype.getOne=function(){return this.one},e.prototype.buildMonomial=function(t,e){if(t<0)throw new _r;if(0===e)return this.zero;var r=new Int32Array(t+1);return r[0]=e,new ua(this,r)},e.PDF417_GF=new e(oa.NUMBER_OF_CODEWORDS,3),e}(la),fa=function(){function t(){this.field=ha.PDF417_GF}return t.prototype.decode=function(t,e,r){for(var n,o,i=new ua(this.field,t),a=new Int32Array(e),s=!1,u=e;u>0;u--){var l=i.evaluateAt(this.field.exp(u));a[e-u]=l,0!==l&&(s=!0)}if(!s)return 0;var c=this.field.getOne();if(null!=r)try{for(var h=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(r),f=h.next();!f.done;f=h.next()){var d=f.value,p=this.field.exp(t.length-1-d),g=new ua(this.field,new Int32Array([this.field.subtract(0,p),1]));c=c.multiply(g)}}catch(A){n={error:A}}finally{try{f&&!f.done&&(o=h.return)&&o.call(h)}finally{if(n)throw n.error}}var m=new ua(this.field,a),v=this.runEuclideanAlgorithm(this.field.buildMonomial(e,1),m,e),y=v[0],_=v[1],w=this.findErrorLocations(y),b=this.findErrorMagnitudes(_,y,w);for(u=0;u<w.length;u++){var C=t.length-1-this.field.log(w[u]);if(C<0)throw Cr.getChecksumInstance();t[C]=this.field.subtract(t[C],b[u])}return w.length},t.prototype.runEuclideanAlgorithm=function(t,e,r){if(t.getDegree()<e.getDegree()){var n=t;t=e,e=n}for(var o=t,i=e,a=this.field.getZero(),s=this.field.getOne();i.getDegree()>=Math.round(r/2);){var u=o,l=a;if(a=s,(o=i).isZero())throw Cr.getChecksumInstance();i=u;for(var c=this.field.getZero(),h=o.getCoefficient(o.getDegree()),f=this.field.inverse(h);i.getDegree()>=o.getDegree()&&!i.isZero();){var d=i.getDegree()-o.getDegree(),p=this.field.multiply(i.getCoefficient(i.getDegree()),f);c=c.add(this.field.buildMonomial(d,p)),i=i.subtract(o.multiplyByMonomial(d,p))}s=c.multiply(a).subtract(l).negative()}var g=s.getCoefficient(0);if(0===g)throw Cr.getChecksumInstance();var m=this.field.inverse(g);return[s.multiply(m),i.multiply(m)]},t.prototype.findErrorLocations=function(t){for(var e=t.getDegree(),r=new Int32Array(e),n=0,o=1;o<this.field.getSize()&&n<e;o++)0===t.evaluateAt(o)&&(r[n]=this.field.inverse(o),n++);if(n!==e)throw Cr.getChecksumInstance();return r},t.prototype.findErrorMagnitudes=function(t,e,r){for(var n=e.getDegree(),o=new Int32Array(n),i=1;i<=n;i++)o[n-i]=this.field.multiply(i,e.getCoefficient(i));var a=new ua(this.field,o),s=r.length,u=new Int32Array(s);for(i=0;i<s;i++){var l=this.field.inverse(r[i]),c=this.field.subtract(0,t.evaluateAt(l)),h=this.field.inverse(a.evaluateAt(l));u[i]=this.field.multiply(c,h)}return u},t}(),da=function(){function t(e,r,n,o,i){e instanceof t?this.constructor_2(e):this.constructor_1(e,r,n,o,i)}return t.prototype.constructor_1=function(t,e,r,n,o){var i=null==e||null==r,a=null==n||null==o;if(i&&a)throw new Gr;i?(e=new Sn(0,n.getY()),r=new Sn(0,o.getY())):a&&(n=new Sn(t.getWidth()-1,e.getY()),o=new Sn(t.getWidth()-1,r.getY())),this.image=t,this.topLeft=e,this.bottomLeft=r,this.topRight=n,this.bottomRight=o,this.minX=Math.trunc(Math.min(e.getX(),r.getX())),this.maxX=Math.trunc(Math.max(n.getX(),o.getX())),this.minY=Math.trunc(Math.min(e.getY(),n.getY())),this.maxY=Math.trunc(Math.max(r.getY(),o.getY()))},t.prototype.constructor_2=function(t){this.image=t.image,this.topLeft=t.getTopLeft(),this.bottomLeft=t.getBottomLeft(),this.topRight=t.getTopRight(),this.bottomRight=t.getBottomRight(),this.minX=t.getMinX(),this.maxX=t.getMaxX(),this.minY=t.getMinY(),this.maxY=t.getMaxY()},t.merge=function(e,r){return null==e?r:null==r?e:new t(e.image,e.topLeft,e.bottomLeft,r.topRight,r.bottomRight)},t.prototype.addMissingRows=function(e,r,n){var o=this.topLeft,i=this.bottomLeft,a=this.topRight,s=this.bottomRight;if(e>0){var u=n?this.topLeft:this.topRight,l=Math.trunc(u.getY()-e);l<0&&(l=0);var c=new Sn(u.getX(),l);n?o=c:a=c}if(r>0){var h=n?this.bottomLeft:this.bottomRight,f=Math.trunc(h.getY()+r);f>=this.image.getHeight()&&(f=this.image.getHeight()-1);var d=new Sn(h.getX(),f);n?i=d:s=d}return new t(this.image,o,i,a,s)},t.prototype.getMinX=function(){return this.minX},t.prototype.getMaxX=function(){return this.maxX},t.prototype.getMinY=function(){return this.minY},t.prototype.getMaxY=function(){return this.maxY},t.prototype.getTopLeft=function(){return this.topLeft},t.prototype.getTopRight=function(){return this.topRight},t.prototype.getBottomLeft=function(){return this.bottomLeft},t.prototype.getBottomRight=function(){return this.bottomRight},t}(),pa=function(){function t(t,e,r,n){this.columnCount=t,this.errorCorrectionLevel=n,this.rowCountUpperPart=e,this.rowCountLowerPart=r,this.rowCount=e+r}return t.prototype.getColumnCount=function(){return this.columnCount},t.prototype.getErrorCorrectionLevel=function(){return this.errorCorrectionLevel},t.prototype.getRowCount=function(){return this.rowCount},t.prototype.getRowCountUpperPart=function(){return this.rowCountUpperPart},t.prototype.getRowCountLowerPart=function(){return this.rowCountLowerPart},t}(),ga=function(){function t(){this.buffer=""}return t.form=function(t,e){var r=-1;return t.replace(/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g,function(t,n,o,i,a,s){if("%%"===t)return"%";if(void 0!==e[++r]){t=i?parseInt(i.substr(1)):void 0;var u,l=a?parseInt(a.substr(1)):void 0;switch(s){case"s":u=e[r];break;case"c":u=e[r][0];break;case"f":u=parseFloat(e[r]).toFixed(t);break;case"p":u=parseFloat(e[r]).toPrecision(t);break;case"e":u=parseFloat(e[r]).toExponential(t);break;case"x":u=parseInt(e[r]).toString(l||16);break;case"d":u=parseFloat(parseInt(e[r],l||10).toPrecision(t)).toFixed(0)}u="object"==typeof u?JSON.stringify(u):(+u).toString(l);for(var c=parseInt(o),h=o&&o[0]+""=="0"?"0":" ";u.length<c;)u=void 0!==n?u+h:h+u;return u}})},t.prototype.format=function(e){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this.buffer+=t.form(e,r)},t.prototype.toString=function(){return this.buffer},t}(),ma=function(){function t(t){this.boundingBox=new da(t),this.codewords=new Array(t.getMaxY()-t.getMinY()+1)}return t.prototype.getCodewordNearby=function(e){var r=this.getCodeword(e);if(null!=r)return r;for(var n=1;n<t.MAX_NEARBY_DISTANCE;n++){var o=this.imageRowToCodewordIndex(e)-n;if(o>=0&&null!=(r=this.codewords[o]))return r;if((o=this.imageRowToCodewordIndex(e)+n)<this.codewords.length&&null!=(r=this.codewords[o]))return r}return null},t.prototype.imageRowToCodewordIndex=function(t){return t-this.boundingBox.getMinY()},t.prototype.setCodeword=function(t,e){this.codewords[this.imageRowToCodewordIndex(t)]=e},t.prototype.getCodeword=function(t){return this.codewords[this.imageRowToCodewordIndex(t)]},t.prototype.getBoundingBox=function(){return this.boundingBox},t.prototype.getCodewords=function(){return this.codewords},t.prototype.toString=function(){var t,e,r=new ga,n=0;try{for(var o=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(this.codewords),i=o.next();!i.done;i=o.next()){var a=i.value;null!=a?r.format("%3d: %3d|%3d%n",n++,a.getRowNumber(),a.getValue()):r.format("%3d: | %n",n++)}}catch(s){t={error:s}}finally{try{i&&!i.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}return r.toString()},t.MAX_NEARBY_DISTANCE=5,t}(),va=function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(s){o={error:s}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},ya=function(){function t(){this.values=new Map}return t.prototype.setValue=function(t){t=Math.trunc(t);var e=this.values.get(t);null==e&&(e=0),e++,this.values.set(t,e)},t.prototype.getValue=function(){var t,e,r=-1,n=new Array,o=function(t,e){var o=function(){return t},i=function(){return e};i()>r?(r=i(),(n=[]).push(o())):i()===r&&n.push(o())};try{for(var i=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(this.values.entries()),a=i.next();!a.done;a=i.next()){var s=va(a.value,2);o(s[0],s[1])}}catch(u){t={error:u}}finally{try{a&&!a.done&&(e=i.return)&&e.call(i)}finally{if(t)throw t.error}}return oa.toIntArray(n)},t.prototype.getConfidence=function(t){return this.values.get(t)},t}(),_a=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),wa=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},ba=function(t){function e(e,r){var n=t.call(this,e)||this;return n._isLeft=r,n}return _a(e,t),e.prototype.setRowNumbers=function(){var t,e;try{for(var r=wa(this.getCodewords()),n=r.next();!n.done;n=r.next()){var o=n.value;null!=o&&o.setRowNumberAsRowIndicatorColumn()}}catch(i){t={error:i}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}},e.prototype.adjustCompleteIndicatorColumnRowNumbers=function(t){var e=this.getCodewords();this.setRowNumbers(),this.removeIncorrectCodewords(e,t);for(var r=this.getBoundingBox(),n=this._isLeft?r.getTopLeft():r.getTopRight(),o=this._isLeft?r.getBottomLeft():r.getBottomRight(),i=this.imageRowToCodewordIndex(Math.trunc(n.getY())),a=this.imageRowToCodewordIndex(Math.trunc(o.getY())),s=-1,u=1,l=0,c=i;c<a;c++)if(null!=e[c]){var h=e[c],f=h.getRowNumber()-s;if(0===f)l++;else if(1===f)u=Math.max(u,l),l=1,s=h.getRowNumber();else if(f<0||h.getRowNumber()>=t.getRowCount()||f>c)e[c]=null;else{for(var d,p=(d=u>2?(u-2)*f:f)>=c,g=1;g<=d&&!p;g++)p=null!=e[c-g];p?e[c]=null:(s=h.getRowNumber(),l=1)}}},e.prototype.getRowHeights=function(){var t,e,r=this.getBarcodeMetadata();if(null==r)return null;this.adjustIncompleteIndicatorColumnRowNumbers(r);var n=new Int32Array(r.getRowCount());try{for(var o=wa(this.getCodewords()),i=o.next();!i.done;i=o.next()){var a=i.value;if(null!=a){var s=a.getRowNumber();if(s>=n.length)continue;n[s]++}}}catch(u){t={error:u}}finally{try{i&&!i.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}return n},e.prototype.adjustIncompleteIndicatorColumnRowNumbers=function(t){for(var e=this.getBoundingBox(),r=this._isLeft?e.getTopLeft():e.getTopRight(),n=this._isLeft?e.getBottomLeft():e.getBottomRight(),o=this.imageRowToCodewordIndex(Math.trunc(r.getY())),i=this.imageRowToCodewordIndex(Math.trunc(n.getY())),a=this.getCodewords(),s=-1,u=o;u<i;u++)if(null!=a[u]){var l=a[u];l.setRowNumberAsRowIndicatorColumn();var c=l.getRowNumber()-s;0===c||(1===c?s=l.getRowNumber():l.getRowNumber()>=t.getRowCount()?a[u]=null:s=l.getRowNumber())}},e.prototype.getBarcodeMetadata=function(){var t,e,r=this.getCodewords(),n=new ya,o=new ya,i=new ya,a=new ya;try{for(var s=wa(r),u=s.next();!u.done;u=s.next()){var l=u.value;if(null!=l){l.setRowNumberAsRowIndicatorColumn();var c=l.getValue()%30,h=l.getRowNumber();switch(this._isLeft||(h+=2),h%3){case 0:o.setValue(3*c+1);break;case 1:a.setValue(c/3),i.setValue(c%3);break;case 2:n.setValue(c+1)}}}}catch(d){t={error:d}}finally{try{u&&!u.done&&(e=s.return)&&e.call(s)}finally{if(t)throw t.error}}if(0===n.getValue().length||0===o.getValue().length||0===i.getValue().length||0===a.getValue().length||n.getValue()[0]<1||o.getValue()[0]+i.getValue()[0]<oa.MIN_ROWS_IN_BARCODE||o.getValue()[0]+i.getValue()[0]>oa.MAX_ROWS_IN_BARCODE)return null;var f=new pa(n.getValue()[0],o.getValue()[0],i.getValue()[0],a.getValue()[0]);return this.removeIncorrectCodewords(r,f),f},e.prototype.removeIncorrectCodewords=function(t,e){for(var r=0;r<t.length;r++){var n=t[r];if(null!=t[r]){var o=n.getValue()%30,i=n.getRowNumber();if(i>e.getRowCount())t[r]=null;else switch(this._isLeft||(i+=2),i%3){case 0:3*o+1!==e.getRowCountUpperPart()&&(t[r]=null);break;case 1:Math.trunc(o/3)===e.getErrorCorrectionLevel()&&o%3===e.getRowCountLowerPart()||(t[r]=null);break;case 2:o+1!==e.getColumnCount()&&(t[r]=null)}}}},e.prototype.isLeft=function(){return this._isLeft},e.prototype.toString=function(){return"IsLeft: "+this._isLeft+"\n"+t.prototype.toString.call(this)},e}(ma),Ca=function(){function t(t,e){this.ADJUST_ROW_NUMBER_SKIP=2,this.barcodeMetadata=t,this.barcodeColumnCount=t.getColumnCount(),this.boundingBox=e,this.detectionResultColumns=new Array(this.barcodeColumnCount+2)}return t.prototype.getDetectionResultColumns=function(){this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[0]),this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[this.barcodeColumnCount+1]);var t,e=oa.MAX_CODEWORDS_IN_BARCODE;do{t=e,e=this.adjustRowNumbersAndGetCount()}while(e>0&&e<t);return this.detectionResultColumns},t.prototype.adjustIndicatorColumnRowNumbers=function(t){null!=t&&t.adjustCompleteIndicatorColumnRowNumbers(this.barcodeMetadata)},t.prototype.adjustRowNumbersAndGetCount=function(){var t=this.adjustRowNumbersByRow();if(0===t)return 0;for(var e=1;e<this.barcodeColumnCount+1;e++)for(var r=this.detectionResultColumns[e].getCodewords(),n=0;n<r.length;n++)null!=r[n]&&(r[n].hasValidRowNumber()||this.adjustRowNumbers(e,n,r));return t},t.prototype.adjustRowNumbersByRow=function(){return this.adjustRowNumbersFromBothRI(),this.adjustRowNumbersFromLRI()+this.adjustRowNumbersFromRRI()},t.prototype.adjustRowNumbersFromBothRI=function(){if(null!=this.detectionResultColumns[0]&&null!=this.detectionResultColumns[this.barcodeColumnCount+1])for(var t=this.detectionResultColumns[0].getCodewords(),e=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords(),r=0;r<t.length;r++)if(null!=t[r]&&null!=e[r]&&t[r].getRowNumber()===e[r].getRowNumber())for(var n=1;n<=this.barcodeColumnCount;n++){var o=this.detectionResultColumns[n].getCodewords()[r];null!=o&&(o.setRowNumber(t[r].getRowNumber()),o.hasValidRowNumber()||(this.detectionResultColumns[n].getCodewords()[r]=null))}},t.prototype.adjustRowNumbersFromRRI=function(){if(null==this.detectionResultColumns[this.barcodeColumnCount+1])return 0;for(var e=0,r=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords(),n=0;n<r.length;n++)if(null!=r[n])for(var o=r[n].getRowNumber(),i=0,a=this.barcodeColumnCount+1;a>0&&i<this.ADJUST_ROW_NUMBER_SKIP;a--){var s=this.detectionResultColumns[a].getCodewords()[n];null!=s&&(i=t.adjustRowNumberIfValid(o,i,s),s.hasValidRowNumber()||e++)}return e},t.prototype.adjustRowNumbersFromLRI=function(){if(null==this.detectionResultColumns[0])return 0;for(var e=0,r=this.detectionResultColumns[0].getCodewords(),n=0;n<r.length;n++)if(null!=r[n])for(var o=r[n].getRowNumber(),i=0,a=1;a<this.barcodeColumnCount+1&&i<this.ADJUST_ROW_NUMBER_SKIP;a++){var s=this.detectionResultColumns[a].getCodewords()[n];null!=s&&(i=t.adjustRowNumberIfValid(o,i,s),s.hasValidRowNumber()||e++)}return e},t.adjustRowNumberIfValid=function(t,e,r){return null==r||r.hasValidRowNumber()||(r.isValidRowNumber(t)?(r.setRowNumber(t),e=0):++e),e},t.prototype.adjustRowNumbers=function(e,r,n){var o,i,a=n[r],s=this.detectionResultColumns[e-1].getCodewords(),u=s;null!=this.detectionResultColumns[e+1]&&(u=this.detectionResultColumns[e+1].getCodewords());var l=new Array(14);l[2]=s[r],l[3]=u[r],r>0&&(l[0]=n[r-1],l[4]=s[r-1],l[5]=u[r-1]),r>1&&(l[8]=n[r-2],l[10]=s[r-2],l[11]=u[r-2]),r<n.length-1&&(l[1]=n[r+1],l[6]=s[r+1],l[7]=u[r+1]),r<n.length-2&&(l[9]=n[r+2],l[12]=s[r+2],l[13]=u[r+2]);try{for(var c=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(l),h=c.next();!h.done;h=c.next()){var f=h.value;if(t.adjustRowNumber(a,f))return}}catch(d){o={error:d}}finally{try{h&&!h.done&&(i=c.return)&&i.call(c)}finally{if(o)throw o.error}}},t.adjustRowNumber=function(t,e){return!(null==e||!e.hasValidRowNumber()||e.getBucket()!==t.getBucket()||(t.setRowNumber(e.getRowNumber()),0))},t.prototype.getBarcodeColumnCount=function(){return this.barcodeColumnCount},t.prototype.getBarcodeRowCount=function(){return this.barcodeMetadata.getRowCount()},t.prototype.getBarcodeECLevel=function(){return this.barcodeMetadata.getErrorCorrectionLevel()},t.prototype.setBoundingBox=function(t){this.boundingBox=t},t.prototype.getBoundingBox=function(){return this.boundingBox},t.prototype.setDetectionResultColumn=function(t,e){this.detectionResultColumns[t]=e},t.prototype.getDetectionResultColumn=function(t){return this.detectionResultColumns[t]},t.prototype.toString=function(){var t=this.detectionResultColumns[0];null==t&&(t=this.detectionResultColumns[this.barcodeColumnCount+1]);for(var e=new ga,r=0;r<t.getCodewords().length;r++){e.format("CW %3d:",r);for(var n=0;n<this.barcodeColumnCount+2;n++)if(null!=this.detectionResultColumns[n]){var o=this.detectionResultColumns[n].getCodewords()[r];null!=o?e.format(" %3d|%3d",o.getRowNumber(),o.getValue()):e.format(" | ")}else e.format(" | ");e.format("%n")}return e.toString()},t}(),Aa=function(){function t(e,r,n,o){this.rowNumber=t.BARCODE_ROW_UNKNOWN,this.startX=Math.trunc(e),this.endX=Math.trunc(r),this.bucket=Math.trunc(n),this.value=Math.trunc(o)}return t.prototype.hasValidRowNumber=function(){return this.isValidRowNumber(this.rowNumber)},t.prototype.isValidRowNumber=function(e){return e!==t.BARCODE_ROW_UNKNOWN&&this.bucket===e%3*3},t.prototype.setRowNumberAsRowIndicatorColumn=function(){this.rowNumber=Math.trunc(3*Math.trunc(this.value/30)+Math.trunc(this.bucket/3))},t.prototype.getWidth=function(){return this.endX-this.startX},t.prototype.getStartX=function(){return this.startX},t.prototype.getEndX=function(){return this.endX},t.prototype.getBucket=function(){return this.bucket},t.prototype.getValue=function(){return this.value},t.prototype.getRowNumber=function(){return this.rowNumber},t.prototype.setRowNumber=function(t){this.rowNumber=t},t.prototype.toString=function(){return this.rowNumber+"|"+this.value},t.BARCODE_ROW_UNKNOWN=-1,t}(),Ea=function(){function t(){}return t.initialize=function(){for(var e=0;e<oa.SYMBOL_TABLE.length;e++)for(var r=oa.SYMBOL_TABLE[e],n=1&r,o=0;o<oa.BARS_IN_MODULE;o++){for(var i=0;(1&r)===n;)i+=1,r>>=1;n=1&r,t.RATIOS_TABLE[e]||(t.RATIOS_TABLE[e]=new Array(oa.BARS_IN_MODULE)),t.RATIOS_TABLE[e][oa.BARS_IN_MODULE-o-1]=Math.fround(i/oa.MODULES_IN_CODEWORD)}this.bSymbolTableReady=!0},t.getDecodedValue=function(e){var r=t.getDecodedCodewordValue(t.sampleBitCounts(e));return-1!==r?r:t.getClosestDecodedValue(e)},t.sampleBitCounts=function(t){for(var e=En.sum(t),r=new Int32Array(oa.BARS_IN_MODULE),n=0,o=0,i=0;i<oa.MODULES_IN_CODEWORD;i++){var a=e/(2*oa.MODULES_IN_CODEWORD)+i*e/oa.MODULES_IN_CODEWORD;o+t[n]<=a&&(o+=t[n],n++),r[n]++}return r},t.getDecodedCodewordValue=function(e){var r=t.getBitValue(e);return-1===oa.getCodeword(r)?-1:r},t.getBitValue=function(t){for(var e=0,r=0;r<t.length;r++)for(var n=0;n<t[r];n++)e=e<<1|(r%2==0?1:0);return Math.trunc(e)},t.getClosestDecodedValue=function(e){var r=En.sum(e),n=new Array(oa.BARS_IN_MODULE);if(r>1)for(var o=0;o<n.length;o++)n[o]=Math.fround(e[o]/r);var i=In.MAX_VALUE,a=-1;this.bSymbolTableReady||t.initialize();for(var s=0;s<t.RATIOS_TABLE.length;s++){for(var u=0,l=t.RATIOS_TABLE[s],c=0;c<oa.BARS_IN_MODULE;c++){var h=Math.fround(l[c]-n[c]);if((u+=Math.fround(h*h))>=i)break}u<i&&(i=u,a=oa.SYMBOL_TABLE[s])}return a},t.bSymbolTableReady=!1,t.RATIOS_TABLE=new Array(oa.SYMBOL_TABLE.length).map(function(t){return new Array(oa.BARS_IN_MODULE)}),t}(),Ia=function(){function t(){this.segmentCount=-1,this.fileSize=-1,this.timestamp=-1,this.checksum=-1}return t.prototype.getSegmentIndex=function(){return this.segmentIndex},t.prototype.setSegmentIndex=function(t){this.segmentIndex=t},t.prototype.getFileId=function(){return this.fileId},t.prototype.setFileId=function(t){this.fileId=t},t.prototype.getOptionalData=function(){return this.optionalData},t.prototype.setOptionalData=function(t){this.optionalData=t},t.prototype.isLastSegment=function(){return this.lastSegment},t.prototype.setLastSegment=function(t){this.lastSegment=t},t.prototype.getSegmentCount=function(){return this.segmentCount},t.prototype.setSegmentCount=function(t){this.segmentCount=t},t.prototype.getSender=function(){return this.sender||null},t.prototype.setSender=function(t){this.sender=t},t.prototype.getAddressee=function(){return this.addressee||null},t.prototype.setAddressee=function(t){this.addressee=t},t.prototype.getFileName=function(){return this.fileName},t.prototype.setFileName=function(t){this.fileName=t},t.prototype.getFileSize=function(){return this.fileSize},t.prototype.setFileSize=function(t){this.fileSize=t},t.prototype.getChecksum=function(){return this.checksum},t.prototype.setChecksum=function(t){this.checksum=t},t.prototype.getTimestamp=function(){return this.timestamp},t.prototype.setTimestamp=function(t){this.timestamp=t},t}(),Sa=function(){function t(){}return t.parseLong=function(t,e){return void 0===e&&(e=void 0),parseInt(t,e)},t}(),xa=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Oa=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return xa(e,t),e.kind="NullPointerException",e}(gr),Ta=function(){function t(){}return t.prototype.writeBytes=function(t){this.writeBytesOffset(t,0,t.length)},t.prototype.writeBytesOffset=function(t,e,r){if(null==t)throw new Oa;if(e<0||e>t.length||r<0||e+r>t.length||e+r<0)throw new Sr;if(0!==r)for(var n=0;n<r;n++)this.write(t[e+n])},t.prototype.flush=function(){},t.prototype.close=function(){},t}(),Na=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ka=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Na(e,t),e}(gr),Ra=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Da=function(t){function e(e){void 0===e&&(e=32);var r=t.call(this)||this;if(r.count=0,e<0)throw new _r("Negative initial size: "+e);return r.buf=new Uint8Array(e),r}return Ra(e,t),e.prototype.ensureCapacity=function(t){t-this.buf.length>0&&this.grow(t)},e.prototype.grow=function(t){var e=this.buf.length<<1;if(e-t<0&&(e=t),e<0){if(t<0)throw new ka;e=Nr.MAX_VALUE}this.buf=Tr.copyOfUint8Array(this.buf,e)},e.prototype.write=function(t){this.ensureCapacity(this.count+1),this.buf[this.count]=t,this.count+=1},e.prototype.writeBytesOffset=function(t,e,r){if(e<0||e>t.length||r<0||e+r-t.length>0)throw new Sr;this.ensureCapacity(this.count+r),Er.arraycopy(t,e,this.buf,this.count,r),this.count+=r},e.prototype.writeTo=function(t){t.writeBytesOffset(this.buf,0,this.count)},e.prototype.reset=function(){this.count=0},e.prototype.toByteArray=function(){return Tr.copyOfUint8Array(this.buf,this.count)},e.prototype.size=function(){return this.count},e.prototype.toString=function(t){return t?"string"==typeof t?this.toString_string(t):this.toString_number(t):this.toString_void()},e.prototype.toString_void=function(){return new String(this.buf).toString()},e.prototype.toString_string=function(t){return new String(this.buf).toString()},e.prototype.toString_number=function(t){return new String(this.buf).toString()},e.prototype.close=function(){},e}(Ta);function Pa(){if("undefined"!=typeof window)return window.BigInt||null;if("undefined"!=typeof global)return global.BigInt||null;if("undefined"!=typeof self)return self.BigInt||null;throw new Error("Can't search globals for BigInt!")}function Ma(t){if(void 0===Hi&&(Hi=Pa()),null===Hi)throw new Error("BigInt is not supported!");return Hi(t)}!function(t){t[t.ALPHA=0]="ALPHA",t[t.LOWER=1]="LOWER",t[t.MIXED=2]="MIXED",t[t.PUNCT=3]="PUNCT",t[t.ALPHA_SHIFT=4]="ALPHA_SHIFT",t[t.PUNCT_SHIFT=5]="PUNCT_SHIFT"}(Ui||(Ui={}));var Ba=function(){function t(){}return t.decode=function(e,r){var n=new Hr(""),o=Lr.ISO8859_1;n.enableDecoding(o);for(var i=1,a=e[i++],s=new Ia;i<e[0];){switch(a){case t.TEXT_COMPACTION_MODE_LATCH:i=t.textCompaction(e,i,n);break;case t.BYTE_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH_6:i=t.byteCompaction(a,e,o,i,n);break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:n.append(e[i++]);break;case t.NUMERIC_COMPACTION_MODE_LATCH:i=t.numericCompaction(e,i,n);break;case t.ECI_CHARSET:Lr.getCharacterSetECIByValue(e[i++]);break;case t.ECI_GENERAL_PURPOSE:i+=2;break;case t.ECI_USER_DEFINED:i++;break;case t.BEGIN_MACRO_PDF417_CONTROL_BLOCK:i=t.decodeMacroBlock(e,i,s);break;case t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case t.MACRO_PDF417_TERMINATOR:throw new Mr;default:i--,i=t.textCompaction(e,i,n)}if(!(i<e.length))throw Mr.getFormatInstance();a=e[i++]}if(0===n.length())throw Mr.getFormatInstance();var u=new hn(null,n.toString(),null,r);return u.setOther(s),u},t.decodeMacroBlock=function(e,r,n){if(r+t.NUMBER_OF_SEQUENCE_CODEWORDS>e[0])throw Mr.getFormatInstance();for(var o=new Int32Array(t.NUMBER_OF_SEQUENCE_CODEWORDS),i=0;i<t.NUMBER_OF_SEQUENCE_CODEWORDS;i++,r++)o[i]=e[r];n.setSegmentIndex(Nr.parseInt(t.decodeBase900toBase10(o,t.NUMBER_OF_SEQUENCE_CODEWORDS)));var a=new Hr;r=t.textCompaction(e,r,a),n.setFileId(a.toString());var s=-1;for(e[r]===t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD&&(s=r+1);r<e[0];)switch(e[r]){case t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:switch(e[++r]){case t.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME:var u=new Hr;r=t.textCompaction(e,r+1,u),n.setFileName(u.toString());break;case t.MACRO_PDF417_OPTIONAL_FIELD_SENDER:var l=new Hr;r=t.textCompaction(e,r+1,l),n.setSender(l.toString());break;case t.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE:var c=new Hr;r=t.textCompaction(e,r+1,c),n.setAddressee(c.toString());break;case t.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT:var h=new Hr;r=t.numericCompaction(e,r+1,h),n.setSegmentCount(Nr.parseInt(h.toString()));break;case t.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP:var f=new Hr;r=t.numericCompaction(e,r+1,f),n.setTimestamp(Sa.parseLong(f.toString()));break;case t.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM:var d=new Hr;r=t.numericCompaction(e,r+1,d),n.setChecksum(Nr.parseInt(d.toString()));break;case t.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE:var p=new Hr;r=t.numericCompaction(e,r+1,p),n.setFileSize(Sa.parseLong(p.toString()));break;default:throw Mr.getFormatInstance()}break;case t.MACRO_PDF417_TERMINATOR:r++,n.setLastSegment(!0);break;default:throw Mr.getFormatInstance()}if(-1!==s){var g=r-s;n.isLastSegment()&&g--,n.setOptionalData(Tr.copyOfRange(e,s,s+g))}return r},t.textCompaction=function(e,r,n){for(var o=new Int32Array(2*(e[0]-r)),i=new Int32Array(2*(e[0]-r)),a=0,s=!1;r<e[0]&&!s;){var u=e[r++];if(u<t.TEXT_COMPACTION_MODE_LATCH)o[a]=u/30,o[a+1]=u%30,a+=2;else switch(u){case t.TEXT_COMPACTION_MODE_LATCH:o[a++]=t.TEXT_COMPACTION_MODE_LATCH;break;case t.BYTE_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH_6:case t.NUMERIC_COMPACTION_MODE_LATCH:case t.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case t.MACRO_PDF417_TERMINATOR:r--,s=!0;break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:o[a]=t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE,u=e[r++],i[a]=u,a++}}return t.decodeTextCompaction(o,i,a,n),r},t.decodeTextCompaction=function(e,r,n,o){for(var i=Ui.ALPHA,a=Ui.ALPHA,s=0;s<n;){var u=e[s],l="";switch(i){case Ui.ALPHA:if(u<26)l=String.fromCharCode(65+u);else switch(u){case 26:l=" ";break;case t.LL:i=Ui.LOWER;break;case t.ML:i=Ui.MIXED;break;case t.PS:a=i,i=Ui.PUNCT_SHIFT;break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:o.append(r[s]);break;case t.TEXT_COMPACTION_MODE_LATCH:i=Ui.ALPHA}break;case Ui.LOWER:if(u<26)l=String.fromCharCode(97+u);else switch(u){case 26:l=" ";break;case t.AS:a=i,i=Ui.ALPHA_SHIFT;break;case t.ML:i=Ui.MIXED;break;case t.PS:a=i,i=Ui.PUNCT_SHIFT;break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:o.append(r[s]);break;case t.TEXT_COMPACTION_MODE_LATCH:i=Ui.ALPHA}break;case Ui.MIXED:if(u<t.PL)l=t.MIXED_CHARS[u];else switch(u){case t.PL:i=Ui.PUNCT;break;case 26:l=" ";break;case t.LL:i=Ui.LOWER;break;case t.AL:i=Ui.ALPHA;break;case t.PS:a=i,i=Ui.PUNCT_SHIFT;break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:o.append(r[s]);break;case t.TEXT_COMPACTION_MODE_LATCH:i=Ui.ALPHA}break;case Ui.PUNCT:if(u<t.PAL)l=t.PUNCT_CHARS[u];else switch(u){case t.PAL:i=Ui.ALPHA;break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:o.append(r[s]);break;case t.TEXT_COMPACTION_MODE_LATCH:i=Ui.ALPHA}break;case Ui.ALPHA_SHIFT:if(i=a,u<26)l=String.fromCharCode(65+u);else switch(u){case 26:l=" ";break;case t.TEXT_COMPACTION_MODE_LATCH:i=Ui.ALPHA}break;case Ui.PUNCT_SHIFT:if(i=a,u<t.PAL)l=t.PUNCT_CHARS[u];else switch(u){case t.PAL:i=Ui.ALPHA;break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:o.append(r[s]);break;case t.TEXT_COMPACTION_MODE_LATCH:i=Ui.ALPHA}}""!==l&&o.append(l),s++}},t.byteCompaction=function(e,r,n,o,i){var a=new Da,s=0,u=0,l=!1;switch(e){case t.BYTE_COMPACTION_MODE_LATCH:for(var c=new Int32Array(6),h=r[o++];o<r[0]&&!l;)switch(c[s++]=h,u=900*u+h,h=r[o++]){case t.TEXT_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH:case t.NUMERIC_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH_6:case t.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case t.MACRO_PDF417_TERMINATOR:o--,l=!0;break;default:if(s%5==0&&s>0){for(var f=0;f<6;++f)a.write(Number(Ma(u)>>Ma(8*(5-f))));u=0,s=0}}o===r[0]&&h<t.TEXT_COMPACTION_MODE_LATCH&&(c[s++]=h);for(var d=0;d<s;d++)a.write(c[d]);break;case t.BYTE_COMPACTION_MODE_LATCH_6:for(;o<r[0]&&!l;){var p=r[o++];if(p<t.TEXT_COMPACTION_MODE_LATCH)s++,u=900*u+p;else switch(p){case t.TEXT_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH:case t.NUMERIC_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH_6:case t.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case t.MACRO_PDF417_TERMINATOR:o--,l=!0}if(s%5==0&&s>0){for(f=0;f<6;++f)a.write(Number(Ma(u)>>Ma(8*(5-f))));u=0,s=0}}}return i.append(Vr.decode(a.toByteArray(),n)),o},t.numericCompaction=function(e,r,n){for(var o=0,i=!1,a=new Int32Array(t.MAX_NUMERIC_CODEWORDS);r<e[0]&&!i;){var s=e[r++];if(r===e[0]&&(i=!0),s<t.TEXT_COMPACTION_MODE_LATCH)a[o]=s,o++;else switch(s){case t.TEXT_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH_6:case t.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case t.MACRO_PDF417_TERMINATOR:r--,i=!0}(o%t.MAX_NUMERIC_CODEWORDS==0||s===t.NUMERIC_COMPACTION_MODE_LATCH||i)&&o>0&&(n.append(t.decodeBase900toBase10(a,o)),o=0)}return r},t.decodeBase900toBase10=function(e,r){for(var n=Ma(0),o=0;o<r;o++)n+=t.EXP900[r-o-1]*Ma(e[o]);var i=n.toString();if("1"!==i.charAt(0))throw new Mr;return i.substring(1)},t.TEXT_COMPACTION_MODE_LATCH=900,t.BYTE_COMPACTION_MODE_LATCH=901,t.NUMERIC_COMPACTION_MODE_LATCH=902,t.BYTE_COMPACTION_MODE_LATCH_6=924,t.ECI_USER_DEFINED=925,t.ECI_GENERAL_PURPOSE=926,t.ECI_CHARSET=927,t.BEGIN_MACRO_PDF417_CONTROL_BLOCK=928,t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD=923,t.MACRO_PDF417_TERMINATOR=922,t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE=913,t.MAX_NUMERIC_CODEWORDS=15,t.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME=0,t.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT=1,t.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP=2,t.MACRO_PDF417_OPTIONAL_FIELD_SENDER=3,t.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE=4,t.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE=5,t.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM=6,t.PL=25,t.LL=27,t.AS=27,t.ML=28,t.AL=28,t.PS=29,t.PAL=29,t.PUNCT_CHARS=";<>@[\\]_`~!\r\t,:\n-.$/\"|*()?{}'",t.MIXED_CHARS="0123456789&\r\t,:#-.$/+%*=^",t.EXP900=Pa()?function(){var t=[];t[0]=Ma(1);var e=Ma(900);t[1]=e;for(var r=2;r<16;r++)t[r]=t[r-1]*e;return t}():[],t.NUMBER_OF_SEQUENCE_CODEWORDS=2,t}(),La=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Fa=function(){function t(){}return t.decode=function(e,r,n,o,i,a,s){for(var u,l=new da(e,r,n,o,i),c=null,h=null,f=!0;;f=!1){if(null!=r&&(c=t.getRowIndicatorColumn(e,l,r,!0,a,s)),null!=o&&(h=t.getRowIndicatorColumn(e,l,o,!1,a,s)),null==(u=t.merge(c,h)))throw Gr.getNotFoundInstance();var d=u.getBoundingBox();if(!f||null==d||!(d.getMinY()<l.getMinY()||d.getMaxY()>l.getMaxY()))break;l=d}u.setBoundingBox(l);var p=u.getBarcodeColumnCount()+1;u.setDetectionResultColumn(0,c),u.setDetectionResultColumn(p,h);for(var g=null!=c,m=1;m<=p;m++){var v=g?m:p-m;if(void 0===u.getDetectionResultColumn(v)){var y=void 0;y=0===v||v===p?new ba(l,0===v):new ma(l),u.setDetectionResultColumn(v,y);for(var _=-1,w=_,b=l.getMinY();b<=l.getMaxY();b++){if((_=t.getStartColumn(u,v,b,g))<0||_>l.getMaxX()){if(-1===w)continue;_=w}var C=t.detectCodeword(e,l.getMinX(),l.getMaxX(),g,_,b,a,s);null!=C&&(y.setCodeword(b,C),w=_,a=Math.min(a,C.getWidth()),s=Math.max(s,C.getWidth()))}}}return t.createDecoderResult(u)},t.merge=function(e,r){if(null==e&&null==r)return null;var n=t.getBarcodeMetadata(e,r);if(null==n)return null;var o=da.merge(t.adjustBoundingBox(e),t.adjustBoundingBox(r));return new Ca(n,o)},t.adjustBoundingBox=function(e){var r,n;if(null==e)return null;var o=e.getRowHeights();if(null==o)return null;var i=t.getMax(o),a=0;try{for(var s=La(o),u=s.next();!u.done;u=s.next()){var l=u.value;if(a+=i-l,l>0)break}}catch(d){r={error:d}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}for(var c=e.getCodewords(),h=0;a>0&&null==c[h];h++)a--;var f=0;for(h=o.length-1;h>=0&&(f+=i-o[h],!(o[h]>0));h--);for(h=c.length-1;f>0&&null==c[h];h--)f--;return e.getBoundingBox().addMissingRows(a,f,e.isLeft())},t.getMax=function(t){var e,r,n=-1;try{for(var o=La(t),i=o.next();!i.done;i=o.next()){var a=i.value;n=Math.max(n,a)}}catch(s){e={error:s}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return n},t.getBarcodeMetadata=function(t,e){var r,n;return null==t||null==(r=t.getBarcodeMetadata())?null==e?null:e.getBarcodeMetadata():null==e||null==(n=e.getBarcodeMetadata())?r:r.getColumnCount()!==n.getColumnCount()&&r.getErrorCorrectionLevel()!==n.getErrorCorrectionLevel()&&r.getRowCount()!==n.getRowCount()?null:r},t.getRowIndicatorColumn=function(e,r,n,o,i,a){for(var s=new ba(r,o),u=0;u<2;u++)for(var l=0===u?1:-1,c=Math.trunc(Math.trunc(n.getX())),h=Math.trunc(Math.trunc(n.getY()));h<=r.getMaxY()&&h>=r.getMinY();h+=l){var f=t.detectCodeword(e,0,e.getWidth(),o,c,h,i,a);null!=f&&(s.setCodeword(h,f),c=o?f.getStartX():f.getEndX())}return s},t.adjustCodewordCount=function(e,r){var n=r[0][1],o=n.getValue(),i=e.getBarcodeColumnCount()*e.getBarcodeRowCount()-t.getNumberOfECCodeWords(e.getBarcodeECLevel());if(0===o.length){if(i<1||i>oa.MAX_CODEWORDS_IN_BARCODE)throw Gr.getNotFoundInstance();n.setValue(i)}else o[0]!==i&&n.setValue(i)},t.createDecoderResult=function(e){var r=t.createBarcodeMatrix(e);t.adjustCodewordCount(e,r);for(var n=new Array,o=new Int32Array(e.getBarcodeRowCount()*e.getBarcodeColumnCount()),i=[],a=new Array,s=0;s<e.getBarcodeRowCount();s++)for(var u=0;u<e.getBarcodeColumnCount();u++){var l=r[s][u+1].getValue(),c=s*e.getBarcodeColumnCount()+u;0===l.length?n.push(c):1===l.length?o[c]=l[0]:(a.push(c),i.push(l))}for(var h=new Array(i.length),f=0;f<h.length;f++)h[f]=i[f];return t.createDecoderResultFromAmbiguousValues(e.getBarcodeECLevel(),o,oa.toIntArray(n),oa.toIntArray(a),h)},t.createDecoderResultFromAmbiguousValues=function(e,r,n,o,i){for(var a=new Int32Array(o.length),s=100;s-- >0;){for(var u=0;u<a.length;u++)r[o[u]]=i[u][a[u]];try{return t.decodeCodewords(r,e,n)}catch(l){if(!(l instanceof Cr))throw l}if(0===a.length)throw Cr.getChecksumInstance();for(u=0;u<a.length;u++){if(a[u]<i[u].length-1){a[u]++;break}if(a[u]=0,u===a.length-1)throw Cr.getChecksumInstance()}}throw Cr.getChecksumInstance()},t.createBarcodeMatrix=function(t){for(var e,r,n,o,i=Array.from({length:t.getBarcodeRowCount()},function(){return new Array(t.getBarcodeColumnCount()+2)}),a=0;a<i.length;a++)for(var s=0;s<i[a].length;s++)i[a][s]=new ya;var u=0;try{for(var l=La(t.getDetectionResultColumns()),c=l.next();!c.done;c=l.next()){var h=c.value;if(null!=h)try{for(var f=(n=void 0,La(h.getCodewords())),d=f.next();!d.done;d=f.next()){var p=d.value;if(null!=p){var g=p.getRowNumber();if(g>=0){if(g>=i.length)continue;i[g][u].setValue(p.getValue())}}}}catch(m){n={error:m}}finally{try{d&&!d.done&&(o=f.return)&&o.call(f)}finally{if(n)throw n.error}}u++}}catch(m){e={error:m}}finally{try{c&&!c.done&&(r=l.return)&&r.call(l)}finally{if(e)throw e.error}}return i},t.isValidBarcodeColumn=function(t,e){return e>=0&&e<=t.getBarcodeColumnCount()+1},t.getStartColumn=function(e,r,n,o){var i,a,s=o?1:-1,u=null;if(t.isValidBarcodeColumn(e,r-s)&&(u=e.getDetectionResultColumn(r-s).getCodeword(n)),null!=u)return o?u.getEndX():u.getStartX();if(null!=(u=e.getDetectionResultColumn(r).getCodewordNearby(n)))return o?u.getStartX():u.getEndX();if(t.isValidBarcodeColumn(e,r-s)&&(u=e.getDetectionResultColumn(r-s).getCodewordNearby(n)),null!=u)return o?u.getEndX():u.getStartX();for(var l=0;t.isValidBarcodeColumn(e,r-s);){r-=s;try{for(var c=(i=void 0,La(e.getDetectionResultColumn(r).getCodewords())),h=c.next();!h.done;h=c.next()){var f=h.value;if(null!=f)return(o?f.getEndX():f.getStartX())+s*l*(f.getEndX()-f.getStartX())}}catch(d){i={error:d}}finally{try{h&&!h.done&&(a=c.return)&&a.call(c)}finally{if(i)throw i.error}}l++}return o?e.getBoundingBox().getMinX():e.getBoundingBox().getMaxX()},t.detectCodeword=function(e,r,n,o,i,a,s,u){i=t.adjustCodewordStartColumn(e,r,n,o,i,a);var l,c=t.getModuleBitCount(e,r,n,o,i,a);if(null==c)return null;var h=En.sum(c);if(o)l=i+h;else{for(var f=0;f<c.length/2;f++){var d=c[f];c[f]=c[c.length-1-f],c[c.length-1-f]=d}i=(l=i)-h}if(!t.checkCodewordSkew(h,s,u))return null;var p=Ea.getDecodedValue(c),g=oa.getCodeword(p);return-1===g?null:new Aa(i,l,t.getCodewordBucketNumber(p),g)},t.getModuleBitCount=function(t,e,r,n,o,i){for(var a=o,s=new Int32Array(8),u=0,l=n?1:-1,c=n;(n?a<r:a>=e)&&u<s.length;)t.get(a,i)===c?(s[u]++,a+=l):(u++,c=!c);return u===s.length||a===(n?r:e)&&u===s.length-1?s:null},t.getNumberOfECCodeWords=function(t){return 2<<t},t.adjustCodewordStartColumn=function(e,r,n,o,i,a){for(var s=i,u=o?-1:1,l=0;l<2;l++){for(;(o?s>=r:s<n)&&o===e.get(s,a);){if(Math.abs(i-s)>t.CODEWORD_SKEW_SIZE)return i;s+=u}u=-u,o=!o}return s},t.checkCodewordSkew=function(e,r,n){return r-t.CODEWORD_SKEW_SIZE<=e&&e<=n+t.CODEWORD_SKEW_SIZE},t.decodeCodewords=function(e,r,n){if(0===e.length)throw Mr.getFormatInstance();var o=1<<r+1,i=t.correctErrors(e,n,o);t.verifyCodewordCount(e,o);var a=Ba.decode(e,""+r);return a.setErrorsCorrected(i),a.setErasures(n.length),a},t.correctErrors=function(e,r,n){if(null!=r&&r.length>n/2+t.MAX_ERRORS||n<0||n>t.MAX_EC_CODEWORDS)throw Cr.getChecksumInstance();return t.errorCorrection.decode(e,n,r)},t.verifyCodewordCount=function(t,e){if(t.length<4)throw Mr.getFormatInstance();var r=t[0];if(r>t.length)throw Mr.getFormatInstance();if(0===r){if(!(e<t.length))throw Mr.getFormatInstance();t[0]=t.length-e}},t.getBitCountForCodeword=function(t){for(var e=new Int32Array(8),r=0,n=e.length-1;!((1&t)!==r&&(r=1&t,--n<0));)e[n]++,t>>=1;return e},t.getCodewordBucketNumber=function(t){return t instanceof Int32Array?this.getCodewordBucketNumber_Int32Array(t):this.getCodewordBucketNumber_number(t)},t.getCodewordBucketNumber_number=function(e){return t.getCodewordBucketNumber(t.getBitCountForCodeword(e))},t.getCodewordBucketNumber_Int32Array=function(t){return(t[0]-t[2]+t[4]-t[6]+9)%9},t.toString=function(t){for(var e=new ga,r=0;r<t.length;r++){e.format("Row %2d: ",r);for(var n=0;n<t[r].length;n++){var o=t[r][n];0===o.getValue().length?e.format(" ",null):e.format("%4d(%2d)",o.getValue()[0],o.getConfidence(o.getValue()[0]))}e.format("%n")}return e.toString()},t.CODEWORD_SKEW_SIZE=2,t.MAX_ERRORS=3,t.MAX_EC_CODEWORDS=512,t.errorCorrection=new fa,t}(),ja=function(){function t(){}return t.prototype.decode=function(e,r){void 0===r&&(r=null);var n=t.decode(e,r,!1);if(null==n||0===n.length||null==n[0])throw Gr.getNotFoundInstance();return n[0]},t.prototype.decodeMultiple=function(e,r){void 0===r&&(r=null);try{return t.decode(e,r,!0)}catch(n){if(n instanceof Mr||n instanceof Cr)throw Gr.getNotFoundInstance();throw n}},t.decode=function(e,r,n){var o,i,a=new Array,s=sa.detectMultiple(e,r,n);try{for(var u=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(s.getPoints()),l=u.next();!l.done;l=u.next()){var c=l.value,h=Fa.decode(s.getBits(),c[4],c[5],c[6],c[7],t.getMinCodewordWidth(c),t.getMaxCodewordWidth(c)),f=new an(h.getText(),h.getRawBytes(),void 0,c,un.PDF_417);f.putMetadata(cn.ERROR_CORRECTION_LEVEL,h.getECLevel());var d=h.getOther();null!=d&&f.putMetadata(cn.PDF417_EXTRA_METADATA,d),a.push(f)}}catch(p){o={error:p}}finally{try{l&&!l.done&&(i=u.return)&&i.call(u)}finally{if(o)throw o.error}}return a.map(function(t){return t})},t.getMaxWidth=function(t,e){return null==t||null==e?0:Math.trunc(Math.abs(t.getX()-e.getX()))},t.getMinWidth=function(t,e){return null==t||null==e?Nr.MAX_VALUE:Math.trunc(Math.abs(t.getX()-e.getX()))},t.getMaxCodewordWidth=function(e){return Math.floor(Math.max(Math.max(t.getMaxWidth(e[0],e[4]),t.getMaxWidth(e[6],e[2])*oa.MODULES_IN_CODEWORD/oa.MODULES_IN_STOP_PATTERN),Math.max(t.getMaxWidth(e[1],e[5]),t.getMaxWidth(e[7],e[3])*oa.MODULES_IN_CODEWORD/oa.MODULES_IN_STOP_PATTERN)))},t.getMinCodewordWidth=function(e){return Math.floor(Math.min(Math.min(t.getMinWidth(e[0],e[4]),t.getMinWidth(e[6],e[2])*oa.MODULES_IN_CODEWORD/oa.MODULES_IN_STOP_PATTERN),Math.min(t.getMinWidth(e[1],e[5]),t.getMinWidth(e[7],e[3])*oa.MODULES_IN_CODEWORD/oa.MODULES_IN_STOP_PATTERN)))},t.prototype.reset=function(){},t}(),Va=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ua=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Va(e,t),e.kind="ReaderException",e}(gr),Ha=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},za=function(){function t(){}return t.prototype.decode=function(t,e){return this.setHints(e),this.decodeInternal(t)},t.prototype.decodeWithState=function(t){return null!==this.readers&&void 0!==this.readers||this.setHints(null),this.decodeInternal(t)},t.prototype.setHints=function(t){this.hints=t;var e=null!=t&&void 0!==t.get(Dr.TRY_HARDER),r=null==t?null:t.get(Dr.POSSIBLE_FORMATS),n=new Array;if(null!=r){var o=r.some(function(t){return t===un.UPC_A||t===un.UPC_E||t===un.EAN_13||t===un.EAN_8||t===un.CODABAR||t===un.CODE_39||t===un.CODE_93||t===un.CODE_128||t===un.ITF||t===un.RSS_14||t===un.RSS_EXPANDED});o&&!e&&n.push(new di(t)),r.includes(un.QR_CODE)&&n.push(new na),r.includes(un.DATA_MATRIX)&&n.push(new Oi),r.includes(un.AZTEC)&&n.push(new Fn),r.includes(un.PDF_417)&&n.push(new ja),o&&e&&n.push(new di(t))}0===n.length&&(e||n.push(new di(t)),n.push(new na),n.push(new Oi),n.push(new Fn),n.push(new ja),e&&n.push(new di(t))),this.readers=n},t.prototype.reset=function(){var t,e;if(null!==this.readers)try{for(var r=Ha(this.readers),n=r.next();!n.done;n=r.next())n.value.reset()}catch(o){t={error:o}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}},t.prototype.decodeInternal=function(t){var e,r;if(null===this.readers)throw new Ua("No readers where selected, nothing can be read.");try{for(var n=Ha(this.readers),o=n.next();!o.done;o=n.next()){var i=o.value;try{return i.decode(t,this.hints)}catch(a){if(a instanceof Ua)continue}}}catch(a){e={error:a}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(e)throw e.error}}throw new Gr("No MultiFormat Readers were able to detect the code.")},t}(),Wa=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){function e(e,r){void 0===e&&(e=null),void 0===r&&(r=500);var n=new za;return n.setHints(e),t.call(this,n,r)||this}Wa(e,t),e.prototype.decodeBitmap=function(t){return this.reader.decodeWithState(t)}}(on);var Ga=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){Ga(function(e){return void 0===e&&(e=500),t.call(this,new ja,e)||this},t)}(on);var Xa,$a=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){$a(function(e){return void 0===e&&(e=500),t.call(this,new na,e)||this},t)}(on),function(t){t[t.ERROR_CORRECTION=0]="ERROR_CORRECTION",t[t.CHARACTER_SET=1]="CHARACTER_SET",t[t.DATA_MATRIX_SHAPE=2]="DATA_MATRIX_SHAPE",t[t.MIN_SIZE=3]="MIN_SIZE",t[t.MAX_SIZE=4]="MAX_SIZE",t[t.MARGIN=5]="MARGIN",t[t.PDF417_COMPACT=6]="PDF417_COMPACT",t[t.PDF417_COMPACTION=7]="PDF417_COMPACTION",t[t.PDF417_DIMENSIONS=8]="PDF417_DIMENSIONS",t[t.AZTEC_LAYERS=9]="AZTEC_LAYERS",t[t.QR_VERSION=10]="QR_VERSION"}(Xa||(Xa={}));var Ya=function(){function t(){}return t.applyMaskPenaltyRule1=function(e){return t.applyMaskPenaltyRule1Internal(e,!0)+t.applyMaskPenaltyRule1Internal(e,!1)},t.applyMaskPenaltyRule2=function(e){for(var r=0,n=e.getArray(),o=e.getWidth(),i=e.getHeight(),a=0;a<i-1;a++)for(var s=n[a],u=0;u<o-1;u++){var l=s[u];l===s[u+1]&&l===n[a+1][u]&&l===n[a+1][u+1]&&r++}return t.N2*r},t.applyMaskPenaltyRule3=function(e){for(var r=0,n=e.getArray(),o=e.getWidth(),i=e.getHeight(),a=0;a<i;a++)for(var s=0;s<o;s++){var u=n[a];s+6<o&&1===u[s]&&0===u[s+1]&&1===u[s+2]&&1===u[s+3]&&1===u[s+4]&&0===u[s+5]&&1===u[s+6]&&(t.isWhiteHorizontal(u,s-4,s)||t.isWhiteHorizontal(u,s+7,s+11))&&r++,a+6<i&&1===n[a][s]&&0===n[a+1][s]&&1===n[a+2][s]&&1===n[a+3][s]&&1===n[a+4][s]&&0===n[a+5][s]&&1===n[a+6][s]&&(t.isWhiteVertical(n,s,a-4,a)||t.isWhiteVertical(n,s,a+7,a+11))&&r++}return r*t.N3},t.isWhiteHorizontal=function(t,e,r){e=Math.max(e,0),r=Math.min(r,t.length);for(var n=e;n<r;n++)if(1===t[n])return!1;return!0},t.isWhiteVertical=function(t,e,r,n){r=Math.max(r,0),n=Math.min(n,t.length);for(var o=r;o<n;o++)if(1===t[o][e])return!1;return!0},t.applyMaskPenaltyRule4=function(e){for(var r=0,n=e.getArray(),o=e.getWidth(),i=e.getHeight(),a=0;a<i;a++)for(var s=n[a],u=0;u<o;u++)1===s[u]&&r++;var l=e.getHeight()*e.getWidth();return Math.floor(10*Math.abs(2*r-l)/l)*t.N4},t.getDataMaskBit=function(t,e,r){var n,o;switch(t){case 0:n=r+e&1;break;case 1:n=1&r;break;case 2:n=e%3;break;case 3:n=(r+e)%3;break;case 4:n=Math.floor(r/2)+Math.floor(e/3)&1;break;case 5:n=(1&(o=r*e))+o%3;break;case 6:n=(1&(o=r*e))+o%3&1;break;case 7:n=(o=r*e)%3+(r+e&1)&1;break;default:throw new _r("Invalid mask pattern: "+t)}return 0===n},t.applyMaskPenaltyRule1Internal=function(e,r){for(var n=0,o=r?e.getHeight():e.getWidth(),i=r?e.getWidth():e.getHeight(),a=e.getArray(),s=0;s<o;s++){for(var u=0,l=-1,c=0;c<i;c++){var h=r?a[s][c]:a[c][s];h===l?u++:(u>=5&&(n+=t.N1+(u-5)),u=1,l=h)}u>=5&&(n+=t.N1+(u-5))}return n},t.N1=3,t.N2=3,t.N3=40,t.N4=10,t}(),qa=function(){function t(){this.maskPattern=-1}return t.prototype.getMode=function(){return this.mode},t.prototype.getECLevel=function(){return this.ecLevel},t.prototype.getVersion=function(){return this.version},t.prototype.getMaskPattern=function(){return this.maskPattern},t.prototype.getMatrix=function(){return this.matrix},t.prototype.toString=function(){var t=new Hr;return t.append("<<\n"),t.append(" mode: "),t.append(this.mode?this.mode.toString():"null"),t.append("\n ecLevel: "),t.append(this.ecLevel?this.ecLevel.toString():"null"),t.append("\n version: "),t.append(this.version?this.version.toString():"null"),t.append("\n maskPattern: "),t.append(this.maskPattern.toString()),this.matrix?(t.append("\n matrix:\n"),t.append(this.matrix.toString())):t.append("\n matrix: null\n"),t.append(">>\n"),t.toString()},t.prototype.setMode=function(t){this.mode=t},t.prototype.setECLevel=function(t){this.ecLevel=t},t.prototype.setVersion=function(t){this.version=t},t.prototype.setMaskPattern=function(t){this.maskPattern=t},t.prototype.setMatrix=function(t){this.matrix=t},t.isValidMaskPattern=function(e){return e>=0&&e<t.NUM_MASK_PATTERNS},t.NUM_MASK_PATTERNS=8,t}(),Ka=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Za=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ka(e,t),e.kind="WriterException",e}(gr);!function(){function t(){}t.clearMatrix=function(t){t.clear(255)},t.buildMatrix=function(e,r,n,o,i){t.clearMatrix(i),t.embedBasicPatterns(n,i),t.embedTypeInfo(r,o,i),t.maybeEmbedVersionInfo(n,i),t.embedDataBits(e,o,i)},t.embedBasicPatterns=function(e,r){t.embedPositionDetectionPatternsAndSeparators(r),t.embedDarkDotAtLeftBottomCorner(r),t.maybeEmbedPositionAdjustmentPatterns(e,r),t.embedTimingPatterns(r)},t.embedTypeInfo=function(e,r,n){var o=new kr;t.makeTypeInfoBits(e,r,o);for(var i=0,a=o.getSize();i<a;++i){var s=o.get(o.getSize()-1-i),u=t.TYPE_INFO_COORDINATES[i],l=u[0],c=u[1];if(n.setBoolean(l,c,s),i<8){var h=n.getWidth()-i-1,f=8;n.setBoolean(h,f,s)}else h=8,f=n.getHeight()-7+(i-8),n.setBoolean(h,f,s)}},t.maybeEmbedVersionInfo=function(e,r){if(!(e.getVersionNumber()<7)){var n=new kr;t.makeVersionInfoBits(e,n);for(var o=17,i=0;i<6;++i)for(var a=0;a<3;++a){var s=n.get(o);o--,r.setBoolean(i,r.getHeight()-11+a,s),r.setBoolean(r.getHeight()-11+a,i,s)}}},t.embedDataBits=function(e,r,n){for(var o=0,i=-1,a=n.getWidth()-1,s=n.getHeight()-1;a>0;){for(6===a&&(a-=1);s>=0&&s<n.getHeight();){for(var u=0;u<2;++u){var l=a-u;if(t.isEmpty(n.get(l,s))){var c=void 0;o<e.getSize()?(c=e.get(o),++o):c=!1,255!==r&&Ya.getDataMaskBit(r,l,s)&&(c=!c),n.setBoolean(l,s,c)}}s+=i}s+=i=-i,a-=2}if(o!==e.getSize())throw new Za("Not all bits consumed: "+o+"/"+e.getSize())},t.findMSBSet=function(t){return 32-Nr.numberOfLeadingZeros(t)},t.calculateBCHCode=function(e,r){if(0===r)throw new _r("0 polynomial");var n=t.findMSBSet(r);for(e<<=n-1;t.findMSBSet(e)>=n;)e^=r<<t.findMSBSet(e)-n;return e},t.makeTypeInfoBits=function(e,r,n){if(!qa.isValidMaskPattern(r))throw new Za("Invalid mask pattern");var o=e.getBits()<<3|r;n.appendBits(o,5);var i=t.calculateBCHCode(o,t.TYPE_INFO_POLY);n.appendBits(i,10);var a=new kr;if(a.appendBits(t.TYPE_INFO_MASK_PATTERN,15),n.xor(a),15!==n.getSize())throw new Za("should not happen but we got: "+n.getSize())},t.makeVersionInfoBits=function(e,r){r.appendBits(e.getVersionNumber(),6);var n=t.calculateBCHCode(e.getVersionNumber(),t.VERSION_INFO_POLY);if(r.appendBits(n,12),18!==r.getSize())throw new Za("should not happen but we got: "+r.getSize())},t.isEmpty=function(t){return 255===t},t.embedTimingPatterns=function(e){for(var r=8;r<e.getWidth()-8;++r){var n=(r+1)%2;t.isEmpty(e.get(r,6))&&e.setNumber(r,6,n),t.isEmpty(e.get(6,r))&&e.setNumber(6,r,n)}},t.embedDarkDotAtLeftBottomCorner=function(t){if(0===t.get(8,t.getHeight()-8))throw new Za;t.setNumber(8,t.getHeight()-8,1)},t.embedHorizontalSeparationPattern=function(e,r,n){for(var o=0;o<8;++o){if(!t.isEmpty(n.get(e+o,r)))throw new Za;n.setNumber(e+o,r,0)}},t.embedVerticalSeparationPattern=function(e,r,n){for(var o=0;o<7;++o){if(!t.isEmpty(n.get(e,r+o)))throw new Za;n.setNumber(e,r+o,0)}},t.embedPositionAdjustmentPattern=function(e,r,n){for(var o=0;o<5;++o)for(var i=t.POSITION_ADJUSTMENT_PATTERN[o],a=0;a<5;++a)n.setNumber(e+a,r+o,i[a])},t.embedPositionDetectionPattern=function(e,r,n){for(var o=0;o<7;++o)for(var i=t.POSITION_DETECTION_PATTERN[o],a=0;a<7;++a)n.setNumber(e+a,r+o,i[a])},t.embedPositionDetectionPatternsAndSeparators=function(e){var r=t.POSITION_DETECTION_PATTERN[0].length;t.embedPositionDetectionPattern(0,0,e),t.embedPositionDetectionPattern(e.getWidth()-r,0,e),t.embedPositionDetectionPattern(0,e.getWidth()-r,e),t.embedHorizontalSeparationPattern(0,7,e),t.embedHorizontalSeparationPattern(e.getWidth()-8,7,e),t.embedHorizontalSeparationPattern(0,e.getWidth()-8,e),t.embedVerticalSeparationPattern(7,0,e),t.embedVerticalSeparationPattern(e.getHeight()-7-1,0,e),t.embedVerticalSeparationPattern(7,e.getHeight()-7,e)},t.maybeEmbedPositionAdjustmentPatterns=function(e,r){if(!(e.getVersionNumber()<2))for(var n=e.getVersionNumber()-1,o=t.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE[n],i=0,a=o.length;i!==a;i++){var s=o[i];if(s>=0)for(var u=0;u!==a;u++){var l=o[u];l>=0&&t.isEmpty(r.get(l,s))&&t.embedPositionAdjustmentPattern(l-2,s-2,r)}}},t.POSITION_DETECTION_PATTERN=Array.from([Int32Array.from([1,1,1,1,1,1,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,1,1,1,1,1,1])]),t.POSITION_ADJUSTMENT_PATTERN=Array.from([Int32Array.from([1,1,1,1,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,0,1,0,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,1,1,1,1])]),t.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE=Array.from([Int32Array.from([-1,-1,-1,-1,-1,-1,-1]),Int32Array.from([6,18,-1,-1,-1,-1,-1]),Int32Array.from([6,22,-1,-1,-1,-1,-1]),Int32Array.from([6,26,-1,-1,-1,-1,-1]),Int32Array.from([6,30,-1,-1,-1,-1,-1]),Int32Array.from([6,34,-1,-1,-1,-1,-1]),Int32Array.from([6,22,38,-1,-1,-1,-1]),Int32Array.from([6,24,42,-1,-1,-1,-1]),Int32Array.from([6,26,46,-1,-1,-1,-1]),Int32Array.from([6,28,50,-1,-1,-1,-1]),Int32Array.from([6,30,54,-1,-1,-1,-1]),Int32Array.from([6,32,58,-1,-1,-1,-1]),Int32Array.from([6,34,62,-1,-1,-1,-1]),Int32Array.from([6,26,46,66,-1,-1,-1]),Int32Array.from([6,26,48,70,-1,-1,-1]),Int32Array.from([6,26,50,74,-1,-1,-1]),Int32Array.from([6,30,54,78,-1,-1,-1]),Int32Array.from([6,30,56,82,-1,-1,-1]),Int32Array.from([6,30,58,86,-1,-1,-1]),Int32Array.from([6,34,62,90,-1,-1,-1]),Int32Array.from([6,28,50,72,94,-1,-1]),Int32Array.from([6,26,50,74,98,-1,-1]),Int32Array.from([6,30,54,78,102,-1,-1]),Int32Array.from([6,28,54,80,106,-1,-1]),Int32Array.from([6,32,58,84,110,-1,-1]),Int32Array.from([6,30,58,86,114,-1,-1]),Int32Array.from([6,34,62,90,118,-1,-1]),Int32Array.from([6,26,50,74,98,122,-1]),Int32Array.from([6,30,54,78,102,126,-1]),Int32Array.from([6,26,52,78,104,130,-1]),Int32Array.from([6,30,56,82,108,134,-1]),Int32Array.from([6,34,60,86,112,138,-1]),Int32Array.from([6,30,58,86,114,142,-1]),Int32Array.from([6,34,62,90,118,146,-1]),Int32Array.from([6,30,54,78,102,126,150]),Int32Array.from([6,24,50,76,102,128,154]),Int32Array.from([6,28,54,80,106,132,158]),Int32Array.from([6,32,58,84,110,136,162]),Int32Array.from([6,26,54,82,110,138,166]),Int32Array.from([6,30,58,86,114,142,170])]),t.TYPE_INFO_COORDINATES=Array.from([Int32Array.from([8,0]),Int32Array.from([8,1]),Int32Array.from([8,2]),Int32Array.from([8,3]),Int32Array.from([8,4]),Int32Array.from([8,5]),Int32Array.from([8,7]),Int32Array.from([8,8]),Int32Array.from([7,8]),Int32Array.from([5,8]),Int32Array.from([4,8]),Int32Array.from([3,8]),Int32Array.from([2,8]),Int32Array.from([1,8]),Int32Array.from([0,8])]),t.VERSION_INFO_POLY=7973,t.TYPE_INFO_POLY=1335,t.TYPE_INFO_MASK_PATTERN=21522}(),Int32Array.from([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,36,-1,-1,-1,37,38,-1,-1,-1,-1,39,40,-1,41,42,43,0,1,2,3,4,5,6,7,8,9,44,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,-1,-1,-1,-1,-1]),Lr.UTF8.getName();var Qa=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){function e(e,r,n,o,i,a,s,u){var l=t.call(this,a,s)||this;if(l.yuvData=e,l.dataWidth=r,l.dataHeight=n,l.left=o,l.top=i,o+a>r||i+s>n)throw new _r("Crop rectangle does not fit within image data.");return u&&l.reverseHorizontal(a,s),l}Qa(e,t),e.prototype.getRow=function(t,e){if(t<0||t>=this.getHeight())throw new _r("Requested row is outside the image: "+t);var r=this.getWidth();(null==e||e.length<r)&&(e=new Uint8ClampedArray(r));var n=(t+this.top)*this.dataWidth+this.left;return Er.arraycopy(this.yuvData,n,e,0,r),e},e.prototype.getMatrix=function(){var t=this.getWidth(),e=this.getHeight();if(t===this.dataWidth&&e===this.dataHeight)return this.yuvData;var r=t*e,n=new Uint8ClampedArray(r),o=this.top*this.dataWidth+this.left;if(t===this.dataWidth)return Er.arraycopy(this.yuvData,o,n,0,r),n;for(var i=0;i<e;i++){var a=i*t;Er.arraycopy(this.yuvData,o,n,a,t),o+=this.dataWidth}return n},e.prototype.isCropSupported=function(){return!0},e.prototype.crop=function(t,r,n,o){return new e(this.yuvData,this.dataWidth,this.dataHeight,this.left+t,this.top+r,n,o,!1)},e.prototype.renderThumbnail=function(){for(var t=this.getWidth()/e.THUMBNAIL_SCALE_FACTOR,r=this.getHeight()/e.THUMBNAIL_SCALE_FACTOR,n=new Int32Array(t*r),o=this.yuvData,i=this.top*this.dataWidth+this.left,a=0;a<r;a++){for(var s=a*t,u=0;u<t;u++){var l=255&o[i+u*e.THUMBNAIL_SCALE_FACTOR];n[s+u]=4278190080|65793*l}i+=this.dataWidth*e.THUMBNAIL_SCALE_FACTOR}return n},e.prototype.getThumbnailWidth=function(){return this.getWidth()/e.THUMBNAIL_SCALE_FACTOR},e.prototype.getThumbnailHeight=function(){return this.getHeight()/e.THUMBNAIL_SCALE_FACTOR},e.prototype.reverseHorizontal=function(t,e){for(var r=this.yuvData,n=0,o=this.top*this.dataWidth+this.left;n<e;n++,o+=this.dataWidth)for(var i=o+t/2,a=o,s=o+t-1;a<i;a++,s--){var u=r[a];r[a]=r[s],r[s]=u}},e.prototype.invert=function(){return new Qr(this)},e.THUMBNAIL_SCALE_FACTOR=2}(Kr);var Ja=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){function e(e,r,n,o,i,a,s){var u=t.call(this,r,n)||this;if(u.dataWidth=o,u.dataHeight=i,u.left=a,u.top=s,4===e.BYTES_PER_ELEMENT){for(var l=r*n,c=new Uint8ClampedArray(l),h=0;h<l;h++){var f=e[h],d=f>>16&255,p=f>>7&510,g=255&f;c[h]=(d+p+g)/4&255}u.luminances=c}else u.luminances=e;if(void 0===o&&(u.dataWidth=r),void 0===i&&(u.dataHeight=n),void 0===a&&(u.left=0),void 0===s&&(u.top=0),u.left+r>u.dataWidth||u.top+n>u.dataHeight)throw new _r("Crop rectangle does not fit within image data.");return u}Ja(e,t),e.prototype.getRow=function(t,e){if(t<0||t>=this.getHeight())throw new _r("Requested row is outside the image: "+t);var r=this.getWidth();(null==e||e.length<r)&&(e=new Uint8ClampedArray(r));var n=(t+this.top)*this.dataWidth+this.left;return Er.arraycopy(this.luminances,n,e,0,r),e},e.prototype.getMatrix=function(){var t=this.getWidth(),e=this.getHeight();if(t===this.dataWidth&&e===this.dataHeight)return this.luminances;var r=t*e,n=new Uint8ClampedArray(r),o=this.top*this.dataWidth+this.left;if(t===this.dataWidth)return Er.arraycopy(this.luminances,o,n,0,r),n;for(var i=0;i<e;i++){var a=i*t;Er.arraycopy(this.luminances,o,n,a,t),o+=this.dataWidth}return n},e.prototype.isCropSupported=function(){return!0},e.prototype.crop=function(t,r,n,o){return new e(this.luminances,n,o,this.dataWidth,this.dataHeight,this.left+t,this.top+r)},e.prototype.invert=function(){return new Qr(this)}}(Kr);var ts=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){function e(){return null!==t&&t.apply(this,arguments)||this}ts(e,t),e.forName=function(t){return this.getCharacterSetECIByName(t)}}(Lr);var es=function(){function t(t){this.previous=t}return t.prototype.getPrevious=function(){return this.previous},t}(),rs=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ns=function(t){function e(e,r,n){var o=t.call(this,e)||this;return o.value=r,o.bitCount=n,o}return rs(e,t),e.prototype.appendTo=function(t,e){t.appendBits(this.value,this.bitCount)},e.prototype.add=function(t,r){return new e(this,t,r)},e.prototype.addBinaryShift=function(t,r){return console.warn("addBinaryShift on SimpleToken, this simply returns a copy of this token"),new e(this,t,r)},e.prototype.toString=function(){var t=this.value&(1<<this.bitCount)-1;return t|=1<<this.bitCount,"<"+Nr.toBinaryString(t|1<<this.bitCount).substring(1)+">"},e}(es),os=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){function e(e,r,n){var o=t.call(this,e,0,0)||this;return o.binaryShiftStart=r,o.binaryShiftByteCount=n,o}os(e,t),e.prototype.appendTo=function(t,e){for(var r=0;r<this.binaryShiftByteCount;r++)(0===r||31===r&&this.binaryShiftByteCount<=62)&&(t.appendBits(31,5),this.binaryShiftByteCount>62?t.appendBits(this.binaryShiftByteCount-31,16):0===r?t.appendBits(Math.min(this.binaryShiftByteCount,31),5):t.appendBits(this.binaryShiftByteCount-31,5)),t.appendBits(e[this.binaryShiftStart+r],8)},e.prototype.addBinaryShift=function(t,r){return new e(this,t,r)},e.prototype.toString=function(){return"<"+this.binaryShiftStart+"::"+(this.binaryShiftStart+this.binaryShiftByteCount-1)+">"}}(ns),new ns(null,0,0);!function(t){var e,r;try{for(var n=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(t),o=n.next();!o.done;o=n.next()){var i=o.value;Tr.fill(i,-1)}}catch(a){e={error:a}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(e)throw e.error}}t[0][4]=0,t[1][4]=0,t[1][0]=28,t[3][4]=0,t[2][4]=0,t[2][0]=15}(Tr.createInt32Array(6,6)),function(t){var e=Ur.getCharCode(" "),r=Ur.getCharCode("."),n=Ur.getCharCode(",");t[0][e]=1;for(var o=Ur.getCharCode("Z"),i=Ur.getCharCode("A"),a=i;a<=o;a++)t[0][a]=a-i+2;t[1][e]=1;var s=Ur.getCharCode("z"),u=Ur.getCharCode("a");for(a=u;a<=s;a++)t[1][a]=a-u+2;t[2][e]=1;var l=Ur.getCharCode("9"),c=Ur.getCharCode("0");for(a=c;a<=l;a++)t[2][a]=a-c+2;t[2][n]=12,t[2][r]=13;for(var h=["\0"," ","","","","","","","","\b","\t","\n","\v","\f","\r","","","","","","@","\\","^","_","`","|","~",""],f=0;f<h.length;f++)t[3][Ur.getCharCode(h[f])]=f;var d=["\0","\r","\0","\0","\0","\0","!","'","#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}"];for(f=0;f<d.length;f++)Ur.getCharCode(d[f])>0&&(t[4][Ur.getCharCode(d[f])]=f)}(Tr.createInt32Array(5,256));var is=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),as=function(t){function e(r){var n=t.call(this,r.width,r.height)||this;return n.canvas=r,n.buffer=e.makeBufferFromCanvasImageData(r),n}return is(e,t),e.makeBufferFromCanvasImageData=function(t){var r=t.getContext("2d");if(!r)throw new Error("Couldn't get canvas context.");var n=r.getImageData(0,0,t.width,t.height);return e.toGrayscaleBuffer(n.data,t.width,t.height)},e.toGrayscaleBuffer=function(t,e,r){for(var n=new Uint8ClampedArray(e*r),o=0,i=0,a=t.length;o<a;o+=4,i++){var s=void 0;s=0===t[o+3]?255:306*t[o]+601*t[o+1]+117*t[o+2]+512>>10,n[i]=s}return n},e.prototype.getRow=function(t,e){if(t<0||t>=this.getHeight())throw new _r("Requested row is outside the image: "+t);var r=this.getWidth(),n=t*r;return null===e?e=this.buffer.slice(n,n+r):(e.length<r&&(e=new Uint8ClampedArray(r)),e.set(this.buffer.slice(n,n+r))),e},e.prototype.getMatrix=function(){return this.buffer},e.prototype.isCropSupported=function(){return!0},e.prototype.crop=function(e,r,n,o){return t.prototype.crop.call(this,e,r,n,o),this},e.prototype.isRotateSupported=function(){return!0},e.prototype.rotateCounterClockwise=function(){return this.rotate(-90),this},e.prototype.rotateCounterClockwise45=function(){return this.rotate(-45),this},e.prototype.invert=function(){return new Qr(this)},e.prototype.getTempCanvasElement=function(){if(null===this.tempCanvasElement){var t=this.canvas.ownerDocument.createElement("canvas");t.width=this.canvas.width,t.height=this.canvas.height,this.tempCanvasElement=t}return this.tempCanvasElement},e.prototype.rotate=function(t){var r=this.getTempCanvasElement();if(!r)throw new Error("Could not create a Canvas element.");var n=t*e.DEGREE_TO_RADIANS,o=this.canvas.width,i=this.canvas.height,a=Math.ceil(Math.abs(Math.cos(n))*o+Math.abs(Math.sin(n))*i),s=Math.ceil(Math.abs(Math.sin(n))*o+Math.abs(Math.cos(n))*i);r.width=a,r.height=s;var u=r.getContext("2d");if(!u)throw new Error("Could not create a Convas Context element.");return u.translate(a/2,s/2),u.rotate(n),u.drawImage(this.canvas,o/-2,i/-2),this.buffer=e.makeBufferFromCanvasImageData(r),this},e.DEGREE_TO_RADIANS=Math.PI/180,e}(Kr);function ss(){return"undefined"!=typeof navigator}var us=function(){return us=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},us.apply(this,arguments)},ls=function(t,e,r,n){return new(r||(r=Promise))(function(e,o){function i(t){try{s(n.next(t))}catch(e){o(e)}}function a(t){try{s(n.throw(t))}catch(e){o(e)}}function s(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r(function(t){t(n)})).then(i,a)}s((n=n.apply(t,[])).next())})},cs=function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(s){i=[6,s],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},hs=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},fs={delayBetweenScanAttempts:500,delayBetweenScanSuccess:500,tryPlayVideoTimeout:5e3},ds=function(){function t(t,e,r){void 0===e&&(e=new Map),void 0===r&&(r={}),this.reader=t,this.hints=e,this.options=us(us({},fs),r)}return Object.defineProperty(t.prototype,"possibleFormats",{set:function(t){this.hints.set(Dr.POSSIBLE_FORMATS,t)},enumerable:!1,configurable:!0}),t.addVideoSource=function(t,e){try{t.srcObject=e}catch(r){t.src=URL.createObjectURL(e)}},t.mediaStreamSetTorch=function(t,e){return ls(this,0,void 0,function(){return cs(this,function(r){switch(r.label){case 0:return[4,t.applyConstraints({advanced:[{fillLightMode:e?"flash":"off",torch:!!e}]})];case 1:return r.sent(),[2]}})})},t.mediaStreamIsTorchCompatible=function(e){var r,n,o=e.getVideoTracks();try{for(var i=hs(o),a=i.next();!a.done;a=i.next()){var s=a.value;if(t.mediaStreamIsTorchCompatibleTrack(s))return!0}}catch(u){r={error:u}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return!1},t.mediaStreamIsTorchCompatibleTrack=function(t){try{return"torch"in t.getCapabilities()}catch(e){return console.error(e),console.warn("Your browser may be not fully compatible with WebRTC and/or ImageCapture specs. Torch will not be available."),!1}},t.isVideoPlaying=function(t){return t.currentTime>0&&!t.paused&&t.readyState>2},t.getMediaElement=function(t,e){var r=document.getElementById(t);if(!r)throw new vr("element with id '"+t+"' not found");if(r.nodeName.toLowerCase()!==e.toLowerCase())throw new vr("element with id '"+t+"' must be an "+e+" element");return r},t.createVideoElement=function(e){if(e instanceof HTMLVideoElement)return e;if("string"==typeof e)return t.getMediaElement(e,"video");if(!e&&"undefined"!=typeof document){var r=document.createElement("video");return r.width=200,r.height=200,r}throw new Error("Couldn't get videoElement from videoSource!")},t.prepareImageElement=function(e){if(e instanceof HTMLImageElement)return e;if("string"==typeof e)return t.getMediaElement(e,"img");if(void 0===e){var r=document.createElement("img");return r.width=200,r.height=200,r}throw new Error("Couldn't get imageElement from imageSource!")},t.prepareVideoElement=function(e){var r=t.createVideoElement(e);return r.setAttribute("autoplay","true"),r.setAttribute("muted","true"),r.setAttribute("playsinline","true"),r},t.isImageLoaded=function(t){return!!t.complete&&0!==t.naturalWidth},t.createBinaryBitmapFromCanvas=function(t){var e=new as(t),r=new qr(e);return new wr(r)},t.drawImageOnCanvas=function(t,e){t.drawImage(e,0,0)},t.getMediaElementDimensions=function(t){if(t instanceof HTMLVideoElement)return{height:t.videoHeight,width:t.videoWidth};if(t instanceof HTMLImageElement)return{height:t.naturalHeight||t.height,width:t.naturalWidth||t.width};throw new Error("Couldn't find the Source's dimentions!")},t.createCaptureCanvas=function(e){if(!e)throw new vr("Cannot create a capture canvas without a media element.");if("undefined"==typeof document)throw new Error('The page "Document" is undefined, make sure you\'re running in a browser.');var r=document.createElement("canvas"),n=t.getMediaElementDimensions(e),o=n.width,i=n.height;return r.style.width=o+"px",r.style.height=i+"px",r.width=o,r.height=i,r},t.tryPlayVideo=function(e){return ls(this,0,void 0,function(){var r;return cs(this,function(n){switch(n.label){case 0:if(null==e?void 0:e.ended)return console.error("Trying to play video that has ended."),[2,!1];if(t.isVideoPlaying(e))return console.warn("Trying to play video that is already playing."),[2,!0];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,e.play()];case 2:return n.sent(),[2,!0];case 3:return r=n.sent(),console.warn("It was not possible to play the video.",r),[2,!1];case 4:return[2]}})})},t.createCanvasFromMediaElement=function(e){var r=t.createCaptureCanvas(e),n=r.getContext("2d");if(!n)throw new Error("Couldn't find Canvas 2D Context.");return t.drawImageOnCanvas(n,e),r},t.createBinaryBitmapFromMediaElem=function(e){var r=t.createCanvasFromMediaElement(e);return t.createBinaryBitmapFromCanvas(r)},t.destroyImageElement=function(t){t.src="",t.removeAttribute("src"),t=void 0},t.listVideoInputDevices=function(){return ls(this,0,void 0,function(){var t,e,r,n,o,i,a,s,u,l,c,h;return cs(this,function(f){switch(f.label){case 0:if(!ss())throw new Error("Can't enumerate devices, navigator is not present.");if(!(ss()&&navigator.mediaDevices&&navigator.mediaDevices.enumerateDevices))throw new Error("Can't enumerate devices, method not supported.");return[4,navigator.mediaDevices.enumerateDevices()];case 1:t=f.sent(),e=[];try{for(r=hs(t),n=r.next();!n.done;n=r.next())o=n.value,"videoinput"===(i="video"===o.kind?"videoinput":o.kind)&&(a=o.deviceId||o.id,s=o.label||"Video device "+(e.length+1),u=o.groupId,l={deviceId:a,label:s,kind:i,groupId:u},e.push(l))}catch(d){c={error:d}}finally{try{n&&!n.done&&(h=r.return)&&h.call(r)}finally{if(c)throw c.error}}return[2,e]}})})},t.findDeviceById=function(e){return ls(this,0,void 0,function(){var r;return cs(this,function(n){switch(n.label){case 0:return[4,t.listVideoInputDevices()];case 1:return(r=n.sent())?[2,r.find(function(t){return t.deviceId===e})]:[2]}})})},t.cleanVideoSource=function(t){if(t){try{t.srcObject=null}catch(e){t.src=""}t&&t.removeAttribute("src")}},t.playVideoOnLoadAsync=function(e,r){return ls(this,0,void 0,function(){return cs(this,function(n){switch(n.label){case 0:return[4,t.tryPlayVideo(e)];case 1:return n.sent()?[2,!0]:[2,new Promise(function(n,o){var i=setTimeout(function(){t.isVideoPlaying(e)||(o(!1),e.removeEventListener("canplay",a))},r),a=function(){t.tryPlayVideo(e).then(function(t){clearTimeout(i),e.removeEventListener("canplay",a),n(t)})};e.addEventListener("canplay",a)})]}})})},t.attachStreamToVideo=function(e,r,n){return void 0===n&&(n=5e3),ls(this,0,void 0,function(){var o;return cs(this,function(i){switch(i.label){case 0:return o=t.prepareVideoElement(r),t.addVideoSource(o,e),[4,t.playVideoOnLoadAsync(o,n)];case 1:return i.sent(),[2,o]}})})},t._waitImageLoad=function(e){return new Promise(function(r,n){var o=setTimeout(function(){t.isImageLoaded(e)||(e.removeEventListener("load",i),n())},1e4),i=function(){clearTimeout(o),e.removeEventListener("load",i),r()};e.addEventListener("load",i)})},t.checkCallbackFnOrThrow=function(t){if(!t)throw new vr("`callbackFn` is a required parameter, you cannot capture results without it.")},t.disposeMediaStream=function(t){t.getVideoTracks().forEach(function(t){return t.stop()}),t=void 0},t.prototype.decode=function(e){var r=t.createCanvasFromMediaElement(e);return this.decodeFromCanvas(r)},t.prototype.decodeBitmap=function(t){return this.reader.decode(t,this.hints)},t.prototype.decodeFromCanvas=function(e){var r=t.createBinaryBitmapFromCanvas(e);return this.decodeBitmap(r)},t.prototype.decodeFromImageElement=function(e){return ls(this,0,void 0,function(){var r;return cs(this,function(n){switch(n.label){case 0:if(!e)throw new vr("An image element must be provided.");return r=t.prepareImageElement(e),[4,this._decodeOnLoadImage(r)];case 1:return[2,n.sent()]}})})},t.prototype.decodeFromImageUrl=function(e){return ls(this,0,void 0,function(){var r;return cs(this,function(n){switch(n.label){case 0:if(!e)throw new vr("An URL must be provided.");(r=t.prepareImageElement()).src=e,n.label=1;case 1:return n.trys.push([1,,3,4]),[4,this.decodeFromImageElement(r)];case 2:return[2,n.sent()];case 3:return t.destroyImageElement(r),[7];case 4:return[2]}})})},t.prototype.decodeFromConstraints=function(e,r,n){return ls(this,0,void 0,function(){var o,i;return cs(this,function(a){switch(a.label){case 0:return t.checkCallbackFnOrThrow(n),[4,navigator.mediaDevices.getUserMedia(e)];case 1:o=a.sent(),a.label=2;case 2:return a.trys.push([2,4,,5]),[4,this.decodeFromStream(o,r,n)];case 3:return[2,a.sent()];case 4:throw i=a.sent(),t.disposeMediaStream(o),i;case 5:return[2]}})})},t.prototype.decodeFromStream=function(e,r,n){return ls(this,0,void 0,function(){var o,i,a,s,u,l,c,h,f,d,p=this;return cs(this,function(g){switch(g.label){case 0:return t.checkCallbackFnOrThrow(n),o=this.options.tryPlayVideoTimeout,[4,t.attachStreamToVideo(e,r,o)];case 1:return i=g.sent(),a=function(){var t,r;try{for(var n=hs(e.getVideoTracks()),o=n.next();!o.done;o=n.next())o.value.stop()}catch(i){t={error:i}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}e=void 0},s=function(){a(),t.cleanVideoSource(i)},u=this.scan(i,n,s),l=e.getVideoTracks(),c=us(us({},u),{stop:function(){u.stop()},streamVideoConstraintsApply:function(t,e){return ls(this,0,void 0,function(){var r,n,o,i,a,s;return cs(this,function(u){switch(u.label){case 0:r=e?l.filter(e):l,u.label=1;case 1:u.trys.push([1,6,7,8]),n=hs(r),o=n.next(),u.label=2;case 2:return o.done?[3,5]:[4,o.value.applyConstraints(t)];case 3:u.sent(),u.label=4;case 4:return o=n.next(),[3,2];case 5:return[3,8];case 6:return i=u.sent(),a={error:i},[3,8];case 7:try{o&&!o.done&&(s=n.return)&&s.call(n)}finally{if(a)throw a.error}return[7];case 8:return[2]}})})},streamVideoConstraintsGet:function(t){return l.find(t).getConstraints()},streamVideoSettingsGet:function(t){return l.find(t).getSettings()},streamVideoCapabilitiesGet:function(t){return l.find(t).getCapabilities()}}),t.mediaStreamIsTorchCompatible(e)&&(h=null==l?void 0:l.find(function(e){return t.mediaStreamIsTorchCompatibleTrack(e)}),f=function(e){return ls(p,0,void 0,function(){return cs(this,function(r){switch(r.label){case 0:return[4,t.mediaStreamSetTorch(h,e)];case 1:return r.sent(),[2]}})})},c.switchTorch=f,d=function(){u.stop(),f(!1)},c.stop=d),[2,c]}})})},t.prototype.decodeFromVideoDevice=function(e,r,n){return ls(this,0,void 0,function(){var o;return cs(this,function(i){switch(i.label){case 0:return t.checkCallbackFnOrThrow(n),o={video:e?{deviceId:{exact:e}}:{facingMode:"environment"}},[4,this.decodeFromConstraints(o,r,n)];case 1:return[2,i.sent()]}})})},t.prototype.decodeFromVideoElement=function(e,r){return ls(this,0,void 0,function(){var n,o;return cs(this,function(i){switch(i.label){case 0:if(t.checkCallbackFnOrThrow(r),!e)throw new vr("A video element must be provided.");return n=t.prepareVideoElement(e),o=this.options.tryPlayVideoTimeout,[4,t.playVideoOnLoadAsync(n,o)];case 1:return i.sent(),[2,this.scan(n,r)]}})})},t.prototype.decodeFromVideoUrl=function(e,r){return ls(this,0,void 0,function(){var n,o,i;return cs(this,function(a){switch(a.label){case 0:if(t.checkCallbackFnOrThrow(r),!e)throw new vr("An URL must be provided.");return(n=t.prepareVideoElement()).src=e,o=function(){t.cleanVideoSource(n)},i=this.options.tryPlayVideoTimeout,[4,t.playVideoOnLoadAsync(n,i)];case 1:return a.sent(),[2,this.scan(n,r,o)]}})})},t.prototype.decodeOnceFromConstraints=function(t,e){return ls(this,0,void 0,function(){var r;return cs(this,function(n){switch(n.label){case 0:return[4,navigator.mediaDevices.getUserMedia(t)];case 1:return r=n.sent(),[4,this.decodeOnceFromStream(r,e)];case 2:return[2,n.sent()]}})})},t.prototype.decodeOnceFromStream=function(e,r){return ls(this,0,void 0,function(){var n,o;return cs(this,function(i){switch(i.label){case 0:return n=Boolean(r),[4,t.attachStreamToVideo(e,r)];case 1:o=i.sent(),i.label=2;case 2:return i.trys.push([2,,4,5]),[4,this.scanOneResult(o)];case 3:return[2,i.sent()];case 4:return n||t.cleanVideoSource(o),[7];case 5:return[2]}})})},t.prototype.decodeOnceFromVideoDevice=function(t,e){return ls(this,0,void 0,function(){var r;return cs(this,function(n){switch(n.label){case 0:return r={video:t?{deviceId:{exact:t}}:{facingMode:"environment"}},[4,this.decodeOnceFromConstraints(r,e)];case 1:return[2,n.sent()]}})})},t.prototype.decodeOnceFromVideoElement=function(e){return ls(this,0,void 0,function(){var r,n;return cs(this,function(o){switch(o.label){case 0:if(!e)throw new vr("A video element must be provided.");return r=t.prepareVideoElement(e),n=this.options.tryPlayVideoTimeout,[4,t.playVideoOnLoadAsync(r,n)];case 1:return o.sent(),[4,this.scanOneResult(r)];case 2:return[2,o.sent()]}})})},t.prototype.decodeOnceFromVideoUrl=function(e){return ls(this,0,void 0,function(){var r,n;return cs(this,function(o){switch(o.label){case 0:if(!e)throw new vr("An URL must be provided.");(r=t.prepareVideoElement()).src=e,n=this.decodeOnceFromVideoElement(r),o.label=1;case 1:return o.trys.push([1,,3,4]),[4,n];case 2:return[2,o.sent()];case 3:return t.cleanVideoSource(r),[7];case 4:return[2]}})})},t.prototype.scanOneResult=function(t,e,r,n){var o=this;return void 0===e&&(e=!0),void 0===r&&(r=!0),void 0===n&&(n=!0),new Promise(function(i,a){o.scan(t,function(t,o,s){if(t)return i(t),void s.stop();if(o){if(o instanceof Gr&&e)return;if(o instanceof Cr&&r)return;if(o instanceof Mr&&n)return;s.stop(),a(o)}})})},t.prototype.scan=function(e,r,n){var o=this;t.checkCallbackFnOrThrow(r);var i=t.createCaptureCanvas(e),a=i.getContext("2d");if(!a)throw new Error("Couldn't create canvas for visual element scan.");var s,u=function(){a=void 0,i=void 0},l=!1,c={stop:function(){l=!0,clearTimeout(s),u(),n&&n()}},h=function(){if(!l)try{t.drawImageOnCanvas(a,e);var f=o.decodeFromCanvas(i);r(f,void 0,c),s=setTimeout(h,o.options.delayBetweenScanSuccess)}catch(d){if(r(void 0,d,c),d instanceof Cr||d instanceof Mr||d instanceof Gr)return void(s=setTimeout(h,o.options.delayBetweenScanAttempts));u(),n&&n(d)}};return h(),c},t.prototype._decodeOnLoadImage=function(e){return ls(this,0,void 0,function(){return cs(this,function(r){switch(r.label){case 0:return t.isImageLoaded(e)?[3,2]:[4,t._waitImageLoad(e)];case 1:r.sent(),r.label=2;case 2:return[2,this.decode(e)]}})})},t}(),ps=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){ps(function(e,r){return t.call(this,new Fn,e,r)||this},t)}(ds);var gs=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){gs(function(e,r){return t.call(this,new di(e),e,r)||this},t)}(ds);var ms=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){ms(function(e,r){return t.call(this,new Oi,e,r)||this},t)}(ds);var vs=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){function e(e,r){var n=this,o=new za;return o.setHints(e),(n=t.call(this,o,e,r)||this).reader=o,n}vs(e,t),Object.defineProperty(e.prototype,"possibleFormats",{set:function(t){this.hints.set(Dr.POSSIBLE_FORMATS,t),this.reader.setHints(this.hints)},enumerable:!1,configurable:!0}),e.prototype.decodeBitmap=function(t){return this.reader.decodeWithState(t)},e.prototype.setHints=function(t){this.hints=t,this.reader.setHints(this.hints)}}(ds);var ys=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){ys(function(e,r){return t.call(this,new ja,e,r)||this},t)}(ds);var _s=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ws=function(t){function e(e,r){return t.call(this,new na,e,r)||this}return _s(e,t),e}(ds),bs=function(t,e,r){var n=typeof t===r;return n||console.warn('[ReactQrReader]: Expected "'.concat(e,'" to be a of type "').concat(r,'".')),n},Cs=function(){return Cs=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Cs.apply(this,arguments)},As={width:"100%",paddingTop:"100%",overflow:"hidden",position:"relative"},Es={top:0,left:0,width:"100%",height:"100%",display:"block",overflow:"hidden",position:"absolute",transform:void 0},Is=function(t){var r=t.videoContainerStyle,n=t.containerStyle,o=t.videoStyle,i=t.constraints,a=t.ViewFinder,s=t.scanDelay,u=t.className,l=t.onResult,c=t.videoId;return function(t){var r=t.scanDelay,n=t.constraints,o=t.onResult,i=t.videoId,a=e.useRef(null);e.useEffect(function(){var t,e=new ws(null,{delayBetweenScanAttempts:r});return(t="undefined"!=typeof navigator&&!!navigator.mediaDevices)||console.warn('[ReactQrReader]: MediaDevices API has no support for your browser. You can fix this by running "npm i webrtc-adapter"'),!t&&bs(o,"onResult","function")&&o(null,new Error('MediaDevices API has no support for your browser. You can fix this by running "npm i webrtc-adapter"'),e),bs(n,"constraints","object")&&e.decodeFromConstraints({video:n},i,function(t,r){bs(o,"onResult","function")&&o(t,r,e)}).then(function(t){return a.current=t}).catch(function(t){bs(o,"onResult","function")&&o(null,t,e)}),function(){var t;null===(t=a.current)||void 0===t||t.stop()}},[])}({constraints:i,scanDelay:s,onResult:l,videoId:c}),h.createElement("section",{className:u,style:n},h.createElement("div",{style:Cs(Cs({},As),r)},!!a&&h.createElement(a,null),h.createElement("video",{muted:!0,id:c,style:Cs(Cs(Cs({},Es),o),{transform:"user"===(null==i?void 0:i.facingMode)&&"scaleX(-1)"})})))};function Ss({onResult:t,setVisible:r,title:n,helpLink:o}){const[i,a]=e.useState(""),[s,u]=e.useState(!1);return Qt.jsxs(Qt.Fragment,{children:[Qt.jsxs(ir,{visible:!0,setVisible:r,hideScrollBar:!1,maxWidth:500,children:[Qt.jsx(ur,{helpLink:o,setVisible:r,children:n}),Qt.jsx(sr,{children:Qt.jsx(ar,{children:Qt.jsxs("div",{className:"position-relative my-2",children:[Qt.jsx(Is,{onResult:function(e,n){(null==n?void 0:n.message)&&(a(`Ocorreu um erro ao fazer a leitura: ${n.message}`),"Requested device not found"===n.message&&u(!0)),e&&t&&(t(e),r(!1))},constraints:{facingMode:"environment"}}),Qt.jsxs("svg",{width:"50px",viewBox:"0 0 100 100",style:{top:"0px",left:"0px",zIndex:1,boxSizing:"border-box",border:"50px solid rgba(0, 0, 0, 0.25)",borderRadius:"15px",position:"absolute",width:"100%",height:"100%"},children:[Qt.jsx("path",{fill:"none",d:"M13,0 L0,0 L0,13",stroke:"rgba(255, 0, 0, 0.5)",strokeWidth:"5"}),Qt.jsx("path",{fill:"none",d:"M0,87 L0,100 L13,100",stroke:"rgba(255, 0, 0, 0.5)",strokeWidth:"5"}),Qt.jsx("path",{fill:"none",d:"M87,100 L100,100 L100,87",stroke:"rgba(255, 0, 0, 0.5)",strokeWidth:"5"}),Qt.jsx("path",{fill:"none",d:"M100,13 L100,0 87,0",stroke:"rgba(255, 0, 0, 0.5)",strokeWidth:"5"})]})]})})})]}),i&&Qt.jsx(se,{onConfirm:function(){a(),s&&r(!1)},children:i})]})}Is.displayName="QrReader",Is.defaultProps={constraints:{facingMode:"user"},videoId:"video",scanDelay:500};const xs=o.div`
|
|
535
530
|
display: flex;
|
|
536
531
|
align-items: center;
|
|
537
532
|
|
|
@@ -549,7 +544,7 @@
|
|
|
549
544
|
min-height: 16px;
|
|
550
545
|
}
|
|
551
546
|
}
|
|
552
|
-
`;function
|
|
547
|
+
`;function Os(t){return"number"!=typeof t&&(t=0),t||(t=0),Number.isNaN(t)&&(t=0),Number.isFinite(t)||(t=0),t}const Ts=o.div`
|
|
553
548
|
--loading-bar-size: 2px;
|
|
554
549
|
|
|
555
550
|
background-color: var(--loading-bar-bg);
|
|
@@ -570,7 +565,7 @@
|
|
|
570
565
|
width: ${({position:t})=>t[1]}%;
|
|
571
566
|
animation: FadeIn 0.5s both;
|
|
572
567
|
}
|
|
573
|
-
`;function Ms({visible:t}){const[r,n]=e.useState([0,0]);return t?(setTimeout(()=>{let[t,e]=r;e<100?e++:e>50&&t++,100==t&&(t=0,e=0),n([t,e])},5),Qt.jsx(Ps,{position:r,children:Qt.jsx("div",{className:"floating-bar",children:Qt.jsx("span",{className:"d-none",children:"Carregando..."})})})):null}function Bs({visible:t,message:e="Aguarde...",isbar:r=!1}){return t?r?Qt.jsx(Ms,{visible:t}):Qt.jsx("div",{className:"loading--container",children:Qt.jsxs("div",{className:"loading-body",children:[Qt.jsx("div",{className:"spinner-border text-info"}),Qt.jsx("span",{children:e})]})}):null}function Ls({name:t,value:e,onChange:r,invalid:n=!1,...o}){return Qt.jsx(l,{placeholder:"Informe o telefone",className:"form-control "+(n?"is-invalid":""),format:"(##) # ####-####",mask:"_",value:e,name:t,onValueChange:e=>function(t,e,r){r&&r({target:{name:e,value:t.formattedValue}})}(e,t,r),...o})}const Fs={mask:"**.***.***/****-00",definitions:{"*":/[A-Za-z0-9]/}};function js(t){const e=String(t).replace(/\D/g,"");let n=!1;return r.validarCPF(e)||(n=!0),"00000000000"==e&&(n=!1),""==t&&(n=!1),n}function Vs(t){return!r.validarCNPJ(t)}function Us(t){const e=String(t).replace(/[^A-Za-z0-9]/g,"");let r=!1;return e.length<=11&&js(t)&&(r=!0),e.length>11&&Vs(t)&&(r=!0),""==t&&(r=!1),r}function Hs(t){return"string"==typeof t||t instanceof String}function zs(t){var e;return"object"==typeof t&&null!=t&&"Object"===(null==t||null==(e=t.constructor)?void 0:e.name)}function Ws(t,e){return Array.isArray(e)?Ws(t,(t,r)=>e.includes(r)):Object.entries(t).reduce((t,r)=>{let[n,o]=r;return e(o,n)&&(t[n]=o),t},{})}const Gs="NONE",Xs="LEFT",$s="FORCE_LEFT",Ys="RIGHT",qs="FORCE_RIGHT";function Ks(t){return t.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function Zs(t,e){if(e===t)return!0;const r=Array.isArray(e),n=Array.isArray(t);let o;if(r&&n){if(e.length!=t.length)return!1;for(o=0;o<e.length;o++)if(!Zs(e[o],t[o]))return!1;return!0}if(r!=n)return!1;if(e&&t&&"object"==typeof e&&"object"==typeof t){const r=e instanceof Date,n=t instanceof Date;if(r&&n)return e.getTime()==t.getTime();if(r!=n)return!1;const i=e instanceof RegExp,a=t instanceof RegExp;if(i&&a)return e.toString()==t.toString();if(i!=a)return!1;const s=Object.keys(e);for(o=0;o<s.length;o++)if(!Object.prototype.hasOwnProperty.call(t,s[o]))return!1;for(o=0;o<s.length;o++)if(!Zs(t[s[o]],e[s[o]]))return!1;return!0}return!(!e||!t||"function"!=typeof e||"function"!=typeof t)&&e.toString()===t.toString()}class Qs{constructor(t){for(Object.assign(this,t);this.value.slice(0,this.startChangePos)!==this.oldValue.slice(0,this.startChangePos);)--this.oldSelection.start;if(this.insertedCount)for(;this.value.slice(this.cursorPos)!==this.oldValue.slice(this.oldSelection.end);)this.value.length-this.cursorPos<this.oldValue.length-this.oldSelection.end?++this.oldSelection.end:++this.cursorPos}get startChangePos(){return Math.min(this.cursorPos,this.oldSelection.start)}get insertedCount(){return this.cursorPos-this.startChangePos}get inserted(){return this.value.substr(this.startChangePos,this.insertedCount)}get removedCount(){return Math.max(this.oldSelection.end-this.startChangePos||this.oldValue.length-this.value.length,0)}get removed(){return this.oldValue.substr(this.startChangePos,this.removedCount)}get head(){return this.value.substring(0,this.startChangePos)}get tail(){return this.value.substring(this.startChangePos+this.insertedCount)}get removeDirection(){return!this.removedCount||this.insertedCount?Gs:this.oldSelection.end!==this.cursorPos&&this.oldSelection.start!==this.cursorPos||this.oldSelection.end!==this.oldSelection.start?Xs:Ys}}function Js(t,e){return new Js.InputMask(t,e)}function tu(t){if(null==t)throw new Error("mask property should be defined");return t instanceof RegExp?Js.MaskedRegExp:Hs(t)?Js.MaskedPattern:t===Date?Js.MaskedDate:t===Number?Js.MaskedNumber:Array.isArray(t)||t===Array?Js.MaskedDynamic:Js.Masked&&t.prototype instanceof Js.Masked?t:Js.Masked&&t instanceof Js.Masked?t.constructor:t instanceof Function?Js.MaskedFunction:(console.warn("Mask not found for mask",t),Js.Masked)}function eu(t){if(!t)throw new Error("Options in not defined");if(Js.Masked){if(t.prototype instanceof Js.Masked)return{mask:t};const{mask:e,...r}=t instanceof Js.Masked?{mask:t}:zs(t)&&t.mask instanceof Js.Masked?t:{};if(e){const t=e.mask;return{...Ws(e,(t,e)=>!e.startsWith("_")),mask:e.constructor,_mask:t,...r}}}return zs(t)?{...t}:{mask:t}}function ru(t){if(Js.Masked&&t instanceof Js.Masked)return t;const e=eu(t),r=tu(e.mask);if(!r)throw new Error("Masked class is not found for provided mask "+e.mask+", appropriate module needs to be imported manually before creating mask.");return e.mask===r&&delete e.mask,e._mask&&(e.mask=e._mask,delete e._mask),new r(e)}Js.createMask=ru;class nu{get selectionStart(){let t;try{t=this._unsafeSelectionStart}catch{}return null!=t?t:this.value.length}get selectionEnd(){let t;try{t=this._unsafeSelectionEnd}catch{}return null!=t?t:this.value.length}select(t,e){if(null!=t&&null!=e&&(t!==this.selectionStart||e!==this.selectionEnd))try{this._unsafeSelect(t,e)}catch{}}get isActive(){return!1}}Js.MaskElement=nu;class ou extends nu{constructor(t){super(),this.input=t,this._onKeydown=this._onKeydown.bind(this),this._onInput=this._onInput.bind(this),this._onBeforeinput=this._onBeforeinput.bind(this),this._onCompositionEnd=this._onCompositionEnd.bind(this)}get rootElement(){var t,e,r;return null!=(t=null==(e=(r=this.input).getRootNode)?void 0:e.call(r))?t:document}get isActive(){return this.input===this.rootElement.activeElement}bindEvents(t){this.input.addEventListener("keydown",this._onKeydown),this.input.addEventListener("input",this._onInput),this.input.addEventListener("beforeinput",this._onBeforeinput),this.input.addEventListener("compositionend",this._onCompositionEnd),this.input.addEventListener("drop",t.drop),this.input.addEventListener("click",t.click),this.input.addEventListener("focus",t.focus),this.input.addEventListener("blur",t.commit),this._handlers=t}_onKeydown(t){return this._handlers.redo&&(90===t.keyCode&&t.shiftKey&&(t.metaKey||t.ctrlKey)||89===t.keyCode&&t.ctrlKey)?(t.preventDefault(),this._handlers.redo(t)):this._handlers.undo&&90===t.keyCode&&(t.metaKey||t.ctrlKey)?(t.preventDefault(),this._handlers.undo(t)):void(t.isComposing||this._handlers.selectionChange(t))}_onBeforeinput(t){return"historyUndo"===t.inputType&&this._handlers.undo?(t.preventDefault(),this._handlers.undo(t)):"historyRedo"===t.inputType&&this._handlers.redo?(t.preventDefault(),this._handlers.redo(t)):void 0}_onCompositionEnd(t){this._handlers.input(t)}_onInput(t){t.isComposing||this._handlers.input(t)}unbindEvents(){this.input.removeEventListener("keydown",this._onKeydown),this.input.removeEventListener("input",this._onInput),this.input.removeEventListener("beforeinput",this._onBeforeinput),this.input.removeEventListener("compositionend",this._onCompositionEnd),this.input.removeEventListener("drop",this._handlers.drop),this.input.removeEventListener("click",this._handlers.click),this.input.removeEventListener("focus",this._handlers.focus),this.input.removeEventListener("blur",this._handlers.commit),this._handlers={}}}Js.HTMLMaskElement=ou;class iu extends ou{constructor(t){super(t),this.input=t}get _unsafeSelectionStart(){return null!=this.input.selectionStart?this.input.selectionStart:this.value.length}get _unsafeSelectionEnd(){return this.input.selectionEnd}_unsafeSelect(t,e){this.input.setSelectionRange(t,e)}get value(){return this.input.value}set value(t){this.input.value=t}}Js.HTMLMaskElement=ou;class au extends ou{get _unsafeSelectionStart(){const t=this.rootElement,e=t.getSelection&&t.getSelection(),r=e&&e.anchorOffset,n=e&&e.focusOffset;return null==n||null==r||r<n?r:n}get _unsafeSelectionEnd(){const t=this.rootElement,e=t.getSelection&&t.getSelection(),r=e&&e.anchorOffset,n=e&&e.focusOffset;return null==n||null==r||r>n?r:n}_unsafeSelect(t,e){if(!this.rootElement.createRange)return;const r=this.rootElement.createRange();r.setStart(this.input.firstChild||this.input,t),r.setEnd(this.input.lastChild||this.input,e);const n=this.rootElement,o=n.getSelection&&n.getSelection();o&&(o.removeAllRanges(),o.addRange(r))}get value(){return this.input.textContent||""}set value(t){this.input.textContent=t}}Js.HTMLContenteditableMaskElement=au;class su{constructor(){this.states=[],this.currentIndex=0}get currentState(){return this.states[this.currentIndex]}get isEmpty(){return 0===this.states.length}push(t){this.currentIndex<this.states.length-1&&(this.states.length=this.currentIndex+1),this.states.push(t),this.states.length>su.MAX_LENGTH&&this.states.shift(),this.currentIndex=this.states.length-1}go(t){return this.currentIndex=Math.min(Math.max(this.currentIndex+t,0),this.states.length-1),this.currentState}undo(){return this.go(-1)}redo(){return this.go(1)}clear(){this.states.length=0,this.currentIndex=0}}su.MAX_LENGTH=100;Js.InputMask=class{constructor(t,e){this.el=t instanceof nu?t:t.isContentEditable&&"INPUT"!==t.tagName&&"TEXTAREA"!==t.tagName?new au(t):new iu(t),this.masked=ru(e),this._listeners={},this._value="",this._unmaskedValue="",this._rawInputValue="",this.history=new su,this._saveSelection=this._saveSelection.bind(this),this._onInput=this._onInput.bind(this),this._onChange=this._onChange.bind(this),this._onDrop=this._onDrop.bind(this),this._onFocus=this._onFocus.bind(this),this._onClick=this._onClick.bind(this),this._onUndo=this._onUndo.bind(this),this._onRedo=this._onRedo.bind(this),this.alignCursor=this.alignCursor.bind(this),this.alignCursorFriendly=this.alignCursorFriendly.bind(this),this._bindEvents(),this.updateValue(),this._onChange()}maskEquals(t){var e;return null==t||(null==(e=this.masked)?void 0:e.maskEquals(t))}get mask(){return this.masked.mask}set mask(t){if(this.maskEquals(t))return;if(!(t instanceof Js.Masked)&&this.masked.constructor===tu(t))return void this.masked.updateOptions({mask:t});const e=t instanceof Js.Masked?t:ru({mask:t});e.unmaskedValue=this.masked.unmaskedValue,this.masked=e}get value(){return this._value}set value(t){this.value!==t&&(this.masked.value=t,this.updateControl("auto"))}get unmaskedValue(){return this._unmaskedValue}set unmaskedValue(t){this.unmaskedValue!==t&&(this.masked.unmaskedValue=t,this.updateControl("auto"))}get rawInputValue(){return this._rawInputValue}set rawInputValue(t){this.rawInputValue!==t&&(this.masked.rawInputValue=t,this.updateControl(),this.alignCursor())}get typedValue(){return this.masked.typedValue}set typedValue(t){this.masked.typedValueEquals(t)||(this.masked.typedValue=t,this.updateControl("auto"))}get displayValue(){return this.masked.displayValue}_bindEvents(){this.el.bindEvents({selectionChange:this._saveSelection,input:this._onInput,drop:this._onDrop,click:this._onClick,focus:this._onFocus,commit:this._onChange,undo:this._onUndo,redo:this._onRedo})}_unbindEvents(){this.el&&this.el.unbindEvents()}_fireEvent(t,e){const r=this._listeners[t];r&&r.forEach(t=>t(e))}get selectionStart(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}get cursorPos(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd}set cursorPos(t){this.el&&this.el.isActive&&(this.el.select(t,t),this._saveSelection())}_saveSelection(){this.displayValue!==this.el.value&&console.warn("Element value was changed outside of mask. Syncronize mask using `mask.updateValue()` to work properly."),this._selection={start:this.selectionStart,end:this.cursorPos}}updateValue(){this.masked.value=this.el.value,this._value=this.masked.value,this._unmaskedValue=this.masked.unmaskedValue,this._rawInputValue=this.masked.rawInputValue}updateControl(t){const e=this.masked.unmaskedValue,r=this.masked.value,n=this.masked.rawInputValue,o=this.displayValue,i=this.unmaskedValue!==e||this.value!==r||this._rawInputValue!==n;this._unmaskedValue=e,this._value=r,this._rawInputValue=n,this.el.value!==o&&(this.el.value=o),"auto"===t?this.alignCursor():null!=t&&(this.cursorPos=t),i&&this._fireChangeEvents(),this._historyChanging||!i&&!this.history.isEmpty||this.history.push({unmaskedValue:e,selection:{start:this.selectionStart,end:this.cursorPos}})}updateOptions(t){const{mask:e,...r}=t,n=!this.maskEquals(e),o=this.masked.optionsIsChanged(r);n&&(this.mask=e),o&&this.masked.updateOptions(r),(n||o)&&this.updateControl()}updateCursor(t){null!=t&&(this.cursorPos=t,this._delayUpdateCursor(t))}_delayUpdateCursor(t){this._abortUpdateCursor(),this._changingCursorPos=t,this._cursorChanging=setTimeout(()=>{this.el&&(this.cursorPos=this._changingCursorPos,this._abortUpdateCursor())},10)}_fireChangeEvents(){this._fireEvent("accept",this._inputEvent),this.masked.isComplete&&this._fireEvent("complete",this._inputEvent)}_abortUpdateCursor(){this._cursorChanging&&(clearTimeout(this._cursorChanging),delete this._cursorChanging)}alignCursor(){this.cursorPos=this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos,Xs))}alignCursorFriendly(){this.selectionStart===this.cursorPos&&this.alignCursor()}on(t,e){return this._listeners[t]||(this._listeners[t]=[]),this._listeners[t].push(e),this}off(t,e){if(!this._listeners[t])return this;if(!e)return delete this._listeners[t],this;const r=this._listeners[t].indexOf(e);return r>=0&&this._listeners[t].splice(r,1),this}_onInput(t){this._inputEvent=t,this._abortUpdateCursor();const e=new Qs({value:this.el.value,cursorPos:this.cursorPos,oldValue:this.displayValue,oldSelection:this._selection}),r=this.masked.rawInputValue,n=this.masked.splice(e.startChangePos,e.removed.length,e.inserted,e.removeDirection,{input:!0,raw:!0}).offset,o=r===this.masked.rawInputValue?e.removeDirection:Gs;let i=this.masked.nearestInputPos(e.startChangePos+n,o);o!==Gs&&(i=this.masked.nearestInputPos(i,Gs)),this.updateControl(i),delete this._inputEvent}_onChange(){this.displayValue!==this.el.value&&this.updateValue(),this.masked.doCommit(),this.updateControl(),this._saveSelection()}_onDrop(t){t.preventDefault(),t.stopPropagation()}_onFocus(t){this.alignCursorFriendly()}_onClick(t){this.alignCursorFriendly()}_onUndo(){this._applyHistoryState(this.history.undo())}_onRedo(){this._applyHistoryState(this.history.redo())}_applyHistoryState(t){t&&(this._historyChanging=!0,this.unmaskedValue=t.unmaskedValue,this.el.select(t.selection.start,t.selection.end),this._saveSelection(),this._historyChanging=!1)}destroy(){this._unbindEvents(),this._listeners.length=0,delete this.el}};class uu{static normalize(t){return Array.isArray(t)?t:[t,new uu]}constructor(t){Object.assign(this,{inserted:"",rawInserted:"",tailShift:0,skip:!1},t)}aggregate(t){return this.inserted+=t.inserted,this.rawInserted+=t.rawInserted,this.tailShift+=t.tailShift,this.skip=this.skip||t.skip,this}get offset(){return this.tailShift+this.inserted.length}get consumed(){return Boolean(this.rawInserted)||this.skip}equals(t){return this.inserted===t.inserted&&this.tailShift===t.tailShift&&this.rawInserted===t.rawInserted&&this.skip===t.skip}}Js.ChangeDetails=uu;class lu{constructor(t,e,r){void 0===t&&(t=""),void 0===e&&(e=0),this.value=t,this.from=e,this.stop=r}toString(){return this.value}extend(t){this.value+=String(t)}appendTo(t){return t.append(this.toString(),{tail:!0}).aggregate(t._appendPlaceholder())}get state(){return{value:this.value,from:this.from,stop:this.stop}}set state(t){Object.assign(this,t)}unshift(t){if(!this.value.length||null!=t&&this.from>=t)return"";const e=this.value[0];return this.value=this.value.slice(1),e}shift(){if(!this.value.length)return"";const t=this.value[this.value.length-1];return this.value=this.value.slice(0,-1),t}}class cu{constructor(t){this._value="",this._update({...cu.DEFAULTS,...t}),this._initialized=!0}updateOptions(t){this.optionsIsChanged(t)&&this.withValueRefresh(this._update.bind(this,t))}_update(t){Object.assign(this,t)}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue}}set state(t){this._value=t._value}reset(){this._value=""}get value(){return this._value}set value(t){this.resolve(t,{input:!0})}resolve(t,e){void 0===e&&(e={input:!0}),this.reset(),this.append(t,e,""),this.doCommit()}get unmaskedValue(){return this.value}set unmaskedValue(t){this.resolve(t,{})}get typedValue(){return this.parse?this.parse(this.value,this):this.unmaskedValue}set typedValue(t){this.format?this.value=this.format(t,this):this.unmaskedValue=String(t)}get rawInputValue(){return this.extractInput(0,this.displayValue.length,{raw:!0})}set rawInputValue(t){this.resolve(t,{raw:!0})}get displayValue(){return this.value}get isComplete(){return!0}get isFilled(){return this.isComplete}nearestInputPos(t,e){return t}totalInputPositions(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),Math.min(this.displayValue.length,e-t)}extractInput(t,e,r){return void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),this.displayValue.slice(t,e)}extractTail(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),new lu(this.extractInput(t,e),t)}appendTail(t){return Hs(t)&&(t=new lu(String(t))),t.appendTo(this)}_appendCharRaw(t,e){return t?(this._value+=t,new uu({inserted:t,rawInserted:t})):new uu}_appendChar(t,e,r){void 0===e&&(e={});const n=this.state;let o;if([t,o]=this.doPrepareChar(t,e),t&&(o=o.aggregate(this._appendCharRaw(t,e)),!o.rawInserted&&"pad"===this.autofix)){const r=this.state;this.state=n;let i=this.pad(e);const a=this._appendCharRaw(t,e);i=i.aggregate(a),a.rawInserted||i.equals(o)?o=i:this.state=r}if(o.inserted){let t,i=!1!==this.doValidate(e);if(i&&null!=r){const e=this.state;if(!0===this.overwrite){t=r.state;for(let t=0;t<o.rawInserted.length;++t)r.unshift(this.displayValue.length-o.tailShift)}let n=this.appendTail(r);if(i=n.rawInserted.length===r.toString().length,!(i&&n.inserted||"shift"!==this.overwrite)){this.state=e,t=r.state;for(let t=0;t<o.rawInserted.length;++t)r.shift();n=this.appendTail(r),i=n.rawInserted.length===r.toString().length}i&&n.inserted&&(this.state=e)}i||(o=new uu,this.state=n,r&&t&&(r.state=t))}return o}_appendPlaceholder(){return new uu}_appendEager(){return new uu}append(t,e,r){if(!Hs(t))throw new Error("value should be string");const n=Hs(r)?new lu(String(r)):r;let o;null!=e&&e.tail&&(e._beforeTailState=this.state),[t,o]=this.doPrepare(t,e);for(let i=0;i<t.length;++i){const r=this._appendChar(t[i],e,n);if(!r.rawInserted&&!this.doSkipInvalid(t[i],e,n))break;o.aggregate(r)}return(!0===this.eager||"append"===this.eager)&&null!=e&&e.input&&t&&o.aggregate(this._appendEager()),null!=n&&(o.tailShift+=this.appendTail(n).tailShift),o}remove(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),this._value=this.displayValue.slice(0,t)+this.displayValue.slice(e),new uu}withValueRefresh(t){if(this._refreshing||!this._initialized)return t();this._refreshing=!0;const e=this.rawInputValue,r=this.value,n=t();return this.rawInputValue=e,this.value&&this.value!==r&&0===r.indexOf(this.value)&&(this.append(r.slice(this.displayValue.length),{},""),this.doCommit()),delete this._refreshing,n}runIsolated(t){if(this._isolated||!this._initialized)return t(this);this._isolated=!0;const e=this.state,r=t(this);return this.state=e,delete this._isolated,r}doSkipInvalid(t,e,r){return Boolean(this.skipInvalid)}doPrepare(t,e){return void 0===e&&(e={}),uu.normalize(this.prepare?this.prepare(t,this,e):t)}doPrepareChar(t,e){return void 0===e&&(e={}),uu.normalize(this.prepareChar?this.prepareChar(t,this,e):t)}doValidate(t){return(!this.validate||this.validate(this.value,this,t))&&(!this.parent||this.parent.doValidate(t))}doCommit(){this.commit&&this.commit(this.value,this)}splice(t,e,r,n,o){void 0===r&&(r=""),void 0===n&&(n=Gs),void 0===o&&(o={input:!0});const i=t+e,a=this.extractTail(i),s=!0===this.eager||"remove"===this.eager;let u;s&&(n=function(t){switch(t){case Xs:return $s;case Ys:return qs;default:return t}}(n),u=this.extractInput(0,i,{raw:!0}));let l=t;const c=new uu;if(n!==Gs&&(l=this.nearestInputPos(t,e>1&&0!==t&&!s?Gs:n),c.tailShift=l-t),c.aggregate(this.remove(l)),s&&n!==Gs&&u===this.rawInputValue)if(n===$s){let t;for(;u===this.rawInputValue&&(t=this.displayValue.length);)c.aggregate(new uu({tailShift:-1})).aggregate(this.remove(t-1))}else n===qs&&a.unshift();return c.aggregate(this.append(r,o,a))}maskEquals(t){return this.mask===t}optionsIsChanged(t){return!Zs(this,t)}typedValueEquals(t){const e=this.typedValue;return t===e||cu.EMPTY_VALUES.includes(t)&&cu.EMPTY_VALUES.includes(e)||!!this.format&&this.format(t,this)===this.format(this.typedValue,this)}pad(t){return new uu}}cu.DEFAULTS={skipInvalid:!0},cu.EMPTY_VALUES=[void 0,null,""],Js.Masked=cu;class hu{constructor(t,e){void 0===t&&(t=[]),void 0===e&&(e=0),this.chunks=t,this.from=e}toString(){return this.chunks.map(String).join("")}extend(t){if(!String(t))return;t=Hs(t)?new lu(String(t)):t;const e=this.chunks[this.chunks.length-1],r=e&&(e.stop===t.stop||null==t.stop)&&t.from===e.from+e.toString().length;if(t instanceof lu)r?e.extend(t.toString()):this.chunks.push(t);else if(t instanceof hu){if(null==t.stop){let e;for(;t.chunks.length&&null==t.chunks[0].stop;)e=t.chunks.shift(),e.from+=t.from,this.extend(e)}t.toString()&&(t.stop=t.blockIndex,this.chunks.push(t))}}appendTo(t){if(!(t instanceof Js.MaskedPattern)){return new lu(this.toString()).appendTo(t)}const e=new uu;for(let r=0;r<this.chunks.length;++r){const n=this.chunks[r],o=t._mapPosToBlock(t.displayValue.length),i=n.stop;let a;if(null!=i&&(!o||o.index<=i)&&((n instanceof hu||t._stops.indexOf(i)>=0)&&e.aggregate(t._appendPlaceholder(i)),a=n instanceof hu&&t._blocks[i]),a){const r=a.appendTail(n);e.aggregate(r);const o=n.toString().slice(r.rawInserted.length);o&&e.aggregate(t.append(o,{tail:!0}))}else e.aggregate(t.append(n.toString(),{tail:!0}))}return e}get state(){return{chunks:this.chunks.map(t=>t.state),from:this.from,stop:this.stop,blockIndex:this.blockIndex}}set state(t){const{chunks:e,...r}=t;Object.assign(this,r),this.chunks=e.map(t=>{const e="chunks"in t?new hu:new lu;return e.state=t,e})}unshift(t){if(!this.chunks.length||null!=t&&this.from>=t)return"";const e=null!=t?t-this.from:t;let r=0;for(;r<this.chunks.length;){const t=this.chunks[r],n=t.unshift(e);if(t.toString()){if(!n)break;++r}else this.chunks.splice(r,1);if(n)return n}return""}shift(){if(!this.chunks.length)return"";let t=this.chunks.length-1;for(;0<=t;){const e=this.chunks[t],r=e.shift();if(e.toString()){if(!r)break;--t}else this.chunks.splice(t,1);if(r)return r}return""}}class fu{constructor(t,e){this.masked=t,this._log=[];const{offset:r,index:n}=t._mapPosToBlock(e)||(e<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0});this.offset=r,this.index=n,this.ok=!1}get block(){return this.masked._blocks[this.index]}get pos(){return this.masked._blockStartPos(this.index)+this.offset}get state(){return{index:this.index,offset:this.offset,ok:this.ok}}set state(t){Object.assign(this,t)}pushState(){this._log.push(this.state)}popState(){const t=this._log.pop();return t&&(this.state=t),t}bindBlock(){this.block||(this.index<0&&(this.index=0,this.offset=0),this.index>=this.masked._blocks.length&&(this.index=this.masked._blocks.length-1,this.offset=this.block.displayValue.length))}_pushLeft(t){for(this.pushState(),this.bindBlock();0<=this.index;--this.index,this.offset=(null==(e=this.block)?void 0:e.displayValue.length)||0){var e;if(t())return this.ok=!0}return this.ok=!1}_pushRight(t){for(this.pushState(),this.bindBlock();this.index<this.masked._blocks.length;++this.index,this.offset=0)if(t())return this.ok=!0;return this.ok=!1}pushLeftBeforeFilled(){return this._pushLeft(()=>{if(!this.block.isFixed&&this.block.value)return this.offset=this.block.nearestInputPos(this.offset,$s),0!==this.offset||void 0})}pushLeftBeforeInput(){return this._pushLeft(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,Xs),!0})}pushLeftBeforeRequired(){return this._pushLeft(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,Xs),!0})}pushRightBeforeFilled(){return this._pushRight(()=>{if(!this.block.isFixed&&this.block.value)return this.offset=this.block.nearestInputPos(this.offset,qs),this.offset!==this.block.value.length||void 0})}pushRightBeforeInput(){return this._pushRight(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,Gs),!0})}pushRightBeforeRequired(){return this._pushRight(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,Gs),!0})}}class du{constructor(t){Object.assign(this,t),this._value="",this.isFixed=!0}get value(){return this._value}get unmaskedValue(){return this.isUnmasking?this.value:""}get rawInputValue(){return this._isRawInput?this.value:""}get displayValue(){return this.value}reset(){this._isRawInput=!1,this._value=""}remove(t,e){return void 0===t&&(t=0),void 0===e&&(e=this._value.length),this._value=this._value.slice(0,t)+this._value.slice(e),this._value||(this._isRawInput=!1),new uu}nearestInputPos(t,e){void 0===e&&(e=Gs);const r=this._value.length;switch(e){case Xs:case $s:return 0;default:return r}}totalInputPositions(t,e){return void 0===t&&(t=0),void 0===e&&(e=this._value.length),this._isRawInput?e-t:0}extractInput(t,e,r){return void 0===t&&(t=0),void 0===e&&(e=this._value.length),void 0===r&&(r={}),r.raw&&this._isRawInput&&this._value.slice(t,e)||""}get isComplete(){return!0}get isFilled(){return Boolean(this._value)}_appendChar(t,e){if(void 0===e&&(e={}),this.isFilled)return new uu;const r=!0===this.eager||"append"===this.eager,n=this.char===t&&(this.isUnmasking||e.input||e.raw)&&(!e.raw||!r)&&!e.tail,o=new uu({inserted:this.char,rawInserted:n?this.char:""});return this._value=this.char,this._isRawInput=n&&(e.raw||e.input),o}_appendEager(){return this._appendChar(this.char,{tail:!0})}_appendPlaceholder(){const t=new uu;return this.isFilled||(this._value=t.inserted=this.char),t}extractTail(){return new lu("")}appendTail(t){return Hs(t)&&(t=new lu(String(t))),t.appendTo(this)}append(t,e,r){const n=this._appendChar(t[0],e);return null!=r&&(n.tailShift+=this.appendTail(r).tailShift),n}doCommit(){}get state(){return{_value:this._value,_rawInputValue:this.rawInputValue}}set state(t){this._value=t._value,this._isRawInput=Boolean(t._rawInputValue)}pad(t){return this._appendPlaceholder()}}class pu{constructor(t){const{parent:e,isOptional:r,placeholderChar:n,displayChar:o,lazy:i,eager:a,...s}=t;this.masked=ru(s),Object.assign(this,{parent:e,isOptional:r,placeholderChar:n,displayChar:o,lazy:i,eager:a})}reset(){this.isFilled=!1,this.masked.reset()}remove(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.value.length),0===t&&e>=1?(this.isFilled=!1,this.masked.remove(t,e)):new uu}get value(){return this.masked.value||(this.isFilled&&!this.isOptional?this.placeholderChar:"")}get unmaskedValue(){return this.masked.unmaskedValue}get rawInputValue(){return this.masked.rawInputValue}get displayValue(){return this.masked.value&&this.displayChar||this.value}get isComplete(){return Boolean(this.masked.value)||this.isOptional}_appendChar(t,e){if(void 0===e&&(e={}),this.isFilled)return new uu;const r=this.masked.state;let n=this.masked._appendChar(t,this.currentMaskFlags(e));return n.inserted&&!1===this.doValidate(e)&&(n=new uu,this.masked.state=r),n.inserted||this.isOptional||this.lazy||e.input||(n.inserted=this.placeholderChar),n.skip=!n.inserted&&!this.isOptional,this.isFilled=Boolean(n.inserted),n}append(t,e,r){return this.masked.append(t,this.currentMaskFlags(e),r)}_appendPlaceholder(){return this.isFilled||this.isOptional?new uu:(this.isFilled=!0,new uu({inserted:this.placeholderChar}))}_appendEager(){return new uu}extractTail(t,e){return this.masked.extractTail(t,e)}appendTail(t){return this.masked.appendTail(t)}extractInput(t,e,r){return void 0===t&&(t=0),void 0===e&&(e=this.value.length),this.masked.extractInput(t,e,r)}nearestInputPos(t,e){void 0===e&&(e=Gs);const r=this.value.length,n=Math.min(Math.max(t,0),r);switch(e){case Xs:case $s:return this.isComplete?n:0;case Ys:case qs:return this.isComplete?n:r;default:return n}}totalInputPositions(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.value.length),this.value.slice(t,e).length}doValidate(t){return this.masked.doValidate(this.currentMaskFlags(t))&&(!this.parent||this.parent.doValidate(this.currentMaskFlags(t)))}doCommit(){this.masked.doCommit()}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue,masked:this.masked.state,isFilled:this.isFilled}}set state(t){this.masked.state=t.masked,this.isFilled=t.isFilled}currentMaskFlags(t){var e;return{...t,_beforeTailState:(null==t||null==(e=t._beforeTailState)?void 0:e.masked)||(null==t?void 0:t._beforeTailState)}}pad(t){return new uu}}pu.DEFAULT_DEFINITIONS={0:/\d/,a:/[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,"*":/./};Js.MaskedRegExp=class extends cu{updateOptions(t){super.updateOptions(t)}_update(t){const e=t.mask;e&&(t.validate=t=>t.search(e)>=0),super._update(t)}};class gu extends cu{constructor(t){super({...gu.DEFAULTS,...t,definitions:Object.assign({},pu.DEFAULT_DEFINITIONS,null==t?void 0:t.definitions)})}updateOptions(t){super.updateOptions(t)}_update(t){t.definitions=Object.assign({},this.definitions,t.definitions),super._update(t),this._rebuildMask()}_rebuildMask(){const t=this.definitions;this._blocks=[],this.exposeBlock=void 0,this._stops=[],this._maskedBlocks={};const e=this.mask;if(!e||!t)return;let r=!1,n=!1;for(let o=0;o<e.length;++o){if(this.blocks){const t=e.slice(o),r=Object.keys(this.blocks).filter(e=>0===t.indexOf(e));r.sort((t,e)=>e.length-t.length);const n=r[0];if(n){const{expose:t,repeat:e,...r}=eu(this.blocks[n]),i={lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite,autofix:this.autofix,...r,repeat:e,parent:this},a=null!=e?new Js.RepeatBlock(i):ru(i);a&&(this._blocks.push(a),t&&(this.exposeBlock=a),this._maskedBlocks[n]||(this._maskedBlocks[n]=[]),this._maskedBlocks[n].push(this._blocks.length-1)),o+=n.length-1;continue}}let i=e[o],a=i in t;if(i===gu.STOP_CHAR){this._stops.push(this._blocks.length);continue}if("{"===i||"}"===i){r=!r;continue}if("["===i||"]"===i){n=!n;continue}if(i===gu.ESCAPE_CHAR){if(++o,i=e[o],!i)break;a=!1}const s=a?new pu({isOptional:n,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,...eu(t[i]),parent:this}):new du({char:i,eager:this.eager,isUnmasking:r});this._blocks.push(s)}}get state(){return{...super.state,_blocks:this._blocks.map(t=>t.state)}}set state(t){if(!t)return void this.reset();const{_blocks:e,...r}=t;this._blocks.forEach((t,r)=>t.state=e[r]),super.state=r}reset(){super.reset(),this._blocks.forEach(t=>t.reset())}get isComplete(){return this.exposeBlock?this.exposeBlock.isComplete:this._blocks.every(t=>t.isComplete)}get isFilled(){return this._blocks.every(t=>t.isFilled)}get isFixed(){return this._blocks.every(t=>t.isFixed)}get isOptional(){return this._blocks.every(t=>t.isOptional)}doCommit(){this._blocks.forEach(t=>t.doCommit()),super.doCommit()}get unmaskedValue(){return this.exposeBlock?this.exposeBlock.unmaskedValue:this._blocks.reduce((t,e)=>t+e.unmaskedValue,"")}set unmaskedValue(t){if(this.exposeBlock){const e=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.unmaskedValue=t,this.appendTail(e),this.doCommit()}else super.unmaskedValue=t}get value(){return this.exposeBlock?this.exposeBlock.value:this._blocks.reduce((t,e)=>t+e.value,"")}set value(t){if(this.exposeBlock){const e=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.value=t,this.appendTail(e),this.doCommit()}else super.value=t}get typedValue(){return this.exposeBlock?this.exposeBlock.typedValue:super.typedValue}set typedValue(t){if(this.exposeBlock){const e=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.typedValue=t,this.appendTail(e),this.doCommit()}else super.typedValue=t}get displayValue(){return this._blocks.reduce((t,e)=>t+e.displayValue,"")}appendTail(t){return super.appendTail(t).aggregate(this._appendPlaceholder())}_appendEager(){var t;const e=new uu;let r=null==(t=this._mapPosToBlock(this.displayValue.length))?void 0:t.index;if(null==r)return e;this._blocks[r].isFilled&&++r;for(let n=r;n<this._blocks.length;++n){const t=this._blocks[n]._appendEager();if(!t.inserted)break;e.aggregate(t)}return e}_appendCharRaw(t,e){void 0===e&&(e={});const r=this._mapPosToBlock(this.displayValue.length),n=new uu;if(!r)return n;for(let i,a=r.index;i=this._blocks[a];++a){var o;const r=i._appendChar(t,{...e,_beforeTailState:null==(o=e._beforeTailState)||null==(o=o._blocks)?void 0:o[a]});if(n.aggregate(r),r.consumed)break}return n}extractTail(t,e){void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length);const r=new hu;return t===e||this._forEachBlocksInRange(t,e,(t,e,n,o)=>{const i=t.extractTail(n,o);i.stop=this._findStopBefore(e),i.from=this._blockStartPos(e),i instanceof hu&&(i.blockIndex=e),r.extend(i)}),r}extractInput(t,e,r){if(void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),void 0===r&&(r={}),t===e)return"";let n="";return this._forEachBlocksInRange(t,e,(t,e,o,i)=>{n+=t.extractInput(o,i,r)}),n}_findStopBefore(t){let e;for(let r=0;r<this._stops.length;++r){const n=this._stops[r];if(!(n<=t))break;e=n}return e}_appendPlaceholder(t){const e=new uu;if(this.lazy&&null==t)return e;const r=this._mapPosToBlock(this.displayValue.length);if(!r)return e;const n=r.index,o=null!=t?t:this._blocks.length;return this._blocks.slice(n,o).forEach(r=>{var n;r.lazy&&null==t||e.aggregate(r._appendPlaceholder(null==(n=r._blocks)?void 0:n.length))}),e}_mapPosToBlock(t){let e="";for(let r=0;r<this._blocks.length;++r){const n=this._blocks[r],o=e.length;if(e+=n.displayValue,t<=e.length)return{index:r,offset:t-o}}}_blockStartPos(t){return this._blocks.slice(0,t).reduce((t,e)=>t+e.displayValue.length,0)}_forEachBlocksInRange(t,e,r){void 0===e&&(e=this.displayValue.length);const n=this._mapPosToBlock(t);if(n){const t=this._mapPosToBlock(e),o=t&&n.index===t.index,i=n.offset,a=t&&o?t.offset:this._blocks[n.index].displayValue.length;if(r(this._blocks[n.index],n.index,i,a),t&&!o){for(let e=n.index+1;e<t.index;++e)r(this._blocks[e],e,0,this._blocks[e].displayValue.length);r(this._blocks[t.index],t.index,0,t.offset)}}}remove(t,e){void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length);const r=super.remove(t,e);return this._forEachBlocksInRange(t,e,(t,e,n,o)=>{r.aggregate(t.remove(n,o))}),r}nearestInputPos(t,e){if(void 0===e&&(e=Gs),!this._blocks.length)return 0;const r=new fu(this,t);if(e===Gs)return r.pushRightBeforeInput()?r.pos:(r.popState(),r.pushLeftBeforeInput()?r.pos:this.displayValue.length);if(e===Xs||e===$s){if(e===Xs){if(r.pushRightBeforeFilled(),r.ok&&r.pos===t)return t;r.popState()}if(r.pushLeftBeforeInput(),r.pushLeftBeforeRequired(),r.pushLeftBeforeFilled(),e===Xs){if(r.pushRightBeforeInput(),r.pushRightBeforeRequired(),r.ok&&r.pos<=t)return r.pos;if(r.popState(),r.ok&&r.pos<=t)return r.pos;r.popState()}return r.ok?r.pos:e===$s?0:(r.popState(),r.ok?r.pos:(r.popState(),r.ok?r.pos:0))}return e===Ys||e===qs?(r.pushRightBeforeInput(),r.pushRightBeforeRequired(),r.pushRightBeforeFilled()?r.pos:e===qs?this.displayValue.length:(r.popState(),r.ok?r.pos:(r.popState(),r.ok?r.pos:this.nearestInputPos(t,Xs)))):t}totalInputPositions(t,e){void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length);let r=0;return this._forEachBlocksInRange(t,e,(t,e,n,o)=>{r+=t.totalInputPositions(n,o)}),r}maskedBlock(t){return this.maskedBlocks(t)[0]}maskedBlocks(t){const e=this._maskedBlocks[t];return e?e.map(t=>this._blocks[t]):[]}pad(t){const e=new uu;return this._forEachBlocksInRange(0,this.displayValue.length,r=>e.aggregate(r.pad(t))),e}}gu.DEFAULTS={...cu.DEFAULTS,lazy:!0,placeholderChar:"_"},gu.STOP_CHAR="`",gu.ESCAPE_CHAR="\\",gu.InputDefinition=pu,gu.FixedDefinition=du,Js.MaskedPattern=gu;class mu extends gu{get _matchFrom(){return this.maxLength-String(this.from).length}constructor(t){super(t)}updateOptions(t){super.updateOptions(t)}_update(t){const{to:e=this.to||0,from:r=this.from||0,maxLength:n=this.maxLength||0,autofix:o=this.autofix,...i}=t;this.to=e,this.from=r,this.maxLength=Math.max(String(e).length,n),this.autofix=o;const a=String(this.from).padStart(this.maxLength,"0"),s=String(this.to).padStart(this.maxLength,"0");let u=0;for(;u<s.length&&s[u]===a[u];)++u;i.mask=s.slice(0,u).replace(/0/g,"\\0")+"0".repeat(this.maxLength-u),super._update(i)}get isComplete(){return super.isComplete&&Boolean(this.value)}boundaries(t){let e="",r="";const[,n,o]=t.match(/^(\D*)(\d*)(\D*)/)||[];return o&&(e="0".repeat(n.length)+o,r="9".repeat(n.length)+o),e=e.padEnd(this.maxLength,"0"),r=r.padEnd(this.maxLength,"9"),[e,r]}doPrepareChar(t,e){let r;return void 0===e&&(e={}),[t,r]=super.doPrepareChar(t.replace(/\D/g,""),e),t||(r.skip=!this.isComplete),[t,r]}_appendCharRaw(t,e){if(void 0===e&&(e={}),!this.autofix||this.value.length+1>this.maxLength)return super._appendCharRaw(t,e);const r=String(this.from).padStart(this.maxLength,"0"),n=String(this.to).padStart(this.maxLength,"0"),[o,i]=this.boundaries(this.value+t);return Number(i)<this.from?super._appendCharRaw(r[this.value.length],e):Number(o)>this.to?!e.tail&&"pad"===this.autofix&&this.value.length+1<this.maxLength?super._appendCharRaw(r[this.value.length],e).aggregate(this._appendCharRaw(t,e)):super._appendCharRaw(n[this.value.length],e):super._appendCharRaw(t,e)}doValidate(t){const e=this.value;if(-1===e.search(/[^0]/)&&e.length<=this._matchFrom)return!0;const[r,n]=this.boundaries(e);return this.from<=Number(n)&&Number(r)<=this.to&&super.doValidate(t)}pad(t){const e=new uu;if(this.value.length===this.maxLength)return e;const r=this.value,n=this.maxLength-this.value.length;if(n){this.reset();for(let r=0;r<n;++r)e.aggregate(super._appendCharRaw("0",t));r.split("").forEach(t=>this._appendCharRaw(t))}return e}}Js.MaskedRange=mu;class vu extends gu{static extractPatternOptions(t){const{mask:e,pattern:r,...n}=t;return{...n,mask:Hs(e)?e:r}}constructor(t){super(vu.extractPatternOptions({...vu.DEFAULTS,...t}))}updateOptions(t){super.updateOptions(t)}_update(t){const{mask:e,pattern:r,blocks:n,...o}={...vu.DEFAULTS,...t},i=Object.assign({},vu.GET_DEFAULT_BLOCKS());t.min&&(i.Y.from=t.min.getFullYear()),t.max&&(i.Y.to=t.max.getFullYear()),t.min&&t.max&&i.Y.from===i.Y.to&&(i.m.from=t.min.getMonth()+1,i.m.to=t.max.getMonth()+1,i.m.from===i.m.to&&(i.d.from=t.min.getDate(),i.d.to=t.max.getDate())),Object.assign(i,this.blocks,n),super._update({...o,mask:Hs(e)?e:r,blocks:i})}doValidate(t){const e=this.date;return super.doValidate(t)&&(!this.isComplete||this.isDateExist(this.value)&&null!=e&&(null==this.min||this.min<=e)&&(null==this.max||e<=this.max))}isDateExist(t){return this.format(this.parse(t,this),this).indexOf(t)>=0}get date(){return this.typedValue}set date(t){this.typedValue=t}get typedValue(){return this.isComplete?super.typedValue:null}set typedValue(t){super.typedValue=t}maskEquals(t){return t===Date||super.maskEquals(t)}optionsIsChanged(t){return super.optionsIsChanged(vu.extractPatternOptions(t))}}vu.GET_DEFAULT_BLOCKS=()=>({d:{mask:mu,from:1,to:31,maxLength:2},m:{mask:mu,from:1,to:12,maxLength:2},Y:{mask:mu,from:1900,to:9999}}),vu.DEFAULTS={...gu.DEFAULTS,mask:Date,pattern:"d{.}`m{.}`Y",format:(t,e)=>{if(!t)return"";return[String(t.getDate()).padStart(2,"0"),String(t.getMonth()+1).padStart(2,"0"),t.getFullYear()].join(".")},parse:(t,e)=>{const[r,n,o]=t.split(".").map(Number);return new Date(o,n-1,r)}},Js.MaskedDate=vu;class yu extends cu{constructor(t){super({...yu.DEFAULTS,...t}),this.currentMask=void 0}updateOptions(t){super.updateOptions(t)}_update(t){super._update(t),"mask"in t&&(this.exposeMask=void 0,this.compiledMasks=Array.isArray(t.mask)?t.mask.map(t=>{const{expose:e,...r}=eu(t),n=ru({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid,...r});return e&&(this.exposeMask=n),n}):[])}_appendCharRaw(t,e){void 0===e&&(e={});const r=this._applyDispatch(t,e);return this.currentMask&&r.aggregate(this.currentMask._appendChar(t,this.currentMaskFlags(e))),r}_applyDispatch(t,e,r){void 0===t&&(t=""),void 0===e&&(e={}),void 0===r&&(r="");const n=e.tail&&null!=e._beforeTailState?e._beforeTailState._value:this.value,o=this.rawInputValue,i=e.tail&&null!=e._beforeTailState?e._beforeTailState._rawInputValue:o,a=o.slice(i.length),s=this.currentMask,u=new uu,l=null==s?void 0:s.state;return this.currentMask=this.doDispatch(t,{...e},r),this.currentMask&&(this.currentMask!==s?(this.currentMask.reset(),i&&(this.currentMask.append(i,{raw:!0}),u.tailShift=this.currentMask.value.length-n.length),a&&(u.tailShift+=this.currentMask.append(a,{raw:!0,tail:!0}).tailShift)):l&&(this.currentMask.state=l)),u}_appendPlaceholder(){const t=this._applyDispatch();return this.currentMask&&t.aggregate(this.currentMask._appendPlaceholder()),t}_appendEager(){const t=this._applyDispatch();return this.currentMask&&t.aggregate(this.currentMask._appendEager()),t}appendTail(t){const e=new uu;return t&&e.aggregate(this._applyDispatch("",{},t)),e.aggregate(this.currentMask?this.currentMask.appendTail(t):super.appendTail(t))}currentMaskFlags(t){var e,r;return{...t,_beforeTailState:(null==(e=t._beforeTailState)?void 0:e.currentMaskRef)===this.currentMask&&(null==(r=t._beforeTailState)?void 0:r.currentMask)||t._beforeTailState}}doDispatch(t,e,r){return void 0===e&&(e={}),void 0===r&&(r=""),this.dispatch(t,this,e,r)}doValidate(t){return super.doValidate(t)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(t)))}doPrepare(t,e){void 0===e&&(e={});let[r,n]=super.doPrepare(t,e);if(this.currentMask){let t;[r,t]=super.doPrepare(r,this.currentMaskFlags(e)),n=n.aggregate(t)}return[r,n]}doPrepareChar(t,e){void 0===e&&(e={});let[r,n]=super.doPrepareChar(t,e);if(this.currentMask){let t;[r,t]=super.doPrepareChar(r,this.currentMaskFlags(e)),n=n.aggregate(t)}return[r,n]}reset(){var t;null==(t=this.currentMask)||t.reset(),this.compiledMasks.forEach(t=>t.reset())}get value(){return this.exposeMask?this.exposeMask.value:this.currentMask?this.currentMask.value:""}set value(t){this.exposeMask?(this.exposeMask.value=t,this.currentMask=this.exposeMask,this._applyDispatch()):super.value=t}get unmaskedValue(){return this.exposeMask?this.exposeMask.unmaskedValue:this.currentMask?this.currentMask.unmaskedValue:""}set unmaskedValue(t){this.exposeMask?(this.exposeMask.unmaskedValue=t,this.currentMask=this.exposeMask,this._applyDispatch()):super.unmaskedValue=t}get typedValue(){return this.exposeMask?this.exposeMask.typedValue:this.currentMask?this.currentMask.typedValue:""}set typedValue(t){if(this.exposeMask)return this.exposeMask.typedValue=t,this.currentMask=this.exposeMask,void this._applyDispatch();let e=String(t);this.currentMask&&(this.currentMask.typedValue=t,e=this.currentMask.unmaskedValue),this.unmaskedValue=e}get displayValue(){return this.currentMask?this.currentMask.displayValue:""}get isComplete(){var t;return Boolean(null==(t=this.currentMask)?void 0:t.isComplete)}get isFilled(){var t;return Boolean(null==(t=this.currentMask)?void 0:t.isFilled)}remove(t,e){const r=new uu;return this.currentMask&&r.aggregate(this.currentMask.remove(t,e)).aggregate(this._applyDispatch()),r}get state(){var t;return{...super.state,_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map(t=>t.state),currentMaskRef:this.currentMask,currentMask:null==(t=this.currentMask)?void 0:t.state}}set state(t){const{compiledMasks:e,currentMaskRef:r,currentMask:n,...o}=t;e&&this.compiledMasks.forEach((t,r)=>t.state=e[r]),null!=r&&(this.currentMask=r,this.currentMask.state=n),super.state=o}extractInput(t,e,r){return this.currentMask?this.currentMask.extractInput(t,e,r):""}extractTail(t,e){return this.currentMask?this.currentMask.extractTail(t,e):super.extractTail(t,e)}doCommit(){this.currentMask&&this.currentMask.doCommit(),super.doCommit()}nearestInputPos(t,e){return this.currentMask?this.currentMask.nearestInputPos(t,e):super.nearestInputPos(t,e)}get overwrite(){return this.currentMask?this.currentMask.overwrite:this._overwrite}set overwrite(t){this._overwrite=t}get eager(){return this.currentMask?this.currentMask.eager:this._eager}set eager(t){this._eager=t}get skipInvalid(){return this.currentMask?this.currentMask.skipInvalid:this._skipInvalid}set skipInvalid(t){this._skipInvalid=t}get autofix(){return this.currentMask?this.currentMask.autofix:this._autofix}set autofix(t){this._autofix=t}maskEquals(t){return Array.isArray(t)?this.compiledMasks.every((e,r)=>{if(!t[r])return;const{mask:n,...o}=t[r];return Zs(e,o)&&e.maskEquals(n)}):super.maskEquals(t)}typedValueEquals(t){var e;return Boolean(null==(e=this.currentMask)?void 0:e.typedValueEquals(t))}}yu.DEFAULTS={...cu.DEFAULTS,dispatch:(t,e,r,n)=>{if(!e.compiledMasks.length)return;const o=e.rawInputValue,i=e.compiledMasks.map((i,a)=>{const s=e.currentMask===i,u=s?i.displayValue.length:i.nearestInputPos(i.displayValue.length,$s);return i.rawInputValue!==o?(i.reset(),i.append(o,{raw:!0})):s||i.remove(u),i.append(t,e.currentMaskFlags(r)),i.appendTail(n),{index:a,weight:i.rawInputValue.length,totalInputPositions:i.totalInputPositions(0,Math.max(u,i.nearestInputPos(i.displayValue.length,$s)))}});return i.sort((t,e)=>e.weight-t.weight||e.totalInputPositions-t.totalInputPositions),e.compiledMasks[i[0].index]}},Js.MaskedDynamic=yu;class _u extends gu{constructor(t){super({..._u.DEFAULTS,...t})}updateOptions(t){super.updateOptions(t)}_update(t){const{enum:e,...r}=t;if(e){const t=e.map(t=>t.length),n=Math.min(...t),o=Math.max(...t)-n;r.mask="*".repeat(n),o&&(r.mask+="["+"*".repeat(o)+"]"),this.enum=e}super._update(r)}_appendCharRaw(t,e){void 0===e&&(e={});const r=Math.min(this.nearestInputPos(0,qs),this.value.length),n=this.enum.filter(e=>this.matchValue(e,this.unmaskedValue+t,r));if(n.length){1===n.length&&this._forEachBlocksInRange(0,this.value.length,(t,r)=>{const o=n[0][r];r>=this.value.length||o===t.value||(t.reset(),t._appendChar(o,e))});const t=super._appendCharRaw(n[0][this.value.length],e);return 1===n.length&&n[0].slice(this.unmaskedValue.length).split("").forEach(e=>t.aggregate(super._appendCharRaw(e))),t}return new uu({skip:!this.isComplete})}extractTail(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),new lu("",t)}remove(t,e){if(void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),t===e)return new uu;const r=Math.min(super.nearestInputPos(0,qs),this.value.length);let n;for(n=t;n>=0;--n){if(this.enum.filter(t=>this.matchValue(t,this.value.slice(r,n),r)).length>1)break}const o=super.remove(n,e);return o.tailShift+=n-t,o}get isComplete(){return this.enum.indexOf(this.value)>=0}}_u.DEFAULTS={...gu.DEFAULTS,matchValue:(t,e,r)=>t.indexOf(e,r)===r},Js.MaskedEnum=_u;var wu;Js.MaskedFunction=class extends cu{updateOptions(t){super.updateOptions(t)}_update(t){super._update({...t,validate:t.mask})}};class bu extends cu{constructor(t){super({...bu.DEFAULTS,...t})}updateOptions(t){super.updateOptions(t)}_update(t){super._update(t),this._updateRegExps()}_updateRegExps(){const t="^"+(this.allowNegative?"[+|\\-]?":""),e=(this.scale?"("+Ks(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=new RegExp(t+"\\d*"+e),this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(Ks).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp(Ks(this.thousandsSeparator),"g")}_removeThousandsSeparators(t){return t.replace(this._thousandsSeparatorRegExp,"")}_insertThousandsSeparators(t){const e=t.split(this.radix);return e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),e.join(this.radix)}doPrepareChar(t,e){void 0===e&&(e={});const[r,n]=super.doPrepareChar(this._removeThousandsSeparators(this.scale&&this.mapToRadix.length&&(e.input&&e.raw||!e.input&&!e.raw)?t.replace(this._mapToRadixRegExp,this.radix):t),e);return t&&!r&&(n.skip=!0),!r||this.allowPositive||this.value||"-"===r||n.aggregate(this._appendChar("-")),[r,n]}_separatorsCount(t,e){void 0===e&&(e=!1);let r=0;for(let n=0;n<t;++n)this._value.indexOf(this.thousandsSeparator,n)===n&&(++r,e&&(t+=this.thousandsSeparator.length));return r}_separatorsCountFromSlice(t){return void 0===t&&(t=this._value),this._separatorsCount(this._removeThousandsSeparators(t).length,!0)}extractInput(t,e,r){return void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),[t,e]=this._adjustRangeWithSeparators(t,e),this._removeThousandsSeparators(super.extractInput(t,e,r))}_appendCharRaw(t,e){void 0===e&&(e={});const r=e.tail&&e._beforeTailState?e._beforeTailState._value:this._value,n=this._separatorsCountFromSlice(r);this._value=this._removeThousandsSeparators(this.value);const o=this._value;this._value+=t;const i=this.number;let a,s=!isNaN(i),u=!1;if(s){let t;null!=this.min&&this.min<0&&this.number<this.min&&(t=this.min),null!=this.max&&this.max>0&&this.number>this.max&&(t=this.max),null!=t&&(this.autofix?(this._value=this.format(t,this).replace(bu.UNMASKED_RADIX,this.radix),u||(u=o===this._value&&!e.tail)):s=!1),s&&(s=Boolean(this._value.match(this._numberRegExp)))}s?a=new uu({inserted:this._value.slice(o.length),rawInserted:u?"":t,skip:u}):(this._value=o,a=new uu),this._value=this._insertThousandsSeparators(this._value);const l=e.tail&&e._beforeTailState?e._beforeTailState._value:this._value,c=this._separatorsCountFromSlice(l);return a.tailShift+=(c-n)*this.thousandsSeparator.length,a}_findSeparatorAround(t){if(this.thousandsSeparator){const e=t-this.thousandsSeparator.length+1,r=this.value.indexOf(this.thousandsSeparator,e);if(r<=t)return r}return-1}_adjustRangeWithSeparators(t,e){const r=this._findSeparatorAround(t);r>=0&&(t=r);const n=this._findSeparatorAround(e);return n>=0&&(e=n+this.thousandsSeparator.length),[t,e]}remove(t,e){void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),[t,e]=this._adjustRangeWithSeparators(t,e);const r=this.value.slice(0,t),n=this.value.slice(e),o=this._separatorsCount(r.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(r+n));const i=this._separatorsCountFromSlice(r);return new uu({tailShift:(i-o)*this.thousandsSeparator.length})}nearestInputPos(t,e){if(!this.thousandsSeparator)return t;switch(e){case Gs:case Xs:case $s:{const r=this._findSeparatorAround(t-1);if(r>=0){const n=r+this.thousandsSeparator.length;if(t<n||this.value.length<=n||e===$s)return r}break}case Ys:case qs:{const e=this._findSeparatorAround(t);if(e>=0)return e+this.thousandsSeparator.length}}return t}doCommit(){if(this.value){const t=this.number;let e=t;null!=this.min&&(e=Math.max(e,this.min)),null!=this.max&&(e=Math.min(e,this.max)),e!==t&&(this.unmaskedValue=this.format(e,this));let r=this.value;this.normalizeZeros&&(r=this._normalizeZeros(r)),this.padFractionalZeros&&this.scale>0&&(r=this._padFractionalZeros(r)),this._value=r}super.doCommit()}_normalizeZeros(t){const e=this._removeThousandsSeparators(t).split(this.radix);return e[0]=e[0].replace(/^(\D*)(0*)(\d*)/,(t,e,r,n)=>e+n),t.length&&!/\d$/.test(e[0])&&(e[0]=e[0]+"0"),e.length>1&&(e[1]=e[1].replace(/0*$/,""),e[1].length||(e.length=1)),this._insertThousandsSeparators(e.join(this.radix))}_padFractionalZeros(t){if(!t)return t;const e=t.split(this.radix);return e.length<2&&e.push(""),e[1]=e[1].padEnd(this.scale,"0"),e.join(this.radix)}doSkipInvalid(t,e,r){void 0===e&&(e={});const n=0===this.scale&&t!==this.thousandsSeparator&&(t===this.radix||t===bu.UNMASKED_RADIX||this.mapToRadix.includes(t));return super.doSkipInvalid(t,e,r)&&!n}get unmaskedValue(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,bu.UNMASKED_RADIX)}set unmaskedValue(t){super.unmaskedValue=t}get typedValue(){return this.parse(this.unmaskedValue,this)}set typedValue(t){this.rawInputValue=this.format(t,this).replace(bu.UNMASKED_RADIX,this.radix)}get number(){return this.typedValue}set number(t){this.typedValue=t}get allowNegative(){return null!=this.min&&this.min<0||null!=this.max&&this.max<0}get allowPositive(){return null!=this.min&&this.min>0||null!=this.max&&this.max>0}typedValueEquals(t){return(super.typedValueEquals(t)||bu.EMPTY_VALUES.includes(t)&&bu.EMPTY_VALUES.includes(this.typedValue))&&!(0===t&&""===this.value)}}wu=bu,bu.UNMASKED_RADIX=".",bu.EMPTY_VALUES=[...cu.EMPTY_VALUES,0],bu.DEFAULTS={...cu.DEFAULTS,mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[wu.UNMASKED_RADIX],min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,scale:2,normalizeZeros:!0,padFractionalZeros:!1,parse:Number,format:t=>t.toLocaleString("en-US",{useGrouping:!1,maximumFractionDigits:20})},Js.MaskedNumber=bu;const Cu={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function Au(t,e,r){void 0===e&&(e=Cu.MASKED),void 0===r&&(r=Cu.MASKED);const n=ru(t);return t=>n.runIsolated(n=>(n[e]=t,n[r]))}Js.PIPE_TYPE=Cu,Js.createPipe=Au,Js.pipe=function(t,e,r,n){return Au(e,r,n)(t)};Js.RepeatBlock=class extends gu{get repeatFrom(){var t;return null!=(t=Array.isArray(this.repeat)?this.repeat[0]:this.repeat===1/0?0:this.repeat)?t:0}get repeatTo(){var t;return null!=(t=Array.isArray(this.repeat)?this.repeat[1]:this.repeat)?t:1/0}constructor(t){super(t)}updateOptions(t){super.updateOptions(t)}_update(t){var e,r,n;const{repeat:o,...i}=eu(t);this._blockOpts=Object.assign({},this._blockOpts,i);const a=ru(this._blockOpts);this.repeat=null!=(e=null!=(r=null!=o?o:a.repeat)?r:this.repeat)?e:1/0,super._update({mask:"m".repeat(Math.max(this.repeatTo===1/0&&(null==(n=this._blocks)?void 0:n.length)||0,this.repeatFrom)),blocks:{m:a},eager:a.eager,overwrite:a.overwrite,skipInvalid:a.skipInvalid,lazy:a.lazy,placeholderChar:a.placeholderChar,displayChar:a.displayChar})}_allocateBlock(t){return t<this._blocks.length?this._blocks[t]:this.repeatTo===1/0||this._blocks.length<this.repeatTo?(this._blocks.push(ru(this._blockOpts)),this.mask+="m",this._blocks[this._blocks.length-1]):void 0}_appendCharRaw(t,e){void 0===e&&(e={});const r=new uu;for(let s,u,l=null!=(n=null==(o=this._mapPosToBlock(this.displayValue.length))?void 0:o.index)?n:Math.max(this._blocks.length-1,0);s=null!=(i=this._blocks[l])?i:u=!u&&this._allocateBlock(l);++l){var n,o,i,a;const c=s._appendChar(t,{...e,_beforeTailState:null==(a=e._beforeTailState)||null==(a=a._blocks)?void 0:a[l]});if(c.skip&&u){this._blocks.pop(),this.mask=this.mask.slice(1);break}if(r.aggregate(c),c.consumed)break}return r}_trimEmptyTail(t,e){var r,n;void 0===t&&(t=0);const o=Math.max((null==(r=this._mapPosToBlock(t))?void 0:r.index)||0,this.repeatFrom,0);let i;null!=e&&(i=null==(n=this._mapPosToBlock(e))?void 0:n.index),null==i&&(i=this._blocks.length-1);let a=0;for(let s=i;o<=s&&!this._blocks[s].unmaskedValue;--s,++a);a&&(this._blocks.splice(i-a+1,a),this.mask=this.mask.slice(a))}reset(){super.reset(),this._trimEmptyTail()}remove(t,e){void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length);const r=super.remove(t,e);return this._trimEmptyTail(t,e),r}totalInputPositions(t,e){return void 0===t&&(t=0),null==e&&this.repeatTo===1/0?1/0:super.totalInputPositions(t,e)}get state(){return super.state}set state(t){this._blocks.length=t._blocks.length,this.mask=this.mask.slice(0,this._blocks.length),super.state=t}};try{globalThis.IMask=Js}catch{}var Eu,Iu={exports:{}},Su={exports:{}},xu={};var Ou,Tu,Nu,ku,Ru,Du,Pu,Mu,Bu,Lu,Fu,ju,Vu,Uu,Hu={};
|
|
568
|
+
`;function Ns({visible:t}){const[r,n]=e.useState([0,0]);return t?(setTimeout(()=>{let[t,e]=r;e<100?e++:e>50&&t++,100==t&&(t=0,e=0),n([t,e])},5),Qt.jsx(Ts,{position:r,children:Qt.jsx("div",{className:"floating-bar",children:Qt.jsx("span",{className:"d-none",children:"Carregando..."})})})):null}function ks({visible:t,message:e="Aguarde...",isbar:r=!1}){return t?r?Qt.jsx(Ns,{visible:t}):Qt.jsx("div",{className:"loading--container",children:Qt.jsxs("div",{className:"loading-body",children:[Qt.jsx("div",{className:"spinner-border text-info"}),Qt.jsx("span",{children:e})]})}):null}function Rs({name:t,value:e,onChange:r,invalid:n=!1,...o}){return Qt.jsx(l,{placeholder:"Informe o telefone",className:"form-control "+(n?"is-invalid":""),format:"(##) # ####-####",mask:"_",value:e,name:t,onValueChange:e=>function(t,e,r){r&&r({target:{name:e,value:t.formattedValue}})}(e,t,r),...o})}const Ds={mask:"**.***.***/****-00",definitions:{"*":/[A-Za-z0-9]/}};function Ps(t){const e=String(t).replace(/\D/g,"");let n=!1;return r.validarCPF(e)||(n=!0),"00000000000"==e&&(n=!1),""==t&&(n=!1),n}function Ms(t){return!r.validarCNPJ(t)}function Bs(t){const e=String(t).replace(/[^A-Za-z0-9]/g,"");let r=!1;return e.length<=11&&Ps(t)&&(r=!0),e.length>11&&Ms(t)&&(r=!0),""==t&&(r=!1),r}function Ls(t){return"string"==typeof t||t instanceof String}function Fs(t){var e;return"object"==typeof t&&null!=t&&"Object"===(null==t||null==(e=t.constructor)?void 0:e.name)}function js(t,e){return Array.isArray(e)?js(t,(t,r)=>e.includes(r)):Object.entries(t).reduce((t,r)=>{let[n,o]=r;return e(o,n)&&(t[n]=o),t},{})}const Vs="NONE",Us="LEFT",Hs="FORCE_LEFT",zs="RIGHT",Ws="FORCE_RIGHT";function Gs(t){return t.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function Xs(t,e){if(e===t)return!0;const r=Array.isArray(e),n=Array.isArray(t);let o;if(r&&n){if(e.length!=t.length)return!1;for(o=0;o<e.length;o++)if(!Xs(e[o],t[o]))return!1;return!0}if(r!=n)return!1;if(e&&t&&"object"==typeof e&&"object"==typeof t){const r=e instanceof Date,n=t instanceof Date;if(r&&n)return e.getTime()==t.getTime();if(r!=n)return!1;const i=e instanceof RegExp,a=t instanceof RegExp;if(i&&a)return e.toString()==t.toString();if(i!=a)return!1;const s=Object.keys(e);for(o=0;o<s.length;o++)if(!Object.prototype.hasOwnProperty.call(t,s[o]))return!1;for(o=0;o<s.length;o++)if(!Xs(t[s[o]],e[s[o]]))return!1;return!0}return!(!e||!t||"function"!=typeof e||"function"!=typeof t)&&e.toString()===t.toString()}class $s{constructor(t){for(Object.assign(this,t);this.value.slice(0,this.startChangePos)!==this.oldValue.slice(0,this.startChangePos);)--this.oldSelection.start;if(this.insertedCount)for(;this.value.slice(this.cursorPos)!==this.oldValue.slice(this.oldSelection.end);)this.value.length-this.cursorPos<this.oldValue.length-this.oldSelection.end?++this.oldSelection.end:++this.cursorPos}get startChangePos(){return Math.min(this.cursorPos,this.oldSelection.start)}get insertedCount(){return this.cursorPos-this.startChangePos}get inserted(){return this.value.substr(this.startChangePos,this.insertedCount)}get removedCount(){return Math.max(this.oldSelection.end-this.startChangePos||this.oldValue.length-this.value.length,0)}get removed(){return this.oldValue.substr(this.startChangePos,this.removedCount)}get head(){return this.value.substring(0,this.startChangePos)}get tail(){return this.value.substring(this.startChangePos+this.insertedCount)}get removeDirection(){return!this.removedCount||this.insertedCount?Vs:this.oldSelection.end!==this.cursorPos&&this.oldSelection.start!==this.cursorPos||this.oldSelection.end!==this.oldSelection.start?Us:zs}}function Ys(t,e){return new Ys.InputMask(t,e)}function qs(t){if(null==t)throw new Error("mask property should be defined");return t instanceof RegExp?Ys.MaskedRegExp:Ls(t)?Ys.MaskedPattern:t===Date?Ys.MaskedDate:t===Number?Ys.MaskedNumber:Array.isArray(t)||t===Array?Ys.MaskedDynamic:Ys.Masked&&t.prototype instanceof Ys.Masked?t:Ys.Masked&&t instanceof Ys.Masked?t.constructor:t instanceof Function?Ys.MaskedFunction:(console.warn("Mask not found for mask",t),Ys.Masked)}function Ks(t){if(!t)throw new Error("Options in not defined");if(Ys.Masked){if(t.prototype instanceof Ys.Masked)return{mask:t};const{mask:e,...r}=t instanceof Ys.Masked?{mask:t}:Fs(t)&&t.mask instanceof Ys.Masked?t:{};if(e){const t=e.mask;return{...js(e,(t,e)=>!e.startsWith("_")),mask:e.constructor,_mask:t,...r}}}return Fs(t)?{...t}:{mask:t}}function Zs(t){if(Ys.Masked&&t instanceof Ys.Masked)return t;const e=Ks(t),r=qs(e.mask);if(!r)throw new Error("Masked class is not found for provided mask "+e.mask+", appropriate module needs to be imported manually before creating mask.");return e.mask===r&&delete e.mask,e._mask&&(e.mask=e._mask,delete e._mask),new r(e)}Ys.createMask=Zs;class Qs{get selectionStart(){let t;try{t=this._unsafeSelectionStart}catch{}return null!=t?t:this.value.length}get selectionEnd(){let t;try{t=this._unsafeSelectionEnd}catch{}return null!=t?t:this.value.length}select(t,e){if(null!=t&&null!=e&&(t!==this.selectionStart||e!==this.selectionEnd))try{this._unsafeSelect(t,e)}catch{}}get isActive(){return!1}}Ys.MaskElement=Qs;class Js extends Qs{constructor(t){super(),this.input=t,this._onKeydown=this._onKeydown.bind(this),this._onInput=this._onInput.bind(this),this._onBeforeinput=this._onBeforeinput.bind(this),this._onCompositionEnd=this._onCompositionEnd.bind(this)}get rootElement(){var t,e,r;return null!=(t=null==(e=(r=this.input).getRootNode)?void 0:e.call(r))?t:document}get isActive(){return this.input===this.rootElement.activeElement}bindEvents(t){this.input.addEventListener("keydown",this._onKeydown),this.input.addEventListener("input",this._onInput),this.input.addEventListener("beforeinput",this._onBeforeinput),this.input.addEventListener("compositionend",this._onCompositionEnd),this.input.addEventListener("drop",t.drop),this.input.addEventListener("click",t.click),this.input.addEventListener("focus",t.focus),this.input.addEventListener("blur",t.commit),this._handlers=t}_onKeydown(t){return this._handlers.redo&&(90===t.keyCode&&t.shiftKey&&(t.metaKey||t.ctrlKey)||89===t.keyCode&&t.ctrlKey)?(t.preventDefault(),this._handlers.redo(t)):this._handlers.undo&&90===t.keyCode&&(t.metaKey||t.ctrlKey)?(t.preventDefault(),this._handlers.undo(t)):void(t.isComposing||this._handlers.selectionChange(t))}_onBeforeinput(t){return"historyUndo"===t.inputType&&this._handlers.undo?(t.preventDefault(),this._handlers.undo(t)):"historyRedo"===t.inputType&&this._handlers.redo?(t.preventDefault(),this._handlers.redo(t)):void 0}_onCompositionEnd(t){this._handlers.input(t)}_onInput(t){t.isComposing||this._handlers.input(t)}unbindEvents(){this.input.removeEventListener("keydown",this._onKeydown),this.input.removeEventListener("input",this._onInput),this.input.removeEventListener("beforeinput",this._onBeforeinput),this.input.removeEventListener("compositionend",this._onCompositionEnd),this.input.removeEventListener("drop",this._handlers.drop),this.input.removeEventListener("click",this._handlers.click),this.input.removeEventListener("focus",this._handlers.focus),this.input.removeEventListener("blur",this._handlers.commit),this._handlers={}}}Ys.HTMLMaskElement=Js;class tu extends Js{constructor(t){super(t),this.input=t}get _unsafeSelectionStart(){return null!=this.input.selectionStart?this.input.selectionStart:this.value.length}get _unsafeSelectionEnd(){return this.input.selectionEnd}_unsafeSelect(t,e){this.input.setSelectionRange(t,e)}get value(){return this.input.value}set value(t){this.input.value=t}}Ys.HTMLMaskElement=Js;class eu extends Js{get _unsafeSelectionStart(){const t=this.rootElement,e=t.getSelection&&t.getSelection(),r=e&&e.anchorOffset,n=e&&e.focusOffset;return null==n||null==r||r<n?r:n}get _unsafeSelectionEnd(){const t=this.rootElement,e=t.getSelection&&t.getSelection(),r=e&&e.anchorOffset,n=e&&e.focusOffset;return null==n||null==r||r>n?r:n}_unsafeSelect(t,e){if(!this.rootElement.createRange)return;const r=this.rootElement.createRange();r.setStart(this.input.firstChild||this.input,t),r.setEnd(this.input.lastChild||this.input,e);const n=this.rootElement,o=n.getSelection&&n.getSelection();o&&(o.removeAllRanges(),o.addRange(r))}get value(){return this.input.textContent||""}set value(t){this.input.textContent=t}}Ys.HTMLContenteditableMaskElement=eu;class ru{constructor(){this.states=[],this.currentIndex=0}get currentState(){return this.states[this.currentIndex]}get isEmpty(){return 0===this.states.length}push(t){this.currentIndex<this.states.length-1&&(this.states.length=this.currentIndex+1),this.states.push(t),this.states.length>ru.MAX_LENGTH&&this.states.shift(),this.currentIndex=this.states.length-1}go(t){return this.currentIndex=Math.min(Math.max(this.currentIndex+t,0),this.states.length-1),this.currentState}undo(){return this.go(-1)}redo(){return this.go(1)}clear(){this.states.length=0,this.currentIndex=0}}ru.MAX_LENGTH=100;Ys.InputMask=class{constructor(t,e){this.el=t instanceof Qs?t:t.isContentEditable&&"INPUT"!==t.tagName&&"TEXTAREA"!==t.tagName?new eu(t):new tu(t),this.masked=Zs(e),this._listeners={},this._value="",this._unmaskedValue="",this._rawInputValue="",this.history=new ru,this._saveSelection=this._saveSelection.bind(this),this._onInput=this._onInput.bind(this),this._onChange=this._onChange.bind(this),this._onDrop=this._onDrop.bind(this),this._onFocus=this._onFocus.bind(this),this._onClick=this._onClick.bind(this),this._onUndo=this._onUndo.bind(this),this._onRedo=this._onRedo.bind(this),this.alignCursor=this.alignCursor.bind(this),this.alignCursorFriendly=this.alignCursorFriendly.bind(this),this._bindEvents(),this.updateValue(),this._onChange()}maskEquals(t){var e;return null==t||(null==(e=this.masked)?void 0:e.maskEquals(t))}get mask(){return this.masked.mask}set mask(t){if(this.maskEquals(t))return;if(!(t instanceof Ys.Masked)&&this.masked.constructor===qs(t))return void this.masked.updateOptions({mask:t});const e=t instanceof Ys.Masked?t:Zs({mask:t});e.unmaskedValue=this.masked.unmaskedValue,this.masked=e}get value(){return this._value}set value(t){this.value!==t&&(this.masked.value=t,this.updateControl("auto"))}get unmaskedValue(){return this._unmaskedValue}set unmaskedValue(t){this.unmaskedValue!==t&&(this.masked.unmaskedValue=t,this.updateControl("auto"))}get rawInputValue(){return this._rawInputValue}set rawInputValue(t){this.rawInputValue!==t&&(this.masked.rawInputValue=t,this.updateControl(),this.alignCursor())}get typedValue(){return this.masked.typedValue}set typedValue(t){this.masked.typedValueEquals(t)||(this.masked.typedValue=t,this.updateControl("auto"))}get displayValue(){return this.masked.displayValue}_bindEvents(){this.el.bindEvents({selectionChange:this._saveSelection,input:this._onInput,drop:this._onDrop,click:this._onClick,focus:this._onFocus,commit:this._onChange,undo:this._onUndo,redo:this._onRedo})}_unbindEvents(){this.el&&this.el.unbindEvents()}_fireEvent(t,e){const r=this._listeners[t];r&&r.forEach(t=>t(e))}get selectionStart(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}get cursorPos(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd}set cursorPos(t){this.el&&this.el.isActive&&(this.el.select(t,t),this._saveSelection())}_saveSelection(){this.displayValue!==this.el.value&&console.warn("Element value was changed outside of mask. Syncronize mask using `mask.updateValue()` to work properly."),this._selection={start:this.selectionStart,end:this.cursorPos}}updateValue(){this.masked.value=this.el.value,this._value=this.masked.value,this._unmaskedValue=this.masked.unmaskedValue,this._rawInputValue=this.masked.rawInputValue}updateControl(t){const e=this.masked.unmaskedValue,r=this.masked.value,n=this.masked.rawInputValue,o=this.displayValue,i=this.unmaskedValue!==e||this.value!==r||this._rawInputValue!==n;this._unmaskedValue=e,this._value=r,this._rawInputValue=n,this.el.value!==o&&(this.el.value=o),"auto"===t?this.alignCursor():null!=t&&(this.cursorPos=t),i&&this._fireChangeEvents(),this._historyChanging||!i&&!this.history.isEmpty||this.history.push({unmaskedValue:e,selection:{start:this.selectionStart,end:this.cursorPos}})}updateOptions(t){const{mask:e,...r}=t,n=!this.maskEquals(e),o=this.masked.optionsIsChanged(r);n&&(this.mask=e),o&&this.masked.updateOptions(r),(n||o)&&this.updateControl()}updateCursor(t){null!=t&&(this.cursorPos=t,this._delayUpdateCursor(t))}_delayUpdateCursor(t){this._abortUpdateCursor(),this._changingCursorPos=t,this._cursorChanging=setTimeout(()=>{this.el&&(this.cursorPos=this._changingCursorPos,this._abortUpdateCursor())},10)}_fireChangeEvents(){this._fireEvent("accept",this._inputEvent),this.masked.isComplete&&this._fireEvent("complete",this._inputEvent)}_abortUpdateCursor(){this._cursorChanging&&(clearTimeout(this._cursorChanging),delete this._cursorChanging)}alignCursor(){this.cursorPos=this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos,Us))}alignCursorFriendly(){this.selectionStart===this.cursorPos&&this.alignCursor()}on(t,e){return this._listeners[t]||(this._listeners[t]=[]),this._listeners[t].push(e),this}off(t,e){if(!this._listeners[t])return this;if(!e)return delete this._listeners[t],this;const r=this._listeners[t].indexOf(e);return r>=0&&this._listeners[t].splice(r,1),this}_onInput(t){this._inputEvent=t,this._abortUpdateCursor();const e=new $s({value:this.el.value,cursorPos:this.cursorPos,oldValue:this.displayValue,oldSelection:this._selection}),r=this.masked.rawInputValue,n=this.masked.splice(e.startChangePos,e.removed.length,e.inserted,e.removeDirection,{input:!0,raw:!0}).offset,o=r===this.masked.rawInputValue?e.removeDirection:Vs;let i=this.masked.nearestInputPos(e.startChangePos+n,o);o!==Vs&&(i=this.masked.nearestInputPos(i,Vs)),this.updateControl(i),delete this._inputEvent}_onChange(){this.displayValue!==this.el.value&&this.updateValue(),this.masked.doCommit(),this.updateControl(),this._saveSelection()}_onDrop(t){t.preventDefault(),t.stopPropagation()}_onFocus(t){this.alignCursorFriendly()}_onClick(t){this.alignCursorFriendly()}_onUndo(){this._applyHistoryState(this.history.undo())}_onRedo(){this._applyHistoryState(this.history.redo())}_applyHistoryState(t){t&&(this._historyChanging=!0,this.unmaskedValue=t.unmaskedValue,this.el.select(t.selection.start,t.selection.end),this._saveSelection(),this._historyChanging=!1)}destroy(){this._unbindEvents(),this._listeners.length=0,delete this.el}};class nu{static normalize(t){return Array.isArray(t)?t:[t,new nu]}constructor(t){Object.assign(this,{inserted:"",rawInserted:"",tailShift:0,skip:!1},t)}aggregate(t){return this.inserted+=t.inserted,this.rawInserted+=t.rawInserted,this.tailShift+=t.tailShift,this.skip=this.skip||t.skip,this}get offset(){return this.tailShift+this.inserted.length}get consumed(){return Boolean(this.rawInserted)||this.skip}equals(t){return this.inserted===t.inserted&&this.tailShift===t.tailShift&&this.rawInserted===t.rawInserted&&this.skip===t.skip}}Ys.ChangeDetails=nu;class ou{constructor(t,e,r){void 0===t&&(t=""),void 0===e&&(e=0),this.value=t,this.from=e,this.stop=r}toString(){return this.value}extend(t){this.value+=String(t)}appendTo(t){return t.append(this.toString(),{tail:!0}).aggregate(t._appendPlaceholder())}get state(){return{value:this.value,from:this.from,stop:this.stop}}set state(t){Object.assign(this,t)}unshift(t){if(!this.value.length||null!=t&&this.from>=t)return"";const e=this.value[0];return this.value=this.value.slice(1),e}shift(){if(!this.value.length)return"";const t=this.value[this.value.length-1];return this.value=this.value.slice(0,-1),t}}class iu{constructor(t){this._value="",this._update({...iu.DEFAULTS,...t}),this._initialized=!0}updateOptions(t){this.optionsIsChanged(t)&&this.withValueRefresh(this._update.bind(this,t))}_update(t){Object.assign(this,t)}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue}}set state(t){this._value=t._value}reset(){this._value=""}get value(){return this._value}set value(t){this.resolve(t,{input:!0})}resolve(t,e){void 0===e&&(e={input:!0}),this.reset(),this.append(t,e,""),this.doCommit()}get unmaskedValue(){return this.value}set unmaskedValue(t){this.resolve(t,{})}get typedValue(){return this.parse?this.parse(this.value,this):this.unmaskedValue}set typedValue(t){this.format?this.value=this.format(t,this):this.unmaskedValue=String(t)}get rawInputValue(){return this.extractInput(0,this.displayValue.length,{raw:!0})}set rawInputValue(t){this.resolve(t,{raw:!0})}get displayValue(){return this.value}get isComplete(){return!0}get isFilled(){return this.isComplete}nearestInputPos(t,e){return t}totalInputPositions(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),Math.min(this.displayValue.length,e-t)}extractInput(t,e,r){return void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),this.displayValue.slice(t,e)}extractTail(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),new ou(this.extractInput(t,e),t)}appendTail(t){return Ls(t)&&(t=new ou(String(t))),t.appendTo(this)}_appendCharRaw(t,e){return t?(this._value+=t,new nu({inserted:t,rawInserted:t})):new nu}_appendChar(t,e,r){void 0===e&&(e={});const n=this.state;let o;if([t,o]=this.doPrepareChar(t,e),t&&(o=o.aggregate(this._appendCharRaw(t,e)),!o.rawInserted&&"pad"===this.autofix)){const r=this.state;this.state=n;let i=this.pad(e);const a=this._appendCharRaw(t,e);i=i.aggregate(a),a.rawInserted||i.equals(o)?o=i:this.state=r}if(o.inserted){let t,i=!1!==this.doValidate(e);if(i&&null!=r){const e=this.state;if(!0===this.overwrite){t=r.state;for(let t=0;t<o.rawInserted.length;++t)r.unshift(this.displayValue.length-o.tailShift)}let n=this.appendTail(r);if(i=n.rawInserted.length===r.toString().length,!(i&&n.inserted||"shift"!==this.overwrite)){this.state=e,t=r.state;for(let t=0;t<o.rawInserted.length;++t)r.shift();n=this.appendTail(r),i=n.rawInserted.length===r.toString().length}i&&n.inserted&&(this.state=e)}i||(o=new nu,this.state=n,r&&t&&(r.state=t))}return o}_appendPlaceholder(){return new nu}_appendEager(){return new nu}append(t,e,r){if(!Ls(t))throw new Error("value should be string");const n=Ls(r)?new ou(String(r)):r;let o;null!=e&&e.tail&&(e._beforeTailState=this.state),[t,o]=this.doPrepare(t,e);for(let i=0;i<t.length;++i){const r=this._appendChar(t[i],e,n);if(!r.rawInserted&&!this.doSkipInvalid(t[i],e,n))break;o.aggregate(r)}return(!0===this.eager||"append"===this.eager)&&null!=e&&e.input&&t&&o.aggregate(this._appendEager()),null!=n&&(o.tailShift+=this.appendTail(n).tailShift),o}remove(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),this._value=this.displayValue.slice(0,t)+this.displayValue.slice(e),new nu}withValueRefresh(t){if(this._refreshing||!this._initialized)return t();this._refreshing=!0;const e=this.rawInputValue,r=this.value,n=t();return this.rawInputValue=e,this.value&&this.value!==r&&0===r.indexOf(this.value)&&(this.append(r.slice(this.displayValue.length),{},""),this.doCommit()),delete this._refreshing,n}runIsolated(t){if(this._isolated||!this._initialized)return t(this);this._isolated=!0;const e=this.state,r=t(this);return this.state=e,delete this._isolated,r}doSkipInvalid(t,e,r){return Boolean(this.skipInvalid)}doPrepare(t,e){return void 0===e&&(e={}),nu.normalize(this.prepare?this.prepare(t,this,e):t)}doPrepareChar(t,e){return void 0===e&&(e={}),nu.normalize(this.prepareChar?this.prepareChar(t,this,e):t)}doValidate(t){return(!this.validate||this.validate(this.value,this,t))&&(!this.parent||this.parent.doValidate(t))}doCommit(){this.commit&&this.commit(this.value,this)}splice(t,e,r,n,o){void 0===r&&(r=""),void 0===n&&(n=Vs),void 0===o&&(o={input:!0});const i=t+e,a=this.extractTail(i),s=!0===this.eager||"remove"===this.eager;let u;s&&(n=function(t){switch(t){case Us:return Hs;case zs:return Ws;default:return t}}(n),u=this.extractInput(0,i,{raw:!0}));let l=t;const c=new nu;if(n!==Vs&&(l=this.nearestInputPos(t,e>1&&0!==t&&!s?Vs:n),c.tailShift=l-t),c.aggregate(this.remove(l)),s&&n!==Vs&&u===this.rawInputValue)if(n===Hs){let t;for(;u===this.rawInputValue&&(t=this.displayValue.length);)c.aggregate(new nu({tailShift:-1})).aggregate(this.remove(t-1))}else n===Ws&&a.unshift();return c.aggregate(this.append(r,o,a))}maskEquals(t){return this.mask===t}optionsIsChanged(t){return!Xs(this,t)}typedValueEquals(t){const e=this.typedValue;return t===e||iu.EMPTY_VALUES.includes(t)&&iu.EMPTY_VALUES.includes(e)||!!this.format&&this.format(t,this)===this.format(this.typedValue,this)}pad(t){return new nu}}iu.DEFAULTS={skipInvalid:!0},iu.EMPTY_VALUES=[void 0,null,""],Ys.Masked=iu;class au{constructor(t,e){void 0===t&&(t=[]),void 0===e&&(e=0),this.chunks=t,this.from=e}toString(){return this.chunks.map(String).join("")}extend(t){if(!String(t))return;t=Ls(t)?new ou(String(t)):t;const e=this.chunks[this.chunks.length-1],r=e&&(e.stop===t.stop||null==t.stop)&&t.from===e.from+e.toString().length;if(t instanceof ou)r?e.extend(t.toString()):this.chunks.push(t);else if(t instanceof au){if(null==t.stop){let e;for(;t.chunks.length&&null==t.chunks[0].stop;)e=t.chunks.shift(),e.from+=t.from,this.extend(e)}t.toString()&&(t.stop=t.blockIndex,this.chunks.push(t))}}appendTo(t){if(!(t instanceof Ys.MaskedPattern)){return new ou(this.toString()).appendTo(t)}const e=new nu;for(let r=0;r<this.chunks.length;++r){const n=this.chunks[r],o=t._mapPosToBlock(t.displayValue.length),i=n.stop;let a;if(null!=i&&(!o||o.index<=i)&&((n instanceof au||t._stops.indexOf(i)>=0)&&e.aggregate(t._appendPlaceholder(i)),a=n instanceof au&&t._blocks[i]),a){const r=a.appendTail(n);e.aggregate(r);const o=n.toString().slice(r.rawInserted.length);o&&e.aggregate(t.append(o,{tail:!0}))}else e.aggregate(t.append(n.toString(),{tail:!0}))}return e}get state(){return{chunks:this.chunks.map(t=>t.state),from:this.from,stop:this.stop,blockIndex:this.blockIndex}}set state(t){const{chunks:e,...r}=t;Object.assign(this,r),this.chunks=e.map(t=>{const e="chunks"in t?new au:new ou;return e.state=t,e})}unshift(t){if(!this.chunks.length||null!=t&&this.from>=t)return"";const e=null!=t?t-this.from:t;let r=0;for(;r<this.chunks.length;){const t=this.chunks[r],n=t.unshift(e);if(t.toString()){if(!n)break;++r}else this.chunks.splice(r,1);if(n)return n}return""}shift(){if(!this.chunks.length)return"";let t=this.chunks.length-1;for(;0<=t;){const e=this.chunks[t],r=e.shift();if(e.toString()){if(!r)break;--t}else this.chunks.splice(t,1);if(r)return r}return""}}class su{constructor(t,e){this.masked=t,this._log=[];const{offset:r,index:n}=t._mapPosToBlock(e)||(e<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0});this.offset=r,this.index=n,this.ok=!1}get block(){return this.masked._blocks[this.index]}get pos(){return this.masked._blockStartPos(this.index)+this.offset}get state(){return{index:this.index,offset:this.offset,ok:this.ok}}set state(t){Object.assign(this,t)}pushState(){this._log.push(this.state)}popState(){const t=this._log.pop();return t&&(this.state=t),t}bindBlock(){this.block||(this.index<0&&(this.index=0,this.offset=0),this.index>=this.masked._blocks.length&&(this.index=this.masked._blocks.length-1,this.offset=this.block.displayValue.length))}_pushLeft(t){for(this.pushState(),this.bindBlock();0<=this.index;--this.index,this.offset=(null==(e=this.block)?void 0:e.displayValue.length)||0){var e;if(t())return this.ok=!0}return this.ok=!1}_pushRight(t){for(this.pushState(),this.bindBlock();this.index<this.masked._blocks.length;++this.index,this.offset=0)if(t())return this.ok=!0;return this.ok=!1}pushLeftBeforeFilled(){return this._pushLeft(()=>{if(!this.block.isFixed&&this.block.value)return this.offset=this.block.nearestInputPos(this.offset,Hs),0!==this.offset||void 0})}pushLeftBeforeInput(){return this._pushLeft(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,Us),!0})}pushLeftBeforeRequired(){return this._pushLeft(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,Us),!0})}pushRightBeforeFilled(){return this._pushRight(()=>{if(!this.block.isFixed&&this.block.value)return this.offset=this.block.nearestInputPos(this.offset,Ws),this.offset!==this.block.value.length||void 0})}pushRightBeforeInput(){return this._pushRight(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,Vs),!0})}pushRightBeforeRequired(){return this._pushRight(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,Vs),!0})}}class uu{constructor(t){Object.assign(this,t),this._value="",this.isFixed=!0}get value(){return this._value}get unmaskedValue(){return this.isUnmasking?this.value:""}get rawInputValue(){return this._isRawInput?this.value:""}get displayValue(){return this.value}reset(){this._isRawInput=!1,this._value=""}remove(t,e){return void 0===t&&(t=0),void 0===e&&(e=this._value.length),this._value=this._value.slice(0,t)+this._value.slice(e),this._value||(this._isRawInput=!1),new nu}nearestInputPos(t,e){void 0===e&&(e=Vs);const r=this._value.length;switch(e){case Us:case Hs:return 0;default:return r}}totalInputPositions(t,e){return void 0===t&&(t=0),void 0===e&&(e=this._value.length),this._isRawInput?e-t:0}extractInput(t,e,r){return void 0===t&&(t=0),void 0===e&&(e=this._value.length),void 0===r&&(r={}),r.raw&&this._isRawInput&&this._value.slice(t,e)||""}get isComplete(){return!0}get isFilled(){return Boolean(this._value)}_appendChar(t,e){if(void 0===e&&(e={}),this.isFilled)return new nu;const r=!0===this.eager||"append"===this.eager,n=this.char===t&&(this.isUnmasking||e.input||e.raw)&&(!e.raw||!r)&&!e.tail,o=new nu({inserted:this.char,rawInserted:n?this.char:""});return this._value=this.char,this._isRawInput=n&&(e.raw||e.input),o}_appendEager(){return this._appendChar(this.char,{tail:!0})}_appendPlaceholder(){const t=new nu;return this.isFilled||(this._value=t.inserted=this.char),t}extractTail(){return new ou("")}appendTail(t){return Ls(t)&&(t=new ou(String(t))),t.appendTo(this)}append(t,e,r){const n=this._appendChar(t[0],e);return null!=r&&(n.tailShift+=this.appendTail(r).tailShift),n}doCommit(){}get state(){return{_value:this._value,_rawInputValue:this.rawInputValue}}set state(t){this._value=t._value,this._isRawInput=Boolean(t._rawInputValue)}pad(t){return this._appendPlaceholder()}}class lu{constructor(t){const{parent:e,isOptional:r,placeholderChar:n,displayChar:o,lazy:i,eager:a,...s}=t;this.masked=Zs(s),Object.assign(this,{parent:e,isOptional:r,placeholderChar:n,displayChar:o,lazy:i,eager:a})}reset(){this.isFilled=!1,this.masked.reset()}remove(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.value.length),0===t&&e>=1?(this.isFilled=!1,this.masked.remove(t,e)):new nu}get value(){return this.masked.value||(this.isFilled&&!this.isOptional?this.placeholderChar:"")}get unmaskedValue(){return this.masked.unmaskedValue}get rawInputValue(){return this.masked.rawInputValue}get displayValue(){return this.masked.value&&this.displayChar||this.value}get isComplete(){return Boolean(this.masked.value)||this.isOptional}_appendChar(t,e){if(void 0===e&&(e={}),this.isFilled)return new nu;const r=this.masked.state;let n=this.masked._appendChar(t,this.currentMaskFlags(e));return n.inserted&&!1===this.doValidate(e)&&(n=new nu,this.masked.state=r),n.inserted||this.isOptional||this.lazy||e.input||(n.inserted=this.placeholderChar),n.skip=!n.inserted&&!this.isOptional,this.isFilled=Boolean(n.inserted),n}append(t,e,r){return this.masked.append(t,this.currentMaskFlags(e),r)}_appendPlaceholder(){return this.isFilled||this.isOptional?new nu:(this.isFilled=!0,new nu({inserted:this.placeholderChar}))}_appendEager(){return new nu}extractTail(t,e){return this.masked.extractTail(t,e)}appendTail(t){return this.masked.appendTail(t)}extractInput(t,e,r){return void 0===t&&(t=0),void 0===e&&(e=this.value.length),this.masked.extractInput(t,e,r)}nearestInputPos(t,e){void 0===e&&(e=Vs);const r=this.value.length,n=Math.min(Math.max(t,0),r);switch(e){case Us:case Hs:return this.isComplete?n:0;case zs:case Ws:return this.isComplete?n:r;default:return n}}totalInputPositions(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.value.length),this.value.slice(t,e).length}doValidate(t){return this.masked.doValidate(this.currentMaskFlags(t))&&(!this.parent||this.parent.doValidate(this.currentMaskFlags(t)))}doCommit(){this.masked.doCommit()}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue,masked:this.masked.state,isFilled:this.isFilled}}set state(t){this.masked.state=t.masked,this.isFilled=t.isFilled}currentMaskFlags(t){var e;return{...t,_beforeTailState:(null==t||null==(e=t._beforeTailState)?void 0:e.masked)||(null==t?void 0:t._beforeTailState)}}pad(t){return new nu}}lu.DEFAULT_DEFINITIONS={0:/\d/,a:/[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,"*":/./};Ys.MaskedRegExp=class extends iu{updateOptions(t){super.updateOptions(t)}_update(t){const e=t.mask;e&&(t.validate=t=>t.search(e)>=0),super._update(t)}};class cu extends iu{constructor(t){super({...cu.DEFAULTS,...t,definitions:Object.assign({},lu.DEFAULT_DEFINITIONS,null==t?void 0:t.definitions)})}updateOptions(t){super.updateOptions(t)}_update(t){t.definitions=Object.assign({},this.definitions,t.definitions),super._update(t),this._rebuildMask()}_rebuildMask(){const t=this.definitions;this._blocks=[],this.exposeBlock=void 0,this._stops=[],this._maskedBlocks={};const e=this.mask;if(!e||!t)return;let r=!1,n=!1;for(let o=0;o<e.length;++o){if(this.blocks){const t=e.slice(o),r=Object.keys(this.blocks).filter(e=>0===t.indexOf(e));r.sort((t,e)=>e.length-t.length);const n=r[0];if(n){const{expose:t,repeat:e,...r}=Ks(this.blocks[n]),i={lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite,autofix:this.autofix,...r,repeat:e,parent:this},a=null!=e?new Ys.RepeatBlock(i):Zs(i);a&&(this._blocks.push(a),t&&(this.exposeBlock=a),this._maskedBlocks[n]||(this._maskedBlocks[n]=[]),this._maskedBlocks[n].push(this._blocks.length-1)),o+=n.length-1;continue}}let i=e[o],a=i in t;if(i===cu.STOP_CHAR){this._stops.push(this._blocks.length);continue}if("{"===i||"}"===i){r=!r;continue}if("["===i||"]"===i){n=!n;continue}if(i===cu.ESCAPE_CHAR){if(++o,i=e[o],!i)break;a=!1}const s=a?new lu({isOptional:n,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,...Ks(t[i]),parent:this}):new uu({char:i,eager:this.eager,isUnmasking:r});this._blocks.push(s)}}get state(){return{...super.state,_blocks:this._blocks.map(t=>t.state)}}set state(t){if(!t)return void this.reset();const{_blocks:e,...r}=t;this._blocks.forEach((t,r)=>t.state=e[r]),super.state=r}reset(){super.reset(),this._blocks.forEach(t=>t.reset())}get isComplete(){return this.exposeBlock?this.exposeBlock.isComplete:this._blocks.every(t=>t.isComplete)}get isFilled(){return this._blocks.every(t=>t.isFilled)}get isFixed(){return this._blocks.every(t=>t.isFixed)}get isOptional(){return this._blocks.every(t=>t.isOptional)}doCommit(){this._blocks.forEach(t=>t.doCommit()),super.doCommit()}get unmaskedValue(){return this.exposeBlock?this.exposeBlock.unmaskedValue:this._blocks.reduce((t,e)=>t+e.unmaskedValue,"")}set unmaskedValue(t){if(this.exposeBlock){const e=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.unmaskedValue=t,this.appendTail(e),this.doCommit()}else super.unmaskedValue=t}get value(){return this.exposeBlock?this.exposeBlock.value:this._blocks.reduce((t,e)=>t+e.value,"")}set value(t){if(this.exposeBlock){const e=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.value=t,this.appendTail(e),this.doCommit()}else super.value=t}get typedValue(){return this.exposeBlock?this.exposeBlock.typedValue:super.typedValue}set typedValue(t){if(this.exposeBlock){const e=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.typedValue=t,this.appendTail(e),this.doCommit()}else super.typedValue=t}get displayValue(){return this._blocks.reduce((t,e)=>t+e.displayValue,"")}appendTail(t){return super.appendTail(t).aggregate(this._appendPlaceholder())}_appendEager(){var t;const e=new nu;let r=null==(t=this._mapPosToBlock(this.displayValue.length))?void 0:t.index;if(null==r)return e;this._blocks[r].isFilled&&++r;for(let n=r;n<this._blocks.length;++n){const t=this._blocks[n]._appendEager();if(!t.inserted)break;e.aggregate(t)}return e}_appendCharRaw(t,e){void 0===e&&(e={});const r=this._mapPosToBlock(this.displayValue.length),n=new nu;if(!r)return n;for(let i,a=r.index;i=this._blocks[a];++a){var o;const r=i._appendChar(t,{...e,_beforeTailState:null==(o=e._beforeTailState)||null==(o=o._blocks)?void 0:o[a]});if(n.aggregate(r),r.consumed)break}return n}extractTail(t,e){void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length);const r=new au;return t===e||this._forEachBlocksInRange(t,e,(t,e,n,o)=>{const i=t.extractTail(n,o);i.stop=this._findStopBefore(e),i.from=this._blockStartPos(e),i instanceof au&&(i.blockIndex=e),r.extend(i)}),r}extractInput(t,e,r){if(void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),void 0===r&&(r={}),t===e)return"";let n="";return this._forEachBlocksInRange(t,e,(t,e,o,i)=>{n+=t.extractInput(o,i,r)}),n}_findStopBefore(t){let e;for(let r=0;r<this._stops.length;++r){const n=this._stops[r];if(!(n<=t))break;e=n}return e}_appendPlaceholder(t){const e=new nu;if(this.lazy&&null==t)return e;const r=this._mapPosToBlock(this.displayValue.length);if(!r)return e;const n=r.index,o=null!=t?t:this._blocks.length;return this._blocks.slice(n,o).forEach(r=>{var n;r.lazy&&null==t||e.aggregate(r._appendPlaceholder(null==(n=r._blocks)?void 0:n.length))}),e}_mapPosToBlock(t){let e="";for(let r=0;r<this._blocks.length;++r){const n=this._blocks[r],o=e.length;if(e+=n.displayValue,t<=e.length)return{index:r,offset:t-o}}}_blockStartPos(t){return this._blocks.slice(0,t).reduce((t,e)=>t+e.displayValue.length,0)}_forEachBlocksInRange(t,e,r){void 0===e&&(e=this.displayValue.length);const n=this._mapPosToBlock(t);if(n){const t=this._mapPosToBlock(e),o=t&&n.index===t.index,i=n.offset,a=t&&o?t.offset:this._blocks[n.index].displayValue.length;if(r(this._blocks[n.index],n.index,i,a),t&&!o){for(let e=n.index+1;e<t.index;++e)r(this._blocks[e],e,0,this._blocks[e].displayValue.length);r(this._blocks[t.index],t.index,0,t.offset)}}}remove(t,e){void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length);const r=super.remove(t,e);return this._forEachBlocksInRange(t,e,(t,e,n,o)=>{r.aggregate(t.remove(n,o))}),r}nearestInputPos(t,e){if(void 0===e&&(e=Vs),!this._blocks.length)return 0;const r=new su(this,t);if(e===Vs)return r.pushRightBeforeInput()?r.pos:(r.popState(),r.pushLeftBeforeInput()?r.pos:this.displayValue.length);if(e===Us||e===Hs){if(e===Us){if(r.pushRightBeforeFilled(),r.ok&&r.pos===t)return t;r.popState()}if(r.pushLeftBeforeInput(),r.pushLeftBeforeRequired(),r.pushLeftBeforeFilled(),e===Us){if(r.pushRightBeforeInput(),r.pushRightBeforeRequired(),r.ok&&r.pos<=t)return r.pos;if(r.popState(),r.ok&&r.pos<=t)return r.pos;r.popState()}return r.ok?r.pos:e===Hs?0:(r.popState(),r.ok?r.pos:(r.popState(),r.ok?r.pos:0))}return e===zs||e===Ws?(r.pushRightBeforeInput(),r.pushRightBeforeRequired(),r.pushRightBeforeFilled()?r.pos:e===Ws?this.displayValue.length:(r.popState(),r.ok?r.pos:(r.popState(),r.ok?r.pos:this.nearestInputPos(t,Us)))):t}totalInputPositions(t,e){void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length);let r=0;return this._forEachBlocksInRange(t,e,(t,e,n,o)=>{r+=t.totalInputPositions(n,o)}),r}maskedBlock(t){return this.maskedBlocks(t)[0]}maskedBlocks(t){const e=this._maskedBlocks[t];return e?e.map(t=>this._blocks[t]):[]}pad(t){const e=new nu;return this._forEachBlocksInRange(0,this.displayValue.length,r=>e.aggregate(r.pad(t))),e}}cu.DEFAULTS={...iu.DEFAULTS,lazy:!0,placeholderChar:"_"},cu.STOP_CHAR="`",cu.ESCAPE_CHAR="\\",cu.InputDefinition=lu,cu.FixedDefinition=uu,Ys.MaskedPattern=cu;class hu extends cu{get _matchFrom(){return this.maxLength-String(this.from).length}constructor(t){super(t)}updateOptions(t){super.updateOptions(t)}_update(t){const{to:e=this.to||0,from:r=this.from||0,maxLength:n=this.maxLength||0,autofix:o=this.autofix,...i}=t;this.to=e,this.from=r,this.maxLength=Math.max(String(e).length,n),this.autofix=o;const a=String(this.from).padStart(this.maxLength,"0"),s=String(this.to).padStart(this.maxLength,"0");let u=0;for(;u<s.length&&s[u]===a[u];)++u;i.mask=s.slice(0,u).replace(/0/g,"\\0")+"0".repeat(this.maxLength-u),super._update(i)}get isComplete(){return super.isComplete&&Boolean(this.value)}boundaries(t){let e="",r="";const[,n,o]=t.match(/^(\D*)(\d*)(\D*)/)||[];return o&&(e="0".repeat(n.length)+o,r="9".repeat(n.length)+o),e=e.padEnd(this.maxLength,"0"),r=r.padEnd(this.maxLength,"9"),[e,r]}doPrepareChar(t,e){let r;return void 0===e&&(e={}),[t,r]=super.doPrepareChar(t.replace(/\D/g,""),e),t||(r.skip=!this.isComplete),[t,r]}_appendCharRaw(t,e){if(void 0===e&&(e={}),!this.autofix||this.value.length+1>this.maxLength)return super._appendCharRaw(t,e);const r=String(this.from).padStart(this.maxLength,"0"),n=String(this.to).padStart(this.maxLength,"0"),[o,i]=this.boundaries(this.value+t);return Number(i)<this.from?super._appendCharRaw(r[this.value.length],e):Number(o)>this.to?!e.tail&&"pad"===this.autofix&&this.value.length+1<this.maxLength?super._appendCharRaw(r[this.value.length],e).aggregate(this._appendCharRaw(t,e)):super._appendCharRaw(n[this.value.length],e):super._appendCharRaw(t,e)}doValidate(t){const e=this.value;if(-1===e.search(/[^0]/)&&e.length<=this._matchFrom)return!0;const[r,n]=this.boundaries(e);return this.from<=Number(n)&&Number(r)<=this.to&&super.doValidate(t)}pad(t){const e=new nu;if(this.value.length===this.maxLength)return e;const r=this.value,n=this.maxLength-this.value.length;if(n){this.reset();for(let r=0;r<n;++r)e.aggregate(super._appendCharRaw("0",t));r.split("").forEach(t=>this._appendCharRaw(t))}return e}}Ys.MaskedRange=hu;class fu extends cu{static extractPatternOptions(t){const{mask:e,pattern:r,...n}=t;return{...n,mask:Ls(e)?e:r}}constructor(t){super(fu.extractPatternOptions({...fu.DEFAULTS,...t}))}updateOptions(t){super.updateOptions(t)}_update(t){const{mask:e,pattern:r,blocks:n,...o}={...fu.DEFAULTS,...t},i=Object.assign({},fu.GET_DEFAULT_BLOCKS());t.min&&(i.Y.from=t.min.getFullYear()),t.max&&(i.Y.to=t.max.getFullYear()),t.min&&t.max&&i.Y.from===i.Y.to&&(i.m.from=t.min.getMonth()+1,i.m.to=t.max.getMonth()+1,i.m.from===i.m.to&&(i.d.from=t.min.getDate(),i.d.to=t.max.getDate())),Object.assign(i,this.blocks,n),super._update({...o,mask:Ls(e)?e:r,blocks:i})}doValidate(t){const e=this.date;return super.doValidate(t)&&(!this.isComplete||this.isDateExist(this.value)&&null!=e&&(null==this.min||this.min<=e)&&(null==this.max||e<=this.max))}isDateExist(t){return this.format(this.parse(t,this),this).indexOf(t)>=0}get date(){return this.typedValue}set date(t){this.typedValue=t}get typedValue(){return this.isComplete?super.typedValue:null}set typedValue(t){super.typedValue=t}maskEquals(t){return t===Date||super.maskEquals(t)}optionsIsChanged(t){return super.optionsIsChanged(fu.extractPatternOptions(t))}}fu.GET_DEFAULT_BLOCKS=()=>({d:{mask:hu,from:1,to:31,maxLength:2},m:{mask:hu,from:1,to:12,maxLength:2},Y:{mask:hu,from:1900,to:9999}}),fu.DEFAULTS={...cu.DEFAULTS,mask:Date,pattern:"d{.}`m{.}`Y",format:(t,e)=>{if(!t)return"";return[String(t.getDate()).padStart(2,"0"),String(t.getMonth()+1).padStart(2,"0"),t.getFullYear()].join(".")},parse:(t,e)=>{const[r,n,o]=t.split(".").map(Number);return new Date(o,n-1,r)}},Ys.MaskedDate=fu;class du extends iu{constructor(t){super({...du.DEFAULTS,...t}),this.currentMask=void 0}updateOptions(t){super.updateOptions(t)}_update(t){super._update(t),"mask"in t&&(this.exposeMask=void 0,this.compiledMasks=Array.isArray(t.mask)?t.mask.map(t=>{const{expose:e,...r}=Ks(t),n=Zs({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid,...r});return e&&(this.exposeMask=n),n}):[])}_appendCharRaw(t,e){void 0===e&&(e={});const r=this._applyDispatch(t,e);return this.currentMask&&r.aggregate(this.currentMask._appendChar(t,this.currentMaskFlags(e))),r}_applyDispatch(t,e,r){void 0===t&&(t=""),void 0===e&&(e={}),void 0===r&&(r="");const n=e.tail&&null!=e._beforeTailState?e._beforeTailState._value:this.value,o=this.rawInputValue,i=e.tail&&null!=e._beforeTailState?e._beforeTailState._rawInputValue:o,a=o.slice(i.length),s=this.currentMask,u=new nu,l=null==s?void 0:s.state;return this.currentMask=this.doDispatch(t,{...e},r),this.currentMask&&(this.currentMask!==s?(this.currentMask.reset(),i&&(this.currentMask.append(i,{raw:!0}),u.tailShift=this.currentMask.value.length-n.length),a&&(u.tailShift+=this.currentMask.append(a,{raw:!0,tail:!0}).tailShift)):l&&(this.currentMask.state=l)),u}_appendPlaceholder(){const t=this._applyDispatch();return this.currentMask&&t.aggregate(this.currentMask._appendPlaceholder()),t}_appendEager(){const t=this._applyDispatch();return this.currentMask&&t.aggregate(this.currentMask._appendEager()),t}appendTail(t){const e=new nu;return t&&e.aggregate(this._applyDispatch("",{},t)),e.aggregate(this.currentMask?this.currentMask.appendTail(t):super.appendTail(t))}currentMaskFlags(t){var e,r;return{...t,_beforeTailState:(null==(e=t._beforeTailState)?void 0:e.currentMaskRef)===this.currentMask&&(null==(r=t._beforeTailState)?void 0:r.currentMask)||t._beforeTailState}}doDispatch(t,e,r){return void 0===e&&(e={}),void 0===r&&(r=""),this.dispatch(t,this,e,r)}doValidate(t){return super.doValidate(t)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(t)))}doPrepare(t,e){void 0===e&&(e={});let[r,n]=super.doPrepare(t,e);if(this.currentMask){let t;[r,t]=super.doPrepare(r,this.currentMaskFlags(e)),n=n.aggregate(t)}return[r,n]}doPrepareChar(t,e){void 0===e&&(e={});let[r,n]=super.doPrepareChar(t,e);if(this.currentMask){let t;[r,t]=super.doPrepareChar(r,this.currentMaskFlags(e)),n=n.aggregate(t)}return[r,n]}reset(){var t;null==(t=this.currentMask)||t.reset(),this.compiledMasks.forEach(t=>t.reset())}get value(){return this.exposeMask?this.exposeMask.value:this.currentMask?this.currentMask.value:""}set value(t){this.exposeMask?(this.exposeMask.value=t,this.currentMask=this.exposeMask,this._applyDispatch()):super.value=t}get unmaskedValue(){return this.exposeMask?this.exposeMask.unmaskedValue:this.currentMask?this.currentMask.unmaskedValue:""}set unmaskedValue(t){this.exposeMask?(this.exposeMask.unmaskedValue=t,this.currentMask=this.exposeMask,this._applyDispatch()):super.unmaskedValue=t}get typedValue(){return this.exposeMask?this.exposeMask.typedValue:this.currentMask?this.currentMask.typedValue:""}set typedValue(t){if(this.exposeMask)return this.exposeMask.typedValue=t,this.currentMask=this.exposeMask,void this._applyDispatch();let e=String(t);this.currentMask&&(this.currentMask.typedValue=t,e=this.currentMask.unmaskedValue),this.unmaskedValue=e}get displayValue(){return this.currentMask?this.currentMask.displayValue:""}get isComplete(){var t;return Boolean(null==(t=this.currentMask)?void 0:t.isComplete)}get isFilled(){var t;return Boolean(null==(t=this.currentMask)?void 0:t.isFilled)}remove(t,e){const r=new nu;return this.currentMask&&r.aggregate(this.currentMask.remove(t,e)).aggregate(this._applyDispatch()),r}get state(){var t;return{...super.state,_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map(t=>t.state),currentMaskRef:this.currentMask,currentMask:null==(t=this.currentMask)?void 0:t.state}}set state(t){const{compiledMasks:e,currentMaskRef:r,currentMask:n,...o}=t;e&&this.compiledMasks.forEach((t,r)=>t.state=e[r]),null!=r&&(this.currentMask=r,this.currentMask.state=n),super.state=o}extractInput(t,e,r){return this.currentMask?this.currentMask.extractInput(t,e,r):""}extractTail(t,e){return this.currentMask?this.currentMask.extractTail(t,e):super.extractTail(t,e)}doCommit(){this.currentMask&&this.currentMask.doCommit(),super.doCommit()}nearestInputPos(t,e){return this.currentMask?this.currentMask.nearestInputPos(t,e):super.nearestInputPos(t,e)}get overwrite(){return this.currentMask?this.currentMask.overwrite:this._overwrite}set overwrite(t){this._overwrite=t}get eager(){return this.currentMask?this.currentMask.eager:this._eager}set eager(t){this._eager=t}get skipInvalid(){return this.currentMask?this.currentMask.skipInvalid:this._skipInvalid}set skipInvalid(t){this._skipInvalid=t}get autofix(){return this.currentMask?this.currentMask.autofix:this._autofix}set autofix(t){this._autofix=t}maskEquals(t){return Array.isArray(t)?this.compiledMasks.every((e,r)=>{if(!t[r])return;const{mask:n,...o}=t[r];return Xs(e,o)&&e.maskEquals(n)}):super.maskEquals(t)}typedValueEquals(t){var e;return Boolean(null==(e=this.currentMask)?void 0:e.typedValueEquals(t))}}du.DEFAULTS={...iu.DEFAULTS,dispatch:(t,e,r,n)=>{if(!e.compiledMasks.length)return;const o=e.rawInputValue,i=e.compiledMasks.map((i,a)=>{const s=e.currentMask===i,u=s?i.displayValue.length:i.nearestInputPos(i.displayValue.length,Hs);return i.rawInputValue!==o?(i.reset(),i.append(o,{raw:!0})):s||i.remove(u),i.append(t,e.currentMaskFlags(r)),i.appendTail(n),{index:a,weight:i.rawInputValue.length,totalInputPositions:i.totalInputPositions(0,Math.max(u,i.nearestInputPos(i.displayValue.length,Hs)))}});return i.sort((t,e)=>e.weight-t.weight||e.totalInputPositions-t.totalInputPositions),e.compiledMasks[i[0].index]}},Ys.MaskedDynamic=du;class pu extends cu{constructor(t){super({...pu.DEFAULTS,...t})}updateOptions(t){super.updateOptions(t)}_update(t){const{enum:e,...r}=t;if(e){const t=e.map(t=>t.length),n=Math.min(...t),o=Math.max(...t)-n;r.mask="*".repeat(n),o&&(r.mask+="["+"*".repeat(o)+"]"),this.enum=e}super._update(r)}_appendCharRaw(t,e){void 0===e&&(e={});const r=Math.min(this.nearestInputPos(0,Ws),this.value.length),n=this.enum.filter(e=>this.matchValue(e,this.unmaskedValue+t,r));if(n.length){1===n.length&&this._forEachBlocksInRange(0,this.value.length,(t,r)=>{const o=n[0][r];r>=this.value.length||o===t.value||(t.reset(),t._appendChar(o,e))});const t=super._appendCharRaw(n[0][this.value.length],e);return 1===n.length&&n[0].slice(this.unmaskedValue.length).split("").forEach(e=>t.aggregate(super._appendCharRaw(e))),t}return new nu({skip:!this.isComplete})}extractTail(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),new ou("",t)}remove(t,e){if(void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),t===e)return new nu;const r=Math.min(super.nearestInputPos(0,Ws),this.value.length);let n;for(n=t;n>=0;--n){if(this.enum.filter(t=>this.matchValue(t,this.value.slice(r,n),r)).length>1)break}const o=super.remove(n,e);return o.tailShift+=n-t,o}get isComplete(){return this.enum.indexOf(this.value)>=0}}pu.DEFAULTS={...cu.DEFAULTS,matchValue:(t,e,r)=>t.indexOf(e,r)===r},Ys.MaskedEnum=pu;var gu;Ys.MaskedFunction=class extends iu{updateOptions(t){super.updateOptions(t)}_update(t){super._update({...t,validate:t.mask})}};class mu extends iu{constructor(t){super({...mu.DEFAULTS,...t})}updateOptions(t){super.updateOptions(t)}_update(t){super._update(t),this._updateRegExps()}_updateRegExps(){const t="^"+(this.allowNegative?"[+|\\-]?":""),e=(this.scale?"("+Gs(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=new RegExp(t+"\\d*"+e),this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(Gs).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp(Gs(this.thousandsSeparator),"g")}_removeThousandsSeparators(t){return t.replace(this._thousandsSeparatorRegExp,"")}_insertThousandsSeparators(t){const e=t.split(this.radix);return e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),e.join(this.radix)}doPrepareChar(t,e){void 0===e&&(e={});const[r,n]=super.doPrepareChar(this._removeThousandsSeparators(this.scale&&this.mapToRadix.length&&(e.input&&e.raw||!e.input&&!e.raw)?t.replace(this._mapToRadixRegExp,this.radix):t),e);return t&&!r&&(n.skip=!0),!r||this.allowPositive||this.value||"-"===r||n.aggregate(this._appendChar("-")),[r,n]}_separatorsCount(t,e){void 0===e&&(e=!1);let r=0;for(let n=0;n<t;++n)this._value.indexOf(this.thousandsSeparator,n)===n&&(++r,e&&(t+=this.thousandsSeparator.length));return r}_separatorsCountFromSlice(t){return void 0===t&&(t=this._value),this._separatorsCount(this._removeThousandsSeparators(t).length,!0)}extractInput(t,e,r){return void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),[t,e]=this._adjustRangeWithSeparators(t,e),this._removeThousandsSeparators(super.extractInput(t,e,r))}_appendCharRaw(t,e){void 0===e&&(e={});const r=e.tail&&e._beforeTailState?e._beforeTailState._value:this._value,n=this._separatorsCountFromSlice(r);this._value=this._removeThousandsSeparators(this.value);const o=this._value;this._value+=t;const i=this.number;let a,s=!isNaN(i),u=!1;if(s){let t;null!=this.min&&this.min<0&&this.number<this.min&&(t=this.min),null!=this.max&&this.max>0&&this.number>this.max&&(t=this.max),null!=t&&(this.autofix?(this._value=this.format(t,this).replace(mu.UNMASKED_RADIX,this.radix),u||(u=o===this._value&&!e.tail)):s=!1),s&&(s=Boolean(this._value.match(this._numberRegExp)))}s?a=new nu({inserted:this._value.slice(o.length),rawInserted:u?"":t,skip:u}):(this._value=o,a=new nu),this._value=this._insertThousandsSeparators(this._value);const l=e.tail&&e._beforeTailState?e._beforeTailState._value:this._value,c=this._separatorsCountFromSlice(l);return a.tailShift+=(c-n)*this.thousandsSeparator.length,a}_findSeparatorAround(t){if(this.thousandsSeparator){const e=t-this.thousandsSeparator.length+1,r=this.value.indexOf(this.thousandsSeparator,e);if(r<=t)return r}return-1}_adjustRangeWithSeparators(t,e){const r=this._findSeparatorAround(t);r>=0&&(t=r);const n=this._findSeparatorAround(e);return n>=0&&(e=n+this.thousandsSeparator.length),[t,e]}remove(t,e){void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),[t,e]=this._adjustRangeWithSeparators(t,e);const r=this.value.slice(0,t),n=this.value.slice(e),o=this._separatorsCount(r.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(r+n));const i=this._separatorsCountFromSlice(r);return new nu({tailShift:(i-o)*this.thousandsSeparator.length})}nearestInputPos(t,e){if(!this.thousandsSeparator)return t;switch(e){case Vs:case Us:case Hs:{const r=this._findSeparatorAround(t-1);if(r>=0){const n=r+this.thousandsSeparator.length;if(t<n||this.value.length<=n||e===Hs)return r}break}case zs:case Ws:{const e=this._findSeparatorAround(t);if(e>=0)return e+this.thousandsSeparator.length}}return t}doCommit(){if(this.value){const t=this.number;let e=t;null!=this.min&&(e=Math.max(e,this.min)),null!=this.max&&(e=Math.min(e,this.max)),e!==t&&(this.unmaskedValue=this.format(e,this));let r=this.value;this.normalizeZeros&&(r=this._normalizeZeros(r)),this.padFractionalZeros&&this.scale>0&&(r=this._padFractionalZeros(r)),this._value=r}super.doCommit()}_normalizeZeros(t){const e=this._removeThousandsSeparators(t).split(this.radix);return e[0]=e[0].replace(/^(\D*)(0*)(\d*)/,(t,e,r,n)=>e+n),t.length&&!/\d$/.test(e[0])&&(e[0]=e[0]+"0"),e.length>1&&(e[1]=e[1].replace(/0*$/,""),e[1].length||(e.length=1)),this._insertThousandsSeparators(e.join(this.radix))}_padFractionalZeros(t){if(!t)return t;const e=t.split(this.radix);return e.length<2&&e.push(""),e[1]=e[1].padEnd(this.scale,"0"),e.join(this.radix)}doSkipInvalid(t,e,r){void 0===e&&(e={});const n=0===this.scale&&t!==this.thousandsSeparator&&(t===this.radix||t===mu.UNMASKED_RADIX||this.mapToRadix.includes(t));return super.doSkipInvalid(t,e,r)&&!n}get unmaskedValue(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,mu.UNMASKED_RADIX)}set unmaskedValue(t){super.unmaskedValue=t}get typedValue(){return this.parse(this.unmaskedValue,this)}set typedValue(t){this.rawInputValue=this.format(t,this).replace(mu.UNMASKED_RADIX,this.radix)}get number(){return this.typedValue}set number(t){this.typedValue=t}get allowNegative(){return null!=this.min&&this.min<0||null!=this.max&&this.max<0}get allowPositive(){return null!=this.min&&this.min>0||null!=this.max&&this.max>0}typedValueEquals(t){return(super.typedValueEquals(t)||mu.EMPTY_VALUES.includes(t)&&mu.EMPTY_VALUES.includes(this.typedValue))&&!(0===t&&""===this.value)}}gu=mu,mu.UNMASKED_RADIX=".",mu.EMPTY_VALUES=[...iu.EMPTY_VALUES,0],mu.DEFAULTS={...iu.DEFAULTS,mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[gu.UNMASKED_RADIX],min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,scale:2,normalizeZeros:!0,padFractionalZeros:!1,parse:Number,format:t=>t.toLocaleString("en-US",{useGrouping:!1,maximumFractionDigits:20})},Ys.MaskedNumber=mu;const vu={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function yu(t,e,r){void 0===e&&(e=vu.MASKED),void 0===r&&(r=vu.MASKED);const n=Zs(t);return t=>n.runIsolated(n=>(n[e]=t,n[r]))}Ys.PIPE_TYPE=vu,Ys.createPipe=yu,Ys.pipe=function(t,e,r,n){return yu(e,r,n)(t)};Ys.RepeatBlock=class extends cu{get repeatFrom(){var t;return null!=(t=Array.isArray(this.repeat)?this.repeat[0]:this.repeat===1/0?0:this.repeat)?t:0}get repeatTo(){var t;return null!=(t=Array.isArray(this.repeat)?this.repeat[1]:this.repeat)?t:1/0}constructor(t){super(t)}updateOptions(t){super.updateOptions(t)}_update(t){var e,r,n;const{repeat:o,...i}=Ks(t);this._blockOpts=Object.assign({},this._blockOpts,i);const a=Zs(this._blockOpts);this.repeat=null!=(e=null!=(r=null!=o?o:a.repeat)?r:this.repeat)?e:1/0,super._update({mask:"m".repeat(Math.max(this.repeatTo===1/0&&(null==(n=this._blocks)?void 0:n.length)||0,this.repeatFrom)),blocks:{m:a},eager:a.eager,overwrite:a.overwrite,skipInvalid:a.skipInvalid,lazy:a.lazy,placeholderChar:a.placeholderChar,displayChar:a.displayChar})}_allocateBlock(t){return t<this._blocks.length?this._blocks[t]:this.repeatTo===1/0||this._blocks.length<this.repeatTo?(this._blocks.push(Zs(this._blockOpts)),this.mask+="m",this._blocks[this._blocks.length-1]):void 0}_appendCharRaw(t,e){void 0===e&&(e={});const r=new nu;for(let s,u,l=null!=(n=null==(o=this._mapPosToBlock(this.displayValue.length))?void 0:o.index)?n:Math.max(this._blocks.length-1,0);s=null!=(i=this._blocks[l])?i:u=!u&&this._allocateBlock(l);++l){var n,o,i,a;const c=s._appendChar(t,{...e,_beforeTailState:null==(a=e._beforeTailState)||null==(a=a._blocks)?void 0:a[l]});if(c.skip&&u){this._blocks.pop(),this.mask=this.mask.slice(1);break}if(r.aggregate(c),c.consumed)break}return r}_trimEmptyTail(t,e){var r,n;void 0===t&&(t=0);const o=Math.max((null==(r=this._mapPosToBlock(t))?void 0:r.index)||0,this.repeatFrom,0);let i;null!=e&&(i=null==(n=this._mapPosToBlock(e))?void 0:n.index),null==i&&(i=this._blocks.length-1);let a=0;for(let s=i;o<=s&&!this._blocks[s].unmaskedValue;--s,++a);a&&(this._blocks.splice(i-a+1,a),this.mask=this.mask.slice(a))}reset(){super.reset(),this._trimEmptyTail()}remove(t,e){void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length);const r=super.remove(t,e);return this._trimEmptyTail(t,e),r}totalInputPositions(t,e){return void 0===t&&(t=0),null==e&&this.repeatTo===1/0?1/0:super.totalInputPositions(t,e)}get state(){return super.state}set state(t){this._blocks.length=t._blocks.length,this.mask=this.mask.slice(0,this._blocks.length),super.state=t}};try{globalThis.IMask=Ys}catch{}var _u,wu={exports:{}},bu={exports:{}},Cu={};var Au,Eu,Iu,Su,xu,Ou,Tu,Nu,ku,Ru,Du,Pu,Mu,Bu,Lu={};
|
|
574
569
|
/** @license React v16.13.1
|
|
575
570
|
* react-is.development.js
|
|
576
571
|
*
|
|
@@ -578,14 +573,14 @@
|
|
|
578
573
|
*
|
|
579
574
|
* This source code is licensed under the MIT license found in the
|
|
580
575
|
* LICENSE file in the root directory of this source tree.
|
|
581
|
-
*/function
|
|
576
|
+
*/function Fu(){return Eu||(Eu=1,"production"===process.env.NODE_ENV?bu.exports=function(){if(_u)return Cu;_u=1;var t="function"==typeof Symbol&&Symbol.for,e=t?Symbol.for("react.element"):60103,r=t?Symbol.for("react.portal"):60106,n=t?Symbol.for("react.fragment"):60107,o=t?Symbol.for("react.strict_mode"):60108,i=t?Symbol.for("react.profiler"):60114,a=t?Symbol.for("react.provider"):60109,s=t?Symbol.for("react.context"):60110,u=t?Symbol.for("react.async_mode"):60111,l=t?Symbol.for("react.concurrent_mode"):60111,c=t?Symbol.for("react.forward_ref"):60112,h=t?Symbol.for("react.suspense"):60113,f=t?Symbol.for("react.suspense_list"):60120,d=t?Symbol.for("react.memo"):60115,p=t?Symbol.for("react.lazy"):60116,g=t?Symbol.for("react.block"):60121,m=t?Symbol.for("react.fundamental"):60117,v=t?Symbol.for("react.responder"):60118,y=t?Symbol.for("react.scope"):60119;function _(t){if("object"==typeof t&&null!==t){var f=t.$$typeof;switch(f){case e:switch(t=t.type){case u:case l:case n:case i:case o:case h:return t;default:switch(t=t&&t.$$typeof){case s:case c:case p:case d:case a:return t;default:return f}}case r:return f}}}function w(t){return _(t)===l}return Cu.AsyncMode=u,Cu.ConcurrentMode=l,Cu.ContextConsumer=s,Cu.ContextProvider=a,Cu.Element=e,Cu.ForwardRef=c,Cu.Fragment=n,Cu.Lazy=p,Cu.Memo=d,Cu.Portal=r,Cu.Profiler=i,Cu.StrictMode=o,Cu.Suspense=h,Cu.isAsyncMode=function(t){return w(t)||_(t)===u},Cu.isConcurrentMode=w,Cu.isContextConsumer=function(t){return _(t)===s},Cu.isContextProvider=function(t){return _(t)===a},Cu.isElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===e},Cu.isForwardRef=function(t){return _(t)===c},Cu.isFragment=function(t){return _(t)===n},Cu.isLazy=function(t){return _(t)===p},Cu.isMemo=function(t){return _(t)===d},Cu.isPortal=function(t){return _(t)===r},Cu.isProfiler=function(t){return _(t)===i},Cu.isStrictMode=function(t){return _(t)===o},Cu.isSuspense=function(t){return _(t)===h},Cu.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===n||t===l||t===i||t===o||t===h||t===f||"object"==typeof t&&null!==t&&(t.$$typeof===p||t.$$typeof===d||t.$$typeof===a||t.$$typeof===s||t.$$typeof===c||t.$$typeof===m||t.$$typeof===v||t.$$typeof===y||t.$$typeof===g)},Cu.typeOf=_,Cu}():bu.exports=(Au||(Au=1,"production"!==process.env.NODE_ENV&&function(){var t="function"==typeof Symbol&&Symbol.for,e=t?Symbol.for("react.element"):60103,r=t?Symbol.for("react.portal"):60106,n=t?Symbol.for("react.fragment"):60107,o=t?Symbol.for("react.strict_mode"):60108,i=t?Symbol.for("react.profiler"):60114,a=t?Symbol.for("react.provider"):60109,s=t?Symbol.for("react.context"):60110,u=t?Symbol.for("react.async_mode"):60111,l=t?Symbol.for("react.concurrent_mode"):60111,c=t?Symbol.for("react.forward_ref"):60112,h=t?Symbol.for("react.suspense"):60113,f=t?Symbol.for("react.suspense_list"):60120,d=t?Symbol.for("react.memo"):60115,p=t?Symbol.for("react.lazy"):60116,g=t?Symbol.for("react.block"):60121,m=t?Symbol.for("react.fundamental"):60117,v=t?Symbol.for("react.responder"):60118,y=t?Symbol.for("react.scope"):60119;function _(t){if("object"==typeof t&&null!==t){var f=t.$$typeof;switch(f){case e:var g=t.type;switch(g){case u:case l:case n:case i:case o:case h:return g;default:var m=g&&g.$$typeof;switch(m){case s:case c:case p:case d:case a:return m;default:return f}}case r:return f}}}var w=u,b=l,C=s,A=a,E=e,I=c,S=n,x=p,O=d,T=r,N=i,k=o,R=h,D=!1;function P(t){return _(t)===l}Lu.AsyncMode=w,Lu.ConcurrentMode=b,Lu.ContextConsumer=C,Lu.ContextProvider=A,Lu.Element=E,Lu.ForwardRef=I,Lu.Fragment=S,Lu.Lazy=x,Lu.Memo=O,Lu.Portal=T,Lu.Profiler=N,Lu.StrictMode=k,Lu.Suspense=R,Lu.isAsyncMode=function(t){return D||(D=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),P(t)||_(t)===u},Lu.isConcurrentMode=P,Lu.isContextConsumer=function(t){return _(t)===s},Lu.isContextProvider=function(t){return _(t)===a},Lu.isElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===e},Lu.isForwardRef=function(t){return _(t)===c},Lu.isFragment=function(t){return _(t)===n},Lu.isLazy=function(t){return _(t)===p},Lu.isMemo=function(t){return _(t)===d},Lu.isPortal=function(t){return _(t)===r},Lu.isProfiler=function(t){return _(t)===i},Lu.isStrictMode=function(t){return _(t)===o},Lu.isSuspense=function(t){return _(t)===h},Lu.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===n||t===l||t===i||t===o||t===h||t===f||"object"==typeof t&&null!==t&&(t.$$typeof===p||t.$$typeof===d||t.$$typeof===a||t.$$typeof===s||t.$$typeof===c||t.$$typeof===m||t.$$typeof===v||t.$$typeof===y||t.$$typeof===g)},Lu.typeOf=_}()),Lu)),bu.exports}
|
|
582
577
|
/*
|
|
583
578
|
object-assign
|
|
584
579
|
(c) Sindre Sorhus
|
|
585
580
|
@license MIT
|
|
586
|
-
*/function Wu(){if(ku)return Nu;ku=1;var t=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;return Nu=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(t){n[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(o){return!1}}()?Object.assign:function(n,o){for(var i,a,s=function(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}(n),u=1;u<arguments.length;u++){for(var l in i=Object(arguments[u]))e.call(i,l)&&(s[l]=i[l]);if(t){a=t(i);for(var c=0;c<a.length;c++)r.call(i,a[c])&&(s[a[c]]=i[a[c]])}}return s},Nu}function Gu(){if(Du)return Ru;Du=1;return Ru="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function Xu(){return Mu?Pu:(Mu=1,Pu=Function.call.bind(Object.prototype.hasOwnProperty))}if("production"!==process.env.NODE_ENV){var $u=zu();Iu.exports=function(){if(ju)return Fu;ju=1;var t=zu(),e=Wu(),r=Gu(),n=Xu(),o=function(){if(Lu)return Bu;Lu=1;var t=function(){};if("production"!==process.env.NODE_ENV){var e=Gu(),r={},n=Xu();t=function(t){var e="Warning: "+t;"undefined"!=typeof console&&console.error(e);try{throw new Error(e)}catch(r){}}}function o(o,i,a,s,u){if("production"!==process.env.NODE_ENV)for(var l in o)if(n(o,l)){var c;try{if("function"!=typeof o[l]){var h=Error((s||"React class")+": "+a+" type `"+l+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[l]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw h.name="Invariant Violation",h}c=o[l](i,l,s,a,null,e)}catch(d){c=d}if(!c||c instanceof Error||t((s||"React class")+": type specification of "+a+" `"+l+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof c+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),c instanceof Error&&!(c.message in r)){r[c.message]=!0;var f=u?u():"";t("Failed "+a+" type: "+c.message+(null!=f?f:""))}}}return o.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(r={})},Bu=o}(),i=function(){};function a(){return null}return"production"!==process.env.NODE_ENV&&(i=function(t){var e="Warning: "+t;"undefined"!=typeof console&&console.error(e);try{throw new Error(e)}catch(r){}}),Fu=function(s,u){var l="function"==typeof Symbol&&Symbol.iterator,c="<<anonymous>>",h={array:g("array"),bigint:g("bigint"),bool:g("boolean"),func:g("function"),number:g("number"),object:g("object"),string:g("string"),symbol:g("symbol"),any:p(a),arrayOf:function(t){return p(function(e,n,o,i,a){if("function"!=typeof t)return new d("Property `"+a+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var s=e[n];if(!Array.isArray(s))return new d("Invalid "+i+" `"+a+"` of type `"+y(s)+"` supplied to `"+o+"`, expected an array.");for(var u=0;u<s.length;u++){var l=t(s,u,o,i,a+"["+u+"]",r);if(l instanceof Error)return l}return null})},element:p(function(t,e,r,n,o){var i=t[e];return s(i)?null:new d("Invalid "+n+" `"+o+"` of type `"+y(i)+"` supplied to `"+r+"`, expected a single ReactElement.")}),elementType:p(function(e,r,n,o,i){var a=e[r];return t.isValidElementType(a)?null:new d("Invalid "+o+" `"+i+"` of type `"+y(a)+"` supplied to `"+n+"`, expected a single ReactElement type.")}),instanceOf:function(t){return p(function(e,r,n,o,i){if(!(e[r]instanceof t)){var a=t.name||c;return new d("Invalid "+o+" `"+i+"` of type `"+((s=e[r]).constructor&&s.constructor.name?s.constructor.name:c)+"` supplied to `"+n+"`, expected instance of `"+a+"`.")}var s;return null})},node:p(function(t,e,r,n,o){return v(t[e])?null:new d("Invalid "+n+" `"+o+"` supplied to `"+r+"`, expected a ReactNode.")}),objectOf:function(t){return p(function(e,o,i,a,s){if("function"!=typeof t)return new d("Property `"+s+"` of component `"+i+"` has invalid PropType notation inside objectOf.");var u=e[o],l=y(u);if("object"!==l)return new d("Invalid "+a+" `"+s+"` of type `"+l+"` supplied to `"+i+"`, expected an object.");for(var c in u)if(n(u,c)){var h=t(u,c,i,a,s+"."+c,r);if(h instanceof Error)return h}return null})},oneOf:function(t){return Array.isArray(t)?p(function(e,r,n,o,i){for(var a=e[r],s=0;s<t.length;s++)if(f(a,t[s]))return null;var u=JSON.stringify(t,function(t,e){return"symbol"===_(e)?String(e):e});return new d("Invalid "+o+" `"+i+"` of value `"+String(a)+"` supplied to `"+n+"`, expected one of "+u+".")}):("production"!==process.env.NODE_ENV&&i(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),a)},oneOfType:function(t){if(!Array.isArray(t))return"production"!==process.env.NODE_ENV&&i("Invalid argument supplied to oneOfType, expected an instance of array."),a;for(var e=0;e<t.length;e++){var o=t[e];if("function"!=typeof o)return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+w(o)+" at index "+e+"."),a}return p(function(e,o,i,a,s){for(var u=[],l=0;l<t.length;l++){var c=(0,t[l])(e,o,i,a,s,r);if(null==c)return null;c.data&&n(c.data,"expectedType")&&u.push(c.data.expectedType)}return new d("Invalid "+a+" `"+s+"` supplied to `"+i+"`"+(u.length>0?", expected one of type ["+u.join(", ")+"]":"")+".")})},shape:function(t){return p(function(e,n,o,i,a){var s=e[n],u=y(s);if("object"!==u)return new d("Invalid "+i+" `"+a+"` of type `"+u+"` supplied to `"+o+"`, expected `object`.");for(var l in t){var c=t[l];if("function"!=typeof c)return m(o,i,a,l,_(c));var h=c(s,l,o,i,a+"."+l,r);if(h)return h}return null})},exact:function(t){return p(function(o,i,a,s,u){var l=o[i],c=y(l);if("object"!==c)return new d("Invalid "+s+" `"+u+"` of type `"+c+"` supplied to `"+a+"`, expected `object`.");var h=e({},o[i],t);for(var f in h){var p=t[f];if(n(t,f)&&"function"!=typeof p)return m(a,s,u,f,_(p));if(!p)return new d("Invalid "+s+" `"+u+"` key `"+f+"` supplied to `"+a+"`.\nBad object: "+JSON.stringify(o[i],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(t),null," "));var g=p(l,f,a,s,u+"."+f,r);if(g)return g}return null})}};function f(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}function d(t,e){this.message=t,this.data=e&&"object"==typeof e?e:{},this.stack=""}function p(t){if("production"!==process.env.NODE_ENV)var e={},n=0;function o(o,a,s,l,h,f,p){if(l=l||c,f=f||s,p!==r){if(u){var g=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw g.name="Invariant Violation",g}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var m=l+":"+s;!e[m]&&n<3&&(i("You are manually calling a React.PropTypes validation function for the `"+f+"` prop on `"+l+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),e[m]=!0,n++)}}return null==a[s]?o?null===a[s]?new d("The "+h+" `"+f+"` is marked as required in `"+l+"`, but its value is `null`."):new d("The "+h+" `"+f+"` is marked as required in `"+l+"`, but its value is `undefined`."):null:t(a,s,l,h,f)}var a=o.bind(null,!1);return a.isRequired=o.bind(null,!0),a}function g(t){return p(function(e,r,n,o,i,a){var s=e[r];return y(s)!==t?new d("Invalid "+o+" `"+i+"` of type `"+_(s)+"` supplied to `"+n+"`, expected `"+t+"`.",{expectedType:t}):null})}function m(t,e,r,n,o){return new d((t||"React class")+": "+e+" type `"+r+"."+n+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function v(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(v);if(null===t||s(t))return!0;var e=function(t){var e=t&&(l&&t[l]||t["@@iterator"]);if("function"==typeof e)return e}(t);if(!e)return!1;var r,n=e.call(t);if(e!==t.entries){for(;!(r=n.next()).done;)if(!v(r.value))return!1}else for(;!(r=n.next()).done;){var o=r.value;if(o&&!v(o[1]))return!1}return!0;default:return!1}}function y(t){var e=typeof t;return Array.isArray(t)?"array":t instanceof RegExp?"object":function(t,e){return"symbol"===t||!!e&&("Symbol"===e["@@toStringTag"]||"function"==typeof Symbol&&e instanceof Symbol)}(e,t)?"symbol":e}function _(t){if(null==t)return""+t;var e=y(t);if("object"===e){if(t instanceof Date)return"date";if(t instanceof RegExp)return"regexp"}return e}function w(t){var e=_(t);switch(e){case"array":case"object":return"an "+e;case"boolean":case"date":case"regexp":return"a "+e;default:return e}}return d.prototype=Error.prototype,h.checkPropTypes=o,h.resetWarningCache=o.resetWarningCache,h.PropTypes=h,h},Fu}()($u.isElement,!0)}else Iu.exports=function(){if(Uu)return Vu;Uu=1;var t=Gu();function e(){}function r(){}return r.resetWarningCache=e,Vu=function(){function n(e,r,n,o,i,a){if(a!==t){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function o(){return n}n.isRequired=n;var i={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:o,element:n,elementType:n,instanceOf:o,node:n,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:r,resetWarningCache:e};return i.PropTypes=i,i}}()();const Yu=d(Iu.exports),qu={mask:Yu.oneOfType([Yu.array,Yu.func,Yu.string,Yu.instanceOf(RegExp),Yu.oneOf([Date,Number,Js.Masked]),Yu.instanceOf(Js.Masked)]),value:Yu.any,unmask:Yu.oneOfType([Yu.bool,Yu.oneOf(["typed"])]),prepare:Yu.func,prepareChar:Yu.func,validate:Yu.func,commit:Yu.func,overwrite:Yu.oneOfType([Yu.bool,Yu.oneOf(["shift"])]),eager:Yu.oneOfType([Yu.bool,Yu.oneOf(["append","remove"])]),skipInvalid:Yu.bool,onAccept:Yu.func,onComplete:Yu.func,placeholderChar:Yu.string,displayChar:Yu.string,lazy:Yu.bool,definitions:Yu.object,blocks:Yu.object,enum:Yu.arrayOf(Yu.string),maxLength:Yu.number,from:Yu.number,to:Yu.number,pattern:Yu.string,format:Yu.func,parse:Yu.func,autofix:Yu.oneOfType([Yu.bool,Yu.oneOf(["pad"])]),radix:Yu.string,thousandsSeparator:Yu.string,mapToRadix:Yu.arrayOf(Yu.string),scale:Yu.number,normalizeZeros:Yu.bool,padFractionalZeros:Yu.bool,min:Yu.oneOfType([Yu.number,Yu.instanceOf(Date)]),max:Yu.oneOfType([Yu.number,Yu.instanceOf(Date)]),dispatch:Yu.func,inputRef:Yu.oneOfType([Yu.func,Yu.shape({current:Yu.object})])},Ku=Object.keys(qu).filter(t=>"value"!==t),Zu=["value","unmask","onAccept","onComplete","inputRef"],Qu=Ku.filter(t=>Zu.indexOf(t)<0);const Ju=function(t){var r;const n=((r=class extends e.Component{constructor(t){super(t),this._inputRef=this._inputRef.bind(this)}componentDidMount(){this.props.mask&&this.initMask()}componentDidUpdate(){const t=this.props,e=this._extractMaskOptionsFromProps(t);var r;e.mask?this.maskRef?(this.maskRef.updateOptions(e),"value"in t&&void 0!==t.value&&(this.maskValue=t.value)):this.initMask(e):(this.destroyMask(),"value"in t&&void 0!==t.value&&(null!=(r=this.element)&&r.isContentEditable&&"INPUT"!==this.element.tagName&&"TEXTAREA"!==this.element.tagName?this.element.textContent=t.value:this.element.value=t.value))}componentWillUnmount(){this.destroyMask()}_inputRef(t){this.element=t,this.props.inputRef&&(Object.prototype.hasOwnProperty.call(this.props.inputRef,"current")?this.props.inputRef.current=t:this.props.inputRef(t))}initMask(t){void 0===t&&(t=this._extractMaskOptionsFromProps(this.props)),this.maskRef=Js(this.element,t).on("accept",this._onAccept.bind(this)).on("complete",this._onComplete.bind(this)),"value"in this.props&&void 0!==this.props.value&&(this.maskValue=this.props.value)}destroyMask(){this.maskRef&&(this.maskRef.destroy(),delete this.maskRef)}_extractMaskOptionsFromProps(t){const{...e}=t;return Object.keys(e).filter(t=>Qu.indexOf(t)<0).forEach(t=>{delete e[t]}),e}_extractNonMaskProps(t){const{...e}=t;return Ku.forEach(t=>{"maxLength"!==t&&delete e[t]}),"defaultValue"in e||(e.defaultValue=t.mask?"":e.value),delete e.value,e}get maskValue(){return this.maskRef?"typed"===this.props.unmask?this.maskRef.typedValue:this.props.unmask?this.maskRef.unmaskedValue:this.maskRef.value:""}set maskValue(t){this.maskRef&&(t=null==t&&"typed"!==this.props.unmask?"":t,"typed"===this.props.unmask?this.maskRef.typedValue=t:this.props.unmask?this.maskRef.unmaskedValue=t:this.maskRef.value=t)}_onAccept(t){this.props.onAccept&&this.maskRef&&this.props.onAccept(this.maskValue,this.maskRef,t)}_onComplete(t){this.props.onComplete&&this.maskRef&&this.props.onComplete(this.maskValue,this.maskRef,t)}render(){return e.createElement(t,{...this._extractNonMaskProps(this.props),inputRef:this._inputRef})}}).displayName=void 0,r.propTypes=void 0,r),o=t.displayName||t.name||"Component";return n.displayName="IMask("+o+")",n.propTypes=qu,e.forwardRef((t,r)=>e.createElement(n,{...t,ref:r}))}(t=>{let{inputRef:r,...n}=t;return e.createElement("input",{...n,ref:r})}),tl=e.forwardRef((t,r)=>e.createElement(Ju,{...t,ref:r})),el=[{mask:"000.000.000-00"},Fs];function rl({value:t,name:e,onChange:r,className:n,...o}){return Qt.jsx(tl,{className:`form-control ${Vs(t)?"is-invalid":""} ${n||""}`,mask:Fs.mask,definitions:Fs.definitions,onAccept:function(t){r({target:{name:e,value:t.toUpperCase()}})},value:t,name:e,...o})}function nl(t,e,r){if(r){r({target:{name:e,value:(n=t.floatValue,!n||null==n||isNaN(n)?0:Number(n))}})}var n}const ol=({name:t,onChange:e,onClick:r,allowNegative:n=!1,...o})=>Qt.jsx(l,{name:t,thousandSeparator:".",decimalSeparator:",",decimalScale:2,fixedDecimalScale:!0,prefix:"R$ ",className:"form-control",allowNegative:n,onValueChange:r=>nl(r,t,e),onClick:function(t){r?r(t):t.target.select()},...o}),il=({name:t,onChange:e,onClick:r,allowNegative:n=!0,decimalScale:o=2,...i})=>Qt.jsx(l,{name:t,thousandSeparator:".",decimalSeparator:",",fixedDecimalScale:!0,prefix:"",className:"form-control",decimalScale:o,allowNegative:n,onValueChange:r=>nl(r,t,e),onClick:function(t){r?r(t):t.target.select()},...i}),al=({name:t,onChange:e,allowNegative:r=!0,decimalScale:n=2,...o})=>Qt.jsx(l,{thousandSeparator:".",decimalSeparator:",",fixedDecimalScale:!0,prefix:"",suffix:"%",className:"form-control",decimalScale:n,allowNegative:r,onValueChange:r=>nl(r,t,e),name:t,...o}),sl=({name:t,onChange:e,...r})=>Qt.jsx(l,{thousandSeparator:".",decimalSeparator:",",fixedDecimalScale:!0,prefix:"",className:"form-control",decimalScale:0,allowNegative:!1,onValueChange:r=>nl(r,t,e),...r}),ul=t=>Qt.jsx(l,{name:t.name,format:"##:##",mask:"_",value:t.value,onChange:t.onChange,className:"form-control",...t}),ll=t=>Qt.jsx(i.Input,{tag:l,name:t.name,format:"###.###.###-##",mask:"_",value:t.value,onChange:t.onChange,invalid:js(t.value),...t}),cl=t=>Qt.jsxs("select",{className:"form-select",name:t.name,value:t.value,onChange:t.onChange,...t,children:[Qt.jsx("option",{value:"",children:"- Selecione o estado -"}),Qt.jsx("option",{value:"EX",children:"Estrangeiro"}),Qt.jsx("option",{value:"AC",children:"Acre"}),Qt.jsx("option",{value:"AL",children:"Alagoas"}),Qt.jsx("option",{value:"AP",children:"Amapá"}),Qt.jsx("option",{value:"AM",children:"Amazonas"}),Qt.jsx("option",{value:"BA",children:"Bahia"}),Qt.jsx("option",{value:"CE",children:"Ceará"}),Qt.jsx("option",{value:"DF",children:"Distrito Federal"}),Qt.jsx("option",{value:"ES",children:"Espírito Santo"}),Qt.jsx("option",{value:"GO",children:"Goiás"}),Qt.jsx("option",{value:"MA",children:"Maranhão"}),Qt.jsx("option",{value:"MT",children:"Mato Grosso"}),Qt.jsx("option",{value:"MS",children:"Mato Grosso do Sul"}),Qt.jsx("option",{value:"MG",children:"Minas Gerais"}),Qt.jsx("option",{value:"PA",children:"Pará"}),Qt.jsx("option",{value:"PB",children:"Paraíba"}),Qt.jsx("option",{value:"PR",children:"Paraná"}),Qt.jsx("option",{value:"PE",children:"Pernambuco"}),Qt.jsx("option",{value:"PI",children:"Piauí"}),Qt.jsx("option",{value:"RJ",children:"Rio de Janeiro"}),Qt.jsx("option",{value:"RN",children:"Rio Grande do Norte"}),Qt.jsx("option",{value:"RS",children:"Rio Grande do Sul"}),Qt.jsx("option",{value:"RO",children:"Rondônia"}),Qt.jsx("option",{value:"RR",children:"Roraima"}),Qt.jsx("option",{value:"SC",children:"Santa Catarina"}),Qt.jsx("option",{value:"SP",children:"São Paulo"}),Qt.jsx("option",{value:"SE",children:"Sergipe"}),Qt.jsx("option",{value:"TO",children:"Tocantins"})]});function hl({innerRef:t,loading:e,page:r,pages:n,...o}){return Qt.jsx("div",{className:"footer-load-more--container",ref:t,hidden:r>=n,...o,children:e&&Qt.jsxs(Qt.Fragment,{children:[Qt.jsx("div",{className:"spinner-border spinner-border-sm",role:"status",children:Qt.jsx("span",{className:"visually-hidden",children:"Loading..."})}),"Carregando..."]})})}const fl={q:"",page:1};function dl({isOpen:t,setOpen:n,title:o="Pesquisar",placeHolder:i="Digite o que deseja pesquisar",maxWidth:a=800,searchInit:s,route:u,keyField:l,fields:c,renderLine:h,onClick:f,helpLink:d}){var p,g;const m=e.useRef(null),[v]=e.useState(`box-inp-${r.random(1e4)}`),[y,_]=e.useState([]),[w,b]=e.useState(""),[C,A]=e.useState({...fl,q:s||""}),[E,I]=e.useState(!1),[S,x]=or({url:u,params:{...C,limit:r.isDesktop()?28:10},onTerminated:t=>{t.error?b(t.error):t.data instanceof Array?(I(!1),_(t.data)):(I(!0),_(e=>[...e,...t.data.data]))}});function O(){if(!C.q)return b("Informe o que deseja pesquisar!");_([]),C.page>1?A({...C,page:1}):S(),T()}function T(){var t;r.isDesktop()&&(null==(t=document.querySelector(`#${v}`))||t.focus())}return e.useEffect(()=>{C.q.length>0&&S()},[C.page]),e.useEffect(()=>{const t=m.current;if(!t)return;const e=new IntersectionObserver(t=>{t.forEach(t=>{t.isIntersecting&&function(){var t;let e=C.page+1;if(e>(null==(t=x.data)?void 0:t.pages)||x.loading||0==y.length)return;x.data||(e=1);A({...C,page:e})}()})});return e.observe(t),()=>e.unobserve(t)},[y]),t?Qt.jsxs(Qt.Fragment,{children:[Qt.jsx(Bs,{visible:x.loading}),Qt.jsxs(cr,{title:o,maxWidth:a,visible:!0,setVisible:n,children:[Qt.jsx(dr,{helpLink:d,setVisible:n,children:o}),Qt.jsx(fr,{children:Qt.jsxs(hr,{children:[Qt.jsx("div",{className:"my-2",children:Qt.jsx(sr,{search:C.q,setSearch:t=>A({...C,q:t}),fnSearch:O,placeHolder:i,onKeyDown:function(t){13===t.keyCode&&(t.preventDefault(),O())},autoFocus:r.isDesktop(),id:v})}),Qt.jsxs("div",{className:"box-search--data-container",children:[0===(null==(p=x.data)?void 0:p.length)&&Qt.jsx("div",{className:"alert alert-info text-center bold",children:"Nenhum registro encontrado!"}),y&&Qt.jsx("table",{children:Qt.jsx("tbody",{children:null==y?void 0:y.map((t,e)=>Qt.jsx("tr",{onClick:()=>f(t[l],t),children:h?h(t):c.map((e,r)=>{let n;return n=0==r?{width:60,textAlign:"center",fontWeight:"bold"}:{width:"auto",textAlign:"left",fontWeight:"normal"},Qt.jsx("td",{style:n,children:t[e]},r)})},e))})}),E&&Qt.jsx(hl,{innerRef:m,loading:x.loading,page:C.page,pages:null==(g=x.data)?void 0:g.pages})]})]})})]}),w&&Qt.jsx(se,{onConfirm:()=>{b(),T()},children:w})]}):null}function pl({children:t,findTitle:r,findPlaceHolder:n,findRoute:o,findKeyField:i,findFields:a,findRenderLine:s,findOnSelect:u,...l}){const[c,h]=e.useState(!1);return Qt.jsxs(Qt.Fragment,{children:[Qt.jsxs("div",{className:"input-group",children:[Qt.jsxs("select",{className:"form-select",...l,children:[Qt.jsxs("option",{value:0,children:["- ",r," -"]}),t]}),Qt.jsx("button",{type:"button",title:"Pesquisar...",className:"btn btn-info",onClick:()=>h(!0),children:Qt.jsx(_e,{})})]}),c&&Qt.jsx(dl,{title:r,placeHolder:n,fields:a,keyField:i,route:o,isOpen:!0,setOpen:h,renderLine:s,onClick:(t,e)=>{u(t,e),h(!1)}})]})}const gl=o.div`
|
|
581
|
+
*/function ju(){if(Su)return Iu;Su=1;var t=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;return Iu=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(t){n[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(o){return!1}}()?Object.assign:function(n,o){for(var i,a,s=function(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}(n),u=1;u<arguments.length;u++){for(var l in i=Object(arguments[u]))e.call(i,l)&&(s[l]=i[l]);if(t){a=t(i);for(var c=0;c<a.length;c++)r.call(i,a[c])&&(s[a[c]]=i[a[c]])}}return s},Iu}function Vu(){if(Ou)return xu;Ou=1;return xu="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function Uu(){return Nu?Tu:(Nu=1,Tu=Function.call.bind(Object.prototype.hasOwnProperty))}if("production"!==process.env.NODE_ENV){var Hu=Fu();wu.exports=function(){if(Pu)return Du;Pu=1;var t=Fu(),e=ju(),r=Vu(),n=Uu(),o=function(){if(Ru)return ku;Ru=1;var t=function(){};if("production"!==process.env.NODE_ENV){var e=Vu(),r={},n=Uu();t=function(t){var e="Warning: "+t;"undefined"!=typeof console&&console.error(e);try{throw new Error(e)}catch(r){}}}function o(o,i,a,s,u){if("production"!==process.env.NODE_ENV)for(var l in o)if(n(o,l)){var c;try{if("function"!=typeof o[l]){var h=Error((s||"React class")+": "+a+" type `"+l+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[l]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw h.name="Invariant Violation",h}c=o[l](i,l,s,a,null,e)}catch(d){c=d}if(!c||c instanceof Error||t((s||"React class")+": type specification of "+a+" `"+l+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof c+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),c instanceof Error&&!(c.message in r)){r[c.message]=!0;var f=u?u():"";t("Failed "+a+" type: "+c.message+(null!=f?f:""))}}}return o.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(r={})},ku=o}(),i=function(){};function a(){return null}return"production"!==process.env.NODE_ENV&&(i=function(t){var e="Warning: "+t;"undefined"!=typeof console&&console.error(e);try{throw new Error(e)}catch(r){}}),Du=function(s,u){var l="function"==typeof Symbol&&Symbol.iterator,c="<<anonymous>>",h={array:g("array"),bigint:g("bigint"),bool:g("boolean"),func:g("function"),number:g("number"),object:g("object"),string:g("string"),symbol:g("symbol"),any:p(a),arrayOf:function(t){return p(function(e,n,o,i,a){if("function"!=typeof t)return new d("Property `"+a+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var s=e[n];if(!Array.isArray(s))return new d("Invalid "+i+" `"+a+"` of type `"+y(s)+"` supplied to `"+o+"`, expected an array.");for(var u=0;u<s.length;u++){var l=t(s,u,o,i,a+"["+u+"]",r);if(l instanceof Error)return l}return null})},element:p(function(t,e,r,n,o){var i=t[e];return s(i)?null:new d("Invalid "+n+" `"+o+"` of type `"+y(i)+"` supplied to `"+r+"`, expected a single ReactElement.")}),elementType:p(function(e,r,n,o,i){var a=e[r];return t.isValidElementType(a)?null:new d("Invalid "+o+" `"+i+"` of type `"+y(a)+"` supplied to `"+n+"`, expected a single ReactElement type.")}),instanceOf:function(t){return p(function(e,r,n,o,i){if(!(e[r]instanceof t)){var a=t.name||c;return new d("Invalid "+o+" `"+i+"` of type `"+((s=e[r]).constructor&&s.constructor.name?s.constructor.name:c)+"` supplied to `"+n+"`, expected instance of `"+a+"`.")}var s;return null})},node:p(function(t,e,r,n,o){return v(t[e])?null:new d("Invalid "+n+" `"+o+"` supplied to `"+r+"`, expected a ReactNode.")}),objectOf:function(t){return p(function(e,o,i,a,s){if("function"!=typeof t)return new d("Property `"+s+"` of component `"+i+"` has invalid PropType notation inside objectOf.");var u=e[o],l=y(u);if("object"!==l)return new d("Invalid "+a+" `"+s+"` of type `"+l+"` supplied to `"+i+"`, expected an object.");for(var c in u)if(n(u,c)){var h=t(u,c,i,a,s+"."+c,r);if(h instanceof Error)return h}return null})},oneOf:function(t){return Array.isArray(t)?p(function(e,r,n,o,i){for(var a=e[r],s=0;s<t.length;s++)if(f(a,t[s]))return null;var u=JSON.stringify(t,function(t,e){return"symbol"===_(e)?String(e):e});return new d("Invalid "+o+" `"+i+"` of value `"+String(a)+"` supplied to `"+n+"`, expected one of "+u+".")}):("production"!==process.env.NODE_ENV&&i(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),a)},oneOfType:function(t){if(!Array.isArray(t))return"production"!==process.env.NODE_ENV&&i("Invalid argument supplied to oneOfType, expected an instance of array."),a;for(var e=0;e<t.length;e++){var o=t[e];if("function"!=typeof o)return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+w(o)+" at index "+e+"."),a}return p(function(e,o,i,a,s){for(var u=[],l=0;l<t.length;l++){var c=(0,t[l])(e,o,i,a,s,r);if(null==c)return null;c.data&&n(c.data,"expectedType")&&u.push(c.data.expectedType)}return new d("Invalid "+a+" `"+s+"` supplied to `"+i+"`"+(u.length>0?", expected one of type ["+u.join(", ")+"]":"")+".")})},shape:function(t){return p(function(e,n,o,i,a){var s=e[n],u=y(s);if("object"!==u)return new d("Invalid "+i+" `"+a+"` of type `"+u+"` supplied to `"+o+"`, expected `object`.");for(var l in t){var c=t[l];if("function"!=typeof c)return m(o,i,a,l,_(c));var h=c(s,l,o,i,a+"."+l,r);if(h)return h}return null})},exact:function(t){return p(function(o,i,a,s,u){var l=o[i],c=y(l);if("object"!==c)return new d("Invalid "+s+" `"+u+"` of type `"+c+"` supplied to `"+a+"`, expected `object`.");var h=e({},o[i],t);for(var f in h){var p=t[f];if(n(t,f)&&"function"!=typeof p)return m(a,s,u,f,_(p));if(!p)return new d("Invalid "+s+" `"+u+"` key `"+f+"` supplied to `"+a+"`.\nBad object: "+JSON.stringify(o[i],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(t),null," "));var g=p(l,f,a,s,u+"."+f,r);if(g)return g}return null})}};function f(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}function d(t,e){this.message=t,this.data=e&&"object"==typeof e?e:{},this.stack=""}function p(t){if("production"!==process.env.NODE_ENV)var e={},n=0;function o(o,a,s,l,h,f,p){if(l=l||c,f=f||s,p!==r){if(u){var g=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw g.name="Invariant Violation",g}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var m=l+":"+s;!e[m]&&n<3&&(i("You are manually calling a React.PropTypes validation function for the `"+f+"` prop on `"+l+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),e[m]=!0,n++)}}return null==a[s]?o?null===a[s]?new d("The "+h+" `"+f+"` is marked as required in `"+l+"`, but its value is `null`."):new d("The "+h+" `"+f+"` is marked as required in `"+l+"`, but its value is `undefined`."):null:t(a,s,l,h,f)}var a=o.bind(null,!1);return a.isRequired=o.bind(null,!0),a}function g(t){return p(function(e,r,n,o,i,a){var s=e[r];return y(s)!==t?new d("Invalid "+o+" `"+i+"` of type `"+_(s)+"` supplied to `"+n+"`, expected `"+t+"`.",{expectedType:t}):null})}function m(t,e,r,n,o){return new d((t||"React class")+": "+e+" type `"+r+"."+n+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function v(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(v);if(null===t||s(t))return!0;var e=function(t){var e=t&&(l&&t[l]||t["@@iterator"]);if("function"==typeof e)return e}(t);if(!e)return!1;var r,n=e.call(t);if(e!==t.entries){for(;!(r=n.next()).done;)if(!v(r.value))return!1}else for(;!(r=n.next()).done;){var o=r.value;if(o&&!v(o[1]))return!1}return!0;default:return!1}}function y(t){var e=typeof t;return Array.isArray(t)?"array":t instanceof RegExp?"object":function(t,e){return"symbol"===t||!!e&&("Symbol"===e["@@toStringTag"]||"function"==typeof Symbol&&e instanceof Symbol)}(e,t)?"symbol":e}function _(t){if(null==t)return""+t;var e=y(t);if("object"===e){if(t instanceof Date)return"date";if(t instanceof RegExp)return"regexp"}return e}function w(t){var e=_(t);switch(e){case"array":case"object":return"an "+e;case"boolean":case"date":case"regexp":return"a "+e;default:return e}}return d.prototype=Error.prototype,h.checkPropTypes=o,h.resetWarningCache=o.resetWarningCache,h.PropTypes=h,h},Du}()(Hu.isElement,!0)}else wu.exports=function(){if(Bu)return Mu;Bu=1;var t=Vu();function e(){}function r(){}return r.resetWarningCache=e,Mu=function(){function n(e,r,n,o,i,a){if(a!==t){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function o(){return n}n.isRequired=n;var i={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:o,element:n,elementType:n,instanceOf:o,node:n,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:r,resetWarningCache:e};return i.PropTypes=i,i}}()();const zu=d(wu.exports),Wu={mask:zu.oneOfType([zu.array,zu.func,zu.string,zu.instanceOf(RegExp),zu.oneOf([Date,Number,Ys.Masked]),zu.instanceOf(Ys.Masked)]),value:zu.any,unmask:zu.oneOfType([zu.bool,zu.oneOf(["typed"])]),prepare:zu.func,prepareChar:zu.func,validate:zu.func,commit:zu.func,overwrite:zu.oneOfType([zu.bool,zu.oneOf(["shift"])]),eager:zu.oneOfType([zu.bool,zu.oneOf(["append","remove"])]),skipInvalid:zu.bool,onAccept:zu.func,onComplete:zu.func,placeholderChar:zu.string,displayChar:zu.string,lazy:zu.bool,definitions:zu.object,blocks:zu.object,enum:zu.arrayOf(zu.string),maxLength:zu.number,from:zu.number,to:zu.number,pattern:zu.string,format:zu.func,parse:zu.func,autofix:zu.oneOfType([zu.bool,zu.oneOf(["pad"])]),radix:zu.string,thousandsSeparator:zu.string,mapToRadix:zu.arrayOf(zu.string),scale:zu.number,normalizeZeros:zu.bool,padFractionalZeros:zu.bool,min:zu.oneOfType([zu.number,zu.instanceOf(Date)]),max:zu.oneOfType([zu.number,zu.instanceOf(Date)]),dispatch:zu.func,inputRef:zu.oneOfType([zu.func,zu.shape({current:zu.object})])},Gu=Object.keys(Wu).filter(t=>"value"!==t),Xu=["value","unmask","onAccept","onComplete","inputRef"],$u=Gu.filter(t=>Xu.indexOf(t)<0);const Yu=function(t){var r;const n=((r=class extends e.Component{constructor(t){super(t),this._inputRef=this._inputRef.bind(this)}componentDidMount(){this.props.mask&&this.initMask()}componentDidUpdate(){const t=this.props,e=this._extractMaskOptionsFromProps(t);var r;e.mask?this.maskRef?(this.maskRef.updateOptions(e),"value"in t&&void 0!==t.value&&(this.maskValue=t.value)):this.initMask(e):(this.destroyMask(),"value"in t&&void 0!==t.value&&(null!=(r=this.element)&&r.isContentEditable&&"INPUT"!==this.element.tagName&&"TEXTAREA"!==this.element.tagName?this.element.textContent=t.value:this.element.value=t.value))}componentWillUnmount(){this.destroyMask()}_inputRef(t){this.element=t,this.props.inputRef&&(Object.prototype.hasOwnProperty.call(this.props.inputRef,"current")?this.props.inputRef.current=t:this.props.inputRef(t))}initMask(t){void 0===t&&(t=this._extractMaskOptionsFromProps(this.props)),this.maskRef=Ys(this.element,t).on("accept",this._onAccept.bind(this)).on("complete",this._onComplete.bind(this)),"value"in this.props&&void 0!==this.props.value&&(this.maskValue=this.props.value)}destroyMask(){this.maskRef&&(this.maskRef.destroy(),delete this.maskRef)}_extractMaskOptionsFromProps(t){const{...e}=t;return Object.keys(e).filter(t=>$u.indexOf(t)<0).forEach(t=>{delete e[t]}),e}_extractNonMaskProps(t){const{...e}=t;return Gu.forEach(t=>{"maxLength"!==t&&delete e[t]}),"defaultValue"in e||(e.defaultValue=t.mask?"":e.value),delete e.value,e}get maskValue(){return this.maskRef?"typed"===this.props.unmask?this.maskRef.typedValue:this.props.unmask?this.maskRef.unmaskedValue:this.maskRef.value:""}set maskValue(t){this.maskRef&&(t=null==t&&"typed"!==this.props.unmask?"":t,"typed"===this.props.unmask?this.maskRef.typedValue=t:this.props.unmask?this.maskRef.unmaskedValue=t:this.maskRef.value=t)}_onAccept(t){this.props.onAccept&&this.maskRef&&this.props.onAccept(this.maskValue,this.maskRef,t)}_onComplete(t){this.props.onComplete&&this.maskRef&&this.props.onComplete(this.maskValue,this.maskRef,t)}render(){return e.createElement(t,{...this._extractNonMaskProps(this.props),inputRef:this._inputRef})}}).displayName=void 0,r.propTypes=void 0,r),o=t.displayName||t.name||"Component";return n.displayName="IMask("+o+")",n.propTypes=Wu,e.forwardRef((t,r)=>e.createElement(n,{...t,ref:r}))}(t=>{let{inputRef:r,...n}=t;return e.createElement("input",{...n,ref:r})}),qu=e.forwardRef((t,r)=>e.createElement(Yu,{...t,ref:r})),Ku=[{mask:"000.000.000-00"},Ds];function Zu({value:t,name:e,onChange:r,className:n,...o}){return Qt.jsx(qu,{className:`form-control ${Ms(t)?"is-invalid":""} ${n||""}`,mask:Ds.mask,definitions:Ds.definitions,onAccept:function(t){r({target:{name:e,value:t.toUpperCase()}})},value:t,name:e,...o})}function Qu(t,e,r){if(r){r({target:{name:e,value:(n=t.floatValue,!n||null==n||isNaN(n)?0:Number(n))}})}var n}const Ju=({name:t,onChange:e,onClick:r,allowNegative:n=!1,...o})=>Qt.jsx(l,{name:t,thousandSeparator:".",decimalSeparator:",",decimalScale:2,fixedDecimalScale:!0,prefix:"R$ ",className:"form-control",allowNegative:n,onValueChange:r=>Qu(r,t,e),onClick:function(t){r?r(t):t.target.select()},...o}),tl=({name:t,onChange:e,onClick:r,allowNegative:n=!0,decimalScale:o=2,...i})=>Qt.jsx(l,{name:t,thousandSeparator:".",decimalSeparator:",",fixedDecimalScale:!0,prefix:"",className:"form-control",decimalScale:o,allowNegative:n,onValueChange:r=>Qu(r,t,e),onClick:function(t){r?r(t):t.target.select()},...i}),el=({name:t,onChange:e,allowNegative:r=!0,decimalScale:n=2,...o})=>Qt.jsx(l,{thousandSeparator:".",decimalSeparator:",",fixedDecimalScale:!0,prefix:"",suffix:"%",className:"form-control",decimalScale:n,allowNegative:r,onValueChange:r=>Qu(r,t,e),name:t,...o}),rl=({name:t,onChange:e,...r})=>Qt.jsx(l,{thousandSeparator:".",decimalSeparator:",",fixedDecimalScale:!0,prefix:"",className:"form-control",decimalScale:0,allowNegative:!1,onValueChange:r=>Qu(r,t,e),...r}),nl=t=>Qt.jsx(l,{name:t.name,format:"##:##",mask:"_",value:t.value,onChange:t.onChange,className:"form-control",...t}),ol=t=>Qt.jsx(i.Input,{tag:l,name:t.name,format:"###.###.###-##",mask:"_",value:t.value,onChange:t.onChange,invalid:Ps(t.value),...t}),il=t=>Qt.jsxs("select",{className:"form-select",name:t.name,value:t.value,onChange:t.onChange,...t,children:[Qt.jsx("option",{value:"",children:"- Selecione o estado -"}),Qt.jsx("option",{value:"EX",children:"Estrangeiro"}),Qt.jsx("option",{value:"AC",children:"Acre"}),Qt.jsx("option",{value:"AL",children:"Alagoas"}),Qt.jsx("option",{value:"AP",children:"Amapá"}),Qt.jsx("option",{value:"AM",children:"Amazonas"}),Qt.jsx("option",{value:"BA",children:"Bahia"}),Qt.jsx("option",{value:"CE",children:"Ceará"}),Qt.jsx("option",{value:"DF",children:"Distrito Federal"}),Qt.jsx("option",{value:"ES",children:"Espírito Santo"}),Qt.jsx("option",{value:"GO",children:"Goiás"}),Qt.jsx("option",{value:"MA",children:"Maranhão"}),Qt.jsx("option",{value:"MT",children:"Mato Grosso"}),Qt.jsx("option",{value:"MS",children:"Mato Grosso do Sul"}),Qt.jsx("option",{value:"MG",children:"Minas Gerais"}),Qt.jsx("option",{value:"PA",children:"Pará"}),Qt.jsx("option",{value:"PB",children:"Paraíba"}),Qt.jsx("option",{value:"PR",children:"Paraná"}),Qt.jsx("option",{value:"PE",children:"Pernambuco"}),Qt.jsx("option",{value:"PI",children:"Piauí"}),Qt.jsx("option",{value:"RJ",children:"Rio de Janeiro"}),Qt.jsx("option",{value:"RN",children:"Rio Grande do Norte"}),Qt.jsx("option",{value:"RS",children:"Rio Grande do Sul"}),Qt.jsx("option",{value:"RO",children:"Rondônia"}),Qt.jsx("option",{value:"RR",children:"Roraima"}),Qt.jsx("option",{value:"SC",children:"Santa Catarina"}),Qt.jsx("option",{value:"SP",children:"São Paulo"}),Qt.jsx("option",{value:"SE",children:"Sergipe"}),Qt.jsx("option",{value:"TO",children:"Tocantins"})]});function al({innerRef:t,loading:e,page:r,pages:n,...o}){return Qt.jsx("div",{className:"footer-load-more--container",ref:t,hidden:r>=n,...o,children:e&&Qt.jsxs(Qt.Fragment,{children:[Qt.jsx("div",{className:"spinner-border spinner-border-sm",role:"status",children:Qt.jsx("span",{className:"visually-hidden",children:"Loading..."})}),"Carregando..."]})})}const sl={q:"",page:1};function ul({isOpen:t,setOpen:n,title:o="Pesquisar",placeHolder:i="Digite o que deseja pesquisar",maxWidth:a=800,searchInit:s,route:u,keyField:l,fields:c,renderLine:h,onClick:f,helpLink:d}){var p,g;const m=e.useRef(null),[v]=e.useState(`box-inp-${r.random(1e4)}`),[y,_]=e.useState([]),[w,b]=e.useState(""),[C,A]=e.useState({...sl,q:s||""}),[E,I]=e.useState(!1),[S,x]=Je({url:u,params:{...C,limit:r.isDesktop()?28:10},onTerminated:t=>{t.error?b(t.error):t.data instanceof Array?(I(!1),_(t.data)):(I(!0),_(e=>[...e,...t.data.data]))}});function O(){if(!C.q)return b("Informe o que deseja pesquisar!");_([]),C.page>1?A({...C,page:1}):S(),T()}function T(){var t;r.isDesktop()&&(null==(t=document.querySelector(`#${v}`))||t.focus())}return e.useEffect(()=>{C.q.length>0&&S()},[C.page]),e.useEffect(()=>{const t=m.current;if(!t)return;const e=new IntersectionObserver(t=>{t.forEach(t=>{t.isIntersecting&&function(){var t;let e=C.page+1;if(e>(null==(t=x.data)?void 0:t.pages)||x.loading||0==y.length)return;x.data||(e=1);A({...C,page:e})}()})});return e.observe(t),()=>e.unobserve(t)},[y]),t?Qt.jsxs(Qt.Fragment,{children:[Qt.jsx(ks,{visible:x.loading}),Qt.jsxs(ir,{title:o,maxWidth:a,visible:!0,setVisible:n,children:[Qt.jsx(ur,{helpLink:d,setVisible:n,children:o}),Qt.jsx(sr,{children:Qt.jsxs(ar,{children:[Qt.jsx("div",{className:"my-2",children:Qt.jsx(rr,{search:C.q,setSearch:t=>A({...C,q:t}),fnSearch:O,placeHolder:i,onKeyDown:function(t){13===t.keyCode&&(t.preventDefault(),O())},autoFocus:r.isDesktop(),id:v})}),Qt.jsxs("div",{className:"box-search--data-container",children:[0===(null==(p=x.data)?void 0:p.length)&&Qt.jsx("div",{className:"alert alert-info text-center bold",children:"Nenhum registro encontrado!"}),y&&Qt.jsx("table",{children:Qt.jsx("tbody",{children:null==y?void 0:y.map((t,e)=>Qt.jsx("tr",{onClick:()=>f(t[l],t),children:h?h(t):c.map((e,r)=>{let n;return n=0==r?{width:60,textAlign:"center",fontWeight:"bold"}:{width:"auto",textAlign:"left",fontWeight:"normal"},Qt.jsx("td",{style:n,children:t[e]},r)})},e))})}),E&&Qt.jsx(al,{innerRef:m,loading:x.loading,page:C.page,pages:null==(g=x.data)?void 0:g.pages})]})]})})]}),w&&Qt.jsx(se,{onConfirm:()=>{b(),T()},children:w})]}):null}function ll({children:t,findTitle:r,findPlaceHolder:n,findRoute:o,findKeyField:i,findFields:a,findRenderLine:s,findOnSelect:u,...l}){const[c,h]=e.useState(!1);return Qt.jsxs(Qt.Fragment,{children:[Qt.jsxs("div",{className:"input-group",children:[Qt.jsxs("select",{className:"form-select",...l,children:[Qt.jsxs("option",{value:0,children:["- ",r," -"]}),t]}),Qt.jsx("button",{type:"button",title:"Pesquisar...",className:"btn btn-info",onClick:()=>h(!0),children:Qt.jsx(_e,{})})]}),c&&Qt.jsx(ul,{title:r,placeHolder:n,fields:a,keyField:i,route:o,isOpen:!0,setOpen:h,renderLine:s,onClick:(t,e)=>{u(t,e),h(!1)}})]})}const cl=o.div`
|
|
587
582
|
display: inline-block;
|
|
588
|
-
`,
|
|
583
|
+
`,hl=o.span`
|
|
589
584
|
color: ${t=>t.disabled?"silver":"#333"};
|
|
590
585
|
display: flex;
|
|
591
586
|
align-items: center;
|
|
@@ -595,7 +590,7 @@
|
|
|
595
590
|
span {
|
|
596
591
|
font-size: 20px;
|
|
597
592
|
}
|
|
598
|
-
`,
|
|
593
|
+
`,fl=o.div`
|
|
599
594
|
position: relative;
|
|
600
595
|
|
|
601
596
|
input {
|
|
@@ -621,7 +616,7 @@
|
|
|
621
616
|
color: ${({disabled:t})=>t?"currentColor":"var(--bs-primary)"};
|
|
622
617
|
}
|
|
623
618
|
}
|
|
624
|
-
`;const
|
|
619
|
+
`;const dl=o.div`
|
|
625
620
|
--toggle-color-on: #4169ed;
|
|
626
621
|
--toggle-color-off: #666;
|
|
627
622
|
--toggle-color-inactive: #999;
|
|
@@ -662,7 +657,7 @@
|
|
|
662
657
|
font-weight: bold;
|
|
663
658
|
color: var(--toggle-color-${t=>t.disabled?"inactive":"text"});
|
|
664
659
|
}
|
|
665
|
-
`;const
|
|
660
|
+
`;const pl=o.main`
|
|
666
661
|
height: calc(100% - 55px);
|
|
667
662
|
overflow-y: scroll;
|
|
668
663
|
overflow-x: hidden;
|
|
@@ -706,7 +701,7 @@
|
|
|
706
701
|
max-width: ${({hasMaxWidth:t})=>t?"1840px":"auto"};
|
|
707
702
|
margin: 12px auto 20px;
|
|
708
703
|
}
|
|
709
|
-
`;const
|
|
704
|
+
`;const gl=o.div`
|
|
710
705
|
display: flex;
|
|
711
706
|
flex-direction: column;
|
|
712
707
|
gap: var(--form-desk-gap);
|
|
@@ -770,9 +765,9 @@
|
|
|
770
765
|
}
|
|
771
766
|
}
|
|
772
767
|
}
|
|
773
|
-
`;const
|
|
768
|
+
`;const ml={id:"",caption:"",title:"",isOpen:!1,isVisible:!1},vl=e.createContext(null);function yl(t){let e=!1;for(const r of t)r.isOpen=!1,r.isVisible&&!e&&(r.isOpen=!0,e=!0)}function _l(){return e.useContext(vl)}function wl({isMultine:t}){const{tabs:e,selectTab:r}=_l(),n=e.filter(t=>t.isVisible);return Qt.jsx("div",{className:"tab-header--container "+(t?"is-tab-multiline":""),children:n.map(t=>Qt.jsx("button",{type:"button",title:t.title,onClick:()=>r(t.id),hidden:!t.isVisible,className:t.isOpen&&n.length>1?"tab-active":"",tabIndex:-1,children:t.caption||t.title},t.id))})}const bl=o.div`
|
|
774
769
|
/* margin: ${({noMargin:t})=>t?"0":"5px 0 8px"}; */
|
|
775
|
-
border: 1px solid var(--
|
|
770
|
+
border: 1px solid var(--pn-color-border);
|
|
776
771
|
border-radius: ${t=>t.open?"0 0 var(--pn-border-radius) var(--pn-border-radius)":"0"};
|
|
777
772
|
background-color: var(--bs-body-bg);
|
|
778
773
|
//overflow: hidden;
|
|
@@ -782,10 +777,10 @@
|
|
|
782
777
|
outline: 0;
|
|
783
778
|
border: none;
|
|
784
779
|
border-bottom: ${({open:t})=>t?"1":"0"}px solid
|
|
785
|
-
var(--
|
|
780
|
+
var(--pn-color-border);
|
|
786
781
|
border-left: 8px solid var(--bi-color-detail);
|
|
787
782
|
background-color: var(--bi-color-button);
|
|
788
|
-
color: var(--
|
|
783
|
+
color: var(--pn-color-font);
|
|
789
784
|
font-size: 1.2rem;
|
|
790
785
|
/* font-weight: bold; */
|
|
791
786
|
padding: 6px 12px;
|
|
@@ -798,7 +793,7 @@
|
|
|
798
793
|
|
|
799
794
|
i {
|
|
800
795
|
font-size: 1.4rem;
|
|
801
|
-
color:
|
|
796
|
+
color: var(--pn-color-font);
|
|
802
797
|
transition: all ease 0.3s;
|
|
803
798
|
transform: rotate(${t=>t.open?"-180":"0"}deg);
|
|
804
799
|
}
|
|
@@ -854,7 +849,13 @@
|
|
|
854
849
|
}
|
|
855
850
|
}
|
|
856
851
|
}
|
|
857
|
-
`;
|
|
852
|
+
`;function Cl(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Al={exports:{}};
|
|
853
|
+
/*!
|
|
854
|
+
localForage -- Offline Storage, Improved
|
|
855
|
+
Version 1.10.0
|
|
856
|
+
https://localforage.github.io/localForage
|
|
857
|
+
(c) 2013-2017 Mozilla, Apache License 2.0
|
|
858
|
+
*/!function(t){t.exports=function t(e,r,n){function o(a,s){if(!r[a]){if(!e[a]){if(!s&&Cl)return Cl(a);if(i)return i(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var l=r[a]={exports:{}};e[a][0].call(l.exports,function(t){var r=e[a][1][t];return o(r||t)},l,l.exports,t,e,r,n)}return r[a].exports}for(var i=Cl,a=0;a<n.length;a++)o(n[a]);return o}({1:[function(t,e,r){(function(t){var r,n,o=t.MutationObserver||t.WebKitMutationObserver;if(o){var i=0,a=new o(c),s=t.document.createTextNode("");a.observe(s,{characterData:!0}),r=function(){s.data=i=++i%2}}else if(t.setImmediate||void 0===t.MessageChannel)r="document"in t&&"onreadystatechange"in t.document.createElement("script")?function(){var e=t.document.createElement("script");e.onreadystatechange=function(){c(),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},t.document.documentElement.appendChild(e)}:function(){setTimeout(c,0)};else{var u=new t.MessageChannel;u.port1.onmessage=c,r=function(){u.port2.postMessage(0)}}var l=[];function c(){var t,e;n=!0;for(var r=l.length;r;){for(e=l,l=[],t=-1;++t<r;)e[t]();r=l.length}n=!1}function h(t){1!==l.push(t)||n||r()}e.exports=h}).call(this,void 0!==f?f:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(t,e,r){var n=t(1);function o(){}var i={},a=["REJECTED"],s=["FULFILLED"],u=["PENDING"];function l(t){if("function"!=typeof t)throw new TypeError("resolver must be a function");this.state=u,this.queue=[],this.outcome=void 0,t!==o&&d(this,t)}function c(t,e,r){this.promise=t,"function"==typeof e&&(this.onFulfilled=e,this.callFulfilled=this.otherCallFulfilled),"function"==typeof r&&(this.onRejected=r,this.callRejected=this.otherCallRejected)}function h(t,e,r){n(function(){var n;try{n=e(r)}catch(o){return i.reject(t,o)}n===t?i.reject(t,new TypeError("Cannot resolve promise with itself")):i.resolve(t,n)})}function f(t){var e=t&&t.then;if(t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof e)return function(){e.apply(t,arguments)}}function d(t,e){var r=!1;function n(e){r||(r=!0,i.reject(t,e))}function o(e){r||(r=!0,i.resolve(t,e))}function a(){e(o,n)}var s=p(a);"error"===s.status&&n(s.value)}function p(t,e){var r={};try{r.value=t(e),r.status="success"}catch(n){r.status="error",r.value=n}return r}function g(t){return t instanceof this?t:i.resolve(new this(o),t)}function m(t){var e=new this(o);return i.reject(e,t)}function v(t){var e=this;if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var r=t.length,n=!1;if(!r)return this.resolve([]);for(var a=new Array(r),s=0,u=-1,l=new this(o);++u<r;)c(t[u],u);return l;function c(t,o){function u(t){a[o]=t,++s!==r||n||(n=!0,i.resolve(l,a))}e.resolve(t).then(u,function(t){n||(n=!0,i.reject(l,t))})}}function y(t){var e=this;if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var r=t.length,n=!1;if(!r)return this.resolve([]);for(var a=-1,s=new this(o);++a<r;)u(t[a]);return s;function u(t){e.resolve(t).then(function(t){n||(n=!0,i.resolve(s,t))},function(t){n||(n=!0,i.reject(s,t))})}}e.exports=l,l.prototype.catch=function(t){return this.then(null,t)},l.prototype.then=function(t,e){if("function"!=typeof t&&this.state===s||"function"!=typeof e&&this.state===a)return this;var r=new this.constructor(o);return this.state!==u?h(r,this.state===s?t:e,this.outcome):this.queue.push(new c(r,t,e)),r},c.prototype.callFulfilled=function(t){i.resolve(this.promise,t)},c.prototype.otherCallFulfilled=function(t){h(this.promise,this.onFulfilled,t)},c.prototype.callRejected=function(t){i.reject(this.promise,t)},c.prototype.otherCallRejected=function(t){h(this.promise,this.onRejected,t)},i.resolve=function(t,e){var r=p(f,e);if("error"===r.status)return i.reject(t,r.value);var n=r.value;if(n)d(t,n);else{t.state=s,t.outcome=e;for(var o=-1,a=t.queue.length;++o<a;)t.queue[o].callFulfilled(e)}return t},i.reject=function(t,e){t.state=a,t.outcome=e;for(var r=-1,n=t.queue.length;++r<n;)t.queue[r].callRejected(e);return t},l.resolve=g,l.reject=m,l.all=v,l.race=y},{1:1}],3:[function(t,e,r){(function(e){"function"!=typeof e.Promise&&(e.Promise=t(2))}).call(this,void 0!==f?f:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{2:2}],4:[function(t,e,r){var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(){try{if("undefined"!=typeof indexedDB)return indexedDB;if("undefined"!=typeof webkitIndexedDB)return webkitIndexedDB;if("undefined"!=typeof mozIndexedDB)return mozIndexedDB;if("undefined"!=typeof OIndexedDB)return OIndexedDB;if("undefined"!=typeof msIndexedDB)return msIndexedDB}catch(t){return}}var a=i();function s(){try{if(!a||!a.open)return!1;var t="undefined"!=typeof openDatabase&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),e="function"==typeof fetch&&-1!==fetch.toString().indexOf("[native code");return(!t||e)&&"undefined"!=typeof indexedDB&&"undefined"!=typeof IDBKeyRange}catch(r){return!1}}function u(t,e){t=t||[],e=e||{};try{return new Blob(t,e)}catch(o){if("TypeError"!==o.name)throw o;for(var r=new("undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder),n=0;n<t.length;n+=1)r.append(t[n]);return r.getBlob(e.type)}}"undefined"==typeof Promise&&t(3);var l=Promise;function c(t,e){e&&t.then(function(t){e(null,t)},function(t){e(t)})}function h(t,e,r){"function"==typeof e&&t.then(e),"function"==typeof r&&t.catch(r)}function f(t){return"string"!=typeof t&&(console.warn(t+" used as a key, but it is not a string."),t=String(t)),t}function d(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}var p="local-forage-detect-blob-support",g=void 0,m={},v=Object.prototype.toString,y="readonly",_="readwrite";function w(t){for(var e=t.length,r=new ArrayBuffer(e),n=new Uint8Array(r),o=0;o<e;o++)n[o]=t.charCodeAt(o);return r}function b(t){return new l(function(e){var r=t.transaction(p,_),n=u([""]);r.objectStore(p).put(n,"key"),r.onabort=function(t){t.preventDefault(),t.stopPropagation(),e(!1)},r.oncomplete=function(){var t=navigator.userAgent.match(/Chrome\/(\d+)/),r=navigator.userAgent.match(/Edge\//);e(r||!t||parseInt(t[1],10)>=43)}}).catch(function(){return!1})}function C(t){return"boolean"==typeof g?l.resolve(g):b(t).then(function(t){return g=t})}function A(t){var e=m[t.name],r={};r.promise=new l(function(t,e){r.resolve=t,r.reject=e}),e.deferredOperations.push(r),e.dbReady?e.dbReady=e.dbReady.then(function(){return r.promise}):e.dbReady=r.promise}function E(t){var e=m[t.name].deferredOperations.pop();if(e)return e.resolve(),e.promise}function I(t,e){var r=m[t.name].deferredOperations.pop();if(r)return r.reject(e),r.promise}function S(t,e){return new l(function(r,n){if(m[t.name]=m[t.name]||B(),t.db){if(!e)return r(t.db);A(t),t.db.close()}var o=[t.name];e&&o.push(t.version);var i=a.open.apply(a,o);e&&(i.onupgradeneeded=function(e){var r=i.result;try{r.createObjectStore(t.storeName),e.oldVersion<=1&&r.createObjectStore(p)}catch(n){if("ConstraintError"!==n.name)throw n;console.warn('The database "'+t.name+'" has been upgraded from version '+e.oldVersion+" to version "+e.newVersion+', but the storage "'+t.storeName+'" already exists.')}}),i.onerror=function(t){t.preventDefault(),n(i.error)},i.onsuccess=function(){var e=i.result;e.onversionchange=function(t){t.target.close()},r(e),E(t)}})}function x(t){return S(t,!1)}function O(t){return S(t,!0)}function T(t,e){if(!t.db)return!0;var r=!t.db.objectStoreNames.contains(t.storeName),n=t.version<t.db.version,o=t.version>t.db.version;if(n&&(t.version!==e&&console.warn('The database "'+t.name+"\" can't be downgraded from version "+t.db.version+" to version "+t.version+"."),t.version=t.db.version),o||r){if(r){var i=t.db.version+1;i>t.version&&(t.version=i)}return!0}return!1}function N(t){return new l(function(e,r){var n=new FileReader;n.onerror=r,n.onloadend=function(r){var n=btoa(r.target.result||"");e({__local_forage_encoded_blob:!0,data:n,type:t.type})},n.readAsBinaryString(t)})}function k(t){return u([w(atob(t.data))],{type:t.type})}function R(t){return t&&t.__local_forage_encoded_blob}function D(t){var e=this,r=e._initReady().then(function(){var t=m[e._dbInfo.name];if(t&&t.dbReady)return t.dbReady});return h(r,t,t),r}function P(t){A(t);for(var e=m[t.name],r=e.forages,n=0;n<r.length;n++){var o=r[n];o._dbInfo.db&&(o._dbInfo.db.close(),o._dbInfo.db=null)}return t.db=null,x(t).then(function(e){return t.db=e,T(t)?O(t):e}).then(function(n){t.db=e.db=n;for(var o=0;o<r.length;o++)r[o]._dbInfo.db=n}).catch(function(e){throw I(t,e),e})}function M(t,e,r,n){void 0===n&&(n=1);try{var o=t.db.transaction(t.storeName,e);r(null,o)}catch(i){if(n>0&&(!t.db||"InvalidStateError"===i.name||"NotFoundError"===i.name))return l.resolve().then(function(){if(!t.db||"NotFoundError"===i.name&&!t.db.objectStoreNames.contains(t.storeName)&&t.version<=t.db.version)return t.db&&(t.version=t.db.version+1),O(t)}).then(function(){return P(t).then(function(){M(t,e,r,n-1)})}).catch(r);r(i)}}function B(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function L(t){var e=this,r={db:null};if(t)for(var n in t)r[n]=t[n];var o=m[r.name];o||(o=B(),m[r.name]=o),o.forages.push(e),e._initReady||(e._initReady=e.ready,e.ready=D);var i=[];function a(){return l.resolve()}for(var s=0;s<o.forages.length;s++){var u=o.forages[s];u!==e&&i.push(u._initReady().catch(a))}var c=o.forages.slice(0);return l.all(i).then(function(){return r.db=o.db,x(r)}).then(function(t){return r.db=t,T(r,e._defaultConfig.version)?O(r):t}).then(function(t){r.db=o.db=t,e._dbInfo=r;for(var n=0;n<c.length;n++){var i=c[n];i!==e&&(i._dbInfo.db=r.db,i._dbInfo.version=r.version)}})}function F(t,e){var r=this;t=f(t);var n=new l(function(e,n){r.ready().then(function(){M(r._dbInfo,y,function(o,i){if(o)return n(o);try{var a=i.objectStore(r._dbInfo.storeName).get(t);a.onsuccess=function(){var t=a.result;void 0===t&&(t=null),R(t)&&(t=k(t)),e(t)},a.onerror=function(){n(a.error)}}catch(s){n(s)}})}).catch(n)});return c(n,e),n}function j(t,e){var r=this,n=new l(function(e,n){r.ready().then(function(){M(r._dbInfo,y,function(o,i){if(o)return n(o);try{var a=i.objectStore(r._dbInfo.storeName).openCursor(),s=1;a.onsuccess=function(){var r=a.result;if(r){var n=r.value;R(n)&&(n=k(n));var o=t(n,r.key,s++);void 0!==o?e(o):r.continue()}else e()},a.onerror=function(){n(a.error)}}catch(u){n(u)}})}).catch(n)});return c(n,e),n}function V(t,e,r){var n=this;t=f(t);var o=new l(function(r,o){var i;n.ready().then(function(){return i=n._dbInfo,"[object Blob]"===v.call(e)?C(i.db).then(function(t){return t?e:N(e)}):e}).then(function(e){M(n._dbInfo,_,function(i,a){if(i)return o(i);try{var s=a.objectStore(n._dbInfo.storeName);null===e&&(e=void 0);var u=s.put(e,t);a.oncomplete=function(){void 0===e&&(e=null),r(e)},a.onabort=a.onerror=function(){var t=u.error?u.error:u.transaction.error;o(t)}}catch(l){o(l)}})}).catch(o)});return c(o,r),o}function U(t,e){var r=this;t=f(t);var n=new l(function(e,n){r.ready().then(function(){M(r._dbInfo,_,function(o,i){if(o)return n(o);try{var a=i.objectStore(r._dbInfo.storeName).delete(t);i.oncomplete=function(){e()},i.onerror=function(){n(a.error)},i.onabort=function(){var t=a.error?a.error:a.transaction.error;n(t)}}catch(s){n(s)}})}).catch(n)});return c(n,e),n}function H(t){var e=this,r=new l(function(t,r){e.ready().then(function(){M(e._dbInfo,_,function(n,o){if(n)return r(n);try{var i=o.objectStore(e._dbInfo.storeName).clear();o.oncomplete=function(){t()},o.onabort=o.onerror=function(){var t=i.error?i.error:i.transaction.error;r(t)}}catch(a){r(a)}})}).catch(r)});return c(r,t),r}function z(t){var e=this,r=new l(function(t,r){e.ready().then(function(){M(e._dbInfo,y,function(n,o){if(n)return r(n);try{var i=o.objectStore(e._dbInfo.storeName).count();i.onsuccess=function(){t(i.result)},i.onerror=function(){r(i.error)}}catch(a){r(a)}})}).catch(r)});return c(r,t),r}function W(t,e){var r=this,n=new l(function(e,n){t<0?e(null):r.ready().then(function(){M(r._dbInfo,y,function(o,i){if(o)return n(o);try{var a=i.objectStore(r._dbInfo.storeName),s=!1,u=a.openKeyCursor();u.onsuccess=function(){var r=u.result;r?0===t||s?e(r.key):(s=!0,r.advance(t)):e(null)},u.onerror=function(){n(u.error)}}catch(l){n(l)}})}).catch(n)});return c(n,e),n}function G(t){var e=this,r=new l(function(t,r){e.ready().then(function(){M(e._dbInfo,y,function(n,o){if(n)return r(n);try{var i=o.objectStore(e._dbInfo.storeName).openKeyCursor(),a=[];i.onsuccess=function(){var e=i.result;e?(a.push(e.key),e.continue()):t(a)},i.onerror=function(){r(i.error)}}catch(s){r(s)}})}).catch(r)});return c(r,t),r}function X(t,e){e=d.apply(this,arguments);var r=this.config();(t="function"!=typeof t&&t||{}).name||(t.name=t.name||r.name,t.storeName=t.storeName||r.storeName);var n,o=this;if(t.name){var i=t.name===r.name&&o._dbInfo.db?l.resolve(o._dbInfo.db):x(t).then(function(e){var r=m[t.name],n=r.forages;r.db=e;for(var o=0;o<n.length;o++)n[o]._dbInfo.db=e;return e});n=t.storeName?i.then(function(e){if(e.objectStoreNames.contains(t.storeName)){var r=e.version+1;A(t);var n=m[t.name],o=n.forages;e.close();for(var i=0;i<o.length;i++){var s=o[i];s._dbInfo.db=null,s._dbInfo.version=r}return new l(function(e,n){var o=a.open(t.name,r);o.onerror=function(t){o.result.close(),n(t)},o.onupgradeneeded=function(){o.result.deleteObjectStore(t.storeName)},o.onsuccess=function(){var t=o.result;t.close(),e(t)}}).then(function(t){n.db=t;for(var e=0;e<o.length;e++){var r=o[e];r._dbInfo.db=t,E(r._dbInfo)}}).catch(function(e){throw(I(t,e)||l.resolve()).catch(function(){}),e})}}):i.then(function(e){A(t);var r=m[t.name],n=r.forages;e.close();for(var o=0;o<n.length;o++)n[o]._dbInfo.db=null;return new l(function(e,r){var n=a.deleteDatabase(t.name);n.onerror=function(){var t=n.result;t&&t.close(),r(n.error)},n.onblocked=function(){console.warn('dropInstance blocked for database "'+t.name+'" until all open connections are closed')},n.onsuccess=function(){var t=n.result;t&&t.close(),e(t)}}).then(function(t){r.db=t;for(var e=0;e<n.length;e++)E(n[e]._dbInfo)}).catch(function(e){throw(I(t,e)||l.resolve()).catch(function(){}),e})})}else n=l.reject("Invalid arguments");return c(n,e),n}var $={_driver:"asyncStorage",_initStorage:L,_support:s(),iterate:j,getItem:F,setItem:V,removeItem:U,clear:H,length:z,key:W,keys:G,dropInstance:X};function Y(){return"function"==typeof openDatabase}var q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",K="~~local_forage_type~",Z=/^~~local_forage_type~([^~]+)~/,Q="__lfsc__:",J=Q.length,tt="arbf",et="blob",rt="si08",nt="ui08",ot="uic8",it="si16",at="si32",st="ur16",ut="ui32",lt="fl32",ct="fl64",ht=J+tt.length,ft=Object.prototype.toString;function dt(t){var e,r,n,o,i,a=.75*t.length,s=t.length,u=0;"="===t[t.length-1]&&(a--,"="===t[t.length-2]&&a--);var l=new ArrayBuffer(a),c=new Uint8Array(l);for(e=0;e<s;e+=4)r=q.indexOf(t[e]),n=q.indexOf(t[e+1]),o=q.indexOf(t[e+2]),i=q.indexOf(t[e+3]),c[u++]=r<<2|n>>4,c[u++]=(15&n)<<4|o>>2,c[u++]=(3&o)<<6|63&i;return l}function pt(t){var e,r=new Uint8Array(t),n="";for(e=0;e<r.length;e+=3)n+=q[r[e]>>2],n+=q[(3&r[e])<<4|r[e+1]>>4],n+=q[(15&r[e+1])<<2|r[e+2]>>6],n+=q[63&r[e+2]];return r.length%3==2?n=n.substring(0,n.length-1)+"=":r.length%3==1&&(n=n.substring(0,n.length-2)+"=="),n}function gt(t,e){var r="";if(t&&(r=ft.call(t)),t&&("[object ArrayBuffer]"===r||t.buffer&&"[object ArrayBuffer]"===ft.call(t.buffer))){var n,o=Q;t instanceof ArrayBuffer?(n=t,o+=tt):(n=t.buffer,"[object Int8Array]"===r?o+=rt:"[object Uint8Array]"===r?o+=nt:"[object Uint8ClampedArray]"===r?o+=ot:"[object Int16Array]"===r?o+=it:"[object Uint16Array]"===r?o+=st:"[object Int32Array]"===r?o+=at:"[object Uint32Array]"===r?o+=ut:"[object Float32Array]"===r?o+=lt:"[object Float64Array]"===r?o+=ct:e(new Error("Failed to get type for BinaryArray"))),e(o+pt(n))}else if("[object Blob]"===r){var i=new FileReader;i.onload=function(){var r=K+t.type+"~"+pt(this.result);e(Q+et+r)},i.readAsArrayBuffer(t)}else try{e(JSON.stringify(t))}catch(a){console.error("Couldn't convert value into a JSON string: ",t),e(null,a)}}function mt(t){if(t.substring(0,J)!==Q)return JSON.parse(t);var e,r=t.substring(ht),n=t.substring(J,ht);if(n===et&&Z.test(r)){var o=r.match(Z);e=o[1],r=r.substring(o[0].length)}var i=dt(r);switch(n){case tt:return i;case et:return u([i],{type:e});case rt:return new Int8Array(i);case nt:return new Uint8Array(i);case ot:return new Uint8ClampedArray(i);case it:return new Int16Array(i);case st:return new Uint16Array(i);case at:return new Int32Array(i);case ut:return new Uint32Array(i);case lt:return new Float32Array(i);case ct:return new Float64Array(i);default:throw new Error("Unkown type: "+n)}}var vt={serialize:gt,deserialize:mt,stringToBuffer:dt,bufferToString:pt};function yt(t,e,r,n){t.executeSql("CREATE TABLE IF NOT EXISTS "+e.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],r,n)}function _t(t){var e=this,r={db:null};if(t)for(var n in t)r[n]="string"!=typeof t[n]?t[n].toString():t[n];var o=new l(function(t,n){try{r.db=openDatabase(r.name,String(r.version),r.description,r.size)}catch(o){return n(o)}r.db.transaction(function(o){yt(o,r,function(){e._dbInfo=r,t()},function(t,e){n(e)})},n)});return r.serializer=vt,o}function wt(t,e,r,n,o,i){t.executeSql(r,n,o,function(t,a){a.code===a.SYNTAX_ERR?t.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[e.storeName],function(t,s){s.rows.length?i(t,a):yt(t,e,function(){t.executeSql(r,n,o,i)},i)},i):i(t,a)},i)}function bt(t,e){var r=this;t=f(t);var n=new l(function(e,n){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(r){wt(r,o,"SELECT * FROM "+o.storeName+" WHERE key = ? LIMIT 1",[t],function(t,r){var n=r.rows.length?r.rows.item(0).value:null;n&&(n=o.serializer.deserialize(n)),e(n)},function(t,e){n(e)})})}).catch(n)});return c(n,e),n}function Ct(t,e){var r=this,n=new l(function(e,n){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(r){wt(r,o,"SELECT * FROM "+o.storeName,[],function(r,n){for(var i=n.rows,a=i.length,s=0;s<a;s++){var u=i.item(s),l=u.value;if(l&&(l=o.serializer.deserialize(l)),void 0!==(l=t(l,u.key,s+1)))return void e(l)}e()},function(t,e){n(e)})})}).catch(n)});return c(n,e),n}function At(t,e,r,n){var o=this;t=f(t);var i=new l(function(i,a){o.ready().then(function(){void 0===e&&(e=null);var s=e,u=o._dbInfo;u.serializer.serialize(e,function(e,l){l?a(l):u.db.transaction(function(r){wt(r,u,"INSERT OR REPLACE INTO "+u.storeName+" (key, value) VALUES (?, ?)",[t,e],function(){i(s)},function(t,e){a(e)})},function(e){if(e.code===e.QUOTA_ERR){if(n>0)return void i(At.apply(o,[t,s,r,n-1]));a(e)}})})}).catch(a)});return c(i,r),i}function Et(t,e,r){return At.apply(this,[t,e,r,1])}function It(t,e){var r=this;t=f(t);var n=new l(function(e,n){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(r){wt(r,o,"DELETE FROM "+o.storeName+" WHERE key = ?",[t],function(){e()},function(t,e){n(e)})})}).catch(n)});return c(n,e),n}function St(t){var e=this,r=new l(function(t,r){e.ready().then(function(){var n=e._dbInfo;n.db.transaction(function(e){wt(e,n,"DELETE FROM "+n.storeName,[],function(){t()},function(t,e){r(e)})})}).catch(r)});return c(r,t),r}function xt(t){var e=this,r=new l(function(t,r){e.ready().then(function(){var n=e._dbInfo;n.db.transaction(function(e){wt(e,n,"SELECT COUNT(key) as c FROM "+n.storeName,[],function(e,r){var n=r.rows.item(0).c;t(n)},function(t,e){r(e)})})}).catch(r)});return c(r,t),r}function Ot(t,e){var r=this,n=new l(function(e,n){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(r){wt(r,o,"SELECT key FROM "+o.storeName+" WHERE id = ? LIMIT 1",[t+1],function(t,r){var n=r.rows.length?r.rows.item(0).key:null;e(n)},function(t,e){n(e)})})}).catch(n)});return c(n,e),n}function Tt(t){var e=this,r=new l(function(t,r){e.ready().then(function(){var n=e._dbInfo;n.db.transaction(function(e){wt(e,n,"SELECT key FROM "+n.storeName,[],function(e,r){for(var n=[],o=0;o<r.rows.length;o++)n.push(r.rows.item(o).key);t(n)},function(t,e){r(e)})})}).catch(r)});return c(r,t),r}function Nt(t){return new l(function(e,r){t.transaction(function(n){n.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(r,n){for(var o=[],i=0;i<n.rows.length;i++)o.push(n.rows.item(i).name);e({db:t,storeNames:o})},function(t,e){r(e)})},function(t){r(t)})})}function kt(t,e){e=d.apply(this,arguments);var r=this.config();(t="function"!=typeof t&&t||{}).name||(t.name=t.name||r.name,t.storeName=t.storeName||r.storeName);var n,o=this;return n=t.name?new l(function(e){var n;n=t.name===r.name?o._dbInfo.db:openDatabase(t.name,"","",0),t.storeName?e({db:n,storeNames:[t.storeName]}):e(Nt(n))}).then(function(t){return new l(function(e,r){t.db.transaction(function(n){function o(t){return new l(function(e,r){n.executeSql("DROP TABLE IF EXISTS "+t,[],function(){e()},function(t,e){r(e)})})}for(var i=[],a=0,s=t.storeNames.length;a<s;a++)i.push(o(t.storeNames[a]));l.all(i).then(function(){e()}).catch(function(t){r(t)})},function(t){r(t)})})}):l.reject("Invalid arguments"),c(n,e),n}var Rt={_driver:"webSQLStorage",_initStorage:_t,_support:Y(),iterate:Ct,getItem:bt,setItem:Et,removeItem:It,clear:St,length:xt,key:Ot,keys:Tt,dropInstance:kt};function Dt(){try{return"undefined"!=typeof localStorage&&"setItem"in localStorage&&!!localStorage.setItem}catch(t){return!1}}function Pt(t,e){var r=t.name+"/";return t.storeName!==e.storeName&&(r+=t.storeName+"/"),r}function Mt(){var t="_localforage_support_test";try{return localStorage.setItem(t,!0),localStorage.removeItem(t),!1}catch(e){return!0}}function Bt(){return!Mt()||localStorage.length>0}function Lt(t){var e=this,r={};if(t)for(var n in t)r[n]=t[n];return r.keyPrefix=Pt(t,e._defaultConfig),Bt()?(e._dbInfo=r,r.serializer=vt,l.resolve()):l.reject()}function Ft(t){var e=this,r=e.ready().then(function(){for(var t=e._dbInfo.keyPrefix,r=localStorage.length-1;r>=0;r--){var n=localStorage.key(r);0===n.indexOf(t)&&localStorage.removeItem(n)}});return c(r,t),r}function jt(t,e){var r=this;t=f(t);var n=r.ready().then(function(){var e=r._dbInfo,n=localStorage.getItem(e.keyPrefix+t);return n&&(n=e.serializer.deserialize(n)),n});return c(n,e),n}function Vt(t,e){var r=this,n=r.ready().then(function(){for(var e=r._dbInfo,n=e.keyPrefix,o=n.length,i=localStorage.length,a=1,s=0;s<i;s++){var u=localStorage.key(s);if(0===u.indexOf(n)){var l=localStorage.getItem(u);if(l&&(l=e.serializer.deserialize(l)),void 0!==(l=t(l,u.substring(o),a++)))return l}}});return c(n,e),n}function Ut(t,e){var r=this,n=r.ready().then(function(){var e,n=r._dbInfo;try{e=localStorage.key(t)}catch(o){e=null}return e&&(e=e.substring(n.keyPrefix.length)),e});return c(n,e),n}function Ht(t){var e=this,r=e.ready().then(function(){for(var t=e._dbInfo,r=localStorage.length,n=[],o=0;o<r;o++){var i=localStorage.key(o);0===i.indexOf(t.keyPrefix)&&n.push(i.substring(t.keyPrefix.length))}return n});return c(r,t),r}function zt(t){var e=this.keys().then(function(t){return t.length});return c(e,t),e}function Wt(t,e){var r=this;t=f(t);var n=r.ready().then(function(){var e=r._dbInfo;localStorage.removeItem(e.keyPrefix+t)});return c(n,e),n}function Gt(t,e,r){var n=this;t=f(t);var o=n.ready().then(function(){void 0===e&&(e=null);var r=e;return new l(function(o,i){var a=n._dbInfo;a.serializer.serialize(e,function(e,n){if(n)i(n);else try{localStorage.setItem(a.keyPrefix+t,e),o(r)}catch(s){"QuotaExceededError"!==s.name&&"NS_ERROR_DOM_QUOTA_REACHED"!==s.name||i(s),i(s)}})})});return c(o,r),o}function Xt(t,e){if(e=d.apply(this,arguments),!(t="function"!=typeof t&&t||{}).name){var r=this.config();t.name=t.name||r.name,t.storeName=t.storeName||r.storeName}var n,o=this;return c(n=t.name?new l(function(e){t.storeName?e(Pt(t,o._defaultConfig)):e(t.name+"/")}).then(function(t){for(var e=localStorage.length-1;e>=0;e--){var r=localStorage.key(e);0===r.indexOf(t)&&localStorage.removeItem(r)}}):l.reject("Invalid arguments"),e),n}var $t={_driver:"localStorageWrapper",_initStorage:Lt,_support:Dt(),iterate:Vt,getItem:jt,setItem:Gt,removeItem:Wt,clear:Ft,length:zt,key:Ut,keys:Ht,dropInstance:Xt},Yt=function(t,e){return t===e||"number"==typeof t&&"number"==typeof e&&isNaN(t)&&isNaN(e)},qt=function(t,e){for(var r=t.length,n=0;n<r;){if(Yt(t[n],e))return!0;n++}return!1},Kt=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},Zt={},Qt={},Jt={INDEXEDDB:$,WEBSQL:Rt,LOCALSTORAGE:$t},te=[Jt.INDEXEDDB._driver,Jt.WEBSQL._driver,Jt.LOCALSTORAGE._driver],ee=["dropInstance"],re=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(ee),ne={description:"",driver:te.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function oe(t,e){t[e]=function(){var r=arguments;return t.ready().then(function(){return t[e].apply(t,r)})}}function ie(){for(var t=1;t<arguments.length;t++){var e=arguments[t];if(e)for(var r in e)e.hasOwnProperty(r)&&(Kt(e[r])?arguments[0][r]=e[r].slice():arguments[0][r]=e[r])}return arguments[0]}var ae=function(){function t(e){for(var r in o(this,t),Jt)if(Jt.hasOwnProperty(r)){var n=Jt[r],i=n._driver;this[r]=i,Zt[i]||this.defineDriver(n)}this._defaultConfig=ie({},ne),this._config=ie({},this._defaultConfig,e),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return t.prototype.config=function(t){if("object"===(void 0===t?"undefined":n(t))){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var e in t){if("storeName"===e&&(t[e]=t[e].replace(/\W/g,"_")),"version"===e&&"number"!=typeof t[e])return new Error("Database version must be a number.");this._config[e]=t[e]}return!("driver"in t)||!t.driver||this.setDriver(this._config.driver)}return"string"==typeof t?this._config[t]:this._config},t.prototype.defineDriver=function(t,e,r){var n=new l(function(e,r){try{var n=t._driver,o=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!t._driver)return void r(o);for(var i=re.concat("_initStorage"),a=0,s=i.length;a<s;a++){var u=i[a];if((!qt(ee,u)||t[u])&&"function"!=typeof t[u])return void r(o)}var h=function(){for(var e=function(t){return function(){var e=new Error("Method "+t+" is not implemented by the current driver"),r=l.reject(e);return c(r,arguments[arguments.length-1]),r}},r=0,n=ee.length;r<n;r++){var o=ee[r];t[o]||(t[o]=e(o))}};h();var f=function(r){Zt[n]&&console.info("Redefining LocalForage driver: "+n),Zt[n]=t,Qt[n]=r,e()};"_support"in t?t._support&&"function"==typeof t._support?t._support().then(f,r):f(!!t._support):f(!0)}catch(d){r(d)}});return h(n,e,r),n},t.prototype.driver=function(){return this._driver||null},t.prototype.getDriver=function(t,e,r){var n=Zt[t]?l.resolve(Zt[t]):l.reject(new Error("Driver not found."));return h(n,e,r),n},t.prototype.getSerializer=function(t){var e=l.resolve(vt);return h(e,t),e},t.prototype.ready=function(t){var e=this,r=e._driverSet.then(function(){return null===e._ready&&(e._ready=e._initDriver()),e._ready});return h(r,t,t),r},t.prototype.setDriver=function(t,e,r){var n=this;Kt(t)||(t=[t]);var o=this._getSupportedDrivers(t);function i(){n._config.driver=n.driver()}function a(t){return n._extend(t),i(),n._ready=n._initStorage(n._config),n._ready}function s(t){return function(){var e=0;function r(){for(;e<t.length;){var o=t[e];return e++,n._dbInfo=null,n._ready=null,n.getDriver(o).then(a).catch(r)}i();var s=new Error("No available storage method found.");return n._driverSet=l.reject(s),n._driverSet}return r()}}var u=null!==this._driverSet?this._driverSet.catch(function(){return l.resolve()}):l.resolve();return this._driverSet=u.then(function(){var t=o[0];return n._dbInfo=null,n._ready=null,n.getDriver(t).then(function(t){n._driver=t._driver,i(),n._wrapLibraryMethodsWithReady(),n._initDriver=s(o)})}).catch(function(){i();var t=new Error("No available storage method found.");return n._driverSet=l.reject(t),n._driverSet}),h(this._driverSet,e,r),this._driverSet},t.prototype.supports=function(t){return!!Qt[t]},t.prototype._extend=function(t){ie(this,t)},t.prototype._getSupportedDrivers=function(t){for(var e=[],r=0,n=t.length;r<n;r++){var o=t[r];this.supports(o)&&e.push(o)}return e},t.prototype._wrapLibraryMethodsWithReady=function(){for(var t=0,e=re.length;t<e;t++)oe(this,re[t])},t.prototype.createInstance=function(e){return new t(e)},t}(),se=new ae;e.exports=se},{3:3}]},{},[4])(4)}(Al);const El=d(Al.exports),Il=El.createInstance({name:"report",storeName:"report"});function Sl(t,r){const[n,o]=e.useState(()=>{const e=localStorage.getItem(t);return e&&"undefined"!==e&&"null"!==e&&""!==e?JSON.parse(e):r});return e.useEffect(()=>localStorage.setItem(t,JSON.stringify(n)),[n]),[n,o]}function xl(t){let e=t.url;if(t.params){e=e+"?"+new URLSearchParams(t.params).toString()}return e}El.config({driver:El.INDEXEDDB,name:"cache",version:1,storeName:"requests",description:"local cache"});const Ol={init:async t=>{let e=await El.getItem(xl(t));e&&(t.headers["x-tag"]=e.xtag,t.data=e.data)},save:async(t,e)=>{if(304==t.status)t.data=e.data;else if(t.status<400)try{let r={xtag:t.headers["x-tag"],data:t.data,create_at:new Date};await El.setItem(xl(e),r)}catch(r){console.info("Cache: ",r)}},clear:async(t=3)=>{const e=864e5*t,r=await El.keys(),n=new Date;for(const o of r){const t=await El.getItem(o);if(t&&t.create_at){n-new Date(t.create_at)>=e&&await El.removeItem(o)}}},clearAll:()=>{El.clear()}},Tl=o.div`
|
|
858
859
|
display: flex;
|
|
859
860
|
align-items: center;
|
|
860
861
|
gap: 0 5px;
|
|
@@ -956,5 +957,5 @@
|
|
|
956
957
|
}
|
|
957
958
|
`,kl=o.hr`
|
|
958
959
|
margin: 4px 12px;
|
|
959
|
-
`;function Rl({opc:t,closeMenu:e,clickGroup:r,clickFavorite:n,isFavorite:o,enabledFavorite:i}){var a;const{versionApp:s}=ee();if((null==(a=t.menus)?void 0:a.length)>0)return Qt.jsxs(Qt.Fragment,{children:[Qt.jsxs(Tl,{onClick:()=>r(t),isOpen:t.open,children:[Qt.jsx("span",{className:"opc",style:{color:t.isFavorite?"var(--nav-icon-sair)":"var(--bs-body-color) !important"},children:t.caption}),Qt.jsx("span",{className:"icon",children:Qt.jsx("i",{className:"fa-solid fa-chevron-down"})})]}),Qt.jsx("div",{className:"opt-group "+(t.open?"opt--open":"opt--close"),children:t.menus.map((t,a)=>Qt.jsx(Rl,{opc:t,closeMenu:e,clickGroup:r,clickFavorite:n,isFavorite:o,enabledFavorite:i},a))})]});if(t.route){let r=o(t.route),a=null==t?void 0:t.version;return a&&(a=Boolean(s.substring(0,a.length)===a)),Qt.jsxs(Nl,{to:t.route,onClick:e,children:[Qt.jsx("span",{className:"menu-icon",children:t.icon}),Qt.jsx("span",{className:"menu-caption",children:t.caption}),Qt.jsxs("span",{className:"menu-fav-new",children:[a&&Qt.jsx("span",{className:"menu-new",children:"novo"}),i&&Qt.jsx("span",{className:"menu-fav",onClick:e=>n(e,t),children:Qt.jsx("i",{title:"Clique para favoritar esta opção",className:"fa-"+(r?"solid":"regular")+" fa-heart",style:{color:r?"var(--nav-icon)":"var(--nav-icon-fav)"}})})]})]})}return(null==t?void 0:t.isLine)?Qt.jsx(kl,{}):null}const Dl="sys/nav/closed";const Pl=({routes:t,closeMenu:e,brand:r})=>Qt.jsx("div",{className:"navbar-mu--brand",children:Qt.jsx(a.Link,{to:t.home,onClick:e,className:"brand",title:"Voltar para tela inicial",children:r})});function Ml({isOpen:t,setIsOpen:e,menuClose:r}){return Qt.jsx("button",{className:"btn-menu",title:"Abrir menu de opções",onClick:()=>e(!t),children:r?Qt.jsx("i",{className:"fa-solid fa-xmark icon-close"}):Qt.jsxs("div",{className:"icon-desk",children:[Qt.jsx("span",{}),Qt.jsx("span",{}),Qt.jsx("span",{})]})})}const Bl="sys/nav/closed";t.Alerta=se,t.Aviso=function({onConfirm:t,text:e="",children:r}){return Qt.jsx(ae,{type:ne,title:"Aviso!",text:e,onConfirm:t,children:r})},t.BotaoClonar=function({title:t="Clonar o registro"}){return Qt.jsx(i.Button,{size:"sm",color:"warning",title:t,children:Qt.jsx(we,{})})},t.BotaoEditar=function({title:t="Alterar o registro"}){return Qt.jsx(i.Button,{size:"sm",color:"primary",title:t,children:Qt.jsx(Ee,{})})},t.BotaoExcluir=function({title:t="Excluir o registro"}){return Qt.jsx(i.Button,{size:"sm",color:"danger",title:t,children:Qt.jsx(Ie,{})})},t.BotaoIncluir=function({caption:t="Incluir",onClick:e,...r}){return Qt.jsxs(i.Button,{color:"success",title:"Incluir um novo registro",onClick:e,...r,children:[Qt.jsx(Ae,{})," ",t]})},t.BotaoSalvar=function({loading:t,saveInfo:e,link:r,fixed:n,modalFixed:o,btnSaveDisabled:s,onCancel:u,onConfirm:l}){const c=a.useHistory();return Qt.jsxs("div",{className:"botao-salvar--area","data-fixed":Boolean(n),"data-modal-fixed":Boolean(o),children:[Qt.jsxs(i.Button,{type:l?"button":"submit",color:"primary",onClick:l,disabled:s&&1==s,children:[Qt.jsx("i",{className:"fas fa-cloud-upload-alt"}),t||(null==e?void 0:e.loading)?"Salvando...":"Salvar"]}),Qt.jsxs(i.Button,{type:"button",color:"outline-danger",onClick:()=>{u?u():r?c.push(r):c.goBack()},children:[Qt.jsx("i",{className:"fas fa-times"}),"Cancelar"]})]})},t.BoxColor=function({corFonte:t,setCorFonte:e,corFundo:r,setCorFundo:n}){return Qt.jsxs("div",{className:"box-color--container",children:[Qt.jsx(ke,{label:"Cor da fonte",value:t,onChange:t=>e(t.target.value)}),Qt.jsx(ke,{label:"Cor de fundo",value:r,onChange:t=>n(t.target.value)}),Qt.jsx("div",{className:"box-color-texto",style:{color:t,backgroundColor:r},children:"Texto de exemplo"})]})},t.BoxInfo=function({id:t,title:r,isOpen:n=!1,isVisible:o=!0,onChange:i,noMargin:a,children:s,...u}){const[l,c]=e.useState(n);return e.useEffect(()=>{t&&i&&i(t,l)},[l]),o?Qt.jsxs(Re,{open:l,noMargin:a,...u,children:[Qt.jsx("div",{className:"bi-btn-area",children:Qt.jsxs("button",{type:"button",onClick:()=>c(!l),children:[r," ",Qt.jsx("i",{className:"fas fa-chevron-down setas-bi"})]})}),Qt.jsx("div",{className:`bi-body ${l&&"bi-open"}`,children:s})]}):null},t.BoxSearch=dl,t.ButtonBack=Be,t.ButtonClose=Pe,t.ButtonHelp=Me,t.ButtonOptions=function({value:t,setValue:e,options:r=[],...n}){return Qt.jsx("div",{className:"btn-opts--container btn-group",...n,children:r.map((r,n)=>Qt.jsx(i.Button,{active:n===t,color:"outline-info",onClick:()=>e(n),children:r},n))})},t.ButtonTop=function({smooth:t,center:r}){const[n,o]=e.useState(!1);function i(){var t;o((null==(t=document.querySelector("main"))?void 0:t.scrollTop)>0)}return e.useEffect(()=>{var t;return null==(t=document.querySelector("main"))||t.addEventListener("scroll",i),()=>{var t;null==(t=document.querySelector("main"))||t.removeEventListener("scroll",i)}},[]),Qt.jsx(Qt.Fragment,{children:n&&Qt.jsx(Le,{title:"Ir para o início da tela",visible:i,onClick:function(){var e;null==(e=document.querySelector("main"))||e.scrollTo({top:0,left:0,behavior:t?"smooth":"instant"}),o(!1)},className:"pulsate-bck",center:r,children:Qt.jsx("i",{className:"fa-solid fa-arrow-up"})})})},t.CheckBox=function({enabled:t=!0,onChange:e,children:r,...n}){const o=n.disabled||!t;return Qt.jsx(Rs,{disabled:o,children:Qt.jsxs("label",{children:[Qt.jsx(i.Input,{type:"checkbox",disabled:o,onChange:t=>{if(e){let r={...t,target:{...t.target,name:t.target.name,value:t.target.checked}};e(r)}},checked:"boolean"==typeof n.value?n.value:n.checked,...n}),r]})})},t.CheckUpdates=function(){const t=e.useRef();function r(e){var r,n;(null==t?void 0:t.current)&&(e?null==(r=t.current)||r.classList.add("update-show"):null==(n=t.current)||n.classList.remove("update-show"))}return e.useLayoutEffect(()=>{"serviceWorker"in navigator&&window.location.origin.startsWith("http")&&navigator.serviceWorker.getRegistration().then(t=>{t&&(t.addEventListener("updatefound",()=>{r(!0);const e=t.installing;e.addEventListener("statechange",()=>{"installed"==e.state&&setTimeout(()=>window.location.reload(!0),1e3),"activated"==e.state&&r(!1)})}),t.update())}).catch(t=>{console.error("=> Service Worker não encontrado:",t)})},[]),Qt.jsx("div",{className:"update-check-box",onClick:function(){r(!1)},children:Qt.jsxs("div",{ref:t,className:"update-box",children:[Qt.jsx("div",{className:"update-line"}),Qt.jsx("div",{className:"spinner-border text-warning w-22",role:"status",children:Qt.jsx("span",{className:"visually-hidden",children:"Carregando..."})}),"Nova versão disponível, atualizando..."]})})},t.ClipboardArea=function({title:t,url:r,timerInMilliSeconds:n=5e3}){const[o,i]=e.useState(!1);return e.useEffect(()=>()=>{Fe&&clearTimeout(Fe)},[]),Qt.jsxs("div",{className:`clipboard-area--container ${o&&" clip-active"}`,children:[Qt.jsx("a",{href:r,target:"_blank",rel:"noreferrer",title:"Abrir este link",children:t||r}),Qt.jsx("button",{type:"button",className:"clip-mark",onClick:function(){navigator.clipboard.writeText(r),i(!0),Fe=setTimeout(()=>i(!1),n)},children:o?Qt.jsxs(Qt.Fragment,{children:[Qt.jsx("i",{className:"fas fa-clipboard-check"}),"Copiado"]}):Qt.jsxs(Qt.Fragment,{children:[Qt.jsx("i",{className:"fas fa-clipboard"}),"Copiar"]})})]})},t.Confirma=function({onConfirm:t,onCancel:e,text:r="",children:n,defaultBtn:o}){return Qt.jsx(ae,{type:oe,title:"Confirmação!",text:r,onConfirm:t,onCancel:e,defaultBtn:o,children:n})},t.DataItem=function({caption:t,colored:e,isForm:r=!1,children:n,className:o,...i}){return Qt.jsxs("div",{className:"di-box "+o,...i,children:[t&&Qt.jsx("label",{style:{fontWeight:r?"bold":"normal"},children:t}),r?Qt.jsx("input",{className:"form-control",value:n,readOnly:!0}):Qt.jsx("div",{style:{color:e?"var(--data-item-destaque)":"var(--body-color)"},className:"fw-bold",children:n})]})},t.DropDownButton=he,t.DynamicCounter=function({valor:t=0,time:n=25,format:o,currency:i}){const[a,s]=e.useState(0);return e.useEffect(()=>{const e=setInterval(()=>{const r=Math.ceil(t/10)+1;s(n=>{let o=n+r;return o>t&&(o=t),o===t&&clearInterval(e),o})},n);return()=>clearInterval(e)},[t,n]),o?r.formatValor(a,i?2:0,Boolean(i)):a},t.FormDesk=function({children:t,labelWidth:e=100,sizeBreak:r=767,lineShortWidth:n=250,gap:o="8px",...i}){return Qt.jsx(wl,{style:{"--form-desk-label-width":`${e}px`,"--form-desk-line-short-width":`${n}px`,"--form-desk-gap":o},sizeBreak:r,...i,children:t})},t.FormDeskGrid=function({grid:t,gap:e=25,className:r="",children:n,...o}){return Qt.jsx("div",{className:`form-desk--grid ${r}`,style:{gridTemplateColumns:t,gap:e},...o,children:n})},t.FormDeskLine=function({children:t,label:e="",isShort:r=!1,className:n="",classNameLabel:o="",classNameCol:i="",extraComp:a,inpWidth:s,...u}){const l={};return s&&(l["--form-desk-line-short-width"]=s),Qt.jsxs("div",{className:`form-desk-line ${n}`,"data-has-extra-comp":a?"true":"false",...u,style:{...u.styles,...l},children:[Qt.jsx("label",{className:`form-desk-label ${o}`,children:e}),Qt.jsx("div",{className:i,"data-is-line-short":String(r),children:t}),a&&Qt.jsx("div",{className:"my-auto",children:a})]})},t.FormEdit=function({title:t,count:r,codigo:n,maxWidth:o=1200,goBack:i,goHome:a,onClose:s,helpLink:u,children:l}){return e.useEffect(()=>{var t;null==(t=document.querySelector("main"))||t.scrollTo(0,0)},[]),Qt.jsx("div",{className:"mx-auto",style:{maxWidth:o},children:Qt.jsx(Ge,{title:t,count:r,codigo:n,goBack:i,goHome:a,onClose:s,helpLink:u,children:l})})},t.FormEnter=function({children:t}){const r=e.useRef(),n=(t,e)=>{let r=t[e];for(;e<t.length-1&&(r=t[++e],r.disabled););return r};return Qt.jsx("form",{onSubmit:function(t){t.preventDefault()},ref:r,onKeyDown:function(t){var e,o;if("Enter"===t.key){const i=null==(e=null==r?void 0:r.current)?void 0:e.querySelector(".form-item:focus,.btn-primary"),a=null==(o=null==r?void 0:r.current)?void 0:o.querySelectorAll(".form-item,.btn-primary");for(let e=0;e<a.length;e++)if(a[e]===i&&e<a.length-1){t.preventDefault();const r=n(a,e);(null==r?void 0:r.select)&&r.select(),r.focus()}}},children:t})},t.FormatData=({value:t="",incHour:e=!0})=>{let r="";if(t){let n,o;-1!==t.indexOf("T")?(n=t.split("T"),o=n[1],n=n[0]):(n=t.split(" "),n.length>1&&(o=n[1]),n=n[0]),-1!==n.indexOf("-")&&(n=n.split("-").reverse().join("/")),o&&e&&(n=n+" "+o),r=n}return r},t.FormatPercent=({value:t=0,decimalScale:e=2,...r})=>Qt.jsx("span",{...r,children:Intl.NumberFormat("pt-br",{maximumFractionDigits:e,minimumFractionDigits:e,style:"decimal"}).format(Ds(t))+"%"}),t.FormatQuant=({value:t=0,decimalScale:e=2,...r})=>Qt.jsx("span",{...r,children:Intl.NumberFormat("pt-br",{maximumFractionDigits:e,minimumFractionDigits:e,style:"decimal"}).format(Ds(t))}),t.FormatValor=({value:t=0,money:e=!0,decimalScale:r=2,...n})=>Qt.jsx("span",{...n,children:Intl.NumberFormat("pt-br",{maximumFractionDigits:r,minimumFractionDigits:r,style:e?"currency":"decimal",currency:"BRL"}).format(Ds(t))}),t.GroupBox=function({label:t,className:e="",children:r}){return Qt.jsxs("div",{className:`group-box--container ${e}`,children:[Qt.jsx("div",{className:"group-box--label",children:t}),Qt.jsx("div",{className:"group-box--body",children:r})]})},t.Hint=function({title:t="Ajuda",children:e}){return Qt.jsxs("div",{className:"hint--container",children:[Qt.jsx("i",{className:"fas fa-question"}),Qt.jsxs("div",{className:"hint-content",children:[Qt.jsx("div",{className:"title",children:t}),e]})]})},t.IconClose=Ve,t.IconExitOutline=function(t){return Qt.jsx("svg",{viewBox:"0 0 512 512",fill:"currentColor",height:"1em",width:"1em",...t,children:Qt.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:32,d:"M320 176v-40a40 40 0 00-40-40H88a40 40 0 00-40 40v240a40 40 0 0040 40h192a40 40 0 0040-40v-40M384 176l80 80-80 80M191 256h273"})})},t.IconMenu=Ue,t.IconUserGear=function(t){return Qt.jsx("svg",{viewBox:"0 0 640 512",fill:"currentColor",height:"1em",width:"1em",...t,children:Qt.jsx("path",{d:"M224 256c-70.7 0-128-57.3-128-128S153.3 0 224 0s128 57.3 128 128-57.3 128-128 128zm-45.7 48h91.4c11.8 0 23.4 1.2 34.5 3.3-2.1 18.5 7.4 35.6 21.8 44.8-16.6 10.6-26.7 31.6-20 53.3 4 12.9 9.4 25.5 16.4 37.6s15.2 23.1 24.4 33c15.7 16.9 39.6 18.4 57.2 8.7v.9c0 9.2 2.7 18.5 7.9 26.3H29.7C13.3 512 0 498.7 0 482.3 0 383.8 79.8 304 178.3 304zM436 218.2c0-7 4.5-13.3 11.3-14.8 10.5-2.4 21.5-3.7 32.7-3.7s22.2 1.3 32.7 3.7c6.8 1.5 11.3 7.8 11.3 14.8v30.6c7.9 3.4 15.4 7.7 22.3 12.8l24.9-14.3c6.1-3.5 13.7-2.7 18.5 2.4 7.6 8.1 14.3 17.2 20.1 27.2s10.3 20.4 13.5 31c2.1 6.7-1.1 13.7-7.2 17.2l-25 14.4c.4 4 .7 8.1.7 12.3s-.2 8.2-.7 12.3l25 14.4c6.1 3.5 9.2 10.5 7.2 17.2-3.3 10.6-7.8 21-13.5 31s-12.5 19.1-20.1 27.2c-4.8 5.1-12.5 5.9-18.5 2.4L546.3 442c-6.9 5.1-14.3 9.4-22.3 12.8v30.6c0 7-4.5 13.3-11.3 14.8-10.5 2.4-21.5 3.7-32.7 3.7s-22.2-1.3-32.7-3.7c-6.8-1.5-11.3-7.8-11.3-14.8v-30.6c-8-3.4-15.6-7.7-22.5-12.9l-24.7 14.3c-6.1 3.5-13.7 2.7-18.5-2.4-7.6-8.1-14.3-17.2-20.1-27.2s-10.3-20.4-13.5-31c-2.1-6.7 1.1-13.7 7.2-17.2l24.8-14.3c-.4-4.1-.7-8.2-.7-12.4s.2-8.3.7-12.4L343.8 325c-6.1-3.5-9.2-10.5-7.2-17.2 3.3-10.6 7.7-21 13.5-31s12.5-19.1 20.1-27.2c4.8-5.1 12.4-5.9 18.5-2.4l24.8 14.3c6.9-5.1 14.5-9.4 22.5-12.9v-30.4zm92.1 133.5c0-26.5-21.5-48-48.1-48s-48.1 21.5-48.1 48 21.5 48 48.1 48 48.1-21.5 48.1-48z"})})},t.IconeChevron=()=>Qt.jsx("i",{className:"fas fa-chevron-down"}),t.IconeClonar=()=>Qt.jsx("i",{className:"fa-solid fa-copy"}),t.IconeConfig=()=>Qt.jsx("i",{className:"fas fa-cogs"}),t.IconeEditar=Ee,t.IconeEmail=()=>Qt.jsx("i",{className:"fas fa-envelope"}),t.IconeEncerrarAno=()=>Qt.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Qt.jsx("path",{d:"M8.875 17.375C7.43258 17.375 6.10606 17.0466 4.89545 16.3898C3.68485 15.733 2.69318 14.8572 1.92045 13.7625V15.8295H0.375V11.1932H5.01136V12.7386H3.09886C3.71705 13.6659 4.53176 14.4129 5.543 14.9795C6.55373 15.5462 7.66439 15.8295 8.875 15.8295C9.84091 15.8295 10.7458 15.6462 11.5896 15.2794C12.4329 14.9121 13.167 14.416 13.7919 13.7911C14.4162 13.1667 14.9121 12.4326 15.2794 11.5888C15.6462 10.7455 15.8295 9.84091 15.8295 8.875H17.375C17.375 10.047 17.153 11.1481 16.7089 12.1784C16.2643 13.2087 15.6557 14.1102 14.883 14.883C14.1102 15.6557 13.2087 16.2641 12.1784 16.7081C11.1481 17.1527 10.047 17.375 8.875 17.375ZM8.17955 14.2841V13.2795C7.57424 13.1379 7.08176 12.8772 6.70209 12.4975C6.32191 12.1174 6.04167 11.6182 5.86136 11L7.13636 10.4977C7.29091 11.0258 7.53251 11.4217 7.86118 11.6854C8.18933 11.9497 8.56591 12.0818 8.99091 12.0818C9.41591 12.0818 9.77961 11.9819 10.082 11.782C10.3849 11.5826 10.5364 11.2705 10.5364 10.8455C10.5364 10.472 10.3787 10.1693 10.0635 9.9375C9.74767 9.70568 9.18409 9.44167 8.37273 9.14545C7.61288 8.875 7.056 8.55303 6.70209 8.17955C6.34767 7.80606 6.17045 7.31667 6.17045 6.71136C6.17045 6.18333 6.35411 5.70347 6.72141 5.27177C7.0882 4.84059 7.58712 4.56061 8.21818 4.43182V3.46591H9.57045V4.43182C10.0341 4.47045 10.456 4.6572 10.8362 4.99205C11.2158 5.32689 11.4765 5.7197 11.6182 6.17045L10.3818 6.67273C10.2788 6.37651 10.1114 6.12873 9.87955 5.92936C9.64773 5.72948 9.32576 5.62955 8.91364 5.62955C8.46288 5.62955 8.1185 5.72614 7.8805 5.91932C7.64198 6.1125 7.52273 6.37651 7.52273 6.71136C7.52273 7.04621 7.67083 7.31023 7.96705 7.50341C8.26326 7.69659 8.79773 7.92197 9.57045 8.17955C10.4977 8.51439 11.1159 8.9072 11.425 9.35795C11.7341 9.80871 11.8886 10.3045 11.8886 10.8455C11.8886 11.2189 11.8242 11.5473 11.6955 11.8307C11.5667 12.114 11.3962 12.3554 11.1839 12.5547C10.9712 12.7546 10.7231 12.9156 10.4398 13.0377C10.1564 13.1603 9.85379 13.2538 9.53182 13.3182V14.2841H8.17955ZM0.375 8.875C0.375 7.70303 0.597288 6.60189 1.04186 5.57159C1.48592 4.54129 2.09432 3.63977 2.86705 2.86705C3.63977 2.09432 4.54129 1.48567 5.57159 1.04109C6.60189 0.59703 7.70303 0.375 8.875 0.375C10.3174 0.375 11.6439 0.703409 12.8545 1.36023C14.0652 2.01705 15.0568 2.8928 15.8295 3.9875V1.92045H17.375V6.55682H12.7386V5.01136H14.6511C14.033 4.08409 13.2182 3.33712 12.207 2.77045C11.1963 2.20379 10.0856 1.92045 8.875 1.92045C7.90909 1.92045 7.00448 2.10385 6.16118 2.47064C5.31736 2.83794 4.58327 3.33377 3.95891 3.95814C3.33403 4.58301 2.83794 5.31711 2.47064 6.16041C2.10385 7.00423 1.92045 7.90909 1.92045 8.875H0.375Z",fill:"currentColor"})}),t.IconeExcluir=Ie,t.IconeFechar=xe,t.IconeFecharCircle=()=>Qt.jsx("i",{className:"fas fa-times-circle"}),t.IconeHelp=Oe,t.IconeIncluir=Ae,t.IconeLogin=()=>Qt.jsx("i",{className:"fas fa-sign-in-alt"}),t.IconeLogout=Ce,t.IconeMostrarSenha=({display:t})=>Qt.jsx("i",{className:"fas fa-eye"+(t?"-slash":"")}),t.IconeOpenLink=Te,t.IconePassword=()=>Qt.jsx("i",{className:"fas fa-key"}),t.IconePin=()=>Qt.jsx("i",{className:"fas fa-map-marker-alt"}),t.IconePrint=()=>Qt.jsx("i",{className:"fas fa-print"}),t.IconeQRCode=Ne,t.IconeSalvar=()=>Qt.jsx("i",{className:"fas fa-cloud-upload-alt"}),t.IconeSearchPlus=()=>Qt.jsx("i",{className:"fas fa-search-plus"}),t.IconeSoma=()=>Qt.jsx("svg",{width:"10",height:"13",viewBox:"0 0 10 13",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Qt.jsx("path",{d:"M0.898056 12.1914V10.6914L5.77306 6.19141L0.898056 1.69141V0.191406H9.89806V2.44141H4.47931L8.51056 6.19141L4.47931 9.94141H9.89806V12.1914H0.898056Z",fill:"currentColor"})}),t.IconeUsers=()=>Qt.jsx("i",{className:"fas fa-user-cog"}),t.IconeVisualizar=Se,t.Input=function({autoSelect:t,...e}){function r(r){e.onClick?e.onClick(r):t&&r.currentTarget.select()}switch(e.type){case"cpf":return Qt.jsx(ll,{onClick:r,...e});case"cnpj":return Qt.jsx(rl,{onClick:r,...e});case"codigo":return Qt.jsx(sl,{name:e.name,onChange:e.onChange,onClick:r,...e});case"fone":return Qt.jsx(Ls,{name:e.name,onChange:e.onChange,value:e.value,onClick:r,...e});case"uf":return Qt.jsx(cl,{onClick:r,...e});case"hora":return Qt.jsx(ul,{onClick:r,...e});case"percent":return Qt.jsx(al,{name:e.name,onChange:e.onChange,onClick:r,...e});case"quant":return Qt.jsx(il,{name:e.name,onChange:e.onChange,onClick:r,...e});case"real":return Qt.jsx(ol,{name:e.name,onChange:e.onChange,onClick:r,...e});case"finder":return Qt.jsx(pl,{onClick:r,...e});default:return Qt.jsx("input",{className:"form-control",onClick:r,...e})}},t.InputBox=function({children:t}){return Qt.jsx("div",{className:"jclib-ui-input-box",children:t})},t.InputCep=function({dados:t,setDados:r,onSearch:n,disabled:o,autoFocus:i,...a}){const[s,u]=e.useState(!1),c=async e=>{u(!0);const o=await(async(t,e)=>{let r={erro:!0,mensagem:"CEP deve ter 8 dígitos!"};if((t=t.replace(/\D+/g,""))&&8===t.length){const n=`https://viacep.com.br/ws/${t}/json`;try{r=await(await fetch(n,{mode:"cors"})).json()}catch{r={erro:!0,mensagem:"Não foi possível pesquisar este CEP!"}}finally{e&&e(r)}}return r})(e,n);!o.erro&&t&&r&&r({...t,ende:o.logradouro,bairro:o.bairro,cida:o.localidade,uf:o.uf}),u(!1)};return Qt.jsxs(Qt.Fragment,{children:[Qt.jsx(Bs,{visible:s,message:"Buscando CEP..."}),Qt.jsxs("div",{className:"input-group",children:[Qt.jsx(l,{format:"##.###-###",mask:"_",value:a.value,className:"form-control",onValueChange:t=>function(t,e,r){r&&r({target:{name:e,value:t.formattedValue}})}(t,a.name,a.onChange),disabled:o,autoFocus:i}),Qt.jsx("button",{type:"button",className:"btn btn-info",onClick:()=>c(a.value),disabled:o,children:Qt.jsx("i",{className:"fas fa-search"})})]})]})},t.InputCheckBox=({disabled:t,children:e,name:r,checked:n,onChange:o})=>Qt.jsx(gl,{children:Qt.jsxs(ml,{disabled:t,onClick:function(){if(!t&&o){o({target:{name:r,checked:!n}})}},children:[Qt.jsxs("span",{children:[n&&Qt.jsx(me,{color:t&&"silver"}),!n&&Qt.jsx(ve,{color:t&&"silver"})]})," ",e]})}),t.InputCnpj=rl,t.InputCodigo=sl,t.InputColor=ke,t.InputCpf=ll,t.InputCpfCnpj=function({onChange:t,value:e,name:r,className:n,...o}){return Qt.jsx(tl,{className:`form-control ${Us(e)?"is-invalid":""} ${n||""}`,mask:el,onAccept:function(e){t({target:{name:r,value:e.toUpperCase()}})},value:e,name:r,...o})},t.InputEstado=cl,t.InputFinder=({title:t,onFind:e,children:r,...n})=>Qt.jsxs("div",{className:"input-group",children:[Qt.jsxs("select",{className:"form-select",...n,children:[Qt.jsxs("option",{value:0,children:["- ",t," -"]}),r]}),Qt.jsx("button",{type:"button",title:"Pesquisar...",className:"btn btn-info",onClick:e,children:Qt.jsx(_e,{})})]}),t.InputFone=Ls,t.InputHora=ul,t.InputPassword=function({disabled:t,autoSelect:r,...n}){const[o,i]=e.useState(!1);return Qt.jsxs(vl,{disabled:t,children:[Qt.jsx("input",{type:o?"text":"password",disabled:t,onClick:function(t){n.onClick?n.onClick(t):r&&t.currentTarget.select()},...n}),Qt.jsx("i",{className:o?"fas fa-eye-slash":"fas fa-eye",onClick:()=>{t||i(!o)},title:t?"":(o?"Ocultar":"Exibir")+" a senha"})]})},t.InputPercent=al,t.InputPesquisa=sr,t.InputQRCode=function({value:t,setValue:r}){const[n,o]=e.useState(!1);return Qt.jsxs(Qt.Fragment,{children:[Qt.jsxs("div",{className:"input-group",children:[Qt.jsx(i.Input,{disabled:!0,placeholder:"Link para o documento de pagamento",title:"Link para o documento de pagamento",value:t}),Qt.jsx(i.Button,{color:"outline-secondary",title:"Limpar o campo",onClick:()=>r(""),children:Qt.jsx(be,{})}),Qt.jsx(i.Button,{color:"success-light",title:"Ler QRCode do documento",onClick:()=>o(!0),children:Qt.jsx(Ne,{})}),t?Qt.jsx(tr,{className:"btn btn-info",title:"Abrir o link do documento",to:t,children:Qt.jsx(Te,{})}):Qt.jsx(i.Button,{color:"info",disabled:!0,children:Qt.jsx(Te,{})})]}),n&&Qt.jsx(ks,{setVisible:o,title:"Ler QRCode do documento",onResult:t=>r(null==t?void 0:t.text)})]})},t.InputQuant=il,t.InputSearch=({title:t="Selecione",options:e=[],fields:r=[],btnClick:n=null,...o})=>Qt.jsxs("div",{className:"input-group",children:[Qt.jsxs("select",{className:"form-select",...o,children:[Qt.jsxs("option",{value:0,children:["- ",t," -"]}),null==e?void 0:e.map((t,e)=>Qt.jsx("option",{value:t[r[0]],children:t[r[1]]},e))]}),Qt.jsx("button",{type:"button",className:"btn btn-info",title:"Abrir tela de pesquisa",onClick:n,children:Qt.jsx(_e,{})})]}),t.InputValor=ol,t.LabelHint=function({label:t,hint:e}){return Qt.jsxs("div",{className:"label-hint--container",children:[Qt.jsx("label",{children:t}),Qt.jsx("div",{className:"label-hint--icon",children:Qt.jsx("i",{className:"fas fa-question"})}),Qt.jsxs("div",{className:"label-hint--box",children:[Qt.jsx("div",{className:"label-hint--box-title",children:"Ajuda"}),e]})]})},t.LibProvider=({apiConfig:t,children:n,versionApp:o,useTheme:i})=>{const a=!(!i||"boolean"!=typeof i)&&i,[s,u]=e.useState(()=>{let t="";if(a){let e=localStorage.getItem(te);t=e||(r.isDarkMode()?"dark":"light")}return t}),[l,c]=Ol("sys/reportType",0),[h,f]=e.useState([]),[d,p]=e.useState(!1),g=t=>{let e=h.find(e=>e.modalId===t);e&&e.setVisible(!1),f(e=>e.filter(e=>e.modalId!==t))},m=e.useCallback(t=>{"Escape"===t.key&&0!=h.length&&g(h[h.length-1].modalId)},[h]);return e.useEffect(()=>{("localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.startsWith("192.168."))&&!document.title.includes(" ⭕ ")&&(document.title=`${document.title} ⭕ `)},[]),e.useEffect(()=>{a&&(localStorage.setItem(te,s),document.body.dataset.bsTheme="dark"==s?s:"")},[s,a]),e.useEffect(()=>(window.addEventListener("keydown",m,!1),()=>window.removeEventListener("keydown",m,!1)),[h]),Qt.jsx(Jt.Provider,{value:{versionApp:o,addModal:(t,e)=>{f(r=>{let n=[...r],o=n.findIndex(e=>e.modalId===t);return o>=0?n[o]={modalId:t,setVisible:e}:n.push({modalId:t,setVisible:e}),n})},removeModal:g,clearModals:()=>{h.forEach(t=>{g(t.modalId)})},showBtnTop:d,setShowBtnTop:p,globalApiConfig:t,theme:s,setTheme:u,toggleTheme:()=>u("dark"==s?"light":"dark"),canChangeTheme:a,reportType:l,setReportType:c},children:n})},t.LinkToEmail=Je,t.LinkToFone=function({href:t,children:e,...r}){const n=String(t||e);let o="+";return(null==n?void 0:n.startsWith("+"))||(o="+55"),o+=n.replace(/\D/g,""),Qt.jsx("a",{href:`tel:${o}`,title:"Ligar para este número",...r,children:e||t})},t.LinkToMaps=function({href:t,children:e,...r}){let n=`https://google.com/maps/place/${null==t?void 0:t.replace(" ","+")}`;return(null==t?void 0:t.includes("/maps/place/"))&&(null==t?void 0:t.startsWith("https"))&&(n=t),Qt.jsx("a",{href:n,target:"_blank",rel:"noreferrer",title:"Localizar este endereço",...r,children:e})},t.LinkToNewPage=tr,t.LinkToWhatsApp=Qe,t.Loading=Bs,t.LoadingReport=function({url:t,file:e,fileTo:r,loading:n=!0,setLoading:o}){if(!n)return null;let[,i]=e.split("."),[a,s]=r.split(".");return s!=i&&(r=[a,i].join(".")),Qt.jsx(ar,{url:t,file:e,fileTo:r,setLoading:o})},t.Modal=cr,t.ModalBody=hr,t.ModalBox=function({visible:t,setVisible:e,codigo:r,title:n,children:o,alignTop:i,paddingBottom:a=10,helpLink:s,count:u,...l}){return t?Qt.jsxs(cr,{alignTop:i,setVisible:e,visible:t,...l,children:[Qt.jsxs(dr,{helpLink:s,setVisible:e,children:[n,null!=u&&Qt.jsxs(Qt.Fragment,{children:[" ",Qt.jsx(ze,{value:u,isCount:!0})]}),Qt.jsx(ze,{value:r})]}),Qt.jsx(fr,{children:Qt.jsx(hr,{style:{paddingBottom:a},children:o})})]}):null},t.ModalContent=fr,t.ModalFilter=function({title:t="Filtros",setVisible:e,maxWidth:r,fnApplyFilter:n,children:o,alignTop:a,helpLink:s}){return Qt.jsxs(cr,{alignTop:a,maxWidth:r,setVisible:e,visible:!0,children:[Qt.jsx(dr,{helpLink:s,setVisible:e,children:t}),Qt.jsx(fr,{children:Qt.jsxs(hr,{className:"mod-filter--container",children:[o,Qt.jsxs("div",{className:"mod-filter--btn-area",children:[Qt.jsxs(i.Button,{block:!0,color:"primary",onClick:()=>{n&&n(!0)},children:[Qt.jsx(ye,{})," Aplicar filtros"]}),Qt.jsxs(i.Button,{block:!0,color:"outline-danger",onClick:()=>{n&&n(!1)},children:[Qt.jsx(xe,{})," Cancelar filtros"]})]})]})})]})},t.ModalFooter=function({className:t="",backgroundColor:e="",...r}){return Qt.jsx("div",{className:`modal--footer ${t}`,style:{backgroundColor:e},...r})},t.ModalHeader=dr,t.Navbar=function({menusConfig:{brand:t,company:n,menus:o,routes:i,user:s,validatePermis:u},helpLink:l}){const c=a.useHistory(),h=e.useRef(),f=e.useRef(),{theme:d,setTheme:p,canChangeTheme:g}=ee(),[m,v]=e.useState(!1),[y,_]=e.useState(""),[w,b]=e.useState([]),[C,A]=e.useState([]);let E=[];const I=localStorage.getItem(Dl);I&&(E=JSON.parse(I));const[S]=or({url:i.apiFavorites,onTerminated:t=>{t.error?console.info("Erro ao obter lista de favoritos!",t.error):A(t.data)}}),[x]=or({url:i.apiFavorites,method:"patch",onTerminated:t=>{t.error&&console.info("Erro ao salvar favoritos!",t.error)}});function O(){v(!1)}function T(t){let e=[...w],r=[];e.forEach(e=>{e===t&&(e.open=!e.open),e.open||r.push(e.caption)}),localStorage.setItem(Dl,JSON.stringify(r)),b(e)}function N(t){let e=[...w];e.forEach(e=>{(null==e?void 0:e.menus)&&((null==e?void 0:e.stayOpen)?e.open=e.stayOpen:e.open=t)}),b(e),T(null)}function k(t,e){t.stopPropagation(),t.preventDefault();const r=C.filter(t=>t.route!==e.route);var n;r.length===C.length&&r.push({caption:((null==e?void 0:e.prefix)?e.prefix+" / ":"")+e.caption,route:e.route}),n=r,i.apiFavorites&&(x({data:n}),A(n))}function R(t){return C.some(e=>e.route===t)}return e.useEffect(()=>{i.apiFavorites&&S()},[]),e.useEffect(()=>{let t=[];null==C||C.forEach(e=>{o.forEach((r,n)=>{var o;if(n>0&&0!==(null==(o=null==r?void 0:r.menus)?void 0:o.length)){let o=r.menus.findIndex(t=>t.route===e.route);if(o>=0){let i=r.menus[o];t.push({...i,caption:e.caption,index:String(n).padStart(2,"0")+String(o).padStart(2,0)})}}})}),"Favoritos"===o[0].caption&&(o[0].menus=t.sort((t,e)=>t.index>e.index?1:t.index<e.index?-1:0)),b(function(t){let e=[];return t.forEach(t=>{let r={caption:t.caption,open:!E.includes(t.caption)||t.stayOpen,stayOpen:t.stayOpen,isFavorite:null==t?void 0:t.isFavorite,prefix:null==t?void 0:t.prefix,menus:[]};t.menus&&t.menus.length>0&&t.menus.filter(t=>{var e;return(null==t?void 0:t.isLine)||!(null==t?void 0:t.isLine)&&(t.caption.toLowerCase().includes(y.toLowerCase())||(null==(e=t.shortcut)?void 0:e.toLowerCase().includes(y.toLowerCase())))}).forEach(t=>{u(null==t?void 0:t.permis,null==t?void 0:t.acesso)&&r.menus.push({...t,prefix:null==r?void 0:r.prefix})}),y&&(r.open=!0),e.push(r)}),e.forEach(t=>{var e;t.menus&&((null==(e=t.menus[0])?void 0:e.isLine)&&(t.menus=t.menus.filter(t=>!(null==t?void 0:t.isLine))),t.menus=t.menus.filter((t,e,r)=>{var n;return!(e>0&&(null==(n=r[e-1])?void 0:n.isLine)&&t.isLine)}),t.menus=t.menus.filter((t,e,r)=>!(e===r.length-1&&(null==t?void 0:t.isLine))))}),e}(o))},[y,C]),e.useEffect(()=>{var t,e;r.isDesktop()&&(null==(t=null==h?void 0:h.current)||t.focus(),null==(e=null==h?void 0:h.current)||e.select())},[m]),Qt.jsxs(Qt.Fragment,{children:[Qt.jsx("div",{className:"navbar--area",children:Qt.jsxs("div",{className:"navbar-content",children:[Qt.jsx("button",{className:"btn-menu"+(m?" opened":""),title:"Abrir menu de opções",onClick:()=>v(!m),children:m?Qt.jsx(Ve,{width:20,height:20}):Qt.jsx(Ue,{width:20,height:20})}),Qt.jsxs("div",{className:"content",children:[Qt.jsx(a.Link,{to:i.home,className:"brand",onClick:O,title:"Voltar para tela inicial",children:t}),Qt.jsxs("div",{className:"company",children:[Qt.jsx("div",{className:"name",children:n}),Qt.jsxs("div",{className:"doc",children:[Qt.jsxs("span",{children:[null==s?void 0:s.title," "]}),Qt.jsx("strong",{children:null==s?void 0:s.name})]})]}),Qt.jsxs("div",{className:"nav-btn-area",children:[Qt.jsx("div",{className:"btn-theme",children:g&&Qt.jsx("button",{title:"Alterar entre o tema claro/escuro",className:"btn nav-button",onClick:()=>{const t="light"==d?"dark":"light";p(t),document.body.dataset.bsTheme=t},children:Qt.jsx("i",{className:"fa-solid fa-circle-half-stroke"})})}),l&&Qt.jsx("a",{title:"Abrir ajuda online",className:"btn nav-button",href:l,target:"_blank",children:Qt.jsx(Oe,{})}),Qt.jsxs("div",{className:"btn-atalho",children:[Qt.jsx(a.Link,{to:i.users,className:"nav-button",title:"Configurações do usuário",onClick:()=>v(!1),children:Qt.jsx("i",{className:"fa-solid fa-user-gear"})}),Qt.jsx(a.Link,{to:i.exit,className:"nav-button",title:"Sair do sistema",onClick:()=>v(!1),children:Qt.jsx("i",{className:"fa-solid fa-right-from-bracket"})})]})]})]})]})}),m&&Qt.jsx("div",{id:"menu-background",className:"navbar--menu-background",onClick:function(t){"menu-background"===t.target.id&&O()},children:Qt.jsxs("div",{className:"menu-content",children:[Qt.jsxs("div",{className:"search-area",children:[Qt.jsx("i",{className:"fas fa-search"}),Qt.jsx("input",{ref:h,placeholder:"Pesquisar...",value:y,onChange:t=>_(t.target.value),onKeyDown:function(t){if("Enter"==t.key)for(const e of w)if(e.menus&&0!=e.menus.length){const t=e.menus.find(t=>null!=t.route&&""!=t.route);if(t){c.push(t.route),v(!1);break}}}}),y&&Qt.jsx("button",{className:"text-danger",title:"Limpar pesquisa",onClick:()=>_(""),children:Qt.jsx("i",{className:"fas fa-times"})}),Qt.jsx("button",{title:"Fechar todos os grupos de opções",onClick:()=>N(!1),children:Qt.jsx("i",{className:"fas fa-minus"})}),Qt.jsx("button",{title:"Expandir todos os grupos de opções",onClick:()=>N(!0),children:Qt.jsx("i",{className:"fas fa-plus"})})]}),Qt.jsx("div",{className:"navbar--menu-area",ref:f,children:w.map((t,e)=>Qt.jsx(Rl,{opc:t,closeMenu:O,clickGroup:T,clickFavorite:k,isFavorite:R,enabledFavorite:i.apiFavorites},e))}),Qt.jsx("div",{className:"menu-footer",children:Qt.jsx(a.Link,{to:i.exit,onClick:O,children:Qt.jsxs("div",{className:"user",children:[Qt.jsx("span",{className:"name",title:`Último acesso em ${null==s?void 0:s.lastAccess}`,children:null==s?void 0:s.name}),Qt.jsxs("span",{className:"sair",children:["Sair ",Qt.jsx(Ce,{})]})]})})})]})})]})},t.NavbarMU=function({menusConfig:{brand:t,company:n,menus:o,routes:i,user:s,validatePermis:u}}){const l=e.useRef(),c=e.useRef(),h=a.useHistory(),{theme:f,setTheme:d,canChangeTheme:p}=ee(),[g,m]=e.useState(!1),[v,y]=e.useState(""),[_,w]=e.useState([]),[b,C]=e.useState([]);let A=[];const E=localStorage.getItem(Bl);E&&(A=JSON.parse(E));const[I]=or({url:i.apiFavorites,onTerminated:t=>{t.error?console.info("Erro ao obter lista de favoritos!",t.error):C(t.data)}}),[S]=or({url:i.apiFavorites,method:"patch",onTerminated:t=>{t.error&&console.info("Erro ao salvar favoritos!",t.error)}});function x(){m(!1)}function O(t){let e=[..._],r=[];e.forEach(e=>{e===t&&(e.open=!e.open),e.open||r.push(e.caption)}),localStorage.setItem(Bl,JSON.stringify(r)),w(e)}function T(t){let e=[..._];e.forEach(e=>{(null==e?void 0:e.menus)&&((null==e?void 0:e.stayOpen)?e.open=e.stayOpen:e.open=t)}),w(e),O(null)}function N(t,e){t.stopPropagation(),t.preventDefault();const r=b.filter(t=>t.route!==e.route);var n;r.length===b.length&&r.push({caption:((null==e?void 0:e.prefix)?e.prefix+" / ":"")+e.caption,route:e.route}),n=r,i.apiFavorites&&(S({data:n}),C(n))}function k(t){return b.some(e=>e.route===t)}return e.useEffect(()=>{i.apiFavorites&&I()},[]),e.useEffect(()=>{let t=[];null==b||b.forEach(e=>{o.forEach((r,n)=>{var o;if(n>0&&0!==(null==(o=null==r?void 0:r.menus)?void 0:o.length)){let o=r.menus.findIndex(t=>t.route===e.route);if(o>=0){let i=r.menus[o];t.push({...i,caption:e.caption,index:String(n).padStart(2,"0")+String(o).padStart(2,0)})}}})}),"Favoritos"===o[0].caption&&(o[0].menus=t.sort((t,e)=>t.index>e.index?1:t.index<e.index?-1:0)),w(function(t){let e=[];return t.forEach(t=>{let r={caption:t.caption,open:!A.includes(t.caption)||t.stayOpen,stayOpen:t.stayOpen,isFavorite:null==t?void 0:t.isFavorite,prefix:null==t?void 0:t.prefix,menus:[]};t.menus&&t.menus.length>0&&t.menus.filter(t=>{var e;return(null==t?void 0:t.isLine)||!(null==t?void 0:t.isLine)&&(t.caption.toLowerCase().includes(v.toLowerCase())||(null==(e=t.shortcut)?void 0:e.toLowerCase().includes(v.toLowerCase())))}).forEach(t=>{u(null==t?void 0:t.permis,null==t?void 0:t.acesso)&&r.menus.push({...t,prefix:null==r?void 0:r.prefix})}),v&&(r.open=!0),e.push(r)}),e.forEach(t=>{var e;t.menus&&((null==(e=t.menus[0])?void 0:e.isLine)&&(t.menus=t.menus.filter(t=>!(null==t?void 0:t.isLine))),t.menus=t.menus.filter((t,e,r)=>{var n;return!(e>0&&(null==(n=r[e-1])?void 0:n.isLine)&&t.isLine)}),t.menus=t.menus.filter((t,e,r)=>!(e===r.length-1&&(null==t?void 0:t.isLine))))}),e}(o))},[v,b]),e.useEffect(()=>{var t,e;r.isDesktop()&&(null==(t=null==l?void 0:l.current)||t.select(),null==(e=null==l?void 0:l.current)||e.focus())},[g]),Qt.jsxs(Qt.Fragment,{children:[Qt.jsx("div",{className:"navbar-mu-area",children:Qt.jsxs("div",{className:"mu--container",children:[Qt.jsx(Ml,{isOpen:g,setIsOpen:m}),Qt.jsxs("div",{className:"mu--content",children:[Qt.jsx(Pl,{isOpen:g,setIsOpen:m,brand:t,closeMenu:x,routes:i}),Qt.jsxs("div",{className:"mu--info",children:[Qt.jsx("div",{className:"info-line-1",children:n}),Qt.jsx("div",{className:"info-line-2",children:Qt.jsxs("span",{children:[null==s?void 0:s.title," ",Qt.jsx("strong",{children:null==s?void 0:s.name})]})})]}),Qt.jsxs("div",{className:"mu--buttons",children:[p&&Qt.jsx("button",{title:"Alterar entre o tema claro/escuro",className:"btn nav-button",onClick:()=>{const t="light"==f?"dark":"light";d(t),document.body.dataset.bsTheme=t},children:Qt.jsx("i",{className:"fa-solid fa-circle-half-stroke"})}),Qt.jsx(a.Link,{to:i.users,className:"nav-button btn-users",title:"Configurações do usuário",onClick:()=>m(!1),children:Qt.jsx("i",{className:"fa-solid fa-user-gear"})}),Qt.jsx(a.Link,{to:i.exit,className:"nav-button btn-exit",title:"Sair do sistema",onClick:()=>m(!1),children:Qt.jsx("i",{className:"fa-solid fa-right-from-bracket"})})]})]})]})}),Qt.jsx("div",{"data-open":g,id:"menu-background",className:"nv-menu--background",onClick:function(t){"menu-background"===t.target.id&&x()},children:Qt.jsxs("div",{className:"nv-menu--content","data-open":g,children:[Qt.jsxs("div",{className:"nv-menu--brand",children:[Qt.jsx(Ml,{isOpen:g,setIsOpen:m,menuClose:r.isMobile()}),Qt.jsx(Pl,{isOpen:g,setIsOpen:m,brand:t,closeMenu:x,routes:i,showButtonClose:!0})]}),Qt.jsxs("div",{className:"nv-menu--search",children:[Qt.jsx("i",{className:"fas fa-search"}),Qt.jsx("input",{ref:l,placeholder:"Pesquisar...",value:v,onChange:t=>y(t.target.value),onKeyDown:function(t){if("Enter"==t.key)for(const e of _)if(e.menus&&0!=e.menus.length){const t=e.menus.find(t=>null!=t.route&&""!=t.route);if(t){h.push(t.route),m(!1);break}}}}),v&&Qt.jsx("button",{className:"text-danger",title:"Limpar pesquisa",onClick:function(){var t;y(""),null==(t=null==l?void 0:l.current)||t.focus()},children:Qt.jsx("i",{className:"fas fa-times"})}),Qt.jsx("button",{title:"Fechar todos os grupos de opções",onClick:()=>T(!1),children:Qt.jsx("i",{className:"fas fa-minus"})}),Qt.jsx("button",{title:"Expandir todos os grupos de opções",onClick:()=>T(!0),children:Qt.jsx("i",{className:"fas fa-plus"})})]}),Qt.jsx("div",{className:"nv-menu--opcoes",ref:c,children:_.map((t,e)=>Qt.jsx(Rl,{opc:t,closeMenu:x,clickGroup:O,clickFavorite:N,isFavorite:k,enabledFavorite:i.apiFavorites},e))}),Qt.jsx("div",{className:"nv-menu--footer",children:Qt.jsx(a.Link,{to:i.exit,onClick:x,children:Qt.jsxs("div",{className:"foo-user",children:[Qt.jsx("span",{className:"foo-name",children:null==s?void 0:s.name}),Qt.jsxs("span",{className:"foo-sair",children:["Sair ",Qt.jsx(Ce,{})]})]})})}),Qt.jsxs("div",{className:"nv-menu--copy",children:["Último acesso em ",null==s?void 0:s.lastAccess]})]})})]})},t.Paginacao=function({pages:t,page:r,setPage:n,limitDefault:o=16,limit:i=16,setLimit:a,align:s="center"}){const[u,l]=e.useState([7,o,30,50,100]),c=void 0!==a&&void 0!==i&&void 0!==o;function h(e){var o;e!==r&&e>=1&&e<=t&&(null==(o=document.querySelector("main"))||o.scrollTo(0,0),n(e))}return c&&!u.includes(o)&&l([...u,o].sort((t,e)=>t-e)),Qt.jsx("div",{className:"pgn-content","data-fixed":i>=30?"true":"false","data-align":s,children:Qt.jsxs("div",{className:"pgn-comps",children:[c&&Qt.jsxs("div",{className:"pgn-limit",children:[Qt.jsx("label",{children:"Registros:"}),Qt.jsx("select",{className:"form-select form-select-sm",value:i,onChange:t=>a(Number(t.target.value)),children:u.map(t=>Qt.jsx("option",{value:t,children:t},t))})]}),Qt.jsxs("div",{className:"pgn-pages",children:[Qt.jsx("button",{className:"btn btn-outline-"+(r<=1?"secondary":"info"),title:"Ir para a primeira página",onClick:()=>h(1),disabled:r<=1,children:Qt.jsx("i",{className:"fas fa-angle-double-left"})}),Qt.jsx("button",{className:"btn btn-outline-"+(r<=1?"secondary":"info"),title:"Ir para página anterior",onClick:()=>h(Number(r)-1),disabled:r<=1,children:Qt.jsx("i",{className:"fas fa-angle-left"})}),Qt.jsx("span",{className:"p-2 text-body",children:Qt.jsxs("div",{children:[Qt.jsx("span",{className:"fw-bold",children:r})," / ",Qt.jsx("span",{children:t||"?"})]})}),Qt.jsx("button",{className:"btn btn-outline-"+(r>=t?"secondary":"info"),title:"Ir para próxima página",onClick:()=>h(Number(r)+1),disabled:r>=t,children:Qt.jsx("i",{className:"fas fa-angle-right"})}),Qt.jsx("button",{className:"btn btn-outline-"+(r>=t?"secondary":"info"),title:"Ir para a última página",onClick:()=>h(t),disabled:r>=t,children:Qt.jsx("i",{className:"fas fa-angle-double-right"})})]})]})})},t.Panel=Ge,t.PanelDashboard=function({title:t,color:e="var(--dash-border)",backColor:r="var(--dash-bg)",className:n,minHeight:o,children:i,marginBottom:a=0,...s}){return Qt.jsxs("div",{className:"panel-dashboard--container"+(n?` ${n}`:""),style:{minHeight:o,marginBottom:a,borderColor:e,backgroundColor:r},...s,children:[t&&Qt.jsx("h3",{className:"title",children:t}),i]})},t.PanelHeader=He,t.PrintButtons=function({onClose:t,showTypes:r}){const{reportType:n,setReportType:o}=ee(),i=[{title:"PDF",icon:Qt.jsx("i",{className:"fa-solid fa-file-pdf"}),onClick(){o(0)}},{title:"Excel",icon:Qt.jsx("i",{className:"fa-solid fa-file-excel"}),onClick(){o(1)}},{title:"Word",icon:Qt.jsx("i",{className:"fa-solid fa-file-word"}),onClick(){o(2)}},{title:"Texto",icon:Qt.jsx("i",{className:"fa-regular fa-file-lines"}),onClick(){o(3)}}];return e.useEffect(()=>{r||o(0)},[]),Qt.jsxs("div",{className:"print-btn--container",children:[r&&Qt.jsx(he,{items:i,title:"Formato do relatório",direction:"down",children:Qt.jsxs("span",{className:"d-flex align-items-center gap-1",children:[Qt.jsxs("span",{children:["Formato",Qt.jsx("span",{className:"d-inline-block d-sm-none",children:" do relatório:"})]}),Qt.jsx("span",{className:"me-1",children:["PDF","Excel","Word","Texto"][n]}),Qt.jsx("i",{className:"fa-solid fa-chevron-down ms-auto fs-7"})]})}),Qt.jsxs("div",{className:"print-btn--buttons",children:[Qt.jsxs("button",{className:"btn btn-primary",type:"submit",children:[Qt.jsx("i",{className:"fas fa-print"})," Gerar relatório"]}),Qt.jsxs("button",{className:"btn btn-outline-danger",type:"button",onClick:t,children:[Qt.jsx("i",{className:"fas fa-times"})," Fechar"]})]})]})},t.QRCodeReader=ks,t.RadioGroup=function({className:t="",label:e,name:r,value:n,setValue:o,options:a=[],disabled:s}){return Qt.jsxs("div",{className:"rad-group--container "+t,style:{color:s?"var(--bs-secondary)":"currentColor"},children:[Qt.jsx("div",{className:"group-radio--label",children:e}),Qt.jsx("div",{className:"group-radio--body",children:a.map((t,e)=>Qt.jsxs("label",{children:[Qt.jsx(i.Input,{type:"radio",name:r,checked:Number(n)===e,onChange:()=>o(e),disabled:s}),t]},e))})]})},t.ScrollContainer=function({children:t,hasMaxWidth:e=!0}){return Qt.jsx(_l,{hasMaxWidth:e,children:Qt.jsx("div",{className:"scroll--content",children:t})})},t.TabControl=function({children:t,isMultine:r=!1,className:n="",classNameContent:o="",innerRef:i,...a}){const[s,u]=e.useState([]),l=e.useCallback(t=>{u(e=>{const r=e.findIndex(e=>e.id==(null==t?void 0:t.id));return-1==r?e.push({...bl,...t}):e[r]={...e[r],...t},e.some(t=>t.isVisible&&t.isOpen)||(void 0===(null==t?void 0:t.isVisible)||(null==t?void 0:t.isVisible)?Al(e):function(t,e){let r=t.findIndex(t=>t.id==e.id),n=!1;t.forEach(t=>{t.isOpen=!1});for(let o=r-1;o>=0;o-=1){const e=t[o];if((null==e?void 0:e.isVisible)&&!n){n=!0,e.isOpen=!0;break}}n||Al(t)}(e,t)),[...e]})},[]),c=e.useCallback(t=>{u(e=>e.filter(e=>e.id!=t))},[]),h=e.useCallback(t=>{u(e=>e.map(e=>e.id==t?{...e,isOpen:!0}:{...e,isOpen:!1}))},[]),f=e.useCallback(t=>{u(e=>e.map(e=>e.id==t?{...e,isOpen:!e.isOpen}:e))},[]),d=e.useCallback(t=>s.find(e=>e.id==t),[s]),p=e.useCallback(()=>{u(t=>{const e=t.map(t=>({...t})),r=e.findIndex(t=>t.isVisible&&t.isOpen);return r<0?Al(e):e.forEach((t,e)=>t.isOpen=e==r),e})},[]);return e.useEffect(()=>{function t(){window.innerWidth>=768&&p()}return window.addEventListener("resize",t,null),()=>{window.removeEventListener("resize",t,null)}},[p]),e.useImperativeHandle(i,()=>({open(t){const e=d(t);e&&(null==e?void 0:e.isVisible)&&h(t)}}),[h,d]),Qt.jsx(Cl.Provider,{value:{tabs:s,updateOrInsertTab:l,removeTab:c,findTab:d,selectTab:h,toggleTab:f},children:Qt.jsxs("div",{className:`tab-control--container ${n}`,...a,children:[Qt.jsx(Il,{isMultine:r}),Qt.jsx("div",{className:`tab-control--content ${o}`,children:t})]})})},t.TabSheet=function({tabId:t,title:n,caption:o,isVisible:i=!0,children:a,...s}){const{findTab:u,toggleTab:l,removeTab:c,updateOrInsertTab:h}=El(),f=e.useMemo(()=>t||r.random(999999),[]),d=u(f);return e.useEffect(()=>()=>c(f),[]),e.useEffect(()=>{h({id:f,caption:o,title:n,isVisible:i})},[h,n,o,i]),i?Qt.jsxs(Sl,{open:(null==d?void 0:d.isOpen)&&(null==d?void 0:d.isVisible),"data-in-tab-sheet":null!=d?"true":"false",...s,children:[Qt.jsx("div",{className:"bi-btn-area",children:Qt.jsxs("button",{type:"button",onClick:()=>l(f),children:[n," ",Qt.jsx("i",{className:"fas fa-chevron-down"})]})}),Qt.jsx("div",{className:`bi-body ${(null==d?void 0:d.isOpen)&&"bi-open"}`,children:a})]}):null},t.Table=function({colunas:e,acoes:n,opcoes:o,dados:a,alignTop:s,colorir:u=!0,border:l=!0,sizeBreak:c=767,msgSemDados:h="Nenhum registro encontrado!",getLineColor:f,onClick:d,fixedHeader:p,clickCanEdit:g,loading:m}){var v,y;e&&e.forEach(t=>{!t.tipo||"money"!=t.tipo&&"currency"!=t.tipo||(t.money=!0)}),void 0===g&&(g=t.hasTableLineClick);let _=!1;const w=(null==(v=null==n?void 0:n.acoes)?void 0:v.map(t=>({...t})))||[];if(n&&n.acoes){const t=null==(y=null==n?void 0:n.acoes)?void 0:y.filter(t=>t.ativa??!0);n.acoes=t,_=n.acoes.length>0}function b(t){const e=window.getSelection();if(e.rangeCount>0){const r=e.getRangeAt(0);if(t.contains(r.commonAncestorContainer)&&e.toString().length>0)return!0}return!1}return m?Qt.jsxs("div",{children:[Qt.jsx(i.Spinner,{size:"sm",color:"info"})," Carregando..."]}):a&&0!=a.length?Qt.jsx(le,{children:Qt.jsxs(ce,{alignTop:s,sizeBreak:c,hasBorder:l,children:[Qt.jsx(pe,{fixedHeader:p,colunas:e,incColActions:_}),Qt.jsx(ge,{colunas:e,acoes:n,dados:a,opcoes:o,colorir:u,getLineColor:f,onClick:d||g?function(t,e){if(d){if(b(null==e?void 0:e.currentTarget))return;d(t,e)}else if(g&&r.isDesktop()){if(b(null==e?void 0:e.currentTarget))return;const r=t[(null==n?void 0:n.campo)||"id"];if(null!=r){const e=w[0];e&&!1!==e.ativa&&e.funcao(r,t,0)}}}:void 0})]})}):Qt.jsx("div",{className:"alert alert-warning mb-0",children:h})},t.TextHtml=function({value:t}){return t&&"string"==typeof t&&t.replaceAll("\n","<br/>"),Qt.jsx("span",{dangerouslySetInnerHTML:{__html:t}})},t.Toggle=function({name:t,checked:e,disabled:r,onChange:n,children:o,toRight:i,className:a="",...s}){return Qt.jsx(yl,{checked:e,disabled:r,className:a,...s,children:Qt.jsxs("label",{style:{flexDirection:i?"row-reverse":"row",justifyContent:i?"space-between":"flex-start"},children:[Qt.jsx("div",{className:"form-switch",children:Qt.jsx("input",{disabled:r,type:"checkbox",className:"form-check-input",checked:e,onChange:function(){!r&&n&&n({target:{name:t,checked:!e,value:!e}})}})}),o&&Qt.jsx("span",{className:"title",children:o})]})})},t.cache=Ze,t.createApiConfig=function(t=ue){const e={...ue,...t};return e.auth={...ue.auth,...t.auth},e},t.createDropdownItems=je,t.createMenuOptions=function(t){return t},t.createTableActions=t=>t,t.createTableCols=t=>t,t.createTableOptions=t=>t,t.getAlign=de,t.getDataCol=fe,t.setRouteMain=function(t){We=t},t.setTableLineClick=function(e){t.hasTableLineClick=e},t.useApi=or,t.useLibContext=ee,t.useLocalForage=function(t,r,n=1){const[o,i]=e.useState(r);return e.useEffect(()=>{xl.getItem(t).then(e=>{e&&(e.versao==n?i(e.data):xl.removeItem(t))})},[]),e.useEffect(()=>{xl.setItem(t,{versao:n,data:o})},[o]),[o,i]},t.useLocalStorage=Ol,t.useParamId=function(){let t=0,e=a.useParams();return e&&e.id&&(t=parseInt(e.id)),t},t.useQuery=function(){const{search:t}=a.useLocation();return e.useMemo(()=>new URLSearchParams(t),[t])},t.useSessionStorage=function(t,r){const[n,o]=e.useState(()=>{const e=sessionStorage.getItem(t);return e&&"undefined"!==e&&"null"!==e&&""!==e?JSON.parse(e):r});return e.useEffect(()=>{sessionStorage.setItem(t,JSON.stringify(n))},[n]),[n,o]},Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})});
|
|
960
|
+
`;function Rl({opc:t,closeMenu:e,clickGroup:r,clickFavorite:n,isFavorite:o,enabledFavorite:i}){var a;const{versionApp:s}=ee();if((null==(a=t.menus)?void 0:a.length)>0)return Qt.jsxs(Qt.Fragment,{children:[Qt.jsxs(Tl,{onClick:()=>r(t),isOpen:t.open,children:[Qt.jsx("span",{className:"opc",style:{color:t.isFavorite?"var(--nav-icon-sair)":"var(--bs-body-color) !important"},children:t.caption}),Qt.jsx("span",{className:"icon",children:Qt.jsx("i",{className:"fa-solid fa-chevron-down"})})]}),Qt.jsx("div",{className:"opt-group "+(t.open?"opt--open":"opt--close"),children:t.menus.map((t,a)=>Qt.jsx(Rl,{opc:t,closeMenu:e,clickGroup:r,clickFavorite:n,isFavorite:o,enabledFavorite:i},a))})]});if(t.route){let r=o(t.route),a=null==t?void 0:t.version;return a&&(a=Boolean(s.substring(0,a.length)===a)),Qt.jsxs(Nl,{to:t.route,onClick:e,children:[Qt.jsx("span",{className:"menu-icon",children:t.icon}),Qt.jsx("span",{className:"menu-caption",children:t.caption}),Qt.jsxs("span",{className:"menu-fav-new",children:[a&&Qt.jsx("span",{className:"menu-new",children:"novo"}),i&&Qt.jsx("span",{className:"menu-fav",onClick:e=>n(e,t),children:Qt.jsx("i",{title:"Clique para favoritar esta opção",className:"fa-"+(r?"solid":"regular")+" fa-heart",style:{color:r?"var(--nav-icon)":"var(--nav-icon-fav)"}})})]})]})}return(null==t?void 0:t.isLine)?Qt.jsx(kl,{}):null}const Dl="sys/nav/closed";const Pl=({routes:t,closeMenu:e,brand:r})=>Qt.jsx("div",{className:"navbar-mu--brand",children:Qt.jsx(a.Link,{to:t.home,onClick:e,className:"brand",title:"Voltar para tela inicial",children:r})});function Ml({isOpen:t,setIsOpen:e,menuClose:r}){return Qt.jsx("button",{className:"btn-menu",title:"Abrir menu de opções",onClick:()=>e(!t),children:r?Qt.jsx("i",{className:"fa-solid fa-xmark icon-close"}):Qt.jsxs("div",{className:"icon-desk",children:[Qt.jsx("span",{}),Qt.jsx("span",{}),Qt.jsx("span",{})]})})}const Bl="sys/nav/closed";t.Alerta=se,t.Aviso=function({onConfirm:t,text:e="",children:r}){return Qt.jsx(ae,{type:ne,title:"Aviso!",text:e,onConfirm:t,children:r})},t.BotaoClonar=function({title:t="Clonar o registro"}){return Qt.jsx(i.Button,{size:"sm",color:"warning",title:t,children:Qt.jsx(we,{})})},t.BotaoEditar=function({title:t="Alterar o registro"}){return Qt.jsx(i.Button,{size:"sm",color:"primary",title:t,children:Qt.jsx(Ee,{})})},t.BotaoExcluir=function({title:t="Excluir o registro"}){return Qt.jsx(i.Button,{size:"sm",color:"danger",title:t,children:Qt.jsx(Ie,{})})},t.BotaoIncluir=function({caption:t="Incluir",onClick:e,...r}){return Qt.jsxs(i.Button,{color:"success",title:"Incluir um novo registro",onClick:e,...r,children:[Qt.jsx(Ae,{})," ",t]})},t.BotaoSalvar=function({loading:t,saveInfo:e,link:r,fixed:n,modalFixed:o,btnSaveDisabled:s,onCancel:u,onConfirm:l}){const c=a.useHistory();return Qt.jsxs("div",{className:"botao-salvar--area","data-fixed":Boolean(n),"data-modal-fixed":Boolean(o),children:[Qt.jsxs(i.Button,{type:l?"button":"submit",color:"primary",onClick:l,disabled:s&&1==s,children:[Qt.jsx("i",{className:"fas fa-cloud-upload-alt"}),t||(null==e?void 0:e.loading)?"Salvando...":"Salvar"]}),Qt.jsxs(i.Button,{type:"button",color:"outline-danger",onClick:()=>{u?u():r?c.push(r):c.goBack()},children:[Qt.jsx("i",{className:"fas fa-times"}),"Cancelar"]})]})},t.BoxColor=function({corFonte:t,setCorFonte:e,corFundo:r,setCorFundo:n}){return Qt.jsxs("div",{className:"box-color--container",children:[Qt.jsx(ke,{label:"Cor da fonte",value:t,onChange:t=>e(t.target.value)}),Qt.jsx(ke,{label:"Cor de fundo",value:r,onChange:t=>n(t.target.value)}),Qt.jsx("div",{className:"box-color-texto",style:{color:t,backgroundColor:r},children:"Texto de exemplo"})]})},t.BoxInfo=function({id:t,title:r,isOpen:n=!1,isVisible:o=!0,onChange:i,noMargin:a,children:s,...u}){const[l,c]=e.useState(n);return e.useEffect(()=>{t&&i&&i(t,l)},[l]),o?Qt.jsxs(Re,{open:l,noMargin:a,...u,children:[Qt.jsx("div",{className:"bi-btn-area",children:Qt.jsxs("button",{type:"button",onClick:()=>c(!l),children:[r," ",Qt.jsx("i",{className:"fas fa-chevron-down setas-bi"})]})}),Qt.jsx("div",{className:`bi-body ${l&&"bi-open"}`,children:s})]}):null},t.BoxSearch=ul,t.ButtonBack=Be,t.ButtonClose=Pe,t.ButtonHelp=Me,t.ButtonOptions=function({value:t,setValue:e,options:r=[],...n}){return Qt.jsx("div",{className:"btn-opts--container btn-group",...n,children:r.map((r,n)=>Qt.jsx(i.Button,{active:n===t,color:"outline-info",onClick:()=>e(n),children:r},n))})},t.ButtonTop=function({smooth:t,center:r}){const[n,o]=e.useState(!1);function i(){var t;o((null==(t=document.querySelector("main"))?void 0:t.scrollTop)>0)}return e.useEffect(()=>{var t;return null==(t=document.querySelector("main"))||t.addEventListener("scroll",i),()=>{var t;null==(t=document.querySelector("main"))||t.removeEventListener("scroll",i)}},[]),Qt.jsx(Qt.Fragment,{children:n&&Qt.jsx(Le,{title:"Ir para o início da tela",visible:i,onClick:function(){var e;null==(e=document.querySelector("main"))||e.scrollTo({top:0,left:0,behavior:t?"smooth":"instant"}),o(!1)},className:"pulsate-bck",center:r,children:Qt.jsx("i",{className:"fa-solid fa-arrow-up"})})})},t.CheckBox=function({enabled:t=!0,onChange:e,children:r,...n}){const o=n.disabled||!t;return Qt.jsx(xs,{disabled:o,children:Qt.jsxs("label",{children:[Qt.jsx(i.Input,{type:"checkbox",disabled:o,onChange:t=>{if(e){let r={...t,target:{...t.target,name:t.target.name,value:t.target.checked}};e(r)}},checked:"boolean"==typeof n.value?n.value:n.checked,...n}),r]})})},t.CheckUpdates=function(){const t=e.useRef();function r(e){var r,n;(null==t?void 0:t.current)&&(e?null==(r=t.current)||r.classList.add("update-show"):null==(n=t.current)||n.classList.remove("update-show"))}return e.useLayoutEffect(()=>{"serviceWorker"in navigator&&window.location.origin.startsWith("http")&&navigator.serviceWorker.getRegistration().then(t=>{t&&(t.addEventListener("updatefound",()=>{r(!0);const e=t.installing;e.addEventListener("statechange",()=>{"installed"==e.state&&setTimeout(()=>window.location.reload(!0),1e3),"activated"==e.state&&r(!1)})}),t.update())}).catch(t=>{console.error("=> Service Worker não encontrado:",t)})},[]),Qt.jsx("div",{className:"update-check-box",onClick:function(){r(!1)},children:Qt.jsxs("div",{ref:t,className:"update-box",children:[Qt.jsx("div",{className:"update-line"}),Qt.jsx("div",{className:"spinner-border text-warning w-22",role:"status",children:Qt.jsx("span",{className:"visually-hidden",children:"Carregando..."})}),"Nova versão disponível, atualizando..."]})})},t.ClipboardArea=function({title:t,url:r,timerInMilliSeconds:n=5e3}){const[o,i]=e.useState(!1);return e.useEffect(()=>()=>{Fe&&clearTimeout(Fe)},[]),Qt.jsxs("div",{className:`clipboard-area--container ${o&&" clip-active"}`,children:[Qt.jsx("a",{href:r,target:"_blank",rel:"noreferrer",title:"Abrir este link",children:t||r}),Qt.jsx("button",{type:"button",className:"clip-mark",onClick:function(){navigator.clipboard.writeText(r),i(!0),Fe=setTimeout(()=>i(!1),n)},children:o?Qt.jsxs(Qt.Fragment,{children:[Qt.jsx("i",{className:"fas fa-clipboard-check"}),"Copiado"]}):Qt.jsxs(Qt.Fragment,{children:[Qt.jsx("i",{className:"fas fa-clipboard"}),"Copiar"]})})]})},t.Confirma=function({onConfirm:t,onCancel:e,text:r="",children:n,defaultBtn:o}){return Qt.jsx(ae,{type:oe,title:"Confirmação!",text:r,onConfirm:t,onCancel:e,defaultBtn:o,children:n})},t.DataItem=function({caption:t,colored:e,isForm:r=!1,children:n,className:o,...i}){return Qt.jsxs("div",{className:"di-box "+o,...i,children:[t&&Qt.jsx("label",{style:{fontWeight:r?"bold":"normal"},children:t}),r?Qt.jsx("input",{className:"form-control",value:n,readOnly:!0}):Qt.jsx("div",{style:{color:e?"var(--data-item-destaque)":"var(--body-color)"},className:"fw-bold",children:n})]})},t.DropDownButton=he,t.DynamicCounter=function({valor:t=0,time:n=25,format:o,currency:i}){const[a,s]=e.useState(0);return e.useEffect(()=>{const e=setInterval(()=>{const r=Math.ceil(t/10)+1;s(n=>{let o=n+r;return o>t&&(o=t),o===t&&clearInterval(e),o})},n);return()=>clearInterval(e)},[t,n]),o?r.formatValor(a,i?2:0,Boolean(i)):a},t.FormDesk=function({children:t,labelWidth:e=100,sizeBreak:r=767,lineShortWidth:n=250,gap:o="8px",...i}){return Qt.jsx(gl,{style:{"--form-desk-label-width":`${e}px`,"--form-desk-line-short-width":`${n}px`,"--form-desk-gap":o},sizeBreak:r,...i,children:t})},t.FormDeskGrid=function({grid:t,gap:e=25,className:r="",children:n,...o}){return Qt.jsx("div",{className:`form-desk--grid ${r}`,style:{gridTemplateColumns:t,gap:e},...o,children:n})},t.FormDeskLine=function({children:t,label:e="",isShort:r=!1,className:n="",classNameLabel:o="",classNameCol:i="",extraComp:a,inpWidth:s,...u}){const l={};return s&&(l["--form-desk-line-short-width"]=s),Qt.jsxs("div",{className:`form-desk-line ${n}`,"data-has-extra-comp":a?"true":"false",...u,style:{...u.styles,...l},children:[Qt.jsx("label",{className:`form-desk-label ${o}`,children:e}),Qt.jsx("div",{className:i,"data-is-line-short":String(r),children:t}),a&&Qt.jsx("div",{className:"my-auto",children:a})]})},t.FormEdit=function({title:t,count:r,codigo:n,maxWidth:o=1200,goBack:i,goHome:a,onClose:s,helpLink:u,children:l}){return e.useEffect(()=>{var t;null==(t=document.querySelector("main"))||t.scrollTo(0,0)},[]),Qt.jsx("div",{className:"mx-auto",style:{maxWidth:o},children:Qt.jsx(Ge,{title:t,count:r,codigo:n,goBack:i,goHome:a,onClose:s,helpLink:u,children:l})})},t.FormEnter=function({children:t}){const r=e.useRef(),n=(t,e)=>{let r=t[e];for(;e<t.length-1&&(r=t[++e],r.disabled););return r};return Qt.jsx("form",{onSubmit:function(t){t.preventDefault()},ref:r,onKeyDown:function(t){var e,o;if("Enter"===t.key){const i=null==(e=null==r?void 0:r.current)?void 0:e.querySelector(".form-item:focus,.btn-primary"),a=null==(o=null==r?void 0:r.current)?void 0:o.querySelectorAll(".form-item,.btn-primary");for(let e=0;e<a.length;e++)if(a[e]===i&&e<a.length-1){t.preventDefault();const r=n(a,e);(null==r?void 0:r.select)&&r.select(),r.focus()}}},children:t})},t.FormatData=({value:t="",incHour:e=!0})=>{let r="";if(t){let n,o;-1!==t.indexOf("T")?(n=t.split("T"),o=n[1],n=n[0]):(n=t.split(" "),n.length>1&&(o=n[1]),n=n[0]),-1!==n.indexOf("-")&&(n=n.split("-").reverse().join("/")),o&&e&&(n=n+" "+o),r=n}return r},t.FormatPercent=({value:t=0,decimalScale:e=2,...r})=>Qt.jsx("span",{...r,children:Intl.NumberFormat("pt-br",{maximumFractionDigits:e,minimumFractionDigits:e,style:"decimal"}).format(Os(t))+"%"}),t.FormatQuant=({value:t=0,decimalScale:e=2,...r})=>Qt.jsx("span",{...r,children:Intl.NumberFormat("pt-br",{maximumFractionDigits:e,minimumFractionDigits:e,style:"decimal"}).format(Os(t))}),t.FormatValor=({value:t=0,money:e=!0,decimalScale:r=2,...n})=>Qt.jsx("span",{...n,children:Intl.NumberFormat("pt-br",{maximumFractionDigits:r,minimumFractionDigits:r,style:e?"currency":"decimal",currency:"BRL"}).format(Os(t))}),t.GroupBox=function({label:t,className:e="",children:r}){return Qt.jsxs("div",{className:`group-box--container ${e}`,children:[Qt.jsx("div",{className:"group-box--label",children:t}),Qt.jsx("div",{className:"group-box--body",children:r})]})},t.Hint=function({title:t="Ajuda",children:e}){return Qt.jsxs("div",{className:"hint--container",children:[Qt.jsx("i",{className:"fas fa-question"}),Qt.jsxs("div",{className:"hint-content",children:[Qt.jsx("div",{className:"title",children:t}),e]})]})},t.IconClose=Ve,t.IconExitOutline=function(t){return Qt.jsx("svg",{viewBox:"0 0 512 512",fill:"currentColor",height:"1em",width:"1em",...t,children:Qt.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:32,d:"M320 176v-40a40 40 0 00-40-40H88a40 40 0 00-40 40v240a40 40 0 0040 40h192a40 40 0 0040-40v-40M384 176l80 80-80 80M191 256h273"})})},t.IconMenu=Ue,t.IconUserGear=function(t){return Qt.jsx("svg",{viewBox:"0 0 640 512",fill:"currentColor",height:"1em",width:"1em",...t,children:Qt.jsx("path",{d:"M224 256c-70.7 0-128-57.3-128-128S153.3 0 224 0s128 57.3 128 128-57.3 128-128 128zm-45.7 48h91.4c11.8 0 23.4 1.2 34.5 3.3-2.1 18.5 7.4 35.6 21.8 44.8-16.6 10.6-26.7 31.6-20 53.3 4 12.9 9.4 25.5 16.4 37.6s15.2 23.1 24.4 33c15.7 16.9 39.6 18.4 57.2 8.7v.9c0 9.2 2.7 18.5 7.9 26.3H29.7C13.3 512 0 498.7 0 482.3 0 383.8 79.8 304 178.3 304zM436 218.2c0-7 4.5-13.3 11.3-14.8 10.5-2.4 21.5-3.7 32.7-3.7s22.2 1.3 32.7 3.7c6.8 1.5 11.3 7.8 11.3 14.8v30.6c7.9 3.4 15.4 7.7 22.3 12.8l24.9-14.3c6.1-3.5 13.7-2.7 18.5 2.4 7.6 8.1 14.3 17.2 20.1 27.2s10.3 20.4 13.5 31c2.1 6.7-1.1 13.7-7.2 17.2l-25 14.4c.4 4 .7 8.1.7 12.3s-.2 8.2-.7 12.3l25 14.4c6.1 3.5 9.2 10.5 7.2 17.2-3.3 10.6-7.8 21-13.5 31s-12.5 19.1-20.1 27.2c-4.8 5.1-12.5 5.9-18.5 2.4L546.3 442c-6.9 5.1-14.3 9.4-22.3 12.8v30.6c0 7-4.5 13.3-11.3 14.8-10.5 2.4-21.5 3.7-32.7 3.7s-22.2-1.3-32.7-3.7c-6.8-1.5-11.3-7.8-11.3-14.8v-30.6c-8-3.4-15.6-7.7-22.5-12.9l-24.7 14.3c-6.1 3.5-13.7 2.7-18.5-2.4-7.6-8.1-14.3-17.2-20.1-27.2s-10.3-20.4-13.5-31c-2.1-6.7 1.1-13.7 7.2-17.2l24.8-14.3c-.4-4.1-.7-8.2-.7-12.4s.2-8.3.7-12.4L343.8 325c-6.1-3.5-9.2-10.5-7.2-17.2 3.3-10.6 7.7-21 13.5-31s12.5-19.1 20.1-27.2c4.8-5.1 12.4-5.9 18.5-2.4l24.8 14.3c6.9-5.1 14.5-9.4 22.5-12.9v-30.4zm92.1 133.5c0-26.5-21.5-48-48.1-48s-48.1 21.5-48.1 48 21.5 48 48.1 48 48.1-21.5 48.1-48z"})})},t.IconeChevron=()=>Qt.jsx("i",{className:"fas fa-chevron-down"}),t.IconeClonar=()=>Qt.jsx("i",{className:"fa-solid fa-copy"}),t.IconeConfig=()=>Qt.jsx("i",{className:"fas fa-cogs"}),t.IconeEditar=Ee,t.IconeEmail=()=>Qt.jsx("i",{className:"fas fa-envelope"}),t.IconeEncerrarAno=()=>Qt.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Qt.jsx("path",{d:"M8.875 17.375C7.43258 17.375 6.10606 17.0466 4.89545 16.3898C3.68485 15.733 2.69318 14.8572 1.92045 13.7625V15.8295H0.375V11.1932H5.01136V12.7386H3.09886C3.71705 13.6659 4.53176 14.4129 5.543 14.9795C6.55373 15.5462 7.66439 15.8295 8.875 15.8295C9.84091 15.8295 10.7458 15.6462 11.5896 15.2794C12.4329 14.9121 13.167 14.416 13.7919 13.7911C14.4162 13.1667 14.9121 12.4326 15.2794 11.5888C15.6462 10.7455 15.8295 9.84091 15.8295 8.875H17.375C17.375 10.047 17.153 11.1481 16.7089 12.1784C16.2643 13.2087 15.6557 14.1102 14.883 14.883C14.1102 15.6557 13.2087 16.2641 12.1784 16.7081C11.1481 17.1527 10.047 17.375 8.875 17.375ZM8.17955 14.2841V13.2795C7.57424 13.1379 7.08176 12.8772 6.70209 12.4975C6.32191 12.1174 6.04167 11.6182 5.86136 11L7.13636 10.4977C7.29091 11.0258 7.53251 11.4217 7.86118 11.6854C8.18933 11.9497 8.56591 12.0818 8.99091 12.0818C9.41591 12.0818 9.77961 11.9819 10.082 11.782C10.3849 11.5826 10.5364 11.2705 10.5364 10.8455C10.5364 10.472 10.3787 10.1693 10.0635 9.9375C9.74767 9.70568 9.18409 9.44167 8.37273 9.14545C7.61288 8.875 7.056 8.55303 6.70209 8.17955C6.34767 7.80606 6.17045 7.31667 6.17045 6.71136C6.17045 6.18333 6.35411 5.70347 6.72141 5.27177C7.0882 4.84059 7.58712 4.56061 8.21818 4.43182V3.46591H9.57045V4.43182C10.0341 4.47045 10.456 4.6572 10.8362 4.99205C11.2158 5.32689 11.4765 5.7197 11.6182 6.17045L10.3818 6.67273C10.2788 6.37651 10.1114 6.12873 9.87955 5.92936C9.64773 5.72948 9.32576 5.62955 8.91364 5.62955C8.46288 5.62955 8.1185 5.72614 7.8805 5.91932C7.64198 6.1125 7.52273 6.37651 7.52273 6.71136C7.52273 7.04621 7.67083 7.31023 7.96705 7.50341C8.26326 7.69659 8.79773 7.92197 9.57045 8.17955C10.4977 8.51439 11.1159 8.9072 11.425 9.35795C11.7341 9.80871 11.8886 10.3045 11.8886 10.8455C11.8886 11.2189 11.8242 11.5473 11.6955 11.8307C11.5667 12.114 11.3962 12.3554 11.1839 12.5547C10.9712 12.7546 10.7231 12.9156 10.4398 13.0377C10.1564 13.1603 9.85379 13.2538 9.53182 13.3182V14.2841H8.17955ZM0.375 8.875C0.375 7.70303 0.597288 6.60189 1.04186 5.57159C1.48592 4.54129 2.09432 3.63977 2.86705 2.86705C3.63977 2.09432 4.54129 1.48567 5.57159 1.04109C6.60189 0.59703 7.70303 0.375 8.875 0.375C10.3174 0.375 11.6439 0.703409 12.8545 1.36023C14.0652 2.01705 15.0568 2.8928 15.8295 3.9875V1.92045H17.375V6.55682H12.7386V5.01136H14.6511C14.033 4.08409 13.2182 3.33712 12.207 2.77045C11.1963 2.20379 10.0856 1.92045 8.875 1.92045C7.90909 1.92045 7.00448 2.10385 6.16118 2.47064C5.31736 2.83794 4.58327 3.33377 3.95891 3.95814C3.33403 4.58301 2.83794 5.31711 2.47064 6.16041C2.10385 7.00423 1.92045 7.90909 1.92045 8.875H0.375Z",fill:"currentColor"})}),t.IconeExcluir=Ie,t.IconeFechar=xe,t.IconeFecharCircle=()=>Qt.jsx("i",{className:"fas fa-times-circle"}),t.IconeHelp=Oe,t.IconeIncluir=Ae,t.IconeLogin=()=>Qt.jsx("i",{className:"fas fa-sign-in-alt"}),t.IconeLogout=Ce,t.IconeMostrarSenha=({display:t})=>Qt.jsx("i",{className:"fas fa-eye"+(t?"-slash":"")}),t.IconeOpenLink=Te,t.IconePassword=()=>Qt.jsx("i",{className:"fas fa-key"}),t.IconePin=()=>Qt.jsx("i",{className:"fas fa-map-marker-alt"}),t.IconePrint=()=>Qt.jsx("i",{className:"fas fa-print"}),t.IconeQRCode=Ne,t.IconeSalvar=()=>Qt.jsx("i",{className:"fas fa-cloud-upload-alt"}),t.IconeSearchPlus=()=>Qt.jsx("i",{className:"fas fa-search-plus"}),t.IconeSoma=()=>Qt.jsx("svg",{width:"10",height:"13",viewBox:"0 0 10 13",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Qt.jsx("path",{d:"M0.898056 12.1914V10.6914L5.77306 6.19141L0.898056 1.69141V0.191406H9.89806V2.44141H4.47931L8.51056 6.19141L4.47931 9.94141H9.89806V12.1914H0.898056Z",fill:"currentColor"})}),t.IconeUsers=()=>Qt.jsx("i",{className:"fas fa-user-cog"}),t.IconeVisualizar=Se,t.Input=function({autoSelect:t,...e}){function r(r){e.onClick?e.onClick(r):t&&r.currentTarget.select()}switch(e.type){case"cpf":return Qt.jsx(ol,{onClick:r,...e});case"cnpj":return Qt.jsx(Zu,{onClick:r,...e});case"codigo":return Qt.jsx(rl,{name:e.name,onChange:e.onChange,onClick:r,...e});case"fone":return Qt.jsx(Rs,{name:e.name,onChange:e.onChange,value:e.value,onClick:r,...e});case"uf":return Qt.jsx(il,{onClick:r,...e});case"hora":return Qt.jsx(nl,{onClick:r,...e});case"percent":return Qt.jsx(el,{name:e.name,onChange:e.onChange,onClick:r,...e});case"quant":return Qt.jsx(tl,{name:e.name,onChange:e.onChange,onClick:r,...e});case"real":return Qt.jsx(Ju,{name:e.name,onChange:e.onChange,onClick:r,...e});case"finder":return Qt.jsx(ll,{onClick:r,...e});default:return Qt.jsx("input",{className:"form-control",onClick:r,...e})}},t.InputBox=function({children:t}){return Qt.jsx("div",{className:"jclib-ui-input-box",children:t})},t.InputCep=function({dados:t,setDados:r,onSearch:n,disabled:o,autoFocus:i,...a}){const[s,u]=e.useState(!1),c=async e=>{u(!0);const o=await(async(t,e)=>{let r={erro:!0,mensagem:"CEP deve ter 8 dígitos!"};if((t=t.replace(/\D+/g,""))&&8===t.length){const n=`https://viacep.com.br/ws/${t}/json`;try{r=await(await fetch(n,{mode:"cors"})).json()}catch{r={erro:!0,mensagem:"Não foi possível pesquisar este CEP!"}}finally{e&&e(r)}}return r})(e,n);!o.erro&&t&&r&&r({...t,ende:o.logradouro,bairro:o.bairro,cida:o.localidade,uf:o.uf}),u(!1)};return Qt.jsxs(Qt.Fragment,{children:[Qt.jsx(ks,{visible:s,message:"Buscando CEP..."}),Qt.jsxs("div",{className:"input-group",children:[Qt.jsx(l,{format:"##.###-###",mask:"_",value:a.value,className:"form-control",onValueChange:t=>function(t,e,r){r&&r({target:{name:e,value:t.formattedValue}})}(t,a.name,a.onChange),disabled:o,autoFocus:i}),Qt.jsx("button",{type:"button",className:"btn btn-info",onClick:()=>c(a.value),disabled:o,children:Qt.jsx("i",{className:"fas fa-search"})})]})]})},t.InputCheckBox=({disabled:t,children:e,name:r,checked:n,onChange:o})=>Qt.jsx(cl,{children:Qt.jsxs(hl,{disabled:t,onClick:function(){if(!t&&o){o({target:{name:r,checked:!n}})}},children:[Qt.jsxs("span",{children:[n&&Qt.jsx(me,{color:t&&"silver"}),!n&&Qt.jsx(ve,{color:t&&"silver"})]})," ",e]})}),t.InputCnpj=Zu,t.InputCodigo=rl,t.InputColor=ke,t.InputCpf=ol,t.InputCpfCnpj=function({onChange:t,value:e,name:r,className:n,...o}){return Qt.jsx(qu,{className:`form-control ${Bs(e)?"is-invalid":""} ${n||""}`,mask:Ku,onAccept:function(e){t({target:{name:r,value:e.toUpperCase()}})},value:e,name:r,...o})},t.InputEstado=il,t.InputFinder=({title:t,onFind:e,children:r,...n})=>Qt.jsxs("div",{className:"input-group",children:[Qt.jsxs("select",{className:"form-select",...n,children:[Qt.jsxs("option",{value:0,children:["- ",t," -"]}),r]}),Qt.jsx("button",{type:"button",title:"Pesquisar...",className:"btn btn-info",onClick:e,children:Qt.jsx(_e,{})})]}),t.InputFone=Rs,t.InputHora=nl,t.InputPassword=function({disabled:t,autoSelect:r,...n}){const[o,i]=e.useState(!1);return Qt.jsxs(fl,{disabled:t,children:[Qt.jsx("input",{type:o?"text":"password",disabled:t,onClick:function(t){n.onClick?n.onClick(t):r&&t.currentTarget.select()},...n}),Qt.jsx("i",{className:o?"fas fa-eye-slash":"fas fa-eye",onClick:()=>{t||i(!o)},title:t?"":(o?"Ocultar":"Exibir")+" a senha"})]})},t.InputPercent=el,t.InputPesquisa=rr,t.InputQRCode=function({value:t,setValue:r}){const[n,o]=e.useState(!1);return Qt.jsxs(Qt.Fragment,{children:[Qt.jsxs("div",{className:"input-group",children:[Qt.jsx(i.Input,{disabled:!0,placeholder:"Link para o documento de pagamento",title:"Link para o documento de pagamento",value:t}),Qt.jsx(i.Button,{color:"outline-secondary",title:"Limpar o campo",onClick:()=>r(""),children:Qt.jsx(be,{})}),Qt.jsx(i.Button,{color:"success-light",title:"Ler QRCode do documento",onClick:()=>o(!0),children:Qt.jsx(Ne,{})}),t?Qt.jsx(qe,{className:"btn btn-info",title:"Abrir o link do documento",to:t,children:Qt.jsx(Te,{})}):Qt.jsx(i.Button,{color:"info",disabled:!0,children:Qt.jsx(Te,{})})]}),n&&Qt.jsx(Ss,{setVisible:o,title:"Ler QRCode do documento",onResult:t=>r(null==t?void 0:t.text)})]})},t.InputQuant=tl,t.InputSearch=({title:t="Selecione",options:e=[],fields:r=[],btnClick:n=null,...o})=>Qt.jsxs("div",{className:"input-group",children:[Qt.jsxs("select",{className:"form-select",...o,children:[Qt.jsxs("option",{value:0,children:["- ",t," -"]}),null==e?void 0:e.map((t,e)=>Qt.jsx("option",{value:t[r[0]],children:t[r[1]]},e))]}),Qt.jsx("button",{type:"button",className:"btn btn-info",title:"Abrir tela de pesquisa",onClick:n,children:Qt.jsx(_e,{})})]}),t.InputValor=Ju,t.LabelHint=function({label:t,hint:e}){return Qt.jsxs("div",{className:"label-hint--container",children:[Qt.jsx("label",{children:t}),Qt.jsx("div",{className:"label-hint--icon",children:Qt.jsx("i",{className:"fas fa-question"})}),Qt.jsxs("div",{className:"label-hint--box",children:[Qt.jsx("div",{className:"label-hint--box-title",children:"Ajuda"}),e]})]})},t.LibProvider=({apiConfig:t,children:n,versionApp:o,useTheme:i})=>{const a=!(!i||"boolean"!=typeof i)&&i,[s,u]=e.useState(()=>{let t="";if(a){let e=localStorage.getItem(te);t=e||(r.isDarkMode()?"dark":"light")}return t}),[l,c]=Sl("sys/reportType",0),[h,f]=e.useState([]),[d,p]=e.useState(!1),g=t=>{let e=h.find(e=>e.modalId===t);e&&e.setVisible(!1),f(e=>e.filter(e=>e.modalId!==t))},m=e.useCallback(t=>{"Escape"===t.key&&0!=h.length&&g(h[h.length-1].modalId)},[h]);return e.useEffect(()=>{("localhost"==window.location.hostname||"127.0.0.1"==window.location.hostname||"[::1]"==window.location.hostname||window.location.hostname.startsWith("192.168."))&&!document.title.includes(" ⭕ ")&&(document.title=`${document.title} ⭕ `)},[]),e.useEffect(()=>{a&&(localStorage.setItem(te,s),document.body.dataset.bsTheme="dark"==s?s:"")},[s,a]),e.useEffect(()=>(window.addEventListener("keydown",m,!1),()=>window.removeEventListener("keydown",m,!1)),[h]),Qt.jsx(Jt.Provider,{value:{versionApp:o,addModal:(t,e)=>{f(r=>{let n=[...r],o=n.findIndex(e=>e.modalId===t);return o>=0?n[o]={modalId:t,setVisible:e}:n.push({modalId:t,setVisible:e}),n})},removeModal:g,clearModals:()=>{h.forEach(t=>{g(t.modalId)})},showBtnTop:d,setShowBtnTop:p,globalApiConfig:t,theme:s,setTheme:u,toggleTheme:()=>u("dark"==s?"light":"dark"),canChangeTheme:a,reportType:l,setReportType:c},children:n})},t.LinkToEmail=Ye,t.LinkToFone=function({href:t,children:e,...r}){const n=String(t||e);let o="+";return(null==n?void 0:n.startsWith("+"))||(o="+55"),o+=n.replace(/\D/g,""),Qt.jsx("a",{href:`tel:${o}`,title:"Ligar para este número",...r,children:e||t})},t.LinkToMaps=function({href:t,children:e,...r}){let n=`https://google.com/maps/place/${null==t?void 0:t.replace(" ","+")}`;return(null==t?void 0:t.includes("/maps/place/"))&&(null==t?void 0:t.startsWith("https"))&&(n=t),Qt.jsx("a",{href:n,target:"_blank",rel:"noreferrer",title:"Localizar este endereço",...r,children:e})},t.LinkToNewPage=qe,t.LinkToWhatsApp=$e,t.Loading=ks,t.LoadingReport=function({url:t,file:e,fileTo:r,loading:n=!0,setLoading:o}){if(!n)return null;let[,i]=e.split("."),[a,s]=r.split(".");return s!=i&&(r=[a,i].join(".")),Qt.jsx(er,{url:t,file:e,fileTo:r,setLoading:o})},t.Modal=ir,t.ModalBody=ar,t.ModalBox=function({visible:t,setVisible:e,codigo:r,title:n,children:o,alignTop:i,paddingBottom:a=10,helpLink:s,count:u,...l}){return t?Qt.jsxs(ir,{alignTop:i,setVisible:e,visible:t,...l,children:[Qt.jsxs(ur,{helpLink:s,setVisible:e,children:[n,null!=u&&Qt.jsxs(Qt.Fragment,{children:[" ",Qt.jsx(ze,{value:u,isCount:!0})]}),Qt.jsx(ze,{value:r})]}),Qt.jsx(sr,{children:Qt.jsx(ar,{style:{paddingBottom:a},children:o})})]}):null},t.ModalContent=sr,t.ModalFilter=function({title:t="Filtros",setVisible:e,maxWidth:r,fnApplyFilter:n,children:o,alignTop:a,helpLink:s}){return Qt.jsxs(ir,{alignTop:a,maxWidth:r,setVisible:e,visible:!0,children:[Qt.jsx(ur,{helpLink:s,setVisible:e,children:t}),Qt.jsx(sr,{children:Qt.jsxs(ar,{className:"mod-filter--container",children:[o,Qt.jsxs("div",{className:"mod-filter--btn-area",children:[Qt.jsxs(i.Button,{block:!0,color:"primary",onClick:()=>{n&&n(!0)},children:[Qt.jsx(ye,{})," Aplicar filtros"]}),Qt.jsxs(i.Button,{block:!0,color:"outline-danger",onClick:()=>{n&&n(!1)},children:[Qt.jsx(xe,{})," Cancelar filtros"]})]})]})})]})},t.ModalFooter=function({className:t="",backgroundColor:e="",...r}){return Qt.jsx("div",{className:`modal--footer ${t}`,style:{backgroundColor:e},...r})},t.ModalHeader=ur,t.Navbar=function({menusConfig:{brand:t,company:n,menus:o,routes:i,user:s,validatePermis:u},helpLink:l}){const c=a.useHistory(),h=e.useRef(),f=e.useRef(),{theme:d,setTheme:p,canChangeTheme:g}=ee(),[m,v]=e.useState(!1),[y,_]=e.useState(""),[w,b]=e.useState([]),[C,A]=e.useState([]);let E=[];const I=localStorage.getItem(Dl);I&&(E=JSON.parse(I));const[S]=Je({url:i.apiFavorites,onTerminated:t=>{t.error?console.info("Erro ao obter lista de favoritos!",t.error):A(t.data)}}),[x]=Je({url:i.apiFavorites,method:"patch",onTerminated:t=>{t.error&&console.info("Erro ao salvar favoritos!",t.error)}});function O(){v(!1)}function T(t){let e=[...w],r=[];e.forEach(e=>{e===t&&(e.open=!e.open),e.open||r.push(e.caption)}),localStorage.setItem(Dl,JSON.stringify(r)),b(e)}function N(t){let e=[...w];e.forEach(e=>{(null==e?void 0:e.menus)&&((null==e?void 0:e.stayOpen)?e.open=e.stayOpen:e.open=t)}),b(e),T(null)}function k(t,e){t.stopPropagation(),t.preventDefault();const r=C.filter(t=>t.route!==e.route);var n;r.length===C.length&&r.push({caption:((null==e?void 0:e.prefix)?e.prefix+" / ":"")+e.caption,route:e.route}),n=r,i.apiFavorites&&(x({data:n}),A(n))}function R(t){return C.some(e=>e.route===t)}return e.useEffect(()=>{i.apiFavorites&&S()},[]),e.useEffect(()=>{let t=[];null==C||C.forEach(e=>{o.forEach((r,n)=>{var o;if(n>0&&0!==(null==(o=null==r?void 0:r.menus)?void 0:o.length)){let o=r.menus.findIndex(t=>t.route===e.route);if(o>=0){let i=r.menus[o];t.push({...i,caption:e.caption,index:String(n).padStart(2,"0")+String(o).padStart(2,0)})}}})}),"Favoritos"===o[0].caption&&(o[0].menus=t.sort((t,e)=>t.index>e.index?1:t.index<e.index?-1:0)),b(function(t){let e=[];return t.forEach(t=>{let r={caption:t.caption,open:!E.includes(t.caption)||t.stayOpen,stayOpen:t.stayOpen,isFavorite:null==t?void 0:t.isFavorite,prefix:null==t?void 0:t.prefix,menus:[]};t.menus&&t.menus.length>0&&t.menus.filter(t=>{var e;return(null==t?void 0:t.isLine)||!(null==t?void 0:t.isLine)&&(t.caption.toLowerCase().includes(y.toLowerCase())||(null==(e=t.shortcut)?void 0:e.toLowerCase().includes(y.toLowerCase())))}).forEach(t=>{u(null==t?void 0:t.permis,null==t?void 0:t.acesso)&&r.menus.push({...t,prefix:null==r?void 0:r.prefix})}),y&&(r.open=!0),e.push(r)}),e.forEach(t=>{var e;t.menus&&((null==(e=t.menus[0])?void 0:e.isLine)&&(t.menus=t.menus.filter(t=>!(null==t?void 0:t.isLine))),t.menus=t.menus.filter((t,e,r)=>{var n;return!(e>0&&(null==(n=r[e-1])?void 0:n.isLine)&&t.isLine)}),t.menus=t.menus.filter((t,e,r)=>!(e===r.length-1&&(null==t?void 0:t.isLine))))}),e}(o))},[y,C]),e.useEffect(()=>{var t,e;r.isDesktop()&&(null==(t=null==h?void 0:h.current)||t.focus(),null==(e=null==h?void 0:h.current)||e.select())},[m]),Qt.jsxs(Qt.Fragment,{children:[Qt.jsx("div",{className:"navbar--area",children:Qt.jsxs("div",{className:"navbar-content",children:[Qt.jsx("button",{className:"btn-menu"+(m?" opened":""),title:"Abrir menu de opções",onClick:()=>v(!m),children:m?Qt.jsx(Ve,{width:20,height:20}):Qt.jsx(Ue,{width:20,height:20})}),Qt.jsxs("div",{className:"content",children:[Qt.jsx(a.Link,{to:i.home,className:"brand",onClick:O,title:"Voltar para tela inicial",children:t}),Qt.jsxs("div",{className:"company",children:[Qt.jsx("div",{className:"name",children:n}),Qt.jsxs("div",{className:"doc",children:[Qt.jsxs("span",{children:[null==s?void 0:s.title," "]}),Qt.jsx("strong",{children:null==s?void 0:s.name})]})]}),Qt.jsxs("div",{className:"nav-btn-area",children:[Qt.jsx("div",{className:"btn-theme",children:g&&Qt.jsx("button",{title:"Alterar entre o tema claro/escuro",className:"btn nav-button",onClick:()=>{const t="light"==d?"dark":"light";p(t),document.body.dataset.bsTheme=t},children:Qt.jsx("i",{className:"fa-solid fa-circle-half-stroke"})})}),l&&Qt.jsx("a",{title:"Abrir ajuda online",className:"btn nav-button",href:l,target:"_blank",children:Qt.jsx(Oe,{})}),Qt.jsxs("div",{className:"btn-atalho",children:[Qt.jsx(a.Link,{to:i.users,className:"nav-button",title:"Configurações do usuário",onClick:()=>v(!1),children:Qt.jsx("i",{className:"fa-solid fa-user-gear"})}),Qt.jsx(a.Link,{to:i.exit,className:"nav-button",title:"Sair do sistema",onClick:()=>v(!1),children:Qt.jsx("i",{className:"fa-solid fa-right-from-bracket"})})]})]})]})]})}),m&&Qt.jsx("div",{id:"menu-background",className:"navbar--menu-background",onClick:function(t){"menu-background"===t.target.id&&O()},children:Qt.jsxs("div",{className:"menu-content",children:[Qt.jsxs("div",{className:"search-area",children:[Qt.jsx("i",{className:"fas fa-search"}),Qt.jsx("input",{ref:h,placeholder:"Pesquisar...",value:y,onChange:t=>_(t.target.value),onKeyDown:function(t){if("Enter"==t.key)for(const e of w)if(e.menus&&0!=e.menus.length){const t=e.menus.find(t=>null!=t.route&&""!=t.route);if(t){c.push(t.route),v(!1);break}}}}),y&&Qt.jsx("button",{className:"text-danger",title:"Limpar pesquisa",onClick:()=>_(""),children:Qt.jsx("i",{className:"fas fa-times"})}),Qt.jsx("button",{title:"Fechar todos os grupos de opções",onClick:()=>N(!1),children:Qt.jsx("i",{className:"fas fa-minus"})}),Qt.jsx("button",{title:"Expandir todos os grupos de opções",onClick:()=>N(!0),children:Qt.jsx("i",{className:"fas fa-plus"})})]}),Qt.jsx("div",{className:"navbar--menu-area",ref:f,children:w.map((t,e)=>Qt.jsx(Rl,{opc:t,closeMenu:O,clickGroup:T,clickFavorite:k,isFavorite:R,enabledFavorite:i.apiFavorites},e))}),Qt.jsx("div",{className:"menu-footer",children:Qt.jsx(a.Link,{to:i.exit,onClick:O,children:Qt.jsxs("div",{className:"user",children:[Qt.jsx("span",{className:"name",title:`Último acesso em ${null==s?void 0:s.lastAccess}`,children:null==s?void 0:s.name}),Qt.jsxs("span",{className:"sair",children:["Sair ",Qt.jsx(Ce,{})]})]})})})]})})]})},t.NavbarMU=function({menusConfig:{brand:t,company:n,menus:o,routes:i,user:s,validatePermis:u}}){const l=e.useRef(),c=e.useRef(),h=a.useHistory(),{theme:f,setTheme:d,canChangeTheme:p}=ee(),[g,m]=e.useState(!1),[v,y]=e.useState(""),[_,w]=e.useState([]),[b,C]=e.useState([]);let A=[];const E=localStorage.getItem(Bl);E&&(A=JSON.parse(E));const[I]=Je({url:i.apiFavorites,onTerminated:t=>{t.error?console.info("Erro ao obter lista de favoritos!",t.error):C(t.data)}}),[S]=Je({url:i.apiFavorites,method:"patch",onTerminated:t=>{t.error&&console.info("Erro ao salvar favoritos!",t.error)}});function x(){m(!1)}function O(t){let e=[..._],r=[];e.forEach(e=>{e===t&&(e.open=!e.open),e.open||r.push(e.caption)}),localStorage.setItem(Bl,JSON.stringify(r)),w(e)}function T(t){let e=[..._];e.forEach(e=>{(null==e?void 0:e.menus)&&((null==e?void 0:e.stayOpen)?e.open=e.stayOpen:e.open=t)}),w(e),O(null)}function N(t,e){t.stopPropagation(),t.preventDefault();const r=b.filter(t=>t.route!==e.route);var n;r.length===b.length&&r.push({caption:((null==e?void 0:e.prefix)?e.prefix+" / ":"")+e.caption,route:e.route}),n=r,i.apiFavorites&&(S({data:n}),C(n))}function k(t){return b.some(e=>e.route===t)}return e.useEffect(()=>{i.apiFavorites&&I()},[]),e.useEffect(()=>{let t=[];null==b||b.forEach(e=>{o.forEach((r,n)=>{var o;if(n>0&&0!==(null==(o=null==r?void 0:r.menus)?void 0:o.length)){let o=r.menus.findIndex(t=>t.route===e.route);if(o>=0){let i=r.menus[o];t.push({...i,caption:e.caption,index:String(n).padStart(2,"0")+String(o).padStart(2,0)})}}})}),"Favoritos"===o[0].caption&&(o[0].menus=t.sort((t,e)=>t.index>e.index?1:t.index<e.index?-1:0)),w(function(t){let e=[];return t.forEach(t=>{let r={caption:t.caption,open:!A.includes(t.caption)||t.stayOpen,stayOpen:t.stayOpen,isFavorite:null==t?void 0:t.isFavorite,prefix:null==t?void 0:t.prefix,menus:[]};t.menus&&t.menus.length>0&&t.menus.filter(t=>{var e;return(null==t?void 0:t.isLine)||!(null==t?void 0:t.isLine)&&(t.caption.toLowerCase().includes(v.toLowerCase())||(null==(e=t.shortcut)?void 0:e.toLowerCase().includes(v.toLowerCase())))}).forEach(t=>{u(null==t?void 0:t.permis,null==t?void 0:t.acesso)&&r.menus.push({...t,prefix:null==r?void 0:r.prefix})}),v&&(r.open=!0),e.push(r)}),e.forEach(t=>{var e;t.menus&&((null==(e=t.menus[0])?void 0:e.isLine)&&(t.menus=t.menus.filter(t=>!(null==t?void 0:t.isLine))),t.menus=t.menus.filter((t,e,r)=>{var n;return!(e>0&&(null==(n=r[e-1])?void 0:n.isLine)&&t.isLine)}),t.menus=t.menus.filter((t,e,r)=>!(e===r.length-1&&(null==t?void 0:t.isLine))))}),e}(o))},[v,b]),e.useEffect(()=>{var t,e;r.isDesktop()&&(null==(t=null==l?void 0:l.current)||t.select(),null==(e=null==l?void 0:l.current)||e.focus())},[g]),Qt.jsxs(Qt.Fragment,{children:[Qt.jsx("div",{className:"navbar-mu-area",children:Qt.jsxs("div",{className:"mu--container",children:[Qt.jsx(Ml,{isOpen:g,setIsOpen:m}),Qt.jsxs("div",{className:"mu--content",children:[Qt.jsx(Pl,{isOpen:g,setIsOpen:m,brand:t,closeMenu:x,routes:i}),Qt.jsxs("div",{className:"mu--info",children:[Qt.jsx("div",{className:"info-line-1",children:n}),Qt.jsx("div",{className:"info-line-2",children:Qt.jsxs("span",{children:[null==s?void 0:s.title," ",Qt.jsx("strong",{children:null==s?void 0:s.name})]})})]}),Qt.jsxs("div",{className:"mu--buttons",children:[p&&Qt.jsx("button",{title:"Alterar entre o tema claro/escuro",className:"btn nav-button",onClick:()=>{const t="light"==f?"dark":"light";d(t),document.body.dataset.bsTheme=t},children:Qt.jsx("i",{className:"fa-solid fa-circle-half-stroke"})}),Qt.jsx(a.Link,{to:i.users,className:"nav-button btn-users",title:"Configurações do usuário",onClick:()=>m(!1),children:Qt.jsx("i",{className:"fa-solid fa-user-gear"})}),Qt.jsx(a.Link,{to:i.exit,className:"nav-button btn-exit",title:"Sair do sistema",onClick:()=>m(!1),children:Qt.jsx("i",{className:"fa-solid fa-right-from-bracket"})})]})]})]})}),Qt.jsx("div",{"data-open":g,id:"menu-background",className:"nv-menu--background",onClick:function(t){"menu-background"===t.target.id&&x()},children:Qt.jsxs("div",{className:"nv-menu--content","data-open":g,children:[Qt.jsxs("div",{className:"nv-menu--brand",children:[Qt.jsx(Ml,{isOpen:g,setIsOpen:m,menuClose:r.isMobile()}),Qt.jsx(Pl,{isOpen:g,setIsOpen:m,brand:t,closeMenu:x,routes:i,showButtonClose:!0})]}),Qt.jsxs("div",{className:"nv-menu--search",children:[Qt.jsx("i",{className:"fas fa-search"}),Qt.jsx("input",{ref:l,placeholder:"Pesquisar...",value:v,onChange:t=>y(t.target.value),onKeyDown:function(t){if("Enter"==t.key)for(const e of _)if(e.menus&&0!=e.menus.length){const t=e.menus.find(t=>null!=t.route&&""!=t.route);if(t){h.push(t.route),m(!1);break}}}}),v&&Qt.jsx("button",{className:"text-danger",title:"Limpar pesquisa",onClick:function(){var t;y(""),null==(t=null==l?void 0:l.current)||t.focus()},children:Qt.jsx("i",{className:"fas fa-times"})}),Qt.jsx("button",{title:"Fechar todos os grupos de opções",onClick:()=>T(!1),children:Qt.jsx("i",{className:"fas fa-minus"})}),Qt.jsx("button",{title:"Expandir todos os grupos de opções",onClick:()=>T(!0),children:Qt.jsx("i",{className:"fas fa-plus"})})]}),Qt.jsx("div",{className:"nv-menu--opcoes",ref:c,children:_.map((t,e)=>Qt.jsx(Rl,{opc:t,closeMenu:x,clickGroup:O,clickFavorite:N,isFavorite:k,enabledFavorite:i.apiFavorites},e))}),Qt.jsx("div",{className:"nv-menu--footer",children:Qt.jsx(a.Link,{to:i.exit,onClick:x,children:Qt.jsxs("div",{className:"foo-user",children:[Qt.jsx("span",{className:"foo-name",children:null==s?void 0:s.name}),Qt.jsxs("span",{className:"foo-sair",children:["Sair ",Qt.jsx(Ce,{})]})]})})}),Qt.jsxs("div",{className:"nv-menu--copy",children:["Último acesso em ",null==s?void 0:s.lastAccess]})]})})]})},t.Paginacao=function({pages:t,page:r,setPage:n,limitDefault:o=16,limit:i=16,setLimit:a,align:s="center"}){const[u]=e.useState([7,o,30,50,100].sort((t,e)=>t-e)),l=void 0!==a&&void 0!==i&&void 0!==o;function c(e){var o;e!==r&&e>=1&&e<=t&&(null==(o=document.querySelector("main"))||o.scrollTo(0,0),n(e))}return Qt.jsx("div",{className:"pgn-content","data-fixed":i>=30?"true":"false","data-align":s,children:Qt.jsxs("div",{className:"pgn-comps",children:[l&&Qt.jsxs("div",{className:"pgn-limit",children:[Qt.jsx("label",{children:"Registros:"}),Qt.jsx("select",{className:"form-select form-select-sm",value:i,onChange:t=>a(Number(t.target.value)),children:u.map(t=>Qt.jsx("option",{value:t,children:t},t))})]}),Qt.jsxs("div",{className:"pgn-pages",children:[Qt.jsx("button",{className:"btn btn-outline-"+(r<=1?"secondary":"info"),title:"Ir para a primeira página",onClick:()=>c(1),disabled:r<=1,children:Qt.jsx("i",{className:"fas fa-angle-double-left"})}),Qt.jsx("button",{className:"btn btn-outline-"+(r<=1?"secondary":"info"),title:"Ir para página anterior",onClick:()=>c(Number(r)-1),disabled:r<=1,children:Qt.jsx("i",{className:"fas fa-angle-left"})}),Qt.jsx("span",{className:"p-2 text-body",children:Qt.jsxs("div",{children:[Qt.jsx("span",{className:"fw-bold",children:r})," / ",Qt.jsx("span",{children:t||"?"})]})}),Qt.jsx("button",{className:"btn btn-outline-"+(r>=t?"secondary":"info"),title:"Ir para próxima página",onClick:()=>c(Number(r)+1),disabled:r>=t,children:Qt.jsx("i",{className:"fas fa-angle-right"})}),Qt.jsx("button",{className:"btn btn-outline-"+(r>=t?"secondary":"info"),title:"Ir para a última página",onClick:()=>c(t),disabled:r>=t,children:Qt.jsx("i",{className:"fas fa-angle-double-right"})})]})]})})},t.Panel=Ge,t.PanelDashboard=function({title:t,color:e="var(--pn-color-border)",backColor:r="var(--bs-body-bg)",className:n,minHeight:o,children:i,marginBottom:a=0,degrade:s=!1,...u}){return Qt.jsxs("div",{className:"panel-dashboard--container"+(n?` ${n}`:""),style:{minHeight:o,marginBottom:a,"--color":e,"--back-color":r,"--degrade-margin-top":s?"calc(calc(var(--panel-dash-top) * -1))":"0px","--border-top-width":s?"0px":"6px"},...u,children:[s&&Qt.jsx("div",{className:"pd-top"}),Qt.jsxs("div",{className:"pd-body",children:[t&&Qt.jsx("h3",{className:"pd-title",children:t}),i]})]})},t.PanelHeader=He,t.PrintButtons=function({onClose:t,showTypes:r}){const{reportType:n,setReportType:o}=ee(),i=[{title:"PDF",icon:Qt.jsx("i",{className:"fa-solid fa-file-pdf"}),onClick(){o(0)}},{title:"Excel",icon:Qt.jsx("i",{className:"fa-solid fa-file-excel"}),onClick(){o(1)}},{title:"Word",icon:Qt.jsx("i",{className:"fa-solid fa-file-word"}),onClick(){o(2)}},{title:"Texto",icon:Qt.jsx("i",{className:"fa-regular fa-file-lines"}),onClick(){o(3)}}];return e.useEffect(()=>{r||o(0)},[]),Qt.jsxs("div",{className:"print-btn--container",children:[r&&Qt.jsx(he,{items:i,title:"Formato do relatório",direction:"down",children:Qt.jsxs("span",{className:"d-flex align-items-center gap-1",children:[Qt.jsxs("span",{children:["Formato",Qt.jsx("span",{className:"d-inline-block d-sm-none",children:" do relatório:"})]}),Qt.jsx("span",{className:"me-1",children:["PDF","Excel","Word","Texto"][n]}),Qt.jsx("i",{className:"fa-solid fa-chevron-down ms-auto fs-7"})]})}),Qt.jsxs("div",{className:"print-btn--buttons",children:[Qt.jsxs("button",{className:"btn btn-primary",type:"submit",children:[Qt.jsx("i",{className:"fas fa-print"})," Gerar relatório"]}),Qt.jsxs("button",{className:"btn btn-outline-danger",type:"button",onClick:t,children:[Qt.jsx("i",{className:"fas fa-times"})," Fechar"]})]})]})},t.QRCodeReader=Ss,t.RadioGroup=function({className:t="",label:e,name:r,value:n,setValue:o,options:a=[],disabled:s}){return Qt.jsxs("div",{className:"rad-group--container "+t,style:{color:s?"var(--bs-secondary)":"currentColor"},children:[Qt.jsx("div",{className:"group-radio--label",children:e}),Qt.jsx("div",{className:"group-radio--body",children:a.map((t,e)=>Qt.jsxs("label",{children:[Qt.jsx(i.Input,{type:"radio",name:r,checked:Number(n)===e,onChange:()=>o(e),disabled:s}),t]},e))})]})},t.ScrollContainer=function({children:t,hasMaxWidth:e=!0}){return Qt.jsx(pl,{hasMaxWidth:e,children:Qt.jsx("div",{className:"scroll--content",children:t})})},t.TabControl=function({children:t,isMultine:r=!1,className:n="",classNameContent:o="",innerRef:i,...a}){const[s,u]=e.useState([]),l=e.useCallback(t=>{u(e=>{const r=e.findIndex(e=>e.id==(null==t?void 0:t.id));return-1==r?e.push({...ml,...t}):e[r]={...e[r],...t},e.some(t=>t.isVisible&&t.isOpen)||(void 0===(null==t?void 0:t.isVisible)||(null==t?void 0:t.isVisible)?yl(e):function(t,e){let r=t.findIndex(t=>t.id==e.id),n=!1;t.forEach(t=>{t.isOpen=!1});for(let o=r-1;o>=0;o-=1){const e=t[o];if((null==e?void 0:e.isVisible)&&!n){n=!0,e.isOpen=!0;break}}n||yl(t)}(e,t)),[...e]})},[]),c=e.useCallback(t=>{u(e=>e.filter(e=>e.id!=t))},[]),h=e.useCallback(t=>{u(e=>e.map(e=>e.id==t?{...e,isOpen:!0}:{...e,isOpen:!1}))},[]),f=e.useCallback(t=>{u(e=>e.map(e=>e.id==t?{...e,isOpen:!e.isOpen}:e))},[]),d=e.useCallback(t=>s.find(e=>e.id==t),[s]),p=e.useCallback(()=>{u(t=>{const e=t.map(t=>({...t})),r=e.findIndex(t=>t.isVisible&&t.isOpen);return r<0?yl(e):e.forEach((t,e)=>t.isOpen=e==r),e})},[]);return e.useEffect(()=>{function t(){window.innerWidth>=768&&p()}return window.addEventListener("resize",t,null),()=>{window.removeEventListener("resize",t,null)}},[p]),e.useImperativeHandle(i,()=>({open(t){const e=d(t);e&&(null==e?void 0:e.isVisible)&&h(t)}}),[h,d]),Qt.jsx(vl.Provider,{value:{tabs:s,updateOrInsertTab:l,removeTab:c,findTab:d,selectTab:h,toggleTab:f},children:Qt.jsxs("div",{className:`tab-control--container ${n}`,...a,children:[Qt.jsx(wl,{isMultine:r}),Qt.jsx("div",{className:`tab-control--content ${o}`,children:t})]})})},t.TabSheet=function({tabId:t,title:n,caption:o,isVisible:i=!0,children:a,...s}){const{findTab:u,toggleTab:l,removeTab:c,updateOrInsertTab:h}=_l(),f=e.useMemo(()=>t||r.random(999999),[]),d=u(f);return e.useEffect(()=>()=>c(f),[]),e.useEffect(()=>{h({id:f,caption:o,title:n,isVisible:i})},[h,n,o,i]),i?Qt.jsxs(bl,{open:(null==d?void 0:d.isOpen)&&(null==d?void 0:d.isVisible),"data-in-tab-sheet":null!=d?"true":"false",...s,children:[Qt.jsx("div",{className:"bi-btn-area",children:Qt.jsxs("button",{type:"button",onClick:()=>l(f),children:[n," ",Qt.jsx("i",{className:"fas fa-chevron-down"})]})}),Qt.jsx("div",{className:`bi-body ${(null==d?void 0:d.isOpen)&&"bi-open"}`,children:a})]}):null},t.Table=function({colunas:e,acoes:n,opcoes:o,dados:a,alignTop:s,colorir:u=!0,border:l=!0,sizeBreak:c=767,msgSemDados:h="Nenhum registro encontrado!",getLineColor:f,onClick:d,fixedHeader:p,clickCanEdit:g,loading:m}){var v,y;e&&e.forEach(t=>{!t.tipo||"money"!=t.tipo&&"currency"!=t.tipo||(t.money=!0)}),void 0===g&&(g=t.hasTableLineClick);let _=!1;const w=(null==(v=null==n?void 0:n.acoes)?void 0:v.map(t=>({...t})))||[];if(n&&n.acoes){const t=null==(y=null==n?void 0:n.acoes)?void 0:y.filter(t=>t.ativa??!0);n.acoes=t,_=n.acoes.length>0}function b(t){const e=window.getSelection();if(e.rangeCount>0){const r=e.getRangeAt(0);if(t.contains(r.commonAncestorContainer)&&e.toString().length>0)return!0}return!1}return m?Qt.jsxs("div",{children:[Qt.jsx(i.Spinner,{size:"sm",color:"info"})," Carregando..."]}):a&&0!=a.length?Qt.jsx(le,{children:Qt.jsxs(ce,{alignTop:s,sizeBreak:c,hasBorder:l,children:[Qt.jsx(pe,{fixedHeader:p,colunas:e,incColActions:_}),Qt.jsx(ge,{colunas:e,acoes:n,dados:a,opcoes:o,colorir:u,getLineColor:f,onClick:d||g?function(t,e){if(d){if(b(null==e?void 0:e.currentTarget))return;d(t,e)}else if(g&&r.isDesktop()){if(b(null==e?void 0:e.currentTarget))return;const r=t[(null==n?void 0:n.campo)||"id"];if(null!=r){const e=w[0];e&&!1!==e.ativa&&e.funcao(r,t,0)}}}:void 0})]})}):Qt.jsx("div",{className:"alert alert-warning mb-0",children:h})},t.TextHtml=function({value:t}){return t&&"string"==typeof t&&t.replaceAll("\n","<br/>"),Qt.jsx("span",{dangerouslySetInnerHTML:{__html:t}})},t.Toggle=function({name:t,checked:e,disabled:r,onChange:n,children:o,toRight:i,className:a="",...s}){return Qt.jsx(dl,{checked:e,disabled:r,className:a,...s,children:Qt.jsxs("label",{style:{flexDirection:i?"row-reverse":"row",justifyContent:i?"space-between":"flex-start"},children:[Qt.jsx("div",{className:"form-switch",children:Qt.jsx("input",{disabled:r,type:"checkbox",className:"form-check-input",checked:e,onChange:function(){!r&&n&&n({target:{name:t,checked:!e,value:!e}})}})}),o&&Qt.jsx("span",{className:"title",children:o})]})})},t.cache=Ol,t.createApiConfig=function(t=ue){const e={...ue,...t};return e.auth={...ue.auth,...t.auth},e},t.createDropdownItems=je,t.createMenuOptions=function(t){return t},t.createTableActions=t=>t,t.createTableCols=t=>t,t.createTableOptions=t=>t,t.getAlign=de,t.getDataCol=fe,t.setRouteMain=function(t){We=t},t.setTableLineClick=function(e){t.hasTableLineClick=e},t.useApi=Je,t.useLibContext=ee,t.useLocalForage=function(t,r,n=1){const[o,i]=e.useState(r);return e.useEffect(()=>{Il.getItem(t).then(e=>{e&&(e.versao==n?i(e.data):Il.removeItem(t))})},[]),e.useEffect(()=>{Il.setItem(t,{versao:n,data:o})},[o]),[o,i]},t.useLocalStorage=Sl,t.useParamId=function(){let t=0,e=a.useParams();return e&&e.id&&(t=parseInt(e.id)),t},t.useQuery=function(){const{search:t}=a.useLocation();return e.useMemo(()=>new URLSearchParams(t),[t])},t.useSessionStorage=function(t,r){const[n,o]=e.useState(()=>{const e=sessionStorage.getItem(t);return e&&"undefined"!==e&&"null"!==e&&""!==e?JSON.parse(e):r});return e.useEffect(()=>{sessionStorage.setItem(t,JSON.stringify(n))},[n]),[n,o]},Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})});
|
|
960
961
|
//# sourceMappingURL=jclib-ui.umd.js.map
|