@ekyc_qoobiss/qbs-ect-cmp 4.7.54 → 4.7.55
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/cjs/agreement-info_21.cjs.entry.js +1 -1
- package/dist/esm/agreement-info_21.entry.js +1 -1
- package/dist/qbs-ect-cmp/{p-dec267d8.entry.js → p-b4279bab.entry.js} +2 -2
- package/dist/qbs-ect-cmp/qbs-ect-cmp.esm.js +1 -1
- package/package.json +1 -1
- /package/dist/qbs-ect-cmp/{p-dec267d8.entry.js.map → p-b4279bab.entry.js.map} +0 -0
|
@@ -5927,6 +5927,6 @@ import{r as t,c as e,h as n,g as r}from"./p-CUNWjaUv.js";import{a as s,A as i,s
|
|
|
5927
5927
|
* See the License for the specific language governing permissions and
|
|
5928
5928
|
* limitations under the License.
|
|
5929
5929
|
* =============================================================================
|
|
5930
|
-
*/var vE=nt.exports;var NE;function xE(){if(NE)return nt.exports;NE=1;(function(t,e){!function(t,n){n(e,wE,bE)}(vE,(function(t,e,n){const r={1:{name:"/m/01g317",id:1,displayName:"person"},2:{name:"/m/0199g",id:2,displayName:"bicycle"},3:{name:"/m/0k4j",id:3,displayName:"car"},4:{name:"/m/04_sv",id:4,displayName:"motorcycle"},5:{name:"/m/05czz6l",id:5,displayName:"airplane"},6:{name:"/m/01bjv",id:6,displayName:"bus"},7:{name:"/m/07jdr",id:7,displayName:"train"},8:{name:"/m/07r04",id:8,displayName:"truck"},9:{name:"/m/019jd",id:9,displayName:"boat"},10:{name:"/m/015qff",id:10,displayName:"traffic light"},11:{name:"/m/01pns0",id:11,displayName:"fire hydrant"},13:{name:"/m/02pv19",id:13,displayName:"stop sign"},14:{name:"/m/015qbp",id:14,displayName:"parking meter"},15:{name:"/m/0cvnqh",id:15,displayName:"bench"},16:{name:"/m/015p6",id:16,displayName:"bird"},17:{name:"/m/01yrx",id:17,displayName:"cat"},18:{name:"/m/0bt9lr",id:18,displayName:"dog"},19:{name:"/m/03k3r",id:19,displayName:"horse"},20:{name:"/m/07bgp",id:20,displayName:"sheep"},21:{name:"/m/01xq0k1",id:21,displayName:"cow"},22:{name:"/m/0bwd_0j",id:22,displayName:"elephant"},23:{name:"/m/01dws",id:23,displayName:"bear"},24:{name:"/m/0898b",id:24,displayName:"zebra"},25:{name:"/m/03bk1",id:25,displayName:"giraffe"},27:{name:"/m/01940j",id:27,displayName:"backpack"},28:{name:"/m/0hnnb",id:28,displayName:"umbrella"},31:{name:"/m/080hkjn",id:31,displayName:"handbag"},32:{name:"/m/01rkbr",id:32,displayName:"tie"},33:{name:"/m/01s55n",id:33,displayName:"suitcase"},34:{name:"/m/02wmf",id:34,displayName:"frisbee"},35:{name:"/m/071p9",id:35,displayName:"skis"},36:{name:"/m/06__v",id:36,displayName:"snowboard"},37:{name:"/m/018xm",id:37,displayName:"sports ball"},38:{name:"/m/02zt3",id:38,displayName:"kite"},39:{name:"/m/03g8mr",id:39,displayName:"baseball bat"},40:{name:"/m/03grzl",id:40,displayName:"baseball glove"},41:{name:"/m/06_fw",id:41,displayName:"skateboard"},42:{name:"/m/019w40",id:42,displayName:"surfboard"},43:{name:"/m/0dv9c",id:43,displayName:"tennis racket"},44:{name:"/m/04dr76w",id:44,displayName:"bottle"},46:{name:"/m/09tvcd",id:46,displayName:"wine glass"},47:{name:"/m/08gqpm",id:47,displayName:"cup"},48:{name:"/m/0dt3t",id:48,displayName:"fork"},49:{name:"/m/04ctx",id:49,displayName:"knife"},50:{name:"/m/0cmx8",id:50,displayName:"spoon"},51:{name:"/m/04kkgm",id:51,displayName:"bowl"},52:{name:"/m/09qck",id:52,displayName:"banana"},53:{name:"/m/014j1m",id:53,displayName:"apple"},54:{name:"/m/0l515",id:54,displayName:"sandwich"},55:{name:"/m/0cyhj_",id:55,displayName:"orange"},56:{name:"/m/0hkxq",id:56,displayName:"broccoli"},57:{name:"/m/0fj52s",id:57,displayName:"carrot"},58:{name:"/m/01b9xk",id:58,displayName:"hot dog"},59:{name:"/m/0663v",id:59,displayName:"pizza"},60:{name:"/m/0jy4k",id:60,displayName:"donut"},61:{name:"/m/0fszt",id:61,displayName:"cake"},62:{name:"/m/01mzpv",id:62,displayName:"chair"},63:{name:"/m/02crq1",id:63,displayName:"couch"},64:{name:"/m/03fp41",id:64,displayName:"potted plant"},65:{name:"/m/03ssj5",id:65,displayName:"bed"},67:{name:"/m/04bcr3",id:67,displayName:"dining table"},70:{name:"/m/09g1w",id:70,displayName:"toilet"},72:{name:"/m/07c52",id:72,displayName:"tv"},73:{name:"/m/01c648",id:73,displayName:"laptop"},74:{name:"/m/020lf",id:74,displayName:"mouse"},75:{name:"/m/0qjjc",id:75,displayName:"remote"},76:{name:"/m/01m2v",id:76,displayName:"keyboard"},77:{name:"/m/050k8",id:77,displayName:"cell phone"},78:{name:"/m/0fx9l",id:78,displayName:"microwave"},79:{name:"/m/029bxz",id:79,displayName:"oven"},80:{name:"/m/01k6s3",id:80,displayName:"toaster"},81:{name:"/m/0130jx",id:81,displayName:"sink"},82:{name:"/m/040b_t",id:82,displayName:"refrigerator"},84:{name:"/m/0bt_c3",id:84,displayName:"book"},85:{name:"/m/01x3z",id:85,displayName:"clock"},86:{name:"/m/02s195",id:86,displayName:"vase"},87:{name:"/m/01lsmm",id:87,displayName:"scissors"},88:{name:"/m/0kmg4",id:88,displayName:"teddy bear"},89:{name:"/m/03wvsk",id:89,displayName:"hair drier"},90:{name:"/m/012xff",id:90,displayName:"toothbrush"}};class s{constructor(t,e){this.modelPath=e||`https://storage.googleapis.com/tfjs-models/savedmodel/${this.getPrefix(t)}/model.json`}getPrefix(t){return"lite_mobilenet_v2"===t?`ssd${t}`:`ssd_${t}`}async load(){this.model=await e.loadGraphModel(this.modelPath);const t=n.zeros([1,300,300,3],"int32"),r=await this.model.executeAsync(t);await Promise.all(r.map((t=>t.data()))),r.map((t=>t.dispose())),t.dispose()}async infer(t,e,r){const s=n.tidy((()=>(t instanceof n.Tensor||(t=n.browser.fromPixels(t)),n.expandDims(t)))),i=s.shape[1],o=s.shape[2],a=await this.model.executeAsync(s),c=a[0].dataSync(),u=a[1].dataSync();s.dispose(),n.dispose(a);const[f,l]=this.calculateMaxScores(c,a[0].shape[1],a[0].shape[2]),h=n.getBackend();"webgl"===n.getBackend()&&n.setBackend("cpu");const d=n.tidy((()=>{const t=n.tensor2d(u,[a[1].shape[1],a[1].shape[3]]);return n.image.nonMaxSuppression(t,f,e,r,r)})),p=d.dataSync();return d.dispose(),h!==n.getBackend()&&n.setBackend(h),this.buildDetectedObjects(o,i,u,f,p,l)}buildDetectedObjects(t,e,n,s,i,o){const a=i.length,c=[];for(let u=0;u<a;u++){const a=[];for(let t=0;t<4;t++)a[t]=n[4*i[u]+t];const f=a[0]*e,l=a[1]*t,h=a[2]*e,d=a[3]*t;a[0]=l,a[1]=f,a[2]=d-l,a[3]=h-f,c.push({bbox:a,class:r[o[i[u]]+1].displayName,score:s[i[u]]})}return c}calculateMaxScores(t,e,n){const r=[],s=[];for(let i=0;i<e;i++){let e=Number.MIN_VALUE,o=-1;for(let r=0;r<n;r++)t[i*n+r]>e&&(e=t[i*n+r],o=r);r[i]=e,s[i]=o}return[r,s]}async detect(t,e=20,n=.5){return this.infer(t,e,n)}dispose(){null!=this.model&&this.model.dispose()}}t.ObjectDetection=s,t.load=async function(t={}){if(null==n)throw new Error("Cannot find TensorFlow.js. If you are using a <script> tag, please also include @tensorflow/tfjs on the page before using this model.");const e=t.base||"lite_mobilenet_v2",r=t.modelUrl;if(-1===["mobilenet_v1","mobilenet_v2","lite_mobilenet_v2"].indexOf(e))throw new Error(`ObjectDetection constructed with invalid base model ${e}. Valid names are 'mobilenet_v1', 'mobilenet_v2' and 'lite_mobilenet_v2'.`);const i=new s(e,r);return await i.load(),i},t.version="2.2.3",Object.defineProperty(t,"__esModule",{value:true})}))})(nt,nt.exports);return nt.exports}var ME=xE();const IE=".camera{color:white;display:flex;align-items:center;justify-content:center;position:relative}.cameraCanvas,.cameraCanvasSelfie,.cameraCanvasSelfieDesk{z-index:3;max-width:100%;max-height:100%;border-radius:10px}.cameraCanvasSelfie,.cameraCanvasSelfieDesk{transform:scale(-1, 1);-webkit-transform:scale(-1, 1)}.cameraVideo,.cameraVideoSelfie,.cameraVideoSelfieDesk{z-index:2;max-width:100%;max-height:100%;border-radius:10px}.cameraVideoSelfie,.cameraVideoSelfieDesk{transform:scale(-1, 1);-webkit-transform:scale(-1, 1)}.id-guide-rectangle{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);width:70%;padding-bottom:calc(70% / 1.58);border:3px dashed rgba(255, 255, 255, 0.7);border-radius:8px;z-index:5;pointer-events:none;box-sizing:border-box}.countdown-overlay-style{position:absolute;inset:0;background-color:rgba(0, 0, 0, 0.5);display:flex;align-items:center;justify-content:center;z-index:6}.video-overlay-canvas{position:absolute;top:0;left:0;width:100%;height:100%;z-index:7;pointer-events:none}.capture-flash-overlay{position:absolute;top:0;left:0;width:100%;height:100%;background-color:white;opacity:0;animation:capture-flash 0.2s ease-out;pointer-events:none;z-index:10}@keyframes bounce{0%,100%{transform:translateY(-25%);animation-timing-function:cubic-bezier(0.8, 0, 1, 1)}50%{transform:none;animation-timing-function:cubic-bezier(0, 0, 0.2, 1)}}.animate-bounce{animation:bounce 1s infinite}@keyframes capture-flash{0%{opacity:0}50%{opacity:1}100%{opacity:0}}.countdown-text-style{color:white;font-size:8rem;font-weight:bold;animation:bounce 1s infinite;}";var SE;(function(t){t["JPEG"]="image/jpeg";t["PNG"]="image/png"})(SE||(SE={}));const EE=class{constructor(n){t(this,n);this.eventPhotoCapture=e(this,"photoIdCapture");this.eventRecordingIdReady=e(this,"recordingIdCapture");this.eventTimeElapsed=e(this,"timeElapsed");this.mediaRecorder=null;this.mediaStream=null;this.animationFrameId=null;this.processingsCount=0;this.objectDetectionModel=null;this.canvasContext=null;this.processingContext=null;this.overlayContext=null;this.recordedChunks=[];this.countdown=0;this.isCapturing=false;this.mode="idle";this.tfjsReady=false;this.detectedArea=null;this.startRecording=()=>{if(this.mediaStream&&this.videoElement){this.recordedChunks=[];var t={mimeType:p.webmMimeType.mime,videoBitsPerSecond:13e5};if(!MediaRecorder.isTypeSupported(t.mimeType)){if(o.device.mobileOS==g.iOS||o.device.browser==v.Safari)t.mimeType=p.mp4MimeType.mime}this.mediaRecorder=new MediaRecorder(this.mediaStream,{mimeType:"video/webm"});this.mediaRecorder.ondataavailable=({data:t})=>{if(t.size>0){this.recordedChunks=[...this.recordedChunks,t]}};this.mediaRecorder.onstop=()=>{if(this.recordedChunks.length>0){var e=new Blob(this.recordedChunks,{type:t.mimeType.split(";")[0]});this.eventRecordingIdReady.emit(e);this.mode="done"}};this.mediaRecorder.start();console.log("Recording started...")}};this.stopRecording=()=>{if(this.mediaRecorder&&this.mediaRecorder.state==="recording"){this.mediaRecorder.stop();console.log("Recording stopped.")}};this.capture=()=>{if(this.videoElement&&this.canvasElement){const t=this.videoElement;const e=this.canvasElement;const n=this.canvasContext;e.width=t.videoWidth;e.height=t.videoHeight;n.drawImage(t,0,0,e.width,e.height);let r=null;e.toBlob((t=>{if(t&&t.type===SE.JPEG&&!o.device.isAppleDevice){try{if(o.debug)console.log("stream | getFrame | addExifInImg");N(t,this.mediaStream.getTracks()[0],{width:this.videoElement.videoWidth,height:this.videoElement.videoHeight}).then((t=>{r=t}))}catch(t){this.eventTimeElapsed.emit()}}else{if(o.debug)console.log("stream | getFrame | resolve");r=t}}),SE.PNG,1);console.log("Image captured!");this.isCapturing=true;setTimeout((()=>{this.isCapturing=false}),200);this.eventPhotoCapture.emit(r)}else{console.error("Video element or canvas element not found. Cannot capture image.")}};this.startFrameProcessing=()=>{if(this.animationFrameId===null){this.animationFrameId=requestAnimationFrame((()=>this.processVideoFrame()))}};this.handleStartTiltDetection=()=>{console.log("Detecting tilt... Please tilt the ID. (Rectangle will appear on detected object).");this.mode="detecting_tilt_live";this.detectedArea=null;if(this.overlayContext){this.overlayContext.clearRect(0,0,this.overlayCanvasElement.width,this.overlayCanvasElement.height)}this.startFrameProcessing()};this.handleStartDetection=async()=>{if(!this.mediaStream){console.log("Camera not ready. Please allow camera access.");return}console.log("Starting ID detection...");this.mode="detecting_straight_id";this.recordedChunks=[];this.detectedArea=null;this.countdown=0;this.processingsCount=0;if(this.overlayContext){this.overlayContext.clearRect(0,0,this.overlayCanvasElement.width,this.overlayCanvasElement.height)}if(this.videoElement&&this.videoElement.readyState<3){console.log("Waiting for video stream to fully load...");await new Promise((t=>{const e=()=>{this.videoElement.removeEventListener("canplaythrough",e);t()};this.videoElement.addEventListener("canplaythrough",e)}));console.log("Video stream ready. Starting detection.")}this.startRecording();this.startFrameProcessing()}}async componentWillLoad(){this.translations=await m.getValues()}async componentDidLoad(){this.initVariables();if(this.canvasElement){this.canvasContext=this.canvasElement.getContext("2d",{willReadFrequently:true})}if(this.processingCanvasElement){this.processingContext=this.processingCanvasElement.getContext("2d",{willReadFrequently:true})}if(this.overlayCanvasElement){this.overlayContext=this.overlayCanvasElement.getContext("2d",{willReadFrequently:true})}console.log("Loading AI model...");try{this.objectDetectionModel=await ME.load();this.tfjsReady=true;console.log('AI model loaded. Camera ready. Click "Start ID Detection" to begin.');this.getMedia();this.mode="idle"}catch(t){console.error("Error loading TensorFlow.js model:",t);console.log("Error: Could not load AI model. Please refresh. (Check console for details).");this.tfjsReady=false;this.mode="idle"}this.handleStartDetection()}initVariables(){if(o.debug)console.log("id-capture | initVariables");if(o.flowStatus==a.IDFRONT){this.titleMesage=this.translations.IdCaptureValues.Title}else if(o.flowStatus==a.IDBACK){this.titleMesage=this.translations.IdCaptureValues.TitleBack}else if(o.flowStatus==a.IDTILT){this.titleMesage=this.translations.IdCaptureValues.IDPoseMapping}}disconnectedCallback(){if(this.mediaStream){this.mediaStream.getTracks().forEach((t=>t.stop()))}if(this.animationFrameId!==null){cancelAnimationFrame(this.animationFrameId);this.animationFrameId=null}if(this.overlayContext){this.overlayContext.clearRect(0,0,this.overlayCanvasElement.width,this.overlayCanvasElement.height)}this.detectedArea=null}async getMedia(){try{if(!o.cameraId){await p.InitCameras(o.device)}const t=p.GetConstraints(o.cameraId,o.device);const e=await navigator.mediaDevices.getUserMedia(t);if(this.videoElement){this.videoElement.srcObject=e;this.videoElement.play()}this.mediaStream=e;this.mode="idle"}catch(t){console.error("Error accessing camera:",t);this.mode="idle"}}async detectIdWithTensorFlow(t,e=.6){if(!this.objectDetectionModel)return null;try{const n=await this.objectDetectionModel.detect(t);const r=["book","cell phone","remote","keyboard","laptop"];let s=null;let i=0;for(const t of n){const[n,o]=t.bbox;const a=n*o;if(r.includes(t.class)&&t.score>e&&a>5e3){if(a>i){i=a;s=t}}}return s}catch(t){console.error("TensorFlow.js detection error:",t);return null}}async processVideoFrame(){if(this.videoElement&&this.processingCanvasElement&&this.overlayCanvasElement&&this.tfjsReady&&(this.mode==="detecting_straight_id"||this.mode==="detecting_tilt_live")&&this.videoElement.readyState>=2&&this.processingContext&&this.overlayContext&&this.processingsCount<100){this.processingsCount++;const t=this.videoElement;const e=this.processingCanvasElement;const n=this.overlayCanvasElement;const r=this.processingContext;const s=this.overlayContext;s.clearRect(0,0,n.width,n.height);e.width=t.videoWidth;e.height=t.videoHeight;n.width=t.videoWidth;n.height=t.videoHeight;r.drawImage(t,0,0,e.width,e.height);let i=await this.detectIdWithTensorFlow(t);try{if(i){const[e,r,o,a]=i.bbox;const c=o/a;const u=o*a;let f="blue";let l=`Detected: ${i.class} (${(i.score*100).toFixed(1)}%). Area: ${u.toFixed(0)} px²`;this.detectedArea=u;if(this.mode==="detecting_straight_id"){if(c>1.4&&c<1.8&&u>t.videoWidth*t.videoHeight*.1){f="green";console.log("Straight ID detected! Starting countdown...");this.countdown=3;if(this.animationFrameId!==null){cancelAnimationFrame(this.animationFrameId);this.animationFrameId=null}this.mode="countdown_capture";const t=setInterval((()=>{this.countdown--;if(this.countdown<=0){clearInterval(t);this.capture();console.log('ID captured! Click "Start Tilt Detection" to analyze tilt.');this.countdown=0;this.detectedArea=null;s.clearRect(0,0,n.width,n.height);this.mode="awaiting_tilt_start"}}),1e3);this.handleStartTiltDetection();return}else{f="red";console.log("Looking for straight ID... Please align your ID with the guide.")}}else if(this.mode==="detecting_tilt_live"){if(c>1.4&&c<1.8){f="green";console.log(`ID is relatively straight (Aspect Ratio: ${c.toFixed(2)}).`)}else{f="yellow";console.log(`ID appears tilted (Aspect Ratio: ${c.toFixed(2)}).`);this.stopRecording()}console.log("Detecting tilt... Observe the highlighted object.")}s.strokeStyle=f;s.lineWidth=4;s.strokeRect(e,r,o,a);s.fillStyle=f;s.font="24px Arial";s.fillText(`${i.class} (${(i.score*100).toFixed(1)}%)`,e,r>20?r-10:r+25);console.log(l)}else{this.detectedArea=null;if(this.mode==="detecting_straight_id"){console.log("No ID detected. Please ensure ID is visible.")}else if(this.mode==="detecting_tilt_live"){console.log("No object detected for tilt analysis.")}}}catch(t){console.error("TensorFlow.js processing error:",t);console.log("AI processing error. See console for details.");this.mode="idle";this.detectedArea=null;if(this.animationFrameId!==null){cancelAnimationFrame(this.animationFrameId);this.animationFrameId=null}if(this.overlayContext){this.overlayContext.clearRect(0,0,this.overlayCanvasElement.width,this.overlayCanvasElement.height)}}finally{}if(this.mode==="detecting_straight_id"||this.mode==="detecting_tilt_live"){setTimeout((()=>{if(this.mode==="detecting_straight_id"||this.mode==="detecting_tilt_live"){this.animationFrameId=requestAnimationFrame((()=>this.processVideoFrame()))}}),100)}else{if(this.animationFrameId!==null){cancelAnimationFrame(this.animationFrameId);this.animationFrameId=null}}}if(this.processingsCount>=100){console.warn("Maximum processing frames reached. Stopping further processing.");this.mode="idle";this.processingsCount=0;if(this.animationFrameId!==null){cancelAnimationFrame(this.animationFrameId);this.animationFrameId=null}this.eventTimeElapsed.emit()}}render(){let t="cameraVideo";if(o.device.isDesktop){t="cameraVideoSelfieDesk"}return n("div",{key:"310d4588eb5b448db05b3c82e2ca5c2f1f380b3f",class:"container flex center"},n("div",{key:"f369228d380b691dbfb97e0eb0fa913e0ca7d1f3",class:"px-2 w-100"},n("h1",{key:"d3848595beff87b9efad7d54bc83d163ae79a562",class:this.titleStyle,innerHTML:this.titleMesage}),n("div",{key:"92f7f919f9cbb661404cb9f5d7edd5796a6608c9",class:"w-100 h-100 rounded"},n("div",{key:"3704224879624681da74a2dbb829609e929dc8f8",class:"camera rounded"},n("video",{key:"94386529d5f8e058111bcebae84e6af7c14be5bb",id:"video",loop:true,autoplay:true,playsinline:true,muted:true,class:t,ref:t=>this.videoElement=t}),n("canvas",{key:"2dffd61323ce333218b0b544c8d6e22eb25bd5a6",id:"output",ref:t=>this.canvasElement=t,style:{display:"none"}}),n("canvas",{key:"6a7a169a576a4e29782400511dffbe20ab19fcd8",id:"processingCanvasElement",ref:t=>this.processingCanvasElement=t,style:{display:"none"}}),n("canvas",{key:"b49aebfbe1c93833d5fec4e43fb892e599c42511",id:"overlayCanvasElement",ref:t=>this.overlayCanvasElement=t,class:"video-overlay-canvas"}),n("div",{key:"d2cff9830aec135f74c9dc7cbc4cb598f59ebd4a",class:"id-guide-rectangle"}),this.isCapturing&&n("div",{key:"737fb40332ceed6211ef48f06c7e4b090cc163e4",class:"capture-flash-overlay"}),this.countdown>0&&n("div",{key:"5301eb32f68a2a3563f8aad36482369cf4f5948a",class:"countdown-overlay-style"},n("span",{key:"a5478095bbbe7ee1f1e4840ae1a0a13e123cf622",class:"countdown-text-style"},this.countdown)))),n("div",{key:"b6f182d84f2b81762fb02576652edc8518c723b9",class:"footer text-center"},n("img",{key:"08cf7eaed7e81373ffcdefec4bc957693f3e57a8",src:y}))))}get el(){return r(this)}};EE.style=IE;const DE="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1Mi4yOTIiIGhlaWdodD0iNDMuODU4IiB2aWV3Qm94PSIwIDAgNTIuMjkyIDQzLjg1OCI+DQogIDxnIGlkPSJpZC1jYXJkIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMTcgLTI5KSI+DQogICAgPHBhdGggaWQ9IlBhdGhfNDc1MSIgZGF0YS1uYW1lPSJQYXRoIDQ3NTEiIGQ9Ik0yMC4zNzQsNjYuOTU0aDIyLjM1YS44NDMuODQzLDAsMCwwLDAtMS42ODdIMjAuMzc0YTEuNjg5LDEuNjg5LDAsMCwxLTEuNjg3LTEuNjg3VjMyLjM3NGExLjY4OSwxLjY4OSwwLDAsMSwxLjY4Ny0xLjY4N0g2NS45MThBMS42ODksMS42ODksMCwwLDEsNjcuNiwzMi4zNzRWNDkuMjQyYS44NDMuODQzLDAsMCwwLDEuNjg3LDBWMzIuMzc0QTMuMzc4LDMuMzc4LDAsMCwwLDY1LjkxOCwyOUgyMC4zNzRBMy4zNzgsMy4zNzgsMCwwLDAsMTcsMzIuMzc0VjYzLjU4QTMuMzc4LDMuMzc4LDAsMCwwLDIwLjM3NCw2Ni45NTRaIiBmaWxsPSIjMjUyYzgyIi8+DQogICAgPHBhdGggaWQ9IlBhdGhfNDc1MiIgZGF0YS1uYW1lPSJQYXRoIDQ3NTIiIGQ9Ik01MC42NTEsNTAuMzI2YTYuMzI2LDYuMzI2LDAsMSwwLTYuMzI2LDYuMzI2QTYuMzMzLDYuMzMzLDAsMCwwLDUwLjY1MSw1MC4zMjZabS0xMC45NjQsMGE0LjYzOSw0LjYzOSwwLDEsMSw0LjYzOSw0LjYzOUE0LjY0NCw0LjY0NCwwLDAsMSwzOS42ODcsNTAuMzI2WiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTEyLjE0NCAtOC42NzQpIiBmaWxsPSIjMjUyYzgyIi8+DQogICAgPHBhdGggaWQ9IlBhdGhfNDc1MyIgZGF0YS1uYW1lPSJQYXRoIDQ3NTMiIGQ9Ik0zMiw4NC43NDd2My4zNzRhLjg0NC44NDQsMCwwLDAsLjg0My44NDNINDguODY4YS44NDQuODQ0LDAsMCwwLC44NDMtLjg0M1Y4NC43NDdBNi43NTUsNi43NTUsMCwwLDAsNDIuOTY0LDc4SDM4Ljc0N0E2Ljc1NSw2Ljc1NSwwLDAsMCwzMiw4NC43NDdabTYuNzQ3LTUuMDZoNC4yMTdhNS4wNjYsNS4wNjYsMCwwLDEsNS4wNiw1LjA2djIuNTNIMzMuNjg3di0yLjUzQTUuMDY2LDUuMDY2LDAsMCwxLDM4Ljc0Nyw3OS42ODdaIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtOC42NzQgLTI4LjMzNikiIGZpbGw9IiMyNTJjODIiLz4NCiAgICA8cGF0aCBpZD0iUGF0aF80NzU0IiBkYXRhLW5hbWU9IlBhdGggNDc1NCIgZD0iTTEwMi43MTIsNDhIODUuODQzYS44NDMuODQzLDAsMCwwLDAsMS42ODdoMTYuODY4YS44NDMuODQzLDAsMCwwLDAtMS42ODdaIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMzkuMzI0IC0xMC45ODgpIiBmaWxsPSIjMjUyYzgyIi8+DQogICAgPHBhdGggaWQ9IlBhdGhfNDc1NSIgZGF0YS1uYW1lPSJQYXRoIDQ3NTUiIGQ9Ik0xMDIuNzEyLDYySDg1Ljg0M2EuODQzLjg0MywwLDEsMCwwLDEuNjg3aDE2Ljg2OGEuODQzLjg0MywwLDAsMCwwLTEuNjg3WiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTM5LjMyNCAtMTkuMDg0KSIgZmlsbD0iIzI1MmM4MiIvPg0KICAgIDxwYXRoIGlkPSJQYXRoXzQ3NTYiIGRhdGEtbmFtZT0iUGF0aCA0NzU2IiBkPSJNOTUuMjI5LDc1YTEyLjIzLDEyLjIzLDAsMSwwLDEyLjIzLDEyLjIzQTEyLjI0NCwxMi4yNDQsMCwwLDAsOTUuMjI5LDc1Wm0wLDIyLjk3N0ExMC43NDcsMTAuNzQ3LDAsMSwxLDEwNS45NzcsODcuMjMsMTAuNzU5LDEwLjc1OSwwLDAsMSw5NS4yMjksOTcuOTc3WiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTM4LjE2NyAtMjYuNjAyKSIgZmlsbD0iIzI1MmM4MiIvPg0KICAgIDxwYXRoIGlkPSJQYXRoXzQ3NTciIGRhdGEtbmFtZT0iUGF0aCA0NzU3IiBkPSJNMTExLjA1OSw5OC43MTdsLTcuNDQ0LDcuNDQzLTQuODUtNC44NDlhLjc0MS43NDEsMCwwLDAtMS4wNDgsMS4wNDhsNS4zNzQsNS4zNzRhLjc0MS43NDEsMCwwLDAsMS4wNDgsMGw3Ljk2OC03Ljk2OGEuNzQxLjc0MSwwLDAsMC0xLjA0OC0xLjA0OFoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC00Ny4yOTQgLTQxLjM5MykiIGZpbGw9IiM3YmI0MGYiLz4NCiAgPC9nPg0KPC9zdmc+DQo=";const kE="";const TE=class{constructor(n){t(this,n);this.apiErrorEvent=e(this,"apiError")}async componentWillRender(){this.translations=await m.getValues()}componentWillLoad(){this.yesButtonPressed=false;this.noButtonPressed=false}async hasBackSelected(){this.yesButtonPressed=true;try{await i.instance.SetTwoSidedId()}catch(t){this.apiErrorEvent.emit(t)}}async onlyFrontSelected(){this.noButtonPressed=true;try{o.flowStatus=await i.instance.GetNextFlowState()}catch(t){this.apiErrorEvent.emit(t)}}render(){return n("div",{key:"32363483a5c9e0ce24f4a1ec38c1ebd586056ac8",class:"container flex center"},n("div",{key:"810f3a7151e7919b2376ff0048c22e40f93e54e2",class:"px-3"},n("div",{key:"850f88924e80e8be2a9c0b2a1877f8b4cf6c175a",class:"mb-1 ml-1 text-center"},n("img",{key:"9d5b28f36250ff31703f65c97deabff71ee171a5",src:DE,style:{width:"70px"}})),n("h1",{key:"78ef4252524228b48a6f66d2af8052cd41114a38",class:"text-center mb-1"},this.translations.IdSelectionValues.Title),n("div",{key:"7da764c9413fa799eb4a9bf48e6a4c9677d8115a",class:"color-blue mb-2 loud-text",innerHTML:this.translations.IdSelectionValues.Description}),!this.noButtonPressed?n("div",{class:"button flex mb-1"},this.yesButtonPressed?n("div",{class:"img-loader rounded img-loader-button"},n("img",{class:"loading-image loading-image-button",src:R})):null,n("button",{class:"main-button",type:"button",disabled:this.yesButtonPressed,onClick:()=>this.hasBackSelected()},this.translations.IdSelectionValues.ButtonYes)):null,n("div",{key:"08ce9802ea046375c547b048bfce2b95ab6ccca0"}),!this.yesButtonPressed?n("div",{class:"button flex mb-1"},this.noButtonPressed?n("div",{class:"img-loader rounded img-loader-button"},n("img",{class:"loading-image loading-image-button",src:R})):null,n("button",{class:"main-button",type:"button",disabled:this.noButtonPressed,onClick:()=>this.onlyFrontSelected()},this.translations.IdSelectionValues.ButtonNo)):null,n("div",{key:"9a384b0a0f7eb858bdcaea1c761d7151b21df473",class:"footer text-center"},n("img",{key:"f1132d1e237bcc496bb3874be2f5fb9e854b7548",src:y}))))}};TE.style=kE;const AE="4.7.54";var LE={version:AE};class _E{constructor(){var t,e,n,r;this.motionValues=[];this.orientationValues=[];this.addItemsToOrientation=t=>{this.orientationValues.push({beta:t.beta,gamma:t.gamma});if(this.orientationValues.length>5){window.removeEventListener("deviceorientation",this.addItemsToOrientation)}};this.addItemsToMotion=t=>{this.motionValues.push({x:t.acceleration.x,y:t.acceleration.y});if(this.motionValues.length>5){window.removeEventListener("devicemotion",this.addItemsToMotion)}};this.supportedScreenOrientation=(e=(t=((screen===null||screen===void 0?void 0:screen.orientation)||{}).type)!==null&&t!==void 0?t:screen.mozOrientation)!==null&&e!==void 0?e:screen.msOrientation;this.safariScreenOrientation=!(screen===null||screen===void 0?void 0:screen.orientation)&&matchMedia("(orientation: portrait)").matches?"portrait-primary":"landscape-primary";this.initialScreenOrientation=(r=(n=this.supportedScreenOrientation)!==null&&n!==void 0?n:this.safariScreenOrientation)!==null&&r!==void 0?r:"portrait-primary";this.userAgent=navigator.userAgent||navigator.vendor||window.opera||undefined;this.isMobile=this.isMobileDevice();this.isTablet=this.isTabletDevice();this.isDesktop=!this.isMobile&&!this.isTablet}isMobileDevice(){const t=[/(Android)(.+)(Mobile)/i,/BlackBerry/i,/iPhone|iPod/i,/Opera Mini/i,/IEMobile/i];return t.some((t=>this.userAgent.match(t)))}isTabletDevice(){const t=/(ipad|tablet|(android(?!.*mobile))|(windows(?!.*phone)(.*touch))|kindle|playbook|silk|(puffin(?!.*(IP|AP|WP))))/;return t.test(this.userAgent.toLowerCase())}getMobileOS(){if(this.isMobileDevice()){if(/windows phone/i.test(this.userAgent))return g.WindowsPhone;else if(/android/i.test(this.userAgent))return g.Android;else if(/iPad|iPhone|iPod/.test(this.userAgent)&&!window.MSStream)return g.iOS;return g.Unknown}else return undefined}getDesktopOS(){if(this.isDesktop){if(this.userAgent.indexOf("Win")!==-1)return x.Windows;else if(this.userAgent.indexOf("Mac")!==-1)return x.MacOS;else if(this.userAgent.indexOf("X11")!==-1)return x.Unix;else if(this.userAgent.indexOf("Linux")!==-1)return x.Linux;return x.Unknown}else return undefined}getDeviceOS(){var t;return(t=this.getMobileOS())!==null&&t!==void 0?t:this.getDesktopOS()}getBrowser(){if(/XiaoMi/i.test(this.userAgent)||/MiuiBrowser/i.test(this.userAgent))return v.Mi;var t=/chrome/i.test(this.userAgent);if(t)return v.Chrome;if(/firefox/i.test(navigator.userAgent))return v.Firefox;else if(!t&&/safari/i.test(navigator.userAgent))return v.Safari;else return v.Unknown}async checkIfMobileBySensors(){var t,e;if(typeof((t=window.DeviceMotionEvent)===null||t===void 0?void 0:t.requestPermission)==="function"){var n=window.DeviceMotionEvent.requestPermission();if(n==="granted"){await this.getMotionValues()}}else{await this.getMotionValues()}await E(200);var r=false;if(this.motionValues.length>0){r=this.motionValues.filter((t=>t.x!=0)).length>=3}if(typeof((e=window.DeviceOrientationEvent)===null||e===void 0?void 0:e.requestPermission)==="function"){var n=window.DeviceOrientationEvent.requestPermission();if(n==="granted"){await this.getOrientationValues()}}else{await this.getOrientationValues()}await E(500);var s=false;if(this.orientationValues.length>0){s=this.orientationValues.map((t=>t.beta)).every(((t,e,n)=>e==0?t!==n[n.length-1]:t!==n[e-1]))||this.orientationValues.map((t=>t.gamma)).every(((t,e,n)=>e==0?t!==n[n.length-1]:t!==n[e-1]))}return r||s}async getOrientationValues(){window.addEventListener("deviceorientation",this.addItemsToOrientation)}async getMotionValues(){window.addEventListener("devicemotion",this.addItemsToMotion)}async getDevice(){var t=await this.checkIfMobileBySensors();var e={isMobileBySensors:t,isDesktop:this.isDesktop,desktopOS:this.getDesktopOS(),isWindowsDesktop:this.getDeviceOS()===x.Windows,isLinuxOrUnixDesktop:this.getDeviceOS()===x.Linux||this.getDeviceOS()===x.Unix,isMobile:this.isMobile,mobileOS:this.getMobileOS(),isAndroidDevice:this.getDeviceOS()===g.Android,isAppleDevice:this.getDeviceOS()===g.iOS||this.getDeviceOS()===x.MacOS,isUnknownMobileDevice:this.getDeviceOS()===g.Unknown,browser:this.getBrowser(),isTablet:this.isTablet,initialScreenOrientation:this.initialScreenOrientation};return e}}const CE="@font-face{font-family:'Roboto';font-style:normal;font-display:swap;font-weight:100;src:url(./files/roboto-latin-ext-100-normal.woff2) format('woff2'), url(./files/roboto-latin-ext-100-normal.woff) format('woff')}@font-face{font-family:'Roboto';font-style:normal;font-display:swap;font-weight:200;src:url(./files/roboto-latin-ext-200-normal.woff2) format('woff2'), url(./files/roboto-latin-ext-200-normal.woff) format('woff')}@font-face{font-family:'Roboto';font-style:normal;font-display:swap;font-weight:300;src:url(./files/roboto-latin-ext-300-normal.woff2) format('woff2'), url(./files/roboto-latin-ext-300-normal.woff) format('woff')}@font-face{font-family:'Roboto';font-style:normal;font-display:swap;font-weight:400;src:url(./files/roboto-latin-ext-400-normal.woff2) format('woff2'), url(./files/roboto-latin-ext-400-normal.woff) format('woff')}@font-face{font-family:'Roboto';font-style:normal;font-display:swap;font-weight:500;src:url(./files/roboto-latin-ext-500-normal.woff2) format('woff2'), url(./files/roboto-latin-ext-500-normal.woff) format('woff')}@font-face{font-family:'Roboto';font-style:normal;font-display:swap;font-weight:600;src:url(./files/roboto-latin-ext-600-normal.woff2) format('woff2'), url(./files/roboto-latin-ext-600-normal.woff) format('woff')}@font-face{font-family:'Roboto';font-style:normal;font-display:swap;font-weight:700;src:url(./files/roboto-latin-ext-700-normal.woff2) format('woff2'), url(./files/roboto-latin-ext-700-normal.woff) format('woff')}@font-face{font-family:'Roboto';font-style:normal;font-display:swap;font-weight:800;src:url(./files/roboto-latin-ext-800-normal.woff2) format('woff2'), url(./files/roboto-latin-ext-800-normal.woff) format('woff')}@font-face{font-family:'Roboto';font-style:normal;font-display:swap;font-weight:900;src:url(./files/roboto-latin-ext-900-normal.woff2) format('woff2'), url(./files/roboto-latin-ext-900-normal.woff) format('woff')}*{font-family:'Roboto', sans-serif}[hidden]{visibility:hidden !important;opacity:0 !important}.full{width:100%;height:100%;left:0;top:0}.container{width:100%;height:100%;background-color:white;max-width:991px;margin:auto;position:relative;overflow:hidden}.flex{display:flex}.relative{position:relative}.d-block{display:block}.center{align-items:center;justify-content:center}.footer{position:relative;width:100%;margin-top:5vh}.w-100{width:100%}.h-100{height:100%}.px-1{padding-left:1em;padding-right:1em}.px-2{padding-left:2em;padding-right:2em}.px-3{padding-left:3em;padding-right:3em}.px-4{padding-left:4em;padding-right:4em}.py-1{padding-top:1em;padding-bottom:1em}.py-2{padding-top:2em;padding-bottom:2em}.py-3{padding-top:3em;padding-bottom:3em}.py-4{padding-top:4em;padding-bottom:4em}.mx-1{margin-left:1em;margin-right:1em}.mx-2{margin-left:2em;margin-right:2em}.mx-3{margin-left:3em;margin-right:3em}.mx-4{margin-left:4em;margin-right:4em}.my-1{margin-top:1em;margin-bottom:1em}.my-2{margin-top:2em;margin-bottom:2em}.my-3{margin-top:3em;margin-bottom:3em}.my-4{margin-top:4em;margin-bottom:4em}.ml-1{margin-left:1em}.ml-2{margin-left:2em}.ml-3{margin-left:3em}.ml-4{margin-left:4em}.mb-05{margin-bottom:0.5em}.mb-1{margin-bottom:1em}.mb-2{margin-bottom:2em}.mb-3{margin-bottom:3em}.mb-4{margin-bottom:4em}.mt-05{margin-top:0.5em}.mt-1{margin-top:1em}.mt-2{margin-top:2em}.mt-3{margin-top:3em}.mt-4{margin-top:4em}h1{color:#252c82;font-size:1.5em;margin:0}h2{font-weight:500;font-size:1.2em;margin:0;color:#525252}h3{font-size:1.4em;margin:0}.main-text{font-weight:400;color:#525252}.link-text{text-decoration:underline;color:#252c82d9}.rounded{border-radius:8px}.cit-selector{width:50%}.img-text{display:flex;align-items:center}.img-text .bg-img{width:4em;height:5em;display:flex;align-items:center;justify-content:center;flex:none;margin-right:1em}.button{position:relative}.img-loader{position:absolute;left:-2px;top:-2px;background:#ffffffc7;border:2px solid #252c82;box-shadow:3px 3px 6px #00000029}.img-loader.rounded{border-radius:11px}.img-loader-button{width:100%;height:100%}.img-loader-button.rounded{border-radius:50px}.loading-image-button{width:100%;height:100%;border-radius:25px}.main-button{background:#7bb40e;border-radius:50px;text-align:center;width:100%;padding:0.9em;color:#fff;border:0;font-size:1.1em;font-weight:600}.main-button:disabled{color:#fff;background:#bdbdbd}.color-red{color:#ff5353}.color-blue{color:#252c82}.loud-text{font-size:1.2em}.loud-text p{margin:0.6em 0}.modal{position:fixed;left:0;top:0;width:100%;height:100%;z-index:999;background:#8b8b8be0;visibility:visible;opacity:1;transition:visibility 0s, opacity 0.2s linear}.inner{background:white;box-shadow:3px 3px 6px #00000029;border-radius:10px;padding:2em;position:relative}.close-modal{position:absolute;top:1em;right:1em}.document-view{height:100%}.scroll{height:100%;overflow-x:hidden;overflow-y:auto;scroll-behavior:smooth;position:relative}.scroll:before{content:'';display:block;width:100%;height:15px;position:sticky;top:0;left:0;background:linear-gradient(180deg, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%)}.scroll:after{content:'';display:block;width:100%;height:15px;position:sticky;bottom:0;left:0;background:linear-gradient(0deg, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%)}.main-input{width:calc(100% - 3.2em - 2px);padding:0.8em 1.6em;border:2px solid #464e58;font-size:1.2em;border-radius:10px}.checklist ul{margin:0;padding-left:20px;text-align:left;list-style-image:url('assets/checkmark.svg')}.checklist li{margin-bottom:1em}.checklist li:last-child{margin-bottom:0}.row-validare h1{font-size:28px;line-height:32px}body{margin:0;padding:0;height:100vh;position:relative;height:100vh;}.container-video{height:99vh;text-align:center;position:relative;overflow:hidden}.row{padding:3.5vh 2.5vh;height:100%;overflow:hidden;position:relative;}.ctheight-100{height:99vh}.d-flex{display:flex}.space-between{justify-content:space-between}.img-info img{width:0.8vh;z-index:5;position:relative}.img-info{width:7vh;height:7vh;border-radius:100%;display:flex;align-items:center;justify-content:center;background:radial-gradient(100% 100% at 50% 0%, #d3b6e9 0%, #fbc2bd 100%)}.i-effect{animation:2.5s infinite transition-i;position:absolute;z-index:2;border-radius:100%;background:radial-gradient(100% 100% at 50% 0%, #d3b6e9 0%, #fbc2bd 100%)}.two-buttons{margin-top:3vh;justify-content:center}.align-center{align-items:center}.font-size-2{font-size:2vh}.row-validare .font-size-2{font-size:17px;line-height:19px}.img-text .bg-img img{width:100%;padding:2vh}.cit-selector-desktop{width:200px;height:140px}.img-selector{width:100%}.img-text .cit-selector,.img-text .cit-selector-desktop{border-radius:5%}.img-text h3{color:#333333;font-weight:700;font-size:2.3vh;margin:0}.font-weight-bold{font-weight:bold}.font-size-18{font-size:1.8vh}.row-validare .font-size-18{font-size:15px;line-height:16px}a{font-size:inherit;color:inherit;text-decoration:none}.color-black{color:#000}.normal-button{background:#1feaa6;box-shadow:0 6px 8px rgba(71, 182, 162, 0.2);border-radius:25px;text-align:center;padding:2vh;margin-right:1vw;margin-left:1vw;color:#fff;border:0;font-size:2vh}.red-button{background:#ff535d}.row-validare .main-button{font-size:17px}.text-right{text-align:right}.mb-0{margin-bottom:0}.row-validare.row{padding:29px 21px}.row-validare .main-button{padding:16px}.row-validare .btn-buletin{position:relative;width:100%;bottom:0}.show-bottom{bottom:-2vh}.second-input{width:46px;height:46px;font-weight:700;font-size:16px;font-family:'Inter', sans-serif;text-align:center;border:2px solid #c5c6cc;border-radius:12px;outline:none;padding:2px}.second-input:not(:placeholder-shown){border:2px solid #1feaa6;color:#1feaa6}.mt-9{margin-top:9%}.second-input::placeholder{color:#fff;opacity:0}.second-input:focus{border:2px solid #464e58;color:#464e58}.second-input.error{border:2px solid #b67171}.second-input.error:focus{border:3px solid #b67171;color:#b67171;padding:1px}.second-input.error:not(:placeholder-shown){border:3px solid #b67171;color:#b67171;padding:2px}.second-input-container{margin-top:30%;display:flex;flex-wrap:wrap;justify-content:space-between}.input-container{display:flex;flex-wrap:wrap}.mt-15{margin-top:15%}.row-validare .mt-15{margin-top:40px}.mb-15{margin-bottom:15%}.row-validare .mb-15{margin-bottom:40px}.mb-20{margin-bottom:20%}.row-validare .mb-1{margin-bottom:20px}.row-validare .mb-20{margin-bottom:60px}.mt-90{margin-top:90px}.op-05{opacity:0.5}.error-text{position:relative;top:50px;margin-bottom:0;margin-top:0}.top-50{top:50px}.mt-25{margin-top:25%}.text-center{text-align:center}.scale-2{transform:scale(2)}.mt-20{margin-top:20%}.div-ci img{max-height:40vh;max-width:80vw}.div-ci{text-align:center}.mt-10{margin-top:10vh}.mt-5{margin-top:5vh}.pos-relative{position:relative}.pos-absolute{position:absolute}.btn-buletin{text-align:center}.buletin-container img{width:60%}.buletin-container>img{margin-top:10vh}.buletin-container{text-align:center}.color-white{color:#fff}.chenar-buletin{margin-top:3em;text-align:center}.chenar-buletin .ci-img{width:96%}.chenar-buletin .face-img,.chenar-buletin .chenar-img{left:4%;width:92%;top:-20px;min-height:55vw;display:flex;position:absolute;align-items:center;background-color:rgba(255, 255, 255, 0.2);justify-content:center}.chenar-buletin img{width:auto;height:100%;top:0;left:0;position:absolute;border-radius:10px;z-index:4}.chenar-buletin .face-img{background-color:rgba(255, 255, 255, 0.3)}.buletin-container .w-40{width:40%}.animation{width:100%;height:100%;}.color-black-2{color:#71727a}.font-size-3{font-size:3vh}.font-size-25{font-size:2.5vh}.font-size-1{font-size:1vh}.font-weight-900{font-weight:900}.mt-8{margin-top:8vh}.mt-12{margin-top:12vh}.mt-30-i{margin-top:30% !important}.ml-5{margin-left:5vh}.chenar-buletin .face-img{left:-2%;width:104%;top:-40px}.pl-2-5{padding-left:2.5vh}.container-coin{background-color:transparent;perspective:1000px;rotate:120deg 0deg}.coin-flip{animation:flip 0.4s ease-in;animation-delay:0.5s;transform-style:preserve-3d;animation-fill-mode:forwards;visibility:hidden}.coin-scale{animation:show 0.4s ease-in;animation-delay:0.5s;transform-style:preserve-3d;animation-fill-mode:forwards}.scroll-disabled{height:100%;overflow-x:hidden;pointer-events:none;user-select:none}.scroll-to-top-btn{position:fixed;z-index:200;bottom:20px;left:20px;width:6vh;height:6vh;border-radius:50%;background-color:#1feaa6;color:white;display:flex;align-items:center;justify-content:center;font-size:5vh;cursor:pointer;box-shadow:0 2px 5px rgba(0, 0, 0, 0.3);transition:background-color 0.3s}.scroll-to-top-btn:hover{background-color:#17d296}.scroll-full{margin:4px, 4px;padding:4px;overflow-x:hidden;overflow-y:auto}.video-demo{z-index:0;width:100%;height:100%;border-radius:20px}.video-capture{padding:2.5vh 2.5vh;margin-top:3em;text-align:center;position:relative}.capture-title{z-index:4;margin-top:3vh;position:absolute;bottom:5vh;padding:2.5vh 2.5vh}video::-webkit-media-controls{display:none !important}@keyframes transition-i{from{width:0;height:0;opacity:1}80%{width:10vh;height:10vh;opacity:0.5}100%{opacity:0}}@keyframes flip{0%{transform:rotateX(140deg);visibility:visible}25%{transform:rotateX(120deg);visibility:visible}50%{transform:rotateX(90deg);visibility:visible}75%{transform:rotateX(75deg);visibility:visible}100%{transform:rotateX(0deg);visibility:visible}}@keyframes show{0%{transform:scale(0)}25%{transform:scale(0.2)}40%{transform:scale(0.4)}50%{transform:scale(0.5)}60%{transform:scale(0.6)}70%{transform:scale(0.7)}100%{transform:scale(1)}}@keyframes rise{0%{visibility:hidden}50%{visibility:visible}100%{visibility:visible}}.buletin-container.rotate-x img{animation:transform-rotate-x 2s infinite ease-in}.rotateimg90{animation:transform-rotate-x2 2s forwards;animation-delay:1s;position:absolute}.rotateimg180{animation:transform-rotate-x3 2s forwards;animation-delay:3s;position:absolute;opacity:0}.buletin-back{display:flex;justify-content:center}.loading-state{display:flex;justify-content:center;align-items:center;position:relative}.loading{width:50px;height:50px;border-radius:50%;border:10px solid #ddd;border-top-color:#71727a;animation:loading 1s linear infinite}.pulsate{animation:textPulse 2s ease 0s infinite normal forwards}@keyframes textPulse{0%{transform:scale(1)}50%{transform:scale(1.1)}100%{transform:scale(1)}}@keyframes loading{to{transform:rotate(360deg)}}@keyframes transform-rotate-x3{from{transform:rotateY(-90deg);opacity:1}to{transform:rotateY(0deg);opacity:1}}@keyframes transform-rotate-x2{to{transform:rotateY(90deg)}}@keyframes transform-rotate-x{to{transform:perspective(600px) rotateX(40deg)}}@media only screen and (max-width: 350px){.second-input{width:36px;height:36px}}@media only screen and (max-width: 390px){.second-input{width:40px;height:40px}.ml-5{margin-left:20vw}}@media only screen and (min-width: 530px) and (max-width: 767px){.chenar-buletin .face-img{width:70%;min-height:auto;margin:auto;left:15%;right:auto;top:-15vh}.ml-5{margin-left:15vw}}@media only screen and (min-width: 600px) and (max-width: 767px){.max-h img{margin-left:15%;margin-right:15%}.max-h{display:flex;align-items:center}.ml-5{margin-left:10vw}}@media only screen and (max-width: 991px){.buletin-container img{max-width:220px}.ml-5{margin-left:2.5vw}}@media only screen and (min-width: 767px){.container{max-width:530px;margin:40px auto;border-radius:20px;box-shadow:1px 1px 10px rgba(0, 0, 0, 0.1);height:calc(100% - 80px)}body{height:90vh}.btn-buletin{max-width:490px;bottom:7vh}.buletin-container img{width:45%}.chenar-buletin .face-img,.chenar-buletin .chenar-img{min-height:300px}.chenar-buletin .face-img{width:80%;min-height:auto;margin:auto;left:10%;right:auto;top:-10vh}.img-selector{width:10vw}}";const OE=class{async onTokenChange(t,e){if(o.debug)console.log("Token change called with value: "+t);if(t==""){t=o.token;return}if(o.token!==t){o.token=t}}agreementAcceptanceEmitted(t){try{i.instance.GenerateAgreement(t.detail.agreementType)}catch(t){this.apiErrorEmitter(t,"Agreement Acceptance")}}async apiErrorEmitter(t,e){var n,r,s,u,f,l;if(t.detail){this.errorTitle=(r=(n=t.detail.message)!==null&&n!==void 0?n:t.detail.status)!==null&&r!==void 0?r:"";this.errorMessage=(u=(s=t.detail.stack)!==null&&s!==void 0?s:t.detail.statusText)!==null&&u!==void 0?u:""}else if(t.message){this.errorTitle=t.message}else if(t.status){this.errorTitle=(f=t.status)!==null&&f!==void 0?f:"";this.errorMessage=(l=t.statusText)!==null&&l!==void 0?l:""}else{this.errorTitle=t}let h={message:this.errorTitle,stack:this.errorMessage,zone:e};try{await i.instance.AddLog(h,await D(this.order_id,this.redirect_id,this.token))}catch(t){}await c.ectdata.delete(o.requestId);d.flowError(this.errorTitle);o.flowStatus=a.ERROREND}constructor(e){t(this,e);this.logInit={};this.initialised=false}async componentWillLoad(){var t,e,n;o.analytics=(t=this.analytics)!==null&&t!==void 0?t:true;this.appInsights=M.getInstance();this.appInsights.trackEvent("IdentificationComponent | init",{requestId:o.requestId});d.init(window);d.flowEvent(s.ComponentLoaded,u.Initialized);o.apiBaseUrl=this.api_url;if(this.env&&this.env!=""){o.environment=this.env}if(o.environment!="PROD"){o.debug=true}i.getInstance();if(o.debug)this.logInit=await D(this.order_id,this.redirect_id,this.token);if(this.token){if(o.debug)console.log("Store Token set with property value: "+this.token);o.token=this.token}if(this.redirect_id){o.redirectId=this.redirect_id}if(this.lang_iso&&this.lang_iso!=""){o.langIso=this.lang_iso}o.showCitizenshipSelector=(e=this.show_citizenship_selector)!==null&&e!==void 0?e:false;o.scrollMode=(n=this.scroll_mode)!==null&&n!==void 0?n:false}async componentDidLoad(){var t,e,n,r,s,a;if(this.order_id&&this.order_id!=""){this.ectData=await c.getOrCreateEctData(this.order_id);o.requestId=this.order_id;o.initialized=this.ectData.initialized;o.modelsPath=this.ectData.modelsPath;if(o.debug)console.log("Current RequestId has value: "+this.order_id)}else if(!this.redirect_id||this.redirect_id==""){var u=await c.getLastEctData(false);if(u){this.ectData=u;o.requestId=this.ectData.orderId;o.initialized=this.ectData.initialized}}if(((t=this.ectData)===null||t===void 0?void 0:t.modelsPath)&&((e=this.ectData)===null||e===void 0?void 0:e.modelsPath)!=""){o.modelsPath=this.ectData.modelsPath}if(this.phone_number&&this.phone_number!=""){o.phoneNumber=this.phone_number;this.ectData.phoneNumber=this.phone_number;await c.ectdata.put(this.ectData)}else if(((n=this.ectData)===null||n===void 0?void 0:n.phoneNumber)&&((r=this.ectData)===null||r===void 0?void 0:r.phoneNumber)!=""){o.phoneNumber=this.ectData.phoneNumber}if(this.citizenship&&this.citizenship!=""){o.citizenship=this.citizenship;this.ectData.citizenship=this.citizenship;await c.ectdata.put(this.ectData)}else if(((s=this.ectData)===null||s===void 0?void 0:s.citizenship)&&((a=this.ectData)===null||a===void 0?void 0:a.citizenship)!=""){o.citizenship=this.ectData.citizenship}await this.initializeRequest();try{if(this.ectData.initialized){o.flowStatus=await i.instance.GetFlowState()}}catch(t){}}async initializeRequest(){if(this.initialised){return}this.initialised=true;if(!o.device){o.device=await(new _E).getDevice()}if(o.device.browser==v.Mi){this.apiErrorEmitter("Mi Browser nu este acceptat. Va rugam utilizati Chrome.","Request Initialisation RequestId:"+o.requestId+" RedirectId:"+o.redirectId);return}try{if(o.debug)await i.instance.AddLog({phase:"debug mode"},this.logInit)}catch(t){}try{if(!o.device.isMobile&&o.redirectId==""&&o.environment=="DEMO"){o.redirectId=k();this.redirect_id=o.redirectId}if(o.token!=""&&(o.requestId!=""||o.redirectId!="")&&!o.initialized){await i.instance.AddIdentificationRequest(o.device,LE.version);await this.treatMobileRedirect();this.ectData.initialized=true;this.ectData.flowStatus=o.flowStatus;this.ectData.modelsPath=o.modelsPath;await c.ectdata.put(this.ectData)}}catch(t){this.apiErrorEmitter(t,"Request Initialisation RequestId:"+o.requestId+" RedirectId:"+o.redirectId)}}async treatMobileRedirect(){if(this.order_id&&this.order_id!=""){return}this.order_id=o.requestId;this.ectData=await c.ectdata.get(o.requestId);if(!this.ectData){await c.ectdata.add({orderId:o.requestId,redirectId:o.redirectId,timestamp:new Date,initialized:true,phoneNumber:o.phoneNumber,refreshStarted:false,flowStatus:o.flowStatus,modelsPath:o.modelsPath,citizenship:o.citizenship,finished:false});this.ectData=await c.ectdata.get(o.requestId)}}disconnectedCallback(){d.flowEvent(s.ComponentLoaded,u.Finalized)}render(){let t=n("div",{key:"f3203e25257630543b3eaf9cfc4149b25ef93d59",class:"container flex center text-center"},n("img",{key:"c6fe9c76d6e120a6c5da737956bcdc2edee27fa5",src:R}));if(o.flowStatus==a.CITIZENSHIP){t=n("citizenship-selection",{key:"9e77e90b824c2f9f0dfc430f8c78aa3c05f94595"})}else if(o.flowStatus==a.LANDING){t=n("landing-validation",{key:"b97ea89c9ebf60641e413e4713f4cb1a56621fa8"})}else if(o.flowStatus==a.MOBILE){t=n("mobile-redirect",{key:"e65b2e1943c46d6231c706f66b5dd74aea27a223"})}else if(o.flowStatus==a.AGREEMENT){t=n("agreement-info",{key:"5521a8e72acf2886f941b7579e4ebd739c977c3b"})}else if(o.flowStatus==a.PHONE){t=n("sms-send",{key:"8f9e86a5c1eb8e53e5eaa8fcefc46f9aa679ebf3"})}else if(o.flowStatus==a.CODE){t=n("sms-code-validation",{key:"21522cd6e114239dded1749feb3faf6bdaa057ab"})}else if(o.flowStatus==a.CODEERROR){t=n("sms-code-validation",{key:"4fb020e67147934651ac3be676982be0a7116474"})}else if(o.flowStatus==a.IDTYPE){t=n("id-selection",{key:"d5827bb28e1d08c3654d426f4ca1feadf63499b0"})}else if(o.flowStatus==a.IDFRONTHOWTO){if(o.debug)console.log("identification-component | render | IDFRONTHOWTO");t=n("how-to-info",{key:"b7e8a8d8a3c12ff3173410cfc02c5fdb1ecb0f16"})}else if(o.flowStatus==a.IDFRONT){if(o.debug)console.log("identification-component | render | IDFRONT");t=n("process-id",{key:"98b2993c6e3c1a9f5b31a9275a1210961d49ac29",id:"processIdFront",mode:"front"})}else if(o.flowStatus==a.IDBACKHOWTO){if(o.debug)console.log("identification-component | render | IDBACKHOWTO");t=n("how-to-info",{key:"c7e1170942611af387b7fb9435a752a8d9b14f74"})}else if(o.flowStatus==a.IDBACK){if(o.debug)console.log("identification-component | render | IDBACK");t=n("process-id",{key:"94969f6a60480bbe6e2159ad3f2fb1055a2f4ffc",id:"processIdBack",mode:"back"})}else if(o.flowStatus==a.IDTILTHOWTO){if(o.debug)console.log("identification-component | render | IDTILTHOWTO");t=n("how-to-info",{key:"4d113c355535cdad7fc8658d900b7e6289a8ea85"})}else if(o.flowStatus==a.IDTILT){if(o.debug)console.log("identification-component | render | TILT");t=n("process-id",{key:"ae5dbd27f705fae9969bfdc57e30442dc22d8850",id:"processIdTilt",mode:"tilt"})}else if(o.flowStatus==a.LIVENESSHOWTO){if(o.debug)console.log("identification-component | render | LIVENESSHOWTO");t=n("how-to-info",{key:"18e81c7168212fa0dfafc08344eb39a151fc7b56"})}else if(o.flowStatus==a.LIVENESS){if(o.debug)console.log("identification-component | render | LIVENESS");t=n("user-liveness",{key:"0f77272e45c6f7c835b8dc720b5633dee2cdc735",id:"userLiveness",mode:"selfie"})}else if(o.flowStatus==a.LIVENESSGESTUREHOWTO){if(o.debug)console.log("identification-component | render | LIVENESSGESTUREHOWTO");t=n("state-transition",{key:"0703f0d9d20f2f550aab5ea41a826a03de2d3424"})}else if(o.flowStatus==a.LIVENESSGESTURE){if(o.debug)console.log("identification-component | render | LIVENESSGESTURE");t=n("user-liveness",{key:"8b0c56bb67ec4e88856432656ce6582681d70de9",id:"userLivenessGesture",mode:"selfieGesture"})}else if(o.flowStatus==a.COMPLETE){if(o.debug)console.log("identification-component | render | COMPLETE");t=n("end-redirect",{key:"6127a025811195d3bfc56570c6a6e76a5e52f11a"})}else if(o.flowStatus==a.ERROREND){t=n("error-end",{key:"7c725e7d1339f11cf78cb317b6031bef83ace90b",errorTitle:this.errorTitle,message:this.errorMessage})}else if(o.flowStatus==a.CAMERAERROR){t=n("camera-error",{key:"472101e25c0ba6bc710b6d6b1e4ac9e92654cd40"})}else if(o.flowStatus==a.RANDOM){if(o.debug)console.log("identification-component | render | RANDOM");t=n("random-action",{key:"95570f8b810c17a19a336f89283b7381a4bc259a"})}return n("div",{key:"f941452ca3ff2a13851a245586ff867d373c1993",class:"full"},t)}static get watchers(){return{token:["onTokenChange"]}}};OE.style=CE;const zE="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0Mi4xMDkiIGhlaWdodD0iNTIuNzg4IiB2aWV3Qm94PSIwIDAgNDIuMTA5IDUyLjc4OCI+DQogIDxnIGlkPSJtb2JpbGVfcGhvbmUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yNSAtMzQyKSI+DQogICAgPHBhdGggaWQ9IlBhdGhfNDc0NiIgZGF0YS1uYW1lPSJQYXRoIDQ3NDYiIGQ9Ik0yOS45MSw1NWEuOTEuOTEsMCwxLDAsMCwxLjgyaDMuNjQxYS45MS45MSwwLDEsMCwwLTEuODJaIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSg4Ljc0MiAzMzQuMzI3KSIvPg0KICAgIDxwYXRoIGlkPSJQYXRoXzQ3NDgiIGRhdGEtbmFtZT0iUGF0aCA0NzQ4IiBkPSJNMzYuNTEyLDguOTFBLjg2Ljg2LDAsMCwwLDM1LjYsOEgyNy40MWEuODYuODYsMCwwLDAtLjkxLjkxLjg2Ljg2LDAsMCwwLC45MS45MUgzNS42QS44Ni44NiwwLDAsMCwzNi41MTIsOC45MVoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDguOTY3IDMzOC41NTEpIiBmaWxsPSIjMjUyYzgyIi8+DQogICAgPGcgaWQ9Ikdyb3VwXzQ2MDciIGRhdGEtbmFtZT0iR3JvdXAgNDYwNyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMjUgMzQyKSI+DQogICAgICA8cGF0aCBpZD0iUGF0aF80NzQ3IiBkYXRhLW5hbWU9IlBhdGggNDc0NyIgZD0iTTQ0LjEyNSw4LjM3YS45MS45MSwwLDEsMCwxLjgyLDBBNS40MzksNS40MzksMCwwLDAsNDAuNTc1LDNIMjAuMzdBNS40MzksNS40MzksMCwwLDAsMTUsOC4zN1Y1MC40MThhNS4zOCw1LjM4LDAsMCwwLDUuMzcsNS4zN0g0MC41NzVhNS4zOCw1LjM4LDAsMCwwLDUuMzctNS4zN1YzNy41ODVhLjkxLjkxLDAsMSwwLTEuODIsMFY1MC40MThhMy41NTQsMy41NTQsMCwwLDEtMy41NSwzLjU1SDIwLjM3YTMuNTU0LDMuNTU0LDAsMCwxLTMuNTUtMy41NVY4LjM3YTMuNjE0LDMuNjE0LDAsMCwxLDMuNTUtMy41NUg0MC41NzVhMy42MTQsMy42MTQsMCwwLDEsMy41NSwzLjU1WiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTE1IC0zKSIgZmlsbD0iIzI1MmM4MiIvPg0KICAgICAgPGcgaWQ9Ikdyb3VwXzQ2MDYiIGRhdGEtbmFtZT0iR3JvdXAgNDYwNiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTguMjAzIDguMTkxKSI+DQogICAgICAgIDxwYXRoIGlkPSJQYXRoXzQ3NTgiIGRhdGEtbmFtZT0iUGF0aCA0NzU4IiBkPSJNOTQuOTUzLDc1YTExLjk1MywxMS45NTMsMCwxLDAsMTEuOTUzLDExLjk1M0ExMS45NjcsMTEuOTY3LDAsMCwwLDk0Ljk1Myw3NVptMCwyMi40NTdhMTAuNSwxMC41LDAsMSwxLDEwLjUtMTAuNUExMC41MTYsMTAuNTE2LDAsMCwxLDk0Ljk1Myw5Ny40NTdaIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtODMgLTc1KSIgZmlsbD0iIzI1MmM4MiIvPg0KICAgICAgICA8cGF0aCBpZD0iUGF0aF80NzU5IiBkYXRhLW5hbWU9IlBhdGggNDc1OSIgZD0iTTExMC43NTIsOTguNzEybC03LjI3NSw3LjI3NS00Ljc0LTQuNzM5YS43MjQuNzI0LDAsMCwwLTEuMDI0LDEuMDI0bDUuMjUyLDUuMjUyYS43MjQuNzI0LDAsMCwwLDEuMDI0LDBsNy43ODctNy43ODdhLjcyNC43MjQsMCwwLDAtMS4wMjQtMS4wMjRaIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtOTIuMjQ4IC04OS45ODgpIiBmaWxsPSIjN2JiNDBlIi8+DQogICAgICA8L2c+DQogICAgPC9nPg0KICA8L2c+DQo8L3N2Zz4NCg==";const jE="";const RE=class{constructor(n){t(this,n);this.apiErrorEvent=e(this,"apiError")}async componentWillLoad(){d.flowStarted();this.translations=await m.getValues();this.buttonDisabled=false;this.ectData=await c.ectdata.get(o.requestId);await this.initRequest()}async componentDidLoad(){await h.initialize(s.Landing)}async initRequest(){if(o.apiBaseUrl.includes("apimd")){this.warningText=this.translations.LandingValues.WarningMd}else{this.warningText=this.translations.LandingValues.Warning}}async startFlow(){if(!this.buttonDisabled){this.buttonDisabled=true;var t=await p.InitCameras(o.device);if(!t&&o.device.mobileOS==g.iOS){this.ectData.refreshStarted=false;await c.ectdata.put(this.ectData)}try{o.flowStatus=await i.instance.LandingValidationStartFlow(t)}catch(t){this.apiErrorEvent.emit(t)}}}async disconnectedCallback(){await h.finalize(s.Landing)}async leaveFlow(){if(this.buttonDisabled)return;try{let t=await i.instance.AbortRequest();o.flowStatus=a[t.state];await c.ectdata.delete(o.requestId);d.flowAborted()}catch(t){d.flowAborted();this.apiErrorEvent.emit(t)}}render(){return n("div",{key:"2469d5b3bd889ec1cb70315659b76d457036e2ac",class:"container flex center"},n("div",{key:"6a6782f1ade3dfbae1a1e632fc4d3e6fc2f84208",class:"px-4"},n("h1",{key:"f6603f3e2d150a0adf467c8c64566784343ae249",class:"text-center px-1 mb-1"},this.translations.LandingValues.Title),n("div",{key:"d39e20bdf0ee6b9e85576870e145a5b9caf7f919",class:"info-container mb-2"},n("div",{key:"5bf6b84be1155b8bf82939c8562f30dcd6765099",class:"img-text"},n("div",{key:"436d13b55e89c107959f996d45cf4cc445a4d77d",class:"bg-img"},n("img",{key:"814ee0eea63f298bfd63a573973560eefe81ae50",src:DE})),n("h2",{key:"05fb39bd9aef6ed2382c48858fedff22128e6e65"},this.translations.LandingValues.IdInfo)),n("div",{key:"ec129795c17c007b99f3aedb382bcad2b1b0f89f",class:"img-text"},n("div",{key:"38bf98c2d02a34127fbba88607a410de544beb3f",class:"bg-img"},n("img",{key:"7e25803515200900aade36112849e1a1d55a8cdc",src:zE})),n("h2",{key:"9f98da2e9b38da7e3ca9fe25cfdd2335c3f084ab"},this.translations.LandingValues.DeviceInfo))),n("div",{key:"7a239652cefc22987f3b4e6fd65d6145ea79cfc0",class:"button flex mb-1"},this.buttonDisabled?n("div",{class:"img-loader rounded img-loader-button"},n("img",{class:"loading-image loading-image-button",src:R})):null,n("button",{key:"d522ca7e0b9731387434f33abeec18da4b3189cb",class:"main-button",type:"button",disabled:this.buttonDisabled,onClick:()=>this.startFlow()},this.translations.LandingValues.Button)),n("div",{key:"b994a0cb45fb430629682805085bdd9ca458d490",class:"text-center"},n("p",{key:"0b5f92a40e6a8468622a0c5a24460bbc8a4e629b",class:"main-text link-text",onClick:()=>this.leaveFlow()},this.translations.LandingValues.ButtonLeave)),n("div",{key:"968ca3c211fedb03e69cc782fa5a098d42ddd759",class:"footer text-center"},n("img",{key:"176617ac7647844b9ba133cefdcffedf5eff0609",src:y}))))}};RE.style=jE;var $E={};var FE;var PE;function BE(){if(PE)return FE;PE=1;FE=function(){return typeof Promise==="function"&&Promise.prototype&&Promise.prototype.then};return FE}var GE={};var UE={};var WE;function YE(){if(WE)return UE;WE=1;let t;const e=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];UE.getSymbolSize=function t(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return e*4+17};UE.getSymbolTotalCodewords=function t(n){return e[n]};UE.getBCHDigit=function(t){let e=0;while(t!==0){e++;t>>>=1}return e};UE.setToSJISFunction=function e(n){if(typeof n!=="function"){throw new Error('"toSJISFunc" is not a valid function.')}t=n};UE.isKanjiModeEnabled=function(){return typeof t!=="undefined"};UE.toSJIS=function e(n){return t(n)};return UE}var VE={};var ZE;function QE(){if(ZE)return VE;ZE=1;(function(t){t.L={bit:1};t.M={bit:0};t.Q={bit:3};t.H={bit:2};function e(e){if(typeof e!=="string"){throw new Error("Param is not a string")}const n=e.toLowerCase();switch(n){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+e)}}t.isValid=function t(e){return e&&typeof e.bit!=="undefined"&&e.bit>=0&&e.bit<4};t.from=function n(r,s){if(t.isValid(r)){return r}try{return e(r)}catch(t){return s}}})(VE);return VE}var HE;var JE;function qE(){if(JE)return HE;JE=1;function t(){this.buffer=[];this.length=0}t.prototype={get:function(t){const e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)===1},put:function(t,e){for(let n=0;n<e;n++){this.putBit((t>>>e-n-1&1)===1)}},getLengthInBits:function(){return this.length},putBit:function(t){const e=Math.floor(this.length/8);if(this.buffer.length<=e){this.buffer.push(0)}if(t){this.buffer[e]|=128>>>this.length%8}this.length++}};HE=t;return HE}var XE;var KE;function tD(){if(KE)return XE;KE=1;function t(t){if(!t||t<1){throw new Error("BitMatrix size must be defined and greater than 0")}this.size=t;this.data=new Uint8Array(t*t);this.reservedBit=new Uint8Array(t*t)}t.prototype.set=function(t,e,n,r){const s=t*this.size+e;this.data[s]=n;if(r)this.reservedBit[s]=true};t.prototype.get=function(t,e){return this.data[t*this.size+e]};t.prototype.xor=function(t,e,n){this.data[t*this.size+e]^=n};t.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};XE=t;return XE}var eD={};var nD;function rD(){if(nD)return eD;nD=1;(function(t){const e=YE().getSymbolSize;t.getRowColCoords=function t(n){if(n===1)return[];const r=Math.floor(n/7)+2;const s=e(n);const i=s===145?26:Math.ceil((s-13)/(2*r-2))*2;const o=[s-7];for(let t=1;t<r-1;t++){o[t]=o[t-1]-i}o.push(6);return o.reverse()};t.getPositions=function e(n){const r=[];const s=t.getRowColCoords(n);const i=s.length;for(let t=0;t<i;t++){for(let e=0;e<i;e++){if(t===0&&e===0||t===0&&e===i-1||t===i-1&&e===0){continue}r.push([s[t],s[e]])}}return r}})(eD);return eD}var sD={};var iD;function oD(){if(iD)return sD;iD=1;const t=YE().getSymbolSize;const e=7;sD.getPositions=function n(r){const s=t(r);return[[0,0],[s-e,0],[0,s-e]]};return sD}var aD={};var cD;function uD(){if(cD)return aD;cD=1;(function(t){t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const e={N1:3,N2:3,N3:40,N4:10};t.isValid=function t(e){return e!=null&&e!==""&&!isNaN(e)&&e>=0&&e<=7};t.from=function e(n){return t.isValid(n)?parseInt(n,10):undefined};t.getPenaltyN1=function t(n){const r=n.size;let s=0;let i=0;let o=0;let a=null;let c=null;for(let t=0;t<r;t++){i=o=0;a=c=null;for(let u=0;u<r;u++){let r=n.get(t,u);if(r===a){i++}else{if(i>=5)s+=e.N1+(i-5);a=r;i=1}r=n.get(u,t);if(r===c){o++}else{if(o>=5)s+=e.N1+(o-5);c=r;o=1}}if(i>=5)s+=e.N1+(i-5);if(o>=5)s+=e.N1+(o-5)}return s};t.getPenaltyN2=function t(n){const r=n.size;let s=0;for(let t=0;t<r-1;t++){for(let e=0;e<r-1;e++){const r=n.get(t,e)+n.get(t,e+1)+n.get(t+1,e)+n.get(t+1,e+1);if(r===4||r===0)s++}}return s*e.N2};t.getPenaltyN3=function t(n){const r=n.size;let s=0;let i=0;let o=0;for(let t=0;t<r;t++){i=o=0;for(let e=0;e<r;e++){i=i<<1&2047|n.get(t,e);if(e>=10&&(i===1488||i===93))s++;o=o<<1&2047|n.get(e,t);if(e>=10&&(o===1488||o===93))s++}}return s*e.N3};t.getPenaltyN4=function t(n){let r=0;const s=n.data.length;for(let t=0;t<s;t++)r+=n.data[t];const i=Math.abs(Math.ceil(r*100/s/5)-10);return i*e.N4};function n(e,n,r){switch(e){case t.Patterns.PATTERN000:return(n+r)%2===0;case t.Patterns.PATTERN001:return n%2===0;case t.Patterns.PATTERN010:return r%3===0;case t.Patterns.PATTERN011:return(n+r)%3===0;case t.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(r/3))%2===0;case t.Patterns.PATTERN101:return n*r%2+n*r%3===0;case t.Patterns.PATTERN110:return(n*r%2+n*r%3)%2===0;case t.Patterns.PATTERN111:return(n*r%3+(n+r)%2)%2===0;default:throw new Error("bad maskPattern:"+e)}}t.applyMask=function t(e,r){const s=r.size;for(let t=0;t<s;t++){for(let i=0;i<s;i++){if(r.isReserved(i,t))continue;r.xor(i,t,n(e,i,t))}}};t.getBestMask=function e(n,r){const s=Object.keys(t.Patterns).length;let i=0;let o=Infinity;for(let e=0;e<s;e++){r(e);t.applyMask(e,n);const s=t.getPenaltyN1(n)+t.getPenaltyN2(n)+t.getPenaltyN3(n)+t.getPenaltyN4(n);t.applyMask(e,n);if(s<o){o=s;i=e}}return i}})(aD);return aD}var fD={};var lD;function hD(){if(lD)return fD;lD=1;const t=QE();const e=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81];const n=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];fD.getBlocksCount=function n(r,s){switch(s){case t.L:return e[(r-1)*4+0];case t.M:return e[(r-1)*4+1];case t.Q:return e[(r-1)*4+2];case t.H:return e[(r-1)*4+3];default:return undefined}};fD.getTotalCodewordsCount=function e(r,s){switch(s){case t.L:return n[(r-1)*4+0];case t.M:return n[(r-1)*4+1];case t.Q:return n[(r-1)*4+2];case t.H:return n[(r-1)*4+3];default:return undefined}};return fD}var dD={};var pD={};var mD;function yD(){if(mD)return pD;mD=1;const t=new Uint8Array(512);const e=new Uint8Array(256);(function n(){let r=1;for(let n=0;n<255;n++){t[n]=r;e[r]=n;r<<=1;if(r&256){r^=285}}for(let e=255;e<512;e++){t[e]=t[e-255]}})();pD.log=function t(n){if(n<1)throw new Error("log("+n+")");return e[n]};pD.exp=function e(n){return t[n]};pD.mul=function n(r,s){if(r===0||s===0)return 0;return t[e[r]+e[s]]};return pD}var gD;function wD(){if(gD)return dD;gD=1;(function(t){const e=yD();t.mul=function t(n,r){const s=new Uint8Array(n.length+r.length-1);for(let t=0;t<n.length;t++){for(let i=0;i<r.length;i++){s[t+i]^=e.mul(n[t],r[i])}}return s};t.mod=function t(n,r){let s=new Uint8Array(n);while(s.length-r.length>=0){const t=s[0];for(let n=0;n<r.length;n++){s[n]^=e.mul(r[n],t)}let n=0;while(n<s.length&&s[n]===0)n++;s=s.slice(n)}return s};t.generateECPolynomial=function n(r){let s=new Uint8Array([1]);for(let n=0;n<r;n++){s=t.mul(s,new Uint8Array([1,e.exp(n)]))}return s}})(dD);return dD}var bD;var vD;function ND(){if(vD)return bD;vD=1;const t=wD();function e(t){this.genPoly=undefined;this.degree=t;if(this.degree)this.initialize(this.degree)}e.prototype.initialize=function e(n){this.degree=n;this.genPoly=t.generateECPolynomial(this.degree)};e.prototype.encode=function e(n){if(!this.genPoly){throw new Error("Encoder not initialized")}const r=new Uint8Array(n.length+this.degree);r.set(n);const s=t.mod(r,this.genPoly);const i=this.degree-s.length;if(i>0){const t=new Uint8Array(this.degree);t.set(s,i);return t}return s};bD=e;return bD}var xD={};var MD={};var ID={};var SD;function ED(){if(SD)return ID;SD=1;ID.isValid=function t(e){return!isNaN(e)&&e>=1&&e<=40};return ID}var DD={};var kD;function TD(){if(kD)return DD;kD=1;const t="[0-9]+";const e="[A-Z $%*+\\-./:]+";let n="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|"+"[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|"+"[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|"+"[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";n=n.replace(/u/g,"\\u");const r="(?:(?![A-Z0-9 $%*+\\-./:]|"+n+")(?:.|[\r\n]))+";DD.KANJI=new RegExp(n,"g");DD.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");DD.BYTE=new RegExp(r,"g");DD.NUMERIC=new RegExp(t,"g");DD.ALPHANUMERIC=new RegExp(e,"g");const s=new RegExp("^"+n+"$");const i=new RegExp("^"+t+"$");const o=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");DD.testKanji=function t(e){return s.test(e)};DD.testNumeric=function t(e){return i.test(e)};DD.testAlphanumeric=function t(e){return o.test(e)};return DD}var AD;function LD(){if(AD)return MD;AD=1;(function(t){const e=ED();const n=TD();t.NUMERIC={id:"Numeric",bit:1<<0,ccBits:[10,12,14]};t.ALPHANUMERIC={id:"Alphanumeric",bit:1<<1,ccBits:[9,11,13]};t.BYTE={id:"Byte",bit:1<<2,ccBits:[8,16,16]};t.KANJI={id:"Kanji",bit:1<<3,ccBits:[8,10,12]};t.MIXED={bit:-1};t.getCharCountIndicator=function t(n,r){if(!n.ccBits)throw new Error("Invalid mode: "+n);if(!e.isValid(r)){throw new Error("Invalid version: "+r)}if(r>=1&&r<10)return n.ccBits[0];else if(r<27)return n.ccBits[1];return n.ccBits[2]};t.getBestModeForData=function e(r){if(n.testNumeric(r))return t.NUMERIC;else if(n.testAlphanumeric(r))return t.ALPHANUMERIC;else if(n.testKanji(r))return t.KANJI;else return t.BYTE};t.toString=function t(e){if(e&&e.id)return e.id;throw new Error("Invalid mode")};t.isValid=function t(e){return e&&e.bit&&e.ccBits};function r(e){if(typeof e!=="string"){throw new Error("Param is not a string")}const n=e.toLowerCase();switch(n){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+e)}}t.from=function e(n,s){if(t.isValid(n)){return n}try{return r(n)}catch(t){return s}}})(MD);return MD}var _D;function CD(){if(_D)return xD;_D=1;(function(t){const e=YE();const n=hD();const r=QE();const s=LD();const i=ED();const o=1<<12|1<<11|1<<10|1<<9|1<<8|1<<5|1<<2|1<<0;const a=e.getBCHDigit(o);function c(e,n,r){for(let s=1;s<=40;s++){if(n<=t.getCapacity(s,r,e)){return s}}return undefined}function u(t,e){return s.getCharCountIndicator(t,e)+4}function f(t,e){let n=0;t.forEach((function(t){const r=u(t.mode,e);n+=r+t.getBitsLength()}));return n}function l(e,n){for(let r=1;r<=40;r++){const i=f(e,r);if(i<=t.getCapacity(r,n,s.MIXED)){return r}}return undefined}t.from=function t(e,n){if(i.isValid(e)){return parseInt(e,10)}return n};t.getCapacity=function t(r,o,a){if(!i.isValid(r)){throw new Error("Invalid QR Code version")}if(typeof a==="undefined")a=s.BYTE;const c=e.getSymbolTotalCodewords(r);const f=n.getTotalCodewordsCount(r,o);const l=(c-f)*8;if(a===s.MIXED)return l;const h=l-u(a,r);switch(a){case s.NUMERIC:return Math.floor(h/10*3);case s.ALPHANUMERIC:return Math.floor(h/11*2);case s.KANJI:return Math.floor(h/13);case s.BYTE:default:return Math.floor(h/8)}};t.getBestVersionForData=function t(e,n){let s;const i=r.from(n,r.M);if(Array.isArray(e)){if(e.length>1){return l(e,i)}if(e.length===0){return 1}s=e[0]}else{s=e}return c(s.mode,s.getLength(),i)};t.getEncodedBits=function t(n){if(!i.isValid(n)||n<7){throw new Error("Invalid QR Code version")}let r=n<<12;while(e.getBCHDigit(r)-a>=0){r^=o<<e.getBCHDigit(r)-a}return n<<12|r}})(xD);return xD}var OD={};var zD;function jD(){if(zD)return OD;zD=1;const t=YE();const e=1<<10|1<<8|1<<5|1<<4|1<<2|1<<1|1<<0;const n=1<<14|1<<12|1<<10|1<<4|1<<1;const r=t.getBCHDigit(e);OD.getEncodedBits=function s(i,o){const a=i.bit<<3|o;let c=a<<10;while(t.getBCHDigit(c)-r>=0){c^=e<<t.getBCHDigit(c)-r}return(a<<10|c)^n};return OD}var RD={};var $D;var FD;function PD(){if(FD)return $D;FD=1;const t=LD();function e(e){this.mode=t.NUMERIC;this.data=e.toString()}e.getBitsLength=function t(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)};e.prototype.getLength=function t(){return this.data.length};e.prototype.getBitsLength=function t(){return e.getBitsLength(this.data.length)};e.prototype.write=function t(e){let n,r,s;for(n=0;n+3<=this.data.length;n+=3){r=this.data.substr(n,3);s=parseInt(r,10);e.put(s,10)}const i=this.data.length-n;if(i>0){r=this.data.substr(n);s=parseInt(r,10);e.put(s,i*3+1)}};$D=e;return $D}var BD;var GD;function UD(){if(GD)return BD;GD=1;const t=LD();const e=["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"," ","$","%","*","+","-",".","/",":"];function n(e){this.mode=t.ALPHANUMERIC;this.data=e}n.getBitsLength=function t(e){return 11*Math.floor(e/2)+6*(e%2)};n.prototype.getLength=function t(){return this.data.length};n.prototype.getBitsLength=function t(){return n.getBitsLength(this.data.length)};n.prototype.write=function t(n){let r;for(r=0;r+2<=this.data.length;r+=2){let t=e.indexOf(this.data[r])*45;t+=e.indexOf(this.data[r+1]);n.put(t,11)}if(this.data.length%2){n.put(e.indexOf(this.data[r]),6)}};BD=n;return BD}var WD;var YD;function VD(){if(YD)return WD;YD=1;const t=LD();function e(e){this.mode=t.BYTE;if(typeof e==="string"){this.data=(new TextEncoder).encode(e)}else{this.data=new Uint8Array(e)}}e.getBitsLength=function t(e){return e*8};e.prototype.getLength=function t(){return this.data.length};e.prototype.getBitsLength=function t(){return e.getBitsLength(this.data.length)};e.prototype.write=function(t){for(let e=0,n=this.data.length;e<n;e++){t.put(this.data[e],8)}};WD=e;return WD}var ZD;var QD;function HD(){if(QD)return ZD;QD=1;const t=LD();const e=YE();function n(e){this.mode=t.KANJI;this.data=e}n.getBitsLength=function t(e){return e*13};n.prototype.getLength=function t(){return this.data.length};n.prototype.getBitsLength=function t(){return n.getBitsLength(this.data.length)};n.prototype.write=function(t){let n;for(n=0;n<this.data.length;n++){let r=e.toSJIS(this.data[n]);if(r>=33088&&r<=40956){r-=33088}else if(r>=57408&&r<=60351){r-=49472}else{throw new Error("Invalid SJIS character: "+this.data[n]+"\n"+"Make sure your charset is UTF-8")}r=(r>>>8&255)*192+(r&255);t.put(r,13)}};ZD=n;return ZD}var JD={exports:{}};var qD;function XD(){if(qD)return JD.exports;qD=1;(function(t){var e={single_source_shortest_paths:function(t,n,r){var s={};var i={};i[n]=0;var o=e.PriorityQueue.make();o.push(n,0);var a,c,u,f,l,h,d,p,m;while(!o.empty()){a=o.pop();c=a.value;f=a.cost;l=t[c]||{};for(u in l){if(l.hasOwnProperty(u)){h=l[u];d=f+h;p=i[u];m=typeof i[u]==="undefined";if(m||p>d){i[u]=d;o.push(u,d);s[u]=c}}}}if(typeof r!=="undefined"&&typeof i[r]==="undefined"){var y=["Could not find a path from ",n," to ",r,"."].join("");throw new Error(y)}return s},extract_shortest_path_from_predecessor_list:function(t,e){var n=[];var r=e;while(r){n.push(r);r=t[r]}n.reverse();return n},find_path:function(t,n,r){var s=e.single_source_shortest_paths(t,n,r);return e.extract_shortest_path_from_predecessor_list(s,r)},PriorityQueue:{make:function(t){var n=e.PriorityQueue,r={},s;t=t||{};for(s in n){if(n.hasOwnProperty(s)){r[s]=n[s]}}r.queue=[];r.sorter=t.sorter||n.default_sorter;return r},default_sorter:function(t,e){return t.cost-e.cost},push:function(t,e){var n={value:t,cost:e};this.queue.push(n);this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};{t.exports=e}})(JD);return JD.exports}var KD;function tk(){if(KD)return RD;KD=1;(function(t){const e=LD();const n=PD();const r=UD();const s=VD();const i=HD();const o=TD();const a=YE();const c=XD();function u(t){return unescape(encodeURIComponent(t)).length}function f(t,e,n){const r=[];let s;while((s=t.exec(n))!==null){r.push({data:s[0],index:s.index,mode:e,length:s[0].length})}return r}function l(t){const n=f(o.NUMERIC,e.NUMERIC,t);const r=f(o.ALPHANUMERIC,e.ALPHANUMERIC,t);let s;let i;if(a.isKanjiModeEnabled()){s=f(o.BYTE,e.BYTE,t);i=f(o.KANJI,e.KANJI,t)}else{s=f(o.BYTE_KANJI,e.BYTE,t);i=[]}const c=n.concat(r,s,i);return c.sort((function(t,e){return t.index-e.index})).map((function(t){return{data:t.data,mode:t.mode,length:t.length}}))}function h(t,o){switch(o){case e.NUMERIC:return n.getBitsLength(t);case e.ALPHANUMERIC:return r.getBitsLength(t);case e.KANJI:return i.getBitsLength(t);case e.BYTE:return s.getBitsLength(t)}}function d(t){return t.reduce((function(t,e){const n=t.length-1>=0?t[t.length-1]:null;if(n&&n.mode===e.mode){t[t.length-1].data+=e.data;return t}t.push(e);return t}),[])}function p(t){const n=[];for(let r=0;r<t.length;r++){const s=t[r];switch(s.mode){case e.NUMERIC:n.push([s,{data:s.data,mode:e.ALPHANUMERIC,length:s.length},{data:s.data,mode:e.BYTE,length:s.length}]);break;case e.ALPHANUMERIC:n.push([s,{data:s.data,mode:e.BYTE,length:s.length}]);break;case e.KANJI:n.push([s,{data:s.data,mode:e.BYTE,length:u(s.data)}]);break;case e.BYTE:n.push([{data:s.data,mode:e.BYTE,length:u(s.data)}])}}return n}function m(t,n){const r={};const s={start:{}};let i=["start"];for(let o=0;o<t.length;o++){const a=t[o];const c=[];for(let t=0;t<a.length;t++){const u=a[t];const f=""+o+t;c.push(f);r[f]={node:u,lastCount:0};s[f]={};for(let t=0;t<i.length;t++){const o=i[t];if(r[o]&&r[o].node.mode===u.mode){s[o][f]=h(r[o].lastCount+u.length,u.mode)-h(r[o].lastCount,u.mode);r[o].lastCount+=u.length}else{if(r[o])r[o].lastCount=u.length;s[o][f]=h(u.length,u.mode)+4+e.getCharCountIndicator(u.mode,n)}}}i=c}for(let t=0;t<i.length;t++){s[i[t]].end=0}return{map:s,table:r}}function y(t,o){let c;const u=e.getBestModeForData(t);c=e.from(o,u);if(c!==e.BYTE&&c.bit<u.bit){throw new Error('"'+t+'"'+" cannot be encoded with mode "+e.toString(c)+".\n Suggested mode is: "+e.toString(u))}if(c===e.KANJI&&!a.isKanjiModeEnabled()){c=e.BYTE}switch(c){case e.NUMERIC:return new n(t);case e.ALPHANUMERIC:return new r(t);case e.KANJI:return new i(t);case e.BYTE:return new s(t)}}t.fromArray=function t(e){return e.reduce((function(t,e){if(typeof e==="string"){t.push(y(e,null))}else if(e.data){t.push(y(e.data,e.mode))}return t}),[])};t.fromString=function e(n,r){const s=l(n,a.isKanjiModeEnabled());const i=p(s);const o=m(i,r);const u=c.find_path(o.map,"start","end");const f=[];for(let t=1;t<u.length-1;t++){f.push(o.table[u[t]].node)}return t.fromArray(d(f))};t.rawSplit=function e(n){return t.fromArray(l(n,a.isKanjiModeEnabled()))}})(RD);return RD}var ek;function nk(){if(ek)return GE;ek=1;const t=YE();const e=QE();const n=qE();const r=tD();const s=rD();const i=oD();const o=uD();const a=hD();const c=ND();const u=CD();const f=jD();const l=LD();const h=tk();function d(t,e){const n=t.size;const r=i.getPositions(e);for(let e=0;e<r.length;e++){const s=r[e][0];const i=r[e][1];for(let e=-1;e<=7;e++){if(s+e<=-1||n<=s+e)continue;for(let r=-1;r<=7;r++){if(i+r<=-1||n<=i+r)continue;if(e>=0&&e<=6&&(r===0||r===6)||r>=0&&r<=6&&(e===0||e===6)||e>=2&&e<=4&&r>=2&&r<=4){t.set(s+e,i+r,true,true)}else{t.set(s+e,i+r,false,true)}}}}}function p(t){const e=t.size;for(let n=8;n<e-8;n++){const e=n%2===0;t.set(n,6,e,true);t.set(6,n,e,true)}}function m(t,e){const n=s.getPositions(e);for(let e=0;e<n.length;e++){const r=n[e][0];const s=n[e][1];for(let e=-2;e<=2;e++){for(let n=-2;n<=2;n++){if(e===-2||e===2||n===-2||n===2||e===0&&n===0){t.set(r+e,s+n,true,true)}else{t.set(r+e,s+n,false,true)}}}}}function y(t,e){const n=t.size;const r=u.getEncodedBits(e);let s,i,o;for(let e=0;e<18;e++){s=Math.floor(e/3);i=e%3+n-8-3;o=(r>>e&1)===1;t.set(s,i,o,true);t.set(i,s,o,true)}}function g(t,e,n){const r=t.size;const s=f.getEncodedBits(e,n);let i,o;for(i=0;i<15;i++){o=(s>>i&1)===1;if(i<6){t.set(i,8,o,true)}else if(i<8){t.set(i+1,8,o,true)}else{t.set(r-15+i,8,o,true)}if(i<8){t.set(8,r-i-1,o,true)}else if(i<9){t.set(8,15-i-1+1,o,true)}else{t.set(8,15-i-1,o,true)}}t.set(r-8,8,1,true)}function w(t,e){const n=t.size;let r=-1;let s=n-1;let i=7;let o=0;for(let a=n-1;a>0;a-=2){if(a===6)a--;while(true){for(let n=0;n<2;n++){if(!t.isReserved(s,a-n)){let r=false;if(o<e.length){r=(e[o]>>>i&1)===1}t.set(s,a-n,r);i--;if(i===-1){o++;i=7}}}s+=r;if(s<0||n<=s){s-=r;r=-r;break}}}}function b(e,r,s){const i=new n;s.forEach((function(t){i.put(t.mode.bit,4);i.put(t.getLength(),l.getCharCountIndicator(t.mode,e));t.write(i)}));const o=t.getSymbolTotalCodewords(e);const c=a.getTotalCodewordsCount(e,r);const u=(o-c)*8;if(i.getLengthInBits()+4<=u){i.put(0,4)}while(i.getLengthInBits()%8!==0){i.putBit(0)}const f=(u-i.getLengthInBits())/8;for(let t=0;t<f;t++){i.put(t%2?17:236,8)}return v(i,e,r)}function v(e,n,r){const s=t.getSymbolTotalCodewords(n);const i=a.getTotalCodewordsCount(n,r);const o=s-i;const u=a.getBlocksCount(n,r);const f=s%u;const l=u-f;const h=Math.floor(s/u);const d=Math.floor(o/u);const p=d+1;const m=h-d;const y=new c(m);let g=0;const w=new Array(u);const b=new Array(u);let v=0;const N=new Uint8Array(e.buffer);for(let t=0;t<u;t++){const e=t<l?d:p;w[t]=N.slice(g,g+e);b[t]=y.encode(w[t]);g+=e;v=Math.max(v,e)}const x=new Uint8Array(s);let M=0;let I,S;for(I=0;I<v;I++){for(S=0;S<u;S++){if(I<w[S].length){x[M++]=w[S][I]}}}for(I=0;I<m;I++){for(S=0;S<u;S++){x[M++]=b[S][I]}}return x}function N(e,n,s,i){let a;if(Array.isArray(e)){a=h.fromArray(e)}else if(typeof e==="string"){let t=n;if(!t){const n=h.rawSplit(e);t=u.getBestVersionForData(n,s)}a=h.fromString(e,t||40)}else{throw new Error("Invalid data")}const c=u.getBestVersionForData(a,s);if(!c){throw new Error("The amount of data is too big to be stored in a QR Code")}if(!n){n=c}else if(n<c){throw new Error("\n"+"The chosen QR Code version cannot contain this amount of data.\n"+"Minimum version required to store current data is: "+c+".\n")}const f=b(n,s,a);const l=t.getSymbolSize(n);const v=new r(l);d(v,n);p(v);m(v,n);g(v,s,0);if(n>=7){y(v,n)}w(v,f);if(isNaN(i)){i=o.getBestMask(v,g.bind(null,v,s))}o.applyMask(i,v);g(v,s,i);return{modules:v,version:n,errorCorrectionLevel:s,maskPattern:i,segments:a}}GE.create=function n(r,s){if(typeof r==="undefined"||r===""){throw new Error("No input text")}let i=e.M;let a;let c;if(typeof s!=="undefined"){i=e.from(s.errorCorrectionLevel,e.M);a=u.from(s.version);c=o.from(s.maskPattern);if(s.toSJISFunc){t.setToSJISFunction(s.toSJISFunc)}}return N(r,a,i,c)};return GE}var rk={};var sk={};var ik;if(typeof Object.create==="function"){ik=function t(e,n){e.super_=n;e.prototype=Object.create(n.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}})}}else{ik=function t(e,n){e.super_=n;var r=function(){};r.prototype=n.prototype;e.prototype=new r;e.prototype.constructor=e}}var ok=/%[sdj%]/g;function ak(t){if(!Dk(t)){var e=[];for(var n=0;n<arguments.length;n++){e.push(hk(arguments[n]))}return e.join(" ")}var n=1;var r=arguments;var s=r.length;var i=String(t).replace(ok,(function(t){if(t==="%%")return"%";if(n>=s)return t;switch(t){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(t){return"[Circular]"}default:return t}}));for(var o=r[n];n<s;o=r[++n]){if(Ik(o)||!Lk(o)){i+=" "+o}else{i+=" "+hk(o)}}return i}function ck(t,e){if(Tk(w.process)){return function(){return ck(t,e).apply(this,arguments)}}if(b.noDeprecation===true){return t}var n=false;function r(){if(!n){if(b.throwDeprecation){throw new Error(e)}else if(b.traceDeprecation){console.trace(e)}else{console.error(e)}n=true}return t.apply(this,arguments)}return r}var uk={};var fk;function lk(t){if(Tk(fk))fk=b.env.NODE_DEBUG||"";t=t.toUpperCase();if(!uk[t]){if(new RegExp("\\b"+t+"\\b","i").test(fk)){var e=0;uk[t]=function(){var n=ak.apply(null,arguments);console.error("%s %d: %s",t,e,n)}}else{uk[t]=function(){}}}return uk[t]}function hk(t,e){var n={seen:[],stylize:pk};if(arguments.length>=3)n.depth=arguments[2];if(arguments.length>=4)n.colors=arguments[3];if(Mk(e)){n.showHidden=e}else if(e){Gk(n,e)}if(Tk(n.showHidden))n.showHidden=false;if(Tk(n.depth))n.depth=2;if(Tk(n.colors))n.colors=false;if(Tk(n.customInspect))n.customInspect=true;if(n.colors)n.stylize=dk;return yk(n,t,n.depth)}hk.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};hk.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function dk(t,e){var n=hk.styles[e];if(n){return"["+hk.colors[n][0]+"m"+t+"["+hk.colors[n][1]+"m"}else{return t}}function pk(t,e){return t}function mk(t){var e={};t.forEach((function(t,n){e[t]=true}));return e}function yk(t,e,n){if(t.customInspect&&e&&Ok(e.inspect)&&e.inspect!==hk&&!(e.constructor&&e.constructor.prototype===e)){var r=e.inspect(n,t);if(!Dk(r)){r=yk(t,r,n)}return r}var s=gk(t,e);if(s){return s}var i=Object.keys(e);var o=mk(i);if(t.showHidden){i=Object.getOwnPropertyNames(e)}if(Ck(e)&&(i.indexOf("message")>=0||i.indexOf("description")>=0)){return wk(e)}if(i.length===0){if(Ok(e)){var a=e.name?": "+e.name:"";return t.stylize("[Function"+a+"]","special")}if(Ak(e)){return t.stylize(RegExp.prototype.toString.call(e),"regexp")}if(_k(e)){return t.stylize(Date.prototype.toString.call(e),"date")}if(Ck(e)){return wk(e)}}var c="",u=false,f=["{","}"];if(xk(e)){u=true;f=["[","]"]}if(Ok(e)){var l=e.name?": "+e.name:"";c=" [Function"+l+"]"}if(Ak(e)){c=" "+RegExp.prototype.toString.call(e)}if(_k(e)){c=" "+Date.prototype.toUTCString.call(e)}if(Ck(e)){c=" "+wk(e)}if(i.length===0&&(!u||e.length==0)){return f[0]+c+f[1]}if(n<0){if(Ak(e)){return t.stylize(RegExp.prototype.toString.call(e),"regexp")}else{return t.stylize("[Object]","special")}}t.seen.push(e);var h;if(u){h=bk(t,e,n,o,i)}else{h=i.map((function(r){return vk(t,e,n,o,r,u)}))}t.seen.pop();return Nk(h,c,f)}function gk(t,e){if(Tk(e))return t.stylize("undefined","undefined");if(Dk(e)){var n="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(n,"string")}if(Ek(e))return t.stylize(""+e,"number");if(Mk(e))return t.stylize(""+e,"boolean");if(Ik(e))return t.stylize("null","null")}function wk(t){return"["+Error.prototype.toString.call(t)+"]"}function bk(t,e,n,r,s){var i=[];for(var o=0,a=e.length;o<a;++o){if(Uk(e,String(o))){i.push(vk(t,e,n,r,String(o),true))}else{i.push("")}}s.forEach((function(s){if(!s.match(/^\d+$/)){i.push(vk(t,e,n,r,s,true))}}));return i}function vk(t,e,n,r,s,i){var o,a,c;c=Object.getOwnPropertyDescriptor(e,s)||{value:e[s]};if(c.get){if(c.set){a=t.stylize("[Getter/Setter]","special")}else{a=t.stylize("[Getter]","special")}}else{if(c.set){a=t.stylize("[Setter]","special")}}if(!Uk(r,s)){o="["+s+"]"}if(!a){if(t.seen.indexOf(c.value)<0){if(Ik(n)){a=yk(t,c.value,null)}else{a=yk(t,c.value,n-1)}if(a.indexOf("\n")>-1){if(i){a=a.split("\n").map((function(t){return" "+t})).join("\n").substr(2)}else{a="\n"+a.split("\n").map((function(t){return" "+t})).join("\n")}}}else{a=t.stylize("[Circular]","special")}}if(Tk(o)){if(i&&s.match(/^\d+$/)){return a}o=JSON.stringify(""+s);if(o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)){o=o.substr(1,o.length-2);o=t.stylize(o,"name")}else{o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'");o=t.stylize(o,"string")}}return o+": "+a}function Nk(t,e,n){var r=t.reduce((function(t,e){if(e.indexOf("\n")>=0);return t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0);if(r>60){return n[0]+(e===""?"":e+"\n ")+" "+t.join(",\n ")+" "+n[1]}return n[0]+e+" "+t.join(", ")+" "+n[1]}function xk(t){return Array.isArray(t)}function Mk(t){return typeof t==="boolean"}function Ik(t){return t===null}function Sk(t){return t==null}function Ek(t){return typeof t==="number"}function Dk(t){return typeof t==="string"}function kk(t){return typeof t==="symbol"}function Tk(t){return t===void 0}function Ak(t){return Lk(t)&&Rk(t)==="[object RegExp]"}function Lk(t){return typeof t==="object"&&t!==null}function _k(t){return Lk(t)&&Rk(t)==="[object Date]"}function Ck(t){return Lk(t)&&(Rk(t)==="[object Error]"||t instanceof Error)}function Ok(t){return typeof t==="function"}function zk(t){return t===null||typeof t==="boolean"||typeof t==="number"||typeof t==="string"||typeof t==="symbol"||typeof t==="undefined"}function jk(t){return Uo.isBuffer(t)}function Rk(t){return Object.prototype.toString.call(t)}function $k(t){return t<10?"0"+t.toString(10):t.toString(10)}var Fk=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Pk(){var t=new Date;var e=[$k(t.getHours()),$k(t.getMinutes()),$k(t.getSeconds())].join(":");return[t.getDate(),Fk[t.getMonth()],e].join(" ")}function Bk(){console.log("%s - %s",Pk(),ak.apply(null,arguments))}function Gk(t,e){if(!e||!Lk(e))return t;var n=Object.keys(e);var r=n.length;while(r--){t[n[r]]=e[n[r]]}return t}function Uk(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var Wk={inherits:ik,_extend:Gk,log:Bk,isBuffer:jk,isPrimitive:zk,isFunction:Ok,isError:Ck,isDate:_k,isObject:Lk,isRegExp:Ak,isUndefined:Tk,isSymbol:kk,isString:Dk,isNumber:Ek,isNullOrUndefined:Sk,isNull:Ik,isBoolean:Mk,isArray:xk,inspect:hk,deprecate:ck,format:ak,debuglog:lk};var Yk=Object.freeze({__proto__:null,_extend:Gk,debuglog:lk,default:Wk,deprecate:ck,format:ak,inherits:ik,inspect:hk,isArray:xk,isBoolean:Mk,isBuffer:jk,isDate:_k,isError:Ck,isFunction:Ok,isNull:Ik,isNullOrUndefined:Sk,isNumber:Ek,isObject:Lk,isPrimitive:zk,isRegExp:Ak,isString:Dk,isSymbol:kk,isUndefined:Tk,log:Bk});var Vk=l(Yk);var Zk;function Qk(){}Qk.prototype=Object.create(null);function Hk(){Hk.init.call(this)}Hk.EventEmitter=Hk;Hk.usingDomains=false;Hk.prototype.domain=undefined;Hk.prototype._events=undefined;Hk.prototype._maxListeners=undefined;Hk.defaultMaxListeners=10;Hk.init=function(){this.domain=null;if(Hk.usingDomains){if(Zk.active&&!(this instanceof Zk.Domain)){this.domain=Zk.active}}if(!this._events||this._events===Object.getPrototypeOf(this)._events){this._events=new Qk;this._eventsCount=0}this._maxListeners=this._maxListeners||undefined};Hk.prototype.setMaxListeners=function t(e){if(typeof e!=="number"||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');this._maxListeners=e;return this};function Jk(t){if(t._maxListeners===undefined)return Hk.defaultMaxListeners;return t._maxListeners}Hk.prototype.getMaxListeners=function t(){return Jk(this)};function qk(t,e,n){if(e)t.call(n);else{var r=t.length;var s=aT(t,r);for(var i=0;i<r;++i)s[i].call(n)}}function Xk(t,e,n,r){if(e)t.call(n,r);else{var s=t.length;var i=aT(t,s);for(var o=0;o<s;++o)i[o].call(n,r)}}function Kk(t,e,n,r,s){if(e)t.call(n,r,s);else{var i=t.length;var o=aT(t,i);for(var a=0;a<i;++a)o[a].call(n,r,s)}}function tT(t,e,n,r,s,i){if(e)t.call(n,r,s,i);else{var o=t.length;var a=aT(t,o);for(var c=0;c<o;++c)a[c].call(n,r,s,i)}}function eT(t,e,n,r){if(e)t.apply(n,r);else{var s=t.length;var i=aT(t,s);for(var o=0;o<s;++o)i[o].apply(n,r)}}Hk.prototype.emit=function t(e){var n,r,s,i,o,a,c;var u=e==="error";a=this._events;if(a)u=u&&a.error==null;else if(!u)return false;c=this.domain;if(u){n=arguments[1];if(c){if(!n)n=new Error('Uncaught, unspecified "error" event');n.domainEmitter=this;n.domain=c;n.domainThrown=false;c.emit("error",n)}else if(n instanceof Error){throw n}else{var f=new Error('Uncaught, unspecified "error" event. ('+n+")");f.context=n;throw f}return false}r=a[e];if(!r)return false;var l=typeof r==="function";s=arguments.length;switch(s){case 1:qk(r,l,this);break;case 2:Xk(r,l,this,arguments[1]);break;case 3:Kk(r,l,this,arguments[1],arguments[2]);break;case 4:tT(r,l,this,arguments[1],arguments[2],arguments[3]);break;default:i=new Array(s-1);for(o=1;o<s;o++)i[o-1]=arguments[o];eT(r,l,this,i)}return true};function nT(t,e,n,r){var s;var i;var o;if(typeof n!=="function")throw new TypeError('"listener" argument must be a function');i=t._events;if(!i){i=t._events=new Qk;t._eventsCount=0}else{if(i.newListener){t.emit("newListener",e,n.listener?n.listener:n);i=t._events}o=i[e]}if(!o){o=i[e]=n;++t._eventsCount}else{if(typeof o==="function"){o=i[e]=r?[n,o]:[o,n]}else{if(r){o.unshift(n)}else{o.push(n)}}if(!o.warned){s=Jk(t);if(s&&s>0&&o.length>s){o.warned=true;var a=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+e+" listeners added. "+"Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning";a.emitter=t;a.type=e;a.count=o.length;rT(a)}}}return t}function rT(t){typeof console.warn==="function"?console.warn(t):console.log(t)}Hk.prototype.addListener=function t(e,n){return nT(this,e,n,false)};Hk.prototype.on=Hk.prototype.addListener;Hk.prototype.prependListener=function t(e,n){return nT(this,e,n,true)};function sT(t,e,n){var r=false;function s(){t.removeListener(e,s);if(!r){r=true;n.apply(t,arguments)}}s.listener=n;return s}Hk.prototype.once=function t(e,n){if(typeof n!=="function")throw new TypeError('"listener" argument must be a function');this.on(e,sT(this,e,n));return this};Hk.prototype.prependOnceListener=function t(e,n){if(typeof n!=="function")throw new TypeError('"listener" argument must be a function');this.prependListener(e,sT(this,e,n));return this};Hk.prototype.removeListener=function t(e,n){var r,s,i,o,a;if(typeof n!=="function")throw new TypeError('"listener" argument must be a function');s=this._events;if(!s)return this;r=s[e];if(!r)return this;if(r===n||r.listener&&r.listener===n){if(--this._eventsCount===0)this._events=new Qk;else{delete s[e];if(s.removeListener)this.emit("removeListener",e,r.listener||n)}}else if(typeof r!=="function"){i=-1;for(o=r.length;o-- >0;){if(r[o]===n||r[o].listener&&r[o].listener===n){a=r[o].listener;i=o;break}}if(i<0)return this;if(r.length===1){r[0]=undefined;if(--this._eventsCount===0){this._events=new Qk;return this}else{delete s[e]}}else{oT(r,i)}if(s.removeListener)this.emit("removeListener",e,a||n)}return this};Hk.prototype.removeAllListeners=function t(e){var n,r;r=this._events;if(!r)return this;if(!r.removeListener){if(arguments.length===0){this._events=new Qk;this._eventsCount=0}else if(r[e]){if(--this._eventsCount===0)this._events=new Qk;else delete r[e]}return this}if(arguments.length===0){var s=Object.keys(r);for(var i=0,o;i<s.length;++i){o=s[i];if(o==="removeListener")continue;this.removeAllListeners(o)}this.removeAllListeners("removeListener");this._events=new Qk;this._eventsCount=0;return this}n=r[e];if(typeof n==="function"){this.removeListener(e,n)}else if(n){do{this.removeListener(e,n[n.length-1])}while(n[0])}return this};Hk.prototype.listeners=function t(e){var n;var r;var s=this._events;if(!s)r=[];else{n=s[e];if(!n)r=[];else if(typeof n==="function")r=[n.listener||n];else r=cT(n)}return r};Hk.listenerCount=function(t,e){if(typeof t.listenerCount==="function"){return t.listenerCount(e)}else{return iT.call(t,e)}};Hk.prototype.listenerCount=iT;function iT(t){var e=this._events;if(e){var n=e[t];if(typeof n==="function"){return 1}else if(n){return n.length}}return 0}Hk.prototype.eventNames=function t(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};function oT(t,e){for(var n=e,r=n+1,s=t.length;r<s;n+=1,r+=1)t[n]=t[r];t.pop()}function aT(t,e){var n=new Array(e);while(e--)n[e]=t[e];return n}function cT(t){var e=new Array(t.length);for(var n=0;n<e.length;++n){e[n]=t[n].listener||t[n]}return e}function uT(){this.head=null;this.tail=null;this.length=0}uT.prototype.push=function(t){var e={data:t,next:null};if(this.length>0)this.tail.next=e;else this.head=e;this.tail=e;++this.length};uT.prototype.unshift=function(t){var e={data:t,next:this.head};if(this.length===0)this.tail=e;this.head=e;++this.length};uT.prototype.shift=function(){if(this.length===0)return;var t=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;--this.length;return t};uT.prototype.clear=function(){this.head=this.tail=null;this.length=0};uT.prototype.join=function(t){if(this.length===0)return"";var e=this.head;var n=""+e.data;while(e=e.next){n+=t+e.data}return n};uT.prototype.concat=function(t){if(this.length===0)return Uo.alloc(0);if(this.length===1)return this.head.data;var e=Uo.allocUnsafe(t>>>0);var n=this.head;var r=0;while(n){n.data.copy(e,r);r+=n.data.length;n=n.next}return e};var fT={};var lT={exports:{}};var hT=l(Pa);
|
|
5930
|
+
*/var vE=nt.exports;var NE;function xE(){if(NE)return nt.exports;NE=1;(function(t,e){!function(t,n){n(e,wE,bE)}(vE,(function(t,e,n){const r={1:{name:"/m/01g317",id:1,displayName:"person"},2:{name:"/m/0199g",id:2,displayName:"bicycle"},3:{name:"/m/0k4j",id:3,displayName:"car"},4:{name:"/m/04_sv",id:4,displayName:"motorcycle"},5:{name:"/m/05czz6l",id:5,displayName:"airplane"},6:{name:"/m/01bjv",id:6,displayName:"bus"},7:{name:"/m/07jdr",id:7,displayName:"train"},8:{name:"/m/07r04",id:8,displayName:"truck"},9:{name:"/m/019jd",id:9,displayName:"boat"},10:{name:"/m/015qff",id:10,displayName:"traffic light"},11:{name:"/m/01pns0",id:11,displayName:"fire hydrant"},13:{name:"/m/02pv19",id:13,displayName:"stop sign"},14:{name:"/m/015qbp",id:14,displayName:"parking meter"},15:{name:"/m/0cvnqh",id:15,displayName:"bench"},16:{name:"/m/015p6",id:16,displayName:"bird"},17:{name:"/m/01yrx",id:17,displayName:"cat"},18:{name:"/m/0bt9lr",id:18,displayName:"dog"},19:{name:"/m/03k3r",id:19,displayName:"horse"},20:{name:"/m/07bgp",id:20,displayName:"sheep"},21:{name:"/m/01xq0k1",id:21,displayName:"cow"},22:{name:"/m/0bwd_0j",id:22,displayName:"elephant"},23:{name:"/m/01dws",id:23,displayName:"bear"},24:{name:"/m/0898b",id:24,displayName:"zebra"},25:{name:"/m/03bk1",id:25,displayName:"giraffe"},27:{name:"/m/01940j",id:27,displayName:"backpack"},28:{name:"/m/0hnnb",id:28,displayName:"umbrella"},31:{name:"/m/080hkjn",id:31,displayName:"handbag"},32:{name:"/m/01rkbr",id:32,displayName:"tie"},33:{name:"/m/01s55n",id:33,displayName:"suitcase"},34:{name:"/m/02wmf",id:34,displayName:"frisbee"},35:{name:"/m/071p9",id:35,displayName:"skis"},36:{name:"/m/06__v",id:36,displayName:"snowboard"},37:{name:"/m/018xm",id:37,displayName:"sports ball"},38:{name:"/m/02zt3",id:38,displayName:"kite"},39:{name:"/m/03g8mr",id:39,displayName:"baseball bat"},40:{name:"/m/03grzl",id:40,displayName:"baseball glove"},41:{name:"/m/06_fw",id:41,displayName:"skateboard"},42:{name:"/m/019w40",id:42,displayName:"surfboard"},43:{name:"/m/0dv9c",id:43,displayName:"tennis racket"},44:{name:"/m/04dr76w",id:44,displayName:"bottle"},46:{name:"/m/09tvcd",id:46,displayName:"wine glass"},47:{name:"/m/08gqpm",id:47,displayName:"cup"},48:{name:"/m/0dt3t",id:48,displayName:"fork"},49:{name:"/m/04ctx",id:49,displayName:"knife"},50:{name:"/m/0cmx8",id:50,displayName:"spoon"},51:{name:"/m/04kkgm",id:51,displayName:"bowl"},52:{name:"/m/09qck",id:52,displayName:"banana"},53:{name:"/m/014j1m",id:53,displayName:"apple"},54:{name:"/m/0l515",id:54,displayName:"sandwich"},55:{name:"/m/0cyhj_",id:55,displayName:"orange"},56:{name:"/m/0hkxq",id:56,displayName:"broccoli"},57:{name:"/m/0fj52s",id:57,displayName:"carrot"},58:{name:"/m/01b9xk",id:58,displayName:"hot dog"},59:{name:"/m/0663v",id:59,displayName:"pizza"},60:{name:"/m/0jy4k",id:60,displayName:"donut"},61:{name:"/m/0fszt",id:61,displayName:"cake"},62:{name:"/m/01mzpv",id:62,displayName:"chair"},63:{name:"/m/02crq1",id:63,displayName:"couch"},64:{name:"/m/03fp41",id:64,displayName:"potted plant"},65:{name:"/m/03ssj5",id:65,displayName:"bed"},67:{name:"/m/04bcr3",id:67,displayName:"dining table"},70:{name:"/m/09g1w",id:70,displayName:"toilet"},72:{name:"/m/07c52",id:72,displayName:"tv"},73:{name:"/m/01c648",id:73,displayName:"laptop"},74:{name:"/m/020lf",id:74,displayName:"mouse"},75:{name:"/m/0qjjc",id:75,displayName:"remote"},76:{name:"/m/01m2v",id:76,displayName:"keyboard"},77:{name:"/m/050k8",id:77,displayName:"cell phone"},78:{name:"/m/0fx9l",id:78,displayName:"microwave"},79:{name:"/m/029bxz",id:79,displayName:"oven"},80:{name:"/m/01k6s3",id:80,displayName:"toaster"},81:{name:"/m/0130jx",id:81,displayName:"sink"},82:{name:"/m/040b_t",id:82,displayName:"refrigerator"},84:{name:"/m/0bt_c3",id:84,displayName:"book"},85:{name:"/m/01x3z",id:85,displayName:"clock"},86:{name:"/m/02s195",id:86,displayName:"vase"},87:{name:"/m/01lsmm",id:87,displayName:"scissors"},88:{name:"/m/0kmg4",id:88,displayName:"teddy bear"},89:{name:"/m/03wvsk",id:89,displayName:"hair drier"},90:{name:"/m/012xff",id:90,displayName:"toothbrush"}};class s{constructor(t,e){this.modelPath=e||`https://storage.googleapis.com/tfjs-models/savedmodel/${this.getPrefix(t)}/model.json`}getPrefix(t){return"lite_mobilenet_v2"===t?`ssd${t}`:`ssd_${t}`}async load(){this.model=await e.loadGraphModel(this.modelPath);const t=n.zeros([1,300,300,3],"int32"),r=await this.model.executeAsync(t);await Promise.all(r.map((t=>t.data()))),r.map((t=>t.dispose())),t.dispose()}async infer(t,e,r){const s=n.tidy((()=>(t instanceof n.Tensor||(t=n.browser.fromPixels(t)),n.expandDims(t)))),i=s.shape[1],o=s.shape[2],a=await this.model.executeAsync(s),c=a[0].dataSync(),u=a[1].dataSync();s.dispose(),n.dispose(a);const[f,l]=this.calculateMaxScores(c,a[0].shape[1],a[0].shape[2]),h=n.getBackend();"webgl"===n.getBackend()&&n.setBackend("cpu");const d=n.tidy((()=>{const t=n.tensor2d(u,[a[1].shape[1],a[1].shape[3]]);return n.image.nonMaxSuppression(t,f,e,r,r)})),p=d.dataSync();return d.dispose(),h!==n.getBackend()&&n.setBackend(h),this.buildDetectedObjects(o,i,u,f,p,l)}buildDetectedObjects(t,e,n,s,i,o){const a=i.length,c=[];for(let u=0;u<a;u++){const a=[];for(let t=0;t<4;t++)a[t]=n[4*i[u]+t];const f=a[0]*e,l=a[1]*t,h=a[2]*e,d=a[3]*t;a[0]=l,a[1]=f,a[2]=d-l,a[3]=h-f,c.push({bbox:a,class:r[o[i[u]]+1].displayName,score:s[i[u]]})}return c}calculateMaxScores(t,e,n){const r=[],s=[];for(let i=0;i<e;i++){let e=Number.MIN_VALUE,o=-1;for(let r=0;r<n;r++)t[i*n+r]>e&&(e=t[i*n+r],o=r);r[i]=e,s[i]=o}return[r,s]}async detect(t,e=20,n=.5){return this.infer(t,e,n)}dispose(){null!=this.model&&this.model.dispose()}}t.ObjectDetection=s,t.load=async function(t={}){if(null==n)throw new Error("Cannot find TensorFlow.js. If you are using a <script> tag, please also include @tensorflow/tfjs on the page before using this model.");const e=t.base||"lite_mobilenet_v2",r=t.modelUrl;if(-1===["mobilenet_v1","mobilenet_v2","lite_mobilenet_v2"].indexOf(e))throw new Error(`ObjectDetection constructed with invalid base model ${e}. Valid names are 'mobilenet_v1', 'mobilenet_v2' and 'lite_mobilenet_v2'.`);const i=new s(e,r);return await i.load(),i},t.version="2.2.3",Object.defineProperty(t,"__esModule",{value:true})}))})(nt,nt.exports);return nt.exports}var ME=xE();const IE=".camera{color:white;display:flex;align-items:center;justify-content:center;position:relative}.cameraCanvas,.cameraCanvasSelfie,.cameraCanvasSelfieDesk{z-index:3;max-width:100%;max-height:100%;border-radius:10px}.cameraCanvasSelfie,.cameraCanvasSelfieDesk{transform:scale(-1, 1);-webkit-transform:scale(-1, 1)}.cameraVideo,.cameraVideoSelfie,.cameraVideoSelfieDesk{z-index:2;max-width:100%;max-height:100%;border-radius:10px}.cameraVideoSelfie,.cameraVideoSelfieDesk{transform:scale(-1, 1);-webkit-transform:scale(-1, 1)}.id-guide-rectangle{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);width:70%;padding-bottom:calc(70% / 1.58);border:3px dashed rgba(255, 255, 255, 0.7);border-radius:8px;z-index:5;pointer-events:none;box-sizing:border-box}.countdown-overlay-style{position:absolute;inset:0;background-color:rgba(0, 0, 0, 0.5);display:flex;align-items:center;justify-content:center;z-index:6}.video-overlay-canvas{position:absolute;top:0;left:0;width:100%;height:100%;z-index:7;pointer-events:none}.capture-flash-overlay{position:absolute;top:0;left:0;width:100%;height:100%;background-color:white;opacity:0;animation:capture-flash 0.2s ease-out;pointer-events:none;z-index:10}@keyframes bounce{0%,100%{transform:translateY(-25%);animation-timing-function:cubic-bezier(0.8, 0, 1, 1)}50%{transform:none;animation-timing-function:cubic-bezier(0, 0, 0.2, 1)}}.animate-bounce{animation:bounce 1s infinite}@keyframes capture-flash{0%{opacity:0}50%{opacity:1}100%{opacity:0}}.countdown-text-style{color:white;font-size:8rem;font-weight:bold;animation:bounce 1s infinite;}";var SE;(function(t){t["JPEG"]="image/jpeg";t["PNG"]="image/png"})(SE||(SE={}));const EE=class{constructor(n){t(this,n);this.eventPhotoCapture=e(this,"photoIdCapture");this.eventRecordingIdReady=e(this,"recordingIdCapture");this.eventTimeElapsed=e(this,"timeElapsed");this.mediaRecorder=null;this.mediaStream=null;this.animationFrameId=null;this.processingsCount=0;this.objectDetectionModel=null;this.canvasContext=null;this.processingContext=null;this.overlayContext=null;this.recordedChunks=[];this.countdown=0;this.isCapturing=false;this.mode="idle";this.tfjsReady=false;this.detectedArea=null;this.startRecording=()=>{if(this.mediaStream&&this.videoElement){this.recordedChunks=[];var t={mimeType:p.webmMimeType.mime,videoBitsPerSecond:13e5};if(!MediaRecorder.isTypeSupported(t.mimeType)){if(o.device.mobileOS==g.iOS||o.device.browser==v.Safari)t.mimeType=p.mp4MimeType.mime}this.mediaRecorder=new MediaRecorder(this.mediaStream,{mimeType:"video/webm"});this.mediaRecorder.ondataavailable=({data:t})=>{if(t.size>0){this.recordedChunks=[...this.recordedChunks,t]}};this.mediaRecorder.onstop=()=>{if(this.recordedChunks.length>0){var e=new Blob(this.recordedChunks,{type:t.mimeType.split(";")[0]});this.eventRecordingIdReady.emit(e);this.mode="done"}};this.mediaRecorder.start();console.log("Recording started...")}};this.stopRecording=()=>{if(this.mediaRecorder&&this.mediaRecorder.state==="recording"){this.mediaRecorder.stop();console.log("Recording stopped.")}};this.capture=()=>{if(this.videoElement&&this.canvasElement){const t=this.videoElement;const e=this.canvasElement;const n=this.canvasContext;e.width=t.videoWidth;e.height=t.videoHeight;n.drawImage(t,0,0,e.width,e.height);let r=null;e.toBlob((t=>{if(t&&t.type===SE.JPEG&&!o.device.isAppleDevice){try{if(o.debug)console.log("stream | getFrame | addExifInImg");N(t,this.mediaStream.getTracks()[0],{width:this.videoElement.videoWidth,height:this.videoElement.videoHeight}).then((t=>{r=t}))}catch(t){this.eventTimeElapsed.emit()}}else{if(o.debug)console.log("stream | getFrame | resolve");r=t}}),SE.PNG,1);console.log("Image captured!");this.isCapturing=true;setTimeout((()=>{this.isCapturing=false}),200);this.eventPhotoCapture.emit(r)}else{console.error("Video element or canvas element not found. Cannot capture image.")}};this.startFrameProcessing=()=>{if(this.animationFrameId===null){this.animationFrameId=requestAnimationFrame((()=>this.processVideoFrame()))}};this.handleStartTiltDetection=()=>{console.log("Detecting tilt... Please tilt the ID. (Rectangle will appear on detected object).");this.mode="detecting_tilt_live";this.detectedArea=null;if(this.overlayContext){this.overlayContext.clearRect(0,0,this.overlayCanvasElement.width,this.overlayCanvasElement.height)}this.startFrameProcessing()};this.handleStartDetection=async()=>{if(!this.mediaStream){console.log("Camera not ready. Please allow camera access.");return}console.log("Starting ID detection...");this.mode="detecting_straight_id";this.recordedChunks=[];this.detectedArea=null;this.countdown=0;this.processingsCount=0;if(this.overlayContext){this.overlayContext.clearRect(0,0,this.overlayCanvasElement.width,this.overlayCanvasElement.height)}if(this.videoElement&&this.videoElement.readyState<3){console.log("Waiting for video stream to fully load...");await new Promise((t=>{const e=()=>{this.videoElement.removeEventListener("canplaythrough",e);t()};this.videoElement.addEventListener("canplaythrough",e)}));console.log("Video stream ready. Starting detection.")}this.startRecording();this.startFrameProcessing()}}async componentWillLoad(){this.translations=await m.getValues()}async componentDidLoad(){this.initVariables();if(this.canvasElement){this.canvasContext=this.canvasElement.getContext("2d",{willReadFrequently:true})}if(this.processingCanvasElement){this.processingContext=this.processingCanvasElement.getContext("2d",{willReadFrequently:true})}if(this.overlayCanvasElement){this.overlayContext=this.overlayCanvasElement.getContext("2d",{willReadFrequently:true})}console.log("Loading AI model...");try{this.objectDetectionModel=await ME.load();this.tfjsReady=true;console.log('AI model loaded. Camera ready. Click "Start ID Detection" to begin.');this.getMedia();this.mode="idle"}catch(t){console.error("Error loading TensorFlow.js model:",t);console.log("Error: Could not load AI model. Please refresh. (Check console for details).");this.tfjsReady=false;this.mode="idle"}this.handleStartDetection()}initVariables(){if(o.debug)console.log("id-capture | initVariables");if(o.flowStatus==a.IDFRONT){this.titleMesage=this.translations.IdCaptureValues.Title}else if(o.flowStatus==a.IDBACK){this.titleMesage=this.translations.IdCaptureValues.TitleBack}else if(o.flowStatus==a.IDTILT){this.titleMesage=this.translations.IdCaptureValues.IDPoseMapping}}disconnectedCallback(){if(this.mediaStream){this.mediaStream.getTracks().forEach((t=>t.stop()))}if(this.animationFrameId!==null){cancelAnimationFrame(this.animationFrameId);this.animationFrameId=null}if(this.overlayContext){this.overlayContext.clearRect(0,0,this.overlayCanvasElement.width,this.overlayCanvasElement.height)}this.detectedArea=null}async getMedia(){try{if(!o.cameraId){await p.InitCameras(o.device)}const t=p.GetConstraints(o.cameraId,o.device);const e=await navigator.mediaDevices.getUserMedia(t);if(this.videoElement){this.videoElement.srcObject=e;this.videoElement.play()}this.mediaStream=e;this.mode="idle"}catch(t){console.error("Error accessing camera:",t);this.mode="idle"}}async detectIdWithTensorFlow(t,e=.6){if(!this.objectDetectionModel)return null;try{const n=await this.objectDetectionModel.detect(t);const r=["book","cell phone","remote","keyboard","laptop"];let s=null;let i=0;for(const t of n){const[n,o]=t.bbox;const a=n*o;if(r.includes(t.class)&&t.score>e&&a>5e3){if(a>i){i=a;s=t}}}return s}catch(t){console.error("TensorFlow.js detection error:",t);return null}}async processVideoFrame(){if(this.videoElement&&this.processingCanvasElement&&this.overlayCanvasElement&&this.tfjsReady&&(this.mode==="detecting_straight_id"||this.mode==="detecting_tilt_live")&&this.videoElement.readyState>=2&&this.processingContext&&this.overlayContext&&this.processingsCount<100){this.processingsCount++;const t=this.videoElement;const e=this.processingCanvasElement;const n=this.overlayCanvasElement;const r=this.processingContext;const s=this.overlayContext;s.clearRect(0,0,n.width,n.height);e.width=t.videoWidth;e.height=t.videoHeight;n.width=t.videoWidth;n.height=t.videoHeight;r.drawImage(t,0,0,e.width,e.height);let i=await this.detectIdWithTensorFlow(t);try{if(i){const[e,r,o,a]=i.bbox;const c=o/a;const u=o*a;let f="blue";let l=`Detected: ${i.class} (${(i.score*100).toFixed(1)}%). Area: ${u.toFixed(0)} px²`;this.detectedArea=u;if(this.mode==="detecting_straight_id"){if(c>1.4&&c<1.8&&u>t.videoWidth*t.videoHeight*.1){f="green";console.log("Straight ID detected! Starting countdown...");this.countdown=3;if(this.animationFrameId!==null){cancelAnimationFrame(this.animationFrameId);this.animationFrameId=null}this.mode="countdown_capture";const t=setInterval((()=>{this.countdown--;if(this.countdown<=0){clearInterval(t);this.capture();console.log('ID captured! Click "Start Tilt Detection" to analyze tilt.');this.countdown=0;this.detectedArea=null;s.clearRect(0,0,n.width,n.height);this.mode="awaiting_tilt_start"}}),1e3);this.handleStartTiltDetection();return}else{f="red";console.log("Looking for straight ID... Please align your ID with the guide.")}}else if(this.mode==="detecting_tilt_live"){if(c>1.4&&c<1.8){f="green";console.log(`ID is relatively straight (Aspect Ratio: ${c.toFixed(2)}).`)}else{f="yellow";console.log(`ID appears tilted (Aspect Ratio: ${c.toFixed(2)}).`);this.stopRecording()}console.log("Detecting tilt... Observe the highlighted object.")}s.strokeStyle=f;s.lineWidth=4;s.strokeRect(e,r,o,a);s.fillStyle=f;s.font="24px Arial";s.fillText(`${i.class} (${(i.score*100).toFixed(1)}%)`,e,r>20?r-10:r+25);console.log(l)}else{this.detectedArea=null;if(this.mode==="detecting_straight_id"){console.log("No ID detected. Please ensure ID is visible.")}else if(this.mode==="detecting_tilt_live"){console.log("No object detected for tilt analysis.")}}}catch(t){console.error("TensorFlow.js processing error:",t);console.log("AI processing error. See console for details.");this.mode="idle";this.detectedArea=null;if(this.animationFrameId!==null){cancelAnimationFrame(this.animationFrameId);this.animationFrameId=null}if(this.overlayContext){this.overlayContext.clearRect(0,0,this.overlayCanvasElement.width,this.overlayCanvasElement.height)}}finally{}if(this.mode==="detecting_straight_id"||this.mode==="detecting_tilt_live"){setTimeout((()=>{if(this.mode==="detecting_straight_id"||this.mode==="detecting_tilt_live"){this.animationFrameId=requestAnimationFrame((()=>this.processVideoFrame()))}}),100)}else{if(this.animationFrameId!==null){cancelAnimationFrame(this.animationFrameId);this.animationFrameId=null}}}if(this.processingsCount>=100){console.warn("Maximum processing frames reached. Stopping further processing.");this.mode="idle";this.processingsCount=0;if(this.animationFrameId!==null){cancelAnimationFrame(this.animationFrameId);this.animationFrameId=null}this.eventTimeElapsed.emit()}}render(){let t="cameraVideo";if(o.device.isDesktop){t="cameraVideoSelfieDesk"}return n("div",{key:"310d4588eb5b448db05b3c82e2ca5c2f1f380b3f",class:"container flex center"},n("div",{key:"f369228d380b691dbfb97e0eb0fa913e0ca7d1f3",class:"px-2 w-100"},n("h1",{key:"d3848595beff87b9efad7d54bc83d163ae79a562",class:this.titleStyle,innerHTML:this.titleMesage}),n("div",{key:"92f7f919f9cbb661404cb9f5d7edd5796a6608c9",class:"w-100 h-100 rounded"},n("div",{key:"3704224879624681da74a2dbb829609e929dc8f8",class:"camera rounded"},n("video",{key:"94386529d5f8e058111bcebae84e6af7c14be5bb",id:"video",loop:true,autoplay:true,playsinline:true,muted:true,class:t,ref:t=>this.videoElement=t}),n("canvas",{key:"2dffd61323ce333218b0b544c8d6e22eb25bd5a6",id:"output",ref:t=>this.canvasElement=t,style:{display:"none"}}),n("canvas",{key:"6a7a169a576a4e29782400511dffbe20ab19fcd8",id:"processingCanvasElement",ref:t=>this.processingCanvasElement=t,style:{display:"none"}}),n("canvas",{key:"b49aebfbe1c93833d5fec4e43fb892e599c42511",id:"overlayCanvasElement",ref:t=>this.overlayCanvasElement=t,class:"video-overlay-canvas"}),n("div",{key:"d2cff9830aec135f74c9dc7cbc4cb598f59ebd4a",class:"id-guide-rectangle"}),this.isCapturing&&n("div",{key:"737fb40332ceed6211ef48f06c7e4b090cc163e4",class:"capture-flash-overlay"}),this.countdown>0&&n("div",{key:"5301eb32f68a2a3563f8aad36482369cf4f5948a",class:"countdown-overlay-style"},n("span",{key:"a5478095bbbe7ee1f1e4840ae1a0a13e123cf622",class:"countdown-text-style"},this.countdown)))),n("div",{key:"b6f182d84f2b81762fb02576652edc8518c723b9",class:"footer text-center"},n("img",{key:"08cf7eaed7e81373ffcdefec4bc957693f3e57a8",src:y}))))}get el(){return r(this)}};EE.style=IE;const DE="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1Mi4yOTIiIGhlaWdodD0iNDMuODU4IiB2aWV3Qm94PSIwIDAgNTIuMjkyIDQzLjg1OCI+DQogIDxnIGlkPSJpZC1jYXJkIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMTcgLTI5KSI+DQogICAgPHBhdGggaWQ9IlBhdGhfNDc1MSIgZGF0YS1uYW1lPSJQYXRoIDQ3NTEiIGQ9Ik0yMC4zNzQsNjYuOTU0aDIyLjM1YS44NDMuODQzLDAsMCwwLDAtMS42ODdIMjAuMzc0YTEuNjg5LDEuNjg5LDAsMCwxLTEuNjg3LTEuNjg3VjMyLjM3NGExLjY4OSwxLjY4OSwwLDAsMSwxLjY4Ny0xLjY4N0g2NS45MThBMS42ODksMS42ODksMCwwLDEsNjcuNiwzMi4zNzRWNDkuMjQyYS44NDMuODQzLDAsMCwwLDEuNjg3LDBWMzIuMzc0QTMuMzc4LDMuMzc4LDAsMCwwLDY1LjkxOCwyOUgyMC4zNzRBMy4zNzgsMy4zNzgsMCwwLDAsMTcsMzIuMzc0VjYzLjU4QTMuMzc4LDMuMzc4LDAsMCwwLDIwLjM3NCw2Ni45NTRaIiBmaWxsPSIjMjUyYzgyIi8+DQogICAgPHBhdGggaWQ9IlBhdGhfNDc1MiIgZGF0YS1uYW1lPSJQYXRoIDQ3NTIiIGQ9Ik01MC42NTEsNTAuMzI2YTYuMzI2LDYuMzI2LDAsMSwwLTYuMzI2LDYuMzI2QTYuMzMzLDYuMzMzLDAsMCwwLDUwLjY1MSw1MC4zMjZabS0xMC45NjQsMGE0LjYzOSw0LjYzOSwwLDEsMSw0LjYzOSw0LjYzOUE0LjY0NCw0LjY0NCwwLDAsMSwzOS42ODcsNTAuMzI2WiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTEyLjE0NCAtOC42NzQpIiBmaWxsPSIjMjUyYzgyIi8+DQogICAgPHBhdGggaWQ9IlBhdGhfNDc1MyIgZGF0YS1uYW1lPSJQYXRoIDQ3NTMiIGQ9Ik0zMiw4NC43NDd2My4zNzRhLjg0NC44NDQsMCwwLDAsLjg0My44NDNINDguODY4YS44NDQuODQ0LDAsMCwwLC44NDMtLjg0M1Y4NC43NDdBNi43NTUsNi43NTUsMCwwLDAsNDIuOTY0LDc4SDM4Ljc0N0E2Ljc1NSw2Ljc1NSwwLDAsMCwzMiw4NC43NDdabTYuNzQ3LTUuMDZoNC4yMTdhNS4wNjYsNS4wNjYsMCwwLDEsNS4wNiw1LjA2djIuNTNIMzMuNjg3di0yLjUzQTUuMDY2LDUuMDY2LDAsMCwxLDM4Ljc0Nyw3OS42ODdaIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtOC42NzQgLTI4LjMzNikiIGZpbGw9IiMyNTJjODIiLz4NCiAgICA8cGF0aCBpZD0iUGF0aF80NzU0IiBkYXRhLW5hbWU9IlBhdGggNDc1NCIgZD0iTTEwMi43MTIsNDhIODUuODQzYS44NDMuODQzLDAsMCwwLDAsMS42ODdoMTYuODY4YS44NDMuODQzLDAsMCwwLDAtMS42ODdaIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMzkuMzI0IC0xMC45ODgpIiBmaWxsPSIjMjUyYzgyIi8+DQogICAgPHBhdGggaWQ9IlBhdGhfNDc1NSIgZGF0YS1uYW1lPSJQYXRoIDQ3NTUiIGQ9Ik0xMDIuNzEyLDYySDg1Ljg0M2EuODQzLjg0MywwLDEsMCwwLDEuNjg3aDE2Ljg2OGEuODQzLjg0MywwLDAsMCwwLTEuNjg3WiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTM5LjMyNCAtMTkuMDg0KSIgZmlsbD0iIzI1MmM4MiIvPg0KICAgIDxwYXRoIGlkPSJQYXRoXzQ3NTYiIGRhdGEtbmFtZT0iUGF0aCA0NzU2IiBkPSJNOTUuMjI5LDc1YTEyLjIzLDEyLjIzLDAsMSwwLDEyLjIzLDEyLjIzQTEyLjI0NCwxMi4yNDQsMCwwLDAsOTUuMjI5LDc1Wm0wLDIyLjk3N0ExMC43NDcsMTAuNzQ3LDAsMSwxLDEwNS45NzcsODcuMjMsMTAuNzU5LDEwLjc1OSwwLDAsMSw5NS4yMjksOTcuOTc3WiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTM4LjE2NyAtMjYuNjAyKSIgZmlsbD0iIzI1MmM4MiIvPg0KICAgIDxwYXRoIGlkPSJQYXRoXzQ3NTciIGRhdGEtbmFtZT0iUGF0aCA0NzU3IiBkPSJNMTExLjA1OSw5OC43MTdsLTcuNDQ0LDcuNDQzLTQuODUtNC44NDlhLjc0MS43NDEsMCwwLDAtMS4wNDgsMS4wNDhsNS4zNzQsNS4zNzRhLjc0MS43NDEsMCwwLDAsMS4wNDgsMGw3Ljk2OC03Ljk2OGEuNzQxLjc0MSwwLDAsMC0xLjA0OC0xLjA0OFoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC00Ny4yOTQgLTQxLjM5MykiIGZpbGw9IiM3YmI0MGYiLz4NCiAgPC9nPg0KPC9zdmc+DQo=";const kE="";const TE=class{constructor(n){t(this,n);this.apiErrorEvent=e(this,"apiError")}async componentWillRender(){this.translations=await m.getValues()}componentWillLoad(){this.yesButtonPressed=false;this.noButtonPressed=false}async hasBackSelected(){this.yesButtonPressed=true;try{await i.instance.SetTwoSidedId()}catch(t){this.apiErrorEvent.emit(t)}}async onlyFrontSelected(){this.noButtonPressed=true;try{o.flowStatus=await i.instance.GetNextFlowState()}catch(t){this.apiErrorEvent.emit(t)}}render(){return n("div",{key:"32363483a5c9e0ce24f4a1ec38c1ebd586056ac8",class:"container flex center"},n("div",{key:"810f3a7151e7919b2376ff0048c22e40f93e54e2",class:"px-3"},n("div",{key:"850f88924e80e8be2a9c0b2a1877f8b4cf6c175a",class:"mb-1 ml-1 text-center"},n("img",{key:"9d5b28f36250ff31703f65c97deabff71ee171a5",src:DE,style:{width:"70px"}})),n("h1",{key:"78ef4252524228b48a6f66d2af8052cd41114a38",class:"text-center mb-1"},this.translations.IdSelectionValues.Title),n("div",{key:"7da764c9413fa799eb4a9bf48e6a4c9677d8115a",class:"color-blue mb-2 loud-text",innerHTML:this.translations.IdSelectionValues.Description}),!this.noButtonPressed?n("div",{class:"button flex mb-1"},this.yesButtonPressed?n("div",{class:"img-loader rounded img-loader-button"},n("img",{class:"loading-image loading-image-button",src:R})):null,n("button",{class:"main-button",type:"button",disabled:this.yesButtonPressed,onClick:()=>this.hasBackSelected()},this.translations.IdSelectionValues.ButtonYes)):null,n("div",{key:"08ce9802ea046375c547b048bfce2b95ab6ccca0"}),!this.yesButtonPressed?n("div",{class:"button flex mb-1"},this.noButtonPressed?n("div",{class:"img-loader rounded img-loader-button"},n("img",{class:"loading-image loading-image-button",src:R})):null,n("button",{class:"main-button",type:"button",disabled:this.noButtonPressed,onClick:()=>this.onlyFrontSelected()},this.translations.IdSelectionValues.ButtonNo)):null,n("div",{key:"9a384b0a0f7eb858bdcaea1c761d7151b21df473",class:"footer text-center"},n("img",{key:"f1132d1e237bcc496bb3874be2f5fb9e854b7548",src:y}))))}};TE.style=kE;const AE="4.7.55";var LE={version:AE};class _E{constructor(){var t,e,n,r;this.motionValues=[];this.orientationValues=[];this.addItemsToOrientation=t=>{this.orientationValues.push({beta:t.beta,gamma:t.gamma});if(this.orientationValues.length>5){window.removeEventListener("deviceorientation",this.addItemsToOrientation)}};this.addItemsToMotion=t=>{this.motionValues.push({x:t.acceleration.x,y:t.acceleration.y});if(this.motionValues.length>5){window.removeEventListener("devicemotion",this.addItemsToMotion)}};this.supportedScreenOrientation=(e=(t=((screen===null||screen===void 0?void 0:screen.orientation)||{}).type)!==null&&t!==void 0?t:screen.mozOrientation)!==null&&e!==void 0?e:screen.msOrientation;this.safariScreenOrientation=!(screen===null||screen===void 0?void 0:screen.orientation)&&matchMedia("(orientation: portrait)").matches?"portrait-primary":"landscape-primary";this.initialScreenOrientation=(r=(n=this.supportedScreenOrientation)!==null&&n!==void 0?n:this.safariScreenOrientation)!==null&&r!==void 0?r:"portrait-primary";this.userAgent=navigator.userAgent||navigator.vendor||window.opera||undefined;this.isMobile=this.isMobileDevice();this.isTablet=this.isTabletDevice();this.isDesktop=!this.isMobile&&!this.isTablet}isMobileDevice(){const t=[/(Android)(.+)(Mobile)/i,/BlackBerry/i,/iPhone|iPod/i,/Opera Mini/i,/IEMobile/i];return t.some((t=>this.userAgent.match(t)))}isTabletDevice(){const t=/(ipad|tablet|(android(?!.*mobile))|(windows(?!.*phone)(.*touch))|kindle|playbook|silk|(puffin(?!.*(IP|AP|WP))))/;return t.test(this.userAgent.toLowerCase())}getMobileOS(){if(this.isMobileDevice()){if(/windows phone/i.test(this.userAgent))return g.WindowsPhone;else if(/android/i.test(this.userAgent))return g.Android;else if(/iPad|iPhone|iPod/.test(this.userAgent)&&!window.MSStream)return g.iOS;return g.Unknown}else return undefined}getDesktopOS(){if(this.isDesktop){if(this.userAgent.indexOf("Win")!==-1)return x.Windows;else if(this.userAgent.indexOf("Mac")!==-1)return x.MacOS;else if(this.userAgent.indexOf("X11")!==-1)return x.Unix;else if(this.userAgent.indexOf("Linux")!==-1)return x.Linux;return x.Unknown}else return undefined}getDeviceOS(){var t;return(t=this.getMobileOS())!==null&&t!==void 0?t:this.getDesktopOS()}getBrowser(){if(/XiaoMi/i.test(this.userAgent)||/MiuiBrowser/i.test(this.userAgent))return v.Mi;var t=/chrome/i.test(this.userAgent);if(t)return v.Chrome;if(/firefox/i.test(navigator.userAgent))return v.Firefox;else if(!t&&/safari/i.test(navigator.userAgent))return v.Safari;else return v.Unknown}async checkIfMobileBySensors(){var t,e;if(typeof((t=window.DeviceMotionEvent)===null||t===void 0?void 0:t.requestPermission)==="function"){var n=window.DeviceMotionEvent.requestPermission();if(n==="granted"){await this.getMotionValues()}}else{await this.getMotionValues()}await E(200);var r=false;if(this.motionValues.length>0){r=this.motionValues.filter((t=>t.x!=0)).length>=3}if(typeof((e=window.DeviceOrientationEvent)===null||e===void 0?void 0:e.requestPermission)==="function"){var n=window.DeviceOrientationEvent.requestPermission();if(n==="granted"){await this.getOrientationValues()}}else{await this.getOrientationValues()}await E(500);var s=false;if(this.orientationValues.length>0){s=this.orientationValues.map((t=>t.beta)).every(((t,e,n)=>e==0?t!==n[n.length-1]:t!==n[e-1]))||this.orientationValues.map((t=>t.gamma)).every(((t,e,n)=>e==0?t!==n[n.length-1]:t!==n[e-1]))}return r||s}async getOrientationValues(){window.addEventListener("deviceorientation",this.addItemsToOrientation)}async getMotionValues(){window.addEventListener("devicemotion",this.addItemsToMotion)}async getDevice(){var t=await this.checkIfMobileBySensors();var e={isMobileBySensors:t,isDesktop:this.isDesktop,desktopOS:this.getDesktopOS(),isWindowsDesktop:this.getDeviceOS()===x.Windows,isLinuxOrUnixDesktop:this.getDeviceOS()===x.Linux||this.getDeviceOS()===x.Unix,isMobile:this.isMobile,mobileOS:this.getMobileOS(),isAndroidDevice:this.getDeviceOS()===g.Android,isAppleDevice:this.getDeviceOS()===g.iOS||this.getDeviceOS()===x.MacOS,isUnknownMobileDevice:this.getDeviceOS()===g.Unknown,browser:this.getBrowser(),isTablet:this.isTablet,initialScreenOrientation:this.initialScreenOrientation};return e}}const CE="@font-face{font-family:'Roboto';font-style:normal;font-display:swap;font-weight:100;src:url(./files/roboto-latin-ext-100-normal.woff2) format('woff2'), url(./files/roboto-latin-ext-100-normal.woff) format('woff')}@font-face{font-family:'Roboto';font-style:normal;font-display:swap;font-weight:200;src:url(./files/roboto-latin-ext-200-normal.woff2) format('woff2'), url(./files/roboto-latin-ext-200-normal.woff) format('woff')}@font-face{font-family:'Roboto';font-style:normal;font-display:swap;font-weight:300;src:url(./files/roboto-latin-ext-300-normal.woff2) format('woff2'), url(./files/roboto-latin-ext-300-normal.woff) format('woff')}@font-face{font-family:'Roboto';font-style:normal;font-display:swap;font-weight:400;src:url(./files/roboto-latin-ext-400-normal.woff2) format('woff2'), url(./files/roboto-latin-ext-400-normal.woff) format('woff')}@font-face{font-family:'Roboto';font-style:normal;font-display:swap;font-weight:500;src:url(./files/roboto-latin-ext-500-normal.woff2) format('woff2'), url(./files/roboto-latin-ext-500-normal.woff) format('woff')}@font-face{font-family:'Roboto';font-style:normal;font-display:swap;font-weight:600;src:url(./files/roboto-latin-ext-600-normal.woff2) format('woff2'), url(./files/roboto-latin-ext-600-normal.woff) format('woff')}@font-face{font-family:'Roboto';font-style:normal;font-display:swap;font-weight:700;src:url(./files/roboto-latin-ext-700-normal.woff2) format('woff2'), url(./files/roboto-latin-ext-700-normal.woff) format('woff')}@font-face{font-family:'Roboto';font-style:normal;font-display:swap;font-weight:800;src:url(./files/roboto-latin-ext-800-normal.woff2) format('woff2'), url(./files/roboto-latin-ext-800-normal.woff) format('woff')}@font-face{font-family:'Roboto';font-style:normal;font-display:swap;font-weight:900;src:url(./files/roboto-latin-ext-900-normal.woff2) format('woff2'), url(./files/roboto-latin-ext-900-normal.woff) format('woff')}*{font-family:'Roboto', sans-serif}[hidden]{visibility:hidden !important;opacity:0 !important}.full{width:100%;height:100%;left:0;top:0}.container{width:100%;height:100%;background-color:white;max-width:991px;margin:auto;position:relative;overflow:hidden}.flex{display:flex}.relative{position:relative}.d-block{display:block}.center{align-items:center;justify-content:center}.footer{position:relative;width:100%;margin-top:5vh}.w-100{width:100%}.h-100{height:100%}.px-1{padding-left:1em;padding-right:1em}.px-2{padding-left:2em;padding-right:2em}.px-3{padding-left:3em;padding-right:3em}.px-4{padding-left:4em;padding-right:4em}.py-1{padding-top:1em;padding-bottom:1em}.py-2{padding-top:2em;padding-bottom:2em}.py-3{padding-top:3em;padding-bottom:3em}.py-4{padding-top:4em;padding-bottom:4em}.mx-1{margin-left:1em;margin-right:1em}.mx-2{margin-left:2em;margin-right:2em}.mx-3{margin-left:3em;margin-right:3em}.mx-4{margin-left:4em;margin-right:4em}.my-1{margin-top:1em;margin-bottom:1em}.my-2{margin-top:2em;margin-bottom:2em}.my-3{margin-top:3em;margin-bottom:3em}.my-4{margin-top:4em;margin-bottom:4em}.ml-1{margin-left:1em}.ml-2{margin-left:2em}.ml-3{margin-left:3em}.ml-4{margin-left:4em}.mb-05{margin-bottom:0.5em}.mb-1{margin-bottom:1em}.mb-2{margin-bottom:2em}.mb-3{margin-bottom:3em}.mb-4{margin-bottom:4em}.mt-05{margin-top:0.5em}.mt-1{margin-top:1em}.mt-2{margin-top:2em}.mt-3{margin-top:3em}.mt-4{margin-top:4em}h1{color:#252c82;font-size:1.5em;margin:0}h2{font-weight:500;font-size:1.2em;margin:0;color:#525252}h3{font-size:1.4em;margin:0}.main-text{font-weight:400;color:#525252}.link-text{text-decoration:underline;color:#252c82d9}.rounded{border-radius:8px}.cit-selector{width:50%}.img-text{display:flex;align-items:center}.img-text .bg-img{width:4em;height:5em;display:flex;align-items:center;justify-content:center;flex:none;margin-right:1em}.button{position:relative}.img-loader{position:absolute;left:-2px;top:-2px;background:#ffffffc7;border:2px solid #252c82;box-shadow:3px 3px 6px #00000029}.img-loader.rounded{border-radius:11px}.img-loader-button{width:100%;height:100%}.img-loader-button.rounded{border-radius:50px}.loading-image-button{width:100%;height:100%;border-radius:25px}.main-button{background:#7bb40e;border-radius:50px;text-align:center;width:100%;padding:0.9em;color:#fff;border:0;font-size:1.1em;font-weight:600}.main-button:disabled{color:#fff;background:#bdbdbd}.color-red{color:#ff5353}.color-blue{color:#252c82}.loud-text{font-size:1.2em}.loud-text p{margin:0.6em 0}.modal{position:fixed;left:0;top:0;width:100%;height:100%;z-index:999;background:#8b8b8be0;visibility:visible;opacity:1;transition:visibility 0s, opacity 0.2s linear}.inner{background:white;box-shadow:3px 3px 6px #00000029;border-radius:10px;padding:2em;position:relative}.close-modal{position:absolute;top:1em;right:1em}.document-view{height:100%}.scroll{height:100%;overflow-x:hidden;overflow-y:auto;scroll-behavior:smooth;position:relative}.scroll:before{content:'';display:block;width:100%;height:15px;position:sticky;top:0;left:0;background:linear-gradient(180deg, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%)}.scroll:after{content:'';display:block;width:100%;height:15px;position:sticky;bottom:0;left:0;background:linear-gradient(0deg, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%)}.main-input{width:calc(100% - 3.2em - 2px);padding:0.8em 1.6em;border:2px solid #464e58;font-size:1.2em;border-radius:10px}.checklist ul{margin:0;padding-left:20px;text-align:left;list-style-image:url('assets/checkmark.svg')}.checklist li{margin-bottom:1em}.checklist li:last-child{margin-bottom:0}.row-validare h1{font-size:28px;line-height:32px}body{margin:0;padding:0;height:100vh;position:relative;height:100vh;}.container-video{height:99vh;text-align:center;position:relative;overflow:hidden}.row{padding:3.5vh 2.5vh;height:100%;overflow:hidden;position:relative;}.ctheight-100{height:99vh}.d-flex{display:flex}.space-between{justify-content:space-between}.img-info img{width:0.8vh;z-index:5;position:relative}.img-info{width:7vh;height:7vh;border-radius:100%;display:flex;align-items:center;justify-content:center;background:radial-gradient(100% 100% at 50% 0%, #d3b6e9 0%, #fbc2bd 100%)}.i-effect{animation:2.5s infinite transition-i;position:absolute;z-index:2;border-radius:100%;background:radial-gradient(100% 100% at 50% 0%, #d3b6e9 0%, #fbc2bd 100%)}.two-buttons{margin-top:3vh;justify-content:center}.align-center{align-items:center}.font-size-2{font-size:2vh}.row-validare .font-size-2{font-size:17px;line-height:19px}.img-text .bg-img img{width:100%;padding:2vh}.cit-selector-desktop{width:200px;height:140px}.img-selector{width:100%}.img-text .cit-selector,.img-text .cit-selector-desktop{border-radius:5%}.img-text h3{color:#333333;font-weight:700;font-size:2.3vh;margin:0}.font-weight-bold{font-weight:bold}.font-size-18{font-size:1.8vh}.row-validare .font-size-18{font-size:15px;line-height:16px}a{font-size:inherit;color:inherit;text-decoration:none}.color-black{color:#000}.normal-button{background:#1feaa6;box-shadow:0 6px 8px rgba(71, 182, 162, 0.2);border-radius:25px;text-align:center;padding:2vh;margin-right:1vw;margin-left:1vw;color:#fff;border:0;font-size:2vh}.red-button{background:#ff535d}.row-validare .main-button{font-size:17px}.text-right{text-align:right}.mb-0{margin-bottom:0}.row-validare.row{padding:29px 21px}.row-validare .main-button{padding:16px}.row-validare .btn-buletin{position:relative;width:100%;bottom:0}.show-bottom{bottom:-2vh}.second-input{width:46px;height:46px;font-weight:700;font-size:16px;font-family:'Inter', sans-serif;text-align:center;border:2px solid #c5c6cc;border-radius:12px;outline:none;padding:2px}.second-input:not(:placeholder-shown){border:2px solid #1feaa6;color:#1feaa6}.mt-9{margin-top:9%}.second-input::placeholder{color:#fff;opacity:0}.second-input:focus{border:2px solid #464e58;color:#464e58}.second-input.error{border:2px solid #b67171}.second-input.error:focus{border:3px solid #b67171;color:#b67171;padding:1px}.second-input.error:not(:placeholder-shown){border:3px solid #b67171;color:#b67171;padding:2px}.second-input-container{margin-top:30%;display:flex;flex-wrap:wrap;justify-content:space-between}.input-container{display:flex;flex-wrap:wrap}.mt-15{margin-top:15%}.row-validare .mt-15{margin-top:40px}.mb-15{margin-bottom:15%}.row-validare .mb-15{margin-bottom:40px}.mb-20{margin-bottom:20%}.row-validare .mb-1{margin-bottom:20px}.row-validare .mb-20{margin-bottom:60px}.mt-90{margin-top:90px}.op-05{opacity:0.5}.error-text{position:relative;top:50px;margin-bottom:0;margin-top:0}.top-50{top:50px}.mt-25{margin-top:25%}.text-center{text-align:center}.scale-2{transform:scale(2)}.mt-20{margin-top:20%}.div-ci img{max-height:40vh;max-width:80vw}.div-ci{text-align:center}.mt-10{margin-top:10vh}.mt-5{margin-top:5vh}.pos-relative{position:relative}.pos-absolute{position:absolute}.btn-buletin{text-align:center}.buletin-container img{width:60%}.buletin-container>img{margin-top:10vh}.buletin-container{text-align:center}.color-white{color:#fff}.chenar-buletin{margin-top:3em;text-align:center}.chenar-buletin .ci-img{width:96%}.chenar-buletin .face-img,.chenar-buletin .chenar-img{left:4%;width:92%;top:-20px;min-height:55vw;display:flex;position:absolute;align-items:center;background-color:rgba(255, 255, 255, 0.2);justify-content:center}.chenar-buletin img{width:auto;height:100%;top:0;left:0;position:absolute;border-radius:10px;z-index:4}.chenar-buletin .face-img{background-color:rgba(255, 255, 255, 0.3)}.buletin-container .w-40{width:40%}.animation{width:100%;height:100%;}.color-black-2{color:#71727a}.font-size-3{font-size:3vh}.font-size-25{font-size:2.5vh}.font-size-1{font-size:1vh}.font-weight-900{font-weight:900}.mt-8{margin-top:8vh}.mt-12{margin-top:12vh}.mt-30-i{margin-top:30% !important}.ml-5{margin-left:5vh}.chenar-buletin .face-img{left:-2%;width:104%;top:-40px}.pl-2-5{padding-left:2.5vh}.container-coin{background-color:transparent;perspective:1000px;rotate:120deg 0deg}.coin-flip{animation:flip 0.4s ease-in;animation-delay:0.5s;transform-style:preserve-3d;animation-fill-mode:forwards;visibility:hidden}.coin-scale{animation:show 0.4s ease-in;animation-delay:0.5s;transform-style:preserve-3d;animation-fill-mode:forwards}.scroll-disabled{height:100%;overflow-x:hidden;pointer-events:none;user-select:none}.scroll-to-top-btn{position:fixed;z-index:200;bottom:20px;left:20px;width:6vh;height:6vh;border-radius:50%;background-color:#1feaa6;color:white;display:flex;align-items:center;justify-content:center;font-size:5vh;cursor:pointer;box-shadow:0 2px 5px rgba(0, 0, 0, 0.3);transition:background-color 0.3s}.scroll-to-top-btn:hover{background-color:#17d296}.scroll-full{margin:4px, 4px;padding:4px;overflow-x:hidden;overflow-y:auto}.video-demo{z-index:0;width:100%;height:100%;border-radius:20px}.video-capture{padding:2.5vh 2.5vh;margin-top:3em;text-align:center;position:relative}.capture-title{z-index:4;margin-top:3vh;position:absolute;bottom:5vh;padding:2.5vh 2.5vh}video::-webkit-media-controls{display:none !important}@keyframes transition-i{from{width:0;height:0;opacity:1}80%{width:10vh;height:10vh;opacity:0.5}100%{opacity:0}}@keyframes flip{0%{transform:rotateX(140deg);visibility:visible}25%{transform:rotateX(120deg);visibility:visible}50%{transform:rotateX(90deg);visibility:visible}75%{transform:rotateX(75deg);visibility:visible}100%{transform:rotateX(0deg);visibility:visible}}@keyframes show{0%{transform:scale(0)}25%{transform:scale(0.2)}40%{transform:scale(0.4)}50%{transform:scale(0.5)}60%{transform:scale(0.6)}70%{transform:scale(0.7)}100%{transform:scale(1)}}@keyframes rise{0%{visibility:hidden}50%{visibility:visible}100%{visibility:visible}}.buletin-container.rotate-x img{animation:transform-rotate-x 2s infinite ease-in}.rotateimg90{animation:transform-rotate-x2 2s forwards;animation-delay:1s;position:absolute}.rotateimg180{animation:transform-rotate-x3 2s forwards;animation-delay:3s;position:absolute;opacity:0}.buletin-back{display:flex;justify-content:center}.loading-state{display:flex;justify-content:center;align-items:center;position:relative}.loading{width:50px;height:50px;border-radius:50%;border:10px solid #ddd;border-top-color:#71727a;animation:loading 1s linear infinite}.pulsate{animation:textPulse 2s ease 0s infinite normal forwards}@keyframes textPulse{0%{transform:scale(1)}50%{transform:scale(1.1)}100%{transform:scale(1)}}@keyframes loading{to{transform:rotate(360deg)}}@keyframes transform-rotate-x3{from{transform:rotateY(-90deg);opacity:1}to{transform:rotateY(0deg);opacity:1}}@keyframes transform-rotate-x2{to{transform:rotateY(90deg)}}@keyframes transform-rotate-x{to{transform:perspective(600px) rotateX(40deg)}}@media only screen and (max-width: 350px){.second-input{width:36px;height:36px}}@media only screen and (max-width: 390px){.second-input{width:40px;height:40px}.ml-5{margin-left:20vw}}@media only screen and (min-width: 530px) and (max-width: 767px){.chenar-buletin .face-img{width:70%;min-height:auto;margin:auto;left:15%;right:auto;top:-15vh}.ml-5{margin-left:15vw}}@media only screen and (min-width: 600px) and (max-width: 767px){.max-h img{margin-left:15%;margin-right:15%}.max-h{display:flex;align-items:center}.ml-5{margin-left:10vw}}@media only screen and (max-width: 991px){.buletin-container img{max-width:220px}.ml-5{margin-left:2.5vw}}@media only screen and (min-width: 767px){.container{max-width:530px;margin:40px auto;border-radius:20px;box-shadow:1px 1px 10px rgba(0, 0, 0, 0.1);height:calc(100% - 80px)}body{height:90vh}.btn-buletin{max-width:490px;bottom:7vh}.buletin-container img{width:45%}.chenar-buletin .face-img,.chenar-buletin .chenar-img{min-height:300px}.chenar-buletin .face-img{width:80%;min-height:auto;margin:auto;left:10%;right:auto;top:-10vh}.img-selector{width:10vw}}";const OE=class{async onTokenChange(t,e){if(o.debug)console.log("Token change called with value: "+t);if(t==""){t=o.token;return}if(o.token!==t){o.token=t}}agreementAcceptanceEmitted(t){try{i.instance.GenerateAgreement(t.detail.agreementType)}catch(t){this.apiErrorEmitter(t,"Agreement Acceptance")}}async apiErrorEmitter(t,e){var n,r,s,u,f,l;if(t.detail){this.errorTitle=(r=(n=t.detail.message)!==null&&n!==void 0?n:t.detail.status)!==null&&r!==void 0?r:"";this.errorMessage=(u=(s=t.detail.stack)!==null&&s!==void 0?s:t.detail.statusText)!==null&&u!==void 0?u:""}else if(t.message){this.errorTitle=t.message}else if(t.status){this.errorTitle=(f=t.status)!==null&&f!==void 0?f:"";this.errorMessage=(l=t.statusText)!==null&&l!==void 0?l:""}else{this.errorTitle=t}let h={message:this.errorTitle,stack:this.errorMessage,zone:e};try{await i.instance.AddLog(h,await D(this.order_id,this.redirect_id,this.token))}catch(t){}await c.ectdata.delete(o.requestId);d.flowError(this.errorTitle);o.flowStatus=a.ERROREND}constructor(e){t(this,e);this.logInit={};this.initialised=false}async componentWillLoad(){var t,e,n;o.analytics=(t=this.analytics)!==null&&t!==void 0?t:true;this.appInsights=M.getInstance();this.appInsights.trackEvent("IdentificationComponent | init",{requestId:o.requestId});d.init(window);d.flowEvent(s.ComponentLoaded,u.Initialized);o.apiBaseUrl=this.api_url;if(this.env&&this.env!=""){o.environment=this.env}if(o.environment!="PROD"){o.debug=true}i.getInstance();if(o.debug)this.logInit=await D(this.order_id,this.redirect_id,this.token);if(this.token){if(o.debug)console.log("Store Token set with property value: "+this.token);o.token=this.token}if(this.redirect_id){o.redirectId=this.redirect_id}if(this.lang_iso&&this.lang_iso!=""){o.langIso=this.lang_iso}o.showCitizenshipSelector=(e=this.show_citizenship_selector)!==null&&e!==void 0?e:false;o.scrollMode=(n=this.scroll_mode)!==null&&n!==void 0?n:false}async componentDidLoad(){var t,e,n,r,s,a;if(this.order_id&&this.order_id!=""){this.ectData=await c.getOrCreateEctData(this.order_id);o.requestId=this.order_id;o.initialized=this.ectData.initialized;o.modelsPath=this.ectData.modelsPath;if(o.debug)console.log("Current RequestId has value: "+this.order_id)}else if(!this.redirect_id||this.redirect_id==""){var u=await c.getLastEctData(false);if(u){this.ectData=u;o.requestId=this.ectData.orderId;o.initialized=this.ectData.initialized}}if(((t=this.ectData)===null||t===void 0?void 0:t.modelsPath)&&((e=this.ectData)===null||e===void 0?void 0:e.modelsPath)!=""){o.modelsPath=this.ectData.modelsPath}if(this.phone_number&&this.phone_number!=""){o.phoneNumber=this.phone_number;this.ectData.phoneNumber=this.phone_number;await c.ectdata.put(this.ectData)}else if(((n=this.ectData)===null||n===void 0?void 0:n.phoneNumber)&&((r=this.ectData)===null||r===void 0?void 0:r.phoneNumber)!=""){o.phoneNumber=this.ectData.phoneNumber}if(this.citizenship&&this.citizenship!=""){o.citizenship=this.citizenship;this.ectData.citizenship=this.citizenship;await c.ectdata.put(this.ectData)}else if(((s=this.ectData)===null||s===void 0?void 0:s.citizenship)&&((a=this.ectData)===null||a===void 0?void 0:a.citizenship)!=""){o.citizenship=this.ectData.citizenship}await this.initializeRequest();try{if(this.ectData.initialized){o.flowStatus=await i.instance.GetFlowState()}}catch(t){}}async initializeRequest(){if(this.initialised){return}this.initialised=true;if(!o.device){o.device=await(new _E).getDevice()}if(o.device.browser==v.Mi){this.apiErrorEmitter("Mi Browser nu este acceptat. Va rugam utilizati Chrome.","Request Initialisation RequestId:"+o.requestId+" RedirectId:"+o.redirectId);return}try{if(o.debug)await i.instance.AddLog({phase:"debug mode"},this.logInit)}catch(t){}try{if(!o.device.isMobile&&o.redirectId==""&&o.environment=="DEMO"){o.redirectId=k();this.redirect_id=o.redirectId}if(o.token!=""&&(o.requestId!=""||o.redirectId!="")&&!o.initialized){await i.instance.AddIdentificationRequest(o.device,LE.version);await this.treatMobileRedirect();this.ectData.initialized=true;this.ectData.flowStatus=o.flowStatus;this.ectData.modelsPath=o.modelsPath;await c.ectdata.put(this.ectData)}}catch(t){this.apiErrorEmitter(t,"Request Initialisation RequestId:"+o.requestId+" RedirectId:"+o.redirectId)}}async treatMobileRedirect(){if(this.order_id&&this.order_id!=""){return}this.order_id=o.requestId;this.ectData=await c.ectdata.get(o.requestId);if(!this.ectData){await c.ectdata.add({orderId:o.requestId,redirectId:o.redirectId,timestamp:new Date,initialized:true,phoneNumber:o.phoneNumber,refreshStarted:false,flowStatus:o.flowStatus,modelsPath:o.modelsPath,citizenship:o.citizenship,finished:false});this.ectData=await c.ectdata.get(o.requestId)}}disconnectedCallback(){d.flowEvent(s.ComponentLoaded,u.Finalized)}render(){let t=n("div",{key:"f3203e25257630543b3eaf9cfc4149b25ef93d59",class:"container flex center text-center"},n("img",{key:"c6fe9c76d6e120a6c5da737956bcdc2edee27fa5",src:R}));if(o.flowStatus==a.CITIZENSHIP){t=n("citizenship-selection",{key:"9e77e90b824c2f9f0dfc430f8c78aa3c05f94595"})}else if(o.flowStatus==a.LANDING){t=n("landing-validation",{key:"b97ea89c9ebf60641e413e4713f4cb1a56621fa8"})}else if(o.flowStatus==a.MOBILE){t=n("mobile-redirect",{key:"e65b2e1943c46d6231c706f66b5dd74aea27a223"})}else if(o.flowStatus==a.AGREEMENT){t=n("agreement-info",{key:"5521a8e72acf2886f941b7579e4ebd739c977c3b"})}else if(o.flowStatus==a.PHONE){t=n("sms-send",{key:"8f9e86a5c1eb8e53e5eaa8fcefc46f9aa679ebf3"})}else if(o.flowStatus==a.CODE){t=n("sms-code-validation",{key:"21522cd6e114239dded1749feb3faf6bdaa057ab"})}else if(o.flowStatus==a.CODEERROR){t=n("sms-code-validation",{key:"4fb020e67147934651ac3be676982be0a7116474"})}else if(o.flowStatus==a.IDTYPE){t=n("id-selection",{key:"d5827bb28e1d08c3654d426f4ca1feadf63499b0"})}else if(o.flowStatus==a.IDFRONTHOWTO){if(o.debug)console.log("identification-component | render | IDFRONTHOWTO");t=n("how-to-info",{key:"b7e8a8d8a3c12ff3173410cfc02c5fdb1ecb0f16"})}else if(o.flowStatus==a.IDFRONT){if(o.debug)console.log("identification-component | render | IDFRONT");t=n("process-id",{key:"98b2993c6e3c1a9f5b31a9275a1210961d49ac29",id:"processIdFront",mode:"front"})}else if(o.flowStatus==a.IDBACKHOWTO){if(o.debug)console.log("identification-component | render | IDBACKHOWTO");t=n("how-to-info",{key:"c7e1170942611af387b7fb9435a752a8d9b14f74"})}else if(o.flowStatus==a.IDBACK){if(o.debug)console.log("identification-component | render | IDBACK");t=n("process-id",{key:"94969f6a60480bbe6e2159ad3f2fb1055a2f4ffc",id:"processIdBack",mode:"back"})}else if(o.flowStatus==a.IDTILTHOWTO){if(o.debug)console.log("identification-component | render | IDTILTHOWTO");t=n("how-to-info",{key:"4d113c355535cdad7fc8658d900b7e6289a8ea85"})}else if(o.flowStatus==a.IDTILT){if(o.debug)console.log("identification-component | render | TILT");t=n("process-id",{key:"ae5dbd27f705fae9969bfdc57e30442dc22d8850",id:"processIdTilt",mode:"tilt"})}else if(o.flowStatus==a.LIVENESSHOWTO){if(o.debug)console.log("identification-component | render | LIVENESSHOWTO");t=n("how-to-info",{key:"18e81c7168212fa0dfafc08344eb39a151fc7b56"})}else if(o.flowStatus==a.LIVENESS){if(o.debug)console.log("identification-component | render | LIVENESS");t=n("user-liveness",{key:"0f77272e45c6f7c835b8dc720b5633dee2cdc735",id:"userLiveness",mode:"selfie"})}else if(o.flowStatus==a.LIVENESSGESTUREHOWTO){if(o.debug)console.log("identification-component | render | LIVENESSGESTUREHOWTO");t=n("state-transition",{key:"0703f0d9d20f2f550aab5ea41a826a03de2d3424"})}else if(o.flowStatus==a.LIVENESSGESTURE){if(o.debug)console.log("identification-component | render | LIVENESSGESTURE");t=n("user-liveness",{key:"8b0c56bb67ec4e88856432656ce6582681d70de9",id:"userLivenessGesture",mode:"selfieGesture"})}else if(o.flowStatus==a.COMPLETE){if(o.debug)console.log("identification-component | render | COMPLETE");t=n("end-redirect",{key:"6127a025811195d3bfc56570c6a6e76a5e52f11a"})}else if(o.flowStatus==a.ERROREND){t=n("error-end",{key:"7c725e7d1339f11cf78cb317b6031bef83ace90b",errorTitle:this.errorTitle,message:this.errorMessage})}else if(o.flowStatus==a.CAMERAERROR){t=n("camera-error",{key:"472101e25c0ba6bc710b6d6b1e4ac9e92654cd40"})}else if(o.flowStatus==a.RANDOM){if(o.debug)console.log("identification-component | render | RANDOM");t=n("random-action",{key:"95570f8b810c17a19a336f89283b7381a4bc259a"})}return n("div",{key:"f941452ca3ff2a13851a245586ff867d373c1993",class:"full"},t)}static get watchers(){return{token:["onTokenChange"]}}};OE.style=CE;const zE="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0Mi4xMDkiIGhlaWdodD0iNTIuNzg4IiB2aWV3Qm94PSIwIDAgNDIuMTA5IDUyLjc4OCI+DQogIDxnIGlkPSJtb2JpbGVfcGhvbmUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yNSAtMzQyKSI+DQogICAgPHBhdGggaWQ9IlBhdGhfNDc0NiIgZGF0YS1uYW1lPSJQYXRoIDQ3NDYiIGQ9Ik0yOS45MSw1NWEuOTEuOTEsMCwxLDAsMCwxLjgyaDMuNjQxYS45MS45MSwwLDEsMCwwLTEuODJaIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSg4Ljc0MiAzMzQuMzI3KSIvPg0KICAgIDxwYXRoIGlkPSJQYXRoXzQ3NDgiIGRhdGEtbmFtZT0iUGF0aCA0NzQ4IiBkPSJNMzYuNTEyLDguOTFBLjg2Ljg2LDAsMCwwLDM1LjYsOEgyNy40MWEuODYuODYsMCwwLDAtLjkxLjkxLjg2Ljg2LDAsMCwwLC45MS45MUgzNS42QS44Ni44NiwwLDAsMCwzNi41MTIsOC45MVoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDguOTY3IDMzOC41NTEpIiBmaWxsPSIjMjUyYzgyIi8+DQogICAgPGcgaWQ9Ikdyb3VwXzQ2MDciIGRhdGEtbmFtZT0iR3JvdXAgNDYwNyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMjUgMzQyKSI+DQogICAgICA8cGF0aCBpZD0iUGF0aF80NzQ3IiBkYXRhLW5hbWU9IlBhdGggNDc0NyIgZD0iTTQ0LjEyNSw4LjM3YS45MS45MSwwLDEsMCwxLjgyLDBBNS40MzksNS40MzksMCwwLDAsNDAuNTc1LDNIMjAuMzdBNS40MzksNS40MzksMCwwLDAsMTUsOC4zN1Y1MC40MThhNS4zOCw1LjM4LDAsMCwwLDUuMzcsNS4zN0g0MC41NzVhNS4zOCw1LjM4LDAsMCwwLDUuMzctNS4zN1YzNy41ODVhLjkxLjkxLDAsMSwwLTEuODIsMFY1MC40MThhMy41NTQsMy41NTQsMCwwLDEtMy41NSwzLjU1SDIwLjM3YTMuNTU0LDMuNTU0LDAsMCwxLTMuNTUtMy41NVY4LjM3YTMuNjE0LDMuNjE0LDAsMCwxLDMuNTUtMy41NUg0MC41NzVhMy42MTQsMy42MTQsMCwwLDEsMy41NSwzLjU1WiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTE1IC0zKSIgZmlsbD0iIzI1MmM4MiIvPg0KICAgICAgPGcgaWQ9Ikdyb3VwXzQ2MDYiIGRhdGEtbmFtZT0iR3JvdXAgNDYwNiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTguMjAzIDguMTkxKSI+DQogICAgICAgIDxwYXRoIGlkPSJQYXRoXzQ3NTgiIGRhdGEtbmFtZT0iUGF0aCA0NzU4IiBkPSJNOTQuOTUzLDc1YTExLjk1MywxMS45NTMsMCwxLDAsMTEuOTUzLDExLjk1M0ExMS45NjcsMTEuOTY3LDAsMCwwLDk0Ljk1Myw3NVptMCwyMi40NTdhMTAuNSwxMC41LDAsMSwxLDEwLjUtMTAuNUExMC41MTYsMTAuNTE2LDAsMCwxLDk0Ljk1Myw5Ny40NTdaIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtODMgLTc1KSIgZmlsbD0iIzI1MmM4MiIvPg0KICAgICAgICA8cGF0aCBpZD0iUGF0aF80NzU5IiBkYXRhLW5hbWU9IlBhdGggNDc1OSIgZD0iTTExMC43NTIsOTguNzEybC03LjI3NSw3LjI3NS00Ljc0LTQuNzM5YS43MjQuNzI0LDAsMCwwLTEuMDI0LDEuMDI0bDUuMjUyLDUuMjUyYS43MjQuNzI0LDAsMCwwLDEuMDI0LDBsNy43ODctNy43ODdhLjcyNC43MjQsMCwwLDAtMS4wMjQtMS4wMjRaIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtOTIuMjQ4IC04OS45ODgpIiBmaWxsPSIjN2JiNDBlIi8+DQogICAgICA8L2c+DQogICAgPC9nPg0KICA8L2c+DQo8L3N2Zz4NCg==";const jE="";const RE=class{constructor(n){t(this,n);this.apiErrorEvent=e(this,"apiError")}async componentWillLoad(){d.flowStarted();this.translations=await m.getValues();this.buttonDisabled=false;this.ectData=await c.ectdata.get(o.requestId);await this.initRequest()}async componentDidLoad(){await h.initialize(s.Landing)}async initRequest(){if(o.apiBaseUrl.includes("apimd")){this.warningText=this.translations.LandingValues.WarningMd}else{this.warningText=this.translations.LandingValues.Warning}}async startFlow(){if(!this.buttonDisabled){this.buttonDisabled=true;var t=await p.InitCameras(o.device);if(!t&&o.device.mobileOS==g.iOS){this.ectData.refreshStarted=false;await c.ectdata.put(this.ectData)}try{o.flowStatus=await i.instance.LandingValidationStartFlow(t)}catch(t){this.apiErrorEvent.emit(t)}}}async disconnectedCallback(){await h.finalize(s.Landing)}async leaveFlow(){if(this.buttonDisabled)return;try{let t=await i.instance.AbortRequest();o.flowStatus=a[t.state];await c.ectdata.delete(o.requestId);d.flowAborted()}catch(t){d.flowAborted();this.apiErrorEvent.emit(t)}}render(){return n("div",{key:"2469d5b3bd889ec1cb70315659b76d457036e2ac",class:"container flex center"},n("div",{key:"6a6782f1ade3dfbae1a1e632fc4d3e6fc2f84208",class:"px-4"},n("h1",{key:"f6603f3e2d150a0adf467c8c64566784343ae249",class:"text-center px-1 mb-1"},this.translations.LandingValues.Title),n("div",{key:"d39e20bdf0ee6b9e85576870e145a5b9caf7f919",class:"info-container mb-2"},n("div",{key:"5bf6b84be1155b8bf82939c8562f30dcd6765099",class:"img-text"},n("div",{key:"436d13b55e89c107959f996d45cf4cc445a4d77d",class:"bg-img"},n("img",{key:"814ee0eea63f298bfd63a573973560eefe81ae50",src:DE})),n("h2",{key:"05fb39bd9aef6ed2382c48858fedff22128e6e65"},this.translations.LandingValues.IdInfo)),n("div",{key:"ec129795c17c007b99f3aedb382bcad2b1b0f89f",class:"img-text"},n("div",{key:"38bf98c2d02a34127fbba88607a410de544beb3f",class:"bg-img"},n("img",{key:"7e25803515200900aade36112849e1a1d55a8cdc",src:zE})),n("h2",{key:"9f98da2e9b38da7e3ca9fe25cfdd2335c3f084ab"},this.translations.LandingValues.DeviceInfo))),n("div",{key:"7a239652cefc22987f3b4e6fd65d6145ea79cfc0",class:"button flex mb-1"},this.buttonDisabled?n("div",{class:"img-loader rounded img-loader-button"},n("img",{class:"loading-image loading-image-button",src:R})):null,n("button",{key:"d522ca7e0b9731387434f33abeec18da4b3189cb",class:"main-button",type:"button",disabled:this.buttonDisabled,onClick:()=>this.startFlow()},this.translations.LandingValues.Button)),n("div",{key:"b994a0cb45fb430629682805085bdd9ca458d490",class:"text-center"},n("p",{key:"0b5f92a40e6a8468622a0c5a24460bbc8a4e629b",class:"main-text link-text",onClick:()=>this.leaveFlow()},this.translations.LandingValues.ButtonLeave)),n("div",{key:"968ca3c211fedb03e69cc782fa5a098d42ddd759",class:"footer text-center"},n("img",{key:"176617ac7647844b9ba133cefdcffedf5eff0609",src:y}))))}};RE.style=jE;var $E={};var FE;var PE;function BE(){if(PE)return FE;PE=1;FE=function(){return typeof Promise==="function"&&Promise.prototype&&Promise.prototype.then};return FE}var GE={};var UE={};var WE;function YE(){if(WE)return UE;WE=1;let t;const e=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];UE.getSymbolSize=function t(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return e*4+17};UE.getSymbolTotalCodewords=function t(n){return e[n]};UE.getBCHDigit=function(t){let e=0;while(t!==0){e++;t>>>=1}return e};UE.setToSJISFunction=function e(n){if(typeof n!=="function"){throw new Error('"toSJISFunc" is not a valid function.')}t=n};UE.isKanjiModeEnabled=function(){return typeof t!=="undefined"};UE.toSJIS=function e(n){return t(n)};return UE}var VE={};var ZE;function QE(){if(ZE)return VE;ZE=1;(function(t){t.L={bit:1};t.M={bit:0};t.Q={bit:3};t.H={bit:2};function e(e){if(typeof e!=="string"){throw new Error("Param is not a string")}const n=e.toLowerCase();switch(n){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+e)}}t.isValid=function t(e){return e&&typeof e.bit!=="undefined"&&e.bit>=0&&e.bit<4};t.from=function n(r,s){if(t.isValid(r)){return r}try{return e(r)}catch(t){return s}}})(VE);return VE}var HE;var JE;function qE(){if(JE)return HE;JE=1;function t(){this.buffer=[];this.length=0}t.prototype={get:function(t){const e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)===1},put:function(t,e){for(let n=0;n<e;n++){this.putBit((t>>>e-n-1&1)===1)}},getLengthInBits:function(){return this.length},putBit:function(t){const e=Math.floor(this.length/8);if(this.buffer.length<=e){this.buffer.push(0)}if(t){this.buffer[e]|=128>>>this.length%8}this.length++}};HE=t;return HE}var XE;var KE;function tD(){if(KE)return XE;KE=1;function t(t){if(!t||t<1){throw new Error("BitMatrix size must be defined and greater than 0")}this.size=t;this.data=new Uint8Array(t*t);this.reservedBit=new Uint8Array(t*t)}t.prototype.set=function(t,e,n,r){const s=t*this.size+e;this.data[s]=n;if(r)this.reservedBit[s]=true};t.prototype.get=function(t,e){return this.data[t*this.size+e]};t.prototype.xor=function(t,e,n){this.data[t*this.size+e]^=n};t.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};XE=t;return XE}var eD={};var nD;function rD(){if(nD)return eD;nD=1;(function(t){const e=YE().getSymbolSize;t.getRowColCoords=function t(n){if(n===1)return[];const r=Math.floor(n/7)+2;const s=e(n);const i=s===145?26:Math.ceil((s-13)/(2*r-2))*2;const o=[s-7];for(let t=1;t<r-1;t++){o[t]=o[t-1]-i}o.push(6);return o.reverse()};t.getPositions=function e(n){const r=[];const s=t.getRowColCoords(n);const i=s.length;for(let t=0;t<i;t++){for(let e=0;e<i;e++){if(t===0&&e===0||t===0&&e===i-1||t===i-1&&e===0){continue}r.push([s[t],s[e]])}}return r}})(eD);return eD}var sD={};var iD;function oD(){if(iD)return sD;iD=1;const t=YE().getSymbolSize;const e=7;sD.getPositions=function n(r){const s=t(r);return[[0,0],[s-e,0],[0,s-e]]};return sD}var aD={};var cD;function uD(){if(cD)return aD;cD=1;(function(t){t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const e={N1:3,N2:3,N3:40,N4:10};t.isValid=function t(e){return e!=null&&e!==""&&!isNaN(e)&&e>=0&&e<=7};t.from=function e(n){return t.isValid(n)?parseInt(n,10):undefined};t.getPenaltyN1=function t(n){const r=n.size;let s=0;let i=0;let o=0;let a=null;let c=null;for(let t=0;t<r;t++){i=o=0;a=c=null;for(let u=0;u<r;u++){let r=n.get(t,u);if(r===a){i++}else{if(i>=5)s+=e.N1+(i-5);a=r;i=1}r=n.get(u,t);if(r===c){o++}else{if(o>=5)s+=e.N1+(o-5);c=r;o=1}}if(i>=5)s+=e.N1+(i-5);if(o>=5)s+=e.N1+(o-5)}return s};t.getPenaltyN2=function t(n){const r=n.size;let s=0;for(let t=0;t<r-1;t++){for(let e=0;e<r-1;e++){const r=n.get(t,e)+n.get(t,e+1)+n.get(t+1,e)+n.get(t+1,e+1);if(r===4||r===0)s++}}return s*e.N2};t.getPenaltyN3=function t(n){const r=n.size;let s=0;let i=0;let o=0;for(let t=0;t<r;t++){i=o=0;for(let e=0;e<r;e++){i=i<<1&2047|n.get(t,e);if(e>=10&&(i===1488||i===93))s++;o=o<<1&2047|n.get(e,t);if(e>=10&&(o===1488||o===93))s++}}return s*e.N3};t.getPenaltyN4=function t(n){let r=0;const s=n.data.length;for(let t=0;t<s;t++)r+=n.data[t];const i=Math.abs(Math.ceil(r*100/s/5)-10);return i*e.N4};function n(e,n,r){switch(e){case t.Patterns.PATTERN000:return(n+r)%2===0;case t.Patterns.PATTERN001:return n%2===0;case t.Patterns.PATTERN010:return r%3===0;case t.Patterns.PATTERN011:return(n+r)%3===0;case t.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(r/3))%2===0;case t.Patterns.PATTERN101:return n*r%2+n*r%3===0;case t.Patterns.PATTERN110:return(n*r%2+n*r%3)%2===0;case t.Patterns.PATTERN111:return(n*r%3+(n+r)%2)%2===0;default:throw new Error("bad maskPattern:"+e)}}t.applyMask=function t(e,r){const s=r.size;for(let t=0;t<s;t++){for(let i=0;i<s;i++){if(r.isReserved(i,t))continue;r.xor(i,t,n(e,i,t))}}};t.getBestMask=function e(n,r){const s=Object.keys(t.Patterns).length;let i=0;let o=Infinity;for(let e=0;e<s;e++){r(e);t.applyMask(e,n);const s=t.getPenaltyN1(n)+t.getPenaltyN2(n)+t.getPenaltyN3(n)+t.getPenaltyN4(n);t.applyMask(e,n);if(s<o){o=s;i=e}}return i}})(aD);return aD}var fD={};var lD;function hD(){if(lD)return fD;lD=1;const t=QE();const e=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81];const n=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];fD.getBlocksCount=function n(r,s){switch(s){case t.L:return e[(r-1)*4+0];case t.M:return e[(r-1)*4+1];case t.Q:return e[(r-1)*4+2];case t.H:return e[(r-1)*4+3];default:return undefined}};fD.getTotalCodewordsCount=function e(r,s){switch(s){case t.L:return n[(r-1)*4+0];case t.M:return n[(r-1)*4+1];case t.Q:return n[(r-1)*4+2];case t.H:return n[(r-1)*4+3];default:return undefined}};return fD}var dD={};var pD={};var mD;function yD(){if(mD)return pD;mD=1;const t=new Uint8Array(512);const e=new Uint8Array(256);(function n(){let r=1;for(let n=0;n<255;n++){t[n]=r;e[r]=n;r<<=1;if(r&256){r^=285}}for(let e=255;e<512;e++){t[e]=t[e-255]}})();pD.log=function t(n){if(n<1)throw new Error("log("+n+")");return e[n]};pD.exp=function e(n){return t[n]};pD.mul=function n(r,s){if(r===0||s===0)return 0;return t[e[r]+e[s]]};return pD}var gD;function wD(){if(gD)return dD;gD=1;(function(t){const e=yD();t.mul=function t(n,r){const s=new Uint8Array(n.length+r.length-1);for(let t=0;t<n.length;t++){for(let i=0;i<r.length;i++){s[t+i]^=e.mul(n[t],r[i])}}return s};t.mod=function t(n,r){let s=new Uint8Array(n);while(s.length-r.length>=0){const t=s[0];for(let n=0;n<r.length;n++){s[n]^=e.mul(r[n],t)}let n=0;while(n<s.length&&s[n]===0)n++;s=s.slice(n)}return s};t.generateECPolynomial=function n(r){let s=new Uint8Array([1]);for(let n=0;n<r;n++){s=t.mul(s,new Uint8Array([1,e.exp(n)]))}return s}})(dD);return dD}var bD;var vD;function ND(){if(vD)return bD;vD=1;const t=wD();function e(t){this.genPoly=undefined;this.degree=t;if(this.degree)this.initialize(this.degree)}e.prototype.initialize=function e(n){this.degree=n;this.genPoly=t.generateECPolynomial(this.degree)};e.prototype.encode=function e(n){if(!this.genPoly){throw new Error("Encoder not initialized")}const r=new Uint8Array(n.length+this.degree);r.set(n);const s=t.mod(r,this.genPoly);const i=this.degree-s.length;if(i>0){const t=new Uint8Array(this.degree);t.set(s,i);return t}return s};bD=e;return bD}var xD={};var MD={};var ID={};var SD;function ED(){if(SD)return ID;SD=1;ID.isValid=function t(e){return!isNaN(e)&&e>=1&&e<=40};return ID}var DD={};var kD;function TD(){if(kD)return DD;kD=1;const t="[0-9]+";const e="[A-Z $%*+\\-./:]+";let n="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|"+"[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|"+"[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|"+"[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";n=n.replace(/u/g,"\\u");const r="(?:(?![A-Z0-9 $%*+\\-./:]|"+n+")(?:.|[\r\n]))+";DD.KANJI=new RegExp(n,"g");DD.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");DD.BYTE=new RegExp(r,"g");DD.NUMERIC=new RegExp(t,"g");DD.ALPHANUMERIC=new RegExp(e,"g");const s=new RegExp("^"+n+"$");const i=new RegExp("^"+t+"$");const o=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");DD.testKanji=function t(e){return s.test(e)};DD.testNumeric=function t(e){return i.test(e)};DD.testAlphanumeric=function t(e){return o.test(e)};return DD}var AD;function LD(){if(AD)return MD;AD=1;(function(t){const e=ED();const n=TD();t.NUMERIC={id:"Numeric",bit:1<<0,ccBits:[10,12,14]};t.ALPHANUMERIC={id:"Alphanumeric",bit:1<<1,ccBits:[9,11,13]};t.BYTE={id:"Byte",bit:1<<2,ccBits:[8,16,16]};t.KANJI={id:"Kanji",bit:1<<3,ccBits:[8,10,12]};t.MIXED={bit:-1};t.getCharCountIndicator=function t(n,r){if(!n.ccBits)throw new Error("Invalid mode: "+n);if(!e.isValid(r)){throw new Error("Invalid version: "+r)}if(r>=1&&r<10)return n.ccBits[0];else if(r<27)return n.ccBits[1];return n.ccBits[2]};t.getBestModeForData=function e(r){if(n.testNumeric(r))return t.NUMERIC;else if(n.testAlphanumeric(r))return t.ALPHANUMERIC;else if(n.testKanji(r))return t.KANJI;else return t.BYTE};t.toString=function t(e){if(e&&e.id)return e.id;throw new Error("Invalid mode")};t.isValid=function t(e){return e&&e.bit&&e.ccBits};function r(e){if(typeof e!=="string"){throw new Error("Param is not a string")}const n=e.toLowerCase();switch(n){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+e)}}t.from=function e(n,s){if(t.isValid(n)){return n}try{return r(n)}catch(t){return s}}})(MD);return MD}var _D;function CD(){if(_D)return xD;_D=1;(function(t){const e=YE();const n=hD();const r=QE();const s=LD();const i=ED();const o=1<<12|1<<11|1<<10|1<<9|1<<8|1<<5|1<<2|1<<0;const a=e.getBCHDigit(o);function c(e,n,r){for(let s=1;s<=40;s++){if(n<=t.getCapacity(s,r,e)){return s}}return undefined}function u(t,e){return s.getCharCountIndicator(t,e)+4}function f(t,e){let n=0;t.forEach((function(t){const r=u(t.mode,e);n+=r+t.getBitsLength()}));return n}function l(e,n){for(let r=1;r<=40;r++){const i=f(e,r);if(i<=t.getCapacity(r,n,s.MIXED)){return r}}return undefined}t.from=function t(e,n){if(i.isValid(e)){return parseInt(e,10)}return n};t.getCapacity=function t(r,o,a){if(!i.isValid(r)){throw new Error("Invalid QR Code version")}if(typeof a==="undefined")a=s.BYTE;const c=e.getSymbolTotalCodewords(r);const f=n.getTotalCodewordsCount(r,o);const l=(c-f)*8;if(a===s.MIXED)return l;const h=l-u(a,r);switch(a){case s.NUMERIC:return Math.floor(h/10*3);case s.ALPHANUMERIC:return Math.floor(h/11*2);case s.KANJI:return Math.floor(h/13);case s.BYTE:default:return Math.floor(h/8)}};t.getBestVersionForData=function t(e,n){let s;const i=r.from(n,r.M);if(Array.isArray(e)){if(e.length>1){return l(e,i)}if(e.length===0){return 1}s=e[0]}else{s=e}return c(s.mode,s.getLength(),i)};t.getEncodedBits=function t(n){if(!i.isValid(n)||n<7){throw new Error("Invalid QR Code version")}let r=n<<12;while(e.getBCHDigit(r)-a>=0){r^=o<<e.getBCHDigit(r)-a}return n<<12|r}})(xD);return xD}var OD={};var zD;function jD(){if(zD)return OD;zD=1;const t=YE();const e=1<<10|1<<8|1<<5|1<<4|1<<2|1<<1|1<<0;const n=1<<14|1<<12|1<<10|1<<4|1<<1;const r=t.getBCHDigit(e);OD.getEncodedBits=function s(i,o){const a=i.bit<<3|o;let c=a<<10;while(t.getBCHDigit(c)-r>=0){c^=e<<t.getBCHDigit(c)-r}return(a<<10|c)^n};return OD}var RD={};var $D;var FD;function PD(){if(FD)return $D;FD=1;const t=LD();function e(e){this.mode=t.NUMERIC;this.data=e.toString()}e.getBitsLength=function t(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)};e.prototype.getLength=function t(){return this.data.length};e.prototype.getBitsLength=function t(){return e.getBitsLength(this.data.length)};e.prototype.write=function t(e){let n,r,s;for(n=0;n+3<=this.data.length;n+=3){r=this.data.substr(n,3);s=parseInt(r,10);e.put(s,10)}const i=this.data.length-n;if(i>0){r=this.data.substr(n);s=parseInt(r,10);e.put(s,i*3+1)}};$D=e;return $D}var BD;var GD;function UD(){if(GD)return BD;GD=1;const t=LD();const e=["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"," ","$","%","*","+","-",".","/",":"];function n(e){this.mode=t.ALPHANUMERIC;this.data=e}n.getBitsLength=function t(e){return 11*Math.floor(e/2)+6*(e%2)};n.prototype.getLength=function t(){return this.data.length};n.prototype.getBitsLength=function t(){return n.getBitsLength(this.data.length)};n.prototype.write=function t(n){let r;for(r=0;r+2<=this.data.length;r+=2){let t=e.indexOf(this.data[r])*45;t+=e.indexOf(this.data[r+1]);n.put(t,11)}if(this.data.length%2){n.put(e.indexOf(this.data[r]),6)}};BD=n;return BD}var WD;var YD;function VD(){if(YD)return WD;YD=1;const t=LD();function e(e){this.mode=t.BYTE;if(typeof e==="string"){this.data=(new TextEncoder).encode(e)}else{this.data=new Uint8Array(e)}}e.getBitsLength=function t(e){return e*8};e.prototype.getLength=function t(){return this.data.length};e.prototype.getBitsLength=function t(){return e.getBitsLength(this.data.length)};e.prototype.write=function(t){for(let e=0,n=this.data.length;e<n;e++){t.put(this.data[e],8)}};WD=e;return WD}var ZD;var QD;function HD(){if(QD)return ZD;QD=1;const t=LD();const e=YE();function n(e){this.mode=t.KANJI;this.data=e}n.getBitsLength=function t(e){return e*13};n.prototype.getLength=function t(){return this.data.length};n.prototype.getBitsLength=function t(){return n.getBitsLength(this.data.length)};n.prototype.write=function(t){let n;for(n=0;n<this.data.length;n++){let r=e.toSJIS(this.data[n]);if(r>=33088&&r<=40956){r-=33088}else if(r>=57408&&r<=60351){r-=49472}else{throw new Error("Invalid SJIS character: "+this.data[n]+"\n"+"Make sure your charset is UTF-8")}r=(r>>>8&255)*192+(r&255);t.put(r,13)}};ZD=n;return ZD}var JD={exports:{}};var qD;function XD(){if(qD)return JD.exports;qD=1;(function(t){var e={single_source_shortest_paths:function(t,n,r){var s={};var i={};i[n]=0;var o=e.PriorityQueue.make();o.push(n,0);var a,c,u,f,l,h,d,p,m;while(!o.empty()){a=o.pop();c=a.value;f=a.cost;l=t[c]||{};for(u in l){if(l.hasOwnProperty(u)){h=l[u];d=f+h;p=i[u];m=typeof i[u]==="undefined";if(m||p>d){i[u]=d;o.push(u,d);s[u]=c}}}}if(typeof r!=="undefined"&&typeof i[r]==="undefined"){var y=["Could not find a path from ",n," to ",r,"."].join("");throw new Error(y)}return s},extract_shortest_path_from_predecessor_list:function(t,e){var n=[];var r=e;while(r){n.push(r);r=t[r]}n.reverse();return n},find_path:function(t,n,r){var s=e.single_source_shortest_paths(t,n,r);return e.extract_shortest_path_from_predecessor_list(s,r)},PriorityQueue:{make:function(t){var n=e.PriorityQueue,r={},s;t=t||{};for(s in n){if(n.hasOwnProperty(s)){r[s]=n[s]}}r.queue=[];r.sorter=t.sorter||n.default_sorter;return r},default_sorter:function(t,e){return t.cost-e.cost},push:function(t,e){var n={value:t,cost:e};this.queue.push(n);this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};{t.exports=e}})(JD);return JD.exports}var KD;function tk(){if(KD)return RD;KD=1;(function(t){const e=LD();const n=PD();const r=UD();const s=VD();const i=HD();const o=TD();const a=YE();const c=XD();function u(t){return unescape(encodeURIComponent(t)).length}function f(t,e,n){const r=[];let s;while((s=t.exec(n))!==null){r.push({data:s[0],index:s.index,mode:e,length:s[0].length})}return r}function l(t){const n=f(o.NUMERIC,e.NUMERIC,t);const r=f(o.ALPHANUMERIC,e.ALPHANUMERIC,t);let s;let i;if(a.isKanjiModeEnabled()){s=f(o.BYTE,e.BYTE,t);i=f(o.KANJI,e.KANJI,t)}else{s=f(o.BYTE_KANJI,e.BYTE,t);i=[]}const c=n.concat(r,s,i);return c.sort((function(t,e){return t.index-e.index})).map((function(t){return{data:t.data,mode:t.mode,length:t.length}}))}function h(t,o){switch(o){case e.NUMERIC:return n.getBitsLength(t);case e.ALPHANUMERIC:return r.getBitsLength(t);case e.KANJI:return i.getBitsLength(t);case e.BYTE:return s.getBitsLength(t)}}function d(t){return t.reduce((function(t,e){const n=t.length-1>=0?t[t.length-1]:null;if(n&&n.mode===e.mode){t[t.length-1].data+=e.data;return t}t.push(e);return t}),[])}function p(t){const n=[];for(let r=0;r<t.length;r++){const s=t[r];switch(s.mode){case e.NUMERIC:n.push([s,{data:s.data,mode:e.ALPHANUMERIC,length:s.length},{data:s.data,mode:e.BYTE,length:s.length}]);break;case e.ALPHANUMERIC:n.push([s,{data:s.data,mode:e.BYTE,length:s.length}]);break;case e.KANJI:n.push([s,{data:s.data,mode:e.BYTE,length:u(s.data)}]);break;case e.BYTE:n.push([{data:s.data,mode:e.BYTE,length:u(s.data)}])}}return n}function m(t,n){const r={};const s={start:{}};let i=["start"];for(let o=0;o<t.length;o++){const a=t[o];const c=[];for(let t=0;t<a.length;t++){const u=a[t];const f=""+o+t;c.push(f);r[f]={node:u,lastCount:0};s[f]={};for(let t=0;t<i.length;t++){const o=i[t];if(r[o]&&r[o].node.mode===u.mode){s[o][f]=h(r[o].lastCount+u.length,u.mode)-h(r[o].lastCount,u.mode);r[o].lastCount+=u.length}else{if(r[o])r[o].lastCount=u.length;s[o][f]=h(u.length,u.mode)+4+e.getCharCountIndicator(u.mode,n)}}}i=c}for(let t=0;t<i.length;t++){s[i[t]].end=0}return{map:s,table:r}}function y(t,o){let c;const u=e.getBestModeForData(t);c=e.from(o,u);if(c!==e.BYTE&&c.bit<u.bit){throw new Error('"'+t+'"'+" cannot be encoded with mode "+e.toString(c)+".\n Suggested mode is: "+e.toString(u))}if(c===e.KANJI&&!a.isKanjiModeEnabled()){c=e.BYTE}switch(c){case e.NUMERIC:return new n(t);case e.ALPHANUMERIC:return new r(t);case e.KANJI:return new i(t);case e.BYTE:return new s(t)}}t.fromArray=function t(e){return e.reduce((function(t,e){if(typeof e==="string"){t.push(y(e,null))}else if(e.data){t.push(y(e.data,e.mode))}return t}),[])};t.fromString=function e(n,r){const s=l(n,a.isKanjiModeEnabled());const i=p(s);const o=m(i,r);const u=c.find_path(o.map,"start","end");const f=[];for(let t=1;t<u.length-1;t++){f.push(o.table[u[t]].node)}return t.fromArray(d(f))};t.rawSplit=function e(n){return t.fromArray(l(n,a.isKanjiModeEnabled()))}})(RD);return RD}var ek;function nk(){if(ek)return GE;ek=1;const t=YE();const e=QE();const n=qE();const r=tD();const s=rD();const i=oD();const o=uD();const a=hD();const c=ND();const u=CD();const f=jD();const l=LD();const h=tk();function d(t,e){const n=t.size;const r=i.getPositions(e);for(let e=0;e<r.length;e++){const s=r[e][0];const i=r[e][1];for(let e=-1;e<=7;e++){if(s+e<=-1||n<=s+e)continue;for(let r=-1;r<=7;r++){if(i+r<=-1||n<=i+r)continue;if(e>=0&&e<=6&&(r===0||r===6)||r>=0&&r<=6&&(e===0||e===6)||e>=2&&e<=4&&r>=2&&r<=4){t.set(s+e,i+r,true,true)}else{t.set(s+e,i+r,false,true)}}}}}function p(t){const e=t.size;for(let n=8;n<e-8;n++){const e=n%2===0;t.set(n,6,e,true);t.set(6,n,e,true)}}function m(t,e){const n=s.getPositions(e);for(let e=0;e<n.length;e++){const r=n[e][0];const s=n[e][1];for(let e=-2;e<=2;e++){for(let n=-2;n<=2;n++){if(e===-2||e===2||n===-2||n===2||e===0&&n===0){t.set(r+e,s+n,true,true)}else{t.set(r+e,s+n,false,true)}}}}}function y(t,e){const n=t.size;const r=u.getEncodedBits(e);let s,i,o;for(let e=0;e<18;e++){s=Math.floor(e/3);i=e%3+n-8-3;o=(r>>e&1)===1;t.set(s,i,o,true);t.set(i,s,o,true)}}function g(t,e,n){const r=t.size;const s=f.getEncodedBits(e,n);let i,o;for(i=0;i<15;i++){o=(s>>i&1)===1;if(i<6){t.set(i,8,o,true)}else if(i<8){t.set(i+1,8,o,true)}else{t.set(r-15+i,8,o,true)}if(i<8){t.set(8,r-i-1,o,true)}else if(i<9){t.set(8,15-i-1+1,o,true)}else{t.set(8,15-i-1,o,true)}}t.set(r-8,8,1,true)}function w(t,e){const n=t.size;let r=-1;let s=n-1;let i=7;let o=0;for(let a=n-1;a>0;a-=2){if(a===6)a--;while(true){for(let n=0;n<2;n++){if(!t.isReserved(s,a-n)){let r=false;if(o<e.length){r=(e[o]>>>i&1)===1}t.set(s,a-n,r);i--;if(i===-1){o++;i=7}}}s+=r;if(s<0||n<=s){s-=r;r=-r;break}}}}function b(e,r,s){const i=new n;s.forEach((function(t){i.put(t.mode.bit,4);i.put(t.getLength(),l.getCharCountIndicator(t.mode,e));t.write(i)}));const o=t.getSymbolTotalCodewords(e);const c=a.getTotalCodewordsCount(e,r);const u=(o-c)*8;if(i.getLengthInBits()+4<=u){i.put(0,4)}while(i.getLengthInBits()%8!==0){i.putBit(0)}const f=(u-i.getLengthInBits())/8;for(let t=0;t<f;t++){i.put(t%2?17:236,8)}return v(i,e,r)}function v(e,n,r){const s=t.getSymbolTotalCodewords(n);const i=a.getTotalCodewordsCount(n,r);const o=s-i;const u=a.getBlocksCount(n,r);const f=s%u;const l=u-f;const h=Math.floor(s/u);const d=Math.floor(o/u);const p=d+1;const m=h-d;const y=new c(m);let g=0;const w=new Array(u);const b=new Array(u);let v=0;const N=new Uint8Array(e.buffer);for(let t=0;t<u;t++){const e=t<l?d:p;w[t]=N.slice(g,g+e);b[t]=y.encode(w[t]);g+=e;v=Math.max(v,e)}const x=new Uint8Array(s);let M=0;let I,S;for(I=0;I<v;I++){for(S=0;S<u;S++){if(I<w[S].length){x[M++]=w[S][I]}}}for(I=0;I<m;I++){for(S=0;S<u;S++){x[M++]=b[S][I]}}return x}function N(e,n,s,i){let a;if(Array.isArray(e)){a=h.fromArray(e)}else if(typeof e==="string"){let t=n;if(!t){const n=h.rawSplit(e);t=u.getBestVersionForData(n,s)}a=h.fromString(e,t||40)}else{throw new Error("Invalid data")}const c=u.getBestVersionForData(a,s);if(!c){throw new Error("The amount of data is too big to be stored in a QR Code")}if(!n){n=c}else if(n<c){throw new Error("\n"+"The chosen QR Code version cannot contain this amount of data.\n"+"Minimum version required to store current data is: "+c+".\n")}const f=b(n,s,a);const l=t.getSymbolSize(n);const v=new r(l);d(v,n);p(v);m(v,n);g(v,s,0);if(n>=7){y(v,n)}w(v,f);if(isNaN(i)){i=o.getBestMask(v,g.bind(null,v,s))}o.applyMask(i,v);g(v,s,i);return{modules:v,version:n,errorCorrectionLevel:s,maskPattern:i,segments:a}}GE.create=function n(r,s){if(typeof r==="undefined"||r===""){throw new Error("No input text")}let i=e.M;let a;let c;if(typeof s!=="undefined"){i=e.from(s.errorCorrectionLevel,e.M);a=u.from(s.version);c=o.from(s.maskPattern);if(s.toSJISFunc){t.setToSJISFunction(s.toSJISFunc)}}return N(r,a,i,c)};return GE}var rk={};var sk={};var ik;if(typeof Object.create==="function"){ik=function t(e,n){e.super_=n;e.prototype=Object.create(n.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}})}}else{ik=function t(e,n){e.super_=n;var r=function(){};r.prototype=n.prototype;e.prototype=new r;e.prototype.constructor=e}}var ok=/%[sdj%]/g;function ak(t){if(!Dk(t)){var e=[];for(var n=0;n<arguments.length;n++){e.push(hk(arguments[n]))}return e.join(" ")}var n=1;var r=arguments;var s=r.length;var i=String(t).replace(ok,(function(t){if(t==="%%")return"%";if(n>=s)return t;switch(t){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(t){return"[Circular]"}default:return t}}));for(var o=r[n];n<s;o=r[++n]){if(Ik(o)||!Lk(o)){i+=" "+o}else{i+=" "+hk(o)}}return i}function ck(t,e){if(Tk(w.process)){return function(){return ck(t,e).apply(this,arguments)}}if(b.noDeprecation===true){return t}var n=false;function r(){if(!n){if(b.throwDeprecation){throw new Error(e)}else if(b.traceDeprecation){console.trace(e)}else{console.error(e)}n=true}return t.apply(this,arguments)}return r}var uk={};var fk;function lk(t){if(Tk(fk))fk=b.env.NODE_DEBUG||"";t=t.toUpperCase();if(!uk[t]){if(new RegExp("\\b"+t+"\\b","i").test(fk)){var e=0;uk[t]=function(){var n=ak.apply(null,arguments);console.error("%s %d: %s",t,e,n)}}else{uk[t]=function(){}}}return uk[t]}function hk(t,e){var n={seen:[],stylize:pk};if(arguments.length>=3)n.depth=arguments[2];if(arguments.length>=4)n.colors=arguments[3];if(Mk(e)){n.showHidden=e}else if(e){Gk(n,e)}if(Tk(n.showHidden))n.showHidden=false;if(Tk(n.depth))n.depth=2;if(Tk(n.colors))n.colors=false;if(Tk(n.customInspect))n.customInspect=true;if(n.colors)n.stylize=dk;return yk(n,t,n.depth)}hk.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};hk.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function dk(t,e){var n=hk.styles[e];if(n){return"["+hk.colors[n][0]+"m"+t+"["+hk.colors[n][1]+"m"}else{return t}}function pk(t,e){return t}function mk(t){var e={};t.forEach((function(t,n){e[t]=true}));return e}function yk(t,e,n){if(t.customInspect&&e&&Ok(e.inspect)&&e.inspect!==hk&&!(e.constructor&&e.constructor.prototype===e)){var r=e.inspect(n,t);if(!Dk(r)){r=yk(t,r,n)}return r}var s=gk(t,e);if(s){return s}var i=Object.keys(e);var o=mk(i);if(t.showHidden){i=Object.getOwnPropertyNames(e)}if(Ck(e)&&(i.indexOf("message")>=0||i.indexOf("description")>=0)){return wk(e)}if(i.length===0){if(Ok(e)){var a=e.name?": "+e.name:"";return t.stylize("[Function"+a+"]","special")}if(Ak(e)){return t.stylize(RegExp.prototype.toString.call(e),"regexp")}if(_k(e)){return t.stylize(Date.prototype.toString.call(e),"date")}if(Ck(e)){return wk(e)}}var c="",u=false,f=["{","}"];if(xk(e)){u=true;f=["[","]"]}if(Ok(e)){var l=e.name?": "+e.name:"";c=" [Function"+l+"]"}if(Ak(e)){c=" "+RegExp.prototype.toString.call(e)}if(_k(e)){c=" "+Date.prototype.toUTCString.call(e)}if(Ck(e)){c=" "+wk(e)}if(i.length===0&&(!u||e.length==0)){return f[0]+c+f[1]}if(n<0){if(Ak(e)){return t.stylize(RegExp.prototype.toString.call(e),"regexp")}else{return t.stylize("[Object]","special")}}t.seen.push(e);var h;if(u){h=bk(t,e,n,o,i)}else{h=i.map((function(r){return vk(t,e,n,o,r,u)}))}t.seen.pop();return Nk(h,c,f)}function gk(t,e){if(Tk(e))return t.stylize("undefined","undefined");if(Dk(e)){var n="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(n,"string")}if(Ek(e))return t.stylize(""+e,"number");if(Mk(e))return t.stylize(""+e,"boolean");if(Ik(e))return t.stylize("null","null")}function wk(t){return"["+Error.prototype.toString.call(t)+"]"}function bk(t,e,n,r,s){var i=[];for(var o=0,a=e.length;o<a;++o){if(Uk(e,String(o))){i.push(vk(t,e,n,r,String(o),true))}else{i.push("")}}s.forEach((function(s){if(!s.match(/^\d+$/)){i.push(vk(t,e,n,r,s,true))}}));return i}function vk(t,e,n,r,s,i){var o,a,c;c=Object.getOwnPropertyDescriptor(e,s)||{value:e[s]};if(c.get){if(c.set){a=t.stylize("[Getter/Setter]","special")}else{a=t.stylize("[Getter]","special")}}else{if(c.set){a=t.stylize("[Setter]","special")}}if(!Uk(r,s)){o="["+s+"]"}if(!a){if(t.seen.indexOf(c.value)<0){if(Ik(n)){a=yk(t,c.value,null)}else{a=yk(t,c.value,n-1)}if(a.indexOf("\n")>-1){if(i){a=a.split("\n").map((function(t){return" "+t})).join("\n").substr(2)}else{a="\n"+a.split("\n").map((function(t){return" "+t})).join("\n")}}}else{a=t.stylize("[Circular]","special")}}if(Tk(o)){if(i&&s.match(/^\d+$/)){return a}o=JSON.stringify(""+s);if(o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)){o=o.substr(1,o.length-2);o=t.stylize(o,"name")}else{o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'");o=t.stylize(o,"string")}}return o+": "+a}function Nk(t,e,n){var r=t.reduce((function(t,e){if(e.indexOf("\n")>=0);return t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0);if(r>60){return n[0]+(e===""?"":e+"\n ")+" "+t.join(",\n ")+" "+n[1]}return n[0]+e+" "+t.join(", ")+" "+n[1]}function xk(t){return Array.isArray(t)}function Mk(t){return typeof t==="boolean"}function Ik(t){return t===null}function Sk(t){return t==null}function Ek(t){return typeof t==="number"}function Dk(t){return typeof t==="string"}function kk(t){return typeof t==="symbol"}function Tk(t){return t===void 0}function Ak(t){return Lk(t)&&Rk(t)==="[object RegExp]"}function Lk(t){return typeof t==="object"&&t!==null}function _k(t){return Lk(t)&&Rk(t)==="[object Date]"}function Ck(t){return Lk(t)&&(Rk(t)==="[object Error]"||t instanceof Error)}function Ok(t){return typeof t==="function"}function zk(t){return t===null||typeof t==="boolean"||typeof t==="number"||typeof t==="string"||typeof t==="symbol"||typeof t==="undefined"}function jk(t){return Uo.isBuffer(t)}function Rk(t){return Object.prototype.toString.call(t)}function $k(t){return t<10?"0"+t.toString(10):t.toString(10)}var Fk=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Pk(){var t=new Date;var e=[$k(t.getHours()),$k(t.getMinutes()),$k(t.getSeconds())].join(":");return[t.getDate(),Fk[t.getMonth()],e].join(" ")}function Bk(){console.log("%s - %s",Pk(),ak.apply(null,arguments))}function Gk(t,e){if(!e||!Lk(e))return t;var n=Object.keys(e);var r=n.length;while(r--){t[n[r]]=e[n[r]]}return t}function Uk(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var Wk={inherits:ik,_extend:Gk,log:Bk,isBuffer:jk,isPrimitive:zk,isFunction:Ok,isError:Ck,isDate:_k,isObject:Lk,isRegExp:Ak,isUndefined:Tk,isSymbol:kk,isString:Dk,isNumber:Ek,isNullOrUndefined:Sk,isNull:Ik,isBoolean:Mk,isArray:xk,inspect:hk,deprecate:ck,format:ak,debuglog:lk};var Yk=Object.freeze({__proto__:null,_extend:Gk,debuglog:lk,default:Wk,deprecate:ck,format:ak,inherits:ik,inspect:hk,isArray:xk,isBoolean:Mk,isBuffer:jk,isDate:_k,isError:Ck,isFunction:Ok,isNull:Ik,isNullOrUndefined:Sk,isNumber:Ek,isObject:Lk,isPrimitive:zk,isRegExp:Ak,isString:Dk,isSymbol:kk,isUndefined:Tk,log:Bk});var Vk=l(Yk);var Zk;function Qk(){}Qk.prototype=Object.create(null);function Hk(){Hk.init.call(this)}Hk.EventEmitter=Hk;Hk.usingDomains=false;Hk.prototype.domain=undefined;Hk.prototype._events=undefined;Hk.prototype._maxListeners=undefined;Hk.defaultMaxListeners=10;Hk.init=function(){this.domain=null;if(Hk.usingDomains){if(Zk.active&&!(this instanceof Zk.Domain)){this.domain=Zk.active}}if(!this._events||this._events===Object.getPrototypeOf(this)._events){this._events=new Qk;this._eventsCount=0}this._maxListeners=this._maxListeners||undefined};Hk.prototype.setMaxListeners=function t(e){if(typeof e!=="number"||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');this._maxListeners=e;return this};function Jk(t){if(t._maxListeners===undefined)return Hk.defaultMaxListeners;return t._maxListeners}Hk.prototype.getMaxListeners=function t(){return Jk(this)};function qk(t,e,n){if(e)t.call(n);else{var r=t.length;var s=aT(t,r);for(var i=0;i<r;++i)s[i].call(n)}}function Xk(t,e,n,r){if(e)t.call(n,r);else{var s=t.length;var i=aT(t,s);for(var o=0;o<s;++o)i[o].call(n,r)}}function Kk(t,e,n,r,s){if(e)t.call(n,r,s);else{var i=t.length;var o=aT(t,i);for(var a=0;a<i;++a)o[a].call(n,r,s)}}function tT(t,e,n,r,s,i){if(e)t.call(n,r,s,i);else{var o=t.length;var a=aT(t,o);for(var c=0;c<o;++c)a[c].call(n,r,s,i)}}function eT(t,e,n,r){if(e)t.apply(n,r);else{var s=t.length;var i=aT(t,s);for(var o=0;o<s;++o)i[o].apply(n,r)}}Hk.prototype.emit=function t(e){var n,r,s,i,o,a,c;var u=e==="error";a=this._events;if(a)u=u&&a.error==null;else if(!u)return false;c=this.domain;if(u){n=arguments[1];if(c){if(!n)n=new Error('Uncaught, unspecified "error" event');n.domainEmitter=this;n.domain=c;n.domainThrown=false;c.emit("error",n)}else if(n instanceof Error){throw n}else{var f=new Error('Uncaught, unspecified "error" event. ('+n+")");f.context=n;throw f}return false}r=a[e];if(!r)return false;var l=typeof r==="function";s=arguments.length;switch(s){case 1:qk(r,l,this);break;case 2:Xk(r,l,this,arguments[1]);break;case 3:Kk(r,l,this,arguments[1],arguments[2]);break;case 4:tT(r,l,this,arguments[1],arguments[2],arguments[3]);break;default:i=new Array(s-1);for(o=1;o<s;o++)i[o-1]=arguments[o];eT(r,l,this,i)}return true};function nT(t,e,n,r){var s;var i;var o;if(typeof n!=="function")throw new TypeError('"listener" argument must be a function');i=t._events;if(!i){i=t._events=new Qk;t._eventsCount=0}else{if(i.newListener){t.emit("newListener",e,n.listener?n.listener:n);i=t._events}o=i[e]}if(!o){o=i[e]=n;++t._eventsCount}else{if(typeof o==="function"){o=i[e]=r?[n,o]:[o,n]}else{if(r){o.unshift(n)}else{o.push(n)}}if(!o.warned){s=Jk(t);if(s&&s>0&&o.length>s){o.warned=true;var a=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+e+" listeners added. "+"Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning";a.emitter=t;a.type=e;a.count=o.length;rT(a)}}}return t}function rT(t){typeof console.warn==="function"?console.warn(t):console.log(t)}Hk.prototype.addListener=function t(e,n){return nT(this,e,n,false)};Hk.prototype.on=Hk.prototype.addListener;Hk.prototype.prependListener=function t(e,n){return nT(this,e,n,true)};function sT(t,e,n){var r=false;function s(){t.removeListener(e,s);if(!r){r=true;n.apply(t,arguments)}}s.listener=n;return s}Hk.prototype.once=function t(e,n){if(typeof n!=="function")throw new TypeError('"listener" argument must be a function');this.on(e,sT(this,e,n));return this};Hk.prototype.prependOnceListener=function t(e,n){if(typeof n!=="function")throw new TypeError('"listener" argument must be a function');this.prependListener(e,sT(this,e,n));return this};Hk.prototype.removeListener=function t(e,n){var r,s,i,o,a;if(typeof n!=="function")throw new TypeError('"listener" argument must be a function');s=this._events;if(!s)return this;r=s[e];if(!r)return this;if(r===n||r.listener&&r.listener===n){if(--this._eventsCount===0)this._events=new Qk;else{delete s[e];if(s.removeListener)this.emit("removeListener",e,r.listener||n)}}else if(typeof r!=="function"){i=-1;for(o=r.length;o-- >0;){if(r[o]===n||r[o].listener&&r[o].listener===n){a=r[o].listener;i=o;break}}if(i<0)return this;if(r.length===1){r[0]=undefined;if(--this._eventsCount===0){this._events=new Qk;return this}else{delete s[e]}}else{oT(r,i)}if(s.removeListener)this.emit("removeListener",e,a||n)}return this};Hk.prototype.removeAllListeners=function t(e){var n,r;r=this._events;if(!r)return this;if(!r.removeListener){if(arguments.length===0){this._events=new Qk;this._eventsCount=0}else if(r[e]){if(--this._eventsCount===0)this._events=new Qk;else delete r[e]}return this}if(arguments.length===0){var s=Object.keys(r);for(var i=0,o;i<s.length;++i){o=s[i];if(o==="removeListener")continue;this.removeAllListeners(o)}this.removeAllListeners("removeListener");this._events=new Qk;this._eventsCount=0;return this}n=r[e];if(typeof n==="function"){this.removeListener(e,n)}else if(n){do{this.removeListener(e,n[n.length-1])}while(n[0])}return this};Hk.prototype.listeners=function t(e){var n;var r;var s=this._events;if(!s)r=[];else{n=s[e];if(!n)r=[];else if(typeof n==="function")r=[n.listener||n];else r=cT(n)}return r};Hk.listenerCount=function(t,e){if(typeof t.listenerCount==="function"){return t.listenerCount(e)}else{return iT.call(t,e)}};Hk.prototype.listenerCount=iT;function iT(t){var e=this._events;if(e){var n=e[t];if(typeof n==="function"){return 1}else if(n){return n.length}}return 0}Hk.prototype.eventNames=function t(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};function oT(t,e){for(var n=e,r=n+1,s=t.length;r<s;n+=1,r+=1)t[n]=t[r];t.pop()}function aT(t,e){var n=new Array(e);while(e--)n[e]=t[e];return n}function cT(t){var e=new Array(t.length);for(var n=0;n<e.length;++n){e[n]=t[n].listener||t[n]}return e}function uT(){this.head=null;this.tail=null;this.length=0}uT.prototype.push=function(t){var e={data:t,next:null};if(this.length>0)this.tail.next=e;else this.head=e;this.tail=e;++this.length};uT.prototype.unshift=function(t){var e={data:t,next:this.head};if(this.length===0)this.tail=e;this.head=e;++this.length};uT.prototype.shift=function(){if(this.length===0)return;var t=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;--this.length;return t};uT.prototype.clear=function(){this.head=this.tail=null;this.length=0};uT.prototype.join=function(t){if(this.length===0)return"";var e=this.head;var n=""+e.data;while(e=e.next){n+=t+e.data}return n};uT.prototype.concat=function(t){if(this.length===0)return Uo.alloc(0);if(this.length===1)return this.head.data;var e=Uo.allocUnsafe(t>>>0);var n=this.head;var r=0;while(n){n.data.copy(e,r);r+=n.data.length;n=n.next}return e};var fT={};var lT={exports:{}};var hT=l(Pa);
|
|
5931
5931
|
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var dT;function pT(){if(dT)return lT.exports;dT=1;(function(t,e){var n=hT;var r=n.Buffer;function s(t,e){for(var n in t){e[n]=t[n]}}if(r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow){t.exports=n}else{s(n,e);e.Buffer=i}function i(t,e,n){return r(t,e,n)}i.prototype=Object.create(r.prototype);s(r,i);i.from=function(t,e,n){if(typeof t==="number"){throw new TypeError("Argument must not be a number")}return r(t,e,n)};i.alloc=function(t,e,n){if(typeof t!=="number"){throw new TypeError("Argument must be a number")}var s=r(t);if(e!==undefined){if(typeof n==="string"){s.fill(e,n)}else{s.fill(e)}}else{s.fill(0)}return s};i.allocUnsafe=function(t){if(typeof t!=="number"){throw new TypeError("Argument must be a number")}return r(t)};i.allocUnsafeSlow=function(t){if(typeof t!=="number"){throw new TypeError("Argument must be a number")}return n.SlowBuffer(t)}})(lT,lT.exports);return lT.exports}var mT;function yT(){if(mT)return fT;mT=1;var t=pT().Buffer;var e=t.isEncoding||function(t){t=""+t;switch(t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return true;default:return false}};function n(t){if(!t)return"utf8";var e;while(true){switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase();e=true}}}function r(r){var s=n(r);if(typeof s!=="string"&&(t.isEncoding===e||!e(r)))throw new Error("Unknown encoding: "+r);return s||r}fT.StringDecoder=s;function s(e){this.encoding=r(e);var n;switch(this.encoding){case"utf16le":this.text=l;this.end=h;n=4;break;case"utf8":this.fillLast=c;n=4;break;case"base64":this.text=d;this.end=p;n=3;break;default:this.write=m;this.end=y;return}this.lastNeed=0;this.lastTotal=0;this.lastChar=t.allocUnsafe(n)}s.prototype.write=function(t){if(t.length===0)return"";var e;var n;if(this.lastNeed){e=this.fillLast(t);if(e===undefined)return"";n=this.lastNeed;this.lastNeed=0}else{n=0}if(n<t.length)return e?e+this.text(t,n):this.text(t,n);return e||""};s.prototype.end=f;s.prototype.text=u;s.prototype.fillLast=function(t){if(this.lastNeed<=t.length){t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed);return this.lastChar.toString(this.encoding,0,this.lastTotal)}t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length);this.lastNeed-=t.length};function i(t){if(t<=127)return 0;else if(t>>5===6)return 2;else if(t>>4===14)return 3;else if(t>>3===30)return 4;return t>>6===2?-1:-2}function o(t,e,n){var r=e.length-1;if(r<n)return 0;var s=i(e[r]);if(s>=0){if(s>0)t.lastNeed=s-1;return s}if(--r<n||s===-2)return 0;s=i(e[r]);if(s>=0){if(s>0)t.lastNeed=s-2;return s}if(--r<n||s===-2)return 0;s=i(e[r]);if(s>=0){if(s>0){if(s===2)s=0;else t.lastNeed=s-3}return s}return 0}function a(t,e,n){if((e[0]&192)!==128){t.lastNeed=0;return"�"}if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128){t.lastNeed=1;return"�"}if(t.lastNeed>2&&e.length>2){if((e[2]&192)!==128){t.lastNeed=2;return"�"}}}}function c(t){var e=this.lastTotal-this.lastNeed;var n=a(this,t);if(n!==undefined)return n;if(this.lastNeed<=t.length){t.copy(this.lastChar,e,0,this.lastNeed);return this.lastChar.toString(this.encoding,0,this.lastTotal)}t.copy(this.lastChar,e,0,t.length);this.lastNeed-=t.length}function u(t,e){var n=o(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=n;var r=t.length-(n-this.lastNeed);t.copy(this.lastChar,0,r);return t.toString("utf8",e,r)}function f(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed)return e+"�";return e}function l(t,e){if((t.length-e)%2===0){var n=t.toString("utf16le",e);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319){this.lastNeed=2;this.lastTotal=4;this.lastChar[0]=t[t.length-2];this.lastChar[1]=t[t.length-1];return n.slice(0,-1)}}return n}this.lastNeed=1;this.lastTotal=2;this.lastChar[0]=t[t.length-1];return t.toString("utf16le",e,t.length-1)}function h(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,n)}return e}function d(t,e){var n=(t.length-e)%3;if(n===0)return t.toString("base64",e);this.lastNeed=3-n;this.lastTotal=3;if(n===1){this.lastChar[0]=t[t.length-1]}else{this.lastChar[0]=t[t.length-2];this.lastChar[1]=t[t.length-1]}return t.toString("base64",e,t.length-n)}function p(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed)return e+this.lastChar.toString("base64",0,3-this.lastNeed);return e}function m(t){return t.toString(this.encoding)}function y(t){return t&&t.length?this.write(t):""}return fT}var gT=yT();xT.ReadableState=NT;var wT=lk("stream");ik(xT,Hk);function bT(t,e,n){if(typeof t.prependListener==="function"){return t.prependListener(e,n)}else{if(!t._events||!t._events[e])t.on(e,n);else if(Array.isArray(t._events[e]))t._events[e].unshift(n);else t._events[e]=[n,t._events[e]]}}function vT(t,e){return t.listeners(e).length}function NT(t,e){t=t||{};this.objectMode=!!t.objectMode;if(e instanceof yA)this.objectMode=this.objectMode||!!t.readableObjectMode;var n=t.highWaterMark;var r=this.objectMode?16:16*1024;this.highWaterMark=n||n===0?n:r;this.highWaterMark=~~this.highWaterMark;this.buffer=new uT;this.length=0;this.pipes=null;this.pipesCount=0;this.flowing=null;this.ended=false;this.endEmitted=false;this.reading=false;this.sync=true;this.needReadable=false;this.emittedReadable=false;this.readableListening=false;this.resumeScheduled=false;this.defaultEncoding=t.defaultEncoding||"utf8";this.ranOut=false;this.awaitDrain=0;this.readingMore=false;this.decoder=null;this.encoding=null;if(t.encoding){this.decoder=new gT.StringDecoder(t.encoding);this.encoding=t.encoding}}function xT(t){if(!(this instanceof xT))return new xT(t);this._readableState=new NT(t,this);this.readable=true;if(t&&typeof t.read==="function")this._read=t.read;Hk.call(this)}xT.prototype.push=function(t,e){var n=this._readableState;if(!n.objectMode&&typeof t==="string"){e=e||n.defaultEncoding;if(e!==n.encoding){t=Uo.from(t,e);e=""}}return MT(this,n,t,e,false)};xT.prototype.unshift=function(t){var e=this._readableState;return MT(this,e,t,"",true)};xT.prototype.isPaused=function(){return this._readableState.flowing===false};function MT(t,e,n,r,s){var i=kT(e,n);if(i){t.emit("error",i)}else if(n===null){e.reading=false;TT(t,e)}else if(e.objectMode||n&&n.length>0){if(e.ended&&!s){var o=new Error("stream.push() after EOF");t.emit("error",o)}else if(e.endEmitted&&s){var a=new Error("stream.unshift() after end event");t.emit("error",a)}else{var c;if(e.decoder&&!s&&!r){n=e.decoder.write(n);c=!e.objectMode&&n.length===0}if(!s)e.reading=false;if(!c){if(e.flowing&&e.length===0&&!e.sync){t.emit("data",n);t.read(0)}else{e.length+=e.objectMode?1:n.length;if(s)e.buffer.unshift(n);else e.buffer.push(n);if(e.needReadable)AT(t)}}_T(t,e)}}else if(!s){e.reading=false}return IT(e)}function IT(t){return!t.ended&&(t.needReadable||t.length<t.highWaterMark||t.length===0)}xT.prototype.setEncoding=function(t){this._readableState.decoder=new gT.StringDecoder(t);this._readableState.encoding=t;return this};var ST=8388608;function ET(t){if(t>=ST){t=ST}else{t--;t|=t>>>1;t|=t>>>2;t|=t>>>4;t|=t>>>8;t|=t>>>16;t++}return t}function DT(t,e){if(t<=0||e.length===0&&e.ended)return 0;if(e.objectMode)return 1;if(t!==t){if(e.flowing&&e.length)return e.buffer.head.data.length;else return e.length}if(t>e.highWaterMark)e.highWaterMark=ET(t);if(t<=e.length)return t;if(!e.ended){e.needReadable=true;return 0}return e.length}xT.prototype.read=function(t){wT("read",t);t=parseInt(t,10);var e=this._readableState;var n=t;if(t!==0)e.emittedReadable=false;if(t===0&&e.needReadable&&(e.length>=e.highWaterMark||e.ended)){wT("read: emitReadable",e.length,e.ended);if(e.length===0&&e.ended)UT(this);else AT(this);return null}t=DT(t,e);if(t===0&&e.ended){if(e.length===0)UT(this);return null}var r=e.needReadable;wT("need readable",r);if(e.length===0||e.length-t<e.highWaterMark){r=true;wT("length less than watermark",r)}if(e.ended||e.reading){r=false;wT("reading or ended",r)}else if(r){wT("do read");e.reading=true;e.sync=true;if(e.length===0)e.needReadable=true;this._read(e.highWaterMark);e.sync=false;if(!e.reading)t=DT(n,e)}var s;if(t>0)s=FT(t,e);else s=null;if(s===null){e.needReadable=true;t=0}else{e.length-=t}if(e.length===0){if(!e.ended)e.needReadable=true;if(n!==t&&e.ended)UT(this)}if(s!==null)this.emit("data",s);return s};function kT(t,e){var n=null;if(!Uo.isBuffer(e)&&typeof e!=="string"&&e!==null&&e!==undefined&&!t.objectMode){n=new TypeError("Invalid non-string/buffer chunk")}return n}function TT(t,e){if(e.ended)return;if(e.decoder){var n=e.decoder.end();if(n&&n.length){e.buffer.push(n);e.length+=e.objectMode?1:n.length}}e.ended=true;AT(t)}function AT(t){var e=t._readableState;e.needReadable=false;if(!e.emittedReadable){wT("emitReadable",e.flowing);e.emittedReadable=true;if(e.sync)I(LT,t);else LT(t)}}function LT(t){wT("emit readable");t.emit("readable");$T(t)}function _T(t,e){if(!e.readingMore){e.readingMore=true;I(CT,t,e)}}function CT(t,e){var n=e.length;while(!e.reading&&!e.flowing&&!e.ended&&e.length<e.highWaterMark){wT("maybeReadMore read 0");t.read(0);if(n===e.length)break;else n=e.length}e.readingMore=false}xT.prototype._read=function(t){this.emit("error",new Error("not implemented"))};xT.prototype.pipe=function(t,e){var n=this;var r=this._readableState;switch(r.pipesCount){case 0:r.pipes=t;break;case 1:r.pipes=[r.pipes,t];break;default:r.pipes.push(t);break}r.pipesCount+=1;wT("pipe count=%d opts=%j",r.pipesCount,e);var s=!e||e.end!==false;var i=s?a:f;if(r.endEmitted)I(i);else n.once("end",i);t.on("unpipe",o);function o(t){wT("onunpipe");if(t===n){f()}}function a(){wT("onend");t.end()}var c=OT(n);t.on("drain",c);var u=false;function f(){wT("cleanup");t.removeListener("close",p);t.removeListener("finish",m);t.removeListener("drain",c);t.removeListener("error",d);t.removeListener("unpipe",o);n.removeListener("end",a);n.removeListener("end",f);n.removeListener("data",h);u=true;if(r.awaitDrain&&(!t._writableState||t._writableState.needDrain))c()}var l=false;n.on("data",h);function h(e){wT("ondata");l=false;var s=t.write(e);if(false===s&&!l){if((r.pipesCount===1&&r.pipes===t||r.pipesCount>1&&VT(r.pipes,t)!==-1)&&!u){wT("false write response, pause",n._readableState.awaitDrain);n._readableState.awaitDrain++;l=true}n.pause()}}function d(e){wT("onerror",e);y();t.removeListener("error",d);if(vT(t,"error")===0)t.emit("error",e)}bT(t,"error",d);function p(){t.removeListener("finish",m);y()}t.once("close",p);function m(){wT("onfinish");t.removeListener("close",p);y()}t.once("finish",m);function y(){wT("unpipe");n.unpipe(t)}t.emit("pipe",n);if(!r.flowing){wT("pipe resume");n.resume()}return t};function OT(t){return function(){var e=t._readableState;wT("pipeOnDrain",e.awaitDrain);if(e.awaitDrain)e.awaitDrain--;if(e.awaitDrain===0&&t.listeners("data").length){e.flowing=true;$T(t)}}}xT.prototype.unpipe=function(t){var e=this._readableState;if(e.pipesCount===0)return this;if(e.pipesCount===1){if(t&&t!==e.pipes)return this;if(!t)t=e.pipes;e.pipes=null;e.pipesCount=0;e.flowing=false;if(t)t.emit("unpipe",this);return this}if(!t){var n=e.pipes;var r=e.pipesCount;e.pipes=null;e.pipesCount=0;e.flowing=false;for(var s=0;s<r;s++){n[s].emit("unpipe",this)}return this}var i=VT(e.pipes,t);if(i===-1)return this;e.pipes.splice(i,1);e.pipesCount-=1;if(e.pipesCount===1)e.pipes=e.pipes[0];t.emit("unpipe",this);return this};xT.prototype.on=function(t,e){var n=Hk.prototype.on.call(this,t,e);if(t==="data"){if(this._readableState.flowing!==false)this.resume()}else if(t==="readable"){var r=this._readableState;if(!r.endEmitted&&!r.readableListening){r.readableListening=r.needReadable=true;r.emittedReadable=false;if(!r.reading){I(zT,this)}else if(r.length){AT(this)}}}return n};xT.prototype.addListener=xT.prototype.on;function zT(t){wT("readable nexttick read 0");t.read(0)}xT.prototype.resume=function(){var t=this._readableState;if(!t.flowing){wT("resume");t.flowing=true;jT(this,t)}return this};function jT(t,e){if(!e.resumeScheduled){e.resumeScheduled=true;I(RT,t,e)}}function RT(t,e){if(!e.reading){wT("resume read 0");t.read(0)}e.resumeScheduled=false;e.awaitDrain=0;t.emit("resume");$T(t);if(e.flowing&&!e.reading)t.read(0)}xT.prototype.pause=function(){wT("call pause flowing=%j",this._readableState.flowing);if(false!==this._readableState.flowing){wT("pause");this._readableState.flowing=false;this.emit("pause")}return this};function $T(t){var e=t._readableState;wT("flow",e.flowing);while(e.flowing&&t.read()!==null){}}xT.prototype.wrap=function(t){var e=this._readableState;var n=false;var r=this;t.on("end",(function(){wT("wrapped end");if(e.decoder&&!e.ended){var t=e.decoder.end();if(t&&t.length)r.push(t)}r.push(null)}));t.on("data",(function(s){wT("wrapped data");if(e.decoder)s=e.decoder.write(s);if(e.objectMode&&(s===null||s===undefined))return;else if(!e.objectMode&&(!s||!s.length))return;var i=r.push(s);if(!i){n=true;t.pause()}}));for(var s in t){if(this[s]===undefined&&typeof t[s]==="function"){this[s]=function(e){return function(){return t[e].apply(t,arguments)}}(s)}}var i=["error","close","destroy","pause","resume"];YT(i,(function(e){t.on(e,r.emit.bind(r,e))}));r._read=function(e){wT("wrapped _read",e);if(n){n=false;t.resume()}};return r};xT._fromList=FT;function FT(t,e){if(e.length===0)return null;var n;if(e.objectMode)n=e.buffer.shift();else if(!t||t>=e.length){if(e.decoder)n=e.buffer.join("");else if(e.buffer.length===1)n=e.buffer.head.data;else n=e.buffer.concat(e.length);e.buffer.clear()}else{n=PT(t,e.buffer,e.decoder)}return n}function PT(t,e,n){var r;if(t<e.head.data.length){r=e.head.data.slice(0,t);e.head.data=e.head.data.slice(t)}else if(t===e.head.data.length){r=e.shift()}else{r=n?BT(t,e):GT(t,e)}return r}function BT(t,e){var n=e.head;var r=1;var s=n.data;t-=s.length;while(n=n.next){var i=n.data;var o=t>i.length?i.length:t;if(o===i.length)s+=i;else s+=i.slice(0,t);t-=o;if(t===0){if(o===i.length){++r;if(n.next)e.head=n.next;else e.head=e.tail=null}else{e.head=n;n.data=i.slice(o)}break}++r}e.length-=r;return s}function GT(t,e){var n=Uo.allocUnsafe(t);var r=e.head;var s=1;r.data.copy(n);t-=r.data.length;while(r=r.next){var i=r.data;var o=t>i.length?i.length:t;i.copy(n,n.length-t,0,o);t-=o;if(t===0){if(o===i.length){++s;if(r.next)e.head=r.next;else e.head=e.tail=null}else{e.head=r;r.data=i.slice(o)}break}++s}e.length-=s;return n}function UT(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');if(!e.endEmitted){e.ended=true;I(WT,e,t)}}function WT(t,e){if(!t.endEmitted&&t.length===0){t.endEmitted=true;e.readable=false;e.emit("end")}}function YT(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n)}}function VT(t,e){for(var n=0,r=t.length;n<r;n++){if(t[n]===e)return n}return-1}JT.WritableState=HT;ik(JT,Hk);function ZT(){}function QT(t,e,n){this.chunk=t;this.encoding=e;this.callback=n;this.next=null}function HT(t,e){Object.defineProperty(this,"buffer",{get:ck((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer "+"instead.")});t=t||{};this.objectMode=!!t.objectMode;if(e instanceof yA)this.objectMode=this.objectMode||!!t.writableObjectMode;var n=t.highWaterMark;var r=this.objectMode?16:16*1024;this.highWaterMark=n||n===0?n:r;this.highWaterMark=~~this.highWaterMark;this.needDrain=false;this.ending=false;this.ended=false;this.finished=false;var s=t.decodeStrings===false;this.decodeStrings=!s;this.defaultEncoding=t.defaultEncoding||"utf8";this.length=0;this.writing=false;this.corked=0;this.sync=true;this.bufferProcessing=false;this.onwrite=function(t){sA(e,t)};this.writecb=null;this.writelen=0;this.bufferedRequest=null;this.lastBufferedRequest=null;this.pendingcb=0;this.prefinished=false;this.errorEmitted=false;this.bufferedRequestCount=0;this.corkedRequestsFree=new hA(this)}HT.prototype.getBuffer=function t(){var e=this.bufferedRequest;var n=[];while(e){n.push(e);e=e.next}return n};function JT(t){if(!(this instanceof JT)&&!(this instanceof yA))return new JT(t);this._writableState=new HT(t,this);this.writable=true;if(t){if(typeof t.write==="function")this._write=t.write;if(typeof t.writev==="function")this._writev=t.writev}Hk.call(this)}JT.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function qT(t,e){var n=new Error("write after end");t.emit("error",n);I(e,n)}function XT(t,e,n,r){var s=true;var i=false;if(n===null){i=new TypeError("May not write null values to stream")}else if(!Uo.isBuffer(n)&&typeof n!=="string"&&n!==undefined&&!e.objectMode){i=new TypeError("Invalid non-string/buffer chunk")}if(i){t.emit("error",i);I(r,i);s=false}return s}JT.prototype.write=function(t,e,n){var r=this._writableState;var s=false;if(typeof e==="function"){n=e;e=null}if(Uo.isBuffer(t))e="buffer";else if(!e)e=r.defaultEncoding;if(typeof n!=="function")n=ZT;if(r.ended)qT(this,n);else if(XT(this,r,t,n)){r.pendingcb++;s=tA(this,r,t,e,n)}return s};JT.prototype.cork=function(){var t=this._writableState;t.corked++};JT.prototype.uncork=function(){var t=this._writableState;if(t.corked){t.corked--;if(!t.writing&&!t.corked&&!t.finished&&!t.bufferProcessing&&t.bufferedRequest)aA(this,t)}};JT.prototype.setDefaultEncoding=function t(e){if(typeof e==="string")e=e.toLowerCase();if(!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);this._writableState.defaultEncoding=e;return this};function KT(t,e,n){if(!t.objectMode&&t.decodeStrings!==false&&typeof e==="string"){e=Uo.from(e,n)}return e}function tA(t,e,n,r,s){n=KT(e,n,r);if(Uo.isBuffer(n))r="buffer";var i=e.objectMode?1:n.length;e.length+=i;var o=e.length<e.highWaterMark;if(!o)e.needDrain=true;if(e.writing||e.corked){var a=e.lastBufferedRequest;e.lastBufferedRequest=new QT(n,r,s);if(a){a.next=e.lastBufferedRequest}else{e.bufferedRequest=e.lastBufferedRequest}e.bufferedRequestCount+=1}else{eA(t,e,false,i,n,r,s)}return o}function eA(t,e,n,r,s,i,o){e.writelen=r;e.writecb=o;e.writing=true;e.sync=true;if(n)t._writev(s,e.onwrite);else t._write(s,i,e.onwrite);e.sync=false}function nA(t,e,n,r,s){--e.pendingcb;if(n)I(s,r);else s(r);t._writableState.errorEmitted=true;t.emit("error",r)}function rA(t){t.writing=false;t.writecb=null;t.length-=t.writelen;t.writelen=0}function sA(t,e){var n=t._writableState;var r=n.sync;var s=n.writecb;rA(n);if(e)nA(t,n,r,e,s);else{var i=cA(n);if(!i&&!n.corked&&!n.bufferProcessing&&n.bufferedRequest){aA(t,n)}if(r){I(iA,t,n,i,s)}else{iA(t,n,i,s)}}}function iA(t,e,n,r){if(!n)oA(t,e);e.pendingcb--;r();fA(t,e)}function oA(t,e){if(e.length===0&&e.needDrain){e.needDrain=false;t.emit("drain")}}function aA(t,e){e.bufferProcessing=true;var n=e.bufferedRequest;if(t._writev&&n&&n.next){var r=e.bufferedRequestCount;var s=new Array(r);var i=e.corkedRequestsFree;i.entry=n;var o=0;while(n){s[o]=n;n=n.next;o+=1}eA(t,e,true,e.length,s,"",i.finish);e.pendingcb++;e.lastBufferedRequest=null;if(i.next){e.corkedRequestsFree=i.next;i.next=null}else{e.corkedRequestsFree=new hA(e)}}else{while(n){var a=n.chunk;var c=n.encoding;var u=n.callback;var f=e.objectMode?1:a.length;eA(t,e,false,f,a,c,u);n=n.next;if(e.writing){break}}if(n===null)e.lastBufferedRequest=null}e.bufferedRequestCount=0;e.bufferedRequest=n;e.bufferProcessing=false}JT.prototype._write=function(t,e,n){n(new Error("not implemented"))};JT.prototype._writev=null;JT.prototype.end=function(t,e,n){var r=this._writableState;if(typeof t==="function"){n=t;t=null;e=null}else if(typeof e==="function"){n=e;e=null}if(t!==null&&t!==undefined)this.write(t,e);if(r.corked){r.corked=1;this.uncork()}if(!r.ending&&!r.finished)lA(this,r,n)};function cA(t){return t.ending&&t.length===0&&t.bufferedRequest===null&&!t.finished&&!t.writing}function uA(t,e){if(!e.prefinished){e.prefinished=true;t.emit("prefinish")}}function fA(t,e){var n=cA(e);if(n){if(e.pendingcb===0){uA(t,e);e.finished=true;t.emit("finish")}else{uA(t,e)}}return n}function lA(t,e,n){e.ending=true;fA(t,e);if(n){if(e.finished)I(n);else t.once("finish",n)}e.ended=true;t.writable=false}function hA(t){var e=this;this.next=null;this.entry=null;this.finish=function(n){var r=e.entry;e.entry=null;while(r){var s=r.callback;t.pendingcb--;s(n);r=r.next}if(t.corkedRequestsFree){t.corkedRequestsFree.next=e}else{t.corkedRequestsFree=e}}}ik(yA,xT);var dA=Object.keys(JT.prototype);for(var pA=0;pA<dA.length;pA++){var mA=dA[pA];if(!yA.prototype[mA])yA.prototype[mA]=JT.prototype[mA]}function yA(t){if(!(this instanceof yA))return new yA(t);xT.call(this,t);JT.call(this,t);if(t&&t.readable===false)this.readable=false;if(t&&t.writable===false)this.writable=false;this.allowHalfOpen=true;if(t&&t.allowHalfOpen===false)this.allowHalfOpen=false;this.once("end",gA)}function gA(){if(this.allowHalfOpen||this._writableState.ended)return;I(wA,this)}function wA(t){t.end()}ik(NA,yA);function bA(t){this.afterTransform=function(e,n){return vA(t,e,n)};this.needTransform=false;this.transforming=false;this.writecb=null;this.writechunk=null;this.writeencoding=null}function vA(t,e,n){var r=t._transformState;r.transforming=false;var s=r.writecb;if(!s)return t.emit("error",new Error("no writecb in Transform class"));r.writechunk=null;r.writecb=null;if(n!==null&&n!==undefined)t.push(n);s(e);var i=t._readableState;i.reading=false;if(i.needReadable||i.length<i.highWaterMark){t._read(i.highWaterMark)}}function NA(t){if(!(this instanceof NA))return new NA(t);yA.call(this,t);this._transformState=new bA(this);var e=this;this._readableState.needReadable=true;this._readableState.sync=false;if(t){if(typeof t.transform==="function")this._transform=t.transform;if(typeof t.flush==="function")this._flush=t.flush}this.once("prefinish",(function(){if(typeof this._flush==="function")this._flush((function(t){xA(e,t)}));else xA(e)}))}NA.prototype.push=function(t,e){this._transformState.needTransform=false;return yA.prototype.push.call(this,t,e)};NA.prototype._transform=function(t,e,n){throw new Error("Not implemented")};NA.prototype._write=function(t,e,n){var r=this._transformState;r.writecb=n;r.writechunk=t;r.writeencoding=e;if(!r.transforming){var s=this._readableState;if(r.needTransform||s.needReadable||s.length<s.highWaterMark)this._read(s.highWaterMark)}};NA.prototype._read=function(t){var e=this._transformState;if(e.writechunk!==null&&e.writecb&&!e.transforming){e.transforming=true;this._transform(e.writechunk,e.writeencoding,e.afterTransform)}else{e.needTransform=true}};function xA(t,e){if(e)return t.emit("error",e);var n=t._writableState;var r=t._transformState;if(n.length)throw new Error("Calling transform done when ws.length != 0");if(r.transforming)throw new Error("Calling transform done when still transforming");return t.push(null)}ik(MA,NA);function MA(t){if(!(this instanceof MA))return new MA(t);NA.call(this,t)}MA.prototype._transform=function(t,e,n){n(null,t)};ik(IA,Hk);IA.Readable=xT;IA.Writable=JT;IA.Duplex=yA;IA.Transform=NA;IA.PassThrough=MA;IA.Stream=IA;function IA(){Hk.call(this)}IA.prototype.pipe=function(t,e){var n=this;function r(e){if(t.writable){if(false===t.write(e)&&n.pause){n.pause()}}}n.on("data",r);function s(){if(n.readable&&n.resume){n.resume()}}t.on("drain",s);if(!t._isStdio&&(!e||e.end!==false)){n.on("end",o);n.on("close",a)}var i=false;function o(){if(i)return;i=true;t.end()}function a(){if(i)return;i=true;if(typeof t.destroy==="function")t.destroy()}function c(t){u();if(Hk.listenerCount(this,"error")===0){throw t}}n.on("error",c);t.on("error",c);function u(){n.removeListener("data",r);t.removeListener("drain",s);n.removeListener("end",o);n.removeListener("close",a);n.removeListener("error",c);t.removeListener("error",c);n.removeListener("end",u);n.removeListener("close",u);t.removeListener("close",u)}n.on("end",u);n.on("close",u);t.on("close",u);t.emit("pipe",n);return t};var SA=Object.freeze({__proto__:null,Duplex:yA,PassThrough:MA,Readable:xT,Stream:IA,Transform:NA,Writable:JT,default:IA});var EA=l(SA);var DA={exports:{}};var kA={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"};function TA(){this.input=null;this.next_in=0;this.avail_in=0;this.total_in=0;this.output=null;this.next_out=0;this.avail_out=0;this.total_out=0;this.msg="";this.state=null;this.data_type=2;this.adler=0}function AA(t,e,n,r,s){if(e.subarray&&t.subarray){t.set(e.subarray(n,n+r),s);return}for(var i=0;i<r;i++){t[s+i]=e[n+i]}}var LA=Uint8Array;var _A=Uint16Array;var CA=Int32Array;var OA=4;var zA=0;var jA=1;var RA=2;function $A(t){var e=t.length;while(--e>=0){t[e]=0}}var FA=0;var PA=1;var BA=2;var GA=3;var UA=258;var WA=29;var YA=256;var VA=YA+1+WA;var ZA=30;var QA=19;var HA=2*VA+1;var JA=15;var qA=16;var XA=7;var KA=256;var tL=16;var eL=17;var nL=18;var rL=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];var sL=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];var iL=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];var oL=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];var aL=512;var cL=new Array((VA+2)*2);$A(cL);var uL=new Array(ZA*2);$A(uL);var fL=new Array(aL);$A(fL);var lL=new Array(UA-GA+1);$A(lL);var hL=new Array(WA);$A(hL);var dL=new Array(ZA);$A(dL);function pL(t,e,n,r,s){this.static_tree=t;this.extra_bits=e;this.extra_base=n;this.elems=r;this.max_length=s;this.has_stree=t&&t.length}var mL;var yL;var gL;function wL(t,e){this.dyn_tree=t;this.max_code=0;this.stat_desc=e}function bL(t){return t<256?fL[t]:fL[256+(t>>>7)]}function vL(t,e){t.pending_buf[t.pending++]=e&255;t.pending_buf[t.pending++]=e>>>8&255}function NL(t,e,n){if(t.bi_valid>qA-n){t.bi_buf|=e<<t.bi_valid&65535;vL(t,t.bi_buf);t.bi_buf=e>>qA-t.bi_valid;t.bi_valid+=n-qA}else{t.bi_buf|=e<<t.bi_valid&65535;t.bi_valid+=n}}function xL(t,e,n){NL(t,n[e*2],n[e*2+1])}function ML(t,e){var n=0;do{n|=t&1;t>>>=1;n<<=1}while(--e>0);return n>>>1}function IL(t){if(t.bi_valid===16){vL(t,t.bi_buf);t.bi_buf=0;t.bi_valid=0}else if(t.bi_valid>=8){t.pending_buf[t.pending++]=t.bi_buf&255;t.bi_buf>>=8;t.bi_valid-=8}}function SL(t,e){var n=e.dyn_tree;var r=e.max_code;var s=e.stat_desc.static_tree;var i=e.stat_desc.has_stree;var o=e.stat_desc.extra_bits;var a=e.stat_desc.extra_base;var c=e.stat_desc.max_length;var u;var f,l;var h;var d;var p;var m=0;for(h=0;h<=JA;h++){t.bl_count[h]=0}n[t.heap[t.heap_max]*2+1]=0;for(u=t.heap_max+1;u<HA;u++){f=t.heap[u];h=n[n[f*2+1]*2+1]+1;if(h>c){h=c;m++}n[f*2+1]=h;if(f>r){continue}t.bl_count[h]++;d=0;if(f>=a){d=o[f-a]}p=n[f*2];t.opt_len+=p*(h+d);if(i){t.static_len+=p*(s[f*2+1]+d)}}if(m===0){return}do{h=c-1;while(t.bl_count[h]===0){h--}t.bl_count[h]--;t.bl_count[h+1]+=2;t.bl_count[c]--;m-=2}while(m>0);for(h=c;h!==0;h--){f=t.bl_count[h];while(f!==0){l=t.heap[--u];if(l>r){continue}if(n[l*2+1]!==h){t.opt_len+=(h-n[l*2+1])*n[l*2];n[l*2+1]=h}f--}}}function EL(t,e,n){var r=new Array(JA+1);var s=0;var i;var o;for(i=1;i<=JA;i++){r[i]=s=s+n[i-1]<<1}for(o=0;o<=e;o++){var a=t[o*2+1];if(a===0){continue}t[o*2]=ML(r[a]++,a)}}function DL(){var t;var e;var n;var r;var s;var i=new Array(JA+1);n=0;for(r=0;r<WA-1;r++){hL[r]=n;for(t=0;t<1<<rL[r];t++){lL[n++]=r}}lL[n-1]=r;s=0;for(r=0;r<16;r++){dL[r]=s;for(t=0;t<1<<sL[r];t++){fL[s++]=r}}s>>=7;for(;r<ZA;r++){dL[r]=s<<7;for(t=0;t<1<<sL[r]-7;t++){fL[256+s++]=r}}for(e=0;e<=JA;e++){i[e]=0}t=0;while(t<=143){cL[t*2+1]=8;t++;i[8]++}while(t<=255){cL[t*2+1]=9;t++;i[9]++}while(t<=279){cL[t*2+1]=7;t++;i[7]++}while(t<=287){cL[t*2+1]=8;t++;i[8]++}EL(cL,VA+1,i);for(t=0;t<ZA;t++){uL[t*2+1]=5;uL[t*2]=ML(t,5)}mL=new pL(cL,rL,YA+1,VA,JA);yL=new pL(uL,sL,0,ZA,JA);gL=new pL(new Array(0),iL,0,QA,XA)}function kL(t){var e;for(e=0;e<VA;e++){t.dyn_ltree[e*2]=0}for(e=0;e<ZA;e++){t.dyn_dtree[e*2]=0}for(e=0;e<QA;e++){t.bl_tree[e*2]=0}t.dyn_ltree[KA*2]=1;t.opt_len=t.static_len=0;t.last_lit=t.matches=0}function TL(t){if(t.bi_valid>8){vL(t,t.bi_buf)}else if(t.bi_valid>0){t.pending_buf[t.pending++]=t.bi_buf}t.bi_buf=0;t.bi_valid=0}function AL(t,e,n,r){TL(t);{vL(t,n);vL(t,~n)}AA(t.pending_buf,t.window,e,n,t.pending);t.pending+=n}function LL(t,e,n,r){var s=e*2;var i=n*2;return t[s]<t[i]||t[s]===t[i]&&r[e]<=r[n]}function _L(t,e,n){var r=t.heap[n];var s=n<<1;while(s<=t.heap_len){if(s<t.heap_len&&LL(e,t.heap[s+1],t.heap[s],t.depth)){s++}if(LL(e,r,t.heap[s],t.depth)){break}t.heap[n]=t.heap[s];n=s;s<<=1}t.heap[n]=r}function CL(t,e,n){var r;var s;var i=0;var o;var a;if(t.last_lit!==0){do{r=t.pending_buf[t.d_buf+i*2]<<8|t.pending_buf[t.d_buf+i*2+1];s=t.pending_buf[t.l_buf+i];i++;if(r===0){xL(t,s,e)}else{o=lL[s];xL(t,o+YA+1,e);a=rL[o];if(a!==0){s-=hL[o];NL(t,s,a)}r--;o=bL(r);xL(t,o,n);a=sL[o];if(a!==0){r-=dL[o];NL(t,r,a)}}}while(i<t.last_lit)}xL(t,KA,e)}function OL(t,e){var n=e.dyn_tree;var r=e.stat_desc.static_tree;var s=e.stat_desc.has_stree;var i=e.stat_desc.elems;var o,a;var c=-1;var u;t.heap_len=0;t.heap_max=HA;for(o=0;o<i;o++){if(n[o*2]!==0){t.heap[++t.heap_len]=c=o;t.depth[o]=0}else{n[o*2+1]=0}}while(t.heap_len<2){u=t.heap[++t.heap_len]=c<2?++c:0;n[u*2]=1;t.depth[u]=0;t.opt_len--;if(s){t.static_len-=r[u*2+1]}}e.max_code=c;for(o=t.heap_len>>1;o>=1;o--){_L(t,n,o)}u=i;do{o=t.heap[1];t.heap[1]=t.heap[t.heap_len--];_L(t,n,1);a=t.heap[1];t.heap[--t.heap_max]=o;t.heap[--t.heap_max]=a;n[u*2]=n[o*2]+n[a*2];t.depth[u]=(t.depth[o]>=t.depth[a]?t.depth[o]:t.depth[a])+1;n[o*2+1]=n[a*2+1]=u;t.heap[1]=u++;_L(t,n,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1];SL(t,e);EL(n,c,t.bl_count)}function zL(t,e,n){var r;var s=-1;var i;var o=e[0*2+1];var a=0;var c=7;var u=4;if(o===0){c=138;u=3}e[(n+1)*2+1]=65535;for(r=0;r<=n;r++){i=o;o=e[(r+1)*2+1];if(++a<c&&i===o){continue}else if(a<u){t.bl_tree[i*2]+=a}else if(i!==0){if(i!==s){t.bl_tree[i*2]++}t.bl_tree[tL*2]++}else if(a<=10){t.bl_tree[eL*2]++}else{t.bl_tree[nL*2]++}a=0;s=i;if(o===0){c=138;u=3}else if(i===o){c=6;u=3}else{c=7;u=4}}}function jL(t,e,n){var r;var s=-1;var i;var o=e[0*2+1];var a=0;var c=7;var u=4;if(o===0){c=138;u=3}for(r=0;r<=n;r++){i=o;o=e[(r+1)*2+1];if(++a<c&&i===o){continue}else if(a<u){do{xL(t,i,t.bl_tree)}while(--a!==0)}else if(i!==0){if(i!==s){xL(t,i,t.bl_tree);a--}xL(t,tL,t.bl_tree);NL(t,a-3,2)}else if(a<=10){xL(t,eL,t.bl_tree);NL(t,a-3,3)}else{xL(t,nL,t.bl_tree);NL(t,a-11,7)}a=0;s=i;if(o===0){c=138;u=3}else if(i===o){c=6;u=3}else{c=7;u=4}}}function RL(t){var e;zL(t,t.dyn_ltree,t.l_desc.max_code);zL(t,t.dyn_dtree,t.d_desc.max_code);OL(t,t.bl_desc);for(e=QA-1;e>=3;e--){if(t.bl_tree[oL[e]*2+1]!==0){break}}t.opt_len+=3*(e+1)+5+5+4;return e}function $L(t,e,n,r){var s;NL(t,e-257,5);NL(t,n-1,5);NL(t,r-4,4);for(s=0;s<r;s++){NL(t,t.bl_tree[oL[s]*2+1],3)}jL(t,t.dyn_ltree,e-1);jL(t,t.dyn_dtree,n-1)}function FL(t){var e=4093624447;var n;for(n=0;n<=31;n++,e>>>=1){if(e&1&&t.dyn_ltree[n*2]!==0){return zA}}if(t.dyn_ltree[9*2]!==0||t.dyn_ltree[10*2]!==0||t.dyn_ltree[13*2]!==0){return jA}for(n=32;n<YA;n++){if(t.dyn_ltree[n*2]!==0){return jA}}return zA}var PL=false;function BL(t){if(!PL){DL();PL=true}t.l_desc=new wL(t.dyn_ltree,mL);t.d_desc=new wL(t.dyn_dtree,yL);t.bl_desc=new wL(t.bl_tree,gL);t.bi_buf=0;t.bi_valid=0;kL(t)}function GL(t,e,n,r){NL(t,(FA<<1)+(r?1:0),3);AL(t,e,n)}function UL(t){NL(t,PA<<1,3);xL(t,KA,cL);IL(t)}function WL(t,e,n,r){var s,i;var o=0;if(t.level>0){if(t.strm.data_type===RA){t.strm.data_type=FL(t)}OL(t,t.l_desc);OL(t,t.d_desc);o=RL(t);s=t.opt_len+3+7>>>3;i=t.static_len+3+7>>>3;if(i<=s){s=i}}else{s=i=n+5}if(n+4<=s&&e!==-1){GL(t,e,n,r)}else if(t.strategy===OA||i===s){NL(t,(PA<<1)+(r?1:0),3);CL(t,cL,uL)}else{NL(t,(BA<<1)+(r?1:0),3);$L(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1);CL(t,t.dyn_ltree,t.dyn_dtree)}kL(t);if(r){TL(t)}}function YL(t,e,n){t.pending_buf[t.d_buf+t.last_lit*2]=e>>>8&255;t.pending_buf[t.d_buf+t.last_lit*2+1]=e&255;t.pending_buf[t.l_buf+t.last_lit]=n&255;t.last_lit++;if(e===0){t.dyn_ltree[n*2]++}else{t.matches++;e--;t.dyn_ltree[(lL[n]+YA+1)*2]++;t.dyn_dtree[bL(e)*2]++}return t.last_lit===t.lit_bufsize-1}function VL(t,e,n,r){var s=t&65535|0,i=t>>>16&65535|0,o=0;while(n!==0){o=n>2e3?2e3:n;n-=o;do{s=s+e[r++]|0;i=i+s|0}while(--o);s%=65521;i%=65521}return s|i<<16|0}function ZL(){var t,e=[];for(var n=0;n<256;n++){t=n;for(var r=0;r<8;r++){t=t&1?3988292384^t>>>1:t>>>1}e[n]=t}return e}var QL=ZL();function HL(t,e,n,r){var s=QL,i=r+n;t^=-1;for(var o=r;o<i;o++){t=t>>>8^s[(t^e[o])&255]}return t^-1}var JL=0;var qL=1;var XL=3;var KL=4;var t_=5;var e_=0;var n_=1;var r_=-2;var s_=-3;var i_=-5;var o_=-1;var a_=1;var c_=2;var u_=3;var f_=4;var l_=2;var h_=8;var d_=9;var p_=29;var m_=256;var y_=m_+1+p_;var g_=30;var w_=19;var b_=2*y_+1;var v_=15;var N_=3;var x_=258;var M_=x_+N_+1;var I_=32;var S_=42;var E_=69;var D_=73;var k_=91;var T_=103;var A_=113;var L_=666;var __=1;var C_=2;var O_=3;var z_=4;var j_=3;function R_(t,e){t.msg=kA[e];return e}function $_(t){return(t<<1)-(t>4?9:0)}function F_(t){var e=t.length;while(--e>=0){t[e]=0}}function P_(t){var e=t.state;var n=e.pending;if(n>t.avail_out){n=t.avail_out}if(n===0){return}AA(t.output,e.pending_buf,e.pending_out,n,t.next_out);t.next_out+=n;e.pending_out+=n;t.total_out+=n;t.avail_out-=n;e.pending-=n;if(e.pending===0){e.pending_out=0}}function B_(t,e){WL(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e);t.block_start=t.strstart;P_(t.strm)}function G_(t,e){t.pending_buf[t.pending++]=e}function U_(t,e){t.pending_buf[t.pending++]=e>>>8&255;t.pending_buf[t.pending++]=e&255}function W_(t,e,n,r){var s=t.avail_in;if(s>r){s=r}if(s===0){return 0}t.avail_in-=s;AA(e,t.input,t.next_in,s,n);if(t.state.wrap===1){t.adler=VL(t.adler,e,s,n)}else if(t.state.wrap===2){t.adler=HL(t.adler,e,s,n)}t.next_in+=s;t.total_in+=s;return s}function Y_(t,e){var n=t.max_chain_length;var r=t.strstart;var s;var i;var o=t.prev_length;var a=t.nice_match;var c=t.strstart>t.w_size-M_?t.strstart-(t.w_size-M_):0;var u=t.window;var f=t.w_mask;var l=t.prev;var h=t.strstart+x_;var d=u[r+o-1];var p=u[r+o];if(t.prev_length>=t.good_match){n>>=2}if(a>t.lookahead){a=t.lookahead}do{s=e;if(u[s+o]!==p||u[s+o-1]!==d||u[s]!==u[r]||u[++s]!==u[r+1]){continue}r+=2;s++;do{}while(u[++r]===u[++s]&&u[++r]===u[++s]&&u[++r]===u[++s]&&u[++r]===u[++s]&&u[++r]===u[++s]&&u[++r]===u[++s]&&u[++r]===u[++s]&&u[++r]===u[++s]&&r<h);i=x_-(h-r);r=h-x_;if(i>o){t.match_start=e;o=i;if(i>=a){break}d=u[r+o-1];p=u[r+o]}}while((e=l[e&f])>c&&--n!==0);if(o<=t.lookahead){return o}return t.lookahead}function V_(t){var e=t.w_size;var n,r,s,i,o;do{i=t.window_size-t.lookahead-t.strstart;if(t.strstart>=e+(e-M_)){AA(t.window,t.window,e,e,0);t.match_start-=e;t.strstart-=e;t.block_start-=e;r=t.hash_size;n=r;do{s=t.head[--n];t.head[n]=s>=e?s-e:0}while(--r);r=e;n=r;do{s=t.prev[--n];t.prev[n]=s>=e?s-e:0}while(--r);i+=e}if(t.strm.avail_in===0){break}r=W_(t.strm,t.window,t.strstart+t.lookahead,i);t.lookahead+=r;if(t.lookahead+t.insert>=N_){o=t.strstart-t.insert;t.ins_h=t.window[o];t.ins_h=(t.ins_h<<t.hash_shift^t.window[o+1])&t.hash_mask;while(t.insert){t.ins_h=(t.ins_h<<t.hash_shift^t.window[o+N_-1])&t.hash_mask;t.prev[o&t.w_mask]=t.head[t.ins_h];t.head[t.ins_h]=o;o++;t.insert--;if(t.lookahead+t.insert<N_){break}}}}while(t.lookahead<M_&&t.strm.avail_in!==0)}function Z_(t,e){var n=65535;if(n>t.pending_buf_size-5){n=t.pending_buf_size-5}for(;;){if(t.lookahead<=1){V_(t);if(t.lookahead===0&&e===JL){return __}if(t.lookahead===0){break}}t.strstart+=t.lookahead;t.lookahead=0;var r=t.block_start+n;if(t.strstart===0||t.strstart>=r){t.lookahead=t.strstart-r;t.strstart=r;B_(t,false);if(t.strm.avail_out===0){return __}}if(t.strstart-t.block_start>=t.w_size-M_){B_(t,false);if(t.strm.avail_out===0){return __}}}t.insert=0;if(e===KL){B_(t,true);if(t.strm.avail_out===0){return O_}return z_}if(t.strstart>t.block_start){B_(t,false);if(t.strm.avail_out===0){return __}}return __}function Q_(t,e){var n;var r;for(;;){if(t.lookahead<M_){V_(t);if(t.lookahead<M_&&e===JL){return __}if(t.lookahead===0){break}}n=0;if(t.lookahead>=N_){t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+N_-1])&t.hash_mask;n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h];t.head[t.ins_h]=t.strstart}if(n!==0&&t.strstart-n<=t.w_size-M_){t.match_length=Y_(t,n)}if(t.match_length>=N_){r=YL(t,t.strstart-t.match_start,t.match_length-N_);t.lookahead-=t.match_length;if(t.match_length<=t.max_lazy_match&&t.lookahead>=N_){t.match_length--;do{t.strstart++;t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+N_-1])&t.hash_mask;n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h];t.head[t.ins_h]=t.strstart}while(--t.match_length!==0);t.strstart++}else{t.strstart+=t.match_length;t.match_length=0;t.ins_h=t.window[t.strstart];t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask}}else{r=YL(t,0,t.window[t.strstart]);t.lookahead--;t.strstart++}if(r){B_(t,false);if(t.strm.avail_out===0){return __}}}t.insert=t.strstart<N_-1?t.strstart:N_-1;if(e===KL){B_(t,true);if(t.strm.avail_out===0){return O_}return z_}if(t.last_lit){B_(t,false);if(t.strm.avail_out===0){return __}}return C_}function H_(t,e){var n;var r;var s;for(;;){if(t.lookahead<M_){V_(t);if(t.lookahead<M_&&e===JL){return __}if(t.lookahead===0){break}}n=0;if(t.lookahead>=N_){t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+N_-1])&t.hash_mask;n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h];t.head[t.ins_h]=t.strstart}t.prev_length=t.match_length;t.prev_match=t.match_start;t.match_length=N_-1;if(n!==0&&t.prev_length<t.max_lazy_match&&t.strstart-n<=t.w_size-M_){t.match_length=Y_(t,n);if(t.match_length<=5&&(t.strategy===a_||t.match_length===N_&&t.strstart-t.match_start>4096)){t.match_length=N_-1}}if(t.prev_length>=N_&&t.match_length<=t.prev_length){s=t.strstart+t.lookahead-N_;r=YL(t,t.strstart-1-t.prev_match,t.prev_length-N_);t.lookahead-=t.prev_length-1;t.prev_length-=2;do{if(++t.strstart<=s){t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+N_-1])&t.hash_mask;n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h];t.head[t.ins_h]=t.strstart}}while(--t.prev_length!==0);t.match_available=0;t.match_length=N_-1;t.strstart++;if(r){B_(t,false);if(t.strm.avail_out===0){return __}}}else if(t.match_available){r=YL(t,0,t.window[t.strstart-1]);if(r){B_(t,false)}t.strstart++;t.lookahead--;if(t.strm.avail_out===0){return __}}else{t.match_available=1;t.strstart++;t.lookahead--}}if(t.match_available){r=YL(t,0,t.window[t.strstart-1]);t.match_available=0}t.insert=t.strstart<N_-1?t.strstart:N_-1;if(e===KL){B_(t,true);if(t.strm.avail_out===0){return O_}return z_}if(t.last_lit){B_(t,false);if(t.strm.avail_out===0){return __}}return C_}function J_(t,e){var n;var r;var s,i;var o=t.window;for(;;){if(t.lookahead<=x_){V_(t);if(t.lookahead<=x_&&e===JL){return __}if(t.lookahead===0){break}}t.match_length=0;if(t.lookahead>=N_&&t.strstart>0){s=t.strstart-1;r=o[s];if(r===o[++s]&&r===o[++s]&&r===o[++s]){i=t.strstart+x_;do{}while(r===o[++s]&&r===o[++s]&&r===o[++s]&&r===o[++s]&&r===o[++s]&&r===o[++s]&&r===o[++s]&&r===o[++s]&&s<i);t.match_length=x_-(i-s);if(t.match_length>t.lookahead){t.match_length=t.lookahead}}}if(t.match_length>=N_){n=YL(t,1,t.match_length-N_);t.lookahead-=t.match_length;t.strstart+=t.match_length;t.match_length=0}else{n=YL(t,0,t.window[t.strstart]);t.lookahead--;t.strstart++}if(n){B_(t,false);if(t.strm.avail_out===0){return __}}}t.insert=0;if(e===KL){B_(t,true);if(t.strm.avail_out===0){return O_}return z_}if(t.last_lit){B_(t,false);if(t.strm.avail_out===0){return __}}return C_}function q_(t,e){var n;for(;;){if(t.lookahead===0){V_(t);if(t.lookahead===0){if(e===JL){return __}break}}t.match_length=0;n=YL(t,0,t.window[t.strstart]);t.lookahead--;t.strstart++;if(n){B_(t,false);if(t.strm.avail_out===0){return __}}}t.insert=0;if(e===KL){B_(t,true);if(t.strm.avail_out===0){return O_}return z_}if(t.last_lit){B_(t,false);if(t.strm.avail_out===0){return __}}return C_}function X_(t,e,n,r,s){this.good_length=t;this.max_lazy=e;this.nice_length=n;this.max_chain=r;this.func=s}var K_;K_=[new X_(0,0,0,0,Z_),new X_(4,4,8,4,Q_),new X_(4,5,16,8,Q_),new X_(4,6,32,32,Q_),new X_(4,4,16,16,H_),new X_(8,16,32,32,H_),new X_(8,16,128,128,H_),new X_(8,32,128,256,H_),new X_(32,128,258,1024,H_),new X_(32,258,258,4096,H_)];function tC(t){t.window_size=2*t.w_size;F_(t.head);t.max_lazy_match=K_[t.level].max_lazy;t.good_match=K_[t.level].good_length;t.nice_match=K_[t.level].nice_length;t.max_chain_length=K_[t.level].max_chain;t.strstart=0;t.block_start=0;t.lookahead=0;t.insert=0;t.match_length=t.prev_length=N_-1;t.match_available=0;t.ins_h=0}function eC(){this.strm=null;this.status=0;this.pending_buf=null;this.pending_buf_size=0;this.pending_out=0;this.pending=0;this.wrap=0;this.gzhead=null;this.gzindex=0;this.method=h_;this.last_flush=-1;this.w_size=0;this.w_bits=0;this.w_mask=0;this.window=null;this.window_size=0;this.prev=null;this.head=null;this.ins_h=0;this.hash_size=0;this.hash_bits=0;this.hash_mask=0;this.hash_shift=0;this.block_start=0;this.match_length=0;this.prev_match=0;this.match_available=0;this.strstart=0;this.match_start=0;this.lookahead=0;this.prev_length=0;this.max_chain_length=0;this.max_lazy_match=0;this.level=0;this.strategy=0;this.good_match=0;this.nice_match=0;this.dyn_ltree=new _A(b_*2);this.dyn_dtree=new _A((2*g_+1)*2);this.bl_tree=new _A((2*w_+1)*2);F_(this.dyn_ltree);F_(this.dyn_dtree);F_(this.bl_tree);this.l_desc=null;this.d_desc=null;this.bl_desc=null;this.bl_count=new _A(v_+1);this.heap=new _A(2*y_+1);F_(this.heap);this.heap_len=0;this.heap_max=0;this.depth=new _A(2*y_+1);F_(this.depth);this.l_buf=0;this.lit_bufsize=0;this.last_lit=0;this.d_buf=0;this.opt_len=0;this.static_len=0;this.matches=0;this.insert=0;this.bi_buf=0;this.bi_valid=0}function nC(t){var e;if(!t||!t.state){return R_(t,r_)}t.total_in=t.total_out=0;t.data_type=l_;e=t.state;e.pending=0;e.pending_out=0;if(e.wrap<0){e.wrap=-e.wrap}e.status=e.wrap?S_:A_;t.adler=e.wrap===2?0:1;e.last_flush=JL;BL(e);return e_}function rC(t){var e=nC(t);if(e===e_){tC(t.state)}return e}function sC(t,e,n,r,s,i){if(!t){return r_}var o=1;if(e===o_){e=6}if(r<0){o=0;r=-r}else if(r>15){o=2;r-=16}if(s<1||s>d_||n!==h_||r<8||r>15||e<0||e>9||i<0||i>f_){return R_(t,r_)}if(r===8){r=9}var a=new eC;t.state=a;a.strm=t;a.wrap=o;a.gzhead=null;a.w_bits=r;a.w_size=1<<a.w_bits;a.w_mask=a.w_size-1;a.hash_bits=s+7;a.hash_size=1<<a.hash_bits;a.hash_mask=a.hash_size-1;a.hash_shift=~~((a.hash_bits+N_-1)/N_);a.window=new LA(a.w_size*2);a.head=new _A(a.hash_size);a.prev=new _A(a.w_size);a.lit_bufsize=1<<s+6;a.pending_buf_size=a.lit_bufsize*4;a.pending_buf=new LA(a.pending_buf_size);a.d_buf=1*a.lit_bufsize;a.l_buf=(1+2)*a.lit_bufsize;a.level=e;a.strategy=i;a.method=n;return rC(t)}function iC(t,e){var n,r;var s,i;if(!t||!t.state||e>t_||e<0){return t?R_(t,r_):r_}r=t.state;if(!t.output||!t.input&&t.avail_in!==0||r.status===L_&&e!==KL){return R_(t,t.avail_out===0?i_:r_)}r.strm=t;n=r.last_flush;r.last_flush=e;if(r.status===S_){if(r.wrap===2){t.adler=0;G_(r,31);G_(r,139);G_(r,8);if(!r.gzhead){G_(r,0);G_(r,0);G_(r,0);G_(r,0);G_(r,0);G_(r,r.level===9?2:r.strategy>=c_||r.level<2?4:0);G_(r,j_);r.status=A_}else{G_(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(!r.gzhead.extra?0:4)+(!r.gzhead.name?0:8)+(!r.gzhead.comment?0:16));G_(r,r.gzhead.time&255);G_(r,r.gzhead.time>>8&255);G_(r,r.gzhead.time>>16&255);G_(r,r.gzhead.time>>24&255);G_(r,r.level===9?2:r.strategy>=c_||r.level<2?4:0);G_(r,r.gzhead.os&255);if(r.gzhead.extra&&r.gzhead.extra.length){G_(r,r.gzhead.extra.length&255);G_(r,r.gzhead.extra.length>>8&255)}if(r.gzhead.hcrc){t.adler=HL(t.adler,r.pending_buf,r.pending,0)}r.gzindex=0;r.status=E_}}else{var o=h_+(r.w_bits-8<<4)<<8;var a=-1;if(r.strategy>=c_||r.level<2){a=0}else if(r.level<6){a=1}else if(r.level===6){a=2}else{a=3}o|=a<<6;if(r.strstart!==0){o|=I_}o+=31-o%31;r.status=A_;U_(r,o);if(r.strstart!==0){U_(r,t.adler>>>16);U_(r,t.adler&65535)}t.adler=1}}if(r.status===E_){if(r.gzhead.extra){s=r.pending;while(r.gzindex<(r.gzhead.extra.length&65535)){if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>s){t.adler=HL(t.adler,r.pending_buf,r.pending-s,s)}P_(t);s=r.pending;if(r.pending===r.pending_buf_size){break}}G_(r,r.gzhead.extra[r.gzindex]&255);r.gzindex++}if(r.gzhead.hcrc&&r.pending>s){t.adler=HL(t.adler,r.pending_buf,r.pending-s,s)}if(r.gzindex===r.gzhead.extra.length){r.gzindex=0;r.status=D_}}else{r.status=D_}}if(r.status===D_){if(r.gzhead.name){s=r.pending;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>s){t.adler=HL(t.adler,r.pending_buf,r.pending-s,s)}P_(t);s=r.pending;if(r.pending===r.pending_buf_size){i=1;break}}if(r.gzindex<r.gzhead.name.length){i=r.gzhead.name.charCodeAt(r.gzindex++)&255}else{i=0}G_(r,i)}while(i!==0);if(r.gzhead.hcrc&&r.pending>s){t.adler=HL(t.adler,r.pending_buf,r.pending-s,s)}if(i===0){r.gzindex=0;r.status=k_}}else{r.status=k_}}if(r.status===k_){if(r.gzhead.comment){s=r.pending;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>s){t.adler=HL(t.adler,r.pending_buf,r.pending-s,s)}P_(t);s=r.pending;if(r.pending===r.pending_buf_size){i=1;break}}if(r.gzindex<r.gzhead.comment.length){i=r.gzhead.comment.charCodeAt(r.gzindex++)&255}else{i=0}G_(r,i)}while(i!==0);if(r.gzhead.hcrc&&r.pending>s){t.adler=HL(t.adler,r.pending_buf,r.pending-s,s)}if(i===0){r.status=T_}}else{r.status=T_}}if(r.status===T_){if(r.gzhead.hcrc){if(r.pending+2>r.pending_buf_size){P_(t)}if(r.pending+2<=r.pending_buf_size){G_(r,t.adler&255);G_(r,t.adler>>8&255);t.adler=0;r.status=A_}}else{r.status=A_}}if(r.pending!==0){P_(t);if(t.avail_out===0){r.last_flush=-1;return e_}}else if(t.avail_in===0&&$_(e)<=$_(n)&&e!==KL){return R_(t,i_)}if(r.status===L_&&t.avail_in!==0){return R_(t,i_)}if(t.avail_in!==0||r.lookahead!==0||e!==JL&&r.status!==L_){var c=r.strategy===c_?q_(r,e):r.strategy===u_?J_(r,e):K_[r.level].func(r,e);if(c===O_||c===z_){r.status=L_}if(c===__||c===O_){if(t.avail_out===0){r.last_flush=-1}return e_}if(c===C_){if(e===qL){UL(r)}else if(e!==t_){GL(r,0,0,false);if(e===XL){F_(r.head);if(r.lookahead===0){r.strstart=0;r.block_start=0;r.insert=0}}}P_(t);if(t.avail_out===0){r.last_flush=-1;return e_}}}if(e!==KL){return e_}if(r.wrap<=0){return n_}if(r.wrap===2){G_(r,t.adler&255);G_(r,t.adler>>8&255);G_(r,t.adler>>16&255);G_(r,t.adler>>24&255);G_(r,t.total_in&255);G_(r,t.total_in>>8&255);G_(r,t.total_in>>16&255);G_(r,t.total_in>>24&255)}else{U_(r,t.adler>>>16);U_(r,t.adler&65535)}P_(t);if(r.wrap>0){r.wrap=-r.wrap}return r.pending!==0?e_:n_}function oC(t){var e;if(!t||!t.state){return r_}e=t.state.status;if(e!==S_&&e!==E_&&e!==D_&&e!==k_&&e!==T_&&e!==A_&&e!==L_){return R_(t,r_)}t.state=null;return e===A_?R_(t,s_):e_}var aC=30;var cC=12;function uC(t,e){var n;var r;var s;var i;var o;var a;var c;var u;var f;var l;var h;var d;var p;var m;var y;var g;var w;var b;var v;var N;var x;var M;var I;var S,E;n=t.state;r=t.next_in;S=t.input;s=r+(t.avail_in-5);i=t.next_out;E=t.output;o=i-(e-t.avail_out);a=i+(t.avail_out-257);c=n.dmax;u=n.wsize;f=n.whave;l=n.wnext;h=n.window;d=n.hold;p=n.bits;m=n.lencode;y=n.distcode;g=(1<<n.lenbits)-1;w=(1<<n.distbits)-1;t:do{if(p<15){d+=S[r++]<<p;p+=8;d+=S[r++]<<p;p+=8}b=m[d&g];e:for(;;){v=b>>>24;d>>>=v;p-=v;v=b>>>16&255;if(v===0){E[i++]=b&65535}else if(v&16){N=b&65535;v&=15;if(v){if(p<v){d+=S[r++]<<p;p+=8}N+=d&(1<<v)-1;d>>>=v;p-=v}if(p<15){d+=S[r++]<<p;p+=8;d+=S[r++]<<p;p+=8}b=y[d&w];n:for(;;){v=b>>>24;d>>>=v;p-=v;v=b>>>16&255;if(v&16){x=b&65535;v&=15;if(p<v){d+=S[r++]<<p;p+=8;if(p<v){d+=S[r++]<<p;p+=8}}x+=d&(1<<v)-1;if(x>c){t.msg="invalid distance too far back";n.mode=aC;break t}d>>>=v;p-=v;v=i-o;if(x>v){v=x-v;if(v>f){if(n.sane){t.msg="invalid distance too far back";n.mode=aC;break t}}M=0;I=h;if(l===0){M+=u-v;if(v<N){N-=v;do{E[i++]=h[M++]}while(--v);M=i-x;I=E}}else if(l<v){M+=u+l-v;v-=l;if(v<N){N-=v;do{E[i++]=h[M++]}while(--v);M=0;if(l<N){v=l;N-=v;do{E[i++]=h[M++]}while(--v);M=i-x;I=E}}}else{M+=l-v;if(v<N){N-=v;do{E[i++]=h[M++]}while(--v);M=i-x;I=E}}while(N>2){E[i++]=I[M++];E[i++]=I[M++];E[i++]=I[M++];N-=3}if(N){E[i++]=I[M++];if(N>1){E[i++]=I[M++]}}}else{M=i-x;do{E[i++]=E[M++];E[i++]=E[M++];E[i++]=E[M++];N-=3}while(N>2);if(N){E[i++]=E[M++];if(N>1){E[i++]=E[M++]}}}}else if((v&64)===0){b=y[(b&65535)+(d&(1<<v)-1)];continue n}else{t.msg="invalid distance code";n.mode=aC;break t}break}}else if((v&64)===0){b=m[(b&65535)+(d&(1<<v)-1)];continue e}else if(v&32){n.mode=cC;break t}else{t.msg="invalid literal/length code";n.mode=aC;break t}break}}while(r<s&&i<a);N=p>>3;r-=N;p-=N<<3;d&=(1<<p)-1;t.next_in=r;t.next_out=i;t.avail_in=r<s?5+(s-r):5-(r-s);t.avail_out=i<a?257+(a-i):257-(i-a);n.hold=d;n.bits=p;return}var fC=15;var lC=852;var hC=592;var dC=0;var pC=1;var mC=2;var yC=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0];var gC=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78];var wC=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0];var bC=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];function vC(t,e,n,r,s,i,o,a){var c=a.bits;var u=0;var f=0;var l=0,h=0;var d=0;var p=0;var m=0;var y=0;var g=0;var w=0;var b;var v;var N;var x;var M;var I=null;var S=0;var E;var D=new _A(fC+1);var k=new _A(fC+1);var T=null;var A=0;var L,_,C;for(u=0;u<=fC;u++){D[u]=0}for(f=0;f<r;f++){D[e[n+f]]++}d=c;for(h=fC;h>=1;h--){if(D[h]!==0){break}}if(d>h){d=h}if(h===0){s[i++]=1<<24|64<<16|0;s[i++]=1<<24|64<<16|0;a.bits=1;return 0}for(l=1;l<h;l++){if(D[l]!==0){break}}if(d<l){d=l}y=1;for(u=1;u<=fC;u++){y<<=1;y-=D[u];if(y<0){return-1}}if(y>0&&(t===dC||h!==1)){return-1}k[1]=0;for(u=1;u<fC;u++){k[u+1]=k[u]+D[u]}for(f=0;f<r;f++){if(e[n+f]!==0){o[k[e[n+f]]++]=f}}if(t===dC){I=T=o;E=19}else if(t===pC){I=yC;S-=257;T=gC;A-=257;E=256}else{I=wC;T=bC;E=-1}w=0;f=0;u=l;M=i;p=d;m=0;N=-1;g=1<<d;x=g-1;if(t===pC&&g>lC||t===mC&&g>hC){return 1}for(;;){L=u-m;if(o[f]<E){_=0;C=o[f]}else if(o[f]>E){_=T[A+o[f]];C=I[S+o[f]]}else{_=32+64;C=0}b=1<<u-m;v=1<<p;l=v;do{v-=b;s[M+(w>>m)+v]=L<<24|_<<16|C|0}while(v!==0);b=1<<u-1;while(w&b){b>>=1}if(b!==0){w&=b-1;w+=b}else{w=0}f++;if(--D[u]===0){if(u===h){break}u=e[n+o[f]]}if(u>d&&(w&x)!==N){if(m===0){m=d}M+=l;p=u-m;y=1<<p;while(p+m<h){y-=D[p+m];if(y<=0){break}p++;y<<=1}g+=1<<p;if(t===pC&&g>lC||t===mC&&g>hC){return 1}N=w&x;s[N]=d<<24|p<<16|M-i|0}}if(w!==0){s[M+w]=u-m<<24|64<<16|0}a.bits=d;return 0}var NC=0;var xC=1;var MC=2;var IC=4;var SC=5;var EC=6;var DC=0;var kC=1;var TC=2;var AC=-2;var LC=-3;var _C=-4;var CC=-5;var OC=8;var zC=1;var jC=2;var RC=3;var $C=4;var FC=5;var PC=6;var BC=7;var GC=8;var UC=9;var WC=10;var YC=11;var VC=12;var ZC=13;var QC=14;var HC=15;var JC=16;var qC=17;var XC=18;var KC=19;var tO=20;var eO=21;var nO=22;var rO=23;var sO=24;var iO=25;var oO=26;var aO=27;var cO=28;var uO=29;var fO=30;var lO=31;var hO=32;var dO=852;var pO=592;function mO(t){return(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24)}function yO(){this.mode=0;this.last=false;this.wrap=0;this.havedict=false;this.flags=0;this.dmax=0;this.check=0;this.total=0;this.head=null;this.wbits=0;this.wsize=0;this.whave=0;this.wnext=0;this.window=null;this.hold=0;this.bits=0;this.length=0;this.offset=0;this.extra=0;this.lencode=null;this.distcode=null;this.lenbits=0;this.distbits=0;this.ncode=0;this.nlen=0;this.ndist=0;this.have=0;this.next=null;this.lens=new _A(320);this.work=new _A(288);this.lendyn=null;this.distdyn=null;this.sane=0;this.back=0;this.was=0}function gO(t){var e;if(!t||!t.state){return AC}e=t.state;t.total_in=t.total_out=e.total=0;t.msg="";if(e.wrap){t.adler=e.wrap&1}e.mode=zC;e.last=0;e.havedict=0;e.dmax=32768;e.head=null;e.hold=0;e.bits=0;e.lencode=e.lendyn=new CA(dO);e.distcode=e.distdyn=new CA(pO);e.sane=1;e.back=-1;return DC}function wO(t){var e;if(!t||!t.state){return AC}e=t.state;e.wsize=0;e.whave=0;e.wnext=0;return gO(t)}function bO(t,e){var n;var r;if(!t||!t.state){return AC}r=t.state;if(e<0){n=0;e=-e}else{n=(e>>4)+1;if(e<48){e&=15}}if(e&&(e<8||e>15)){return AC}if(r.window!==null&&r.wbits!==e){r.window=null}r.wrap=n;r.wbits=e;return wO(t)}function vO(t,e){var n;var r;if(!t){return AC}r=new yO;t.state=r;r.window=null;n=bO(t,e);if(n!==DC){t.state=null}return n}var NO=true;var xO,MO;function IO(t){if(NO){var e;xO=new CA(512);MO=new CA(32);e=0;while(e<144){t.lens[e++]=8}while(e<256){t.lens[e++]=9}while(e<280){t.lens[e++]=7}while(e<288){t.lens[e++]=8}vC(xC,t.lens,0,288,xO,0,t.work,{bits:9});e=0;while(e<32){t.lens[e++]=5}vC(MC,t.lens,0,32,MO,0,t.work,{bits:5});NO=false}t.lencode=xO;t.lenbits=9;t.distcode=MO;t.distbits=5}function SO(t,e,n,r){var s;var i=t.state;if(i.window===null){i.wsize=1<<i.wbits;i.wnext=0;i.whave=0;i.window=new LA(i.wsize)}if(r>=i.wsize){AA(i.window,e,n-i.wsize,i.wsize,0);i.wnext=0;i.whave=i.wsize}else{s=i.wsize-i.wnext;if(s>r){s=r}AA(i.window,e,n-r,s,i.wnext);r-=s;if(r){AA(i.window,e,n-r,r,0);i.wnext=r;i.whave=i.wsize}else{i.wnext+=s;if(i.wnext===i.wsize){i.wnext=0}if(i.whave<i.wsize){i.whave+=s}}}return 0}function EO(t,e){var n;var r,s;var i;var o;var a,c;var u;var f;var l,h;var d;var p;var m;var y=0;var g,w,b;var v,N,x;var M;var I;var S=new LA(4);var E;var D;var k=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&t.avail_in!==0){return AC}n=t.state;if(n.mode===VC){n.mode=ZC}o=t.next_out;s=t.output;c=t.avail_out;i=t.next_in;r=t.input;a=t.avail_in;u=n.hold;f=n.bits;l=a;h=c;I=DC;t:for(;;){switch(n.mode){case zC:if(n.wrap===0){n.mode=ZC;break}while(f<16){if(a===0){break t}a--;u+=r[i++]<<f;f+=8}if(n.wrap&2&&u===35615){n.check=0;S[0]=u&255;S[1]=u>>>8&255;n.check=HL(n.check,S,2,0);u=0;f=0;n.mode=jC;break}n.flags=0;if(n.head){n.head.done=false}if(!(n.wrap&1)||(((u&255)<<8)+(u>>8))%31){t.msg="incorrect header check";n.mode=fO;break}if((u&15)!==OC){t.msg="unknown compression method";n.mode=fO;break}u>>>=4;f-=4;M=(u&15)+8;if(n.wbits===0){n.wbits=M}else if(M>n.wbits){t.msg="invalid window size";n.mode=fO;break}n.dmax=1<<M;t.adler=n.check=1;n.mode=u&512?WC:VC;u=0;f=0;break;case jC:while(f<16){if(a===0){break t}a--;u+=r[i++]<<f;f+=8}n.flags=u;if((n.flags&255)!==OC){t.msg="unknown compression method";n.mode=fO;break}if(n.flags&57344){t.msg="unknown header flags set";n.mode=fO;break}if(n.head){n.head.text=u>>8&1}if(n.flags&512){S[0]=u&255;S[1]=u>>>8&255;n.check=HL(n.check,S,2,0)}u=0;f=0;n.mode=RC;case RC:while(f<32){if(a===0){break t}a--;u+=r[i++]<<f;f+=8}if(n.head){n.head.time=u}if(n.flags&512){S[0]=u&255;S[1]=u>>>8&255;S[2]=u>>>16&255;S[3]=u>>>24&255;n.check=HL(n.check,S,4,0)}u=0;f=0;n.mode=$C;case $C:while(f<16){if(a===0){break t}a--;u+=r[i++]<<f;f+=8}if(n.head){n.head.xflags=u&255;n.head.os=u>>8}if(n.flags&512){S[0]=u&255;S[1]=u>>>8&255;n.check=HL(n.check,S,2,0)}u=0;f=0;n.mode=FC;case FC:if(n.flags&1024){while(f<16){if(a===0){break t}a--;u+=r[i++]<<f;f+=8}n.length=u;if(n.head){n.head.extra_len=u}if(n.flags&512){S[0]=u&255;S[1]=u>>>8&255;n.check=HL(n.check,S,2,0)}u=0;f=0}else if(n.head){n.head.extra=null}n.mode=PC;case PC:if(n.flags&1024){d=n.length;if(d>a){d=a}if(d){if(n.head){M=n.head.extra_len-n.length;if(!n.head.extra){n.head.extra=new Array(n.head.extra_len)}AA(n.head.extra,r,i,d,M)}if(n.flags&512){n.check=HL(n.check,r,d,i)}a-=d;i+=d;n.length-=d}if(n.length){break t}}n.length=0;n.mode=BC;case BC:if(n.flags&2048){if(a===0){break t}d=0;do{M=r[i+d++];if(n.head&&M&&n.length<65536){n.head.name+=String.fromCharCode(M)}}while(M&&d<a);if(n.flags&512){n.check=HL(n.check,r,d,i)}a-=d;i+=d;if(M){break t}}else if(n.head){n.head.name=null}n.length=0;n.mode=GC;case GC:if(n.flags&4096){if(a===0){break t}d=0;do{M=r[i+d++];if(n.head&&M&&n.length<65536){n.head.comment+=String.fromCharCode(M)}}while(M&&d<a);if(n.flags&512){n.check=HL(n.check,r,d,i)}a-=d;i+=d;if(M){break t}}else if(n.head){n.head.comment=null}n.mode=UC;case UC:if(n.flags&512){while(f<16){if(a===0){break t}a--;u+=r[i++]<<f;f+=8}if(u!==(n.check&65535)){t.msg="header crc mismatch";n.mode=fO;break}u=0;f=0}if(n.head){n.head.hcrc=n.flags>>9&1;n.head.done=true}t.adler=n.check=0;n.mode=VC;break;case WC:while(f<32){if(a===0){break t}a--;u+=r[i++]<<f;f+=8}t.adler=n.check=mO(u);u=0;f=0;n.mode=YC;case YC:if(n.havedict===0){t.next_out=o;t.avail_out=c;t.next_in=i;t.avail_in=a;n.hold=u;n.bits=f;return TC}t.adler=n.check=1;n.mode=VC;case VC:if(e===SC||e===EC){break t}case ZC:if(n.last){u>>>=f&7;f-=f&7;n.mode=aO;break}while(f<3){if(a===0){break t}a--;u+=r[i++]<<f;f+=8}n.last=u&1;u>>>=1;f-=1;switch(u&3){case 0:n.mode=QC;break;case 1:IO(n);n.mode=tO;if(e===EC){u>>>=2;f-=2;break t}break;case 2:n.mode=qC;break;case 3:t.msg="invalid block type";n.mode=fO}u>>>=2;f-=2;break;case QC:u>>>=f&7;f-=f&7;while(f<32){if(a===0){break t}a--;u+=r[i++]<<f;f+=8}if((u&65535)!==(u>>>16^65535)){t.msg="invalid stored block lengths";n.mode=fO;break}n.length=u&65535;u=0;f=0;n.mode=HC;if(e===EC){break t}case HC:n.mode=JC;case JC:d=n.length;if(d){if(d>a){d=a}if(d>c){d=c}if(d===0){break t}AA(s,r,i,d,o);a-=d;i+=d;c-=d;o+=d;n.length-=d;break}n.mode=VC;break;case qC:while(f<14){if(a===0){break t}a--;u+=r[i++]<<f;f+=8}n.nlen=(u&31)+257;u>>>=5;f-=5;n.ndist=(u&31)+1;u>>>=5;f-=5;n.ncode=(u&15)+4;u>>>=4;f-=4;if(n.nlen>286||n.ndist>30){t.msg="too many length or distance symbols";n.mode=fO;break}n.have=0;n.mode=XC;case XC:while(n.have<n.ncode){while(f<3){if(a===0){break t}a--;u+=r[i++]<<f;f+=8}n.lens[k[n.have++]]=u&7;u>>>=3;f-=3}while(n.have<19){n.lens[k[n.have++]]=0}n.lencode=n.lendyn;n.lenbits=7;E={bits:n.lenbits};I=vC(NC,n.lens,0,19,n.lencode,0,n.work,E);n.lenbits=E.bits;if(I){t.msg="invalid code lengths set";n.mode=fO;break}n.have=0;n.mode=KC;case KC:while(n.have<n.nlen+n.ndist){for(;;){y=n.lencode[u&(1<<n.lenbits)-1];g=y>>>24;w=y>>>16&255;b=y&65535;if(g<=f){break}if(a===0){break t}a--;u+=r[i++]<<f;f+=8}if(b<16){u>>>=g;f-=g;n.lens[n.have++]=b}else{if(b===16){D=g+2;while(f<D){if(a===0){break t}a--;u+=r[i++]<<f;f+=8}u>>>=g;f-=g;if(n.have===0){t.msg="invalid bit length repeat";n.mode=fO;break}M=n.lens[n.have-1];d=3+(u&3);u>>>=2;f-=2}else if(b===17){D=g+3;while(f<D){if(a===0){break t}a--;u+=r[i++]<<f;f+=8}u>>>=g;f-=g;M=0;d=3+(u&7);u>>>=3;f-=3}else{D=g+7;while(f<D){if(a===0){break t}a--;u+=r[i++]<<f;f+=8}u>>>=g;f-=g;M=0;d=11+(u&127);u>>>=7;f-=7}if(n.have+d>n.nlen+n.ndist){t.msg="invalid bit length repeat";n.mode=fO;break}while(d--){n.lens[n.have++]=M}}}if(n.mode===fO){break}if(n.lens[256]===0){t.msg="invalid code -- missing end-of-block";n.mode=fO;break}n.lenbits=9;E={bits:n.lenbits};I=vC(xC,n.lens,0,n.nlen,n.lencode,0,n.work,E);n.lenbits=E.bits;if(I){t.msg="invalid literal/lengths set";n.mode=fO;break}n.distbits=6;n.distcode=n.distdyn;E={bits:n.distbits};I=vC(MC,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,E);n.distbits=E.bits;if(I){t.msg="invalid distances set";n.mode=fO;break}n.mode=tO;if(e===EC){break t}case tO:n.mode=eO;case eO:if(a>=6&&c>=258){t.next_out=o;t.avail_out=c;t.next_in=i;t.avail_in=a;n.hold=u;n.bits=f;uC(t,h);o=t.next_out;s=t.output;c=t.avail_out;i=t.next_in;r=t.input;a=t.avail_in;u=n.hold;f=n.bits;if(n.mode===VC){n.back=-1}break}n.back=0;for(;;){y=n.lencode[u&(1<<n.lenbits)-1];g=y>>>24;w=y>>>16&255;b=y&65535;if(g<=f){break}if(a===0){break t}a--;u+=r[i++]<<f;f+=8}if(w&&(w&240)===0){v=g;N=w;x=b;for(;;){y=n.lencode[x+((u&(1<<v+N)-1)>>v)];g=y>>>24;w=y>>>16&255;b=y&65535;if(v+g<=f){break}if(a===0){break t}a--;u+=r[i++]<<f;f+=8}u>>>=v;f-=v;n.back+=v}u>>>=g;f-=g;n.back+=g;n.length=b;if(w===0){n.mode=oO;break}if(w&32){n.back=-1;n.mode=VC;break}if(w&64){t.msg="invalid literal/length code";n.mode=fO;break}n.extra=w&15;n.mode=nO;case nO:if(n.extra){D=n.extra;while(f<D){if(a===0){break t}a--;u+=r[i++]<<f;f+=8}n.length+=u&(1<<n.extra)-1;u>>>=n.extra;f-=n.extra;n.back+=n.extra}n.was=n.length;n.mode=rO;case rO:for(;;){y=n.distcode[u&(1<<n.distbits)-1];g=y>>>24;w=y>>>16&255;b=y&65535;if(g<=f){break}if(a===0){break t}a--;u+=r[i++]<<f;f+=8}if((w&240)===0){v=g;N=w;x=b;for(;;){y=n.distcode[x+((u&(1<<v+N)-1)>>v)];g=y>>>24;w=y>>>16&255;b=y&65535;if(v+g<=f){break}if(a===0){break t}a--;u+=r[i++]<<f;f+=8}u>>>=v;f-=v;n.back+=v}u>>>=g;f-=g;n.back+=g;if(w&64){t.msg="invalid distance code";n.mode=fO;break}n.offset=b;n.extra=w&15;n.mode=sO;case sO:if(n.extra){D=n.extra;while(f<D){if(a===0){break t}a--;u+=r[i++]<<f;f+=8}n.offset+=u&(1<<n.extra)-1;u>>>=n.extra;f-=n.extra;n.back+=n.extra}if(n.offset>n.dmax){t.msg="invalid distance too far back";n.mode=fO;break}n.mode=iO;case iO:if(c===0){break t}d=h-c;if(n.offset>d){d=n.offset-d;if(d>n.whave){if(n.sane){t.msg="invalid distance too far back";n.mode=fO;break}}if(d>n.wnext){d-=n.wnext;p=n.wsize-d}else{p=n.wnext-d}if(d>n.length){d=n.length}m=n.window}else{m=s;p=o-n.offset;d=n.length}if(d>c){d=c}c-=d;n.length-=d;do{s[o++]=m[p++]}while(--d);if(n.length===0){n.mode=eO}break;case oO:if(c===0){break t}s[o++]=n.length;c--;n.mode=eO;break;case aO:if(n.wrap){while(f<32){if(a===0){break t}a--;u|=r[i++]<<f;f+=8}h-=c;t.total_out+=h;n.total+=h;if(h){t.adler=n.check=n.flags?HL(n.check,s,h,o-h):VL(n.check,s,h,o-h)}h=c;if((n.flags?u:mO(u))!==n.check){t.msg="incorrect data check";n.mode=fO;break}u=0;f=0}n.mode=cO;case cO:if(n.wrap&&n.flags){while(f<32){if(a===0){break t}a--;u+=r[i++]<<f;f+=8}if(u!==(n.total&4294967295)){t.msg="incorrect length check";n.mode=fO;break}u=0;f=0}n.mode=uO;case uO:I=kC;break t;case fO:I=LC;break t;case lO:return _C;case hO:default:return AC}}t.next_out=o;t.avail_out=c;t.next_in=i;t.avail_in=a;n.hold=u;n.bits=f;if(n.wsize||h!==t.avail_out&&n.mode<fO&&(n.mode<aO||e!==IC)){if(SO(t,t.output,t.next_out,h-t.avail_out));}l-=t.avail_in;h-=t.avail_out;t.total_in+=l;t.total_out+=h;n.total+=h;if(n.wrap&&h){t.adler=n.check=n.flags?HL(n.check,s,h,t.next_out-h):VL(n.check,s,h,t.next_out-h)}t.data_type=n.bits+(n.last?64:0)+(n.mode===VC?128:0)+(n.mode===tO||n.mode===HC?256:0);if((l===0&&h===0||e===IC)&&I===DC){I=CC}return I}function DO(t){if(!t||!t.state){return AC}var e=t.state;if(e.window){e.window=null}t.state=null;return DC}var kO=0;var TO=1;var AO=2;var LO=3;var _O=4;var CO=5;var OO=6;var zO=7;var jO=0,RO=1,$O=2,FO=3,PO=4,BO=5,GO=6,UO=0,WO=1,YO=2,VO=-1,ZO=-2,QO=-3,HO=-5,JO=0,qO=1,XO=9,KO=-1,tz=1,ez=2,nz=3,rz=4,sz=0,iz=0,oz=1,az=2,cz=8;function uz(t){if(t<TO||t>zO)throw new TypeError("Bad argument");this.mode=t;this.init_done=false;this.write_in_progress=false;this.pending_close=false;this.windowBits=0;this.level=0;this.memLevel=0;this.strategy=0;this.dictionary=null}uz.prototype.init=function(t,e,n,r,s){this.windowBits=t;this.level=e;this.memLevel=n;this.strategy=r;if(this.mode===LO||this.mode===_O)this.windowBits+=16;if(this.mode===zO)this.windowBits+=32;if(this.mode===CO||this.mode===OO)this.windowBits=-this.windowBits;this.strm=new TA;var i;switch(this.mode){case TO:case LO:case CO:i=sC(this.strm,this.level,cz,this.windowBits,this.memLevel,this.strategy);break;case AO:case _O:case OO:case zO:i=vO(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}if(i!==UO){this._error(i);return}this.write_in_progress=false;this.init_done=true};uz.prototype.params=function(){throw new Error("deflateParams Not supported")};uz.prototype._writeCheck=function(){if(!this.init_done)throw new Error("write before init");if(this.mode===kO)throw new Error("already finalized");if(this.write_in_progress)throw new Error("write already in progress");if(this.pending_close)throw new Error("close is pending")};uz.prototype.write=function(t,e,n,r,s,i,o){this._writeCheck();this.write_in_progress=true;var a=this;b.nextTick((function(){a.write_in_progress=false;var c=a._write(t,e,n,r,s,i,o);a.callback(c[0],c[1]);if(a.pending_close)a.close()}));return this};function fz(t,e){for(var n=0;n<t.length;n++){this[e+n]=t[n]}}uz.prototype.writeSync=function(t,e,n,r,s,i,o){this._writeCheck();return this._write(t,e,n,r,s,i,o)};uz.prototype._write=function(t,e,n,r,s,i,o){this.write_in_progress=true;if(t!==jO&&t!==RO&&t!==$O&&t!==FO&&t!==PO&&t!==BO){throw new Error("Invalid flush value")}if(e==null){e=new Uo(0);r=0;n=0}if(s._set)s.set=s._set;else s.set=fz;var a=this.strm;a.avail_in=r;a.input=e;a.next_in=n;a.avail_out=o;a.output=s;a.next_out=i;var c;switch(this.mode){case TO:case LO:case CO:c=iC(a,t);break;case zO:case AO:case _O:case OO:c=EO(a,t);break;default:throw new Error("Unknown mode "+this.mode)}if(c!==WO&&c!==UO){this._error(c)}this.write_in_progress=false;return[a.avail_in,a.avail_out]};uz.prototype.close=function(){if(this.write_in_progress){this.pending_close=true;return}this.pending_close=false;if(this.mode===TO||this.mode===LO||this.mode===CO){oC(this.strm)}else{DO(this.strm)}this.mode=kO};var lz;uz.prototype.reset=function(){switch(this.mode){case TO:case CO:lz=rC(this.strm);break;case AO:case OO:lz=wO(this.strm);break}if(lz!==UO){this._error(lz)}};uz.prototype._error=function(t){this.onerror(kA[t]+": "+this.strm.msg,t);this.write_in_progress=false;if(this.pending_close)this.close()};var hz=Object.freeze({__proto__:null,DEFLATE:TO,DEFLATERAW:CO,GUNZIP:_O,GZIP:LO,INFLATE:AO,INFLATERAW:OO,NONE:kO,UNZIP:zO,Z_BEST_COMPRESSION:XO,Z_BEST_SPEED:qO,Z_BINARY:iz,Z_BLOCK:BO,Z_BUF_ERROR:HO,Z_DATA_ERROR:QO,Z_DEFAULT_COMPRESSION:KO,Z_DEFAULT_STRATEGY:sz,Z_DEFLATED:cz,Z_ERRNO:VO,Z_FILTERED:tz,Z_FINISH:PO,Z_FIXED:rz,Z_FULL_FLUSH:FO,Z_HUFFMAN_ONLY:ez,Z_NEED_DICT:YO,Z_NO_COMPRESSION:JO,Z_NO_FLUSH:jO,Z_OK:UO,Z_PARTIAL_FLUSH:RO,Z_RLE:nz,Z_STREAM_END:WO,Z_STREAM_ERROR:ZO,Z_SYNC_FLUSH:$O,Z_TEXT:oz,Z_TREES:GO,Z_UNKNOWN:az,Zlib:uz});function dz(t,e){if(!t){throw new Error(e)}}var pz={};Object.keys(hz).forEach((function(t){pz[t]=hz[t]}));pz.Z_MIN_WINDOWBITS=8;pz.Z_MAX_WINDOWBITS=15;pz.Z_DEFAULT_WINDOWBITS=15;pz.Z_MIN_CHUNK=64;pz.Z_MAX_CHUNK=Infinity;pz.Z_DEFAULT_CHUNK=16*1024;pz.Z_MIN_MEMLEVEL=1;pz.Z_MAX_MEMLEVEL=9;pz.Z_DEFAULT_MEMLEVEL=8;pz.Z_MIN_LEVEL=-1;pz.Z_MAX_LEVEL=9;pz.Z_DEFAULT_LEVEL=pz.Z_DEFAULT_COMPRESSION;var mz={Z_OK:pz.Z_OK,Z_STREAM_END:pz.Z_STREAM_END,Z_NEED_DICT:pz.Z_NEED_DICT,Z_ERRNO:pz.Z_ERRNO,Z_STREAM_ERROR:pz.Z_STREAM_ERROR,Z_DATA_ERROR:pz.Z_DATA_ERROR,Z_MEM_ERROR:pz.Z_MEM_ERROR,Z_BUF_ERROR:pz.Z_BUF_ERROR,Z_VERSION_ERROR:pz.Z_VERSION_ERROR};Object.keys(mz).forEach((function(t){mz[mz[t]]=t}));function yz(t){return new Fz(t)}function gz(t){return new Pz(t)}function wz(t){return new Uz(t)}function bz(t){return new Wz(t)}function vz(t){return new Bz(t)}function Nz(t){return new Gz(t)}function xz(t){return new Yz(t)}function Mz(t,e,n){if(typeof e==="function"){n=e;e={}}return Rz(new Fz(e),t,n)}function Iz(t,e){return $z(new Fz(e),t)}function Sz(t,e,n){if(typeof e==="function"){n=e;e={}}return Rz(new Bz(e),t,n)}function Ez(t,e){return $z(new Bz(e),t)}function Dz(t,e,n){if(typeof e==="function"){n=e;e={}}return Rz(new Uz(e),t,n)}function kz(t,e){return $z(new Uz(e),t)}function Tz(t,e,n){if(typeof e==="function"){n=e;e={}}return Rz(new Yz(e),t,n)}function Az(t,e){return $z(new Yz(e),t)}function Lz(t,e,n){if(typeof e==="function"){n=e;e={}}return Rz(new Pz(e),t,n)}function _z(t,e){return $z(new Pz(e),t)}function Cz(t,e,n){if(typeof e==="function"){n=e;e={}}return Rz(new Gz(e),t,n)}function Oz(t,e){return $z(new Gz(e),t)}function zz(t,e,n){if(typeof e==="function"){n=e;e={}}return Rz(new Wz(e),t,n)}function jz(t,e){return $z(new Wz(e),t)}function Rz(t,e,n){var r=[];var s=0;t.on("error",o);t.on("end",a);t.end(e);i();function i(){var e;while(null!==(e=t.read())){r.push(e);s+=e.length}t.once("readable",i)}function o(e){t.removeListener("end",a);t.removeListener("readable",i);n(e)}function a(){var e=Uo.concat(r,s);r=[];n(null,e);t.close()}}function $z(t,e){if(typeof e==="string")e=new Uo(e);if(!Uo.isBuffer(e))throw new TypeError("Not a string or buffer");var n=pz.Z_FINISH;return t._processChunk(e,n)}function Fz(t){if(!(this instanceof Fz))return new Fz(t);Vz.call(this,t,pz.DEFLATE)}function Pz(t){if(!(this instanceof Pz))return new Pz(t);Vz.call(this,t,pz.INFLATE)}function Bz(t){if(!(this instanceof Bz))return new Bz(t);Vz.call(this,t,pz.GZIP)}function Gz(t){if(!(this instanceof Gz))return new Gz(t);Vz.call(this,t,pz.GUNZIP)}function Uz(t){if(!(this instanceof Uz))return new Uz(t);Vz.call(this,t,pz.DEFLATERAW)}function Wz(t){if(!(this instanceof Wz))return new Wz(t);Vz.call(this,t,pz.INFLATERAW)}function Yz(t){if(!(this instanceof Yz))return new Yz(t);Vz.call(this,t,pz.UNZIP)}function Vz(t,e){this._opts=t=t||{};this._chunkSize=t.chunkSize||pz.Z_DEFAULT_CHUNK;NA.call(this,t);if(t.flush){if(t.flush!==pz.Z_NO_FLUSH&&t.flush!==pz.Z_PARTIAL_FLUSH&&t.flush!==pz.Z_SYNC_FLUSH&&t.flush!==pz.Z_FULL_FLUSH&&t.flush!==pz.Z_FINISH&&t.flush!==pz.Z_BLOCK){throw new Error("Invalid flush flag: "+t.flush)}}this._flushFlag=t.flush||pz.Z_NO_FLUSH;if(t.chunkSize){if(t.chunkSize<pz.Z_MIN_CHUNK||t.chunkSize>pz.Z_MAX_CHUNK){throw new Error("Invalid chunk size: "+t.chunkSize)}}if(t.windowBits){if(t.windowBits<pz.Z_MIN_WINDOWBITS||t.windowBits>pz.Z_MAX_WINDOWBITS){throw new Error("Invalid windowBits: "+t.windowBits)}}if(t.level){if(t.level<pz.Z_MIN_LEVEL||t.level>pz.Z_MAX_LEVEL){throw new Error("Invalid compression level: "+t.level)}}if(t.memLevel){if(t.memLevel<pz.Z_MIN_MEMLEVEL||t.memLevel>pz.Z_MAX_MEMLEVEL){throw new Error("Invalid memLevel: "+t.memLevel)}}if(t.strategy){if(t.strategy!=pz.Z_FILTERED&&t.strategy!=pz.Z_HUFFMAN_ONLY&&t.strategy!=pz.Z_RLE&&t.strategy!=pz.Z_FIXED&&t.strategy!=pz.Z_DEFAULT_STRATEGY){throw new Error("Invalid strategy: "+t.strategy)}}if(t.dictionary){if(!Uo.isBuffer(t.dictionary)){throw new Error("Invalid dictionary: it should be a Buffer instance")}}this._binding=new pz.Zlib(e);var n=this;this._hadError=false;this._binding.onerror=function(t,e){n._binding=null;n._hadError=true;var r=new Error(t);r.errno=e;r.code=pz.codes[e];n.emit("error",r)};var r=pz.Z_DEFAULT_COMPRESSION;if(typeof t.level==="number")r=t.level;var s=pz.Z_DEFAULT_STRATEGY;if(typeof t.strategy==="number")s=t.strategy;this._binding.init(t.windowBits||pz.Z_DEFAULT_WINDOWBITS,r,t.memLevel||pz.Z_DEFAULT_MEMLEVEL,s,t.dictionary);this._buffer=new Uo(this._chunkSize);this._offset=0;this._closed=false;this._level=r;this._strategy=s;this.once("end",this.close)}ik(Vz,NA);Vz.prototype.params=function(t,e,n){if(t<pz.Z_MIN_LEVEL||t>pz.Z_MAX_LEVEL){throw new RangeError("Invalid compression level: "+t)}if(e!=pz.Z_FILTERED&&e!=pz.Z_HUFFMAN_ONLY&&e!=pz.Z_RLE&&e!=pz.Z_FIXED&&e!=pz.Z_DEFAULT_STRATEGY){throw new TypeError("Invalid strategy: "+e)}if(this._level!==t||this._strategy!==e){var r=this;this.flush(pz.Z_SYNC_FLUSH,(function(){r._binding.params(t,e);if(!r._hadError){r._level=t;r._strategy=e;if(n)n()}}))}else{b.nextTick(n)}};Vz.prototype.reset=function(){return this._binding.reset()};Vz.prototype._flush=function(t){this._transform(new Uo(0),"",t)};Vz.prototype.flush=function(t,e){var n=this._writableState;if(typeof t==="function"||t===void 0&&!e){e=t;t=pz.Z_FULL_FLUSH}if(n.ended){if(e)b.nextTick(e)}else if(n.ending){if(e)this.once("end",e)}else if(n.needDrain){var r=this;this.once("drain",(function(){r.flush(e)}))}else{this._flushFlag=t;this.write(new Uo(0),"",e)}};Vz.prototype.close=function(t){if(t)b.nextTick(t);if(this._closed)return;this._closed=true;this._binding.close();var e=this;b.nextTick((function(){e.emit("close")}))};Vz.prototype._transform=function(t,e,n){var r;var s=this._writableState;var i=s.ending||s.ended;var o=i&&(!t||s.length===t.length);if(!t===null&&!Uo.isBuffer(t))return n(new Error("invalid input"));if(o)r=pz.Z_FINISH;else{r=this._flushFlag;if(t.length>=s.length){this._flushFlag=this._opts.flush||pz.Z_NO_FLUSH}}this._processChunk(t,r,n)};Vz.prototype._processChunk=function(t,e,n){var r=t&&t.length;var s=this._chunkSize-this._offset;var i=0;var o=this;var a=typeof n==="function";if(!a){var c=[];var u=0;var f;this.on("error",(function(t){f=t}));do{var l=this._binding.writeSync(e,t,i,r,this._buffer,this._offset,s)}while(!this._hadError&&p(l[0],l[1]));if(this._hadError){throw f}var h=Uo.concat(c,u);this.close();return h}var d=this._binding.write(e,t,i,r,this._buffer,this._offset,s);d.buffer=t;d.callback=p;function p(f,l){if(o._hadError)return;var h=s-l;dz(h>=0,"have should not go down");if(h>0){var d=o._buffer.slice(o._offset,o._offset+h);o._offset+=h;if(a){o.push(d)}else{c.push(d);u+=d.length}}if(l===0||o._offset>=o._chunkSize){s=o._chunkSize;o._offset=0;o._buffer=new Uo(o._chunkSize)}if(l===0){i+=r-f;r=f;if(!a)return true;var m=o._binding.write(e,t,i,r,o._buffer,o._offset,o._chunkSize);m.callback=p;m.buffer=t;return}if(!a)return false;n()}};ik(Fz,Vz);ik(Pz,Vz);ik(Bz,Vz);ik(Gz,Vz);ik(Uz,Vz);ik(Wz,Vz);ik(Yz,Vz);var Zz={codes:mz,createDeflate:yz,createInflate:gz,createDeflateRaw:wz,createInflateRaw:bz,createGzip:vz,createGunzip:Nz,createUnzip:xz,deflate:Mz,deflateSync:Iz,gzip:Sz,gzipSync:Ez,deflateRaw:Dz,deflateRawSync:kz,unzip:Tz,unzipSync:Az,inflate:Lz,inflateSync:_z,gunzip:Cz,gunzipSync:Oz,inflateRaw:zz,inflateRawSync:jz,Deflate:Fz,Inflate:Pz,Gzip:Bz,Gunzip:Gz,DeflateRaw:Uz,InflateRaw:Wz,Unzip:Yz,Zlib:Vz};var Qz=Object.freeze({__proto__:null,Deflate:Fz,DeflateRaw:Uz,Gunzip:Gz,Gzip:Bz,Inflate:Pz,InflateRaw:Wz,Unzip:Yz,Zlib:Vz,codes:mz,createDeflate:yz,createDeflateRaw:wz,createGunzip:Nz,createGzip:vz,createInflate:gz,createInflateRaw:bz,createUnzip:xz,default:Zz,deflate:Mz,deflateRaw:Dz,deflateRawSync:kz,deflateSync:Iz,gunzip:Cz,gunzipSync:Oz,gzip:Sz,gzipSync:Ez,inflate:Lz,inflateRaw:zz,inflateRawSync:jz,inflateSync:_z,unzip:Tz,unzipSync:Az});var Hz=l(Qz);var Jz={exports:{}};var qz;function Xz(){if(qz)return Jz.exports;qz=1;let t=Vk;let e=EA;let n=Jz.exports=function(){e.call(this);this._buffers=[];this._buffered=0;this._reads=[];this._paused=false;this._encoding="utf8";this.writable=true};t.inherits(n,e);n.prototype.read=function(t,e){this._reads.push({length:Math.abs(t),allowLess:t<0,func:e});b.nextTick(function(){this._process();if(this._paused&&this._reads&&this._reads.length>0){this._paused=false;this.emit("drain")}}.bind(this))};n.prototype.write=function(t,e){if(!this.writable){this.emit("error",new Error("Stream not writable"));return false}let n;if(Uo.isBuffer(t)){n=t}else{n=Uo.from(t,e||this._encoding)}this._buffers.push(n);this._buffered+=n.length;this._process();if(this._reads&&this._reads.length===0){this._paused=true}return this.writable&&!this._paused};n.prototype.end=function(t,e){if(t){this.write(t,e)}this.writable=false;if(!this._buffers){return}if(this._buffers.length===0){this._end()}else{this._buffers.push(null);this._process()}};n.prototype.destroySoon=n.prototype.end;n.prototype._end=function(){if(this._reads.length>0){this.emit("error",new Error("Unexpected end of input"))}this.destroy()};n.prototype.destroy=function(){if(!this._buffers){return}this.writable=false;this._reads=null;this._buffers=null;this.emit("close")};n.prototype._processReadAllowingLess=function(t){this._reads.shift();let e=this._buffers[0];if(e.length>t.length){this._buffered-=t.length;this._buffers[0]=e.slice(t.length);t.func.call(this,e.slice(0,t.length))}else{this._buffered-=e.length;this._buffers.shift();t.func.call(this,e)}};n.prototype._processRead=function(t){this._reads.shift();let e=0;let n=0;let r=Uo.alloc(t.length);while(e<t.length){let s=this._buffers[n++];let i=Math.min(s.length,t.length-e);s.copy(r,e,0,i);e+=i;if(i!==s.length){this._buffers[--n]=s.slice(i)}}if(n>0){this._buffers.splice(0,n)}this._buffered-=t.length;t.func.call(this,r)};n.prototype._process=function(){try{while(this._buffered>0&&this._reads&&this._reads.length>0){let t=this._reads[0];if(t.allowLess){this._processReadAllowingLess(t)}else if(this._buffered>=t.length){this._processRead(t)}else{break}}if(this._buffers&&!this.writable){this._end()}}catch(t){this.emit("error",t)}};return Jz.exports}var Kz={exports:{}};var tj={exports:{}};var ej={};var nj;function rj(){if(nj)return ej;nj=1;let t=[{x:[0],y:[0]},{x:[4],y:[0]},{x:[0,4],y:[4]},{x:[2,6],y:[0,4]},{x:[0,2,4,6],y:[2,6]},{x:[1,3,5,7],y:[0,2,4,6]},{x:[0,1,2,3,4,5,6,7],y:[1,3,5,7]}];ej.getImagePasses=function(e,n){let r=[];let s=e%8;let i=n%8;let o=(e-s)/8;let a=(n-i)/8;for(let e=0;e<t.length;e++){let n=t[e];let c=o*n.x.length;let u=a*n.y.length;for(let t=0;t<n.x.length;t++){if(n.x[t]<s){c++}else{break}}for(let t=0;t<n.y.length;t++){if(n.y[t]<i){u++}else{break}}if(c>0&&u>0){r.push({width:c,height:u,index:e})}}return r};ej.getInterlaceIterator=function(e){return function(n,r,s){let i=n%t[s].x.length;let o=(n-i)/t[s].x.length*8+t[s].x[i];let a=r%t[s].y.length;let c=(r-a)/t[s].y.length*8+t[s].y[a];return o*4+c*e*4}};return ej}var sj;var ij;function oj(){if(ij)return sj;ij=1;sj=function t(e,n,r){let s=e+n-r;let i=Math.abs(s-e);let o=Math.abs(s-n);let a=Math.abs(s-r);if(i<=o&&i<=a){return e}if(o<=a){return n}return r};return sj}var aj;function cj(){if(aj)return tj.exports;aj=1;let t=rj();let e=oj();function n(t,e,n){let r=t*e;if(n!==8){r=Math.ceil(r/(8/n))}return r}let r=tj.exports=function(e,r){let s=e.width;let i=e.height;let o=e.interlace;let a=e.bpp;let c=e.depth;this.read=r.read;this.write=r.write;this.complete=r.complete;this._imageIndex=0;this._images=[];if(o){let e=t.getImagePasses(s,i);for(let t=0;t<e.length;t++){this._images.push({byteWidth:n(e[t].width,a,c),height:e[t].height,lineIndex:0})}}else{this._images.push({byteWidth:n(s,a,c),height:i,lineIndex:0})}if(c===8){this._xComparison=a}else if(c===16){this._xComparison=a*2}else{this._xComparison=1}};r.prototype.start=function(){this.read(this._images[this._imageIndex].byteWidth+1,this._reverseFilterLine.bind(this))};r.prototype._unFilterType1=function(t,e,n){let r=this._xComparison;let s=r-1;for(let i=0;i<n;i++){let n=t[1+i];let o=i>s?e[i-r]:0;e[i]=n+o}};r.prototype._unFilterType2=function(t,e,n){let r=this._lastLine;for(let s=0;s<n;s++){let n=t[1+s];let i=r?r[s]:0;e[s]=n+i}};r.prototype._unFilterType3=function(t,e,n){let r=this._xComparison;let s=r-1;let i=this._lastLine;for(let o=0;o<n;o++){let n=t[1+o];let a=i?i[o]:0;let c=o>s?e[o-r]:0;let u=Math.floor((c+a)/2);e[o]=n+u}};r.prototype._unFilterType4=function(t,n,r){let s=this._xComparison;let i=s-1;let o=this._lastLine;for(let a=0;a<r;a++){let r=t[1+a];let c=o?o[a]:0;let u=a>i?n[a-s]:0;let f=a>i&&o?o[a-s]:0;let l=e(u,c,f);n[a]=r+l}};r.prototype._reverseFilterLine=function(t){let e=t[0];let n;let r=this._images[this._imageIndex];let s=r.byteWidth;if(e===0){n=t.slice(1,s+1)}else{n=Uo.alloc(s);switch(e){case 1:this._unFilterType1(t,n,s);break;case 2:this._unFilterType2(t,n,s);break;case 3:this._unFilterType3(t,n,s);break;case 4:this._unFilterType4(t,n,s);break;default:throw new Error("Unrecognised filter type - "+e)}}this.write(n);r.lineIndex++;if(r.lineIndex>=r.height){this._lastLine=null;this._imageIndex++;r=this._images[this._imageIndex]}else{this._lastLine=n}if(r){this.read(r.byteWidth+1,this._reverseFilterLine.bind(this))}else{this._lastLine=null;this.complete()}};return tj.exports}var uj;function fj(){if(uj)return Kz.exports;uj=1;let t=Vk;let e=Xz();let n=cj();let r=Kz.exports=function(t){e.call(this);let r=[];let s=this;this._filter=new n(t,{read:this.read.bind(this),write:function(t){r.push(t)},complete:function(){s.emit("complete",Uo.concat(r))}});this._filter.start()};t.inherits(r,e);return Kz.exports}var lj={exports:{}};var hj;var dj;function pj(){if(dj)return hj;dj=1;hj={PNG_SIGNATURE:[137,80,78,71,13,10,26,10],TYPE_IHDR:1229472850,TYPE_IEND:1229278788,TYPE_IDAT:1229209940,TYPE_PLTE:1347179589,TYPE_tRNS:1951551059,TYPE_gAMA:1732332865,COLORTYPE_GRAYSCALE:0,COLORTYPE_PALETTE:1,COLORTYPE_COLOR:2,COLORTYPE_ALPHA:4,COLORTYPE_PALETTE_COLOR:3,COLORTYPE_COLOR_ALPHA:6,COLORTYPE_TO_BPP_MAP:{0:1,2:3,3:1,4:2,6:4},GAMMA_DIVISION:1e5};return hj}var mj={exports:{}};var yj;function gj(){if(yj)return mj.exports;yj=1;let t=[];(function(){for(let e=0;e<256;e++){let n=e;for(let t=0;t<8;t++){if(n&1){n=3988292384^n>>>1}else{n=n>>>1}}t[e]=n}})();let e=mj.exports=function(){this._crc=-1};e.prototype.write=function(e){for(let n=0;n<e.length;n++){this._crc=t[(this._crc^e[n])&255]^this._crc>>>8}return true};e.prototype.crc32=function(){return this._crc^-1};e.crc32=function(e){let n=-1;for(let r=0;r<e.length;r++){n=t[(n^e[r])&255]^n>>>8}return n^-1};return mj.exports}var wj;function bj(){if(wj)return lj.exports;wj=1;let t=pj();let e=gj();let n=lj.exports=function(e,n){this._options=e;e.checkCRC=e.checkCRC!==false;this._hasIHDR=false;this._hasIEND=false;this._emittedHeadersFinished=false;this._palette=[];this._colorType=0;this._chunks={};this._chunks[t.TYPE_IHDR]=this._handleIHDR.bind(this);this._chunks[t.TYPE_IEND]=this._handleIEND.bind(this);this._chunks[t.TYPE_IDAT]=this._handleIDAT.bind(this);this._chunks[t.TYPE_PLTE]=this._handlePLTE.bind(this);this._chunks[t.TYPE_tRNS]=this._handleTRNS.bind(this);this._chunks[t.TYPE_gAMA]=this._handleGAMA.bind(this);this.read=n.read;this.error=n.error;this.metadata=n.metadata;this.gamma=n.gamma;this.transColor=n.transColor;this.palette=n.palette;this.parsed=n.parsed;this.inflateData=n.inflateData;this.finished=n.finished;this.simpleTransparency=n.simpleTransparency;this.headersFinished=n.headersFinished||function(){}};n.prototype.start=function(){this.read(t.PNG_SIGNATURE.length,this._parseSignature.bind(this))};n.prototype._parseSignature=function(e){let n=t.PNG_SIGNATURE;for(let t=0;t<n.length;t++){if(e[t]!==n[t]){this.error(new Error("Invalid file signature"));return}}this.read(8,this._parseChunkBegin.bind(this))};n.prototype._parseChunkBegin=function(n){let r=n.readUInt32BE(0);let s=n.readUInt32BE(4);let i="";for(let t=4;t<8;t++){i+=String.fromCharCode(n[t])}let o=Boolean(n[4]&32);if(!this._hasIHDR&&s!==t.TYPE_IHDR){this.error(new Error("Expected IHDR on beggining"));return}this._crc=new e;this._crc.write(Uo.from(i));if(this._chunks[s]){return this._chunks[s](r)}if(!o){this.error(new Error("Unsupported critical chunk type "+i));return}this.read(r+4,this._skipChunk.bind(this))};n.prototype._skipChunk=function(){this.read(8,this._parseChunkBegin.bind(this))};n.prototype._handleChunkEnd=function(){this.read(4,this._parseChunkEnd.bind(this))};n.prototype._parseChunkEnd=function(t){let e=t.readInt32BE(0);let n=this._crc.crc32();if(this._options.checkCRC&&n!==e){this.error(new Error("Crc error - "+e+" - "+n));return}if(!this._hasIEND){this.read(8,this._parseChunkBegin.bind(this))}};n.prototype._handleIHDR=function(t){this.read(t,this._parseIHDR.bind(this))};n.prototype._parseIHDR=function(e){this._crc.write(e);let n=e.readUInt32BE(0);let r=e.readUInt32BE(4);let s=e[8];let i=e[9];let o=e[10];let a=e[11];let c=e[12];if(s!==8&&s!==4&&s!==2&&s!==1&&s!==16){this.error(new Error("Unsupported bit depth "+s));return}if(!(i in t.COLORTYPE_TO_BPP_MAP)){this.error(new Error("Unsupported color type"));return}if(o!==0){this.error(new Error("Unsupported compression method"));return}if(a!==0){this.error(new Error("Unsupported filter method"));return}if(c!==0&&c!==1){this.error(new Error("Unsupported interlace method"));return}this._colorType=i;let u=t.COLORTYPE_TO_BPP_MAP[this._colorType];this._hasIHDR=true;this.metadata({width:n,height:r,depth:s,interlace:Boolean(c),palette:Boolean(i&t.COLORTYPE_PALETTE),color:Boolean(i&t.COLORTYPE_COLOR),alpha:Boolean(i&t.COLORTYPE_ALPHA),bpp:u,colorType:i});this._handleChunkEnd()};n.prototype._handlePLTE=function(t){this.read(t,this._parsePLTE.bind(this))};n.prototype._parsePLTE=function(t){this._crc.write(t);let e=Math.floor(t.length/3);for(let n=0;n<e;n++){this._palette.push([t[n*3],t[n*3+1],t[n*3+2],255])}this.palette(this._palette);this._handleChunkEnd()};n.prototype._handleTRNS=function(t){this.simpleTransparency();this.read(t,this._parseTRNS.bind(this))};n.prototype._parseTRNS=function(e){this._crc.write(e);if(this._colorType===t.COLORTYPE_PALETTE_COLOR){if(this._palette.length===0){this.error(new Error("Transparency chunk must be after palette"));return}if(e.length>this._palette.length){this.error(new Error("More transparent colors than palette size"));return}for(let t=0;t<e.length;t++){this._palette[t][3]=e[t]}this.palette(this._palette)}if(this._colorType===t.COLORTYPE_GRAYSCALE){this.transColor([e.readUInt16BE(0)])}if(this._colorType===t.COLORTYPE_COLOR){this.transColor([e.readUInt16BE(0),e.readUInt16BE(2),e.readUInt16BE(4)])}this._handleChunkEnd()};n.prototype._handleGAMA=function(t){this.read(t,this._parseGAMA.bind(this))};n.prototype._parseGAMA=function(e){this._crc.write(e);this.gamma(e.readUInt32BE(0)/t.GAMMA_DIVISION);this._handleChunkEnd()};n.prototype._handleIDAT=function(t){if(!this._emittedHeadersFinished){this._emittedHeadersFinished=true;this.headersFinished()}this.read(-t,this._parseIDAT.bind(this,t))};n.prototype._parseIDAT=function(e,n){this._crc.write(n);if(this._colorType===t.COLORTYPE_PALETTE_COLOR&&this._palette.length===0){throw new Error("Expected palette not found")}this.inflateData(n);let r=e-n.length;if(r>0){this._handleIDAT(r)}else{this._handleChunkEnd()}};n.prototype._handleIEND=function(t){this.read(t,this._parseIEND.bind(this))};n.prototype._parseIEND=function(t){this._crc.write(t);this._hasIEND=true;this._handleChunkEnd();if(this.finished){this.finished()}};return lj.exports}var vj={};var Nj;function xj(){if(Nj)return vj;Nj=1;let t=rj();let e=[function(){},function(t,e,n,r){if(r===e.length){throw new Error("Ran out of data")}let s=e[r];t[n]=s;t[n+1]=s;t[n+2]=s;t[n+3]=255},function(t,e,n,r){if(r+1>=e.length){throw new Error("Ran out of data")}let s=e[r];t[n]=s;t[n+1]=s;t[n+2]=s;t[n+3]=e[r+1]},function(t,e,n,r){if(r+2>=e.length){throw new Error("Ran out of data")}t[n]=e[r];t[n+1]=e[r+1];t[n+2]=e[r+2];t[n+3]=255},function(t,e,n,r){if(r+3>=e.length){throw new Error("Ran out of data")}t[n]=e[r];t[n+1]=e[r+1];t[n+2]=e[r+2];t[n+3]=e[r+3]}];let n=[function(){},function(t,e,n,r){let s=e[0];t[n]=s;t[n+1]=s;t[n+2]=s;t[n+3]=r},function(t,e,n){let r=e[0];t[n]=r;t[n+1]=r;t[n+2]=r;t[n+3]=e[1]},function(t,e,n,r){t[n]=e[0];t[n+1]=e[1];t[n+2]=e[2];t[n+3]=r},function(t,e,n){t[n]=e[0];t[n+1]=e[1];t[n+2]=e[2];t[n+3]=e[3]}];function r(t,e){let n=[];let r=0;function s(){if(r===t.length){throw new Error("Ran out of data")}let s=t[r];r++;let i,o,a,c,u,f,l,h;switch(e){default:throw new Error("unrecognised depth");case 16:l=t[r];r++;n.push((s<<8)+l);break;case 4:l=s&15;h=s>>4;n.push(h,l);break;case 2:u=s&3;f=s>>2&3;l=s>>4&3;h=s>>6&3;n.push(h,l,f,u);break;case 1:i=s&1;o=s>>1&1;a=s>>2&1;c=s>>3&1;u=s>>4&1;f=s>>5&1;l=s>>6&1;h=s>>7&1;n.push(h,l,f,u,c,a,o,i);break}}return{get:function(t){while(n.length<t){s()}let e=n.slice(0,t);n=n.slice(t);return e},resetAfterLine:function(){n.length=0},end:function(){if(r!==t.length){throw new Error("extra data found")}}}}function s(t,n,r,s,i,o){let a=t.width;let c=t.height;let u=t.index;for(let t=0;t<c;t++){for(let c=0;c<a;c++){let a=r(c,t,u);e[s](n,i,a,o);o+=s}}return o}function i(t,e,r,s,i,o){let a=t.width;let c=t.height;let u=t.index;for(let t=0;t<c;t++){for(let c=0;c<a;c++){let a=i.get(s);let f=r(c,t,u);n[s](e,a,f,o)}i.resetAfterLine()}}vj.dataToBitMap=function(e,n){let o=n.width;let a=n.height;let c=n.depth;let u=n.bpp;let f=n.interlace;let l;if(c!==8){l=r(e,c)}let h;if(c<=8){h=Uo.alloc(o*a*4)}else{h=new Uint16Array(o*a*4)}let d=Math.pow(2,c)-1;let p=0;let m;let y;if(f){m=t.getImagePasses(o,a);y=t.getInterlaceIterator(o,a)}else{let t=0;y=function(){let e=t;t+=4;return e};m=[{width:o,height:a}]}for(let t=0;t<m.length;t++){if(c===8){p=s(m[t],h,y,u,e,p)}else{i(m[t],h,y,u,l,d)}}if(c===8){if(p!==e.length){throw new Error("extra data found")}}else{l.end()}return h};return vj}var Mj;var Ij;function Sj(){if(Ij)return Mj;Ij=1;function t(t,e,n,r,s){let i=0;for(let o=0;o<r;o++){for(let r=0;r<n;r++){let n=s[t[i]];if(!n){throw new Error("index "+t[i]+" not in palette")}for(let t=0;t<4;t++){e[i+t]=n[t]}i+=4}}}function e(t,e,n,r,s){let i=0;for(let o=0;o<r;o++){for(let r=0;r<n;r++){let n=false;if(s.length===1){if(s[0]===t[i]){n=true}}else if(s[0]===t[i]&&s[1]===t[i+1]&&s[2]===t[i+2]){n=true}if(n){for(let t=0;t<4;t++){e[i+t]=0}}i+=4}}}function n(t,e,n,r,s){let i=255;let o=Math.pow(2,s)-1;let a=0;for(let s=0;s<r;s++){for(let r=0;r<n;r++){for(let n=0;n<4;n++){e[a+n]=Math.floor(t[a+n]*i/o+.5)}a+=4}}}Mj=function(r,s){let i=s.depth;let o=s.width;let a=s.height;let c=s.colorType;let u=s.transColor;let f=s.palette;let l=r;if(c===3){t(r,l,o,a,f)}else{if(u){e(r,l,o,a,u)}if(i!==8){if(i===16){l=Uo.alloc(o*a*4)}n(r,l,o,a,i)}}return l};return Mj}var Ej;function Dj(){if(Ej)return DA.exports;Ej=1;let t=Vk;let e=Hz;let n=Xz();let r=fj();let s=bj();let i=xj();let o=Sj();let a=DA.exports=function(t){n.call(this);this._parser=new s(t,{read:this.read.bind(this),error:this._handleError.bind(this),metadata:this._handleMetaData.bind(this),gamma:this.emit.bind(this,"gamma"),palette:this._handlePalette.bind(this),transColor:this._handleTransColor.bind(this),finished:this._finished.bind(this),inflateData:this._inflateData.bind(this),simpleTransparency:this._simpleTransparency.bind(this),headersFinished:this._headersFinished.bind(this)});this._options=t;this.writable=true;this._parser.start()};t.inherits(a,n);a.prototype._handleError=function(t){this.emit("error",t);this.writable=false;this.destroy();if(this._inflate&&this._inflate.destroy){this._inflate.destroy()}if(this._filter){this._filter.destroy();this._filter.on("error",(function(){}))}this.errord=true};a.prototype._inflateData=function(t){if(!this._inflate){if(this._bitmapInfo.interlace){this._inflate=e.createInflate();this._inflate.on("error",this.emit.bind(this,"error"));this._filter.on("complete",this._complete.bind(this));this._inflate.pipe(this._filter)}else{let t=(this._bitmapInfo.width*this._bitmapInfo.bpp*this._bitmapInfo.depth+7>>3)+1;let n=t*this._bitmapInfo.height;let r=Math.max(n,e.Z_MIN_CHUNK);this._inflate=e.createInflate({chunkSize:r});let s=n;let i=this.emit.bind(this,"error");this._inflate.on("error",(function(t){if(!s){return}i(t)}));this._filter.on("complete",this._complete.bind(this));let o=this._filter.write.bind(this._filter);this._inflate.on("data",(function(t){if(!s){return}if(t.length>s){t=t.slice(0,s)}s-=t.length;o(t)}));this._inflate.on("end",this._filter.end.bind(this._filter))}}this._inflate.write(t)};a.prototype._handleMetaData=function(t){this._metaData=t;this._bitmapInfo=Object.create(t);this._filter=new r(this._bitmapInfo)};a.prototype._handleTransColor=function(t){this._bitmapInfo.transColor=t};a.prototype._handlePalette=function(t){this._bitmapInfo.palette=t};a.prototype._simpleTransparency=function(){this._metaData.alpha=true};a.prototype._headersFinished=function(){this.emit("metadata",this._metaData)};a.prototype._finished=function(){if(this.errord){return}if(!this._inflate){this.emit("error","No Inflate block")}else{this._inflate.end()}};a.prototype._complete=function(t){if(this.errord){return}let e;try{let n=i.dataToBitMap(t,this._bitmapInfo);e=o(n,this._bitmapInfo);n=null}catch(t){this._handleError(t);return}this.emit("parsed",e)};return DA.exports}var kj={exports:{}};var Tj={exports:{}};var Aj;var Lj;function _j(){if(Lj)return Aj;Lj=1;let t=pj();Aj=function(e,n,r,s){let i=[t.COLORTYPE_COLOR_ALPHA,t.COLORTYPE_ALPHA].indexOf(s.colorType)!==-1;if(s.colorType===s.inputColorType){let t=function(){let t=new ArrayBuffer(2);new DataView(t).setInt16(0,256,true);return new Int16Array(t)[0]!==256}();if(s.bitDepth===8||s.bitDepth===16&&t){return e}}let o=s.bitDepth!==16?e:new Uint16Array(e.buffer);let a=255;let c=t.COLORTYPE_TO_BPP_MAP[s.inputColorType];if(c===4&&!s.inputHasAlpha){c=3}let u=t.COLORTYPE_TO_BPP_MAP[s.colorType];if(s.bitDepth===16){a=65535;u*=2}let f=Uo.alloc(n*r*u);let l=0;let h=0;let d=s.bgColor||{};if(d.red===undefined){d.red=a}if(d.green===undefined){d.green=a}if(d.blue===undefined){d.blue=a}function p(){let e;let n;let r;let c=a;switch(s.inputColorType){case t.COLORTYPE_COLOR_ALPHA:c=o[l+3];e=o[l];n=o[l+1];r=o[l+2];break;case t.COLORTYPE_COLOR:e=o[l];n=o[l+1];r=o[l+2];break;case t.COLORTYPE_ALPHA:c=o[l+1];e=o[l];n=e;r=e;break;case t.COLORTYPE_GRAYSCALE:e=o[l];n=e;r=e;break;default:throw new Error("input color type:"+s.inputColorType+" is not supported at present")}if(s.inputHasAlpha){if(!i){c/=a;e=Math.min(Math.max(Math.round((1-c)*d.red+c*e),0),a);n=Math.min(Math.max(Math.round((1-c)*d.green+c*n),0),a);r=Math.min(Math.max(Math.round((1-c)*d.blue+c*r),0),a)}}return{red:e,green:n,blue:r,alpha:c}}for(let e=0;e<r;e++){for(let e=0;e<n;e++){let e=p();switch(s.colorType){case t.COLORTYPE_COLOR_ALPHA:case t.COLORTYPE_COLOR:if(s.bitDepth===8){f[h]=e.red;f[h+1]=e.green;f[h+2]=e.blue;if(i){f[h+3]=e.alpha}}else{f.writeUInt16BE(e.red,h);f.writeUInt16BE(e.green,h+2);f.writeUInt16BE(e.blue,h+4);if(i){f.writeUInt16BE(e.alpha,h+6)}}break;case t.COLORTYPE_ALPHA:case t.COLORTYPE_GRAYSCALE:{let t=(e.red+e.green+e.blue)/3;if(s.bitDepth===8){f[h]=t;if(i){f[h+1]=e.alpha}}else{f.writeUInt16BE(t,h);if(i){f.writeUInt16BE(e.alpha,h+2)}}break}default:throw new Error("unrecognised color Type "+s.colorType)}l+=c;h+=u}}return f};return Aj}var Cj;var Oj;function zj(){if(Oj)return Cj;Oj=1;let t=oj();function e(t,e,n,r,s){for(let i=0;i<n;i++){r[s+i]=t[e+i]}}function n(t,e,n){let r=0;let s=e+n;for(let n=e;n<s;n++){r+=Math.abs(t[n])}return r}function r(t,e,n,r,s,i){for(let o=0;o<n;o++){let n=o>=i?t[e+o-i]:0;let a=t[e+o]-n;r[s+o]=a}}function s(t,e,n,r){let s=0;for(let i=0;i<n;i++){let n=i>=r?t[e+i-r]:0;let o=t[e+i]-n;s+=Math.abs(o)}return s}function i(t,e,n,r,s){for(let i=0;i<n;i++){let o=e>0?t[e+i-n]:0;let a=t[e+i]-o;r[s+i]=a}}function o(t,e,n){let r=0;let s=e+n;for(let i=e;i<s;i++){let s=e>0?t[i-n]:0;let o=t[i]-s;r+=Math.abs(o)}return r}function a(t,e,n,r,s,i){for(let o=0;o<n;o++){let a=o>=i?t[e+o-i]:0;let c=e>0?t[e+o-n]:0;let u=t[e+o]-(a+c>>1);r[s+o]=u}}function c(t,e,n,r){let s=0;for(let i=0;i<n;i++){let o=i>=r?t[e+i-r]:0;let a=e>0?t[e+i-n]:0;let c=t[e+i]-(o+a>>1);s+=Math.abs(c)}return s}function u(e,n,r,s,i,o){for(let a=0;a<r;a++){let c=a>=o?e[n+a-o]:0;let u=n>0?e[n+a-r]:0;let f=n>0&&a>=o?e[n+a-(r+o)]:0;let l=e[n+a]-t(c,u,f);s[i+a]=l}}function f(e,n,r,s){let i=0;for(let o=0;o<r;o++){let a=o>=s?e[n+o-s]:0;let c=n>0?e[n+o-r]:0;let u=n>0&&o>=s?e[n+o-(r+s)]:0;let f=e[n+o]-t(a,c,u);i+=Math.abs(f)}return i}let l={0:e,1:r,2:i,3:a,4:u};let h={0:n,1:s,2:o,3:c,4:f};Cj=function(t,e,n,r,s){let i;if(!("filterType"in r)||r.filterType===-1){i=[0,1,2,3,4]}else if(typeof r.filterType==="number"){i=[r.filterType]}else{throw new Error("unrecognised filter types")}if(r.bitDepth===16){s*=2}let o=e*s;let a=0;let c=0;let u=Uo.alloc((o+1)*n);let f=i[0];for(let e=0;e<n;e++){if(i.length>1){let e=Infinity;for(let n=0;n<i.length;n++){let r=h[i[n]](t,c,o,s);if(r<e){f=i[n];e=r}}}u[a]=f;a++;l[f](t,c,o,u,a,s);a+=o;c+=o}return u};return Cj}var jj;function Rj(){if(jj)return Tj.exports;jj=1;let t=pj();let e=gj();let n=_j();let r=zj();let s=Hz;let i=Tj.exports=function(e){this._options=e;e.deflateChunkSize=e.deflateChunkSize||32*1024;e.deflateLevel=e.deflateLevel!=null?e.deflateLevel:9;e.deflateStrategy=e.deflateStrategy!=null?e.deflateStrategy:3;e.inputHasAlpha=e.inputHasAlpha!=null?e.inputHasAlpha:true;e.deflateFactory=e.deflateFactory||s.createDeflate;e.bitDepth=e.bitDepth||8;e.colorType=typeof e.colorType==="number"?e.colorType:t.COLORTYPE_COLOR_ALPHA;e.inputColorType=typeof e.inputColorType==="number"?e.inputColorType:t.COLORTYPE_COLOR_ALPHA;if([t.COLORTYPE_GRAYSCALE,t.COLORTYPE_COLOR,t.COLORTYPE_COLOR_ALPHA,t.COLORTYPE_ALPHA].indexOf(e.colorType)===-1){throw new Error("option color type:"+e.colorType+" is not supported at present")}if([t.COLORTYPE_GRAYSCALE,t.COLORTYPE_COLOR,t.COLORTYPE_COLOR_ALPHA,t.COLORTYPE_ALPHA].indexOf(e.inputColorType)===-1){throw new Error("option input color type:"+e.inputColorType+" is not supported at present")}if(e.bitDepth!==8&&e.bitDepth!==16){throw new Error("option bit depth:"+e.bitDepth+" is not supported at present")}};i.prototype.getDeflateOptions=function(){return{chunkSize:this._options.deflateChunkSize,level:this._options.deflateLevel,strategy:this._options.deflateStrategy}};i.prototype.createDeflate=function(){return this._options.deflateFactory(this.getDeflateOptions())};i.prototype.filterData=function(e,s,i){let o=n(e,s,i,this._options);let a=t.COLORTYPE_TO_BPP_MAP[this._options.colorType];let c=r(o,s,i,this._options,a);return c};i.prototype._packChunk=function(t,n){let r=n?n.length:0;let s=Uo.alloc(r+12);s.writeUInt32BE(r,0);s.writeUInt32BE(t,4);if(n){n.copy(s,8)}s.writeInt32BE(e.crc32(s.slice(4,s.length-4)),s.length-4);return s};i.prototype.packGAMA=function(e){let n=Uo.alloc(4);n.writeUInt32BE(Math.floor(e*t.GAMMA_DIVISION),0);return this._packChunk(t.TYPE_gAMA,n)};i.prototype.packIHDR=function(e,n){let r=Uo.alloc(13);r.writeUInt32BE(e,0);r.writeUInt32BE(n,4);r[8]=this._options.bitDepth;r[9]=this._options.colorType;r[10]=0;r[11]=0;r[12]=0;return this._packChunk(t.TYPE_IHDR,r)};i.prototype.packIDAT=function(e){return this._packChunk(t.TYPE_IDAT,e)};i.prototype.packIEND=function(){return this._packChunk(t.TYPE_IEND,null)};return Tj.exports}var $j;function Fj(){if($j)return kj.exports;$j=1;let t=Vk;let e=EA;let n=pj();let r=Rj();let s=kj.exports=function(t){e.call(this);let n=t||{};this._packer=new r(n);this._deflate=this._packer.createDeflate();this.readable=true};t.inherits(s,e);s.prototype.pack=function(t,e,r,s){this.emit("data",Uo.from(n.PNG_SIGNATURE));this.emit("data",this._packer.packIHDR(e,r));if(s){this.emit("data",this._packer.packGAMA(s))}let i=this._packer.filterData(t,e,r);this._deflate.on("error",this.emit.bind(this,"error"));this._deflate.on("data",function(t){this.emit("data",this._packer.packIDAT(t))}.bind(this));this._deflate.on("end",function(){this.emit("data",this._packer.packIEND());this.emit("end")}.bind(this));this._deflate.end(i)};return kj.exports}var Pj={};var Bj={exports:{}};function Gj(t,e){if(t===e){return 0}var n=t.length;var r=e.length;for(var s=0,i=Math.min(n,r);s<i;++s){if(t[s]!==e[s]){n=t[s];r=e[s];break}}if(n<r){return-1}if(r<n){return 1}return 0}var Uj=Object.prototype.hasOwnProperty;var Wj=Object.keys||function(t){var e=[];for(var n in t){if(Uj.call(t,n))e.push(n)}return e};var Yj=Array.prototype.slice;var Vj;function Zj(){if(typeof Vj!=="undefined"){return Vj}return Vj=function(){return function t(){}.name==="foo"}()}function Qj(t){return Object.prototype.toString.call(t)}function Hj(t){if(Ra(t)){return false}if(typeof w.ArrayBuffer!=="function"){return false}if(typeof ArrayBuffer.isView==="function"){return ArrayBuffer.isView(t)}if(!t){return false}if(t instanceof DataView){return true}if(t.buffer&&t.buffer instanceof ArrayBuffer){return true}return false}function Jj(t,e){if(!t)rR(t,true,e,"==",sR)}var qj=/\s*function\s+([^\(\s]*)\s*/;function Xj(t){if(!Ok(t)){return}if(Zj()){return t.name}var e=t.toString();var n=e.match(qj);return n&&n[1]}Jj.AssertionError=Kj;function Kj(t){this.name="AssertionError";this.actual=t.actual;this.expected=t.expected;this.operator=t.operator;if(t.message){this.message=t.message;this.generatedMessage=false}else{this.message=nR(this);this.generatedMessage=true}var e=t.stackStartFunction||rR;if(Error.captureStackTrace){Error.captureStackTrace(this,e)}else{var n=new Error;if(n.stack){var r=n.stack;var s=Xj(e);var i=r.indexOf("\n"+s);if(i>=0){var o=r.indexOf("\n",i+1);r=r.substring(o+1)}this.stack=r}}}ik(Kj,Error);function tR(t,e){if(typeof t==="string"){return t.length<e?t:t.slice(0,e)}else{return t}}function eR(t){if(Zj()||!Ok(t)){return hk(t)}var e=Xj(t);var n=e?": "+e:"";return"[Function"+n+"]"}function nR(t){return tR(eR(t.actual),128)+" "+t.operator+" "+tR(eR(t.expected),128)}function rR(t,e,n,r,s){throw new Kj({message:n,actual:t,expected:e,operator:r,stackStartFunction:s})}Jj.fail=rR;function sR(t,e){if(!t)rR(t,true,e,"==",sR)}Jj.ok=sR;Jj.equal=iR;function iR(t,e,n){if(t!=e)rR(t,e,n,"==",iR)}Jj.notEqual=oR;function oR(t,e,n){if(t==e){rR(t,e,n,"!=",oR)}}Jj.deepEqual=aR;function aR(t,e,n){if(!uR(t,e,false)){rR(t,e,n,"deepEqual",aR)}}Jj.deepStrictEqual=cR;function cR(t,e,n){if(!uR(t,e,true)){rR(t,e,n,"deepStrictEqual",cR)}}function uR(t,e,n,r){if(t===e){return true}else if(Ra(t)&&Ra(e)){return Gj(t,e)===0}else if(_k(t)&&_k(e)){return t.getTime()===e.getTime()}else if(Ak(t)&&Ak(e)){return t.source===e.source&&t.global===e.global&&t.multiline===e.multiline&&t.lastIndex===e.lastIndex&&t.ignoreCase===e.ignoreCase}else if((t===null||typeof t!=="object")&&(e===null||typeof e!=="object")){return n?t===e:t==e}else if(Hj(t)&&Hj(e)&&Qj(t)===Qj(e)&&!(t instanceof Float32Array||t instanceof Float64Array)){return Gj(new Uint8Array(t.buffer),new Uint8Array(e.buffer))===0}else if(Ra(t)!==Ra(e)){return false}else{r=r||{actual:[],expected:[]};var s=r.actual.indexOf(t);if(s!==-1){if(s===r.expected.indexOf(e)){return true}}r.actual.push(t);r.expected.push(e);return lR(t,e,n,r)}}function fR(t){return Object.prototype.toString.call(t)=="[object Arguments]"}function lR(t,e,n,r){if(t===null||t===undefined||e===null||e===undefined)return false;if(zk(t)||zk(e))return t===e;if(n&&Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return false;var s=fR(t);var i=fR(e);if(s&&!i||!s&&i)return false;if(s){t=Yj.call(t);e=Yj.call(e);return uR(t,e,n)}var o=Wj(t);var a=Wj(e);var c,u;if(o.length!==a.length)return false;o.sort();a.sort();for(u=o.length-1;u>=0;u--){if(o[u]!==a[u])return false}for(u=o.length-1;u>=0;u--){c=o[u];if(!uR(t[c],e[c],n,r))return false}return true}Jj.notDeepEqual=hR;function hR(t,e,n){if(uR(t,e,false)){rR(t,e,n,"notDeepEqual",hR)}}Jj.notDeepStrictEqual=dR;function dR(t,e,n){if(uR(t,e,true)){rR(t,e,n,"notDeepStrictEqual",dR)}}Jj.strictEqual=pR;function pR(t,e,n){if(t!==e){rR(t,e,n,"===",pR)}}Jj.notStrictEqual=mR;function mR(t,e,n){if(t===e){rR(t,e,n,"!==",mR)}}function yR(t,e){if(!t||!e){return false}if(Object.prototype.toString.call(e)=="[object RegExp]"){return e.test(t)}try{if(t instanceof e){return true}}catch(t){}if(Error.isPrototypeOf(e)){return false}return e.call({},t)===true}function gR(t){var e;try{t()}catch(t){e=t}return e}function wR(t,e,n,r){var s;if(typeof e!=="function"){throw new TypeError('"block" argument must be a function')}if(typeof n==="string"){r=n;n=null}s=gR(e);r=(n&&n.name?" ("+n.name+").":".")+(r?" "+r:".");if(t&&!s){rR(s,n,"Missing expected exception"+r)}var i=typeof r==="string";var o=!t&&Ck(s);var a=!t&&s&&!n;if(o&&i&&yR(s,n)||a){rR(s,n,"Got unwanted exception"+r)}if(t&&s&&n&&!yR(s,n)||!t&&s){throw s}}Jj.throws=bR;function bR(t,e,n){wR(true,t,e,n)}Jj.doesNotThrow=vR;function vR(t,e,n){wR(false,t,e,n)}Jj.ifError=NR;function NR(t){if(t)throw t}var xR=Object.freeze({__proto__:null,AssertionError:Kj,assert:sR,deepEqual:aR,deepStrictEqual:cR,default:Jj,doesNotThrow:vR,equal:iR,fail:rR,ifError:NR,notDeepEqual:hR,notDeepStrictEqual:dR,notEqual:oR,notStrictEqual:mR,ok:sR,strictEqual:pR,throws:bR});var MR=l(xR);var IR;function SR(){if(IR)return Bj.exports;IR=1;(function(t,e){let n=MR.ok;let r=Hz;let s=Vk;let i=hT.kMaxLength;function o(t){if(!(this instanceof o)){return new o(t)}if(t&&t.chunkSize<r.Z_MIN_CHUNK){t.chunkSize=r.Z_MIN_CHUNK}r.Inflate.call(this,t);this._offset=this._offset===undefined?this._outOffset:this._offset;this._buffer=this._buffer||this._outBuffer;if(t&&t.maxLength!=null){this._maxLength=t.maxLength}}function a(t){return new o(t)}function c(t,e){if(!t._handle){return}t._handle.close();t._handle=null}o.prototype._processChunk=function(t,e,s){if(typeof s==="function"){return r.Inflate._processChunk.call(this,t,e,s)}let o=this;let a=t&&t.length;let u=this._chunkSize-this._offset;let f=this._maxLength;let l=0;let h=[];let d=0;let p;this.on("error",(function(t){p=t}));function m(t,e){if(o._hadError){return}let r=u-e;n(r>=0,"have should not go down");if(r>0){let t=o._buffer.slice(o._offset,o._offset+r);o._offset+=r;if(t.length>f){t=t.slice(0,f)}h.push(t);d+=t.length;f-=t.length;if(f===0){return false}}if(e===0||o._offset>=o._chunkSize){u=o._chunkSize;o._offset=0;o._buffer=Uo.allocUnsafe(o._chunkSize)}if(e===0){l+=a-t;a=t;return true}return false}n(this._handle,"zlib binding closed");let y;do{y=this._handle.writeSync(e,t,l,a,this._buffer,this._offset,u);y=y||this._writeState}while(!this._hadError&&m(y[0],y[1]));if(this._hadError){throw p}if(d>=i){c(this);throw new RangeError("Cannot create final Buffer. It would be larger than 0x"+i.toString(16)+" bytes")}let g=Uo.concat(h,d);c(this);return g};s.inherits(o,r.Inflate);function u(t,e){if(typeof e==="string"){e=Uo.from(e)}if(!(e instanceof Uo)){throw new TypeError("Not a string or buffer")}let n=t._finishFlushFlag;if(n==null){n=r.Z_FINISH}return t._processChunk(e,n)}function f(t,e){return u(new o(e),t)}t.exports=e=f;e.Inflate=o;e.createInflate=a;e.inflateSync=f})(Bj,Bj.exports);return Bj.exports}var ER={exports:{}};var DR;function kR(){if(DR)return ER.exports;DR=1;let t=ER.exports=function(t){this._buffer=t;this._reads=[]};t.prototype.read=function(t,e){this._reads.push({length:Math.abs(t),allowLess:t<0,func:e})};t.prototype.process=function(){while(this._reads.length>0&&this._buffer.length){let t=this._reads[0];if(this._buffer.length&&(this._buffer.length>=t.length||t.allowLess)){this._reads.shift();let e=this._buffer;this._buffer=e.slice(t.length);t.func.call(this,e.slice(0,t.length))}else{break}}if(this._reads.length>0){return new Error("There are some read requests waitng on finished stream")}if(this._buffer.length>0){return new Error("unrecognised content at end of stream")}};return ER.exports}var TR={};var AR;function LR(){if(AR)return TR;AR=1;let t=kR();let e=cj();TR.process=function(n,r){let s=[];let i=new t(n);let o=new e(r,{read:i.read.bind(i),write:function(t){s.push(t)},complete:function(){}});o.start();i.process();return Uo.concat(s)};return TR}var _R;var CR;function OR(){if(CR)return _R;CR=1;let t=true;let e=Hz;let n=SR();if(!e.deflateSync){t=false}let r=kR();let s=LR();let i=bj();let o=xj();let a=Sj();_R=function(c,u){if(!t){throw new Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0")}let f;function l(t){f=t}let h;function d(t){h=t}function p(t){h.transColor=t}function m(t){h.palette=t}function y(){h.alpha=true}let g;function w(t){g=t}let b=[];function v(t){b.push(t)}let N=new r(c);let x=new i(u,{read:N.read.bind(N),error:l,metadata:d,gamma:w,palette:m,transColor:p,inflateData:v,simpleTransparency:y});x.start();N.process();if(f){throw f}let M=Uo.concat(b);b.length=0;let I;if(h.interlace){I=e.inflateSync(M)}else{let t=(h.width*h.bpp*h.depth+7>>3)+1;let e=t*h.height;I=n(M,{chunkSize:e,maxLength:e})}M=null;if(!I||!I.length){throw new Error("bad png - invalid inflate data response")}let S=s.process(I,h);M=null;let E=o.dataToBitMap(S,h);S=null;let D=a(E,h);h.data=D;h.gamma=g||0;return h};return _R}var zR;var jR;function RR(){if(jR)return zR;jR=1;let t=true;let e=Hz;if(!e.deflateSync){t=false}let n=pj();let r=Rj();zR=function(s,i){if(!t){throw new Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0")}let o=i||{};let a=new r(o);let c=[];c.push(Uo.from(n.PNG_SIGNATURE));c.push(a.packIHDR(s.width,s.height));if(s.gamma){c.push(a.packGAMA(s.gamma))}let u=a.filterData(s.data,s.width,s.height);let f=e.deflateSync(u,a.getDeflateOptions());u=null;if(!f||!f.length){throw new Error("bad png - invalid compressed data response")}c.push(a.packIDAT(f));c.push(a.packIEND());return Uo.concat(c)};return zR}var $R;function FR(){if($R)return Pj;$R=1;let t=OR();let e=RR();Pj.read=function(e,n){return t(e,n||{})};Pj.write=function(t,n){return e(t,n)};return Pj}var PR;function BR(){if(PR)return sk;PR=1;let t=Vk;let e=EA;let n=Dj();let r=Fj();let s=FR();let i=sk.PNG=function(t){e.call(this);t=t||{};this.width=t.width|0;this.height=t.height|0;this.data=this.width>0&&this.height>0?Uo.alloc(4*this.width*this.height):null;if(t.fill&&this.data){this.data.fill(0)}this.gamma=0;this.readable=this.writable=true;this._parser=new n(t);this._parser.on("error",this.emit.bind(this,"error"));this._parser.on("close",this._handleClose.bind(this));this._parser.on("metadata",this._metadata.bind(this));this._parser.on("gamma",this._gamma.bind(this));this._parser.on("parsed",function(t){this.data=t;this.emit("parsed",t)}.bind(this));this._packer=new r(t);this._packer.on("data",this.emit.bind(this,"data"));this._packer.on("end",this.emit.bind(this,"end"));this._parser.on("close",this._handleClose.bind(this));this._packer.on("error",this.emit.bind(this,"error"))};t.inherits(i,e);i.sync=s;i.prototype.pack=function(){if(!this.data||!this.data.length){this.emit("error","No data provided");return this}b.nextTick(function(){this._packer.pack(this.data,this.width,this.height,this.gamma)}.bind(this));return this};i.prototype.parse=function(t,e){if(e){let t,n;t=function(t){this.removeListener("error",n);this.data=t;e(null,this)}.bind(this);n=function(n){this.removeListener("parsed",t);e(n,null)}.bind(this);this.once("parsed",t);this.once("error",n)}this.end(t);return this};i.prototype.write=function(t){this._parser.write(t);return true};i.prototype.end=function(t){this._parser.end(t)};i.prototype._metadata=function(t){this.width=t.width;this.height=t.height;this.emit("metadata",t)};i.prototype._gamma=function(t){this.gamma=t};i.prototype._handleClose=function(){if(!this._parser.writable&&!this._packer.readable){this.emit("close")}};i.bitblt=function(t,e,n,r,s,i,o,a){n|=0;r|=0;s|=0;i|=0;o|=0;a|=0;if(n>t.width||r>t.height||n+s>t.width||r+i>t.height){throw new Error("bitblt reading outside image")}if(o>e.width||a>e.height||o+s>e.width||a+i>e.height){throw new Error("bitblt writing outside image")}for(let c=0;c<i;c++){t.data.copy(e.data,(a+c)*e.width+o<<2,(r+c)*t.width+n<<2,(r+c)*t.width+n+s<<2)}};i.prototype.bitblt=function(t,e,n,r,s,o,a){i.bitblt(this,t,e,n,r,s,o,a);return this};i.adjustGamma=function(t){if(t.gamma){for(let e=0;e<t.height;e++){for(let n=0;n<t.width;n++){let r=t.width*e+n<<2;for(let e=0;e<3;e++){let n=t.data[r+e]/255;n=Math.pow(n,1/2.2/t.gamma);t.data[r+e]=Math.round(n*255)}}}t.gamma=0}};i.prototype.adjustGamma=function(){i.adjustGamma(this)};return sk}var GR={};var UR;function WR(){if(UR)return GR;UR=1;(function(t){function e(t){if(typeof t==="number"){t=t.toString()}if(typeof t!=="string"){throw new Error("Color should be defined as hex string")}let e=t.slice().replace("#","").split("");if(e.length<3||e.length===5||e.length>8){throw new Error("Invalid hex color: "+t)}if(e.length===3||e.length===4){e=Array.prototype.concat.apply([],e.map((function(t){return[t,t]})))}if(e.length===6)e.push("F","F");const n=parseInt(e.join(""),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:n&255,hex:"#"+e.slice(0,6).join("")}}t.getOptions=function t(n){if(!n)n={};if(!n.color)n.color={};const r=typeof n.margin==="undefined"||n.margin===null||n.margin<0?4:n.margin;const s=n.width&&n.width>=21?n.width:undefined;const i=n.scale||4;return{width:s,scale:s?4:i,margin:r,color:{dark:e(n.color.dark||"#000000ff"),light:e(n.color.light||"#ffffffff")},type:n.type,rendererOpts:n.rendererOpts||{}}};t.getScale=function t(e,n){return n.width&&n.width>=e+n.margin*2?n.width/(e+n.margin*2):n.scale};t.getImageWidth=function e(n,r){const s=t.getScale(n,r);return Math.floor((n+r.margin*2)*s)};t.qrToImageData=function e(n,r,s){const i=r.modules.size;const o=r.modules.data;const a=t.getScale(i,s);const c=Math.floor((i+s.margin*2)*a);const u=s.margin*a;const f=[s.color.light,s.color.dark];for(let t=0;t<c;t++){for(let e=0;e<c;e++){let r=(t*c+e)*4;let l=s.color.light;if(t>=u&&e>=u&&t<c-u&&e<c-u){const n=Math.floor((t-u)/a);const r=Math.floor((e-u)/a);l=f[o[n*i+r]?1:0]}n[r++]=l.r;n[r++]=l.g;n[r++]=l.b;n[r]=l.a}}}})(GR);return GR}var YR;function VR(){if(YR)return rk;YR=1;(function(t){const e=oy;const n=BR().PNG;const r=WR();t.render=function t(e,s){const i=r.getOptions(s);const o=i.rendererOpts;const a=r.getImageWidth(e.modules.size,i);o.width=a;o.height=a;const c=new n(o);r.qrToImageData(c.data,e,i);return c};t.renderToDataURL=function e(n,r,s){if(typeof s==="undefined"){s=r;r=undefined}t.renderToBuffer(n,r,(function(t,e){if(t)s(t);let n="data:image/png;base64,";n+=e.toString("base64");s(null,n)}))};t.renderToBuffer=function e(n,r,s){if(typeof s==="undefined"){s=r;r=undefined}const i=t.render(n,r);const o=[];i.on("error",s);i.on("data",(function(t){o.push(t)}));i.on("end",(function(){s(null,Uo.concat(o))}));i.pack()};t.renderToFile=function n(r,s,i,o){if(typeof o==="undefined"){o=i;i=undefined}let a=false;const c=(...t)=>{if(a)return;a=true;o.apply(null,t)};const u=e.createWriteStream(r);u.on("error",c);u.on("close",c);t.renderToFileStream(u,s,i)};t.renderToFileStream=function e(n,r,s){const i=t.render(r,s);i.pack().pipe(n)}})(rk);return rk}var ZR={};var QR;function HR(){if(QR)return ZR;QR=1;(function(t){const e=WR();const n={WW:" ",WB:"▄",BB:"█",BW:"▀"};const r={BB:" ",BW:"▄",WW:"█",WB:"▀"};function s(t,e,n){if(t&&e)return n.BB;if(t&&!e)return n.BW;if(!t&&e)return n.WB;return n.WW}t.render=function(t,i,o){const a=e.getOptions(i);let c=n;if(a.color.dark.hex==="#ffffff"||a.color.light.hex==="#000000"){c=r}const u=t.modules.size;const f=t.modules.data;let l="";let h=Array(u+a.margin*2+1).join(c.WW);h=Array(a.margin/2+1).join(h+"\n");const d=Array(a.margin+1).join(c.WW);l+=h;for(let t=0;t<u;t+=2){l+=d;for(let e=0;e<u;e++){const n=f[t*u+e];const r=f[(t+1)*u+e];l+=s(n,r,c)}l+=d+"\n"}l+=h.slice(0,-1);if(typeof o==="function"){o(null,l)}return l};t.renderToFile=function e(n,r,s,i){if(typeof i==="undefined"){i=s;s=undefined}const o=oy;const a=t.render(r,s);o.writeFile(n,a,i)}})(ZR);return ZR}var JR={};var qR={};var XR;function KR(){if(XR)return qR;XR=1;qR.render=function(t,e,n){const r=t.modules.size;const s=t.modules.data;const i="[40m [0m";const o="[47m [0m";let a="";const c=Array(r+3).join(o);const u=Array(2).join(o);a+=c+"\n";for(let t=0;t<r;++t){a+=o;for(let e=0;e<r;e++){a+=s[t*r+e]?i:o}a+=u+"\n"}a+=c+"\n";if(typeof n==="function"){n(null,a)}return a};return qR}var t$={};var e$;function n$(){if(e$)return t$;e$=1;const t="[47m";const e="[40m";const n="[37m";const r="[30m";const s="[0m";const i=t+r;const o=e+n;const a=function(t,e,n){return{"00":s+" "+t,"01":s+e+"▄"+t,"02":s+n+"▄"+t,10:s+e+"▀"+t,11:" ",12:"▄",20:s+n+"▀"+t,21:"▀",22:"█"}};const c=function(t,e,n,r){const s=e+1;if(n>=s||r>=s||r<-1||n<-1)return"0";if(n>=e||r>=e||r<0||n<0)return"1";const i=r*e+n;return t[i]?"2":"1"};const u=function(t,e,n,r){return c(t,e,n,r)+c(t,e,n,r+1)};t$.render=function(t,e,c){const f=t.modules.size;const l=t.modules.data;const h=!!(e&&e.inverse);const d=e&&e.inverse?o:i;const p=h?r:n;const m=h?n:r;const y=a(d,p,m);const g=s+"\n"+d;let w=d;for(let t=-1;t<f+1;t+=2){for(let e=-1;e<f;e++){w+=y[u(l,f,e,t)]}w+=y[u(l,f,f,t)]+g}w+=s;if(typeof c==="function"){c(null,w)}return w};return t$}var r$;function s$(){if(r$)return JR;r$=1;const t=KR();const e=n$();JR.render=function(n,r,s){if(r&&r.small){return e.render(n,r,s)}return t.render(n,r,s)};return JR}var i$={};var o$={};var a$;function c$(){if(a$)return o$;a$=1;const t=WR();function e(t,e){const n=t.a/255;const r=e+'="'+t.hex+'"';return n<1?r+" "+e+'-opacity="'+n.toFixed(2).slice(1)+'"':r}function n(t,e,n){let r=t+e;if(typeof n!=="undefined")r+=" "+n;return r}function r(t,e,r){let s="";let i=0;let o=false;let a=0;for(let c=0;c<t.length;c++){const u=Math.floor(c%e);const f=Math.floor(c/e);if(!u&&!o)o=true;if(t[c]){a++;if(!(c>0&&u>0&&t[c-1])){s+=o?n("M",u+r,.5+f+r):n("m",i,0);i=0;o=false}if(!(u+1<e&&t[c+1])){s+=n("h",a);a=0}}else{i++}}return s}o$.render=function n(s,i,o){const a=t.getOptions(i);const c=s.modules.size;const u=s.modules.data;const f=c+a.margin*2;const l=!a.color.light.a?"":"<path "+e(a.color.light,"fill")+' d="M0 0h'+f+"v"+f+'H0z"/>';const h="<path "+e(a.color.dark,"stroke")+' d="'+r(u,c,a.margin)+'"/>';const d='viewBox="'+"0 0 "+f+" "+f+'"';const p=!a.width?"":'width="'+a.width+'" height="'+a.width+'" ';const m='<svg xmlns="http://www.w3.org/2000/svg" '+p+d+' shape-rendering="crispEdges">'+l+h+"</svg>\n";if(typeof o==="function"){o(null,m)}return m};return o$}var u$;function f$(){if(u$)return i$;u$=1;(function(t){const e=c$();t.render=e.render;t.renderToFile=function e(n,r,s,i){if(typeof i==="undefined"){i=s;s=undefined}const o=oy;const a=t.render(r,s);const c='<?xml version="1.0" encoding="utf-8"?>'+'<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">'+a;o.writeFile(n,c,i)}})(i$);return i$}var l$={};var h$={};var d$;function p$(){if(d$)return h$;d$=1;(function(t){const e=WR();function n(t,e,n){t.clearRect(0,0,e.width,e.height);if(!e.style)e.style={};e.height=n;e.width=n;e.style.height=n+"px";e.style.width=n+"px"}function r(){try{return document.createElement("canvas")}catch(t){throw new Error("You need to specify a canvas element")}}t.render=function t(s,i,o){let a=o;let c=i;if(typeof a==="undefined"&&(!i||!i.getContext)){a=i;i=undefined}if(!i){c=r()}a=e.getOptions(a);const u=e.getImageWidth(s.modules.size,a);const f=c.getContext("2d");const l=f.createImageData(u,u);e.qrToImageData(l.data,s,a);n(f,c,u);f.putImageData(l,0,0);return c};t.renderToDataURL=function e(n,r,s){let i=s;if(typeof i==="undefined"&&(!r||!r.getContext)){i=r;r=undefined}if(!i)i={};const o=t.render(n,r,i);const a=i.type||"image/png";const c=i.rendererOpts||{};return o.toDataURL(a,c.quality)}})(h$);return h$}var m$;function y$(){if(m$)return l$;m$=1;const t=BE();const e=nk();const n=p$();const r=c$();function s(n,r,s,i,o){const a=[].slice.call(arguments,1);const c=a.length;const u=typeof a[c-1]==="function";if(!u&&!t()){throw new Error("Callback required as last argument")}if(u){if(c<2){throw new Error("Too few arguments provided")}if(c===2){o=s;s=r;r=i=undefined}else if(c===3){if(r.getContext&&typeof o==="undefined"){o=i;i=undefined}else{o=i;i=s;s=r;r=undefined}}}else{if(c<1){throw new Error("Too few arguments provided")}if(c===1){s=r;r=i=undefined}else if(c===2&&!r.getContext){i=s;s=r;r=undefined}return new Promise((function(t,o){try{const o=e.create(s,i);t(n(o,r,i))}catch(t){o(t)}}))}try{const t=e.create(s,i);o(null,n(t,r,i))}catch(t){o(t)}}l$.create=e.create;l$.toCanvas=s.bind(null,n.render);l$.toDataURL=s.bind(null,n.renderToDataURL);l$.toString=s.bind(null,(function(t,e,n){return r.render(t,n)}));return l$}var g$;function w$(){if(g$)return $E;g$=1;const t=BE();const e=nk();const n=VR();const r=HR();const s=s$();const i=f$();function o(e,n,r){if(typeof e==="undefined"){throw new Error("String required as first argument")}if(typeof r==="undefined"){r=n;n={}}if(typeof r!=="function"){if(!t()){throw new Error("Callback required as last argument")}else{n=r||{};r=null}}return{opts:n,cb:r}}function a(t){return t.slice((t.lastIndexOf(".")-1>>>0)+2).toLowerCase()}function c(t){switch(t){case"svg":return i;case"txt":case"utf8":return r;case"png":case"image/png":default:return n}}function u(t){switch(t){case"svg":return i;case"terminal":return s;case"utf8":default:return r}}function f(t,n,r){if(!r.cb){return new Promise((function(s,i){try{const o=e.create(n,r.opts);return t(o,r.opts,(function(t,e){return t?i(t):s(e)}))}catch(t){i(t)}}))}try{const s=e.create(n,r.opts);return t(s,r.opts,r.cb)}catch(t){r.cb(t)}}$E.create=e.create;$E.toCanvas=y$().toCanvas;$E.toString=function t(e,n,r){const s=o(e,n,r);const i=s.opts?s.opts.type:undefined;const a=u(i);return f(a.render,e,s)};$E.toDataURL=function t(e,n,r){const s=o(e,n,r);const i=c(s.opts.type);return f(i.renderToDataURL,e,s)};$E.toBuffer=function t(e,n,r){const s=o(e,n,r);const i=c(s.opts.type);return f(i.renderToBuffer,e,s)};$E.toFile=function e(n,r,s,i){if(typeof n!=="string"||!(typeof r==="string"||typeof r==="object")){throw new Error("Invalid argument")}if(arguments.length<3&&!t()){throw new Error("Too few arguments provided")}const u=o(r,s,i);const l=u.opts.type||a(n);const h=c(l);const d=h.renderToFile.bind(null,n);return f(d,r,u)};$E.toFileStream=function t(e,n,r){if(arguments.length<2){throw new Error("Too few arguments provided")}const s=o(n,r,e.emit.bind(e,"error"));const i=c("png");const a=i.renderToFileStream.bind(null,e);f(a,n,s)};return $E}var b$;var v$;function N$(){if(v$)return b$;v$=1;b$=w$();return b$}var x$=N$();var M$=f(x$);const I$=".qr-canvas{max-height:60vh;max-width:80vw;text-align:center}.qr-canvas>canvas{width:100%;height:100%}";const S$=class{constructor(n){t(this,n);this.apiErrorEvent=e(this,"apiError");this.prefilledPhone=false;this.invalidValue=false;this.waitingMobile=false}async componentWillLoad(){d.flowStarted();this.translations=await m.getValues();this.infoTextTop=this.translations.MobileRedirectValues.InfoTop;this.infoTextBottom=this.translations.MobileRedirectValues.InfoBottom;let t="ontr";if(o.environment=="QA"){t="test"}else if(o.environment=="DOCKER"){t=""}let e="";if(o.apiBaseUrl.includes("apimd")){e="https://onmd.id-kyc.com/"}else if(o.apiBaseUrl.includes("apiontrace")){e="https://ontrace.id-kyc.com/"}else{e="https://onro.id-kyc.com/"}this.redirectLink=new URL(t+"mobileredirect?redirectId="+o.redirectId,e).toString();if(o.phoneNumber&&o.phoneNumber!=""){this.contact=o.phoneNumber;this.prefilledPhone=true}var n=this;M$.toDataURL(this.redirectLink,{type:"image/png",errorCorrectionLevel:"M",scale:6},(function(t,e){if(t)console.error(t);n.qrCode=e}))}async componentDidLoad(){await h.initialize(s.MobileRedirect);await E(5e3);await this.checkStatus();while(this.orderStatus!=a.COMPLETE){await this.checkStatus();await E(5e3)}}async checkStatus(){this.orderStatus=await i.instance.GetStatusUi(o.requestId);if(this.orderStatus==null){this.apiErrorEvent.emit({message:"No order was started for this process."})}else if(this.orderStatus==a.ABORTED){this.waitingMobile=false;this.infoTextTop=this.translations.MobileRedirectValues.InfoAborted;d.flowAborted()}else if(this.orderStatus==a.COMPLETE){this.waitingMobile=false;o.flowStatus=a.COMPLETE}else if(this.orderStatus!=a.MOBILE){this.infoTextTop=this.translations.MobileRedirectValues.InfoWaiting;this.waitingMobile=true}}async disconnectedCallback(){await h.finalize(s.MobileRedirect)}async buttonClick(){if(this.contact==""||this.contact.length!=10){return}this.waitingMobile=true;this.infoTextTop=this.translations.MobileRedirectValues.InfoWaiting;try{await i.instance.SendLink(this.redirectLink,this.contact)}catch(t){this.apiErrorEvent.emit(t)}}handleChangeContact(t){let e=t.target?t.target.value:"";this.contact=e.replace(/\D/g,"");if(this.contact.length>10){this.contact=this.contact.substring(0,10)}this.invalidValue=this.contact.length!=10;t.target.value=this.contact}render(){return n("div",{key:"34d54d78152d4382e56b40d40324d65687eb39cf",class:"container flex center"},n("div",{key:"86ec4e33867724d36a4ed0504f25be82aa78276a",class:"px-2 w-100"},n("div",{key:"ac49a37b03b137c450b5b51027b6a367c1d32476",hidden:this.waitingMobile},n("h1",{key:"899ac0b19433daa4518fc1af512352f9a50eb1d2",class:"text-center px-2 mb-1"},this.infoTextTop),n("div",{key:"9840907c2c888161bc1a4473a019eb5ac2ec67cb",class:"flex center"},n("img",{key:"ce0c5b50c844e9a701f27411db1b73134fdd5241",src:this.qrCode})),n("h2",{key:"5fcd4a070c136dd450120861ee3ff9621d9f4bfe",class:"text-center px-2 mb-2"},this.infoTextBottom),n("div",{key:"63b937dab269e457357607c6d693e1da3607370a",class:"input-container mb-3 px-3"},n("label",{key:"69b9d3673112ef5ea92b1c3fafe71cf1852ecd8b",class:"font-size-18 mb-1 color-red",hidden:this.invalidValue==false},n("b",{key:"aaa49c86df8936291d154a7d7a0407b15c3227ee"},this.translations.MobileRedirectValues.Validation)),n("input",{key:"c029f6e18ba29154afdf6fca589d0953ecde9ce4",type:"text",id:"codeInput",class:"main-input",disabled:this.prefilledPhone,value:this.contact,onInput:t=>this.handleChangeContact(t)})),n("div",{key:"c3045e43fc93e122da17f7e86614dddd36d01c51",class:"px-3"},n("button",{key:"cdbb355764e00f3b31fe437afb28794293292290",class:"main-button",onClick:()=>this.buttonClick()},this.translations.MobileRedirectValues.Send))),n("div",{key:"33d96361551f8173ea706dfcb0fddf101a3297af",hidden:this.waitingMobile==false},n("div",{key:"759aaac75e0137733f83c1fb078b5cf6fe5f62c6",class:"text-center"},n("p",{key:"9c9cb40166a29f80575af47cbef2c0ac5581fcb9",class:"font-size-2"},this.infoTextTop))),n("div",{key:"346d7376785aabff41d46f3d472102c46a2c79e1",class:"footer text-center"},n("img",{key:"7f5eb110ca773311ca3df122d17ad47358d4ad93",src:y}))))}};S$.style=I$;var E$;(function(t){t["IdFront"]="IdFront";t["IdBack"]="IdBack";t["IdFrontVideo"]="IdFrontVideo";t["IdBackVideo"]="IdBackVideo";t["Selfie"]="Selfie";t["SelfieVideo"]="SelfieVideo";t["SelfieGestureVideo"]="SelfieGestureVideo";t["TiltVideo"]="TiltVideo";t["None"]="None"})(E$||(E$={}));const D$="";const k$=class{constructor(n){t(this,n);this.apiErrorEvent=e(this,"apiError");this.recordingResultCount=0;this.uploading=false;this.appInsights=M.getInstance()}componentWillLoad(){this.captureRetryCount=0;this.initFlow();this.appInsights.trackEvent("ProcessId | init",{requestId:o.requestId})}initFlow(){if(this.mode=="front"){this.currentStep=s.CiFront;this.flow={fileName:"idImage.png",recName:"idVideo.",photoType:E$.IdFront,recType:E$.IdFrontVideo,imageSize:0,videoSize:0}}else if(this.mode=="back"){this.currentStep=s.CiBack;this.flow={fileName:"idBackImage.png",recName:"idBackVideo.",photoType:E$.IdBack,recType:E$.IdBackVideo,imageSize:0,videoSize:0}}else if(this.mode=="tilt"){this.currentStep=s.CiTilt;this.flow={fileName:"idTiltImage.png",recName:"idTiltVideo.",photoType:E$.None,recType:E$.TiltVideo,imageSize:0,videoSize:0}}if(o.debug)console.log("process-id | initFlow")}timeElapsed(){this.errorReason="Timeout";this.showTimeout=true}captureErrorDone(){if(o.debug)console.log("process-id | captureErrorDone");if(this.showTimeout==true){this.showTimeout=false}if(this.showInvalid==true){this.showInvalid=false}}async captureIdImage(t){if(o.debug)console.log("process-id | captureIdImage",this.mode);if(this.mode=="tilt")return;let e=t.detail;if(e.size==0){if(o.debug)console.log("process-id | captureIdImage | Empty id photo");await i.instance.AddLog({message:"Empty id photo",blobData:e},await D());this.triggerErrorFlow();return}this.capture=new File([e],this.flow.fileName,{type:"image/png"});this.uploadCapture()}async uploadCapture(){try{this.uploading=true;let e=await T(this.capture);this.flow.imageSize=A(e);if(o.debug)console.log("process-id | captureIdImage | uploadResult: "+t);var t=await i.instance.UploadFileForRequestB64(o.requestId,this.flow.photoType,e);if(t.isValid){o.flowStatus=a[t.state]}else{this.switchCamera();this.triggerErrorFlow()}this.capture=null;this.uploading=false}catch(t){this.apiErrorEvent.emit(t)}}async capturedIdRecording(t){if(o.debug)console.log("process-id | capturedIdRecording");let e=t.detail;if(e.size==0&&this.recordingResultCount==0){this.recordingResultCount++;return}if(e.size==0){if(o.debug)console.log("process-id | capturedIdRecording | Empty ID recording");await i.instance.AddLog({message:"Empty ID recording",blobData:e},await D());this.triggerErrorFlow();return}let n=e.type==S.mp4MimeType.type?S.mp4MimeType:S.webmMimeType;let r=new File([e],this.flow.recName+n.extension,{type:n.type});let s=await T(r);this.flow.videoSize=A(s);var c=await i.instance.UploadFileForRequestB64(o.requestId,this.flow.recType,s);if(o.debug)console.log("process-id | capturedIdRecording | uploadResult: "+c);if(c.saved){o.flowStatus=a[c.state]}else{this.triggerErrorFlow()}this.recordingResultCount=0}async verificationFinished(){if(o.debug)console.log("process-id | verificationFinished");this.verificationReceived=Date.now();while(Date.now()-this.verificationReceived<9e4){await E(2e3);if(this.showInvalid||this.showTimeout)return}this.triggerUploadFailedFlow();if(o.debug)console.log("process-id | verificationFinished | waitingFinished ")}triggerUploadFailedFlow(){this.errorReason="Upload Failed";this.showInvalid=true}async componentDidLoad(){if(o.debug)console.log("process-id | componentDidLoad");await h.initialize(this.currentStep)}triggerErrorFlow(){this.errorReason="Invalid";this.showInvalid=true}async disconnectedCallback(){if(o.debug)console.log("process-id | disconnectedCallback");await h.finalize(this.currentStep)}switchCamera(){if(o.debug)console.log("process-id | switchCamera");if(this.captureRetryCount==1){p.switchCamera();this.captureRetryCount=0}else{this.captureRetryCount++}}render(){let t=n("capture-error",{type:"ID",reason:this.errorReason,error:`image: ${this.flow.imageSize}mb video: ${this.flow.videoSize}mb`});let e=n("id-auto-capture",null);let r=n("uploading-data",{type:"id"});if(this.uploading)return r;if(this.showInvalid||this.showTimeout)return t;return e}};k$.style=D$;const T$=".grid{display:grid;gap:20px;grid-template-rows:repeat(3, calc((100vw - 4em - 40px) / 3));grid-template-columns:repeat(3, calc((100vw - 4em - 40px) / 3))}.grid>div{background-color:#f9f9f9;display:flex;align-items:center;justify-content:center;border-radius:50%;font-weight:600;font-size:1.4em;box-shadow:1px 1px 3px #00000029}.grid>div.error{background:#FF5353;color:white}.grid>div.success{background:#7BB40E;color:white}";const A$=class{constructor(e){t(this,e);this.rand=[]}async componentWillLoad(){this.translations=await m.getValues();this.randomize()}randomInt(t,e){return Math.floor(Math.random()*(e-t+1)+t)}randomize(){this.rand=[];for(let e=0;e<9;e++){var t=this.randomInt(1,99);while(this.rand.includes(t)){t=this.randomInt(1,99)}this.rand.push(t)}this.choice=this.randomInt(0,8)}async click(t,e){let n=e.currentTarget;if(this.choice==t){n.classList.add("success");await E(500);o.flowStatus=await i.instance.GetNextFlowState()}else{n.classList.add("error");await E(500);this.randomize()}n.classList=[]}render(){return n("div",{key:"177de311b3e0113c22f16d0bd05584a916788c97",class:"container flex center"},n("div",{key:"45cfff1e3c369459aca9ffd8654239e85dddb376",class:"px-2 w-100"},n("h1",{key:"46b5810c7a157ca2b01a1bd04f1cb13dfce5b123",class:"text-center px-1 mb-2",innerHTML:this.translations.RandomActionValues.Title+` ${this.rand[this.choice]}`}),n("div",{key:"a0c7891ced6147b8bd5a441749a71d8878ea25af",class:"grid"},this.rand.map(((t,e)=>n("div",{onClick:t=>this.click(e,t)},t)))),n("div",{key:"dd5b29400f6677bf140cc226d7a0bbfbabf5198d",class:"footer text-center"},n("img",{key:"10a94fae640ddf85a5988d14876597aa5b7e010d",src:y}))))}};A$.style=T$;var L$="undefined"!=typeof self?self:{};function _$(){throw Error("Invalid UTF8")}function C$(t,e){return e=String.fromCharCode.apply(null,e),null==t?e:t+e}let O$,z$;const j$="undefined"!=typeof TextDecoder;let R$;const $$="undefined"!=typeof TextEncoder;function F$(t){if($$)t=(R$||=new TextEncoder).encode(t);else{let n=0;const r=new Uint8Array(3*t.length);for(let s=0;s<t.length;s++){var e=t.charCodeAt(s);if(e<128)r[n++]=e;else{if(e<2048)r[n++]=e>>6|192;else{if(e>=55296&&e<=57343){if(e<=56319&&s<t.length){const i=t.charCodeAt(++s);if(i>=56320&&i<=57343){e=1024*(e-55296)+i-56320+65536,r[n++]=e>>18|240,r[n++]=e>>12&63|128,r[n++]=e>>6&63|128,r[n++]=63&e|128;continue}s--}e=65533}r[n++]=e>>12|224,r[n++]=e>>6&63|128}r[n++]=63&e|128}}t=n===r.length?r:r.subarray(0,n)}return t}var P$,B$;t:{for(var G$=["CLOSURE_FLAGS"],U$=L$,W$=0;W$<G$.length;W$++)if(null==(U$=U$[G$[W$]])){B$=null;break t}B$=U$}var Y$,V$=B$&&B$[610401301];P$=null!=V$&&V$;const Z$=L$.navigator;function Q$(t){return!!P$&&(!!Y$&&Y$.brands.some((({brand:e})=>e&&-1!=e.indexOf(t))))}function H$(t){var e;return(e=L$.navigator)&&(e=e.userAgent)||(e=""),-1!=e.indexOf(t)}function J$(){return!!P$&&(!!Y$&&Y$.brands.length>0)}function q$(){return J$()?Q$("Chromium"):(H$("Chrome")||H$("CriOS"))&&!(!J$()&&H$("Edge"))||H$("Silk")}function X$(t){return X$[" "](t),t}Y$=Z$&&Z$.userAgentData||null,X$[" "]=function(){};var K$=!J$()&&(H$("Trident")||H$("MSIE"));!H$("Android")||q$(),q$(),H$("Safari")&&(q$()||!J$()&&H$("Coast")||!J$()&&H$("Opera")||!J$()&&H$("Edge")||(J$()?Q$("Microsoft Edge"):H$("Edg/"))||J$()&&Q$("Opera"));var tF={},eF=null;function nF(t){const e=t.length;let n=3*e/4;n%3?n=Math.floor(n):-1!="=.".indexOf(t[e-1])&&(n=-1!="=.".indexOf(t[e-2])?n-2:n-1);const r=new Uint8Array(n);let s=0;return function(t,e){function n(e){for(;r<t.length;){const e=t.charAt(r++),n=eF[e];if(null!=n)return n;if(!/^[\s\xa0]*$/.test(e))throw Error("Unknown base64 encoding at char: "+e)}return e}rF();let r=0;for(;;){const t=n(-1),r=n(0),s=n(64),i=n(64);if(64===i&&-1===t)break;e(t<<2|r>>4),64!=s&&(e(r<<4&240|s>>2),64!=i&&e(s<<6&192|i))}}(t,(function(t){r[s++]=t})),s!==n?r.subarray(0,s):r}function rF(){if(!eF){eF={};var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"];for(let n=0;n<5;n++){const r=t.concat(e[n].split(""));tF[n]=r;for(let t=0;t<r.length;t++){const e=r[t];void 0===eF[e]&&(eF[e]=t)}}}}var sF="undefined"!=typeof Uint8Array,iF=!K$&&"function"==typeof btoa;function oF(t){if(!iF){var e;void 0===e&&(e=0),rF(),e=tF[e];var n=Array(Math.floor(t.length/3)),r=e[64]||"";let c=0,u=0;for(;c<t.length-2;c+=3){var s=t[c],i=t[c+1],o=t[c+2],a=e[s>>2];s=e[(3&s)<<4|i>>4],i=e[(15&i)<<2|o>>6],o=e[63&o],n[u++]=a+s+i+o}switch(a=0,o=r,t.length-c){case 2:o=e[(15&(a=t[c+1]))<<2]||r;case 1:t=t[c],n[u]=e[t>>2]+e[(3&t)<<4|a>>4]+o+r}return n.join("")}for(e="",n=0,r=t.length-10240;n<r;)e+=String.fromCharCode.apply(null,t.subarray(n,n+=10240));return e+=String.fromCharCode.apply(null,n?t.subarray(n):t),btoa(e)}const aF=/[-_.]/g,cF={"-":"+",_:"/",".":"="};function uF(t){return cF[t]||""}function fF(t){if(!iF)return nF(t);aF.test(t)&&(t=t.replace(aF,uF)),t=atob(t);const e=new Uint8Array(t.length);for(let n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e}function lF(t){return sF&&null!=t&&t instanceof Uint8Array}var hF={};function dF(){return yF||=new mF(null,hF)}function pF(t){wF(hF);var e=t.g;return null==(e=null==e||lF(e)?e:"string"==typeof e?fF(e):null)?e:t.g=e}var mF=class{h(){return new Uint8Array(pF(this)||0)}constructor(t,e){if(wF(e),this.g=t,null!=t&&0===t.length)throw Error("ByteString should be constructed with non-empty values")}};let yF,gF;function wF(t){if(t!==hF)throw Error("illegal external caller")}function bF(t,e){t.__closure__error__context__984382||(t.__closure__error__context__984382={}),t.__closure__error__context__984382.severity=e}function vF(t){return bF(t=Error(t),"warning"),t}function NF(t){if(null!=t){var e=gF??={},n=e[t]||0;n>=5||(e[t]=n+1,bF(t=Error(),"incident"),function(t){L$.setTimeout((()=>{throw t}),0)}(t))}}var xF="function"==typeof Symbol&&"symbol"==typeof Symbol();function MF(t,e,n=false){return"function"==typeof Symbol&&"symbol"==typeof Symbol()?n&&Symbol.for&&t?Symbol.for(t):null!=t?Symbol(t):Symbol():e}var IF=MF("jas",void 0,true),SF=MF(void 0,"0di"),EF=MF(void 0,"1oa"),DF=MF(void 0,Symbol()),kF=MF(void 0,"0actk"),TF=MF(void 0,"8utk");const AF=xF?IF:"Ea",LF={Ea:{value:0,configurable:true,writable:true,enumerable:false}},_F=Object.defineProperties;function CF(t,e){xF||AF in t||_F(t,LF),t[AF]|=e}function OF(t,e){xF||AF in t||_F(t,LF),t[AF]=e}function zF(t){return CF(t,34),t}function jF(t,e){OF(e,-15615&(0|t))}function RF(t,e){OF(e,-15581&(34|t))}function $F(){return"function"==typeof BigInt}function FF(t){return Array.prototype.slice.call(t)}var PF,BF={};function GF(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)&&t.constructor===Object}function UF(t,e){if(null!=t)if("string"==typeof t)t=t?new mF(t,hF):dF();else if(t.constructor!==mF)if(lF(t))t=t.length?new mF(new Uint8Array(t),hF):dF();else{if(!e)throw Error();t=void 0}return t}const WF=[];function YF(t){if(2&t)throw Error()}OF(WF,55),PF=Object.freeze(WF);class VF{constructor(t,e,n){this.g=t,this.h=e,this.l=n}next(){const t=this.g.next();return t.done||(t.value=this.h.call(this.l,t.value)),t}[Symbol.iterator](){return this}}function ZF(t){return DF?t[DF]:void 0}var QF=Object.freeze({});function HF(t){return t.Na=true,t}var JF=HF((t=>"number"==typeof t)),qF=HF((t=>"string"==typeof t)),XF=HF((t=>"boolean"==typeof t)),KF="function"==typeof L$.BigInt&&"bigint"==typeof L$.BigInt(0);function tP(t){var e=t;if(qF(e)){if(!/^\s*(?:-?[1-9]\d*|0)?\s*$/.test(e))throw Error(String(e))}else if(JF(e)&&!Number.isSafeInteger(e))throw Error(String(e));return KF?BigInt(t):t=XF(t)?t?"1":"0":qF(t)?t.trim()||"0":String(t)}var eP=HF((t=>KF?t>=rP&&t<=iP:"-"===t[0]?oP(t,nP):oP(t,sP)));const nP=Number.MIN_SAFE_INTEGER.toString(),rP=KF?BigInt(Number.MIN_SAFE_INTEGER):void 0,sP=Number.MAX_SAFE_INTEGER.toString(),iP=KF?BigInt(Number.MAX_SAFE_INTEGER):void 0;function oP(t,e){if(t.length>e.length)return false;if(t.length<e.length||t===e)return true;for(let n=0;n<t.length;n++){const r=t[n],s=e[n];if(r>s)return false;if(r<s)return true}}const aP="function"==typeof Uint8Array.prototype.slice;let cP,uP=0,fP=0;function lP(t){const e=t>>>0;uP=e,fP=(t-e)/4294967296>>>0}function hP(t){if(t<0){lP(-t);const[e,n]=vP(uP,fP);uP=e>>>0,fP=n>>>0}else lP(t)}function dP(t){const e=cP||=new DataView(new ArrayBuffer(8));e.setFloat32(0,+t,true),fP=0,uP=e.getUint32(0,true)}function pP(t,e){const n=4294967296*e+(t>>>0);return Number.isSafeInteger(n)?n:yP(t,e)}function mP(t,e){const n=2147483648&e;return n&&(e=~e>>>0,0==(t=1+~t>>>0)&&(e=e+1>>>0)),"number"==typeof(t=pP(t,e))?n?-t:t:n?"-"+t:t}function yP(t,e){if(t>>>=0,(e>>>=0)<=2097151)var n=""+(4294967296*e+t);else $F()?n=""+(BigInt(e)<<BigInt(32)|BigInt(t)):(t=(16777215&t)+6777216*(n=16777215&(t>>>24|e<<8))+6710656*(e=e>>16&65535),n+=8147497*e,e*=2,t>=1e7&&(n+=t/1e7>>>0,t%=1e7),n>=1e7&&(e+=n/1e7>>>0,n%=1e7),n=e+gP(n)+gP(t));return n}function gP(t){return t=String(t),"0000000".slice(t.length)+t}function wP(){var t=uP,e=fP;if(2147483648&e)if($F())t=""+(BigInt(0|e)<<BigInt(32)|BigInt(t>>>0));else{const[n,r]=vP(t,e);t="-"+yP(n,r)}else t=yP(t,e);return t}function bP(t){if(t.length<16)hP(Number(t));else if($F())t=BigInt(t),uP=Number(t&BigInt(4294967295))>>>0,fP=Number(t>>BigInt(32)&BigInt(4294967295));else{const e=+("-"===t[0]);fP=uP=0;const n=t.length;for(let r=e,s=(n-e)%6+e;s<=n;r=s,s+=6){const e=Number(t.slice(r,s));fP*=1e6,uP=1e6*uP+e,uP>=4294967296&&(fP+=Math.trunc(uP/4294967296),fP>>>=0,uP>>>=0)}if(e){const[t,e]=vP(uP,fP);uP=t,fP=e}}}function vP(t,e){return e=~e,t?t=1+~t:e+=1,[t,e]}const NP="function"==typeof BigInt?BigInt.asIntN:void 0,xP="function"==typeof BigInt?BigInt.asUintN:void 0,MP=Number.isSafeInteger,IP=Number.isFinite,SP=Math.trunc,EP=tP(0);function DP(t){return null==t||"number"==typeof t?t:"NaN"===t||"Infinity"===t||"-Infinity"===t?Number(t):void 0}function kP(t){return null==t||"boolean"==typeof t?t:"number"==typeof t?!!t:void 0}const TP=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function AP(t){switch(typeof t){case"bigint":return true;case"number":return IP(t);case"string":return TP.test(t);default:return false}}function LP(t){if(null==t)return t;if("string"==typeof t&&t)t=+t;else if("number"!=typeof t)return;return IP(t)?0|t:void 0}function _P(t){if(null==t)return t;if("string"==typeof t&&t)t=+t;else if("number"!=typeof t)return;return IP(t)?t>>>0:void 0}function CP(t){if("-"===t[0])return false;const e=t.length;return e<20||20===e&&Number(t.substring(0,6))<184467}function OP(t){const e=t.length;return"-"===t[0]?e<20||20===e&&Number(t.substring(0,7))>-922337:e<19||19===e&&Number(t.substring(0,6))<922337}function zP(t){return OP(t)?t:(bP(t),wP())}function jP(t){return t=SP(t),MP(t)||(hP(t),t=mP(uP,fP)),t}function RP(t){var e=SP(Number(t));return MP(e)?String(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),zP(t))}function $P(t){var e=SP(Number(t));return MP(e)?tP(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),$F()?tP(NP(64,BigInt(t))):tP(zP(t)))}function FP(t){if(MP(t))t=tP(jP(t));else{if(t=SP(t),MP(t))t=String(t);else{const e=String(t);OP(e)?t=e:(hP(t),t=wP())}t=tP(t)}return t}function PP(t){return null==t?t:"bigint"==typeof t?(eP(t)?t=Number(t):(t=NP(64,t),t=eP(t)?Number(t):String(t)),t):AP(t)?"number"==typeof t?jP(t):RP(t):void 0}function BP(t){if(null==t)return t;var e=typeof t;if("bigint"===e)return String(xP(64,t));if(AP(t)){if("string"===e)return e=SP(Number(t)),MP(e)&&e>=0?t=String(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),CP(t)||(bP(t),t=yP(uP,fP))),t;if("number"===e)return(t=SP(t))>=0&&MP(t)?t:function(t){if(t<0){hP(t);var e=yP(uP,fP);return t=Number(e),MP(t)?t:e}return CP(e=String(t))?e:(hP(t),pP(uP,fP))}(t)}}function GP(t){if("string"!=typeof t)throw Error();return t}function UP(t){if(null!=t&&"string"!=typeof t)throw Error();return t}function WP(t){return null==t||"string"==typeof t?t:void 0}function YP(t,e,n,r){if(null!=t&&"object"==typeof t&&t.W===BF)return t;if(!Array.isArray(t))return n?2&r?((t=e[SF])||(zF((t=new e).u),t=e[SF]=t),e=t):e=new e:e=void 0,e;let s=n=0|t[AF];return 0===s&&(s|=32&r),s|=2&r,s!==n&&OF(t,s),new e(t)}function VP(t,e,n){if(e)t:{if(!AP(e=t))throw vF("int64");switch(typeof e){case"string":e=$P(e);break t;case"bigint":e=tP(NP(64,e));break t;default:e=FP(e)}}else t=typeof(e=t),e=null==e?e:"bigint"===t?tP(NP(64,e)):AP(e)?"string"===t?$P(e):FP(e):void 0;return null==(t=e)?n?EP:void 0:t}function ZP(t){return t}const QP={};let HP=function(){try{return X$(new class extends Map{constructor(){super()}}),false}catch{return true}}();class JP{constructor(){this.g=new Map}get(t){return this.g.get(t)}set(t,e){return this.g.set(t,e),this.size=this.g.size,this}delete(t){return t=this.g.delete(t),this.size=this.g.size,t}clear(){this.g.clear(),this.size=this.g.size}has(t){return this.g.has(t)}entries(){return this.g.entries()}keys(){return this.g.keys()}values(){return this.g.values()}forEach(t,e){return this.g.forEach(t,e)}[Symbol.iterator](){return this.entries()}}const qP=HP?(Object.setPrototypeOf(JP.prototype,Map.prototype),Object.defineProperties(JP.prototype,{size:{value:0,configurable:true,enumerable:true,writable:true}}),JP):class extends Map{constructor(){super()}};function XP(t){return t}function KP(t){if(2&t.M)throw Error("Cannot mutate an immutable Map")}var tB=class extends qP{constructor(t,e,n=XP,r=XP){super();let s=0|t[AF];s|=64,OF(t,s),this.M=s,this.I=e,this.S=n,this.X=this.I?eB:r;for(let i=0;i<t.length;i++){const o=t[i],a=n(o[0],false,true);let c=o[1];e?void 0===c&&(c=null):c=r(o[1],false,true,void 0,void 0,s),super.set(a,c)}}La(){var t=lB;if(0!==this.size)return Array.from(super.entries(),(e=>(e[0]=t(e[0]),e[1]=t(e[1]),e)))}da(t=nB){const e=[],n=super.entries();for(var r;!(r=n.next()).done;)(r=r.value)[0]=t(r[0]),r[1]=t(r[1]),e.push(r);return e}clear(){KP(this),super.clear()}delete(t){return KP(this),super.delete(this.S(t,true,false))}entries(){if(this.I){var t=super.keys();t=new VF(t,rB,this)}else t=super.entries();return t}values(){if(this.I){var t=super.keys();t=new VF(t,tB.prototype.get,this)}else t=super.values();return t}forEach(t,e){this.I?super.forEach(((n,r,s)=>{t.call(e,s.get(r),r,s)})):super.forEach(t,e)}set(t,e){return KP(this),null==(t=this.S(t,true,false))?this:null==e?(super.delete(t),this):super.set(t,this.X(e,true,true,this.I,false,this.M))}Ja(t){const e=this.S(t[0],false,true);t=t[1],t=this.I?void 0===t?null:t:this.X(t,false,true,void 0,false,this.M),super.set(e,t)}has(t){return super.has(this.S(t,false,false))}get(t){t=this.S(t,false,false);const e=super.get(t);if(void 0!==e){var n=this.I;return n?((n=this.X(e,false,true,n,this.pa,this.M))!==e&&super.set(t,n),n):e}}[Symbol.iterator](){return this.entries()}};function eB(t,e,n,r,s,i){return t=YP(t,r,n,i),s&&(t=wB(t)),t}function nB(t){return t}function rB(t){return[t,this.get(t)]}let sB,iB,oB,aB;function cB(){return sB||=new tB(zF([]),void 0,void 0,void 0,QP)}function uB(t,e,n,r,s){if(null!=t){if(Array.isArray(t)){const i=0|t[AF];return 0===t.length&&1&i?void 0:s&&2&i?t:fB(t,e,n,void 0!==r,s)}return e(t,r)}}function fB(t,e,n,r,s){const i=r||n?0|t[AF]:0,o=r?!!(32&i):void 0;let a=0;const c=(r=FF(t)).length;for(let t=0;t<c;t++){var u=r[t];if(t===c-1&&GF(u)){var f=e,l=n,h=o,d=s;let t;for(let e in u){const n=uB(u[e],f,l,h,d);null!=n&&((t??={})[e]=n)}u=t}else u=uB(r[t],e,n,o,s);r[t]=u,null!=u&&(a=t+1)}return a<c&&(r.length=a),n&&((t=ZF(t))&&(r[DF]=FF(t)),n(i,r)),r}function lB(t){return uB(t,hB,void 0,void 0,false)}function hB(t){switch(typeof t){case"number":return Number.isFinite(t)?t:""+t;case"bigint":return eP(t)?Number(t):""+t;case"boolean":return t?1:0;case"object":if(lF(t))return lF(t)&&NF(TF),oF(t);if(t.W===BF)return dB(t);if(t instanceof mF){const e=t.g;return null==e?"":"string"==typeof e?e:t.g=oF(e)}return t instanceof tB?t.La():void 0}return t}function dB(t){var e=t.u;t=fB(e,hB,void 0,void 0,false);var n=0|e[AF];if((e=t.length)&&!(512&n)){var r=t[e-1],s=false;GF(r)?(e--,s=true):r=void 0;var i=e-(n=512&n?0:-1),o=(iB??ZP)(i,n,t,r);if(r&&(t[e]=void 0),i<o&&r){for(var a in i=true,r){const c=+a;c<=o?(t[s=c+n]=r[a],e=Math.max(s+1,e),s=false,delete r[a]):i=false}i&&(r=void 0)}for(i=e-1;e>0;i=e-1)if(null==(a=t[i]))e--,s=true;else{if(!((i-=n)>=o))break;(r??={})[i]=a,e--,s=true}s&&(t.length=e),r&&t.push(r)}return t}function pB(t,e,n){return t=mB(t,e[0],e[1],n?1:2),e!==oB&&n&&CF(t,8192),t}function mB(t,e,n,r){if(null==t){var s=96;n?(t=[n],s|=512):t=[],e&&(s=-16760833&s|(1023&e)<<14)}else{if(!Array.isArray(t))throw Error("narr");if(8192&(s=0|t[AF])||!(64&s)||2&s||NF(kF),1024&s)throw Error("farr");if(64&s)return t;if(1===r||2===r||(s|=64),n&&(s|=512,n!==t[0]))throw Error("mid");t:{var i=(n=t).length;if(i){var o=i-1;if(GF(r=n[o])){if((o-=e=512&(s|=256)?0:-1)>=1024)throw Error("pvtlmt");for(var a in r)(i=+a)<o&&(n[i+e]=r[a],delete r[a]);s=-16760833&s|(1023&o)<<14;break t}}if(e){if((a=Math.max(e,i-(512&s?0:-1)))>1024)throw Error("spvt");s=-16760833&s|(1023&a)<<14}}}return OF(t,s),t}function yB(t,e,n=RF){if(null!=t){if(sF&&t instanceof Uint8Array)return e?t:new Uint8Array(t);if(Array.isArray(t)){var r=0|t[AF];return 2&r?t:(e&&=0===r||!!(32&r)&&!(64&r||!(16&r)),e?(OF(t,34|r),4&r&&Object.freeze(t),t):fB(t,yB,4&r?RF:n,true,true))}return t.W===BF?t=2&(r=0|(n=t.u)[AF])?t:new t.constructor(gB(n,r,true)):t instanceof tB&&!(2&t.M)&&(n=zF(t.da(yB)),t=new tB(n,t.I,t.S,t.X)),t}}function gB(t,e,n){const r=n||2&e?RF:jF,s=!!(32&e);return t=function(t,e,n){const r=FF(t);var s=r.length;const i=256&e?r[s-1]:void 0;for(s+=i?-1:0,e=512&e?1:0;e<s;e++)r[e]=n(r[e]);if(i){e=r[e]={};for(const t in i)e[t]=n(i[t])}return(t=ZF(t))&&(r[DF]=FF(t)),r}(t,e,(t=>yB(t,s,r))),CF(t,32|(n?2:0)),t}function wB(t){const e=t.u,n=0|e[AF];return 2&n?new t.constructor(gB(e,n,false)):t}function bB(t,e){return vB(t=t.u,0|t[AF],e)}function vB(t,e,n){if(-1===n)return null;const r=n+(512&e?0:-1),s=t.length-1;return r>=s&&256&e?t[s][n]:r<=s?t[r]:void 0}function NB(t,e,n){const r=t.u;let s=0|r[AF];return YF(s),xB(r,s,e,n),t}function xB(t,e,n,r){const s=512&e?0:-1,i=n+s;var o=t.length-1;return i>=o&&256&e?(t[o][n]=r,e):i<=o?(t[i]=r,e):(void 0!==r&&(n>=(o=e>>14&1023||536870912)?null!=r&&(t[o+s]={[n]:r},OF(t,e|=256)):t[i]=r),e)}function MB(t,e){let n=0|(t=t.u)[AF];const r=vB(t,n,e),s=DP(r);return null!=s&&s!==r&&xB(t,n,e,s),s}function IB(t){let e=0|(t=t.u)[AF];const n=vB(t,e,1),r=UF(n,true);return null!=r&&r!==n&&xB(t,e,1,r),r}function SB(){return void 0===QF?2:4}function EB(t,e,n,r,s){const i=t.u,o=2&(t=0|i[AF])?1:r;s=!!s;let a=0|(r=DB(i,t,e))[AF];if(!(4&a)){4&a&&(r=FF(r),a=WB(a,t),t=xB(i,t,e,r));let s=0,o=0;for(;s<r.length;s++){const t=n(r[s]);null!=t&&(r[o++]=t)}o<s&&(r.length=o),a=kB(a,t),n=-2049&(20|a),a=n&=-4097,OF(r,a),2&a&&Object.freeze(r)}return 1===o||4===o&&32&a?TB(a)||(s=a,a|=2,a!==s&&OF(r,a),Object.freeze(r)):(2===o&&TB(a)&&(r=FF(r),a=WB(a,t),a=YB(a,t,s),OF(r,a),t=xB(i,t,e,r)),TB(a)||(e=a,a=YB(a,t,s),a!==e&&OF(r,a))),r}function DB(t,e,n){return t=vB(t,e,n),Array.isArray(t)?t:PF}function kB(t,e){return 0===t&&(t=WB(t,e)),1|t}function TB(t){return!!(2&t)&&!!(4&t)||!!(1024&t)}function AB(t){t=FF(t);for(let e=0;e<t.length;e++){const n=t[e]=FF(t[e]);Array.isArray(n[1])&&(n[1]=zF(n[1]))}return t}function LB(t,e,n,r){let s=0|(t=t.u)[AF];YF(s),xB(t,s,e,("0"===r?0===Number(n):n===r)?void 0:n)}function _B(t,e,n,r){YF(e);let s=DB(t,e,n);const i=s!==PF;if(64&e||!(8192&e)||!i){const o=i?0|s[AF]:0;let a=o;(!i||2&a||TB(a)||4&a&&!(32&a))&&(s=FF(s),a=WB(a,e),e=xB(t,e,n,s)),a=-13&kB(a,e),a=YB(r?-17&a:16|a,e,true),a!==o&&OF(s,a)}return s}function CB(t,e){var n=XW;return jB(OB(t=t.u),t,0|t[AF],n)===e?e:-1}function OB(t){if(xF)return t[EF]??(t[EF]=new Map);if(EF in t)return t[EF];const e=new Map;return Object.defineProperty(t,EF,{value:e}),e}function zB(t,e,n,r){const s=OB(t),i=jB(s,t,e,n);return i!==r&&(i&&(e=xB(t,e,i)),s.set(n,r)),e}function jB(t,e,n,r){let s=t.get(r);if(null!=s)return s;s=0;for(let t=0;t<r.length;t++){const i=r[t];null!=vB(e,n,i)&&(0!==s&&(n=xB(e,n,s)),s=i)}return t.set(r,s),s}function RB(t,e,n){let r=0|t[AF];const s=vB(t,r,n);let i;if(null!=s&&s.W===BF)return(e=wB(s))!==s&&xB(t,r,n,e),e.u;if(Array.isArray(s)){const t=0|s[AF];i=2&t?pB(gB(s,t,false),e,true):64&t?s:pB(i,e,true)}else i=pB(void 0,e,true);return i!==s&&xB(t,r,n,i),i}function $B(t,e,n){let r=0|(t=t.u)[AF];const s=vB(t,r,n);return(e=YP(s,e,false,r))!==s&&null!=e&&xB(t,r,n,e),e}function FB(t,e,n){if(null==(e=$B(t,e,n)))return e;let r=0|(t=t.u)[AF];if(!(2&r)){const s=wB(e);s!==e&&xB(t,r,n,e=s)}return e}function PB(t,e,n,r,s,i,o){t=t.u;var a=!!(2&e);const c=a?1:s;i=!!i,o&&=!a;var u=0|(s=DB(t,e,r))[AF];if(!(a=!!(4&u))){var f=s,l=e;const t=!!(2&(u=kB(u,e)));t&&(l|=2);let r=!t,i=true,o=0,a=0;for(;o<f.length;o++){const e=YP(f[o],n,false,l);if(e instanceof n){if(!t){const t=!!(2&(0|e.u[AF]));r&&=!t,i&&=t}f[a++]=e}}a<o&&(f.length=a),u|=4,u=i?16|u:-17&u,OF(f,u=r?8|u:-9&u),t&&Object.freeze(f)}if(o&&!(8&u||!s.length&&(1===c||4===c&&32&u))){for(TB(u)&&(s=FF(s),u=WB(u,e),e=xB(t,e,r,s)),n=s,o=u,f=0;f<n.length;f++)(u=n[f])!==(l=wB(u))&&(n[f]=l);o|=8,OF(n,o=n.length?-17&o:16|o),u=o}return 1===c||4===c&&32&u?TB(u)||(e=u,(u|=!s.length||16&u&&(!a||32&u)?2:1024)!==e&&OF(s,u),Object.freeze(s)):(2===c&&TB(u)&&(OF(s=FF(s),u=YB(u=WB(u,e),e,i)),e=xB(t,e,r,s)),TB(u)||(r=u,(u=YB(u,e,i))!==r&&OF(s,u))),s}function BB(t,e,n){const r=0|t.u[AF];return PB(t,r,e,n,SB(),false,!(2&r))}function GB(t,e,n,r){return null==r&&(r=void 0),NB(t,n,r)}function UB(t,e,n,r){null==r&&(r=void 0);t:{let s=0|(t=t.u)[AF];if(YF(s),null==r){const r=OB(t);if(jB(r,t,s,n)!==e)break t;r.set(n,0)}else s=zB(t,s,n,e);xB(t,s,e,r)}}function WB(t,e){return-1025&(t=32|(2&e?2|t:-3&t))}function YB(t,e,n){return 32&e&&n||(t&=-33),t}function VB(t,e,n){YF(0|t.u[AF]),EB(t,e,WP,2,true).push(GP(n))}function ZB(t,e,n,r){const s=0|t.u[AF];YF(s),t=PB(t,s,n,e,2,true),r=null!=r?r:new n,t.push(r),t[AF]=2&(0|r.u[AF])?-9&t[AF]:-17&t[AF]}function QB(t,e){return LP(bB(t,e))}function HB(t,e){return WP(bB(t,e))}function JB(t,e){return MB(t,e)??0}function qB(t,e,n){if(null!=n&&"boolean"!=typeof n)throw t=typeof n,Error(`Expected boolean but got ${"object"!=t?t:n?Array.isArray(n)?"array":t:"null"}: ${n}`);NB(t,e,n)}function XB(t,e,n){if(null!=n){if("number"!=typeof n)throw vF("int32");if(!IP(n))throw vF("int32");n|=0}NB(t,e,n)}function KB(t,e,n){if(null!=n&&"number"!=typeof n)throw Error(`Value of float/double field must be a number, found ${typeof n}: ${n}`);NB(t,e,n)}function tG(t,e,n){{const o=t.u;let a=0|o[AF];if(YF(a),null==n)xB(o,a,e);else{var r=t=0|n[AF],s=TB(t),i=s||Object.isFrozen(n);for(s||(t=0),i||(n=FF(n),r=0,t=YB(t=WB(t,a),a,true),i=false),t|=21,s=0;s<n.length;s++){const e=n[s],o=GP(e);Object.is(e,o)||(i&&(n=FF(n),r=0,t=YB(t=WB(t,a),a,true),i=false),n[s]=o)}t!==r&&(i&&(n=FF(n),t=YB(t=WB(t,a),a,true)),OF(n,t)),xB(o,a,e,n)}}}function eG(t,e){return Error(`Invalid wire type: ${t} (at position ${e})`)}function nG(){return Error("Failed to read varint, encoding is invalid.")}function rG(t,e){return Error(`Tried to read past the end of the data ${e} > ${t}`)}function sG(t){if("string"==typeof t)return{buffer:fF(t),O:false};if(Array.isArray(t))return{buffer:new Uint8Array(t),O:false};if(t.constructor===Uint8Array)return{buffer:t,O:false};if(t.constructor===ArrayBuffer)return{buffer:new Uint8Array(t),O:false};if(t.constructor===mF)return{buffer:pF(t)||new Uint8Array(0),O:true};if(t instanceof Uint8Array)return{buffer:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),O:false};throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, a ByteString or an Array of numbers")}function iG(t,e){let n,r=0,s=0,i=0;const o=t.h;let a=t.g;do{n=o[a++],r|=(127&n)<<i,i+=7}while(i<32&&128&n);for(i>32&&(s|=(127&n)>>4),i=3;i<32&&128&n;i+=7)n=o[a++],s|=(127&n)<<i;if(dG(t,a),n<128)return e(r>>>0,s>>>0);throw nG()}function oG(t){let e=0,n=t.g;const r=n+10,s=t.h;for(;n<r;){const r=s[n++];if(e|=r,0==(128&r))return dG(t,n),!!(127&e)}throw nG()}function aG(t){const e=t.h;let n=t.g,r=e[n++],s=127&r;if(128&r&&(r=e[n++],s|=(127&r)<<7,128&r&&(r=e[n++],s|=(127&r)<<14,128&r&&(r=e[n++],s|=(127&r)<<21,128&r&&(r=e[n++],s|=r<<28,128&r&&128&e[n++]&&128&e[n++]&&128&e[n++]&&128&e[n++]&&128&e[n++])))))throw nG();return dG(t,n),s}function cG(t){return aG(t)>>>0}function uG(t){var e=t.h;const n=t.g,r=e[n],s=e[n+1],i=e[n+2];return e=e[n+3],dG(t,t.g+4),(r<<0|s<<8|i<<16|e<<24)>>>0}function fG(t){var e=uG(t);t=2*(e>>31)+1;const n=e>>>23&255;return e&=8388607,255==n?e?NaN:t*(1/0):0==n?1401298464324817e-60*t*e:t*Math.pow(2,n-150)*(e+8388608)}function lG(t){return aG(t)}function hG(t,e,{aa:n=false}={}){t.aa=n,e&&(e=sG(e),t.h=e.buffer,t.m=e.O,t.j=0,t.l=t.h.length,t.g=t.j)}function dG(t,e){if(t.g=e,e>t.l)throw rG(t.l,e)}function pG(t,e){if(e<0)throw Error(`Tried to read a negative byte length: ${e}`);const n=t.g,r=n+e;if(r>t.l)throw rG(e,t.l-n);return t.g=r,n}function mG(t,e){if(0==e)return dF();var n=pG(t,e);return t.aa&&t.m?n=t.h.subarray(n,n+e):(t=t.h,n=n===(e=n+e)?new Uint8Array(0):aP?t.slice(n,e):new Uint8Array(t.subarray(n,e))),0==n.length?dF():new mF(n,hF)}tB.prototype.toJSON=void 0;var yG=[];function gG(t){var e=t.g;if(e.g==e.l)return false;t.l=t.g.g;var n=cG(t.g);if(e=n>>>3,!((n&=7)>=0&&n<=5))throw eG(n,t.l);if(e<1)throw Error(`Invalid field number: ${e} (at position ${t.l})`);return t.m=e,t.h=n,true}function wG(t){switch(t.h){case 0:0!=t.h?wG(t):oG(t.g);break;case 1:dG(t=t.g,t.g+8);break;case 2:if(2!=t.h)wG(t);else{var e=cG(t.g);dG(t=t.g,t.g+e)}break;case 5:dG(t=t.g,t.g+4);break;case 3:for(e=t.m;;){if(!gG(t))throw Error("Unmatched start-group tag: stream EOF");if(4==t.h){if(t.m!=e)throw Error("Unmatched end-group tag");break}wG(t)}break;default:throw eG(t.h,t.l)}}function bG(t,e,n){const r=t.g.l,s=cG(t.g),i=t.g.g+s;let o=i-r;if(o<=0&&(t.g.l=i,n(e,t,void 0,void 0,void 0),o=i-t.g.g),o)throw Error(`Message parsing ended unexpectedly. Expected to read ${s} bytes, instead read ${s-o} bytes, either the data ended unexpectedly or the message misreported its own length`);return t.g.g=i,t.g.l=r,e}function vG(t){var e=cG(t.g),n=pG(t=t.g,e);if(t=t.h,j$){var r,s=t;(r=z$)||(r=z$=new TextDecoder("utf-8",{fatal:true})),e=n+e,s=0===n&&e===s.length?s:s.subarray(n,e);try{var i=r.decode(s)}catch(t){if(void 0===O$){try{r.decode(new Uint8Array([128]))}catch(t){}try{r.decode(new Uint8Array([97])),O$=true}catch(t){O$=false}}throw!O$&&(z$=void 0),t}}else{e=(i=n)+e,n=[];let a,c=null;for(;i<e;){var o=t[i++];o<128?n.push(o):o<224?i>=e?_$():(a=t[i++],o<194||128!=(192&a)?(i--,_$()):n.push((31&o)<<6|63&a)):o<240?i>=e-1?_$():(a=t[i++],128!=(192&a)||224===o&&a<160||237===o&&a>=160||128!=(192&(r=t[i++]))?(i--,_$()):n.push((15&o)<<12|(63&a)<<6|63&r)):o<=244?i>=e-2?_$():(a=t[i++],128!=(192&a)||a-144+(o<<28)>>30!=0||128!=(192&(r=t[i++]))||128!=(192&(s=t[i++]))?(i--,_$()):(o=(7&o)<<18|(63&a)<<12|(63&r)<<6|63&s,o-=65536,n.push(55296+(o>>10&1023),56320+(1023&o)))):_$(),n.length>=8192&&(c=C$(c,n),n.length=0)}i=C$(c,n)}return i}function NG(t){const e=cG(t.g);return mG(t.g,e)}function xG(t,e,n){var r=cG(t.g);for(r=t.g.g+r;t.g.g<r;)n.push(e(t.g))}var MG=[];function IG(t,e,n){e.g?e.m(t,e.g,e.h,n):e.m(t,e.h,n)}var SG=class{constructor(t,e){this.u=mB(t,e)}toJSON(){try{var t=dB(this)}finally{iB=void 0}return t}l(){var t=ZY;return t.g?t.l(this,t.g,t.h):t.l(this,t.h,t.defaultValue)}clone(){const t=this.u;return new this.constructor(gB(t,0|t[AF],false))}O(){return!!(2&(0|this.u[AF]))}};function EG(t){return t?/^\d+$/.test(t)?(bP(t),new DG(uP,fP)):null:kG||=new DG(0,0)}SG.prototype.W=BF,SG.prototype.toString=function(){return this.u.toString()};var DG=class{constructor(t,e){this.h=t>>>0,this.g=e>>>0}};let kG;function TG(t){return t?/^-?\d+$/.test(t)?(bP(t),new AG(uP,fP)):null:LG||=new AG(0,0)}var AG=class{constructor(t,e){this.h=t>>>0,this.g=e>>>0}};let LG;function _G(t,e,n){for(;n>0||e>127;)t.g.push(127&e|128),e=(e>>>7|n<<25)>>>0,n>>>=7;t.g.push(e)}function CG(t,e){for(;e>127;)t.g.push(127&e|128),e>>>=7;t.g.push(e)}function OG(t,e){if(e>=0)CG(t,e);else{for(let n=0;n<9;n++)t.g.push(127&e|128),e>>=7;t.g.push(1)}}function zG(t,e){t.g.push(e>>>0&255),t.g.push(e>>>8&255),t.g.push(e>>>16&255),t.g.push(e>>>24&255)}function jG(t,e){0!==e.length&&(t.l.push(e),t.h+=e.length)}function RG(t,e,n){CG(t.g,8*e+n)}function $G(t,e){return RG(t,e,2),e=t.g.end(),jG(t,e),e.push(t.h),e}function FG(t,e){var n=e.pop();for(n=t.h+t.g.length()-n;n>127;)e.push(127&n|128),n>>>=7,t.h++;e.push(n),t.h++}function PG(t,e,n){RG(t,e,2),CG(t.g,n.length),jG(t,t.g.end()),jG(t,n)}function BG(t,e,n,r){null!=n&&(e=$G(t,e),r(n,t),FG(t,e))}function GG(){const t=class{constructor(){throw Error()}};return Object.setPrototypeOf(t,t.prototype),t}var UG=GG(),WG=GG(),YG=GG(),VG=GG(),ZG=GG(),QG=GG(),HG=GG(),JG=GG(),qG=GG(),XG=class{constructor(t,e,n){this.g=t,this.h=e,t=UG,this.l=!!t&&n===t||false}};function KG(t,e){return new XG(t,e,UG)}function tU(t,e,n,r,s){BG(t,n,lU(e,r),s)}const eU=KG((function(t,e,n,r,s){return 2===t.h&&(bG(t,RB(e,r,n),s),true)}),tU),nU=KG((function(t,e,n,r,s){return 2===t.h&&(bG(t,RB(e,r,n),s),true)}),tU);var rU=Symbol(),sU=Symbol(),iU=Symbol(),oU=Symbol();let aU,cU;function uU(t,e,n,r){var s=r[t];if(s)return s;(s={}).Ma=r,s.T=function(t){switch(typeof t){case"boolean":return oB||=[0,void 0,true];case"number":return t>0?void 0:0===t?aB||=[0,void 0]:[-t,void 0];case"string":return[0,t];case"object":return t}}(r[0]);var i=r[1];let o=1;i&&i.constructor===Object&&(s.ga=i,"function"==typeof(i=r[++o])&&(s.la=true,aU??=i,cU??=r[o+1],i=r[o+=2]));const a={};for(;i&&Array.isArray(i)&&i.length&&"number"==typeof i[0]&&i[0]>0;){for(var c=0;c<i.length;c++)a[i[c]]=i;i=r[++o]}for(c=1;void 0!==i;){let t;"number"==typeof i&&(c+=i,i=r[++o]);var u=void 0;if(i instanceof XG?t=i:(t=eU,o--),t?.l){i=r[++o],u=r;var f=o;"function"==typeof i&&(i=i(),u[f]=i),u=i}for(f=c+1,"number"==typeof(i=r[++o])&&i<0&&(f-=i,i=r[++o]);c<f;c++){const r=a[c];u?n(s,c,t,u,r):e(s,c,t,r)}}return r[t]=s}function fU(t){return Array.isArray(t)?t[0]instanceof XG?t:[nU,t]:[t,void 0]}function lU(t,e){return t instanceof SG?t.u:Array.isArray(t)?pB(t,e,false):void 0}function hU(t,e,n,r){const s=n.g;t[e]=r?(t,e,n)=>s(t,e,n,r):s}function dU(t,e,n,r,s){const i=n.g;let o,a;t[e]=(t,e,n)=>i(t,e,n,a||=uU(sU,hU,dU,r).T,o||=pU(r),s)}function pU(t){let e=t[iU];if(null!=e)return e;const n=uU(sU,hU,dU,t);return e=n.la?(t,e)=>aU(t,e,n):(t,e)=>{const r=0|t[AF];for(;gG(e)&&4!=e.h;){var s=e.m,i=n[s];if(null==i){var o=n.ga;o&&(o=o[s])&&(null!=(o=mU(o))&&(i=n[s]=o))}null!=i&&i(e,t,s)||(s=(i=e).l,wG(i),i.fa?i=void 0:(o=i.g.g-s,i.g.g=s,i=mG(i.g,o)),s=t,i&&((o=s[DF])?o.push(i):s[DF]=[i]))}return 8192&r&&zF(t),true},t[iU]=e}function mU(t){const e=(t=fU(t))[0].g;if(t=t[1]){const n=pU(t),r=uU(sU,hU,dU,t).T;return(t,s,i)=>e(t,s,i,r,n)}return e}function yU(t,e,n){t[e]=n.h}function gU(t,e,n,r){let s,i;const o=n.h;t[e]=(t,e,n)=>o(t,e,n,i||=uU(rU,yU,gU,r).T,s||=wU(r))}function wU(t){let e=t[oU];if(!e){const n=uU(rU,yU,gU,t);e=(t,e)=>bU(t,e,n),t[oU]=e}return e}function bU(t,e,n){!function(t,e,n){const r=512&e?0:-1,s=t.length,i=s+((e=64&e?256&e:!!s&&GF(t[s-1]))?-1:0);for(let e=0;e<i;e++)n(e-r,t[e]);if(e){t=t[s-1];for(const e in t)!isNaN(e)&&n(+e,t[e])}}(t,0|t[AF]|(n.T[1]?512:0),((t,r)=>{if(null!=r){var s=function(t,e){var n=t[e];if(n)return n;if((n=t.ga)&&(n=n[e])){var r=(n=fU(n))[0].h;if(n=n[1]){const e=wU(n),s=uU(rU,yU,gU,n).T;n=t.la?cU(s,e):(t,n,i)=>r(t,n,i,s,e)}else n=r;return t[e]=n}}(n,t);s&&s(e,r,t)}})),(t=ZF(t))&&function(t,e){jG(t,t.g.end());for(let n=0;n<e.length;n++)jG(t,pF(e[n])||new Uint8Array(0))}(e,t)}function vU(t,e){if(Array.isArray(e)){var n=0|e[AF];if(4&n)return e;for(var r=0,s=0;r<e.length;r++){const n=t(e[r]);null!=n&&(e[s++]=n)}return s<r&&(e.length=s),OF(e,-6145&(5|n)),2&n&&Object.freeze(e),e}}function NU(t,e,n){return new XG(t,e,n)}function xU(t,e,n){return new XG(t,e,n)}function MU(t,e,n){xB(t,0|t[AF],e,n)}var IU=KG((function(t,e,n,r,s){return 2===t.h&&(t=bG(t,pB([void 0,void 0],r,true),s),YF(r=0|e[AF]),(s=vB(e,r,n))instanceof tB?0!=(2&s.M)?((s=s.da()).push(t),xB(e,r,n,s)):s.Ja(t):Array.isArray(s)?(2&(0|s[AF])&&xB(e,r,n,s=AB(s)),s.push(t)):xB(e,r,n,[t]),true)}),(function(t,e,n,r,s){if(e instanceof tB)e.forEach(((e,i)=>{BG(t,n,pB([i,e],r,false),s)}));else if(Array.isArray(e))for(let i=0;i<e.length;i++){const o=e[i];Array.isArray(o)&&BG(t,n,pB(o,r,false),s)}}));function SU(t,e,n){if(e=function(t){if(null==t)return t;const e=typeof t;if("bigint"===e)return String(NP(64,t));if(AP(t)){if("string"===e)return RP(t);if("number"===e)return jP(t)}}(e),null!=e){if("string"==typeof e)TG(e);if(null!=e)switch(RG(t,n,0),typeof e){case"number":t=t.g,hP(e),_G(t,uP,fP);break;case"bigint":n=BigInt.asUintN(64,e),n=new AG(Number(n&BigInt(4294967295)),Number(n>>BigInt(32))),_G(t.g,n.h,n.g);break;default:n=TG(e),_G(t.g,n.h,n.g)}}}function EU(t,e,n){null!=(e=LP(e))&&null!=e&&(RG(t,n,0),OG(t.g,e))}function DU(t,e,n){null!=(e=kP(e))&&(RG(t,n,0),t.g.g.push(e?1:0))}function kU(t,e,n){null!=(e=WP(e))&&PG(t,n,F$(e))}function TU(t,e,n,r,s){BG(t,n,lU(e,r),s)}function AU(t,e,n){null==e||"string"==typeof e||e instanceof mF||(lF(e)?lF(e)&&NF(TF):e=void 0),null!=e&&PG(t,n,sG(e).buffer)}function LU(t,e,n){return(5===t.h||2===t.h)&&(e=_B(e,0|e[AF],n,false),2==t.h?xG(t,fG,e):e.push(fG(t.g)),true)}var _U=NU((function(t,e,n){if(1!==t.h)return false;var r=t.g;t=uG(r);const s=uG(r);r=2*(s>>31)+1;const i=s>>>20&2047;return t=4294967296*(1048575&s)+t,MU(e,n,2047==i?t?NaN:r*(1/0):0==i?5e-324*r*t:r*Math.pow(2,i-1075)*(t+4503599627370496)),true}),(function(t,e,n){null!=(e=DP(e))&&(RG(t,n,1),t=t.g,(n=cP||=new DataView(new ArrayBuffer(8))).setFloat64(0,+e,true),uP=n.getUint32(0,true),fP=n.getUint32(4,true),zG(t,uP),zG(t,fP))}),GG()),CU=NU((function(t,e,n){return 5===t.h&&(MU(e,n,fG(t.g)),true)}),(function(t,e,n){null!=(e=DP(e))&&(RG(t,n,5),t=t.g,dP(e),zG(t,uP))}),HG),OU=xU(LU,(function(t,e,n){if(null!=(e=vU(DP,e)))for(let o=0;o<e.length;o++){var r=t,s=n,i=e[o];null!=i&&(RG(r,s,5),r=r.g,dP(i),zG(r,uP))}}),HG),zU=xU(LU,(function(t,e,n){if(null!=(e=vU(DP,e))&&e.length){RG(t,n,2),CG(t.g,4*e.length);for(let r=0;r<e.length;r++)n=t.g,dP(e[r]),zG(n,uP)}}),HG),jU=NU((function(t,e,n){return 0===t.h&&(MU(e,n,iG(t.g,mP)),true)}),SU,QG),RU=NU((function(t,e,n){return 0===t.h&&(MU(e,n,0===(t=iG(t.g,mP))?void 0:t),true)}),SU,QG),$U=NU((function(t,e,n){return 0===t.h&&(MU(e,n,iG(t.g,pP)),true)}),(function(t,e,n){if(null!=(e=BP(e))){if("string"==typeof e)EG(e);if(null!=e)switch(RG(t,n,0),typeof e){case"number":t=t.g,hP(e),_G(t,uP,fP);break;case"bigint":n=BigInt.asUintN(64,e),n=new DG(Number(n&BigInt(4294967295)),Number(n>>BigInt(32))),_G(t.g,n.h,n.g);break;default:n=EG(e),_G(t.g,n.h,n.g)}}}),GG()),FU=NU((function(t,e,n){return 0===t.h&&(MU(e,n,aG(t.g)),true)}),EU,VG),PU=xU((function(t,e,n){return(0===t.h||2===t.h)&&(e=_B(e,0|e[AF],n,false),2==t.h?xG(t,aG,e):e.push(aG(t.g)),true)}),(function(t,e,n){if(null!=(e=vU(LP,e))&&e.length){n=$G(t,n);for(let n=0;n<e.length;n++)OG(t.g,e[n]);FG(t,n)}}),VG),BU=NU((function(t,e,n){return 0===t.h&&(MU(e,n,0===(t=aG(t.g))?void 0:t),true)}),EU,VG),GU=NU((function(t,e,n){return 0===t.h&&(MU(e,n,oG(t.g)),true)}),DU,WG),UU=NU((function(t,e,n){return 0===t.h&&(MU(e,n,false===(t=oG(t.g))?void 0:t),true)}),DU,WG),WU=xU((function(t,e,n){return 2===t.h&&(t=vG(t),_B(e,0|e[AF],n,false).push(t),true)}),(function(t,e,n){if(null!=(e=vU(WP,e)))for(let o=0;o<e.length;o++){var r=t,s=n,i=e[o];null!=i&&PG(r,s,F$(i))}}),YG),YU=NU((function(t,e,n){return 2===t.h&&(MU(e,n,""===(t=vG(t))?void 0:t),true)}),kU,YG),VU=NU((function(t,e,n){return 2===t.h&&(MU(e,n,vG(t)),true)}),kU,YG),ZU=function(t,e,n=UG){return new XG(t,e,n)}((function(t,e,n,r,s){return 2===t.h&&(r=pB(void 0,r,true),_B(e,0|e[AF],n,true).push(r),bG(t,r,s),true)}),(function(t,e,n,r,s){if(Array.isArray(e))for(let i=0;i<e.length;i++)TU(t,e[i],n,r,s)})),QU=KG((function(t,e,n,r,s,i){return 2===t.h&&(zB(e,0|e[AF],i,n),bG(t,e=RB(e,r,n),s),true)}),TU),HU=NU((function(t,e,n){return 2===t.h&&(MU(e,n,NG(t)),true)}),AU,JG),JU=xU((function(t,e,n){return(0===t.h||2===t.h)&&(e=_B(e,0|e[AF],n,false),2==t.h?xG(t,cG,e):e.push(cG(t.g)),true)}),(function(t,e,n){if(null!=(e=vU(_P,e)))for(let o=0;o<e.length;o++){var r=t,s=n,i=e[o];null!=i&&(RG(r,s,0),CG(r.g,i))}}),ZG),qU=NU((function(t,e,n){return 0===t.h&&(MU(e,n,0===(t=cG(t.g))?void 0:t),true)}),(function(t,e,n){null!=(e=_P(e))&&null!=e&&(RG(t,n,0),CG(t.g,e))}),ZG),XU=NU((function(t,e,n){return 0===t.h&&(MU(e,n,aG(t.g)),true)}),(function(t,e,n){null!=(e=LP(e))&&(e=parseInt(e,10),RG(t,n,0),OG(t.g,e))}),qG);class KU{constructor(t,e){this.h=t,this.g=e,this.l=FB,this.m=GB,this.defaultValue=void 0}register(){X$(this)}}function tW(t,e){return new KU(t,e)}function eW(t,e){return(n,r)=>{if(MG.length){const t=MG.pop();t.o(r),hG(t.g,n,r),n=t}else n=new class{constructor(t,e){if(yG.length){const n=yG.pop();hG(n,t,e),t=n}else t=new class{constructor(t,e){this.h=null,this.m=false,this.g=this.l=this.j=0,hG(this,t,e)}clear(){this.h=null,this.m=false,this.g=this.l=this.j=0,this.aa=false}}(t,e);this.g=t,this.l=this.g.g,this.h=this.m=-1,this.o(e)}o({fa:t=false}={}){this.fa=t}}(n,r);try{const r=new t,i=r.u;pU(e)(i,n);var s=r}finally{n.g.clear(),n.m=-1,n.h=-1,MG.length<100&&MG.push(n)}return s}}function nW(t){return function(){const e=new class{constructor(){this.l=[],this.h=0,this.g=new class{constructor(){this.g=[]}length(){return this.g.length}end(){const t=this.g;return this.g=[],t}}}};bU(this.u,e,uU(rU,yU,gU,t)),jG(e,e.g.end());const n=new Uint8Array(e.h),r=e.l,s=r.length;let i=0;for(let t=0;t<s;t++){const e=r[t];n.set(e,i),i+=e.length}return e.l=[n],n}}var rW=class extends SG{constructor(t){super(t)}},sW=[0,YU,NU((function(t,e,n){return 2===t.h&&(MU(e,n,(t=NG(t))===dF()?void 0:t),true)}),(function(t,e,n){if(null!=e){if(e instanceof SG){const r=e.Oa;return void(r&&(e=r(e),null!=e&&PG(t,n,sG(e).buffer)))}if(Array.isArray(e))return}AU(t,e,n)}),JG)];let iW,oW=globalThis.trustedTypes;function aW(t){void 0===iW&&(iW=function(){let t=null;if(!oW)return t;try{const e=t=>t;t=oW.createPolicy("goog#html",{createHTML:e,createScript:e,createScriptURL:e})}catch(t){}return t}());var e=iW;return new class{constructor(t){this.g=t}toString(){return this.g+""}}(e?e.createScriptURL(t):t)}function cW(t,...e){if(0===e.length)return aW(t[0]);let n=t[0];for(let r=0;r<e.length;r++)n+=encodeURIComponent(e[r])+t[r+1];return aW(n)}var uW=[0,FU,XU,GU,-1,PU,XU,-1],fW=class extends SG{constructor(t){super(t)}},lW=[0,GU,VU,GU,XU,-1,xU((function(t,e,n){return(0===t.h||2===t.h)&&(e=_B(e,0|e[AF],n,false),2==t.h?xG(t,lG,e):e.push(aG(t.g)),true)}),(function(t,e,n){if(null!=(e=vU(LP,e))&&e.length){n=$G(t,n);for(let n=0;n<e.length;n++)OG(t.g,e[n]);FG(t,n)}}),qG),VU,-1,[0,GU,-1],XU,GU,-1],hW=[0,VU,-2],dW=class extends SG{constructor(t){super(t)}},pW=[0],mW=[0,FU,GU,1,GU,-3],yW=class extends SG{constructor(t){super(t,2)}},gW={};gW[336783863]=[0,VU,GU,-1,FU,[0,[1,2,3,4,5,6,7,8,9],QU,pW,QU,lW,QU,hW,QU,mW,QU,uW,QU,[0,VU,-2],QU,[0,VU,XU],QU,[0,XU,VU,-1],QU,[0,XU,-1]],[0,VU],GU,[0,[1,3],[2,4],QU,[0,PU],-1,QU,[0,WU],-1,ZU,[0,VU,-1]],VU];var wW=[0,RU,-1,UU,-3,RU,PU,YU,BU,RU,-1,UU,BU,UU,-2,YU];function bW(t,e){LB(t,2,UP(e),"")}function vW(t,e){VB(t,3,e)}function NW(t,e){VB(t,4,e)}var xW=class extends SG{constructor(t){super(t,500)}o(t){return GB(this,0,7,t)}},MW=[-1,{}],IW=[0,VU,1,MW],SW=[0,VU,WU,MW];function EW(t,e){ZB(t,1,xW,e)}function DW(t,e){VB(t,10,e)}function kW(t,e){VB(t,15,e)}var TW=class extends SG{constructor(t){super(t,500)}o(t){return GB(this,0,1001,t)}},AW=[-500,ZU,[-500,YU,-1,WU,-3,[-2,gW,GU],ZU,sW,BU,-1,IW,SW,ZU,[0,YU,UU],YU,wW,BU,WU,987,WU],4,ZU,[-500,VU,-1,[-1,{}],998,VU],ZU,[-500,VU,WU,-1,[-2,{},GU],997,WU,-1],BU,ZU,[-500,VU,WU,MW,998,WU],WU,BU,IW,SW,ZU,[0,YU,-1,MW],WU,-2,wW,YU,-1,UU,[0,UU,qU],978,MW,ZU,sW];TW.prototype.g=nW(AW);var LW=eW(TW,AW),_W=class extends SG{constructor(t){super(t)}},CW=class extends SG{constructor(t){super(t)}g(){return BB(this,_W,1)}},OW=[0,ZU,[0,FU,CU,VU,-1]],zW=eW(CW,OW),jW=class extends SG{constructor(t){super(t)}},RW=class extends SG{constructor(t){super(t)}},$W=class extends SG{constructor(t){super(t)}h(){return FB(this,jW,2)}g(){return BB(this,RW,5)}},FW=eW(class extends SG{constructor(t){super(t)}},[0,WU,PU,zU,[0,XU,[0,FU,-3],[0,CU,-3],[0,FU,-1,[0,ZU,[0,FU,-2]]],ZU,[0,CU,-1,VU,CU]],VU,-1,jU,ZU,[0,FU,CU],WU,jU]),PW=class extends SG{constructor(t){super(t)}},BW=eW(class extends SG{constructor(t){super(t)}},[0,ZU,[0,CU,-4]]),GW=class extends SG{constructor(t){super(t)}},UW=eW(class extends SG{constructor(t){super(t)}},[0,ZU,[0,CU,-4]]),WW=class extends SG{constructor(t){super(t)}},YW=[0,FU,-1,zU,XU],VW=class extends SG{constructor(t){super(t)}};VW.prototype.g=nW([0,CU,-4,jU]);var ZW=class extends SG{constructor(t){super(t)}},QW=eW(class extends SG{constructor(t){super(t)}},[0,ZU,[0,1,FU,VU,OW],jU]),HW=class extends SG{constructor(t){super(t)}},JW=class extends SG{constructor(t){super(t)}ma(){const t=IB(this);return null==t?dF():t}},qW=class extends SG{constructor(t){super(t)}},XW=[1,2],KW=eW(class extends SG{constructor(t){super(t)}},[0,ZU,[0,XW,QU,[0,zU],QU,[0,HU],FU,VU],jU]),tY=class extends SG{constructor(t){super(t)}},eY=[0,VU,FU,CU,WU,-1],nY=class extends SG{constructor(t){super(t)}},rY=[0,GU,-1],sY=class extends SG{constructor(t){super(t)}},iY=[1,2,3,4,5],oY=class extends SG{constructor(t){super(t)}g(){return null!=IB(this)}h(){return null!=HB(this,2)}},aY=class extends SG{constructor(t){super(t)}g(){return kP(bB(this,2))??false}},cY=[0,HU,VU,[0,FU,jU,-1],[0,$U,jU]],uY=[0,cY,GU,[0,iY,QU,mW,QU,lW,QU,uW,QU,pW,QU,hW],XU],fY=class extends SG{constructor(t){super(t)}},lY=[0,uY,CU,-1,FU],hY=tW(502141897,fY);gW[502141897]=lY;var dY=eW(class extends SG{constructor(t){super(t)}},[0,[0,XU,-1,OU,JU],YW]),pY=class extends SG{constructor(t){super(t)}},mY=class extends SG{constructor(t){super(t)}},yY=[0,uY,CU,[0,uY],GU],gY=[0,uY,lY,yY,CU,[0,[0,cY]]],wY=tW(508968150,mY);gW[508968150]=gY,gW[508968149]=yY;var bY=class extends SG{constructor(t){super(t)}},vY=tW(513916220,bY);gW[513916220]=[0,uY,gY,FU];var NY=class extends SG{constructor(t){super(t)}h(){return FB(this,tY,2)}g(){NB(this,2)}},xY=[0,uY,eY];gW[478825465]=xY;var MY=class extends SG{constructor(t){super(t)}},IY=class extends SG{constructor(t){super(t)}},SY=class extends SG{constructor(t){super(t)}},EY=class extends SG{constructor(t){super(t)}},DY=class extends SG{constructor(t){super(t)}},kY=[0,uY,[0,uY],xY,-1],TY=[0,uY,CU,FU],AY=[0,uY,CU],LY=[0,uY,TY,AY,CU],_Y=tW(479097054,DY);gW[479097054]=[0,uY,LY,kY],gW[463370452]=kY,gW[464864288]=TY;var CY=tW(462713202,EY);gW[462713202]=LY,gW[474472470]=AY;var OY=class extends SG{constructor(t){super(t)}},zY=class extends SG{constructor(t){super(t)}},jY=class extends SG{constructor(t){super(t)}},RY=class extends SG{constructor(t){super(t)}},$Y=[0,uY,CU,-1,FU],FY=[0,uY,CU,GU];RY.prototype.g=nW([0,uY,AY,[0,uY],lY,yY,$Y,FY]);var PY=class extends SG{constructor(t){super(t)}},BY=tW(456383383,PY);gW[456383383]=[0,uY,eY];var GY=class extends SG{constructor(t){super(t)}},UY=tW(476348187,GY);gW[476348187]=[0,uY,rY];var WY=class extends SG{constructor(t){super(t)}},YY=class extends SG{constructor(t){super(t)}},VY=[0,XU,-1],ZY=tW(458105876,class extends SG{constructor(t){super(t)}g(){var t=this.u;const e=0|t[AF],n=2&e;return t=function(t,e,n){var r=YY;const s=2&e;let i=false;if(null==n){if(s)return cB();n=[]}else if(n.constructor===tB){if(0==(2&n.M)||s)return n;n=n.da()}else Array.isArray(n)?i=!!(2&(0|n[AF])):n=[];if(s){if(!n.length)return cB();i||(i=true,zF(n))}else i&&(i=false,n=AB(n));return i||(64&(0|n[AF])?n[AF]&=-33:32&e&&CF(n,32)),xB(t,e,2,r=new tB(n,r,VP,void 0)),r}(t,e,vB(t,e,2)),!n&&YY&&(t.pa=true),t}});gW[458105876]=[0,VY,IU,[true,jU,[0,VU,-1,WU]]];var QY=class extends SG{constructor(t){super(t)}},HY=tW(458105758,QY);gW[458105758]=[0,uY,VU,VY];var JY=class extends SG{constructor(t){super(t)}},qY=tW(443442058,JY);gW[443442058]=[0,uY,VU,FU,CU,WU,-1,GU,CU],gW[514774813]=$Y;var XY=class extends SG{constructor(t){super(t)}},KY=tW(516587230,XY);function tV(t,e){return e=e?e.clone():new tY,void 0!==t.displayNamesLocale?NB(e,1,UP(t.displayNamesLocale)):void 0===t.displayNamesLocale&&NB(e,1),void 0!==t.maxResults?XB(e,2,t.maxResults):"maxResults"in t&&NB(e,2),void 0!==t.scoreThreshold?KB(e,3,t.scoreThreshold):"scoreThreshold"in t&&NB(e,3),void 0!==t.categoryAllowlist?tG(e,4,t.categoryAllowlist):"categoryAllowlist"in t&&NB(e,4),void 0!==t.categoryDenylist?tG(e,5,t.categoryDenylist):"categoryDenylist"in t&&NB(e,5),e}function eV(t,e=-1,n=""){return{categories:t.map((t=>({index:QB(t,1)??0??-1,score:JB(t,2)??0,categoryName:HB(t,3)??""??"",displayName:HB(t,4)??""??""}))),headIndex:e,headName:n}}function nV(t){var e=EB(t,3,DP,SB()),n=EB(t,2,LP,SB()),r=EB(t,1,WP,SB()),s=EB(t,9,WP,SB());const i={categories:[],keypoints:[]};for(let t=0;t<e.length;t++)i.categories.push({score:e[t],index:n[t]??-1,categoryName:r[t]??"",displayName:s[t]??""});if((e=FB(t,$W,4)?.h())&&(i.boundingBox={originX:QB(e,1)??0,originY:QB(e,2)??0,width:QB(e,3)??0,height:QB(e,4)??0,angle:0}),FB(t,$W,4)?.g().length)for(const e of FB(t,$W,4).g())i.keypoints.push({x:MB(e,1)??0,y:MB(e,2)??0,score:MB(e,4)??0,label:HB(e,3)??""});return i}function rV(t){const e=[];for(const n of BB(t,GW,1))e.push({x:JB(n,1)??0,y:JB(n,2)??0,z:JB(n,3)??0,visibility:JB(n,4)??0});return e}function sV(t){const e=[];for(const n of BB(t,PW,1))e.push({x:JB(n,1)??0,y:JB(n,2)??0,z:JB(n,3)??0,visibility:JB(n,4)??0});return e}function iV(t){return Array.from(t,(t=>t>127?t-256:t))}function oV(t,e){if(t.length!==e.length)throw Error(`Cannot compute cosine similarity between embeddings of different sizes (${t.length} vs. ${e.length}).`);let n=0,r=0,s=0;for(let i=0;i<t.length;i++)n+=t[i]*e[i],r+=t[i]*t[i],s+=e[i]*e[i];if(r<=0||s<=0)throw Error("Cannot compute cosine similarity on embedding with 0 norm.");return n/Math.sqrt(r*s)}let aV;gW[516587230]=[0,uY,$Y,FY,CU],gW[518928384]=FY;const cV=new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]);async function uV(){if(void 0===aV)try{await WebAssembly.instantiate(cV),aV=true}catch{aV=false}return aV}async function fV(t,e=cW``){const n=await uV()?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${e}/${t}_${n}.js`,wasmBinaryPath:`${e}/${t}_${n}.wasm`}}var lV=class{};function hV(){var t=navigator;return"undefined"!=typeof OffscreenCanvas&&(!function(t=navigator){return(t=t.userAgent).includes("Safari")&&!t.includes("Chrome")}(t)||!!((t=t.userAgent.match(/Version\/([\d]+).*Safari/))&&t.length>=1&&Number(t[1])>=17))}async function dV(t){if("function"!=typeof importScripts){const e=document.createElement("script");return e.src=t.toString(),e.crossOrigin="anonymous",new Promise(((t,n)=>{e.addEventListener("load",(()=>{t()}),false),e.addEventListener("error",(t=>{n(t)}),false),document.body.appendChild(e)}))}importScripts(t.toString())}function pV(t){return void 0!==t.videoWidth?[t.videoWidth,t.videoHeight]:void 0!==t.naturalWidth?[t.naturalWidth,t.naturalHeight]:void 0!==t.displayWidth?[t.displayWidth,t.displayHeight]:[t.width,t.height]}function mV(t,e,n){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),n(e=t.i.stringToNewUTF8(e)),t.i._free(e)}function yV(t,e,n){if(!t.i.canvas)throw Error("No OpenGL canvas configured.");if(n?t.i._bindTextureToStream(n):t.i._bindTextureToCanvas(),!(n=t.i.canvas.getContext("webgl2")||t.i.canvas.getContext("webgl")))throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");t.i.gpuOriginForWebTexturesIsBottomLeft&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,true),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,e),t.i.gpuOriginForWebTexturesIsBottomLeft&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,false);const[r,s]=pV(e);return!t.l||r===t.i.canvas.width&&s===t.i.canvas.height||(t.i.canvas.width=r,t.i.canvas.height=s),[r,s]}function gV(t,e,n){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");const r=new Uint32Array(e.length);for(let n=0;n<e.length;n++)r[n]=t.i.stringToNewUTF8(e[n]);e=t.i._malloc(4*r.length),t.i.HEAPU32.set(r,e>>2),n(e);for(const e of r)t.i._free(e);t.i._free(e)}function wV(t,e,n){t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=n}function bV(t,e,n){let r=[];t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=(t,e,s)=>{e?(n(r,s),r=[]):r.push(t)}}lV.forVisionTasks=function(t){return fV("vision",t)},lV.forTextTasks=function(t){return fV("text",t)},lV.forGenAiExperimentalTasks=function(t){return fV("genai_experimental",t)},lV.forGenAiTasks=function(t){return fV("genai",t)},lV.forAudioTasks=function(t){return fV("audio",t)},lV.isSimdSupported=function(){return uV()};async function vV(t,e,n,r){return t=await(async(t,e,n,r,s)=>{if(e&&await dV(e),!self.ModuleFactory)throw Error("ModuleFactory not set.");if(n&&(await dV(n),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&s&&((e=self.Module).locateFile=s.locateFile,s.mainScriptUrlOrBlob&&(e.mainScriptUrlOrBlob=s.mainScriptUrlOrBlob)),s=await self.ModuleFactory(self.Module||s),self.ModuleFactory=self.Module=void 0,new t(s,r)})(t,n.wasmLoaderPath,n.assetLoaderPath,e,{locateFile:t=>t.endsWith(".wasm")?n.wasmBinaryPath.toString():n.assetBinaryPath&&t.endsWith(".data")?n.assetBinaryPath.toString():t}),await t.o(r),t}function NV(t,e){const n=FB(t.baseOptions,oY,1)||new oY;"string"==typeof e?(NB(n,2,UP(e)),NB(n,1)):e instanceof Uint8Array&&(NB(n,1,UF(e,false)),NB(n,2)),GB(t.baseOptions,0,1,n)}function xV(t){try{const e=t.G.length;if(1===e)throw Error(t.G[0].message);if(e>1)throw Error("Encountered multiple errors: "+t.G.map((t=>t.message)).join(", "))}finally{t.G=[]}}function MV(t,e){t.B=Math.max(t.B,e)}function IV(t,e){t.A=new xW,bW(t.A,"PassThroughCalculator"),vW(t.A,"free_memory"),NW(t.A,"free_memory_unused_out"),DW(e,"free_memory"),EW(e,t.A)}function SV(t,e){vW(t.A,e),NW(t.A,e+"_unused_out")}function EV(t){t.g.addBoolToStream(true,"free_memory",t.B)}var DV=class{constructor(t){this.g=t,this.G=[],this.B=0,this.g.setAutoRenderToScreen(false)}l(t,e=true){if(e){const e=t.baseOptions||{};if(t.baseOptions?.modelAssetBuffer&&t.baseOptions?.modelAssetPath)throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!(FB(this.baseOptions,oY,1)?.g()||FB(this.baseOptions,oY,1)?.h()||t.baseOptions?.modelAssetBuffer||t.baseOptions?.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if(function(t,e){let n=FB(t.baseOptions,sY,3);if(!n){var r=n=new sY,s=new dW;UB(r,4,iY,s)}"delegate"in e&&("GPU"===e.delegate?(e=n,r=new fW,UB(e,2,iY,r)):(e=n,r=new dW,UB(e,4,iY,r))),GB(t.baseOptions,0,3,n)}(this,e),e.modelAssetPath)return fetch(e.modelAssetPath.toString()).then((t=>{if(t.ok)return t.arrayBuffer();throw Error(`Failed to fetch model: ${e.modelAssetPath} (${t.status})`)})).then((t=>{try{this.g.i.FS_unlink("/model.dat")}catch{}this.g.i.FS_createDataFile("/","model.dat",new Uint8Array(t),true,false,false),NV(this,"/model.dat"),this.m(),this.J()}));if(e.modelAssetBuffer instanceof Uint8Array)NV(this,e.modelAssetBuffer);else if(e.modelAssetBuffer)return async function(t){const e=[];for(var n=0;;){const{done:r,value:s}=await t.read();if(r)break;e.push(s),n+=s.length}if(0===e.length)return new Uint8Array(0);if(1===e.length)return e[0];t=new Uint8Array(n),n=0;for(const r of e)t.set(r,n),n+=r.length;return t}(e.modelAssetBuffer).then((t=>{NV(this,t),this.m(),this.J()}))}return this.m(),this.J(),Promise.resolve()}J(){}ca(){let t;if(this.g.ca((e=>{t=LW(e)})),!t)throw Error("Failed to retrieve CalculatorGraphConfig");return t}setGraph(t,e){this.g.attachErrorListener(((t,e)=>{this.G.push(Error(e))})),this.g.Ha(),this.g.setGraph(t,e),this.A=void 0,xV(this)}finishProcessing(){this.g.finishProcessing(),xV(this)}close(){this.A=void 0,this.g.closeGraph()}};function kV(t,e){if(!t)throw Error(`Unable to obtain required WebGL resource: ${e}`);return t}DV.prototype.close=DV.prototype.close;class TV{constructor(t,e,n,r){this.g=t,this.h=e,this.m=n,this.l=r}bind(){this.g.bindVertexArray(this.h)}close(){this.g.deleteVertexArray(this.h),this.g.deleteBuffer(this.m),this.g.deleteBuffer(this.l)}}function AV(t,e,n){const r=t.g;if(n=kV(r.createShader(n),"Failed to create WebGL shader"),r.shaderSource(n,e),r.compileShader(n),!r.getShaderParameter(n,r.COMPILE_STATUS))throw Error(`Could not compile WebGL shader: ${r.getShaderInfoLog(n)}`);return r.attachShader(t.h,n),n}function LV(t,e){const n=t.g,r=kV(n.createVertexArray(),"Failed to create vertex array");n.bindVertexArray(r);const s=kV(n.createBuffer(),"Failed to create buffer");n.bindBuffer(n.ARRAY_BUFFER,s),n.enableVertexAttribArray(t.P),n.vertexAttribPointer(t.P,2,n.FLOAT,false,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),n.STATIC_DRAW);const i=kV(n.createBuffer(),"Failed to create buffer");return n.bindBuffer(n.ARRAY_BUFFER,i),n.enableVertexAttribArray(t.J),n.vertexAttribPointer(t.J,2,n.FLOAT,false,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array(e?[0,1,0,0,1,0,1,1]:[0,0,0,1,1,1,1,0]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),n.bindVertexArray(null),new TV(n,r,s,i)}function _V(t,e){if(t.g){if(e!==t.g)throw Error("Cannot change GL context once initialized")}else t.g=e}function CV(t,e,n,r){return _V(t,e),t.h||(t.m(),t.C()),n?(t.s||(t.s=LV(t,true)),n=t.s):(t.v||(t.v=LV(t,false)),n=t.v),e.useProgram(t.h),n.bind(),t.l(),t=r(),n.g.bindVertexArray(null),t}function OV(t,e,n){return _V(t,e),t=kV(e.createTexture(),"Failed to create texture"),e.bindTexture(e.TEXTURE_2D,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,n??e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,n??e.LINEAR),e.bindTexture(e.TEXTURE_2D,null),t}function zV(t,e,n){_V(t,e),t.A||(t.A=kV(e.createFramebuffer(),"Failed to create framebuffe.")),e.bindFramebuffer(e.FRAMEBUFFER,t.A),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,n,0)}function jV(t){t.g?.bindFramebuffer(t.g.FRAMEBUFFER,null)}var RV=class{G(){return"\n precision mediump float;\n varying vec2 vTex;\n uniform sampler2D inputTexture;\n void main() {\n gl_FragColor = texture2D(inputTexture, vTex);\n }\n "}m(){const t=this.g;if(this.h=kV(t.createProgram(),"Failed to create WebGL program"),this.Z=AV(this,"\n attribute vec2 aVertex;\n attribute vec2 aTex;\n varying vec2 vTex;\n void main(void) {\n gl_Position = vec4(aVertex, 0.0, 1.0);\n vTex = aTex;\n }",t.VERTEX_SHADER),this.Y=AV(this,this.G(),t.FRAGMENT_SHADER),t.linkProgram(this.h),!t.getProgramParameter(this.h,t.LINK_STATUS))throw Error(`Error during program linking: ${t.getProgramInfoLog(this.h)}`);this.P=t.getAttribLocation(this.h,"aVertex"),this.J=t.getAttribLocation(this.h,"aTex")}C(){}l(){}close(){if(this.h){const t=this.g;t.deleteProgram(this.h),t.deleteShader(this.Z),t.deleteShader(this.Y)}this.A&&this.g.deleteFramebuffer(this.A),this.v&&this.v.close(),this.s&&this.s.close()}};function $V(t,e){switch(e){case 0:return t.g.find((t=>t instanceof Uint8Array));case 1:return t.g.find((t=>t instanceof Float32Array));case 2:return t.g.find((t=>"undefined"!=typeof WebGLTexture&&t instanceof WebGLTexture));default:throw Error(`Type is not supported: ${e}`)}}function FV(t){var e=$V(t,1);if(!e){if(e=$V(t,0))e=new Float32Array(e).map((t=>t/255));else{e=new Float32Array(t.width*t.height);const r=BV(t);var n=UV(t);if(zV(n,r,PV(t)),"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"document"in self&&"ontouchend"in self.document){n=new Float32Array(t.width*t.height*4),r.readPixels(0,0,t.width,t.height,r.RGBA,r.FLOAT,n);for(let t=0,r=0;t<e.length;++t,r+=4)e[t]=n[r]}else r.readPixels(0,0,t.width,t.height,r.RED,r.FLOAT,e)}t.g.push(e)}return e}function PV(t){let e=$V(t,2);if(!e){const n=BV(t);e=WV(t);const r=FV(t),s=GV(t);n.texImage2D(n.TEXTURE_2D,0,s,t.width,t.height,0,n.RED,n.FLOAT,r),YV(t)}return e}function BV(t){if(!t.canvas)throw Error("Conversion to different image formats require that a canvas is passed when initializing the image.");return t.h||(t.h=kV(t.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),t.h}function GV(t){if(t=BV(t),!VV)if(t.getExtension("EXT_color_buffer_float")&&t.getExtension("OES_texture_float_linear")&&t.getExtension("EXT_float_blend"))VV=t.R32F;else{if(!t.getExtension("EXT_color_buffer_half_float"))throw Error("GPU does not fully support 4-channel float32 or float16 formats");VV=t.R16F}return VV}function UV(t){return t.l||(t.l=new RV),t.l}function WV(t){const e=BV(t);e.viewport(0,0,t.width,t.height),e.activeTexture(e.TEXTURE0);let n=$V(t,2);return n||(n=OV(UV(t),e,t.m?e.LINEAR:e.NEAREST),t.g.push(n),t.j=true),e.bindTexture(e.TEXTURE_2D,n),n}function YV(t){t.h.bindTexture(t.h.TEXTURE_2D,null)}var VV,ZV=class{constructor(t,e,n,r,s,i,o){this.g=t,this.m=e,this.j=n,this.canvas=r,this.l=s,this.width=i,this.height=o,this.j&&(0===--QV&&console.error("You seem to be creating MPMask instances without invoking .close(). This leaks resources."))}Da(){return!!$V(this,0)}ja(){return!!$V(this,1)}R(){return!!$V(this,2)}ia(){return(e=$V(t=this,0))||(e=FV(t),e=new Uint8Array(e.map((t=>255*t))),t.g.push(e)),e;var t,e}ha(){return FV(this)}N(){return PV(this)}clone(){const t=[];for(const e of this.g){let n;if(e instanceof Uint8Array)n=new Uint8Array(e);else if(e instanceof Float32Array)n=new Float32Array(e);else{if(!(e instanceof WebGLTexture))throw Error(`Type is not supported: ${e}`);{const t=BV(this),e=UV(this);t.activeTexture(t.TEXTURE1),n=OV(e,t,this.m?t.LINEAR:t.NEAREST),t.bindTexture(t.TEXTURE_2D,n);const r=GV(this);t.texImage2D(t.TEXTURE_2D,0,r,this.width,this.height,0,t.RED,t.FLOAT,null),t.bindTexture(t.TEXTURE_2D,null),zV(e,t,n),CV(e,t,false,(()=>{WV(this),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),t.drawArrays(t.TRIANGLE_FAN,0,4),YV(this)})),jV(e),YV(this)}}t.push(n)}return new ZV(t,this.m,this.R(),this.canvas,this.l,this.width,this.height)}close(){this.j&&BV(this).deleteTexture($V(this,2)),QV=-1}};ZV.prototype.close=ZV.prototype.close,ZV.prototype.clone=ZV.prototype.clone,ZV.prototype.getAsWebGLTexture=ZV.prototype.N,ZV.prototype.getAsFloat32Array=ZV.prototype.ha,ZV.prototype.getAsUint8Array=ZV.prototype.ia,ZV.prototype.hasWebGLTexture=ZV.prototype.R,ZV.prototype.hasFloat32Array=ZV.prototype.ja,ZV.prototype.hasUint8Array=ZV.prototype.Da;var QV=250;function HV(t,e){switch(e){case 0:return t.g.find((t=>t instanceof ImageData));case 1:return t.g.find((t=>"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap));case 2:return t.g.find((t=>"undefined"!=typeof WebGLTexture&&t instanceof WebGLTexture));default:throw Error(`Type is not supported: ${e}`)}}function JV(t){var e=HV(t,0);if(!e){e=XV(t);const n=KV(t),r=new Uint8Array(t.width*t.height*4);zV(n,e,qV(t)),e.readPixels(0,0,t.width,t.height,e.RGBA,e.UNSIGNED_BYTE,r),jV(n),e=new ImageData(new Uint8ClampedArray(r.buffer),t.width,t.height),t.g.push(e)}return e}function qV(t){let e=HV(t,2);if(!e){const n=XV(t);e=tZ(t);const r=HV(t,1)||JV(t);n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,r),eZ(t)}return e}function XV(t){if(!t.canvas)throw Error("Conversion to different image formats require that a canvas is passed when initializing the image.");return t.h||(t.h=kV(t.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),t.h}function KV(t){return t.l||(t.l=new RV),t.l}function tZ(t){const e=XV(t);e.viewport(0,0,t.width,t.height),e.activeTexture(e.TEXTURE0);let n=HV(t,2);return n||(n=OV(KV(t),e),t.g.push(n),t.m=true),e.bindTexture(e.TEXTURE_2D,n),n}function eZ(t){t.h.bindTexture(t.h.TEXTURE_2D,null)}function nZ(t){const e=XV(t);return CV(KV(t),e,true,(()=>function(t,e){const n=t.canvas;if(n.width===t.width&&n.height===t.height)return e();const r=n.width,s=n.height;return n.width=t.width,n.height=t.height,t=e(),n.width=r,n.height=s,t}(t,(()=>{if(e.bindFramebuffer(e.FRAMEBUFFER,null),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT),e.drawArrays(e.TRIANGLE_FAN,0,4),!(t.canvas instanceof OffscreenCanvas))throw Error("Conversion to ImageBitmap requires that the MediaPipe Tasks is initialized with an OffscreenCanvas");return t.canvas.transferToImageBitmap()}))))}var rZ=class{constructor(t,e,n,r,s,i,o){this.g=t,this.j=e,this.m=n,this.canvas=r,this.l=s,this.width=i,this.height=o,(this.j||this.m)&&(0===--sZ&&console.error("You seem to be creating MPImage instances without invoking .close(). This leaks resources."))}Ca(){return!!HV(this,0)}ka(){return!!HV(this,1)}R(){return!!HV(this,2)}Aa(){return JV(this)}za(){var t=HV(this,1);return t||(qV(this),tZ(this),t=nZ(this),eZ(this),this.g.push(t),this.j=true),t}N(){return qV(this)}clone(){const t=[];for(const e of this.g){let n;if(e instanceof ImageData)n=new ImageData(e.data,this.width,this.height);else if(e instanceof WebGLTexture){const t=XV(this),e=KV(this);t.activeTexture(t.TEXTURE1),n=OV(e,t),t.bindTexture(t.TEXTURE_2D,n),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.width,this.height,0,t.RGBA,t.UNSIGNED_BYTE,null),t.bindTexture(t.TEXTURE_2D,null),zV(e,t,n),CV(e,t,false,(()=>{tZ(this),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),t.drawArrays(t.TRIANGLE_FAN,0,4),eZ(this)})),jV(e),eZ(this)}else{if(!(e instanceof ImageBitmap))throw Error(`Type is not supported: ${e}`);qV(this),tZ(this),n=nZ(this),eZ(this)}t.push(n)}return new rZ(t,this.ka(),this.R(),this.canvas,this.l,this.width,this.height)}close(){this.j&&HV(this,1).close(),this.m&&XV(this).deleteTexture(HV(this,2)),sZ=-1}};rZ.prototype.close=rZ.prototype.close,rZ.prototype.clone=rZ.prototype.clone,rZ.prototype.getAsWebGLTexture=rZ.prototype.N,rZ.prototype.getAsImageBitmap=rZ.prototype.za,rZ.prototype.getAsImageData=rZ.prototype.Aa,rZ.prototype.hasWebGLTexture=rZ.prototype.R,rZ.prototype.hasImageBitmap=rZ.prototype.ka,rZ.prototype.hasImageData=rZ.prototype.Ca;var sZ=250;function iZ(...t){return t.map((([t,e])=>({start:t,end:e})))}const oZ=function(t){return class extends t{Ha(){this.i._registerModelResourcesGraphService()}}}((aZ=class{constructor(t,e){this.l=true,this.i=t,this.g=null,this.h=0,this.m="function"==typeof this.i._addIntToInputStream,void 0!==e?this.i.canvas=e:hV()?this.i.canvas=new OffscreenCanvas(1,1):(console.warn("OffscreenCanvas not supported and GraphRunner constructor glCanvas parameter is undefined. Creating backup canvas."),this.i.canvas=document.createElement("canvas"))}async initializeGraph(t){const e=await(await fetch(t)).arrayBuffer();t=!(t.endsWith(".pbtxt")||t.endsWith(".textproto")),this.setGraph(new Uint8Array(e),t)}setGraphFromString(t){this.setGraph((new TextEncoder).encode(t),false)}setGraph(t,e){const n=t.length,r=this.i._malloc(n);this.i.HEAPU8.set(t,r),e?this.i._changeBinaryGraph(n,r):this.i._changeTextGraph(n,r),this.i._free(r)}configureAudio(t,e,n,r,s){this.i._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),mV(this,r||"input_audio",(r=>{mV(this,s=s||"audio_header",(s=>{this.i._configureAudio(r,s,t,e??0,n)}))}))}setAutoResizeCanvas(t){this.l=t}setAutoRenderToScreen(t){this.i._setAutoRenderToScreen(t)}setGpuBufferVerticalFlip(t){this.i.gpuOriginForWebTexturesIsBottomLeft=t}ca(t){wV(this,"__graph_config__",(e=>{t(e)})),mV(this,"__graph_config__",(t=>{this.i._getGraphConfig(t,void 0)})),delete this.i.simpleListeners.__graph_config__}attachErrorListener(t){this.i.errorListener=t}attachEmptyPacketListener(t,e){this.i.emptyPacketListeners=this.i.emptyPacketListeners||{},this.i.emptyPacketListeners[t]=e}addAudioToStream(t,e,n){this.addAudioToStreamWithShape(t,0,0,e,n)}addAudioToStreamWithShape(t,e,n,r,s){const i=4*t.length;this.h!==i&&(this.g&&this.i._free(this.g),this.g=this.i._malloc(i),this.h=i),this.i.HEAPF32.set(t,this.g/4),mV(this,r,(t=>{this.i._addAudioToInputStream(this.g,e,n,t,s)}))}addGpuBufferToStream(t,e,n){mV(this,e,(e=>{const[r,s]=yV(this,t,e);this.i._addBoundTextureToStream(e,r,s,n)}))}addBoolToStream(t,e,n){mV(this,e,(e=>{this.i._addBoolToInputStream(t,e,n)}))}addDoubleToStream(t,e,n){mV(this,e,(e=>{this.i._addDoubleToInputStream(t,e,n)}))}addFloatToStream(t,e,n){mV(this,e,(e=>{this.i._addFloatToInputStream(t,e,n)}))}addIntToStream(t,e,n){mV(this,e,(e=>{this.i._addIntToInputStream(t,e,n)}))}addUintToStream(t,e,n){mV(this,e,(e=>{this.i._addUintToInputStream(t,e,n)}))}addStringToStream(t,e,n){mV(this,e,(e=>{mV(this,t,(t=>{this.i._addStringToInputStream(t,e,n)}))}))}addStringRecordToStream(t,e,n){mV(this,e,(e=>{gV(this,Object.keys(t),(r=>{gV(this,Object.values(t),(s=>{this.i._addFlatHashMapToInputStream(r,s,Object.keys(t).length,e,n)}))}))}))}addProtoToStream(t,e,n,r){mV(this,n,(n=>{mV(this,e,(e=>{const s=this.i._malloc(t.length);this.i.HEAPU8.set(t,s),this.i._addProtoToInputStream(s,t.length,e,n,r),this.i._free(s)}))}))}addEmptyPacketToStream(t,e){mV(this,t,(t=>{this.i._addEmptyPacketToInputStream(t,e)}))}addBoolVectorToStream(t,e,n){mV(this,e,(e=>{const r=this.i._allocateBoolVector(t.length);if(!r)throw Error("Unable to allocate new bool vector on heap.");for(const e of t)this.i._addBoolVectorEntry(r,e);this.i._addBoolVectorToInputStream(r,e,n)}))}addDoubleVectorToStream(t,e,n){mV(this,e,(e=>{const r=this.i._allocateDoubleVector(t.length);if(!r)throw Error("Unable to allocate new double vector on heap.");for(const e of t)this.i._addDoubleVectorEntry(r,e);this.i._addDoubleVectorToInputStream(r,e,n)}))}addFloatVectorToStream(t,e,n){mV(this,e,(e=>{const r=this.i._allocateFloatVector(t.length);if(!r)throw Error("Unable to allocate new float vector on heap.");for(const e of t)this.i._addFloatVectorEntry(r,e);this.i._addFloatVectorToInputStream(r,e,n)}))}addIntVectorToStream(t,e,n){mV(this,e,(e=>{const r=this.i._allocateIntVector(t.length);if(!r)throw Error("Unable to allocate new int vector on heap.");for(const e of t)this.i._addIntVectorEntry(r,e);this.i._addIntVectorToInputStream(r,e,n)}))}addUintVectorToStream(t,e,n){mV(this,e,(e=>{const r=this.i._allocateUintVector(t.length);if(!r)throw Error("Unable to allocate new unsigned int vector on heap.");for(const e of t)this.i._addUintVectorEntry(r,e);this.i._addUintVectorToInputStream(r,e,n)}))}addStringVectorToStream(t,e,n){mV(this,e,(e=>{const r=this.i._allocateStringVector(t.length);if(!r)throw Error("Unable to allocate new string vector on heap.");for(const e of t)mV(this,e,(t=>{this.i._addStringVectorEntry(r,t)}));this.i._addStringVectorToInputStream(r,e,n)}))}addBoolToInputSidePacket(t,e){mV(this,e,(e=>{this.i._addBoolToInputSidePacket(t,e)}))}addDoubleToInputSidePacket(t,e){mV(this,e,(e=>{this.i._addDoubleToInputSidePacket(t,e)}))}addFloatToInputSidePacket(t,e){mV(this,e,(e=>{this.i._addFloatToInputSidePacket(t,e)}))}addIntToInputSidePacket(t,e){mV(this,e,(e=>{this.i._addIntToInputSidePacket(t,e)}))}addUintToInputSidePacket(t,e){mV(this,e,(e=>{this.i._addUintToInputSidePacket(t,e)}))}addStringToInputSidePacket(t,e){mV(this,e,(e=>{mV(this,t,(t=>{this.i._addStringToInputSidePacket(t,e)}))}))}addProtoToInputSidePacket(t,e,n){mV(this,n,(n=>{mV(this,e,(e=>{const r=this.i._malloc(t.length);this.i.HEAPU8.set(t,r),this.i._addProtoToInputSidePacket(r,t.length,e,n),this.i._free(r)}))}))}addBoolVectorToInputSidePacket(t,e){mV(this,e,(e=>{const n=this.i._allocateBoolVector(t.length);if(!n)throw Error("Unable to allocate new bool vector on heap.");for(const e of t)this.i._addBoolVectorEntry(n,e);this.i._addBoolVectorToInputSidePacket(n,e)}))}addDoubleVectorToInputSidePacket(t,e){mV(this,e,(e=>{const n=this.i._allocateDoubleVector(t.length);if(!n)throw Error("Unable to allocate new double vector on heap.");for(const e of t)this.i._addDoubleVectorEntry(n,e);this.i._addDoubleVectorToInputSidePacket(n,e)}))}addFloatVectorToInputSidePacket(t,e){mV(this,e,(e=>{const n=this.i._allocateFloatVector(t.length);if(!n)throw Error("Unable to allocate new float vector on heap.");for(const e of t)this.i._addFloatVectorEntry(n,e);this.i._addFloatVectorToInputSidePacket(n,e)}))}addIntVectorToInputSidePacket(t,e){mV(this,e,(e=>{const n=this.i._allocateIntVector(t.length);if(!n)throw Error("Unable to allocate new int vector on heap.");for(const e of t)this.i._addIntVectorEntry(n,e);this.i._addIntVectorToInputSidePacket(n,e)}))}addUintVectorToInputSidePacket(t,e){mV(this,e,(e=>{const n=this.i._allocateUintVector(t.length);if(!n)throw Error("Unable to allocate new unsigned int vector on heap.");for(const e of t)this.i._addUintVectorEntry(n,e);this.i._addUintVectorToInputSidePacket(n,e)}))}addStringVectorToInputSidePacket(t,e){mV(this,e,(e=>{const n=this.i._allocateStringVector(t.length);if(!n)throw Error("Unable to allocate new string vector on heap.");for(const e of t)mV(this,e,(t=>{this.i._addStringVectorEntry(n,t)}));this.i._addStringVectorToInputSidePacket(n,e)}))}attachBoolListener(t,e){wV(this,t,e),mV(this,t,(t=>{this.i._attachBoolListener(t)}))}attachBoolVectorListener(t,e){bV(this,t,e),mV(this,t,(t=>{this.i._attachBoolVectorListener(t)}))}attachIntListener(t,e){wV(this,t,e),mV(this,t,(t=>{this.i._attachIntListener(t)}))}attachIntVectorListener(t,e){bV(this,t,e),mV(this,t,(t=>{this.i._attachIntVectorListener(t)}))}attachUintListener(t,e){wV(this,t,e),mV(this,t,(t=>{this.i._attachUintListener(t)}))}attachUintVectorListener(t,e){bV(this,t,e),mV(this,t,(t=>{this.i._attachUintVectorListener(t)}))}attachDoubleListener(t,e){wV(this,t,e),mV(this,t,(t=>{this.i._attachDoubleListener(t)}))}attachDoubleVectorListener(t,e){bV(this,t,e),mV(this,t,(t=>{this.i._attachDoubleVectorListener(t)}))}attachFloatListener(t,e){wV(this,t,e),mV(this,t,(t=>{this.i._attachFloatListener(t)}))}attachFloatVectorListener(t,e){bV(this,t,e),mV(this,t,(t=>{this.i._attachFloatVectorListener(t)}))}attachStringListener(t,e){wV(this,t,e),mV(this,t,(t=>{this.i._attachStringListener(t)}))}attachStringVectorListener(t,e){bV(this,t,e),mV(this,t,(t=>{this.i._attachStringVectorListener(t)}))}attachProtoListener(t,e,n){wV(this,t,e),mV(this,t,(t=>{this.i._attachProtoListener(t,n||false)}))}attachProtoVectorListener(t,e,n){bV(this,t,e),mV(this,t,(t=>{this.i._attachProtoVectorListener(t,n||false)}))}attachAudioListener(t,e,n){this.i._attachAudioListener||console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'),wV(this,t,((t,n)=>{t=new Float32Array(t.buffer,t.byteOffset,t.length/4),e(t,n)})),mV(this,t,(t=>{this.i._attachAudioListener(t,n||false)}))}finishProcessing(){this.i._waitUntilIdle()}closeGraph(){this.i._closeGraph(),this.i.simpleListeners=void 0,this.i.emptyPacketListeners=void 0}},class extends aZ{get ea(){return this.i}oa(t,e,n){mV(this,e,(e=>{const[r,s]=yV(this,t,e);this.ea._addBoundTextureAsImageToStream(e,r,s,n)}))}V(t,e){wV(this,t,e),mV(this,t,(t=>{this.ea._attachImageListener(t)}))}ba(t,e){bV(this,t,e),mV(this,t,(t=>{this.ea._attachImageVectorListener(t)}))}}));var aZ,cZ=class extends oZ{};async function uZ(t,e,n){return async function(t,e,n,r){return vV(t,e,n,r)}(t,n.canvas??(hV()?void 0:document.createElement("canvas")),e,n)}function fZ(t,e,n,r){if(t.U){const i=new VW;if(n?.regionOfInterest){if(!t.na)throw Error("This task doesn't support region-of-interest.");var s=n.regionOfInterest;if(s.left>=s.right||s.top>=s.bottom)throw Error("Expected RectF with left < right and top < bottom.");if(s.left<0||s.top<0||s.right>1||s.bottom>1)throw Error("Expected RectF values to be in [0,1].");KB(i,1,(s.left+s.right)/2),KB(i,2,(s.top+s.bottom)/2),KB(i,4,s.right-s.left),KB(i,3,s.bottom-s.top)}else KB(i,1,.5),KB(i,2,.5),KB(i,4,1),KB(i,3,1);if(n?.rotationDegrees){if(n?.rotationDegrees%90!=0)throw Error("Expected rotation to be a multiple of 90°.");if(KB(i,5,-Math.PI*n.rotationDegrees/180),n?.rotationDegrees%180!=0){const[t,r]=pV(e);n=JB(i,3)*r/t,s=JB(i,4)*t/r,KB(i,4,n),KB(i,3,s)}}t.g.addProtoToStream(i.g(),"mediapipe.NormalizedRect",t.U,r)}t.g.oa(e,t.Z,r??performance.now()),t.finishProcessing()}function lZ(t,e,n){if(t.baseOptions?.g())throw Error("Task is not initialized with image mode. 'runningMode' must be set to 'IMAGE'.");fZ(t,e,n,t.B+1)}function hZ(t,e,n,r){if(!t.baseOptions?.g())throw Error("Task is not initialized with video mode. 'runningMode' must be set to 'VIDEO'.");fZ(t,e,n,r)}function dZ(t,e,n,r){var s=e.data;const i=e.width,o=i*(e=e.height);if((s instanceof Uint8Array||s instanceof Float32Array)&&s.length!==o)throw Error("Unsupported channel count: "+s.length/o);return t=new ZV([s],n,false,t.g.i.canvas,t.P,i,e),r?t.clone():t}var pZ=class extends DV{constructor(t,e,n,r){super(t),this.g=t,this.Z=e,this.U=n,this.na=r,this.P=new RV}l(t,e=true){if("runningMode"in t&&qB(this.baseOptions,2,!!t.runningMode&&"IMAGE"!==t.runningMode),void 0!==t.canvas&&this.g.i.canvas!==t.canvas)throw Error("You must create a new task to reset the canvas.");return super.l(t,e)}close(){this.P.close(),super.close()}};pZ.prototype.close=pZ.prototype.close;var mZ=class extends pZ{constructor(t,e){super(new cZ(t,e),"image_in","norm_rect_in",false),this.j={detections:[]},GB(t=this.h=new fY,0,1,e=new aY),KB(this.h,2,.5),KB(this.h,3,.3)}get baseOptions(){return FB(this.h,aY,1)}set baseOptions(t){GB(this.h,0,1,t)}o(t){return"minDetectionConfidence"in t&&KB(this.h,2,t.minDetectionConfidence??.5),"minSuppressionThreshold"in t&&KB(this.h,3,t.minSuppressionThreshold??.3),this.l(t)}D(t,e){return this.j={detections:[]},lZ(this,t,e),this.j}F(t,e,n){return this.j={detections:[]},hZ(this,t,n,e),this.j}m(){var t=new TW;DW(t,"image_in"),DW(t,"norm_rect_in"),kW(t,"detections");const e=new yW;IG(e,hY,this.h);const n=new xW;bW(n,"mediapipe.tasks.vision.face_detector.FaceDetectorGraph"),vW(n,"IMAGE:image_in"),vW(n,"NORM_RECT:norm_rect_in"),NW(n,"DETECTIONS:detections"),n.o(e),EW(t,n),this.g.attachProtoVectorListener("detections",((t,e)=>{for(const e of t)t=FW(e),this.j.detections.push(nV(t));MV(this,e)})),this.g.attachEmptyPacketListener("detections",(t=>{MV(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),true)}};mZ.prototype.detectForVideo=mZ.prototype.F,mZ.prototype.detect=mZ.prototype.D,mZ.prototype.setOptions=mZ.prototype.o,mZ.createFromModelPath=async function(t,e){return uZ(mZ,t,{baseOptions:{modelAssetPath:e}})},mZ.createFromModelBuffer=function(t,e){return uZ(mZ,t,{baseOptions:{modelAssetBuffer:e}})},mZ.createFromOptions=function(t,e){return uZ(mZ,t,e)};var yZ=iZ([61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]),gZ=iZ([263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]),wZ=iZ([276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]),bZ=iZ([474,475],[475,476],[476,477],[477,474]),vZ=iZ([33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]),NZ=iZ([46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]),xZ=iZ([469,470],[470,471],[471,472],[472,469]),MZ=iZ([10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]),IZ=[...yZ,...gZ,...wZ,...vZ,...NZ,...MZ],SZ=iZ([127,34],[34,139],[139,127],[11,0],[0,37],[37,11],[232,231],[231,120],[120,232],[72,37],[37,39],[39,72],[128,121],[121,47],[47,128],[232,121],[121,128],[128,232],[104,69],[69,67],[67,104],[175,171],[171,148],[148,175],[118,50],[50,101],[101,118],[73,39],[39,40],[40,73],[9,151],[151,108],[108,9],[48,115],[115,131],[131,48],[194,204],[204,211],[211,194],[74,40],[40,185],[185,74],[80,42],[42,183],[183,80],[40,92],[92,186],[186,40],[230,229],[229,118],[118,230],[202,212],[212,214],[214,202],[83,18],[18,17],[17,83],[76,61],[61,146],[146,76],[160,29],[29,30],[30,160],[56,157],[157,173],[173,56],[106,204],[204,194],[194,106],[135,214],[214,192],[192,135],[203,165],[165,98],[98,203],[21,71],[71,68],[68,21],[51,45],[45,4],[4,51],[144,24],[24,23],[23,144],[77,146],[146,91],[91,77],[205,50],[50,187],[187,205],[201,200],[200,18],[18,201],[91,106],[106,182],[182,91],[90,91],[91,181],[181,90],[85,84],[84,17],[17,85],[206,203],[203,36],[36,206],[148,171],[171,140],[140,148],[92,40],[40,39],[39,92],[193,189],[189,244],[244,193],[159,158],[158,28],[28,159],[247,246],[246,161],[161,247],[236,3],[3,196],[196,236],[54,68],[68,104],[104,54],[193,168],[168,8],[8,193],[117,228],[228,31],[31,117],[189,193],[193,55],[55,189],[98,97],[97,99],[99,98],[126,47],[47,100],[100,126],[166,79],[79,218],[218,166],[155,154],[154,26],[26,155],[209,49],[49,131],[131,209],[135,136],[136,150],[150,135],[47,126],[126,217],[217,47],[223,52],[52,53],[53,223],[45,51],[51,134],[134,45],[211,170],[170,140],[140,211],[67,69],[69,108],[108,67],[43,106],[106,91],[91,43],[230,119],[119,120],[120,230],[226,130],[130,247],[247,226],[63,53],[53,52],[52,63],[238,20],[20,242],[242,238],[46,70],[70,156],[156,46],[78,62],[62,96],[96,78],[46,53],[53,63],[63,46],[143,34],[34,227],[227,143],[123,117],[117,111],[111,123],[44,125],[125,19],[19,44],[236,134],[134,51],[51,236],[216,206],[206,205],[205,216],[154,153],[153,22],[22,154],[39,37],[37,167],[167,39],[200,201],[201,208],[208,200],[36,142],[142,100],[100,36],[57,212],[212,202],[202,57],[20,60],[60,99],[99,20],[28,158],[158,157],[157,28],[35,226],[226,113],[113,35],[160,159],[159,27],[27,160],[204,202],[202,210],[210,204],[113,225],[225,46],[46,113],[43,202],[202,204],[204,43],[62,76],[76,77],[77,62],[137,123],[123,116],[116,137],[41,38],[38,72],[72,41],[203,129],[129,142],[142,203],[64,98],[98,240],[240,64],[49,102],[102,64],[64,49],[41,73],[73,74],[74,41],[212,216],[216,207],[207,212],[42,74],[74,184],[184,42],[169,170],[170,211],[211,169],[170,149],[149,176],[176,170],[105,66],[66,69],[69,105],[122,6],[6,168],[168,122],[123,147],[147,187],[187,123],[96,77],[77,90],[90,96],[65,55],[55,107],[107,65],[89,90],[90,180],[180,89],[101,100],[100,120],[120,101],[63,105],[105,104],[104,63],[93,137],[137,227],[227,93],[15,86],[86,85],[85,15],[129,102],[102,49],[49,129],[14,87],[87,86],[86,14],[55,8],[8,9],[9,55],[100,47],[47,121],[121,100],[145,23],[23,22],[22,145],[88,89],[89,179],[179,88],[6,122],[122,196],[196,6],[88,95],[95,96],[96,88],[138,172],[172,136],[136,138],[215,58],[58,172],[172,215],[115,48],[48,219],[219,115],[42,80],[80,81],[81,42],[195,3],[3,51],[51,195],[43,146],[146,61],[61,43],[171,175],[175,199],[199,171],[81,82],[82,38],[38,81],[53,46],[46,225],[225,53],[144,163],[163,110],[110,144],[52,65],[65,66],[66,52],[229,228],[228,117],[117,229],[34,127],[127,234],[234,34],[107,108],[108,69],[69,107],[109,108],[108,151],[151,109],[48,64],[64,235],[235,48],[62,78],[78,191],[191,62],[129,209],[209,126],[126,129],[111,35],[35,143],[143,111],[117,123],[123,50],[50,117],[222,65],[65,52],[52,222],[19,125],[125,141],[141,19],[221,55],[55,65],[65,221],[3,195],[195,197],[197,3],[25,7],[7,33],[33,25],[220,237],[237,44],[44,220],[70,71],[71,139],[139,70],[122,193],[193,245],[245,122],[247,130],[130,33],[33,247],[71,21],[21,162],[162,71],[170,169],[169,150],[150,170],[188,174],[174,196],[196,188],[216,186],[186,92],[92,216],[2,97],[97,167],[167,2],[141,125],[125,241],[241,141],[164,167],[167,37],[37,164],[72,38],[38,12],[12,72],[38,82],[82,13],[13,38],[63,68],[68,71],[71,63],[226,35],[35,111],[111,226],[101,50],[50,205],[205,101],[206,92],[92,165],[165,206],[209,198],[198,217],[217,209],[165,167],[167,97],[97,165],[220,115],[115,218],[218,220],[133,112],[112,243],[243,133],[239,238],[238,241],[241,239],[214,135],[135,169],[169,214],[190,173],[173,133],[133,190],[171,208],[208,32],[32,171],[125,44],[44,237],[237,125],[86,87],[87,178],[178,86],[85,86],[86,179],[179,85],[84,85],[85,180],[180,84],[83,84],[84,181],[181,83],[201,83],[83,182],[182,201],[137,93],[93,132],[132,137],[76,62],[62,183],[183,76],[61,76],[76,184],[184,61],[57,61],[61,185],[185,57],[212,57],[57,186],[186,212],[214,207],[207,187],[187,214],[34,143],[143,156],[156,34],[79,239],[239,237],[237,79],[123,137],[137,177],[177,123],[44,1],[1,4],[4,44],[201,194],[194,32],[32,201],[64,102],[102,129],[129,64],[213,215],[215,138],[138,213],[59,166],[166,219],[219,59],[242,99],[99,97],[97,242],[2,94],[94,141],[141,2],[75,59],[59,235],[235,75],[24,110],[110,228],[228,24],[25,130],[130,226],[226,25],[23,24],[24,229],[229,23],[22,23],[23,230],[230,22],[26,22],[22,231],[231,26],[112,26],[26,232],[232,112],[189,190],[190,243],[243,189],[221,56],[56,190],[190,221],[28,56],[56,221],[221,28],[27,28],[28,222],[222,27],[29,27],[27,223],[223,29],[30,29],[29,224],[224,30],[247,30],[30,225],[225,247],[238,79],[79,20],[20,238],[166,59],[59,75],[75,166],[60,75],[75,240],[240,60],[147,177],[177,215],[215,147],[20,79],[79,166],[166,20],[187,147],[147,213],[213,187],[112,233],[233,244],[244,112],[233,128],[128,245],[245,233],[128,114],[114,188],[188,128],[114,217],[217,174],[174,114],[131,115],[115,220],[220,131],[217,198],[198,236],[236,217],[198,131],[131,134],[134,198],[177,132],[132,58],[58,177],[143,35],[35,124],[124,143],[110,163],[163,7],[7,110],[228,110],[110,25],[25,228],[356,389],[389,368],[368,356],[11,302],[302,267],[267,11],[452,350],[350,349],[349,452],[302,303],[303,269],[269,302],[357,343],[343,277],[277,357],[452,453],[453,357],[357,452],[333,332],[332,297],[297,333],[175,152],[152,377],[377,175],[347,348],[348,330],[330,347],[303,304],[304,270],[270,303],[9,336],[336,337],[337,9],[278,279],[279,360],[360,278],[418,262],[262,431],[431,418],[304,408],[408,409],[409,304],[310,415],[415,407],[407,310],[270,409],[409,410],[410,270],[450,348],[348,347],[347,450],[422,430],[430,434],[434,422],[313,314],[314,17],[17,313],[306,307],[307,375],[375,306],[387,388],[388,260],[260,387],[286,414],[414,398],[398,286],[335,406],[406,418],[418,335],[364,367],[367,416],[416,364],[423,358],[358,327],[327,423],[251,284],[284,298],[298,251],[281,5],[5,4],[4,281],[373,374],[374,253],[253,373],[307,320],[320,321],[321,307],[425,427],[427,411],[411,425],[421,313],[313,18],[18,421],[321,405],[405,406],[406,321],[320,404],[404,405],[405,320],[315,16],[16,17],[17,315],[426,425],[425,266],[266,426],[377,400],[400,369],[369,377],[322,391],[391,269],[269,322],[417,465],[465,464],[464,417],[386,257],[257,258],[258,386],[466,260],[260,388],[388,466],[456,399],[399,419],[419,456],[284,332],[332,333],[333,284],[417,285],[285,8],[8,417],[346,340],[340,261],[261,346],[413,441],[441,285],[285,413],[327,460],[460,328],[328,327],[355,371],[371,329],[329,355],[392,439],[439,438],[438,392],[382,341],[341,256],[256,382],[429,420],[420,360],[360,429],[364,394],[394,379],[379,364],[277,343],[343,437],[437,277],[443,444],[444,283],[283,443],[275,440],[440,363],[363,275],[431,262],[262,369],[369,431],[297,338],[338,337],[337,297],[273,375],[375,321],[321,273],[450,451],[451,349],[349,450],[446,342],[342,467],[467,446],[293,334],[334,282],[282,293],[458,461],[461,462],[462,458],[276,353],[353,383],[383,276],[308,324],[324,325],[325,308],[276,300],[300,293],[293,276],[372,345],[345,447],[447,372],[352,345],[345,340],[340,352],[274,1],[1,19],[19,274],[456,248],[248,281],[281,456],[436,427],[427,425],[425,436],[381,256],[256,252],[252,381],[269,391],[391,393],[393,269],[200,199],[199,428],[428,200],[266,330],[330,329],[329,266],[287,273],[273,422],[422,287],[250,462],[462,328],[328,250],[258,286],[286,384],[384,258],[265,353],[353,342],[342,265],[387,259],[259,257],[257,387],[424,431],[431,430],[430,424],[342,353],[353,276],[276,342],[273,335],[335,424],[424,273],[292,325],[325,307],[307,292],[366,447],[447,345],[345,366],[271,303],[303,302],[302,271],[423,266],[266,371],[371,423],[294,455],[455,460],[460,294],[279,278],[278,294],[294,279],[271,272],[272,304],[304,271],[432,434],[434,427],[427,432],[272,407],[407,408],[408,272],[394,430],[430,431],[431,394],[395,369],[369,400],[400,395],[334,333],[333,299],[299,334],[351,417],[417,168],[168,351],[352,280],[280,411],[411,352],[325,319],[319,320],[320,325],[295,296],[296,336],[336,295],[319,403],[403,404],[404,319],[330,348],[348,349],[349,330],[293,298],[298,333],[333,293],[323,454],[454,447],[447,323],[15,16],[16,315],[315,15],[358,429],[429,279],[279,358],[14,15],[15,316],[316,14],[285,336],[336,9],[9,285],[329,349],[349,350],[350,329],[374,380],[380,252],[252,374],[318,402],[402,403],[403,318],[6,197],[197,419],[419,6],[318,319],[319,325],[325,318],[367,364],[364,365],[365,367],[435,367],[367,397],[397,435],[344,438],[438,439],[439,344],[272,271],[271,311],[311,272],[195,5],[5,281],[281,195],[273,287],[287,291],[291,273],[396,428],[428,199],[199,396],[311,271],[271,268],[268,311],[283,444],[444,445],[445,283],[373,254],[254,339],[339,373],[282,334],[334,296],[296,282],[449,347],[347,346],[346,449],[264,447],[447,454],[454,264],[336,296],[296,299],[299,336],[338,10],[10,151],[151,338],[278,439],[439,455],[455,278],[292,407],[407,415],[415,292],[358,371],[371,355],[355,358],[340,345],[345,372],[372,340],[346,347],[347,280],[280,346],[442,443],[443,282],[282,442],[19,94],[94,370],[370,19],[441,442],[442,295],[295,441],[248,419],[419,197],[197,248],[263,255],[255,359],[359,263],[440,275],[275,274],[274,440],[300,383],[383,368],[368,300],[351,412],[412,465],[465,351],[263,467],[467,466],[466,263],[301,368],[368,389],[389,301],[395,378],[378,379],[379,395],[412,351],[351,419],[419,412],[436,426],[426,322],[322,436],[2,164],[164,393],[393,2],[370,462],[462,461],[461,370],[164,0],[0,267],[267,164],[302,11],[11,12],[12,302],[268,12],[12,13],[13,268],[293,300],[300,301],[301,293],[446,261],[261,340],[340,446],[330,266],[266,425],[425,330],[426,423],[423,391],[391,426],[429,355],[355,437],[437,429],[391,327],[327,326],[326,391],[440,457],[457,438],[438,440],[341,382],[382,362],[362,341],[459,457],[457,461],[461,459],[434,430],[430,394],[394,434],[414,463],[463,362],[362,414],[396,369],[369,262],[262,396],[354,461],[461,457],[457,354],[316,403],[403,402],[402,316],[315,404],[404,403],[403,315],[314,405],[405,404],[404,314],[313,406],[406,405],[405,313],[421,418],[418,406],[406,421],[366,401],[401,361],[361,366],[306,408],[408,407],[407,306],[291,409],[409,408],[408,291],[287,410],[410,409],[409,287],[432,436],[436,410],[410,432],[434,416],[416,411],[411,434],[264,368],[368,383],[383,264],[309,438],[438,457],[457,309],[352,376],[376,401],[401,352],[274,275],[275,4],[4,274],[421,428],[428,262],[262,421],[294,327],[327,358],[358,294],[433,416],[416,367],[367,433],[289,455],[455,439],[439,289],[462,370],[370,326],[326,462],[2,326],[326,370],[370,2],[305,460],[460,455],[455,305],[254,449],[449,448],[448,254],[255,261],[261,446],[446,255],[253,450],[450,449],[449,253],[252,451],[451,450],[450,252],[256,452],[452,451],[451,256],[341,453],[453,452],[452,341],[413,464],[464,463],[463,413],[441,413],[413,414],[414,441],[258,442],[442,441],[441,258],[257,443],[443,442],[442,257],[259,444],[444,443],[443,259],[260,445],[445,444],[444,260],[467,342],[342,445],[445,467],[459,458],[458,250],[250,459],[289,392],[392,290],[290,289],[290,328],[328,460],[460,290],[376,433],[433,435],[435,376],[250,290],[290,392],[392,250],[411,416],[416,433],[433,411],[341,463],[463,464],[464,341],[453,464],[464,465],[465,453],[357,465],[465,412],[412,357],[343,412],[412,399],[399,343],[360,363],[363,440],[440,360],[437,399],[399,456],[456,437],[420,456],[456,363],[363,420],[401,435],[435,288],[288,401],[372,383],[383,353],[353,372],[339,255],[255,249],[249,339],[448,261],[261,255],[255,448],[133,243],[243,190],[190,133],[133,155],[155,112],[112,133],[33,246],[246,247],[247,33],[33,130],[130,25],[25,33],[398,384],[384,286],[286,398],[362,398],[398,414],[414,362],[362,463],[463,341],[341,362],[263,359],[359,467],[467,263],[263,249],[249,255],[255,263],[466,467],[467,260],[260,466],[75,60],[60,166],[166,75],[238,239],[239,79],[79,238],[162,127],[127,139],[139,162],[72,11],[11,37],[37,72],[121,232],[232,120],[120,121],[73,72],[72,39],[39,73],[114,128],[128,47],[47,114],[233,232],[232,128],[128,233],[103,104],[104,67],[67,103],[152,175],[175,148],[148,152],[119,118],[118,101],[101,119],[74,73],[73,40],[40,74],[107,9],[9,108],[108,107],[49,48],[48,131],[131,49],[32,194],[194,211],[211,32],[184,74],[74,185],[185,184],[191,80],[80,183],[183,191],[185,40],[40,186],[186,185],[119,230],[230,118],[118,119],[210,202],[202,214],[214,210],[84,83],[83,17],[17,84],[77,76],[76,146],[146,77],[161,160],[160,30],[30,161],[190,56],[56,173],[173,190],[182,106],[106,194],[194,182],[138,135],[135,192],[192,138],[129,203],[203,98],[98,129],[54,21],[21,68],[68,54],[5,51],[51,4],[4,5],[145,144],[144,23],[23,145],[90,77],[77,91],[91,90],[207,205],[205,187],[187,207],[83,201],[201,18],[18,83],[181,91],[91,182],[182,181],[180,90],[90,181],[181,180],[16,85],[85,17],[17,16],[205,206],[206,36],[36,205],[176,148],[148,140],[140,176],[165,92],[92,39],[39,165],[245,193],[193,244],[244,245],[27,159],[159,28],[28,27],[30,247],[247,161],[161,30],[174,236],[236,196],[196,174],[103,54],[54,104],[104,103],[55,193],[193,8],[8,55],[111,117],[117,31],[31,111],[221,189],[189,55],[55,221],[240,98],[98,99],[99,240],[142,126],[126,100],[100,142],[219,166],[166,218],[218,219],[112,155],[155,26],[26,112],[198,209],[209,131],[131,198],[169,135],[135,150],[150,169],[114,47],[47,217],[217,114],[224,223],[223,53],[53,224],[220,45],[45,134],[134,220],[32,211],[211,140],[140,32],[109,67],[67,108],[108,109],[146,43],[43,91],[91,146],[231,230],[230,120],[120,231],[113,226],[226,247],[247,113],[105,63],[63,52],[52,105],[241,238],[238,242],[242,241],[124,46],[46,156],[156,124],[95,78],[78,96],[96,95],[70,46],[46,63],[63,70],[116,143],[143,227],[227,116],[116,123],[123,111],[111,116],[1,44],[44,19],[19,1],[3,236],[236,51],[51,3],[207,216],[216,205],[205,207],[26,154],[154,22],[22,26],[165,39],[39,167],[167,165],[199,200],[200,208],[208,199],[101,36],[36,100],[100,101],[43,57],[57,202],[202,43],[242,20],[20,99],[99,242],[56,28],[28,157],[157,56],[124,35],[35,113],[113,124],[29,160],[160,27],[27,29],[211,204],[204,210],[210,211],[124,113],[113,46],[46,124],[106,43],[43,204],[204,106],[96,62],[62,77],[77,96],[227,137],[137,116],[116,227],[73,41],[41,72],[72,73],[36,203],[203,142],[142,36],[235,64],[64,240],[240,235],[48,49],[49,64],[64,48],[42,41],[41,74],[74,42],[214,212],[212,207],[207,214],[183,42],[42,184],[184,183],[210,169],[169,211],[211,210],[140,170],[170,176],[176,140],[104,105],[105,69],[69,104],[193,122],[122,168],[168,193],[50,123],[123,187],[187,50],[89,96],[96,90],[90,89],[66,65],[65,107],[107,66],[179,89],[89,180],[180,179],[119,101],[101,120],[120,119],[68,63],[63,104],[104,68],[234,93],[93,227],[227,234],[16,15],[15,85],[85,16],[209,129],[129,49],[49,209],[15,14],[14,86],[86,15],[107,55],[55,9],[9,107],[120,100],[100,121],[121,120],[153,145],[145,22],[22,153],[178,88],[88,179],[179,178],[197,6],[6,196],[196,197],[89,88],[88,96],[96,89],[135,138],[138,136],[136,135],[138,215],[215,172],[172,138],[218,115],[115,219],[219,218],[41,42],[42,81],[81,41],[5,195],[195,51],[51,5],[57,43],[43,61],[61,57],[208,171],[171,199],[199,208],[41,81],[81,38],[38,41],[224,53],[53,225],[225,224],[24,144],[144,110],[110,24],[105,52],[52,66],[66,105],[118,229],[229,117],[117,118],[227,34],[34,234],[234,227],[66,107],[107,69],[69,66],[10,109],[109,151],[151,10],[219,48],[48,235],[235,219],[183,62],[62,191],[191,183],[142,129],[129,126],[126,142],[116,111],[111,143],[143,116],[118,117],[117,50],[50,118],[223,222],[222,52],[52,223],[94,19],[19,141],[141,94],[222,221],[221,65],[65,222],[196,3],[3,197],[197,196],[45,220],[220,44],[44,45],[156,70],[70,139],[139,156],[188,122],[122,245],[245,188],[139,71],[71,162],[162,139],[149,170],[170,150],[150,149],[122,188],[188,196],[196,122],[206,216],[216,92],[92,206],[164,2],[2,167],[167,164],[242,141],[141,241],[241,242],[0,164],[164,37],[37,0],[11,72],[72,12],[12,11],[12,38],[38,13],[13,12],[70,63],[63,71],[71,70],[31,226],[226,111],[111,31],[36,101],[101,205],[205,36],[203,206],[206,165],[165,203],[126,209],[209,217],[217,126],[98,165],[165,97],[97,98],[237,220],[220,218],[218,237],[237,239],[239,241],[241,237],[210,214],[214,169],[169,210],[140,171],[171,32],[32,140],[241,125],[125,237],[237,241],[179,86],[86,178],[178,179],[180,85],[85,179],[179,180],[181,84],[84,180],[180,181],[182,83],[83,181],[181,182],[194,201],[201,182],[182,194],[177,137],[137,132],[132,177],[184,76],[76,183],[183,184],[185,61],[61,184],[184,185],[186,57],[57,185],[185,186],[216,212],[212,186],[186,216],[192,214],[214,187],[187,192],[139,34],[34,156],[156,139],[218,79],[79,237],[237,218],[147,123],[123,177],[177,147],[45,44],[44,4],[4,45],[208,201],[201,32],[32,208],[98,64],[64,129],[129,98],[192,213],[213,138],[138,192],[235,59],[59,219],[219,235],[141,242],[242,97],[97,141],[97,2],[2,141],[141,97],[240,75],[75,235],[235,240],[229,24],[24,228],[228,229],[31,25],[25,226],[226,31],[230,23],[23,229],[229,230],[231,22],[22,230],[230,231],[232,26],[26,231],[231,232],[233,112],[112,232],[232,233],[244,189],[189,243],[243,244],[189,221],[221,190],[190,189],[222,28],[28,221],[221,222],[223,27],[27,222],[222,223],[224,29],[29,223],[223,224],[225,30],[30,224],[224,225],[113,247],[247,225],[225,113],[99,60],[60,240],[240,99],[213,147],[147,215],[215,213],[60,20],[20,166],[166,60],[192,187],[187,213],[213,192],[243,112],[112,244],[244,243],[244,233],[233,245],[245,244],[245,128],[128,188],[188,245],[188,114],[114,174],[174,188],[134,131],[131,220],[220,134],[174,217],[217,236],[236,174],[236,198],[198,134],[134,236],[215,177],[177,58],[58,215],[156,143],[143,124],[124,156],[25,110],[110,7],[7,25],[31,228],[228,25],[25,31],[264,356],[356,368],[368,264],[0,11],[11,267],[267,0],[451,452],[452,349],[349,451],[267,302],[302,269],[269,267],[350,357],[357,277],[277,350],[350,452],[452,357],[357,350],[299,333],[333,297],[297,299],[396,175],[175,377],[377,396],[280,347],[347,330],[330,280],[269,303],[303,270],[270,269],[151,9],[9,337],[337,151],[344,278],[278,360],[360,344],[424,418],[418,431],[431,424],[270,304],[304,409],[409,270],[272,310],[310,407],[407,272],[322,270],[270,410],[410,322],[449,450],[450,347],[347,449],[432,422],[422,434],[434,432],[18,313],[313,17],[17,18],[291,306],[306,375],[375,291],[259,387],[387,260],[260,259],[424,335],[335,418],[418,424],[434,364],[364,416],[416,434],[391,423],[423,327],[327,391],[301,251],[251,298],[298,301],[275,281],[281,4],[4,275],[254,373],[373,253],[253,254],[375,307],[307,321],[321,375],[280,425],[425,411],[411,280],[200,421],[421,18],[18,200],[335,321],[321,406],[406,335],[321,320],[320,405],[405,321],[314,315],[315,17],[17,314],[423,426],[426,266],[266,423],[396,377],[377,369],[369,396],[270,322],[322,269],[269,270],[413,417],[417,464],[464,413],[385,386],[386,258],[258,385],[248,456],[456,419],[419,248],[298,284],[284,333],[333,298],[168,417],[417,8],[8,168],[448,346],[346,261],[261,448],[417,413],[413,285],[285,417],[326,327],[327,328],[328,326],[277,355],[355,329],[329,277],[309,392],[392,438],[438,309],[381,382],[382,256],[256,381],[279,429],[429,360],[360,279],[365,364],[364,379],[379,365],[355,277],[277,437],[437,355],[282,443],[443,283],[283,282],[281,275],[275,363],[363,281],[395,431],[431,369],[369,395],[299,297],[297,337],[337,299],[335,273],[273,321],[321,335],[348,450],[450,349],[349,348],[359,446],[446,467],[467,359],[283,293],[293,282],[282,283],[250,458],[458,462],[462,250],[300,276],[276,383],[383,300],[292,308],[308,325],[325,292],[283,276],[276,293],[293,283],[264,372],[372,447],[447,264],[346,352],[352,340],[340,346],[354,274],[274,19],[19,354],[363,456],[456,281],[281,363],[426,436],[436,425],[425,426],[380,381],[381,252],[252,380],[267,269],[269,393],[393,267],[421,200],[200,428],[428,421],[371,266],[266,329],[329,371],[432,287],[287,422],[422,432],[290,250],[250,328],[328,290],[385,258],[258,384],[384,385],[446,265],[265,342],[342,446],[386,387],[387,257],[257,386],[422,424],[424,430],[430,422],[445,342],[342,276],[276,445],[422,273],[273,424],[424,422],[306,292],[292,307],[307,306],[352,366],[366,345],[345,352],[268,271],[271,302],[302,268],[358,423],[423,371],[371,358],[327,294],[294,460],[460,327],[331,279],[279,294],[294,331],[303,271],[271,304],[304,303],[436,432],[432,427],[427,436],[304,272],[272,408],[408,304],[395,394],[394,431],[431,395],[378,395],[395,400],[400,378],[296,334],[334,299],[299,296],[6,351],[351,168],[168,6],[376,352],[352,411],[411,376],[307,325],[325,320],[320,307],[285,295],[295,336],[336,285],[320,319],[319,404],[404,320],[329,330],[330,349],[349,329],[334,293],[293,333],[333,334],[366,323],[323,447],[447,366],[316,15],[15,315],[315,316],[331,358],[358,279],[279,331],[317,14],[14,316],[316,317],[8,285],[285,9],[9,8],[277,329],[329,350],[350,277],[253,374],[374,252],[252,253],[319,318],[318,403],[403,319],[351,6],[6,419],[419,351],[324,318],[318,325],[325,324],[397,367],[367,365],[365,397],[288,435],[435,397],[397,288],[278,344],[344,439],[439,278],[310,272],[272,311],[311,310],[248,195],[195,281],[281,248],[375,273],[273,291],[291,375],[175,396],[396,199],[199,175],[312,311],[311,268],[268,312],[276,283],[283,445],[445,276],[390,373],[373,339],[339,390],[295,282],[282,296],[296,295],[448,449],[449,346],[346,448],[356,264],[264,454],[454,356],[337,336],[336,299],[299,337],[337,338],[338,151],[151,337],[294,278],[278,455],[455,294],[308,292],[292,415],[415,308],[429,358],[358,355],[355,429],[265,340],[340,372],[372,265],[352,346],[346,280],[280,352],[295,442],[442,282],[282,295],[354,19],[19,370],[370,354],[285,441],[441,295],[295,285],[195,248],[248,197],[197,195],[457,440],[440,274],[274,457],[301,300],[300,368],[368,301],[417,351],[351,465],[465,417],[251,301],[301,389],[389,251],[394,395],[395,379],[379,394],[399,412],[412,419],[419,399],[410,436],[436,322],[322,410],[326,2],[2,393],[393,326],[354,370],[370,461],[461,354],[393,164],[164,267],[267,393],[268,302],[302,12],[12,268],[312,268],[268,13],[13,312],[298,293],[293,301],[301,298],[265,446],[446,340],[340,265],[280,330],[330,425],[425,280],[322,426],[426,391],[391,322],[420,429],[429,437],[437,420],[393,391],[391,326],[326,393],[344,440],[440,438],[438,344],[458,459],[459,461],[461,458],[364,434],[434,394],[394,364],[428,396],[396,262],[262,428],[274,354],[354,457],[457,274],[317,316],[316,402],[402,317],[316,315],[315,403],[403,316],[315,314],[314,404],[404,315],[314,313],[313,405],[405,314],[313,421],[421,406],[406,313],[323,366],[366,361],[361,323],[292,306],[306,407],[407,292],[306,291],[291,408],[408,306],[291,287],[287,409],[409,291],[287,432],[432,410],[410,287],[427,434],[434,411],[411,427],[372,264],[264,383],[383,372],[459,309],[309,457],[457,459],[366,352],[352,401],[401,366],[1,274],[274,4],[4,1],[418,421],[421,262],[262,418],[331,294],[294,358],[358,331],[435,433],[433,367],[367,435],[392,289],[289,439],[439,392],[328,462],[462,326],[326,328],[94,2],[2,370],[370,94],[289,305],[305,455],[455,289],[339,254],[254,448],[448,339],[359,255],[255,446],[446,359],[254,253],[253,449],[449,254],[253,252],[252,450],[450,253],[252,256],[256,451],[451,252],[256,341],[341,452],[452,256],[414,413],[413,463],[463,414],[286,441],[441,414],[414,286],[286,258],[258,441],[441,286],[258,257],[257,442],[442,258],[257,259],[259,443],[443,257],[259,260],[260,444],[444,259],[260,467],[467,445],[445,260],[309,459],[459,250],[250,309],[305,289],[289,290],[290,305],[305,290],[290,460],[460,305],[401,376],[376,435],[435,401],[309,250],[250,392],[392,309],[376,411],[411,433],[433,376],[453,341],[341,464],[464,453],[357,453],[453,465],[465,357],[343,357],[357,412],[412,343],[437,343],[343,399],[399,437],[344,360],[360,440],[440,344],[420,437],[437,456],[456,420],[360,420],[420,363],[363,360],[361,401],[401,288],[288,361],[265,372],[372,353],[353,265],[390,339],[339,249],[249,390],[339,448],[448,255],[255,339]);function EZ(t){t.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]}}var DZ=class extends pZ{constructor(t,e){super(new cZ(t,e),"image_in","norm_rect",false),this.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]},this.outputFacialTransformationMatrixes=this.outputFaceBlendshapes=false,GB(t=this.h=new mY,0,1,e=new aY),this.v=new pY,GB(this.h,0,3,this.v),this.s=new fY,GB(this.h,0,2,this.s),XB(this.s,4,1),KB(this.s,2,.5),KB(this.v,2,.5),KB(this.h,4,.5)}get baseOptions(){return FB(this.h,aY,1)}set baseOptions(t){GB(this.h,0,1,t)}o(t){return"numFaces"in t&&XB(this.s,4,t.numFaces??1),"minFaceDetectionConfidence"in t&&KB(this.s,2,t.minFaceDetectionConfidence??.5),"minTrackingConfidence"in t&&KB(this.h,4,t.minTrackingConfidence??.5),"minFacePresenceConfidence"in t&&KB(this.v,2,t.minFacePresenceConfidence??.5),"outputFaceBlendshapes"in t&&(this.outputFaceBlendshapes=!!t.outputFaceBlendshapes),"outputFacialTransformationMatrixes"in t&&(this.outputFacialTransformationMatrixes=!!t.outputFacialTransformationMatrixes),this.l(t)}D(t,e){return EZ(this),lZ(this,t,e),this.j}F(t,e,n){return EZ(this),hZ(this,t,n,e),this.j}m(){var t=new TW;DW(t,"image_in"),DW(t,"norm_rect"),kW(t,"face_landmarks");const e=new yW;IG(e,wY,this.h);const n=new xW;bW(n,"mediapipe.tasks.vision.face_landmarker.FaceLandmarkerGraph"),vW(n,"IMAGE:image_in"),vW(n,"NORM_RECT:norm_rect"),NW(n,"NORM_LANDMARKS:face_landmarks"),n.o(e),EW(t,n),this.g.attachProtoVectorListener("face_landmarks",((t,e)=>{for(const e of t)t=UW(e),this.j.faceLandmarks.push(rV(t));MV(this,e)})),this.g.attachEmptyPacketListener("face_landmarks",(t=>{MV(this,t)})),this.outputFaceBlendshapes&&(kW(t,"blendshapes"),NW(n,"BLENDSHAPES:blendshapes"),this.g.attachProtoVectorListener("blendshapes",((t,e)=>{if(this.outputFaceBlendshapes)for(const e of t)t=zW(e),this.j.faceBlendshapes.push(eV(t.g()??[]));MV(this,e)})),this.g.attachEmptyPacketListener("blendshapes",(t=>{MV(this,t)}))),this.outputFacialTransformationMatrixes&&(kW(t,"face_geometry"),NW(n,"FACE_GEOMETRY:face_geometry"),this.g.attachProtoVectorListener("face_geometry",((t,e)=>{if(this.outputFacialTransformationMatrixes)for(const e of t)(t=FB(dY(e),WW,2))&&this.j.facialTransformationMatrixes.push({rows:QB(t,1)??0??0,columns:QB(t,2)??0??0,data:EB(t,3,DP,SB()).slice()??[]});MV(this,e)})),this.g.attachEmptyPacketListener("face_geometry",(t=>{MV(this,t)}))),t=t.g(),this.setGraph(new Uint8Array(t),true)}};DZ.prototype.detectForVideo=DZ.prototype.F,DZ.prototype.detect=DZ.prototype.D,DZ.prototype.setOptions=DZ.prototype.o,DZ.createFromModelPath=function(t,e){return uZ(DZ,t,{baseOptions:{modelAssetPath:e}})},DZ.createFromModelBuffer=function(t,e){return uZ(DZ,t,{baseOptions:{modelAssetBuffer:e}})},DZ.createFromOptions=function(t,e){return uZ(DZ,t,e)},DZ.FACE_LANDMARKS_LIPS=yZ,DZ.FACE_LANDMARKS_LEFT_EYE=gZ,DZ.FACE_LANDMARKS_LEFT_EYEBROW=wZ,DZ.FACE_LANDMARKS_LEFT_IRIS=bZ,DZ.FACE_LANDMARKS_RIGHT_EYE=vZ,DZ.FACE_LANDMARKS_RIGHT_EYEBROW=NZ,DZ.FACE_LANDMARKS_RIGHT_IRIS=xZ,DZ.FACE_LANDMARKS_FACE_OVAL=MZ,DZ.FACE_LANDMARKS_CONTOURS=IZ,DZ.FACE_LANDMARKS_TESSELATION=SZ;var kZ=class extends pZ{constructor(t,e){super(new cZ(t,e),"image_in","norm_rect",true),GB(t=this.j=new bY,0,1,e=new aY)}get baseOptions(){return FB(this.j,aY,1)}set baseOptions(t){GB(this.j,0,1,t)}o(t){return super.l(t)}Ka(t,e,n){const r="function"!=typeof e?e:{};if(this.h="function"==typeof e?e:n,lZ(this,t,r??{}),!this.h)return this.s}m(){var t=new TW;DW(t,"image_in"),DW(t,"norm_rect"),kW(t,"stylized_image");const e=new yW;IG(e,vY,this.j);const n=new xW;bW(n,"mediapipe.tasks.vision.face_stylizer.FaceStylizerGraph"),vW(n,"IMAGE:image_in"),vW(n,"NORM_RECT:norm_rect"),NW(n,"STYLIZED_IMAGE:stylized_image"),n.o(e),EW(t,n),this.g.V("stylized_image",((t,e)=>{var n=!this.h,r=t.data,s=t.width;const i=s*(t=t.height);if(r instanceof Uint8Array)if(r.length===3*i){const e=new Uint8ClampedArray(4*i);for(let t=0;t<i;++t)e[4*t]=r[3*t],e[4*t+1]=r[3*t+1],e[4*t+2]=r[3*t+2],e[4*t+3]=255;r=new ImageData(e,s,t)}else{if(r.length!==4*i)throw Error("Unsupported channel count: "+r.length/i);r=new ImageData(new Uint8ClampedArray(r.buffer,r.byteOffset,r.length),s,t)}else if(!(r instanceof WebGLTexture))throw Error(`Unsupported format: ${r.constructor.name}`);s=new rZ([r],false,false,this.g.i.canvas,this.P,s,t),this.s=n=n?s.clone():s,this.h&&this.h(n),MV(this,e)})),this.g.attachEmptyPacketListener("stylized_image",(t=>{this.s=null,this.h&&this.h(null),MV(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),true)}};kZ.prototype.stylize=kZ.prototype.Ka,kZ.prototype.setOptions=kZ.prototype.o,kZ.createFromModelPath=function(t,e){return uZ(kZ,t,{baseOptions:{modelAssetPath:e}})},kZ.createFromModelBuffer=function(t,e){return uZ(kZ,t,{baseOptions:{modelAssetBuffer:e}})},kZ.createFromOptions=function(t,e){return uZ(kZ,t,e)};var TZ=iZ([0,1],[1,2],[2,3],[3,4],[0,5],[5,6],[6,7],[7,8],[5,9],[9,10],[10,11],[11,12],[9,13],[13,14],[14,15],[15,16],[13,17],[0,17],[17,18],[18,19],[19,20]);function AZ(t){t.gestures=[],t.landmarks=[],t.worldLandmarks=[],t.handedness=[]}function LZ(t){return 0===t.gestures.length?{gestures:[],landmarks:[],worldLandmarks:[],handedness:[],handednesses:[]}:{gestures:t.gestures,landmarks:t.landmarks,worldLandmarks:t.worldLandmarks,handedness:t.handedness,handednesses:t.handedness}}function _Z(t,e=true){const n=[];for(const s of t){var r=zW(s);t=[];for(const n of r.g())r=e&&null!=QB(n,1)?QB(n,1)??0:-1,t.push({score:JB(n,2)??0,index:r,categoryName:HB(n,3)??""??"",displayName:HB(n,4)??""??""});n.push(t)}return n}var CZ=class extends pZ{constructor(t,e){super(new cZ(t,e),"image_in","norm_rect",false),this.gestures=[],this.landmarks=[],this.worldLandmarks=[],this.handedness=[],GB(t=this.j=new DY,0,1,e=new aY),this.s=new EY,GB(this.j,0,2,this.s),this.C=new SY,GB(this.s,0,3,this.C),this.v=new IY,GB(this.s,0,2,this.v),this.h=new MY,GB(this.j,0,3,this.h),KB(this.v,2,.5),KB(this.s,4,.5),KB(this.C,2,.5)}get baseOptions(){return FB(this.j,aY,1)}set baseOptions(t){GB(this.j,0,1,t)}o(t){if(XB(this.v,3,t.numHands??1),"minHandDetectionConfidence"in t&&KB(this.v,2,t.minHandDetectionConfidence??.5),"minTrackingConfidence"in t&&KB(this.s,4,t.minTrackingConfidence??.5),"minHandPresenceConfidence"in t&&KB(this.C,2,t.minHandPresenceConfidence??.5),t.cannedGesturesClassifierOptions){var e=new NY,n=e,r=tV(t.cannedGesturesClassifierOptions,FB(this.h,NY,3)?.h());GB(n,0,2,r),GB(this.h,0,3,e)}else void 0===t.cannedGesturesClassifierOptions&&FB(this.h,NY,3)?.g();return t.customGesturesClassifierOptions?(GB(n=e=new NY,0,2,r=tV(t.customGesturesClassifierOptions,FB(this.h,NY,4)?.h())),GB(this.h,0,4,e)):void 0===t.customGesturesClassifierOptions&&FB(this.h,NY,4)?.g(),this.l(t)}Fa(t,e){return AZ(this),lZ(this,t,e),LZ(this)}Ga(t,e,n){return AZ(this),hZ(this,t,n,e),LZ(this)}m(){var t=new TW;DW(t,"image_in"),DW(t,"norm_rect"),kW(t,"hand_gestures"),kW(t,"hand_landmarks"),kW(t,"world_hand_landmarks"),kW(t,"handedness");const e=new yW;IG(e,_Y,this.j);const n=new xW;bW(n,"mediapipe.tasks.vision.gesture_recognizer.GestureRecognizerGraph"),vW(n,"IMAGE:image_in"),vW(n,"NORM_RECT:norm_rect"),NW(n,"HAND_GESTURES:hand_gestures"),NW(n,"LANDMARKS:hand_landmarks"),NW(n,"WORLD_LANDMARKS:world_hand_landmarks"),NW(n,"HANDEDNESS:handedness"),n.o(e),EW(t,n),this.g.attachProtoVectorListener("hand_landmarks",((t,e)=>{for(const e of t){t=UW(e);const n=[];for(const e of BB(t,GW,1))n.push({x:JB(e,1)??0,y:JB(e,2)??0,z:JB(e,3)??0,visibility:JB(e,4)??0});this.landmarks.push(n)}MV(this,e)})),this.g.attachEmptyPacketListener("hand_landmarks",(t=>{MV(this,t)})),this.g.attachProtoVectorListener("world_hand_landmarks",((t,e)=>{for(const e of t){t=BW(e);const n=[];for(const e of BB(t,PW,1))n.push({x:JB(e,1)??0,y:JB(e,2)??0,z:JB(e,3)??0,visibility:JB(e,4)??0});this.worldLandmarks.push(n)}MV(this,e)})),this.g.attachEmptyPacketListener("world_hand_landmarks",(t=>{MV(this,t)})),this.g.attachProtoVectorListener("hand_gestures",((t,e)=>{this.gestures.push(..._Z(t,false)),MV(this,e)})),this.g.attachEmptyPacketListener("hand_gestures",(t=>{MV(this,t)})),this.g.attachProtoVectorListener("handedness",((t,e)=>{this.handedness.push(..._Z(t)),MV(this,e)})),this.g.attachEmptyPacketListener("handedness",(t=>{MV(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),true)}};function OZ(t){return{landmarks:t.landmarks,worldLandmarks:t.worldLandmarks,handednesses:t.handedness,handedness:t.handedness}}CZ.prototype.recognizeForVideo=CZ.prototype.Ga,CZ.prototype.recognize=CZ.prototype.Fa,CZ.prototype.setOptions=CZ.prototype.o,CZ.createFromModelPath=function(t,e){return uZ(CZ,t,{baseOptions:{modelAssetPath:e}})},CZ.createFromModelBuffer=function(t,e){return uZ(CZ,t,{baseOptions:{modelAssetBuffer:e}})},CZ.createFromOptions=function(t,e){return uZ(CZ,t,e)},CZ.HAND_CONNECTIONS=TZ;var zZ=class extends pZ{constructor(t,e){super(new cZ(t,e),"image_in","norm_rect",false),this.landmarks=[],this.worldLandmarks=[],this.handedness=[],GB(t=this.h=new EY,0,1,e=new aY),this.s=new SY,GB(this.h,0,3,this.s),this.j=new IY,GB(this.h,0,2,this.j),XB(this.j,3,1),KB(this.j,2,.5),KB(this.s,2,.5),KB(this.h,4,.5)}get baseOptions(){return FB(this.h,aY,1)}set baseOptions(t){GB(this.h,0,1,t)}o(t){return"numHands"in t&&XB(this.j,3,t.numHands??1),"minHandDetectionConfidence"in t&&KB(this.j,2,t.minHandDetectionConfidence??.5),"minTrackingConfidence"in t&&KB(this.h,4,t.minTrackingConfidence??.5),"minHandPresenceConfidence"in t&&KB(this.s,2,t.minHandPresenceConfidence??.5),this.l(t)}D(t,e){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],lZ(this,t,e),OZ(this)}F(t,e,n){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],hZ(this,t,n,e),OZ(this)}m(){var t=new TW;DW(t,"image_in"),DW(t,"norm_rect"),kW(t,"hand_landmarks"),kW(t,"world_hand_landmarks"),kW(t,"handedness");const e=new yW;IG(e,CY,this.h);const n=new xW;bW(n,"mediapipe.tasks.vision.hand_landmarker.HandLandmarkerGraph"),vW(n,"IMAGE:image_in"),vW(n,"NORM_RECT:norm_rect"),NW(n,"LANDMARKS:hand_landmarks"),NW(n,"WORLD_LANDMARKS:world_hand_landmarks"),NW(n,"HANDEDNESS:handedness"),n.o(e),EW(t,n),this.g.attachProtoVectorListener("hand_landmarks",((t,e)=>{for(const e of t)t=UW(e),this.landmarks.push(rV(t));MV(this,e)})),this.g.attachEmptyPacketListener("hand_landmarks",(t=>{MV(this,t)})),this.g.attachProtoVectorListener("world_hand_landmarks",((t,e)=>{for(const e of t)t=BW(e),this.worldLandmarks.push(sV(t));MV(this,e)})),this.g.attachEmptyPacketListener("world_hand_landmarks",(t=>{MV(this,t)})),this.g.attachProtoVectorListener("handedness",((t,e)=>{var n=this.handedness,r=n.push;const s=[];for(const e of t){t=zW(e);const n=[];for(const e of t.g())n.push({score:JB(e,2)??0,index:QB(e,1)??0??-1,categoryName:HB(e,3)??""??"",displayName:HB(e,4)??""??""});s.push(n)}r.call(n,...s),MV(this,e)})),this.g.attachEmptyPacketListener("handedness",(t=>{MV(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),true)}};zZ.prototype.detectForVideo=zZ.prototype.F,zZ.prototype.detect=zZ.prototype.D,zZ.prototype.setOptions=zZ.prototype.o,zZ.createFromModelPath=function(t,e){return uZ(zZ,t,{baseOptions:{modelAssetPath:e}})},zZ.createFromModelBuffer=function(t,e){return uZ(zZ,t,{baseOptions:{modelAssetBuffer:e}})},zZ.createFromOptions=function(t,e){return uZ(zZ,t,e)},zZ.HAND_CONNECTIONS=TZ;var jZ=iZ([0,1],[1,2],[2,3],[3,7],[0,4],[4,5],[5,6],[6,8],[9,10],[11,12],[11,13],[13,15],[15,17],[15,19],[15,21],[17,19],[12,14],[14,16],[16,18],[16,20],[16,22],[18,20],[11,23],[12,24],[23,24],[23,25],[24,26],[25,27],[26,28],[27,29],[28,30],[29,31],[30,32],[27,31],[28,32]);function RZ(t){t.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]}}function $Z(t){try{if(!t.C)return t.h;t.C(t.h)}finally{EV(t)}}function FZ(t,e){t=UW(t),e.push(rV(t))}var PZ=class extends pZ{constructor(t,e){super(new cZ(t,e),"input_frames_image",null,false),this.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]},this.outputPoseSegmentationMasks=this.outputFaceBlendshapes=false,GB(t=this.j=new RY,0,1,e=new aY),this.K=new SY,GB(this.j,0,2,this.K),this.Y=new OY,GB(this.j,0,3,this.Y),this.s=new fY,GB(this.j,0,4,this.s),this.H=new pY,GB(this.j,0,5,this.H),this.v=new zY,GB(this.j,0,6,this.v),this.L=new jY,GB(this.j,0,7,this.L),KB(this.s,2,.5),KB(this.s,3,.3),KB(this.H,2,.5),KB(this.v,2,.5),KB(this.v,3,.3),KB(this.L,2,.5),KB(this.K,2,.5)}get baseOptions(){return FB(this.j,aY,1)}set baseOptions(t){GB(this.j,0,1,t)}o(t){return"minFaceDetectionConfidence"in t&&KB(this.s,2,t.minFaceDetectionConfidence??.5),"minFaceSuppressionThreshold"in t&&KB(this.s,3,t.minFaceSuppressionThreshold??.3),"minFacePresenceConfidence"in t&&KB(this.H,2,t.minFacePresenceConfidence??.5),"outputFaceBlendshapes"in t&&(this.outputFaceBlendshapes=!!t.outputFaceBlendshapes),"minPoseDetectionConfidence"in t&&KB(this.v,2,t.minPoseDetectionConfidence??.5),"minPoseSuppressionThreshold"in t&&KB(this.v,3,t.minPoseSuppressionThreshold??.3),"minPosePresenceConfidence"in t&&KB(this.L,2,t.minPosePresenceConfidence??.5),"outputPoseSegmentationMasks"in t&&(this.outputPoseSegmentationMasks=!!t.outputPoseSegmentationMasks),"minHandLandmarksConfidence"in t&&KB(this.K,2,t.minHandLandmarksConfidence??.5),this.l(t)}D(t,e,n){const r="function"!=typeof e?e:{};return this.C="function"==typeof e?e:n,RZ(this),lZ(this,t,r),$Z(this)}F(t,e,n,r){const s="function"!=typeof n?n:{};return this.C="function"==typeof n?n:r,RZ(this),hZ(this,t,s,e),$Z(this)}m(){var t=new TW;DW(t,"input_frames_image"),kW(t,"pose_landmarks"),kW(t,"pose_world_landmarks"),kW(t,"face_landmarks"),kW(t,"left_hand_landmarks"),kW(t,"left_hand_world_landmarks"),kW(t,"right_hand_landmarks"),kW(t,"right_hand_world_landmarks");const e=new yW,n=new rW;LB(n,1,UP("type.googleapis.com/mediapipe.tasks.vision.holistic_landmarker.proto.HolisticLandmarkerGraphOptions"),""),function(t,e){if(null!=e)if(Array.isArray(e))NB(t,2,fB(e,hB,void 0,void 0,false));else{if(!("string"==typeof e||e instanceof mF||lF(e)))throw Error("invalid value in Any.value field: "+e+" expected a ByteString, a base64 encoded string, a Uint8Array or a jspb array");LB(t,2,UF(e,false),dF())}}(n,this.j.g());const r=new xW;bW(r,"mediapipe.tasks.vision.holistic_landmarker.HolisticLandmarkerGraph"),ZB(r,8,rW,n),vW(r,"IMAGE:input_frames_image"),NW(r,"POSE_LANDMARKS:pose_landmarks"),NW(r,"POSE_WORLD_LANDMARKS:pose_world_landmarks"),NW(r,"FACE_LANDMARKS:face_landmarks"),NW(r,"LEFT_HAND_LANDMARKS:left_hand_landmarks"),NW(r,"LEFT_HAND_WORLD_LANDMARKS:left_hand_world_landmarks"),NW(r,"RIGHT_HAND_LANDMARKS:right_hand_landmarks"),NW(r,"RIGHT_HAND_WORLD_LANDMARKS:right_hand_world_landmarks"),r.o(e),EW(t,r),IV(this,t),this.g.attachProtoListener("pose_landmarks",((t,e)=>{FZ(t,this.h.poseLandmarks),MV(this,e)})),this.g.attachEmptyPacketListener("pose_landmarks",(t=>{MV(this,t)})),this.g.attachProtoListener("pose_world_landmarks",((t,e)=>{var n=this.h.poseWorldLandmarks;t=BW(t),n.push(sV(t)),MV(this,e)})),this.g.attachEmptyPacketListener("pose_world_landmarks",(t=>{MV(this,t)})),this.outputPoseSegmentationMasks&&(NW(r,"POSE_SEGMENTATION_MASK:pose_segmentation_mask"),SV(this,"pose_segmentation_mask"),this.g.V("pose_segmentation_mask",((t,e)=>{this.h.poseSegmentationMasks=[dZ(this,t,true,!this.C)],MV(this,e)})),this.g.attachEmptyPacketListener("pose_segmentation_mask",(t=>{this.h.poseSegmentationMasks=[],MV(this,t)}))),this.g.attachProtoListener("face_landmarks",((t,e)=>{FZ(t,this.h.faceLandmarks),MV(this,e)})),this.g.attachEmptyPacketListener("face_landmarks",(t=>{MV(this,t)})),this.outputFaceBlendshapes&&(kW(t,"extra_blendshapes"),NW(r,"FACE_BLENDSHAPES:extra_blendshapes"),this.g.attachProtoListener("extra_blendshapes",((t,e)=>{var n=this.h.faceBlendshapes;this.outputFaceBlendshapes&&(t=zW(t),n.push(eV(t.g()??[]))),MV(this,e)})),this.g.attachEmptyPacketListener("extra_blendshapes",(t=>{MV(this,t)}))),this.g.attachProtoListener("left_hand_landmarks",((t,e)=>{FZ(t,this.h.leftHandLandmarks),MV(this,e)})),this.g.attachEmptyPacketListener("left_hand_landmarks",(t=>{MV(this,t)})),this.g.attachProtoListener("left_hand_world_landmarks",((t,e)=>{var n=this.h.leftHandWorldLandmarks;t=BW(t),n.push(sV(t)),MV(this,e)})),this.g.attachEmptyPacketListener("left_hand_world_landmarks",(t=>{MV(this,t)})),this.g.attachProtoListener("right_hand_landmarks",((t,e)=>{FZ(t,this.h.rightHandLandmarks),MV(this,e)})),this.g.attachEmptyPacketListener("right_hand_landmarks",(t=>{MV(this,t)})),this.g.attachProtoListener("right_hand_world_landmarks",((t,e)=>{var n=this.h.rightHandWorldLandmarks;t=BW(t),n.push(sV(t)),MV(this,e)})),this.g.attachEmptyPacketListener("right_hand_world_landmarks",(t=>{MV(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),true)}};PZ.prototype.detectForVideo=PZ.prototype.F,PZ.prototype.detect=PZ.prototype.D,PZ.prototype.setOptions=PZ.prototype.o,PZ.createFromModelPath=function(t,e){return uZ(PZ,t,{baseOptions:{modelAssetPath:e}})},PZ.createFromModelBuffer=function(t,e){return uZ(PZ,t,{baseOptions:{modelAssetBuffer:e}})},PZ.createFromOptions=function(t,e){return uZ(PZ,t,e)},PZ.HAND_CONNECTIONS=TZ,PZ.POSE_CONNECTIONS=jZ,PZ.FACE_LANDMARKS_LIPS=yZ,PZ.FACE_LANDMARKS_LEFT_EYE=gZ,PZ.FACE_LANDMARKS_LEFT_EYEBROW=wZ,PZ.FACE_LANDMARKS_LEFT_IRIS=bZ,PZ.FACE_LANDMARKS_RIGHT_EYE=vZ,PZ.FACE_LANDMARKS_RIGHT_EYEBROW=NZ,PZ.FACE_LANDMARKS_RIGHT_IRIS=xZ,PZ.FACE_LANDMARKS_FACE_OVAL=MZ,PZ.FACE_LANDMARKS_CONTOURS=IZ,PZ.FACE_LANDMARKS_TESSELATION=SZ;var BZ=class extends pZ{constructor(t,e){super(new cZ(t,e),"input_image","norm_rect",true),this.j={classifications:[]},GB(t=this.h=new PY,0,1,e=new aY)}get baseOptions(){return FB(this.h,aY,1)}set baseOptions(t){GB(this.h,0,1,t)}o(t){return GB(this.h,0,2,tV(t,FB(this.h,tY,2))),this.l(t)}qa(t,e){return this.j={classifications:[]},lZ(this,t,e),this.j}ra(t,e,n){return this.j={classifications:[]},hZ(this,t,n,e),this.j}m(){var t=new TW;DW(t,"input_image"),DW(t,"norm_rect"),kW(t,"classifications");const e=new yW;IG(e,BY,this.h);const n=new xW;bW(n,"mediapipe.tasks.vision.image_classifier.ImageClassifierGraph"),vW(n,"IMAGE:input_image"),vW(n,"NORM_RECT:norm_rect"),NW(n,"CLASSIFICATIONS:classifications"),n.o(e),EW(t,n),this.g.attachProtoListener("classifications",((t,e)=>{this.j=function(t){const e={classifications:BB(t,ZW,1).map((t=>eV(FB(t,CW,4)?.g()??[],QB(t,2)??0,HB(t,3)??"")))};return null!=PP(bB(t,2))&&(e.timestampMs=PP(bB(t,2))??0),e}(QW(t)),MV(this,e)})),this.g.attachEmptyPacketListener("classifications",(t=>{MV(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),true)}};BZ.prototype.classifyForVideo=BZ.prototype.ra,BZ.prototype.classify=BZ.prototype.qa,BZ.prototype.setOptions=BZ.prototype.o,BZ.createFromModelPath=function(t,e){return uZ(BZ,t,{baseOptions:{modelAssetPath:e}})},BZ.createFromModelBuffer=function(t,e){return uZ(BZ,t,{baseOptions:{modelAssetBuffer:e}})},BZ.createFromOptions=function(t,e){return uZ(BZ,t,e)};var GZ=class extends pZ{constructor(t,e){super(new cZ(t,e),"image_in","norm_rect",true),this.h=new GY,this.embeddings={embeddings:[]},GB(t=this.h,0,1,e=new aY)}get baseOptions(){return FB(this.h,aY,1)}set baseOptions(t){GB(this.h,0,1,t)}o(t){var e=this.h,n=FB(this.h,nY,2);return n=n?n.clone():new nY,void 0!==t.l2Normalize?qB(n,1,t.l2Normalize):"l2Normalize"in t&&NB(n,1),void 0!==t.quantize?qB(n,2,t.quantize):"quantize"in t&&NB(n,2),GB(e,0,2,n),this.l(t)}xa(t,e){return lZ(this,t,e),this.embeddings}ya(t,e,n){return hZ(this,t,n,e),this.embeddings}m(){var t=new TW;DW(t,"image_in"),DW(t,"norm_rect"),kW(t,"embeddings_out");const e=new yW;IG(e,UY,this.h);const n=new xW;bW(n,"mediapipe.tasks.vision.image_embedder.ImageEmbedderGraph"),vW(n,"IMAGE:image_in"),vW(n,"NORM_RECT:norm_rect"),NW(n,"EMBEDDINGS:embeddings_out"),n.o(e),EW(t,n),this.g.attachProtoListener("embeddings_out",((t,e)=>{t=KW(t),this.embeddings=function(t){return{embeddings:BB(t,qW,1).map((t=>{const e={headIndex:QB(t,3)??0??-1,headName:HB(t,4)??""??""};if(void 0!==$B(t,HW,CB(t,1)))t=EB(t=FB(t,HW,CB(t,1)),1,DP,SB()),e.floatEmbedding=t.slice();else{const n=new Uint8Array(0);e.quantizedEmbedding=FB(t,JW,CB(t,2))?.ma()?.h()??n}return e})),timestampMs:PP(bB(t,2))??0}}(t),MV(this,e)})),this.g.attachEmptyPacketListener("embeddings_out",(t=>{MV(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),true)}};GZ.cosineSimilarity=function(t,e){if(t.floatEmbedding&&e.floatEmbedding)t=oV(t.floatEmbedding,e.floatEmbedding);else{if(!t.quantizedEmbedding||!e.quantizedEmbedding)throw Error("Cannot compute cosine similarity between quantized and float embeddings.");t=oV(iV(t.quantizedEmbedding),iV(e.quantizedEmbedding))}return t},GZ.prototype.embedForVideo=GZ.prototype.ya,GZ.prototype.embed=GZ.prototype.xa,GZ.prototype.setOptions=GZ.prototype.o,GZ.createFromModelPath=function(t,e){return uZ(GZ,t,{baseOptions:{modelAssetPath:e}})},GZ.createFromModelBuffer=function(t,e){return uZ(GZ,t,{baseOptions:{modelAssetBuffer:e}})},GZ.createFromOptions=function(t,e){return uZ(GZ,t,e)};var UZ=class{constructor(t,e,n){this.confidenceMasks=t,this.categoryMask=e,this.qualityScores=n}close(){this.confidenceMasks?.forEach((t=>{t.close()})),this.categoryMask?.close()}};function WZ(t){t.categoryMask=void 0,t.confidenceMasks=void 0,t.qualityScores=void 0}function YZ(t){try{const e=new UZ(t.confidenceMasks,t.categoryMask,t.qualityScores);if(!t.j)return e;t.j(e)}finally{EV(t)}}UZ.prototype.close=UZ.prototype.close;var VZ=class extends pZ{constructor(t,e){super(new cZ(t,e),"image_in","norm_rect",false),this.s=[],this.outputCategoryMask=false,this.outputConfidenceMasks=true,this.h=new QY,this.v=new WY,GB(this.h,0,3,this.v),GB(t=this.h,0,1,e=new aY)}get baseOptions(){return FB(this.h,aY,1)}set baseOptions(t){GB(this.h,0,1,t)}o(t){return void 0!==t.displayNamesLocale?NB(this.h,2,UP(t.displayNamesLocale)):"displayNamesLocale"in t&&NB(this.h,2),"outputCategoryMask"in t&&(this.outputCategoryMask=t.outputCategoryMask??false),"outputConfidenceMasks"in t&&(this.outputConfidenceMasks=t.outputConfidenceMasks??true),super.l(t)}J(){!function(t){const e=BB(t.ca(),xW,1).filter((t=>(HB(t,1)??"").includes("mediapipe.tasks.TensorsToSegmentationCalculator")));if(t.s=[],e.length>1)throw Error("The graph has more than one mediapipe.tasks.TensorsToSegmentationCalculator.");1===e.length&&(FB(e[0],yW,7)?.l()?.g()??new Map).forEach(((e,n)=>{t.s[Number(n)]=HB(e,1)??""}))}(this)}segment(t,e,n){const r="function"!=typeof e?e:{};return this.j="function"==typeof e?e:n,WZ(this),lZ(this,t,r),YZ(this)}Ia(t,e,n,r){const s="function"!=typeof n?n:{};return this.j="function"==typeof n?n:r,WZ(this),hZ(this,t,s,e),YZ(this)}Ba(){return this.s}m(){var t=new TW;DW(t,"image_in"),DW(t,"norm_rect");const e=new yW;IG(e,HY,this.h);const n=new xW;bW(n,"mediapipe.tasks.vision.image_segmenter.ImageSegmenterGraph"),vW(n,"IMAGE:image_in"),vW(n,"NORM_RECT:norm_rect"),n.o(e),EW(t,n),IV(this,t),this.outputConfidenceMasks&&(kW(t,"confidence_masks"),NW(n,"CONFIDENCE_MASKS:confidence_masks"),SV(this,"confidence_masks"),this.g.ba("confidence_masks",((t,e)=>{this.confidenceMasks=t.map((t=>dZ(this,t,true,!this.j))),MV(this,e)})),this.g.attachEmptyPacketListener("confidence_masks",(t=>{this.confidenceMasks=[],MV(this,t)}))),this.outputCategoryMask&&(kW(t,"category_mask"),NW(n,"CATEGORY_MASK:category_mask"),SV(this,"category_mask"),this.g.V("category_mask",((t,e)=>{this.categoryMask=dZ(this,t,false,!this.j),MV(this,e)})),this.g.attachEmptyPacketListener("category_mask",(t=>{this.categoryMask=void 0,MV(this,t)}))),kW(t,"quality_scores"),NW(n,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",((t,e)=>{this.qualityScores=t,MV(this,e)})),this.g.attachEmptyPacketListener("quality_scores",(t=>{this.categoryMask=void 0,MV(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),true)}};VZ.prototype.getLabels=VZ.prototype.Ba,VZ.prototype.segmentForVideo=VZ.prototype.Ia,VZ.prototype.segment=VZ.prototype.segment,VZ.prototype.setOptions=VZ.prototype.o,VZ.createFromModelPath=function(t,e){return uZ(VZ,t,{baseOptions:{modelAssetPath:e}})},VZ.createFromModelBuffer=function(t,e){return uZ(VZ,t,{baseOptions:{modelAssetBuffer:e}})},VZ.createFromOptions=function(t,e){return uZ(VZ,t,e)};var ZZ=class{constructor(t,e,n){this.confidenceMasks=t,this.categoryMask=e,this.qualityScores=n}close(){this.confidenceMasks?.forEach((t=>{t.close()})),this.categoryMask?.close()}};ZZ.prototype.close=ZZ.prototype.close;var QZ=class extends SG{constructor(t){super(t)}},HZ=[0,FU,-2],JZ=[0,_U,-3,GU,_U,-1],qZ=[0,JZ],XZ=[0,JZ,FU,-1],KZ=class extends SG{constructor(t){super(t)}},tQ=[0,_U,-1,GU],eQ=class extends SG{constructor(t){super(t)}},nQ=class extends SG{constructor(t){super(t)}},rQ=[1,2,3,4,5,6,7,8,9,10,14,15],sQ=class extends SG{constructor(t){super(t)}};sQ.prototype.g=nW([0,ZU,[0,rQ,QU,JZ,QU,[0,JZ,HZ],QU,qZ,QU,[0,qZ,HZ],QU,tQ,QU,[0,_U,-3,GU,XU],QU,[0,_U,-3,GU],QU,[0,VU,_U,-2,GU,FU,GU,-1,2,_U,HZ],QU,XZ,QU,[0,XZ,HZ],_U,HZ,VU,QU,[0,_U,-3,GU,HZ,-1],QU,[0,ZU,tQ]],VU,[0,VU,FU,-1,GU]]);var iQ=class extends pZ{constructor(t,e){super(new cZ(t,e),"image_in","norm_rect_in",false),this.outputCategoryMask=false,this.outputConfidenceMasks=true,this.h=new QY,this.s=new WY,GB(this.h,0,3,this.s),GB(t=this.h,0,1,e=new aY)}get baseOptions(){return FB(this.h,aY,1)}set baseOptions(t){GB(this.h,0,1,t)}o(t){return"outputCategoryMask"in t&&(this.outputCategoryMask=t.outputCategoryMask??false),"outputConfidenceMasks"in t&&(this.outputConfidenceMasks=t.outputConfidenceMasks??true),super.l(t)}segment(t,e,n,r){const s="function"!=typeof n?n:{};this.j="function"==typeof n?n:r,this.qualityScores=this.categoryMask=this.confidenceMasks=void 0,n=this.B+1,r=new sQ;const i=new nQ;var o=new QZ;if(XB(o,1,255),GB(i,0,12,o),e.keypoint&&e.scribble)throw Error("Cannot provide both keypoint and scribble.");if(e.keypoint){var a=new KZ;qB(a,3,true),KB(a,1,e.keypoint.x),KB(a,2,e.keypoint.y),UB(i,5,rQ,a)}else{if(!e.scribble)throw Error("Must provide either a keypoint or a scribble.");for(a of(o=new eQ,e.scribble))qB(e=new KZ,3,true),KB(e,1,a.x),KB(e,2,a.y),ZB(o,1,KZ,e);UB(i,15,rQ,o)}ZB(r,1,nQ,i),this.g.addProtoToStream(r.g(),"drishti.RenderData","roi_in",n),lZ(this,t,s);t:{try{const t=new ZZ(this.confidenceMasks,this.categoryMask,this.qualityScores);if(!this.j){var c=t;break t}this.j(t)}finally{EV(this)}c=void 0}return c}m(){var t=new TW;DW(t,"image_in"),DW(t,"roi_in"),DW(t,"norm_rect_in");const e=new yW;IG(e,HY,this.h);const n=new xW;bW(n,"mediapipe.tasks.vision.interactive_segmenter.InteractiveSegmenterGraph"),vW(n,"IMAGE:image_in"),vW(n,"ROI:roi_in"),vW(n,"NORM_RECT:norm_rect_in"),n.o(e),EW(t,n),IV(this,t),this.outputConfidenceMasks&&(kW(t,"confidence_masks"),NW(n,"CONFIDENCE_MASKS:confidence_masks"),SV(this,"confidence_masks"),this.g.ba("confidence_masks",((t,e)=>{this.confidenceMasks=t.map((t=>dZ(this,t,true,!this.j))),MV(this,e)})),this.g.attachEmptyPacketListener("confidence_masks",(t=>{this.confidenceMasks=[],MV(this,t)}))),this.outputCategoryMask&&(kW(t,"category_mask"),NW(n,"CATEGORY_MASK:category_mask"),SV(this,"category_mask"),this.g.V("category_mask",((t,e)=>{this.categoryMask=dZ(this,t,false,!this.j),MV(this,e)})),this.g.attachEmptyPacketListener("category_mask",(t=>{this.categoryMask=void 0,MV(this,t)}))),kW(t,"quality_scores"),NW(n,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",((t,e)=>{this.qualityScores=t,MV(this,e)})),this.g.attachEmptyPacketListener("quality_scores",(t=>{this.categoryMask=void 0,MV(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),true)}};iQ.prototype.segment=iQ.prototype.segment,iQ.prototype.setOptions=iQ.prototype.o,iQ.createFromModelPath=function(t,e){return uZ(iQ,t,{baseOptions:{modelAssetPath:e}})},iQ.createFromModelBuffer=function(t,e){return uZ(iQ,t,{baseOptions:{modelAssetBuffer:e}})},iQ.createFromOptions=function(t,e){return uZ(iQ,t,e)};var oQ=class extends pZ{constructor(t,e){super(new cZ(t,e),"input_frame_gpu","norm_rect",false),this.j={detections:[]},GB(t=this.h=new JY,0,1,e=new aY)}get baseOptions(){return FB(this.h,aY,1)}set baseOptions(t){GB(this.h,0,1,t)}o(t){return void 0!==t.displayNamesLocale?NB(this.h,2,UP(t.displayNamesLocale)):"displayNamesLocale"in t&&NB(this.h,2),void 0!==t.maxResults?XB(this.h,3,t.maxResults):"maxResults"in t&&NB(this.h,3),void 0!==t.scoreThreshold?KB(this.h,4,t.scoreThreshold):"scoreThreshold"in t&&NB(this.h,4),void 0!==t.categoryAllowlist?tG(this.h,5,t.categoryAllowlist):"categoryAllowlist"in t&&NB(this.h,5),void 0!==t.categoryDenylist?tG(this.h,6,t.categoryDenylist):"categoryDenylist"in t&&NB(this.h,6),this.l(t)}D(t,e){return this.j={detections:[]},lZ(this,t,e),this.j}F(t,e,n){return this.j={detections:[]},hZ(this,t,n,e),this.j}m(){var t=new TW;DW(t,"input_frame_gpu"),DW(t,"norm_rect"),kW(t,"detections");const e=new yW;IG(e,qY,this.h);const n=new xW;bW(n,"mediapipe.tasks.vision.ObjectDetectorGraph"),vW(n,"IMAGE:input_frame_gpu"),vW(n,"NORM_RECT:norm_rect"),NW(n,"DETECTIONS:detections"),n.o(e),EW(t,n),this.g.attachProtoVectorListener("detections",((t,e)=>{for(const e of t)t=FW(e),this.j.detections.push(nV(t));MV(this,e)})),this.g.attachEmptyPacketListener("detections",(t=>{MV(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),true)}};oQ.prototype.detectForVideo=oQ.prototype.F,oQ.prototype.detect=oQ.prototype.D,oQ.prototype.setOptions=oQ.prototype.o,oQ.createFromModelPath=async function(t,e){return uZ(oQ,t,{baseOptions:{modelAssetPath:e}})},oQ.createFromModelBuffer=function(t,e){return uZ(oQ,t,{baseOptions:{modelAssetBuffer:e}})},oQ.createFromOptions=function(t,e){return uZ(oQ,t,e)};var aQ=class{constructor(t,e,n){this.landmarks=t,this.worldLandmarks=e,this.segmentationMasks=n}close(){this.segmentationMasks?.forEach((t=>{t.close()}))}};function cQ(t){t.landmarks=[],t.worldLandmarks=[],t.segmentationMasks=void 0}function uQ(t){try{const e=new aQ(t.landmarks,t.worldLandmarks,t.segmentationMasks);if(!t.s)return e;t.s(e)}finally{EV(t)}}aQ.prototype.close=aQ.prototype.close;var fQ=class extends pZ{constructor(t,e){super(new cZ(t,e),"image_in","norm_rect",false),this.landmarks=[],this.worldLandmarks=[],this.outputSegmentationMasks=false,GB(t=this.h=new XY,0,1,e=new aY),this.v=new jY,GB(this.h,0,3,this.v),this.j=new zY,GB(this.h,0,2,this.j),XB(this.j,4,1),KB(this.j,2,.5),KB(this.v,2,.5),KB(this.h,4,.5)}get baseOptions(){return FB(this.h,aY,1)}set baseOptions(t){GB(this.h,0,1,t)}o(t){return"numPoses"in t&&XB(this.j,4,t.numPoses??1),"minPoseDetectionConfidence"in t&&KB(this.j,2,t.minPoseDetectionConfidence??.5),"minTrackingConfidence"in t&&KB(this.h,4,t.minTrackingConfidence??.5),"minPosePresenceConfidence"in t&&KB(this.v,2,t.minPosePresenceConfidence??.5),"outputSegmentationMasks"in t&&(this.outputSegmentationMasks=t.outputSegmentationMasks??false),this.l(t)}D(t,e,n){const r="function"!=typeof e?e:{};return this.s="function"==typeof e?e:n,cQ(this),lZ(this,t,r),uQ(this)}F(t,e,n,r){const s="function"!=typeof n?n:{};return this.s="function"==typeof n?n:r,cQ(this),hZ(this,t,s,e),uQ(this)}m(){var t=new TW;DW(t,"image_in"),DW(t,"norm_rect"),kW(t,"normalized_landmarks"),kW(t,"world_landmarks"),kW(t,"segmentation_masks");const e=new yW;IG(e,KY,this.h);const n=new xW;bW(n,"mediapipe.tasks.vision.pose_landmarker.PoseLandmarkerGraph"),vW(n,"IMAGE:image_in"),vW(n,"NORM_RECT:norm_rect"),NW(n,"NORM_LANDMARKS:normalized_landmarks"),NW(n,"WORLD_LANDMARKS:world_landmarks"),n.o(e),EW(t,n),IV(this,t),this.g.attachProtoVectorListener("normalized_landmarks",((t,e)=>{this.landmarks=[];for(const e of t)t=UW(e),this.landmarks.push(rV(t));MV(this,e)})),this.g.attachEmptyPacketListener("normalized_landmarks",(t=>{this.landmarks=[],MV(this,t)})),this.g.attachProtoVectorListener("world_landmarks",((t,e)=>{this.worldLandmarks=[];for(const e of t)t=BW(e),this.worldLandmarks.push(sV(t));MV(this,e)})),this.g.attachEmptyPacketListener("world_landmarks",(t=>{this.worldLandmarks=[],MV(this,t)})),this.outputSegmentationMasks&&(NW(n,"SEGMENTATION_MASK:segmentation_masks"),SV(this,"segmentation_masks"),this.g.ba("segmentation_masks",((t,e)=>{this.segmentationMasks=t.map((t=>dZ(this,t,true,!this.s))),MV(this,e)})),this.g.attachEmptyPacketListener("segmentation_masks",(t=>{this.segmentationMasks=[],MV(this,t)}))),t=t.g(),this.setGraph(new Uint8Array(t),true)}};fQ.prototype.detectForVideo=fQ.prototype.F,fQ.prototype.detect=fQ.prototype.D,fQ.prototype.setOptions=fQ.prototype.o,fQ.createFromModelPath=function(t,e){return uZ(fQ,t,{baseOptions:{modelAssetPath:e}})},fQ.createFromModelBuffer=function(t,e){return uZ(fQ,t,{baseOptions:{modelAssetBuffer:e}})},fQ.createFromOptions=function(t,e){return uZ(fQ,t,e)},fQ.POSE_CONNECTIONS=jZ;const lQ=".camera{color:white;display:flex;align-items:center;justify-content:center;position:relative}.cameraCanvas,.cameraCanvasSelfie,.cameraCanvasSelfieDesk{z-index:3;max-width:100%;max-height:100%;border-radius:10px}.cameraVideo,.cameraVideoSelfie,.cameraVideoSelfieDesk{z-index:2;position:absolute;max-width:100%;max-height:100%;border-radius:10px}.cameraVideoSelfie,.cameraVideoSelfieDesk{transform:scale(-1, 1);-webkit-transform:scale(-1, 1)}:host{display:block;font-family:sans-serif;text-align:center}.video-container{position:relative;width:100%;max-width:640px;margin:0 auto}#webcam{width:100%;height:auto;transform:scaleX(-1);}#outputCanvas{position:absolute;top:0;left:0;width:100%;height:100%;transform:scaleX(-1);}img{max-width:100%;margin-top:20px;border:1px solid #ddd}";var hQ;(function(t){t["JPEG"]="image/jpeg";t["PNG"]="image/png"})(hQ||(hQ={}));const dQ=class{constructor(n){t(this,n);this.eventRecordingIdReady=e(this,"recordingIdCapture");this.eventPhotoCapture=e(this,"photoSelfieCapture");this.apiErrorEvent=e(this,"apiError");this.eventTimeElapsed=e(this,"timeElapsed");this.mediaStream=null;this.mediaRecorder=null;this.isRecording=false;this.recordedChunks=[];this.capturedImage=null;this.faceDetector=null;this.hasFace=false;this.isDetecting=false;this.modelPath="https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@latest/wasm";this.minDetectionConfidence=.5;this.startDetection=()=>{if(this.faceDetector&&this.videoElement&&!this.isDetecting){this.isDetecting=true;this.detectFacesInRealTime()}};this.stopDetection=()=>{this.isDetecting=false};this.detectFacesInRealTime=async()=>{if(!this.isDetecting||!this.faceDetector||!this.videoElement||this.videoElement.paused||this.videoElement.ended){return}this.canvasElement.width=this.videoElement.videoWidth;this.canvasElement.height=this.videoElement.videoHeight;let t=performance.now();const e=this.faceDetector.detectForVideo(this.videoElement,t);this.drawResults(e.detections);if(e.detections&&e.detections.length>0){this.hasFace=true;this.captureImage()}else{this.hasFace=false}requestAnimationFrame(this.detectFacesInRealTime)};this.startRecording=()=>{if(this.mediaStream&&this.videoElement){this.recordedChunks=[];var t={mimeType:p.webmMimeType.mime,videoBitsPerSecond:13e5};if(!MediaRecorder.isTypeSupported(t.mimeType)){if(o.device.mobileOS==g.iOS||o.device.browser==v.Safari)t.mimeType=p.mp4MimeType.mime}this.mediaRecorder=new MediaRecorder(this.mediaStream,{mimeType:"video/webm"});this.mediaRecorder.ondataavailable=({data:t})=>{if(t.size>0){this.recordedChunks=[...this.recordedChunks,t]}};this.mediaRecorder.onstop=()=>{if(this.recordedChunks.length>0){var e=new Blob(this.recordedChunks,{type:t.mimeType.split(";")[0]});this.eventRecordingIdReady.emit(e)}};this.mediaRecorder.start();this.isRecording=true;console.log("Recording started...")}};this.stopRecording=()=>{if(this.mediaRecorder&&this.mediaRecorder.state==="recording"){this.mediaRecorder.stop();this.isRecording=false;console.log("Recording stopped.")}};this.captureImage=()=>{if(this.hasFace&&this.canvasElement){const t=this.videoElement;const e=this.canvasElement;const n=e.getContext("2d");e.width=t.videoWidth;e.height=t.videoHeight;n.drawImage(t,0,0,e.width,e.height);e.toBlob((t=>{if(t&&t.type===hQ.JPEG&&!o.device.isAppleDevice){try{if(o.debug)console.log("stream | getFrame | addExifInImg");N(t,this.mediaStream.getTracks()[0],{width:this.videoElement.videoWidth,height:this.videoElement.videoHeight}).then((t=>{this.eventPhotoCapture.emit(t)}))}catch(e){this.eventTimeElapsed.emit();this.eventPhotoCapture.emit(t)}}else{if(o.debug)console.log("stream | getFrame | resolve");this.eventPhotoCapture.emit(t)}}),hQ.PNG,1);this.stopRecording();console.log("Image captured!")}else{console.log("No face detected or canvas not ready. Cannot capture image.")}}}infoTimeElapsed(){this.titleMesage=this.translations.SelfieCaptureValues.TitleMore;this.titleStyle+=" pulsate"}async componentWillLoad(){this.translations=await m.getValues();if(!navigator.mediaDevices){this.apiErrorEvent.emit({message:"This browser does not support webRTC"})}this.titleStyle="text-center px-1 mb-2";await this.setupMediaPipe()}async componentDidLoad(){if(o.flowStatus==a.LIVENESS){this.titleMesage=this.translations.SelfieCaptureValues.Title}if(!this.videoElement||!this.canvasElement||!this.canvasCtx){console.error("Canvas or video element not found.");return}await this.startWebcam()}async startWebcam(){try{const t=p.GetConstraints("",o.device,true);if(o.device.isAppleDevice){navigator.audioSession.type="play-and-record"}const e=await navigator.mediaDevices.getUserMedia(t);this.videoElement.srcObject=e;this.videoElement.addEventListener("loadeddata",(()=>{this.videoElement.play();this.startDetection();this.startRecording()}))}catch(t){console.error("Error accessing webcam:",t);alert("Could not access webcam. Please ensure you have a camera and grant permissions.")}}async setupMediaPipe(){try{const t=await lV.forVisionTasks(this.modelPath);this.faceDetector=await mZ.createFromOptions(t,{baseOptions:{modelAssetPath:"https://storage.googleapis.com/mediapipe-models/face_detector/blaze_face_short_range/float16/1/blaze_face_short_range.tflite"},runningMode:"VIDEO",minDetectionConfidence:this.minDetectionConfidence});console.log("MediaPipe Face Detector loaded.")}catch(t){console.error("Error loading MediaPipe Face Detector:",t)}}disconnectedCallback(){if(this.mediaRecorder){this.mediaRecorder.stop();this.mediaRecorder=null}if(this.mediaStream){this.mediaStream.getTracks().forEach((t=>t.stop()));this.mediaStream=null}if(this.videoElement){this.videoElement.srcObject=null}}drawResults(t){this.canvasCtx.save();this.canvasCtx.clearRect(0,0,this.canvasElement.width,this.canvasElement.height);this.canvasCtx.drawImage(this.videoElement,0,0,this.canvasElement.width,this.canvasElement.height);for(const e of t){const t=e.boundingBox;this.canvasCtx.strokeStyle="red";this.canvasCtx.lineWidth=2;this.canvasCtx.strokeRect(t.originX,t.originY,t.width,t.height);if(e.keypoints){for(const t of e.keypoints){this.canvasCtx.beginPath();this.canvasCtx.arc(t.x,t.y,5,0,2*Math.PI);this.canvasCtx.fillStyle="blue";this.canvasCtx.fill()}}}this.canvasCtx.restore()}render(){let t;if(o.device.isMobile&&this.videoStarted){if(o.debug)console.log(this.captureWidth,this.captureHeight);t={width:this.captureWidth+"px",height:this.captureHeight+"px",overflow:"hidden",borderRadius:"10px","text-align":"center",margin:"auto"}}return n("div",{key:"2634f5b4ec75c31dafe88f31e02c78d2acf08d5b",class:"container flex center"},n("div",{key:"571cbfc2bb8d521327bcb4eca1fa0178663c65f9",class:"px-2 w-100"},n("h1",{key:"ac81bc49b503f72406bd4d01a4f6a9a75ac99f9c",class:this.titleStyle,innerHTML:this.titleMesage}),n("div",{key:"d024615d47d124c94c551b11b2e0a87de28c5390",style:t},n("div",{key:"2f15539e0e1dc71554cf32e0ac6663a7d4d4645a",class:"bg-black w-100 h-100 rounded"},n("div",{key:"a58987ce39905e9d6b248aa2169bfbbc0367d859",class:"camera rounded"},n("video",{key:"bf264224feb0ebbdc319a7535b50062fff49ec69",id:"video",loop:true,autoplay:true,playsinline:true,muted:true,class:"cameraVideoSelfie",ref:t=>this.videoElement=t}),n("canvas",{key:"015e5c7d1ee741ed78f24012a89d8533515b43ff",id:"output",class:"cameraCanvasSelfie",ref:t=>this.canvasElement=t})))),n("div",{key:"0916a7e0584ad2f2509d8e8dab7d25437f4eaed1",class:"footer text-center"},n("img",{key:"ea23dd18279534c4710e718a97d9d71b2345ae60",src:y}))))}get component(){return r(this)}};dQ.style=lQ;const pQ="";const mQ=class{constructor(n){t(this,n);this.apiErrorEvent=e(this,"apiError");this.canSend=false;this.sending=false;this.hasError=false}async doAction(){if(this.sending)return;this.sending=true;this.canSend=false;try{var t=await i.instance.CheckOTPCode(o.requestId,this.code);o.flowStatus=a[t.state];if(o.flowStatus==a.CODEERROR)this.hasError=true;this.sending=false;this.code=""}catch(t){this.apiErrorEvent.emit(t)}}async disconnectedCallback(){await h.finalize(s.OtpCheck)}async componentWillLoad(){if(o.flowStatus==a.CODEERROR)this.hasError=true}async componentWillRender(){this.translations=await m.getValues();this.title=this.translations.CodeValidationValues.Title;this.details=this.translations.CodeValidationValues.Description;this.buttonText=this.translations.CodeValidationValues.Button}async componentDidLoad(){await h.initialize(s.OtpCheck)}handleChangeCode(t){let e=t.target?t.target.value:"";this.code=e;if(this.code.length>4)this.code=this.code.substring(0,4);this.canSend=this.code.length==4;t.target.value=this.code;this.hasError=false}render(){return n("div",{key:"2fe8cff98fd2a0fbcd2a7498e4801769207505dd",class:"container flex center"},n("div",{key:"aabb1a8ad5f18d9f755d8614fe205a4048f04c86",class:"px-1 w-100"},this.hasError?n("div",null,n("div",{class:"mb-1 ml-1 text-center"},n("img",{src:q,style:{width:"60px"}})),n("h1",{class:"text-center color-red px-1 mb-2"},this.translations.CodeValidationValues.Error)):n("div",null,n("div",{class:"mb-1 ml-1 text-center"},n("img",{src:zE,style:{width:"60px"}})),n("h1",{class:"text-center px-1 mb-2"},this.title)),n("p",{key:"9e3e483eff8a731fc45bb158279d8e3cfa5d7477",class:"text-center mb-05"},this.details),n("div",{key:"ce2ea970167a7513dcc9730af260b2126f897e01",class:"mb-2"},n("input",{key:"cf30cfa8e66874589f738157af82cd7dfe3c1453",placeholder:"XXXX",type:"tel",id:"codeInput",class:"main-input",onInput:t=>this.handleChangeCode(t),value:this.code})),n("div",{key:"5fec30a204ea531b65c1ae602f22d045760f7322",class:"button flex mb-1 mx-3"},this.sending?n("div",{class:"img-loader rounded img-loader-button"},n("img",{class:"loading-image loading-image-button",src:R})):null,n("button",{key:"494622f358c4198515c8bde477f31ec89d47a135",id:"action",disabled:!this.canSend,class:"main-button",onClick:()=>this.doAction()},this.buttonText)),n("div",{key:"8adf4d094db9cd0be96a8fe8bb64322650c3c151",class:"footer text-center"},n("img",{key:"dd5591a9dfff0451539156c11d4c59f8ae70c9e1",src:y}))))}};mQ.style=pQ;const yQ="";const gQ=class{constructor(n){t(this,n);this.apiErrorEvent=e(this,"apiError");this.prefilledPhone=false;this.canSend=false;this.sending=false}async doAction(){if(this.sending)return;this.sending=true;try{this.canSend=false;var t=await i.instance.SendOTPCode(o.requestId,this.phoneNumber);if(t.sent===true){await this.setPhoneNumber();o.flowStatus=a[t.state]}}catch(t){this.apiErrorEvent.emit(t)}}async setPhoneNumber(){var t=await c.ectdata.get(o.requestId);t.phoneNumber=this.phoneNumber;await c.ectdata.put(t)}async disconnectedCallback(){await h.finalize(s.OtpSend)}async componentWillRender(){this.translations=await m.getValues();this.buttonText=this.translations.PhoneValidationValues.Button;this.title=this.translations.PhoneValidationValues.Title;this.details=this.translations.PhoneValidationValues.Description;if(o.phoneNumber&&o.phoneNumber!=""){this.phoneNumber=o.phoneNumber;this.prefilledPhone=true;this.canSend=true}}async componentDidLoad(){await h.initialize(s.OtpSend)}handleChangePhone(t){let e=t.target?t.target.value:"";this.phoneNumber=e.replace(/\D/g,"");if(this.phoneNumber.length>10)this.phoneNumber=this.phoneNumber.substring(0,10);this.canSend=this.phoneNumber.length==10;t.target.value=this.phoneNumber}render(){return n("div",{key:"7f46af5c8178ae10afa7fe70e0076b7d0feebf07",class:"container flex center"},n("div",{key:"6a36664ff6af3493d6b14777029769c0177f0baa",class:"px-1"},n("div",{key:"973323a7b7463a3af1db141a4690b9d398f66fd4",class:"mb-1 ml-1 text-center"},n("img",{key:"75e82451cb37da1c2a7e9024179b36fce851fec7",src:zE,style:{width:"60px"}})),n("h1",{key:"133a1dc32fe0d8b305ff3ade31a150f63ddbca38",class:"text-center px-1 mb-2"},this.title),n("p",{key:"257349a5c1b7c0d26865097eafa089dd8e0aa0de",class:"text-center mb-05"},this.details),n("div",{key:"9d359fc605eb53943d7dee1690371b457bfbd3a9",class:"mb-2"},n("input",{key:"422ae164a696d899f91a81b11dc2a499ca429795",placeholder:this.translations.PhoneValidationValues.Label,type:"tel",id:"phoneInput",class:"main-input",disabled:this.prefilledPhone,onInput:t=>this.handleChangePhone(t),value:this.phoneNumber})),n("div",{key:"557c4fe84f7a55f5ee4ccab5673d5f5529b15b1c",class:"button flex mb-1 mx-3"},this.sending?n("div",{class:"img-loader rounded img-loader-button"},n("img",{class:"loading-image loading-image-button",src:R})):null,n("button",{key:"dc642c231cd113034cfb3c5a146e13158521e4a2",id:"action",disabled:!this.canSend,class:"main-button",onClick:()=>this.doAction()},this.buttonText)),n("div",{key:"c7cea421d46d5058329b76e6eb55d4225a03b12f",class:"footer text-center"},n("img",{key:"4484642f6d38c54e8166c7b8841ee8b481746960",src:y}))))}};gQ.style=yQ;const wQ="";const bQ=class{constructor(e){t(this,e)}async componentWillLoad(){o.flowStatus=await i.instance.GetNextFlowState()}render(){return n("div",{key:"78aab7e9727391cb47dbf359d66ed18ae527109a",class:"container"},n("div",{key:"5416c6d69b1de135427829a690088df4dc56e836",class:"row"},n("div",{key:"6b0f8550cb66a0bfc25d01791ae5ebb52661d049",class:"div-ci align-center"},n("img",{key:"b84caa6615b4c8e1d3c08b90a452675974f51fd5",src:R}))))}};bQ.style=wQ;const vQ=class{constructor(e){t(this,e)}async componentWillLoad(){this.translations=await m.getValues()}render(){return n("div",{key:"6d1c61638cb3c71864267f1c3c5aaf6455cea582",class:"container flex center"},n("div",{key:"b0e69e3700e9fa0f9adcf829eaab4d5bb673a695",class:"px-2 w-100"},n("h1",{key:"b310b03e46d27453ec1efd54d5855f732d6df583",class:"text-center px-1 mb-2",innerHTML:this.type=="id"?this.translations.IdCaptureValues.Loading:this.translations.SelfieCaptureValues.Loading}),n("img",{key:"b214023fa0d748905dabb71b3bddd72d827e454c",class:"w-100",src:"https://ekyc.blob.core.windows.net/$web/"+(this.type=="id"?"uploading_id.gif":"uploading_selfie.gif")}),n("div",{key:"32fb07ebddc42c3a572725ac5bad924ce9ac20bb",class:"footer text-center"},n("img",{key:"7ae1e0bc6ee35368eda6429964af5f0300560eec",src:y}))))}};const NQ="";const xQ=class{constructor(n){t(this,n);this.apiErrorEvent=e(this,"apiError");this.uploading=false;this.recordingResultCount=0;this.recordingRetryCount=0;this.appInsights=M.getInstance()}async componentDidLoad(){}componentWillLoad(){this.appInsights.trackEvent("UserLiveness | init",{requestId:o.requestId});if(this.mode=="selfie"){this.currentStep=s.Selfie;this.flow={fileName:"selfie.png",recName:"selfieVideo.",photoType:E$.Selfie,recType:E$.SelfieVideo,imageSize:0,videoSize:0}}else if(this.mode=="selfieGesture"){this.currentStep=s.SelfieTilt;this.flow={fileName:"",recName:"selfieTiltVideo.",photoType:E$.None,recType:E$.SelfieGestureVideo,imageSize:0,videoSize:0}}}timeElapsed(){this.errorReason="Timeout";this.showTimeout=true}captureErrorDone(){if(this.showTimeout==true){this.showTimeout=false}if(this.showError==true){this.showError=false}}async captureSelfieImage(t){if(o.flowStatus==a.LIVENESSGESTURE)return;let e=t.detail;if(e.size==0){await i.instance.AddLog({message:"Empty selfie",blobData:e},await D());this.triggerErrorFlow();return}try{var n=new File([e],this.flow.fileName,{type:"image/png"});let t=await T(n);this.flow.imageSize=A(t);this.uploading=true;let r=await i.instance.UploadFileForRequestB64(o.requestId,this.flow.photoType,t);if(r.isValid){o.flowStatus=a[r.state]}else{this.triggerErrorFlow()}this.uploading=false}catch(t){this.apiErrorEvent.emit(t)}}async capturedSelfieRecording(t){let e=t.detail;if(e.size==0&&this.recordingResultCount==0){this.recordingResultCount++;return}this.recordingResultCount=0;if(e.size==0){await i.instance.AddLog({message:"Empty recording",blobData:e},await D());this.triggerErrorFlow();return}let n=e.type==S.mp4MimeType.type?S.mp4MimeType:S.webmMimeType;try{let t=new File([e],this.flow.recName+n.extension,{type:n.type});let r=await T(t);this.flow.videoSize=A(r);let s=await i.instance.UploadFileForRequestB64(o.requestId,this.flow.recType,r);if(s.saved){o.flowStatus=a[s.state]}else{this.triggerErrorFlow()}}catch(t){if(this.recordingRetryCount<3){this.recordingRetryCount++;this.triggerErrorFlow()}else{this.apiErrorEvent.emit(t)}}}async verificationFinished(){if(o.debug)console.log("user-liveness | verificationFinished");this.verificationReceived=Date.now();while(Date.now()-this.verificationReceived<9e4){await E(2e3);if(this.showError||this.showTimeout)return}this.triggerUploadFailedFlow();if(o.debug)console.log("user-liveness | verificationFinished | waitingFinished ")}triggerUploadFailedFlow(){this.errorReason="Upload Failed";this.showError=true}async disconnectedCallback(){await h.finalize(this.currentStep)}triggerErrorFlow(){this.errorReason="Invalid";this.showError=true}render(){let t=n("selfie-auto-capture",null);let e=n("capture-error",{type:"LIVENESS",reason:this.errorReason,error:`image: ${this.flow.imageSize}mb video: ${this.flow.videoSize}mb`});let r=n("uploading-data",{type:"id"});if(this.uploading)return r;if(this.showError||this.showTimeout)return e;return t}};xQ.style=NQ;export{O as agreement_info,j as agreement_view,G as camera_error,V as capture_error,Q as citizenship_selection,J as end_redirect,K as error_end,et as how_to_info,EE as id_auto_capture,TE as id_selection,OE as identification_component,RE as landing_validation,S$ as mobile_redirect,k$ as process_id,A$ as random_action,dQ as selfie_auto_capture,mQ as sms_code_validation,gQ as sms_send,bQ as state_transition,vQ as uploading_data,xQ as user_liveness};
|
|
5932
|
-
//# sourceMappingURL=p-
|
|
5932
|
+
//# sourceMappingURL=p-b4279bab.entry.js.map
|